@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
|
@@ -43,7 +43,10 @@ const meta = {
|
|
|
43
43
|
export default meta;
|
|
44
44
|
|
|
45
45
|
const Template = ( args ) => {
|
|
46
|
-
const
|
|
46
|
+
const firstColor =
|
|
47
|
+
args.colors[ 0 ].color || args.colors[ 0 ].colors[ 0 ].color;
|
|
48
|
+
const [ color, setColor ] = useState( firstColor );
|
|
49
|
+
|
|
47
50
|
return (
|
|
48
51
|
<SlotFillProvider>
|
|
49
52
|
<ColorPalette { ...args } value={ color } onChange={ setColor } />
|
|
@@ -88,3 +91,24 @@ MultipleOrigins.args = {
|
|
|
88
91
|
},
|
|
89
92
|
],
|
|
90
93
|
};
|
|
94
|
+
|
|
95
|
+
export const CSSVariables = ( args ) => {
|
|
96
|
+
return (
|
|
97
|
+
<div
|
|
98
|
+
style={ {
|
|
99
|
+
'--red': '#f00',
|
|
100
|
+
'--yellow': '#ff0',
|
|
101
|
+
'--blue': '#00f',
|
|
102
|
+
} }
|
|
103
|
+
>
|
|
104
|
+
<Template { ...args } />
|
|
105
|
+
</div>
|
|
106
|
+
);
|
|
107
|
+
};
|
|
108
|
+
CSSVariables.args = {
|
|
109
|
+
colors: [
|
|
110
|
+
{ name: 'Red', color: 'var(--red)' },
|
|
111
|
+
{ name: 'Yellow', color: 'var(--yellow)' },
|
|
112
|
+
{ name: 'Blue', color: 'var(--blue)' },
|
|
113
|
+
],
|
|
114
|
+
};
|
|
@@ -30,31 +30,16 @@
|
|
|
30
30
|
overflow: visible;
|
|
31
31
|
box-shadow: 0 4px 4px rgba(0, 0, 0, 0.05);
|
|
32
32
|
border: none;
|
|
33
|
+
outline: none;
|
|
33
34
|
border-radius: $radius-block-ui;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
padding: 0;
|
|
37
|
-
}
|
|
35
|
+
padding: 0;
|
|
36
|
+
|
|
38
37
|
.react-colorful__saturation {
|
|
39
38
|
border-top-right-radius: $radius-block-ui;
|
|
40
39
|
border-top-left-radius: $radius-block-ui;
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
42
|
|
|
44
|
-
@include break-medium() {
|
|
45
|
-
.components-dropdown__content.components-color-palette__custom-color-dropdown-content.is-rendered-in-sidebar {
|
|
46
|
-
.components-popover__content.components-popover__content {
|
|
47
|
-
margin-right: #{ math.div($sidebar-width, 2) + $grid-unit-20 };
|
|
48
|
-
}
|
|
49
|
-
&.is-from-top .components-popover__content {
|
|
50
|
-
margin-top: #{ -($grid-unit-60 + $grid-unit-15) };
|
|
51
|
-
}
|
|
52
|
-
&.is-from-bottom .components-popover__content {
|
|
53
|
-
margin-bottom: #{ -($grid-unit-60 + $grid-unit-15) };
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
43
|
.components-color-palette__custom-color-name {
|
|
59
44
|
text-align: left;
|
|
60
45
|
}
|
|
@@ -1186,13 +1186,12 @@ exports[`ColorPalette should render a dynamic toolbar of colors 1`] = `
|
|
|
1186
1186
|
>
|
|
1187
1187
|
<ForwardRef(Button)
|
|
1188
1188
|
className="components-circular-option-picker__clear"
|
|
1189
|
-
isSmall={true}
|
|
1190
1189
|
onClick={[Function]}
|
|
1191
|
-
variant="
|
|
1190
|
+
variant="tertiary"
|
|
1192
1191
|
>
|
|
1193
1192
|
<button
|
|
1194
1193
|
aria-describedby={null}
|
|
1195
|
-
className="components-button components-circular-option-picker__clear is-
|
|
1194
|
+
className="components-button components-circular-option-picker__clear is-tertiary"
|
|
1196
1195
|
onClick={[Function]}
|
|
1197
1196
|
type="button"
|
|
1198
1197
|
>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { extractColorNameFromCurrentValue } from '../';
|
|
5
|
+
|
|
6
|
+
describe( 'ColorPalette: Utils', () => {
|
|
7
|
+
describe( 'extractColorNameFromCurrentValue', () => {
|
|
8
|
+
test( 'should support hex values', () => {
|
|
9
|
+
const result = extractColorNameFromCurrentValue( '#00f', [
|
|
10
|
+
{ name: 'Red', color: '#f00' },
|
|
11
|
+
{ name: 'Blue', color: '#00f' },
|
|
12
|
+
] );
|
|
13
|
+
expect( result ).toBe( 'Blue' );
|
|
14
|
+
} );
|
|
15
|
+
|
|
16
|
+
test( 'should support CSS variables', () => {
|
|
17
|
+
const result = extractColorNameFromCurrentValue( 'var(--blue)', [
|
|
18
|
+
{ name: 'Red', color: 'var(--red)' },
|
|
19
|
+
{ name: 'Blue', color: 'var(--blue)' },
|
|
20
|
+
] );
|
|
21
|
+
expect( result ).toBe( 'Blue' );
|
|
22
|
+
} );
|
|
23
|
+
} );
|
|
24
|
+
} );
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useCopyToClipboard } from '@wordpress/compose';
|
|
5
|
+
import { useState, useEffect, useRef } from '@wordpress/element';
|
|
6
|
+
import { copy } from '@wordpress/icons';
|
|
7
|
+
import { __ } from '@wordpress/i18n';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Internal dependencies
|
|
11
|
+
*/
|
|
12
|
+
import { CopyButton } from './styles';
|
|
13
|
+
import { Text } from '../text';
|
|
14
|
+
import { Tooltip } from '../ui/tooltip';
|
|
15
|
+
|
|
16
|
+
import type { ColorCopyButtonProps } from './types';
|
|
17
|
+
|
|
18
|
+
export const ColorCopyButton = ( props: ColorCopyButtonProps ) => {
|
|
19
|
+
const { color, colorType } = props;
|
|
20
|
+
const [ copiedColor, setCopiedColor ] = useState< string | null >( null );
|
|
21
|
+
const copyTimer = useRef< ReturnType< typeof setTimeout > | undefined >();
|
|
22
|
+
const copyRef = useCopyToClipboard< HTMLDivElement >(
|
|
23
|
+
() => {
|
|
24
|
+
switch ( colorType ) {
|
|
25
|
+
case 'hsl': {
|
|
26
|
+
return color.toHslString();
|
|
27
|
+
}
|
|
28
|
+
case 'rgb': {
|
|
29
|
+
return color.toRgbString();
|
|
30
|
+
}
|
|
31
|
+
default:
|
|
32
|
+
case 'hex': {
|
|
33
|
+
return color.toHex();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
() => {
|
|
38
|
+
if ( copyTimer.current ) {
|
|
39
|
+
clearTimeout( copyTimer.current );
|
|
40
|
+
}
|
|
41
|
+
setCopiedColor( color.toHex() );
|
|
42
|
+
copyTimer.current = setTimeout( () => {
|
|
43
|
+
setCopiedColor( null );
|
|
44
|
+
copyTimer.current = undefined;
|
|
45
|
+
}, 3000 );
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
useEffect( () => {
|
|
49
|
+
// Clear copyTimer on component unmount.
|
|
50
|
+
return () => {
|
|
51
|
+
if ( copyTimer.current ) {
|
|
52
|
+
clearTimeout( copyTimer.current );
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}, [] );
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<Tooltip
|
|
59
|
+
content={
|
|
60
|
+
<Text color="white">
|
|
61
|
+
{ copiedColor === color.toHex()
|
|
62
|
+
? __( 'Copied!' )
|
|
63
|
+
: __( 'Copy' ) }
|
|
64
|
+
</Text>
|
|
65
|
+
}
|
|
66
|
+
placement="bottom"
|
|
67
|
+
>
|
|
68
|
+
<CopyButton
|
|
69
|
+
isSmall
|
|
70
|
+
ref={ copyRef }
|
|
71
|
+
icon={ copy }
|
|
72
|
+
showTooltip={ false }
|
|
73
|
+
/>
|
|
74
|
+
</Tooltip>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
@@ -9,7 +9,6 @@ import namesPlugin from 'colord/plugins/names';
|
|
|
9
9
|
* WordPress dependencies
|
|
10
10
|
*/
|
|
11
11
|
import { useCallback, useState, useMemo } from '@wordpress/element';
|
|
12
|
-
import { settings } from '@wordpress/icons';
|
|
13
12
|
import { useDebounce } from '@wordpress/compose';
|
|
14
13
|
import { __ } from '@wordpress/i18n';
|
|
15
14
|
|
|
@@ -27,9 +26,8 @@ import {
|
|
|
27
26
|
ColorfulWrapper,
|
|
28
27
|
SelectControl,
|
|
29
28
|
AuxiliaryColorArtefactWrapper,
|
|
30
|
-
DetailsControlButton,
|
|
31
29
|
} from './styles';
|
|
32
|
-
import {
|
|
30
|
+
import { ColorCopyButton } from './color-copy-button';
|
|
33
31
|
import { ColorInput } from './color-input';
|
|
34
32
|
import { Picker } from './picker';
|
|
35
33
|
import { useControlledValue } from '../utils/hooks';
|
|
@@ -85,7 +83,6 @@ const ColorPicker = (
|
|
|
85
83
|
[ debouncedSetColor ]
|
|
86
84
|
);
|
|
87
85
|
|
|
88
|
-
const [ showInputs, setShowInputs ] = useState< boolean >( false );
|
|
89
86
|
const [ colorType, setColorType ] = useState< ColorType >(
|
|
90
87
|
copyFormat || 'hex'
|
|
91
88
|
);
|
|
@@ -99,44 +96,27 @@ const ColorPicker = (
|
|
|
99
96
|
/>
|
|
100
97
|
<AuxiliaryColorArtefactWrapper>
|
|
101
98
|
<HStack justify="space-between">
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
setColorType( nextColorType as ColorType )
|
|
108
|
-
}
|
|
109
|
-
label={ __( 'Color format' ) }
|
|
110
|
-
hideLabelFromVision
|
|
111
|
-
/>
|
|
112
|
-
) : (
|
|
113
|
-
<ColorDisplay
|
|
114
|
-
color={ safeColordColor }
|
|
115
|
-
colorType={ copyFormat || colorType }
|
|
116
|
-
enableAlpha={ enableAlpha }
|
|
117
|
-
/>
|
|
118
|
-
) }
|
|
119
|
-
<DetailsControlButton
|
|
120
|
-
isSmall
|
|
121
|
-
onClick={ () => setShowInputs( ! showInputs ) }
|
|
122
|
-
icon={ settings }
|
|
123
|
-
isPressed={ showInputs }
|
|
124
|
-
label={
|
|
125
|
-
showInputs
|
|
126
|
-
? __( 'Hide detailed inputs' )
|
|
127
|
-
: __( 'Show detailed inputs' )
|
|
99
|
+
<SelectControl
|
|
100
|
+
options={ options }
|
|
101
|
+
value={ colorType }
|
|
102
|
+
onChange={ ( nextColorType ) =>
|
|
103
|
+
setColorType( nextColorType as ColorType )
|
|
128
104
|
}
|
|
105
|
+
label={ __( 'Color format' ) }
|
|
106
|
+
hideLabelFromVision
|
|
129
107
|
/>
|
|
130
|
-
|
|
131
|
-
<Spacer margin={ 4 } />
|
|
132
|
-
{ showInputs && (
|
|
133
|
-
<ColorInput
|
|
134
|
-
colorType={ colorType }
|
|
108
|
+
<ColorCopyButton
|
|
135
109
|
color={ safeColordColor }
|
|
136
|
-
|
|
137
|
-
enableAlpha={ enableAlpha }
|
|
110
|
+
colorType={ copyFormat || colorType }
|
|
138
111
|
/>
|
|
139
|
-
|
|
112
|
+
</HStack>
|
|
113
|
+
<Spacer margin={ 4 } />
|
|
114
|
+
<ColorInput
|
|
115
|
+
colorType={ colorType }
|
|
116
|
+
color={ safeColordColor }
|
|
117
|
+
onChange={ handleChange }
|
|
118
|
+
enableAlpha={ enableAlpha }
|
|
119
|
+
/>
|
|
140
120
|
</AuxiliaryColorArtefactWrapper>
|
|
141
121
|
</ColorfulWrapper>
|
|
142
122
|
);
|
|
@@ -16,6 +16,7 @@ import { Spacer } from '../spacer';
|
|
|
16
16
|
import { space } from '../ui/utils/space';
|
|
17
17
|
import { ColorHexInputControl } from './styles';
|
|
18
18
|
import { COLORS } from '../utils/colors-values';
|
|
19
|
+
import type { StateReducer } from '../input-control/reducer/state';
|
|
19
20
|
|
|
20
21
|
interface HexInputProps {
|
|
21
22
|
color: Colord;
|
|
@@ -33,6 +34,20 @@ export const HexInput = ( { color, onChange, enableAlpha }: HexInputProps ) => {
|
|
|
33
34
|
onChange( colord( hexValue ) );
|
|
34
35
|
};
|
|
35
36
|
|
|
37
|
+
const stateReducer: StateReducer = ( state, action ) => {
|
|
38
|
+
const nativeEvent = action.payload?.event?.nativeEvent as InputEvent;
|
|
39
|
+
|
|
40
|
+
if ( 'insertFromPaste' !== nativeEvent?.inputType ) {
|
|
41
|
+
return { ...state };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const value = state.value?.startsWith( '#' )
|
|
45
|
+
? state.value.slice( 1 ).toUpperCase()
|
|
46
|
+
: state.value?.toUpperCase();
|
|
47
|
+
|
|
48
|
+
return { ...state, value };
|
|
49
|
+
};
|
|
50
|
+
|
|
36
51
|
return (
|
|
37
52
|
<ColorHexInputControl
|
|
38
53
|
prefix={
|
|
@@ -50,6 +65,7 @@ export const HexInput = ( { color, onChange, enableAlpha }: HexInputProps ) => {
|
|
|
50
65
|
maxLength={ enableAlpha ? 9 : 7 }
|
|
51
66
|
label={ __( 'Hex color' ) }
|
|
52
67
|
hideLabelFromVision
|
|
68
|
+
__unstableStateReducer={ stateReducer }
|
|
53
69
|
/>
|
|
54
70
|
);
|
|
55
71
|
};
|
|
@@ -111,10 +111,14 @@ export const ColorfulWrapper = styled.div`
|
|
|
111
111
|
${ inputHeightStyle }
|
|
112
112
|
`;
|
|
113
113
|
|
|
114
|
-
export const
|
|
114
|
+
export const CopyButton = styled( Button )`
|
|
115
115
|
&&&&& {
|
|
116
116
|
min-width: ${ space( 6 ) };
|
|
117
117
|
padding: 0;
|
|
118
|
+
|
|
119
|
+
> svg {
|
|
120
|
+
margin-right: 0;
|
|
121
|
+
}
|
|
118
122
|
}
|
|
119
123
|
`;
|
|
120
124
|
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { text } from '@storybook/addon-knobs';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -15,102 +10,42 @@ import Button from '../../button';
|
|
|
15
10
|
import { Heading } from '../../heading';
|
|
16
11
|
import { ConfirmDialog } from '..';
|
|
17
12
|
|
|
18
|
-
|
|
13
|
+
const meta = {
|
|
19
14
|
component: ConfirmDialog,
|
|
20
15
|
title: 'Components (Experimental)/ConfirmDialog',
|
|
16
|
+
argTypes: {
|
|
17
|
+
children: {
|
|
18
|
+
control: { type: 'text' },
|
|
19
|
+
},
|
|
20
|
+
confirmButtonText: {
|
|
21
|
+
control: { type: 'text' },
|
|
22
|
+
},
|
|
23
|
+
cancelButtonText: {
|
|
24
|
+
control: { type: 'text' },
|
|
25
|
+
},
|
|
26
|
+
isOpen: {
|
|
27
|
+
control: { type: null },
|
|
28
|
+
},
|
|
29
|
+
onConfirm: {
|
|
30
|
+
control: { type: null },
|
|
31
|
+
},
|
|
32
|
+
onCancel: {
|
|
33
|
+
control: { type: null },
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
args: {
|
|
37
|
+
children: 'Would you like to privately publish the post now?',
|
|
38
|
+
},
|
|
21
39
|
parameters: {
|
|
22
|
-
|
|
40
|
+
docs: { source: { state: 'open' } },
|
|
23
41
|
},
|
|
24
42
|
};
|
|
25
43
|
|
|
26
|
-
|
|
27
|
-
text( 'message', 'Would you like to privately publish the post now?' );
|
|
28
|
-
const daCancelText = () => text( 'cancel button', 'No thanks' );
|
|
29
|
-
const daConfirmText = () => text( 'confirm button', 'Yes please!' );
|
|
30
|
-
|
|
31
|
-
// Simplest usage: just declare the component with the required `onConfirm` prop.
|
|
32
|
-
export const _default = () => {
|
|
33
|
-
const [ confirmVal, setConfirmVal ] = useState( "Hasn't confirmed yet" );
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<>
|
|
37
|
-
<ConfirmDialog onConfirm={ () => setConfirmVal( 'Confirmed!' ) }>
|
|
38
|
-
{ daText() }
|
|
39
|
-
</ConfirmDialog>
|
|
40
|
-
<Heading level={ 1 }>{ confirmVal }</Heading>
|
|
41
|
-
</>
|
|
42
|
-
);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export const WithCustomButtonLabels = () => {
|
|
46
|
-
const [ confirmVal, setConfirmVal ] = useState( "Hasn't confirmed yet" );
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<>
|
|
50
|
-
<ConfirmDialog
|
|
51
|
-
onConfirm={ () => setConfirmVal( 'Confirmed!' ) }
|
|
52
|
-
cancelButtonText={ daCancelText() }
|
|
53
|
-
confirmButtonText={ daConfirmText() }
|
|
54
|
-
>
|
|
55
|
-
{ daText() }
|
|
56
|
-
</ConfirmDialog>
|
|
57
|
-
<Heading level={ 1 }>{ confirmVal }</Heading>
|
|
58
|
-
</>
|
|
59
|
-
);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export const WithJSXMessage = () => {
|
|
63
|
-
const [ confirmVal, setConfirmVal ] = useState( "Hasn't confirmed yet" );
|
|
64
|
-
|
|
65
|
-
return (
|
|
66
|
-
<>
|
|
67
|
-
<ConfirmDialog onConfirm={ () => setConfirmVal( 'Confirmed!' ) }>
|
|
68
|
-
<Heading level={ 2 }>{ daText() }</Heading>
|
|
69
|
-
</ConfirmDialog>
|
|
70
|
-
<Heading level={ 1 }>{ confirmVal }</Heading>
|
|
71
|
-
</>
|
|
72
|
-
);
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export const VeeeryLongMessage = () => {
|
|
76
|
-
const [ confirmVal, setConfirmVal ] = useState( "Hasn't confirmed yet" );
|
|
44
|
+
export default meta;
|
|
77
45
|
|
|
78
|
-
|
|
79
|
-
<>
|
|
80
|
-
<ConfirmDialog onConfirm={ () => setConfirmVal( 'Confirmed!' ) }>
|
|
81
|
-
{ daText().repeat( 20 ) }
|
|
82
|
-
</ConfirmDialog>
|
|
83
|
-
<Heading level={ 1 }>{ confirmVal }</Heading>
|
|
84
|
-
</>
|
|
85
|
-
);
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
export const UncontrolledAndWithExplicitOnCancel = () => {
|
|
89
|
-
const [ confirmVal, setConfirmVal ] = useState(
|
|
90
|
-
"Hasn't confirmed or cancelled yet"
|
|
91
|
-
);
|
|
92
|
-
|
|
93
|
-
return (
|
|
94
|
-
<>
|
|
95
|
-
<ConfirmDialog
|
|
96
|
-
onConfirm={ () => setConfirmVal( 'Confirmed!' ) }
|
|
97
|
-
onCancel={ () => setConfirmVal( 'Cancelled' ) }
|
|
98
|
-
>
|
|
99
|
-
{ daText() }
|
|
100
|
-
</ConfirmDialog>
|
|
101
|
-
<Heading level={ 1 }>{ confirmVal }</Heading>
|
|
102
|
-
</>
|
|
103
|
-
);
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
// Controlled `ConfirmDialog`s require both `onConfirm` *and* `onCancel to be passed
|
|
107
|
-
// It's expected that the user will then use it to hide the dialog, too (see the
|
|
108
|
-
// `setIsOpen` calls below).
|
|
109
|
-
export const Controlled = () => {
|
|
46
|
+
const Template = ( args ) => {
|
|
110
47
|
const [ isOpen, setIsOpen ] = useState( false );
|
|
111
|
-
const [ confirmVal, setConfirmVal ] = useState(
|
|
112
|
-
"Hasn't confirmed or cancelled yet"
|
|
113
|
-
);
|
|
48
|
+
const [ confirmVal, setConfirmVal ] = useState( '' );
|
|
114
49
|
|
|
115
50
|
const handleConfirm = () => {
|
|
116
51
|
setConfirmVal( 'Confirmed!' );
|
|
@@ -121,22 +56,75 @@ export const Controlled = () => {
|
|
|
121
56
|
setConfirmVal( 'Cancelled' );
|
|
122
57
|
setIsOpen( false );
|
|
123
58
|
};
|
|
124
|
-
|
|
125
59
|
return (
|
|
126
60
|
<>
|
|
61
|
+
<Button variant="primary" onClick={ () => setIsOpen( true ) }>
|
|
62
|
+
Open ConfirmDialog
|
|
63
|
+
</Button>
|
|
64
|
+
|
|
127
65
|
<ConfirmDialog
|
|
66
|
+
{ ...args }
|
|
128
67
|
isOpen={ isOpen }
|
|
129
68
|
onConfirm={ handleConfirm }
|
|
130
69
|
onCancel={ handleCancel }
|
|
131
70
|
>
|
|
132
|
-
{
|
|
71
|
+
{ args.children }
|
|
133
72
|
</ConfirmDialog>
|
|
134
73
|
|
|
135
74
|
<Heading level={ 1 }>{ confirmVal }</Heading>
|
|
136
|
-
|
|
137
|
-
<Button variant="primary" onClick={ () => setIsOpen( true ) }>
|
|
138
|
-
Open ConfirmDialog
|
|
139
|
-
</Button>
|
|
140
75
|
</>
|
|
141
76
|
);
|
|
142
77
|
};
|
|
78
|
+
|
|
79
|
+
// Simplest usage: just declare the component with the required `onConfirm` prop. Note: the `onCancel` prop is optional here, unless you'd like to render the component in Controlled mode (see below)
|
|
80
|
+
export const _default = Template.bind( {} );
|
|
81
|
+
const _defaultSnippet = `() => {
|
|
82
|
+
const [ isOpen, setIsOpen ] = useState( false );
|
|
83
|
+
const [ confirmVal, setConfirmVal ] = useState('');
|
|
84
|
+
|
|
85
|
+
const handleConfirm = () => {
|
|
86
|
+
setConfirmVal( 'Confirmed!' );
|
|
87
|
+
setIsOpen( false );
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const handleCancel = () => {
|
|
91
|
+
setConfirmVal( 'Cancelled' );
|
|
92
|
+
setIsOpen( false );
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<>
|
|
97
|
+
<ConfirmDialog
|
|
98
|
+
isOpen={ isOpen }
|
|
99
|
+
onConfirm={ handleConfirm }
|
|
100
|
+
onCancel={ handleCancel }
|
|
101
|
+
>
|
|
102
|
+
Would you like to privately publish the post now?
|
|
103
|
+
</ConfirmDialog>
|
|
104
|
+
|
|
105
|
+
<Heading level={ 1 }>{ confirmVal }</Heading>
|
|
106
|
+
|
|
107
|
+
<Button variant="primary" onClick={ () => setIsOpen( true ) }>
|
|
108
|
+
Open ConfirmDialog
|
|
109
|
+
</Button>
|
|
110
|
+
</>
|
|
111
|
+
);
|
|
112
|
+
};`;
|
|
113
|
+
_default.args = {};
|
|
114
|
+
_default.parameters = {
|
|
115
|
+
docs: {
|
|
116
|
+
source: {
|
|
117
|
+
code: _defaultSnippet,
|
|
118
|
+
language: 'jsx',
|
|
119
|
+
type: 'auto',
|
|
120
|
+
format: 'true',
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
// To customize button text, pass the `cancelButtonText` and/or `confirmButtonText` props.
|
|
126
|
+
export const withCustomButtonLabels = Template.bind( {} );
|
|
127
|
+
withCustomButtonLabels.args = {
|
|
128
|
+
cancelButtonText: 'No thanks',
|
|
129
|
+
confirmButtonText: 'Yes please!',
|
|
130
|
+
};
|
package/src/date-time/README.md
CHANGED
|
@@ -26,6 +26,8 @@ const MyDateTimePicker = () => {
|
|
|
26
26
|
currentDate={ date }
|
|
27
27
|
onChange={ ( newDate ) => setDate( newDate ) }
|
|
28
28
|
is12Hour={ true }
|
|
29
|
+
__nextRemoveHelpButton
|
|
30
|
+
__nextRemoveResetButton
|
|
29
31
|
/>
|
|
30
32
|
);
|
|
31
33
|
};
|
|
@@ -35,22 +37,20 @@ const MyDateTimePicker = () => {
|
|
|
35
37
|
|
|
36
38
|
The component accepts the following props:
|
|
37
39
|
|
|
38
|
-
### currentDate
|
|
40
|
+
### `currentDate`: `Date | string | number | null`
|
|
39
41
|
|
|
40
42
|
The current date and time at initialization. Optionally pass in a `null` value to specify no date is currently selected.
|
|
41
43
|
|
|
42
|
-
- Type: `string`
|
|
43
44
|
- Required: No
|
|
44
45
|
- Default: today's date
|
|
45
46
|
|
|
46
|
-
### onChange
|
|
47
|
+
### `onChange`: `( date: string | null ) => void`
|
|
47
48
|
|
|
48
49
|
The function called when a new date or time has been selected. It is passed the `currentDate` as an argument.
|
|
49
50
|
|
|
50
|
-
-
|
|
51
|
-
- Required: Yes
|
|
51
|
+
- Required: No
|
|
52
52
|
|
|
53
|
-
### is12Hour
|
|
53
|
+
### `is12Hour`: `boolean`
|
|
54
54
|
|
|
55
55
|
Whether we use a 12-hour clock. With a 12-hour clock, an AM/PM widget is displayed and the time format is assumed to be `MM-DD-YYYY` (as opposed to the default format `DD-MM-YYYY`).
|
|
56
56
|
|
|
@@ -58,16 +58,35 @@ Whether we use a 12-hour clock. With a 12-hour clock, an AM/PM widget is display
|
|
|
58
58
|
- Required: No
|
|
59
59
|
- Default: false
|
|
60
60
|
|
|
61
|
-
### isInvalidDate
|
|
61
|
+
### `isInvalidDate`: `( date: Date ) => boolean`
|
|
62
62
|
|
|
63
63
|
A callback function which receives a Date object representing a day as an argument, and should return a Boolean to signify if the day is valid or not.
|
|
64
64
|
|
|
65
|
-
- Type: `Function`
|
|
66
65
|
- Required: No
|
|
67
66
|
|
|
68
|
-
### onMonthPreviewed
|
|
67
|
+
### `onMonthPreviewed`: `( date: Date ) => void`
|
|
69
68
|
|
|
70
69
|
A callback invoked when selecting the previous/next month in the date picker. The callback receives the new month date in the ISO format as an argument.
|
|
71
70
|
|
|
72
|
-
- Type: `Function`
|
|
73
71
|
- Required: No
|
|
72
|
+
|
|
73
|
+
### `events`: `{ date: Date }[]`
|
|
74
|
+
|
|
75
|
+
List of events to show in the date picker. Each event will appear as a dot on the day of the event.
|
|
76
|
+
|
|
77
|
+
- Type: `Array`
|
|
78
|
+
- Required: No
|
|
79
|
+
|
|
80
|
+
### `__nextRemoveHelpButton`: `boolean`
|
|
81
|
+
|
|
82
|
+
Start opting in to not displaying a Help button which will become the default in a future version.
|
|
83
|
+
|
|
84
|
+
- Required: No
|
|
85
|
+
- Default: `false`
|
|
86
|
+
|
|
87
|
+
### `__nextRemoveResetButton`: `boolean`
|
|
88
|
+
|
|
89
|
+
Start opting in to not displaying a Reset button which will become the default in a future version.
|
|
90
|
+
|
|
91
|
+
- Required: No
|
|
92
|
+
- Default: `false`
|
|
File without changes
|