@almadar/ui 2.24.5 → 2.24.9
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/avl/index.cjs +43 -43
- package/dist/avl/index.js +43 -43
- package/dist/components/atoms/AnimatedGraphic.d.ts +29 -0
- package/dist/components/atoms/AnimatedReveal.d.ts +24 -0
- package/dist/components/atoms/index.d.ts +2 -0
- package/dist/components/index.cjs +2277 -1929
- package/dist/components/index.js +1415 -1069
- package/dist/components/organisms/debug/RuntimeDebugger.d.ts +2 -2
- package/dist/components/organisms/game/three/index.cjs +41 -41
- package/dist/components/organisms/game/three/index.js +41 -41
- package/dist/docs/index.cjs +144 -142
- package/dist/docs/index.js +144 -142
- package/dist/illustrations/index.cjs +17 -17
- package/dist/illustrations/index.js +17 -17
- package/dist/lib/index.cjs +62 -50
- package/dist/lib/index.js +62 -50
- package/dist/marketing/index.cjs +457 -172
- package/dist/marketing/index.d.cts +54 -1
- package/dist/marketing/index.d.ts +4 -0
- package/dist/marketing/index.js +457 -174
- package/dist/providers/index.cjs +628 -329
- package/dist/providers/index.js +540 -241
- package/dist/runtime/index.cjs +2151 -1770
- package/dist/runtime/index.js +1392 -1011
- package/package.json +1 -1
- package/tailwind-preset.cjs +32 -134
package/dist/providers/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React112 = require('react');
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
var providers = require('@almadar/ui/providers');
|
|
6
6
|
require('react-dom');
|
|
@@ -41,7 +41,7 @@ function _interopNamespace(e) {
|
|
|
41
41
|
return Object.freeze(n);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
var
|
|
44
|
+
var React112__namespace = /*#__PURE__*/_interopNamespace(React112);
|
|
45
45
|
var LucideIcons__namespace = /*#__PURE__*/_interopNamespace(LucideIcons);
|
|
46
46
|
var L__default = /*#__PURE__*/_interopDefault(L);
|
|
47
47
|
var ReactMarkdown__default = /*#__PURE__*/_interopDefault(ReactMarkdown);
|
|
@@ -153,7 +153,7 @@ var BUILT_IN_THEMES = [
|
|
|
153
153
|
hasDarkMode: true
|
|
154
154
|
}
|
|
155
155
|
];
|
|
156
|
-
var ThemeContext =
|
|
156
|
+
var ThemeContext = React112.createContext(void 0);
|
|
157
157
|
var THEME_STORAGE_KEY = "theme";
|
|
158
158
|
var MODE_STORAGE_KEY = "theme-mode";
|
|
159
159
|
function getSystemMode() {
|
|
@@ -173,14 +173,14 @@ var ThemeProvider = ({
|
|
|
173
173
|
defaultMode = "system",
|
|
174
174
|
targetRef
|
|
175
175
|
}) => {
|
|
176
|
-
const availableThemes =
|
|
176
|
+
const availableThemes = React112.useMemo(() => {
|
|
177
177
|
const themeMap = /* @__PURE__ */ new Map();
|
|
178
178
|
BUILT_IN_THEMES.forEach((t) => themeMap.set(t.name, t));
|
|
179
179
|
themes.forEach((t) => themeMap.set(t.name, t));
|
|
180
180
|
return Array.from(themeMap.values());
|
|
181
181
|
}, [themes]);
|
|
182
182
|
const isScoped = !!targetRef;
|
|
183
|
-
const [theme, setThemeState] =
|
|
183
|
+
const [theme, setThemeState] = React112.useState(() => {
|
|
184
184
|
if (isScoped || typeof window === "undefined") return defaultTheme;
|
|
185
185
|
const stored = localStorage.getItem(THEME_STORAGE_KEY);
|
|
186
186
|
const validThemes = [
|
|
@@ -192,7 +192,7 @@ var ThemeProvider = ({
|
|
|
192
192
|
}
|
|
193
193
|
return defaultTheme;
|
|
194
194
|
});
|
|
195
|
-
const [mode, setModeState] =
|
|
195
|
+
const [mode, setModeState] = React112.useState(() => {
|
|
196
196
|
if (isScoped || typeof window === "undefined") return defaultMode;
|
|
197
197
|
const stored = localStorage.getItem(MODE_STORAGE_KEY);
|
|
198
198
|
if (stored === "light" || stored === "dark" || stored === "system") {
|
|
@@ -200,14 +200,14 @@ var ThemeProvider = ({
|
|
|
200
200
|
}
|
|
201
201
|
return defaultMode;
|
|
202
202
|
});
|
|
203
|
-
const [resolvedMode, setResolvedMode] =
|
|
203
|
+
const [resolvedMode, setResolvedMode] = React112.useState(
|
|
204
204
|
() => resolveMode(mode)
|
|
205
205
|
);
|
|
206
|
-
const appliedTheme =
|
|
206
|
+
const appliedTheme = React112.useMemo(
|
|
207
207
|
() => `${theme}-${resolvedMode}`,
|
|
208
208
|
[theme, resolvedMode]
|
|
209
209
|
);
|
|
210
|
-
|
|
210
|
+
React112.useEffect(() => {
|
|
211
211
|
const updateResolved = () => {
|
|
212
212
|
setResolvedMode(resolveMode(mode));
|
|
213
213
|
};
|
|
@@ -220,7 +220,7 @@ var ThemeProvider = ({
|
|
|
220
220
|
}
|
|
221
221
|
return void 0;
|
|
222
222
|
}, [mode]);
|
|
223
|
-
|
|
223
|
+
React112.useEffect(() => {
|
|
224
224
|
if (isScoped) {
|
|
225
225
|
if (targetRef?.current) {
|
|
226
226
|
targetRef.current.setAttribute("data-theme", appliedTheme);
|
|
@@ -234,7 +234,7 @@ var ThemeProvider = ({
|
|
|
234
234
|
root.classList.remove("light", "dark");
|
|
235
235
|
root.classList.add(resolvedMode);
|
|
236
236
|
}, [appliedTheme, resolvedMode, targetRef, isScoped]);
|
|
237
|
-
const setTheme =
|
|
237
|
+
const setTheme = React112.useCallback(
|
|
238
238
|
(newTheme) => {
|
|
239
239
|
const validTheme = availableThemes.find((t) => t.name === newTheme);
|
|
240
240
|
if (validTheme) {
|
|
@@ -250,17 +250,17 @@ var ThemeProvider = ({
|
|
|
250
250
|
},
|
|
251
251
|
[availableThemes]
|
|
252
252
|
);
|
|
253
|
-
const setMode =
|
|
253
|
+
const setMode = React112.useCallback((newMode) => {
|
|
254
254
|
setModeState(newMode);
|
|
255
255
|
if (!isScoped && typeof window !== "undefined") {
|
|
256
256
|
localStorage.setItem(MODE_STORAGE_KEY, newMode);
|
|
257
257
|
}
|
|
258
258
|
}, []);
|
|
259
|
-
const toggleMode =
|
|
259
|
+
const toggleMode = React112.useCallback(() => {
|
|
260
260
|
const newMode = resolvedMode === "dark" ? "light" : "dark";
|
|
261
261
|
setMode(newMode);
|
|
262
262
|
}, [resolvedMode, setMode]);
|
|
263
|
-
const contextValue =
|
|
263
|
+
const contextValue = React112.useMemo(
|
|
264
264
|
() => ({
|
|
265
265
|
theme,
|
|
266
266
|
mode,
|
|
@@ -356,15 +356,15 @@ var fallbackEventBus = {
|
|
|
356
356
|
}
|
|
357
357
|
};
|
|
358
358
|
function useEventBus() {
|
|
359
|
-
const context =
|
|
359
|
+
const context = React112.useContext(providers.EventBusContext);
|
|
360
360
|
return context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
361
361
|
}
|
|
362
|
-
var EventBusContext2 =
|
|
362
|
+
var EventBusContext2 = React112.createContext(null);
|
|
363
363
|
function EventBusProvider({ children, debug: debug2 = false }) {
|
|
364
|
-
const listenersRef =
|
|
365
|
-
const anyListenersRef =
|
|
366
|
-
const deprecationWarningShown =
|
|
367
|
-
const getSelectedEntity =
|
|
364
|
+
const listenersRef = React112.useRef(/* @__PURE__ */ new Map());
|
|
365
|
+
const anyListenersRef = React112.useRef(/* @__PURE__ */ new Set());
|
|
366
|
+
const deprecationWarningShown = React112.useRef(false);
|
|
367
|
+
const getSelectedEntity = React112.useCallback(() => {
|
|
368
368
|
if (!deprecationWarningShown.current) {
|
|
369
369
|
console.warn(
|
|
370
370
|
"[EventBus] getSelectedEntity is deprecated. Use SelectionProvider and useSelection hook instead. See SelectionProvider.tsx for migration guide."
|
|
@@ -373,7 +373,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
373
373
|
}
|
|
374
374
|
return null;
|
|
375
375
|
}, []);
|
|
376
|
-
const clearSelectedEntity =
|
|
376
|
+
const clearSelectedEntity = React112.useCallback(() => {
|
|
377
377
|
if (!deprecationWarningShown.current) {
|
|
378
378
|
console.warn(
|
|
379
379
|
"[EventBus] clearSelectedEntity is deprecated. Use SelectionProvider and useSelection hook instead. See SelectionProvider.tsx for migration guide."
|
|
@@ -381,14 +381,14 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
381
381
|
deprecationWarningShown.current = true;
|
|
382
382
|
}
|
|
383
383
|
}, []);
|
|
384
|
-
const emit =
|
|
384
|
+
const emit = React112.useCallback((type, payload) => {
|
|
385
385
|
const event = {
|
|
386
386
|
type,
|
|
387
387
|
payload,
|
|
388
388
|
timestamp: Date.now()
|
|
389
389
|
};
|
|
390
|
-
const
|
|
391
|
-
const listenerCount =
|
|
390
|
+
const listeners6 = listenersRef.current.get(type);
|
|
391
|
+
const listenerCount = listeners6?.size ?? 0;
|
|
392
392
|
if (debug2) {
|
|
393
393
|
if (listenerCount > 0) {
|
|
394
394
|
console.log(`[EventBus] Emit: ${type} \u2192 ${listenerCount} listener(s)`, payload);
|
|
@@ -396,8 +396,8 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
396
396
|
console.warn(`[EventBus] Emit: ${type} (NO LISTENERS - event may be lost!)`, payload);
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
|
-
if (
|
|
400
|
-
const listenersCopy = Array.from(
|
|
399
|
+
if (listeners6) {
|
|
400
|
+
const listenersCopy = Array.from(listeners6);
|
|
401
401
|
for (const listener of listenersCopy) {
|
|
402
402
|
try {
|
|
403
403
|
listener(event);
|
|
@@ -415,37 +415,37 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
417
|
}, [debug2]);
|
|
418
|
-
const on =
|
|
418
|
+
const on = React112.useCallback((type, listener) => {
|
|
419
419
|
if (!listenersRef.current.has(type)) {
|
|
420
420
|
listenersRef.current.set(type, /* @__PURE__ */ new Set());
|
|
421
421
|
}
|
|
422
|
-
const
|
|
423
|
-
|
|
422
|
+
const listeners6 = listenersRef.current.get(type);
|
|
423
|
+
listeners6.add(listener);
|
|
424
424
|
if (debug2) {
|
|
425
|
-
console.log(`[EventBus] Subscribed to '${type}', total: ${
|
|
425
|
+
console.log(`[EventBus] Subscribed to '${type}', total: ${listeners6.size}`);
|
|
426
426
|
}
|
|
427
427
|
return () => {
|
|
428
|
-
|
|
428
|
+
listeners6.delete(listener);
|
|
429
429
|
if (debug2) {
|
|
430
|
-
console.log(`[EventBus] Unsubscribed from '${type}', remaining: ${
|
|
430
|
+
console.log(`[EventBus] Unsubscribed from '${type}', remaining: ${listeners6.size}`);
|
|
431
431
|
}
|
|
432
|
-
if (
|
|
432
|
+
if (listeners6.size === 0) {
|
|
433
433
|
listenersRef.current.delete(type);
|
|
434
434
|
}
|
|
435
435
|
};
|
|
436
436
|
}, [debug2]);
|
|
437
|
-
const once =
|
|
437
|
+
const once = React112.useCallback((type, listener) => {
|
|
438
438
|
const wrappedListener = (event) => {
|
|
439
439
|
listenersRef.current.get(type)?.delete(wrappedListener);
|
|
440
440
|
listener(event);
|
|
441
441
|
};
|
|
442
442
|
return on(type, wrappedListener);
|
|
443
443
|
}, [on]);
|
|
444
|
-
const hasListeners =
|
|
445
|
-
const
|
|
446
|
-
return
|
|
444
|
+
const hasListeners = React112.useCallback((type) => {
|
|
445
|
+
const listeners6 = listenersRef.current.get(type);
|
|
446
|
+
return listeners6 !== void 0 && listeners6.size > 0;
|
|
447
447
|
}, []);
|
|
448
|
-
const onAny =
|
|
448
|
+
const onAny = React112.useCallback((listener) => {
|
|
449
449
|
anyListenersRef.current.add(listener);
|
|
450
450
|
if (debug2) {
|
|
451
451
|
console.log(`[EventBus] onAny subscribed, total: ${anyListenersRef.current.size}`);
|
|
@@ -457,7 +457,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
457
457
|
}
|
|
458
458
|
};
|
|
459
459
|
}, [debug2]);
|
|
460
|
-
const contextValue =
|
|
460
|
+
const contextValue = React112.useMemo(
|
|
461
461
|
() => ({
|
|
462
462
|
emit,
|
|
463
463
|
on,
|
|
@@ -469,7 +469,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
469
469
|
}),
|
|
470
470
|
[emit, on, once, hasListeners, onAny, getSelectedEntity, clearSelectedEntity]
|
|
471
471
|
);
|
|
472
|
-
|
|
472
|
+
React112.useEffect(() => {
|
|
473
473
|
setGlobalEventBus(contextValue);
|
|
474
474
|
return () => {
|
|
475
475
|
setGlobalEventBus(null);
|
|
@@ -477,7 +477,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
477
477
|
}, [contextValue]);
|
|
478
478
|
return /* @__PURE__ */ jsxRuntime.jsx(EventBusContext2.Provider, { value: contextValue, children });
|
|
479
479
|
}
|
|
480
|
-
var SelectionContext =
|
|
480
|
+
var SelectionContext = React112.createContext(null);
|
|
481
481
|
var defaultCompareEntities = (a, b) => {
|
|
482
482
|
if (a === b) return true;
|
|
483
483
|
if (!a || !b) return false;
|
|
@@ -494,8 +494,8 @@ function SelectionProvider({
|
|
|
494
494
|
compareEntities = defaultCompareEntities
|
|
495
495
|
}) {
|
|
496
496
|
const eventBus = useEventBus();
|
|
497
|
-
const [selected, setSelectedState] =
|
|
498
|
-
const setSelected =
|
|
497
|
+
const [selected, setSelectedState] = React112.useState(null);
|
|
498
|
+
const setSelected = React112.useCallback(
|
|
499
499
|
(entity) => {
|
|
500
500
|
setSelectedState(entity);
|
|
501
501
|
if (debug2) {
|
|
@@ -504,19 +504,19 @@ function SelectionProvider({
|
|
|
504
504
|
},
|
|
505
505
|
[debug2]
|
|
506
506
|
);
|
|
507
|
-
const clearSelection =
|
|
507
|
+
const clearSelection = React112.useCallback(() => {
|
|
508
508
|
setSelectedState(null);
|
|
509
509
|
if (debug2) {
|
|
510
510
|
console.log("[SelectionProvider] Selection cleared");
|
|
511
511
|
}
|
|
512
512
|
}, [debug2]);
|
|
513
|
-
const isSelected =
|
|
513
|
+
const isSelected = React112.useCallback(
|
|
514
514
|
(entity) => {
|
|
515
515
|
return compareEntities(selected, entity);
|
|
516
516
|
},
|
|
517
517
|
[selected, compareEntities]
|
|
518
518
|
);
|
|
519
|
-
|
|
519
|
+
React112.useEffect(() => {
|
|
520
520
|
const handleSelect = (event) => {
|
|
521
521
|
const row = event.payload?.row;
|
|
522
522
|
if (row) {
|
|
@@ -554,14 +554,14 @@ function SelectionProvider({
|
|
|
554
554
|
return /* @__PURE__ */ jsxRuntime.jsx(SelectionContext.Provider, { value: contextValue, children });
|
|
555
555
|
}
|
|
556
556
|
function useSelection() {
|
|
557
|
-
const context =
|
|
557
|
+
const context = React112.useContext(SelectionContext);
|
|
558
558
|
if (!context) {
|
|
559
559
|
throw new Error("useSelection must be used within a SelectionProvider");
|
|
560
560
|
}
|
|
561
561
|
return context;
|
|
562
562
|
}
|
|
563
563
|
function useSelectionOptional() {
|
|
564
|
-
const context =
|
|
564
|
+
const context = React112.useContext(SelectionContext);
|
|
565
565
|
return context;
|
|
566
566
|
}
|
|
567
567
|
function cn(...inputs) {
|
|
@@ -661,28 +661,28 @@ var marginYStyles = {
|
|
|
661
661
|
};
|
|
662
662
|
var bgStyles = {
|
|
663
663
|
transparent: "bg-transparent",
|
|
664
|
-
primary: "bg-
|
|
665
|
-
secondary: "bg-
|
|
666
|
-
muted: "bg-
|
|
667
|
-
accent: "bg-
|
|
668
|
-
surface: "bg-
|
|
669
|
-
overlay: "bg-
|
|
664
|
+
primary: "bg-primary text-primary-foreground",
|
|
665
|
+
secondary: "bg-secondary text-secondary-foreground",
|
|
666
|
+
muted: "bg-muted text-foreground",
|
|
667
|
+
accent: "bg-accent text-accent-foreground",
|
|
668
|
+
surface: "bg-card",
|
|
669
|
+
overlay: "bg-card/80 backdrop-blur-sm"
|
|
670
670
|
};
|
|
671
671
|
var roundedStyles = {
|
|
672
672
|
none: "rounded-none",
|
|
673
|
-
sm: "rounded-
|
|
674
|
-
md: "rounded-
|
|
675
|
-
lg: "rounded-
|
|
676
|
-
xl: "rounded-
|
|
677
|
-
"2xl": "rounded-
|
|
678
|
-
full: "rounded-
|
|
673
|
+
sm: "rounded-sm",
|
|
674
|
+
md: "rounded-md",
|
|
675
|
+
lg: "rounded-lg",
|
|
676
|
+
xl: "rounded-xl",
|
|
677
|
+
"2xl": "rounded-xl",
|
|
678
|
+
full: "rounded-full"
|
|
679
679
|
};
|
|
680
680
|
var shadowStyles = {
|
|
681
681
|
none: "shadow-none",
|
|
682
|
-
sm: "shadow-
|
|
683
|
-
md: "shadow
|
|
684
|
-
lg: "shadow-
|
|
685
|
-
xl: "shadow-
|
|
682
|
+
sm: "shadow-sm",
|
|
683
|
+
md: "shadow",
|
|
684
|
+
lg: "shadow-lg",
|
|
685
|
+
xl: "shadow-lg"
|
|
686
686
|
};
|
|
687
687
|
var displayStyles = {
|
|
688
688
|
block: "block",
|
|
@@ -704,7 +704,7 @@ var positionStyles = {
|
|
|
704
704
|
fixed: "fixed",
|
|
705
705
|
sticky: "sticky"
|
|
706
706
|
};
|
|
707
|
-
var Box =
|
|
707
|
+
var Box = React112__namespace.default.forwardRef(
|
|
708
708
|
({
|
|
709
709
|
padding,
|
|
710
710
|
paddingX,
|
|
@@ -733,20 +733,20 @@ var Box = React110__namespace.default.forwardRef(
|
|
|
733
733
|
...rest
|
|
734
734
|
}, ref) => {
|
|
735
735
|
const eventBus = useEventBus();
|
|
736
|
-
const handleClick =
|
|
736
|
+
const handleClick = React112.useCallback((e) => {
|
|
737
737
|
if (action) {
|
|
738
738
|
e.stopPropagation();
|
|
739
739
|
eventBus.emit(`UI:${action}`, actionPayload ?? {});
|
|
740
740
|
}
|
|
741
741
|
onClick?.(e);
|
|
742
742
|
}, [action, actionPayload, eventBus, onClick]);
|
|
743
|
-
const handleMouseEnter =
|
|
743
|
+
const handleMouseEnter = React112.useCallback((e) => {
|
|
744
744
|
if (hoverEvent) {
|
|
745
745
|
eventBus.emit(`UI:${hoverEvent}`, { hovered: true });
|
|
746
746
|
}
|
|
747
747
|
onMouseEnter?.(e);
|
|
748
748
|
}, [hoverEvent, eventBus, onMouseEnter]);
|
|
749
|
-
const handleMouseLeave =
|
|
749
|
+
const handleMouseLeave = React112.useCallback((e) => {
|
|
750
750
|
if (hoverEvent) {
|
|
751
751
|
eventBus.emit(`UI:${hoverEvent}`, { hovered: false });
|
|
752
752
|
}
|
|
@@ -770,7 +770,7 @@ var Box = React110__namespace.default.forwardRef(
|
|
|
770
770
|
// Background
|
|
771
771
|
bgStyles[bg],
|
|
772
772
|
// Border - uses theme variables
|
|
773
|
-
border && "border-[length:var(--border-width)] border-
|
|
773
|
+
border && "border-[length:var(--border-width)] border-border",
|
|
774
774
|
// Rounded
|
|
775
775
|
roundedStyles[rounded],
|
|
776
776
|
// Shadow
|
|
@@ -799,30 +799,30 @@ var Box = React110__namespace.default.forwardRef(
|
|
|
799
799
|
);
|
|
800
800
|
Box.displayName = "Box";
|
|
801
801
|
var variantStyles = {
|
|
802
|
-
h1: "text-4xl font-bold tracking-tight text-
|
|
803
|
-
h2: "text-3xl font-bold tracking-tight text-
|
|
804
|
-
h3: "text-2xl font-bold text-
|
|
805
|
-
h4: "text-xl font-bold text-
|
|
806
|
-
h5: "text-lg font-bold text-
|
|
807
|
-
h6: "text-base font-bold text-
|
|
808
|
-
heading: "text-2xl font-bold text-
|
|
809
|
-
subheading: "text-lg font-semibold text-
|
|
810
|
-
body1: "text-base font-normal text-
|
|
811
|
-
body2: "text-sm font-normal text-
|
|
812
|
-
body: "text-base font-normal text-
|
|
813
|
-
caption: "text-xs font-normal text-
|
|
814
|
-
overline: "text-xs uppercase tracking-wide font-bold text-
|
|
815
|
-
small: "text-sm font-normal text-
|
|
816
|
-
large: "text-lg font-medium text-
|
|
817
|
-
label: "text-sm font-medium text-
|
|
802
|
+
h1: "text-4xl font-bold tracking-tight text-foreground",
|
|
803
|
+
h2: "text-3xl font-bold tracking-tight text-foreground",
|
|
804
|
+
h3: "text-2xl font-bold text-foreground",
|
|
805
|
+
h4: "text-xl font-bold text-foreground",
|
|
806
|
+
h5: "text-lg font-bold text-foreground",
|
|
807
|
+
h6: "text-base font-bold text-foreground",
|
|
808
|
+
heading: "text-2xl font-bold text-foreground",
|
|
809
|
+
subheading: "text-lg font-semibold text-foreground",
|
|
810
|
+
body1: "text-base font-normal text-foreground",
|
|
811
|
+
body2: "text-sm font-normal text-foreground",
|
|
812
|
+
body: "text-base font-normal text-foreground",
|
|
813
|
+
caption: "text-xs font-normal text-muted-foreground",
|
|
814
|
+
overline: "text-xs uppercase tracking-wide font-bold text-muted-foreground",
|
|
815
|
+
small: "text-sm font-normal text-foreground",
|
|
816
|
+
large: "text-lg font-medium text-foreground",
|
|
817
|
+
label: "text-sm font-medium text-foreground"
|
|
818
818
|
};
|
|
819
819
|
var colorStyles = {
|
|
820
|
-
primary: "text-
|
|
821
|
-
secondary: "text-
|
|
822
|
-
muted: "text-
|
|
823
|
-
error: "text-
|
|
824
|
-
success: "text-
|
|
825
|
-
warning: "text-
|
|
820
|
+
primary: "text-foreground",
|
|
821
|
+
secondary: "text-muted-foreground",
|
|
822
|
+
muted: "text-muted-foreground",
|
|
823
|
+
error: "text-error",
|
|
824
|
+
success: "text-success",
|
|
825
|
+
warning: "text-warning",
|
|
826
826
|
inherit: "text-inherit"
|
|
827
827
|
};
|
|
828
828
|
var weightStyles = {
|
|
@@ -907,49 +907,50 @@ var Typography = ({
|
|
|
907
907
|
Typography.displayName = "Typography";
|
|
908
908
|
var variantStyles2 = {
|
|
909
909
|
primary: [
|
|
910
|
-
"bg-
|
|
910
|
+
"bg-primary text-primary-foreground",
|
|
911
911
|
"border-none",
|
|
912
|
-
"shadow-
|
|
913
|
-
"hover:bg-
|
|
914
|
-
"active:scale-[var(--active-scale)] active:shadow-
|
|
912
|
+
"shadow-sm",
|
|
913
|
+
"hover:bg-primary-hover hover:shadow-lg",
|
|
914
|
+
"active:scale-[var(--active-scale)] active:shadow-sm"
|
|
915
915
|
].join(" "),
|
|
916
916
|
secondary: [
|
|
917
|
-
"bg-
|
|
918
|
-
"border-
|
|
919
|
-
"hover:bg-
|
|
917
|
+
"bg-transparent text-accent",
|
|
918
|
+
"border border-accent",
|
|
919
|
+
"hover:bg-accent hover:text-white hover:border-accent",
|
|
920
920
|
"active:scale-[var(--active-scale)]"
|
|
921
921
|
].join(" "),
|
|
922
922
|
ghost: [
|
|
923
|
-
"bg-transparent text-
|
|
924
|
-
"
|
|
923
|
+
"bg-transparent text-muted-foreground",
|
|
924
|
+
"border border-transparent",
|
|
925
|
+
"hover:text-primary-foreground hover:bg-primary hover:border-primary",
|
|
925
926
|
"active:scale-[var(--active-scale)]"
|
|
926
927
|
].join(" "),
|
|
927
928
|
danger: [
|
|
928
|
-
"bg-
|
|
929
|
-
"border-[length:var(--border-width)] border-
|
|
930
|
-
"shadow-
|
|
931
|
-
"hover:bg-
|
|
932
|
-
"active:scale-[var(--active-scale)] active:shadow-
|
|
929
|
+
"bg-surface text-error",
|
|
930
|
+
"border-[length:var(--border-width)] border-error",
|
|
931
|
+
"shadow-sm",
|
|
932
|
+
"hover:bg-error hover:text-error-foreground hover:shadow-lg",
|
|
933
|
+
"active:scale-[var(--active-scale)] active:shadow-sm"
|
|
933
934
|
].join(" "),
|
|
934
935
|
success: [
|
|
935
|
-
"bg-
|
|
936
|
-
"border-[length:var(--border-width)] border-
|
|
937
|
-
"shadow-
|
|
938
|
-
"hover:bg-
|
|
939
|
-
"active:scale-[var(--active-scale)] active:shadow-
|
|
936
|
+
"bg-surface text-success",
|
|
937
|
+
"border-[length:var(--border-width)] border-success",
|
|
938
|
+
"shadow-sm",
|
|
939
|
+
"hover:bg-success hover:text-success-foreground hover:shadow-lg",
|
|
940
|
+
"active:scale-[var(--active-scale)] active:shadow-sm"
|
|
940
941
|
].join(" "),
|
|
941
942
|
warning: [
|
|
942
|
-
"bg-
|
|
943
|
-
"border-[length:var(--border-width)] border-
|
|
944
|
-
"shadow-
|
|
945
|
-
"hover:bg-
|
|
946
|
-
"active:scale-[var(--active-scale)] active:shadow-
|
|
943
|
+
"bg-surface text-warning",
|
|
944
|
+
"border-[length:var(--border-width)] border-warning",
|
|
945
|
+
"shadow-sm",
|
|
946
|
+
"hover:bg-warning hover:text-warning-foreground hover:shadow-lg",
|
|
947
|
+
"active:scale-[var(--active-scale)] active:shadow-sm"
|
|
947
948
|
].join(" "),
|
|
948
949
|
// "default" is an alias for secondary
|
|
949
950
|
default: [
|
|
950
|
-
"bg-
|
|
951
|
-
"border-[length:var(--border-width-thin)] border-
|
|
952
|
-
"hover:bg-
|
|
951
|
+
"bg-secondary text-secondary-foreground",
|
|
952
|
+
"border-[length:var(--border-width-thin)] border-border",
|
|
953
|
+
"hover:bg-secondary-hover",
|
|
953
954
|
"active:scale-[var(--active-scale)]"
|
|
954
955
|
].join(" ")
|
|
955
956
|
};
|
|
@@ -974,7 +975,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
974
975
|
const IconComp = value;
|
|
975
976
|
return /* @__PURE__ */ jsxRuntime.jsx(IconComp, { className: sizeClass });
|
|
976
977
|
}
|
|
977
|
-
if (
|
|
978
|
+
if (React112__namespace.default.isValidElement(value)) {
|
|
978
979
|
return value;
|
|
979
980
|
}
|
|
980
981
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -983,7 +984,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
983
984
|
}
|
|
984
985
|
return value;
|
|
985
986
|
}
|
|
986
|
-
var Button =
|
|
987
|
+
var Button = React112__namespace.default.forwardRef(
|
|
987
988
|
({
|
|
988
989
|
className,
|
|
989
990
|
variant = "primary",
|
|
@@ -1020,9 +1021,10 @@ var Button = React110__namespace.default.forwardRef(
|
|
|
1020
1021
|
className: cn(
|
|
1021
1022
|
"inline-flex items-center justify-center gap-2",
|
|
1022
1023
|
"font-[var(--font-weight-medium)]",
|
|
1023
|
-
"rounded-
|
|
1024
|
+
"rounded-sm",
|
|
1025
|
+
"cursor-pointer",
|
|
1024
1026
|
"transition-all duration-[var(--transition-normal)]",
|
|
1025
|
-
"focus:outline-none focus:ring-[length:var(--focus-ring-width)] focus:ring-
|
|
1027
|
+
"focus:outline-none focus:ring-[length:var(--focus-ring-width)] focus:ring-ring focus:ring-offset-[length:var(--focus-ring-offset)]",
|
|
1026
1028
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1027
1029
|
variantStyles2[variant],
|
|
1028
1030
|
sizeStyles2[size],
|
|
@@ -1043,34 +1045,34 @@ var Button = React110__namespace.default.forwardRef(
|
|
|
1043
1045
|
Button.displayName = "Button";
|
|
1044
1046
|
var variantStyles3 = {
|
|
1045
1047
|
default: [
|
|
1046
|
-
"bg-
|
|
1047
|
-
"border-[length:var(--border-width-thin)] border-
|
|
1048
|
+
"bg-muted text-foreground",
|
|
1049
|
+
"border-[length:var(--border-width-thin)] border-border"
|
|
1048
1050
|
].join(" "),
|
|
1049
|
-
primary: "bg-
|
|
1050
|
-
secondary: "bg-
|
|
1051
|
+
primary: "bg-primary text-primary-foreground",
|
|
1052
|
+
secondary: "bg-secondary text-secondary-foreground",
|
|
1051
1053
|
success: [
|
|
1052
|
-
"bg-
|
|
1053
|
-
"border-[length:var(--border-width)] border-
|
|
1054
|
+
"bg-surface text-success",
|
|
1055
|
+
"border-[length:var(--border-width)] border-success"
|
|
1054
1056
|
].join(" "),
|
|
1055
1057
|
warning: [
|
|
1056
|
-
"bg-
|
|
1057
|
-
"border-[length:var(--border-width)] border-
|
|
1058
|
+
"bg-surface text-warning",
|
|
1059
|
+
"border-[length:var(--border-width)] border-warning"
|
|
1058
1060
|
].join(" "),
|
|
1059
1061
|
danger: [
|
|
1060
|
-
"bg-
|
|
1061
|
-
"border-[length:var(--border-width)] border-
|
|
1062
|
+
"bg-surface text-error",
|
|
1063
|
+
"border-[length:var(--border-width)] border-error"
|
|
1062
1064
|
].join(" "),
|
|
1063
1065
|
error: [
|
|
1064
|
-
"bg-
|
|
1065
|
-
"border-[length:var(--border-width)] border-
|
|
1066
|
+
"bg-surface text-error",
|
|
1067
|
+
"border-[length:var(--border-width)] border-error"
|
|
1066
1068
|
].join(" "),
|
|
1067
1069
|
info: [
|
|
1068
|
-
"bg-
|
|
1069
|
-
"border-[length:var(--border-width)] border-
|
|
1070
|
+
"bg-surface text-info",
|
|
1071
|
+
"border-[length:var(--border-width)] border-info"
|
|
1070
1072
|
].join(" "),
|
|
1071
1073
|
neutral: [
|
|
1072
|
-
"bg-
|
|
1073
|
-
"border-[length:var(--border-width-thin)] border-
|
|
1074
|
+
"bg-muted text-muted-foreground",
|
|
1075
|
+
"border-[length:var(--border-width-thin)] border-border"
|
|
1074
1076
|
].join(" ")
|
|
1075
1077
|
};
|
|
1076
1078
|
var sizeStyles3 = {
|
|
@@ -1078,7 +1080,7 @@ var sizeStyles3 = {
|
|
|
1078
1080
|
md: "px-2.5 py-1 text-sm",
|
|
1079
1081
|
lg: "px-3 py-1.5 text-base"
|
|
1080
1082
|
};
|
|
1081
|
-
var Badge =
|
|
1083
|
+
var Badge = React112__namespace.default.forwardRef(
|
|
1082
1084
|
({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
|
|
1083
1085
|
const iconSizes2 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
|
|
1084
1086
|
const resolvedIcon = typeof icon === "string" ? (() => {
|
|
@@ -1090,7 +1092,7 @@ var Badge = React110__namespace.default.forwardRef(
|
|
|
1090
1092
|
{
|
|
1091
1093
|
ref,
|
|
1092
1094
|
className: cn(
|
|
1093
|
-
"inline-flex items-center gap-1 font-bold rounded-
|
|
1095
|
+
"inline-flex items-center gap-1 font-bold rounded-sm",
|
|
1094
1096
|
variantStyles3[variant],
|
|
1095
1097
|
sizeStyles3[size],
|
|
1096
1098
|
className
|
|
@@ -1105,7 +1107,7 @@ var Badge = React110__namespace.default.forwardRef(
|
|
|
1105
1107
|
}
|
|
1106
1108
|
);
|
|
1107
1109
|
Badge.displayName = "Badge";
|
|
1108
|
-
var Input =
|
|
1110
|
+
var Input = React112__namespace.default.forwardRef(
|
|
1109
1111
|
({
|
|
1110
1112
|
className,
|
|
1111
1113
|
inputType,
|
|
@@ -1126,21 +1128,21 @@ var Input = React110__namespace.default.forwardRef(
|
|
|
1126
1128
|
const resolvedLeftIcon = leftIcon || IconComponent && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, { className: "h-4 w-4" });
|
|
1127
1129
|
const showClearButton = clearable && value && String(value).length > 0;
|
|
1128
1130
|
const baseClassName = cn(
|
|
1129
|
-
"block w-full rounded-
|
|
1130
|
-
"border-[length:var(--border-width-thin)] border-
|
|
1131
|
+
"block w-full rounded-sm transition-all duration-[var(--transition-fast)]",
|
|
1132
|
+
"border-[length:var(--border-width-thin)] border-border",
|
|
1131
1133
|
"px-3 py-2 text-sm",
|
|
1132
|
-
"bg-
|
|
1133
|
-
"text-
|
|
1134
|
-
"focus:outline-none focus:ring-1 focus:ring-
|
|
1135
|
-
"disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-
|
|
1136
|
-
error ? "border-
|
|
1134
|
+
"bg-card hover:bg-muted focus:bg-card",
|
|
1135
|
+
"text-foreground placeholder:text-muted-foreground",
|
|
1136
|
+
"focus:outline-none focus:ring-1 focus:ring-ring focus:border-ring",
|
|
1137
|
+
"disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-muted",
|
|
1138
|
+
error ? "border-error focus:border-error focus:ring-error" : "",
|
|
1137
1139
|
resolvedLeftIcon && "pl-10",
|
|
1138
1140
|
(rightIcon || showClearButton) && "pr-10",
|
|
1139
1141
|
className
|
|
1140
1142
|
);
|
|
1141
1143
|
if (type === "select") {
|
|
1142
1144
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
1143
|
-
resolvedLeftIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-
|
|
1145
|
+
resolvedLeftIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-muted-foreground", children: resolvedLeftIcon }),
|
|
1144
1146
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1145
1147
|
"select",
|
|
1146
1148
|
{
|
|
@@ -1155,7 +1157,7 @@ var Input = React110__namespace.default.forwardRef(
|
|
|
1155
1157
|
]
|
|
1156
1158
|
}
|
|
1157
1159
|
),
|
|
1158
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none text-
|
|
1160
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none text-muted-foreground", children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.ChevronDown, { className: "h-4 w-4" }) })
|
|
1159
1161
|
] });
|
|
1160
1162
|
}
|
|
1161
1163
|
if (type === "textarea") {
|
|
@@ -1180,9 +1182,9 @@ var Input = React110__namespace.default.forwardRef(
|
|
|
1180
1182
|
checked: props.checked,
|
|
1181
1183
|
onChange,
|
|
1182
1184
|
className: cn(
|
|
1183
|
-
"h-4 w-4 rounded-
|
|
1184
|
-
"border-
|
|
1185
|
-
"text-
|
|
1185
|
+
"h-4 w-4 rounded-sm",
|
|
1186
|
+
"border-border",
|
|
1187
|
+
"text-primary focus:ring-ring",
|
|
1186
1188
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1187
1189
|
className
|
|
1188
1190
|
),
|
|
@@ -1191,7 +1193,7 @@ var Input = React110__namespace.default.forwardRef(
|
|
|
1191
1193
|
);
|
|
1192
1194
|
}
|
|
1193
1195
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
1194
|
-
resolvedLeftIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-
|
|
1196
|
+
resolvedLeftIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-muted-foreground", children: resolvedLeftIcon }),
|
|
1195
1197
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1196
1198
|
"input",
|
|
1197
1199
|
{
|
|
@@ -1208,50 +1210,50 @@ var Input = React110__namespace.default.forwardRef(
|
|
|
1208
1210
|
{
|
|
1209
1211
|
type: "button",
|
|
1210
1212
|
onClick: onClear,
|
|
1211
|
-
className: "absolute inset-y-0 right-0 pr-3 flex items-center text-
|
|
1213
|
+
className: "absolute inset-y-0 right-0 pr-3 flex items-center text-muted-foreground hover:text-foreground",
|
|
1212
1214
|
children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.X, { className: "h-4 w-4" })
|
|
1213
1215
|
}
|
|
1214
1216
|
),
|
|
1215
|
-
rightIcon && !showClearButton && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center text-
|
|
1217
|
+
rightIcon && !showClearButton && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center text-muted-foreground", children: rightIcon })
|
|
1216
1218
|
] });
|
|
1217
1219
|
}
|
|
1218
1220
|
);
|
|
1219
1221
|
Input.displayName = "Input";
|
|
1220
|
-
var Label =
|
|
1222
|
+
var Label = React112__namespace.default.forwardRef(
|
|
1221
1223
|
({ className, required, children, ...props }, ref) => {
|
|
1222
1224
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1223
1225
|
"label",
|
|
1224
1226
|
{
|
|
1225
1227
|
ref,
|
|
1226
1228
|
className: cn(
|
|
1227
|
-
"block text-sm font-bold text-
|
|
1229
|
+
"block text-sm font-bold text-foreground",
|
|
1228
1230
|
className
|
|
1229
1231
|
),
|
|
1230
1232
|
...props,
|
|
1231
1233
|
children: [
|
|
1232
1234
|
children,
|
|
1233
|
-
required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-
|
|
1235
|
+
required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-error ml-1", children: "*" })
|
|
1234
1236
|
]
|
|
1235
1237
|
}
|
|
1236
1238
|
);
|
|
1237
1239
|
}
|
|
1238
1240
|
);
|
|
1239
1241
|
Label.displayName = "Label";
|
|
1240
|
-
var Textarea =
|
|
1242
|
+
var Textarea = React112__namespace.default.forwardRef(
|
|
1241
1243
|
({ className, error, ...props }, ref) => {
|
|
1242
1244
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1243
1245
|
"textarea",
|
|
1244
1246
|
{
|
|
1245
1247
|
ref,
|
|
1246
1248
|
className: cn(
|
|
1247
|
-
"block w-full border-[length:var(--border-width)] shadow-
|
|
1248
|
-
"px-3 py-2 text-sm text-
|
|
1249
|
-
"bg-
|
|
1249
|
+
"block w-full border-[length:var(--border-width)] shadow-sm",
|
|
1250
|
+
"px-3 py-2 text-sm text-foreground",
|
|
1251
|
+
"bg-card",
|
|
1250
1252
|
"placeholder:text-[var(--color-placeholder)]",
|
|
1251
|
-
"focus:outline-none focus:ring-2 focus:ring-offset-0 focus:ring-
|
|
1252
|
-
"disabled:bg-
|
|
1253
|
+
"focus:outline-none focus:ring-2 focus:ring-offset-0 focus:ring-ring",
|
|
1254
|
+
"disabled:bg-muted disabled:text-muted-foreground disabled:cursor-not-allowed",
|
|
1253
1255
|
"resize-y min-h-[80px]",
|
|
1254
|
-
error ? "border-
|
|
1256
|
+
error ? "border-error focus:border-error" : "border-border focus:border-primary",
|
|
1255
1257
|
className
|
|
1256
1258
|
),
|
|
1257
1259
|
...props
|
|
@@ -1260,7 +1262,7 @@ var Textarea = React110__namespace.default.forwardRef(
|
|
|
1260
1262
|
}
|
|
1261
1263
|
);
|
|
1262
1264
|
Textarea.displayName = "Textarea";
|
|
1263
|
-
var Select =
|
|
1265
|
+
var Select = React112__namespace.default.forwardRef(
|
|
1264
1266
|
({ className, options, placeholder, error, ...props }, ref) => {
|
|
1265
1267
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
1266
1268
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1268,12 +1270,12 @@ var Select = React110__namespace.default.forwardRef(
|
|
|
1268
1270
|
{
|
|
1269
1271
|
ref,
|
|
1270
1272
|
className: cn(
|
|
1271
|
-
"block w-full border-[length:var(--border-width)] shadow-
|
|
1272
|
-
"px-3 py-2 pr-10 text-sm text-
|
|
1273
|
-
"bg-
|
|
1274
|
-
"focus:outline-none focus:ring-2 focus:ring-offset-0 focus:ring-
|
|
1275
|
-
"disabled:bg-
|
|
1276
|
-
error ? "border-
|
|
1273
|
+
"block w-full border-[length:var(--border-width)] shadow-sm appearance-none",
|
|
1274
|
+
"px-3 py-2 pr-10 text-sm text-foreground font-medium",
|
|
1275
|
+
"bg-card",
|
|
1276
|
+
"focus:outline-none focus:ring-2 focus:ring-offset-0 focus:ring-ring",
|
|
1277
|
+
"disabled:bg-muted disabled:text-muted-foreground disabled:cursor-not-allowed",
|
|
1278
|
+
error ? "border-error focus:border-error" : "border-border focus:border-primary",
|
|
1277
1279
|
className
|
|
1278
1280
|
),
|
|
1279
1281
|
...props,
|
|
@@ -1291,12 +1293,12 @@ var Select = React110__namespace.default.forwardRef(
|
|
|
1291
1293
|
]
|
|
1292
1294
|
}
|
|
1293
1295
|
),
|
|
1294
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none", children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.ChevronDown, { className: "h-4 w-4 text-
|
|
1296
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none", children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.ChevronDown, { className: "h-4 w-4 text-foreground" }) })
|
|
1295
1297
|
] });
|
|
1296
1298
|
}
|
|
1297
1299
|
);
|
|
1298
1300
|
Select.displayName = "Select";
|
|
1299
|
-
var Checkbox =
|
|
1301
|
+
var Checkbox = React112__namespace.default.forwardRef(
|
|
1300
1302
|
({ className, label, id, ...props }, ref) => {
|
|
1301
1303
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
1302
1304
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center", children: [
|
|
@@ -1307,9 +1309,9 @@ var Checkbox = React110__namespace.default.forwardRef(
|
|
|
1307
1309
|
type: "checkbox",
|
|
1308
1310
|
id: inputId,
|
|
1309
1311
|
className: cn(
|
|
1310
|
-
"peer h-4 w-4 border-[length:var(--border-width)] border-
|
|
1311
|
-
"accent-
|
|
1312
|
-
"bg-
|
|
1312
|
+
"peer h-4 w-4 border-[length:var(--border-width)] border-border",
|
|
1313
|
+
"accent-primary focus:ring-ring focus:ring-offset-0",
|
|
1314
|
+
"bg-card checked:bg-primary",
|
|
1313
1315
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1314
1316
|
className
|
|
1315
1317
|
),
|
|
@@ -1320,7 +1322,7 @@ var Checkbox = React110__namespace.default.forwardRef(
|
|
|
1320
1322
|
"label",
|
|
1321
1323
|
{
|
|
1322
1324
|
htmlFor: inputId,
|
|
1323
|
-
className: "ml-2 text-sm text-
|
|
1325
|
+
className: "ml-2 text-sm text-foreground font-medium cursor-pointer select-none",
|
|
1324
1326
|
children: label
|
|
1325
1327
|
}
|
|
1326
1328
|
)
|
|
@@ -1330,34 +1332,34 @@ var Checkbox = React110__namespace.default.forwardRef(
|
|
|
1330
1332
|
Checkbox.displayName = "Checkbox";
|
|
1331
1333
|
var variantStyles4 = {
|
|
1332
1334
|
default: [
|
|
1333
|
-
"bg-
|
|
1334
|
-
"border-[length:var(--border-width)] border-
|
|
1335
|
-
"shadow-
|
|
1335
|
+
"bg-card",
|
|
1336
|
+
"border-[length:var(--border-width)] border-border",
|
|
1337
|
+
"shadow-sm",
|
|
1336
1338
|
"transition-all duration-[var(--transition-normal)]",
|
|
1337
|
-
"hover:shadow-
|
|
1339
|
+
"hover:shadow-lg hover:-translate-y-0.5"
|
|
1338
1340
|
].join(" "),
|
|
1339
1341
|
bordered: [
|
|
1340
|
-
"bg-
|
|
1341
|
-
"border-[length:var(--border-width)] border-
|
|
1342
|
-
"shadow-
|
|
1342
|
+
"bg-card",
|
|
1343
|
+
"border-[length:var(--border-width)] border-border",
|
|
1344
|
+
"shadow-sm",
|
|
1343
1345
|
"transition-all duration-[var(--transition-normal)]",
|
|
1344
|
-
"hover:shadow-
|
|
1346
|
+
"hover:shadow-lg hover:-translate-y-0.5"
|
|
1345
1347
|
].join(" "),
|
|
1346
1348
|
elevated: [
|
|
1347
|
-
"bg-
|
|
1348
|
-
"border-[length:var(--border-width)] border-
|
|
1349
|
-
"shadow
|
|
1349
|
+
"bg-card",
|
|
1350
|
+
"border-[length:var(--border-width)] border-border",
|
|
1351
|
+
"shadow",
|
|
1350
1352
|
"transition-all duration-[var(--transition-normal)]",
|
|
1351
|
-
"hover:shadow-
|
|
1353
|
+
"hover:shadow-lg hover:-translate-y-0.5"
|
|
1352
1354
|
].join(" "),
|
|
1353
1355
|
// Interactive variant with theme-specific hover effects
|
|
1354
1356
|
interactive: [
|
|
1355
|
-
"bg-
|
|
1356
|
-
"border-[length:var(--border-width)] border-
|
|
1357
|
-
"shadow
|
|
1357
|
+
"bg-card",
|
|
1358
|
+
"border-[length:var(--border-width)] border-border",
|
|
1359
|
+
"shadow",
|
|
1358
1360
|
"cursor-pointer",
|
|
1359
1361
|
"transition-all duration-[var(--transition-normal)]",
|
|
1360
|
-
"hover:shadow-
|
|
1362
|
+
"hover:shadow-lg"
|
|
1361
1363
|
].join(" ")
|
|
1362
1364
|
};
|
|
1363
1365
|
var paddingStyles2 = {
|
|
@@ -1368,11 +1370,11 @@ var paddingStyles2 = {
|
|
|
1368
1370
|
};
|
|
1369
1371
|
var shadowStyles2 = {
|
|
1370
1372
|
none: "shadow-none",
|
|
1371
|
-
sm: "shadow-
|
|
1372
|
-
md: "shadow
|
|
1373
|
-
lg: "shadow-
|
|
1373
|
+
sm: "shadow-sm",
|
|
1374
|
+
md: "shadow",
|
|
1375
|
+
lg: "shadow-lg"
|
|
1374
1376
|
};
|
|
1375
|
-
var Card =
|
|
1377
|
+
var Card = React112__namespace.default.forwardRef(
|
|
1376
1378
|
({
|
|
1377
1379
|
className,
|
|
1378
1380
|
variant = "bordered",
|
|
@@ -1388,7 +1390,7 @@ var Card = React110__namespace.default.forwardRef(
|
|
|
1388
1390
|
{
|
|
1389
1391
|
ref,
|
|
1390
1392
|
className: cn(
|
|
1391
|
-
"rounded-
|
|
1393
|
+
"rounded-md",
|
|
1392
1394
|
"transition-all duration-[var(--transition-normal)]",
|
|
1393
1395
|
variantStyles4[variant],
|
|
1394
1396
|
paddingStyles2[padding],
|
|
@@ -1398,8 +1400,8 @@ var Card = React110__namespace.default.forwardRef(
|
|
|
1398
1400
|
...props,
|
|
1399
1401
|
children: [
|
|
1400
1402
|
(title || subtitle) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-4", children: [
|
|
1401
|
-
title && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg text-
|
|
1402
|
-
subtitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-
|
|
1403
|
+
title && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg text-card-foreground font-[var(--font-weight-bold)]", children: title }),
|
|
1404
|
+
subtitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground mt-1", children: subtitle })
|
|
1403
1405
|
] }),
|
|
1404
1406
|
children
|
|
1405
1407
|
]
|
|
@@ -1408,14 +1410,14 @@ var Card = React110__namespace.default.forwardRef(
|
|
|
1408
1410
|
}
|
|
1409
1411
|
);
|
|
1410
1412
|
Card.displayName = "Card";
|
|
1411
|
-
var CardHeader =
|
|
1413
|
+
var CardHeader = React112__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
1412
1414
|
CardHeader.displayName = "CardHeader";
|
|
1413
|
-
var CardTitle =
|
|
1415
|
+
var CardTitle = React112__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1414
1416
|
"h3",
|
|
1415
1417
|
{
|
|
1416
1418
|
ref,
|
|
1417
1419
|
className: cn(
|
|
1418
|
-
"text-lg text-
|
|
1420
|
+
"text-lg text-card-foreground",
|
|
1419
1421
|
"font-[var(--font-weight-bold)]",
|
|
1420
1422
|
className
|
|
1421
1423
|
),
|
|
@@ -1423,11 +1425,11 @@ var CardTitle = React110__namespace.default.forwardRef(({ className, ...props },
|
|
|
1423
1425
|
}
|
|
1424
1426
|
));
|
|
1425
1427
|
CardTitle.displayName = "CardTitle";
|
|
1426
|
-
var CardContent =
|
|
1428
|
+
var CardContent = React112__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("", className), ...props }));
|
|
1427
1429
|
CardContent.displayName = "CardContent";
|
|
1428
1430
|
var CardBody = CardContent;
|
|
1429
1431
|
CardBody.displayName = "CardBody";
|
|
1430
|
-
var CardFooter =
|
|
1432
|
+
var CardFooter = React112__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1431
1433
|
"div",
|
|
1432
1434
|
{
|
|
1433
1435
|
ref,
|
|
@@ -1442,13 +1444,13 @@ var sizeStyles4 = {
|
|
|
1442
1444
|
md: "h-6 w-6",
|
|
1443
1445
|
lg: "h-8 w-8"
|
|
1444
1446
|
};
|
|
1445
|
-
var Spinner =
|
|
1447
|
+
var Spinner = React112__namespace.default.forwardRef(
|
|
1446
1448
|
({ className, size = "md", ...props }, ref) => {
|
|
1447
1449
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1448
1450
|
"div",
|
|
1449
1451
|
{
|
|
1450
1452
|
ref,
|
|
1451
|
-
className: cn("text-
|
|
1453
|
+
className: cn("text-foreground", className),
|
|
1452
1454
|
...props,
|
|
1453
1455
|
children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.Loader2, { className: cn("animate-spin", sizeStyles4[size]) })
|
|
1454
1456
|
}
|
|
@@ -1456,7 +1458,7 @@ var Spinner = React110__namespace.default.forwardRef(
|
|
|
1456
1458
|
}
|
|
1457
1459
|
);
|
|
1458
1460
|
Spinner.displayName = "Spinner";
|
|
1459
|
-
var Radio =
|
|
1461
|
+
var Radio = React112__namespace.default.forwardRef(
|
|
1460
1462
|
({
|
|
1461
1463
|
label,
|
|
1462
1464
|
helperText,
|
|
@@ -1505,8 +1507,8 @@ var Radio = React110__namespace.default.forwardRef(
|
|
|
1505
1507
|
"flex items-center justify-center",
|
|
1506
1508
|
"border-[length:var(--border-width)] transition-all cursor-pointer",
|
|
1507
1509
|
sizeClasses6[size],
|
|
1508
|
-
hasError ? "border-
|
|
1509
|
-
checked ? hasError ? "border-
|
|
1510
|
+
hasError ? "border-error peer-focus:ring-error/20" : "border-border peer-focus:ring-ring/20",
|
|
1511
|
+
checked ? hasError ? "border-error" : "border-primary bg-primary" : "",
|
|
1510
1512
|
"peer-focus:outline-none peer-focus:ring-2 peer-focus:ring-offset-2",
|
|
1511
1513
|
disabled && "opacity-50 cursor-not-allowed",
|
|
1512
1514
|
!disabled && "hover:border-[var(--color-border-hover)]"
|
|
@@ -1517,7 +1519,7 @@ var Radio = React110__namespace.default.forwardRef(
|
|
|
1517
1519
|
className: cn(
|
|
1518
1520
|
"transition-all",
|
|
1519
1521
|
dotSizeClasses[size],
|
|
1520
|
-
hasError ? "bg-
|
|
1522
|
+
hasError ? "bg-error" : "bg-primary-foreground"
|
|
1521
1523
|
)
|
|
1522
1524
|
}
|
|
1523
1525
|
)
|
|
@@ -1530,7 +1532,7 @@ var Radio = React110__namespace.default.forwardRef(
|
|
|
1530
1532
|
htmlFor: radioId,
|
|
1531
1533
|
className: cn(
|
|
1532
1534
|
"block text-sm font-medium cursor-pointer select-none",
|
|
1533
|
-
hasError ? "text-
|
|
1535
|
+
hasError ? "text-error" : "text-foreground",
|
|
1534
1536
|
disabled && "opacity-50 cursor-not-allowed"
|
|
1535
1537
|
),
|
|
1536
1538
|
children: label
|
|
@@ -1542,7 +1544,7 @@ var Radio = React110__namespace.default.forwardRef(
|
|
|
1542
1544
|
"p",
|
|
1543
1545
|
{
|
|
1544
1546
|
id: `${radioId}-error`,
|
|
1545
|
-
className: "text-sm text-
|
|
1547
|
+
className: "text-sm text-error font-medium",
|
|
1546
1548
|
role: "alert",
|
|
1547
1549
|
children: error
|
|
1548
1550
|
}
|
|
@@ -1551,7 +1553,7 @@ var Radio = React110__namespace.default.forwardRef(
|
|
|
1551
1553
|
"p",
|
|
1552
1554
|
{
|
|
1553
1555
|
id: `${radioId}-helper`,
|
|
1554
|
-
className: "text-sm text-
|
|
1556
|
+
className: "text-sm text-muted-foreground",
|
|
1555
1557
|
children: helperText
|
|
1556
1558
|
}
|
|
1557
1559
|
)
|
|
@@ -1560,7 +1562,7 @@ var Radio = React110__namespace.default.forwardRef(
|
|
|
1560
1562
|
}
|
|
1561
1563
|
);
|
|
1562
1564
|
Radio.displayName = "Radio";
|
|
1563
|
-
var Switch =
|
|
1565
|
+
var Switch = React112__namespace.forwardRef(
|
|
1564
1566
|
({
|
|
1565
1567
|
checked,
|
|
1566
1568
|
defaultChecked = false,
|
|
@@ -1571,10 +1573,10 @@ var Switch = React110__namespace.forwardRef(
|
|
|
1571
1573
|
name,
|
|
1572
1574
|
className
|
|
1573
1575
|
}, ref) => {
|
|
1574
|
-
const [isChecked, setIsChecked] =
|
|
1576
|
+
const [isChecked, setIsChecked] = React112__namespace.useState(
|
|
1575
1577
|
checked !== void 0 ? checked : defaultChecked
|
|
1576
1578
|
);
|
|
1577
|
-
|
|
1579
|
+
React112__namespace.useEffect(() => {
|
|
1578
1580
|
if (checked !== void 0) {
|
|
1579
1581
|
setIsChecked(checked);
|
|
1580
1582
|
}
|
|
@@ -1712,27 +1714,27 @@ var Stack = ({
|
|
|
1712
1714
|
var VStack = (props) => /* @__PURE__ */ jsxRuntime.jsx(Stack, { direction: "vertical", ...props });
|
|
1713
1715
|
var HStack = (props) => /* @__PURE__ */ jsxRuntime.jsx(Stack, { direction: "horizontal", ...props });
|
|
1714
1716
|
var statusColors = {
|
|
1715
|
-
online: "bg-
|
|
1716
|
-
offline: "bg-
|
|
1717
|
-
away: "bg-
|
|
1718
|
-
busy: "bg-
|
|
1719
|
-
warning: "bg-
|
|
1720
|
-
critical: "bg-
|
|
1717
|
+
online: "bg-success",
|
|
1718
|
+
offline: "bg-muted-foreground",
|
|
1719
|
+
away: "bg-warning",
|
|
1720
|
+
busy: "bg-error",
|
|
1721
|
+
warning: "bg-warning",
|
|
1722
|
+
critical: "bg-error"
|
|
1721
1723
|
};
|
|
1722
1724
|
var pulseRingColors = {
|
|
1723
|
-
online: "ring-
|
|
1724
|
-
offline: "ring-
|
|
1725
|
-
away: "ring-
|
|
1726
|
-
busy: "ring-
|
|
1727
|
-
warning: "ring-
|
|
1728
|
-
critical: "ring-
|
|
1725
|
+
online: "ring-success",
|
|
1726
|
+
offline: "ring-muted-foreground",
|
|
1727
|
+
away: "ring-warning",
|
|
1728
|
+
busy: "ring-error",
|
|
1729
|
+
warning: "ring-warning",
|
|
1730
|
+
critical: "ring-error"
|
|
1729
1731
|
};
|
|
1730
1732
|
var sizeStyles5 = {
|
|
1731
1733
|
sm: "w-2 h-2",
|
|
1732
1734
|
md: "w-2.5 h-2.5",
|
|
1733
1735
|
lg: "w-3 h-3"
|
|
1734
1736
|
};
|
|
1735
|
-
var StatusDot =
|
|
1737
|
+
var StatusDot = React112__namespace.default.forwardRef(
|
|
1736
1738
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
1737
1739
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1738
1740
|
"span",
|
|
@@ -1769,17 +1771,17 @@ function resolveDirection(value, direction) {
|
|
|
1769
1771
|
return value > 0 ? "up" : "down";
|
|
1770
1772
|
}
|
|
1771
1773
|
function resolveColor(dir, invert) {
|
|
1772
|
-
if (dir === "flat") return "text-
|
|
1774
|
+
if (dir === "flat") return "text-muted-foreground";
|
|
1773
1775
|
const isPositive = dir === "up";
|
|
1774
1776
|
const isGood = invert ? !isPositive : isPositive;
|
|
1775
|
-
return isGood ? "text-
|
|
1777
|
+
return isGood ? "text-success" : "text-error";
|
|
1776
1778
|
}
|
|
1777
1779
|
var iconMap2 = {
|
|
1778
1780
|
up: LucideIcons.TrendingUp,
|
|
1779
1781
|
down: LucideIcons.TrendingDown,
|
|
1780
1782
|
flat: LucideIcons.ArrowRight
|
|
1781
1783
|
};
|
|
1782
|
-
var TrendIndicator =
|
|
1784
|
+
var TrendIndicator = React112__namespace.default.forwardRef(
|
|
1783
1785
|
({
|
|
1784
1786
|
className,
|
|
1785
1787
|
value,
|
|
@@ -1838,7 +1840,7 @@ var thumbSizes = {
|
|
|
1838
1840
|
md: "w-4 h-4",
|
|
1839
1841
|
lg: "w-5 h-5"
|
|
1840
1842
|
};
|
|
1841
|
-
var RangeSlider =
|
|
1843
|
+
var RangeSlider = React112__namespace.default.forwardRef(
|
|
1842
1844
|
({
|
|
1843
1845
|
className,
|
|
1844
1846
|
min = 0,
|
|
@@ -1856,14 +1858,14 @@ var RangeSlider = React110__namespace.default.forwardRef(
|
|
|
1856
1858
|
formatValue: formatValue5,
|
|
1857
1859
|
...props
|
|
1858
1860
|
}, ref) => {
|
|
1859
|
-
const [isDragging, setIsDragging] =
|
|
1860
|
-
const [showTip, setShowTip] =
|
|
1861
|
-
const inputRef =
|
|
1861
|
+
const [isDragging, setIsDragging] = React112.useState(false);
|
|
1862
|
+
const [showTip, setShowTip] = React112.useState(false);
|
|
1863
|
+
const inputRef = React112.useRef(null);
|
|
1862
1864
|
const eventBus = useSafeEventBus();
|
|
1863
1865
|
const percentage = max !== min ? (value - min) / (max - min) * 100 : 0;
|
|
1864
1866
|
const bufferedPercentage = buffered !== void 0 ? Math.min(buffered, 100) : void 0;
|
|
1865
1867
|
const displayValue = formatValue5 ? formatValue5(value) : String(value);
|
|
1866
|
-
const handleChange =
|
|
1868
|
+
const handleChange = React112.useCallback(
|
|
1867
1869
|
(e) => {
|
|
1868
1870
|
const newValue = Number(e.target.value);
|
|
1869
1871
|
onChange?.(newValue);
|
|
@@ -1890,7 +1892,7 @@ var RangeSlider = React110__namespace.default.forwardRef(
|
|
|
1890
1892
|
"div",
|
|
1891
1893
|
{
|
|
1892
1894
|
className: cn(
|
|
1893
|
-
"absolute inset-x-0 rounded-full bg-
|
|
1895
|
+
"absolute inset-x-0 rounded-full bg-muted",
|
|
1894
1896
|
trackSizes[size]
|
|
1895
1897
|
),
|
|
1896
1898
|
style: { top: "50%", transform: "translateY(-50%)" }
|
|
@@ -1900,7 +1902,7 @@ var RangeSlider = React110__namespace.default.forwardRef(
|
|
|
1900
1902
|
"div",
|
|
1901
1903
|
{
|
|
1902
1904
|
className: cn(
|
|
1903
|
-
"absolute rounded-full bg-
|
|
1905
|
+
"absolute rounded-full bg-muted-foreground opacity-30",
|
|
1904
1906
|
trackSizes[size]
|
|
1905
1907
|
),
|
|
1906
1908
|
style: {
|
|
@@ -1915,7 +1917,7 @@ var RangeSlider = React110__namespace.default.forwardRef(
|
|
|
1915
1917
|
"div",
|
|
1916
1918
|
{
|
|
1917
1919
|
className: cn(
|
|
1918
|
-
"absolute rounded-full bg-
|
|
1920
|
+
"absolute rounded-full bg-primary",
|
|
1919
1921
|
trackSizes[size]
|
|
1920
1922
|
),
|
|
1921
1923
|
style: {
|
|
@@ -1977,9 +1979,9 @@ var RangeSlider = React110__namespace.default.forwardRef(
|
|
|
1977
1979
|
"div",
|
|
1978
1980
|
{
|
|
1979
1981
|
className: cn(
|
|
1980
|
-
"absolute rounded-full bg-
|
|
1981
|
-
"border-2 border-
|
|
1982
|
-
"shadow-
|
|
1982
|
+
"absolute rounded-full bg-primary-foreground",
|
|
1983
|
+
"border-2 border-primary",
|
|
1984
|
+
"shadow-sm",
|
|
1983
1985
|
"pointer-events-none",
|
|
1984
1986
|
"transition-transform duration-100",
|
|
1985
1987
|
isDragging && "scale-110",
|
|
@@ -1997,7 +1999,7 @@ var RangeSlider = React110__namespace.default.forwardRef(
|
|
|
1997
1999
|
{
|
|
1998
2000
|
className: cn(
|
|
1999
2001
|
"absolute -top-8 px-2 py-0.5 rounded",
|
|
2000
|
-
"bg-
|
|
2002
|
+
"bg-foreground text-background",
|
|
2001
2003
|
"text-xs font-medium whitespace-nowrap",
|
|
2002
2004
|
"pointer-events-none"
|
|
2003
2005
|
),
|
|
@@ -2014,7 +2016,7 @@ var RangeSlider = React110__namespace.default.forwardRef(
|
|
|
2014
2016
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2015
2017
|
"div",
|
|
2016
2018
|
{
|
|
2017
|
-
className: "absolute w-px h-1.5 bg-
|
|
2019
|
+
className: "absolute w-px h-1.5 bg-muted-foreground",
|
|
2018
2020
|
style: { left: `${tickPercent}%` }
|
|
2019
2021
|
},
|
|
2020
2022
|
i
|
|
@@ -2028,8 +2030,8 @@ var RangeSlider = React110__namespace.default.forwardRef(
|
|
|
2028
2030
|
RangeSlider.displayName = "RangeSlider";
|
|
2029
2031
|
var backgroundClasses = {
|
|
2030
2032
|
default: "",
|
|
2031
|
-
alt: "bg-
|
|
2032
|
-
dark: "bg-
|
|
2033
|
+
alt: "bg-surface",
|
|
2034
|
+
dark: "bg-foreground text-background",
|
|
2033
2035
|
gradient: [
|
|
2034
2036
|
"bg-gradient-to-b",
|
|
2035
2037
|
"from-[var(--color-primary)]/5",
|
|
@@ -2041,7 +2043,7 @@ var paddingClasses = {
|
|
|
2041
2043
|
md: "py-16",
|
|
2042
2044
|
lg: "py-24"
|
|
2043
2045
|
};
|
|
2044
|
-
var ContentSection =
|
|
2046
|
+
var ContentSection = React112__namespace.default.forwardRef(
|
|
2045
2047
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
2046
2048
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2047
2049
|
Box,
|
|
@@ -2060,6 +2062,289 @@ var ContentSection = React110__namespace.default.forwardRef(
|
|
|
2060
2062
|
}
|
|
2061
2063
|
);
|
|
2062
2064
|
ContentSection.displayName = "ContentSection";
|
|
2065
|
+
var initialStyles = {
|
|
2066
|
+
"fade-up": { opacity: 0, transform: "translateY(24px)" },
|
|
2067
|
+
"fade-down": { opacity: 0, transform: "translateY(-24px)" },
|
|
2068
|
+
"fade-in": { opacity: 0 },
|
|
2069
|
+
"fade-left": { opacity: 0, transform: "translateX(24px)" },
|
|
2070
|
+
"fade-right": { opacity: 0, transform: "translateX(-24px)" },
|
|
2071
|
+
"scale": { opacity: 0, transform: "scale(0.92)" },
|
|
2072
|
+
"scale-up": { opacity: 0, transform: "scale(0.92) translateY(16px)" },
|
|
2073
|
+
"none": {}
|
|
2074
|
+
};
|
|
2075
|
+
var animatedStyles = {
|
|
2076
|
+
"fade-up": { opacity: 1, transform: "translateY(0)" },
|
|
2077
|
+
"fade-down": { opacity: 1, transform: "translateY(0)" },
|
|
2078
|
+
"fade-in": { opacity: 1 },
|
|
2079
|
+
"fade-left": { opacity: 1, transform: "translateX(0)" },
|
|
2080
|
+
"fade-right": { opacity: 1, transform: "translateX(0)" },
|
|
2081
|
+
"scale": { opacity: 1, transform: "scale(1)" },
|
|
2082
|
+
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
2083
|
+
"none": {}
|
|
2084
|
+
};
|
|
2085
|
+
var AnimatedReveal = React112__namespace.default.forwardRef(
|
|
2086
|
+
({
|
|
2087
|
+
trigger = "scroll",
|
|
2088
|
+
animation = "fade-up",
|
|
2089
|
+
duration = 600,
|
|
2090
|
+
delay = 0,
|
|
2091
|
+
threshold = 0.15,
|
|
2092
|
+
once = true,
|
|
2093
|
+
animate: manualAnimate,
|
|
2094
|
+
easing = "cubic-bezier(0.16, 1, 0.3, 1)",
|
|
2095
|
+
children,
|
|
2096
|
+
className,
|
|
2097
|
+
style,
|
|
2098
|
+
...props
|
|
2099
|
+
}, forwardedRef) => {
|
|
2100
|
+
const [isAnimated, setIsAnimated] = React112.useState(false);
|
|
2101
|
+
const internalRef = React112.useRef(null);
|
|
2102
|
+
const hasAnimated = React112.useRef(false);
|
|
2103
|
+
const setRef = React112.useCallback(
|
|
2104
|
+
(node) => {
|
|
2105
|
+
internalRef.current = node;
|
|
2106
|
+
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
2107
|
+
else if (forwardedRef) forwardedRef.current = node;
|
|
2108
|
+
},
|
|
2109
|
+
[forwardedRef]
|
|
2110
|
+
);
|
|
2111
|
+
React112.useEffect(() => {
|
|
2112
|
+
if (trigger !== "scroll") return;
|
|
2113
|
+
const el = internalRef.current;
|
|
2114
|
+
if (!el) return;
|
|
2115
|
+
const observer = new IntersectionObserver(
|
|
2116
|
+
([entry]) => {
|
|
2117
|
+
if (entry.isIntersecting) {
|
|
2118
|
+
if (once && hasAnimated.current) return;
|
|
2119
|
+
hasAnimated.current = true;
|
|
2120
|
+
setIsAnimated(true);
|
|
2121
|
+
} else if (!once) {
|
|
2122
|
+
setIsAnimated(false);
|
|
2123
|
+
}
|
|
2124
|
+
},
|
|
2125
|
+
{ threshold }
|
|
2126
|
+
);
|
|
2127
|
+
observer.observe(el);
|
|
2128
|
+
return () => observer.disconnect();
|
|
2129
|
+
}, [trigger, threshold, once]);
|
|
2130
|
+
const handleMouseEnter = trigger === "hover" ? () => setIsAnimated(true) : void 0;
|
|
2131
|
+
const handleMouseLeave = trigger === "hover" ? () => {
|
|
2132
|
+
if (!once || !hasAnimated.current) {
|
|
2133
|
+
hasAnimated.current = true;
|
|
2134
|
+
setIsAnimated(false);
|
|
2135
|
+
}
|
|
2136
|
+
} : void 0;
|
|
2137
|
+
React112.useEffect(() => {
|
|
2138
|
+
if (trigger === "manual" && manualAnimate !== void 0) {
|
|
2139
|
+
setIsAnimated(manualAnimate);
|
|
2140
|
+
}
|
|
2141
|
+
}, [trigger, manualAnimate]);
|
|
2142
|
+
const active = isAnimated;
|
|
2143
|
+
const currentStyle = active ? animatedStyles[animation] : initialStyles[animation];
|
|
2144
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2145
|
+
"div",
|
|
2146
|
+
{
|
|
2147
|
+
ref: setRef,
|
|
2148
|
+
className: cn("will-change-[opacity,transform]", className),
|
|
2149
|
+
style: {
|
|
2150
|
+
...currentStyle,
|
|
2151
|
+
transitionProperty: "opacity, transform",
|
|
2152
|
+
transitionDuration: `${duration}ms`,
|
|
2153
|
+
transitionDelay: `${delay}ms`,
|
|
2154
|
+
transitionTimingFunction: easing,
|
|
2155
|
+
...style
|
|
2156
|
+
},
|
|
2157
|
+
onMouseEnter: handleMouseEnter,
|
|
2158
|
+
onMouseLeave: handleMouseLeave,
|
|
2159
|
+
...props,
|
|
2160
|
+
children: typeof children === "function" ? children(active) : children
|
|
2161
|
+
}
|
|
2162
|
+
);
|
|
2163
|
+
}
|
|
2164
|
+
);
|
|
2165
|
+
AnimatedReveal.displayName = "AnimatedReveal";
|
|
2166
|
+
function useFetchedSvg(src) {
|
|
2167
|
+
const [svg, setSvg] = React112.useState(null);
|
|
2168
|
+
const cache = React112.useRef({});
|
|
2169
|
+
React112.useEffect(() => {
|
|
2170
|
+
if (!src) {
|
|
2171
|
+
setSvg(null);
|
|
2172
|
+
return;
|
|
2173
|
+
}
|
|
2174
|
+
if (cache.current[src]) {
|
|
2175
|
+
setSvg(cache.current[src]);
|
|
2176
|
+
return;
|
|
2177
|
+
}
|
|
2178
|
+
let cancelled = false;
|
|
2179
|
+
fetch(src).then((res) => {
|
|
2180
|
+
if (!res.ok) throw new Error(`Failed to fetch SVG: ${res.status}`);
|
|
2181
|
+
return res.text();
|
|
2182
|
+
}).then((text) => {
|
|
2183
|
+
if (cancelled) return;
|
|
2184
|
+
cache.current[src] = text;
|
|
2185
|
+
setSvg(text);
|
|
2186
|
+
}).catch(() => {
|
|
2187
|
+
if (!cancelled) setSvg(null);
|
|
2188
|
+
});
|
|
2189
|
+
return () => {
|
|
2190
|
+
cancelled = true;
|
|
2191
|
+
};
|
|
2192
|
+
}, [src]);
|
|
2193
|
+
return svg;
|
|
2194
|
+
}
|
|
2195
|
+
function applyDrawAnimation(container, animate, duration, delay, easing) {
|
|
2196
|
+
const paths = container.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
|
|
2197
|
+
paths.forEach((el) => {
|
|
2198
|
+
if ("getTotalLength" in el && typeof el.getTotalLength === "function") {
|
|
2199
|
+
const len = el.getTotalLength();
|
|
2200
|
+
el.style.strokeDasharray = `${len}`;
|
|
2201
|
+
el.style.strokeDashoffset = animate ? "0" : `${len}`;
|
|
2202
|
+
el.style.transition = `stroke-dashoffset ${duration}ms ${easing} ${delay}ms`;
|
|
2203
|
+
}
|
|
2204
|
+
});
|
|
2205
|
+
}
|
|
2206
|
+
function applyFillAnimation(container, animate, duration, delay, easing, fillColor) {
|
|
2207
|
+
const paths = container.querySelectorAll("path, circle, ellipse, rect, polygon");
|
|
2208
|
+
paths.forEach((el) => {
|
|
2209
|
+
if ("getTotalLength" in el && typeof el.getTotalLength === "function") {
|
|
2210
|
+
const geom = el;
|
|
2211
|
+
const len = geom.getTotalLength();
|
|
2212
|
+
geom.style.strokeDasharray = `${len}`;
|
|
2213
|
+
geom.style.strokeDashoffset = animate ? "0" : `${len}`;
|
|
2214
|
+
geom.style.transition = `stroke-dashoffset ${duration * 0.6}ms ${easing} ${delay}ms, fill-opacity ${duration * 0.4}ms ${easing} ${delay + duration * 0.6}ms`;
|
|
2215
|
+
}
|
|
2216
|
+
if (fillColor) el.style.fill = fillColor;
|
|
2217
|
+
el.style.fillOpacity = animate ? "1" : "0";
|
|
2218
|
+
});
|
|
2219
|
+
}
|
|
2220
|
+
function applyPulseAnimation(container, animate, duration) {
|
|
2221
|
+
const svg = container.querySelector("svg");
|
|
2222
|
+
if (!svg) return;
|
|
2223
|
+
if (animate) {
|
|
2224
|
+
svg.style.animation = `ag-pulse ${duration}ms ease-in-out infinite`;
|
|
2225
|
+
} else {
|
|
2226
|
+
svg.style.animation = "none";
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2229
|
+
function applyMorphAnimation(container, animate, duration, delay, easing) {
|
|
2230
|
+
const paths = container.querySelectorAll("path, circle, ellipse, rect, polygon");
|
|
2231
|
+
paths.forEach((el) => {
|
|
2232
|
+
el.style.transition = `all ${duration}ms ${easing} ${delay}ms`;
|
|
2233
|
+
el.style.transform = animate ? "scale(1)" : "scale(0)";
|
|
2234
|
+
el.style.transformOrigin = "center";
|
|
2235
|
+
el.style.opacity = animate ? "1" : "0";
|
|
2236
|
+
});
|
|
2237
|
+
}
|
|
2238
|
+
var AnimatedGraphic = React112__namespace.default.forwardRef(
|
|
2239
|
+
({
|
|
2240
|
+
src,
|
|
2241
|
+
svgContent,
|
|
2242
|
+
animation = "draw",
|
|
2243
|
+
animate = false,
|
|
2244
|
+
duration = 1200,
|
|
2245
|
+
delay = 0,
|
|
2246
|
+
easing = "cubic-bezier(0.16, 1, 0.3, 1)",
|
|
2247
|
+
width,
|
|
2248
|
+
height,
|
|
2249
|
+
strokeColor,
|
|
2250
|
+
fillColor,
|
|
2251
|
+
alt,
|
|
2252
|
+
className,
|
|
2253
|
+
style,
|
|
2254
|
+
children,
|
|
2255
|
+
...props
|
|
2256
|
+
}, ref) => {
|
|
2257
|
+
const containerRef = React112.useRef(null);
|
|
2258
|
+
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
2259
|
+
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
2260
|
+
const prevAnimateRef = React112.useRef(animate);
|
|
2261
|
+
const setRef = React112__namespace.default.useCallback(
|
|
2262
|
+
(node) => {
|
|
2263
|
+
containerRef.current = node;
|
|
2264
|
+
if (typeof ref === "function") ref(node);
|
|
2265
|
+
else if (ref) ref.current = node;
|
|
2266
|
+
},
|
|
2267
|
+
[ref]
|
|
2268
|
+
);
|
|
2269
|
+
React112.useEffect(() => {
|
|
2270
|
+
const el = containerRef.current;
|
|
2271
|
+
if (!el || !strokeColor) return;
|
|
2272
|
+
const paths = el.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
|
|
2273
|
+
paths.forEach((p2) => {
|
|
2274
|
+
p2.style.stroke = strokeColor;
|
|
2275
|
+
});
|
|
2276
|
+
}, [resolvedSvg, strokeColor]);
|
|
2277
|
+
React112.useEffect(() => {
|
|
2278
|
+
const el = containerRef.current;
|
|
2279
|
+
if (!el || !resolvedSvg) return;
|
|
2280
|
+
if (animation === "draw" || animation === "fill") {
|
|
2281
|
+
const paths = el.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
|
|
2282
|
+
paths.forEach((p2) => {
|
|
2283
|
+
if ("getTotalLength" in p2 && typeof p2.getTotalLength === "function") {
|
|
2284
|
+
const len = p2.getTotalLength();
|
|
2285
|
+
p2.style.strokeDasharray = `${len}`;
|
|
2286
|
+
p2.style.strokeDashoffset = `${len}`;
|
|
2287
|
+
}
|
|
2288
|
+
if (animation === "fill") {
|
|
2289
|
+
p2.style.fillOpacity = "0";
|
|
2290
|
+
}
|
|
2291
|
+
});
|
|
2292
|
+
}
|
|
2293
|
+
if (animation === "morph") {
|
|
2294
|
+
const paths = el.querySelectorAll("path, circle, ellipse, rect, polygon");
|
|
2295
|
+
paths.forEach((p2) => {
|
|
2296
|
+
p2.style.transform = "scale(0)";
|
|
2297
|
+
p2.style.transformOrigin = "center";
|
|
2298
|
+
p2.style.opacity = "0";
|
|
2299
|
+
});
|
|
2300
|
+
}
|
|
2301
|
+
}, [resolvedSvg, animation]);
|
|
2302
|
+
React112.useEffect(() => {
|
|
2303
|
+
const el = containerRef.current;
|
|
2304
|
+
if (!el) return;
|
|
2305
|
+
const id = requestAnimationFrame(() => {
|
|
2306
|
+
switch (animation) {
|
|
2307
|
+
case "draw":
|
|
2308
|
+
applyDrawAnimation(el, animate, duration, delay, easing);
|
|
2309
|
+
break;
|
|
2310
|
+
case "fill":
|
|
2311
|
+
applyFillAnimation(el, animate, duration, delay, easing, fillColor);
|
|
2312
|
+
break;
|
|
2313
|
+
case "pulse":
|
|
2314
|
+
applyPulseAnimation(el, animate, duration);
|
|
2315
|
+
break;
|
|
2316
|
+
case "morph":
|
|
2317
|
+
applyMorphAnimation(el, animate, duration, delay, easing);
|
|
2318
|
+
break;
|
|
2319
|
+
}
|
|
2320
|
+
});
|
|
2321
|
+
prevAnimateRef.current = animate;
|
|
2322
|
+
return () => cancelAnimationFrame(id);
|
|
2323
|
+
}, [animate, animation, duration, delay, easing, fillColor, resolvedSvg]);
|
|
2324
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2325
|
+
/* @__PURE__ */ jsxRuntime.jsx("style", { children: `@keyframes ag-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.04); opacity: 0.85; } }` }),
|
|
2326
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2327
|
+
"div",
|
|
2328
|
+
{
|
|
2329
|
+
ref: setRef,
|
|
2330
|
+
className: cn("inline-flex items-center justify-center", className),
|
|
2331
|
+
style: { width, height, ...style },
|
|
2332
|
+
role: alt ? "img" : void 0,
|
|
2333
|
+
"aria-label": alt,
|
|
2334
|
+
...props,
|
|
2335
|
+
children: resolvedSvg ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2336
|
+
"div",
|
|
2337
|
+
{
|
|
2338
|
+
className: "w-full h-full [&>svg]:w-full [&>svg]:h-full",
|
|
2339
|
+
dangerouslySetInnerHTML: { __html: resolvedSvg }
|
|
2340
|
+
}
|
|
2341
|
+
) : children
|
|
2342
|
+
}
|
|
2343
|
+
)
|
|
2344
|
+
] });
|
|
2345
|
+
}
|
|
2346
|
+
);
|
|
2347
|
+
AnimatedGraphic.displayName = "AnimatedGraphic";
|
|
2063
2348
|
|
|
2064
2349
|
// locales/en.json
|
|
2065
2350
|
var en_default = {
|
|
@@ -2170,7 +2455,7 @@ var en_default = {
|
|
|
2170
2455
|
// hooks/useTranslate.ts
|
|
2171
2456
|
var { $meta: _meta, ...coreMessages } = en_default;
|
|
2172
2457
|
var coreLocale = coreMessages;
|
|
2173
|
-
var I18nContext =
|
|
2458
|
+
var I18nContext = React112.createContext({
|
|
2174
2459
|
locale: "en",
|
|
2175
2460
|
direction: "ltr",
|
|
2176
2461
|
t: (key) => coreLocale[key] ?? key
|
|
@@ -2179,7 +2464,7 @@ var I18nContext = React110.createContext({
|
|
|
2179
2464
|
I18nContext.displayName = "I18nContext";
|
|
2180
2465
|
I18nContext.Provider;
|
|
2181
2466
|
function useTranslate() {
|
|
2182
|
-
return
|
|
2467
|
+
return React112.useContext(I18nContext);
|
|
2183
2468
|
}
|
|
2184
2469
|
var ErrorState = ({
|
|
2185
2470
|
title,
|
|
@@ -2206,16 +2491,16 @@ var ErrorState = ({
|
|
|
2206
2491
|
className
|
|
2207
2492
|
),
|
|
2208
2493
|
children: [
|
|
2209
|
-
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "mb-4 rounded-
|
|
2210
|
-
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "h3", className: "text-lg font-medium text-
|
|
2211
|
-
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "mt-1 text-
|
|
2494
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "mb-4 rounded-full bg-error/10 p-3", children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.AlertCircle, { className: "h-8 w-8 text-error" }) }),
|
|
2495
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "h3", className: "text-lg font-medium text-foreground", children: resolvedTitle }),
|
|
2496
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "mt-1 text-muted-foreground max-w-sm", children: resolvedMessage }),
|
|
2212
2497
|
(onRetry || retryEvent) && /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "secondary", className: "mt-4", onClick: handleRetry, children: t("error.retry") })
|
|
2213
2498
|
]
|
|
2214
2499
|
}
|
|
2215
2500
|
);
|
|
2216
2501
|
};
|
|
2217
2502
|
ErrorState.displayName = "ErrorState";
|
|
2218
|
-
var ErrorBoundary = class extends
|
|
2503
|
+
var ErrorBoundary = class extends React112__namespace.default.Component {
|
|
2219
2504
|
constructor(props) {
|
|
2220
2505
|
super(props);
|
|
2221
2506
|
__publicField(this, "reset", () => {
|
|
@@ -2314,7 +2599,7 @@ function executeNotify(message, options, config) {
|
|
|
2314
2599
|
function executeEmit(event, payload, config) {
|
|
2315
2600
|
config.eventBus.emit(event, payload);
|
|
2316
2601
|
}
|
|
2317
|
-
var ClientEffectConfigContext =
|
|
2602
|
+
var ClientEffectConfigContext = React112.createContext(null);
|
|
2318
2603
|
ClientEffectConfigContext.Provider;
|
|
2319
2604
|
var effectIdCounter = 0;
|
|
2320
2605
|
function generateEffectId() {
|
|
@@ -2553,14 +2838,14 @@ var OfflineExecutor = class {
|
|
|
2553
2838
|
}
|
|
2554
2839
|
};
|
|
2555
2840
|
function useOfflineExecutor(options) {
|
|
2556
|
-
const executorRef =
|
|
2557
|
-
const [state, setState] =
|
|
2841
|
+
const executorRef = React112.useRef(null);
|
|
2842
|
+
const [state, setState] = React112.useState({
|
|
2558
2843
|
isOffline: false,
|
|
2559
2844
|
syncQueue: [],
|
|
2560
2845
|
localEffectsProcessed: 0,
|
|
2561
2846
|
effectsSynced: 0
|
|
2562
2847
|
});
|
|
2563
|
-
|
|
2848
|
+
React112.useEffect(() => {
|
|
2564
2849
|
const executor = new OfflineExecutor({
|
|
2565
2850
|
...options,
|
|
2566
2851
|
onQueueChange: (queue) => {
|
|
@@ -2575,7 +2860,7 @@ function useOfflineExecutor(options) {
|
|
|
2575
2860
|
executorRef.current = null;
|
|
2576
2861
|
};
|
|
2577
2862
|
}, []);
|
|
2578
|
-
|
|
2863
|
+
React112.useEffect(() => {
|
|
2579
2864
|
if (!options.autoSync || !options.serverUrl) return;
|
|
2580
2865
|
const handleOnline = async () => {
|
|
2581
2866
|
if (executorRef.current) {
|
|
@@ -2589,13 +2874,13 @@ function useOfflineExecutor(options) {
|
|
|
2589
2874
|
window.addEventListener("online", handleOnline);
|
|
2590
2875
|
return () => window.removeEventListener("online", handleOnline);
|
|
2591
2876
|
}, [options.autoSync, options.serverUrl, options.authToken]);
|
|
2592
|
-
const executeEffects =
|
|
2877
|
+
const executeEffects = React112.useCallback((effects) => {
|
|
2593
2878
|
executorRef.current?.executeClientEffects(effects);
|
|
2594
2879
|
if (executorRef.current) {
|
|
2595
2880
|
setState(executorRef.current.getState());
|
|
2596
2881
|
}
|
|
2597
2882
|
}, []);
|
|
2598
|
-
const processEventOffline =
|
|
2883
|
+
const processEventOffline = React112.useCallback(
|
|
2599
2884
|
(event, payload, effects) => {
|
|
2600
2885
|
const result = executorRef.current?.processEventOffline(event, payload, effects);
|
|
2601
2886
|
if (executorRef.current) {
|
|
@@ -2605,7 +2890,7 @@ function useOfflineExecutor(options) {
|
|
|
2605
2890
|
},
|
|
2606
2891
|
[]
|
|
2607
2892
|
);
|
|
2608
|
-
const sync =
|
|
2893
|
+
const sync = React112.useCallback(async () => {
|
|
2609
2894
|
if (!executorRef.current || !options.serverUrl) return 0;
|
|
2610
2895
|
const count = await executorRef.current.syncPendingEffects(
|
|
2611
2896
|
options.serverUrl,
|
|
@@ -2614,7 +2899,7 @@ function useOfflineExecutor(options) {
|
|
|
2614
2899
|
setState(executorRef.current.getState());
|
|
2615
2900
|
return count;
|
|
2616
2901
|
}, [options.serverUrl, options.authToken]);
|
|
2617
|
-
const clearQueue =
|
|
2902
|
+
const clearQueue = React112.useCallback(() => {
|
|
2618
2903
|
executorRef.current?.clearQueue();
|
|
2619
2904
|
if (executorRef.current) {
|
|
2620
2905
|
setState(executorRef.current.getState());
|
|
@@ -2630,7 +2915,7 @@ function useOfflineExecutor(options) {
|
|
|
2630
2915
|
clearQueue
|
|
2631
2916
|
};
|
|
2632
2917
|
}
|
|
2633
|
-
|
|
2918
|
+
React112.createContext(null);
|
|
2634
2919
|
var defaultIcon = L__default.default.icon({
|
|
2635
2920
|
iconUrl: "https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png",
|
|
2636
2921
|
iconRetinaUrl: "https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon-2x.png",
|
|
@@ -2643,29 +2928,41 @@ var defaultIcon = L__default.default.icon({
|
|
|
2643
2928
|
L__default.default.Marker.prototype.options.icon = defaultIcon;
|
|
2644
2929
|
|
|
2645
2930
|
// lib/verificationRegistry.ts
|
|
2646
|
-
var checks = /* @__PURE__ */ new Map();
|
|
2647
|
-
var transitions = [];
|
|
2648
2931
|
var MAX_TRANSITIONS = 500;
|
|
2649
|
-
|
|
2932
|
+
function getState() {
|
|
2933
|
+
if (typeof window !== "undefined") {
|
|
2934
|
+
const w = window;
|
|
2935
|
+
if (!w.__verificationRegistryState) {
|
|
2936
|
+
w.__verificationRegistryState = {
|
|
2937
|
+
checks: /* @__PURE__ */ new Map(),
|
|
2938
|
+
transitions: [],
|
|
2939
|
+
bridgeHealth: null,
|
|
2940
|
+
listeners: /* @__PURE__ */ new Set()
|
|
2941
|
+
};
|
|
2942
|
+
}
|
|
2943
|
+
return w.__verificationRegistryState;
|
|
2944
|
+
}
|
|
2945
|
+
return { checks: /* @__PURE__ */ new Map(), transitions: [], bridgeHealth: null, listeners: /* @__PURE__ */ new Set() };
|
|
2946
|
+
}
|
|
2650
2947
|
function notifyListeners() {
|
|
2651
|
-
listeners.forEach((l) => l());
|
|
2948
|
+
getState().listeners.forEach((l) => l());
|
|
2652
2949
|
exposeOnWindow();
|
|
2653
2950
|
}
|
|
2654
2951
|
function registerCheck(id, label, status = "pending", details) {
|
|
2655
|
-
checks.set(id, { id, label, status, details, updatedAt: Date.now() });
|
|
2952
|
+
getState().checks.set(id, { id, label, status, details, updatedAt: Date.now() });
|
|
2656
2953
|
notifyListeners();
|
|
2657
2954
|
}
|
|
2658
2955
|
function getAllChecks() {
|
|
2659
|
-
return Array.from(checks.values());
|
|
2956
|
+
return Array.from(getState().checks.values());
|
|
2660
2957
|
}
|
|
2661
2958
|
function recordTransition(trace) {
|
|
2662
2959
|
const entry = {
|
|
2663
2960
|
...trace,
|
|
2664
2961
|
id: `t-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`
|
|
2665
2962
|
};
|
|
2666
|
-
transitions.push(entry);
|
|
2667
|
-
if (transitions.length > MAX_TRANSITIONS) {
|
|
2668
|
-
transitions.shift();
|
|
2963
|
+
getState().transitions.push(entry);
|
|
2964
|
+
if (getState().transitions.length > MAX_TRANSITIONS) {
|
|
2965
|
+
getState().transitions.shift();
|
|
2669
2966
|
}
|
|
2670
2967
|
if (entry.event === "INIT") {
|
|
2671
2968
|
const hasFetch = entry.effects.some((e) => e.type === "fetch");
|
|
@@ -2700,10 +2997,11 @@ function recordTransition(trace) {
|
|
|
2700
2997
|
notifyListeners();
|
|
2701
2998
|
}
|
|
2702
2999
|
function getTransitions() {
|
|
2703
|
-
return [...transitions];
|
|
3000
|
+
return [...getState().transitions];
|
|
2704
3001
|
}
|
|
2705
3002
|
function getBridgeHealth() {
|
|
2706
|
-
|
|
3003
|
+
const bh = getState().bridgeHealth;
|
|
3004
|
+
return bh ? { ...bh } : null;
|
|
2707
3005
|
}
|
|
2708
3006
|
function getSummary() {
|
|
2709
3007
|
const allChecks = getAllChecks();
|
|
@@ -2724,8 +3022,8 @@ function getSnapshot() {
|
|
|
2724
3022
|
};
|
|
2725
3023
|
}
|
|
2726
3024
|
function subscribeToVerification(listener) {
|
|
2727
|
-
listeners.add(listener);
|
|
2728
|
-
return () => listeners.delete(listener);
|
|
3025
|
+
getState().listeners.add(listener);
|
|
3026
|
+
return () => getState().listeners.delete(listener);
|
|
2729
3027
|
}
|
|
2730
3028
|
function exposeOnWindow() {
|
|
2731
3029
|
if (typeof window === "undefined") return;
|
|
@@ -2742,7 +3040,7 @@ function exposeOnWindow() {
|
|
|
2742
3040
|
}
|
|
2743
3041
|
function waitForTransition(event, timeoutMs = 1e4) {
|
|
2744
3042
|
return new Promise((resolve) => {
|
|
2745
|
-
const existing = transitions.find((t) => t.event === event);
|
|
3043
|
+
const existing = getState().transitions.find((t) => t.event === event);
|
|
2746
3044
|
if (existing) {
|
|
2747
3045
|
resolve(existing);
|
|
2748
3046
|
return;
|
|
@@ -2752,7 +3050,7 @@ function waitForTransition(event, timeoutMs = 1e4) {
|
|
|
2752
3050
|
resolve(null);
|
|
2753
3051
|
}, timeoutMs);
|
|
2754
3052
|
const unsub = subscribeToVerification(() => {
|
|
2755
|
-
const found = transitions.find((t) => t.event === event);
|
|
3053
|
+
const found = getState().transitions.find((t) => t.event === event);
|
|
2756
3054
|
if (found) {
|
|
2757
3055
|
clearTimeout(timeout);
|
|
2758
3056
|
unsub();
|
|
@@ -2795,7 +3093,7 @@ function bindTraitStateGetter(getter) {
|
|
|
2795
3093
|
}
|
|
2796
3094
|
}
|
|
2797
3095
|
exposeOnWindow();
|
|
2798
|
-
var MarkdownContent =
|
|
3096
|
+
var MarkdownContent = React112__namespace.default.memo(
|
|
2799
3097
|
({ content, direction, className }) => {
|
|
2800
3098
|
const { t: _t } = useTranslate();
|
|
2801
3099
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -2882,7 +3180,7 @@ var MarkdownContent = React110__namespace.default.memo(
|
|
|
2882
3180
|
"blockquote",
|
|
2883
3181
|
{
|
|
2884
3182
|
...props,
|
|
2885
|
-
className: "border-l-4 border-blue-500 pl-4 italic text-
|
|
3183
|
+
className: "border-l-4 border-blue-500 pl-4 italic text-foreground my-4",
|
|
2886
3184
|
children
|
|
2887
3185
|
}
|
|
2888
3186
|
);
|
|
@@ -2897,7 +3195,7 @@ var MarkdownContent = React110__namespace.default.memo(
|
|
|
2897
3195
|
(prev, next) => prev.content === next.content && prev.className === next.className && prev.direction === next.direction
|
|
2898
3196
|
);
|
|
2899
3197
|
MarkdownContent.displayName = "MarkdownContent";
|
|
2900
|
-
var CodeBlock =
|
|
3198
|
+
var CodeBlock = React112__namespace.default.memo(
|
|
2901
3199
|
({
|
|
2902
3200
|
code: rawCode,
|
|
2903
3201
|
language = "text",
|
|
@@ -2909,20 +3207,20 @@ var CodeBlock = React110__namespace.default.memo(
|
|
|
2909
3207
|
const code = typeof rawCode === "string" ? rawCode : String(rawCode ?? "");
|
|
2910
3208
|
const eventBus = useEventBus();
|
|
2911
3209
|
const { t: _t } = useTranslate();
|
|
2912
|
-
const scrollRef =
|
|
2913
|
-
const savedScrollLeftRef =
|
|
2914
|
-
const [copied, setCopied] =
|
|
2915
|
-
|
|
3210
|
+
const scrollRef = React112.useRef(null);
|
|
3211
|
+
const savedScrollLeftRef = React112.useRef(0);
|
|
3212
|
+
const [copied, setCopied] = React112.useState(false);
|
|
3213
|
+
React112.useLayoutEffect(() => {
|
|
2916
3214
|
const el = scrollRef.current;
|
|
2917
3215
|
return () => {
|
|
2918
3216
|
if (el) savedScrollLeftRef.current = el.scrollLeft;
|
|
2919
3217
|
};
|
|
2920
3218
|
}, [language, code]);
|
|
2921
|
-
|
|
3219
|
+
React112.useLayoutEffect(() => {
|
|
2922
3220
|
const el = scrollRef.current;
|
|
2923
3221
|
if (el) el.scrollLeft = savedScrollLeftRef.current;
|
|
2924
3222
|
}, [language, code]);
|
|
2925
|
-
|
|
3223
|
+
React112.useEffect(() => {
|
|
2926
3224
|
const el = scrollRef.current;
|
|
2927
3225
|
if (!el) return;
|
|
2928
3226
|
const handle = () => {
|
|
@@ -2957,7 +3255,7 @@ var CodeBlock = React110__namespace.default.memo(
|
|
|
2957
3255
|
variant: "ghost",
|
|
2958
3256
|
size: "sm",
|
|
2959
3257
|
onClick: handleCopy,
|
|
2960
|
-
className: "opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity text-
|
|
3258
|
+
className: "opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity text-muted-foreground hover:text-white",
|
|
2961
3259
|
"aria-label": "Copy code",
|
|
2962
3260
|
children: copied ? /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.Check, { size: 16, className: "text-green-400" }) : /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.Copy, { size: 16 })
|
|
2963
3261
|
}
|
|
@@ -3008,18 +3306,18 @@ CodeBlock.displayName = "CodeBlock";
|
|
|
3008
3306
|
|
|
3009
3307
|
// lib/debug.ts
|
|
3010
3308
|
typeof window !== "undefined" && (localStorage.getItem("debug") === "true" || process.env.NODE_ENV === "development");
|
|
3011
|
-
|
|
3012
|
-
var GameAudioContext =
|
|
3309
|
+
React112.lazy(() => import('react-markdown'));
|
|
3310
|
+
var GameAudioContext = React112.createContext(null);
|
|
3013
3311
|
GameAudioContext.displayName = "GameAudioContext";
|
|
3014
3312
|
|
|
3015
3313
|
// components/organisms/component-registry.generated.ts
|
|
3016
3314
|
function lazyThree(name, loader) {
|
|
3017
|
-
const Lazy =
|
|
3315
|
+
const Lazy = React112__namespace.default.lazy(() => loader().then((m) => ({ default: m[name] })));
|
|
3018
3316
|
function ThreeWrapper(props) {
|
|
3019
|
-
return
|
|
3020
|
-
|
|
3317
|
+
return React112__namespace.default.createElement(
|
|
3318
|
+
React112__namespace.default.Suspense,
|
|
3021
3319
|
{ fallback: null },
|
|
3022
|
-
|
|
3320
|
+
React112__namespace.default.createElement(Lazy, props)
|
|
3023
3321
|
);
|
|
3024
3322
|
}
|
|
3025
3323
|
ThreeWrapper.displayName = `Lazy(${name})`;
|
|
@@ -3040,13 +3338,13 @@ lazyThree("PhysicsObject3D", () => import('@almadar/ui/components/organisms/game
|
|
|
3040
3338
|
lazyThree("Scene3D", () => import('@almadar/ui/components/organisms/game/three'));
|
|
3041
3339
|
lazyThree("TileRenderer", () => import('@almadar/ui/components/organisms/game/three'));
|
|
3042
3340
|
lazyThree("UnitRenderer", () => import('@almadar/ui/components/organisms/game/three'));
|
|
3043
|
-
var SuspenseConfigContext =
|
|
3044
|
-
|
|
3341
|
+
var SuspenseConfigContext = React112.createContext({ enabled: false });
|
|
3342
|
+
React112.createContext(false);
|
|
3045
3343
|
function SuspenseConfigProvider({
|
|
3046
3344
|
config,
|
|
3047
3345
|
children
|
|
3048
3346
|
}) {
|
|
3049
|
-
return
|
|
3347
|
+
return React112__namespace.default.createElement(
|
|
3050
3348
|
SuspenseConfigContext.Provider,
|
|
3051
3349
|
{ value: config },
|
|
3052
3350
|
children
|
|
@@ -3091,8 +3389,8 @@ function VerificationProvider({
|
|
|
3091
3389
|
}) {
|
|
3092
3390
|
const isEnabled = enabled ?? (typeof process !== "undefined" && process.env?.NODE_ENV !== "production");
|
|
3093
3391
|
const eventBus = useEventBus();
|
|
3094
|
-
const pendingRef =
|
|
3095
|
-
|
|
3392
|
+
const pendingRef = React112.useRef(/* @__PURE__ */ new Map());
|
|
3393
|
+
React112.useEffect(() => {
|
|
3096
3394
|
if (!isEnabled) return;
|
|
3097
3395
|
if (!eventBus.onAny) return;
|
|
3098
3396
|
const unsub = eventBus.onAny((evt) => {
|
|
@@ -3119,7 +3417,7 @@ function VerificationProvider({
|
|
|
3119
3417
|
})) : [];
|
|
3120
3418
|
recordTransition({
|
|
3121
3419
|
traitName: parsed.traitName,
|
|
3122
|
-
from: pending?.from ?? "
|
|
3420
|
+
from: pending?.from ?? payload["currentState"] ?? newState,
|
|
3123
3421
|
to: newState,
|
|
3124
3422
|
event: parsed.event,
|
|
3125
3423
|
effects,
|
|
@@ -3130,10 +3428,11 @@ function VerificationProvider({
|
|
|
3130
3428
|
const pending = pendingRef.current.get(key);
|
|
3131
3429
|
pendingRef.current.delete(key);
|
|
3132
3430
|
const errorMsg = payload["error"] ?? "Unknown error";
|
|
3431
|
+
const fromState = pending?.from ?? payload["currentState"] ?? "unknown";
|
|
3133
3432
|
recordTransition({
|
|
3134
3433
|
traitName: parsed.traitName,
|
|
3135
|
-
from:
|
|
3136
|
-
to:
|
|
3434
|
+
from: fromState,
|
|
3435
|
+
to: fromState,
|
|
3137
3436
|
// state didn't change on error
|
|
3138
3437
|
event: parsed.event,
|
|
3139
3438
|
effects: [{
|
|
@@ -3153,7 +3452,7 @@ function VerificationProvider({
|
|
|
3153
3452
|
);
|
|
3154
3453
|
return unsub;
|
|
3155
3454
|
}, [isEnabled, eventBus]);
|
|
3156
|
-
|
|
3455
|
+
React112.useEffect(() => {
|
|
3157
3456
|
if (!isEnabled) return;
|
|
3158
3457
|
if (!runtimeManager) return;
|
|
3159
3458
|
runtimeManager.setObserver({
|
|
@@ -3175,11 +3474,11 @@ function VerificationProvider({
|
|
|
3175
3474
|
"pass"
|
|
3176
3475
|
);
|
|
3177
3476
|
}, [isEnabled, runtimeManager]);
|
|
3178
|
-
|
|
3477
|
+
React112.useEffect(() => {
|
|
3179
3478
|
if (!isEnabled) return;
|
|
3180
3479
|
bindEventBus(eventBus);
|
|
3181
3480
|
}, [isEnabled, eventBus]);
|
|
3182
|
-
|
|
3481
|
+
React112.useEffect(() => {
|
|
3183
3482
|
if (!isEnabled) return;
|
|
3184
3483
|
if (traitStateGetter) {
|
|
3185
3484
|
bindTraitStateGetter(traitStateGetter);
|
|
@@ -3203,7 +3502,7 @@ function OrbitalProvider({
|
|
|
3203
3502
|
suspense = false,
|
|
3204
3503
|
verification
|
|
3205
3504
|
}) {
|
|
3206
|
-
const suspenseConfig =
|
|
3505
|
+
const suspenseConfig = React112.useMemo(
|
|
3207
3506
|
() => ({ enabled: suspense }),
|
|
3208
3507
|
[suspense]
|
|
3209
3508
|
);
|
|
@@ -3223,43 +3522,43 @@ function OrbitalProvider({
|
|
|
3223
3522
|
);
|
|
3224
3523
|
}
|
|
3225
3524
|
OrbitalProvider.displayName = "OrbitalProvider";
|
|
3226
|
-
var FetchedDataContext =
|
|
3525
|
+
var FetchedDataContext = React112.createContext(null);
|
|
3227
3526
|
function FetchedDataProvider({
|
|
3228
3527
|
initialData,
|
|
3229
3528
|
children
|
|
3230
3529
|
}) {
|
|
3231
|
-
const [state, setState] =
|
|
3530
|
+
const [state, setState] = React112.useState(() => ({
|
|
3232
3531
|
data: initialData || {},
|
|
3233
3532
|
fetchedAt: {},
|
|
3234
3533
|
loading: false,
|
|
3235
3534
|
error: null
|
|
3236
3535
|
}));
|
|
3237
|
-
const getData =
|
|
3536
|
+
const getData = React112.useCallback(
|
|
3238
3537
|
(entityName) => {
|
|
3239
3538
|
return state.data[entityName] || [];
|
|
3240
3539
|
},
|
|
3241
3540
|
[state.data]
|
|
3242
3541
|
);
|
|
3243
|
-
const getById =
|
|
3542
|
+
const getById = React112.useCallback(
|
|
3244
3543
|
(entityName, id) => {
|
|
3245
3544
|
const records = state.data[entityName];
|
|
3246
3545
|
return records?.find((r) => r.id === id);
|
|
3247
3546
|
},
|
|
3248
3547
|
[state.data]
|
|
3249
3548
|
);
|
|
3250
|
-
const hasData =
|
|
3549
|
+
const hasData = React112.useCallback(
|
|
3251
3550
|
(entityName) => {
|
|
3252
3551
|
return entityName in state.data && state.data[entityName].length > 0;
|
|
3253
3552
|
},
|
|
3254
3553
|
[state.data]
|
|
3255
3554
|
);
|
|
3256
|
-
const getFetchedAt =
|
|
3555
|
+
const getFetchedAt = React112.useCallback(
|
|
3257
3556
|
(entityName) => {
|
|
3258
3557
|
return state.fetchedAt[entityName];
|
|
3259
3558
|
},
|
|
3260
3559
|
[state.fetchedAt]
|
|
3261
3560
|
);
|
|
3262
|
-
const setData =
|
|
3561
|
+
const setData = React112.useCallback((data) => {
|
|
3263
3562
|
const now = Date.now();
|
|
3264
3563
|
setState((prev) => ({
|
|
3265
3564
|
...prev,
|
|
@@ -3278,14 +3577,14 @@ function FetchedDataProvider({
|
|
|
3278
3577
|
error: null
|
|
3279
3578
|
}));
|
|
3280
3579
|
}, []);
|
|
3281
|
-
const clearData =
|
|
3580
|
+
const clearData = React112.useCallback(() => {
|
|
3282
3581
|
setState((prev) => ({
|
|
3283
3582
|
...prev,
|
|
3284
3583
|
data: {},
|
|
3285
3584
|
fetchedAt: {}
|
|
3286
3585
|
}));
|
|
3287
3586
|
}, []);
|
|
3288
|
-
const clearEntity =
|
|
3587
|
+
const clearEntity = React112.useCallback((entityName) => {
|
|
3289
3588
|
setState((prev) => {
|
|
3290
3589
|
const newData = { ...prev.data };
|
|
3291
3590
|
const newFetchedAt = { ...prev.fetchedAt };
|
|
@@ -3298,13 +3597,13 @@ function FetchedDataProvider({
|
|
|
3298
3597
|
};
|
|
3299
3598
|
});
|
|
3300
3599
|
}, []);
|
|
3301
|
-
const setLoading =
|
|
3600
|
+
const setLoading = React112.useCallback((loading) => {
|
|
3302
3601
|
setState((prev) => ({ ...prev, loading }));
|
|
3303
3602
|
}, []);
|
|
3304
|
-
const setError =
|
|
3603
|
+
const setError = React112.useCallback((error) => {
|
|
3305
3604
|
setState((prev) => ({ ...prev, error, loading: false }));
|
|
3306
3605
|
}, []);
|
|
3307
|
-
const contextValue =
|
|
3606
|
+
const contextValue = React112.useMemo(
|
|
3308
3607
|
() => ({
|
|
3309
3608
|
getData,
|
|
3310
3609
|
getById,
|
|
@@ -3335,10 +3634,10 @@ function FetchedDataProvider({
|
|
|
3335
3634
|
return /* @__PURE__ */ jsxRuntime.jsx(FetchedDataContext.Provider, { value: contextValue, children });
|
|
3336
3635
|
}
|
|
3337
3636
|
function useFetchedDataContext() {
|
|
3338
|
-
return
|
|
3637
|
+
return React112.useContext(FetchedDataContext);
|
|
3339
3638
|
}
|
|
3340
3639
|
function useFetchedData() {
|
|
3341
|
-
const context =
|
|
3640
|
+
const context = React112.useContext(FetchedDataContext);
|
|
3342
3641
|
if (!context) {
|
|
3343
3642
|
return {
|
|
3344
3643
|
getData: () => [],
|
|
@@ -3378,15 +3677,15 @@ function useFetchedEntity(entityName) {
|
|
|
3378
3677
|
error: context.error
|
|
3379
3678
|
};
|
|
3380
3679
|
}
|
|
3381
|
-
var OfflineModeContext =
|
|
3680
|
+
var OfflineModeContext = React112.createContext(null);
|
|
3382
3681
|
function OfflineModeProvider({
|
|
3383
3682
|
children,
|
|
3384
3683
|
...executorOptions
|
|
3385
3684
|
}) {
|
|
3386
|
-
const [forceOffline, setForceOffline] =
|
|
3685
|
+
const [forceOffline, setForceOffline] = React112.useState(false);
|
|
3387
3686
|
const executor = useOfflineExecutor(executorOptions);
|
|
3388
3687
|
const effectivelyOffline = executor.isOffline || forceOffline;
|
|
3389
|
-
const contextValue =
|
|
3688
|
+
const contextValue = React112.useMemo(
|
|
3390
3689
|
() => ({
|
|
3391
3690
|
...executor,
|
|
3392
3691
|
forceOffline,
|
|
@@ -3398,14 +3697,14 @@ function OfflineModeProvider({
|
|
|
3398
3697
|
return /* @__PURE__ */ jsxRuntime.jsx(OfflineModeContext.Provider, { value: contextValue, children });
|
|
3399
3698
|
}
|
|
3400
3699
|
function useOfflineMode() {
|
|
3401
|
-
const context =
|
|
3700
|
+
const context = React112.useContext(OfflineModeContext);
|
|
3402
3701
|
if (!context) {
|
|
3403
3702
|
throw new Error("useOfflineMode must be used within OfflineModeProvider");
|
|
3404
3703
|
}
|
|
3405
3704
|
return context;
|
|
3406
3705
|
}
|
|
3407
3706
|
function useOptionalOfflineMode() {
|
|
3408
|
-
return
|
|
3707
|
+
return React112.useContext(OfflineModeContext);
|
|
3409
3708
|
}
|
|
3410
3709
|
|
|
3411
3710
|
exports.EventBusContext = EventBusContext2;
|