Commit Graph

289 Commits

Author SHA1 Message Date
Robert Elliott 11d6e8ba87 rebase with master after some afk 2018-08-13 12:24:10 +02:00
Robert Elliott da5d6600e5 move to getderivedstate 2018-08-13 12:24:09 +02:00
Robert Elliott bbc7e13e3e split out example.js and index for component 2018-08-13 12:23:50 +02:00
Robert Elliott 0c7d016629 D3 Chart Component: split out example + index and handle full-width 2018-08-13 12:22:58 +02:00
Paul Sealock b427249aa1 Advanced Filters: add card and config 2018-08-09 12:16:46 +12:00
Kelly Dwan 4c2797d6cf Table: Add "required"/"sortable" meta to headers/columns (https://github.com/woocommerce/woocommerce-admin/pull/275)
* Switch headers to an object, use `header.label` to display title

* Change sort function to update a query param

* Clean up README

* Get the currently sorted column from the query

* Don’t allow toggling of required columns

* Add in direction-sorting (ascending/descending)

* Switch to aria-describedby so that the actual column name is read aloud

* Fix chevron orientation

* Handle hiding a sorted column

* Fall back to sorting by first item if no defaultSort col is set

* Fix arrow orientation again

* Update order_by to orderby to match wp_query param name
2018-08-06 13:01:41 -04:00
Kelly Dwan a4267202c5 Update TableCard component to handle toggling on/off specific columns (https://github.com/woocommerce/woocommerce-admin/pull/268) 2018-08-02 18:21:37 -04:00
Kelly Dwan 6a82db326e SummaryNumber: Switch to dropdown display on small screens (https://github.com/woocommerce/woocommerce-admin/pull/265)
* Move isMobileViewport to a helper function in lib

* Switch SummaryList to use navigable menu to support up/down (or left/right) arrow key navigation

* Switch to a dropdown menu/button combo when on a smaller screen

* Ensure aria role & href are only added if the item is a link

* Wrap the entire SummaryNumber in a link to match non-mobile use

* Update card content to be single line on mobile

* Add label to the popover title

* Make SummaryNumbers edge-to-edge on smaller screens

* Switch to the collapsed/dropdown view on screens <1100px

* Adjust offset of arrow icon
2018-08-02 18:20:48 -04:00
Paul Sealock 45231f9049 add theming to Gutenberg components' 2018-08-02 12:25:00 +12:00
Timmy Crawford 64b3f99649 Merge pull request woocommerce/woocommerce-admin#253 from woocommerce/fix/pagination-input
Pagination: Fix page input bug.
2018-08-01 13:36:17 -07:00
Timmy Crawford 2e3788a862 Verify the page number exists. 2018-08-01 11:51:11 -07:00
Kelly Dwan 8141a9f66d Update/table component (https://github.com/woocommerce/woocommerce-admin/pull/251)
* Update mock data to reflect latest API format

* Update Table component to create a TableCard, TableSummary, and plain Table

Use the TableCard container to display mocked revenue data

* Add horizontal scroll only on the table itself

* Remove `sortable` prop, base column sortability on whether the `value` is true/false

Checking against a strict false should prevent any real 0 or ‘’ values from triggering unsortability

* Add a checkbox to the demo table

* Update accepted props

* Update README for TableCard, Table, and TableSummary

* Update README

* Fix confused defaults
2018-08-01 12:00:45 -04:00
Justin Shreve d346945702 Add Collapsed Review View (https://github.com/woocommerce/woocommerce-admin/pull/242)
* Add Collapsed Review View

* Fix spacing issue on main button action
2018-08-01 08:21:51 -04:00
Timmy Crawford f93421c750 Ensure NaN doesn't sneak in there. 2018-07-31 09:38:24 -07:00
Paul Sealock 735dfcd272 Merge pull request woocommerce/woocommerce-admin#239 from woocommerce/fix/calendar-component
Datepicker: Refactor Calendar to fully controlled component
2018-07-31 11:10:20 +12:00
Timmy Crawford d373599f8a Pagination: Fix page input bug. 2018-07-30 16:08:13 -07:00
Kelly Dwan 727654ff3b SummaryNumber Component: Update to latest hifi design (https://github.com/woocommerce/woocommerce-admin/pull/237)
* Add first pass + demo of updated SummaryNumber

* Add new larger screen breakpoint

* Remove the max-width from the content wrapper

* Update previous label text

* Fix the border colors/sizing

* Create a mixin to generate the grid template pattern

* Add green/red colors based on trend, with prop to reverse

In some cases, a downward trend is good (ex, refunds), so we want to be able to color those green

* Move selected number containers up to avoid the double-border

* Document className logic, and apply 10-item layout to all cases of 10+ items

* Remove layout notes

* Update component docs, clean up optional displays

* Update style of SummaryNumbers inside cards

* Filter out any `false` or otherwise unrenderable children

* Fix card borders

* Update dashboard component to use new props

* Check that prevValue is defined

a prevValue of 0 was incorrectly outputting `0` for both label and value

* Update no-change datapoint style

* Update default data values

Rather than hiding the prevValue/label or delta section if these are not passed through, use default N/A placeholders

* Change SummaryList & SummaryNumber to a list of links

Add active, hover, and focus styles

* Add a short help text for screen reader users

* Add href to README

* Add the href prop to the readme example

* Fix border colors

The `nth-of-type` rules need to be on the `li` containers

* Fix font-weights on value & delta

* Wrap the previous label/value when the percentage wraps
2018-07-30 11:14:09 -04:00
Paul Sealock 0df86cb6f6 Datepicker: Refactor Calendar to fully controlled component 2018-07-30 11:11:52 +12:00
Paul Sealock 1c447396c8 Datepicker: Custom: Add styles 2018-07-30 10:36:38 +12:00
Robert Elliott 7a6a82c6af Merge pull request woocommerce/woocommerce-admin#189 from woocommerce/add/chart-legend
D3 Chart: legend component and integration

Thanks for the great feedback. I've made updates and will address a few of the styling (and remove code used for testing) in future PRs. Keep an eye on https://github.com/woocommerce/wc-admin/issues/164 for future work planned on this component.
2018-07-25 17:08:59 +02:00
Robert Elliott 2c78dfb3cc feedback updates and tooltip 2018-07-25 17:04:21 +02:00
Robert Elliott dd663e0cd9 init for legends PR
updates from feedback
2018-07-25 17:04:03 +02:00
Justin Shreve ff934eb999 Add SplitButton Component (https://github.com/woocommerce/woocommerce-admin/pull/236)
* Add SplitButton component

* Update primary styles and focus border
2018-07-25 10:25:08 -04:00
Kelly Dwan 944b7ab460 Update to Gutenberg 3.3 (https://github.com/woocommerce/woocommerce-admin/pull/234)
Removes Gutenberg package dependency in favor of published sub-packages, update tests and build process to reflect new package locations
2018-07-23 16:14:40 -04:00
Justin Shreve c587ca94dc Add rating components (https://github.com/woocommerce/woocommerce-admin/pull/233)
* Add rating component

* Add ProductRating, ReviewRating components.
Add tests.
2018-07-23 09:19:24 -04:00
Paul Sealock 11b30baa6f Merge pull request woocommerce/woocommerce-admin#226 from woocommerce/add/filter-picker-animation
Components: Filter picker: Add animation
2018-07-23 10:03:35 +12:00
Justin Shreve dabef973bd Add ProductImage Component (https://github.com/woocommerce/woocommerce-admin/pull/231)
* Add ProductImage Component

* Use provided product image alt text
2018-07-20 14:24:39 -04:00
Paul Sealock 186c803c31 FilterPicker: Add Animation 2018-07-20 15:42:36 +12:00
Justin Shreve 22028283ef Add Activity Panel Outbound Link Component (https://github.com/woocommerce/woocommerce-admin/pull/213)
* Activity Panel Outbound Link

* Address PR Feedback: Pass through additional props on ActivityOutboundLink, add comment for activity panel wrapping padding, fix README naming, and use $gap $gutter trick for outbound link padding.
2018-07-17 14:51:56 -04:00
Justin Shreve 6abcbbdc87 Fix key prop warning in FilterPicker (https://github.com/woocommerce/woocommerce-admin/pull/221) 2018-07-17 14:38:58 -04:00
Justin Shreve 9cc4e1b97a Add Order Status Component (https://github.com/woocommerce/woocommerce-admin/pull/214) 2018-07-17 09:11:13 -04:00
Paul Sealock 31c055fd57 Component: Filter Picker 2018-07-17 12:25:00 +12:00
Justin Shreve dd98f925ef Add Flag Component (https://github.com/woocommerce/woocommerce-admin/pull/197)
* Add Flag Component

* Fix for travis ci

* Fix spacing with new card layout
2018-07-16 12:28:26 -04:00
Paul Sealock 9af766fe80 Datepicker: fix getCurrentDates to always reflect defaults 2018-07-14 22:27:55 +12:00
Kelly Dwan 96925f77fa Component: Fix rows prop in Table (https://github.com/woocommerce/woocommerce-admin/pull/193)
* Move component lifecycle method to top of component

* Update rows if the rows passed in via props have changed

This lets us bring in API changes, but will wipe out any sorting (revisit in a later PR, perhaps)

* Pass rows through to Table even if we don’t have rows loaded yet

Adds todo comment to remind that we should come back to add a placeholder/loading state
2018-07-13 15:36:41 -04:00
Justin Shreve eb7b60d558 Add Gravatar Component (https://github.com/woocommerce/woocommerce-admin/pull/188) 2018-07-11 13:06:26 -04:00
Robert Elliott f0069b4d48 reformatted README 2018-07-11 17:12:37 +02:00
Robert Elliott 7b8bcea17a move dummy into fixtures subfolder 2018-07-10 17:07:34 +02:00
Robert Elliott 6ff484bddc JSDocs for chart component utils 2018-07-10 16:09:58 +02:00
Robert Elliott da980328e2 move dummy js and add README 2018-07-10 16:09:47 +02:00
Justin Shreve 71c12e6795 Update woo-dash naming to new wc-admin name (https://github.com/woocommerce/woocommerce-admin/pull/183) 2018-07-10 08:48:06 -04:00
Kelly Dwan 5bf87f4ad9 Fix unique key warning for DropdownButton labels (https://github.com/woocommerce/woocommerce-admin/pull/180) 2018-07-09 16:36:12 -04:00
Justin Shreve 3783e5e6f7 Add ActivityHeader & implement panel styles (https://github.com/woocommerce/woocommerce-admin/pull/167)
* Header shadow on scroll, panel styles, implement woo bubble

* Add ActivityHeader component

* Fix admin bar stickyness and missing onInvoke function
2018-07-09 11:46:31 -04:00
Justin Shreve 8627e89d19 Fix infinite loop from calling setState in D3 componentDidUpdate (https://github.com/woocommerce/woocommerce-admin/pull/179) 2018-07-09 11:28:33 -04:00
Robert Elliott 5c0a293297 refactor params to reduce recalculating scales each time + new tests 2018-07-09 15:35:25 +02:00
Robert Elliott ec3e433e24 line mouseover and out events with tooltip 2018-07-09 15:35:24 +02:00
Robert Elliott 01eea75a2a bug fixes to drawLines and dummy renders of bars and lines on Dashboard 2018-07-09 15:35:24 +02:00
Robert Elliott 806d423324 bar chart and example 2018-07-09 15:35:12 +02:00
Justin Shreve f0c27ee999 Activity Panel: Unread bubble, animations, cleaned up styles/mobile handling (https://github.com/woocommerce/woocommerce-admin/pull/154)
* Activity Panel Updates: Unread bubble, animations, cleaned up styles and mobile handling.

* * Color and animation definition cleanup
* Fix animation for tab switch
* Clicking outside the panel will close it
* Hover bubble border
* Aria attributes/tablist

* Fix mobile styles
2018-07-06 08:40:05 -04:00
Paul Sealock 817f6813a1 Date: Load localeData into Momentjs 2018-07-06 14:04:17 +12:00
Paul Sealock a768fac41d span instead of p 2018-07-03 11:58:05 +12:00
Paul Sealock a4305347ce Datepicker: Add styles 2018-07-03 11:41:38 +12:00
Paul Sealock 0a2b71865b Datepicker: Use api naming before/after 2018-07-03 11:16:42 +12:00
Paul Sealock 13a283cac1 Merge pull request woocommerce/woocommerce-admin#128 from woocommerce/update/datepicker-i18n
Datepicker: i18n date formats
2018-06-29 06:52:17 +12:00
Justin Shreve d604f3625c Rename sidebar to activity-panel, and refactor code and behavior. 2018-06-28 09:52:45 -04:00
Timmy Crawford f2518dcd34 make with and without elipsis the same height 2018-06-27 15:10:50 -07:00
Timmy Crawford 2145b8ebce Update Card header styles. 2018-06-27 14:58:37 -07:00
Paul Sealock efba4fab7d Datepicker: i18n datestrings 2018-06-27 15:54:01 +12:00
Paul Sealock 0f93022a62 DatePicker: Hook up react-dates 2018-06-27 14:21:14 +12:00
Paul Sealock be002e442a DatePicker: Hook up react-dates 2018-06-27 14:11:13 +12:00
Kelly Dwan ff80ca0122 Use formatCurrency in the orders activity list 2018-06-26 14:22:23 -07:00
Justin Shreve ba68ada59d Add Pagination Component (https://github.com/woocommerce/woocommerce-admin/pull/117)
* Add pagination component

* Refactor query string/route updating so it can be done using a nav-utils helper function

* Fix typo and adjust accessibility attributes for error handling and current page

* Update styles
2018-06-26 10:59:35 -04:00
Justin Shreve bf80e5c649 Global Header & Activity Panel on all WooCommerce Pages (https://github.com/woocommerce/woocommerce-admin/pull/110)
* Makes the header/sidebar component embeddable on other WooCommerce pages.

* Some mobile CSS fixes to make sure the header bar displays properly on smaller screensizes.

* Refactor notices and pull out success message from the panel

* Handle positioning of screen options, update message handling, css fixes and header height increase to match mockups, some code cleanup

* Only enable the header embed on normal/classic WooCommerce pages, and provide a method for plugins to opt-in.
This change also builds nicer breadcrumbs for pages.

* Code cleanup and consistent naming.

* Some spacing cleanup. Also updated the page title method to correctly set page titles in PHP for classic WC pages
2018-06-26 10:49:42 -04:00
Kelly Dwan 99ac7728cd Try a context-aware heading component (https://github.com/woocommerce/woocommerce-admin/pull/121)
* Add H and Section components for context-aware headings

* Switch to using the new context-aware heading and section components

* Style header by class name, not heading level

* Add our client dir to the modules list for Jest

We already have this setting in webpack, but Jest doesn’t pick up on that
2018-06-20 11:10:06 -04:00
Kelly Dwan b1c2b3fdc4 Add Table component (https://github.com/woocommerce/woocommerce-admin/pull/118)
* Update package-lock

* Add data table component

* Add fake data & display revenue on the analytics test report

* Update styling

* Display table inside a card

* Update mock data to be easier to scan for testing ascending/descending

* Fix sorting function to correctly sort all columns

* Check column content before determining “sortability” — objects (links) are not sortable

* Update README

* Add translation to scroll helper text
2018-06-20 11:09:37 -04:00
Kelly Dwan bc084b7302 Add Summary Number/Performance Tile component (https://github.com/woocommerce/woocommerce-admin/pull/109)
* Add SummaryList and SummaryNumber components

* Add a demo of SummaryList/SummaryNumbers

* Pages without the sidebar displayed can use a larger max-width

* Adjust layout styles for smaller screens
2018-06-14 11:16:57 -04:00
Justin Shreve 215464a592 Move Jetpack JITM messages out of the wp notice toggle, and count all child divs. (https://github.com/woocommerce/woocommerce-admin/pull/111) 2018-06-13 21:19:36 -04:00
Kelly Dwan 29136ce44c Show real orders in the sidebar orders tab (https://github.com/woocommerce/woocommerce-admin/pull/105)
* Add an activity list component which will fetch and display the respective tabs’ content

* Add currency and order calculation helpers from Calypso

* Add date support to ActivityCard

* Fix the product label when there’s only 1 product

* Only display the orders on the orders tab

* Remove demo component

* PR feedback

- Switch to function components
- Check isLoading for showing loading state
- use v3 of WC API
- Remove getOrderShippingMethod (it’s not a tax-related function)
- Switch to array.reduce
- Add `|| 0` protect to all possible API-based calculations
2018-06-07 12:05:22 -04:00
Paul Sealock b25fdc3f31 DatePicker: Add url support and container 2018-06-05 10:20:25 +12:00
Justin Shreve 59cb071aa2 Expand WP notices with header toggle (https://github.com/woocommerce/woocommerce-admin/pull/101)
* Display WP notices behind a button

* Expand WP notices inline when the WP toggle is clicked

* Update setState calls

* Fix string display when only 1 notice is present

* Remove display:none that snuck in during rebase
2018-06-04 10:25:41 -04:00
Robert Elliott a932758fc7 Merge pull request woocommerce/woocommerce-admin#73 from woocommerce/add/d3-base-component
D3: adding base component
2018-06-03 02:15:30 +02:00
Kelly Dwan e0d05ecfa0 Add a label to Count to add context for screen reader users (https://github.com/woocommerce/woocommerce-admin/pull/102)
* Add a label “Total” to the count balloon

* Update README

* Switch to an aria-label, so that we can set a fully translatable string

* Update README to make label default clear
2018-06-01 10:39:48 -04:00
Robert Elliott 8216841490 adding README from Calypso 2018-06-01 16:35:51 +02:00
Kelly Dwan b0bcce86d8 Add CSS naming conventions following Gutenberg’s standards (https://github.com/woocommerce/woocommerce-admin/pull/99)
* Add CSS naming conventions following Gutenberg’s standards

* Update `woo-dashboard` to `woocommerce-layout`

* Update admin notice container to new classname standard
2018-06-01 10:35:18 -04:00
Kelly Dwan a01861d886 Add README for `useFilters`, clean up example filter (https://github.com/woocommerce/woocommerce-admin/pull/100)
* Add README for useFilters

* Remove unused filter example
2018-06-01 10:34:54 -04:00
Kelly Dwan 4191d7adab Add ActivityCard component (https://github.com/woocommerce/woocommerce-admin/pull/86)
* Add an ActivityCard component

* Add font-size mixin, hover-state mixin, and a fake base padding

* Style the ActivityCard

* Style the card image

* Add README

* Address PR feedback

- Add className prop
- children propType is required
- Link to a real image
2018-05-25 15:34:35 -04:00
Justin Shreve e110283997 Set document title (https://github.com/woocommerce/woocommerce-admin/pull/79)
* Set the document title based on header sections

* Set dashboard default title via PHP to avoid a title switch
2018-05-24 12:03:03 -04:00
Justin Shreve 893298aa5d Update Agenda widget to use Count component (https://github.com/woocommerce/woocommerce-admin/pull/81)
* Update Agenda widget to use Count component

* Move font-weight rule to count component
2018-05-24 11:45:32 -04:00
Paul Sealock ee5e314668 Merge pull request woocommerce/woocommerce-admin#63 from woocommerce/add/segmented-selection
Component: add segmented selection
2018-05-24 11:19:21 +12:00
Paul Sealock 631ce420a4 Component: add segmented selection 2018-05-24 11:14:19 +12:00
Paul Sealock 558d163f35 Sidebar: Add Tabs 2018-05-23 12:42:26 +12:00
Justin Shreve d4ade607d8 Add agenda widget base and related components (https://github.com/woocommerce/woocommerce-admin/pull/57)
* Add agenda widget with accordion

* Add AgendaItem, README, and do some cleanup

* Handle PR Feedback: Rename AgendaAccordion to AgendaGroup, accept an href prop for a non-accordion state. Accept onClick or href for AgendaItem, a11y fixes, fix some typos, update examples & README.

* Address PR Feedback: Rename AgendaGroup to AgenaHeader, use a direct link for href mode, use IconButton instead of Button & Dashicon, pull out link rendering to its own method. Use <Link /> for app links.

* Combine box-shadow focus/hover rule and add transparent background

* Make `count` optional
2018-05-22 11:19:56 -04:00
Robert Elliott 7050868638 d3 base component 2018-05-22 15:00:06 +02:00
Kelly Dwan 8f23630269 Layout: Add structure components & CSS (https://github.com/woocommerce/woocommerce-admin/pull/45)
* Refactor dashboard layout into new Layout components

* Style the new layout

* Use Slot/Fill for the Header component

* Center cards, fixed size for sidebar

* Only set the box-sizing on things within our app

* Make app the full height of the wp-admin frame

* Add styles to show/hide sidebar

* Toggle the sidebar

* Wrap router around entire Layout, use page setting to show/hide sidebar on page

* Fix the styles on show/hide buttons, add title & close button to the sidebar

* Use a min-height on visible sidebars

* Add/update READMEs

* Update space between main content & sidebar
2018-05-18 13:31:08 -04:00
Kelly Dwan 3554c4ef7d Tests: Add Jest with Gutenberg as a npm dependency (https://github.com/woocommerce/woocommerce-admin/pull/43)
* Add Jest testing with Gutenberg as a dependency

* Add test using Enzyme

* Update for “element” moving

Something also must have moved api-request, so we mock that import now
2018-05-16 10:59:03 -04:00
Justin Shreve e5bb7e556b Add routing capabilities with basic analytics page (https://github.com/woocommerce/woocommerce-admin/pull/44)
* Add routing capabilities with basic analytics page

* Pass query string to child component
2018-05-15 11:06:15 -04:00
Kelly Dwan 146547cb1d Components: Add EllipsisMenu component (https://github.com/woocommerce/woocommerce-admin/pull/40)
* Add EllipsisMenu & MenuItem

* Add styles for menu items

* Don’t disable all keyboard interactions

Was breaking tab

* Move EllipsisMenu to client folder

* Clean up unused props & focus state

* Add an unfocusable MenuTitle component

* Update EllipsisMenu exports so that all menu-related components can be pulled from EllipsisMenu

* Make strings translatable

Even demo content should use translation functions :)

* Add README

* Fix arrow position

* Add box-sizing back to global reset
2018-05-14 11:47:42 -04:00
Justin Shreve d7df8ed76e Adds SCSS color variables and breakpoints (https://github.com/woocommerce/woocommerce-admin/pull/39)
* Adds SCSS color variables and breakpoint mixins

* Use webpack to pull in shared CSS

* Move notices reset rule to wpadmin-reset

* Prefix breakpoints, colors, and wpadmin reset
2018-05-14 09:41:30 -04:00
Justin Shreve d380fd7569 Rename js/src to client (https://github.com/woocommerce/woocommerce-admin/pull/38)
* Rename js/src to client/

* Update the prettier format to only look in client/
2018-05-11 12:13:57 -04:00