@wordpress/components 29.1.1 → 29.3.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 +29 -6
- package/CONTRIBUTING.md +4 -4
- package/README.md +1 -1
- package/build/badge/index.js +26 -22
- package/build/badge/index.js.map +1 -1
- package/build/border-box-control/border-box-control-linked-button/component.js +8 -15
- package/build/border-box-control/border-box-control-linked-button/component.js.map +1 -1
- package/build/box-control/index.js +6 -0
- package/build/box-control/index.js.map +1 -1
- package/build/box-control/linked-button.js +7 -11
- package/build/box-control/linked-button.js.map +1 -1
- package/build/box-control/types.js.map +1 -1
- package/build/circular-option-picker/circular-option-picker-option.js +9 -7
- package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
- package/build/circular-option-picker/circular-option-picker.js +0 -1
- package/build/circular-option-picker/circular-option-picker.js.map +1 -1
- package/build/color-palette/index.js +1 -6
- package/build/color-palette/index.js.map +1 -1
- package/build/font-size-picker/index.native.js +1 -1
- package/build/font-size-picker/index.native.js.map +1 -1
- package/build/higher-order/with-focus-return/index.js +1 -1
- package/build/higher-order/with-focus-return/index.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +22 -22
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/menu/checkbox-item.js +6 -6
- package/build/menu/checkbox-item.js.map +1 -1
- package/build/menu/context.js +2 -2
- package/build/menu/context.js.map +1 -1
- package/build/menu/group-label.js +4 -4
- package/build/menu/group-label.js.map +1 -1
- package/build/menu/group.js +4 -4
- package/build/menu/group.js.map +1 -1
- package/build/menu/index.js +87 -14
- package/build/menu/index.js.map +1 -1
- package/build/menu/item-help-text.js +4 -4
- package/build/menu/item-help-text.js.map +1 -1
- package/build/menu/item-label.js +4 -4
- package/build/menu/item-label.js.map +1 -1
- package/build/menu/item.js +6 -6
- package/build/menu/item.js.map +1 -1
- package/build/menu/popover.js +5 -5
- package/build/menu/popover.js.map +1 -1
- package/build/menu/radio-item.js +6 -6
- package/build/menu/radio-item.js.map +1 -1
- package/build/menu/separator.js +4 -4
- package/build/menu/separator.js.map +1 -1
- package/build/menu/styles.js +41 -41
- package/build/menu/styles.js.map +1 -1
- package/build/menu/submenu-trigger-item.js +5 -5
- package/build/menu/submenu-trigger-item.js.map +1 -1
- package/build/menu/trigger-button.js +3 -3
- package/build/menu/trigger-button.js.map +1 -1
- package/build/menu/types.js.map +1 -1
- package/build/mobile/bottom-sheet/nav-bar/action-button.native.js +1 -1
- package/build/mobile/bottom-sheet/nav-bar/action-button.native.js.map +1 -1
- package/build/mobile/utils/get-px-from-css-unit.native.js +3 -3
- package/build/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
- package/build/notice/types.js.map +1 -1
- package/build/search-control/index.js +1 -1
- package/build/search-control/index.js.map +1 -1
- package/build/text/hook.js +8 -6
- package/build/text/hook.js.map +1 -1
- package/build/text/utils.js +1 -1
- package/build/text/utils.js.map +1 -1
- package/build-module/badge/index.js +28 -22
- package/build-module/badge/index.js.map +1 -1
- package/build-module/border-box-control/border-box-control-linked-button/component.js +8 -15
- package/build-module/border-box-control/border-box-control-linked-button/component.js.map +1 -1
- package/build-module/box-control/index.js +6 -0
- package/build-module/box-control/index.js.map +1 -1
- package/build-module/box-control/linked-button.js +7 -11
- package/build-module/box-control/linked-button.js.map +1 -1
- package/build-module/box-control/types.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker-option.js +9 -7
- package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker.js +0 -1
- package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
- package/build-module/color-palette/index.js +1 -6
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/font-size-picker/index.native.js +1 -1
- package/build-module/font-size-picker/index.native.js.map +1 -1
- package/build-module/higher-order/with-focus-return/index.js +1 -1
- package/build-module/higher-order/with-focus-return/index.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +22 -22
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/menu/checkbox-item.js +6 -6
- package/build-module/menu/checkbox-item.js.map +1 -1
- package/build-module/menu/context.js +1 -1
- package/build-module/menu/context.js.map +1 -1
- package/build-module/menu/group-label.js +4 -4
- package/build-module/menu/group-label.js.map +1 -1
- package/build-module/menu/group.js +4 -4
- package/build-module/menu/group.js.map +1 -1
- package/build-module/menu/index.js +99 -26
- package/build-module/menu/index.js.map +1 -1
- package/build-module/menu/item-help-text.js +4 -4
- package/build-module/menu/item-help-text.js.map +1 -1
- package/build-module/menu/item-label.js +4 -4
- package/build-module/menu/item-label.js.map +1 -1
- package/build-module/menu/item.js +6 -6
- package/build-module/menu/item.js.map +1 -1
- package/build-module/menu/popover.js +5 -5
- package/build-module/menu/popover.js.map +1 -1
- package/build-module/menu/radio-item.js +6 -6
- package/build-module/menu/radio-item.js.map +1 -1
- package/build-module/menu/separator.js +4 -4
- package/build-module/menu/separator.js.map +1 -1
- package/build-module/menu/styles.js +40 -40
- package/build-module/menu/styles.js.map +1 -1
- package/build-module/menu/submenu-trigger-item.js +6 -6
- package/build-module/menu/submenu-trigger-item.js.map +1 -1
- package/build-module/menu/trigger-button.js +3 -3
- package/build-module/menu/trigger-button.js.map +1 -1
- package/build-module/menu/types.js.map +1 -1
- package/build-module/mobile/bottom-sheet/nav-bar/action-button.native.js +1 -1
- package/build-module/mobile/bottom-sheet/nav-bar/action-button.native.js.map +1 -1
- package/build-module/mobile/utils/get-px-from-css-unit.native.js +3 -3
- package/build-module/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
- package/build-module/notice/types.js.map +1 -1
- package/build-module/search-control/index.js +1 -1
- package/build-module/search-control/index.js.map +1 -1
- package/build-module/text/hook.js +8 -6
- package/build-module/text/hook.js.map +1 -1
- package/build-module/text/utils.js +1 -1
- package/build-module/text/utils.js.map +1 -1
- package/build-style/style-rtl.css +89 -170
- package/build-style/style.css +89 -170
- package/build-types/badge/index.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-linked-button/component.d.ts.map +1 -1
- package/build-types/box-control/index.d.ts.map +1 -1
- package/build-types/box-control/linked-button.d.ts.map +1 -1
- package/build-types/box-control/stories/index.story.d.ts +7 -2331
- package/build-types/box-control/stories/index.story.d.ts.map +1 -1
- package/build-types/box-control/types.d.ts +15 -3
- package/build-types/box-control/types.d.ts.map +1 -1
- package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
- package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
- package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/color-palette/index.d.ts.map +1 -1
- package/build-types/higher-order/with-focus-return/index.d.ts +1 -1
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/menu/checkbox-item.d.ts +2 -2
- package/build-types/menu/checkbox-item.d.ts.map +1 -1
- package/build-types/menu/context.d.ts +2 -2
- package/build-types/menu/context.d.ts.map +1 -1
- package/build-types/menu/group-label.d.ts +2 -2
- package/build-types/menu/group-label.d.ts.map +1 -1
- package/build-types/menu/group.d.ts +2 -2
- package/build-types/menu/group.d.ts.map +1 -1
- package/build-types/menu/index.d.ts +84 -12
- package/build-types/menu/index.d.ts.map +1 -1
- package/build-types/menu/item-help-text.d.ts +1 -1
- package/build-types/menu/item-help-text.d.ts.map +1 -1
- package/build-types/menu/item-label.d.ts +1 -1
- package/build-types/menu/item-label.d.ts.map +1 -1
- package/build-types/menu/item.d.ts +2 -2
- package/build-types/menu/item.d.ts.map +1 -1
- package/build-types/menu/popover.d.ts +2 -2
- package/build-types/menu/popover.d.ts.map +1 -1
- package/build-types/menu/radio-item.d.ts +2 -2
- package/build-types/menu/radio-item.d.ts.map +1 -1
- package/build-types/menu/separator.d.ts +2 -2
- package/build-types/menu/separator.d.ts.map +1 -1
- package/build-types/menu/styles.d.ts +15 -15
- package/build-types/menu/styles.d.ts.map +1 -1
- package/build-types/menu/submenu-trigger-item.d.ts +2 -2
- package/build-types/menu/submenu-trigger-item.d.ts.map +1 -1
- package/build-types/menu/trigger-button.d.ts +2 -2
- package/build-types/menu/trigger-button.d.ts.map +1 -1
- package/build-types/menu/types.d.ts +10 -10
- package/build-types/menu/types.d.ts.map +1 -1
- package/build-types/menu-group/stories/index.story.d.ts +1 -1
- package/build-types/notice/types.d.ts +1 -1
- package/build-types/progress-bar/stories/index.story.d.ts +1 -1
- package/build-types/tabs/stories/index.story.d.ts +0 -3
- package/build-types/tabs/stories/index.story.d.ts.map +1 -1
- package/build-types/text/hook.d.ts.map +1 -1
- package/build-types/text/utils.d.ts +1 -1
- package/package.json +19 -19
- package/src/animate/style.scss +16 -12
- package/src/badge/index.tsx +28 -27
- package/src/border-box-control/border-box-control-linked-button/component.tsx +9 -14
- package/src/border-control/test/index.js +12 -4
- package/src/box-control/index.tsx +9 -0
- package/src/box-control/linked-button.tsx +8 -11
- package/src/box-control/test/index.tsx +9 -2
- package/src/box-control/types.ts +26 -11
- package/src/button/style.scss +15 -12
- package/src/checkbox-control/style.scss +4 -2
- package/src/circular-option-picker/README.md +1 -2
- package/src/circular-option-picker/circular-option-picker-option.tsx +17 -10
- package/src/circular-option-picker/circular-option-picker.tsx +0 -1
- package/src/circular-option-picker/stories/index.story.tsx +0 -1
- package/src/circular-option-picker/style.scss +10 -5
- package/src/color-palette/index.tsx +0 -7
- package/src/color-palette/test/index.tsx +2 -8
- package/src/combobox-control/test/index.tsx +1 -1
- package/src/drop-zone/style.scss +6 -9
- package/src/font-size-picker/index.native.js +1 -1
- package/src/form-toggle/style.scss +17 -10
- package/src/form-token-field/style.scss +9 -4
- package/src/higher-order/navigate-regions/style.scss +2 -2
- package/src/higher-order/with-focus-return/index.tsx +1 -1
- package/src/input-control/styles/input-control-styles.tsx +6 -0
- package/src/menu/README.md +421 -174
- package/src/menu/checkbox-item.tsx +12 -12
- package/src/menu/context.tsx +2 -4
- package/src/menu/docs-manifest.json +62 -0
- package/src/menu/group-label.tsx +7 -7
- package/src/menu/group.tsx +7 -11
- package/src/menu/index.tsx +101 -31
- package/src/menu/item-help-text.tsx +5 -7
- package/src/menu/item-label.tsx +5 -7
- package/src/menu/item.tsx +12 -12
- package/src/menu/popover.tsx +9 -9
- package/src/menu/radio-item.tsx +12 -12
- package/src/menu/separator.tsx +7 -7
- package/src/menu/stories/best-practices.mdx +38 -0
- package/src/menu/stories/index.story.tsx +8 -8
- package/src/menu/styles.ts +24 -24
- package/src/menu/submenu-trigger-item.tsx +9 -9
- package/src/menu/trigger-button.tsx +6 -6
- package/src/menu/types.ts +10 -10
- package/src/menu-group/stories/index.story.tsx +2 -2
- package/src/mobile/bottom-sheet/nav-bar/action-button.native.js +1 -1
- package/src/mobile/utils/get-px-from-css-unit.native.js +3 -3
- package/src/modal/style.scss +4 -2
- package/src/modal/test/index.tsx +5 -4
- package/src/notice/README.md +3 -3
- package/src/notice/types.ts +1 -1
- package/src/palette-edit/test/index.tsx +1 -1
- package/src/panel/style.scss +14 -6
- package/src/placeholder/style.scss +5 -3
- package/src/progress-bar/stories/index.story.tsx +1 -1
- package/src/resizable-box/style.scss +14 -9
- package/src/search-control/index.tsx +1 -1
- package/src/tab-panel/style.scss +6 -4
- package/src/tabs/stories/index.story.tsx +0 -131
- package/src/text/README.md +1 -1
- package/src/text/hook.ts +3 -2
- package/src/text/stories/index.story.tsx +2 -2
- package/src/text/test/index.tsx +1 -1
- package/src/text/utils.ts +1 -1
- package/src/text-highlight/test/index.tsx +3 -3
- package/src/toolbar/toolbar/style.scss +4 -3
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -17,7 +17,6 @@ import { Icon, check } from '@wordpress/icons';
|
|
|
17
17
|
import { CircularOptionPickerContext } from './circular-option-picker-context';
|
|
18
18
|
import Button from '../button';
|
|
19
19
|
import { Composite } from '../composite';
|
|
20
|
-
import Tooltip from '../tooltip';
|
|
21
20
|
import type { OptionProps } from './types';
|
|
22
21
|
|
|
23
22
|
function UnforwardedOptionAsButton(
|
|
@@ -25,15 +24,17 @@ function UnforwardedOptionAsButton(
|
|
|
25
24
|
id?: string;
|
|
26
25
|
className?: string;
|
|
27
26
|
isPressed?: boolean;
|
|
27
|
+
label?: string;
|
|
28
28
|
},
|
|
29
29
|
forwardedRef: ForwardedRef< any >
|
|
30
30
|
) {
|
|
31
|
-
const { isPressed, ...additionalProps } = props;
|
|
31
|
+
const { isPressed, label, ...additionalProps } = props;
|
|
32
32
|
return (
|
|
33
33
|
<Button
|
|
34
34
|
{ ...additionalProps }
|
|
35
35
|
aria-pressed={ isPressed }
|
|
36
36
|
ref={ forwardedRef }
|
|
37
|
+
label={ label }
|
|
37
38
|
/>
|
|
38
39
|
);
|
|
39
40
|
}
|
|
@@ -45,10 +46,11 @@ function UnforwardedOptionAsOption(
|
|
|
45
46
|
id: string;
|
|
46
47
|
className?: string;
|
|
47
48
|
isSelected?: boolean;
|
|
49
|
+
label?: string;
|
|
48
50
|
},
|
|
49
51
|
forwardedRef: ForwardedRef< any >
|
|
50
52
|
) {
|
|
51
|
-
const { id, isSelected, ...additionalProps } = props;
|
|
53
|
+
const { id, isSelected, label, ...additionalProps } = props;
|
|
52
54
|
|
|
53
55
|
const { setActiveId, activeId } = useContext( CircularOptionPickerContext );
|
|
54
56
|
|
|
@@ -69,6 +71,7 @@ function UnforwardedOptionAsOption(
|
|
|
69
71
|
role="option"
|
|
70
72
|
aria-selected={ !! isSelected }
|
|
71
73
|
ref={ forwardedRef }
|
|
74
|
+
label={ label }
|
|
72
75
|
/>
|
|
73
76
|
}
|
|
74
77
|
id={ id }
|
|
@@ -100,9 +103,17 @@ export function Option( {
|
|
|
100
103
|
|
|
101
104
|
const isListbox = setActiveId !== undefined;
|
|
102
105
|
const optionControl = isListbox ? (
|
|
103
|
-
<OptionAsOption
|
|
106
|
+
<OptionAsOption
|
|
107
|
+
{ ...commonProps }
|
|
108
|
+
label={ tooltipText }
|
|
109
|
+
isSelected={ isSelected }
|
|
110
|
+
/>
|
|
104
111
|
) : (
|
|
105
|
-
<OptionAsButton
|
|
112
|
+
<OptionAsButton
|
|
113
|
+
{ ...commonProps }
|
|
114
|
+
label={ tooltipText }
|
|
115
|
+
isPressed={ isSelected }
|
|
116
|
+
/>
|
|
106
117
|
);
|
|
107
118
|
|
|
108
119
|
return (
|
|
@@ -112,11 +123,7 @@ export function Option( {
|
|
|
112
123
|
'components-circular-option-picker__option-wrapper'
|
|
113
124
|
) }
|
|
114
125
|
>
|
|
115
|
-
{
|
|
116
|
-
<Tooltip text={ tooltipText }>{ optionControl }</Tooltip>
|
|
117
|
-
) : (
|
|
118
|
-
optionControl
|
|
119
|
-
) }
|
|
126
|
+
{ optionControl }
|
|
120
127
|
{ isSelected && <Icon icon={ check } { ...selectedIconProps } /> }
|
|
121
128
|
</div>
|
|
122
129
|
);
|
|
@@ -35,9 +35,11 @@ $color-palette-circle-spacing: 12px;
|
|
|
35
35
|
width: $color-palette-circle-size;
|
|
36
36
|
vertical-align: top;
|
|
37
37
|
transform: scale(1);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
|
|
39
|
+
@media not (prefers-reduced-motion) {
|
|
40
|
+
transition: 100ms transform ease;
|
|
41
|
+
will-change: transform;
|
|
42
|
+
}
|
|
41
43
|
|
|
42
44
|
&:hover {
|
|
43
45
|
transform: scale(1.2);
|
|
@@ -73,8 +75,11 @@ $color-palette-circle-spacing: 12px;
|
|
|
73
75
|
border-radius: $radius-round;
|
|
74
76
|
background: transparent;
|
|
75
77
|
box-shadow: inset 0 0 0 ($color-palette-circle-size * 0.5);
|
|
76
|
-
|
|
77
|
-
@
|
|
78
|
+
|
|
79
|
+
@media not (prefers-reduced-motion) {
|
|
80
|
+
transition: 100ms box-shadow ease;
|
|
81
|
+
}
|
|
82
|
+
|
|
78
83
|
cursor: pointer;
|
|
79
84
|
|
|
80
85
|
&:hover {
|
|
@@ -79,13 +79,6 @@ function SinglePalette( {
|
|
|
79
79
|
onClick={
|
|
80
80
|
isSelected ? clearColor : () => onChange( color, index )
|
|
81
81
|
}
|
|
82
|
-
aria-label={
|
|
83
|
-
name
|
|
84
|
-
? // translators: %s: The name of the color e.g: "vivid red".
|
|
85
|
-
sprintf( __( 'Color: %s' ), name )
|
|
86
|
-
: // translators: %s: color hex code e.g: "#f00".
|
|
87
|
-
sprintf( __( 'Color code: %s' ), color )
|
|
88
|
-
}
|
|
89
82
|
/>
|
|
90
83
|
);
|
|
91
84
|
} );
|
|
@@ -50,9 +50,7 @@ describe( 'ColorPalette', () => {
|
|
|
50
50
|
/>
|
|
51
51
|
);
|
|
52
52
|
|
|
53
|
-
expect(
|
|
54
|
-
screen.getAllByRole( 'option', { name: /^Color:/ } )
|
|
55
|
-
).toHaveLength( 3 );
|
|
53
|
+
expect( screen.getAllByRole( 'option' ) ).toHaveLength( 3 );
|
|
56
54
|
} );
|
|
57
55
|
|
|
58
56
|
it( 'should call onClick on an active button with undefined', async () => {
|
|
@@ -67,9 +65,7 @@ describe( 'ColorPalette', () => {
|
|
|
67
65
|
/>
|
|
68
66
|
);
|
|
69
67
|
|
|
70
|
-
await user.click(
|
|
71
|
-
screen.getByRole( 'option', { name: /^Color:/, selected: true } )
|
|
72
|
-
);
|
|
68
|
+
await user.click( screen.getByRole( 'option', { selected: true } ) );
|
|
73
69
|
|
|
74
70
|
expect( onChange ).toHaveBeenCalledTimes( 1 );
|
|
75
71
|
expect( onChange ).toHaveBeenCalledWith( undefined );
|
|
@@ -91,7 +87,6 @@ describe( 'ColorPalette', () => {
|
|
|
91
87
|
// (i.e. a button representing a color that is not the current color)
|
|
92
88
|
await user.click(
|
|
93
89
|
screen.getAllByRole( 'option', {
|
|
94
|
-
name: /^Color:/,
|
|
95
90
|
selected: false,
|
|
96
91
|
} )[ 0 ]
|
|
97
92
|
);
|
|
@@ -230,7 +225,6 @@ describe( 'ColorPalette', () => {
|
|
|
230
225
|
// Click the first unpressed button
|
|
231
226
|
await user.click(
|
|
232
227
|
screen.getAllByRole( 'option', {
|
|
233
|
-
name: /^Color:/,
|
|
234
228
|
selected: false,
|
|
235
229
|
} )[ 0 ]
|
|
236
230
|
);
|
|
@@ -348,7 +348,7 @@ describe.each( [
|
|
|
348
348
|
expect( option ).toHaveTextContent( matches[ optionIndex ].label );
|
|
349
349
|
} );
|
|
350
350
|
|
|
351
|
-
// Confirm that the
|
|
351
|
+
// Confirm that the current option is selected
|
|
352
352
|
await user.keyboard( '{Enter}' );
|
|
353
353
|
|
|
354
354
|
expect( onChangeSpy ).toHaveBeenCalledTimes( 1 );
|
package/src/drop-zone/style.scss
CHANGED
|
@@ -46,9 +46,8 @@
|
|
|
46
46
|
.components-drop-zone__content {
|
|
47
47
|
opacity: 1;
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
transition: none;
|
|
49
|
+
@media not (prefers-reduced-motion) {
|
|
50
|
+
transition: opacity 0.2s ease-in-out;
|
|
52
51
|
}
|
|
53
52
|
}
|
|
54
53
|
|
|
@@ -56,12 +55,10 @@
|
|
|
56
55
|
opacity: 1;
|
|
57
56
|
transform: scale(1);
|
|
58
57
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
@media (prefers-reduced-motion) {
|
|
64
|
-
transition: none;
|
|
58
|
+
@media not (prefers-reduced-motion) {
|
|
59
|
+
transition:
|
|
60
|
+
opacity 0.1s ease-in-out 0.1s,
|
|
61
|
+
transform 0.1s ease-in-out 0.1s;
|
|
65
62
|
}
|
|
66
63
|
}
|
|
67
64
|
}
|
|
@@ -126,7 +126,7 @@ function FontSizePicker( {
|
|
|
126
126
|
</View>
|
|
127
127
|
</BottomSheet.Cell>
|
|
128
128
|
{ fontSizes.map( ( item, index ) => {
|
|
129
|
-
// Only display a choice that we can
|
|
129
|
+
// Only display a choice that we can currently select.
|
|
130
130
|
if ( ! parseFloat( item.sizePx ) ) {
|
|
131
131
|
return null;
|
|
132
132
|
}
|
|
@@ -24,10 +24,13 @@ $transition-duration: 0.2s;
|
|
|
24
24
|
width: $toggle-width;
|
|
25
25
|
height: $toggle-height;
|
|
26
26
|
border-radius: math.div($toggle-height, 2);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
|
|
28
|
+
@media not (prefers-reduced-motion) {
|
|
29
|
+
transition:
|
|
30
|
+
$transition-duration background-color ease,
|
|
31
|
+
$transition-duration border-color ease;
|
|
32
|
+
}
|
|
33
|
+
|
|
31
34
|
overflow: hidden;
|
|
32
35
|
|
|
33
36
|
// Windows High Contrast Mode
|
|
@@ -39,8 +42,9 @@ $transition-duration: 0.2s;
|
|
|
39
42
|
// Expand the border to fake a solid in Windows High Contrast Mode.
|
|
40
43
|
border-top: #{ $toggle-height } solid transparent;
|
|
41
44
|
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
@media not (prefers-reduced-motion) {
|
|
46
|
+
transition: $transition-duration opacity ease;
|
|
47
|
+
}
|
|
44
48
|
|
|
45
49
|
opacity: 0;
|
|
46
50
|
}
|
|
@@ -55,10 +59,13 @@ $transition-duration: 0.2s;
|
|
|
55
59
|
width: $toggle-thumb-size;
|
|
56
60
|
height: $toggle-thumb-size;
|
|
57
61
|
border-radius: $radius-round;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
|
|
63
|
+
@media not (prefers-reduced-motion) {
|
|
64
|
+
transition:
|
|
65
|
+
$transition-duration transform ease,
|
|
66
|
+
$transition-duration background-color ease-out;
|
|
67
|
+
}
|
|
68
|
+
|
|
62
69
|
background-color: $gray-900;
|
|
63
70
|
box-shadow: $elevation-x-small;
|
|
64
71
|
|
|
@@ -124,8 +124,10 @@
|
|
|
124
124
|
height: auto;
|
|
125
125
|
background: $gray-300;
|
|
126
126
|
min-width: unset;
|
|
127
|
-
|
|
128
|
-
@
|
|
127
|
+
|
|
128
|
+
@media not (prefers-reduced-motion) {
|
|
129
|
+
transition: all 0.2s cubic-bezier(0.4, 1, 0.4, 1);
|
|
130
|
+
}
|
|
129
131
|
}
|
|
130
132
|
|
|
131
133
|
.components-form-token-field__token-text {
|
|
@@ -154,8 +156,11 @@
|
|
|
154
156
|
min-width: 100%;
|
|
155
157
|
max-height: $grid-unit-80 * 2;
|
|
156
158
|
overflow-y: auto;
|
|
157
|
-
|
|
158
|
-
@
|
|
159
|
+
|
|
160
|
+
@media not (prefers-reduced-motion) {
|
|
161
|
+
transition: all 0.15s ease-in-out;
|
|
162
|
+
}
|
|
163
|
+
|
|
159
164
|
list-style: none;
|
|
160
165
|
box-shadow: inset 0 $border-width 0 0 $gray-600; // Matches the border color of the input.
|
|
161
166
|
margin: 0;
|
|
@@ -8,7 +8,7 @@ $regionOutlineRatio: 2;
|
|
|
8
8
|
[role="region"] {
|
|
9
9
|
position: relative;
|
|
10
10
|
|
|
11
|
-
// Handles the focus when we
|
|
11
|
+
// Handles the focus when we programmatically send focus to this region
|
|
12
12
|
&.interface-interface-skeleton__content:focus-visible::after {
|
|
13
13
|
@include region-selection-focus;
|
|
14
14
|
}
|
|
@@ -26,7 +26,7 @@ $regionOutlineRatio: 2;
|
|
|
26
26
|
// the navigable regions should always have a computed size. For now, we can
|
|
27
27
|
// fix some edge cases but these CSS rules should be later removed in favor of
|
|
28
28
|
// a more abstracted approach to make the navigable regions focus style work
|
|
29
|
-
//
|
|
29
|
+
// regardless of the CSS used on other components.
|
|
30
30
|
|
|
31
31
|
// Header top bar when Distraction free mode is on.
|
|
32
32
|
&.is-distraction-free .interface-interface-skeleton__header .edit-post-header,
|
|
@@ -32,7 +32,7 @@ type Props = {
|
|
|
32
32
|
* describing the component and the
|
|
33
33
|
* focus return characteristics.
|
|
34
34
|
*
|
|
35
|
-
* @return Higher Order Component with the focus
|
|
35
|
+
* @return Higher Order Component with the focus restoration behaviour.
|
|
36
36
|
*/
|
|
37
37
|
export default createHigherOrderComponent(
|
|
38
38
|
// @ts-expect-error TODO: Reconcile with intended `createHigherOrderComponent` types
|