@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,4 +1,5 @@
|
|
|
1
1
|
// packages/components/src/box-control/box-input-control.tsx
|
|
2
|
+
import clsx from "clsx";
|
|
2
3
|
import { useInstanceId } from "@wordpress/compose";
|
|
3
4
|
import { __ } from "@wordpress/i18n";
|
|
4
5
|
import { useState } from "@wordpress/element";
|
|
@@ -6,8 +7,96 @@ import { settings } from "@wordpress/icons";
|
|
|
6
7
|
import Tooltip from "../tooltip/index.mjs";
|
|
7
8
|
import { parseQuantityAndUnitFromRawValue } from "../unit-control/utils.mjs";
|
|
8
9
|
import { CUSTOM_VALUE_SETTINGS, getMergedValue, getAllowedSides, getPresetIndexFromValue, getPresetValueFromIndex, isValuePreset, isValuesDefined, isValueMixed, LABELS } from "./utils.mjs";
|
|
9
|
-
import
|
|
10
|
+
import BoxControlIcon from "./icon.mjs";
|
|
10
11
|
import Button from "../button/index.mjs";
|
|
12
|
+
import { HStack } from "../h-stack/index.mjs";
|
|
13
|
+
import RangeControl from "../range-control/index.mjs";
|
|
14
|
+
import UnitControl from "../unit-control/index.mjs";
|
|
15
|
+
|
|
16
|
+
// packages/style-runtime/src/index.ts
|
|
17
|
+
var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
|
|
18
|
+
function getRuntime() {
|
|
19
|
+
const globalScope = globalThis;
|
|
20
|
+
if (globalScope.__wpStyleRuntime) {
|
|
21
|
+
return globalScope.__wpStyleRuntime;
|
|
22
|
+
}
|
|
23
|
+
globalScope.__wpStyleRuntime = {
|
|
24
|
+
documents: /* @__PURE__ */ new Map(),
|
|
25
|
+
styles: /* @__PURE__ */ new Map(),
|
|
26
|
+
injectedStyles: /* @__PURE__ */ new WeakMap()
|
|
27
|
+
};
|
|
28
|
+
if (typeof document !== "undefined") {
|
|
29
|
+
registerDocument(document);
|
|
30
|
+
}
|
|
31
|
+
return globalScope.__wpStyleRuntime;
|
|
32
|
+
}
|
|
33
|
+
function documentContainsStyleHash(targetDocument, hash) {
|
|
34
|
+
if (!targetDocument.head) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
for (const style of targetDocument.head.querySelectorAll(`style[${STYLE_HASH_ATTRIBUTE}]`)) {
|
|
38
|
+
if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
function injectStyle(targetDocument, hash, css) {
|
|
45
|
+
if (!targetDocument.head) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const runtime = getRuntime();
|
|
49
|
+
let injectedStyles = runtime.injectedStyles.get(targetDocument);
|
|
50
|
+
if (!injectedStyles) {
|
|
51
|
+
injectedStyles = /* @__PURE__ */ new Set();
|
|
52
|
+
runtime.injectedStyles.set(targetDocument, injectedStyles);
|
|
53
|
+
}
|
|
54
|
+
if (injectedStyles.has(hash)) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (documentContainsStyleHash(targetDocument, hash)) {
|
|
58
|
+
injectedStyles.add(hash);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const style = targetDocument.createElement("style");
|
|
62
|
+
style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
|
|
63
|
+
style.appendChild(targetDocument.createTextNode(css));
|
|
64
|
+
targetDocument.head.appendChild(style);
|
|
65
|
+
injectedStyles.add(hash);
|
|
66
|
+
}
|
|
67
|
+
function registerDocument(targetDocument) {
|
|
68
|
+
const runtime = getRuntime();
|
|
69
|
+
runtime.documents.set(targetDocument, (runtime.documents.get(targetDocument) ?? 0) + 1);
|
|
70
|
+
for (const [hash, css] of runtime.styles) {
|
|
71
|
+
injectStyle(targetDocument, hash, css);
|
|
72
|
+
}
|
|
73
|
+
return () => {
|
|
74
|
+
const count = runtime.documents.get(targetDocument);
|
|
75
|
+
if (count === void 0) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (count <= 1) {
|
|
79
|
+
runtime.documents.delete(targetDocument);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
runtime.documents.set(targetDocument, count - 1);
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function registerStyle(hash, css) {
|
|
86
|
+
const runtime = getRuntime();
|
|
87
|
+
runtime.styles.set(hash, css);
|
|
88
|
+
for (const targetDocument of runtime.documents.keys()) {
|
|
89
|
+
injectStyle(targetDocument, hash, css);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// packages/components/src/box-control/style.module.scss
|
|
94
|
+
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
|
|
95
|
+
registerStyle("541c332c55", ".d5a55650545c8e59__unit-control{max-width:90px}.ea5687e40d8b3401__input-wrapper{grid-column:1/span 3}._33fca83ebb9a56db__reset-button{grid-area:1/2;justify-self:end}._80f02f0884ee052b__linked-button-wrapper{grid-area:1/3;justify-self:end}._432c155702d177a9__icon{flex:0 0 auto}._4c5932d5023e1609__range-control{margin-inline-end:8px;width:100%}");
|
|
96
|
+
}
|
|
97
|
+
var style_module_default = { "unit-control": "d5a55650545c8e59__unit-control", "input-wrapper": "ea5687e40d8b3401__input-wrapper", "reset-button": "_33fca83ebb9a56db__reset-button", "linked-button-wrapper": "_80f02f0884ee052b__linked-button-wrapper", "icon": "_432c155702d177a9__icon", "range-control": "_4c5932d5023e1609__range-control" };
|
|
98
|
+
|
|
99
|
+
// packages/components/src/box-control/box-input-control.tsx
|
|
11
100
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
101
|
var noop = () => {
|
|
13
102
|
};
|
|
@@ -36,10 +125,10 @@ function getSidesToModify(side, sides, isAlt) {
|
|
|
36
125
|
modifiedSides.push("top");
|
|
37
126
|
break;
|
|
38
127
|
case "left":
|
|
39
|
-
modifiedSides.push("
|
|
128
|
+
modifiedSides.push("right");
|
|
40
129
|
break;
|
|
41
130
|
case "right":
|
|
42
|
-
modifiedSides.push("
|
|
131
|
+
modifiedSides.push("left");
|
|
43
132
|
break;
|
|
44
133
|
}
|
|
45
134
|
}
|
|
@@ -132,19 +221,21 @@ function BoxInputControl({
|
|
|
132
221
|
label: "",
|
|
133
222
|
tooltip: preset.name ?? preset.slug
|
|
134
223
|
}))] : [];
|
|
135
|
-
return /* @__PURE__ */ _jsxs(
|
|
224
|
+
return /* @__PURE__ */ _jsxs(HStack, {
|
|
225
|
+
className: style_module_default["input-wrapper"],
|
|
136
226
|
expanded: true,
|
|
137
|
-
children: [/* @__PURE__ */ _jsx(
|
|
227
|
+
children: [/* @__PURE__ */ _jsx(BoxControlIcon, {
|
|
228
|
+
className: style_module_default.icon,
|
|
138
229
|
side,
|
|
139
230
|
sides
|
|
140
231
|
}), showCustomValueControl && /* @__PURE__ */ _jsxs(_Fragment, {
|
|
141
232
|
children: [/* @__PURE__ */ _jsx(Tooltip, {
|
|
142
233
|
placement: "top-end",
|
|
143
234
|
text: LABELS[side],
|
|
144
|
-
children: /* @__PURE__ */ _jsx(
|
|
235
|
+
children: /* @__PURE__ */ _jsx(UnitControl, {
|
|
145
236
|
...props,
|
|
146
237
|
min,
|
|
147
|
-
className: "component-box-control__unit-control",
|
|
238
|
+
className: clsx(style_module_default["unit-control"], "component-box-control__unit-control"),
|
|
148
239
|
id: inputId,
|
|
149
240
|
isPressEnterToChange: true,
|
|
150
241
|
disableUnits: isMixed || isMixedUnit,
|
|
@@ -156,7 +247,8 @@ function BoxInputControl({
|
|
|
156
247
|
placeholder: mixedPlaceholder ?? placeholderProp,
|
|
157
248
|
hideLabelFromVision: true
|
|
158
249
|
})
|
|
159
|
-
}), /* @__PURE__ */ _jsx(
|
|
250
|
+
}), /* @__PURE__ */ _jsx(RangeControl, {
|
|
251
|
+
className: style_module_default["range-control"],
|
|
160
252
|
"aria-controls": inputId,
|
|
161
253
|
label: LABELS[side],
|
|
162
254
|
hideLabelFromVision: true,
|
|
@@ -169,8 +261,8 @@ function BoxInputControl({
|
|
|
169
261
|
value: parsedQuantity ?? 0,
|
|
170
262
|
withInputField: false
|
|
171
263
|
})]
|
|
172
|
-
}), hasPresets && !showCustomValueControl && /* @__PURE__ */ _jsx(
|
|
173
|
-
className: "spacing-sizes-control__range-control",
|
|
264
|
+
}), hasPresets && !showCustomValueControl && /* @__PURE__ */ _jsx(RangeControl, {
|
|
265
|
+
className: clsx(style_module_default["range-control"], "spacing-sizes-control__range-control"),
|
|
174
266
|
value: presetIndex !== void 0 ? presetIndex + 1 : 0,
|
|
175
267
|
onChange: (newIndex) => {
|
|
176
268
|
const newValue = newIndex === 0 || newIndex === void 0 ? void 0 : getPresetValueFromIndex(newIndex - 1, presetKey, presets);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/box-control/box-input-control.tsx"],
|
|
4
|
-
"sourcesContent": ["import { useInstanceId } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { settings } from '@wordpress/icons';\nimport Tooltip from '../tooltip';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport { CUSTOM_VALUE_SETTINGS, getMergedValue, getAllowedSides, getPresetIndexFromValue, getPresetValueFromIndex, isValuePreset, isValuesDefined, isValueMixed, LABELS } from './utils';\nimport { FlexedBoxControlIcon, FlexedRangeControl, InputWrapper, StyledUnitControl } from './styles/box-control-styles';\nimport Button from '../button';\nimport { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst noop = () => {};\nfunction getSidesToModify(side, sides, isAlt) {\n const allowedSides = getAllowedSides(sides);\n let modifiedSides = [];\n switch (side) {\n case 'all':\n modifiedSides = ['top', 'bottom', 'left', 'right'];\n break;\n case 'horizontal':\n modifiedSides = ['left', 'right'];\n break;\n case 'vertical':\n modifiedSides = ['top', 'bottom'];\n break;\n default:\n modifiedSides = [side];\n }\n if (isAlt) {\n switch (side) {\n case 'top':\n modifiedSides.push('bottom');\n break;\n case 'bottom':\n modifiedSides.push('top');\n break;\n case 'left':\n modifiedSides.push('left');\n break;\n case 'right':\n modifiedSides.push('right');\n break;\n }\n }\n return modifiedSides.filter(s => allowedSides.has(s));\n}\nexport default function BoxInputControl({\n onChange = noop,\n onFocus = noop,\n values,\n selectedUnits,\n setSelectedUnits,\n sides,\n side,\n min = 0,\n presets,\n presetKey,\n placeholder: placeholderProp,\n ...props\n}) {\n const defaultValuesToModify = getSidesToModify(side, sides);\n const handleOnFocus = event => {\n onFocus(event, {\n side\n });\n };\n const handleOnChange = nextValues => {\n onChange(nextValues);\n };\n const handleRawOnValueChange = next => {\n const nextValues = {\n ...values\n };\n defaultValuesToModify.forEach(modifiedSide => {\n nextValues[modifiedSide] = next;\n });\n handleOnChange(nextValues);\n };\n const handleOnValueChange = (next, extra) => {\n const nextValues = {\n ...values\n };\n const isNumeric = next !== undefined && !isNaN(parseFloat(next));\n const nextValue = isNumeric ? next : undefined;\n const modifiedSides = getSidesToModify(side, sides,\n /**\n * Supports changing pair sides. For example, holding the ALT key\n * when changing the TOP will also update BOTTOM.\n */\n // @ts-expect-error - TODO: event.altKey is only present when the change event was\n // triggered by a keyboard event. Should this feature be implemented differently so\n // it also works with drag events?\n !!extra?.event.altKey);\n modifiedSides.forEach(modifiedSide => {\n nextValues[modifiedSide] = nextValue;\n });\n handleOnChange(nextValues);\n };\n const handleOnUnitChange = next => {\n const newUnits = {\n ...selectedUnits\n };\n defaultValuesToModify.forEach(modifiedSide => {\n newUnits[modifiedSide] = next;\n });\n setSelectedUnits(newUnits);\n };\n const mergedValue = getMergedValue(values, defaultValuesToModify);\n const hasValues = isValuesDefined(values);\n const isMixed = hasValues && defaultValuesToModify.length > 1 && isValueMixed(values, defaultValuesToModify);\n const [parsedQuantity, parsedUnit] = parseQuantityAndUnitFromRawValue(mergedValue);\n const computedUnit = hasValues ? parsedUnit : selectedUnits[defaultValuesToModify[0]];\n const generatedId = useInstanceId(BoxInputControl, 'box-control-input');\n const inputId = [generatedId, side].join('-');\n const isMixedUnit = defaultValuesToModify.length > 1 && mergedValue === undefined && defaultValuesToModify.some(s => selectedUnits[s] !== computedUnit);\n const usedValue = mergedValue === undefined && computedUnit ? computedUnit : mergedValue;\n const mixedPlaceholder = isMixed || isMixedUnit ? __('Mixed') : undefined;\n const hasPresets = presets && presets.length > 0 && presetKey;\n const hasPresetValue = hasPresets && mergedValue !== undefined && !isMixed && isValuePreset(mergedValue, presetKey);\n const [showCustomValueControl, setShowCustomValueControl] = useState(!hasPresets || !hasPresetValue && !isMixed && mergedValue !== undefined);\n const presetIndex = hasPresetValue ? getPresetIndexFromValue(mergedValue, presetKey, presets) : undefined;\n const marks = hasPresets ? [{\n value: 0,\n label: '',\n tooltip: __('None')\n }, ...presets.map((preset, index) => ({\n value: index + 1,\n label: '',\n tooltip: preset.name ?? preset.slug\n }))] : [];\n return /*#__PURE__*/_jsxs(InputWrapper, {\n expanded: true,\n children: [/*#__PURE__*/_jsx(FlexedBoxControlIcon, {\n side: side,\n sides: sides\n }), showCustomValueControl && /*#__PURE__*/_jsxs(_Fragment, {\n children: [/*#__PURE__*/_jsx(Tooltip, {\n placement: \"top-end\",\n text: LABELS[side],\n children: /*#__PURE__*/_jsx(StyledUnitControl, {\n ...props,\n min: min,\n className: \"component-box-control__unit-control\",\n id: inputId,\n isPressEnterToChange: true,\n disableUnits: isMixed || isMixedUnit,\n value: usedValue,\n onChange: handleOnValueChange,\n onUnitChange: handleOnUnitChange,\n onFocus: handleOnFocus,\n label: LABELS[side],\n placeholder: mixedPlaceholder ?? placeholderProp,\n hideLabelFromVision: true\n })\n }), /*#__PURE__*/_jsx(FlexedRangeControl, {\n \"aria-controls\": inputId,\n label: LABELS[side],\n hideLabelFromVision: true,\n onChange: newValue => {\n handleOnValueChange(newValue !== undefined ? [newValue, computedUnit].join('') : undefined);\n },\n min: isFinite(min) ? min : 0,\n max: CUSTOM_VALUE_SETTINGS[computedUnit ?? 'px']?.max ?? 10,\n step: CUSTOM_VALUE_SETTINGS[computedUnit ?? 'px']?.step ?? 0.1,\n value: parsedQuantity ?? 0,\n withInputField: false\n })]\n }), hasPresets && !showCustomValueControl && /*#__PURE__*/_jsx(FlexedRangeControl, {\n className: \"spacing-sizes-control__range-control\",\n value: presetIndex !== undefined ? presetIndex + 1 : 0,\n onChange: newIndex => {\n const newValue = newIndex === 0 || newIndex === undefined ? undefined : getPresetValueFromIndex(newIndex - 1, presetKey, presets);\n handleRawOnValueChange(newValue);\n },\n withInputField: false,\n \"aria-valuenow\": presetIndex !== undefined ? presetIndex + 1 : 0,\n \"aria-valuetext\": marks[presetIndex !== undefined ? presetIndex + 1 : 0].tooltip,\n renderTooltipContent: index => marks[!index ? 0 : index].tooltip,\n min: 0,\n max: marks.length - 1,\n marks: marks,\n label: LABELS[side],\n hideLabelFromVision: true\n }), hasPresets && /*#__PURE__*/_jsx(Button, {\n label: showCustomValueControl ? __('Use size preset') : __('Set custom size'),\n icon: settings,\n onClick: () => {\n setShowCustomValueControl(!showCustomValueControl);\n },\n isPressed: showCustomValueControl,\n size: \"small\",\n iconSize: 24\n })]\n }, `box-control-${side}`);\n}"],
|
|
5
|
-
"mappings": ";AAAA,SAAS,qBAAqB;AAC9B,SAAS,UAAU;AACnB,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AACzB,OAAO,aAAa;AACpB,SAAS,wCAAwC;AACjD,SAAS,uBAAuB,gBAAgB,iBAAiB,yBAAyB,yBAAyB,eAAe,iBAAiB,cAAc,cAAc;AAC/K,SAAS,
|
|
3
|
+
"sources": ["../../src/box-control/box-input-control.tsx", "../../../style-runtime/src/index.ts", "../../src/box-control/style.module.scss"],
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport { useInstanceId } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { settings } from '@wordpress/icons';\nimport Tooltip from '../tooltip';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport { CUSTOM_VALUE_SETTINGS, getMergedValue, getAllowedSides, getPresetIndexFromValue, getPresetValueFromIndex, isValuePreset, isValuesDefined, isValueMixed, LABELS } from './utils';\nimport BoxControlIcon from './icon';\nimport Button from '../button';\nimport { HStack } from '../h-stack';\nimport RangeControl from '../range-control';\nimport UnitControl from '../unit-control';\nimport styles from './style.module.scss';\nimport { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst noop = () => {};\nfunction getSidesToModify(side, sides, isAlt) {\n const allowedSides = getAllowedSides(sides);\n let modifiedSides = [];\n switch (side) {\n case 'all':\n modifiedSides = ['top', 'bottom', 'left', 'right'];\n break;\n case 'horizontal':\n modifiedSides = ['left', 'right'];\n break;\n case 'vertical':\n modifiedSides = ['top', 'bottom'];\n break;\n default:\n modifiedSides = [side];\n }\n if (isAlt) {\n switch (side) {\n case 'top':\n modifiedSides.push('bottom');\n break;\n case 'bottom':\n modifiedSides.push('top');\n break;\n case 'left':\n modifiedSides.push('right');\n break;\n case 'right':\n modifiedSides.push('left');\n break;\n }\n }\n return modifiedSides.filter(s => allowedSides.has(s));\n}\nexport default function BoxInputControl({\n onChange = noop,\n onFocus = noop,\n values,\n selectedUnits,\n setSelectedUnits,\n sides,\n side,\n min = 0,\n presets,\n presetKey,\n placeholder: placeholderProp,\n ...props\n}) {\n const defaultValuesToModify = getSidesToModify(side, sides);\n const handleOnFocus = event => {\n onFocus(event, {\n side\n });\n };\n const handleOnChange = nextValues => {\n onChange(nextValues);\n };\n const handleRawOnValueChange = next => {\n const nextValues = {\n ...values\n };\n defaultValuesToModify.forEach(modifiedSide => {\n nextValues[modifiedSide] = next;\n });\n handleOnChange(nextValues);\n };\n const handleOnValueChange = (next, extra) => {\n const nextValues = {\n ...values\n };\n const isNumeric = next !== undefined && !isNaN(parseFloat(next));\n const nextValue = isNumeric ? next : undefined;\n const modifiedSides = getSidesToModify(side, sides,\n /**\n * Supports changing pair sides. For example, holding the ALT key\n * when changing the TOP will also update BOTTOM.\n */\n // @ts-expect-error - TODO: event.altKey is only present when the change event was\n // triggered by a keyboard event. Should this feature be implemented differently so\n // it also works with drag events?\n !!extra?.event.altKey);\n modifiedSides.forEach(modifiedSide => {\n nextValues[modifiedSide] = nextValue;\n });\n handleOnChange(nextValues);\n };\n const handleOnUnitChange = next => {\n const newUnits = {\n ...selectedUnits\n };\n defaultValuesToModify.forEach(modifiedSide => {\n newUnits[modifiedSide] = next;\n });\n setSelectedUnits(newUnits);\n };\n const mergedValue = getMergedValue(values, defaultValuesToModify);\n const hasValues = isValuesDefined(values);\n const isMixed = hasValues && defaultValuesToModify.length > 1 && isValueMixed(values, defaultValuesToModify);\n const [parsedQuantity, parsedUnit] = parseQuantityAndUnitFromRawValue(mergedValue);\n const computedUnit = hasValues ? parsedUnit : selectedUnits[defaultValuesToModify[0]];\n const generatedId = useInstanceId(BoxInputControl, 'box-control-input');\n const inputId = [generatedId, side].join('-');\n const isMixedUnit = defaultValuesToModify.length > 1 && mergedValue === undefined && defaultValuesToModify.some(s => selectedUnits[s] !== computedUnit);\n const usedValue = mergedValue === undefined && computedUnit ? computedUnit : mergedValue;\n const mixedPlaceholder = isMixed || isMixedUnit ? __('Mixed') : undefined;\n const hasPresets = presets && presets.length > 0 && presetKey;\n const hasPresetValue = hasPresets && mergedValue !== undefined && !isMixed && isValuePreset(mergedValue, presetKey);\n const [showCustomValueControl, setShowCustomValueControl] = useState(!hasPresets || !hasPresetValue && !isMixed && mergedValue !== undefined);\n const presetIndex = hasPresetValue ? getPresetIndexFromValue(mergedValue, presetKey, presets) : undefined;\n const marks = hasPresets ? [{\n value: 0,\n label: '',\n tooltip: __('None')\n }, ...presets.map((preset, index) => ({\n value: index + 1,\n label: '',\n tooltip: preset.name ?? preset.slug\n }))] : [];\n return /*#__PURE__*/_jsxs(HStack, {\n className: styles['input-wrapper'],\n expanded: true,\n children: [/*#__PURE__*/_jsx(BoxControlIcon, {\n className: styles.icon,\n side: side,\n sides: sides\n }), showCustomValueControl && /*#__PURE__*/_jsxs(_Fragment, {\n children: [/*#__PURE__*/_jsx(Tooltip, {\n placement: \"top-end\",\n text: LABELS[side],\n children: /*#__PURE__*/_jsx(UnitControl, {\n ...props,\n min: min,\n className: clsx(styles['unit-control'], 'component-box-control__unit-control'),\n id: inputId,\n isPressEnterToChange: true,\n disableUnits: isMixed || isMixedUnit,\n value: usedValue,\n onChange: handleOnValueChange,\n onUnitChange: handleOnUnitChange,\n onFocus: handleOnFocus,\n label: LABELS[side],\n placeholder: mixedPlaceholder ?? placeholderProp,\n hideLabelFromVision: true\n })\n }), /*#__PURE__*/_jsx(RangeControl, {\n className: styles['range-control'],\n \"aria-controls\": inputId,\n label: LABELS[side],\n hideLabelFromVision: true,\n onChange: newValue => {\n handleOnValueChange(newValue !== undefined ? [newValue, computedUnit].join('') : undefined);\n },\n min: isFinite(min) ? min : 0,\n max: CUSTOM_VALUE_SETTINGS[computedUnit ?? 'px']?.max ?? 10,\n step: CUSTOM_VALUE_SETTINGS[computedUnit ?? 'px']?.step ?? 0.1,\n value: parsedQuantity ?? 0,\n withInputField: false\n })]\n }), hasPresets && !showCustomValueControl && /*#__PURE__*/_jsx(RangeControl, {\n className: clsx(styles['range-control'], 'spacing-sizes-control__range-control'),\n value: presetIndex !== undefined ? presetIndex + 1 : 0,\n onChange: newIndex => {\n const newValue = newIndex === 0 || newIndex === undefined ? undefined : getPresetValueFromIndex(newIndex - 1, presetKey, presets);\n handleRawOnValueChange(newValue);\n },\n withInputField: false,\n \"aria-valuenow\": presetIndex !== undefined ? presetIndex + 1 : 0,\n \"aria-valuetext\": marks[presetIndex !== undefined ? presetIndex + 1 : 0].tooltip,\n renderTooltipContent: index => marks[!index ? 0 : index].tooltip,\n min: 0,\n max: marks.length - 1,\n marks: marks,\n label: LABELS[side],\n hideLabelFromVision: true\n }), hasPresets && /*#__PURE__*/_jsx(Button, {\n label: showCustomValueControl ? __('Use size preset') : __('Set custom size'),\n icon: settings,\n onClick: () => {\n setShowCustomValueControl(!showCustomValueControl);\n },\n isPressed: showCustomValueControl,\n size: \"small\",\n iconSize: 24\n })]\n }, `box-control-${side}`);\n}", "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(\"541c332c55\", \".d5a55650545c8e59__unit-control{max-width:90px}.ea5687e40d8b3401__input-wrapper{grid-column:1/span 3}._33fca83ebb9a56db__reset-button{grid-area:1/2;justify-self:end}._80f02f0884ee052b__linked-button-wrapper{grid-area:1/3;justify-self:end}._432c155702d177a9__icon{flex:0 0 auto}._4c5932d5023e1609__range-control{margin-inline-end:8px;width:100%}\");\n}\nexport default {\"unit-control\":\"d5a55650545c8e59__unit-control\",\"input-wrapper\":\"ea5687e40d8b3401__input-wrapper\",\"reset-button\":\"_33fca83ebb9a56db__reset-button\",\"linked-button-wrapper\":\"_80f02f0884ee052b__linked-button-wrapper\",\"icon\":\"_432c155702d177a9__icon\",\"range-control\":\"_4c5932d5023e1609__range-control\"};\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,UAAU;A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/index.tsx
|
|
2
|
+
import clsx from "clsx";
|
|
2
3
|
import { useInstanceId } from "@wordpress/compose";
|
|
3
4
|
import { useState } from "@wordpress/element";
|
|
4
5
|
import { __ } from "@wordpress/i18n";
|
|
@@ -6,11 +7,97 @@ import warning from "@wordpress/warning";
|
|
|
6
7
|
import { BaseControl } from "../base-control/index.mjs";
|
|
7
8
|
import BoxInputControl from "./box-input-control.mjs";
|
|
8
9
|
import LinkedButton from "./linked-button.mjs";
|
|
10
|
+
import Button from "../button/index.mjs";
|
|
9
11
|
import { Grid } from "../grid/index.mjs";
|
|
10
|
-
import {
|
|
12
|
+
import { HStack } from "../h-stack/index.mjs";
|
|
11
13
|
import { parseQuantityAndUnitFromRawValue } from "../unit-control/utils.mjs";
|
|
12
14
|
import { DEFAULT_VALUES, isValueMixed, isValuesDefined, getAllowedSides } from "./utils.mjs";
|
|
13
15
|
import { useControlledState } from "../utils/hooks/index.mjs";
|
|
16
|
+
|
|
17
|
+
// packages/style-runtime/src/index.ts
|
|
18
|
+
var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
|
|
19
|
+
function getRuntime() {
|
|
20
|
+
const globalScope = globalThis;
|
|
21
|
+
if (globalScope.__wpStyleRuntime) {
|
|
22
|
+
return globalScope.__wpStyleRuntime;
|
|
23
|
+
}
|
|
24
|
+
globalScope.__wpStyleRuntime = {
|
|
25
|
+
documents: /* @__PURE__ */ new Map(),
|
|
26
|
+
styles: /* @__PURE__ */ new Map(),
|
|
27
|
+
injectedStyles: /* @__PURE__ */ new WeakMap()
|
|
28
|
+
};
|
|
29
|
+
if (typeof document !== "undefined") {
|
|
30
|
+
registerDocument(document);
|
|
31
|
+
}
|
|
32
|
+
return globalScope.__wpStyleRuntime;
|
|
33
|
+
}
|
|
34
|
+
function documentContainsStyleHash(targetDocument, hash) {
|
|
35
|
+
if (!targetDocument.head) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
for (const style of targetDocument.head.querySelectorAll(`style[${STYLE_HASH_ATTRIBUTE}]`)) {
|
|
39
|
+
if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
function injectStyle(targetDocument, hash, css) {
|
|
46
|
+
if (!targetDocument.head) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const runtime = getRuntime();
|
|
50
|
+
let injectedStyles = runtime.injectedStyles.get(targetDocument);
|
|
51
|
+
if (!injectedStyles) {
|
|
52
|
+
injectedStyles = /* @__PURE__ */ new Set();
|
|
53
|
+
runtime.injectedStyles.set(targetDocument, injectedStyles);
|
|
54
|
+
}
|
|
55
|
+
if (injectedStyles.has(hash)) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (documentContainsStyleHash(targetDocument, hash)) {
|
|
59
|
+
injectedStyles.add(hash);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const style = targetDocument.createElement("style");
|
|
63
|
+
style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
|
|
64
|
+
style.appendChild(targetDocument.createTextNode(css));
|
|
65
|
+
targetDocument.head.appendChild(style);
|
|
66
|
+
injectedStyles.add(hash);
|
|
67
|
+
}
|
|
68
|
+
function registerDocument(targetDocument) {
|
|
69
|
+
const runtime = getRuntime();
|
|
70
|
+
runtime.documents.set(targetDocument, (runtime.documents.get(targetDocument) ?? 0) + 1);
|
|
71
|
+
for (const [hash, css] of runtime.styles) {
|
|
72
|
+
injectStyle(targetDocument, hash, css);
|
|
73
|
+
}
|
|
74
|
+
return () => {
|
|
75
|
+
const count = runtime.documents.get(targetDocument);
|
|
76
|
+
if (count === void 0) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (count <= 1) {
|
|
80
|
+
runtime.documents.delete(targetDocument);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
runtime.documents.set(targetDocument, count - 1);
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function registerStyle(hash, css) {
|
|
87
|
+
const runtime = getRuntime();
|
|
88
|
+
runtime.styles.set(hash, css);
|
|
89
|
+
for (const targetDocument of runtime.documents.keys()) {
|
|
90
|
+
injectStyle(targetDocument, hash, css);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// packages/components/src/box-control/style.module.scss
|
|
95
|
+
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
|
|
96
|
+
registerStyle("541c332c55", ".d5a55650545c8e59__unit-control{max-width:90px}.ea5687e40d8b3401__input-wrapper{grid-column:1/span 3}._33fca83ebb9a56db__reset-button{grid-area:1/2;justify-self:end}._80f02f0884ee052b__linked-button-wrapper{grid-area:1/3;justify-self:end}._432c155702d177a9__icon{flex:0 0 auto}._4c5932d5023e1609__range-control{margin-inline-end:8px;width:100%}");
|
|
97
|
+
}
|
|
98
|
+
var style_module_default = { "unit-control": "d5a55650545c8e59__unit-control", "input-wrapper": "ea5687e40d8b3401__input-wrapper", "reset-button": "_33fca83ebb9a56db__reset-button", "linked-button-wrapper": "_80f02f0884ee052b__linked-button-wrapper", "icon": "_432c155702d177a9__icon", "range-control": "_4c5932d5023e1609__range-control" };
|
|
99
|
+
|
|
100
|
+
// packages/components/src/box-control/index.tsx
|
|
14
101
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
102
|
var defaultInputProps = {
|
|
16
103
|
min: 0
|
|
@@ -96,12 +183,14 @@ function BoxControl({
|
|
|
96
183
|
children: [/* @__PURE__ */ _jsx(BaseControl.VisualLabel, {
|
|
97
184
|
id: headingId,
|
|
98
185
|
children: label
|
|
99
|
-
}), isLinked && /* @__PURE__ */ _jsx(
|
|
186
|
+
}), isLinked && /* @__PURE__ */ _jsx(HStack, {
|
|
187
|
+
className: style_module_default["input-wrapper"],
|
|
100
188
|
children: /* @__PURE__ */ _jsx(BoxInputControl, {
|
|
101
189
|
side: "all",
|
|
102
190
|
...inputControlProps
|
|
103
191
|
})
|
|
104
|
-
}), !hasOneSide && /* @__PURE__ */ _jsx(
|
|
192
|
+
}), !hasOneSide && /* @__PURE__ */ _jsx("div", {
|
|
193
|
+
className: style_module_default["linked-button-wrapper"],
|
|
105
194
|
children: /* @__PURE__ */ _jsx(LinkedButton, {
|
|
106
195
|
onClick: toggleLinked,
|
|
107
196
|
isLinked
|
|
@@ -112,12 +201,13 @@ function BoxControl({
|
|
|
112
201
|
}, axis)), !isLinked && !splitOnAxis && Array.from(sidesToRender).map((axis) => /* @__PURE__ */ _jsx(BoxInputControl, {
|
|
113
202
|
side: axis,
|
|
114
203
|
...inputControlProps
|
|
115
|
-
}, axis)), allowReset && /* @__PURE__ */ _jsx(
|
|
116
|
-
className: "component-box-control__reset-button",
|
|
204
|
+
}, axis)), allowReset && /* @__PURE__ */ _jsx(Button, {
|
|
205
|
+
className: clsx(style_module_default["reset-button"], "component-box-control__reset-button"),
|
|
117
206
|
variant: "secondary",
|
|
118
207
|
size: "small",
|
|
119
208
|
onClick: handleOnReset,
|
|
120
209
|
disabled: !isDirty,
|
|
210
|
+
accessibleWhenDisabled: true,
|
|
121
211
|
children: __("Reset")
|
|
122
212
|
})]
|
|
123
213
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/box-control/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { useInstanceId } from '@wordpress/compose';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport warning from '@wordpress/warning';\nimport { BaseControl } from '../base-control';\nimport BoxInputControl from './box-input-control';\nimport LinkedButton from './linked-button';\nimport { Grid } from '../grid';\nimport { InputWrapper, ResetButton, LinkedButtonWrapper } from './styles/box-control-styles';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport { DEFAULT_VALUES, isValueMixed, isValuesDefined, getAllowedSides } from './utils';\nimport { useControlledState } from '../utils/hooks';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst defaultInputProps = {\n min: 0\n};\nconst noop = () => {};\nfunction useUniqueId(idProp) {\n const instanceId = useInstanceId(BoxControl, 'inspector-box-control');\n return idProp || instanceId;\n}\n\n/**\n * A control that lets users set values for top, right, bottom, and left. Can be\n * used as an input control for values like `padding` or `margin`.\n *\n * ```jsx\n * import { useState } from 'react';\n * import { BoxControl } from '@wordpress/components';\n *\n * function Example() {\n * const [ values, setValues ] = useState( {\n * top: '50px',\n * left: '10%',\n * right: '10%',\n * bottom: '50px',\n * } );\n *\n * return (\n * <BoxControl values={ values } onChange={ setValues } />\n * );\n * };\n * ```\n */\nfunction BoxControl({\n id: idProp,\n inputProps = defaultInputProps,\n onChange = noop,\n label = __('Box Control'),\n values: valuesProp,\n units,\n sides,\n splitOnAxis = false,\n allowReset = true,\n resetValues = DEFAULT_VALUES,\n presets,\n presetKey,\n onMouseOver,\n onMouseOut\n}) {\n const [values, setValues] = useControlledState(valuesProp, {\n fallback: DEFAULT_VALUES\n });\n const inputValues = values || DEFAULT_VALUES;\n const hasInitialValue = isValuesDefined(valuesProp);\n const hasOneSide = sides?.length === 1;\n const [isDirty, setIsDirty] = useState(hasInitialValue);\n const [isLinked, setIsLinked] = useState(!hasInitialValue || !isValueMixed(inputValues) || hasOneSide);\n\n // Tracking selected units via internal state allows filtering of CSS unit\n // only values from being saved while maintaining preexisting unit selection\n // behaviour. Filtering CSS only values prevents invalid style values.\n const [selectedUnits, setSelectedUnits] = useState({\n top: parseQuantityAndUnitFromRawValue(valuesProp?.top)[1],\n right: parseQuantityAndUnitFromRawValue(valuesProp?.right)[1],\n bottom: parseQuantityAndUnitFromRawValue(valuesProp?.bottom)[1],\n left: parseQuantityAndUnitFromRawValue(valuesProp?.left)[1]\n });\n const id = useUniqueId(idProp);\n const headingId = `${id}-heading`;\n const toggleLinked = () => {\n setIsLinked(!isLinked);\n };\n const handleOnChange = nextValues => {\n onChange(nextValues);\n setValues(nextValues);\n setIsDirty(true);\n };\n const handleOnReset = () => {\n onChange(resetValues);\n setValues(resetValues);\n setSelectedUnits(resetValues);\n setIsDirty(false);\n };\n const inputControlProps = {\n onMouseOver,\n onMouseOut,\n ...inputProps,\n onChange: handleOnChange,\n isLinked,\n units,\n selectedUnits,\n setSelectedUnits,\n sides,\n values: inputValues,\n presets,\n presetKey\n };\n const sidesToRender = getAllowedSides(sides);\n if (presets && !presetKey || !presets && presetKey) {\n const definedProp = presets ? 'presets' : 'presetKey';\n const missingProp = presets ? 'presetKey' : 'presets';\n globalThis.SCRIPT_DEBUG === true ? warning(`wp.components.BoxControl: the '${missingProp}' prop is required when the '${definedProp}' prop is defined.`) : void 0;\n }\n return /*#__PURE__*/_jsxs(Grid, {\n id: id,\n columns: 3,\n templateColumns: \"1fr min-content min-content\",\n role: \"group\",\n \"aria-labelledby\": headingId,\n children: [/*#__PURE__*/_jsx(BaseControl.VisualLabel, {\n id: headingId,\n children: label\n }), isLinked && /*#__PURE__*/_jsx(InputWrapper, {\n children: /*#__PURE__*/_jsx(BoxInputControl, {\n side: \"all\",\n ...inputControlProps\n })\n }), !hasOneSide && /*#__PURE__*/_jsx(LinkedButtonWrapper, {\n children: /*#__PURE__*/_jsx(LinkedButton, {\n onClick: toggleLinked,\n isLinked: isLinked\n })\n }), !isLinked && splitOnAxis && ['vertical', 'horizontal'].map(axis => /*#__PURE__*/_jsx(BoxInputControl, {\n side: axis,\n ...inputControlProps\n }, axis)), !isLinked && !splitOnAxis && Array.from(sidesToRender).map(axis => /*#__PURE__*/_jsx(BoxInputControl, {\n side: axis,\n ...inputControlProps\n }, axis)), allowReset && /*#__PURE__*/_jsx(ResetButton, {\n className: \"component-box-control__reset-button\",\n variant: \"secondary\",\n size: \"small\",\n onClick: handleOnReset,\n disabled: !isDirty,\n children: __('Reset')\n })]\n });\n}\nexport default BoxControl;"],
|
|
5
|
-
"mappings": ";AAAA,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB;AACzB,SAAS,UAAU;AACnB,OAAO,aAAa;AACpB,SAAS,mBAAmB;AAC5B,OAAO,qBAAqB;AAC5B,OAAO,kBAAkB;AACzB,SAAS,YAAY;AACrB,SAAS,cAAc
|
|
3
|
+
"sources": ["../../src/box-control/index.tsx", "../../../style-runtime/src/index.ts", "../../src/box-control/style.module.scss"],
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport warning from '@wordpress/warning';\nimport { BaseControl } from '../base-control';\nimport BoxInputControl from './box-input-control';\nimport LinkedButton from './linked-button';\nimport Button from '../button';\nimport { Grid } from '../grid';\nimport { HStack } from '../h-stack';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport { DEFAULT_VALUES, isValueMixed, isValuesDefined, getAllowedSides } from './utils';\nimport { useControlledState } from '../utils/hooks';\nimport styles from './style.module.scss';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst defaultInputProps = {\n min: 0\n};\nconst noop = () => {};\nfunction useUniqueId(idProp) {\n const instanceId = useInstanceId(BoxControl, 'inspector-box-control');\n return idProp || instanceId;\n}\n\n/**\n * A control that lets users set values for top, right, bottom, and left. Can be\n * used as an input control for values like `padding` or `margin`.\n *\n * ```jsx\n * import { useState } from 'react';\n * import { BoxControl } from '@wordpress/components';\n *\n * function Example() {\n * const [ values, setValues ] = useState( {\n * top: '50px',\n * left: '10%',\n * right: '10%',\n * bottom: '50px',\n * } );\n *\n * return (\n * <BoxControl values={ values } onChange={ setValues } />\n * );\n * };\n * ```\n */\nfunction BoxControl({\n id: idProp,\n inputProps = defaultInputProps,\n onChange = noop,\n label = __('Box Control'),\n values: valuesProp,\n units,\n sides,\n splitOnAxis = false,\n allowReset = true,\n resetValues = DEFAULT_VALUES,\n presets,\n presetKey,\n onMouseOver,\n onMouseOut\n}) {\n const [values, setValues] = useControlledState(valuesProp, {\n fallback: DEFAULT_VALUES\n });\n const inputValues = values || DEFAULT_VALUES;\n const hasInitialValue = isValuesDefined(valuesProp);\n const hasOneSide = sides?.length === 1;\n const [isDirty, setIsDirty] = useState(hasInitialValue);\n const [isLinked, setIsLinked] = useState(!hasInitialValue || !isValueMixed(inputValues) || hasOneSide);\n\n // Tracking selected units via internal state allows filtering of CSS unit\n // only values from being saved while maintaining preexisting unit selection\n // behaviour. Filtering CSS only values prevents invalid style values.\n const [selectedUnits, setSelectedUnits] = useState({\n top: parseQuantityAndUnitFromRawValue(valuesProp?.top)[1],\n right: parseQuantityAndUnitFromRawValue(valuesProp?.right)[1],\n bottom: parseQuantityAndUnitFromRawValue(valuesProp?.bottom)[1],\n left: parseQuantityAndUnitFromRawValue(valuesProp?.left)[1]\n });\n const id = useUniqueId(idProp);\n const headingId = `${id}-heading`;\n const toggleLinked = () => {\n setIsLinked(!isLinked);\n };\n const handleOnChange = nextValues => {\n onChange(nextValues);\n setValues(nextValues);\n setIsDirty(true);\n };\n const handleOnReset = () => {\n onChange(resetValues);\n setValues(resetValues);\n setSelectedUnits(resetValues);\n setIsDirty(false);\n };\n const inputControlProps = {\n onMouseOver,\n onMouseOut,\n ...inputProps,\n onChange: handleOnChange,\n isLinked,\n units,\n selectedUnits,\n setSelectedUnits,\n sides,\n values: inputValues,\n presets,\n presetKey\n };\n const sidesToRender = getAllowedSides(sides);\n if (presets && !presetKey || !presets && presetKey) {\n const definedProp = presets ? 'presets' : 'presetKey';\n const missingProp = presets ? 'presetKey' : 'presets';\n globalThis.SCRIPT_DEBUG === true ? warning(`wp.components.BoxControl: the '${missingProp}' prop is required when the '${definedProp}' prop is defined.`) : void 0;\n }\n return /*#__PURE__*/_jsxs(Grid, {\n id: id,\n columns: 3,\n templateColumns: \"1fr min-content min-content\",\n role: \"group\",\n \"aria-labelledby\": headingId,\n children: [/*#__PURE__*/_jsx(BaseControl.VisualLabel, {\n id: headingId,\n children: label\n }), isLinked && /*#__PURE__*/_jsx(HStack, {\n className: styles['input-wrapper'],\n children: /*#__PURE__*/_jsx(BoxInputControl, {\n side: \"all\",\n ...inputControlProps\n })\n }), !hasOneSide && /*#__PURE__*/_jsx(\"div\", {\n className: styles['linked-button-wrapper'],\n children: /*#__PURE__*/_jsx(LinkedButton, {\n onClick: toggleLinked,\n isLinked: isLinked\n })\n }), !isLinked && splitOnAxis && ['vertical', 'horizontal'].map(axis => /*#__PURE__*/_jsx(BoxInputControl, {\n side: axis,\n ...inputControlProps\n }, axis)), !isLinked && !splitOnAxis && Array.from(sidesToRender).map(axis => /*#__PURE__*/_jsx(BoxInputControl, {\n side: axis,\n ...inputControlProps\n }, axis)), allowReset && /*#__PURE__*/_jsx(Button, {\n className: clsx(styles['reset-button'], 'component-box-control__reset-button'),\n variant: \"secondary\",\n size: \"small\",\n onClick: handleOnReset,\n disabled: !isDirty,\n accessibleWhenDisabled: true,\n children: __('Reset')\n })]\n });\n}\nexport default BoxControl;", "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(\"541c332c55\", \".d5a55650545c8e59__unit-control{max-width:90px}.ea5687e40d8b3401__input-wrapper{grid-column:1/span 3}._33fca83ebb9a56db__reset-button{grid-area:1/2;justify-self:end}._80f02f0884ee052b__linked-button-wrapper{grid-area:1/3;justify-self:end}._432c155702d177a9__icon{flex:0 0 auto}._4c5932d5023e1609__range-control{margin-inline-end:8px;width:100%}\");\n}\nexport default {\"unit-control\":\"d5a55650545c8e59__unit-control\",\"input-wrapper\":\"ea5687e40d8b3401__input-wrapper\",\"reset-button\":\"_33fca83ebb9a56db__reset-button\",\"linked-button-wrapper\":\"_80f02f0884ee052b__linked-button-wrapper\",\"icon\":\"_432c155702d177a9__icon\",\"range-control\":\"_4c5932d5023e1609__range-control\"};\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB;AACzB,SAAS,UAAU;AACnB,OAAO,aAAa;AACpB,SAAS,mBAAmB;AAC5B,OAAO,qBAAqB;AAC5B,OAAO,kBAAkB;AACzB,OAAO,YAAY;AACnB,SAAS,YAAY;AACrB,SAAS,cAAc;AACvB,SAAS,wCAAwC;AACjD,SAAS,gBAAgB,cAAc,iBAAiB,uBAAuB;AAC/E,SAAS,0BAA0B;;;ACbnC,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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a;AAAA,MACpD,IAAI;AAAA,MACJ,UAAU;AAAA,IACZ,CAAC,GAAG,YAAyB,qBAAK,QAAQ;AAAA,MACxC,WAAW,qBAAO,eAAe;AAAA,MACjC,UAAuB,qBAAK,iBAAiB;AAAA,QAC3C,MAAM;AAAA,QACN,GAAG;AAAA,MACL,CAAC;AAAA,IACH,CAAC,GAAG,CAAC,cAA2B,qBAAK,OAAO;AAAA,MAC1C,WAAW,qBAAO,uBAAuB;AAAA,MACzC,UAAuB,qBAAK,cAAc;AAAA,QACxC,SAAS;AAAA,QACT;AAAA,MACF,CAAC;AAAA,IACH,CAAC,GAAG,CAAC,YAAY,eAAe,CAAC,YAAY,YAAY,EAAE,IAAI,UAAqB,qBAAK,iBAAiB;AAAA,MACxG,MAAM;AAAA,MACN,GAAG;AAAA,IACL,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,eAAe,MAAM,KAAK,aAAa,EAAE,IAAI,UAAqB,qBAAK,iBAAiB;AAAA,MAC/G,MAAM;AAAA,MACN,GAAG;AAAA,IACL,GAAG,IAAI,CAAC,GAAG,cAA2B,qBAAK,QAAQ;AAAA,MACjD,WAAW,KAAK,qBAAO,cAAc,GAAG,qCAAqC;AAAA,MAC7E,SAAS;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,MACT,UAAU,CAAC;AAAA,MACX,wBAAwB;AAAA,MACxB,UAAU,GAAG,OAAO;AAAA,IACtB,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;AACA,IAAO,sBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// packages/components/src/button/index.tsx
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import deprecated from "@wordpress/deprecated";
|
|
4
|
-
import { forwardRef } from "@wordpress/element";
|
|
4
|
+
import { Children, Fragment, forwardRef, isValidElement } from "@wordpress/element";
|
|
5
5
|
import { useInstanceId } from "@wordpress/compose";
|
|
6
6
|
import Tooltip from "../tooltip/index.mjs";
|
|
7
7
|
import Icon from "../icon/index.mjs";
|
|
@@ -9,6 +9,15 @@ import { VisuallyHidden } from "../visually-hidden/index.mjs";
|
|
|
9
9
|
import { positionToPlacement } from "../popover/utils.mjs";
|
|
10
10
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
11
|
var disabledEventsOnDisabledButton = ["onMouseDown", "onClick"];
|
|
12
|
+
var hasRenderableChildren = (children) => Children.toArray(children).some((child) => {
|
|
13
|
+
if (!isValidElement(child)) {
|
|
14
|
+
return child !== "";
|
|
15
|
+
}
|
|
16
|
+
if (child.type === Fragment) {
|
|
17
|
+
return hasRenderableChildren(child.props.children);
|
|
18
|
+
}
|
|
19
|
+
return child.props.className !== "components-tooltip";
|
|
20
|
+
});
|
|
12
21
|
function useDeprecatedProps({
|
|
13
22
|
__experimentalIsFocusable,
|
|
14
23
|
isDefault,
|
|
@@ -95,8 +104,6 @@ var Button = forwardRef(function UnforwardedButton(props, ref) {
|
|
|
95
104
|
...buttonOrAnchorProps
|
|
96
105
|
};
|
|
97
106
|
const instanceId = useInstanceId(Button, "components-button__description");
|
|
98
|
-
const hasChildren = "string" === typeof children && !!children || Array.isArray(children) && children?.[0] && children[0] !== null && // Tooltip should not considered as a child
|
|
99
|
-
children?.[0]?.props?.className !== "components-tooltip";
|
|
100
107
|
const truthyAriaPressedValues = [true, "true", "mixed"];
|
|
101
108
|
const classes = clsx("components-button", className, {
|
|
102
109
|
"is-next-40px-default-size": __next40pxDefaultSize,
|
|
@@ -110,7 +117,7 @@ var Button = forwardRef(function UnforwardedButton(props, ref) {
|
|
|
110
117
|
"is-busy": isBusy,
|
|
111
118
|
"is-link": variant === "link",
|
|
112
119
|
"is-destructive": isDestructive,
|
|
113
|
-
"has-text": !!icon && (
|
|
120
|
+
"has-text": !!icon && (text || hasRenderableChildren(children)),
|
|
114
121
|
"has-icon": !!icon,
|
|
115
122
|
"has-icon-right": iconPosition === "right"
|
|
116
123
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/button/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import clsx from 'clsx';\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\nimport Tooltip from '../tooltip';\nimport Icon from '../icon';\nimport { VisuallyHidden } from '../visually-hidden';\nimport { positionToPlacement } from '../popover/utils';\nimport { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst disabledEventsOnDisabledButton = ['onMouseDown', 'onClick'];\nfunction useDeprecatedProps({\n __experimentalIsFocusable,\n isDefault,\n isPrimary,\n isSecondary,\n isTertiary,\n isLink,\n isPressed,\n isSmall,\n size,\n variant,\n describedBy,\n ...otherProps\n}) {\n let computedSize = size;\n let computedVariant = variant;\n const newProps = {\n accessibleWhenDisabled: __experimentalIsFocusable,\n // @todo Mark `isPressed` as deprecated\n 'aria-pressed': isPressed,\n description: describedBy\n };\n if (isSmall) {\n computedSize ??= 'small';\n }\n if (isPrimary) {\n computedVariant ??= 'primary';\n }\n if (isTertiary) {\n computedVariant ??= 'tertiary';\n }\n if (isSecondary) {\n computedVariant ??= 'secondary';\n }\n if (isDefault) {\n deprecated('wp.components.Button `isDefault` prop', {\n since: '5.4',\n alternative: 'variant=\"secondary\"'\n });\n computedVariant ??= 'secondary';\n }\n if (isLink) {\n computedVariant ??= 'link';\n }\n return {\n ...newProps,\n ...otherProps,\n size: computedSize,\n variant: computedVariant\n };\n}\n\n/**\n * Lets users take actions and make choices with a single click or tap.\n *\n * ```jsx\n * import { Button } from '@wordpress/components';\n * const Mybutton = () => (\n * <Button\n * variant=\"primary\"\n * onClick={ handleClick }\n * >\n * Click here\n * </Button>\n * );\n * ```\n */\nexport const Button = forwardRef(function UnforwardedButton(props, ref) {\n const {\n __next40pxDefaultSize,\n accessibleWhenDisabled,\n isBusy,\n isDestructive,\n className,\n disabled,\n icon,\n iconPosition = 'left',\n iconSize,\n showTooltip,\n tooltipPosition,\n shortcut,\n label,\n children,\n size = 'default',\n text,\n variant,\n description,\n ...buttonOrAnchorProps\n } = useDeprecatedProps(props);\n const {\n href,\n target,\n 'aria-checked': ariaChecked,\n 'aria-pressed': ariaPressed,\n 'aria-selected': ariaSelected,\n ...additionalProps\n } = 'href' in buttonOrAnchorProps ? buttonOrAnchorProps : {\n href: undefined,\n target: undefined,\n ...buttonOrAnchorProps\n };\n const instanceId = useInstanceId(Button, 'components-button__description');\n const
|
|
5
|
-
"mappings": ";AAAA,OAAO,UAAU;AACjB,OAAO,gBAAgB;AACvB,SAAS,
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport deprecated from '@wordpress/deprecated';\nimport { Children, Fragment, forwardRef, isValidElement } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\nimport Tooltip from '../tooltip';\nimport Icon from '../icon';\nimport { VisuallyHidden } from '../visually-hidden';\nimport { positionToPlacement } from '../popover/utils';\nimport { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst disabledEventsOnDisabledButton = ['onMouseDown', 'onClick'];\n\n/**\n * Whether `children` will render any content, to differentiate an icon-only\n * button or an icon-with-text button.\n *\n * `Children.toArray` discards the children that render nothing (`null`,\n * `undefined`, and booleans), which is what conditionally rendered content\n * evaluates to when its condition is unmet.\n *\n * @param children The children passed to the button.\n */\nconst hasRenderableChildren = children => Children.toArray(children).some(child => {\n if (!isValidElement(child)) {\n return child !== '';\n }\n if (child.type === Fragment) {\n return hasRenderableChildren(child.props.children);\n }\n\n // A tooltip should not be considered as a child.\n return child.props.className !== 'components-tooltip';\n});\nfunction useDeprecatedProps({\n __experimentalIsFocusable,\n isDefault,\n isPrimary,\n isSecondary,\n isTertiary,\n isLink,\n isPressed,\n isSmall,\n size,\n variant,\n describedBy,\n ...otherProps\n}) {\n let computedSize = size;\n let computedVariant = variant;\n const newProps = {\n accessibleWhenDisabled: __experimentalIsFocusable,\n // @todo Mark `isPressed` as deprecated\n 'aria-pressed': isPressed,\n description: describedBy\n };\n if (isSmall) {\n computedSize ??= 'small';\n }\n if (isPrimary) {\n computedVariant ??= 'primary';\n }\n if (isTertiary) {\n computedVariant ??= 'tertiary';\n }\n if (isSecondary) {\n computedVariant ??= 'secondary';\n }\n if (isDefault) {\n deprecated('wp.components.Button `isDefault` prop', {\n since: '5.4',\n alternative: 'variant=\"secondary\"'\n });\n computedVariant ??= 'secondary';\n }\n if (isLink) {\n computedVariant ??= 'link';\n }\n return {\n ...newProps,\n ...otherProps,\n size: computedSize,\n variant: computedVariant\n };\n}\n\n/**\n * Lets users take actions and make choices with a single click or tap.\n *\n * ```jsx\n * import { Button } from '@wordpress/components';\n * const Mybutton = () => (\n * <Button\n * variant=\"primary\"\n * onClick={ handleClick }\n * >\n * Click here\n * </Button>\n * );\n * ```\n */\nexport const Button = forwardRef(function UnforwardedButton(props, ref) {\n const {\n __next40pxDefaultSize,\n accessibleWhenDisabled,\n isBusy,\n isDestructive,\n className,\n disabled,\n icon,\n iconPosition = 'left',\n iconSize,\n showTooltip,\n tooltipPosition,\n shortcut,\n label,\n children,\n size = 'default',\n text,\n variant,\n description,\n ...buttonOrAnchorProps\n } = useDeprecatedProps(props);\n const {\n href,\n target,\n 'aria-checked': ariaChecked,\n 'aria-pressed': ariaPressed,\n 'aria-selected': ariaSelected,\n ...additionalProps\n } = 'href' in buttonOrAnchorProps ? buttonOrAnchorProps : {\n href: undefined,\n target: undefined,\n ...buttonOrAnchorProps\n };\n const instanceId = useInstanceId(Button, 'components-button__description');\n const truthyAriaPressedValues = [true, 'true', 'mixed'];\n const classes = clsx('components-button', className, {\n 'is-next-40px-default-size': __next40pxDefaultSize,\n 'is-secondary': variant === 'secondary',\n 'is-primary': variant === 'primary',\n 'is-small': size === 'small',\n 'is-compact': size === 'compact',\n 'is-tertiary': variant === 'tertiary',\n 'is-pressed': truthyAriaPressedValues.includes(ariaPressed),\n 'is-pressed-mixed': ariaPressed === 'mixed',\n 'is-busy': isBusy,\n 'is-link': variant === 'link',\n 'is-destructive': isDestructive,\n 'has-text': !!icon && (text || hasRenderableChildren(children)),\n 'has-icon': !!icon,\n 'has-icon-right': iconPosition === 'right'\n });\n const trulyDisabled = disabled && !accessibleWhenDisabled;\n const Tag = href !== undefined && !disabled ? 'a' : 'button';\n const buttonProps = Tag === 'button' ? {\n type: 'button',\n disabled: trulyDisabled,\n 'aria-checked': ariaChecked,\n 'aria-pressed': ariaPressed,\n 'aria-selected': ariaSelected\n } : {};\n const anchorProps = Tag === 'a' ? {\n href,\n target\n } : {};\n const disableEventProps = {};\n if (disabled && accessibleWhenDisabled) {\n // In this case, the button will be disabled, but still focusable and\n // perceivable by screen reader users.\n buttonProps['aria-disabled'] = true;\n anchorProps['aria-disabled'] = true;\n for (const disabledEvent of disabledEventsOnDisabledButton) {\n disableEventProps[disabledEvent] = event => {\n if (event) {\n event.stopPropagation();\n event.preventDefault();\n }\n };\n }\n }\n\n // Should show the tooltip if...\n const shouldShowTooltip = !trulyDisabled && (\n // An explicit tooltip is passed or...\n showTooltip && !!label ||\n // There's a shortcut or...\n !!shortcut ||\n // There's a label and...\n !!label &&\n // The children are empty and...\n !children?.length &&\n // The tooltip is not explicitly disabled.\n false !== showTooltip);\n const descriptionId = description ? instanceId : undefined;\n const describedById = additionalProps['aria-describedby'] || descriptionId;\n const commonProps = {\n className: classes,\n 'aria-label': additionalProps['aria-label'] || label,\n 'aria-describedby': describedById,\n ref\n };\n const elementChildren = /*#__PURE__*/_jsxs(_Fragment, {\n children: [icon && iconPosition === 'left' && /*#__PURE__*/_jsx(Icon, {\n icon: icon,\n size: iconSize\n }), text && /*#__PURE__*/_jsx(_Fragment, {\n children: text\n }), children, icon && iconPosition === 'right' && /*#__PURE__*/_jsx(Icon, {\n icon: icon,\n size: iconSize\n })]\n });\n const element = Tag === 'a' ? /*#__PURE__*/_jsx(\"a\", {\n ...anchorProps,\n ...additionalProps,\n ...disableEventProps,\n ...commonProps,\n children: elementChildren\n }) : /*#__PURE__*/_jsx(\"button\", {\n ...buttonProps,\n ...additionalProps,\n ...disableEventProps,\n ...commonProps,\n children: elementChildren\n });\n\n // In order to avoid some React reconciliation issues, we are always rendering\n // the `Tooltip` component even when `shouldShowTooltip` is `false`.\n // In order to make sure that the tooltip doesn't show when it shouldn't,\n // we don't pass the props to the `Tooltip` component.\n const tooltipProps = shouldShowTooltip ? {\n text: children?.length && description ? description : label,\n shortcut,\n placement: tooltipPosition &&\n // Convert legacy `position` values to be used with the new `placement` prop\n positionToPlacement(tooltipPosition)\n } : {};\n return /*#__PURE__*/_jsxs(_Fragment, {\n children: [/*#__PURE__*/_jsx(Tooltip, {\n ...tooltipProps,\n children: element\n }), description && /*#__PURE__*/_jsx(VisuallyHidden, {\n children: /*#__PURE__*/_jsx(\"span\", {\n id: descriptionId,\n children: description\n })\n })]\n });\n});\nexport default Button;"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,UAAU;AACjB,OAAO,gBAAgB;AACvB,SAAS,UAAU,UAAU,YAAY,sBAAsB;AAC/D,SAAS,qBAAqB;AAC9B,OAAO,aAAa;AACpB,OAAO,UAAU;AACjB,SAAS,sBAAsB;AAC/B,SAAS,2BAA2B;AACpC,SAAS,OAAO,MAAM,YAAY,WAAW,QAAQ,aAAa;AAClE,IAAM,iCAAiC,CAAC,eAAe,SAAS;AAYhE,IAAM,wBAAwB,cAAY,SAAS,QAAQ,QAAQ,EAAE,KAAK,WAAS;AACjF,MAAI,CAAC,eAAe,KAAK,GAAG;AAC1B,WAAO,UAAU;AAAA,EACnB;AACA,MAAI,MAAM,SAAS,UAAU;AAC3B,WAAO,sBAAsB,MAAM,MAAM,QAAQ;AAAA,EACnD;AAGA,SAAO,MAAM,MAAM,cAAc;AACnC,CAAC;AACD,SAAS,mBAAmB;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA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
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -14,14 +14,16 @@ function useCardBody(props) {
|
|
|
14
14
|
} = useContextSystem(props, "CardBody");
|
|
15
15
|
const cx = useCx();
|
|
16
16
|
const classes = useMemo(() => cx(
|
|
17
|
-
styles.
|
|
17
|
+
styles.getCardBodyStyles({
|
|
18
|
+
isScrollable
|
|
19
|
+
}),
|
|
18
20
|
styles.borderRadius,
|
|
19
21
|
getPaddingBySize(size),
|
|
20
22
|
isShady && styles.shady,
|
|
21
23
|
// This classname is added for legacy compatibility reasons.
|
|
22
24
|
"components-card__body",
|
|
23
25
|
className
|
|
24
|
-
), [className, cx, isShady, size]);
|
|
26
|
+
), [className, cx, isScrollable, isShady, size]);
|
|
25
27
|
return {
|
|
26
28
|
...otherProps,
|
|
27
29
|
className: classes,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/card/card-body/hook.ts"],
|
|
4
|
-
"sourcesContent": ["import { useMemo } from '@wordpress/element';\nimport { useContextSystem } from '../../context';\nimport * as styles from '../styles';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport { getPaddingBySize } from '../get-padding-by-size';\nexport function useCardBody(props) {\n const {\n className,\n isScrollable = false,\n isShady = false,\n size = 'medium',\n ...otherProps\n } = useContextSystem(props, 'CardBody');\n const cx = useCx();\n const classes = useMemo(() => cx(styles.
|
|
5
|
-
"mappings": ";AAAA,SAAS,eAAe;AACxB,SAAS,wBAAwB;AACjC,YAAY,YAAY;AACxB,SAAS,aAAa;AACtB,SAAS,wBAAwB;AAC1B,SAAS,YAAY,OAAO;AACjC,QAAM;AAAA,IACJ;AAAA,IACA,eAAe;AAAA,IACf,UAAU;AAAA,IACV,OAAO;AAAA,IACP,GAAG;AAAA,EACL,IAAI,iBAAiB,OAAO,UAAU;AACtC,QAAM,KAAK,MAAM;AACjB,QAAM,UAAU,QAAQ,MAAM;AAAA,IAAU;AAAA,
|
|
4
|
+
"sourcesContent": ["import { useMemo } from '@wordpress/element';\nimport { useContextSystem } from '../../context';\nimport * as styles from '../styles';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport { getPaddingBySize } from '../get-padding-by-size';\nexport function useCardBody(props) {\n const {\n className,\n isScrollable = false,\n isShady = false,\n size = 'medium',\n ...otherProps\n } = useContextSystem(props, 'CardBody');\n const cx = useCx();\n const classes = useMemo(() => cx(styles.getCardBodyStyles({\n isScrollable\n }), styles.borderRadius, getPaddingBySize(size), isShady && styles.shady,\n // This classname is added for legacy compatibility reasons.\n 'components-card__body', className), [className, cx, isScrollable, isShady, size]);\n return {\n ...otherProps,\n className: classes,\n isScrollable\n };\n}"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,eAAe;AACxB,SAAS,wBAAwB;AACjC,YAAY,YAAY;AACxB,SAAS,aAAa;AACtB,SAAS,wBAAwB;AAC1B,SAAS,YAAY,OAAO;AACjC,QAAM;AAAA,IACJ;AAAA,IACA,eAAe;AAAA,IACf,UAAU;AAAA,IACV,OAAO;AAAA,IACP,GAAG;AAAA,EACL,IAAI,iBAAiB,OAAO,UAAU;AACtC,QAAM,KAAK,MAAM;AACjB,QAAM,UAAU,QAAQ,MAAM;AAAA,IAAU,yBAAkB;AAAA,MACxD;AAAA,IACF,CAAC;AAAA,IAAU;AAAA,IAAc,iBAAiB,IAAI;AAAA,IAAG,WAAkB;AAAA;AAAA,IAEnE;AAAA,IAAyB;AAAA,EAAS,GAAG,CAAC,WAAW,IAAI,cAAc,SAAS,IAAI,CAAC;AACjF,SAAO;AAAA,IACL,GAAG;AAAA,IACH,WAAW;AAAA,IACX;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|