@taskon/widget-react 0.0.1 → 0.0.2

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.
Files changed (66) hide show
  1. package/README.md +118 -64
  2. package/dist/CommunityTaskList.css +2694 -2951
  3. package/dist/EligibilityInfo.css +2221 -1332
  4. package/dist/LeaderboardWidget.css +403 -198
  5. package/dist/PageBuilder.css +57 -0
  6. package/dist/Quest.css +1347 -1477
  7. package/dist/TaskOnProvider.css +337 -29
  8. package/dist/ThemeProvider.css +228 -0
  9. package/dist/UserCenterWidget.css +168 -0
  10. package/dist/UserCenterWidget2.css +4917 -0
  11. package/dist/WidgetShell.css +417 -130
  12. package/dist/chunks/{CommunityTaskList-CrH6r4Av.js → CommunityTaskList-2nFy6l6m.js} +2612 -2074
  13. package/dist/chunks/{EligibilityInfo-DesW9-k9.js → EligibilityInfo-CKTl_cdU.js} +2714 -4077
  14. package/dist/chunks/{LeaderboardWidget-BSGpHKTk.js → LeaderboardWidget-DyoiiNS6.js} +288 -349
  15. package/dist/chunks/PageBuilder-DHM3Il6f.js +150 -0
  16. package/dist/chunks/{Quest-uSIVq78I.js → Quest-Dqx4OCat.js} +1380 -726
  17. package/dist/chunks/TaskOnProvider-CxtFIs3n.js +2072 -0
  18. package/dist/chunks/{WidgetShell-NlOgn1x5.js → ThemeProvider-CulHkqqY.js} +1397 -103
  19. package/dist/chunks/UserCenterWidget-SE5hqpnZ.js +8335 -0
  20. package/dist/chunks/UserCenterWidget-XL6LZRZM.js +3259 -0
  21. package/dist/chunks/{Table-CWGf2FKV.js → WidgetShell-8xn-Jivw.js} +237 -27
  22. package/dist/chunks/communitytask-es-CBNnS4o2.js +521 -0
  23. package/dist/chunks/communitytask-ja-GRf9cbdx.js +521 -0
  24. package/dist/chunks/communitytask-ko-Bf24PQKI.js +521 -0
  25. package/dist/chunks/communitytask-ru-CZm2CPoV.js +521 -0
  26. package/dist/chunks/leaderboardwidget-es-vKjrjQaz.js +146 -0
  27. package/dist/chunks/leaderboardwidget-ja-Q6u0HxKG.js +146 -0
  28. package/dist/chunks/leaderboardwidget-ko-CG6SWgxf.js +146 -0
  29. package/dist/chunks/leaderboardwidget-ru-DCcHcJGz.js +146 -0
  30. package/dist/chunks/quest-es-Dyyy0zaw.js +863 -0
  31. package/dist/chunks/quest-ja-Depog33y.js +863 -0
  32. package/dist/chunks/quest-ko-BMu3uRQJ.js +863 -0
  33. package/dist/chunks/quest-ru-xne814Rw.js +863 -0
  34. package/dist/chunks/taskwidget-es-Do9b3Mqw.js +245 -0
  35. package/dist/chunks/taskwidget-ja-CqSu-yWA.js +245 -0
  36. package/dist/chunks/taskwidget-ko-EHgXFV4B.js +245 -0
  37. package/dist/chunks/taskwidget-ru-CMbLQDK4.js +245 -0
  38. package/dist/chunks/useIsMobile-D6Ybur-6.js +30 -0
  39. package/dist/chunks/usercenter-es-Dz3Wp2vV.js +512 -0
  40. package/dist/chunks/usercenter-ja-CKE4DJC6.js +512 -0
  41. package/dist/chunks/usercenter-ko-Dtpkn2qb.js +512 -0
  42. package/dist/chunks/usercenter-ru-DnBGee45.js +512 -0
  43. package/dist/community-task.d.ts +29 -388
  44. package/dist/community-task.js +2 -7
  45. package/dist/core.d.ts +95 -28
  46. package/dist/core.js +11 -12
  47. package/dist/index.d.ts +260 -602
  48. package/dist/index.js +28 -7361
  49. package/dist/leaderboard.d.ts +5 -496
  50. package/dist/leaderboard.js +2 -15
  51. package/dist/page-builder.d.ts +20 -0
  52. package/dist/page-builder.js +4 -0
  53. package/dist/quest.d.ts +20 -292
  54. package/dist/quest.js +2 -5
  55. package/dist/user-center.d.ts +56 -0
  56. package/dist/user-center.js +4 -0
  57. package/package.json +22 -3
  58. package/dist/Table.css +0 -389
  59. package/dist/chunks/TaskOnProvider-QMwxGL44.js +0 -1435
  60. package/dist/chunks/ThemeProvider-Cs8IUVQj.js +0 -1118
  61. package/dist/chunks/leaderboardwidget-ja-Bj6gz6y1.js +0 -119
  62. package/dist/chunks/leaderboardwidget-ko-f1cLO9ic.js +0 -119
  63. package/dist/chunks/useWidgetLocale-BVcopbZS.js +0 -74
  64. package/dist/chunks/usercenter-ja-DBj_dtuz.js +0 -329
  65. package/dist/chunks/usercenter-ko-DYTkHAld.js +0 -329
  66. package/dist/index.css +0 -3662
