Commit Graph

125 Commits

Author SHA1 Message Date
Sam Seay ed483ab43d Refactor <List> to support custom markup (https://github.com/woocommerce/woocommerce-admin/pull/6787)
* Create the new experimental list, default to rendering it when items are not supplied.

* Remove typings from the List, ListItem.

* Add react-transition-group as dependency.

* Fix warnings by wrapping with CSS transition, pass down props from List.

* Remove type annotations left in list-item.

* Duplicate some styles in the higher level woocommerce-list-item element, to make them work in the new list.

* Fix accessibility issues, adjust the role logic

* Add more testing of the roles logic.

* Mark the old list stories as deprecated, add a basic story for the new style.

* Expose ListItem without Experimental in the name.

* Remove some redundant code changes.

* Fix linting issues

* Add types package.

* Cast the type of children to TransitionGroup.

* Adjust the list to assume a purpose of being a list of links.

* Adjust the tests for the new behaviour.

* Fix css mangled by prettier.

* Fix types that are optional.

* Rework the list item.

* Export new list as experimental, fix accessibility styles and deprecation notice.

* Make the basic transition opt-in.

* Update classnames to get types.

* Add tests, adjust behaviour for css disable.

* Fix css lint, remove types/classnames, update tetsing-library/user-event.

* Fix the basic story for ExperimentalList.

* Conditionally add keyDown and role based on onClick handler. Adjust tests to new behaviour.

* tabIndex only on hasAction

* Update the package-lock

* Add changelog

* Fix transition styling

Co-authored-by: Paul Sealock <psealock@gmail.com>
Co-authored-by: Lourens Schep <lourensschep@gmail.com>
2021-04-23 15:47:43 -03:00
louwie17 7859e37221 Making experimental package public and updating its dependency versions (https://github.com/woocommerce/woocommerce-admin/pull/6810)
* Making experimental package public, and updating the dependency versions

* add experimental to webpack and make explat public

* bump DEWP package version

* use filepath for inter package dependencies

* load experimental script

* remove check for experimental

Co-authored-by: Sam Seay <samueljseay@gmail.com>
Co-authored-by: Paul Sealock <psealock@gmail.com>
2021-04-16 15:34:15 +12:00
louwie17 68161836a5 Update experimental package path, and bump patch version (https://github.com/woocommerce/woocommerce-admin/pull/6808)
* Update experimental package path, and bump patch version

* Revert package-lock changes
2021-04-15 15:34:12 -03:00
louwie17 c0cb48f217 Bumped version and changelog of component package to 6.1.0 (https://github.com/woocommerce/woocommerce-admin/pull/6806)
* Bumped version and changelog to 6.1.0

* Remove the unreleased header
2021-04-15 13:54:32 -03:00
Albert Juhé Lluveras f3b097c3d3 Add dompurify and md5 to @woocommerce/components dependencies list (https://github.com/woocommerce/woocommerce-admin/pull/6804)
* Add dompurify and md5 to @woocommerce/components dependencies list

* Add changelog entry

* Add @woocommerce/experimental to @woocommerce/components dependencies list

* Update changelog entry
2021-04-15 13:29:44 -03:00
Ismael Martín Alabarce 664694e165 Render optional children in summary number component (https://github.com/woocommerce/woocommerce-admin/pull/6748)
* WIP add details prop to summary number component. New optional prop to add additional information at the bottom.

* Update component readme and stories to include new prop

* Revert commits to use children instead of a new prop

* Render optional summary number component children

* Typo fix, doc improvement and add entry to changelog

* Add readme.txt entry
2021-04-15 08:49:35 +02:00
Paul Sealock 3dcb7697e5 Bump components version and add single publish instructions (https://github.com/woocommerce/woocommerce-admin/pull/6736) 2021-04-02 12:28:03 +13:00
louwie17 e6f55019a6 Update select control logic so value type stays consistent (https://github.com/woocommerce/woocommerce-admin/pull/6594)
* Update select control logic so value type stays consistent

* Added test cases for updated changes

* Add changelog

* Removed the use of lodash 'findIndex' using the native one instead

* Added onChange update to readme
2021-04-01 09:34:56 -03:00
Adrian Duffell 828a2cb038 Move Lodash to a Peer Dependency in Packages (https://github.com/woocommerce/woocommerce-admin/pull/6399)
* Update old versions of lodash in packages

* Add changelog entries

* Move lodash to peerDependencies in components package

* Fix broken JSON

* Fix lodash defined twice in components package

* Move lodash to peer dependency in date package

* Move lodash to peer dependency in navigation package

* Move lodash to peer dependency in notices package

* Relax lodash version constraint in components package

* Update  package changelogs
2021-03-12 11:58:51 +08:00
Hsing-Yu Flowers db0552e714 Change from MenuGroup to label (https://github.com/woocommerce/woocommerce-admin/pull/6090)
* Change from MenuGroup to label

* Remove icon

* Remove icon folder

* Update input style

* Remove list message

* Run test snapshots

* Add single knob

* Add changelog

* Change to wrap list with ul

* Run snapshots test

* Add styling on li

* Move renderList outside of li to prevent nesting

* snapshots test
2021-02-05 13:24:34 -03:00
Joel Thiessen 2e3f23f653 Fix 'sort by undefined' issue with screen readers in reports table (https://github.com/woocommerce/woocommerce-admin/pull/6232) 2021-02-02 15:02:57 -08:00
Joshua T Flowers 0b3f4d8e92 Try: Replace Accordion with Panel component (https://github.com/woocommerce/woocommerce-admin/pull/5970)
* Use Panel for Activity Panels

* Update styling for panels in activity panels

* Remove Accordion component

* Add collapsible param to activity panel tests

* Fix errant comma

* Add bottom border to panel header toggle and remove disbled button styling

* Update empty activity card styles

* Add border between activity cards
2021-01-12 16:18:51 -05:00
Albert Juhé Lluveras 080271fb27 Add SearchListControl isCompact prop (https://github.com/woocommerce/woocommerce-admin/pull/5901)
* Add isCompact prop to SearchListControl

* Add left and right borders to search list

* Remove box-shadow when search list items are focused/active

* Add Changelog notice

* Update snapshots
2020-12-22 15:32:24 +01:00
Joshua T Flowers 2db701b5f3 Add deprecation notice to wc card component (https://github.com/woocommerce/woocommerce-admin/pull/5911)
* Add deprecation notice to wc card component

* Add changelog note
2020-12-21 18:12:05 -05:00
Jeff Stieler c8c544f70c Support custom product attributes in advanced filter (https://github.com/woocommerce/woocommerce-admin/pull/5848)
* Add product attributes autocomplete for Search control.

* Support single selection in Search component.

* Fix SelectControl input after selection in single mode.

* Remove label from Search component's inner SelectControl.

Placeholder is the behavior we want to avoid label and selection collision.

* Match Search component selected prop to SelectControl.

It's passed through anyhow.

* Rework attribute filter to use new endpoints for custom terms.

* Hook up custom attribute filter to report queries.

* Fix errant space in filter name.

* Fix SelectControl active status when control is disabled.

* Fix SelectControl "has tags" logic for non-multiple use cases.

* Fix attribute filter screen reader text.

* Update changelogs.

* Move custom attribute test to it's own function.

* Remove SelectControl input disabling.

This was supposed to improve keyboard behavior for non-multiple controls, but it was questionable.

* Fix backspace in attribute term field.
2020-12-17 09:59:01 -05:00
Albert Juhé Lluveras e44193cb1d Fix count bubble alignment in SearchListItem with latest @wordpress/components (https://github.com/woocommerce/woocommerce-admin/pull/5809)
* Remove showCount prop from SearchListControlItem

* Add option to show counts in ShowListControl story

* Fix count alignment in SearchListItem with latest Gutenberg

* Add new changelog entry

* Update dated prop description
2020-12-10 11:44:31 +01:00
Jeff Stieler 2a302603c6 Migrate Stock Panel to Homescreen (https://github.com/woocommerce/woocommerce-admin/pull/5729)
* Refactor low stock variable to be the count instead of a boolean.

* Add initial render of the Stock panel on the homescreen.

* Move existing Stock panel to homescreen accordion.

* Ensure int value for low stock product count.

* Update ProductImage styling.

* Update stock activity car styles.

* Only show 5 low stock products.

* Add "undo" action to the stock updated snackbar.

* Fix check for explicit notice dismissal when taking actions.

* Hide now-in-stock products after updating.

By cllearing "edited" flag on successful update.

* Fetch more products after updating stock.

* Fix the number of product placeholders shown.

* Only show products placeholders on the initial fetch.

* Fix placeholder style.

* Fetch low stock count dynamically.

* Let initialOpen prop toggle Accordion panels if they haven't been toggled by the user.

* Refactor item total count state.

Allows for auto-updating item totals whenever identical queries (from a totals perspective) are issued.

* Add last order date to low stock products API response.

* Allow non-date strings in ActivityCard date prop.

* Add last order date to stock panel cards.

* Remove empty stock panel view.

* Add test file for StockPanel.

* Only request necessary fields from products endpoint.

* Add test for products fetch after stock update.

* Fix field name.

* Add test for last order date in low stock products API response.

* Stock panel should be initially closed.

* Skip updating a product if the quantity is unchanged.
2020-11-25 13:51:15 -05:00
Paul Sealock 328075abb7 Remove ` @woocommerce/wc-admin-settings` from data package (https://github.com/woocommerce/woocommerce-admin/pull/5158)
* remove getAdminLink

* prep for package release

* correctly pass in args

* tests
2020-09-18 14:22:52 +12:00
Paul Sealock 2dea138505 Update/components deps (https://github.com/woocommerce/woocommerce-admin/pull/5153)
* bump components dependencie

* prep for package release
2020-09-18 08:19:36 +12:00
Paul Sealock 4a07997a86 Packages: release prep (https://github.com/woocommerce/woocommerce-admin/pull/5122)
* packgages version bumps

* fix errant s?
2020-09-11 14:33:10 +12:00
Paul Sealock 7e7064e38c Fix components internal deps (https://github.com/woocommerce/woocommerce-admin/pull/5018)
* Fix components internal deps

* Pass full response

* remove errant comment
2020-08-28 11:55:48 +12:00
Jeff Stieler 650ecac14a Add "Product Attribute" advanced report filter. (https://github.com/woocommerce/woocommerce-admin/pull/5038)
* Simplify variation name logic.

* Remove errant commas from variation autocomplete options.

* Add single variation filter to products report.

* Include more variations in search results.

Also trim the response fields down.

* Add initial AttributeFilter component.

Only selected of attribute names for now.

* Add attribute term selection control.

* Position attribute filter inputs side by side.

* Add loading indicator to attribute term control.

* Clear term when attribute value changes, and handle backspaces.

* Generate screen reader text.

* Translate filter labels, add field separator.

* Improve grammar in screen reader text.

* Fix lint errors.
2020-08-27 08:11:12 -04:00
Jeff Stieler e845de7003 Fix missing title component in advanced filter screen reader interpolation. (https://github.com/woocommerce/woocommerce-admin/pull/5032) 2020-08-26 08:29:21 -04:00
Paul Sealock 2f650b74a0 Replace useFilters with wp's withFilters (https://github.com/woocommerce/woocommerce-admin/pull/4962)
* use wp withFilters

* changelog

* remove altogether

* other uses of withFilters

* Add deprecation warning to README
2020-08-21 11:14:55 +12:00
Jeff Stieler 2c8402eebf Fix Table component `onQueryChange` prop default (https://github.com/woocommerce/woocommerce-admin/pull/4959)
* Fix default value for Table component onQueryChange.

* Add component changelog.

* Convert Table component tests to react-testing-library.

* Add test coverage for default callback props.
2020-08-12 15:35:26 -04:00
Paul Sealock 8b80c83b09 Prepare to publish packages (https://github.com/woocommerce/woocommerce-admin/pull/4908)
* get changelogs ready

* bump versions in package.json

* reset stable tag
2020-08-04 15:10:36 +12:00
Paul Sealock d4729a5578 Remove unused ref (https://github.com/woocommerce/woocommerce-admin/pull/4859) 2020-07-29 10:15:20 +12:00
Bec Scott 551dfe1f0c Pills and tooltips in product step of OBW (https://github.com/woocommerce/woocommerce-admin/pull/4707)
* Add monthly product prices to OBW

* Remove description for physical and download products

* Use pills in product selection step of OBW

* Add missing translation wrapper, also convert some spaces to tabs

* Add pill to changelog

* Change pills to medium gray text and border

* Make everything line up correctly on smaller viewports

* Get the styles closer to the design

* Breakpoint to set font size to 11px

Co-authored-by: Rebecca Scott <me@becdetat.com>
2020-07-21 14:27:32 +10:00
Joshua T Flowers 49a0a9f3a2 Add option to dismiss tasks (https://github.com/woocommerce/woocommerce-admin/pull/4733)
* Add dismiss button as task list item option

* Add option to undo task dismissal

* Record modal dismissal event

* Add transition animation to list items

* Use key for list items instead of index

* Remove dismissed tasks on recompleting profiler steps
2020-07-14 13:46:25 +03:00
Valerie K fe865b0c84 Add Timeline component (https://github.com/woocommerce/woocommerce-admin/pull/3614)
Add Timeline component

The overall component is split into smaller components:
  * Timeline item: an individual item (event) for the timeline.
  * Timeline group: a group of items grouped according to props.

See README.md for prop details.

Ordering and grouping is decided via props. Component also
exports helper objects to make it easier to pass in the correct
props for ordering and grouping.

Item titles and bodies can be passed in as either strings or
React elements. Icons must be React elements.

Has a storybook scenario along with unit and snapshot tests.


Co-authored-by: Valerie K <valerie@automattic.com>
Co-authored-by: Allen Snook <allen@allendav.com>
Co-authored-by: Kristófer R <kristofer.thorlaksson@automattic.com>
Co-authored-by: David Levin <davidlevin@Davids-MacBook-Pro-2.local>
2020-06-17 03:44:08 +08:00
Matt Sherman aaefeebe29 Add overlooked changes to CHANGELOG.md for SelectControl, List, and Link (https://github.com/woocommerce/woocommerce-admin/pull/4555) 2020-06-11 14:13:55 -04:00
Luiz Reis 9fed1c307b Add custom autocompleter support to Search component (https://github.com/woocommerce/woocommerce-admin/pull/4518)
* Add custom autocompleter support to Search component

* Throw error if Search autocompleter is missing or is of the wrong type

* Add custom Search autocompleter changelog entry
2020-06-10 10:42:22 -03:00
Paul Sealock 16cb332f28 IconButton: Replace with Button (https://github.com/woocommerce/woocommerce-admin/pull/4415) 2020-05-29 14:32:37 +12:00
Paul Sealock c500d3fa98 Plugins DataStore: decouple from onboarding (https://github.com/woocommerce/woocommerce-admin/pull/4048)
* Plugins DataStore: Add client side store
2020-04-17 11:58:36 +12:00
Jason Conroy 741116a6ad Animation slider example fix (https://github.com/woocommerce/woocommerce-admin/pull/3939)
* Fix AnimationSlider example code buttons

* Fixes disable state logic on forward button
* Fixes back property

* Update readme to indicate AnimationSlider example fix
2020-03-25 10:50:26 +13:00
Joshua T Flowers d22774aa66 Onboarding: Fix shipping rates overlapping currency prefix (https://github.com/woocommerce/woocommerce-admin/pull/3623)
* Add various input states classes to the text control with affixes component

* Replace TextControl with TextControlWithAffixes in shipping rates

* Style TextControlWithAffixes for shipping rates in task list

* Always provide a formatted currency string

* Always display shipping rate labels and affixes

* Add components changelog entry.

Co-authored-by: Jeff Stieler <jeff.m.stieler@gmail.com>
2020-01-28 08:54:39 -08:00
Jeff Stieler 9f5826ee61 Fix Search component token display in ReportTable (https://github.com/woocommerce/woocommerce-admin/pull/3618)
* Fix parsing of report table search terms.

* Fix styling of Search component "clear all" button.

* Add components changelog entry.
2020-01-23 08:32:28 -07:00
Jeff Stieler 11d4911191 Fix CompareFilter selected value format. (https://github.com/woocommerce/woocommerce-admin/pull/3421)
Look for `key` instead of `id` property.
2019-12-16 10:27:53 -05:00
Jeff Stieler 6a826600c2 Fix WC-Admin component styles for WP 5.3 (https://github.com/woocommerce/woocommerce-admin/pull/3357)
* Style Search component for 5.3.

* Reset native select control styles.

* Fix styling of selected radio options.

* Fix bottom margin on select inputs in filters and pagination.

* Update DropdownButton styles for WP 5.3.

* Style DropdownButton arrow as a chevron.

* Fix tooltip arrow styling.

* Style TextControlWithAffixes for WP 5.3.

* Flatten pagination button style.

* Use SelectControl for StoreAlert snooze action.

* Remove 3D look and use chevron on SplitButton.

* Add changelog entry.

* Fix stylelint issues.

* Update test snapshots.

* Add TextControlWithAffixes disabled prop to documentation and proptypes.

* Use WP checkboxes in ReportTable columns.

* Fix TableCard header background colors.

* Add padding to EllipsisMenu toggle controls.

* Remove version-specific styles.

We require WP 5.3 as a minimum now.
2019-12-13 12:35:29 -05:00
Justin Shreve 448e1f3e11 Remove Newspack Dependency (https://github.com/woocommerce/woocommerce-admin/pull/3302)
* Switch to @wordpress/component's Button

* Finish button conversion

* Move to @wp/component's CheckboxControl

* Add  ImageUpload component

* Remove Newspack package

* CSS Cleanup

* Handle PR feedback: Fix tests, add ImageUploader basic test, fix FireFox/Safari Display issues, and  currency input bug
2019-12-02 12:39:22 -05:00
Darren Ethier 09ddedc8d9 Packages: Prep for release. (https://github.com/woocommerce/woocommerce-admin/pull/3325)
* update components package version and changelog

* update csvexport package and changelog

* update currency package and changelog

* update date package and changelog

* update navigation package and changelog

* update number package and changelog

* update package dependency versions

* fix typo
2019-12-02 08:08:35 -05:00
Jeff Stieler 9469663379 Decouple date package from `wcSettings`. (https://github.com/woocommerce/woocommerce-admin/pull/3278)
* Decouple date package from wcSettings.

* Update missed documentation and example.

* Expect simpler prop values for date filter.

* Remove unused props from primary/secondary dates.

* Avoid introducing moment dependency for type checking.

* Handle null moment/date values in DateRangeFilterPicker.

* Fix missing ISO date format.

* Fix moment instance detection.
2019-11-26 14:39:40 -05:00
Jeff Stieler c2020507e3 Decouple Navigation from `wcSettings`. (https://github.com/woocommerce/woocommerce-admin/pull/3294)
* Move getAdminLink to wc-admin-settings.

* Add changelog entries.

* Look for `getAdminLink()` in @woocommerce/settings first.
2019-11-22 12:07:26 -05:00
Jeff Stieler 17514872ad Decouple currency and numbers packages from `wcSettings`. (https://github.com/woocommerce/woocommerce-admin/pull/3277)
* Remove wcSettings dependency from currency and number packages.

Either take a configuration object in function calls or in a new class constructor.

* Use new Currency class and number format methods in client/.

Compose with store settings to keep the same API.

* Don't reintroduce lodash dependency to currency package.

* Add changelog entries to currency and number packages.

* Update docs, example, and changelog for AdvancedFilters component.

* Use precision-less formatValue() for integer report values.

* Make Currency instance immutable.
2019-11-21 16:51:52 -05:00
Joshua T Flowers b92500b35f Onboarding: Replace TextControl component (https://github.com/woocommerce/woocommerce-admin/pull/3020)
* Add TextControl component

* Replace instances of newspack TextControl
2019-10-10 07:00:33 +08:00
Jeff Stieler e53d5daa94 Hook up download button to export endpoint. (https://github.com/woocommerce/woocommerce-admin/pull/2900)
* Move TableCard actions from packaged component to ReportTable.

* Build an IE stylesheet for the main app.

* Remove defunct TableCard download test.

* Update components changelog.

* Fix pagination.

Pull query from table data instead of ReportTable props.

* Initiate report export from download button (https://github.com/woocommerce/woocommerce-admin/pull/2951)

* Add report export operations to API spec.

* Initiate a report export job when there is more than one page of report data.

* Add report download "type" to Tracks event.

* Ensure WC_Emails class is hooked in before sending report download emails.

* Set email parameter for background CSV download requests.
2019-10-08 15:02:26 -07:00
Joshua T Flowers 1563971836 Replace select controls with new SelectControl (Autocomplete) component (https://github.com/woocommerce/woocommerce-admin/pull/2997)
* Rename Autocomplete component to SelectControl

* Add isSearchable prop to SelectControl

* Remove SimpleSelectControl component

* Refactor list expansion and key behavior

* Bump changelog and version
2019-10-08 06:42:32 +08:00
Ron Rennick 193c961d22 add backticks to component tag in changelog 2019-09-03 14:09:22 -03:00
Ron Rennick 24d3104eca fix merge conflicts 2019-09-03 14:08:02 -03:00
Justin Shreve e5b4606047 Add base payments task & jetpack connection status method (https://github.com/woocommerce/woocommerce-admin/pull/2853)
* Add a base for the payments task, with the ability to choose methods. Also adds Jetpack connection status.

* Handle PR feedback
2019-08-29 12:41:04 -04:00