@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
|
@@ -1,64 +1,38 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { number } from '@storybook/addon-knobs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { useCx } from '../../utils';
|
|
10
|
-
import { Text } from '../../text';
|
|
11
9
|
import { Divider } from '..';
|
|
12
10
|
|
|
13
11
|
export default {
|
|
14
12
|
component: Divider,
|
|
15
13
|
title: 'Components (Experimental)/Divider',
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
control: { type: 'number' },
|
|
19
|
-
},
|
|
20
|
-
marginStart: {
|
|
21
|
-
control: { type: 'number' },
|
|
22
|
-
},
|
|
23
|
-
marginEnd: {
|
|
24
|
-
control: { type: 'number' },
|
|
25
|
-
},
|
|
14
|
+
parameters: {
|
|
15
|
+
knobs: { disabled: false },
|
|
26
16
|
},
|
|
27
17
|
};
|
|
28
18
|
|
|
29
|
-
const
|
|
30
|
-
<
|
|
31
|
-
<Text>Some text before the divider</Text>
|
|
32
|
-
<Divider { ...args } />
|
|
33
|
-
<Text>Some text after the divider</Text>
|
|
34
|
-
</div>
|
|
19
|
+
const BlackDivider = ( props ) => (
|
|
20
|
+
<Divider { ...props } style={ { borderColor: 'black' } } />
|
|
35
21
|
);
|
|
36
22
|
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
` );
|
|
44
|
-
|
|
45
|
-
return (
|
|
46
|
-
<div className={ wrapperClassName }>
|
|
47
|
-
<Text>Some text before the divider</Text>
|
|
48
|
-
<Divider orientation="vertical" { ...args } />
|
|
49
|
-
<Text>Some text after the divider</Text>
|
|
50
|
-
</div>
|
|
51
|
-
);
|
|
23
|
+
export const _default = () => {
|
|
24
|
+
const props = {
|
|
25
|
+
margin: number( 'margin', 0 ),
|
|
26
|
+
};
|
|
27
|
+
// make the border color black to give higher contrast and help it appear in storybook better
|
|
28
|
+
return <BlackDivider { ...props } />;
|
|
52
29
|
};
|
|
53
30
|
|
|
54
|
-
export const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
};
|
|
31
|
+
export const splitMargins = () => {
|
|
32
|
+
const props = {
|
|
33
|
+
marginTop: number( 'marginTop', 0 ),
|
|
34
|
+
marginBottom: number( 'marginBottom', 0 ),
|
|
35
|
+
};
|
|
60
36
|
|
|
61
|
-
|
|
62
|
-
Vertical.args = {
|
|
63
|
-
...Horizontal.args,
|
|
37
|
+
return <BlackDivider { ...props } />;
|
|
64
38
|
};
|
package/src/divider/styles.ts
CHANGED
|
@@ -8,66 +8,29 @@ import { css } from '@emotion/react';
|
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
10
|
import { space } from '../ui/utils/space';
|
|
11
|
-
import
|
|
12
|
-
import type {
|
|
11
|
+
import CONFIG from '../utils/config-values';
|
|
12
|
+
import type { OwnProps } from './types';
|
|
13
13
|
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
horizontal: {
|
|
23
|
-
start: 'marginTop',
|
|
24
|
-
end: 'marginBottom',
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
// Renders the correct margins given the Divider's `orientation` and the writing direction.
|
|
29
|
-
// When both the generic `margin` and the specific `marginStart|marginEnd` props are defined,
|
|
30
|
-
// the latter will take priority.
|
|
31
|
-
const renderMargin = ( {
|
|
32
|
-
'aria-orientation': orientation = 'horizontal',
|
|
33
|
-
margin,
|
|
34
|
-
marginStart,
|
|
35
|
-
marginEnd,
|
|
36
|
-
}: Props ) =>
|
|
37
|
-
css(
|
|
38
|
-
rtl( {
|
|
39
|
-
[ MARGIN_DIRECTIONS[ orientation ].start ]: space(
|
|
40
|
-
marginStart ?? margin
|
|
41
|
-
),
|
|
42
|
-
[ MARGIN_DIRECTIONS[ orientation ].end ]: space(
|
|
43
|
-
marginEnd ?? margin
|
|
44
|
-
),
|
|
45
|
-
} )()
|
|
46
|
-
);
|
|
14
|
+
const renderMargin = ( { margin, marginTop, marginBottom }: OwnProps ) => {
|
|
15
|
+
if ( typeof margin !== 'undefined' ) {
|
|
16
|
+
return css( {
|
|
17
|
+
marginBottom: space( margin ),
|
|
18
|
+
marginTop: space( margin ),
|
|
19
|
+
} );
|
|
20
|
+
}
|
|
47
21
|
|
|
48
|
-
const renderBorder = ( {
|
|
49
|
-
'aria-orientation': orientation = 'horizontal',
|
|
50
|
-
}: Props ) => {
|
|
51
22
|
return css( {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
: 'borderBottom' ]: '1px solid currentColor',
|
|
23
|
+
marginTop: space( marginTop ),
|
|
24
|
+
marginBottom: space( marginBottom ),
|
|
55
25
|
} );
|
|
56
26
|
};
|
|
57
27
|
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
height: orientation === 'vertical' ? 'auto' : 0,
|
|
63
|
-
width: orientation === 'vertical' ? 0 : 'auto',
|
|
64
|
-
} );
|
|
65
|
-
|
|
66
|
-
export const DividerView = styled.hr< Props >`
|
|
67
|
-
border: 0;
|
|
28
|
+
export const DividerView = styled.hr< OwnProps >`
|
|
29
|
+
border-color: ${ CONFIG.colorDivider };
|
|
30
|
+
border-width: 0 0 1px 0;
|
|
31
|
+
height: 0;
|
|
68
32
|
margin: 0;
|
|
33
|
+
width: auto;
|
|
69
34
|
|
|
70
|
-
${ renderBorder }
|
|
71
|
-
${ renderSize }
|
|
72
35
|
${ renderMargin }
|
|
73
36
|
`;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`props should render correctly 1`] = `
|
|
4
4
|
.emotion-0 {
|
|
5
|
-
border: 0;
|
|
6
|
-
|
|
7
|
-
border-bottom: 1px solid currentColor;
|
|
5
|
+
border-color: rgba(0, 0, 0, 0.1);
|
|
6
|
+
border-width: 0 0 1px 0;
|
|
8
7
|
height: 0;
|
|
8
|
+
margin: 0;
|
|
9
9
|
width: auto;
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -25,8 +25,8 @@ Snapshot Diff:
|
|
|
25
25
|
|
|
26
26
|
@@ -2,10 +2,8 @@
|
|
27
27
|
Object {
|
|
28
|
-
"border": "0",
|
|
29
|
-
"border-
|
|
28
|
+
"border-color": "rgba(0, 0, 0, 0.1)",
|
|
29
|
+
"border-width": "0 0 1px 0",
|
|
30
30
|
"height": "0",
|
|
31
31
|
"margin": "0",
|
|
32
32
|
- "margin-bottom": "calc(4px * 7)",
|
|
@@ -36,15 +36,15 @@ Snapshot Diff:
|
|
|
36
36
|
]
|
|
37
37
|
`;
|
|
38
38
|
|
|
39
|
-
exports[`props should render
|
|
39
|
+
exports[`props should render marginBottom 1`] = `
|
|
40
40
|
Snapshot Diff:
|
|
41
41
|
- Received styles
|
|
42
42
|
+ Base styles
|
|
43
43
|
|
|
44
44
|
@@ -2,9 +2,8 @@
|
|
45
45
|
Object {
|
|
46
|
-
"border": "0",
|
|
47
|
-
"border-
|
|
46
|
+
"border-color": "rgba(0, 0, 0, 0.1)",
|
|
47
|
+
"border-width": "0 0 1px 0",
|
|
48
48
|
"height": "0",
|
|
49
49
|
"margin": "0",
|
|
50
50
|
- "margin-bottom": "calc(4px * 5)",
|
|
@@ -53,15 +53,15 @@ Snapshot Diff:
|
|
|
53
53
|
]
|
|
54
54
|
`;
|
|
55
55
|
|
|
56
|
-
exports[`props should render
|
|
56
|
+
exports[`props should render marginTop 1`] = `
|
|
57
57
|
Snapshot Diff:
|
|
58
58
|
- Received styles
|
|
59
59
|
+ Base styles
|
|
60
60
|
|
|
61
61
|
@@ -2,9 +2,8 @@
|
|
62
62
|
Object {
|
|
63
|
-
"border": "0",
|
|
64
|
-
"border-
|
|
63
|
+
"border-color": "rgba(0, 0, 0, 0.1)",
|
|
64
|
+
"border-width": "0 0 1px 0",
|
|
65
65
|
"height": "0",
|
|
66
66
|
"margin": "0",
|
|
67
67
|
- "margin-top": "calc(4px * 5)",
|
|
@@ -18,15 +18,15 @@ describe( 'props', () => {
|
|
|
18
18
|
expect( base.container.firstChild ).toMatchSnapshot();
|
|
19
19
|
} );
|
|
20
20
|
|
|
21
|
-
test( 'should render
|
|
22
|
-
const { container } = render( <Divider
|
|
21
|
+
test( 'should render marginTop', () => {
|
|
22
|
+
const { container } = render( <Divider marginTop={ 5 } /> );
|
|
23
23
|
expect( container.firstChild ).toMatchStyleDiffSnapshot(
|
|
24
24
|
base.container.firstChild
|
|
25
25
|
);
|
|
26
26
|
} );
|
|
27
27
|
|
|
28
|
-
test( 'should render
|
|
29
|
-
const { container } = render( <Divider
|
|
28
|
+
test( 'should render marginBottom', () => {
|
|
29
|
+
const { container } = render( <Divider marginBottom={ 5 } /> );
|
|
30
30
|
expect( container.firstChild ).toMatchStyleDiffSnapshot(
|
|
31
31
|
base.container.firstChild
|
|
32
32
|
);
|
package/src/divider/types.ts
CHANGED
|
@@ -11,17 +11,17 @@ import type { SpaceInput } from '../ui/utils/space';
|
|
|
11
11
|
|
|
12
12
|
export interface OwnProps {
|
|
13
13
|
/**
|
|
14
|
-
* Adjusts all margins
|
|
14
|
+
* Adjusts all margins.
|
|
15
15
|
*/
|
|
16
16
|
margin?: SpaceInput;
|
|
17
17
|
/**
|
|
18
|
-
* Adjusts
|
|
18
|
+
* Adjusts top margins.
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
marginTop?: SpaceInput;
|
|
21
21
|
/**
|
|
22
|
-
* Adjusts
|
|
22
|
+
* Adjusts bottom margins.
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
marginBottom?: SpaceInput;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export interface Props extends Omit< SeparatorProps, 'children' >, OwnProps {}
|
package/src/drop-zone/index.js
CHANGED
|
@@ -39,14 +39,10 @@ export default function DropZoneComponent( {
|
|
|
39
39
|
const files = getFilesFromDataTransfer( event.dataTransfer );
|
|
40
40
|
const html = event.dataTransfer.getData( 'text/html' );
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
* From Windows Chrome 96, the `event.dataTransfer` returns both file object and HTML.
|
|
44
|
-
* The order of the checks is important to recognise the HTML drop.
|
|
45
|
-
*/
|
|
46
|
-
if ( html && onHTMLDrop ) {
|
|
47
|
-
onHTMLDrop( html );
|
|
48
|
-
} else if ( files.length && onFilesDrop ) {
|
|
42
|
+
if ( files.length && onFilesDrop ) {
|
|
49
43
|
onFilesDrop( files );
|
|
44
|
+
} else if ( html && onHTMLDrop ) {
|
|
45
|
+
onHTMLDrop( html );
|
|
50
46
|
} else if ( onDrop ) {
|
|
51
47
|
onDrop( event );
|
|
52
48
|
}
|
|
@@ -56,19 +52,15 @@ export default function DropZoneComponent( {
|
|
|
56
52
|
|
|
57
53
|
let _type = 'default';
|
|
58
54
|
|
|
59
|
-
|
|
60
|
-
* From Windows Chrome 96, the `event.dataTransfer` returns both file object and HTML.
|
|
61
|
-
* The order of the checks is important to recognise the HTML drop.
|
|
62
|
-
*/
|
|
63
|
-
if ( includes( event.dataTransfer.types, 'text/html' ) ) {
|
|
64
|
-
_type = 'html';
|
|
65
|
-
} else if (
|
|
55
|
+
if (
|
|
66
56
|
// Check for the types because sometimes the files themselves
|
|
67
57
|
// are only available on drop.
|
|
68
58
|
includes( event.dataTransfer.types, 'Files' ) ||
|
|
69
59
|
getFilesFromDataTransfer( event.dataTransfer ).length > 0
|
|
70
60
|
) {
|
|
71
61
|
_type = 'file';
|
|
62
|
+
} else if ( includes( event.dataTransfer.types, 'text/html' ) ) {
|
|
63
|
+
_type = 'html';
|
|
72
64
|
}
|
|
73
65
|
|
|
74
66
|
setType( _type );
|
|
@@ -5,7 +5,6 @@ import deprecated from '@wordpress/deprecated';
|
|
|
5
5
|
|
|
6
6
|
export default function DropZoneProvider( { children } ) {
|
|
7
7
|
deprecated( 'wp.components.DropZoneProvider', {
|
|
8
|
-
since: '5.8',
|
|
9
8
|
hint:
|
|
10
9
|
'wp.component.DropZone no longer needs a provider. wp.components.DropZoneProvider is safe to remove from your code.',
|
|
11
10
|
} );
|
package/src/flyout/styles.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import styled
|
|
4
|
+
import styled from '@emotion/styled';
|
|
5
5
|
// eslint-disable-next-line no-restricted-imports
|
|
6
6
|
import { Popover as ReakitPopover } from 'reakit';
|
|
7
7
|
|
|
@@ -12,9 +12,7 @@ import { Card, CardBody } from '../card';
|
|
|
12
12
|
import * as ZIndex from '../utils/z-index';
|
|
13
13
|
import CONFIG from '../utils/config-values';
|
|
14
14
|
|
|
15
|
-
export const FlyoutContentView
|
|
16
|
-
React.ComponentPropsWithoutRef< typeof ReakitPopover >
|
|
17
|
-
> = styled( ReakitPopover )`
|
|
15
|
+
export const FlyoutContentView = styled( ReakitPopover )`
|
|
18
16
|
z-index: ${ ZIndex.Flyout };
|
|
19
17
|
box-sizing: border-box;
|
|
20
18
|
opacity: 0;
|
|
@@ -7,7 +7,6 @@ import deprecated from '@wordpress/deprecated';
|
|
|
7
7
|
export default function FocusableIframe( { iframeRef, ...props } ) {
|
|
8
8
|
const ref = useMergeRefs( [ iframeRef, useFocusableIframe() ] );
|
|
9
9
|
deprecated( 'wp.components.FocusableIframe', {
|
|
10
|
-
since: '5.9',
|
|
11
10
|
alternative: 'wp.compose.useFocusableIframe',
|
|
12
11
|
} );
|
|
13
12
|
// Disable reason: The rendered iframe is a pass-through component,
|
package/src/index.js
CHANGED
|
@@ -47,7 +47,6 @@ export {
|
|
|
47
47
|
CompositeItem as __unstableCompositeItem,
|
|
48
48
|
useCompositeState as __unstableUseCompositeState,
|
|
49
49
|
} from './composite';
|
|
50
|
-
export { ConfirmDialog as __experimentalConfirmDialog } from './confirm-dialog';
|
|
51
50
|
export { default as CustomSelectControl } from './custom-select-control';
|
|
52
51
|
export { default as Dashicon } from './dashicon';
|
|
53
52
|
export { default as DateTimePicker, DatePicker, TimePicker } from './date-time';
|
|
@@ -17,7 +17,7 @@ export default {
|
|
|
17
17
|
title: 'Components/InputControl',
|
|
18
18
|
component: InputControl,
|
|
19
19
|
parameters: {
|
|
20
|
-
knobs: {
|
|
20
|
+
knobs: { disabled: false },
|
|
21
21
|
},
|
|
22
22
|
};
|
|
23
23
|
|
|
@@ -44,7 +44,6 @@ function Example() {
|
|
|
44
44
|
{
|
|
45
45
|
default: 'default',
|
|
46
46
|
small: 'small',
|
|
47
|
-
'__unstable-large': '__unstable-large',
|
|
48
47
|
},
|
|
49
48
|
'default'
|
|
50
49
|
),
|
|
@@ -13,7 +13,7 @@ import type { WordPressComponentProps } from '../../ui/context';
|
|
|
13
13
|
import { Flex, FlexItem } from '../../flex';
|
|
14
14
|
import { Text } from '../../text';
|
|
15
15
|
import { COLORS, rtl } from '../../utils';
|
|
16
|
-
import type { LabelPosition
|
|
16
|
+
import type { LabelPosition } from '../types';
|
|
17
17
|
|
|
18
18
|
type ContainerProps = {
|
|
19
19
|
disabled?: boolean;
|
|
@@ -105,6 +105,8 @@ export const Container = styled.div< ContainerProps >`
|
|
|
105
105
|
${ containerWidthStyles }
|
|
106
106
|
`;
|
|
107
107
|
|
|
108
|
+
type Size = 'default' | 'small';
|
|
109
|
+
|
|
108
110
|
type InputProps = {
|
|
109
111
|
disabled?: boolean;
|
|
110
112
|
inputSize?: Size;
|
|
@@ -124,7 +126,6 @@ const fontSizeStyles = ( { inputSize: size }: InputProps ) => {
|
|
|
124
126
|
const sizes = {
|
|
125
127
|
default: '13px',
|
|
126
128
|
small: '11px',
|
|
127
|
-
'__unstable-large': '13px',
|
|
128
129
|
};
|
|
129
130
|
|
|
130
131
|
const fontSize = sizes[ size as Size ] || sizes.default;
|
|
@@ -147,22 +148,11 @@ const sizeStyles = ( { inputSize: size }: InputProps ) => {
|
|
|
147
148
|
height: 30,
|
|
148
149
|
lineHeight: 1,
|
|
149
150
|
minHeight: 30,
|
|
150
|
-
paddingLeft: 8,
|
|
151
|
-
paddingRight: 8,
|
|
152
151
|
},
|
|
153
152
|
small: {
|
|
154
153
|
height: 24,
|
|
155
154
|
lineHeight: 1,
|
|
156
155
|
minHeight: 24,
|
|
157
|
-
paddingLeft: 8,
|
|
158
|
-
paddingRight: 8,
|
|
159
|
-
},
|
|
160
|
-
'__unstable-large': {
|
|
161
|
-
height: 40,
|
|
162
|
-
lineHeight: 1,
|
|
163
|
-
minHeight: 40,
|
|
164
|
-
paddingLeft: 16,
|
|
165
|
-
paddingRight: 16,
|
|
166
156
|
},
|
|
167
157
|
};
|
|
168
158
|
|
|
@@ -215,6 +205,8 @@ export const Input = styled.input< InputProps >`
|
|
|
215
205
|
display: block;
|
|
216
206
|
margin: 0;
|
|
217
207
|
outline: none;
|
|
208
|
+
padding-left: 8px;
|
|
209
|
+
padding-right: 8px;
|
|
218
210
|
width: 100%;
|
|
219
211
|
|
|
220
212
|
${ dragStyles }
|
|
@@ -323,8 +315,6 @@ export const Prefix = styled.span`
|
|
|
323
315
|
`;
|
|
324
316
|
|
|
325
317
|
export const Suffix = styled.span`
|
|
326
|
-
align-items: center;
|
|
327
|
-
align-self: stretch;
|
|
328
318
|
box-sizing: border-box;
|
|
329
|
-
display:
|
|
319
|
+
display: block;
|
|
330
320
|
`;
|
|
@@ -23,14 +23,12 @@ export type DragDirection = 'n' | 's' | 'e' | 'w';
|
|
|
23
23
|
|
|
24
24
|
export type DragProps = Parameters< Parameters< typeof useDrag >[ 0 ] >[ 0 ];
|
|
25
25
|
|
|
26
|
-
export type Size = 'default' | 'small' | '__unstable-large';
|
|
27
|
-
|
|
28
26
|
interface BaseProps {
|
|
29
27
|
__unstableInputWidth?: CSSProperties[ 'width' ];
|
|
30
28
|
hideLabelFromVision?: boolean;
|
|
31
29
|
isFocused: boolean;
|
|
32
30
|
labelPosition?: LabelPosition;
|
|
33
|
-
size?:
|
|
31
|
+
size?: 'default' | 'small';
|
|
34
32
|
}
|
|
35
33
|
|
|
36
34
|
export type InputChangeCallback<
|