@@ -1,1118 +0,0 @@
1
- import * as React from "react";
2
- import { createContext, useContext, useMemo, useState, useEffect } from "react";
3
- import { jsx } from "react/jsx-runtime";
4
- import * as ReactDOM from "react-dom";
5
- import ReactDOM__default from "react-dom";
6
- const ThemeContext = createContext(null);
7
- function useTaskOnTheme() {
8
- const theme = useContext(ThemeContext);
9
- if (!theme) {
10
- throw new Error("useTaskOnTheme must be used within a ThemeProvider");
11
- }
12
- return theme;
13
- }
14
- const TaskOnContext = createContext(null);
15
- function useTaskOnContext() {
16
- const context = useContext(TaskOnContext);
17
- if (!context) {
18
- throw new Error("useTaskOnContext must be used within a TaskOnProvider");
19
- }
20
- return context;
21
- }
22
- function useTaskOnAuth() {
23
- const context = useTaskOnContext();
24
- return useMemo(
25
- () => ({
26
- // User state
27
- userId: context.userId,
28
- isLoggedIn: context.isLoggedIn,
29
- isInitializing: context.isInitializing,
30
- // Unified login
31
- login: context.login,
32
- // Logout
33
- logout: context.logout,
34
- // Request login (triggers config.onRequestLogin)
35
- requestLogin: context.requestLogin
36
- }),
37
- [
38
- context.userId,
39
- context.isLoggedIn,
40
- context.isInitializing,
41
- context.login,
42
- context.logout,
43
- context.requestLogin
44
- ]
45
- );
46
- }
47
- function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
48
- return function handleEvent(event) {
49
- originalEventHandler == null ? void 0 : originalEventHandler(event);
50
- if (checkForDefaultPrevented === false || !event.defaultPrevented) {
51
- return ourEventHandler == null ? void 0 : ourEventHandler(event);
52
- }
53
- };
54
- }
55
- function setRef(ref, value) {
56
- if (typeof ref === "function") {
57
- return ref(value);
58
- } else if (ref !== null && ref !== void 0) {
59
- ref.current = value;
60
- }
61
- }
62
- function composeRefs(...refs) {
63
- return (node) => {
64
- let hasCleanup = false;
65
- const cleanups = refs.map((ref) => {
66
- const cleanup = setRef(ref, node);
67
- if (!hasCleanup && typeof cleanup == "function") {
68
- hasCleanup = true;
69
- }
70
- return cleanup;
71
- });
72
- if (hasCleanup) {
73
- return () => {
74
- for (let i = 0; i < cleanups.length; i++) {
75
- const cleanup = cleanups[i];
76
- if (typeof cleanup == "function") {
77
- cleanup();
78
- } else {
79
- setRef(refs[i], null);
80
- }
81
- }
82
- };
83
- }
84
- };
85
- }
86
- function useComposedRefs(...refs) {
87
- return React.useCallback(composeRefs(...refs), refs);
88
- }
89
- function createContext2(rootComponentName, defaultContext) {
90
- const Context = React.createContext(defaultContext);
91
- const Provider = (props) => {
92
- const { children, ...context } = props;
93
- const value = React.useMemo(() => context, Object.values(context));
94
- return /* @__PURE__ */ jsx(Context.Provider, { value, children });
95
- };
96
- Provider.displayName = rootComponentName + "Provider";
97
- function useContext2(consumerName) {
98
- const context = React.useContext(Context);
99
- if (context) return context;
100
- if (defaultContext !== void 0) return defaultContext;
101
- throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
102
- }
103
- return [Provider, useContext2];
104
- }
105
- function createContextScope(scopeName, createContextScopeDeps = []) {
106
- let defaultContexts = [];
107
- function createContext3(rootComponentName, defaultContext) {
108
- const BaseContext = React.createContext(defaultContext);
109
- const index = defaultContexts.length;
110
- defaultContexts = [...defaultContexts, defaultContext];
111
- const Provider = (props) => {
112
- var _a;
113
- const { scope, children, ...context } = props;
114
- const Context = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index]) || BaseContext;
115
- const value = React.useMemo(() => context, Object.values(context));
116
- return /* @__PURE__ */ jsx(Context.Provider, { value, children });
117
- };
118
- Provider.displayName = rootComponentName + "Provider";
119
- function useContext2(consumerName, scope) {
120
- var _a;
121
- const Context = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index]) || BaseContext;
122
- const context = React.useContext(Context);
123
- if (context) return context;
124
- if (defaultContext !== void 0) return defaultContext;
125
- throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
126
- }
127
- return [Provider, useContext2];
128
- }
129
- const createScope = () => {
130
- const scopeContexts = defaultContexts.map((defaultContext) => {
131
- return React.createContext(defaultContext);
132
- });
133
- return function useScope(scope) {
134
- const contexts = (scope == null ? void 0 : scope[scopeName]) || scopeContexts;
135
- return React.useMemo(
136
- () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
137
- [scope, contexts]
138
- );
139
- };
140
- };
141
- createScope.scopeName = scopeName;
142
- return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
143
- }
144
- function composeContextScopes(...scopes) {
145
- const baseScope = scopes[0];
146
- if (scopes.length === 1) return baseScope;
147
- const createScope = () => {
148
- const scopeHooks = scopes.map((createScope2) => ({
149
- useScope: createScope2(),
150
- scopeName: createScope2.scopeName
151
- }));
152
- return function useComposedScopes(overrideScopes) {
153
- const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
154
- const scopeProps = useScope(overrideScopes);
155
- const currentScope = scopeProps[`__scope${scopeName}`];
156
- return { ...nextScopes2, ...currentScope };
157
- }, {});
158
- return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
159
- };
160
- };
161
- createScope.scopeName = baseScope.scopeName;
162
- return createScope;
163
- }
164
- // @__NO_SIDE_EFFECTS__
165
- function createSlot(ownerName) {
166
- const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
167
- const Slot2 = React.forwardRef((props, forwardedRef) => {
168
- const { children, ...slotProps } = props;
169
- const childrenArray = React.Children.toArray(children);
170
- const slottable = childrenArray.find(isSlottable);
171
- if (slottable) {
172
- const newElement = slottable.props.children;
173
- const newChildren = childrenArray.map((child) => {
174
- if (child === slottable) {
175
- if (React.Children.count(newElement) > 1) return React.Children.only(null);
176
- return React.isValidElement(newElement) ? newElement.props.children : null;
177
- } else {
178
- return child;
179
- }
180
- });
181
- return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
182
- }
183
- return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
184
- });
185
- Slot2.displayName = `${ownerName}.Slot`;
186
- return Slot2;
187
- }
188
- // @__NO_SIDE_EFFECTS__
189
- function createSlotClone(ownerName) {
190
- const SlotClone = React.forwardRef((props, forwardedRef) => {
191
- const { children, ...slotProps } = props;
192
- if (React.isValidElement(children)) {
193
- const childrenRef = getElementRef$1(children);
194
- const props2 = mergeProps(slotProps, children.props);
195
- if (children.type !== React.Fragment) {
196
- props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
197
- }
198
- return React.cloneElement(children, props2);
199
- }
200
- return React.Children.count(children) > 1 ? React.Children.only(null) : null;
201
- });
202
- SlotClone.displayName = `${ownerName}.SlotClone`;
203
- return SlotClone;
204
- }
205
- var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
206
- function isSlottable(child) {
207
- return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
208
- }
209
- function mergeProps(slotProps, childProps) {
210
- const overrideProps = { ...childProps };
211
- for (const propName in childProps) {
212
- const slotPropValue = slotProps[propName];
213
- const childPropValue = childProps[propName];
214
- const isHandler = /^on[A-Z]/.test(propName);
215
- if (isHandler) {
216
- if (slotPropValue && childPropValue) {
217
- overrideProps[propName] = (...args) => {
218
- const result = childPropValue(...args);
219
- slotPropValue(...args);
220
- return result;
221
- };
222
- } else if (slotPropValue) {
223
- overrideProps[propName] = slotPropValue;
224
- }
225
- } else if (propName === "style") {
226
- overrideProps[propName] = { ...slotPropValue, ...childPropValue };
227
- } else if (propName === "className") {
228
- overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
229
- }
230
- }
231
- return { ...slotProps, ...overrideProps };
232
- }
233
- function getElementRef$1(element) {
234
- var _a, _b;
235
- let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
236
- let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
237
- if (mayWarn) {
238
- return element.ref;
239
- }
240
- getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
241
- mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
242
- if (mayWarn) {
243
- return element.props.ref;
244
- }
245
- return element.props.ref || element.ref;
246
- }
247
- var NODES = [
248
- "a",
249
- "button",
250
- "div",
251
- "form",
252
- "h2",
253
- "h3",
254
- "img",
255
- "input",
256
- "label",
257
- "li",
258
- "nav",
259
- "ol",
260
- "p",
261
- "select",
262
- "span",
263
- "svg",
264
- "ul"
265
- ];
266
- var Primitive = NODES.reduce((primitive, node) => {
267
- const Slot = /* @__PURE__ */ createSlot(`Primitive.${node}`);
268
- const Node = React.forwardRef((props, forwardedRef) => {
269
- const { asChild, ...primitiveProps } = props;
270
- const Comp = asChild ? Slot : node;
271
- if (typeof window !== "undefined") {
272
- window[Symbol.for("radix-ui")] = true;
273
- }
274
- return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
275
- });
276
- Node.displayName = `Primitive.${node}`;
277
- return { ...primitive, [node]: Node };
278
- }, {});
279
- function dispatchDiscreteCustomEvent(target, event) {
280
- if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
281
- }
282
- function useCallbackRef(callback) {
283
- const callbackRef = React.useRef(callback);
284
- React.useEffect(() => {
285
- callbackRef.current = callback;
286
- });
287
- return React.useMemo(() => (...args) => {
288
- var _a;
289
- return (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef, ...args);
290
- }, []);
291
- }
292
- function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
293
- const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
294
- React.useEffect(() => {
295
- const handleKeyDown = (event) => {
296
- if (event.key === "Escape") {
297
- onEscapeKeyDown(event);
298
- }
299
- };
300
- ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true });
301
- return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true });
302
- }, [onEscapeKeyDown, ownerDocument]);
303
- }
304
- var DISMISSABLE_LAYER_NAME = "DismissableLayer";
305
- var CONTEXT_UPDATE = "dismissableLayer.update";
306
- var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
307
- var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
308
- var originalBodyPointerEvents;
309
- var DismissableLayerContext = React.createContext({
310
- layers: /* @__PURE__ */ new Set(),
311
- layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
312
- branches: /* @__PURE__ */ new Set()
313
- });
314
- var DismissableLayer = React.forwardRef(
315
- (props, forwardedRef) => {
316
- const {
317
- disableOutsidePointerEvents = false,
318
- onEscapeKeyDown,
319
- onPointerDownOutside,
320
- onFocusOutside,
321
- onInteractOutside,
322
- onDismiss,
323
- ...layerProps
324
- } = props;
325
- const context = React.useContext(DismissableLayerContext);
326
- const [node, setNode] = React.useState(null);
327
- const ownerDocument = (node == null ? void 0 : node.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document);
328
- const [, force] = React.useState({});
329
- const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
330
- const layers = Array.from(context.layers);
331
- const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
332
- const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
333
- const index = node ? layers.indexOf(node) : -1;
334
- const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
335
- const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
336
- const pointerDownOutside = usePointerDownOutside((event) => {
337
- const target = event.target;
338
- const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));
339
- if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
340
- onPointerDownOutside == null ? void 0 : onPointerDownOutside(event);
341
- onInteractOutside == null ? void 0 : onInteractOutside(event);
342
- if (!event.defaultPrevented) onDismiss == null ? void 0 : onDismiss();
343
- }, ownerDocument);
344
- const focusOutside = useFocusOutside((event) => {
345
- const target = event.target;
346
- const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));
347
- if (isFocusInBranch) return;
348
- onFocusOutside == null ? void 0 : onFocusOutside(event);
349
- onInteractOutside == null ? void 0 : onInteractOutside(event);
350
- if (!event.defaultPrevented) onDismiss == null ? void 0 : onDismiss();
351
- }, ownerDocument);
352
- useEscapeKeydown((event) => {
353
- const isHighestLayer = index === context.layers.size - 1;
354
- if (!isHighestLayer) return;
355
- onEscapeKeyDown == null ? void 0 : onEscapeKeyDown(event);
356
- if (!event.defaultPrevented && onDismiss) {
357
- event.preventDefault();
358
- onDismiss();
359
- }
360
- }, ownerDocument);
361
- React.useEffect(() => {
362
- if (!node) return;
363
- if (disableOutsidePointerEvents) {
364
- if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
365
- originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
366
- ownerDocument.body.style.pointerEvents = "none";
367
- }
368
- context.layersWithOutsidePointerEventsDisabled.add(node);
369
- }
370
- context.layers.add(node);
371
- dispatchUpdate();
372
- return () => {
373
- if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {
374
- ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
375
- }
376
- };
377
- }, [node, ownerDocument, disableOutsidePointerEvents, context]);
378
- React.useEffect(() => {
379
- return () => {
380
- if (!node) return;
381
- context.layers.delete(node);
382
- context.layersWithOutsidePointerEventsDisabled.delete(node);
383
- dispatchUpdate();
384
- };
385
- }, [node, context]);
386
- React.useEffect(() => {
387
- const handleUpdate = () => force({});
388
- document.addEventListener(CONTEXT_UPDATE, handleUpdate);
389
- return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
390
- }, []);
391
- return /* @__PURE__ */ jsx(
392
- Primitive.div,
393
- {
394
- ...layerProps,
395
- ref: composedRefs,
396
- style: {
397
- pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
398
- ...props.style
399
- },
400
- onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),
401
- onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
402
- onPointerDownCapture: composeEventHandlers(
403
- props.onPointerDownCapture,
404
- pointerDownOutside.onPointerDownCapture
405
- )
406
- }
407
- );
408
- }
409
- );
410
- DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
411
- var BRANCH_NAME = "DismissableLayerBranch";
412
- var DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {
413
- const context = React.useContext(DismissableLayerContext);
414
- const ref = React.useRef(null);
415
- const composedRefs = useComposedRefs(forwardedRef, ref);
416
- React.useEffect(() => {
417
- const node = ref.current;
418
- if (node) {
419
- context.branches.add(node);
420
- return () => {
421
- context.branches.delete(node);
422
- };
423
- }
424
- }, [context.branches]);
425
- return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });
426
- });
427
- DismissableLayerBranch.displayName = BRANCH_NAME;
428
- function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
429
- const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
430
- const isPointerInsideReactTreeRef = React.useRef(false);
431
- const handleClickRef = React.useRef(() => {
432
- });
433
- React.useEffect(() => {
434
- const handlePointerDown = (event) => {
435
- if (event.target && !isPointerInsideReactTreeRef.current) {
436
- let handleAndDispatchPointerDownOutsideEvent2 = function() {
437
- handleAndDispatchCustomEvent(
438
- POINTER_DOWN_OUTSIDE,
439
- handlePointerDownOutside,
440
- eventDetail,
441
- { discrete: true }
442
- );
443
- };
444
- const eventDetail = { originalEvent: event };
445
- if (event.pointerType === "touch") {
446
- ownerDocument.removeEventListener("click", handleClickRef.current);
447
- handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
448
- ownerDocument.addEventListener("click", handleClickRef.current, { once: true });
449
- } else {
450
- handleAndDispatchPointerDownOutsideEvent2();
451
- }
452
- } else {
453
- ownerDocument.removeEventListener("click", handleClickRef.current);
454
- }
455
- isPointerInsideReactTreeRef.current = false;
456
- };
457
- const timerId = window.setTimeout(() => {
458
- ownerDocument.addEventListener("pointerdown", handlePointerDown);
459
- }, 0);
460
- return () => {
461
- window.clearTimeout(timerId);
462
- ownerDocument.removeEventListener("pointerdown", handlePointerDown);
463
- ownerDocument.removeEventListener("click", handleClickRef.current);
464
- };
465
- }, [ownerDocument, handlePointerDownOutside]);
466
- return {
467
- // ensures we check React component tree (not just DOM tree)
468
- onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
469
- };
470
- }
471
- function useFocusOutside(onFocusOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
472
- const handleFocusOutside = useCallbackRef(onFocusOutside);
473
- const isFocusInsideReactTreeRef = React.useRef(false);
474
- React.useEffect(() => {
475
- const handleFocus = (event) => {
476
- if (event.target && !isFocusInsideReactTreeRef.current) {
477
- const eventDetail = { originalEvent: event };
478
- handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
479
- discrete: false
480
- });
481
- }
482
- };
483
- ownerDocument.addEventListener("focusin", handleFocus);
484
- return () => ownerDocument.removeEventListener("focusin", handleFocus);
485
- }, [ownerDocument, handleFocusOutside]);
486
- return {
487
- onFocusCapture: () => isFocusInsideReactTreeRef.current = true,
488
- onBlurCapture: () => isFocusInsideReactTreeRef.current = false
489
- };
490
- }
491
- function dispatchUpdate() {
492
- const event = new CustomEvent(CONTEXT_UPDATE);
493
- document.dispatchEvent(event);
494
- }
495
- function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
496
- const target = detail.originalEvent.target;
497
- const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
498
- if (handler) target.addEventListener(name, handler, { once: true });
499
- if (discrete) {
500
- dispatchDiscreteCustomEvent(target, event);
501
- } else {
502
- target.dispatchEvent(event);
503
- }
504
- }
505
- var Root = DismissableLayer;
506
- var Branch = DismissableLayerBranch;
507
- var useLayoutEffect2 = (globalThis == null ? void 0 : globalThis.document) ? React.useLayoutEffect : () => {
508
- };
509
- var PORTAL_NAME = "Portal";
510
- var Portal = React.forwardRef((props, forwardedRef) => {
511
- var _a;
512
- const { container: containerProp, ...portalProps } = props;
513
- const [mounted, setMounted] = React.useState(false);
514
- useLayoutEffect2(() => setMounted(true), []);
515
- const container = containerProp || mounted && ((_a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : _a.body);
516
- return container ? ReactDOM__default.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
517
- });
518
- Portal.displayName = PORTAL_NAME;
519
- function useStateMachine(initialState, machine) {
520
- return React.useReducer((state, event) => {
521
- const nextState = machine[state][event];
522
- return nextState ?? state;
523
- }, initialState);
524
- }
525
- var Presence = (props) => {
526
- const { present, children } = props;
527
- const presence = usePresence(present);
528
- const child = typeof children === "function" ? children({ present: presence.isPresent }) : React.Children.only(children);
529
- const ref = useComposedRefs(presence.ref, getElementRef(child));
530
- const forceMount = typeof children === "function";
531
- return forceMount || presence.isPresent ? React.cloneElement(child, { ref }) : null;
532
- };
533
- Presence.displayName = "Presence";
534
- function usePresence(present) {
535
- const [node, setNode] = React.useState();
536
- const stylesRef = React.useRef(null);
537
- const prevPresentRef = React.useRef(present);
538
- const prevAnimationNameRef = React.useRef("none");
539
- const initialState = present ? "mounted" : "unmounted";
540
- const [state, send] = useStateMachine(initialState, {
541
- mounted: {
542
- UNMOUNT: "unmounted",
543
- ANIMATION_OUT: "unmountSuspended"
544
- },
545
- unmountSuspended: {
546
- MOUNT: "mounted",
547
- ANIMATION_END: "unmounted"
548
- },
549
- unmounted: {
550
- MOUNT: "mounted"
551
- }
552
- });
553
- React.useEffect(() => {
554
- const currentAnimationName = getAnimationName(stylesRef.current);
555
- prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
556
- }, [state]);
557
- useLayoutEffect2(() => {
558
- const styles = stylesRef.current;
559
- const wasPresent = prevPresentRef.current;
560
- const hasPresentChanged = wasPresent !== present;
561
- if (hasPresentChanged) {
562
- const prevAnimationName = prevAnimationNameRef.current;
563
- const currentAnimationName = getAnimationName(styles);
564
- if (present) {
565
- send("MOUNT");
566
- } else if (currentAnimationName === "none" || (styles == null ? void 0 : styles.display) === "none") {
567
- send("UNMOUNT");
568
- } else {
569
- const isAnimating = prevAnimationName !== currentAnimationName;
570
- if (wasPresent && isAnimating) {
571
- send("ANIMATION_OUT");
572
- } else {
573
- send("UNMOUNT");
574
- }
575
- }
576
- prevPresentRef.current = present;
577
- }
578
- }, [present, send]);
579
- useLayoutEffect2(() => {
580
- if (node) {
581
- let timeoutId;
582
- const ownerWindow = node.ownerDocument.defaultView ?? window;
583
- const handleAnimationEnd = (event) => {
584
- const currentAnimationName = getAnimationName(stylesRef.current);
585
- const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));
586
- if (event.target === node && isCurrentAnimation) {
587
- send("ANIMATION_END");
588
- if (!prevPresentRef.current) {
589
- const currentFillMode = node.style.animationFillMode;
590
- node.style.animationFillMode = "forwards";
591
- timeoutId = ownerWindow.setTimeout(() => {
592
- if (node.style.animationFillMode === "forwards") {
593
- node.style.animationFillMode = currentFillMode;
594
- }
595
- });
596
- }
597
- }
598
- };
599
- const handleAnimationStart = (event) => {
600
- if (event.target === node) {
601
- prevAnimationNameRef.current = getAnimationName(stylesRef.current);
602
- }
603
- };
604
- node.addEventListener("animationstart", handleAnimationStart);
605
- node.addEventListener("animationcancel", handleAnimationEnd);
606
- node.addEventListener("animationend", handleAnimationEnd);
607
- return () => {
608
- ownerWindow.clearTimeout(timeoutId);
609
- node.removeEventListener("animationstart", handleAnimationStart);
610
- node.removeEventListener("animationcancel", handleAnimationEnd);
611
- node.removeEventListener("animationend", handleAnimationEnd);
612
- };
613
- } else {
614
- send("ANIMATION_END");
615
- }
616
- }, [node, send]);
617
- return {
618
- isPresent: ["mounted", "unmountSuspended"].includes(state),
619
- ref: React.useCallback((node2) => {
620
- stylesRef.current = node2 ? getComputedStyle(node2) : null;
621
- setNode(node2);
622
- }, [])
623
- };
624
- }
625
- function getAnimationName(styles) {
626
- return (styles == null ? void 0 : styles.animationName) || "none";
627
- }
628
- function getElementRef(element) {
629
- var _a, _b;
630
- let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
631
- let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
632
- if (mayWarn) {
633
- return element.ref;
634
- }
635
- getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
636
- mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
637
- if (mayWarn) {
638
- return element.props.ref;
639
- }
640
- return element.props.ref || element.ref;
641
- }
642
- var useInsertionEffect = React[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
643
- function useControllableState({
644
- prop,
645
- defaultProp,
646
- onChange = () => {
647
- },
648
- caller
649
- }) {
650
- const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
651
- defaultProp,
652
- onChange
653
- });
654
- const isControlled = prop !== void 0;
655
- const value = isControlled ? prop : uncontrolledProp;
656
- {
657
- const isControlledRef = React.useRef(prop !== void 0);
658
- React.useEffect(() => {
659
- const wasControlled = isControlledRef.current;
660
- if (wasControlled !== isControlled) {
661
- const from = wasControlled ? "controlled" : "uncontrolled";
662
- const to = isControlled ? "controlled" : "uncontrolled";
663
- console.warn(
664
- `${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.`
665
- );
666
- }
667
- isControlledRef.current = isControlled;
668
- }, [isControlled, caller]);
669
- }
670
- const setValue = React.useCallback(
671
- (nextValue) => {
672
- var _a;
673
- if (isControlled) {
674
- const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
675
- if (value2 !== prop) {
676
- (_a = onChangeRef.current) == null ? void 0 : _a.call(onChangeRef, value2);
677
- }
678
- } else {
679
- setUncontrolledProp(nextValue);
680
- }
681
- },
682
- [isControlled, prop, setUncontrolledProp, onChangeRef]
683
- );
684
- return [value, setValue];
685
- }
686
- function useUncontrolledState({
687
- defaultProp,
688
- onChange
689
- }) {
690
- const [value, setValue] = React.useState(defaultProp);
691
- const prevValueRef = React.useRef(value);
692
- const onChangeRef = React.useRef(onChange);
693
- useInsertionEffect(() => {
694
- onChangeRef.current = onChange;
695
- }, [onChange]);
696
- React.useEffect(() => {
697
- var _a;
698
- if (prevValueRef.current !== value) {
699
- (_a = onChangeRef.current) == null ? void 0 : _a.call(onChangeRef, value);
700
- prevValueRef.current = value;
701
- }
702
- }, [value, prevValueRef]);
703
- return [value, setValue, onChangeRef];
704
- }
705
- function isFunction(value) {
706
- return typeof value === "function";
707
- }
708
- const lightDefaultTokens = {
709
- // Primary colors
710
- colorPrimary: "#6366f1",
711
- colorPrimaryHover: "#9197fe",
712
- colorPrimaryActive: "#4b49cb",
713
- colorPrimaryBg: "#f0f3ff",
714
- // Secondary color
715
- colorSecondary: "#64748b",
716
- // Status colors
717
- colorSuccess: "#22c55e",
718
- colorWarning: "#f59e0b",
719
- colorError: "#ef4444",
720
- // Background colors
721
- colorBg: "#ffffff",
722
- colorBgElevated: "#ffffff",
723
- colorBgSpotlight: "#f8fafc",
724
- // Text colors
725
- colorText: "#0f172a",
726
- colorTextSecondary: "#475569",
727
- colorTextTertiary: "#94a3b8",
728
- colorTextDisabled: "#cbd5e1",
729
- // Border colors
730
- colorBorder: "#e2e8f0",
731
- colorBorderSecondary: "#f1f5f9",
732
- // Border radius
733
- borderRadius: 8,
734
- borderRadiusSm: 4,
735
- borderRadiusLg: 12,
736
- // Font
737
- fontSize: 14,
738
- fontSizeSm: 12,
739
- fontSizeLg: 16,
740
- // Spacing
741
- spacing: 8,
742
- spacingXs: 4,
743
- spacingSm: 8,
744
- spacingMd: 16,
745
- spacingLg: 24,
746
- spacingXl: 32
747
- };
748
- const darkDefaultTokens = {
749
- // Primary colors
750
- colorPrimary: "#818cf8",
751
- colorPrimaryHover: "#adb8ff",
752
- colorPrimaryActive: "#6369d2",
753
- colorPrimaryBg: "#131525",
754
- // Secondary color
755
- colorSecondary: "#94a3b8",
756
- // Status colors
757
- colorSuccess: "#4ade80",
758
- colorWarning: "#fbbf24",
759
- colorError: "#f87171",
760
- // Background colors
761
- colorBg: "#0f172a",
762
- colorBgElevated: "#1e293b",
763
- colorBgSpotlight: "#334155",
764
- // Text colors
765
- colorText: "#f8fafc",
766
- colorTextSecondary: "#cbd5e1",
767
- colorTextTertiary: "#94a3b8",
768
- colorTextDisabled: "#64748b",
769
- // Border colors
770
- colorBorder: "#334155",
771
- colorBorderSecondary: "#1e293b",
772
- // Border radius
773
- borderRadius: 8,
774
- borderRadiusSm: 4,
775
- borderRadiusLg: 12,
776
- // Font
777
- fontSize: 14,
778
- fontSizeSm: 12,
779
- fontSizeLg: 16,
780
- // Spacing
781
- spacing: 8,
782
- spacingXs: 4,
783
- spacingSm: 8,
784
- spacingMd: 16,
785
- spacingLg: 24,
786
- spacingXl: 32
787
- };
788
- const hueStep = 2;
789
- const saturationStep = 0.16;
790
- const saturationStep2 = 0.05;
791
- const brightnessStep1 = 0.05;
792
- const brightnessStep2 = 0.15;
793
- const lightColorCount = 5;
794
- const darkColorCount = 4;
795
- function hexToRgb(hex) {
796
- const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
797
- if (!result || !result[1] || !result[2] || !result[3]) {
798
- return null;
799
- }
800
- return {
801
- r: parseInt(result[1], 16),
802
- g: parseInt(result[2], 16),
803
- b: parseInt(result[3], 16)
804
- };
805
- }
806
- function rgbToHex(rgb) {
807
- const toHex = (n) => {
808
- const hex = Math.round(Math.max(0, Math.min(255, n))).toString(16);
809
- return hex.length === 1 ? "0" + hex : hex;
810
- };
811
- return "#" + toHex(rgb.r) + toHex(rgb.g) + toHex(rgb.b);
812
- }
813
- function rgbToHsv(rgb) {
814
- const r = rgb.r / 255;
815
- const g = rgb.g / 255;
816
- const b = rgb.b / 255;
817
- const max = Math.max(r, g, b);
818
- const min = Math.min(r, g, b);
819
- const delta = max - min;
820
- let h = 0;
821
- const v = max;
822
- const s = max === 0 ? 0 : delta / max;
823
- if (delta !== 0) {
824
- if (max === r) {
825
- h = ((g - b) / delta + (g < b ? 6 : 0)) * 60;
826
- } else if (max === g) {
827
- h = ((b - r) / delta + 2) * 60;
828
- } else {
829
- h = ((r - g) / delta + 4) * 60;
830
- }
831
- }
832
- return { h, s, v };
833
- }
834
- function hsvToRgb(hsv) {
835
- const h = hsv.h / 60;
836
- const s = hsv.s;
837
- const v = hsv.v;
838
- const i = Math.floor(h) % 6;
839
- const f = h - Math.floor(h);
840
- const p = v * (1 - s);
841
- const q = v * (1 - f * s);
842
- const t = v * (1 - (1 - f) * s);
843
- let r = 0, g = 0, b = 0;
844
- switch (i) {
845
- case 0:
846
- r = v;
847
- g = t;
848
- b = p;
849
- break;
850
- case 1:
851
- r = q;
852
- g = v;
853
- b = p;
854
- break;
855
- case 2:
856
- r = p;
857
- g = v;
858
- b = t;
859
- break;
860
- case 3:
861
- r = p;
862
- g = q;
863
- b = v;
864
- break;
865
- case 4:
866
- r = t;
867
- g = p;
868
- b = v;
869
- break;
870
- case 5:
871
- r = v;
872
- g = p;
873
- b = q;
874
- break;
875
- }
876
- return {
877
- r: Math.round(r * 255),
878
- g: Math.round(g * 255),
879
- b: Math.round(b * 255)
880
- };
881
- }
882
- function getHue(hsv, i, isLight) {
883
- let hue;
884
- if (hsv.h >= 60 && hsv.h <= 240) {
885
- hue = isLight ? hsv.h - hueStep * i : hsv.h + hueStep * i;
886
- } else {
887
- hue = isLight ? hsv.h + hueStep * i : hsv.h - hueStep * i;
888
- }
889
- if (hue < 0) {
890
- hue += 360;
891
- } else if (hue >= 360) {
892
- hue -= 360;
893
- }
894
- return hue;
895
- }
896
- function getSaturation(hsv, i, isLight) {
897
- if (hsv.s === 0) {
898
- return hsv.s;
899
- }
900
- let saturation;
901
- if (isLight) {
902
- saturation = hsv.s - saturationStep * i;
903
- } else {
904
- saturation = hsv.s + saturationStep2 * i;
905
- }
906
- if (saturation < 0.06) {
907
- saturation = 0.06;
908
- }
909
- if (saturation > 1) {
910
- saturation = 1;
911
- }
912
- return saturation;
913
- }
914
- function getValue(hsv, i, isLight) {
915
- let value;
916
- if (isLight) {
917
- value = hsv.v + brightnessStep1 * i;
918
- } else {
919
- value = hsv.v - brightnessStep2 * i;
920
- }
921
- if (value < 0) {
922
- value = 0;
923
- }
924
- if (value > 1) {
925
- value = 1;
926
- }
927
- return value;
928
- }
929
- function generatePalette(primaryColor) {
930
- const rgb = hexToRgb(primaryColor);
931
- if (!rgb) {
932
- return Array(10).fill(primaryColor);
933
- }
934
- const hsv = rgbToHsv(rgb);
935
- const palette = [];
936
- for (let i = lightColorCount; i > 0; i--) {
937
- const newHsv = {
938
- h: getHue(hsv, i, true),
939
- s: getSaturation(hsv, i, true),
940
- v: getValue(hsv, i, true)
941
- };
942
- palette.push(rgbToHex(hsvToRgb(newHsv)));
943
- }
944
- palette.push(primaryColor);
945
- for (let i = 1; i <= darkColorCount; i++) {
946
- const newHsv = {
947
- h: getHue(hsv, i, false),
948
- s: getSaturation(hsv, i, false),
949
- v: getValue(hsv, i, false)
950
- };
951
- palette.push(rgbToHex(hsvToRgb(newHsv)));
952
- }
953
- return palette;
954
- }
955
- function mixColors(color1, color2, weight) {
956
- const rgb1 = hexToRgb(color1);
957
- const rgb2 = hexToRgb(color2);
958
- if (!rgb1 || !rgb2) return color1;
959
- return rgbToHex({
960
- r: rgb1.r + (rgb2.r - rgb1.r) * weight,
961
- g: rgb1.g + (rgb2.g - rgb1.g) * weight,
962
- b: rgb1.b + (rgb2.b - rgb1.b) * weight
963
- });
964
- }
965
- function deriveTokens(seed, mode) {
966
- const derived = {};
967
- const isLight = mode === "light";
968
- if (seed.colorPrimary) {
969
- const palette = generatePalette(seed.colorPrimary);
970
- derived.colorPrimary = seed.colorPrimary;
971
- if (isLight) {
972
- derived.colorPrimaryHover = palette[4];
973
- derived.colorPrimaryActive = palette[6];
974
- derived.colorPrimaryBg = palette[0];
975
- } else {
976
- derived.colorPrimaryHover = palette[4];
977
- derived.colorPrimaryActive = palette[6];
978
- derived.colorPrimaryBg = mixColors(seed.colorPrimary, "#000000", 0.85);
979
- }
980
- }
981
- if (seed.colorSecondary) derived.colorSecondary = seed.colorSecondary;
982
- if (seed.colorSuccess) derived.colorSuccess = seed.colorSuccess;
983
- if (seed.colorWarning) derived.colorWarning = seed.colorWarning;
984
- if (seed.colorError) derived.colorError = seed.colorError;
985
- if (seed.borderRadius !== void 0) {
986
- derived.borderRadius = seed.borderRadius;
987
- derived.borderRadiusSm = Math.max(0, seed.borderRadius - 4);
988
- derived.borderRadiusLg = seed.borderRadius + 4;
989
- }
990
- if (seed.fontSize !== void 0) {
991
- derived.fontSize = seed.fontSize;
992
- derived.fontSizeSm = seed.fontSize - 2;
993
- derived.fontSizeLg = seed.fontSize + 2;
994
- }
995
- return derived;
996
- }
997
- function mergeTokens(defaults, derived, override) {
998
- return {
999
- ...defaults,
1000
- ...derived,
1001
- ...override
1002
- };
1003
- }
1004
- function getSystemThemeMode() {
1005
- if (typeof window === "undefined") {
1006
- return "light";
1007
- }
1008
- return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
1009
- }
1010
- const defaultTheme = {
1011
- mode: "light",
1012
- compact: false,
1013
- tokens: lightDefaultTokens
1014
- };
1015
- function toKebabCase(str) {
1016
- return str.replace(/([A-Z])/g, "-$1").toLowerCase();
1017
- }
1018
- function tokensToCssVariables(tokens) {
1019
- const cssVars = {};
1020
- for (const [key, value] of Object.entries(tokens)) {
1021
- const cssVarName = `--taskon-${toKebabCase(key)}`;
1022
- if (typeof value === "number") {
1023
- cssVars[cssVarName] = `${value}px`;
1024
- } else {
1025
- cssVars[cssVarName] = value;
1026
- }
1027
- }
1028
- return cssVars;
1029
- }
1030
- function resolveTheme(config, systemMode) {
1031
- if (!config) {
1032
- return defaultTheme;
1033
- }
1034
- let resolvedMode;
1035
- if (config.mode === "auto") {
1036
- resolvedMode = systemMode;
1037
- } else if (config.mode) {
1038
- resolvedMode = config.mode;
1039
- } else {
1040
- resolvedMode = "light";
1041
- }
1042
- const defaultTokens = resolvedMode === "light" ? lightDefaultTokens : darkDefaultTokens;
1043
- const modeConfig = resolvedMode === "light" ? config.light : config.dark;
1044
- const mergedSeed = {
1045
- ...config.seed,
1046
- ...modeConfig == null ? void 0 : modeConfig.seed
1047
- };
1048
- const derivedTokens = deriveTokens(mergedSeed, resolvedMode);
1049
- const mergedMap = {
1050
- ...config.map,
1051
- ...modeConfig == null ? void 0 : modeConfig.map
1052
- };
1053
- const finalTokens = mergeTokens(defaultTokens, derivedTokens, mergedMap);
1054
- return {
1055
- mode: resolvedMode,
1056
- compact: config.compact ?? false,
1057
- tokens: finalTokens
1058
- };
1059
- }
1060
- function ThemeProvider({
1061
- theme: themeConfig,
1062
- children
1063
- }) {
1064
- const [systemMode, setSystemMode] = useState(
1065
- () => getSystemThemeMode()
1066
- );
1067
- const effectiveMode = themeConfig == null ? void 0 : themeConfig.mode;
1068
- useEffect(() => {
1069
- if (effectiveMode !== "auto") {
1070
- return;
1071
- }
1072
- const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
1073
- const handler = (e) => {
1074
- setSystemMode(e.matches ? "dark" : "light");
1075
- };
1076
- mediaQuery.addEventListener("change", handler);
1077
- return () => mediaQuery.removeEventListener("change", handler);
1078
- }, [effectiveMode]);
1079
- const resolvedTheme = useMemo(
1080
- () => resolveTheme(themeConfig, systemMode),
1081
- [themeConfig, systemMode]
1082
- );
1083
- const cssVariables = useMemo(
1084
- () => tokensToCssVariables(resolvedTheme.tokens),
1085
- [resolvedTheme.tokens]
1086
- );
1087
- return /* @__PURE__ */ jsx(ThemeContext.Provider, { value: resolvedTheme, children: /* @__PURE__ */ jsx(
1088
- "div",
1089
- {
1090
- style: cssVariables,
1091
- "data-taskon-theme": resolvedTheme.mode,
1092
- children
1093
- }
1094
- ) });
1095
- }
1096
- export {
1097
- Branch as B,
1098
- DismissableLayer as D,
1099
- Primitive as P,
1100
- Root as R,
1101
- ThemeProvider as T,
1102
- useTaskOnTheme as a,
1103
- useTaskOnContext as b,
1104
- composeRefs as c,
1105
- createContextScope as d,
1106
- useComposedRefs as e,
1107
- createSlot as f,
1108
- useControllableState as g,
1109
- Presence as h,
1110
- composeEventHandlers as i,
1111
- useCallbackRef as j,
1112
- Portal as k,
1113
- dispatchDiscreteCustomEvent as l,
1114
- useLayoutEffect2 as m,
1115
- TaskOnContext as n,
1116
- createContext2 as o,
1117
- useTaskOnAuth as u
1118
- };