@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,51 +0,0 @@
|
|
|
1
|
-
.selected {
|
|
2
|
-
height: 28px;
|
|
3
|
-
width: 28px;
|
|
4
|
-
border-radius: 14px;
|
|
5
|
-
background-color: $white;
|
|
6
|
-
justify-content: center;
|
|
7
|
-
align-items: center;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.circleOption {
|
|
11
|
-
height: $mobile-color-swatch;
|
|
12
|
-
width: $mobile-color-swatch;
|
|
13
|
-
border-radius: 24px;
|
|
14
|
-
margin-right: 8px;
|
|
15
|
-
justify-content: center;
|
|
16
|
-
align-items: center;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.absolute {
|
|
20
|
-
position: absolute;
|
|
21
|
-
margin-right: 0;
|
|
22
|
-
border-width: 0;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.icon {
|
|
26
|
-
color: $gray-dark;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.outline {
|
|
30
|
-
border-color: $light-dim;
|
|
31
|
-
top: 0;
|
|
32
|
-
bottom: 0;
|
|
33
|
-
left: 0;
|
|
34
|
-
right: 0;
|
|
35
|
-
border-radius: 24px;
|
|
36
|
-
border-width: $border-width;
|
|
37
|
-
position: absolute;
|
|
38
|
-
z-index: 2;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.outlineDark {
|
|
42
|
-
border-color: $dark-ultra-dim;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.selectedOutline {
|
|
46
|
-
top: -$border-width;
|
|
47
|
-
bottom: -$border-width;
|
|
48
|
-
left: -$border-width;
|
|
49
|
-
right: -$border-width;
|
|
50
|
-
border-radius: 14px;
|
|
51
|
-
}
|
|
@@ -1,360 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import {
|
|
5
|
-
ScrollView,
|
|
6
|
-
TouchableWithoutFeedback,
|
|
7
|
-
View,
|
|
8
|
-
Animated,
|
|
9
|
-
Easing,
|
|
10
|
-
Dimensions,
|
|
11
|
-
Platform,
|
|
12
|
-
Text,
|
|
13
|
-
} from 'react-native';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* WordPress dependencies
|
|
17
|
-
*/
|
|
18
|
-
import { __, sprintf } from '@wordpress/i18n';
|
|
19
|
-
import { useRef, useEffect } from '@wordpress/element';
|
|
20
|
-
import { usePreferredColorSchemeStyle } from '@wordpress/compose';
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Internal dependencies
|
|
24
|
-
*/
|
|
25
|
-
import styles from './style.scss';
|
|
26
|
-
import ColorIndicator from '../color-indicator';
|
|
27
|
-
import { colorsUtils } from '../mobile/color-settings/utils';
|
|
28
|
-
|
|
29
|
-
const ANIMATION_DURATION = 200;
|
|
30
|
-
|
|
31
|
-
let contentWidth = 0;
|
|
32
|
-
let scrollPosition = 0;
|
|
33
|
-
let customIndicatorWidth = 0;
|
|
34
|
-
|
|
35
|
-
function ColorPalette( {
|
|
36
|
-
enableCustomColor = false,
|
|
37
|
-
setColor,
|
|
38
|
-
activeColor,
|
|
39
|
-
isGradientColor,
|
|
40
|
-
defaultSettings,
|
|
41
|
-
currentSegment,
|
|
42
|
-
onCustomPress,
|
|
43
|
-
shouldEnableBottomSheetScroll,
|
|
44
|
-
shouldShowCustomIndicatorOption = true,
|
|
45
|
-
shouldShowCustomLabel = true,
|
|
46
|
-
shouldShowCustomVerticalSeparator = true,
|
|
47
|
-
customColorIndicatorStyles,
|
|
48
|
-
customIndicatorWrapperStyles,
|
|
49
|
-
label,
|
|
50
|
-
} ) {
|
|
51
|
-
const customSwatchGradients = [
|
|
52
|
-
'linear-gradient(120deg, rgba(255,0,0,.8) 0%, rgba(255,255,255,1) 70.71%)',
|
|
53
|
-
'linear-gradient(240deg, rgba(0,255,0,.8) 0%, rgba(0,255,0,0) 70.71%)',
|
|
54
|
-
'linear-gradient(360deg, rgba(0,0,255,.8) 0%, rgba(0,0,255,0) 70.71%)',
|
|
55
|
-
];
|
|
56
|
-
|
|
57
|
-
const scrollViewRef = useRef();
|
|
58
|
-
const isIOS = Platform.OS === 'ios';
|
|
59
|
-
|
|
60
|
-
const isGradientSegment = currentSegment === colorsUtils.segments[ 1 ];
|
|
61
|
-
|
|
62
|
-
const scale = useRef( new Animated.Value( 1 ) ).current;
|
|
63
|
-
const opacity = useRef( new Animated.Value( 1 ) ).current;
|
|
64
|
-
const delayedScrollRef = useRef();
|
|
65
|
-
|
|
66
|
-
const mergedColors = [
|
|
67
|
-
...new Set(
|
|
68
|
-
( defaultSettings.colors ?? [] ).map( ( { color } ) => color )
|
|
69
|
-
),
|
|
70
|
-
];
|
|
71
|
-
const mergedGradients = [
|
|
72
|
-
...new Set(
|
|
73
|
-
( defaultSettings.gradients ?? [] ).map(
|
|
74
|
-
( { gradient } ) => gradient
|
|
75
|
-
)
|
|
76
|
-
),
|
|
77
|
-
];
|
|
78
|
-
const allAvailableColors = [
|
|
79
|
-
...new Set(
|
|
80
|
-
( defaultSettings.allColors ?? [] ).map( ( { color } ) => color )
|
|
81
|
-
),
|
|
82
|
-
];
|
|
83
|
-
const allAvailableGradients = [
|
|
84
|
-
...new Set(
|
|
85
|
-
( defaultSettings.allGradients ?? [] ).map(
|
|
86
|
-
( { gradient } ) => gradient
|
|
87
|
-
)
|
|
88
|
-
),
|
|
89
|
-
];
|
|
90
|
-
|
|
91
|
-
const colors = isGradientSegment ? mergedGradients : mergedColors;
|
|
92
|
-
const allColors = isGradientSegment
|
|
93
|
-
? allAvailableGradients
|
|
94
|
-
: allAvailableColors;
|
|
95
|
-
|
|
96
|
-
const customIndicatorColor = isGradientSegment
|
|
97
|
-
? activeColor
|
|
98
|
-
: customSwatchGradients;
|
|
99
|
-
const isCustomGradientColor = isGradientColor && isSelectedCustom();
|
|
100
|
-
const shouldShowCustomIndicator =
|
|
101
|
-
enableCustomColor &&
|
|
102
|
-
shouldShowCustomIndicatorOption &&
|
|
103
|
-
( ! isGradientSegment || isCustomGradientColor );
|
|
104
|
-
|
|
105
|
-
const accessibilityHint = isGradientSegment
|
|
106
|
-
? __( 'Navigates to customize the gradient' )
|
|
107
|
-
: __( 'Navigates to custom color picker' );
|
|
108
|
-
const customText = __( 'Custom' );
|
|
109
|
-
|
|
110
|
-
useEffect( () => {
|
|
111
|
-
if ( scrollViewRef.current ) {
|
|
112
|
-
if ( isSelectedCustom() ) {
|
|
113
|
-
scrollToEndWithDelay();
|
|
114
|
-
} else {
|
|
115
|
-
scrollViewRef.current.scrollTo( { x: 0, y: 0 } );
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
// Not adding additional dependencies until the component can be refactored and updated safely.
|
|
119
|
-
// Please see https://github.com/WordPress/gutenberg/pull/41253 for discussion and details.
|
|
120
|
-
}, [ currentSegment ] );
|
|
121
|
-
|
|
122
|
-
function isSelectedCustom() {
|
|
123
|
-
const isWithinColors =
|
|
124
|
-
activeColor && allColors?.includes( activeColor );
|
|
125
|
-
if ( enableCustomColor && activeColor ) {
|
|
126
|
-
if ( isGradientSegment ) {
|
|
127
|
-
return isGradientColor && ! isWithinColors;
|
|
128
|
-
}
|
|
129
|
-
return ! isGradientColor && ! isWithinColors;
|
|
130
|
-
}
|
|
131
|
-
return false;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function isSelected( color ) {
|
|
135
|
-
return ! isSelectedCustom() && activeColor === color;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
function timingAnimation( property, toValue ) {
|
|
139
|
-
return Animated.timing( property, {
|
|
140
|
-
toValue,
|
|
141
|
-
duration: ANIMATION_DURATION,
|
|
142
|
-
easing: Easing.ease,
|
|
143
|
-
useNativeDriver: true,
|
|
144
|
-
} );
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
function performAnimation( color ) {
|
|
148
|
-
if ( ! isSelected( color ) ) {
|
|
149
|
-
opacity.setValue( 0 );
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
Animated.parallel( [
|
|
153
|
-
timingAnimation( scale, 2 ),
|
|
154
|
-
timingAnimation( opacity, 1 ),
|
|
155
|
-
] ).start( () => {
|
|
156
|
-
opacity.setValue( 1 );
|
|
157
|
-
scale.setValue( 1 );
|
|
158
|
-
} );
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
const scaleInterpolation = scale.interpolate( {
|
|
162
|
-
inputRange: [ 1, 1.5, 2 ],
|
|
163
|
-
outputRange: [ 1, 0.7, 1 ],
|
|
164
|
-
} );
|
|
165
|
-
|
|
166
|
-
function deselectCustomGradient() {
|
|
167
|
-
const { width } = Dimensions.get( 'window' );
|
|
168
|
-
const isVisible =
|
|
169
|
-
contentWidth - scrollPosition - customIndicatorWidth < width;
|
|
170
|
-
|
|
171
|
-
if ( isCustomGradientColor ) {
|
|
172
|
-
if ( ! isIOS ) {
|
|
173
|
-
// Scroll position on Android doesn't adjust automatically when removing the last item from the horizontal list.
|
|
174
|
-
// https://github.com/facebook/react-native/issues/27504
|
|
175
|
-
// Workaround: Force the scroll when deselecting custom gradient color and when custom indicator is visible on layout.
|
|
176
|
-
if (
|
|
177
|
-
isCustomGradientColor &&
|
|
178
|
-
isVisible &&
|
|
179
|
-
scrollViewRef.current
|
|
180
|
-
) {
|
|
181
|
-
scrollViewRef.current.scrollTo( {
|
|
182
|
-
x: scrollPosition - customIndicatorWidth,
|
|
183
|
-
} );
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
function getColorGradientName( value ) {
|
|
190
|
-
const fallbackName = sprintf(
|
|
191
|
-
/* translators: %s: the hex color value */
|
|
192
|
-
__( 'Unlabeled color. %s' ),
|
|
193
|
-
value
|
|
194
|
-
);
|
|
195
|
-
const foundColorName = isGradientSegment
|
|
196
|
-
? defaultSettings.gradients?.find(
|
|
197
|
-
( gradient ) => gradient.gradient === value
|
|
198
|
-
)
|
|
199
|
-
: defaultSettings.allColors?.find(
|
|
200
|
-
( color ) => color.color === value
|
|
201
|
-
);
|
|
202
|
-
return foundColorName ? foundColorName?.name : fallbackName;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
function onColorPress( color ) {
|
|
206
|
-
deselectCustomGradient();
|
|
207
|
-
performAnimation( color );
|
|
208
|
-
setColor( color );
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
function onContentSizeChange( width ) {
|
|
212
|
-
contentWidth = width;
|
|
213
|
-
if ( isSelectedCustom() && scrollViewRef.current ) {
|
|
214
|
-
scrollToEndWithDelay();
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
function scrollToEndWithDelay() {
|
|
219
|
-
delayedScrollRef.current = setTimeout( () => {
|
|
220
|
-
scrollViewRef?.current.scrollToEnd();
|
|
221
|
-
}, ANIMATION_DURATION );
|
|
222
|
-
return () => {
|
|
223
|
-
clearTimeout( delayedScrollRef.current );
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
function onCustomIndicatorLayout( { nativeEvent } ) {
|
|
228
|
-
const { width } = nativeEvent.layout;
|
|
229
|
-
if ( width !== customIndicatorWidth ) {
|
|
230
|
-
customIndicatorWidth = width;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
function onScroll( { nativeEvent } ) {
|
|
235
|
-
scrollPosition = nativeEvent.contentOffset.x;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
const verticalSeparatorStyle = usePreferredColorSchemeStyle(
|
|
239
|
-
styles.verticalSeparator,
|
|
240
|
-
styles.verticalSeparatorDark
|
|
241
|
-
);
|
|
242
|
-
|
|
243
|
-
const customTextStyle = usePreferredColorSchemeStyle(
|
|
244
|
-
[ styles.customText, ! isIOS && styles.customTextAndroid ],
|
|
245
|
-
styles.customTextDark
|
|
246
|
-
);
|
|
247
|
-
|
|
248
|
-
const customIndicatorWrapperStyle = [
|
|
249
|
-
styles.customIndicatorWrapper,
|
|
250
|
-
customIndicatorWrapperStyles,
|
|
251
|
-
];
|
|
252
|
-
|
|
253
|
-
return (
|
|
254
|
-
<>
|
|
255
|
-
{ label && (
|
|
256
|
-
<Text accessibilityRole="header" style={ styles.headerText }>
|
|
257
|
-
{ label }
|
|
258
|
-
</Text>
|
|
259
|
-
) }
|
|
260
|
-
|
|
261
|
-
<ScrollView
|
|
262
|
-
contentContainerStyle={ styles.contentContainer }
|
|
263
|
-
horizontal
|
|
264
|
-
showsHorizontalScrollIndicator={ false }
|
|
265
|
-
keyboardShouldPersistTaps="always"
|
|
266
|
-
disableScrollViewPanResponder
|
|
267
|
-
scrollEventThrottle={ 16 }
|
|
268
|
-
onScroll={ onScroll }
|
|
269
|
-
onContentSizeChange={ onContentSizeChange }
|
|
270
|
-
onScrollBeginDrag={ () =>
|
|
271
|
-
shouldEnableBottomSheetScroll( false )
|
|
272
|
-
}
|
|
273
|
-
onScrollEndDrag={ () => shouldEnableBottomSheetScroll( true ) }
|
|
274
|
-
ref={ scrollViewRef }
|
|
275
|
-
testID={ `color-palette${ label ? '-' + label : '' }` }
|
|
276
|
-
>
|
|
277
|
-
{ colors.map( ( color ) => {
|
|
278
|
-
const scaleValue = isSelected( color )
|
|
279
|
-
? scaleInterpolation
|
|
280
|
-
: 1;
|
|
281
|
-
const colorName = getColorGradientName( color );
|
|
282
|
-
|
|
283
|
-
return (
|
|
284
|
-
<View key={ `${ color }-${ isSelected( color ) }` }>
|
|
285
|
-
<TouchableWithoutFeedback
|
|
286
|
-
onPress={ () => onColorPress( color ) }
|
|
287
|
-
accessibilityRole="button"
|
|
288
|
-
accessibilityState={ {
|
|
289
|
-
selected: isSelected( color ),
|
|
290
|
-
} }
|
|
291
|
-
accessibilityHint={ color }
|
|
292
|
-
accessibilityLabel={ colorName }
|
|
293
|
-
testID={ color }
|
|
294
|
-
>
|
|
295
|
-
<Animated.View
|
|
296
|
-
style={ {
|
|
297
|
-
transform: [
|
|
298
|
-
{
|
|
299
|
-
scale: scaleValue,
|
|
300
|
-
},
|
|
301
|
-
],
|
|
302
|
-
} }
|
|
303
|
-
>
|
|
304
|
-
<ColorIndicator
|
|
305
|
-
color={ color }
|
|
306
|
-
isSelected={ isSelected( color ) }
|
|
307
|
-
opacity={ opacity }
|
|
308
|
-
style={ [
|
|
309
|
-
styles.colorIndicator,
|
|
310
|
-
customColorIndicatorStyles,
|
|
311
|
-
] }
|
|
312
|
-
/>
|
|
313
|
-
</Animated.View>
|
|
314
|
-
</TouchableWithoutFeedback>
|
|
315
|
-
</View>
|
|
316
|
-
);
|
|
317
|
-
} ) }
|
|
318
|
-
{ shouldShowCustomIndicator && (
|
|
319
|
-
<View
|
|
320
|
-
style={ customIndicatorWrapperStyle }
|
|
321
|
-
onLayout={ onCustomIndicatorLayout }
|
|
322
|
-
>
|
|
323
|
-
{ shouldShowCustomVerticalSeparator && (
|
|
324
|
-
<View style={ verticalSeparatorStyle } />
|
|
325
|
-
) }
|
|
326
|
-
<TouchableWithoutFeedback
|
|
327
|
-
onPress={ onCustomPress }
|
|
328
|
-
accessibilityRole="button"
|
|
329
|
-
accessibilityState={ {
|
|
330
|
-
selected: isSelectedCustom(),
|
|
331
|
-
} }
|
|
332
|
-
accessibilityHint={ accessibilityHint }
|
|
333
|
-
>
|
|
334
|
-
<View style={ customIndicatorWrapperStyle }>
|
|
335
|
-
<ColorIndicator
|
|
336
|
-
withCustomPicker={ ! isGradientSegment }
|
|
337
|
-
color={ customIndicatorColor }
|
|
338
|
-
isSelected={ isSelectedCustom() }
|
|
339
|
-
style={ [
|
|
340
|
-
styles.colorIndicator,
|
|
341
|
-
customColorIndicatorStyles,
|
|
342
|
-
] }
|
|
343
|
-
/>
|
|
344
|
-
{ shouldShowCustomLabel && (
|
|
345
|
-
<Text style={ customTextStyle }>
|
|
346
|
-
{ isIOS
|
|
347
|
-
? customText
|
|
348
|
-
: customText.toUpperCase() }
|
|
349
|
-
</Text>
|
|
350
|
-
) }
|
|
351
|
-
</View>
|
|
352
|
-
</TouchableWithoutFeedback>
|
|
353
|
-
</View>
|
|
354
|
-
) }
|
|
355
|
-
</ScrollView>
|
|
356
|
-
</>
|
|
357
|
-
);
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
export default ColorPalette;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
.contentContainer {
|
|
2
|
-
flex-direction: row;
|
|
3
|
-
padding: 0 $grid-unit-20;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.verticalSeparator {
|
|
7
|
-
border-width: $border-width * 0.5;
|
|
8
|
-
border-color: $light-gray-400;
|
|
9
|
-
height: 38px;
|
|
10
|
-
margin-right: $grid-unit-20 * 0.5;
|
|
11
|
-
align-self: center;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.verticalSeparatorDark {
|
|
15
|
-
border-color: $gray-70;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.colorIndicator {
|
|
19
|
-
margin-top: 12px;
|
|
20
|
-
margin-bottom: 12px;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.customIndicatorWrapper {
|
|
24
|
-
flex-direction: row;
|
|
25
|
-
align-items: center;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.customText {
|
|
29
|
-
font-size: 16px;
|
|
30
|
-
color: $gray-dark;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.customTextDark {
|
|
34
|
-
color: $white;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.customTextAndroid {
|
|
38
|
-
letter-spacing: 1.25;
|
|
39
|
-
font-weight: 500;
|
|
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,88 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { View, Dimensions } from 'react-native';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { useRef } from '@wordpress/element';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Internal dependencies
|
|
13
|
-
*/
|
|
14
|
-
import HuePicker from './hue-picker';
|
|
15
|
-
import SaturationValuePicker from './saturation-picker';
|
|
16
|
-
import styles from './style.native.scss';
|
|
17
|
-
|
|
18
|
-
const HsvColorPicker = ( props ) => {
|
|
19
|
-
const maxWidth = Dimensions.get( 'window' ).width - 32;
|
|
20
|
-
const satValPickerRef = useRef( null );
|
|
21
|
-
|
|
22
|
-
const {
|
|
23
|
-
containerStyle = {},
|
|
24
|
-
currentColor,
|
|
25
|
-
huePickerContainerStyle = {},
|
|
26
|
-
huePickerBorderRadius = 0,
|
|
27
|
-
huePickerHue = 0,
|
|
28
|
-
huePickerBarWidth = maxWidth,
|
|
29
|
-
huePickerBarHeight = 12,
|
|
30
|
-
huePickerSliderSize = 24,
|
|
31
|
-
onHuePickerDragStart,
|
|
32
|
-
onHuePickerDragMove,
|
|
33
|
-
onHuePickerDragEnd,
|
|
34
|
-
onHuePickerDragTerminate,
|
|
35
|
-
onHuePickerPress,
|
|
36
|
-
satValPickerContainerStyle = {},
|
|
37
|
-
satValPickerBorderRadius = 0,
|
|
38
|
-
satValPickerSize = { width: maxWidth, height: 200 },
|
|
39
|
-
satValPickerSliderSize = 24,
|
|
40
|
-
satValPickerHue = 0,
|
|
41
|
-
satValPickerSaturation = 1,
|
|
42
|
-
satValPickerValue = 1,
|
|
43
|
-
onSatValPickerDragStart,
|
|
44
|
-
onSatValPickerDragMove,
|
|
45
|
-
onSatValPickerDragEnd,
|
|
46
|
-
onSatValPickerDragTerminate,
|
|
47
|
-
onSatValPickerPress,
|
|
48
|
-
} = props;
|
|
49
|
-
|
|
50
|
-
return (
|
|
51
|
-
<View
|
|
52
|
-
style={ [ styles[ 'hsv-container' ], containerStyle ] }
|
|
53
|
-
testID="hsv-color-picker"
|
|
54
|
-
>
|
|
55
|
-
<SaturationValuePicker
|
|
56
|
-
containerStyle={ satValPickerContainerStyle }
|
|
57
|
-
currentColor={ currentColor }
|
|
58
|
-
borderRadius={ satValPickerBorderRadius }
|
|
59
|
-
size={ satValPickerSize }
|
|
60
|
-
sliderSize={ satValPickerSliderSize }
|
|
61
|
-
hue={ satValPickerHue }
|
|
62
|
-
saturation={ satValPickerSaturation }
|
|
63
|
-
value={ satValPickerValue }
|
|
64
|
-
onDragStart={ onSatValPickerDragStart }
|
|
65
|
-
onDragMove={ onSatValPickerDragMove }
|
|
66
|
-
onDragEnd={ onSatValPickerDragEnd }
|
|
67
|
-
onDragTerminate={ onSatValPickerDragTerminate }
|
|
68
|
-
onPress={ onSatValPickerPress }
|
|
69
|
-
ref={ satValPickerRef }
|
|
70
|
-
/>
|
|
71
|
-
<HuePicker
|
|
72
|
-
containerStyle={ huePickerContainerStyle }
|
|
73
|
-
borderRadius={ huePickerBorderRadius }
|
|
74
|
-
hue={ huePickerHue }
|
|
75
|
-
barWidth={ huePickerBarWidth }
|
|
76
|
-
barHeight={ huePickerBarHeight }
|
|
77
|
-
sliderSize={ huePickerSliderSize }
|
|
78
|
-
onDragStart={ onHuePickerDragStart }
|
|
79
|
-
onDragMove={ onHuePickerDragMove }
|
|
80
|
-
onDragEnd={ onHuePickerDragEnd }
|
|
81
|
-
onDragTerminate={ onHuePickerDragTerminate }
|
|
82
|
-
onPress={ onHuePickerPress }
|
|
83
|
-
/>
|
|
84
|
-
</View>
|
|
85
|
-
);
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
export default HsvColorPicker;
|