@wordpress/components 34.0.0 → 35.0.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 +25 -1
- package/build/alignment-matrix-control/cell.cjs +1 -1
- package/build/alignment-matrix-control/cell.cjs.map +2 -2
- package/build/alignment-matrix-control/index.cjs +1 -1
- package/build/alignment-matrix-control/index.cjs.map +2 -2
- package/build/border-control/border-control-dropdown/component.cjs +33 -33
- package/build/border-control/border-control-dropdown/component.cjs.map +3 -3
- package/build/color-palette/index.cjs +3 -0
- package/build/color-palette/index.cjs.map +2 -2
- package/build/custom-gradient-picker/gradient-bar/index.cjs.map +2 -2
- package/build/disabled/index.cjs +1 -1
- package/build/disabled/index.cjs.map +2 -2
- package/build/draggable/index.cjs +1 -1
- package/build/draggable/index.cjs.map +2 -2
- package/build/higher-order/with-notices/index.cjs +15 -3
- package/build/higher-order/with-notices/index.cjs.map +2 -2
- package/build/input-control/input-base.cjs +34 -31
- package/build/input-control/input-base.cjs.map +2 -2
- package/build/navigable-container/container.cjs +15 -21
- package/build/navigable-container/container.cjs.map +2 -2
- package/build/responsive-wrapper/index.cjs +3 -4
- package/build/responsive-wrapper/index.cjs.map +2 -2
- package/build/tooltip/index.cjs +1 -2
- package/build/tooltip/index.cjs.map +2 -2
- package/build/unit-control/utils.cjs +33 -35
- package/build/unit-control/utils.cjs.map +2 -2
- package/build-module/alignment-matrix-control/cell.mjs +1 -1
- package/build-module/alignment-matrix-control/cell.mjs.map +2 -2
- package/build-module/alignment-matrix-control/index.mjs +1 -1
- package/build-module/alignment-matrix-control/index.mjs.map +2 -2
- package/build-module/border-control/border-control-dropdown/component.mjs +34 -34
- package/build-module/border-control/border-control-dropdown/component.mjs.map +2 -2
- package/build-module/color-palette/index.mjs +3 -0
- package/build-module/color-palette/index.mjs.map +2 -2
- package/build-module/custom-gradient-picker/gradient-bar/index.mjs.map +2 -2
- package/build-module/disabled/index.mjs +1 -1
- package/build-module/disabled/index.mjs.map +2 -2
- package/build-module/draggable/index.mjs +1 -1
- package/build-module/draggable/index.mjs.map +2 -2
- package/build-module/higher-order/with-notices/index.mjs +16 -4
- package/build-module/higher-order/with-notices/index.mjs.map +2 -2
- package/build-module/input-control/input-base.mjs +34 -31
- package/build-module/input-control/input-base.mjs.map +2 -2
- package/build-module/navigable-container/container.mjs +16 -22
- package/build-module/navigable-container/container.mjs.map +2 -2
- package/build-module/responsive-wrapper/index.mjs +3 -4
- package/build-module/responsive-wrapper/index.mjs.map +2 -2
- package/build-module/tooltip/index.mjs +1 -2
- package/build-module/tooltip/index.mjs.map +2 -2
- package/build-module/unit-control/utils.mjs +33 -35
- package/build-module/unit-control/utils.mjs.map +2 -2
- package/build-style/style-rtl.css +41 -10
- package/build-style/style.css +41 -10
- package/build-types/border-box-control/border-box-control/hook.d.ts +10 -24
- package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +12 -26
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +10 -24
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +11 -25
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control/hook.d.ts +10 -24
- package/build-types/border-control/border-control/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/hook.d.ts +9 -23
- package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
- package/build-types/box-control/styles/box-control-styles.d.ts +2 -2
- package/build-types/card/card/hook.d.ts +11 -25
- package/build-types/card/card/hook.d.ts.map +1 -1
- package/build-types/card/card-body/hook.d.ts +11 -25
- package/build-types/card/card-body/hook.d.ts.map +1 -1
- package/build-types/card/card-divider/hook.d.ts +12 -26
- package/build-types/card/card-divider/hook.d.ts.map +1 -1
- package/build-types/card/card-footer/hook.d.ts +11 -25
- package/build-types/card/card-footer/hook.d.ts.map +1 -1
- package/build-types/card/card-header/hook.d.ts +11 -25
- package/build-types/card/card-header/hook.d.ts.map +1 -1
- package/build-types/card/card-media/hook.d.ts +11 -25
- package/build-types/card/card-media/hook.d.ts.map +1 -1
- package/build-types/card/context.d.ts +3 -0
- package/build-types/card/context.d.ts.map +1 -0
- package/build-types/color-palette/index.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +2 -2
- package/build-types/composite/stories/index.story.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/gradient-bar/index.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/styles.d.ts +12 -4
- package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
- package/build-types/date-time/date/index.d.ts +23 -0
- package/build-types/date-time/date/index.d.ts.map +1 -0
- package/build-types/date-time/date/styles.d.ts +45 -0
- package/build-types/date-time/date/styles.d.ts.map +1 -0
- package/build-types/date-time/date/test/index.d.ts +2 -0
- package/build-types/date-time/date/test/index.d.ts.map +1 -0
- package/build-types/date-time/date/test/use-lilius.d.ts +2 -0
- package/build-types/date-time/date/test/use-lilius.d.ts.map +1 -0
- package/build-types/date-time/date/use-lilius/index.d.ts +169 -0
- package/build-types/date-time/date/use-lilius/index.d.ts.map +1 -0
- package/build-types/date-time/time/index.d.ts +27 -0
- package/build-types/date-time/time/index.d.ts.map +1 -0
- package/build-types/date-time/time/styles.d.ts +93 -0
- package/build-types/date-time/time/styles.d.ts.map +1 -0
- package/build-types/date-time/time/test/index.d.ts +2 -0
- package/build-types/date-time/time/test/index.d.ts.map +1 -0
- package/build-types/date-time/time/time-input/index.d.ts +4 -0
- package/build-types/date-time/time/time-input/index.d.ts.map +1 -0
- package/build-types/date-time/time/time-input/test/index.d.ts +2 -0
- package/build-types/date-time/time/time-input/test/index.d.ts.map +1 -0
- package/build-types/date-time/time/timezone.d.ts +7 -0
- package/build-types/date-time/time/timezone.d.ts.map +1 -0
- package/build-types/date-time/time-picker/styles.d.ts +4 -4
- package/build-types/elevation/hook.d.ts +11 -25
- package/build-types/elevation/hook.d.ts.map +1 -1
- package/build-types/flex/flex/hook.d.ts +11 -25
- package/build-types/flex/flex/hook.d.ts.map +1 -1
- package/build-types/flex/flex-block/hook.d.ts +11 -25
- package/build-types/flex/flex-block/hook.d.ts.map +1 -1
- package/build-types/flex/flex-item/hook.d.ts +11 -25
- package/build-types/flex/flex-item/hook.d.ts.map +1 -1
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +1 -1
- package/build-types/grid/hook.d.ts +11 -25
- package/build-types/grid/hook.d.ts.map +1 -1
- package/build-types/h-stack/hook.d.ts +11 -25
- package/build-types/h-stack/hook.d.ts.map +1 -1
- package/build-types/heading/hook.d.ts +11 -25
- package/build-types/heading/hook.d.ts.map +1 -1
- package/build-types/higher-order/with-fallback-styles/index.d.ts +3 -1
- package/build-types/higher-order/with-filters/index.d.ts +6 -1
- package/build-types/higher-order/with-filters/index.d.ts.map +1 -1
- package/build-types/higher-order/with-notices/index.d.ts +4 -2
- package/build-types/higher-order/with-notices/index.d.ts.map +1 -1
- package/build-types/input-control/reducer/reducer.d.ts +1 -1
- package/build-types/item-group/item/hook.d.ts +11 -25
- package/build-types/item-group/item/hook.d.ts.map +1 -1
- package/build-types/item-group/item-group/hook.d.ts +11 -25
- package/build-types/item-group/item-group/hook.d.ts.map +1 -1
- package/build-types/menu/stories/index.story.d.ts.map +1 -1
- package/build-types/menu/styles.d.ts +21 -7
- package/build-types/menu/styles.d.ts.map +1 -1
- package/build-types/modal/use-modal-exit-animation.d.ts +1 -1
- package/build-types/navigable-container/container.d.ts.map +1 -1
- package/build-types/navigation/back-button/index.d.ts +7 -0
- package/build-types/navigation/back-button/index.d.ts.map +1 -0
- package/build-types/navigation/constants.d.ts +3 -0
- package/build-types/navigation/constants.d.ts.map +1 -0
- package/build-types/navigation/context.d.ts +4 -0
- package/build-types/navigation/context.d.ts.map +1 -0
- package/build-types/navigation/group/context.d.ts +7 -0
- package/build-types/navigation/group/context.d.ts.map +1 -0
- package/build-types/navigation/group/index.d.ts +7 -0
- package/build-types/navigation/group/index.d.ts.map +1 -0
- package/build-types/navigation/index.d.ts +46 -0
- package/build-types/navigation/index.d.ts.map +1 -0
- package/build-types/navigation/item/base-content.d.ts +3 -0
- package/build-types/navigation/item/base-content.d.ts.map +1 -0
- package/build-types/navigation/item/base.d.ts +3 -0
- package/build-types/navigation/item/base.d.ts.map +1 -0
- package/build-types/navigation/item/index.d.ts +7 -0
- package/build-types/navigation/item/index.d.ts.map +1 -0
- package/build-types/navigation/item/use-navigation-tree-item.d.ts +3 -0
- package/build-types/navigation/item/use-navigation-tree-item.d.ts.map +1 -0
- package/build-types/navigation/menu/context.d.ts +7 -0
- package/build-types/navigation/menu/context.d.ts.map +1 -0
- package/build-types/navigation/menu/index.d.ts +7 -0
- package/build-types/navigation/menu/index.d.ts.map +1 -0
- package/build-types/navigation/menu/menu-title-search.d.ts +3 -0
- package/build-types/navigation/menu/menu-title-search.d.ts.map +1 -0
- package/build-types/navigation/menu/menu-title.d.ts +3 -0
- package/build-types/navigation/menu/menu-title.d.ts.map +1 -0
- package/build-types/navigation/menu/search-no-results-found.d.ts +3 -0
- package/build-types/navigation/menu/search-no-results-found.d.ts.map +1 -0
- package/build-types/navigation/menu/use-navigation-tree-menu.d.ts +3 -0
- package/build-types/navigation/menu/use-navigation-tree-menu.d.ts.map +1 -0
- package/build-types/navigation/stories/index.story.d.ts +23 -0
- package/build-types/navigation/stories/index.story.d.ts.map +1 -0
- package/build-types/navigation/stories/utils/controlled-state.d.ts +7 -0
- package/build-types/navigation/stories/utils/controlled-state.d.ts.map +1 -0
- package/build-types/navigation/stories/utils/default.d.ts +10 -0
- package/build-types/navigation/stories/utils/default.d.ts.map +1 -0
- package/build-types/navigation/stories/utils/group.d.ts +10 -0
- package/build-types/navigation/stories/utils/group.d.ts.map +1 -0
- package/build-types/navigation/stories/utils/hide-if-empty.d.ts +10 -0
- package/build-types/navigation/stories/utils/hide-if-empty.d.ts.map +1 -0
- package/build-types/navigation/stories/utils/more-examples.d.ts +10 -0
- package/build-types/navigation/stories/utils/more-examples.d.ts.map +1 -0
- package/build-types/navigation/stories/utils/search.d.ts +10 -0
- package/build-types/navigation/stories/utils/search.d.ts.map +1 -0
- package/build-types/navigation/styles/navigation-styles.d.ts +55 -0
- package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -0
- package/build-types/navigation/test/index.d.ts +2 -0
- package/build-types/navigation/test/index.d.ts.map +1 -0
- package/build-types/navigation/types.d.ts +266 -0
- package/build-types/navigation/types.d.ts.map +1 -0
- package/build-types/navigation/use-create-navigation-tree.d.ts +15 -0
- package/build-types/navigation/use-create-navigation-tree.d.ts.map +1 -0
- package/build-types/navigation/use-navigation-tree-nodes.d.ts +10 -0
- package/build-types/navigation/use-navigation-tree-nodes.d.ts.map +1 -0
- package/build-types/navigation/utils.d.ts +3 -0
- package/build-types/navigation/utils.d.ts.map +1 -0
- package/build-types/navigator/navigator-back-button/hook.d.ts +12 -26
- package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/hook.d.ts +12 -26
- package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
- package/build-types/number-control/index.d.ts +1 -1
- package/build-types/number-control/index.d.ts.map +1 -1
- package/build-types/number-control/stories/index.story.d.ts +1 -1
- package/build-types/number-control/stories/index.story.d.ts.map +1 -1
- package/build-types/popover/types.d.ts +2 -2
- package/build-types/popover/types.d.ts.map +1 -1
- package/build-types/range-control/index.d.ts +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts +1 -1
- package/build-types/range-control/types.d.ts +1 -1
- package/build-types/range-control/types.d.ts.map +1 -1
- package/build-types/responsive-wrapper/index.d.ts.map +1 -1
- package/build-types/scrollable/hook.d.ts +11 -25
- package/build-types/scrollable/hook.d.ts.map +1 -1
- package/build-types/snackbar/index.d.ts +2 -2
- package/build-types/snackbar/types.d.ts +2 -2
- package/build-types/snackbar/types.d.ts.map +1 -1
- package/build-types/spacer/hook.d.ts +11 -25
- package/build-types/spacer/hook.d.ts.map +1 -1
- package/build-types/surface/hook.d.ts +11 -25
- package/build-types/surface/hook.d.ts.map +1 -1
- package/build-types/tabs/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/styles.d.ts +9 -3
- package/build-types/tabs/styles.d.ts.map +1 -1
- package/build-types/text/hook.d.ts +11 -25
- package/build-types/text/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +11 -25
- package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/hook.d.ts +11 -25
- package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts +11 -25
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/tooltip/index.d.ts.map +1 -1
- package/build-types/truncate/hook.d.ts +11 -25
- package/build-types/truncate/hook.d.ts.map +1 -1
- 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 +1 -1
- package/build-types/unit-control/utils.d.ts.map +1 -1
- package/build-types/utils/get-node-text.d.ts.map +1 -1
- package/build-types/v-stack/hook.d.ts +11 -25
- package/build-types/v-stack/hook.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/combobox-control.d.ts +2 -2
- package/build-types/validated-form-controls/components/number-control.d.ts +1 -1
- package/build-types/validated-form-controls/components/number-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/range-control.d.ts +1 -1
- package/build-types/validated-form-controls/control-with-error.d.ts +1 -4
- package/build-types/validated-form-controls/control-with-error.d.ts.map +1 -1
- package/build-types/visually-hidden/test/index.d.ts +2 -0
- package/build-types/visually-hidden/test/index.d.ts.map +1 -0
- package/package.json +37 -35
- package/src/autocomplete/README.md +1 -1
- package/src/border-control/border-control-dropdown/component.tsx +37 -36
- package/src/card/card/README.md +4 -4
- package/src/checkbox-control/README.md +1 -1
- package/src/clipboard-button/README.md +4 -4
- package/src/color-palette/index.tsx +5 -0
- package/src/color-palette/test/index.tsx +30 -0
- package/src/combobox-control/README.md +1 -1
- package/src/composite/stories/index.story.tsx +1 -0
- package/src/confirm-dialog/README.md +1 -1
- package/src/custom-gradient-picker/gradient-bar/index.tsx +1 -1
- package/src/disabled/index.tsx +1 -1
- package/src/flex/flex/README.md +1 -1
- package/src/form-file-upload/README.md +1 -1
- package/src/h-stack/hook.tsx +1 -1
- package/src/higher-order/with-notices/index.tsx +21 -4
- package/src/higher-order/with-notices/test/index.tsx +18 -0
- package/src/input-control/input-base.tsx +2 -2
- package/src/menu/README.md +7 -7
- package/src/menu/stories/index.story.tsx +1 -0
- package/src/navigable-container/container.tsx +22 -30
- package/src/popover/README.md +1 -1
- package/src/popover/index.tsx +1 -1
- package/src/popover/types.ts +4 -2
- package/src/range-control/types.ts +1 -1
- package/src/responsive-wrapper/index.tsx +3 -7
- package/src/scrollable/README.md +1 -1
- package/src/snackbar/README.md +1 -1
- package/src/snackbar/types.ts +2 -2
- package/src/tabs/README.md +1 -1
- package/src/tabs/stories/index.story.tsx +1 -0
- package/src/tabs/tablist.tsx +1 -1
- package/src/tooltip/index.tsx +1 -7
- package/src/tooltip/style.scss +1 -1
- package/src/tree-grid/test/cell.tsx +1 -0
- package/src/tree-grid/test/roving-tab-index-item.tsx +1 -0
- package/src/tree-select/README.md +1 -1
- package/src/unit-control/utils.ts +33 -52
- package/src/utils/get-node-text.ts +1 -7
- package/src/validated-form-controls/control-with-error.tsx +1 -6
- package/build/mobile/image/constants.cjs +0 -34
- package/build/mobile/image/constants.cjs.map +0 -7
- package/build-module/mobile/image/constants.mjs +0 -9
- package/build-module/mobile/image/constants.mjs.map +0 -7
- package/src/autocomplete/autocompleter-ui.native.js +0 -211
- package/src/autocomplete/background-view.android.js +0 -25
- package/src/autocomplete/background-view.ios.js +0 -23
- package/src/autocomplete/style.android.scss +0 -7
- package/src/autocomplete/style.native.scss +0 -74
- package/src/base-control/index.native.js +0 -14
- package/src/button/index.native.js +0 -236
- package/src/button/style.native.scss +0 -9
- package/src/color-control/index.native.js +0 -24
- package/src/color-indicator/index.native.js +0 -80
- package/src/color-indicator/style.native.scss +0 -51
- package/src/color-palette/index.native.js +0 -360
- package/src/color-palette/style.native.scss +0 -49
- package/src/color-picker/hsv-color-picker.native.js +0 -88
- package/src/color-picker/hue-picker.native.js +0 -198
- package/src/color-picker/index.native.js +0 -215
- package/src/color-picker/saturation-picker.native.js +0 -167
- package/src/color-picker/style.native.scss +0 -87
- package/src/custom-gradient-picker/index.native.js +0 -110
- package/src/custom-gradient-picker/style.native.scss +0 -3
- package/src/dashicon/index.native.js +0 -18
- package/src/disabled/index.native.js +0 -10
- package/src/draggable/index.native.js +0 -234
- package/src/draggable/style.native.scss +0 -3
- package/src/draggable/test/index.native.js +0 -138
- package/src/dropdown/index.native.js +0 -59
- package/src/dropdown-menu/index.native.js +0 -152
- package/src/external-link/index.native.js +0 -25
- package/src/focal-point-picker/focal-point.native.js +0 -30
- package/src/focal-point-picker/index.native.js +0 -281
- package/src/focal-point-picker/tooltip/index.native.js +0 -144
- package/src/focal-point-picker/tooltip/style.native.scss +0 -42
- package/src/font-size-picker/index.native.js +0 -190
- package/src/font-size-picker/style.native.scss +0 -6
- package/src/footer-message-control/index.native.js +0 -14
- package/src/higher-order/with-focus-outside/index.native.js +0 -38
- package/src/index.native.js +0 -134
- package/src/keyboard-shortcuts/index.native.js +0 -2
- package/src/mobile/README.md +0 -3
- package/src/mobile/autocompletion-items.native.js +0 -11
- package/src/mobile/badge/README.md +0 -31
- package/src/mobile/badge/index.native.js +0 -27
- package/src/mobile/badge/style.scss +0 -18
- package/src/mobile/bottom-sheet/borderStyles.android.scss +0 -8
- package/src/mobile/bottom-sheet/borderStyles.ios.scss +0 -9
- package/src/mobile/bottom-sheet/bottom-sheet-context.native.js +0 -40
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/README.md +0 -101
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/bottom-sheet-navigation-context.native.js +0 -16
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +0 -193
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +0 -146
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/styles.native.scss +0 -11
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/test/navigation-container.native.js +0 -197
- package/src/mobile/bottom-sheet/button.native.js +0 -19
- package/src/mobile/bottom-sheet/cell.native.js +0 -464
- package/src/mobile/bottom-sheet/cellStyles.android.scss +0 -15
- package/src/mobile/bottom-sheet/cellStyles.ios.scss +0 -19
- package/src/mobile/bottom-sheet/chevron-back.native.js +0 -18
- package/src/mobile/bottom-sheet/color-cell.native.js +0 -35
- package/src/mobile/bottom-sheet/cycle-picker-cell.native.js +0 -31
- package/src/mobile/bottom-sheet/footer-message-cell.native.js +0 -23
- package/src/mobile/bottom-sheet/footer-message-link/README.md +0 -37
- package/src/mobile/bottom-sheet/footer-message-link/footer-message-link.native.js +0 -26
- package/src/mobile/bottom-sheet/footer-message-link/styles.native.scss +0 -7
- package/src/mobile/bottom-sheet/index.native.js +0 -646
- package/src/mobile/bottom-sheet/keyboard-avoiding-view.native.js +0 -125
- package/src/mobile/bottom-sheet/link-cell.native.js +0 -35
- package/src/mobile/bottom-sheet/link-suggestion-item-cell.native.js +0 -92
- package/src/mobile/bottom-sheet/link-suggestion-styles.native.scss +0 -27
- package/src/mobile/bottom-sheet/lock-icon/index.native.js +0 -19
- package/src/mobile/bottom-sheet/lock-icon/styles.native.scss +0 -8
- package/src/mobile/bottom-sheet/nav-bar/README.md +0 -63
- package/src/mobile/bottom-sheet/nav-bar/action-button.native.js +0 -30
- package/src/mobile/bottom-sheet/nav-bar/apply-button.native.js +0 -53
- package/src/mobile/bottom-sheet/nav-bar/back-button.native.js +0 -94
- package/src/mobile/bottom-sheet/nav-bar/heading.native.js +0 -33
- package/src/mobile/bottom-sheet/nav-bar/index.native.js +0 -23
- package/src/mobile/bottom-sheet/nav-bar/styles.native.scss +0 -69
- package/src/mobile/bottom-sheet/picker-cell.native.js +0 -40
- package/src/mobile/bottom-sheet/radio-cell.native.js +0 -39
- package/src/mobile/bottom-sheet/range-cell.native.js +0 -274
- package/src/mobile/bottom-sheet/range-cell.native.scss +0 -40
- package/src/mobile/bottom-sheet/range-text-input.native.js +0 -248
- package/src/mobile/bottom-sheet/ripple.native.js +0 -83
- package/src/mobile/bottom-sheet/ripple.native.scss +0 -11
- package/src/mobile/bottom-sheet/stepper-cell/index.native.js +0 -264
- package/src/mobile/bottom-sheet/stepper-cell/stepper.android.js +0 -78
- package/src/mobile/bottom-sheet/stepper-cell/stepper.ios.js +0 -64
- package/src/mobile/bottom-sheet/stepper-cell/style.native.scss +0 -89
- package/src/mobile/bottom-sheet/styles.native.scss +0 -333
- package/src/mobile/bottom-sheet/sub-sheet/README.md +0 -90
- package/src/mobile/bottom-sheet/sub-sheet/index.native.js +0 -49
- package/src/mobile/bottom-sheet/switch-cell.native.js +0 -75
- package/src/mobile/bottom-sheet/test/index.native.js +0 -24
- package/src/mobile/bottom-sheet/test/range-cell.native.js +0 -73
- package/src/mobile/bottom-sheet-select-control/README.md +0 -97
- package/src/mobile/bottom-sheet-select-control/index.native.js +0 -124
- package/src/mobile/bottom-sheet-select-control/style.native.scss +0 -3
- package/src/mobile/bottom-sheet-text-control/README.md +0 -98
- package/src/mobile/bottom-sheet-text-control/index.native.js +0 -104
- package/src/mobile/bottom-sheet-text-control/styles.scss +0 -25
- package/src/mobile/clipboard/index.native.js +0 -18
- package/src/mobile/color-settings/gradient-picker-screen.native.js +0 -37
- package/src/mobile/color-settings/index.native.js +0 -88
- package/src/mobile/color-settings/palette.screen.native.js +0 -232
- package/src/mobile/color-settings/picker-screen.native.js +0 -60
- package/src/mobile/color-settings/style.native.scss +0 -62
- package/src/mobile/color-settings/utils.native.js +0 -36
- package/src/mobile/cycle-select-control/README.md +0 -3
- package/src/mobile/cycle-select-control/index.native.js +0 -39
- package/src/mobile/dashicons/index.native.js +0 -22
- package/src/mobile/focal-point-settings-panel/index.native.js +0 -84
- package/src/mobile/focal-point-settings-panel/styles.native.scss +0 -3
- package/src/mobile/gradient/index.native.js +0 -188
- package/src/mobile/gradient/style.native.scss +0 -8
- package/src/mobile/gradient/test/index.native.js +0 -114
- package/src/mobile/gridicons/index.native.js +0 -39
- package/src/mobile/html-text-input/index.native.js +0 -169
- package/src/mobile/html-text-input/style.android.scss +0 -8
- package/src/mobile/html-text-input/style.ios.scss +0 -10
- package/src/mobile/html-text-input/style.scss +0 -45
- package/src/mobile/html-text-input/test/__snapshots__/index.native.js.snap +0 -48
- package/src/mobile/html-text-input/test/index.native.js +0 -118
- package/src/mobile/image/constants.js +0 -1
- package/src/mobile/image/icon-customize.native.js +0 -10
- package/src/mobile/image/icon-retry.native.js +0 -11
- package/src/mobile/image/image-editing-button.native.js +0 -63
- package/src/mobile/image/index.native.js +0 -401
- package/src/mobile/image/style.native.scss +0 -179
- package/src/mobile/image/utils/index.native.js +0 -58
- package/src/mobile/keyboard-avoiding-view/index.android.js +0 -8
- package/src/mobile/keyboard-avoiding-view/index.ios.js +0 -143
- package/src/mobile/keyboard-avoiding-view/styles.native.scss +0 -9
- package/src/mobile/keyboard-aware-flat-list/index.android.js +0 -81
- package/src/mobile/keyboard-aware-flat-list/index.ios.js +0 -147
- package/src/mobile/keyboard-aware-flat-list/shared.native.js +0 -26
- package/src/mobile/keyboard-aware-flat-list/styles.native.scss +0 -8
- package/src/mobile/keyboard-aware-flat-list/test/use-keyboard-offset.native.js +0 -203
- package/src/mobile/keyboard-aware-flat-list/test/use-scroll-to-section.native.js +0 -142
- package/src/mobile/keyboard-aware-flat-list/test/use-scroll.native.js +0 -71
- package/src/mobile/keyboard-aware-flat-list/test/use-text-input-caret-position.native.js +0 -82
- package/src/mobile/keyboard-aware-flat-list/test/use-text-input-offset.native.js +0 -147
- package/src/mobile/keyboard-aware-flat-list/use-keyboard-offset.native.js +0 -87
- package/src/mobile/keyboard-aware-flat-list/use-scroll-to-element.native.js +0 -41
- package/src/mobile/keyboard-aware-flat-list/use-scroll-to-section.native.js +0 -100
- package/src/mobile/keyboard-aware-flat-list/use-scroll.native.js +0 -100
- package/src/mobile/keyboard-aware-flat-list/use-text-input-caret-position.native.js +0 -36
- package/src/mobile/keyboard-aware-flat-list/use-text-input-offset.native.js +0 -54
- package/src/mobile/layout-animation/index.native.js +0 -16
- package/src/mobile/link-picker/index.native.js +0 -160
- package/src/mobile/link-picker/link-picker-results.native.js +0 -129
- package/src/mobile/link-picker/link-picker-screen.native.js +0 -60
- package/src/mobile/link-picker/styles.native.scss +0 -45
- package/src/mobile/link-picker/test/performance/index.native.js +0 -35
- package/src/mobile/link-settings/index.native.js +0 -332
- package/src/mobile/link-settings/link-rel.native.js +0 -10
- package/src/mobile/link-settings/link-settings-navigation.native.js +0 -50
- package/src/mobile/link-settings/link-settings-screen.native.js +0 -44
- package/src/mobile/link-settings/style.native.scss +0 -4
- package/src/mobile/link-settings/test/edit.native.js +0 -325
- package/src/mobile/link-settings/test/link-settings-navigation.native.js +0 -94
- package/src/mobile/media-edit/index.native.js +0 -125
- package/src/mobile/picker/index.android.js +0 -104
- package/src/mobile/picker/index.ios.js +0 -96
- package/src/mobile/picker/styles.native.scss +0 -29
- package/src/mobile/segmented-control/index.native.js +0 -186
- package/src/mobile/segmented-control/style.native.scss +0 -99
- package/src/mobile/utils/alignments.native.js +0 -78
- package/src/mobile/utils/get-px-from-css-unit.native.js +0 -329
- package/src/mobile/utils/index.native.js +0 -12
- package/src/mobile/utils/test/get-px-from-css-unit.native.js +0 -172
- package/src/mobile/utils/test/index.native.js +0 -134
- package/src/mobile/utils/use-is-floating-keyboard.native.js +0 -31
- package/src/mobile/utils/use-unit-converter-to-mobile.native.js +0 -90
- package/src/notice/index.native.js +0 -123
- package/src/notice/list.native.js +0 -55
- package/src/notice/style.native.scss +0 -60
- package/src/panel/actions.native.js +0 -46
- package/src/panel/actions.native.scss +0 -12
- package/src/panel/body.native.js +0 -29
- package/src/panel/body.native.scss +0 -11
- package/src/panel/bottom-separator-cover.native.js +0 -27
- package/src/panel/bottom-separator-cover.native.scss +0 -9
- package/src/private-apis.native.js +0 -13
- package/src/query-controls/index.native.js +0 -103
- package/src/radio-control/index.native.js +0 -24
- package/src/range-control/index.native.js +0 -73
- package/src/resizable-box/index.native.js +0 -32
- package/src/resizable-box/style.native.scss +0 -14
- package/src/sandbox/index.native.js +0 -392
- package/src/sandbox/style.native.scss +0 -7
- package/src/search-control/index.native.js +0 -274
- package/src/search-control/platform-style.android.scss +0 -57
- package/src/search-control/platform-style.ios.scss +0 -43
- package/src/search-control/style.native.scss +0 -63
- package/src/select-control/index.native.js +0 -41
- package/src/slot-fill/index.native.js +0 -25
- package/src/spinner/index.native.js +0 -22
- package/src/spinner/style.native.scss +0 -4
- package/src/style-provider/index.native.js +0 -3
- package/src/text/index.native.js +0 -13
- package/src/text/styles/emotion-css.native.js +0 -6
- package/src/text/styles/font-family.native.js +0 -1
- package/src/text/styles/text-mixins.native.js +0 -163
- package/src/text-control/index.native.js +0 -41
- package/src/textarea-control/index.native.js +0 -26
- package/src/toggle-control/index.native.js +0 -31
- package/src/toolbar/toolbar/style.native.scss +0 -11
- package/src/toolbar/toolbar/toolbar-container.native.js +0 -8
- package/src/toolbar/toolbar-button/toolbar-button-container.native.js +0 -8
- package/src/toolbar/toolbar-group/style.native.scss +0 -10
- package/src/toolbar/toolbar-group/toolbar-group-collapsed.native.js +0 -36
- package/src/toolbar/toolbar-group/toolbar-group-container.native.js +0 -26
- package/src/toolbar/toolbar-item/index.native.js +0 -17
- package/src/tooltip/index.native.js +0 -292
- package/src/tooltip/style.native.scss +0 -39
- package/src/tooltip/test/index.native.js +0 -98
- package/src/unit-control/index.native.js +0 -202
- package/src/unit-control/style.native.scss +0 -19
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { ActionSheetIOS } from 'react-native';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { __ } from '@wordpress/i18n';
|
|
10
|
-
import { Component, forwardRef, useContext } from '@wordpress/element';
|
|
11
|
-
import { useDispatch, useSelect } from '@wordpress/data';
|
|
12
|
-
import { usePreferredColorScheme } from '@wordpress/compose';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Internal dependencies
|
|
16
|
-
*/
|
|
17
|
-
import styles from './styles.scss';
|
|
18
|
-
import { BottomSheetContext } from '../bottom-sheet/bottom-sheet-context';
|
|
19
|
-
|
|
20
|
-
class Picker extends Component {
|
|
21
|
-
presentPicker() {
|
|
22
|
-
const {
|
|
23
|
-
options,
|
|
24
|
-
onChange,
|
|
25
|
-
title,
|
|
26
|
-
destructiveButtonIndex,
|
|
27
|
-
disabledButtonIndices,
|
|
28
|
-
getAnchor,
|
|
29
|
-
isBottomSheetOpened,
|
|
30
|
-
closeBottomSheet,
|
|
31
|
-
onHandleClosingBottomSheet,
|
|
32
|
-
colorScheme,
|
|
33
|
-
} = this.props;
|
|
34
|
-
const labels = options.map( ( { label } ) => label );
|
|
35
|
-
const fullOptions = [ __( 'Cancel' ) ].concat( labels );
|
|
36
|
-
|
|
37
|
-
const buttonTitleColor =
|
|
38
|
-
colorScheme === 'light'
|
|
39
|
-
? styles[ 'components-picker__button-title' ].color
|
|
40
|
-
: styles[ 'components-picker__button-title--dark' ].color;
|
|
41
|
-
|
|
42
|
-
ActionSheetIOS.showActionSheetWithOptions(
|
|
43
|
-
{
|
|
44
|
-
title,
|
|
45
|
-
options: fullOptions,
|
|
46
|
-
cancelButtonIndex: 0,
|
|
47
|
-
destructiveButtonIndex,
|
|
48
|
-
disabledButtonIndices,
|
|
49
|
-
anchor: getAnchor && getAnchor(),
|
|
50
|
-
tintColor: buttonTitleColor,
|
|
51
|
-
},
|
|
52
|
-
( buttonIndex ) => {
|
|
53
|
-
if ( buttonIndex === 0 ) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
const selected = options[ buttonIndex - 1 ];
|
|
57
|
-
|
|
58
|
-
if ( selected.requiresModal && isBottomSheetOpened ) {
|
|
59
|
-
onHandleClosingBottomSheet( () => {
|
|
60
|
-
onChange( selected.value );
|
|
61
|
-
} );
|
|
62
|
-
closeBottomSheet();
|
|
63
|
-
} else {
|
|
64
|
-
onChange( selected.value );
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
render() {
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const PickerComponent = forwardRef( ( props, ref ) => {
|
|
76
|
-
const isBottomSheetOpened = useSelect( ( select ) =>
|
|
77
|
-
select( 'core/edit-post' ).isEditorSidebarOpened()
|
|
78
|
-
);
|
|
79
|
-
const { closeGeneralSidebar } = useDispatch( 'core/edit-post' );
|
|
80
|
-
const { onHandleClosingBottomSheet } = useContext( BottomSheetContext );
|
|
81
|
-
|
|
82
|
-
const colorScheme = usePreferredColorScheme();
|
|
83
|
-
|
|
84
|
-
return (
|
|
85
|
-
<Picker
|
|
86
|
-
ref={ ref }
|
|
87
|
-
{ ...props }
|
|
88
|
-
isBottomSheetOpened={ isBottomSheetOpened }
|
|
89
|
-
closeBottomSheet={ closeGeneralSidebar }
|
|
90
|
-
onHandleClosingBottomSheet={ onHandleClosingBottomSheet }
|
|
91
|
-
colorScheme={ colorScheme }
|
|
92
|
-
/>
|
|
93
|
-
);
|
|
94
|
-
} );
|
|
95
|
-
|
|
96
|
-
export default PickerComponent;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
.components-picker__separator {
|
|
2
|
-
margin-top: $grid-unit-20 * 0.5;
|
|
3
|
-
margin-bottom: $grid-unit-20 * 0.5;
|
|
4
|
-
margin-left: -$grid-unit-20;
|
|
5
|
-
margin-right: -$grid-unit-20;
|
|
6
|
-
height: $border-width;
|
|
7
|
-
background-color: $light-gray-400;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.components-picker__separator--dark {
|
|
11
|
-
background-color: $gray-70;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.components-picker__button--disabled {
|
|
15
|
-
opacity: 0.3;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.components-picker__panel {
|
|
19
|
-
padding-left: 0;
|
|
20
|
-
padding-right: 0;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.components-picker__button-title {
|
|
24
|
-
color: $blue-50;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.components-picker__button-title--dark {
|
|
28
|
-
color: $blue-30;
|
|
29
|
-
}
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import {
|
|
5
|
-
View,
|
|
6
|
-
TouchableWithoutFeedback,
|
|
7
|
-
Text,
|
|
8
|
-
Platform,
|
|
9
|
-
Animated,
|
|
10
|
-
Easing,
|
|
11
|
-
} from 'react-native';
|
|
12
|
-
/**
|
|
13
|
-
* WordPress dependencies
|
|
14
|
-
*/
|
|
15
|
-
import { useState, useEffect } from '@wordpress/element';
|
|
16
|
-
import { usePreferredColorSchemeStyle } from '@wordpress/compose';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Internal dependencies
|
|
20
|
-
*/
|
|
21
|
-
import { performLayoutAnimation } from '../layout-animation';
|
|
22
|
-
import styles from './style.scss';
|
|
23
|
-
|
|
24
|
-
const ANIMATION_DURATION = 200;
|
|
25
|
-
|
|
26
|
-
const isIOS = Platform.OS === 'ios';
|
|
27
|
-
|
|
28
|
-
const Segment = ( { isSelected, title, onPress, onLayout, ...props } ) => {
|
|
29
|
-
const isSelectedIOS = isIOS && isSelected;
|
|
30
|
-
|
|
31
|
-
const segmentStyle = [ styles.segment, isIOS && styles.segmentIOS ];
|
|
32
|
-
|
|
33
|
-
const textStyle = usePreferredColorSchemeStyle(
|
|
34
|
-
styles.buttonTextDefault,
|
|
35
|
-
styles.buttonTextDefaultDark
|
|
36
|
-
);
|
|
37
|
-
const selectedTextStyle = usePreferredColorSchemeStyle(
|
|
38
|
-
styles.buttonTextSelected,
|
|
39
|
-
styles.buttonTextSelectedDark
|
|
40
|
-
);
|
|
41
|
-
const shadowStyle = usePreferredColorSchemeStyle( styles.shadowIOS, {} );
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<View style={ isSelectedIOS && shadowStyle }>
|
|
45
|
-
<TouchableWithoutFeedback onPress={ onPress }>
|
|
46
|
-
<View style={ segmentStyle } onLayout={ onLayout } { ...props }>
|
|
47
|
-
<Text
|
|
48
|
-
style={ [ textStyle, isSelected && selectedTextStyle ] }
|
|
49
|
-
maxFontSizeMultiplier={ 2 }
|
|
50
|
-
>
|
|
51
|
-
{ title }
|
|
52
|
-
</Text>
|
|
53
|
-
</View>
|
|
54
|
-
</TouchableWithoutFeedback>
|
|
55
|
-
</View>
|
|
56
|
-
);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const SegmentedControls = ( {
|
|
60
|
-
segments,
|
|
61
|
-
segmentHandler,
|
|
62
|
-
selectedIndex,
|
|
63
|
-
addonLeft,
|
|
64
|
-
addonRight,
|
|
65
|
-
} ) => {
|
|
66
|
-
const selectedSegmentIndex = selectedIndex || 0;
|
|
67
|
-
const [ activeSegmentIndex, setActiveSegmentIndex ] =
|
|
68
|
-
useState( selectedSegmentIndex );
|
|
69
|
-
const [ segmentsDimensions, setSegmentsDimensions ] = useState( {
|
|
70
|
-
[ activeSegmentIndex ]: { width: 0, height: 0 },
|
|
71
|
-
} );
|
|
72
|
-
const [ positionAnimationValue ] = useState( new Animated.Value( 0 ) );
|
|
73
|
-
|
|
74
|
-
useEffect( () => {
|
|
75
|
-
setActiveSegmentIndex( selectedSegmentIndex );
|
|
76
|
-
segmentHandler( segments[ selectedSegmentIndex ] );
|
|
77
|
-
// See https://github.com/WordPress/gutenberg/pull/41166
|
|
78
|
-
}, [] );
|
|
79
|
-
|
|
80
|
-
useEffect( () => {
|
|
81
|
-
positionAnimationValue.setValue(
|
|
82
|
-
calculateEndValue( activeSegmentIndex )
|
|
83
|
-
);
|
|
84
|
-
// See https://github.com/WordPress/gutenberg/pull/41166
|
|
85
|
-
}, [ segmentsDimensions ] );
|
|
86
|
-
|
|
87
|
-
const containerStyle = usePreferredColorSchemeStyle(
|
|
88
|
-
styles.container,
|
|
89
|
-
styles.containerDark
|
|
90
|
-
);
|
|
91
|
-
|
|
92
|
-
function performSwatchAnimation( index ) {
|
|
93
|
-
Animated.timing( positionAnimationValue, {
|
|
94
|
-
toValue: calculateEndValue( index ),
|
|
95
|
-
duration: ANIMATION_DURATION,
|
|
96
|
-
easing: Easing.ease,
|
|
97
|
-
useNativeDriver: false,
|
|
98
|
-
} ).start();
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function calculateEndValue( index ) {
|
|
102
|
-
const { paddingLeft: offset } = isIOS
|
|
103
|
-
? styles.containerIOS
|
|
104
|
-
: styles.container;
|
|
105
|
-
const widths = Object.values( segmentsDimensions ).map(
|
|
106
|
-
( dimension ) => dimension.width
|
|
107
|
-
);
|
|
108
|
-
const widthsDistance = widths.slice( 0, index );
|
|
109
|
-
const widthsDistanceSum = widthsDistance.reduce(
|
|
110
|
-
( sum, n ) => sum + n,
|
|
111
|
-
0
|
|
112
|
-
);
|
|
113
|
-
|
|
114
|
-
const endValue = index === 0 ? 0 : widthsDistanceSum;
|
|
115
|
-
return endValue + offset;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
function onHandlePress( segment, index ) {
|
|
119
|
-
performLayoutAnimation( ANIMATION_DURATION );
|
|
120
|
-
setActiveSegmentIndex( index );
|
|
121
|
-
segmentHandler( segment );
|
|
122
|
-
performSwatchAnimation( index );
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
function segmentOnLayout( event, index ) {
|
|
126
|
-
const { width, height } = event.nativeEvent.layout;
|
|
127
|
-
|
|
128
|
-
setSegmentsDimensions( {
|
|
129
|
-
...segmentsDimensions,
|
|
130
|
-
[ index ]: { width, height },
|
|
131
|
-
} );
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
const selectedStyle = usePreferredColorSchemeStyle(
|
|
135
|
-
styles.selected,
|
|
136
|
-
styles.selectedDark
|
|
137
|
-
);
|
|
138
|
-
|
|
139
|
-
const width = segmentsDimensions[ activeSegmentIndex ]?.width;
|
|
140
|
-
const height = segmentsDimensions[ activeSegmentIndex ]?.height;
|
|
141
|
-
|
|
142
|
-
const outlineStyle = [ styles.outline, isIOS && styles.outlineIOS ];
|
|
143
|
-
|
|
144
|
-
return (
|
|
145
|
-
<View style={ styles.row }>
|
|
146
|
-
<View style={ styles.flex }>{ addonLeft }</View>
|
|
147
|
-
<View style={ [ containerStyle, isIOS && styles.containerIOS ] }>
|
|
148
|
-
<Animated.View
|
|
149
|
-
style={ [
|
|
150
|
-
{
|
|
151
|
-
width,
|
|
152
|
-
left: positionAnimationValue,
|
|
153
|
-
height,
|
|
154
|
-
},
|
|
155
|
-
selectedStyle,
|
|
156
|
-
outlineStyle,
|
|
157
|
-
] }
|
|
158
|
-
/>
|
|
159
|
-
{ segments.map( ( segment, index ) => {
|
|
160
|
-
return (
|
|
161
|
-
<Segment
|
|
162
|
-
title={ segment }
|
|
163
|
-
onPress={ () => onHandlePress( segment, index ) }
|
|
164
|
-
isSelected={ activeSegmentIndex === index }
|
|
165
|
-
key={ index }
|
|
166
|
-
onLayout={ ( event ) =>
|
|
167
|
-
segmentOnLayout( event, index )
|
|
168
|
-
}
|
|
169
|
-
accessibilityState={ {
|
|
170
|
-
selected: activeSegmentIndex === index,
|
|
171
|
-
} }
|
|
172
|
-
accessibilityRole="button"
|
|
173
|
-
accessibilityLabel={ segment }
|
|
174
|
-
accessibilityHint={ `${ index + 1 } on ${
|
|
175
|
-
segments.length
|
|
176
|
-
}` }
|
|
177
|
-
/>
|
|
178
|
-
);
|
|
179
|
-
} ) }
|
|
180
|
-
</View>
|
|
181
|
-
<View style={ styles.flex }>{ addonRight }</View>
|
|
182
|
-
</View>
|
|
183
|
-
);
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
export default SegmentedControls;
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
$container-height: 32px;
|
|
2
|
-
$segment-height: 28px;
|
|
3
|
-
$segment-spacing: 2px;
|
|
4
|
-
$border-width-ios: $border-width * 0.5;
|
|
5
|
-
$border-width-android: $border-width;
|
|
6
|
-
$border-radius-ios: 7px;
|
|
7
|
-
|
|
8
|
-
.segment {
|
|
9
|
-
border-radius: $segment-height * 0.5;
|
|
10
|
-
padding: 6px $grid-unit-20;
|
|
11
|
-
align-items: center;
|
|
12
|
-
justify-content: center;
|
|
13
|
-
margin-top: $segment-spacing + $border-width;
|
|
14
|
-
margin-bottom: $segment-spacing + $border-width;
|
|
15
|
-
z-index: 2;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.segmentIOS {
|
|
19
|
-
border-radius: $border-radius-ios;
|
|
20
|
-
margin-top: $segment-spacing + $border-width-ios;
|
|
21
|
-
margin-bottom: $segment-spacing + $border-width-ios;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.selected {
|
|
25
|
-
position: absolute;
|
|
26
|
-
background-color: $white;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.selectedDark {
|
|
30
|
-
background-color: $dark-quaternary;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.shadowIOS {
|
|
34
|
-
box-shadow: 0 0 8px $light-dim;
|
|
35
|
-
z-index: 2;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.container {
|
|
39
|
-
min-height: $container-height;
|
|
40
|
-
background-color: $light-ultra-dim;
|
|
41
|
-
border-radius: $container-height * 0.5;
|
|
42
|
-
align-items: center;
|
|
43
|
-
flex-direction: row;
|
|
44
|
-
align-self: center;
|
|
45
|
-
padding-left: $segment-spacing + $border-width;
|
|
46
|
-
padding-right: $segment-spacing + $border-width;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.containerDark {
|
|
50
|
-
background-color: $dark-ultra-dim;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.containerIOS {
|
|
54
|
-
border-radius: $border-radius-ios + 2 * $border-width-ios;
|
|
55
|
-
padding-left: $segment-spacing + $border-width-ios;
|
|
56
|
-
padding-right: $segment-spacing + $border-width-ios;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.outline {
|
|
60
|
-
position: absolute;
|
|
61
|
-
min-height: $segment-height - 2 * $border-width-ios;
|
|
62
|
-
border-width: $border-width;
|
|
63
|
-
border-radius: $container-height * 0.5;
|
|
64
|
-
border-color: $light-ultra-dim;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.outlineIOS {
|
|
68
|
-
border-radius: $border-radius-ios;
|
|
69
|
-
border-width: $border-width-ios;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.buttonTextDefault {
|
|
73
|
-
font-size: 12px;
|
|
74
|
-
font-weight: 600;
|
|
75
|
-
text-align: center;
|
|
76
|
-
color: $light-secondary;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.buttonTextDefaultDark {
|
|
80
|
-
color: #e0e0e0;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.buttonTextSelected {
|
|
84
|
-
color: $light-primary;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.buttonTextSelectedDark {
|
|
88
|
-
color: #f4f4f4;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.row {
|
|
92
|
-
flex-direction: row;
|
|
93
|
-
align-items: center;
|
|
94
|
-
padding: $grid-unit-20 * 0.5 $grid-unit-20;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.flex {
|
|
98
|
-
flex: 1;
|
|
99
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { getBlockType } from '@wordpress/blocks';
|
|
5
|
-
|
|
6
|
-
export const WIDE_ALIGNMENTS = {
|
|
7
|
-
alignments: {
|
|
8
|
-
wide: 'wide',
|
|
9
|
-
full: 'full',
|
|
10
|
-
},
|
|
11
|
-
excludeBlocks: [ 'core/heading' ],
|
|
12
|
-
notInnerContainers: [
|
|
13
|
-
'core/image',
|
|
14
|
-
'core/separator',
|
|
15
|
-
'core/media-text',
|
|
16
|
-
'core/quote',
|
|
17
|
-
'core/pullquote',
|
|
18
|
-
],
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const ALIGNMENT_BREAKPOINTS = {
|
|
22
|
-
wide: 1024,
|
|
23
|
-
large: 820,
|
|
24
|
-
medium: 768,
|
|
25
|
-
small: 680,
|
|
26
|
-
mobile: 480,
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const isFullWidth = ( align ) => align === WIDE_ALIGNMENTS.alignments.full;
|
|
30
|
-
|
|
31
|
-
const isWideWidth = ( align ) => align === WIDE_ALIGNMENTS.alignments.wide;
|
|
32
|
-
|
|
33
|
-
const isWider = ( width, breakpoint ) =>
|
|
34
|
-
width > ALIGNMENT_BREAKPOINTS[ breakpoint ];
|
|
35
|
-
|
|
36
|
-
const isContainerRelated = ( blockName ) => {
|
|
37
|
-
if ( WIDE_ALIGNMENTS.notInnerContainers.includes( blockName ) ) {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if ( hasFullWidthSupport( blockName ) ) {
|
|
42
|
-
return true;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return hasParentFullWidthSupport( blockName );
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Whether the block has support for full width alignment.
|
|
50
|
-
*
|
|
51
|
-
* @param {string} blockName
|
|
52
|
-
* @return {boolean} Return whether the block supports full width alignment.
|
|
53
|
-
*/
|
|
54
|
-
function hasFullWidthSupport( blockName ) {
|
|
55
|
-
const blockType = getBlockType( blockName );
|
|
56
|
-
const blockAlign = blockType?.supports?.align;
|
|
57
|
-
return (
|
|
58
|
-
!! Array.isArray( blockAlign ) &&
|
|
59
|
-
blockAlign.includes( WIDE_ALIGNMENTS.alignments.full )
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Whether the block's parent has support for full width alignment.
|
|
64
|
-
*
|
|
65
|
-
* @param {string} blockName
|
|
66
|
-
* @return {boolean} Return whether the block's parent supports full width alignment.
|
|
67
|
-
*/
|
|
68
|
-
function hasParentFullWidthSupport( blockName ) {
|
|
69
|
-
const blockType = getBlockType( blockName );
|
|
70
|
-
return !! blockType?.parent?.some( hasFullWidthSupport );
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export const alignmentHelpers = {
|
|
74
|
-
isFullWidth,
|
|
75
|
-
isWideWidth,
|
|
76
|
-
isWider,
|
|
77
|
-
isContainerRelated,
|
|
78
|
-
};
|