@betterinternship/components 1.0.1 → 1.3.1
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/components/Button.d.ts +12 -0
- package/dist/hooks/ClientTask.d.ts +21 -0
- package/dist/index.css +101 -0
- package/dist/index.d.mts +15 -0
- package/dist/index.d.ts +6 -34
- package/dist/index.esm.js +5 -1500
- package/dist/index.esm.js.map +1 -1
- package/dist/index.mjs +98 -0
- package/dist/tailwind.css +126 -0
- package/dist/utils.d.ts +2 -0
- package/package.json +121 -82
- package/dist/index.js +0 -1580
- package/dist/index.js.map +0 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,1504 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import * as r$o from '@radix-ui/react-alert-dialog';
|
|
4
|
-
export { r$o as AlertDialog };
|
|
5
|
-
import * as t$e from '@radix-ui/react-aspect-ratio';
|
|
6
|
-
export { t$e as AspectRatio };
|
|
7
|
-
import * as m$8 from '@radix-ui/react-avatar';
|
|
8
|
-
export { m$8 as Avatar };
|
|
9
|
-
import * as C$1 from '@radix-ui/react-checkbox';
|
|
10
|
-
export { C$1 as Checkbox };
|
|
11
|
-
import * as React from 'react';
|
|
12
|
-
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
13
|
-
import * as ReactDOM from 'react-dom';
|
|
14
|
-
import ReactDOM__default from 'react-dom';
|
|
15
|
-
import * as r$p from '@radix-ui/react-context-menu';
|
|
16
|
-
export { r$p as ContextMenu };
|
|
17
|
-
import * as t$f from '@radix-ui/react-dialog';
|
|
18
|
-
export { t$f as Dialog };
|
|
19
|
-
import * as t$g from '@radix-ui/react-dropdown-menu';
|
|
20
|
-
export { t$g as DropdownMenu };
|
|
21
|
-
import { Label as Label$1 } from '@radix-ui/react-label';
|
|
22
|
-
import * as reactLabel from '@radix-ui/react-label';
|
|
23
|
-
export { reactLabel as Label };
|
|
24
|
-
import * as o$d from '@radix-ui/react-hover-card';
|
|
25
|
-
export { o$d as HoverCard };
|
|
26
|
-
import * as reactMenubar from '@radix-ui/react-menubar';
|
|
27
|
-
export { reactMenubar as Menubar };
|
|
28
|
-
import * as e$q from '@radix-ui/react-navigation-menu';
|
|
29
|
-
export { e$q as NavigationMenu };
|
|
30
|
-
import * as p$j from '@radix-ui/react-popover';
|
|
31
|
-
export { p$j as Popover };
|
|
32
|
-
import * as e$r from '@radix-ui/react-progress';
|
|
33
|
-
export { e$r as Progress };
|
|
34
|
-
import * as R$3 from '@radix-ui/react-radio-group';
|
|
35
|
-
export { R$3 as RadioGroup };
|
|
36
|
-
import * as e$s from '@radix-ui/react-scroll-area';
|
|
37
|
-
export { e$s as ScrollArea };
|
|
38
|
-
import * as l$5 from '@radix-ui/react-select';
|
|
39
|
-
export { l$5 as Select };
|
|
40
|
-
import * as reactSeparator from '@radix-ui/react-separator';
|
|
41
|
-
export { reactSeparator as Separator };
|
|
42
|
-
import * as o$e from '@radix-ui/react-slider';
|
|
43
|
-
export { o$e as Slider };
|
|
44
|
-
import * as e$t from '@radix-ui/react-switch';
|
|
45
|
-
export { e$t as Switch };
|
|
46
|
-
import * as p$k from '@radix-ui/react-tabs';
|
|
47
|
-
export { p$k as Tabs };
|
|
48
|
-
import * as reactToast from '@radix-ui/react-toast';
|
|
49
|
-
export { reactToast as Toast };
|
|
50
|
-
import * as reactToggle from '@radix-ui/react-toggle';
|
|
51
|
-
export { reactToggle as Toggle };
|
|
52
|
-
import * as m$9 from '@radix-ui/react-toggle-group';
|
|
53
|
-
export { m$9 as ToggleGroup };
|
|
54
|
-
import * as reactToolbar from '@radix-ui/react-toolbar';
|
|
55
|
-
export { reactToolbar as Toolbar };
|
|
56
|
-
import * as t$h from '@radix-ui/react-tooltip';
|
|
57
|
-
export { t$h as Tooltip };
|
|
58
|
-
|
|
59
|
-
// packages/core/primitive/src/primitive.tsx
|
|
60
|
-
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
61
|
-
return function handleEvent(event) {
|
|
62
|
-
originalEventHandler?.(event);
|
|
63
|
-
if (checkForDefaultPrevented === false || !event.defaultPrevented) {
|
|
64
|
-
return ourEventHandler?.(event);
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// packages/react/context/src/create-context.tsx
|
|
70
|
-
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
71
|
-
let defaultContexts = [];
|
|
72
|
-
function createContext3(rootComponentName, defaultContext) {
|
|
73
|
-
const BaseContext = React.createContext(defaultContext);
|
|
74
|
-
const index = defaultContexts.length;
|
|
75
|
-
defaultContexts = [...defaultContexts, defaultContext];
|
|
76
|
-
const Provider = (props) => {
|
|
77
|
-
const { scope, children, ...context } = props;
|
|
78
|
-
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
79
|
-
const value = React.useMemo(() => context, Object.values(context));
|
|
80
|
-
return /* @__PURE__ */ jsx(Context.Provider, { value, children });
|
|
81
|
-
};
|
|
82
|
-
Provider.displayName = rootComponentName + "Provider";
|
|
83
|
-
function useContext2(consumerName, scope) {
|
|
84
|
-
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
85
|
-
const context = React.useContext(Context);
|
|
86
|
-
if (context) return context;
|
|
87
|
-
if (defaultContext !== void 0) return defaultContext;
|
|
88
|
-
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
89
|
-
}
|
|
90
|
-
return [Provider, useContext2];
|
|
91
|
-
}
|
|
92
|
-
const createScope = () => {
|
|
93
|
-
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
94
|
-
return React.createContext(defaultContext);
|
|
95
|
-
});
|
|
96
|
-
return function useScope(scope) {
|
|
97
|
-
const contexts = scope?.[scopeName] || scopeContexts;
|
|
98
|
-
return React.useMemo(
|
|
99
|
-
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
100
|
-
[scope, contexts]
|
|
101
|
-
);
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
createScope.scopeName = scopeName;
|
|
105
|
-
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
106
|
-
}
|
|
107
|
-
function composeContextScopes(...scopes) {
|
|
108
|
-
const baseScope = scopes[0];
|
|
109
|
-
if (scopes.length === 1) return baseScope;
|
|
110
|
-
const createScope = () => {
|
|
111
|
-
const scopeHooks = scopes.map((createScope2) => ({
|
|
112
|
-
useScope: createScope2(),
|
|
113
|
-
scopeName: createScope2.scopeName
|
|
114
|
-
}));
|
|
115
|
-
return function useComposedScopes(overrideScopes) {
|
|
116
|
-
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
117
|
-
const scopeProps = useScope(overrideScopes);
|
|
118
|
-
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
119
|
-
return { ...nextScopes2, ...currentScope };
|
|
120
|
-
}, {});
|
|
121
|
-
return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
122
|
-
};
|
|
123
|
-
};
|
|
124
|
-
createScope.scopeName = baseScope.scopeName;
|
|
125
|
-
return createScope;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// packages/react/use-layout-effect/src/use-layout-effect.tsx
|
|
129
|
-
var useLayoutEffect2 = globalThis?.document ? React.useLayoutEffect : () => {
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
// src/use-controllable-state.tsx
|
|
133
|
-
var useInsertionEffect = React[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
134
|
-
function useControllableState({
|
|
135
|
-
prop,
|
|
136
|
-
defaultProp,
|
|
137
|
-
onChange = () => {
|
|
138
|
-
},
|
|
139
|
-
caller
|
|
140
|
-
}) {
|
|
141
|
-
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
|
|
142
|
-
defaultProp,
|
|
143
|
-
onChange
|
|
144
|
-
});
|
|
145
|
-
const isControlled = prop !== void 0;
|
|
146
|
-
const value = isControlled ? prop : uncontrolledProp;
|
|
147
|
-
{
|
|
148
|
-
const isControlledRef = React.useRef(prop !== void 0);
|
|
149
|
-
React.useEffect(() => {
|
|
150
|
-
const wasControlled = isControlledRef.current;
|
|
151
|
-
if (wasControlled !== isControlled) {
|
|
152
|
-
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
153
|
-
const to = isControlled ? "controlled" : "uncontrolled";
|
|
154
|
-
console.warn(
|
|
155
|
-
`${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
156
|
-
);
|
|
157
|
-
}
|
|
158
|
-
isControlledRef.current = isControlled;
|
|
159
|
-
}, [isControlled, caller]);
|
|
160
|
-
}
|
|
161
|
-
const setValue = React.useCallback(
|
|
162
|
-
(nextValue) => {
|
|
163
|
-
if (isControlled) {
|
|
164
|
-
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
165
|
-
if (value2 !== prop) {
|
|
166
|
-
onChangeRef.current?.(value2);
|
|
167
|
-
}
|
|
168
|
-
} else {
|
|
169
|
-
setUncontrolledProp(nextValue);
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
|
-
[isControlled, prop, setUncontrolledProp, onChangeRef]
|
|
173
|
-
);
|
|
174
|
-
return [value, setValue];
|
|
175
|
-
}
|
|
176
|
-
function useUncontrolledState({
|
|
177
|
-
defaultProp,
|
|
178
|
-
onChange
|
|
179
|
-
}) {
|
|
180
|
-
const [value, setValue] = React.useState(defaultProp);
|
|
181
|
-
const prevValueRef = React.useRef(value);
|
|
182
|
-
const onChangeRef = React.useRef(onChange);
|
|
183
|
-
useInsertionEffect(() => {
|
|
184
|
-
onChangeRef.current = onChange;
|
|
185
|
-
}, [onChange]);
|
|
186
|
-
React.useEffect(() => {
|
|
187
|
-
if (prevValueRef.current !== value) {
|
|
188
|
-
onChangeRef.current?.(value);
|
|
189
|
-
prevValueRef.current = value;
|
|
190
|
-
}
|
|
191
|
-
}, [value, prevValueRef]);
|
|
192
|
-
return [value, setValue, onChangeRef];
|
|
193
|
-
}
|
|
194
|
-
function isFunction(value) {
|
|
195
|
-
return typeof value === "function";
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
// packages/react/compose-refs/src/compose-refs.tsx
|
|
199
|
-
function setRef(ref, value) {
|
|
200
|
-
if (typeof ref === "function") {
|
|
201
|
-
return ref(value);
|
|
202
|
-
} else if (ref !== null && ref !== void 0) {
|
|
203
|
-
ref.current = value;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
function composeRefs(...refs) {
|
|
207
|
-
return (node) => {
|
|
208
|
-
let hasCleanup = false;
|
|
209
|
-
const cleanups = refs.map((ref) => {
|
|
210
|
-
const cleanup = setRef(ref, node);
|
|
211
|
-
if (!hasCleanup && typeof cleanup == "function") {
|
|
212
|
-
hasCleanup = true;
|
|
213
|
-
}
|
|
214
|
-
return cleanup;
|
|
215
|
-
});
|
|
216
|
-
if (hasCleanup) {
|
|
217
|
-
return () => {
|
|
218
|
-
for (let i = 0; i < cleanups.length; i++) {
|
|
219
|
-
const cleanup = cleanups[i];
|
|
220
|
-
if (typeof cleanup == "function") {
|
|
221
|
-
cleanup();
|
|
222
|
-
} else {
|
|
223
|
-
setRef(refs[i], null);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
function useComposedRefs(...refs) {
|
|
231
|
-
return React.useCallback(composeRefs(...refs), refs);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
// src/slot.tsx
|
|
235
|
-
// @__NO_SIDE_EFFECTS__
|
|
236
|
-
function createSlot(ownerName) {
|
|
237
|
-
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
238
|
-
const Slot2 = React.forwardRef((props, forwardedRef) => {
|
|
239
|
-
const { children, ...slotProps } = props;
|
|
240
|
-
const childrenArray = React.Children.toArray(children);
|
|
241
|
-
const slottable = childrenArray.find(isSlottable);
|
|
242
|
-
if (slottable) {
|
|
243
|
-
const newElement = slottable.props.children;
|
|
244
|
-
const newChildren = childrenArray.map((child) => {
|
|
245
|
-
if (child === slottable) {
|
|
246
|
-
if (React.Children.count(newElement) > 1) return React.Children.only(null);
|
|
247
|
-
return React.isValidElement(newElement) ? newElement.props.children : null;
|
|
248
|
-
} else {
|
|
249
|
-
return child;
|
|
250
|
-
}
|
|
251
|
-
});
|
|
252
|
-
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
|
|
253
|
-
}
|
|
254
|
-
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
255
|
-
});
|
|
256
|
-
Slot2.displayName = `${ownerName}.Slot`;
|
|
257
|
-
return Slot2;
|
|
258
|
-
}
|
|
259
|
-
var Slot = /* @__PURE__ */ createSlot("Slot");
|
|
260
|
-
// @__NO_SIDE_EFFECTS__
|
|
261
|
-
function createSlotClone(ownerName) {
|
|
262
|
-
const SlotClone = React.forwardRef((props, forwardedRef) => {
|
|
263
|
-
const { children, ...slotProps } = props;
|
|
264
|
-
if (React.isValidElement(children)) {
|
|
265
|
-
const childrenRef = getElementRef$1(children);
|
|
266
|
-
const props2 = mergeProps(slotProps, children.props);
|
|
267
|
-
if (children.type !== React.Fragment) {
|
|
268
|
-
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
269
|
-
}
|
|
270
|
-
return React.cloneElement(children, props2);
|
|
271
|
-
}
|
|
272
|
-
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
273
|
-
});
|
|
274
|
-
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
275
|
-
return SlotClone;
|
|
276
|
-
}
|
|
277
|
-
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
278
|
-
// @__NO_SIDE_EFFECTS__
|
|
279
|
-
function createSlottable(ownerName) {
|
|
280
|
-
const Slottable2 = ({ children }) => {
|
|
281
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
282
|
-
};
|
|
283
|
-
Slottable2.displayName = `${ownerName}.Slottable`;
|
|
284
|
-
Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
|
|
285
|
-
return Slottable2;
|
|
286
|
-
}
|
|
287
|
-
var Slottable = /* @__PURE__ */ createSlottable("Slottable");
|
|
288
|
-
function isSlottable(child) {
|
|
289
|
-
return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
290
|
-
}
|
|
291
|
-
function mergeProps(slotProps, childProps) {
|
|
292
|
-
const overrideProps = { ...childProps };
|
|
293
|
-
for (const propName in childProps) {
|
|
294
|
-
const slotPropValue = slotProps[propName];
|
|
295
|
-
const childPropValue = childProps[propName];
|
|
296
|
-
const isHandler = /^on[A-Z]/.test(propName);
|
|
297
|
-
if (isHandler) {
|
|
298
|
-
if (slotPropValue && childPropValue) {
|
|
299
|
-
overrideProps[propName] = (...args) => {
|
|
300
|
-
const result = childPropValue(...args);
|
|
301
|
-
slotPropValue(...args);
|
|
302
|
-
return result;
|
|
303
|
-
};
|
|
304
|
-
} else if (slotPropValue) {
|
|
305
|
-
overrideProps[propName] = slotPropValue;
|
|
306
|
-
}
|
|
307
|
-
} else if (propName === "style") {
|
|
308
|
-
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
309
|
-
} else if (propName === "className") {
|
|
310
|
-
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
return { ...slotProps, ...overrideProps };
|
|
314
|
-
}
|
|
315
|
-
function getElementRef$1(element) {
|
|
316
|
-
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
317
|
-
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
318
|
-
if (mayWarn) {
|
|
319
|
-
return element.ref;
|
|
320
|
-
}
|
|
321
|
-
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
322
|
-
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
323
|
-
if (mayWarn) {
|
|
324
|
-
return element.props.ref;
|
|
325
|
-
}
|
|
326
|
-
return element.props.ref || element.ref;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
var index$5 = /*#__PURE__*/Object.freeze({
|
|
330
|
-
__proto__: null,
|
|
331
|
-
Root: Slot,
|
|
332
|
-
Slot: Slot,
|
|
333
|
-
Slottable: Slottable,
|
|
334
|
-
createSlot: createSlot,
|
|
335
|
-
createSlottable: createSlottable
|
|
336
|
-
});
|
|
337
|
-
|
|
338
|
-
// src/primitive.tsx
|
|
339
|
-
var NODES = [
|
|
340
|
-
"a",
|
|
341
|
-
"button",
|
|
342
|
-
"div",
|
|
343
|
-
"form",
|
|
344
|
-
"h2",
|
|
345
|
-
"h3",
|
|
346
|
-
"img",
|
|
347
|
-
"input",
|
|
348
|
-
"label",
|
|
349
|
-
"li",
|
|
350
|
-
"nav",
|
|
351
|
-
"ol",
|
|
352
|
-
"p",
|
|
353
|
-
"select",
|
|
354
|
-
"span",
|
|
355
|
-
"svg",
|
|
356
|
-
"ul"
|
|
357
|
-
];
|
|
358
|
-
var Primitive$1 = NODES.reduce((primitive, node) => {
|
|
359
|
-
const Slot = createSlot(`Primitive.${node}`);
|
|
360
|
-
const Node = React.forwardRef((props, forwardedRef) => {
|
|
361
|
-
const { asChild, ...primitiveProps } = props;
|
|
362
|
-
const Comp = asChild ? Slot : node;
|
|
363
|
-
if (typeof window !== "undefined") {
|
|
364
|
-
window[Symbol.for("radix-ui")] = true;
|
|
365
|
-
}
|
|
366
|
-
return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
367
|
-
});
|
|
368
|
-
Node.displayName = `Primitive.${node}`;
|
|
369
|
-
return { ...primitive, [node]: Node };
|
|
370
|
-
}, {});
|
|
371
|
-
function dispatchDiscreteCustomEvent(target, event) {
|
|
372
|
-
if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
function useStateMachine(initialState, machine) {
|
|
376
|
-
return React.useReducer((state, event) => {
|
|
377
|
-
const nextState = machine[state][event];
|
|
378
|
-
return nextState ?? state;
|
|
379
|
-
}, initialState);
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
// src/presence.tsx
|
|
383
|
-
var Presence = (props) => {
|
|
384
|
-
const { present, children } = props;
|
|
385
|
-
const presence = usePresence(present);
|
|
386
|
-
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React.Children.only(children);
|
|
387
|
-
const ref = useComposedRefs(presence.ref, getElementRef(child));
|
|
388
|
-
const forceMount = typeof children === "function";
|
|
389
|
-
return forceMount || presence.isPresent ? React.cloneElement(child, { ref }) : null;
|
|
1
|
+
let config = {
|
|
2
|
+
orchestratorApi: '',
|
|
390
3
|
};
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
const [node, setNode] = React.useState();
|
|
394
|
-
const stylesRef = React.useRef(null);
|
|
395
|
-
const prevPresentRef = React.useRef(present);
|
|
396
|
-
const prevAnimationNameRef = React.useRef("none");
|
|
397
|
-
const initialState = present ? "mounted" : "unmounted";
|
|
398
|
-
const [state, send] = useStateMachine(initialState, {
|
|
399
|
-
mounted: {
|
|
400
|
-
UNMOUNT: "unmounted",
|
|
401
|
-
ANIMATION_OUT: "unmountSuspended"
|
|
402
|
-
},
|
|
403
|
-
unmountSuspended: {
|
|
404
|
-
MOUNT: "mounted",
|
|
405
|
-
ANIMATION_END: "unmounted"
|
|
406
|
-
},
|
|
407
|
-
unmounted: {
|
|
408
|
-
MOUNT: "mounted"
|
|
409
|
-
}
|
|
410
|
-
});
|
|
411
|
-
React.useEffect(() => {
|
|
412
|
-
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
413
|
-
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
|
414
|
-
}, [state]);
|
|
415
|
-
useLayoutEffect2(() => {
|
|
416
|
-
const styles = stylesRef.current;
|
|
417
|
-
const wasPresent = prevPresentRef.current;
|
|
418
|
-
const hasPresentChanged = wasPresent !== present;
|
|
419
|
-
if (hasPresentChanged) {
|
|
420
|
-
const prevAnimationName = prevAnimationNameRef.current;
|
|
421
|
-
const currentAnimationName = getAnimationName(styles);
|
|
422
|
-
if (present) {
|
|
423
|
-
send("MOUNT");
|
|
424
|
-
} else if (currentAnimationName === "none" || styles?.display === "none") {
|
|
425
|
-
send("UNMOUNT");
|
|
426
|
-
} else {
|
|
427
|
-
const isAnimating = prevAnimationName !== currentAnimationName;
|
|
428
|
-
if (wasPresent && isAnimating) {
|
|
429
|
-
send("ANIMATION_OUT");
|
|
430
|
-
} else {
|
|
431
|
-
send("UNMOUNT");
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
prevPresentRef.current = present;
|
|
435
|
-
}
|
|
436
|
-
}, [present, send]);
|
|
437
|
-
useLayoutEffect2(() => {
|
|
438
|
-
if (node) {
|
|
439
|
-
let timeoutId;
|
|
440
|
-
const ownerWindow = node.ownerDocument.defaultView ?? window;
|
|
441
|
-
const handleAnimationEnd = (event) => {
|
|
442
|
-
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
443
|
-
const isCurrentAnimation = currentAnimationName.includes(event.animationName);
|
|
444
|
-
if (event.target === node && isCurrentAnimation) {
|
|
445
|
-
send("ANIMATION_END");
|
|
446
|
-
if (!prevPresentRef.current) {
|
|
447
|
-
const currentFillMode = node.style.animationFillMode;
|
|
448
|
-
node.style.animationFillMode = "forwards";
|
|
449
|
-
timeoutId = ownerWindow.setTimeout(() => {
|
|
450
|
-
if (node.style.animationFillMode === "forwards") {
|
|
451
|
-
node.style.animationFillMode = currentFillMode;
|
|
452
|
-
}
|
|
453
|
-
});
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
};
|
|
457
|
-
const handleAnimationStart = (event) => {
|
|
458
|
-
if (event.target === node) {
|
|
459
|
-
prevAnimationNameRef.current = getAnimationName(stylesRef.current);
|
|
460
|
-
}
|
|
461
|
-
};
|
|
462
|
-
node.addEventListener("animationstart", handleAnimationStart);
|
|
463
|
-
node.addEventListener("animationcancel", handleAnimationEnd);
|
|
464
|
-
node.addEventListener("animationend", handleAnimationEnd);
|
|
465
|
-
return () => {
|
|
466
|
-
ownerWindow.clearTimeout(timeoutId);
|
|
467
|
-
node.removeEventListener("animationstart", handleAnimationStart);
|
|
468
|
-
node.removeEventListener("animationcancel", handleAnimationEnd);
|
|
469
|
-
node.removeEventListener("animationend", handleAnimationEnd);
|
|
470
|
-
};
|
|
471
|
-
} else {
|
|
472
|
-
send("ANIMATION_END");
|
|
473
|
-
}
|
|
474
|
-
}, [node, send]);
|
|
475
|
-
return {
|
|
476
|
-
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
477
|
-
ref: React.useCallback((node2) => {
|
|
478
|
-
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
479
|
-
setNode(node2);
|
|
480
|
-
}, [])
|
|
481
|
-
};
|
|
482
|
-
}
|
|
483
|
-
function getAnimationName(styles) {
|
|
484
|
-
return styles?.animationName || "none";
|
|
485
|
-
}
|
|
486
|
-
function getElementRef(element) {
|
|
487
|
-
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
488
|
-
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
489
|
-
if (mayWarn) {
|
|
490
|
-
return element.ref;
|
|
491
|
-
}
|
|
492
|
-
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
493
|
-
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
494
|
-
if (mayWarn) {
|
|
495
|
-
return element.props.ref;
|
|
496
|
-
}
|
|
497
|
-
return element.props.ref || element.ref;
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
// packages/react/id/src/id.tsx
|
|
501
|
-
var useReactId = React[" useId ".trim().toString()] || (() => void 0);
|
|
502
|
-
var count = 0;
|
|
503
|
-
function useId(deterministicId) {
|
|
504
|
-
const [id, setId] = React.useState(useReactId());
|
|
505
|
-
useLayoutEffect2(() => {
|
|
506
|
-
setId((reactId) => reactId ?? String(count++));
|
|
507
|
-
}, [deterministicId]);
|
|
508
|
-
return deterministicId || (id ? `radix-${id}` : "");
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
var COLLAPSIBLE_NAME = "Collapsible";
|
|
512
|
-
var [createCollapsibleContext, createCollapsibleScope] = createContextScope(COLLAPSIBLE_NAME);
|
|
513
|
-
var [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);
|
|
514
|
-
var Collapsible = React.forwardRef(
|
|
515
|
-
(props, forwardedRef) => {
|
|
516
|
-
const {
|
|
517
|
-
__scopeCollapsible,
|
|
518
|
-
open: openProp,
|
|
519
|
-
defaultOpen,
|
|
520
|
-
disabled,
|
|
521
|
-
onOpenChange,
|
|
522
|
-
...collapsibleProps
|
|
523
|
-
} = props;
|
|
524
|
-
const [open, setOpen] = useControllableState({
|
|
525
|
-
prop: openProp,
|
|
526
|
-
defaultProp: defaultOpen ?? false,
|
|
527
|
-
onChange: onOpenChange,
|
|
528
|
-
caller: COLLAPSIBLE_NAME
|
|
529
|
-
});
|
|
530
|
-
return /* @__PURE__ */ jsx(
|
|
531
|
-
CollapsibleProvider,
|
|
532
|
-
{
|
|
533
|
-
scope: __scopeCollapsible,
|
|
534
|
-
disabled,
|
|
535
|
-
contentId: useId(),
|
|
536
|
-
open,
|
|
537
|
-
onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
538
|
-
children: /* @__PURE__ */ jsx(
|
|
539
|
-
Primitive$1.div,
|
|
540
|
-
{
|
|
541
|
-
"data-state": getState(open),
|
|
542
|
-
"data-disabled": disabled ? "" : void 0,
|
|
543
|
-
...collapsibleProps,
|
|
544
|
-
ref: forwardedRef
|
|
545
|
-
}
|
|
546
|
-
)
|
|
547
|
-
}
|
|
548
|
-
);
|
|
549
|
-
}
|
|
550
|
-
);
|
|
551
|
-
Collapsible.displayName = COLLAPSIBLE_NAME;
|
|
552
|
-
var TRIGGER_NAME = "CollapsibleTrigger";
|
|
553
|
-
var CollapsibleTrigger = React.forwardRef(
|
|
554
|
-
(props, forwardedRef) => {
|
|
555
|
-
const { __scopeCollapsible, ...triggerProps } = props;
|
|
556
|
-
const context = useCollapsibleContext(TRIGGER_NAME, __scopeCollapsible);
|
|
557
|
-
return /* @__PURE__ */ jsx(
|
|
558
|
-
Primitive$1.button,
|
|
559
|
-
{
|
|
560
|
-
type: "button",
|
|
561
|
-
"aria-controls": context.contentId,
|
|
562
|
-
"aria-expanded": context.open || false,
|
|
563
|
-
"data-state": getState(context.open),
|
|
564
|
-
"data-disabled": context.disabled ? "" : void 0,
|
|
565
|
-
disabled: context.disabled,
|
|
566
|
-
...triggerProps,
|
|
567
|
-
ref: forwardedRef,
|
|
568
|
-
onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
|
|
569
|
-
}
|
|
570
|
-
);
|
|
571
|
-
}
|
|
572
|
-
);
|
|
573
|
-
CollapsibleTrigger.displayName = TRIGGER_NAME;
|
|
574
|
-
var CONTENT_NAME = "CollapsibleContent";
|
|
575
|
-
var CollapsibleContent = React.forwardRef(
|
|
576
|
-
(props, forwardedRef) => {
|
|
577
|
-
const { forceMount, ...contentProps } = props;
|
|
578
|
-
const context = useCollapsibleContext(CONTENT_NAME, props.__scopeCollapsible);
|
|
579
|
-
return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: ({ present }) => /* @__PURE__ */ jsx(CollapsibleContentImpl, { ...contentProps, ref: forwardedRef, present }) });
|
|
580
|
-
}
|
|
581
|
-
);
|
|
582
|
-
CollapsibleContent.displayName = CONTENT_NAME;
|
|
583
|
-
var CollapsibleContentImpl = React.forwardRef((props, forwardedRef) => {
|
|
584
|
-
const { __scopeCollapsible, present, children, ...contentProps } = props;
|
|
585
|
-
const context = useCollapsibleContext(CONTENT_NAME, __scopeCollapsible);
|
|
586
|
-
const [isPresent, setIsPresent] = React.useState(present);
|
|
587
|
-
const ref = React.useRef(null);
|
|
588
|
-
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
589
|
-
const heightRef = React.useRef(0);
|
|
590
|
-
const height = heightRef.current;
|
|
591
|
-
const widthRef = React.useRef(0);
|
|
592
|
-
const width = widthRef.current;
|
|
593
|
-
const isOpen = context.open || isPresent;
|
|
594
|
-
const isMountAnimationPreventedRef = React.useRef(isOpen);
|
|
595
|
-
const originalStylesRef = React.useRef(void 0);
|
|
596
|
-
React.useEffect(() => {
|
|
597
|
-
const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
|
|
598
|
-
return () => cancelAnimationFrame(rAF);
|
|
599
|
-
}, []);
|
|
600
|
-
useLayoutEffect2(() => {
|
|
601
|
-
const node = ref.current;
|
|
602
|
-
if (node) {
|
|
603
|
-
originalStylesRef.current = originalStylesRef.current || {
|
|
604
|
-
transitionDuration: node.style.transitionDuration,
|
|
605
|
-
animationName: node.style.animationName
|
|
606
|
-
};
|
|
607
|
-
node.style.transitionDuration = "0s";
|
|
608
|
-
node.style.animationName = "none";
|
|
609
|
-
const rect = node.getBoundingClientRect();
|
|
610
|
-
heightRef.current = rect.height;
|
|
611
|
-
widthRef.current = rect.width;
|
|
612
|
-
if (!isMountAnimationPreventedRef.current) {
|
|
613
|
-
node.style.transitionDuration = originalStylesRef.current.transitionDuration;
|
|
614
|
-
node.style.animationName = originalStylesRef.current.animationName;
|
|
615
|
-
}
|
|
616
|
-
setIsPresent(present);
|
|
617
|
-
}
|
|
618
|
-
}, [context.open, present]);
|
|
619
|
-
return /* @__PURE__ */ jsx(
|
|
620
|
-
Primitive$1.div,
|
|
621
|
-
{
|
|
622
|
-
"data-state": getState(context.open),
|
|
623
|
-
"data-disabled": context.disabled ? "" : void 0,
|
|
624
|
-
id: context.contentId,
|
|
625
|
-
hidden: !isOpen,
|
|
626
|
-
...contentProps,
|
|
627
|
-
ref: composedRefs,
|
|
628
|
-
style: {
|
|
629
|
-
[`--radix-collapsible-content-height`]: height ? `${height}px` : void 0,
|
|
630
|
-
[`--radix-collapsible-content-width`]: width ? `${width}px` : void 0,
|
|
631
|
-
...props.style
|
|
632
|
-
},
|
|
633
|
-
children: isOpen && children
|
|
634
|
-
}
|
|
635
|
-
);
|
|
636
|
-
});
|
|
637
|
-
function getState(open) {
|
|
638
|
-
return open ? "open" : "closed";
|
|
639
|
-
}
|
|
640
|
-
var Root$3 = Collapsible;
|
|
641
|
-
var Trigger = CollapsibleTrigger;
|
|
642
|
-
var Content = CollapsibleContent;
|
|
643
|
-
|
|
644
|
-
var index$4 = /*#__PURE__*/Object.freeze({
|
|
645
|
-
__proto__: null,
|
|
646
|
-
Collapsible: Collapsible,
|
|
647
|
-
CollapsibleContent: CollapsibleContent,
|
|
648
|
-
CollapsibleTrigger: CollapsibleTrigger,
|
|
649
|
-
Content: Content,
|
|
650
|
-
Root: Root$3,
|
|
651
|
-
Trigger: Trigger,
|
|
652
|
-
createCollapsibleScope: createCollapsibleScope
|
|
653
|
-
});
|
|
654
|
-
|
|
655
|
-
var [createFormContext, createFormScope] = createContextScope("Form");
|
|
656
|
-
var FORM_NAME = "Form";
|
|
657
|
-
var [ValidationProvider, useValidationContext] = createFormContext(FORM_NAME);
|
|
658
|
-
var [AriaDescriptionProvider, useAriaDescriptionContext] = createFormContext(FORM_NAME);
|
|
659
|
-
var Form = React.forwardRef(
|
|
660
|
-
(props, forwardedRef) => {
|
|
661
|
-
const { __scopeForm, onClearServerErrors = () => {
|
|
662
|
-
}, ...rootProps } = props;
|
|
663
|
-
const formRef = React.useRef(null);
|
|
664
|
-
const composedFormRef = useComposedRefs(forwardedRef, formRef);
|
|
665
|
-
const [validityMap, setValidityMap] = React.useState({});
|
|
666
|
-
const getFieldValidity = React.useCallback(
|
|
667
|
-
(fieldName) => validityMap[fieldName],
|
|
668
|
-
[validityMap]
|
|
669
|
-
);
|
|
670
|
-
const handleFieldValidityChange = React.useCallback(
|
|
671
|
-
(fieldName, validity) => setValidityMap((prevValidityMap) => ({
|
|
672
|
-
...prevValidityMap,
|
|
673
|
-
[fieldName]: { ...prevValidityMap[fieldName] ?? {}, ...validity }
|
|
674
|
-
})),
|
|
675
|
-
[]
|
|
676
|
-
);
|
|
677
|
-
const handleFieldValiditionClear = React.useCallback((fieldName) => {
|
|
678
|
-
setValidityMap((prevValidityMap) => ({ ...prevValidityMap, [fieldName]: void 0 }));
|
|
679
|
-
setCustomErrorsMap((prevCustomErrorsMap) => ({ ...prevCustomErrorsMap, [fieldName]: {} }));
|
|
680
|
-
}, []);
|
|
681
|
-
const [customMatcherEntriesMap, setCustomMatcherEntriesMap] = React.useState({});
|
|
682
|
-
const getFieldCustomMatcherEntries = React.useCallback(
|
|
683
|
-
(fieldName) => customMatcherEntriesMap[fieldName] ?? [],
|
|
684
|
-
[customMatcherEntriesMap]
|
|
685
|
-
);
|
|
686
|
-
const handleFieldCustomMatcherAdd = React.useCallback((fieldName, matcherEntry) => {
|
|
687
|
-
setCustomMatcherEntriesMap((prevCustomMatcherEntriesMap) => ({
|
|
688
|
-
...prevCustomMatcherEntriesMap,
|
|
689
|
-
[fieldName]: [...prevCustomMatcherEntriesMap[fieldName] ?? [], matcherEntry]
|
|
690
|
-
}));
|
|
691
|
-
}, []);
|
|
692
|
-
const handleFieldCustomMatcherRemove = React.useCallback((fieldName, matcherEntryId) => {
|
|
693
|
-
setCustomMatcherEntriesMap((prevCustomMatcherEntriesMap) => ({
|
|
694
|
-
...prevCustomMatcherEntriesMap,
|
|
695
|
-
[fieldName]: (prevCustomMatcherEntriesMap[fieldName] ?? []).filter(
|
|
696
|
-
(matcherEntry) => matcherEntry.id !== matcherEntryId
|
|
697
|
-
)
|
|
698
|
-
}));
|
|
699
|
-
}, []);
|
|
700
|
-
const [customErrorsMap, setCustomErrorsMap] = React.useState({});
|
|
701
|
-
const getFieldCustomErrors = React.useCallback(
|
|
702
|
-
(fieldName) => customErrorsMap[fieldName] ?? {},
|
|
703
|
-
[customErrorsMap]
|
|
704
|
-
);
|
|
705
|
-
const handleFieldCustomErrorsChange = React.useCallback((fieldName, customErrors) => {
|
|
706
|
-
setCustomErrorsMap((prevCustomErrorsMap) => ({
|
|
707
|
-
...prevCustomErrorsMap,
|
|
708
|
-
[fieldName]: { ...prevCustomErrorsMap[fieldName] ?? {}, ...customErrors }
|
|
709
|
-
}));
|
|
710
|
-
}, []);
|
|
711
|
-
const [messageIdsMap, setMessageIdsMap] = React.useState({});
|
|
712
|
-
const handleFieldMessageIdAdd = React.useCallback((fieldName, id) => {
|
|
713
|
-
setMessageIdsMap((prevMessageIdsMap) => {
|
|
714
|
-
const fieldDescriptionIds = new Set(prevMessageIdsMap[fieldName]).add(id);
|
|
715
|
-
return { ...prevMessageIdsMap, [fieldName]: fieldDescriptionIds };
|
|
716
|
-
});
|
|
717
|
-
}, []);
|
|
718
|
-
const handleFieldMessageIdRemove = React.useCallback((fieldName, id) => {
|
|
719
|
-
setMessageIdsMap((prevMessageIdsMap) => {
|
|
720
|
-
const fieldDescriptionIds = new Set(prevMessageIdsMap[fieldName]);
|
|
721
|
-
fieldDescriptionIds.delete(id);
|
|
722
|
-
return { ...prevMessageIdsMap, [fieldName]: fieldDescriptionIds };
|
|
723
|
-
});
|
|
724
|
-
}, []);
|
|
725
|
-
const getFieldDescription = React.useCallback(
|
|
726
|
-
(fieldName) => Array.from(messageIdsMap[fieldName] ?? []).join(" ") || void 0,
|
|
727
|
-
[messageIdsMap]
|
|
728
|
-
);
|
|
729
|
-
return /* @__PURE__ */ jsx(
|
|
730
|
-
ValidationProvider,
|
|
731
|
-
{
|
|
732
|
-
scope: __scopeForm,
|
|
733
|
-
getFieldValidity,
|
|
734
|
-
onFieldValidityChange: handleFieldValidityChange,
|
|
735
|
-
getFieldCustomMatcherEntries,
|
|
736
|
-
onFieldCustomMatcherEntryAdd: handleFieldCustomMatcherAdd,
|
|
737
|
-
onFieldCustomMatcherEntryRemove: handleFieldCustomMatcherRemove,
|
|
738
|
-
getFieldCustomErrors,
|
|
739
|
-
onFieldCustomErrorsChange: handleFieldCustomErrorsChange,
|
|
740
|
-
onFieldValiditionClear: handleFieldValiditionClear,
|
|
741
|
-
children: /* @__PURE__ */ jsx(
|
|
742
|
-
AriaDescriptionProvider,
|
|
743
|
-
{
|
|
744
|
-
scope: __scopeForm,
|
|
745
|
-
onFieldMessageIdAdd: handleFieldMessageIdAdd,
|
|
746
|
-
onFieldMessageIdRemove: handleFieldMessageIdRemove,
|
|
747
|
-
getFieldDescription,
|
|
748
|
-
children: /* @__PURE__ */ jsx(
|
|
749
|
-
Primitive$1.form,
|
|
750
|
-
{
|
|
751
|
-
...rootProps,
|
|
752
|
-
ref: composedFormRef,
|
|
753
|
-
onInvalid: composeEventHandlers(props.onInvalid, (event) => {
|
|
754
|
-
const firstInvalidControl = getFirstInvalidControl(event.currentTarget);
|
|
755
|
-
if (firstInvalidControl === event.target) firstInvalidControl.focus();
|
|
756
|
-
event.preventDefault();
|
|
757
|
-
}),
|
|
758
|
-
onSubmit: composeEventHandlers(props.onSubmit, onClearServerErrors, {
|
|
759
|
-
checkForDefaultPrevented: false
|
|
760
|
-
}),
|
|
761
|
-
onReset: composeEventHandlers(props.onReset, onClearServerErrors)
|
|
762
|
-
}
|
|
763
|
-
)
|
|
764
|
-
}
|
|
765
|
-
)
|
|
766
|
-
}
|
|
767
|
-
);
|
|
768
|
-
}
|
|
769
|
-
);
|
|
770
|
-
Form.displayName = FORM_NAME;
|
|
771
|
-
var FIELD_NAME = "FormField";
|
|
772
|
-
var [FormFieldProvider, useFormFieldContext] = createFormContext(FIELD_NAME);
|
|
773
|
-
var FormField = React.forwardRef(
|
|
774
|
-
(props, forwardedRef) => {
|
|
775
|
-
const { __scopeForm, name, serverInvalid = false, ...fieldProps } = props;
|
|
776
|
-
const validationContext = useValidationContext(FIELD_NAME, __scopeForm);
|
|
777
|
-
const validity = validationContext.getFieldValidity(name);
|
|
778
|
-
const id = useId();
|
|
779
|
-
return /* @__PURE__ */ jsx(FormFieldProvider, { scope: __scopeForm, id, name, serverInvalid, children: /* @__PURE__ */ jsx(
|
|
780
|
-
Primitive$1.div,
|
|
781
|
-
{
|
|
782
|
-
"data-valid": getValidAttribute(validity, serverInvalid),
|
|
783
|
-
"data-invalid": getInvalidAttribute(validity, serverInvalid),
|
|
784
|
-
...fieldProps,
|
|
785
|
-
ref: forwardedRef
|
|
786
|
-
}
|
|
787
|
-
) });
|
|
788
|
-
}
|
|
789
|
-
);
|
|
790
|
-
FormField.displayName = FIELD_NAME;
|
|
791
|
-
var LABEL_NAME = "FormLabel";
|
|
792
|
-
var FormLabel = React.forwardRef(
|
|
793
|
-
(props, forwardedRef) => {
|
|
794
|
-
const { __scopeForm, ...labelProps } = props;
|
|
795
|
-
const validationContext = useValidationContext(LABEL_NAME, __scopeForm);
|
|
796
|
-
const fieldContext = useFormFieldContext(LABEL_NAME, __scopeForm);
|
|
797
|
-
const htmlFor = labelProps.htmlFor || fieldContext.id;
|
|
798
|
-
const validity = validationContext.getFieldValidity(fieldContext.name);
|
|
799
|
-
return /* @__PURE__ */ jsx(
|
|
800
|
-
Label$1,
|
|
801
|
-
{
|
|
802
|
-
"data-valid": getValidAttribute(validity, fieldContext.serverInvalid),
|
|
803
|
-
"data-invalid": getInvalidAttribute(validity, fieldContext.serverInvalid),
|
|
804
|
-
...labelProps,
|
|
805
|
-
ref: forwardedRef,
|
|
806
|
-
htmlFor
|
|
807
|
-
}
|
|
808
|
-
);
|
|
809
|
-
}
|
|
810
|
-
);
|
|
811
|
-
FormLabel.displayName = LABEL_NAME;
|
|
812
|
-
var CONTROL_NAME = "FormControl";
|
|
813
|
-
var FormControl = React.forwardRef(
|
|
814
|
-
(props, forwardedRef) => {
|
|
815
|
-
const { __scopeForm, ...controlProps } = props;
|
|
816
|
-
const validationContext = useValidationContext(CONTROL_NAME, __scopeForm);
|
|
817
|
-
const fieldContext = useFormFieldContext(CONTROL_NAME, __scopeForm);
|
|
818
|
-
const ariaDescriptionContext = useAriaDescriptionContext(CONTROL_NAME, __scopeForm);
|
|
819
|
-
const ref = React.useRef(null);
|
|
820
|
-
const composedRef = useComposedRefs(forwardedRef, ref);
|
|
821
|
-
const name = controlProps.name || fieldContext.name;
|
|
822
|
-
const id = controlProps.id || fieldContext.id;
|
|
823
|
-
const customMatcherEntries = validationContext.getFieldCustomMatcherEntries(name);
|
|
824
|
-
const { onFieldValidityChange, onFieldCustomErrorsChange, onFieldValiditionClear } = validationContext;
|
|
825
|
-
const updateControlValidity = React.useCallback(
|
|
826
|
-
async (control) => {
|
|
827
|
-
if (hasBuiltInError(control.validity)) {
|
|
828
|
-
const controlValidity2 = validityStateToObject(control.validity);
|
|
829
|
-
onFieldValidityChange(name, controlValidity2);
|
|
830
|
-
return;
|
|
831
|
-
}
|
|
832
|
-
const formData = control.form ? new FormData(control.form) : new FormData();
|
|
833
|
-
const matcherArgs = [control.value, formData];
|
|
834
|
-
const syncCustomMatcherEntries = [];
|
|
835
|
-
const ayncCustomMatcherEntries = [];
|
|
836
|
-
customMatcherEntries.forEach((customMatcherEntry) => {
|
|
837
|
-
if (isAsyncCustomMatcherEntry(customMatcherEntry, matcherArgs)) {
|
|
838
|
-
ayncCustomMatcherEntries.push(customMatcherEntry);
|
|
839
|
-
} else if (isSyncCustomMatcherEntry(customMatcherEntry)) {
|
|
840
|
-
syncCustomMatcherEntries.push(customMatcherEntry);
|
|
841
|
-
}
|
|
842
|
-
});
|
|
843
|
-
const syncCustomErrors = syncCustomMatcherEntries.map(({ id: id2, match }) => {
|
|
844
|
-
return [id2, match(...matcherArgs)];
|
|
845
|
-
});
|
|
846
|
-
const syncCustomErrorsById = Object.fromEntries(syncCustomErrors);
|
|
847
|
-
const hasSyncCustomErrors = Object.values(syncCustomErrorsById).some(Boolean);
|
|
848
|
-
const hasCustomError = hasSyncCustomErrors;
|
|
849
|
-
control.setCustomValidity(hasCustomError ? DEFAULT_INVALID_MESSAGE : "");
|
|
850
|
-
const controlValidity = validityStateToObject(control.validity);
|
|
851
|
-
onFieldValidityChange(name, controlValidity);
|
|
852
|
-
onFieldCustomErrorsChange(name, syncCustomErrorsById);
|
|
853
|
-
if (!hasSyncCustomErrors && ayncCustomMatcherEntries.length > 0) {
|
|
854
|
-
const promisedCustomErrors = ayncCustomMatcherEntries.map(
|
|
855
|
-
({ id: id2, match }) => match(...matcherArgs).then((matches) => [id2, matches])
|
|
856
|
-
);
|
|
857
|
-
const asyncCustomErrors = await Promise.all(promisedCustomErrors);
|
|
858
|
-
const asyncCustomErrorsById = Object.fromEntries(asyncCustomErrors);
|
|
859
|
-
const hasAsyncCustomErrors = Object.values(asyncCustomErrorsById).some(Boolean);
|
|
860
|
-
const hasCustomError2 = hasAsyncCustomErrors;
|
|
861
|
-
control.setCustomValidity(hasCustomError2 ? DEFAULT_INVALID_MESSAGE : "");
|
|
862
|
-
const controlValidity2 = validityStateToObject(control.validity);
|
|
863
|
-
onFieldValidityChange(name, controlValidity2);
|
|
864
|
-
onFieldCustomErrorsChange(name, asyncCustomErrorsById);
|
|
865
|
-
}
|
|
866
|
-
},
|
|
867
|
-
[customMatcherEntries, name, onFieldCustomErrorsChange, onFieldValidityChange]
|
|
868
|
-
);
|
|
869
|
-
React.useEffect(() => {
|
|
870
|
-
const control = ref.current;
|
|
871
|
-
if (control) {
|
|
872
|
-
const handleChange = () => updateControlValidity(control);
|
|
873
|
-
control.addEventListener("change", handleChange);
|
|
874
|
-
return () => control.removeEventListener("change", handleChange);
|
|
875
|
-
}
|
|
876
|
-
}, [updateControlValidity]);
|
|
877
|
-
const resetControlValidity = React.useCallback(() => {
|
|
878
|
-
const control = ref.current;
|
|
879
|
-
if (control) {
|
|
880
|
-
control.setCustomValidity("");
|
|
881
|
-
onFieldValiditionClear(name);
|
|
882
|
-
}
|
|
883
|
-
}, [name, onFieldValiditionClear]);
|
|
884
|
-
React.useEffect(() => {
|
|
885
|
-
const form = ref.current?.form;
|
|
886
|
-
if (form) {
|
|
887
|
-
form.addEventListener("reset", resetControlValidity);
|
|
888
|
-
return () => form.removeEventListener("reset", resetControlValidity);
|
|
889
|
-
}
|
|
890
|
-
}, [resetControlValidity]);
|
|
891
|
-
React.useEffect(() => {
|
|
892
|
-
const control = ref.current;
|
|
893
|
-
const form = control?.closest("form");
|
|
894
|
-
if (form && fieldContext.serverInvalid) {
|
|
895
|
-
const firstInvalidControl = getFirstInvalidControl(form);
|
|
896
|
-
if (firstInvalidControl === control) firstInvalidControl.focus();
|
|
897
|
-
}
|
|
898
|
-
}, [fieldContext.serverInvalid]);
|
|
899
|
-
const validity = validationContext.getFieldValidity(name);
|
|
900
|
-
return /* @__PURE__ */ jsx(
|
|
901
|
-
Primitive$1.input,
|
|
902
|
-
{
|
|
903
|
-
"data-valid": getValidAttribute(validity, fieldContext.serverInvalid),
|
|
904
|
-
"data-invalid": getInvalidAttribute(validity, fieldContext.serverInvalid),
|
|
905
|
-
"aria-invalid": fieldContext.serverInvalid ? true : void 0,
|
|
906
|
-
"aria-describedby": ariaDescriptionContext.getFieldDescription(name),
|
|
907
|
-
title: "",
|
|
908
|
-
...controlProps,
|
|
909
|
-
ref: composedRef,
|
|
910
|
-
id,
|
|
911
|
-
name,
|
|
912
|
-
onInvalid: composeEventHandlers(props.onInvalid, (event) => {
|
|
913
|
-
const control = event.currentTarget;
|
|
914
|
-
updateControlValidity(control);
|
|
915
|
-
}),
|
|
916
|
-
onChange: composeEventHandlers(props.onChange, (_event) => {
|
|
917
|
-
resetControlValidity();
|
|
918
|
-
})
|
|
919
|
-
}
|
|
920
|
-
);
|
|
921
|
-
}
|
|
922
|
-
);
|
|
923
|
-
FormControl.displayName = CONTROL_NAME;
|
|
924
|
-
var DEFAULT_INVALID_MESSAGE = "This value is not valid";
|
|
925
|
-
var DEFAULT_BUILT_IN_MESSAGES = {
|
|
926
|
-
badInput: DEFAULT_INVALID_MESSAGE,
|
|
927
|
-
patternMismatch: "This value does not match the required pattern",
|
|
928
|
-
rangeOverflow: "This value is too large",
|
|
929
|
-
rangeUnderflow: "This value is too small",
|
|
930
|
-
stepMismatch: "This value does not match the required step",
|
|
931
|
-
tooLong: "This value is too long",
|
|
932
|
-
tooShort: "This value is too short",
|
|
933
|
-
typeMismatch: "This value does not match the required type",
|
|
934
|
-
valid: void 0,
|
|
935
|
-
valueMissing: "This value is missing"
|
|
936
|
-
};
|
|
937
|
-
var MESSAGE_NAME = "FormMessage";
|
|
938
|
-
var FormMessage = React.forwardRef(
|
|
939
|
-
(props, forwardedRef) => {
|
|
940
|
-
const { match, name: nameProp, ...messageProps } = props;
|
|
941
|
-
const fieldContext = useFormFieldContext(MESSAGE_NAME, props.__scopeForm);
|
|
942
|
-
const name = nameProp ?? fieldContext.name;
|
|
943
|
-
if (match === void 0) {
|
|
944
|
-
return /* @__PURE__ */ jsx(FormMessageImpl, { ...messageProps, ref: forwardedRef, name, children: props.children || DEFAULT_INVALID_MESSAGE });
|
|
945
|
-
} else if (typeof match === "function") {
|
|
946
|
-
return /* @__PURE__ */ jsx(FormCustomMessage, { match, ...messageProps, ref: forwardedRef, name });
|
|
947
|
-
} else {
|
|
948
|
-
return /* @__PURE__ */ jsx(FormBuiltInMessage, { match, ...messageProps, ref: forwardedRef, name });
|
|
949
|
-
}
|
|
950
|
-
}
|
|
951
|
-
);
|
|
952
|
-
FormMessage.displayName = MESSAGE_NAME;
|
|
953
|
-
var FormBuiltInMessage = React.forwardRef(
|
|
954
|
-
(props, forwardedRef) => {
|
|
955
|
-
const { match, forceMatch = false, name, children, ...messageProps } = props;
|
|
956
|
-
const validationContext = useValidationContext(MESSAGE_NAME, messageProps.__scopeForm);
|
|
957
|
-
const validity = validationContext.getFieldValidity(name);
|
|
958
|
-
const matches = forceMatch || validity?.[match];
|
|
959
|
-
if (matches) {
|
|
960
|
-
return /* @__PURE__ */ jsx(FormMessageImpl, { ref: forwardedRef, ...messageProps, name, children: children ?? DEFAULT_BUILT_IN_MESSAGES[match] });
|
|
961
|
-
}
|
|
962
|
-
return null;
|
|
963
|
-
}
|
|
964
|
-
);
|
|
965
|
-
var FormCustomMessage = React.forwardRef(
|
|
966
|
-
(props, forwardedRef) => {
|
|
967
|
-
const { match, forceMatch = false, name, id: idProp, children, ...messageProps } = props;
|
|
968
|
-
const validationContext = useValidationContext(MESSAGE_NAME, messageProps.__scopeForm);
|
|
969
|
-
const ref = React.useRef(null);
|
|
970
|
-
const composedRef = useComposedRefs(forwardedRef, ref);
|
|
971
|
-
const _id = useId();
|
|
972
|
-
const id = idProp ?? _id;
|
|
973
|
-
const customMatcherEntry = React.useMemo(() => ({ id, match }), [id, match]);
|
|
974
|
-
const { onFieldCustomMatcherEntryAdd, onFieldCustomMatcherEntryRemove } = validationContext;
|
|
975
|
-
React.useEffect(() => {
|
|
976
|
-
onFieldCustomMatcherEntryAdd(name, customMatcherEntry);
|
|
977
|
-
return () => onFieldCustomMatcherEntryRemove(name, customMatcherEntry.id);
|
|
978
|
-
}, [customMatcherEntry, name, onFieldCustomMatcherEntryAdd, onFieldCustomMatcherEntryRemove]);
|
|
979
|
-
const validity = validationContext.getFieldValidity(name);
|
|
980
|
-
const customErrors = validationContext.getFieldCustomErrors(name);
|
|
981
|
-
const hasMatchingCustomError = customErrors[id];
|
|
982
|
-
const matches = forceMatch || validity && !hasBuiltInError(validity) && hasMatchingCustomError;
|
|
983
|
-
if (matches) {
|
|
984
|
-
return /* @__PURE__ */ jsx(FormMessageImpl, { id, ref: composedRef, ...messageProps, name, children: children ?? DEFAULT_INVALID_MESSAGE });
|
|
985
|
-
}
|
|
986
|
-
return null;
|
|
987
|
-
}
|
|
988
|
-
);
|
|
989
|
-
var FormMessageImpl = React.forwardRef(
|
|
990
|
-
(props, forwardedRef) => {
|
|
991
|
-
const { __scopeForm, id: idProp, name, ...messageProps } = props;
|
|
992
|
-
const ariaDescriptionContext = useAriaDescriptionContext(MESSAGE_NAME, __scopeForm);
|
|
993
|
-
const _id = useId();
|
|
994
|
-
const id = idProp ?? _id;
|
|
995
|
-
const { onFieldMessageIdAdd, onFieldMessageIdRemove } = ariaDescriptionContext;
|
|
996
|
-
React.useEffect(() => {
|
|
997
|
-
onFieldMessageIdAdd(name, id);
|
|
998
|
-
return () => onFieldMessageIdRemove(name, id);
|
|
999
|
-
}, [name, id, onFieldMessageIdAdd, onFieldMessageIdRemove]);
|
|
1000
|
-
return /* @__PURE__ */ jsx(Primitive$1.span, { id, ...messageProps, ref: forwardedRef });
|
|
1001
|
-
}
|
|
1002
|
-
);
|
|
1003
|
-
var VALIDITY_STATE_NAME = "FormValidityState";
|
|
1004
|
-
var FormValidityState = (props) => {
|
|
1005
|
-
const { __scopeForm, name: nameProp, children } = props;
|
|
1006
|
-
const validationContext = useValidationContext(VALIDITY_STATE_NAME, __scopeForm);
|
|
1007
|
-
const fieldContext = useFormFieldContext(VALIDITY_STATE_NAME, __scopeForm);
|
|
1008
|
-
const name = nameProp ?? fieldContext.name;
|
|
1009
|
-
const validity = validationContext.getFieldValidity(name);
|
|
1010
|
-
return /* @__PURE__ */ jsx(Fragment, { children: children(validity) });
|
|
4
|
+
const configure = (newConfig) => {
|
|
5
|
+
config = { ...config, ...newConfig };
|
|
1011
6
|
};
|
|
1012
|
-
FormValidityState.displayName = VALIDITY_STATE_NAME;
|
|
1013
|
-
var SUBMIT_NAME = "FormSubmit";
|
|
1014
|
-
var FormSubmit = React.forwardRef(
|
|
1015
|
-
(props, forwardedRef) => {
|
|
1016
|
-
const { __scopeForm, ...submitProps } = props;
|
|
1017
|
-
return /* @__PURE__ */ jsx(Primitive$1.button, { type: "submit", ...submitProps, ref: forwardedRef });
|
|
1018
|
-
}
|
|
1019
|
-
);
|
|
1020
|
-
FormSubmit.displayName = SUBMIT_NAME;
|
|
1021
|
-
function validityStateToObject(validity) {
|
|
1022
|
-
const object = {};
|
|
1023
|
-
for (const key in validity) {
|
|
1024
|
-
object[key] = validity[key];
|
|
1025
|
-
}
|
|
1026
|
-
return object;
|
|
1027
|
-
}
|
|
1028
|
-
function isHTMLElement(element) {
|
|
1029
|
-
return element instanceof HTMLElement;
|
|
1030
|
-
}
|
|
1031
|
-
function isFormControl(element) {
|
|
1032
|
-
return "validity" in element;
|
|
1033
|
-
}
|
|
1034
|
-
function isInvalid(control) {
|
|
1035
|
-
return isFormControl(control) && (control.validity.valid === false || control.getAttribute("aria-invalid") === "true");
|
|
1036
|
-
}
|
|
1037
|
-
function getFirstInvalidControl(form) {
|
|
1038
|
-
const elements = form.elements;
|
|
1039
|
-
const [firstInvalidControl] = Array.from(elements).filter(isHTMLElement).filter(isInvalid);
|
|
1040
|
-
return firstInvalidControl;
|
|
1041
|
-
}
|
|
1042
|
-
function isAsyncCustomMatcherEntry(entry, args) {
|
|
1043
|
-
return entry.match.constructor.name === "AsyncFunction" || returnsPromise(entry.match, args);
|
|
1044
|
-
}
|
|
1045
|
-
function isSyncCustomMatcherEntry(entry) {
|
|
1046
|
-
return entry.match.constructor.name === "Function";
|
|
1047
|
-
}
|
|
1048
|
-
function returnsPromise(func, args) {
|
|
1049
|
-
return func(...args) instanceof Promise;
|
|
1050
|
-
}
|
|
1051
|
-
function hasBuiltInError(validity) {
|
|
1052
|
-
let error = false;
|
|
1053
|
-
for (const validityKey in validity) {
|
|
1054
|
-
const key = validityKey;
|
|
1055
|
-
if (key !== "valid" && key !== "customError" && validity[key]) {
|
|
1056
|
-
error = true;
|
|
1057
|
-
break;
|
|
1058
|
-
}
|
|
1059
|
-
}
|
|
1060
|
-
return error;
|
|
1061
|
-
}
|
|
1062
|
-
function getValidAttribute(validity, serverInvalid) {
|
|
1063
|
-
if (validity?.valid === true && !serverInvalid) return true;
|
|
1064
|
-
return void 0;
|
|
1065
|
-
}
|
|
1066
|
-
function getInvalidAttribute(validity, serverInvalid) {
|
|
1067
|
-
if (validity?.valid === false || serverInvalid) return true;
|
|
1068
|
-
return void 0;
|
|
1069
|
-
}
|
|
1070
|
-
var Root$2 = Form;
|
|
1071
|
-
var Field = FormField;
|
|
1072
|
-
var Label = FormLabel;
|
|
1073
|
-
var Control = FormControl;
|
|
1074
|
-
var Message = FormMessage;
|
|
1075
|
-
var ValidityState = FormValidityState;
|
|
1076
|
-
var Submit = FormSubmit;
|
|
1077
|
-
|
|
1078
|
-
var index$3 = /*#__PURE__*/Object.freeze({
|
|
1079
|
-
__proto__: null,
|
|
1080
|
-
Control: Control,
|
|
1081
|
-
Field: Field,
|
|
1082
|
-
Form: Form,
|
|
1083
|
-
FormControl: FormControl,
|
|
1084
|
-
FormField: FormField,
|
|
1085
|
-
FormLabel: FormLabel,
|
|
1086
|
-
FormMessage: FormMessage,
|
|
1087
|
-
FormSubmit: FormSubmit,
|
|
1088
|
-
FormValidityState: FormValidityState,
|
|
1089
|
-
Label: Label,
|
|
1090
|
-
Message: Message,
|
|
1091
|
-
Root: Root$2,
|
|
1092
|
-
Submit: Submit,
|
|
1093
|
-
ValidityState: ValidityState,
|
|
1094
|
-
createFormScope: createFormScope
|
|
1095
|
-
});
|
|
1096
|
-
|
|
1097
|
-
var PORTAL_NAME = "Portal";
|
|
1098
|
-
var Portal = React.forwardRef((props, forwardedRef) => {
|
|
1099
|
-
const { container: containerProp, ...portalProps } = props;
|
|
1100
|
-
const [mounted, setMounted] = React.useState(false);
|
|
1101
|
-
useLayoutEffect2(() => setMounted(true), []);
|
|
1102
|
-
const container = containerProp || mounted && globalThis?.document?.body;
|
|
1103
|
-
return container ? ReactDOM__default.createPortal(/* @__PURE__ */ jsx(Primitive$1.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
1104
|
-
});
|
|
1105
|
-
Portal.displayName = PORTAL_NAME;
|
|
1106
|
-
var Root$1 = Portal;
|
|
1107
|
-
|
|
1108
|
-
var index$2 = /*#__PURE__*/Object.freeze({
|
|
1109
|
-
__proto__: null,
|
|
1110
|
-
Portal: Portal,
|
|
1111
|
-
Root: Root$1
|
|
1112
|
-
});
|
|
1113
|
-
|
|
1114
|
-
// src/visually-hidden.tsx
|
|
1115
|
-
var VISUALLY_HIDDEN_STYLES = Object.freeze({
|
|
1116
|
-
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|
|
1117
|
-
position: "absolute",
|
|
1118
|
-
border: 0,
|
|
1119
|
-
width: 1,
|
|
1120
|
-
height: 1,
|
|
1121
|
-
padding: 0,
|
|
1122
|
-
margin: -1,
|
|
1123
|
-
overflow: "hidden",
|
|
1124
|
-
clip: "rect(0, 0, 0, 0)",
|
|
1125
|
-
whiteSpace: "nowrap",
|
|
1126
|
-
wordWrap: "normal"
|
|
1127
|
-
});
|
|
1128
|
-
var NAME$1 = "VisuallyHidden";
|
|
1129
|
-
var VisuallyHidden = React.forwardRef(
|
|
1130
|
-
(props, forwardedRef) => {
|
|
1131
|
-
return /* @__PURE__ */ jsx(
|
|
1132
|
-
Primitive$1.span,
|
|
1133
|
-
{
|
|
1134
|
-
...props,
|
|
1135
|
-
ref: forwardedRef,
|
|
1136
|
-
style: { ...VISUALLY_HIDDEN_STYLES, ...props.style }
|
|
1137
|
-
}
|
|
1138
|
-
);
|
|
1139
|
-
}
|
|
1140
|
-
);
|
|
1141
|
-
VisuallyHidden.displayName = NAME$1;
|
|
1142
|
-
var Root = VisuallyHidden;
|
|
1143
|
-
|
|
1144
|
-
var index$1 = /*#__PURE__*/Object.freeze({
|
|
1145
|
-
__proto__: null,
|
|
1146
|
-
Root: Root,
|
|
1147
|
-
VISUALLY_HIDDEN_STYLES: VISUALLY_HIDDEN_STYLES,
|
|
1148
|
-
VisuallyHidden: VisuallyHidden
|
|
1149
|
-
});
|
|
1150
|
-
|
|
1151
|
-
// packages/react/direction/src/direction.tsx
|
|
1152
|
-
var DirectionContext = React.createContext(void 0);
|
|
1153
|
-
var DirectionProvider = (props) => {
|
|
1154
|
-
const { dir, children } = props;
|
|
1155
|
-
return /* @__PURE__ */ jsx(DirectionContext.Provider, { value: dir, children });
|
|
1156
|
-
};
|
|
1157
|
-
function useDirection(localDir) {
|
|
1158
|
-
const globalDir = React.useContext(DirectionContext);
|
|
1159
|
-
return localDir || globalDir || "ltr";
|
|
1160
|
-
}
|
|
1161
|
-
var Provider = DirectionProvider;
|
|
1162
|
-
|
|
1163
|
-
var q = /*#__PURE__*/Object.freeze({
|
|
1164
|
-
__proto__: null,
|
|
1165
|
-
DirectionProvider: DirectionProvider,
|
|
1166
|
-
Provider: Provider,
|
|
1167
|
-
useDirection: useDirection
|
|
1168
|
-
});
|
|
1169
|
-
|
|
1170
|
-
// src/accessible-icon.tsx
|
|
1171
|
-
var NAME = "AccessibleIcon";
|
|
1172
|
-
var AccessibleIcon = ({ children, label }) => {
|
|
1173
|
-
const child = React.Children.only(children);
|
|
1174
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1175
|
-
React.cloneElement(child, {
|
|
1176
|
-
// accessibility
|
|
1177
|
-
"aria-hidden": "true",
|
|
1178
|
-
focusable: "false"
|
|
1179
|
-
// See: https://allyjs.io/tutorials/focusing-in-svg.html#making-svg-elements-focusable
|
|
1180
|
-
}),
|
|
1181
|
-
/* @__PURE__ */ jsx(Root, { children: label })
|
|
1182
|
-
] });
|
|
1183
|
-
};
|
|
1184
|
-
AccessibleIcon.displayName = NAME;
|
|
1185
|
-
var Root2 = AccessibleIcon;
|
|
1186
|
-
|
|
1187
|
-
var index = /*#__PURE__*/Object.freeze({
|
|
1188
|
-
__proto__: null,
|
|
1189
|
-
AccessibleIcon: AccessibleIcon,
|
|
1190
|
-
Root: Root2
|
|
1191
|
-
});
|
|
1192
|
-
|
|
1193
|
-
// packages/react/use-callback-ref/src/use-callback-ref.tsx
|
|
1194
|
-
function useCallbackRef(callback) {
|
|
1195
|
-
const callbackRef = React.useRef(callback);
|
|
1196
|
-
React.useEffect(() => {
|
|
1197
|
-
callbackRef.current = callback;
|
|
1198
|
-
});
|
|
1199
|
-
return React.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
1200
|
-
}
|
|
1201
|
-
|
|
1202
|
-
function getDefaultExportFromCjs (x) {
|
|
1203
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
1204
|
-
}
|
|
1205
|
-
|
|
1206
|
-
const s$8=Root2;
|
|
1207
|
-
|
|
1208
|
-
var classnames = {exports: {}};
|
|
1209
|
-
|
|
1210
|
-
/*!
|
|
1211
|
-
Copyright (c) 2018 Jed Watson.
|
|
1212
|
-
Licensed under the MIT License (MIT), see
|
|
1213
|
-
http://jedwatson.github.io/classnames
|
|
1214
|
-
*/
|
|
1215
|
-
|
|
1216
|
-
var hasRequiredClassnames;
|
|
1217
|
-
|
|
1218
|
-
function requireClassnames () {
|
|
1219
|
-
if (hasRequiredClassnames) return classnames.exports;
|
|
1220
|
-
hasRequiredClassnames = 1;
|
|
1221
|
-
(function (module) {
|
|
1222
|
-
/* global define */
|
|
1223
|
-
|
|
1224
|
-
(function () {
|
|
1225
|
-
|
|
1226
|
-
var hasOwn = {}.hasOwnProperty;
|
|
1227
|
-
|
|
1228
|
-
function classNames () {
|
|
1229
|
-
var classes = '';
|
|
1230
|
-
|
|
1231
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
1232
|
-
var arg = arguments[i];
|
|
1233
|
-
if (arg) {
|
|
1234
|
-
classes = appendClass(classes, parseValue(arg));
|
|
1235
|
-
}
|
|
1236
|
-
}
|
|
1237
|
-
|
|
1238
|
-
return classes;
|
|
1239
|
-
}
|
|
1240
|
-
|
|
1241
|
-
function parseValue (arg) {
|
|
1242
|
-
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
1243
|
-
return arg;
|
|
1244
|
-
}
|
|
1245
|
-
|
|
1246
|
-
if (typeof arg !== 'object') {
|
|
1247
|
-
return '';
|
|
1248
|
-
}
|
|
1249
|
-
|
|
1250
|
-
if (Array.isArray(arg)) {
|
|
1251
|
-
return classNames.apply(null, arg);
|
|
1252
|
-
}
|
|
1253
|
-
|
|
1254
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
1255
|
-
return arg.toString();
|
|
1256
|
-
}
|
|
1257
|
-
|
|
1258
|
-
var classes = '';
|
|
1259
|
-
|
|
1260
|
-
for (var key in arg) {
|
|
1261
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
1262
|
-
classes = appendClass(classes, key);
|
|
1263
|
-
}
|
|
1264
|
-
}
|
|
1265
|
-
|
|
1266
|
-
return classes;
|
|
1267
|
-
}
|
|
1268
|
-
|
|
1269
|
-
function appendClass (value, newClass) {
|
|
1270
|
-
if (!newClass) {
|
|
1271
|
-
return value;
|
|
1272
|
-
}
|
|
1273
|
-
|
|
1274
|
-
if (value) {
|
|
1275
|
-
return value + ' ' + newClass;
|
|
1276
|
-
}
|
|
1277
|
-
|
|
1278
|
-
return value + newClass;
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1281
|
-
if (module.exports) {
|
|
1282
|
-
classNames.default = classNames;
|
|
1283
|
-
module.exports = classNames;
|
|
1284
|
-
} else {
|
|
1285
|
-
window.classNames = classNames;
|
|
1286
|
-
}
|
|
1287
|
-
}());
|
|
1288
|
-
} (classnames));
|
|
1289
|
-
return classnames.exports;
|
|
1290
|
-
}
|
|
1291
|
-
|
|
1292
|
-
var classnamesExports = requireClassnames();
|
|
1293
|
-
var y = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
1294
|
-
|
|
1295
|
-
const o$c={asChild:{type:"boolean"}};
|
|
1296
|
-
|
|
1297
|
-
const t$d={width:{type:"string",className:"rt-r-w",customProperties:["--width"],responsive:true},minWidth:{type:"string",className:"rt-r-min-w",customProperties:["--min-width"],responsive:true},maxWidth:{type:"string",className:"rt-r-max-w",customProperties:["--max-width"],responsive:true}};
|
|
1298
|
-
|
|
1299
|
-
const e$p={height:{type:"string",className:"rt-r-h",customProperties:["--height"],responsive:true},minHeight:{type:"string",className:"rt-r-min-h",customProperties:["--min-height"],responsive:true},maxHeight:{type:"string",className:"rt-r-max-h",customProperties:["--max-height"],responsive:true}};
|
|
1300
|
-
|
|
1301
|
-
const o$b=["gray","gold","bronze","brown","yellow","amber","orange","tomato","red","ruby","crimson","pink","plum","purple","violet","iris","indigo","blue","cyan","teal","jade","green","grass","lime","mint","sky"],e$o=["auto","gray","mauve","slate","sage","olive","sand"],r$n={color:{type:"enum",values:o$b,default:void 0}},s$7={color:{type:"enum",values:o$b,default:""}};
|
|
1302
|
-
|
|
1303
|
-
const o$a={highContrast:{type:"boolean",className:"rt-high-contrast",default:void 0}};
|
|
1304
|
-
|
|
1305
|
-
const e$n=["normal","start","end","both"],r$m={trim:{type:"enum",className:"rt-r-lt",values:e$n,responsive:true}};
|
|
1306
|
-
|
|
1307
|
-
const e$m=["left","center","right"],t$c={align:{type:"enum",className:"rt-r-ta",values:e$m,responsive:true}};
|
|
1308
|
-
|
|
1309
|
-
const e$l=["wrap","nowrap","pretty","balance"],r$l={wrap:{type:"enum",className:"rt-r-tw",values:e$l,responsive:true}};
|
|
1310
|
-
|
|
1311
|
-
const e$k={truncate:{type:"boolean",className:"rt-truncate"}};
|
|
1312
|
-
|
|
1313
|
-
const e$j=["light","regular","medium","bold"],t$b={weight:{type:"enum",className:"rt-r-weight",values:e$j,responsive:true}};
|
|
1314
|
-
|
|
1315
|
-
const m$7=["h1","h2","h3","h4","h5","h6"],a$g=["1","2","3","4","5","6","7","8","9"],n$a={as:{type:"enum",values:m$7,default:"h1"},...o$c,size:{type:"enum",className:"rt-r-size",values:a$g,default:"6",responsive:true},...t$b,...t$c,...r$m,...e$k,...r$l,...r$n,...o$a};
|
|
1316
|
-
|
|
1317
|
-
const e$i=["initial","xs","sm","md","lg","xl"];
|
|
1318
|
-
|
|
1319
|
-
function e$h(n,r){return Object.prototype.hasOwnProperty.call(n,r)}
|
|
1320
|
-
|
|
1321
|
-
function i$8(e){return typeof e=="object"&&Object.keys(e).some(s=>e$i.includes(s))}
|
|
1322
|
-
|
|
1323
|
-
function R$2({className:r,customProperties:n,...t}){const p=g({allowArbitraryValues:true,className:r,...t}),e=m$6({customProperties:n,...t});return [p,e]}function g({allowArbitraryValues:r,value:n,className:t,propValues:p,parseValue:e=s=>s}){const s=[];if(n){if(typeof n=="string"&&p.includes(n))return l$4(t,n,e);if(i$8(n)){const i=n;for(const o in i){if(!e$h(i,o)||!e$i.includes(o))continue;const u=i[o];if(u!==void 0){if(p.includes(u)){const f=l$4(t,u,e),v=o==="initial"?f:`${o}:${f}`;s.push(v);}else if(r){const f=o==="initial"?t:`${o}:${t}`;s.push(f);}}}return s.join(" ")}if(r)return t}}function l$4(r,n,t){const p=r?"-":"",e=t(n),s=e?.startsWith("-"),i=s?"-":"",o=s?e?.substring(1):e;return `${i}${r}${p}${o}`}function m$6({customProperties:r,value:n,propValues:t,parseValue:p=e=>e}){let e={};if(!(!n||typeof n=="string"&&t.includes(n))){if(typeof n=="string"&&(e=Object.fromEntries(r.map(s=>[s,n]))),i$8(n)){const s=n;for(const i in s){if(!e$h(s,i)||!e$i.includes(i))continue;const o=s[i];if(!t.includes(o))for(const u of r)e={[i==="initial"?u:`${u}-${i}`]:o,...e};}}for(const s in e){const i=e[s];i!==void 0&&(e[s]=p(i));}return e}}
|
|
1324
|
-
|
|
1325
|
-
function l$3(...t){let e={};for(const n of t)n&&(e={...e,...n});return Object.keys(e).length?e:void 0}
|
|
1326
|
-
|
|
1327
|
-
function N$1(...r){return Object.assign({},...r)}function v$1(r,...m){let t,l;const a={...r},f=N$1(...m);for(const n in f){let s=a[n];const e=f[n];if(e.default!==void 0&&s===void 0&&(s=e.default),e.type==="enum"&&![e.default,...e.values].includes(s)&&!i$8(s)&&(s=e.default),a[n]=s,"className"in e&&e.className){delete a[n];const u="responsive"in e;if(!s||i$8(s)&&!u)continue;if(i$8(s)&&(e.default!==void 0&&s.initial===void 0&&(s.initial=e.default),e.type==="enum"&&([e.default,...e.values].includes(s.initial)||(s.initial=e.default))),e.type==="enum"){const i=g({allowArbitraryValues:false,value:s,className:e.className,propValues:e.values,parseValue:e.parseValue});t=y(t,i);continue}if(e.type==="string"||e.type==="enum | string"){const i=e.type==="string"?[]:e.values,[d,y$1]=R$2({className:e.className,customProperties:e.customProperties,propValues:i,parseValue:e.parseValue,value:s});l=l$3(l,y$1),t=y(t,d);continue}if(e.type==="boolean"&&s){t=y(t,e.className);continue}}}return a.className=y(t,r.className),a.style=l$3(l,r.style),a}
|
|
1328
|
-
|
|
1329
|
-
const e$g=["0","1","2","3","4","5","6","7","8","9","-1","-2","-3","-4","-5","-6","-7","-8","-9"],r$k={m:{type:"enum | string",values:e$g,responsive:true,className:"rt-r-m",customProperties:["--m"]},mx:{type:"enum | string",values:e$g,responsive:true,className:"rt-r-mx",customProperties:["--ml","--mr"]},my:{type:"enum | string",values:e$g,responsive:true,className:"rt-r-my",customProperties:["--mt","--mb"]},mt:{type:"enum | string",values:e$g,responsive:true,className:"rt-r-mt",customProperties:["--mt"]},mr:{type:"enum | string",values:e$g,responsive:true,className:"rt-r-mr",customProperties:["--mr"]},mb:{type:"enum | string",values:e$g,responsive:true,className:"rt-r-mb",customProperties:["--mb"]},ml:{type:"enum | string",values:e$g,responsive:true,className:"rt-r-ml",customProperties:["--ml"]}};
|
|
1330
|
-
|
|
1331
|
-
const r$j=React.forwardRef((p,t)=>{const{children:e,className:s,asChild:a,as:n="h1",color:i,...m}=v$1(p,n$a,r$k);return React.createElement(Slot,{"data-accent-color":i,...m,ref:t,className:y("rt-Heading",s)},a?e:React.createElement(n,null,e))});r$j.displayName="Heading";
|
|
1332
|
-
|
|
1333
|
-
const m$5=["span","div","label","p"],a$f=["1","2","3","4","5","6","7","8","9"],n$9={as:{type:"enum",values:m$5,default:"span"},...o$c,size:{type:"enum",className:"rt-r-size",values:a$f,responsive:true},...t$b,...t$c,...r$m,...e$k,...r$l,...r$n,...o$a};
|
|
1334
|
-
|
|
1335
|
-
const p$i=React.forwardRef((t,r)=>{const{children:e,className:s,asChild:m,as:a="span",color:n,...P}=v$1(t,n$9,r$k);return React.createElement(Slot,{"data-accent-color":n,...P,ref:r,className:y("rt-Text",s)},m?e:React.createElement(a,null,e))});p$i.displayName="Text";
|
|
1336
|
-
|
|
1337
|
-
function a$e(e){switch(e){case "tomato":case "red":case "ruby":case "crimson":case "pink":case "plum":case "purple":case "violet":return "mauve";case "iris":case "indigo":case "blue":case "sky":case "cyan":return "slate";case "teal":case "jade":case "mint":case "green":return "sage";case "grass":case "lime":return "olive";case "yellow":case "amber":case "orange":case "brown":case "gold":case "bronze":return "sand";case "gray":return "gray"}}
|
|
1338
|
-
|
|
1339
|
-
const e$f=["none","small","medium","large","full"],r$i={radius:{type:"enum",values:e$f,default:void 0}};
|
|
1340
|
-
|
|
1341
|
-
const t$a=["solid","translucent"],n$8=["90%","95%","100%","105%","110%"],s$6={hasBackground:{default:true},appearance:{default:"inherit"},accentColor:{values:o$b,default:"indigo"},grayColor:{values:e$o,default:"auto"},panelBackground:{values:t$a,default:"translucent"},radius:{values:e$f,default:"medium"},scaling:{values:n$8,default:"100%"}};
|
|
1342
|
-
|
|
1343
|
-
const d$3=()=>{},P$2=React.createContext(void 0);function H(){const a=React.useContext(P$2);if(a===void 0)throw new Error("`useThemeContext` must be used within a `Theme`");return a}const R$1=React.forwardRef((a,s)=>React.useContext(P$2)===void 0?React.createElement(t$h.Provider,{delayDuration:200},React.createElement(Provider,{dir:"ltr"},React.createElement(I,{...a,ref:s}))):React.createElement(A,{...a,ref:s}));R$1.displayName="Theme";const I=React.forwardRef((a,s)=>{const{appearance:r=s$6.appearance.default,accentColor:c=s$6.accentColor.default,grayColor:l=s$6.grayColor.default,panelBackground:p=s$6.panelBackground.default,radius:n=s$6.radius.default,scaling:t=s$6.scaling.default,hasBackground:i=s$6.hasBackground.default,...u}=a,[h,m]=React.useState(r);React.useEffect(()=>m(r),[r]);const[y,g]=React.useState(c);React.useEffect(()=>g(c),[c]);const[v,C]=React.useState(l);React.useEffect(()=>C(l),[l]);const[k,f]=React.useState(p);React.useEffect(()=>f(p),[p]);const[B,x]=React.useState(n);React.useEffect(()=>x(n),[n]);const[T,b]=React.useState(t);return React.useEffect(()=>b(t),[t]),React.createElement(A,{...u,ref:s,isRoot:true,hasBackground:i,appearance:h,accentColor:y,grayColor:v,panelBackground:k,radius:B,scaling:T,onAppearanceChange:m,onAccentColorChange:g,onGrayColorChange:C,onPanelBackgroundChange:f,onRadiusChange:x,onScalingChange:b})});I.displayName="ThemeRoot";const A=React.forwardRef((a,s)=>{const r=React.useContext(P$2),{asChild:c,isRoot:l,hasBackground:p,appearance:n=r?.appearance??s$6.appearance.default,accentColor:t=r?.accentColor??s$6.accentColor.default,grayColor:i=r?.resolvedGrayColor??s$6.grayColor.default,panelBackground:u=r?.panelBackground??s$6.panelBackground.default,radius:h=r?.radius??s$6.radius.default,scaling:m=r?.scaling??s$6.scaling.default,onAppearanceChange:y$1=d$3,onAccentColorChange:g=d$3,onGrayColorChange:v=d$3,onPanelBackgroundChange:C=d$3,onRadiusChange:k=d$3,onScalingChange:f=d$3,...B}=a,x=c?Slot:"div",T=i==="auto"?a$e(t):i,b=a.appearance==="light"||a.appearance==="dark",S=p===void 0?l||b:p;return React.createElement(P$2.Provider,{value:React.useMemo(()=>({appearance:n,accentColor:t,grayColor:i,resolvedGrayColor:T,panelBackground:u,radius:h,scaling:m,onAppearanceChange:y$1,onAccentColorChange:g,onGrayColorChange:v,onPanelBackgroundChange:C,onRadiusChange:k,onScalingChange:f}),[n,t,i,T,u,h,m,y$1,g,v,C,k,f])},React.createElement(x,{"data-is-root-theme":l?"true":"false","data-accent-color":t,"data-gray-color":T,"data-has-background":S?"true":"false","data-panel-background":u,"data-radius":h,"data-scaling":m,ref:s,...B,className:y("radix-themes",{light:n==="light",dark:n==="dark"},B.className)}))});A.displayName="ThemeImpl";
|
|
1344
|
-
|
|
1345
|
-
const a$d=t=>{if(!React.isValidElement(t))throw Error(`Expected a single React Element child, but got: ${React.Children.toArray(t).map(e=>typeof e=="object"&&"type"in e&&typeof e.type=="string"?e.type:typeof e).join(", ")}`);return t};
|
|
1346
|
-
|
|
1347
|
-
function d$2(i,e){const{asChild:r,children:c}=i;if(!r)return typeof e=="function"?e(c):e;const t=React.Children.only(c);return React.cloneElement(t,{children:typeof e=="function"?e(t.props.children):e})}
|
|
1348
|
-
|
|
1349
|
-
const e$e=React.forwardRef((t,p)=>{const{asChild:r,children:s,className:m,...l}=t,c=r?Slot:"blockquote";return React.createElement(p$i,{asChild:true,...l,ref:p,className:y("rt-Blockquote",m)},React.createElement(c,null,s))});e$e.displayName="Blockquote";
|
|
1350
|
-
|
|
1351
|
-
const e$d=Slot;
|
|
1352
|
-
|
|
1353
|
-
const s$5=["div","span"],o$9=["none","inline","inline-block","block","contents"],p$h={as:{type:"enum",values:s$5,default:"div"},...o$c,display:{type:"enum",className:"rt-r-display",values:o$9,responsive:true}};
|
|
1354
|
-
|
|
1355
|
-
const e$c=["0","1","2","3","4","5","6","7","8","9"],p$g={p:{type:"enum | string",className:"rt-r-p",customProperties:["--p"],values:e$c,responsive:true},px:{type:"enum | string",className:"rt-r-px",customProperties:["--pl","--pr"],values:e$c,responsive:true},py:{type:"enum | string",className:"rt-r-py",customProperties:["--pt","--pb"],values:e$c,responsive:true},pt:{type:"enum | string",className:"rt-r-pt",customProperties:["--pt"],values:e$c,responsive:true},pr:{type:"enum | string",className:"rt-r-pr",customProperties:["--pr"],values:e$c,responsive:true},pb:{type:"enum | string",className:"rt-r-pb",customProperties:["--pb"],values:e$c,responsive:true},pl:{type:"enum | string",className:"rt-r-pl",customProperties:["--pl"],values:e$c,responsive:true}};
|
|
1356
|
-
|
|
1357
|
-
const r$h=["visible","hidden","clip","scroll","auto"],i$7=["static","relative","absolute","fixed","sticky"],e$b=["0","1","2","3","4","5","6","7","8","9","-1","-2","-3","-4","-5","-6","-7","-8","-9"],p$f=["0","1"],n$7=["0","1"],u$6={...p$g,...t$d,...e$p,position:{type:"enum",className:"rt-r-position",values:i$7,responsive:true},inset:{type:"enum | string",className:"rt-r-inset",customProperties:["--inset"],values:e$b,responsive:true},top:{type:"enum | string",className:"rt-r-top",customProperties:["--top"],values:e$b,responsive:true},right:{type:"enum | string",className:"rt-r-right",customProperties:["--right"],values:e$b,responsive:true},bottom:{type:"enum | string",className:"rt-r-bottom",customProperties:["--bottom"],values:e$b,responsive:true},left:{type:"enum | string",className:"rt-r-left",customProperties:["--left"],values:e$b,responsive:true},overflow:{type:"enum",className:"rt-r-overflow",values:r$h,responsive:true},overflowX:{type:"enum",className:"rt-r-ox",values:r$h,responsive:true},overflowY:{type:"enum",className:"rt-r-oy",values:r$h,responsive:true},flexBasis:{type:"string",className:"rt-r-fb",customProperties:["--flex-basis"],responsive:true},flexShrink:{type:"enum | string",className:"rt-r-fs",customProperties:["--flex-shrink"],values:p$f,responsive:true},flexGrow:{type:"enum | string",className:"rt-r-fg",customProperties:["--flex-grow"],values:n$7,responsive:true},gridArea:{type:"string",className:"rt-r-ga",customProperties:["--grid-area"],responsive:true},gridColumn:{type:"string",className:"rt-r-gc",customProperties:["--grid-column"],responsive:true},gridColumnStart:{type:"string",className:"rt-r-gcs",customProperties:["--grid-column-start"],responsive:true},gridColumnEnd:{type:"string",className:"rt-r-gce",customProperties:["--grid-column-end"],responsive:true},gridRow:{type:"string",className:"rt-r-gr",customProperties:["--grid-row"],responsive:true},gridRowStart:{type:"string",className:"rt-r-grs",customProperties:["--grid-row-start"],responsive:true},gridRowEnd:{type:"string",className:"rt-r-gre",customProperties:["--grid-row-end"],responsive:true}};
|
|
1358
|
-
|
|
1359
|
-
const p$e=React.forwardRef((r,s)=>{const{className:t,asChild:e,as:m="div",...a}=v$1(r,p$h,u$6,r$k);return React.createElement(e?e$d:m,{...a,ref:s,className:y("rt-Box",t)})});p$e.displayName="Box";
|
|
1360
|
-
|
|
1361
|
-
const t$9=["1","2","3","4"],a$c=["classic","solid","soft","surface","outline","ghost"],i$6={...o$c,size:{type:"enum",className:"rt-r-size",values:t$9,default:"2",responsive:true},variant:{type:"enum",className:"rt-variant",values:a$c,default:"solid"},...s$7,...o$a,...r$i,loading:{type:"boolean",className:"rt-loading",default:false}};
|
|
1362
|
-
|
|
1363
|
-
const e$a=["0","1","2","3","4","5","6","7","8","9"],p$d={gap:{type:"enum | string",className:"rt-r-gap",customProperties:["--gap"],values:e$a,responsive:true},gapX:{type:"enum | string",className:"rt-r-cg",customProperties:["--column-gap"],values:e$a,responsive:true},gapY:{type:"enum | string",className:"rt-r-rg",customProperties:["--row-gap"],values:e$a,responsive:true}};
|
|
1364
|
-
|
|
1365
|
-
const t$8=["div","span"],p$c=["none","inline-flex","flex"],a$b=["row","column","row-reverse","column-reverse"],o$8=["start","center","end","baseline","stretch"],n$6=["start","center","end","between"],l$2=["nowrap","wrap","wrap-reverse"],u$5={as:{type:"enum",values:t$8,default:"div"},...o$c,display:{type:"enum",className:"rt-r-display",values:p$c,responsive:true},direction:{type:"enum",className:"rt-r-fd",values:a$b,responsive:true},align:{type:"enum",className:"rt-r-ai",values:o$8,responsive:true},justify:{type:"enum",className:"rt-r-jc",values:n$6,parseValue:f$6,responsive:true},wrap:{type:"enum",className:"rt-r-fw",values:l$2,responsive:true},...p$d};function f$6(e){return e==="between"?"space-between":e}
|
|
1366
|
-
|
|
1367
|
-
const p$b=React.forwardRef((r,e)=>{const{className:s,asChild:t,as:m="div",...l}=v$1(r,u$5,u$6,r$k);return React.createElement(t?e$d:m,{...l,ref:e,className:y("rt-Flex",s)})});p$b.displayName="Flex";
|
|
1368
|
-
|
|
1369
|
-
const e$9=["1","2","3"],s$4={size:{type:"enum",className:"rt-r-size",values:e$9,default:"2",responsive:true},loading:{type:"boolean",default:true}};
|
|
1370
|
-
|
|
1371
|
-
const s$3=React.forwardRef((i,o)=>{const{className:a,children:e,loading:t,...m}=v$1(i,s$4,r$k);if(!t)return e;const r=React.createElement("span",{...m,ref:o,className:y("rt-Spinner",a)},React.createElement("span",{className:"rt-SpinnerLeaf"}),React.createElement("span",{className:"rt-SpinnerLeaf"}),React.createElement("span",{className:"rt-SpinnerLeaf"}),React.createElement("span",{className:"rt-SpinnerLeaf"}),React.createElement("span",{className:"rt-SpinnerLeaf"}),React.createElement("span",{className:"rt-SpinnerLeaf"}),React.createElement("span",{className:"rt-SpinnerLeaf"}),React.createElement("span",{className:"rt-SpinnerLeaf"}));return e===void 0?r:React.createElement(p$b,{asChild:true,position:"relative",align:"center",justify:"center"},React.createElement("span",null,React.createElement("span",{"aria-hidden":true,style:{display:"contents",visibility:"hidden"},inert:void 0},e),React.createElement(p$b,{asChild:true,align:"center",justify:"center",position:"absolute",inset:"0"},React.createElement("span",null,r))))});s$3.displayName="Spinner";
|
|
1372
|
-
|
|
1373
|
-
const d$1=Root;
|
|
1374
|
-
|
|
1375
|
-
function s$2(e,t){if(e!==void 0)return typeof e=="string"?t(e):Object.fromEntries(Object.entries(e).map(([n,o])=>[n,t(o)]))}function p$a(e){return e==="3"?"3":"2"}function r$g(e){switch(e){case "1":return "1";case "2":case "3":return "2";case "4":return "3"}}
|
|
1376
|
-
|
|
1377
|
-
const n$5=React.forwardRef((t,p)=>{const{size:i=i$6.size.default}=t,{className:a,children:e,asChild:m,color:d,radius:l,disabled:s=t.loading,...u}=v$1(t,i$6,r$k),f=m?Slot:"button";return React.createElement(f,{"data-disabled":s||void 0,"data-accent-color":d,"data-radius":l,...u,ref:p,className:y("rt-reset","rt-BaseButton",a),disabled:s},t.loading?React.createElement(React.Fragment,null,React.createElement("span",{style:{display:"contents",visibility:"hidden"},"aria-hidden":true},e),React.createElement(d$1,null,e),React.createElement(p$b,{asChild:true,align:"center",justify:"center",position:"absolute",inset:"0"},React.createElement("span",null,React.createElement(s$3,{size:s$2(i,r$g)})))):e)});n$5.displayName="BaseButton";
|
|
1378
|
-
|
|
1379
|
-
const o$7=React.forwardRef(({className:e,...n},r)=>React.createElement(n$5,{...n,ref:r,className:y("rt-Button",e)}));o$7.displayName="Button";
|
|
1380
|
-
|
|
1381
|
-
const t$7=["1","2","3"],r$f=["soft","surface","outline"],a$a={...o$c,size:{type:"enum",className:"rt-r-size",values:t$7,default:"2",responsive:true},variant:{type:"enum",className:"rt-variant",values:r$f,default:"soft"},...s$7,...o$a};
|
|
1382
|
-
|
|
1383
|
-
const a$9=React.createContext({}),n$4=React.forwardRef((t,l)=>{const{size:e=a$a.size.default}=t,{asChild:r,children:C,className:i,color:c,...f}=v$1(t,a$a,r$k),P=r?Slot:"div";return React.createElement(P,{"data-accent-color":c,...f,className:y("rt-CalloutRoot",i),ref:l},React.createElement(a$9.Provider,{value:React.useMemo(()=>({size:e}),[e])},C))});n$4.displayName="Callout.Root";const m$4=React.forwardRef(({className:t,...l},e)=>React.createElement("div",{...l,className:y("rt-CalloutIcon",t),ref:e}));m$4.displayName="Callout.Icon";const u$4=React.forwardRef(({className:t,...l},e)=>{const{size:r}=React.useContext(a$9);return React.createElement(p$i,{as:"p",size:s$2(r,p$a),...l,asChild:false,ref:e,className:y("rt-CalloutText",t)})});u$4.displayName="Callout.Text";
|
|
1384
|
-
|
|
1385
|
-
var callout = /*#__PURE__*/Object.freeze({
|
|
1386
|
-
__proto__: null,
|
|
1387
|
-
Icon: m$4,
|
|
1388
|
-
Root: n$4,
|
|
1389
|
-
Text: u$4
|
|
1390
|
-
});
|
|
1391
|
-
|
|
1392
|
-
const e$8=["1","2","3","4","5"],r$e=["surface","classic","ghost"],a$8={...o$c,size:{type:"enum",className:"rt-r-size",values:e$8,default:"1",responsive:true},variant:{type:"enum",className:"rt-variant",values:r$e,default:"surface"}};
|
|
1393
|
-
|
|
1394
|
-
const o$6=React.forwardRef((p,e)=>{const{asChild:t,className:s,...a}=v$1(p,a$8,r$k),m=t?Slot:"div";return React.createElement(m,{ref:e,...a,className:y("rt-reset","rt-BaseCard","rt-Card",s)})});o$6.displayName="Card";
|
|
1395
|
-
|
|
1396
|
-
// src/internal.ts
|
|
1397
|
-
var Primitive = Primitive$1;
|
|
1398
|
-
Primitive.dispatchDiscreteCustomEvent = dispatchDiscreteCustomEvent;
|
|
1399
|
-
Primitive.Root = Primitive$1;
|
|
1400
|
-
|
|
1401
|
-
const a$7=["div","span"],n$3=["none","inline-grid","grid"],p$9=["1","2","3","4","5","6","7","8","9"],u$3=["1","2","3","4","5","6","7","8","9"],i$5=["row","column","dense","row-dense","column-dense"],l$1=["start","center","end","baseline","stretch"],f$5=["start","center","end","between"],s$1={as:{type:"enum",values:a$7,default:"div"},...o$c,display:{type:"enum",className:"rt-r-display",values:n$3,responsive:true},areas:{type:"string",className:"rt-r-gta",customProperties:["--grid-template-areas"],responsive:true},columns:{type:"enum | string",className:"rt-r-gtc",customProperties:["--grid-template-columns"],values:p$9,parseValue:r$d,responsive:true},rows:{type:"enum | string",className:"rt-r-gtr",customProperties:["--grid-template-rows"],values:u$3,parseValue:r$d,responsive:true},flow:{type:"enum",className:"rt-r-gaf",values:i$5,responsive:true},align:{type:"enum",className:"rt-r-ai",values:l$1,responsive:true},justify:{type:"enum",className:"rt-r-jc",values:f$5,parseValue:m$3,responsive:true},...p$d};function r$d(e){return s$1.columns.values.includes(e)?e:e?.match(/^\d+$/)?`repeat(${e}, minmax(0, 1fr))`:e}function m$3(e){return e==="between"?"space-between":e}
|
|
1402
|
-
|
|
1403
|
-
const o$5=React.forwardRef((p,s)=>{const{className:t,asChild:e,as:i="div",...m}=v$1(p,s$1,u$6,r$k);return React.createElement(e?e$d:i,{...m,ref:s,className:y("rt-Grid",t)})});o$5.displayName="Grid";
|
|
1404
|
-
|
|
1405
|
-
const a$6=["1","2","3","4","5","6","7","8","9"],i$4=["solid","soft","outline","ghost"],f$4={...o$c,size:{type:"enum",className:"rt-r-size",values:a$6,responsive:true},variant:{type:"enum",className:"rt-variant",values:i$4,default:"soft"},...t$b,...s$7,...o$a,...e$k,...r$l};
|
|
1406
|
-
|
|
1407
|
-
const p$8=React.forwardRef((o,t)=>{const{asChild:s,className:m,color:e,...d}=v$1(o,f$4,r$k),n=o.variant==="ghost"?e||void 0:e,a=s?Slot:"code";return React.createElement(a,{"data-accent-color":n,...d,ref:t,className:y("rt-reset","rt-Code",m)})});p$8.displayName="Code";
|
|
1408
|
-
|
|
1409
|
-
const r$c=["1","2","3","4"],t$6=["none","initial"],p$7=["left","center","right"],n$2={...o$c,size:{type:"enum",className:"rt-r-size",values:r$c,default:"4",responsive:true},display:{type:"enum",className:"rt-r-display",values:t$6,parseValue:a$5,responsive:true},align:{type:"enum",className:"rt-r-ai",values:p$7,parseValue:i$3,responsive:true}};function a$5(e){return e==="initial"?"flex":e}function i$3(e){return e==="left"?"start":e==="right"?"end":e}
|
|
1410
|
-
|
|
1411
|
-
const p$6=React.forwardRef(({width:n,minWidth:s,maxWidth:i,height:m,minHeight:a,maxHeight:f,...P},l)=>{const{asChild:r,children:C,className:c,...y$1}=v$1(P,n$2,u$6,r$k),{className:d,style:h}=v$1({width:n,minWidth:s,maxWidth:i,height:m,minHeight:a,maxHeight:f},t$d,e$p),u=r?Slot:"div";return React.createElement(u,{...y$1,ref:l,className:y("rt-Container",c)},d$2({asChild:r,children:C},v=>React.createElement("div",{className:y("rt-ContainerInner",d),style:h},v)))});p$6.displayName="Container";
|
|
1412
|
-
|
|
1413
|
-
const r$b=["1","2","3"],t$5={...o$c,size:{values:r$b,default:"1"},...r$i,scrollbars:{default:"both"}};
|
|
1414
|
-
|
|
1415
|
-
function a$4(r){const{m:t,mx:m,my:o,mt:p,mr:n,mb:s,ml:e,...i}=r;return {m:t,mx:m,my:o,mt:p,mr:n,mb:s,ml:e,rest:i}}
|
|
1416
|
-
|
|
1417
|
-
const r$a=r$k.m.values;function S(s){const[e,t]=R$2({className:"rt-r-m",customProperties:["--margin"],propValues:r$a,value:s.m}),[a,o]=R$2({className:"rt-r-mx",customProperties:["--margin-left","--margin-right"],propValues:r$a,value:s.mx}),[l,i]=R$2({className:"rt-r-my",customProperties:["--margin-top","--margin-bottom"],propValues:r$a,value:s.my}),[p,u]=R$2({className:"rt-r-mt",customProperties:["--margin-top"],propValues:r$a,value:s.mt}),[n,c]=R$2({className:"rt-r-mr",customProperties:["--margin-right"],propValues:r$a,value:s.mr}),[g,P]=R$2({className:"rt-r-mb",customProperties:["--margin-bottom"],propValues:r$a,value:s.mb}),[N,C]=R$2({className:"rt-r-ml",customProperties:["--margin-left"],propValues:r$a,value:s.ml});return [y(e,a,l,p,n,g,N),l$3(t,o,i,u,c,P,C)]}
|
|
1418
|
-
|
|
1419
|
-
const c$2=React.forwardRef((n,S$1)=>{const{rest:f,...P}=a$4(n),[u,A]=S(P),{asChild:a,children:d,className:y$1,style:v,type:t,scrollHideDelay:N=t!=="scroll"?0:void 0,dir:V,size:i=t$5.size.default,radius:p=t$5.radius.default,scrollbars:l=t$5.scrollbars.default,...b}=f;return React.createElement(e$s.Root,{type:t,scrollHideDelay:N,className:y("rt-ScrollAreaRoot",u,y$1),style:l$3(A,v),asChild:a},d$2({asChild:a,children:d},g$1=>React.createElement(React.Fragment,null,React.createElement(e$s.Viewport,{...b,ref:S$1,className:"rt-ScrollAreaViewport"},g$1),React.createElement("div",{className:"rt-ScrollAreaViewportFocusRing"}),l!=="vertical"?React.createElement(e$s.Scrollbar,{"data-radius":p,orientation:"horizontal",className:y("rt-ScrollAreaScrollbar",g({className:"rt-r-size",value:i,propValues:t$5.size.values}))},React.createElement(e$s.Thumb,{className:"rt-ScrollAreaThumb"})):null,l!=="horizontal"?React.createElement(e$s.Scrollbar,{"data-radius":p,orientation:"vertical",className:y("rt-ScrollAreaScrollbar",g({className:"rt-r-size",value:i,propValues:t$5.size.values}))},React.createElement(e$s.Thumb,{className:"rt-ScrollAreaThumb"})):null,l==="both"?React.createElement(e$s.Corner,{className:"rt-ScrollAreaCorner"}):null)))});c$2.displayName="ScrollArea";
|
|
1420
|
-
|
|
1421
|
-
const t$4={...o$c,...e$k,...r$l};
|
|
1422
|
-
|
|
1423
|
-
const e$7=React.forwardRef((p,m)=>{const{asChild:r,className:t,...s}=v$1(p,t$4),f=r?Slot:"em";return React.createElement(f,{...s,ref:m,className:y("rt-Em",t)})});e$7.displayName="Em";
|
|
1424
|
-
|
|
1425
|
-
const o$4=React.forwardRef(({className:e,...n},r)=>React.createElement(n$5,{...n,ref:r,className:y("rt-IconButton",e)}));o$4.displayName="IconButton";
|
|
1426
|
-
|
|
1427
|
-
const a$3=["all","x","y","top","bottom","left","right"],t$3=["border-box","padding-box"],e$6=["current","0"],u$2={...o$c,side:{type:"enum",className:"rt-r-side",values:a$3,default:"all",responsive:true},clip:{type:"enum",className:"rt-r-clip",values:t$3,default:"border-box",responsive:true},p:{type:"enum",className:"rt-r-p",values:e$6,parseValue:p$5,responsive:true},px:{type:"enum",className:"rt-r-px",values:e$6,parseValue:p$5,responsive:true},py:{type:"enum",className:"rt-r-py",values:e$6,parseValue:p$5,responsive:true},pt:{type:"enum",className:"rt-r-pt",values:e$6,parseValue:p$5,responsive:true},pr:{type:"enum",className:"rt-r-pr",values:e$6,parseValue:p$5,responsive:true},pb:{type:"enum",className:"rt-r-pb",values:e$6,parseValue:p$5,responsive:true},pl:{type:"enum",className:"rt-r-pl",values:e$6,parseValue:p$5,responsive:true}};function p$5(s){return s==="current"?"inset":s}
|
|
1428
|
-
|
|
1429
|
-
const e$5=React.forwardRef((r,t)=>{const{asChild:p,className:s,...n}=v$1(r,u$2,r$k),m=p?Slot:"div";return React.createElement(m,{...n,ref:t,className:y("rt-Inset",s)})});e$5.displayName="Inset";
|
|
1430
|
-
|
|
1431
|
-
const e$4=["1","2","3","4","5","6","7","8","9"],o$3={...o$c,size:{type:"enum",className:"rt-r-size",values:e$4,responsive:true}};
|
|
1432
|
-
|
|
1433
|
-
const r$9=React.forwardRef((p,e)=>{const{asChild:t,className:s,...m}=v$1(p,o$3,r$k),d=t?Slot:"kbd";return React.createElement(d,{...m,ref:e,className:y("rt-reset","rt-Kbd",s)})});r$9.displayName="Kbd";
|
|
1434
|
-
|
|
1435
|
-
const n$1=["1","2","3","4","5","6","7","8","9"],f$3=["auto","always","hover","none"],m$2={...o$c,size:{type:"enum",className:"rt-r-size",values:n$1,responsive:true},...t$b,...r$m,...e$k,...r$l,underline:{type:"enum",className:"rt-underline",values:f$3,default:"auto"},...s$7,...o$a};
|
|
1436
|
-
|
|
1437
|
-
const e$3=React.forwardRef((p,t)=>{const{children:r,className:s,color:n,asChild:i,...m}=v$1(p,m$2);return React.createElement(p$i,{...m,"data-accent-color":n,ref:t,asChild:true,className:y("rt-reset","rt-Link",s)},i?r:React.createElement("a",null,r))});e$3.displayName="Link";
|
|
1438
|
-
|
|
1439
|
-
const p$4=["1","2","3","4"],r$8={...o$c,size:{type:"enum",className:"rt-r-size",values:p$4,default:"2",responsive:true},width:t$d.width,minWidth:t$d.minWidth,maxWidth:{...t$d.maxWidth,default:"480px"},...e$p};
|
|
1440
|
-
|
|
1441
|
-
const P$1=e=>React.createElement(p$j.Root,{...e});P$1.displayName="Popover.Root";const s=React.forwardRef(({children:e,...r},t)=>React.createElement(p$j.Trigger,{...r,ref:t,asChild:true},a$d(e)));s.displayName="Popover.Trigger";const i$2=React.forwardRef((e,r)=>{const{className:t,forceMount:a,container:f,...l}=v$1(e,r$8);return React.createElement(p$j.Portal,{container:f,forceMount:a},React.createElement(R$1,{asChild:true},React.createElement(p$j.Content,{align:"start",sideOffset:8,collisionPadding:10,...l,ref:r,className:y("rt-PopperContent","rt-PopoverContent",t)})))});i$2.displayName="Popover.Content";const v=React.forwardRef(({children:e,...r},t)=>React.createElement(p$j.Close,{...r,ref:t,asChild:true},a$d(e)));v.displayName="Popover.Close";const m$1=React.forwardRef(({children:e,...r},t)=>React.createElement(p$j.Anchor,{...r,ref:t}));m$1.displayName="Popover.Anchor";
|
|
1442
|
-
|
|
1443
|
-
const p$3={...o$c,...e$k,...r$l};
|
|
1444
|
-
|
|
1445
|
-
const e$2=React.forwardRef((t,p)=>{const{asChild:r,className:s,...m}=v$1(t,p$3),f=r?Slot:"q";return React.createElement(f,{...m,ref:p,className:y("rt-Quote",s)})});e$2.displayName="Quote";
|
|
1446
|
-
|
|
1447
|
-
const p$2=["1","2","3","4"],o$2=["none","initial"],t$2={...o$c,size:{type:"enum",className:"rt-r-size",values:p$2,default:"3",responsive:true},display:{type:"enum",className:"rt-r-display",values:o$2,parseValue:r$7,responsive:true}};function r$7(e){return e==="initial"?"block":e}
|
|
1448
|
-
|
|
1449
|
-
const r$6=React.forwardRef((t,p)=>{const{asChild:e,className:s,...m}=v$1(t,t$2,u$6,r$k),i=e?Slot:"section";return React.createElement(i,{...m,ref:p,className:y("rt-Section",s)})});r$6.displayName="Section";
|
|
1450
|
-
|
|
1451
|
-
const r$5=parseFloat(React.version)>=19||"";
|
|
1452
|
-
|
|
1453
|
-
const p$1={...o$c,...e$k,...r$l};
|
|
1454
|
-
|
|
1455
|
-
const r$4=React.forwardRef((t,e)=>{const{asChild:p,className:s,...n}=v$1(t,p$1),m=p?Slot:"strong";return React.createElement(m,{...n,ref:e,className:y("rt-Strong",s)})});r$4.displayName="Strong";
|
|
1456
|
-
|
|
1457
|
-
const r$3=["1","2","3"],a$2=["surface","ghost"],o$1=["auto","fixed"],n={size:{type:"enum",className:"rt-r-size",values:r$3,default:"2",responsive:true},variant:{type:"enum",className:"rt-variant",values:a$2,default:"ghost"},layout:{type:"enum",className:"rt-r-tl",values:o$1,responsive:true}},i$1=["start","center","end","baseline"],u$1={align:{type:"enum",className:"rt-r-va",values:i$1,parseValue:l,responsive:true}};function l(e){return {baseline:"baseline",start:"top",center:"middle",end:"bottom"}[e]}const p=["start","center","end"],f$2={justify:{type:"enum",className:"rt-r-ta",values:p,parseValue:c$1,responsive:true},...t$d,...p$g};function c$1(e){return {start:"left",center:"center",end:"right"}[e]}
|
|
1458
|
-
|
|
1459
|
-
const m=React.forwardRef((o,l)=>{const{layout:a,...r}=n,{className:C,children:c,layout:y$1,...i}=v$1(o,r,r$k),w=g({value:y$1,className:n.layout.className,propValues:n.layout.values});return React.createElement("div",{ref:l,className:y("rt-TableRoot",C),...i},React.createElement(c$2,null,React.createElement("table",{className:y("rt-TableRootTable",w)},c)))});m.displayName="Table.Root";const d=React.forwardRef(({className:o,...l},a)=>React.createElement("thead",{...l,ref:a,className:y("rt-TableHeader",o)}));d.displayName="Table.Header";const b=React.forwardRef(({className:o,...l},a)=>React.createElement("tbody",{...l,ref:a,className:y("rt-TableBody",o)}));b.displayName="Table.Body";const P=React.forwardRef((o,l)=>{const{className:a,...r}=v$1(o,u$1);return React.createElement("tr",{...r,ref:l,className:y("rt-TableRow",a)})});P.displayName="Table.Row";const T=React.forwardRef((o,l)=>{const{className:a,...r}=v$1(o,f$2);return React.createElement("td",{className:y("rt-TableCell",a),ref:l,...r})});T.displayName="Table.Cell";const f$1=React.forwardRef((o,l)=>{const{className:a,...r}=v$1(o,f$2);return React.createElement("th",{className:y("rt-TableCell","rt-TableColumnHeaderCell",a),scope:"col",ref:l,...r})});f$1.displayName="Table.ColumnHeaderCell";const R=React.forwardRef((o,l)=>{const{className:a,...r}=v$1(o,f$2);return React.createElement("th",{className:y("rt-TableCell","rt-TableRowHeaderCell",a),scope:"row",ref:l,...r})});R.displayName="Table.RowHeaderCell";
|
|
1460
|
-
|
|
1461
|
-
var table = /*#__PURE__*/Object.freeze({
|
|
1462
|
-
__proto__: null,
|
|
1463
|
-
Body: b,
|
|
1464
|
-
Cell: T,
|
|
1465
|
-
ColumnHeaderCell: f$1,
|
|
1466
|
-
Header: d,
|
|
1467
|
-
Root: m,
|
|
1468
|
-
Row: P,
|
|
1469
|
-
RowHeaderCell: R
|
|
1470
|
-
});
|
|
1471
|
-
|
|
1472
|
-
const r$2=["1","2","3"],t$1=["classic","surface","soft"],o=["none","vertical","horizontal","both"],a$1={size:{type:"enum",className:"rt-r-size",values:r$2,default:"2",responsive:true},variant:{type:"enum",className:"rt-variant",values:t$1,default:"surface"},resize:{type:"enum",className:"rt-r-resize",values:o,responsive:true},...r$n,...r$i};
|
|
1473
|
-
|
|
1474
|
-
const r$1=React.forwardRef((t,o)=>{const{className:p,color:a,radius:s,style:m,...n}=v$1(t,a$1,r$k);return React.createElement("div",{"data-accent-color":a,"data-radius":s,className:y("rt-TextAreaRoot",p),style:m},React.createElement("textarea",{className:"rt-reset rt-TextAreaInput",ref:o,...n}))});r$1.displayName="TextArea";
|
|
1475
|
-
|
|
1476
|
-
const r=["1","2","3"],t=["classic","surface","soft"],f={size:{type:"enum",className:"rt-r-size",values:r,default:"2",responsive:true},variant:{type:"enum",className:"rt-variant",values:t,default:"surface"},...r$n,...r$i},a=["left","right"],i={side:{type:"enum",values:a},...r$n,gap:u$5.gap,px:p$g.px,pl:p$g.pl,pr:p$g.pr};
|
|
1477
|
-
|
|
1478
|
-
const u=React.forwardRef((r,s)=>{const e=React.useRef(null),{children:l,className:i,color:p,radius:f$1,style:x,...P}=v$1(r,f,r$k);return React.createElement("div",{"data-accent-color":p,"data-radius":f$1,style:x,className:y("rt-TextFieldRoot",i),onPointerDown:T=>{const n=T.target;if(n.closest("input, button, a"))return;const o=e.current;if(!o)return;const a=n.closest(`
|
|
1479
|
-
.rt-TextFieldSlot[data-side='right'],
|
|
1480
|
-
.rt-TextFieldSlot:not([data-side='right']) ~ .rt-TextFieldSlot:not([data-side='left'])
|
|
1481
|
-
`)?o.value.length:0;requestAnimationFrame(()=>{try{o.setSelectionRange(a,a);}catch{}o.focus();});}},React.createElement("input",{spellCheck:"false",...P,ref:composeRefs(e,s),className:"rt-reset rt-TextFieldInput"}),l)});u.displayName="TextField.Root";const c=React.forwardRef((r,s)=>{const{className:e,color:l,side:i$1,...p}=v$1(r,i);return React.createElement("div",{"data-accent-color":l,"data-side":i$1,...p,ref:s,className:y("rt-TextFieldSlot",e)})});c.displayName="TextField.Slot";
|
|
1482
|
-
|
|
1483
|
-
var textField = /*#__PURE__*/Object.freeze({
|
|
1484
|
-
__proto__: null,
|
|
1485
|
-
Root: u,
|
|
1486
|
-
Slot: c
|
|
1487
|
-
});
|
|
1488
|
-
|
|
1489
|
-
const N=React.forwardRef(({defaultOpen:n=true,...a},l)=>{const[c,h]=React.useState(n);return React.createElement(z,{...a,ref:l,open:c,onOpenChange:h})});N.displayName="ThemePanel";const z=React.forwardRef((n,a)=>{const{open:l,onOpenChange:c,onAppearanceChange:h,...v}=n,G=H(),{appearance:d,onAppearanceChange:B,accentColor:g,onAccentColorChange:$,grayColor:f,onGrayColorChange:F,panelBackground:T,onPanelBackgroundChange:O,radius:w,onRadiusChange:D,scaling:x,onScalingChange:j}=G,E=h!==void 0,K=useCallbackRef(h),k=React.useCallback(t=>{const o=a9();if(d!=="inherit"){B(t);return}E?K(t):(H$1(t),l9(t)),o();},[d,B,E,K]),P=a$e(g),S=f==="auto"?P:f,[W,M]=React.useState("idle");async function U(){const t={appearance:d===s$6.appearance.default?void 0:d,accentColor:g===s$6.accentColor.default?void 0:g,grayColor:f===s$6.grayColor.default?void 0:f,panelBackground:T===s$6.panelBackground.default?void 0:T,radius:w===s$6.radius.default?void 0:w,scaling:x===s$6.scaling.default?void 0:x},o=Object.keys(t).filter(i=>t[i]!==void 0).map(i=>`${i}="${t[i]}"`).join(" "),m=o?`<Theme ${o}>`:"<Theme>";M("copying"),await navigator.clipboard.writeText(m),M("copied"),setTimeout(()=>M("idle"),2e3);}const[Z,H$1]=React.useState(d==="inherit"?null:d),b=`
|
|
1490
|
-
[contenteditable],
|
|
1491
|
-
[role="combobox"],
|
|
1492
|
-
[role="listbox"],
|
|
1493
|
-
[role="menu"],
|
|
1494
|
-
input:not([type="radio"], [type="checkbox"]),
|
|
1495
|
-
select,
|
|
1496
|
-
textarea
|
|
1497
|
-
`;return React.useEffect(()=>{function t(o){const m=o.altKey||o.ctrlKey||o.shiftKey||o.metaKey,i=document.activeElement?.closest(b);o.key?.toUpperCase()==="T"&&!m&&!i&&c(!l);}return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[c,l,b]),React.useEffect(()=>{function t(o){const m=o.altKey||o.ctrlKey||o.shiftKey||o.metaKey,i=document.activeElement?.closest(b);o.key?.toUpperCase()==="D"&&!m&&!i&&k(Z==="light"?"dark":"light");}return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[k,Z,b]),React.useEffect(()=>{const t=document.documentElement,o=document.body;function m(){const y=t.classList.contains("dark")||t.classList.contains("dark-theme")||o.classList.contains("dark")||o.classList.contains("dark-theme");H$1(d==="inherit"?y?"dark":"light":d);}const i=new MutationObserver(function(y){y.forEach(function(X){X.attributeName==="class"&&m();});});return m(),d==="inherit"&&(i.observe(t,{attributes:true}),i.observe(o,{attributes:true})),()=>i.disconnect()},[d]),React.createElement(R$1,{asChild:true,radius:"medium",scaling:"100%"},React.createElement(p$b,{direction:"column",position:"fixed",top:"0",right:"0",mr:"4",mt:"4",inert:l?void 0:r$5,...v,ref:a,style:{zIndex:9999,overflow:"hidden",maxHeight:"calc(100vh - var(--space-4) - var(--space-4))",borderRadius:"var(--radius-4)",backgroundColor:"var(--color-panel-solid)",transformOrigin:"top center",transitionProperty:"transform, box-shadow",transitionDuration:"200ms",transitionTimingFunction:l?"ease-out":"ease-in",transform:l?"none":"translateX(105%)",boxShadow:l?"var(--shadow-5)":"var(--shadow-2)",...n.style}},React.createElement(c$2,null,React.createElement(p$e,{flexGrow:"1",p:"5",position:"relative"},React.createElement(p$e,{position:"absolute",top:"0",right:"0",m:"2"},React.createElement(e,{content:"Press T to show/hide the Theme Panel",side:"bottom",sideOffset:6},React.createElement(r$9,{asChild:true,size:"3",tabIndex:0,className:"rt-ThemePanelShortcut"},React.createElement("button",{onClick:()=>c(!l)},"T")))),React.createElement(r$j,{size:"5",trim:"both",as:"h3",mb:"5"},"Theme"),React.createElement(p$i,{id:"accent-color-title",as:"p",size:"2",weight:"medium",mt:"5"},"Accent color"),React.createElement(o$5,{columns:"10",gap:"2",mt:"3",role:"group","aria-labelledby":"accent-color-title"},s$6.accentColor.values.map(t=>React.createElement("label",{key:t,className:"rt-ThemePanelSwatch",style:{backgroundColor:`var(--${t}-9)`}},React.createElement(e,{content:`${C(t)}${g==="gray"&&S!=="gray"?` (${C(S)})`:""}`},React.createElement("input",{className:"rt-ThemePanelSwatchInput",type:"radio",name:"accentColor",value:t,checked:g===t,onChange:o=>$(o.target.value)}))))),React.createElement(p$b,{asChild:true,align:"center",justify:"between"},React.createElement(p$i,{as:"p",id:"gray-color-title",size:"2",weight:"medium",mt:"5"},"Gray color")),React.createElement(o$5,{columns:"10",gap:"2",mt:"3",role:"group","aria-labelledby":"gray-color-title"},s$6.grayColor.values.map(t=>React.createElement(p$b,{key:t,asChild:true,align:"center",justify:"center"},React.createElement("label",{className:"rt-ThemePanelSwatch",style:{backgroundColor:t==="auto"?`var(--${P}-9)`:t==="gray"?"var(--gray-9)":`var(--${t}-9)`,filter:t==="gray"?"saturate(0)":void 0}},React.createElement(e,{content:`${C(t)}${t==="auto"?` (${C(P)})`:""}`},React.createElement("input",{className:"rt-ThemePanelSwatchInput",type:"radio",name:"grayColor",value:t,checked:f===t,onChange:o=>F(o.target.value)})))))),React.createElement(p$i,{id:"appearance-title",as:"p",size:"2",weight:"medium",mt:"5"},"Appearance"),React.createElement(o$5,{columns:"2",gap:"2",mt:"3",role:"group","aria-labelledby":"appearance-title"},["light","dark"].map(t=>React.createElement("label",{key:t,className:"rt-ThemePanelRadioCard"},React.createElement("input",{className:"rt-ThemePanelRadioCardInput",type:"radio",name:"appearance",value:t,checked:Z===t,onChange:o=>k(o.target.value)}),React.createElement(p$b,{align:"center",justify:"center",height:"32px",gap:"2"},t==="light"?React.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{margin:"0 -1px"}},React.createElement("path",{d:"M7.5 0C7.77614 0 8 0.223858 8 0.5V2.5C8 2.77614 7.77614 3 7.5 3C7.22386 3 7 2.77614 7 2.5V0.5C7 0.223858 7.22386 0 7.5 0ZM2.1967 2.1967C2.39196 2.00144 2.70854 2.00144 2.90381 2.1967L4.31802 3.61091C4.51328 3.80617 4.51328 4.12276 4.31802 4.31802C4.12276 4.51328 3.80617 4.51328 3.61091 4.31802L2.1967 2.90381C2.00144 2.70854 2.00144 2.39196 2.1967 2.1967ZM0.5 7C0.223858 7 0 7.22386 0 7.5C0 7.77614 0.223858 8 0.5 8H2.5C2.77614 8 3 7.77614 3 7.5C3 7.22386 2.77614 7 2.5 7H0.5ZM2.1967 12.8033C2.00144 12.608 2.00144 12.2915 2.1967 12.0962L3.61091 10.682C3.80617 10.4867 4.12276 10.4867 4.31802 10.682C4.51328 10.8772 4.51328 11.1938 4.31802 11.3891L2.90381 12.8033C2.70854 12.9986 2.39196 12.9986 2.1967 12.8033ZM12.5 7C12.2239 7 12 7.22386 12 7.5C12 7.77614 12.2239 8 12.5 8H14.5C14.7761 8 15 7.77614 15 7.5C15 7.22386 14.7761 7 14.5 7H12.5ZM10.682 4.31802C10.4867 4.12276 10.4867 3.80617 10.682 3.61091L12.0962 2.1967C12.2915 2.00144 12.608 2.00144 12.8033 2.1967C12.9986 2.39196 12.9986 2.70854 12.8033 2.90381L11.3891 4.31802C11.1938 4.51328 10.8772 4.51328 10.682 4.31802ZM8 12.5C8 12.2239 7.77614 12 7.5 12C7.22386 12 7 12.2239 7 12.5V14.5C7 14.7761 7.22386 15 7.5 15C7.77614 15 8 14.7761 8 14.5V12.5ZM10.682 10.682C10.8772 10.4867 11.1938 10.4867 11.3891 10.682L12.8033 12.0962C12.9986 12.2915 12.9986 12.608 12.8033 12.8033C12.608 12.9986 12.2915 12.9986 12.0962 12.8033L10.682 11.3891C10.4867 11.1938 10.4867 10.8772 10.682 10.682ZM5.5 7.5C5.5 6.39543 6.39543 5.5 7.5 5.5C8.60457 5.5 9.5 6.39543 9.5 7.5C9.5 8.60457 8.60457 9.5 7.5 9.5C6.39543 9.5 5.5 8.60457 5.5 7.5ZM7.5 4.5C5.84315 4.5 4.5 5.84315 4.5 7.5C4.5 9.15685 5.84315 10.5 7.5 10.5C9.15685 10.5 10.5 9.15685 10.5 7.5C10.5 5.84315 9.15685 4.5 7.5 4.5Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})):React.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{margin:"0 -1px"}},React.createElement("path",{d:"M2.89998 0.499976C2.89998 0.279062 2.72089 0.0999756 2.49998 0.0999756C2.27906 0.0999756 2.09998 0.279062 2.09998 0.499976V1.09998H1.49998C1.27906 1.09998 1.09998 1.27906 1.09998 1.49998C1.09998 1.72089 1.27906 1.89998 1.49998 1.89998H2.09998V2.49998C2.09998 2.72089 2.27906 2.89998 2.49998 2.89998C2.72089 2.89998 2.89998 2.72089 2.89998 2.49998V1.89998H3.49998C3.72089 1.89998 3.89998 1.72089 3.89998 1.49998C3.89998 1.27906 3.72089 1.09998 3.49998 1.09998H2.89998V0.499976ZM5.89998 3.49998C5.89998 3.27906 5.72089 3.09998 5.49998 3.09998C5.27906 3.09998 5.09998 3.27906 5.09998 3.49998V4.09998H4.49998C4.27906 4.09998 4.09998 4.27906 4.09998 4.49998C4.09998 4.72089 4.27906 4.89998 4.49998 4.89998H5.09998V5.49998C5.09998 5.72089 5.27906 5.89998 5.49998 5.89998C5.72089 5.89998 5.89998 5.72089 5.89998 5.49998V4.89998H6.49998C6.72089 4.89998 6.89998 4.72089 6.89998 4.49998C6.89998 4.27906 6.72089 4.09998 6.49998 4.09998H5.89998V3.49998ZM1.89998 6.49998C1.89998 6.27906 1.72089 6.09998 1.49998 6.09998C1.27906 6.09998 1.09998 6.27906 1.09998 6.49998V7.09998H0.499976C0.279062 7.09998 0.0999756 7.27906 0.0999756 7.49998C0.0999756 7.72089 0.279062 7.89998 0.499976 7.89998H1.09998V8.49998C1.09998 8.72089 1.27906 8.89997 1.49998 8.89997C1.72089 8.89997 1.89998 8.72089 1.89998 8.49998V7.89998H2.49998C2.72089 7.89998 2.89998 7.72089 2.89998 7.49998C2.89998 7.27906 2.72089 7.09998 2.49998 7.09998H1.89998V6.49998ZM8.54406 0.98184L8.24618 0.941586C8.03275 0.917676 7.90692 1.1655 8.02936 1.34194C8.17013 1.54479 8.29981 1.75592 8.41754 1.97445C8.91878 2.90485 9.20322 3.96932 9.20322 5.10022C9.20322 8.37201 6.82247 11.0878 3.69887 11.6097C3.45736 11.65 3.20988 11.6772 2.96008 11.6906C2.74563 11.702 2.62729 11.9535 2.77721 12.1072C2.84551 12.1773 2.91535 12.2458 2.98667 12.3128L3.05883 12.3795L3.31883 12.6045L3.50684 12.7532L3.62796 12.8433L3.81491 12.9742L3.99079 13.089C4.11175 13.1651 4.23536 13.2375 4.36157 13.3059L4.62496 13.4412L4.88553 13.5607L5.18837 13.6828L5.43169 13.7686C5.56564 13.8128 5.70149 13.8529 5.83857 13.8885C5.94262 13.9155 6.04767 13.9401 6.15405 13.9622C6.27993 13.9883 6.40713 14.0109 6.53544 14.0298L6.85241 14.0685L7.11934 14.0892C7.24637 14.0965 7.37436 14.1002 7.50322 14.1002C11.1483 14.1002 14.1032 11.1453 14.1032 7.50023C14.1032 7.25044 14.0893 7.00389 14.0623 6.76131L14.0255 6.48407C13.991 6.26083 13.9453 6.04129 13.8891 5.82642C13.8213 5.56709 13.7382 5.31398 13.6409 5.06881L13.5279 4.80132L13.4507 4.63542L13.3766 4.48666C13.2178 4.17773 13.0353 3.88295 12.8312 3.60423L12.6782 3.40352L12.4793 3.16432L12.3157 2.98361L12.1961 2.85951L12.0355 2.70246L11.8134 2.50184L11.4925 2.24191L11.2483 2.06498L10.9562 1.87446L10.6346 1.68894L10.3073 1.52378L10.1938 1.47176L9.95488 1.3706L9.67791 1.2669L9.42566 1.1846L9.10075 1.09489L8.83599 1.03486L8.54406 0.98184ZM10.4032 5.30023C10.4032 4.27588 10.2002 3.29829 9.83244 2.40604C11.7623 3.28995 13.1032 5.23862 13.1032 7.50023C13.1032 10.593 10.596 13.1002 7.50322 13.1002C6.63646 13.1002 5.81597 12.9036 5.08355 12.5522C6.5419 12.0941 7.81081 11.2082 8.74322 10.0416C8.87963 10.2284 9.10028 10.3497 9.34928 10.3497C9.76349 10.3497 10.0993 10.0139 10.0993 9.59971C10.0993 9.24256 9.84965 8.94373 9.51535 8.86816C9.57741 8.75165 9.63653 8.63334 9.6926 8.51332C9.88358 8.63163 10.1088 8.69993 10.35 8.69993C11.0403 8.69993 11.6 8.14028 11.6 7.44993C11.6 6.75976 11.0406 6.20024 10.3505 6.19993C10.3853 5.90487 10.4032 5.60464 10.4032 5.30023Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})),React.createElement(p$i,{size:"1",weight:"medium"},C(t)))))),React.createElement(p$i,{id:"radius-title",as:"p",size:"2",weight:"medium",mt:"5"},"Radius"),React.createElement(o$5,{columns:"5",gap:"2",mt:"3",role:"group","aria-labelledby":"radius-title"},s$6.radius.values.map(t=>React.createElement(p$b,{key:t,direction:"column",align:"center"},React.createElement("label",{className:"rt-ThemePanelRadioCard"},React.createElement("input",{className:"rt-ThemePanelRadioCardInput",type:"radio",name:"radius",id:`theme-panel-radius-${t}`,value:t,checked:w===t,onChange:o=>D(o.target.value)}),React.createElement(R$1,{asChild:true,radius:t},React.createElement(p$e,{m:"3",width:"32px",height:"32px",style:{borderTopLeftRadius:t==="full"?"80%":"var(--radius-5)",backgroundImage:"linear-gradient(to bottom right, var(--accent-3), var(--accent-4))",borderTop:"2px solid var(--accent-a8)",borderLeft:"2px solid var(--accent-a8)"}}))),React.createElement(p$e,{asChild:true,pt:"2"},React.createElement(p$i,{asChild:true,size:"1",color:"gray"},React.createElement("label",{htmlFor:`theme-panel-radius-${t}`},C(t))))))),React.createElement(p$i,{id:"scaling-title",as:"p",size:"2",weight:"medium",mt:"5"},"Scaling"),React.createElement(o$5,{columns:"5",gap:"2",mt:"3",role:"group","aria-labelledby":"scaling-title"},s$6.scaling.values.map(t=>React.createElement("label",{key:t,className:"rt-ThemePanelRadioCard"},React.createElement("input",{className:"rt-ThemePanelRadioCardInput",type:"radio",name:"scaling",value:t,checked:x===t,onChange:o=>j(o.target.value)}),React.createElement(p$b,{align:"center",justify:"center",height:"32px"},React.createElement(R$1,{asChild:true,scaling:t},React.createElement(p$b,{align:"center",justify:"center"},React.createElement(p$i,{size:"1",weight:"medium"},C(t)))))))),React.createElement(p$b,{mt:"5",align:"center",gap:"2"},React.createElement(p$i,{id:"panel-background-title",as:"p",size:"2",weight:"medium"},"Panel background"),React.createElement(P$1,null,React.createElement(s,null,React.createElement(o$4,{size:"1",variant:"ghost",color:"gray"},React.createElement(s$8,{label:"Learn more about panel background options"},React.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z",fillRule:"evenodd",clipRule:"evenodd"}))))),React.createElement(i$2,{size:"1",style:{maxWidth:220},side:"top",align:"center"},React.createElement(p$i,{as:"p",size:"2"},"Whether Card and Table panels are translucent, showing some of\xA0the background behind them.")))),React.createElement(o$5,{columns:"2",gap:"2",mt:"3",role:"group","aria-labelledby":"panel-background-title"},s$6.panelBackground.values.map(t=>React.createElement("label",{key:t,className:"rt-ThemePanelRadioCard"},React.createElement("input",{className:"rt-ThemePanelRadioCardInput",type:"radio",name:"panelBackground",value:t,checked:T===t,onChange:o=>O(o.target.value)}),React.createElement(p$b,{align:"center",justify:"center",height:"32px",gap:"2"},t==="solid"?React.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{margin:"0 -2px"}},React.createElement("path",{d:"M0.877075 7.49988C0.877075 3.84219 3.84222 0.877045 7.49991 0.877045C11.1576 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1576 14.1227 7.49991 14.1227C3.84222 14.1227 0.877075 11.1575 0.877075 7.49988ZM7.49991 1.82704C4.36689 1.82704 1.82708 4.36686 1.82708 7.49988C1.82708 10.6329 4.36689 13.1727 7.49991 13.1727C10.6329 13.1727 13.1727 10.6329 13.1727 7.49988C13.1727 4.36686 10.6329 1.82704 7.49991 1.82704Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})):React.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{margin:"0 -2px"}},React.createElement("path",{opacity:".05",d:"M6.78296 13.376C8.73904 9.95284 8.73904 5.04719 6.78296 1.62405L7.21708 1.37598C9.261 4.95283 9.261 10.0472 7.21708 13.624L6.78296 13.376Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),React.createElement("path",{opacity:".1",d:"M7.28204 13.4775C9.23929 9.99523 9.23929 5.00475 7.28204 1.52248L7.71791 1.2775C9.76067 4.9119 9.76067 10.0881 7.71791 13.7225L7.28204 13.4775Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),React.createElement("path",{opacity:".15",d:"M7.82098 13.5064C9.72502 9.99523 9.72636 5.01411 7.82492 1.50084L8.26465 1.26285C10.2465 4.92466 10.2451 10.085 8.26052 13.7448L7.82098 13.5064Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),React.createElement("path",{opacity:".2",d:"M8.41284 13.429C10.1952 9.92842 10.1957 5.07537 8.41435 1.57402L8.85999 1.34729C10.7139 4.99113 10.7133 10.0128 8.85841 13.6559L8.41284 13.429Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),React.createElement("path",{opacity:".25",d:"M9.02441 13.2956C10.6567 9.8379 10.6586 5.17715 9.03005 1.71656L9.48245 1.50366C11.1745 5.09919 11.1726 9.91629 9.47657 13.5091L9.02441 13.2956Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),React.createElement("path",{opacity:".3",d:"M9.66809 13.0655C11.1097 9.69572 11.1107 5.3121 9.67088 1.94095L10.1307 1.74457C11.6241 5.24121 11.6231 9.76683 10.1278 13.2622L9.66809 13.0655Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),React.createElement("path",{opacity:".35",d:"M10.331 12.7456C11.5551 9.52073 11.5564 5.49103 10.3347 2.26444L10.8024 2.0874C12.0672 5.42815 12.0659 9.58394 10.7985 12.9231L10.331 12.7456Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),React.createElement("path",{opacity:".4",d:"M11.0155 12.2986C11.9938 9.29744 11.9948 5.71296 11.0184 2.71067L11.4939 2.55603C12.503 5.6589 12.502 9.35178 11.4909 12.4535L11.0155 12.2986Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),React.createElement("path",{opacity:".45",d:"M11.7214 11.668C12.4254 9.01303 12.4262 5.99691 11.7237 3.34116L12.2071 3.21329C12.9318 5.95292 12.931 9.05728 12.2047 11.7961L11.7214 11.668Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),React.createElement("path",{opacity:".5",d:"M12.4432 10.752C12.8524 8.63762 12.8523 6.36089 12.4429 4.2466L12.9338 4.15155C13.3553 6.32861 13.3554 8.66985 12.9341 10.847L12.4432 10.752Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),React.createElement("path",{d:"M0.877075 7.49988C0.877075 3.84219 3.84222 0.877045 7.49991 0.877045C11.1576 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1576 14.1227 7.49991 14.1227C3.84222 14.1227 0.877075 11.1575 0.877075 7.49988ZM7.49991 1.82704C4.36689 1.82704 1.82708 4.36686 1.82708 7.49988C1.82708 10.6329 4.36689 13.1727 7.49991 13.1727C10.6329 13.1727 13.1727 10.6329 13.1727 7.49988C13.1727 4.36686 10.6329 1.82704 7.49991 1.82704Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})),React.createElement(p$i,{size:"1",weight:"medium"},C(t)))))),React.createElement(o$7,{mt:"5",style:{width:"100%"},onClick:U},W==="copied"?"Copied":"Copy Theme")))))});z.displayName="ThemePanelImpl";function a9(){const n=document.createElement("style");return n.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(n),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(n);},1);}}function C(n){return n.charAt(0).toUpperCase()+n.slice(1)}function l9(n){const a=document.documentElement,l=a.classList.contains("light-theme"),c=a.classList.contains("dark-theme"),h=a.classList.contains("light"),v=a.classList.contains("dark");(l||c)&&(a.classList.remove("light-theme","dark-theme"),a.style.colorScheme=n,a.classList.add(`${n}-theme`)),(h||v)&&(a.classList.remove("light","dark"),a.style.colorScheme=n,a.classList.add(n)),!l&&!c&&!h&&!v&&(a.style.colorScheme=n,a.classList.add(n));}
|
|
1498
|
-
|
|
1499
|
-
const e$1={content:{type:"ReactNode",required:true},width:t$d.width,minWidth:t$d.minWidth,maxWidth:{...t$d.maxWidth,default:"360px"}};
|
|
1500
|
-
|
|
1501
|
-
const e=React.forwardRef((i,p)=>{const{children:r,className:n,open:s,defaultOpen:l,onOpenChange:m,delayDuration:a,disableHoverableContent:f,content:P,container:T,forceMount:c,...d}=v$1(i,e$1),C={open:s,defaultOpen:l,onOpenChange:m,delayDuration:a,disableHoverableContent:f};return React.createElement(t$h.Root,{...C},React.createElement(t$h.Trigger,{asChild:true},r),React.createElement(t$h.Portal,{container:T,forceMount:c},React.createElement(R$1,{asChild:true},React.createElement(t$h.Content,{sideOffset:4,collisionPadding:10,...d,asChild:false,ref:p,className:y("rt-TooltipContent",n)},React.createElement(p$i,{as:"p",className:"rt-TooltipText",size:"1"},P),React.createElement(t$h.Arrow,{className:"rt-TooltipArrow"})))))});e.displayName="Tooltip";
|
|
1502
7
|
|
|
1503
|
-
export {
|
|
8
|
+
export { config, configure };
|
|
1504
9
|
//# sourceMappingURL=index.esm.js.map
|