@onesaz/ui 0.4.10 → 0.4.12
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/index.d.ts +53 -3
- package/dist/index.js +494 -400
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -870,28 +870,28 @@ var useButtonGroup = () => React6.useContext(ButtonGroupContext);
|
|
|
870
870
|
var colorMap = {
|
|
871
871
|
success: {
|
|
872
872
|
contained: "bg-success-500 text-white hover:bg-success-600 dark:bg-success-600 dark:hover:bg-success-700",
|
|
873
|
-
|
|
873
|
+
outlined: "border border-success-500 bg-transparent text-success-600 hover:bg-success-500/10 dark:text-success-400 dark:hover:bg-success-500/10",
|
|
874
874
|
secondary: "bg-success-500/10 text-success-700 hover:bg-success-500/15 dark:text-success-300 dark:hover:bg-success-500/15",
|
|
875
875
|
ghost: "text-success-600 hover:bg-success-500/10 dark:text-success-400 dark:hover:bg-success-500/10",
|
|
876
876
|
link: "text-success-600 dark:text-success-400"
|
|
877
877
|
},
|
|
878
878
|
warning: {
|
|
879
879
|
contained: "bg-warning-500 text-white hover:bg-warning-600 dark:bg-warning-600 dark:hover:bg-warning-700",
|
|
880
|
-
|
|
880
|
+
outlined: "border border-warning-500 bg-transparent text-warning-600 hover:bg-warning-500/10 dark:text-warning-400 dark:hover:bg-warning-500/10",
|
|
881
881
|
secondary: "bg-warning-500/10 text-warning-700 hover:bg-warning-500/15 dark:text-warning-300 dark:hover:bg-warning-500/15",
|
|
882
882
|
ghost: "text-warning-600 hover:bg-warning-500/10 dark:text-warning-400 dark:hover:bg-warning-500/10",
|
|
883
883
|
link: "text-warning-600 dark:text-warning-400"
|
|
884
884
|
},
|
|
885
885
|
error: {
|
|
886
886
|
contained: "bg-error-500 text-white hover:bg-error-600 dark:bg-error-600 dark:hover:bg-error-700",
|
|
887
|
-
|
|
887
|
+
outlined: "border border-error-500 bg-transparent text-error-600 hover:bg-error-500/10 dark:text-error-400 dark:hover:bg-error-500/10",
|
|
888
888
|
secondary: "bg-error-500/10 text-error-700 hover:bg-error-500/15 dark:text-error-300 dark:hover:bg-error-500/15",
|
|
889
889
|
ghost: "text-error-600 hover:bg-error-500/10 dark:text-error-400 dark:hover:bg-error-500/10",
|
|
890
890
|
link: "text-error-600 dark:text-error-400"
|
|
891
891
|
},
|
|
892
892
|
destructive: {
|
|
893
893
|
contained: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
894
|
-
|
|
894
|
+
outlined: "border border-destructive bg-transparent text-destructive hover:bg-destructive/10",
|
|
895
895
|
secondary: "bg-destructive/10 text-destructive hover:bg-destructive/20",
|
|
896
896
|
ghost: "text-destructive hover:bg-destructive/10",
|
|
897
897
|
link: "text-destructive"
|
|
@@ -899,8 +899,8 @@ var colorMap = {
|
|
|
899
899
|
};
|
|
900
900
|
function variantToShape(variant) {
|
|
901
901
|
switch (variant) {
|
|
902
|
-
case "
|
|
903
|
-
return "
|
|
902
|
+
case "outlined":
|
|
903
|
+
return "outlined";
|
|
904
904
|
case "secondary":
|
|
905
905
|
return "secondary";
|
|
906
906
|
case "ghost":
|
|
@@ -947,15 +947,15 @@ var Button = React6.forwardRef(
|
|
|
947
947
|
...props
|
|
948
948
|
}, ref) => {
|
|
949
949
|
const groupCtx = useButtonGroup();
|
|
950
|
-
const resolvedVariant = variant ?? groupCtx.variant ?? "
|
|
950
|
+
const resolvedVariant = variant ?? groupCtx.variant ?? "contained";
|
|
951
951
|
const resolvedSize = size ?? "default";
|
|
952
952
|
const resolvedColor = color ?? groupCtx.color ?? "default";
|
|
953
953
|
const resolvedDisabled = disabled ?? groupCtx.disabled;
|
|
954
954
|
const colorOverride = resolvedColor !== "default" ? colorMap[resolvedColor]?.[variantToShape(resolvedVariant)] ?? null : null;
|
|
955
955
|
const variantClasses3 = colorOverride ? null : {
|
|
956
|
-
"bg-accent text-accent-foreground hover:bg-accent-hover": resolvedVariant === "
|
|
956
|
+
"bg-accent text-accent-foreground hover:bg-accent-hover": resolvedVariant === "contained",
|
|
957
957
|
"bg-destructive text-destructive-foreground hover:bg-destructive/90": resolvedVariant === "destructive",
|
|
958
|
-
"border border-input bg-background hover:text-foreground dark:border-border dark:text-foreground dark:hover:bg-muted": resolvedVariant === "
|
|
958
|
+
"border border-input bg-background hover:text-foreground dark:border-border dark:text-foreground dark:hover:bg-muted": resolvedVariant === "outlined",
|
|
959
959
|
"bg-muted text-foreground hover:bg-muted/80": resolvedVariant === "secondary",
|
|
960
960
|
"hover:bg-muted hover:text-foreground": resolvedVariant === "ghost",
|
|
961
961
|
"text-accent underline-offset-4 hover:underline": resolvedVariant === "link"
|
|
@@ -1003,12 +1003,12 @@ var iconButtonSizes = {
|
|
|
1003
1003
|
lg: "h-12 w-12"
|
|
1004
1004
|
};
|
|
1005
1005
|
var IconButton = React6.forwardRef(
|
|
1006
|
-
({ className, variant = "
|
|
1006
|
+
({ className, variant = "contained", color = "default", size = "md", rounded = false, loading = false, ...props }, ref) => {
|
|
1007
1007
|
const colorOverride = color !== "default" ? colorMap[color]?.[variantToShape(variant)] ?? null : null;
|
|
1008
1008
|
const variantClasses3 = colorOverride ? null : {
|
|
1009
|
-
"bg-accent text-accent-foreground hover:bg-accent-hover": variant === "
|
|
1009
|
+
"bg-accent text-accent-foreground hover:bg-accent-hover": variant === "contained",
|
|
1010
1010
|
"bg-destructive text-destructive-foreground hover:bg-destructive/90": variant === "destructive",
|
|
1011
|
-
"border border-input bg-background hover:text-foreground dark:border-border dark:text-foreground dark:hover:bg-muted": variant === "
|
|
1011
|
+
"border border-input bg-background hover:text-foreground dark:border-border dark:text-foreground dark:hover:bg-muted": variant === "outlined",
|
|
1012
1012
|
"bg-muted text-foreground hover:bg-muted/80": variant === "secondary",
|
|
1013
1013
|
"hover:bg-muted hover:text-foreground": variant === "ghost",
|
|
1014
1014
|
"text-accent underline-offset-4 hover:underline": variant === "link"
|
|
@@ -3451,14 +3451,14 @@ Badge.displayName = "Badge";
|
|
|
3451
3451
|
// src/components/chip.tsx
|
|
3452
3452
|
import * as React21 from "react";
|
|
3453
3453
|
import { jsx as jsx21, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3454
|
-
var
|
|
3454
|
+
var containedClasses2 = {
|
|
3455
3455
|
default: "bg-accent text-accent-foreground",
|
|
3456
3456
|
success: "bg-success-500 text-white dark:bg-success-600",
|
|
3457
3457
|
warning: "bg-warning-500 text-white dark:bg-warning-600",
|
|
3458
3458
|
error: "bg-error-500 text-white dark:bg-error-600",
|
|
3459
3459
|
destructive: "bg-destructive text-destructive-foreground"
|
|
3460
3460
|
};
|
|
3461
|
-
var
|
|
3461
|
+
var containedHoverClasses = {
|
|
3462
3462
|
default: "hover:bg-accent-hover",
|
|
3463
3463
|
success: "hover:bg-success-600 dark:hover:bg-success-500",
|
|
3464
3464
|
warning: "hover:bg-warning-600 dark:hover:bg-warning-500",
|
|
@@ -3500,7 +3500,7 @@ var Chip = React21.forwardRef(
|
|
|
3500
3500
|
({
|
|
3501
3501
|
className,
|
|
3502
3502
|
label,
|
|
3503
|
-
variant = "
|
|
3503
|
+
variant = "contained",
|
|
3504
3504
|
color = "default",
|
|
3505
3505
|
size = "medium",
|
|
3506
3506
|
icon,
|
|
@@ -3520,9 +3520,9 @@ var Chip = React21.forwardRef(
|
|
|
3520
3520
|
const isClickable = clickable || !!onClick || !!href;
|
|
3521
3521
|
const Component = component ?? (href ? "a" : "div");
|
|
3522
3522
|
const safeSize = size in sizeClasses3 ? size : "medium";
|
|
3523
|
-
const safeVariant = variant === "
|
|
3524
|
-
const colorClass = safeVariant === "
|
|
3525
|
-
const hoverClass = isClickable && !disabled ? safeVariant === "
|
|
3523
|
+
const safeVariant = variant === "contained" || variant === "outlined" ? variant : "contained";
|
|
3524
|
+
const colorClass = safeVariant === "contained" ? containedClasses2[color] ?? containedClasses2.default : outlinedClasses2[color] ?? outlinedClasses2.default;
|
|
3525
|
+
const hoverClass = isClickable && !disabled ? safeVariant === "contained" ? containedHoverClasses[color] ?? containedHoverClasses.default : outlinedHoverClasses[color] ?? outlinedHoverClasses.default : "";
|
|
3526
3526
|
const handleKeyDown = (e) => {
|
|
3527
3527
|
if (!disabled) {
|
|
3528
3528
|
if (isClickable && (e.key === "Enter" || e.key === " ")) {
|
|
@@ -5186,7 +5186,7 @@ var PaginationLink = React35.forwardRef(
|
|
|
5186
5186
|
Button,
|
|
5187
5187
|
{
|
|
5188
5188
|
ref,
|
|
5189
|
-
variant: isActive ? "
|
|
5189
|
+
variant: isActive ? "contained" : "outlined",
|
|
5190
5190
|
size: "icon",
|
|
5191
5191
|
className: cn("h-9 w-9", className),
|
|
5192
5192
|
...props
|
|
@@ -5198,7 +5198,7 @@ var PaginationPrevious = React35.forwardRef(({ className, ...props }, ref) => /*
|
|
|
5198
5198
|
Button,
|
|
5199
5199
|
{
|
|
5200
5200
|
ref,
|
|
5201
|
-
variant: "
|
|
5201
|
+
variant: "outlined",
|
|
5202
5202
|
size: "default",
|
|
5203
5203
|
className: cn("gap-1 pl-2.5", className),
|
|
5204
5204
|
...props,
|
|
@@ -5228,7 +5228,7 @@ var PaginationNext = React35.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
5228
5228
|
Button,
|
|
5229
5229
|
{
|
|
5230
5230
|
ref,
|
|
5231
|
-
variant: "
|
|
5231
|
+
variant: "outlined",
|
|
5232
5232
|
size: "default",
|
|
5233
5233
|
className: cn("gap-1 pr-2.5", className),
|
|
5234
5234
|
...props,
|
|
@@ -6071,7 +6071,7 @@ var ColumnVisibilityDropdown = ({
|
|
|
6071
6071
|
/* @__PURE__ */ jsxs24(
|
|
6072
6072
|
Button,
|
|
6073
6073
|
{
|
|
6074
|
-
variant: "
|
|
6074
|
+
variant: "outlined",
|
|
6075
6075
|
size: "sm",
|
|
6076
6076
|
onClick: () => setOpen(!open),
|
|
6077
6077
|
className: "h-9 gap-2",
|
|
@@ -6212,7 +6212,7 @@ var DataGridPagination = ({
|
|
|
6212
6212
|
/* @__PURE__ */ jsx37(PaginationItem, { children: /* @__PURE__ */ jsx37(
|
|
6213
6213
|
Button,
|
|
6214
6214
|
{
|
|
6215
|
-
variant: "
|
|
6215
|
+
variant: "outlined",
|
|
6216
6216
|
size: "icon",
|
|
6217
6217
|
className: "h-8 w-8",
|
|
6218
6218
|
onClick: () => table.setPageIndex(0),
|
|
@@ -6223,7 +6223,7 @@ var DataGridPagination = ({
|
|
|
6223
6223
|
/* @__PURE__ */ jsx37(PaginationItem, { children: /* @__PURE__ */ jsx37(
|
|
6224
6224
|
Button,
|
|
6225
6225
|
{
|
|
6226
|
-
variant: "
|
|
6226
|
+
variant: "outlined",
|
|
6227
6227
|
size: "icon",
|
|
6228
6228
|
className: "h-8 w-8",
|
|
6229
6229
|
onClick: () => table.previousPage(),
|
|
@@ -6235,7 +6235,7 @@ var DataGridPagination = ({
|
|
|
6235
6235
|
/* @__PURE__ */ jsx37(PaginationItem, { children: /* @__PURE__ */ jsx37(
|
|
6236
6236
|
Button,
|
|
6237
6237
|
{
|
|
6238
|
-
variant: "
|
|
6238
|
+
variant: "outlined",
|
|
6239
6239
|
size: "icon",
|
|
6240
6240
|
className: "h-8 w-8",
|
|
6241
6241
|
onClick: () => table.nextPage(),
|
|
@@ -6246,7 +6246,7 @@ var DataGridPagination = ({
|
|
|
6246
6246
|
/* @__PURE__ */ jsx37(PaginationItem, { children: /* @__PURE__ */ jsx37(
|
|
6247
6247
|
Button,
|
|
6248
6248
|
{
|
|
6249
|
-
variant: "
|
|
6249
|
+
variant: "outlined",
|
|
6250
6250
|
size: "icon",
|
|
6251
6251
|
className: "h-8 w-8",
|
|
6252
6252
|
onClick: () => table.setPageIndex(pageCount - 1),
|
|
@@ -6330,7 +6330,7 @@ var ExportDropdown = ({
|
|
|
6330
6330
|
/* @__PURE__ */ jsxs24(
|
|
6331
6331
|
Button,
|
|
6332
6332
|
{
|
|
6333
|
-
variant: "
|
|
6333
|
+
variant: "outlined",
|
|
6334
6334
|
size: "sm",
|
|
6335
6335
|
onClick: () => setOpen(!open),
|
|
6336
6336
|
className: "h-9 gap-2",
|
|
@@ -6395,7 +6395,7 @@ var MoreOptionsDropdown = ({
|
|
|
6395
6395
|
/* @__PURE__ */ jsx37(
|
|
6396
6396
|
Button,
|
|
6397
6397
|
{
|
|
6398
|
-
variant: "
|
|
6398
|
+
variant: "outlined",
|
|
6399
6399
|
size: "icon",
|
|
6400
6400
|
onClick: () => setOpen(!open),
|
|
6401
6401
|
className: "h-9 w-9",
|
|
@@ -9474,12 +9474,97 @@ var Backdrop = React44.forwardRef(
|
|
|
9474
9474
|
);
|
|
9475
9475
|
Backdrop.displayName = "Backdrop";
|
|
9476
9476
|
|
|
9477
|
-
// src/components/
|
|
9477
|
+
// src/components/popover.tsx
|
|
9478
9478
|
import * as React45 from "react";
|
|
9479
|
-
import
|
|
9479
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
9480
9480
|
import { jsx as jsx45, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
9481
|
-
var
|
|
9482
|
-
|
|
9481
|
+
var PopoverRoot = PopoverPrimitive.Root;
|
|
9482
|
+
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
9483
|
+
var PopoverPortal = PopoverPrimitive.Portal;
|
|
9484
|
+
var PopoverClose = PopoverPrimitive.Close;
|
|
9485
|
+
var PopoverAnchor = PopoverPrimitive.Anchor;
|
|
9486
|
+
var PopoverArrow = React45.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45(
|
|
9487
|
+
PopoverPrimitive.Arrow,
|
|
9488
|
+
{
|
|
9489
|
+
ref,
|
|
9490
|
+
className: cn("fill-white dark:fill-neutral-800", className),
|
|
9491
|
+
...props
|
|
9492
|
+
}
|
|
9493
|
+
));
|
|
9494
|
+
PopoverArrow.displayName = PopoverPrimitive.Arrow.displayName;
|
|
9495
|
+
var PopoverContent = React45.forwardRef(({ className, align = "center", sideOffset = 6, showArrow = false, children, ...props }, ref) => /* @__PURE__ */ jsx45(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsxs30(
|
|
9496
|
+
PopoverPrimitive.Content,
|
|
9497
|
+
{
|
|
9498
|
+
ref,
|
|
9499
|
+
align,
|
|
9500
|
+
sideOffset,
|
|
9501
|
+
className: cn(
|
|
9502
|
+
"z-50 rounded-lg border border-neutral-200 bg-white p-4 shadow-md outline-none",
|
|
9503
|
+
"dark:border-neutral-700 dark:bg-neutral-800",
|
|
9504
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
9505
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
9506
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
9507
|
+
"data-[side=bottom]:slide-in-from-top-2",
|
|
9508
|
+
"data-[side=left]:slide-in-from-right-2",
|
|
9509
|
+
"data-[side=right]:slide-in-from-left-2",
|
|
9510
|
+
"data-[side=top]:slide-in-from-bottom-2",
|
|
9511
|
+
className
|
|
9512
|
+
),
|
|
9513
|
+
...props,
|
|
9514
|
+
children: [
|
|
9515
|
+
children,
|
|
9516
|
+
showArrow && /* @__PURE__ */ jsx45(PopoverArrow, {})
|
|
9517
|
+
]
|
|
9518
|
+
}
|
|
9519
|
+
) }));
|
|
9520
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
9521
|
+
var Popover = ({
|
|
9522
|
+
children,
|
|
9523
|
+
content,
|
|
9524
|
+
side = "bottom",
|
|
9525
|
+
align = "center",
|
|
9526
|
+
sideOffset = 6,
|
|
9527
|
+
open,
|
|
9528
|
+
onOpenChange,
|
|
9529
|
+
defaultOpen,
|
|
9530
|
+
modal = false,
|
|
9531
|
+
showArrow = false,
|
|
9532
|
+
className
|
|
9533
|
+
}) => {
|
|
9534
|
+
return /* @__PURE__ */ jsxs30(
|
|
9535
|
+
PopoverRoot,
|
|
9536
|
+
{
|
|
9537
|
+
open,
|
|
9538
|
+
onOpenChange,
|
|
9539
|
+
defaultOpen,
|
|
9540
|
+
modal,
|
|
9541
|
+
children: [
|
|
9542
|
+
/* @__PURE__ */ jsx45(PopoverTrigger, { asChild: true, children }),
|
|
9543
|
+
/* @__PURE__ */ jsx45(
|
|
9544
|
+
PopoverContent,
|
|
9545
|
+
{
|
|
9546
|
+
side,
|
|
9547
|
+
align,
|
|
9548
|
+
sideOffset,
|
|
9549
|
+
showArrow,
|
|
9550
|
+
className,
|
|
9551
|
+
children: content
|
|
9552
|
+
}
|
|
9553
|
+
)
|
|
9554
|
+
]
|
|
9555
|
+
}
|
|
9556
|
+
);
|
|
9557
|
+
};
|
|
9558
|
+
Popover.displayName = "Popover";
|
|
9559
|
+
var Popper = (props) => /* @__PURE__ */ jsx45(Popover, { ...props, modal: false });
|
|
9560
|
+
Popper.displayName = "Popper";
|
|
9561
|
+
|
|
9562
|
+
// src/components/snackbar.tsx
|
|
9563
|
+
import * as React46 from "react";
|
|
9564
|
+
import { createPortal as createPortal2 } from "react-dom";
|
|
9565
|
+
import { jsx as jsx46, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
9566
|
+
var SnackbarContent = React46.forwardRef(
|
|
9567
|
+
({ className, message, action, ...props }, ref) => /* @__PURE__ */ jsxs31(
|
|
9483
9568
|
"div",
|
|
9484
9569
|
{
|
|
9485
9570
|
ref,
|
|
@@ -9491,8 +9576,8 @@ var SnackbarContent = React45.forwardRef(
|
|
|
9491
9576
|
),
|
|
9492
9577
|
...props,
|
|
9493
9578
|
children: [
|
|
9494
|
-
/* @__PURE__ */
|
|
9495
|
-
action && /* @__PURE__ */
|
|
9579
|
+
/* @__PURE__ */ jsx46("span", { className: "flex-1", children: message }),
|
|
9580
|
+
action && /* @__PURE__ */ jsx46("span", { className: "shrink-0", children: action })
|
|
9496
9581
|
]
|
|
9497
9582
|
}
|
|
9498
9583
|
)
|
|
@@ -9506,7 +9591,7 @@ var anchorClasses = {
|
|
|
9506
9591
|
"bottom-center": "bottom-4 left-1/2 -translate-x-1/2",
|
|
9507
9592
|
"bottom-right": "bottom-4 right-4"
|
|
9508
9593
|
};
|
|
9509
|
-
var Snackbar =
|
|
9594
|
+
var Snackbar = React46.forwardRef(
|
|
9510
9595
|
({
|
|
9511
9596
|
open,
|
|
9512
9597
|
message,
|
|
@@ -9521,21 +9606,21 @@ var Snackbar = React45.forwardRef(
|
|
|
9521
9606
|
children,
|
|
9522
9607
|
...props
|
|
9523
9608
|
}, ref) => {
|
|
9524
|
-
const [mounted, setMounted] =
|
|
9525
|
-
const [visible, setVisible] =
|
|
9526
|
-
const timer =
|
|
9609
|
+
const [mounted, setMounted] = React46.useState(open);
|
|
9610
|
+
const [visible, setVisible] = React46.useState(false);
|
|
9611
|
+
const timer = React46.useRef(null);
|
|
9527
9612
|
const posKey = `${anchorOrigin.vertical}-${anchorOrigin.horizontal}`;
|
|
9528
9613
|
const position = anchorClasses[posKey] ?? anchorClasses["bottom-left"];
|
|
9529
9614
|
const slideDir = anchorOrigin.vertical === "top" ? "-8px" : "8px";
|
|
9530
|
-
const clearTimer =
|
|
9615
|
+
const clearTimer = React46.useCallback(() => {
|
|
9531
9616
|
if (timer.current) clearTimeout(timer.current);
|
|
9532
9617
|
}, []);
|
|
9533
|
-
const startTimer =
|
|
9618
|
+
const startTimer = React46.useCallback(() => {
|
|
9534
9619
|
if (!autoHideDuration) return;
|
|
9535
9620
|
clearTimer();
|
|
9536
9621
|
timer.current = setTimeout(() => onClose?.(null, "timeout"), autoHideDuration);
|
|
9537
9622
|
}, [autoHideDuration, onClose, clearTimer]);
|
|
9538
|
-
|
|
9623
|
+
React46.useEffect(() => {
|
|
9539
9624
|
if (open) {
|
|
9540
9625
|
setMounted(true);
|
|
9541
9626
|
const raf = requestAnimationFrame(() => setVisible(true));
|
|
@@ -9546,13 +9631,13 @@ var Snackbar = React45.forwardRef(
|
|
|
9546
9631
|
return () => clearTimeout(t);
|
|
9547
9632
|
}
|
|
9548
9633
|
}, [open, transitionDuration]);
|
|
9549
|
-
|
|
9634
|
+
React46.useEffect(() => {
|
|
9550
9635
|
if (open) {
|
|
9551
9636
|
startTimer();
|
|
9552
9637
|
return clearTimer;
|
|
9553
9638
|
}
|
|
9554
9639
|
}, [open, startTimer, clearTimer]);
|
|
9555
|
-
|
|
9640
|
+
React46.useEffect(() => {
|
|
9556
9641
|
if (disableWindowBlurListener || !open) return;
|
|
9557
9642
|
window.addEventListener("blur", clearTimer);
|
|
9558
9643
|
window.addEventListener("focus", startTimer);
|
|
@@ -9561,7 +9646,7 @@ var Snackbar = React45.forwardRef(
|
|
|
9561
9646
|
window.removeEventListener("focus", startTimer);
|
|
9562
9647
|
};
|
|
9563
9648
|
}, [open, disableWindowBlurListener, clearTimer, startTimer]);
|
|
9564
|
-
|
|
9649
|
+
React46.useEffect(() => {
|
|
9565
9650
|
if (!open) return;
|
|
9566
9651
|
const onKey = (e) => {
|
|
9567
9652
|
if (e.key === "Escape") {
|
|
@@ -9573,7 +9658,7 @@ var Snackbar = React45.forwardRef(
|
|
|
9573
9658
|
return () => document.removeEventListener("keydown", onKey);
|
|
9574
9659
|
}, [open, onClose]);
|
|
9575
9660
|
if (!mounted) return null;
|
|
9576
|
-
const node = /* @__PURE__ */
|
|
9661
|
+
const node = /* @__PURE__ */ jsx46(
|
|
9577
9662
|
"div",
|
|
9578
9663
|
{
|
|
9579
9664
|
ref,
|
|
@@ -9586,7 +9671,7 @@ var Snackbar = React45.forwardRef(
|
|
|
9586
9671
|
onMouseEnter: clearTimer,
|
|
9587
9672
|
onMouseLeave: startTimer,
|
|
9588
9673
|
...props,
|
|
9589
|
-
children: children ?? /* @__PURE__ */
|
|
9674
|
+
children: children ?? /* @__PURE__ */ jsx46(SnackbarContent, { message, action })
|
|
9590
9675
|
}
|
|
9591
9676
|
);
|
|
9592
9677
|
if (disablePortal || typeof document === "undefined") return node;
|
|
@@ -9595,13 +9680,13 @@ var Snackbar = React45.forwardRef(
|
|
|
9595
9680
|
);
|
|
9596
9681
|
Snackbar.displayName = "Snackbar";
|
|
9597
9682
|
function ManagedRow({ item, vertical, transitionDuration, onRemove }) {
|
|
9598
|
-
const [visible, setVisible] =
|
|
9599
|
-
const timer =
|
|
9683
|
+
const [visible, setVisible] = React46.useState(false);
|
|
9684
|
+
const timer = React46.useRef(null);
|
|
9600
9685
|
const slideDir = vertical === "top" ? "-8px" : "8px";
|
|
9601
|
-
const clearTimer =
|
|
9686
|
+
const clearTimer = React46.useCallback(() => {
|
|
9602
9687
|
if (timer.current) clearTimeout(timer.current);
|
|
9603
9688
|
}, []);
|
|
9604
|
-
const startTimer =
|
|
9689
|
+
const startTimer = React46.useCallback(() => {
|
|
9605
9690
|
if (!item.autoHideDuration) return;
|
|
9606
9691
|
clearTimer();
|
|
9607
9692
|
timer.current = setTimeout(() => {
|
|
@@ -9609,15 +9694,15 @@ function ManagedRow({ item, vertical, transitionDuration, onRemove }) {
|
|
|
9609
9694
|
item.onClose?.();
|
|
9610
9695
|
}, item.autoHideDuration);
|
|
9611
9696
|
}, [item, onRemove, clearTimer]);
|
|
9612
|
-
|
|
9697
|
+
React46.useEffect(() => {
|
|
9613
9698
|
const raf = requestAnimationFrame(() => setVisible(true));
|
|
9614
9699
|
return () => cancelAnimationFrame(raf);
|
|
9615
9700
|
}, []);
|
|
9616
|
-
|
|
9701
|
+
React46.useEffect(() => {
|
|
9617
9702
|
startTimer();
|
|
9618
9703
|
return clearTimer;
|
|
9619
9704
|
}, [startTimer, clearTimer]);
|
|
9620
|
-
return /* @__PURE__ */
|
|
9705
|
+
return /* @__PURE__ */ jsx46(
|
|
9621
9706
|
"div",
|
|
9622
9707
|
{
|
|
9623
9708
|
style: {
|
|
@@ -9631,7 +9716,7 @@ function ManagedRow({ item, vertical, transitionDuration, onRemove }) {
|
|
|
9631
9716
|
}
|
|
9632
9717
|
);
|
|
9633
9718
|
}
|
|
9634
|
-
var SnackbarContext =
|
|
9719
|
+
var SnackbarContext = React46.createContext({
|
|
9635
9720
|
enqueueSnackbar: () => "",
|
|
9636
9721
|
closeSnackbar: () => {
|
|
9637
9722
|
}
|
|
@@ -9643,24 +9728,24 @@ function SnackbarProvider({
|
|
|
9643
9728
|
maxSnack = 3,
|
|
9644
9729
|
transitionDuration = 225
|
|
9645
9730
|
}) {
|
|
9646
|
-
const [items, setItems] =
|
|
9647
|
-
const closeSnackbar =
|
|
9731
|
+
const [items, setItems] = React46.useState([]);
|
|
9732
|
+
const closeSnackbar = React46.useCallback((key) => {
|
|
9648
9733
|
setItems((prev) => prev.filter((i) => i.key !== key));
|
|
9649
9734
|
}, []);
|
|
9650
|
-
const enqueueSnackbar =
|
|
9735
|
+
const enqueueSnackbar = React46.useCallback(
|
|
9651
9736
|
(message, options = {}) => {
|
|
9652
9737
|
const key = `snk-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
9653
9738
|
const { variant, action, onClose, autoHideDuration: dur, anchorOrigin: anchor } = options;
|
|
9654
9739
|
let content;
|
|
9655
9740
|
if (variant) {
|
|
9656
|
-
content = /* @__PURE__ */
|
|
9741
|
+
content = /* @__PURE__ */ jsx46(Alert, { variant, onClose: () => {
|
|
9657
9742
|
closeSnackbar(key);
|
|
9658
9743
|
onClose?.();
|
|
9659
9744
|
}, children: message });
|
|
9660
|
-
} else if (
|
|
9745
|
+
} else if (React46.isValidElement(message)) {
|
|
9661
9746
|
content = message;
|
|
9662
9747
|
} else {
|
|
9663
|
-
content = /* @__PURE__ */
|
|
9748
|
+
content = /* @__PURE__ */ jsx46(SnackbarContent, { message, action });
|
|
9664
9749
|
}
|
|
9665
9750
|
setItems((prev) => {
|
|
9666
9751
|
const capped = prev.length >= maxSnack ? prev.slice(-(maxSnack - 1)) : prev;
|
|
@@ -9679,7 +9764,7 @@ function SnackbarProvider({
|
|
|
9679
9764
|
},
|
|
9680
9765
|
[autoHideDuration, anchorOrigin, maxSnack, closeSnackbar]
|
|
9681
9766
|
);
|
|
9682
|
-
const groups =
|
|
9767
|
+
const groups = React46.useMemo(() => {
|
|
9683
9768
|
const map = /* @__PURE__ */ new Map();
|
|
9684
9769
|
items.forEach((item) => {
|
|
9685
9770
|
const k = `${item.anchorOrigin.vertical}-${item.anchorOrigin.horizontal}`;
|
|
@@ -9687,12 +9772,12 @@ function SnackbarProvider({
|
|
|
9687
9772
|
});
|
|
9688
9773
|
return map;
|
|
9689
9774
|
}, [items]);
|
|
9690
|
-
return /* @__PURE__ */
|
|
9775
|
+
return /* @__PURE__ */ jsxs31(SnackbarContext.Provider, { value: { enqueueSnackbar, closeSnackbar }, children: [
|
|
9691
9776
|
children,
|
|
9692
9777
|
typeof document !== "undefined" && Array.from(groups.entries()).map(([posKey, posItems]) => {
|
|
9693
9778
|
const [vertical, horizontal] = posKey.split("-");
|
|
9694
9779
|
return createPortal2(
|
|
9695
|
-
/* @__PURE__ */
|
|
9780
|
+
/* @__PURE__ */ jsx46(
|
|
9696
9781
|
"div",
|
|
9697
9782
|
{
|
|
9698
9783
|
className: cn(
|
|
@@ -9700,7 +9785,7 @@ function SnackbarProvider({
|
|
|
9700
9785
|
vertical === "top" ? "top-4 flex-col" : "bottom-4 flex-col-reverse",
|
|
9701
9786
|
horizontal === "left" ? "left-4" : horizontal === "right" ? "right-4" : "left-1/2 -translate-x-1/2"
|
|
9702
9787
|
),
|
|
9703
|
-
children: posItems.map((item) => /* @__PURE__ */
|
|
9788
|
+
children: posItems.map((item) => /* @__PURE__ */ jsx46("div", { className: "pointer-events-auto", children: /* @__PURE__ */ jsx46(
|
|
9704
9789
|
ManagedRow,
|
|
9705
9790
|
{
|
|
9706
9791
|
item,
|
|
@@ -9717,17 +9802,17 @@ function SnackbarProvider({
|
|
|
9717
9802
|
})
|
|
9718
9803
|
] });
|
|
9719
9804
|
}
|
|
9720
|
-
var useSnackbar = () =>
|
|
9805
|
+
var useSnackbar = () => React46.useContext(SnackbarContext);
|
|
9721
9806
|
|
|
9722
9807
|
// src/components/drawer.tsx
|
|
9723
|
-
import * as
|
|
9808
|
+
import * as React47 from "react";
|
|
9724
9809
|
import * as DialogPrimitive2 from "@radix-ui/react-dialog";
|
|
9725
|
-
import { jsx as
|
|
9810
|
+
import { jsx as jsx47, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
9726
9811
|
var Drawer = DialogPrimitive2.Root;
|
|
9727
9812
|
var DrawerTrigger = DialogPrimitive2.Trigger;
|
|
9728
9813
|
var DrawerClose = DialogPrimitive2.Close;
|
|
9729
9814
|
var DrawerPortal = DialogPrimitive2.Portal;
|
|
9730
|
-
var DrawerOverlay =
|
|
9815
|
+
var DrawerOverlay = React47.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx47(
|
|
9731
9816
|
DialogPrimitive2.Overlay,
|
|
9732
9817
|
{
|
|
9733
9818
|
ref,
|
|
@@ -9747,9 +9832,9 @@ var slideVariants = {
|
|
|
9747
9832
|
top: "inset-x-0 top-0 w-full data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
9748
9833
|
bottom: "inset-x-0 bottom-0 w-full data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom"
|
|
9749
9834
|
};
|
|
9750
|
-
var DrawerContent =
|
|
9751
|
-
/* @__PURE__ */
|
|
9752
|
-
/* @__PURE__ */
|
|
9835
|
+
var DrawerContent = React47.forwardRef(({ side = "right", showClose = true, className, children, ...props }, ref) => /* @__PURE__ */ jsxs32(DrawerPortal, { children: [
|
|
9836
|
+
/* @__PURE__ */ jsx47(DrawerOverlay, {}),
|
|
9837
|
+
/* @__PURE__ */ jsxs32(
|
|
9753
9838
|
DialogPrimitive2.Content,
|
|
9754
9839
|
{
|
|
9755
9840
|
ref,
|
|
@@ -9763,7 +9848,7 @@ var DrawerContent = React46.forwardRef(({ side = "right", showClose = true, clas
|
|
|
9763
9848
|
...props,
|
|
9764
9849
|
children: [
|
|
9765
9850
|
children,
|
|
9766
|
-
showClose && /* @__PURE__ */
|
|
9851
|
+
showClose && /* @__PURE__ */ jsxs32(
|
|
9767
9852
|
DrawerClose,
|
|
9768
9853
|
{
|
|
9769
9854
|
className: cn(
|
|
@@ -9773,7 +9858,7 @@ var DrawerContent = React46.forwardRef(({ side = "right", showClose = true, clas
|
|
|
9773
9858
|
"disabled:pointer-events-none"
|
|
9774
9859
|
),
|
|
9775
9860
|
children: [
|
|
9776
|
-
/* @__PURE__ */
|
|
9861
|
+
/* @__PURE__ */ jsx47(
|
|
9777
9862
|
"svg",
|
|
9778
9863
|
{
|
|
9779
9864
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -9786,10 +9871,10 @@ var DrawerContent = React46.forwardRef(({ side = "right", showClose = true, clas
|
|
|
9786
9871
|
strokeLinecap: "round",
|
|
9787
9872
|
strokeLinejoin: "round",
|
|
9788
9873
|
className: "h-4 w-4",
|
|
9789
|
-
children: /* @__PURE__ */
|
|
9874
|
+
children: /* @__PURE__ */ jsx47("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
9790
9875
|
}
|
|
9791
9876
|
),
|
|
9792
|
-
/* @__PURE__ */
|
|
9877
|
+
/* @__PURE__ */ jsx47("span", { className: "sr-only", children: "Close" })
|
|
9793
9878
|
]
|
|
9794
9879
|
}
|
|
9795
9880
|
)
|
|
@@ -9798,8 +9883,8 @@ var DrawerContent = React46.forwardRef(({ side = "right", showClose = true, clas
|
|
|
9798
9883
|
)
|
|
9799
9884
|
] }));
|
|
9800
9885
|
DrawerContent.displayName = "DrawerContent";
|
|
9801
|
-
var DrawerHeader =
|
|
9802
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
9886
|
+
var DrawerHeader = React47.forwardRef(
|
|
9887
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx47(
|
|
9803
9888
|
"div",
|
|
9804
9889
|
{
|
|
9805
9890
|
ref,
|
|
@@ -9809,7 +9894,7 @@ var DrawerHeader = React46.forwardRef(
|
|
|
9809
9894
|
)
|
|
9810
9895
|
);
|
|
9811
9896
|
DrawerHeader.displayName = "DrawerHeader";
|
|
9812
|
-
var DrawerTitle =
|
|
9897
|
+
var DrawerTitle = React47.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx47(
|
|
9813
9898
|
DialogPrimitive2.Title,
|
|
9814
9899
|
{
|
|
9815
9900
|
ref,
|
|
@@ -9818,7 +9903,7 @@ var DrawerTitle = React46.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
9818
9903
|
}
|
|
9819
9904
|
));
|
|
9820
9905
|
DrawerTitle.displayName = DialogPrimitive2.Title.displayName;
|
|
9821
|
-
var DrawerDescription =
|
|
9906
|
+
var DrawerDescription = React47.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx47(
|
|
9822
9907
|
DialogPrimitive2.Description,
|
|
9823
9908
|
{
|
|
9824
9909
|
ref,
|
|
@@ -9827,8 +9912,8 @@ var DrawerDescription = React46.forwardRef(({ className, ...props }, ref) => /*
|
|
|
9827
9912
|
}
|
|
9828
9913
|
));
|
|
9829
9914
|
DrawerDescription.displayName = DialogPrimitive2.Description.displayName;
|
|
9830
|
-
var DrawerBody =
|
|
9831
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
9915
|
+
var DrawerBody = React47.forwardRef(
|
|
9916
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx47(
|
|
9832
9917
|
"div",
|
|
9833
9918
|
{
|
|
9834
9919
|
ref,
|
|
@@ -9838,8 +9923,8 @@ var DrawerBody = React46.forwardRef(
|
|
|
9838
9923
|
)
|
|
9839
9924
|
);
|
|
9840
9925
|
DrawerBody.displayName = "DrawerBody";
|
|
9841
|
-
var DrawerFooter =
|
|
9842
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
9926
|
+
var DrawerFooter = React47.forwardRef(
|
|
9927
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx47(
|
|
9843
9928
|
"div",
|
|
9844
9929
|
{
|
|
9845
9930
|
ref,
|
|
@@ -9865,17 +9950,17 @@ var SheetBody = DrawerBody;
|
|
|
9865
9950
|
var SheetFooter = DrawerFooter;
|
|
9866
9951
|
|
|
9867
9952
|
// src/components/topbar.tsx
|
|
9868
|
-
import * as
|
|
9869
|
-
import { Fragment as Fragment8, jsx as
|
|
9953
|
+
import * as React48 from "react";
|
|
9954
|
+
import { Fragment as Fragment8, jsx as jsx48, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
9870
9955
|
var sizeClasses5 = {
|
|
9871
9956
|
sm: "h-12",
|
|
9872
9957
|
md: "h-14",
|
|
9873
9958
|
lg: "h-16"
|
|
9874
9959
|
};
|
|
9875
|
-
var TopBar =
|
|
9960
|
+
var TopBar = React48.forwardRef(
|
|
9876
9961
|
({ className, bordered = true, sticky = false, size = "md", children, ...props }, ref) => {
|
|
9877
9962
|
const safeSize = size in sizeClasses5 ? size : "md";
|
|
9878
|
-
return /* @__PURE__ */
|
|
9963
|
+
return /* @__PURE__ */ jsx48(
|
|
9879
9964
|
"header",
|
|
9880
9965
|
{
|
|
9881
9966
|
ref,
|
|
@@ -9893,23 +9978,23 @@ var TopBar = React47.forwardRef(
|
|
|
9893
9978
|
}
|
|
9894
9979
|
);
|
|
9895
9980
|
TopBar.displayName = "TopBar";
|
|
9896
|
-
var TopBarBrand =
|
|
9981
|
+
var TopBarBrand = React48.forwardRef(
|
|
9897
9982
|
({ className, logo, name, href, children, ...props }, ref) => {
|
|
9898
|
-
const content = /* @__PURE__ */
|
|
9899
|
-
logo && /* @__PURE__ */
|
|
9900
|
-
name && /* @__PURE__ */
|
|
9983
|
+
const content = /* @__PURE__ */ jsxs33(Fragment8, { children: [
|
|
9984
|
+
logo && /* @__PURE__ */ jsx48("span", { className: "shrink-0", children: logo }),
|
|
9985
|
+
name && /* @__PURE__ */ jsx48("span", { className: "font-semibold text-lg", children: name }),
|
|
9901
9986
|
children
|
|
9902
9987
|
] });
|
|
9903
9988
|
if (href) {
|
|
9904
|
-
return /* @__PURE__ */
|
|
9989
|
+
return /* @__PURE__ */ jsx48("div", { ref, className: cn("flex items-center gap-2", className), ...props, children: /* @__PURE__ */ jsx48("a", { href, className: "flex items-center gap-2 hover:opacity-80 transition-opacity", children: content }) });
|
|
9905
9990
|
}
|
|
9906
|
-
return /* @__PURE__ */
|
|
9991
|
+
return /* @__PURE__ */ jsx48("div", { ref, className: cn("flex items-center gap-2", className), ...props, children: content });
|
|
9907
9992
|
}
|
|
9908
9993
|
);
|
|
9909
9994
|
TopBarBrand.displayName = "TopBarBrand";
|
|
9910
|
-
var TopBarNav =
|
|
9995
|
+
var TopBarNav = React48.forwardRef(
|
|
9911
9996
|
({ className, children, ...props }, ref) => {
|
|
9912
|
-
return /* @__PURE__ */
|
|
9997
|
+
return /* @__PURE__ */ jsx48(
|
|
9913
9998
|
"nav",
|
|
9914
9999
|
{
|
|
9915
10000
|
ref,
|
|
@@ -9921,9 +10006,9 @@ var TopBarNav = React47.forwardRef(
|
|
|
9921
10006
|
}
|
|
9922
10007
|
);
|
|
9923
10008
|
TopBarNav.displayName = "TopBarNav";
|
|
9924
|
-
var TopBarNavItem =
|
|
10009
|
+
var TopBarNavItem = React48.forwardRef(
|
|
9925
10010
|
({ className, active, children, ...props }, ref) => {
|
|
9926
|
-
return /* @__PURE__ */
|
|
10011
|
+
return /* @__PURE__ */ jsx48(
|
|
9927
10012
|
"a",
|
|
9928
10013
|
{
|
|
9929
10014
|
ref,
|
|
@@ -9939,9 +10024,9 @@ var TopBarNavItem = React47.forwardRef(
|
|
|
9939
10024
|
}
|
|
9940
10025
|
);
|
|
9941
10026
|
TopBarNavItem.displayName = "TopBarNavItem";
|
|
9942
|
-
var TopBarSection =
|
|
10027
|
+
var TopBarSection = React48.forwardRef(
|
|
9943
10028
|
({ className, align = "left", children, ...props }, ref) => {
|
|
9944
|
-
return /* @__PURE__ */
|
|
10029
|
+
return /* @__PURE__ */ jsx48(
|
|
9945
10030
|
"div",
|
|
9946
10031
|
{
|
|
9947
10032
|
ref,
|
|
@@ -9961,9 +10046,9 @@ var TopBarSection = React47.forwardRef(
|
|
|
9961
10046
|
}
|
|
9962
10047
|
);
|
|
9963
10048
|
TopBarSection.displayName = "TopBarSection";
|
|
9964
|
-
var TopBarDivider =
|
|
10049
|
+
var TopBarDivider = React48.forwardRef(
|
|
9965
10050
|
({ className, ...props }, ref) => {
|
|
9966
|
-
return /* @__PURE__ */
|
|
10051
|
+
return /* @__PURE__ */ jsx48(
|
|
9967
10052
|
"div",
|
|
9968
10053
|
{
|
|
9969
10054
|
ref,
|
|
@@ -9976,17 +10061,17 @@ var TopBarDivider = React47.forwardRef(
|
|
|
9976
10061
|
TopBarDivider.displayName = "TopBarDivider";
|
|
9977
10062
|
|
|
9978
10063
|
// src/components/sidebar.tsx
|
|
9979
|
-
import * as
|
|
9980
|
-
import { Fragment as Fragment9, jsx as
|
|
9981
|
-
var SidebarContext =
|
|
10064
|
+
import * as React49 from "react";
|
|
10065
|
+
import { Fragment as Fragment9, jsx as jsx49, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
10066
|
+
var SidebarContext = React49.createContext(void 0);
|
|
9982
10067
|
var useSidebar = () => {
|
|
9983
|
-
const context =
|
|
10068
|
+
const context = React49.useContext(SidebarContext);
|
|
9984
10069
|
if (!context) {
|
|
9985
10070
|
throw new Error("useSidebar must be used within a Sidebar");
|
|
9986
10071
|
}
|
|
9987
10072
|
return context;
|
|
9988
10073
|
};
|
|
9989
|
-
var Sidebar =
|
|
10074
|
+
var Sidebar = React49.forwardRef(
|
|
9990
10075
|
({
|
|
9991
10076
|
className,
|
|
9992
10077
|
collapsed: controlledCollapsed,
|
|
@@ -9998,10 +10083,10 @@ var Sidebar = React48.forwardRef(
|
|
|
9998
10083
|
children,
|
|
9999
10084
|
...props
|
|
10000
10085
|
}, ref) => {
|
|
10001
|
-
const [uncontrolledCollapsed, setUncontrolledCollapsed] =
|
|
10086
|
+
const [uncontrolledCollapsed, setUncontrolledCollapsed] = React49.useState(defaultCollapsed);
|
|
10002
10087
|
const isControlled = controlledCollapsed !== void 0;
|
|
10003
10088
|
const collapsed = isControlled ? controlledCollapsed : uncontrolledCollapsed;
|
|
10004
|
-
const setCollapsed =
|
|
10089
|
+
const setCollapsed = React49.useCallback(
|
|
10005
10090
|
(value) => {
|
|
10006
10091
|
if (!isControlled) {
|
|
10007
10092
|
setUncontrolledCollapsed(value);
|
|
@@ -10010,7 +10095,7 @@ var Sidebar = React48.forwardRef(
|
|
|
10010
10095
|
},
|
|
10011
10096
|
[isControlled, onCollapsedChange]
|
|
10012
10097
|
);
|
|
10013
|
-
return /* @__PURE__ */
|
|
10098
|
+
return /* @__PURE__ */ jsx49(SidebarContext.Provider, { value: { collapsed, setCollapsed }, children: /* @__PURE__ */ jsx49(
|
|
10014
10099
|
"aside",
|
|
10015
10100
|
{
|
|
10016
10101
|
ref,
|
|
@@ -10030,9 +10115,9 @@ var Sidebar = React48.forwardRef(
|
|
|
10030
10115
|
}
|
|
10031
10116
|
);
|
|
10032
10117
|
Sidebar.displayName = "Sidebar";
|
|
10033
|
-
var SidebarHeader =
|
|
10118
|
+
var SidebarHeader = React49.forwardRef(
|
|
10034
10119
|
({ className, accentColor = false, children, ...props }, ref) => {
|
|
10035
|
-
return /* @__PURE__ */
|
|
10120
|
+
return /* @__PURE__ */ jsx49(
|
|
10036
10121
|
"div",
|
|
10037
10122
|
{
|
|
10038
10123
|
ref,
|
|
@@ -10048,9 +10133,9 @@ var SidebarHeader = React48.forwardRef(
|
|
|
10048
10133
|
}
|
|
10049
10134
|
);
|
|
10050
10135
|
SidebarHeader.displayName = "SidebarHeader";
|
|
10051
|
-
var SidebarContent =
|
|
10136
|
+
var SidebarContent = React49.forwardRef(
|
|
10052
10137
|
({ className, children, ...props }, ref) => {
|
|
10053
|
-
return /* @__PURE__ */
|
|
10138
|
+
return /* @__PURE__ */ jsx49(
|
|
10054
10139
|
"div",
|
|
10055
10140
|
{
|
|
10056
10141
|
ref,
|
|
@@ -10062,9 +10147,9 @@ var SidebarContent = React48.forwardRef(
|
|
|
10062
10147
|
}
|
|
10063
10148
|
);
|
|
10064
10149
|
SidebarContent.displayName = "SidebarContent";
|
|
10065
|
-
var SidebarFooter =
|
|
10150
|
+
var SidebarFooter = React49.forwardRef(
|
|
10066
10151
|
({ className, children, ...props }, ref) => {
|
|
10067
|
-
return /* @__PURE__ */
|
|
10152
|
+
return /* @__PURE__ */ jsx49(
|
|
10068
10153
|
"div",
|
|
10069
10154
|
{
|
|
10070
10155
|
ref,
|
|
@@ -10076,25 +10161,25 @@ var SidebarFooter = React48.forwardRef(
|
|
|
10076
10161
|
}
|
|
10077
10162
|
);
|
|
10078
10163
|
SidebarFooter.displayName = "SidebarFooter";
|
|
10079
|
-
var SidebarGroup =
|
|
10164
|
+
var SidebarGroup = React49.forwardRef(
|
|
10080
10165
|
({ className, label, children, ...props }, ref) => {
|
|
10081
10166
|
const { collapsed } = useSidebar();
|
|
10082
|
-
return /* @__PURE__ */
|
|
10083
|
-
label && !collapsed && /* @__PURE__ */
|
|
10084
|
-
label && collapsed && /* @__PURE__ */
|
|
10085
|
-
/* @__PURE__ */
|
|
10167
|
+
return /* @__PURE__ */ jsxs34("div", { ref, className: cn("px-2 py-2", className), ...props, children: [
|
|
10168
|
+
label && !collapsed && /* @__PURE__ */ jsx49("div", { className: "px-2 py-1.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: label }),
|
|
10169
|
+
label && collapsed && /* @__PURE__ */ jsx49("div", { className: "flex justify-center py-1.5", children: /* @__PURE__ */ jsx49("div", { className: "h-px w-4 bg-border" }) }),
|
|
10170
|
+
/* @__PURE__ */ jsx49("div", { className: "space-y-1", children })
|
|
10086
10171
|
] });
|
|
10087
10172
|
}
|
|
10088
10173
|
);
|
|
10089
10174
|
SidebarGroup.displayName = "SidebarGroup";
|
|
10090
|
-
var SidebarItem =
|
|
10175
|
+
var SidebarItem = React49.forwardRef(
|
|
10091
10176
|
({ className, icon, active, disabled, badge, onClick, href, children, ...props }, ref) => {
|
|
10092
10177
|
const { collapsed } = useSidebar();
|
|
10093
|
-
const content = /* @__PURE__ */
|
|
10094
|
-
icon && /* @__PURE__ */
|
|
10095
|
-
!collapsed && /* @__PURE__ */
|
|
10096
|
-
/* @__PURE__ */
|
|
10097
|
-
badge && /* @__PURE__ */
|
|
10178
|
+
const content = /* @__PURE__ */ jsxs34(Fragment9, { children: [
|
|
10179
|
+
icon && /* @__PURE__ */ jsx49("span", { className: cn("shrink-0", collapsed ? "mx-auto" : ""), children: icon }),
|
|
10180
|
+
!collapsed && /* @__PURE__ */ jsxs34(Fragment9, { children: [
|
|
10181
|
+
/* @__PURE__ */ jsx49("span", { className: "flex-1 truncate", children }),
|
|
10182
|
+
badge && /* @__PURE__ */ jsx49("span", { className: "shrink-0", children: badge })
|
|
10098
10183
|
] })
|
|
10099
10184
|
] });
|
|
10100
10185
|
const itemClasses = cn(
|
|
@@ -10105,9 +10190,9 @@ var SidebarItem = React48.forwardRef(
|
|
|
10105
10190
|
className
|
|
10106
10191
|
);
|
|
10107
10192
|
if (href) {
|
|
10108
|
-
return /* @__PURE__ */
|
|
10193
|
+
return /* @__PURE__ */ jsx49("div", { ref, ...props, children: /* @__PURE__ */ jsx49("a", { href, className: itemClasses, children: content }) });
|
|
10109
10194
|
}
|
|
10110
|
-
return /* @__PURE__ */
|
|
10195
|
+
return /* @__PURE__ */ jsx49(
|
|
10111
10196
|
"div",
|
|
10112
10197
|
{
|
|
10113
10198
|
ref,
|
|
@@ -10122,20 +10207,20 @@ var SidebarItem = React48.forwardRef(
|
|
|
10122
10207
|
}
|
|
10123
10208
|
);
|
|
10124
10209
|
SidebarItem.displayName = "SidebarItem";
|
|
10125
|
-
var SidebarSubMenu =
|
|
10210
|
+
var SidebarSubMenu = React49.forwardRef(
|
|
10126
10211
|
({ className, icon, label, defaultOpen = false, children, ...props }, ref) => {
|
|
10127
|
-
const [open, setOpen] =
|
|
10212
|
+
const [open, setOpen] = React49.useState(defaultOpen);
|
|
10128
10213
|
const { collapsed } = useSidebar();
|
|
10129
|
-
|
|
10214
|
+
React49.useEffect(() => {
|
|
10130
10215
|
if (collapsed) {
|
|
10131
10216
|
setOpen(false);
|
|
10132
10217
|
}
|
|
10133
10218
|
}, [collapsed]);
|
|
10134
10219
|
if (collapsed) {
|
|
10135
|
-
return /* @__PURE__ */
|
|
10220
|
+
return /* @__PURE__ */ jsx49(SidebarItem, { icon, className, children: label });
|
|
10136
10221
|
}
|
|
10137
|
-
return /* @__PURE__ */
|
|
10138
|
-
/* @__PURE__ */
|
|
10222
|
+
return /* @__PURE__ */ jsxs34("div", { ref, className, ...props, children: [
|
|
10223
|
+
/* @__PURE__ */ jsxs34(
|
|
10139
10224
|
"div",
|
|
10140
10225
|
{
|
|
10141
10226
|
className: cn(
|
|
@@ -10146,9 +10231,9 @@ var SidebarSubMenu = React48.forwardRef(
|
|
|
10146
10231
|
role: "button",
|
|
10147
10232
|
tabIndex: 0,
|
|
10148
10233
|
children: [
|
|
10149
|
-
icon && /* @__PURE__ */
|
|
10150
|
-
/* @__PURE__ */
|
|
10151
|
-
/* @__PURE__ */
|
|
10234
|
+
icon && /* @__PURE__ */ jsx49("span", { className: "shrink-0", children: icon }),
|
|
10235
|
+
/* @__PURE__ */ jsx49("span", { className: "flex-1 truncate", children: label }),
|
|
10236
|
+
/* @__PURE__ */ jsx49(
|
|
10152
10237
|
"svg",
|
|
10153
10238
|
{
|
|
10154
10239
|
className: cn("h-4 w-4 shrink-0 transition-transform", open && "rotate-90"),
|
|
@@ -10159,21 +10244,21 @@ var SidebarSubMenu = React48.forwardRef(
|
|
|
10159
10244
|
strokeWidth: "2",
|
|
10160
10245
|
strokeLinecap: "round",
|
|
10161
10246
|
strokeLinejoin: "round",
|
|
10162
|
-
children: /* @__PURE__ */
|
|
10247
|
+
children: /* @__PURE__ */ jsx49("path", { d: "m9 18 6-6-6-6" })
|
|
10163
10248
|
}
|
|
10164
10249
|
)
|
|
10165
10250
|
]
|
|
10166
10251
|
}
|
|
10167
10252
|
),
|
|
10168
|
-
open && /* @__PURE__ */
|
|
10253
|
+
open && /* @__PURE__ */ jsx49("div", { className: "ml-4 pl-3 border-l border-border space-y-1 mt-1", children })
|
|
10169
10254
|
] });
|
|
10170
10255
|
}
|
|
10171
10256
|
);
|
|
10172
10257
|
SidebarSubMenu.displayName = "SidebarSubMenu";
|
|
10173
|
-
var SidebarToggle =
|
|
10258
|
+
var SidebarToggle = React49.forwardRef(
|
|
10174
10259
|
({ className, children, ...props }, ref) => {
|
|
10175
10260
|
const { collapsed, setCollapsed } = useSidebar();
|
|
10176
|
-
return /* @__PURE__ */
|
|
10261
|
+
return /* @__PURE__ */ jsx49(
|
|
10177
10262
|
"button",
|
|
10178
10263
|
{
|
|
10179
10264
|
ref,
|
|
@@ -10187,7 +10272,7 @@ var SidebarToggle = React48.forwardRef(
|
|
|
10187
10272
|
),
|
|
10188
10273
|
"aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
10189
10274
|
...props,
|
|
10190
|
-
children: children || /* @__PURE__ */
|
|
10275
|
+
children: children || /* @__PURE__ */ jsxs34(
|
|
10191
10276
|
"svg",
|
|
10192
10277
|
{
|
|
10193
10278
|
className: cn("h-5 w-5 transition-transform", collapsed && "rotate-180"),
|
|
@@ -10199,9 +10284,9 @@ var SidebarToggle = React48.forwardRef(
|
|
|
10199
10284
|
strokeLinecap: "round",
|
|
10200
10285
|
strokeLinejoin: "round",
|
|
10201
10286
|
children: [
|
|
10202
|
-
/* @__PURE__ */
|
|
10203
|
-
/* @__PURE__ */
|
|
10204
|
-
/* @__PURE__ */
|
|
10287
|
+
/* @__PURE__ */ jsx49("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
10288
|
+
/* @__PURE__ */ jsx49("path", { d: "M9 3v18" }),
|
|
10289
|
+
/* @__PURE__ */ jsx49("path", { d: "m14 9 3 3-3 3" })
|
|
10205
10290
|
]
|
|
10206
10291
|
}
|
|
10207
10292
|
)
|
|
@@ -10212,17 +10297,17 @@ var SidebarToggle = React48.forwardRef(
|
|
|
10212
10297
|
SidebarToggle.displayName = "SidebarToggle";
|
|
10213
10298
|
|
|
10214
10299
|
// src/components/sidebar-rail.tsx
|
|
10215
|
-
import * as
|
|
10216
|
-
import { Fragment as Fragment10, jsx as
|
|
10217
|
-
var SidebarRailContext =
|
|
10300
|
+
import * as React50 from "react";
|
|
10301
|
+
import { Fragment as Fragment10, jsx as jsx50, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
10302
|
+
var SidebarRailContext = React50.createContext(void 0);
|
|
10218
10303
|
var useSidebarRail = () => {
|
|
10219
|
-
const context =
|
|
10304
|
+
const context = React50.useContext(SidebarRailContext);
|
|
10220
10305
|
if (!context) {
|
|
10221
10306
|
throw new Error("useSidebarRail must be used within a SidebarRail");
|
|
10222
10307
|
}
|
|
10223
10308
|
return context;
|
|
10224
10309
|
};
|
|
10225
|
-
var SidebarRail =
|
|
10310
|
+
var SidebarRail = React50.forwardRef(
|
|
10226
10311
|
({
|
|
10227
10312
|
className,
|
|
10228
10313
|
defaultActiveRail = null,
|
|
@@ -10240,14 +10325,14 @@ var SidebarRail = React49.forwardRef(
|
|
|
10240
10325
|
children,
|
|
10241
10326
|
...props
|
|
10242
10327
|
}, ref) => {
|
|
10243
|
-
const [uncontrolledActiveRail, setUncontrolledActiveRail] =
|
|
10244
|
-
const [expanded, setExpanded] =
|
|
10245
|
-
const [uncontrolledRailExpanded, setUncontrolledRailExpanded] =
|
|
10328
|
+
const [uncontrolledActiveRail, setUncontrolledActiveRail] = React50.useState(defaultActiveRail);
|
|
10329
|
+
const [expanded, setExpanded] = React50.useState(!!defaultActiveRail);
|
|
10330
|
+
const [uncontrolledRailExpanded, setUncontrolledRailExpanded] = React50.useState(defaultRailExpanded);
|
|
10246
10331
|
const isControlled = controlledActiveRail !== void 0;
|
|
10247
10332
|
const activeRail = isControlled ? controlledActiveRail : uncontrolledActiveRail;
|
|
10248
10333
|
const isRailControlled = controlledRailExpanded !== void 0;
|
|
10249
10334
|
const railExpanded = isRailControlled ? controlledRailExpanded : uncontrolledRailExpanded;
|
|
10250
|
-
const setActiveRail =
|
|
10335
|
+
const setActiveRail = React50.useCallback(
|
|
10251
10336
|
(rail) => {
|
|
10252
10337
|
if (!isControlled) {
|
|
10253
10338
|
setUncontrolledActiveRail(rail);
|
|
@@ -10257,7 +10342,7 @@ var SidebarRail = React49.forwardRef(
|
|
|
10257
10342
|
},
|
|
10258
10343
|
[isControlled, onActiveRailChange]
|
|
10259
10344
|
);
|
|
10260
|
-
const setRailExpanded =
|
|
10345
|
+
const setRailExpanded = React50.useCallback(
|
|
10261
10346
|
(value) => {
|
|
10262
10347
|
if (!isRailControlled) {
|
|
10263
10348
|
setUncontrolledRailExpanded(value);
|
|
@@ -10266,7 +10351,7 @@ var SidebarRail = React49.forwardRef(
|
|
|
10266
10351
|
},
|
|
10267
10352
|
[isRailControlled, onRailExpandedChange]
|
|
10268
10353
|
);
|
|
10269
|
-
return /* @__PURE__ */
|
|
10354
|
+
return /* @__PURE__ */ jsx50(
|
|
10270
10355
|
SidebarRailContext.Provider,
|
|
10271
10356
|
{
|
|
10272
10357
|
value: {
|
|
@@ -10280,7 +10365,7 @@ var SidebarRail = React49.forwardRef(
|
|
|
10280
10365
|
overlayRail: overlayRail && expandableRail,
|
|
10281
10366
|
expandableRail
|
|
10282
10367
|
},
|
|
10283
|
-
children: /* @__PURE__ */
|
|
10368
|
+
children: /* @__PURE__ */ jsx50(
|
|
10284
10369
|
"div",
|
|
10285
10370
|
{
|
|
10286
10371
|
ref,
|
|
@@ -10303,7 +10388,7 @@ var SidebarRail = React49.forwardRef(
|
|
|
10303
10388
|
}
|
|
10304
10389
|
);
|
|
10305
10390
|
SidebarRail.displayName = "SidebarRail";
|
|
10306
|
-
var IconRail =
|
|
10391
|
+
var IconRail = React50.forwardRef(
|
|
10307
10392
|
({ className, children, hoverExpandRail = false, ...props }, ref) => {
|
|
10308
10393
|
const { railExpanded, overlayRail, expandableRail, setRailExpanded } = useSidebarRail();
|
|
10309
10394
|
const isExpanded = expandableRail && railExpanded;
|
|
@@ -10317,7 +10402,7 @@ var IconRail = React49.forwardRef(
|
|
|
10317
10402
|
setRailExpanded(false);
|
|
10318
10403
|
}
|
|
10319
10404
|
};
|
|
10320
|
-
return /* @__PURE__ */
|
|
10405
|
+
return /* @__PURE__ */ jsx50(
|
|
10321
10406
|
"div",
|
|
10322
10407
|
{
|
|
10323
10408
|
ref,
|
|
@@ -10328,7 +10413,7 @@ var IconRail = React49.forwardRef(
|
|
|
10328
10413
|
onMouseEnter: handleMouseEnter,
|
|
10329
10414
|
onMouseLeave: handleMouseLeave,
|
|
10330
10415
|
...props,
|
|
10331
|
-
children: /* @__PURE__ */
|
|
10416
|
+
children: /* @__PURE__ */ jsx50(
|
|
10332
10417
|
"div",
|
|
10333
10418
|
{
|
|
10334
10419
|
className: cn(
|
|
@@ -10348,9 +10433,9 @@ var IconRail = React49.forwardRef(
|
|
|
10348
10433
|
}
|
|
10349
10434
|
);
|
|
10350
10435
|
IconRail.displayName = "IconRail";
|
|
10351
|
-
var IconRailHeader =
|
|
10436
|
+
var IconRailHeader = React50.forwardRef(
|
|
10352
10437
|
({ className, children, ...props }, ref) => {
|
|
10353
|
-
return /* @__PURE__ */
|
|
10438
|
+
return /* @__PURE__ */ jsx50(
|
|
10354
10439
|
"div",
|
|
10355
10440
|
{
|
|
10356
10441
|
ref,
|
|
@@ -10365,9 +10450,9 @@ var IconRailHeader = React49.forwardRef(
|
|
|
10365
10450
|
}
|
|
10366
10451
|
);
|
|
10367
10452
|
IconRailHeader.displayName = "IconRailHeader";
|
|
10368
|
-
var IconRailContent =
|
|
10453
|
+
var IconRailContent = React50.forwardRef(
|
|
10369
10454
|
({ className, children, ...props }, ref) => {
|
|
10370
|
-
return /* @__PURE__ */
|
|
10455
|
+
return /* @__PURE__ */ jsx50(
|
|
10371
10456
|
"div",
|
|
10372
10457
|
{
|
|
10373
10458
|
ref,
|
|
@@ -10379,9 +10464,9 @@ var IconRailContent = React49.forwardRef(
|
|
|
10379
10464
|
}
|
|
10380
10465
|
);
|
|
10381
10466
|
IconRailContent.displayName = "IconRailContent";
|
|
10382
|
-
var IconRailFooter =
|
|
10467
|
+
var IconRailFooter = React50.forwardRef(
|
|
10383
10468
|
({ className, children, ...props }, ref) => {
|
|
10384
|
-
return /* @__PURE__ */
|
|
10469
|
+
return /* @__PURE__ */ jsx50(
|
|
10385
10470
|
"div",
|
|
10386
10471
|
{
|
|
10387
10472
|
ref,
|
|
@@ -10396,7 +10481,7 @@ var IconRailFooter = React49.forwardRef(
|
|
|
10396
10481
|
}
|
|
10397
10482
|
);
|
|
10398
10483
|
IconRailFooter.displayName = "IconRailFooter";
|
|
10399
|
-
var IconRailItem =
|
|
10484
|
+
var IconRailItem = React50.forwardRef(
|
|
10400
10485
|
({ className, railId, icon, label, asButton = false, toggleRail = false, iconColor, onClick, ...props }, ref) => {
|
|
10401
10486
|
const {
|
|
10402
10487
|
activeRail,
|
|
@@ -10422,8 +10507,8 @@ var IconRailItem = React49.forwardRef(
|
|
|
10422
10507
|
setActiveRail(railId);
|
|
10423
10508
|
}
|
|
10424
10509
|
};
|
|
10425
|
-
const iconWithColor = iconColor ? /* @__PURE__ */
|
|
10426
|
-
return /* @__PURE__ */
|
|
10510
|
+
const iconWithColor = iconColor ? /* @__PURE__ */ jsx50("span", { style: { color: iconColor }, className: "flex items-center justify-center", children: icon }) : icon;
|
|
10511
|
+
return /* @__PURE__ */ jsxs35(
|
|
10427
10512
|
"button",
|
|
10428
10513
|
{
|
|
10429
10514
|
ref,
|
|
@@ -10443,14 +10528,14 @@ var IconRailItem = React49.forwardRef(
|
|
|
10443
10528
|
...props,
|
|
10444
10529
|
children: [
|
|
10445
10530
|
iconWithColor,
|
|
10446
|
-
isRailExpanded && label && /* @__PURE__ */
|
|
10531
|
+
isRailExpanded && label && /* @__PURE__ */ jsx50("span", { className: "text-sm font-medium truncate", children: label })
|
|
10447
10532
|
]
|
|
10448
10533
|
}
|
|
10449
10534
|
);
|
|
10450
10535
|
}
|
|
10451
10536
|
);
|
|
10452
10537
|
IconRailItem.displayName = "IconRailItem";
|
|
10453
|
-
var RailPanel =
|
|
10538
|
+
var RailPanel = React50.forwardRef(
|
|
10454
10539
|
({ className, railId, title, children, ...props }, ref) => {
|
|
10455
10540
|
const { activeRail, setActiveRail, hoverExpand } = useSidebarRail();
|
|
10456
10541
|
const isVisible = activeRail === railId;
|
|
@@ -10460,7 +10545,7 @@ var RailPanel = React49.forwardRef(
|
|
|
10460
10545
|
}
|
|
10461
10546
|
};
|
|
10462
10547
|
if (!isVisible) return null;
|
|
10463
|
-
return /* @__PURE__ */
|
|
10548
|
+
return /* @__PURE__ */ jsxs35(
|
|
10464
10549
|
"div",
|
|
10465
10550
|
{
|
|
10466
10551
|
ref,
|
|
@@ -10473,16 +10558,16 @@ var RailPanel = React49.forwardRef(
|
|
|
10473
10558
|
onMouseLeave: handleMouseLeave,
|
|
10474
10559
|
...props,
|
|
10475
10560
|
children: [
|
|
10476
|
-
title && /* @__PURE__ */
|
|
10477
|
-
/* @__PURE__ */
|
|
10478
|
-
/* @__PURE__ */
|
|
10561
|
+
title && /* @__PURE__ */ jsxs35("div", { className: "flex items-center justify-between h-14 px-4 border-b border-border shrink-0", children: [
|
|
10562
|
+
/* @__PURE__ */ jsx50("span", { className: "font-semibold text-sm", children: title }),
|
|
10563
|
+
/* @__PURE__ */ jsx50(
|
|
10479
10564
|
"button",
|
|
10480
10565
|
{
|
|
10481
10566
|
type: "button",
|
|
10482
10567
|
onClick: () => setActiveRail(null),
|
|
10483
10568
|
className: "p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground cursor-pointer",
|
|
10484
10569
|
"aria-label": "Close panel",
|
|
10485
|
-
children: /* @__PURE__ */
|
|
10570
|
+
children: /* @__PURE__ */ jsxs35(
|
|
10486
10571
|
"svg",
|
|
10487
10572
|
{
|
|
10488
10573
|
className: "h-4 w-4",
|
|
@@ -10494,36 +10579,36 @@ var RailPanel = React49.forwardRef(
|
|
|
10494
10579
|
strokeLinecap: "round",
|
|
10495
10580
|
strokeLinejoin: "round",
|
|
10496
10581
|
children: [
|
|
10497
|
-
/* @__PURE__ */
|
|
10498
|
-
/* @__PURE__ */
|
|
10582
|
+
/* @__PURE__ */ jsx50("path", { d: "M18 6 6 18" }),
|
|
10583
|
+
/* @__PURE__ */ jsx50("path", { d: "m6 6 12 12" })
|
|
10499
10584
|
]
|
|
10500
10585
|
}
|
|
10501
10586
|
)
|
|
10502
10587
|
}
|
|
10503
10588
|
)
|
|
10504
10589
|
] }),
|
|
10505
|
-
/* @__PURE__ */
|
|
10590
|
+
/* @__PURE__ */ jsx50("div", { className: "flex-1 overflow-y-auto", children })
|
|
10506
10591
|
]
|
|
10507
10592
|
}
|
|
10508
10593
|
);
|
|
10509
10594
|
}
|
|
10510
10595
|
);
|
|
10511
10596
|
RailPanel.displayName = "RailPanel";
|
|
10512
|
-
var RailPanelGroup =
|
|
10597
|
+
var RailPanelGroup = React50.forwardRef(
|
|
10513
10598
|
({ className, label, children, ...props }, ref) => {
|
|
10514
|
-
return /* @__PURE__ */
|
|
10515
|
-
label && /* @__PURE__ */
|
|
10516
|
-
/* @__PURE__ */
|
|
10599
|
+
return /* @__PURE__ */ jsxs35("div", { ref, className: cn("px-2 py-2", className), ...props, children: [
|
|
10600
|
+
label && /* @__PURE__ */ jsx50("div", { className: "px-2 py-1.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: label }),
|
|
10601
|
+
/* @__PURE__ */ jsx50("div", { className: "space-y-1", children })
|
|
10517
10602
|
] });
|
|
10518
10603
|
}
|
|
10519
10604
|
);
|
|
10520
10605
|
RailPanelGroup.displayName = "RailPanelGroup";
|
|
10521
|
-
var RailPanelItem =
|
|
10606
|
+
var RailPanelItem = React50.forwardRef(
|
|
10522
10607
|
({ className, icon, active, disabled, badge, href, children, onClick, ...props }, ref) => {
|
|
10523
|
-
const content = /* @__PURE__ */
|
|
10524
|
-
icon && /* @__PURE__ */
|
|
10525
|
-
/* @__PURE__ */
|
|
10526
|
-
badge && /* @__PURE__ */
|
|
10608
|
+
const content = /* @__PURE__ */ jsxs35(Fragment10, { children: [
|
|
10609
|
+
icon && /* @__PURE__ */ jsx50("span", { className: "shrink-0", children: icon }),
|
|
10610
|
+
/* @__PURE__ */ jsx50("span", { className: "flex-1 truncate", children }),
|
|
10611
|
+
badge && /* @__PURE__ */ jsx50("span", { className: "shrink-0", children: badge })
|
|
10527
10612
|
] });
|
|
10528
10613
|
const itemClasses = cn(
|
|
10529
10614
|
"flex items-center gap-3 px-3 py-2 rounded-md text-sm transition-colors cursor-pointer",
|
|
@@ -10532,9 +10617,9 @@ var RailPanelItem = React49.forwardRef(
|
|
|
10532
10617
|
className
|
|
10533
10618
|
);
|
|
10534
10619
|
if (href) {
|
|
10535
|
-
return /* @__PURE__ */
|
|
10620
|
+
return /* @__PURE__ */ jsx50("div", { ref, ...props, children: /* @__PURE__ */ jsx50("a", { href, className: itemClasses, children: content }) });
|
|
10536
10621
|
}
|
|
10537
|
-
return /* @__PURE__ */
|
|
10622
|
+
return /* @__PURE__ */ jsx50(
|
|
10538
10623
|
"div",
|
|
10539
10624
|
{
|
|
10540
10625
|
ref,
|
|
@@ -10551,34 +10636,34 @@ var RailPanelItem = React49.forwardRef(
|
|
|
10551
10636
|
RailPanelItem.displayName = "RailPanelItem";
|
|
10552
10637
|
|
|
10553
10638
|
// src/playground.tsx
|
|
10554
|
-
import * as
|
|
10555
|
-
import { jsx as
|
|
10556
|
-
var Section = ({ title, children }) => /* @__PURE__ */
|
|
10557
|
-
/* @__PURE__ */
|
|
10558
|
-
/* @__PURE__ */
|
|
10639
|
+
import * as React51 from "react";
|
|
10640
|
+
import { jsx as jsx51, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
10641
|
+
var Section = ({ title, children }) => /* @__PURE__ */ jsxs36("div", { className: "mb-8", children: [
|
|
10642
|
+
/* @__PURE__ */ jsx51("h2", { className: "text-xl font-semibold mb-4 text-foreground", children: title }),
|
|
10643
|
+
/* @__PURE__ */ jsx51("div", { className: "p-4 border border-border rounded-lg bg-background", children })
|
|
10559
10644
|
] });
|
|
10560
10645
|
var ThemeToggle = () => {
|
|
10561
10646
|
const { theme, setTheme } = useTheme();
|
|
10562
|
-
return /* @__PURE__ */
|
|
10563
|
-
/* @__PURE__ */
|
|
10564
|
-
/* @__PURE__ */
|
|
10565
|
-
/* @__PURE__ */
|
|
10566
|
-
/* @__PURE__ */
|
|
10567
|
-
/* @__PURE__ */
|
|
10568
|
-
/* @__PURE__ */
|
|
10569
|
-
/* @__PURE__ */
|
|
10647
|
+
return /* @__PURE__ */ jsxs36("div", { className: "flex items-center gap-2", children: [
|
|
10648
|
+
/* @__PURE__ */ jsx51(Label, { children: "Theme:" }),
|
|
10649
|
+
/* @__PURE__ */ jsxs36(SelectNamespace, { value: theme, onValueChange: (value) => setTheme(value), children: [
|
|
10650
|
+
/* @__PURE__ */ jsx51(SelectTrigger, { className: "w-32", children: /* @__PURE__ */ jsx51(SelectValue, { placeholder: "Select theme" }) }),
|
|
10651
|
+
/* @__PURE__ */ jsxs36(SelectContent, { children: [
|
|
10652
|
+
/* @__PURE__ */ jsx51(SelectItem, { value: "light", children: "Light" }),
|
|
10653
|
+
/* @__PURE__ */ jsx51(SelectItem, { value: "dark", children: "Dark" }),
|
|
10654
|
+
/* @__PURE__ */ jsx51(SelectItem, { value: "system", children: "System" })
|
|
10570
10655
|
] })
|
|
10571
10656
|
] })
|
|
10572
10657
|
] });
|
|
10573
10658
|
};
|
|
10574
10659
|
var PlaygroundContent = () => {
|
|
10575
|
-
const [dialogOpen, setDialogOpen] =
|
|
10576
|
-
const [checkboxChecked, setCheckboxChecked] =
|
|
10577
|
-
const [switchChecked, setSwitchChecked] =
|
|
10578
|
-
const [inputValue, setInputValue] =
|
|
10579
|
-
const [textareaValue, setTextareaValue] =
|
|
10580
|
-
const [selectValue, setSelectValue] =
|
|
10581
|
-
const [comboboxValue, setComboboxValue] =
|
|
10660
|
+
const [dialogOpen, setDialogOpen] = React51.useState(false);
|
|
10661
|
+
const [checkboxChecked, setCheckboxChecked] = React51.useState(false);
|
|
10662
|
+
const [switchChecked, setSwitchChecked] = React51.useState(false);
|
|
10663
|
+
const [inputValue, setInputValue] = React51.useState("");
|
|
10664
|
+
const [textareaValue, setTextareaValue] = React51.useState("");
|
|
10665
|
+
const [selectValue, setSelectValue] = React51.useState("");
|
|
10666
|
+
const [comboboxValue, setComboboxValue] = React51.useState(null);
|
|
10582
10667
|
const comboboxOptions = [
|
|
10583
10668
|
{ value: "react", label: "React" },
|
|
10584
10669
|
{ value: "vue", label: "Vue" },
|
|
@@ -10586,35 +10671,35 @@ var PlaygroundContent = () => {
|
|
|
10586
10671
|
{ value: "svelte", label: "Svelte" },
|
|
10587
10672
|
{ value: "solid", label: "SolidJS" }
|
|
10588
10673
|
];
|
|
10589
|
-
return /* @__PURE__ */
|
|
10590
|
-
/* @__PURE__ */
|
|
10591
|
-
/* @__PURE__ */
|
|
10592
|
-
/* @__PURE__ */
|
|
10674
|
+
return /* @__PURE__ */ jsx51("div", { className: "min-h-screen bg-background p-8", children: /* @__PURE__ */ jsxs36("div", { className: "max-w-4xl mx-auto", children: [
|
|
10675
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex items-center justify-between mb-8", children: [
|
|
10676
|
+
/* @__PURE__ */ jsx51("h1", { className: "text-3xl font-bold text-foreground", children: "@onesaz/ui Playground" }),
|
|
10677
|
+
/* @__PURE__ */ jsx51(ThemeToggle, {})
|
|
10593
10678
|
] }),
|
|
10594
|
-
/* @__PURE__ */
|
|
10595
|
-
/* @__PURE__ */
|
|
10596
|
-
/* @__PURE__ */
|
|
10597
|
-
/* @__PURE__ */
|
|
10598
|
-
/* @__PURE__ */
|
|
10599
|
-
/* @__PURE__ */
|
|
10600
|
-
/* @__PURE__ */
|
|
10601
|
-
/* @__PURE__ */
|
|
10679
|
+
/* @__PURE__ */ jsxs36(Section, { title: "Button", children: [
|
|
10680
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex flex-wrap gap-4", children: [
|
|
10681
|
+
/* @__PURE__ */ jsx51(Button, { variant: "contained", children: "Default" }),
|
|
10682
|
+
/* @__PURE__ */ jsx51(Button, { variant: "destructive", children: "Destructive" }),
|
|
10683
|
+
/* @__PURE__ */ jsx51(Button, { variant: "outlined", children: "Outline" }),
|
|
10684
|
+
/* @__PURE__ */ jsx51(Button, { variant: "secondary", children: "Secondary" }),
|
|
10685
|
+
/* @__PURE__ */ jsx51(Button, { variant: "ghost", children: "Ghost" }),
|
|
10686
|
+
/* @__PURE__ */ jsx51(Button, { variant: "link", children: "Link" })
|
|
10602
10687
|
] }),
|
|
10603
|
-
/* @__PURE__ */
|
|
10604
|
-
/* @__PURE__ */
|
|
10605
|
-
/* @__PURE__ */
|
|
10606
|
-
/* @__PURE__ */
|
|
10607
|
-
/* @__PURE__ */
|
|
10688
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex flex-wrap gap-4 mt-4", children: [
|
|
10689
|
+
/* @__PURE__ */ jsx51(Button, { size: "sm", children: "Small" }),
|
|
10690
|
+
/* @__PURE__ */ jsx51(Button, { size: "default", children: "Default" }),
|
|
10691
|
+
/* @__PURE__ */ jsx51(Button, { size: "lg", children: "Large" }),
|
|
10692
|
+
/* @__PURE__ */ jsx51(Button, { size: "icon", children: "\u{1F514}" })
|
|
10608
10693
|
] }),
|
|
10609
|
-
/* @__PURE__ */
|
|
10610
|
-
/* @__PURE__ */
|
|
10611
|
-
/* @__PURE__ */
|
|
10694
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex flex-wrap gap-4 mt-4", children: [
|
|
10695
|
+
/* @__PURE__ */ jsx51(Button, { disabled: true, children: "Disabled" }),
|
|
10696
|
+
/* @__PURE__ */ jsx51(Button, { variant: "outlined", disabled: true, children: "Disabled Outline" })
|
|
10612
10697
|
] })
|
|
10613
10698
|
] }),
|
|
10614
|
-
/* @__PURE__ */
|
|
10615
|
-
/* @__PURE__ */
|
|
10616
|
-
/* @__PURE__ */
|
|
10617
|
-
/* @__PURE__ */
|
|
10699
|
+
/* @__PURE__ */ jsx51(Section, { title: "Input", children: /* @__PURE__ */ jsxs36("div", { className: "space-y-4 max-w-md", children: [
|
|
10700
|
+
/* @__PURE__ */ jsxs36("div", { children: [
|
|
10701
|
+
/* @__PURE__ */ jsx51(Label, { htmlFor: "input-default", children: "Default Input" }),
|
|
10702
|
+
/* @__PURE__ */ jsx51(
|
|
10618
10703
|
Input,
|
|
10619
10704
|
{
|
|
10620
10705
|
id: "input-default",
|
|
@@ -10624,19 +10709,19 @@ var PlaygroundContent = () => {
|
|
|
10624
10709
|
}
|
|
10625
10710
|
)
|
|
10626
10711
|
] }),
|
|
10627
|
-
/* @__PURE__ */
|
|
10628
|
-
/* @__PURE__ */
|
|
10629
|
-
/* @__PURE__ */
|
|
10712
|
+
/* @__PURE__ */ jsxs36("div", { children: [
|
|
10713
|
+
/* @__PURE__ */ jsx51(Label, { htmlFor: "input-disabled", children: "Disabled Input" }),
|
|
10714
|
+
/* @__PURE__ */ jsx51(Input, { id: "input-disabled", placeholder: "Disabled...", disabled: true })
|
|
10630
10715
|
] }),
|
|
10631
|
-
/* @__PURE__ */
|
|
10632
|
-
/* @__PURE__ */
|
|
10633
|
-
/* @__PURE__ */
|
|
10716
|
+
/* @__PURE__ */ jsxs36("div", { children: [
|
|
10717
|
+
/* @__PURE__ */ jsx51(Label, { htmlFor: "input-type", children: "Email Input" }),
|
|
10718
|
+
/* @__PURE__ */ jsx51(Input, { id: "input-type", type: "email", placeholder: "email@example.com" })
|
|
10634
10719
|
] })
|
|
10635
10720
|
] }) }),
|
|
10636
|
-
/* @__PURE__ */
|
|
10637
|
-
/* @__PURE__ */
|
|
10638
|
-
/* @__PURE__ */
|
|
10639
|
-
/* @__PURE__ */
|
|
10721
|
+
/* @__PURE__ */ jsx51(Section, { title: "Textarea", children: /* @__PURE__ */ jsxs36("div", { className: "space-y-4 max-w-md", children: [
|
|
10722
|
+
/* @__PURE__ */ jsxs36("div", { children: [
|
|
10723
|
+
/* @__PURE__ */ jsx51(Label, { htmlFor: "textarea-default", children: "Default Textarea" }),
|
|
10724
|
+
/* @__PURE__ */ jsx51(
|
|
10640
10725
|
Textarea,
|
|
10641
10726
|
{
|
|
10642
10727
|
id: "textarea-default",
|
|
@@ -10646,52 +10731,52 @@ var PlaygroundContent = () => {
|
|
|
10646
10731
|
}
|
|
10647
10732
|
)
|
|
10648
10733
|
] }),
|
|
10649
|
-
/* @__PURE__ */
|
|
10650
|
-
/* @__PURE__ */
|
|
10651
|
-
/* @__PURE__ */
|
|
10734
|
+
/* @__PURE__ */ jsxs36("div", { children: [
|
|
10735
|
+
/* @__PURE__ */ jsx51(Label, { htmlFor: "textarea-disabled", children: "Disabled Textarea" }),
|
|
10736
|
+
/* @__PURE__ */ jsx51(Textarea, { id: "textarea-disabled", placeholder: "Disabled...", disabled: true })
|
|
10652
10737
|
] })
|
|
10653
10738
|
] }) }),
|
|
10654
|
-
/* @__PURE__ */
|
|
10655
|
-
/* @__PURE__ */
|
|
10656
|
-
/* @__PURE__ */
|
|
10657
|
-
/* @__PURE__ */
|
|
10658
|
-
/* @__PURE__ */
|
|
10659
|
-
/* @__PURE__ */
|
|
10660
|
-
/* @__PURE__ */
|
|
10661
|
-
/* @__PURE__ */
|
|
10662
|
-
/* @__PURE__ */
|
|
10739
|
+
/* @__PURE__ */ jsx51(Section, { title: "Select", children: /* @__PURE__ */ jsxs36("div", { className: "space-y-4 max-w-md", children: [
|
|
10740
|
+
/* @__PURE__ */ jsxs36("div", { children: [
|
|
10741
|
+
/* @__PURE__ */ jsx51(Label, { children: "Default Select" }),
|
|
10742
|
+
/* @__PURE__ */ jsxs36(SelectNamespace, { value: selectValue, onValueChange: setSelectValue, children: [
|
|
10743
|
+
/* @__PURE__ */ jsx51(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ jsx51(SelectValue, { placeholder: "Select an option..." }) }),
|
|
10744
|
+
/* @__PURE__ */ jsxs36(SelectContent, { children: [
|
|
10745
|
+
/* @__PURE__ */ jsx51(SelectItem, { value: "option1", children: "Option 1" }),
|
|
10746
|
+
/* @__PURE__ */ jsx51(SelectItem, { value: "option2", children: "Option 2" }),
|
|
10747
|
+
/* @__PURE__ */ jsx51(SelectItem, { value: "option3", children: "Option 3" })
|
|
10663
10748
|
] })
|
|
10664
10749
|
] })
|
|
10665
10750
|
] }),
|
|
10666
|
-
/* @__PURE__ */
|
|
10667
|
-
/* @__PURE__ */
|
|
10668
|
-
/* @__PURE__ */
|
|
10669
|
-
/* @__PURE__ */
|
|
10670
|
-
/* @__PURE__ */
|
|
10671
|
-
/* @__PURE__ */
|
|
10672
|
-
/* @__PURE__ */
|
|
10673
|
-
/* @__PURE__ */
|
|
10674
|
-
/* @__PURE__ */
|
|
10751
|
+
/* @__PURE__ */ jsxs36("div", { children: [
|
|
10752
|
+
/* @__PURE__ */ jsx51(Label, { children: "Grouped Select" }),
|
|
10753
|
+
/* @__PURE__ */ jsxs36(SelectNamespace, { children: [
|
|
10754
|
+
/* @__PURE__ */ jsx51(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ jsx51(SelectValue, { placeholder: "Select a food..." }) }),
|
|
10755
|
+
/* @__PURE__ */ jsxs36(SelectContent, { children: [
|
|
10756
|
+
/* @__PURE__ */ jsxs36(SelectGroup, { children: [
|
|
10757
|
+
/* @__PURE__ */ jsx51(SelectLabel, { children: "Fruits" }),
|
|
10758
|
+
/* @__PURE__ */ jsx51(SelectItem, { value: "apple", children: "Apple" }),
|
|
10759
|
+
/* @__PURE__ */ jsx51(SelectItem, { value: "banana", children: "Banana" })
|
|
10675
10760
|
] }),
|
|
10676
|
-
/* @__PURE__ */
|
|
10677
|
-
/* @__PURE__ */
|
|
10678
|
-
/* @__PURE__ */
|
|
10679
|
-
/* @__PURE__ */
|
|
10761
|
+
/* @__PURE__ */ jsxs36(SelectGroup, { children: [
|
|
10762
|
+
/* @__PURE__ */ jsx51(SelectLabel, { children: "Vegetables" }),
|
|
10763
|
+
/* @__PURE__ */ jsx51(SelectItem, { value: "carrot", children: "Carrot" }),
|
|
10764
|
+
/* @__PURE__ */ jsx51(SelectItem, { value: "potato", children: "Potato" })
|
|
10680
10765
|
] })
|
|
10681
10766
|
] })
|
|
10682
10767
|
] })
|
|
10683
10768
|
] }),
|
|
10684
|
-
/* @__PURE__ */
|
|
10685
|
-
/* @__PURE__ */
|
|
10686
|
-
/* @__PURE__ */
|
|
10687
|
-
/* @__PURE__ */
|
|
10688
|
-
/* @__PURE__ */
|
|
10769
|
+
/* @__PURE__ */ jsxs36("div", { children: [
|
|
10770
|
+
/* @__PURE__ */ jsx51(Label, { children: "Disabled Select" }),
|
|
10771
|
+
/* @__PURE__ */ jsxs36(SelectNamespace, { disabled: true, children: [
|
|
10772
|
+
/* @__PURE__ */ jsx51(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ jsx51(SelectValue, { placeholder: "Disabled..." }) }),
|
|
10773
|
+
/* @__PURE__ */ jsx51(SelectContent, { children: /* @__PURE__ */ jsx51(SelectItem, { value: "none", children: "None" }) })
|
|
10689
10774
|
] })
|
|
10690
10775
|
] })
|
|
10691
10776
|
] }) }),
|
|
10692
|
-
/* @__PURE__ */
|
|
10693
|
-
/* @__PURE__ */
|
|
10694
|
-
/* @__PURE__ */
|
|
10777
|
+
/* @__PURE__ */ jsx51(Section, { title: "Combobox (Searchable Select)", children: /* @__PURE__ */ jsx51("div", { className: "space-y-4 max-w-md", children: /* @__PURE__ */ jsxs36("div", { children: [
|
|
10778
|
+
/* @__PURE__ */ jsx51(Label, { children: "Framework" }),
|
|
10779
|
+
/* @__PURE__ */ jsx51(
|
|
10695
10780
|
Combobox,
|
|
10696
10781
|
{
|
|
10697
10782
|
options: comboboxOptions,
|
|
@@ -10703,9 +10788,9 @@ var PlaygroundContent = () => {
|
|
|
10703
10788
|
}
|
|
10704
10789
|
)
|
|
10705
10790
|
] }) }) }),
|
|
10706
|
-
/* @__PURE__ */
|
|
10707
|
-
/* @__PURE__ */
|
|
10708
|
-
/* @__PURE__ */
|
|
10791
|
+
/* @__PURE__ */ jsx51(Section, { title: "Checkbox & Switch", children: /* @__PURE__ */ jsxs36("div", { className: "space-y-4", children: [
|
|
10792
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex items-center gap-2", children: [
|
|
10793
|
+
/* @__PURE__ */ jsx51(
|
|
10709
10794
|
Checkbox,
|
|
10710
10795
|
{
|
|
10711
10796
|
id: "checkbox",
|
|
@@ -10713,15 +10798,15 @@ var PlaygroundContent = () => {
|
|
|
10713
10798
|
onChange: (e) => setCheckboxChecked(e.target.checked)
|
|
10714
10799
|
}
|
|
10715
10800
|
),
|
|
10716
|
-
/* @__PURE__ */
|
|
10801
|
+
/* @__PURE__ */ jsx51(Label, { htmlFor: "checkbox", children: "Accept terms and conditions" })
|
|
10717
10802
|
] }),
|
|
10718
|
-
/* @__PURE__ */
|
|
10719
|
-
/* @__PURE__ */
|
|
10720
|
-
/* @__PURE__ */
|
|
10803
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex items-center gap-2", children: [
|
|
10804
|
+
/* @__PURE__ */ jsx51(Checkbox, { id: "checkbox-disabled", disabled: true }),
|
|
10805
|
+
/* @__PURE__ */ jsx51(Label, { htmlFor: "checkbox-disabled", children: "Disabled checkbox" })
|
|
10721
10806
|
] }),
|
|
10722
|
-
/* @__PURE__ */
|
|
10723
|
-
/* @__PURE__ */
|
|
10724
|
-
/* @__PURE__ */
|
|
10807
|
+
/* @__PURE__ */ jsx51(Separator, {}),
|
|
10808
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex items-center gap-2", children: [
|
|
10809
|
+
/* @__PURE__ */ jsx51(
|
|
10725
10810
|
Switch,
|
|
10726
10811
|
{
|
|
10727
10812
|
id: "switch",
|
|
@@ -10729,161 +10814,161 @@ var PlaygroundContent = () => {
|
|
|
10729
10814
|
onChange: (e) => setSwitchChecked(e.target.checked)
|
|
10730
10815
|
}
|
|
10731
10816
|
),
|
|
10732
|
-
/* @__PURE__ */
|
|
10817
|
+
/* @__PURE__ */ jsx51(Label, { htmlFor: "switch", children: "Enable notifications" })
|
|
10733
10818
|
] }),
|
|
10734
|
-
/* @__PURE__ */
|
|
10735
|
-
/* @__PURE__ */
|
|
10736
|
-
/* @__PURE__ */
|
|
10819
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex items-center gap-2", children: [
|
|
10820
|
+
/* @__PURE__ */ jsx51(Switch, { id: "switch-disabled", disabled: true }),
|
|
10821
|
+
/* @__PURE__ */ jsx51(Label, { htmlFor: "switch-disabled", children: "Disabled switch" })
|
|
10737
10822
|
] })
|
|
10738
10823
|
] }) }),
|
|
10739
|
-
/* @__PURE__ */
|
|
10740
|
-
/* @__PURE__ */
|
|
10741
|
-
/* @__PURE__ */
|
|
10742
|
-
/* @__PURE__ */
|
|
10743
|
-
/* @__PURE__ */
|
|
10744
|
-
/* @__PURE__ */
|
|
10824
|
+
/* @__PURE__ */ jsx51(Section, { title: "Badge", children: /* @__PURE__ */ jsxs36("div", { className: "flex flex-wrap gap-4", children: [
|
|
10825
|
+
/* @__PURE__ */ jsx51(Badge, { children: "Default" }),
|
|
10826
|
+
/* @__PURE__ */ jsx51(Badge, { color: "success", children: "Success" }),
|
|
10827
|
+
/* @__PURE__ */ jsx51(Badge, { color: "warning", children: "Warning" }),
|
|
10828
|
+
/* @__PURE__ */ jsx51(Badge, { color: "error", variant: "outlined", children: "Error" }),
|
|
10829
|
+
/* @__PURE__ */ jsx51(Badge, { color: "destructive", variant: "text", children: "Destructive" })
|
|
10745
10830
|
] }) }),
|
|
10746
|
-
/* @__PURE__ */
|
|
10747
|
-
/* @__PURE__ */
|
|
10748
|
-
/* @__PURE__ */
|
|
10749
|
-
/* @__PURE__ */
|
|
10750
|
-
/* @__PURE__ */
|
|
10831
|
+
/* @__PURE__ */ jsx51(Section, { title: "Card", children: /* @__PURE__ */ jsxs36("div", { className: "grid gap-4 md:grid-cols-2", children: [
|
|
10832
|
+
/* @__PURE__ */ jsxs36(Card, { children: [
|
|
10833
|
+
/* @__PURE__ */ jsxs36(CardHeader, { children: [
|
|
10834
|
+
/* @__PURE__ */ jsx51(CardTitle, { children: "Card Title" }),
|
|
10835
|
+
/* @__PURE__ */ jsx51(CardDescription, { children: "Card description goes here" })
|
|
10751
10836
|
] }),
|
|
10752
|
-
/* @__PURE__ */
|
|
10753
|
-
/* @__PURE__ */
|
|
10754
|
-
/* @__PURE__ */
|
|
10755
|
-
/* @__PURE__ */
|
|
10837
|
+
/* @__PURE__ */ jsx51(CardContent, { children: /* @__PURE__ */ jsx51("p", { className: "text-foreground", children: "This is the card content area." }) }),
|
|
10838
|
+
/* @__PURE__ */ jsxs36(CardFooter, { children: [
|
|
10839
|
+
/* @__PURE__ */ jsx51(Button, { variant: "outlined", className: "mr-2", children: "Cancel" }),
|
|
10840
|
+
/* @__PURE__ */ jsx51(Button, { children: "Submit" })
|
|
10756
10841
|
] })
|
|
10757
10842
|
] }),
|
|
10758
|
-
/* @__PURE__ */
|
|
10759
|
-
/* @__PURE__ */
|
|
10760
|
-
/* @__PURE__ */
|
|
10761
|
-
/* @__PURE__ */
|
|
10843
|
+
/* @__PURE__ */ jsxs36(Card, { children: [
|
|
10844
|
+
/* @__PURE__ */ jsxs36(CardHeader, { children: [
|
|
10845
|
+
/* @__PURE__ */ jsx51(CardTitle, { children: "Another Card" }),
|
|
10846
|
+
/* @__PURE__ */ jsx51(CardDescription, { children: "With different content" })
|
|
10762
10847
|
] }),
|
|
10763
|
-
/* @__PURE__ */
|
|
10764
|
-
/* @__PURE__ */
|
|
10765
|
-
/* @__PURE__ */
|
|
10848
|
+
/* @__PURE__ */ jsx51(CardContent, { children: /* @__PURE__ */ jsxs36("div", { className: "space-y-2", children: [
|
|
10849
|
+
/* @__PURE__ */ jsx51(Label, { htmlFor: "card-input", children: "Name" }),
|
|
10850
|
+
/* @__PURE__ */ jsx51(Input, { id: "card-input", placeholder: "Enter name..." })
|
|
10766
10851
|
] }) }),
|
|
10767
|
-
/* @__PURE__ */
|
|
10852
|
+
/* @__PURE__ */ jsx51(CardFooter, { children: /* @__PURE__ */ jsx51(Button, { className: "w-full", children: "Save" }) })
|
|
10768
10853
|
] })
|
|
10769
10854
|
] }) }),
|
|
10770
|
-
/* @__PURE__ */
|
|
10771
|
-
/* @__PURE__ */
|
|
10772
|
-
/* @__PURE__ */
|
|
10773
|
-
/* @__PURE__ */
|
|
10774
|
-
/* @__PURE__ */
|
|
10775
|
-
/* @__PURE__ */
|
|
10855
|
+
/* @__PURE__ */ jsxs36(Section, { title: "Dialog", children: [
|
|
10856
|
+
/* @__PURE__ */ jsx51(Button, { onClick: () => setDialogOpen(true), children: "Open Dialog" }),
|
|
10857
|
+
/* @__PURE__ */ jsx51(DialogNamespace, { open: dialogOpen, onOpenChange: setDialogOpen, children: /* @__PURE__ */ jsxs36(DialogContent, { children: [
|
|
10858
|
+
/* @__PURE__ */ jsxs36(DialogHeader, { children: [
|
|
10859
|
+
/* @__PURE__ */ jsx51(DialogTitle, { children: "Create New Zone" }),
|
|
10860
|
+
/* @__PURE__ */ jsx51(DialogDescription, { children: "Fill in the details below to create a new zone." })
|
|
10776
10861
|
] }),
|
|
10777
|
-
/* @__PURE__ */
|
|
10778
|
-
/* @__PURE__ */
|
|
10779
|
-
/* @__PURE__ */
|
|
10780
|
-
/* @__PURE__ */
|
|
10781
|
-
/* @__PURE__ */
|
|
10862
|
+
/* @__PURE__ */ jsxs36("div", { className: "space-y-4 py-4", children: [
|
|
10863
|
+
/* @__PURE__ */ jsxs36("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
10864
|
+
/* @__PURE__ */ jsxs36("div", { children: [
|
|
10865
|
+
/* @__PURE__ */ jsx51(Label, { htmlFor: "zone-name", children: "Zone Name *" }),
|
|
10866
|
+
/* @__PURE__ */ jsx51(Input, { id: "zone-name", placeholder: "eg:hyderabad" })
|
|
10782
10867
|
] }),
|
|
10783
|
-
/* @__PURE__ */
|
|
10784
|
-
/* @__PURE__ */
|
|
10785
|
-
/* @__PURE__ */
|
|
10868
|
+
/* @__PURE__ */ jsxs36("div", { children: [
|
|
10869
|
+
/* @__PURE__ */ jsx51(Label, { htmlFor: "zone-code", children: "Zone Code *" }),
|
|
10870
|
+
/* @__PURE__ */ jsx51(Input, { id: "zone-code", placeholder: "eg :hyd022" })
|
|
10786
10871
|
] })
|
|
10787
10872
|
] }),
|
|
10788
|
-
/* @__PURE__ */
|
|
10789
|
-
/* @__PURE__ */
|
|
10790
|
-
/* @__PURE__ */
|
|
10791
|
-
/* @__PURE__ */
|
|
10792
|
-
/* @__PURE__ */
|
|
10793
|
-
/* @__PURE__ */
|
|
10794
|
-
/* @__PURE__ */
|
|
10795
|
-
/* @__PURE__ */
|
|
10873
|
+
/* @__PURE__ */ jsxs36("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
10874
|
+
/* @__PURE__ */ jsxs36("div", { children: [
|
|
10875
|
+
/* @__PURE__ */ jsx51(Label, { children: "State *" }),
|
|
10876
|
+
/* @__PURE__ */ jsxs36(SelectNamespace, { children: [
|
|
10877
|
+
/* @__PURE__ */ jsx51(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ jsx51(SelectValue, { placeholder: "Select state" }) }),
|
|
10878
|
+
/* @__PURE__ */ jsxs36(SelectContent, { children: [
|
|
10879
|
+
/* @__PURE__ */ jsx51(SelectItem, { value: "telangana", children: "TELANGANA" }),
|
|
10880
|
+
/* @__PURE__ */ jsx51(SelectItem, { value: "andhra", children: "ANDHRA PRADESH" })
|
|
10796
10881
|
] })
|
|
10797
10882
|
] })
|
|
10798
10883
|
] }),
|
|
10799
|
-
/* @__PURE__ */
|
|
10800
|
-
/* @__PURE__ */
|
|
10801
|
-
/* @__PURE__ */
|
|
10802
|
-
/* @__PURE__ */
|
|
10803
|
-
/* @__PURE__ */
|
|
10804
|
-
/* @__PURE__ */
|
|
10805
|
-
/* @__PURE__ */
|
|
10884
|
+
/* @__PURE__ */ jsxs36("div", { children: [
|
|
10885
|
+
/* @__PURE__ */ jsx51(Label, { children: "District *" }),
|
|
10886
|
+
/* @__PURE__ */ jsxs36(SelectNamespace, { children: [
|
|
10887
|
+
/* @__PURE__ */ jsx51(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ jsx51(SelectValue, { placeholder: "Select District" }) }),
|
|
10888
|
+
/* @__PURE__ */ jsxs36(SelectContent, { children: [
|
|
10889
|
+
/* @__PURE__ */ jsx51(SelectItem, { value: "hyderabad", children: "HYDERABAD" }),
|
|
10890
|
+
/* @__PURE__ */ jsx51(SelectItem, { value: "rangareddy", children: "RANGAREDDY" })
|
|
10806
10891
|
] })
|
|
10807
10892
|
] })
|
|
10808
10893
|
] })
|
|
10809
10894
|
] })
|
|
10810
10895
|
] }),
|
|
10811
|
-
/* @__PURE__ */
|
|
10812
|
-
/* @__PURE__ */
|
|
10813
|
-
/* @__PURE__ */
|
|
10896
|
+
/* @__PURE__ */ jsxs36(DialogFooter, { children: [
|
|
10897
|
+
/* @__PURE__ */ jsx51(Button, { variant: "outlined", onClick: () => setDialogOpen(false), children: "CANCEL" }),
|
|
10898
|
+
/* @__PURE__ */ jsx51(Button, { onClick: () => setDialogOpen(false), children: "Create" })
|
|
10814
10899
|
] })
|
|
10815
10900
|
] }) })
|
|
10816
10901
|
] }),
|
|
10817
|
-
/* @__PURE__ */
|
|
10818
|
-
/* @__PURE__ */
|
|
10819
|
-
/* @__PURE__ */
|
|
10820
|
-
/* @__PURE__ */
|
|
10821
|
-
/* @__PURE__ */
|
|
10822
|
-
/* @__PURE__ */
|
|
10823
|
-
/* @__PURE__ */
|
|
10902
|
+
/* @__PURE__ */ jsx51(Section, { title: "Table", children: /* @__PURE__ */ jsxs36(TableNamespace, { children: [
|
|
10903
|
+
/* @__PURE__ */ jsx51(TableCaption, { children: "A list of recent invoices" }),
|
|
10904
|
+
/* @__PURE__ */ jsx51(TableHeader, { children: /* @__PURE__ */ jsxs36(TableRow, { children: [
|
|
10905
|
+
/* @__PURE__ */ jsx51(TableHead, { children: "Invoice" }),
|
|
10906
|
+
/* @__PURE__ */ jsx51(TableHead, { children: "Status" }),
|
|
10907
|
+
/* @__PURE__ */ jsx51(TableHead, { children: "Method" }),
|
|
10908
|
+
/* @__PURE__ */ jsx51(TableHead, { className: "text-right", children: "Amount" })
|
|
10824
10909
|
] }) }),
|
|
10825
|
-
/* @__PURE__ */
|
|
10826
|
-
/* @__PURE__ */
|
|
10827
|
-
/* @__PURE__ */
|
|
10828
|
-
/* @__PURE__ */
|
|
10829
|
-
/* @__PURE__ */
|
|
10830
|
-
/* @__PURE__ */
|
|
10910
|
+
/* @__PURE__ */ jsxs36(TableBody, { children: [
|
|
10911
|
+
/* @__PURE__ */ jsxs36(TableRow, { children: [
|
|
10912
|
+
/* @__PURE__ */ jsx51(TableCell, { children: "INV001" }),
|
|
10913
|
+
/* @__PURE__ */ jsx51(TableCell, { children: /* @__PURE__ */ jsx51(Badge, { color: "success", children: "Paid" }) }),
|
|
10914
|
+
/* @__PURE__ */ jsx51(TableCell, { children: "Credit Card" }),
|
|
10915
|
+
/* @__PURE__ */ jsx51(TableCell, { className: "text-right", children: "$250.00" })
|
|
10831
10916
|
] }),
|
|
10832
|
-
/* @__PURE__ */
|
|
10833
|
-
/* @__PURE__ */
|
|
10834
|
-
/* @__PURE__ */
|
|
10835
|
-
/* @__PURE__ */
|
|
10836
|
-
/* @__PURE__ */
|
|
10917
|
+
/* @__PURE__ */ jsxs36(TableRow, { children: [
|
|
10918
|
+
/* @__PURE__ */ jsx51(TableCell, { children: "INV002" }),
|
|
10919
|
+
/* @__PURE__ */ jsx51(TableCell, { children: /* @__PURE__ */ jsx51(Badge, { color: "warning", variant: "outlined", children: "Pending" }) }),
|
|
10920
|
+
/* @__PURE__ */ jsx51(TableCell, { children: "PayPal" }),
|
|
10921
|
+
/* @__PURE__ */ jsx51(TableCell, { className: "text-right", children: "$150.00" })
|
|
10837
10922
|
] }),
|
|
10838
|
-
/* @__PURE__ */
|
|
10839
|
-
/* @__PURE__ */
|
|
10840
|
-
/* @__PURE__ */
|
|
10841
|
-
/* @__PURE__ */
|
|
10842
|
-
/* @__PURE__ */
|
|
10923
|
+
/* @__PURE__ */ jsxs36(TableRow, { children: [
|
|
10924
|
+
/* @__PURE__ */ jsx51(TableCell, { children: "INV003" }),
|
|
10925
|
+
/* @__PURE__ */ jsx51(TableCell, { children: /* @__PURE__ */ jsx51(Badge, { color: "error", variant: "outlined", children: "Failed" }) }),
|
|
10926
|
+
/* @__PURE__ */ jsx51(TableCell, { children: "Bank Transfer" }),
|
|
10927
|
+
/* @__PURE__ */ jsx51(TableCell, { className: "text-right", children: "$350.00" })
|
|
10843
10928
|
] })
|
|
10844
10929
|
] })
|
|
10845
10930
|
] }) }),
|
|
10846
|
-
/* @__PURE__ */
|
|
10847
|
-
/* @__PURE__ */
|
|
10848
|
-
/* @__PURE__ */
|
|
10849
|
-
/* @__PURE__ */
|
|
10850
|
-
/* @__PURE__ */
|
|
10851
|
-
/* @__PURE__ */
|
|
10852
|
-
/* @__PURE__ */
|
|
10931
|
+
/* @__PURE__ */ jsx51(Section, { title: "Pagination", children: /* @__PURE__ */ jsx51(PaginationNamespace, { children: /* @__PURE__ */ jsxs36(PaginationContent, { children: [
|
|
10932
|
+
/* @__PURE__ */ jsx51(PaginationItem, { children: /* @__PURE__ */ jsx51(PaginationPrevious, { onClick: () => console.log("Previous") }) }),
|
|
10933
|
+
/* @__PURE__ */ jsx51(PaginationItem, { children: /* @__PURE__ */ jsx51(PaginationLink, { isActive: true, children: "1" }) }),
|
|
10934
|
+
/* @__PURE__ */ jsx51(PaginationItem, { children: /* @__PURE__ */ jsx51(PaginationLink, { children: "2" }) }),
|
|
10935
|
+
/* @__PURE__ */ jsx51(PaginationItem, { children: /* @__PURE__ */ jsx51(PaginationLink, { children: "3" }) }),
|
|
10936
|
+
/* @__PURE__ */ jsx51(PaginationItem, { children: /* @__PURE__ */ jsx51(PaginationEllipsis, {}) }),
|
|
10937
|
+
/* @__PURE__ */ jsx51(PaginationItem, { children: /* @__PURE__ */ jsx51(PaginationNext, { onClick: () => console.log("Next") }) })
|
|
10853
10938
|
] }) }) }),
|
|
10854
|
-
/* @__PURE__ */
|
|
10855
|
-
/* @__PURE__ */
|
|
10856
|
-
/* @__PURE__ */
|
|
10857
|
-
/* @__PURE__ */
|
|
10939
|
+
/* @__PURE__ */ jsx51(Section, { title: "Spinner", children: /* @__PURE__ */ jsxs36("div", { className: "flex items-center gap-8", children: [
|
|
10940
|
+
/* @__PURE__ */ jsxs36("div", { className: "text-center", children: [
|
|
10941
|
+
/* @__PURE__ */ jsx51(Spinner2, { size: "sm" }),
|
|
10942
|
+
/* @__PURE__ */ jsx51("p", { className: "text-sm text-muted-foreground mt-2", children: "Small" })
|
|
10858
10943
|
] }),
|
|
10859
|
-
/* @__PURE__ */
|
|
10860
|
-
/* @__PURE__ */
|
|
10861
|
-
/* @__PURE__ */
|
|
10944
|
+
/* @__PURE__ */ jsxs36("div", { className: "text-center", children: [
|
|
10945
|
+
/* @__PURE__ */ jsx51(Spinner2, { size: "default" }),
|
|
10946
|
+
/* @__PURE__ */ jsx51("p", { className: "text-sm text-muted-foreground mt-2", children: "Default" })
|
|
10862
10947
|
] }),
|
|
10863
|
-
/* @__PURE__ */
|
|
10864
|
-
/* @__PURE__ */
|
|
10865
|
-
/* @__PURE__ */
|
|
10948
|
+
/* @__PURE__ */ jsxs36("div", { className: "text-center", children: [
|
|
10949
|
+
/* @__PURE__ */ jsx51(Spinner2, { size: "lg" }),
|
|
10950
|
+
/* @__PURE__ */ jsx51("p", { className: "text-sm text-muted-foreground mt-2", children: "Large" })
|
|
10866
10951
|
] })
|
|
10867
10952
|
] }) }),
|
|
10868
|
-
/* @__PURE__ */
|
|
10869
|
-
/* @__PURE__ */
|
|
10870
|
-
/* @__PURE__ */
|
|
10871
|
-
/* @__PURE__ */
|
|
10872
|
-
/* @__PURE__ */
|
|
10873
|
-
/* @__PURE__ */
|
|
10874
|
-
/* @__PURE__ */
|
|
10875
|
-
/* @__PURE__ */
|
|
10953
|
+
/* @__PURE__ */ jsx51(Section, { title: "Separator", children: /* @__PURE__ */ jsxs36("div", { className: "space-y-4", children: [
|
|
10954
|
+
/* @__PURE__ */ jsx51("p", { className: "text-foreground", children: "Content above separator" }),
|
|
10955
|
+
/* @__PURE__ */ jsx51(Separator, {}),
|
|
10956
|
+
/* @__PURE__ */ jsx51("p", { className: "text-foreground", children: "Content below separator" }),
|
|
10957
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex items-center h-10", children: [
|
|
10958
|
+
/* @__PURE__ */ jsx51("span", { className: "text-foreground", children: "Left" }),
|
|
10959
|
+
/* @__PURE__ */ jsx51(Separator, { orientation: "vertical", className: "mx-4" }),
|
|
10960
|
+
/* @__PURE__ */ jsx51("span", { className: "text-foreground", children: "Right" })
|
|
10876
10961
|
] })
|
|
10877
10962
|
] }) }),
|
|
10878
|
-
/* @__PURE__ */
|
|
10879
|
-
/* @__PURE__ */
|
|
10880
|
-
/* @__PURE__ */
|
|
10881
|
-
/* @__PURE__ */
|
|
10882
|
-
/* @__PURE__ */
|
|
10963
|
+
/* @__PURE__ */ jsx51(Section, { title: "Typography & Colors", children: /* @__PURE__ */ jsxs36("div", { className: "space-y-2", children: [
|
|
10964
|
+
/* @__PURE__ */ jsx51("p", { className: "text-foreground", children: "text-foreground - Primary text color" }),
|
|
10965
|
+
/* @__PURE__ */ jsx51("p", { className: "text-muted-foreground", children: "text-muted-foreground - Muted text color" }),
|
|
10966
|
+
/* @__PURE__ */ jsx51("p", { className: "text-accent", children: "text-accent - Accent color" }),
|
|
10967
|
+
/* @__PURE__ */ jsx51("p", { className: "text-destructive", children: "text-destructive - Destructive color" })
|
|
10883
10968
|
] }) })
|
|
10884
10969
|
] }) });
|
|
10885
10970
|
};
|
|
10886
|
-
var Playground = () => /* @__PURE__ */
|
|
10971
|
+
var Playground = () => /* @__PURE__ */ jsx51(ThemeProvider, { defaultTheme: "light", children: /* @__PURE__ */ jsx51(PlaygroundContent, {}) });
|
|
10887
10972
|
export {
|
|
10888
10973
|
Accordion,
|
|
10889
10974
|
AccordionContent,
|
|
@@ -11023,6 +11108,15 @@ export {
|
|
|
11023
11108
|
PaginationPrevious,
|
|
11024
11109
|
PieChart,
|
|
11025
11110
|
Playground,
|
|
11111
|
+
Popover,
|
|
11112
|
+
PopoverAnchor,
|
|
11113
|
+
PopoverArrow,
|
|
11114
|
+
PopoverClose,
|
|
11115
|
+
PopoverContent,
|
|
11116
|
+
PopoverPortal,
|
|
11117
|
+
PopoverRoot,
|
|
11118
|
+
PopoverTrigger,
|
|
11119
|
+
Popper,
|
|
11026
11120
|
Progress,
|
|
11027
11121
|
ProgressCard,
|
|
11028
11122
|
ProgressDonut,
|