@wordpress/components 20.0.2-next.957ca95e4c.0 → 21.0.1
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 +68 -1
- package/CONTRIBUTING.md +3 -54
- package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +9 -9
- package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
- package/build/angle-picker-control/index.js +10 -0
- package/build/angle-picker-control/index.js.map +1 -1
- package/build/autocomplete/autocompleter-ui.js +3 -3
- package/build/autocomplete/autocompleter-ui.js.map +1 -1
- package/build/border-box-control/border-box-control/component.js +10 -7
- package/build/border-box-control/border-box-control/component.js.map +1 -1
- package/build/border-box-control/border-box-control-linked-button/component.js +1 -2
- package/build/border-box-control/border-box-control-linked-button/component.js.map +1 -1
- package/build/border-box-control/border-box-control-split-controls/component.js +10 -7
- package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- package/build/border-box-control/styles.js +7 -7
- package/build/border-box-control/styles.js.map +1 -1
- package/build/border-control/border-control-dropdown/component.js +2 -1
- package/build/border-control/border-control-dropdown/component.js.map +1 -1
- package/build/box-control/linked-button.js +3 -3
- package/build/box-control/linked-button.js.map +1 -1
- package/build/card/styles.js +17 -17
- package/build/card/styles.js.map +1 -1
- package/build/checkbox-control/index.js +3 -3
- package/build/checkbox-control/index.js.map +1 -1
- package/build/color-palette/index.js +1 -1
- package/build/color-palette/index.js.map +1 -1
- package/build/color-picker/input-with-slider.js +2 -1
- package/build/color-picker/input-with-slider.js.map +1 -1
- package/build/combobox-control/index.js +1 -1
- package/build/combobox-control/index.js.map +1 -1
- package/build/custom-gradient-picker/index.js +1 -1
- package/build/custom-gradient-picker/index.js.map +1 -1
- package/build/date-time/date/index.js +1 -1
- package/build/date-time/date/index.js.map +1 -1
- package/build/date-time/time/timezone.js +1 -1
- package/build/date-time/time/timezone.js.map +1 -1
- package/build/disabled/index.js +14 -6
- package/build/disabled/index.js.map +1 -1
- package/build/disabled/styles/disabled-styles.js +8 -18
- package/build/disabled/styles/disabled-styles.js.map +1 -1
- package/build/drop-zone/index.js +44 -9
- package/build/drop-zone/index.js.map +1 -1
- package/build/drop-zone/provider.js.map +1 -1
- package/build/drop-zone/types.js +6 -0
- package/build/drop-zone/types.js.map +1 -0
- package/build/dropdown/index.js +11 -4
- package/build/dropdown/index.js.map +1 -1
- package/build/flex/flex/hook.js +6 -30
- package/build/flex/flex/hook.js.map +1 -1
- package/build/focal-point-picker/controls.js +10 -5
- package/build/focal-point-picker/controls.js.map +1 -1
- package/build/focal-point-picker/focal-point.js.map +1 -1
- package/build/focal-point-picker/grid.js.map +1 -1
- package/build/focal-point-picker/index.js +83 -16
- package/build/focal-point-picker/index.js.map +1 -1
- package/build/focal-point-picker/media.js +4 -0
- package/build/focal-point-picker/media.js.map +1 -1
- package/build/focal-point-picker/styles/focal-point-picker-style.js +70 -41
- package/build/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
- package/build/focal-point-picker/styles/focal-point-style.js +12 -12
- package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
- package/build/focal-point-picker/types.js +6 -0
- package/build/focal-point-picker/types.js.map +1 -0
- package/build/focal-point-picker/utils.js +6 -6
- package/build/focal-point-picker/utils.js.map +1 -1
- package/build/font-size-picker/index.js +11 -0
- package/build/font-size-picker/index.js.map +1 -1
- package/build/font-size-picker/utils.js +1 -1
- package/build/font-size-picker/utils.js.map +1 -1
- package/build/form-file-upload/index.js +22 -2
- package/build/form-file-upload/index.js.map +1 -1
- package/build/form-file-upload/types.js +6 -0
- package/build/form-file-upload/types.js.map +1 -0
- package/build/form-toggle/index.js +1 -3
- package/build/form-toggle/index.js.map +1 -1
- package/build/form-token-field/index.js +4 -6
- package/build/form-token-field/index.js.map +1 -1
- package/build/form-token-field/suggestions-list.js +1 -3
- package/build/form-token-field/suggestions-list.js.map +1 -1
- package/build/gradient-picker/index.js +25 -26
- package/build/gradient-picker/index.js.map +1 -1
- package/build/icon/index.js +1 -2
- package/build/icon/index.js.map +1 -1
- package/build/input-control/input-base.js +3 -2
- package/build/input-control/input-base.js.map +1 -1
- package/build/input-control/label.js +2 -2
- package/build/input-control/label.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +41 -128
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/modal/aria-helper.js +3 -10
- package/build/modal/aria-helper.js.map +1 -1
- package/build/navigable-container/container.js +5 -1
- package/build/navigable-container/container.js.map +1 -1
- package/build/navigable-container/menu.js +10 -12
- package/build/navigable-container/menu.js.map +1 -1
- package/build/navigable-container/tabbable.js +2 -4
- package/build/navigable-container/tabbable.js.map +1 -1
- package/build/navigation/menu/menu-title-search.js +2 -1
- package/build/navigation/menu/menu-title-search.js.map +1 -1
- package/build/navigation/menu/use-navigation-tree-menu.js +2 -1
- package/build/navigation/menu/use-navigation-tree-menu.js.map +1 -1
- package/build/navigator/navigator-button/hook.js +1 -1
- package/build/navigator/navigator-button/hook.js.map +1 -1
- package/build/navigator/navigator-screen/component.js +2 -2
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/number-control/index.js +29 -25
- package/build/number-control/index.js.map +1 -1
- package/build/number-control/types.js +6 -0
- package/build/number-control/types.js.map +1 -0
- package/build/placeholder/index.js +1 -3
- package/build/placeholder/index.js.map +1 -1
- package/build/popover/index.js +190 -160
- package/build/popover/index.js.map +1 -1
- package/build/popover/types.js +6 -0
- package/build/popover/types.js.map +1 -0
- package/build/popover/utils.js +125 -24
- package/build/popover/utils.js.map +1 -1
- package/build/radio-control/index.js +7 -4
- package/build/radio-control/index.js.map +1 -1
- package/build/range-control/index.js +4 -1
- package/build/range-control/index.js.map +1 -1
- package/build/range-control/styles/range-control-styles.js +33 -33
- package/build/range-control/styles/range-control-styles.js.map +1 -1
- package/build/sandbox/index.js +2 -2
- package/build/sandbox/index.js.map +1 -1
- package/build/search-control/index.js +38 -10
- package/build/search-control/index.js.map +1 -1
- package/build/search-control/types.js +6 -0
- package/build/search-control/types.js.map +1 -0
- package/build/select-control/index.native.js +2 -1
- package/build/select-control/index.native.js.map +1 -1
- package/build/tab-panel/index.js +48 -9
- package/build/tab-panel/index.js.map +1 -1
- package/build/tab-panel/types.js +6 -0
- package/build/tab-panel/types.js.map +1 -0
- package/build/text-control/index.js +2 -0
- package/build/text-control/index.js.map +1 -1
- package/build/textarea-control/index.js +3 -3
- package/build/textarea-control/index.js.map +1 -1
- package/build/toggle-control/index.js +44 -4
- package/build/toggle-control/index.js.map +1 -1
- package/build/toggle-control/types.js +6 -0
- package/build/toggle-control/types.js.map +1 -0
- package/build/toggle-group-control/toggle-group-control/component.js +2 -2
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-icon/component.js +1 -1
- package/build/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
- package/build/tooltip/index.js +9 -7
- package/build/tooltip/index.js.map +1 -1
- package/build/ui/context/context-connect.js +31 -22
- package/build/ui/context/context-connect.js.map +1 -1
- package/build/ui/context/context-system-provider.js +4 -3
- package/build/ui/context/context-system-provider.js.map +1 -1
- package/build/unit-control/index.js +1 -1
- package/build/unit-control/index.js.map +1 -1
- package/build/unit-control/styles/unit-control-styles.js +9 -9
- package/build/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build/utils/colors-values.js +2 -30
- package/build/utils/colors-values.js.map +1 -1
- package/build/utils/math.js +4 -4
- package/build/utils/math.js.map +1 -1
- package/build/utils/values.js +62 -6
- package/build/utils/values.js.map +1 -1
- package/build/view/component.js +6 -7
- package/build/view/component.js.map +1 -1
- package/build/view/types.js +6 -0
- package/build/view/types.js.map +1 -0
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +9 -9
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
- package/build-module/angle-picker-control/index.js +9 -0
- package/build-module/angle-picker-control/index.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.js +4 -4
- package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
- package/build-module/border-box-control/border-box-control/component.js +11 -8
- package/build-module/border-box-control/border-box-control/component.js.map +1 -1
- package/build-module/border-box-control/border-box-control-linked-button/component.js +1 -2
- package/build-module/border-box-control/border-box-control-linked-button/component.js.map +1 -1
- package/build-module/border-box-control/border-box-control-split-controls/component.js +11 -8
- package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- package/build-module/border-box-control/styles.js +7 -7
- package/build-module/border-box-control/styles.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/component.js +2 -1
- package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
- package/build-module/box-control/linked-button.js +3 -3
- package/build-module/box-control/linked-button.js.map +1 -1
- package/build-module/card/styles.js +17 -17
- package/build-module/card/styles.js.map +1 -1
- package/build-module/checkbox-control/index.js +3 -3
- package/build-module/checkbox-control/index.js.map +1 -1
- package/build-module/color-palette/index.js +1 -1
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-picker/input-with-slider.js +2 -1
- package/build-module/color-picker/input-with-slider.js.map +1 -1
- package/build-module/combobox-control/index.js +1 -1
- package/build-module/combobox-control/index.js.map +1 -1
- package/build-module/custom-gradient-picker/index.js +1 -1
- package/build-module/custom-gradient-picker/index.js.map +1 -1
- package/build-module/date-time/date/index.js +2 -3
- package/build-module/date-time/date/index.js.map +1 -1
- package/build-module/date-time/time/timezone.js +1 -1
- package/build-module/date-time/time/timezone.js.map +1 -1
- package/build-module/disabled/index.js +16 -8
- package/build-module/disabled/index.js.map +1 -1
- package/build-module/disabled/styles/disabled-styles.js +6 -12
- package/build-module/disabled/styles/disabled-styles.js.map +1 -1
- package/build-module/drop-zone/index.js +40 -9
- package/build-module/drop-zone/index.js.map +1 -1
- package/build-module/drop-zone/provider.js.map +1 -1
- package/build-module/drop-zone/types.js +2 -0
- package/build-module/drop-zone/types.js.map +1 -0
- package/build-module/dropdown/index.js +10 -4
- package/build-module/dropdown/index.js.map +1 -1
- package/build-module/flex/flex/hook.js +7 -29
- package/build-module/flex/flex/hook.js.map +1 -1
- package/build-module/focal-point-picker/controls.js +11 -6
- package/build-module/focal-point-picker/controls.js.map +1 -1
- package/build-module/focal-point-picker/focal-point.js.map +1 -1
- package/build-module/focal-point-picker/grid.js.map +1 -1
- package/build-module/focal-point-picker/index.js +81 -16
- package/build-module/focal-point-picker/index.js.map +1 -1
- package/build-module/focal-point-picker/media.js +4 -0
- package/build-module/focal-point-picker/media.js.map +1 -1
- package/build-module/focal-point-picker/styles/focal-point-picker-style.js +68 -40
- package/build-module/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
- package/build-module/focal-point-picker/styles/focal-point-style.js +12 -12
- package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
- package/build-module/focal-point-picker/types.js +2 -0
- package/build-module/focal-point-picker/types.js.map +1 -0
- package/build-module/focal-point-picker/utils.js +6 -6
- package/build-module/focal-point-picker/utils.js.map +1 -1
- package/build-module/font-size-picker/index.js +10 -0
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/font-size-picker/utils.js +1 -1
- package/build-module/font-size-picker/utils.js.map +1 -1
- package/build-module/form-file-upload/index.js +21 -4
- package/build-module/form-file-upload/index.js.map +1 -1
- package/build-module/form-file-upload/types.js +2 -0
- package/build-module/form-file-upload/types.js.map +1 -0
- package/build-module/form-toggle/index.js +1 -3
- package/build-module/form-toggle/index.js.map +1 -1
- package/build-module/form-token-field/index.js +4 -5
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/form-token-field/suggestions-list.js +1 -2
- package/build-module/form-token-field/suggestions-list.js.map +1 -1
- package/build-module/gradient-picker/index.js +25 -26
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/icon/index.js +1 -2
- package/build-module/icon/index.js.map +1 -1
- package/build-module/input-control/input-base.js +4 -3
- package/build-module/input-control/input-base.js.map +1 -1
- package/build-module/input-control/label.js +3 -3
- package/build-module/input-control/label.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +41 -127
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/modal/aria-helper.js +3 -8
- package/build-module/modal/aria-helper.js.map +1 -1
- package/build-module/navigable-container/container.js +5 -1
- package/build-module/navigable-container/container.js.map +1 -1
- package/build-module/navigable-container/menu.js +10 -11
- package/build-module/navigable-container/menu.js.map +1 -1
- package/build-module/navigable-container/tabbable.js +2 -3
- package/build-module/navigable-container/tabbable.js.map +1 -1
- package/build-module/navigation/menu/menu-title-search.js +2 -1
- package/build-module/navigation/menu/menu-title-search.js.map +1 -1
- package/build-module/navigation/menu/use-navigation-tree-menu.js +2 -1
- package/build-module/navigation/menu/use-navigation-tree-menu.js.map +1 -1
- package/build-module/navigator/navigator-button/hook.js +1 -1
- package/build-module/navigator/navigator-button/hook.js.map +1 -1
- package/build-module/navigator/navigator-screen/component.js +2 -2
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/number-control/index.js +31 -23
- package/build-module/number-control/index.js.map +1 -1
- package/build-module/number-control/types.js +2 -0
- package/build-module/number-control/types.js.map +1 -0
- package/build-module/placeholder/index.js +1 -3
- package/build-module/placeholder/index.js.map +1 -1
- package/build-module/popover/index.js +192 -162
- package/build-module/popover/index.js.map +1 -1
- package/build-module/popover/types.js +2 -0
- package/build-module/popover/types.js.map +1 -0
- package/build-module/popover/utils.js +118 -23
- package/build-module/popover/utils.js.map +1 -1
- package/build-module/radio-control/index.js +7 -5
- package/build-module/radio-control/index.js.map +1 -1
- package/build-module/range-control/index.js +4 -1
- package/build-module/range-control/index.js.map +1 -1
- package/build-module/range-control/styles/range-control-styles.js +33 -33
- package/build-module/range-control/styles/range-control-styles.js.map +1 -1
- package/build-module/sandbox/index.js +2 -2
- package/build-module/sandbox/index.js.map +1 -1
- package/build-module/search-control/index.js +34 -7
- package/build-module/search-control/index.js.map +1 -1
- package/build-module/search-control/types.js +2 -0
- package/build-module/search-control/types.js.map +1 -0
- package/build-module/select-control/index.native.js +1 -1
- package/build-module/select-control/index.native.js.map +1 -1
- package/build-module/tab-panel/index.js +46 -10
- package/build-module/tab-panel/index.js.map +1 -1
- package/build-module/tab-panel/types.js +2 -0
- package/build-module/tab-panel/types.js.map +1 -0
- package/build-module/text-control/index.js +2 -0
- package/build-module/text-control/index.js.map +1 -1
- package/build-module/textarea-control/index.js +3 -3
- package/build-module/textarea-control/index.js.map +1 -1
- package/build-module/toggle-control/index.js +38 -4
- package/build-module/toggle-control/index.js.map +1 -1
- package/build-module/toggle-control/types.js +2 -0
- package/build-module/toggle-control/types.js.map +1 -0
- package/build-module/toggle-group-control/toggle-group-control/component.js +2 -2
- package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
- package/build-module/tooltip/index.js +10 -8
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/ui/context/context-connect.js +30 -23
- package/build-module/ui/context/context-connect.js.map +1 -1
- package/build-module/ui/context/context-system-provider.js +5 -4
- package/build-module/ui/context/context-system-provider.js.map +1 -1
- package/build-module/unit-control/index.js +1 -1
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/unit-control/styles/unit-control-styles.js +9 -9
- package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build-module/utils/colors-values.js +2 -30
- package/build-module/utils/colors-values.js.map +1 -1
- package/build-module/utils/math.js +4 -4
- package/build-module/utils/math.js.map +1 -1
- package/build-module/utils/values.js +48 -6
- package/build-module/utils/values.js.map +1 -1
- package/build-module/view/component.js +5 -8
- package/build-module/view/component.js.map +1 -1
- package/build-module/view/types.js +2 -0
- package/build-module/view/types.js.map +1 -0
- package/build-style/style-rtl.css +4 -31
- package/build-style/style.css +4 -31
- package/build-types/base-field/hook.d.ts +54 -55
- package/build-types/base-field/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control/component.d.ts +10 -2
- package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts +56 -57
- 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/component.d.ts +2 -1
- package/build-types/border-box-control/border-box-control-linked-button/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +55 -56
- 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/component.d.ts +9 -2
- package/build-types/border-box-control/border-box-control-split-controls/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +56 -57
- 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/component.d.ts +2 -1
- package/build-types/border-box-control/border-box-control-visualizer/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +55 -56
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
- package/build-types/border-box-control/styles.d.ts.map +1 -1
- package/build-types/border-box-control/types.d.ts +5 -4
- package/build-types/border-box-control/types.d.ts.map +1 -1
- package/build-types/border-control/border-control/component.d.ts +14 -2
- package/build-types/border-control/border-control/component.d.ts.map +1 -1
- package/build-types/border-control/border-control/hook.d.ts +56 -57
- package/build-types/border-control/border-control/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/component.d.ts +10 -2
- 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 +56 -57
- package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-style-picker/component.d.ts +6 -2
- package/build-types/border-control/border-control-style-picker/component.d.ts.map +1 -1
- package/build-types/border-control/border-control-style-picker/hook.d.ts +55 -56
- package/build-types/border-control/border-control-style-picker/hook.d.ts.map +1 -1
- package/build-types/border-control/stories/index.d.ts +74 -6
- package/build-types/border-control/stories/index.d.ts.map +1 -1
- package/build-types/border-control/types.d.ts +6 -8
- package/build-types/border-control/types.d.ts.map +1 -1
- package/build-types/button-group/index.d.ts +1 -3
- package/build-types/button-group/index.d.ts.map +1 -1
- package/build-types/card/card/component.d.ts +9 -2
- package/build-types/card/card/component.d.ts.map +1 -1
- package/build-types/card/card/hook.d.ts +55 -56
- package/build-types/card/card/hook.d.ts.map +1 -1
- package/build-types/card/card-body/component.d.ts +9 -2
- package/build-types/card/card-body/component.d.ts.map +1 -1
- package/build-types/card/card-body/hook.d.ts +55 -56
- package/build-types/card/card-body/hook.d.ts.map +1 -1
- package/build-types/card/card-divider/component.d.ts +7 -2
- package/build-types/card/card-divider/component.d.ts.map +1 -1
- package/build-types/card/card-divider/hook.d.ts +55 -55
- package/build-types/card/card-footer/component.d.ts +11 -2
- package/build-types/card/card-footer/component.d.ts.map +1 -1
- package/build-types/card/card-footer/hook.d.ts +55 -56
- package/build-types/card/card-footer/hook.d.ts.map +1 -1
- package/build-types/card/card-header/component.d.ts +1 -1
- package/build-types/card/card-header/component.d.ts.map +1 -1
- package/build-types/card/card-header/hook.d.ts +55 -56
- package/build-types/card/card-header/hook.d.ts.map +1 -1
- package/build-types/card/card-media/component.d.ts +2 -1
- package/build-types/card/card-media/component.d.ts.map +1 -1
- package/build-types/card/card-media/hook.d.ts +55 -56
- package/build-types/card/card-media/hook.d.ts.map +1 -1
- package/build-types/checkbox-control/index.d.ts +1 -1
- package/build-types/checkbox-control/index.d.ts.map +1 -1
- package/build-types/checkbox-control/stories/index.d.ts.map +1 -1
- package/build-types/checkbox-control/types.d.ts +1 -1
- package/build-types/checkbox-control/types.d.ts.map +1 -1
- package/build-types/color-indicator/index.d.ts +1 -3
- package/build-types/color-indicator/index.d.ts.map +1 -1
- package/build-types/color-palette/styles.d.ts +1 -3
- package/build-types/color-palette/styles.d.ts.map +1 -1
- package/build-types/color-picker/component.d.ts +2 -1
- package/build-types/color-picker/component.d.ts.map +1 -1
- package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +12 -25
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/confirm-dialog/component.d.ts +4 -8
- package/build-types/confirm-dialog/component.d.ts.map +1 -1
- package/build-types/date-time/date/styles.d.ts +4 -8
- package/build-types/date-time/date/styles.d.ts.map +1 -1
- package/build-types/date-time/date-time/styles.d.ts +4 -6
- package/build-types/date-time/date-time/styles.d.ts.map +1 -1
- package/build-types/date-time/time/styles.d.ts +21 -43
- package/build-types/date-time/time/styles.d.ts.map +1 -1
- package/build-types/disabled/index.d.ts +1 -1
- package/build-types/disabled/index.d.ts.map +1 -1
- package/build-types/disabled/styles/disabled-styles.d.ts +1 -5
- package/build-types/disabled/styles/disabled-styles.d.ts.map +1 -1
- package/build-types/divider/component.d.ts +7 -2
- package/build-types/divider/component.d.ts.map +1 -1
- package/build-types/drop-zone/index.d.ts +29 -0
- package/build-types/drop-zone/index.d.ts.map +1 -0
- package/build-types/drop-zone/provider.d.ts +5 -0
- package/build-types/drop-zone/provider.d.ts.map +1 -0
- package/build-types/drop-zone/stories/index.d.ts +12 -0
- package/build-types/drop-zone/stories/index.d.ts.map +1 -0
- package/build-types/drop-zone/types.d.ts +29 -0
- package/build-types/drop-zone/types.d.ts.map +1 -0
- package/build-types/dropdown/dropdown-content-wrapper.d.ts +2 -1
- package/build-types/dropdown/dropdown-content-wrapper.d.ts.map +1 -1
- package/build-types/dropdown/index.d.ts.map +1 -1
- package/build-types/elevation/component.d.ts +2 -1
- package/build-types/elevation/component.d.ts.map +1 -1
- package/build-types/elevation/hook.d.ts +54 -55
- package/build-types/elevation/hook.d.ts.map +1 -1
- package/build-types/external-link/index.d.ts +1 -1
- package/build-types/external-link/index.d.ts.map +1 -1
- package/build-types/external-link/styles/external-link-styles.d.ts +1 -1
- package/build-types/flex/flex/component.d.ts +2 -1
- package/build-types/flex/flex/component.d.ts.map +1 -1
- package/build-types/flex/flex/hook.d.ts +55 -56
- package/build-types/flex/flex/hook.d.ts.map +1 -1
- package/build-types/flex/flex-block/component.d.ts +2 -1
- package/build-types/flex/flex-block/component.d.ts.map +1 -1
- package/build-types/flex/flex-block/hook.d.ts +55 -56
- package/build-types/flex/flex-block/hook.d.ts.map +1 -1
- package/build-types/flex/flex-item/component.d.ts +2 -1
- package/build-types/flex/flex-item/component.d.ts.map +1 -1
- package/build-types/flex/flex-item/hook.d.ts +55 -56
- package/build-types/flex/flex-item/hook.d.ts.map +1 -1
- package/build-types/focal-point-picker/controls.d.ts +4 -0
- package/build-types/focal-point-picker/controls.d.ts.map +1 -0
- package/build-types/focal-point-picker/focal-point.d.ts +5 -0
- package/build-types/focal-point-picker/focal-point.d.ts.map +1 -0
- package/build-types/focal-point-picker/grid.d.ts +5 -0
- package/build-types/focal-point-picker/grid.d.ts.map +1 -0
- package/build-types/focal-point-picker/index.d.ts +51 -0
- package/build-types/focal-point-picker/index.d.ts.map +1 -0
- package/build-types/focal-point-picker/media.d.ts +4 -0
- package/build-types/focal-point-picker/media.d.ts.map +1 -0
- package/build-types/focal-point-picker/stories/index.d.ts +15 -0
- package/build-types/focal-point-picker/stories/index.d.ts.map +1 -0
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +56 -0
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts.map +1 -0
- package/build-types/focal-point-picker/styles/focal-point-style.d.ts +19 -0
- package/build-types/focal-point-picker/styles/focal-point-style.d.ts.map +1 -0
- package/build-types/focal-point-picker/types.d.ts +79 -0
- package/build-types/focal-point-picker/types.d.ts.map +1 -0
- package/build-types/focal-point-picker/utils.d.ts +26 -0
- package/build-types/focal-point-picker/utils.d.ts.map +1 -0
- package/build-types/form-file-upload/index.d.ts +22 -0
- package/build-types/form-file-upload/index.d.ts.map +1 -0
- package/build-types/form-file-upload/stories/index.d.ts +23 -0
- package/build-types/form-file-upload/stories/index.d.ts.map +1 -0
- package/build-types/form-file-upload/test/index.d.ts +2 -0
- package/build-types/form-file-upload/test/index.d.ts.map +1 -0
- package/build-types/form-file-upload/types.d.ts +63 -0
- package/build-types/form-file-upload/types.d.ts.map +1 -0
- package/build-types/form-toggle/index.d.ts +1 -1
- package/build-types/form-toggle/index.d.ts.map +1 -1
- package/build-types/form-token-field/index.d.ts.map +1 -1
- package/build-types/form-token-field/styles.d.ts +1 -3
- package/build-types/form-token-field/styles.d.ts.map +1 -1
- package/build-types/form-token-field/suggestions-list.d.ts.map +1 -1
- package/build-types/form-token-field/token-input.d.ts +1 -3
- package/build-types/form-token-field/token-input.d.ts.map +1 -1
- package/build-types/grid/component.d.ts +2 -1
- package/build-types/grid/component.d.ts.map +1 -1
- package/build-types/grid/hook.d.ts +55 -56
- package/build-types/grid/hook.d.ts.map +1 -1
- package/build-types/h-stack/component.d.ts +5 -2
- package/build-types/h-stack/component.d.ts.map +1 -1
- package/build-types/h-stack/hook.d.ts +55 -56
- package/build-types/h-stack/hook.d.ts.map +1 -1
- package/build-types/heading/component.d.ts +4 -2
- package/build-types/heading/component.d.ts.map +1 -1
- package/build-types/heading/hook.d.ts +54 -55
- package/build-types/heading/hook.d.ts.map +1 -1
- package/build-types/input-control/index.d.ts +1 -1
- package/build-types/input-control/index.d.ts.map +1 -1
- package/build-types/input-control/input-base.d.ts.map +1 -1
- package/build-types/input-control/input-field.d.ts +1 -3
- package/build-types/input-control/input-field.d.ts.map +1 -1
- package/build-types/input-control/input-prefix-wrapper.d.ts +2 -1
- package/build-types/input-control/input-prefix-wrapper.d.ts.map +1 -1
- package/build-types/input-control/input-suffix-wrapper.d.ts +2 -1
- package/build-types/input-control/input-suffix-wrapper.d.ts.map +1 -1
- package/build-types/input-control/label.d.ts.map +1 -1
- package/build-types/input-control/stories/index.d.ts +5 -5
- package/build-types/input-control/stories/index.d.ts.map +1 -1
- package/build-types/input-control/styles/input-control-styles.d.ts +2 -6
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/input-control/types.d.ts +3 -0
- package/build-types/input-control/types.d.ts.map +1 -1
- package/build-types/item-group/item/component.d.ts +2 -1
- package/build-types/item-group/item/component.d.ts.map +1 -1
- package/build-types/item-group/item/hook.d.ts +54 -55
- package/build-types/item-group/item/hook.d.ts.map +1 -1
- package/build-types/item-group/item-group/component.d.ts +2 -1
- package/build-types/item-group/item-group/component.d.ts.map +1 -1
- package/build-types/item-group/item-group/hook.d.ts +54 -55
- package/build-types/item-group/item-group/hook.d.ts.map +1 -1
- package/build-types/modal/aria-helper.d.ts.map +1 -1
- package/build-types/navigable-container/menu.d.ts.map +1 -1
- package/build-types/navigable-container/tabbable.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/component.d.ts +4 -2
- package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +59 -60
- package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/component.d.ts +7 -2
- package/build-types/navigator/navigator-button/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/hook.d.ts +59 -60
- package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-provider/component.d.ts +2 -1
- package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-screen/component.d.ts +1 -1
- package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
- package/build-types/number-control/index.d.ts +10 -28
- package/build-types/number-control/index.d.ts.map +1 -1
- package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
- package/build-types/number-control/types.d.ts +72 -0
- package/build-types/number-control/types.d.ts.map +1 -0
- package/build-types/placeholder/index.d.ts +1 -1
- package/build-types/placeholder/index.d.ts.map +1 -1
- package/build-types/popover/index.d.ts +28 -24
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/popover/stories/index.d.ts +12 -0
- package/build-types/popover/stories/index.d.ts.map +1 -0
- package/build-types/popover/types.d.ts +179 -0
- package/build-types/popover/types.d.ts.map +1 -0
- package/build-types/popover/utils.d.ts +42 -24
- package/build-types/popover/utils.d.ts.map +1 -1
- package/build-types/radio-control/index.d.ts +1 -1
- package/build-types/radio-control/index.d.ts.map +1 -1
- package/build-types/range-control/index.d.ts +2 -4
- package/build-types/range-control/index.d.ts.map +1 -1
- package/build-types/range-control/input-range.d.ts +2 -4
- package/build-types/range-control/input-range.d.ts.map +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts +5 -10
- package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
- package/build-types/resizable-box/index.d.ts +1 -1
- package/build-types/resizable-box/resize-tooltip/index.d.ts +1 -1
- package/build-types/resizable-box/resize-tooltip/label.d.ts +1 -1
- package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts +1 -3
- package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
- package/build-types/scrollable/component.d.ts +2 -1
- package/build-types/scrollable/component.d.ts.map +1 -1
- package/build-types/scrollable/hook.d.ts +55 -56
- package/build-types/scrollable/hook.d.ts.map +1 -1
- package/build-types/search-control/index.d.ts +29 -0
- package/build-types/search-control/index.d.ts.map +1 -0
- package/build-types/search-control/stories/index.d.ts +47 -0
- package/build-types/search-control/stories/index.d.ts.map +1 -0
- package/build-types/search-control/types.d.ts +39 -0
- package/build-types/search-control/types.d.ts.map +1 -0
- package/build-types/select-control/index.d.ts +1 -3
- package/build-types/select-control/index.d.ts.map +1 -1
- package/build-types/select-control/stories/index.d.ts +2 -6
- package/build-types/select-control/stories/index.d.ts.map +1 -1
- package/build-types/select-control/styles/select-control-styles.d.ts +1 -3
- package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
- package/build-types/spacer/component.d.ts +2 -1
- package/build-types/spacer/component.d.ts.map +1 -1
- package/build-types/spacer/hook.d.ts +55 -56
- package/build-types/spacer/hook.d.ts.map +1 -1
- package/build-types/spinner/index.d.ts +1 -3
- package/build-types/spinner/index.d.ts.map +1 -1
- package/build-types/surface/component.d.ts +2 -1
- package/build-types/surface/component.d.ts.map +1 -1
- package/build-types/surface/hook.d.ts +55 -56
- package/build-types/surface/hook.d.ts.map +1 -1
- package/build-types/tab-panel/index.d.ts +42 -0
- package/build-types/tab-panel/index.d.ts.map +1 -0
- package/build-types/tab-panel/stories/index.d.ts +12 -0
- package/build-types/tab-panel/stories/index.d.ts.map +1 -0
- package/build-types/tab-panel/test/index.d.ts +2 -0
- package/build-types/tab-panel/test/index.d.ts.map +1 -0
- package/build-types/tab-panel/types.d.ts +64 -0
- package/build-types/tab-panel/types.d.ts.map +1 -0
- package/build-types/text/component.d.ts +1 -1
- package/build-types/text/component.d.ts.map +1 -1
- package/build-types/text/hook.d.ts +55 -56
- package/build-types/text/hook.d.ts.map +1 -1
- package/build-types/text-control/index.d.ts +2 -4
- package/build-types/text-control/index.d.ts.map +1 -1
- package/build-types/text-control/types.d.ts +1 -1
- package/build-types/text-control/types.d.ts.map +1 -1
- package/build-types/textarea-control/index.d.ts +1 -1
- package/build-types/textarea-control/index.d.ts.map +1 -1
- package/build-types/textarea-control/types.d.ts +1 -1
- package/build-types/textarea-control/types.d.ts.map +1 -1
- package/build-types/toggle-control/index.d.ts +26 -0
- package/build-types/toggle-control/index.d.ts.map +1 -0
- package/build-types/toggle-control/stories/index.d.ts +13 -0
- package/build-types/toggle-control/stories/index.d.ts.map +1 -0
- package/build-types/toggle-control/test/index.d.ts +2 -0
- package/build-types/toggle-control/test/index.d.ts.map +1 -0
- package/build-types/toggle-control/types.d.ts +20 -0
- package/build-types/toggle-control/types.d.ts.map +1 -0
- package/build-types/toggle-group-control/stories/index.d.ts +4 -2
- package/build-types/toggle-group-control/stories/index.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts +12 -2
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts +2 -4
- package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts +2 -1
- package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +3 -5
- package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/types.d.ts +2 -2
- package/build-types/toggle-group-control/types.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/component.d.ts +2 -1
- package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +55 -56
- package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/component.d.ts +2 -1
- package/build-types/tools-panel/tools-panel-header/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/hook.d.ts +55 -56
- package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/component.d.ts +6 -2
- package/build-types/tools-panel/tools-panel-item/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts +55 -56
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/tooltip/index.d.ts.map +1 -1
- package/build-types/truncate/component.d.ts +2 -1
- package/build-types/truncate/component.d.ts.map +1 -1
- package/build-types/truncate/hook.d.ts +55 -56
- package/build-types/truncate/hook.d.ts.map +1 -1
- package/build-types/ui/context/context-connect.d.ts +10 -9
- package/build-types/ui/context/context-connect.d.ts.map +1 -1
- package/build-types/ui/context/context-system-provider.d.ts.map +1 -1
- package/build-types/ui/context/test/context-connect.d.ts +2 -0
- package/build-types/ui/context/test/context-connect.d.ts.map +1 -0
- package/build-types/ui/context/test/wordpress-component.d.ts +2 -0
- package/build-types/ui/context/test/wordpress-component.d.ts.map +1 -0
- package/build-types/ui/context/wordpress-component.d.ts +8 -9
- package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
- package/build-types/ui/control-group/component.d.ts +4 -1
- package/build-types/ui/control-group/component.d.ts.map +1 -1
- package/build-types/ui/control-group/hook.d.ts +55 -56
- package/build-types/ui/control-group/hook.d.ts.map +1 -1
- package/build-types/ui/control-label/component.d.ts +4 -1
- package/build-types/ui/control-label/component.d.ts.map +1 -1
- package/build-types/ui/control-label/hook.d.ts +55 -56
- package/build-types/ui/control-label/hook.d.ts.map +1 -1
- package/build-types/ui/form-group/form-group.d.ts +4 -8
- package/build-types/ui/form-group/form-group.d.ts.map +1 -1
- package/build-types/ui/form-group/use-form-group.d.ts +112 -114
- package/build-types/ui/form-group/use-form-group.d.ts.map +1 -1
- package/build-types/ui/shortcut/component.d.ts +2 -1
- package/build-types/ui/shortcut/component.d.ts.map +1 -1
- package/build-types/ui/spinner/component.d.ts +1 -1
- package/build-types/ui/tooltip/component.d.ts +11 -1
- package/build-types/ui/tooltip/component.d.ts.map +1 -1
- package/build-types/ui/tooltip/content.d.ts +7 -1
- package/build-types/ui/tooltip/styles.d.ts +1 -3
- package/build-types/ui/tooltip/styles.d.ts.map +1 -1
- package/build-types/unit-control/index.d.ts +2 -12
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/unit-control/stories/index.d.ts.map +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts +5 -10
- package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
- package/build-types/unit-control/types.d.ts +3 -35
- package/build-types/unit-control/types.d.ts.map +1 -1
- package/build-types/utils/colors-values.d.ts +0 -18
- package/build-types/utils/colors-values.d.ts.map +1 -1
- package/build-types/utils/math.d.ts +6 -6
- package/build-types/utils/math.d.ts.map +1 -1
- package/build-types/utils/values.d.ts +10 -8
- package/build-types/utils/values.d.ts.map +1 -1
- package/build-types/v-stack/component.d.ts +8 -2
- package/build-types/v-stack/component.d.ts.map +1 -1
- package/build-types/v-stack/hook.d.ts +55 -56
- package/build-types/v-stack/hook.d.ts.map +1 -1
- package/build-types/v-stack/stories/index.d.ts +8 -1
- package/build-types/v-stack/stories/index.d.ts.map +1 -1
- package/build-types/view/component.d.ts +8 -6
- package/build-types/view/component.d.ts.map +1 -1
- package/build-types/view/stories/index.d.ts +12 -0
- package/build-types/view/stories/index.d.ts.map +1 -0
- package/build-types/view/types.d.ts +8 -0
- package/build-types/view/types.d.ts.map +1 -0
- package/build-types/visually-hidden/component.d.ts +2 -1
- package/build-types/visually-hidden/component.d.ts.map +1 -1
- package/build-types/z-stack/component.d.ts +2 -1
- package/build-types/z-stack/component.d.ts.map +1 -1
- package/package.json +17 -17
- package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.js +1 -1
- package/src/angle-picker-control/README.md +9 -1
- package/src/angle-picker-control/index.js +12 -0
- package/src/angle-picker-control/stories/index.js +3 -3
- package/src/autocomplete/autocompleter-ui.js +6 -3
- package/src/base-field/test/__snapshots__/index.js.snap +3 -5
- package/src/border-box-control/border-box-control/component.tsx +28 -12
- package/src/border-box-control/border-box-control-linked-button/component.tsx +1 -2
- package/src/border-box-control/border-box-control-split-controls/component.tsx +25 -11
- package/src/border-box-control/stories/index.js +1 -0
- package/src/border-box-control/styles.ts +2 -1
- package/src/border-box-control/types.ts +5 -4
- package/src/border-control/border-control-dropdown/component.tsx +3 -8
- package/src/border-control/types.ts +7 -9
- package/src/box-control/linked-button.js +3 -3
- package/src/box-control/test/index.js +5 -5
- package/src/button/style.scss +4 -3
- package/src/card/styles.ts +1 -1
- package/src/card/test/__snapshots__/index.tsx.snap +39 -51
- package/src/checkbox-control/index.tsx +3 -6
- package/src/checkbox-control/stories/index.tsx +6 -2
- package/src/checkbox-control/types.ts +4 -1
- package/src/color-palette/index.js +1 -1
- package/src/color-palette/test/__snapshots__/index.js.snap +67 -91
- package/src/color-picker/input-with-slider.tsx +1 -0
- package/src/combobox-control/index.js +1 -1
- package/src/combobox-control/test/index.js +311 -0
- package/src/custom-gradient-picker/index.js +1 -1
- package/src/date-time/date/index.tsx +2 -2
- package/src/date-time/time/timezone.tsx +1 -1
- package/src/dimension-control/test/__snapshots__/index.test.js.snap +1122 -164
- package/src/dimension-control/test/index.test.js +29 -38
- package/src/disabled/index.tsx +27 -9
- package/src/disabled/styles/disabled-styles.tsx +2 -2
- package/src/disabled/test/index.tsx +38 -0
- package/src/drop-zone/README.md +3 -3
- package/src/drop-zone/{index.js → index.tsx} +48 -13
- package/src/drop-zone/{provider.js → provider.ts} +5 -1
- package/src/drop-zone/stories/index.tsx +30 -0
- package/src/drop-zone/types.ts +29 -0
- package/src/dropdown/README.md +6 -4
- package/src/dropdown/index.js +15 -3
- package/src/dropdown/stories/index.js +1 -1
- package/src/flex/flex/hook.ts +5 -54
- package/src/flex/test/__snapshots__/index.tsx.snap +7 -15
- package/src/focal-point-picker/README.md +2 -2
- package/src/focal-point-picker/{controls.js → controls.tsx} +38 -10
- package/src/focal-point-picker/{focal-point.js → focal-point.tsx} +7 -1
- package/src/focal-point-picker/{grid.js → grid.tsx} +6 -1
- package/src/focal-point-picker/{index.js → index.tsx} +99 -15
- package/src/focal-point-picker/{media.js → media.tsx} +10 -4
- package/src/focal-point-picker/stories/index.tsx +93 -0
- package/src/focal-point-picker/styles/{focal-point-picker-style.js → focal-point-picker-style.ts} +31 -5
- package/src/focal-point-picker/styles/{focal-point-style.js → focal-point-style.ts} +2 -1
- package/src/focal-point-picker/test/index.js +27 -7
- package/src/focal-point-picker/types.ts +93 -0
- package/src/focal-point-picker/{utils.js → utils.ts} +9 -9
- package/src/font-size-picker/README.md +9 -0
- package/src/font-size-picker/index.js +9 -0
- package/src/font-size-picker/stories/index.js +3 -5
- package/src/font-size-picker/test/index.js +15 -2
- package/src/font-size-picker/test/utils.js +1 -2
- package/src/font-size-picker/utils.js +1 -1
- package/src/form-file-upload/README.md +6 -1
- package/src/form-file-upload/{index.js → index.tsx} +22 -4
- package/src/form-file-upload/stories/index.tsx +74 -0
- package/src/form-file-upload/test/{index.js → index.tsx} +7 -3
- package/src/form-file-upload/types.ts +63 -0
- package/src/form-toggle/index.tsx +1 -6
- package/src/form-token-field/index.tsx +4 -5
- package/src/form-token-field/suggestions-list.tsx +1 -2
- package/src/gradient-picker/index.js +41 -47
- package/src/gradient-picker/stories/index.js +10 -0
- package/src/h-stack/test/__snapshots__/index.tsx.snap +3 -12
- package/src/higher-order/with-filters/test/__snapshots__/index.js.snap +87 -0
- package/src/higher-order/with-filters/test/index.js +20 -74
- package/src/icon/index.tsx +1 -1
- package/src/icon/stories/index.js +18 -0
- package/src/icon/test/index.js +32 -83
- package/src/input-control/input-base.tsx +9 -11
- package/src/input-control/label.tsx +9 -4
- package/src/input-control/styles/input-control-styles.tsx +0 -43
- package/src/input-control/types.ts +3 -0
- package/src/isolated-event-container/test/index.js +53 -11
- package/src/item-group/test/__snapshots__/index.js.snap +16 -16
- package/src/keyboard-shortcuts/test/index.js +16 -31
- package/src/menu-item/test/__snapshots__/index.js.snap +60 -62
- package/src/menu-item/test/index.js +30 -22
- package/src/modal/aria-helper.js +3 -8
- package/src/modal/style.scss +3 -4
- package/src/navigable-container/README.md +2 -0
- package/src/navigable-container/container.js +8 -1
- package/src/navigable-container/menu.js +14 -11
- package/src/navigable-container/stories/navigable-menu.js +49 -0
- package/src/navigable-container/stories/tabbable-container.js +40 -0
- package/src/navigable-container/tabbable.js +2 -3
- package/src/navigable-container/test/navigable-menu.js +277 -0
- package/src/navigable-container/test/tababble-container.js +175 -0
- package/src/navigation/menu/menu-title-search.js +2 -0
- package/src/navigation/menu/use-navigation-tree-menu.js +2 -0
- package/src/navigator/navigator-button/hook.ts +1 -1
- package/src/navigator/navigator-screen/component.tsx +6 -1
- package/src/number-control/index.tsx +209 -0
- package/src/number-control/stories/index.js +6 -18
- package/src/number-control/types.ts +75 -0
- package/src/panel/README.md +1 -1
- package/src/panel/test/__snapshots__/header.js.snap +9 -0
- package/src/panel/test/__snapshots__/index.js.snap +17 -0
- package/src/panel/test/__snapshots__/row.js.snap +17 -0
- package/src/panel/test/header.js +30 -23
- package/src/panel/test/index.js +33 -25
- package/src/panel/test/row.js +18 -11
- package/src/placeholder/index.tsx +4 -5
- package/src/placeholder/style.scss +4 -0
- package/src/popover/README.md +128 -48
- package/src/popover/{index.js → index.tsx} +284 -182
- package/src/popover/stories/{index.js → index.tsx} +52 -54
- package/src/popover/test/index.js +7 -5
- package/src/popover/types.ts +192 -0
- package/src/popover/utils.ts +242 -0
- package/src/radio-control/index.tsx +28 -29
- package/src/radio-control/style.scss +0 -17
- package/src/range-control/index.tsx +4 -1
- package/src/range-control/styles/range-control-styles.ts +8 -8
- package/src/sandbox/index.js +2 -2
- package/src/search-control/README.md +5 -3
- package/src/search-control/{index.js → index.tsx} +35 -7
- package/src/search-control/stories/index.tsx +66 -0
- package/src/search-control/types.ts +43 -0
- package/src/select-control/index.native.js +1 -1
- package/src/slot-fill/test/index.js +69 -12
- package/src/style.scss +0 -1
- package/src/surface/test/__snapshots__/index.tsx.snap +10 -10
- package/src/tab-panel/README.md +1 -2
- package/src/tab-panel/{index.js → index.tsx} +58 -13
- package/src/tab-panel/stories/index.tsx +37 -0
- package/src/tab-panel/test/index.tsx +120 -0
- package/src/tab-panel/types.ts +65 -0
- package/src/text-control/index.tsx +2 -0
- package/src/text-control/types.ts +5 -1
- package/src/textarea-control/index.tsx +3 -6
- package/src/textarea-control/types.ts +1 -1
- package/src/toggle-control/index.tsx +97 -0
- package/src/toggle-control/stories/index.tsx +58 -0
- package/src/toggle-control/test/index.tsx +53 -0
- package/src/toggle-control/types.ts +28 -0
- package/src/toggle-group-control/stories/index.tsx +10 -3
- package/src/toggle-group-control/toggle-group-control/component.tsx +3 -3
- package/src/toggle-group-control/toggle-group-control-option-icon/README.md +1 -1
- package/src/toggle-group-control/toggle-group-control-option-icon/component.tsx +1 -1
- package/src/toggle-group-control/types.ts +2 -2
- package/src/tooltip/index.js +11 -7
- package/src/ui/context/context-connect.ts +58 -31
- package/src/ui/context/context-system-provider.js +5 -4
- package/src/ui/context/test/context-connect.tsx +55 -0
- package/src/ui/context/test/wordpress-component.tsx +36 -0
- package/src/ui/context/wordpress-component.ts +18 -12
- package/src/ui/control-group/test/__snapshots__/index.js.snap +1 -4
- package/src/unit-control/index.tsx +1 -1
- package/src/unit-control/stories/index.tsx +7 -16
- package/src/unit-control/styles/unit-control-styles.ts +2 -2
- package/src/unit-control/test/__snapshots__/index.tsx.snap +4 -6
- package/src/unit-control/types.ts +3 -44
- package/src/utils/colors-values.js +2 -24
- package/src/utils/math.js +4 -4
- package/src/utils/values.js +48 -6
- package/src/v-stack/test/__snapshots__/index.tsx.snap +3 -12
- package/src/view/{component.js → component.tsx} +13 -4
- package/src/view/stories/index.tsx +32 -0
- package/src/view/types.ts +6 -0
- package/tsconfig.json +1 -6
- package/tsconfig.tsbuildinfo +1 -1
- package/src/focal-point-picker/stories/index.js +0 -76
- package/src/navigable-container/test/menu.js +0 -310
- package/src/navigable-container/test/tabbable.js +0 -158
- package/src/number-control/index.js +0 -192
- package/src/popover/utils.js +0 -107
- package/src/search-control/stories/index.js +0 -39
- package/src/tab-panel/stories/index.js +0 -39
- package/src/tab-panel/test/index.js +0 -179
- package/src/toggle-control/index.js +0 -55
- package/src/toggle-control/stories/index.js +0 -64
- package/src/toggle-control/style.scss +0 -14
- package/src/toggle-control/test/index.js +0 -52
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/range-control/styles/range-control-styles.ts"],"names":["css","NumberControl","COLORS","reduceMotion","rtl","space","rangeHeightValue","railHeight","rangeHeight","height","minHeight","thumbSize","Root","wrapperColor","color","ui","borderFocus","wrapperMargin","marks","__nextHasNoMarginBottom","marginBottom","undefined","Wrapper","BeforeIconWrapper","marginRight","AfterIconWrapper","marginLeft","railBackgroundColor","disabled","railColor","background","lightGray","Rail","trackBackgroundColor","trackColor","Track","MarksWrapper","markFill","isFilled","backgroundColor","Mark","markLabelFill","darkGray","MarkLabel","thumbColor","ThumbWrapper","transform","thumbFocus","isFocused","Thumb","InputRange","tooltipShow","show","opacity","tooltipPosition","position","isBottom","Tooltip","InputNumber","Act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C,CAyBP;AACA;;AACA,OAAO,MAAMY,WAAW,GAAG,qBAAQzD,aAAR;AAAA;AAAA;AAAA;AAAA;AAAA,EAAH,4DAIbI,KAAK,CAAE,EAAF,CAJQ,uCAOnBG,WAPmB,QAUpBJ,GAAG,CAAE;AAAEsB,EAAAA,UAAU,EAAG,GAAGrB,KAAK,CAAE,CAAF,CAAO;AAA9B,CAAF,CAViB,qoTAAjB;AAaP,OAAO,MAAMsD,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA,uEAO1BnD,WAP0B,QAU3BJ,GAAG,CAAE;AAAEsB,EAAAA,UAAU,EAAE;AAAd,CAAF,CAVwB,qoTAAxB","sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\nimport styled from '@emotion/styled';\n\n/**\n * Internal dependencies\n */\nimport NumberControl from '../../number-control';\nimport { COLORS, reduceMotion, rtl } from '../../utils';\nimport { space } from '../../ui/utils/space';\n\nimport type {\n\tRangeMarkProps,\n\tRailProps,\n\tThumbProps,\n\tTooltipProps,\n\tTrackProps,\n\tWrapperProps,\n} from '../types';\n\nconst rangeHeightValue = 30;\nconst railHeight = 4;\nconst rangeHeight = () =>\n\tcss( { height: rangeHeightValue, minHeight: rangeHeightValue } );\nconst thumbSize = 12;\n\nexport const Root = styled.div`\n\t-webkit-tap-highlight-color: transparent;\n\talign-items: flex-start;\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\tpadding: 0;\n\tposition: relative;\n\ttouch-action: none;\n\twidth: 100%;\n`;\n\nconst wrapperColor = ( { color = COLORS.ui.borderFocus }: WrapperProps ) =>\n\tcss( { color } );\n\nconst wrapperMargin = ( { marks, __nextHasNoMarginBottom }: WrapperProps ) => {\n\tif ( ! __nextHasNoMarginBottom ) {\n\t\treturn css( { marginBottom: marks ? 16 : undefined } );\n\t}\n\treturn '';\n};\n\nexport const Wrapper = styled.div< WrapperProps >`\n\tdisplay: block;\n\tflex: 1;\n\tposition: relative;\n\twidth: 100%;\n\n\t${ wrapperColor };\n\t${ rangeHeight };\n\t${ wrapperMargin };\n`;\n\nexport const BeforeIconWrapper = styled.span`\n\tdisplay: flex; // ensures the height isn't affected by line-height\n\tmargin-top: ${ railHeight }px;\n\n\t${ rtl( { marginRight: 6 } ) }\n`;\n\nexport const AfterIconWrapper = styled.span`\n\tdisplay: flex; // ensures the height isn't affected by line-height\n\tmargin-top: ${ railHeight }px;\n\n\t${ rtl( { marginLeft: 6 } ) }\n`;\n\nconst railBackgroundColor = ( { disabled, railColor }: RailProps ) => {\n\tlet background = railColor || '';\n\n\tif ( disabled ) {\n\t\tbackground = COLORS.lightGray[ 400 ];\n\t}\n\n\treturn css( { background } );\n};\n\nexport const Rail = styled.span`\n\tbackground-color: ${ COLORS.lightGray[ 600 ] };\n\tleft: 0;\n\tpointer-events: none;\n\tright: 0;\n\tdisplay: block;\n\theight: ${ railHeight }px;\n\tposition: absolute;\n\tmargin-top: ${ ( rangeHeightValue - railHeight ) / 2 }px;\n\ttop: 0;\n\tborder-radius: ${ railHeight }px;\n\n\t${ railBackgroundColor };\n`;\n\nconst trackBackgroundColor = ( { disabled, trackColor }: TrackProps ) => {\n\tlet background = trackColor || 'currentColor';\n\n\tif ( disabled ) {\n\t\tbackground = COLORS.lightGray[ 800 ];\n\t}\n\n\treturn css( { background } );\n};\n\nexport const Track = styled.span`\n\tbackground-color: currentColor;\n\tborder-radius: ${ railHeight }px;\n\theight: ${ railHeight }px;\n\tpointer-events: none;\n\tdisplay: block;\n\tposition: absolute;\n\tmargin-top: ${ ( rangeHeightValue - railHeight ) / 2 }px;\n\ttop: 0;\n\n\t${ trackBackgroundColor };\n`;\n\nexport const MarksWrapper = styled.span`\n\tdisplay: block;\n\tpointer-events: none;\n\tposition: relative;\n\twidth: 100%;\n\tuser-select: none;\n`;\n\nconst markFill = ( { disabled, isFilled }: RangeMarkProps ) => {\n\tlet backgroundColor = isFilled ? 'currentColor' : COLORS.lightGray[ 600 ];\n\n\tif ( disabled ) {\n\t\tbackgroundColor = COLORS.lightGray[ 800 ];\n\t}\n\n\treturn css( {\n\t\tbackgroundColor,\n\t} );\n};\n\nexport const Mark = styled.span`\n\theight: ${ thumbSize }px;\n\tleft: 0;\n\tposition: absolute;\n\ttop: -4px;\n\twidth: 1px;\n\n\t${ markFill };\n`;\n\nconst markLabelFill = ( { isFilled }: RangeMarkProps ) => {\n\treturn css( {\n\t\tcolor: isFilled ? COLORS.darkGray[ 300 ] : COLORS.lightGray[ 600 ],\n\t} );\n};\n\nexport const MarkLabel = styled.span`\n\tcolor: ${ COLORS.lightGray[ 600 ] };\n\tleft: 0;\n\tfont-size: 11px;\n\tposition: absolute;\n\ttop: 12px;\n\ttransform: translateX( -50% );\n\twhite-space: nowrap;\n\n\t${ markLabelFill };\n`;\n\nconst thumbColor = ( { disabled }: ThumbProps ) =>\n\tdisabled\n\t\t? css`\n\t\t\t\tbackground-color: ${ COLORS.lightGray[ 800 ] };\n\t\t `\n\t\t: css`\n\t\t\t\tbackground-color: var( --wp-admin-theme-color );\n\t\t `;\n\nexport const ThumbWrapper = styled.span`\n\talign-items: center;\n\tdisplay: flex;\n\theight: ${ thumbSize }px;\n\tjustify-content: center;\n\tmargin-top: ${ ( rangeHeightValue - thumbSize ) / 2 }px;\n\toutline: 0;\n\tpointer-events: none;\n\tposition: absolute;\n\ttop: 0;\n\tuser-select: none;\n\twidth: ${ thumbSize }px;\n\tborder-radius: 50%;\n\n\t${ thumbColor };\n\t${ rtl( { marginLeft: -10 } ) };\n\t${ rtl(\n\t\t{ transform: 'translateX( 4.5px )' },\n\t\t{ transform: 'translateX( -4.5px )' }\n\t) };\n`;\n\nconst thumbFocus = ( { isFocused }: ThumbProps ) => {\n\treturn isFocused\n\t\t? css`\n\t\t\t\t&::before {\n\t\t\t\t\tcontent: ' ';\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\tbackground-color: var( --wp-admin-theme-color );\n\t\t\t\t\topacity: 0.4;\n\t\t\t\t\tborder-radius: 50%;\n\t\t\t\t\theight: ${ thumbSize + 8 }px;\n\t\t\t\t\twidth: ${ thumbSize + 8 }px;\n\t\t\t\t\ttop: -4px;\n\t\t\t\t\tleft: -4px;\n\t\t\t\t}\n\t\t `\n\t\t: '';\n};\n\nexport const Thumb = styled.span< ThumbProps >`\n\talign-items: center;\n\tborder-radius: 50%;\n\theight: 100%;\n\toutline: 0;\n\tposition: absolute;\n\tuser-select: none;\n\twidth: 100%;\n\n\t${ thumbColor };\n\t${ thumbFocus };\n`;\n\nexport const InputRange = styled.input`\n\tbox-sizing: border-box;\n\tcursor: pointer;\n\tdisplay: block;\n\theight: 100%;\n\tleft: 0;\n\tmargin: 0 -${ thumbSize / 2 }px;\n\topacity: 0;\n\toutline: none;\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n\twidth: calc( 100% + ${ thumbSize }px );\n`;\n\nconst tooltipShow = ( { show }: TooltipProps ) => {\n\treturn css( {\n\t\topacity: show ? 1 : 0,\n\t} );\n};\n\nconst tooltipPosition = ( { position }: TooltipProps ) => {\n\tconst isBottom = position === 'bottom';\n\n\tif ( isBottom ) {\n\t\treturn css`\n\t\t\tbottom: -80%;\n\t\t`;\n\t}\n\n\treturn css`\n\t\ttop: -80%;\n\t`;\n};\n\nexport const Tooltip = styled.span< TooltipProps >`\n\tbackground: rgba( 0, 0, 0, 0.8 );\n\tborder-radius: 2px;\n\tcolor: white;\n\tdisplay: inline-block;\n\tfont-size: 12px;\n\tmin-width: 32px;\n\topacity: 0;\n\tpadding: 4px 8px;\n\tpointer-events: none;\n\tposition: absolute;\n\ttext-align: center;\n\ttransition: opacity 120ms ease;\n\tuser-select: none;\n\tline-height: 1.4;\n\n\t${ tooltipShow };\n\t${ tooltipPosition };\n\t${ reduceMotion( 'transition' ) };\n\t${ rtl(\n\t\t{ transform: 'translateX(-50%)' },\n\t\t{ transform: 'translateX(50%)' }\n\t) }\n`;\n\n// @todo: Refactor RangeControl with latest HStack configuration\n// @wordpress/components/ui/hstack.\nexport const InputNumber = styled( NumberControl )`\n\tdisplay: inline-block;\n\tfont-size: 13px;\n\tmargin-top: 0;\n\twidth: ${ space( 16 ) } !important;\n\n\tinput[type='number']& {\n\t\t${ rangeHeight };\n\t}\n\n\t${ rtl( { marginLeft: `${ space( 4 ) } !important` } ) }\n`;\n\nexport const ActionRightWrapper = styled.span`\n\tdisplay: block;\n\tmargin-top: 0;\n\n\tbutton,\n\tbutton.is-small {\n\t\tmargin-left: 0;\n\t\t${ rangeHeight };\n\t}\n\n\t${ rtl( { marginLeft: 8 } ) }\n`;\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/range-control/styles/range-control-styles.ts"],"names":["css","NumberControl","COLORS","reduceMotion","rtl","space","rangeHeightValue","railHeight","rangeHeight","height","minHeight","thumbSize","Root","wrapperColor","color","ui","borderFocus","wrapperMargin","marks","__nextHasNoMarginBottom","marginBottom","undefined","Wrapper","BeforeIconWrapper","marginRight","AfterIconWrapper","marginLeft","railBackgroundColor","disabled","railColor","background","backgroundDisabled","Rail","gray","trackBackgroundColor","trackColor","Track","MarksWrapper","markFill","isFilled","backgroundColor","Mark","markLabelFill","MarkLabel","thumbColor","ThumbWrapper","transform","thumbFocus","isFocused","Thumb","InputRange","tooltipShow","show","opacity","tooltipPosition","position","isBottom","Tooltip","InputNumber","ActionRightWrapper"],"mappings":";;;;AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,gBAApB;;AAGA;AACA;AACA;AACA,OAAOC,aAAP,MAA0B,sBAA1B;AACA,SAASC,MAAT,EAAiBC,YAAjB,EAA+BC,GAA/B,QAA0C,aAA1C;AACA,SAASC,KAAT,QAAsB,sBAAtB;AAWA,MAAMC,gBAAgB,GAAG,EAAzB;AACA,MAAMC,UAAU,GAAG,CAAnB;;AACA,MAAMC,WAAW,GAAG,mBACnBR,GAAG,CAAE;AAAES,EAAAA,MAAM,EAAEH,gBAAV;AAA4BI,EAAAA,SAAS,EAAEJ;AAAvC,CAAF,ipTADJ;;AAEA,MAAMK,SAAS,GAAG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styled from '@emotion/styled';\n\n/**\n * Internal dependencies\n */\nimport NumberControl from '../../number-control';\nimport { COLORS, reduceMotion, rtl } from '../../utils';\nimport { space } from '../../ui/utils/space';\n\nimport type {\n\tRangeMarkProps,\n\tRailProps,\n\tThumbProps,\n\tTooltipProps,\n\tTrackProps,\n\tWrapperProps,\n} from '../types';\n\nconst rangeHeightValue = 30;\nconst railHeight = 4;\nconst rangeHeight = () =>\n\tcss( { height: rangeHeightValue, minHeight: rangeHeightValue } );\nconst thumbSize = 12;\n\nexport const Root = styled.div`\n\t-webkit-tap-highlight-color: transparent;\n\talign-items: flex-start;\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\tpadding: 0;\n\tposition: relative;\n\ttouch-action: none;\n\twidth: 100%;\n`;\n\nconst wrapperColor = ( { color = COLORS.ui.borderFocus }: WrapperProps ) =>\n\tcss( { color } );\n\nconst wrapperMargin = ( { marks, __nextHasNoMarginBottom }: WrapperProps ) => {\n\tif ( ! __nextHasNoMarginBottom ) {\n\t\treturn css( { marginBottom: marks ? 16 : undefined } );\n\t}\n\treturn '';\n};\n\nexport const Wrapper = styled.div< WrapperProps >`\n\tdisplay: block;\n\tflex: 1;\n\tposition: relative;\n\twidth: 100%;\n\n\t${ wrapperColor };\n\t${ rangeHeight };\n\t${ wrapperMargin };\n`;\n\nexport const BeforeIconWrapper = styled.span`\n\tdisplay: flex; // ensures the height isn't affected by line-height\n\tmargin-top: ${ railHeight }px;\n\n\t${ rtl( { marginRight: 6 } ) }\n`;\n\nexport const AfterIconWrapper = styled.span`\n\tdisplay: flex; // ensures the height isn't affected by line-height\n\tmargin-top: ${ railHeight }px;\n\n\t${ rtl( { marginLeft: 6 } ) }\n`;\n\nconst railBackgroundColor = ( { disabled, railColor }: RailProps ) => {\n\tlet background = railColor || '';\n\n\tif ( disabled ) {\n\t\tbackground = COLORS.ui.backgroundDisabled;\n\t}\n\n\treturn css( { background } );\n};\n\nexport const Rail = styled.span`\n\tbackground-color: ${ COLORS.gray[ 300 ] };\n\tleft: 0;\n\tpointer-events: none;\n\tright: 0;\n\tdisplay: block;\n\theight: ${ railHeight }px;\n\tposition: absolute;\n\tmargin-top: ${ ( rangeHeightValue - railHeight ) / 2 }px;\n\ttop: 0;\n\tborder-radius: ${ railHeight }px;\n\n\t${ railBackgroundColor };\n`;\n\nconst trackBackgroundColor = ( { disabled, trackColor }: TrackProps ) => {\n\tlet background = trackColor || 'currentColor';\n\n\tif ( disabled ) {\n\t\tbackground = COLORS.gray[ 400 ];\n\t}\n\n\treturn css( { background } );\n};\n\nexport const Track = styled.span`\n\tbackground-color: currentColor;\n\tborder-radius: ${ railHeight }px;\n\theight: ${ railHeight }px;\n\tpointer-events: none;\n\tdisplay: block;\n\tposition: absolute;\n\tmargin-top: ${ ( rangeHeightValue - railHeight ) / 2 }px;\n\ttop: 0;\n\n\t${ trackBackgroundColor };\n`;\n\nexport const MarksWrapper = styled.span`\n\tdisplay: block;\n\tpointer-events: none;\n\tposition: relative;\n\twidth: 100%;\n\tuser-select: none;\n`;\n\nconst markFill = ( { disabled, isFilled }: RangeMarkProps ) => {\n\tlet backgroundColor = isFilled ? 'currentColor' : COLORS.gray[ 300 ];\n\n\tif ( disabled ) {\n\t\tbackgroundColor = COLORS.gray[ 400 ];\n\t}\n\n\treturn css( {\n\t\tbackgroundColor,\n\t} );\n};\n\nexport const Mark = styled.span`\n\theight: ${ thumbSize }px;\n\tleft: 0;\n\tposition: absolute;\n\ttop: -4px;\n\twidth: 1px;\n\n\t${ markFill };\n`;\n\nconst markLabelFill = ( { isFilled }: RangeMarkProps ) => {\n\treturn css( {\n\t\tcolor: isFilled ? COLORS.gray[ 700 ] : COLORS.gray[ 300 ],\n\t} );\n};\n\nexport const MarkLabel = styled.span`\n\tcolor: ${ COLORS.gray[ 300 ] };\n\tleft: 0;\n\tfont-size: 11px;\n\tposition: absolute;\n\ttop: 12px;\n\ttransform: translateX( -50% );\n\twhite-space: nowrap;\n\n\t${ markLabelFill };\n`;\n\nconst thumbColor = ( { disabled }: ThumbProps ) =>\n\tdisabled\n\t\t? css`\n\t\t\t\tbackground-color: ${ COLORS.gray[ 400 ] };\n\t\t `\n\t\t: css`\n\t\t\t\tbackground-color: var( --wp-admin-theme-color );\n\t\t `;\n\nexport const ThumbWrapper = styled.span`\n\talign-items: center;\n\tdisplay: flex;\n\theight: ${ thumbSize }px;\n\tjustify-content: center;\n\tmargin-top: ${ ( rangeHeightValue - thumbSize ) / 2 }px;\n\toutline: 0;\n\tpointer-events: none;\n\tposition: absolute;\n\ttop: 0;\n\tuser-select: none;\n\twidth: ${ thumbSize }px;\n\tborder-radius: 50%;\n\n\t${ thumbColor };\n\t${ rtl( { marginLeft: -10 } ) };\n\t${ rtl(\n\t\t{ transform: 'translateX( 4.5px )' },\n\t\t{ transform: 'translateX( -4.5px )' }\n\t) };\n`;\n\nconst thumbFocus = ( { isFocused }: ThumbProps ) => {\n\treturn isFocused\n\t\t? css`\n\t\t\t\t&::before {\n\t\t\t\t\tcontent: ' ';\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\tbackground-color: var( --wp-admin-theme-color );\n\t\t\t\t\topacity: 0.4;\n\t\t\t\t\tborder-radius: 50%;\n\t\t\t\t\theight: ${ thumbSize + 8 }px;\n\t\t\t\t\twidth: ${ thumbSize + 8 }px;\n\t\t\t\t\ttop: -4px;\n\t\t\t\t\tleft: -4px;\n\t\t\t\t}\n\t\t `\n\t\t: '';\n};\n\nexport const Thumb = styled.span< ThumbProps >`\n\talign-items: center;\n\tborder-radius: 50%;\n\theight: 100%;\n\toutline: 0;\n\tposition: absolute;\n\tuser-select: none;\n\twidth: 100%;\n\n\t${ thumbColor };\n\t${ thumbFocus };\n`;\n\nexport const InputRange = styled.input`\n\tbox-sizing: border-box;\n\tcursor: pointer;\n\tdisplay: block;\n\theight: 100%;\n\tleft: 0;\n\tmargin: 0 -${ thumbSize / 2 }px;\n\topacity: 0;\n\toutline: none;\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n\twidth: calc( 100% + ${ thumbSize }px );\n`;\n\nconst tooltipShow = ( { show }: TooltipProps ) => {\n\treturn css( {\n\t\topacity: show ? 1 : 0,\n\t} );\n};\n\nconst tooltipPosition = ( { position }: TooltipProps ) => {\n\tconst isBottom = position === 'bottom';\n\n\tif ( isBottom ) {\n\t\treturn css`\n\t\t\tbottom: -80%;\n\t\t`;\n\t}\n\n\treturn css`\n\t\ttop: -80%;\n\t`;\n};\n\nexport const Tooltip = styled.span< TooltipProps >`\n\tbackground: rgba( 0, 0, 0, 0.8 );\n\tborder-radius: 2px;\n\tcolor: white;\n\tdisplay: inline-block;\n\tfont-size: 12px;\n\tmin-width: 32px;\n\topacity: 0;\n\tpadding: 4px 8px;\n\tpointer-events: none;\n\tposition: absolute;\n\ttext-align: center;\n\ttransition: opacity 120ms ease;\n\tuser-select: none;\n\tline-height: 1.4;\n\n\t${ tooltipShow };\n\t${ tooltipPosition };\n\t${ reduceMotion( 'transition' ) };\n\t${ rtl(\n\t\t{ transform: 'translateX(-50%)' },\n\t\t{ transform: 'translateX(50%)' }\n\t) }\n`;\n\n// @todo: Refactor RangeControl with latest HStack configuration\n// @wordpress/components/ui/hstack.\nexport const InputNumber = styled( NumberControl )`\n\tdisplay: inline-block;\n\tfont-size: 13px;\n\tmargin-top: 0;\n\twidth: ${ space( 16 ) } !important;\n\n\tinput[type='number']& {\n\t\t${ rangeHeight };\n\t}\n\n\t${ rtl( { marginLeft: `${ space( 4 ) } !important` } ) }\n`;\n\nexport const ActionRightWrapper = styled.span`\n\tdisplay: block;\n\tmargin-top: 0;\n\n\tbutton,\n\tbutton.is-small {\n\t\tmargin-left: 0;\n\t\t${ rangeHeight };\n\t}\n\n\t${ rtl( { marginLeft: 8 } ) }\n`;\n"]}
|
|
@@ -69,14 +69,14 @@ const style = `
|
|
|
69
69
|
}
|
|
70
70
|
html,
|
|
71
71
|
body,
|
|
72
|
-
body > div
|
|
73
|
-
body > div iframe {
|
|
72
|
+
body > div {
|
|
74
73
|
width: 100%;
|
|
75
74
|
}
|
|
76
75
|
html.wp-has-aspect-ratio,
|
|
77
76
|
body.wp-has-aspect-ratio,
|
|
78
77
|
body.wp-has-aspect-ratio > div,
|
|
79
78
|
body.wp-has-aspect-ratio > div iframe {
|
|
79
|
+
width: 100%;
|
|
80
80
|
height: 100%;
|
|
81
81
|
overflow: hidden; /* If it has an aspect ratio, it shouldn't scroll. */
|
|
82
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/sandbox/index.js"],"names":["renderToString","useRef","useState","useEffect","useFocusableIframe","useMergeRefs","observeAndResizeJS","style","Sandbox","html","title","type","styles","scripts","onFocus","ref","width","setWidth","height","setHeight","isFrameAccessible","current","contentDocument","body","e","trySandbox","forceRerender","ownerDocument","getAttribute","htmlDoc","documentElement","lang","__html","map","rules","i","src","open","write","close","tryNoForceSandbox","checkMessageForResize","event","iframe","contentWindow","source","data","JSON","parse","action","defaultView","addEventListener","removeEventListener","Math","ceil"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,cADD,EAECC,MAFD,EAGCC,QAHD,EAICC,SAJD,QAKO,oBALP;AAMA,SAASC,kBAAT,EAA6BC,YAA7B,QAAiD,oBAAjD;AAEA,MAAMC,kBAAkB,GAAI;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAzDA;AA2DA,MAAMC,KAAK,GAAI;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CArBA;AAuBA,eAAe,SAASC,OAAT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C,IAAI,CAACC,IAAL,CAAWtC,KAAX,CANT;AAOC,IAAA,MAAM,EAAGqC,IAAI,CAACC,IAAL,CAAWpC,MAAX;AAPV,IADD;AAWA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\trenderToString,\n\tuseRef,\n\tuseState,\n\tuseEffect,\n} from '@wordpress/element';\nimport { useFocusableIframe, useMergeRefs } from '@wordpress/compose';\n\nconst observeAndResizeJS = `\n\t( function() {\n\t\tvar observer;\n\n\t\tif ( ! window.MutationObserver || ! document.body || ! window.parent ) {\n\t\t\treturn;\n\t\t}\n\n\t\tfunction sendResize() {\n\t\t\tvar clientBoundingRect = document.body.getBoundingClientRect();\n\n\t\t\twindow.parent.postMessage( {\n\t\t\t\taction: 'resize',\n\t\t\t\twidth: clientBoundingRect.width,\n\t\t\t\theight: clientBoundingRect.height,\n\t\t\t}, '*' );\n\t\t}\n\n\t\tobserver = new MutationObserver( sendResize );\n\t\tobserver.observe( document.body, {\n\t\t\tattributes: true,\n\t\t\tattributeOldValue: false,\n\t\t\tcharacterData: true,\n\t\t\tcharacterDataOldValue: false,\n\t\t\tchildList: true,\n\t\t\tsubtree: true\n\t\t} );\n\n\t\twindow.addEventListener( 'load', sendResize, true );\n\n\t\t// Hack: Remove viewport unit styles, as these are relative\n\t\t// the iframe root and interfere with our mechanism for\n\t\t// determining the unconstrained page bounds.\n\t\tfunction removeViewportStyles( ruleOrNode ) {\n\t\t\tif( ruleOrNode.style ) {\n\t\t\t\t[ 'width', 'height', 'minHeight', 'maxHeight' ].forEach( function( style ) {\n\t\t\t\t\tif ( /^\\\\d+(vmin|vmax|vh|vw)$/.test( ruleOrNode.style[ style ] ) ) {\n\t\t\t\t\t\truleOrNode.style[ style ] = '';\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\tArray.prototype.forEach.call( document.querySelectorAll( '[style]' ), removeViewportStyles );\n\t\tArray.prototype.forEach.call( document.styleSheets, function( stylesheet ) {\n\t\t\tArray.prototype.forEach.call( stylesheet.cssRules || stylesheet.rules, removeViewportStyles );\n\t\t} );\n\n\t\tdocument.body.style.position = 'absolute';\n\t\tdocument.body.style.width = '100%';\n\t\tdocument.body.setAttribute( 'data-resizable-iframe-connected', '' );\n\n\t\tsendResize();\n\n\t\t// Resize events can change the width of elements with 100% width, but we don't\n\t\t// get an DOM mutations for that, so do the resize when the window is resized, too.\n\t\twindow.addEventListener( 'resize', sendResize, true );\n} )();`;\n\nconst style = `\n\tbody {\n\t\tmargin: 0;\n\t}\n\thtml,\n\tbody,\n\tbody > div,\n\tbody > div iframe {\n\t\twidth: 100%;\n\t}\n\thtml.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio > div,\n\tbody.wp-has-aspect-ratio > div iframe {\n\t\theight: 100%;\n\t\toverflow: hidden; /* If it has an aspect ratio, it shouldn't scroll. */\n\t}\n\tbody > div > * {\n\t\tmargin-top: 0 !important; /* Has to have !important to override inline styles. */\n\t\tmargin-bottom: 0 !important;\n\t}\n`;\n\nexport default function Sandbox( {\n\thtml = '',\n\ttitle = '',\n\ttype,\n\tstyles = [],\n\tscripts = [],\n\tonFocus,\n} ) {\n\tconst ref = useRef();\n\tconst [ width, setWidth ] = useState( 0 );\n\tconst [ height, setHeight ] = useState( 0 );\n\n\tfunction isFrameAccessible() {\n\t\ttry {\n\t\t\treturn !! ref.current.contentDocument.body;\n\t\t} catch ( e ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tfunction trySandbox( forceRerender = false ) {\n\t\tif ( ! isFrameAccessible() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { contentDocument, ownerDocument } = ref.current;\n\t\tconst { body } = contentDocument;\n\n\t\tif (\n\t\t\t! forceRerender &&\n\t\t\tnull !== body.getAttribute( 'data-resizable-iframe-connected' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Put the html snippet into a html document, and then write it to the iframe's document\n\t\t// we can use this in the future to inject custom styles or scripts.\n\t\t// Scripts go into the body rather than the head, to support embedded content such as Instagram\n\t\t// that expect the scripts to be part of the body.\n\t\tconst htmlDoc = (\n\t\t\t<html\n\t\t\t\tlang={ ownerDocument.documentElement.lang }\n\t\t\t\tclassName={ type }\n\t\t\t>\n\t\t\t\t<head>\n\t\t\t\t\t<title>{ title }</title>\n\t\t\t\t\t<style dangerouslySetInnerHTML={ { __html: style } } />\n\t\t\t\t\t{ styles.map( ( rules, i ) => (\n\t\t\t\t\t\t<style\n\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\tdangerouslySetInnerHTML={ { __html: rules } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t\t</head>\n\t\t\t\t<body\n\t\t\t\t\tdata-resizable-iframe-connected=\"data-resizable-iframe-connected\"\n\t\t\t\t\tclassName={ type }\n\t\t\t\t>\n\t\t\t\t\t<div dangerouslySetInnerHTML={ { __html: html } } />\n\t\t\t\t\t<script\n\t\t\t\t\t\ttype=\"text/javascript\"\n\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t__html: observeAndResizeJS,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t{ scripts.map( ( src ) => (\n\t\t\t\t\t\t<script key={ src } src={ src } />\n\t\t\t\t\t) ) }\n\t\t\t\t</body>\n\t\t\t</html>\n\t\t);\n\n\t\t// Writing the document like this makes it act in the same way as if it was\n\t\t// loaded over the network, so DOM creation and mutation, script execution, etc.\n\t\t// all work as expected.\n\t\tcontentDocument.open();\n\t\tcontentDocument.write( '<!DOCTYPE html>' + renderToString( htmlDoc ) );\n\t\tcontentDocument.close();\n\t}\n\n\tuseEffect( () => {\n\t\ttrySandbox();\n\n\t\tfunction tryNoForceSandbox() {\n\t\t\ttrySandbox( false );\n\t\t}\n\n\t\tfunction checkMessageForResize( event ) {\n\t\t\tconst iframe = ref.current;\n\n\t\t\t// Verify that the mounted element is the source of the message.\n\t\t\tif ( ! iframe || iframe.contentWindow !== event.source ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Attempt to parse the message data as JSON if passed as string.\n\t\t\tlet data = event.data || {};\n\n\t\t\tif ( 'string' === typeof data ) {\n\t\t\t\ttry {\n\t\t\t\t\tdata = JSON.parse( data );\n\t\t\t\t} catch ( e ) {}\n\t\t\t}\n\n\t\t\t// Update the state only if the message is formatted as we expect,\n\t\t\t// i.e. as an object with a 'resize' action.\n\t\t\tif ( 'resize' !== data.action ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetWidth( data.width );\n\t\t\tsetHeight( data.height );\n\t\t}\n\n\t\tconst { ownerDocument } = ref.current;\n\t\tconst { defaultView } = ownerDocument;\n\n\t\t// This used to be registered using <iframe onLoad={} />, but it made the iframe blank\n\t\t// after reordering the containing block. See these two issues for more details:\n\t\t// https://github.com/WordPress/gutenberg/issues/6146\n\t\t// https://github.com/facebook/react/issues/18752\n\t\tref.current.addEventListener( 'load', tryNoForceSandbox, false );\n\t\tdefaultView.addEventListener( 'message', checkMessageForResize );\n\n\t\treturn () => {\n\t\t\tref.current?.removeEventListener(\n\t\t\t\t'load',\n\t\t\t\ttryNoForceSandbox,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tdefaultView.addEventListener( 'message', checkMessageForResize );\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\ttrySandbox();\n\t}, [ title, styles, scripts ] );\n\n\tuseEffect( () => {\n\t\ttrySandbox( true );\n\t}, [ html, type ] );\n\n\treturn (\n\t\t<iframe\n\t\t\tref={ useMergeRefs( [ ref, useFocusableIframe() ] ) }\n\t\t\ttitle={ title }\n\t\t\tclassName=\"components-sandbox\"\n\t\t\tsandbox=\"allow-scripts allow-same-origin allow-presentation\"\n\t\t\tonFocus={ onFocus }\n\t\t\twidth={ Math.ceil( width ) }\n\t\t\theight={ Math.ceil( height ) }\n\t\t/>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/sandbox/index.js"],"names":["renderToString","useRef","useState","useEffect","useFocusableIframe","useMergeRefs","observeAndResizeJS","style","Sandbox","html","title","type","styles","scripts","onFocus","ref","width","setWidth","height","setHeight","isFrameAccessible","current","contentDocument","body","e","trySandbox","forceRerender","ownerDocument","getAttribute","htmlDoc","documentElement","lang","__html","map","rules","i","src","open","write","close","tryNoForceSandbox","checkMessageForResize","event","iframe","contentWindow","source","data","JSON","parse","action","defaultView","addEventListener","removeEventListener","Math","ceil"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,cADD,EAECC,MAFD,EAGCC,QAHD,EAICC,SAJD,QAKO,oBALP;AAMA,SAASC,kBAAT,EAA6BC,YAA7B,QAAiD,oBAAjD;AAEA,MAAMC,kBAAkB,GAAI;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAzDA;AA2DA,MAAMC,KAAK,GAAI;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CArBA;AAuBA,eAAe,SAASC,OAAT,OAOX;AAAA,MAP6B;AAChCC,IAAAA,IAAI,GAAG,EADyB;AAEhCC,IAAAA,KAAK,GAAG,EAFwB;AAGhCC,IAAAA,IAHgC;AAIhCC,IAAAA,MAAM,GAAG,EAJuB;AAKhCC,IAAAA,OAAO,GAAG,EALsB;AAMhCC,IAAAA;AANgC,GAO7B;AACH,QAAMC,GAAG,GAAGd,MAAM,EAAlB;AACA,QAAM,CAAEe,KAAF,EAASC,QAAT,IAAsBf,QAAQ,CAAE,CAAF,CAApC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,CAnCgB,CAqChB;AACA;AACA;AACA;;AACAZ,IAAAA,GAAG,CAACM,OAAJ,CAAY8B,gBAAZ,CAA8B,MAA9B,EAAsCX,iBAAtC,EAAyD,KAAzD;AACAU,IAAAA,WAAW,CAACC,gBAAZ,CAA8B,SAA9B,EAAyCV,qBAAzC;AAEA,WAAO,MAAM;AAAA;;AACZ,sBAAA1B,GAAG,CAACM,OAAJ,8DAAa+B,mBAAb,CACC,MADD,EAECZ,iBAFD,EAGC,KAHD;AAKAU,MAAAA,WAAW,CAACC,gBAAZ,CAA8B,SAA9B,EAAyCV,qBAAzC;AACA,KAPD;AAQA,GApDQ,EAoDN,EApDM,CAAT;AAsDAtC,EAAAA,SAAS,CAAE,MAAM;AAChBsB,IAAAA,UAAU;AACV,GAFQ,EAEN,CAAEf,KAAF,EAASE,MAAT,EAAiBC,OAAjB,CAFM,CAAT;AAIAV,EAAAA,SAAS,CAAE,MAAM;AAChBsB,IAAAA,UAAU,CAAE,IAAF,CAAV;AACA,GAFQ,EAEN,CAAEhB,IAAF,EAAQE,IAAR,CAFM,CAAT;AAIA,SACC;AACC,IAAA,GAAG,EAAGN,YAAY,CAAE,CAAEU,GAAF,EAAOX,kBAAkB,EAAzB,CAAF,CADnB;AAEC,IAAA,KAAK,EAAGM,KAFT;AAGC,IAAA,SAAS,EAAC,oBAHX;AAIC,IAAA,OAAO,EAAC,oDAJT;AAKC,IAAA,OAAO,EAAGI,OALX;AAMC,IAAA,KAAK,EAAGuC,IAAI,CAACC,IAAL,CAAWtC,KAAX,CANT;AAOC,IAAA,MAAM,EAAGqC,IAAI,CAACC,IAAL,CAAWpC,MAAX;AAPV,IADD;AAWA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\trenderToString,\n\tuseRef,\n\tuseState,\n\tuseEffect,\n} from '@wordpress/element';\nimport { useFocusableIframe, useMergeRefs } from '@wordpress/compose';\n\nconst observeAndResizeJS = `\n\t( function() {\n\t\tvar observer;\n\n\t\tif ( ! window.MutationObserver || ! document.body || ! window.parent ) {\n\t\t\treturn;\n\t\t}\n\n\t\tfunction sendResize() {\n\t\t\tvar clientBoundingRect = document.body.getBoundingClientRect();\n\n\t\t\twindow.parent.postMessage( {\n\t\t\t\taction: 'resize',\n\t\t\t\twidth: clientBoundingRect.width,\n\t\t\t\theight: clientBoundingRect.height,\n\t\t\t}, '*' );\n\t\t}\n\n\t\tobserver = new MutationObserver( sendResize );\n\t\tobserver.observe( document.body, {\n\t\t\tattributes: true,\n\t\t\tattributeOldValue: false,\n\t\t\tcharacterData: true,\n\t\t\tcharacterDataOldValue: false,\n\t\t\tchildList: true,\n\t\t\tsubtree: true\n\t\t} );\n\n\t\twindow.addEventListener( 'load', sendResize, true );\n\n\t\t// Hack: Remove viewport unit styles, as these are relative\n\t\t// the iframe root and interfere with our mechanism for\n\t\t// determining the unconstrained page bounds.\n\t\tfunction removeViewportStyles( ruleOrNode ) {\n\t\t\tif( ruleOrNode.style ) {\n\t\t\t\t[ 'width', 'height', 'minHeight', 'maxHeight' ].forEach( function( style ) {\n\t\t\t\t\tif ( /^\\\\d+(vmin|vmax|vh|vw)$/.test( ruleOrNode.style[ style ] ) ) {\n\t\t\t\t\t\truleOrNode.style[ style ] = '';\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\tArray.prototype.forEach.call( document.querySelectorAll( '[style]' ), removeViewportStyles );\n\t\tArray.prototype.forEach.call( document.styleSheets, function( stylesheet ) {\n\t\t\tArray.prototype.forEach.call( stylesheet.cssRules || stylesheet.rules, removeViewportStyles );\n\t\t} );\n\n\t\tdocument.body.style.position = 'absolute';\n\t\tdocument.body.style.width = '100%';\n\t\tdocument.body.setAttribute( 'data-resizable-iframe-connected', '' );\n\n\t\tsendResize();\n\n\t\t// Resize events can change the width of elements with 100% width, but we don't\n\t\t// get an DOM mutations for that, so do the resize when the window is resized, too.\n\t\twindow.addEventListener( 'resize', sendResize, true );\n} )();`;\n\nconst style = `\n\tbody {\n\t\tmargin: 0;\n\t}\n\thtml,\n\tbody,\n\tbody > div {\n\t\twidth: 100%;\n\t}\n\thtml.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio > div,\n\tbody.wp-has-aspect-ratio > div iframe {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\toverflow: hidden; /* If it has an aspect ratio, it shouldn't scroll. */\n\t}\n\tbody > div > * {\n\t\tmargin-top: 0 !important; /* Has to have !important to override inline styles. */\n\t\tmargin-bottom: 0 !important;\n\t}\n`;\n\nexport default function Sandbox( {\n\thtml = '',\n\ttitle = '',\n\ttype,\n\tstyles = [],\n\tscripts = [],\n\tonFocus,\n} ) {\n\tconst ref = useRef();\n\tconst [ width, setWidth ] = useState( 0 );\n\tconst [ height, setHeight ] = useState( 0 );\n\n\tfunction isFrameAccessible() {\n\t\ttry {\n\t\t\treturn !! ref.current.contentDocument.body;\n\t\t} catch ( e ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tfunction trySandbox( forceRerender = false ) {\n\t\tif ( ! isFrameAccessible() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { contentDocument, ownerDocument } = ref.current;\n\t\tconst { body } = contentDocument;\n\n\t\tif (\n\t\t\t! forceRerender &&\n\t\t\tnull !== body.getAttribute( 'data-resizable-iframe-connected' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Put the html snippet into a html document, and then write it to the iframe's document\n\t\t// we can use this in the future to inject custom styles or scripts.\n\t\t// Scripts go into the body rather than the head, to support embedded content such as Instagram\n\t\t// that expect the scripts to be part of the body.\n\t\tconst htmlDoc = (\n\t\t\t<html\n\t\t\t\tlang={ ownerDocument.documentElement.lang }\n\t\t\t\tclassName={ type }\n\t\t\t>\n\t\t\t\t<head>\n\t\t\t\t\t<title>{ title }</title>\n\t\t\t\t\t<style dangerouslySetInnerHTML={ { __html: style } } />\n\t\t\t\t\t{ styles.map( ( rules, i ) => (\n\t\t\t\t\t\t<style\n\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\tdangerouslySetInnerHTML={ { __html: rules } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t\t</head>\n\t\t\t\t<body\n\t\t\t\t\tdata-resizable-iframe-connected=\"data-resizable-iframe-connected\"\n\t\t\t\t\tclassName={ type }\n\t\t\t\t>\n\t\t\t\t\t<div dangerouslySetInnerHTML={ { __html: html } } />\n\t\t\t\t\t<script\n\t\t\t\t\t\ttype=\"text/javascript\"\n\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t__html: observeAndResizeJS,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t{ scripts.map( ( src ) => (\n\t\t\t\t\t\t<script key={ src } src={ src } />\n\t\t\t\t\t) ) }\n\t\t\t\t</body>\n\t\t\t</html>\n\t\t);\n\n\t\t// Writing the document like this makes it act in the same way as if it was\n\t\t// loaded over the network, so DOM creation and mutation, script execution, etc.\n\t\t// all work as expected.\n\t\tcontentDocument.open();\n\t\tcontentDocument.write( '<!DOCTYPE html>' + renderToString( htmlDoc ) );\n\t\tcontentDocument.close();\n\t}\n\n\tuseEffect( () => {\n\t\ttrySandbox();\n\n\t\tfunction tryNoForceSandbox() {\n\t\t\ttrySandbox( false );\n\t\t}\n\n\t\tfunction checkMessageForResize( event ) {\n\t\t\tconst iframe = ref.current;\n\n\t\t\t// Verify that the mounted element is the source of the message.\n\t\t\tif ( ! iframe || iframe.contentWindow !== event.source ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Attempt to parse the message data as JSON if passed as string.\n\t\t\tlet data = event.data || {};\n\n\t\t\tif ( 'string' === typeof data ) {\n\t\t\t\ttry {\n\t\t\t\t\tdata = JSON.parse( data );\n\t\t\t\t} catch ( e ) {}\n\t\t\t}\n\n\t\t\t// Update the state only if the message is formatted as we expect,\n\t\t\t// i.e. as an object with a 'resize' action.\n\t\t\tif ( 'resize' !== data.action ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetWidth( data.width );\n\t\t\tsetHeight( data.height );\n\t\t}\n\n\t\tconst { ownerDocument } = ref.current;\n\t\tconst { defaultView } = ownerDocument;\n\n\t\t// This used to be registered using <iframe onLoad={} />, but it made the iframe blank\n\t\t// after reordering the containing block. See these two issues for more details:\n\t\t// https://github.com/WordPress/gutenberg/issues/6146\n\t\t// https://github.com/facebook/react/issues/18752\n\t\tref.current.addEventListener( 'load', tryNoForceSandbox, false );\n\t\tdefaultView.addEventListener( 'message', checkMessageForResize );\n\n\t\treturn () => {\n\t\t\tref.current?.removeEventListener(\n\t\t\t\t'load',\n\t\t\t\ttryNoForceSandbox,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tdefaultView.addEventListener( 'message', checkMessageForResize );\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\ttrySandbox();\n\t}, [ title, styles, scripts ] );\n\n\tuseEffect( () => {\n\t\ttrySandbox( true );\n\t}, [ html, type ] );\n\n\treturn (\n\t\t<iframe\n\t\t\tref={ useMergeRefs( [ ref, useFocusableIframe() ] ) }\n\t\t\ttitle={ title }\n\t\t\tclassName=\"components-sandbox\"\n\t\t\tsandbox=\"allow-scripts allow-same-origin allow-presentation\"\n\t\t\tonFocus={ onFocus }\n\t\t\twidth={ Math.ceil( width ) }\n\t\t\theight={ Math.ceil( height ) }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
1
2
|
import { createElement } from "@wordpress/element";
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -16,11 +17,12 @@ import { forwardRef, useRef } from '@wordpress/element';
|
|
|
16
17
|
* Internal dependencies
|
|
17
18
|
*/
|
|
18
19
|
|
|
19
|
-
import
|
|
20
|
+
import Button from '../button';
|
|
20
21
|
import BaseControl from '../base-control';
|
|
21
22
|
|
|
22
|
-
function
|
|
23
|
+
function UnforwardedSearchControl(_ref, forwardedRef) {
|
|
23
24
|
let {
|
|
25
|
+
__nextHasNoMarginBottom,
|
|
24
26
|
className,
|
|
25
27
|
onChange,
|
|
26
28
|
onKeyDown,
|
|
@@ -29,7 +31,8 @@ function SearchControl(_ref, forwardedRef) {
|
|
|
29
31
|
placeholder = __('Search'),
|
|
30
32
|
hideLabelFromVision = true,
|
|
31
33
|
help,
|
|
32
|
-
onClose
|
|
34
|
+
onClose,
|
|
35
|
+
...restProps
|
|
33
36
|
} = _ref;
|
|
34
37
|
const searchRef = useRef();
|
|
35
38
|
const instanceId = useInstanceId(SearchControl);
|
|
@@ -49,8 +52,10 @@ function SearchControl(_ref, forwardedRef) {
|
|
|
49
52
|
icon: closeSmall,
|
|
50
53
|
label: __('Reset search'),
|
|
51
54
|
onClick: () => {
|
|
55
|
+
var _searchRef$current;
|
|
56
|
+
|
|
52
57
|
onChange('');
|
|
53
|
-
searchRef.current.focus();
|
|
58
|
+
(_searchRef$current = searchRef.current) === null || _searchRef$current === void 0 ? void 0 : _searchRef$current.focus();
|
|
54
59
|
}
|
|
55
60
|
});
|
|
56
61
|
}
|
|
@@ -61,6 +66,7 @@ function SearchControl(_ref, forwardedRef) {
|
|
|
61
66
|
};
|
|
62
67
|
|
|
63
68
|
return createElement(BaseControl, {
|
|
69
|
+
__nextHasNoMarginBottom: __nextHasNoMarginBottom,
|
|
64
70
|
label: label,
|
|
65
71
|
id: id,
|
|
66
72
|
hideLabelFromVision: hideLabelFromVision,
|
|
@@ -68,7 +74,7 @@ function SearchControl(_ref, forwardedRef) {
|
|
|
68
74
|
className: classnames(className, 'components-search-control')
|
|
69
75
|
}, createElement("div", {
|
|
70
76
|
className: "components-search-control__input-wrapper"
|
|
71
|
-
}, createElement("input", {
|
|
77
|
+
}, createElement("input", _extends({}, restProps, {
|
|
72
78
|
ref: useMergeRefs([searchRef, forwardedRef]),
|
|
73
79
|
className: "components-search-control__input",
|
|
74
80
|
id: id,
|
|
@@ -78,10 +84,31 @@ function SearchControl(_ref, forwardedRef) {
|
|
|
78
84
|
onKeyDown: onKeyDown,
|
|
79
85
|
autoComplete: "off",
|
|
80
86
|
value: value || ''
|
|
81
|
-
}), createElement("div", {
|
|
87
|
+
})), createElement("div", {
|
|
82
88
|
className: "components-search-control__icon"
|
|
83
89
|
}, renderRightButton())));
|
|
84
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* SearchControl components let users display a search control.
|
|
93
|
+
*
|
|
94
|
+
* ```jsx
|
|
95
|
+
* import { SearchControl } from '@wordpress/components';
|
|
96
|
+
* import { useState } from '@wordpress/element';
|
|
97
|
+
*
|
|
98
|
+
* function MySearchControl( { className, setState } ) {
|
|
99
|
+
* const [ searchInput, setSearchInput ] = useState( '' );
|
|
100
|
+
*
|
|
101
|
+
* return (
|
|
102
|
+
* <SearchControl
|
|
103
|
+
* value={ searchInput }
|
|
104
|
+
* onChange={ setSearchInput }
|
|
105
|
+
* />
|
|
106
|
+
* );
|
|
107
|
+
* }
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
|
|
85
111
|
|
|
86
|
-
export
|
|
112
|
+
export const SearchControl = forwardRef(UnforwardedSearchControl);
|
|
113
|
+
export default SearchControl;
|
|
87
114
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/search-control/index.
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/search-control/index.tsx"],"names":["classnames","useInstanceId","useMergeRefs","__","Icon","search","closeSmall","forwardRef","useRef","Button","BaseControl","UnforwardedSearchControl","forwardedRef","__nextHasNoMarginBottom","className","onChange","onKeyDown","value","label","placeholder","hideLabelFromVision","help","onClose","restProps","searchRef","instanceId","SearchControl","id","renderRightButton","current","focus","event","target"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,aAAT,EAAwBC,YAAxB,QAA4C,oBAA5C;AACA,SAASC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A,GAzBD;;AA2BA,SACC,cAAC,WAAD;AACC,IAAA,uBAAuB,EAAGQ,uBAD3B;AAEC,IAAA,KAAK,EAAGK,KAFT;AAGC,IAAA,EAAE,EAAGS,EAHN;AAIC,IAAA,mBAAmB,EAAGP,mBAJvB;AAKC,IAAA,IAAI,EAAGC,IALR;AAMC,IAAA,SAAS,EAAGrB,UAAU,CAAEc,SAAF,EAAa,2BAAb;AANvB,KAQC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,oCACMS,SADN;AAEC,IAAA,GAAG,EAAGrB,YAAY,CAAE,CAAEsB,SAAF,EAAaZ,YAAb,CAAF,CAFnB;AAGC,IAAA,SAAS,EAAC,kCAHX;AAIC,IAAA,EAAE,EAAGe,EAJN;AAKC,IAAA,IAAI,EAAC,QALN;AAMC,IAAA,WAAW,EAAGR,WANf;AAOC,IAAA,QAAQ,EAAKY,KAAF,IAAahB,QAAQ,CAAEgB,KAAK,CAACC,MAAN,CAAaf,KAAf,CAPjC;AAQC,IAAA,SAAS,EAAGD,SARb;AASC,IAAA,YAAY,EAAC,KATd;AAUC,IAAA,KAAK,EAAGC,KAAK,IAAI;AAVlB,KADD,EAaC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGW,iBAAiB,EADpB,CAbD,CARD,CADD;AA4BA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,OAAO,MAAMF,aAAa,GAAGnB,UAAU,CAAEI,wBAAF,CAAhC;AAEP,eAAee,aAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId, useMergeRefs } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { Icon, search, closeSmall } from '@wordpress/icons';\nimport { forwardRef, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport BaseControl from '../base-control';\nimport type { WordPressComponentProps } from '../ui/context/wordpress-component';\nimport type { SearchControlProps } from './types';\nimport type { ForwardedRef } from 'react';\n\nfunction UnforwardedSearchControl(\n\t{\n\t\t__nextHasNoMarginBottom,\n\t\tclassName,\n\t\tonChange,\n\t\tonKeyDown,\n\t\tvalue,\n\t\tlabel,\n\t\tplaceholder = __( 'Search' ),\n\t\thideLabelFromVision = true,\n\t\thelp,\n\t\tonClose,\n\t\t...restProps\n\t}: WordPressComponentProps< SearchControlProps, 'input', false >,\n\tforwardedRef: ForwardedRef< HTMLInputElement >\n) {\n\tconst searchRef = useRef< HTMLInputElement >();\n\tconst instanceId = useInstanceId( SearchControl );\n\tconst id = `components-search-control-${ instanceId }`;\n\n\tconst renderRightButton = () => {\n\t\tif ( onClose ) {\n\t\t\treturn (\n\t\t\t\t<Button\n\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\tlabel={ __( 'Close search' ) }\n\t\t\t\t\tonClick={ onClose }\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\tif ( !! value ) {\n\t\t\treturn (\n\t\t\t\t<Button\n\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\tlabel={ __( 'Reset search' ) }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tonChange( '' );\n\t\t\t\t\t\tsearchRef.current?.focus();\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn <Icon icon={ search } />;\n\t};\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\tlabel={ label }\n\t\t\tid={ id }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\thelp={ help }\n\t\t\tclassName={ classnames( className, 'components-search-control' ) }\n\t\t>\n\t\t\t<div className=\"components-search-control__input-wrapper\">\n\t\t\t\t<input\n\t\t\t\t\t{ ...restProps }\n\t\t\t\t\tref={ useMergeRefs( [ searchRef, forwardedRef ] ) }\n\t\t\t\t\tclassName=\"components-search-control__input\"\n\t\t\t\t\tid={ id }\n\t\t\t\t\ttype=\"search\"\n\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\tonChange={ ( event ) => onChange( event.target.value ) }\n\t\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\tvalue={ value || '' }\n\t\t\t\t/>\n\t\t\t\t<div className=\"components-search-control__icon\">\n\t\t\t\t\t{ renderRightButton() }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</BaseControl>\n\t);\n}\n\n/**\n * SearchControl components let users display a search control.\n *\n * ```jsx\n * import { SearchControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * function MySearchControl( { className, setState } ) {\n * const [ searchInput, setSearchInput ] = useState( '' );\n *\n * return (\n * <SearchControl\n * value={ searchInput }\n * onChange={ setSearchInput }\n * />\n * );\n * }\n * ```\n */\nexport const SearchControl = forwardRef( UnforwardedSearchControl );\n\nexport default SearchControl;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/select-control/index.native.js"],"names":["memo","PickerCell","SelectControl","help","instanceId","label","multiple","onChange","options","className","hideLabelFromVision","props","id","undefined"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,oBAArB;AACA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,oCAAvB;AAEA,MAAMC,aAAa,GAAGF,IAAI,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/select-control/index.native.js"],"names":["memo","PickerCell","SelectControl","help","instanceId","label","multiple","onChange","options","className","hideLabelFromVision","props","id","undefined"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,oBAArB;AACA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,oCAAvB;AAEA,OAAO,MAAMC,aAAa,GAAGF,IAAI,CAChC,QAUO;AAAA,MAVL;AACDG,IAAAA,IADC;AAEDC,IAAAA,UAFC;AAGDC,IAAAA,KAHC;AAIDC,IAAAA,QAAQ,GAAG,KAJV;AAKDC,IAAAA,QALC;AAMDC,IAAAA,OAAO,GAAG,EANT;AAODC,IAAAA,SAPC;AAQDC,IAAAA,mBARC;AASD,OAAGC;AATF,GAUK;AACN,QAAMC,EAAE,GAAI,4BAA4BR,UAAY,EAApD;AAEA,SACC,cAAC,UAAD;AACC,IAAA,KAAK,EAAGC,KADT;AAEC,IAAA,mBAAmB,EAAGK,mBAFvB;AAGC,IAAA,EAAE,EAAGE,EAHN;AAIC,IAAA,IAAI,EAAGT,IAJR;AAKC,IAAA,SAAS,EAAGM,SALb;AAMC,IAAA,aAAa,EAAGF,QANjB;AAOC,wBAAmB,CAAC,CAAEJ,IAAH,GAAW,GAAGS,EAAI,QAAlB,GAA4BC,SAPhD;AAQC,IAAA,QAAQ,EAAGP,QARZ;AASC,IAAA,OAAO,EAAGE;AATX,KAUMG,KAVN,EADD;AAcA,CA5B+B,CAA1B;AA+BP,eAAeT,aAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { memo } from '@wordpress/element';\n/**\n * Internal dependencies\n */\nimport PickerCell from '../mobile/bottom-sheet/picker-cell';\n\nexport const SelectControl = memo(\n\t( {\n\t\thelp,\n\t\tinstanceId,\n\t\tlabel,\n\t\tmultiple = false,\n\t\tonChange,\n\t\toptions = [],\n\t\tclassName,\n\t\thideLabelFromVision,\n\t\t...props\n\t} ) => {\n\t\tconst id = `inspector-select-control-${ instanceId }`;\n\n\t\treturn (\n\t\t\t<PickerCell\n\t\t\t\tlabel={ label }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\tid={ id }\n\t\t\t\thelp={ help }\n\t\t\t\tclassName={ className }\n\t\t\t\tonChangeValue={ onChange }\n\t\t\t\taria-describedby={ !! help ? `${ id }__help` : undefined }\n\t\t\t\tmultiple={ multiple }\n\t\t\t\toptions={ options }\n\t\t\t\t{ ...props }\n\t\t\t/>\n\t\t);\n\t}\n);\n\nexport default SelectControl;\n"]}
|
|
@@ -5,7 +5,7 @@ import { createElement } from "@wordpress/element";
|
|
|
5
5
|
* External dependencies
|
|
6
6
|
*/
|
|
7
7
|
import classnames from 'classnames';
|
|
8
|
-
import {
|
|
8
|
+
import { find } from 'lodash';
|
|
9
9
|
/**
|
|
10
10
|
* WordPress dependencies
|
|
11
11
|
*/
|
|
@@ -19,8 +19,6 @@ import { useInstanceId } from '@wordpress/compose';
|
|
|
19
19
|
import { NavigableMenu } from '../navigable-container';
|
|
20
20
|
import Button from '../button';
|
|
21
21
|
|
|
22
|
-
const noop = () => {};
|
|
23
|
-
|
|
24
22
|
const TabButton = _ref => {
|
|
25
23
|
let {
|
|
26
24
|
tabId,
|
|
@@ -37,8 +35,45 @@ const TabButton = _ref => {
|
|
|
37
35
|
onClick: onClick
|
|
38
36
|
}, rest), children);
|
|
39
37
|
};
|
|
38
|
+
/**
|
|
39
|
+
* TabPanel is an ARIA-compliant tabpanel.
|
|
40
|
+
*
|
|
41
|
+
* TabPanels organize content across different screens, data sets, and interactions.
|
|
42
|
+
* It has two sections: a list of tabs, and the view to show when tabs are chosen.
|
|
43
|
+
*
|
|
44
|
+
* ```jsx
|
|
45
|
+
* import { TabPanel } from '@wordpress/components';
|
|
46
|
+
*
|
|
47
|
+
* const onSelect = ( tabName ) => {
|
|
48
|
+
* console.log( 'Selecting tab', tabName );
|
|
49
|
+
* };
|
|
50
|
+
*
|
|
51
|
+
* const MyTabPanel = () => (
|
|
52
|
+
* <TabPanel
|
|
53
|
+
* className="my-tab-panel"
|
|
54
|
+
* activeClass="active-tab"
|
|
55
|
+
* onSelect={ onSelect }
|
|
56
|
+
* tabs={ [
|
|
57
|
+
* {
|
|
58
|
+
* name: 'tab1',
|
|
59
|
+
* title: 'Tab 1',
|
|
60
|
+
* className: 'tab-one',
|
|
61
|
+
* },
|
|
62
|
+
* {
|
|
63
|
+
* name: 'tab2',
|
|
64
|
+
* title: 'Tab 2',
|
|
65
|
+
* className: 'tab-two',
|
|
66
|
+
* },
|
|
67
|
+
* ] }
|
|
68
|
+
* >
|
|
69
|
+
* { ( tab ) => <p>{ tab.title }</p> }
|
|
70
|
+
* </TabPanel>
|
|
71
|
+
* );
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
|
|
40
75
|
|
|
41
|
-
export
|
|
76
|
+
export function TabPanel(_ref2) {
|
|
42
77
|
var _selectedTab$name;
|
|
43
78
|
|
|
44
79
|
let {
|
|
@@ -48,17 +83,17 @@ export default function TabPanel(_ref2) {
|
|
|
48
83
|
initialTabName,
|
|
49
84
|
orientation = 'horizontal',
|
|
50
85
|
activeClass = 'is-active',
|
|
51
|
-
onSelect
|
|
86
|
+
onSelect
|
|
52
87
|
} = _ref2;
|
|
53
88
|
const instanceId = useInstanceId(TabPanel, 'tab-panel');
|
|
54
|
-
const [selected, setSelected] = useState(
|
|
89
|
+
const [selected, setSelected] = useState();
|
|
55
90
|
|
|
56
91
|
const handleClick = tabKey => {
|
|
57
92
|
setSelected(tabKey);
|
|
58
|
-
onSelect(tabKey);
|
|
93
|
+
onSelect === null || onSelect === void 0 ? void 0 : onSelect(tabKey);
|
|
59
94
|
};
|
|
60
95
|
|
|
61
|
-
const onNavigate = (
|
|
96
|
+
const onNavigate = (_childIndex, child) => {
|
|
62
97
|
child.click();
|
|
63
98
|
};
|
|
64
99
|
|
|
@@ -72,7 +107,7 @@ export default function TabPanel(_ref2) {
|
|
|
72
107
|
});
|
|
73
108
|
|
|
74
109
|
if (!newSelectedTab) {
|
|
75
|
-
setSelected(initialTabName || (tabs.length > 0 ? tabs[0].name :
|
|
110
|
+
setSelected(initialTabName || (tabs.length > 0 ? tabs[0].name : undefined));
|
|
76
111
|
}
|
|
77
112
|
}, [tabs]);
|
|
78
113
|
return createElement("div", {
|
|
@@ -90,7 +125,7 @@ export default function TabPanel(_ref2) {
|
|
|
90
125
|
"aria-controls": `${instanceId}-${tab.name}-view`,
|
|
91
126
|
selected: tab.name === selected,
|
|
92
127
|
key: tab.name,
|
|
93
|
-
onClick:
|
|
128
|
+
onClick: () => handleClick(tab.name)
|
|
94
129
|
}, tab.title))), selectedTab && createElement("div", {
|
|
95
130
|
key: selectedId,
|
|
96
131
|
"aria-labelledby": selectedId,
|
|
@@ -99,4 +134,5 @@ export default function TabPanel(_ref2) {
|
|
|
99
134
|
className: "components-tab-panel__tab-content"
|
|
100
135
|
}, children(selectedTab)));
|
|
101
136
|
}
|
|
137
|
+
export default TabPanel;
|
|
102
138
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/tab-panel/index.
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/tab-panel/index.tsx"],"names":["classnames","find","useState","useEffect","useInstanceId","NavigableMenu","Button","TabButton","tabId","onClick","children","selected","rest","TabPanel","className","tabs","initialTabName","orientation","activeClass","onSelect","instanceId","setSelected","handleClick","tabKey","onNavigate","_childIndex","child","click","selectedTab","name","selectedId","newSelectedTab","length","undefined","map","tab","title"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AACA,SAASC,IAAT,QAAqB,QAArB;AAEA;AACA;AACA;;AACA,SAASC,QAAT,EAAmBC,SAAnB,QAAoC,oBAApC;AACA,SAASC,aAAT,QAA8B,oBAA9B;AAEA;AACA;AACA;;AACA,SAASC,aAAT,QAA8B,wBAA9B;AACA,OAAOC,MAAP,MAAmB,WAAnB;;AAIA,MAAMC,SAAS,GAAG;AAAA,MAAE;AACnBC,IAAAA,KADmB;AAEnBC,IAAAA,OAFmB;AAGnBC,IAAAA,QAHmB;AAInBC,IAAAA,QAJmB;AAKnB,OAAGC;AALgB,GAAF;AAAA,SAOjB,cAAC,MAAD;AACC,IAAA,IAAI,EAAC,KADN;AAEC,IAAA,QAAQ,EAAGD,QAAQ,GAAG,IAAH,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EAAC;AALX,KAOGpB,QAAQ,CAAEkB,WAAF,CAPX,CA3BF,CADD;AAwCA;AAED,eAAef,QAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { find } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useEffect } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { NavigableMenu } from '../navigable-container';\nimport Button from '../button';\nimport type { TabButtonProps, TabPanelProps } from './types';\nimport type { WordPressComponentProps } from '../ui/context';\n\nconst TabButton = ( {\n\ttabId,\n\tonClick,\n\tchildren,\n\tselected,\n\t...rest\n}: TabButtonProps ) => (\n\t<Button\n\t\trole=\"tab\"\n\t\ttabIndex={ selected ? null : -1 }\n\t\taria-selected={ selected }\n\t\tid={ tabId }\n\t\tonClick={ onClick }\n\t\t{ ...rest }\n\t>\n\t\t{ children }\n\t</Button>\n);\n\n/**\n * TabPanel is an ARIA-compliant tabpanel.\n *\n * TabPanels organize content across different screens, data sets, and interactions.\n * It has two sections: a list of tabs, and the view to show when tabs are chosen.\n *\n * ```jsx\n * import { TabPanel } from '@wordpress/components';\n *\n * const onSelect = ( tabName ) => {\n * console.log( 'Selecting tab', tabName );\n * };\n *\n * const MyTabPanel = () => (\n * <TabPanel\n * className=\"my-tab-panel\"\n * activeClass=\"active-tab\"\n * onSelect={ onSelect }\n * tabs={ [\n * {\n * name: 'tab1',\n * title: 'Tab 1',\n * className: 'tab-one',\n * },\n * {\n * name: 'tab2',\n * title: 'Tab 2',\n * className: 'tab-two',\n * },\n * ] }\n * >\n * { ( tab ) => <p>{ tab.title }</p> }\n * </TabPanel>\n * );\n * ```\n */\nexport function TabPanel( {\n\tclassName,\n\tchildren,\n\ttabs,\n\tinitialTabName,\n\torientation = 'horizontal',\n\tactiveClass = 'is-active',\n\tonSelect,\n}: WordPressComponentProps< TabPanelProps, 'div', false > ) {\n\tconst instanceId = useInstanceId( TabPanel, 'tab-panel' );\n\tconst [ selected, setSelected ] = useState< string >();\n\n\tconst handleClick = ( tabKey: string ) => {\n\t\tsetSelected( tabKey );\n\t\tonSelect?.( tabKey );\n\t};\n\n\tconst onNavigate = ( _childIndex: number, child: HTMLButtonElement ) => {\n\t\tchild.click();\n\t};\n\tconst selectedTab = find( tabs, { name: selected } );\n\tconst selectedId = `${ instanceId }-${ selectedTab?.name ?? 'none' }`;\n\n\tuseEffect( () => {\n\t\tconst newSelectedTab = find( tabs, { name: selected } );\n\t\tif ( ! newSelectedTab ) {\n\t\t\tsetSelected(\n\t\t\t\tinitialTabName ||\n\t\t\t\t\t( tabs.length > 0 ? tabs[ 0 ].name : undefined )\n\t\t\t);\n\t\t}\n\t}, [ tabs ] );\n\n\treturn (\n\t\t<div className={ className }>\n\t\t\t<NavigableMenu\n\t\t\t\trole=\"tablist\"\n\t\t\t\torientation={ orientation }\n\t\t\t\tonNavigate={ onNavigate }\n\t\t\t\tclassName=\"components-tab-panel__tabs\"\n\t\t\t>\n\t\t\t\t{ tabs.map( ( tab ) => (\n\t\t\t\t\t<TabButton\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'components-tab-panel__tabs-item',\n\t\t\t\t\t\t\ttab.className,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t[ activeClass ]: tab.name === selected,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\ttabId={ `${ instanceId }-${ tab.name }` }\n\t\t\t\t\t\taria-controls={ `${ instanceId }-${ tab.name }-view` }\n\t\t\t\t\t\tselected={ tab.name === selected }\n\t\t\t\t\t\tkey={ tab.name }\n\t\t\t\t\t\tonClick={ () => handleClick( tab.name ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ tab.title }\n\t\t\t\t\t</TabButton>\n\t\t\t\t) ) }\n\t\t\t</NavigableMenu>\n\t\t\t{ selectedTab && (\n\t\t\t\t<div\n\t\t\t\t\tkey={ selectedId }\n\t\t\t\t\taria-labelledby={ selectedId }\n\t\t\t\t\trole=\"tabpanel\"\n\t\t\t\t\tid={ `${ selectedId }-view` }\n\t\t\t\t\tclassName=\"components-tab-panel__tab-content\"\n\t\t\t\t>\n\t\t\t\t\t{ children( selectedTab ) }\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default TabPanel;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
|
@@ -18,6 +18,7 @@ import BaseControl from '../base-control';
|
|
|
18
18
|
|
|
19
19
|
function UnforwardedTextControl(props, ref) {
|
|
20
20
|
const {
|
|
21
|
+
__nextHasNoMarginBottom,
|
|
21
22
|
label,
|
|
22
23
|
hideLabelFromVision,
|
|
23
24
|
value,
|
|
@@ -33,6 +34,7 @@ function UnforwardedTextControl(props, ref) {
|
|
|
33
34
|
const onChangeValue = event => onChange(event.target.value);
|
|
34
35
|
|
|
35
36
|
return createElement(BaseControl, {
|
|
37
|
+
__nextHasNoMarginBottom: __nextHasNoMarginBottom,
|
|
36
38
|
label: label,
|
|
37
39
|
hideLabelFromVision: hideLabelFromVision,
|
|
38
40
|
id: id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/text-control/index.tsx"],"names":["useInstanceId","forwardRef","BaseControl","UnforwardedTextControl","props","ref","label","hideLabelFromVision","value","help","className","onChange","type","additionalProps","instanceId","TextControl","id","onChangeValue","event","target","undefined"],"mappings":";;;AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,aAAT,QAA8B,oBAA9B;AACA,SAASC,UAAT,QAA2B,oBAA3B;AAEA;AACA;AACA;;AACA,OAAOC,WAAP,MAAwB,iBAAxB;;AAIA,SAASC,sBAAT,CACCC,KADD,EAECC,GAFD,EAGE;AACD,QAAM;AACLC,IAAAA,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/text-control/index.tsx"],"names":["useInstanceId","forwardRef","BaseControl","UnforwardedTextControl","props","ref","__nextHasNoMarginBottom","label","hideLabelFromVision","value","help","className","onChange","type","additionalProps","instanceId","TextControl","id","onChangeValue","event","target","undefined"],"mappings":";;;AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,aAAT,QAA8B,oBAA9B;AACA,SAASC,UAAT,QAA2B,oBAA3B;AAEA;AACA;AACA;;AACA,OAAOC,WAAP,MAAwB,iBAAxB;;AAIA,SAASC,sBAAT,CACCC,KADD,EAECC,GAFD,EAGE;AACD,QAAM;AACLC,IAAAA,uBADK;AAELC,IAAAA,KAFK;AAGLC,IAAAA,mBAHK;AAILC,IAAAA,KAJK;AAKLC,IAAAA,IALK;AAMLC,IAAAA,SANK;AAOLC,IAAAA,QAPK;AAQLC,IAAAA,IAAI,GAAG,MARF;AASL,OAAGC;AATE,MAUFV,KAVJ;AAWA,QAAMW,UAAU,GAAGf,aAAa,CAAEgB,WAAF,CAAhC;AACA,QAAMC,EAAE,GAAI,0BAA0BF,UAAY,EAAlD;;AACA,QAAMG,aAAa,GAAKC,KAAF,IACrBP,QAAQ,CAAEO,KAAK,CAACC,MAAN,CAAaX,KAAf,CADT;;AAGA,SACC,cAAC,WAAD;AACC,IAAA,uBAAuB,EAAGH,uBAD3B;AAEC,IAAA,KAAK,EAAGC,KAFT;AAGC,IAAA,mBAAmB,EAAGC,mBAHvB;AAIC,IAAA,EAAE,EAAGS,EAJN;AAKC,IAAA,IAAI,EAAGP,IALR;AAMC,IAAA,SAAS,EAAGC;AANb,KAQC;AACC,IAAA,SAAS,EAAC,gCADX;AAEC,IAAA,IAAI,EAAGE,IAFR;AAGC,IAAA,EAAE,EAAGI,EAHN;AAIC,IAAA,KAAK,EAAGR,KAJT;AAKC,IAAA,QAAQ,EAAGS,aALZ;AAMC,wBAAmB,CAAC,CAAER,IAAH,GAAUO,EAAE,GAAG,QAAf,GAA0BI,SAN9C;AAOC,IAAA,GAAG,EAAGhB;AAPP,KAQMS,eARN,EARD,CADD;AAqBA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,OAAO,MAAME,WAAW,GAAGf,UAAU,CAAEE,sBAAF,CAA9B;AAEP,eAAea,WAAf","sourcesContent":["/**\n * External dependencies\n */\nimport type { ChangeEvent, ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport type { WordPressComponentProps } from '../ui/context';\nimport type { TextControlProps } from './types';\n\nfunction UnforwardedTextControl(\n\tprops: WordPressComponentProps< TextControlProps, 'input', false >,\n\tref: ForwardedRef< HTMLInputElement >\n) {\n\tconst {\n\t\t__nextHasNoMarginBottom,\n\t\tlabel,\n\t\thideLabelFromVision,\n\t\tvalue,\n\t\thelp,\n\t\tclassName,\n\t\tonChange,\n\t\ttype = 'text',\n\t\t...additionalProps\n\t} = props;\n\tconst instanceId = useInstanceId( TextControl );\n\tconst id = `inspector-text-control-${ instanceId }`;\n\tconst onChangeValue = ( event: ChangeEvent< HTMLInputElement > ) =>\n\t\tonChange( event.target.value );\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\tlabel={ label }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\tid={ id }\n\t\t\thelp={ help }\n\t\t\tclassName={ className }\n\t\t>\n\t\t\t<input\n\t\t\t\tclassName=\"components-text-control__input\"\n\t\t\t\ttype={ type }\n\t\t\t\tid={ id }\n\t\t\t\tvalue={ value }\n\t\t\t\tonChange={ onChangeValue }\n\t\t\t\taria-describedby={ !! help ? id + '__help' : undefined }\n\t\t\t\tref={ ref }\n\t\t\t\t{ ...additionalProps }\n\t\t\t/>\n\t\t</BaseControl>\n\t);\n}\n\n/**\n * TextControl components let users enter and edit text.\n *\n *\n * @example\n * ```jsx\n * import { TextControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyTextControl = () => {\n * const [ className, setClassName ] = useState( '' );\n *\n * return (\n * <TextControl\n * label=\"Additional CSS Class\"\n * value={ className }\n * onChange={ ( value ) => setClassName( value ) }\n * />\n * );\n * };\n * ```\n */\nexport const TextControl = forwardRef( UnforwardedTextControl );\n\nexport default TextControl;\n"]}
|
|
@@ -39,10 +39,9 @@ import { StyledTextarea } from './styles/textarea-control-styles';
|
|
|
39
39
|
* };
|
|
40
40
|
* ```
|
|
41
41
|
*/
|
|
42
|
-
export function TextareaControl(
|
|
43
|
-
// ref forwarding to TextareaControl.
|
|
44
|
-
props) {
|
|
42
|
+
export function TextareaControl(props) {
|
|
45
43
|
const {
|
|
44
|
+
__nextHasNoMarginBottom,
|
|
46
45
|
label,
|
|
47
46
|
hideLabelFromVision,
|
|
48
47
|
value,
|
|
@@ -58,6 +57,7 @@ props) {
|
|
|
58
57
|
const onChangeValue = event => onChange(event.target.value);
|
|
59
58
|
|
|
60
59
|
return createElement(BaseControl, {
|
|
60
|
+
__nextHasNoMarginBottom: __nextHasNoMarginBottom,
|
|
61
61
|
label: label,
|
|
62
62
|
hideLabelFromVision: hideLabelFromVision,
|
|
63
63
|
id: id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/textarea-control/index.tsx"],"names":["useInstanceId","BaseControl","StyledTextarea","TextareaControl","props","label","hideLabelFromVision","value","help","onChange","rows","className","additionalProps","instanceId","id","onChangeValue","event","target","undefined"],"mappings":";;;AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,aAAT,QAA8B,oBAA9B;AAEA;AACA;AACA;;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,SAASC,cAAT,QAA+B,kCAA/B;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/textarea-control/index.tsx"],"names":["useInstanceId","BaseControl","StyledTextarea","TextareaControl","props","__nextHasNoMarginBottom","label","hideLabelFromVision","value","help","onChange","rows","className","additionalProps","instanceId","id","onChangeValue","event","target","undefined"],"mappings":";;;AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,aAAT,QAA8B,oBAA9B;AAEA;AACA;AACA;;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,SAASC,cAAT,QAA+B,kCAA/B;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAT,CACNC,KADM,EAEL;AACD,QAAM;AACLC,IAAAA,uBADK;AAELC,IAAAA,KAFK;AAGLC,IAAAA,mBAHK;AAILC,IAAAA,KAJK;AAKLC,IAAAA,IALK;AAMLC,IAAAA,QANK;AAOLC,IAAAA,IAAI,GAAG,CAPF;AAQLC,IAAAA,SARK;AASL,OAAGC;AATE,MAUFT,KAVJ;AAWA,QAAMU,UAAU,GAAGd,aAAa,CAAEG,eAAF,CAAhC;AACA,QAAMY,EAAE,GAAI,8BAA8BD,UAAY,EAAtD;;AACA,QAAME,aAAa,GAAKC,KAAF,IACrBP,QAAQ,CAAEO,KAAK,CAACC,MAAN,CAAaV,KAAf,CADT;;AAGA,SACC,cAAC,WAAD;AACC,IAAA,uBAAuB,EAAGH,uBAD3B;AAEC,IAAA,KAAK,EAAGC,KAFT;AAGC,IAAA,mBAAmB,EAAGC,mBAHvB;AAIC,IAAA,EAAE,EAAGQ,EAJN;AAKC,IAAA,IAAI,EAAGN,IALR;AAMC,IAAA,SAAS,EAAGG;AANb,KAQC,cAAC,cAAD;AACC,IAAA,SAAS,EAAC,oCADX;AAEC,IAAA,EAAE,EAAGG,EAFN;AAGC,IAAA,IAAI,EAAGJ,IAHR;AAIC,IAAA,QAAQ,EAAGK,aAJZ;AAKC,wBAAmB,CAAC,CAAEP,IAAH,GAAUM,EAAE,GAAG,QAAf,GAA0BI,SAL9C;AAMC,IAAA,KAAK,EAAGX;AANT,KAOMK,eAPN,EARD,CADD;AAoBA;AAED,eAAeV,eAAf","sourcesContent":["/**\n * External dependencies\n */\nimport type { ChangeEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport { StyledTextarea } from './styles/textarea-control-styles';\nimport type { TextareaControlProps } from './types';\nimport type { WordPressComponentProps } from '../ui/context';\n\n/**\n * TextareaControls are TextControls that allow for multiple lines of text, and\n * wrap overflow text onto a new line. They are a fixed height and scroll\n * vertically when the cursor reaches the bottom of the field.\n *\n * ```jsx\n * import { TextareaControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyTextareaControl = () => {\n * const [ text, setText ] = useState( '' );\n *\n * return (\n * <TextareaControl\n * label=\"Text\"\n * help=\"Enter some text\"\n * value={ text }\n * onChange={ ( value ) => setText( value ) }\n * />\n * );\n * };\n * ```\n */\nexport function TextareaControl(\n\tprops: WordPressComponentProps< TextareaControlProps, 'textarea', false >\n) {\n\tconst {\n\t\t__nextHasNoMarginBottom,\n\t\tlabel,\n\t\thideLabelFromVision,\n\t\tvalue,\n\t\thelp,\n\t\tonChange,\n\t\trows = 4,\n\t\tclassName,\n\t\t...additionalProps\n\t} = props;\n\tconst instanceId = useInstanceId( TextareaControl );\n\tconst id = `inspector-textarea-control-${ instanceId }`;\n\tconst onChangeValue = ( event: ChangeEvent< HTMLTextAreaElement > ) =>\n\t\tonChange( event.target.value );\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\tlabel={ label }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\tid={ id }\n\t\t\thelp={ help }\n\t\t\tclassName={ className }\n\t\t>\n\t\t\t<StyledTextarea\n\t\t\t\tclassName=\"components-textarea-control__input\"\n\t\t\t\tid={ id }\n\t\t\t\trows={ rows }\n\t\t\t\tonChange={ onChangeValue }\n\t\t\t\taria-describedby={ !! help ? id + '__help' : undefined }\n\t\t\t\tvalue={ value }\n\t\t\t\t{ ...additionalProps }\n\t\t\t/>\n\t\t</BaseControl>\n\t);\n}\n\nexport default TextareaControl;\n"]}
|
|
@@ -3,7 +3,7 @@ import { createElement } from "@wordpress/element";
|
|
|
3
3
|
/**
|
|
4
4
|
* External dependencies
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
6
|
+
import { css } from '@emotion/react';
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
@@ -15,8 +15,33 @@ import { useInstanceId } from '@wordpress/compose';
|
|
|
15
15
|
|
|
16
16
|
import FormToggle from '../form-toggle';
|
|
17
17
|
import BaseControl from '../base-control';
|
|
18
|
-
|
|
18
|
+
import { HStack } from '../h-stack';
|
|
19
|
+
import { useCx } from '../utils';
|
|
20
|
+
import { space } from '../ui/utils/space';
|
|
21
|
+
/**
|
|
22
|
+
* ToggleControl is used to generate a toggle user interface.
|
|
23
|
+
*
|
|
24
|
+
* ```jsx
|
|
25
|
+
* import { ToggleControl } from '@wordpress/components';
|
|
26
|
+
* import { useState } from '@wordpress/element';
|
|
27
|
+
*
|
|
28
|
+
* const MyToggleControl = () => {
|
|
29
|
+
* const [ value, setValue ] = useState( false );
|
|
30
|
+
*
|
|
31
|
+
* return (
|
|
32
|
+
* <ToggleControl
|
|
33
|
+
* label="Fixed Background"
|
|
34
|
+
* checked={ value }
|
|
35
|
+
* onChange={ () => setValue( ( state ) => ! state ) }
|
|
36
|
+
* />
|
|
37
|
+
* );
|
|
38
|
+
* };
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
export function ToggleControl(_ref) {
|
|
19
43
|
let {
|
|
44
|
+
__nextHasNoMarginBottom,
|
|
20
45
|
label,
|
|
21
46
|
checked,
|
|
22
47
|
help,
|
|
@@ -31,6 +56,10 @@ export default function ToggleControl(_ref) {
|
|
|
31
56
|
|
|
32
57
|
const instanceId = useInstanceId(ToggleControl);
|
|
33
58
|
const id = `inspector-toggle-control-${instanceId}`;
|
|
59
|
+
const cx = useCx();
|
|
60
|
+
const classes = cx('components-toggle-control', className, !__nextHasNoMarginBottom && /*#__PURE__*/css({
|
|
61
|
+
marginBottom: space(3)
|
|
62
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:classes;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdG9nZ2xlLWNvbnRyb2wvaW5kZXgudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTZEK0IiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy90b2dnbGUtY29udHJvbC9pbmRleC50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgdHlwZSB7IENoYW5nZUV2ZW50IH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuXG4vKipcbiAqIFdvcmRQcmVzcyBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHsgdXNlSW5zdGFuY2VJZCB9IGZyb20gJ0B3b3JkcHJlc3MvY29tcG9zZSc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCBGb3JtVG9nZ2xlIGZyb20gJy4uL2Zvcm0tdG9nZ2xlJztcbmltcG9ydCBCYXNlQ29udHJvbCBmcm9tICcuLi9i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xhc3NlcyB9XG5cdFx0XHRfX25leHRIYXNOb01hcmdpbkJvdHRvbVxuXHRcdD5cblx0XHRcdDxIU3RhY2sganVzdGlmeT1cImZsZXgtc3RhcnRcIiBzcGFjaW5nPXsgMyB9PlxuXHRcdFx0XHQ8Rm9ybVRvZ2dsZVxuXHRcdFx0XHRcdGlkPXsgaWQgfVxuXHRcdFx0XHRcdGNoZWNrZWQ9eyBjaGVja2VkIH1cblx0XHRcdFx0XHRvbkNoYW5nZT17IG9uQ2hhbmdlVG9nZ2xlIH1cblx0XHRcdFx0XHRhcmlhLWRlc2NyaWJlZGJ5PXsgZGVzY3JpYmVkQnkgfVxuXHRcdFx0XHRcdGRpc2FibGVkPXsgZGlzYWJsZWQgfVxuXHRcdFx0XHQvPlxuXHRcdFx0XHQ8bGFiZWxcblx0XHRcdFx0XHRodG1sRm9yPXsgaWQgfVxuXHRcdFx0XHRcdGNsYXNzTmFtZT1cImNvbXBvbmVudHMtdG9nZ2xlLWNvbnRyb2xfX2xhYmVsXCJcblx0XHRcdFx0PlxuXHRcdFx0XHRcdHsgbGFiZWwgfVxuXHRcdFx0XHQ8L2xhYmVsPlxuXHRcdFx0PC9IU3RhY2s+XG5cdFx0PC9CYXNlQ29udHJvbD5cblx0KTtcbn1cblxuZXhwb3J0IGRlZmF1bHQgVG9nZ2xlQ29udHJvbDtcbiJdfQ== */"));
|
|
34
63
|
let describedBy, helpLabel;
|
|
35
64
|
|
|
36
65
|
if (help) {
|
|
@@ -41,7 +70,11 @@ export default function ToggleControl(_ref) {
|
|
|
41
70
|
return createElement(BaseControl, {
|
|
42
71
|
id: id,
|
|
43
72
|
help: helpLabel,
|
|
44
|
-
className:
|
|
73
|
+
className: classes,
|
|
74
|
+
__nextHasNoMarginBottom: true
|
|
75
|
+
}, createElement(HStack, {
|
|
76
|
+
justify: "flex-start",
|
|
77
|
+
spacing: 3
|
|
45
78
|
}, createElement(FormToggle, {
|
|
46
79
|
id: id,
|
|
47
80
|
checked: checked,
|
|
@@ -51,6 +84,7 @@ export default function ToggleControl(_ref) {
|
|
|
51
84
|
}), createElement("label", {
|
|
52
85
|
htmlFor: id,
|
|
53
86
|
className: "components-toggle-control__label"
|
|
54
|
-
}, label));
|
|
87
|
+
}, label)));
|
|
55
88
|
}
|
|
89
|
+
export default ToggleControl;
|
|
56
90
|
//# sourceMappingURL=index.js.map
|