* Style mobile qty selector
* Add dedicated column for image and remove duplicate elements
* Tweak column headers
* Refactor cart styles to use CSS grid, and use nesting for organisation
* adjust column widths
* Remove unused div
* Fix wrapping and flexbox styles
* Add decodeEntities to alt attribute
* Use % basis
* Tweak min widths
* Create initial CountryInput component
* Create ShippingCountryInput
* Create BillingCountryInput
* Make backgrounds white
* Correctly align options
* Add CSS resets for 20xy themes
* Fix wrong defaults in countries constants
* Make CountryInput respect 'prefers-reduced-motion'
* Reverse prefers-reduced-motion check
* Set max-width to CountryInput dropdown
* Use decodeEntities to print country names
* Avoid unnecessary JSON enconding and later parsing
* Make sure country name is also encoded when selected
* Fix countries default value
* correct typography styles for remove link (based on design)
* add trashcan icon from material icons, for removing cart items on mobile
* add & style trash icon for remove cart item on mobile
* a11y - use darker grey for trashcan icon button to improve contrast
* rename IconDelete -> IconTrash
* remove unnecessary div
* use <button> for remove action buttons + add link-button scss mixin
* fix editor styles for cart line items - total column should be right-aligned
* fix various visual issues with cart line items table in editor:
- rows should align hard left and right (first/last child no padding)
- totals should be align-bottom on small screen
- correct vertical padding on column headings
- re-add row border separator lines
* Add schema validation helper
* Add tests for cart item schema
* Fix schema errors found by tests
* Add tests and fix validation for remaining store API endpoints
* Tweak response for nested diffs
* Array syntax
* Improved nesting and type validation for schema
* Implement and fix type checking across test suite
* Type validation fixes
* Fix null comparison
* Fix array handling
* Switch to number type and support in validation
* Test the tests
* Update tests to use objects which match schema, avoiding JSON encode/decode
* add product short description to cart/items api
* leave short description as plain text + use default trim length (200)
* strip html and shortcodes from product short description
* limit cart line item short description to max 75 chars
* add normalize_whitespace to trim extra newlines in short description
* retrieve product description & truncate consistent with products API
* View switcher on cart block
* Dedicated component and styling
* Views and selected should be required
* Rename to ViewSwitcher
* Implement views via render prop
* Remove defaults for required props
* show discount on cart line items (no styling)
* style line item discount badge + use correct colors for prices
* show full price inline on mobile
* move all responsive tweaks for cart prices to explicit breakpoints
* add nowrap to FormattedMoneyAmount so prices don't ever wrap
* fix misaligned full price on mobile when prices are large (edge case):
- if price strings are long, the full price stacks above line total
- previous right-margin on full price showed prices misaligned
* allow client code to add class(es) to FormattedMonetaryAmount
* add nowrap so discount badge doesn't wrap
* remove unnecessary span from discount badge +
+ more explicit `display` style for different price column elements
* show product variation attributes in cart line item + styling:
+ adjust font sizes & colors to match design
* show product description in cart line items…
- this commit also adds descriptions to test cart-items data
- note API does not currently return description/excerpt
* add a class to product attributes to allow custom styling
The changelog script now has the following:
- constructed more modularly for easier maintenance.
- removed coupling to blocks repository so it can be used in more contexts (potentially publishing as it's own package).
- switched to use github v4 api (graphql) to reduce number of requests (reducing the likelihood of hitting api limits)
- added support for zenhub releases instead of github milestones for what pulls to derive changelog from.
* Add Cart totals to Cart block
* Accessibility improvements
* Load vendors styles separately
* Use same shipping placeholders for cart and checkout
* Refactor how we import @wordpress/components styles so only panel styles are imported
* Remove style-loader from vendors styles build process
* Add htmlFor attribute to TotalsCouponCodeInput
* Update totalItems shape to match API
* Fix wrong total items shape using numbers instead of strings
* Rename wc-blocks classes to wc-block
* Remove unnecessary parseInt()
* Add radix to parseInt()
* Rename totalRows to totalRowsConfig
* Move placeholder content out of the component
* Use Card component for cart's sidebar (https://github.com/woocommerce/woocommerce-blocks/pull/1423)
* Use Card component for cart's sidebar
* Split RadioControl component
* No need to use Label in RadioControlOption
* Remove no longer valid @todo comment
* Use 'checked' prop instead of 'selected' in RadioControlOption
* Rename wc-blocks classes to wc-block
* Rename wc-blocks classes to wc-block (II)
* Make sure radio control ids are unique using withComponentId
* Load PanelBody and PanelRow from last version of @wordpress/components
* Create vendors-frontend.js file
* Load wordpress-component instead of @wordpress/components from <Button> component
* Only load 'withRestApiHydration' HOC
* Make vendors-frontend a dependency of cart-frontend script
* Revert "Only load 'withRestApiHydration' HOC"
This reverts commit 9f9b9759a98047b26e7d8f04189ffe78c1d5bb06.
* Fix fieldset background
* Checkout/order WIP schema
* Add _address suffix for billing/shipping
* Rename schema, update endpoints, create tests
* Fix POST in test
* Fix test response checks
* Stock reservation and draft order status
* Add todo for shipping lines
* Readme
* Rename address fields in readme
* 10 min timeout of stock
* Fix broken test
* Update src/RestApi/StoreApi/Controllers/CartOrder.php
Co-Authored-By: Darren Ethier <darren@roughsmootheng.in>
* Add typehinting where possible
* Remove explicit pass by reference
* Further typehinting
* Clarify todo comment
* Validate product instances
* Specific phpcs exclusion rule
* Exclusion rule
* Move ReserveStock code to class
* Correct shipping-rates schema to shipping_rates
* Save shipping rates and lines if included with request
* Insert todo for shipping rate code
* Calculate shipping and selected shipping from order properties, not global cart properties
* Prevent error when shipping is not needed
* Update API readme
* Added tests for stock reserve class
* Fixes conflicts with draft statuses
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
* render block on front end, add `Shopping cart` heading (baby steps)
* fake data for editing full cart + show line count in header
* add note about core/html using `is-active` class for toggle state
* reinstate work-in-progress full cart component (lost in rebase)
* reinstate full cart from master
* component for full cart title & item count + margin tweaks:
- add margin between main cart & sidebar
- add margin after cart block
* add cart items sample data + factor sample product image to module
* use sample cart data for item count
* basic table of cart line items (no styling)
* prettification
* show images for cart line items + initial table styling
* cart quantity selector component (work in progress)
* use state for cart product quantity, allow incr/decr from UI (WIP)
* replace WIP custom quantity control with number edit (temporary)
* correctly format cart line item total price
* align cart item columns with headings + indent image on desktop
* tweak css for cart line item padding on mobile so it's more explicit
* show cart line item full price if discounted
* add placeholder for cart remove item link
* switch cart table to flex layout (was table)…
This will allow us to move things around for mobile/responsive layout.
* only show cart items table header on desktop
* more cart items styling - row borders, appropriate padding +
+ move image width to variable
+ fix class name plurality for row (item not items)
* use standard $gap instead of 1em for padding/margins
* responsive (mobile) layout for cart line items:
- shift line $ total to bottom right
- stack quantity selector in product info column
* remove extraneous cart table padding on mobile
* comment about unused styles for quantity selector component
* add follow up issue for todo
* remove inappropriate href
* render srcset & sizes for cart line item product image
* remove todo comment
* switch back to table markup for cart items (in progress):
- table is more semantic, associates headers with columns
* cart line items column widths - product column is larger (60%)
* reinstate table row borders
* bottom-align line item price on mobile
* cart contents heading should be H2 + prettify
* remove unused QuantitySelector code/styles, rename main class in line with BEM
* defaults for QuantitySelector props
* variable/property name tidies - match conventions/API
* fix bug: line total price is only bottom-align on small screen
* move QuantitySelector to root of components, intended to be generally useful
* use lineItem directly for cart, specify shape in PropTypes
* rename cart components to align with "line item" rather than "product"
* rejig class names to better align with new component names & BEM style
* show cart item image correct size:
- use single column for product image and info, with flex container
- specify image width (rem instead of px)
* fix safari issue - cart product images displaying vertically stretched
* shift product name left margin from image, to account for no-image case
* experiment: bump bundlewatch size limit for cart temporarily:
- our fake data inline image is heavy
- when we switch to real API we will no longer need it
* fix issue introduced when moving margin from image to details div:
- product details needs margin on left (not right)
* fix react props issues:
- explicitly destructure image props for srcSet (vs srcset)
- use API key field for line item key instead of id, fix duplicate test id
- CartLineItemsTable takes an array of lineItems (incorrect PropTypes)
* remove redundant divs + use conventional `null` (when no full price)
* override editor styles to ensure cart product image is correct size
* move cart items editor style override to editor.css
* add an explicit readable heading for cart heading to match visual layout
* Set default value to TextInput component
* Set TextInput label transition origin
* Set default onChange function prop to noop
* Fix wrong propType name
* Remove default onChange and set it required