@wordpress/components 19.4.0 → 19.5.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 +16 -1
- package/CONTRIBUTING.md +69 -2
- package/build/box-control/unit-control.js +2 -2
- package/build/box-control/unit-control.js.map +1 -1
- package/build/card/card/component.js +2 -2
- package/build/card/card/component.js.map +1 -1
- package/build/card/card-body/component.js +1 -1
- package/build/card/card-body/component.js.map +1 -1
- package/build/card/card-divider/component.js +1 -1
- package/build/card/card-divider/component.js.map +1 -1
- package/build/card/card-footer/component.js +1 -1
- package/build/card/card-footer/component.js.map +1 -1
- package/build/card/card-header/component.js +1 -1
- package/build/card/card-header/component.js.map +1 -1
- package/build/card/card-media/component.js +1 -1
- package/build/card/card-media/component.js.map +1 -1
- package/build/color-palette/index.native.js +35 -30
- package/build/color-palette/index.native.js.map +1 -1
- package/build/color-picker/component.js.map +1 -1
- package/build/color-picker/hex-input.js +6 -9
- package/build/color-picker/hex-input.js.map +1 -1
- package/build/confirm-dialog/component.js.map +1 -1
- package/build/divider/component.js.map +1 -1
- package/build/elevation/component.js +1 -1
- package/build/elevation/component.js.map +1 -1
- package/build/flex/flex/component.js +1 -1
- package/build/flex/flex/component.js.map +1 -1
- package/build/flex/flex-block/component.js +1 -1
- package/build/flex/flex-block/component.js.map +1 -1
- package/build/flex/flex-item/component.js +1 -1
- package/build/flex/flex-item/component.js.map +1 -1
- package/build/flyout/flyout/component.js +1 -1
- package/build/flyout/flyout/component.js.map +1 -1
- package/build/flyout/flyout-content/component.js +1 -1
- package/build/flyout/flyout-content/component.js.map +1 -1
- package/build/focal-point-picker/index.js +18 -12
- package/build/focal-point-picker/index.js.map +1 -1
- package/build/font-size-picker/index.js +0 -1
- package/build/font-size-picker/index.js.map +1 -1
- package/build/grid/component.js +1 -1
- package/build/grid/component.js.map +1 -1
- package/build/h-stack/component.js +1 -1
- package/build/h-stack/component.js.map +1 -1
- package/build/heading/component.js.map +1 -1
- package/build/index.js +12 -0
- package/build/index.js.map +1 -1
- package/build/index.native.js +15 -1
- package/build/index.native.js.map +1 -1
- package/build/input-control/index.js.map +1 -1
- package/build/input-control/input-base.js.map +1 -1
- package/build/input-control/input-field.js +7 -7
- package/build/input-control/input-field.js.map +1 -1
- package/build/input-control/reducer/reducer.js +3 -0
- package/build/input-control/reducer/reducer.js.map +1 -1
- package/build/item-group/item/component.js.map +1 -1
- package/build/item-group/item-group/component.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/color-settings/palette.screen.native.js +26 -9
- package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build/mobile/global-styles-context/utils.native.js +63 -9
- package/build/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build/mobile/inserter-button/index.native.js +3 -3
- package/build/mobile/inserter-button/index.native.js.map +1 -1
- package/build/mobile/inserter-button/sparkles.js +25 -0
- package/build/mobile/inserter-button/sparkles.js.map +1 -0
- package/build/navigator/index.js +16 -0
- package/build/navigator/index.js.map +1 -1
- package/build/navigator/navigator-back-button/component.js +72 -0
- package/build/navigator/navigator-back-button/component.js.map +1 -0
- package/build/navigator/navigator-back-button/hook.js +49 -0
- package/build/navigator/navigator-back-button/hook.js.map +1 -0
- package/build/navigator/navigator-back-button/index.js +16 -0
- package/build/navigator/navigator-back-button/index.js.map +1 -0
- package/build/navigator/navigator-button/component.js +71 -0
- package/build/navigator/navigator-button/component.js.map +1 -0
- package/build/navigator/navigator-button/hook.js +59 -0
- package/build/navigator/navigator-button/hook.js.map +1 -0
- package/build/navigator/navigator-button/index.js +16 -0
- package/build/navigator/navigator-button/index.js.map +1 -0
- package/build/navigator/navigator-provider/component.js +11 -21
- package/build/navigator/navigator-provider/component.js.map +1 -1
- package/build/navigator/navigator-screen/component.js +14 -22
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/resizable-box/index.js.map +1 -1
- package/build/resizable-box/resize-tooltip/index.js.map +1 -1
- package/build/resizable-box/resize-tooltip/label.js.map +1 -1
- package/build/scrollable/component.js +1 -1
- package/build/scrollable/component.js.map +1 -1
- package/build/select-control/index.js.map +1 -1
- package/build/spacer/component.js.map +1 -1
- package/build/surface/component.js +1 -1
- package/build/surface/component.js.map +1 -1
- package/build/text/component.js +1 -1
- package/build/text/component.js.map +1 -1
- package/build/text-control/index.js +2 -2
- package/build/text-control/index.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
- package/build/tools-panel/tools-panel/component.js.map +1 -1
- package/build/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build/tools-panel/tools-panel-item/component.js.map +1 -1
- package/build/tree-grid/index.js +50 -6
- package/build/tree-grid/index.js.map +1 -1
- package/build/truncate/component.js +1 -1
- package/build/truncate/component.js.map +1 -1
- package/build/ui/control-group/component.js +1 -1
- package/build/ui/control-group/component.js.map +1 -1
- package/build/ui/control-label/component.js +1 -1
- package/build/ui/control-label/component.js.map +1 -1
- package/build/ui/form-group/form-group.js +1 -1
- package/build/ui/form-group/form-group.js.map +1 -1
- package/build/ui/shortcut/component.js.map +1 -1
- package/build/ui/spinner/component.js +1 -1
- package/build/ui/spinner/component.js.map +1 -1
- package/build/ui/tooltip/component.js +1 -1
- package/build/ui/tooltip/component.js.map +1 -1
- package/build/ui/tooltip/content.js +1 -1
- package/build/ui/tooltip/content.js.map +1 -1
- package/build/unit-control/index.js.map +1 -1
- package/build/v-stack/component.js +1 -1
- package/build/v-stack/component.js.map +1 -1
- package/build/visually-hidden/component.js +1 -1
- package/build/visually-hidden/component.js.map +1 -1
- package/build/z-stack/component.js.map +1 -1
- package/build-module/box-control/unit-control.js +1 -1
- package/build-module/box-control/unit-control.js.map +1 -1
- package/build-module/card/card/component.js +2 -2
- package/build-module/card/card/component.js.map +1 -1
- package/build-module/card/card-body/component.js +1 -1
- package/build-module/card/card-body/component.js.map +1 -1
- package/build-module/card/card-divider/component.js +1 -1
- package/build-module/card/card-divider/component.js.map +1 -1
- package/build-module/card/card-footer/component.js +1 -1
- package/build-module/card/card-footer/component.js.map +1 -1
- package/build-module/card/card-header/component.js +1 -1
- package/build-module/card/card-header/component.js.map +1 -1
- package/build-module/card/card-media/component.js +1 -1
- package/build-module/card/card-media/component.js.map +1 -1
- package/build-module/color-palette/index.native.js +36 -31
- package/build-module/color-palette/index.native.js.map +1 -1
- package/build-module/color-picker/component.js.map +1 -1
- package/build-module/color-picker/hex-input.js +6 -9
- package/build-module/color-picker/hex-input.js.map +1 -1
- package/build-module/confirm-dialog/component.js.map +1 -1
- package/build-module/divider/component.js.map +1 -1
- package/build-module/elevation/component.js +1 -1
- package/build-module/elevation/component.js.map +1 -1
- package/build-module/flex/flex/component.js +1 -1
- package/build-module/flex/flex/component.js.map +1 -1
- package/build-module/flex/flex-block/component.js +1 -1
- package/build-module/flex/flex-block/component.js.map +1 -1
- package/build-module/flex/flex-item/component.js +1 -1
- package/build-module/flex/flex-item/component.js.map +1 -1
- package/build-module/flyout/flyout/component.js +1 -1
- package/build-module/flyout/flyout/component.js.map +1 -1
- package/build-module/flyout/flyout-content/component.js +1 -1
- package/build-module/flyout/flyout-content/component.js.map +1 -1
- package/build-module/focal-point-picker/index.js +18 -12
- package/build-module/focal-point-picker/index.js.map +1 -1
- package/build-module/font-size-picker/index.js +0 -1
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/grid/component.js +1 -1
- package/build-module/grid/component.js.map +1 -1
- package/build-module/h-stack/component.js +1 -1
- package/build-module/h-stack/component.js.map +1 -1
- package/build-module/heading/component.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +1 -1
- package/build-module/index.native.js.map +1 -1
- package/build-module/input-control/index.js.map +1 -1
- package/build-module/input-control/input-base.js.map +1 -1
- package/build-module/input-control/input-field.js +6 -6
- package/build-module/input-control/input-field.js.map +1 -1
- package/build-module/input-control/reducer/reducer.js +3 -0
- package/build-module/input-control/reducer/reducer.js.map +1 -1
- package/build-module/item-group/item/component.js.map +1 -1
- package/build-module/item-group/item-group/component.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/color-settings/palette.screen.native.js +27 -10
- package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build-module/mobile/global-styles-context/utils.native.js +60 -10
- package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build-module/mobile/inserter-button/index.native.js +1 -1
- package/build-module/mobile/inserter-button/index.native.js.map +1 -1
- package/build-module/mobile/inserter-button/sparkles.js +16 -0
- package/build-module/mobile/inserter-button/sparkles.js.map +1 -0
- package/build-module/navigator/index.js +2 -0
- package/build-module/navigator/index.js.map +1 -1
- package/build-module/navigator/navigator-back-button/component.js +59 -0
- package/build-module/navigator/navigator-back-button/component.js.map +1 -0
- package/build-module/navigator/navigator-back-button/hook.js +36 -0
- package/build-module/navigator/navigator-back-button/hook.js.map +1 -0
- package/build-module/navigator/navigator-back-button/index.js +2 -0
- package/build-module/navigator/navigator-back-button/index.js.map +1 -0
- package/build-module/navigator/navigator-button/component.js +58 -0
- package/build-module/navigator/navigator-button/component.js.map +1 -0
- package/build-module/navigator/navigator-button/hook.js +46 -0
- package/build-module/navigator/navigator-button/hook.js.map +1 -0
- package/build-module/navigator/navigator-button/index.js +2 -0
- package/build-module/navigator/navigator-button/index.js.map +1 -0
- package/build-module/navigator/navigator-provider/component.js +11 -21
- package/build-module/navigator/navigator-provider/component.js.map +1 -1
- package/build-module/navigator/navigator-screen/component.js +13 -22
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/resizable-box/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
- package/build-module/scrollable/component.js +1 -1
- package/build-module/scrollable/component.js.map +1 -1
- package/build-module/select-control/index.js +1 -1
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/spacer/component.js.map +1 -1
- package/build-module/surface/component.js +1 -1
- package/build-module/surface/component.js.map +1 -1
- package/build-module/text/component.js +1 -1
- package/build-module/text/component.js.map +1 -1
- package/build-module/text-control/index.js +2 -2
- package/build-module/text-control/index.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/component.js.map +1 -1
- package/build-module/tree-grid/index.js +51 -7
- package/build-module/tree-grid/index.js.map +1 -1
- package/build-module/truncate/component.js +1 -1
- package/build-module/truncate/component.js.map +1 -1
- package/build-module/ui/control-group/component.js +1 -1
- package/build-module/ui/control-group/component.js.map +1 -1
- package/build-module/ui/control-label/component.js +1 -1
- package/build-module/ui/control-label/component.js.map +1 -1
- package/build-module/ui/form-group/form-group.js +1 -1
- package/build-module/ui/form-group/form-group.js.map +1 -1
- package/build-module/ui/shortcut/component.js.map +1 -1
- package/build-module/ui/spinner/component.js +1 -1
- package/build-module/ui/spinner/component.js.map +1 -1
- package/build-module/ui/tooltip/component.js +1 -1
- package/build-module/ui/tooltip/component.js.map +1 -1
- package/build-module/ui/tooltip/content.js +1 -1
- package/build-module/ui/tooltip/content.js.map +1 -1
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/v-stack/component.js +1 -1
- package/build-module/v-stack/component.js.map +1 -1
- package/build-module/visually-hidden/component.js +1 -1
- package/build-module/visually-hidden/component.js.map +1 -1
- package/build-module/z-stack/component.js.map +1 -1
- package/build-types/card/card-divider/hook.d.ts +0 -1
- package/build-types/card/card-divider/hook.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +2 -4
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/confirm-dialog/component.d.ts +2 -6
- package/build-types/confirm-dialog/component.d.ts.map +1 -1
- package/build-types/flyout/flyout/hook.d.ts +0 -1
- package/build-types/flyout/flyout/hook.d.ts.map +1 -1
- package/build-types/input-control/index.d.ts +3 -3
- package/build-types/input-control/index.d.ts.map +1 -1
- package/build-types/input-control/input-base.d.ts +2 -2
- package/build-types/input-control/input-base.d.ts.map +1 -1
- package/build-types/input-control/input-field.d.ts +1 -3
- package/build-types/input-control/input-field.d.ts.map +1 -1
- package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
- package/build-types/input-control/types.d.ts +1 -1
- package/build-types/input-control/types.d.ts.map +1 -1
- package/build-types/navigator/index.d.ts +2 -0
- package/build-types/navigator/index.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/component.d.ts +38 -0
- package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -0
- package/build-types/navigator/navigator-back-button/hook.d.ts +282 -0
- package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -0
- package/build-types/navigator/navigator-back-button/index.d.ts +2 -0
- package/build-types/navigator/navigator-back-button/index.d.ts.map +1 -0
- package/build-types/navigator/navigator-button/component.d.ts +37 -0
- package/build-types/navigator/navigator-button/component.d.ts.map +1 -0
- package/build-types/navigator/navigator-button/hook.d.ts +282 -0
- package/build-types/navigator/navigator-button/hook.d.ts.map +1 -0
- package/build-types/navigator/navigator-button/index.d.ts +2 -0
- package/build-types/navigator/navigator-button/index.d.ts.map +1 -0
- package/build-types/navigator/navigator-provider/component.d.ts +10 -20
- package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-screen/component.d.ts +10 -20
- package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
- package/build-types/navigator/types.d.ts +21 -0
- package/build-types/navigator/types.d.ts.map +1 -1
- package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
- package/build-types/resizable-box/index.d.ts +2 -2
- package/build-types/resizable-box/index.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
- package/build-types/select-control/index.d.ts +1 -3
- package/build-types/select-control/index.d.ts.map +1 -1
- package/build-types/ui/context/wordpress-component.d.ts +2 -6
- package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
- package/build-types/unit-control/index.d.ts +1 -3
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/z-stack/component.d.ts.map +1 -1
- package/package.json +8 -7
- package/src/alignment-matrix-control/README.md +4 -0
- package/src/alignment-matrix-control/stories/index.js +1 -1
- package/src/base-control/stories/index.js +65 -22
- package/src/box-control/stories/index.js +4 -1
- package/src/box-control/unit-control.js +1 -1
- package/src/card/card/component.js +1 -1
- package/src/card/card-body/component.js +1 -1
- package/src/card/card-divider/component.js +1 -1
- package/src/card/card-footer/component.js +1 -1
- package/src/card/card-header/component.js +1 -1
- package/src/card/card-media/component.js +1 -1
- package/src/color-palette/index.native.js +92 -75
- package/src/color-palette/style.native.scss +10 -5
- package/src/color-picker/component.tsx +2 -2
- package/src/color-picker/hex-input.tsx +9 -9
- package/src/confirm-dialog/component.tsx +2 -2
- package/src/divider/component.tsx +2 -2
- package/src/elevation/component.js +1 -1
- package/src/flex/flex/component.js +1 -1
- package/src/flex/flex-block/component.js +1 -1
- package/src/flex/flex-item/component.js +1 -1
- package/src/flyout/flyout/component.js +1 -1
- package/src/flyout/flyout-content/component.js +1 -1
- package/src/focal-point-picker/README.md +7 -0
- package/src/focal-point-picker/index.js +12 -7
- package/src/focal-point-picker/stories/index.js +30 -0
- package/src/focal-point-picker/test/index.js +44 -0
- package/src/font-size-picker/index.js +0 -1
- package/src/form-file-upload/README.md +1 -1
- package/src/form-file-upload/stories/index.js +51 -0
- package/src/grid/component.js +1 -1
- package/src/h-stack/component.js +1 -1
- package/src/heading/component.tsx +2 -2
- package/src/index.js +2 -0
- package/src/index.native.js +5 -1
- package/src/input-control/index.tsx +2 -2
- package/src/input-control/input-base.tsx +2 -2
- package/src/input-control/input-field.tsx +4 -6
- package/src/input-control/reducer/reducer.ts +3 -0
- package/src/input-control/stories/index.js +1 -1
- package/src/input-control/types.ts +1 -1
- package/src/item-group/item/component.tsx +2 -2
- package/src/item-group/item-group/component.tsx +2 -2
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +10 -1
- package/src/mobile/color-settings/palette.screen.native.js +39 -9
- package/src/mobile/color-settings/style.native.scss +4 -0
- package/src/mobile/global-styles-context/test/fixtures/theme.native.js +27 -0
- package/src/mobile/global-styles-context/test/utils.native.js +2 -2
- package/src/mobile/global-styles-context/utils.native.js +75 -6
- package/src/mobile/inserter-button/index.native.js +1 -2
- package/src/mobile/inserter-button/sparkles.js +15 -0
- package/src/navigation/stories/index.js +1 -1
- package/src/navigator/index.ts +2 -0
- package/src/navigator/navigator-back-button/README.md +31 -0
- package/src/navigator/navigator-back-button/component.tsx +62 -0
- package/src/navigator/navigator-back-button/hook.ts +40 -0
- package/src/navigator/navigator-back-button/index.ts +1 -0
- package/src/navigator/navigator-button/README.md +38 -0
- package/src/navigator/navigator-button/component.tsx +61 -0
- package/src/navigator/navigator-button/hook.ts +55 -0
- package/src/navigator/navigator-button/index.ts +1 -0
- package/src/navigator/navigator-provider/README.md +20 -33
- package/src/navigator/navigator-provider/component.tsx +12 -22
- package/src/navigator/navigator-screen/README.md +1 -1
- package/src/navigator/navigator-screen/component.tsx +14 -23
- package/src/navigator/stories/index.js +24 -37
- package/src/navigator/test/index.js +89 -34
- package/src/navigator/types.ts +26 -0
- package/src/number-control/stories/index.js +1 -1
- package/src/radio/stories/index.js +1 -1
- package/src/radio-group/stories/index.js +4 -1
- package/src/resizable-box/index.tsx +2 -2
- package/src/resizable-box/resize-tooltip/index.tsx +2 -2
- package/src/resizable-box/resize-tooltip/label.tsx +2 -2
- package/src/scrollable/component.js +1 -1
- package/src/select-control/index.tsx +2 -3
- package/src/spacer/component.tsx +2 -2
- package/src/surface/component.js +1 -1
- package/src/text/component.js +1 -1
- package/src/text-control/index.js +2 -2
- package/src/toggle-group-control/stories/index.js +1 -1
- package/src/toggle-group-control/toggle-group-control/component.tsx +2 -2
- package/src/toggle-group-control/toggle-group-control-option/component.tsx +2 -2
- package/src/tools-panel/stories/index.js +0 -1
- package/src/tools-panel/tools-panel/component.tsx +2 -2
- package/src/tools-panel/tools-panel-header/component.tsx +2 -2
- package/src/tools-panel/tools-panel-item/component.tsx +2 -2
- package/src/tree-grid/README.md +24 -1
- package/src/tree-grid/index.js +66 -7
- package/src/tree-grid/stories/index.js +4 -1
- package/src/tree-grid/test/__snapshots__/index.js.snap +1 -14
- package/src/tree-grid/test/index.js +226 -7
- package/src/truncate/component.js +1 -1
- package/src/ui/context/wordpress-component.ts +2 -2
- package/src/ui/control-group/component.js +1 -1
- package/src/ui/control-label/component.js +1 -1
- package/src/ui/form-group/form-group.js +1 -1
- package/src/ui/shortcut/component.tsx +2 -2
- package/src/ui/spinner/component.js +1 -1
- package/src/ui/tooltip/component.js +1 -1
- package/src/ui/tooltip/content.js +1 -1
- package/src/unit-control/index.tsx +2 -2
- package/src/unit-control/stories/index.js +1 -1
- package/src/v-stack/component.js +1 -1
- package/src/visually-hidden/component.js +1 -1
- package/src/z-stack/component.tsx +2 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/src/tools-panel/stories/typography-panel.js +0 -215
|
@@ -28,9 +28,7 @@ declare const ForwardedUnitControl: import("react").ForwardRefExoticComponent<Pi
|
|
|
28
28
|
value: import("./types").Value;
|
|
29
29
|
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>> & {
|
|
30
30
|
ref?: ((instance: HTMLInputElement | null) => void) | import("react").RefObject<HTMLInputElement> | null | undefined;
|
|
31
|
-
}, "children" | "value" | "label" | "as" | "__unstableInputWidth" | "isPressEnterToChange" | "__unstableStateReducer" | "disableUnits" | keyof import("./types").UnitSelectControlProps | "isResetValueOnUnitChange" | "onUnitChange"> &
|
|
32
|
-
as?: undefined;
|
|
33
|
-
}, "type" | "value" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "as" | "key" | "className" | "color" | "height" | "id" | "lang" | "max" | "min" | "name" | "width" | "role" | "tabIndex" | "crossOrigin" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "list" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "alt" | "src" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "autoComplete" | "accept" | "capture" | "checked" | "enterKeyHint" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "step" | "__unstableInputWidth" | "isPressEnterToChange" | "__unstableStateReducer" | "disableUnits" | keyof import("./types").UnitSelectControlProps | "isResetValueOnUnitChange" | "onUnitChange"> & import("react").RefAttributes<any>>;
|
|
31
|
+
}, "children" | "value" | "label" | "as" | "__unstableInputWidth" | "isPressEnterToChange" | "__unstableStateReducer" | "disableUnits" | keyof import("./types").UnitSelectControlProps | "isResetValueOnUnitChange" | "onUnitChange">, "type" | "value" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "key" | "className" | "color" | "height" | "id" | "lang" | "max" | "min" | "name" | "width" | "role" | "tabIndex" | "crossOrigin" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "list" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "alt" | "src" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "autoComplete" | "accept" | "capture" | "checked" | "enterKeyHint" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "step" | "__unstableInputWidth" | "isPressEnterToChange" | "__unstableStateReducer" | "disableUnits" | keyof import("./types").UnitSelectControlProps | "isResetValueOnUnitChange" | "onUnitChange"> & import("react").RefAttributes<any>>;
|
|
34
32
|
export { parseUnit, useCustomUnits } from './utils';
|
|
35
33
|
export default ForwardedUnitControl;
|
|
36
34
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/unit-control/index.tsx"],"names":[],"mappings":";AAkCA,OAAO,KAAK,EAAoB,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AA+LnE;;;;;;;;;;;;;;;GAeG;AACH,QAAA,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/unit-control/index.tsx"],"names":[],"mappings":";AAkCA,OAAO,KAAK,EAAoB,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AA+LnE;;;;;;;;;;;;;;;GAeG;AACH,QAAA,MAAM,oBAAoB;;;;;;;;;;;2yKAA4B,CAAC;AAEvD,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACpD,eAAe,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/z-stack/component.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/z-stack/component.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AAerD,MAAM,WAAW,WAAW;IAC3B;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACpB;;AA+CD,wBAAkD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/components",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.5.0",
|
|
4
4
|
"description": "UI components for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -36,19 +36,21 @@
|
|
|
36
36
|
"@emotion/serialize": "^1.0.2",
|
|
37
37
|
"@emotion/styled": "^11.6.0",
|
|
38
38
|
"@emotion/utils": "1.0.0",
|
|
39
|
+
"@use-gesture/react": "^10.2.6",
|
|
39
40
|
"@wordpress/a11y": "^3.3.1",
|
|
40
|
-
"@wordpress/compose": "^5.1.
|
|
41
|
+
"@wordpress/compose": "^5.1.2",
|
|
41
42
|
"@wordpress/date": "^4.3.1",
|
|
42
43
|
"@wordpress/deprecated": "^3.3.1",
|
|
43
|
-
"@wordpress/dom": "^3.3.
|
|
44
|
+
"@wordpress/dom": "^3.3.2",
|
|
44
45
|
"@wordpress/element": "^4.1.1",
|
|
46
|
+
"@wordpress/escape-html": "^2.3.1",
|
|
45
47
|
"@wordpress/hooks": "^3.3.1",
|
|
46
48
|
"@wordpress/i18n": "^4.3.1",
|
|
47
|
-
"@wordpress/icons": "^
|
|
49
|
+
"@wordpress/icons": "^7.0.1",
|
|
48
50
|
"@wordpress/is-shallow-equal": "^4.3.1",
|
|
49
51
|
"@wordpress/keycodes": "^3.3.1",
|
|
50
52
|
"@wordpress/primitives": "^3.1.1",
|
|
51
|
-
"@wordpress/rich-text": "^5.1.
|
|
53
|
+
"@wordpress/rich-text": "^5.1.2",
|
|
52
54
|
"@wordpress/warning": "^2.3.1",
|
|
53
55
|
"classnames": "^2.3.1",
|
|
54
56
|
"colord": "^2.7.0",
|
|
@@ -64,7 +66,6 @@
|
|
|
64
66
|
"react-colorful": "^5.3.1",
|
|
65
67
|
"react-dates": "^17.1.1",
|
|
66
68
|
"react-resize-aware": "^3.1.0",
|
|
67
|
-
"react-use-gesture": "^9.0.0",
|
|
68
69
|
"reakit": "^1.3.8",
|
|
69
70
|
"uuid": "^8.3.0"
|
|
70
71
|
},
|
|
@@ -75,5 +76,5 @@
|
|
|
75
76
|
"publishConfig": {
|
|
76
77
|
"access": "public"
|
|
77
78
|
},
|
|
78
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "4566ac290359553d04de4eb574545309343f790b"
|
|
79
80
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# AlignmentMatrixControl
|
|
2
2
|
|
|
3
|
+
<div class="callout callout-alert">
|
|
4
|
+
This feature is still experimental. “Experimental” means this is an early implementation subject to drastic and breaking changes.
|
|
5
|
+
</div>
|
|
6
|
+
|
|
3
7
|
AlignmentMatrixControl components enable adjustments to horizontal and vertical alignments for UI.
|
|
4
8
|
|
|
5
9
|
## Usage
|
|
@@ -17,7 +17,7 @@ const alignmentOptions = ALIGNMENTS.reduce( ( options, item ) => {
|
|
|
17
17
|
}, {} );
|
|
18
18
|
|
|
19
19
|
export default {
|
|
20
|
-
title: 'Components/AlignmentMatrixControl',
|
|
20
|
+
title: 'Components (Experimental)/AlignmentMatrixControl',
|
|
21
21
|
component: AlignmentMatrixControl,
|
|
22
22
|
parameters: {
|
|
23
23
|
knobs: { disable: false },
|
|
@@ -1,38 +1,81 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { boolean, text } from '@storybook/addon-knobs';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* Internal dependencies
|
|
8
3
|
*/
|
|
9
4
|
import BaseControl from '../';
|
|
5
|
+
import Button from '../../button';
|
|
6
|
+
import { Spacer } from '../../spacer';
|
|
10
7
|
import TextareaControl from '../../textarea-control';
|
|
11
8
|
|
|
12
9
|
export default {
|
|
13
10
|
title: 'Components/BaseControl',
|
|
14
11
|
component: BaseControl,
|
|
15
|
-
|
|
16
|
-
knobs: { disable: false },
|
|
17
|
-
},
|
|
12
|
+
subcomponents: { BaseControl: BaseControl.VisualLabel },
|
|
18
13
|
};
|
|
19
14
|
|
|
20
|
-
|
|
21
|
-
const id = text( 'Id', 'textarea-1' );
|
|
22
|
-
const label = text( 'Label', 'Label text' );
|
|
23
|
-
const hideLabelFromVision = boolean( 'Hide label from vision', false );
|
|
24
|
-
const help = text( 'Help', 'Help text' );
|
|
25
|
-
const className = text( 'ClassName', '' );
|
|
26
|
-
|
|
15
|
+
const BaseControlWithTextarea = ( { id, ...props } ) => {
|
|
27
16
|
return (
|
|
28
|
-
<BaseControl
|
|
29
|
-
id={ id }
|
|
30
|
-
label={ label }
|
|
31
|
-
help={ help }
|
|
32
|
-
hideLabelFromVision={ hideLabelFromVision }
|
|
33
|
-
className={ className }
|
|
34
|
-
>
|
|
17
|
+
<BaseControl id={ id } { ...props }>
|
|
35
18
|
<TextareaControl id={ id } />
|
|
36
19
|
</BaseControl>
|
|
37
20
|
);
|
|
38
21
|
};
|
|
22
|
+
|
|
23
|
+
export const Default = BaseControlWithTextarea.bind( {} );
|
|
24
|
+
Default.args = {
|
|
25
|
+
id: 'textarea-1',
|
|
26
|
+
label: '',
|
|
27
|
+
hideLabelFromVision: false,
|
|
28
|
+
help: '',
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const WithLabel = BaseControlWithTextarea.bind( {} );
|
|
32
|
+
WithLabel.args = {
|
|
33
|
+
...Default.args,
|
|
34
|
+
label: 'Label text',
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const WithHelpText = BaseControlWithTextarea.bind( {} );
|
|
38
|
+
WithHelpText.args = {
|
|
39
|
+
...WithLabel.args,
|
|
40
|
+
help: 'Help text adds more explanation.',
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const WithVisualLabel = ( { visualLabelChildren, ...props } ) => {
|
|
44
|
+
return (
|
|
45
|
+
<>
|
|
46
|
+
<BaseControl { ...props }>
|
|
47
|
+
<div>
|
|
48
|
+
<BaseControl.VisualLabel>
|
|
49
|
+
{ visualLabelChildren }
|
|
50
|
+
</BaseControl.VisualLabel>
|
|
51
|
+
</div>
|
|
52
|
+
<Button variant="secondary">Select an author</Button>
|
|
53
|
+
</BaseControl>
|
|
54
|
+
<Spacer marginTop={ 12 }>
|
|
55
|
+
<p>
|
|
56
|
+
<code>BaseControl.VisualLabel</code> is used to render a
|
|
57
|
+
purely visual label inside a <code>BaseControl</code>{ ' ' }
|
|
58
|
+
component.
|
|
59
|
+
</p>
|
|
60
|
+
<p>
|
|
61
|
+
It should <strong>only</strong> be used in cases where the
|
|
62
|
+
children being rendered inside BaseControl are already
|
|
63
|
+
accessibly labeled, e.g., a button, but we want an
|
|
64
|
+
additional visual label for that section equivalent to the
|
|
65
|
+
labels BaseControl would otherwise use if the{ ' ' }
|
|
66
|
+
<code>label</code> prop was passed.
|
|
67
|
+
</p>
|
|
68
|
+
</Spacer>
|
|
69
|
+
</>
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
WithVisualLabel.args = {
|
|
73
|
+
...Default.args,
|
|
74
|
+
help: 'This button is already accessibly labeled.',
|
|
75
|
+
visualLabelChildren: 'Author',
|
|
76
|
+
};
|
|
77
|
+
WithVisualLabel.argTypes = {
|
|
78
|
+
visualLabelChildren: {
|
|
79
|
+
name: 'VisualLabel children',
|
|
80
|
+
},
|
|
81
|
+
};
|
|
@@ -14,7 +14,10 @@ import BoxControl from '../';
|
|
|
14
14
|
import BoxControlVisualizer from '../visualizer';
|
|
15
15
|
import { Flex, FlexBlock } from '../../flex';
|
|
16
16
|
|
|
17
|
-
export default {
|
|
17
|
+
export default {
|
|
18
|
+
title: 'Components (Experimental)/BoxControl',
|
|
19
|
+
component: BoxControl,
|
|
20
|
+
};
|
|
18
21
|
|
|
19
22
|
export const _default = () => {
|
|
20
23
|
return <BoxControl />;
|
|
@@ -21,7 +21,7 @@ import { useCx } from '../../utils/hooks/use-cx';
|
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* @param {import('../../ui/context').WordPressComponentProps<import('../types').Props, 'div'>} props
|
|
24
|
-
* @param {import('react').
|
|
24
|
+
* @param {import('react').ForwardedRef<any>} forwardedRef
|
|
25
25
|
*/
|
|
26
26
|
function Card( props, forwardedRef ) {
|
|
27
27
|
const {
|
|
@@ -8,7 +8,7 @@ import { useCardBody } from './hook';
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @param {import('../../ui/context').WordPressComponentProps<import('../types').BodyProps, 'div'>} props
|
|
11
|
-
* @param {import('react').
|
|
11
|
+
* @param {import('react').ForwardedRef<any>} forwardedRef
|
|
12
12
|
*/
|
|
13
13
|
function CardBody( props, forwardedRef ) {
|
|
14
14
|
const { isScrollable, ...otherProps } = useCardBody( props );
|
|
@@ -7,7 +7,7 @@ import { useCardDivider } from './hook';
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @param {import('../../ui/context').WordPressComponentProps<import('../../divider').DividerProps, 'hr', false>} props
|
|
10
|
-
* @param {import('react').
|
|
10
|
+
* @param {import('react').ForwardedRef<any>} forwardedRef
|
|
11
11
|
*/
|
|
12
12
|
function CardDivider( props, forwardedRef ) {
|
|
13
13
|
const dividerProps = useCardDivider( props );
|
|
@@ -7,7 +7,7 @@ import { useCardFooter } from './hook';
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @param {import('../../ui/context').WordPressComponentProps<import('../types').FooterProps, 'div'>} props
|
|
10
|
-
* @param {import('react').
|
|
10
|
+
* @param {import('react').ForwardedRef<any>} forwardedRef
|
|
11
11
|
*/
|
|
12
12
|
function CardFooter( props, forwardedRef ) {
|
|
13
13
|
const footerProps = useCardFooter( props );
|
|
@@ -7,7 +7,7 @@ import { useCardHeader } from './hook';
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @param {import('../../ui/context').WordPressComponentProps<import('../types').HeaderProps, 'div'>} props
|
|
10
|
-
* @param {import('react').
|
|
10
|
+
* @param {import('react').ForwardedRef<any>} forwardedRef
|
|
11
11
|
*/
|
|
12
12
|
function CardHeader( props, forwardedRef ) {
|
|
13
13
|
const headerProps = useCardHeader( props );
|
|
@@ -7,7 +7,7 @@ import { useCardMedia } from './hook';
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @param {import('../../ui/context').WordPressComponentProps<{ children: import('react').ReactNode }, 'div'>} props
|
|
10
|
-
* @param {import('react').
|
|
10
|
+
* @param {import('react').ForwardedRef<any>} forwardedRef
|
|
11
11
|
*/
|
|
12
12
|
function CardMedia( props, forwardedRef ) {
|
|
13
13
|
const cardMediaProps = useCardMedia( props );
|
|
@@ -34,6 +34,7 @@ let scrollPosition = 0;
|
|
|
34
34
|
let customIndicatorWidth = 0;
|
|
35
35
|
|
|
36
36
|
function ColorPalette( {
|
|
37
|
+
enableCustomColor = true,
|
|
37
38
|
setColor,
|
|
38
39
|
activeColor,
|
|
39
40
|
isGradientColor,
|
|
@@ -46,6 +47,7 @@ function ColorPalette( {
|
|
|
46
47
|
shouldShowCustomVerticalSeparator = true,
|
|
47
48
|
customColorIndicatorStyles,
|
|
48
49
|
customIndicatorWrapperStyles,
|
|
50
|
+
label,
|
|
49
51
|
} ) {
|
|
50
52
|
const customSwatchGradients = [
|
|
51
53
|
'linear-gradient(120deg, rgba(255,0,0,.8) 0%, rgba(255,255,255,1) 70.71%)',
|
|
@@ -62,6 +64,7 @@ function ColorPalette( {
|
|
|
62
64
|
const opacity = useRef( new Animated.Value( 1 ) ).current;
|
|
63
65
|
|
|
64
66
|
const defaultColors = uniq( map( defaultSettings.colors, 'color' ) );
|
|
67
|
+
const mergedColors = uniq( map( defaultSettings.allColors, 'color' ) );
|
|
65
68
|
const defaultGradientColors = uniq(
|
|
66
69
|
map( defaultSettings.gradients, 'gradient' )
|
|
67
70
|
);
|
|
@@ -72,6 +75,7 @@ function ColorPalette( {
|
|
|
72
75
|
: customSwatchGradients;
|
|
73
76
|
const isCustomGradientColor = isGradientColor && isSelectedCustom();
|
|
74
77
|
const shouldShowCustomIndicator =
|
|
78
|
+
enableCustomColor &&
|
|
75
79
|
shouldShowCustomIndicatorOption &&
|
|
76
80
|
( ! isGradientSegment || isCustomGradientColor );
|
|
77
81
|
|
|
@@ -92,8 +96,8 @@ function ColorPalette( {
|
|
|
92
96
|
|
|
93
97
|
function isSelectedCustom() {
|
|
94
98
|
const isWithinColors =
|
|
95
|
-
activeColor &&
|
|
96
|
-
if ( activeColor ) {
|
|
99
|
+
activeColor && mergedColors && mergedColors.includes( activeColor );
|
|
100
|
+
if ( enableCustomColor && activeColor ) {
|
|
97
101
|
if ( isGradientSegment ) {
|
|
98
102
|
return isGradientColor && ! isWithinColors;
|
|
99
103
|
}
|
|
@@ -206,93 +210,106 @@ function ColorPalette( {
|
|
|
206
210
|
];
|
|
207
211
|
|
|
208
212
|
return (
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
keyboardShouldPersistTaps="always"
|
|
215
|
-
disableScrollViewPanResponder
|
|
216
|
-
scrollEventThrottle={ 16 }
|
|
217
|
-
onScroll={ onScroll }
|
|
218
|
-
onContentSizeChange={ onContentSizeChange }
|
|
219
|
-
onScrollBeginDrag={ () => shouldEnableBottomSheetScroll( false ) }
|
|
220
|
-
onScrollEndDrag={ () => shouldEnableBottomSheetScroll( true ) }
|
|
221
|
-
ref={ scrollViewRef }
|
|
222
|
-
testID="color-palette"
|
|
223
|
-
>
|
|
224
|
-
{ shouldShowCustomIndicator && (
|
|
225
|
-
<View
|
|
226
|
-
style={ customIndicatorWrapperStyle }
|
|
227
|
-
onLayout={ onCustomIndicatorLayout }
|
|
228
|
-
>
|
|
229
|
-
{ shouldShowCustomVerticalSeparator && (
|
|
230
|
-
<View style={ verticalSeparatorStyle } />
|
|
231
|
-
) }
|
|
232
|
-
<TouchableWithoutFeedback
|
|
233
|
-
onPress={ onCustomPress }
|
|
234
|
-
accessibilityRole={ 'button' }
|
|
235
|
-
accessibilityState={ { selected: isSelectedCustom() } }
|
|
236
|
-
accessibilityHint={ accessibilityHint }
|
|
237
|
-
>
|
|
238
|
-
<View style={ customIndicatorWrapperStyle }>
|
|
239
|
-
<ColorIndicator
|
|
240
|
-
withCustomPicker={ ! isGradientSegment }
|
|
241
|
-
color={ customIndicatorColor }
|
|
242
|
-
isSelected={ isSelectedCustom() }
|
|
243
|
-
style={ [
|
|
244
|
-
styles.colorIndicator,
|
|
245
|
-
customColorIndicatorStyles,
|
|
246
|
-
] }
|
|
247
|
-
/>
|
|
248
|
-
{ shouldShowCustomLabel && (
|
|
249
|
-
<Text style={ customTextStyle }>
|
|
250
|
-
{ isIOS
|
|
251
|
-
? customText
|
|
252
|
-
: customText.toUpperCase() }
|
|
253
|
-
</Text>
|
|
254
|
-
) }
|
|
255
|
-
</View>
|
|
256
|
-
</TouchableWithoutFeedback>
|
|
257
|
-
</View>
|
|
213
|
+
<>
|
|
214
|
+
{ label && (
|
|
215
|
+
<Text accessibilityRole="header" style={ styles.headerText }>
|
|
216
|
+
{ label }
|
|
217
|
+
</Text>
|
|
258
218
|
) }
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
219
|
+
|
|
220
|
+
<ScrollView
|
|
221
|
+
contentContainerStyle={ styles.contentContainer }
|
|
222
|
+
horizontal
|
|
223
|
+
showsHorizontalScrollIndicator={ false }
|
|
224
|
+
keyboardShouldPersistTaps="always"
|
|
225
|
+
disableScrollViewPanResponder
|
|
226
|
+
scrollEventThrottle={ 16 }
|
|
227
|
+
onScroll={ onScroll }
|
|
228
|
+
onContentSizeChange={ onContentSizeChange }
|
|
229
|
+
onScrollBeginDrag={ () =>
|
|
230
|
+
shouldEnableBottomSheetScroll( false )
|
|
231
|
+
}
|
|
232
|
+
onScrollEndDrag={ () => shouldEnableBottomSheetScroll( true ) }
|
|
233
|
+
ref={ scrollViewRef }
|
|
234
|
+
testID={ `color-palette${ label ? '-' + label : '' }` }
|
|
235
|
+
>
|
|
236
|
+
{ colors.map( ( color ) => {
|
|
237
|
+
const scaleValue = isSelected( color )
|
|
238
|
+
? scaleInterpolation
|
|
239
|
+
: 1;
|
|
240
|
+
return (
|
|
241
|
+
<View key={ `${ color }-${ isSelected( color ) }` }>
|
|
242
|
+
<TouchableWithoutFeedback
|
|
243
|
+
onPress={ () => onColorPress( color ) }
|
|
244
|
+
accessibilityRole={ 'button' }
|
|
245
|
+
accessibilityState={ {
|
|
246
|
+
selected: isSelected( color ),
|
|
247
|
+
} }
|
|
248
|
+
accessibilityHint={ color }
|
|
249
|
+
testID={ color }
|
|
250
|
+
>
|
|
251
|
+
<Animated.View
|
|
252
|
+
style={ {
|
|
253
|
+
transform: [
|
|
254
|
+
{
|
|
255
|
+
scale: scaleValue,
|
|
256
|
+
},
|
|
257
|
+
],
|
|
258
|
+
} }
|
|
259
|
+
>
|
|
260
|
+
<ColorIndicator
|
|
261
|
+
color={ color }
|
|
262
|
+
isSelected={ isSelected( color ) }
|
|
263
|
+
opacity={ opacity }
|
|
264
|
+
style={ [
|
|
265
|
+
styles.colorIndicator,
|
|
266
|
+
customColorIndicatorStyles,
|
|
267
|
+
] }
|
|
268
|
+
/>
|
|
269
|
+
</Animated.View>
|
|
270
|
+
</TouchableWithoutFeedback>
|
|
271
|
+
</View>
|
|
272
|
+
);
|
|
273
|
+
} ) }
|
|
274
|
+
{ shouldShowCustomIndicator && (
|
|
275
|
+
<View
|
|
276
|
+
style={ customIndicatorWrapperStyle }
|
|
277
|
+
onLayout={ onCustomIndicatorLayout }
|
|
278
|
+
>
|
|
279
|
+
{ shouldShowCustomVerticalSeparator && (
|
|
280
|
+
<View style={ verticalSeparatorStyle } />
|
|
281
|
+
) }
|
|
263
282
|
<TouchableWithoutFeedback
|
|
264
|
-
onPress={
|
|
283
|
+
onPress={ onCustomPress }
|
|
265
284
|
accessibilityRole={ 'button' }
|
|
266
285
|
accessibilityState={ {
|
|
267
|
-
selected:
|
|
286
|
+
selected: isSelectedCustom(),
|
|
268
287
|
} }
|
|
269
|
-
accessibilityHint={
|
|
270
|
-
testID={ color }
|
|
288
|
+
accessibilityHint={ accessibilityHint }
|
|
271
289
|
>
|
|
272
|
-
<
|
|
273
|
-
style={ {
|
|
274
|
-
transform: [
|
|
275
|
-
{
|
|
276
|
-
scale: scaleValue,
|
|
277
|
-
},
|
|
278
|
-
],
|
|
279
|
-
} }
|
|
280
|
-
>
|
|
290
|
+
<View style={ customIndicatorWrapperStyle }>
|
|
281
291
|
<ColorIndicator
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
292
|
+
withCustomPicker={ ! isGradientSegment }
|
|
293
|
+
color={ customIndicatorColor }
|
|
294
|
+
isSelected={ isSelectedCustom() }
|
|
285
295
|
style={ [
|
|
286
296
|
styles.colorIndicator,
|
|
287
297
|
customColorIndicatorStyles,
|
|
288
298
|
] }
|
|
289
299
|
/>
|
|
290
|
-
|
|
300
|
+
{ shouldShowCustomLabel && (
|
|
301
|
+
<Text style={ customTextStyle }>
|
|
302
|
+
{ isIOS
|
|
303
|
+
? customText
|
|
304
|
+
: customText.toUpperCase() }
|
|
305
|
+
</Text>
|
|
306
|
+
) }
|
|
307
|
+
</View>
|
|
291
308
|
</TouchableWithoutFeedback>
|
|
292
309
|
</View>
|
|
293
|
-
)
|
|
294
|
-
|
|
295
|
-
|
|
310
|
+
) }
|
|
311
|
+
</ScrollView>
|
|
312
|
+
</>
|
|
296
313
|
);
|
|
297
314
|
}
|
|
298
315
|
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
.contentContainer {
|
|
2
|
-
flex-direction: row
|
|
2
|
+
flex-direction: row;
|
|
3
3
|
padding: 0 $grid-unit-20;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
.container {
|
|
7
|
-
padding-bottom: $grid-unit-20;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
6
|
.verticalSeparator {
|
|
11
7
|
border-width: $border-width * 0.5;
|
|
12
8
|
border-color: $light-gray-400;
|
|
@@ -42,3 +38,12 @@
|
|
|
42
38
|
letter-spacing: 1.25;
|
|
43
39
|
font-weight: 500;
|
|
44
40
|
}
|
|
41
|
+
|
|
42
|
+
.headerText {
|
|
43
|
+
color: $gray;
|
|
44
|
+
padding-top: 8;
|
|
45
|
+
font-size: 14;
|
|
46
|
+
font-weight: 500;
|
|
47
|
+
padding-left: $grid-unit-20;
|
|
48
|
+
padding-right: $grid-unit-20;
|
|
49
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { ForwardedRef } from 'react';
|
|
5
5
|
import { colord, extend, Colord } from 'colord';
|
|
6
6
|
import namesPlugin from 'colord/plugins/names';
|
|
7
7
|
|
|
@@ -54,7 +54,7 @@ const options = [
|
|
|
54
54
|
|
|
55
55
|
const ColorPicker = (
|
|
56
56
|
props: WordPressComponentProps< ColorPickerProps, 'div', false >,
|
|
57
|
-
forwardedRef:
|
|
57
|
+
forwardedRef: ForwardedRef< any >
|
|
58
58
|
) => {
|
|
59
59
|
const {
|
|
60
60
|
enableAlpha = false,
|
|
@@ -24,10 +24,13 @@ interface HexInputProps {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export const HexInput = ( { color, onChange, enableAlpha }: HexInputProps ) => {
|
|
27
|
-
const
|
|
28
|
-
if ( !
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
const handleChange = ( nextValue: string | undefined ) => {
|
|
28
|
+
if ( ! nextValue ) return;
|
|
29
|
+
const hexValue = nextValue.startsWith( '#' )
|
|
30
|
+
? nextValue
|
|
31
|
+
: '#' + nextValue;
|
|
32
|
+
|
|
33
|
+
onChange( colord( hexValue ) );
|
|
31
34
|
};
|
|
32
35
|
|
|
33
36
|
return (
|
|
@@ -43,11 +46,8 @@ export const HexInput = ( { color, onChange, enableAlpha }: HexInputProps ) => {
|
|
|
43
46
|
</Spacer>
|
|
44
47
|
}
|
|
45
48
|
value={ color.toHex().slice( 1 ).toUpperCase() }
|
|
46
|
-
onChange={
|
|
47
|
-
|
|
48
|
-
} }
|
|
49
|
-
onValidate={ handleValidate }
|
|
50
|
-
maxLength={ enableAlpha ? 8 : 6 }
|
|
49
|
+
onChange={ handleChange }
|
|
50
|
+
maxLength={ enableAlpha ? 9 : 7 }
|
|
51
51
|
label={ __( 'Hex color' ) }
|
|
52
52
|
hideLabelFromVision
|
|
53
53
|
/>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { ForwardedRef, KeyboardEvent } from 'react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -28,7 +28,7 @@ import { useCx } from '../utils/hooks/use-cx';
|
|
|
28
28
|
|
|
29
29
|
function ConfirmDialog(
|
|
30
30
|
props: WordPressComponentProps< OwnProps, 'div', false >,
|
|
31
|
-
forwardedRef:
|
|
31
|
+
forwardedRef: ForwardedRef< any >
|
|
32
32
|
) {
|
|
33
33
|
const {
|
|
34
34
|
isOpen: isOpenProp,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
// eslint-disable-next-line no-restricted-imports
|
|
5
5
|
import { Separator } from 'reakit';
|
|
6
|
-
import type {
|
|
6
|
+
import type { ForwardedRef } from 'react';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Internal dependencies
|
|
@@ -18,7 +18,7 @@ import type { Props } from './types';
|
|
|
18
18
|
|
|
19
19
|
function Divider(
|
|
20
20
|
props: WordPressComponentProps< Props, 'hr', false >,
|
|
21
|
-
forwardedRef:
|
|
21
|
+
forwardedRef: ForwardedRef< any >
|
|
22
22
|
) {
|
|
23
23
|
const contextProps = useContextSystem( props, 'Divider' );
|
|
24
24
|
|
|
@@ -7,7 +7,7 @@ import { useElevation } from './hook';
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @param {import('../ui/context').WordPressComponentProps<import('./types').Props, 'div'>} props
|
|
10
|
-
* @param {import('react').
|
|
10
|
+
* @param {import('react').ForwardedRef<any>} forwardedRef
|
|
11
11
|
*/
|
|
12
12
|
function Elevation( props, forwardedRef ) {
|
|
13
13
|
const elevationProps = useElevation( props );
|