@arc-ui/components 11.14.0 → 11.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Breadcrumbs/Breadcrumbs.cjs.js +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.esm.js +1 -1
- package/dist/Checkbox/Checkbox.cjs.js +2 -2
- package/dist/Checkbox/Checkbox.esm.js +2 -2
- package/dist/FormControl/FormControl.cjs.js +1 -1
- package/dist/FormControl/FormControl.esm.js +1 -1
- package/dist/InformationCard/InformationCard.cjs.js +25 -43
- package/dist/InformationCard/InformationCard.esm.js +24 -42
- package/dist/Modal/Modal.cjs.js +16 -40
- package/dist/Modal/Modal.esm.js +6 -30
- package/dist/PaginationSimple/PaginationSimple.cjs.js +19 -16
- package/dist/PaginationSimple/PaginationSimple.esm.js +19 -16
- package/dist/RadioGroup/RadioGroup.cjs.js +2 -2
- package/dist/RadioGroup/RadioGroup.esm.js +2 -2
- package/dist/Select/Select.cjs.js +2736 -619
- package/dist/Select/Select.esm.js +2535 -418
- package/dist/Switch/Switch.cjs.js +335 -11
- package/dist/Switch/Switch.esm.js +328 -4
- package/dist/Tabs/Tabs.cjs.js +7 -4
- package/dist/Tabs/Tabs.esm.js +7 -4
- package/dist/TextArea/TextArea.cjs.js +17 -12
- package/dist/TextArea/TextArea.esm.js +17 -12
- package/dist/TextInput/TextInput.cjs.js +2 -2
- package/dist/TextInput/TextInput.esm.js +2 -2
- package/dist/Toast/Toast.cjs.js +7 -4
- package/dist/Toast/Toast.esm.js +7 -4
- package/dist/TypographyCard/TypographyCard.cjs.js +93 -0
- package/dist/TypographyCard/TypographyCard.esm.js +85 -0
- package/dist/TypographyCard/package.json +7 -0
- package/dist/UniversalHeader/UniversalHeader.cjs.js +1 -1
- package/dist/UniversalHeader/UniversalHeader.esm.js +1 -1
- package/dist/_shared/cjs/{Breadcrumbs-ed70e75a.js → Breadcrumbs-ef659d2b.js} +5 -5
- package/dist/_shared/cjs/BtIconArrowRight.esm-8e8ac316.js +30 -0
- package/dist/_shared/cjs/BtIconArrowRightFill.esm-435cf4bd.js +26 -0
- package/dist/_shared/cjs/{Checkbox-b126194e.js → Checkbox-904ad028.js} +1 -1
- package/dist/_shared/cjs/{FormControl-7daf8110.js → FormControl-166e0957.js} +5 -1
- package/dist/_shared/cjs/{RadioGroup-56e3b0e5.js → RadioGroup-1eddf86f.js} +1 -1
- package/dist/_shared/cjs/{Tabs-2d2a517d.js → Tabs-cc77dabb.js} +17 -37
- package/dist/_shared/cjs/{TextInput-bf1fe052.js → TextInput-fd9c756f.js} +10 -4
- package/dist/_shared/cjs/{Toast-69108261.js → Toast-91e96744.js} +36 -54
- package/dist/_shared/cjs/{UniversalHeader-5e43d320.js → UniversalHeader-b8389447.js} +4 -2
- package/dist/_shared/cjs/index-1641d0b4.js +27 -0
- package/dist/_shared/cjs/{index-43458549.js → index-3d69ea00.js} +28 -1
- package/dist/_shared/cjs/index-49c72a87.js +131 -0
- package/dist/_shared/cjs/{index-6b2a9ac3.js → index-4ecad2dd.js} +6 -22
- package/dist/_shared/cjs/{index.module-dd1d7d0b.js → index-56a040f4.js} +87 -104
- package/dist/_shared/cjs/index-6542b467.js +23 -0
- package/dist/_shared/cjs/{index-adbb63da.js → index-84e6a68f.js} +1 -1
- package/dist/_shared/cjs/{index-b2fd6338.js → index-d31f2b65.js} +1 -1
- package/dist/_shared/cjs/index-dcfdd5da.js +11 -0
- package/dist/_shared/esm/{Breadcrumbs-87e2bd46.js → Breadcrumbs-36edfb3d.js} +5 -5
- package/dist/_shared/esm/BtIconArrowRight.esm-267916a4.js +24 -0
- package/dist/_shared/esm/BtIconArrowRightFill.esm-99019d1a.js +20 -0
- package/dist/_shared/esm/{Checkbox-d6ec5024.js → Checkbox-8a5bb9a1.js} +1 -1
- package/dist/_shared/esm/{FormControl-351e5f1b.js → FormControl-9d4ddfec.js} +5 -1
- package/dist/_shared/esm/{RadioGroup-c838764c.js → RadioGroup-238db88d.js} +1 -1
- package/dist/_shared/esm/{Tabs-f903187a.js → Tabs-8719d952.js} +7 -27
- package/dist/_shared/esm/{TextInput-991804b6.js → TextInput-c1e2a1dd.js} +10 -4
- package/dist/_shared/esm/{Toast-37549e68.js → Toast-7cb1e544.js} +6 -24
- package/dist/_shared/esm/{UniversalHeader-b4c1577c.js → UniversalHeader-80c7313f.js} +4 -2
- package/dist/_shared/esm/{index.module-44714d3f.js → index-12f3a407.js} +89 -105
- package/dist/_shared/esm/index-246b4f18.js +21 -0
- package/dist/_shared/esm/{index-a1d2d9b3.js → index-39019a9b.js} +1 -1
- package/dist/_shared/esm/{index-41d7af2b.js → index-3e2bc99d.js} +29 -3
- package/dist/_shared/esm/index-6b7b075c.js +25 -0
- package/dist/_shared/esm/{index-efd9ef1c.js → index-936b5179.js} +1 -1
- package/dist/_shared/esm/index-a624de47.js +9 -0
- package/dist/_shared/esm/{index-3797d77e.js → index-d0307140.js} +5 -21
- package/dist/_shared/esm/index-db47e95a.js +129 -0
- package/dist/index.es.js +3062 -865
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +3062 -864
- package/dist/index.js.map +1 -1
- package/dist/styles.css +5 -5
- package/dist/types/components/MediaCard/MediaCard.d.ts +24 -30
- package/dist/types/components/Select/Select.d.ts +49 -0
- package/dist/types/components/TextInput/TextInput.d.ts +12 -1
- package/dist/types/components/TypographyCard/TypographyCard.d.ts +48 -0
- package/dist/types/components/TypographyCard/index.d.ts +1 -0
- package/dist/types/components/UniversalHeader/UniversalHeader.d.ts +4 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/internal-components/ConditionalWrapper/ConditionalWrapper.d.ts +6 -0
- package/dist/types/internal-components/ConditionalWrapper/index.d.ts +1 -0
- package/dist/types/internal-components/index.d.ts +1 -0
- package/dist/types/styles.d.ts +2 -1
- package/package.json +2 -2
- package/dist/_shared/cjs/index-c575a255.js +0 -490
- package/dist/_shared/esm/index-13d575cc.js +0 -479
- package/dist/types/components/MediaCard/MediaCard.stories-wip.d.ts +0 -15
|
@@ -4,10 +4,12 @@ var filterDataAttrs = require('./filter-data-attrs-1c9a530c.js');
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var _extends = require('./extends-8c5e4b48.js');
|
|
6
6
|
var $7SXl2$reactdom = require('react-dom');
|
|
7
|
-
var index = require('./index-
|
|
8
|
-
var index
|
|
9
|
-
var index$2 = require('./index-
|
|
10
|
-
var index$
|
|
7
|
+
var index$1 = require('./index-56a040f4.js');
|
|
8
|
+
var index = require('./index-d31f2b65.js');
|
|
9
|
+
var index$2 = require('./index-4ecad2dd.js');
|
|
10
|
+
var index$4 = require('./index-49c72a87.js');
|
|
11
|
+
var index$3 = require('./index-1641d0b4.js');
|
|
12
|
+
var index$5 = require('./index-9947ac13.js');
|
|
11
13
|
var BtIconCrossAlt2Px_esm = require('./BtIconCrossAlt2Px.esm-1452b14b.js');
|
|
12
14
|
var BtIconTick_esm = require('./BtIconTick.esm-844eac6c.js');
|
|
13
15
|
var BtIconAlert_esm = require('./BtIconAlert.esm-1a0ff9f0.js');
|
|
@@ -17,31 +19,11 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
17
19
|
|
|
18
20
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
19
21
|
|
|
20
|
-
const $ea1ef594cf570d83$export$439d29a4e110a164 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
21
|
-
return /*#__PURE__*/ React.createElement(index.$8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends._extends({}, props, {
|
|
22
|
-
ref: forwardedRef,
|
|
23
|
-
style: {
|
|
24
|
-
// See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss
|
|
25
|
-
position: 'absolute',
|
|
26
|
-
border: 0,
|
|
27
|
-
width: 1,
|
|
28
|
-
height: 1,
|
|
29
|
-
padding: 0,
|
|
30
|
-
margin: -1,
|
|
31
|
-
overflow: 'hidden',
|
|
32
|
-
clip: 'rect(0, 0, 0, 0)',
|
|
33
|
-
whiteSpace: 'nowrap',
|
|
34
|
-
wordWrap: 'normal',
|
|
35
|
-
...props.style
|
|
36
|
-
}
|
|
37
|
-
}));
|
|
38
|
-
});
|
|
39
|
-
|
|
40
22
|
/* -------------------------------------------------------------------------------------------------
|
|
41
23
|
* ToastProvider
|
|
42
24
|
* -----------------------------------------------------------------------------------------------*/ const $054eb8030ebde76e$var$PROVIDER_NAME = 'ToastProvider';
|
|
43
|
-
const [$054eb8030ebde76e$var$Collection, $054eb8030ebde76e$var$useCollection, $054eb8030ebde76e$var$createCollectionScope] = index
|
|
44
|
-
const [$054eb8030ebde76e$var$createToastContext, $054eb8030ebde76e$export$8a359da18fbc9073] = index.$c512c27ab02ef895$export$50c7b4e9d9f19c1('Toast', [
|
|
25
|
+
const [$054eb8030ebde76e$var$Collection, $054eb8030ebde76e$var$useCollection, $054eb8030ebde76e$var$createCollectionScope] = index.$e02a7d9cb1dc128c$export$c74125a8e3af6bb2('Toast');
|
|
26
|
+
const [$054eb8030ebde76e$var$createToastContext, $054eb8030ebde76e$export$8a359da18fbc9073] = index$1.$c512c27ab02ef895$export$50c7b4e9d9f19c1('Toast', [
|
|
45
27
|
$054eb8030ebde76e$var$createCollectionScope
|
|
46
28
|
]);
|
|
47
29
|
const [$054eb8030ebde76e$var$ToastProviderProvider, $054eb8030ebde76e$var$useToastProviderContext] = $054eb8030ebde76e$var$createToastContext($054eb8030ebde76e$var$PROVIDER_NAME);
|
|
@@ -97,7 +79,7 @@ const $054eb8030ebde76e$export$6192c2425ecfd989 = /*#__PURE__*/ React.forwardRef
|
|
|
97
79
|
const headFocusProxyRef = React.useRef(null);
|
|
98
80
|
const tailFocusProxyRef = React.useRef(null);
|
|
99
81
|
const ref = React.useRef(null);
|
|
100
|
-
const composedRefs = index.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref, context.onViewportChange);
|
|
82
|
+
const composedRefs = index$1.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref, context.onViewportChange);
|
|
101
83
|
const hotkeyLabel = hotkey.join('+').replace(/Key/g, '').replace(/Digit/g, '');
|
|
102
84
|
const hasToasts = context.toastCount > 0;
|
|
103
85
|
React.useEffect(()=>{
|
|
@@ -236,7 +218,7 @@ const $054eb8030ebde76e$export$6192c2425ecfd989 = /*#__PURE__*/ React.forwardRef
|
|
|
236
218
|
}
|
|
237
219
|
}), /*#__PURE__*/ React.createElement($054eb8030ebde76e$var$Collection.Slot, {
|
|
238
220
|
scope: __scopeToast
|
|
239
|
-
}, /*#__PURE__*/ React.createElement(index.$8927f6f2acc4f386$export$250ffa63cdc0d034.ol, _extends._extends({
|
|
221
|
+
}, /*#__PURE__*/ React.createElement(index$1.$8927f6f2acc4f386$export$250ffa63cdc0d034.ol, _extends._extends({
|
|
240
222
|
tabIndex: -1
|
|
241
223
|
}, viewportProps, {
|
|
242
224
|
ref: composedRefs
|
|
@@ -254,7 +236,7 @@ const $054eb8030ebde76e$export$6192c2425ecfd989 = /*#__PURE__*/ React.forwardRef
|
|
|
254
236
|
const $054eb8030ebde76e$var$FocusProxy = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
255
237
|
const { __scopeToast: __scopeToast , onFocusFromOutsideViewport: onFocusFromOutsideViewport , ...proxyProps } = props;
|
|
256
238
|
const context = $054eb8030ebde76e$var$useToastProviderContext($054eb8030ebde76e$var$FOCUS_PROXY_NAME, __scopeToast);
|
|
257
|
-
return /*#__PURE__*/ React.createElement($ea1ef594cf570d83$export$439d29a4e110a164, _extends._extends({
|
|
239
|
+
return /*#__PURE__*/ React.createElement(index$3.$ea1ef594cf570d83$export$439d29a4e110a164, _extends._extends({
|
|
258
240
|
"aria-hidden": true,
|
|
259
241
|
tabIndex: 0
|
|
260
242
|
}, proxyProps, {
|
|
@@ -280,12 +262,12 @@ const $054eb8030ebde76e$var$TOAST_SWIPE_CANCEL = 'toast.swipeCancel';
|
|
|
280
262
|
const $054eb8030ebde76e$var$TOAST_SWIPE_END = 'toast.swipeEnd';
|
|
281
263
|
const $054eb8030ebde76e$export$8d8dc7d5f743331b = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
282
264
|
const { forceMount: forceMount , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , ...toastProps } = props;
|
|
283
|
-
const [open = true, setOpen] = index.$71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
265
|
+
const [open = true, setOpen] = index$1.$71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
284
266
|
prop: openProp,
|
|
285
267
|
defaultProp: defaultOpen,
|
|
286
268
|
onChange: onOpenChange
|
|
287
269
|
});
|
|
288
|
-
return /*#__PURE__*/ React.createElement(index.$921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
270
|
+
return /*#__PURE__*/ React.createElement(index$4.$921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
289
271
|
present: forceMount || open
|
|
290
272
|
}, /*#__PURE__*/ React.createElement($054eb8030ebde76e$var$ToastImpl, _extends._extends({
|
|
291
273
|
open: open
|
|
@@ -293,25 +275,25 @@ const $054eb8030ebde76e$export$8d8dc7d5f743331b = /*#__PURE__*/ React.forwardRef
|
|
|
293
275
|
ref: forwardedRef,
|
|
294
276
|
onClose: ()=>setOpen(false)
|
|
295
277
|
,
|
|
296
|
-
onPause: index.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(props.onPause),
|
|
297
|
-
onResume: index.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(props.onResume),
|
|
298
|
-
onSwipeStart: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onSwipeStart, (event)=>{
|
|
278
|
+
onPause: index$1.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(props.onPause),
|
|
279
|
+
onResume: index$1.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(props.onResume),
|
|
280
|
+
onSwipeStart: index$1.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onSwipeStart, (event)=>{
|
|
299
281
|
event.currentTarget.setAttribute('data-swipe', 'start');
|
|
300
282
|
}),
|
|
301
|
-
onSwipeMove: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onSwipeMove, (event)=>{
|
|
283
|
+
onSwipeMove: index$1.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onSwipeMove, (event)=>{
|
|
302
284
|
const { x: x , y: y } = event.detail.delta;
|
|
303
285
|
event.currentTarget.setAttribute('data-swipe', 'move');
|
|
304
286
|
event.currentTarget.style.setProperty('--radix-toast-swipe-move-x', `${x}px`);
|
|
305
287
|
event.currentTarget.style.setProperty('--radix-toast-swipe-move-y', `${y}px`);
|
|
306
288
|
}),
|
|
307
|
-
onSwipeCancel: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onSwipeCancel, (event)=>{
|
|
289
|
+
onSwipeCancel: index$1.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onSwipeCancel, (event)=>{
|
|
308
290
|
event.currentTarget.setAttribute('data-swipe', 'cancel');
|
|
309
291
|
event.currentTarget.style.removeProperty('--radix-toast-swipe-move-x');
|
|
310
292
|
event.currentTarget.style.removeProperty('--radix-toast-swipe-move-y');
|
|
311
293
|
event.currentTarget.style.removeProperty('--radix-toast-swipe-end-x');
|
|
312
294
|
event.currentTarget.style.removeProperty('--radix-toast-swipe-end-y');
|
|
313
295
|
}),
|
|
314
|
-
onSwipeEnd: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onSwipeEnd, (event)=>{
|
|
296
|
+
onSwipeEnd: index$1.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onSwipeEnd, (event)=>{
|
|
315
297
|
const { x: x , y: y } = event.detail.delta;
|
|
316
298
|
event.currentTarget.setAttribute('data-swipe', 'end');
|
|
317
299
|
event.currentTarget.style.removeProperty('--radix-toast-swipe-move-x');
|
|
@@ -329,7 +311,7 @@ const $054eb8030ebde76e$var$ToastImpl = /*#__PURE__*/ React.forwardRef((props, f
|
|
|
329
311
|
const { __scopeToast: __scopeToast , type: type = 'foreground' , duration: durationProp , open: open , onClose: onClose , onEscapeKeyDown: onEscapeKeyDown , onPause: onPause , onResume: onResume , onSwipeStart: onSwipeStart , onSwipeMove: onSwipeMove , onSwipeCancel: onSwipeCancel , onSwipeEnd: onSwipeEnd , ...toastProps } = props;
|
|
330
312
|
const context = $054eb8030ebde76e$var$useToastProviderContext($054eb8030ebde76e$var$TOAST_NAME, __scopeToast);
|
|
331
313
|
const [node1, setNode] = React.useState(null);
|
|
332
|
-
const composedRefs = index.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setNode(node)
|
|
314
|
+
const composedRefs = index$1.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setNode(node)
|
|
333
315
|
);
|
|
334
316
|
const pointerStartRef = React.useRef(null);
|
|
335
317
|
const swipeDeltaRef = React.useRef(null);
|
|
@@ -338,7 +320,7 @@ const $054eb8030ebde76e$var$ToastImpl = /*#__PURE__*/ React.forwardRef((props, f
|
|
|
338
320
|
const closeTimerRemainingTimeRef = React.useRef(duration1);
|
|
339
321
|
const closeTimerRef = React.useRef(0);
|
|
340
322
|
const { onToastAdd: onToastAdd , onToastRemove: onToastRemove } = context;
|
|
341
|
-
const handleClose = index.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(()=>{
|
|
323
|
+
const handleClose = index$1.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(()=>{
|
|
342
324
|
var _context$viewport2;
|
|
343
325
|
// focus viewport if focus is within toast to read the remaining toast
|
|
344
326
|
// count to SR users and ensure focus isn't lost
|
|
@@ -418,11 +400,11 @@ const $054eb8030ebde76e$var$ToastImpl = /*#__PURE__*/ React.forwardRef((props, f
|
|
|
418
400
|
scope: __scopeToast
|
|
419
401
|
}, /*#__PURE__*/ React.createElement(index$2.$5cb92bef7577960e$export$be92b6f5f03c0fe9, {
|
|
420
402
|
asChild: true,
|
|
421
|
-
onEscapeKeyDown: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(onEscapeKeyDown, ()=>{
|
|
403
|
+
onEscapeKeyDown: index$1.$e42e1063c40fb3ef$export$b9ecd428b558ff10(onEscapeKeyDown, ()=>{
|
|
422
404
|
if (!context.isFocusedToastEscapeKeyDownRef.current) handleClose();
|
|
423
405
|
context.isFocusedToastEscapeKeyDownRef.current = false;
|
|
424
406
|
})
|
|
425
|
-
}, /*#__PURE__*/ React.createElement(index.$8927f6f2acc4f386$export$250ffa63cdc0d034.li, _extends._extends({
|
|
407
|
+
}, /*#__PURE__*/ React.createElement(index$1.$8927f6f2acc4f386$export$250ffa63cdc0d034.li, _extends._extends({
|
|
426
408
|
// Ensure toasts are announced as status list or status when focused
|
|
427
409
|
role: "status",
|
|
428
410
|
"aria-live": "off",
|
|
@@ -437,7 +419,7 @@ const $054eb8030ebde76e$var$ToastImpl = /*#__PURE__*/ React.forwardRef((props, f
|
|
|
437
419
|
touchAction: 'none',
|
|
438
420
|
...props.style
|
|
439
421
|
},
|
|
440
|
-
onKeyDown: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{
|
|
422
|
+
onKeyDown: index$1.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{
|
|
441
423
|
if (event.key !== 'Escape') return;
|
|
442
424
|
onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event.nativeEvent);
|
|
443
425
|
if (!event.nativeEvent.defaultPrevented) {
|
|
@@ -445,14 +427,14 @@ const $054eb8030ebde76e$var$ToastImpl = /*#__PURE__*/ React.forwardRef((props, f
|
|
|
445
427
|
handleClose();
|
|
446
428
|
}
|
|
447
429
|
}),
|
|
448
|
-
onPointerDown: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDown, (event)=>{
|
|
430
|
+
onPointerDown: index$1.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDown, (event)=>{
|
|
449
431
|
if (event.button !== 0) return;
|
|
450
432
|
pointerStartRef.current = {
|
|
451
433
|
x: event.clientX,
|
|
452
434
|
y: event.clientY
|
|
453
435
|
};
|
|
454
436
|
}),
|
|
455
|
-
onPointerMove: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerMove, (event)=>{
|
|
437
|
+
onPointerMove: index$1.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerMove, (event)=>{
|
|
456
438
|
if (!pointerStartRef.current) return;
|
|
457
439
|
const x = event.clientX - pointerStartRef.current.x;
|
|
458
440
|
const y = event.clientY - pointerStartRef.current.y;
|
|
@@ -491,7 +473,7 @@ const $054eb8030ebde76e$var$ToastImpl = /*#__PURE__*/ React.forwardRef((props, f
|
|
|
491
473
|
// for the current pointer down interaction
|
|
492
474
|
pointerStartRef.current = null;
|
|
493
475
|
}),
|
|
494
|
-
onPointerUp: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerUp, (event1)=>{
|
|
476
|
+
onPointerUp: index$1.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerUp, (event1)=>{
|
|
495
477
|
const delta = swipeDeltaRef.current;
|
|
496
478
|
const target = event1.target;
|
|
497
479
|
if (target.hasPointerCapture(event1.pointerId)) target.releasePointerCapture(event1.pointerId);
|
|
@@ -546,11 +528,11 @@ $054eb8030ebde76e$var$ToastImpl.propTypes = {
|
|
|
546
528
|
}, []);
|
|
547
529
|
return isAnnounced ? null : /*#__PURE__*/ React.createElement(index$2.$f1701beae083dbae$export$602eac185826482c, {
|
|
548
530
|
asChild: true
|
|
549
|
-
}, /*#__PURE__*/ React.createElement($ea1ef594cf570d83$export$439d29a4e110a164, announceProps, renderAnnounceText && /*#__PURE__*/ React.createElement(React.Fragment, null, context.label, " ", children)));
|
|
531
|
+
}, /*#__PURE__*/ React.createElement(index$3.$ea1ef594cf570d83$export$439d29a4e110a164, announceProps, renderAnnounceText && /*#__PURE__*/ React.createElement(React.Fragment, null, context.label, " ", children)));
|
|
550
532
|
};
|
|
551
533
|
const $054eb8030ebde76e$export$16d42d7c29b95a4 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
552
534
|
const { __scopeToast: __scopeToast , ...titleProps } = props;
|
|
553
|
-
return /*#__PURE__*/ React.createElement(index.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends._extends({}, titleProps, {
|
|
535
|
+
return /*#__PURE__*/ React.createElement(index$1.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends._extends({}, titleProps, {
|
|
554
536
|
ref: forwardedRef
|
|
555
537
|
}));
|
|
556
538
|
});
|
|
@@ -581,16 +563,16 @@ const $054eb8030ebde76e$export$811e70f61c205839 = /*#__PURE__*/ React.forwardRef
|
|
|
581
563
|
const interactiveContext = $054eb8030ebde76e$var$useToastInteractiveContext($054eb8030ebde76e$var$CLOSE_NAME, __scopeToast);
|
|
582
564
|
return /*#__PURE__*/ React.createElement($054eb8030ebde76e$var$ToastAnnounceExclude, {
|
|
583
565
|
asChild: true
|
|
584
|
-
}, /*#__PURE__*/ React.createElement(index.$8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends._extends({
|
|
566
|
+
}, /*#__PURE__*/ React.createElement(index$1.$8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends._extends({
|
|
585
567
|
type: "button"
|
|
586
568
|
}, closeProps, {
|
|
587
569
|
ref: forwardedRef,
|
|
588
|
-
onClick: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, interactiveContext.onClose)
|
|
570
|
+
onClick: index$1.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, interactiveContext.onClose)
|
|
589
571
|
})));
|
|
590
572
|
});
|
|
591
573
|
/* ---------------------------------------------------------------------------------------------- */ const $054eb8030ebde76e$var$ToastAnnounceExclude = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
592
574
|
const { __scopeToast: __scopeToast , altText: altText , ...announceExcludeProps } = props;
|
|
593
|
-
return /*#__PURE__*/ React.createElement(index.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends._extends({
|
|
575
|
+
return /*#__PURE__*/ React.createElement(index$1.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends._extends({
|
|
594
576
|
"data-radix-toast-announce-exclude": "",
|
|
595
577
|
"data-radix-toast-announce-alt": altText || undefined
|
|
596
578
|
}, announceExcludeProps, {
|
|
@@ -626,7 +608,7 @@ function $054eb8030ebde76e$var$getAnnounceTextContent(container) {
|
|
|
626
608
|
if (handler) currentTarget.addEventListener(name, handler, {
|
|
627
609
|
once: true
|
|
628
610
|
});
|
|
629
|
-
if (discrete) index.$8927f6f2acc4f386$export$6d1a0317bde7de7f(currentTarget, event);
|
|
611
|
+
if (discrete) index$1.$8927f6f2acc4f386$export$6d1a0317bde7de7f(currentTarget, event);
|
|
630
612
|
else currentTarget.dispatchEvent(event);
|
|
631
613
|
}
|
|
632
614
|
const $054eb8030ebde76e$var$isDeltaInDirection = (delta, direction, threshold = 0)=>{
|
|
@@ -637,8 +619,8 @@ const $054eb8030ebde76e$var$isDeltaInDirection = (delta, direction, threshold =
|
|
|
637
619
|
else return !isDeltaX && deltaY > threshold;
|
|
638
620
|
};
|
|
639
621
|
function $054eb8030ebde76e$var$useNextFrame(callback = ()=>{}) {
|
|
640
|
-
const fn = index.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback);
|
|
641
|
-
index.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
622
|
+
const fn = index$1.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback);
|
|
623
|
+
index$1.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
642
624
|
let raf1 = 0;
|
|
643
625
|
let raf2 = 0;
|
|
644
626
|
raf1 = window.requestAnimationFrame(()=>raf2 = window.requestAnimationFrame(fn)
|
|
@@ -707,7 +689,7 @@ var ToastNotification = function (_a) {
|
|
|
707
689
|
handler();
|
|
708
690
|
}; };
|
|
709
691
|
return (React__default["default"].createElement($054eb8030ebde76e$export$be92b6f5f03c0fe9, filterDataAttrs.__assign({ className: "arc-Toast-root", open: isOpen, onOpenChange: onOpenChange }, filterDataAttrs.filterDataAttrs(props)),
|
|
710
|
-
React__default["default"].createElement("div", { "data-testid": "toast-notification-wrapper", className: index$
|
|
692
|
+
React__default["default"].createElement("div", { "data-testid": "toast-notification-wrapper", className: index$5.classNames("arc-Toast", "arc-Toast-status--".concat(status)) },
|
|
711
693
|
isStatusIconVisible && (React__default["default"].createElement("div", { "data-testid": "status-icon", className: "arc-Toast-icon" },
|
|
712
694
|
React__default["default"].createElement(Icon.Icon, { size: 24, icon: statusIcons[status] }))),
|
|
713
695
|
React__default["default"].createElement($054eb8030ebde76e$export$f99233281efd08a0, { className: "arc-Toast-title" },
|
|
@@ -12,7 +12,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
12
12
|
* Use `UniversalHeader` to display a group-level page header.
|
|
13
13
|
*/
|
|
14
14
|
var UniversalHeader = function (_a) {
|
|
15
|
-
var children = _a.children, props = filterDataAttrs.__rest(_a, ["children"]);
|
|
15
|
+
var children = _a.children, ContentSlot = _a.ContentSlot, props = filterDataAttrs.__rest(_a, ["children", "ContentSlot"]);
|
|
16
16
|
React.useEffect(function () {
|
|
17
17
|
React__default["default"].Children.map(children, function (item) {
|
|
18
18
|
if (item && item.type !== UniversalHeaderItem) {
|
|
@@ -22,7 +22,9 @@ var UniversalHeader = function (_a) {
|
|
|
22
22
|
}, [children]);
|
|
23
23
|
return (React__default["default"].createElement("nav", filterDataAttrs.__assign({ className: "arc-UniversalHeader" }, filterDataAttrs.filterDataAttrs(props)),
|
|
24
24
|
React__default["default"].createElement(Surface.Surface, { background: "light" },
|
|
25
|
-
React__default["default"].createElement("ul", { className: "arc-UniversalHeader-items" },
|
|
25
|
+
React__default["default"].createElement("ul", { className: "arc-UniversalHeader-items" },
|
|
26
|
+
children,
|
|
27
|
+
ContentSlot && (React__default["default"].createElement("li", { className: "arc-UniversalHeader-contentSlot" }, ContentSlot))))));
|
|
26
28
|
};
|
|
27
29
|
var UniversalHeaderItem = function (_a) {
|
|
28
30
|
var children = _a.children, href = _a.href, props = filterDataAttrs.__rest(_a, ["children", "href"]);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _extends = require('./extends-8c5e4b48.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var index = require('./index-56a040f4.js');
|
|
6
|
+
|
|
7
|
+
const $ea1ef594cf570d83$export$439d29a4e110a164 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
8
|
+
return /*#__PURE__*/ React.createElement(index.$8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends._extends({}, props, {
|
|
9
|
+
ref: forwardedRef,
|
|
10
|
+
style: {
|
|
11
|
+
// See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss
|
|
12
|
+
position: 'absolute',
|
|
13
|
+
border: 0,
|
|
14
|
+
width: 1,
|
|
15
|
+
height: 1,
|
|
16
|
+
padding: 0,
|
|
17
|
+
margin: -1,
|
|
18
|
+
overflow: 'hidden',
|
|
19
|
+
clip: 'rect(0, 0, 0, 0)',
|
|
20
|
+
whiteSpace: 'nowrap',
|
|
21
|
+
wordWrap: 'normal',
|
|
22
|
+
...props.style
|
|
23
|
+
}
|
|
24
|
+
}));
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
exports.$ea1ef594cf570d83$export$439d29a4e110a164 = $ea1ef594cf570d83$export$439d29a4e110a164;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var filterDataAttrs = require('./filter-data-attrs-1c9a530c.js');
|
|
4
3
|
var React = require('react');
|
|
4
|
+
var filterDataAttrs = require('./filter-data-attrs-1c9a530c.js');
|
|
5
5
|
|
|
6
6
|
function _interopNamespace(e) {
|
|
7
7
|
if (e && e.__esModule) return e;
|
|
@@ -23,6 +23,32 @@ function _interopNamespace(e) {
|
|
|
23
23
|
|
|
24
24
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
25
25
|
|
|
26
|
+
/** Number of components which have requested interest to have focus guards */ let $3db38b7d1fb3fe6a$var$count = 0;
|
|
27
|
+
/**
|
|
28
|
+
* Injects a pair of focus guards at the edges of the whole DOM tree
|
|
29
|
+
* to ensure `focusin` & `focusout` events can be caught consistently.
|
|
30
|
+
*/ function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c() {
|
|
31
|
+
React.useEffect(()=>{
|
|
32
|
+
var _edgeGuards$, _edgeGuards$2;
|
|
33
|
+
const edgeGuards = document.querySelectorAll('[data-radix-focus-guard]');
|
|
34
|
+
document.body.insertAdjacentElement('afterbegin', (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard());
|
|
35
|
+
document.body.insertAdjacentElement('beforeend', (_edgeGuards$2 = edgeGuards[1]) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $3db38b7d1fb3fe6a$var$createFocusGuard());
|
|
36
|
+
$3db38b7d1fb3fe6a$var$count++;
|
|
37
|
+
return ()=>{
|
|
38
|
+
if ($3db38b7d1fb3fe6a$var$count === 1) document.querySelectorAll('[data-radix-focus-guard]').forEach((node)=>node.remove()
|
|
39
|
+
);
|
|
40
|
+
$3db38b7d1fb3fe6a$var$count--;
|
|
41
|
+
};
|
|
42
|
+
}, []);
|
|
43
|
+
}
|
|
44
|
+
function $3db38b7d1fb3fe6a$var$createFocusGuard() {
|
|
45
|
+
const element = document.createElement('span');
|
|
46
|
+
element.setAttribute('data-radix-focus-guard', '');
|
|
47
|
+
element.tabIndex = 0;
|
|
48
|
+
element.style.cssText = 'outline: none; opacity: 0; position: fixed; pointer-events: none';
|
|
49
|
+
return element;
|
|
50
|
+
}
|
|
51
|
+
|
|
26
52
|
var zeroRightClassName = 'right-scroll-bar-position';
|
|
27
53
|
var fullWidthClassName = 'width-before-scroll-bar';
|
|
28
54
|
var noScrollbarsClassName = 'with-scroll-bars-hidden';
|
|
@@ -783,4 +809,5 @@ var hideOthers = function (originalTarget, parentNode, markerName) {
|
|
|
783
809
|
};
|
|
784
810
|
|
|
785
811
|
exports.$01b9c$RemoveScroll = $01b9c$RemoveScroll;
|
|
812
|
+
exports.$3db38b7d1fb3fe6a$export$b7ece24a22aeda8c = $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c;
|
|
786
813
|
exports.hideOthers = hideOthers;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var $7SXl2$reactdom = require('react-dom');
|
|
5
|
+
var index = require('./index-56a040f4.js');
|
|
6
|
+
|
|
7
|
+
function $fe963b355347cc68$export$3e6543de14f8614f(initialState, machine) {
|
|
8
|
+
return React.useReducer((state, event)=>{
|
|
9
|
+
const nextState = machine[state][event];
|
|
10
|
+
return nextState !== null && nextState !== void 0 ? nextState : state;
|
|
11
|
+
}, initialState);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
const $921a889cee6df7e8$export$99c2b779aa4e8b8b = (props)=>{
|
|
16
|
+
const { present: present , children: children } = props;
|
|
17
|
+
const presence = $921a889cee6df7e8$var$usePresence(present);
|
|
18
|
+
const child = typeof children === 'function' ? children({
|
|
19
|
+
present: presence.isPresent
|
|
20
|
+
}) : React.Children.only(children);
|
|
21
|
+
const ref = index.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(presence.ref, child.ref);
|
|
22
|
+
const forceMount = typeof children === 'function';
|
|
23
|
+
return forceMount || presence.isPresent ? /*#__PURE__*/ React.cloneElement(child, {
|
|
24
|
+
ref: ref
|
|
25
|
+
}) : null;
|
|
26
|
+
};
|
|
27
|
+
$921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName = 'Presence';
|
|
28
|
+
/* -------------------------------------------------------------------------------------------------
|
|
29
|
+
* usePresence
|
|
30
|
+
* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$usePresence(present) {
|
|
31
|
+
const [node1, setNode] = React.useState();
|
|
32
|
+
const stylesRef = React.useRef({});
|
|
33
|
+
const prevPresentRef = React.useRef(present);
|
|
34
|
+
const prevAnimationNameRef = React.useRef('none');
|
|
35
|
+
const initialState = present ? 'mounted' : 'unmounted';
|
|
36
|
+
const [state, send] = $fe963b355347cc68$export$3e6543de14f8614f(initialState, {
|
|
37
|
+
mounted: {
|
|
38
|
+
UNMOUNT: 'unmounted',
|
|
39
|
+
ANIMATION_OUT: 'unmountSuspended'
|
|
40
|
+
},
|
|
41
|
+
unmountSuspended: {
|
|
42
|
+
MOUNT: 'mounted',
|
|
43
|
+
ANIMATION_END: 'unmounted'
|
|
44
|
+
},
|
|
45
|
+
unmounted: {
|
|
46
|
+
MOUNT: 'mounted'
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
React.useEffect(()=>{
|
|
50
|
+
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
|
|
51
|
+
prevAnimationNameRef.current = state === 'mounted' ? currentAnimationName : 'none';
|
|
52
|
+
}, [
|
|
53
|
+
state
|
|
54
|
+
]);
|
|
55
|
+
index.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
56
|
+
const styles = stylesRef.current;
|
|
57
|
+
const wasPresent = prevPresentRef.current;
|
|
58
|
+
const hasPresentChanged = wasPresent !== present;
|
|
59
|
+
if (hasPresentChanged) {
|
|
60
|
+
const prevAnimationName = prevAnimationNameRef.current;
|
|
61
|
+
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(styles);
|
|
62
|
+
if (present) send('MOUNT');
|
|
63
|
+
else if (currentAnimationName === 'none' || (styles === null || styles === void 0 ? void 0 : styles.display) === 'none') // If there is no exit animation or the element is hidden, animations won't run
|
|
64
|
+
// so we unmount instantly
|
|
65
|
+
send('UNMOUNT');
|
|
66
|
+
else {
|
|
67
|
+
/**
|
|
68
|
+
* When `present` changes to `false`, we check changes to animation-name to
|
|
69
|
+
* determine whether an animation has started. We chose this approach (reading
|
|
70
|
+
* computed styles) because there is no `animationrun` event and `animationstart`
|
|
71
|
+
* fires after `animation-delay` has expired which would be too late.
|
|
72
|
+
*/ const isAnimating = prevAnimationName !== currentAnimationName;
|
|
73
|
+
if (wasPresent && isAnimating) send('ANIMATION_OUT');
|
|
74
|
+
else send('UNMOUNT');
|
|
75
|
+
}
|
|
76
|
+
prevPresentRef.current = present;
|
|
77
|
+
}
|
|
78
|
+
}, [
|
|
79
|
+
present,
|
|
80
|
+
send
|
|
81
|
+
]);
|
|
82
|
+
index.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
83
|
+
if (node1) {
|
|
84
|
+
/**
|
|
85
|
+
* Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel`
|
|
86
|
+
* event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we
|
|
87
|
+
* make sure we only trigger ANIMATION_END for the currently active animation.
|
|
88
|
+
*/ const handleAnimationEnd = (event)=>{
|
|
89
|
+
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
|
|
90
|
+
const isCurrentAnimation = currentAnimationName.includes(event.animationName);
|
|
91
|
+
if (event.target === node1 && isCurrentAnimation) // With React 18 concurrency this update is applied
|
|
92
|
+
// a frame after the animation ends, creating a flash of visible content.
|
|
93
|
+
// By manually flushing we ensure they sync within a frame, removing the flash.
|
|
94
|
+
$7SXl2$reactdom.flushSync(()=>send('ANIMATION_END')
|
|
95
|
+
);
|
|
96
|
+
};
|
|
97
|
+
const handleAnimationStart = (event)=>{
|
|
98
|
+
if (event.target === node1) // if animation occurred, store its name as the previous animation.
|
|
99
|
+
prevAnimationNameRef.current = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
|
|
100
|
+
};
|
|
101
|
+
node1.addEventListener('animationstart', handleAnimationStart);
|
|
102
|
+
node1.addEventListener('animationcancel', handleAnimationEnd);
|
|
103
|
+
node1.addEventListener('animationend', handleAnimationEnd);
|
|
104
|
+
return ()=>{
|
|
105
|
+
node1.removeEventListener('animationstart', handleAnimationStart);
|
|
106
|
+
node1.removeEventListener('animationcancel', handleAnimationEnd);
|
|
107
|
+
node1.removeEventListener('animationend', handleAnimationEnd);
|
|
108
|
+
};
|
|
109
|
+
} else // Transition to the unmounted state if the node is removed prematurely.
|
|
110
|
+
// We avoid doing so during cleanup as the node may change but still exist.
|
|
111
|
+
send('ANIMATION_END');
|
|
112
|
+
}, [
|
|
113
|
+
node1,
|
|
114
|
+
send
|
|
115
|
+
]);
|
|
116
|
+
return {
|
|
117
|
+
isPresent: [
|
|
118
|
+
'mounted',
|
|
119
|
+
'unmountSuspended'
|
|
120
|
+
].includes(state),
|
|
121
|
+
ref: React.useCallback((node)=>{
|
|
122
|
+
if (node) stylesRef.current = getComputedStyle(node);
|
|
123
|
+
setNode(node);
|
|
124
|
+
}, [])
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
/* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$getAnimationName(styles) {
|
|
128
|
+
return (styles === null || styles === void 0 ? void 0 : styles.animationName) || 'none';
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
exports.$921a889cee6df7e8$export$99c2b779aa4e8b8b = $921a889cee6df7e8$export$99c2b779aa4e8b8b;
|
|
@@ -2,30 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
var _extends = require('./extends-8c5e4b48.js');
|
|
4
4
|
var React = require('react');
|
|
5
|
-
var index = require('./index-
|
|
5
|
+
var index = require('./index-56a040f4.js');
|
|
6
|
+
var index$1 = require('./index-6542b467.js');
|
|
6
7
|
var $7SXl2$reactdom = require('react-dom');
|
|
7
8
|
|
|
8
9
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
10
|
|
|
10
11
|
var $7SXl2$reactdom__default = /*#__PURE__*/_interopDefaultLegacy($7SXl2$reactdom);
|
|
11
12
|
|
|
12
|
-
/**
|
|
13
|
-
* Listens for when the escape key is down
|
|
14
|
-
*/ function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
15
|
-
const onEscapeKeyDown = index.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEscapeKeyDownProp);
|
|
16
|
-
React.useEffect(()=>{
|
|
17
|
-
const handleKeyDown = (event)=>{
|
|
18
|
-
if (event.key === 'Escape') onEscapeKeyDown(event);
|
|
19
|
-
};
|
|
20
|
-
ownerDocument.addEventListener('keydown', handleKeyDown);
|
|
21
|
-
return ()=>ownerDocument.removeEventListener('keydown', handleKeyDown)
|
|
22
|
-
;
|
|
23
|
-
}, [
|
|
24
|
-
onEscapeKeyDown,
|
|
25
|
-
ownerDocument
|
|
26
|
-
]);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
13
|
const $5cb92bef7577960e$var$CONTEXT_UPDATE = 'dismissableLayer.update';
|
|
30
14
|
const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';
|
|
31
15
|
const $5cb92bef7577960e$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';
|
|
@@ -49,9 +33,9 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React.forwardRef
|
|
|
49
33
|
...context.layersWithOutsidePointerEventsDisabled
|
|
50
34
|
].slice(-1); // prettier-ignore
|
|
51
35
|
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); // prettier-ignore
|
|
52
|
-
const index$
|
|
36
|
+
const index$2 = node1 ? layers.indexOf(node1) : -1;
|
|
53
37
|
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
54
|
-
const isPointerEventsEnabled = index$
|
|
38
|
+
const isPointerEventsEnabled = index$2 >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
55
39
|
const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside((event)=>{
|
|
56
40
|
const target = event.target;
|
|
57
41
|
const isPointerDownOnBranch = [
|
|
@@ -74,8 +58,8 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React.forwardRef
|
|
|
74
58
|
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
75
59
|
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
76
60
|
}, ownerDocument);
|
|
77
|
-
$addc16e1bbe58fd0$export$3a72a57244d6e765((event)=>{
|
|
78
|
-
const isHighestLayer = index$
|
|
61
|
+
index$1.$addc16e1bbe58fd0$export$3a72a57244d6e765((event)=>{
|
|
62
|
+
const isHighestLayer = index$2 === context.layers.size - 1;
|
|
79
63
|
if (!isHighestLayer) return;
|
|
80
64
|
onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);
|
|
81
65
|
if (!event.defaultPrevented && onDismiss) {
|