@primer/react 0.0.0-20260309122525 → 0.0.0-20260309122635
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 +2 -2
- package/dist/ActionList/Item.d.ts.map +1 -1
- package/dist/ActionList/Item.js +192 -628
- package/dist/ActionList/List.d.ts.map +1 -1
- package/dist/ActionList/List.js +5 -6
- package/dist/Dialog/{Dialog-2d417a89.css → Dialog-2de477b3.css} +2 -2
- package/dist/Dialog/{Dialog-2d417a89.css.map → Dialog-2de477b3.css.map} +1 -1
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +1 -0
- package/dist/Dialog/Dialog.module.css.js +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-20260309122635
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
- [#7624](https://github.com/primer/react/pull/7624) [`f6d4311`](https://github.com/primer/react/commit/f6d431194d217fbb7d456e58bcbbcbb434896fe1) Thanks [@llastflowers](https://github.com/llastflowers)! - Fix FormControl + SelectPanel accessible name to address SR issues
|
|
22
22
|
|
|
23
|
-
- [#
|
|
23
|
+
- [#7599](https://github.com/primer/react/pull/7599) [`510e557`](https://github.com/primer/react/commit/510e5571e7509af4047e5cb799f8b1db374454d7) Thanks [@hectahertz](https://github.com/hectahertz)! - perf(Dialog): replace `:has(.Footer)` with `[data-has-footer]` attribute selector for footer border detection
|
|
24
24
|
|
|
25
25
|
- [#7617](https://github.com/primer/react/pull/7617) [`79c855a`](https://github.com/primer/react/commit/79c855abeb6f46d3fefafb236f00ea65dfcd1ed4) Thanks [@llastflowers](https://github.com/llastflowers)! - Push margin-top of TimelineBody +1px
|
|
26
26
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../src/ActionList/Item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAA;AAoBrC,KAAK,sBAAsB,GAAG;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAwBD,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAEpD,CAAA;
|
|
1
|
+
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../src/ActionList/Item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAA;AAoBrC,KAAK,sBAAsB,GAAG;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAwBD,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAEpD,CAAA;AAkTD,QAAA,MAAM,IAAI,IA1Ra,EAAE,SAAS,KAAK,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6RjD,CAAA;AAEF,OAAO,EAAC,IAAI,EAAC,CAAA"}
|
package/dist/ActionList/Item.js
CHANGED
|
@@ -142,132 +142,50 @@ const DivItemContainerNoBox = /*#__PURE__*/React.forwardRef((t0, forwardedRef) =
|
|
|
142
142
|
}
|
|
143
143
|
return t2;
|
|
144
144
|
});
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
145
|
+
const UnwrappedItem = ({
|
|
146
|
+
variant = 'default',
|
|
147
|
+
size = 'medium',
|
|
148
|
+
disabled = false,
|
|
149
|
+
inactiveText,
|
|
150
|
+
selected = undefined,
|
|
151
|
+
active = false,
|
|
152
|
+
onSelect: onSelectUser,
|
|
153
|
+
id,
|
|
154
|
+
role,
|
|
155
|
+
loading,
|
|
156
|
+
_PrivateItemWrapper,
|
|
157
|
+
className,
|
|
158
|
+
groupId: _groupId,
|
|
159
|
+
renderItem: _renderItem,
|
|
160
|
+
handleAddItem: _handleAddItem,
|
|
161
|
+
...props
|
|
162
|
+
}, forwardedRef) => {
|
|
160
163
|
var _slots$trailingVisual, _slots$description$pr, _slots$description;
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
if ($[0] !== t0) {
|
|
176
|
-
const {
|
|
177
|
-
variant: t6,
|
|
178
|
-
size: t7,
|
|
179
|
-
disabled: t8,
|
|
180
|
-
inactiveText: t9,
|
|
181
|
-
selected: t10,
|
|
182
|
-
active: t11,
|
|
183
|
-
onSelect: t12,
|
|
184
|
-
id: t13,
|
|
185
|
-
role: t14,
|
|
186
|
-
loading: t15,
|
|
187
|
-
_PrivateItemWrapper: t16,
|
|
188
|
-
className: t17,
|
|
189
|
-
groupId: _groupId,
|
|
190
|
-
renderItem: _renderItem,
|
|
191
|
-
handleAddItem: _handleAddItem,
|
|
192
|
-
...t18
|
|
193
|
-
} = t0;
|
|
194
|
-
t1 = t6;
|
|
195
|
-
t2 = t7;
|
|
196
|
-
t3 = t8;
|
|
197
|
-
inactiveText = t9;
|
|
198
|
-
t4 = t10;
|
|
199
|
-
t5 = t11;
|
|
200
|
-
onSelectUser = t12;
|
|
201
|
-
id = t13;
|
|
202
|
-
role = t14;
|
|
203
|
-
loading = t15;
|
|
204
|
-
_PrivateItemWrapper = t16;
|
|
205
|
-
className = t17;
|
|
206
|
-
props = t18;
|
|
207
|
-
$[0] = t0;
|
|
208
|
-
$[1] = _PrivateItemWrapper;
|
|
209
|
-
$[2] = className;
|
|
210
|
-
$[3] = id;
|
|
211
|
-
$[4] = inactiveText;
|
|
212
|
-
$[5] = loading;
|
|
213
|
-
$[6] = onSelectUser;
|
|
214
|
-
$[7] = props;
|
|
215
|
-
$[8] = role;
|
|
216
|
-
$[9] = t1;
|
|
217
|
-
$[10] = t2;
|
|
218
|
-
$[11] = t3;
|
|
219
|
-
$[12] = t4;
|
|
220
|
-
$[13] = t5;
|
|
221
|
-
} else {
|
|
222
|
-
_PrivateItemWrapper = $[1];
|
|
223
|
-
className = $[2];
|
|
224
|
-
id = $[3];
|
|
225
|
-
inactiveText = $[4];
|
|
226
|
-
loading = $[5];
|
|
227
|
-
onSelectUser = $[6];
|
|
228
|
-
props = $[7];
|
|
229
|
-
role = $[8];
|
|
230
|
-
t1 = $[9];
|
|
231
|
-
t2 = $[10];
|
|
232
|
-
t3 = $[11];
|
|
233
|
-
t4 = $[12];
|
|
234
|
-
t5 = $[13];
|
|
235
|
-
}
|
|
236
|
-
const variant = t1 === undefined ? "default" : t1;
|
|
237
|
-
const size = t2 === undefined ? "medium" : t2;
|
|
238
|
-
const disabled = t3 === undefined ? false : t3;
|
|
239
|
-
const selected = t4 === undefined ? undefined : t4;
|
|
240
|
-
const active = t5 === undefined ? false : t5;
|
|
241
|
-
const [partialSlots, childrenWithoutSlots] = useSlots(props.children, slotsConfig);
|
|
242
|
-
let t6;
|
|
243
|
-
if ($[14] !== partialSlots) {
|
|
244
|
-
t6 = {
|
|
245
|
-
description: undefined,
|
|
246
|
-
...partialSlots
|
|
247
|
-
};
|
|
248
|
-
$[14] = partialSlots;
|
|
249
|
-
$[15] = t6;
|
|
250
|
-
} else {
|
|
251
|
-
t6 = $[15];
|
|
252
|
-
}
|
|
253
|
-
const slots = t6;
|
|
164
|
+
const baseSlots = {
|
|
165
|
+
leadingVisual: LeadingVisual,
|
|
166
|
+
trailingVisual: TrailingVisual,
|
|
167
|
+
trailingAction: TrailingAction,
|
|
168
|
+
subItem: SubItem
|
|
169
|
+
};
|
|
170
|
+
const [partialSlots, childrenWithoutSlots] = useSlots(props.children, {
|
|
171
|
+
...baseSlots,
|
|
172
|
+
description: Description
|
|
173
|
+
});
|
|
174
|
+
const slots = {
|
|
175
|
+
description: undefined,
|
|
176
|
+
...partialSlots
|
|
177
|
+
};
|
|
254
178
|
const {
|
|
255
179
|
container,
|
|
256
180
|
afterSelect,
|
|
257
181
|
selectionAttribute,
|
|
258
182
|
defaultTrailingVisual
|
|
259
183
|
} = React.useContext(ActionListContainerContext);
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
$[16] = defaultTrailingVisual;
|
|
266
|
-
$[17] = t7;
|
|
267
|
-
} else {
|
|
268
|
-
t7 = $[17];
|
|
269
|
-
}
|
|
270
|
-
const wrappedDefaultTrailingVisual = t7;
|
|
184
|
+
|
|
185
|
+
// Be sure to avoid rendering the container unless there is a default
|
|
186
|
+
const wrappedDefaultTrailingVisual = defaultTrailingVisual ? /*#__PURE__*/jsx(TrailingVisual, {
|
|
187
|
+
children: defaultTrailingVisual
|
|
188
|
+
}) : null;
|
|
271
189
|
const trailingVisual = (_slots$trailingVisual = slots.trailingVisual) !== null && _slots$trailingVisual !== void 0 ? _slots$trailingVisual : wrappedDefaultTrailingVisual;
|
|
272
190
|
const {
|
|
273
191
|
role: listRole,
|
|
@@ -277,127 +195,57 @@ const UnwrappedItem = (t0, forwardedRef) => {
|
|
|
277
195
|
selectionVariant: groupSelectionVariant
|
|
278
196
|
} = React.useContext(GroupContext);
|
|
279
197
|
const inactive = Boolean(inactiveText);
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
}
|
|
290
|
-
const showInactiveIndicator = t8;
|
|
291
|
-
let t9;
|
|
292
|
-
if ($[21] !== onSelectUser) {
|
|
293
|
-
t9 = (event, afterSelect_0) => {
|
|
294
|
-
if (typeof onSelectUser === "function") {
|
|
295
|
-
onSelectUser(event);
|
|
296
|
-
}
|
|
297
|
-
if (event.defaultPrevented) {
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
if (typeof afterSelect_0 === "function") {
|
|
301
|
-
afterSelect_0(event);
|
|
302
|
-
}
|
|
303
|
-
};
|
|
304
|
-
$[21] = onSelectUser;
|
|
305
|
-
$[22] = t9;
|
|
306
|
-
} else {
|
|
307
|
-
t9 = $[22];
|
|
308
|
-
}
|
|
309
|
-
const onSelect = t9;
|
|
198
|
+
// TODO change `menuContext` check to ```listRole !== undefined && ['menu', 'listbox'].includes(listRole)```
|
|
199
|
+
// once we have a better way to handle existing usage in dotcom that incorrectly use ActionList.TrailingAction
|
|
200
|
+
const menuContext = container === 'ActionMenu' || container === 'SelectPanel' || container === 'FilteredActionList';
|
|
201
|
+
// TODO: when we change `menuContext` to check `listRole` instead of `container`
|
|
202
|
+
const showInactiveIndicator = inactive && !(listRole !== undefined && ['menu', 'listbox'].includes(listRole));
|
|
203
|
+
const onSelect = React.useCallback((event, afterSelect_0) => {
|
|
204
|
+
if (typeof onSelectUser === 'function') onSelectUser(event);
|
|
205
|
+
if (event.defaultPrevented) return;
|
|
206
|
+
if (typeof afterSelect_0 === 'function') afterSelect_0(event);
|
|
207
|
+
}, [onSelectUser]);
|
|
310
208
|
const selectionVariant = groupSelectionVariant ? groupSelectionVariant : listSelectionVariant;
|
|
209
|
+
|
|
210
|
+
/** Infer item role based on the container */
|
|
311
211
|
let inferredItemRole;
|
|
312
|
-
if (container ===
|
|
313
|
-
if (selectionVariant ===
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
} else {
|
|
319
|
-
inferredItemRole = "menuitem";
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
} else {
|
|
323
|
-
if (listRole === "listbox") {
|
|
324
|
-
if (selectionVariant !== undefined && !role) {
|
|
325
|
-
inferredItemRole = "option";
|
|
326
|
-
}
|
|
327
|
-
} else {
|
|
328
|
-
if (listRole === "tablist") {
|
|
329
|
-
inferredItemRole = "tab";
|
|
330
|
-
}
|
|
331
|
-
}
|
|
212
|
+
if (container === 'ActionMenu') {
|
|
213
|
+
if (selectionVariant === 'single') inferredItemRole = 'menuitemradio';else if (selectionVariant === 'multiple') inferredItemRole = 'menuitemcheckbox';else inferredItemRole = 'menuitem';
|
|
214
|
+
} else if (listRole === 'listbox') {
|
|
215
|
+
if (selectionVariant !== undefined && !role) inferredItemRole = 'option';
|
|
216
|
+
} else if (listRole === 'tablist') {
|
|
217
|
+
inferredItemRole = 'tab';
|
|
332
218
|
}
|
|
333
219
|
const itemRole = role || inferredItemRole;
|
|
334
220
|
if (slots.trailingAction) {
|
|
335
|
-
!!menuContext ? process.env.NODE_ENV !== "production" ? invariant(false,
|
|
221
|
+
!!menuContext ? process.env.NODE_ENV !== "production" ? invariant(false, `ActionList.TrailingAction can not be used within a list with an ARIA role of "menu" or "listbox".`) : invariant(false) : void 0;
|
|
336
222
|
}
|
|
223
|
+
|
|
224
|
+
/** Infer the proper selection attribute based on the item's role */
|
|
337
225
|
let inferredSelectionAttribute;
|
|
338
|
-
if (itemRole ===
|
|
339
|
-
inferredSelectionAttribute = "aria-checked";
|
|
340
|
-
} else {
|
|
341
|
-
if (itemRole === "option") {
|
|
342
|
-
inferredSelectionAttribute = "aria-selected";
|
|
343
|
-
}
|
|
344
|
-
}
|
|
226
|
+
if (itemRole === 'menuitemradio' || itemRole === 'menuitemcheckbox') inferredSelectionAttribute = 'aria-checked';else if (itemRole === 'option') inferredSelectionAttribute = 'aria-selected';
|
|
345
227
|
const itemSelectionAttribute = selectionAttribute || inferredSelectionAttribute;
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
$[23] = inactive;
|
|
351
|
-
$[24] = listItemSemantics;
|
|
352
|
-
$[25] = listRole;
|
|
353
|
-
$[26] = t10;
|
|
354
|
-
} else {
|
|
355
|
-
t10 = $[26];
|
|
356
|
-
}
|
|
357
|
-
const listSemantics = t10;
|
|
228
|
+
// Ensures ActionList.Item retains list item semantics if a valid ARIA role is applied, or if item is inactive
|
|
229
|
+
const listItemSemantics = itemRole === 'option' || itemRole === 'menuitem' || itemRole === 'menuitemradio' || itemRole === 'menuitemcheckbox' || itemRole === 'tab';
|
|
230
|
+
const listRoleTypes = ['listbox', 'menu', 'list'];
|
|
231
|
+
const listSemantics = listRole && listRoleTypes.includes(listRole) || inactive || listItemSemantics;
|
|
358
232
|
const buttonSemantics = !listSemantics && !_PrivateItemWrapper;
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
233
|
+
const clickHandler = React.useCallback(event_0 => {
|
|
234
|
+
if (disabled || inactive || loading) return;
|
|
235
|
+
onSelect(event_0, afterSelect);
|
|
236
|
+
}, [onSelect, disabled, inactive, afterSelect, loading]);
|
|
237
|
+
const keyPressHandler = React.useCallback(event_1 => {
|
|
238
|
+
if (disabled || inactive || loading) return;
|
|
239
|
+
if ([' ', 'Enter'].includes(event_1.key)) {
|
|
240
|
+
if (event_1.key === ' ') {
|
|
241
|
+
event_1.preventDefault(); // prevent scrolling on Space
|
|
242
|
+
// immediately reset defaultPrevented once its job is done
|
|
243
|
+
// so as to not disturb the functions that use that event after this
|
|
244
|
+
event_1.defaultPrevented = false;
|
|
364
245
|
}
|
|
365
|
-
onSelect(
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
$[28] = disabled;
|
|
369
|
-
$[29] = inactive;
|
|
370
|
-
$[30] = loading;
|
|
371
|
-
$[31] = onSelect;
|
|
372
|
-
$[32] = t11;
|
|
373
|
-
} else {
|
|
374
|
-
t11 = $[32];
|
|
375
|
-
}
|
|
376
|
-
const clickHandler = t11;
|
|
377
|
-
let t12;
|
|
378
|
-
if ($[33] !== afterSelect || $[34] !== disabled || $[35] !== inactive || $[36] !== loading || $[37] !== onSelect) {
|
|
379
|
-
t12 = event_1 => {
|
|
380
|
-
if (disabled || inactive || loading) {
|
|
381
|
-
return;
|
|
382
|
-
}
|
|
383
|
-
if (event_1.key === " " || event_1.key === "Enter") {
|
|
384
|
-
if (event_1.key === " ") {
|
|
385
|
-
event_1.preventDefault();
|
|
386
|
-
event_1.defaultPrevented = false;
|
|
387
|
-
}
|
|
388
|
-
onSelect(event_1, afterSelect);
|
|
389
|
-
}
|
|
390
|
-
};
|
|
391
|
-
$[33] = afterSelect;
|
|
392
|
-
$[34] = disabled;
|
|
393
|
-
$[35] = inactive;
|
|
394
|
-
$[36] = loading;
|
|
395
|
-
$[37] = onSelect;
|
|
396
|
-
$[38] = t12;
|
|
397
|
-
} else {
|
|
398
|
-
t12 = $[38];
|
|
399
|
-
}
|
|
400
|
-
const keyPressHandler = t12;
|
|
246
|
+
onSelect(event_1, afterSelect);
|
|
247
|
+
}
|
|
248
|
+
}, [onSelect, disabled, loading, inactive, afterSelect]);
|
|
401
249
|
const itemId = useId(id);
|
|
402
250
|
const labelId = `${itemId}--label`;
|
|
403
251
|
const inlineDescriptionId = `${itemId}--inline-description`;
|
|
@@ -407,414 +255,130 @@ const UnwrappedItem = (t0, forwardedRef) => {
|
|
|
407
255
|
const [truncatedText, setTruncatedText] = React.useState(undefined);
|
|
408
256
|
const DefaultItemWrapper = listSemantics ? DivItemContainerNoBox : ButtonItemContainerNoBox;
|
|
409
257
|
const ItemWrapper = _PrivateItemWrapper || DefaultItemWrapper;
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
t13 = $[41];
|
|
418
|
-
}
|
|
419
|
-
const includeSelectionAttribute = t13;
|
|
420
|
-
const focusable = showInactiveIndicator ? true : undefined;
|
|
421
|
-
const descriptionVariant = (_slots$description$pr = (_slots$description = slots.description) === null || _slots$description === void 0 ? void 0 : _slots$description.props.variant) !== null && _slots$description$pr !== void 0 ? _slots$description$pr : "inline";
|
|
422
|
-
const hasTrailingVisualSlot = Boolean(slots.trailingVisual);
|
|
423
|
-
const hasDescriptionSlot = Boolean(slots.description);
|
|
424
|
-
let parts;
|
|
425
|
-
if ($[42] !== descriptionVariant || $[43] !== hasDescriptionSlot || $[44] !== hasTrailingVisualSlot || $[45] !== inlineDescriptionId || $[46] !== labelId || $[47] !== trailingVisualId) {
|
|
426
|
-
parts = [labelId];
|
|
427
|
-
if (hasTrailingVisualSlot) {
|
|
428
|
-
parts.push(trailingVisualId);
|
|
429
|
-
}
|
|
430
|
-
if (hasDescriptionSlot && descriptionVariant === "inline") {
|
|
431
|
-
parts.push(inlineDescriptionId);
|
|
432
|
-
}
|
|
433
|
-
$[42] = descriptionVariant;
|
|
434
|
-
$[43] = hasDescriptionSlot;
|
|
435
|
-
$[44] = hasTrailingVisualSlot;
|
|
436
|
-
$[45] = inlineDescriptionId;
|
|
437
|
-
$[46] = labelId;
|
|
438
|
-
$[47] = trailingVisualId;
|
|
439
|
-
$[48] = parts;
|
|
440
|
-
} else {
|
|
441
|
-
parts = $[48];
|
|
442
|
-
}
|
|
443
|
-
const ariaLabelledBy = parts.join(" ");
|
|
444
|
-
let parts_0;
|
|
445
|
-
if ($[49] !== blockDescriptionId || $[50] !== descriptionVariant || $[51] !== hasDescriptionSlot || $[52] !== inactiveWarningId) {
|
|
446
|
-
parts_0 = [];
|
|
447
|
-
if (hasDescriptionSlot && descriptionVariant === "block") {
|
|
448
|
-
parts_0.push(blockDescriptionId);
|
|
449
|
-
}
|
|
450
|
-
if (inactiveWarningId) {
|
|
451
|
-
parts_0.push(inactiveWarningId);
|
|
452
|
-
}
|
|
453
|
-
$[49] = blockDescriptionId;
|
|
454
|
-
$[50] = descriptionVariant;
|
|
455
|
-
$[51] = hasDescriptionSlot;
|
|
456
|
-
$[52] = inactiveWarningId;
|
|
457
|
-
$[53] = parts_0;
|
|
458
|
-
} else {
|
|
459
|
-
parts_0 = $[53];
|
|
258
|
+
|
|
259
|
+
// only apply aria-selected and aria-checked to selectable items
|
|
260
|
+
const selectableRoles = ['menuitemradio', 'menuitemcheckbox', 'option'];
|
|
261
|
+
const includeSelectionAttribute = itemSelectionAttribute && itemRole && selectableRoles.includes(itemRole);
|
|
262
|
+
let focusable;
|
|
263
|
+
if (showInactiveIndicator) {
|
|
264
|
+
focusable = true;
|
|
460
265
|
}
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
const
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
266
|
+
|
|
267
|
+
// Extract the variant prop value from the description slot component
|
|
268
|
+
const descriptionVariant = (_slots$description$pr = (_slots$description = slots.description) === null || _slots$description === void 0 ? void 0 : _slots$description.props.variant) !== null && _slots$description$pr !== void 0 ? _slots$description$pr : 'inline';
|
|
269
|
+
const menuItemProps = {
|
|
270
|
+
onClick: clickHandler,
|
|
271
|
+
onKeyPress: !buttonSemantics ? keyPressHandler : undefined,
|
|
272
|
+
'aria-disabled': disabled ? true : undefined,
|
|
273
|
+
'data-inactive': inactive ? true : undefined,
|
|
274
|
+
'data-loading': loading && !inactive ? true : undefined,
|
|
275
|
+
tabIndex: focusable ? undefined : 0,
|
|
276
|
+
'aria-labelledby': `${labelId} ${slots.trailingVisual ? trailingVisualId : ''}`,
|
|
277
|
+
'aria-describedby': [slots.description && descriptionVariant === 'block' ? blockDescriptionId : undefined, slots.description && descriptionVariant === 'inline' ? inlineDescriptionId : undefined, inactiveWarningId !== null && inactiveWarningId !== void 0 ? inactiveWarningId : undefined].filter(String).join(' ').trim() || undefined,
|
|
278
|
+
...(includeSelectionAttribute && {
|
|
470
279
|
[itemSelectionAttribute]: selected
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
id: itemId
|
|
493
|
-
};
|
|
494
|
-
$[58] = ariaDescribedBy;
|
|
495
|
-
$[59] = ariaLabelledBy;
|
|
496
|
-
$[60] = clickHandler;
|
|
497
|
-
$[61] = itemId;
|
|
498
|
-
$[62] = itemRole;
|
|
499
|
-
$[63] = t14;
|
|
500
|
-
$[64] = t15;
|
|
501
|
-
$[65] = t16;
|
|
502
|
-
$[66] = t17;
|
|
503
|
-
$[67] = t18;
|
|
504
|
-
$[68] = t19;
|
|
505
|
-
$[69] = t20;
|
|
506
|
-
} else {
|
|
507
|
-
t20 = $[69];
|
|
508
|
-
}
|
|
509
|
-
const menuItemProps = t20;
|
|
510
|
-
let t21;
|
|
511
|
-
if ($[70] !== _PrivateItemWrapper || $[71] !== forwardedRef || $[72] !== itemRole || $[73] !== listSemantics || $[74] !== menuItemProps || $[75] !== props) {
|
|
512
|
-
t21 = _PrivateItemWrapper ? {
|
|
513
|
-
role: itemRole ? "none" : undefined,
|
|
514
|
-
...props
|
|
515
|
-
} : listSemantics && {
|
|
516
|
-
...menuItemProps,
|
|
517
|
-
...props,
|
|
518
|
-
ref: forwardedRef
|
|
519
|
-
} || {};
|
|
520
|
-
$[70] = _PrivateItemWrapper;
|
|
521
|
-
$[71] = forwardedRef;
|
|
522
|
-
$[72] = itemRole;
|
|
523
|
-
$[73] = listSemantics;
|
|
524
|
-
$[74] = menuItemProps;
|
|
525
|
-
$[75] = props;
|
|
526
|
-
$[76] = t21;
|
|
527
|
-
} else {
|
|
528
|
-
t21 = $[76];
|
|
529
|
-
}
|
|
530
|
-
const containerProps = t21;
|
|
531
|
-
let t22;
|
|
532
|
-
if ($[77] !== _PrivateItemWrapper || $[78] !== forwardedRef || $[79] !== listSemantics || $[80] !== menuItemProps || $[81] !== props) {
|
|
533
|
-
t22 = _PrivateItemWrapper ? menuItemProps : !listSemantics && {
|
|
534
|
-
...menuItemProps,
|
|
535
|
-
...props,
|
|
536
|
-
ref: forwardedRef
|
|
537
|
-
};
|
|
538
|
-
$[77] = _PrivateItemWrapper;
|
|
539
|
-
$[78] = forwardedRef;
|
|
540
|
-
$[79] = listSemantics;
|
|
541
|
-
$[80] = menuItemProps;
|
|
542
|
-
$[81] = props;
|
|
543
|
-
$[82] = t22;
|
|
544
|
-
} else {
|
|
545
|
-
t22 = $[82];
|
|
546
|
-
}
|
|
547
|
-
const wrapperProps = t22;
|
|
548
|
-
const t23 = Boolean(inactiveText);
|
|
549
|
-
const t24 = buttonSemantics ? setTruncatedText : undefined;
|
|
550
|
-
let t25;
|
|
551
|
-
if ($[83] !== blockDescriptionId || $[84] !== disabled || $[85] !== inlineDescriptionId || $[86] !== size || $[87] !== t23 || $[88] !== t24 || $[89] !== trailingVisualId || $[90] !== variant) {
|
|
552
|
-
t25 = {
|
|
280
|
+
}),
|
|
281
|
+
role: itemRole,
|
|
282
|
+
id: itemId
|
|
283
|
+
};
|
|
284
|
+
const containerProps = _PrivateItemWrapper ? {
|
|
285
|
+
role: itemRole ? 'none' : undefined,
|
|
286
|
+
...props
|
|
287
|
+
} :
|
|
288
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
289
|
+
listSemantics && {
|
|
290
|
+
...menuItemProps,
|
|
291
|
+
...props,
|
|
292
|
+
ref: forwardedRef
|
|
293
|
+
} || {};
|
|
294
|
+
const wrapperProps = _PrivateItemWrapper ? menuItemProps : !listSemantics && {
|
|
295
|
+
...menuItemProps,
|
|
296
|
+
...props,
|
|
297
|
+
ref: forwardedRef
|
|
298
|
+
};
|
|
299
|
+
return /*#__PURE__*/jsx(ItemContext.Provider, {
|
|
300
|
+
value: {
|
|
553
301
|
variant,
|
|
554
302
|
size,
|
|
555
303
|
disabled,
|
|
556
|
-
inactive:
|
|
304
|
+
inactive: Boolean(inactiveText),
|
|
557
305
|
inlineDescriptionId,
|
|
558
306
|
blockDescriptionId,
|
|
559
307
|
trailingVisualId,
|
|
560
|
-
setTruncatedText:
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
$[84] = disabled;
|
|
564
|
-
$[85] = inlineDescriptionId;
|
|
565
|
-
$[86] = size;
|
|
566
|
-
$[87] = t23;
|
|
567
|
-
$[88] = t24;
|
|
568
|
-
$[89] = trailingVisualId;
|
|
569
|
-
$[90] = variant;
|
|
570
|
-
$[91] = t25;
|
|
571
|
-
} else {
|
|
572
|
-
t25 = $[91];
|
|
573
|
-
}
|
|
574
|
-
const itemContextValue = t25;
|
|
575
|
-
const t26 = listSemantics ? forwardedRef : null;
|
|
576
|
-
const t27 = variant === "danger" ? variant : undefined;
|
|
577
|
-
const t28 = active ? true : undefined;
|
|
578
|
-
const t29 = inactiveText ? true : undefined;
|
|
579
|
-
const t30 = disabled ? true : undefined;
|
|
580
|
-
const t31 = slots.subItem ? true : undefined;
|
|
581
|
-
const t32 = slots.description ? true : false;
|
|
582
|
-
let t33;
|
|
583
|
-
if ($[92] !== className) {
|
|
584
|
-
t33 = clsx(classes.ActionListItem, className);
|
|
585
|
-
$[92] = className;
|
|
586
|
-
$[93] = t33;
|
|
587
|
-
} else {
|
|
588
|
-
t33 = $[93];
|
|
589
|
-
}
|
|
590
|
-
let t34;
|
|
591
|
-
let t35;
|
|
592
|
-
if ($[94] === Symbol.for("react.memo_cache_sentinel")) {
|
|
593
|
-
t34 = {};
|
|
594
|
-
t35 = /*#__PURE__*/jsx("span", {
|
|
595
|
-
className: classes.Spacer
|
|
596
|
-
});
|
|
597
|
-
$[94] = t34;
|
|
598
|
-
$[95] = t35;
|
|
599
|
-
} else {
|
|
600
|
-
t34 = $[94];
|
|
601
|
-
t35 = $[95];
|
|
602
|
-
}
|
|
603
|
-
let t36;
|
|
604
|
-
if ($[96] !== selected) {
|
|
605
|
-
t36 = /*#__PURE__*/jsx(Selection, {
|
|
606
|
-
selected: selected,
|
|
607
|
-
className: classes.LeadingAction
|
|
608
|
-
});
|
|
609
|
-
$[96] = selected;
|
|
610
|
-
$[97] = t36;
|
|
611
|
-
} else {
|
|
612
|
-
t36 = $[97];
|
|
613
|
-
}
|
|
614
|
-
const t37 = showInactiveIndicator ? inactiveText : undefined;
|
|
615
|
-
const t38 = Boolean(slots.leadingVisual);
|
|
616
|
-
let t39;
|
|
617
|
-
if ($[98] !== labelId || $[99] !== loading || $[100] !== slots.leadingVisual || $[101] !== t37 || $[102] !== t38) {
|
|
618
|
-
t39 = /*#__PURE__*/jsx(VisualOrIndicator, {
|
|
619
|
-
inactiveText: t37,
|
|
620
|
-
itemHasLeadingVisual: t38,
|
|
621
|
-
labelId: labelId,
|
|
622
|
-
loading: loading,
|
|
623
|
-
position: "leading",
|
|
624
|
-
children: slots.leadingVisual
|
|
625
|
-
});
|
|
626
|
-
$[98] = labelId;
|
|
627
|
-
$[99] = loading;
|
|
628
|
-
$[100] = slots.leadingVisual;
|
|
629
|
-
$[101] = t37;
|
|
630
|
-
$[102] = t38;
|
|
631
|
-
$[103] = t39;
|
|
632
|
-
} else {
|
|
633
|
-
t39 = $[103];
|
|
634
|
-
}
|
|
635
|
-
const t40 = !!slots.description;
|
|
636
|
-
let t41;
|
|
637
|
-
if ($[104] !== inactive || $[105] !== loading) {
|
|
638
|
-
t41 = loading === true && !inactive && /*#__PURE__*/jsx(VisuallyHidden, {
|
|
639
|
-
children: "Loading"
|
|
640
|
-
});
|
|
641
|
-
$[104] = inactive;
|
|
642
|
-
$[105] = loading;
|
|
643
|
-
$[106] = t41;
|
|
644
|
-
} else {
|
|
645
|
-
t41 = $[106];
|
|
646
|
-
}
|
|
647
|
-
let t42;
|
|
648
|
-
if ($[107] !== childrenWithoutSlots || $[108] !== labelId || $[109] !== t41) {
|
|
649
|
-
t42 = /*#__PURE__*/jsxs("span", {
|
|
650
|
-
id: labelId,
|
|
651
|
-
className: classes.ItemLabel,
|
|
652
|
-
children: [childrenWithoutSlots, t41]
|
|
653
|
-
});
|
|
654
|
-
$[107] = childrenWithoutSlots;
|
|
655
|
-
$[108] = labelId;
|
|
656
|
-
$[109] = t41;
|
|
657
|
-
$[110] = t42;
|
|
658
|
-
} else {
|
|
659
|
-
t42 = $[110];
|
|
660
|
-
}
|
|
661
|
-
let t43;
|
|
662
|
-
if ($[111] !== descriptionVariant || $[112] !== slots.description || $[113] !== t40 || $[114] !== t42) {
|
|
663
|
-
t43 = /*#__PURE__*/jsxs(ConditionalWrapper, {
|
|
664
|
-
if: t40,
|
|
665
|
-
className: classes.ItemDescriptionWrap,
|
|
666
|
-
"data-description-variant": descriptionVariant,
|
|
667
|
-
children: [t42, slots.description]
|
|
668
|
-
});
|
|
669
|
-
$[111] = descriptionVariant;
|
|
670
|
-
$[112] = slots.description;
|
|
671
|
-
$[113] = t40;
|
|
672
|
-
$[114] = t42;
|
|
673
|
-
$[115] = t43;
|
|
674
|
-
} else {
|
|
675
|
-
t43 = $[115];
|
|
676
|
-
}
|
|
677
|
-
const t44 = showInactiveIndicator ? inactiveText : undefined;
|
|
678
|
-
const t45 = Boolean(slots.leadingVisual);
|
|
679
|
-
let t46;
|
|
680
|
-
if ($[116] !== labelId || $[117] !== loading || $[118] !== t44 || $[119] !== t45 || $[120] !== trailingVisual) {
|
|
681
|
-
t46 = /*#__PURE__*/jsx(VisualOrIndicator, {
|
|
682
|
-
inactiveText: t44,
|
|
683
|
-
itemHasLeadingVisual: t45,
|
|
684
|
-
labelId: labelId,
|
|
685
|
-
loading: loading,
|
|
686
|
-
position: "trailing",
|
|
687
|
-
children: trailingVisual
|
|
688
|
-
});
|
|
689
|
-
$[116] = labelId;
|
|
690
|
-
$[117] = loading;
|
|
691
|
-
$[118] = t44;
|
|
692
|
-
$[119] = t45;
|
|
693
|
-
$[120] = trailingVisual;
|
|
694
|
-
$[121] = t46;
|
|
695
|
-
} else {
|
|
696
|
-
t46 = $[121];
|
|
697
|
-
}
|
|
698
|
-
let t47;
|
|
699
|
-
if ($[122] !== inactiveText || $[123] !== inactiveWarningId || $[124] !== showInactiveIndicator) {
|
|
700
|
-
t47 = !showInactiveIndicator && inactiveText ? /*#__PURE__*/jsx("span", {
|
|
701
|
-
className: classes.InactiveWarning,
|
|
702
|
-
id: inactiveWarningId,
|
|
703
|
-
children: inactiveText
|
|
704
|
-
}) : null;
|
|
705
|
-
$[122] = inactiveText;
|
|
706
|
-
$[123] = inactiveWarningId;
|
|
707
|
-
$[124] = showInactiveIndicator;
|
|
708
|
-
$[125] = t47;
|
|
709
|
-
} else {
|
|
710
|
-
t47 = $[125];
|
|
711
|
-
}
|
|
712
|
-
let t48;
|
|
713
|
-
if ($[126] !== t43 || $[127] !== t46 || $[128] !== t47) {
|
|
714
|
-
t48 = /*#__PURE__*/jsxs("span", {
|
|
715
|
-
className: classes.ActionListSubContent,
|
|
716
|
-
"data-component": "ActionList.Item--DividerContainer",
|
|
717
|
-
children: [t43, t46, t47]
|
|
718
|
-
});
|
|
719
|
-
$[126] = t43;
|
|
720
|
-
$[127] = t46;
|
|
721
|
-
$[128] = t47;
|
|
722
|
-
$[129] = t48;
|
|
723
|
-
} else {
|
|
724
|
-
t48 = $[129];
|
|
725
|
-
}
|
|
726
|
-
let t49;
|
|
727
|
-
if ($[130] !== t36 || $[131] !== t39 || $[132] !== t48) {
|
|
728
|
-
t49 = /*#__PURE__*/jsxs(TooltipContext.Provider, {
|
|
729
|
-
value: t34,
|
|
730
|
-
children: [t35, t36, t39, t48]
|
|
731
|
-
});
|
|
732
|
-
$[130] = t36;
|
|
733
|
-
$[131] = t39;
|
|
734
|
-
$[132] = t48;
|
|
735
|
-
$[133] = t49;
|
|
736
|
-
} else {
|
|
737
|
-
t49 = $[133];
|
|
738
|
-
}
|
|
739
|
-
let t50;
|
|
740
|
-
if ($[134] !== ItemWrapper || $[135] !== forwardedRef || $[136] !== size || $[137] !== t49 || $[138] !== wrapperProps) {
|
|
741
|
-
t50 = /*#__PURE__*/jsx(ItemWrapper, {
|
|
742
|
-
...wrapperProps,
|
|
743
|
-
className: classes.ActionListContent,
|
|
744
|
-
"data-size": size,
|
|
745
|
-
ref: forwardedRef,
|
|
746
|
-
children: t49
|
|
747
|
-
});
|
|
748
|
-
$[134] = ItemWrapper;
|
|
749
|
-
$[135] = forwardedRef;
|
|
750
|
-
$[136] = size;
|
|
751
|
-
$[137] = t49;
|
|
752
|
-
$[138] = wrapperProps;
|
|
753
|
-
$[139] = t50;
|
|
754
|
-
} else {
|
|
755
|
-
t50 = $[139];
|
|
756
|
-
}
|
|
757
|
-
let t51;
|
|
758
|
-
if ($[140] !== buttonSemantics || $[141] !== forwardedRef || $[142] !== t50 || $[143] !== truncatedText) {
|
|
759
|
-
t51 = /*#__PURE__*/jsx(ConditionalTooltip, {
|
|
760
|
-
ref: forwardedRef,
|
|
761
|
-
text: truncatedText,
|
|
762
|
-
enabled: buttonSemantics,
|
|
763
|
-
children: t50
|
|
764
|
-
});
|
|
765
|
-
$[140] = buttonSemantics;
|
|
766
|
-
$[141] = forwardedRef;
|
|
767
|
-
$[142] = t50;
|
|
768
|
-
$[143] = truncatedText;
|
|
769
|
-
$[144] = t51;
|
|
770
|
-
} else {
|
|
771
|
-
t51 = $[144];
|
|
772
|
-
}
|
|
773
|
-
const t52 = !inactive && !loading && !menuContext && Boolean(slots.trailingAction) && slots.trailingAction;
|
|
774
|
-
let t53;
|
|
775
|
-
if ($[145] !== containerProps || $[146] !== slots.subItem || $[147] !== t26 || $[148] !== t27 || $[149] !== t28 || $[150] !== t29 || $[151] !== t30 || $[152] !== t31 || $[153] !== t32 || $[154] !== t33 || $[155] !== t51 || $[156] !== t52) {
|
|
776
|
-
t53 = /*#__PURE__*/jsxs("li", {
|
|
308
|
+
setTruncatedText: buttonSemantics ? setTruncatedText : undefined
|
|
309
|
+
},
|
|
310
|
+
children: /*#__PURE__*/jsxs("li", {
|
|
777
311
|
...containerProps,
|
|
778
|
-
ref:
|
|
779
|
-
"data-variant":
|
|
780
|
-
"data-active":
|
|
781
|
-
"data-inactive":
|
|
782
|
-
"data-is-disabled":
|
|
783
|
-
"data-has-subitem":
|
|
784
|
-
"data-has-description":
|
|
785
|
-
className:
|
|
786
|
-
children: [
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
312
|
+
ref: listSemantics ? forwardedRef : null,
|
|
313
|
+
"data-variant": variant === 'danger' ? variant : undefined,
|
|
314
|
+
"data-active": active ? true : undefined,
|
|
315
|
+
"data-inactive": inactiveText ? true : undefined,
|
|
316
|
+
"data-is-disabled": disabled ? true : undefined,
|
|
317
|
+
"data-has-subitem": slots.subItem ? true : undefined,
|
|
318
|
+
"data-has-description": slots.description ? true : false,
|
|
319
|
+
className: clsx(classes.ActionListItem, className),
|
|
320
|
+
children: [/*#__PURE__*/jsx(ConditionalTooltip, {
|
|
321
|
+
ref: forwardedRef,
|
|
322
|
+
text: truncatedText,
|
|
323
|
+
enabled: buttonSemantics,
|
|
324
|
+
children: /*#__PURE__*/jsx(ItemWrapper, {
|
|
325
|
+
...wrapperProps,
|
|
326
|
+
className: classes.ActionListContent,
|
|
327
|
+
"data-size": size
|
|
328
|
+
// @ts-ignore: ItemWrapper is polymorphic and the ref type depends on the rendered element ('button' or 'li')
|
|
329
|
+
,
|
|
330
|
+
ref: forwardedRef,
|
|
331
|
+
children: /*#__PURE__*/jsxs(TooltipContext.Provider, {
|
|
332
|
+
value: {},
|
|
333
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
334
|
+
className: classes.Spacer
|
|
335
|
+
}), /*#__PURE__*/jsx(Selection, {
|
|
336
|
+
selected: selected,
|
|
337
|
+
className: classes.LeadingAction
|
|
338
|
+
}), /*#__PURE__*/jsx(VisualOrIndicator, {
|
|
339
|
+
inactiveText: showInactiveIndicator ? inactiveText : undefined,
|
|
340
|
+
itemHasLeadingVisual: Boolean(slots.leadingVisual),
|
|
341
|
+
labelId: labelId,
|
|
342
|
+
loading: loading,
|
|
343
|
+
position: "leading",
|
|
344
|
+
children: slots.leadingVisual
|
|
345
|
+
}), /*#__PURE__*/jsxs("span", {
|
|
346
|
+
className: classes.ActionListSubContent,
|
|
347
|
+
"data-component": "ActionList.Item--DividerContainer",
|
|
348
|
+
children: [/*#__PURE__*/jsxs(ConditionalWrapper, {
|
|
349
|
+
if: !!slots.description,
|
|
350
|
+
className: classes.ItemDescriptionWrap,
|
|
351
|
+
"data-description-variant": descriptionVariant,
|
|
352
|
+
children: [/*#__PURE__*/jsxs("span", {
|
|
353
|
+
id: labelId,
|
|
354
|
+
className: classes.ItemLabel,
|
|
355
|
+
children: [childrenWithoutSlots, loading === true && !inactive && /*#__PURE__*/jsx(VisuallyHidden, {
|
|
356
|
+
children: "Loading"
|
|
357
|
+
})]
|
|
358
|
+
}), slots.description]
|
|
359
|
+
}), /*#__PURE__*/jsx(VisualOrIndicator, {
|
|
360
|
+
inactiveText: showInactiveIndicator ? inactiveText : undefined,
|
|
361
|
+
itemHasLeadingVisual: Boolean(slots.leadingVisual),
|
|
362
|
+
labelId: labelId,
|
|
363
|
+
loading: loading,
|
|
364
|
+
position: "trailing",
|
|
365
|
+
children: trailingVisual
|
|
366
|
+
}),
|
|
367
|
+
// If the item is inactive, but it's not in an overlay (e.g. ActionMenu, SelectPanel),
|
|
368
|
+
// render the inactive warning message directly in the item.
|
|
369
|
+
!showInactiveIndicator && inactiveText ? /*#__PURE__*/jsx("span", {
|
|
370
|
+
className: classes.InactiveWarning,
|
|
371
|
+
id: inactiveWarningId,
|
|
372
|
+
children: inactiveText
|
|
373
|
+
}) : null]
|
|
374
|
+
})]
|
|
375
|
+
})
|
|
376
|
+
})
|
|
377
|
+
}), !inactive && !loading && !menuContext && Boolean(slots.trailingAction) && slots.trailingAction, slots.subItem]
|
|
378
|
+
})
|
|
379
|
+
});
|
|
817
380
|
};
|
|
381
|
+
UnwrappedItem.displayName = "UnwrappedItem";
|
|
818
382
|
const Item = Object.assign(fixedForwardRef(UnwrappedItem), {
|
|
819
383
|
displayName: 'ActionList.Item',
|
|
820
384
|
__SLOT__: Symbol('ActionList.Item')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../src/ActionList/List.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../src/ActionList/List.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAA;AAoFrC,QAAA,MAAM,IAAI,GAxEa,EAAE,SAAS,KAAK,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;oDAwER,CAAA;AAI3C,OAAO,EAAC,IAAI,EAAC,CAAA"}
|
package/dist/ActionList/List.js
CHANGED
|
@@ -131,7 +131,6 @@ const UnwrappedList = (props, forwardedRef) => {
|
|
|
131
131
|
} else {
|
|
132
132
|
t9 = $[20];
|
|
133
133
|
}
|
|
134
|
-
const listContextValue = t9;
|
|
135
134
|
const t10 = slots.heading;
|
|
136
135
|
let t11;
|
|
137
136
|
if ($[21] !== className) {
|
|
@@ -167,14 +166,14 @@ const UnwrappedList = (props, forwardedRef) => {
|
|
|
167
166
|
t12 = $[32];
|
|
168
167
|
}
|
|
169
168
|
let t13;
|
|
170
|
-
if ($[33] !==
|
|
169
|
+
if ($[33] !== slots.heading || $[34] !== t12 || $[35] !== t9) {
|
|
171
170
|
t13 = /*#__PURE__*/jsxs(ListContext.Provider, {
|
|
172
|
-
value:
|
|
171
|
+
value: t9,
|
|
173
172
|
children: [t10, t12]
|
|
174
173
|
});
|
|
175
|
-
$[33] =
|
|
176
|
-
$[34] =
|
|
177
|
-
$[35] =
|
|
174
|
+
$[33] = slots.heading;
|
|
175
|
+
$[34] = t12;
|
|
176
|
+
$[35] = t9;
|
|
178
177
|
$[36] = t13;
|
|
179
178
|
} else {
|
|
180
179
|
t13 = $[36];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@property --prc-dialog-scrollgutter{initial-value:0;inherits:false;syntax:"<length>"}@keyframes prc-Dialog-dialog-backdrop-appear-tCG2K{0%{opacity:0}to{opacity:1}}@keyframes prc-Dialog-Overlay--motion-scaleFade-mE6-C{0%{opacity:0;transform:scale(.5)}to{opacity:1;transform:scale(1)}}@keyframes prc-Dialog-Overlay--motion-slideUp-tPElO{0%{transform:translateY(100%)}}@keyframes prc-Dialog-Overlay--motion-slideInRight-BR-CZ{0%{transform:translateX(-100%)}}@keyframes prc-Dialog-Overlay--motion-slideInLeft-ISmQZ{0%{transform:translateX(100%)}}@keyframes prc-Dialog-detect-scroll-b3i8Q{0%,to{--can-scroll:1}}.prc-Dialog-Backdrop-5Nt2U{animation:prc-Dialog-dialog-backdrop-appear-tCG2K .2s cubic-bezier(.33,1,.68,1);background-color:var(--overlay-backdrop-bgColor,var(--color-overlay-backdrop));bottom:0;display:flex;left:0;position:fixed;right:0;top:0}.prc-Dialog-Backdrop-5Nt2U,.prc-Dialog-Backdrop-5Nt2U[data-position-regular=center]{align-items:center;justify-content:center}.prc-Dialog-Backdrop-5Nt2U[data-position-regular=left]{align-items:center;justify-content:flex-start}.prc-Dialog-Backdrop-5Nt2U[data-position-regular=right]{align-items:center;justify-content:flex-end}.prc-Dialog-Backdrop-5Nt2U[data-align=top]:where(:not([data-position-regular=left]):not([data-position-regular=right])){align-items:flex-start}.prc-Dialog-Backdrop-5Nt2U[data-align=center]:where(:not([data-position-regular=left]):not([data-position-regular=right])){align-items:center}.prc-Dialog-Backdrop-5Nt2U[data-align=bottom]:where(:not([data-position-regular=left]):not([data-position-regular=right])){align-items:flex-end}@media (max-width:767px){.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=center]{align-items:center;justify-content:center}.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=center][data-align=top]{align-items:flex-start}.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=center][data-align=center]{align-items:center}.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=center][data-align=bottom]{align-items:flex-end}.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=bottom]{align-items:end;justify-content:center}}.prc-Dialog-Dialog-G8cDF{background-color:var(--overlay-bgColor,var(--color-canvas-overlay));border-radius:var(--borderRadius-large,.75rem);border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));box-shadow:var(--shadow-floating-small,var(--color-overlay-shadow));display:flex;flex-direction:column;height:auto;max-height:calc(100dvh - 64px);max-width:calc(100dvw - 64px);min-width:296px;opacity:1;width:640px}.prc-Dialog-Dialog-G8cDF:where([data-width=small]){width:296px}.prc-Dialog-Dialog-G8cDF:where([data-width=medium]){width:320px}.prc-Dialog-Dialog-G8cDF:where([data-width=large]){width:480px}.prc-Dialog-Dialog-G8cDF:where([data-height=small]){height:480px}.prc-Dialog-Dialog-G8cDF:where([data-height=large]){height:640px}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF{animation:prc-Dialog-Overlay--motion-scaleFade-mE6-C .2s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-regular=center]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem))}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-regular=center]{animation:prc-Dialog-Overlay--motion-scaleFade-mE6-C .2s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-regular=center][data-align=top]{margin-top:var(--base-size-64,4rem)}.prc-Dialog-Dialog-G8cDF[data-position-regular=center][data-align=bottom]{margin-bottom:var(--base-size-64,4rem)}.prc-Dialog-Dialog-G8cDF[data-position-regular=left]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));border-bottom-left-radius:0;border-top-left-radius:0;height:100dvh;max-height:unset}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-regular=left]{animation:prc-Dialog-Overlay--motion-slideInRight-BR-CZ .25s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-regular=right]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));border-bottom-right-radius:0;border-top-right-radius:0;height:100dvh;max-height:unset}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-regular=right]{animation:prc-Dialog-Overlay--motion-slideInLeft-ISmQZ .25s cubic-bezier(.33,1,.68,1) 0s 1 normal none running}}@media (max-width:767px){.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));height:auto;width:640px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-width=small]){width:296px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-width=medium]){width:320px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-width=large]){width:480px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-height=small]){height:480px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-height=large]){height:640px}@media (max-height:280px){.prc-Dialog-Dialog-G8cDF{max-height:calc(100dvh - 12px);max-width:calc(100dvw - 12px)}}.prc-Dialog-Dialog-G8cDF[data-position-narrow=bottom]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));border-bottom-left-radius:0;border-bottom-right-radius:0;height:auto;max-height:calc(100dvh - 64px);max-width:100dvw;width:100dvw}.prc-Dialog-Dialog-G8cDF[data-position-narrow=bottom][data-align]{margin-bottom:0;margin-top:0}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-narrow=bottom]{animation:prc-Dialog-Overlay--motion-slideUp-tPElO .25s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-narrow=fullscreen]{border-radius:unset!important;flex-grow:1;height:100%;max-height:100dvh;max-width:100dvw;width:100%}.prc-Dialog-Dialog-G8cDF[data-position-narrow=fullscreen][data-align]{margin-bottom:0;margin-top:0}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-narrow=fullscreen]{animation:prc-Dialog-Overlay--motion-scaleFade-mE6-C .2s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}}body:not([data-dialog-scroll-optimized]):has(.prc-Dialog-Dialog-G8cDF.prc-Dialog-DisableScroll-UkWFM){overflow:hidden!important;padding-right:var(--prc-dialog-scrollgutter)!important}body[data-dialog-scroll-disabled]{overflow:hidden!important;padding-right:var(--prc-dialog-scrollgutter)!important}.prc-Dialog-DialogOverflowWrapper-JvHzz{flex-grow:1}.prc-Dialog-Dialog-G8cDF
|
|
2
|
-
/*# sourceMappingURL=Dialog-
|
|
1
|
+
@property --prc-dialog-scrollgutter{initial-value:0;inherits:false;syntax:"<length>"}@keyframes prc-Dialog-dialog-backdrop-appear-tCG2K{0%{opacity:0}to{opacity:1}}@keyframes prc-Dialog-Overlay--motion-scaleFade-mE6-C{0%{opacity:0;transform:scale(.5)}to{opacity:1;transform:scale(1)}}@keyframes prc-Dialog-Overlay--motion-slideUp-tPElO{0%{transform:translateY(100%)}}@keyframes prc-Dialog-Overlay--motion-slideInRight-BR-CZ{0%{transform:translateX(-100%)}}@keyframes prc-Dialog-Overlay--motion-slideInLeft-ISmQZ{0%{transform:translateX(100%)}}@keyframes prc-Dialog-detect-scroll-b3i8Q{0%,to{--can-scroll:1}}.prc-Dialog-Backdrop-5Nt2U{animation:prc-Dialog-dialog-backdrop-appear-tCG2K .2s cubic-bezier(.33,1,.68,1);background-color:var(--overlay-backdrop-bgColor,var(--color-overlay-backdrop));bottom:0;display:flex;left:0;position:fixed;right:0;top:0}.prc-Dialog-Backdrop-5Nt2U,.prc-Dialog-Backdrop-5Nt2U[data-position-regular=center]{align-items:center;justify-content:center}.prc-Dialog-Backdrop-5Nt2U[data-position-regular=left]{align-items:center;justify-content:flex-start}.prc-Dialog-Backdrop-5Nt2U[data-position-regular=right]{align-items:center;justify-content:flex-end}.prc-Dialog-Backdrop-5Nt2U[data-align=top]:where(:not([data-position-regular=left]):not([data-position-regular=right])){align-items:flex-start}.prc-Dialog-Backdrop-5Nt2U[data-align=center]:where(:not([data-position-regular=left]):not([data-position-regular=right])){align-items:center}.prc-Dialog-Backdrop-5Nt2U[data-align=bottom]:where(:not([data-position-regular=left]):not([data-position-regular=right])){align-items:flex-end}@media (max-width:767px){.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=center]{align-items:center;justify-content:center}.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=center][data-align=top]{align-items:flex-start}.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=center][data-align=center]{align-items:center}.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=center][data-align=bottom]{align-items:flex-end}.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=bottom]{align-items:end;justify-content:center}}.prc-Dialog-Dialog-G8cDF{background-color:var(--overlay-bgColor,var(--color-canvas-overlay));border-radius:var(--borderRadius-large,.75rem);border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));box-shadow:var(--shadow-floating-small,var(--color-overlay-shadow));display:flex;flex-direction:column;height:auto;max-height:calc(100dvh - 64px);max-width:calc(100dvw - 64px);min-width:296px;opacity:1;width:640px}.prc-Dialog-Dialog-G8cDF:where([data-width=small]){width:296px}.prc-Dialog-Dialog-G8cDF:where([data-width=medium]){width:320px}.prc-Dialog-Dialog-G8cDF:where([data-width=large]){width:480px}.prc-Dialog-Dialog-G8cDF:where([data-height=small]){height:480px}.prc-Dialog-Dialog-G8cDF:where([data-height=large]){height:640px}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF{animation:prc-Dialog-Overlay--motion-scaleFade-mE6-C .2s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-regular=center]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem))}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-regular=center]{animation:prc-Dialog-Overlay--motion-scaleFade-mE6-C .2s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-regular=center][data-align=top]{margin-top:var(--base-size-64,4rem)}.prc-Dialog-Dialog-G8cDF[data-position-regular=center][data-align=bottom]{margin-bottom:var(--base-size-64,4rem)}.prc-Dialog-Dialog-G8cDF[data-position-regular=left]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));border-bottom-left-radius:0;border-top-left-radius:0;height:100dvh;max-height:unset}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-regular=left]{animation:prc-Dialog-Overlay--motion-slideInRight-BR-CZ .25s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-regular=right]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));border-bottom-right-radius:0;border-top-right-radius:0;height:100dvh;max-height:unset}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-regular=right]{animation:prc-Dialog-Overlay--motion-slideInLeft-ISmQZ .25s cubic-bezier(.33,1,.68,1) 0s 1 normal none running}}@media (max-width:767px){.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));height:auto;width:640px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-width=small]){width:296px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-width=medium]){width:320px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-width=large]){width:480px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-height=small]){height:480px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-height=large]){height:640px}@media (max-height:280px){.prc-Dialog-Dialog-G8cDF{max-height:calc(100dvh - 12px);max-width:calc(100dvw - 12px)}}.prc-Dialog-Dialog-G8cDF[data-position-narrow=bottom]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));border-bottom-left-radius:0;border-bottom-right-radius:0;height:auto;max-height:calc(100dvh - 64px);max-width:100dvw;width:100dvw}.prc-Dialog-Dialog-G8cDF[data-position-narrow=bottom][data-align]{margin-bottom:0;margin-top:0}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-narrow=bottom]{animation:prc-Dialog-Overlay--motion-slideUp-tPElO .25s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-narrow=fullscreen]{border-radius:unset!important;flex-grow:1;height:100%;max-height:100dvh;max-width:100dvw;width:100%}.prc-Dialog-Dialog-G8cDF[data-position-narrow=fullscreen][data-align]{margin-bottom:0;margin-top:0}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-narrow=fullscreen]{animation:prc-Dialog-Overlay--motion-scaleFade-mE6-C .2s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}}body:not([data-dialog-scroll-optimized]):has(.prc-Dialog-Dialog-G8cDF.prc-Dialog-DisableScroll-UkWFM){overflow:hidden!important;padding-right:var(--prc-dialog-scrollgutter)!important}body[data-dialog-scroll-disabled]{overflow:hidden!important;padding-right:var(--prc-dialog-scrollgutter)!important}.prc-Dialog-DialogOverflowWrapper-JvHzz{flex-grow:1}.prc-Dialog-Dialog-G8cDF[data-has-footer]{--can-scroll:0}.prc-Dialog-Dialog-G8cDF[data-has-footer] .prc-Dialog-DialogOverflowWrapper-JvHzz{animation:prc-Dialog-detect-scroll-b3i8Q;border-bottom:var(--borderWidth-default,.0625rem) solid var(--borderColor-default,var(--color-border-default));animation-timeline:scroll(self)}@supports (animation-timeline:scroll(self)){.prc-Dialog-Dialog-G8cDF[data-has-footer] .prc-Dialog-DialogOverflowWrapper-JvHzz{border-bottom:calc(var(--borderWidth-thin,.0625rem)*var(--can-scroll)) solid var(--borderColor-default,var(--color-border-default))}}.prc-Dialog-Header-f7Me-{box-shadow:0 1px 0 var(--borderColor-default,var(--color-border-default));flex-shrink:0;max-height:35vh;overflow-y:auto;padding:var(--base-size-8,.5rem);z-index:1}.prc-Dialog-HeaderInner-H-fFY{display:flex}.prc-Dialog-HeaderContent-mjAsn{display:flex;flex-direction:column;flex-grow:1;padding-block:var(--base-size-6,.375rem);padding-inline:var(--base-size-8,.5rem)}.prc-Dialog-Title-M-iPn{font-size:var(--text-body-size-medium,.875rem);font-weight:var(--text-title-weight-large,600);margin:0}.prc-Dialog-Subtitle-aBFSq{color:var(--fgColor-muted,var(--color-fg-muted));font-size:var(--text-body-size-small,.75rem);font-weight:var(--base-text-weight-normal,400);margin:0;margin-top:var(--base-size-4,.25rem)}.prc-Dialog-Body-bB903{flex-grow:1;overflow:auto}.prc-Dialog-Body-bB903,.prc-Dialog-Footer-PMeQk{padding:var(--base-size-16,1rem)}.prc-Dialog-Footer-PMeQk{display:flex;flex-flow:wrap;flex-shrink:0;gap:var(--base-size-8,.5rem);justify-content:flex-end;z-index:1}@media (max-height:325px){.prc-Dialog-Footer-PMeQk{flex-direction:row;flex-wrap:nowrap;justify-content:unset;overflow-x:scroll}}
|
|
2
|
+
/*# sourceMappingURL=Dialog-2de477b3.css.map */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Dialog/Dialog.module.css.js"],"names":[],"mappings":"AAOA,oCACE,eAAgB,CAChB,cAAe,CACf,iBACF,CAEA,mDACE,GACE,SACF,CAEA,GACE,SACF,CACF,CAEA,sDACE,GACE,SAAU,CACV,mBACF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F,CAEA,gFAEE,WACF,CAEA,iFACE,YACF,CAEA,iFACE,YACF,CAGF,0BA9GJ,yBA+GM,8BAA+B,CAC/B,6BA0CN,CAzCI,CAEA,sDAKE,wEAAmE,CAEnE,2BAA4B,CAD5B,4BAA6B,CAH7B,WAAY,CACZ,8BAA+B,CAF/B,gBAAiB,CADjB,YAiBF,CARE,kEAEE,eAAgB,CADhB,YAEF,CAEA,yDAfF,sDAgBI,2GAEJ,CADE,CAGF,0DAKE,6BAA+B,CAC/B,WAAY,CAHZ,WAAY,CACZ,iBAAkB,CAFlB,gBAAiB,CADjB,UAgBF,CARE,sEAEE,eAAgB,CADhB,YAEF,CAEA,yDAdF,0DAeI,4GAEJ,CADE,CAEJ,CAeF,sGAGE,yBAA2B,CAD3B,sDAEF,CAOA,kCAGE,yBAA2B,CAD3B,sDAEF,CAEA,wCACE,WACF,CAQA,uDACE,cAYF,CAVE,+FAGE,wCAAwB,CADxB,8GAA0E,CAE1E,+BAKF,CAHE,4CANF,+FAOI,mIAEJ,CADE,CAIJ,yBAME,yEAA8C,CAC9C,aAAc,CALd,eAAgB,CAEhB,eAAgB,CADhB,gCAA2B,CAF3B,SAOF,CAEA,8BACE,YACF,CAEA,gCACE,YAAa,CAGb,qBAAsB,CACtB,WAAY,CAFZ,wCAAiC,CADjC,uCAIF,CAEA,wBAEE,8CAAuC,CACvC,8CAA2C,CAF3C,QAGF,CAEA,2BAKE,gDAA2B,CAF3B,4CAAsC,CACtC,8CAA2C,CAH3C,QAAS,CACT,oCAIF,CAEA,uBAGE,WAAY,CADZ,aAEF,CAEA,gDALE,gCAoBF,CAfA,yBAEE,YAAa,CACb,cAAe,CAIf,aAAc,CADd,4BAAuB,CAFvB,wBAAyB,CAHzB,SAcF,CANE,0BATF,yBAYI,kBAAmB,CAFnB,gBAAiB,CAGjB,qBAAsB,CAFtB,iBAIJ,CADE","file":"Dialog-2d417a89.css","sourcesContent":["/* The --prc-dialog-scrollgutter property is used only on the body element to\n * simulate scrollbar-gutter:stable. This property is not and should not\n * be used elsewhere in the DOM. There is a performance penalty to\n * setting inherited properties which can cause a large style recalc to\n * occur, so it benefits us to prevent inheritance for this property.\n * See https://web.dev/blog/at-property-performance\n */\n@property --prc-dialog-scrollgutter {\n initial-value: 0;\n inherits: false;\n syntax: '<length>';\n}\n\n@keyframes dialog-backdrop-appear {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n@keyframes Overlay--motion-scaleFade {\n 0% {\n opacity: 0;\n transform: scale(0.5);\n }\n\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n}\n\n@keyframes Overlay--motion-slideUp {\n from {\n transform: translateY(100%);\n }\n}\n\n@keyframes Overlay--motion-slideInRight {\n from {\n transform: translateX(-100%);\n }\n}\n\n@keyframes Overlay--motion-slideInLeft {\n from {\n transform: translateX(100%);\n }\n}\n\n/* Used to determine whether there should be a border between the body and footer */\n@keyframes detect-scroll {\n from,\n to {\n --can-scroll: 1;\n }\n}\n\n.Backdrop {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n display: flex;\n background-color: var(--overlay-backdrop-bgColor);\n animation: dialog-backdrop-appear 200ms cubic-bezier(0.33, 1, 0.68, 1);\n align-items: center;\n justify-content: center;\n\n &[data-position-regular='center'] {\n align-items: center;\n justify-content: center;\n }\n\n &[data-position-regular='left'] {\n align-items: center;\n justify-content: flex-start;\n }\n\n &[data-position-regular='right'] {\n align-items: center;\n justify-content: flex-end;\n }\n\n /* align only applies when regular position is center (or absent).\n * :where() zeroes out the :not() specificity so narrow-position rules (coming later)\n * always win when data-position-narrow is bottom or fullscreen. */\n &:where(:not([data-position-regular='left']):not([data-position-regular='right'])) {\n &[data-align='top'] {\n align-items: flex-start;\n }\n\n &[data-align='center'] {\n align-items: center;\n }\n\n &[data-align='bottom'] {\n align-items: flex-end;\n }\n }\n\n @media (max-width: 767px) {\n &[data-position-narrow='center'] {\n align-items: center;\n justify-content: center;\n\n /* align still applies when narrow position is center */\n &[data-align='top'] {\n align-items: flex-start;\n }\n\n &[data-align='center'] {\n align-items: center;\n }\n\n &[data-align='bottom'] {\n align-items: flex-end;\n }\n }\n\n &[data-position-narrow='bottom'] {\n align-items: end;\n justify-content: center;\n }\n }\n}\n\n.Dialog {\n display: flex;\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 640px;\n min-width: 296px;\n max-width: calc(100dvw - 64px);\n height: auto;\n max-height: calc(100dvh - 64px);\n flex-direction: column;\n background-color: var(--overlay-bgColor);\n border-radius: var(--borderRadius-large);\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n box-shadow: var(--shadow-floating-small);\n opacity: 1;\n\n &:where([data-width='small']) {\n width: 296px;\n }\n\n &:where([data-width='medium']) {\n width: 320px;\n }\n\n &:where([data-width='large']) {\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 480px;\n }\n\n &:where([data-height='small']) {\n height: 480px;\n }\n\n &:where([data-height='large']) {\n height: 640px;\n }\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-scaleFade 0.2s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n\n &[data-position-regular='center'] {\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-scaleFade 0.2s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n\n /* align margins only apply when regular position is center */\n &[data-align='top'] {\n margin-top: var(--base-size-64);\n }\n\n &[data-align='bottom'] {\n margin-bottom: var(--base-size-64);\n }\n }\n\n &[data-position-regular='left'] {\n height: 100dvh;\n max-height: unset;\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-slideInRight 0.25s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n }\n\n &[data-position-regular='right'] {\n height: 100dvh;\n max-height: unset;\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-slideInLeft 0.25s cubic-bezier(0.33, 1, 0.68, 1) 0s 1 normal none running;\n }\n }\n\n @media (max-width: 767px) {\n &[data-position-narrow='center'] {\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 640px;\n height: auto;\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n\n &:where([data-width='small']) {\n width: 296px;\n }\n\n &:where([data-width='medium']) {\n width: 320px;\n }\n\n &:where([data-width='large']) {\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 480px;\n }\n\n &:where([data-height='small']) {\n height: 480px;\n }\n\n &:where([data-height='large']) {\n height: 640px;\n }\n }\n\n @media (max-height: 280px) {\n max-height: calc(100dvh - 12px);\n max-width: calc(100dvw - 12px);\n }\n\n &[data-position-narrow='bottom'] {\n width: 100dvw;\n max-width: 100dvw;\n height: auto;\n max-height: calc(100dvh - 64px);\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n\n /* reset align margins since position wins at narrow */\n &[data-align] {\n margin-top: 0;\n margin-bottom: 0;\n }\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-slideUp 0.25s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n }\n\n &[data-position-narrow='fullscreen'] {\n width: 100%;\n max-width: 100dvw;\n height: 100%;\n max-height: 100dvh;\n border-radius: unset !important;\n flex-grow: 1;\n\n /* reset align margins since fullscreen wins at narrow */\n &[data-align] {\n margin-top: 0;\n margin-bottom: 0;\n }\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-scaleFade 0.2s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n }\n }\n}\n\n/* DisableScroll class is added to Dialog when scroll should be disabled on body */\n.DisableScroll {\n /* This class is used as a selector target for the legacy :has() CSS selector */\n}\n\n/*\n * LEGACY: Scoped :has() selector with negation guard\n * Only evaluates when data-dialog-scroll-optimized is NOT present on body.\n * When the attribute IS present (flag ON), browser skips :has() evaluation\n * because the :not() check fails first (O(1) attribute lookup).\n */\n/* stylelint-disable-next-line selector-no-qualifying-type */\nbody:not([data-dialog-scroll-optimized]):has(.Dialog.DisableScroll) {\n /* stylelint-disable-next-line primer/spacing */\n padding-right: var(--prc-dialog-scrollgutter) !important;\n overflow: hidden !important;\n}\n\n/*\n * PERFORMANCE OPTIMIZATION: Direct attribute on body - O(1) lookup\n * Active when primer_react_css_has_selector_perf flag is ON\n */\n/* stylelint-disable-next-line selector-no-qualifying-type */\nbody[data-dialog-scroll-disabled] {\n /* stylelint-disable-next-line primer/spacing */\n padding-right: var(--prc-dialog-scrollgutter) !important;\n overflow: hidden !important;\n}\n\n.DialogOverflowWrapper {\n flex-grow: 1;\n}\n\n/*\nAdd a border between the body and footer if:\n- the dialog has a footer\n- the dialog has a body that can scroll\n- the browser supports the `animation-timeline` property and its `scroll()` function\n*/\n.Dialog:has(.Footer) {\n --can-scroll: 0;\n\n .DialogOverflowWrapper {\n /* If the browser does not support the `animation-timeline` property, always show a border */\n border-bottom: var(--borderWidth-default) solid var(--borderColor-default);\n animation: detect-scroll;\n animation-timeline: scroll(self);\n\n @supports (animation-timeline: scroll(self)) {\n border-bottom: calc(var(--borderWidth-thin) * var(--can-scroll)) solid var(--borderColor-default);\n }\n }\n}\n\n.Header {\n z-index: 1;\n max-height: 35vh;\n padding: var(--base-size-8);\n overflow-y: auto;\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: 0 1px 0 var(--borderColor-default);\n flex-shrink: 0;\n}\n\n.HeaderInner {\n display: flex;\n}\n\n.HeaderContent {\n display: flex;\n padding-inline: var(--base-size-8);\n padding-block: var(--base-size-6);\n flex-direction: column;\n flex-grow: 1;\n}\n\n.Title {\n margin: 0; /* override default margin */\n font-size: var(--text-body-size-medium);\n font-weight: var(--text-title-weight-large);\n}\n\n.Subtitle {\n margin: 0; /* override default margin */\n margin-top: var(--base-size-4);\n font-size: var(--text-body-size-small);\n font-weight: var(--base-text-weight-normal);\n color: var(--fgColor-muted);\n}\n\n.Body {\n padding: var(--base-size-16);\n overflow: auto;\n flex-grow: 1;\n}\n\n.Footer {\n z-index: 1;\n display: flex;\n flex-flow: wrap;\n justify-content: flex-end;\n padding: var(--base-size-16);\n gap: var(--base-size-8);\n flex-shrink: 0;\n\n @media (max-height: 325px) {\n flex-wrap: nowrap;\n overflow-x: scroll;\n flex-direction: row;\n justify-content: unset;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/Dialog/Dialog.module.css.js"],"names":[],"mappings":"AAOA,oCACE,eAAgB,CAChB,cAAe,CACf,iBACF,CAEA,mDACE,GACE,SACF,CAEA,GACE,SACF,CACF,CAEA,sDACE,GACE,SAAU,CACV,mBACF,CAEA,GACE,SAAU,CACV,kBACF,CACF,CAEA,oDACE,GACE,0BACF,CACF,CAEA,yDACE,GACE,2BACF,CACF,CAEA,wDACE,GACE,0BACF,CACF,CAGA,0CACE,MAEE,cACF,CACF,CAEA,2BAQE,+EAAsE,CADtE,8EAAiD,CAHjD,QAAS,CAET,YAAa,CADb,MAAO,CAJP,cAAe,CAEf,OAAQ,CADR,KAkEF,CAxDE,oFAHA,kBAAmB,CACnB,sBAKA,CAEA,uDACE,kBAAmB,CACnB,0BACF,CAEA,wDACE,kBAAmB,CACnB,wBACF,CAME,wHACE,sBACF,CAEA,2HACE,kBACF,CAEA,2HACE,oBACF,CAGF,yBACE,wDACE,kBAAmB,CACnB,sBAcF,CAXE,wEACE,sBACF,CAEA,2EACE,kBACF,CAEA,2EACE,oBACF,CAGF,wDACE,eAAgB,CAChB,sBACF,CACF,CAGF,yBASE,mEAAwC,CACxC,8CAAwC,CACxC,wEAAmE,CACnE,mEAAwC,CAXxC,YAAa,CAOb,qBAAsB,CAFtB,WAAY,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IJ,yBAME,yEAA8C,CAC9C,aAAc,CALd,eAAgB,CAEhB,eAAgB,CADhB,gCAA2B,CAF3B,SAOF,CAEA,8BACE,YACF,CAEA,gCACE,YAAa,CAGb,qBAAsB,CACtB,WAAY,CAFZ,wCAAiC,CADjC,uCAIF,CAEA,wBAEE,8CAAuC,CACvC,8CAA2C,CAF3C,QAGF,CAEA,2BAKE,gDAA2B,CAF3B,4CAAsC,CACtC,8CAA2C,CAH3C,QAAS,CACT,oCAIF,CAEA,uBAGE,WAAY,CADZ,aAEF,CAEA,gDALE,gCAoBF,CAfA,yBAEE,YAAa,CACb,cAAe,CAIf,aAAc,CADd,4BAAuB,CAFvB,wBAAyB,CAHzB,SAcF,CANE,0BATF,yBAYI,kBAAmB,CAFnB,gBAAiB,CAGjB,qBAAsB,CAFtB,iBAIJ,CADE","file":"Dialog-2de477b3.css","sourcesContent":["/* The --prc-dialog-scrollgutter property is used only on the body element to\n * simulate scrollbar-gutter:stable. This property is not and should not\n * be used elsewhere in the DOM. There is a performance penalty to\n * setting inherited properties which can cause a large style recalc to\n * occur, so it benefits us to prevent inheritance for this property.\n * See https://web.dev/blog/at-property-performance\n */\n@property --prc-dialog-scrollgutter {\n initial-value: 0;\n inherits: false;\n syntax: '<length>';\n}\n\n@keyframes dialog-backdrop-appear {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n@keyframes Overlay--motion-scaleFade {\n 0% {\n opacity: 0;\n transform: scale(0.5);\n }\n\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n}\n\n@keyframes Overlay--motion-slideUp {\n from {\n transform: translateY(100%);\n }\n}\n\n@keyframes Overlay--motion-slideInRight {\n from {\n transform: translateX(-100%);\n }\n}\n\n@keyframes Overlay--motion-slideInLeft {\n from {\n transform: translateX(100%);\n }\n}\n\n/* Used to determine whether there should be a border between the body and footer */\n@keyframes detect-scroll {\n from,\n to {\n --can-scroll: 1;\n }\n}\n\n.Backdrop {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n display: flex;\n background-color: var(--overlay-backdrop-bgColor);\n animation: dialog-backdrop-appear 200ms cubic-bezier(0.33, 1, 0.68, 1);\n align-items: center;\n justify-content: center;\n\n &[data-position-regular='center'] {\n align-items: center;\n justify-content: center;\n }\n\n &[data-position-regular='left'] {\n align-items: center;\n justify-content: flex-start;\n }\n\n &[data-position-regular='right'] {\n align-items: center;\n justify-content: flex-end;\n }\n\n /* align only applies when regular position is center (or absent).\n * :where() zeroes out the :not() specificity so narrow-position rules (coming later)\n * always win when data-position-narrow is bottom or fullscreen. */\n &:where(:not([data-position-regular='left']):not([data-position-regular='right'])) {\n &[data-align='top'] {\n align-items: flex-start;\n }\n\n &[data-align='center'] {\n align-items: center;\n }\n\n &[data-align='bottom'] {\n align-items: flex-end;\n }\n }\n\n @media (max-width: 767px) {\n &[data-position-narrow='center'] {\n align-items: center;\n justify-content: center;\n\n /* align still applies when narrow position is center */\n &[data-align='top'] {\n align-items: flex-start;\n }\n\n &[data-align='center'] {\n align-items: center;\n }\n\n &[data-align='bottom'] {\n align-items: flex-end;\n }\n }\n\n &[data-position-narrow='bottom'] {\n align-items: end;\n justify-content: center;\n }\n }\n}\n\n.Dialog {\n display: flex;\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 640px;\n min-width: 296px;\n max-width: calc(100dvw - 64px);\n height: auto;\n max-height: calc(100dvh - 64px);\n flex-direction: column;\n background-color: var(--overlay-bgColor);\n border-radius: var(--borderRadius-large);\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n box-shadow: var(--shadow-floating-small);\n opacity: 1;\n\n &:where([data-width='small']) {\n width: 296px;\n }\n\n &:where([data-width='medium']) {\n width: 320px;\n }\n\n &:where([data-width='large']) {\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 480px;\n }\n\n &:where([data-height='small']) {\n height: 480px;\n }\n\n &:where([data-height='large']) {\n height: 640px;\n }\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-scaleFade 0.2s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n\n &[data-position-regular='center'] {\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-scaleFade 0.2s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n\n /* align margins only apply when regular position is center */\n &[data-align='top'] {\n margin-top: var(--base-size-64);\n }\n\n &[data-align='bottom'] {\n margin-bottom: var(--base-size-64);\n }\n }\n\n &[data-position-regular='left'] {\n height: 100dvh;\n max-height: unset;\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-slideInRight 0.25s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n }\n\n &[data-position-regular='right'] {\n height: 100dvh;\n max-height: unset;\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-slideInLeft 0.25s cubic-bezier(0.33, 1, 0.68, 1) 0s 1 normal none running;\n }\n }\n\n @media (max-width: 767px) {\n &[data-position-narrow='center'] {\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 640px;\n height: auto;\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n\n &:where([data-width='small']) {\n width: 296px;\n }\n\n &:where([data-width='medium']) {\n width: 320px;\n }\n\n &:where([data-width='large']) {\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 480px;\n }\n\n &:where([data-height='small']) {\n height: 480px;\n }\n\n &:where([data-height='large']) {\n height: 640px;\n }\n }\n\n @media (max-height: 280px) {\n max-height: calc(100dvh - 12px);\n max-width: calc(100dvw - 12px);\n }\n\n &[data-position-narrow='bottom'] {\n width: 100dvw;\n max-width: 100dvw;\n height: auto;\n max-height: calc(100dvh - 64px);\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n\n /* reset align margins since position wins at narrow */\n &[data-align] {\n margin-top: 0;\n margin-bottom: 0;\n }\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-slideUp 0.25s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n }\n\n &[data-position-narrow='fullscreen'] {\n width: 100%;\n max-width: 100dvw;\n height: 100%;\n max-height: 100dvh;\n border-radius: unset !important;\n flex-grow: 1;\n\n /* reset align margins since fullscreen wins at narrow */\n &[data-align] {\n margin-top: 0;\n margin-bottom: 0;\n }\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-scaleFade 0.2s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n }\n }\n}\n\n/* DisableScroll class is added to Dialog when scroll should be disabled on body */\n.DisableScroll {\n /* This class is used as a selector target for the legacy :has() CSS selector */\n}\n\n/*\n * LEGACY: Scoped :has() selector with negation guard\n * Only evaluates when data-dialog-scroll-optimized is NOT present on body.\n * When the attribute IS present (flag ON), browser skips :has() evaluation\n * because the :not() check fails first (O(1) attribute lookup).\n */\n/* stylelint-disable-next-line selector-no-qualifying-type */\nbody:not([data-dialog-scroll-optimized]):has(.Dialog.DisableScroll) {\n /* stylelint-disable-next-line primer/spacing */\n padding-right: var(--prc-dialog-scrollgutter) !important;\n overflow: hidden !important;\n}\n\n/*\n * PERFORMANCE OPTIMIZATION: Direct attribute on body - O(1) lookup\n * Active when primer_react_css_has_selector_perf flag is ON\n */\n/* stylelint-disable-next-line selector-no-qualifying-type */\nbody[data-dialog-scroll-disabled] {\n /* stylelint-disable-next-line primer/spacing */\n padding-right: var(--prc-dialog-scrollgutter) !important;\n overflow: hidden !important;\n}\n\n.DialogOverflowWrapper {\n flex-grow: 1;\n}\n\n/*\nAdd a border between the body and footer if:\n- the dialog has a footer\n- the dialog has a body that can scroll\n- the browser supports the `animation-timeline` property and its `scroll()` function\n*/\n.Dialog[data-has-footer] {\n --can-scroll: 0;\n\n .DialogOverflowWrapper {\n /* If the browser does not support the `animation-timeline` property, always show a border */\n border-bottom: var(--borderWidth-default) solid var(--borderColor-default);\n animation: detect-scroll;\n animation-timeline: scroll(self);\n\n @supports (animation-timeline: scroll(self)) {\n border-bottom: calc(var(--borderWidth-thin) * var(--can-scroll)) solid var(--borderColor-default);\n }\n }\n}\n\n.Header {\n z-index: 1;\n max-height: 35vh;\n padding: var(--base-size-8);\n overflow-y: auto;\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: 0 1px 0 var(--borderColor-default);\n flex-shrink: 0;\n}\n\n.HeaderInner {\n display: flex;\n}\n\n.HeaderContent {\n display: flex;\n padding-inline: var(--base-size-8);\n padding-block: var(--base-size-6);\n flex-direction: column;\n flex-grow: 1;\n}\n\n.Title {\n margin: 0; /* override default margin */\n font-size: var(--text-body-size-medium);\n font-weight: var(--text-title-weight-large);\n}\n\n.Subtitle {\n margin: 0; /* override default margin */\n margin-top: var(--base-size-4);\n font-size: var(--text-body-size-small);\n font-weight: var(--base-text-weight-normal);\n color: var(--fgColor-muted);\n}\n\n.Body {\n padding: var(--base-size-16);\n overflow: auto;\n flex-grow: 1;\n}\n\n.Footer {\n z-index: 1;\n display: flex;\n flex-flow: wrap;\n justify-content: flex-end;\n padding: var(--base-size-16);\n gap: var(--base-size-8);\n flex-shrink: 0;\n\n @media (max-height: 325px) {\n flex-wrap: nowrap;\n overflow-x: scroll;\n flex-direction: row;\n justify-content: unset;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAA;AAC1F,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,WAAW,CAAA;AAW1C,OAAO,KAAK,EAAC,eA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|
"data-width": width,
|
|
202
202
|
"data-height": height,
|
|
203
|
+
"data-has-footer": footer != null ? '' : undefined,
|
|
203
204
|
className: clsx(className, classes.Dialog),
|
|
204
205
|
style: style,
|
|
205
206
|
children: [header, /*#__PURE__*/jsx(ScrollableRegion, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import './Dialog-
|
|
1
|
+
import './Dialog-2de477b3.css';
|
|
2
2
|
|
|
3
|
-
var classes = {"Backdrop":"prc-Dialog-Backdrop-5Nt2U","dialog-backdrop-appear":"prc-Dialog-dialog-backdrop-appear-tCG2K","Dialog":"prc-Dialog-Dialog-G8cDF","Overlay--motion-scaleFade":"prc-Dialog-Overlay--motion-scaleFade-mE6-C","Overlay--motion-slideInRight":"prc-Dialog-Overlay--motion-slideInRight-BR-CZ","Overlay--motion-slideInLeft":"prc-Dialog-Overlay--motion-slideInLeft-ISmQZ","Overlay--motion-slideUp":"prc-Dialog-Overlay--motion-slideUp-tPElO","DisableScroll":"prc-Dialog-DisableScroll-UkWFM","DialogOverflowWrapper":"prc-Dialog-DialogOverflowWrapper-JvHzz","
|
|
3
|
+
var classes = {"Backdrop":"prc-Dialog-Backdrop-5Nt2U","dialog-backdrop-appear":"prc-Dialog-dialog-backdrop-appear-tCG2K","Dialog":"prc-Dialog-Dialog-G8cDF","Overlay--motion-scaleFade":"prc-Dialog-Overlay--motion-scaleFade-mE6-C","Overlay--motion-slideInRight":"prc-Dialog-Overlay--motion-slideInRight-BR-CZ","Overlay--motion-slideInLeft":"prc-Dialog-Overlay--motion-slideInLeft-ISmQZ","Overlay--motion-slideUp":"prc-Dialog-Overlay--motion-slideUp-tPElO","DisableScroll":"prc-Dialog-DisableScroll-UkWFM","DialogOverflowWrapper":"prc-Dialog-DialogOverflowWrapper-JvHzz","detect-scroll":"prc-Dialog-detect-scroll-b3i8Q","Header":"prc-Dialog-Header-f7Me-","HeaderInner":"prc-Dialog-HeaderInner-H-fFY","HeaderContent":"prc-Dialog-HeaderContent-mjAsn","Title":"prc-Dialog-Title-M-iPn","Subtitle":"prc-Dialog-Subtitle-aBFSq","Body":"prc-Dialog-Body-bB903","Footer":"prc-Dialog-Footer-PMeQk"};
|
|
4
4
|
|
|
5
5
|
export { classes as default };
|
package/package.json
CHANGED