@web-my-money/primitives 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/dist/accordion/index.d.mts +9 -0
  2. package/dist/accordion/index.d.ts +9 -0
  3. package/dist/accordion/index.js +99 -0
  4. package/dist/accordion/index.mjs +14 -0
  5. package/dist/alert-dialog/index.d.mts +22 -0
  6. package/dist/alert-dialog/index.d.ts +22 -0
  7. package/dist/alert-dialog/index.js +206 -0
  8. package/dist/alert-dialog/index.mjs +29 -0
  9. package/dist/avatar/index.d.mts +23 -0
  10. package/dist/avatar/index.d.ts +23 -0
  11. package/dist/avatar/index.js +133 -0
  12. package/dist/avatar/index.mjs +10 -0
  13. package/dist/badge/index.d.mts +15 -0
  14. package/dist/badge/index.d.ts +15 -0
  15. package/dist/badge/index.js +96 -0
  16. package/dist/badge/index.mjs +10 -0
  17. package/dist/breadcrumb/index.d.mts +20 -0
  18. package/dist/breadcrumb/index.d.ts +20 -0
  19. package/dist/breadcrumb/index.js +126 -0
  20. package/dist/breadcrumb/index.mjs +20 -0
  21. package/dist/button/index.d.mts +12 -0
  22. package/dist/button/index.d.ts +12 -0
  23. package/dist/button/index.js +88 -0
  24. package/dist/button/index.mjs +10 -0
  25. package/dist/calendar/index.d.mts +29 -0
  26. package/dist/calendar/index.d.ts +29 -0
  27. package/dist/calendar/index.js +191 -0
  28. package/dist/calendar/index.mjs +9 -0
  29. package/dist/card/index.d.mts +13 -0
  30. package/dist/card/index.d.ts +13 -0
  31. package/dist/card/index.js +141 -0
  32. package/dist/card/index.mjs +19 -0
  33. package/dist/carousel/index.d.mts +20 -0
  34. package/dist/carousel/index.d.ts +20 -0
  35. package/dist/carousel/index.js +236 -0
  36. package/dist/carousel/index.mjs +19 -0
  37. package/dist/checkbox/index.d.mts +6 -0
  38. package/dist/checkbox/index.d.ts +6 -0
  39. package/dist/checkbox/index.js +63 -0
  40. package/dist/checkbox/index.mjs +8 -0
  41. package/dist/chunk-32LEHNCH.mjs +155 -0
  42. package/dist/chunk-3ZJ4L43B.mjs +92 -0
  43. package/dist/chunk-4KQNZMKT.mjs +47 -0
  44. package/dist/chunk-4W6U222X.mjs +113 -0
  45. package/dist/chunk-556SM2PJ.mjs +40 -0
  46. package/dist/chunk-5LYTCNI6.mjs +127 -0
  47. package/dist/chunk-5N7LGYZK.mjs +137 -0
  48. package/dist/chunk-6OG237U6.mjs +54 -0
  49. package/dist/chunk-7TMIJ7HZ.mjs +149 -0
  50. package/dist/chunk-DTENOVQN.mjs +44 -0
  51. package/dist/chunk-DUGW62XX.mjs +143 -0
  52. package/dist/chunk-DWLKKYIU.mjs +156 -0
  53. package/dist/chunk-DYCSGLM5.mjs +32 -0
  54. package/dist/chunk-DZPJV6MN.mjs +66 -0
  55. package/dist/chunk-FT72MNAV.mjs +25 -0
  56. package/dist/chunk-FV6JTZAK.mjs +30 -0
  57. package/dist/chunk-GLD4KQD3.mjs +90 -0
  58. package/dist/chunk-GWVW5OI6.mjs +106 -0
  59. package/dist/chunk-JWCA4M7E.mjs +160 -0
  60. package/dist/chunk-K4UYYX45.mjs +199 -0
  61. package/dist/chunk-KVQKOJNU.mjs +52 -0
  62. package/dist/chunk-LPMRBQLR.mjs +120 -0
  63. package/dist/chunk-M6HSM6GV.mjs +68 -0
  64. package/dist/chunk-NE5LEVMC.mjs +201 -0
  65. package/dist/chunk-NGWDLZ6E.mjs +33 -0
  66. package/dist/chunk-NH5ZVHAV.mjs +36 -0
  67. package/dist/chunk-PFXSPRVI.mjs +65 -0
  68. package/dist/chunk-PJO7WJ4G.mjs +10 -0
  69. package/dist/chunk-PTXZWR7Y.mjs +76 -0
  70. package/dist/chunk-SG747CBC.mjs +34 -0
  71. package/dist/chunk-UDQDW22Y.mjs +71 -0
  72. package/dist/chunk-UGOA6M4S.mjs +120 -0
  73. package/dist/chunk-UXU54FBX.mjs +63 -0
  74. package/dist/chunk-WYBX5VJ4.mjs +49 -0
  75. package/dist/chunk-Y7DNVOKO.mjs +57 -0
  76. package/dist/chunk-YNOS3JA2.mjs +29 -0
  77. package/dist/chunk-YPTARV3T.mjs +57 -0
  78. package/dist/chunk-YYFQVSPV.mjs +17 -0
  79. package/dist/chunk-ZR3J34NX.mjs +85 -0
  80. package/dist/collapsible/index.d.mts +8 -0
  81. package/dist/collapsible/index.d.ts +8 -0
  82. package/dist/collapsible/index.js +64 -0
  83. package/dist/collapsible/index.mjs +12 -0
  84. package/dist/combobox/index.d.mts +18 -0
  85. package/dist/combobox/index.d.ts +18 -0
  86. package/dist/combobox/index.js +198 -0
  87. package/dist/combobox/index.mjs +32 -0
  88. package/dist/context-menu/index.d.mts +16 -0
  89. package/dist/context-menu/index.d.ts +16 -0
  90. package/dist/context-menu/index.js +177 -0
  91. package/dist/context-menu/index.mjs +28 -0
  92. package/dist/date-range-input/index.d.mts +17 -0
  93. package/dist/date-range-input/index.d.ts +17 -0
  94. package/dist/date-range-input/index.js +284 -0
  95. package/dist/date-range-input/index.mjs +11 -0
  96. package/dist/dialog/index.d.mts +19 -0
  97. package/dist/dialog/index.d.ts +19 -0
  98. package/dist/dialog/index.js +240 -0
  99. package/dist/dialog/index.mjs +27 -0
  100. package/dist/dropdown-menu/index.d.mts +16 -0
  101. package/dist/dropdown-menu/index.d.ts +16 -0
  102. package/dist/dropdown-menu/index.js +189 -0
  103. package/dist/dropdown-menu/index.mjs +28 -0
  104. package/dist/field/index.d.mts +24 -0
  105. package/dist/field/index.d.ts +24 -0
  106. package/dist/field/index.js +88 -0
  107. package/dist/field/index.mjs +16 -0
  108. package/dist/hover-card/index.d.mts +8 -0
  109. package/dist/hover-card/index.d.ts +8 -0
  110. package/dist/hover-card/index.js +79 -0
  111. package/dist/hover-card/index.mjs +12 -0
  112. package/dist/index.d.mts +73 -0
  113. package/dist/index.d.ts +73 -0
  114. package/dist/index.js +3167 -0
  115. package/dist/index.mjs +452 -0
  116. package/dist/input/index.d.mts +5 -0
  117. package/dist/input/index.d.ts +5 -0
  118. package/dist/input/index.js +54 -0
  119. package/dist/input/index.mjs +7 -0
  120. package/dist/kbd/index.d.mts +8 -0
  121. package/dist/kbd/index.d.ts +8 -0
  122. package/dist/kbd/index.js +64 -0
  123. package/dist/kbd/index.mjs +9 -0
  124. package/dist/lightbox/index.d.mts +17 -0
  125. package/dist/lightbox/index.d.ts +17 -0
  126. package/dist/lightbox/index.js +151 -0
  127. package/dist/lightbox/index.mjs +24 -0
  128. package/dist/pagination/index.d.mts +33 -0
  129. package/dist/pagination/index.d.ts +33 -0
  130. package/dist/pagination/index.js +212 -0
  131. package/dist/pagination/index.mjs +25 -0
  132. package/dist/popover/index.d.mts +11 -0
  133. package/dist/popover/index.d.ts +11 -0
  134. package/dist/popover/index.js +120 -0
  135. package/dist/popover/index.mjs +18 -0
  136. package/dist/progress/index.d.mts +6 -0
  137. package/dist/progress/index.d.ts +6 -0
  138. package/dist/progress/index.js +60 -0
  139. package/dist/progress/index.mjs +8 -0
  140. package/dist/radio-group/index.d.mts +8 -0
  141. package/dist/radio-group/index.d.ts +8 -0
  142. package/dist/radio-group/index.js +71 -0
  143. package/dist/radio-group/index.mjs +10 -0
  144. package/dist/resizable/index.d.mts +10 -0
  145. package/dist/resizable/index.d.ts +10 -0
  146. package/dist/resizable/index.js +80 -0
  147. package/dist/resizable/index.mjs +12 -0
  148. package/dist/scroll-area/index.d.mts +6 -0
  149. package/dist/scroll-area/index.d.ts +6 -0
  150. package/dist/scroll-area/index.js +74 -0
  151. package/dist/scroll-area/index.mjs +8 -0
  152. package/dist/select/index.d.mts +17 -0
  153. package/dist/select/index.d.ts +17 -0
  154. package/dist/select/index.js +238 -0
  155. package/dist/select/index.mjs +26 -0
  156. package/dist/separator/index.d.mts +6 -0
  157. package/dist/separator/index.d.ts +6 -0
  158. package/dist/separator/index.js +59 -0
  159. package/dist/separator/index.mjs +8 -0
  160. package/dist/sheet/index.d.mts +38 -0
  161. package/dist/sheet/index.d.ts +38 -0
  162. package/dist/sheet/index.js +212 -0
  163. package/dist/sheet/index.mjs +27 -0
  164. package/dist/skeleton/index.d.mts +17 -0
  165. package/dist/skeleton/index.d.ts +17 -0
  166. package/dist/skeleton/index.js +80 -0
  167. package/dist/skeleton/index.mjs +11 -0
  168. package/dist/slide-over/index.d.mts +92 -0
  169. package/dist/slide-over/index.d.ts +92 -0
  170. package/dist/slide-over/index.js +298 -0
  171. package/dist/slide-over/index.mjs +31 -0
  172. package/dist/slider/index.d.mts +6 -0
  173. package/dist/slider/index.d.ts +6 -0
  174. package/dist/slider/index.js +47 -0
  175. package/dist/slider/index.mjs +8 -0
  176. package/dist/switch/index.d.mts +8 -0
  177. package/dist/switch/index.d.ts +8 -0
  178. package/dist/switch/index.js +66 -0
  179. package/dist/switch/index.mjs +8 -0
  180. package/dist/tabs/index.d.mts +9 -0
  181. package/dist/tabs/index.d.ts +9 -0
  182. package/dist/tabs/index.js +96 -0
  183. package/dist/tabs/index.mjs +14 -0
  184. package/dist/toast/index.d.mts +19 -0
  185. package/dist/toast/index.d.ts +19 -0
  186. package/dist/toast/index.js +107 -0
  187. package/dist/toast/index.mjs +10 -0
  188. package/dist/toggle/index.d.mts +14 -0
  189. package/dist/toggle/index.d.ts +14 -0
  190. package/dist/toggle/index.js +89 -0
  191. package/dist/toggle/index.mjs +12 -0
  192. package/dist/tooltip/index.d.mts +9 -0
  193. package/dist/tooltip/index.d.ts +9 -0
  194. package/dist/tooltip/index.js +101 -0
  195. package/dist/tooltip/index.mjs +14 -0
  196. package/package.json +235 -0
