@craftzbay/ui 0.11.3 → 0.11.4

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 (163) hide show
  1. package/dist-lib/_virtual/_rolldown/runtime.js +11 -0
  2. package/dist-lib/components/ui/Accordion.js +42 -67
  3. package/dist-lib/components/ui/Accordion.js.map +1 -1
  4. package/dist-lib/components/ui/Alert.js +71 -77
  5. package/dist-lib/components/ui/Alert.js.map +1 -1
  6. package/dist-lib/components/ui/Avatar.js +67 -92
  7. package/dist-lib/components/ui/Avatar.js.map +1 -1
  8. package/dist-lib/components/ui/Badge.js +119 -74
  9. package/dist-lib/components/ui/Badge.js.map +1 -1
  10. package/dist-lib/components/ui/Breadcrumbs.js +62 -50
  11. package/dist-lib/components/ui/Breadcrumbs.js.map +1 -1
  12. package/dist-lib/components/ui/Button.js +129 -131
  13. package/dist-lib/components/ui/Button.js.map +1 -1
  14. package/dist-lib/components/ui/Calendar.d.ts +1 -1
  15. package/dist-lib/components/ui/Calendar.js +99 -136
  16. package/dist-lib/components/ui/Calendar.js.map +1 -1
  17. package/dist-lib/components/ui/Card.js +88 -94
  18. package/dist-lib/components/ui/Card.js.map +1 -1
  19. package/dist-lib/components/ui/Carousel.js +125 -170
  20. package/dist-lib/components/ui/Carousel.js.map +1 -1
  21. package/dist-lib/components/ui/Chart.d.ts +3 -3
  22. package/dist-lib/components/ui/Chart.js +435 -464
  23. package/dist-lib/components/ui/Chart.js.map +1 -1
  24. package/dist-lib/components/ui/Checkbox.js +60 -69
  25. package/dist-lib/components/ui/Checkbox.js.map +1 -1
  26. package/dist-lib/components/ui/Combobox.js +179 -192
  27. package/dist-lib/components/ui/Combobox.js.map +1 -1
  28. package/dist-lib/components/ui/CommandPalette.d.ts +2 -2
  29. package/dist-lib/components/ui/CommandPalette.js +106 -167
  30. package/dist-lib/components/ui/CommandPalette.js.map +1 -1
  31. package/dist-lib/components/ui/ContextMenu.d.ts +1 -1
  32. package/dist-lib/components/ui/ContextMenu.js +89 -154
  33. package/dist-lib/components/ui/ContextMenu.js.map +1 -1
  34. package/dist-lib/components/ui/DataGrid.d.ts +1 -1
  35. package/dist-lib/components/ui/DataGrid.js +99 -96
  36. package/dist-lib/components/ui/DataGrid.js.map +1 -1
  37. package/dist-lib/components/ui/DatePicker.js +151 -188
  38. package/dist-lib/components/ui/DatePicker.js.map +1 -1
  39. package/dist-lib/components/ui/DesignSystemProvider.d.ts +1 -1
  40. package/dist-lib/components/ui/DesignSystemProvider.js +120 -130
  41. package/dist-lib/components/ui/DesignSystemProvider.js.map +1 -1
  42. package/dist-lib/components/ui/Dialog.d.ts +3 -3
  43. package/dist-lib/components/ui/Dialog.js +108 -156
  44. package/dist-lib/components/ui/Dialog.js.map +1 -1
  45. package/dist-lib/components/ui/Drawer.d.ts +3 -3
  46. package/dist-lib/components/ui/Drawer.js +90 -124
  47. package/dist-lib/components/ui/Drawer.js.map +1 -1
  48. package/dist-lib/components/ui/DropdownMenu.d.ts +1 -1
  49. package/dist-lib/components/ui/DropdownMenu.js +92 -158
  50. package/dist-lib/components/ui/DropdownMenu.js.map +1 -1
  51. package/dist-lib/components/ui/EmptyState.js +31 -44
  52. package/dist-lib/components/ui/EmptyState.js.map +1 -1
  53. package/dist-lib/components/ui/ErrorState.js +57 -67
  54. package/dist-lib/components/ui/ErrorState.js.map +1 -1
  55. package/dist-lib/components/ui/FileUpload.js +113 -107
  56. package/dist-lib/components/ui/FileUpload.js.map +1 -1
  57. package/dist-lib/components/ui/Form.d.ts +6 -4
  58. package/dist-lib/components/ui/Form.js +117 -122
  59. package/dist-lib/components/ui/Form.js.map +1 -1
  60. package/dist-lib/components/ui/Icon.d.ts +1 -1
  61. package/dist-lib/components/ui/Icon.js +30 -29
  62. package/dist-lib/components/ui/Icon.js.map +1 -1
  63. package/dist-lib/components/ui/IconButton.js +61 -63
  64. package/dist-lib/components/ui/IconButton.js.map +1 -1
  65. package/dist-lib/components/ui/Input.js +133 -156
  66. package/dist-lib/components/ui/Input.js.map +1 -1
  67. package/dist-lib/components/ui/Kbd.js +14 -21
  68. package/dist-lib/components/ui/Kbd.js.map +1 -1
  69. package/dist-lib/components/ui/MultiSelect.js +176 -208
  70. package/dist-lib/components/ui/MultiSelect.js.map +1 -1
  71. package/dist-lib/components/ui/Pagination.js +152 -149
  72. package/dist-lib/components/ui/Pagination.js.map +1 -1
  73. package/dist-lib/components/ui/Popover.js +18 -33
  74. package/dist-lib/components/ui/Popover.js.map +1 -1
  75. package/dist-lib/components/ui/Progress.js +77 -99
  76. package/dist-lib/components/ui/Progress.js.map +1 -1
  77. package/dist-lib/components/ui/RadioGroup.js +51 -80
  78. package/dist-lib/components/ui/RadioGroup.js.map +1 -1
  79. package/dist-lib/components/ui/RelativeTime.js +22 -29
  80. package/dist-lib/components/ui/RelativeTime.js.map +1 -1
  81. package/dist-lib/components/ui/ScrollArea.js +39 -58
  82. package/dist-lib/components/ui/ScrollArea.js.map +1 -1
  83. package/dist-lib/components/ui/Select.js +108 -131
  84. package/dist-lib/components/ui/Select.js.map +1 -1
  85. package/dist-lib/components/ui/Separator.js +18 -24
  86. package/dist-lib/components/ui/Separator.js.map +1 -1
  87. package/dist-lib/components/ui/Sheet.d.ts +2 -2
  88. package/dist-lib/components/ui/Sheet.js +77 -129
  89. package/dist-lib/components/ui/Sheet.js.map +1 -1
  90. package/dist-lib/components/ui/Sidebar.d.ts +1 -1
  91. package/dist-lib/components/ui/Sidebar.js +168 -207
  92. package/dist-lib/components/ui/Sidebar.js.map +1 -1
  93. package/dist-lib/components/ui/Skeleton.js +17 -27
  94. package/dist-lib/components/ui/Skeleton.js.map +1 -1
  95. package/dist-lib/components/ui/Slider.js +45 -62
  96. package/dist-lib/components/ui/Slider.js.map +1 -1
  97. package/dist-lib/components/ui/Snackbar.js +75 -55
  98. package/dist-lib/components/ui/Snackbar.js.map +1 -1
  99. package/dist-lib/components/ui/Spinner.js +45 -52
  100. package/dist-lib/components/ui/Spinner.js.map +1 -1
  101. package/dist-lib/components/ui/Stepper.js +56 -108
  102. package/dist-lib/components/ui/Stepper.js.map +1 -1
  103. package/dist-lib/components/ui/Switch.js +46 -79
  104. package/dist-lib/components/ui/Switch.js.map +1 -1
  105. package/dist-lib/components/ui/Table.js +108 -169
  106. package/dist-lib/components/ui/Table.js.map +1 -1
  107. package/dist-lib/components/ui/Tabs.js +57 -88
  108. package/dist-lib/components/ui/Tabs.js.map +1 -1
  109. package/dist-lib/components/ui/TagInput.js +76 -109
  110. package/dist-lib/components/ui/TagInput.js.map +1 -1
  111. package/dist-lib/components/ui/Textarea.js +74 -86
  112. package/dist-lib/components/ui/Textarea.js.map +1 -1
  113. package/dist-lib/components/ui/Timeline.d.ts +3 -3
  114. package/dist-lib/components/ui/Timeline.js +61 -49
  115. package/dist-lib/components/ui/Timeline.js.map +1 -1
  116. package/dist-lib/components/ui/Toast.d.ts +1 -1
  117. package/dist-lib/components/ui/Toast.js +136 -150
  118. package/dist-lib/components/ui/Toast.js.map +1 -1
  119. package/dist-lib/components/ui/Tooltip.d.ts +2 -2
  120. package/dist-lib/components/ui/Tooltip.js +35 -56
  121. package/dist-lib/components/ui/Tooltip.js.map +1 -1
  122. package/dist-lib/components/ui/TopNav.js +46 -66
  123. package/dist-lib/components/ui/TopNav.js.map +1 -1
  124. package/dist-lib/components/ui/Tree.js +134 -168
  125. package/dist-lib/components/ui/Tree.js.map +1 -1
  126. package/dist-lib/hooks/use-debounce.js +27 -33
  127. package/dist-lib/hooks/use-debounce.js.map +1 -1
  128. package/dist-lib/hooks/use-delayed-loading.js +19 -18
  129. package/dist-lib/hooks/use-delayed-loading.js.map +1 -1
  130. package/dist-lib/hooks/use-field-ids.js +14 -16
  131. package/dist-lib/hooks/use-field-ids.js.map +1 -1
  132. package/dist-lib/hooks/use-media-query.js +15 -19
  133. package/dist-lib/hooks/use-media-query.js.map +1 -1
  134. package/dist-lib/hooks/use-modifier-key.js +20 -15
  135. package/dist-lib/hooks/use-modifier-key.js.map +1 -1
  136. package/dist-lib/hooks/use-strings.js +10 -10
  137. package/dist-lib/hooks/use-strings.js.map +1 -1
  138. package/dist-lib/hooks/use-toast.js +73 -62
  139. package/dist-lib/hooks/use-toast.js.map +1 -1
  140. package/dist-lib/icon.js +2 -6
  141. package/dist-lib/icons/index.js +166 -163
  142. package/dist-lib/icons/index.js.map +1 -1
  143. package/dist-lib/illustrations/index.d.ts +7 -7
  144. package/dist-lib/illustrations/index.js +255 -106
  145. package/dist-lib/illustrations/index.js.map +1 -1
  146. package/dist-lib/index.js +69 -291
  147. package/dist-lib/lib/cva.js +2 -0
  148. package/dist-lib/lib/format.js +71 -87
  149. package/dist-lib/lib/format.js.map +1 -1
  150. package/dist-lib/lib/return-focus.js +11 -11
  151. package/dist-lib/lib/return-focus.js.map +1 -1
  152. package/dist-lib/lib/strings.js +167 -135
  153. package/dist-lib/lib/strings.js.map +1 -1
  154. package/dist-lib/lib/strings.mn.js +150 -113
  155. package/dist-lib/lib/strings.mn.js.map +1 -1
  156. package/dist-lib/lib/utils.js +9 -9
  157. package/dist-lib/lib/utils.js.map +1 -1
  158. package/dist-lib/styles.css +3 -1
  159. package/package.json +50 -50
  160. package/dist-lib/__tests__/helpers/color.d.ts +0 -9
  161. package/dist-lib/__tests__/helpers/theme.d.ts +0 -18
  162. package/dist-lib/icon.js.map +0 -1
  163. package/dist-lib/index.js.map +0 -1
