@wordpress/components 23.1.0 → 23.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 +53 -0
- package/CONTRIBUTING.md +1 -1
- package/LICENSE.md +1 -1
- package/build/alignment-matrix-control/utils.js +2 -2
- package/build/alignment-matrix-control/utils.js.map +1 -1
- package/build/autocomplete/autocompleter-ui.js +1 -3
- package/build/autocomplete/autocompleter-ui.js.map +1 -1
- package/build/border-box-control/border-box-control-linked-button/component.js.map +1 -1
- package/build/border-box-control/border-box-control-linked-button/hook.js.map +1 -1
- package/build/border-control/border-control-dropdown/component.js +8 -4
- package/build/border-control/border-control-dropdown/component.js.map +1 -1
- package/build/button/deprecated.js +8 -6
- package/build/button/deprecated.js.map +1 -1
- package/build/button/index.js +52 -23
- package/build/button/index.js.map +1 -1
- package/build/button/types.js +6 -0
- package/build/button/types.js.map +1 -0
- package/build/color-list-picker/index.js.map +1 -1
- package/build/color-list-picker/types.js +6 -0
- package/build/color-list-picker/types.js.map +1 -0
- package/build/color-palette/index.js +9 -61
- package/build/color-palette/index.js.map +1 -1
- package/build/color-palette/index.native.js +24 -9
- package/build/color-palette/index.native.js.map +1 -1
- package/build/color-palette/utils.js +103 -0
- package/build/color-palette/utils.js.map +1 -0
- package/build/color-picker/component.js +1 -0
- package/build/color-picker/component.js.map +1 -1
- package/build/color-picker/styles.js +8 -10
- package/build/color-picker/styles.js.map +1 -1
- package/build/combobox-control/index.js +5 -1
- package/build/combobox-control/index.js.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/utils.js +1 -1
- package/build/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
- package/build/date-time/date/index.js.map +1 -1
- package/build/dropdown/index.js +20 -8
- package/build/dropdown/index.js.map +1 -1
- package/build/focal-point-picker/utils.js +1 -1
- package/build/focal-point-picker/utils.js.map +1 -1
- package/build/form-token-field/token.js +1 -1
- package/build/form-token-field/token.js.map +1 -1
- package/build/gradient-picker/index.js +9 -1
- package/build/gradient-picker/index.js.map +1 -1
- package/build/h-stack/component.js +0 -1
- package/build/h-stack/component.js.map +1 -1
- package/build/index.js +7 -17
- package/build/index.js.map +1 -1
- package/build/index.native.js +8 -18
- package/build/index.native.js.map +1 -1
- package/build/input-control/input-field.js +4 -2
- package/build/input-control/input-field.js.map +1 -1
- package/build/item-group/item/component.js +27 -3
- package/build/item-group/item/component.js.map +1 -1
- package/build/item-group/item-group/component.js +26 -3
- package/build/item-group/item-group/component.js.map +1 -1
- package/build/item-group/styles.js +14 -14
- package/build/item-group/styles.js.map +1 -1
- package/build/keyboard-shortcuts/index.js +44 -16
- package/build/keyboard-shortcuts/index.js.map +1 -1
- package/build/keyboard-shortcuts/types.js +6 -0
- package/build/keyboard-shortcuts/types.js.map +1 -0
- package/build/modal/index.js +1 -1
- package/build/modal/index.js.map +1 -1
- package/build/notice/index.js +16 -18
- package/build/notice/index.js.map +1 -1
- package/build/notice/list.js +23 -8
- package/build/notice/list.js.map +1 -1
- package/build/notice/types.js +6 -0
- package/build/notice/types.js.map +1 -0
- package/build/number-control/index.js +1 -1
- package/build/number-control/index.js.map +1 -1
- package/build/panel/row.js +5 -3
- package/build/panel/row.js.map +1 -1
- package/build/query-controls/author-select.js +7 -3
- package/build/query-controls/author-select.js.map +1 -1
- package/build/query-controls/category-select.js +7 -3
- package/build/query-controls/category-select.js.map +1 -1
- package/build/query-controls/index.js +69 -20
- package/build/query-controls/index.js.map +1 -1
- package/build/query-controls/terms.js +4 -3
- package/build/query-controls/terms.js.map +1 -1
- package/build/query-controls/types.js +6 -0
- package/build/query-controls/types.js.map +1 -0
- package/build/resizable-box/index.js +5 -4
- package/build/resizable-box/index.js.map +1 -1
- package/build/responsive-wrapper/index.js +18 -1
- package/build/responsive-wrapper/index.js.map +1 -1
- package/build/responsive-wrapper/types.js +6 -0
- package/build/responsive-wrapper/types.js.map +1 -0
- package/build/sandbox/index.js +35 -24
- package/build/sandbox/index.js.map +1 -1
- package/build/sandbox/types.js +6 -0
- package/build/sandbox/types.js.map +1 -0
- package/build/slot-fill/bubbles-virtually/fill.js +1 -0
- package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build/slot-fill/slot.js +1 -0
- package/build/slot-fill/slot.js.map +1 -1
- package/build/slot-fill/use-slot.js +1 -11
- package/build/slot-fill/use-slot.js.map +1 -1
- package/build/snackbar/index.js.map +1 -1
- package/build/snackbar/list.js.map +1 -1
- package/build/tab-panel/index.js +40 -7
- package/build/tab-panel/index.js.map +1 -1
- package/build/toolbar/index.js +42 -60
- package/build/toolbar/index.js.map +1 -1
- package/build/toolbar/toolbar/index.js +74 -0
- package/build/toolbar/toolbar/index.js.map +1 -0
- package/build/toolbar/{toolbar-container.js → toolbar/toolbar-container.js} +0 -0
- package/build/toolbar/toolbar/toolbar-container.js.map +1 -0
- package/build/toolbar/{toolbar-container.native.js → toolbar/toolbar-container.native.js} +0 -0
- package/build/toolbar/toolbar/toolbar-container.native.js.map +1 -0
- package/build/{toolbar-button → toolbar/toolbar-button}/index.js +1 -1
- package/build/toolbar/toolbar-button/index.js.map +1 -0
- package/build/{toolbar-button → toolbar/toolbar-button}/toolbar-button-container.js +0 -0
- package/build/toolbar/toolbar-button/toolbar-button-container.js.map +1 -0
- package/build/{toolbar-button → toolbar/toolbar-button}/toolbar-button-container.native.js +0 -0
- package/build/toolbar/toolbar-button/toolbar-button-container.native.js.map +1 -0
- package/build/{toolbar-context → toolbar/toolbar-context}/index.js +0 -0
- package/build/toolbar/toolbar-context/index.js.map +1 -0
- package/build/{toolbar-dropdown-menu → toolbar/toolbar-dropdown-menu}/index.js +1 -1
- package/build/toolbar/toolbar-dropdown-menu/index.js.map +1 -0
- package/build/{toolbar-group → toolbar/toolbar-group}/index.js +0 -0
- package/build/toolbar/toolbar-group/index.js.map +1 -0
- package/build/{toolbar-group → toolbar/toolbar-group}/toolbar-group-collapsed.js +1 -1
- package/build/toolbar/toolbar-group/toolbar-group-collapsed.js.map +1 -0
- package/build/{toolbar-group → toolbar/toolbar-group}/toolbar-group-collapsed.native.js +1 -1
- package/build/toolbar/toolbar-group/toolbar-group-collapsed.native.js.map +1 -0
- package/build/{toolbar-group → toolbar/toolbar-group}/toolbar-group-container.js +0 -0
- package/build/toolbar/toolbar-group/toolbar-group-container.js.map +1 -0
- package/build/{toolbar-group → toolbar/toolbar-group}/toolbar-group-container.native.js +0 -0
- package/build/toolbar/toolbar-group/toolbar-group-container.native.js.map +1 -0
- package/build/{toolbar-item → toolbar/toolbar-item}/index.js +0 -0
- package/build/toolbar/toolbar-item/index.js.map +1 -0
- package/build/{toolbar-item → toolbar/toolbar-item}/index.native.js +0 -0
- package/build/toolbar/toolbar-item/index.native.js.map +1 -0
- package/build/tree-grid/index.js +4 -4
- package/build/tree-grid/index.js.map +1 -1
- package/build/tree-select/index.js +2 -6
- package/build/tree-select/index.js.map +1 -1
- package/build-module/alignment-matrix-control/utils.js +2 -2
- package/build-module/alignment-matrix-control/utils.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.js +1 -2
- package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
- package/build-module/border-box-control/border-box-control-linked-button/component.js.map +1 -1
- package/build-module/border-box-control/border-box-control-linked-button/hook.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/component.js +7 -4
- package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
- package/build-module/button/deprecated.js +8 -5
- package/build-module/button/deprecated.js.map +1 -1
- package/build-module/button/index.js +51 -22
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/types.js +2 -0
- package/build-module/button/types.js.map +1 -0
- package/build-module/color-list-picker/index.js.map +1 -1
- package/build-module/color-list-picker/types.js +2 -0
- package/build-module/color-list-picker/types.js.map +1 -0
- package/build-module/color-palette/index.js +7 -54
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-palette/index.native.js +24 -8
- package/build-module/color-palette/index.native.js.map +1 -1
- package/build-module/color-palette/utils.js +79 -0
- package/build-module/color-palette/utils.js.map +1 -0
- package/build-module/color-picker/component.js +1 -0
- package/build-module/color-picker/component.js.map +1 -1
- package/build-module/color-picker/styles.js +8 -9
- package/build-module/color-picker/styles.js.map +1 -1
- package/build-module/combobox-control/index.js +5 -1
- package/build-module/combobox-control/index.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/utils.js +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
- package/build-module/date-time/date/index.js +1 -1
- package/build-module/date-time/date/index.js.map +1 -1
- package/build-module/dropdown/index.js +19 -8
- package/build-module/dropdown/index.js.map +1 -1
- package/build-module/focal-point-picker/utils.js +1 -1
- package/build-module/focal-point-picker/utils.js.map +1 -1
- package/build-module/form-token-field/token.js +1 -1
- package/build-module/form-token-field/token.js.map +1 -1
- package/build-module/gradient-picker/index.js +9 -2
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/h-stack/component.js +0 -1
- package/build-module/h-stack/component.js.map +1 -1
- package/build-module/index.js +1 -6
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +1 -6
- package/build-module/index.native.js.map +1 -1
- package/build-module/input-control/input-field.js +4 -2
- package/build-module/input-control/input-field.js.map +1 -1
- package/build-module/item-group/item/component.js +26 -2
- package/build-module/item-group/item/component.js.map +1 -1
- package/build-module/item-group/item-group/component.js +25 -2
- package/build-module/item-group/item-group/component.js.map +1 -1
- package/build-module/item-group/styles.js +14 -14
- package/build-module/item-group/styles.js.map +1 -1
- package/build-module/keyboard-shortcuts/index.js +48 -16
- package/build-module/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/keyboard-shortcuts/types.js +2 -0
- package/build-module/keyboard-shortcuts/types.js.map +1 -0
- package/build-module/modal/index.js +1 -1
- package/build-module/modal/index.js.map +1 -1
- package/build-module/notice/index.js +14 -15
- package/build-module/notice/index.js.map +1 -1
- package/build-module/notice/list.js +23 -8
- package/build-module/notice/list.js.map +1 -1
- package/build-module/notice/types.js +2 -0
- package/build-module/notice/types.js.map +1 -0
- package/build-module/number-control/index.js +1 -1
- package/build-module/number-control/index.js.map +1 -1
- package/build-module/panel/row.js +5 -3
- package/build-module/panel/row.js.map +1 -1
- package/build-module/query-controls/author-select.js +7 -3
- package/build-module/query-controls/author-select.js.map +1 -1
- package/build-module/query-controls/category-select.js +8 -4
- package/build-module/query-controls/category-select.js.map +1 -1
- package/build-module/query-controls/index.js +65 -20
- package/build-module/query-controls/index.js.map +1 -1
- package/build-module/query-controls/terms.js +8 -4
- package/build-module/query-controls/terms.js.map +1 -1
- package/build-module/query-controls/types.js +2 -0
- package/build-module/query-controls/types.js.map +1 -0
- package/build-module/resizable-box/index.js +3 -2
- package/build-module/resizable-box/index.js.map +1 -1
- package/build-module/responsive-wrapper/index.js +20 -1
- package/build-module/responsive-wrapper/index.js.map +1 -1
- package/build-module/responsive-wrapper/types.js +2 -0
- package/build-module/responsive-wrapper/types.js.map +1 -0
- package/build-module/sandbox/index.js +37 -23
- package/build-module/sandbox/index.js.map +1 -1
- package/build-module/sandbox/types.js +2 -0
- package/build-module/sandbox/types.js.map +1 -0
- package/build-module/slot-fill/bubbles-virtually/fill.js +1 -0
- package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build-module/slot-fill/slot.js +1 -0
- package/build-module/slot-fill/slot.js.map +1 -1
- package/build-module/slot-fill/use-slot.js +2 -12
- package/build-module/slot-fill/use-slot.js.map +1 -1
- package/build-module/snackbar/index.js.map +1 -1
- package/build-module/snackbar/list.js.map +1 -1
- package/build-module/tab-panel/index.js +40 -7
- package/build-module/tab-panel/index.js.map +1 -1
- package/build-module/toolbar/index.js +6 -58
- package/build-module/toolbar/index.js.map +1 -1
- package/build-module/toolbar/toolbar/index.js +59 -0
- package/build-module/toolbar/toolbar/index.js.map +1 -0
- package/build-module/toolbar/{toolbar-container.js → toolbar/toolbar-container.js} +0 -0
- package/{build → build-module/toolbar}/toolbar/toolbar-container.js.map +1 -1
- package/build-module/toolbar/{toolbar-container.native.js → toolbar/toolbar-container.native.js} +0 -0
- package/build-module/toolbar/toolbar/toolbar-container.native.js.map +1 -0
- package/build-module/{toolbar-button → toolbar/toolbar-button}/index.js +1 -1
- package/build-module/toolbar/toolbar-button/index.js.map +1 -0
- package/build-module/{toolbar-button → toolbar/toolbar-button}/toolbar-button-container.js +0 -0
- package/build-module/toolbar/toolbar-button/toolbar-button-container.js.map +1 -0
- package/build-module/{toolbar-button → toolbar/toolbar-button}/toolbar-button-container.native.js +0 -0
- package/build-module/toolbar/toolbar-button/toolbar-button-container.native.js.map +1 -0
- package/build-module/{toolbar-context → toolbar/toolbar-context}/index.js +0 -0
- package/build-module/toolbar/toolbar-context/index.js.map +1 -0
- package/build-module/{toolbar-dropdown-menu → toolbar/toolbar-dropdown-menu}/index.js +1 -1
- package/build-module/toolbar/toolbar-dropdown-menu/index.js.map +1 -0
- package/build-module/{toolbar-group → toolbar/toolbar-group}/index.js +0 -0
- package/build-module/toolbar/toolbar-group/index.js.map +1 -0
- package/build-module/{toolbar-group → toolbar/toolbar-group}/toolbar-group-collapsed.js +1 -1
- package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.js.map +1 -0
- package/build-module/{toolbar-group → toolbar/toolbar-group}/toolbar-group-collapsed.native.js +1 -1
- package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.native.js.map +1 -0
- package/build-module/{toolbar-group → toolbar/toolbar-group}/toolbar-group-container.js +0 -0
- package/build-module/toolbar/toolbar-group/toolbar-group-container.js.map +1 -0
- package/build-module/{toolbar-group → toolbar/toolbar-group}/toolbar-group-container.native.js +0 -0
- package/build-module/toolbar/toolbar-group/toolbar-group-container.native.js.map +1 -0
- package/build-module/{toolbar-item → toolbar/toolbar-item}/index.js +0 -0
- package/build-module/toolbar/toolbar-item/index.js.map +1 -0
- package/build-module/{toolbar-item → toolbar/toolbar-item}/index.native.js +0 -0
- package/build-module/toolbar/toolbar-item/index.native.js.map +1 -0
- package/build-module/tree-grid/index.js +4 -4
- package/build-module/tree-grid/index.js.map +1 -1
- package/build-module/tree-select/index.js +2 -6
- package/build-module/tree-select/index.js.map +1 -1
- package/build-style/style-rtl.css +6 -1
- package/build-style/style.css +6 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts +1 -1
- package/build-types/border-box-control/border-box-control-linked-button/component.d.ts +1 -1
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +171 -160
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +1 -1
- package/build-types/border-control/border-control/hook.d.ts +1 -1
- package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/hook.d.ts +1 -1
- package/build-types/button/deprecated.d.ts +143 -7
- package/build-types/button/deprecated.d.ts.map +1 -1
- package/build-types/button/index.d.ts +20 -3
- package/build-types/button/index.d.ts.map +1 -1
- package/build-types/button/stories/index.d.ts +20 -0
- package/build-types/button/stories/index.d.ts.map +1 -0
- package/build-types/button/test/index.d.ts +2 -0
- package/build-types/button/test/index.d.ts.map +1 -0
- package/build-types/button/types.d.ts +134 -0
- package/build-types/button/types.d.ts.map +1 -0
- package/build-types/color-list-picker/index.d.ts +5 -0
- package/build-types/color-list-picker/index.d.ts.map +1 -0
- package/build-types/color-list-picker/types.d.ts +42 -0
- package/build-types/color-list-picker/types.d.ts.map +1 -0
- package/build-types/color-palette/index.d.ts +2 -4
- package/build-types/color-palette/index.d.ts.map +1 -1
- package/build-types/color-palette/stories/index.d.ts +2 -2
- package/build-types/color-palette/styles.d.ts +1 -1
- package/build-types/color-palette/types.d.ts +1 -1
- package/build-types/color-palette/types.d.ts.map +1 -1
- package/build-types/color-palette/utils.d.ts +14 -0
- package/build-types/color-palette/utils.d.ts.map +1 -0
- package/build-types/color-picker/component.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +2 -2
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/dashicon/types.d.ts +0 -4
- package/build-types/dashicon/types.d.ts.map +1 -1
- package/build-types/date-time/date/index.d.ts.map +1 -1
- package/build-types/date-time/date/styles.d.ts +3 -3
- package/build-types/dropdown/index.d.ts +4 -4
- package/build-types/dropdown/index.d.ts.map +1 -1
- package/build-types/dropdown/stories/index.d.ts.map +1 -1
- package/build-types/dropdown/types.d.ts +9 -10
- package/build-types/dropdown/types.d.ts.map +1 -1
- package/build-types/focal-point-picker/utils.d.ts.map +1 -1
- package/build-types/font-size-picker/styles.d.ts +2 -2
- package/build-types/h-stack/component.d.ts +0 -1
- package/build-types/h-stack/component.d.ts.map +1 -1
- package/build-types/input-control/input-field.d.ts.map +1 -1
- package/build-types/item-group/item/component.d.ts +24 -2
- package/build-types/item-group/item/component.d.ts.map +1 -1
- package/build-types/item-group/item-group/component.d.ts +23 -2
- package/build-types/item-group/item-group/component.d.ts.map +1 -1
- package/build-types/item-group/stories/index.d.ts +15 -0
- package/build-types/item-group/stories/index.d.ts.map +1 -0
- package/build-types/item-group/styles.d.ts.map +1 -1
- package/build-types/keyboard-shortcuts/index.d.ts +38 -0
- package/build-types/keyboard-shortcuts/index.d.ts.map +1 -0
- package/build-types/keyboard-shortcuts/stories/index.d.ts +12 -0
- package/build-types/keyboard-shortcuts/stories/index.d.ts.map +1 -0
- package/build-types/keyboard-shortcuts/test/index.d.ts +2 -0
- package/build-types/keyboard-shortcuts/test/index.d.ts.map +1 -0
- package/build-types/keyboard-shortcuts/types.d.ts +48 -0
- package/build-types/keyboard-shortcuts/types.d.ts.map +1 -0
- package/build-types/modal/index.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 +2 -2
- package/build-types/navigator/navigator-button/component.d.ts +1 -1
- package/build-types/navigator/navigator-button/hook.d.ts +2 -2
- package/build-types/notice/index.d.ts +16 -0
- package/build-types/notice/index.d.ts.map +1 -0
- package/build-types/notice/list.d.ts +32 -0
- package/build-types/notice/list.d.ts.map +1 -0
- package/build-types/notice/stories/index.d.ts +17 -0
- package/build-types/notice/stories/index.d.ts.map +1 -0
- package/build-types/notice/test/index.d.ts +2 -0
- package/build-types/notice/test/index.d.ts.map +1 -0
- package/build-types/notice/test/list.d.ts +2 -0
- package/build-types/notice/test/list.d.ts.map +1 -0
- package/build-types/notice/types.d.ts +128 -0
- package/build-types/notice/types.d.ts.map +1 -0
- package/build-types/number-control/styles/number-control-styles.d.ts +2 -2
- package/build-types/number-control/styles/number-control-styles.d.ts.map +1 -1
- package/build-types/placeholder/stories/index.d.ts.map +1 -1
- package/build-types/query-controls/author-select.d.ts +4 -0
- package/build-types/query-controls/author-select.d.ts.map +1 -0
- package/build-types/query-controls/category-select.d.ts +4 -0
- package/build-types/query-controls/category-select.d.ts.map +1 -0
- package/build-types/query-controls/index.d.ts +30 -0
- package/build-types/query-controls/index.d.ts.map +1 -0
- package/build-types/query-controls/stories/index.d.ts +13 -0
- package/build-types/query-controls/stories/index.d.ts.map +1 -0
- package/build-types/query-controls/terms.d.ts +13 -0
- package/build-types/query-controls/terms.d.ts.map +1 -0
- package/build-types/query-controls/test/terms.d.ts +2 -0
- package/build-types/query-controls/test/terms.d.ts.map +1 -0
- package/build-types/query-controls/types.d.ts +131 -0
- package/build-types/query-controls/types.d.ts.map +1 -0
- package/build-types/range-control/index.d.ts +1 -1
- package/build-types/resizable-box/index.d.ts +6 -7
- package/build-types/resizable-box/index.d.ts.map +1 -1
- package/build-types/resizable-box/stories/index.d.ts +61 -0
- package/build-types/resizable-box/stories/index.d.ts.map +1 -0
- package/build-types/responsive-wrapper/index.d.ts +24 -0
- package/build-types/responsive-wrapper/index.d.ts.map +1 -0
- package/build-types/responsive-wrapper/stories/index.d.ts +12 -0
- package/build-types/responsive-wrapper/stories/index.d.ts.map +1 -0
- package/build-types/responsive-wrapper/types.d.ts +22 -0
- package/build-types/responsive-wrapper/types.d.ts.map +1 -0
- package/build-types/sandbox/index.d.ts +19 -0
- package/build-types/sandbox/index.d.ts.map +1 -0
- package/build-types/sandbox/stories/index.d.ts +12 -0
- package/build-types/sandbox/stories/index.d.ts.map +1 -0
- package/build-types/sandbox/test/index.d.ts +2 -0
- package/build-types/sandbox/test/index.d.ts.map +1 -0
- package/build-types/sandbox/types.d.ts +36 -0
- package/build-types/sandbox/types.d.ts.map +1 -0
- package/build-types/slot-fill/bubbles-virtually/fill.d.ts.map +1 -1
- package/build-types/slot-fill/use-slot.d.ts.map +1 -1
- package/build-types/snackbar/index.d.ts +9 -2
- package/build-types/snackbar/index.d.ts.map +1 -1
- package/build-types/snackbar/list.d.ts.map +1 -1
- package/build-types/snackbar/types.d.ts +15 -88
- package/build-types/snackbar/types.d.ts.map +1 -1
- package/build-types/tab-panel/index.d.ts.map +1 -1
- package/build-types/tab-panel/stories/index.d.ts +1 -0
- package/build-types/tab-panel/stories/index.d.ts.map +1 -1
- package/build-types/tab-panel/types.d.ts +11 -5
- package/build-types/tab-panel/types.d.ts.map +1 -1
- package/build-types/toggle-group-control/stories/index.d.ts.map +1 -1
- package/build-types/tree-select/index.d.ts.map +1 -1
- package/build-types/ui/form-group/form-group.d.ts +2 -2
- package/package.json +18 -17
- package/src/alignment-matrix-control/utils.tsx +2 -2
- package/src/autocomplete/autocompleter-ui.js +1 -2
- package/src/autocomplete/test/index.js +1 -5
- package/src/border-box-control/border-box-control-linked-button/component.tsx +1 -1
- package/src/border-box-control/border-box-control-linked-button/hook.ts +1 -1
- package/src/border-control/border-control-dropdown/component.tsx +9 -8
- package/src/box-control/test/index.js +11 -35
- package/src/button/README.md +49 -55
- package/src/button/{deprecated.js → deprecated.tsx} +19 -4
- package/src/button/{index.js → index.tsx} +95 -34
- package/src/button/stories/index.tsx +106 -0
- package/src/button/style.scss +3 -2
- package/src/button/test/{index.js → index.tsx} +30 -7
- package/src/button/types.ts +138 -0
- package/src/checkbox-control/test/index.tsx +1 -5
- package/src/color-list-picker/{index.js → index.tsx} +3 -2
- package/src/color-list-picker/types.ts +46 -0
- package/src/color-palette/README.md +1 -1
- package/src/color-palette/index.native.js +11 -4
- package/src/color-palette/index.tsx +11 -67
- package/src/color-palette/test/index.tsx +4 -14
- package/src/color-palette/test/utils.ts +1 -1
- package/src/color-palette/types.ts +1 -1
- package/src/color-palette/utils.ts +98 -0
- package/src/color-picker/component.tsx +1 -0
- package/src/color-picker/stories/index.js +20 -60
- package/src/color-picker/styles.ts +0 -5
- package/src/color-picker/test/index.js +6 -15
- package/src/combobox-control/index.js +9 -1
- package/src/combobox-control/test/index.js +1 -6
- package/src/confirm-dialog/test/index.js +9 -29
- package/src/custom-gradient-picker/gradient-bar/utils.js +1 -1
- package/src/dashicon/types.ts +0 -6
- package/src/date-time/date/index.tsx +2 -1
- package/src/date-time/date/test/index.tsx +2 -8
- package/src/date-time/time/test/index.tsx +9 -29
- package/src/dimension-control/test/index.test.js +2 -8
- package/src/disabled/test/index.tsx +1 -5
- package/src/draggable/test/index.native.js +4 -4
- package/src/dropdown/README.md +1 -8
- package/src/dropdown/index.tsx +17 -6
- package/src/dropdown/stories/index.tsx +3 -3
- package/src/dropdown/test/index.tsx +2 -8
- package/src/dropdown/types.ts +9 -10
- package/src/dropdown-menu/README.md +1 -1
- package/src/dropdown-menu/stories/index.js +96 -27
- package/src/dropdown-menu/test/index.js +2 -8
- package/src/external-link/test/index.tsx +1 -6
- package/src/focal-point-picker/stories/index.tsx +1 -1
- package/src/focal-point-picker/test/index.js +3 -11
- package/src/focal-point-picker/utils.ts +4 -1
- package/src/font-size-picker/test/index.tsx +14 -44
- package/src/form-file-upload/test/index.tsx +2 -17
- package/src/form-toggle/test/index.tsx +1 -5
- package/src/form-token-field/test/index.tsx +80 -163
- package/src/form-token-field/token.tsx +1 -1
- package/src/gradient-picker/index.js +15 -4
- package/src/guide/stories/index.js +14 -41
- package/src/guide/test/index.js +5 -17
- package/src/h-stack/component.tsx +0 -1
- package/src/higher-order/with-filters/test/index.js +24 -24
- package/src/higher-order/with-focus-outside/test/index.js +11 -25
- package/src/higher-order/with-focus-return/test/index.js +1 -5
- package/src/index.js +8 -6
- package/src/index.native.js +8 -6
- package/src/input-control/input-field.tsx +3 -1
- package/src/input-control/test/index.js +1 -6
- package/src/isolated-event-container/test/index.js +2 -8
- package/src/item-group/item/component.tsx +26 -2
- package/src/item-group/item-group/component.tsx +25 -2
- package/src/item-group/stories/index.tsx +103 -0
- package/src/item-group/styles.ts +1 -0
- package/src/item-group/test/__snapshots__/index.js.snap +11 -10
- package/src/keyboard-shortcuts/README.md +1 -1
- package/src/keyboard-shortcuts/index.tsx +93 -0
- package/src/keyboard-shortcuts/stories/index.tsx +60 -0
- package/src/keyboard-shortcuts/test/{index.js → index.tsx} +16 -6
- package/src/keyboard-shortcuts/types.ts +51 -0
- package/src/modal/index.tsx +1 -2
- package/src/navigable-container/test/navigable-menu.js +5 -17
- package/src/navigable-container/test/tababble-container.js +3 -11
- package/src/navigation/test/index.js +3 -11
- package/src/navigator/test/index.tsx +6 -20
- package/src/notice/README.md +89 -42
- package/src/notice/{index.js → index.tsx} +28 -20
- package/src/notice/list.tsx +72 -0
- package/src/notice/stories/index.tsx +119 -0
- package/src/notice/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
- package/src/notice/test/{index.js → index.tsx} +7 -4
- package/src/notice/test/{list.js → list.tsx} +0 -0
- package/src/notice/types.ts +136 -0
- package/src/number-control/index.tsx +1 -1
- package/src/number-control/test/index.tsx +28 -86
- package/src/panel/row.js +3 -3
- package/src/panel/stories/index.js +62 -80
- package/src/panel/test/body.js +2 -8
- package/src/placeholder/stories/index.tsx +1 -0
- package/src/placeholder/style.scss +1 -1
- package/src/query-controls/README.md +56 -56
- package/src/query-controls/author-select.tsx +37 -0
- package/src/query-controls/category-select.tsx +46 -0
- package/src/query-controls/index.tsx +192 -0
- package/src/query-controls/stories/index.tsx +205 -0
- package/src/query-controls/terms.ts +57 -0
- package/src/query-controls/test/{terms.js → terms.ts} +36 -20
- package/src/query-controls/types.ts +150 -0
- package/src/resizable-box/README.md +2 -2
- package/src/resizable-box/index.tsx +7 -6
- package/src/resizable-box/stories/index.tsx +92 -0
- package/src/responsive-wrapper/README.md +29 -0
- package/src/responsive-wrapper/{index.js → index.tsx} +23 -2
- package/src/responsive-wrapper/stories/index.tsx +38 -0
- package/src/responsive-wrapper/types.ts +20 -0
- package/src/sandbox/README.md +45 -2
- package/src/sandbox/{index.js → index.tsx} +47 -24
- package/src/sandbox/stories/index.tsx +32 -0
- package/src/sandbox/test/{index.js → index.tsx} +9 -4
- package/src/sandbox/types.ts +34 -0
- package/src/select-control/test/select-control.tsx +1 -6
- package/src/slot-fill/bubbles-virtually/fill.js +1 -0
- package/src/slot-fill/slot.js +1 -1
- package/src/slot-fill/stories/index.js +12 -17
- package/src/slot-fill/use-slot.js +6 -16
- package/src/snackbar/index.tsx +6 -5
- package/src/snackbar/list.tsx +4 -2
- package/src/snackbar/types.ts +18 -92
- package/src/style.scss +3 -3
- package/src/tab-panel/README.md +1 -0
- package/src/tab-panel/index.tsx +42 -6
- package/src/tab-panel/stories/index.tsx +20 -0
- package/src/tab-panel/style.scss +8 -0
- package/src/tab-panel/test/index.tsx +124 -7
- package/src/tab-panel/types.ts +11 -5
- package/src/theme/test/index.tsx +4 -4
- package/src/toggle-group-control/stories/index.tsx +1 -0
- package/src/toggle-group-control/test/index.tsx +7 -23
- package/src/toolbar/index.js +6 -52
- package/src/toolbar/stories/index.js +71 -75
- package/src/toolbar/test/index.js +1 -2
- package/src/{toolbar-group/test/index.js → toolbar/test/toolbar-group.js} +1 -1
- package/src/toolbar/{README.md → toolbar/README.md} +0 -0
- package/src/toolbar/toolbar/index.js +52 -0
- package/src/toolbar/{style.native.scss → toolbar/style.native.scss} +0 -0
- package/src/toolbar/{style.scss → toolbar/style.scss} +0 -0
- package/src/toolbar/{toolbar-container.js → toolbar/toolbar-container.js} +0 -0
- package/src/toolbar/{toolbar-container.native.js → toolbar/toolbar-container.native.js} +0 -0
- package/src/{toolbar-button → toolbar/toolbar-button}/README.md +0 -0
- package/src/{toolbar-button → toolbar/toolbar-button}/index.js +1 -1
- package/src/{toolbar-button → toolbar/toolbar-button}/style.scss +0 -0
- package/src/{toolbar-button → toolbar/toolbar-button}/toolbar-button-container.js +0 -0
- package/src/{toolbar-button → toolbar/toolbar-button}/toolbar-button-container.native.js +0 -0
- package/src/{toolbar-context → toolbar/toolbar-context}/index.js +0 -0
- package/src/{toolbar-dropdown-menu → toolbar/toolbar-dropdown-menu}/README.md +0 -0
- package/src/{toolbar-dropdown-menu → toolbar/toolbar-dropdown-menu}/index.js +1 -1
- package/src/{toolbar-group → toolbar/toolbar-group}/README.md +0 -0
- package/src/{toolbar-group → toolbar/toolbar-group}/index.js +0 -0
- package/src/{toolbar-group → toolbar/toolbar-group}/style.native.scss +0 -0
- package/src/{toolbar-group → toolbar/toolbar-group}/style.scss +0 -0
- package/src/{toolbar-group → toolbar/toolbar-group}/toolbar-group-collapsed.js +1 -1
- package/src/{toolbar-group → toolbar/toolbar-group}/toolbar-group-collapsed.native.js +1 -1
- package/src/{toolbar-group → toolbar/toolbar-group}/toolbar-group-container.js +0 -0
- package/src/{toolbar-group → toolbar/toolbar-group}/toolbar-group-container.native.js +0 -0
- package/src/{toolbar-item → toolbar/toolbar-item}/README.md +0 -0
- package/src/{toolbar-item → toolbar/toolbar-item}/index.js +0 -0
- package/src/{toolbar-item → toolbar/toolbar-item}/index.native.js +0 -0
- package/src/tools-panel/stories/index.js +3 -0
- package/src/tools-panel/test/index.js +1 -1
- package/src/tree-grid/index.js +3 -5
- package/src/tree-select/index.tsx +3 -6
- package/src/ui/context/test/context-connect.tsx +2 -0
- package/src/ui/context/test/wordpress-component.tsx +2 -0
- package/src/unit-control/test/index.tsx +21 -74
- package/src/utils/hooks/test/use-latest-ref.js +15 -18
- package/tsconfig.json +1 -11
- package/tsconfig.tsbuildinfo +1 -1
- package/build/toolbar/toolbar-container.native.js.map +0 -1
- package/build/toolbar-button/index.js.map +0 -1
- package/build/toolbar-button/toolbar-button-container.js.map +0 -1
- package/build/toolbar-button/toolbar-button-container.native.js.map +0 -1
- package/build/toolbar-context/index.js.map +0 -1
- package/build/toolbar-dropdown-menu/index.js.map +0 -1
- package/build/toolbar-group/index.js.map +0 -1
- package/build/toolbar-group/toolbar-group-collapsed.js.map +0 -1
- package/build/toolbar-group/toolbar-group-collapsed.native.js.map +0 -1
- package/build/toolbar-group/toolbar-group-container.js.map +0 -1
- package/build/toolbar-group/toolbar-group-container.native.js.map +0 -1
- package/build/toolbar-item/index.js.map +0 -1
- package/build/toolbar-item/index.native.js.map +0 -1
- package/build-module/toolbar/toolbar-container.js.map +0 -1
- package/build-module/toolbar/toolbar-container.native.js.map +0 -1
- package/build-module/toolbar-button/index.js.map +0 -1
- package/build-module/toolbar-button/toolbar-button-container.js.map +0 -1
- package/build-module/toolbar-button/toolbar-button-container.native.js.map +0 -1
- package/build-module/toolbar-context/index.js.map +0 -1
- package/build-module/toolbar-dropdown-menu/index.js.map +0 -1
- package/build-module/toolbar-group/index.js.map +0 -1
- package/build-module/toolbar-group/toolbar-group-collapsed.js.map +0 -1
- package/build-module/toolbar-group/toolbar-group-collapsed.native.js.map +0 -1
- package/build-module/toolbar-group/toolbar-group-container.js.map +0 -1
- package/build-module/toolbar-group/toolbar-group-container.native.js.map +0 -1
- package/build-module/toolbar-item/index.js.map +0 -1
- package/build-module/toolbar-item/index.native.js.map +0 -1
- package/src/button/stories/index.js +0 -179
- package/src/item-group/stories/index.js +0 -270
- package/src/keyboard-shortcuts/index.js +0 -56
- package/src/notice/list.js +0 -48
- package/src/notice/stories/index.js +0 -74
- package/src/query-controls/author-select.js +0 -23
- package/src/query-controls/category-select.js +0 -31
- package/src/query-controls/index.js +0 -121
- package/src/query-controls/terms.js +0 -40
- package/src/resizable-box/stories/index.js +0 -97
- package/src/toolbar-button/stories/index.js +0 -33
- package/src/toolbar-group/stories/index.js +0 -33
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare type SandBoxProps = {
|
|
3
|
+
/**
|
|
4
|
+
* The HTML to render in the body of the iframe document.
|
|
5
|
+
*
|
|
6
|
+
* @default ''
|
|
7
|
+
*/
|
|
8
|
+
html?: string;
|
|
9
|
+
/**
|
|
10
|
+
* The `<title>` of the iframe document.
|
|
11
|
+
*
|
|
12
|
+
* @default ''
|
|
13
|
+
*/
|
|
14
|
+
title?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The CSS class name to apply to the `<html>` and `<body>` elements of the iframe.
|
|
17
|
+
*/
|
|
18
|
+
type?: string;
|
|
19
|
+
/**
|
|
20
|
+
* An array of CSS strings to inject into the `<head>` of the iframe document.
|
|
21
|
+
*
|
|
22
|
+
* @default []
|
|
23
|
+
*/
|
|
24
|
+
styles?: string[];
|
|
25
|
+
/**
|
|
26
|
+
* An array of script URLs to inject as `<script>` tags into the bottom of the `<body>` of the iframe document.
|
|
27
|
+
*
|
|
28
|
+
* @default []
|
|
29
|
+
*/
|
|
30
|
+
scripts?: string[];
|
|
31
|
+
/**
|
|
32
|
+
* The `onFocus` callback for the iframe.
|
|
33
|
+
*/
|
|
34
|
+
onFocus?: React.DOMAttributes<HTMLIFrameElement>['onFocus'];
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sandbox/types.ts"],"names":[],"mappings":";AAAA,oBAAY,YAAY,GAAG;IAC1B;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAE,iBAAiB,CAAE,CAAE,SAAS,CAAE,CAAC;CAChE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fill.d.ts","sourceRoot":"","sources":["../../../src/slot-fill/bubbles-virtually/fill.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fill.d.ts","sourceRoot":"","sources":["../../../src/slot-fill/bubbles-virtually/fill.js"],"names":[],"mappings":"AA8BA;;;uCAiCC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-slot.d.ts","sourceRoot":"","sources":["../../src/slot-fill/use-slot.js"],"names":[],"mappings":";AAWA;;;;;GAKG;AACH,+BAHW,MAAM,GACL,MAAM,
|
|
1
|
+
{"version":3,"file":"use-slot.d.ts","sourceRoot":"","sources":["../../src/slot-fill/use-slot.js"],"names":[],"mappings":";AAWA;;;;;GAKG;AACH,+BAHW,MAAM,GACL,MAAM,CASjB"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { SnackbarProps } from './types';
|
|
3
2
|
/**
|
|
4
3
|
* A Snackbar displays a succinct message that is cleared out after a small delay.
|
|
5
4
|
*
|
|
@@ -12,7 +11,15 @@ import type { SnackbarProps } from './types';
|
|
|
12
11
|
* );
|
|
13
12
|
* ```
|
|
14
13
|
*/
|
|
15
|
-
export declare const Snackbar: import("react").ForwardRefExoticComponent<
|
|
14
|
+
export declare const Snackbar: import("react").ForwardRefExoticComponent<import("../notice/types").NoticeProps & {
|
|
15
|
+
icon?: import("react").ReactNode;
|
|
16
|
+
explicitDismiss?: boolean | undefined;
|
|
17
|
+
listRef?: import("react").MutableRefObject<HTMLDivElement | null> | undefined;
|
|
18
|
+
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "as" | keyof import("../notice/types").NoticeProps | keyof {
|
|
19
|
+
icon?: import("react").ReactNode;
|
|
20
|
+
explicitDismiss?: boolean | undefined;
|
|
21
|
+
listRef?: import("react").MutableRefObject<HTMLDivElement | null> | undefined;
|
|
22
|
+
}> & {
|
|
16
23
|
as?: keyof JSX.IntrinsicElements | undefined;
|
|
17
24
|
} & import("react").RefAttributes<any>>;
|
|
18
25
|
export default Snackbar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/snackbar/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/snackbar/index.tsx"],"names":[],"mappings":";AAwKA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;uCAAoC,CAAC;AAE1D,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/snackbar/list.tsx"],"names":[],"mappings":";AAmBA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/snackbar/list.tsx"],"names":[],"mappings":";AAmBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAsB7D;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAE,EAC7B,OAAO,EACP,SAAS,EACT,QAAQ,EACR,QAAQ,GACR,EAAE,uBAAuB,CAAE,iBAAiB,EAAE,KAAK,CAAE,eAwCrD;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1,111 +1,38 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type { MutableRefObject, ReactNode
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
declare type NoticeActionWithOnClick = {
|
|
11
|
-
label: string;
|
|
12
|
-
url?: string;
|
|
13
|
-
onClick: (event: SyntheticEvent) => void;
|
|
14
|
-
};
|
|
15
|
-
export declare type NoticeAction = NoticeActionWithURL | NoticeActionWithOnClick;
|
|
16
|
-
export declare type Notice = {
|
|
17
|
-
id: string;
|
|
18
|
-
spokenMessage: string;
|
|
19
|
-
actions: NoticeAction[];
|
|
20
|
-
icon?: ReactNode;
|
|
21
|
-
onDismiss?: () => void;
|
|
22
|
-
content: string;
|
|
23
|
-
isDismissible: boolean;
|
|
24
|
-
explicitDismiss: boolean;
|
|
25
|
-
};
|
|
26
|
-
export declare type SnackbarProps = {
|
|
27
|
-
/**
|
|
28
|
-
* The displayed message of a notice.
|
|
29
|
-
*
|
|
30
|
-
* Also used as the spoken message for assistive technology,
|
|
31
|
-
* unless `spokenMessage` is provided as an alternative message.
|
|
32
|
-
*/
|
|
33
|
-
children: string;
|
|
34
|
-
/**
|
|
35
|
-
* Used to provide a custom spoken message.
|
|
36
|
-
*
|
|
37
|
-
* @default children
|
|
38
|
-
*/
|
|
39
|
-
spokenMessage?: Notice['spokenMessage'];
|
|
40
|
-
/**
|
|
41
|
-
* A politeness level for the notice's spoken message. Should be provided as
|
|
42
|
-
* one of the valid options for an `aria-live` attribute value. Note that this
|
|
43
|
-
* value should be considered a suggestion; assistive technologies may
|
|
44
|
-
* override it based on internal heuristics.
|
|
45
|
-
*
|
|
46
|
-
* A value of `'assertive'` is to be used for important, and usually
|
|
47
|
-
* time-sensitive, information. It will interrupt anything else the screen
|
|
48
|
-
* reader is announcing in that moment.
|
|
49
|
-
* A value of `'polite'` is to be used for advisory information. It should
|
|
50
|
-
* not interrupt what the screen reader is announcing in that moment
|
|
51
|
-
* (the "speech queue") or interrupt the current task.
|
|
52
|
-
*
|
|
53
|
-
* @see https://www.w3.org/TR/wai-aria-1.1/#aria-live
|
|
54
|
-
*
|
|
55
|
-
* @default 'polite'
|
|
56
|
-
*/
|
|
57
|
-
politeness?: 'polite' | 'assertive';
|
|
58
|
-
/**
|
|
59
|
-
* An array of action objects.
|
|
60
|
-
*
|
|
61
|
-
* Each member object should contain
|
|
62
|
-
* a `label` and either a `url` link string or `onClick` callback function.
|
|
63
|
-
*
|
|
64
|
-
* @default []
|
|
65
|
-
*/
|
|
66
|
-
actions?: Notice['actions'];
|
|
67
|
-
/**
|
|
68
|
-
* Called to remove the snackbar from the UI.
|
|
69
|
-
*/
|
|
70
|
-
onRemove?: () => void;
|
|
4
|
+
import type { MutableRefObject, ReactNode } from 'react';
|
|
5
|
+
/**
|
|
6
|
+
* Internal dependencies
|
|
7
|
+
*/
|
|
8
|
+
import type { NoticeProps, NoticeChildren } from '../notice/types';
|
|
9
|
+
declare type SnackbarOnlyProps = {
|
|
71
10
|
/**
|
|
72
11
|
* The icon to render in the snackbar.
|
|
73
12
|
*
|
|
74
13
|
* @default null
|
|
75
14
|
*/
|
|
76
|
-
icon?:
|
|
15
|
+
icon?: ReactNode;
|
|
77
16
|
/**
|
|
78
17
|
* Whether to require user action to dismiss the snackbar.
|
|
79
18
|
* By default, this is dismissed on a timeout, without user interaction.
|
|
80
19
|
*
|
|
81
20
|
* @default false
|
|
82
21
|
*/
|
|
83
|
-
explicitDismiss?:
|
|
84
|
-
/**
|
|
85
|
-
* A callback executed when the snackbar is dismissed.
|
|
86
|
-
*
|
|
87
|
-
* It is distinct from onRemove, which _looks_ like a callback but is
|
|
88
|
-
* actually the function to call to remove the snackbar from the UI.
|
|
89
|
-
*/
|
|
90
|
-
onDismiss?: Notice['onDismiss'];
|
|
22
|
+
explicitDismiss?: boolean;
|
|
91
23
|
/**
|
|
92
24
|
* A ref to the list that contains the snackbar.
|
|
93
25
|
*/
|
|
94
26
|
listRef?: MutableRefObject<HTMLDivElement | null>;
|
|
95
27
|
};
|
|
28
|
+
export declare type SnackbarProps = NoticeProps & SnackbarOnlyProps;
|
|
96
29
|
export declare type SnackbarListProps = {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
*/
|
|
104
|
-
children?: ReactNode;
|
|
105
|
-
/**
|
|
106
|
-
* Function called when a notice should be removed / dismissed.
|
|
107
|
-
*/
|
|
108
|
-
onRemove?: (id: Notice['id']) => void;
|
|
30
|
+
notices: Array<Omit<SnackbarProps, 'children'> & {
|
|
31
|
+
id: string;
|
|
32
|
+
content: string;
|
|
33
|
+
}>;
|
|
34
|
+
onRemove: (id: string) => void;
|
|
35
|
+
children?: NoticeChildren | Array<NoticeChildren>;
|
|
109
36
|
};
|
|
110
37
|
export {};
|
|
111
38
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/snackbar/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/snackbar/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzD;;GAEG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEnE,aAAK,iBAAiB,GAAG;IACxB;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAE,cAAc,GAAG,IAAI,CAAE,CAAC;CACpD,CAAC;AAEF,oBAAY,aAAa,GAAG,WAAW,GAAG,iBAAiB,CAAC;AAE5D,oBAAY,iBAAiB,GAAG;IAC/B,OAAO,EAAE,KAAK,CACb,IAAI,CAAE,aAAa,EAAE,UAAU,CAAE,GAAG;QACnC,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;KAChB,CACD,CAAC;IACF,QAAQ,EAAE,CAAE,EAAE,EAAE,MAAM,KAAM,IAAI,CAAC;IACjC,QAAQ,CAAC,EAAE,cAAc,GAAG,KAAK,CAAE,cAAc,CAAE,CAAC;CACpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tab-panel/index.tsx"],"names":[],"mappings":";AAgBA,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tab-panel/index.tsx"],"names":[],"mappings":";AAgBA,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAoB7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,QAAQ,CAAE,EACzB,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,YAAmB,EACnB,cAAc,EACd,WAA0B,EAC1B,WAAyB,EACzB,QAAQ,GACR,EAAE,uBAAuB,CAAE,aAAa,EAAE,KAAK,EAAE,KAAK,CAAE,eA+GxD;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -9,4 +9,5 @@ import TabPanel from '..';
|
|
|
9
9
|
declare const meta: ComponentMeta<typeof TabPanel>;
|
|
10
10
|
export default meta;
|
|
11
11
|
export declare const Default: ComponentStory<typeof TabPanel>;
|
|
12
|
+
export declare const DisabledTab: ComponentStory<typeof TabPanel>;
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tab-panel/stories/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEtE;;GAEG;AACH,OAAO,QAAQ,MAAM,IAAI,CAAC;AAE1B,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,QAAQ,CAMzC,CAAC;AACF,eAAe,IAAI,CAAC;AAMpB,eAAO,MAAM,OAAO,iCAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tab-panel/stories/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEtE;;GAEG;AACH,OAAO,QAAQ,MAAM,IAAI,CAAC;AAE1B,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,QAAQ,CAMzC,CAAC;AACF,eAAe,IAAI,CAAC;AAMpB,eAAO,MAAM,OAAO,iCAAsB,CAAC;AAe3C,eAAO,MAAM,WAAW,iCAAsB,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type { ReactNode } from 'react';
|
|
4
|
+
import type { MouseEvent, ReactNode } from 'react';
|
|
5
5
|
/**
|
|
6
6
|
* Internal dependencies
|
|
7
7
|
*/
|
|
8
8
|
import type { IconType } from '../icon';
|
|
9
|
-
declare type Tab = {
|
|
9
|
+
declare type Tab<IconProps = unknown> = {
|
|
10
10
|
/**
|
|
11
11
|
* The key of the tab.
|
|
12
12
|
*/
|
|
@@ -19,17 +19,23 @@ declare type Tab = {
|
|
|
19
19
|
* The class name to apply to the tab button.
|
|
20
20
|
*/
|
|
21
21
|
className?: string;
|
|
22
|
+
/**
|
|
23
|
+
* The icon used for the tab button.
|
|
24
|
+
*/
|
|
25
|
+
icon?: IconType<IconProps>;
|
|
26
|
+
/**
|
|
27
|
+
* Determines if the tab button should be disabled.
|
|
28
|
+
*/
|
|
29
|
+
disabled?: boolean;
|
|
22
30
|
} & Record<any, any>;
|
|
23
31
|
export declare type TabButtonProps<IconProps = unknown> = {
|
|
24
32
|
children: ReactNode;
|
|
25
|
-
className?: string;
|
|
26
|
-
icon?: IconType<IconProps>;
|
|
27
33
|
label?: string;
|
|
28
34
|
onClick: (event: MouseEvent) => void;
|
|
29
35
|
selected: boolean;
|
|
30
36
|
showTooltip?: boolean;
|
|
31
37
|
tabId: string;
|
|
32
|
-
}
|
|
38
|
+
} & Pick<Tab<IconProps>, 'className' | 'icon' | 'disabled'>;
|
|
33
39
|
export declare type TabPanelProps = {
|
|
34
40
|
/**
|
|
35
41
|
* The class name to add to the active tab.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/tab-panel/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/tab-panel/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEnD;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,aAAK,GAAG,CAAE,SAAS,GAAG,OAAO,IAAK;IACjC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAE,SAAS,CAAE,CAAC;IAC7B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,MAAM,CAAE,GAAG,EAAE,GAAG,CAAE,CAAC;AAEvB,oBAAY,cAAc,CAAE,SAAS,GAAG,OAAO,IAAK;IACnD,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,CAAE,KAAK,EAAE,UAAU,KAAM,IAAI,CAAC;IACvC,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;CACd,GAAG,IAAI,CAAE,GAAG,CAAE,SAAS,CAAE,EAAE,WAAW,GAAG,MAAM,GAAG,UAAU,CAAE,CAAC;AAEhE,oBAAY,aAAa,GAAG;IAC3B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,QAAQ,EAAE,CAAE,GAAG,EAAE,GAAG,KAAM,SAAS,CAAC;IACpC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAE,OAAO,EAAE,MAAM,KAAM,IAAI,CAAC;IACvC;;;;OAIG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC;;OAEG;IACH,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/toggle-group-control/stories/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAQtE;;GAEG;AACH,OAAO,EACN,kBAAkB,EAGlB,MAAM,UAAU,CAAC;AAOlB,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,kBAAkB,CAanD,CAAC;AACF,eAAe,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/toggle-group-control/stories/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAQtE;;GAEG;AACH,OAAO,EACN,kBAAkB,EAGlB,MAAM,UAAU,CAAC;AAOlB,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,kBAAkB,CAanD,CAAC;AACF,eAAe,IAAI,CAAC;AAoCpB,eAAO,MAAM,OAAO,EAAE,cAAc,CAAE,OAAO,kBAAkB,CAC3C,CAAC;AAYrB;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,cAAc,CAAE,OAAO,kBAAkB,CAC/C,CAAC;AAmBrB;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,cAAc,CAAE,OAAO,kBAAkB,CAC7C,CAAC;AAUrB;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,cAAc,CAAE,OAAO,kBAAkB,CAChD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tree-select/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tree-select/index.tsx"],"names":[],"mappings":";AAUA,OAAO,KAAK,EAAE,eAAe,EAA+B,MAAM,SAAS,CAAC;AAa5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,wBAAgB,UAAU,CAAE,EAC3B,KAAK,EACL,aAAa,EACb,QAAQ,EACR,UAAU,EACV,IAAS,EACT,GAAG,KAAK,EACR,EAAE,eAAe,eAejB;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -30,7 +30,7 @@ declare const ConnectedFormGroup: import("../context").WordPressComponent<import
|
|
|
30
30
|
truncate?: boolean | undefined;
|
|
31
31
|
} & import("../../grid/types").GridProps & {
|
|
32
32
|
horizontal: true;
|
|
33
|
-
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "color" | "display" | "letterSpacing" | "lineHeight" | "ellipsis" | "size" | "help" | "weight" | "horizontal" | "children" | "label" | "as" | "id" | "spacing" | "variant" | "isBlock" | "align" | "ellipsizeMode" | "limit" | "numberOfLines" | "adjustLineHeightForInnerControls" | "
|
|
33
|
+
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "color" | "display" | "letterSpacing" | "lineHeight" | "ellipsis" | "size" | "help" | "weight" | "horizontal" | "children" | "label" | "as" | "id" | "spacing" | "isDestructive" | "variant" | "isBlock" | "align" | "ellipsizeMode" | "limit" | "numberOfLines" | "adjustLineHeightForInnerControls" | "highlightEscape" | "highlightCaseSensitive" | "highlightSanitize" | "optimizeReadabilityFor" | "truncate" | "upperCase" | "highlightWords" | "labelHidden" | "alignLabel"> & {
|
|
34
34
|
as?: keyof JSX.IntrinsicElements | undefined;
|
|
35
35
|
} & import("react").RefAttributes<any>, boolean> | import("../context").WordPressComponent<import("react").ElementType<any>, import("../../text/types").Props & {
|
|
36
36
|
isBlock?: boolean | undefined;
|
|
@@ -47,7 +47,7 @@ declare const ConnectedFormGroup: import("../context").WordPressComponent<import
|
|
|
47
47
|
truncate?: boolean | undefined;
|
|
48
48
|
} & {
|
|
49
49
|
horizontal: false;
|
|
50
|
-
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "color" | "display" | "letterSpacing" | "lineHeight" | "ellipsis" | "size" | "help" | "weight" | "horizontal" | "children" | "label" | "as" | "id" | "spacing" | "variant" | "isBlock" | "align" | "ellipsizeMode" | "limit" | "numberOfLines" | "adjustLineHeightForInnerControls" | "
|
|
50
|
+
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "color" | "display" | "letterSpacing" | "lineHeight" | "ellipsis" | "size" | "help" | "weight" | "horizontal" | "children" | "label" | "as" | "id" | "spacing" | "isDestructive" | "variant" | "isBlock" | "align" | "ellipsizeMode" | "limit" | "numberOfLines" | "adjustLineHeightForInnerControls" | "highlightEscape" | "highlightCaseSensitive" | "highlightSanitize" | "optimizeReadabilityFor" | "truncate" | "upperCase" | "highlightWords" | "labelHidden" | "alignLabel"> & {
|
|
51
51
|
as?: keyof JSX.IntrinsicElements | undefined;
|
|
52
52
|
} & import("react").RefAttributes<any>, boolean>;
|
|
53
53
|
//# sourceMappingURL=form-group.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/components",
|
|
3
|
-
"version": "23.
|
|
3
|
+
"version": "23.3.0",
|
|
4
4
|
"description": "UI components for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -38,21 +38,22 @@
|
|
|
38
38
|
"@emotion/utils": "^1.0.0",
|
|
39
39
|
"@floating-ui/react-dom": "^1.0.0",
|
|
40
40
|
"@use-gesture/react": "^10.2.6",
|
|
41
|
-
"@wordpress/a11y": "^3.
|
|
42
|
-
"@wordpress/compose": "^6.
|
|
43
|
-
"@wordpress/date": "^4.
|
|
44
|
-
"@wordpress/deprecated": "^3.
|
|
45
|
-
"@wordpress/dom": "^3.
|
|
46
|
-
"@wordpress/element": "^5.
|
|
47
|
-
"@wordpress/escape-html": "^2.
|
|
48
|
-
"@wordpress/hooks": "^3.
|
|
49
|
-
"@wordpress/
|
|
50
|
-
"@wordpress/
|
|
51
|
-
"@wordpress/
|
|
52
|
-
"@wordpress/
|
|
53
|
-
"@wordpress/
|
|
54
|
-
"@wordpress/
|
|
55
|
-
"@wordpress/
|
|
41
|
+
"@wordpress/a11y": "^3.26.0",
|
|
42
|
+
"@wordpress/compose": "^6.3.0",
|
|
43
|
+
"@wordpress/date": "^4.26.0",
|
|
44
|
+
"@wordpress/deprecated": "^3.26.0",
|
|
45
|
+
"@wordpress/dom": "^3.26.0",
|
|
46
|
+
"@wordpress/element": "^5.3.0",
|
|
47
|
+
"@wordpress/escape-html": "^2.26.0",
|
|
48
|
+
"@wordpress/hooks": "^3.26.0",
|
|
49
|
+
"@wordpress/html-entities": "^3.26.0",
|
|
50
|
+
"@wordpress/i18n": "^4.26.0",
|
|
51
|
+
"@wordpress/icons": "^9.17.0",
|
|
52
|
+
"@wordpress/is-shallow-equal": "^4.26.0",
|
|
53
|
+
"@wordpress/keycodes": "^3.26.0",
|
|
54
|
+
"@wordpress/primitives": "^3.24.0",
|
|
55
|
+
"@wordpress/rich-text": "^6.3.0",
|
|
56
|
+
"@wordpress/warning": "^2.26.0",
|
|
56
57
|
"change-case": "^4.1.2",
|
|
57
58
|
"classnames": "^2.3.1",
|
|
58
59
|
"colord": "^2.7.0",
|
|
@@ -80,5 +81,5 @@
|
|
|
80
81
|
"publishConfig": {
|
|
81
82
|
"access": "public"
|
|
82
83
|
},
|
|
83
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "cab6ebe2b4c5dbacfd753dcae4a2406559c4813c"
|
|
84
85
|
}
|
|
@@ -19,8 +19,8 @@ export const ALIGNMENT_LABEL: Record< AlignmentMatrixControlValue, string > = {
|
|
|
19
19
|
'top center': __( 'Top Center' ),
|
|
20
20
|
'top right': __( 'Top Right' ),
|
|
21
21
|
'center left': __( 'Center Left' ),
|
|
22
|
-
'center center': __( 'Center
|
|
23
|
-
center: __( 'Center
|
|
22
|
+
'center center': __( 'Center' ),
|
|
23
|
+
center: __( 'Center' ),
|
|
24
24
|
'center right': __( 'Center Right' ),
|
|
25
25
|
'bottom left': __( 'Bottom Left' ),
|
|
26
26
|
'bottom center': __( 'Bottom Center' ),
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import { map } from 'lodash';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* WordPress dependencies
|
|
@@ -70,7 +69,7 @@ export function getAutoCompleterUI( autocompleter ) {
|
|
|
70
69
|
role="listbox"
|
|
71
70
|
className="components-autocomplete__results"
|
|
72
71
|
>
|
|
73
|
-
{ map(
|
|
72
|
+
{ items.map( ( option, index ) => (
|
|
74
73
|
<Button
|
|
75
74
|
key={ option.key }
|
|
76
75
|
id={ `components-autocomplete-item-${ instanceId }-${ option.key }` }
|
|
@@ -14,14 +14,10 @@ import { useRef } from '@wordpress/element';
|
|
|
14
14
|
*/
|
|
15
15
|
import { getAutoCompleterUI } from '../autocompleter-ui';
|
|
16
16
|
|
|
17
|
-
jest.useFakeTimers();
|
|
18
|
-
|
|
19
17
|
describe( 'AutocompleterUI', () => {
|
|
20
18
|
describe( 'click outside behavior', () => {
|
|
21
19
|
it( 'should call reset function when a click on another element occurs', async () => {
|
|
22
|
-
const user = userEvent.setup(
|
|
23
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
24
|
-
} );
|
|
20
|
+
const user = userEvent.setup();
|
|
25
21
|
|
|
26
22
|
const resetSpy = jest.fn();
|
|
27
23
|
|
|
@@ -16,7 +16,7 @@ import { useBorderBoxControlLinkedButton } from './hook';
|
|
|
16
16
|
import type { LinkedButtonProps } from '../types';
|
|
17
17
|
|
|
18
18
|
const BorderBoxControlLinkedButton = (
|
|
19
|
-
props: WordPressComponentProps< LinkedButtonProps, '
|
|
19
|
+
props: WordPressComponentProps< LinkedButtonProps, 'button' >,
|
|
20
20
|
forwardedRef: React.ForwardedRef< any >
|
|
21
21
|
) => {
|
|
22
22
|
const { className, isLinked, ...buttonProps } =
|
|
@@ -13,7 +13,7 @@ import { useCx } from '../../utils/hooks/use-cx';
|
|
|
13
13
|
import type { LinkedButtonProps } from '../types';
|
|
14
14
|
|
|
15
15
|
export function useBorderBoxControlLinkedButton(
|
|
16
|
-
props: WordPressComponentProps< LinkedButtonProps, '
|
|
16
|
+
props: WordPressComponentProps< LinkedButtonProps, 'button' >
|
|
17
17
|
) {
|
|
18
18
|
const {
|
|
19
19
|
className,
|
|
@@ -24,7 +24,8 @@ import { useBorderControlDropdown } from './hook';
|
|
|
24
24
|
import { StyledLabel } from '../../base-control/styles/base-control-styles';
|
|
25
25
|
import DropdownContentWrapper from '../../dropdown/dropdown-content-wrapper';
|
|
26
26
|
|
|
27
|
-
import type { ColorObject
|
|
27
|
+
import type { ColorObject } from '../../color-palette/types';
|
|
28
|
+
import { isMultiplePaletteArray } from '../../color-palette/utils';
|
|
28
29
|
import type { DropdownProps as DropdownComponentProps } from '../../dropdown/types';
|
|
29
30
|
import type { ColorProps, DropdownProps } from '../types';
|
|
30
31
|
|
|
@@ -32,14 +33,15 @@ const getColorObject = (
|
|
|
32
33
|
colorValue: CSSProperties[ 'borderColor' ],
|
|
33
34
|
colors: ColorProps[ 'colors' ] | undefined
|
|
34
35
|
) => {
|
|
35
|
-
if ( ! colorValue || ! colors
|
|
36
|
+
if ( ! colorValue || ! colors ) {
|
|
36
37
|
return;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
if ( ( colors
|
|
40
|
+
if ( isMultiplePaletteArray( colors ) ) {
|
|
41
|
+
// Multiple origins
|
|
40
42
|
let matchedColor;
|
|
41
43
|
|
|
42
|
-
|
|
44
|
+
colors.some( ( origin ) =>
|
|
43
45
|
origin.colors.some( ( color ) => {
|
|
44
46
|
if ( color.color === colorValue ) {
|
|
45
47
|
matchedColor = color;
|
|
@@ -53,9 +55,8 @@ const getColorObject = (
|
|
|
53
55
|
return matchedColor;
|
|
54
56
|
}
|
|
55
57
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
);
|
|
58
|
+
// Single origin
|
|
59
|
+
return colors.find( ( color ) => color.color === colorValue );
|
|
59
60
|
};
|
|
60
61
|
|
|
61
62
|
const getToggleAriaLabel = (
|
|
@@ -166,7 +167,7 @@ const BorderControlDropdown = (
|
|
|
166
167
|
onClick={ onToggle }
|
|
167
168
|
variant="tertiary"
|
|
168
169
|
aria-label={ toggleAriaLabel }
|
|
169
|
-
|
|
170
|
+
tooltipPosition={ dropdownPosition }
|
|
170
171
|
label={ __( 'Border color and style picker' ) }
|
|
171
172
|
showTooltip={ true }
|
|
172
173
|
>
|
|
@@ -14,8 +14,6 @@ import { useState } from '@wordpress/element';
|
|
|
14
14
|
*/
|
|
15
15
|
import BoxControl from '../';
|
|
16
16
|
|
|
17
|
-
jest.useFakeTimers();
|
|
18
|
-
|
|
19
17
|
const Example = ( extraProps ) => {
|
|
20
18
|
const [ state, setState ] = useState();
|
|
21
19
|
|
|
@@ -39,9 +37,7 @@ describe( 'BoxControl', () => {
|
|
|
39
37
|
} );
|
|
40
38
|
|
|
41
39
|
it( 'should update values when interacting with input', async () => {
|
|
42
|
-
const user = userEvent.setup(
|
|
43
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
44
|
-
} );
|
|
40
|
+
const user = userEvent.setup();
|
|
45
41
|
|
|
46
42
|
render( <BoxControl /> );
|
|
47
43
|
|
|
@@ -63,9 +59,7 @@ describe( 'BoxControl', () => {
|
|
|
63
59
|
|
|
64
60
|
describe( 'Reset', () => {
|
|
65
61
|
it( 'should reset values when clicking Reset', async () => {
|
|
66
|
-
const user = userEvent.setup(
|
|
67
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
68
|
-
} );
|
|
62
|
+
const user = userEvent.setup();
|
|
69
63
|
|
|
70
64
|
render( <BoxControl /> );
|
|
71
65
|
|
|
@@ -89,9 +83,7 @@ describe( 'BoxControl', () => {
|
|
|
89
83
|
} );
|
|
90
84
|
|
|
91
85
|
it( 'should reset values when clicking Reset, if controlled', async () => {
|
|
92
|
-
const user = userEvent.setup(
|
|
93
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
94
|
-
} );
|
|
86
|
+
const user = userEvent.setup();
|
|
95
87
|
|
|
96
88
|
render( <Example /> );
|
|
97
89
|
|
|
@@ -115,9 +107,7 @@ describe( 'BoxControl', () => {
|
|
|
115
107
|
} );
|
|
116
108
|
|
|
117
109
|
it( 'should reset values when clicking Reset, if controlled <-> uncontrolled state changes', async () => {
|
|
118
|
-
const user = userEvent.setup(
|
|
119
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
120
|
-
} );
|
|
110
|
+
const user = userEvent.setup();
|
|
121
111
|
|
|
122
112
|
render( <Example /> );
|
|
123
113
|
|
|
@@ -141,9 +131,7 @@ describe( 'BoxControl', () => {
|
|
|
141
131
|
} );
|
|
142
132
|
|
|
143
133
|
it( 'should persist cleared value when focus changes', async () => {
|
|
144
|
-
const user = userEvent.setup(
|
|
145
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
146
|
-
} );
|
|
134
|
+
const user = userEvent.setup();
|
|
147
135
|
const spyChange = jest.fn();
|
|
148
136
|
|
|
149
137
|
render( <BoxControl onChange={ ( v ) => spyChange( v ) } /> );
|
|
@@ -179,9 +167,7 @@ describe( 'BoxControl', () => {
|
|
|
179
167
|
|
|
180
168
|
describe( 'Unlinked sides', () => {
|
|
181
169
|
it( 'should update a single side value when unlinked', async () => {
|
|
182
|
-
const user = userEvent.setup(
|
|
183
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
184
|
-
} );
|
|
170
|
+
const user = userEvent.setup();
|
|
185
171
|
|
|
186
172
|
render( <Example /> );
|
|
187
173
|
|
|
@@ -216,9 +202,7 @@ describe( 'BoxControl', () => {
|
|
|
216
202
|
} );
|
|
217
203
|
|
|
218
204
|
it( 'should update a whole axis when value is changed when unlinked', async () => {
|
|
219
|
-
const user = userEvent.setup(
|
|
220
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
221
|
-
} );
|
|
205
|
+
const user = userEvent.setup();
|
|
222
206
|
|
|
223
207
|
render( <Example splitOnAxis /> );
|
|
224
208
|
|
|
@@ -251,9 +235,7 @@ describe( 'BoxControl', () => {
|
|
|
251
235
|
|
|
252
236
|
describe( 'Unit selections', () => {
|
|
253
237
|
it( 'should update unlinked controls unit selection based on all input control', async () => {
|
|
254
|
-
const user = userEvent.setup(
|
|
255
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
256
|
-
} );
|
|
238
|
+
const user = userEvent.setup();
|
|
257
239
|
|
|
258
240
|
// Render control.
|
|
259
241
|
render( <BoxControl /> );
|
|
@@ -285,9 +267,7 @@ describe( 'BoxControl', () => {
|
|
|
285
267
|
} );
|
|
286
268
|
|
|
287
269
|
it( 'should use individual side attribute unit when available', async () => {
|
|
288
|
-
const user = userEvent.setup(
|
|
289
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
290
|
-
} );
|
|
270
|
+
const user = userEvent.setup();
|
|
291
271
|
|
|
292
272
|
// Render control.
|
|
293
273
|
const { rerender } = render( <BoxControl /> );
|
|
@@ -337,9 +317,7 @@ describe( 'BoxControl', () => {
|
|
|
337
317
|
|
|
338
318
|
describe( 'onChange updates', () => {
|
|
339
319
|
it( 'should call onChange when values contain more than just CSS units', async () => {
|
|
340
|
-
const user = userEvent.setup(
|
|
341
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
342
|
-
} );
|
|
320
|
+
const user = userEvent.setup();
|
|
343
321
|
const setState = jest.fn();
|
|
344
322
|
|
|
345
323
|
render( <BoxControl onChange={ setState } /> );
|
|
@@ -361,9 +339,7 @@ describe( 'BoxControl', () => {
|
|
|
361
339
|
} );
|
|
362
340
|
|
|
363
341
|
it( 'should not pass invalid CSS unit only values to onChange', async () => {
|
|
364
|
-
const user = userEvent.setup(
|
|
365
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
366
|
-
} );
|
|
342
|
+
const user = userEvent.setup();
|
|
367
343
|
const setState = jest.fn();
|
|
368
344
|
|
|
369
345
|
render( <BoxControl onChange={ setState } /> );
|