@automattic/vip-design-system 2.20.3 → 2.20.4
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/build/system/Accordion/Accordion.js +13 -3
- package/build/system/Form/Input.styles.d.ts +0 -2
- package/build/system/Form/Input.styles.js +0 -3
- package/build/system/Form/Radio/styles.js +1 -1
- package/build/system/NewDialog/DialogTitle.js +1 -2
- package/package.json +1 -1
- package/src/system/Accordion/Accordion.tsx +15 -1
- package/src/system/Form/Input.styles.ts +0 -1
- package/src/system/Form/Radio/styles.ts +1 -1
- package/src/system/NewDialog/DialogTitle.tsx +1 -3
|
@@ -57,9 +57,6 @@ export var Item = function Item(_ref) {
|
|
|
57
57
|
'&:last-child': {
|
|
58
58
|
borderBottomLeftRadius: 1,
|
|
59
59
|
borderBottomRightRadius: 1
|
|
60
|
-
},
|
|
61
|
-
'&:focus-within': function focusWithin(theme) {
|
|
62
|
-
return theme.outline;
|
|
63
60
|
}
|
|
64
61
|
},
|
|
65
62
|
children: children
|
|
@@ -108,6 +105,19 @@ export var Trigger = /*#__PURE__*/React.forwardRef(function (_ref2, forwardedRef
|
|
|
108
105
|
},
|
|
109
106
|
'&:hover': {
|
|
110
107
|
backgroundColor: 'accordion.background.hover'
|
|
108
|
+
},
|
|
109
|
+
// Keyboard-only focus ring on the header (the trigger button
|
|
110
|
+
// fills the header). Rendered inset, reusing the shared
|
|
111
|
+
// focus-ring colors, because the parent Item has overflow:hidden
|
|
112
|
+
// for its rounded corners which would clip an outset ring.
|
|
113
|
+
'&:focus-visible': function focusVisible(theme) {
|
|
114
|
+
var _theme$outline;
|
|
115
|
+
var ring = (_theme$outline = theme.outline) == null ? void 0 : _theme$outline.boxShadow;
|
|
116
|
+
return ring ? {
|
|
117
|
+
boxShadow: ring.split(/,(?![^(]*\))/).map(function (layer) {
|
|
118
|
+
return "inset " + layer.trim();
|
|
119
|
+
}).join(', ')
|
|
120
|
+
} : {};
|
|
111
121
|
}
|
|
112
122
|
}, sx)
|
|
113
123
|
}, props, {
|
|
@@ -11,7 +11,6 @@ export declare const inputBaseText = "input.text.default";
|
|
|
11
11
|
export declare const inputBaseBackground = "input.background.default";
|
|
12
12
|
export declare const baseControlFocusStyle: {
|
|
13
13
|
'&:focus-visible': (theme: InputTheme) => Record<string, string> | undefined;
|
|
14
|
-
'&:focus-within': (theme: InputTheme) => Record<string, string> | undefined;
|
|
15
14
|
};
|
|
16
15
|
export declare const baseControlStyle: {
|
|
17
16
|
'&:disabled': {
|
|
@@ -26,7 +25,6 @@ export declare const baseControlStyle: {
|
|
|
26
25
|
opacity: number;
|
|
27
26
|
};
|
|
28
27
|
'&:focus-visible': (theme: InputTheme) => Record<string, string> | undefined;
|
|
29
|
-
'&:focus-within': (theme: InputTheme) => Record<string, string> | undefined;
|
|
30
28
|
backgroundColor: string;
|
|
31
29
|
color: string;
|
|
32
30
|
borderRadius: number;
|
|
@@ -11,9 +11,6 @@ export var inputBaseBackground = 'input.background.default';
|
|
|
11
11
|
export var baseControlFocusStyle = {
|
|
12
12
|
'&:focus-visible': function focusVisible(theme) {
|
|
13
13
|
return theme.outline;
|
|
14
|
-
},
|
|
15
|
-
'&:focus-within': function focusWithin(theme) {
|
|
16
|
-
return theme.outline;
|
|
17
14
|
}
|
|
18
15
|
};
|
|
19
16
|
export var baseControlStyle = _extends({}, baseControlBorderStyle, {
|
|
@@ -11,7 +11,7 @@ export var inputStyle = function inputStyle(variant) {
|
|
|
11
11
|
clipPath: 'inset(50%)',
|
|
12
12
|
width: RADIO_SIZE,
|
|
13
13
|
height: RADIO_SIZE,
|
|
14
|
-
'&:focus ~ label:before': {
|
|
14
|
+
'&:focus-visible ~ label:before': {
|
|
15
15
|
variant: 'outline',
|
|
16
16
|
content: '""',
|
|
17
17
|
border: '1px solid',
|
package/package.json
CHANGED
|
@@ -92,7 +92,6 @@ export const Item = ( { children, ...props }: AccordionItemProps ) => (
|
|
|
92
92
|
borderBottomLeftRadius: 1,
|
|
93
93
|
borderBottomRightRadius: 1,
|
|
94
94
|
},
|
|
95
|
-
'&:focus-within': ( theme: AccordionTheme ) => theme.outline,
|
|
96
95
|
} }
|
|
97
96
|
>
|
|
98
97
|
{ children }
|
|
@@ -136,6 +135,21 @@ export const Trigger = React.forwardRef< HTMLButtonElement, TriggerProps >(
|
|
|
136
135
|
'.vip-accordion-trigger-indicator': { transform: 'rotate(270deg)' },
|
|
137
136
|
},
|
|
138
137
|
'&:hover': { backgroundColor: 'accordion.background.hover' },
|
|
138
|
+
// Keyboard-only focus ring on the header (the trigger button
|
|
139
|
+
// fills the header). Rendered inset, reusing the shared
|
|
140
|
+
// focus-ring colors, because the parent Item has overflow:hidden
|
|
141
|
+
// for its rounded corners which would clip an outset ring.
|
|
142
|
+
'&:focus-visible': ( theme: AccordionTheme ) => {
|
|
143
|
+
const ring = theme.outline?.boxShadow;
|
|
144
|
+
return ring
|
|
145
|
+
? {
|
|
146
|
+
boxShadow: ring
|
|
147
|
+
.split( /,(?![^(]*\))/ )
|
|
148
|
+
.map( layer => `inset ${ layer.trim() }` )
|
|
149
|
+
.join( ', ' ),
|
|
150
|
+
}
|
|
151
|
+
: {};
|
|
152
|
+
},
|
|
139
153
|
...sx,
|
|
140
154
|
} }
|
|
141
155
|
{ ...props }
|
|
@@ -14,7 +14,6 @@ export const inputBaseText = 'input.text.default';
|
|
|
14
14
|
export const inputBaseBackground = 'input.background.default';
|
|
15
15
|
export const baseControlFocusStyle = {
|
|
16
16
|
'&:focus-visible': ( theme: InputTheme ) => theme.outline,
|
|
17
|
-
'&:focus-within': ( theme: InputTheme ) => theme.outline,
|
|
18
17
|
};
|
|
19
18
|
|
|
20
19
|
export const baseControlStyle = {
|
|
@@ -13,7 +13,7 @@ export const inputStyle = ( variant: string ): ThemeUIStyleObject => ( {
|
|
|
13
13
|
clipPath: 'inset(50%)',
|
|
14
14
|
width: RADIO_SIZE,
|
|
15
15
|
height: RADIO_SIZE,
|
|
16
|
-
'&:focus ~ label:before': {
|
|
16
|
+
'&:focus-visible ~ label:before': {
|
|
17
17
|
variant: 'outline',
|
|
18
18
|
content: '""',
|
|
19
19
|
border: '1px solid',
|
|
@@ -34,9 +34,7 @@ export const DialogTitle: React.FC< DialogTitleProps > = ( { title, hidden = fal
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
return (
|
|
37
|
-
<DialogPrimitive.Title
|
|
38
|
-
sx={ { margin: 0, fontSize: 3, fontWeight: 'medium', color: 'heading' } }
|
|
39
|
-
>
|
|
37
|
+
<DialogPrimitive.Title sx={ { margin: 0, variant: 'text.h3', color: 'heading' } }>
|
|
40
38
|
{ titleNode }
|
|
41
39
|
</DialogPrimitive.Title>
|
|
42
40
|
);
|