@wordpress/components 19.9.0 → 19.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +84 -0
- package/CONTRIBUTING.md +80 -7
- package/README.md +1 -1
- package/build/alignment-matrix-control/index.js +5 -2
- package/build/alignment-matrix-control/index.js.map +1 -1
- package/build/angle-picker-control/angle-circle.js +5 -7
- package/build/angle-picker-control/angle-circle.js.map +1 -1
- package/build/autocomplete/autocompleter-ui.js +1 -1
- package/build/autocomplete/autocompleter-ui.js.map +1 -1
- package/build/autocomplete/autocompleter-ui.native.js +2 -2
- package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
- package/build/autocomplete/index.js +12 -10
- package/build/autocomplete/index.js.map +1 -1
- package/build/border-box-control/border-box-control/component.js +22 -7
- package/build/border-box-control/border-box-control/component.js.map +1 -1
- package/build/border-box-control/border-box-control/hook.js +2 -2
- package/build/border-box-control/border-box-control/hook.js.map +1 -1
- package/build/border-box-control/border-box-control-linked-button/hook.js +3 -2
- package/build/border-box-control/border-box-control-linked-button/hook.js.map +1 -1
- package/build/border-box-control/border-box-control-split-controls/component.js +23 -8
- package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- package/build/border-box-control/border-box-control-split-controls/hook.js +13 -4
- package/build/border-box-control/border-box-control-split-controls/hook.js.map +1 -1
- package/build/border-box-control/border-box-control-visualizer/hook.js +7 -2
- package/build/border-box-control/border-box-control-visualizer/hook.js.map +1 -1
- package/build/border-box-control/styles.js +25 -19
- package/build/border-box-control/styles.js.map +1 -1
- package/build/border-control/border-control/component.js +5 -3
- package/build/border-control/border-control/component.js.map +1 -1
- package/build/border-control/border-control/hook.js +8 -5
- package/build/border-control/border-control/hook.js.map +1 -1
- package/build/border-control/border-control-dropdown/component.js +6 -2
- package/build/border-control/border-control-dropdown/component.js.map +1 -1
- package/build/border-control/border-control-dropdown/hook.js +5 -5
- package/build/border-control/border-control-dropdown/hook.js.map +1 -1
- package/build/border-control/styles.js +58 -29
- package/build/border-control/styles.js.map +1 -1
- package/build/box-control/index.js +0 -21
- package/build/box-control/index.js.map +1 -1
- package/build/box-control/utils.js +1 -8
- package/build/box-control/utils.js.map +1 -1
- package/build/button/index.js +3 -5
- package/build/button/index.js.map +1 -1
- package/build/button/index.native.js +16 -2
- package/build/button/index.native.js.map +1 -1
- package/build/button-group/index.js +24 -7
- package/build/button-group/index.js.map +1 -1
- package/build/{flyout → button-group}/types.js +0 -0
- package/build/button-group/types.js.map +1 -0
- package/build/checkbox-control/index.js +34 -7
- package/build/checkbox-control/index.js.map +1 -1
- package/build/checkbox-control/types.js +6 -0
- package/build/checkbox-control/types.js.map +1 -0
- package/build/circular-option-picker/index.js +1 -2
- package/build/circular-option-picker/index.js.map +1 -1
- package/build/color-palette/index.js +14 -14
- package/build/color-palette/index.js.map +1 -1
- package/build/color-palette/index.native.js +4 -1
- package/build/color-palette/index.native.js.map +1 -1
- package/build/color-picker/color-copy-button.js +87 -0
- package/build/color-picker/color-copy-button.js.map +1 -0
- package/build/color-picker/component.js +5 -15
- package/build/color-picker/component.js.map +1 -1
- package/build/color-picker/hex-input.js +18 -1
- package/build/color-picker/hex-input.js.map +1 -1
- package/build/color-picker/styles.js +11 -11
- package/build/color-picker/styles.js.map +1 -1
- package/build/custom-gradient-picker/utils.js +1 -1
- package/build/custom-gradient-picker/utils.js.map +1 -1
- package/build/date-time/{date.js → date/index.js} +83 -20
- package/build/date-time/date/index.js.map +1 -0
- package/build/date-time/date/styles.js +70 -0
- package/build/date-time/date/styles.js.map +1 -0
- package/build/date-time/{utils.js → date/utils.js} +6 -4
- package/build/date-time/date/utils.js.map +1 -0
- package/build/date-time/date-time/index.js +175 -0
- package/build/date-time/date-time/index.js.map +1 -0
- package/build/date-time/date-time/styles.js +32 -0
- package/build/date-time/date-time/styles.js.map +1 -0
- package/build/date-time/index.js +2 -84
- package/build/date-time/index.js.map +1 -1
- package/build/date-time/time/index.js +322 -0
- package/build/date-time/time/index.js.map +1 -0
- package/build/date-time/time/styles.js +139 -0
- package/build/date-time/time/styles.js.map +1 -0
- package/build/date-time/{timezone.js → time/timezone.js} +8 -5
- package/build/date-time/time/timezone.js.map +1 -0
- package/build/date-time/types.js +6 -0
- package/build/date-time/types.js.map +1 -0
- package/build/disabled/index.js +4 -76
- package/build/disabled/index.js.map +1 -1
- package/build/draggable/index.native.js +228 -0
- package/build/draggable/index.native.js.map +1 -0
- package/build/dropdown/index.js +9 -4
- package/build/dropdown/index.js.map +1 -1
- package/build/focal-point-picker/index.native.js +3 -3
- package/build/focal-point-picker/index.native.js.map +1 -1
- package/build/index.js +0 -8
- package/build/index.js.map +1 -1
- package/build/index.native.js +16 -0
- package/build/index.native.js.map +1 -1
- package/build/input-control/index.js +12 -6
- package/build/input-control/index.js.map +1 -1
- package/build/input-control/input-field.js +1 -26
- package/build/input-control/input-field.js.map +1 -1
- package/build/input-control/reducer/reducer.js +36 -24
- package/build/input-control/reducer/reducer.js.map +1 -1
- package/build/input-control/reducer/state.js +0 -1
- package/build/input-control/reducer/state.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +42 -30
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/input-control/utils.js +45 -0
- package/build/input-control/utils.js.map +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
- package/build/mobile/bottom-sheet/index.native.js +1 -1
- package/build/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet-select-control/index.native.js +4 -2
- package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
- package/build/mobile/html-text-input/index.native.js +19 -8
- package/build/mobile/html-text-input/index.native.js.map +1 -1
- package/build/mobile/keyboard-aware-flat-list/index.android.js +28 -5
- package/build/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
- package/build/mobile/keyboard-aware-flat-list/index.ios.js +47 -24
- package/build/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
- package/build/palette-edit/index.js +38 -7
- package/build/palette-edit/index.js.map +1 -1
- package/build/popover/index.js +228 -321
- package/build/popover/index.js.map +1 -1
- package/build/resizable-box/resize-tooltip/utils.js +5 -8
- package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build/sandbox/index.native.js +1 -1
- package/build/sandbox/index.native.js.map +1 -1
- package/build/search-control/index.js +4 -6
- package/build/search-control/index.js.map +1 -1
- package/build/select-control/index.js +34 -5
- package/build/select-control/index.js.map +1 -1
- package/build/select-control/styles/select-control-styles.js +17 -14
- package/build/select-control/styles/select-control-styles.js.map +1 -1
- package/build/spacer/hook.js +11 -3
- package/build/spacer/hook.js.map +1 -1
- package/build/surface/component.js +7 -7
- package/build/surface/component.js.map +1 -1
- package/build/surface/hook.js +8 -11
- package/build/surface/hook.js.map +1 -1
- package/build/surface/index.js.map +1 -1
- package/build/surface/styles.js +8 -48
- package/build/surface/styles.js.map +1 -1
- package/build/text-control/index.js +35 -28
- package/build/text-control/index.js.map +1 -1
- package/build/text-control/types.js +6 -0
- package/build/text-control/types.js.map +1 -0
- package/build/textarea-control/index.js +40 -6
- package/build/textarea-control/index.js.map +1 -1
- package/build/textarea-control/styles/textarea-control-styles.js +3 -3
- package/build/textarea-control/styles/textarea-control-styles.js.map +1 -1
- package/build/textarea-control/types.js +6 -0
- package/build/textarea-control/types.js.map +1 -0
- package/build/toggle-group-control/toggle-group-control/component.js +1 -3
- 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 +6 -4
- package/build/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
- package/build/tools-panel/tools-panel-header/component.js +52 -36
- package/build/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build/tooltip/index.js +2 -2
- package/build/tooltip/index.js.map +1 -1
- package/build/unit-control/index.js +3 -3
- package/build/unit-control/index.js.map +1 -1
- package/build/unit-control/styles/unit-control-styles.js +11 -20
- package/build/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build/unit-control/utils.js.map +1 -1
- package/build/utils/hooks/index.js +0 -8
- package/build/utils/hooks/index.js.map +1 -1
- package/build-module/alignment-matrix-control/index.js +5 -2
- package/build-module/alignment-matrix-control/index.js.map +1 -1
- package/build-module/angle-picker-control/angle-circle.js +5 -7
- package/build-module/angle-picker-control/angle-circle.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.js +1 -1
- package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.native.js +2 -2
- package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
- package/build-module/autocomplete/index.js +13 -11
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/border-box-control/border-box-control/component.js +22 -7
- package/build-module/border-box-control/border-box-control/component.js.map +1 -1
- package/build-module/border-box-control/border-box-control/hook.js +2 -2
- package/build-module/border-box-control/border-box-control/hook.js.map +1 -1
- package/build-module/border-box-control/border-box-control-linked-button/hook.js +3 -2
- package/build-module/border-box-control/border-box-control-linked-button/hook.js.map +1 -1
- package/build-module/border-box-control/border-box-control-split-controls/component.js +23 -8
- package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- package/build-module/border-box-control/border-box-control-split-controls/hook.js +11 -4
- package/build-module/border-box-control/border-box-control-split-controls/hook.js.map +1 -1
- package/build-module/border-box-control/border-box-control-visualizer/hook.js +5 -2
- package/build-module/border-box-control/border-box-control-visualizer/hook.js.map +1 -1
- package/build-module/border-box-control/styles.js +15 -16
- package/build-module/border-box-control/styles.js.map +1 -1
- package/build-module/border-control/border-control/component.js +5 -3
- package/build-module/border-control/border-control/component.js.map +1 -1
- package/build-module/border-control/border-control/hook.js +8 -5
- package/build-module/border-control/border-control/hook.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/component.js +6 -2
- package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/hook.js +5 -5
- package/build-module/border-control/border-control-dropdown/hook.js.map +1 -1
- package/build-module/border-control/styles.js +56 -29
- package/build-module/border-control/styles.js.map +1 -1
- package/build-module/box-control/index.js +1 -20
- package/build-module/box-control/index.js.map +1 -1
- package/build-module/box-control/utils.js +0 -6
- package/build-module/box-control/utils.js.map +1 -1
- package/build-module/button/index.js +3 -4
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/index.native.js +16 -3
- package/build-module/button/index.native.js.map +1 -1
- package/build-module/button-group/index.js +27 -7
- package/build-module/button-group/index.js.map +1 -1
- package/build-module/{flyout → button-group}/types.js +0 -0
- package/build-module/{flyout → button-group}/types.js.map +0 -0
- package/build-module/checkbox-control/index.js +31 -7
- package/build-module/checkbox-control/index.js.map +1 -1
- package/build-module/checkbox-control/types.js +2 -0
- package/{build/flyout → build-module/checkbox-control}/types.js.map +0 -0
- package/build-module/circular-option-picker/index.js +1 -2
- package/build-module/circular-option-picker/index.js.map +1 -1
- package/build-module/color-palette/index.js +12 -16
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-palette/index.native.js +4 -1
- package/build-module/color-palette/index.native.js.map +1 -1
- package/build-module/color-picker/color-copy-button.js +73 -0
- package/build-module/color-picker/color-copy-button.js.map +1 -0
- package/build-module/color-picker/component.js +6 -15
- package/build-module/color-picker/component.js.map +1 -1
- package/build-module/color-picker/hex-input.js +18 -1
- package/build-module/color-picker/hex-input.js.map +1 -1
- package/build-module/color-picker/styles.js +9 -9
- package/build-module/color-picker/styles.js.map +1 -1
- package/build-module/custom-gradient-picker/utils.js +1 -1
- package/build-module/custom-gradient-picker/utils.js.map +1 -1
- package/build-module/date-time/{date.js → date/index.js} +79 -22
- package/build-module/date-time/date/index.js.map +1 -0
- package/build-module/date-time/date/styles.js +61 -0
- package/build-module/date-time/date/styles.js.map +1 -0
- package/build-module/date-time/date/utils.js +22 -0
- package/build-module/date-time/date/utils.js.map +1 -0
- package/build-module/date-time/date-time/index.js +144 -0
- package/build-module/date-time/date-time/index.js.map +1 -0
- package/build-module/date-time/date-time/styles.js +22 -0
- package/build-module/date-time/date-time/styles.js.map +1 -0
- package/build-module/date-time/index.js +2 -82
- package/build-module/date-time/index.js.map +1 -1
- package/build-module/date-time/time/index.js +302 -0
- package/build-module/date-time/time/index.js.map +1 -0
- package/build-module/date-time/time/styles.js +118 -0
- package/build-module/date-time/time/styles.js.map +1 -0
- package/build-module/date-time/{timezone.js → time/timezone.js} +7 -5
- package/build-module/date-time/time/timezone.js.map +1 -0
- package/build-module/date-time/types.js +2 -0
- package/build-module/date-time/types.js.map +1 -0
- package/build-module/disabled/index.js +5 -76
- package/build-module/disabled/index.js.map +1 -1
- package/build-module/draggable/index.native.js +211 -0
- package/build-module/draggable/index.native.js.map +1 -0
- package/build-module/dropdown/index.js +9 -4
- package/build-module/dropdown/index.js.map +1 -1
- package/build-module/focal-point-picker/index.native.js +3 -3
- package/build-module/focal-point-picker/index.native.js.map +1 -1
- package/build-module/index.js +0 -1
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +2 -1
- package/build-module/index.native.js.map +1 -1
- package/build-module/input-control/index.js +11 -6
- package/build-module/input-control/index.js.map +1 -1
- package/build-module/input-control/input-field.js +1 -25
- package/build-module/input-control/input-field.js.map +1 -1
- package/build-module/input-control/reducer/reducer.js +38 -26
- package/build-module/input-control/reducer/reducer.js.map +1 -1
- package/build-module/input-control/reducer/state.js +0 -1
- package/build-module/input-control/reducer/state.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +42 -30
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/input-control/utils.js +48 -2
- package/build-module/input-control/utils.js.map +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/index.native.js +1 -1
- package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet-select-control/index.native.js +4 -2
- package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
- package/build-module/mobile/html-text-input/index.native.js +20 -9
- package/build-module/mobile/html-text-input/index.native.js.map +1 -1
- package/build-module/mobile/keyboard-aware-flat-list/index.android.js +21 -5
- package/build-module/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
- package/build-module/mobile/keyboard-aware-flat-list/index.ios.js +42 -25
- package/build-module/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
- package/build-module/palette-edit/index.js +37 -7
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/popover/index.js +230 -323
- package/build-module/popover/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/utils.js +4 -5
- package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build-module/sandbox/index.native.js +1 -1
- package/build-module/sandbox/index.native.js.map +1 -1
- package/build-module/search-control/index.js +6 -7
- package/build-module/search-control/index.js.map +1 -1
- package/build-module/select-control/index.js +32 -4
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/select-control/styles/select-control-styles.js +17 -14
- package/build-module/select-control/styles/select-control-styles.js.map +1 -1
- package/build-module/spacer/hook.js +10 -2
- package/build-module/spacer/hook.js.map +1 -1
- package/build-module/surface/component.js +7 -7
- package/build-module/surface/component.js.map +1 -1
- package/build-module/surface/hook.js +8 -11
- package/build-module/surface/hook.js.map +1 -1
- package/build-module/surface/index.js.map +1 -1
- package/build-module/surface/styles.js +8 -48
- package/build-module/surface/styles.js.map +1 -1
- package/build-module/text-control/index.js +35 -27
- package/build-module/text-control/index.js.map +1 -1
- package/build-module/text-control/types.js +2 -0
- package/build-module/text-control/types.js.map +1 -0
- package/build-module/textarea-control/index.js +36 -5
- package/build-module/textarea-control/index.js.map +1 -1
- package/build-module/textarea-control/styles/textarea-control-styles.js +3 -3
- package/build-module/textarea-control/styles/textarea-control-styles.js.map +1 -1
- package/build-module/textarea-control/types.js +2 -0
- package/build-module/textarea-control/types.js.map +1 -0
- package/build-module/toggle-group-control/toggle-group-control/component.js +2 -3
- 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 -5
- package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/component.js +51 -36
- package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build-module/tooltip/index.js +2 -2
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/unit-control/index.js +3 -3
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/unit-control/styles/unit-control-styles.js +11 -20
- package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build-module/unit-control/utils.js.map +1 -1
- package/build-module/utils/hooks/index.js +0 -1
- package/build-module/utils/hooks/index.js.map +1 -1
- package/build-style/style-rtl.css +51 -358
- package/build-style/style.css +47 -361
- 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 +3 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-split-controls/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +4 -1
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
- package/build-types/border-box-control/styles.d.ts +4 -3
- package/build-types/border-box-control/styles.d.ts.map +1 -1
- package/build-types/border-box-control/types.d.ts +40 -13
- package/build-types/border-box-control/types.d.ts.map +1 -1
- package/build-types/border-control/border-control/component.d.ts.map +1 -1
- package/build-types/border-control/border-control/hook.d.ts +2 -1
- package/build-types/border-control/border-control/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/hook.d.ts +1 -0
- package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
- package/build-types/border-control/styles.d.ts +2 -1
- package/build-types/border-control/styles.d.ts.map +1 -1
- package/build-types/border-control/types.d.ts +18 -6
- package/build-types/border-control/types.d.ts.map +1 -1
- package/build-types/button/index.d.ts.map +1 -1
- package/build-types/button-group/index.d.ts +25 -0
- package/build-types/button-group/index.d.ts.map +1 -0
- package/build-types/button-group/stories/index.d.ts +12 -0
- package/build-types/button-group/stories/index.d.ts.map +1 -0
- package/build-types/button-group/types.d.ts +11 -0
- package/build-types/button-group/types.d.ts.map +1 -0
- package/build-types/card/types.d.ts +1 -1
- package/build-types/card/types.d.ts.map +1 -1
- package/build-types/checkbox-control/index.d.ts +26 -0
- package/build-types/checkbox-control/index.d.ts.map +1 -0
- package/build-types/checkbox-control/stories/index.d.ts +13 -0
- package/build-types/checkbox-control/stories/index.d.ts.map +1 -0
- package/build-types/checkbox-control/test/index.d.ts +2 -0
- package/build-types/checkbox-control/test/index.d.ts.map +1 -0
- package/build-types/checkbox-control/types.d.ts +35 -0
- package/build-types/checkbox-control/types.d.ts.map +1 -0
- package/build-types/circular-option-picker/index.d.ts.map +1 -1
- package/build-types/color-palette/index.d.ts +1 -0
- package/build-types/color-palette/index.d.ts.map +1 -1
- package/build-types/color-palette/test/utils.d.ts +2 -0
- package/build-types/color-palette/test/utils.d.ts.map +1 -0
- package/build-types/color-picker/color-copy-button.d.ts +4 -0
- package/build-types/color-picker/color-copy-button.d.ts.map +1 -0
- package/build-types/color-picker/component.d.ts.map +1 -1
- package/build-types/color-picker/hex-input.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +4 -4
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/color-picker/types.d.ts +8 -0
- package/build-types/color-picker/types.d.ts.map +1 -1
- package/build-types/date-time/date/index.d.ts +25 -0
- package/build-types/date-time/date/index.d.ts.map +1 -0
- package/build-types/date-time/date/styles.d.ts +23 -0
- package/build-types/date-time/date/styles.d.ts.map +1 -0
- package/build-types/date-time/date/test/index.d.ts +2 -0
- package/build-types/date-time/date/test/index.d.ts.map +1 -0
- package/build-types/date-time/date/test/utils.d.ts +2 -0
- package/build-types/date-time/date/test/utils.d.ts.map +1 -0
- package/build-types/date-time/date/utils.d.ts +15 -0
- package/build-types/date-time/date/utils.d.ts.map +1 -0
- package/build-types/date-time/date-time/index.d.ts +33 -0
- package/build-types/date-time/date-time/index.d.ts.map +1 -0
- package/build-types/date-time/date-time/styles.d.ts +6 -0
- package/build-types/date-time/date-time/styles.d.ts.map +1 -0
- package/build-types/date-time/index.d.ts +9 -0
- package/build-types/date-time/index.d.ts.map +1 -0
- package/build-types/date-time/stories/date-time.d.ts +14 -0
- package/build-types/date-time/stories/date-time.d.ts.map +1 -0
- package/build-types/date-time/stories/date.d.ts +14 -0
- package/build-types/date-time/stories/date.d.ts.map +1 -0
- package/build-types/date-time/stories/time.d.ts +12 -0
- package/build-types/date-time/stories/time.d.ts.map +1 -0
- package/build-types/date-time/stories/utils.d.ts +3 -0
- package/build-types/date-time/stories/utils.d.ts.map +1 -0
- package/build-types/date-time/time/index.d.ts +25 -0
- package/build-types/date-time/time/index.d.ts.map +1 -0
- package/build-types/date-time/time/styles.d.ts +111 -0
- package/build-types/date-time/time/styles.d.ts.map +1 -0
- package/build-types/date-time/time/test/index.d.ts +2 -0
- package/build-types/date-time/time/test/index.d.ts.map +1 -0
- package/build-types/date-time/time/timezone.d.ts +8 -0
- package/build-types/date-time/time/timezone.d.ts.map +1 -0
- package/build-types/date-time/types.d.ts +90 -0
- package/build-types/date-time/types.d.ts.map +1 -0
- package/build-types/disabled/index.d.ts.map +1 -1
- package/build-types/dropdown/index.d.ts.map +1 -1
- package/build-types/input-control/index.d.ts +4 -3
- package/build-types/input-control/index.d.ts.map +1 -1
- package/build-types/input-control/input-field.d.ts.map +1 -1
- package/build-types/input-control/reducer/reducer.d.ts +5 -3
- package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
- package/build-types/input-control/reducer/state.d.ts +2 -2
- package/build-types/input-control/reducer/state.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 +1 -0
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/input-control/types.d.ts +6 -0
- package/build-types/input-control/types.d.ts.map +1 -1
- package/build-types/input-control/utils.d.ts +17 -0
- package/build-types/input-control/utils.d.ts.map +1 -1
- package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
- package/build-types/popover/index.d.ts +6 -8
- package/build-types/popover/index.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/utils.d.ts.map +1 -1
- package/build-types/select-control/index.d.ts +30 -26
- package/build-types/select-control/index.d.ts.map +1 -1
- package/build-types/select-control/stories/index.d.ts +23 -0
- package/build-types/select-control/stories/index.d.ts.map +1 -0
- package/build-types/select-control/styles/select-control-styles.d.ts +3 -4
- package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
- package/build-types/select-control/test/select-control.d.ts +2 -0
- package/build-types/select-control/test/select-control.d.ts.map +1 -0
- package/build-types/select-control/types.d.ts +52 -1
- package/build-types/select-control/types.d.ts.map +1 -1
- package/build-types/surface/component.d.ts +3 -2
- package/build-types/surface/component.d.ts.map +1 -1
- package/build-types/surface/hook.d.ts +4 -4
- package/build-types/surface/hook.d.ts.map +1 -1
- package/build-types/surface/index.d.ts +2 -2
- package/build-types/surface/index.d.ts.map +1 -1
- package/build-types/surface/stories/index.d.ts +12 -0
- package/build-types/surface/stories/index.d.ts.map +1 -0
- package/build-types/surface/styles.d.ts +10 -21
- package/build-types/surface/styles.d.ts.map +1 -1
- package/build-types/surface/test/index.d.ts +2 -0
- package/build-types/{flyout/flyout → surface/test}/index.d.ts.map +1 -1
- package/build-types/surface/types.d.ts +1 -1
- package/build-types/surface/types.d.ts.map +1 -1
- package/build-types/text-control/index.d.ts +32 -0
- package/build-types/text-control/index.d.ts.map +1 -0
- package/build-types/text-control/stories/index.d.ts +13 -0
- package/build-types/text-control/stories/index.d.ts.map +1 -0
- package/build-types/text-control/types.d.ts +25 -0
- package/build-types/text-control/types.d.ts.map +1 -0
- package/build-types/textarea-control/index.d.ts +29 -0
- package/build-types/textarea-control/index.d.ts.map +1 -0
- package/build-types/textarea-control/stories/index.d.ts +12 -0
- package/build-types/textarea-control/stories/index.d.ts.map +1 -0
- package/build-types/textarea-control/styles/textarea-control-styles.d.ts +6 -0
- package/build-types/textarea-control/styles/textarea-control-styles.d.ts.map +1 -0
- package/build-types/textarea-control/types.d.ts +26 -0
- package/build-types/textarea-control/types.d.ts.map +1 -0
- 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-icon/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/component.d.ts.map +1 -1
- package/build-types/tools-panel/types.d.ts +0 -1
- package/build-types/tools-panel/types.d.ts.map +1 -1
- package/build-types/tooltip/index.d.ts.map +1 -1
- package/build-types/unit-control/index.d.ts +2 -2
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
- package/build-types/unit-control/test/index.d.ts +2 -0
- package/build-types/unit-control/test/index.d.ts.map +1 -0
- package/build-types/unit-control/test/utils.d.ts +2 -0
- package/build-types/unit-control/test/utils.d.ts.map +1 -0
- package/build-types/unit-control/types.d.ts +1 -1
- package/build-types/unit-control/types.d.ts.map +1 -1
- package/build-types/unit-control/utils.d.ts +3 -3
- package/build-types/unit-control/utils.d.ts.map +1 -1
- package/build-types/utils/hooks/index.d.ts +0 -1
- package/package.json +20 -20
- package/src/alignment-matrix-control/index.js +4 -2
- package/src/angle-picker-control/angle-circle.js +3 -3
- package/src/autocomplete/autocompleter-ui.js +1 -1
- package/src/autocomplete/autocompleter-ui.native.js +2 -2
- package/src/autocomplete/index.js +21 -9
- package/src/autocomplete/style.scss +1 -1
- package/src/border-box-control/border-box-control/README.md +10 -14
- package/src/border-box-control/border-box-control/component.tsx +21 -4
- package/src/border-box-control/border-box-control/hook.ts +2 -2
- package/src/border-box-control/border-box-control-linked-button/hook.ts +10 -6
- package/src/border-box-control/border-box-control-split-controls/component.tsx +26 -7
- package/src/border-box-control/border-box-control-split-controls/hook.ts +18 -4
- package/src/border-box-control/border-box-control-visualizer/hook.ts +14 -6
- package/src/border-box-control/stories/index.js +1 -0
- package/src/border-box-control/styles.ts +20 -9
- package/src/border-box-control/types.ts +40 -14
- package/src/border-control/border-control/README.md +0 -7
- package/src/border-control/border-control/component.tsx +4 -2
- package/src/border-control/border-control/hook.ts +13 -4
- package/src/border-control/border-control-dropdown/component.tsx +18 -11
- package/src/border-control/border-control-dropdown/hook.ts +7 -5
- package/src/border-control/stories/index.js +1 -0
- package/src/border-control/styles.ts +82 -22
- package/src/border-control/types.ts +18 -6
- package/src/box-control/README.md +0 -74
- package/src/box-control/index.js +0 -15
- package/src/box-control/stories/index.js +0 -29
- package/src/box-control/test/index.js +120 -109
- package/src/box-control/utils.js +0 -7
- package/src/button/index.js +2 -4
- package/src/button/index.native.js +33 -18
- package/src/button/test/index.js +16 -1
- package/src/button-group/index.tsx +47 -0
- package/src/button-group/stories/index.tsx +41 -0
- package/src/button-group/types.ts +11 -0
- package/src/card/types.ts +1 -1
- package/src/checkbox-control/README.md +10 -8
- package/src/checkbox-control/{index.js → index.tsx} +49 -14
- package/src/checkbox-control/stories/{index.js → index.tsx} +49 -27
- package/src/checkbox-control/test/__snapshots__/index.tsx.snap +42 -0
- package/src/checkbox-control/test/index.tsx +109 -0
- package/src/checkbox-control/types.ts +36 -0
- package/src/circular-option-picker/index.js +1 -2
- package/src/circular-option-picker/style.scss +1 -0
- package/src/color-palette/README.md +0 -1
- package/src/color-palette/index.js +17 -17
- package/src/color-palette/index.native.js +3 -0
- package/src/color-palette/stories/index.js +25 -1
- package/src/color-palette/style.scss +3 -18
- package/src/color-palette/test/__snapshots__/index.js.snap +2 -3
- package/src/color-palette/test/utils.ts +24 -0
- package/src/color-picker/color-copy-button.tsx +76 -0
- package/src/color-picker/component.tsx +18 -38
- package/src/color-picker/hex-input.tsx +16 -0
- package/src/color-picker/styles.ts +5 -1
- package/src/color-picker/types.ts +9 -0
- package/src/confirm-dialog/stories/index.js +87 -99
- package/src/custom-gradient-picker/utils.js +1 -1
- package/src/date-time/README.md +29 -10
- package/src/date-time/{datepicker.scss → date/datepicker.scss} +0 -0
- package/src/date-time/{date.js → date/index.tsx} +76 -24
- package/src/date-time/date/style.scss +75 -0
- package/src/date-time/date/styles.ts +55 -0
- package/src/date-time/date/test/index.tsx +127 -0
- package/src/date-time/{test/utils.js → date/test/utils.ts} +1 -1
- package/src/date-time/date/utils.ts +20 -0
- package/src/date-time/date-time/index.tsx +217 -0
- package/src/date-time/date-time/styles.ts +8 -0
- package/src/date-time/index.ts +9 -0
- package/src/date-time/stories/date-time.tsx +75 -0
- package/src/date-time/stories/date.tsx +73 -0
- package/src/date-time/stories/time.tsx +51 -0
- package/src/date-time/stories/utils.ts +9 -0
- package/src/date-time/style.scss +1 -262
- package/src/date-time/time/index.tsx +356 -0
- package/src/date-time/time/styles.ts +119 -0
- package/src/date-time/{test/time.js → time/test/index.tsx} +119 -57
- package/src/date-time/{timezone.js → time/timezone.tsx} +9 -5
- package/src/date-time/types.ts +104 -0
- package/src/dimension-control/test/__snapshots__/index.test.js.snap +4 -4
- package/src/disabled/index.js +5 -90
- package/src/draggable/index.native.js +226 -0
- package/src/draggable/style.native.scss +3 -0
- package/src/draggable/test/index.native.js +130 -0
- package/src/dropdown/index.js +12 -3
- package/src/dropdown/style.scss +1 -1
- package/src/focal-point-picker/index.native.js +3 -3
- package/src/form-file-upload/test/index.js +20 -13
- package/src/index.js +0 -1
- package/src/index.native.js +1 -0
- package/src/input-control/README.md +1 -1
- package/src/input-control/index.tsx +11 -4
- package/src/input-control/input-field.tsx +10 -30
- package/src/input-control/reducer/reducer.ts +40 -26
- package/src/input-control/reducer/state.ts +2 -3
- package/src/input-control/stories/index.tsx +1 -1
- package/src/input-control/styles/input-control-styles.tsx +19 -5
- package/src/input-control/types.ts +6 -0
- package/src/input-control/utils.ts +55 -1
- package/src/item-group/stories/index.js +22 -18
- package/src/menu-item/style.scss +10 -0
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -1
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/test/navigation-container.native.js +9 -2
- package/src/mobile/bottom-sheet/index.native.js +1 -1
- package/src/mobile/bottom-sheet-select-control/index.native.js +8 -2
- package/src/mobile/html-text-input/index.native.js +45 -29
- package/src/mobile/html-text-input/style.android.scss +2 -15
- package/src/mobile/html-text-input/style.ios.scss +2 -15
- package/src/mobile/html-text-input/{style-common.native.scss → style.scss} +16 -0
- package/src/mobile/keyboard-aware-flat-list/index.android.js +15 -5
- package/src/mobile/keyboard-aware-flat-list/index.ios.js +75 -46
- package/src/mobile/link-settings/test/link-settings-navigation.native.js +9 -1
- package/src/navigator/stories/index.js +16 -10
- package/src/palette-edit/index.js +37 -9
- package/src/palette-edit/style.scss +0 -7
- package/src/palette-edit/test/index.js +63 -0
- package/src/panel/README.md +1 -1
- package/src/placeholder/test/index.js +7 -0
- package/src/popover/README.md +7 -9
- package/src/popover/index.js +256 -416
- package/src/popover/style.scss +20 -190
- package/src/popover/test/__snapshots__/index.js.snap +6 -18
- package/src/query-controls/README.md +1 -1
- package/src/resizable-box/resize-tooltip/utils.ts +4 -5
- package/src/sandbox/index.native.js +1 -1
- package/src/search-control/index.js +6 -7
- package/src/select-control/README.md +13 -2
- package/src/select-control/index.tsx +36 -30
- package/src/select-control/stories/index.tsx +90 -0
- package/src/select-control/styles/select-control-styles.ts +15 -11
- package/src/select-control/test/{select-control.js → select-control.tsx} +2 -2
- package/src/select-control/types.ts +66 -1
- package/src/slot-fill/README.md +1 -1
- package/src/spacer/hook.ts +13 -13
- package/src/surface/README.md +15 -15
- package/src/surface/{component.js → component.tsx} +13 -7
- package/src/surface/{hook.js → hook.ts} +13 -12
- package/src/surface/{index.js → index.ts} +0 -0
- package/src/surface/stories/index.tsx +40 -0
- package/src/surface/{styles.js → styles.ts} +15 -44
- package/src/surface/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
- package/src/surface/test/{index.js → index.tsx} +2 -1
- package/src/surface/types.ts +1 -1
- package/src/tab-panel/style.scss +1 -1
- package/src/text-control/index.tsx +84 -0
- package/src/text-control/stories/index.tsx +66 -0
- package/src/text-control/types.ts +29 -0
- package/src/textarea-control/README.md +14 -20
- package/src/textarea-control/index.tsx +86 -0
- package/src/textarea-control/stories/index.tsx +58 -0
- package/src/textarea-control/styles/{textarea-control-styles.js → textarea-control-styles.ts} +0 -0
- package/src/textarea-control/types.ts +30 -0
- package/src/toggle-group-control/test/__snapshots__/index.js.snap +4 -10
- package/src/toggle-group-control/toggle-group-control/component.tsx +7 -3
- package/src/toggle-group-control/toggle-group-control-option-icon/component.tsx +1 -5
- package/src/tools-panel/test/__snapshots__/index.js.snap +1 -1
- package/src/tools-panel/test/index.js +71 -18
- package/src/tools-panel/tools-panel-header/component.tsx +75 -33
- package/src/tools-panel/types.ts +0 -1
- package/src/tooltip/index.js +8 -2
- package/src/tooltip/style.scss +2 -4
- package/src/tooltip/test/index.js +6 -0
- package/src/tooltip/test/index.native.js +1 -1
- package/src/unit-control/index.tsx +2 -5
- package/src/unit-control/styles/unit-control-styles.ts +3 -13
- package/src/unit-control/test/__snapshots__/index.tsx.snap +33 -0
- package/src/unit-control/test/{index.js → index.tsx} +295 -166
- package/src/unit-control/test/{utils.js → utils.ts} +38 -19
- package/src/unit-control/types.ts +4 -1
- package/src/unit-control/utils.ts +5 -3
- package/src/utils/hooks/index.js +0 -1
- package/tsconfig.json +7 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/build/box-control/visualizer.js +0 -165
- package/build/box-control/visualizer.js.map +0 -1
- package/build/color-picker/color-display.js +0 -184
- package/build/color-picker/color-display.js.map +0 -1
- package/build/date-time/date.js.map +0 -1
- package/build/date-time/time.js +0 -287
- package/build/date-time/time.js.map +0 -1
- package/build/date-time/timezone.js.map +0 -1
- package/build/date-time/utils.js.map +0 -1
- package/build/flyout/context.js +0 -23
- package/build/flyout/context.js.map +0 -1
- package/build/flyout/flyout/component.js +0 -106
- package/build/flyout/flyout/component.js.map +0 -1
- package/build/flyout/flyout/hook.js +0 -53
- package/build/flyout/flyout/hook.js.map +0 -1
- package/build/flyout/flyout/index.js +0 -24
- package/build/flyout/flyout/index.js.map +0 -1
- package/build/flyout/flyout-content/component.js +0 -65
- package/build/flyout/flyout-content/component.js.map +0 -1
- package/build/flyout/flyout-content/index.js +0 -16
- package/build/flyout/flyout-content/index.js.map +0 -1
- package/build/flyout/index.js +0 -16
- package/build/flyout/index.js.map +0 -1
- package/build/flyout/styles.js +0 -46
- package/build/flyout/styles.js.map +0 -1
- package/build/flyout/utils.js +0 -36
- package/build/flyout/utils.js.map +0 -1
- package/build/mobile/html-text-input/container.android.js +0 -41
- package/build/mobile/html-text-input/container.android.js.map +0 -1
- package/build/mobile/html-text-input/container.ios.js +0 -60
- package/build/mobile/html-text-input/container.ios.js.map +0 -1
- package/build/popover/utils.js +0 -322
- package/build/popover/utils.js.map +0 -1
- package/build/utils/hooks/use-combined-ref.js +0 -32
- package/build/utils/hooks/use-combined-ref.js.map +0 -1
- package/build-module/box-control/visualizer.js +0 -154
- package/build-module/box-control/visualizer.js.map +0 -1
- package/build-module/color-picker/color-display.js +0 -170
- package/build-module/color-picker/color-display.js.map +0 -1
- package/build-module/date-time/date.js.map +0 -1
- package/build-module/date-time/time.js +0 -269
- package/build-module/date-time/time.js.map +0 -1
- package/build-module/date-time/timezone.js.map +0 -1
- package/build-module/date-time/utils.js +0 -20
- package/build-module/date-time/utils.js.map +0 -1
- package/build-module/flyout/context.js +0 -11
- package/build-module/flyout/context.js.map +0 -1
- package/build-module/flyout/flyout/component.js +0 -89
- package/build-module/flyout/flyout/component.js.map +0 -1
- package/build-module/flyout/flyout/hook.js +0 -44
- package/build-module/flyout/flyout/hook.js.map +0 -1
- package/build-module/flyout/flyout/index.js +0 -3
- package/build-module/flyout/flyout/index.js.map +0 -1
- package/build-module/flyout/flyout-content/component.js +0 -51
- package/build-module/flyout/flyout-content/component.js.map +0 -1
- package/build-module/flyout/flyout-content/index.js +0 -2
- package/build-module/flyout/flyout-content/index.js.map +0 -1
- package/build-module/flyout/index.js +0 -2
- package/build-module/flyout/index.js.map +0 -1
- package/build-module/flyout/styles.js +0 -27
- package/build-module/flyout/styles.js.map +0 -1
- package/build-module/flyout/utils.js +0 -25
- package/build-module/flyout/utils.js.map +0 -1
- package/build-module/mobile/html-text-input/container.android.js +0 -29
- package/build-module/mobile/html-text-input/container.android.js.map +0 -1
- package/build-module/mobile/html-text-input/container.ios.js +0 -48
- package/build-module/mobile/html-text-input/container.ios.js.map +0 -1
- package/build-module/popover/utils.js +0 -308
- package/build-module/popover/utils.js.map +0 -1
- package/build-module/utils/hooks/use-combined-ref.js +0 -28
- package/build-module/utils/hooks/use-combined-ref.js.map +0 -1
- package/build-types/color-picker/color-display.d.ts +0 -14
- package/build-types/color-picker/color-display.d.ts.map +0 -1
- package/build-types/flyout/context.d.ts +0 -6
- package/build-types/flyout/context.d.ts.map +0 -1
- package/build-types/flyout/flyout/component.d.ts +0 -21
- package/build-types/flyout/flyout/component.d.ts.map +0 -1
- package/build-types/flyout/flyout/hook.d.ts +0 -270
- package/build-types/flyout/flyout/hook.d.ts.map +0 -1
- package/build-types/flyout/flyout/index.d.ts +0 -3
- package/build-types/flyout/flyout-content/component.d.ts +0 -3
- package/build-types/flyout/flyout-content/component.d.ts.map +0 -1
- package/build-types/flyout/flyout-content/index.d.ts +0 -2
- package/build-types/flyout/flyout-content/index.d.ts.map +0 -1
- package/build-types/flyout/index.d.ts +0 -2
- package/build-types/flyout/index.d.ts.map +0 -1
- package/build-types/flyout/styles.d.ts +0 -22
- package/build-types/flyout/styles.d.ts.map +0 -1
- package/build-types/flyout/types.d.ts +0 -80
- package/build-types/flyout/types.d.ts.map +0 -1
- package/build-types/flyout/utils.d.ts +0 -8
- package/build-types/flyout/utils.d.ts.map +0 -1
- package/build-types/popover/utils.d.ts +0 -70
- package/build-types/popover/utils.d.ts.map +0 -1
- package/build-types/utils/hooks/use-combined-ref.d.ts +0 -8
- package/build-types/utils/hooks/use-combined-ref.d.ts.map +0 -1
- package/src/box-control/visualizer.js +0 -116
- package/src/button-group/index.js +0 -17
- package/src/button-group/stories/index.js +0 -21
- package/src/color-picker/color-display.tsx +0 -169
- package/src/date-time/index.js +0 -170
- package/src/date-time/stories/date.js +0 -17
- package/src/date-time/stories/index.js +0 -72
- package/src/date-time/stories/time.js +0 -32
- package/src/date-time/test/date.js +0 -97
- package/src/date-time/time.js +0 -310
- package/src/date-time/utils.js +0 -18
- package/src/flyout/context.js +0 -10
- package/src/flyout/flyout/README.md +0 -98
- package/src/flyout/flyout/component.js +0 -111
- package/src/flyout/flyout/hook.js +0 -45
- package/src/flyout/flyout/index.js +0 -2
- package/src/flyout/flyout-content/component.js +0 -53
- package/src/flyout/flyout-content/index.js +0 -1
- package/src/flyout/index.js +0 -1
- package/src/flyout/stories/index.js +0 -24
- package/src/flyout/styles.ts +0 -41
- package/src/flyout/test/__snapshots__/index.js.snap +0 -186
- package/src/flyout/test/index.js +0 -103
- package/src/flyout/types.ts +0 -84
- package/src/flyout/utils.js +0 -23
- package/src/mobile/html-text-input/container.android.js +0 -23
- package/src/mobile/html-text-input/container.ios.js +0 -50
- package/src/popover/test/utils.js +0 -304
- package/src/popover/utils.js +0 -396
- package/src/select-control/stories/index.js +0 -104
- package/src/surface/stories/index.js +0 -46
- package/src/text-control/index.js +0 -72
- package/src/text-control/stories/index.js +0 -46
- package/src/textarea-control/index.js +0 -45
- package/src/textarea-control/stories/index.js +0 -48
- package/src/utils/hooks/use-combined-ref.ts +0 -28
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { useState } from '@wordpress/element';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Internal dependencies
|
|
13
|
+
*/
|
|
14
|
+
import TextControl from '..';
|
|
15
|
+
|
|
16
|
+
const meta: ComponentMeta< typeof TextControl > = {
|
|
17
|
+
component: TextControl,
|
|
18
|
+
title: 'Components/TextControl',
|
|
19
|
+
argTypes: {
|
|
20
|
+
onChange: {
|
|
21
|
+
action: 'onChange',
|
|
22
|
+
},
|
|
23
|
+
value: {
|
|
24
|
+
control: { type: null },
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
parameters: {
|
|
28
|
+
controls: {
|
|
29
|
+
expanded: true,
|
|
30
|
+
},
|
|
31
|
+
docs: { source: { state: 'open' } },
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
export default meta;
|
|
35
|
+
|
|
36
|
+
const DefaultTemplate: ComponentStory< typeof TextControl > = ( {
|
|
37
|
+
onChange,
|
|
38
|
+
...args
|
|
39
|
+
} ) => {
|
|
40
|
+
const [ value, setValue ] = useState( '' );
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<TextControl
|
|
44
|
+
{ ...args }
|
|
45
|
+
value={ value }
|
|
46
|
+
onChange={ ( v ) => {
|
|
47
|
+
setValue( v );
|
|
48
|
+
onChange( v );
|
|
49
|
+
} }
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const Default: ComponentStory<
|
|
55
|
+
typeof TextControl
|
|
56
|
+
> = DefaultTemplate.bind( {} );
|
|
57
|
+
Default.args = {};
|
|
58
|
+
|
|
59
|
+
export const WithLabelAndHelpText: ComponentStory<
|
|
60
|
+
typeof TextControl
|
|
61
|
+
> = DefaultTemplate.bind( {} );
|
|
62
|
+
WithLabelAndHelpText.args = {
|
|
63
|
+
...Default.args,
|
|
64
|
+
label: 'Label Text',
|
|
65
|
+
help: 'Help text to explain the input.',
|
|
66
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { HTMLInputTypeAttribute } from 'react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import type { BaseControlProps } from '../base-control/types';
|
|
10
|
+
|
|
11
|
+
export type TextControlProps = Pick<
|
|
12
|
+
BaseControlProps,
|
|
13
|
+
'className' | 'hideLabelFromVision' | 'help' | 'label'
|
|
14
|
+
> & {
|
|
15
|
+
/**
|
|
16
|
+
* A function that receives the value of the input.
|
|
17
|
+
*/
|
|
18
|
+
onChange: ( value: string ) => void;
|
|
19
|
+
/**
|
|
20
|
+
* The current value of the input.
|
|
21
|
+
*/
|
|
22
|
+
value: string | number;
|
|
23
|
+
/**
|
|
24
|
+
* Type of the input element to render. Defaults to "text".
|
|
25
|
+
*
|
|
26
|
+
* @default 'text'
|
|
27
|
+
*/
|
|
28
|
+
type?: HTMLInputTypeAttribute;
|
|
29
|
+
};
|
|
@@ -100,47 +100,41 @@ The set of props accepted by the component will be specified below.
|
|
|
100
100
|
|
|
101
101
|
Props not included in this set will be applied to the textarea element.
|
|
102
102
|
|
|
103
|
-
####
|
|
103
|
+
#### `help`: `string | WPElement`
|
|
104
104
|
|
|
105
|
-
If this property is added, a
|
|
105
|
+
If this property is added, a help text will be generated using help property as the content.
|
|
106
106
|
|
|
107
|
-
- Type: `String`
|
|
108
107
|
- Required: No
|
|
109
108
|
|
|
110
|
-
#### hideLabelFromVision
|
|
109
|
+
#### `hideLabelFromVision`: `boolean`
|
|
111
110
|
|
|
112
111
|
If true, the label will only be visible to screen readers.
|
|
113
112
|
|
|
114
|
-
- Type: `Boolean`
|
|
115
113
|
- Required: No
|
|
116
114
|
|
|
117
|
-
####
|
|
115
|
+
#### `label`: `string`
|
|
118
116
|
|
|
119
|
-
If this property is added, a
|
|
117
|
+
If this property is added, a label will be generated using label property as the content.
|
|
120
118
|
|
|
121
|
-
- Type: `String|WPElement`
|
|
122
119
|
- Required: No
|
|
123
120
|
|
|
124
|
-
####
|
|
121
|
+
#### `onChange`: `( value: string ) => void`
|
|
125
122
|
|
|
126
|
-
|
|
123
|
+
A function that receives the new value of the textarea each time it changes.
|
|
127
124
|
|
|
128
|
-
-
|
|
129
|
-
- Required: No
|
|
130
|
-
- Default: 4
|
|
125
|
+
- Required: Yes
|
|
131
126
|
|
|
132
|
-
####
|
|
127
|
+
#### `rows`: `number`
|
|
133
128
|
|
|
134
|
-
The
|
|
129
|
+
The number of rows the textarea should contain.
|
|
135
130
|
|
|
136
|
-
-
|
|
137
|
-
-
|
|
131
|
+
- Required: No
|
|
132
|
+
- Default: 4
|
|
138
133
|
|
|
139
|
-
####
|
|
134
|
+
#### `value`: `string`
|
|
140
135
|
|
|
141
|
-
|
|
136
|
+
The current value of the textarea.
|
|
142
137
|
|
|
143
|
-
- Type: `function`
|
|
144
138
|
- Required: Yes
|
|
145
139
|
|
|
146
140
|
## Related components
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { ChangeEvent } from 'react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { useInstanceId } from '@wordpress/compose';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Internal dependencies
|
|
13
|
+
*/
|
|
14
|
+
import BaseControl from '../base-control';
|
|
15
|
+
import { StyledTextarea } from './styles/textarea-control-styles';
|
|
16
|
+
import type { TextareaControlProps } from './types';
|
|
17
|
+
import type { WordPressComponentProps } from '../ui/context';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* TextareaControls are TextControls that allow for multiple lines of text, and
|
|
21
|
+
* wrap overflow text onto a new line. They are a fixed height and scroll
|
|
22
|
+
* vertically when the cursor reaches the bottom of the field.
|
|
23
|
+
*
|
|
24
|
+
* ```jsx
|
|
25
|
+
* import { TextareaControl } from '@wordpress/components';
|
|
26
|
+
* import { useState } from '@wordpress/element';
|
|
27
|
+
*
|
|
28
|
+
* const MyTextareaControl = () => {
|
|
29
|
+
* const [ text, setText ] = useState( '' );
|
|
30
|
+
*
|
|
31
|
+
* return (
|
|
32
|
+
* <TextareaControl
|
|
33
|
+
* label="Text"
|
|
34
|
+
* help="Enter some text"
|
|
35
|
+
* value={ text }
|
|
36
|
+
* onChange={ ( value ) => setText( value ) }
|
|
37
|
+
* />
|
|
38
|
+
* );
|
|
39
|
+
* };
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export function TextareaControl(
|
|
43
|
+
// ref is omitted until we have `WordPressComponentPropsWithoutRef` or add
|
|
44
|
+
// ref forwarding to TextareaControl.
|
|
45
|
+
props: Omit<
|
|
46
|
+
WordPressComponentProps< TextareaControlProps, 'textarea', false >,
|
|
47
|
+
'ref'
|
|
48
|
+
>
|
|
49
|
+
) {
|
|
50
|
+
const {
|
|
51
|
+
label,
|
|
52
|
+
hideLabelFromVision,
|
|
53
|
+
value,
|
|
54
|
+
help,
|
|
55
|
+
onChange,
|
|
56
|
+
rows = 4,
|
|
57
|
+
className,
|
|
58
|
+
...additionalProps
|
|
59
|
+
} = props;
|
|
60
|
+
const instanceId = useInstanceId( TextareaControl );
|
|
61
|
+
const id = `inspector-textarea-control-${ instanceId }`;
|
|
62
|
+
const onChangeValue = ( event: ChangeEvent< HTMLTextAreaElement > ) =>
|
|
63
|
+
onChange( event.target.value );
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<BaseControl
|
|
67
|
+
label={ label }
|
|
68
|
+
hideLabelFromVision={ hideLabelFromVision }
|
|
69
|
+
id={ id }
|
|
70
|
+
help={ help }
|
|
71
|
+
className={ className }
|
|
72
|
+
>
|
|
73
|
+
<StyledTextarea
|
|
74
|
+
className="components-textarea-control__input"
|
|
75
|
+
id={ id }
|
|
76
|
+
rows={ rows }
|
|
77
|
+
onChange={ onChangeValue }
|
|
78
|
+
aria-describedby={ !! help ? id + '__help' : undefined }
|
|
79
|
+
value={ value }
|
|
80
|
+
{ ...additionalProps }
|
|
81
|
+
/>
|
|
82
|
+
</BaseControl>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export default TextareaControl;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { useState } from '@wordpress/element';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Internal dependencies
|
|
13
|
+
*/
|
|
14
|
+
import TextareaControl from '..';
|
|
15
|
+
|
|
16
|
+
const meta: ComponentMeta< typeof TextareaControl > = {
|
|
17
|
+
component: TextareaControl,
|
|
18
|
+
title: 'Components/TextareaControl',
|
|
19
|
+
argTypes: {
|
|
20
|
+
onChange: { action: 'onChange' },
|
|
21
|
+
label: { control: { type: 'text' } },
|
|
22
|
+
help: { control: { type: 'text' } },
|
|
23
|
+
value: { control: { type: null } },
|
|
24
|
+
},
|
|
25
|
+
parameters: {
|
|
26
|
+
controls: {
|
|
27
|
+
expanded: true,
|
|
28
|
+
},
|
|
29
|
+
docs: { source: { state: 'open' } },
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
export default meta;
|
|
33
|
+
|
|
34
|
+
const Template: ComponentStory< typeof TextareaControl > = ( {
|
|
35
|
+
onChange,
|
|
36
|
+
...args
|
|
37
|
+
} ) => {
|
|
38
|
+
const [ value, setValue ] = useState( '' );
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<TextareaControl
|
|
42
|
+
{ ...args }
|
|
43
|
+
value={ value }
|
|
44
|
+
onChange={ ( v ) => {
|
|
45
|
+
setValue( v );
|
|
46
|
+
onChange( v );
|
|
47
|
+
} }
|
|
48
|
+
/>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const Default: ComponentStory< typeof TextareaControl > = Template.bind(
|
|
53
|
+
{}
|
|
54
|
+
);
|
|
55
|
+
Default.args = {
|
|
56
|
+
label: 'Text',
|
|
57
|
+
help: 'Enter some text',
|
|
58
|
+
};
|
package/src/textarea-control/styles/{textarea-control-styles.js → textarea-control-styles.ts}
RENAMED
|
File without changes
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { TextareaHTMLAttributes } from 'react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import type { BaseControlProps } from '../base-control/types';
|
|
10
|
+
|
|
11
|
+
export type TextareaControlProps = Pick<
|
|
12
|
+
BaseControlProps,
|
|
13
|
+
'hideLabelFromVision' | 'help' | 'label'
|
|
14
|
+
> & {
|
|
15
|
+
/**
|
|
16
|
+
* A function that receives the new value of the textarea each time it
|
|
17
|
+
* changes.
|
|
18
|
+
*/
|
|
19
|
+
onChange: ( value: string ) => void;
|
|
20
|
+
/**
|
|
21
|
+
* The current value of the textarea.
|
|
22
|
+
*/
|
|
23
|
+
value: string;
|
|
24
|
+
/**
|
|
25
|
+
* The number of rows the textarea should contain.
|
|
26
|
+
*
|
|
27
|
+
* @default 4
|
|
28
|
+
*/
|
|
29
|
+
rows?: TextareaHTMLAttributes< HTMLTextAreaElement >[ 'rows' ];
|
|
30
|
+
};
|
|
@@ -173,12 +173,9 @@ exports[`ToggleGroupControl should render correctly with icons 1`] = `
|
|
|
173
173
|
id="toggle-group-control-1"
|
|
174
174
|
role="radiogroup"
|
|
175
175
|
>
|
|
176
|
-
<
|
|
176
|
+
<div
|
|
177
177
|
aria-hidden="true"
|
|
178
|
-
|
|
179
|
-
src="about:blank"
|
|
180
|
-
style="display: block; opacity: 0; position: absolute; top: 0px; left: 0px; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"
|
|
181
|
-
tabindex="-1"
|
|
178
|
+
style="position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; pointer-events: none; opacity: 0; overflow: hidden; z-index: -1;"
|
|
182
179
|
/>
|
|
183
180
|
<div
|
|
184
181
|
class="emotion-8 emotion-9"
|
|
@@ -402,12 +399,9 @@ exports[`ToggleGroupControl should render correctly with text options 1`] = `
|
|
|
402
399
|
id="toggle-group-control-0"
|
|
403
400
|
role="radiogroup"
|
|
404
401
|
>
|
|
405
|
-
<
|
|
402
|
+
<div
|
|
406
403
|
aria-hidden="true"
|
|
407
|
-
|
|
408
|
-
src="about:blank"
|
|
409
|
-
style="display: block; opacity: 0; position: absolute; top: 0px; left: 0px; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"
|
|
410
|
-
tabindex="-1"
|
|
404
|
+
style="position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; pointer-events: none; opacity: 0; overflow: hidden; z-index: -1;"
|
|
411
405
|
/>
|
|
412
406
|
<div
|
|
413
407
|
class="emotion-8 emotion-9"
|
|
@@ -4,14 +4,18 @@
|
|
|
4
4
|
import type { ForwardedRef } from 'react';
|
|
5
5
|
// eslint-disable-next-line no-restricted-imports
|
|
6
6
|
import { RadioGroup, useRadioState } from 'reakit';
|
|
7
|
-
import useResizeAware from 'react-resize-aware';
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* WordPress dependencies
|
|
11
10
|
*/
|
|
12
11
|
import { __ } from '@wordpress/i18n';
|
|
13
12
|
import { useRef, useMemo } from '@wordpress/element';
|
|
14
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
useMergeRefs,
|
|
15
|
+
useInstanceId,
|
|
16
|
+
usePrevious,
|
|
17
|
+
useResizeObserver,
|
|
18
|
+
} from '@wordpress/compose';
|
|
15
19
|
|
|
16
20
|
/**
|
|
17
21
|
* Internal dependencies
|
|
@@ -49,7 +53,7 @@ function ToggleGroupControl(
|
|
|
49
53
|
} = useContextSystem( props, 'ToggleGroupControl' );
|
|
50
54
|
const cx = useCx();
|
|
51
55
|
const containerRef = useRef();
|
|
52
|
-
const [ resizeListener, sizes ] =
|
|
56
|
+
const [ resizeListener, sizes ] = useResizeObserver();
|
|
53
57
|
const baseId = useInstanceId(
|
|
54
58
|
ToggleGroupControl,
|
|
55
59
|
'toggle-group-control'
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { Icon } from '@wordpress/icons';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* Internal dependencies
|
|
8
3
|
*/
|
|
9
4
|
import type { WordPressComponentProps } from '../../ui/context';
|
|
10
5
|
import type { ToggleGroupControlOptionIconProps } from '../types';
|
|
11
6
|
import { ToggleGroupControlOptionBase } from '../toggle-group-control-option-base';
|
|
7
|
+
import Icon from '../../icon';
|
|
12
8
|
|
|
13
9
|
export default function ToggleGroupControlOptionIcon(
|
|
14
10
|
props: WordPressComponentProps<
|
|
@@ -167,7 +167,7 @@ exports[`ToolsPanel first and last panel items should apply first/last classes t
|
|
|
167
167
|
<button
|
|
168
168
|
aria-expanded="false"
|
|
169
169
|
aria-haspopup="true"
|
|
170
|
-
aria-label="
|
|
170
|
+
aria-label="Panel header options"
|
|
171
171
|
class="components-button components-dropdown-menu__toggle is-small has-icon"
|
|
172
172
|
type="button"
|
|
173
173
|
>
|
|
@@ -161,7 +161,7 @@ const renderPanel = () => {
|
|
|
161
161
|
*/
|
|
162
162
|
const getMenuButton = () => {
|
|
163
163
|
return screen.getByRole( 'button', {
|
|
164
|
-
name: /
|
|
164
|
+
name: /Panel([\w\s]+)header([\w\s]+)options/i,
|
|
165
165
|
} );
|
|
166
166
|
};
|
|
167
167
|
|
|
@@ -178,7 +178,6 @@ const openDropdownMenu = () => {
|
|
|
178
178
|
|
|
179
179
|
// Opens dropdown then selects the menu item by label before simulating a click.
|
|
180
180
|
const selectMenuItem = async ( label ) => {
|
|
181
|
-
openDropdownMenu();
|
|
182
181
|
const menuItem = await screen.findByText( label );
|
|
183
182
|
fireEvent.click( menuItem );
|
|
184
183
|
};
|
|
@@ -289,18 +288,30 @@ describe( 'ToolsPanel', () => {
|
|
|
289
288
|
|
|
290
289
|
it( 'should render panel item when corresponding menu item is selected', async () => {
|
|
291
290
|
renderPanel();
|
|
291
|
+
await openDropdownMenu();
|
|
292
292
|
await selectMenuItem( altControlProps.label );
|
|
293
293
|
const control = await screen.findByText( 'Alt control' );
|
|
294
294
|
|
|
295
295
|
expect( control ).toBeInTheDocument();
|
|
296
|
+
|
|
297
|
+
// Test the aria live announcement.
|
|
298
|
+
const announcement = await screen.getByText( 'Alt is now visible' );
|
|
299
|
+
expect( announcement ).toHaveAttribute( 'aria-live', 'assertive' );
|
|
296
300
|
} );
|
|
297
301
|
|
|
298
302
|
it( 'should prevent optional panel item rendering when toggled off via menu item', async () => {
|
|
299
303
|
renderPanel();
|
|
304
|
+
await openDropdownMenu();
|
|
300
305
|
await selectMenuItem( controlProps.label );
|
|
301
306
|
const control = screen.queryByText( 'Example control' );
|
|
302
307
|
|
|
303
308
|
expect( control ).not.toBeInTheDocument();
|
|
309
|
+
|
|
310
|
+
// Test the aria live announcement.
|
|
311
|
+
const announcement = await screen.getByText(
|
|
312
|
+
'Example hidden and reset to default'
|
|
313
|
+
);
|
|
314
|
+
expect( announcement ).toHaveAttribute( 'aria-live', 'assertive' );
|
|
304
315
|
} );
|
|
305
316
|
|
|
306
317
|
it( 'should continue to render shown by default item after it is toggled off via menu item', async () => {
|
|
@@ -319,10 +330,17 @@ describe( 'ToolsPanel', () => {
|
|
|
319
330
|
|
|
320
331
|
expect( control ).toBeInTheDocument();
|
|
321
332
|
|
|
333
|
+
await openDropdownMenu();
|
|
322
334
|
await selectMenuItem( controlProps.label );
|
|
323
335
|
const resetControl = screen.getByText( 'Default control' );
|
|
324
336
|
|
|
325
337
|
expect( resetControl ).toBeInTheDocument();
|
|
338
|
+
|
|
339
|
+
// Test the aria live announcement.
|
|
340
|
+
const announcement = await screen.getByText(
|
|
341
|
+
'Example reset to default'
|
|
342
|
+
);
|
|
343
|
+
expect( announcement ).toHaveAttribute( 'aria-live', 'assertive' );
|
|
326
344
|
} );
|
|
327
345
|
|
|
328
346
|
it( 'should render appropriate menu groups', async () => {
|
|
@@ -657,6 +675,8 @@ describe( 'ToolsPanel', () => {
|
|
|
657
675
|
|
|
658
676
|
it( 'should call onDeselect callback when menu item is toggled off', async () => {
|
|
659
677
|
renderPanel();
|
|
678
|
+
|
|
679
|
+
await openDropdownMenu();
|
|
660
680
|
await selectMenuItem( controlProps.label );
|
|
661
681
|
|
|
662
682
|
expect( controlProps.onSelect ).not.toHaveBeenCalled();
|
|
@@ -665,6 +685,8 @@ describe( 'ToolsPanel', () => {
|
|
|
665
685
|
|
|
666
686
|
it( 'should call onSelect callback when menu item is toggled on', async () => {
|
|
667
687
|
renderPanel();
|
|
688
|
+
|
|
689
|
+
await openDropdownMenu();
|
|
668
690
|
await selectMenuItem( altControlProps.label );
|
|
669
691
|
|
|
670
692
|
expect( altControlProps.onSelect ).toHaveBeenCalledTimes( 1 );
|
|
@@ -673,6 +695,8 @@ describe( 'ToolsPanel', () => {
|
|
|
673
695
|
|
|
674
696
|
it( 'should call resetAll callback when its menu item is selected', async () => {
|
|
675
697
|
renderPanel();
|
|
698
|
+
|
|
699
|
+
await openDropdownMenu();
|
|
676
700
|
await selectMenuItem( 'Reset all' );
|
|
677
701
|
|
|
678
702
|
expect( resetAll ).toHaveBeenCalledTimes( 1 );
|
|
@@ -688,6 +712,7 @@ describe( 'ToolsPanel', () => {
|
|
|
688
712
|
it( 'should call onDeselect after previous reset all', async () => {
|
|
689
713
|
renderPanel();
|
|
690
714
|
|
|
715
|
+
await openDropdownMenu();
|
|
691
716
|
await selectMenuItem( 'Reset all' ); // Initial control is displayed by default.
|
|
692
717
|
await selectMenuItem( controlProps.label ); // Re-display control.
|
|
693
718
|
|
|
@@ -715,9 +740,8 @@ describe( 'ToolsPanel', () => {
|
|
|
715
740
|
openDropdownMenu();
|
|
716
741
|
|
|
717
742
|
const defaultItem = screen.getByText( 'Nested Control 1' );
|
|
718
|
-
const defaultMenuItem = screen.getByRole( '
|
|
743
|
+
const defaultMenuItem = screen.getByRole( 'menuitem', {
|
|
719
744
|
name: 'Reset Nested Control 1',
|
|
720
|
-
checked: true,
|
|
721
745
|
} );
|
|
722
746
|
|
|
723
747
|
const altItem = screen.getByText( 'Nested Control 2' );
|
|
@@ -754,9 +778,8 @@ describe( 'ToolsPanel', () => {
|
|
|
754
778
|
openDropdownMenu();
|
|
755
779
|
|
|
756
780
|
const defaultItem = screen.getByText( 'Nested Control 1' );
|
|
757
|
-
const defaultMenuItem = screen.getByRole( '
|
|
781
|
+
const defaultMenuItem = screen.getByRole( 'menuitem', {
|
|
758
782
|
name: 'Reset Nested Control 1',
|
|
759
|
-
checked: true,
|
|
760
783
|
} );
|
|
761
784
|
|
|
762
785
|
const altItem = screen.getByText( 'Nested Control 2' );
|
|
@@ -807,6 +830,7 @@ describe( 'ToolsPanel', () => {
|
|
|
807
830
|
expect( secondItem ).toBeInTheDocument();
|
|
808
831
|
|
|
809
832
|
// Toggle on the first item.
|
|
833
|
+
await openDropdownMenu();
|
|
810
834
|
await selectMenuItem( altControlProps.label );
|
|
811
835
|
|
|
812
836
|
// The order of items should be as per their original source order.
|
|
@@ -964,7 +988,7 @@ describe( 'ToolsPanel', () => {
|
|
|
964
988
|
isShownByDefault: false,
|
|
965
989
|
};
|
|
966
990
|
|
|
967
|
-
it( 'should render appropriate
|
|
991
|
+
it( 'should render appropriate labels and descriptions for the dropdown menu where there are default controls', async () => {
|
|
968
992
|
render(
|
|
969
993
|
<ToolsPanel { ...defaultProps }>
|
|
970
994
|
<ToolsPanelItem { ...defaultControls }>
|
|
@@ -977,13 +1001,18 @@ describe( 'ToolsPanel', () => {
|
|
|
977
1001
|
);
|
|
978
1002
|
|
|
979
1003
|
const optionsDisplayedIcon = screen.getByRole( 'button', {
|
|
980
|
-
name: '
|
|
1004
|
+
name: 'Panel header options',
|
|
981
1005
|
} );
|
|
982
1006
|
|
|
983
1007
|
expect( optionsDisplayedIcon ).toBeInTheDocument();
|
|
1008
|
+
|
|
1009
|
+
// The dropdown toggle doesn't have a description when an option is displayed.
|
|
1010
|
+
// In this case the default control is displayed.
|
|
1011
|
+
expect( optionsDisplayedIcon ).not.toHaveAccessibleDescription();
|
|
984
1012
|
} );
|
|
985
1013
|
|
|
986
|
-
it( 'should render appropriate
|
|
1014
|
+
it( 'should render appropriate labels and descriptions for the dropdown menu where there are no default controls', async () => {
|
|
1015
|
+
// All options are inactive.
|
|
987
1016
|
render(
|
|
988
1017
|
<ToolsPanel { ...defaultProps }>
|
|
989
1018
|
<ToolsPanelItem { ...optionalControls }>
|
|
@@ -992,25 +1021,49 @@ describe( 'ToolsPanel', () => {
|
|
|
992
1021
|
</ToolsPanel>
|
|
993
1022
|
);
|
|
994
1023
|
|
|
995
|
-
// There are unactivated, optional menu items in the Tools Panel dropdown.
|
|
996
1024
|
const optionsHiddenIcon = screen.getByRole( 'button', {
|
|
997
|
-
name: '
|
|
1025
|
+
name: 'Panel header options',
|
|
998
1026
|
} );
|
|
999
1027
|
|
|
1028
|
+
// The dropdown toggle has a description indicating that all options are hidden.
|
|
1000
1029
|
expect( optionsHiddenIcon ).toBeInTheDocument();
|
|
1030
|
+
expect( optionsHiddenIcon ).toHaveAccessibleDescription(
|
|
1031
|
+
'All options are currently hidden'
|
|
1032
|
+
);
|
|
1001
1033
|
|
|
1034
|
+
// Activate one of the options.
|
|
1035
|
+
await openDropdownMenu();
|
|
1002
1036
|
await selectMenuItem( optionalControls.label );
|
|
1003
1037
|
|
|
1004
|
-
// There are now NO unactivated, optional menu items in the Tools Panel dropdown.
|
|
1005
|
-
expect(
|
|
1006
|
-
screen.queryByRole( 'button', { name: 'View and add options' } )
|
|
1007
|
-
).not.toBeInTheDocument();
|
|
1008
|
-
|
|
1009
1038
|
const optionsDisplayedIcon = screen.getByRole( 'button', {
|
|
1010
|
-
name: '
|
|
1039
|
+
name: 'Panel header options',
|
|
1011
1040
|
} );
|
|
1012
1041
|
|
|
1013
|
-
|
|
1042
|
+
// The dropdown toggle no longer has a description.
|
|
1043
|
+
expect( optionsDisplayedIcon ).not.toHaveAccessibleDescription();
|
|
1044
|
+
} );
|
|
1045
|
+
} );
|
|
1046
|
+
|
|
1047
|
+
describe( 'reset all button', () => {
|
|
1048
|
+
it( "should disable the reset all button when there's nothing to reset", async () => {
|
|
1049
|
+
await renderPanel();
|
|
1050
|
+
await openDropdownMenu();
|
|
1051
|
+
|
|
1052
|
+
const resetAllItem = await screen.findByRole( 'menuitem', {
|
|
1053
|
+
disabled: false,
|
|
1054
|
+
} );
|
|
1055
|
+
expect( resetAllItem ).toBeInTheDocument();
|
|
1056
|
+
|
|
1057
|
+
await selectMenuItem( 'Reset all' );
|
|
1058
|
+
|
|
1059
|
+
// Test the aria live announcement.
|
|
1060
|
+
const announcement = await screen.getByText( 'All options reset' );
|
|
1061
|
+
expect( announcement ).toHaveAttribute( 'aria-live', 'assertive' );
|
|
1062
|
+
|
|
1063
|
+
const disabledResetAllItem = await screen.findByRole( 'menuitem', {
|
|
1064
|
+
disabled: true,
|
|
1065
|
+
} );
|
|
1066
|
+
expect( disabledResetAllItem ).toBeInTheDocument();
|
|
1014
1067
|
} );
|
|
1015
1068
|
} );
|
|
1016
1069
|
|