@olwiba/cn 0.1.26 → 0.1.28

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.js CHANGED
@@ -35,7 +35,6 @@ import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
35
35
  import * as SelectPrimitive from '@radix-ui/react-select';
36
36
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
37
37
  import * as SliderPrimitive from '@radix-ui/react-slider';
38
- import { useTheme } from 'next-themes';
39
38
  import { Toaster as Toaster$1 } from 'sonner';
40
39
  import * as SwitchPrimitives from '@radix-ui/react-switch';
41
40
  import * as TabsPrimitive from '@radix-ui/react-tabs';
@@ -142,23 +141,26 @@ var alertVariants = cva(
142
141
  }
143
142
  }
144
143
  );
145
- var Alert = React37.forwardRef(({ className, variant, mode, size, disabled, ...props }, ref) => /* @__PURE__ */ jsx(
146
- "div",
147
- {
148
- ref,
149
- role: "alert",
150
- className: cn(
151
- alertVariants({ variant }),
152
- size === "sm" && "p-3 text-xs [&>svg]:top-3 [&>svg]:left-3",
153
- size === "lg" && "p-6 text-base [&>svg]:top-6 [&>svg]:left-6",
154
- mode === "smooth" && "rounded-2xl",
155
- mode === "playful" && "border-l-4",
156
- disabled && "opacity-50 pointer-events-none",
157
- className
158
- ),
159
- ...props
160
- }
161
- ));
144
+ var Alert = React37.forwardRef(({ className, variant, mode: modeProp, size, disabled, ...props }, ref) => {
145
+ const mode = modeProp ?? useUIVariant();
146
+ return /* @__PURE__ */ jsx(
147
+ "div",
148
+ {
149
+ ref,
150
+ role: "alert",
151
+ className: cn(
152
+ alertVariants({ variant }),
153
+ size === "sm" && "p-3 text-xs [&>svg]:top-3 [&>svg]:left-3",
154
+ size === "lg" && "p-6 text-base [&>svg]:top-6 [&>svg]:left-6",
155
+ mode === "smooth" && "rounded-2xl",
156
+ mode === "playful" && "border-l-4",
157
+ disabled && "opacity-50 pointer-events-none",
158
+ className
159
+ ),
160
+ ...props
161
+ }
162
+ );
163
+ });
162
164
  Alert.displayName = "Alert";
163
165
  var AlertTitle = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
164
166
  "h5",
@@ -178,6 +180,12 @@ var AlertDescription = React37.forwardRef(({ className, ...props }, ref) => /* @
178
180
  }
179
181
  ));
180
182
  AlertDescription.displayName = "AlertDescription";
183
+
184
+ // src/components/ui/glass.ts
185
+ var glassBlur = "backdrop-blur-xl backdrop-saturate-150";
186
+ 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";
187
+ 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";
188
+ 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
189
  var buttonVariants = cva(
182
190
  "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
191
  {
@@ -203,6 +211,12 @@ var buttonVariants = cva(
203
211
  }
204
212
  }
205
213
  );
214
+ var glassButtonBg = {
215
+ default: "bg-primary/75 hover:bg-primary/60",
216
+ destructive: "bg-destructive/75 hover:bg-destructive/60",
217
+ outline: "bg-background/40 hover:bg-background/60",
218
+ secondary: "bg-secondary/50 hover:bg-secondary/40"
219
+ };
206
220
  var Button = React37.forwardRef(
207
221
  ({ className, variant, size, asChild = false, mode: modeProp, ...props }, ref) => {
208
222
  const mode = modeProp ?? useUIVariant();
@@ -236,12 +250,18 @@ var Button = React37.forwardRef(
236
250
  )
237
251
  ] });
238
252
  }
253
+ const isGlass = mode === "glass" && variant !== "ghost" && variant !== "link";
239
254
  return /* @__PURE__ */ jsx(
240
255
  Comp,
241
256
  {
242
257
  className: cn(
243
258
  buttonVariants({ variant, size, className }),
244
- mode === "smooth" && "rounded-full shadow-none"
259
+ mode === "smooth" && "rounded-full shadow-none",
260
+ isGlass && cn(
261
+ glassBlur,
262
+ "border border-white/25 shadow-sm shadow-black/10 dark:border-white/15",
263
+ glassButtonBg[variant ?? "default"]
264
+ )
245
265
  ),
246
266
  ref,
247
267
  ...props
@@ -265,24 +285,27 @@ var AlertDialogOverlay = React37.forwardRef(({ className, ...props }, ref) => /*
265
285
  }
266
286
  ));
267
287
  AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
268
- var AlertDialogContent = React37.forwardRef(({ className, mode, children, ...props }, ref) => /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
269
- /* @__PURE__ */ jsx(AlertDialogOverlay, {}),
270
- /* @__PURE__ */ jsx(
271
- AlertDialogPrimitive.Content,
272
- {
273
- ref,
274
- className: cn(
275
- "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%]",
276
- !mode && "shadow-lg sm:rounded-lg",
277
- mode === "smooth" && "rounded-2xl shadow-xl",
278
- mode === "playful" && "rounded-xl border-2 shadow-lg shadow-primary/10",
279
- className
280
- ),
281
- ...props,
282
- children: /* @__PURE__ */ jsx(UIVariantProvider, { mode, children })
283
- }
284
- )
285
- ] }));
288
+ var AlertDialogContent = React37.forwardRef(({ className, mode: modeProp, children, ...props }, ref) => {
289
+ const mode = modeProp ?? useUIVariant();
290
+ return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
291
+ /* @__PURE__ */ jsx(AlertDialogOverlay, {}),
292
+ /* @__PURE__ */ jsx(
293
+ AlertDialogPrimitive.Content,
294
+ {
295
+ ref,
296
+ className: cn(
297
+ "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%]",
298
+ !mode && "shadow-lg sm:rounded-lg",
299
+ mode === "smooth" && "rounded-2xl shadow-xl",
300
+ mode === "playful" && "rounded-xl border-2 shadow-lg shadow-primary/10",
301
+ className
302
+ ),
303
+ ...props,
304
+ children: /* @__PURE__ */ jsx(UIVariantProvider, { mode, children })
305
+ }
306
+ )
307
+ ] });
308
+ });
286
309
  AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
