@wordpress/components 19.2.1-next.33ec3857e2.0 → 19.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -29
- package/build/angle-picker-control/index.js +0 -2
- package/build/angle-picker-control/index.js.map +1 -1
- package/build/button/index.native.js +3 -13
- package/build/button/index.native.js.map +1 -1
- package/build/checkbox-control/index.js +1 -1
- package/build/checkbox-control/index.js.map +1 -1
- package/build/clipboard-button/index.js +2 -1
- package/build/clipboard-button/index.js.map +1 -1
- package/build/color-palette/index.js +1 -13
- package/build/color-palette/index.js.map +1 -1
- package/build/color-picker/color-display.js +2 -4
- package/build/color-picker/color-display.js.map +1 -1
- package/build/color-picker/hex-input.js +1 -3
- package/build/color-picker/hex-input.js.map +1 -1
- package/build/color-picker/input-with-slider.js +1 -3
- package/build/color-picker/input-with-slider.js.map +1 -1
- package/build/custom-gradient-picker/index.js +0 -1
- package/build/custom-gradient-picker/index.js.map +1 -1
- package/build/date-time/date.js +86 -63
- package/build/date-time/date.js.map +1 -1
- package/build/divider/component.js +7 -8
- package/build/divider/component.js.map +1 -1
- package/build/divider/styles.js +13 -38
- package/build/divider/styles.js.map +1 -1
- package/build/drop-zone/index.js +6 -14
- package/build/drop-zone/index.js.map +1 -1
- package/build/drop-zone/provider.js +0 -1
- package/build/drop-zone/provider.js.map +1 -1
- package/build/flyout/styles.js +2 -2
- package/build/flyout/styles.js.map +1 -1
- package/build/focusable-iframe/index.js +0 -1
- package/build/focusable-iframe/index.js.map +1 -1
- package/build/higher-order/with-focus-outside/index.js +0 -2
- package/build/higher-order/with-focus-outside/index.js.map +1 -1
- package/build/index.js +0 -8
- package/build/index.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +32 -44
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js +3 -10
- package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
- package/build/mobile/color-settings/index.native.js +2 -4
- package/build/mobile/color-settings/index.native.js.map +1 -1
- package/build/mobile/color-settings/palette.screen.native.js +6 -7
- package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build/mobile/global-styles-context/utils.native.js +1 -1
- package/build/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build/mobile/gridicons/index.native.js +1 -3
- package/build/mobile/gridicons/index.native.js.map +1 -1
- package/build/mobile/link-picker/index.native.js +4 -45
- package/build/mobile/link-picker/index.native.js.map +1 -1
- package/build/mobile/link-settings/index.native.js +0 -10
- package/build/mobile/link-settings/index.native.js.map +1 -1
- package/build/modal/aria-helper.js +0 -2
- package/build/modal/aria-helper.js.map +1 -1
- package/build/modal/index.js +8 -17
- package/build/modal/index.js.map +1 -1
- package/build/palette-edit/index.js +31 -27
- package/build/palette-edit/index.js.map +1 -1
- package/build/select-control/styles/select-control-styles.js +9 -33
- package/build/select-control/styles/select-control-styles.js.map +1 -1
- package/build/style-provider/index.js +0 -2
- package/build/style-provider/index.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js +2 -7
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +14 -25
- package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
- package/build/tools-panel/styles.js +10 -12
- package/build/tools-panel/styles.js.map +1 -1
- package/build/tools-panel/tools-panel/component.js +8 -6
- package/build/tools-panel/tools-panel/component.js.map +1 -1
- package/build/tools-panel/tools-panel-item/hook.js +8 -6
- package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build/unit-control/styles/unit-control-styles.js +41 -23
- package/build/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build/z-stack/component.js.map +1 -1
- package/build/z-stack/styles.js +8 -10
- package/build/z-stack/styles.js.map +1 -1
- package/build-module/angle-picker-control/index.js +0 -2
- package/build-module/angle-picker-control/index.js.map +1 -1
- package/build-module/button/index.native.js +3 -13
- package/build-module/button/index.native.js.map +1 -1
- package/build-module/checkbox-control/index.js +1 -1
- package/build-module/checkbox-control/index.js.map +1 -1
- package/build-module/clipboard-button/index.js +2 -1
- package/build-module/clipboard-button/index.js.map +1 -1
- package/build-module/color-palette/index.js +2 -14
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-picker/color-display.js +2 -3
- package/build-module/color-picker/color-display.js.map +1 -1
- package/build-module/color-picker/hex-input.js +1 -2
- package/build-module/color-picker/hex-input.js.map +1 -1
- package/build-module/color-picker/input-with-slider.js +1 -2
- package/build-module/color-picker/input-with-slider.js.map +1 -1
- package/build-module/custom-gradient-picker/index.js +0 -1
- package/build-module/custom-gradient-picker/index.js.map +1 -1
- package/build-module/date-time/date.js +87 -63
- package/build-module/date-time/date.js.map +1 -1
- package/build-module/divider/component.js +7 -8
- package/build-module/divider/component.js.map +1 -1
- package/build-module/divider/styles.js +13 -37
- package/build-module/divider/styles.js.map +1 -1
- package/build-module/drop-zone/index.js +6 -14
- package/build-module/drop-zone/index.js.map +1 -1
- package/build-module/drop-zone/provider.js +0 -1
- package/build-module/drop-zone/provider.js.map +1 -1
- package/build-module/flyout/styles.js +2 -2
- package/build-module/flyout/styles.js.map +1 -1
- package/build-module/focusable-iframe/index.js +0 -1
- package/build-module/focusable-iframe/index.js.map +1 -1
- package/build-module/higher-order/with-focus-outside/index.js +0 -1
- package/build-module/higher-order/with-focus-outside/index.js.map +1 -1
- package/build-module/index.js +0 -1
- package/build-module/index.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +32 -44
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js +4 -10
- package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
- package/build-module/mobile/color-settings/index.native.js +2 -4
- package/build-module/mobile/color-settings/index.native.js.map +1 -1
- package/build-module/mobile/color-settings/palette.screen.native.js +6 -7
- package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build-module/mobile/global-styles-context/utils.native.js +1 -1
- package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build-module/mobile/gridicons/index.native.js +0 -1
- package/build-module/mobile/gridicons/index.native.js.map +1 -1
- package/build-module/mobile/link-picker/index.native.js +8 -50
- package/build-module/mobile/link-picker/index.native.js.map +1 -1
- package/build-module/mobile/link-settings/index.native.js +0 -10
- package/build-module/mobile/link-settings/index.native.js.map +1 -1
- package/build-module/modal/aria-helper.js +0 -2
- package/build-module/modal/aria-helper.js.map +1 -1
- package/build-module/modal/index.js +8 -15
- package/build-module/modal/index.js.map +1 -1
- package/build-module/palette-edit/index.js +30 -27
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/select-control/styles/select-control-styles.js +9 -33
- package/build-module/select-control/styles/select-control-styles.js.map +1 -1
- package/build-module/style-provider/index.js +0 -1
- package/build-module/style-provider/index.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js +3 -8
- package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +14 -25
- package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
- package/build-module/tools-panel/styles.js +11 -12
- package/build-module/tools-panel/styles.js.map +1 -1
- package/build-module/tools-panel/tools-panel/component.js +8 -5
- package/build-module/tools-panel/tools-panel/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/hook.js +8 -6
- package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build-module/unit-control/styles/unit-control-styles.js +41 -23
- package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build-module/z-stack/component.js.map +1 -1
- package/build-module/z-stack/styles.js +8 -13
- package/build-module/z-stack/styles.js.map +1 -1
- package/build-style/style-rtl.css +11 -23
- package/build-style/style.css +11 -23
- package/build-types/base-field/hook.d.ts +16 -16
- package/build-types/card/card/hook.d.ts +16 -16
- package/build-types/card/card-body/hook.d.ts +16 -16
- package/build-types/card/card-divider/hook.d.ts +18 -18
- package/build-types/card/card-footer/hook.d.ts +17 -17
- package/build-types/card/card-header/hook.d.ts +16 -16
- package/build-types/card/card-media/hook.d.ts +16 -16
- package/build-types/divider/component.d.ts +7 -8
- package/build-types/divider/component.d.ts.map +1 -1
- package/build-types/divider/styles.d.ts +2 -2
- package/build-types/divider/styles.d.ts.map +1 -1
- package/build-types/divider/types.d.ts +5 -5
- package/build-types/divider/types.d.ts.map +1 -1
- package/build-types/elevation/hook.d.ts +15 -15
- package/build-types/flex/flex/hook.d.ts +16 -16
- package/build-types/flex/flex-block/hook.d.ts +16 -16
- package/build-types/flex/flex-item/hook.d.ts +16 -16
- package/build-types/flyout/flyout/hook.d.ts +17 -17
- package/build-types/flyout/styles.d.ts +9 -7
- package/build-types/flyout/styles.d.ts.map +1 -1
- package/build-types/grid/hook.d.ts +16 -16
- package/build-types/h-stack/hook.d.ts +16 -16
- package/build-types/heading/hook.d.ts +16 -16
- package/build-types/input-control/index.d.ts +1 -1
- package/build-types/input-control/index.d.ts.map +1 -1
- package/build-types/input-control/input-field.d.ts +1 -1
- package/build-types/input-control/input-field.d.ts.map +1 -1
- package/build-types/input-control/styles/input-control-styles.d.ts +2 -1
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/input-control/types.d.ts +1 -2
- package/build-types/input-control/types.d.ts.map +1 -1
- package/build-types/item-group/item/hook.d.ts +16 -16
- package/build-types/item-group/item-group/hook.d.ts +16 -16
- package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
- package/build-types/scrollable/hook.d.ts +16 -16
- package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
- package/build-types/select-control/types.d.ts +1 -1
- package/build-types/select-control/types.d.ts.map +1 -1
- package/build-types/spacer/hook.d.ts +16 -16
- package/build-types/surface/hook.d.ts +16 -16
- package/build-types/text/hook.d.ts +16 -16
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.d.ts.map +1 -1
- package/build-types/tools-panel/styles.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +16 -16
- package/build-types/tools-panel/tools-panel-header/hook.d.ts +16 -16
- package/build-types/tools-panel/tools-panel-item/hook.d.ts +16 -16
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/truncate/hook.d.ts +16 -16
- package/build-types/ui/control-group/hook.d.ts +18 -18
- package/build-types/ui/control-label/hook.d.ts +16 -16
- package/build-types/ui/form-group/form-group.d.ts +4 -4
- package/build-types/ui/form-group/use-form-group.d.ts +55 -55
- package/build-types/unit-control/index.d.ts +1 -1
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts +0 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
- package/build-types/unit-control/types.d.ts +2 -2
- package/build-types/unit-control/types.d.ts.map +1 -1
- package/build-types/v-stack/hook.d.ts +16 -16
- package/build-types/z-stack/component.d.ts +1 -1
- package/build-types/z-stack/styles.d.ts.map +1 -1
- package/package.json +23 -21
- package/src/alignment-matrix-control/stories/index.js +1 -1
- package/src/angle-picker-control/index.js +0 -2
- package/src/base-control/stories/index.js +1 -1
- package/src/button/index.native.js +1 -15
- package/src/button/stories/index.js +1 -1
- package/src/button/style.scss +0 -14
- package/src/card/card/README.md +3 -3
- package/src/card/stories/index.js +1 -1
- package/src/card/test/__snapshots__/index.js.snap +6 -6
- package/src/checkbox-control/index.js +1 -1
- package/src/checkbox-control/stories/index.js +1 -1
- package/src/clipboard-button/index.js +2 -1
- package/src/color-indicator/stories/index.js +1 -1
- package/src/color-indicator/style.scss +8 -5
- package/src/color-palette/index.js +5 -13
- package/src/color-palette/stories/index.js +1 -1
- package/src/color-palette/test/__snapshots__/index.js.snap +0 -1
- package/src/color-picker/color-display.tsx +2 -3
- package/src/color-picker/hex-input.tsx +1 -2
- package/src/color-picker/input-with-slider.tsx +1 -2
- package/src/color-picker/stories/index.js +1 -1
- package/src/combobox-control/README.md +2 -2
- package/src/custom-gradient-picker/index.js +0 -1
- package/src/custom-gradient-picker/style.scss +4 -0
- package/src/date-time/README.md +0 -7
- package/src/date-time/date.js +84 -67
- package/src/date-time/stories/index.js +1 -1
- package/src/date-time/stories/time.js +1 -1
- package/src/date-time/test/date.js +29 -3
- package/src/dimension-control/README.md +1 -1
- package/src/divider/README.md +5 -33
- package/src/divider/component.tsx +7 -8
- package/src/divider/stories/index.js +17 -43
- package/src/divider/styles.ts +16 -53
- package/src/divider/test/__snapshots__/index.js.snap +11 -11
- package/src/divider/test/index.js +4 -4
- package/src/divider/types.ts +5 -5
- package/src/drop-zone/index.js +6 -14
- package/src/drop-zone/provider.js +0 -1
- package/src/dropdown-menu/stories/index.js +1 -1
- package/src/duotone-picker/README.md +1 -1
- package/src/elevation/stories/index.js +1 -1
- package/src/external-link/stories/index.js +1 -1
- package/src/flyout/styles.ts +2 -4
- package/src/focusable-iframe/index.js +0 -1
- package/src/font-size-picker/stories/index.js +1 -1
- package/src/form-token-field/stories/index.js +1 -1
- package/src/gradient-picker/stories/index.js +1 -1
- package/src/grid/stories/index.js +1 -1
- package/src/guide/stories/index.js +1 -1
- package/src/higher-order/with-focus-outside/index.js +0 -2
- package/src/icon/stories/index.js +1 -1
- package/src/index.js +0 -1
- package/src/input-control/stories/index.js +1 -2
- package/src/input-control/styles/input-control-styles.tsx +6 -16
- package/src/input-control/types.ts +1 -3
- package/src/item-group/stories/index.js +2 -84
- package/src/menu-item/README.md +2 -2
- package/src/mobile/bottom-sheet/link-suggestion-item-cell.native.js +2 -6
- package/src/mobile/color-settings/index.native.js +0 -2
- package/src/mobile/color-settings/palette.screen.native.js +5 -8
- package/src/mobile/color-settings/style.native.scss +1 -1
- package/src/mobile/global-styles-context/utils.native.js +1 -1
- package/src/mobile/gridicons/index.native.js +3 -3
- package/src/mobile/inserter-button/style.native.scss +0 -1
- package/src/mobile/link-picker/index.native.js +7 -41
- package/src/mobile/link-settings/index.native.js +0 -11
- package/src/modal/README.md +0 -10
- package/src/modal/aria-helper.js +0 -2
- package/src/modal/index.js +55 -72
- package/src/modal/stories/index.js +1 -6
- package/src/modal/style.scss +0 -9
- package/src/modal/test/index.js +0 -11
- package/src/navigation/README.md +9 -0
- package/src/notice/stories/index.js +1 -1
- package/src/number-control/stories/index.js +1 -1
- package/src/palette-edit/index.js +106 -73
- package/src/panel/stories/index.js +1 -1
- package/src/placeholder/stories/index.js +1 -1
- package/src/popover/stories/index.js +1 -1
- package/src/query-controls/README.md +6 -138
- package/src/radio-group/README.md +1 -4
- package/src/range-control/stories/index.js +1 -1
- package/src/resizable-box/stories/index.js +1 -1
- package/src/scrollable/stories/index.js +1 -1
- package/src/search-control/stories/index.js +1 -1
- package/src/select-control/stories/index.js +1 -2
- package/src/select-control/styles/select-control-styles.ts +2 -25
- package/src/select-control/types.ts +1 -1
- package/src/slot-fill/stories/index.js +1 -1
- package/src/snackbar/stories/index.js +1 -1
- package/src/spacer/stories/index.js +1 -1
- package/src/style-provider/index.js +0 -2
- package/src/surface/stories/index.js +1 -1
- package/src/tab-panel/stories/index.js +1 -1
- package/src/text-control/stories/index.js +1 -1
- package/src/text-highlight/stories/index.js +1 -1
- package/src/textarea-control/stories/index.js +1 -1
- package/src/tip/stories/index.js +1 -1
- package/src/toggle-control/stories/index.js +1 -1
- package/src/toggle-group-control/stories/index.js +1 -1
- package/src/toggle-group-control/toggle-group-control/component.tsx +2 -7
- package/src/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.tsx +9 -24
- package/src/toolbar-button/stories/index.js +1 -1
- package/src/tools-panel/stories/index.js +0 -54
- package/src/tools-panel/styles.ts +1 -41
- package/src/tools-panel/test/index.js +137 -19
- package/src/tools-panel/tools-panel/README.md +3 -11
- package/src/tools-panel/tools-panel/component.tsx +5 -2
- package/src/tools-panel/tools-panel-item/hook.ts +14 -6
- package/src/tooltip/stories/index.js +1 -1
- package/src/tree-select/stories/index.js +1 -1
- package/src/truncate/stories/index.js +1 -1
- package/src/unit-control/stories/index.js +1 -19
- package/src/unit-control/styles/unit-control-styles.ts +46 -33
- package/src/unit-control/types.ts +2 -5
- package/src/z-stack/README.md +1 -1
- package/src/z-stack/component.tsx +1 -1
- package/src/z-stack/stories/index.js +1 -1
- package/src/z-stack/styles.ts +2 -7
- package/tsconfig.json +2 -6
- package/tsconfig.tsbuildinfo +1 -1
- package/build/confirm-dialog/component.js +0 -103
- package/build/confirm-dialog/component.js.map +0 -1
- package/build/confirm-dialog/index.js +0 -16
- package/build/confirm-dialog/index.js.map +0 -1
- package/build/confirm-dialog/types.js +0 -6
- package/build/confirm-dialog/types.js.map +0 -1
- package/build/date-time/utils.js +0 -32
- package/build/date-time/utils.js.map +0 -1
- package/build-module/confirm-dialog/component.js +0 -84
- package/build-module/confirm-dialog/component.js.map +0 -1
- package/build-module/confirm-dialog/index.js +0 -6
- package/build-module/confirm-dialog/index.js.map +0 -1
- package/build-module/confirm-dialog/types.js +0 -2
- package/build-module/confirm-dialog/types.js.map +0 -1
- package/build-module/date-time/utils.js +0 -20
- package/build-module/date-time/utils.js.map +0 -1
- package/src/confirm-dialog/README.md +0 -128
- package/src/confirm-dialog/component.tsx +0 -114
- package/src/confirm-dialog/index.tsx +0 -6
- package/src/confirm-dialog/stories/index.js +0 -120
- package/src/confirm-dialog/test/index.js +0 -302
- package/src/confirm-dialog/types.ts +0 -26
- package/src/date-time/test/utils.js +0 -32
- package/src/date-time/utils.js +0 -18
- package/src/mobile/link-settings/test/edit.native.js +0 -432
|
@@ -269,10 +269,10 @@ Object {
|
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
.emotion-10 {
|
|
272
|
-
border: 0;
|
|
273
|
-
|
|
274
|
-
border-bottom: 1px solid currentColor;
|
|
272
|
+
border-color: rgba(0, 0, 0, 0.1);
|
|
273
|
+
border-width: 0 0 1px 0;
|
|
275
274
|
height: 0;
|
|
275
|
+
margin: 0;
|
|
276
276
|
width: auto;
|
|
277
277
|
box-sizing: border-box;
|
|
278
278
|
display: block;
|
|
@@ -525,10 +525,10 @@ Object {
|
|
|
525
525
|
}
|
|
526
526
|
|
|
527
527
|
.emotion-10 {
|
|
528
|
-
border: 0;
|
|
529
|
-
|
|
530
|
-
border-bottom: 1px solid currentColor;
|
|
528
|
+
border-color: rgba(0, 0, 0, 0.1);
|
|
529
|
+
border-width: 0 0 1px 0;
|
|
531
530
|
height: 0;
|
|
531
|
+
margin: 0;
|
|
532
532
|
width: auto;
|
|
533
533
|
box-sizing: border-box;
|
|
534
534
|
display: block;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
.component-color-indicator {
|
|
2
|
-
width:
|
|
3
|
-
height:
|
|
4
|
-
|
|
5
|
-
border:
|
|
2
|
+
width: 25px;
|
|
3
|
+
height: 16px;
|
|
4
|
+
margin-left: 0.8rem;
|
|
5
|
+
border: 1px solid #dadada;
|
|
6
6
|
display: inline-block;
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
& + & {
|
|
9
|
+
margin-left: 0.5rem;
|
|
10
|
+
}
|
|
8
11
|
}
|
|
@@ -10,7 +10,7 @@ import classnames from 'classnames';
|
|
|
10
10
|
/**
|
|
11
11
|
* WordPress dependencies
|
|
12
12
|
*/
|
|
13
|
-
import { __, sprintf
|
|
13
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
14
14
|
import { useCallback, useMemo } from '@wordpress/element';
|
|
15
15
|
|
|
16
16
|
/**
|
|
@@ -136,9 +136,10 @@ export default function ColorPalette( {
|
|
|
136
136
|
__experimentalIsRenderedInSidebar = false,
|
|
137
137
|
} ) {
|
|
138
138
|
const clearColor = useCallback( () => onChange( undefined ), [ onChange ] );
|
|
139
|
-
const Component =
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
const Component =
|
|
140
|
+
__experimentalHasMultipleOrigins && colors?.length
|
|
141
|
+
? MultiplePalettes
|
|
142
|
+
: SinglePalette;
|
|
142
143
|
|
|
143
144
|
const renderCustomColorPicker = () => (
|
|
144
145
|
<ColorPicker
|
|
@@ -148,23 +149,14 @@ export default function ColorPalette( {
|
|
|
148
149
|
/>
|
|
149
150
|
);
|
|
150
151
|
|
|
151
|
-
let dropdownPosition;
|
|
152
|
-
let popoverProps;
|
|
153
|
-
if ( __experimentalIsRenderedInSidebar ) {
|
|
154
|
-
dropdownPosition = isRTL() ? 'bottom right' : 'bottom left';
|
|
155
|
-
popoverProps = { __unstableForcePosition: true };
|
|
156
|
-
}
|
|
157
|
-
|
|
158
152
|
const colordColor = colord( value );
|
|
159
153
|
|
|
160
154
|
return (
|
|
161
155
|
<VStack spacing={ 3 } className={ className }>
|
|
162
156
|
{ ! disableCustomColors && (
|
|
163
157
|
<CustomColorPickerDropdown
|
|
164
|
-
position={ dropdownPosition }
|
|
165
158
|
isRenderedInSidebar={ __experimentalIsRenderedInSidebar }
|
|
166
159
|
renderContent={ renderCustomColorPicker }
|
|
167
|
-
popoverProps={ popoverProps }
|
|
168
160
|
renderToggle={ ( { isOpen, onToggle } ) => (
|
|
169
161
|
<button
|
|
170
162
|
className="components-color-palette__custom-color"
|
|
@@ -173,7 +173,6 @@ exports[`ColorPalette should render a dynamic toolbar of colors 1`] = `
|
|
|
173
173
|
data-wp-component="VStack"
|
|
174
174
|
isColumn={true}
|
|
175
175
|
>
|
|
176
|
-
<Noop />
|
|
177
176
|
<div
|
|
178
177
|
className="components-flex components-h-stack components-v-stack emotion-4 emotion-5"
|
|
179
178
|
data-wp-c16t={true}
|
|
@@ -18,7 +18,6 @@ import { Flex, FlexItem } from '../flex';
|
|
|
18
18
|
import { Tooltip } from '../ui/tooltip';
|
|
19
19
|
import type { ColorType } from './types';
|
|
20
20
|
import { space } from '../ui/utils/space';
|
|
21
|
-
import { COLORS } from '../utils/colors-values';
|
|
22
21
|
|
|
23
22
|
interface ColorDisplayProps {
|
|
24
23
|
color: Colord;
|
|
@@ -42,7 +41,7 @@ const ValueDisplay = ( { values }: ValueDisplayProps ) => (
|
|
|
42
41
|
{ values.map( ( [ value, abbreviation ] ) => {
|
|
43
42
|
return (
|
|
44
43
|
<FlexItem key={ abbreviation } isBlock display="flex">
|
|
45
|
-
<Text color=
|
|
44
|
+
<Text color="blue">{ abbreviation }</Text>
|
|
46
45
|
<Text>{ value }</Text>
|
|
47
46
|
</FlexItem>
|
|
48
47
|
);
|
|
@@ -85,7 +84,7 @@ const HexDisplay = ( { color }: DisplayProps ) => {
|
|
|
85
84
|
const colorWithoutHash = color.toHex().slice( 1 ).toUpperCase();
|
|
86
85
|
return (
|
|
87
86
|
<FlexItem>
|
|
88
|
-
<Text color=
|
|
87
|
+
<Text color="blue">#</Text>
|
|
89
88
|
<Text>{ colorWithoutHash }</Text>
|
|
90
89
|
</FlexItem>
|
|
91
90
|
);
|
|
@@ -15,7 +15,6 @@ import { Text } from '../text';
|
|
|
15
15
|
import { Spacer } from '../spacer';
|
|
16
16
|
import { space } from '../ui/utils/space';
|
|
17
17
|
import { ColorHexInputControl } from './styles';
|
|
18
|
-
import { COLORS } from '../utils/colors-values';
|
|
19
18
|
|
|
20
19
|
interface HexInputProps {
|
|
21
20
|
color: Colord;
|
|
@@ -36,7 +35,7 @@ export const HexInput = ( { color, onChange, enableAlpha }: HexInputProps ) => {
|
|
|
36
35
|
<Spacer
|
|
37
36
|
as={ Text }
|
|
38
37
|
marginLeft={ space( 3.5 ) }
|
|
39
|
-
color=
|
|
38
|
+
color="blue"
|
|
40
39
|
lineHeight={ 1 }
|
|
41
40
|
>
|
|
42
41
|
#
|
|
@@ -6,7 +6,6 @@ import { Text } from '../text';
|
|
|
6
6
|
import { Spacer } from '../spacer';
|
|
7
7
|
import { space } from '../ui/utils/space';
|
|
8
8
|
import { RangeControl, NumberControlWrapper } from './styles';
|
|
9
|
-
import { COLORS } from '../utils/colors-values';
|
|
10
9
|
|
|
11
10
|
interface InputWithSliderProps {
|
|
12
11
|
min: number;
|
|
@@ -38,7 +37,7 @@ export const InputWithSlider = ( {
|
|
|
38
37
|
<Spacer
|
|
39
38
|
as={ Text }
|
|
40
39
|
paddingLeft={ space( 3.5 ) }
|
|
41
|
-
color=
|
|
40
|
+
color="blue"
|
|
42
41
|
lineHeight={ 1 }
|
|
43
42
|
>
|
|
44
43
|
{ abbreviation }
|
|
@@ -21,7 +21,7 @@ These are the same as [the ones for `SelectControl`s](/packages/components/src/s
|
|
|
21
21
|
* WordPress dependencies
|
|
22
22
|
*/
|
|
23
23
|
import { ComboboxControl } from '@wordpress/components';
|
|
24
|
-
import { useState } from '@wordpress/
|
|
24
|
+
import { useState } from '@wordpress/compose';
|
|
25
25
|
|
|
26
26
|
const options = [
|
|
27
27
|
{
|
|
@@ -51,7 +51,7 @@ function MyComboboxControl() {
|
|
|
51
51
|
value={ fontSize }
|
|
52
52
|
onChange={ setFontSize }
|
|
53
53
|
options={ filteredOptions }
|
|
54
|
-
|
|
54
|
+
onInputChange={ ( inputValue ) =>
|
|
55
55
|
setFilteredOptions(
|
|
56
56
|
options.filter( ( option ) =>
|
|
57
57
|
option.label
|
|
@@ -111,6 +111,10 @@ $components-custom-gradient-picker__padding: $grid-unit-20; // 48px container, 1
|
|
|
111
111
|
|
|
112
112
|
// All these styles should be made generic and changed on the inputs for all components.
|
|
113
113
|
.components-custom-gradient-picker {
|
|
114
|
+
.components-select-control__input,
|
|
115
|
+
.components-input-control__input {
|
|
116
|
+
height: 40px !important;
|
|
117
|
+
}
|
|
114
118
|
.components-input-control__label {
|
|
115
119
|
line-height: 1;
|
|
116
120
|
padding-bottom: $grid-unit-10 !important;
|
package/src/date-time/README.md
CHANGED
|
@@ -64,10 +64,3 @@ A callback function which receives a Date object representing a day as an argume
|
|
|
64
64
|
|
|
65
65
|
- Type: `Function`
|
|
66
66
|
- Required: No
|
|
67
|
-
|
|
68
|
-
### onMonthPreviewed
|
|
69
|
-
|
|
70
|
-
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
|
-
|
|
72
|
-
- Type: `Function`
|
|
73
|
-
- Required: No
|
package/src/date-time/date.js
CHANGED
|
@@ -11,14 +11,9 @@ import DayPickerSingleDateController from 'react-dates/lib/components/DayPickerS
|
|
|
11
11
|
/**
|
|
12
12
|
* WordPress dependencies
|
|
13
13
|
*/
|
|
14
|
-
import { useEffect, useRef } from '@wordpress/element';
|
|
14
|
+
import { Component, createRef, useEffect, useRef } from '@wordpress/element';
|
|
15
15
|
import { isRTL, _n, sprintf } from '@wordpress/i18n';
|
|
16
16
|
|
|
17
|
-
/**
|
|
18
|
-
* Internal dependencies
|
|
19
|
-
*/
|
|
20
|
-
import { getMomentDate } from './utils';
|
|
21
|
-
|
|
22
17
|
/**
|
|
23
18
|
* Module Constants
|
|
24
19
|
*/
|
|
@@ -75,18 +70,21 @@ function DatePickerDay( { day, events = [] } ) {
|
|
|
75
70
|
);
|
|
76
71
|
}
|
|
77
72
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
73
|
+
class DatePicker extends Component {
|
|
74
|
+
constructor() {
|
|
75
|
+
super( ...arguments );
|
|
76
|
+
|
|
77
|
+
this.onChangeMoment = this.onChangeMoment.bind( this );
|
|
78
|
+
this.nodeRef = createRef();
|
|
79
|
+
this.onMonthPreviewedHandler = this.onMonthPreviewedHandler.bind(
|
|
80
|
+
this
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
onMonthPreviewedHandler( newMonthDate ) {
|
|
85
|
+
this.props.onMonthPreviewed?.( newMonthDate.toISOString() );
|
|
86
|
+
this.keepFocusInside();
|
|
87
|
+
}
|
|
90
88
|
|
|
91
89
|
/*
|
|
92
90
|
* Todo: We should remove this function ASAP.
|
|
@@ -94,21 +92,21 @@ function DatePicker( {
|
|
|
94
92
|
* This focus loss closes the date picker popover.
|
|
95
93
|
* Ideally we should add an upstream commit on react-dates to fix this issue.
|
|
96
94
|
*/
|
|
97
|
-
|
|
98
|
-
if ( ! nodeRef.current ) {
|
|
95
|
+
keepFocusInside() {
|
|
96
|
+
if ( ! this.nodeRef.current ) {
|
|
99
97
|
return;
|
|
100
98
|
}
|
|
101
99
|
|
|
102
|
-
const { ownerDocument } = nodeRef.current;
|
|
100
|
+
const { ownerDocument } = this.nodeRef.current;
|
|
103
101
|
const { activeElement } = ownerDocument;
|
|
104
102
|
|
|
105
103
|
// If focus was lost.
|
|
106
104
|
if (
|
|
107
105
|
! activeElement ||
|
|
108
|
-
! nodeRef.current.contains( ownerDocument.activeElement )
|
|
106
|
+
! this.nodeRef.current.contains( ownerDocument.activeElement )
|
|
109
107
|
) {
|
|
110
108
|
// Retrieve the focus region div.
|
|
111
|
-
const focusRegion = nodeRef.current.querySelector(
|
|
109
|
+
const focusRegion = this.nodeRef.current.querySelector(
|
|
112
110
|
'.DayPicker_focusRegion'
|
|
113
111
|
);
|
|
114
112
|
if ( ! focusRegion ) {
|
|
@@ -117,9 +115,11 @@ function DatePicker( {
|
|
|
117
115
|
// Keep the focus on focus region.
|
|
118
116
|
focusRegion.focus();
|
|
119
117
|
}
|
|
120
|
-
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
onChangeMoment( newDate ) {
|
|
121
|
+
const { currentDate, onChange } = this.props;
|
|
121
122
|
|
|
122
|
-
const onChangeMoment = ( newDate ) => {
|
|
123
123
|
// If currentDate is null, use now as momentTime to designate hours, minutes, seconds.
|
|
124
124
|
const momentDate = currentDate ? moment( currentDate ) : moment();
|
|
125
125
|
const momentTime = {
|
|
@@ -131,54 +131,71 @@ function DatePicker( {
|
|
|
131
131
|
onChange( newDate.set( momentTime ).format( TIMEZONELESS_FORMAT ) );
|
|
132
132
|
|
|
133
133
|
// Keep focus on the date picker.
|
|
134
|
-
keepFocusInside();
|
|
135
|
-
}
|
|
134
|
+
this.keepFocusInside();
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Create a Moment object from a date string. With no currentDate supplied, default to a Moment
|
|
139
|
+
* object representing now. If a null value is passed, return a null value.
|
|
140
|
+
*
|
|
141
|
+
* @param {?string} currentDate Date representing the currently selected date or null to signify no selection.
|
|
142
|
+
* @return {?moment.Moment} Moment object for selected date or null.
|
|
143
|
+
*/
|
|
144
|
+
getMomentDate( currentDate ) {
|
|
145
|
+
if ( null === currentDate ) {
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
return currentDate ? moment( currentDate ) : moment();
|
|
149
|
+
}
|
|
136
150
|
|
|
137
|
-
|
|
138
|
-
if ( ! events?.length ) {
|
|
151
|
+
getEventsPerDay( day ) {
|
|
152
|
+
if ( ! this.props.events?.length ) {
|
|
139
153
|
return [];
|
|
140
154
|
}
|
|
141
155
|
|
|
142
|
-
return events.filter( ( eventDay ) =>
|
|
156
|
+
return this.props.events.filter( ( eventDay ) =>
|
|
143
157
|
day.isSame( eventDay.date, 'day' )
|
|
144
158
|
);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
render() {
|
|
162
|
+
const { currentDate, isInvalidDate } = this.props;
|
|
163
|
+
const momentDate = this.getMomentDate( currentDate );
|
|
164
|
+
|
|
165
|
+
return (
|
|
166
|
+
<div className="components-datetime__date" ref={ this.nodeRef }>
|
|
167
|
+
<DayPickerSingleDateController
|
|
168
|
+
date={ momentDate }
|
|
169
|
+
daySize={ 30 }
|
|
170
|
+
focused
|
|
171
|
+
hideKeyboardShortcutsPanel
|
|
172
|
+
// This is a hack to force the calendar to update on month or year change
|
|
173
|
+
// https://github.com/airbnb/react-dates/issues/240#issuecomment-361776665
|
|
174
|
+
key={ `datepicker-controller-${
|
|
175
|
+
momentDate ? momentDate.format( 'MM-YYYY' ) : 'null'
|
|
176
|
+
}` }
|
|
177
|
+
noBorder
|
|
178
|
+
numberOfMonths={ 1 }
|
|
179
|
+
onDateChange={ this.onChangeMoment }
|
|
180
|
+
transitionDuration={ 0 }
|
|
181
|
+
weekDayFormat="ddd"
|
|
182
|
+
dayAriaLabelFormat={ ARIAL_LABEL_TIME_FORMAT }
|
|
183
|
+
isRTL={ isRTL() }
|
|
184
|
+
isOutsideRange={ ( date ) => {
|
|
185
|
+
return isInvalidDate && isInvalidDate( date.toDate() );
|
|
186
|
+
} }
|
|
187
|
+
onPrevMonthClick={ this.onMonthPreviewedHandler }
|
|
188
|
+
onNextMonthClick={ this.onMonthPreviewedHandler }
|
|
189
|
+
renderDayContents={ ( day ) => (
|
|
190
|
+
<DatePickerDay
|
|
191
|
+
day={ day }
|
|
192
|
+
events={ this.getEventsPerDay( day ) }
|
|
193
|
+
/>
|
|
194
|
+
) }
|
|
195
|
+
/>
|
|
196
|
+
</div>
|
|
197
|
+
);
|
|
198
|
+
}
|
|
182
199
|
}
|
|
183
200
|
|
|
184
201
|
export default DatePicker;
|
|
@@ -31,6 +31,32 @@ describe( 'DatePicker', () => {
|
|
|
31
31
|
expect( moment.isMoment( date ) ).toBe( true );
|
|
32
32
|
} );
|
|
33
33
|
|
|
34
|
+
describe( 'getMomentDate', () => {
|
|
35
|
+
it( 'should return a Moment object representing a given date string', () => {
|
|
36
|
+
const currentDate = '1986-10-18T23:00:00';
|
|
37
|
+
const wrapper = shallow( <DatePicker /> );
|
|
38
|
+
const momentDate = wrapper.instance().getMomentDate( currentDate );
|
|
39
|
+
|
|
40
|
+
expect( moment.isMoment( momentDate ) ).toBe( true );
|
|
41
|
+
expect( momentDate.isSame( moment( currentDate ) ) ).toBe( true );
|
|
42
|
+
} );
|
|
43
|
+
|
|
44
|
+
it( 'should return null when given a null agrument', () => {
|
|
45
|
+
const currentDate = null;
|
|
46
|
+
const wrapper = shallow( <DatePicker /> );
|
|
47
|
+
const momentDate = wrapper.instance().getMomentDate( currentDate );
|
|
48
|
+
|
|
49
|
+
expect( momentDate ).toBeNull();
|
|
50
|
+
} );
|
|
51
|
+
|
|
52
|
+
it( 'should return a Moment object representing now when given an undefined argument', () => {
|
|
53
|
+
const wrapper = shallow( <DatePicker /> );
|
|
54
|
+
const momentDate = wrapper.instance().getMomentDate();
|
|
55
|
+
|
|
56
|
+
expect( moment.isMoment( momentDate ) ).toBe( true );
|
|
57
|
+
} );
|
|
58
|
+
} );
|
|
59
|
+
|
|
34
60
|
describe( 'onChangeMoment', () => {
|
|
35
61
|
it( 'should call onChange with a formated date of the input', () => {
|
|
36
62
|
const onChangeSpy = jest.fn();
|
|
@@ -43,7 +69,7 @@ describe( 'DatePicker', () => {
|
|
|
43
69
|
);
|
|
44
70
|
const newDate = moment();
|
|
45
71
|
|
|
46
|
-
wrapper.
|
|
72
|
+
wrapper.instance().onChangeMoment( newDate );
|
|
47
73
|
|
|
48
74
|
expect( onChangeSpy ).toHaveBeenCalledWith(
|
|
49
75
|
newDate.format( TIMEZONELESS_FORMAT )
|
|
@@ -61,7 +87,7 @@ describe( 'DatePicker', () => {
|
|
|
61
87
|
minutes: current.minutes(),
|
|
62
88
|
seconds: current.seconds(),
|
|
63
89
|
} );
|
|
64
|
-
wrapper.
|
|
90
|
+
wrapper.instance().onChangeMoment( newDate );
|
|
65
91
|
|
|
66
92
|
expect(
|
|
67
93
|
moment( onChangeSpyArgument ).isSame(
|
|
@@ -84,7 +110,7 @@ describe( 'DatePicker', () => {
|
|
|
84
110
|
minutes: current.minutes(),
|
|
85
111
|
seconds: current.seconds(),
|
|
86
112
|
} );
|
|
87
|
-
wrapper.
|
|
113
|
+
wrapper.instance().onChangeMoment( newDate );
|
|
88
114
|
|
|
89
115
|
expect(
|
|
90
116
|
moment( onChangeSpyArgument ).isSame(
|
|
@@ -13,7 +13,7 @@ In a block's `edit` implementation, render a `<DimensionControl />` component.
|
|
|
13
13
|
```jsx
|
|
14
14
|
import { registerBlockType } from '@wordpress/blocks';
|
|
15
15
|
import { __ } from '@wordpress/i18n';
|
|
16
|
-
import { DimensionControl } from '@wordpress/
|
|
16
|
+
import { DimensionControl } from '@wordpress/block-editor';
|
|
17
17
|
|
|
18
18
|
registerBlockType( 'my-plugin/my-block', {
|
|
19
19
|
// ...
|
package/src/divider/README.md
CHANGED
|
@@ -9,43 +9,15 @@ This feature is still experimental. “Experimental” means this is an early im
|
|
|
9
9
|
## Usage
|
|
10
10
|
|
|
11
11
|
```jsx
|
|
12
|
-
import {
|
|
13
|
-
__experimentalDivider as Divider,
|
|
14
|
-
__experimentalText as Text,
|
|
15
|
-
__experimentalVStack as VStack,
|
|
16
|
-
} from `@wordpress/components`;
|
|
12
|
+
import { Divider, FormGroup, ListGroup } from '@wordpress/components/ui';
|
|
17
13
|
|
|
18
14
|
function Example() {
|
|
19
15
|
return (
|
|
20
|
-
<
|
|
21
|
-
<
|
|
16
|
+
<ListGroup>
|
|
17
|
+
<FormGroup>...</FormGroup>
|
|
22
18
|
<Divider />
|
|
23
|
-
<
|
|
24
|
-
</
|
|
19
|
+
<FormGroup>...</FormGroup>
|
|
20
|
+
</ListGroup>
|
|
25
21
|
);
|
|
26
22
|
}
|
|
27
23
|
```
|
|
28
|
-
|
|
29
|
-
## Props
|
|
30
|
-
|
|
31
|
-
### `margin`: `number`
|
|
32
|
-
|
|
33
|
-
Adjusts all margins on the inline dimension.
|
|
34
|
-
|
|
35
|
-
- Required: No
|
|
36
|
-
|
|
37
|
-
### `marginStart`: `number`
|
|
38
|
-
|
|
39
|
-
Adjusts the inline-start margin.
|
|
40
|
-
|
|
41
|
-
- Required: No
|
|
42
|
-
|
|
43
|
-
### `marginEnd`: `number`
|
|
44
|
-
|
|
45
|
-
Adjusts the inline-end margin.
|
|
46
|
-
|
|
47
|
-
- Required: No
|
|
48
|
-
|
|
49
|
-
### Inherited props
|
|
50
|
-
|
|
51
|
-
`Divider` also inherits all of the [`Separator` props](https://reakit.io/docs/separator/).
|
|
@@ -38,18 +38,17 @@ function Divider(
|
|
|
38
38
|
* @example
|
|
39
39
|
* ```js
|
|
40
40
|
* import {
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* } from `@wordpress/components`;
|
|
41
|
+
* __experimentalDivider as Divider,
|
|
42
|
+
* __experimentalText as Text }
|
|
43
|
+
* from `@wordpress/components`;
|
|
45
44
|
*
|
|
46
45
|
* function Example() {
|
|
47
46
|
* return (
|
|
48
|
-
* <
|
|
49
|
-
* <
|
|
47
|
+
* <ListGroup>
|
|
48
|
+
* <FormGroup>...</FormGroup>
|
|
50
49
|
* <Divider />
|
|
51
|
-
* <
|
|
52
|
-
* </
|
|
50
|
+
* <FormGroup>...</FormGroup>
|
|
51
|
+
* </ListGroup>
|
|
53
52
|
* );
|
|
54
53
|
* }
|
|
55
54
|
* ```
|