@primer/react 0.0.0-20260218214256 → 0.0.0-20260218214943
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 +3 -3
- package/dist/ActionList/Description.d.ts.map +1 -1
- package/dist/ActionList/Description.js +40 -76
- package/dist/ActionList/Item.d.ts.map +1 -1
- package/dist/ActionList/Item.js +62 -107
- package/dist/ActionList/shared.d.ts +0 -1
- package/dist/ActionList/shared.d.ts.map +1 -1
- package/generated/components.json +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @primer/react
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-20260218214943
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
@@ -14,8 +14,6 @@
|
|
|
14
14
|
|
|
15
15
|
- [#7552](https://github.com/primer/react/pull/7552) [`551ec63`](https://github.com/primer/react/commit/551ec6338af5c45e3f549245d85a4dd5a708df47) Thanks [@hectahertz](https://github.com/hectahertz)! - perf(Button): fix CounterLabel remount and remove conditional DEV hook
|
|
16
16
|
|
|
17
|
-
- [#7529](https://github.com/primer/react/pull/7529) [`7b11c23`](https://github.com/primer/react/commit/7b11c23088e9887608d28b8198f3370425f4cd8a) Thanks [@liuliu-dev](https://github.com/liuliu-dev)! - Add keyboard-accessible tooltip for truncated ActionList.Description
|
|
18
|
-
|
|
19
17
|
- [#7504](https://github.com/primer/react/pull/7504) [`d91e78e`](https://github.com/primer/react/commit/d91e78e8d1e69915222354b95d09d93d269dbd8b) Thanks [@TylerJDev](https://github.com/TylerJDev)! - UnderlineNav: Adds `overflow: hidden` when the "More" button isn't present
|
|
20
18
|
|
|
21
19
|
- [#7526](https://github.com/primer/react/pull/7526) [`0c2358a`](https://github.com/primer/react/commit/0c2358aa12a409f7cbcf15ce4fd41cbb9eee4b6c) Thanks [@hectahertz](https://github.com/hectahertz)! - Add `content-visibility: auto` to ActionList items to improve rendering performance for large lists by allowing the browser to skip layout and paint for off-screen items.
|
|
@@ -24,6 +22,8 @@
|
|
|
24
22
|
|
|
25
23
|
- [#7548](https://github.com/primer/react/pull/7548) [`d4b32c3`](https://github.com/primer/react/commit/d4b32c3672d3d5421711324654c1028527dcdf38) Thanks [@hectahertz](https://github.com/hectahertz)! - perf(useIsMacOS): replace useState+useEffect with useSyncExternalStore to eliminate unnecessary re-render
|
|
26
24
|
|
|
25
|
+
- [#7567](https://github.com/primer/react/pull/7567) [`05fda07`](https://github.com/primer/react/commit/05fda0772e038aadf96383253f5966661d80fefb) Thanks [@llastflowers](https://github.com/llastflowers)! - Autocomplete storybook a11y bug fixes
|
|
26
|
+
|
|
27
27
|
## 38.12.0
|
|
28
28
|
|
|
29
29
|
### Minor Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Description.d.ts","sourceRoot":"","sources":["../../src/ActionList/Description.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAA;AAE1D,MAAM,MAAM,0BAA0B,GAAG;IACvC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAA;IAE5B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,gBAAgB,CAAC,KAAK,CAAC,iBAAiB,CAAC,0BAA0B,CAAC,
|
|
1
|
+
{"version":3,"file":"Description.d.ts","sourceRoot":"","sources":["../../src/ActionList/Description.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAA;AAE1D,MAAM,MAAM,0BAA0B,GAAG;IACvC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAA;IAE5B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,gBAAgB,CAAC,KAAK,CAAC,iBAAiB,CAAC,0BAA0B,CAAC,CAgD7F,CAAA"}
|
|
@@ -7,7 +7,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
7
7
|
import Truncate from '../Truncate/Truncate.js';
|
|
8
8
|
|
|
9
9
|
const Description = t0 => {
|
|
10
|
-
const $ = c(
|
|
10
|
+
const $ = c(26);
|
|
11
11
|
let className;
|
|
12
12
|
let props;
|
|
13
13
|
let style;
|
|
@@ -37,8 +37,7 @@ const Description = t0 => {
|
|
|
37
37
|
const variant = t1 === undefined ? "inline" : t1;
|
|
38
38
|
const {
|
|
39
39
|
blockDescriptionId,
|
|
40
|
-
inlineDescriptionId
|
|
41
|
-
setTruncatedText
|
|
40
|
+
inlineDescriptionId
|
|
42
41
|
} = React.useContext(ItemContext);
|
|
43
42
|
const containerRef = React.useRef(null);
|
|
44
43
|
const [computedTitle, setComputedTitle] = React.useState("");
|
|
@@ -66,101 +65,66 @@ const Description = t0 => {
|
|
|
66
65
|
}
|
|
67
66
|
React.useEffect(t2, t3);
|
|
68
67
|
const effectiveTitle = typeof props.children === "string" ? props.children : computedTitle;
|
|
69
|
-
let t4;
|
|
70
|
-
let t5;
|
|
71
|
-
if ($[11] !== effectiveTitle || $[12] !== setTruncatedText || $[13] !== truncate) {
|
|
72
|
-
t4 = () => {
|
|
73
|
-
if (!truncate || !containerRef.current || !setTruncatedText) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
const isContentTruncated = function isContentTruncated() {
|
|
77
|
-
const el = containerRef.current;
|
|
78
|
-
if (!el) {
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
return el.scrollWidth > el.clientWidth;
|
|
82
|
-
};
|
|
83
|
-
setTruncatedText(isContentTruncated() ? effectiveTitle : undefined);
|
|
84
|
-
const observer = new ResizeObserver(() => {
|
|
85
|
-
setTruncatedText(isContentTruncated() ? effectiveTitle : undefined);
|
|
86
|
-
});
|
|
87
|
-
observer.observe(containerRef.current);
|
|
88
|
-
return () => {
|
|
89
|
-
observer.disconnect();
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
t5 = [truncate, effectiveTitle, setTruncatedText];
|
|
93
|
-
$[11] = effectiveTitle;
|
|
94
|
-
$[12] = setTruncatedText;
|
|
95
|
-
$[13] = truncate;
|
|
96
|
-
$[14] = t4;
|
|
97
|
-
$[15] = t5;
|
|
98
|
-
} else {
|
|
99
|
-
t4 = $[14];
|
|
100
|
-
t5 = $[15];
|
|
101
|
-
}
|
|
102
|
-
React.useEffect(t4, t5);
|
|
103
68
|
if (variant === "block" || !truncate) {
|
|
104
|
-
const
|
|
105
|
-
let
|
|
106
|
-
if ($[
|
|
107
|
-
|
|
108
|
-
$[
|
|
109
|
-
$[
|
|
69
|
+
const t4 = variant === "block" ? blockDescriptionId : inlineDescriptionId;
|
|
70
|
+
let t5;
|
|
71
|
+
if ($[11] !== className) {
|
|
72
|
+
t5 = clsx(className, classes.Description);
|
|
73
|
+
$[11] = className;
|
|
74
|
+
$[12] = t5;
|
|
110
75
|
} else {
|
|
111
|
-
|
|
76
|
+
t5 = $[12];
|
|
112
77
|
}
|
|
113
|
-
let
|
|
114
|
-
if ($[
|
|
115
|
-
|
|
116
|
-
id:
|
|
117
|
-
className:
|
|
78
|
+
let t6;
|
|
79
|
+
if ($[13] !== props.children || $[14] !== style || $[15] !== t4 || $[16] !== t5) {
|
|
80
|
+
t6 = /*#__PURE__*/jsx("span", {
|
|
81
|
+
id: t4,
|
|
82
|
+
className: t5,
|
|
118
83
|
style: style,
|
|
119
84
|
"data-component": "ActionList.Description",
|
|
120
85
|
children: props.children
|
|
121
86
|
});
|
|
122
|
-
$[
|
|
123
|
-
$[
|
|
124
|
-
$[
|
|
125
|
-
$[
|
|
126
|
-
$[
|
|
87
|
+
$[13] = props.children;
|
|
88
|
+
$[14] = style;
|
|
89
|
+
$[15] = t4;
|
|
90
|
+
$[16] = t5;
|
|
91
|
+
$[17] = t6;
|
|
127
92
|
} else {
|
|
128
|
-
|
|
93
|
+
t6 = $[17];
|
|
129
94
|
}
|
|
130
|
-
return
|
|
95
|
+
return t6;
|
|
131
96
|
} else {
|
|
132
|
-
let
|
|
133
|
-
if ($[
|
|
134
|
-
|
|
135
|
-
$[
|
|
136
|
-
$[
|
|
97
|
+
let t4;
|
|
98
|
+
if ($[18] !== className) {
|
|
99
|
+
t4 = clsx(className, classes.Description);
|
|
100
|
+
$[18] = className;
|
|
101
|
+
$[19] = t4;
|
|
137
102
|
} else {
|
|
138
|
-
|
|
103
|
+
t4 = $[19];
|
|
139
104
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
t8 = /*#__PURE__*/jsx(Truncate, {
|
|
105
|
+
let t5;
|
|
106
|
+
if ($[20] !== effectiveTitle || $[21] !== inlineDescriptionId || $[22] !== props.children || $[23] !== style || $[24] !== t4) {
|
|
107
|
+
t5 = /*#__PURE__*/jsx(Truncate, {
|
|
144
108
|
ref: containerRef,
|
|
145
109
|
id: inlineDescriptionId,
|
|
146
|
-
className:
|
|
110
|
+
className: t4,
|
|
147
111
|
style: style,
|
|
148
|
-
title:
|
|
112
|
+
title: effectiveTitle,
|
|
149
113
|
inline: true,
|
|
150
114
|
maxWidth: "100%",
|
|
151
115
|
"data-component": "ActionList.Description",
|
|
152
116
|
children: props.children
|
|
153
117
|
});
|
|
154
|
-
$[
|
|
155
|
-
$[
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
118
|
+
$[20] = effectiveTitle;
|
|
119
|
+
$[21] = inlineDescriptionId;
|
|
120
|
+
$[22] = props.children;
|
|
121
|
+
$[23] = style;
|
|
122
|
+
$[24] = t4;
|
|
123
|
+
$[25] = t5;
|
|
160
124
|
} else {
|
|
161
|
-
|
|
125
|
+
t5 = $[25];
|
|
162
126
|
}
|
|
163
|
-
return
|
|
127
|
+
return t5;
|
|
164
128
|
}
|
|
165
129
|
};
|
|
166
130
|
Description.__SLOT__ = Symbol('ActionList.Description');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../src/ActionList/Item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../src/ActionList/Item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAA;AAmBrC,KAAK,sBAAsB,GAAG;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAEpD,CAAA;AAySD,QAAA,MAAM,IAAI,IAjRa,EAAE,SAAS,KAAK,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoRjD,CAAA;AAEF,OAAO,EAAC,IAAI,EAAC,CAAA"}
|
package/dist/ActionList/Item.js
CHANGED
|
@@ -15,44 +15,8 @@ import VisuallyHidden from '../_VisuallyHidden.js';
|
|
|
15
15
|
import classes from './ActionList.module.css.js';
|
|
16
16
|
import { clsx } from 'clsx';
|
|
17
17
|
import { fixedForwardRef } from '../utils/modern-polymorphic.js';
|
|
18
|
-
import { TooltipContext, Tooltip } from '../TooltipV2/Tooltip.js';
|
|
19
18
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
20
19
|
|
|
21
|
-
/**
|
|
22
|
-
* Stable wrapper that keeps Tooltip in the tree for button-semantic items
|
|
23
|
-
* to avoid remount cycles when truncation state changes.
|
|
24
|
-
* For non-button-semantic items, renders children directly.
|
|
25
|
-
*/
|
|
26
|
-
function ConditionalTooltip(t0) {
|
|
27
|
-
const $ = c(4);
|
|
28
|
-
const {
|
|
29
|
-
text,
|
|
30
|
-
enabled,
|
|
31
|
-
children
|
|
32
|
-
} = t0;
|
|
33
|
-
if (!enabled) {
|
|
34
|
-
return children;
|
|
35
|
-
}
|
|
36
|
-
const t1 = text || "";
|
|
37
|
-
const t2 = !text;
|
|
38
|
-
let t3;
|
|
39
|
-
if ($[0] !== children || $[1] !== t1 || $[2] !== t2) {
|
|
40
|
-
t3 = /*#__PURE__*/jsx(Tooltip, {
|
|
41
|
-
text: t1,
|
|
42
|
-
direction: "e",
|
|
43
|
-
delay: "medium",
|
|
44
|
-
_privateDisableTooltip: t2,
|
|
45
|
-
children: children
|
|
46
|
-
});
|
|
47
|
-
$[0] = children;
|
|
48
|
-
$[1] = t1;
|
|
49
|
-
$[2] = t2;
|
|
50
|
-
$[3] = t3;
|
|
51
|
-
} else {
|
|
52
|
-
t3 = $[3];
|
|
53
|
-
}
|
|
54
|
-
return t3;
|
|
55
|
-
}
|
|
56
20
|
const SubItem = t0 => {
|
|
57
21
|
const $ = c(2);
|
|
58
22
|
const {
|
|
@@ -254,7 +218,6 @@ const UnwrappedItem = ({
|
|
|
254
218
|
const blockDescriptionId = `${itemId}--block-description`;
|
|
255
219
|
const trailingVisualId = `${itemId}--trailing-visual`;
|
|
256
220
|
const inactiveWarningId = inactive && !showInactiveIndicator ? `${itemId}--warning-message` : undefined;
|
|
257
|
-
const [truncatedText, setTruncatedText] = React.useState(undefined);
|
|
258
221
|
const DefaultItemWrapper = listSemantics ? DivItemContainerNoBox : ButtonItemContainerNoBox;
|
|
259
222
|
const ItemWrapper = _PrivateItemWrapper || DefaultItemWrapper;
|
|
260
223
|
|
|
@@ -275,8 +238,8 @@ const UnwrappedItem = ({
|
|
|
275
238
|
'data-inactive': inactive ? true : undefined,
|
|
276
239
|
'data-loading': loading && !inactive ? true : undefined,
|
|
277
240
|
tabIndex: focusable ? undefined : 0,
|
|
278
|
-
'aria-labelledby': `${labelId} ${slots.trailingVisual ? trailingVisualId : ''}`,
|
|
279
|
-
'aria-describedby': [slots.description && descriptionVariant === 'block' ? blockDescriptionId : undefined,
|
|
241
|
+
'aria-labelledby': `${labelId} ${slots.trailingVisual ? trailingVisualId : ''} ${slots.description && descriptionVariant === 'inline' ? inlineDescriptionId : ''}`,
|
|
242
|
+
'aria-describedby': [slots.description && descriptionVariant === 'block' ? blockDescriptionId : undefined, inactiveWarningId !== null && inactiveWarningId !== void 0 ? inactiveWarningId : undefined].filter(String).join(' ').trim() || undefined,
|
|
280
243
|
...(includeSelectionAttribute && {
|
|
281
244
|
[itemSelectionAttribute]: selected
|
|
282
245
|
}),
|
|
@@ -306,75 +269,67 @@ const UnwrappedItem = ({
|
|
|
306
269
|
inactive: Boolean(inactiveText),
|
|
307
270
|
inlineDescriptionId,
|
|
308
271
|
blockDescriptionId,
|
|
309
|
-
trailingVisualId
|
|
310
|
-
setTruncatedText: buttonSemantics ? setTruncatedText : undefined
|
|
272
|
+
trailingVisualId
|
|
311
273
|
},
|
|
312
|
-
children: /*#__PURE__*/
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
className:
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
"
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
id: inactiveWarningId,
|
|
372
|
-
children: inactiveText
|
|
373
|
-
}) : null]
|
|
374
|
-
})]
|
|
375
|
-
}), !inactive && !loading && !menuContext && Boolean(slots.trailingAction) && slots.trailingAction, slots.subItem]
|
|
376
|
-
})
|
|
377
|
-
})
|
|
274
|
+
children: /*#__PURE__*/jsxs("li", {
|
|
275
|
+
...containerProps,
|
|
276
|
+
ref: listSemantics ? forwardedRef : null,
|
|
277
|
+
"data-variant": variant === 'danger' ? variant : undefined,
|
|
278
|
+
"data-active": active ? true : undefined,
|
|
279
|
+
"data-inactive": inactiveText ? true : undefined,
|
|
280
|
+
"data-has-subitem": slots.subItem ? true : undefined,
|
|
281
|
+
"data-has-description": slots.description ? true : false,
|
|
282
|
+
className: clsx(classes.ActionListItem, className),
|
|
283
|
+
children: [/*#__PURE__*/jsxs(ItemWrapper, {
|
|
284
|
+
...wrapperProps,
|
|
285
|
+
className: classes.ActionListContent,
|
|
286
|
+
"data-size": size
|
|
287
|
+
// @ts-ignore: ItemWrapper is polymorphic and the ref type depends on the rendered element ('button' or 'li')
|
|
288
|
+
,
|
|
289
|
+
ref: forwardedRef,
|
|
290
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
291
|
+
className: classes.Spacer
|
|
292
|
+
}), /*#__PURE__*/jsx(Selection, {
|
|
293
|
+
selected: selected,
|
|
294
|
+
className: classes.LeadingAction
|
|
295
|
+
}), /*#__PURE__*/jsx(VisualOrIndicator, {
|
|
296
|
+
inactiveText: showInactiveIndicator ? inactiveText : undefined,
|
|
297
|
+
itemHasLeadingVisual: Boolean(slots.leadingVisual),
|
|
298
|
+
labelId: labelId,
|
|
299
|
+
loading: loading,
|
|
300
|
+
position: "leading",
|
|
301
|
+
children: slots.leadingVisual
|
|
302
|
+
}), /*#__PURE__*/jsxs("span", {
|
|
303
|
+
className: classes.ActionListSubContent,
|
|
304
|
+
"data-component": "ActionList.Item--DividerContainer",
|
|
305
|
+
children: [/*#__PURE__*/jsxs(ConditionalWrapper, {
|
|
306
|
+
if: !!slots.description,
|
|
307
|
+
className: classes.ItemDescriptionWrap,
|
|
308
|
+
"data-description-variant": descriptionVariant,
|
|
309
|
+
children: [/*#__PURE__*/jsxs("span", {
|
|
310
|
+
id: labelId,
|
|
311
|
+
className: classes.ItemLabel,
|
|
312
|
+
children: [childrenWithoutSlots, loading === true && !inactive && /*#__PURE__*/jsx(VisuallyHidden, {
|
|
313
|
+
children: "Loading"
|
|
314
|
+
})]
|
|
315
|
+
}), slots.description]
|
|
316
|
+
}), /*#__PURE__*/jsx(VisualOrIndicator, {
|
|
317
|
+
inactiveText: showInactiveIndicator ? inactiveText : undefined,
|
|
318
|
+
itemHasLeadingVisual: Boolean(slots.leadingVisual),
|
|
319
|
+
labelId: labelId,
|
|
320
|
+
loading: loading,
|
|
321
|
+
position: "trailing",
|
|
322
|
+
children: trailingVisual
|
|
323
|
+
}),
|
|
324
|
+
// If the item is inactive, but it's not in an overlay (e.g. ActionMenu, SelectPanel),
|
|
325
|
+
// render the inactive warning message directly in the item.
|
|
326
|
+
!showInactiveIndicator && inactiveText ? /*#__PURE__*/jsx("span", {
|
|
327
|
+
className: classes.InactiveWarning,
|
|
328
|
+
id: inactiveWarningId,
|
|
329
|
+
children: inactiveText
|
|
330
|
+
}) : null]
|
|
331
|
+
})]
|
|
332
|
+
}), !inactive && !loading && !menuContext && Boolean(slots.trailingAction) && slots.trailingAction, slots.subItem]
|
|
378
333
|
})
|
|
379
334
|
});
|
|
380
335
|
};
|
|
@@ -77,7 +77,6 @@ export type ItemContext = Pick<ActionListItemProps<React.ElementType>, 'variant'
|
|
|
77
77
|
blockDescriptionId?: string;
|
|
78
78
|
trailingVisualId?: string;
|
|
79
79
|
inactive?: boolean;
|
|
80
|
-
setTruncatedText?: (text: string | undefined) => void;
|
|
81
80
|
};
|
|
82
81
|
export declare const ItemContext: React.Context<ItemContext>;
|
|
83
82
|
export declare const getVariantStyles: (variant: ActionListItemProps<React.ElementType>["variant"], disabled: ActionListItemProps<React.ElementType>["disabled"], inactive?: boolean) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/ActionList/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAA;AAC5C,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,6BAA6B,CAAA;AAIjE,KAAK,yBAAyB,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,GAAG,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,GAAG,KAAK,CAAA;AAE/E,MAAM,MAAM,mBAAmB,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,GAAG,IAAI,IAAI,yBAAyB,CAC9F,gBAAgB,CAAC,EAAE,EAAE,IAAI,CAAC,CAC3B,GAAG;IACF;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,KAAK,IAAI,CAAA;IAC5F;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;IAC9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B,CAAA;AAED,eAAO,MAAM,WAAW,6BAAwC,CAAA"}
|
|
@@ -1019,7 +1019,7 @@
|
|
|
1019
1019
|
},
|
|
1020
1020
|
{
|
|
1021
1021
|
"id": "components-autocomplete-features--rendering-the-menu-outside-an-overlay",
|
|
1022
|
-
"code": "() => {\n return (\n <form className={classes.FormPadding}>\n <FormControl>\n <FormControl.Label id=\"autocompleteLabel\">\n Default label\n </FormControl.Label>\n <Autocomplete>\n <Autocomplete.Input />\n <Autocomplete.Menu\n
|
|
1022
|
+
"code": "() => {\n const [query, setQuery] = useState('')\n return (\n <form className={classes.FormPadding}>\n <FormControl>\n <FormControl.Label id=\"autocompleteLabel\">\n Default label\n </FormControl.Label>\n <Autocomplete>\n <Autocomplete.Input\n value={query}\n onChange={(e) => setQuery(e.currentTarget.value)}\n />\n {query.length > 0 ? (\n <Autocomplete.Menu\n items={items}\n selectedItemIds={[]}\n aria-labelledby=\"autocompleteLabel\"\n />\n ) : null}\n </Autocomplete>\n </FormControl>\n </form>\n )\n}"
|
|
1023
1023
|
},
|
|
1024
1024
|
{
|
|
1025
1025
|
"id": "components-autocomplete-features--custom-overlay-menu-anchor",
|
|
@@ -1027,7 +1027,7 @@
|
|
|
1027
1027
|
},
|
|
1028
1028
|
{
|
|
1029
1029
|
"id": "components-autocomplete-features--in-overlay-with-custom-scroll-container-ref",
|
|
1030
|
-
"code": "() => {\n const scrollContainerRef = useRef<HTMLElement>(null)\n const inputRef = useRef<HTMLInputElement>(null)\n const triggerRef = useRef<HTMLButtonElement>(null)\n const [isOpen, setIsOpen] = useState(false)\n const [selectedItem, setSelectedItem] = useState<Datum>()\n const handleOpen = () => {\n setIsOpen(true)\n
|
|
1030
|
+
"code": "() => {\n const scrollContainerRef = useRef<HTMLElement>(null)\n const inputRef = useRef<HTMLInputElement>(null)\n const triggerRef = useRef<HTMLButtonElement>(null)\n const [isOpen, setIsOpen] = useState(false)\n const [selectedItem, setSelectedItem] = useState<Datum>()\n const [query, setQuery] = useState('')\n const [menuOpen, setMenuOpen] = useState(false)\n const handleOpen = () => {\n setIsOpen(true)\n setMenuOpen(false)\n setQuery('')\n }\n const selectChange = (item: Datum[] | Datum) => {\n setIsOpen(false)\n if (Array.isArray(item) && item.length) setSelectedItem(item[0])\n triggerRef.current?.focus()\n }\n return (\n <form className={classes.FormPadding}>\n <span id=\"selected-item-status\">\n Selected item: {selectedItem ? selectedItem.text : 'none'}\n </span>\n\n <AnchoredOverlay\n open={isOpen}\n onOpen={handleOpen}\n onClose={() => setIsOpen(false)}\n width=\"large\"\n focusTrapSettings={{\n initialFocusRef: inputRef,\n }}\n side=\"inside-top\"\n anchorRef={triggerRef}\n renderAnchor={(props) => (\n <Button {...props} aria-describedby=\"selected-item-status\">\n open overlay\n </Button>\n )}\n preventOverflow={false}\n >\n <Autocomplete>\n <div className={classes.OverlayFlexCol}>\n <div className={classes.OverlayInputBar}>\n <Autocomplete.Input\n ref={inputRef}\n className={classes.OverlayInput}\n block\n aria-label=\"Search\"\n value={query}\n onChange={(e) => {\n setQuery(e.currentTarget.value)\n setMenuOpen(true)\n }}\n onKeyDown={(e) => {\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp')\n setMenuOpen(true)\n if (e.key === 'Escape') setMenuOpen(false)\n }}\n />\n </div>\n\n <div\n ref={scrollContainerRef as RefObject<HTMLDivElement>}\n className={classes.OverlayScroll}\n >\n {menuOpen ? (\n <Autocomplete.Menu\n items={items}\n selectedItemIds={[]}\n customScrollContainerRef={scrollContainerRef}\n aria-labelledby=\"autocompleteLabel\"\n onSelectedChange={selectChange}\n />\n ) : null}\n </div>\n </div>\n </Autocomplete>\n </AnchoredOverlay>\n </form>\n )\n}"
|
|
1031
1031
|
},
|
|
1032
1032
|
{
|
|
1033
1033
|
"id": "components-autocomplete-features--in-a-dialog",
|
package/package.json
CHANGED