287
310
  var AlertDialogHeader = ({
288
311
  className,
@@ -940,6 +963,7 @@ var Card = React37.forwardRef(
940
963
  className: cn(
941
964
  "rounded-lg border bg-card text-card-foreground shadow-sm",
942
965
  mode === "smooth" && "rounded-3xl",
966
+ mode === "glass" && cn(glassSurface, "rounded-xl"),
943
967
  className
944
968
  ),
945
969
  ...props
@@ -1527,30 +1551,34 @@ var DialogOverlay = React37.forwardRef(({ className, ...props }, ref) => /* @__P
1527
1551
  }
1528
1552
  ));
1529
1553
  DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
1530
- var DialogContent = React37.forwardRef(({ className, mode, children, ...props }, ref) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
1531
- /* @__PURE__ */ jsx(DialogOverlay, {}),
1532
- /* @__PURE__ */ jsx(
1533
- DialogPrimitive.Content,
1534
- {
1535
- ref,
1536
- className: cn(
1537
- "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",
1538
- !mode && "shadow-lg sm:rounded-lg",
1539
- mode === "smooth" && "rounded-2xl shadow-xl",
1540
- mode === "playful" && "rounded-xl border-2 shadow-lg shadow-primary/10",
1541
- className
1542
- ),
1543
- ...props,
1544
- children: /* @__PURE__ */ jsxs(UIVariantProvider, { mode, children: [
1545
- children,
1546
- /* @__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: [
1547
- /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
1548
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
1554
+ var DialogContent = React37.forwardRef(({ className, mode: modeProp, children, ...props }, ref) => {
1555
+ const mode = modeProp ?? useUIVariant();
1556
+ return /* @__PURE__ */ jsxs(DialogPortal, { children: [
1557
+ /* @__PURE__ */ jsx(DialogOverlay, { className: mode === "glass" ? "bg-black/40" : void 0 }),
1558
+ /* @__PURE__ */ jsx(
1559
+ DialogPrimitive.Content,
1560
+ {
1561
+ ref,
1562
+ className: cn(
1563
+ "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",
1564
+ !mode && "shadow-lg sm:rounded-lg",
1565
+ mode === "smooth" && "rounded-2xl shadow-xl",
1566
+ mode === "playful" && "rounded-xl border-2 shadow-lg shadow-primary/10",
1567
+ mode === "glass" && cn(glassSurface, "rounded-2xl"),
1568
+ className
1569
+ ),
1570
+ ...props,
1571
+ children: /* @__PURE__ */ jsxs(UIVariantProvider, { mode, children: [
1572
+ children,
1573
+ /* @__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: [
1574
+ /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
1575
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
1576
+ ] })
1549
1577
  ] })
1550
- ] })
1551
- }
1552
- )
1553
- ] }));
1578
+ }
1579
+ )
1580
+ ] });
1581
+ });
1554
1582
  DialogContent.displayName = DialogPrimitive.Content.displayName;
1555
1583
  var DialogHeader = ({
1556
1584
  className,
@@ -1644,20 +1672,45 @@ function useIsMac() {
1644
1672
  return isMac;
1645
1673
  }
1646
1674
  var Hotkey = React37.forwardRef(
1647
- ({ shortcut, asKbd = false, className, ...props }, ref) => {
1675
+ ({ shortcut, asKbd = false, mode: modeProp, className, ...props }, ref) => {
1648
1676
  const isMac = useIsMac();
1649
1677
  const content = formatShortcut(shortcut, isMac);
1678
+ const mode = modeProp ?? useUIVariant();
1650
1679
  if (asKbd) {
1680
+ const kbdClasses = cn(
1681
+ "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",
1682
+ "[&_svg:not([class*='size-'])]:size-3",
1683
+ !mode && "rounded-sm",
1684
+ mode === "smooth" && "rounded-md",
1685
+ mode === "playful" && "rounded-sm"
1686
+ );
1687
+ if (mode === "playful") {
1688
+ return /* @__PURE__ */ jsxs("span", { className: "group/playful relative inline-flex", children: [
1689
+ /* @__PURE__ */ jsx(
1690
+ "span",
1691
+ {
1692
+ "aria-hidden": "true",
1693
+ 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]"
1694
+ }
1695
+ ),
1696
+ /* @__PURE__ */ jsx(
1697
+ "kbd",
1698
+ {
1699
+ ref,
1700
+ "data-slot": "hotkey",
1701
+ className: cn(kbdClasses, "relative rotate-[1.5deg]", className),
1702
+ ...props,
1703
+ children: content
1704
+ }
1705
+ )
1706
+ ] });
1707
+ }
1651
1708
  return /* @__PURE__ */ jsx(
1652
1709
  "kbd",
1653
1710
  {
1654
1711
  ref,
1655
1712
  "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
- ),
1713
+ className: cn(kbdClasses, className),
1661
1714
  ...props,
1662
1715
  children: content
1663
1716
  }
@@ -1798,92 +1851,132 @@ var ContextMenuGroup = ContextMenuPrimitive.Group;
1798
1851
  var ContextMenuPortal = ContextMenuPrimitive.Portal;
1799
1852
  var ContextMenuSub = ContextMenuPrimitive.Sub;
1800
1853
  var ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
1801
- var ContextMenuSubTrigger = React37.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
1802
- ContextMenuPrimitive.SubTrigger,
1803
- {
1804
- ref,
1805
- className: cn(
1806
- "flex cursor-default select-none items-center rounded-sm 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",
1807
- inset && "pl-8",
1808
- className
1809
- ),
1810
- ...props,
1811
- children: [
1812
- children,
1813
- /* @__PURE__ */ jsx(ChevronRight, { className: "ml-auto h-4 w-4" })
1814
- ]
1815
- }
1816
- ));
1854
+ var ContextMenuSubTrigger = React37.forwardRef(({ className, inset, children, ...props }, ref) => {
1855
+ const mode = useUIVariant();
1856
+ return /* @__PURE__ */ jsxs(
1857
+ ContextMenuPrimitive.SubTrigger,
1858
+ {
1859
+ ref,
1860
+ className: cn(
1861
+ "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",
1862
+ !mode && "rounded-sm",
1863
+ mode === "smooth" && "rounded-lg",
1864
+ mode === "playful" && "rounded-lg",
1865
+ inset && "pl-8",
1866
+ className
1867
+ ),
1868
+ ...props,
1869
+ children: [
1870
+ children,
1871
+ /* @__PURE__ */ jsx(ChevronRight, { className: "ml-auto h-4 w-4" })
1872
+ ]
1873
+ }
1874
+ );
1875
+ });
1817
1876
  ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
1818
- var ContextMenuSubContent = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1819
- ContextMenuPrimitive.SubContent,
1820
- {
1821
- ref,
1822
- className: cn(
1823
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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]",
1824
- className
1825
- ),
1826
- ...props
1827
- }
1828
- ));
1877
+ var ContextMenuSubContent = React37.forwardRef(({ className, mode: modeProp, children, ...props }, ref) => {
1878
+ const inheritedMode = useUIVariant();
1879
+ const mode = modeProp ?? inheritedMode;
1880
+ return /* @__PURE__ */ jsx(
1881
+ ContextMenuPrimitive.SubContent,
1882
+ {
1883
+ ref,
1884
+ className: cn(
1885
+ "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]",
1886
+ !mode && "rounded-md shadow-md",
1887
+ mode === "smooth" && "rounded-2xl shadow-xl",
1888
+ mode === "playful" && "rounded-xl border-2 shadow-lg shadow-primary/10",
1889
+ className
1890
+ ),
1891
+ ...props,
1892
+ children: /* @__PURE__ */ jsx(UIVariantProvider, { mode, children })
1893
+ }
1894
+ );
1895
+ });
1829
1896
  ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
1830
- var ContextMenuContent = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
1831
- ContextMenuPrimitive.Content,
1832
- {
1833
- ref,
1834
- className: cn(
1835
- "z-50 max-h-[--radix-context-menu-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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]",
1836
- className
1837
- ),
1838
- ...props
1839
- }
1840
- ) }));
1897
+ var ContextMenuContent = React37.forwardRef(({ className, mode: modeProp, children, ...props }, ref) => {
1898
+ const inheritedMode = useUIVariant();
1899
+ const mode = modeProp ?? inheritedMode;
1900
+ return /* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
1901
+ ContextMenuPrimitive.Content,
1902
+ {
1903
+ ref,
1904
+ className: cn(
1905
+ "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]",
1906
+ !mode && "rounded-md shadow-md",
1907
+ mode === "smooth" && "rounded-2xl shadow-xl",
1908
+ mode === "playful" && "rounded-xl border-2 shadow-lg shadow-primary/10",
1909
+ className
1910
+ ),
1911
+ ...props,
1912
+ children: /* @__PURE__ */ jsx(UIVariantProvider, { mode, children })
1913
+ }
1914
+ ) });
1915
+ });
1841
1916
  ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
1842
- var ContextMenuItem = React37.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
1843
- ContextMenuPrimitive.Item,
1844
- {
1845
- ref,
1846
- className: cn(
1847
- "relative flex cursor-default select-none items-center rounded-sm 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",
1848
- inset && "pl-8",
1849
- className
1850
- ),
1851
- ...props
1852
- }
1853
- ));
1917
+ var ContextMenuItem = React37.forwardRef(({ className, inset, ...props }, ref) => {
1918
+ const mode = useUIVariant();
1919
+ return /* @__PURE__ */ jsx(
1920
+ ContextMenuPrimitive.Item,
1921
+ {
1922
+ ref,
1923
+ className: cn(
1924
+ "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",
1925
+ !mode && "rounded-sm",
1926
+ mode === "smooth" && "rounded-lg",
1927
+ mode === "playful" && "rounded-lg",
1928
+ inset && "pl-8",
1929
+ className
1930
+ ),
1931
+ ...props
1932
+ }
1933
+ );
1934
+ });
1854
1935
  ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
