@wordpress/components 23.3.2 → 23.4.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 +20 -5
- package/build/alignment-matrix-control/utils.js +4 -4
- package/build/alignment-matrix-control/utils.js.map +1 -1
- package/build/angle-picker-control/angle-circle.js +37 -29
- package/build/angle-picker-control/angle-circle.js.map +1 -1
- package/build/angle-picker-control/index.js +44 -9
- package/build/angle-picker-control/index.js.map +1 -1
- package/build/angle-picker-control/styles/angle-picker-control-styles.js +13 -13
- package/build/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
- package/build/{base-field → angle-picker-control}/types.js +0 -0
- package/build/angle-picker-control/types.js.map +1 -0
- package/build/autocomplete/autocompleter-ui.native.js +1 -0
- package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
- package/build/base-control/hooks.js +1 -1
- package/build/base-control/hooks.js.map +1 -1
- package/build/border-box-control/utils.js +1 -1
- package/build/border-box-control/utils.js.map +1 -1
- package/build/box-control/all-input-control.js +2 -2
- package/build/box-control/all-input-control.js.map +1 -1
- package/build/box-control/axial-input-controls.js +1 -1
- package/build/box-control/axial-input-controls.js.map +1 -1
- package/build/box-control/icon.js.map +1 -1
- package/build/box-control/index.js +32 -3
- package/build/box-control/index.js.map +1 -1
- package/build/box-control/input-controls.js +5 -5
- package/build/box-control/input-controls.js.map +1 -1
- package/build/box-control/linked-button.js.map +1 -1
- package/build/box-control/styles/box-control-icon-styles.js +28 -28
- package/build/box-control/styles/box-control-icon-styles.js.map +1 -1
- package/build/box-control/styles/box-control-styles.js +23 -23
- package/build/box-control/styles/box-control-styles.js.map +1 -1
- package/build/box-control/styles/box-control-visualizer-styles.js +19 -19
- package/build/box-control/styles/box-control-visualizer-styles.js.map +1 -1
- package/build/box-control/types.js +6 -0
- package/build/box-control/types.js.map +1 -0
- package/build/box-control/unit-control.js.map +1 -1
- package/build/box-control/utils.js +23 -23
- package/build/box-control/utils.js.map +1 -1
- package/build/color-palette/index.js +8 -3
- package/build/color-palette/index.js.map +1 -1
- package/build/combobox-control/index.js +68 -12
- package/build/combobox-control/index.js.map +1 -1
- package/build/combobox-control/styles.js +2 -2
- package/build/combobox-control/styles.js.map +1 -1
- package/build/combobox-control/types.js +6 -0
- package/build/combobox-control/types.js.map +1 -0
- package/build/custom-gradient-picker/index.js +0 -1
- package/build/custom-gradient-picker/index.js.map +1 -1
- package/build/date-time/time/index.js +1 -1
- package/build/date-time/time/index.js.map +1 -1
- package/build/date-time/utils.js +1 -1
- package/build/date-time/utils.js.map +1 -1
- package/build/draggable/index.js +2 -2
- package/build/draggable/index.js.map +1 -1
- package/build/focal-point-picker/utils.js +3 -3
- package/build/focal-point-picker/utils.js.map +1 -1
- package/build/font-size-picker/utils.js +2 -2
- package/build/font-size-picker/utils.js.map +1 -1
- package/build/gradient-picker/index.js +9 -4
- package/build/gradient-picker/index.js.map +1 -1
- package/build/input-control/reducer/reducer.js +5 -5
- package/build/input-control/reducer/reducer.js.map +1 -1
- package/build/input-control/utils.js +1 -1
- package/build/input-control/utils.js.map +1 -1
- package/build/menu-items-choice/index.js +40 -3
- package/build/menu-items-choice/index.js.map +1 -1
- package/build/menu-items-choice/types.js +6 -0
- package/build/menu-items-choice/types.js.map +1 -0
- package/build/modal/index.js +41 -3
- package/build/modal/index.js.map +1 -1
- package/build/palette-edit/index.js +4 -1
- package/build/palette-edit/index.js.map +1 -1
- package/build/panel/header.js +9 -0
- package/build/panel/header.js.map +1 -1
- package/build/panel/index.js +21 -3
- package/build/panel/index.js.map +1 -1
- package/build/panel/row.js +10 -4
- package/build/panel/row.js.map +1 -1
- package/build/panel/types.js +6 -0
- package/build/panel/types.js.map +1 -0
- package/build/popover/index.js +15 -3
- package/build/popover/index.js.map +1 -1
- package/build/popover/overlay-middlewares.js +46 -0
- package/build/popover/overlay-middlewares.js.map +1 -0
- package/build/popover/utils.js +45 -6
- package/build/popover/utils.js.map +1 -1
- package/build/query-controls/terms.js +1 -1
- package/build/query-controls/terms.js.map +1 -1
- package/build/range-control/utils.js +4 -4
- package/build/range-control/utils.js.map +1 -1
- package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +12 -12
- package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
- package/build/resizable-box/resize-tooltip/utils.js +14 -14
- package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build/snackbar/index.js +2 -2
- package/build/snackbar/index.js.map +1 -1
- package/build/toolbar/toolbar/index.js +25 -14
- package/build/toolbar/toolbar/index.js.map +1 -1
- package/build/toolbar/toolbar/toolbar-container.js +5 -4
- package/build/toolbar/toolbar/toolbar-container.js.map +1 -1
- package/build/toolbar/toolbar/types.js +6 -0
- package/build/toolbar/toolbar/types.js.map +1 -0
- package/build/toolbar/toolbar-button/index.js +2 -0
- package/build/toolbar/toolbar-button/index.js.map +1 -1
- package/build/toolbar/toolbar-button/toolbar-button-container.js +1 -0
- package/build/toolbar/toolbar-button/toolbar-button-container.js.map +1 -1
- package/build/toolbar/toolbar-context/index.js +2 -0
- package/build/toolbar/toolbar-context/index.js.map +1 -1
- package/build/toolbar/toolbar-dropdown-menu/index.js +2 -0
- package/build/toolbar/toolbar-dropdown-menu/index.js.map +1 -1
- package/build/toolbar/toolbar-group/index.js +2 -0
- package/build/toolbar/toolbar-group/index.js.map +1 -1
- package/build/toolbar/toolbar-group/toolbar-group-collapsed.js +2 -0
- package/build/toolbar/toolbar-group/toolbar-group-collapsed.js.map +1 -1
- package/build/toolbar/toolbar-group/toolbar-group-container.js +1 -0
- package/build/toolbar/toolbar-group/toolbar-group-container.js.map +1 -1
- package/build/toolbar/toolbar-item/index.js +2 -0
- package/build/toolbar/toolbar-item/index.js.map +1 -1
- package/build/tools-panel/tools-panel/component.js +61 -5
- package/build/tools-panel/tools-panel/component.js.map +1 -1
- package/build/tools-panel/tools-panel/hook.js +4 -2
- package/build/tools-panel/tools-panel/hook.js.map +1 -1
- package/build/tools-panel/tools-panel-header/component.js +2 -1
- package/build/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build/tools-panel/tools-panel-header/hook.js +2 -0
- package/build/tools-panel/tools-panel-header/hook.js.map +1 -1
- package/build/tools-panel/tools-panel-item/component.js +5 -4
- package/build/tools-panel/tools-panel-item/component.js.map +1 -1
- package/build/tools-panel/tools-panel-item/hook.js +4 -2
- package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build/tree-grid/cell.js +15 -4
- package/build/tree-grid/cell.js.map +1 -1
- package/build/tree-grid/index.js +81 -19
- package/build/tree-grid/index.js.map +1 -1
- package/build/tree-grid/item.js +14 -3
- package/build/tree-grid/item.js.map +1 -1
- package/build/tree-grid/roving-tab-index-context.js +1 -1
- package/build/tree-grid/roving-tab-index-context.js.map +1 -1
- package/build/tree-grid/roving-tab-index-item.js +13 -6
- package/build/tree-grid/roving-tab-index-item.js.map +1 -1
- package/build/tree-grid/roving-tab-index.js +0 -3
- package/build/tree-grid/roving-tab-index.js.map +1 -1
- package/build/tree-grid/row.js +20 -18
- package/build/tree-grid/row.js.map +1 -1
- package/build/tree-grid/types.js +6 -0
- package/build/tree-grid/types.js.map +1 -0
- package/build/ui/context/context-connect.js +7 -7
- package/build/ui/context/context-connect.js.map +1 -1
- package/build/ui/context/get-styled-class-name-from-key.js +1 -1
- package/build/ui/context/get-styled-class-name-from-key.js.map +1 -1
- package/build/ui/utils/get-valid-children.js +1 -1
- package/build/ui/utils/get-valid-children.js.map +1 -1
- package/build/ui/utils/space.js +1 -1
- package/build/ui/utils/space.js.map +1 -1
- package/build/unit-control/index.js +2 -2
- package/build/unit-control/index.js.map +1 -1
- package/build/unit-control/utils.js +20 -20
- package/build/unit-control/utils.js.map +1 -1
- package/build/utils/events.js +4 -4
- package/build/utils/events.js.map +1 -1
- package/build/utils/hooks/use-controlled-state.js +2 -2
- package/build/utils/hooks/use-controlled-state.js.map +1 -1
- package/build/utils/hooks/use-controlled-value.js +4 -4
- package/build/utils/hooks/use-controlled-value.js.map +1 -1
- package/build/utils/hooks/use-latest-ref.js +1 -1
- package/build/utils/hooks/use-latest-ref.js.map +1 -1
- package/build/utils/unit-values.js +3 -3
- package/build/utils/unit-values.js.map +1 -1
- package/build-module/alignment-matrix-control/utils.js +4 -4
- package/build-module/alignment-matrix-control/utils.js.map +1 -1
- package/build-module/angle-picker-control/angle-circle.js +37 -29
- package/build-module/angle-picker-control/angle-circle.js.map +1 -1
- package/build-module/angle-picker-control/index.js +42 -8
- package/build-module/angle-picker-control/index.js.map +1 -1
- package/build-module/angle-picker-control/styles/angle-picker-control-styles.js +13 -13
- package/build-module/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
- package/build-module/{base-field → angle-picker-control}/types.js +0 -0
- package/build-module/{base-field → angle-picker-control}/types.js.map +0 -0
- package/build-module/autocomplete/autocompleter-ui.native.js +1 -0
- package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
- package/build-module/base-control/hooks.js +1 -1
- package/build-module/base-control/hooks.js.map +1 -1
- package/build-module/border-box-control/utils.js +1 -1
- package/build-module/border-box-control/utils.js.map +1 -1
- package/build-module/box-control/all-input-control.js +2 -2
- package/build-module/box-control/all-input-control.js.map +1 -1
- package/build-module/box-control/axial-input-controls.js +1 -1
- package/build-module/box-control/axial-input-controls.js.map +1 -1
- package/build-module/box-control/icon.js.map +1 -1
- package/build-module/box-control/index.js +31 -3
- package/build-module/box-control/index.js.map +1 -1
- package/build-module/box-control/input-controls.js +5 -5
- package/build-module/box-control/input-controls.js.map +1 -1
- package/build-module/box-control/linked-button.js.map +1 -1
- package/build-module/box-control/styles/box-control-icon-styles.js +28 -28
- package/build-module/box-control/styles/box-control-icon-styles.js.map +1 -1
- package/build-module/box-control/styles/box-control-styles.js +23 -23
- package/build-module/box-control/styles/box-control-styles.js.map +1 -1
- package/build-module/box-control/styles/box-control-visualizer-styles.js +19 -19
- package/build-module/box-control/styles/box-control-visualizer-styles.js.map +1 -1
- package/build-module/box-control/types.js +2 -0
- package/{build/base-field → build-module/box-control}/types.js.map +0 -0
- package/build-module/box-control/unit-control.js.map +1 -1
- package/build-module/box-control/utils.js +23 -23
- package/build-module/box-control/utils.js.map +1 -1
- package/build-module/color-palette/index.js +8 -3
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/combobox-control/index.js +68 -12
- package/build-module/combobox-control/index.js.map +1 -1
- package/build-module/combobox-control/styles.js +2 -2
- package/build-module/combobox-control/styles.js.map +1 -1
- package/build-module/combobox-control/types.js +2 -0
- package/build-module/{resizable-box/styles/resizable-box.styles.js.map → combobox-control/types.js.map} +0 -0
- package/build-module/custom-gradient-picker/index.js +0 -1
- package/build-module/custom-gradient-picker/index.js.map +1 -1
- package/build-module/date-time/time/index.js +1 -1
- package/build-module/date-time/time/index.js.map +1 -1
- package/build-module/date-time/utils.js +1 -1
- package/build-module/date-time/utils.js.map +1 -1
- package/build-module/draggable/index.js +2 -2
- package/build-module/draggable/index.js.map +1 -1
- package/build-module/focal-point-picker/utils.js +3 -3
- package/build-module/focal-point-picker/utils.js.map +1 -1
- package/build-module/font-size-picker/utils.js +2 -2
- package/build-module/font-size-picker/utils.js.map +1 -1
- package/build-module/gradient-picker/index.js +9 -4
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/input-control/reducer/reducer.js +5 -5
- package/build-module/input-control/reducer/reducer.js.map +1 -1
- package/build-module/input-control/utils.js +1 -1
- package/build-module/input-control/utils.js.map +1 -1
- package/build-module/menu-items-choice/index.js +40 -4
- package/build-module/menu-items-choice/index.js.map +1 -1
- package/build-module/menu-items-choice/types.js +2 -0
- package/{build/resizable-box/styles/resizable-box.styles.js.map → build-module/menu-items-choice/types.js.map} +0 -0
- package/build-module/modal/index.js +41 -4
- package/build-module/modal/index.js.map +1 -1
- package/build-module/palette-edit/index.js +4 -1
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/panel/header.js +9 -0
- package/build-module/panel/header.js.map +1 -1
- package/build-module/panel/index.js +20 -2
- package/build-module/panel/index.js.map +1 -1
- package/build-module/panel/row.js +9 -3
- package/build-module/panel/row.js.map +1 -1
- package/build-module/panel/types.js +2 -0
- package/build-module/panel/types.js.map +1 -0
- package/build-module/popover/index.js +14 -4
- package/build-module/popover/index.js.map +1 -1
- package/build-module/popover/overlay-middlewares.js +38 -0
- package/build-module/popover/overlay-middlewares.js.map +1 -0
- package/build-module/popover/utils.js +41 -5
- package/build-module/popover/utils.js.map +1 -1
- package/build-module/query-controls/terms.js +1 -1
- package/build-module/query-controls/terms.js.map +1 -1
- package/build-module/range-control/utils.js +4 -4
- package/build-module/range-control/utils.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +12 -12
- package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/utils.js +14 -14
- package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build-module/snackbar/index.js +2 -2
- package/build-module/snackbar/index.js.map +1 -1
- package/build-module/toolbar/toolbar/index.js +25 -13
- package/build-module/toolbar/toolbar/index.js.map +1 -1
- package/build-module/toolbar/toolbar/toolbar-container.js +4 -3
- package/build-module/toolbar/toolbar/toolbar-container.js.map +1 -1
- package/build-module/toolbar/toolbar/types.js +2 -0
- package/build-module/toolbar/toolbar/types.js.map +1 -0
- package/build-module/toolbar/toolbar-button/index.js +1 -0
- package/build-module/toolbar/toolbar-button/index.js.map +1 -1
- package/build-module/toolbar/toolbar-button/toolbar-button-container.js +1 -0
- package/build-module/toolbar/toolbar-button/toolbar-button-container.js.map +1 -1
- package/build-module/toolbar/toolbar-context/index.js +2 -0
- package/build-module/toolbar/toolbar-context/index.js.map +1 -1
- package/build-module/toolbar/toolbar-dropdown-menu/index.js +1 -0
- package/build-module/toolbar/toolbar-dropdown-menu/index.js.map +1 -1
- package/build-module/toolbar/toolbar-group/index.js +1 -0
- package/build-module/toolbar/toolbar-group/index.js.map +1 -1
- package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.js +1 -0
- package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.js.map +1 -1
- package/build-module/toolbar/toolbar-group/toolbar-group-container.js +1 -0
- package/build-module/toolbar/toolbar-group/toolbar-group-container.js.map +1 -1
- package/build-module/toolbar/toolbar-item/index.js +1 -0
- package/build-module/toolbar/toolbar-item/index.js.map +1 -1
- package/build-module/tools-panel/tools-panel/component.js +59 -4
- package/build-module/tools-panel/tools-panel/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel/hook.js +4 -2
- package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/component.js +2 -1
- package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/hook.js +2 -0
- package/build-module/tools-panel/tools-panel-header/hook.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/component.js +3 -3
- package/build-module/tools-panel/tools-panel-item/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/hook.js +5 -2
- package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build-module/tree-grid/cell.js +16 -4
- package/build-module/tree-grid/cell.js.map +1 -1
- package/build-module/tree-grid/index.js +81 -21
- package/build-module/tree-grid/index.js.map +1 -1
- package/build-module/tree-grid/item.js +14 -2
- package/build-module/tree-grid/item.js.map +1 -1
- package/build-module/tree-grid/roving-tab-index-context.js +1 -1
- package/build-module/tree-grid/roving-tab-index-context.js.map +1 -1
- package/build-module/tree-grid/roving-tab-index-item.js +11 -4
- package/build-module/tree-grid/roving-tab-index-item.js.map +1 -1
- package/build-module/tree-grid/roving-tab-index.js +0 -3
- package/build-module/tree-grid/roving-tab-index.js.map +1 -1
- package/build-module/tree-grid/row.js +22 -17
- package/build-module/tree-grid/row.js.map +1 -1
- package/build-module/tree-grid/types.js +2 -0
- package/build-module/tree-grid/types.js.map +1 -0
- package/build-module/ui/context/context-connect.js +7 -7
- package/build-module/ui/context/context-connect.js.map +1 -1
- package/build-module/ui/context/get-styled-class-name-from-key.js +1 -1
- package/build-module/ui/context/get-styled-class-name-from-key.js.map +1 -1
- package/build-module/ui/utils/get-valid-children.js +1 -1
- package/build-module/ui/utils/get-valid-children.js.map +1 -1
- package/build-module/ui/utils/space.js +1 -1
- package/build-module/ui/utils/space.js.map +1 -1
- package/build-module/unit-control/index.js +2 -2
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/unit-control/utils.js +20 -20
- package/build-module/unit-control/utils.js.map +1 -1
- package/build-module/utils/events.js +4 -4
- package/build-module/utils/events.js.map +1 -1
- package/build-module/utils/hooks/use-controlled-state.js +2 -2
- package/build-module/utils/hooks/use-controlled-state.js.map +1 -1
- package/build-module/utils/hooks/use-controlled-value.js +4 -4
- package/build-module/utils/hooks/use-controlled-value.js.map +1 -1
- package/build-module/utils/hooks/use-latest-ref.js +1 -1
- package/build-module/utils/hooks/use-latest-ref.js.map +1 -1
- package/build-module/utils/unit-values.js +3 -3
- package/build-module/utils/unit-values.js.map +1 -1
- package/build-style/style-rtl.css +5 -0
- package/build-style/style.css +5 -0
- package/build-types/alignment-matrix-control/utils.d.ts +4 -4
- package/build-types/angle-picker-control/angle-circle.d.ts +6 -0
- package/build-types/angle-picker-control/angle-circle.d.ts.map +1 -0
- package/build-types/angle-picker-control/index.d.ts +29 -0
- package/build-types/angle-picker-control/index.d.ts.map +1 -0
- package/build-types/angle-picker-control/stories/index.d.ts +15 -0
- package/build-types/angle-picker-control/stories/index.d.ts.map +1 -0
- package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts +20 -0
- package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts.map +1 -0
- package/build-types/angle-picker-control/types.d.ts +26 -0
- package/build-types/angle-picker-control/types.d.ts.map +1 -0
- package/build-types/base-control/hooks.d.ts +1 -1
- package/build-types/border-box-control/border-box-control/component.d.ts +1 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts +1 -1
- package/build-types/border-box-control/border-box-control-split-controls/component.d.ts +1 -1
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +1 -1
- package/build-types/border-box-control/stories/index.d.ts +1 -1
- package/build-types/{base-field → border-box-control}/test/index.d.ts +0 -0
- package/build-types/border-box-control/test/index.d.ts.map +1 -0
- package/build-types/border-box-control/test/utils.d.ts +2 -0
- package/build-types/border-box-control/test/utils.d.ts.map +1 -0
- package/build-types/box-control/all-input-control.d.ts +4 -0
- package/build-types/box-control/all-input-control.d.ts.map +1 -0
- package/build-types/box-control/axial-input-controls.d.ts +4 -0
- package/build-types/box-control/axial-input-controls.d.ts.map +1 -0
- package/build-types/box-control/icon.d.ts +8 -0
- package/build-types/box-control/icon.d.ts.map +1 -0
- package/build-types/box-control/index.d.ts +31 -0
- package/build-types/box-control/index.d.ts.map +1 -0
- package/build-types/box-control/input-controls.d.ts +4 -0
- package/build-types/box-control/input-controls.d.ts.map +1 -0
- package/build-types/box-control/linked-button.d.ts +9 -0
- package/build-types/box-control/linked-button.d.ts.map +1 -0
- package/build-types/box-control/styles/box-control-icon-styles.d.ts +42 -0
- package/build-types/box-control/styles/box-control-icon-styles.d.ts.map +1 -0
- package/build-types/box-control/styles/box-control-styles.d.ts +42 -0
- package/build-types/box-control/styles/box-control-styles.d.ts.map +1 -0
- package/build-types/box-control/styles/box-control-visualizer-styles.d.ts +46 -0
- package/build-types/box-control/styles/box-control-visualizer-styles.d.ts.map +1 -0
- package/build-types/box-control/test/index.d.ts +2 -0
- package/build-types/box-control/test/index.d.ts.map +1 -0
- package/build-types/box-control/types.d.ts +99 -0
- package/build-types/box-control/types.d.ts.map +1 -0
- package/build-types/box-control/unit-control.d.ts +4 -0
- package/build-types/box-control/unit-control.d.ts.map +1 -0
- package/build-types/box-control/utils.d.ts +84 -0
- package/build-types/box-control/utils.d.ts.map +1 -0
- package/build-types/color-palette/index.d.ts +3 -1
- package/build-types/color-palette/index.d.ts.map +1 -1
- package/build-types/color-palette/stories/index.d.ts +6 -2
- package/build-types/color-palette/stories/index.d.ts.map +1 -1
- package/build-types/color-palette/types.d.ts +8 -0
- package/build-types/color-palette/types.d.ts.map +1 -1
- package/build-types/combobox-control/index.d.ts +51 -0
- package/build-types/combobox-control/index.d.ts.map +1 -0
- package/build-types/combobox-control/stories/index.d.ts +18 -0
- package/build-types/combobox-control/stories/index.d.ts.map +1 -0
- package/build-types/combobox-control/styles.d.ts +8 -0
- package/build-types/combobox-control/styles.d.ts.map +1 -0
- package/build-types/combobox-control/test/index.d.ts +2 -0
- package/build-types/combobox-control/test/index.d.ts.map +1 -0
- package/build-types/combobox-control/types.d.ts +62 -0
- package/build-types/combobox-control/types.d.ts.map +1 -0
- package/build-types/date-time/utils.d.ts +1 -1
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +1 -1
- package/build-types/focal-point-picker/utils.d.ts +3 -3
- package/build-types/font-size-picker/utils.d.ts +2 -2
- package/build-types/input-control/reducer/reducer.d.ts +3 -3
- package/build-types/input-control/utils.d.ts +1 -1
- package/build-types/menu-items-choice/index.d.ts +38 -0
- package/build-types/menu-items-choice/index.d.ts.map +1 -0
- package/build-types/menu-items-choice/stories/index.d.ts +12 -0
- package/build-types/menu-items-choice/stories/index.d.ts.map +1 -0
- package/build-types/menu-items-choice/types.d.ts +53 -0
- package/build-types/menu-items-choice/types.d.ts.map +1 -0
- package/build-types/modal/index.d.ts.map +1 -1
- package/build-types/modal/types.d.ts +2 -0
- package/build-types/modal/types.d.ts.map +1 -1
- package/build-types/panel/header.d.ts +13 -0
- package/build-types/panel/header.d.ts.map +1 -0
- package/build-types/panel/index.d.ts +21 -0
- package/build-types/panel/index.d.ts.map +1 -0
- package/build-types/panel/row.d.ts +12 -0
- package/build-types/panel/row.d.ts.map +1 -0
- package/build-types/panel/test/header.d.ts +2 -0
- package/build-types/panel/test/header.d.ts.map +1 -0
- package/build-types/panel/test/index.d.ts +2 -0
- package/build-types/{base-field → panel}/test/index.d.ts.map +1 -1
- package/build-types/panel/test/row.d.ts +2 -0
- package/build-types/panel/test/row.d.ts.map +1 -0
- package/build-types/panel/types.d.ts +38 -0
- package/build-types/panel/types.d.ts.map +1 -0
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/popover/overlay-middlewares.d.ts +9 -0
- package/build-types/popover/overlay-middlewares.d.ts.map +1 -0
- package/build-types/popover/stories/index.d.ts.map +1 -1
- package/build-types/popover/types.d.ts +3 -2
- package/build-types/popover/types.d.ts.map +1 -1
- package/build-types/popover/utils.d.ts +12 -4
- package/build-types/popover/utils.d.ts.map +1 -1
- package/build-types/query-controls/terms.d.ts +1 -1
- package/build-types/range-control/utils.d.ts +4 -4
- package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts +5 -4
- package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/utils.d.ts +6 -6
- package/build-types/toolbar/index.d.ts +7 -0
- package/build-types/toolbar/index.d.ts.map +1 -0
- package/build-types/toolbar/stories/index.d.ts +14 -0
- package/build-types/toolbar/stories/index.d.ts.map +1 -0
- package/build-types/toolbar/test/index.d.ts +2 -0
- package/build-types/toolbar/test/index.d.ts.map +1 -0
- package/build-types/toolbar/test/toolbar-group.d.ts +2 -0
- package/build-types/toolbar/test/toolbar-group.d.ts.map +1 -0
- package/build-types/toolbar/toolbar/index.d.ts +25 -0
- package/build-types/toolbar/toolbar/index.d.ts.map +1 -0
- package/build-types/toolbar/toolbar/toolbar-container.d.ts +5 -0
- package/build-types/toolbar/toolbar/toolbar-container.d.ts.map +1 -0
- package/build-types/toolbar/toolbar/types.d.ts +15 -0
- package/build-types/toolbar/toolbar/types.d.ts.map +1 -0
- package/build-types/toolbar/toolbar-button/index.d.ts +12 -0
- package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -0
- package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts +3 -0
- package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts.map +1 -0
- package/build-types/toolbar/toolbar-context/index.d.ts +3 -0
- package/build-types/toolbar/toolbar-context/index.d.ts.map +1 -0
- package/build-types/toolbar/toolbar-dropdown-menu/index.d.ts +3 -0
- package/build-types/toolbar/toolbar-dropdown-menu/index.d.ts.map +1 -0
- package/build-types/toolbar/toolbar-group/index.d.ts +39 -0
- package/build-types/toolbar/toolbar-group/index.d.ts.map +1 -0
- package/build-types/toolbar/toolbar-group/toolbar-group-collapsed.d.ts +7 -0
- package/build-types/toolbar/toolbar-group/toolbar-group-collapsed.d.ts.map +1 -0
- package/build-types/toolbar/toolbar-group/toolbar-group-container.d.ts +7 -0
- package/build-types/toolbar/toolbar-group/toolbar-group-container.d.ts.map +1 -0
- package/build-types/toolbar/toolbar-item/index.d.ts +7 -0
- package/build-types/toolbar/toolbar-item/index.d.ts.map +1 -0
- package/build-types/tools-panel/stories/index.d.ts +17 -0
- package/build-types/tools-panel/stories/index.d.ts.map +1 -0
- package/build-types/tools-panel/tools-panel/component.d.ts +54 -2
- package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +2 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/hook.d.ts +2 -1
- package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/component.d.ts +2 -2
- package/build-types/tools-panel/tools-panel-item/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/tools-panel/types.d.ts +42 -15
- package/build-types/tools-panel/types.d.ts.map +1 -1
- package/build-types/tree-grid/cell.d.ts +13 -0
- package/build-types/tree-grid/cell.d.ts.map +1 -0
- package/build-types/tree-grid/index.d.ts +70 -0
- package/build-types/tree-grid/index.d.ts.map +1 -0
- package/build-types/tree-grid/item.d.ts +12 -0
- package/build-types/tree-grid/item.d.ts.map +1 -0
- package/build-types/tree-grid/roving-tab-index-context.d.ts +10 -0
- package/build-types/tree-grid/roving-tab-index-context.d.ts.map +1 -0
- package/build-types/tree-grid/roving-tab-index-item.d.ts +5 -0
- package/build-types/tree-grid/roving-tab-index-item.d.ts.map +1 -0
- package/build-types/tree-grid/roving-tab-index.d.ts +10 -0
- package/build-types/tree-grid/roving-tab-index.d.ts.map +1 -0
- package/build-types/tree-grid/row.d.ts +12 -0
- package/build-types/tree-grid/row.d.ts.map +1 -0
- package/build-types/tree-grid/stories/index.d.ts +13 -0
- package/build-types/tree-grid/stories/index.d.ts.map +1 -0
- package/build-types/tree-grid/test/cell.d.ts +2 -0
- package/build-types/tree-grid/test/cell.d.ts.map +1 -0
- package/build-types/tree-grid/test/index.d.ts +2 -0
- package/build-types/tree-grid/test/index.d.ts.map +1 -0
- package/build-types/tree-grid/test/roving-tab-index-item.d.ts +2 -0
- package/build-types/tree-grid/test/roving-tab-index-item.d.ts.map +1 -0
- package/build-types/tree-grid/test/roving-tab-index.d.ts +2 -0
- package/build-types/tree-grid/test/roving-tab-index.d.ts.map +1 -0
- package/build-types/tree-grid/test/row.d.ts +2 -0
- package/build-types/tree-grid/test/row.d.ts.map +1 -0
- package/build-types/tree-grid/types.d.ts +109 -0
- package/build-types/tree-grid/types.d.ts.map +1 -0
- package/build-types/ui/context/context-connect.d.ts +7 -7
- package/build-types/ui/context/get-styled-class-name-from-key.d.ts +1 -1
- package/build-types/ui/utils/get-valid-children.d.ts +1 -1
- package/build-types/ui/utils/space.d.ts +1 -1
- package/build-types/unit-control/index.d.ts +1 -1
- package/build-types/unit-control/utils.d.ts +20 -20
- package/build-types/utils/events.d.ts +2 -2
- package/build-types/utils/hooks/use-controlled-state.d.ts +1 -1
- package/build-types/utils/hooks/use-controlled-state.d.ts.map +1 -1
- package/build-types/utils/hooks/use-controlled-value.d.ts +4 -4
- package/build-types/utils/hooks/use-latest-ref.d.ts +1 -1
- package/build-types/utils/unit-values.d.ts +3 -3
- package/package.json +19 -19
- package/src/alignment-matrix-control/utils.tsx +4 -4
- package/src/angle-picker-control/README.md +17 -14
- package/src/angle-picker-control/{angle-circle.js → angle-circle.tsx} +44 -12
- package/src/angle-picker-control/{index.js → index.tsx} +54 -10
- package/src/angle-picker-control/stories/index.tsx +57 -0
- package/src/angle-picker-control/styles/{angle-picker-control-styles.js → angle-picker-control-styles.tsx} +5 -1
- package/src/angle-picker-control/types.ts +29 -0
- package/src/autocomplete/autocompleter-ui.native.js +1 -0
- package/src/base-control/hooks.ts +1 -1
- package/src/border-box-control/test/{index.js → index.tsx} +76 -102
- package/src/border-box-control/test/{utils.js → utils.ts} +20 -0
- package/src/border-box-control/utils.ts +1 -1
- package/src/box-control/README.md +17 -26
- package/src/box-control/{all-input-control.js → all-input-control.tsx} +10 -6
- package/src/box-control/{axial-input-controls.js → axial-input-controls.tsx} +29 -24
- package/src/box-control/{icon.js → icon.tsx} +9 -4
- package/src/box-control/{index.js → index.tsx} +43 -8
- package/src/box-control/{input-controls.js → input-controls.tsx} +26 -16
- package/src/box-control/{linked-button.js → linked-button.tsx} +4 -1
- package/src/box-control/styles/{box-control-icon-styles.js → box-control-icon-styles.ts} +1 -1
- package/src/box-control/styles/{box-control-styles.js → box-control-styles.ts} +10 -2
- package/src/box-control/styles/{box-control-visualizer-styles.js → box-control-visualizer-styles.ts} +6 -2
- package/src/box-control/test/{index.js → index.tsx} +12 -9
- package/src/box-control/types.ts +121 -0
- package/src/box-control/{unit-control.js → unit-control.tsx} +9 -2
- package/src/box-control/{utils.js → utils.ts} +47 -38
- package/src/button/test/index.tsx +38 -30
- package/src/color-palette/README.md +7 -0
- package/src/color-palette/index.tsx +6 -1
- package/src/color-palette/types.ts +8 -0
- package/src/combobox-control/README.md +8 -15
- package/src/combobox-control/{index.js → index.tsx} +91 -19
- package/src/combobox-control/stories/index.tsx +114 -0
- package/src/combobox-control/styles.ts +4 -1
- package/src/combobox-control/test/{index.js → index.tsx} +9 -7
- package/src/combobox-control/types.ts +69 -0
- package/src/custom-gradient-picker/index.js +0 -1
- package/src/custom-select-control/stories/index.js +1 -1
- package/src/date-time/time/index.tsx +1 -1
- package/src/date-time/utils.ts +1 -1
- package/src/draggable/index.tsx +2 -2
- package/src/dropdown-menu/test/index.js +3 -11
- package/src/focal-point-picker/utils.ts +3 -3
- package/src/font-size-picker/utils.ts +2 -2
- package/src/gradient-picker/README.md +8 -0
- package/src/gradient-picker/index.js +6 -1
- package/src/input-control/reducer/reducer.ts +5 -5
- package/src/input-control/utils.ts +1 -1
- package/src/menu-items-choice/index.tsx +83 -0
- package/src/menu-items-choice/stories/index.tsx +79 -0
- package/src/menu-items-choice/types.ts +54 -0
- package/src/modal/index.tsx +45 -1
- package/src/modal/style.scss +8 -0
- package/src/modal/types.ts +2 -0
- package/src/palette-edit/index.js +4 -1
- package/src/panel/README.md +2 -2
- package/src/panel/header.tsx +20 -0
- package/src/panel/index.tsx +48 -0
- package/src/panel/row.tsx +37 -0
- package/src/panel/stories/index.js +22 -0
- package/src/panel/test/__snapshots__/{header.js.snap → header.tsx.snap} +0 -0
- package/src/panel/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
- package/src/panel/test/__snapshots__/{row.js.snap → row.tsx.snap} +0 -0
- package/src/panel/test/{header.js → header.tsx} +1 -1
- package/src/panel/test/{index.js → index.tsx} +6 -4
- package/src/panel/test/{row.js → row.tsx} +4 -2
- package/src/panel/types.ts +38 -0
- package/src/popover/README.md +4 -1
- package/src/popover/index.tsx +17 -1
- package/src/popover/overlay-middlewares.tsx +29 -0
- package/src/popover/stories/index.tsx +7 -1
- package/src/popover/test/index.tsx +29 -21
- package/src/popover/types.ts +4 -2
- package/src/popover/utils.ts +39 -3
- package/src/query-controls/terms.ts +1 -1
- package/src/range-control/utils.ts +4 -4
- package/src/resizable-box/resize-tooltip/styles/{resize-tooltip.styles.js → resize-tooltip.styles.ts} +0 -0
- package/src/resizable-box/resize-tooltip/utils.ts +14 -14
- package/src/snackbar/index.tsx +2 -2
- package/src/toolbar/stories/{index.js → index.tsx} +39 -26
- package/src/toolbar/test/{index.js → index.tsx} +0 -0
- package/src/toolbar/test/{toolbar-group.js → toolbar-group.tsx} +2 -2
- package/src/toolbar/toolbar/README.md +7 -2
- package/src/toolbar/toolbar/{index.js → index.tsx} +33 -12
- package/src/toolbar/toolbar/{toolbar-container.js → toolbar-container.tsx} +9 -2
- package/src/toolbar/toolbar/types.ts +15 -0
- package/src/toolbar/toolbar-button/index.js +2 -0
- package/src/toolbar/toolbar-button/toolbar-button-container.js +2 -0
- package/src/toolbar/toolbar-context/index.js +2 -0
- package/src/toolbar/toolbar-dropdown-menu/index.js +2 -0
- package/src/toolbar/toolbar-group/index.js +2 -0
- package/src/toolbar/toolbar-group/toolbar-group-collapsed.js +2 -0
- package/src/toolbar/toolbar-group/toolbar-group-container.js +2 -0
- package/src/toolbar/toolbar-item/index.js +2 -0
- package/src/tools-panel/stories/{index.js → index.tsx} +196 -95
- package/src/tools-panel/test/index.js +6 -6
- package/src/tools-panel/tools-panel/README.md +12 -4
- package/src/tools-panel/tools-panel/component.tsx +57 -3
- package/src/tools-panel/tools-panel/hook.ts +4 -2
- package/src/tools-panel/tools-panel-header/README.md +7 -0
- package/src/tools-panel/tools-panel-header/component.tsx +2 -1
- package/src/tools-panel/tools-panel-header/hook.ts +6 -4
- package/src/tools-panel/tools-panel-item/README.md +6 -4
- package/src/tools-panel/tools-panel-item/component.tsx +4 -4
- package/src/tools-panel/tools-panel-item/hook.ts +4 -2
- package/src/tools-panel/types.ts +43 -15
- package/src/tree-grid/README.md +18 -58
- package/src/tree-grid/cell.tsx +41 -0
- package/src/tree-grid/{index.js → index.tsx} +111 -35
- package/src/tree-grid/item.tsx +32 -0
- package/src/tree-grid/{roving-tab-index-context.js → roving-tab-index-context.ts} +9 -1
- package/src/tree-grid/roving-tab-index-item.tsx +50 -0
- package/src/tree-grid/{roving-tab-index.js → roving-tab-index.tsx} +7 -5
- package/src/tree-grid/row.tsx +47 -0
- package/src/tree-grid/stories/index.tsx +144 -0
- package/src/tree-grid/test/__snapshots__/{cell.js.snap → cell.tsx.snap} +0 -0
- package/src/tree-grid/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
- package/src/tree-grid/test/__snapshots__/{roving-tab-index-item.js.snap → roving-tab-index-item.tsx.snap} +0 -0
- package/src/tree-grid/test/__snapshots__/{roving-tab-index.js.snap → roving-tab-index.tsx.snap} +0 -0
- package/src/tree-grid/test/__snapshots__/{row.js.snap → row.tsx.snap} +0 -0
- package/src/tree-grid/test/{cell.js → cell.tsx} +7 -4
- package/src/tree-grid/test/{index.js → index.tsx} +13 -5
- package/src/tree-grid/test/{roving-tab-index-item.js → roving-tab-index-item.tsx} +7 -4
- package/src/tree-grid/test/{roving-tab-index.js → roving-tab-index.tsx} +0 -0
- package/src/tree-grid/test/{row.js → row.tsx} +4 -4
- package/src/tree-grid/types.ts +116 -0
- package/src/ui/context/context-connect.ts +7 -7
- package/src/ui/context/get-styled-class-name-from-key.ts +1 -1
- package/src/ui/utils/get-valid-children.ts +1 -1
- package/src/ui/utils/space.ts +1 -1
- package/src/unit-control/index.tsx +2 -2
- package/src/unit-control/utils.ts +20 -20
- package/src/utils/events.ts +4 -4
- package/src/utils/hooks/use-controlled-state.js +2 -2
- package/src/utils/hooks/use-controlled-value.ts +4 -4
- package/src/utils/hooks/use-latest-ref.ts +1 -1
- package/src/utils/unit-values.ts +3 -3
- package/tsconfig.json +1 -7
- package/tsconfig.tsbuildinfo +1 -1
- package/build/base-field/hook.js +0 -54
- package/build/base-field/hook.js.map +0 -1
- package/build/base-field/index.js +0 -14
- package/build/base-field/index.js.map +0 -1
- package/build/base-field/styles.js +0 -33
- package/build/base-field/styles.js.map +0 -1
- package/build/resizable-box/styles/resizable-box.styles.js +0 -2
- package/build-module/base-field/hook.js +0 -37
- package/build-module/base-field/hook.js.map +0 -1
- package/build-module/base-field/index.js +0 -2
- package/build-module/base-field/index.js.map +0 -1
- package/build-module/base-field/styles.js +0 -18
- package/build-module/base-field/styles.js.map +0 -1
- package/build-module/resizable-box/styles/resizable-box.styles.js +0 -2
- package/build-types/base-field/hook.d.ts +0 -270
- package/build-types/base-field/hook.d.ts.map +0 -1
- package/build-types/base-field/index.d.ts +0 -2
- package/build-types/base-field/index.d.ts.map +0 -1
- package/build-types/base-field/styles.d.ts +0 -6
- package/build-types/base-field/styles.d.ts.map +0 -1
- package/build-types/base-field/types.d.ts +0 -29
- package/build-types/base-field/types.d.ts.map +0 -1
- package/build-types/resizable-box/styles/resizable-box.styles.d.ts +0 -1
- package/build-types/resizable-box/styles/resizable-box.styles.d.ts.map +0 -1
- package/src/angle-picker-control/stories/index.js +0 -29
- package/src/base-field/README.md +0 -66
- package/src/base-field/hook.ts +0 -51
- package/src/base-field/index.ts +0 -1
- package/src/base-field/styles.ts +0 -86
- package/src/base-field/test/__snapshots__/index.tsx.snap +0 -141
- package/src/base-field/test/index.tsx +0 -84
- package/src/base-field/types.ts +0 -29
- package/src/combobox-control/stories/index.js +0 -339
- package/src/menu-items-choice/index.js +0 -43
- package/src/panel/header.js +0 -10
- package/src/panel/index.js +0 -26
- package/src/panel/row.js +0 -20
- package/src/resizable-box/styles/resizable-box.styles.js +0 -0
- package/src/tools-panel/stories/utils/tools-panel-with-item-group-slot.js +0 -246
- package/src/tree-grid/cell.js +0 -24
- package/src/tree-grid/item.js +0 -20
- package/src/tree-grid/roving-tab-index-item.js +0 -33
- package/src/tree-grid/row.js +0 -31
- package/src/tree-grid/stories/index.js +0 -106
|
@@ -1,339 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { useState } from '@wordpress/element';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
|
-
import ComboboxControl from '../';
|
|
10
|
-
|
|
11
|
-
const countries = [
|
|
12
|
-
{ name: 'Afghanistan', code: 'AF' },
|
|
13
|
-
{ name: 'Åland Islands', code: 'AX' },
|
|
14
|
-
{ name: 'Albania', code: 'AL' },
|
|
15
|
-
{ name: 'Algeria', code: 'DZ' },
|
|
16
|
-
{ name: 'American Samoa', code: 'AS' },
|
|
17
|
-
{ name: 'Andorra', code: 'AD' },
|
|
18
|
-
{ name: 'Angola', code: 'AO' },
|
|
19
|
-
{ name: 'Anguilla', code: 'AI' },
|
|
20
|
-
{ name: 'Antarctica', code: 'AQ' },
|
|
21
|
-
{ name: 'Antigua and Barbuda', code: 'AG' },
|
|
22
|
-
{ name: 'Argentina', code: 'AR' },
|
|
23
|
-
{ name: 'Armenia', code: 'AM' },
|
|
24
|
-
{ name: 'Aruba', code: 'AW' },
|
|
25
|
-
{ name: 'Australia', code: 'AU' },
|
|
26
|
-
{ name: 'Austria', code: 'AT' },
|
|
27
|
-
{ name: 'Azerbaijan', code: 'AZ' },
|
|
28
|
-
{ name: 'Bahamas', code: 'BS' },
|
|
29
|
-
{ name: 'Bahrain', code: 'BH' },
|
|
30
|
-
{ name: 'Bangladesh', code: 'BD' },
|
|
31
|
-
{ name: 'Barbados', code: 'BB' },
|
|
32
|
-
{ name: 'Belarus', code: 'BY' },
|
|
33
|
-
{ name: 'Belgium', code: 'BE' },
|
|
34
|
-
{ name: 'Belize', code: 'BZ' },
|
|
35
|
-
{ name: 'Benin', code: 'BJ' },
|
|
36
|
-
{ name: 'Bermuda', code: 'BM' },
|
|
37
|
-
{ name: 'Bhutan', code: 'BT' },
|
|
38
|
-
{ name: 'Bolivia', code: 'BO' },
|
|
39
|
-
{ name: 'Bosnia and Herzegovina', code: 'BA' },
|
|
40
|
-
{ name: 'Botswana', code: 'BW' },
|
|
41
|
-
{ name: 'Bouvet Island', code: 'BV' },
|
|
42
|
-
{ name: 'Brazil', code: 'BR' },
|
|
43
|
-
{ name: 'British Indian Ocean Territory', code: 'IO' },
|
|
44
|
-
{ name: 'Brunei Darussalam', code: 'BN' },
|
|
45
|
-
{ name: 'Bulgaria', code: 'BG' },
|
|
46
|
-
{ name: 'Burkina Faso', code: 'BF' },
|
|
47
|
-
{ name: 'Burundi', code: 'BI' },
|
|
48
|
-
{ name: 'Cambodia', code: 'KH' },
|
|
49
|
-
{ name: 'Cameroon', code: 'CM' },
|
|
50
|
-
{ name: 'Canada', code: 'CA' },
|
|
51
|
-
{ name: 'Cape Verde', code: 'CV' },
|
|
52
|
-
{ name: 'Cayman Islands', code: 'KY' },
|
|
53
|
-
{ name: 'Central African Republic', code: 'CF' },
|
|
54
|
-
{ name: 'Chad', code: 'TD' },
|
|
55
|
-
{ name: 'Chile', code: 'CL' },
|
|
56
|
-
{ name: 'China', code: 'CN' },
|
|
57
|
-
{ name: 'Christmas Island', code: 'CX' },
|
|
58
|
-
{ name: 'Cocos (Keeling) Islands', code: 'CC' },
|
|
59
|
-
{ name: 'Colombia', code: 'CO' },
|
|
60
|
-
{ name: 'Comoros', code: 'KM' },
|
|
61
|
-
{ name: 'Congo', code: 'CG' },
|
|
62
|
-
{ name: 'Congo, The Democratic Republic of the', code: 'CD' },
|
|
63
|
-
{ name: 'Cook Islands', code: 'CK' },
|
|
64
|
-
{ name: 'Costa Rica', code: 'CR' },
|
|
65
|
-
{ name: "Cote D'Ivoire", code: 'CI' },
|
|
66
|
-
{ name: 'Croatia', code: 'HR' },
|
|
67
|
-
{ name: 'Cuba', code: 'CU' },
|
|
68
|
-
{ name: 'Cyprus', code: 'CY' },
|
|
69
|
-
{ name: 'Czech Republic', code: 'CZ' },
|
|
70
|
-
{ name: 'Denmark', code: 'DK' },
|
|
71
|
-
{ name: 'Djibouti', code: 'DJ' },
|
|
72
|
-
{ name: 'Dominica', code: 'DM' },
|
|
73
|
-
{ name: 'Dominican Republic', code: 'DO' },
|
|
74
|
-
{ name: 'Ecuador', code: 'EC' },
|
|
75
|
-
{ name: 'Egypt', code: 'EG' },
|
|
76
|
-
{ name: 'El Salvador', code: 'SV' },
|
|
77
|
-
{ name: 'Equatorial Guinea', code: 'GQ' },
|
|
78
|
-
{ name: 'Eritrea', code: 'ER' },
|
|
79
|
-
{ name: 'Estonia', code: 'EE' },
|
|
80
|
-
{ name: 'Ethiopia', code: 'ET' },
|
|
81
|
-
{ name: 'Falkland Islands (Malvinas)', code: 'FK' },
|
|
82
|
-
{ name: 'Faroe Islands', code: 'FO' },
|
|
83
|
-
{ name: 'Fiji', code: 'FJ' },
|
|
84
|
-
{ name: 'Finland', code: 'FI' },
|
|
85
|
-
{ name: 'France', code: 'FR' },
|
|
86
|
-
{ name: 'French Guiana', code: 'GF' },
|
|
87
|
-
{ name: 'French Polynesia', code: 'PF' },
|
|
88
|
-
{ name: 'French Southern Territories', code: 'TF' },
|
|
89
|
-
{ name: 'Gabon', code: 'GA' },
|
|
90
|
-
{ name: 'Gambia', code: 'GM' },
|
|
91
|
-
{ name: 'Georgia', code: 'GE' },
|
|
92
|
-
{ name: 'Germany', code: 'DE' },
|
|
93
|
-
{ name: 'Ghana', code: 'GH' },
|
|
94
|
-
{ name: 'Gibraltar', code: 'GI' },
|
|
95
|
-
{ name: 'Greece', code: 'GR' },
|
|
96
|
-
{ name: 'Greenland', code: 'GL' },
|
|
97
|
-
{ name: 'Grenada', code: 'GD' },
|
|
98
|
-
{ name: 'Guadeloupe', code: 'GP' },
|
|
99
|
-
{ name: 'Guam', code: 'GU' },
|
|
100
|
-
{ name: 'Guatemala', code: 'GT' },
|
|
101
|
-
{ name: 'Guernsey', code: 'GG' },
|
|
102
|
-
{ name: 'Guinea', code: 'GN' },
|
|
103
|
-
{ name: 'Guinea-Bissau', code: 'GW' },
|
|
104
|
-
{ name: 'Guyana', code: 'GY' },
|
|
105
|
-
{ name: 'Haiti', code: 'HT' },
|
|
106
|
-
{ name: 'Heard Island and Mcdonald Islands', code: 'HM' },
|
|
107
|
-
{ name: 'Holy See (Vatican City State)', code: 'VA' },
|
|
108
|
-
{ name: 'Honduras', code: 'HN' },
|
|
109
|
-
{ name: 'Hong Kong', code: 'HK' },
|
|
110
|
-
{ name: 'Hungary', code: 'HU' },
|
|
111
|
-
{ name: 'Iceland', code: 'IS' },
|
|
112
|
-
{ name: 'India', code: 'IN' },
|
|
113
|
-
{ name: 'Indonesia', code: 'ID' },
|
|
114
|
-
{ name: 'Iran, Islamic Republic Of', code: 'IR' },
|
|
115
|
-
{ name: 'Iraq', code: 'IQ' },
|
|
116
|
-
{ name: 'Ireland', code: 'IE' },
|
|
117
|
-
{ name: 'Isle of Man', code: 'IM' },
|
|
118
|
-
{ name: 'Israel', code: 'IL' },
|
|
119
|
-
{ name: 'Italy', code: 'IT' },
|
|
120
|
-
{ name: 'Jamaica', code: 'JM' },
|
|
121
|
-
{ name: 'Japan', code: 'JP' },
|
|
122
|
-
{ name: 'Jersey', code: 'JE' },
|
|
123
|
-
{ name: 'Jordan', code: 'JO' },
|
|
124
|
-
{ name: 'Kazakhstan', code: 'KZ' },
|
|
125
|
-
{ name: 'Kenya', code: 'KE' },
|
|
126
|
-
{ name: 'Kiribati', code: 'KI' },
|
|
127
|
-
{ name: "Korea, Democratic People'S Republic of", code: 'KP' },
|
|
128
|
-
{ name: 'Korea, Republic of', code: 'KR' },
|
|
129
|
-
{ name: 'Kuwait', code: 'KW' },
|
|
130
|
-
{ name: 'Kyrgyzstan', code: 'KG' },
|
|
131
|
-
{ name: "Lao People'S Democratic Republic", code: 'LA' },
|
|
132
|
-
{ name: 'Latvia', code: 'LV' },
|
|
133
|
-
{ name: 'Lebanon', code: 'LB' },
|
|
134
|
-
{ name: 'Lesotho', code: 'LS' },
|
|
135
|
-
{ name: 'Liberia', code: 'LR' },
|
|
136
|
-
{ name: 'Libyan Arab Jamahiriya', code: 'LY' },
|
|
137
|
-
{ name: 'Liechtenstein', code: 'LI' },
|
|
138
|
-
{ name: 'Lithuania', code: 'LT' },
|
|
139
|
-
{ name: 'Luxembourg', code: 'LU' },
|
|
140
|
-
{ name: 'Macao', code: 'MO' },
|
|
141
|
-
{ name: 'Macedonia, The Former Yugoslav Republic of', code: 'MK' },
|
|
142
|
-
{ name: 'Madagascar', code: 'MG' },
|
|
143
|
-
{ name: 'Malawi', code: 'MW' },
|
|
144
|
-
{ name: 'Malaysia', code: 'MY' },
|
|
145
|
-
{ name: 'Maldives', code: 'MV' },
|
|
146
|
-
{ name: 'Mali', code: 'ML' },
|
|
147
|
-
{ name: 'Malta', code: 'MT' },
|
|
148
|
-
{ name: 'Marshall Islands', code: 'MH' },
|
|
149
|
-
{ name: 'Martinique', code: 'MQ' },
|
|
150
|
-
{ name: 'Mauritania', code: 'MR' },
|
|
151
|
-
{ name: 'Mauritius', code: 'MU' },
|
|
152
|
-
{ name: 'Mayotte', code: 'YT' },
|
|
153
|
-
{ name: 'Mexico', code: 'MX' },
|
|
154
|
-
{ name: 'Micronesia, Federated States of', code: 'FM' },
|
|
155
|
-
{ name: 'Moldova, Republic of', code: 'MD' },
|
|
156
|
-
{ name: 'Monaco', code: 'MC' },
|
|
157
|
-
{ name: 'Mongolia', code: 'MN' },
|
|
158
|
-
{ name: 'Montserrat', code: 'MS' },
|
|
159
|
-
{ name: 'Morocco', code: 'MA' },
|
|
160
|
-
{ name: 'Mozambique', code: 'MZ' },
|
|
161
|
-
{ name: 'Myanmar', code: 'MM' },
|
|
162
|
-
{ name: 'Namibia', code: 'NA' },
|
|
163
|
-
{ name: 'Nauru', code: 'NR' },
|
|
164
|
-
{ name: 'Nepal', code: 'NP' },
|
|
165
|
-
{ name: 'Netherlands', code: 'NL' },
|
|
166
|
-
{ name: 'Netherlands Antilles', code: 'AN' },
|
|
167
|
-
{ name: 'New Caledonia', code: 'NC' },
|
|
168
|
-
{ name: 'New Zealand', code: 'NZ' },
|
|
169
|
-
{ name: 'Nicaragua', code: 'NI' },
|
|
170
|
-
{ name: 'Niger', code: 'NE' },
|
|
171
|
-
{ name: 'Nigeria', code: 'NG' },
|
|
172
|
-
{ name: 'Niue', code: 'NU' },
|
|
173
|
-
{ name: 'Norfolk Island', code: 'NF' },
|
|
174
|
-
{ name: 'Northern Mariana Islands', code: 'MP' },
|
|
175
|
-
{ name: 'Norway', code: 'NO' },
|
|
176
|
-
{ name: 'Oman', code: 'OM' },
|
|
177
|
-
{ name: 'Pakistan', code: 'PK' },
|
|
178
|
-
{ name: 'Palau', code: 'PW' },
|
|
179
|
-
{ name: 'Palestinian Territory, Occupied', code: 'PS' },
|
|
180
|
-
{ name: 'Panama', code: 'PA' },
|
|
181
|
-
{ name: 'Papua New Guinea', code: 'PG' },
|
|
182
|
-
{ name: 'Paraguay', code: 'PY' },
|
|
183
|
-
{ name: 'Peru', code: 'PE' },
|
|
184
|
-
{ name: 'Philippines', code: 'PH' },
|
|
185
|
-
{ name: 'Pitcairn', code: 'PN' },
|
|
186
|
-
{ name: 'Poland', code: 'PL' },
|
|
187
|
-
{ name: 'Portugal', code: 'PT' },
|
|
188
|
-
{ name: 'Puerto Rico', code: 'PR' },
|
|
189
|
-
{ name: 'Qatar', code: 'QA' },
|
|
190
|
-
{ name: 'Reunion', code: 'RE' },
|
|
191
|
-
{ name: 'Romania', code: 'RO' },
|
|
192
|
-
{ name: 'Russian Federation', code: 'RU' },
|
|
193
|
-
{ name: 'RWANDA', code: 'RW' },
|
|
194
|
-
{ name: 'Saint Helena', code: 'SH' },
|
|
195
|
-
{ name: 'Saint Kitts and Nevis', code: 'KN' },
|
|
196
|
-
{ name: 'Saint Lucia', code: 'LC' },
|
|
197
|
-
{ name: 'Saint Pierre and Miquelon', code: 'PM' },
|
|
198
|
-
{ name: 'Saint Vincent and the Grenadines', code: 'VC' },
|
|
199
|
-
{ name: 'Samoa', code: 'WS' },
|
|
200
|
-
{ name: 'San Marino', code: 'SM' },
|
|
201
|
-
{ name: 'Sao Tome and Principe', code: 'ST' },
|
|
202
|
-
{ name: 'Saudi Arabia', code: 'SA' },
|
|
203
|
-
{ name: 'Senegal', code: 'SN' },
|
|
204
|
-
{ name: 'Serbia and Montenegro', code: 'CS' },
|
|
205
|
-
{ name: 'Seychelles', code: 'SC' },
|
|
206
|
-
{ name: 'Sierra Leone', code: 'SL' },
|
|
207
|
-
{ name: 'Singapore', code: 'SG' },
|
|
208
|
-
{ name: 'Slovakia', code: 'SK' },
|
|
209
|
-
{ name: 'Slovenia', code: 'SI' },
|
|
210
|
-
{ name: 'Solomon Islands', code: 'SB' },
|
|
211
|
-
{ name: 'Somalia', code: 'SO' },
|
|
212
|
-
{ name: 'South Africa', code: 'ZA' },
|
|
213
|
-
{ name: 'South Georgia and the South Sandwich Islands', code: 'GS' },
|
|
214
|
-
{ name: 'Spain', code: 'ES' },
|
|
215
|
-
{ name: 'Sri Lanka', code: 'LK' },
|
|
216
|
-
{ name: 'Sudan', code: 'SD' },
|
|
217
|
-
{ name: 'Suriname', code: 'SR' },
|
|
218
|
-
{ name: 'Svalbard and Jan Mayen', code: 'SJ' },
|
|
219
|
-
{ name: 'Swaziland', code: 'SZ' },
|
|
220
|
-
{ name: 'Sweden', code: 'SE' },
|
|
221
|
-
{ name: 'Switzerland', code: 'CH' },
|
|
222
|
-
{ name: 'Syrian Arab Republic', code: 'SY' },
|
|
223
|
-
{ name: 'Taiwan, Province of China', code: 'TW' },
|
|
224
|
-
{ name: 'Tajikistan', code: 'TJ' },
|
|
225
|
-
{ name: 'Tanzania, United Republic of', code: 'TZ' },
|
|
226
|
-
{ name: 'Thailand', code: 'TH' },
|
|
227
|
-
{ name: 'Timor-Leste', code: 'TL' },
|
|
228
|
-
{ name: 'Togo', code: 'TG' },
|
|
229
|
-
{ name: 'Tokelau', code: 'TK' },
|
|
230
|
-
{ name: 'Tonga', code: 'TO' },
|
|
231
|
-
{ name: 'Trinidad and Tobago', code: 'TT' },
|
|
232
|
-
{ name: 'Tunisia', code: 'TN' },
|
|
233
|
-
{ name: 'Turkey', code: 'TR' },
|
|
234
|
-
{ name: 'Turkmenistan', code: 'TM' },
|
|
235
|
-
{ name: 'Turks and Caicos Islands', code: 'TC' },
|
|
236
|
-
{ name: 'Tuvalu', code: 'TV' },
|
|
237
|
-
{ name: 'Uganda', code: 'UG' },
|
|
238
|
-
{ name: 'Ukraine', code: 'UA' },
|
|
239
|
-
{ name: 'United Arab Emirates', code: 'AE' },
|
|
240
|
-
{ name: 'United Kingdom', code: 'GB' },
|
|
241
|
-
{ name: 'United States', code: 'US' },
|
|
242
|
-
{ name: 'United States Minor Outlying Islands', code: 'UM' },
|
|
243
|
-
{ name: 'Uruguay', code: 'UY' },
|
|
244
|
-
{ name: 'Uzbekistan', code: 'UZ' },
|
|
245
|
-
{ name: 'Vanuatu', code: 'VU' },
|
|
246
|
-
{ name: 'Venezuela', code: 'VE' },
|
|
247
|
-
{ name: 'Viet Nam', code: 'VN' },
|
|
248
|
-
{ name: 'Virgin Islands, British', code: 'VG' },
|
|
249
|
-
{ name: 'Virgin Islands, U.S.', code: 'VI' },
|
|
250
|
-
{ name: 'Wallis and Futuna', code: 'WF' },
|
|
251
|
-
{ name: 'Western Sahara', code: 'EH' },
|
|
252
|
-
{ name: 'Yemen', code: 'YE' },
|
|
253
|
-
{ name: 'Zambia', code: 'ZM' },
|
|
254
|
-
{ name: 'Zimbabwe', code: 'ZW' },
|
|
255
|
-
];
|
|
256
|
-
|
|
257
|
-
export default {
|
|
258
|
-
title: 'Components/ComboboxControl',
|
|
259
|
-
component: ComboboxControl,
|
|
260
|
-
argTypes: {
|
|
261
|
-
__nextHasNoMarginBottom: { control: { type: 'boolean' } },
|
|
262
|
-
onChange: { action: 'onChange' },
|
|
263
|
-
},
|
|
264
|
-
};
|
|
265
|
-
|
|
266
|
-
const mapCountryOption = ( country ) => ( {
|
|
267
|
-
value: country.code,
|
|
268
|
-
label: country.name,
|
|
269
|
-
} );
|
|
270
|
-
|
|
271
|
-
const countryOptions = countries.map( mapCountryOption );
|
|
272
|
-
|
|
273
|
-
function Template( { onChange, ...args } ) {
|
|
274
|
-
const [ value, setValue ] = useState( null );
|
|
275
|
-
|
|
276
|
-
return (
|
|
277
|
-
<>
|
|
278
|
-
<ComboboxControl
|
|
279
|
-
{ ...args }
|
|
280
|
-
value={ value }
|
|
281
|
-
onChange={ ( ...changeArgs ) => {
|
|
282
|
-
setValue( ...changeArgs );
|
|
283
|
-
onChange?.( ...changeArgs );
|
|
284
|
-
} }
|
|
285
|
-
/>
|
|
286
|
-
</>
|
|
287
|
-
);
|
|
288
|
-
}
|
|
289
|
-
export const Default = Template.bind( {} );
|
|
290
|
-
Default.args = {
|
|
291
|
-
__next36pxDefaultSize: false,
|
|
292
|
-
allowReset: false,
|
|
293
|
-
label: 'Select a country',
|
|
294
|
-
options: countryOptions,
|
|
295
|
-
};
|
|
296
|
-
|
|
297
|
-
const authorOptions = [
|
|
298
|
-
{
|
|
299
|
-
value: 'parsley',
|
|
300
|
-
label: 'Parsley Montana',
|
|
301
|
-
age: 48,
|
|
302
|
-
country: 'Germany',
|
|
303
|
-
},
|
|
304
|
-
{
|
|
305
|
-
value: 'cabbage',
|
|
306
|
-
label: 'Cabbage New York',
|
|
307
|
-
age: 44,
|
|
308
|
-
country: 'France',
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
value: 'jake',
|
|
312
|
-
label: 'Jake Weary',
|
|
313
|
-
age: 41,
|
|
314
|
-
country: 'United Kingdom',
|
|
315
|
-
},
|
|
316
|
-
];
|
|
317
|
-
|
|
318
|
-
/**
|
|
319
|
-
* The rendered output of each suggestion can be customized by passing a
|
|
320
|
-
* render function to the `__experimentalRenderItem` prop. (This is still an experimental feature
|
|
321
|
-
* and is subject to change.)
|
|
322
|
-
*/
|
|
323
|
-
export const WithCustomRenderItem = Template.bind( {} );
|
|
324
|
-
WithCustomRenderItem.args = {
|
|
325
|
-
...Default.args,
|
|
326
|
-
label: 'Select an author',
|
|
327
|
-
options: authorOptions,
|
|
328
|
-
__experimentalRenderItem: ( { item } ) => {
|
|
329
|
-
const { label, age, country } = item;
|
|
330
|
-
return (
|
|
331
|
-
<div>
|
|
332
|
-
<div style={ { marginBottom: '0.2rem' } }>{ label }</div>
|
|
333
|
-
<small>
|
|
334
|
-
Age: { age }, Country: { country }
|
|
335
|
-
</small>
|
|
336
|
-
</div>
|
|
337
|
-
);
|
|
338
|
-
},
|
|
339
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { check } from '@wordpress/icons';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
|
-
import MenuItem from '../menu-item';
|
|
10
|
-
|
|
11
|
-
const noop = () => {};
|
|
12
|
-
|
|
13
|
-
export default function MenuItemsChoice( {
|
|
14
|
-
choices = [],
|
|
15
|
-
onHover = noop,
|
|
16
|
-
onSelect,
|
|
17
|
-
value,
|
|
18
|
-
} ) {
|
|
19
|
-
return choices.map( ( item ) => {
|
|
20
|
-
const isSelected = value === item.value;
|
|
21
|
-
return (
|
|
22
|
-
<MenuItem
|
|
23
|
-
key={ item.value }
|
|
24
|
-
role="menuitemradio"
|
|
25
|
-
icon={ isSelected && check }
|
|
26
|
-
info={ item.info }
|
|
27
|
-
isSelected={ isSelected }
|
|
28
|
-
shortcut={ item.shortcut }
|
|
29
|
-
className="components-menu-items-choice"
|
|
30
|
-
onClick={ () => {
|
|
31
|
-
if ( ! isSelected ) {
|
|
32
|
-
onSelect( item.value );
|
|
33
|
-
}
|
|
34
|
-
} }
|
|
35
|
-
onMouseEnter={ () => onHover( item.value ) }
|
|
36
|
-
onMouseLeave={ () => onHover( null ) }
|
|
37
|
-
aria-label={ item[ 'aria-label' ] }
|
|
38
|
-
>
|
|
39
|
-
{ item.label }
|
|
40
|
-
</MenuItem>
|
|
41
|
-
);
|
|
42
|
-
} );
|
|
43
|
-
}
|
package/src/panel/header.js
DELETED
package/src/panel/index.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import classnames from 'classnames';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { forwardRef } from '@wordpress/element';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Internal dependencies
|
|
13
|
-
*/
|
|
14
|
-
import PanelHeader from './header';
|
|
15
|
-
|
|
16
|
-
function Panel( { header, className, children }, ref ) {
|
|
17
|
-
const classNames = classnames( className, 'components-panel' );
|
|
18
|
-
return (
|
|
19
|
-
<div className={ classNames } ref={ ref }>
|
|
20
|
-
{ header && <PanelHeader label={ header } /> }
|
|
21
|
-
{ children }
|
|
22
|
-
</div>
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export default forwardRef( Panel );
|
package/src/panel/row.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import classnames from 'classnames';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { forwardRef } from '@wordpress/element';
|
|
10
|
-
|
|
11
|
-
const PanelRow = ( { className, children }, ref ) => (
|
|
12
|
-
<div
|
|
13
|
-
className={ classnames( 'components-panel__row', className ) }
|
|
14
|
-
ref={ ref }
|
|
15
|
-
>
|
|
16
|
-
{ children }
|
|
17
|
-
</div>
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
export default forwardRef( PanelRow );
|
|
File without changes
|
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import styled from '@emotion/styled';
|
|
5
|
-
import { css } from '@emotion/react';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* WordPress dependencies
|
|
9
|
-
*/
|
|
10
|
-
import { useContext, useState } from '@wordpress/element';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Internal dependencies
|
|
14
|
-
*/
|
|
15
|
-
import Button from '../../../button';
|
|
16
|
-
import ColorIndicator from '../../../color-indicator';
|
|
17
|
-
import ColorPalette from '../../../color-palette';
|
|
18
|
-
import Dropdown from '../../../dropdown';
|
|
19
|
-
import Panel from '../../../panel';
|
|
20
|
-
import { FlexItem } from '../../../flex';
|
|
21
|
-
import { HStack } from '../../../h-stack';
|
|
22
|
-
import { Item, ItemGroup } from '../../../item-group';
|
|
23
|
-
import { ToolsPanel, ToolsPanelItem, ToolsPanelContext } from '../..';
|
|
24
|
-
import {
|
|
25
|
-
createSlotFill,
|
|
26
|
-
Provider as SlotFillProvider,
|
|
27
|
-
} from '../../../slot-fill';
|
|
28
|
-
import { useCx } from '../../../utils';
|
|
29
|
-
|
|
30
|
-
// Available border colors.
|
|
31
|
-
const colors = [
|
|
32
|
-
{ name: 'Gray 0', color: '#f6f7f7' },
|
|
33
|
-
{ name: 'Gray 5', color: '#dcdcde' },
|
|
34
|
-
{ name: 'Gray 20', color: '#a7aaad' },
|
|
35
|
-
{ name: 'Gray 70', color: '#3c434a' },
|
|
36
|
-
{ name: 'Gray 100', color: '#101517' },
|
|
37
|
-
{ name: 'Blue 20', color: '#72aee6' },
|
|
38
|
-
{ name: 'Blue 40', color: '#3582c4' },
|
|
39
|
-
{ name: 'Blue 70', color: '#0a4b78' },
|
|
40
|
-
{ name: 'Red 40', color: '#e65054' },
|
|
41
|
-
{ name: 'Red 70', color: '#8a2424' },
|
|
42
|
-
{ name: 'Green 10', color: '#68de7c' },
|
|
43
|
-
{ name: 'Green 40', color: '#00a32a' },
|
|
44
|
-
{ name: 'Green 60', color: '#007017' },
|
|
45
|
-
{ name: 'Yellow 10', color: '#f2d675' },
|
|
46
|
-
{ name: 'Yellow 40', color: '#bd8600' },
|
|
47
|
-
];
|
|
48
|
-
const panelId = 'unique-tools-panel-id';
|
|
49
|
-
|
|
50
|
-
const { Fill, Slot } = createSlotFill( 'ToolsPanelSlot' );
|
|
51
|
-
|
|
52
|
-
// This storybook example aims to replicate a virtual bubbling SlotFill use case
|
|
53
|
-
// for the `ToolsPanel` when the Slot itself is an `ItemGroup`.
|
|
54
|
-
|
|
55
|
-
// In this scenario the `ToolsPanel` has to render item placeholders so fills
|
|
56
|
-
// maintain their order in the DOM. These placeholders in the DOM prevent the
|
|
57
|
-
// normal styling of the `ItemGroup` in particular the border radii on the first
|
|
58
|
-
// and last items. In case consumers of the ItemGroup and ToolsPanel are
|
|
59
|
-
// applying their own styles to these components, the ToolsPanel needs to assist
|
|
60
|
-
// consumers in identifying which of its visible items are first and last.
|
|
61
|
-
|
|
62
|
-
// This custom fill is required to re-establish the ToolsPanelContext for
|
|
63
|
-
// injected ToolsPanelItem components as they will not have access to the React
|
|
64
|
-
// Context as the Provider is part of the ToolsPanelItems.Slot tree.
|
|
65
|
-
const ToolsPanelItems = ( { children } ) => {
|
|
66
|
-
return (
|
|
67
|
-
<Fill>
|
|
68
|
-
{ ( fillProps ) => (
|
|
69
|
-
<ToolsPanelContext.Provider value={ fillProps }>
|
|
70
|
-
{ children }
|
|
71
|
-
</ToolsPanelContext.Provider>
|
|
72
|
-
) }
|
|
73
|
-
</Fill>
|
|
74
|
-
);
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
// This fetches the ToolsPanelContext and passes it through `fillProps` so that
|
|
78
|
-
// rendered fills can re-establish the `ToolsPanelContext.Provider`.
|
|
79
|
-
const SlotContainer = ( { Slot: ToolsPanelSlot, ...props } ) => {
|
|
80
|
-
const toolsPanelContext = useContext( ToolsPanelContext );
|
|
81
|
-
|
|
82
|
-
return (
|
|
83
|
-
<ToolsPanelSlot
|
|
84
|
-
{ ...props }
|
|
85
|
-
fillProps={ toolsPanelContext }
|
|
86
|
-
bubblesVirtually
|
|
87
|
-
/>
|
|
88
|
-
);
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
// This wraps the slot with a `ToolsPanel` mimicking a real-world use case from
|
|
92
|
-
// the block editor.
|
|
93
|
-
ToolsPanelItems.Slot = ( { resetAll, ...props } ) => (
|
|
94
|
-
<ToolsPanel
|
|
95
|
-
label="Tools Panel with Item Group"
|
|
96
|
-
resetAll={ resetAll }
|
|
97
|
-
panelId={ panelId }
|
|
98
|
-
hasInnerWrapper={ true }
|
|
99
|
-
shouldRenderPlaceholderItems={ true }
|
|
100
|
-
__experimentalFirstVisibleItemClass="first"
|
|
101
|
-
__experimentalLastVisibleItemClass="last"
|
|
102
|
-
>
|
|
103
|
-
<SlotContainer { ...props } Slot={ Slot } />
|
|
104
|
-
</ToolsPanel>
|
|
105
|
-
);
|
|
106
|
-
|
|
107
|
-
export const ToolsPanelWithItemGroupSlot = () => {
|
|
108
|
-
const [ attributes, setAttributes ] = useState( {} );
|
|
109
|
-
const { text, background, link } = attributes;
|
|
110
|
-
|
|
111
|
-
const cx = useCx();
|
|
112
|
-
const slotWrapperClassName = cx( SlotWrapper );
|
|
113
|
-
const itemClassName = cx( ToolsPanelItemClass );
|
|
114
|
-
|
|
115
|
-
const resetAll = ( resetFilters = [] ) => {
|
|
116
|
-
let newAttributes = {};
|
|
117
|
-
|
|
118
|
-
resetFilters.forEach( ( resetFilter ) => {
|
|
119
|
-
newAttributes = {
|
|
120
|
-
...newAttributes,
|
|
121
|
-
...resetFilter( newAttributes ),
|
|
122
|
-
};
|
|
123
|
-
} );
|
|
124
|
-
|
|
125
|
-
setAttributes( newAttributes );
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
const updateAttribute = ( name, value ) => {
|
|
129
|
-
setAttributes( {
|
|
130
|
-
...attributes,
|
|
131
|
-
[ name ]: value,
|
|
132
|
-
} );
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
const ToolsPanelColorDropdown = ( { attribute, label, value } ) => {
|
|
136
|
-
return (
|
|
137
|
-
<ToolsPanelItem
|
|
138
|
-
className={ itemClassName }
|
|
139
|
-
hasValue={ () => !! value }
|
|
140
|
-
label={ label }
|
|
141
|
-
onDeselect={ () => updateAttribute( attribute, undefined ) }
|
|
142
|
-
resetAllFilter={ () => ( { [ attribute ]: undefined } ) }
|
|
143
|
-
panelId={ panelId }
|
|
144
|
-
as={ Item }
|
|
145
|
-
>
|
|
146
|
-
<Dropdown
|
|
147
|
-
renderToggle={ ( { onToggle } ) => (
|
|
148
|
-
<Button onClick={ onToggle }>
|
|
149
|
-
<HStack justify="flex-start">
|
|
150
|
-
<ColorIndicator colorValue={ value } />
|
|
151
|
-
<FlexItem>{ label }</FlexItem>
|
|
152
|
-
</HStack>
|
|
153
|
-
</Button>
|
|
154
|
-
) }
|
|
155
|
-
renderContent={ () => (
|
|
156
|
-
<ColorPalette
|
|
157
|
-
value={ value }
|
|
158
|
-
colors={ colors }
|
|
159
|
-
onChange={ ( newColor ) =>
|
|
160
|
-
updateAttribute( attribute, newColor )
|
|
161
|
-
}
|
|
162
|
-
/>
|
|
163
|
-
) }
|
|
164
|
-
/>
|
|
165
|
-
</ToolsPanelItem>
|
|
166
|
-
);
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
// ToolsPanelItems are rendered via two different fills to simulate
|
|
170
|
-
// injection from multiple locations.
|
|
171
|
-
return (
|
|
172
|
-
<SlotFillProvider>
|
|
173
|
-
<PanelWrapperView>
|
|
174
|
-
<Panel>
|
|
175
|
-
<ToolsPanelItems.Slot
|
|
176
|
-
as={ ItemGroup }
|
|
177
|
-
isBordered
|
|
178
|
-
isSeparated
|
|
179
|
-
isRounded={ false }
|
|
180
|
-
className={ slotWrapperClassName }
|
|
181
|
-
resetAll={ resetAll }
|
|
182
|
-
/>
|
|
183
|
-
</Panel>
|
|
184
|
-
</PanelWrapperView>
|
|
185
|
-
<ToolsPanelItems>
|
|
186
|
-
<ToolsPanelColorDropdown
|
|
187
|
-
attribute="text"
|
|
188
|
-
label="Text"
|
|
189
|
-
value={ text }
|
|
190
|
-
/>
|
|
191
|
-
<ToolsPanelColorDropdown
|
|
192
|
-
attribute="background"
|
|
193
|
-
label="Background"
|
|
194
|
-
value={ background }
|
|
195
|
-
/>
|
|
196
|
-
</ToolsPanelItems>
|
|
197
|
-
<ToolsPanelItems>
|
|
198
|
-
<ToolsPanelColorDropdown
|
|
199
|
-
attribute="link"
|
|
200
|
-
label="Link"
|
|
201
|
-
value={ link }
|
|
202
|
-
/>
|
|
203
|
-
</ToolsPanelItems>
|
|
204
|
-
</SlotFillProvider>
|
|
205
|
-
);
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
const PanelWrapperView = styled.div`
|
|
209
|
-
font-size: 13px;
|
|
210
|
-
|
|
211
|
-
.components-dropdown-menu__menu {
|
|
212
|
-
max-width: 220px;
|
|
213
|
-
}
|
|
214
|
-
`;
|
|
215
|
-
|
|
216
|
-
const SlotWrapper = css`
|
|
217
|
-
&&& {
|
|
218
|
-
row-gap: 0;
|
|
219
|
-
border-radius: 20px;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
> div {
|
|
223
|
-
grid-column: span 2;
|
|
224
|
-
border-radius: inherit;
|
|
225
|
-
}
|
|
226
|
-
`;
|
|
227
|
-
|
|
228
|
-
const ToolsPanelItemClass = css`
|
|
229
|
-
padding: 0;
|
|
230
|
-
|
|
231
|
-
&&.first {
|
|
232
|
-
border-top-left-radius: inherit;
|
|
233
|
-
border-top-right-radius: inherit;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
&.last {
|
|
237
|
-
border-bottom-left-radius: inherit;
|
|
238
|
-
border-bottom-right-radius: inherit;
|
|
239
|
-
border-bottom-color: transparent;
|
|
240
|
-
}
|
|
241
|
-
&& > div,
|
|
242
|
-
&& > div > button {
|
|
243
|
-
width: 100%;
|
|
244
|
-
border-radius: inherit;
|
|
245
|
-
}
|
|
246
|
-
`;
|