@wordpress/components 28.2.0 → 28.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -0
- package/build/animation/index.js.map +1 -1
- package/build/autocomplete/autocompleter-ui.js +1 -0
- package/build/autocomplete/autocompleter-ui.js.map +1 -1
- package/build/autocomplete/index.js.map +1 -1
- package/build/base-control/index.js +14 -7
- package/build/base-control/index.js.map +1 -1
- package/build/border-box-control/border-box-control-visualizer/component.js +0 -4
- package/build/border-box-control/border-box-control-visualizer/component.js.map +1 -1
- package/build/button/index.js +5 -3
- package/build/button/index.js.map +1 -1
- package/build/button/types.js.map +1 -1
- package/build/combobox-control/index.js +4 -1
- package/build/combobox-control/index.js.map +1 -1
- package/build/composite/current/index.js.map +1 -1
- package/build/custom-select-control-v2/custom-select.js +57 -33
- package/build/custom-select-control-v2/custom-select.js.map +1 -1
- package/build/custom-select-control-v2/default-component/index.js +0 -1
- package/build/custom-select-control-v2/default-component/index.js.map +1 -1
- package/build/custom-select-control-v2/item.js +2 -0
- package/build/custom-select-control-v2/item.js.map +1 -1
- package/build/custom-select-control-v2/legacy-component/index.js +18 -6
- package/build/custom-select-control-v2/legacy-component/index.js.map +1 -1
- package/build/custom-select-control-v2/styles.js +90 -78
- package/build/custom-select-control-v2/styles.js.map +1 -1
- package/build/custom-select-control-v2/types.js.map +1 -1
- package/build/date-time/date-time/index.js +3 -1
- package/build/date-time/date-time/index.js.map +1 -1
- package/build/date-time/index.js +7 -0
- package/build/date-time/index.js.map +1 -1
- package/build/date-time/time/index.js +62 -145
- package/build/date-time/time/index.js.map +1 -1
- package/build/date-time/time-input/index.js +159 -0
- package/build/date-time/time-input/index.js.map +1 -0
- package/build/date-time/types.js.map +1 -1
- package/build/date-time/utils.js +64 -0
- package/build/date-time/utils.js.map +1 -1
- package/build/disclosure/index.js +0 -1
- package/build/disclosure/index.js.map +1 -1
- package/build/divider/component.js +0 -1
- package/build/divider/component.js.map +1 -1
- package/build/divider/types.js.map +1 -1
- package/build/dropdown-menu/index.js +1 -0
- package/build/dropdown-menu/index.js.map +1 -1
- package/build/dropdown-menu-v2/index.js +0 -1
- package/build/dropdown-menu-v2/index.js.map +1 -1
- package/build/dropdown-menu-v2/styles.js +15 -16
- package/build/dropdown-menu-v2/styles.js.map +1 -1
- package/build/dropdown-menu-v2/types.js.map +1 -1
- package/build/font-size-picker/font-size-picker-select.js +2 -2
- package/build/font-size-picker/font-size-picker-select.js.map +1 -1
- package/build/font-size-picker/index.js +1 -1
- package/build/font-size-picker/index.js.map +1 -1
- package/build/font-size-picker/utils.js +0 -4
- package/build/font-size-picker/utils.js.map +1 -1
- package/build/form-token-field/token.js +4 -1
- package/build/form-token-field/token.js.map +1 -1
- package/build/higher-order/with-spoken-messages/index.js +1 -2
- package/build/higher-order/with-spoken-messages/index.js.map +1 -1
- package/build/menu-items-choice/types.js.map +1 -1
- package/build/popover/index.js +0 -4
- package/build/popover/index.js.map +1 -1
- package/build/popover/utils.js +0 -1
- package/build/popover/utils.js.map +1 -1
- package/build/private-apis.js +2 -4
- package/build/private-apis.js.map +1 -1
- package/build/progress-bar/styles.js +19 -13
- package/build/progress-bar/styles.js.map +1 -1
- package/build/radio-group/context.js +0 -1
- package/build/radio-group/context.js.map +1 -1
- package/build/radio-group/index.js +0 -1
- package/build/radio-group/index.js.map +1 -1
- package/build/radio-group/radio.js +0 -1
- package/build/radio-group/radio.js.map +1 -1
- package/build/range-control/index.js +4 -1
- package/build/range-control/index.js.map +1 -1
- package/build/range-control/styles/range-control-styles.js +34 -28
- package/build/range-control/styles/range-control-styles.js.map +1 -1
- package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build/select-control/index.js +1 -2
- package/build/select-control/index.js.map +1 -1
- package/build/select-control/styles/select-control-styles.js +13 -8
- package/build/select-control/styles/select-control-styles.js.map +1 -1
- package/build/tab-panel/index.js +0 -1
- package/build/tab-panel/index.js.map +1 -1
- package/build/tabs/index.js +0 -1
- package/build/tabs/index.js.map +1 -1
- package/build/tabs/styles.js +3 -5
- package/build/tabs/styles.js.map +1 -1
- package/build/tabs/tablist.js +148 -37
- package/build/tabs/tablist.js.map +1 -1
- package/build/tabs/types.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/as-radio-group.js +0 -2
- package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js +0 -2
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/component.js +0 -4
- package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
- package/build/toolbar/toolbar/toolbar-container.js +0 -1
- package/build/toolbar/toolbar/toolbar-container.js.map +1 -1
- package/build/toolbar/toolbar/types.js.map +1 -1
- package/build/toolbar/toolbar-button/index.js +27 -19
- package/build/toolbar/toolbar-button/index.js.map +1 -1
- package/build/toolbar/toolbar-button/types.js.map +1 -1
- package/build/toolbar/toolbar-context/index.js +0 -1
- package/build/toolbar/toolbar-context/index.js.map +1 -1
- package/build/toolbar/toolbar-item/index.js +1 -1
- package/build/toolbar/toolbar-item/index.js.map +1 -1
- package/build/tooltip/index.js +3 -2
- package/build/tooltip/index.js.map +1 -1
- package/build/tooltip/types.js.map +1 -1
- package/build/unit-control/index.js +3 -3
- package/build/unit-control/index.js.map +1 -1
- package/build/unit-control/styles/unit-control-styles.js +7 -7
- package/build/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build/utils/hooks/use-update-effect.js +4 -1
- package/build/utils/hooks/use-update-effect.js.map +1 -1
- package/build-module/animation/index.js +0 -1
- package/build-module/animation/index.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.js +1 -0
- package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/base-control/index.js +13 -6
- package/build-module/base-control/index.js.map +1 -1
- package/build-module/border-box-control/border-box-control-visualizer/component.js +0 -4
- package/build-module/border-box-control/border-box-control-visualizer/component.js.map +1 -1
- package/build-module/button/index.js +5 -3
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/types.js.map +1 -1
- package/build-module/combobox-control/index.js +4 -1
- package/build-module/combobox-control/index.js.map +1 -1
- package/build-module/composite/current/index.js +0 -3
- package/build-module/composite/current/index.js.map +1 -1
- package/build-module/custom-select-control-v2/custom-select.js +58 -35
- package/build-module/custom-select-control-v2/custom-select.js.map +1 -1
- package/build-module/custom-select-control-v2/default-component/index.js +0 -1
- package/build-module/custom-select-control-v2/default-component/index.js.map +1 -1
- package/build-module/custom-select-control-v2/item.js +2 -0
- package/build-module/custom-select-control-v2/item.js.map +1 -1
- package/build-module/custom-select-control-v2/legacy-component/index.js +18 -6
- package/build-module/custom-select-control-v2/legacy-component/index.js.map +1 -1
- package/build-module/custom-select-control-v2/styles.js +88 -76
- package/build-module/custom-select-control-v2/styles.js.map +1 -1
- package/build-module/custom-select-control-v2/types.js.map +1 -1
- package/build-module/date-time/date-time/index.js +4 -1
- package/build-module/date-time/date-time/index.js.map +1 -1
- package/build-module/date-time/index.js +2 -1
- package/build-module/date-time/index.js.map +1 -1
- package/build-module/date-time/time/index.js +65 -149
- package/build-module/date-time/time/index.js.map +1 -1
- package/build-module/date-time/time-input/index.js +151 -0
- package/build-module/date-time/time-input/index.js.map +1 -0
- package/build-module/date-time/types.js.map +1 -1
- package/build-module/date-time/utils.js +61 -0
- package/build-module/date-time/utils.js.map +1 -1
- package/build-module/disclosure/index.js +0 -1
- package/build-module/disclosure/index.js.map +1 -1
- package/build-module/divider/component.js +0 -1
- package/build-module/divider/component.js.map +1 -1
- package/build-module/divider/types.js.map +1 -1
- package/build-module/dropdown-menu/index.js +1 -0
- package/build-module/dropdown-menu/index.js.map +1 -1
- package/build-module/dropdown-menu-v2/index.js +0 -1
- package/build-module/dropdown-menu-v2/index.js.map +1 -1
- package/build-module/dropdown-menu-v2/styles.js +14 -15
- package/build-module/dropdown-menu-v2/styles.js.map +1 -1
- package/build-module/dropdown-menu-v2/types.js.map +1 -1
- package/build-module/font-size-picker/font-size-picker-select.js +1 -1
- package/build-module/font-size-picker/font-size-picker-select.js.map +1 -1
- package/build-module/font-size-picker/index.js +1 -1
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/font-size-picker/utils.js +0 -4
- package/build-module/font-size-picker/utils.js.map +1 -1
- package/build-module/form-token-field/token.js +4 -1
- package/build-module/form-token-field/token.js.map +1 -1
- package/build-module/higher-order/with-spoken-messages/index.js +1 -2
- package/build-module/higher-order/with-spoken-messages/index.js.map +1 -1
- package/build-module/menu-items-choice/types.js.map +1 -1
- package/build-module/popover/index.js +0 -3
- package/build-module/popover/index.js.map +1 -1
- package/build-module/popover/utils.js +0 -1
- package/build-module/popover/utils.js.map +1 -1
- package/build-module/private-apis.js +2 -4
- package/build-module/private-apis.js.map +1 -1
- package/build-module/progress-bar/styles.js +21 -13
- package/build-module/progress-bar/styles.js.map +1 -1
- package/build-module/radio-group/context.js +0 -1
- package/build-module/radio-group/context.js.map +1 -1
- package/build-module/radio-group/index.js +0 -1
- package/build-module/radio-group/index.js.map +1 -1
- package/build-module/radio-group/radio.js +0 -1
- package/build-module/radio-group/radio.js.map +1 -1
- package/build-module/range-control/index.js +4 -1
- package/build-module/range-control/index.js.map +1 -1
- package/build-module/range-control/styles/range-control-styles.js +34 -28
- package/build-module/range-control/styles/range-control-styles.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build-module/select-control/index.js +2 -3
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/select-control/styles/select-control-styles.js +12 -7
- package/build-module/select-control/styles/select-control-styles.js.map +1 -1
- package/build-module/tab-panel/index.js +0 -1
- package/build-module/tab-panel/index.js.map +1 -1
- package/build-module/tabs/index.js +0 -1
- package/build-module/tabs/index.js.map +1 -1
- package/build-module/tabs/styles.js +3 -4
- package/build-module/tabs/styles.js.map +1 -1
- package/build-module/tabs/tablist.js +149 -38
- package/build-module/tabs/tablist.js.map +1 -1
- package/build-module/tabs/types.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +0 -1
- package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js +0 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +0 -2
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
- package/build-module/toolbar/toolbar/toolbar-container.js +0 -1
- package/build-module/toolbar/toolbar/toolbar-container.js.map +1 -1
- package/build-module/toolbar/toolbar/types.js.map +1 -1
- package/build-module/toolbar/toolbar-button/index.js +27 -19
- package/build-module/toolbar/toolbar-button/index.js.map +1 -1
- package/build-module/toolbar/toolbar-button/types.js.map +1 -1
- package/build-module/toolbar/toolbar-context/index.js +0 -1
- package/build-module/toolbar/toolbar-context/index.js.map +1 -1
- package/build-module/toolbar/toolbar-item/index.js +1 -1
- package/build-module/toolbar/toolbar-item/index.js.map +1 -1
- package/build-module/tooltip/index.js +3 -2
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/tooltip/types.js.map +1 -1
- package/build-module/unit-control/index.js +3 -3
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/unit-control/styles/unit-control-styles.js +7 -7
- package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build-module/utils/hooks/use-update-effect.js +4 -1
- package/build-module/utils/hooks/use-update-effect.js.map +1 -1
- package/build-style/style-rtl.css +18 -0
- package/build-style/style.css +18 -0
- package/build-types/animation/index.d.ts.map +1 -1
- package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
- package/build-types/autocomplete/index.d.ts.map +1 -1
- package/build-types/base-control/index.d.ts +6 -20
- package/build-types/base-control/index.d.ts.map +1 -1
- package/build-types/base-control/stories/index.story.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-visualizer/component.d.ts.map +1 -1
- package/build-types/button/deprecated.d.ts +4 -4
- package/build-types/button/index.d.ts.map +1 -1
- package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
- package/build-types/button/types.d.ts +27 -10
- package/build-types/button/types.d.ts.map +1 -1
- package/build-types/combobox-control/index.d.ts.map +1 -1
- package/build-types/composite/current/index.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/custom-select.d.ts +2 -2
- package/build-types/custom-select-control-v2/custom-select.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/default-component/index.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/item.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/legacy-component/index.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/stories/default.story.d.ts +6 -3
- package/build-types/custom-select-control-v2/stories/default.story.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/styles.d.ts +18 -26
- package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/types.d.ts +12 -2
- package/build-types/custom-select-control-v2/types.d.ts.map +1 -1
- package/build-types/date-time/date-time/index.d.ts.map +1 -1
- package/build-types/date-time/index.d.ts +2 -1
- package/build-types/date-time/index.d.ts.map +1 -1
- package/build-types/date-time/stories/time-input.story.d.ts +12 -0
- package/build-types/date-time/stories/time-input.story.d.ts.map +1 -0
- package/build-types/date-time/time/index.d.ts +1 -1
- package/build-types/date-time/time/index.d.ts.map +1 -1
- package/build-types/date-time/time-input/index.d.ts +5 -0
- package/build-types/date-time/time-input/index.d.ts.map +1 -0
- package/build-types/date-time/time-input/test/index.d.ts +2 -0
- package/build-types/date-time/time-input/test/index.d.ts.map +1 -0
- package/build-types/date-time/types.d.ts +54 -0
- package/build-types/date-time/types.d.ts.map +1 -1
- package/build-types/date-time/utils.d.ts +40 -0
- package/build-types/date-time/utils.d.ts.map +1 -1
- package/build-types/disclosure/index.d.ts.map +1 -1
- package/build-types/divider/component.d.ts.map +1 -1
- package/build-types/divider/types.d.ts.map +1 -1
- package/build-types/dropdown-menu/index.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/index.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/styles.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/types.d.ts.map +1 -1
- package/build-types/font-size-picker/styles.d.ts +1 -1
- package/build-types/font-size-picker/utils.d.ts.map +1 -1
- package/build-types/form-token-field/token.d.ts.map +1 -1
- package/build-types/higher-order/with-spoken-messages/index.d.ts +1 -2
- package/build-types/higher-order/with-spoken-messages/index.d.ts.map +1 -1
- package/build-types/menu-items-choice/types.d.ts +1 -1
- package/build-types/menu-items-choice/types.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/component.d.ts +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +1 -1
- package/build-types/navigator/navigator-button/component.d.ts +1 -1
- package/build-types/navigator/navigator-button/hook.d.ts +1 -1
- package/build-types/navigator/navigator-to-parent-button/component.d.ts +1 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/popover/utils.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/progress-bar/styles.d.ts.map +1 -1
- package/build-types/radio-group/context.d.ts.map +1 -1
- package/build-types/radio-group/index.d.ts.map +1 -1
- package/build-types/radio-group/radio.d.ts.map +1 -1
- package/build-types/range-control/index.d.ts.map +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/utils.d.ts +2 -2
- package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
- package/build-types/select-control/index.d.ts.map +1 -1
- package/build-types/select-control/styles/select-control-styles.d.ts +5 -0
- package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
- package/build-types/tab-panel/index.d.ts.map +1 -1
- package/build-types/tabs/index.d.ts.map +1 -1
- package/build-types/tabs/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/styles.d.ts.map +1 -1
- package/build-types/tabs/tablist.d.ts.map +1 -1
- package/build-types/tabs/types.d.ts.map +1 -1
- package/build-types/theme/stories/index.story.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
- package/build-types/toolbar/toolbar/toolbar-container.d.ts.map +1 -1
- package/build-types/toolbar/toolbar/types.d.ts +6 -0
- package/build-types/toolbar/toolbar/types.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-button/index.d.ts +3 -96
- package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-button/types.d.ts +18 -0
- package/build-types/toolbar/toolbar-button/types.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-context/index.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-item/index.d.ts +1 -3
- package/build-types/toolbar/toolbar-item/index.d.ts.map +1 -1
- package/build-types/tooltip/index.d.ts.map +1 -1
- package/build-types/tooltip/types.d.ts +4 -0
- package/build-types/tooltip/types.d.ts.map +1 -1
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
- package/build-types/utils/hooks/use-update-effect.d.ts +1 -1
- package/build-types/utils/hooks/use-update-effect.d.ts.map +1 -1
- package/package.json +19 -19
- package/src/animation/index.tsx +0 -1
- package/src/autocomplete/autocompleter-ui.tsx +1 -0
- package/src/autocomplete/index.tsx +0 -1
- package/src/base-control/index.tsx +16 -6
- package/src/base-control/stories/index.story.tsx +0 -1
- package/src/border-box-control/border-box-control-visualizer/component.tsx +0 -5
- package/src/button/README.md +13 -0
- package/src/button/index.tsx +6 -4
- package/src/button/stories/e2e/index.story.tsx +2 -1
- package/src/button/test/index.tsx +17 -2
- package/src/button/types.ts +27 -10
- package/src/combobox-control/index.tsx +2 -0
- package/src/composite/current/index.ts +0 -2
- package/src/custom-select-control/test/index.js +42 -6
- package/src/custom-select-control-v2/custom-select.tsx +57 -22
- package/src/custom-select-control-v2/default-component/index.tsx +0 -1
- package/src/custom-select-control-v2/item.tsx +5 -1
- package/src/custom-select-control-v2/legacy-component/index.tsx +28 -7
- package/src/custom-select-control-v2/legacy-component/test/index.tsx +44 -8
- package/src/custom-select-control-v2/styles.ts +153 -83
- package/src/custom-select-control-v2/test/index.tsx +35 -5
- package/src/custom-select-control-v2/types.ts +18 -6
- package/src/date-time/README.md +8 -0
- package/src/date-time/date-time/index.tsx +2 -1
- package/src/date-time/index.ts +2 -1
- package/src/date-time/stories/time-input.story.tsx +36 -0
- package/src/date-time/time/index.tsx +77 -194
- package/src/date-time/time/test/index.tsx +61 -0
- package/src/date-time/time-input/index.tsx +196 -0
- package/src/date-time/time-input/test/index.tsx +171 -0
- package/src/date-time/types.ts +63 -0
- package/src/date-time/utils.ts +69 -0
- package/src/dimension-control/test/__snapshots__/index.test.js.snap +116 -96
- package/src/disclosure/index.tsx +0 -1
- package/src/divider/component.tsx +0 -1
- package/src/divider/types.ts +0 -1
- package/src/dropdown-menu/index.tsx +1 -0
- package/src/dropdown-menu-v2/index.tsx +0 -1
- package/src/dropdown-menu-v2/styles.ts +0 -1
- package/src/dropdown-menu-v2/types.ts +0 -1
- package/src/font-size-picker/font-size-picker-select.tsx +1 -1
- package/src/font-size-picker/index.tsx +1 -1
- package/src/font-size-picker/test/index.tsx +6 -6
- package/src/font-size-picker/utils.ts +0 -5
- package/src/form-token-field/token.tsx +2 -0
- package/src/higher-order/navigate-regions/style.scss +25 -13
- package/src/higher-order/with-spoken-messages/index.tsx +1 -2
- package/src/menu-items-choice/types.ts +2 -1
- package/src/palette-edit/test/index.tsx +1 -0
- package/src/popover/index.tsx +0 -2
- package/src/popover/utils.ts +0 -1
- package/src/private-apis.ts +2 -5
- package/src/progress-bar/styles.ts +18 -9
- package/src/radio-group/context.tsx +0 -1
- package/src/radio-group/index.tsx +0 -1
- package/src/radio-group/radio.tsx +0 -1
- package/src/range-control/index.tsx +2 -0
- package/src/range-control/styles/range-control-styles.ts +6 -2
- package/src/resizable-box/resize-tooltip/utils.ts +1 -1
- package/src/select-control/index.tsx +3 -4
- package/src/select-control/styles/select-control-styles.ts +17 -6
- package/src/tab-panel/index.tsx +0 -1
- package/src/tabs/index.tsx +0 -1
- package/src/tabs/stories/index.story.tsx +25 -18
- package/src/tabs/styles.ts +18 -14
- package/src/tabs/tablist.tsx +187 -43
- package/src/tabs/types.ts +0 -1
- package/src/theme/stories/index.story.tsx +2 -0
- package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +0 -1
- package/src/toggle-group-control/toggle-group-control/component.tsx +0 -2
- package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +0 -2
- package/src/toolbar/toolbar/README.md +9 -0
- package/src/toolbar/toolbar/style.scss +7 -0
- package/src/toolbar/toolbar/toolbar-container.tsx +0 -1
- package/src/toolbar/toolbar/types.ts +6 -0
- package/src/toolbar/toolbar-button/index.tsx +30 -17
- package/src/toolbar/toolbar-button/types.ts +19 -0
- package/src/toolbar/toolbar-context/index.ts +0 -1
- package/src/toolbar/toolbar-item/index.tsx +1 -1
- package/src/tooltip/index.tsx +3 -2
- package/src/tooltip/test/index.tsx +18 -0
- package/src/tooltip/types.ts +4 -0
- package/src/unit-control/index.tsx +3 -2
- package/src/unit-control/styles/unit-control-styles.ts +10 -4
- package/src/utils/hooks/use-update-effect.js +8 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -204,14 +204,14 @@ describe.each( [
|
|
|
204
204
|
await press.Enter();
|
|
205
205
|
expect(
|
|
206
206
|
screen.getByRole( 'listbox', {
|
|
207
|
-
name:
|
|
207
|
+
name: legacyProps.label,
|
|
208
208
|
} )
|
|
209
209
|
).toBeVisible();
|
|
210
210
|
|
|
211
211
|
await press.Escape();
|
|
212
212
|
expect(
|
|
213
213
|
screen.queryByRole( 'listbox', {
|
|
214
|
-
name:
|
|
214
|
+
name: legacyProps.label,
|
|
215
215
|
} )
|
|
216
216
|
).not.toBeInTheDocument();
|
|
217
217
|
|
|
@@ -453,9 +453,18 @@ describe.each( [
|
|
|
453
453
|
);
|
|
454
454
|
} );
|
|
455
455
|
|
|
456
|
+
it( 'Should label the component correctly even when the label is not visible', () => {
|
|
457
|
+
render( <Component { ...legacyProps } hideLabelFromVision /> );
|
|
458
|
+
|
|
459
|
+
expect(
|
|
460
|
+
screen.getByRole( 'combobox', {
|
|
461
|
+
name: legacyProps.label,
|
|
462
|
+
} )
|
|
463
|
+
).toBeVisible();
|
|
464
|
+
} );
|
|
465
|
+
|
|
456
466
|
describe( 'Keyboard behavior and accessibility', () => {
|
|
457
|
-
|
|
458
|
-
it.skip( 'Captures the keypress event and does not let it propagate', async () => {
|
|
467
|
+
it( 'Captures the keypress event and does not let it propagate', async () => {
|
|
459
468
|
const onKeyDown = jest.fn();
|
|
460
469
|
|
|
461
470
|
render(
|
|
@@ -473,7 +482,7 @@ describe.each( [
|
|
|
473
482
|
await click( currentSelectedItem );
|
|
474
483
|
|
|
475
484
|
const customSelect = screen.getByRole( 'listbox', {
|
|
476
|
-
name:
|
|
485
|
+
name: legacyProps.label,
|
|
477
486
|
} );
|
|
478
487
|
expect( customSelect ).toHaveFocus();
|
|
479
488
|
await press.Enter();
|
|
@@ -495,7 +504,7 @@ describe.each( [
|
|
|
495
504
|
await press.Enter();
|
|
496
505
|
expect(
|
|
497
506
|
screen.getByRole( 'listbox', {
|
|
498
|
-
name:
|
|
507
|
+
name: legacyProps.label,
|
|
499
508
|
} )
|
|
500
509
|
).toHaveFocus();
|
|
501
510
|
|
|
@@ -519,7 +528,7 @@ describe.each( [
|
|
|
519
528
|
await press.Enter();
|
|
520
529
|
expect(
|
|
521
530
|
screen.getByRole( 'listbox', {
|
|
522
|
-
name:
|
|
531
|
+
name: legacyProps.label,
|
|
523
532
|
} )
|
|
524
533
|
).toHaveFocus();
|
|
525
534
|
|
|
@@ -547,7 +556,7 @@ describe.each( [
|
|
|
547
556
|
|
|
548
557
|
expect(
|
|
549
558
|
screen.queryByRole( 'listbox', {
|
|
550
|
-
name:
|
|
559
|
+
name: legacyProps.label,
|
|
551
560
|
hidden: true,
|
|
552
561
|
} )
|
|
553
562
|
).not.toBeInTheDocument();
|
|
@@ -558,6 +567,33 @@ describe.each( [
|
|
|
558
567
|
expect( currentSelectedItem ).toHaveTextContent( 'amber' );
|
|
559
568
|
} );
|
|
560
569
|
|
|
570
|
+
it( 'Can change selection with a focused input and closed dropdown while pressing arrow keys', async () => {
|
|
571
|
+
render( <Component { ...legacyProps } /> );
|
|
572
|
+
|
|
573
|
+
const currentSelectedItem = screen.getByRole( 'combobox', {
|
|
574
|
+
expanded: false,
|
|
575
|
+
} );
|
|
576
|
+
|
|
577
|
+
await sleep();
|
|
578
|
+
await press.Tab();
|
|
579
|
+
expect( currentSelectedItem ).toHaveFocus();
|
|
580
|
+
expect( currentSelectedItem ).toHaveTextContent(
|
|
581
|
+
legacyProps.options[ 0 ].name
|
|
582
|
+
);
|
|
583
|
+
|
|
584
|
+
await press.ArrowDown();
|
|
585
|
+
await press.ArrowDown();
|
|
586
|
+
expect(
|
|
587
|
+
screen.queryByRole( 'listbox', {
|
|
588
|
+
name: legacyProps.label,
|
|
589
|
+
} )
|
|
590
|
+
).not.toBeInTheDocument();
|
|
591
|
+
|
|
592
|
+
expect( currentSelectedItem ).toHaveTextContent(
|
|
593
|
+
legacyProps.options[ 2 ].name
|
|
594
|
+
);
|
|
595
|
+
} );
|
|
596
|
+
|
|
561
597
|
it( 'Should have correct aria-selected value for selections', async () => {
|
|
562
598
|
render( <Component { ...legacyProps } /> );
|
|
563
599
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
// eslint-disable-next-line no-restricted-imports
|
|
5
4
|
import * as Ariakit from '@ariakit/react';
|
|
6
5
|
import { css } from '@emotion/react';
|
|
7
6
|
import styled from '@emotion/styled';
|
|
@@ -11,124 +10,195 @@ import styled from '@emotion/styled';
|
|
|
11
10
|
import { COLORS, CONFIG } from '../utils';
|
|
12
11
|
import { space } from '../utils/space';
|
|
13
12
|
import { chevronIconSize } from '../select-control/styles/select-control-styles';
|
|
13
|
+
import { fontSizeStyles } from '../input-control/styles/input-control-styles';
|
|
14
14
|
import type { CustomSelectButtonSize } from './types';
|
|
15
15
|
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
16
|
+
const INLINE_PADDING = {
|
|
17
|
+
compact: 8, // space(2)
|
|
18
|
+
small: 8, // space(2)
|
|
19
|
+
default: 16, // space(4)
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const getSelectSize = (
|
|
23
|
+
size: NonNullable< CustomSelectButtonSize[ 'size' ] >,
|
|
24
|
+
heightProperty: 'minHeight' | 'height'
|
|
25
|
+
) => {
|
|
26
|
+
const sizes = {
|
|
27
|
+
compact: {
|
|
28
|
+
[ heightProperty ]: 32,
|
|
29
|
+
paddingInlineStart: INLINE_PADDING.compact,
|
|
30
|
+
paddingInlineEnd: INLINE_PADDING.compact + chevronIconSize,
|
|
31
|
+
},
|
|
32
|
+
default: {
|
|
33
|
+
[ heightProperty ]: 40,
|
|
34
|
+
paddingInlineStart: INLINE_PADDING.default,
|
|
35
|
+
paddingInlineEnd: INLINE_PADDING.default + chevronIconSize,
|
|
36
|
+
},
|
|
37
|
+
small: {
|
|
38
|
+
[ heightProperty ]: 24,
|
|
39
|
+
paddingInlineStart: INLINE_PADDING.small,
|
|
40
|
+
paddingInlineEnd: INLINE_PADDING.small + chevronIconSize,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
38
43
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
return sizes[ size ] || sizes.default;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const getSelectItemSize = (
|
|
48
|
+
size: NonNullable< CustomSelectButtonSize[ 'size' ] >
|
|
49
|
+
) => {
|
|
50
|
+
// Used to visually align the checkmark with the chevron
|
|
51
|
+
const checkmarkCorrection = 6;
|
|
52
|
+
const sizes = {
|
|
53
|
+
compact: {
|
|
54
|
+
paddingInlineStart: INLINE_PADDING.compact,
|
|
55
|
+
paddingInlineEnd: INLINE_PADDING.compact - checkmarkCorrection,
|
|
56
|
+
},
|
|
57
|
+
default: {
|
|
58
|
+
paddingInlineStart: INLINE_PADDING.default,
|
|
59
|
+
paddingInlineEnd: INLINE_PADDING.default - checkmarkCorrection,
|
|
60
|
+
},
|
|
61
|
+
small: {
|
|
62
|
+
paddingInlineStart: INLINE_PADDING.small,
|
|
63
|
+
paddingInlineEnd: INLINE_PADDING.small - checkmarkCorrection,
|
|
64
|
+
},
|
|
65
|
+
};
|
|
44
66
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
font-weight: 500;
|
|
48
|
-
line-height: 1.4;
|
|
49
|
-
text-transform: uppercase;
|
|
50
|
-
margin-bottom: ${ space( 2 ) };
|
|
51
|
-
`;
|
|
67
|
+
return sizes[ size ] || sizes.default;
|
|
68
|
+
};
|
|
52
69
|
|
|
53
70
|
export const Select = styled( Ariakit.Select, {
|
|
54
71
|
// Do not forward `hasCustomRenderProp` to the underlying Ariakit.Select component
|
|
55
72
|
shouldForwardProp: ( prop ) => prop !== 'hasCustomRenderProp',
|
|
56
|
-
} )(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const getSize = () => {
|
|
66
|
-
const sizes = {
|
|
67
|
-
compact: {
|
|
68
|
-
[ heightProperty ]: 32,
|
|
69
|
-
paddingInlineStart: 8,
|
|
70
|
-
paddingInlineEnd: 8 + chevronIconSize,
|
|
71
|
-
},
|
|
72
|
-
default: {
|
|
73
|
-
[ heightProperty ]: 40,
|
|
74
|
-
paddingInlineStart: 16,
|
|
75
|
-
paddingInlineEnd: 16 + chevronIconSize,
|
|
76
|
-
},
|
|
77
|
-
small: {
|
|
78
|
-
[ heightProperty ]: 24,
|
|
79
|
-
paddingInlineStart: 8,
|
|
80
|
-
paddingInlineEnd: 8 + chevronIconSize,
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
return sizes[ size ] || sizes.default;
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
return css`
|
|
73
|
+
} )(
|
|
74
|
+
( {
|
|
75
|
+
size,
|
|
76
|
+
hasCustomRenderProp,
|
|
77
|
+
}: {
|
|
78
|
+
size: NonNullable< CustomSelectButtonSize[ 'size' ] >;
|
|
79
|
+
hasCustomRenderProp: boolean;
|
|
80
|
+
} ) => css`
|
|
88
81
|
display: block;
|
|
89
82
|
background-color: ${ COLORS.theme.background };
|
|
90
83
|
border: none;
|
|
91
84
|
color: ${ COLORS.theme.foreground };
|
|
92
85
|
cursor: pointer;
|
|
93
86
|
font-family: inherit;
|
|
94
|
-
|
|
95
|
-
|
|
87
|
+
text-align: start;
|
|
88
|
+
user-select: none;
|
|
96
89
|
width: 100%;
|
|
97
90
|
|
|
98
91
|
&[data-focus-visible] {
|
|
99
92
|
outline: none; // handled by InputBase component
|
|
100
93
|
}
|
|
101
94
|
|
|
102
|
-
${
|
|
95
|
+
${ getSelectSize( size, hasCustomRenderProp ? 'minHeight' : 'height' ) }
|
|
103
96
|
${ ! hasCustomRenderProp && truncateStyles }
|
|
104
|
-
|
|
105
|
-
|
|
97
|
+
${ fontSizeStyles( { inputSize: size } ) }
|
|
98
|
+
`
|
|
99
|
+
);
|
|
106
100
|
|
|
107
101
|
export const SelectPopover = styled( Ariakit.SelectPopover )`
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-direction: column;
|
|
104
|
+
|
|
105
|
+
background-color: ${ COLORS.theme.background };
|
|
108
106
|
border-radius: 2px;
|
|
109
|
-
background: ${ COLORS.theme.background };
|
|
110
107
|
border: 1px solid ${ COLORS.theme.foreground };
|
|
111
108
|
|
|
109
|
+
/* z-index(".components-popover") */
|
|
110
|
+
z-index: 1000000;
|
|
111
|
+
|
|
112
|
+
max-height: min( var( --popover-available-height, 400px ), 400px );
|
|
113
|
+
overflow: auto;
|
|
114
|
+
overscroll-behavior: contain;
|
|
115
|
+
|
|
116
|
+
// The smallest size without overflowing the container.
|
|
117
|
+
min-width: min-content;
|
|
118
|
+
|
|
112
119
|
&[data-focus-visible] {
|
|
113
120
|
outline: none; // outline will be on the trigger, rather than the popover
|
|
114
121
|
}
|
|
115
122
|
`;
|
|
116
123
|
|
|
117
|
-
export const SelectItem = styled( Ariakit.SelectItem )
|
|
124
|
+
export const SelectItem = styled( Ariakit.SelectItem )(
|
|
125
|
+
( {
|
|
126
|
+
size,
|
|
127
|
+
}: {
|
|
128
|
+
size: NonNullable< CustomSelectButtonSize[ 'size' ] >;
|
|
129
|
+
} ) => css`
|
|
130
|
+
cursor: default;
|
|
131
|
+
display: flex;
|
|
132
|
+
align-items: center;
|
|
133
|
+
justify-content: space-between;
|
|
134
|
+
font-size: ${ CONFIG.fontSize };
|
|
135
|
+
// TODO: reassess line-height for non-legacy v2
|
|
136
|
+
line-height: 28px;
|
|
137
|
+
padding-block: ${ space( 2 ) };
|
|
138
|
+
scroll-margin: ${ space( 1 ) };
|
|
139
|
+
user-select: none;
|
|
140
|
+
|
|
141
|
+
&[aria-disabled='true'] {
|
|
142
|
+
cursor: not-allowed;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
&[data-active-item] {
|
|
146
|
+
background-color: ${ COLORS.theme.gray[ 300 ] };
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
${ getSelectItemSize( size ) }
|
|
150
|
+
`
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
const truncateStyles = css`
|
|
154
|
+
overflow: hidden;
|
|
155
|
+
text-overflow: ellipsis;
|
|
156
|
+
white-space: nowrap;
|
|
157
|
+
`;
|
|
158
|
+
|
|
159
|
+
export const SelectedExperimentalHintWrapper = styled.div`
|
|
160
|
+
${ truncateStyles }
|
|
161
|
+
`;
|
|
162
|
+
|
|
163
|
+
export const SelectedExperimentalHintItem = styled.span`
|
|
164
|
+
color: ${ COLORS.theme.gray[ 600 ] };
|
|
165
|
+
margin-inline-start: ${ space( 2 ) };
|
|
166
|
+
`;
|
|
167
|
+
|
|
168
|
+
export const WithHintItemWrapper = styled.div`
|
|
118
169
|
display: flex;
|
|
119
|
-
align-items: center;
|
|
120
170
|
justify-content: space-between;
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
171
|
+
align-items: center;
|
|
172
|
+
flex-wrap: wrap;
|
|
173
|
+
flex: 1;
|
|
174
|
+
column-gap: ${ space( 4 ) };
|
|
175
|
+
`;
|
|
176
|
+
|
|
177
|
+
export const WithHintItemHint = styled.span`
|
|
178
|
+
color: ${ COLORS.theme.gray[ 600 ] };
|
|
179
|
+
text-align: initial;
|
|
180
|
+
line-height: ${ CONFIG.fontLineHeightBase };
|
|
181
|
+
padding-inline-end: ${ space( 1 ) };
|
|
182
|
+
margin-block: ${ space( 1 ) };
|
|
127
183
|
`;
|
|
128
184
|
|
|
129
185
|
export const SelectedItemCheck = styled( Ariakit.SelectItemCheck )`
|
|
130
186
|
display: flex;
|
|
131
187
|
align-items: center;
|
|
132
|
-
margin-inline-start: ${
|
|
133
|
-
|
|
188
|
+
margin-inline-start: ${ space( 2 ) };
|
|
189
|
+
|
|
190
|
+
// Keep the checkmark vertically aligned at the top. Since the item text has a
|
|
191
|
+
// 28px line height and the checkmark is 24px tall, a (28-24)/2 = 2px margin
|
|
192
|
+
// is applied to keep the correct alignment between the text and the checkmark.
|
|
193
|
+
align-self: start;
|
|
194
|
+
margin-block-start: 2px;
|
|
195
|
+
|
|
196
|
+
// Since the checkmark's dimensions are applied with 'em' units, setting a
|
|
197
|
+
// font size of 0 allows the space reserved for the checkmark to collapse for
|
|
198
|
+
// items that are not selected or that don't have an associated item hint.
|
|
199
|
+
font-size: 0;
|
|
200
|
+
${ WithHintItemWrapper } ~ &,
|
|
201
|
+
&:not(:empty) {
|
|
202
|
+
font-size: 24px; // Size of checkmark icon
|
|
203
|
+
}
|
|
134
204
|
`;
|
|
@@ -105,14 +105,14 @@ describe.each( [
|
|
|
105
105
|
await press.Enter();
|
|
106
106
|
expect(
|
|
107
107
|
screen.getByRole( 'listbox', {
|
|
108
|
-
name:
|
|
108
|
+
name: defaultProps.label,
|
|
109
109
|
} )
|
|
110
110
|
).toBeVisible();
|
|
111
111
|
|
|
112
112
|
await press.Escape();
|
|
113
113
|
expect(
|
|
114
114
|
screen.queryByRole( 'listbox', {
|
|
115
|
-
name:
|
|
115
|
+
name: defaultProps.label,
|
|
116
116
|
} )
|
|
117
117
|
).not.toBeInTheDocument();
|
|
118
118
|
|
|
@@ -134,7 +134,7 @@ describe.each( [
|
|
|
134
134
|
await press.Enter();
|
|
135
135
|
expect(
|
|
136
136
|
screen.getByRole( 'listbox', {
|
|
137
|
-
name:
|
|
137
|
+
name: defaultProps.label,
|
|
138
138
|
} )
|
|
139
139
|
).toHaveFocus();
|
|
140
140
|
|
|
@@ -156,7 +156,7 @@ describe.each( [
|
|
|
156
156
|
await press.Enter();
|
|
157
157
|
expect(
|
|
158
158
|
screen.getByRole( 'listbox', {
|
|
159
|
-
name:
|
|
159
|
+
name: defaultProps.label,
|
|
160
160
|
} )
|
|
161
161
|
).toHaveFocus();
|
|
162
162
|
|
|
@@ -182,7 +182,7 @@ describe.each( [
|
|
|
182
182
|
|
|
183
183
|
expect(
|
|
184
184
|
screen.queryByRole( 'listbox', {
|
|
185
|
-
name:
|
|
185
|
+
name: defaultProps.label,
|
|
186
186
|
hidden: true,
|
|
187
187
|
} )
|
|
188
188
|
).not.toBeInTheDocument();
|
|
@@ -416,4 +416,34 @@ describe.each( [
|
|
|
416
416
|
screen.getByRole( 'option', { name: 'july-9' } )
|
|
417
417
|
).toBeVisible();
|
|
418
418
|
} );
|
|
419
|
+
|
|
420
|
+
it( 'Should open the select popover when focussing the trigger button and pressing arrow down', async () => {
|
|
421
|
+
render( <Component { ...defaultProps } /> );
|
|
422
|
+
|
|
423
|
+
const currentSelectedItem = screen.getByRole( 'combobox', {
|
|
424
|
+
expanded: false,
|
|
425
|
+
} );
|
|
426
|
+
|
|
427
|
+
await sleep();
|
|
428
|
+
await press.Tab();
|
|
429
|
+
expect( currentSelectedItem ).toHaveFocus();
|
|
430
|
+
expect( currentSelectedItem ).toHaveTextContent( items[ 0 ].value );
|
|
431
|
+
|
|
432
|
+
await press.ArrowDown();
|
|
433
|
+
expect(
|
|
434
|
+
screen.getByRole( 'listbox', {
|
|
435
|
+
name: defaultProps.label,
|
|
436
|
+
} )
|
|
437
|
+
).toBeVisible();
|
|
438
|
+
} );
|
|
439
|
+
|
|
440
|
+
it( 'Should label the component correctly even when the label is not visible', () => {
|
|
441
|
+
render( <Component { ...defaultProps } hideLabelFromVision /> );
|
|
442
|
+
|
|
443
|
+
expect(
|
|
444
|
+
screen.getByRole( 'combobox', {
|
|
445
|
+
name: defaultProps.label,
|
|
446
|
+
} )
|
|
447
|
+
).toBeVisible();
|
|
448
|
+
} );
|
|
419
449
|
} );
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
// eslint-disable-next-line no-restricted-imports
|
|
5
4
|
import type * as Ariakit from '@ariakit/react';
|
|
6
5
|
import type { FocusEventHandler, MouseEventHandler } from 'react';
|
|
7
6
|
|
|
@@ -12,8 +11,6 @@ export type CustomSelectStore = {
|
|
|
12
11
|
store: Ariakit.SelectStore;
|
|
13
12
|
};
|
|
14
13
|
|
|
15
|
-
export type CustomSelectContext = CustomSelectStore | undefined;
|
|
16
|
-
|
|
17
14
|
type CustomSelectSize< Size = 'compact' | 'default' > = {
|
|
18
15
|
/**
|
|
19
16
|
* The size of the control.
|
|
@@ -27,6 +24,10 @@ export type CustomSelectButtonSize = CustomSelectSize<
|
|
|
27
24
|
'compact' | 'default' | 'small'
|
|
28
25
|
>;
|
|
29
26
|
|
|
27
|
+
export type CustomSelectContext =
|
|
28
|
+
| ( CustomSelectStore & CustomSelectButtonSize )
|
|
29
|
+
| undefined;
|
|
30
|
+
|
|
30
31
|
export type CustomSelectButtonProps = {
|
|
31
32
|
/**
|
|
32
33
|
* An optional default value for the control when used in uncontrolled mode.
|
|
@@ -49,7 +50,20 @@ export type CustomSelectButtonProps = {
|
|
|
49
50
|
value?: string | string[];
|
|
50
51
|
};
|
|
51
52
|
|
|
53
|
+
// Props only exposed on the internal implementation
|
|
54
|
+
export type _CustomSelectInternalProps = {
|
|
55
|
+
/**
|
|
56
|
+
* True if the consumer is emulating the legacy component behavior and look
|
|
57
|
+
*/
|
|
58
|
+
isLegacy?: boolean;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// Props that are exposed in exported components
|
|
52
62
|
export type _CustomSelectProps = CustomSelectButtonProps & {
|
|
63
|
+
/**
|
|
64
|
+
* Additional className added to the root wrapper element.
|
|
65
|
+
*/
|
|
66
|
+
className?: string;
|
|
53
67
|
/**
|
|
54
68
|
* The child elements. This should be composed of `CustomSelectItem` components.
|
|
55
69
|
*/
|
|
@@ -66,9 +80,7 @@ export type _CustomSelectProps = CustomSelectButtonProps & {
|
|
|
66
80
|
label: string;
|
|
67
81
|
};
|
|
68
82
|
|
|
69
|
-
export type CustomSelectProps = _CustomSelectProps &
|
|
70
|
-
CustomSelectButtonProps &
|
|
71
|
-
CustomSelectSize;
|
|
83
|
+
export type CustomSelectProps = _CustomSelectProps & CustomSelectSize;
|
|
72
84
|
|
|
73
85
|
/**
|
|
74
86
|
* The legacy object structure for the options array.
|
package/src/date-time/README.md
CHANGED
|
@@ -56,6 +56,14 @@ Whether we use a 12-hour clock. With a 12-hour clock, an AM/PM widget is display
|
|
|
56
56
|
- Required: No
|
|
57
57
|
- Default: false
|
|
58
58
|
|
|
59
|
+
### `dateOrder`: `'dmy' | 'mdy' | 'ymd'`
|
|
60
|
+
|
|
61
|
+
The order of day, month, and year. This prop overrides the time format determined by `is12Hour` prop.
|
|
62
|
+
|
|
63
|
+
- Type: `string`
|
|
64
|
+
- Required: No
|
|
65
|
+
- Default: `'dmy'`
|
|
66
|
+
|
|
59
67
|
### `isInvalidDate`: `( date: Date ) => boolean`
|
|
60
68
|
|
|
61
69
|
A callback function which receives a Date object representing a day as an argument, and should return a Boolean to signify if the day is valid or not.
|
|
@@ -7,7 +7,6 @@ import type { ForwardedRef } from 'react';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { forwardRef } from '@wordpress/element';
|
|
10
|
-
import { __, _x } from '@wordpress/i18n';
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* Internal dependencies
|
|
@@ -25,6 +24,7 @@ function UnforwardedDateTimePicker(
|
|
|
25
24
|
{
|
|
26
25
|
currentDate,
|
|
27
26
|
is12Hour,
|
|
27
|
+
dateOrder,
|
|
28
28
|
isInvalidDate,
|
|
29
29
|
onMonthPreviewed = noop,
|
|
30
30
|
onChange,
|
|
@@ -40,6 +40,7 @@ function UnforwardedDateTimePicker(
|
|
|
40
40
|
currentTime={ currentDate }
|
|
41
41
|
onChange={ onChange }
|
|
42
42
|
is12Hour={ is12Hour }
|
|
43
|
+
dateOrder={ dateOrder }
|
|
43
44
|
/>
|
|
44
45
|
<DatePicker
|
|
45
46
|
currentDate={ currentDate }
|
package/src/date-time/index.ts
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { default as DatePicker } from './date';
|
|
5
5
|
import { default as TimePicker } from './time';
|
|
6
|
+
import { default as TimeInput } from './time-input';
|
|
6
7
|
import { default as DateTimePicker } from './date-time';
|
|
7
8
|
|
|
8
|
-
export { DatePicker, TimePicker };
|
|
9
|
+
export { DatePicker, TimePicker, TimeInput };
|
|
9
10
|
export default DateTimePicker;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Meta, StoryFn } from '@storybook/react';
|
|
5
|
+
import { action } from '@storybook/addon-actions';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import { TimeInput } from '../time-input';
|
|
11
|
+
|
|
12
|
+
const meta: Meta< typeof TimeInput > = {
|
|
13
|
+
title: 'Components/TimeInput',
|
|
14
|
+
component: TimeInput,
|
|
15
|
+
argTypes: {
|
|
16
|
+
onChange: { action: 'onChange', control: { type: null } },
|
|
17
|
+
},
|
|
18
|
+
tags: [ 'status-wip' ],
|
|
19
|
+
parameters: {
|
|
20
|
+
controls: { expanded: true },
|
|
21
|
+
docs: { canvas: { sourceState: 'shown' } },
|
|
22
|
+
},
|
|
23
|
+
args: {
|
|
24
|
+
onChange: action( 'onChange' ),
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
export default meta;
|
|
28
|
+
|
|
29
|
+
const Template: StoryFn< typeof TimeInput > = ( args ) => {
|
|
30
|
+
return <TimeInput { ...args } />;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const Default: StoryFn< typeof TimeInput > = Template.bind( {} );
|
|
34
|
+
Default.args = {
|
|
35
|
+
label: 'Time',
|
|
36
|
+
};
|