@wordpress/components 19.1.2 → 19.2.1-next.33ec3857e2.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 -4
- package/README.md +0 -1
- package/build/angle-picker-control/index.js +2 -0
- package/build/angle-picker-control/index.js.map +1 -1
- package/build/button/index.native.js +13 -3
- package/build/button/index.native.js.map +1 -1
- package/build/checkbox-control/index.js +1 -1
- package/build/checkbox-control/index.js.map +1 -1
- package/build/clipboard-button/index.js +1 -2
- package/build/clipboard-button/index.js.map +1 -1
- package/build/color-palette/index.js +36 -9
- package/build/color-palette/index.js.map +1 -1
- package/build/color-picker/color-display.js +4 -2
- package/build/color-picker/color-display.js.map +1 -1
- package/build/color-picker/hex-input.js +3 -1
- package/build/color-picker/hex-input.js.map +1 -1
- package/build/color-picker/input-with-slider.js +3 -1
- package/build/color-picker/input-with-slider.js.map +1 -1
- package/build/confirm-dialog/component.js +103 -0
- package/build/confirm-dialog/component.js.map +1 -0
- package/build/confirm-dialog/index.js +16 -0
- package/build/confirm-dialog/index.js.map +1 -0
- package/build/confirm-dialog/types.js +6 -0
- package/build/confirm-dialog/types.js.map +1 -0
- package/build/custom-gradient-bar/constants.js +1 -6
- package/build/custom-gradient-bar/constants.js.map +1 -1
- package/build/custom-gradient-bar/control-points.js +52 -21
- package/build/custom-gradient-bar/control-points.js.map +1 -1
- package/build/custom-gradient-bar/index.js +5 -1
- package/build/custom-gradient-bar/index.js.map +1 -1
- package/build/custom-gradient-picker/index.js +4 -1
- package/build/custom-gradient-picker/index.js.map +1 -1
- package/build/date-time/date.js +63 -86
- package/build/date-time/date.js.map +1 -1
- package/build/date-time/utils.js +32 -0
- package/build/date-time/utils.js.map +1 -0
- package/build/divider/component.js +8 -7
- package/build/divider/component.js.map +1 -1
- package/build/divider/styles.js +38 -13
- package/build/divider/styles.js.map +1 -1
- package/build/drop-zone/index.js +14 -6
- package/build/drop-zone/index.js.map +1 -1
- package/build/drop-zone/provider.js +1 -0
- package/build/drop-zone/provider.js.map +1 -1
- package/build/flyout/styles.js +2 -2
- package/build/flyout/styles.js.map +1 -1
- package/build/focusable-iframe/index.js +1 -0
- package/build/focusable-iframe/index.js.map +1 -1
- package/build/font-size-picker/index.js +10 -9
- package/build/font-size-picker/index.js.map +1 -1
- package/build/font-size-picker/utils.js +28 -17
- package/build/font-size-picker/utils.js.map +1 -1
- package/build/gradient-picker/index.js +3 -1
- package/build/gradient-picker/index.js.map +1 -1
- package/build/higher-order/with-focus-outside/index.js +2 -0
- package/build/higher-order/with-focus-outside/index.js.map +1 -1
- package/build/index.js +8 -0
- package/build/index.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +44 -32
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js +10 -3
- package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
- package/build/mobile/color-settings/index.native.js +4 -2
- package/build/mobile/color-settings/index.native.js.map +1 -1
- package/build/mobile/color-settings/palette.screen.native.js +7 -6
- package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build/mobile/global-styles-context/utils.native.js +1 -1
- package/build/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build/mobile/gridicons/index.native.js +3 -1
- package/build/mobile/gridicons/index.native.js.map +1 -1
- package/build/mobile/link-picker/index.native.js +45 -4
- package/build/mobile/link-picker/index.native.js.map +1 -1
- package/build/mobile/link-settings/index.native.js +10 -0
- package/build/mobile/link-settings/index.native.js.map +1 -1
- package/build/modal/aria-helper.js +2 -0
- package/build/modal/aria-helper.js.map +1 -1
- package/build/modal/index.js +17 -8
- package/build/modal/index.js.map +1 -1
- package/build/palette-edit/index.js +13 -11
- package/build/palette-edit/index.js.map +1 -1
- package/build/select-control/styles/select-control-styles.js +33 -9
- package/build/select-control/styles/select-control-styles.js.map +1 -1
- package/build/style-provider/index.js +2 -0
- package/build/style-provider/index.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js +7 -2
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +25 -14
- package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option/styles.js +8 -8
- package/build/toggle-group-control/toggle-group-control-option/styles.js.map +1 -1
- package/build/tools-panel/styles.js +12 -10
- package/build/tools-panel/styles.js.map +1 -1
- package/build/tools-panel/tools-panel/component.js +6 -8
- package/build/tools-panel/tools-panel/component.js.map +1 -1
- package/build/tools-panel/tools-panel/hook.js +48 -17
- package/build/tools-panel/tools-panel/hook.js.map +1 -1
- package/build/tools-panel/tools-panel-item/hook.js +5 -1
- package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build/unit-control/styles/unit-control-styles.js +23 -41
- package/build/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build/z-stack/component.js.map +1 -1
- package/build/z-stack/styles.js +10 -8
- package/build/z-stack/styles.js.map +1 -1
- package/build-module/angle-picker-control/index.js +2 -0
- package/build-module/angle-picker-control/index.js.map +1 -1
- package/build-module/button/index.native.js +13 -3
- package/build-module/button/index.native.js.map +1 -1
- package/build-module/checkbox-control/index.js +1 -1
- package/build-module/checkbox-control/index.js.map +1 -1
- package/build-module/clipboard-button/index.js +1 -2
- package/build-module/clipboard-button/index.js.map +1 -1
- package/build-module/color-palette/index.js +34 -10
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-picker/color-display.js +3 -2
- package/build-module/color-picker/color-display.js.map +1 -1
- package/build-module/color-picker/hex-input.js +2 -1
- package/build-module/color-picker/hex-input.js.map +1 -1
- package/build-module/color-picker/input-with-slider.js +2 -1
- package/build-module/color-picker/input-with-slider.js.map +1 -1
- package/build-module/confirm-dialog/component.js +84 -0
- package/build-module/confirm-dialog/component.js.map +1 -0
- package/build-module/confirm-dialog/index.js +6 -0
- package/build-module/confirm-dialog/index.js.map +1 -0
- package/build-module/confirm-dialog/types.js +2 -0
- package/build-module/confirm-dialog/types.js.map +1 -0
- package/build-module/custom-gradient-bar/constants.js +0 -4
- package/build-module/custom-gradient-bar/constants.js.map +1 -1
- package/build-module/custom-gradient-bar/control-points.js +54 -23
- package/build-module/custom-gradient-bar/control-points.js.map +1 -1
- package/build-module/custom-gradient-bar/index.js +5 -1
- package/build-module/custom-gradient-bar/index.js.map +1 -1
- package/build-module/custom-gradient-picker/index.js +4 -1
- package/build-module/custom-gradient-picker/index.js.map +1 -1
- package/build-module/date-time/date.js +63 -87
- package/build-module/date-time/date.js.map +1 -1
- package/build-module/date-time/utils.js +20 -0
- package/build-module/date-time/utils.js.map +1 -0
- package/build-module/divider/component.js +8 -7
- package/build-module/divider/component.js.map +1 -1
- package/build-module/divider/styles.js +37 -13
- package/build-module/divider/styles.js.map +1 -1
- package/build-module/drop-zone/index.js +14 -6
- package/build-module/drop-zone/index.js.map +1 -1
- package/build-module/drop-zone/provider.js +1 -0
- package/build-module/drop-zone/provider.js.map +1 -1
- package/build-module/flyout/styles.js +2 -2
- package/build-module/flyout/styles.js.map +1 -1
- package/build-module/focusable-iframe/index.js +1 -0
- package/build-module/focusable-iframe/index.js.map +1 -1
- package/build-module/font-size-picker/index.js +10 -9
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/font-size-picker/utils.js +28 -17
- package/build-module/font-size-picker/utils.js.map +1 -1
- package/build-module/gradient-picker/index.js +3 -1
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/higher-order/with-focus-outside/index.js +1 -0
- package/build-module/higher-order/with-focus-outside/index.js.map +1 -1
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +44 -32
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js +10 -4
- package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
- package/build-module/mobile/color-settings/index.native.js +4 -2
- package/build-module/mobile/color-settings/index.native.js.map +1 -1
- package/build-module/mobile/color-settings/palette.screen.native.js +7 -6
- package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build-module/mobile/global-styles-context/utils.native.js +1 -1
- package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build-module/mobile/gridicons/index.native.js +1 -0
- package/build-module/mobile/gridicons/index.native.js.map +1 -1
- package/build-module/mobile/link-picker/index.native.js +50 -8
- package/build-module/mobile/link-picker/index.native.js.map +1 -1
- package/build-module/mobile/link-settings/index.native.js +10 -0
- package/build-module/mobile/link-settings/index.native.js.map +1 -1
- package/build-module/modal/aria-helper.js +2 -0
- package/build-module/modal/aria-helper.js.map +1 -1
- package/build-module/modal/index.js +15 -8
- package/build-module/modal/index.js.map +1 -1
- package/build-module/palette-edit/index.js +13 -11
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/select-control/styles/select-control-styles.js +33 -9
- package/build-module/select-control/styles/select-control-styles.js.map +1 -1
- package/build-module/style-provider/index.js +1 -0
- package/build-module/style-provider/index.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js +8 -3
- package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +25 -14
- package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option/styles.js +8 -8
- package/build-module/toggle-group-control/toggle-group-control-option/styles.js.map +1 -1
- package/build-module/tools-panel/styles.js +12 -11
- package/build-module/tools-panel/styles.js.map +1 -1
- package/build-module/tools-panel/tools-panel/component.js +5 -8
- package/build-module/tools-panel/tools-panel/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel/hook.js +48 -17
- package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/hook.js +5 -1
- package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build-module/unit-control/styles/unit-control-styles.js +23 -41
- package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build-module/z-stack/component.js.map +1 -1
- package/build-module/z-stack/styles.js +13 -8
- package/build-module/z-stack/styles.js.map +1 -1
- package/build-style/style-rtl.css +34 -12
- package/build-style/style.css +34 -12
- package/build-types/base-field/hook.d.ts +16 -16
- package/build-types/card/card/hook.d.ts +16 -16
- package/build-types/card/card-body/hook.d.ts +16 -16
- package/build-types/card/card-divider/hook.d.ts +18 -18
- package/build-types/card/card-footer/hook.d.ts +17 -17
- package/build-types/card/card-header/hook.d.ts +16 -16
- package/build-types/card/card-media/hook.d.ts +16 -16
- package/build-types/divider/component.d.ts +8 -7
- package/build-types/divider/component.d.ts.map +1 -1
- package/build-types/divider/styles.d.ts +2 -2
- package/build-types/divider/styles.d.ts.map +1 -1
- package/build-types/divider/types.d.ts +5 -5
- package/build-types/divider/types.d.ts.map +1 -1
- package/build-types/elevation/hook.d.ts +15 -15
- package/build-types/flex/flex/hook.d.ts +16 -16
- package/build-types/flex/flex-block/hook.d.ts +16 -16
- package/build-types/flex/flex-item/hook.d.ts +16 -16
- package/build-types/flyout/flyout/hook.d.ts +17 -17
- package/build-types/flyout/styles.d.ts +7 -9
- package/build-types/flyout/styles.d.ts.map +1 -1
- package/build-types/grid/hook.d.ts +16 -16
- package/build-types/h-stack/hook.d.ts +16 -16
- package/build-types/heading/hook.d.ts +16 -16
- package/build-types/input-control/index.d.ts +1 -1
- package/build-types/input-control/index.d.ts.map +1 -1
- package/build-types/input-control/input-field.d.ts +1 -1
- package/build-types/input-control/input-field.d.ts.map +1 -1
- package/build-types/input-control/styles/input-control-styles.d.ts +1 -2
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/input-control/types.d.ts +2 -1
- package/build-types/input-control/types.d.ts.map +1 -1
- package/build-types/item-group/item/hook.d.ts +16 -16
- package/build-types/item-group/item-group/hook.d.ts +16 -16
- package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
- package/build-types/scrollable/hook.d.ts +16 -16
- package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
- package/build-types/select-control/types.d.ts +1 -1
- package/build-types/select-control/types.d.ts.map +1 -1
- package/build-types/spacer/hook.d.ts +16 -16
- package/build-types/surface/hook.d.ts +16 -16
- package/build-types/text/hook.d.ts +16 -16
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option/styles.d.ts.map +1 -1
- package/build-types/tools-panel/styles.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +16 -16
- package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/hook.d.ts +16 -16
- package/build-types/tools-panel/tools-panel-item/hook.d.ts +16 -16
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/tools-panel/types.d.ts +2 -1
- package/build-types/tools-panel/types.d.ts.map +1 -1
- package/build-types/truncate/hook.d.ts +16 -16
- package/build-types/ui/control-group/hook.d.ts +18 -18
- package/build-types/ui/control-label/hook.d.ts +16 -16
- package/build-types/ui/form-group/form-group.d.ts +4 -4
- package/build-types/ui/form-group/use-form-group.d.ts +55 -55
- package/build-types/unit-control/index.d.ts +1 -1
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -0
- package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
- package/build-types/unit-control/types.d.ts +2 -2
- package/build-types/unit-control/types.d.ts.map +1 -1
- package/build-types/v-stack/hook.d.ts +16 -16
- package/build-types/z-stack/component.d.ts +1 -1
- package/build-types/z-stack/styles.d.ts.map +1 -1
- package/package.json +21 -23
- package/src/alignment-matrix-control/stories/index.js +1 -1
- package/src/angle-picker-control/index.js +2 -0
- package/src/base-control/stories/index.js +1 -1
- package/src/button/index.native.js +15 -1
- package/src/button/stories/index.js +1 -1
- package/src/button/style.scss +14 -0
- package/src/card/card/README.md +3 -3
- package/src/card/stories/index.js +1 -1
- package/src/card/test/__snapshots__/index.js.snap +6 -6
- package/src/checkbox-control/index.js +1 -1
- package/src/checkbox-control/stories/index.js +1 -1
- package/src/clipboard-button/index.js +1 -2
- package/src/color-indicator/stories/index.js +1 -1
- package/src/color-indicator/style.scss +5 -8
- package/src/color-palette/index.js +37 -9
- package/src/color-palette/stories/index.js +1 -1
- package/src/color-palette/style.scss +10 -1
- package/src/color-palette/test/__snapshots__/index.js.snap +30 -21
- package/src/color-picker/color-display.tsx +3 -2
- package/src/color-picker/hex-input.tsx +2 -1
- package/src/color-picker/input-with-slider.tsx +2 -1
- package/src/color-picker/stories/index.js +1 -1
- package/src/combobox-control/README.md +2 -2
- package/src/confirm-dialog/README.md +128 -0
- package/src/confirm-dialog/component.tsx +114 -0
- package/src/confirm-dialog/index.tsx +6 -0
- package/src/confirm-dialog/stories/index.js +120 -0
- package/src/confirm-dialog/test/index.js +302 -0
- package/src/confirm-dialog/types.ts +26 -0
- package/src/custom-gradient-bar/constants.js +0 -5
- package/src/custom-gradient-bar/control-points.js +40 -9
- package/src/custom-gradient-bar/index.js +8 -0
- package/src/custom-gradient-picker/index.js +9 -1
- package/src/custom-gradient-picker/style.scss +0 -4
- package/src/date-time/README.md +7 -0
- package/src/date-time/date.js +67 -84
- package/src/date-time/stories/index.js +1 -1
- package/src/date-time/stories/time.js +1 -1
- package/src/date-time/test/date.js +3 -29
- package/src/date-time/test/utils.js +32 -0
- package/src/date-time/utils.js +18 -0
- package/src/dimension-control/README.md +1 -1
- package/src/divider/README.md +33 -5
- package/src/divider/component.tsx +8 -7
- package/src/divider/stories/index.js +43 -17
- package/src/divider/styles.ts +53 -16
- package/src/divider/test/__snapshots__/index.js.snap +11 -11
- package/src/divider/test/index.js +4 -4
- package/src/divider/types.ts +5 -5
- package/src/drop-zone/index.js +14 -6
- package/src/drop-zone/provider.js +1 -0
- package/src/dropdown-menu/stories/index.js +1 -1
- package/src/duotone-picker/README.md +1 -1
- package/src/elevation/stories/index.js +1 -1
- package/src/external-link/stories/index.js +1 -1
- package/src/flyout/styles.ts +4 -2
- package/src/focusable-iframe/index.js +1 -0
- package/src/font-size-picker/index.js +27 -13
- package/src/font-size-picker/stories/index.js +63 -1
- package/src/font-size-picker/test/index.js +87 -0
- package/src/font-size-picker/test/util.js +74 -0
- package/src/font-size-picker/utils.js +31 -17
- package/src/form-token-field/stories/index.js +1 -1
- package/src/gradient-picker/index.js +4 -0
- package/src/gradient-picker/stories/index.js +1 -1
- package/src/grid/stories/index.js +1 -1
- package/src/guide/stories/index.js +1 -1
- package/src/higher-order/with-focus-outside/index.js +2 -0
- package/src/icon/stories/index.js +1 -1
- package/src/index.js +1 -0
- package/src/input-control/stories/index.js +2 -1
- package/src/input-control/styles/input-control-styles.tsx +16 -6
- package/src/input-control/types.ts +3 -1
- package/src/item-group/stories/index.js +84 -2
- package/src/menu-item/README.md +2 -2
- package/src/mobile/bottom-sheet/link-suggestion-item-cell.native.js +6 -2
- package/src/mobile/color-settings/index.native.js +2 -0
- package/src/mobile/color-settings/palette.screen.native.js +8 -5
- package/src/mobile/color-settings/style.native.scss +1 -1
- package/src/mobile/global-styles-context/utils.native.js +1 -1
- package/src/mobile/gridicons/index.native.js +3 -3
- package/src/mobile/inserter-button/style.native.scss +1 -0
- package/src/mobile/link-picker/index.native.js +41 -7
- package/src/mobile/link-settings/index.native.js +11 -0
- package/src/mobile/link-settings/test/edit.native.js +432 -0
- package/src/modal/README.md +10 -0
- package/src/modal/aria-helper.js +2 -0
- package/src/modal/index.js +72 -55
- package/src/modal/stories/index.js +6 -1
- package/src/modal/style.scss +9 -0
- package/src/modal/test/index.js +11 -0
- package/src/navigation/README.md +0 -9
- package/src/notice/stories/index.js +1 -1
- package/src/number-control/stories/index.js +1 -1
- package/src/palette-edit/index.js +15 -16
- package/src/palette-edit/style.scss +5 -0
- package/src/panel/stories/index.js +1 -1
- package/src/placeholder/stories/index.js +1 -1
- package/src/popover/stories/index.js +1 -1
- package/src/query-controls/README.md +138 -6
- package/src/radio-group/README.md +4 -1
- package/src/range-control/stories/index.js +1 -1
- package/src/resizable-box/stories/index.js +1 -1
- package/src/scrollable/stories/index.js +1 -1
- package/src/search-control/stories/index.js +1 -1
- package/src/select-control/stories/index.js +2 -1
- package/src/select-control/styles/select-control-styles.ts +25 -2
- package/src/select-control/types.ts +1 -1
- package/src/slot-fill/stories/index.js +1 -1
- package/src/snackbar/stories/index.js +1 -1
- package/src/spacer/stories/index.js +1 -1
- package/src/style-provider/index.js +2 -0
- package/src/surface/stories/index.js +1 -1
- package/src/tab-panel/stories/index.js +1 -1
- package/src/text-control/stories/index.js +1 -1
- package/src/text-highlight/stories/index.js +1 -1
- package/src/textarea-control/stories/index.js +1 -1
- package/src/tip/stories/index.js +1 -1
- package/src/toggle-control/stories/index.js +1 -1
- package/src/toggle-group-control/stories/index.js +1 -1
- package/src/toggle-group-control/toggle-group-control/component.tsx +7 -2
- package/src/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.tsx +24 -9
- package/src/toggle-group-control/toggle-group-control-option/styles.ts +3 -0
- package/src/toolbar-button/stories/index.js +1 -1
- package/src/tools-panel/stories/index.js +237 -0
- package/src/tools-panel/styles.ts +41 -1
- package/src/tools-panel/test/index.js +234 -1
- package/src/tools-panel/tools-panel/README.md +9 -0
- package/src/tools-panel/tools-panel/component.tsx +2 -5
- package/src/tools-panel/tools-panel/hook.ts +50 -18
- package/src/tools-panel/tools-panel-item/hook.ts +5 -1
- package/src/tools-panel/types.ts +5 -1
- package/src/tooltip/stories/index.js +1 -1
- package/src/tree-select/stories/index.js +1 -1
- package/src/truncate/stories/index.js +1 -1
- package/src/unit-control/stories/index.js +19 -1
- package/src/unit-control/styles/unit-control-styles.ts +33 -46
- package/src/unit-control/types.ts +5 -2
- package/src/z-stack/README.md +1 -1
- package/src/z-stack/component.tsx +1 -1
- package/src/z-stack/stories/index.js +1 -1
- package/src/z-stack/styles.ts +7 -2
- package/tsconfig.json +6 -2
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -127,6 +127,7 @@ function Option( {
|
|
|
127
127
|
) }
|
|
128
128
|
{ isGradient && (
|
|
129
129
|
<CustomGradientPicker
|
|
130
|
+
__experimentalIsRenderedInSidebar
|
|
130
131
|
value={ value }
|
|
131
132
|
onChange={ ( newGradient ) =>
|
|
132
133
|
onChange( {
|
|
@@ -291,22 +292,8 @@ export default function PaletteEdit( {
|
|
|
291
292
|
} }
|
|
292
293
|
/>
|
|
293
294
|
) }
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
disabled={ ! hasElements }
|
|
297
|
-
isSmall
|
|
298
|
-
icon={ moreVertical }
|
|
299
|
-
label={
|
|
300
|
-
isGradient
|
|
301
|
-
? __( 'Edit gradients' )
|
|
302
|
-
: __( 'Edit colors' )
|
|
303
|
-
}
|
|
304
|
-
onClick={ () => {
|
|
305
|
-
setIsEditing( true );
|
|
306
|
-
} }
|
|
307
|
-
/>
|
|
308
|
-
) }
|
|
309
|
-
{ isEditing && ( canReset || ! canOnlyChangeValues ) && (
|
|
295
|
+
|
|
296
|
+
{ hasElements && ( canReset || ! canOnlyChangeValues ) && (
|
|
310
297
|
<DropdownMenu
|
|
311
298
|
icon={ moreVertical }
|
|
312
299
|
label={
|
|
@@ -321,6 +308,17 @@ export default function PaletteEdit( {
|
|
|
321
308
|
{ ( { onClose } ) => (
|
|
322
309
|
<>
|
|
323
310
|
<NavigableMenu role="menu">
|
|
311
|
+
<Button
|
|
312
|
+
variant="tertiary"
|
|
313
|
+
disabled={ isEditing }
|
|
314
|
+
onClick={ () => {
|
|
315
|
+
setIsEditing( true );
|
|
316
|
+
onClose();
|
|
317
|
+
} }
|
|
318
|
+
className="components-palette-edit__menu-button"
|
|
319
|
+
>
|
|
320
|
+
{ __( 'Edit custom colors' ) }
|
|
321
|
+
</Button>
|
|
324
322
|
{ ! canOnlyChangeValues && (
|
|
325
323
|
<Button
|
|
326
324
|
variant="tertiary"
|
|
@@ -330,6 +328,7 @@ export default function PaletteEdit( {
|
|
|
330
328
|
onChange();
|
|
331
329
|
onClose();
|
|
332
330
|
} }
|
|
331
|
+
className="components-palette-edit__menu-button"
|
|
333
332
|
>
|
|
334
333
|
{ isGradient
|
|
335
334
|
? __(
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# QueryControls
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Development Guidelines
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
4
6
|
|
|
5
7
|
```jsx
|
|
6
8
|
import { QueryControls } from '@wordpress/components';
|
|
7
9
|
import { useState } from '@wordpress/element';
|
|
8
10
|
|
|
9
11
|
const QUERY_DEFAULTS = {
|
|
10
|
-
orderBy: 'title',
|
|
11
|
-
order: 'asc',
|
|
12
12
|
category: 1,
|
|
13
13
|
categories: [
|
|
14
14
|
{
|
|
@@ -27,12 +27,16 @@ const QUERY_DEFAULTS = {
|
|
|
27
27
|
parent: 0,
|
|
28
28
|
},
|
|
29
29
|
],
|
|
30
|
+
maxItems: 20,
|
|
31
|
+
minItems: 1,
|
|
30
32
|
numberOfItems: 10,
|
|
33
|
+
order: 'asc',
|
|
34
|
+
orderBy: 'title',
|
|
31
35
|
};
|
|
32
36
|
|
|
33
37
|
const MyQueryControls = () => {
|
|
34
38
|
const [ query, setQuery ] = useState( QUERY_DEFAULTS );
|
|
35
|
-
const {
|
|
39
|
+
const { category, categories, maxItems, minItems, numberOfItems, order, orderBy } = query;
|
|
36
40
|
|
|
37
41
|
const updateQuery = ( newQuery ) => {
|
|
38
42
|
setQuery( { ...query, ...newQuery } );
|
|
@@ -40,7 +44,7 @@ const MyQueryControls = () => {
|
|
|
40
44
|
|
|
41
45
|
return (
|
|
42
46
|
<QueryControls
|
|
43
|
-
{ ...{
|
|
47
|
+
{ ...{ maxItems, minItems, numberOfItems, order, orderBy } }
|
|
44
48
|
onOrderByChange={ ( newOrderBy ) => updateQuery( { orderBy: newOrderBy } ) }
|
|
45
49
|
onOrderChange={ ( newOrder ) => updateQuery( { order: newOrder } ) }
|
|
46
50
|
categoriesList={ categories }
|
|
@@ -54,7 +58,7 @@ const MyQueryControls = () => {
|
|
|
54
58
|
};
|
|
55
59
|
```
|
|
56
60
|
|
|
57
|
-
|
|
61
|
+
### Multiple category selector
|
|
58
62
|
|
|
59
63
|
The `QueryControls` component now supports multiple category selection, to replace the single category selection available so far. To enable it use the component with the new props instead: `categorySuggestions` in place of `categoriesList` and the `selectedCategories` array instead of `selectedCategoryId` like so:
|
|
60
64
|
|
|
@@ -108,3 +112,131 @@ const MyQueryControls = () => {
|
|
|
108
112
|
```
|
|
109
113
|
|
|
110
114
|
The format of the categories list also needs to be updated to match what `FormTokenField` expects for making suggestions.
|
|
115
|
+
|
|
116
|
+
### Props
|
|
117
|
+
|
|
118
|
+
#### authorList
|
|
119
|
+
|
|
120
|
+
An array of author IDs that is passed into an `AuthorSelect` sub-component.
|
|
121
|
+
|
|
122
|
+
- Type: `Array`
|
|
123
|
+
- Required: No
|
|
124
|
+
- Platform: Web
|
|
125
|
+
|
|
126
|
+
#### selectedAuthorId
|
|
127
|
+
|
|
128
|
+
The selected author ID.
|
|
129
|
+
|
|
130
|
+
- Type: `Number`
|
|
131
|
+
- Required: No
|
|
132
|
+
- Platform: Web
|
|
133
|
+
|
|
134
|
+
#### categoriesList
|
|
135
|
+
|
|
136
|
+
An array of category IDs; renders a `CategorySelect` sub-component when passed in conjunction with `onCategoryChange`.
|
|
137
|
+
|
|
138
|
+
- Type: `Array`
|
|
139
|
+
- Required: No
|
|
140
|
+
- Platform: Web
|
|
141
|
+
|
|
142
|
+
#### categorySuggestions
|
|
143
|
+
|
|
144
|
+
An array of category names; renders a `FormTokenField` component when passed in conjunction with `onCategoryChange`.
|
|
145
|
+
|
|
146
|
+
- Type: `Array`
|
|
147
|
+
- Required: No
|
|
148
|
+
- Platform: Web
|
|
149
|
+
|
|
150
|
+
#### maxItems
|
|
151
|
+
|
|
152
|
+
- Type: `Number`
|
|
153
|
+
- Required: No
|
|
154
|
+
- Default: 100
|
|
155
|
+
- Platform: Web
|
|
156
|
+
|
|
157
|
+
#### minItems
|
|
158
|
+
|
|
159
|
+
- Type: `Number`
|
|
160
|
+
- Required: No
|
|
161
|
+
- Default: 1
|
|
162
|
+
- Platform: Web
|
|
163
|
+
|
|
164
|
+
#### numberOfItems
|
|
165
|
+
|
|
166
|
+
The selected number of items to retrieve via the query.
|
|
167
|
+
|
|
168
|
+
- Type: `Number`
|
|
169
|
+
- Required: No
|
|
170
|
+
- Platform: Web
|
|
171
|
+
|
|
172
|
+
#### onAuthorChange
|
|
173
|
+
|
|
174
|
+
A function that receives the new author value. If this is not specified, the author controls are not included.
|
|
175
|
+
|
|
176
|
+
- Type: `Function`
|
|
177
|
+
- Required: No
|
|
178
|
+
- Platform: Web
|
|
179
|
+
|
|
180
|
+
#### onCategoryChange
|
|
181
|
+
|
|
182
|
+
A function that receives the new author value. If this is not specified, the category controls are not included.
|
|
183
|
+
|
|
184
|
+
- Type: `Function`
|
|
185
|
+
- Required: No
|
|
186
|
+
- Platform: Web
|
|
187
|
+
|
|
188
|
+
#### onNumberOfItemsChange
|
|
189
|
+
|
|
190
|
+
A function that receives the new number of items value. If this is not specified, then the number of items range control is not included.
|
|
191
|
+
|
|
192
|
+
- Type: `Function`
|
|
193
|
+
- Required: No
|
|
194
|
+
- Platform: Web
|
|
195
|
+
|
|
196
|
+
#### onOrderChange
|
|
197
|
+
|
|
198
|
+
A function that receives the new order value. If this or onOrderByChange are not specified, then the order controls are not included.
|
|
199
|
+
|
|
200
|
+
- Type: `Function`
|
|
201
|
+
- Required: No
|
|
202
|
+
- Platform: Web
|
|
203
|
+
|
|
204
|
+
#### onOrderByChange
|
|
205
|
+
|
|
206
|
+
A function that receives the new orderby value. If this or onOrderChange are not specified, then the order controls are not included.
|
|
207
|
+
|
|
208
|
+
- Type: `Function`
|
|
209
|
+
- Required: No
|
|
210
|
+
- Platform: Web
|
|
211
|
+
|
|
212
|
+
#### order
|
|
213
|
+
|
|
214
|
+
The order in which to retrieve posts. Can be 'asc' or 'desc'.
|
|
215
|
+
|
|
216
|
+
- Type: `String`
|
|
217
|
+
- Required: No
|
|
218
|
+
- Platform: Web
|
|
219
|
+
|
|
220
|
+
#### orderBy
|
|
221
|
+
|
|
222
|
+
The meta key by which to order posts. Can be 'date' or 'title'.
|
|
223
|
+
|
|
224
|
+
- Type: `String`
|
|
225
|
+
- Required: No
|
|
226
|
+
- Platform: Web
|
|
227
|
+
|
|
228
|
+
#### selectedCategories
|
|
229
|
+
|
|
230
|
+
The selected categories for the `categorySuggestions`.
|
|
231
|
+
|
|
232
|
+
- Type: `Array`
|
|
233
|
+
- Required: No
|
|
234
|
+
- Platform: Web
|
|
235
|
+
|
|
236
|
+
#### selectedCategoryId
|
|
237
|
+
|
|
238
|
+
The selected category for the `categoriesList`.
|
|
239
|
+
|
|
240
|
+
- Type: `Number`
|
|
241
|
+
- Required: No
|
|
242
|
+
- Platform: Web
|
|
@@ -49,7 +49,10 @@ Radio groups that cannot be selected can either be given a disabled state, or be
|
|
|
49
49
|
#### Controlled
|
|
50
50
|
|
|
51
51
|
```jsx
|
|
52
|
-
import {
|
|
52
|
+
import {
|
|
53
|
+
__experimentalRadio as Radio,
|
|
54
|
+
__experimentalRadioGroup as RadioGroup,
|
|
55
|
+
} from '@wordpress/components';
|
|
53
56
|
import { useState } from '@wordpress/element';
|
|
54
57
|
|
|
55
58
|
const MyControlledRadioRadioGroup = () => {
|
|
@@ -17,7 +17,7 @@ export default {
|
|
|
17
17
|
title: 'Components/SelectControl',
|
|
18
18
|
component: SelectControl,
|
|
19
19
|
parameters: {
|
|
20
|
-
knobs: {
|
|
20
|
+
knobs: { disable: false },
|
|
21
21
|
},
|
|
22
22
|
};
|
|
23
23
|
|
|
@@ -60,6 +60,7 @@ export const _default = () => {
|
|
|
60
60
|
{
|
|
61
61
|
default: 'default',
|
|
62
62
|
small: 'small',
|
|
63
|
+
'__unstable-large': '__unstable-large',
|
|
63
64
|
},
|
|
64
65
|
'default'
|
|
65
66
|
),
|
|
@@ -27,6 +27,7 @@ const fontSizeStyles = ( { selectSize }: SelectProps ) => {
|
|
|
27
27
|
const sizes = {
|
|
28
28
|
default: '13px',
|
|
29
29
|
small: '11px',
|
|
30
|
+
'__unstable-large': '13px',
|
|
30
31
|
};
|
|
31
32
|
|
|
32
33
|
const fontSize = sizes[ selectSize as Size ];
|
|
@@ -55,6 +56,11 @@ const sizeStyles = ( { selectSize }: SelectProps ) => {
|
|
|
55
56
|
lineHeight: 1,
|
|
56
57
|
minHeight: 24,
|
|
57
58
|
},
|
|
59
|
+
'__unstable-large': {
|
|
60
|
+
height: 40,
|
|
61
|
+
lineHeight: 1,
|
|
62
|
+
minHeight: 40,
|
|
63
|
+
},
|
|
58
64
|
};
|
|
59
65
|
|
|
60
66
|
const style = sizes[ selectSize as Size ] || sizes.default;
|
|
@@ -62,6 +68,24 @@ const sizeStyles = ( { selectSize }: SelectProps ) => {
|
|
|
62
68
|
return css( style );
|
|
63
69
|
};
|
|
64
70
|
|
|
71
|
+
const sizePaddings = ( { selectSize = 'default' }: SelectProps ) => {
|
|
72
|
+
const sizes = {
|
|
73
|
+
default: {
|
|
74
|
+
paddingLeft: 8,
|
|
75
|
+
paddingRight: 24,
|
|
76
|
+
},
|
|
77
|
+
small: {
|
|
78
|
+
paddingLeft: 8,
|
|
79
|
+
paddingRight: 24,
|
|
80
|
+
},
|
|
81
|
+
'__unstable-large': {
|
|
82
|
+
paddingLeft: 16,
|
|
83
|
+
paddingRight: 32,
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
return rtl( sizes[ selectSize ] );
|
|
87
|
+
};
|
|
88
|
+
|
|
65
89
|
// TODO: Resolve need to use &&& to increase specificity
|
|
66
90
|
// https://github.com/WordPress/gutenberg/issues/18483
|
|
67
91
|
|
|
@@ -80,8 +104,7 @@ export const Select = styled.select< SelectProps >`
|
|
|
80
104
|
${ disabledStyles };
|
|
81
105
|
${ fontSizeStyles };
|
|
82
106
|
${ sizeStyles };
|
|
83
|
-
|
|
84
|
-
${ rtl( { paddingLeft: 8, paddingRight: 24 } ) }
|
|
107
|
+
${ sizePaddings };
|
|
85
108
|
}
|
|
86
109
|
`;
|
|
87
110
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type Size = 'default' | 'small';
|
|
1
|
+
export type Size = 'default' | 'small' | '__unstable-large';
|
package/src/tip/stories/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import useResizeAware from 'react-resize-aware';
|
|
|
12
12
|
*/
|
|
13
13
|
import { __ } from '@wordpress/i18n';
|
|
14
14
|
import { useRef, useMemo } from '@wordpress/element';
|
|
15
|
-
import { useMergeRefs, useInstanceId } from '@wordpress/compose';
|
|
15
|
+
import { useMergeRefs, useInstanceId, usePrevious } from '@wordpress/compose';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Internal dependencies
|
|
@@ -59,10 +59,15 @@ function ToggleGroupControl(
|
|
|
59
59
|
baseId,
|
|
60
60
|
state: value,
|
|
61
61
|
} );
|
|
62
|
+
const previousValue = usePrevious( value );
|
|
62
63
|
|
|
63
64
|
// Propagate radio.state change
|
|
64
65
|
useUpdateEffect( () => {
|
|
65
|
-
onChange
|
|
66
|
+
// Avoid calling onChange if radio state changed
|
|
67
|
+
// from incoming value.
|
|
68
|
+
if ( previousValue !== radio.state ) {
|
|
69
|
+
onChange( radio.state );
|
|
70
|
+
}
|
|
66
71
|
}, [ radio.state ] );
|
|
67
72
|
|
|
68
73
|
// Sync incoming value with radio.state
|
|
@@ -35,21 +35,36 @@ function ToggleGroupControlBackdrop( {
|
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
const computeDimensions = () => {
|
|
39
|
+
const {
|
|
40
|
+
width: offsetWidth,
|
|
41
|
+
x,
|
|
42
|
+
} = targetNode.getBoundingClientRect();
|
|
42
43
|
|
|
43
|
-
|
|
44
|
-
setWidth( offsetWidth );
|
|
44
|
+
const { x: parentX } = containerNode.getBoundingClientRect();
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
const borderWidth = 1;
|
|
47
|
+
const offsetLeft = x - parentX - borderWidth;
|
|
48
|
+
|
|
49
|
+
setLeft( offsetLeft );
|
|
50
|
+
setWidth( offsetWidth );
|
|
51
|
+
};
|
|
52
|
+
// Fix to make the component appear as expected inside popovers.
|
|
53
|
+
// If the targetNode width is 0 it means the element was not yet rendered we should allow
|
|
54
|
+
// some time for the render to happen.
|
|
55
|
+
// requestAnimationFrame instead of setTimeout with a small time does not seems to work.
|
|
56
|
+
const dimensionsRequestId = window.setTimeout( computeDimensions, 100 );
|
|
57
|
+
|
|
58
|
+
let animationRequestId: number;
|
|
47
59
|
if ( ! canAnimate ) {
|
|
48
|
-
|
|
60
|
+
animationRequestId = window.requestAnimationFrame( () => {
|
|
49
61
|
setCanAnimate( true );
|
|
50
62
|
} );
|
|
51
63
|
}
|
|
52
|
-
return () =>
|
|
64
|
+
return () => {
|
|
65
|
+
window.clearTimeout( dimensionsRequestId );
|
|
66
|
+
window.cancelAnimationFrame( animationRequestId );
|
|
67
|
+
};
|
|
53
68
|
}, [ canAnimate, containerRef, containerWidth, state, isAdaptiveWidth ] );
|
|
54
69
|
|
|
55
70
|
if ( ! renderBackdrop ) {
|