1855
- var ContextMenuCheckboxItem = React37.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
1856
- ContextMenuPrimitive.CheckboxItem,
1857
- {
1858
- ref,
1859
- className: cn(
1860
- "relative flex cursor-default select-none items-center rounded-sm 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",
1861
- className
1862
- ),
1863
- checked,
1864
- ...props,
1865
- children: [
1866
- /* @__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" }) }) }),
1867
- children
1868
- ]
1869
- }
1870
- ));
1936
+ var ContextMenuCheckboxItem = React37.forwardRef(({ className, children, checked, ...props }, ref) => {
1937
+ const mode = useUIVariant();
1938
+ return /* @__PURE__ */ jsxs(
1939
+ ContextMenuPrimitive.CheckboxItem,
1940
+ {
1941
+ ref,
1942
+ className: cn(
1943
+ "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",
1944
+ !mode && "rounded-sm",
1945
+ mode === "smooth" && "rounded-lg",
1946
+ mode === "playful" && "rounded-lg",
1947
+ className
1948
+ ),
1949
+ checked,
1950
+ ...props,
1951
+ children: [
1952
+ /* @__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" }) }) }),
1953
+ children
1954
+ ]
1955
+ }
1956
+ );
1957
+ });
1871
1958
  ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
1872
- var ContextMenuRadioItem = React37.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
1873
- ContextMenuPrimitive.RadioItem,
1874
- {
1875
- ref,
1876
- className: cn(
1877
- "relative flex cursor-default select-none items-center rounded-sm 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",
1878
- className
1879
- ),
1880
- ...props,
1881
- children: [
1882
- /* @__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" }) }) }),
1883
- children
1884
- ]
1885
- }
1886
- ));
1959
+ var ContextMenuRadioItem = React37.forwardRef(({ className, children, ...props }, ref) => {
1960
+ const mode = useUIVariant();
1961
+ return /* @__PURE__ */ jsxs(
1962
+ ContextMenuPrimitive.RadioItem,
1963
+ {
1964
+ ref,
1965
+ className: cn(
1966
+ "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",
1967
+ !mode && "rounded-sm",
1968
+ mode === "smooth" && "rounded-lg",
1969
+ mode === "playful" && "rounded-lg",
1970
+ className
1971
+ ),
1972
+ ...props,
1973
+ children: [
1974
+ /* @__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" }) }) }),
1975
+ children
1976
+ ]
1977
+ }
1978
+ );
1979
+ });
1887
1980
  ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
1888
1981
  var ContextMenuLabel = React37.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
1889
1982
  ContextMenuPrimitive.Label,
@@ -1949,27 +2042,30 @@ var DrawerOverlay = React37.forwardRef(({ className, ...props }, ref) => /* @__P
1949
2042
  }
1950
2043
  ));
1951
2044
  DrawerOverlay.displayName = Drawer$1.Overlay.displayName;
1952
- var DrawerContent = React37.forwardRef(({ className, mode, children, ...props }, ref) => /* @__PURE__ */ jsxs(DrawerPortal, { children: [
1953
- /* @__PURE__ */ jsx(DrawerOverlay, {}),
1954
- /* @__PURE__ */ jsx(
1955
- Drawer$1.Content,
1956
- {
1957
- ref,
1958
- className: cn(
1959
- "fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col border bg-background",
1960
- !mode && "rounded-t-[10px]",
1961
- mode === "smooth" && "rounded-t-2xl shadow-xl",
1962
- mode === "playful" && "rounded-t-xl border-2 shadow-lg shadow-primary/10",
1963
- className
1964
- ),
1965
- ...props,
1966
- children: /* @__PURE__ */ jsxs(UIVariantProvider, { mode, children: [
1967
- /* @__PURE__ */ jsx("div", { className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" }),
1968
- children
1969
- ] })
1970
- }
1971
- )
1972
- ] }));
2045
+ var DrawerContent = React37.forwardRef(({ className, mode: modeProp, children, ...props }, ref) => {
2046
+ const mode = modeProp ?? useUIVariant();
2047
+ return /* @__PURE__ */ jsxs(DrawerPortal, { children: [
2048
+ /* @__PURE__ */ jsx(DrawerOverlay, {}),
2049
+ /* @__PURE__ */ jsx(
2050
+ Drawer$1.Content,
2051
+ {
2052
+ ref,
2053
+ className: cn(
2054
+ "fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col border bg-background",
2055
+ !mode && "rounded-t-[10px]",
2056
+ mode === "smooth" && "rounded-t-2xl shadow-xl",
2057
+ mode === "playful" && "rounded-t-xl border-2 shadow-lg shadow-primary/10",
2058
+ className
2059
+ ),
2060
+ ...props,
2061
+ children: /* @__PURE__ */ jsxs(UIVariantProvider, { mode, children: [
2062
+ /* @__PURE__ */ jsx("div", { className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" }),
2063
+ children
2064
+ ] })
2065
+ }
2066
+ )
2067
+ ] });
2068
+ });
1973
2069
  DrawerContent.displayName = "DrawerContent";
1974
2070
  var DrawerHeader = ({
1975
2071
  className,
@@ -2645,6 +2741,7 @@ var Input = React37.forwardRef(
2645
2741
  "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
2742
  mode === "smooth" && "rounded-full",
2647
2743
  mode === "playful" && "relative z-10",
2744
+ mode === "glass" && glassControl,
2648
2745
  className
2649
2746
  ),
2650
2747
  ref,
@@ -2707,10 +2804,11 @@ var Textarea = React37.forwardRef(
2707
2804
  Textarea.displayName = "Textarea";
2708
2805
  function InputGroup({
2709
2806
  className,
2710
- mode,
2807
+ mode: modeProp,
2711
2808
  disabled,
2712
2809
  ...props
2713
2810
  }) {
2811
+ const mode = modeProp ?? useUIVariant();
2714
2812
  return /* @__PURE__ */ jsx(UIVariantProvider, { mode, children: /* @__PURE__ */ jsx(
2715
2813
  "div",
2716
2814
  {
@@ -3125,20 +3223,36 @@ function ItemFooter({ className, ...props }) {
3125
3223
  }
3126
3224
  );
3127
3225
  }
3128
- function Kbd({ className, ...props }) {
3129
- return /* @__PURE__ */ jsx(
3130
- "kbd",
3131
- {
3132
- "data-slot": "kbd",
3133
- className: cn(
3134
- "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",
3135
- "[&_svg:not([class*='size-'])]:size-3",
3136
- "[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",
3137
- className
3138
- ),
3139
- ...props
3140
- }
3226
+ function Kbd({ className, mode: modeProp, ...props }) {
3227
+ const mode = modeProp ?? useUIVariant();
3228
+ const baseClasses = cn(
3229
+ "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",
3230
+ "[&_svg:not([class*='size-'])]:size-3",
3231
+ "[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",
3232
+ !mode && "rounded-sm",
3233
+ mode === "smooth" && "rounded-md",
3234
+ mode === "playful" && "rounded-sm"
3141
3235
  );
3236
+ if (mode === "playful") {
3237
+ return /* @__PURE__ */ jsxs("span", { className: "group/playful relative inline-flex", children: [
3238
+ /* @__PURE__ */ jsx(
3239
+ "span",
3240
+ {
3241
+ "aria-hidden": "true",
3242
+ 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]"
3243
+ }
3244
+ ),
3245
+ /* @__PURE__ */ jsx(
3246
+ "kbd",
3247
+ {
3248
+ "data-slot": "kbd",
3249
+ className: cn(baseClasses, "relative rotate-[1.5deg]", className),
3250
+ ...props
3251
+ }
3252
+ )
3253
+ ] });
3254
+ }
3255
+ return /* @__PURE__ */ jsx("kbd", { "data-slot": "kbd", className: cn(baseClasses, className), ...props });
3142
3256
  }
3143
3257
  function KbdGroup({ className, ...props }) {
3144
3258
  return /* @__PURE__ */ jsx(
@@ -3700,6 +3814,7 @@ var PopoverContent = React37.forwardRef(({ className, align = "center", sideOffs
3700
3814
  !mode && "rounded-md shadow-md",
3701
3815
  mode === "smooth" && "rounded-2xl shadow-xl",
3702
3816
  mode === "playful" && "rounded-xl border-2 shadow-lg shadow-primary/10",
3817
+ mode === "glass" && cn(glassPanel, "rounded-xl"),
3703
3818
  className
3704
3819
  ),
3705
3820
  ...props,
@@ -3708,27 +3823,43 @@ var PopoverContent = React37.forwardRef(({ className, align = "center", sideOffs
3708
3823
  ) });
3709
3824
  });
3710
3825
  PopoverContent.displayName = PopoverPrimitive.Content.displayName;
3711
- var Progress = React37.forwardRef(({ className, value, disabled = false, ...props }, ref) => /* @__PURE__ */ jsx(
3712
- ProgressPrimitive.Root,
3713
- {
3714
- ref,
3715
- "aria-disabled": disabled || void 0,
3716
- "data-disabled": disabled ? "" : void 0,
3717
- className: cn(
3718
- "relative h-4 w-full overflow-hidden rounded-full bg-secondary",
3719
- disabled && "opacity-50",
3720
- className
3721
- ),
3722
- ...props,
3723
- children: /* @__PURE__ */ jsx(
3724
- ProgressPrimitive.Indicator,
3725
- {
3726
- className: "h-full w-full flex-1 bg-primary transition-all",
3727
- style: { transform: `translateX(-${100 - (value || 0)}%)` }
3728
- }
3729
- )
3826
+ var Progress = React37.forwardRef(({ className, value, disabled = false, mode: modeProp, ...props }, ref) => {
3827
+ const mode = modeProp ?? useUIVariant();
3828
+ const bar = /* @__PURE__ */ jsx(
3829
+ ProgressPrimitive.Root,
3830
+ {
3831
+ ref,
3832
+ "aria-disabled": disabled || void 0,
3833
+ "data-disabled": disabled ? "" : void 0,
3834
+ className: cn(
3835
+ "relative h-4 w-full overflow-hidden rounded-full bg-secondary",
3836
+ disabled && "opacity-50",
3837
+ className
3838
+ ),
3839
+ ...props,
3840
+ children: /* @__PURE__ */ jsx(
3841
+ ProgressPrimitive.Indicator,
3842
+ {
3843
+ className: "h-full w-full flex-1 bg-primary transition-all",
3844
+ style: { transform: `translateX(-${100 - (value || 0)}%)` }
3845
+ }
3846
+ )
3847
+ }
3848
+ );
3849
+ if (mode === "playful") {
3850
+ return /* @__PURE__ */ jsxs("div", { className: "group/playful relative", children: [
3851
+ /* @__PURE__ */ jsx(
3852
+ "div",
3853
+ {
3854
+ "aria-hidden": "true",
3855
+ 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]"
3856
+ }
3857
+ ),
3858
+ /* @__PURE__ */ jsx("div", { className: "relative", children: bar })
3859
+ ] });
3730
3860
  }
3731
- ));
3861
+ return bar;
3862
+ });
3732
3863
  Progress.displayName = ProgressPrimitive.Root.displayName;
3733
3864
  var RadioGroup4 = React37.forwardRef(({ className, ...props }, ref) => {
3734
3865
  return /* @__PURE__ */ jsx(
@@ -3741,7 +3872,31 @@ var RadioGroup4 = React37.forwardRef(({ className, ...props }, ref) => {
3741
3872
  );
3742
3873
  });
3743
3874
  RadioGroup4.displayName = RadioGroupPrimitive.Root.displayName;
3744
- var RadioGroupItem = React37.forwardRef(({ className, ...props }, ref) => {
3875
+ var RadioGroupItem = React37.forwardRef(({ className, mode: modeProp, ...props }, ref) => {
3876
+ const mode = modeProp ?? useUIVariant();
3877
+ if (mode === "playful") {
3878
+ return /* @__PURE__ */ jsxs("span", { className: "group/playful relative inline-flex", children: [
3879
+ /* @__PURE__ */ jsx(
3880
+ "span",
3881
+ {
3882
+ "aria-hidden": "true",
3883
+ 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]"
3884
+ }
3885
+ ),
3886
+ /* @__PURE__ */ jsx(
3887
+ RadioGroupPrimitive.Item,
3888
+ {
3889
+ ref,
3890
+ className: cn(
3891
+ "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",
3892
+ className
3893
+ ),
3894
+ ...props,
3895
+ 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" }) })
3896
+ }
3897
+ )
3898
+ ] });
3899
+ }
3745
3900
  return /* @__PURE__ */ jsx(
3746
3901
  RadioGroupPrimitive.Item,
3747
3902
  {
@@ -3987,29 +4142,32 @@ var sideRoundingPlayful = {
3987
4142
  top: "rounded-b-xl",
3988
4143
  bottom: "rounded-t-xl"
3989
4144
  };
3990
- var SheetContent = React37.forwardRef(({ side = "right", className, children, container, mode, ...props }, ref) => /* @__PURE__ */ jsxs(SheetPortal, { container: container ?? void 0, children: [
3991
- /* @__PURE__ */ jsx(SheetOverlay, {}),
3992
- /* @__PURE__ */ jsx(
3993
- DialogPrimitive.Content,
3994
- {
3995
- ref,
3996
- className: cn(
3997
- sheetVariants({ side }),
3998
- mode === "smooth" && `${sideRoundingSmooth[side ?? "right"]} shadow-xl`,
3999
- mode === "playful" && `${sideRoundingPlayful[side ?? "right"]} border-2 shadow-lg shadow-primary/10`,
4000
- className
4001
- ),
4002
- ...props,
4003
- children: /* @__PURE__ */ jsxs(UIVariantProvider, { mode, children: [
4004
- children,
4005
- /* @__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: [
4006
- /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
4007
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
4145
+ var SheetContent = React37.forwardRef(({ side = "right", className, children, container, mode: modeProp, ...props }, ref) => {
4146
+ const mode = modeProp ?? useUIVariant();
4147
+ return /* @__PURE__ */ jsxs(SheetPortal, { container: container ?? void 0, children: [
4148
+ /* @__PURE__ */ jsx(SheetOverlay, {}),
4149
+ /* @__PURE__ */ jsx(
4150
+ DialogPrimitive.Content,
4151
+ {
4152
+ ref,
4153
+ className: cn(
4154
+ sheetVariants({ side }),
4155
+ mode === "smooth" && `${sideRoundingSmooth[side ?? "right"]} shadow-xl`,
4156
+ mode === "playful" && `${sideRoundingPlayful[side ?? "right"]} border-2 shadow-lg shadow-primary/10`,
4157
+ className
4158
+ ),
4159
+ ...props,
4160
+ children: /* @__PURE__ */ jsxs(UIVariantProvider, { mode, children: [
4161
+ children,
4162
+ /* @__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: [
4163
+ /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
4164
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
4165
+ ] })
4008
4166
  ] })
4009
- ] })
4010
- }
4011
- )
4012
- ] }));
4167
+ }
4168
+ )
4169
+ ] });
4170
+ });
4013
4171
  SheetContent.displayName = DialogPrimitive.Content.displayName;
4014
4172
  var SheetHeader = ({
4015
4173
  className,
@@ -4086,21 +4244,25 @@ function Skeleton({
4086
4244
  var TooltipProvider = TooltipPrimitive.Provider;
4087
4245
  var Tooltip2 = TooltipPrimitive.Root;
4088
4246
  var TooltipTrigger = TooltipPrimitive.Trigger;
4089
- var TooltipContent = React37.forwardRef(({ className, sideOffset = 4, mode, children, ...props }, ref) => /* @__PURE__ */ jsx(
4090
- TooltipPrimitive.Content,
4091
- {
4092
- ref,
4093
- sideOffset,
4094
- className: cn(
4095
- "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]",
4096
- mode === "smooth" && "rounded-xl shadow-xl",
4097
- mode === "playful" && "rounded-lg border-2 shadow-md shadow-primary/10",
4098
- className
4099
- ),
4100
- ...props,
4101
- children: /* @__PURE__ */ jsx(UIVariantProvider, { mode, children })
4102
- }
4103
- ));
4247
+ var TooltipContent = React37.forwardRef(({ className, sideOffset = 4, mode: modeProp, children, ...props }, ref) => {
4248
+ const mode = modeProp ?? useUIVariant();
4249
+ return /* @__PURE__ */ jsx(
4250
+ TooltipPrimitive.Content,
4251
+ {
4252
+ ref,
4253
+ sideOffset,
4254
+ className: cn(
4255
+ "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]",
4256
+ mode === "smooth" && "rounded-xl shadow-xl",
4257
+ mode === "playful" && "rounded-lg border-2 shadow-md shadow-primary/10",
4258
+ mode === "glass" && cn(glassPanel, "rounded-lg"),
4259
+ className
4260
+ ),
4261
+ ...props,
4262
+ children: /* @__PURE__ */ jsx(UIVariantProvider, { mode, children })
4263
+ }
4264
+ );
4265
+ });
4104
4266
  TooltipContent.displayName = TooltipPrimitive.Content.displayName;
4105
4267
  var SIDEBAR_COOKIE_NAME = "sidebar_state";
4106
4268
  var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
@@ -4826,9 +4988,57 @@ var Slider = React37.forwardRef(({ className, size = "default", ...props }, ref)
4826
4988
  }
4827
4989
  ));
4828
4990
  Slider.displayName = SliderPrimitive.Root.displayName;
4829
- var Toaster = ({ mode, className, style, ...props }) => {
4830
- const { theme = "system" } = useTheme();
4991
+ function useDocumentTheme() {
4992
+ const [theme, setTheme] = React37.useState("light");
4993
+ React37.useEffect(() => {
4994
+ const root = document.documentElement;
4995
+ const read = () => setTheme(
4996
+ root.classList.contains("dark") || root.dataset.theme === "dark" ? "dark" : "light"
4997
+ );
4998
+ read();
4999
+ const observer = new MutationObserver(read);
5000
+ observer.observe(root, { attributes: true, attributeFilter: ["class", "data-theme"] });
5001
+ return () => observer.disconnect();
5002
+ }, []);
5003
+ return theme;
5004
+ }
5005
+ var Toaster = ({ mode: modeProp, className, style, ...props }) => {
5006
+ const theme = useDocumentTheme();
5007
+ const ctxVariant = useUIVariant();
5008
+ const mode = modeProp ?? ctxVariant;
4831
5009
  return /* @__PURE__ */ jsxs(Fragment, { children: [
5010
+ /* @__PURE__ */ jsx("style", { children: `
5011
+ [data-sonner-toaster] {
5012
+ --toast-close-button-start: unset;
5013
+ --toast-close-button-end: 0.5rem;
5014
+ --toast-close-button-transform: translateY(0.5rem);
5015
+ }
5016
+ [data-sonner-toaster] [data-sonner-toast][data-styled='true'] [data-close-button] {
5017
+ height: 1.25rem;
5018
+ width: 1.25rem;
5019
+ padding: 0;
5020
+ border: none;
5021
+ border-radius: var(--radius-sm);
5022
+ background: transparent;
5023
+ /* Inherited rather than a fixed token: on a richColors toast the
5024
+ text is already the only colour guaranteed to read against that
5025
+ background, so borrowing it keeps the button legible on every
5026
+ variant without a rule per type. */
5027
+ color: inherit;
5028
+ opacity: 0.6;
5029
+ transition: opacity 150ms ease, background-color 150ms ease;
5030
+ }
5031
+ [data-sonner-toaster] [data-sonner-toast][data-styled='true'] [data-close-button] svg {
5032
+ height: 0.75rem;
5033
+ width: 0.75rem;
5034
+ }
5035
+ [data-sonner-toaster] [data-sonner-toast][data-styled='true']:hover [data-close-button]:hover {
5036
+ background: color-mix(in oklab, currentColor 12%, transparent);
5037
+ border-color: transparent;
5038
+ color: inherit;
5039
+ opacity: 1;
5040
+ }
5041
+ ` }),
4832
5042
  mode === "smooth" && /* @__PURE__ */ jsx("style", { children: `[data-sonner-toaster].toaster-smooth { --border-radius: 1.5rem; }` }),
4833
5043
  mode === "playful" && /* @__PURE__ */ jsx("style", { children: `
4834
5044
  [data-sonner-toaster].toaster-playful [data-sonner-toast][data-mounted=true] {
@@ -4954,8 +5164,41 @@ var switchSizes = {
4954
5164
  thumb: "size-6 data-[state=checked]:translate-x-7"
4955
5165
  }
4956
5166
  };
4957
- var Switch = React37.forwardRef(({ className, size = "default", ...props }, ref) => {
5167
+ var Switch = React37.forwardRef(({ className, size = "default", mode: modeProp, ...props }, ref) => {
5168
+ const mode = modeProp ?? useUIVariant();
4958
5169
  const sizes = switchSizes[size];
5170
+ if (mode === "playful") {
5171
+ return /* @__PURE__ */ jsxs("span", { className: "group/playful relative inline-flex", children: [
5172
+ /* @__PURE__ */ jsx(
5173
+ "span",
5174
+ {
5175
+ "aria-hidden": "true",
5176
+ 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]"
5177
+ }
5178
+ ),
5179
+ /* @__PURE__ */ jsx(
5180
+ SwitchPrimitives.Root,
5181
+ {
5182
+ className: cn(
5183
+ "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]",
5184
+ sizes.root,
5185
+ className
5186
+ ),
5187
+ ...props,
5188
+ ref,
5189
+ children: /* @__PURE__ */ jsx(
5190
+ SwitchPrimitives.Thumb,
5191
+ {
5192
+ className: cn(
5193
+ "pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=unchecked]:translate-x-0",
5194
+ sizes.thumb
5195
+ )
5196
+ }
5197
+ )
5198
+ }
5199
+ )
5200
+ ] });
5201
+ }
4959
5202
  return /* @__PURE__ */ jsx(
4960
5203
  SwitchPrimitives.Root,
4961
5204
  {
@@ -6818,12 +7061,13 @@ function AsciiText({
6818
7061
  }
6819
7062
  ) });
6820
7063
  }
7064
+ var SHINE_SPEED = 1.0125;
6821
7065
  function getShineAlpha(col, row, time, bounds) {
6822
7066
  const span = bounds.max - bounds.min + 1;
6823
7067
  const travel = span + 6;
6824
7068
  const diagonalCol = col + row * 0.62;
6825
- const primarySweep = bounds.max + 3 - time * 1.35 % 1 * travel;
6826
- const secondarySweep = bounds.max + 3 - (time * 1.35 + 0.5) % 1 * travel;
7069
+ const primarySweep = bounds.max + 3 - time * SHINE_SPEED % 1 * travel;
7070
+ const secondarySweep = bounds.max + 3 - (time * SHINE_SPEED + 0.5) % 1 * travel;
6827
7071
  const primary = getShineBandAlpha(diagonalCol, primarySweep);
6828
7072
  const secondary = getShineBandAlpha(diagonalCol, secondarySweep);
6829
7073
  return Math.min(0.86, primary + secondary * 0.82);