@geomak/ui 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-DNQSZOYD.js → chunk-OSWZRIGC.js} +8 -8
- package/dist/{chunk-DNQSZOYD.js.map → chunk-OSWZRIGC.js.map} +1 -1
- package/dist/{chunk-ZS3HB5YJ.cjs → chunk-RLL7ES4F.cjs} +8 -8
- package/dist/{chunk-ZS3HB5YJ.cjs.map → chunk-RLL7ES4F.cjs.map} +1 -1
- package/dist/{index-CPCiQllz.d.cts → index-DLGzTj3K.d.cts} +5 -5
- package/dist/{index-CPCiQllz.d.ts → index-DLGzTj3K.d.ts} +5 -5
- package/dist/index.cjs +605 -132
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +267 -57
- package/dist/index.d.ts +267 -57
- package/dist/index.js +571 -105
- package/dist/index.js.map +1 -1
- package/dist/tokens/index.cjs +4 -4
- package/dist/tokens/index.d.cts +1 -1
- package/dist/tokens/index.d.ts +1 -1
- package/dist/tokens/index.js +1 -1
- package/package.json +92 -85
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { colors_default } from './chunk-
|
|
2
|
-
export { colors_default as COLORS, PALETTE as palette, semanticTokens, vars } from './chunk-
|
|
1
|
+
import { colors_default } from './chunk-OSWZRIGC.js';
|
|
2
|
+
export { colors_default as COLORS, PALETTE as palette, semanticTokens, vars } from './chunk-OSWZRIGC.js';
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import React9, { createContext, useMemo, useState, useEffect, useContext, useRef, useCallback, useId } from 'react';
|
|
5
5
|
import * as Dialog from '@radix-ui/react-dialog';
|
|
@@ -202,8 +202,45 @@ function IconButton({
|
|
|
202
202
|
}
|
|
203
203
|
);
|
|
204
204
|
}
|
|
205
|
+
var VARIANT_CLASSES = {
|
|
206
|
+
primary: [
|
|
207
|
+
"bg-accent text-white",
|
|
208
|
+
"hover:bg-accent-hover",
|
|
209
|
+
"active:bg-accent",
|
|
210
|
+
"disabled:bg-roman-silver disabled:text-white/70 disabled:cursor-not-allowed",
|
|
211
|
+
"focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2"
|
|
212
|
+
].join(" "),
|
|
213
|
+
secondary: [
|
|
214
|
+
"bg-transparent border border-accent text-accent",
|
|
215
|
+
"hover:bg-accent hover:text-white",
|
|
216
|
+
"active:bg-accent-hover active:text-white",
|
|
217
|
+
"disabled:border-roman-silver disabled:text-roman-silver disabled:cursor-not-allowed",
|
|
218
|
+
"focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2"
|
|
219
|
+
].join(" "),
|
|
220
|
+
ghost: [
|
|
221
|
+
"bg-transparent text-foreground-secondary",
|
|
222
|
+
"hover:bg-ice dark:hover:bg-oxford-blue-700 hover:text-foreground",
|
|
223
|
+
"active:bg-ice-dark dark:active:bg-independence",
|
|
224
|
+
"disabled:text-roman-silver disabled:cursor-not-allowed",
|
|
225
|
+
"focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2"
|
|
226
|
+
].join(" "),
|
|
227
|
+
danger: [
|
|
228
|
+
"bg-status-error text-white",
|
|
229
|
+
"hover:opacity-90",
|
|
230
|
+
"active:opacity-100",
|
|
231
|
+
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
232
|
+
"focus-visible:ring-2 focus-visible:ring-status-error focus-visible:ring-offset-2"
|
|
233
|
+
].join(" ")
|
|
234
|
+
};
|
|
235
|
+
var SIZE_CLASSES = {
|
|
236
|
+
sm: "h-7 px-3 text-xs gap-1 rounded-md",
|
|
237
|
+
md: "h-9 px-4 text-sm gap-1.5 rounded-lg",
|
|
238
|
+
lg: "h-11 px-5 text-sm gap-2 rounded-xl"
|
|
239
|
+
};
|
|
205
240
|
function Button({
|
|
206
241
|
content,
|
|
242
|
+
variant = "primary",
|
|
243
|
+
size = "md",
|
|
207
244
|
buttonType = "button",
|
|
208
245
|
loading,
|
|
209
246
|
disabled,
|
|
@@ -217,26 +254,33 @@ function Button({
|
|
|
217
254
|
onClick,
|
|
218
255
|
disabled: disabled || loading,
|
|
219
256
|
type: buttonType,
|
|
220
|
-
|
|
221
|
-
|
|
257
|
+
style,
|
|
258
|
+
className: [
|
|
259
|
+
// Base — layout, transitions, focus reset
|
|
260
|
+
"inline-flex items-center justify-center font-medium",
|
|
261
|
+
"outline-none transition-colors duration-150 select-none",
|
|
262
|
+
"whitespace-nowrap",
|
|
263
|
+
SIZE_CLASSES[size],
|
|
264
|
+
VARIANT_CLASSES[variant]
|
|
265
|
+
].join(" "),
|
|
222
266
|
children: [
|
|
223
267
|
loading ? /* @__PURE__ */ jsx(
|
|
224
268
|
"svg",
|
|
225
269
|
{
|
|
226
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
227
270
|
viewBox: "0 0 24 24",
|
|
228
|
-
fill: "
|
|
229
|
-
className: "w-
|
|
271
|
+
fill: "currentColor",
|
|
272
|
+
className: "w-4 h-4 animate-spin flex-shrink-0",
|
|
273
|
+
"aria-hidden": "true",
|
|
230
274
|
children: /* @__PURE__ */ jsx(
|
|
231
275
|
"path",
|
|
232
276
|
{
|
|
233
277
|
fillRule: "evenodd",
|
|
234
|
-
|
|
235
|
-
|
|
278
|
+
clipRule: "evenodd",
|
|
279
|
+
d: "M4.755 10.059a7.5 7.5 0 0112.548-3.364l1.903 1.903h-3.183a.75.75 0 100 1.5h4.992a.75.75 0 00.75-.75V4.356a.75.75 0 00-1.5 0v3.18l-1.9-1.9A9 9 0 003.306 9.67a.75.75 0 101.45.388zm15.408 3.352a.75.75 0 00-.919.53 7.5 7.5 0 01-12.548 3.364l-1.902-1.903h3.183a.75.75 0 000-1.5H2.984a.75.75 0 00-.75.75v4.992a.75.75 0 001.5 0v-3.18l1.9 1.9a9 9 0 0015.059-4.035.75.75 0 00-.53-.918z"
|
|
236
280
|
}
|
|
237
281
|
)
|
|
238
282
|
}
|
|
239
|
-
) : icon ? icon : null,
|
|
283
|
+
) : icon ? /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", "aria-hidden": "true", children: icon }) : null,
|
|
240
284
|
content
|
|
241
285
|
]
|
|
242
286
|
}
|
|
@@ -391,23 +435,49 @@ function Drawer({
|
|
|
391
435
|
) }) })
|
|
392
436
|
] }) });
|
|
393
437
|
}
|
|
438
|
+
var ANIMATION = {
|
|
439
|
+
top: "data-[state=delayed-open]:animate-tooltip-in-top",
|
|
440
|
+
bottom: "data-[state=delayed-open]:animate-tooltip-in-bottom",
|
|
441
|
+
left: "data-[state=delayed-open]:animate-tooltip-in-left",
|
|
442
|
+
right: "data-[state=delayed-open]:animate-tooltip-in-right"
|
|
443
|
+
};
|
|
394
444
|
function Tooltip({
|
|
395
445
|
children,
|
|
396
446
|
title,
|
|
397
|
-
placement = "
|
|
398
|
-
delayDuration =
|
|
447
|
+
placement = "top",
|
|
448
|
+
delayDuration = 300,
|
|
449
|
+
sideOffset = 8
|
|
399
450
|
}) {
|
|
400
451
|
return /* @__PURE__ */ jsx(TooltipPrimitive.Provider, { delayDuration, children: /* @__PURE__ */ jsxs(TooltipPrimitive.Root, { children: [
|
|
401
|
-
/* @__PURE__ */ jsx(TooltipPrimitive.Trigger, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "
|
|
452
|
+
/* @__PURE__ */ jsx(TooltipPrimitive.Trigger, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "inline-flex", children }) }),
|
|
402
453
|
/* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
403
454
|
TooltipPrimitive.Content,
|
|
404
455
|
{
|
|
405
456
|
side: placement,
|
|
406
|
-
sideOffset
|
|
407
|
-
className:
|
|
457
|
+
sideOffset,
|
|
458
|
+
className: [
|
|
459
|
+
// Layout + typography
|
|
460
|
+
"pointer-events-none z-[500000] max-w-[220px] px-2.5 py-1.5",
|
|
461
|
+
"text-xs font-medium leading-snug text-white",
|
|
462
|
+
// Background + border — slightly translucent for depth
|
|
463
|
+
"bg-foreground/95 rounded-md border border-white/5",
|
|
464
|
+
// Shadow
|
|
465
|
+
"shadow-md",
|
|
466
|
+
// Out animation (always the same — just fade)
|
|
467
|
+
"data-[state=closed]:animate-tooltip-out",
|
|
468
|
+
// In animation — direction-aware
|
|
469
|
+
ANIMATION[placement]
|
|
470
|
+
].join(" "),
|
|
408
471
|
children: [
|
|
409
472
|
title,
|
|
410
|
-
/* @__PURE__ */ jsx(
|
|
473
|
+
/* @__PURE__ */ jsx(
|
|
474
|
+
TooltipPrimitive.Arrow,
|
|
475
|
+
{
|
|
476
|
+
width: 10,
|
|
477
|
+
height: 5,
|
|
478
|
+
className: "fill-foreground/95"
|
|
479
|
+
}
|
|
480
|
+
)
|
|
411
481
|
]
|
|
412
482
|
}
|
|
413
483
|
) })
|
|
@@ -659,71 +729,151 @@ var NotificationContext = createContext({
|
|
|
659
729
|
open: () => void 0,
|
|
660
730
|
close: () => void 0
|
|
661
731
|
});
|
|
662
|
-
var
|
|
663
|
-
info: "bg-info",
|
|
664
|
-
success: "bg-success",
|
|
665
|
-
warning: "bg-warning",
|
|
666
|
-
danger: "bg-error"
|
|
732
|
+
var TYPE_BG = {
|
|
733
|
+
info: "bg-status-info",
|
|
734
|
+
success: "bg-status-success",
|
|
735
|
+
warning: "bg-status-warning",
|
|
736
|
+
danger: "bg-status-error"
|
|
737
|
+
};
|
|
738
|
+
var VIEWPORT_CLASSES = {
|
|
739
|
+
"top-right": "fixed top-14 right-0 flex flex-col items-end",
|
|
740
|
+
"top-left": "fixed top-14 left-0 flex flex-col items-start",
|
|
741
|
+
"top-center": "fixed top-14 left-1/2 flex flex-col items-center -translate-x-1/2",
|
|
742
|
+
"bottom-right": "fixed bottom-4 right-0 flex flex-col-reverse items-end",
|
|
743
|
+
"bottom-left": "fixed bottom-4 left-0 flex flex-col-reverse items-start",
|
|
744
|
+
"bottom-center": "fixed bottom-4 left-1/2 flex flex-col-reverse items-center -translate-x-1/2"
|
|
667
745
|
};
|
|
746
|
+
function getInitialMotion(pos, reduced) {
|
|
747
|
+
if (reduced) return { opacity: 0, x: 0, y: 0, scale: 1 };
|
|
748
|
+
const right = pos.endsWith("right");
|
|
749
|
+
const left = pos.endsWith("left");
|
|
750
|
+
const center = pos.endsWith("center");
|
|
751
|
+
const bottom = pos.startsWith("bottom");
|
|
752
|
+
return {
|
|
753
|
+
opacity: 0,
|
|
754
|
+
x: right ? 40 : left ? -40 : 0,
|
|
755
|
+
y: center ? bottom ? 12 : -12 : 0,
|
|
756
|
+
scale: center ? 0.96 : 1
|
|
757
|
+
};
|
|
758
|
+
}
|
|
668
759
|
function TypeIcon({ type }) {
|
|
669
760
|
if (type === "success") {
|
|
670
|
-
return /* @__PURE__ */ jsx("svg", { width: "
|
|
671
|
-
"path",
|
|
672
|
-
{
|
|
673
|
-
fillRule: "evenodd",
|
|
674
|
-
clipRule: "evenodd",
|
|
675
|
-
d: "M14 0.25C6.40625 0.25 0.25 6.40625 0.25 14C0.25 21.5937 6.40625 27.75 14 27.75C21.5937 27.75 27.75 21.5937 27.75 14C27.75 6.40625 21.5937 0.25 14 0.25ZM19.96 11.675C20.0697 11.5496 20.1533 11.4034 20.2057 11.2452C20.2582 11.087 20.2784 10.9199 20.2653 10.7537C20.2522 10.5876 20.206 10.4257 20.1295 10.2777C20.0529 10.1296 19.9475 9.99838 19.8194 9.89168C19.6914 9.78497 19.5433 9.70495 19.3839 9.65633C19.2244 9.6077 19.0569 9.59145 18.8911 9.60853C18.7253 9.62562 18.5646 9.67568 18.4184 9.75579C18.2723 9.8359 18.1436 9.94443 18.04 10.075L12.665 16.5237L9.88375 13.7412C9.648 13.5136 9.33224 13.3876 9.0045 13.3904C8.67675 13.3933 8.36324 13.5247 8.13148 13.7565C7.89972 13.9882 7.76825 14.3018 7.76541 14.6295C7.76256 14.9572 7.88855 15.273 8.11625 15.5087L11.8662 19.2587C11.9891 19.3815 12.1361 19.4773 12.298 19.5401C12.4599 19.6028 12.6331 19.6312 12.8066 19.6233C12.98 19.6154 13.15 19.5715 13.3055 19.4943C13.4611 19.4171 13.5988 19.3084 13.71 19.175L19.96 11.675Z",
|
|
676
|
-
fill: "#fff"
|
|
677
|
-
}
|
|
678
|
-
) });
|
|
761
|
+
return /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx("polyline", { points: "20 6 9 17 4 12" }) });
|
|
679
762
|
}
|
|
680
763
|
if (type === "info") {
|
|
681
|
-
return /* @__PURE__ */
|
|
764
|
+
return /* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
765
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
766
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
|
|
767
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
|
|
768
|
+
] });
|
|
682
769
|
}
|
|
683
770
|
if (type === "warning") {
|
|
684
|
-
return /* @__PURE__ */
|
|
771
|
+
return /* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
772
|
+
/* @__PURE__ */ jsx("path", { d: "M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }),
|
|
773
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
|
|
774
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
|
|
775
|
+
] });
|
|
685
776
|
}
|
|
686
|
-
return /* @__PURE__ */
|
|
777
|
+
return /* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
778
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
779
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }),
|
|
780
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })
|
|
781
|
+
] });
|
|
782
|
+
}
|
|
783
|
+
function NotificationItem({
|
|
784
|
+
n,
|
|
785
|
+
pos,
|
|
786
|
+
onClose,
|
|
787
|
+
reduced
|
|
788
|
+
}) {
|
|
789
|
+
const initial = getInitialMotion(pos, reduced);
|
|
790
|
+
const center = pos.endsWith("center");
|
|
791
|
+
return /* @__PURE__ */ jsx(
|
|
792
|
+
motion.div,
|
|
793
|
+
{
|
|
794
|
+
layout: true,
|
|
795
|
+
initial,
|
|
796
|
+
animate: { opacity: 1, x: 0, y: 0, scale: 1 },
|
|
797
|
+
exit: { ...initial, opacity: 0 },
|
|
798
|
+
transition: reduced ? { duration: 0 } : {
|
|
799
|
+
opacity: { duration: 0.14 },
|
|
800
|
+
x: { type: "tween", duration: 0.22, ease: [0.16, 1, 0.3, 1] },
|
|
801
|
+
y: { type: "tween", duration: 0.22, ease: [0.16, 1, 0.3, 1] },
|
|
802
|
+
scale: { type: "tween", duration: 0.22, ease: [0.16, 1, 0.3, 1] },
|
|
803
|
+
layout: { duration: 0.18 }
|
|
804
|
+
},
|
|
805
|
+
children: /* @__PURE__ */ jsx(
|
|
806
|
+
Toast.Root,
|
|
807
|
+
{
|
|
808
|
+
open: true,
|
|
809
|
+
duration: n.duration,
|
|
810
|
+
onOpenChange: (o) => {
|
|
811
|
+
if (!o) onClose(n.id);
|
|
812
|
+
},
|
|
813
|
+
className: [
|
|
814
|
+
"w-[300px] rounded-md shadow-lg overflow-hidden",
|
|
815
|
+
center ? "mx-auto" : "",
|
|
816
|
+
"focus:outline-none",
|
|
817
|
+
TYPE_BG[n.type ?? "info"]
|
|
818
|
+
].join(" "),
|
|
819
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3 p-3 pr-2.5", children: [
|
|
820
|
+
/* @__PURE__ */ jsx("span", { className: "mt-0.5 flex-shrink-0 text-white/90", children: /* @__PURE__ */ jsx(TypeIcon, { type: n.type ?? "info" }) }),
|
|
821
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
822
|
+
/* @__PURE__ */ jsx(Toast.Title, { className: "text-sm font-semibold text-white leading-snug", children: n.title }),
|
|
823
|
+
n.description && /* @__PURE__ */ jsx(Toast.Description, { className: "mt-0.5 text-xs text-white/75 leading-relaxed", children: n.description })
|
|
824
|
+
] }),
|
|
825
|
+
/* @__PURE__ */ jsx(Toast.Action, { asChild: true, altText: "Close", children: /* @__PURE__ */ jsx(
|
|
826
|
+
"button",
|
|
827
|
+
{
|
|
828
|
+
"aria-label": "Close",
|
|
829
|
+
onClick: () => onClose(n.id),
|
|
830
|
+
className: "flex-shrink-0 mt-0.5 rounded p-1 text-white/60 hover:text-white hover:bg-white/15 transition-colors duration-100 focus:outline-none focus-visible:ring-1 focus-visible:ring-white/50",
|
|
831
|
+
children: /* @__PURE__ */ jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M9 3L3 9M3 3l6 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) })
|
|
832
|
+
}
|
|
833
|
+
) })
|
|
834
|
+
] })
|
|
835
|
+
}
|
|
836
|
+
)
|
|
837
|
+
}
|
|
838
|
+
);
|
|
687
839
|
}
|
|
688
|
-
function NotificationProvider({
|
|
840
|
+
function NotificationProvider({
|
|
841
|
+
children,
|
|
842
|
+
position = "top-right"
|
|
843
|
+
}) {
|
|
689
844
|
const [notifications, setNotifications] = useState([]);
|
|
845
|
+
const reduced = useReducedMotion();
|
|
690
846
|
const open = (payload) => {
|
|
691
|
-
setNotifications((prev) => [
|
|
847
|
+
setNotifications((prev) => [
|
|
848
|
+
...prev,
|
|
849
|
+
{ duration: 4e3, ...payload, id: Date.now() + Math.random() }
|
|
850
|
+
]);
|
|
692
851
|
};
|
|
693
852
|
const close = (id) => {
|
|
694
853
|
setNotifications((prev) => prev.filter((n) => n.id !== id));
|
|
695
854
|
};
|
|
696
|
-
return /* @__PURE__ */ jsx(NotificationContext.Provider, { value: { open, close }, children: /* @__PURE__ */ jsxs(Toast.Provider, { swipeDirection: "right", children: [
|
|
855
|
+
return /* @__PURE__ */ jsx(NotificationContext.Provider, { value: { open, close }, children: /* @__PURE__ */ jsxs(Toast.Provider, { swipeDirection: position.endsWith("right") ? "right" : position.endsWith("left") ? "left" : "up", children: [
|
|
697
856
|
children,
|
|
698
|
-
|
|
699
|
-
Toast.
|
|
857
|
+
/* @__PURE__ */ jsx(
|
|
858
|
+
Toast.Viewport,
|
|
700
859
|
{
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
}
|
|
719
|
-
) })
|
|
720
|
-
] }),
|
|
721
|
-
n.description && /* @__PURE__ */ jsx(Toast.Description, { className: "text-center mt-1 text-sm", children: n.description })
|
|
722
|
-
]
|
|
723
|
-
},
|
|
724
|
-
n.id
|
|
725
|
-
)),
|
|
726
|
-
/* @__PURE__ */ jsx(Toast.Viewport, { className: "fixed top-[50px] right-0 flex flex-col gap-2 w-[350px] z-[500000] p-4 outline-none" })
|
|
860
|
+
asChild: true,
|
|
861
|
+
className: [
|
|
862
|
+
VIEWPORT_CLASSES[position],
|
|
863
|
+
"z-[500000] gap-2 w-[332px] p-4 outline-none"
|
|
864
|
+
].join(" "),
|
|
865
|
+
children: /* @__PURE__ */ jsx("ul", { children: /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: notifications.map((n) => /* @__PURE__ */ jsx(
|
|
866
|
+
NotificationItem,
|
|
867
|
+
{
|
|
868
|
+
n,
|
|
869
|
+
pos: position,
|
|
870
|
+
onClose: close,
|
|
871
|
+
reduced
|
|
872
|
+
},
|
|
873
|
+
n.id
|
|
874
|
+
)) }) })
|
|
875
|
+
}
|
|
876
|
+
)
|
|
727
877
|
] }) });
|
|
728
878
|
}
|
|
729
879
|
function useNotification() {
|
|
@@ -1700,29 +1850,319 @@ function Table({
|
|
|
1700
1850
|
/* @__PURE__ */ jsx("div", { children: footer })
|
|
1701
1851
|
] });
|
|
1702
1852
|
}
|
|
1703
|
-
function
|
|
1853
|
+
function ThemeSwitch({ checked, onChange, label = "Toggle dark mode" }) {
|
|
1704
1854
|
const id = useId();
|
|
1705
|
-
return /* @__PURE__ */ jsx("
|
|
1855
|
+
return /* @__PURE__ */ jsx("label", { htmlFor: id, className: "flex items-center gap-2 cursor-pointer select-none", children: /* @__PURE__ */ jsx(
|
|
1706
1856
|
SwitchPrimitive.Root,
|
|
1707
1857
|
{
|
|
1708
1858
|
id,
|
|
1709
1859
|
checked,
|
|
1710
1860
|
onCheckedChange: (c) => onChange({ target: { checked: c } }),
|
|
1711
|
-
|
|
1861
|
+
"aria-label": label,
|
|
1862
|
+
className: [
|
|
1863
|
+
"relative inline-flex h-6 w-11 items-center rounded-full",
|
|
1864
|
+
"transition-colors duration-200",
|
|
1865
|
+
"bg-foreground-secondary data-[state=checked]:bg-accent",
|
|
1866
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2"
|
|
1867
|
+
].join(" "),
|
|
1712
1868
|
children: /* @__PURE__ */ jsx(
|
|
1713
1869
|
SwitchPrimitive.Thumb,
|
|
1714
1870
|
{
|
|
1715
|
-
className:
|
|
1716
|
-
|
|
1717
|
-
"
|
|
1871
|
+
className: [
|
|
1872
|
+
"pointer-events-none block h-5 w-5 rounded-full shadow-sm",
|
|
1873
|
+
"transition-transform duration-200",
|
|
1874
|
+
"data-[state=checked]:translate-x-[22px]",
|
|
1875
|
+
"data-[state=unchecked]:translate-x-[2px]",
|
|
1876
|
+
// Moon icon (dark mode indicator) when checked, sun when unchecked
|
|
1877
|
+
checked ? "bg-oxford-blue-900" : "bg-white"
|
|
1878
|
+
].join(" "),
|
|
1879
|
+
children: checked ? (
|
|
1880
|
+
// Moon
|
|
1881
|
+
/* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", fill: "currentColor", className: "w-3 h-3 m-1 text-manatee", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z" }) })
|
|
1882
|
+
) : (
|
|
1883
|
+
// Sun
|
|
1884
|
+
/* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", fill: "currentColor", className: "w-3 h-3 m-1 text-usafa-blue", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M8 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0 1a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707z" }) })
|
|
1885
|
+
)
|
|
1886
|
+
}
|
|
1887
|
+
)
|
|
1888
|
+
}
|
|
1889
|
+
) });
|
|
1890
|
+
}
|
|
1891
|
+
function TopBar({
|
|
1892
|
+
brand,
|
|
1893
|
+
center,
|
|
1894
|
+
actions,
|
|
1895
|
+
height = 56,
|
|
1896
|
+
className = ""
|
|
1897
|
+
}) {
|
|
1898
|
+
return /* @__PURE__ */ jsxs(
|
|
1899
|
+
"header",
|
|
1900
|
+
{
|
|
1901
|
+
className: [
|
|
1902
|
+
"sticky top-0 z-[100]",
|
|
1903
|
+
"flex items-center justify-between gap-4",
|
|
1904
|
+
"border-b border-border bg-surface",
|
|
1905
|
+
"px-4 md:px-6",
|
|
1906
|
+
className
|
|
1907
|
+
].join(" "),
|
|
1908
|
+
style: {
|
|
1909
|
+
height,
|
|
1910
|
+
// Expose as CSS var so consumers can write:
|
|
1911
|
+
// padding-top: calc(var(--topbar-height) + 1rem)
|
|
1912
|
+
["--topbar-height"]: `${height}px`
|
|
1913
|
+
},
|
|
1914
|
+
children: [
|
|
1915
|
+
brand !== void 0 ? /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 flex-shrink-0", children: brand }) : (
|
|
1916
|
+
// Reserve leading space even when brand is null so center stays centred
|
|
1917
|
+
/* @__PURE__ */ jsx("div", { "aria-hidden": "true", className: "flex-shrink-0 w-0" })
|
|
1918
|
+
),
|
|
1919
|
+
center !== void 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-1 items-center justify-center min-w-0", children: center }),
|
|
1920
|
+
actions !== void 0 && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 flex-shrink-0", children: actions })
|
|
1921
|
+
]
|
|
1922
|
+
}
|
|
1923
|
+
);
|
|
1924
|
+
}
|
|
1925
|
+
function NavItem({
|
|
1926
|
+
item,
|
|
1927
|
+
isExpanded
|
|
1928
|
+
}) {
|
|
1929
|
+
const btn = /* @__PURE__ */ jsxs(
|
|
1930
|
+
"button",
|
|
1931
|
+
{
|
|
1932
|
+
type: "button",
|
|
1933
|
+
onClick: item.onClick,
|
|
1934
|
+
className: [
|
|
1935
|
+
"group relative flex w-full items-center gap-2.5 rounded-md",
|
|
1936
|
+
"px-2.5 py-2 transition-colors duration-100",
|
|
1937
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-inset",
|
|
1938
|
+
item.isActive ? "bg-accent/10 text-accent" : "text-foreground-secondary hover:bg-surface-raised hover:text-foreground"
|
|
1939
|
+
].join(" "),
|
|
1940
|
+
children: [
|
|
1941
|
+
/* @__PURE__ */ jsxs("span", { className: "relative flex h-5 w-5 flex-shrink-0 items-center justify-center", children: [
|
|
1942
|
+
item.icon,
|
|
1943
|
+
item.badge !== void 0 && item.badge > 0 && /* @__PURE__ */ jsx("span", { className: "absolute -right-1 -top-1 flex h-3.5 w-3.5 items-center justify-center rounded-full bg-status-error text-[9px] font-bold text-white leading-none", children: item.badge > 99 ? "99+" : item.badge })
|
|
1944
|
+
] }),
|
|
1945
|
+
isExpanded && /* @__PURE__ */ jsx(
|
|
1946
|
+
motion.span,
|
|
1947
|
+
{
|
|
1948
|
+
initial: false,
|
|
1949
|
+
animate: { opacity: 1 },
|
|
1950
|
+
className: "truncate text-sm font-medium",
|
|
1951
|
+
children: item.label
|
|
1952
|
+
}
|
|
1953
|
+
),
|
|
1954
|
+
item.isActive && /* @__PURE__ */ jsx("span", { className: "absolute inset-y-0 left-0 w-[3px] rounded-r-full bg-accent" })
|
|
1955
|
+
]
|
|
1956
|
+
}
|
|
1957
|
+
);
|
|
1958
|
+
if (isExpanded) return btn;
|
|
1959
|
+
return /* @__PURE__ */ jsx(Tooltip, { title: item.label, placement: "right", delayDuration: 200, children: btn });
|
|
1960
|
+
}
|
|
1961
|
+
function Sidebar({
|
|
1962
|
+
sections,
|
|
1963
|
+
isExpanded,
|
|
1964
|
+
onToggle,
|
|
1965
|
+
expandedWidth = 220,
|
|
1966
|
+
collapsedWidth = 52,
|
|
1967
|
+
footer
|
|
1968
|
+
}) {
|
|
1969
|
+
return /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxs(
|
|
1970
|
+
motion.aside,
|
|
1971
|
+
{
|
|
1972
|
+
initial: false,
|
|
1973
|
+
animate: { width: isExpanded ? expandedWidth : collapsedWidth },
|
|
1974
|
+
transition: { type: "tween", duration: 0.22, ease: [0.16, 1, 0.3, 1] },
|
|
1975
|
+
className: "relative flex h-full flex-col border-r border-border bg-surface overflow-hidden flex-shrink-0",
|
|
1976
|
+
children: [
|
|
1977
|
+
/* @__PURE__ */ jsxs("div", { className: [
|
|
1978
|
+
"flex h-14 flex-shrink-0 items-center border-b border-border",
|
|
1979
|
+
isExpanded ? "justify-between px-3" : "justify-center px-1.5"
|
|
1980
|
+
].join(" "), children: [
|
|
1981
|
+
isExpanded && /* @__PURE__ */ jsx(
|
|
1982
|
+
motion.span,
|
|
1718
1983
|
{
|
|
1719
|
-
|
|
1984
|
+
initial: { opacity: 0 },
|
|
1985
|
+
animate: { opacity: 1 },
|
|
1986
|
+
transition: { delay: 0.08 },
|
|
1987
|
+
className: "text-xs font-semibold uppercase tracking-widest text-foreground-muted select-none",
|
|
1988
|
+
children: "Menu"
|
|
1720
1989
|
}
|
|
1721
|
-
)
|
|
1990
|
+
),
|
|
1991
|
+
/* @__PURE__ */ jsx(Tooltip, { title: isExpanded ? "Collapse menu" : "Expand menu", placement: "right", delayDuration: 500, children: /* @__PURE__ */ jsx(
|
|
1992
|
+
"button",
|
|
1993
|
+
{
|
|
1994
|
+
type: "button",
|
|
1995
|
+
onClick: onToggle,
|
|
1996
|
+
"aria-label": isExpanded ? "Collapse sidebar" : "Expand sidebar",
|
|
1997
|
+
className: "flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md text-foreground-muted hover:bg-surface-raised hover:text-foreground transition-colors duration-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",
|
|
1998
|
+
children: /* @__PURE__ */ jsx(
|
|
1999
|
+
motion.svg,
|
|
2000
|
+
{
|
|
2001
|
+
viewBox: "0 0 20 20",
|
|
2002
|
+
fill: "none",
|
|
2003
|
+
stroke: "currentColor",
|
|
2004
|
+
strokeWidth: "1.8",
|
|
2005
|
+
strokeLinecap: "round",
|
|
2006
|
+
strokeLinejoin: "round",
|
|
2007
|
+
className: "h-4 w-4",
|
|
2008
|
+
animate: { rotate: isExpanded ? 0 : 180 },
|
|
2009
|
+
transition: { type: "tween", duration: 0.22 },
|
|
2010
|
+
children: /* @__PURE__ */ jsx("path", { d: "M13 5l-5 5 5 5" })
|
|
2011
|
+
}
|
|
2012
|
+
)
|
|
2013
|
+
}
|
|
2014
|
+
) })
|
|
2015
|
+
] }),
|
|
2016
|
+
/* @__PURE__ */ jsx("nav", { className: "flex-1 overflow-y-auto overflow-x-hidden py-2 px-1.5 space-y-0.5", children: sections.map((section, si) => /* @__PURE__ */ jsxs("div", { className: si > 0 ? "pt-3" : "", children: [
|
|
2017
|
+
section.title && isExpanded && /* @__PURE__ */ jsx(
|
|
2018
|
+
motion.p,
|
|
2019
|
+
{
|
|
2020
|
+
initial: { opacity: 0 },
|
|
2021
|
+
animate: { opacity: 1 },
|
|
2022
|
+
transition: { delay: 0.06 },
|
|
2023
|
+
className: "px-2.5 pb-1 text-[10px] font-semibold uppercase tracking-widest text-foreground-muted select-none",
|
|
2024
|
+
children: section.title
|
|
2025
|
+
}
|
|
2026
|
+
),
|
|
2027
|
+
section.items.map((item) => /* @__PURE__ */ jsx(NavItem, { item, isExpanded }, item.key))
|
|
2028
|
+
] }, section.key)) }),
|
|
2029
|
+
footer && /* @__PURE__ */ jsx("div", { className: [
|
|
2030
|
+
"flex flex-shrink-0 items-center border-t border-border py-2",
|
|
2031
|
+
isExpanded ? "px-3 gap-2" : "justify-center px-1.5"
|
|
2032
|
+
].join(" "), children: footer })
|
|
2033
|
+
]
|
|
2034
|
+
}
|
|
2035
|
+
) });
|
|
2036
|
+
}
|
|
2037
|
+
function AppShell({
|
|
2038
|
+
topBar,
|
|
2039
|
+
sidebarSections = [],
|
|
2040
|
+
sidebarExpandedWidth = 220,
|
|
2041
|
+
sidebarCollapsedWidth = 52,
|
|
2042
|
+
sidebarDefaultExpanded = false,
|
|
2043
|
+
sidebarFooter,
|
|
2044
|
+
children,
|
|
2045
|
+
className = ""
|
|
2046
|
+
}) {
|
|
2047
|
+
const [expanded, setExpanded] = useState(sidebarDefaultExpanded);
|
|
2048
|
+
return /* @__PURE__ */ jsxs("div", { className: `flex flex-col h-screen bg-background ${className}`, children: [
|
|
2049
|
+
topBar && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 z-[200]", children: topBar }),
|
|
2050
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-1 overflow-hidden", children: [
|
|
2051
|
+
sidebarSections.length > 0 && /* @__PURE__ */ jsx(
|
|
2052
|
+
Sidebar,
|
|
2053
|
+
{
|
|
2054
|
+
sections: sidebarSections,
|
|
2055
|
+
isExpanded: expanded,
|
|
2056
|
+
onToggle: () => setExpanded((e) => !e),
|
|
2057
|
+
expandedWidth: sidebarExpandedWidth,
|
|
2058
|
+
collapsedWidth: sidebarCollapsedWidth,
|
|
2059
|
+
footer: sidebarFooter
|
|
2060
|
+
}
|
|
2061
|
+
),
|
|
2062
|
+
/* @__PURE__ */ jsx(
|
|
2063
|
+
motion.main,
|
|
2064
|
+
{
|
|
2065
|
+
className: "flex-1 overflow-y-auto overflow-x-hidden",
|
|
2066
|
+
animate: { marginLeft: 0 },
|
|
2067
|
+
transition: { type: "tween", duration: 0.22, ease: [0.16, 1, 0.3, 1] },
|
|
2068
|
+
children: /* @__PURE__ */ jsx("div", { className: "h-full p-6", children })
|
|
1722
2069
|
}
|
|
1723
2070
|
)
|
|
2071
|
+
] })
|
|
2072
|
+
] });
|
|
2073
|
+
}
|
|
2074
|
+
var SHIMMER = [
|
|
2075
|
+
"animate-shimmer rounded-sm",
|
|
2076
|
+
"bg-[length:400%_100%]",
|
|
2077
|
+
"bg-gradient-to-r",
|
|
2078
|
+
"from-border via-border-strong/40 to-border"
|
|
2079
|
+
].join(" ");
|
|
2080
|
+
function SkeletonBox({ width, height = 16, radius, className = "", style }) {
|
|
2081
|
+
return /* @__PURE__ */ jsx(
|
|
2082
|
+
"span",
|
|
2083
|
+
{
|
|
2084
|
+
role: "presentation",
|
|
2085
|
+
"aria-hidden": "true",
|
|
2086
|
+
className: `block ${SHIMMER} ${className}`,
|
|
2087
|
+
style: {
|
|
2088
|
+
width: width ?? "100%",
|
|
2089
|
+
height,
|
|
2090
|
+
borderRadius: radius ?? "var(--radius-md)",
|
|
2091
|
+
...style
|
|
2092
|
+
}
|
|
1724
2093
|
}
|
|
1725
|
-
)
|
|
2094
|
+
);
|
|
2095
|
+
}
|
|
2096
|
+
function SkeletonText({
|
|
2097
|
+
lines = 3,
|
|
2098
|
+
lastLineWidth = 60,
|
|
2099
|
+
lineHeight = 14,
|
|
2100
|
+
gap = 8,
|
|
2101
|
+
className = "",
|
|
2102
|
+
style
|
|
2103
|
+
}) {
|
|
2104
|
+
return /* @__PURE__ */ jsx(
|
|
2105
|
+
"div",
|
|
2106
|
+
{
|
|
2107
|
+
role: "presentation",
|
|
2108
|
+
"aria-hidden": "true",
|
|
2109
|
+
className: `flex flex-col ${className}`,
|
|
2110
|
+
style: { gap, ...style },
|
|
2111
|
+
children: Array.from({ length: lines }).map((_, i) => {
|
|
2112
|
+
const isLast = i === lines - 1;
|
|
2113
|
+
const width = isLast && lines > 1 ? `${lastLineWidth}%` : "100%";
|
|
2114
|
+
return /* @__PURE__ */ jsx(
|
|
2115
|
+
"span",
|
|
2116
|
+
{
|
|
2117
|
+
className: `block ${SHIMMER}`,
|
|
2118
|
+
style: { height: lineHeight, width, borderRadius: "var(--radius-sm)" }
|
|
2119
|
+
},
|
|
2120
|
+
i
|
|
2121
|
+
);
|
|
2122
|
+
})
|
|
2123
|
+
}
|
|
2124
|
+
);
|
|
2125
|
+
}
|
|
2126
|
+
function SkeletonCircle({ size = 40, className = "", style }) {
|
|
2127
|
+
return /* @__PURE__ */ jsx(
|
|
2128
|
+
"span",
|
|
2129
|
+
{
|
|
2130
|
+
role: "presentation",
|
|
2131
|
+
"aria-hidden": "true",
|
|
2132
|
+
className: `block flex-shrink-0 ${SHIMMER} ${className}`,
|
|
2133
|
+
style: {
|
|
2134
|
+
width: size,
|
|
2135
|
+
height: size,
|
|
2136
|
+
borderRadius: "50%",
|
|
2137
|
+
...style
|
|
2138
|
+
}
|
|
2139
|
+
}
|
|
2140
|
+
);
|
|
2141
|
+
}
|
|
2142
|
+
function SkeletonCard({ hasAvatar = true, lines = 3, className = "", style }) {
|
|
2143
|
+
return /* @__PURE__ */ jsxs(
|
|
2144
|
+
"div",
|
|
2145
|
+
{
|
|
2146
|
+
role: "presentation",
|
|
2147
|
+
"aria-hidden": "true",
|
|
2148
|
+
className: `rounded-lg border border-border bg-surface p-4 ${className}`,
|
|
2149
|
+
style,
|
|
2150
|
+
children: [
|
|
2151
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 mb-4", children: [
|
|
2152
|
+
hasAvatar && /* @__PURE__ */ jsx(SkeletonCircle, { size: 36 }),
|
|
2153
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 flex flex-col gap-2", children: [
|
|
2154
|
+
/* @__PURE__ */ jsx(SkeletonBox, { height: 12, width: "55%" }),
|
|
2155
|
+
/* @__PURE__ */ jsx(SkeletonBox, { height: 10, width: "35%" })
|
|
2156
|
+
] })
|
|
2157
|
+
] }),
|
|
2158
|
+
/* @__PURE__ */ jsx(SkeletonText, { lines, lastLineWidth: 55 }),
|
|
2159
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-4 flex gap-2", children: [
|
|
2160
|
+
/* @__PURE__ */ jsx(SkeletonBox, { height: 28, width: 72 }),
|
|
2161
|
+
/* @__PURE__ */ jsx(SkeletonBox, { height: 28, width: 56 })
|
|
2162
|
+
] })
|
|
2163
|
+
]
|
|
2164
|
+
}
|
|
2165
|
+
);
|
|
1726
2166
|
}
|
|
1727
2167
|
function TextInput({
|
|
1728
2168
|
value,
|
|
@@ -1947,59 +2387,85 @@ function Password({
|
|
|
1947
2387
|
] });
|
|
1948
2388
|
}
|
|
1949
2389
|
function Checkbox({
|
|
1950
|
-
|
|
1951
|
-
|
|
2390
|
+
checked,
|
|
2391
|
+
value,
|
|
2392
|
+
// legacy alias
|
|
2393
|
+
onChange,
|
|
1952
2394
|
label,
|
|
1953
2395
|
name,
|
|
1954
2396
|
htmlFor,
|
|
1955
2397
|
errorMessage,
|
|
1956
|
-
|
|
1957
|
-
onChange
|
|
2398
|
+
disabled = false
|
|
1958
2399
|
}) {
|
|
1959
|
-
|
|
2400
|
+
const isChecked = checked ?? value ?? false;
|
|
2401
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
1960
2402
|
/* @__PURE__ */ jsxs(
|
|
1961
|
-
"
|
|
2403
|
+
"label",
|
|
1962
2404
|
{
|
|
1963
|
-
|
|
2405
|
+
htmlFor,
|
|
2406
|
+
className: [
|
|
2407
|
+
"inline-flex items-center gap-2.5",
|
|
2408
|
+
disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"
|
|
2409
|
+
].join(" "),
|
|
1964
2410
|
children: [
|
|
1965
|
-
/* @__PURE__ */ jsx(
|
|
1966
|
-
"label",
|
|
1967
|
-
{
|
|
1968
|
-
htmlFor,
|
|
1969
|
-
className: "font-bold text-md text-prussian-blue dark:text-white cursor-pointer",
|
|
1970
|
-
children: label
|
|
1971
|
-
}
|
|
1972
|
-
),
|
|
1973
2411
|
/* @__PURE__ */ jsx(
|
|
1974
2412
|
CheckboxPrimitive.Root,
|
|
1975
2413
|
{
|
|
1976
2414
|
id: htmlFor,
|
|
1977
2415
|
name,
|
|
1978
|
-
checked:
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
2416
|
+
checked: isChecked,
|
|
2417
|
+
disabled,
|
|
2418
|
+
onCheckedChange: (c) => onChange?.({ target: { checked: !!c, id: htmlFor, name } }),
|
|
2419
|
+
className: [
|
|
2420
|
+
// Box
|
|
2421
|
+
"relative flex h-[18px] w-[18px] flex-shrink-0 items-center justify-center",
|
|
2422
|
+
"rounded-sm border transition-colors duration-150",
|
|
2423
|
+
// Unchecked
|
|
2424
|
+
"border-border-strong bg-surface",
|
|
2425
|
+
// Checked
|
|
2426
|
+
"data-[state=checked]:bg-accent data-[state=checked]:border-accent",
|
|
2427
|
+
// Focus
|
|
2428
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1",
|
|
2429
|
+
// Disabled
|
|
2430
|
+
"disabled:cursor-not-allowed"
|
|
2431
|
+
].join(" "),
|
|
1983
2432
|
"aria-label": typeof label === "string" ? label : void 0,
|
|
1984
|
-
children: /* @__PURE__ */ jsx(
|
|
1985
|
-
|
|
2433
|
+
children: /* @__PURE__ */ jsx(
|
|
2434
|
+
CheckboxPrimitive.Indicator,
|
|
1986
2435
|
{
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
2436
|
+
className: "flex items-center justify-center data-[state=checked]:animate-check-pop",
|
|
2437
|
+
children: /* @__PURE__ */ jsx(
|
|
2438
|
+
"svg",
|
|
2439
|
+
{
|
|
2440
|
+
width: "11",
|
|
2441
|
+
height: "9",
|
|
2442
|
+
viewBox: "0 0 11 9",
|
|
2443
|
+
fill: "none",
|
|
2444
|
+
"aria-hidden": "true",
|
|
2445
|
+
children: /* @__PURE__ */ jsx(
|
|
2446
|
+
"path",
|
|
2447
|
+
{
|
|
2448
|
+
d: "M1 4.5L4 7.5L10 1",
|
|
2449
|
+
stroke: "white",
|
|
2450
|
+
strokeWidth: "1.8",
|
|
2451
|
+
strokeLinecap: "round",
|
|
2452
|
+
strokeLinejoin: "round"
|
|
2453
|
+
}
|
|
2454
|
+
)
|
|
2455
|
+
}
|
|
2456
|
+
)
|
|
1992
2457
|
}
|
|
1993
|
-
)
|
|
2458
|
+
)
|
|
1994
2459
|
}
|
|
1995
|
-
)
|
|
2460
|
+
),
|
|
2461
|
+
label && /* @__PURE__ */ jsx("span", { className: "text-sm text-foreground-secondary select-none leading-snug", children: label })
|
|
1996
2462
|
]
|
|
1997
2463
|
}
|
|
1998
2464
|
),
|
|
1999
|
-
/* @__PURE__ */ jsx("
|
|
2465
|
+
errorMessage && /* @__PURE__ */ jsx("span", { className: "text-xs text-status-error pl-[26px]", children: errorMessage })
|
|
2000
2466
|
] });
|
|
2001
2467
|
}
|
|
2002
|
-
function
|
|
2468
|
+
function Switch({
|
|
2003
2469
|
checked = false,
|
|
2004
2470
|
onChange,
|
|
2005
2471
|
checkedIcon,
|
|
@@ -2599,6 +3065,6 @@ Temporal.DatePicker = DatePickerBase;
|
|
|
2599
3065
|
Temporal.TemporalPicker = TemporalPickerBase;
|
|
2600
3066
|
var DatePicker_default = Temporal;
|
|
2601
3067
|
|
|
2602
|
-
export { AutoComplete, Button, Catalog, CatalogCarousel, CatalogGrid, Checkbox, ContextMenu, Drawer, Dropdown, DropdownPill, FadingBase, FileInput, GridCard, icons_default as Icon, IconButton, List2 as List, LoadingSpinner, MenuBar, MenuBarItem, Modal, NotificationProvider, NumberInput, OpaqueGridCard, Password, ScalableContainer, SearchInput_default as SearchInput,
|
|
3068
|
+
export { AppShell, AutoComplete, Button, Catalog, CatalogCarousel, CatalogGrid, Checkbox, ContextMenu, Drawer, Dropdown, DropdownPill, FadingBase, FileInput, GridCard, icons_default as Icon, IconButton, List2 as List, LoadingSpinner, MenuBar, MenuBarItem, Modal, NotificationProvider, NumberInput, OpaqueGridCard, Password, ScalableContainer, SearchInput_default as SearchInput, Sidebar, SkeletonBox, SkeletonCard, SkeletonCircle, SkeletonText, Switch, Table, Tabs, DatePicker_default as Temporal, TextInput, ThemeSwitch, ToggleButton, Tooltip, TooltipProvider, TopBar, Tree, TreeSelect, Wizard, useNotification };
|
|
2603
3069
|
//# sourceMappingURL=index.js.map
|
|
2604
3070
|
//# sourceMappingURL=index.js.map
|