@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/checkbox-control/index.js"],"names":["classnames","useInstanceId","deprecated","Icon","check","BaseControl","CheckboxControl","label","className","heading","checked","help","onChange","props","alternative","
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/checkbox-control/index.js"],"names":["classnames","useInstanceId","deprecated","Icon","check","BaseControl","CheckboxControl","label","className","heading","checked","help","onChange","props","alternative","since","instanceId","id","onChangeValue","event","target","undefined"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,aAAT,QAA8B,oBAA9B;AACA,OAAOC,UAAP,MAAuB,uBAAvB;AACA,SAASC,IAAT,EAAeC,KAAf,QAA4B,kBAA5B;AAEA;AACA;AACA;;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AAEA,eAAe,SAASC,eAAT,OAQX;AAAA,MARqC;AACxCC,IAAAA,KADwC;AAExCC,IAAAA,SAFwC;AAGxCC,IAAAA,OAHwC;AAIxCC,IAAAA,OAJwC;AAKxCC,IAAAA,IALwC;AAMxCC,IAAAA,QANwC;AAOxC,OAAGC;AAPqC,GAQrC;;AACH,MAAKJ,OAAL,EAAe;AACdP,IAAAA,UAAU,CAAE,qCAAF,EAAyC;AAClDY,MAAAA,WAAW,EAAE,2CADqC;AAElDC,MAAAA,KAAK,EAAE;AAF2C,KAAzC,CAAV;AAIA;;AAED,QAAMC,UAAU,GAAGf,aAAa,CAAEK,eAAF,CAAhC;AACA,QAAMW,EAAE,GAAI,8BAA8BD,UAAY,EAAtD;;AACA,QAAME,aAAa,GAAKC,KAAF,IAAaP,QAAQ,CAAEO,KAAK,CAACC,MAAN,CAAaV,OAAf,CAA3C;;AAEA,SACC,cAAC,WAAD;AACC,IAAA,KAAK,EAAGD,OADT;AAEC,IAAA,EAAE,EAAGQ,EAFN;AAGC,IAAA,IAAI,EAAGN,IAHR;AAIC,IAAA,SAAS,EAAGX,UAAU,CAAE,6BAAF,EAAiCQ,SAAjC;AAJvB,KAMC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC;AACC,IAAA,EAAE,EAAGS,EADN;AAEC,IAAA,SAAS,EAAC,oCAFX;AAGC,IAAA,IAAI,EAAC,UAHN;AAIC,IAAA,KAAK,EAAC,GAJP;AAKC,IAAA,QAAQ,EAAGC,aALZ;AAMC,IAAA,OAAO,EAAGR,OANX;AAOC,wBAAmB,CAAC,CAAEC,IAAH,GAAUM,EAAE,GAAG,QAAf,GAA0BI;AAP9C,KAQMR,KARN,EADD,EAWGH,OAAO,GACR,cAAC,IAAD;AACC,IAAA,IAAI,EAAGN,KADR;AAEC,IAAA,SAAS,EAAC,sCAFX;AAGC,IAAA,IAAI,EAAC;AAHN,IADQ,GAML,IAjBL,CAND,EAyBC;AACC,IAAA,SAAS,EAAC,oCADX;AAEC,IAAA,OAAO,EAAGa;AAFX,KAIGV,KAJH,CAzBD,CADD;AAkCA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\nimport { Icon, check } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\n\nexport default function CheckboxControl( {\n\tlabel,\n\tclassName,\n\theading,\n\tchecked,\n\thelp,\n\tonChange,\n\t...props\n} ) {\n\tif ( heading ) {\n\t\tdeprecated( '`heading` prop in `CheckboxControl`', {\n\t\t\talternative: 'a separate element to implement a heading',\n\t\t\tsince: '5.8',\n\t\t} );\n\t}\n\n\tconst instanceId = useInstanceId( CheckboxControl );\n\tconst id = `inspector-checkbox-control-${ instanceId }`;\n\tconst onChangeValue = ( event ) => onChange( event.target.checked );\n\n\treturn (\n\t\t<BaseControl\n\t\t\tlabel={ heading }\n\t\t\tid={ id }\n\t\t\thelp={ help }\n\t\t\tclassName={ classnames( 'components-checkbox-control', className ) }\n\t\t>\n\t\t\t<span className=\"components-checkbox-control__input-container\">\n\t\t\t\t<input\n\t\t\t\t\tid={ id }\n\t\t\t\t\tclassName=\"components-checkbox-control__input\"\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\tvalue=\"1\"\n\t\t\t\t\tonChange={ onChangeValue }\n\t\t\t\t\tchecked={ checked }\n\t\t\t\t\taria-describedby={ !! help ? id + '__help' : undefined }\n\t\t\t\t\t{ ...props }\n\t\t\t\t/>\n\t\t\t\t{ checked ? (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ check }\n\t\t\t\t\t\tclassName=\"components-checkbox-control__checked\"\n\t\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\t/>\n\t\t\t\t) : null }\n\t\t\t</span>\n\t\t\t<label\n\t\t\t\tclassName=\"components-checkbox-control__label\"\n\t\t\t\thtmlFor={ id }\n\t\t\t>\n\t\t\t\t{ label }\n\t\t\t</label>\n\t\t</BaseControl>\n\t);\n}\n"]}
|
|
@@ -28,8 +28,7 @@ export default function ClipboardButton(_ref) {
|
|
|
28
28
|
...buttonProps
|
|
29
29
|
} = _ref;
|
|
30
30
|
deprecated('wp.components.ClipboardButton', {
|
|
31
|
-
since: '
|
|
32
|
-
plugin: 'Gutenberg',
|
|
31
|
+
since: '5.8',
|
|
33
32
|
alternative: 'wp.compose.useCopyToClipboard'
|
|
34
33
|
});
|
|
35
34
|
const timeoutId = useRef();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/clipboard-button/index.js"],"names":["classnames","useRef","useEffect","useCopyToClipboard","deprecated","Button","TIMEOUT","ClipboardButton","className","children","onCopy","onFinishCopy","text","buttonProps","since","
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/clipboard-button/index.js"],"names":["classnames","useRef","useEffect","useCopyToClipboard","deprecated","Button","TIMEOUT","ClipboardButton","className","children","onCopy","onFinishCopy","text","buttonProps","since","alternative","timeoutId","ref","clearTimeout","current","setTimeout","classes","focusOnCopyEventTarget","event","target","focus"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,MAAT,EAAiBC,SAAjB,QAAkC,oBAAlC;AACA,SAASC,kBAAT,QAAmC,oBAAnC;AACA,OAAOC,UAAP,MAAuB,uBAAvB;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,WAAnB;AAEA,MAAMC,OAAO,GAAG,IAAhB;AAEA,eAAe,SAASC,eAAT,OAOX;AAAA,MAPqC;AACxCC,IAAAA,SADwC;AAExCC,IAAAA,QAFwC;AAGxCC,IAAAA,MAHwC;AAIxCC,IAAAA,YAJwC;AAKxCC,IAAAA,IALwC;AAMxC,OAAGC;AANqC,GAOrC;AACHT,EAAAA,UAAU,CAAE,+BAAF,EAAmC;AAC5CU,IAAAA,KAAK,EAAE,KADqC;AAE5CC,IAAAA,WAAW,EAAE;AAF+B,GAAnC,CAAV;AAKA,QAAMC,SAAS,GAAGf,MAAM,EAAxB;AACA,QAAMgB,GAAG,GAAGd,kBAAkB,CAAES,IAAF,EAAQ,MAAM;AAC3CF,IAAAA,MAAM;AACNQ,IAAAA,YAAY,CAAEF,SAAS,CAACG,OAAZ,CAAZ;;AAEA,QAAKR,YAAL,EAAoB;AACnBK,MAAAA,SAAS,CAACG,OAAV,GAAoBC,UAAU,CAAE,MAAMT,YAAY,EAApB,EAAwBL,OAAxB,CAA9B;AACA;AACD,GAP6B,CAA9B;AASAJ,EAAAA,SAAS,CAAE,MAAM;AAChBgB,IAAAA,YAAY,CAAEF,SAAS,CAACG,OAAZ,CAAZ;AACA,GAFQ,EAEN,EAFM,CAAT;AAIA,QAAME,OAAO,GAAGrB,UAAU,CAAE,6BAAF,EAAiCQ,SAAjC,CAA1B,CApBG,CAsBH;AACA;AACA;AACA;AACA;;AACA,QAAMc,sBAAsB,GAAKC,KAAF,IAAa;AAC3CA,IAAAA,KAAK,CAACC,MAAN,CAAaC,KAAb;AACA,GAFD;;AAIA,SACC,cAAC,MAAD,eACMZ,WADN;AAEC,IAAA,SAAS,EAAGQ,OAFb;AAGC,IAAA,GAAG,EAAGJ,GAHP;AAIC,IAAA,MAAM,EAAGK;AAJV,MAMGb,QANH,CADD;AAUA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\n\nconst TIMEOUT = 4000;\n\nexport default function ClipboardButton( {\n\tclassName,\n\tchildren,\n\tonCopy,\n\tonFinishCopy,\n\ttext,\n\t...buttonProps\n} ) {\n\tdeprecated( 'wp.components.ClipboardButton', {\n\t\tsince: '5.8',\n\t\talternative: 'wp.compose.useCopyToClipboard',\n\t} );\n\n\tconst timeoutId = useRef();\n\tconst ref = useCopyToClipboard( text, () => {\n\t\tonCopy();\n\t\tclearTimeout( timeoutId.current );\n\n\t\tif ( onFinishCopy ) {\n\t\t\ttimeoutId.current = setTimeout( () => onFinishCopy(), TIMEOUT );\n\t\t}\n\t} );\n\n\tuseEffect( () => {\n\t\tclearTimeout( timeoutId.current );\n\t}, [] );\n\n\tconst classes = classnames( 'components-clipboard-button', className );\n\n\t// Workaround for inconsistent behavior in Safari, where <textarea> is not\n\t// the document.activeElement at the moment when the copy event fires.\n\t// This causes documentHasSelection() in the copy-handler component to\n\t// mistakenly override the ClipboardButton, and copy a serialized string\n\t// of the current block instead.\n\tconst focusOnCopyEventTarget = ( event ) => {\n\t\tevent.target.focus();\n\t};\n\n\treturn (\n\t\t<Button\n\t\t\t{ ...buttonProps }\n\t\t\tclassName={ classes }\n\t\t\tref={ ref }\n\t\t\tonCopy={ focusOnCopyEventTarget }\n\t\t>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
1
2
|
import { createElement } from "@wordpress/element";
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -12,7 +13,7 @@ import classnames from 'classnames';
|
|
|
12
13
|
* WordPress dependencies
|
|
13
14
|
*/
|
|
14
15
|
|
|
15
|
-
import { __, sprintf } from '@wordpress/i18n';
|
|
16
|
+
import { __, sprintf, isRTL } from '@wordpress/i18n';
|
|
16
17
|
import { useCallback, useMemo } from '@wordpress/element';
|
|
17
18
|
/**
|
|
18
19
|
* Internal dependencies
|
|
@@ -97,7 +98,18 @@ function MultiplePalettes(_ref3) {
|
|
|
97
98
|
}));
|
|
98
99
|
}
|
|
99
100
|
|
|
100
|
-
export
|
|
101
|
+
export function CustomColorPickerDropdown(_ref5) {
|
|
102
|
+
let {
|
|
103
|
+
isRenderedInSidebar,
|
|
104
|
+
...props
|
|
105
|
+
} = _ref5;
|
|
106
|
+
return createElement(Dropdown, _extends({
|
|
107
|
+
contentClassName: classnames('components-color-palette__custom-color-dropdown-content', {
|
|
108
|
+
'is-rendered-in-sidebar': isRenderedInSidebar
|
|
109
|
+
})
|
|
110
|
+
}, props));
|
|
111
|
+
}
|
|
112
|
+
export default function ColorPalette(_ref6) {
|
|
101
113
|
let {
|
|
102
114
|
clearable = true,
|
|
103
115
|
className,
|
|
@@ -108,7 +120,7 @@ export default function ColorPalette(_ref5) {
|
|
|
108
120
|
value,
|
|
109
121
|
__experimentalHasMultipleOrigins = false,
|
|
110
122
|
__experimentalIsRenderedInSidebar = false
|
|
111
|
-
} =
|
|
123
|
+
} = _ref6;
|
|
112
124
|
const clearColor = useCallback(() => onChange(undefined), [onChange]);
|
|
113
125
|
const Component = __experimentalHasMultipleOrigins ? MultiplePalettes : SinglePalette;
|
|
114
126
|
|
|
@@ -118,19 +130,30 @@ export default function ColorPalette(_ref5) {
|
|
|
118
130
|
enableAlpha: enableAlpha
|
|
119
131
|
});
|
|
120
132
|
|
|
133
|
+
let dropdownPosition;
|
|
134
|
+
let popoverProps;
|
|
135
|
+
|
|
136
|
+
if (__experimentalIsRenderedInSidebar) {
|
|
137
|
+
dropdownPosition = isRTL() ? 'bottom right' : 'bottom left';
|
|
138
|
+
popoverProps = {
|
|
139
|
+
__unstableForcePosition: true
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const colordColor = colord(value);
|
|
121
144
|
return createElement(VStack, {
|
|
122
145
|
spacing: 3,
|
|
123
146
|
className: className
|
|
124
|
-
}, !disableCustomColors && createElement(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}),
|
|
147
|
+
}, !disableCustomColors && createElement(CustomColorPickerDropdown, {
|
|
148
|
+
position: dropdownPosition,
|
|
149
|
+
isRenderedInSidebar: __experimentalIsRenderedInSidebar,
|
|
128
150
|
renderContent: renderCustomColorPicker,
|
|
129
|
-
|
|
151
|
+
popoverProps: popoverProps,
|
|
152
|
+
renderToggle: _ref7 => {
|
|
130
153
|
let {
|
|
131
154
|
isOpen,
|
|
132
155
|
onToggle
|
|
133
|
-
} =
|
|
156
|
+
} = _ref7;
|
|
134
157
|
return createElement("button", {
|
|
135
158
|
className: "components-color-palette__custom-color",
|
|
136
159
|
"aria-expanded": isOpen,
|
|
@@ -138,7 +161,8 @@ export default function ColorPalette(_ref5) {
|
|
|
138
161
|
onClick: onToggle,
|
|
139
162
|
"aria-label": __('Custom color picker'),
|
|
140
163
|
style: {
|
|
141
|
-
background: value
|
|
164
|
+
background: value,
|
|
165
|
+
color: colordColor.contrast() > colordColor.contrast('#000') ? '#fff' : '#000'
|
|
142
166
|
}
|
|
143
167
|
}, value);
|
|
144
168
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/color-palette/index.js"],"names":["map","colord","extend","namesPlugin","a11yPlugin","classnames","__","sprintf","useCallback","useMemo","Dropdown","ColorPicker","CircularOptionPicker","VStack","ColorHeading","SinglePalette","className","clearColor","colors","onChange","value","actions","colorOptions","color","name","colordColor","fill","contrast","backgroundColor","MultiplePalettes","index","colorPalette","length","ColorPalette","clearable","disableCustomColors","enableAlpha","__experimentalHasMultipleOrigins","__experimentalIsRenderedInSidebar","undefined","Component","renderCustomColorPicker","isOpen","onToggle","background"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AACA,SAASC,MAAT,EAAiBC,MAAjB,QAA+B,QAA/B;AACA,OAAOC,WAAP,MAAwB,sBAAxB;AACA,OAAOC,UAAP,MAAuB,qBAAvB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,WAAT,EAAsBC,OAAtB,QAAqC,oBAArC;AAEA;AACA;AACA;;AACA,OAAOC,QAAP,MAAqB,aAArB;AACA,SAASC,WAAT,QAA4B,iBAA5B;AACA,OAAOC,oBAAP,MAAiC,2BAAjC;AACA,SAASC,MAAT,QAAuB,YAAvB;AACA,SAASC,YAAT,QAA6B,UAA7B;AAEAZ,MAAM,CAAE,CAAEC,WAAF,EAAeC,UAAf,CAAF,CAAN;;AAEA,SAASW,aAAT,OAOI;AAAA,MAPoB;AACvBC,IAAAA,SADuB;AAEvBC,IAAAA,UAFuB;AAGvBC,IAAAA,MAHuB;AAIvBC,IAAAA,QAJuB;AAKvBC,IAAAA,KALuB;AAMvBC,IAAAA;AANuB,GAOpB;AACH,QAAMC,YAAY,GAAGb,OAAO,CAAE,MAAM;AACnC,WAAOT,GAAG,CAAEkB,MAAF,EAAU,SAAuB;AAAA,UAArB;AAAEK,QAAAA,KAAF;AAASC,QAAAA;AAAT,OAAqB;AAC1C,YAAMC,WAAW,GAAGxB,MAAM,CAAEsB,KAAF,CAA1B;AACA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AFjC;AAGC,IAAA,WAAW,EAAGa;AAHf,IADD;;AAQA,SACC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAG,CAAlB;AAAsB,IAAA,SAAS,EAAGpB;AAAlC,KACG,CAAEmB,mBAAF,IACD,cAAC,QAAD;AACC,IAAA,gBAAgB,EAAG9B,UAAU,CAC5B,yDAD4B,EAE5B;AACC,gCAA0BiC;AAD3B,KAF4B,CAD9B;AAOC,IAAA,aAAa,EAAGG,uBAPjB;AAQC,IAAA,YAAY,EAAG;AAAA,UAAE;AAAEC,QAAAA,MAAF;AAAUC,QAAAA;AAAV,OAAF;AAAA,aACd;AACC,QAAA,SAAS,EAAC,wCADX;AAEC,yBAAgBD,MAFjB;AAGC,yBAAc,MAHf;AAIC,QAAA,OAAO,EAAGC,QAJX;AAKC,sBAAarC,EAAE,CAAE,qBAAF,CALhB;AAMC,QAAA,KAAK,EAAG;AAAEsC,UAAAA,UAAU,EAAExB;AAAd;AANT,SAQGA,KARH,CADc;AAAA;AARhB,IAFF,EAwBC,cAAC,SAAD;AACC,IAAA,SAAS,EAAGc,SADb;AAEC,IAAA,UAAU,EAAGjB,UAFd;AAGC,IAAA,MAAM,EAAGC,MAHV;AAIC,IAAA,QAAQ,EAAGC,QAJZ;AAKC,IAAA,KAAK,EAAGC,KALT;AAMC,IAAA,OAAO,EACN,CAAC,CAAEc,SAAH,IACC,cAAC,oBAAD,CAAsB,YAAtB;AACC,MAAA,OAAO,EAAGjB;AADX,OAGGX,EAAE,CAAE,OAAF,CAHL;AARH,IAxBD,CADD;AA2CA","sourcesContent":["/**\n * External dependencies\n */\nimport { map } from 'lodash';\nimport { colord, extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\nimport a11yPlugin from 'colord/plugins/a11y';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useCallback, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Dropdown from '../dropdown';\nimport { ColorPicker } from '../color-picker';\nimport CircularOptionPicker from '../circular-option-picker';\nimport { VStack } from '../v-stack';\nimport { ColorHeading } from './styles';\n\nextend( [ namesPlugin, a11yPlugin ] );\n\nfunction SinglePalette( {\n\tclassName,\n\tclearColor,\n\tcolors,\n\tonChange,\n\tvalue,\n\tactions,\n} ) {\n\tconst colorOptions = useMemo( () => {\n\t\treturn map( colors, ( { color, name } ) => {\n\t\t\tconst colordColor = colord( color );\n\t\t\treturn (\n\t\t\t\t<CircularOptionPicker.Option\n\t\t\t\t\tkey={ color }\n\t\t\t\t\tisSelected={ value === color }\n\t\t\t\t\tselectedIconProps={\n\t\t\t\t\t\tvalue === color\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tfill:\n\t\t\t\t\t\t\t\t\t\tcolordColor.contrast() >\n\t\t\t\t\t\t\t\t\t\tcolordColor.contrast( '#000' )\n\t\t\t\t\t\t\t\t\t\t\t? '#fff'\n\t\t\t\t\t\t\t\t\t\t\t: '#000',\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t: {}\n\t\t\t\t\t}\n\t\t\t\t\ttooltipText={\n\t\t\t\t\t\tname ||\n\t\t\t\t\t\t// translators: %s: color hex code e.g: \"#f00\".\n\t\t\t\t\t\tsprintf( __( 'Color code: %s' ), color )\n\t\t\t\t\t}\n\t\t\t\t\tstyle={ { backgroundColor: color, color } }\n\t\t\t\t\tonClick={\n\t\t\t\t\t\tvalue === color ? clearColor : () => onChange( color )\n\t\t\t\t\t}\n\t\t\t\t\taria-label={\n\t\t\t\t\t\tname\n\t\t\t\t\t\t\t? // translators: %s: The name of the color e.g: \"vivid red\".\n\t\t\t\t\t\t\t sprintf( __( 'Color: %s' ), name )\n\t\t\t\t\t\t\t: // translators: %s: color hex code e.g: \"#f00\".\n\t\t\t\t\t\t\t sprintf( __( 'Color code: %s' ), color )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t);\n\t\t} );\n\t}, [ colors, value, onChange, clearColor ] );\n\treturn (\n\t\t<CircularOptionPicker\n\t\t\tclassName={ className }\n\t\t\toptions={ colorOptions }\n\t\t\tactions={ actions }\n\t\t/>\n\t);\n}\n\nfunction MultiplePalettes( {\n\tclassName,\n\tclearColor,\n\tcolors,\n\tonChange,\n\tvalue,\n\tactions,\n} ) {\n\treturn (\n\t\t<VStack spacing={ 3 } className={ className }>\n\t\t\t{ colors.map( ( { name, colors: colorPalette }, index ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<VStack spacing={ 2 } key={ index }>\n\t\t\t\t\t\t<ColorHeading>{ name }</ColorHeading>\n\t\t\t\t\t\t<SinglePalette\n\t\t\t\t\t\t\tclearColor={ clearColor }\n\t\t\t\t\t\t\tcolors={ colorPalette }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\tactions={\n\t\t\t\t\t\t\t\tcolors.length === index + 1 ? actions : null\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</VStack>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</VStack>\n\t);\n}\n\nexport default function ColorPalette( {\n\tclearable = true,\n\tclassName,\n\tcolors,\n\tdisableCustomColors = false,\n\tenableAlpha,\n\tonChange,\n\tvalue,\n\t__experimentalHasMultipleOrigins = false,\n\t__experimentalIsRenderedInSidebar = false,\n} ) {\n\tconst clearColor = useCallback( () => onChange( undefined ), [ onChange ] );\n\tconst Component = __experimentalHasMultipleOrigins\n\t\t? MultiplePalettes\n\t\t: SinglePalette;\n\n\tconst renderCustomColorPicker = () => (\n\t\t<ColorPicker\n\t\t\tcolor={ value }\n\t\t\tonChange={ ( color ) => onChange( color ) }\n\t\t\tenableAlpha={ enableAlpha }\n\t\t/>\n\t);\n\n\treturn (\n\t\t<VStack spacing={ 3 } className={ className }>\n\t\t\t{ ! disableCustomColors && (\n\t\t\t\t<Dropdown\n\t\t\t\t\tcontentClassName={ classnames(\n\t\t\t\t\t\t'components-color-palette__custom-color-dropdown-content',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-rendered-in-sidebar': __experimentalIsRenderedInSidebar,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ renderCustomColorPicker }\n\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\tclassName=\"components-color-palette__custom-color\"\n\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\taria-label={ __( 'Custom color picker' ) }\n\t\t\t\t\t\t\tstyle={ { background: value } }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ value }\n\t\t\t\t\t\t</button>\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<Component\n\t\t\t\tclearable={ clearable }\n\t\t\t\tclearColor={ clearColor }\n\t\t\t\tcolors={ colors }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tvalue={ value }\n\t\t\t\tactions={\n\t\t\t\t\t!! clearable && (\n\t\t\t\t\t\t<CircularOptionPicker.ButtonAction\n\t\t\t\t\t\t\tonClick={ clearColor }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Clear' ) }\n\t\t\t\t\t\t</CircularOptionPicker.ButtonAction>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t/>\n\t\t</VStack>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/color-palette/index.js"],"names":["map","colord","extend","namesPlugin","a11yPlugin","classnames","__","sprintf","isRTL","useCallback","useMemo","Dropdown","ColorPicker","CircularOptionPicker","VStack","ColorHeading","SinglePalette","className","clearColor","colors","onChange","value","actions","colorOptions","color","name","colordColor","fill","contrast","backgroundColor","MultiplePalettes","index","colorPalette","length","CustomColorPickerDropdown","isRenderedInSidebar","props","ColorPalette","clearable","disableCustomColors","enableAlpha","__experimentalHasMultipleOrigins","__experimentalIsRenderedInSidebar","undefined","Component","renderCustomColorPicker","dropdownPosition","popoverProps","__unstableForcePosition","isOpen","onToggle","background"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AACA,SAASC,MAAT,EAAiBC,MAAjB,QAA+B,QAA/B;AACA,OAAOC,WAAP,MAAwB,sBAAxB;AACA,OAAOC,UAAP,MAAuB,qBAAvB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,EAAT,EAAaC,OAAb,EAAsBC,KAAtB,QAAmC,iBAAnC;AACA,SAASC,WAAT,EAAsBC,OAAtB,QAAqC,oBAArC;AAEA;AACA;AACA;;AACA,OAAOC,QAAP,MAAqB,aAArB;AACA,SAASC,WAAT,QAA4B,iBAA5B;AACA,OAAOC,oBAAP,MAAiC,2BAAjC;AACA,SAASC,MAAT,QAAuB,YAAvB;AACA,SAASC,YAAT,QAA6B,UAA7B;AAEAb,MAAM,CAAE,CAAEC,WAAF,EAAeC,UAAf,CAAF,CAAN;;AAEA,SAASY,aAAT,OAOI;AAAA,MAPoB;AACvBC,IAAAA,SADuB;AAEvBC,IAAAA,UAFuB;AAGvBC,IAAAA,MAHuB;AAIvBC,IAAAA,QAJuB;AAKvBC,IAAAA,KALuB;AAMvBC,IAAAA;AANuB,GAOpB;AACH,QAAMC,YAAY,GAAGb,OAAO,CAAE,MAAM;AACnC,WAAOV,GAAG,CAAEmB,MAAF,EAAU,SAAuB;AAAA,UAArB;AAAEK,QAAAA,KAAF;AAASC,QAAAA;AAAT,OAAqB;AAC1C,YAAMC,WAAW,GAAGzB,MAAM,CAAEuB,KAAF,CAA1B;AAEA,aACC,cAAC,oBAAD,CAAsB,MAAtB;AACC,QAAA,GAAG,EAAGA,KADP;AAEC,QAAA,UAAU,EAAGH,KAAK,KAAKG,KAFxB;AAGC,QAAA,iBAAiB,EAChBH,KAAK,KAAKG,KAAV,GAC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,EAAGC,QAJZ;AAKC,IAAA,KAAK,EAAGC,KALT;AAMC,IAAA,OAAO,EACN,CAAC,CAAEiB,SAAH,IACC,cAAC,oBAAD,CAAsB,YAAtB;AACC,MAAA,OAAO,EAAGpB;AADX,OAGGZ,EAAE,CAAE,OAAF,CAHL;AARH,IA5BD,CADD;AA+CA","sourcesContent":["/**\n * External dependencies\n */\nimport { map } from 'lodash';\nimport { colord, extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\nimport a11yPlugin from 'colord/plugins/a11y';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf, isRTL } from '@wordpress/i18n';\nimport { useCallback, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Dropdown from '../dropdown';\nimport { ColorPicker } from '../color-picker';\nimport CircularOptionPicker from '../circular-option-picker';\nimport { VStack } from '../v-stack';\nimport { ColorHeading } from './styles';\n\nextend( [ namesPlugin, a11yPlugin ] );\n\nfunction SinglePalette( {\n\tclassName,\n\tclearColor,\n\tcolors,\n\tonChange,\n\tvalue,\n\tactions,\n} ) {\n\tconst colorOptions = useMemo( () => {\n\t\treturn map( colors, ( { color, name } ) => {\n\t\t\tconst colordColor = colord( color );\n\n\t\t\treturn (\n\t\t\t\t<CircularOptionPicker.Option\n\t\t\t\t\tkey={ color }\n\t\t\t\t\tisSelected={ value === color }\n\t\t\t\t\tselectedIconProps={\n\t\t\t\t\t\tvalue === color\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tfill:\n\t\t\t\t\t\t\t\t\t\tcolordColor.contrast() >\n\t\t\t\t\t\t\t\t\t\tcolordColor.contrast( '#000' )\n\t\t\t\t\t\t\t\t\t\t\t? '#fff'\n\t\t\t\t\t\t\t\t\t\t\t: '#000',\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t: {}\n\t\t\t\t\t}\n\t\t\t\t\ttooltipText={\n\t\t\t\t\t\tname ||\n\t\t\t\t\t\t// translators: %s: color hex code e.g: \"#f00\".\n\t\t\t\t\t\tsprintf( __( 'Color code: %s' ), color )\n\t\t\t\t\t}\n\t\t\t\t\tstyle={ { backgroundColor: color, color } }\n\t\t\t\t\tonClick={\n\t\t\t\t\t\tvalue === color ? clearColor : () => onChange( color )\n\t\t\t\t\t}\n\t\t\t\t\taria-label={\n\t\t\t\t\t\tname\n\t\t\t\t\t\t\t? // translators: %s: The name of the color e.g: \"vivid red\".\n\t\t\t\t\t\t\t sprintf( __( 'Color: %s' ), name )\n\t\t\t\t\t\t\t: // translators: %s: color hex code e.g: \"#f00\".\n\t\t\t\t\t\t\t sprintf( __( 'Color code: %s' ), color )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t);\n\t\t} );\n\t}, [ colors, value, onChange, clearColor ] );\n\treturn (\n\t\t<CircularOptionPicker\n\t\t\tclassName={ className }\n\t\t\toptions={ colorOptions }\n\t\t\tactions={ actions }\n\t\t/>\n\t);\n}\n\nfunction MultiplePalettes( {\n\tclassName,\n\tclearColor,\n\tcolors,\n\tonChange,\n\tvalue,\n\tactions,\n} ) {\n\treturn (\n\t\t<VStack spacing={ 3 } className={ className }>\n\t\t\t{ colors.map( ( { name, colors: colorPalette }, index ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<VStack spacing={ 2 } key={ index }>\n\t\t\t\t\t\t<ColorHeading>{ name }</ColorHeading>\n\t\t\t\t\t\t<SinglePalette\n\t\t\t\t\t\t\tclearColor={ clearColor }\n\t\t\t\t\t\t\tcolors={ colorPalette }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\tactions={\n\t\t\t\t\t\t\t\tcolors.length === index + 1 ? actions : null\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</VStack>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</VStack>\n\t);\n}\n\nexport function CustomColorPickerDropdown( { isRenderedInSidebar, ...props } ) {\n\treturn (\n\t\t<Dropdown\n\t\t\tcontentClassName={ classnames(\n\t\t\t\t'components-color-palette__custom-color-dropdown-content',\n\t\t\t\t{\n\t\t\t\t\t'is-rendered-in-sidebar': isRenderedInSidebar,\n\t\t\t\t}\n\t\t\t) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default function ColorPalette( {\n\tclearable = true,\n\tclassName,\n\tcolors,\n\tdisableCustomColors = false,\n\tenableAlpha,\n\tonChange,\n\tvalue,\n\t__experimentalHasMultipleOrigins = false,\n\t__experimentalIsRenderedInSidebar = false,\n} ) {\n\tconst clearColor = useCallback( () => onChange( undefined ), [ onChange ] );\n\tconst Component = __experimentalHasMultipleOrigins\n\t\t? MultiplePalettes\n\t\t: SinglePalette;\n\n\tconst renderCustomColorPicker = () => (\n\t\t<ColorPicker\n\t\t\tcolor={ value }\n\t\t\tonChange={ ( color ) => onChange( color ) }\n\t\t\tenableAlpha={ enableAlpha }\n\t\t/>\n\t);\n\n\tlet dropdownPosition;\n\tlet popoverProps;\n\tif ( __experimentalIsRenderedInSidebar ) {\n\t\tdropdownPosition = isRTL() ? 'bottom right' : 'bottom left';\n\t\tpopoverProps = { __unstableForcePosition: true };\n\t}\n\n\tconst colordColor = colord( value );\n\n\treturn (\n\t\t<VStack spacing={ 3 } className={ className }>\n\t\t\t{ ! disableCustomColors && (\n\t\t\t\t<CustomColorPickerDropdown\n\t\t\t\t\tposition={ dropdownPosition }\n\t\t\t\t\tisRenderedInSidebar={ __experimentalIsRenderedInSidebar }\n\t\t\t\t\trenderContent={ renderCustomColorPicker }\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\tclassName=\"components-color-palette__custom-color\"\n\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\taria-label={ __( 'Custom color picker' ) }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tbackground: value,\n\t\t\t\t\t\t\t\tcolor:\n\t\t\t\t\t\t\t\t\tcolordColor.contrast() >\n\t\t\t\t\t\t\t\t\tcolordColor.contrast( '#000' )\n\t\t\t\t\t\t\t\t\t\t? '#fff'\n\t\t\t\t\t\t\t\t\t\t: '#000',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ value }\n\t\t\t\t\t\t</button>\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<Component\n\t\t\t\tclearable={ clearable }\n\t\t\t\tclearColor={ clearColor }\n\t\t\t\tcolors={ colors }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tvalue={ value }\n\t\t\t\tactions={\n\t\t\t\t\t!! clearable && (\n\t\t\t\t\t\t<CircularOptionPicker.ButtonAction\n\t\t\t\t\t\t\tonClick={ clearColor }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Clear' ) }\n\t\t\t\t\t\t</CircularOptionPicker.ButtonAction>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t/>\n\t\t</VStack>\n\t);\n}\n"]}
|
|
@@ -18,6 +18,7 @@ import { Text } from '../text';
|
|
|
18
18
|
import { Flex, FlexItem } from '../flex';
|
|
19
19
|
import { Tooltip } from '../ui/tooltip';
|
|
20
20
|
import { space } from '../ui/utils/space';
|
|
21
|
+
import { COLORS } from '../utils/colors-values';
|
|
21
22
|
|
|
22
23
|
const ValueDisplay = _ref => {
|
|
23
24
|
let {
|
|
@@ -30,7 +31,7 @@ const ValueDisplay = _ref => {
|
|
|
30
31
|
isBlock: true,
|
|
31
32
|
display: "flex"
|
|
32
33
|
}, createElement(Text, {
|
|
33
|
-
color:
|
|
34
|
+
color: COLORS.ui.theme
|
|
34
35
|
}, abbreviation), createElement(Text, null, value));
|
|
35
36
|
}));
|
|
36
37
|
};
|
|
@@ -85,7 +86,7 @@ const HexDisplay = _ref5 => {
|
|
|
85
86
|
} = _ref5;
|
|
86
87
|
const colorWithoutHash = color.toHex().slice(1).toUpperCase();
|
|
87
88
|
return createElement(FlexItem, null, createElement(Text, {
|
|
88
|
-
color:
|
|
89
|
+
color: COLORS.ui.theme
|
|
89
90
|
}, "#"), createElement(Text, null, colorWithoutHash));
|
|
90
91
|
};
|
|
91
92
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/color-picker/color-display.tsx"],"names":["useCopyToClipboard","useState","useEffect","useRef","__","Text","Flex","FlexItem","Tooltip","space","ValueDisplay","values","map","value","abbreviation","HslDisplay","color","enableAlpha","h","s","l","a","toHsl","Math","floor","round","push","RgbDisplay","r","g","b","toRgb","HexDisplay","colorWithoutHash","toHex","slice","toUpperCase","getComponent","colorType","ColorDisplay","copiedColor","setCopiedColor","copyTimer","props","Component","copyRef","toHslString","toRgbString","current","clearTimeout","setTimeout","undefined","height"],"mappings":";;AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,kBAAT,QAAmC,oBAAnC;AACA,SAASC,QAAT,EAAmBC,SAAnB,EAA8BC,MAA9B,QAA4C,oBAA5C;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,SAASC,IAAT,QAAqB,SAArB;AACA,SAASC,IAAT,EAAeC,QAAf,QAA+B,SAA/B;AACA,SAASC,OAAT,QAAwB,eAAxB;AAEA,SAASC,KAAT,QAAsB,mBAAtB;;AAmBA,MAAMC,YAAY,GAAG;AAAA,MAAE;AAAEC,IAAAA;AAAF,GAAF;AAAA,SACpB,8BACGA,MAAM,CAACC,GAAP,CAAY,SAA+B;AAAA,QAA7B,CAAEC,KAAF,EAASC,YAAT,CAA6B;AAC5C,WACC,cAAC,QAAD;AAAU,MAAA,GAAG,EAAGA,YAAhB;AAA+B,MAAA,OAAO,MAAtC;AAAuC,MAAA,OAAO,EAAC;AAA/C,OACC,cAAC,IAAD;AAAM,MAAA,KAAK,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/color-picker/color-display.tsx"],"names":["useCopyToClipboard","useState","useEffect","useRef","__","Text","Flex","FlexItem","Tooltip","space","COLORS","ValueDisplay","values","map","value","abbreviation","ui","theme","HslDisplay","color","enableAlpha","h","s","l","a","toHsl","Math","floor","round","push","RgbDisplay","r","g","b","toRgb","HexDisplay","colorWithoutHash","toHex","slice","toUpperCase","getComponent","colorType","ColorDisplay","copiedColor","setCopiedColor","copyTimer","props","Component","copyRef","toHslString","toRgbString","current","clearTimeout","setTimeout","undefined","height"],"mappings":";;AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,kBAAT,QAAmC,oBAAnC;AACA,SAASC,QAAT,EAAmBC,SAAnB,EAA8BC,MAA9B,QAA4C,oBAA5C;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,SAASC,IAAT,QAAqB,SAArB;AACA,SAASC,IAAT,EAAeC,QAAf,QAA+B,SAA/B;AACA,SAASC,OAAT,QAAwB,eAAxB;AAEA,SAASC,KAAT,QAAsB,mBAAtB;AACA,SAASC,MAAT,QAAuB,wBAAvB;;AAmBA,MAAMC,YAAY,GAAG;AAAA,MAAE;AAAEC,IAAAA;AAAF,GAAF;AAAA,SACpB,8BACGA,MAAM,CAACC,GAAP,CAAY,SAA+B;AAAA,QAA7B,CAAEC,KAAF,EAASC,YAAT,CAA6B;AAC5C,WACC,cAAC,QAAD;AAAU,MAAA,GAAG,EAAGA,YAAhB;AAA+B,MAAA,OAAO,MAAtC;AAAuC,MAAA,OAAO,EAAC;AAA/C,OACC,cAAC,IAAD;AAAM,MAAA,KAAK,EAAGL,MAAM,CAACM,EAAP,CAAUC;AAAxB,OAAkCF,YAAlC,CADD,EAEC,cAAC,IAAD,QAAQD,KAAR,CAFD,CADD;AAMA,GAPC,CADH,CADoB;AAAA,CAArB;;AAaA,MAAMI,UAAU,GAAG,SAA4C;AAAA,MAA1C;A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YA,GAdgC,EAejC,MAAM;AACL,QAAKQ,SAAS,CAACM,OAAf,EAAyB;AACxBC,MAAAA,YAAY,CAAEP,SAAS,CAACM,OAAZ,CAAZ;AACA;;AACDP,IAAAA,cAAc,CAAEzB,KAAK,CAACkB,KAAN,EAAF,CAAd;AACAQ,IAAAA,SAAS,CAACM,OAAV,GAAoBE,UAAU,CAAE,MAAM;AACrCT,MAAAA,cAAc,CAAE,IAAF,CAAd;AACAC,MAAAA,SAAS,CAACM,OAAV,GAAoBG,SAApB;AACA,KAH6B,EAG3B,IAH2B,CAA9B;AAIA,GAxBgC,CAAlC;AA0BApD,EAAAA,SAAS,CAAE,MAAM;AAChB;AACA,WAAO,MAAM;AACZ,UAAK2C,SAAS,CAACM,OAAf,EAAyB;AACxBC,QAAAA,YAAY,CAAEP,SAAS,CAACM,OAAZ,CAAZ;AACA;AACD,KAJD;AAKA,GAPQ,EAON,EAPM,CAAT;AAQA,SACC,cAAC,OAAD;AACC,IAAA,OAAO,EACN,cAAC,IAAD;AAAM,MAAA,KAAK,EAAC;AAAZ,OACGR,WAAW,KAAKxB,KAAK,CAACkB,KAAN,EAAhB,GACCjC,EAAE,CAAE,SAAF,CADH,GAECA,EAAE,CAAE,MAAF,CAHN;AAFF,KASC,cAAC,IAAD;AACC,IAAA,OAAO,EAAC,YADT;AAEC,IAAA,GAAG,EAAGK,KAAK,CAAE,CAAF,CAFZ;AAGC,IAAA,GAAG,EAAGuC,OAHP;AAIC,IAAA,KAAK,EAAG;AAAEO,MAAAA,MAAM,EAAE;AAAV;AAJT,KAMC,cAAC,SAAD,EAAgBT,KAAhB,CAND,CATD,CADD;AAoBA,CA/DM","sourcesContent":["/**\n * External dependencies\n */\nimport { colord, extend, Colord } from 'colord';\n\n/**\n * WordPress dependencies\n */\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { useState, useEffect, useRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { Text } from '../text';\nimport { Flex, FlexItem } from '../flex';\nimport { Tooltip } from '../ui/tooltip';\nimport type { ColorType } from './types';\nimport { space } from '../ui/utils/space';\nimport { COLORS } from '../utils/colors-values';\n\ninterface ColorDisplayProps {\n\tcolor: Colord;\n\tcolorType: ColorType;\n\tenableAlpha: boolean;\n}\n\ninterface DisplayProps {\n\tcolor: Colord;\n\tenableAlpha: boolean;\n}\n\ntype Values = [ number, string ][];\n\ninterface ValueDisplayProps {\n\tvalues: Values;\n}\n\nconst ValueDisplay = ( { values }: ValueDisplayProps ) => (\n\t<>\n\t\t{ values.map( ( [ value, abbreviation ] ) => {\n\t\t\treturn (\n\t\t\t\t<FlexItem key={ abbreviation } isBlock display=\"flex\">\n\t\t\t\t\t<Text color={ COLORS.ui.theme }>{ abbreviation }</Text>\n\t\t\t\t\t<Text>{ value }</Text>\n\t\t\t\t</FlexItem>\n\t\t\t);\n\t\t} ) }\n\t</>\n);\n\nconst HslDisplay = ( { color, enableAlpha }: DisplayProps ) => {\n\tconst { h, s, l, a } = color.toHsl();\n\n\tconst values: Values = [\n\t\t[ Math.floor( h ), 'H' ],\n\t\t[ Math.round( s * 100 ), 'S' ],\n\t\t[ Math.round( l * 100 ), 'L' ],\n\t];\n\tif ( enableAlpha ) {\n\t\tvalues.push( [ Math.round( a * 100 ), 'A' ] );\n\t}\n\n\treturn <ValueDisplay values={ values } />;\n};\n\nconst RgbDisplay = ( { color, enableAlpha }: DisplayProps ) => {\n\tconst { r, g, b, a } = color.toRgb();\n\n\tconst values: Values = [\n\t\t[ r, 'R' ],\n\t\t[ g, 'G' ],\n\t\t[ b, 'B' ],\n\t];\n\n\tif ( enableAlpha ) {\n\t\tvalues.push( [ Math.round( a * 100 ), 'A' ] );\n\t}\n\n\treturn <ValueDisplay values={ values } />;\n};\n\nconst HexDisplay = ( { color }: DisplayProps ) => {\n\tconst colorWithoutHash = color.toHex().slice( 1 ).toUpperCase();\n\treturn (\n\t\t<FlexItem>\n\t\t\t<Text color={ COLORS.ui.theme }>#</Text>\n\t\t\t<Text>{ colorWithoutHash }</Text>\n\t\t</FlexItem>\n\t);\n};\n\nconst getComponent = ( colorType: ColorType ) => {\n\tswitch ( colorType ) {\n\t\tcase 'hsl':\n\t\t\treturn HslDisplay;\n\t\tcase 'rgb':\n\t\t\treturn RgbDisplay;\n\t\tdefault:\n\t\tcase 'hex':\n\t\t\treturn HexDisplay;\n\t}\n};\n\nexport const ColorDisplay = ( {\n\tcolor,\n\tcolorType,\n\tenableAlpha,\n}: ColorDisplayProps ) => {\n\tconst [ copiedColor, setCopiedColor ] = useState< string | null >( null );\n\tconst copyTimer = useRef< ReturnType< typeof setTimeout > | undefined >();\n\tconst props = { color, enableAlpha };\n\tconst Component = getComponent( colorType );\n\tconst copyRef = useCopyToClipboard< HTMLDivElement >(\n\t\t() => {\n\t\t\tswitch ( colorType ) {\n\t\t\t\tcase 'hsl': {\n\t\t\t\t\treturn color.toHslString();\n\t\t\t\t}\n\t\t\t\tcase 'rgb': {\n\t\t\t\t\treturn color.toRgbString();\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\tcase 'hex': {\n\t\t\t\t\treturn color.toHex();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t() => {\n\t\t\tif ( copyTimer.current ) {\n\t\t\t\tclearTimeout( copyTimer.current );\n\t\t\t}\n\t\t\tsetCopiedColor( color.toHex() );\n\t\t\tcopyTimer.current = setTimeout( () => {\n\t\t\t\tsetCopiedColor( null );\n\t\t\t\tcopyTimer.current = undefined;\n\t\t\t}, 3000 );\n\t\t}\n\t);\n\tuseEffect( () => {\n\t\t// clear copyTimer on component unmount.\n\t\treturn () => {\n\t\t\tif ( copyTimer.current ) {\n\t\t\t\tclearTimeout( copyTimer.current );\n\t\t\t}\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<Tooltip\n\t\t\tcontent={\n\t\t\t\t<Text color=\"white\">\n\t\t\t\t\t{ copiedColor === color.toHex()\n\t\t\t\t\t\t? __( 'Copied!' )\n\t\t\t\t\t\t: __( 'Copy' ) }\n\t\t\t\t</Text>\n\t\t\t}\n\t\t>\n\t\t\t<Flex\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t\tgap={ space( 1 ) }\n\t\t\t\tref={ copyRef }\n\t\t\t\tstyle={ { height: 30 } }\n\t\t\t>\n\t\t\t\t<Component { ...props } />\n\t\t\t</Flex>\n\t\t</Tooltip>\n\t);\n};\n"]}
|
|
@@ -17,6 +17,7 @@ import { Text } from '../text';
|
|
|
17
17
|
import { Spacer } from '../spacer';
|
|
18
18
|
import { space } from '../ui/utils/space';
|
|
19
19
|
import { ColorHexInputControl } from './styles';
|
|
20
|
+
import { COLORS } from '../utils/colors-values';
|
|
20
21
|
export const HexInput = _ref => {
|
|
21
22
|
let {
|
|
22
23
|
color,
|
|
@@ -34,7 +35,7 @@ export const HexInput = _ref => {
|
|
|
34
35
|
prefix: createElement(Spacer, {
|
|
35
36
|
as: Text,
|
|
36
37
|
marginLeft: space(3.5),
|
|
37
|
-
color:
|
|
38
|
+
color: COLORS.ui.theme,
|
|
38
39
|
lineHeight: 1
|
|
39
40
|
}, "#"),
|
|
40
41
|
value: color.toHex().slice(1).toUpperCase(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/color-picker/hex-input.tsx"],"names":["colord","__","Text","Spacer","space","ColorHexInputControl","HexInput","color","onChange","enableAlpha","handleValidate","value","isValid","Error","toHex","slice","toUpperCase","nextValue"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,QAA+B,QAA/B;AAEA;AACA;AACA;;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,SAASC,IAAT,QAAqB,SAArB;AACA,SAASC,MAAT,QAAuB,WAAvB;AACA,SAASC,KAAT,QAAsB,mBAAtB;AACA,SAASC,oBAAT,QAAqC,UAArC;AAQA,OAAO,MAAMC,QAAQ,GAAG,QAAuD;AAAA,MAArD;AAAEC,IAAAA,KAAF;AAASC,IAAAA,QAAT;AAAmBC,IAAAA;AAAnB,GAAqD;;AAC9E,QAAMC,cAAc,GAAKC,KAAF,IAAqB;AAC3C,QAAK,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/color-picker/hex-input.tsx"],"names":["colord","__","Text","Spacer","space","ColorHexInputControl","COLORS","HexInput","color","onChange","enableAlpha","handleValidate","value","isValid","Error","ui","theme","toHex","slice","toUpperCase","nextValue"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,QAA+B,QAA/B;AAEA;AACA;AACA;;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,SAASC,IAAT,QAAqB,SAArB;AACA,SAASC,MAAT,QAAuB,WAAvB;AACA,SAASC,KAAT,QAAsB,mBAAtB;AACA,SAASC,oBAAT,QAAqC,UAArC;AACA,SAASC,MAAT,QAAuB,wBAAvB;AAQA,OAAO,MAAMC,QAAQ,GAAG,QAAuD;AAAA,MAArD;AAAEC,IAAAA,KAAF;AAASC,IAAAA,QAAT;AAAmBC,IAAAA;AAAnB,GAAqD;;AAC9E,QAAMC,cAAc,GAAKC,KAAF,IAAqB;AAC3C,QAAK,CAAEZ,MAAM,CAAE,MAAMY,KAAR,CAAN,CAAsBC,OAAtB,EAAP,EAAyC;AACxC,YAAM,IAAIC,KAAJ,CAAW,yBAAX,CAAN;AACA;AACD,GAJD;;AAMA,SACC,cAAC,oBAAD;AACC,IAAA,MAAM,EACL,cAAC,MAAD;AACC,MAAA,EAAE,EAAGZ,IADN;AAEC,MAAA,UAAU,EAAGE,KAAK,CAAE,GAAF,CAFnB;AAGC,MAAA,KAAK,EAAGE,MAAM,CAACS,EAAP,CAAUC,KAHnB;AAIC,MAAA,UAAU,EAAG;AAJd,WAFF;AAWC,IAAA,KAAK,EAAGR,KAAK,CAACS,KAAN,GAAcC,KAAd,CAAqB,CAArB,EAAyBC,WAAzB,EAXT;AAYC,IAAA,QAAQ,EAAKC,SAAF,IAAiB;AAC3BX,MAAAA,QAAQ,CAAET,MAAM,CAAE,MAAMoB,SAAR,CAAR,CAAR;AACA,KAdF;AAeC,IAAA,UAAU,EAAGT,cAfd;AAgBC,IAAA,SAAS,EAAGD,WAAW,GAAG,CAAH,GAAO,CAhB/B;AAiBC,IAAA,KAAK,EAAGT,EAAE,CAAE,WAAF,CAjBX;AAkBC,IAAA,mBAAmB;AAlBpB,IADD;AAsBA,CA7BM","sourcesContent":["/**\n * External dependencies\n */\nimport { colord, Colord } from 'colord';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { Text } from '../text';\nimport { Spacer } from '../spacer';\nimport { space } from '../ui/utils/space';\nimport { ColorHexInputControl } from './styles';\nimport { COLORS } from '../utils/colors-values';\n\ninterface HexInputProps {\n\tcolor: Colord;\n\tonChange: ( nextColor: Colord ) => void;\n\tenableAlpha: boolean;\n}\n\nexport const HexInput = ( { color, onChange, enableAlpha }: HexInputProps ) => {\n\tconst handleValidate = ( value: string ) => {\n\t\tif ( ! colord( '#' + value ).isValid() ) {\n\t\t\tthrow new Error( 'Invalid hex color input' );\n\t\t}\n\t};\n\n\treturn (\n\t\t<ColorHexInputControl\n\t\t\tprefix={\n\t\t\t\t<Spacer\n\t\t\t\t\tas={ Text }\n\t\t\t\t\tmarginLeft={ space( 3.5 ) }\n\t\t\t\t\tcolor={ COLORS.ui.theme }\n\t\t\t\t\tlineHeight={ 1 }\n\t\t\t\t>\n\t\t\t\t\t#\n\t\t\t\t</Spacer>\n\t\t\t}\n\t\t\tvalue={ color.toHex().slice( 1 ).toUpperCase() }\n\t\t\tonChange={ ( nextValue ) => {\n\t\t\t\tonChange( colord( '#' + nextValue ) );\n\t\t\t} }\n\t\t\tonValidate={ handleValidate }\n\t\t\tmaxLength={ enableAlpha ? 8 : 6 }\n\t\t\tlabel={ __( 'Hex color' ) }\n\t\t\thideLabelFromVision\n\t\t/>\n\t);\n};\n"]}
|
|
@@ -8,6 +8,7 @@ import { Text } from '../text';
|
|
|
8
8
|
import { Spacer } from '../spacer';
|
|
9
9
|
import { space } from '../ui/utils/space';
|
|
10
10
|
import { RangeControl, NumberControlWrapper } from './styles';
|
|
11
|
+
import { COLORS } from '../utils/colors-values';
|
|
11
12
|
export const InputWithSlider = _ref => {
|
|
12
13
|
let {
|
|
13
14
|
min,
|
|
@@ -30,7 +31,7 @@ export const InputWithSlider = _ref => {
|
|
|
30
31
|
prefix: createElement(Spacer, {
|
|
31
32
|
as: Text,
|
|
32
33
|
paddingLeft: space(3.5),
|
|
33
|
-
color:
|
|
34
|
+
color: COLORS.ui.theme,
|
|
34
35
|
lineHeight: 1
|
|
35
36
|
}, abbreviation),
|
|
36
37
|
hideHTMLArrows: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/color-picker/input-with-slider.tsx"],"names":["HStack","Text","Spacer","space","RangeControl","NumberControlWrapper","InputWithSlider","min","max","label","abbreviation","onChange","value"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,QAAuB,YAAvB;AACA,SAASC,IAAT,QAAqB,SAArB;AACA,SAASC,MAAT,QAAuB,WAAvB;AACA,SAASC,KAAT,QAAsB,mBAAtB;AACA,SAASC,YAAT,EAAuBC,oBAAvB,QAAmD,UAAnD;AAWA,OAAO,MAAMC,eAAe,GAAG,QAOF;AAAA,MAPI;AAChCC,IAAAA,GADgC;AAEhCC,IAAAA,GAFgC;AAGhCC,IAAAA,KAHgC;AAIhCC,IAAAA,YAJgC;AAKhCC,IAAAA,QALgC;AAMhCC,IAAAA;AANgC,GAOJ;AAC5B,SACC,cAAC,MAAD;AAAQ,IAAA,EAAE,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/color-picker/input-with-slider.tsx"],"names":["HStack","Text","Spacer","space","RangeControl","NumberControlWrapper","COLORS","InputWithSlider","min","max","label","abbreviation","onChange","value","ui","theme"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,QAA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from '../text';\nimport { Spacer } from '../spacer';\nimport { space } from '../ui/utils/space';\nimport { RangeControl, NumberControlWrapper } from './styles';\nimport { COLORS } from '../utils/colors-values';\n\ninterface InputWithSliderProps {\n\tmin: number;\n\tmax: number;\n\tvalue: number;\n\tlabel: string;\n\tabbreviation: string;\n\tonChange: ( value: number ) => void;\n}\n\nexport const InputWithSlider = ( {\n\tmin,\n\tmax,\n\tlabel,\n\tabbreviation,\n\tonChange,\n\tvalue,\n}: InputWithSliderProps ) => {\n\treturn (\n\t\t<Spacer as={ HStack } spacing={ 4 }>\n\t\t\t<NumberControlWrapper\n\t\t\t\tmin={ min }\n\t\t\t\tmax={ max }\n\t\t\t\tlabel={ label }\n\t\t\t\thideLabelFromVision\n\t\t\t\tvalue={ value }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tprefix={\n\t\t\t\t\t<Spacer\n\t\t\t\t\t\tas={ Text }\n\t\t\t\t\t\tpaddingLeft={ space( 3.5 ) }\n\t\t\t\t\t\tcolor={ COLORS.ui.theme }\n\t\t\t\t\t\tlineHeight={ 1 }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ abbreviation }\n\t\t\t\t\t</Spacer>\n\t\t\t\t}\n\t\t\t\thideHTMLArrows\n\t\t\t/>\n\t\t\t<RangeControl\n\t\t\t\tlabel={ label }\n\t\t\t\thideLabelFromVision\n\t\t\t\tmin={ min }\n\t\t\t\tmax={ max }\n\t\t\t\tvalue={ value }\n\t\t\t\tonChange={ onChange }\n\t\t\t\twithInputField={ false }\n\t\t\t/>\n\t\t</Spacer>\n\t);\n};\n"]}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import { createElement, Fragment } from "@wordpress/element";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* External dependencies
|
|
6
|
+
*/
|
|
7
|
+
// eslint-disable-next-line no-restricted-imports
|
|
8
|
+
import React, { useEffect, useState } from 'react'; // eslint-disable-next-line no-restricted-imports
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* WordPress dependencies
|
|
12
|
+
*/
|
|
13
|
+
import { __ } from '@wordpress/i18n';
|
|
14
|
+
import { useCallback } from '@wordpress/element';
|
|
15
|
+
/**
|
|
16
|
+
* Internal dependencies
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import Modal from '../modal';
|
|
20
|
+
import { useContextSystem, contextConnect } from '../ui/context';
|
|
21
|
+
import { Flex } from '../flex';
|
|
22
|
+
import Button from '../button';
|
|
23
|
+
import { Text } from '../text';
|
|
24
|
+
import { VStack } from '../v-stack';
|
|
25
|
+
|
|
26
|
+
function ConfirmDialog(props, forwardedRef) {
|
|
27
|
+
const {
|
|
28
|
+
isOpen: isOpenProp,
|
|
29
|
+
onConfirm,
|
|
30
|
+
onCancel,
|
|
31
|
+
children,
|
|
32
|
+
...otherProps
|
|
33
|
+
} = useContextSystem(props, 'ConfirmDialog');
|
|
34
|
+
const [isOpen, setIsOpen] = useState();
|
|
35
|
+
const [shouldSelfClose, setShouldSelfClose] = useState();
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
// We only allow the dialog to close itself if `isOpenProp` is *not* set.
|
|
38
|
+
// If `isOpenProp` is set, then it (probably) means it's controlled by a
|
|
39
|
+
// parent component. In that case, `shouldSelfClose` might do more harm than
|
|
40
|
+
// good, so we disable it.
|
|
41
|
+
const isIsOpenSet = typeof isOpenProp !== 'undefined';
|
|
42
|
+
setIsOpen(isIsOpenSet ? isOpenProp : true);
|
|
43
|
+
setShouldSelfClose(!isIsOpenSet);
|
|
44
|
+
}, [isOpenProp]);
|
|
45
|
+
const handleEvent = useCallback(callback => event => {
|
|
46
|
+
callback === null || callback === void 0 ? void 0 : callback(event);
|
|
47
|
+
|
|
48
|
+
if (shouldSelfClose) {
|
|
49
|
+
setIsOpen(false);
|
|
50
|
+
}
|
|
51
|
+
}, [shouldSelfClose, setIsOpen]);
|
|
52
|
+
const handleEnter = useCallback(event => {
|
|
53
|
+
if (event.key === 'Enter') {
|
|
54
|
+
handleEvent(onConfirm)(event);
|
|
55
|
+
}
|
|
56
|
+
}, [handleEvent, onConfirm]);
|
|
57
|
+
|
|
58
|
+
const cancelLabel = __('Cancel');
|
|
59
|
+
|
|
60
|
+
const confirmLabel = __('OK');
|
|
61
|
+
|
|
62
|
+
return createElement(Fragment, null, isOpen && createElement(Modal, _extends({
|
|
63
|
+
onRequestClose: handleEvent(onCancel),
|
|
64
|
+
onKeyDown: handleEnter,
|
|
65
|
+
closeButtonLabel: cancelLabel,
|
|
66
|
+
isDismissible: true,
|
|
67
|
+
ref: forwardedRef,
|
|
68
|
+
__experimentalHideHeader: true
|
|
69
|
+
}, otherProps), createElement(VStack, {
|
|
70
|
+
spacing: 8
|
|
71
|
+
}, createElement(Text, null, children), createElement(Flex, {
|
|
72
|
+
direction: "row",
|
|
73
|
+
justify: "flex-end"
|
|
74
|
+
}, createElement(Button, {
|
|
75
|
+
variant: "tertiary",
|
|
76
|
+
onClick: handleEvent(onCancel)
|
|
77
|
+
}, cancelLabel), createElement(Button, {
|
|
78
|
+
variant: "primary",
|
|
79
|
+
onClick: handleEvent(onConfirm)
|
|
80
|
+
}, confirmLabel)))));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export default contextConnect(ConfirmDialog, 'ConfirmDialog');
|
|
84
|
+
//# sourceMappingURL=component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/confirm-dialog/component.tsx"],"names":["React","useEffect","useState","__","useCallback","Modal","useContextSystem","contextConnect","Flex","Button","Text","VStack","ConfirmDialog","props","forwardedRef","isOpen","isOpenProp","onConfirm","onCancel","children","otherProps","setIsOpen","shouldSelfClose","setShouldSelfClose","isIsOpenSet","handleEvent","callback","event","handleEnter","key","cancelLabel","confirmLabel"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA,OAAOA,KAAP,IAAgBC,SAAhB,EAA2BC,QAA3B,QAA2C,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,CAC5BuB,KAAF,IAA8C;AAC7C,QAAKA,KAAK,CAACE,GAAN,KAAc,OAAnB,EAA6B;AAC5BJ,MAAAA,WAAW,CAAER,SAAF,CAAX,CAA0BU,KAA1B;AACA;AACD,GAL6B,EAM9B,CAAEF,WAAF,EAAeR,SAAf,CAN8B,CAA/B;;AASA,QAAMa,WAAW,GAAG3B,EAAE,CAAE,QAAF,CAAtB;;AACA,QAAM4B,YAAY,GAAG5B,EAAE,CAAE,IAAF,CAAvB;;AAEA,SACC,8BACGY,MAAM,IACP,cAAC,KAAD;AACC,IAAA,cAAc,EAAGU,WAAW,CAAEP,QAAF,CAD7B;AAEC,IAAA,SAAS,EAAGU,WAFb;AAGC,IAAA,gBAAgB,EAAGE,WAHpB;AAIC,IAAA,aAAa,EAAG,IAJjB;AAKC,IAAA,GAAG,EAAGhB,YALP;AAMC,IAAA,wBAAwB;AANzB,KAOMM,UAPN,GASC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,cAAC,IAAD,QAAQD,QAAR,CADD,EAEC,cAAC,IAAD;AAAM,IAAA,SAAS,EAAC,KAAhB;AAAsB,IAAA,OAAO,EAAC;AAA9B,KACC,cAAC,MAAD;AACC,IAAA,OAAO,EAAC,UADT;AAEC,IAAA,OAAO,EAAGM,WAAW,CAAEP,QAAF;AAFtB,KAIGY,WAJH,CADD,EAOC,cAAC,MAAD;AACC,IAAA,OAAO,EAAC,SADT;AAEC,IAAA,OAAO,EAAGL,WAAW,CAAER,SAAF;AAFtB,KAIGc,YAJH,CAPD,CAFD,CATD,CAFF,CADD;AAiCA;;AAED,eAAexB,cAAc,CAAEK,aAAF,EAAiB,eAAjB,CAA7B","sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport React, { useEffect, useState } from 'react';\n// eslint-disable-next-line no-restricted-imports\nimport type { Ref, KeyboardEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Modal from '../modal';\nimport type { OwnProps, DialogInputEvent } from './types';\nimport {\n\tuseContextSystem,\n\tcontextConnect,\n\tWordPressComponentProps,\n} from '../ui/context';\nimport { Flex } from '../flex';\nimport Button from '../button';\nimport { Text } from '../text';\nimport { VStack } from '../v-stack';\n\nfunction ConfirmDialog(\n\tprops: WordPressComponentProps< OwnProps, 'div', false >,\n\tforwardedRef: Ref< any >\n) {\n\tconst {\n\t\tisOpen: isOpenProp,\n\t\tonConfirm,\n\t\tonCancel,\n\t\tchildren,\n\t\t...otherProps\n\t} = useContextSystem( props, 'ConfirmDialog' );\n\n\tconst [ isOpen, setIsOpen ] = useState< boolean >();\n\tconst [ shouldSelfClose, setShouldSelfClose ] = useState< boolean >();\n\n\tuseEffect( () => {\n\t\t// We only allow the dialog to close itself if `isOpenProp` is *not* set.\n\t\t// If `isOpenProp` is set, then it (probably) means it's controlled by a\n\t\t// parent component. In that case, `shouldSelfClose` might do more harm than\n\t\t// good, so we disable it.\n\t\tconst isIsOpenSet = typeof isOpenProp !== 'undefined';\n\t\tsetIsOpen( isIsOpenSet ? isOpenProp : true );\n\t\tsetShouldSelfClose( ! isIsOpenSet );\n\t}, [ isOpenProp ] );\n\n\tconst handleEvent = useCallback(\n\t\t( callback?: ( event: DialogInputEvent ) => void ) => (\n\t\t\tevent: DialogInputEvent\n\t\t) => {\n\t\t\tcallback?.( event );\n\t\t\tif ( shouldSelfClose ) {\n\t\t\t\tsetIsOpen( false );\n\t\t\t}\n\t\t},\n\t\t[ shouldSelfClose, setIsOpen ]\n\t);\n\n\tconst handleEnter = useCallback(\n\t\t( event: KeyboardEvent< HTMLDivElement > ) => {\n\t\t\tif ( event.key === 'Enter' ) {\n\t\t\t\thandleEvent( onConfirm )( event );\n\t\t\t}\n\t\t},\n\t\t[ handleEvent, onConfirm ]\n\t);\n\n\tconst cancelLabel = __( 'Cancel' );\n\tconst confirmLabel = __( 'OK' );\n\n\treturn (\n\t\t<>\n\t\t\t{ isOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\tonRequestClose={ handleEvent( onCancel ) }\n\t\t\t\t\tonKeyDown={ handleEnter }\n\t\t\t\t\tcloseButtonLabel={ cancelLabel }\n\t\t\t\t\tisDismissible={ true }\n\t\t\t\t\tref={ forwardedRef }\n\t\t\t\t\t__experimentalHideHeader\n\t\t\t\t\t{ ...otherProps }\n\t\t\t\t>\n\t\t\t\t\t<VStack spacing={ 8 }>\n\t\t\t\t\t\t<Text>{ children }</Text>\n\t\t\t\t\t\t<Flex direction=\"row\" justify=\"flex-end\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\tonClick={ handleEvent( onCancel ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ cancelLabel }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\tonClick={ handleEvent( onConfirm ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ confirmLabel }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</Flex>\n\t\t\t\t\t</VStack>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default contextConnect( ConfirmDialog, 'ConfirmDialog' );\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/confirm-dialog/index.tsx"],"names":["ConfirmDialog"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,aAAP,MAA0B,aAA1B;AAEA,SAASA,aAAT","sourcesContent":["/**\n * Internal dependencies\n */\nimport ConfirmDialog from './component';\n\nexport { ConfirmDialog };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/custom-gradient-bar/constants.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/custom-gradient-bar/constants.js"],"names":["GRADIENT_MARKERS_WIDTH","INSERT_POINT_WIDTH","MINIMUM_ABSOLUTE_LEFT_POSITION","MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT","MINIMUM_DISTANCE_BETWEEN_POINTS","MINIMUM_SIGNIFICANT_MOVE","KEYBOARD_CONTROL_POINT_VARIATION","MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_MARKER"],"mappings":"AAAA,OAAO,MAAMA,sBAAsB,GAAG,EAA/B;AACP,OAAO,MAAMC,kBAAkB,GAAG,EAA3B;AACP,OAAO,MAAMC,8BAA8B,GAAG,CAAvC;AACP,OAAO,MAAMC,2CAA2C,GAAG,EAApD;AACP,OAAO,MAAMC,+BAA+B,GAAG,CAAxC;AACP,OAAO,MAAMC,wBAAwB,GAAG,CAAjC;AAEP,OAAO,MAAMC,gCAAgC,GAAGH,2CAAzC;AACP,OAAO,MAAMI,4CAA4C,GACxD,CAAEN,kBAAkB,GAAGD,sBAAvB,IAAkD,CAD5C","sourcesContent":["export const GRADIENT_MARKERS_WIDTH = 16;\nexport const INSERT_POINT_WIDTH = 16;\nexport const MINIMUM_ABSOLUTE_LEFT_POSITION = 5;\nexport const MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT = 10;\nexport const MINIMUM_DISTANCE_BETWEEN_POINTS = 0;\nexport const MINIMUM_SIGNIFICANT_MOVE = 5;\n\nexport const KEYBOARD_CONTROL_POINT_VARIATION = MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT;\nexport const MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_MARKER =\n\t( INSERT_POINT_WIDTH + GRADIENT_MARKERS_WIDTH ) / 2;\n"]}
|