@@ -0,0 +1,36 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-PJO7WJ4G.mjs";
4
+
5
+ // src/switch/index.tsx
6
+ import { Switch as SwitchPrimitive } from "@base-ui/react/switch";
7
+ import { jsx } from "react/jsx-runtime";
8
+ function Switch({
9
+ className,
10
+ size = "default",
11
+ ...props
12
+ }) {
13
+ return /* @__PURE__ */ jsx(
14
+ SwitchPrimitive.Root,
15
+ {
16
+ "data-slot": "switch",
17
+ "data-size": size,
18
+ className: cn(
19
+ "peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",
20
+ className
21
+ ),
22
+ ...props,
23
+ children: /* @__PURE__ */ jsx(
24
+ SwitchPrimitive.Thumb,
25
+ {
26
+ "data-slot": "switch-thumb",
27
+ className: "pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"
28
+ }
29
+ )
30
+ }
31
+ );
32
+ }
33
+
34
+ export {
35
+ Switch
36
+ };
@@ -0,0 +1,65 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-PJO7WJ4G.mjs";
4
+
5
+ // src/badge/index.tsx
6
+ import { cva } from "class-variance-authority";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ var badgeVariants = cva(
9
+ "inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium transition-colors border select-none",
10
+ {
11
+ variants: {
12
+ variant: {
13
+ default: "border-transparent bg-primary/15 text-primary",
14
+ secondary: "border-transparent bg-secondary text-secondary-foreground",
15
+ outline: "border-border text-foreground bg-transparent",
16
+ success: "border-transparent bg-emerald-500/15 text-emerald-500",
17
+ warning: "border-transparent bg-amber-500/15 text-amber-500",
18
+ destructive: "border-transparent bg-red-500/15 text-red-500",
19
+ info: "border-transparent bg-sky-500/15 text-sky-500"
20
+ },
21
+ size: {
22
+ sm: "px-2 py-px text-[10px]",
23
+ default: "px-2.5 py-0.5 text-xs",
24
+ lg: "px-3 py-1 text-sm"
25
+ }
26
+ },
27
+ defaultVariants: {
28
+ variant: "default",
29
+ size: "default"
30
+ }
31
+ }
32
+ );
33
+ var dotColors = {
34
+ default: "bg-primary",
35
+ secondary: "bg-secondary-foreground",
36
+ outline: "bg-foreground",
37
+ success: "bg-emerald-500",
38
+ warning: "bg-amber-500",
39
+ destructive: "bg-red-500",
40
+ info: "bg-sky-500"
41
+ };
42
+ function Badge({
43
+ className,
44
+ variant = "default",
45
+ size,
46
+ dot,
47
+ children,
48
+ ...props
49
+ }) {
50
+ return /* @__PURE__ */ jsxs("span", { className: cn(badgeVariants({ variant, size }), className), ...props, children: [
51
+ dot && /* @__PURE__ */ jsx(
52
+ "span",
53
+ {
54
+ "aria-hidden": true,
55
+ className: cn("inline-block size-1.5 rounded-full shrink-0", dotColors[variant ?? "default"])
56
+ }
57
+ ),
58
+ children
59
+ ] });
60
+ }
61
+
62
+ export {
63
+ badgeVariants,
64
+ Badge
65
+ };
@@ -0,0 +1,10 @@
1
+ // src/utils.ts
2
+ import { clsx } from "clsx";
3
+ import { twMerge } from "tailwind-merge";
4
+ function cn(...inputs) {
5
+ return twMerge(clsx(inputs));
6
+ }
7
+
8
+ export {
9
+ cn
10
+ };
@@ -0,0 +1,76 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-PJO7WJ4G.mjs";
4
+
5
+ // src/toast/index.tsx
6
+ import { Toast as ToastPrimitive } from "@base-ui/react/toast";
7
+ import { X } from "lucide-react";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ function useToast() {
10
+ return ToastPrimitive.useToastManager();
11
+ }
12
+ function ToastList() {
13
+ const { toasts } = ToastPrimitive.useToastManager();
14
+ return toasts.map((toast) => /* @__PURE__ */ jsxs(
15
+ ToastPrimitive.Root,
16
+ {
17
+ toast,
18
+ className: cn(
19
+ "relative flex items-start gap-3 rounded-lg bg-popover p-3.5 pr-9 text-sm text-popover-foreground shadow-lg ring-1 ring-foreground/10",
20
+ "transition-all duration-200",
21
+ "data-[starting-style]:translate-x-full data-[starting-style]:opacity-0",
22
+ "data-[ending-style]:translate-x-full data-[ending-style]:opacity-0",
23
+ "data-[swipe-direction=right]:data-[ending-style]:translate-x-full"
24
+ ),
25
+ children: [
26
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
27
+ /* @__PURE__ */ jsx(ToastPrimitive.Title, { className: "text-sm font-medium text-foreground" }),
28
+ /* @__PURE__ */ jsx(ToastPrimitive.Description, { className: "mt-0.5 text-sm text-muted-foreground" }),
29
+ toast.actionProps && /* @__PURE__ */ jsx(
30
+ ToastPrimitive.Action,
31
+ {
32
+ ...toast.actionProps,
33
+ className: cn(
34
+ "mt-2 text-sm font-medium text-primary underline underline-offset-2 hover:text-primary/80",
35
+ toast.actionProps.className
36
+ )
37
+ }
38
+ )
39
+ ] }),
40
+ /* @__PURE__ */ jsx(
41
+ ToastPrimitive.Close,
42
+ {
43
+ "aria-label": "Close",
44
+ className: "absolute right-2 top-2 rounded-md p-1 text-muted-foreground outline-none hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",
45
+ children: /* @__PURE__ */ jsx(X, { className: "size-4" })
46
+ }
47
+ )
48
+ ]
49
+ },
50
+ toast.id
51
+ ));
52
+ }
53
+ function ToastProvider({
54
+ children,
55
+ className,
56
+ ...props
57
+ }) {
58
+ return /* @__PURE__ */ jsxs(ToastPrimitive.Provider, { ...props, children: [
59
+ children,
60
+ /* @__PURE__ */ jsx(ToastPrimitive.Portal, { children: /* @__PURE__ */ jsx(
61
+ ToastPrimitive.Viewport,
62
+ {
63
+ className: cn(
64
+ "fixed right-4 top-4 z-[100] flex w-80 max-w-[calc(100vw-2rem)] flex-col gap-2 outline-none",
65
+ className
66
+ ),
67
+ children: /* @__PURE__ */ jsx(ToastList, {})
68
+ }
69
+ ) })
70
+ ] });
71
+ }
72
+
73
+ export {
74
+ useToast,
75
+ ToastProvider
76
+ };
@@ -0,0 +1,34 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-PJO7WJ4G.mjs";
4
+
5
+ // src/kbd/index.tsx
6
+ import { jsx } from "react/jsx-runtime";
7
+ function Kbd({ className, ...props }) {
8
+ return /* @__PURE__ */ jsx(
9
+ "kbd",
10
+ {
11
+ "data-slot": "kbd",
12
+ className: cn(
13
+ "pointer-events-none inline-flex h-5 min-w-5 select-none items-center justify-center rounded border border-border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground",
14
+ className
15
+ ),
16
+ ...props
17
+ }
18
+ );
19
+ }
20
+ function KbdGroup({ className, ...props }) {
21
+ return /* @__PURE__ */ jsx(
22
+ "div",
23
+ {
24
+ "data-slot": "kbd-group",
25
+ className: cn("inline-flex items-center gap-1", className),
26
+ ...props
27
+ }
28
+ );
29
+ }
30
+
31
+ export {
32
+ Kbd,
33
+ KbdGroup
34
+ };
@@ -0,0 +1,71 @@
1
+ import {
2
+ Popover,
3
+ PopoverContent,
4
+ PopoverTrigger
5
+ } from "./chunk-ZR3J34NX.mjs";
6
+ import {
7
+ Calendar
8
+ } from "./chunk-UGOA6M4S.mjs";
9
+ import {
10
+ buttonVariants
11
+ } from "./chunk-YPTARV3T.mjs";
12
+ import {
13
+ cn
14
+ } from "./chunk-PJO7WJ4G.mjs";
15
+
16
+ // src/date-range-input/index.tsx
17
+ import * as React from "react";
18
+ import { CalendarDays } from "lucide-react";
19
+ import { jsx, jsxs } from "react/jsx-runtime";
20
+ function defaultFormat(d) {
21
+ return d.toLocaleDateString(void 0, { month: "short", day: "numeric", year: "numeric" });
22
+ }
23
+ function DateRangeInput({
24
+ value,
25
+ onChange,
26
+ placeholder = "Pick a date range",
27
+ minDate,
28
+ maxDate,
29
+ disabled,
30
+ className,
31
+ formatDate = defaultFormat
32
+ }) {
33
+ const [open, setOpen] = React.useState(false);
34
+ const label = value?.from ? value.to ? `${formatDate(value.from)} \u2013 ${formatDate(value.to)}` : formatDate(value.from) : placeholder;
35
+ return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
36
+ /* @__PURE__ */ jsxs(
37
+ PopoverTrigger,
38
+ {
39
+ "data-slot": "date-range-input-trigger",
40
+ disabled,
41
+ className: cn(
42
+ buttonVariants({ variant: "outline" }),
43
+ "w-full justify-start gap-2 font-normal",
44
+ !value?.from && "text-muted-foreground",
45
+ className
46
+ ),
47
+ children: [
48
+ /* @__PURE__ */ jsx(CalendarDays, { className: "size-4" }),
49
+ label
50
+ ]
51
+ }
52
+ ),
53
+ /* @__PURE__ */ jsx(PopoverContent, { align: "start", className: "w-auto p-0", children: /* @__PURE__ */ jsx(
54
+ Calendar,
55
+ {
56
+ mode: "range",
57
+ selected: value ?? { from: void 0, to: void 0 },
58
+ onSelect: (range) => {
59
+ onChange?.(range);
60
+ if (range.from && range.to) setOpen(false);
61
+ },
62
+ minDate,
63
+ maxDate
64
+ }
65
+ ) })
66
+ ] });
67
+ }
68
+
69
+ export {
70
+ DateRangeInput
71
+ };
@@ -0,0 +1,120 @@
1
+ import {
2
+ buttonVariants
3
+ } from "./chunk-YPTARV3T.mjs";
4
+ import {
5
+ cn
6
+ } from "./chunk-PJO7WJ4G.mjs";
7
+
8
+ // src/calendar/index.tsx
9
+ import * as React from "react";
10
+ import { ChevronLeft, ChevronRight } from "lucide-react";
11
+ import { jsx, jsxs } from "react/jsx-runtime";
12
+ var WEEKDAY_LABELS = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
13
+ function startOfDay(d) {
14
+ return new Date(d.getFullYear(), d.getMonth(), d.getDate());
15
+ }
16
+ function isSameDay(a, b) {
17
+ return !!a && !!b && startOfDay(a).getTime() === startOfDay(b).getTime();
18
+ }
19
+ function isBetween(d, from, to) {
20
+ if (!from || !to) return false;
21
+ const t = startOfDay(d).getTime();
22
+ return t > startOfDay(from).getTime() && t < startOfDay(to).getTime();
23
+ }
24
+ function getMonthGrid(year, month) {
25
+ const first = new Date(year, month, 1);
26
+ const gridStart = new Date(year, month, 1 - first.getDay());
27
+ return Array.from({ length: 42 }, (_, i) => {
28
+ const d = new Date(gridStart);
29
+ d.setDate(gridStart.getDate() + i);
30
+ return d;
31
+ });
32
+ }
33
+ function Calendar(props) {
34
+ const { className, minDate, maxDate, disabled } = props;
35
+ const [uncontrolledMonth, setUncontrolledMonth] = React.useState(
36
+ () => props.defaultMonth ?? props.month ?? /* @__PURE__ */ new Date()
37
+ );
38
+ const month = props.month ?? uncontrolledMonth;
39
+ const setMonth = (next) => {
40
+ setUncontrolledMonth(next);
41
+ props.onMonthChange?.(next);
42
+ };
43
+ const isDisabled = (d) => {
44
+ if (minDate && startOfDay(d) < startOfDay(minDate)) return true;
45
+ if (maxDate && startOfDay(d) > startOfDay(maxDate)) return true;
46
+ return disabled?.(d) ?? false;
47
+ };
48
+ const handleSelect = (d) => {
49
+ if (isDisabled(d)) return;
50
+ if (props.mode === "range") {
51
+ const current = props.selected;
52
+ if (!current?.from || current.from && current.to) {
53
+ props.onSelect?.({ from: d, to: void 0 });
54
+ } else if (startOfDay(d) < startOfDay(current.from)) {
55
+ props.onSelect?.({ from: d, to: current.from });
56
+ } else {
57
+ props.onSelect?.({ from: current.from, to: d });
58
+ }
59
+ } else {
60
+ props.onSelect?.(isSameDay(props.selected, d) ? void 0 : d);
61
+ }
62
+ };
63
+ const grid = getMonthGrid(month.getFullYear(), month.getMonth());
64
+ return /* @__PURE__ */ jsxs("div", { "data-slot": "calendar", className: cn("w-fit p-2", className), children: [
65
+ /* @__PURE__ */ jsxs("div", { "data-slot": "calendar-header", className: "flex items-center justify-between px-1 pb-2", children: [
66
+ /* @__PURE__ */ jsx(
67
+ "button",
68
+ {
69
+ type: "button",
70
+ "aria-label": "Previous month",
71
+ onClick: () => setMonth(new Date(month.getFullYear(), month.getMonth() - 1, 1)),
72
+ className: cn(buttonVariants({ variant: "ghost", size: "icon-sm" })),
73
+ children: /* @__PURE__ */ jsx(ChevronLeft, { className: "size-4" })
74
+ }
75
+ ),
76
+ /* @__PURE__ */ jsx("div", { "data-slot": "calendar-label", className: "text-sm font-medium", children: month.toLocaleDateString(void 0, { month: "long", year: "numeric" }) }),
77
+ /* @__PURE__ */ jsx(
78
+ "button",
79
+ {
80
+ type: "button",
81
+ "aria-label": "Next month",
82
+ onClick: () => setMonth(new Date(month.getFullYear(), month.getMonth() + 1, 1)),
83
+ className: cn(buttonVariants({ variant: "ghost", size: "icon-sm" })),
84
+ children: /* @__PURE__ */ jsx(ChevronRight, { className: "size-4" })
85
+ }
86
+ )
87
+ ] }),
88
+ /* @__PURE__ */ jsx("div", { "data-slot": "calendar-weekdays", className: "grid grid-cols-7 gap-0.5 px-1", children: WEEKDAY_LABELS.map((w) => /* @__PURE__ */ jsx("div", { className: "flex h-8 items-center justify-center text-xs font-medium text-muted-foreground", children: w }, w)) }),
89
+ /* @__PURE__ */ jsx("div", { "data-slot": "calendar-grid", className: "grid grid-cols-7 gap-0.5 px-1", children: grid.map((d) => {
90
+ const outsideMonth = d.getMonth() !== month.getMonth();
91
+ const isSelected = props.mode === "range" ? isSameDay(d, props.selected?.from) || isSameDay(d, props.selected?.to) : isSameDay(d, props.selected);
92
+ const inRange = props.mode === "range" && isBetween(d, props.selected?.from, props.selected?.to);
93
+ return /* @__PURE__ */ jsx(
94
+ "button",
95
+ {
96
+ type: "button",
97
+ "data-slot": "calendar-day",
98
+ "data-selected": isSelected || void 0,
99
+ "data-outside-month": outsideMonth || void 0,
100
+ disabled: isDisabled(d),
101
+ "aria-label": d.toDateString(),
102
+ "aria-current": isSameDay(d, /* @__PURE__ */ new Date()) ? "date" : void 0,
103
+ onClick: () => handleSelect(d),
104
+ className: cn(
105
+ "flex h-8 w-8 items-center justify-center rounded-md text-sm transition-colors hover:bg-muted disabled:pointer-events-none disabled:opacity-40",
106
+ outsideMonth && "text-muted-foreground/50",
107
+ inRange && "rounded-none bg-primary/10",
108
+ isSelected && "bg-primary text-primary-foreground hover:bg-primary/90"
109
+ ),
110
+ children: d.getDate()
111
+ },
112
+ d.toISOString()
113
+ );
114
+ }) })
115
+ ] });
116
+ }
117
+
118
+ export {
119
+ Calendar
120
+ };
@@ -0,0 +1,63 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-PJO7WJ4G.mjs";
4
+
5
+ // src/tabs/index.tsx
6
+ import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";
7
+ import { jsx } from "react/jsx-runtime";
8
+ var TabsList = ({
9
+ className,
10
+ ...props
11
+ }) => /* @__PURE__ */ jsx(
12
+ TabsPrimitive.List,
13
+ {
14
+ className: cn(
15
+ "inline-flex h-9 items-center gap-1 rounded-lg bg-muted p-1 text-muted-foreground",
16
+ className
17
+ ),
18
+ ...props
19
+ }
20
+ );
21
+ var TabsTrigger = ({
22
+ className,
23
+ ...props
24
+ }) => /* @__PURE__ */ jsx(
25
+ TabsPrimitive.Tab,
26
+ {
27
+ className: cn(
28
+ "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium",
29
+ "transition-all outline-none select-none cursor-pointer",
30
+ "disabled:pointer-events-none disabled:opacity-50",
31
+ "data-[selected]:bg-background data-[selected]:text-foreground data-[selected]:shadow-sm",
32
+ "hover:not-data-[selected]:text-foreground/80",
33
+ "focus-visible:ring-2 focus-visible:ring-ring",
34
+ className
35
+ ),
36
+ ...props
37
+ }
38
+ );
39
+ var TabsContent = ({
40
+ className,
41
+ ...props
42
+ }) => /* @__PURE__ */ jsx(
43
+ TabsPrimitive.Panel,
44
+ {
45
+ className: cn(
46
+ "mt-2 outline-none",
47
+ "focus-visible:ring-2 focus-visible:ring-ring rounded-md",
48
+ className
49
+ ),
50
+ ...props
51
+ }
52
+ );
53
+ var Tabs = ({
54
+ className,
55
+ ...props
56
+ }) => /* @__PURE__ */ jsx(TabsPrimitive.Root, { className: cn("flex flex-col gap-2", className), ...props });
57
+
58
+ export {
59
+ TabsList,
60
+ TabsTrigger,
61
+ TabsContent,
62
+ Tabs
63
+ };
@@ -0,0 +1,49 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-PJO7WJ4G.mjs";
4
+
5
+ // src/skeleton/index.tsx
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ function Skeleton({ className, shape, width, height, style, ...props }) {
8
+ return /* @__PURE__ */ jsx(
9
+ "div",
10
+ {
11
+ "aria-hidden": true,
12
+ className: cn(
13
+ "animate-pulse rounded-md bg-muted/60",
14
+ shape === "circle" && "rounded-full",
15
+ shape === "line" && "h-4",
16
+ className
17
+ ),
18
+ style: {
19
+ width: typeof width === "number" ? `${width}px` : width,
20
+ height: typeof height === "number" ? `${height}px` : height,
21
+ ...style
22
+ },
23
+ ...props
24
+ }
25
+ );
26
+ }
27
+ function SkeletonCard({ className }) {
28
+ return /* @__PURE__ */ jsxs("div", { className: cn("space-y-3 rounded-xl border border-border bg-card p-5", className), children: [
29
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-2/5" }),
30
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-3/5" }),
31
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-4/5" }),
32
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-1/2" })
33
+ ] });
34
+ }
35
+ function SkeletonRow({ className }) {
36
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-3", className), children: [
37
+ /* @__PURE__ */ jsx(Skeleton, { shape: "circle", className: "size-9 shrink-0" }),
38
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-2", children: [
39
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-2/3" }),
40
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-1/3" })
41
+ ] })
42
+ ] });
43
+ }
44
+
45
+ export {
46
+ Skeleton,
47
+ SkeletonCard,
48
+ SkeletonRow
49
+ };
@@ -0,0 +1,57 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-PJO7WJ4G.mjs";
4
+
5
+ // src/toggle/index.tsx
6
+ import { Toggle as TogglePrimitive } from "@base-ui/react/toggle";
7
+ import { ToggleGroup as ToggleGroupPrimitive } from "@base-ui/react/toggle-group";
8
+ import { cva } from "class-variance-authority";
9
+ import { jsx } from "react/jsx-runtime";
10
+ var toggleVariants = cva(
11
+ "inline-flex items-center justify-center gap-1.5 rounded-md text-sm font-medium outline-none transition-colors select-none cursor-pointer disabled:pointer-events-none disabled:opacity-50 hover:bg-muted hover:text-foreground data-pressed:bg-primary/15 data-pressed:text-primary focus-visible:ring-2 focus-visible:ring-ring [&_svg]:size-4 [&_svg]:shrink-0",
12
+ {
13
+ variants: {
14
+ variant: {
15
+ default: "bg-transparent",
16
+ outline: "border border-border bg-transparent"
17
+ },
18
+ size: {
19
+ sm: "h-7 px-2",
20
+ default: "h-8 px-2.5",
21
+ lg: "h-9 px-3"
22
+ }
23
+ },
24
+ defaultVariants: { variant: "default", size: "default" }
25
+ }
26
+ );
27
+ function Toggle({
28
+ className,
29
+ variant,
30
+ size,
31
+ ...props
32
+ }) {
33
+ return /* @__PURE__ */ jsx(
34
+ TogglePrimitive,
35
+ {
36
+ "data-slot": "toggle",
37
+ className: cn(toggleVariants({ variant, size }), className),
38
+ ...props
39
+ }
40
+ );
41
+ }
42
+ function ToggleGroup({ className, ...props }) {
43
+ return /* @__PURE__ */ jsx(
44
+ ToggleGroupPrimitive,
45
+ {
46
+ "data-slot": "toggle-group",
47
+ className: cn("inline-flex items-center gap-1 rounded-lg bg-muted p-1", className),
48
+ ...props
49
+ }
50
+ );
51
+ }
52
+
53
+ export {
54
+ toggleVariants,
55
+ Toggle,
56
+ ToggleGroup
57
+ };
@@ -0,0 +1,29 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-PJO7WJ4G.mjs";
4
+
5
+ // src/separator/index.tsx
6
+ import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";
7
+ import { jsx } from "react/jsx-runtime";
8
+ function Separator({
9
+ className,
10
+ orientation = "horizontal",
11
+ ...props
12
+ }) {
13
+ return /* @__PURE__ */ jsx(
14
+ SeparatorPrimitive,
15
+ {
16
+ "data-slot": "separator",
17
+ orientation,
18
+ className: cn(
19
+ "shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",
20
+ className
21
+ ),
22
+ ...props
23
+ }
24
+ );
25
+ }
26
+
27
+ export {
28
+ Separator
29
+ };
@@ -0,0 +1,57 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-PJO7WJ4G.mjs";
4
+
5
+ // src/button/index.tsx
6
+ import { Button as ButtonPrimitive } from "@base-ui/react/button";
7
+ import { cva } from "class-variance-authority";
8
+ import { jsx } from "react/jsx-runtime";
9
+ var buttonVariants = cva(
10
+ "group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
11
+ {
12
+ variants: {
13
+ variant: {
14
+ default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
15
+ outline: "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
16
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
17
+ ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
18
+ destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
19
+ link: "text-primary underline-offset-4 hover:underline"
20
+ },
21
+ size: {
22
+ default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
23
+ xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
24
+ sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
25
+ lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",
26
+ icon: "size-8",
27
+ "icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
28
+ "icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
29
+ "icon-lg": "size-9"
30
+ }
31
+ },
32
+ defaultVariants: {
33
+ variant: "default",
34
+ size: "default"
35
+ }
36
+ }
37
+ );
38
+ function Button({
39
+ className,
40
+ variant = "default",
41
+ size = "default",
42
+ ...props
43
+ }) {
44
+ return /* @__PURE__ */ jsx(
45
+ ButtonPrimitive,
46
+ {
47
+ "data-slot": "button",
48
+ className: cn(buttonVariants({ variant, size, className })),
49
+ ...props
50
+ }
51
+ );
52
+ }
53
+
54
+ export {
55
+ buttonVariants,
56
+ Button
57
+ };