@wordpress/components 39.0.0 → 40.1.1-next.v.202608281122.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 +79 -0
- package/CONTRIBUTING.md +7 -8
- package/build/base-control/styles/base-control-styles.cjs +150 -45
- package/build/base-control/styles/base-control-styles.cjs.map +4 -4
- package/build/border-box-control/border-box-control/hook.cjs +88 -23
- package/build/border-box-control/border-box-control/hook.cjs.map +3 -3
- package/build/border-box-control/border-box-control-linked-button/hook.cjs +87 -8
- package/build/border-box-control/border-box-control-linked-button/hook.cjs.map +4 -4
- package/build/border-box-control/border-box-control-split-controls/hook.cjs +89 -16
- package/build/border-box-control/border-box-control-split-controls/hook.cjs.map +4 -4
- package/build/border-box-control/border-box-control-visualizer/hook.cjs +108 -8
- package/build/border-box-control/border-box-control-visualizer/hook.cjs.map +4 -4
- package/build/border-control/border-control/hook.cjs +89 -14
- package/build/border-control/border-control/hook.cjs.map +4 -4
- package/build/border-control/border-control-dropdown/component.cjs +2 -4
- package/build/border-control/border-control-dropdown/component.cjs.map +2 -2
- package/build/border-control/border-control-dropdown/hook.cjs +103 -27
- package/build/border-control/border-control-dropdown/hook.cjs.map +4 -4
- package/build/box-control/box-input-control.cjs +102 -10
- package/build/box-control/box-input-control.cjs.map +4 -4
- package/build/box-control/index.cjs +95 -5
- package/build/box-control/index.cjs.map +4 -4
- package/build/button/index.cjs +10 -3
- package/build/button/index.cjs.map +2 -2
- package/build/card/card-body/hook.cjs +4 -2
- package/build/card/card-body/hook.cjs.map +2 -2
- package/build/card/styles.cjs +31 -16
- package/build/card/styles.cjs.map +2 -2
- package/build/circular-option-picker/circular-option-picker-option.cjs +4 -5
- package/build/circular-option-picker/circular-option-picker-option.cjs.map +2 -2
- package/build/circular-option-picker/circular-option-picker.cjs +24 -6
- package/build/circular-option-picker/circular-option-picker.cjs.map +2 -2
- package/build/circular-option-picker/index.cjs +6 -2
- package/build/circular-option-picker/index.cjs.map +2 -2
- package/build/circular-option-picker/utils.cjs +38 -8
- package/build/circular-option-picker/utils.cjs.map +3 -3
- package/build/color-palette/index.cjs +103 -10
- package/build/color-palette/index.cjs.map +3 -3
- package/build/combobox-control/index.cjs +87 -2
- package/build/combobox-control/index.cjs.map +3 -3
- package/build/confirm-dialog/component.cjs +5 -1
- package/build/confirm-dialog/component.cjs.map +2 -2
- package/build/content-editable-control/index.cjs +1 -1
- package/build/content-editable-control/index.cjs.map +2 -2
- package/build/context/context-system-provider.cjs +1 -1
- package/build/context/context-system-provider.cjs.map +3 -3
- package/build/custom-gradient-picker/gradient-bar/control-points.cjs +14 -2
- package/build/custom-gradient-picker/gradient-bar/control-points.cjs.map +2 -2
- package/build/custom-gradient-picker/gradient-bar/index.cjs +2 -0
- package/build/custom-gradient-picker/gradient-bar/index.cjs.map +2 -2
- package/build/dropdown/dropdown-content-wrapper.cjs +102 -3
- package/build/dropdown/dropdown-content-wrapper.cjs.map +4 -4
- package/build/duotone-picker/custom-duotone-bar.cjs +1 -0
- package/build/duotone-picker/custom-duotone-bar.cjs.map +2 -2
- package/build/duotone-picker/duotone-picker.cjs +23 -14
- package/build/duotone-picker/duotone-picker.cjs.map +2 -2
- package/build/focal-point-picker/index.cjs +5 -3
- package/build/focal-point-picker/index.cjs.map +2 -2
- package/build/gradient-picker/index.cjs +105 -11
- package/build/gradient-picker/index.cjs.map +3 -3
- package/build/input-control/input-field.cjs +1 -0
- package/build/input-control/input-field.cjs.map +2 -2
- package/build/input-control/styles/input-control-styles.cjs +22 -22
- package/build/input-control/styles/input-control-styles.cjs.map +2 -2
- package/build/modal/index.cjs +1 -0
- package/build/modal/index.cjs.map +2 -2
- package/build/palette-edit/index.cjs +208 -33
- package/build/palette-edit/index.cjs.map +3 -3
- package/build/private-apis.cjs +1 -6
- package/build/private-apis.cjs.map +2 -2
- package/build/progress-bar/index.cjs +95 -7
- package/build/progress-bar/index.cjs.map +4 -4
- package/build/radio-control/index.cjs +1 -0
- package/build/radio-control/index.cjs.map +2 -2
- package/build/resizable-box/resize-tooltip/index.cjs +91 -4
- package/build/resizable-box/resize-tooltip/index.cjs.map +3 -3
- package/build/resizable-box/resize-tooltip/label.cjs +103 -6
- package/build/resizable-box/resize-tooltip/label.cjs.map +4 -4
- package/build/scrollable/hook.cjs +93 -6
- package/build/scrollable/hook.cjs.map +4 -4
- package/build/snackbar/index.cjs +8 -5
- package/build/snackbar/index.cjs.map +2 -2
- package/build/textarea-control/index.cjs +87 -3
- package/build/textarea-control/index.cjs.map +3 -3
- package/build/toggle-group-control/toggle-group-control/component.cjs +1 -1
- package/build/toggle-group-control/toggle-group-control/component.cjs.map +2 -2
- package/build/toggle-group-control/toggle-group-control-option-base/component.cjs +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/component.cjs.map +2 -2
- package/build/tools-panel/tools-panel-item/hook.cjs +2 -2
- package/build/tools-panel/tools-panel-item/hook.cjs.map +2 -2
- package/build/utils/config-values.cjs +0 -3
- package/build/utils/config-values.cjs.map +2 -2
- package/build/validated-form-controls/components/content-editable-control.cjs +3 -2
- package/build/validated-form-controls/components/content-editable-control.cjs.map +2 -2
- package/build/validated-form-controls/components/custom-select-control.cjs +3 -2
- package/build/validated-form-controls/components/custom-select-control.cjs.map +2 -2
- package/build/validated-form-controls/components/index.cjs +1 -9
- package/build/validated-form-controls/components/index.cjs.map +2 -2
- package/build/validated-form-controls/components/input-control.cjs +9 -2
- package/build/validated-form-controls/components/input-control.cjs.map +3 -3
- package/build/validated-form-controls/components/range-control.cjs +3 -2
- package/build/validated-form-controls/components/range-control.cjs.map +2 -2
- package/build/validated-form-controls/components/textarea-control.cjs +9 -2
- package/build/validated-form-controls/components/textarea-control.cjs.map +3 -3
- package/build/validated-form-controls/index.cjs +1 -3
- package/build/validated-form-controls/index.cjs.map +2 -2
- package/build/z-stack/component.cjs +105 -7
- package/build/z-stack/component.cjs.map +4 -4
- package/build-module/base-control/styles/base-control-styles.mjs +151 -46
- package/build-module/base-control/styles/base-control-styles.mjs.map +3 -3
- package/build-module/border-box-control/border-box-control/hook.mjs +89 -14
- package/build-module/border-box-control/border-box-control/hook.mjs.map +3 -3
- package/build-module/border-box-control/border-box-control-linked-button/hook.mjs +87 -8
- package/build-module/border-box-control/border-box-control-linked-button/hook.mjs.map +3 -3
- package/build-module/border-box-control/border-box-control-split-controls/hook.mjs +89 -16
- package/build-module/border-box-control/border-box-control-split-controls/hook.mjs.map +3 -3
- package/build-module/border-box-control/border-box-control-visualizer/hook.mjs +108 -8
- package/build-module/border-box-control/border-box-control-visualizer/hook.mjs.map +3 -3
- package/build-module/border-control/border-control/hook.mjs +90 -15
- package/build-module/border-control/border-control/hook.mjs.map +3 -3
- package/build-module/border-control/border-control-dropdown/component.mjs +2 -4
- package/build-module/border-control/border-control-dropdown/component.mjs.map +2 -2
- package/build-module/border-control/border-control-dropdown/hook.mjs +103 -27
- package/build-module/border-control/border-control-dropdown/hook.mjs.map +3 -3
- package/build-module/box-control/box-input-control.mjs +102 -10
- package/build-module/box-control/box-input-control.mjs.map +3 -3
- package/build-module/box-control/index.mjs +95 -5
- package/build-module/box-control/index.mjs.map +3 -3
- package/build-module/button/index.mjs +11 -4
- package/build-module/button/index.mjs.map +2 -2
- package/build-module/card/card-body/hook.mjs +4 -2
- package/build-module/card/card-body/hook.mjs.map +2 -2
- package/build-module/card/styles.mjs +30 -16
- package/build-module/card/styles.mjs.map +2 -2
- package/build-module/circular-option-picker/circular-option-picker-option.mjs +4 -5
- package/build-module/circular-option-picker/circular-option-picker-option.mjs.map +2 -2
- package/build-module/circular-option-picker/circular-option-picker.mjs +24 -6
- package/build-module/circular-option-picker/circular-option-picker.mjs.map +2 -2
- package/build-module/circular-option-picker/index.mjs +4 -2
- package/build-module/circular-option-picker/index.mjs.map +2 -2
- package/build-module/circular-option-picker/utils.mjs +25 -7
- package/build-module/circular-option-picker/utils.mjs.map +2 -2
- package/build-module/color-palette/index.mjs +104 -11
- package/build-module/color-palette/index.mjs.map +3 -3
- package/build-module/combobox-control/index.mjs +88 -3
- package/build-module/combobox-control/index.mjs.map +3 -3
- package/build-module/confirm-dialog/component.mjs +5 -1
- package/build-module/confirm-dialog/component.mjs.map +2 -2
- package/build-module/content-editable-control/index.mjs +1 -1
- package/build-module/content-editable-control/index.mjs.map +2 -2
- package/build-module/context/context-system-provider.mjs +1 -1
- package/build-module/context/context-system-provider.mjs.map +3 -3
- package/build-module/custom-gradient-picker/gradient-bar/control-points.mjs +14 -2
- package/build-module/custom-gradient-picker/gradient-bar/control-points.mjs.map +2 -2
- package/build-module/custom-gradient-picker/gradient-bar/index.mjs +2 -0
- package/build-module/custom-gradient-picker/gradient-bar/index.mjs.map +2 -2
- package/build-module/dropdown/dropdown-content-wrapper.mjs +92 -3
- package/build-module/dropdown/dropdown-content-wrapper.mjs.map +3 -3
- package/build-module/duotone-picker/custom-duotone-bar.mjs +1 -0
- package/build-module/duotone-picker/custom-duotone-bar.mjs.map +2 -2
- package/build-module/duotone-picker/duotone-picker.mjs +24 -15
- package/build-module/duotone-picker/duotone-picker.mjs.map +2 -2
- package/build-module/focal-point-picker/index.mjs +5 -3
- package/build-module/focal-point-picker/index.mjs.map +2 -2
- package/build-module/gradient-picker/index.mjs +106 -12
- package/build-module/gradient-picker/index.mjs.map +3 -3
- package/build-module/input-control/input-field.mjs +1 -0
- package/build-module/input-control/input-field.mjs.map +2 -2
- package/build-module/input-control/styles/input-control-styles.mjs +22 -22
- package/build-module/input-control/styles/input-control-styles.mjs.map +2 -2
- package/build-module/modal/index.mjs +1 -0
- package/build-module/modal/index.mjs.map +2 -2
- package/build-module/palette-edit/index.mjs +209 -34
- package/build-module/palette-edit/index.mjs.map +2 -2
- package/build-module/private-apis.mjs +2 -7
- package/build-module/private-apis.mjs.map +2 -2
- package/build-module/progress-bar/index.mjs +95 -7
- package/build-module/progress-bar/index.mjs.map +3 -3
- package/build-module/radio-control/index.mjs +1 -0
- package/build-module/radio-control/index.mjs.map +2 -2
- package/build-module/resizable-box/resize-tooltip/index.mjs +91 -4
- package/build-module/resizable-box/resize-tooltip/index.mjs.map +3 -3
- package/build-module/resizable-box/resize-tooltip/label.mjs +93 -6
- package/build-module/resizable-box/resize-tooltip/label.mjs.map +3 -3
- package/build-module/scrollable/hook.mjs +93 -6
- package/build-module/scrollable/hook.mjs.map +4 -4
- package/build-module/snackbar/index.mjs +8 -5
- package/build-module/snackbar/index.mjs.map +2 -2
- package/build-module/textarea-control/index.mjs +87 -3
- package/build-module/textarea-control/index.mjs.map +3 -3
- package/build-module/toggle-group-control/toggle-group-control/component.mjs +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.mjs.map +2 -2
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.mjs +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.mjs.map +2 -2
- package/build-module/tools-panel/tools-panel-item/hook.mjs +2 -2
- package/build-module/tools-panel/tools-panel-item/hook.mjs.map +2 -2
- package/build-module/utils/config-values.mjs +0 -3
- package/build-module/utils/config-values.mjs.map +2 -2
- package/build-module/validated-form-controls/components/content-editable-control.mjs +2 -1
- package/build-module/validated-form-controls/components/content-editable-control.mjs.map +2 -2
- package/build-module/validated-form-controls/components/custom-select-control.mjs +2 -1
- package/build-module/validated-form-controls/components/custom-select-control.mjs.map +2 -2
- package/build-module/validated-form-controls/components/index.mjs +0 -4
- package/build-module/validated-form-controls/components/index.mjs.map +2 -2
- package/build-module/validated-form-controls/components/input-control.mjs +8 -1
- package/build-module/validated-form-controls/components/input-control.mjs.map +2 -2
- package/build-module/validated-form-controls/components/range-control.mjs +2 -1
- package/build-module/validated-form-controls/components/range-control.mjs.map +2 -2
- package/build-module/validated-form-controls/components/textarea-control.mjs +8 -1
- package/build-module/validated-form-controls/components/textarea-control.mjs.map +2 -2
- package/build-module/validated-form-controls/index.mjs +0 -1
- package/build-module/validated-form-controls/index.mjs.map +2 -2
- package/build-module/z-stack/component.mjs +95 -7
- package/build-module/z-stack/component.mjs.map +3 -3
- package/build-style/style-rtl.css +79 -134
- package/build-style/style.css +79 -134
- package/build-types/base-control/styles/base-control-styles.d.ts +21 -20
- package/build-types/base-control/styles/base-control-styles.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +863 -1
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
- package/build-types/border-box-control/types.d.ts +6 -2
- package/build-types/border-box-control/types.d.ts.map +1 -1
- package/build-types/border-control/border-control/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/hook.d.ts +4 -2
- package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
- package/build-types/box-control/box-input-control.d.ts.map +1 -1
- package/build-types/box-control/index.d.ts.map +1 -1
- package/build-types/button/index.d.ts.map +1 -1
- package/build-types/card/styles.d.ts +2 -1
- package/build-types/card/styles.d.ts.map +1 -1
- package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
- package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
- package/build-types/circular-option-picker/index.d.ts +1 -1
- package/build-types/circular-option-picker/index.d.ts.map +1 -1
- package/build-types/circular-option-picker/types.d.ts +34 -26
- package/build-types/circular-option-picker/types.d.ts.map +1 -1
- package/build-types/circular-option-picker/utils.d.ts +9 -5
- package/build-types/circular-option-picker/utils.d.ts.map +1 -1
- package/build-types/color-palette/index.d.ts.map +1 -1
- package/build-types/color-palette/types.d.ts +23 -3
- package/build-types/color-palette/types.d.ts.map +1 -1
- package/build-types/combobox-control/index.d.ts.map +1 -1
- package/build-types/combobox-control/types.d.ts +4 -2
- package/build-types/combobox-control/types.d.ts.map +1 -1
- package/build-types/confirm-dialog/component.d.ts.map +1 -1
- package/build-types/confirm-dialog/types.d.ts +11 -0
- package/build-types/confirm-dialog/types.d.ts.map +1 -1
- package/build-types/context/context-system-provider.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts +1 -1
- package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/gradient-bar/index.d.ts +1 -1
- package/build-types/custom-gradient-picker/gradient-bar/index.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/types.d.ts +10 -0
- package/build-types/custom-gradient-picker/types.d.ts.map +1 -1
- package/build-types/dropdown/dropdown-content-wrapper.d.ts.map +1 -1
- package/build-types/duotone-picker/custom-duotone-bar.d.ts.map +1 -1
- package/build-types/duotone-picker/duotone-picker.d.ts +1 -1
- package/build-types/duotone-picker/duotone-picker.d.ts.map +1 -1
- package/build-types/duotone-picker/types.d.ts +43 -4
- package/build-types/duotone-picker/types.d.ts.map +1 -1
- package/build-types/focal-point-picker/index.d.ts.map +1 -1
- package/build-types/gradient-picker/index.d.ts.map +1 -1
- package/build-types/gradient-picker/types.d.ts +22 -3
- package/build-types/gradient-picker/types.d.ts.map +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.map +1 -1
- package/build-types/modal/index.d.ts.map +1 -1
- package/build-types/palette-edit/index.d.ts +8 -5
- package/build-types/palette-edit/index.d.ts.map +1 -1
- package/build-types/palette-edit/types.d.ts +47 -8
- package/build-types/palette-edit/types.d.ts.map +1 -1
- package/build-types/popover/types.d.ts +6 -2
- package/build-types/popover/types.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/progress-bar/index.d.ts.map +1 -1
- package/build-types/radio-control/index.d.ts.map +1 -1
- package/build-types/radio-control/types.d.ts +6 -0
- package/build-types/radio-control/types.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/index.d.ts +4 -5
- package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/label.d.ts.map +1 -1
- package/build-types/scrollable/hook.d.ts.map +1 -1
- package/build-types/snackbar/index.d.ts.map +1 -1
- package/build-types/textarea-control/index.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/utils/config-values.d.ts +0 -3
- package/build-types/validated-form-controls/components/content-editable-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/custom-select-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/index.d.ts +0 -4
- package/build-types/validated-form-controls/components/index.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/input-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/range-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/textarea-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/index.d.ts +0 -1
- package/build-types/validated-form-controls/index.d.ts.map +1 -1
- package/build-types/z-stack/component.d.ts.map +1 -1
- package/package.json +30 -30
- package/src/animate/stories/index.story.tsx +0 -10
- package/src/base-control/stories/index.story.tsx +1 -1
- package/src/base-control/styles/base-control-styles.tsx +115 -0
- package/src/base-control/styles/style.module.scss +39 -0
- package/src/border-box-control/border-box-control/README.md +2 -2
- package/src/border-box-control/border-box-control/hook.ts +5 -16
- package/src/border-box-control/border-box-control-linked-button/hook.ts +6 -10
- package/src/border-box-control/border-box-control-split-controls/hook.ts +11 -20
- package/src/border-box-control/border-box-control-visualizer/hook.ts +37 -11
- package/src/border-box-control/stories/index.story.tsx +1 -1
- package/src/border-box-control/style.module.scss +43 -0
- package/src/border-box-control/types.ts +6 -2
- package/src/border-control/border-control/hook.ts +10 -19
- package/src/border-control/border-control-dropdown/component.tsx +6 -8
- package/src/border-control/border-control-dropdown/hook.ts +23 -32
- package/src/border-control/style.module.scss +93 -0
- package/src/border-control/test/{index.js → index.jsx} +63 -31
- package/src/box-control/box-input-control.tsx +31 -16
- package/src/box-control/index.tsx +15 -12
- package/src/box-control/style.module.scss +28 -0
- package/src/box-control/test/index.tsx +161 -0
- package/src/button/index.tsx +32 -10
- package/src/button/test/index.tsx +51 -0
- package/src/card/card-body/hook.ts +2 -2
- package/src/card/styles.ts +11 -1
- package/src/card/test/__snapshots__/index.tsx.snap +27 -27
- package/src/circular-option-picker/README.md +8 -4
- package/src/circular-option-picker/circular-option-picker-option.tsx +26 -16
- package/src/circular-option-picker/circular-option-picker.tsx +47 -14
- package/src/circular-option-picker/index.tsx +5 -1
- package/src/circular-option-picker/stories/index.story.tsx +3 -3
- package/src/circular-option-picker/test/index.tsx +152 -3
- package/src/circular-option-picker/types.ts +38 -32
- package/src/circular-option-picker/utils.tsx +35 -5
- package/src/clipboard-button/index.tsx +1 -1
- package/src/color-palette/README.md +11 -7
- package/src/color-palette/index.tsx +28 -14
- package/src/color-palette/stories/index.story.tsx +5 -0
- package/src/color-palette/style.module.scss +12 -0
- package/src/color-palette/test/index.tsx +80 -5
- package/src/color-palette/types.ts +23 -3
- package/src/color-picker/stories/index.story.tsx +0 -5
- package/src/combobox-control/README.md +1 -1
- package/src/combobox-control/index.tsx +4 -4
- package/src/combobox-control/style.module.scss +6 -0
- package/src/combobox-control/style.scss +1 -1
- package/src/combobox-control/types.ts +4 -2
- package/src/composite/legacy/stories/index.story.tsx +10 -10
- package/src/composite/stories/index.story.tsx +0 -5
- package/src/confirm-dialog/README.md +16 -0
- package/src/confirm-dialog/component.tsx +7 -1
- package/src/confirm-dialog/test/index.tsx +41 -0
- package/src/confirm-dialog/types.ts +11 -0
- package/src/content-editable-control/style.module.scss +0 -1
- package/src/context/{context-system-provider.js → context-system-provider.jsx} +0 -1
- package/src/context/test/__snapshots__/{context-system-provider.js.snap → context-system-provider.jsx.snap} +3 -3
- package/src/custom-gradient-picker/gradient-bar/control-points.tsx +24 -3
- package/src/custom-gradient-picker/gradient-bar/index.tsx +2 -0
- package/src/custom-gradient-picker/test/index.tsx +134 -0
- package/src/custom-gradient-picker/types.ts +10 -0
- package/src/dropdown/dropdown-content-wrapper.tsx +17 -7
- package/src/dropdown/stories/index.story.tsx +0 -5
- package/src/dropdown/style.module.scss +25 -0
- package/src/dropdown/test/index.tsx +51 -0
- package/src/duotone-picker/README.md +21 -6
- package/src/duotone-picker/custom-duotone-bar.tsx +1 -0
- package/src/duotone-picker/duotone-picker.tsx +79 -54
- package/src/duotone-picker/stories/duotone-picker.story.tsx +63 -15
- package/src/duotone-picker/test/custom-duotone-bar.tsx +114 -0
- package/src/duotone-picker/test/index.tsx +346 -0
- package/src/duotone-picker/types.ts +48 -4
- package/src/focal-point-picker/index.tsx +6 -2
- package/src/focal-point-picker/stories/index.story.tsx +15 -0
- package/src/focal-point-picker/test/index.tsx +31 -0
- package/src/form-toggle/stories/index.story.tsx +3 -0
- package/src/form-token-field/style.scss +7 -1
- package/src/gradient-picker/README.md +19 -10
- package/src/gradient-picker/index.tsx +43 -16
- package/src/gradient-picker/stories/index.story.tsx +5 -0
- package/src/gradient-picker/test/index.tsx +84 -0
- package/src/gradient-picker/types.ts +22 -3
- package/src/input-control/input-field.tsx +1 -0
- package/src/input-control/stories/index.story.tsx +3 -3
- package/src/input-control/stories/migration-guide.mdx +201 -0
- package/src/input-control/style.scss +11 -0
- package/src/input-control/styles/input-control-styles.tsx +30 -11
- package/src/input-control/test/{index.js → index.jsx} +10 -0
- package/src/keyboard-shortcuts/stories/index.story.tsx +2 -2
- package/src/menu-group/stories/index.story.tsx +9 -6
- package/src/menu-item/stories/index.story.tsx +6 -3
- package/src/menu-items-choice/stories/index.story.tsx +14 -11
- package/src/modal/index.tsx +1 -0
- package/src/modal/test/index.tsx +19 -0
- package/src/navigator/stories/index.story.tsx +0 -5
- package/src/number-control/stories/index.story.tsx +3 -3
- package/src/palette-edit/index.tsx +364 -70
- package/src/palette-edit/stories/index.story.tsx +59 -18
- package/src/palette-edit/style.scss +3 -1
- package/src/palette-edit/test/index.tsx +375 -1
- package/src/palette-edit/types.ts +50 -8
- package/src/popover/README.md +2 -2
- package/src/popover/stories/index.story.tsx +5 -1
- package/src/popover/stories/utils.tsx +79 -0
- package/src/popover/test/index.tsx +24 -1
- package/src/popover/test/utils/index.js +1 -0
- package/src/popover/test/utils/index.tsx +4 -78
- package/src/popover/types.ts +9 -3
- package/src/private-apis.ts +0 -8
- package/src/progress-bar/index.tsx +10 -6
- package/src/progress-bar/style.module.scss +62 -0
- package/src/progress-bar/test/index.tsx +13 -11
- package/src/radio-control/README.md +3 -1
- package/src/radio-control/index.tsx +1 -0
- package/src/radio-control/stories/index.story.tsx +12 -0
- package/src/radio-control/style.scss +1 -3
- package/src/radio-control/test/index.tsx +59 -0
- package/src/radio-control/types.ts +6 -0
- package/src/range-control/stories/index.story.tsx +30 -0
- package/src/resizable-box/resize-tooltip/index.tsx +16 -7
- package/src/resizable-box/resize-tooltip/label.tsx +18 -12
- package/src/resizable-box/resize-tooltip/style.module.scss +40 -0
- package/src/resizable-box/resize-tooltip/test/index.tsx +44 -0
- package/src/resizable-box/resize-tooltip/test/label.tsx +25 -0
- package/src/resizable-box/stories/index.story.tsx +11 -0
- package/src/sandbox/stories/index.story.tsx +2 -0
- package/src/scrollable/hook.ts +11 -17
- package/src/scrollable/stories/index.story.tsx +1 -0
- package/src/scrollable/style.module.scss +44 -0
- package/src/scrollable/test/index.tsx +120 -6
- package/src/snackbar/index.tsx +10 -6
- package/src/snackbar/stories/index.story.tsx +5 -0
- package/src/snackbar/stories/list.story.tsx +3 -0
- package/src/snackbar/test/index.tsx +28 -2
- package/src/snackbar/test/list.tsx +61 -1
- package/src/spinner/stories/index.story.tsx +2 -2
- package/src/style.scss +1 -0
- package/src/text-control/stories/index.story.tsx +2 -3
- package/src/text-control/style.scss +0 -1
- package/src/textarea-control/index.tsx +6 -3
- package/src/textarea-control/stories/index.story.tsx +2 -3
- package/src/textarea-control/stories/migration-guide.mdx +79 -0
- package/src/textarea-control/style.module.scss +56 -0
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +12 -116
- package/src/toggle-group-control/toggle-group-control/style.module.scss +0 -2
- package/src/toggle-group-control/toggle-group-control-option-base/style.module.scss +0 -2
- package/src/tools-panel/test/index.tsx +39 -0
- package/src/tools-panel/tools-panel-item/hook.ts +4 -1
- package/src/utils/config-values.js +0 -3
- package/src/utils/theme-variables.scss +0 -1
- package/src/validated-form-controls/components/content-editable-control.tsx +2 -1
- package/src/validated-form-controls/components/custom-select-control.tsx +2 -1
- package/src/validated-form-controls/components/index.ts +0 -4
- package/src/validated-form-controls/components/input-control.tsx +9 -1
- package/src/validated-form-controls/components/range-control.tsx +2 -1
- package/src/validated-form-controls/components/stories/content-editable-control.story.tsx +6 -0
- package/src/validated-form-controls/components/stories/custom-select-control.story.tsx +6 -0
- package/src/validated-form-controls/components/stories/overview.mdx +4 -47
- package/src/validated-form-controls/components/textarea-control.tsx +9 -1
- package/src/validated-form-controls/index.ts +0 -1
- package/src/validated-form-controls/style.scss +11 -67
- package/src/validated-form-controls/test/input-control.tsx +12 -0
- package/src/validated-form-controls/test/textarea-control.tsx +17 -0
- package/src/z-stack/component.tsx +17 -9
- package/src/z-stack/style.module.scss +26 -0
- package/build/border-box-control/styles.cjs +0 -99
- package/build/border-box-control/styles.cjs.map +0 -7
- package/build/border-control/styles.cjs +0 -117
- package/build/border-control/styles.cjs.map +0 -7
- package/build/box-control/styles/box-control-styles.cjs +0 -131
- package/build/box-control/styles/box-control-styles.cjs.map +0 -7
- package/build/color-palette/styles.cjs +0 -49
- package/build/color-palette/styles.cjs.map +0 -7
- package/build/combobox-control/styles.cjs +0 -49
- package/build/combobox-control/styles.cjs.map +0 -7
- package/build/dropdown/styles.cjs +0 -61
- package/build/dropdown/styles.cjs.map +0 -7
- package/build/progress-bar/styles.cjs +0 -106
- package/build/progress-bar/styles.cjs.map +0 -7
- package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.cjs +0 -90
- package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.cjs.map +0 -7
- package/build/scrollable/styles.cjs +0 -96
- package/build/scrollable/styles.cjs.map +0 -7
- package/build/textarea-control/styles/textarea-control-styles.cjs +0 -54
- package/build/textarea-control/styles/textarea-control-styles.cjs.map +0 -7
- package/build/validated-form-controls/components/combobox-control.cjs +0 -75
- package/build/validated-form-controls/components/combobox-control.cjs.map +0 -7
- package/build/validated-form-controls/components/form-token-field.cjs +0 -69
- package/build/validated-form-controls/components/form-token-field.cjs.map +0 -7
- package/build/validated-form-controls/components/toggle-control.cjs +0 -67
- package/build/validated-form-controls/components/toggle-control.cjs.map +0 -7
- package/build/validated-form-controls/components/toggle-group-control.cjs +0 -71
- package/build/validated-form-controls/components/toggle-group-control.cjs.map +0 -7
- package/build/validated-form-controls/control-with-error.cjs +0 -200
- package/build/validated-form-controls/control-with-error.cjs.map +0 -7
- package/build/validated-form-controls/validity-indicator.cjs +0 -67
- package/build/validated-form-controls/validity-indicator.cjs.map +0 -7
- package/build/z-stack/styles.cjs +0 -80
- package/build/z-stack/styles.cjs.map +0 -7
- package/build-module/border-box-control/styles.mjs +0 -67
- package/build-module/border-box-control/styles.mjs.map +0 -7
- package/build-module/border-control/styles.mjs +0 -80
- package/build-module/border-control/styles.mjs.map +0 -7
- package/build-module/box-control/styles/box-control-styles.mjs +0 -91
- package/build-module/box-control/styles/box-control-styles.mjs.map +0 -7
- package/build-module/color-palette/styles.mjs +0 -14
- package/build-module/color-palette/styles.mjs.map +0 -7
- package/build-module/combobox-control/styles.mjs +0 -14
- package/build-module/combobox-control/styles.mjs.map +0 -7
- package/build-module/dropdown/styles.mjs +0 -26
- package/build-module/dropdown/styles.mjs.map +0 -7
- package/build-module/progress-bar/styles.mjs +0 -68
- package/build-module/progress-bar/styles.mjs.map +0 -7
- package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.mjs +0 -52
- package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.mjs.map +0 -7
- package/build-module/scrollable/styles.mjs +0 -65
- package/build-module/scrollable/styles.mjs.map +0 -7
- package/build-module/textarea-control/styles/textarea-control-styles.mjs +0 -19
- package/build-module/textarea-control/styles/textarea-control-styles.mjs.map +0 -7
- package/build-module/validated-form-controls/components/combobox-control.mjs +0 -40
- package/build-module/validated-form-controls/components/combobox-control.mjs.map +0 -7
- package/build-module/validated-form-controls/components/form-token-field.mjs +0 -44
- package/build-module/validated-form-controls/components/form-token-field.mjs.map +0 -7
- package/build-module/validated-form-controls/components/toggle-control.mjs +0 -32
- package/build-module/validated-form-controls/components/toggle-control.mjs.map +0 -7
- package/build-module/validated-form-controls/components/toggle-group-control.mjs +0 -46
- package/build-module/validated-form-controls/components/toggle-group-control.mjs.map +0 -7
- package/build-module/validated-form-controls/control-with-error.mjs +0 -175
- package/build-module/validated-form-controls/control-with-error.mjs.map +0 -7
- package/build-module/validated-form-controls/validity-indicator.mjs +0 -32
- package/build-module/validated-form-controls/validity-indicator.mjs.map +0 -7
- package/build-module/z-stack/styles.mjs +0 -44
- package/build-module/z-stack/styles.mjs.map +0 -7
- package/build-types/alignment-matrix-control/stories/index.story.d.ts +0 -8
- package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +0 -1
- package/build-types/alignment-matrix-control/test/index.d.ts +0 -2
- package/build-types/alignment-matrix-control/test/index.d.ts.map +0 -1
- package/build-types/angle-picker-control/stories/index.story.d.ts +0 -8
- package/build-types/angle-picker-control/stories/index.story.d.ts.map +0 -1
- package/build-types/animate/stories/index.story.d.ts +0 -12
- package/build-types/animate/stories/index.story.d.ts.map +0 -1
- package/build-types/autocomplete/test/get-autocomplete-match.d.ts +0 -2
- package/build-types/autocomplete/test/get-autocomplete-match.d.ts.map +0 -1
- package/build-types/autocomplete/test/index.d.ts +0 -2
- package/build-types/autocomplete/test/index.d.ts.map +0 -1
- package/build-types/badge/stories/e2e/index.story.d.ts +0 -7
- package/build-types/badge/stories/e2e/index.story.d.ts.map +0 -1
- package/build-types/badge/stories/index.story.d.ts +0 -11
- package/build-types/badge/stories/index.story.d.ts.map +0 -1
- package/build-types/badge/test/index.d.ts +0 -2
- package/build-types/badge/test/index.d.ts.map +0 -1
- package/build-types/base-control/stories/index.story.d.ts +0 -17
- package/build-types/base-control/stories/index.story.d.ts.map +0 -1
- package/build-types/base-control/test/index.d.ts +0 -2
- package/build-types/base-control/test/index.d.ts.map +0 -1
- package/build-types/border-box-control/stories/index.story.d.ts +0 -14
- package/build-types/border-box-control/stories/index.story.d.ts.map +0 -1
- package/build-types/border-box-control/styles.d.ts +0 -10
- package/build-types/border-box-control/styles.d.ts.map +0 -1
- package/build-types/border-box-control/test/index.d.ts +0 -2
- package/build-types/border-box-control/test/index.d.ts.map +0 -1
- package/build-types/border-box-control/test/utils.d.ts +0 -2
- package/build-types/border-box-control/test/utils.d.ts.map +0 -1
- package/build-types/border-control/stories/index.story.d.ts +0 -109
- package/build-types/border-control/stories/index.story.d.ts.map +0 -1
- package/build-types/border-control/styles.d.ts +0 -17
- package/build-types/border-control/styles.d.ts.map +0 -1
- package/build-types/box-control/stories/index.story.d.ts +0 -12
- package/build-types/box-control/stories/index.story.d.ts.map +0 -1
- package/build-types/box-control/styles/box-control-styles.d.ts +0 -65
- package/build-types/box-control/styles/box-control-styles.d.ts.map +0 -1
- package/build-types/box-control/test/index.d.ts +0 -2
- package/build-types/box-control/test/index.d.ts.map +0 -1
- package/build-types/button/stories/e2e/index.story.d.ts +0 -9
- package/build-types/button/stories/e2e/index.story.d.ts.map +0 -1
- package/build-types/button/stories/index.story.d.ts +0 -31
- package/build-types/button/stories/index.story.d.ts.map +0 -1
- package/build-types/button/test/index.d.ts +0 -2
- package/build-types/button/test/index.d.ts.map +0 -1
- package/build-types/button-group/stories/index.story.d.ts +0 -12
- package/build-types/button-group/stories/index.story.d.ts.map +0 -1
- package/build-types/card/stories/index.story.d.ts +0 -20
- package/build-types/card/stories/index.story.d.ts.map +0 -1
- package/build-types/card/test/index.d.ts +0 -2
- package/build-types/card/test/index.d.ts.map +0 -1
- package/build-types/checkbox-control/stories/index.story.d.ts +0 -24
- package/build-types/checkbox-control/stories/index.story.d.ts.map +0 -1
- package/build-types/checkbox-control/test/index.d.ts +0 -2
- package/build-types/checkbox-control/test/index.d.ts.map +0 -1
- package/build-types/circular-option-picker/stories/index.story.d.ts +0 -10
- package/build-types/circular-option-picker/stories/index.story.d.ts.map +0 -1
- package/build-types/circular-option-picker/test/index.d.ts +0 -2
- package/build-types/circular-option-picker/test/index.d.ts.map +0 -1
- package/build-types/color-indicator/stories/index.story.d.ts +0 -6
- package/build-types/color-indicator/stories/index.story.d.ts.map +0 -1
- package/build-types/color-indicator/test/index.d.ts +0 -2
- package/build-types/color-indicator/test/index.d.ts.map +0 -1
- package/build-types/color-palette/stories/index.story.d.ts +0 -11
- package/build-types/color-palette/stories/index.story.d.ts.map +0 -1
- package/build-types/color-palette/styles.d.ts +0 -11
- package/build-types/color-palette/styles.d.ts.map +0 -1
- package/build-types/color-palette/test/index.d.ts +0 -2
- package/build-types/color-palette/test/index.d.ts.map +0 -1
- package/build-types/color-palette/test/utils.d.ts +0 -2
- package/build-types/color-palette/test/utils.d.ts.map +0 -1
- package/build-types/color-picker/stories/index.story.d.ts +0 -6
- package/build-types/color-picker/stories/index.story.d.ts.map +0 -1
- package/build-types/color-picker/test/index.d.ts +0 -2
- package/build-types/color-picker/test/index.d.ts.map +0 -1
- package/build-types/combobox-control/stories/index.story.d.ts +0 -93
- package/build-types/combobox-control/stories/index.story.d.ts.map +0 -1
- package/build-types/combobox-control/styles.d.ts +0 -6
- package/build-types/combobox-control/styles.d.ts.map +0 -1
- package/build-types/combobox-control/test/index.d.ts +0 -2
- package/build-types/combobox-control/test/index.d.ts.map +0 -1
- package/build-types/composite/legacy/stories/index.story.d.ts +0 -9
- package/build-types/composite/legacy/stories/index.story.d.ts.map +0 -1
- package/build-types/composite/legacy/stories/utils.d.ts +0 -27
- package/build-types/composite/legacy/stories/utils.d.ts.map +0 -1
- package/build-types/composite/legacy/test/index.d.ts +0 -2
- package/build-types/composite/legacy/test/index.d.ts.map +0 -1
- package/build-types/composite/stories/index.story.d.ts +0 -33
- package/build-types/composite/stories/index.story.d.ts.map +0 -1
- package/build-types/composite/test/index.d.ts +0 -2
- package/build-types/composite/test/index.d.ts.map +0 -1
- package/build-types/confirm-dialog/stories/index.story.d.ts +0 -7
- package/build-types/confirm-dialog/stories/index.story.d.ts.map +0 -1
- package/build-types/confirm-dialog/test/index.d.ts +0 -2
- package/build-types/confirm-dialog/test/index.d.ts.map +0 -1
- package/build-types/content-editable-control/stories/index.story.d.ts +0 -7
- package/build-types/content-editable-control/stories/index.story.d.ts.map +0 -1
- package/build-types/content-editable-control/test/index.d.ts +0 -2
- package/build-types/content-editable-control/test/index.d.ts.map +0 -1
- package/build-types/context/test/context-connect.d.ts +0 -2
- package/build-types/context/test/context-connect.d.ts.map +0 -1
- package/build-types/context/test/wordpress-component.d.ts +0 -2
- package/build-types/context/test/wordpress-component.d.ts.map +0 -1
- package/build-types/custom-gradient-picker/gradient-bar/test/utils.d.ts +0 -2
- package/build-types/custom-gradient-picker/gradient-bar/test/utils.d.ts.map +0 -1
- package/build-types/custom-gradient-picker/stories/index.story.d.ts +0 -6
- package/build-types/custom-gradient-picker/stories/index.story.d.ts.map +0 -1
- package/build-types/custom-gradient-picker/test/index.d.ts +0 -2
- package/build-types/custom-gradient-picker/test/index.d.ts.map +0 -1
- package/build-types/custom-gradient-picker/test/serializer.d.ts +0 -2
- package/build-types/custom-gradient-picker/test/serializer.d.ts.map +0 -1
- package/build-types/custom-select-control/stories/index.story.d.ts +0 -8
- package/build-types/custom-select-control/stories/index.story.d.ts.map +0 -1
- package/build-types/custom-select-control/test/index.d.ts +0 -2
- package/build-types/custom-select-control/test/index.d.ts.map +0 -1
- package/build-types/custom-select-control-v2/stories/index.story.d.ts +0 -38
- package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +0 -1
- package/build-types/custom-select-control-v2/test/index.d.ts +0 -2
- package/build-types/custom-select-control-v2/test/index.d.ts.map +0 -1
- package/build-types/date-time/date-picker/test/index.d.ts +0 -2
- package/build-types/date-time/date-picker/test/index.d.ts.map +0 -1
- package/build-types/date-time/date-picker/test/use-lilius.d.ts +0 -2
- package/build-types/date-time/date-picker/test/use-lilius.d.ts.map +0 -1
- package/build-types/date-time/date-time/test/index.d.ts +0 -2
- package/build-types/date-time/date-time/test/index.d.ts.map +0 -1
- package/build-types/date-time/stories/date-time.story.d.ts +0 -8
- package/build-types/date-time/stories/date-time.story.d.ts.map +0 -1
- package/build-types/date-time/stories/date.story.d.ts +0 -8
- package/build-types/date-time/stories/date.story.d.ts.map +0 -1
- package/build-types/date-time/stories/time.story.d.ts +0 -11
- package/build-types/date-time/stories/time.story.d.ts.map +0 -1
- package/build-types/date-time/stories/utils.d.ts +0 -3
- package/build-types/date-time/stories/utils.d.ts.map +0 -1
- package/build-types/date-time/test/utils.test.d.ts +0 -2
- package/build-types/date-time/test/utils.test.d.ts.map +0 -1
- package/build-types/date-time/time-picker/test/index.d.ts +0 -2
- package/build-types/date-time/time-picker/test/index.d.ts.map +0 -1
- package/build-types/date-time/time-picker/time-input/test/index.d.ts +0 -2
- package/build-types/date-time/time-picker/time-input/test/index.d.ts.map +0 -1
- package/build-types/disabled/stories/index.story.d.ts +0 -7
- package/build-types/disabled/stories/index.story.d.ts.map +0 -1
- package/build-types/disabled/test/index.d.ts +0 -2
- package/build-types/disabled/test/index.d.ts.map +0 -1
- package/build-types/divider/stories/index.story.d.ts +0 -8
- package/build-types/divider/stories/index.story.d.ts.map +0 -1
- package/build-types/divider/test/index.d.ts +0 -2
- package/build-types/divider/test/index.d.ts.map +0 -1
- package/build-types/draggable/stories/index.story.d.ts +0 -13
- package/build-types/draggable/stories/index.story.d.ts.map +0 -1
- package/build-types/drop-zone/stories/index.story.d.ts +0 -6
- package/build-types/drop-zone/stories/index.story.d.ts.map +0 -1
- package/build-types/dropdown/stories/index.story.d.ts +0 -18
- package/build-types/dropdown/stories/index.story.d.ts.map +0 -1
- package/build-types/dropdown/styles.d.ts +0 -6
- package/build-types/dropdown/styles.d.ts.map +0 -1
- package/build-types/dropdown/test/index.d.ts +0 -2
- package/build-types/dropdown/test/index.d.ts.map +0 -1
- package/build-types/dropdown-menu/stories/index.story.d.ts +0 -7
- package/build-types/dropdown-menu/stories/index.story.d.ts.map +0 -1
- package/build-types/dropdown-menu/test/index.d.ts +0 -2
- package/build-types/dropdown-menu/test/index.d.ts.map +0 -1
- package/build-types/duotone-picker/stories/duotone-picker.story.d.ts +0 -7
- package/build-types/duotone-picker/stories/duotone-picker.story.d.ts.map +0 -1
- package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts +0 -8
- package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts.map +0 -1
- package/build-types/elevation/stories/index.story.d.ts +0 -16
- package/build-types/elevation/stories/index.story.d.ts.map +0 -1
- package/build-types/elevation/test/index.d.ts +0 -2
- package/build-types/elevation/test/index.d.ts.map +0 -1
- package/build-types/external-link/stories/index.story.d.ts +0 -6
- package/build-types/external-link/stories/index.story.d.ts.map +0 -1
- package/build-types/external-link/test/index.d.ts +0 -2
- package/build-types/external-link/test/index.d.ts.map +0 -1
- package/build-types/flex/stories/index.story.d.ts +0 -7
- package/build-types/flex/stories/index.story.d.ts.map +0 -1
- package/build-types/flex/test/index.d.ts +0 -2
- package/build-types/flex/test/index.d.ts.map +0 -1
- package/build-types/focal-point-picker/stories/index.story.d.ts +0 -49
- package/build-types/focal-point-picker/stories/index.story.d.ts.map +0 -1
- package/build-types/focal-point-picker/test/index.d.ts +0 -2
- package/build-types/focal-point-picker/test/index.d.ts.map +0 -1
- package/build-types/focal-point-picker/test/media.d.ts +0 -2
- package/build-types/focal-point-picker/test/media.d.ts.map +0 -1
- package/build-types/font-size-picker/stories/e2e/index.story.d.ts +0 -20
- package/build-types/font-size-picker/stories/e2e/index.story.d.ts.map +0 -1
- package/build-types/font-size-picker/stories/index.story.d.ts +0 -26
- package/build-types/font-size-picker/stories/index.story.d.ts.map +0 -1
- package/build-types/font-size-picker/test/font-size-picker-select.d.ts +0 -2
- package/build-types/font-size-picker/test/font-size-picker-select.d.ts.map +0 -1
- package/build-types/font-size-picker/test/font-size-picker-toggle-group.d.ts +0 -2
- package/build-types/font-size-picker/test/font-size-picker-toggle-group.d.ts.map +0 -1
- package/build-types/font-size-picker/test/index.d.ts +0 -2
- package/build-types/font-size-picker/test/index.d.ts.map +0 -1
- package/build-types/font-size-picker/test/utils.d.ts +0 -2
- package/build-types/font-size-picker/test/utils.d.ts.map +0 -1
- package/build-types/form-file-upload/stories/index.story.d.ts +0 -17
- package/build-types/form-file-upload/stories/index.story.d.ts.map +0 -1
- package/build-types/form-file-upload/test/index.d.ts +0 -2
- package/build-types/form-file-upload/test/index.d.ts.map +0 -1
- package/build-types/form-toggle/stories/index.story.d.ts +0 -6
- package/build-types/form-toggle/stories/index.story.d.ts.map +0 -1
- package/build-types/form-toggle/test/index.d.ts +0 -2
- package/build-types/form-toggle/test/index.d.ts.map +0 -1
- package/build-types/form-token-field/stories/index.story.d.ts +0 -25
- package/build-types/form-token-field/stories/index.story.d.ts.map +0 -1
- package/build-types/form-token-field/test/index.d.ts +0 -2
- package/build-types/form-token-field/test/index.d.ts.map +0 -1
- package/build-types/gradient-picker/stories/index.story.d.ts +0 -11
- package/build-types/gradient-picker/stories/index.story.d.ts.map +0 -1
- package/build-types/gradient-picker/test/index.d.ts +0 -2
- package/build-types/gradient-picker/test/index.d.ts.map +0 -1
- package/build-types/grid/stories/index.story.d.ts +0 -6
- package/build-types/grid/stories/index.story.d.ts.map +0 -1
- package/build-types/grid/test/grid.d.ts +0 -2
- package/build-types/grid/test/grid.d.ts.map +0 -1
- package/build-types/guide/stories/index.story.d.ts +0 -6
- package/build-types/guide/stories/index.story.d.ts.map +0 -1
- package/build-types/guide/test/index.d.ts +0 -2
- package/build-types/guide/test/index.d.ts.map +0 -1
- package/build-types/h-stack/stories/e2e/index.story.d.ts +0 -6
- package/build-types/h-stack/stories/e2e/index.story.d.ts.map +0 -1
- package/build-types/h-stack/stories/index.story.d.ts +0 -6
- package/build-types/h-stack/stories/index.story.d.ts.map +0 -1
- package/build-types/h-stack/test/index.d.ts +0 -2
- package/build-types/h-stack/test/index.d.ts.map +0 -1
- package/build-types/heading/stories/index.story.d.ts +0 -6
- package/build-types/heading/stories/index.story.d.ts.map +0 -1
- package/build-types/heading/test/index.d.ts +0 -2
- package/build-types/heading/test/index.d.ts.map +0 -1
- package/build-types/higher-order/with-fallback-styles/test/index.d.ts +0 -2
- package/build-types/higher-order/with-fallback-styles/test/index.d.ts.map +0 -1
- package/build-types/higher-order/with-filters/test/index.d.ts +0 -2
- package/build-types/higher-order/with-filters/test/index.d.ts.map +0 -1
- package/build-types/higher-order/with-focus-outside/test/index.d.ts +0 -2
- package/build-types/higher-order/with-focus-outside/test/index.d.ts.map +0 -1
- package/build-types/higher-order/with-focus-return/test/index.d.ts +0 -2
- package/build-types/higher-order/with-focus-return/test/index.d.ts.map +0 -1
- package/build-types/higher-order/with-notices/test/index.d.ts +0 -2
- package/build-types/higher-order/with-notices/test/index.d.ts.map +0 -1
- package/build-types/higher-order/with-spoken-messages/test/index.d.ts +0 -2
- package/build-types/higher-order/with-spoken-messages/test/index.d.ts.map +0 -1
- package/build-types/icon/stories/index.story.d.ts +0 -21
- package/build-types/icon/stories/index.story.d.ts.map +0 -1
- package/build-types/icon/test/index.d.ts +0 -2
- package/build-types/icon/test/index.d.ts.map +0 -1
- package/build-types/input-control/stories/index.story.d.ts +0 -31
- package/build-types/input-control/stories/index.story.d.ts.map +0 -1
- package/build-types/isolated-event-container/test/index.d.ts +0 -2
- package/build-types/isolated-event-container/test/index.d.ts.map +0 -1
- package/build-types/item-group/stories/index.story.d.ts +0 -9
- package/build-types/item-group/stories/index.story.d.ts.map +0 -1
- package/build-types/keyboard-shortcuts/stories/index.story.d.ts +0 -6
- package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +0 -1
- package/build-types/keyboard-shortcuts/test/index.d.ts +0 -2
- package/build-types/keyboard-shortcuts/test/index.d.ts.map +0 -1
- package/build-types/menu/stories/index.story.d.ts +0 -13
- package/build-types/menu/stories/index.story.d.ts.map +0 -1
- package/build-types/menu/test/index.d.ts +0 -2
- package/build-types/menu/test/index.d.ts.map +0 -1
- package/build-types/menu-group/stories/index.story.d.ts +0 -11
- package/build-types/menu-group/stories/index.story.d.ts.map +0 -1
- package/build-types/menu-group/test/index.d.ts +0 -2
- package/build-types/menu-group/test/index.d.ts.map +0 -1
- package/build-types/menu-item/stories/index.story.d.ts +0 -70
- package/build-types/menu-item/stories/index.story.d.ts.map +0 -1
- package/build-types/menu-items-choice/stories/index.story.d.ts +0 -6
- package/build-types/menu-items-choice/stories/index.story.d.ts.map +0 -1
- package/build-types/modal/stories/index.story.d.ts +0 -11
- package/build-types/modal/stories/index.story.d.ts.map +0 -1
- package/build-types/modal/test/aria-helper.d.ts +0 -2
- package/build-types/modal/test/aria-helper.d.ts.map +0 -1
- package/build-types/modal/test/index.d.ts +0 -2
- package/build-types/modal/test/index.d.ts.map +0 -1
- package/build-types/navigable-container/stories/navigable-menu.story.d.ts +0 -6
- package/build-types/navigable-container/stories/navigable-menu.story.d.ts.map +0 -1
- package/build-types/navigable-container/stories/tabbable-container.story.d.ts +0 -6
- package/build-types/navigable-container/stories/tabbable-container.story.d.ts.map +0 -1
- package/build-types/navigable-container/test/navigable-menu.d.ts +0 -2
- package/build-types/navigable-container/test/navigable-menu.d.ts.map +0 -1
- package/build-types/navigable-container/test/tababble-container.d.ts +0 -2
- package/build-types/navigable-container/test/tababble-container.d.ts.map +0 -1
- package/build-types/navigator/stories/index.story.d.ts +0 -8
- package/build-types/navigator/stories/index.story.d.ts.map +0 -1
- package/build-types/navigator/test/index.d.ts +0 -2
- package/build-types/navigator/test/index.d.ts.map +0 -1
- package/build-types/navigator/test/router.d.ts +0 -2
- package/build-types/navigator/test/router.d.ts.map +0 -1
- package/build-types/notice/stories/index.story.d.ts +0 -15
- package/build-types/notice/stories/index.story.d.ts.map +0 -1
- package/build-types/notice/test/index.d.ts +0 -2
- package/build-types/notice/test/index.d.ts.map +0 -1
- package/build-types/notice/test/list.d.ts +0 -2
- package/build-types/notice/test/list.d.ts.map +0 -1
- package/build-types/number-control/stories/index.story.d.ts +0 -19
- package/build-types/number-control/stories/index.story.d.ts.map +0 -1
- package/build-types/number-control/test/index.d.ts +0 -2
- package/build-types/number-control/test/index.d.ts.map +0 -1
- package/build-types/palette-edit/stories/index.story.d.ts +0 -7
- package/build-types/palette-edit/stories/index.story.d.ts.map +0 -1
- package/build-types/palette-edit/test/index.d.ts +0 -2
- package/build-types/palette-edit/test/index.d.ts.map +0 -1
- package/build-types/panel/stories/index.story.d.ts +0 -13
- package/build-types/panel/stories/index.story.d.ts.map +0 -1
- package/build-types/panel/test/body.d.ts +0 -2
- package/build-types/panel/test/body.d.ts.map +0 -1
- package/build-types/panel/test/header.d.ts +0 -2
- package/build-types/panel/test/header.d.ts.map +0 -1
- package/build-types/panel/test/index.d.ts +0 -2
- package/build-types/panel/test/index.d.ts.map +0 -1
- package/build-types/panel/test/row.d.ts +0 -2
- package/build-types/panel/test/row.d.ts.map +0 -1
- package/build-types/placeholder/stories/index.story.d.ts +0 -6
- package/build-types/placeholder/stories/index.story.d.ts.map +0 -1
- package/build-types/placeholder/test/index.d.ts +0 -2
- package/build-types/placeholder/test/index.d.ts.map +0 -1
- package/build-types/popover/stories/e2e/index.story.d.ts +0 -18
- package/build-types/popover/stories/e2e/index.story.d.ts.map +0 -1
- package/build-types/popover/stories/index.story.d.ts +0 -11
- package/build-types/popover/stories/index.story.d.ts.map +0 -1
- package/build-types/popover/test/index.d.ts +0 -2
- package/build-types/popover/test/index.d.ts.map +0 -1
- package/build-types/popover/test/utils/index.d.ts +0 -3
- package/build-types/popover/test/utils/index.d.ts.map +0 -1
- package/build-types/progress-bar/stories/index.story.d.ts +0 -23
- package/build-types/progress-bar/stories/index.story.d.ts.map +0 -1
- package/build-types/progress-bar/styles.d.ts +0 -16
- package/build-types/progress-bar/styles.d.ts.map +0 -1
- package/build-types/progress-bar/test/index.d.ts +0 -2
- package/build-types/progress-bar/test/index.d.ts.map +0 -1
- package/build-types/query-controls/stories/index.story.d.ts +0 -7
- package/build-types/query-controls/stories/index.story.d.ts.map +0 -1
- package/build-types/query-controls/test/terms.d.ts +0 -2
- package/build-types/query-controls/test/terms.d.ts.map +0 -1
- package/build-types/radio-control/stories/index.story.d.ts +0 -7
- package/build-types/radio-control/stories/index.story.d.ts.map +0 -1
- package/build-types/radio-control/test/index.d.ts +0 -2
- package/build-types/radio-control/test/index.d.ts.map +0 -1
- package/build-types/radio-group/stories/index.story.d.ts +0 -8
- package/build-types/radio-group/stories/index.story.d.ts.map +0 -1
- package/build-types/range-control/stories/index.story.d.ts +0 -42
- package/build-types/range-control/stories/index.story.d.ts.map +0 -1
- package/build-types/range-control/test/index.d.ts +0 -2
- package/build-types/range-control/test/index.d.ts.map +0 -1
- package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts +0 -18
- package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +0 -1
- package/build-types/resizable-box/stories/index.story.d.ts +0 -46
- package/build-types/resizable-box/stories/index.story.d.ts.map +0 -1
- package/build-types/responsive-wrapper/stories/index.story.d.ts +0 -16
- package/build-types/responsive-wrapper/stories/index.story.d.ts.map +0 -1
- package/build-types/sandbox/stories/index.story.d.ts +0 -7
- package/build-types/sandbox/stories/index.story.d.ts.map +0 -1
- package/build-types/sandbox/test/index.d.ts +0 -2
- package/build-types/sandbox/test/index.d.ts.map +0 -1
- package/build-types/scroll-lock/stories/index.story.d.ts +0 -6
- package/build-types/scroll-lock/stories/index.story.d.ts.map +0 -1
- package/build-types/scroll-lock/test/index.d.ts +0 -2
- package/build-types/scroll-lock/test/index.d.ts.map +0 -1
- package/build-types/scrollable/stories/index.story.d.ts +0 -6
- package/build-types/scrollable/stories/index.story.d.ts.map +0 -1
- package/build-types/scrollable/styles.d.ts +0 -8
- package/build-types/scrollable/styles.d.ts.map +0 -1
- package/build-types/scrollable/test/index.d.ts +0 -2
- package/build-types/scrollable/test/index.d.ts.map +0 -1
- package/build-types/search-control/stories/index.story.d.ts +0 -18
- package/build-types/search-control/stories/index.story.d.ts.map +0 -1
- package/build-types/search-control/test/index.d.ts +0 -2
- package/build-types/search-control/test/index.d.ts.map +0 -1
- package/build-types/select-control/stories/index.story.d.ts +0 -28
- package/build-types/select-control/stories/index.story.d.ts.map +0 -1
- package/build-types/select-control/test/select-control.d.ts +0 -2
- package/build-types/select-control/test/select-control.d.ts.map +0 -1
- package/build-types/shortcut/stories/index.story.d.ts +0 -7
- package/build-types/shortcut/stories/index.story.d.ts.map +0 -1
- package/build-types/shortcut/test/index.d.ts +0 -2
- package/build-types/shortcut/test/index.d.ts.map +0 -1
- package/build-types/slot-fill/stories/index.story.d.ts +0 -10
- package/build-types/slot-fill/stories/index.story.d.ts.map +0 -1
- package/build-types/snackbar/stories/index.story.d.ts +0 -10
- package/build-types/snackbar/stories/index.story.d.ts.map +0 -1
- package/build-types/snackbar/stories/list.story.d.ts +0 -6
- package/build-types/snackbar/stories/list.story.d.ts.map +0 -1
- package/build-types/snackbar/test/index.d.ts +0 -2
- package/build-types/snackbar/test/index.d.ts.map +0 -1
- package/build-types/snackbar/test/list.d.ts +0 -2
- package/build-types/snackbar/test/list.d.ts.map +0 -1
- package/build-types/spacer/stories/index.story.d.ts +0 -7
- package/build-types/spacer/stories/index.story.d.ts.map +0 -1
- package/build-types/spacer/test/index.d.ts +0 -2
- package/build-types/spacer/test/index.d.ts.map +0 -1
- package/build-types/spinner/stories/index.story.d.ts +0 -7
- package/build-types/spinner/stories/index.story.d.ts.map +0 -1
- package/build-types/style-provider/test/index.d.ts +0 -2
- package/build-types/style-provider/test/index.d.ts.map +0 -1
- package/build-types/surface/stories/index.story.d.ts +0 -6
- package/build-types/surface/stories/index.story.d.ts.map +0 -1
- package/build-types/surface/test/index.d.ts +0 -2
- package/build-types/surface/test/index.d.ts.map +0 -1
- package/build-types/tab-panel/stories/index.story.d.ts +0 -9
- package/build-types/tab-panel/stories/index.story.d.ts.map +0 -1
- package/build-types/tab-panel/test/index.d.ts +0 -2
- package/build-types/tab-panel/test/index.d.ts.map +0 -1
- package/build-types/tabs/stories/index.story.d.ts +0 -13
- package/build-types/tabs/stories/index.story.d.ts.map +0 -1
- package/build-types/tabs/test/index.d.ts +0 -2
- package/build-types/tabs/test/index.d.ts.map +0 -1
- package/build-types/text/stories/index.story.d.ts +0 -14
- package/build-types/text/stories/index.story.d.ts.map +0 -1
- package/build-types/text/test/index.d.ts +0 -2
- package/build-types/text/test/index.d.ts.map +0 -1
- package/build-types/text-control/stories/index.story.d.ts +0 -7
- package/build-types/text-control/stories/index.story.d.ts.map +0 -1
- package/build-types/text-control/test/text-control.d.ts +0 -2
- package/build-types/text-control/test/text-control.d.ts.map +0 -1
- package/build-types/text-highlight/stories/index.story.d.ts +0 -6
- package/build-types/text-highlight/stories/index.story.d.ts.map +0 -1
- package/build-types/text-highlight/test/index.d.ts +0 -2
- package/build-types/text-highlight/test/index.d.ts.map +0 -1
- package/build-types/textarea-control/stories/index.story.d.ts +0 -6
- package/build-types/textarea-control/stories/index.story.d.ts.map +0 -1
- package/build-types/textarea-control/styles/textarea-control-styles.d.ts +0 -5
- package/build-types/textarea-control/styles/textarea-control-styles.d.ts.map +0 -1
- package/build-types/tip/stories/index.story.d.ts +0 -6
- package/build-types/tip/stories/index.story.d.ts.map +0 -1
- package/build-types/toggle-control/stories/index.story.d.ts +0 -13
- package/build-types/toggle-control/stories/index.story.d.ts.map +0 -1
- package/build-types/toggle-control/test/index.d.ts +0 -2
- package/build-types/toggle-control/test/index.d.ts.map +0 -1
- package/build-types/toggle-group-control/stories/index.story.d.ts +0 -21
- package/build-types/toggle-group-control/stories/index.story.d.ts.map +0 -1
- package/build-types/toggle-group-control/test/index.d.ts +0 -2
- package/build-types/toggle-group-control/test/index.d.ts.map +0 -1
- package/build-types/toolbar/stories/index.story.d.ts +0 -12
- package/build-types/toolbar/stories/index.story.d.ts.map +0 -1
- package/build-types/toolbar/test/index.d.ts +0 -2
- package/build-types/toolbar/test/index.d.ts.map +0 -1
- package/build-types/toolbar/test/toolbar-group.d.ts +0 -2
- package/build-types/toolbar/test/toolbar-group.d.ts.map +0 -1
- package/build-types/tools-panel/stories/index.story.d.ts +0 -11
- package/build-types/tools-panel/stories/index.story.d.ts.map +0 -1
- package/build-types/tools-panel/test/index.d.ts +0 -2
- package/build-types/tools-panel/test/index.d.ts.map +0 -1
- package/build-types/tooltip/stories/index.story.d.ts +0 -15
- package/build-types/tooltip/stories/index.story.d.ts.map +0 -1
- package/build-types/tooltip/test/index.d.ts +0 -2
- package/build-types/tooltip/test/index.d.ts.map +0 -1
- package/build-types/tooltip/test/utils/index.d.ts +0 -7
- package/build-types/tooltip/test/utils/index.d.ts.map +0 -1
- package/build-types/tree-grid/stories/index.story.d.ts +0 -6
- package/build-types/tree-grid/stories/index.story.d.ts.map +0 -1
- package/build-types/tree-grid/test/cell.d.ts +0 -2
- package/build-types/tree-grid/test/cell.d.ts.map +0 -1
- package/build-types/tree-grid/test/index.d.ts +0 -2
- package/build-types/tree-grid/test/index.d.ts.map +0 -1
- package/build-types/tree-grid/test/roving-tab-index-item.d.ts +0 -2
- package/build-types/tree-grid/test/roving-tab-index-item.d.ts.map +0 -1
- package/build-types/tree-grid/test/roving-tab-index.d.ts +0 -2
- package/build-types/tree-grid/test/roving-tab-index.d.ts.map +0 -1
- package/build-types/tree-grid/test/row.d.ts +0 -2
- package/build-types/tree-grid/test/row.d.ts.map +0 -1
- package/build-types/tree-select/stories/index.story.d.ts +0 -6
- package/build-types/tree-select/stories/index.story.d.ts.map +0 -1
- package/build-types/truncate/stories/index.story.d.ts +0 -7
- package/build-types/truncate/stories/index.story.d.ts.map +0 -1
- package/build-types/truncate/test/index.d.ts +0 -2
- package/build-types/truncate/test/index.d.ts.map +0 -1
- package/build-types/unit-control/stories/index.story.d.ts +0 -27
- package/build-types/unit-control/stories/index.story.d.ts.map +0 -1
- package/build-types/unit-control/test/index.d.ts +0 -2
- package/build-types/unit-control/test/index.d.ts.map +0 -1
- package/build-types/unit-control/test/utils.d.ts +0 -2
- package/build-types/unit-control/test/utils.d.ts.map +0 -1
- package/build-types/utils/test/polymorphic-element.d.ts +0 -2
- package/build-types/utils/test/polymorphic-element.d.ts.map +0 -1
- package/build-types/v-stack/stories/e2e/index.story.d.ts +0 -6
- package/build-types/v-stack/stories/e2e/index.story.d.ts.map +0 -1
- package/build-types/v-stack/stories/index.story.d.ts +0 -11
- package/build-types/v-stack/stories/index.story.d.ts.map +0 -1
- package/build-types/v-stack/test/index.d.ts +0 -2
- package/build-types/v-stack/test/index.d.ts.map +0 -1
- package/build-types/validated-form-controls/components/combobox-control.d.ts +0 -20
- package/build-types/validated-form-controls/components/combobox-control.d.ts.map +0 -1
- package/build-types/validated-form-controls/components/form-token-field.d.ts +0 -3
- package/build-types/validated-form-controls/components/form-token-field.d.ts.map +0 -1
- package/build-types/validated-form-controls/components/stories/combobox-control.story.d.ts +0 -6
- package/build-types/validated-form-controls/components/stories/combobox-control.story.d.ts.map +0 -1
- package/build-types/validated-form-controls/components/stories/content-editable-control.story.d.ts +0 -6
- package/build-types/validated-form-controls/components/stories/content-editable-control.story.d.ts.map +0 -1
- package/build-types/validated-form-controls/components/stories/custom-select-control.story.d.ts +0 -6
- package/build-types/validated-form-controls/components/stories/custom-select-control.story.d.ts.map +0 -1
- package/build-types/validated-form-controls/components/stories/form-token-field.story.d.ts +0 -9
- package/build-types/validated-form-controls/components/stories/form-token-field.story.d.ts.map +0 -1
- package/build-types/validated-form-controls/components/stories/input-control.story.d.ts +0 -12
- package/build-types/validated-form-controls/components/stories/input-control.story.d.ts.map +0 -1
- package/build-types/validated-form-controls/components/stories/overview.story.d.ts +0 -60
- package/build-types/validated-form-controls/components/stories/overview.story.d.ts.map +0 -1
- package/build-types/validated-form-controls/components/stories/range-control.story.d.ts +0 -6
- package/build-types/validated-form-controls/components/stories/range-control.story.d.ts.map +0 -1
- package/build-types/validated-form-controls/components/stories/story-utils.d.ts +0 -3
- package/build-types/validated-form-controls/components/stories/story-utils.d.ts.map +0 -1
- package/build-types/validated-form-controls/components/stories/textarea-control.story.d.ts +0 -6
- package/build-types/validated-form-controls/components/stories/textarea-control.story.d.ts.map +0 -1
- package/build-types/validated-form-controls/components/stories/toggle-control.story.d.ts +0 -6
- package/build-types/validated-form-controls/components/stories/toggle-control.story.d.ts.map +0 -1
- package/build-types/validated-form-controls/components/stories/toggle-group-control.story.d.ts +0 -6
- package/build-types/validated-form-controls/components/stories/toggle-group-control.story.d.ts.map +0 -1
- package/build-types/validated-form-controls/components/toggle-control.d.ts +0 -7
- package/build-types/validated-form-controls/components/toggle-control.d.ts.map +0 -1
- package/build-types/validated-form-controls/components/toggle-group-control.d.ts +0 -15
- package/build-types/validated-form-controls/components/toggle-group-control.d.ts.map +0 -1
- package/build-types/validated-form-controls/control-with-error.d.ts +0 -36
- package/build-types/validated-form-controls/control-with-error.d.ts.map +0 -1
- package/build-types/validated-form-controls/test/combobox-control.d.ts +0 -2
- package/build-types/validated-form-controls/test/combobox-control.d.ts.map +0 -1
- package/build-types/validated-form-controls/test/content-editable-control.d.ts +0 -2
- package/build-types/validated-form-controls/test/content-editable-control.d.ts.map +0 -1
- package/build-types/validated-form-controls/test/control-with-error.d.ts +0 -2
- package/build-types/validated-form-controls/test/control-with-error.d.ts.map +0 -1
- package/build-types/validated-form-controls/test/custom-select-control.d.ts +0 -2
- package/build-types/validated-form-controls/test/custom-select-control.d.ts.map +0 -1
- package/build-types/validated-form-controls/test/form-token-field.d.ts +0 -2
- package/build-types/validated-form-controls/test/form-token-field.d.ts.map +0 -1
- package/build-types/validated-form-controls/test/input-control.d.ts +0 -2
- package/build-types/validated-form-controls/test/input-control.d.ts.map +0 -1
- package/build-types/validated-form-controls/test/range-control.d.ts +0 -2
- package/build-types/validated-form-controls/test/range-control.d.ts.map +0 -1
- package/build-types/validated-form-controls/test/textarea-control.d.ts +0 -2
- package/build-types/validated-form-controls/test/textarea-control.d.ts.map +0 -1
- package/build-types/validated-form-controls/test/toggle-control.d.ts +0 -2
- package/build-types/validated-form-controls/test/toggle-control.d.ts.map +0 -1
- package/build-types/validated-form-controls/test/toggle-group-control.d.ts +0 -2
- package/build-types/validated-form-controls/test/toggle-group-control.d.ts.map +0 -1
- package/build-types/validated-form-controls/validity-indicator.d.ts +0 -6
- package/build-types/validated-form-controls/validity-indicator.d.ts.map +0 -1
- package/build-types/view/stories/index.story.d.ts +0 -6
- package/build-types/view/stories/index.story.d.ts.map +0 -1
- package/build-types/visually-hidden/stories/index.story.d.ts +0 -8
- package/build-types/visually-hidden/stories/index.story.d.ts.map +0 -1
- package/build-types/z-stack/stories/index.story.d.ts +0 -6
- package/build-types/z-stack/stories/index.story.d.ts.map +0 -1
- package/build-types/z-stack/styles.d.ts +0 -14
- package/build-types/z-stack/styles.d.ts.map +0 -1
- package/src/base-control/styles/base-control-styles.ts +0 -46
- package/src/border-box-control/styles.ts +0 -71
- package/src/border-control/styles.ts +0 -151
- package/src/box-control/styles/box-control-styles.ts +0 -34
- package/src/color-palette/styles.ts +0 -13
- package/src/combobox-control/styles.ts +0 -9
- package/src/dropdown/styles.ts +0 -33
- package/src/progress-bar/styles.ts +0 -84
- package/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.ts +0 -47
- package/src/scrollable/styles.ts +0 -57
- package/src/scrollable/test/__snapshots__/index.tsx.snap +0 -66
- package/src/textarea-control/styles/textarea-control-styles.ts +0 -90
- package/src/validated-form-controls/components/combobox-control.tsx +0 -56
- package/src/validated-form-controls/components/form-token-field.tsx +0 -57
- package/src/validated-form-controls/components/stories/combobox-control.story.tsx +0 -56
- package/src/validated-form-controls/components/stories/form-token-field.story.tsx +0 -60
- package/src/validated-form-controls/components/stories/input-control.story.tsx +0 -126
- package/src/validated-form-controls/components/stories/overview.story.tsx +0 -560
- package/src/validated-form-controls/components/stories/textarea-control.story.tsx +0 -50
- package/src/validated-form-controls/components/stories/toggle-control.story.tsx +0 -47
- package/src/validated-form-controls/components/stories/toggle-group-control.story.tsx +0 -58
- package/src/validated-form-controls/components/toggle-control.tsx +0 -40
- package/src/validated-form-controls/components/toggle-group-control.tsx +0 -55
- package/src/validated-form-controls/control-with-error.tsx +0 -321
- package/src/validated-form-controls/test/combobox-control.tsx +0 -61
- package/src/validated-form-controls/test/control-with-error.tsx +0 -577
- package/src/validated-form-controls/test/form-token-field.tsx +0 -52
- package/src/validated-form-controls/test/toggle-control.tsx +0 -49
- package/src/validated-form-controls/test/toggle-group-control.tsx +0 -28
- package/src/validated-form-controls/validity-indicator.tsx +0 -40
- package/src/z-stack/styles.ts +0 -35
- /package/src/context/test/{context-system-provider.js → context-system-provider.jsx} +0 -0
- /package/src/input-control/test/__snapshots__/{index.js.snap → index.jsx.snap} +0 -0
- /package/src/item-group/test/__snapshots__/{index.js.snap → index.jsx.snap} +0 -0
- /package/src/item-group/test/{index.js → index.jsx} +0 -0
- /package/src/menu-item/test/__snapshots__/{index.js.snap → index.jsx.snap} +0 -0
- /package/src/menu-item/test/{index.js → index.jsx} +0 -0
- /package/src/slot-fill/test/__snapshots__/{slot.js.snap → slot.jsx.snap} +0 -0
- /package/src/slot-fill/test/{index.js → index.jsx} +0 -0
- /package/src/slot-fill/test/{slot.js → slot.jsx} +0 -0
- /package/src/utils/hooks/test/{use-controlled-state.js → use-controlled-state.jsx} +0 -0
- /package/src/utils/hooks/test/{use-controlled-value.js → use-controlled-value.jsx} +0 -0
- /package/src/utils/hooks/test/{use-cx.js → use-cx.jsx} +0 -0
- /package/src/utils/test/{get-node-text.js → get-node-text.jsx} +0 -0
- /package/src/view/test/__snapshots__/{index.js.snap → index.jsx.snap} +0 -0
- /package/src/view/test/{index.js → index.jsx} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/confirm-dialog/component.tsx", "../../../style-runtime/src/index.ts", "../../src/confirm-dialog/style.module.scss"],
|
|
4
|
-
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { useCallback, useEffect, useRef, useState } from '@wordpress/element';\nimport Modal from '../modal';\nimport { useContextSystem, contextConnect } from '../context';\nimport { Flex } from '../flex';\nimport Button from '../button';\nimport { Text } from '../text';\nimport { VStack } from '../v-stack';\nimport styles from './style.module.scss';\nimport { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nconst UnconnectedConfirmDialog = (props, forwardedRef) => {\n const {\n isOpen: isOpenProp,\n onConfirm,\n onCancel,\n children,\n confirmButtonText,\n cancelButtonText,\n isBusy,\n ...otherProps\n } = useContextSystem(props, 'ConfirmDialog');\n const wrapperClassName = styles.wrapper;\n const cancelButtonRef = useRef(null);\n const confirmButtonRef = useRef(null);\n const [isOpen, setIsOpen] = useState();\n const [shouldSelfClose, setShouldSelfClose] = useState();\n useEffect(() => {\n // We only allow the dialog to close itself if `isOpenProp` is *not* set.\n // If `isOpenProp` is set, then it (probably) means it's controlled by a\n // parent component. In that case, `shouldSelfClose` might do more harm than\n // good, so we disable it.\n const isIsOpenSet = typeof isOpenProp !== 'undefined';\n setIsOpen(isIsOpenSet ? isOpenProp : true);\n setShouldSelfClose(!isIsOpenSet);\n }, [isOpenProp]);\n const handleEvent = useCallback(callback => event => {\n callback?.(event);\n if (shouldSelfClose) {\n setIsOpen(false);\n }\n }, [shouldSelfClose, setIsOpen]);\n const handleEnter = useCallback(event => {\n // Avoid triggering the 'confirm' action when a button is focused,\n // as this can cause a double submission.\n const isConfirmOrCancelButton = event.target === cancelButtonRef.current || event.target === confirmButtonRef.current;\n if (!isConfirmOrCancelButton && event.key === 'Enter') {\n handleEvent(onConfirm)(event);\n }\n }, [handleEvent, onConfirm]);\n const cancelLabel = cancelButtonText ?? __('Cancel');\n const confirmLabel = confirmButtonText ?? __('OK');\n return /*#__PURE__*/_jsx(_Fragment, {\n children: isOpen && /*#__PURE__*/_jsx(Modal, {\n onRequestClose: handleEvent(onCancel),\n onKeyDown: handleEnter,\n closeButtonLabel: cancelLabel,\n isDismissible: true,\n ref: forwardedRef,\n overlayClassName: wrapperClassName,\n __experimentalHideHeader: true,\n ...otherProps,\n children: /*#__PURE__*/_jsxs(VStack, {\n spacing: 8,\n children: [/*#__PURE__*/_jsx(Text, {\n children: children\n }), /*#__PURE__*/_jsxs(Flex, {\n direction: \"row\",\n justify: \"flex-end\",\n children: [/*#__PURE__*/_jsx(Button, {\n __next40pxDefaultSize: true,\n ref: cancelButtonRef,\n variant: \"tertiary\",\n onClick: handleEvent(onCancel),\n accessibleWhenDisabled: true,\n disabled: isBusy,\n children: cancelLabel\n }), /*#__PURE__*/_jsx(Button, {\n __next40pxDefaultSize: true,\n ref: confirmButtonRef,\n variant: \"primary\",\n onClick: handleEvent(onConfirm),\n accessibleWhenDisabled: true,\n disabled: isBusy,\n isBusy: isBusy,\n children: confirmLabel\n })]\n })]\n })\n })\n });\n};\n\n/**\n * `ConfirmDialog` is built on top of [`Modal`](/packages/components/src/modal/README.md)\n * and displays a confirmation dialog, with _confirm_ and _cancel_ buttons.\n *\n * The dialog is confirmed by clicking the _confirm_ button or by pressing the `Enter` key.\n * It is cancelled (closed) by clicking the _cancel_ button, by pressing the `ESC` key, or by\n * clicking outside the dialog focus (i.e. the overlay).\n *\n * `ConfirmDialog` has two main modes: controlled and uncontrolled.\n *\n * ### Uncontrolled mode\n *\n * Allows the component to be used standalone, just by declaring it as part of another React\n * component's render method:\n *\n * - It will be automatically open (displayed) upon mounting.\n * - It will be automatically closed when clicking the _cancel_ button, by pressing the `ESC`\n * key, or by clicking outside the dialog focus (i.e. the overlay).\n * - `onCancel` is not mandatory but can be passed. Even if passed, the dialog will still be\n * able to close itself.\n *\n * Activating this mode is as simple as omitting the `isOpen` prop. The only mandatory prop\n * in this case is the `onConfirm` callback. The message is passed as the `children`.\n *\n * ```jsx\n * import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';\n *\n * function Example() {\n * \treturn (\n * \t\t<ConfirmDialog onConfirm={ () => console.debug( 'Confirmed!' ) }>\n * \t\t\tAre you sure? <strong>This action cannot be undone!</strong>\n * \t\t</ConfirmDialog>\n * \t);\n * }\n * ```\n *\n * ### Controlled mode\n *\n * Let the parent component control when the dialog is open/closed. It's activated when a\n * boolean value is passed to `isOpen`:\n *\n * - It will not be automatically closed. You need to let it know when to open/close by\n * updating the value of the `isOpen` prop.\n * - Both `onConfirm` and the `onCancel` callbacks are mandatory props in this mode.\n * - You'll want to update the state that controls `isOpen` from the `onCancel` and\n * `onConfirm` callbacks.\n *\n * ```jsx\n * import { useState } from '@wordpress/element';\n * import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';\n *\n * function Example() {\n * \tconst [ isOpen, setIsOpen ] = useState( true );\n *\n * \tconst handleConfirm = () => {\n * \t\tconsole.debug( 'Confirmed!' );\n * \t\tsetIsOpen( false );\n * \t};\n *\n * \tconst handleCancel = () => {\n * \t\tconsole.debug( 'Cancelled!' );\n * \t\tsetIsOpen( false );\n * \t};\n *\n * \treturn (\n * \t\t<ConfirmDialog\n * \t\t\tisOpen={ isOpen }\n * \t\t\tonConfirm={ handleConfirm }\n * \t\t\tonCancel={ handleCancel }\n * \t\t>\n * \t\t\tAre you sure? <strong>This action cannot be undone!</strong>\n * \t\t</ConfirmDialog>\n * \t);\n * }\n * ```\n */\nexport const ConfirmDialog = contextConnect(UnconnectedConfirmDialog, 'ConfirmDialog');\nexport default ConfirmDialog;", "const STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n const globalScope = globalThis;\n if (globalScope.__wpStyleRuntime) {\n return globalScope.__wpStyleRuntime;\n }\n globalScope.__wpStyleRuntime = {\n documents: new Map(),\n styles: new Map(),\n injectedStyles: new WeakMap()\n };\n if (typeof document !== 'undefined') {\n registerDocument(document);\n }\n return globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(targetDocument, hash) {\n if (!targetDocument.head) {\n return false;\n }\n for (const style of targetDocument.head.querySelectorAll(`style[${STYLE_HASH_ATTRIBUTE}]`)) {\n if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle(targetDocument, hash, css) {\n if (!targetDocument.head) {\n return;\n }\n const runtime = getRuntime();\n let injectedStyles = runtime.injectedStyles.get(targetDocument);\n if (!injectedStyles) {\n injectedStyles = new Set();\n runtime.injectedStyles.set(targetDocument, injectedStyles);\n }\n if (injectedStyles.has(hash)) {\n return;\n }\n\n // Older generated CSS module output can still inject matching style tags\n // after this document's cache is created, so keep the DOM as the fallback\n // source of truth on cache misses.\n if (documentContainsStyleHash(targetDocument, hash)) {\n injectedStyles.add(hash);\n return;\n }\n const style = targetDocument.createElement('style');\n style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);\n style.appendChild(targetDocument.createTextNode(css));\n targetDocument.head.appendChild(style);\n injectedStyles.add(hash);\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument(targetDocument) {\n const runtime = getRuntime();\n runtime.documents.set(targetDocument, (runtime.documents.get(targetDocument) ?? 0) + 1);\n for (const [hash, css] of runtime.styles) {\n injectStyle(targetDocument, hash, css);\n }\n return () => {\n const count = runtime.documents.get(targetDocument);\n if (count === undefined) {\n return;\n }\n if (count <= 1) {\n runtime.documents.delete(targetDocument);\n return;\n }\n runtime.documents.set(targetDocument, count - 1);\n };\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle(hash, css) {\n const runtime = getRuntime();\n runtime.styles.set(hash, css);\n for (const targetDocument of runtime.documents.keys()) {\n injectStyle(targetDocument, hash, css);\n }\n}", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"af7a0f28df\", \".f8c6ba0dd016e6c1__wrapper.f8c6ba0dd016e6c1__wrapper{z-index:1000001}\");\n}\nexport default {\"wrapper\":\"f8c6ba0dd016e6c1__wrapper\"};\n"],
|
|
5
|
-
"mappings": ";AAAA,SAAS,UAAU;AACnB,SAAS,aAAa,WAAW,QAAQ,gBAAgB;AACzD,OAAO,WAAW;AAClB,SAAS,kBAAkB,sBAAsB;AACjD,SAAS,YAAY;AACrB,OAAO,YAAY;AACnB,SAAS,YAAY;AACrB,SAAS,cAAc;;;ACPvB,IAAM,uBAAuB;AAU7B,SAAS,aAAa;AACpB,QAAM,cAAc;AACpB,MAAI,YAAY,kBAAkB;AAChC,WAAO,YAAY;AAAA,EACrB;AACA,cAAY,mBAAmB;AAAA,IAC7B,WAAW,oBAAI,IAAI;AAAA,IACnB,QAAQ,oBAAI,IAAI;AAAA,IAChB,gBAAgB,oBAAI,QAAQ;AAAA,EAC9B;AACA,MAAI,OAAO,aAAa,aAAa;AACnC,qBAAiB,QAAQ;AAAA,EAC3B;AACA,SAAO,YAAY;AACrB;AAUA,SAAS,0BAA0B,gBAAgB,MAAM;AACvD,MAAI,CAAC,eAAe,MAAM;AACxB,WAAO;AAAA,EACT;AACA,aAAW,SA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,QAAM,cAAc,oBAAoB,GAAG,QAAQ;AACnD,QAAM,eAAe,qBAAqB,GAAG,IAAI;AACjD,SAAoB,qBAAK,WAAW;AAAA,IAClC,UAAU,UAAuB,qBAAK,OAAO;AAAA,MAC3C,gBAAgB,YAAY,QAAQ;AAAA,MACpC,WAAW;AAAA,MACX,kBAAkB;AAAA,MAClB,eAAe;AAAA,MACf,KAAK;AAAA,MACL,kBAAkB;AAAA,MAClB,
|
|
4
|
+
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { useCallback, useEffect, useRef, useState } from '@wordpress/element';\nimport Modal from '../modal';\nimport { useContextSystem, contextConnect } from '../context';\nimport { Flex } from '../flex';\nimport Button from '../button';\nimport { Text } from '../text';\nimport { VStack } from '../v-stack';\nimport styles from './style.module.scss';\nimport { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nconst UnconnectedConfirmDialog = (props, forwardedRef) => {\n const {\n isOpen: isOpenProp,\n onConfirm,\n onCancel,\n children,\n confirmButtonText,\n cancelButtonText,\n isBusy,\n title,\n __experimentalHideHeader = true,\n ...otherProps\n } = useContextSystem(props, 'ConfirmDialog');\n const wrapperClassName = styles.wrapper;\n const cancelButtonRef = useRef(null);\n const confirmButtonRef = useRef(null);\n const [isOpen, setIsOpen] = useState();\n const [shouldSelfClose, setShouldSelfClose] = useState();\n useEffect(() => {\n // We only allow the dialog to close itself if `isOpenProp` is *not* set.\n // If `isOpenProp` is set, then it (probably) means it's controlled by a\n // parent component. In that case, `shouldSelfClose` might do more harm than\n // good, so we disable it.\n const isIsOpenSet = typeof isOpenProp !== 'undefined';\n setIsOpen(isIsOpenSet ? isOpenProp : true);\n setShouldSelfClose(!isIsOpenSet);\n }, [isOpenProp]);\n const handleEvent = useCallback(callback => event => {\n callback?.(event);\n if (shouldSelfClose) {\n setIsOpen(false);\n }\n }, [shouldSelfClose, setIsOpen]);\n const handleEnter = useCallback(event => {\n // Avoid triggering the 'confirm' action when a button is focused,\n // as this can cause a double submission.\n const isConfirmOrCancelButton = event.target === cancelButtonRef.current || event.target === confirmButtonRef.current;\n if (!isConfirmOrCancelButton && event.key === 'Enter') {\n handleEvent(onConfirm)(event);\n }\n }, [handleEvent, onConfirm]);\n const cancelLabel = cancelButtonText ?? __('Cancel');\n const confirmLabel = confirmButtonText ?? __('OK');\n return /*#__PURE__*/_jsx(_Fragment, {\n children: isOpen && /*#__PURE__*/_jsx(Modal, {\n onRequestClose: handleEvent(onCancel),\n onKeyDown: handleEnter,\n closeButtonLabel: cancelLabel,\n isDismissible: true,\n ref: forwardedRef,\n overlayClassName: wrapperClassName,\n title: title,\n contentLabel: __experimentalHideHeader ? title : undefined,\n __experimentalHideHeader: __experimentalHideHeader,\n ...otherProps,\n children: /*#__PURE__*/_jsxs(VStack, {\n spacing: 8,\n children: [/*#__PURE__*/_jsx(Text, {\n children: children\n }), /*#__PURE__*/_jsxs(Flex, {\n direction: \"row\",\n justify: \"flex-end\",\n children: [/*#__PURE__*/_jsx(Button, {\n __next40pxDefaultSize: true,\n ref: cancelButtonRef,\n variant: \"tertiary\",\n onClick: handleEvent(onCancel),\n accessibleWhenDisabled: true,\n disabled: isBusy,\n children: cancelLabel\n }), /*#__PURE__*/_jsx(Button, {\n __next40pxDefaultSize: true,\n ref: confirmButtonRef,\n variant: \"primary\",\n onClick: handleEvent(onConfirm),\n accessibleWhenDisabled: true,\n disabled: isBusy,\n isBusy: isBusy,\n children: confirmLabel\n })]\n })]\n })\n })\n });\n};\n\n/**\n * `ConfirmDialog` is built on top of [`Modal`](/packages/components/src/modal/README.md)\n * and displays a confirmation dialog, with _confirm_ and _cancel_ buttons.\n *\n * The dialog is confirmed by clicking the _confirm_ button or by pressing the `Enter` key.\n * It is cancelled (closed) by clicking the _cancel_ button, by pressing the `ESC` key, or by\n * clicking outside the dialog focus (i.e. the overlay).\n *\n * `ConfirmDialog` has two main modes: controlled and uncontrolled.\n *\n * ### Uncontrolled mode\n *\n * Allows the component to be used standalone, just by declaring it as part of another React\n * component's render method:\n *\n * - It will be automatically open (displayed) upon mounting.\n * - It will be automatically closed when clicking the _cancel_ button, by pressing the `ESC`\n * key, or by clicking outside the dialog focus (i.e. the overlay).\n * - `onCancel` is not mandatory but can be passed. Even if passed, the dialog will still be\n * able to close itself.\n *\n * Activating this mode is as simple as omitting the `isOpen` prop. The only mandatory prop\n * in this case is the `onConfirm` callback. The message is passed as the `children`.\n *\n * ```jsx\n * import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';\n *\n * function Example() {\n * \treturn (\n * \t\t<ConfirmDialog onConfirm={ () => console.debug( 'Confirmed!' ) }>\n * \t\t\tAre you sure? <strong>This action cannot be undone!</strong>\n * \t\t</ConfirmDialog>\n * \t);\n * }\n * ```\n *\n * ### Controlled mode\n *\n * Let the parent component control when the dialog is open/closed. It's activated when a\n * boolean value is passed to `isOpen`:\n *\n * - It will not be automatically closed. You need to let it know when to open/close by\n * updating the value of the `isOpen` prop.\n * - Both `onConfirm` and the `onCancel` callbacks are mandatory props in this mode.\n * - You'll want to update the state that controls `isOpen` from the `onCancel` and\n * `onConfirm` callbacks.\n *\n * ```jsx\n * import { useState } from '@wordpress/element';\n * import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';\n *\n * function Example() {\n * \tconst [ isOpen, setIsOpen ] = useState( true );\n *\n * \tconst handleConfirm = () => {\n * \t\tconsole.debug( 'Confirmed!' );\n * \t\tsetIsOpen( false );\n * \t};\n *\n * \tconst handleCancel = () => {\n * \t\tconsole.debug( 'Cancelled!' );\n * \t\tsetIsOpen( false );\n * \t};\n *\n * \treturn (\n * \t\t<ConfirmDialog\n * \t\t\tisOpen={ isOpen }\n * \t\t\tonConfirm={ handleConfirm }\n * \t\t\tonCancel={ handleCancel }\n * \t\t>\n * \t\t\tAre you sure? <strong>This action cannot be undone!</strong>\n * \t\t</ConfirmDialog>\n * \t);\n * }\n * ```\n */\nexport const ConfirmDialog = contextConnect(UnconnectedConfirmDialog, 'ConfirmDialog');\nexport default ConfirmDialog;", "const STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n const globalScope = globalThis;\n if (globalScope.__wpStyleRuntime) {\n return globalScope.__wpStyleRuntime;\n }\n globalScope.__wpStyleRuntime = {\n documents: new Map(),\n styles: new Map(),\n injectedStyles: new WeakMap()\n };\n if (typeof document !== 'undefined') {\n registerDocument(document);\n }\n return globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(targetDocument, hash) {\n if (!targetDocument.head) {\n return false;\n }\n for (const style of targetDocument.head.querySelectorAll(`style[${STYLE_HASH_ATTRIBUTE}]`)) {\n if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle(targetDocument, hash, css) {\n if (!targetDocument.head) {\n return;\n }\n const runtime = getRuntime();\n let injectedStyles = runtime.injectedStyles.get(targetDocument);\n if (!injectedStyles) {\n injectedStyles = new Set();\n runtime.injectedStyles.set(targetDocument, injectedStyles);\n }\n if (injectedStyles.has(hash)) {\n return;\n }\n\n // Older generated CSS module output can still inject matching style tags\n // after this document's cache is created, so keep the DOM as the fallback\n // source of truth on cache misses.\n if (documentContainsStyleHash(targetDocument, hash)) {\n injectedStyles.add(hash);\n return;\n }\n const style = targetDocument.createElement('style');\n style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);\n style.appendChild(targetDocument.createTextNode(css));\n targetDocument.head.appendChild(style);\n injectedStyles.add(hash);\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument(targetDocument) {\n const runtime = getRuntime();\n runtime.documents.set(targetDocument, (runtime.documents.get(targetDocument) ?? 0) + 1);\n for (const [hash, css] of runtime.styles) {\n injectStyle(targetDocument, hash, css);\n }\n return () => {\n const count = runtime.documents.get(targetDocument);\n if (count === undefined) {\n return;\n }\n if (count <= 1) {\n runtime.documents.delete(targetDocument);\n return;\n }\n runtime.documents.set(targetDocument, count - 1);\n };\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle(hash, css) {\n const runtime = getRuntime();\n runtime.styles.set(hash, css);\n for (const targetDocument of runtime.documents.keys()) {\n injectStyle(targetDocument, hash, css);\n }\n}", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"af7a0f28df\", \".f8c6ba0dd016e6c1__wrapper.f8c6ba0dd016e6c1__wrapper{z-index:1000001}\");\n}\nexport default {\"wrapper\":\"f8c6ba0dd016e6c1__wrapper\"};\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,UAAU;AACnB,SAAS,aAAa,WAAW,QAAQ,gBAAgB;AACzD,OAAO,WAAW;AAClB,SAAS,kBAAkB,sBAAsB;AACjD,SAAS,YAAY;AACrB,OAAO,YAAY;AACnB,SAAS,YAAY;AACrB,SAAS,cAAc;;;ACPvB,IAAM,uBAAuB;AAU7B,SAAS,aAAa;AACpB,QAAM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AAA,YAC9B,wBAAwB;AAAA,YACxB,UAAU;AAAA,YACV;AAAA,YACA,UAAU;AAAA,UACZ,CAAC,CAAC;AAAA,QACJ,CAAC,CAAC;AAAA,MACJ,CAAC;AAAA,IACH,CAAC;AAAA,EACH,CAAC;AACH;AA8EO,IAAM,gBAAgB,eAAe,0BAA0B,eAAe;AACrF,IAAO,oBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -84,7 +84,7 @@ function registerStyle(hash, css) {
|
|
|
84
84
|
|
|
85
85
|
// packages/components/src/content-editable-control/style.module.scss
|
|
86
86
|
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
|
|
87
|
-
registerStyle("
|
|
87
|
+
registerStyle("3558237a49", "._0f130cee1a924516__editable{background:var(--wp-components-color-background,var(--wpds-color-background-surface-neutral-strong,#fff));border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-interactive-neutral,#8d8d8d);border-radius:var(--wpds-border-radius-sm,2px);color:var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:normal;padding:6px 8px;width:100%}@media (min-width:600px){._0f130cee1a924516__editable{font-size:13px;line-height:normal}}._0f130cee1a924516__editable:hover:not(:disabled,[aria-disabled=true],[type=checkbox]){border-color:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e)}._0f130cee1a924516__editable:focus{border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);box-shadow:none;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}._0f130cee1a924516__editable::placeholder{color:rgba(30,30,30,.62)}._0f130cee1a924516__editable[aria-placeholder]:empty:before{color:color-mix(in srgb,var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e)),transparent 38%);content:attr(aria-placeholder)}._0f130cee1a924516__editable{min-height:40px;padding:12px}._0f130cee1a924516__editable[aria-disabled=true]{background:var(--wp-components-color-gray-100,var(--wpds-color-background-surface-neutral,#fcfcfc));border-color:var(--wp-components-color-gray-300,var(--wpds-color-stroke-surface-neutral,#dbdbdb));color:var(--wp-components-color-gray-700,var(--wpds-color-foreground-content-neutral-weak,#707070));cursor:default}");
|
|
88
88
|
}
|
|
89
89
|
var style_module_default = { "editable": "_0f130cee1a924516__editable" };
|
|
90
90
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/content-editable-control/index.tsx", "../../../style-runtime/src/index.ts", "../../src/content-editable-control/style.module.scss"],
|
|
4
|
-
"sourcesContent": ["import { useMergeRefs } from '@wordpress/compose';\nimport { forwardRef, useRef } from '@wordpress/element';\nimport BaseControl from '../base-control';\nimport { useBaseControlProps } from '../base-control/hooks';\nimport { VisuallyHidden } from '../visually-hidden';\nimport styles from './style.module.scss';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction UnforwardedContentEditableControl({\n label,\n id,\n className,\n help,\n hideLabelFromVision,\n disabled,\n required,\n placeholder,\n ...additionalProps\n}, forwardedRef) {\n // The label is not passed through to `BaseControl`: it would render a\n // `<label for>` pointing at the `contentEditable` `div`, which is not a\n // labelable element, making the association invalid. The label is instead\n // rendered here without `for` and wired up via `aria-labelledby`.\n const {\n baseControlProps,\n controlProps\n } = useBaseControlProps({\n id,\n className,\n help\n });\n const labelId = `${controlProps.id}__label`;\n const editableRef = useRef(null);\n const mergedRefs = useMergeRefs([editableRef, forwardedRef]);\n return /*#__PURE__*/_jsxs(BaseControl, {\n ...baseControlProps,\n children: [hideLabelFromVision ? /*#__PURE__*/_jsx(VisuallyHidden, {\n id: labelId,\n children: label\n }) : /*#__PURE__*/_jsx(BaseControl.VisualLabel, {\n id: labelId\n // Focus the field on label click, like `<label for>` would.\n ,\n onClick: () => editableRef.current?.focus(),\n children: label\n }), /*#__PURE__*/_jsx(\"div\", {\n className: styles.editable,\n role: \"textbox\",\n \"aria-multiline\": true,\n \"aria-labelledby\": labelId,\n \"aria-placeholder\": placeholder || undefined,\n \"aria-disabled\": disabled || undefined,\n \"aria-required\": required || undefined,\n ref: mergedRefs\n // A disabled field is not `contentEditable`, which also\n // removes it from the tab order.\n ,\n contentEditable: !disabled,\n suppressContentEditableWarning: true,\n ...additionalProps,\n ...controlProps\n })]\n });\n}\n\n/**\n * A presentational `contentEditable` form control: a labeled editable element\n * rendered with the chrome (`BaseControl` + label) shared by the other form\n * controls in the package.\n *\n * Unlike the in-canvas `RichText` from `@wordpress/block-editor`, this control\n * is intended for standalone form fields (DataForms, sidebar inputs, etc.).\n * It is deliberately **presentational only** and has no `@wordpress/rich-text`\n * dependency: the editable behavior (value, formatting, keyboard shortcuts)\n * and any focus/selection tracking are owned by the consumer, which wires them\n * through the forwarded ref and native event props (see the richtext DataForm\n * control in `@wordpress/dataviews` for the canonical assembly).\n *\n * ```jsx\n * // The rich-text \"assembly\" lives in the consumer.\n * <ContentEditableControl\n * label=\"Caption\"\n * ref={ mergedRef }\n * onFocus={ onEditableFocus }\n * onBlur={ onEditableBlur }\n * />\n * ```\n */\nexport const ContentEditableControl = forwardRef(UnforwardedContentEditableControl);\nexport default ContentEditableControl;", "const STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n const globalScope = globalThis;\n if (globalScope.__wpStyleRuntime) {\n return globalScope.__wpStyleRuntime;\n }\n globalScope.__wpStyleRuntime = {\n documents: new Map(),\n styles: new Map(),\n injectedStyles: new WeakMap()\n };\n if (typeof document !== 'undefined') {\n registerDocument(document);\n }\n return globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(targetDocument, hash) {\n if (!targetDocument.head) {\n return false;\n }\n for (const style of targetDocument.head.querySelectorAll(`style[${STYLE_HASH_ATTRIBUTE}]`)) {\n if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle(targetDocument, hash, css) {\n if (!targetDocument.head) {\n return;\n }\n const runtime = getRuntime();\n let injectedStyles = runtime.injectedStyles.get(targetDocument);\n if (!injectedStyles) {\n injectedStyles = new Set();\n runtime.injectedStyles.set(targetDocument, injectedStyles);\n }\n if (injectedStyles.has(hash)) {\n return;\n }\n\n // Older generated CSS module output can still inject matching style tags\n // after this document's cache is created, so keep the DOM as the fallback\n // source of truth on cache misses.\n if (documentContainsStyleHash(targetDocument, hash)) {\n injectedStyles.add(hash);\n return;\n }\n const style = targetDocument.createElement('style');\n style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);\n style.appendChild(targetDocument.createTextNode(css));\n targetDocument.head.appendChild(style);\n injectedStyles.add(hash);\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument(targetDocument) {\n const runtime = getRuntime();\n runtime.documents.set(targetDocument, (runtime.documents.get(targetDocument) ?? 0) + 1);\n for (const [hash, css] of runtime.styles) {\n injectStyle(targetDocument, hash, css);\n }\n return () => {\n const count = runtime.documents.get(targetDocument);\n if (count === undefined) {\n return;\n }\n if (count <= 1) {\n runtime.documents.delete(targetDocument);\n return;\n }\n runtime.documents.set(targetDocument, count - 1);\n };\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle(hash, css) {\n const runtime = getRuntime();\n runtime.styles.set(hash, css);\n for (const targetDocument of runtime.documents.keys()) {\n injectStyle(targetDocument, hash, css);\n }\n}", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"
|
|
5
|
-
"mappings": ";AAAA,SAAS,oBAAoB;AAC7B,SAAS,YAAY,cAAc;AACnC,OAAO,iBAAiB;AACxB,SAAS,2BAA2B;AACpC,SAAS,sBAAsB;;;ACJ/B,IAAM,uBAAuB;AAU7B,SAAS,aAAa;AACpB,QAAM,cAAc;AACpB,MAAI,YAAY,kBAAkB;AAChC,WAAO,YAAY;AAAA,EACrB;AACA,cAAY,mBAAmB;AAAA,IAC7B,WAAW,oBAAI,IAAI;AAAA,IACnB,QAAQ,oBAAI,IAAI;AAAA,IAChB,gBAAgB,oBAAI,QAAQ;AAAA,EAC9B;AACA,MAAI,OAAO,aAAa,aAAa;AACnC,qBAAiB,QAAQ;AAAA,EAC3B;AACA,SAAO,YAAY;AACrB;AAUA,SAAS,0BAA0B,gBAAgB,MAAM;AACvD,MAAI,CAAC,eAAe,MAAM;AACxB,WAAO;AAAA,EACT;AACA,aAAW,SAAS,eAAe,KAAK,iBAAiB,SAAS,oBAAoB,GAAG,GAAG;AAC1F,QAAI,MAAM,aAAa,oBAAoB,MAAM,MAAM;AACrD,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;AAUA,SAAS,YAAY,gBAAg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Ae,QAAQ,IAAI,aAAa,QAAQ;AACtE,gBAAc,cAAc,
|
|
4
|
+
"sourcesContent": ["import { useMergeRefs } from '@wordpress/compose';\nimport { forwardRef, useRef } from '@wordpress/element';\nimport BaseControl from '../base-control';\nimport { useBaseControlProps } from '../base-control/hooks';\nimport { VisuallyHidden } from '../visually-hidden';\nimport styles from './style.module.scss';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction UnforwardedContentEditableControl({\n label,\n id,\n className,\n help,\n hideLabelFromVision,\n disabled,\n required,\n placeholder,\n ...additionalProps\n}, forwardedRef) {\n // The label is not passed through to `BaseControl`: it would render a\n // `<label for>` pointing at the `contentEditable` `div`, which is not a\n // labelable element, making the association invalid. The label is instead\n // rendered here without `for` and wired up via `aria-labelledby`.\n const {\n baseControlProps,\n controlProps\n } = useBaseControlProps({\n id,\n className,\n help\n });\n const labelId = `${controlProps.id}__label`;\n const editableRef = useRef(null);\n const mergedRefs = useMergeRefs([editableRef, forwardedRef]);\n return /*#__PURE__*/_jsxs(BaseControl, {\n ...baseControlProps,\n children: [hideLabelFromVision ? /*#__PURE__*/_jsx(VisuallyHidden, {\n id: labelId,\n children: label\n }) : /*#__PURE__*/_jsx(BaseControl.VisualLabel, {\n id: labelId\n // Focus the field on label click, like `<label for>` would.\n ,\n onClick: () => editableRef.current?.focus(),\n children: label\n }), /*#__PURE__*/_jsx(\"div\", {\n className: styles.editable,\n role: \"textbox\",\n \"aria-multiline\": true,\n \"aria-labelledby\": labelId,\n \"aria-placeholder\": placeholder || undefined,\n \"aria-disabled\": disabled || undefined,\n \"aria-required\": required || undefined,\n ref: mergedRefs\n // A disabled field is not `contentEditable`, which also\n // removes it from the tab order.\n ,\n contentEditable: !disabled,\n suppressContentEditableWarning: true,\n ...additionalProps,\n ...controlProps\n })]\n });\n}\n\n/**\n * A presentational `contentEditable` form control: a labeled editable element\n * rendered with the chrome (`BaseControl` + label) shared by the other form\n * controls in the package.\n *\n * Unlike the in-canvas `RichText` from `@wordpress/block-editor`, this control\n * is intended for standalone form fields (DataForms, sidebar inputs, etc.).\n * It is deliberately **presentational only** and has no `@wordpress/rich-text`\n * dependency: the editable behavior (value, formatting, keyboard shortcuts)\n * and any focus/selection tracking are owned by the consumer, which wires them\n * through the forwarded ref and native event props (see the richtext DataForm\n * control in `@wordpress/dataviews` for the canonical assembly).\n *\n * ```jsx\n * // The rich-text \"assembly\" lives in the consumer.\n * <ContentEditableControl\n * label=\"Caption\"\n * ref={ mergedRef }\n * onFocus={ onEditableFocus }\n * onBlur={ onEditableBlur }\n * />\n * ```\n */\nexport const ContentEditableControl = forwardRef(UnforwardedContentEditableControl);\nexport default ContentEditableControl;", "const STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n const globalScope = globalThis;\n if (globalScope.__wpStyleRuntime) {\n return globalScope.__wpStyleRuntime;\n }\n globalScope.__wpStyleRuntime = {\n documents: new Map(),\n styles: new Map(),\n injectedStyles: new WeakMap()\n };\n if (typeof document !== 'undefined') {\n registerDocument(document);\n }\n return globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(targetDocument, hash) {\n if (!targetDocument.head) {\n return false;\n }\n for (const style of targetDocument.head.querySelectorAll(`style[${STYLE_HASH_ATTRIBUTE}]`)) {\n if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle(targetDocument, hash, css) {\n if (!targetDocument.head) {\n return;\n }\n const runtime = getRuntime();\n let injectedStyles = runtime.injectedStyles.get(targetDocument);\n if (!injectedStyles) {\n injectedStyles = new Set();\n runtime.injectedStyles.set(targetDocument, injectedStyles);\n }\n if (injectedStyles.has(hash)) {\n return;\n }\n\n // Older generated CSS module output can still inject matching style tags\n // after this document's cache is created, so keep the DOM as the fallback\n // source of truth on cache misses.\n if (documentContainsStyleHash(targetDocument, hash)) {\n injectedStyles.add(hash);\n return;\n }\n const style = targetDocument.createElement('style');\n style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);\n style.appendChild(targetDocument.createTextNode(css));\n targetDocument.head.appendChild(style);\n injectedStyles.add(hash);\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument(targetDocument) {\n const runtime = getRuntime();\n runtime.documents.set(targetDocument, (runtime.documents.get(targetDocument) ?? 0) + 1);\n for (const [hash, css] of runtime.styles) {\n injectStyle(targetDocument, hash, css);\n }\n return () => {\n const count = runtime.documents.get(targetDocument);\n if (count === undefined) {\n return;\n }\n if (count <= 1) {\n runtime.documents.delete(targetDocument);\n return;\n }\n runtime.documents.set(targetDocument, count - 1);\n };\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle(hash, css) {\n const runtime = getRuntime();\n runtime.styles.set(hash, css);\n for (const targetDocument of runtime.documents.keys()) {\n injectStyle(targetDocument, hash, css);\n }\n}", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"3558237a49\", \"._0f130cee1a924516__editable{background:var(--wp-components-color-background,var(--wpds-color-background-surface-neutral-strong,#fff));border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-interactive-neutral,#8d8d8d);border-radius:var(--wpds-border-radius-sm,2px);color:var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:normal;padding:6px 8px;width:100%}@media (min-width:600px){._0f130cee1a924516__editable{font-size:13px;line-height:normal}}._0f130cee1a924516__editable:hover:not(:disabled,[aria-disabled=true],[type=checkbox]){border-color:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e)}._0f130cee1a924516__editable:focus{border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);box-shadow:none;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}._0f130cee1a924516__editable::placeholder{color:rgba(30,30,30,.62)}._0f130cee1a924516__editable[aria-placeholder]:empty:before{color:color-mix(in srgb,var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e)),transparent 38%);content:attr(aria-placeholder)}._0f130cee1a924516__editable{min-height:40px;padding:12px}._0f130cee1a924516__editable[aria-disabled=true]{background:var(--wp-components-color-gray-100,var(--wpds-color-background-surface-neutral,#fcfcfc));border-color:var(--wp-components-color-gray-300,var(--wpds-color-stroke-surface-neutral,#dbdbdb));color:var(--wp-components-color-gray-700,var(--wpds-color-foreground-content-neutral-weak,#707070));cursor:default}\");\n}\nexport default {\"editable\":\"_0f130cee1a924516__editable\"};\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,oBAAoB;AAC7B,SAAS,YAAY,cAAc;AACnC,OAAO,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AU,CAAC,sBAAmC,qBAAK,gBAAgB;AAAA,MACjE,IAAI;AAAA,MACJ,UAAU;AAAA,IACZ,CAAC,IAAiB,qBAAK,YAAY,aAAa;AAAA,MAC9C,IAAI;AAAA,MAGJ,SAAS,MAAM,YAAY,SAAS,MAAM;AAAA,MAC1C,UAAU;AAAA,IACZ,CAAC,GAAgB,qBAAK,OAAO;AAAA,MAC3B,WAAW,qBAAO;AAAA,MAClB,MAAM;AAAA,MACN,kBAAkB;AAAA,MAClB,mBAAmB;AAAA,MACnB,oBAAoB,eAAe;AAAA,MACnC,iBAAiB,YAAY;AAAA,MAC7B,iBAAiB,YAAY;AAAA,MAC7B,KAAK;AAAA,MAIL,iBAAiB,CAAC;AAAA,MAClB,gCAAgC;AAAA,MAChC,GAAG;AAAA,MACH,GAAG;AAAA,IACL,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;AAyBO,IAAM,yBAAyB,WAAW,iCAAiC;AAClF,IAAO,mCAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// packages/components/src/context/context-system-provider.
|
|
1
|
+
// packages/components/src/context/context-system-provider.jsx
|
|
2
2
|
import deepmerge from "deepmerge";
|
|
3
3
|
import fastDeepEqual from "fast-deep-equal/es6/index.js";
|
|
4
4
|
import { isPlainObject } from "is-plain-object";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/context/context-system-provider.
|
|
4
|
-
"sourcesContent": ["import deepmerge from 'deepmerge';\nimport fastDeepEqual from 'fast-deep-equal/es6/index.js';\
|
|
5
|
-
"mappings": ";AAAA,OAAO,eAAe;AACtB,OAAO,mBAAmB;
|
|
3
|
+
"sources": ["../../src/context/context-system-provider.jsx"],
|
|
4
|
+
"sourcesContent": ["import deepmerge from 'deepmerge';\nimport fastDeepEqual from 'fast-deep-equal/es6/index.js';\nimport { isPlainObject } from 'is-plain-object';\nimport { createContext, useContext, useRef, useMemo, memo } from '@wordpress/element';\nimport warn from '@wordpress/warning';\nimport { useUpdateEffect } from '../utils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComponentsContext = createContext(/** @type {Record<string, any>} */{});\nComponentsContext.displayName = 'ComponentsContext';\nexport const useComponentsContext = () => useContext(ComponentsContext);\n\n/**\n * Consolidates incoming ContextSystem values with a (potential) parent ContextSystem value.\n *\n * Note: This function will warn if it detects an un-memoized `value`\n *\n * @param {Object} props\n * @param {Record<string, any>} props.value\n * @return {Record<string, any>} The consolidated value.\n */\nfunction useContextSystemBridge({\n value\n}) {\n const parentContext = useComponentsContext();\n const valueRef = useRef(value);\n useUpdateEffect(() => {\n if (\n // Objects are equivalent.\n fastDeepEqual(valueRef.current, value) &&\n // But not the same reference.\n valueRef.current !== value) {\n globalThis.SCRIPT_DEBUG === true ? warn(`Please memoize your context: ${JSON.stringify(value)}`) : void 0;\n }\n }, [value]);\n\n // `parentContext` will always be memoized (i.e., the result of this hook itself)\n // or the default value from when the `ComponentsContext` was originally\n // initialized (which will never change, it's a static variable)\n // so this memoization will prevent `deepmerge()` from rerunning unless\n // the references to `value` change OR the `parentContext` has an actual material change\n // (because again, it's guaranteed to be memoized or a static reference to the empty object\n // so we know that the only changes for `parentContext` are material ones... i.e., why we\n // don't have to warn in the `useUpdateEffect` hook above for `parentContext` and we only\n // need to bother with the `value`). The `useUpdateEffect` above will ensure that we are\n // correctly warning when the `value` isn't being properly memoized. All of that to say\n // that this should be super safe to assume that `useMemo` will only run on actual\n // changes to the two dependencies, therefore saving us calls to `deepmerge()`!\n const config = useMemo(() => {\n // Deep clone `parentContext` to avoid mutating it later.\n return deepmerge(parentContext ?? {}, value ?? {}, {\n isMergeableObject: isPlainObject\n });\n }, [parentContext, value]);\n return config;\n}\n\n/**\n * A Provider component that can modify props for connected components within\n * the Context system.\n *\n * @example\n * ```jsx\n * <ContextSystemProvider value={{ Button: { size: 'small' }}}>\n * <Button>...</Button>\n * </ContextSystemProvider>\n * ```\n *\n * @template {Record<string, any>} T\n * @param {Object} options\n * @param {React.ReactNode} options.children Children to render.\n * @param {T} options.value Props to render into connected components.\n * @return {React.JSX.Element} A Provider wrapped component.\n */\nconst BaseContextSystemProvider = ({\n children,\n value\n}) => {\n const contextValue = useContextSystemBridge({\n value\n });\n return /*#__PURE__*/_jsx(ComponentsContext.Provider, {\n value: contextValue,\n children: children\n });\n};\nexport const ContextSystemProvider = memo(BaseContextSystemProvider);"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,eAAe;AACtB,OAAO,mBAAmB;AAC1B,SAAS,qBAAqB;AAC9B,SAAS,eAAe,YAAY,QAAQ,SAAS,YAAY;AACjE,OAAO,UAAU;AACjB,SAAS,uBAAuB;AAChC,SAAS,OAAO,YAAY;AACrB,IAAM,oBAAoB;AAAA;AAAA,EAAgD,CAAC;AAAC;AACnF,kBAAkB,cAAc;AACzB,IAAM,uBAAuB,MAAM,WAAW,iBAAiB;AAWtE,SAAS,uBAAuB;AAAA,EAC9B;AACF,GAAG;AACD,QAAM,gBAAgB,qBAAqB;AAC3C,QAAM,WAAW,OAAO,KAAK;AAC7B,kBAAgB,MAAM;AACpB;AAAA;AAAA,MAEA,cAAc,SAAS,SAAS,KAAK;AAAA,MAErC,SAAS,YAAY;AAAA,MAAO;AAC1B,iBAAW,iBAAiB,OAAO,KAAK,gCAAgC,KAAK,UAAU,KAAK,CAAC,EAAE,IAAI;AAAA,IACrG;AAAA,EACF,GAAG,CAAC,KAAK,CAAC;AAcV,QAAM,SAAS,QAAQ,MAAM;AAE3B,WAAO,UAAU,iBAAiB,CAAC,GAAG,SAAS,CAAC,GAAG;AAAA,MACjD,mBAAmB;AAAA,IACrB,CAAC;AAAA,EACH,GAAG,CAAC,eAAe,KAAK,CAAC;AACzB,SAAO;AACT;AAmBA,IAAM,4BAA4B,CAAC;AAAA,EACjC;AAAA,EACA;AACF,MAAM;AACJ,QAAM,eAAe,uBAAuB;AAAA,IAC1C;AAAA,EACF,CAAC;AACD,SAAoB,qBAAK,kBAAkB,UAAU;AAAA,IACnD,OAAO;AAAA,IACP;AAAA,EACF,CAAC;AACH;AACO,IAAM,wBAAwB,KAAK,yBAAyB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,6 +18,7 @@ function ControlPointButton({
|
|
|
18
18
|
isOpen,
|
|
19
19
|
position,
|
|
20
20
|
color,
|
|
21
|
+
disablePositioning,
|
|
21
22
|
...additionalProps
|
|
22
23
|
}) {
|
|
23
24
|
const instanceId = useInstanceId(ControlPointButton);
|
|
@@ -40,7 +41,7 @@ function ControlPointButton({
|
|
|
40
41
|
...additionalProps
|
|
41
42
|
}), /* @__PURE__ */ _jsx(VisuallyHidden, {
|
|
42
43
|
id: descriptionId,
|
|
43
|
-
children: __("Use your left or right arrow keys or drag and drop with the mouse to change the gradient position. Press the button to change the color or remove the control point.")
|
|
44
|
+
children: disablePositioning ? __("Press the button to change the color.") : __("Use your left or right arrow keys or drag and drop with the mouse to change the gradient position. Press the button to change the color or remove the control point.")
|
|
44
45
|
})]
|
|
45
46
|
});
|
|
46
47
|
}
|
|
@@ -68,6 +69,7 @@ function GradientColorPickerDropdown({
|
|
|
68
69
|
function ControlPoints({
|
|
69
70
|
disableRemove,
|
|
70
71
|
disableAlpha,
|
|
72
|
+
disablePositioning,
|
|
71
73
|
gradientPickerDomRef,
|
|
72
74
|
ignoreMarkerPosition,
|
|
73
75
|
value: controlPoints,
|
|
@@ -129,6 +131,9 @@ function ControlPoints({
|
|
|
129
131
|
onToggle();
|
|
130
132
|
},
|
|
131
133
|
onMouseDown: () => {
|
|
134
|
+
if (disablePositioning) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
132
137
|
if (window && window.addEventListener) {
|
|
133
138
|
controlPointMoveStateRef.current = {
|
|
134
139
|
initialPosition,
|
|
@@ -142,6 +147,12 @@ function ControlPoints({
|
|
|
142
147
|
}
|
|
143
148
|
},
|
|
144
149
|
onKeyDown: (event) => {
|
|
150
|
+
if (disablePositioning) {
|
|
151
|
+
if (event.code === "ArrowLeft" || event.code === "ArrowRight") {
|
|
152
|
+
event.stopPropagation();
|
|
153
|
+
}
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
145
156
|
if (event.code === "ArrowLeft") {
|
|
146
157
|
event.stopPropagation();
|
|
147
158
|
onChange(updateControlPointPosition(controlPoints, index, clampPercent(point.position - KEYBOARD_CONTROL_POINT_VARIATION)));
|
|
@@ -152,7 +163,8 @@ function ControlPoints({
|
|
|
152
163
|
},
|
|
153
164
|
isOpen,
|
|
154
165
|
position: point.position,
|
|
155
|
-
color: point.color
|
|
166
|
+
color: point.color,
|
|
167
|
+
disablePositioning
|
|
156
168
|
}, index),
|
|
157
169
|
renderContent: ({
|
|
158
170
|
onClose
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/custom-gradient-picker/gradient-bar/control-points.tsx"],
|
|
4
|
-
"sourcesContent": ["import clsx from 'clsx';\nimport { colord } from 'colord';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useEffect, useRef, useState, useMemo } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { plus } from '@wordpress/icons';\nimport Button from '../../button';\nimport { HStack } from '../../h-stack';\nimport { ColorPicker } from '../../color-picker';\nimport { VisuallyHidden } from '../../visually-hidden';\nimport { CustomColorPickerDropdown } from '../../color-palette';\nimport { addControlPoint, clampPercent, removeControlPoint, updateControlPointColor, updateControlPointColorByPosition, updateControlPointPosition, getHorizontalRelativeGradientPosition } from './utils';\nimport { MINIMUM_SIGNIFICANT_MOVE, KEYBOARD_CONTROL_POINT_VARIATION } from './constants';\nimport DropdownContentWrapper from '../../dropdown/dropdown-content-wrapper';\nimport { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction ControlPointButton({\n isOpen,\n position,\n color,\n ...additionalProps\n}) {\n const instanceId = useInstanceId(ControlPointButton);\n const descriptionId = `components-custom-gradient-picker__control-point-button-description-${instanceId}`;\n return /*#__PURE__*/_jsxs(_Fragment, {\n children: [/*#__PURE__*/_jsx(Button, {\n \"aria-label\": sprintf(\n // translators: 1: gradient position e.g: 70. 2: gradient color code e.g: rgb(52,121,151).\n __('Gradient control point at position %1$d%% with color code %2$s.'), position, color),\n \"aria-describedby\": descriptionId,\n \"aria-haspopup\": \"true\",\n \"aria-expanded\": isOpen,\n __next40pxDefaultSize: true,\n className: clsx('components-custom-gradient-picker__control-point-button', {\n 'is-active': isOpen\n }),\n ...additionalProps\n }), /*#__PURE__*/_jsx(VisuallyHidden, {\n id: descriptionId,\n children: __('Use your left or right arrow keys or drag and drop with the mouse to change the gradient position. Press the button to change the color or remove the control point.')\n })]\n });\n}\nfunction GradientColorPickerDropdown({\n isRenderedInSidebar,\n className,\n ...props\n}) {\n // Open the popover below the gradient control/insertion point\n const popoverProps = useMemo(() => ({\n placement: 'bottom',\n offset: 8,\n // Disabling resize as it would otherwise cause the popover to show\n // scrollbars while dragging the color picker's handle close to the\n // popover edge.\n resize: false\n }), []);\n const mergedClassName = clsx('components-custom-gradient-picker__control-point-dropdown', className);\n return /*#__PURE__*/_jsx(CustomColorPickerDropdown, {\n isRenderedInSidebar: isRenderedInSidebar,\n popoverProps: popoverProps,\n className: mergedClassName,\n ...props\n });\n}\nfunction ControlPoints({\n disableRemove,\n disableAlpha,\n gradientPickerDomRef,\n ignoreMarkerPosition,\n value: controlPoints,\n onChange,\n onStartControlPointChange,\n onStopControlPointChange,\n __experimentalIsRenderedInSidebar\n}) {\n const controlPointMoveStateRef = useRef(undefined);\n const onMouseMove = event => {\n if (controlPointMoveStateRef.current === undefined || gradientPickerDomRef.current === null) {\n return;\n }\n const relativePosition = getHorizontalRelativeGradientPosition(event.clientX, gradientPickerDomRef.current);\n const {\n initialPosition,\n index,\n significantMoveHappened\n } = controlPointMoveStateRef.current;\n if (!significantMoveHappened && Math.abs(initialPosition - relativePosition) >= MINIMUM_SIGNIFICANT_MOVE) {\n controlPointMoveStateRef.current.significantMoveHappened = true;\n }\n onChange(updateControlPointPosition(controlPoints, index, relativePosition));\n };\n const cleanEventListeners = () => {\n if (window && window.removeEventListener && controlPointMoveStateRef.current && controlPointMoveStateRef.current.listenersActivated) {\n window.removeEventListener('mousemove', onMouseMove);\n window.removeEventListener('mouseup', cleanEventListeners);\n onStopControlPointChange();\n controlPointMoveStateRef.current.listenersActivated = false;\n }\n };\n\n // Adding `cleanEventListeners` to the dependency array below requires the function itself to be wrapped in a `useCallback`\n // This memoization would prevent the event listeners from being properly cleaned.\n // Instead, we'll pass a ref to the function in our `useEffect` so `cleanEventListeners` itself is no longer a dependency.\n const cleanEventListenersRef = useRef(undefined);\n cleanEventListenersRef.current = cleanEventListeners;\n useEffect(() => {\n return () => {\n cleanEventListenersRef.current?.();\n };\n }, []);\n return /*#__PURE__*/_jsx(_Fragment, {\n children: controlPoints.map((point, index) => {\n const initialPosition = point?.position;\n return ignoreMarkerPosition !== initialPosition && /*#__PURE__*/_jsx(GradientColorPickerDropdown, {\n isRenderedInSidebar: __experimentalIsRenderedInSidebar,\n onClose: onStopControlPointChange,\n renderToggle: ({\n isOpen,\n onToggle\n }) => /*#__PURE__*/_jsx(ControlPointButton, {\n onClick: () => {\n if (controlPointMoveStateRef.current && controlPointMoveStateRef.current.significantMoveHappened) {\n return;\n }\n if (isOpen) {\n onStopControlPointChange();\n } else {\n onStartControlPointChange();\n }\n onToggle();\n },\n onMouseDown: () => {\n if (window && window.addEventListener) {\n controlPointMoveStateRef.current = {\n initialPosition,\n index,\n significantMoveHappened: false,\n listenersActivated: true\n };\n onStartControlPointChange();\n window.addEventListener('mousemove', onMouseMove);\n window.addEventListener('mouseup', cleanEventListeners);\n }\n },\n onKeyDown: event => {\n if (event.code === 'ArrowLeft') {\n // Stop propagation of the key press event to avoid focus moving\n // to another editor area.\n event.stopPropagation();\n onChange(updateControlPointPosition(controlPoints, index, clampPercent(point.position - KEYBOARD_CONTROL_POINT_VARIATION)));\n } else if (event.code === 'ArrowRight') {\n // Stop propagation of the key press event to avoid focus moving\n // to another editor area.\n event.stopPropagation();\n onChange(updateControlPointPosition(controlPoints, index, clampPercent(point.position + KEYBOARD_CONTROL_POINT_VARIATION)));\n }\n },\n isOpen: isOpen,\n position: point.position,\n color: point.color\n }, index),\n renderContent: ({\n onClose\n }) => /*#__PURE__*/_jsxs(DropdownContentWrapper, {\n paddingSize: \"none\",\n children: [/*#__PURE__*/_jsx(ColorPicker, {\n enableAlpha: !disableAlpha,\n color: point.color,\n onChange: color => {\n onChange(updateControlPointColor(controlPoints, index, colord(color).toRgbString()));\n }\n }), !disableRemove && controlPoints.length > 2 && /*#__PURE__*/_jsx(HStack, {\n className: \"components-custom-gradient-picker__remove-control-point-wrapper\",\n alignment: \"center\",\n children: /*#__PURE__*/_jsx(Button, {\n onClick: () => {\n onChange(removeControlPoint(controlPoints, index));\n onClose();\n },\n variant: \"link\",\n children: __('Remove Control Point')\n })\n })]\n }),\n style: {\n left: `${point.position}%`,\n transform: 'translateX( -50% )'\n }\n }, index);\n })\n });\n}\nfunction InsertPoint({\n value: controlPoints,\n onChange,\n onOpenInserter,\n onCloseInserter,\n insertPosition,\n disableAlpha,\n __experimentalIsRenderedInSidebar\n}) {\n const [alreadyInsertedPoint, setAlreadyInsertedPoint] = useState(false);\n return /*#__PURE__*/_jsx(GradientColorPickerDropdown, {\n isRenderedInSidebar: __experimentalIsRenderedInSidebar,\n className: \"components-custom-gradient-picker__inserter\",\n onClose: () => {\n onCloseInserter();\n },\n renderToggle: ({\n isOpen,\n onToggle\n }) => /*#__PURE__*/_jsx(Button, {\n __next40pxDefaultSize: true,\n \"aria-expanded\": isOpen,\n \"aria-haspopup\": \"true\",\n onClick: () => {\n if (isOpen) {\n onCloseInserter();\n } else {\n setAlreadyInsertedPoint(false);\n onOpenInserter();\n }\n onToggle();\n },\n className: \"components-custom-gradient-picker__insert-point-dropdown\",\n icon: plus\n }),\n renderContent: () => /*#__PURE__*/_jsx(DropdownContentWrapper, {\n paddingSize: \"none\",\n children: /*#__PURE__*/_jsx(ColorPicker, {\n enableAlpha: !disableAlpha,\n onChange: color => {\n if (!alreadyInsertedPoint) {\n onChange(addControlPoint(controlPoints, insertPosition, colord(color).toRgbString()));\n setAlreadyInsertedPoint(true);\n } else {\n onChange(updateControlPointColorByPosition(controlPoints, insertPosition, colord(color).toRgbString()));\n }\n }\n })\n }),\n style: insertPosition !== null ? {\n left: `${insertPosition}%`,\n transform: 'translateX( -50% )'\n } : undefined\n });\n}\nControlPoints.InsertPoint = InsertPoint;\nexport default ControlPoints;"],
|
|
5
|
-
"mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,cAAc;AACvB,SAAS,qBAAqB;AAC9B,SAAS,WAAW,QAAQ,UAAU,eAAe;AACrD,SAAS,IAAI,eAAe;AAC5B,SAAS,YAAY;AACrB,OAAO,YAAY;AACnB,SAAS,cAAc;AACvB,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAC/B,SAAS,iCAAiC;AAC1C,SAAS,iBAAiB,cAAc,oBAAoB,yBAAyB,mCAAmC,4BAA4B,6CAA6C;AACjM,SAAS,0BAA0B,wCAAwC;AAC3E,OAAO,4BAA4B;AACnC,SAAS,OAAO,MAAM,YAAY,WAAW,QAAQ,aAAa;AAClE,SAAS,mBAAmB;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAG;AACD,QAAM,aAAa,cAAc,kBAAkB;AACnD,QAAM,gBAAgB,uEAAuE,UAAU;AACvG,SAAoB,sBAAM,WAAW;AAAA,IACnC,UAAU,CAAc,qBAAK,QAAQ;AAAA,MACnC,cAAc;AAAA;AAAA,QAEd,GAAG,iEAAiE;AAAA,QAAG;AAAA,QAAU;AAAA,MAAK;AAAA,MACtF,oBAAoB;AAAA,MACpB,iBAAiB;AAAA,MACjB,iBAAiB;AAAA,MACjB,uBAAuB;AAAA,MACvB,WAAW,KAAK,2DAA2D;AAAA,QACzE,aAAa;AAAA,MACf,CAAC;AAAA,MACD,GAAG;AAAA,IACL,CAAC,GAAgB,qBAAK,gBAAgB;AAAA,MACpC,IAAI;AAAA,MACJ,UAAU,GAAG,sKAAsK;AAAA,
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport { colord } from 'colord';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useEffect, useRef, useState, useMemo } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { plus } from '@wordpress/icons';\nimport Button from '../../button';\nimport { HStack } from '../../h-stack';\nimport { ColorPicker } from '../../color-picker';\nimport { VisuallyHidden } from '../../visually-hidden';\nimport { CustomColorPickerDropdown } from '../../color-palette';\nimport { addControlPoint, clampPercent, removeControlPoint, updateControlPointColor, updateControlPointColorByPosition, updateControlPointPosition, getHorizontalRelativeGradientPosition } from './utils';\nimport { MINIMUM_SIGNIFICANT_MOVE, KEYBOARD_CONTROL_POINT_VARIATION } from './constants';\nimport DropdownContentWrapper from '../../dropdown/dropdown-content-wrapper';\nimport { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction ControlPointButton({\n isOpen,\n position,\n color,\n disablePositioning,\n ...additionalProps\n}) {\n const instanceId = useInstanceId(ControlPointButton);\n const descriptionId = `components-custom-gradient-picker__control-point-button-description-${instanceId}`;\n return /*#__PURE__*/_jsxs(_Fragment, {\n children: [/*#__PURE__*/_jsx(Button, {\n \"aria-label\": sprintf(\n // translators: 1: gradient position e.g: 70. 2: gradient color code e.g: rgb(52,121,151).\n __('Gradient control point at position %1$d%% with color code %2$s.'), position, color),\n \"aria-describedby\": descriptionId,\n \"aria-haspopup\": \"true\",\n \"aria-expanded\": isOpen,\n __next40pxDefaultSize: true,\n className: clsx('components-custom-gradient-picker__control-point-button', {\n 'is-active': isOpen\n }),\n ...additionalProps\n }), /*#__PURE__*/_jsx(VisuallyHidden, {\n id: descriptionId,\n children: disablePositioning ? __('Press the button to change the color.') : __('Use your left or right arrow keys or drag and drop with the mouse to change the gradient position. Press the button to change the color or remove the control point.')\n })]\n });\n}\nfunction GradientColorPickerDropdown({\n isRenderedInSidebar,\n className,\n ...props\n}) {\n // Open the popover below the gradient control/insertion point\n const popoverProps = useMemo(() => ({\n placement: 'bottom',\n offset: 8,\n // Disabling resize as it would otherwise cause the popover to show\n // scrollbars while dragging the color picker's handle close to the\n // popover edge.\n resize: false\n }), []);\n const mergedClassName = clsx('components-custom-gradient-picker__control-point-dropdown', className);\n return /*#__PURE__*/_jsx(CustomColorPickerDropdown, {\n isRenderedInSidebar: isRenderedInSidebar,\n popoverProps: popoverProps,\n className: mergedClassName,\n ...props\n });\n}\nfunction ControlPoints({\n disableRemove,\n disableAlpha,\n disablePositioning,\n gradientPickerDomRef,\n ignoreMarkerPosition,\n value: controlPoints,\n onChange,\n onStartControlPointChange,\n onStopControlPointChange,\n __experimentalIsRenderedInSidebar\n}) {\n const controlPointMoveStateRef = useRef(undefined);\n const onMouseMove = event => {\n if (controlPointMoveStateRef.current === undefined || gradientPickerDomRef.current === null) {\n return;\n }\n const relativePosition = getHorizontalRelativeGradientPosition(event.clientX, gradientPickerDomRef.current);\n const {\n initialPosition,\n index,\n significantMoveHappened\n } = controlPointMoveStateRef.current;\n if (!significantMoveHappened && Math.abs(initialPosition - relativePosition) >= MINIMUM_SIGNIFICANT_MOVE) {\n controlPointMoveStateRef.current.significantMoveHappened = true;\n }\n onChange(updateControlPointPosition(controlPoints, index, relativePosition));\n };\n const cleanEventListeners = () => {\n if (window && window.removeEventListener && controlPointMoveStateRef.current && controlPointMoveStateRef.current.listenersActivated) {\n window.removeEventListener('mousemove', onMouseMove);\n window.removeEventListener('mouseup', cleanEventListeners);\n onStopControlPointChange();\n controlPointMoveStateRef.current.listenersActivated = false;\n }\n };\n\n // Adding `cleanEventListeners` to the dependency array below requires the function itself to be wrapped in a `useCallback`\n // This memoization would prevent the event listeners from being properly cleaned.\n // Instead, we'll pass a ref to the function in our `useEffect` so `cleanEventListeners` itself is no longer a dependency.\n const cleanEventListenersRef = useRef(undefined);\n cleanEventListenersRef.current = cleanEventListeners;\n useEffect(() => {\n return () => {\n cleanEventListenersRef.current?.();\n };\n }, []);\n return /*#__PURE__*/_jsx(_Fragment, {\n children: controlPoints.map((point, index) => {\n const initialPosition = point?.position;\n return ignoreMarkerPosition !== initialPosition && /*#__PURE__*/_jsx(GradientColorPickerDropdown, {\n isRenderedInSidebar: __experimentalIsRenderedInSidebar,\n onClose: onStopControlPointChange,\n renderToggle: ({\n isOpen,\n onToggle\n }) => /*#__PURE__*/_jsx(ControlPointButton, {\n onClick: () => {\n if (controlPointMoveStateRef.current && controlPointMoveStateRef.current.significantMoveHappened) {\n return;\n }\n if (isOpen) {\n onStopControlPointChange();\n } else {\n onStartControlPointChange();\n }\n onToggle();\n },\n onMouseDown: () => {\n if (disablePositioning) {\n return;\n }\n if (window && window.addEventListener) {\n controlPointMoveStateRef.current = {\n initialPosition,\n index,\n significantMoveHappened: false,\n listenersActivated: true\n };\n onStartControlPointChange();\n window.addEventListener('mousemove', onMouseMove);\n window.addEventListener('mouseup', cleanEventListeners);\n }\n },\n onKeyDown: event => {\n if (disablePositioning) {\n // The point cannot move, but the\n // arrow keys are still consumed so\n // they do not bubble away and move\n // focus to another editor area.\n if (event.code === 'ArrowLeft' || event.code === 'ArrowRight') {\n event.stopPropagation();\n }\n return;\n }\n if (event.code === 'ArrowLeft') {\n // Stop propagation of the key press event to avoid focus moving\n // to another editor area.\n event.stopPropagation();\n onChange(updateControlPointPosition(controlPoints, index, clampPercent(point.position - KEYBOARD_CONTROL_POINT_VARIATION)));\n } else if (event.code === 'ArrowRight') {\n // Stop propagation of the key press event to avoid focus moving\n // to another editor area.\n event.stopPropagation();\n onChange(updateControlPointPosition(controlPoints, index, clampPercent(point.position + KEYBOARD_CONTROL_POINT_VARIATION)));\n }\n },\n isOpen: isOpen,\n position: point.position,\n color: point.color,\n disablePositioning: disablePositioning\n }, index),\n renderContent: ({\n onClose\n }) => /*#__PURE__*/_jsxs(DropdownContentWrapper, {\n paddingSize: \"none\",\n children: [/*#__PURE__*/_jsx(ColorPicker, {\n enableAlpha: !disableAlpha,\n color: point.color,\n onChange: color => {\n onChange(updateControlPointColor(controlPoints, index, colord(color).toRgbString()));\n }\n }), !disableRemove && controlPoints.length > 2 && /*#__PURE__*/_jsx(HStack, {\n className: \"components-custom-gradient-picker__remove-control-point-wrapper\",\n alignment: \"center\",\n children: /*#__PURE__*/_jsx(Button, {\n onClick: () => {\n onChange(removeControlPoint(controlPoints, index));\n onClose();\n },\n variant: \"link\",\n children: __('Remove Control Point')\n })\n })]\n }),\n style: {\n left: `${point.position}%`,\n transform: 'translateX( -50% )'\n }\n }, index);\n })\n });\n}\nfunction InsertPoint({\n value: controlPoints,\n onChange,\n onOpenInserter,\n onCloseInserter,\n insertPosition,\n disableAlpha,\n __experimentalIsRenderedInSidebar\n}) {\n const [alreadyInsertedPoint, setAlreadyInsertedPoint] = useState(false);\n return /*#__PURE__*/_jsx(GradientColorPickerDropdown, {\n isRenderedInSidebar: __experimentalIsRenderedInSidebar,\n className: \"components-custom-gradient-picker__inserter\",\n onClose: () => {\n onCloseInserter();\n },\n renderToggle: ({\n isOpen,\n onToggle\n }) => /*#__PURE__*/_jsx(Button, {\n __next40pxDefaultSize: true,\n \"aria-expanded\": isOpen,\n \"aria-haspopup\": \"true\",\n onClick: () => {\n if (isOpen) {\n onCloseInserter();\n } else {\n setAlreadyInsertedPoint(false);\n onOpenInserter();\n }\n onToggle();\n },\n className: \"components-custom-gradient-picker__insert-point-dropdown\",\n icon: plus\n }),\n renderContent: () => /*#__PURE__*/_jsx(DropdownContentWrapper, {\n paddingSize: \"none\",\n children: /*#__PURE__*/_jsx(ColorPicker, {\n enableAlpha: !disableAlpha,\n onChange: color => {\n if (!alreadyInsertedPoint) {\n onChange(addControlPoint(controlPoints, insertPosition, colord(color).toRgbString()));\n setAlreadyInsertedPoint(true);\n } else {\n onChange(updateControlPointColorByPosition(controlPoints, insertPosition, colord(color).toRgbString()));\n }\n }\n })\n }),\n style: insertPosition !== null ? {\n left: `${insertPosition}%`,\n transform: 'translateX( -50% )'\n } : undefined\n });\n}\nControlPoints.InsertPoint = InsertPoint;\nexport default ControlPoints;"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,cAAc;AACvB,SAAS,qBAAqB;AAC9B,SAAS,WAAW,QAAQ,UAAU,eAAe;AACrD,SAAS,IAAI,eAAe;AAC5B,SAAS,YAAY;AACrB,OAAO,YAAY;AACnB,SAAS,cAAc;AACvB,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAC/B,SAAS,iCAAiC;AAC1C,SAAS,iBAAiB,cAAc,oBAAoB,yBAAyB,mCAAmC,4BAA4B,6CAA6C;AACjM,SAAS,0BAA0B,wCAAwC;AAC3E,OAAO,4BAA4B;AACnC,SAAS,OAAO,MAAM,YAAY,WAAW,QAAQ,aAAa;AAClE,SAAS,mBAAmB;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAG;AACD,QAAM,aAAa,cAAc,kBAAkB;AACnD,QAAM,gBAAgB,uEAAuE,UAAU;AACvG,SAAoB,sBAAM,WAAW;AAAA,IACnC,UAAU,CAAc,qBAAK,QAAQ;AAAA,MACnC,cAAc;AAAA;AAAA,QAEd,GAAG,iEAAiE;AAAA,QAAG;AAAA,QAAU;AAAA,MAAK;AAAA,MACtF,oBAAoB;AAAA,MACpB,iBAAiB;AAAA,MACjB,iBAAiB;AAAA,MACjB,uBAAuB;AAAA,MACvB,WAAW,KAAK,2DAA2D;AAAA,QACzE,aAAa;AAAA,MACf,CAAC;AAAA,MACD,GAAG;AAAA,IACL,CAAC,GAAgB,qBAAK,gBAAgB;AAAA,MACpC,IAAI;AAAA,MACJ,UAAU,qBAAqB,GAAG,uCAAuC,IAAI,GAAG,sKAAsK;AAAA,IACxP,CAAC,CA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BAAK,QAAQ;AAAA,MAC9B,uBAAuB;AAAA,MACvB,iBAAiB;AAAA,MACjB,iBAAiB;AAAA,MACjB,SAAS,MAAM;AACb,YAAI,QAAQ;AACV,0BAAgB;AAAA,QAClB,OAAO;AACL,kCAAwB,KAAK;AAC7B,yBAAe;AAAA,QACjB;AACA,iBAAS;AAAA,MACX;AAAA,MACA,WAAW;AAAA,MACX,MAAM;AAAA,IACR,CAAC;AAAA,IACD,eAAe,MAAmB,qBAAK,wBAAwB;AAAA,MAC7D,aAAa;AAAA,MACb,UAAuB,qBAAK,aAAa;AAAA,QACvC,aAAa,CAAC;AAAA,QACd,UAAU,WAAS;AACjB,cAAI,CAAC,sBAAsB;AACzB,qBAAS,gBAAgB,eAAe,gBAAgB,OAAO,KAAK,EAAE,YAAY,CAAC,CAAC;AACpF,oCAAwB,IAAI;AAAA,UAC9B,OAAO;AACL,qBAAS,kCAAkC,eAAe,gBAAgB,OAAO,KAAK,EAAE,YAAY,CAAC,CAAC;AAAA,UACxG;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAAA,IACD,OAAO,mBAAmB,OAAO;AAAA,MAC/B,MAAM,GAAG,cAAc;AAAA,MACvB,WAAW;AAAA,IACb,IAAI;AAAA,EACN,CAAC;AACH;AACA,cAAc,cAAc;AAC5B,IAAO,yBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -64,6 +64,7 @@ function CustomGradientBar({
|
|
|
64
64
|
onChange,
|
|
65
65
|
disableInserter = false,
|
|
66
66
|
disableAlpha = false,
|
|
67
|
+
disablePositioning = false,
|
|
67
68
|
__experimentalIsRenderedInSidebar = false
|
|
68
69
|
}) {
|
|
69
70
|
const gradientMarkersContainerDomRef = useRef(null);
|
|
@@ -133,6 +134,7 @@ function CustomGradientBar({
|
|
|
133
134
|
__experimentalIsRenderedInSidebar,
|
|
134
135
|
disableAlpha,
|
|
135
136
|
disableRemove: disableInserter,
|
|
137
|
+
disablePositioning,
|
|
136
138
|
gradientPickerDomRef: gradientMarkersContainerDomRef,
|
|
137
139
|
ignoreMarkerPosition: isInsertingControlPoint ? gradientBarState.insertPosition : void 0,
|
|
138
140
|
value: controlPoints,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/custom-gradient-picker/gradient-bar/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import clsx from 'clsx';\nimport { useRef, useReducer } from '@wordpress/element';\nimport ControlPoints from './control-points';\nimport { getHorizontalRelativeGradientPosition } from './utils';\nimport { MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT } from './constants';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst customGradientBarReducer = (state, action) => {\n switch (action.type) {\n case 'MOVE_INSERTER':\n if (state.id === 'IDLE' || state.id === 'MOVING_INSERTER') {\n return {\n id: 'MOVING_INSERTER',\n insertPosition: action.insertPosition\n };\n }\n break;\n case 'STOP_INSERTER_MOVE':\n if (state.id === 'MOVING_INSERTER') {\n return {\n id: 'IDLE'\n };\n }\n break;\n case 'OPEN_INSERTER':\n if (state.id === 'MOVING_INSERTER') {\n return {\n id: 'INSERTING_CONTROL_POINT',\n insertPosition: state.insertPosition\n };\n }\n break;\n case 'CLOSE_INSERTER':\n if (state.id === 'INSERTING_CONTROL_POINT') {\n return {\n id: 'IDLE'\n };\n }\n break;\n case 'START_CONTROL_CHANGE':\n if (state.id === 'IDLE') {\n return {\n id: 'MOVING_CONTROL_POINT'\n };\n }\n break;\n case 'STOP_CONTROL_CHANGE':\n if (state.id === 'MOVING_CONTROL_POINT') {\n return {\n id: 'IDLE'\n };\n }\n break;\n }\n return state;\n};\nconst customGradientBarReducerInitialState = {\n id: 'IDLE'\n};\nexport default function CustomGradientBar({\n background,\n hasGradient,\n value: controlPoints,\n onChange,\n disableInserter = false,\n disableAlpha = false,\n __experimentalIsRenderedInSidebar = false\n}) {\n const gradientMarkersContainerDomRef = useRef(null);\n const [gradientBarState, gradientBarStateDispatch] = useReducer(customGradientBarReducer, customGradientBarReducerInitialState);\n const onMouseEnterAndMove = event => {\n if (!gradientMarkersContainerDomRef.current) {\n return;\n }\n const insertPosition = getHorizontalRelativeGradientPosition(event.clientX, gradientMarkersContainerDomRef.current);\n\n // If the insert point is close to an existing control point don't show it.\n if (controlPoints.some(({\n position\n }) => {\n return Math.abs(insertPosition - position) < MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT;\n })) {\n if (gradientBarState.id === 'MOVING_INSERTER') {\n gradientBarStateDispatch({\n type: 'STOP_INSERTER_MOVE'\n });\n }\n return;\n }\n gradientBarStateDispatch({\n type: 'MOVE_INSERTER',\n insertPosition\n });\n };\n const onMouseLeave = () => {\n gradientBarStateDispatch({\n type: 'STOP_INSERTER_MOVE'\n });\n };\n const isMovingInserter = gradientBarState.id === 'MOVING_INSERTER';\n const isInsertingControlPoint = gradientBarState.id === 'INSERTING_CONTROL_POINT';\n return /*#__PURE__*/_jsxs(\"div\", {\n className: clsx('components-custom-gradient-picker__gradient-bar', {\n 'has-gradient': hasGradient\n }),\n onMouseEnter: onMouseEnterAndMove,\n onMouseMove: onMouseEnterAndMove,\n onMouseLeave: onMouseLeave,\n children: [/*#__PURE__*/_jsx(\"div\", {\n className: \"components-custom-gradient-picker__gradient-bar-background\",\n style: {\n background,\n opacity: hasGradient ? 1 : 0.4\n }\n }), /*#__PURE__*/_jsxs(\"div\", {\n ref: gradientMarkersContainerDomRef,\n className: \"components-custom-gradient-picker__markers-container\",\n children: [!disableInserter && (isMovingInserter || isInsertingControlPoint) && /*#__PURE__*/_jsx(ControlPoints.InsertPoint, {\n __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar,\n disableAlpha: disableAlpha,\n insertPosition: gradientBarState.insertPosition,\n value: controlPoints,\n onChange: onChange,\n onOpenInserter: () => {\n gradientBarStateDispatch({\n type: 'OPEN_INSERTER'\n });\n },\n onCloseInserter: () => {\n gradientBarStateDispatch({\n type: 'CLOSE_INSERTER'\n });\n }\n }), /*#__PURE__*/_jsx(ControlPoints, {\n __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar,\n disableAlpha: disableAlpha,\n disableRemove: disableInserter,\n gradientPickerDomRef: gradientMarkersContainerDomRef,\n ignoreMarkerPosition: isInsertingControlPoint ? gradientBarState.insertPosition : undefined,\n value: controlPoints,\n onChange: onChange,\n onStartControlPointChange: () => {\n gradientBarStateDispatch({\n type: 'START_CONTROL_CHANGE'\n });\n },\n onStopControlPointChange: () => {\n gradientBarStateDispatch({\n type: 'STOP_CONTROL_CHANGE'\n });\n }\n })]\n })]\n });\n}"],
|
|
5
|
-
"mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,QAAQ,kBAAkB;AACnC,OAAO,mBAAmB;AAC1B,SAAS,6CAA6C;AACtD,SAAS,mDAAmD;AAC5D,SAAS,OAAO,MAAM,QAAQ,aAAa;AAC3C,IAAM,2BAA2B,CAAC,OAAO,WAAW;AAClD,UAAQ,OAAO,MAAM;AAAA,IACnB,KAAK;AACH,UAAI,MAAM,OAAO,UAAU,MAAM,OAAO,mBAAmB;AACzD,eAAO;AAAA,UACL,IAAI;AAAA,UACJ,gBAAgB,OAAO;AAAA,QACzB;AAAA,MACF;AACA;AAAA,IACF,KAAK;AACH,UAAI,MAAM,OAAO,mBAAmB;AAClC,eAAO;AAAA,UACL,IAAI;AAAA,QACN;AAAA,MACF;AACA;AAAA,IACF,KAAK;AACH,UAAI,MAAM,OAAO,mBAAmB;AAClC,eAAO;AAAA,UACL,IAAI;AAAA,UACJ,gBAAgB,MAAM;AAAA,QACxB;AAAA,MACF;AACA;AAAA,IACF,KAAK;AACH,UAAI,MAAM,OAAO,2BAA2B;AAC1C,eAAO;AAAA,UACL,IAAI;AAAA,QACN;AAAA,MACF;AACA;AAAA,IACF,KAAK;AACH,UAAI,MAAM,OAAO,QAAQ;AACvB,eAAO;AAAA,UACL,IAAI;AAAA,QACN;AAAA,M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QACL;AAAA,QACA,SAAS,cAAc,IAAI;AAAA,MAC7B;AAAA,IACF,CAAC,GAAgB,sBAAM,OAAO;AAAA,MAC5B,KAAK;AAAA,MACL,WAAW;AAAA,MACX,UAAU,CAAC,CAAC,oBAAoB,oBAAoB,4BAAyC,qBAAK,cAAc,aAAa;AAAA,QAC3H;AAAA,QACA;AAAA,QACA,gBAAgB,iBAAiB;AAAA,QACjC,OAAO;AAAA,QACP;AAAA,QACA,gBAAgB,MAAM;AACpB,mCAAyB;AAAA,YACvB,MAAM;AAAA,UACR,CAAC;AAAA,QACH;AAAA,QACA,iBAAiB,MAAM;AACrB,mCAAyB;AAAA,YACvB,MAAM;AAAA,UACR,CAAC;AAAA,QACH;AAAA,MACF,CAAC,GAAgB,qBAAK,eAAe;AAAA,QACnC;AAAA,QACA;AAAA,QACA,eAAe;AAAA,QACf,sBAAsB;AAAA,QACtB,sBAAsB,0BAA0B,iBAAiB,iBAAiB;AAAA,QAClF,OAAO;AAAA,QACP;AAAA,QACA,2BAA2B,MAAM;AAC/B,mCAAyB;AAAA,YACvB,MAAM;AAAA,UACR,CAAC;AAAA,QACH;AAAA,QACA,0BAA0B,MAAM;AAC9B,mCAAyB;AAAA,YACvB,MAAM;AAAA,UACR,CAAC;AAAA,QACH;AAAA,MACF,CAAC,CAAC;AAAA,IACJ,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;",
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport { useRef, useReducer } from '@wordpress/element';\nimport ControlPoints from './control-points';\nimport { getHorizontalRelativeGradientPosition } from './utils';\nimport { MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT } from './constants';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst customGradientBarReducer = (state, action) => {\n switch (action.type) {\n case 'MOVE_INSERTER':\n if (state.id === 'IDLE' || state.id === 'MOVING_INSERTER') {\n return {\n id: 'MOVING_INSERTER',\n insertPosition: action.insertPosition\n };\n }\n break;\n case 'STOP_INSERTER_MOVE':\n if (state.id === 'MOVING_INSERTER') {\n return {\n id: 'IDLE'\n };\n }\n break;\n case 'OPEN_INSERTER':\n if (state.id === 'MOVING_INSERTER') {\n return {\n id: 'INSERTING_CONTROL_POINT',\n insertPosition: state.insertPosition\n };\n }\n break;\n case 'CLOSE_INSERTER':\n if (state.id === 'INSERTING_CONTROL_POINT') {\n return {\n id: 'IDLE'\n };\n }\n break;\n case 'START_CONTROL_CHANGE':\n if (state.id === 'IDLE') {\n return {\n id: 'MOVING_CONTROL_POINT'\n };\n }\n break;\n case 'STOP_CONTROL_CHANGE':\n if (state.id === 'MOVING_CONTROL_POINT') {\n return {\n id: 'IDLE'\n };\n }\n break;\n }\n return state;\n};\nconst customGradientBarReducerInitialState = {\n id: 'IDLE'\n};\nexport default function CustomGradientBar({\n background,\n hasGradient,\n value: controlPoints,\n onChange,\n disableInserter = false,\n disableAlpha = false,\n disablePositioning = false,\n __experimentalIsRenderedInSidebar = false\n}) {\n const gradientMarkersContainerDomRef = useRef(null);\n const [gradientBarState, gradientBarStateDispatch] = useReducer(customGradientBarReducer, customGradientBarReducerInitialState);\n const onMouseEnterAndMove = event => {\n if (!gradientMarkersContainerDomRef.current) {\n return;\n }\n const insertPosition = getHorizontalRelativeGradientPosition(event.clientX, gradientMarkersContainerDomRef.current);\n\n // If the insert point is close to an existing control point don't show it.\n if (controlPoints.some(({\n position\n }) => {\n return Math.abs(insertPosition - position) < MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT;\n })) {\n if (gradientBarState.id === 'MOVING_INSERTER') {\n gradientBarStateDispatch({\n type: 'STOP_INSERTER_MOVE'\n });\n }\n return;\n }\n gradientBarStateDispatch({\n type: 'MOVE_INSERTER',\n insertPosition\n });\n };\n const onMouseLeave = () => {\n gradientBarStateDispatch({\n type: 'STOP_INSERTER_MOVE'\n });\n };\n const isMovingInserter = gradientBarState.id === 'MOVING_INSERTER';\n const isInsertingControlPoint = gradientBarState.id === 'INSERTING_CONTROL_POINT';\n return /*#__PURE__*/_jsxs(\"div\", {\n className: clsx('components-custom-gradient-picker__gradient-bar', {\n 'has-gradient': hasGradient\n }),\n onMouseEnter: onMouseEnterAndMove,\n onMouseMove: onMouseEnterAndMove,\n onMouseLeave: onMouseLeave,\n children: [/*#__PURE__*/_jsx(\"div\", {\n className: \"components-custom-gradient-picker__gradient-bar-background\",\n style: {\n background,\n opacity: hasGradient ? 1 : 0.4\n }\n }), /*#__PURE__*/_jsxs(\"div\", {\n ref: gradientMarkersContainerDomRef,\n className: \"components-custom-gradient-picker__markers-container\",\n children: [!disableInserter && (isMovingInserter || isInsertingControlPoint) && /*#__PURE__*/_jsx(ControlPoints.InsertPoint, {\n __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar,\n disableAlpha: disableAlpha,\n insertPosition: gradientBarState.insertPosition,\n value: controlPoints,\n onChange: onChange,\n onOpenInserter: () => {\n gradientBarStateDispatch({\n type: 'OPEN_INSERTER'\n });\n },\n onCloseInserter: () => {\n gradientBarStateDispatch({\n type: 'CLOSE_INSERTER'\n });\n }\n }), /*#__PURE__*/_jsx(ControlPoints, {\n __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar,\n disableAlpha: disableAlpha,\n disableRemove: disableInserter,\n disablePositioning: disablePositioning,\n gradientPickerDomRef: gradientMarkersContainerDomRef,\n ignoreMarkerPosition: isInsertingControlPoint ? gradientBarState.insertPosition : undefined,\n value: controlPoints,\n onChange: onChange,\n onStartControlPointChange: () => {\n gradientBarStateDispatch({\n type: 'START_CONTROL_CHANGE'\n });\n },\n onStopControlPointChange: () => {\n gradientBarStateDispatch({\n type: 'STOP_CONTROL_CHANGE'\n });\n }\n })]\n })]\n });\n}"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,QAAQ,kBAAkB;AACnC,OAAO,mBAAmB;AAC1B,SAAS,6CAA6C;AACtD,SAAS,mDAAmD;AAC5D,SAAS,OAAO,MAAM,QAAQ,aAA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tB,sBAAsB,0BAA0B,iBAAiB,iBAAiB;AAAA,QAClF,OAAO;AAAA,QACP;AAAA,QACA,2BAA2B,MAAM;AAC/B,mCAAyB;AAAA,YACvB,MAAM;AAAA,UACR,CAAC;AAAA,QACH;AAAA,QACA,0BAA0B,MAAM;AAC9B,mCAAyB;AAAA,YACvB,MAAM;AAAA,UACR,CAAC;AAAA,QACH;AAAA,MACF,CAAC,CAAC;AAAA,IACJ,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,15 +1,104 @@
|
|
|
1
1
|
// packages/components/src/dropdown/dropdown-content-wrapper.tsx
|
|
2
|
+
import clsx from "clsx";
|
|
2
3
|
import { contextConnect, useContextSystem } from "../context/index.mjs";
|
|
3
|
-
|
|
4
|
+
|
|
5
|
+
// packages/style-runtime/src/index.ts
|
|
6
|
+
var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
|
|
7
|
+
function getRuntime() {
|
|
8
|
+
const globalScope = globalThis;
|
|
9
|
+
if (globalScope.__wpStyleRuntime) {
|
|
10
|
+
return globalScope.__wpStyleRuntime;
|
|
11
|
+
}
|
|
12
|
+
globalScope.__wpStyleRuntime = {
|
|
13
|
+
documents: /* @__PURE__ */ new Map(),
|
|
14
|
+
styles: /* @__PURE__ */ new Map(),
|
|
15
|
+
injectedStyles: /* @__PURE__ */ new WeakMap()
|
|
16
|
+
};
|
|
17
|
+
if (typeof document !== "undefined") {
|
|
18
|
+
registerDocument(document);
|
|
19
|
+
}
|
|
20
|
+
return globalScope.__wpStyleRuntime;
|
|
21
|
+
}
|
|
22
|
+
function documentContainsStyleHash(targetDocument, hash) {
|
|
23
|
+
if (!targetDocument.head) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
for (const style of targetDocument.head.querySelectorAll(`style[${STYLE_HASH_ATTRIBUTE}]`)) {
|
|
27
|
+
if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
function injectStyle(targetDocument, hash, css) {
|
|
34
|
+
if (!targetDocument.head) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const runtime = getRuntime();
|
|
38
|
+
let injectedStyles = runtime.injectedStyles.get(targetDocument);
|
|
39
|
+
if (!injectedStyles) {
|
|
40
|
+
injectedStyles = /* @__PURE__ */ new Set();
|
|
41
|
+
runtime.injectedStyles.set(targetDocument, injectedStyles);
|
|
42
|
+
}
|
|
43
|
+
if (injectedStyles.has(hash)) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (documentContainsStyleHash(targetDocument, hash)) {
|
|
47
|
+
injectedStyles.add(hash);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const style = targetDocument.createElement("style");
|
|
51
|
+
style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
|
|
52
|
+
style.appendChild(targetDocument.createTextNode(css));
|
|
53
|
+
targetDocument.head.appendChild(style);
|
|
54
|
+
injectedStyles.add(hash);
|
|
55
|
+
}
|
|
56
|
+
function registerDocument(targetDocument) {
|
|
57
|
+
const runtime = getRuntime();
|
|
58
|
+
runtime.documents.set(targetDocument, (runtime.documents.get(targetDocument) ?? 0) + 1);
|
|
59
|
+
for (const [hash, css] of runtime.styles) {
|
|
60
|
+
injectStyle(targetDocument, hash, css);
|
|
61
|
+
}
|
|
62
|
+
return () => {
|
|
63
|
+
const count = runtime.documents.get(targetDocument);
|
|
64
|
+
if (count === void 0) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (count <= 1) {
|
|
68
|
+
runtime.documents.delete(targetDocument);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
runtime.documents.set(targetDocument, count - 1);
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function registerStyle(hash, css) {
|
|
75
|
+
const runtime = getRuntime();
|
|
76
|
+
runtime.styles.set(hash, css);
|
|
77
|
+
for (const targetDocument of runtime.documents.keys()) {
|
|
78
|
+
injectStyle(targetDocument, hash, css);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// packages/components/src/dropdown/style.module.scss
|
|
83
|
+
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
|
|
84
|
+
registerStyle("7f9bfd3385", ".ab61d20c737fa550__content-wrapper{margin-left:-8px;margin-right:-8px}.ab61d20c737fa550__content-wrapper:first-of-type{margin-top:-8px}.ab61d20c737fa550__content-wrapper:last-of-type{margin-bottom:-8px}.f0a033fae417d720__padding-small{padding:8px}.d83816967399484e__padding-medium{padding:16px}");
|
|
85
|
+
}
|
|
86
|
+
var style_module_default = { "content-wrapper": "ab61d20c737fa550__content-wrapper", "padding-small": "f0a033fae417d720__padding-small", "padding-medium": "d83816967399484e__padding-medium" };
|
|
87
|
+
|
|
88
|
+
// packages/components/src/dropdown/dropdown-content-wrapper.tsx
|
|
4
89
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
90
|
function UnconnectedDropdownContentWrapper(props, forwardedRef) {
|
|
6
91
|
const {
|
|
7
92
|
paddingSize = "small",
|
|
93
|
+
className,
|
|
8
94
|
...derivedProps
|
|
9
95
|
} = useContextSystem(props, "DropdownContentWrapper");
|
|
10
|
-
return /* @__PURE__ */ _jsx(
|
|
96
|
+
return /* @__PURE__ */ _jsx("div", {
|
|
11
97
|
...derivedProps,
|
|
12
|
-
|
|
98
|
+
className: clsx(style_module_default["content-wrapper"], {
|
|
99
|
+
[style_module_default["padding-small"]]: paddingSize !== "none" && paddingSize !== "medium",
|
|
100
|
+
[style_module_default["padding-medium"]]: paddingSize === "medium"
|
|
101
|
+
}, className),
|
|
13
102
|
ref: forwardedRef
|
|
14
103
|
});
|
|
15
104
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/dropdown/dropdown-content-wrapper.tsx"],
|
|
4
|
-
"sourcesContent": ["import { contextConnect, useContextSystem } from '../context';\nimport
|
|
5
|
-
"mappings": ";AAAA,SAAS,gBAAgB,wBAAwB;
|
|
3
|
+
"sources": ["../../src/dropdown/dropdown-content-wrapper.tsx", "../../../style-runtime/src/index.ts", "../../src/dropdown/style.module.scss"],
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport { contextConnect, useContextSystem } from '../context';\nimport styles from './style.module.scss';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction UnconnectedDropdownContentWrapper(props, forwardedRef) {\n const {\n paddingSize = 'small',\n className,\n ...derivedProps\n } = useContextSystem(props, 'DropdownContentWrapper');\n return /*#__PURE__*/_jsx(\"div\", {\n ...derivedProps,\n className: clsx(styles['content-wrapper'], {\n [styles['padding-small']]: paddingSize !== 'none' && paddingSize !== 'medium',\n [styles['padding-medium']]: paddingSize === 'medium'\n }, className),\n ref: forwardedRef\n });\n}\n\n/**\n * A convenience wrapper for the `renderContent` when you want to apply\n * different padding. (Default is `paddingSize=\"small\"`).\n *\n * ```jsx\n * import {\n * Dropdown,\n * __experimentalDropdownContentWrapper as DropdownContentWrapper,\n * } from '@wordpress/components';\n *\n * <Dropdown\n * renderContent={ () => (\n * <DropdownContentWrapper paddingSize=\"medium\">\n * My dropdown content\n * </DropdownContentWrapper>\n * ) }\n * />\n * ```\n */\nexport const DropdownContentWrapper = contextConnect(UnconnectedDropdownContentWrapper, 'DropdownContentWrapper');\nexport default DropdownContentWrapper;", "const STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n const globalScope = globalThis;\n if (globalScope.__wpStyleRuntime) {\n return globalScope.__wpStyleRuntime;\n }\n globalScope.__wpStyleRuntime = {\n documents: new Map(),\n styles: new Map(),\n injectedStyles: new WeakMap()\n };\n if (typeof document !== 'undefined') {\n registerDocument(document);\n }\n return globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(targetDocument, hash) {\n if (!targetDocument.head) {\n return false;\n }\n for (const style of targetDocument.head.querySelectorAll(`style[${STYLE_HASH_ATTRIBUTE}]`)) {\n if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle(targetDocument, hash, css) {\n if (!targetDocument.head) {\n return;\n }\n const runtime = getRuntime();\n let injectedStyles = runtime.injectedStyles.get(targetDocument);\n if (!injectedStyles) {\n injectedStyles = new Set();\n runtime.injectedStyles.set(targetDocument, injectedStyles);\n }\n if (injectedStyles.has(hash)) {\n return;\n }\n\n // Older generated CSS module output can still inject matching style tags\n // after this document's cache is created, so keep the DOM as the fallback\n // source of truth on cache misses.\n if (documentContainsStyleHash(targetDocument, hash)) {\n injectedStyles.add(hash);\n return;\n }\n const style = targetDocument.createElement('style');\n style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);\n style.appendChild(targetDocument.createTextNode(css));\n targetDocument.head.appendChild(style);\n injectedStyles.add(hash);\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument(targetDocument) {\n const runtime = getRuntime();\n runtime.documents.set(targetDocument, (runtime.documents.get(targetDocument) ?? 0) + 1);\n for (const [hash, css] of runtime.styles) {\n injectStyle(targetDocument, hash, css);\n }\n return () => {\n const count = runtime.documents.get(targetDocument);\n if (count === undefined) {\n return;\n }\n if (count <= 1) {\n runtime.documents.delete(targetDocument);\n return;\n }\n runtime.documents.set(targetDocument, count - 1);\n };\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle(hash, css) {\n const runtime = getRuntime();\n runtime.styles.set(hash, css);\n for (const targetDocument of runtime.documents.keys()) {\n injectStyle(targetDocument, hash, css);\n }\n}", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"7f9bfd3385\", \".ab61d20c737fa550__content-wrapper{margin-left:-8px;margin-right:-8px}.ab61d20c737fa550__content-wrapper:first-of-type{margin-top:-8px}.ab61d20c737fa550__content-wrapper:last-of-type{margin-bottom:-8px}.f0a033fae417d720__padding-small{padding:8px}.d83816967399484e__padding-medium{padding:16px}\");\n}\nexport default {\"content-wrapper\":\"ab61d20c737fa550__content-wrapper\",\"padding-small\":\"f0a033fae417d720__padding-small\",\"padding-medium\":\"d83816967399484e__padding-medium\"};\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,gBAAgB,wBAAwB;;;ACDjD,IAAM,uBAAuB;AAU7B,SAAS,aAAa;AACpB,QAAM,cAAc;AACpB,MAAI,YAAY,kBAAkB;AAChC,WAAO,YAAY;AAAA,EACrB;AACA,cAAY,mBAAmB;AAAA,IAC7B,WAAW,oBAAI,IAAI;AAAA,IACnB,QAAQ,oBAAI,IAAI;AAAA,IAChB,gBAAgB,oBAAI,QAAQ;AAAA,EAC9B;AACA,MAAI,OAAO,aAAa,aAAa;AACnC,qBAAiB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AAU,OAAO,cAAc;AACvC;AAAA,IACF;AACA,YAAQ,UAAU,IAAI,gBAAgB,QAAQ,CAAC;AAAA,EACjD;AACF;AAaO,SAAS,cAAc,MAAM,KAAK;AACvC,QAAM,UAAU,WAAW;AAC3B,UAAQ,OAAO,IAAI,MAAM,GAAG;AAC5B,aAAW,kBAAkB,QAAQ,UAAU,KAAK,GAAG;AACrD,gBAAY,gBAAgB,MAAM,GAAG;AAAA,EACvC;AACF;;;AChIA,IAAI,OAAO,YAAY,eAAe,QAAQ,IAAI,aAAa,QAAQ;AACtE,gBAAc,cAAc,wSAAwS;AACrU;AACA,IAAO,uBAAQ,EAAC,mBAAkB,qCAAoC,iBAAgB,mCAAkC,kBAAiB,mCAAkC;;;AFD3K,SAAS,OAAO,YAAY;AAC5B,SAAS,kCAAkC,OAAO,cAAc;AAC9D,QAAM;AAAA,IACJ,cAAc;AAAA,IACd;AAAA,IACA,GAAG;AAAA,EACL,IAAI,iBAAiB,OAAO,wBAAwB;AACpD,SAAoB,qBAAK,OAAO;AAAA,IAC9B,GAAG;AAAA,IACH,WAAW,KAAK,qBAAO,iBAAiB,GAAG;AAAA,MACzC,CAAC,qBAAO,eAAe,CAAC,GAAG,gBAAgB,UAAU,gBAAgB;AAAA,MACrE,CAAC,qBAAO,gBAAgB,CAAC,GAAG,gBAAgB;AAAA,IAC9C,GAAG,SAAS;AAAA,IACZ,KAAK;AAAA,EACP,CAAC;AACH;AAqBO,IAAM,yBAAyB,eAAe,mCAAmC,wBAAwB;AAChH,IAAO,mCAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/duotone-picker/custom-duotone-bar.tsx"],
|
|
4
|
-
"sourcesContent": ["import CustomGradientBar from '../custom-gradient-picker/gradient-bar';\nimport { getColorStopsFromColors, getGradientFromCSSColors, getColorsFromColorStops } from './utils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst PLACEHOLDER_VALUES = ['#333', '#CCC'];\nexport default function CustomDuotoneBar({\n value,\n onChange\n}) {\n const hasGradient = !!value;\n const values = hasGradient ? value : PLACEHOLDER_VALUES;\n const background = getGradientFromCSSColors(values);\n const controlPoints = getColorStopsFromColors(values);\n return /*#__PURE__*/_jsx(CustomGradientBar, {\n disableInserter: true,\n background: background,\n hasGradient: hasGradient,\n value: controlPoints,\n onChange: newColorStops => {\n const newValue = getColorsFromColorStops(newColorStops);\n onChange(newValue);\n }\n });\n}"],
|
|
5
|
-
"mappings": ";AAAA,OAAO,uBAAuB;AAC9B,SAAS,yBAAyB,0BAA0B,+BAA+B;AAC3F,SAAS,OAAO,YAAY;AAC5B,IAAM,qBAAqB,CAAC,QAAQ,MAAM;AAC3B,SAAR,iBAAkC;AAAA,EACvC;AAAA,EACA;AACF,GAAG;AACD,QAAM,cAAc,CAAC,CAAC;AACtB,QAAM,SAAS,cAAc,QAAQ;AACrC,QAAM,aAAa,yBAAyB,MAAM;AAClD,QAAM,gBAAgB,wBAAwB,MAAM;AACpD,SAAoB,qBAAK,mBAAmB;AAAA,IAC1C,iBAAiB;AAAA,IACjB;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP,UAAU,mBAAiB;AACzB,YAAM,WAAW,wBAAwB,aAAa;AACtD,eAAS,QAAQ;AAAA,IACnB;AAAA,EACF,CAAC;AACH;",
|
|
4
|
+
"sourcesContent": ["import CustomGradientBar from '../custom-gradient-picker/gradient-bar';\nimport { getColorStopsFromColors, getGradientFromCSSColors, getColorsFromColorStops } from './utils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst PLACEHOLDER_VALUES = ['#333', '#CCC'];\nexport default function CustomDuotoneBar({\n value,\n onChange\n}) {\n const hasGradient = !!value;\n const values = hasGradient ? value : PLACEHOLDER_VALUES;\n const background = getGradientFromCSSColors(values);\n const controlPoints = getColorStopsFromColors(values);\n return /*#__PURE__*/_jsx(CustomGradientBar, {\n disableInserter: true,\n disablePositioning: true,\n background: background,\n hasGradient: hasGradient,\n value: controlPoints,\n onChange: newColorStops => {\n const newValue = getColorsFromColorStops(newColorStops);\n onChange(newValue);\n }\n });\n}"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,uBAAuB;AAC9B,SAAS,yBAAyB,0BAA0B,+BAA+B;AAC3F,SAAS,OAAO,YAAY;AAC5B,IAAM,qBAAqB,CAAC,QAAQ,MAAM;AAC3B,SAAR,iBAAkC;AAAA,EACvC;AAAA,EACA;AACF,GAAG;AACD,QAAM,cAAc,CAAC,CAAC;AACtB,QAAM,SAAS,cAAc,QAAQ;AACrC,QAAM,aAAa,yBAAyB,MAAM;AAClD,QAAM,gBAAgB,wBAAwB,MAAM;AACpD,SAAoB,qBAAK,mBAAmB;AAAA,IAC1C,iBAAiB;AAAA,IACjB,oBAAoB;AAAA,IACpB;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP,UAAU,mBAAiB;AACzB,YAAM,WAAW,wBAAwB,aAAa;AACtD,eAAS,QAAQ;AAAA,IACnB;AAAA,EACF,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|