@@ -1,135 +1,133 @@
1
1
  "use client";
2
- import { jsx as c, jsxs as p } from "react/jsx-runtime";
3
- import { forwardRef as x } from "react";
4
- import { Slot as h } from "@radix-ui/react-slot";
5
- import { Loader2 as k } from "../../icons/index.js";
6
- import { cn as y } from "../../lib/utils.js";
7
- import { cva as z } from "class-variance-authority";
8
- const _ = z(
9
- [
10
- "inline-flex items-center justify-center gap-2 whitespace-nowrap",
11
- "rounded-md text-sm font-medium",
12
- "transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]",
13
- "outline-none",
14
- "focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
15
- "focus-visible:ring-offset-background",
16
- "disabled:pointer-events-none disabled:opacity-50",
17
- // Loading keeps focus (no `disabled`) but blocks interaction.
18
- "aria-busy:pointer-events-none",
19
- "[&_svg]:pointer-events-none [&_svg]:shrink-0"
20
- ],
21
- {
22
- variants: {
23
- variant: {
24
- primary: ["bg-accent text-on-accent", "hover:bg-accent-hover", "active:bg-accent-active"],
25
- // A button carries its own label, so its edge is not what identifies it:
26
- // WCAG 1.4.11 asks for 3:1 only where the boundary is the sole cue
27
- // (fields, checkbox, radio). --border-strong keeps the shape without
28
- // eight dark rectangles in a toolbar; prefers-contrast: more darkens it.
29
- secondary: [
30
- "bg-background-muted text-foreground border border-border-strong",
31
- "hover:bg-surface-hover",
32
- "active:bg-surface-active"
33
- ],
34
- outline: [
35
- "border border-border-strong bg-transparent text-foreground",
36
- "hover:bg-background-muted",
37
- "active:bg-background-subtle"
38
- ],
39
- ghost: [
40
- "bg-transparent text-foreground",
41
- "hover:bg-background-muted",
42
- "active:bg-background-subtle"
43
- ],
44
- destructive: [
45
- "bg-danger text-on-danger",
46
- "hover:bg-danger-hover",
47
- "active:bg-danger-active"
48
- ],
49
- link: [
50
- "bg-transparent text-accent underline-offset-4 px-0",
51
- "hover:underline",
52
- "active:text-accent-hover"
53
- ]
54
- },
55
- size: {
56
- sm: "h-8 px-3 text-xs [&_svg]:size-4",
57
- md: "h-9 px-3.5 text-sm [&_svg]:size-4",
58
- lg: "h-10 px-4 text-sm [&_svg]:size-5",
59
- // 44px — touch-first screens and marketing CTAs.
60
- xl: "h-11 px-5 text-base [&_svg]:size-5",
61
- icon: "h-9 w-9 [&_svg]:size-4"
62
- }
63
- },
64
- compoundVariants: [
65
- // The `link` variant ignores horizontal padding from the size variant.
66
- { variant: "link", size: "sm", class: "h-auto px-0" },
67
- { variant: "link", size: "md", class: "h-auto px-0" },
68
- { variant: "link", size: "lg", class: "h-auto px-0" },
69
- { variant: "link", size: "xl", class: "h-auto px-0" }
70
- ],
71
- defaultVariants: {
72
- variant: "primary",
73
- size: "md"
74
- }
75
- }
76
- ), w = x(function({
77
- className: u,
78
- variant: v,
79
- size: d,
80
- asChild: b = !1,
81
- loading: e = !1,
82
- leadingIcon: g,
83
- trailingIcon: l,
84
- disabled: f,
85
- children: a,
86
- type: m = "button",
87
- onClick: n,
88
- ...o
89
- }, i) {
90
- const s = y(_({ variant: v, size: d }), u);
91
- return b ? /* @__PURE__ */ c(
92
- h,
93
- {
94
- ref: i,
95
- "aria-busy": e || void 0,
96
- "aria-disabled": e || void 0,
97
- "data-loading": e || void 0,
98
- className: s,
99
- onClick: n,
100
- onClickCapture: e ? r : void 0,
101
- onKeyDownCapture: e ? N : void 0,
102
- ...o,
103
- children: a
104
- }
105
- ) : /* @__PURE__ */ p(
106
- "button",
107
- {
108
- ref: i,
109
- type: m,
110
- "aria-busy": e || void 0,
111
- "aria-disabled": e || void 0,
112
- disabled: f,
113
- "data-loading": e || void 0,
114
- className: s,
115
- onClick: e ? r : n,
116
- ...o,
117
- children: [
118
- e ? /* @__PURE__ */ c(k, { className: "animate-spin", "aria-hidden": "true" }) : g,
119
- a,
120
- !e && l
121
- ]
122
- }
123
- );
2
+ import { cn as e } from "../../lib/utils.js";
3
+ import { cva as t } from "../../lib/cva.js";
4
+ import { Loader2 as n } from "../../icons/index.js";
5
+ import { forwardRef as r } from "react";
6
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
+ import { Slot as o } from "@radix-ui/react-slot";
8
+ //#region src/components/ui/Button.tsx
9
+ var s = t([
10
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap",
11
+ "rounded-md text-sm font-medium",
12
+ "transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]",
13
+ "outline-none",
14
+ "focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
15
+ "focus-visible:ring-offset-background",
16
+ "disabled:pointer-events-none disabled:opacity-50",
17
+ "aria-busy:pointer-events-none",
18
+ "[&_svg]:pointer-events-none [&_svg]:shrink-0"
19
+ ], {
20
+ variants: {
21
+ variant: {
22
+ primary: [
23
+ "bg-accent text-on-accent",
24
+ "hover:bg-accent-hover",
25
+ "active:bg-accent-active"
26
+ ],
27
+ secondary: [
28
+ "bg-background-muted text-foreground border border-border-strong",
29
+ "hover:bg-surface-hover",
30
+ "active:bg-surface-active"
31
+ ],
32
+ outline: [
33
+ "border border-border-strong bg-transparent text-foreground",
34
+ "hover:bg-background-muted",
35
+ "active:bg-background-subtle"
36
+ ],
37
+ ghost: [
38
+ "bg-transparent text-foreground",
39
+ "hover:bg-background-muted",
40
+ "active:bg-background-subtle"
41
+ ],
42
+ destructive: [
43
+ "bg-danger text-on-danger",
44
+ "hover:bg-danger-hover",
45
+ "active:bg-danger-active"
46
+ ],
47
+ link: [
48
+ "bg-transparent text-accent underline-offset-4 px-0",
49
+ "hover:underline",
50
+ "active:text-accent-hover"
51
+ ]
52
+ },
53
+ size: {
54
+ sm: "h-8 px-3 text-xs [&_svg]:size-4",
55
+ md: "h-9 px-3.5 text-sm [&_svg]:size-4",
56
+ lg: "h-10 px-4 text-sm [&_svg]:size-5",
57
+ xl: "h-11 px-5 text-base [&_svg]:size-5",
58
+ icon: "h-9 w-9 [&_svg]:size-4"
59
+ }
60
+ },
61
+ compoundVariants: [
62
+ {
63
+ variant: "link",
64
+ size: "sm",
65
+ class: "h-auto px-0"
66
+ },
67
+ {
68
+ variant: "link",
69
+ size: "md",
70
+ class: "h-auto px-0"
71
+ },
72
+ {
73
+ variant: "link",
74
+ size: "lg",
75
+ class: "h-auto px-0"
76
+ },
77
+ {
78
+ variant: "link",
79
+ size: "xl",
80
+ class: "h-auto px-0"
81
+ }
82
+ ],
83
+ defaultVariants: {
84
+ variant: "primary",
85
+ size: "md"
86
+ }
87
+ }), c = r(function({ className: t, variant: r, size: c, asChild: d = !1, loading: f = !1, leadingIcon: p, trailingIcon: m, disabled: h, children: g, type: _ = "button", onClick: v, ...y }, b) {
88
+ let x = e(s({
89
+ variant: r,
90
+ size: c
91
+ }), t);
92
+ return d ? /* @__PURE__ */ i(o, {
93
+ ref: b,
94
+ "aria-busy": f || void 0,
95
+ "aria-disabled": f || void 0,
96
+ "data-loading": f || void 0,
97
+ className: x,
98
+ onClick: v,
99
+ onClickCapture: f ? l : void 0,
100
+ onKeyDownCapture: f ? u : void 0,
101
+ ...y,
102
+ children: g
103
+ }) : /* @__PURE__ */ a("button", {
104
+ ref: b,
105
+ type: _,
106
+ "aria-busy": f || void 0,
107
+ "aria-disabled": f || void 0,
108
+ disabled: h,
109
+ "data-loading": f || void 0,
110
+ className: x,
111
+ onClick: f ? l : v,
112
+ ...y,
113
+ children: [
114
+ f ? /* @__PURE__ */ i(n, {
115
+ className: "animate-spin",
116
+ "aria-hidden": "true"
117
+ }) : p,
118
+ g,
119
+ !f && m
120
+ ]
121
+ });
124
122
  });
125
- w.displayName = "Button";
126
- function r(t) {
127
- t.preventDefault(), t.stopPropagation();
123
+ c.displayName = "Button";
124
+ function l(e) {
125
+ e.preventDefault(), e.stopPropagation();
128
126
  }
129
- function N(t) {
130
- (t.key === "Enter" || t.key === " ") && r(t);
127
+ function u(e) {
128
+ (e.key === "Enter" || e.key === " ") && l(e);
131
129
  }
132
- export {
133
- w as Button
134
- };
135
- //# sourceMappingURL=Button.js.map
130
+ //#endregion
131
+ export { c as Button };
132
+
133
+ //# sourceMappingURL=Button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sources":["../../../src/components/ui/Button.tsx"],"sourcesContent":["'use client';\n\nimport {\n forwardRef,\n type ButtonHTMLAttributes,\n type MouseEvent,\n type ReactNode,\n type SyntheticEvent,\n} from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { Loader2 } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { cva, type VariantProps } from '@/lib/cva';\n\n/* -----------------------------------------------------------------------------\n * Variants — the entire visual surface of the Button.\n *\n * All sizes share the same border radius (md = 6px) per the refined-minimal\n * rules. Focus state is the standardised 2px-ring + 2px-offset on every\n * variant, including `link`.\n * --------------------------------------------------------------------------- */\nconst button = cva(\n [\n 'inline-flex items-center justify-center gap-2 whitespace-nowrap',\n 'rounded-md text-sm font-medium',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'outline-none',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',\n 'focus-visible:ring-offset-background',\n 'disabled:pointer-events-none disabled:opacity-50',\n // Loading keeps focus (no `disabled`) but blocks interaction.\n 'aria-busy:pointer-events-none',\n '[&_svg]:pointer-events-none [&_svg]:shrink-0',\n ],\n {\n variants: {\n variant: {\n primary: ['bg-accent text-on-accent', 'hover:bg-accent-hover', 'active:bg-accent-active'],\n // A button carries its own label, so its edge is not what identifies it:\n // WCAG 1.4.11 asks for 3:1 only where the boundary is the sole cue\n // (fields, checkbox, radio). --border-strong keeps the shape without\n // eight dark rectangles in a toolbar; prefers-contrast: more darkens it.\n secondary: [\n 'bg-background-muted text-foreground border border-border-strong',\n 'hover:bg-surface-hover',\n 'active:bg-surface-active',\n ],\n outline: [\n 'border border-border-strong bg-transparent text-foreground',\n 'hover:bg-background-muted',\n 'active:bg-background-subtle',\n ],\n ghost: [\n 'bg-transparent text-foreground',\n 'hover:bg-background-muted',\n 'active:bg-background-subtle',\n ],\n destructive: [\n 'bg-danger text-on-danger',\n 'hover:bg-danger-hover',\n 'active:bg-danger-active',\n ],\n link: [\n 'bg-transparent text-accent underline-offset-4 px-0',\n 'hover:underline',\n 'active:text-accent-hover',\n ],\n },\n size: {\n sm: 'h-8 px-3 text-xs [&_svg]:size-4',\n md: 'h-9 px-3.5 text-sm [&_svg]:size-4',\n lg: 'h-10 px-4 text-sm [&_svg]:size-5',\n // 44px — touch-first screens and marketing CTAs.\n xl: 'h-11 px-5 text-base [&_svg]:size-5',\n icon: 'h-9 w-9 [&_svg]:size-4',\n },\n },\n compoundVariants: [\n // The `link` variant ignores horizontal padding from the size variant.\n { variant: 'link', size: 'sm', class: 'h-auto px-0' },\n { variant: 'link', size: 'md', class: 'h-auto px-0' },\n { variant: 'link', size: 'lg', class: 'h-auto px-0' },\n { variant: 'link', size: 'xl', class: 'h-auto px-0' },\n ],\n defaultVariants: {\n variant: 'primary',\n size: 'md',\n },\n },\n);\n\nexport interface ButtonProps\n extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof button> {\n /**\n * Render as a different element via Radix Slot. Useful when wrapping a\n * link: `<Button asChild><a href=\"…\">…</a></Button>`.\n * @default false\n */\n asChild?: boolean;\n /**\n * Show a spinner in place of the leading icon and block interaction while\n * keeping keyboard focus (`aria-disabled` + `aria-busy`, not `disabled`, so\n * focus is not lost mid-submit). With `asChild` no spinner is rendered —\n * the child is only marked busy and made inert.\n * @default false\n */\n loading?: boolean;\n /** Icon rendered before the label. Replaced by a spinner when loading. */\n leadingIcon?: ReactNode;\n /** Icon rendered after the label. Hidden while loading. */\n trailingIcon?: ReactNode;\n}\n\n/**\n * Primary interactive element. Variants:\n *\n * - `primary` — accent fill, the single most prominent action on a screen.\n * - `secondary` — neutral fill, sits next to a primary or stands alone for\n * secondary actions.\n * - `outline` — border only, transparent fill. Use when next to a primary.\n * - `ghost` — no border, hover background. Use in dense toolbars and tables.\n * - `destructive` — danger fill, reserved for irreversible actions.\n * - `link` — text styled as a link.\n *\n * @example Two-button row\n * <div className=\"flex gap-2 justify-end\">\n * <Button variant=\"outline\">Cancel</Button>\n * <Button>Save changes</Button>\n * </div>\n *\n * @example Loading state\n * <Button loading leadingIcon={<Mail />}>Sending…</Button>\n *\n * @do Use one primary button per major surface. Verb-first labels.\n * @dont Stack three primary buttons in a row — only the most important\n * action gets the primary variant.\n */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n className,\n variant,\n size,\n asChild = false,\n loading = false,\n leadingIcon,\n trailingIcon,\n disabled,\n children,\n type = 'button',\n onClick,\n ...props\n },\n ref,\n) {\n const classes = cn(button({ variant, size }), className);\n\n if (asChild) {\n // Slot requires exactly one element child — pass the consumer's element\n // through untouched. The consumer is responsible for any leading/trailing\n // icons inside that element. While loading, a capture-phase guard stops\n // the child's own handlers (and link navigation) before they run.\n return (\n <Slot\n ref={ref}\n aria-busy={loading || undefined}\n aria-disabled={loading || undefined}\n data-loading={loading || undefined}\n className={classes}\n onClick={onClick}\n onClickCapture={loading ? blockEvent : undefined}\n onKeyDownCapture={loading ? blockActivationKey : undefined}\n {...props}\n >\n {children}\n </Slot>\n );\n }\n\n return (\n <button\n ref={ref}\n type={type}\n aria-busy={loading || undefined}\n aria-disabled={loading || undefined}\n disabled={disabled}\n data-loading={loading || undefined}\n className={classes}\n onClick={loading ? blockEvent : onClick}\n {...props}\n >\n {loading ? <Loader2 className=\"animate-spin\" aria-hidden=\"true\" /> : leadingIcon}\n {children}\n {!loading && trailingIcon}\n </button>\n );\n});\n\nButton.displayName = 'Button';\n\nfunction blockEvent(e: SyntheticEvent | MouseEvent) {\n e.preventDefault();\n e.stopPropagation();\n}\n\nfunction blockActivationKey(e: React.KeyboardEvent) {\n if (e.key === 'Enter' || e.key === ' ') blockEvent(e);\n}\n"],"names":["button","cva","Button","forwardRef","className","variant","size","asChild","loading","leadingIcon","trailingIcon","disabled","children","type","onClick","props","ref","classes","cn","jsx","Slot","blockEvent","blockActivationKey","jsxs","Loader2","e"],"mappings":"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"}
1
+ {"version":3,"file":"Button.js","names":[],"sources":["../../../src/components/ui/Button.tsx"],"sourcesContent":["'use client';\n\nimport {\n forwardRef,\n type ButtonHTMLAttributes,\n type MouseEvent,\n type ReactNode,\n type SyntheticEvent,\n} from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { Loader2 } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { cva, type VariantProps } from '@/lib/cva';\n\n/* -----------------------------------------------------------------------------\n * Variants — the entire visual surface of the Button.\n *\n * All sizes share the same border radius (md = 6px) per the refined-minimal\n * rules. Focus state is the standardised 2px-ring + 2px-offset on every\n * variant, including `link`.\n * --------------------------------------------------------------------------- */\nconst button = cva(\n [\n 'inline-flex items-center justify-center gap-2 whitespace-nowrap',\n 'rounded-md text-sm font-medium',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'outline-none',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',\n 'focus-visible:ring-offset-background',\n 'disabled:pointer-events-none disabled:opacity-50',\n // Loading keeps focus (no `disabled`) but blocks interaction.\n 'aria-busy:pointer-events-none',\n '[&_svg]:pointer-events-none [&_svg]:shrink-0',\n ],\n {\n variants: {\n variant: {\n primary: ['bg-accent text-on-accent', 'hover:bg-accent-hover', 'active:bg-accent-active'],\n // A button carries its own label, so its edge is not what identifies it:\n // WCAG 1.4.11 asks for 3:1 only where the boundary is the sole cue\n // (fields, checkbox, radio). --border-strong keeps the shape without\n // eight dark rectangles in a toolbar; prefers-contrast: more darkens it.\n secondary: [\n 'bg-background-muted text-foreground border border-border-strong',\n 'hover:bg-surface-hover',\n 'active:bg-surface-active',\n ],\n outline: [\n 'border border-border-strong bg-transparent text-foreground',\n 'hover:bg-background-muted',\n 'active:bg-background-subtle',\n ],\n ghost: [\n 'bg-transparent text-foreground',\n 'hover:bg-background-muted',\n 'active:bg-background-subtle',\n ],\n destructive: [\n 'bg-danger text-on-danger',\n 'hover:bg-danger-hover',\n 'active:bg-danger-active',\n ],\n link: [\n 'bg-transparent text-accent underline-offset-4 px-0',\n 'hover:underline',\n 'active:text-accent-hover',\n ],\n },\n size: {\n sm: 'h-8 px-3 text-xs [&_svg]:size-4',\n md: 'h-9 px-3.5 text-sm [&_svg]:size-4',\n lg: 'h-10 px-4 text-sm [&_svg]:size-5',\n // 44px — touch-first screens and marketing CTAs.\n xl: 'h-11 px-5 text-base [&_svg]:size-5',\n icon: 'h-9 w-9 [&_svg]:size-4',\n },\n },\n compoundVariants: [\n // The `link` variant ignores horizontal padding from the size variant.\n { variant: 'link', size: 'sm', class: 'h-auto px-0' },\n { variant: 'link', size: 'md', class: 'h-auto px-0' },\n { variant: 'link', size: 'lg', class: 'h-auto px-0' },\n { variant: 'link', size: 'xl', class: 'h-auto px-0' },\n ],\n defaultVariants: {\n variant: 'primary',\n size: 'md',\n },\n },\n);\n\nexport interface ButtonProps\n extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof button> {\n /**\n * Render as a different element via Radix Slot. Useful when wrapping a\n * link: `<Button asChild><a href=\"…\">…</a></Button>`.\n * @default false\n */\n asChild?: boolean;\n /**\n * Show a spinner in place of the leading icon and block interaction while\n * keeping keyboard focus (`aria-disabled` + `aria-busy`, not `disabled`, so\n * focus is not lost mid-submit). With `asChild` no spinner is rendered —\n * the child is only marked busy and made inert.\n * @default false\n */\n loading?: boolean;\n /** Icon rendered before the label. Replaced by a spinner when loading. */\n leadingIcon?: ReactNode;\n /** Icon rendered after the label. Hidden while loading. */\n trailingIcon?: ReactNode;\n}\n\n/**\n * Primary interactive element. Variants:\n *\n * - `primary` — accent fill, the single most prominent action on a screen.\n * - `secondary` — neutral fill, sits next to a primary or stands alone for\n * secondary actions.\n * - `outline` — border only, transparent fill. Use when next to a primary.\n * - `ghost` — no border, hover background. Use in dense toolbars and tables.\n * - `destructive` — danger fill, reserved for irreversible actions.\n * - `link` — text styled as a link.\n *\n * @example Two-button row\n * <div className=\"flex gap-2 justify-end\">\n * <Button variant=\"outline\">Cancel</Button>\n * <Button>Save changes</Button>\n * </div>\n *\n * @example Loading state\n * <Button loading leadingIcon={<Mail />}>Sending…</Button>\n *\n * @do Use one primary button per major surface. Verb-first labels.\n * @dont Stack three primary buttons in a row — only the most important\n * action gets the primary variant.\n */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n className,\n variant,\n size,\n asChild = false,\n loading = false,\n leadingIcon,\n trailingIcon,\n disabled,\n children,\n type = 'button',\n onClick,\n ...props\n },\n ref,\n) {\n const classes = cn(button({ variant, size }), className);\n\n if (asChild) {\n // Slot requires exactly one element child — pass the consumer's element\n // through untouched. The consumer is responsible for any leading/trailing\n // icons inside that element. While loading, a capture-phase guard stops\n // the child's own handlers (and link navigation) before they run.\n return (\n <Slot\n ref={ref}\n aria-busy={loading || undefined}\n aria-disabled={loading || undefined}\n data-loading={loading || undefined}\n className={classes}\n onClick={onClick}\n onClickCapture={loading ? blockEvent : undefined}\n onKeyDownCapture={loading ? blockActivationKey : undefined}\n {...props}\n >\n {children}\n </Slot>\n );\n }\n\n return (\n <button\n ref={ref}\n type={type}\n aria-busy={loading || undefined}\n aria-disabled={loading || undefined}\n disabled={disabled}\n data-loading={loading || undefined}\n className={classes}\n onClick={loading ? blockEvent : onClick}\n {...props}\n >\n {loading ? <Loader2 className=\"animate-spin\" aria-hidden=\"true\" /> : leadingIcon}\n {children}\n {!loading && trailingIcon}\n </button>\n );\n});\n\nButton.displayName = 'Button';\n\nfunction blockEvent(e: SyntheticEvent | MouseEvent) {\n e.preventDefault();\n e.stopPropagation();\n}\n\nfunction blockActivationKey(e: React.KeyboardEvent) {\n if (e.key === 'Enter' || e.key === ' ') blockEvent(e);\n}\n"],"mappings":";;;;;;;;AAqBA,IAAM,IAAS,EACb;CACE;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;AACF,GACA;CACE,UAAU;EACR,SAAS;GACP,SAAS;IAAC;IAA4B;IAAyB;GAAyB;GAKxF,WAAW;IACT;IACA;IACA;GACF;GACA,SAAS;IACP;IACA;IACA;GACF;GACA,OAAO;IACL;IACA;IACA;GACF;GACA,aAAa;IACX;IACA;IACA;GACF;GACA,MAAM;IACJ;IACA;IACA;GACF;EACF;EACA,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GAEJ,IAAI;GACJ,MAAM;EACR;CACF;CACA,kBAAkB;EAEhB;GAAE,SAAS;GAAQ,MAAM;GAAM,OAAO;EAAc;EACpD;GAAE,SAAS;GAAQ,MAAM;GAAM,OAAO;EAAc;EACpD;GAAE,SAAS;GAAQ,MAAM;GAAM,OAAO;EAAc;EACpD;GAAE,SAAS;GAAQ,MAAM;GAAM,OAAO;EAAc;CACtD;CACA,iBAAiB;EACf,SAAS;EACT,MAAM;CACR;AACF,CACF,GAgDa,IAAS,EAA2C,SAC/D,EACE,cACA,YACA,SACA,aAAU,IACV,aAAU,IACV,gBACA,iBACA,aACA,aACA,UAAO,UACP,YACA,GAAG,KAEL,GACA;CACA,IAAM,IAAU,EAAG,EAAO;EAAE;EAAS;CAAK,CAAC,GAAG,CAAS;CAwBvD,OAtBI,IAMA,kBAAC,GAAD;EACO;EACL,aAAW,KAAW,KAAA;EACtB,iBAAe,KAAW,KAAA;EAC1B,gBAAc,KAAW,KAAA;EACzB,WAAW;EACF;EACT,gBAAgB,IAAU,IAAa,KAAA;EACvC,kBAAkB,IAAU,IAAqB,KAAA;EACjD,GAAI;EAEH;CACG,CAAA,IAKR,kBAAC,UAAD;EACO;EACC;EACN,aAAW,KAAW,KAAA;EACtB,iBAAe,KAAW,KAAA;EAChB;EACV,gBAAc,KAAW,KAAA;EACzB,WAAW;EACX,SAAS,IAAU,IAAa;EAChC,GAAI;EATN,UAAA;GAWG,IAAU,kBAAC,GAAD;IAAS,WAAU;IAAe,eAAY;GAAQ,CAAA,IAAI;GACpE;GACA,CAAC,KAAW;EACP;;AAEZ,CAAC;AAED,EAAO,cAAc;AAErB,SAAS,EAAW,GAAgC;CAElD,AADA,EAAE,eAAe,GACjB,EAAE,gBAAgB;AACpB;AAEA,SAAS,EAAmB,GAAwB;CAClD,CAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,QAAK,EAAW,CAAC;AACtD"}
@@ -9,7 +9,7 @@ export type CalendarProps = DayPickerProps & {
9
9
  * Not a forwardRef: RDP v9's `DayPicker` is a plain function component and
10
10
  * exposes no root ref, so a forwarded ref would silently be dropped.
11
11
  */
12
- export declare function Calendar({ className, classNames, captionLayout, startMonth, endMonth, labels, weekStartsOn, ...props }: CalendarProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare function Calendar({ className, classNames, captionLayout, startMonth, endMonth, labels, weekStartsOn, ...props }: CalendarProps): import("react").JSX.Element;
13
13
  export declare namespace Calendar {
14
14
  var displayName: string;
15
15
  }
@@ -1,139 +1,102 @@
1
1
  "use client";
2
- import { jsx as t, jsxs as b } from "react/jsx-runtime";
3
- import { useMemo as x } from "react";
4
- import { DayPicker as w, getDefaultClassNames as _ } from "react-day-picker";
5
- import * as u from "@radix-ui/react-select";
6
- import { ChevronLeft as y, ChevronRight as N, ChevronDown as g } from "../../icons/index.js";
7
- import { Select as k, SelectContent as D, SelectItem as j } from "./Select.js";
8
- import { cn as n } from "../../lib/utils.js";
9
- import { useStrings as C } from "../../hooks/use-strings.js";
10
- const f = _();
11
- function S({
12
- options: l = [],
13
- value: r,
14
- onChange: o,
15
- disabled: d,
16
- "aria-label": c
17
- }) {
18
- const i = l.find((e) => e.value === Number(r));
19
- return /* @__PURE__ */ b(
20
- k,
21
- {
22
- value: r === void 0 ? void 0 : String(r),
23
- onValueChange: (e) => {
24
- o == null || o({ target: { value: e } });
25
- },
26
- disabled: d,
27
- children: [
28
- /* @__PURE__ */ b(
29
- u.Trigger,
30
- {
31
- "aria-label": c,
32
- className: n(
33
- "border-border bg-card text-foreground inline-flex h-7 items-center gap-1 rounded-md border px-2 text-sm font-medium",
34
- "hover:bg-background-muted focus-visible:ring-ring focus-visible:ring-offset-background outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
35
- "disabled:pointer-events-none disabled:opacity-50"
36
- ),
37
- children: [
38
- /* @__PURE__ */ t(u.Value, { children: i == null ? void 0 : i.label }),
39
- /* @__PURE__ */ t(u.Icon, { asChild: !0, children: /* @__PURE__ */ t(g, { className: "size-3.5 opacity-60", "aria-hidden": !0 }) })
40
- ]
41
- }
42
- ),
43
- /* @__PURE__ */ t(D, { className: "max-h-64", children: l.map((e) => /* @__PURE__ */ t(j, { value: String(e.value), disabled: e.disabled, children: e.label }, e.value)) })
44
- ]
45
- }
46
- );
2
+ import { cn as e } from "../../lib/utils.js";
3
+ import { useStrings as t } from "../../hooks/use-strings.js";
4
+ import { ChevronDown as n, ChevronLeft as r, ChevronRight as i } from "../../icons/index.js";
5
+ import { Select as a, SelectContent as o, SelectItem as s } from "./Select.js";
6
+ import { useMemo as c } from "react";
7
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
8
+ import { DayPicker as d, getDefaultClassNames as f } from "react-day-picker";
9
+ import * as p from "@radix-ui/react-select";
10
+ //#region src/components/ui/Calendar.tsx
11
+ var m = f();
12
+ function h({ options: t = [], value: r, onChange: i, disabled: c, "aria-label": d }) {
13
+ let f = t.find((e) => e.value === Number(r));
14
+ return /* @__PURE__ */ u(a, {
15
+ value: r === void 0 ? void 0 : String(r),
16
+ onValueChange: (e) => {
17
+ i?.({ target: { value: e } });
18
+ },
19
+ disabled: c,
20
+ children: [/* @__PURE__ */ u(p.Trigger, {
21
+ "aria-label": d,
22
+ className: e("border-border bg-card text-foreground inline-flex h-7 items-center gap-1 rounded-md border px-2 text-sm font-medium", "hover:bg-background-muted focus-visible:ring-ring focus-visible:ring-offset-background outline-none focus-visible:ring-2 focus-visible:ring-offset-2", "disabled:pointer-events-none disabled:opacity-50"),
23
+ children: [/* @__PURE__ */ l(p.Value, { children: f?.label }), /* @__PURE__ */ l(p.Icon, {
24
+ asChild: !0,
25
+ children: /* @__PURE__ */ l(n, {
26
+ className: "size-3.5 opacity-60",
27
+ "aria-hidden": !0
28
+ })
29
+ })]
30
+ }), /* @__PURE__ */ l(o, {
31
+ className: "max-h-64",
32
+ children: t.map((e) => /* @__PURE__ */ l(s, {
33
+ value: String(e.value),
34
+ disabled: e.disabled,
35
+ children: e.label
36
+ }, e.value))
37
+ })]
38
+ });
47
39
  }
48
- const m = n(
49
- "pointer-events-auto inline-flex h-7 w-7 items-center justify-center rounded-md text-foreground-muted hover:bg-background-muted",
50
- "outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
51
- "disabled:opacity-40 disabled:pointer-events-none"
52
- );
53
- function z({
54
- className: l,
55
- classNames: r,
56
- captionLayout: o = "dropdown",
57
- startMonth: d,
58
- endMonth: c,
59
- labels: i,
60
- weekStartsOn: e = 1,
61
- ...v
62
- }) {
63
- const s = C(), { start: p, end: h } = x(() => {
64
- const a = /* @__PURE__ */ new Date();
65
- return {
66
- start: d ?? new Date(a.getFullYear() - 100, 0, 1),
67
- end: c ?? new Date(a.getFullYear() + 10, 11, 31)
68
- };
69
- }, [d, c]);
70
- return /* @__PURE__ */ t(
71
- w,
72
- {
73
- showOutsideDays: !0,
74
- weekStartsOn: e,
75
- captionLayout: o,
76
- startMonth: p,
77
- endMonth: h,
78
- className: n("border-border bg-card inline-block rounded-lg border p-3", l),
79
- labels: {
80
- labelPrevious: () => s.calendar.previous,
81
- labelNext: () => s.calendar.next,
82
- labelMonthDropdown: () => s.calendar.chooseMonth,
83
- labelYearDropdown: () => s.calendar.chooseYear,
84
- labelNav: () => s.calendar.nav,
85
- ...i
86
- },
87
- classNames: {
88
- ...f,
89
- root: n(f.root, "relative"),
90
- months: "relative flex flex-col gap-4 sm:flex-row sm:gap-6",
91
- month: "flex flex-col gap-3",
92
- month_caption: "relative flex h-8 items-center justify-center px-8",
93
- dropdowns: "flex items-center justify-center gap-2",
94
- caption_label: "flex items-center gap-1 text-sm font-medium",
95
- // The caption is positioned and painted after the nav, so the nav must
96
- // sit above it (z-10) for its buttons to receive clicks. The container
97
- // itself ignores pointer events so the centred dropdowns underneath
98
- // stay clickable — only the buttons opt back in.
99
- nav: "pointer-events-none absolute inset-x-0 top-0 z-10 flex h-8 items-center justify-between",
100
- button_previous: m,
101
- button_next: m,
102
- month_grid: "w-full border-collapse",
103
- weekdays: "grid grid-cols-7",
104
- weekday: "h-8 w-9 text-center text-xs font-medium uppercase tracking-wide text-foreground-subtle",
105
- week: "mt-0.5 grid grid-cols-7",
106
- day: "relative h-9 w-9 p-0 text-center",
107
- day_button: n(
108
- "inline-flex h-9 w-9 items-center justify-center rounded-md text-sm hover:bg-background-muted",
109
- "outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"
110
- ),
111
- // RDP 9 puts aria-selected / the modifier classes on the <td>, so the
112
- // button is styled through its cell. `[&_button:hover]` outranks the
113
- // button's own `hover:` rule so selected days keep the accent on hover.
114
- selected: n(
115
- "[&_button]:bg-accent [&_button]:text-on-accent [&_button:hover]:bg-accent-hover",
116
- "[&_button]:focus-visible:ring-offset-accent-soft"
117
- ),
118
- today: "[&_button]:border [&_button]:border-border",
119
- outside: "text-foreground-subtle",
120
- disabled: "opacity-40 pointer-events-none",
121
- range_start: "[&_button]:rounded-r-none",
122
- range_end: "[&_button]:rounded-l-none",
123
- range_middle: "[&_button]:bg-accent-soft [&_button]:text-foreground [&_button:hover]:bg-accent-soft [&_button]:rounded-none",
124
- hidden: "invisible",
125
- ...r
126
- },
127
- components: {
128
- Dropdown: S,
129
- Chevron: ({ orientation: a }) => a === "left" ? /* @__PURE__ */ t(y, { className: "size-4" }) : a === "right" ? /* @__PURE__ */ t(N, { className: "size-4" }) : /* @__PURE__ */ t(g, { className: "size-3.5 opacity-60" })
130
- },
131
- ...v
132
- }
133
- );
40
+ var g = e("pointer-events-auto inline-flex h-7 w-7 items-center justify-center rounded-md text-foreground-muted hover:bg-background-muted", "outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background", "disabled:opacity-40 disabled:pointer-events-none");
41
+ function _({ className: a, classNames: o, captionLayout: s = "dropdown", startMonth: u, endMonth: f, labels: p, weekStartsOn: _ = 1, ...v }) {
42
+ let y = t(), { start: b, end: x } = c(() => {
43
+ let e = /* @__PURE__ */ new Date();
44
+ return {
45
+ start: u ?? new Date(e.getFullYear() - 100, 0, 1),
46
+ end: f ?? new Date(e.getFullYear() + 10, 11, 31)
47
+ };
48
+ }, [u, f]);
49
+ return /* @__PURE__ */ l(d, {
50
+ showOutsideDays: !0,
51
+ weekStartsOn: _,
52
+ captionLayout: s,
53
+ startMonth: b,
54
+ endMonth: x,
55
+ className: e("border-border bg-card inline-block rounded-lg border p-3", a),
56
+ labels: {
57
+ labelPrevious: () => y.calendar.previous,
58
+ labelNext: () => y.calendar.next,
59
+ labelMonthDropdown: () => y.calendar.chooseMonth,
60
+ labelYearDropdown: () => y.calendar.chooseYear,
61
+ labelNav: () => y.calendar.nav,
62
+ ...p
63
+ },
64
+ classNames: {
65
+ ...m,
66
+ root: e(m.root, "relative"),
67
+ months: "relative flex flex-col gap-4 sm:flex-row sm:gap-6",
68
+ month: "flex flex-col gap-3",
69
+ month_caption: "relative flex h-8 items-center justify-center px-8",
70
+ dropdowns: "flex items-center justify-center gap-2",
71
+ caption_label: "flex items-center gap-1 text-sm font-medium",
72
+ nav: "pointer-events-none absolute inset-x-0 top-0 z-10 flex h-8 items-center justify-between",
73
+ button_previous: g,
74
+ button_next: g,
75
+ month_grid: "w-full border-collapse",
76
+ weekdays: "grid grid-cols-7",
77
+ weekday: "h-8 w-9 text-center text-xs font-medium uppercase tracking-wide text-foreground-subtle",
78
+ week: "mt-0.5 grid grid-cols-7",
79
+ day: "relative h-9 w-9 p-0 text-center",
80
+ day_button: e("inline-flex h-9 w-9 items-center justify-center rounded-md text-sm hover:bg-background-muted", "outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"),
81
+ selected: e("[&_button]:bg-accent [&_button]:text-on-accent [&_button:hover]:bg-accent-hover", "[&_button]:focus-visible:ring-offset-accent-soft"),
82
+ today: "[&_button]:border [&_button]:border-border",
83
+ outside: "text-foreground-subtle",
84
+ disabled: "opacity-40 pointer-events-none",
85
+ range_start: "[&_button]:rounded-r-none",
86
+ range_end: "[&_button]:rounded-l-none",
87
+ range_middle: "[&_button]:bg-accent-soft [&_button]:text-foreground [&_button:hover]:bg-accent-soft [&_button]:rounded-none",
88
+ hidden: "invisible",
89
+ ...o
90
+ },
91
+ components: {
92
+ Dropdown: h,
93
+ Chevron: ({ orientation: e }) => e === "left" ? /* @__PURE__ */ l(r, { className: "size-4" }) : e === "right" ? /* @__PURE__ */ l(i, { className: "size-4" }) : /* @__PURE__ */ l(n, { className: "size-3.5 opacity-60" })
94
+ },
95
+ ...v
96
+ });
134
97
  }
135
- z.displayName = "Calendar";
136
- export {
137
- z as Calendar
138
- };
139
- //# sourceMappingURL=Calendar.js.map
98
+ _.displayName = "Calendar";
99
+ //#endregion
100
+ export { _ as Calendar };
101
+
102
+ //# sourceMappingURL=Calendar.js.map