@olwiba/cn 0.1.26 → 0.1.27
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 +40 -25
- package/dist/index.js +441 -243
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -142,23 +142,26 @@ var alertVariants = cva(
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
);
|
|
145
|
-
var Alert = React37.forwardRef(({ className, variant, mode, size, disabled, ...props }, ref) =>
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
145
|
+
var Alert = React37.forwardRef(({ className, variant, mode: modeProp, size, disabled, ...props }, ref) => {
|
|
146
|
+
const mode = modeProp ?? useUIVariant();
|
|
147
|
+
return /* @__PURE__ */ jsx(
|
|
148
|
+
"div",
|
|
149
|
+
{
|
|
150
|
+
ref,
|
|
151
|
+
role: "alert",
|
|
152
|
+
className: cn(
|
|
153
|
+
alertVariants({ variant }),
|
|
154
|
+
size === "sm" && "p-3 text-xs [&>svg]:top-3 [&>svg]:left-3",
|
|
155
|
+
size === "lg" && "p-6 text-base [&>svg]:top-6 [&>svg]:left-6",
|
|
156
|
+
mode === "smooth" && "rounded-2xl",
|
|
157
|
+
mode === "playful" && "border-l-4",
|
|
158
|
+
disabled && "opacity-50 pointer-events-none",
|
|
159
|
+
className
|
|
160
|
+
),
|
|
161
|
+
...props
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
});
|
|
162
165
|
Alert.displayName = "Alert";
|
|
163
166
|
var AlertTitle = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
164
167
|
"h5",
|
|
@@ -178,6 +181,12 @@ var AlertDescription = React37.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
178
181
|
}
|
|
179
182
|
));
|
|
180
183
|
AlertDescription.displayName = "AlertDescription";
|
|
184
|
+
|
|
185
|
+
// src/components/ui/glass.ts
|
|
186
|
+
var glassBlur = "backdrop-blur-xl backdrop-saturate-150";
|
|
187
|
+
var glassSurface = "border border-white/20 bg-background/60 backdrop-blur-xl backdrop-saturate-150 shadow-lg shadow-black/10 dark:border-white/10 dark:bg-background/40";
|
|
188
|
+
var glassPanel = "border border-white/20 bg-popover/70 backdrop-blur-lg backdrop-saturate-150 shadow-lg shadow-black/10 dark:border-white/10 dark:bg-popover/50";
|
|
189
|
+
var glassControl = "border border-white/25 bg-background/50 backdrop-blur-md backdrop-saturate-150 shadow-sm shadow-black/10 dark:border-white/10 dark:bg-background/30";
|
|
181
190
|
var buttonVariants = cva(
|
|
182
191
|
"inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-semibold transition-all duration-200 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/20 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
183
192
|
{
|
|
@@ -203,6 +212,12 @@ var buttonVariants = cva(
|
|
|
203
212
|
}
|
|
204
213
|
}
|
|
205
214
|
);
|
|
215
|
+
var glassButtonBg = {
|
|
216
|
+
default: "bg-primary/75 hover:bg-primary/60",
|
|
217
|
+
destructive: "bg-destructive/75 hover:bg-destructive/60",
|
|
218
|
+
outline: "bg-background/40 hover:bg-background/60",
|
|
219
|
+
secondary: "bg-secondary/50 hover:bg-secondary/40"
|
|
220
|
+
};
|
|
206
221
|
var Button = React37.forwardRef(
|
|
207
222
|
({ className, variant, size, asChild = false, mode: modeProp, ...props }, ref) => {
|
|
208
223
|
const mode = modeProp ?? useUIVariant();
|
|
@@ -236,12 +251,18 @@ var Button = React37.forwardRef(
|
|
|
236
251
|
)
|
|
237
252
|
] });
|
|
238
253
|
}
|
|
254
|
+
const isGlass = mode === "glass" && variant !== "ghost" && variant !== "link";
|
|
239
255
|
return /* @__PURE__ */ jsx(
|
|
240
256
|
Comp,
|
|
241
257
|
{
|
|
242
258
|
className: cn(
|
|
243
259
|
buttonVariants({ variant, size, className }),
|
|
244
|
-
mode === "smooth" && "rounded-full shadow-none"
|
|
260
|
+
mode === "smooth" && "rounded-full shadow-none",
|
|
261
|
+
isGlass && cn(
|
|
262
|
+
glassBlur,
|
|
263
|
+
"border border-white/25 shadow-sm shadow-black/10 dark:border-white/15",
|
|
264
|
+
glassButtonBg[variant ?? "default"]
|
|
265
|
+
)
|
|
245
266
|
),
|
|
246
267
|
ref,
|
|
247
268
|
...props
|
|
@@ -265,24 +286,27 @@ var AlertDialogOverlay = React37.forwardRef(({ className, ...props }, ref) => /*
|
|
|
265
286
|
}
|
|
266
287
|
));
|
|
267
288
|
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
268
|
-
var AlertDialogContent = React37.forwardRef(({ className, mode, children, ...props }, ref) =>
|
|
269
|
-
|
|
270
|
-
/* @__PURE__ */
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
289
|
+
var AlertDialogContent = React37.forwardRef(({ className, mode: modeProp, children, ...props }, ref) => {
|
|
290
|
+
const mode = modeProp ?? useUIVariant();
|
|
291
|
+
return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
|
|
292
|
+
/* @__PURE__ */ jsx(AlertDialogOverlay, {}),
|
|
293
|
+
/* @__PURE__ */ jsx(
|
|
294
|
+
AlertDialogPrimitive.Content,
|
|
295
|
+
{
|
|
296
|
+
ref,
|
|
297
|
+
className: cn(
|
|
298
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%]",
|
|
299
|
+
!mode && "shadow-lg sm:rounded-lg",
|
|
300
|
+
mode === "smooth" && "rounded-2xl shadow-xl",
|
|
301
|
+
mode === "playful" && "rounded-xl border-2 shadow-lg shadow-primary/10",
|
|
302
|
+
className
|
|
303
|
+
),
|
|
304
|
+
...props,
|
|
305
|
+
children: /* @__PURE__ */ jsx(UIVariantProvider, { mode, children })
|
|
306
|
+
}
|
|
307
|
+
)
|
|
308
|
+
] });
|
|
309
|
+
});
|
|
286
310
|
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
287
311
|
var AlertDialogHeader = ({
|
|
288
312
|
className,
|
|
@@ -940,6 +964,7 @@ var Card = React37.forwardRef(
|
|
|
940
964
|
className: cn(
|
|
941
965
|
"rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
942
966
|
mode === "smooth" && "rounded-3xl",
|
|
967
|
+
mode === "glass" && cn(glassSurface, "rounded-xl"),
|
|
943
968
|
className
|
|
944
969
|
),
|
|
945
970
|
...props
|
|
@@ -1527,30 +1552,34 @@ var DialogOverlay = React37.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
1527
1552
|
}
|
|
1528
1553
|
));
|
|
1529
1554
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
1530
|
-
var DialogContent = React37.forwardRef(({ className, mode, children, ...props }, ref) =>
|
|
1531
|
-
|
|
1532
|
-
/* @__PURE__ */
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1555
|
+
var DialogContent = React37.forwardRef(({ className, mode: modeProp, children, ...props }, ref) => {
|
|
1556
|
+
const mode = modeProp ?? useUIVariant();
|
|
1557
|
+
return /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
1558
|
+
/* @__PURE__ */ jsx(DialogOverlay, { className: mode === "glass" ? "bg-black/40" : void 0 }),
|
|
1559
|
+
/* @__PURE__ */ jsx(
|
|
1560
|
+
DialogPrimitive.Content,
|
|
1561
|
+
{
|
|
1562
|
+
ref,
|
|
1563
|
+
className: cn(
|
|
1564
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:slide-out-to-top-full data-[state=open]:slide-in-from-top-full",
|
|
1565
|
+
!mode && "shadow-lg sm:rounded-lg",
|
|
1566
|
+
mode === "smooth" && "rounded-2xl shadow-xl",
|
|
1567
|
+
mode === "playful" && "rounded-xl border-2 shadow-lg shadow-primary/10",
|
|
1568
|
+
mode === "glass" && cn(glassSurface, "rounded-2xl"),
|
|
1569
|
+
className
|
|
1570
|
+
),
|
|
1571
|
+
...props,
|
|
1572
|
+
children: /* @__PURE__ */ jsxs(UIVariantProvider, { mode, children: [
|
|
1573
|
+
children,
|
|
1574
|
+
/* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
1575
|
+
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
1576
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
1577
|
+
] })
|
|
1549
1578
|
] })
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
)
|
|
1553
|
-
|
|
1579
|
+
}
|
|
1580
|
+
)
|
|
1581
|
+
] });
|
|
1582
|
+
});
|
|
1554
1583
|
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
1555
1584
|
var DialogHeader = ({
|
|
1556
1585
|
className,
|
|
@@ -1644,20 +1673,45 @@ function useIsMac() {
|
|
|
1644
1673
|
return isMac;
|
|
1645
1674
|
}
|
|
1646
1675
|
var Hotkey = React37.forwardRef(
|
|
1647
|
-
({ shortcut, asKbd = false, className, ...props }, ref) => {
|
|
1676
|
+
({ shortcut, asKbd = false, mode: modeProp, className, ...props }, ref) => {
|
|
1648
1677
|
const isMac = useIsMac();
|
|
1649
1678
|
const content = formatShortcut(shortcut, isMac);
|
|
1679
|
+
const mode = modeProp ?? useUIVariant();
|
|
1650
1680
|
if (asKbd) {
|
|
1681
|
+
const kbdClasses = cn(
|
|
1682
|
+
"bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 select-none items-center justify-center gap-1 px-1 font-sans text-xs font-medium",
|
|
1683
|
+
"[&_svg:not([class*='size-'])]:size-3",
|
|
1684
|
+
!mode && "rounded-sm",
|
|
1685
|
+
mode === "smooth" && "rounded-md",
|
|
1686
|
+
mode === "playful" && "rounded-sm"
|
|
1687
|
+
);
|
|
1688
|
+
if (mode === "playful") {
|
|
1689
|
+
return /* @__PURE__ */ jsxs("span", { className: "group/playful relative inline-flex", children: [
|
|
1690
|
+
/* @__PURE__ */ jsx(
|
|
1691
|
+
"span",
|
|
1692
|
+
{
|
|
1693
|
+
"aria-hidden": "true",
|
|
1694
|
+
className: "absolute inset-0 rounded-sm bg-primary/30 dark:bg-primary/20 transition-transform duration-200 translate-x-[2px] translate-y-[2px] -rotate-[3deg] group-hover/playful:-rotate-[5deg]"
|
|
1695
|
+
}
|
|
1696
|
+
),
|
|
1697
|
+
/* @__PURE__ */ jsx(
|
|
1698
|
+
"kbd",
|
|
1699
|
+
{
|
|
1700
|
+
ref,
|
|
1701
|
+
"data-slot": "hotkey",
|
|
1702
|
+
className: cn(kbdClasses, "relative rotate-[1.5deg]", className),
|
|
1703
|
+
...props,
|
|
1704
|
+
children: content
|
|
1705
|
+
}
|
|
1706
|
+
)
|
|
1707
|
+
] });
|
|
1708
|
+
}
|
|
1651
1709
|
return /* @__PURE__ */ jsx(
|
|
1652
1710
|
"kbd",
|
|
1653
1711
|
{
|
|
1654
1712
|
ref,
|
|
1655
1713
|
"data-slot": "hotkey",
|
|
1656
|
-
className: cn(
|
|
1657
|
-
"bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 select-none items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium",
|
|
1658
|
-
"[&_svg:not([class*='size-'])]:size-3",
|
|
1659
|
-
className
|
|
1660
|
-
),
|
|
1714
|
+
className: cn(kbdClasses, className),
|
|
1661
1715
|
...props,
|
|
1662
1716
|
children: content
|
|
1663
1717
|
}
|
|
@@ -1798,92 +1852,132 @@ var ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
|
1798
1852
|
var ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
1799
1853
|
var ContextMenuSub = ContextMenuPrimitive.Sub;
|
|
1800
1854
|
var ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
|
|
1801
|
-
var ContextMenuSubTrigger = React37.forwardRef(({ className, inset, children, ...props }, ref) =>
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1855
|
+
var ContextMenuSubTrigger = React37.forwardRef(({ className, inset, children, ...props }, ref) => {
|
|
1856
|
+
const mode = useUIVariant();
|
|
1857
|
+
return /* @__PURE__ */ jsxs(
|
|
1858
|
+
ContextMenuPrimitive.SubTrigger,
|
|
1859
|
+
{
|
|
1860
|
+
ref,
|
|
1861
|
+
className: cn(
|
|
1862
|
+
"flex cursor-default select-none items-center px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
|
|
1863
|
+
!mode && "rounded-sm",
|
|
1864
|
+
mode === "smooth" && "rounded-lg",
|
|
1865
|
+
mode === "playful" && "rounded-lg",
|
|
1866
|
+
inset && "pl-8",
|
|
1867
|
+
className
|
|
1868
|
+
),
|
|
1869
|
+
...props,
|
|
1870
|
+
children: [
|
|
1871
|
+
children,
|
|
1872
|
+
/* @__PURE__ */ jsx(ChevronRight, { className: "ml-auto h-4 w-4" })
|
|
1873
|
+
]
|
|
1874
|
+
}
|
|
1875
|
+
);
|
|
1876
|
+
});
|
|
1817
1877
|
ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
|
|
1818
|
-
var ContextMenuSubContent = React37.forwardRef(({ className, ...props }, ref) =>
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1878
|
+
var ContextMenuSubContent = React37.forwardRef(({ className, mode: modeProp, children, ...props }, ref) => {
|
|
1879
|
+
const inheritedMode = useUIVariant();
|
|
1880
|
+
const mode = modeProp ?? inheritedMode;
|
|
1881
|
+
return /* @__PURE__ */ jsx(
|
|
1882
|
+
ContextMenuPrimitive.SubContent,
|
|
1883
|
+
{
|
|
1884
|
+
ref,
|
|
1885
|
+
className: cn(
|
|
1886
|
+
"z-50 min-w-[8rem] overflow-hidden border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]",
|
|
1887
|
+
!mode && "rounded-md shadow-md",
|
|
1888
|
+
mode === "smooth" && "rounded-2xl shadow-xl",
|
|
1889
|
+
mode === "playful" && "rounded-xl border-2 shadow-lg shadow-primary/10",
|
|
1890
|
+
className
|
|
1891
|
+
),
|
|
1892
|
+
...props,
|
|
1893
|
+
children: /* @__PURE__ */ jsx(UIVariantProvider, { mode, children })
|
|
1894
|
+
}
|
|
1895
|
+
);
|
|
1896
|
+
});
|
|
1829
1897
|
ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
|
|
1830
|
-
var ContextMenuContent = React37.forwardRef(({ className, ...props }, ref) =>
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1898
|
+
var ContextMenuContent = React37.forwardRef(({ className, mode: modeProp, children, ...props }, ref) => {
|
|
1899
|
+
const inheritedMode = useUIVariant();
|
|
1900
|
+
const mode = modeProp ?? inheritedMode;
|
|
1901
|
+
return /* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
1902
|
+
ContextMenuPrimitive.Content,
|
|
1903
|
+
{
|
|
1904
|
+
ref,
|
|
1905
|
+
className: cn(
|
|
1906
|
+
"z-50 max-h-[--radix-context-menu-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden border bg-popover p-1 text-popover-foreground animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]",
|
|
1907
|
+
!mode && "rounded-md shadow-md",
|
|
1908
|
+
mode === "smooth" && "rounded-2xl shadow-xl",
|
|
1909
|
+
mode === "playful" && "rounded-xl border-2 shadow-lg shadow-primary/10",
|
|
1910
|
+
className
|
|
1911
|
+
),
|
|
1912
|
+
...props,
|
|
1913
|
+
children: /* @__PURE__ */ jsx(UIVariantProvider, { mode, children })
|
|
1914
|
+
}
|
|
1915
|
+
) });
|
|
1916
|
+
});
|
|
1841
1917
|
ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
|
|
1842
|
-
var ContextMenuItem = React37.forwardRef(({ className, inset, ...props }, ref) =>
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1918
|
+
var ContextMenuItem = React37.forwardRef(({ className, inset, ...props }, ref) => {
|
|
1919
|
+
const mode = useUIVariant();
|
|
1920
|
+
return /* @__PURE__ */ jsx(
|
|
1921
|
+
ContextMenuPrimitive.Item,
|
|
1922
|
+
{
|
|
1923
|
+
ref,
|
|
1924
|
+
className: cn(
|
|
1925
|
+
"relative flex cursor-default select-none items-center px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
1926
|
+
!mode && "rounded-sm",
|
|
1927
|
+
mode === "smooth" && "rounded-lg",
|
|
1928
|
+
mode === "playful" && "rounded-lg",
|
|
1929
|
+
inset && "pl-8",
|
|
1930
|
+
className
|
|
1931
|
+
),
|
|
1932
|
+
...props
|
|
1933
|
+
}
|
|
1934
|
+
);
|
|
1935
|
+
});
|
|
1854
1936
|
ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
|
|
1855
|
-
var ContextMenuCheckboxItem = React37.forwardRef(({ className, children, checked, ...props }, ref) =>
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
className
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1937
|
+
var ContextMenuCheckboxItem = React37.forwardRef(({ className, children, checked, ...props }, ref) => {
|
|
1938
|
+
const mode = useUIVariant();
|
|
1939
|
+
return /* @__PURE__ */ jsxs(
|
|
1940
|
+
ContextMenuPrimitive.CheckboxItem,
|
|
1941
|
+
{
|
|
1942
|
+
ref,
|
|
1943
|
+
className: cn(
|
|
1944
|
+
"relative flex cursor-default select-none items-center py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
1945
|
+
!mode && "rounded-sm",
|
|
1946
|
+
mode === "smooth" && "rounded-lg",
|
|
1947
|
+
mode === "playful" && "rounded-lg",
|
|
1948
|
+
className
|
|
1949
|
+
),
|
|
1950
|
+
checked,
|
|
1951
|
+
...props,
|
|
1952
|
+
children: [
|
|
1953
|
+
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) }) }),
|
|
1954
|
+
children
|
|
1955
|
+
]
|
|
1956
|
+
}
|
|
1957
|
+
);
|
|
1958
|
+
});
|
|
1871
1959
|
ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
|
|
1872
|
-
var ContextMenuRadioItem = React37.forwardRef(({ className, children, ...props }, ref) =>
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
className
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1960
|
+
var ContextMenuRadioItem = React37.forwardRef(({ className, children, ...props }, ref) => {
|
|
1961
|
+
const mode = useUIVariant();
|
|
1962
|
+
return /* @__PURE__ */ jsxs(
|
|
1963
|
+
ContextMenuPrimitive.RadioItem,
|
|
1964
|
+
{
|
|
1965
|
+
ref,
|
|
1966
|
+
className: cn(
|
|
1967
|
+
"relative flex cursor-default select-none items-center py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
1968
|
+
!mode && "rounded-sm",
|
|
1969
|
+
mode === "smooth" && "rounded-lg",
|
|
1970
|
+
mode === "playful" && "rounded-lg",
|
|
1971
|
+
className
|
|
1972
|
+
),
|
|
1973
|
+
...props,
|
|
1974
|
+
children: [
|
|
1975
|
+
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Circle, { className: "h-2 w-2 fill-current" }) }) }),
|
|
1976
|
+
children
|
|
1977
|
+
]
|
|
1978
|
+
}
|
|
1979
|
+
);
|
|
1980
|
+
});
|
|
1887
1981
|
ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
|
|
1888
1982
|
var ContextMenuLabel = React37.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1889
1983
|
ContextMenuPrimitive.Label,
|
|
@@ -1949,27 +2043,30 @@ var DrawerOverlay = React37.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
1949
2043
|
}
|
|
1950
2044
|
));
|
|
1951
2045
|
DrawerOverlay.displayName = Drawer$1.Overlay.displayName;
|
|
1952
|
-
var DrawerContent = React37.forwardRef(({ className, mode, children, ...props }, ref) =>
|
|
1953
|
-
|
|
1954
|
-
/* @__PURE__ */
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
children
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
2046
|
+
var DrawerContent = React37.forwardRef(({ className, mode: modeProp, children, ...props }, ref) => {
|
|
2047
|
+
const mode = modeProp ?? useUIVariant();
|
|
2048
|
+
return /* @__PURE__ */ jsxs(DrawerPortal, { children: [
|
|
2049
|
+
/* @__PURE__ */ jsx(DrawerOverlay, {}),
|
|
2050
|
+
/* @__PURE__ */ jsx(
|
|
2051
|
+
Drawer$1.Content,
|
|
2052
|
+
{
|
|
2053
|
+
ref,
|
|
2054
|
+
className: cn(
|
|
2055
|
+
"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col border bg-background",
|
|
2056
|
+
!mode && "rounded-t-[10px]",
|
|
2057
|
+
mode === "smooth" && "rounded-t-2xl shadow-xl",
|
|
2058
|
+
mode === "playful" && "rounded-t-xl border-2 shadow-lg shadow-primary/10",
|
|
2059
|
+
className
|
|
2060
|
+
),
|
|
2061
|
+
...props,
|
|
2062
|
+
children: /* @__PURE__ */ jsxs(UIVariantProvider, { mode, children: [
|
|
2063
|
+
/* @__PURE__ */ jsx("div", { className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" }),
|
|
2064
|
+
children
|
|
2065
|
+
] })
|
|
2066
|
+
}
|
|
2067
|
+
)
|
|
2068
|
+
] });
|
|
2069
|
+
});
|
|
1973
2070
|
DrawerContent.displayName = "DrawerContent";
|
|
1974
2071
|
var DrawerHeader = ({
|
|
1975
2072
|
className,
|
|
@@ -2645,6 +2742,7 @@ var Input = React37.forwardRef(
|
|
|
2645
2742
|
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm aria-invalid:border-destructive aria-invalid:focus-visible:ring-destructive/20",
|
|
2646
2743
|
mode === "smooth" && "rounded-full",
|
|
2647
2744
|
mode === "playful" && "relative z-10",
|
|
2745
|
+
mode === "glass" && glassControl,
|
|
2648
2746
|
className
|
|
2649
2747
|
),
|
|
2650
2748
|
ref,
|
|
@@ -2707,10 +2805,11 @@ var Textarea = React37.forwardRef(
|
|
|
2707
2805
|
Textarea.displayName = "Textarea";
|
|
2708
2806
|
function InputGroup({
|
|
2709
2807
|
className,
|
|
2710
|
-
mode,
|
|
2808
|
+
mode: modeProp,
|
|
2711
2809
|
disabled,
|
|
2712
2810
|
...props
|
|
2713
2811
|
}) {
|
|
2812
|
+
const mode = modeProp ?? useUIVariant();
|
|
2714
2813
|
return /* @__PURE__ */ jsx(UIVariantProvider, { mode, children: /* @__PURE__ */ jsx(
|
|
2715
2814
|
"div",
|
|
2716
2815
|
{
|
|
@@ -3125,20 +3224,36 @@ function ItemFooter({ className, ...props }) {
|
|
|
3125
3224
|
}
|
|
3126
3225
|
);
|
|
3127
3226
|
}
|
|
3128
|
-
function Kbd({ className, ...props }) {
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
className
|
|
3138
|
-
),
|
|
3139
|
-
...props
|
|
3140
|
-
}
|
|
3227
|
+
function Kbd({ className, mode: modeProp, ...props }) {
|
|
3228
|
+
const mode = modeProp ?? useUIVariant();
|
|
3229
|
+
const baseClasses = cn(
|
|
3230
|
+
"bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 select-none items-center justify-center gap-1 px-1 font-sans text-xs font-medium",
|
|
3231
|
+
"[&_svg:not([class*='size-'])]:size-3",
|
|
3232
|
+
"[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",
|
|
3233
|
+
!mode && "rounded-sm",
|
|
3234
|
+
mode === "smooth" && "rounded-md",
|
|
3235
|
+
mode === "playful" && "rounded-sm"
|
|
3141
3236
|
);
|
|
3237
|
+
if (mode === "playful") {
|
|
3238
|
+
return /* @__PURE__ */ jsxs("span", { className: "group/playful relative inline-flex", children: [
|
|
3239
|
+
/* @__PURE__ */ jsx(
|
|
3240
|
+
"span",
|
|
3241
|
+
{
|
|
3242
|
+
"aria-hidden": "true",
|
|
3243
|
+
className: "absolute inset-0 rounded-sm bg-primary/30 dark:bg-primary/20 transition-transform duration-200 translate-x-[2px] translate-y-[2px] -rotate-[3deg] group-hover/playful:-rotate-[5deg]"
|
|
3244
|
+
}
|
|
3245
|
+
),
|
|
3246
|
+
/* @__PURE__ */ jsx(
|
|
3247
|
+
"kbd",
|
|
3248
|
+
{
|
|
3249
|
+
"data-slot": "kbd",
|
|
3250
|
+
className: cn(baseClasses, "relative rotate-[1.5deg]", className),
|
|
3251
|
+
...props
|
|
3252
|
+
}
|
|
3253
|
+
)
|
|
3254
|
+
] });
|
|
3255
|
+
}
|
|
3256
|
+
return /* @__PURE__ */ jsx("kbd", { "data-slot": "kbd", className: cn(baseClasses, className), ...props });
|
|
3142
3257
|
}
|
|
3143
3258
|
function KbdGroup({ className, ...props }) {
|
|
3144
3259
|
return /* @__PURE__ */ jsx(
|
|
@@ -3700,6 +3815,7 @@ var PopoverContent = React37.forwardRef(({ className, align = "center", sideOffs
|
|
|
3700
3815
|
!mode && "rounded-md shadow-md",
|
|
3701
3816
|
mode === "smooth" && "rounded-2xl shadow-xl",
|
|
3702
3817
|
mode === "playful" && "rounded-xl border-2 shadow-lg shadow-primary/10",
|
|
3818
|
+
mode === "glass" && cn(glassPanel, "rounded-xl"),
|
|
3703
3819
|
className
|
|
3704
3820
|
),
|
|
3705
3821
|
...props,
|
|
@@ -3708,27 +3824,43 @@ var PopoverContent = React37.forwardRef(({ className, align = "center", sideOffs
|
|
|
3708
3824
|
) });
|
|
3709
3825
|
});
|
|
3710
3826
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
3711
|
-
var Progress = React37.forwardRef(({ className, value, disabled = false, ...props }, ref) =>
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
"
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3827
|
+
var Progress = React37.forwardRef(({ className, value, disabled = false, mode: modeProp, ...props }, ref) => {
|
|
3828
|
+
const mode = modeProp ?? useUIVariant();
|
|
3829
|
+
const bar = /* @__PURE__ */ jsx(
|
|
3830
|
+
ProgressPrimitive.Root,
|
|
3831
|
+
{
|
|
3832
|
+
ref,
|
|
3833
|
+
"aria-disabled": disabled || void 0,
|
|
3834
|
+
"data-disabled": disabled ? "" : void 0,
|
|
3835
|
+
className: cn(
|
|
3836
|
+
"relative h-4 w-full overflow-hidden rounded-full bg-secondary",
|
|
3837
|
+
disabled && "opacity-50",
|
|
3838
|
+
className
|
|
3839
|
+
),
|
|
3840
|
+
...props,
|
|
3841
|
+
children: /* @__PURE__ */ jsx(
|
|
3842
|
+
ProgressPrimitive.Indicator,
|
|
3843
|
+
{
|
|
3844
|
+
className: "h-full w-full flex-1 bg-primary transition-all",
|
|
3845
|
+
style: { transform: `translateX(-${100 - (value || 0)}%)` }
|
|
3846
|
+
}
|
|
3847
|
+
)
|
|
3848
|
+
}
|
|
3849
|
+
);
|
|
3850
|
+
if (mode === "playful") {
|
|
3851
|
+
return /* @__PURE__ */ jsxs("div", { className: "group/playful relative", children: [
|
|
3852
|
+
/* @__PURE__ */ jsx(
|
|
3853
|
+
"div",
|
|
3854
|
+
{
|
|
3855
|
+
"aria-hidden": "true",
|
|
3856
|
+
className: "absolute inset-0 rounded-full bg-border transition-transform duration-200 translate-x-[3px] translate-y-[3px] -rotate-[0.5deg] group-hover/playful:-rotate-[1.5deg]"
|
|
3857
|
+
}
|
|
3858
|
+
),
|
|
3859
|
+
/* @__PURE__ */ jsx("div", { className: "relative", children: bar })
|
|
3860
|
+
] });
|
|
3730
3861
|
}
|
|
3731
|
-
|
|
3862
|
+
return bar;
|
|
3863
|
+
});
|
|
3732
3864
|
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
3733
3865
|
var RadioGroup4 = React37.forwardRef(({ className, ...props }, ref) => {
|
|
3734
3866
|
return /* @__PURE__ */ jsx(
|
|
@@ -3741,7 +3873,31 @@ var RadioGroup4 = React37.forwardRef(({ className, ...props }, ref) => {
|
|
|
3741
3873
|
);
|
|
3742
3874
|
});
|
|
3743
3875
|
RadioGroup4.displayName = RadioGroupPrimitive.Root.displayName;
|
|
3744
|
-
var RadioGroupItem = React37.forwardRef(({ className, ...props }, ref) => {
|
|
3876
|
+
var RadioGroupItem = React37.forwardRef(({ className, mode: modeProp, ...props }, ref) => {
|
|
3877
|
+
const mode = modeProp ?? useUIVariant();
|
|
3878
|
+
if (mode === "playful") {
|
|
3879
|
+
return /* @__PURE__ */ jsxs("span", { className: "group/playful relative inline-flex", children: [
|
|
3880
|
+
/* @__PURE__ */ jsx(
|
|
3881
|
+
"span",
|
|
3882
|
+
{
|
|
3883
|
+
"aria-hidden": "true",
|
|
3884
|
+
className: "absolute inset-0 rounded-full bg-primary/30 dark:bg-primary/20 transition-transform duration-200 translate-x-[2px] translate-y-[2px] -rotate-[3deg] group-hover/playful:-rotate-[5deg]"
|
|
3885
|
+
}
|
|
3886
|
+
),
|
|
3887
|
+
/* @__PURE__ */ jsx(
|
|
3888
|
+
RadioGroupPrimitive.Item,
|
|
3889
|
+
{
|
|
3890
|
+
ref,
|
|
3891
|
+
className: cn(
|
|
3892
|
+
"relative aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
3893
|
+
className
|
|
3894
|
+
),
|
|
3895
|
+
...props,
|
|
3896
|
+
children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(Circle, { className: "h-2.5 w-2.5 fill-current text-current" }) })
|
|
3897
|
+
}
|
|
3898
|
+
)
|
|
3899
|
+
] });
|
|
3900
|
+
}
|
|
3745
3901
|
return /* @__PURE__ */ jsx(
|
|
3746
3902
|
RadioGroupPrimitive.Item,
|
|
3747
3903
|
{
|
|
@@ -3987,29 +4143,32 @@ var sideRoundingPlayful = {
|
|
|
3987
4143
|
top: "rounded-b-xl",
|
|
3988
4144
|
bottom: "rounded-t-xl"
|
|
3989
4145
|
};
|
|
3990
|
-
var SheetContent = React37.forwardRef(({ side = "right", className, children, container, mode, ...props }, ref) =>
|
|
3991
|
-
|
|
3992
|
-
/* @__PURE__ */
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
/* @__PURE__ */ jsxs(
|
|
4006
|
-
|
|
4007
|
-
/* @__PURE__ */
|
|
4146
|
+
var SheetContent = React37.forwardRef(({ side = "right", className, children, container, mode: modeProp, ...props }, ref) => {
|
|
4147
|
+
const mode = modeProp ?? useUIVariant();
|
|
4148
|
+
return /* @__PURE__ */ jsxs(SheetPortal, { container: container ?? void 0, children: [
|
|
4149
|
+
/* @__PURE__ */ jsx(SheetOverlay, {}),
|
|
4150
|
+
/* @__PURE__ */ jsx(
|
|
4151
|
+
DialogPrimitive.Content,
|
|
4152
|
+
{
|
|
4153
|
+
ref,
|
|
4154
|
+
className: cn(
|
|
4155
|
+
sheetVariants({ side }),
|
|
4156
|
+
mode === "smooth" && `${sideRoundingSmooth[side ?? "right"]} shadow-xl`,
|
|
4157
|
+
mode === "playful" && `${sideRoundingPlayful[side ?? "right"]} border-2 shadow-lg shadow-primary/10`,
|
|
4158
|
+
className
|
|
4159
|
+
),
|
|
4160
|
+
...props,
|
|
4161
|
+
children: /* @__PURE__ */ jsxs(UIVariantProvider, { mode, children: [
|
|
4162
|
+
children,
|
|
4163
|
+
/* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
|
|
4164
|
+
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
4165
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
4166
|
+
] })
|
|
4008
4167
|
] })
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
)
|
|
4012
|
-
|
|
4168
|
+
}
|
|
4169
|
+
)
|
|
4170
|
+
] });
|
|
4171
|
+
});
|
|
4013
4172
|
SheetContent.displayName = DialogPrimitive.Content.displayName;
|
|
4014
4173
|
var SheetHeader = ({
|
|
4015
4174
|
className,
|
|
@@ -4086,21 +4245,25 @@ function Skeleton({
|
|
|
4086
4245
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
4087
4246
|
var Tooltip2 = TooltipPrimitive.Root;
|
|
4088
4247
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
4089
|
-
var TooltipContent = React37.forwardRef(({ className, sideOffset = 4, mode, children, ...props }, ref) =>
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4248
|
+
var TooltipContent = React37.forwardRef(({ className, sideOffset = 4, mode: modeProp, children, ...props }, ref) => {
|
|
4249
|
+
const mode = modeProp ?? useUIVariant();
|
|
4250
|
+
return /* @__PURE__ */ jsx(
|
|
4251
|
+
TooltipPrimitive.Content,
|
|
4252
|
+
{
|
|
4253
|
+
ref,
|
|
4254
|
+
sideOffset,
|
|
4255
|
+
className: cn(
|
|
4256
|
+
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",
|
|
4257
|
+
mode === "smooth" && "rounded-xl shadow-xl",
|
|
4258
|
+
mode === "playful" && "rounded-lg border-2 shadow-md shadow-primary/10",
|
|
4259
|
+
mode === "glass" && cn(glassPanel, "rounded-lg"),
|
|
4260
|
+
className
|
|
4261
|
+
),
|
|
4262
|
+
...props,
|
|
4263
|
+
children: /* @__PURE__ */ jsx(UIVariantProvider, { mode, children })
|
|
4264
|
+
}
|
|
4265
|
+
);
|
|
4266
|
+
});
|
|
4104
4267
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
4105
4268
|
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
4106
4269
|
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
@@ -4826,8 +4989,9 @@ var Slider = React37.forwardRef(({ className, size = "default", ...props }, ref)
|
|
|
4826
4989
|
}
|
|
4827
4990
|
));
|
|
4828
4991
|
Slider.displayName = SliderPrimitive.Root.displayName;
|
|
4829
|
-
var Toaster = ({ mode, className, style, ...props }) => {
|
|
4992
|
+
var Toaster = ({ mode: modeProp, className, style, ...props }) => {
|
|
4830
4993
|
const { theme = "system" } = useTheme();
|
|
4994
|
+
const mode = modeProp ?? useUIVariant();
|
|
4831
4995
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4832
4996
|
mode === "smooth" && /* @__PURE__ */ jsx("style", { children: `[data-sonner-toaster].toaster-smooth { --border-radius: 1.5rem; }` }),
|
|
4833
4997
|
mode === "playful" && /* @__PURE__ */ jsx("style", { children: `
|
|
@@ -4954,8 +5118,41 @@ var switchSizes = {
|
|
|
4954
5118
|
thumb: "size-6 data-[state=checked]:translate-x-7"
|
|
4955
5119
|
}
|
|
4956
5120
|
};
|
|
4957
|
-
var Switch = React37.forwardRef(({ className, size = "default", ...props }, ref) => {
|
|
5121
|
+
var Switch = React37.forwardRef(({ className, size = "default", mode: modeProp, ...props }, ref) => {
|
|
5122
|
+
const mode = modeProp ?? useUIVariant();
|
|
4958
5123
|
const sizes = switchSizes[size];
|
|
5124
|
+
if (mode === "playful") {
|
|
5125
|
+
return /* @__PURE__ */ jsxs("span", { className: "group/playful relative inline-flex", children: [
|
|
5126
|
+
/* @__PURE__ */ jsx(
|
|
5127
|
+
"span",
|
|
5128
|
+
{
|
|
5129
|
+
"aria-hidden": "true",
|
|
5130
|
+
className: "absolute inset-0 rounded-full bg-primary/30 dark:bg-primary/20 transition-transform duration-200 translate-x-[2px] translate-y-[2px] -rotate-[3deg] group-hover/playful:-rotate-[5deg]"
|
|
5131
|
+
}
|
|
5132
|
+
),
|
|
5133
|
+
/* @__PURE__ */ jsx(
|
|
5134
|
+
SwitchPrimitives.Root,
|
|
5135
|
+
{
|
|
5136
|
+
className: cn(
|
|
5137
|
+
"relative peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input rotate-[1.5deg]",
|
|
5138
|
+
sizes.root,
|
|
5139
|
+
className
|
|
5140
|
+
),
|
|
5141
|
+
...props,
|
|
5142
|
+
ref,
|
|
5143
|
+
children: /* @__PURE__ */ jsx(
|
|
5144
|
+
SwitchPrimitives.Thumb,
|
|
5145
|
+
{
|
|
5146
|
+
className: cn(
|
|
5147
|
+
"pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=unchecked]:translate-x-0",
|
|
5148
|
+
sizes.thumb
|
|
5149
|
+
)
|
|
5150
|
+
}
|
|
5151
|
+
)
|
|
5152
|
+
}
|
|
5153
|
+
)
|
|
5154
|
+
] });
|
|
5155
|
+
}
|
|
4959
5156
|
return /* @__PURE__ */ jsx(
|
|
4960
5157
|
SwitchPrimitives.Root,
|
|
4961
5158
|
{
|
|
@@ -6818,12 +7015,13 @@ function AsciiText({
|
|
|
6818
7015
|
}
|
|
6819
7016
|
) });
|
|
6820
7017
|
}
|
|
7018
|
+
var SHINE_SPEED = 1.0125;
|
|
6821
7019
|
function getShineAlpha(col, row, time, bounds) {
|
|
6822
7020
|
const span = bounds.max - bounds.min + 1;
|
|
6823
7021
|
const travel = span + 6;
|
|
6824
7022
|
const diagonalCol = col + row * 0.62;
|
|
6825
|
-
const primarySweep = bounds.max + 3 - time *
|
|
6826
|
-
const secondarySweep = bounds.max + 3 - (time *
|
|
7023
|
+
const primarySweep = bounds.max + 3 - time * SHINE_SPEED % 1 * travel;
|
|
7024
|
+
const secondarySweep = bounds.max + 3 - (time * SHINE_SPEED + 0.5) % 1 * travel;
|
|
6827
7025
|
const primary = getShineBandAlpha(diagonalCol, primarySweep);
|
|
6828
7026
|
const secondary = getShineBandAlpha(diagonalCol, secondarySweep);
|
|
6829
7027
|
return Math.min(0.86, primary + secondary * 0.82);
|