@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createContext, useMemo, createElement, useContext,
|
|
1
|
+
import { useCallback, createContext, useMemo, createElement, useContext, useLayoutEffect, useRef, useEffect, useState, forwardRef, Children, isValidElement, cloneElement, Fragment } from 'react';
|
|
2
2
|
import { _ as _extends } from './extends-8cc61aad.js';
|
|
3
3
|
import { flushSync } from 'react-dom';
|
|
4
4
|
|
|
@@ -9,6 +9,29 @@ function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEven
|
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Set a given ref to a given value
|
|
14
|
+
* This utility takes care of different types of refs: callback refs and RefObject(s)
|
|
15
|
+
*/ function $6ed0406888f73fc4$var$setRef(ref, value) {
|
|
16
|
+
if (typeof ref === 'function') ref(value);
|
|
17
|
+
else if (ref !== null && ref !== undefined) ref.current = value;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A utility to compose multiple refs together
|
|
21
|
+
* Accepts callback refs and RefObject(s)
|
|
22
|
+
*/ function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {
|
|
23
|
+
return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef(ref, node)
|
|
24
|
+
)
|
|
25
|
+
;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A custom hook that composes multiple refs
|
|
29
|
+
* Accepts callback refs and RefObject(s)
|
|
30
|
+
*/ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {
|
|
31
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
32
|
+
return useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);
|
|
33
|
+
}
|
|
34
|
+
|
|
12
35
|
/* -------------------------------------------------------------------------------------------------
|
|
13
36
|
* createContextScope
|
|
14
37
|
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName, createContextScopeDeps = []) {
|
|
@@ -107,26 +130,69 @@ function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEven
|
|
|
107
130
|
}
|
|
108
131
|
|
|
109
132
|
/**
|
|
110
|
-
*
|
|
111
|
-
* This
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
133
|
+
* On the server, React emits a warning when calling `useLayoutEffect`.
|
|
134
|
+
* This is because neither `useLayoutEffect` nor `useEffect` run on the server.
|
|
135
|
+
* We use this safe version which suppresses the warning by replacing it with a noop on the server.
|
|
136
|
+
*
|
|
137
|
+
* See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
|
|
138
|
+
*/ const $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? useLayoutEffect : ()=>{};
|
|
139
|
+
|
|
116
140
|
/**
|
|
117
|
-
* A
|
|
118
|
-
*
|
|
119
|
-
*/ function $
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
141
|
+
* A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
|
|
142
|
+
* prop or avoid re-executing effects when passed as a dependency
|
|
143
|
+
*/ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
|
|
144
|
+
const callbackRef = useRef(callback);
|
|
145
|
+
useEffect(()=>{
|
|
146
|
+
callbackRef.current = callback;
|
|
147
|
+
}); // https://github.com/facebook/react/issues/19240
|
|
148
|
+
return useMemo(()=>(...args)=>{
|
|
149
|
+
var _callbackRef$current;
|
|
150
|
+
return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
|
|
151
|
+
}
|
|
152
|
+
, []);
|
|
123
153
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
154
|
+
|
|
155
|
+
function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop: prop , defaultProp: defaultProp , onChange: onChange = ()=>{} }) {
|
|
156
|
+
const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({
|
|
157
|
+
defaultProp: defaultProp,
|
|
158
|
+
onChange: onChange
|
|
159
|
+
});
|
|
160
|
+
const isControlled = prop !== undefined;
|
|
161
|
+
const value1 = isControlled ? prop : uncontrolledProp;
|
|
162
|
+
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
163
|
+
const setValue = useCallback((nextValue)=>{
|
|
164
|
+
if (isControlled) {
|
|
165
|
+
const setter = nextValue;
|
|
166
|
+
const value = typeof nextValue === 'function' ? setter(prop) : nextValue;
|
|
167
|
+
if (value !== prop) handleChange(value);
|
|
168
|
+
} else setUncontrolledProp(nextValue);
|
|
169
|
+
}, [
|
|
170
|
+
isControlled,
|
|
171
|
+
prop,
|
|
172
|
+
setUncontrolledProp,
|
|
173
|
+
handleChange
|
|
174
|
+
]);
|
|
175
|
+
return [
|
|
176
|
+
value1,
|
|
177
|
+
setValue
|
|
178
|
+
];
|
|
179
|
+
}
|
|
180
|
+
function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp: defaultProp , onChange: onChange }) {
|
|
181
|
+
const uncontrolledState = useState(defaultProp);
|
|
182
|
+
const [value] = uncontrolledState;
|
|
183
|
+
const prevValueRef = useRef(value);
|
|
184
|
+
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
185
|
+
useEffect(()=>{
|
|
186
|
+
if (prevValueRef.current !== value) {
|
|
187
|
+
handleChange(value);
|
|
188
|
+
prevValueRef.current = value;
|
|
189
|
+
}
|
|
190
|
+
}, [
|
|
191
|
+
value,
|
|
192
|
+
prevValueRef,
|
|
193
|
+
handleChange
|
|
194
|
+
]);
|
|
195
|
+
return uncontrolledState;
|
|
130
196
|
}
|
|
131
197
|
|
|
132
198
|
/* -------------------------------------------------------------------------------------------------
|
|
@@ -161,7 +227,7 @@ $5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';
|
|
|
161
227
|
const { children: children , ...slotProps } = props;
|
|
162
228
|
if (/*#__PURE__*/ isValidElement(children)) return /*#__PURE__*/ cloneElement(children, {
|
|
163
229
|
...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),
|
|
164
|
-
ref: $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref)
|
|
230
|
+
ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref) : children.ref
|
|
165
231
|
});
|
|
166
232
|
return Children.count(children) > 1 ? Children.only(null) : null;
|
|
167
233
|
});
|
|
@@ -209,9 +275,11 @@ const $8927f6f2acc4f386$var$NODES = [
|
|
|
209
275
|
'a',
|
|
210
276
|
'button',
|
|
211
277
|
'div',
|
|
278
|
+
'form',
|
|
212
279
|
'h2',
|
|
213
280
|
'h3',
|
|
214
281
|
'img',
|
|
282
|
+
'input',
|
|
215
283
|
'label',
|
|
216
284
|
'li',
|
|
217
285
|
'nav',
|
|
@@ -284,88 +352,4 @@ const $8927f6f2acc4f386$var$NODES = [
|
|
|
284
352
|
);
|
|
285
353
|
}
|
|
286
354
|
|
|
287
|
-
|
|
288
|
-
* A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
|
|
289
|
-
* prop or avoid re-executing effects when passed as a dependency
|
|
290
|
-
*/ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
|
|
291
|
-
const callbackRef = useRef(callback);
|
|
292
|
-
useEffect(()=>{
|
|
293
|
-
callbackRef.current = callback;
|
|
294
|
-
}); // https://github.com/facebook/react/issues/19240
|
|
295
|
-
return useMemo(()=>(...args)=>{
|
|
296
|
-
var _callbackRef$current;
|
|
297
|
-
return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
|
|
298
|
-
}
|
|
299
|
-
, []);
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
/**
|
|
303
|
-
* On the server, React emits a warning when calling `useLayoutEffect`.
|
|
304
|
-
* This is because neither `useLayoutEffect` nor `useEffect` run on the server.
|
|
305
|
-
* We use this safe version which suppresses the warning by replacing it with a noop on the server.
|
|
306
|
-
*
|
|
307
|
-
* See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
|
|
308
|
-
*/ const $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? useLayoutEffect : ()=>{};
|
|
309
|
-
|
|
310
|
-
function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop: prop , defaultProp: defaultProp , onChange: onChange = ()=>{} }) {
|
|
311
|
-
const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({
|
|
312
|
-
defaultProp: defaultProp,
|
|
313
|
-
onChange: onChange
|
|
314
|
-
});
|
|
315
|
-
const isControlled = prop !== undefined;
|
|
316
|
-
const value1 = isControlled ? prop : uncontrolledProp;
|
|
317
|
-
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
318
|
-
const setValue = useCallback((nextValue)=>{
|
|
319
|
-
if (isControlled) {
|
|
320
|
-
const setter = nextValue;
|
|
321
|
-
const value = typeof nextValue === 'function' ? setter(prop) : nextValue;
|
|
322
|
-
if (value !== prop) handleChange(value);
|
|
323
|
-
} else setUncontrolledProp(nextValue);
|
|
324
|
-
}, [
|
|
325
|
-
isControlled,
|
|
326
|
-
prop,
|
|
327
|
-
setUncontrolledProp,
|
|
328
|
-
handleChange
|
|
329
|
-
]);
|
|
330
|
-
return [
|
|
331
|
-
value1,
|
|
332
|
-
setValue
|
|
333
|
-
];
|
|
334
|
-
}
|
|
335
|
-
function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp: defaultProp , onChange: onChange }) {
|
|
336
|
-
const uncontrolledState = useState(defaultProp);
|
|
337
|
-
const [value] = uncontrolledState;
|
|
338
|
-
const prevValueRef = useRef(value);
|
|
339
|
-
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
340
|
-
useEffect(()=>{
|
|
341
|
-
if (prevValueRef.current !== value) {
|
|
342
|
-
handleChange(value);
|
|
343
|
-
prevValueRef.current = value;
|
|
344
|
-
}
|
|
345
|
-
}, [
|
|
346
|
-
value,
|
|
347
|
-
prevValueRef,
|
|
348
|
-
handleChange
|
|
349
|
-
]);
|
|
350
|
-
return uncontrolledState;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
function $010c2913dbd2fe3d$export$5cae361ad82dce8b(value) {
|
|
354
|
-
const ref = useRef({
|
|
355
|
-
value: value,
|
|
356
|
-
previous: value
|
|
357
|
-
}); // We compare values before making an update to ensure that
|
|
358
|
-
// a change has been made. This ensures the previous value is
|
|
359
|
-
// persisted correctly between renders.
|
|
360
|
-
return useMemo(()=>{
|
|
361
|
-
if (ref.current.value !== value) {
|
|
362
|
-
ref.current.previous = ref.current.value;
|
|
363
|
-
ref.current.value = value;
|
|
364
|
-
}
|
|
365
|
-
return ref.current.previous;
|
|
366
|
-
}, [
|
|
367
|
-
value
|
|
368
|
-
]);
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
export { $c512c27ab02ef895$export$50c7b4e9d9f19c1 as $, $6ed0406888f73fc4$export$c7b2cbe3552a0d05 as a, $5e63c961fc1ce211$export$8c6ed5c666ac1360 as b, $b1b2314f5f9a1d84$export$25bec8c6f54ee79a as c, $8927f6f2acc4f386$export$250ffa63cdc0d034 as d, $e42e1063c40fb3ef$export$b9ecd428b558ff10 as e, $8927f6f2acc4f386$export$6d1a0317bde7de7f as f, $9f79659886946c16$export$e5c5a5f917a5871c as g, $71cd76cc60e0454e$export$6f32135080cb4c3 as h, $010c2913dbd2fe3d$export$5cae361ad82dce8b as i };
|
|
355
|
+
export { $b1b2314f5f9a1d84$export$25bec8c6f54ee79a as $, $6ed0406888f73fc4$export$c7b2cbe3552a0d05 as a, $8927f6f2acc4f386$export$250ffa63cdc0d034 as b, $c512c27ab02ef895$export$50c7b4e9d9f19c1 as c, $71cd76cc60e0454e$export$6f32135080cb4c3 as d, $5e63c961fc1ce211$export$8c6ed5c666ac1360 as e, $e42e1063c40fb3ef$export$b9ecd428b558ff10 as f, $9f79659886946c16$export$e5c5a5f917a5871c as g, $8927f6f2acc4f386$export$6d1a0317bde7de7f as h };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { $ as $b1b2314f5f9a1d84$export$25bec8c6f54ee79a } from './index-12f3a407.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Listens for when the escape key is down
|
|
6
|
+
*/ function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
7
|
+
const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEscapeKeyDownProp);
|
|
8
|
+
useEffect(()=>{
|
|
9
|
+
const handleKeyDown = (event)=>{
|
|
10
|
+
if (event.key === 'Escape') onEscapeKeyDown(event);
|
|
11
|
+
};
|
|
12
|
+
ownerDocument.addEventListener('keydown', handleKeyDown);
|
|
13
|
+
return ()=>ownerDocument.removeEventListener('keydown', handleKeyDown)
|
|
14
|
+
;
|
|
15
|
+
}, [
|
|
16
|
+
onEscapeKeyDown,
|
|
17
|
+
ownerDocument
|
|
18
|
+
]);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { $addc16e1bbe58fd0$export$3a72a57244d6e765 as $ };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
|
-
import { c as $c512c27ab02ef895$export$50c7b4e9d9f19c1, a as $6ed0406888f73fc4$export$c7b2cbe3552a0d05,
|
|
2
|
+
import { c as $c512c27ab02ef895$export$50c7b4e9d9f19c1, a as $6ed0406888f73fc4$export$c7b2cbe3552a0d05, e as $5e63c961fc1ce211$export$8c6ed5c666ac1360 } from './index-12f3a407.js';
|
|
3
3
|
|
|
4
4
|
// We have resorted to returning slots directly rather than exposing primitives that can then
|
|
5
5
|
// be slotted like `<CollectionItem as={Slot}>…</CollectionItem>`.
|
|
@@ -1,6 +1,32 @@
|
|
|
1
|
-
import { a as __assign, _ as __rest, b as __spreadArray } from './filter-data-attrs-ea8f4ed4.js';
|
|
2
1
|
import * as React from 'react';
|
|
3
|
-
import { useState } from 'react';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { a as __assign, _ as __rest, b as __spreadArray } from './filter-data-attrs-ea8f4ed4.js';
|
|
4
|
+
|
|
5
|
+
/** Number of components which have requested interest to have focus guards */ let $3db38b7d1fb3fe6a$var$count = 0;
|
|
6
|
+
/**
|
|
7
|
+
* Injects a pair of focus guards at the edges of the whole DOM tree
|
|
8
|
+
* to ensure `focusin` & `focusout` events can be caught consistently.
|
|
9
|
+
*/ function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c() {
|
|
10
|
+
useEffect(()=>{
|
|
11
|
+
var _edgeGuards$, _edgeGuards$2;
|
|
12
|
+
const edgeGuards = document.querySelectorAll('[data-radix-focus-guard]');
|
|
13
|
+
document.body.insertAdjacentElement('afterbegin', (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard());
|
|
14
|
+
document.body.insertAdjacentElement('beforeend', (_edgeGuards$2 = edgeGuards[1]) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $3db38b7d1fb3fe6a$var$createFocusGuard());
|
|
15
|
+
$3db38b7d1fb3fe6a$var$count++;
|
|
16
|
+
return ()=>{
|
|
17
|
+
if ($3db38b7d1fb3fe6a$var$count === 1) document.querySelectorAll('[data-radix-focus-guard]').forEach((node)=>node.remove()
|
|
18
|
+
);
|
|
19
|
+
$3db38b7d1fb3fe6a$var$count--;
|
|
20
|
+
};
|
|
21
|
+
}, []);
|
|
22
|
+
}
|
|
23
|
+
function $3db38b7d1fb3fe6a$var$createFocusGuard() {
|
|
24
|
+
const element = document.createElement('span');
|
|
25
|
+
element.setAttribute('data-radix-focus-guard', '');
|
|
26
|
+
element.tabIndex = 0;
|
|
27
|
+
element.style.cssText = 'outline: none; opacity: 0; position: fixed; pointer-events: none';
|
|
28
|
+
return element;
|
|
29
|
+
}
|
|
4
30
|
|
|
5
31
|
var zeroRightClassName = 'right-scroll-bar-position';
|
|
6
32
|
var fullWidthClassName = 'width-before-scroll-bar';
|
|
@@ -761,4 +787,4 @@ var hideOthers = function (originalTarget, parentNode, markerName) {
|
|
|
761
787
|
return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden');
|
|
762
788
|
};
|
|
763
789
|
|
|
764
|
-
export { $01b9c$RemoveScroll as $, hideOthers as h };
|
|
790
|
+
export { $01b9c$RemoveScroll as $, $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c as a, hideOthers as h };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { _ as _extends } from './extends-8cc61aad.js';
|
|
2
|
+
import { forwardRef, createElement } from 'react';
|
|
3
|
+
import { b as $8927f6f2acc4f386$export$250ffa63cdc0d034 } from './index-12f3a407.js';
|
|
4
|
+
|
|
5
|
+
const $ea1ef594cf570d83$export$439d29a4e110a164 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
6
|
+
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, props, {
|
|
7
|
+
ref: forwardedRef,
|
|
8
|
+
style: {
|
|
9
|
+
// See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss
|
|
10
|
+
position: 'absolute',
|
|
11
|
+
border: 0,
|
|
12
|
+
width: 1,
|
|
13
|
+
height: 1,
|
|
14
|
+
padding: 0,
|
|
15
|
+
margin: -1,
|
|
16
|
+
overflow: 'hidden',
|
|
17
|
+
clip: 'rect(0, 0, 0, 0)',
|
|
18
|
+
whiteSpace: 'nowrap',
|
|
19
|
+
wordWrap: 'normal',
|
|
20
|
+
...props.style
|
|
21
|
+
}
|
|
22
|
+
}));
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export { $ea1ef594cf570d83$export$439d29a4e110a164 as $ };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { g as $9f79659886946c16$export$e5c5a5f917a5871c } from './index-12f3a407.js';
|
|
3
3
|
|
|
4
4
|
const $1746a345f3d73bb7$var$useReactId = React['useId'.toString()] || (()=>undefined
|
|
5
5
|
);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useContext, createContext } from 'react';
|
|
2
|
+
|
|
3
|
+
const $f631663db3294ace$var$DirectionContext = /*#__PURE__*/ createContext(undefined);
|
|
4
|
+
/* -----------------------------------------------------------------------------------------------*/ function $f631663db3294ace$export$b39126d51d94e6f3(localDir) {
|
|
5
|
+
const globalDir = useContext($f631663db3294ace$var$DirectionContext);
|
|
6
|
+
return localDir || globalDir || 'ltr';
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { $f631663db3294ace$export$b39126d51d94e6f3 as $ };
|
|
@@ -1,24 +1,8 @@
|
|
|
1
1
|
import { _ as _extends } from './extends-8cc61aad.js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import $
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Listens for when the escape key is down
|
|
8
|
-
*/ function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
9
|
-
const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEscapeKeyDownProp);
|
|
10
|
-
useEffect(()=>{
|
|
11
|
-
const handleKeyDown = (event)=>{
|
|
12
|
-
if (event.key === 'Escape') onEscapeKeyDown(event);
|
|
13
|
-
};
|
|
14
|
-
ownerDocument.addEventListener('keydown', handleKeyDown);
|
|
15
|
-
return ()=>ownerDocument.removeEventListener('keydown', handleKeyDown)
|
|
16
|
-
;
|
|
17
|
-
}, [
|
|
18
|
-
onEscapeKeyDown,
|
|
19
|
-
ownerDocument
|
|
20
|
-
]);
|
|
21
|
-
}
|
|
2
|
+
import { forwardRef, useContext, useState, useEffect, createElement, useRef, createContext } from 'react';
|
|
3
|
+
import { a as $6ed0406888f73fc4$export$c7b2cbe3552a0d05, b as $8927f6f2acc4f386$export$250ffa63cdc0d034, f as $e42e1063c40fb3ef$export$b9ecd428b558ff10, $ as $b1b2314f5f9a1d84$export$25bec8c6f54ee79a, h as $8927f6f2acc4f386$export$6d1a0317bde7de7f } from './index-12f3a407.js';
|
|
4
|
+
import { $ as $addc16e1bbe58fd0$export$3a72a57244d6e765 } from './index-246b4f18.js';
|
|
5
|
+
import $7SXl2$reactdom__default from 'react-dom';
|
|
22
6
|
|
|
23
7
|
const $5cb92bef7577960e$var$CONTEXT_UPDATE = 'dismissableLayer.update';
|
|
24
8
|
const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';
|
|
@@ -272,7 +256,7 @@ const $5cb92bef7577960e$export$aecb2ddcb55c95be = $5cb92bef7577960e$export$4d5eb
|
|
|
272
256
|
const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
273
257
|
var _globalThis$document;
|
|
274
258
|
const { container: container = globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : _globalThis$document.body , ...portalProps } = props;
|
|
275
|
-
return container ? /*#__PURE__*/ $7SXl2$
|
|
259
|
+
return container ? /*#__PURE__*/ $7SXl2$reactdom__default.createPortal(/*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, portalProps, {
|
|
276
260
|
ref: forwardedRef
|
|
277
261
|
})), container) : null;
|
|
278
262
|
});
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { Children, cloneElement, useState, useRef, useEffect, useCallback, useReducer } from 'react';
|
|
2
|
+
import { flushSync } from 'react-dom';
|
|
3
|
+
import { a as $6ed0406888f73fc4$export$c7b2cbe3552a0d05, g as $9f79659886946c16$export$e5c5a5f917a5871c } from './index-12f3a407.js';
|
|
4
|
+
|
|
5
|
+
function $fe963b355347cc68$export$3e6543de14f8614f(initialState, machine) {
|
|
6
|
+
return useReducer((state, event)=>{
|
|
7
|
+
const nextState = machine[state][event];
|
|
8
|
+
return nextState !== null && nextState !== void 0 ? nextState : state;
|
|
9
|
+
}, initialState);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
const $921a889cee6df7e8$export$99c2b779aa4e8b8b = (props)=>{
|
|
14
|
+
const { present: present , children: children } = props;
|
|
15
|
+
const presence = $921a889cee6df7e8$var$usePresence(present);
|
|
16
|
+
const child = typeof children === 'function' ? children({
|
|
17
|
+
present: presence.isPresent
|
|
18
|
+
}) : Children.only(children);
|
|
19
|
+
const ref = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(presence.ref, child.ref);
|
|
20
|
+
const forceMount = typeof children === 'function';
|
|
21
|
+
return forceMount || presence.isPresent ? /*#__PURE__*/ cloneElement(child, {
|
|
22
|
+
ref: ref
|
|
23
|
+
}) : null;
|
|
24
|
+
};
|
|
25
|
+
$921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName = 'Presence';
|
|
26
|
+
/* -------------------------------------------------------------------------------------------------
|
|
27
|
+
* usePresence
|
|
28
|
+
* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$usePresence(present) {
|
|
29
|
+
const [node1, setNode] = useState();
|
|
30
|
+
const stylesRef = useRef({});
|
|
31
|
+
const prevPresentRef = useRef(present);
|
|
32
|
+
const prevAnimationNameRef = useRef('none');
|
|
33
|
+
const initialState = present ? 'mounted' : 'unmounted';
|
|
34
|
+
const [state, send] = $fe963b355347cc68$export$3e6543de14f8614f(initialState, {
|
|
35
|
+
mounted: {
|
|
36
|
+
UNMOUNT: 'unmounted',
|
|
37
|
+
ANIMATION_OUT: 'unmountSuspended'
|
|
38
|
+
},
|
|
39
|
+
unmountSuspended: {
|
|
40
|
+
MOUNT: 'mounted',
|
|
41
|
+
ANIMATION_END: 'unmounted'
|
|
42
|
+
},
|
|
43
|
+
unmounted: {
|
|
44
|
+
MOUNT: 'mounted'
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
useEffect(()=>{
|
|
48
|
+
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
|
|
49
|
+
prevAnimationNameRef.current = state === 'mounted' ? currentAnimationName : 'none';
|
|
50
|
+
}, [
|
|
51
|
+
state
|
|
52
|
+
]);
|
|
53
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
54
|
+
const styles = stylesRef.current;
|
|
55
|
+
const wasPresent = prevPresentRef.current;
|
|
56
|
+
const hasPresentChanged = wasPresent !== present;
|
|
57
|
+
if (hasPresentChanged) {
|
|
58
|
+
const prevAnimationName = prevAnimationNameRef.current;
|
|
59
|
+
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(styles);
|
|
60
|
+
if (present) send('MOUNT');
|
|
61
|
+
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
|
|
62
|
+
// so we unmount instantly
|
|
63
|
+
send('UNMOUNT');
|
|
64
|
+
else {
|
|
65
|
+
/**
|
|
66
|
+
* When `present` changes to `false`, we check changes to animation-name to
|
|
67
|
+
* determine whether an animation has started. We chose this approach (reading
|
|
68
|
+
* computed styles) because there is no `animationrun` event and `animationstart`
|
|
69
|
+
* fires after `animation-delay` has expired which would be too late.
|
|
70
|
+
*/ const isAnimating = prevAnimationName !== currentAnimationName;
|
|
71
|
+
if (wasPresent && isAnimating) send('ANIMATION_OUT');
|
|
72
|
+
else send('UNMOUNT');
|
|
73
|
+
}
|
|
74
|
+
prevPresentRef.current = present;
|
|
75
|
+
}
|
|
76
|
+
}, [
|
|
77
|
+
present,
|
|
78
|
+
send
|
|
79
|
+
]);
|
|
80
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
81
|
+
if (node1) {
|
|
82
|
+
/**
|
|
83
|
+
* Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel`
|
|
84
|
+
* event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we
|
|
85
|
+
* make sure we only trigger ANIMATION_END for the currently active animation.
|
|
86
|
+
*/ const handleAnimationEnd = (event)=>{
|
|
87
|
+
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
|
|
88
|
+
const isCurrentAnimation = currentAnimationName.includes(event.animationName);
|
|
89
|
+
if (event.target === node1 && isCurrentAnimation) // With React 18 concurrency this update is applied
|
|
90
|
+
// a frame after the animation ends, creating a flash of visible content.
|
|
91
|
+
// By manually flushing we ensure they sync within a frame, removing the flash.
|
|
92
|
+
flushSync(()=>send('ANIMATION_END')
|
|
93
|
+
);
|
|
94
|
+
};
|
|
95
|
+
const handleAnimationStart = (event)=>{
|
|
96
|
+
if (event.target === node1) // if animation occurred, store its name as the previous animation.
|
|
97
|
+
prevAnimationNameRef.current = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
|
|
98
|
+
};
|
|
99
|
+
node1.addEventListener('animationstart', handleAnimationStart);
|
|
100
|
+
node1.addEventListener('animationcancel', handleAnimationEnd);
|
|
101
|
+
node1.addEventListener('animationend', handleAnimationEnd);
|
|
102
|
+
return ()=>{
|
|
103
|
+
node1.removeEventListener('animationstart', handleAnimationStart);
|
|
104
|
+
node1.removeEventListener('animationcancel', handleAnimationEnd);
|
|
105
|
+
node1.removeEventListener('animationend', handleAnimationEnd);
|
|
106
|
+
};
|
|
107
|
+
} else // Transition to the unmounted state if the node is removed prematurely.
|
|
108
|
+
// We avoid doing so during cleanup as the node may change but still exist.
|
|
109
|
+
send('ANIMATION_END');
|
|
110
|
+
}, [
|
|
111
|
+
node1,
|
|
112
|
+
send
|
|
113
|
+
]);
|
|
114
|
+
return {
|
|
115
|
+
isPresent: [
|
|
116
|
+
'mounted',
|
|
117
|
+
'unmountSuspended'
|
|
118
|
+
].includes(state),
|
|
119
|
+
ref: useCallback((node)=>{
|
|
120
|
+
if (node) stylesRef.current = getComputedStyle(node);
|
|
121
|
+
setNode(node);
|
|
122
|
+
}, [])
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
/* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$getAnimationName(styles) {
|
|
126
|
+
return (styles === null || styles === void 0 ? void 0 : styles.animationName) || 'none';
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export { $921a889cee6df7e8$export$99c2b779aa4e8b8b as $ };
|