@wordpress/components 19.10.0 → 19.11.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 +24 -6
- 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-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 +21 -8
- package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- package/build/border-box-control/border-box-control-visualizer/hook.js +3 -2
- package/build/border-box-control/border-box-control-visualizer/hook.js.map +1 -1
- package/build/border-box-control/styles.js +11 -15
- 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 +6 -3
- 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/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/color-palette/index.js +5 -12
- package/build/color-palette/index.js.map +1 -1
- package/build/date-time/date.js +43 -19
- package/build/date-time/date.js.map +1 -1
- package/build/date-time/index.js +28 -3
- package/build/date-time/index.js.map +1 -1
- package/build/date-time/time.js +42 -40
- package/build/date-time/time.js.map +1 -1
- package/build/date-time/timezone.js +4 -3
- package/build/date-time/timezone.js.map +1 -1
- package/build/date-time/types.js +6 -0
- package/build/date-time/types.js.map +1 -0
- package/build/date-time/utils.js +6 -4
- package/build/date-time/utils.js.map +1 -1
- package/build/disabled/index.js +1 -1
- package/build/disabled/index.js.map +1 -1
- package/build/draggable/index.native.js +223 -0
- package/build/draggable/index.native.js.map +1 -0
- package/build/dropdown/index.js +7 -5
- 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/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 +3 -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 +223 -277
- 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/select-control/styles/select-control-styles.js +14 -11
- package/build/select-control/styles/select-control-styles.js.map +1 -1
- 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/tooltip/index.js +2 -2
- package/build/tooltip/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-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 +21 -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-visualizer/hook.js +3 -2
- package/build-module/border-box-control/border-box-control-visualizer/hook.js.map +1 -1
- package/build-module/border-box-control/styles.js +9 -15
- 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 +6 -3
- 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/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/color-palette/index.js +5 -11
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/date-time/date.js +44 -19
- package/build-module/date-time/date.js.map +1 -1
- package/build-module/date-time/index.js +28 -4
- package/build-module/date-time/index.js.map +1 -1
- package/build-module/date-time/time.js +43 -41
- package/build-module/date-time/time.js.map +1 -1
- package/build-module/date-time/timezone.js +4 -3
- package/build-module/date-time/timezone.js.map +1 -1
- package/build-module/date-time/types.js +2 -0
- package/build-module/date-time/types.js.map +1 -0
- package/build-module/date-time/utils.js +6 -4
- package/build-module/date-time/utils.js.map +1 -1
- package/build-module/disabled/index.js +1 -1
- package/build-module/disabled/index.js.map +1 -1
- package/build-module/draggable/index.native.js +206 -0
- package/build-module/draggable/index.native.js.map +1 -0
- package/build-module/dropdown/index.js +7 -5
- 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/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 +3 -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 +225 -279
- 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/select-control/styles/select-control-styles.js +14 -11
- package/build-module/select-control/styles/select-control-styles.js.map +1 -1
- 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/tooltip/index.js +2 -2
- package/build-module/tooltip/index.js.map +1 -1
- package/build-style/style-rtl.css +31 -170
- package/build-style/style.css +27 -170
- 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 +3 -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 +2 -2
- 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-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/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/types.d.ts +35 -0
- package/build-types/checkbox-control/types.d.ts.map +1 -0
- package/build-types/color-palette/index.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +1 -1
- package/build-types/date-time/date.d.ts +24 -0
- package/build-types/date-time/date.d.ts.map +1 -0
- package/build-types/date-time/index.d.ts +35 -0
- package/build-types/date-time/index.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/index.d.ts +14 -0
- package/build-types/date-time/stories/index.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/test/date.d.ts +2 -0
- package/build-types/date-time/test/date.d.ts.map +1 -0
- package/build-types/date-time/test/time.d.ts +2 -0
- package/build-types/date-time/test/time.d.ts.map +1 -0
- package/build-types/date-time/test/utils.d.ts +2 -0
- package/build-types/date-time/test/utils.d.ts.map +1 -0
- package/build-types/date-time/time.d.ts +25 -0
- package/build-types/date-time/time.d.ts.map +1 -0
- package/build-types/date-time/timezone.d.ts +8 -0
- package/build-types/date-time/timezone.d.ts.map +1 -0
- package/build-types/date-time/types.d.ts +91 -0
- package/build-types/date-time/types.d.ts.map +1 -0
- package/build-types/date-time/utils.d.ts +15 -0
- package/build-types/date-time/utils.d.ts.map +1 -0
- package/build-types/dropdown/index.d.ts.map +1 -1
- package/build-types/input-control/index.d.ts +1 -1
- package/build-types/input-control/stories/index.d.ts +5 -5
- package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
- package/build-types/popover/index.d.ts +5 -7
- 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/styles/select-control-styles.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
- package/build-types/tooltip/index.d.ts.map +1 -1
- package/package.json +19 -19
- 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-linked-button/hook.ts +10 -6
- package/src/border-box-control/border-box-control-split-controls/component.tsx +24 -7
- package/src/border-box-control/border-box-control-visualizer/hook.ts +11 -6
- package/src/border-box-control/stories/index.js +1 -0
- package/src/border-box-control/styles.ts +15 -8
- 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 +5 -2
- 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/button/index.native.js +33 -18
- 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/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/types.ts +36 -0
- package/src/circular-option-picker/style.scss +1 -0
- package/src/color-palette/index.js +6 -13
- package/src/color-palette/style.scss +3 -18
- package/src/date-time/README.md +13 -10
- package/src/date-time/{date.js → date.tsx} +49 -20
- package/src/date-time/{index.js → index.tsx} +31 -5
- package/src/date-time/stories/date.tsx +73 -0
- package/src/date-time/stories/index.tsx +75 -0
- package/src/date-time/stories/time.tsx +51 -0
- package/src/date-time/stories/utils.ts +9 -0
- package/src/date-time/test/{date.js → date.tsx} +3 -2
- package/src/date-time/test/{time.js → time.tsx} +34 -19
- package/src/date-time/test/{utils.js → utils.ts} +1 -1
- package/src/date-time/{time.js → time.tsx} +57 -46
- package/src/date-time/{timezone.js → timezone.tsx} +4 -3
- package/src/date-time/types.ts +106 -0
- package/src/date-time/utils.ts +20 -0
- package/src/disabled/index.js +1 -1
- package/src/draggable/index.native.js +215 -0
- package/src/draggable/style.native.scss +3 -0
- package/src/dropdown/index.js +9 -4
- 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 +8 -4
- package/src/index.js +0 -1
- package/src/index.native.js +1 -0
- package/src/item-group/stories/index.js +22 -18
- 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 +1 -1
- package/src/mobile/bottom-sheet/index.native.js +1 -1
- package/src/mobile/bottom-sheet-select-control/index.native.js +7 -2
- package/src/mobile/html-text-input/index.native.js +45 -29
- package/src/mobile/html-text-input/style.android.scss +1 -15
- package/src/mobile/html-text-input/style.ios.scss +1 -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/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 +242 -371
- package/src/popover/style.scss +20 -190
- package/src/popover/test/__snapshots__/index.js.snap +6 -18
- package/src/resizable-box/resize-tooltip/utils.ts +4 -5
- package/src/sandbox/index.native.js +1 -1
- package/src/select-control/styles/select-control-styles.ts +6 -3
- package/src/tab-panel/style.scss +1 -1
- 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/tooltip/index.js +8 -2
- package/src/tooltip/style.scss +2 -4
- package/src/tooltip/test/index.native.js +1 -1
- package/src/unit-control/test/index.tsx +84 -4
- package/tsconfig.json +6 -2
- package/tsconfig.tsbuildinfo +1 -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-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-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/index.d.ts.map +0 -1
- 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/src/button-group/index.js +0 -17
- package/src/button-group/stories/index.js +0 -21
- package/src/date-time/stories/date.js +0 -17
- package/src/date-time/stories/index.js +0 -91
- package/src/date-time/stories/time.js +0 -32
- 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
|
@@ -9,11 +9,12 @@ import {
|
|
|
9
9
|
Platform,
|
|
10
10
|
} from 'react-native';
|
|
11
11
|
import { isArray } from 'lodash';
|
|
12
|
+
import { LongPressGestureHandler, State } from 'react-native-gesture-handler';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* WordPress dependencies
|
|
15
16
|
*/
|
|
16
|
-
import { Children, cloneElement } from '@wordpress/element';
|
|
17
|
+
import { Children, cloneElement, useCallback } from '@wordpress/element';
|
|
17
18
|
import {
|
|
18
19
|
usePreferredColorScheme,
|
|
19
20
|
usePreferredColorSchemeStyle,
|
|
@@ -163,6 +164,15 @@ export function Button( props ) {
|
|
|
163
164
|
} )
|
|
164
165
|
: null;
|
|
165
166
|
|
|
167
|
+
const longPressHandler = useCallback(
|
|
168
|
+
( { nativeEvent } ) => {
|
|
169
|
+
if ( nativeEvent.state === State.ACTIVE && onLongPress ) {
|
|
170
|
+
onLongPress();
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
[ onLongPress ]
|
|
174
|
+
);
|
|
175
|
+
|
|
166
176
|
const element = (
|
|
167
177
|
<TouchableOpacity
|
|
168
178
|
activeOpacity={ 0.7 }
|
|
@@ -172,28 +182,33 @@ export function Button( props ) {
|
|
|
172
182
|
accessibilityRole={ 'button' }
|
|
173
183
|
accessibilityHint={ hint }
|
|
174
184
|
onPress={ onClick }
|
|
175
|
-
onLongPress={ onLongPress }
|
|
176
185
|
style={ containerStyle }
|
|
177
186
|
disabled={ isDisabled }
|
|
178
187
|
testID={ testID }
|
|
179
188
|
>
|
|
180
|
-
<
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
189
|
+
<LongPressGestureHandler
|
|
190
|
+
minDurationMs={ 500 }
|
|
191
|
+
maxDist={ 150 }
|
|
192
|
+
onHandlerStateChange={ longPressHandler }
|
|
193
|
+
>
|
|
194
|
+
<View style={ buttonViewStyle }>
|
|
195
|
+
<View style={ { flexDirection: 'row' } }>
|
|
196
|
+
{ newIcon }
|
|
197
|
+
{ newChildren }
|
|
198
|
+
{ subscript && (
|
|
199
|
+
<Text
|
|
200
|
+
style={
|
|
201
|
+
isPressed
|
|
202
|
+
? styles.subscriptActive
|
|
203
|
+
: subscriptInactive
|
|
204
|
+
}
|
|
205
|
+
>
|
|
206
|
+
{ subscript }
|
|
207
|
+
</Text>
|
|
208
|
+
) }
|
|
209
|
+
</View>
|
|
195
210
|
</View>
|
|
196
|
-
</
|
|
211
|
+
</LongPressGestureHandler>
|
|
197
212
|
</TouchableOpacity>
|
|
198
213
|
);
|
|
199
214
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import classnames from 'classnames';
|
|
5
|
+
import type { ForwardedRef } from 'react';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* WordPress dependencies
|
|
9
|
+
*/
|
|
10
|
+
import { forwardRef } from '@wordpress/element';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Internal dependencies
|
|
14
|
+
*/
|
|
15
|
+
import type { ButtonGroupProps } from './types';
|
|
16
|
+
import type { WordPressComponentProps } from '../ui/context';
|
|
17
|
+
|
|
18
|
+
function UnforwardedButtonGroup(
|
|
19
|
+
props: WordPressComponentProps< ButtonGroupProps, 'div', false >,
|
|
20
|
+
ref: ForwardedRef< HTMLDivElement >
|
|
21
|
+
) {
|
|
22
|
+
const { className, ...restProps } = props;
|
|
23
|
+
const classes = classnames( 'components-button-group', className );
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<div ref={ ref } role="group" className={ classes } { ...restProps } />
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* ButtonGroup can be used to group any related buttons together. To emphasize
|
|
32
|
+
* related buttons, a group should share a common container.
|
|
33
|
+
*
|
|
34
|
+
* ```jsx
|
|
35
|
+
* import { Button, ButtonGroup } from '@wordpress/components';
|
|
36
|
+
*
|
|
37
|
+
* const MyButtonGroup = () => (
|
|
38
|
+
* <ButtonGroup>
|
|
39
|
+
* <Button variant="primary">Button 1</Button>
|
|
40
|
+
* <Button variant="primary">Button 2</Button>
|
|
41
|
+
* </ButtonGroup>
|
|
42
|
+
* );
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export const ButtonGroup = forwardRef( UnforwardedButtonGroup );
|
|
46
|
+
|
|
47
|
+
export default ButtonGroup;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import ButtonGroup from '..';
|
|
10
|
+
import Button from '../../button';
|
|
11
|
+
|
|
12
|
+
const meta: ComponentMeta< typeof ButtonGroup > = {
|
|
13
|
+
title: 'Components/ButtonGroup',
|
|
14
|
+
component: ButtonGroup,
|
|
15
|
+
argTypes: {
|
|
16
|
+
children: { control: { type: null } },
|
|
17
|
+
},
|
|
18
|
+
parameters: {
|
|
19
|
+
controls: { expanded: true },
|
|
20
|
+
docs: { source: { state: 'open' } },
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
export default meta;
|
|
24
|
+
|
|
25
|
+
const Template: ComponentStory< typeof ButtonGroup > = ( args ) => {
|
|
26
|
+
const style = { margin: '0 4px' };
|
|
27
|
+
return (
|
|
28
|
+
<ButtonGroup { ...args }>
|
|
29
|
+
<Button variant="primary" style={ style }>
|
|
30
|
+
Button 1
|
|
31
|
+
</Button>
|
|
32
|
+
<Button variant="primary" style={ style }>
|
|
33
|
+
Button 2
|
|
34
|
+
</Button>
|
|
35
|
+
</ButtonGroup>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const Default: ComponentStory< typeof ButtonGroup > = Template.bind(
|
|
40
|
+
{}
|
|
41
|
+
);
|
|
@@ -77,37 +77,39 @@ const MyCheckboxControl = () => {
|
|
|
77
77
|
The set of props accepted by the component will be specified below.
|
|
78
78
|
Props not included in this set will be applied to the input element.
|
|
79
79
|
|
|
80
|
-
#### label
|
|
80
|
+
#### `label`: `string`
|
|
81
81
|
|
|
82
82
|
A label for the input field, that appears at the side of the checkbox.
|
|
83
83
|
The prop will be rendered as content a label element.
|
|
84
84
|
If no prop is passed an empty label is rendered.
|
|
85
85
|
|
|
86
|
-
- Type: `String`
|
|
87
86
|
- Required: No
|
|
88
87
|
|
|
89
|
-
#### help
|
|
88
|
+
#### `help`: `string|WPElement`
|
|
90
89
|
|
|
91
90
|
If this property is added, a help text will be generated using help property as the content.
|
|
92
91
|
|
|
93
|
-
- Type: `String|WPElement`
|
|
94
92
|
- Required: No
|
|
95
93
|
|
|
96
|
-
#### checked
|
|
94
|
+
#### `checked`: `boolean`
|
|
97
95
|
|
|
98
96
|
If checked is true the checkbox will be checked. If checked is false the checkbox will be unchecked.
|
|
99
97
|
If no value is passed the checkbox will be unchecked.
|
|
100
98
|
|
|
101
|
-
- Type: `Boolean`
|
|
102
99
|
- Required: No
|
|
103
100
|
|
|
104
|
-
#### onChange
|
|
101
|
+
#### `onChange`: `function`
|
|
105
102
|
|
|
106
103
|
A function that receives the checked state (boolean) as input.
|
|
107
104
|
|
|
108
|
-
- Type: `function`
|
|
109
105
|
- Required: Yes
|
|
110
106
|
|
|
107
|
+
#### `indeterminate`: `boolean`
|
|
108
|
+
|
|
109
|
+
If indeterminate is true the state of the checkbox will be indeterminate.
|
|
110
|
+
|
|
111
|
+
- Required: No
|
|
112
|
+
|
|
111
113
|
## Related components
|
|
112
114
|
|
|
113
115
|
- To select one option from a set, and you want to show all the available options at once, use the `RadioControl` component.
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
+
import type { ChangeEvent } from 'react';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* WordPress dependencies
|
|
@@ -15,17 +16,48 @@ import { Icon, check, reset } from '@wordpress/icons';
|
|
|
15
16
|
* Internal dependencies
|
|
16
17
|
*/
|
|
17
18
|
import BaseControl from '../base-control';
|
|
19
|
+
import type { CheckboxControlProps } from './types';
|
|
20
|
+
import type { WordPressComponentProps } from '../ui/context';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Checkboxes allow the user to select one or more items from a set.
|
|
24
|
+
*
|
|
25
|
+
* ```jsx
|
|
26
|
+
* import { CheckboxControl } from '@wordpress/components';
|
|
27
|
+
* import { useState } from '@wordpress/element';
|
|
28
|
+
*
|
|
29
|
+
* const MyCheckboxControl = () => {
|
|
30
|
+
* const [ isChecked, setChecked ] = useState( true );
|
|
31
|
+
* return (
|
|
32
|
+
* <CheckboxControl
|
|
33
|
+
* label="Is author"
|
|
34
|
+
* help="Is the user a author or not?"
|
|
35
|
+
* checked={ isChecked }
|
|
36
|
+
* onChange={ setChecked }
|
|
37
|
+
* />
|
|
38
|
+
* );
|
|
39
|
+
* };
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export function CheckboxControl(
|
|
43
|
+
// ref is omitted until we have `WordPressComponentPropsWithoutRef` or add
|
|
44
|
+
// ref forwarding to CheckboxControl.
|
|
45
|
+
props: Omit<
|
|
46
|
+
WordPressComponentProps< CheckboxControlProps, 'input', false >,
|
|
47
|
+
'ref'
|
|
48
|
+
>
|
|
49
|
+
) {
|
|
50
|
+
const {
|
|
51
|
+
label,
|
|
52
|
+
className,
|
|
53
|
+
heading,
|
|
54
|
+
checked,
|
|
55
|
+
indeterminate,
|
|
56
|
+
help,
|
|
57
|
+
onChange,
|
|
58
|
+
...additionalProps
|
|
59
|
+
} = props;
|
|
18
60
|
|
|
19
|
-
export default function CheckboxControl( {
|
|
20
|
-
label,
|
|
21
|
-
className,
|
|
22
|
-
heading,
|
|
23
|
-
checked,
|
|
24
|
-
indeterminate,
|
|
25
|
-
help,
|
|
26
|
-
onChange,
|
|
27
|
-
...props
|
|
28
|
-
} ) {
|
|
29
61
|
if ( heading ) {
|
|
30
62
|
deprecated( '`heading` prop in `CheckboxControl`', {
|
|
31
63
|
alternative: 'a separate element to implement a heading',
|
|
@@ -38,9 +70,9 @@ export default function CheckboxControl( {
|
|
|
38
70
|
false
|
|
39
71
|
);
|
|
40
72
|
|
|
41
|
-
// Run the following callback
|
|
73
|
+
// Run the following callback every time the `ref` (and the additional
|
|
42
74
|
// dependencies) change.
|
|
43
|
-
const ref = useRefEffect(
|
|
75
|
+
const ref = useRefEffect< HTMLInputElement >(
|
|
44
76
|
( node ) => {
|
|
45
77
|
if ( ! node ) {
|
|
46
78
|
return;
|
|
@@ -56,7 +88,8 @@ export default function CheckboxControl( {
|
|
|
56
88
|
);
|
|
57
89
|
const instanceId = useInstanceId( CheckboxControl );
|
|
58
90
|
const id = `inspector-checkbox-control-${ instanceId }`;
|
|
59
|
-
const onChangeValue = ( event
|
|
91
|
+
const onChangeValue = ( event: ChangeEvent< HTMLInputElement > ) =>
|
|
92
|
+
onChange( event.target.checked );
|
|
60
93
|
|
|
61
94
|
return (
|
|
62
95
|
<BaseControl
|
|
@@ -75,7 +108,7 @@ export default function CheckboxControl( {
|
|
|
75
108
|
onChange={ onChangeValue }
|
|
76
109
|
checked={ checked }
|
|
77
110
|
aria-describedby={ !! help ? id + '__help' : undefined }
|
|
78
|
-
{ ...
|
|
111
|
+
{ ...additionalProps }
|
|
79
112
|
/>
|
|
80
113
|
{ showIndeterminateIcon ? (
|
|
81
114
|
<Icon
|
|
@@ -101,3 +134,5 @@ export default function CheckboxControl( {
|
|
|
101
134
|
</BaseControl>
|
|
102
135
|
);
|
|
103
136
|
}
|
|
137
|
+
|
|
138
|
+
export default CheckboxControl;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import type { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -11,42 +11,60 @@ import { useState } from '@wordpress/element';
|
|
|
11
11
|
/**
|
|
12
12
|
* Internal dependencies
|
|
13
13
|
*/
|
|
14
|
-
import CheckboxControl from '
|
|
14
|
+
import CheckboxControl from '..';
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
title: 'Components/CheckboxControl',
|
|
16
|
+
const meta: ComponentMeta< typeof CheckboxControl > = {
|
|
18
17
|
component: CheckboxControl,
|
|
18
|
+
title: 'Components/CheckboxControl',
|
|
19
|
+
argTypes: {
|
|
20
|
+
onChange: {
|
|
21
|
+
action: 'onChange',
|
|
22
|
+
},
|
|
23
|
+
checked: {
|
|
24
|
+
control: { type: null },
|
|
25
|
+
},
|
|
26
|
+
help: { control: { type: 'text' } },
|
|
27
|
+
},
|
|
19
28
|
parameters: {
|
|
20
|
-
|
|
29
|
+
controls: {
|
|
30
|
+
expanded: true,
|
|
31
|
+
exclude: [ 'heading' ],
|
|
32
|
+
},
|
|
33
|
+
docs: { source: { state: 'open' } },
|
|
21
34
|
},
|
|
22
35
|
};
|
|
36
|
+
export default meta;
|
|
23
37
|
|
|
24
|
-
const
|
|
25
|
-
|
|
38
|
+
const DefaultTemplate: ComponentStory< typeof CheckboxControl > = ( {
|
|
39
|
+
onChange,
|
|
40
|
+
...args
|
|
41
|
+
} ) => {
|
|
42
|
+
const [ isChecked, setChecked ] = useState( true );
|
|
26
43
|
|
|
27
44
|
return (
|
|
28
45
|
<CheckboxControl
|
|
29
|
-
{ ...
|
|
46
|
+
{ ...args }
|
|
30
47
|
checked={ isChecked }
|
|
31
|
-
onChange={
|
|
48
|
+
onChange={ ( v ) => {
|
|
49
|
+
setChecked( v );
|
|
50
|
+
onChange( v );
|
|
51
|
+
} }
|
|
32
52
|
/>
|
|
33
53
|
);
|
|
34
54
|
};
|
|
35
55
|
|
|
36
|
-
export const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
56
|
+
export const Default: ComponentStory<
|
|
57
|
+
typeof CheckboxControl
|
|
58
|
+
> = DefaultTemplate.bind( {} );
|
|
59
|
+
Default.args = {
|
|
60
|
+
label: 'Is author',
|
|
61
|
+
help: 'Is the user an author or not?',
|
|
40
62
|
};
|
|
41
63
|
|
|
42
|
-
export const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return <CheckboxControlWithState label={ label } help={ help } checked />;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export const Indeterminate = () => {
|
|
64
|
+
export const Indeterminate: ComponentStory< typeof CheckboxControl > = ( {
|
|
65
|
+
onChange,
|
|
66
|
+
...args
|
|
67
|
+
} ) => {
|
|
50
68
|
const [ fruits, setFruits ] = useState( { apple: false, orange: false } );
|
|
51
69
|
|
|
52
70
|
const isAllChecked = Object.values( fruits ).every( Boolean );
|
|
@@ -56,15 +74,16 @@ export const Indeterminate = () => {
|
|
|
56
74
|
return (
|
|
57
75
|
<>
|
|
58
76
|
<CheckboxControl
|
|
59
|
-
|
|
77
|
+
{ ...args }
|
|
60
78
|
checked={ isAllChecked }
|
|
61
79
|
indeterminate={ isIndeterminate }
|
|
62
|
-
onChange={ (
|
|
80
|
+
onChange={ ( v ) => {
|
|
63
81
|
setFruits( {
|
|
64
|
-
apple:
|
|
65
|
-
orange:
|
|
66
|
-
} )
|
|
67
|
-
|
|
82
|
+
apple: v,
|
|
83
|
+
orange: v,
|
|
84
|
+
} );
|
|
85
|
+
onChange( v );
|
|
86
|
+
} }
|
|
68
87
|
/>
|
|
69
88
|
<CheckboxControl
|
|
70
89
|
label="Apple"
|
|
@@ -89,3 +108,6 @@ export const Indeterminate = () => {
|
|
|
89
108
|
</>
|
|
90
109
|
);
|
|
91
110
|
};
|
|
111
|
+
Indeterminate.args = {
|
|
112
|
+
label: 'Select all',
|
|
113
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { ReactNode } from 'react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import type { BaseControlProps } from '../base-control/types';
|
|
10
|
+
|
|
11
|
+
export type CheckboxControlProps = Pick< BaseControlProps, 'help' > & {
|
|
12
|
+
/**
|
|
13
|
+
* A function that receives the checked state (boolean) as input.
|
|
14
|
+
*/
|
|
15
|
+
onChange: ( value: boolean ) => void;
|
|
16
|
+
/**
|
|
17
|
+
* A label for the input field, that appears at the side of the checkbox.
|
|
18
|
+
* The prop will be rendered as content a label element. If no prop is
|
|
19
|
+
* passed an empty label is rendered.
|
|
20
|
+
*/
|
|
21
|
+
label?: string;
|
|
22
|
+
/**
|
|
23
|
+
* If checked is true the checkbox will be checked. If checked is false the
|
|
24
|
+
* checkbox will be unchecked. If no value is passed the checkbox will be
|
|
25
|
+
* unchecked.
|
|
26
|
+
*/
|
|
27
|
+
checked?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* If indeterminate is true the state of the checkbox will be indeterminate.
|
|
30
|
+
*/
|
|
31
|
+
indeterminate?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated
|
|
34
|
+
*/
|
|
35
|
+
heading?: ReactNode;
|
|
36
|
+
};
|
|
@@ -99,6 +99,7 @@ $color-palette-circle-spacing: 12px;
|
|
|
99
99
|
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
|
|
100
100
|
// Show a thin circular outline in Windows high contrast mode, otherwise the button is invisible.
|
|
101
101
|
border: 1px solid transparent;
|
|
102
|
+
box-sizing: inherit;
|
|
102
103
|
}
|
|
103
104
|
|
|
104
105
|
&:focus {
|
|
@@ -6,7 +6,6 @@ import { map } from 'lodash';
|
|
|
6
6
|
import { colord, extend } from 'colord';
|
|
7
7
|
import namesPlugin from 'colord/plugins/names';
|
|
8
8
|
import a11yPlugin from 'colord/plugins/a11y';
|
|
9
|
-
import classnames from 'classnames';
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
11
|
* WordPress dependencies
|
|
@@ -116,12 +115,12 @@ function MultiplePalettes( {
|
|
|
116
115
|
export function CustomColorPickerDropdown( { isRenderedInSidebar, ...props } ) {
|
|
117
116
|
return (
|
|
118
117
|
<Dropdown
|
|
119
|
-
contentClassName=
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
'
|
|
123
|
-
|
|
124
|
-
|
|
118
|
+
contentClassName="components-color-palette__custom-color-dropdown-content"
|
|
119
|
+
popoverProps={
|
|
120
|
+
isRenderedInSidebar
|
|
121
|
+
? { placement: 'left-start', offset: 20 }
|
|
122
|
+
: undefined
|
|
123
|
+
}
|
|
125
124
|
{ ...props }
|
|
126
125
|
/>
|
|
127
126
|
);
|
|
@@ -176,11 +175,6 @@ export default function ColorPalette( {
|
|
|
176
175
|
/>
|
|
177
176
|
);
|
|
178
177
|
|
|
179
|
-
let dropdownPosition;
|
|
180
|
-
if ( __experimentalIsRenderedInSidebar ) {
|
|
181
|
-
dropdownPosition = 'bottom left';
|
|
182
|
-
}
|
|
183
|
-
|
|
184
178
|
const colordColor = colord( value );
|
|
185
179
|
|
|
186
180
|
const valueWithoutLeadingHash = value?.startsWith( '#' )
|
|
@@ -211,7 +205,6 @@ export default function ColorPalette( {
|
|
|
211
205
|
<VStack spacing={ 3 } className={ className }>
|
|
212
206
|
{ ! disableCustomColors && (
|
|
213
207
|
<CustomColorPickerDropdown
|
|
214
|
-
position={ dropdownPosition }
|
|
215
208
|
isRenderedInSidebar={ __experimentalIsRenderedInSidebar }
|
|
216
209
|
renderContent={ renderCustomColorPicker }
|
|
217
210
|
renderToggle={ ( { isOpen, onToggle } ) => (
|
|
@@ -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
|
}
|
package/src/date-time/README.md
CHANGED
|
@@ -35,22 +35,20 @@ const MyDateTimePicker = () => {
|
|
|
35
35
|
|
|
36
36
|
The component accepts the following props:
|
|
37
37
|
|
|
38
|
-
### currentDate
|
|
38
|
+
### `currentDate`: `Date | string | number | null`
|
|
39
39
|
|
|
40
40
|
The current date and time at initialization. Optionally pass in a `null` value to specify no date is currently selected.
|
|
41
41
|
|
|
42
|
-
- Type: `string`
|
|
43
42
|
- Required: No
|
|
44
43
|
- Default: today's date
|
|
45
44
|
|
|
46
|
-
### onChange
|
|
45
|
+
### `onChange`: `( date: string | null ) => void`
|
|
47
46
|
|
|
48
47
|
The function called when a new date or time has been selected. It is passed the `currentDate` as an argument.
|
|
49
48
|
|
|
50
|
-
-
|
|
51
|
-
- Required: Yes
|
|
49
|
+
- Required: No
|
|
52
50
|
|
|
53
|
-
### is12Hour
|
|
51
|
+
### `is12Hour`: `boolean`
|
|
54
52
|
|
|
55
53
|
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
54
|
|
|
@@ -58,16 +56,21 @@ Whether we use a 12-hour clock. With a 12-hour clock, an AM/PM widget is display
|
|
|
58
56
|
- Required: No
|
|
59
57
|
- Default: false
|
|
60
58
|
|
|
61
|
-
### isInvalidDate
|
|
59
|
+
### `isInvalidDate`: `( date: Date ) => boolean`
|
|
62
60
|
|
|
63
61
|
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
62
|
|
|
65
|
-
- Type: `Function`
|
|
66
63
|
- Required: No
|
|
67
64
|
|
|
68
|
-
### onMonthPreviewed
|
|
65
|
+
### `onMonthPreviewed`: `( date: Date ) => void`
|
|
69
66
|
|
|
70
67
|
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
68
|
|
|
72
|
-
-
|
|
69
|
+
- Required: No
|
|
70
|
+
|
|
71
|
+
### `events`: `{ date: Date }[]`
|
|
72
|
+
|
|
73
|
+
List of events to show in the date picker. Each event will appear as a dot on the day of the event.
|
|
74
|
+
|
|
75
|
+
- Type: `Array`
|
|
73
76
|
- Required: No
|