@wordpress/components 35.0.1 → 36.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/CONTRIBUTING.md +33 -26
- 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/angle-picker-control/angle-circle.cjs +1 -1
- package/build/angle-picker-control/angle-circle.cjs.map +2 -2
- package/build/angle-picker-control/index.cjs +2 -2
- package/build/autocomplete/get-autocomplete-match.cjs.map +1 -1
- package/build/autocomplete/index.cjs.map +1 -1
- package/build/base-control/styles/base-control-styles.cjs +6 -6
- package/build/base-control/styles/base-control-styles.cjs.map +2 -2
- package/build/border-control/styles.cjs +17 -14
- package/build/border-control/styles.cjs.map +2 -2
- package/build/box-control/{input-control.cjs → box-input-control.cjs} +9 -9
- package/build/box-control/box-input-control.cjs.map +7 -0
- package/build/box-control/index.cjs +9 -25
- package/build/box-control/index.cjs.map +3 -3
- package/build/button/index.cjs +3 -7
- package/build/button/index.cjs.map +2 -2
- package/build/card/card-divider/hook.cjs.map +2 -2
- package/build/color-palette/index.cjs.map +1 -1
- package/build/color-picker/component.cjs.map +1 -1
- package/build/date-time/utils.cjs.map +1 -1
- package/build/disabled/index.cjs.map +2 -2
- package/build/divider/component.cjs +108 -3
- package/build/divider/component.cjs.map +4 -4
- package/build/draggable/index.cjs.map +1 -1
- package/build/external-link/index.cjs +1 -1
- package/build/external-link/index.cjs.map +1 -1
- package/build/higher-order/with-fallback-styles/index.cjs +18 -44
- package/build/higher-order/with-fallback-styles/index.cjs.map +2 -2
- package/build/menu/popover.cjs.map +1 -1
- package/build/menu/styles.cjs +17 -17
- package/build/menu/styles.cjs.map +2 -2
- package/build/modal/index.cjs.map +1 -1
- package/build/modal/use-modal-exit-animation.cjs +37 -52
- package/build/modal/use-modal-exit-animation.cjs.map +2 -2
- package/build/palette-edit/index.cjs +1 -1
- package/build/progress-bar/index.cjs +1 -1
- package/build/progress-bar/index.cjs.map +2 -2
- package/build/query-controls/index.cjs +2 -2
- package/build/query-controls/index.cjs.map +2 -2
- package/build/range-control/index.cjs.map +1 -1
- package/build/sandbox/index.cjs +7 -1
- package/build/sandbox/index.cjs.map +2 -2
- package/build/snackbar/index.cjs +1 -1
- package/build/spinner/styles.cjs +4 -4
- package/build/spinner/styles.cjs.map +2 -2
- package/build/tabs/index.cjs +0 -18
- package/build/tabs/index.cjs.map +2 -2
- package/build/tabs/tablist.cjs +5 -15
- package/build/tabs/tablist.cjs.map +2 -2
- package/build/text-control/index.cjs +3 -12
- package/build/text-control/index.cjs.map +3 -3
- package/build/tools-panel/styles.cjs +13 -13
- package/build/tools-panel/styles.cjs.map +2 -2
- package/build/tools-panel/tools-panel/hook.cjs.map +1 -1
- package/build/tree-select/index.cjs +1 -1
- package/build/tree-select/index.cjs.map +1 -1
- package/build/truncate/utils.cjs +1 -1
- package/build/truncate/utils.cjs.map +1 -1
- package/build/utils/colors-values.cjs +12 -12
- package/build/utils/colors-values.cjs.map +2 -2
- package/build/utils/config-values.cjs +2 -2
- package/build/utils/config-values.cjs.map +2 -2
- package/build/utils/dropdown-motion.cjs.map +2 -2
- package/build/utils/strings.cjs.map +1 -1
- package/build/validated-form-controls/components/text-control.cjs +0 -1
- package/build/validated-form-controls/components/text-control.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/angle-picker-control/angle-circle.mjs +1 -1
- package/build-module/angle-picker-control/angle-circle.mjs.map +2 -2
- package/build-module/angle-picker-control/index.mjs +2 -2
- package/build-module/autocomplete/get-autocomplete-match.mjs.map +1 -1
- package/build-module/autocomplete/index.mjs.map +1 -1
- package/build-module/base-control/styles/base-control-styles.mjs +6 -6
- package/build-module/base-control/styles/base-control-styles.mjs.map +2 -2
- package/build-module/border-control/styles.mjs +17 -14
- package/build-module/border-control/styles.mjs.map +2 -2
- package/build-module/box-control/{input-control.mjs → box-input-control.mjs} +6 -6
- package/build-module/box-control/box-input-control.mjs.map +7 -0
- package/build-module/box-control/index.mjs +9 -25
- package/build-module/box-control/index.mjs.map +2 -2
- package/build-module/button/index.mjs +2 -5
- package/build-module/button/index.mjs.map +2 -2
- package/build-module/card/card-divider/hook.mjs.map +2 -2
- package/build-module/color-palette/index.mjs.map +1 -1
- package/build-module/color-picker/component.mjs.map +1 -1
- package/build-module/date-time/utils.mjs.map +1 -1
- package/build-module/disabled/index.mjs.map +2 -2
- package/build-module/divider/component.mjs +108 -3
- package/build-module/divider/component.mjs.map +3 -3
- package/build-module/draggable/index.mjs.map +1 -1
- package/build-module/external-link/index.mjs +1 -1
- package/build-module/external-link/index.mjs.map +1 -1
- package/build-module/higher-order/with-fallback-styles/index.mjs +20 -46
- package/build-module/higher-order/with-fallback-styles/index.mjs.map +2 -2
- package/build-module/menu/popover.mjs.map +1 -1
- package/build-module/menu/styles.mjs +17 -17
- package/build-module/menu/styles.mjs.map +2 -2
- package/build-module/modal/index.mjs.map +1 -1
- package/build-module/modal/use-modal-exit-animation.mjs +37 -52
- package/build-module/modal/use-modal-exit-animation.mjs.map +2 -2
- package/build-module/palette-edit/index.mjs +1 -1
- package/build-module/progress-bar/index.mjs +1 -1
- package/build-module/progress-bar/index.mjs.map +2 -2
- package/build-module/query-controls/index.mjs +2 -2
- package/build-module/query-controls/index.mjs.map +2 -2
- package/build-module/range-control/index.mjs.map +1 -1
- package/build-module/sandbox/index.mjs +3 -1
- package/build-module/sandbox/index.mjs.map +2 -2
- package/build-module/snackbar/index.mjs +1 -1
- package/build-module/spinner/styles.mjs +4 -4
- package/build-module/spinner/styles.mjs.map +2 -2
- package/build-module/tabs/index.mjs +1 -19
- package/build-module/tabs/index.mjs.map +2 -2
- package/build-module/tabs/tablist.mjs +5 -15
- package/build-module/tabs/tablist.mjs.map +2 -2
- package/build-module/text-control/index.mjs +3 -12
- package/build-module/text-control/index.mjs.map +2 -2
- package/build-module/tools-panel/styles.mjs +13 -13
- package/build-module/tools-panel/styles.mjs.map +2 -2
- package/build-module/tools-panel/tools-panel/hook.mjs.map +1 -1
- package/build-module/tree-select/index.mjs +1 -1
- package/build-module/tree-select/index.mjs.map +1 -1
- package/build-module/truncate/utils.mjs +1 -1
- package/build-module/truncate/utils.mjs.map +1 -1
- package/build-module/utils/colors-values.mjs +12 -12
- package/build-module/utils/colors-values.mjs.map +2 -2
- package/build-module/utils/config-values.mjs +2 -2
- package/build-module/utils/config-values.mjs.map +2 -2
- package/build-module/utils/dropdown-motion.mjs.map +2 -2
- package/build-module/utils/strings.mjs.map +1 -1
- package/build-module/validated-form-controls/components/text-control.mjs +0 -1
- package/build-module/validated-form-controls/components/text-control.mjs.map +2 -2
- package/build-style/style-rtl.css +85 -101
- package/build-style/style.css +85 -101
- package/build-types/base-control/styles/base-control-styles.d.ts.map +1 -1
- package/build-types/border-control/styles.d.ts.map +1 -1
- package/build-types/box-control/box-input-control.d.ts +3 -0
- package/build-types/box-control/box-input-control.d.ts.map +1 -0
- package/build-types/box-control/index.d.ts +2 -6
- package/build-types/box-control/index.d.ts.map +1 -1
- package/build-types/box-control/stories/index.story.d.ts.map +1 -1
- package/build-types/box-control/types.d.ts +7 -6
- package/build-types/box-control/types.d.ts.map +1 -1
- package/build-types/button/index.d.ts +0 -2
- package/build-types/button/index.d.ts.map +1 -1
- package/build-types/card/card-divider/hook.d.ts +1 -274
- package/build-types/card/card-divider/hook.d.ts.map +1 -1
- package/build-types/composite/stories/index.story.d.ts.map +1 -1
- package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -1
- package/build-types/disabled/index.d.ts +0 -1
- package/build-types/disabled/index.d.ts.map +1 -1
- package/build-types/disabled/stories/index.story.d.ts.map +1 -1
- package/build-types/divider/component.d.ts.map +1 -1
- package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
- package/build-types/higher-order/with-fallback-styles/index.d.ts +1 -35
- package/build-types/higher-order/with-fallback-styles/index.d.ts.map +1 -1
- package/build-types/higher-order/with-fallback-styles/test/index.d.ts.map +1 -0
- package/build-types/icon/stories/index.story.d.ts +0 -1
- package/build-types/icon/stories/index.story.d.ts.map +1 -1
- package/build-types/menu/styles.d.ts.map +1 -1
- package/build-types/menu/types.d.ts +2 -2
- package/build-types/placeholder/stories/index.story.d.ts.map +1 -1
- package/build-types/resizable-box/index.d.ts +0 -2
- package/build-types/resizable-box/index.d.ts.map +1 -1
- package/build-types/resizable-box/stories/index.story.d.ts +0 -2
- package/build-types/resizable-box/stories/index.story.d.ts.map +1 -1
- package/build-types/sandbox/index.d.ts +15 -0
- package/build-types/sandbox/index.d.ts.map +1 -1
- package/build-types/spinner/styles.d.ts.map +1 -1
- package/build-types/tabs/index.d.ts.map +1 -1
- package/build-types/tabs/tablist.d.ts.map +1 -1
- package/build-types/text-control/index.d.ts +0 -1
- package/build-types/text-control/index.d.ts.map +1 -1
- package/build-types/text-control/stories/index.story.d.ts.map +1 -1
- package/build-types/text-control/types.d.ts +2 -1
- package/build-types/text-control/types.d.ts.map +1 -1
- package/build-types/tools-panel/styles.d.ts.map +1 -1
- package/build-types/utils/colors-values.d.ts.map +1 -1
- package/build-types/utils/dropdown-motion.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/text-control.d.ts +2 -2
- package/build-types/validated-form-controls/components/text-control.d.ts.map +1 -1
- package/package.json +34 -28
- package/src/angle-picker-control/angle-circle.tsx +3 -3
- package/src/base-control/README.md +2 -2
- package/src/base-control/styles/base-control-styles.ts +1 -0
- package/src/border-control/styles.ts +1 -0
- package/src/box-control/README.md +1 -13
- package/src/box-control/{input-control.tsx → box-input-control.tsx} +4 -4
- package/src/box-control/index.tsx +5 -23
- package/src/box-control/stories/index.story.tsx +1 -3
- package/src/box-control/test/index.tsx +15 -2
- package/src/box-control/types.ts +7 -6
- package/src/button/index.tsx +2 -4
- package/src/button/style.scss +3 -3
- package/src/card/card-divider/hook.ts +5 -1
- package/src/card/test/__snapshots__/index.tsx.snap +7 -9
- package/src/checkbox-control/test/__snapshots__/index.tsx.snap +4 -3
- package/src/composite/stories/index.story.tsx +5 -0
- package/src/confirm-dialog/stories/index.story.tsx +1 -0
- package/src/custom-select-control/test/index.tsx +1 -1
- package/src/disabled/README.md +0 -1
- package/src/disabled/index.tsx +0 -1
- package/src/disabled/stories/index.story.tsx +0 -1
- package/src/divider/component.tsx +27 -3
- package/src/divider/style.module.scss +21 -0
- package/src/divider/test/index.tsx +21 -11
- package/src/dropdown/stories/index.story.tsx +5 -0
- package/src/dropdown-menu/style.scss +1 -1
- package/src/external-link/style.scss +4 -4
- package/src/form-toggle/style.scss +1 -1
- package/src/heading/test/__snapshots__/index.tsx.snap +4 -4
- package/src/higher-order/with-constrained-tabbing/README.md +0 -2
- package/src/higher-order/with-fallback-styles/index.tsx +31 -61
- package/src/higher-order/with-fallback-styles/test/index.tsx +47 -0
- package/src/higher-order/with-focus-return/README.md +0 -2
- package/src/icon/stories/index.story.tsx +0 -15
- package/src/menu/README.md +2 -2
- package/src/menu/styles.ts +2 -0
- package/src/menu/test/index.tsx +104 -87
- package/src/menu/types.ts +2 -2
- package/src/menu-item/test/__snapshots__/index.js.snap +2 -0
- package/src/modal/style.scss +1 -1
- package/src/modal/test/index.tsx +0 -24
- package/src/modal/use-modal-exit-animation.ts +2 -2
- package/src/navigable-container/test/navigable-menu.tsx +0 -16
- package/src/navigable-container/test/tababble-container.tsx +0 -16
- package/src/navigator/test/index.tsx +0 -24
- package/src/notice/style.scss +11 -13
- package/src/notice/test/__snapshots__/index.tsx.snap +1 -0
- package/src/panel/README.md +2 -0
- package/src/panel/stories/index.story.tsx +2 -2
- package/src/panel/style.scss +1 -1
- package/src/placeholder/stories/index.story.tsx +0 -1
- package/src/radio-control/style.scss +1 -1
- package/src/resizable-box/index.tsx +1 -2
- package/src/sandbox/index.tsx +18 -1
- package/src/sandbox/test/index.tsx +44 -1
- package/src/spinner/styles.ts +1 -0
- package/src/tab-panel/style.scss +6 -6
- package/src/tab-panel/test/index.tsx +0 -17
- package/src/tabs/index.tsx +1 -26
- package/src/tabs/tablist.tsx +5 -21
- package/src/tabs/test/index.tsx +16 -44
- package/src/text/test/__snapshots__/index.tsx.snap +3 -3
- package/src/text-control/README.md +0 -9
- package/src/text-control/index.tsx +3 -14
- package/src/text-control/stories/index.story.tsx +0 -2
- package/src/text-control/style.scss +7 -11
- package/src/text-control/test/text-control.tsx +1 -5
- package/src/text-control/types.ts +2 -1
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +38 -26
- package/src/toolbar/toolbar-group/style.scss +2 -2
- package/src/tools-panel/styles.ts +1 -1
- package/src/tools-panel/tools-panel/README.md +0 -2
- package/src/tooltip/stories/index.story.tsx +2 -2
- package/src/tree-grid/test/index.tsx +0 -23
- package/src/utils/colors-values.js +36 -16
- package/src/utils/config-values.js +2 -2
- package/src/utils/dropdown-motion.ts +6 -4
- package/src/utils/theme-variables.scss +18 -13
- package/src/validated-form-controls/components/text-control.tsx +2 -10
- package/build/box-control/input-control.cjs.map +0 -7
- package/build/divider/styles.cjs +0 -98
- package/build/divider/styles.cjs.map +0 -7
- package/build-module/box-control/input-control.mjs.map +0 -7
- package/build-module/divider/styles.mjs +0 -63
- package/build-module/divider/styles.mjs.map +0 -7
- package/build-types/box-control/input-control.d.ts +0 -3
- package/build-types/box-control/input-control.d.ts.map +0 -1
- package/build-types/card/context.d.ts +0 -3
- package/build-types/card/context.d.ts.map +0 -1
- package/build-types/date-time/date/index.d.ts +0 -23
- package/build-types/date-time/date/index.d.ts.map +0 -1
- package/build-types/date-time/date/styles.d.ts +0 -45
- package/build-types/date-time/date/styles.d.ts.map +0 -1
- package/build-types/date-time/date/test/index.d.ts.map +0 -1
- package/build-types/date-time/date/test/use-lilius.d.ts +0 -2
- package/build-types/date-time/date/test/use-lilius.d.ts.map +0 -1
- package/build-types/date-time/date/use-lilius/index.d.ts +0 -169
- package/build-types/date-time/date/use-lilius/index.d.ts.map +0 -1
- package/build-types/date-time/time/index.d.ts +0 -27
- package/build-types/date-time/time/index.d.ts.map +0 -1
- package/build-types/date-time/time/styles.d.ts +0 -93
- package/build-types/date-time/time/styles.d.ts.map +0 -1
- package/build-types/date-time/time/test/index.d.ts +0 -2
- package/build-types/date-time/time/test/index.d.ts.map +0 -1
- package/build-types/date-time/time/time-input/index.d.ts +0 -4
- package/build-types/date-time/time/time-input/index.d.ts.map +0 -1
- package/build-types/date-time/time/time-input/test/index.d.ts +0 -2
- package/build-types/date-time/time/time-input/test/index.d.ts.map +0 -1
- package/build-types/date-time/time/timezone.d.ts +0 -7
- package/build-types/date-time/time/timezone.d.ts.map +0 -1
- package/build-types/divider/styles.d.ts +0 -10
- package/build-types/divider/styles.d.ts.map +0 -1
- package/build-types/mobile/image/constants.d.ts +0 -5
- package/build-types/mobile/image/constants.d.ts.map +0 -1
- package/build-types/navigation/back-button/index.d.ts +0 -7
- package/build-types/navigation/back-button/index.d.ts.map +0 -1
- package/build-types/navigation/constants.d.ts +0 -3
- package/build-types/navigation/constants.d.ts.map +0 -1
- package/build-types/navigation/context.d.ts +0 -4
- package/build-types/navigation/context.d.ts.map +0 -1
- package/build-types/navigation/group/context.d.ts +0 -7
- package/build-types/navigation/group/context.d.ts.map +0 -1
- package/build-types/navigation/group/index.d.ts +0 -7
- package/build-types/navigation/group/index.d.ts.map +0 -1
- package/build-types/navigation/index.d.ts +0 -46
- package/build-types/navigation/index.d.ts.map +0 -1
- package/build-types/navigation/item/base-content.d.ts +0 -3
- package/build-types/navigation/item/base-content.d.ts.map +0 -1
- package/build-types/navigation/item/base.d.ts +0 -3
- package/build-types/navigation/item/base.d.ts.map +0 -1
- package/build-types/navigation/item/index.d.ts +0 -7
- package/build-types/navigation/item/index.d.ts.map +0 -1
- package/build-types/navigation/item/use-navigation-tree-item.d.ts +0 -3
- package/build-types/navigation/item/use-navigation-tree-item.d.ts.map +0 -1
- package/build-types/navigation/menu/context.d.ts +0 -7
- package/build-types/navigation/menu/context.d.ts.map +0 -1
- package/build-types/navigation/menu/index.d.ts +0 -7
- package/build-types/navigation/menu/index.d.ts.map +0 -1
- package/build-types/navigation/menu/menu-title-search.d.ts +0 -3
- package/build-types/navigation/menu/menu-title-search.d.ts.map +0 -1
- package/build-types/navigation/menu/menu-title.d.ts +0 -3
- package/build-types/navigation/menu/menu-title.d.ts.map +0 -1
- package/build-types/navigation/menu/search-no-results-found.d.ts +0 -3
- package/build-types/navigation/menu/search-no-results-found.d.ts.map +0 -1
- package/build-types/navigation/menu/use-navigation-tree-menu.d.ts +0 -3
- package/build-types/navigation/menu/use-navigation-tree-menu.d.ts.map +0 -1
- package/build-types/navigation/stories/index.story.d.ts +0 -23
- package/build-types/navigation/stories/index.story.d.ts.map +0 -1
- package/build-types/navigation/stories/utils/controlled-state.d.ts +0 -7
- package/build-types/navigation/stories/utils/controlled-state.d.ts.map +0 -1
- package/build-types/navigation/stories/utils/default.d.ts +0 -10
- package/build-types/navigation/stories/utils/default.d.ts.map +0 -1
- package/build-types/navigation/stories/utils/group.d.ts +0 -10
- package/build-types/navigation/stories/utils/group.d.ts.map +0 -1
- package/build-types/navigation/stories/utils/hide-if-empty.d.ts +0 -10
- package/build-types/navigation/stories/utils/hide-if-empty.d.ts.map +0 -1
- package/build-types/navigation/stories/utils/more-examples.d.ts +0 -10
- package/build-types/navigation/stories/utils/more-examples.d.ts.map +0 -1
- package/build-types/navigation/stories/utils/search.d.ts +0 -10
- package/build-types/navigation/stories/utils/search.d.ts.map +0 -1
- package/build-types/navigation/styles/navigation-styles.d.ts +0 -55
- package/build-types/navigation/styles/navigation-styles.d.ts.map +0 -1
- package/build-types/navigation/test/index.d.ts +0 -2
- package/build-types/navigation/test/index.d.ts.map +0 -1
- package/build-types/navigation/types.d.ts +0 -266
- package/build-types/navigation/types.d.ts.map +0 -1
- package/build-types/navigation/use-create-navigation-tree.d.ts +0 -15
- package/build-types/navigation/use-create-navigation-tree.d.ts.map +0 -1
- package/build-types/navigation/use-navigation-tree-nodes.d.ts +0 -10
- package/build-types/navigation/use-navigation-tree-nodes.d.ts.map +0 -1
- package/build-types/navigation/utils.d.ts +0 -3
- package/build-types/navigation/utils.d.ts.map +0 -1
- package/build-types/visually-hidden/test/index.d.ts +0 -2
- package/build-types/visually-hidden/test/index.d.ts.map +0 -1
- package/src/divider/styles.ts +0 -81
- package/src/divider/test/__snapshots__/index.tsx.snap +0 -71
- /package/build-types/{date-time/date → higher-order/with-fallback-styles}/test/index.d.ts +0 -0
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import type { ChangeEvent, ForwardedRef } from 'react';
|
|
5
|
-
import clsx from 'clsx';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* WordPress dependencies
|
|
@@ -16,16 +15,15 @@ import { forwardRef } from '@wordpress/element';
|
|
|
16
15
|
import BaseControl from '../base-control';
|
|
17
16
|
import type { WordPressComponentProps } from '../context';
|
|
18
17
|
import type { TextControlProps } from './types';
|
|
19
|
-
import { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';
|
|
20
18
|
|
|
21
19
|
function UnforwardedTextControl(
|
|
22
20
|
props: WordPressComponentProps< TextControlProps, 'input', false >,
|
|
23
21
|
ref: ForwardedRef< HTMLInputElement >
|
|
24
22
|
) {
|
|
25
23
|
const {
|
|
26
|
-
// Prevent passing
|
|
24
|
+
// Prevent passing legacy props to `input`.
|
|
27
25
|
__nextHasNoMarginBottom: _,
|
|
28
|
-
__next40pxDefaultSize
|
|
26
|
+
__next40pxDefaultSize: __,
|
|
29
27
|
label,
|
|
30
28
|
hideLabelFromVision,
|
|
31
29
|
value,
|
|
@@ -40,12 +38,6 @@ function UnforwardedTextControl(
|
|
|
40
38
|
const onChangeValue = ( event: ChangeEvent< HTMLInputElement > ) =>
|
|
41
39
|
onChange( event.target.value );
|
|
42
40
|
|
|
43
|
-
maybeWarnDeprecated36pxSize( {
|
|
44
|
-
componentName: 'TextControl',
|
|
45
|
-
size: undefined,
|
|
46
|
-
__next40pxDefaultSize,
|
|
47
|
-
} );
|
|
48
|
-
|
|
49
41
|
return (
|
|
50
42
|
<BaseControl
|
|
51
43
|
label={ label }
|
|
@@ -55,9 +47,7 @@ function UnforwardedTextControl(
|
|
|
55
47
|
className={ className }
|
|
56
48
|
>
|
|
57
49
|
<input
|
|
58
|
-
className=
|
|
59
|
-
'is-next-40px-default-size': __next40pxDefaultSize,
|
|
60
|
-
} ) }
|
|
50
|
+
className="components-text-control__input"
|
|
61
51
|
type={ type }
|
|
62
52
|
id={ id }
|
|
63
53
|
value={ value }
|
|
@@ -82,7 +72,6 @@ function UnforwardedTextControl(
|
|
|
82
72
|
*
|
|
83
73
|
* return (
|
|
84
74
|
* <TextControl
|
|
85
|
-
* __next40pxDefaultSize
|
|
86
75
|
* label="Additional CSS Class"
|
|
87
76
|
* value={ className }
|
|
88
77
|
* onChange={ ( value ) => setClassName( value ) }
|
|
@@ -46,7 +46,6 @@ const DefaultTemplate: StoryFn< typeof TextControl > = ( {
|
|
|
46
46
|
|
|
47
47
|
return (
|
|
48
48
|
<TextControl
|
|
49
|
-
__next40pxDefaultSize
|
|
50
49
|
{ ...args }
|
|
51
50
|
value={ value }
|
|
52
51
|
onChange={ ( v ) => {
|
|
@@ -61,7 +60,6 @@ export const Default: StoryFn< typeof TextControl > = DefaultTemplate.bind(
|
|
|
61
60
|
{}
|
|
62
61
|
);
|
|
63
62
|
Default.args = {
|
|
64
|
-
__next40pxDefaultSize: true,
|
|
65
63
|
placeholder: 'Placeholder',
|
|
66
64
|
};
|
|
67
65
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
.components-text-control__input[type="month"],
|
|
19
19
|
.components-text-control__input[type="number"] {
|
|
20
20
|
width: 100%;
|
|
21
|
-
height: $grid-unit-
|
|
21
|
+
height: $grid-unit-50;
|
|
22
22
|
// Override input style margin in WP forms.css.
|
|
23
23
|
margin: 0;
|
|
24
24
|
background: $components-color-background;
|
|
@@ -26,19 +26,15 @@
|
|
|
26
26
|
@include input-control( $components-color-accent );
|
|
27
27
|
border-color: $components-color-border;
|
|
28
28
|
|
|
29
|
+
// Subtract 1px to account for the border, which isn't included on the element
|
|
30
|
+
// on newer components like InputControl, SelectControl, etc.
|
|
31
|
+
// These values should be shared with the `controlPaddingX` in ./utils/config-values.js
|
|
32
|
+
padding-left: $grid-unit-15;
|
|
33
|
+
padding-right: $grid-unit-15;
|
|
34
|
+
|
|
29
35
|
&::placeholder {
|
|
30
36
|
color: $components-color-dark-gray-placeholder;
|
|
31
37
|
}
|
|
32
|
-
|
|
33
|
-
&.is-next-40px-default-size {
|
|
34
|
-
height: $grid-unit-50;
|
|
35
|
-
|
|
36
|
-
// Subtract 1px to account for the border, which isn't included on the element
|
|
37
|
-
// on newer components like InputControl, SelectControl, etc.
|
|
38
|
-
// These values should be shared with the `controlPaddingX` in ./utils/config-values.js
|
|
39
|
-
padding-left: $grid-unit-15;
|
|
40
|
-
padding-right: $grid-unit-15;
|
|
41
|
-
}
|
|
42
38
|
}
|
|
43
39
|
|
|
44
40
|
.components-text-control__input[type="email"],
|
|
@@ -6,11 +6,7 @@ import { render, screen } from '@testing-library/react';
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
const TextControl = ( props: React.ComponentProps< typeof _TextControl > ) => {
|
|
12
|
-
return <_TextControl { ...props } __next40pxDefaultSize />;
|
|
13
|
-
};
|
|
9
|
+
import TextControl from '..';
|
|
14
10
|
|
|
15
11
|
const noop = () => {};
|
|
16
12
|
|
|
@@ -39,7 +39,8 @@ export type TextControlProps = Pick<
|
|
|
39
39
|
/**
|
|
40
40
|
* Start opting into the larger default height that will become the default size in a future version.
|
|
41
41
|
*
|
|
42
|
-
* @
|
|
42
|
+
* @deprecated Default behavior since WordPress 7.1. Prop can be safely removed.
|
|
43
|
+
* @ignore
|
|
43
44
|
*/
|
|
44
45
|
__next40pxDefaultSize?: boolean;
|
|
45
46
|
};
|
|
@@ -28,7 +28,7 @@ exports[`ToggleGroupControl controlled should render correctly with icons 1`] =
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.emotion-6 {
|
|
31
|
-
background: var(--wp-components-color-background, #fff);
|
|
31
|
+
background: var(--wp-components-color-background, var(--wpds-color-background-surface-neutral-strong, #fff));
|
|
32
32
|
border: 1px solid transparent;
|
|
33
33
|
border-radius: 2px;
|
|
34
34
|
display: -webkit-inline-box;
|
|
@@ -62,8 +62,8 @@ exports[`ToggleGroupControl controlled should render correctly with icons 1`] =
|
|
|
62
62
|
content: '';
|
|
63
63
|
position: absolute;
|
|
64
64
|
pointer-events: none;
|
|
65
|
-
background: var(--wp-components-color-gray-100, #
|
|
66
|
-
border: 1px solid var(--wp-components-color-gray-700, #
|
|
65
|
+
background: var(--wp-components-color-gray-100, var(--wpds-color-background-surface-neutral, #fcfcfc));
|
|
66
|
+
border: 1px solid var(--wp-components-color-gray-700, var(--wpds-color-foreground-content-neutral-weak, #707070));
|
|
67
67
|
outline: 2px solid transparent;
|
|
68
68
|
outline-offset: -3px;
|
|
69
69
|
border-radius: 2px;
|
|
@@ -106,7 +106,7 @@ exports[`ToggleGroupControl controlled should render correctly with icons 1`] =
|
|
|
106
106
|
background: transparent;
|
|
107
107
|
border: none;
|
|
108
108
|
border-radius: 1px;
|
|
109
|
-
color: var(--wp-components-color-gray-700, #
|
|
109
|
+
color: var(--wp-components-color-gray-700, var(--wpds-color-foreground-content-neutral-weak, #707070));
|
|
110
110
|
fill: currentColor;
|
|
111
111
|
cursor: pointer;
|
|
112
112
|
display: -webkit-box;
|
|
@@ -134,7 +134,7 @@ exports[`ToggleGroupControl controlled should render correctly with icons 1`] =
|
|
|
134
134
|
aspect-ratio: 1;
|
|
135
135
|
padding-left: 0;
|
|
136
136
|
padding-right: 0;
|
|
137
|
-
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
137
|
+
color: var(--wp-components-color-foreground, var(--wpds-color-foreground-content-neutral, #1e1e1e));
|
|
138
138
|
font-weight: 499;
|
|
139
139
|
}
|
|
140
140
|
|
|
@@ -156,7 +156,7 @@ exports[`ToggleGroupControl controlled should render correctly with icons 1`] =
|
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
.emotion-10:hover:not( [disabled] ):not( [aria-disabled='true'] ) {
|
|
159
|
-
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
159
|
+
color: var(--wp-components-color-foreground, var(--wpds-color-foreground-content-neutral, #1e1e1e));
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
.emotion-11 {
|
|
@@ -180,7 +180,7 @@ exports[`ToggleGroupControl controlled should render correctly with icons 1`] =
|
|
|
180
180
|
background: transparent;
|
|
181
181
|
border: none;
|
|
182
182
|
border-radius: 1px;
|
|
183
|
-
color: var(--wp-components-color-gray-700, #
|
|
183
|
+
color: var(--wp-components-color-gray-700, var(--wpds-color-foreground-content-neutral-weak, #707070));
|
|
184
184
|
fill: currentColor;
|
|
185
185
|
cursor: pointer;
|
|
186
186
|
display: -webkit-box;
|
|
@@ -228,7 +228,7 @@ exports[`ToggleGroupControl controlled should render correctly with icons 1`] =
|
|
|
228
228
|
}
|
|
229
229
|
|
|
230
230
|
.emotion-15:hover:not( [disabled] ):not( [aria-disabled='true'] ) {
|
|
231
|
-
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
231
|
+
color: var(--wp-components-color-foreground, var(--wpds-color-foreground-content-neutral, #1e1e1e));
|
|
232
232
|
}
|
|
233
233
|
|
|
234
234
|
<div>
|
|
@@ -264,6 +264,7 @@ exports[`ToggleGroupControl controlled should render correctly with icons 1`] =
|
|
|
264
264
|
data-wp-c16t="true"
|
|
265
265
|
data-wp-component="ToggleGroupControlOptionBase"
|
|
266
266
|
id="wp-components-base-control-19-40"
|
|
267
|
+
name=":r3e:"
|
|
267
268
|
role="radio"
|
|
268
269
|
type="button"
|
|
269
270
|
value="uppercase"
|
|
@@ -273,6 +274,7 @@ exports[`ToggleGroupControl controlled should render correctly with icons 1`] =
|
|
|
273
274
|
>
|
|
274
275
|
<svg
|
|
275
276
|
aria-hidden="true"
|
|
277
|
+
fill="currentColor"
|
|
276
278
|
focusable="false"
|
|
277
279
|
height="24"
|
|
278
280
|
viewBox="0 0 24 24"
|
|
@@ -297,6 +299,7 @@ exports[`ToggleGroupControl controlled should render correctly with icons 1`] =
|
|
|
297
299
|
data-wp-c16t="true"
|
|
298
300
|
data-wp-component="ToggleGroupControlOptionBase"
|
|
299
301
|
id="wp-components-base-control-19-41"
|
|
302
|
+
name=":r3e:"
|
|
300
303
|
role="radio"
|
|
301
304
|
type="button"
|
|
302
305
|
value="lowercase"
|
|
@@ -306,6 +309,7 @@ exports[`ToggleGroupControl controlled should render correctly with icons 1`] =
|
|
|
306
309
|
>
|
|
307
310
|
<svg
|
|
308
311
|
aria-hidden="true"
|
|
312
|
+
fill="currentColor"
|
|
309
313
|
focusable="false"
|
|
310
314
|
height="24"
|
|
311
315
|
viewBox="0 0 24 24"
|
|
@@ -359,7 +363,7 @@ exports[`ToggleGroupControl controlled should render correctly with text options
|
|
|
359
363
|
}
|
|
360
364
|
|
|
361
365
|
.emotion-6 {
|
|
362
|
-
background: var(--wp-components-color-background, #fff);
|
|
366
|
+
background: var(--wp-components-color-background, var(--wpds-color-background-surface-neutral-strong, #fff));
|
|
363
367
|
border: 1px solid transparent;
|
|
364
368
|
border-radius: 2px;
|
|
365
369
|
display: -webkit-inline-box;
|
|
@@ -393,8 +397,8 @@ exports[`ToggleGroupControl controlled should render correctly with text options
|
|
|
393
397
|
content: '';
|
|
394
398
|
position: absolute;
|
|
395
399
|
pointer-events: none;
|
|
396
|
-
background: var(--wp-components-color-gray-100, #
|
|
397
|
-
border: 1px solid var(--wp-components-color-gray-700, #
|
|
400
|
+
background: var(--wp-components-color-gray-100, var(--wpds-color-background-surface-neutral, #fcfcfc));
|
|
401
|
+
border: 1px solid var(--wp-components-color-gray-700, var(--wpds-color-foreground-content-neutral-weak, #707070));
|
|
398
402
|
outline: 2px solid transparent;
|
|
399
403
|
outline-offset: -3px;
|
|
400
404
|
border-radius: 2px;
|
|
@@ -437,7 +441,7 @@ exports[`ToggleGroupControl controlled should render correctly with text options
|
|
|
437
441
|
background: transparent;
|
|
438
442
|
border: none;
|
|
439
443
|
border-radius: 1px;
|
|
440
|
-
color: var(--wp-components-color-gray-700, #
|
|
444
|
+
color: var(--wp-components-color-gray-700, var(--wpds-color-foreground-content-neutral-weak, #707070));
|
|
441
445
|
fill: currentColor;
|
|
442
446
|
cursor: pointer;
|
|
443
447
|
display: -webkit-box;
|
|
@@ -481,7 +485,7 @@ exports[`ToggleGroupControl controlled should render correctly with text options
|
|
|
481
485
|
}
|
|
482
486
|
|
|
483
487
|
.emotion-10:hover:not( [disabled] ):not( [aria-disabled='true'] ) {
|
|
484
|
-
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
488
|
+
color: var(--wp-components-color-foreground, var(--wpds-color-foreground-content-neutral, #1e1e1e));
|
|
485
489
|
}
|
|
486
490
|
|
|
487
491
|
.emotion-11 {
|
|
@@ -525,6 +529,7 @@ exports[`ToggleGroupControl controlled should render correctly with text options
|
|
|
525
529
|
data-wp-c16t="true"
|
|
526
530
|
data-wp-component="ToggleGroupControlOptionBase"
|
|
527
531
|
id="wp-components-base-control-18-38"
|
|
532
|
+
name=":r37:"
|
|
528
533
|
role="radio"
|
|
529
534
|
type="button"
|
|
530
535
|
value="rigas"
|
|
@@ -547,6 +552,7 @@ exports[`ToggleGroupControl controlled should render correctly with text options
|
|
|
547
552
|
data-wp-c16t="true"
|
|
548
553
|
data-wp-component="ToggleGroupControlOptionBase"
|
|
549
554
|
id="wp-components-base-control-18-39"
|
|
555
|
+
name=":r37:"
|
|
550
556
|
role="radio"
|
|
551
557
|
type="button"
|
|
552
558
|
value="jack"
|
|
@@ -598,7 +604,7 @@ exports[`ToggleGroupControl uncontrolled should render correctly with icons 1`]
|
|
|
598
604
|
}
|
|
599
605
|
|
|
600
606
|
.emotion-6 {
|
|
601
|
-
background: var(--wp-components-color-background, #fff);
|
|
607
|
+
background: var(--wp-components-color-background, var(--wpds-color-background-surface-neutral-strong, #fff));
|
|
602
608
|
border: 1px solid transparent;
|
|
603
609
|
border-radius: 2px;
|
|
604
610
|
display: -webkit-inline-box;
|
|
@@ -632,8 +638,8 @@ exports[`ToggleGroupControl uncontrolled should render correctly with icons 1`]
|
|
|
632
638
|
content: '';
|
|
633
639
|
position: absolute;
|
|
634
640
|
pointer-events: none;
|
|
635
|
-
background: var(--wp-components-color-gray-100, #
|
|
636
|
-
border: 1px solid var(--wp-components-color-gray-700, #
|
|
641
|
+
background: var(--wp-components-color-gray-100, var(--wpds-color-background-surface-neutral, #fcfcfc));
|
|
642
|
+
border: 1px solid var(--wp-components-color-gray-700, var(--wpds-color-foreground-content-neutral-weak, #707070));
|
|
637
643
|
outline: 2px solid transparent;
|
|
638
644
|
outline-offset: -3px;
|
|
639
645
|
border-radius: 2px;
|
|
@@ -676,7 +682,7 @@ exports[`ToggleGroupControl uncontrolled should render correctly with icons 1`]
|
|
|
676
682
|
background: transparent;
|
|
677
683
|
border: none;
|
|
678
684
|
border-radius: 1px;
|
|
679
|
-
color: var(--wp-components-color-gray-700, #
|
|
685
|
+
color: var(--wp-components-color-gray-700, var(--wpds-color-foreground-content-neutral-weak, #707070));
|
|
680
686
|
fill: currentColor;
|
|
681
687
|
cursor: pointer;
|
|
682
688
|
display: -webkit-box;
|
|
@@ -704,7 +710,7 @@ exports[`ToggleGroupControl uncontrolled should render correctly with icons 1`]
|
|
|
704
710
|
aspect-ratio: 1;
|
|
705
711
|
padding-left: 0;
|
|
706
712
|
padding-right: 0;
|
|
707
|
-
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
713
|
+
color: var(--wp-components-color-foreground, var(--wpds-color-foreground-content-neutral, #1e1e1e));
|
|
708
714
|
font-weight: 499;
|
|
709
715
|
}
|
|
710
716
|
|
|
@@ -726,7 +732,7 @@ exports[`ToggleGroupControl uncontrolled should render correctly with icons 1`]
|
|
|
726
732
|
}
|
|
727
733
|
|
|
728
734
|
.emotion-10:hover:not( [disabled] ):not( [aria-disabled='true'] ) {
|
|
729
|
-
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
735
|
+
color: var(--wp-components-color-foreground, var(--wpds-color-foreground-content-neutral, #1e1e1e));
|
|
730
736
|
}
|
|
731
737
|
|
|
732
738
|
.emotion-11 {
|
|
@@ -750,7 +756,7 @@ exports[`ToggleGroupControl uncontrolled should render correctly with icons 1`]
|
|
|
750
756
|
background: transparent;
|
|
751
757
|
border: none;
|
|
752
758
|
border-radius: 1px;
|
|
753
|
-
color: var(--wp-components-color-gray-700, #
|
|
759
|
+
color: var(--wp-components-color-gray-700, var(--wpds-color-foreground-content-neutral-weak, #707070));
|
|
754
760
|
fill: currentColor;
|
|
755
761
|
cursor: pointer;
|
|
756
762
|
display: -webkit-box;
|
|
@@ -798,7 +804,7 @@ exports[`ToggleGroupControl uncontrolled should render correctly with icons 1`]
|
|
|
798
804
|
}
|
|
799
805
|
|
|
800
806
|
.emotion-15:hover:not( [disabled] ):not( [aria-disabled='true'] ) {
|
|
801
|
-
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
807
|
+
color: var(--wp-components-color-foreground, var(--wpds-color-foreground-content-neutral, #1e1e1e));
|
|
802
808
|
}
|
|
803
809
|
|
|
804
810
|
<div>
|
|
@@ -834,6 +840,7 @@ exports[`ToggleGroupControl uncontrolled should render correctly with icons 1`]
|
|
|
834
840
|
data-wp-c16t="true"
|
|
835
841
|
data-wp-component="ToggleGroupControlOptionBase"
|
|
836
842
|
id="wp-components-base-control-1-2"
|
|
843
|
+
name=":r7:"
|
|
837
844
|
role="radio"
|
|
838
845
|
type="button"
|
|
839
846
|
value="uppercase"
|
|
@@ -843,6 +850,7 @@ exports[`ToggleGroupControl uncontrolled should render correctly with icons 1`]
|
|
|
843
850
|
>
|
|
844
851
|
<svg
|
|
845
852
|
aria-hidden="true"
|
|
853
|
+
fill="currentColor"
|
|
846
854
|
focusable="false"
|
|
847
855
|
height="24"
|
|
848
856
|
viewBox="0 0 24 24"
|
|
@@ -867,6 +875,7 @@ exports[`ToggleGroupControl uncontrolled should render correctly with icons 1`]
|
|
|
867
875
|
data-wp-c16t="true"
|
|
868
876
|
data-wp-component="ToggleGroupControlOptionBase"
|
|
869
877
|
id="wp-components-base-control-1-3"
|
|
878
|
+
name=":r7:"
|
|
870
879
|
role="radio"
|
|
871
880
|
type="button"
|
|
872
881
|
value="lowercase"
|
|
@@ -876,6 +885,7 @@ exports[`ToggleGroupControl uncontrolled should render correctly with icons 1`]
|
|
|
876
885
|
>
|
|
877
886
|
<svg
|
|
878
887
|
aria-hidden="true"
|
|
888
|
+
fill="currentColor"
|
|
879
889
|
focusable="false"
|
|
880
890
|
height="24"
|
|
881
891
|
viewBox="0 0 24 24"
|
|
@@ -923,7 +933,7 @@ exports[`ToggleGroupControl uncontrolled should render correctly with text optio
|
|
|
923
933
|
}
|
|
924
934
|
|
|
925
935
|
.emotion-6 {
|
|
926
|
-
background: var(--wp-components-color-background, #fff);
|
|
936
|
+
background: var(--wp-components-color-background, var(--wpds-color-background-surface-neutral-strong, #fff));
|
|
927
937
|
border: 1px solid transparent;
|
|
928
938
|
border-radius: 2px;
|
|
929
939
|
display: -webkit-inline-box;
|
|
@@ -957,8 +967,8 @@ exports[`ToggleGroupControl uncontrolled should render correctly with text optio
|
|
|
957
967
|
content: '';
|
|
958
968
|
position: absolute;
|
|
959
969
|
pointer-events: none;
|
|
960
|
-
background: var(--wp-components-color-gray-100, #
|
|
961
|
-
border: 1px solid var(--wp-components-color-gray-700, #
|
|
970
|
+
background: var(--wp-components-color-gray-100, var(--wpds-color-background-surface-neutral, #fcfcfc));
|
|
971
|
+
border: 1px solid var(--wp-components-color-gray-700, var(--wpds-color-foreground-content-neutral-weak, #707070));
|
|
962
972
|
outline: 2px solid transparent;
|
|
963
973
|
outline-offset: -3px;
|
|
964
974
|
border-radius: 2px;
|
|
@@ -1001,7 +1011,7 @@ exports[`ToggleGroupControl uncontrolled should render correctly with text optio
|
|
|
1001
1011
|
background: transparent;
|
|
1002
1012
|
border: none;
|
|
1003
1013
|
border-radius: 1px;
|
|
1004
|
-
color: var(--wp-components-color-gray-700, #
|
|
1014
|
+
color: var(--wp-components-color-gray-700, var(--wpds-color-foreground-content-neutral-weak, #707070));
|
|
1005
1015
|
fill: currentColor;
|
|
1006
1016
|
cursor: pointer;
|
|
1007
1017
|
display: -webkit-box;
|
|
@@ -1045,7 +1055,7 @@ exports[`ToggleGroupControl uncontrolled should render correctly with text optio
|
|
|
1045
1055
|
}
|
|
1046
1056
|
|
|
1047
1057
|
.emotion-10:hover:not( [disabled] ):not( [aria-disabled='true'] ) {
|
|
1048
|
-
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
1058
|
+
color: var(--wp-components-color-foreground, var(--wpds-color-foreground-content-neutral, #1e1e1e));
|
|
1049
1059
|
}
|
|
1050
1060
|
|
|
1051
1061
|
.emotion-11 {
|
|
@@ -1089,6 +1099,7 @@ exports[`ToggleGroupControl uncontrolled should render correctly with text optio
|
|
|
1089
1099
|
data-wp-c16t="true"
|
|
1090
1100
|
data-wp-component="ToggleGroupControlOptionBase"
|
|
1091
1101
|
id="wp-components-base-control-0-0"
|
|
1102
|
+
name=":r0:"
|
|
1092
1103
|
role="radio"
|
|
1093
1104
|
type="button"
|
|
1094
1105
|
value="rigas"
|
|
@@ -1111,6 +1122,7 @@ exports[`ToggleGroupControl uncontrolled should render correctly with text optio
|
|
|
1111
1122
|
data-wp-c16t="true"
|
|
1112
1123
|
data-wp-component="ToggleGroupControlOptionBase"
|
|
1113
1124
|
id="wp-components-base-control-0-1"
|
|
1125
|
+
name=":r0:"
|
|
1114
1126
|
role="radio"
|
|
1115
1127
|
type="button"
|
|
1116
1128
|
value="jack"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
padding-right: $grid-unit-15 * 0.5;
|
|
31
31
|
|
|
32
32
|
svg {
|
|
33
|
-
min-width:
|
|
33
|
+
min-width: var(--wpds-dimension-size-sm); // This is the optimal icon size, and we size the whole button after this.
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
&::before {
|
|
@@ -75,7 +75,7 @@ div.components-toolbar {
|
|
|
75
75
|
display: inline-block;
|
|
76
76
|
content: "";
|
|
77
77
|
box-sizing: content-box;
|
|
78
|
-
background-color:
|
|
78
|
+
background-color: var(--wpds-color-stroke-surface-neutral);
|
|
79
79
|
position: absolute;
|
|
80
80
|
top: 8px;
|
|
81
81
|
left: -3px;
|
|
@@ -30,10 +30,10 @@ const toolsPanelGrid = {
|
|
|
30
30
|
},
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
+
// TODO: should use the `stroke-surface-neutral` WPDS token when refactored to SCSS modules
|
|
33
34
|
export const ToolsPanel = ( columns: number ) => css`
|
|
34
35
|
${ toolsPanelGrid.columns( columns ) }
|
|
35
36
|
${ toolsPanelGrid.spacing }
|
|
36
|
-
|
|
37
37
|
border-top: ${ CONFIG.borderWidth } solid ${ COLORS.gray[ 300 ] };
|
|
38
38
|
margin-top: -1px;
|
|
39
39
|
padding: ${ space( 4 ) };
|
|
@@ -126,7 +126,6 @@ export function DimensionPanel() {
|
|
|
126
126
|
onDeselect={ () => setPadding( undefined ) }
|
|
127
127
|
>
|
|
128
128
|
<BoxControl
|
|
129
|
-
__next40pxDefaultSize
|
|
130
129
|
label={ __( 'Padding' ) }
|
|
131
130
|
onChange={ setPadding }
|
|
132
131
|
values={ padding }
|
|
@@ -139,7 +138,6 @@ export function DimensionPanel() {
|
|
|
139
138
|
onDeselect={ () => setMargin( undefined ) }
|
|
140
139
|
>
|
|
141
140
|
<BoxControl
|
|
142
|
-
__next40pxDefaultSize
|
|
143
141
|
label={ __( 'Margin' ) }
|
|
144
142
|
onChange={ setMargin }
|
|
145
143
|
values={ margin }
|
|
@@ -15,7 +15,6 @@ import Tooltip from '..';
|
|
|
15
15
|
import Button from '../../button';
|
|
16
16
|
|
|
17
17
|
const meta: Meta< typeof Tooltip > = {
|
|
18
|
-
tags: [ 'manifest' ],
|
|
19
18
|
title: 'Components/Overlays/Tooltip',
|
|
20
19
|
id: 'components-tooltip',
|
|
21
20
|
component: Tooltip,
|
|
@@ -38,8 +37,9 @@ const meta: Meta< typeof Tooltip > = {
|
|
|
38
37
|
controls: { expanded: true },
|
|
39
38
|
docs: { canvas: { sourceState: 'shown' } },
|
|
40
39
|
componentStatus: {
|
|
41
|
-
status: 'recommended',
|
|
40
|
+
status: 'not-recommended',
|
|
42
41
|
whereUsed: 'global',
|
|
42
|
+
notes: 'Use `Tooltip` from `@wordpress/ui` instead.',
|
|
43
43
|
},
|
|
44
44
|
},
|
|
45
45
|
};
|
|
@@ -24,29 +24,6 @@ const TestButton = forwardRef(
|
|
|
24
24
|
);
|
|
25
25
|
|
|
26
26
|
describe( 'TreeGrid', () => {
|
|
27
|
-
const originalGetClientRects = window.Element.prototype.getClientRects;
|
|
28
|
-
|
|
29
|
-
// `getClientRects` needs to be mocked so that `isVisible` from the `@wordpress/dom`
|
|
30
|
-
// `focusable` module can pass, in a JSDOM env where the DOM elements have no width/height.
|
|
31
|
-
const mockedGetClientRects = jest.fn( () => [
|
|
32
|
-
{
|
|
33
|
-
x: 0,
|
|
34
|
-
y: 0,
|
|
35
|
-
width: 100,
|
|
36
|
-
height: 100,
|
|
37
|
-
},
|
|
38
|
-
] );
|
|
39
|
-
|
|
40
|
-
beforeAll( () => {
|
|
41
|
-
// @ts-expect-error - This is just a mock
|
|
42
|
-
window.Element.prototype.getClientRects =
|
|
43
|
-
jest.fn( mockedGetClientRects );
|
|
44
|
-
} );
|
|
45
|
-
|
|
46
|
-
afterAll( () => {
|
|
47
|
-
window.Element.prototype.getClientRects = originalGetClientRects;
|
|
48
|
-
} );
|
|
49
|
-
|
|
50
27
|
describe( 'simple rendering', () => {
|
|
51
28
|
it( 'renders a table, tbody and any child elements', () => {
|
|
52
29
|
const { container } = render(
|
|
@@ -1,6 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/* eslint-disable @wordpress/no-ds-tokens -- This file is the JS counterpart of
|
|
2
|
+
theme-variables.scss and the package's single mapping to the design system.
|
|
3
|
+
The rule guards against bare `--wpds-*` references, which the build can't
|
|
4
|
+
inject fallbacks into for Emotion/JS files; here every reference carries an
|
|
5
|
+
explicit fallback, so that concern doesn't apply.
|
|
6
|
+
|
|
7
|
+
IMPORTANT: because this file's source contains `--wpds-` text, the
|
|
8
|
+
design-system fallback build plugin claims it (it matches any file whose
|
|
9
|
+
source includes `--wpds-`, comments included) and, in doing so, displaces
|
|
10
|
+
the Emotion transform for this file. That is harmless ONLY because this file
|
|
11
|
+
holds plain value constants and no Emotion `css`/styled component selectors.
|
|
12
|
+
Do not add any here: a co-located component selector would silently fail to
|
|
13
|
+
compile and break the build, with no lint signal (see #79245). Keep this
|
|
14
|
+
file selector-free — define styles elsewhere and consume these constants. */
|
|
15
|
+
|
|
4
16
|
const white = '#fff';
|
|
5
17
|
|
|
6
18
|
// Matches the grays in @wordpress/base-styles
|
|
@@ -27,33 +39,41 @@ const ALERT = {
|
|
|
27
39
|
green: '#4ab866',
|
|
28
40
|
};
|
|
29
41
|
|
|
30
|
-
// Should match packages/components/src/utils/theme-variables.scss
|
|
42
|
+
// Should match packages/components/src/utils/theme-variables.scss.
|
|
43
|
+
//
|
|
44
|
+
// Mirrors the Sass structure: each non-accent value resolves through a design
|
|
45
|
+
// system (`--wpds-*`) token, then a hardcoded fallback. The hardcoded values
|
|
46
|
+
// match what the design-system fallback plugin injects into the Sass version,
|
|
47
|
+
// so JS behaves consistently with the Sass variables. Keep both the token
|
|
48
|
+
// references and the fallbacks in sync with the Sass version.
|
|
31
49
|
const THEME = {
|
|
32
50
|
accent: `var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9))`,
|
|
33
51
|
accentDarker10: `var(--wp-components-color-accent-darker-10, var(--wp-admin-theme-color-darker-10, #2145e6))`,
|
|
34
52
|
accentDarker20: `var(--wp-components-color-accent-darker-20, var(--wp-admin-theme-color-darker-20, #183ad6))`,
|
|
35
53
|
/** Used when placing text on the accent color. */
|
|
36
|
-
accentInverted: `var(--wp-components-color-accent-inverted,
|
|
54
|
+
accentInverted: `var(--wp-components-color-accent-inverted, var(--wpds-color-foreground-interactive-brand-strong, #fff))`,
|
|
37
55
|
|
|
38
|
-
background: `var(--wp-components-color-background,
|
|
56
|
+
background: `var(--wp-components-color-background, var(--wpds-color-background-surface-neutral-strong, #fff))`,
|
|
39
57
|
|
|
40
|
-
foreground: `var(--wp-components-color-foreground,
|
|
58
|
+
foreground: `var(--wp-components-color-foreground, var(--wpds-color-foreground-content-neutral, #1e1e1e))`,
|
|
41
59
|
/** Used when placing text on the foreground color. */
|
|
42
|
-
foregroundInverted: `var(--wp-components-color-foreground-inverted,
|
|
60
|
+
foregroundInverted: `var(--wp-components-color-foreground-inverted, var(--wpds-color-background-surface-neutral, #fcfcfc))`,
|
|
43
61
|
|
|
44
62
|
gray: {
|
|
45
63
|
/** @deprecated Use `COLORS.theme.foreground` instead. */
|
|
46
|
-
900: `var(--wp-components-color-foreground,
|
|
47
|
-
800: `var(--wp-components-color-gray-800,
|
|
48
|
-
700: `var(--wp-components-color-gray-700,
|
|
49
|
-
600: `var(--wp-components-color-gray-600,
|
|
50
|
-
400: `var(--wp-components-color-gray-400,
|
|
51
|
-
300: `var(--wp-components-color-gray-300,
|
|
52
|
-
200: `var(--wp-components-color-gray-200,
|
|
53
|
-
100: `var(--wp-components-color-gray-100,
|
|
64
|
+
900: `var(--wp-components-color-foreground, var(--wpds-color-foreground-content-neutral, #1e1e1e))`,
|
|
65
|
+
800: `var(--wp-components-color-gray-800, var(--wpds-color-foreground-content-neutral, #1e1e1e))`,
|
|
66
|
+
700: `var(--wp-components-color-gray-700, var(--wpds-color-foreground-content-neutral-weak, #707070))`,
|
|
67
|
+
600: `var(--wp-components-color-gray-600, var(--wpds-color-stroke-interactive-neutral, #8d8d8d))`,
|
|
68
|
+
400: `var(--wp-components-color-gray-400, var(--wpds-color-stroke-interactive-neutral, #8d8d8d))`,
|
|
69
|
+
300: `var(--wp-components-color-gray-300, var(--wpds-color-stroke-surface-neutral, #dbdbdb))`,
|
|
70
|
+
200: `var(--wp-components-color-gray-200, var(--wpds-color-stroke-surface-neutral, #dbdbdb))`,
|
|
71
|
+
100: `var(--wp-components-color-gray-100, var(--wpds-color-background-surface-neutral, #fcfcfc))`,
|
|
54
72
|
},
|
|
55
73
|
};
|
|
56
74
|
|
|
75
|
+
/* eslint-enable @wordpress/no-ds-tokens */
|
|
76
|
+
|
|
57
77
|
const UI = {
|
|
58
78
|
background: THEME.background,
|
|
59
79
|
backgroundDisabled: THEME.gray[ 100 ],
|
|
@@ -66,8 +66,8 @@ export default Object.assign( {}, CONTROL_PROPS, {
|
|
|
66
66
|
surfaceBackgroundTertiaryColor: COLORS.white,
|
|
67
67
|
surfaceColor: COLORS.white,
|
|
68
68
|
// Modal exit animation: `use-modal-exit-animation` parses this for the
|
|
69
|
-
// `animationend` timeout race; keep the numeric duration equal to
|
|
70
|
-
//
|
|
69
|
+
// `animationend` timeout race; keep the numeric duration equal to the WPDS
|
|
70
|
+
// `motion-duration-md` token on `.components-modal__frame` in modal/style.scss.
|
|
71
71
|
transitionDuration: '200ms',
|
|
72
72
|
transitionDurationFast: '160ms',
|
|
73
73
|
transitionDurationFaster: '120ms',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Motion configuration for dropdown-like popovers.
|
|
2
2
|
// Keep constants in sync with: packages/ui/src/utils/css/dropdown-motion.module.css
|
|
3
|
-
// Values should stay in sync with
|
|
3
|
+
// Values should stay in sync with the WPDS motion design tokens.
|
|
4
4
|
|
|
5
5
|
export const DROPDOWN_MOTION = Object.freeze( {
|
|
6
6
|
SLIDE_DISTANCE: 4,
|
|
@@ -25,9 +25,11 @@ const convertEasingToString = ( easing: {
|
|
|
25
25
|
return easing.function;
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
// Note:
|
|
29
|
-
// fallback injection is
|
|
30
|
-
//
|
|
28
|
+
// Note: WPDS design tokens can't be referenced here directly. The build-time
|
|
29
|
+
// fallback injection is incompatible with Emotion, and even mentioning a token's
|
|
30
|
+
// full CSS custom property name in this file makes the esbuild fallback plugin
|
|
31
|
+
// claim it and break the Emotion transform. This file is consumed by Menu's
|
|
32
|
+
// Emotion styles.
|
|
31
33
|
export const DROPDOWN_MOTION_CSS = Object.freeze( {
|
|
32
34
|
SLIDE_DISTANCE: `${ DROPDOWN_MOTION.SLIDE_DISTANCE }px`,
|
|
33
35
|
SLIDE_DURATION: `${ DROPDOWN_MOTION.SLIDE_DURATION }ms`,
|