ml-uikit 1.1.6 → 1.1.8

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 (287) hide show
  1. package/dist/components/ui/date-range-picker.d.ts +3 -0
  2. package/dist/components/ui/date-range-picker.d.ts.map +1 -1
  3. package/dist/components/ui/password-input.d.ts +9 -0
  4. package/dist/components/ui/password-input.d.ts.map +1 -0
  5. package/dist/components/ui/searchable-dropdown.d.ts +22 -0
  6. package/dist/components/ui/searchable-dropdown.d.ts.map +1 -0
  7. package/dist/components/ui/table.d.ts +5 -1
  8. package/dist/components/ui/table.d.ts.map +1 -1
  9. package/dist/index.cjs.js +1 -1
  10. package/dist/index.cjs10.js +1 -1
  11. package/dist/index.cjs10.js.map +1 -1
  12. package/dist/index.cjs11.js +1 -1
  13. package/dist/index.cjs11.js.map +1 -1
  14. package/dist/index.cjs12.js +1 -1
  15. package/dist/index.cjs12.js.map +1 -1
  16. package/dist/index.cjs13.js +1 -1
  17. package/dist/index.cjs13.js.map +1 -1
  18. package/dist/index.cjs14.js +1 -1
  19. package/dist/index.cjs14.js.map +1 -1
  20. package/dist/index.cjs15.js +1 -1
  21. package/dist/index.cjs15.js.map +1 -1
  22. package/dist/index.cjs16.js +4 -4
  23. package/dist/index.cjs16.js.map +1 -1
  24. package/dist/index.cjs17.js +1 -1
  25. package/dist/index.cjs17.js.map +1 -1
  26. package/dist/index.cjs19.js +1 -1
  27. package/dist/index.cjs19.js.map +1 -1
  28. package/dist/index.cjs2.js +1 -1
  29. package/dist/index.cjs2.js.map +1 -1
  30. package/dist/index.cjs20.js +1 -1
  31. package/dist/index.cjs20.js.map +1 -1
  32. package/dist/index.cjs21.js +1 -1
  33. package/dist/index.cjs21.js.map +1 -1
  34. package/dist/index.cjs22.js +1 -1
  35. package/dist/index.cjs22.js.map +1 -1
  36. package/dist/index.cjs23.js +1 -1
  37. package/dist/index.cjs23.js.map +1 -1
  38. package/dist/index.cjs24.js +1 -1
  39. package/dist/index.cjs24.js.map +1 -1
  40. package/dist/index.cjs25.js +1 -1
  41. package/dist/index.cjs25.js.map +1 -1
  42. package/dist/index.cjs26.js +1 -1
  43. package/dist/index.cjs26.js.map +1 -1
  44. package/dist/index.cjs27.js +1 -1
  45. package/dist/index.cjs27.js.map +1 -1
  46. package/dist/index.cjs28.js +1 -1
  47. package/dist/index.cjs28.js.map +1 -1
  48. package/dist/index.cjs29.js +1 -1
  49. package/dist/index.cjs29.js.map +1 -1
  50. package/dist/index.cjs3.js +1 -1
  51. package/dist/index.cjs3.js.map +1 -1
  52. package/dist/index.cjs30.js +1 -1
  53. package/dist/index.cjs30.js.map +1 -1
  54. package/dist/index.cjs31.js +1 -1
  55. package/dist/index.cjs31.js.map +1 -1
  56. package/dist/index.cjs32.js +1 -1
  57. package/dist/index.cjs32.js.map +1 -1
  58. package/dist/index.cjs33.js +1 -1
  59. package/dist/index.cjs33.js.map +1 -1
  60. package/dist/index.cjs34.js +1 -1
  61. package/dist/index.cjs34.js.map +1 -1
  62. package/dist/index.cjs35.js +1 -1
  63. package/dist/index.cjs35.js.map +1 -1
  64. package/dist/index.cjs36.js +1 -1
  65. package/dist/index.cjs36.js.map +1 -1
  66. package/dist/index.cjs37.js +1 -1
  67. package/dist/index.cjs37.js.map +1 -1
  68. package/dist/index.cjs38.js +1 -1
  69. package/dist/index.cjs38.js.map +1 -1
  70. package/dist/index.cjs39.js +1 -1
  71. package/dist/index.cjs39.js.map +1 -1
  72. package/dist/index.cjs4.js +1 -1
  73. package/dist/index.cjs4.js.map +1 -1
  74. package/dist/index.cjs40.js +1 -1
  75. package/dist/index.cjs40.js.map +1 -1
  76. package/dist/index.cjs41.js +1 -1
  77. package/dist/index.cjs41.js.map +1 -1
  78. package/dist/index.cjs42.js +1 -1
  79. package/dist/index.cjs42.js.map +1 -1
  80. package/dist/index.cjs43.js +1 -1
  81. package/dist/index.cjs43.js.map +1 -1
  82. package/dist/index.cjs44.js +1 -1
  83. package/dist/index.cjs44.js.map +1 -1
  84. package/dist/index.cjs45.js +1 -1
  85. package/dist/index.cjs45.js.map +1 -1
  86. package/dist/index.cjs46.js +1 -1
  87. package/dist/index.cjs46.js.map +1 -1
  88. package/dist/index.cjs47.js +1 -1
  89. package/dist/index.cjs47.js.map +1 -1
  90. package/dist/index.cjs48.js +1 -1
  91. package/dist/index.cjs48.js.map +1 -1
  92. package/dist/index.cjs49.js +1 -1
  93. package/dist/index.cjs49.js.map +1 -1
  94. package/dist/index.cjs5.js +1 -1
  95. package/dist/index.cjs5.js.map +1 -1
  96. package/dist/index.cjs50.js +1 -1
  97. package/dist/index.cjs50.js.map +1 -1
  98. package/dist/index.cjs51.js +1 -1
  99. package/dist/index.cjs51.js.map +1 -1
  100. package/dist/index.cjs52.js +1 -1
  101. package/dist/index.cjs52.js.map +1 -1
  102. package/dist/index.cjs53.js +1 -1
  103. package/dist/index.cjs53.js.map +1 -1
  104. package/dist/index.cjs54.js +1 -1
  105. package/dist/index.cjs54.js.map +1 -1
  106. package/dist/index.cjs55.js +1 -1
  107. package/dist/index.cjs55.js.map +1 -1
  108. package/dist/index.cjs56.js +1 -1
  109. package/dist/index.cjs56.js.map +1 -1
  110. package/dist/index.cjs57.js +1 -1
  111. package/dist/index.cjs57.js.map +1 -1
  112. package/dist/index.cjs58.js +1 -1
  113. package/dist/index.cjs58.js.map +1 -1
  114. package/dist/index.cjs59.js +1 -1
  115. package/dist/index.cjs59.js.map +1 -1
  116. package/dist/index.cjs60.js +1 -1
  117. package/dist/index.cjs60.js.map +1 -1
  118. package/dist/index.cjs61.js +1 -1
  119. package/dist/index.cjs61.js.map +1 -1
  120. package/dist/index.cjs62.js +1 -1
  121. package/dist/index.cjs62.js.map +1 -1
  122. package/dist/index.cjs63.js +2 -0
  123. package/dist/index.cjs63.js.map +1 -0
  124. package/dist/index.cjs64.js +2 -0
  125. package/dist/index.cjs64.js.map +1 -0
  126. package/dist/index.cjs65.js +2 -0
  127. package/dist/index.cjs65.js.map +1 -0
  128. package/dist/index.cjs66.js +2 -0
  129. package/dist/index.cjs66.js.map +1 -0
  130. package/dist/index.cjs67.js +2 -0
  131. package/dist/index.cjs67.js.map +1 -0
  132. package/dist/index.cjs68.js +7 -0
  133. package/dist/index.cjs68.js.map +1 -0
  134. package/dist/index.cjs69.js +2 -0
  135. package/dist/index.cjs69.js.map +1 -0
  136. package/dist/index.cjs7.js +1 -1
  137. package/dist/index.cjs7.js.map +1 -1
  138. package/dist/index.cjs70.js +2 -0
  139. package/dist/index.cjs70.js.map +1 -0
  140. package/dist/index.cjs71.js +2 -0
  141. package/dist/index.cjs71.js.map +1 -0
  142. package/dist/index.cjs8.js +1 -1
  143. package/dist/index.cjs8.js.map +1 -1
  144. package/dist/index.cjs9.js +1 -1
  145. package/dist/index.cjs9.js.map +1 -1
  146. package/dist/index.d.ts +3 -1
  147. package/dist/index.d.ts.map +1 -1
  148. package/dist/index.es.js +271 -258
  149. package/dist/index.es.js.map +1 -1
  150. package/dist/index.es10.js +22 -21
  151. package/dist/index.es10.js.map +1 -1
  152. package/dist/index.es11.js +14 -13
  153. package/dist/index.es11.js.map +1 -1
  154. package/dist/index.es12.js +31 -31
  155. package/dist/index.es12.js.map +1 -1
  156. package/dist/index.es13.js +39 -38
  157. package/dist/index.es13.js.map +1 -1
  158. package/dist/index.es14.js +34 -33
  159. package/dist/index.es14.js.map +1 -1
  160. package/dist/index.es15.js +107 -102
  161. package/dist/index.es15.js.map +1 -1
  162. package/dist/index.es16.js +155 -140
  163. package/dist/index.es16.js.map +1 -1
  164. package/dist/index.es17.js +21 -18
  165. package/dist/index.es17.js.map +1 -1
  166. package/dist/index.es19.js +63 -59
  167. package/dist/index.es19.js.map +1 -1
  168. package/dist/index.es2.js +10 -6
  169. package/dist/index.es2.js.map +1 -1
  170. package/dist/index.es20.js +85 -78
  171. package/dist/index.es20.js.map +1 -1
  172. package/dist/index.es21.js +68 -59
  173. package/dist/index.es21.js.map +1 -1
  174. package/dist/index.es22.js +68 -62
  175. package/dist/index.es22.js.map +1 -1
  176. package/dist/index.es23.js +83 -76
  177. package/dist/index.es23.js.map +1 -1
  178. package/dist/index.es24.js +178 -94
  179. package/dist/index.es24.js.map +1 -1
  180. package/dist/index.es25.js +57 -164
  181. package/dist/index.es25.js.map +1 -1
  182. package/dist/index.es26.js +198 -77
  183. package/dist/index.es26.js.map +1 -1
  184. package/dist/index.es27.js +90 -20
  185. package/dist/index.es27.js.map +1 -1
  186. package/dist/index.es28.js +21 -22
  187. package/dist/index.es28.js.map +1 -1
  188. package/dist/index.es29.js +19 -339
  189. package/dist/index.es29.js.map +1 -1
  190. package/dist/index.es3.js +35 -32
  191. package/dist/index.es3.js.map +1 -1
  192. package/dist/index.es30.js +38 -148
  193. package/dist/index.es30.js.map +1 -1
  194. package/dist/index.es31.js +377 -42
  195. package/dist/index.es31.js.map +1 -1
  196. package/dist/index.es32.js +146 -172
  197. package/dist/index.es32.js.map +1 -1
  198. package/dist/index.es33.js +46 -253
  199. package/dist/index.es33.js.map +1 -1
  200. package/dist/index.es34.js +195 -180
  201. package/dist/index.es34.js.map +1 -1
  202. package/dist/index.es35.js +253 -29
  203. package/dist/index.es35.js.map +1 -1
  204. package/dist/index.es36.js +183 -14
  205. package/dist/index.es36.js.map +1 -1
  206. package/dist/index.es37.js +29 -93
  207. package/dist/index.es37.js.map +1 -1
  208. package/dist/index.es38.js +13 -187
  209. package/dist/index.es38.js.map +1 -1
  210. package/dist/index.es39.js +93 -96
  211. package/dist/index.es39.js.map +1 -1
  212. package/dist/index.es4.js +38 -32
  213. package/dist/index.es4.js.map +1 -1
  214. package/dist/index.es40.js +182 -80
  215. package/dist/index.es40.js.map +1 -1
  216. package/dist/index.es41.js +98 -17
  217. package/dist/index.es41.js.map +1 -1
  218. package/dist/index.es42.js +101 -21
  219. package/dist/index.es42.js.map +1 -1
  220. package/dist/index.es43.js +20 -28
  221. package/dist/index.es43.js.map +1 -1
  222. package/dist/index.es44.js +19 -28
  223. package/dist/index.es44.js.map +1 -1
  224. package/dist/index.es45.js +25 -176
  225. package/dist/index.es45.js.map +1 -1
  226. package/dist/index.es46.js +36 -21
  227. package/dist/index.es46.js.map +1 -1
  228. package/dist/index.es47.js +171 -78
  229. package/dist/index.es47.js.map +1 -1
  230. package/dist/index.es48.js +17 -551
  231. package/dist/index.es48.js.map +1 -1
  232. package/dist/index.es49.js +106 -13
  233. package/dist/index.es49.js.map +1 -1
  234. package/dist/index.es5.js +71 -67
  235. package/dist/index.es5.js.map +1 -1
  236. package/dist/index.es50.js +559 -35
  237. package/dist/index.es50.js.map +1 -1
  238. package/dist/index.es51.js +12 -19
  239. package/dist/index.es51.js.map +1 -1
  240. package/dist/index.es52.js +47 -12
  241. package/dist/index.es52.js.map +1 -1
  242. package/dist/index.es53.js +21 -25
  243. package/dist/index.es53.js.map +1 -1
  244. package/dist/index.es54.js +14 -217
  245. package/dist/index.es54.js.map +1 -1
  246. package/dist/index.es55.js +23 -44
  247. package/dist/index.es55.js.map +1 -1
  248. package/dist/index.es56.js +237 -13
  249. package/dist/index.es56.js.map +1 -1
  250. package/dist/index.es57.js +44 -28
  251. package/dist/index.es57.js.map +1 -1
  252. package/dist/index.es58.js +17 -36
  253. package/dist/index.es58.js.map +1 -1
  254. package/dist/index.es59.js +33 -18
  255. package/dist/index.es59.js.map +1 -1
  256. package/dist/index.es60.js +39 -6
  257. package/dist/index.es60.js.map +1 -1
  258. package/dist/index.es61.js +21 -267
  259. package/dist/index.es61.js.map +1 -1
  260. package/dist/index.es62.js +3 -6268
  261. package/dist/index.es62.js.map +1 -1
  262. package/dist/index.es63.js +9 -0
  263. package/dist/index.es63.js.map +1 -0
  264. package/dist/index.es64.js +270 -0
  265. package/dist/index.es64.js.map +1 -0
  266. package/dist/index.es65.js +11 -0
  267. package/dist/index.es65.js.map +1 -0
  268. package/dist/index.es66.js +5 -0
  269. package/dist/index.es66.js.map +1 -0
  270. package/dist/index.es67.js +27 -0
  271. package/dist/index.es67.js.map +1 -0
  272. package/dist/index.es68.js +237 -0
  273. package/dist/index.es68.js.map +1 -0
  274. package/dist/index.es69.js +5 -0
  275. package/dist/index.es69.js.map +1 -0
  276. package/dist/index.es7.js +25 -24
  277. package/dist/index.es7.js.map +1 -1
  278. package/dist/index.es70.js +5 -0
  279. package/dist/index.es70.js.map +1 -0
  280. package/dist/index.es71.js +6271 -0
  281. package/dist/index.es71.js.map +1 -0
  282. package/dist/index.es8.js +43 -41
  283. package/dist/index.es8.js.map +1 -1
  284. package/dist/index.es9.js +51 -48
  285. package/dist/index.es9.js.map +1 -1
  286. package/dist/style.css +199 -49
  287. package/package.json +1 -1
@@ -1,154 +1,44 @@
1
- import * as a from "react";
2
- import { cva as s } from "class-variance-authority";
3
- import { cn as r } from "./index.es60.js";
4
- import { Button as u } from "./index.es10.js";
5
- import { Input as p } from "./index.es28.js";
6
- import { Textarea as l } from "./index.es56.js";
7
- function h({ className: e, ...t }) {
8
- return /* @__PURE__ */ a.createElement(
9
- "div",
10
- {
11
- "data-slot": "input-group",
12
- role: "group",
13
- className: r(
14
- "group/input-group relative flex w-full items-center rounded-[8px] border border-[#e6e6e6] bg-white text-[14px] leading-[20px] text-foreground transition-colors",
15
- "h-10 has-[>textarea]:h-auto",
16
- // Variants based on alignment.
17
- "has-[>[data-align=inline-start]]:[&>input]:pl-2",
18
- "has-[>[data-align=inline-end]]:[&>input]:pr-2",
19
- "has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3",
20
- "has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3",
21
- // Focus state.
22
- "focus-within:border-[#1D1C20]",
23
- // Error state.
24
- "has-[[data-slot][aria-invalid=true]]:border-[#ff3b30]",
25
- // Disabled state.
26
- "data-[disabled=true]:cursor-not-allowed data-[disabled=true]:bg-[#f2f2f2] data-[disabled=true]:text-[#9ca3af]",
27
- e
1
+ import { j as s } from "./index.es62.js";
2
+ import * as o from "react";
3
+ import { EyeOff as c, Eye as d } from "lucide-react";
4
+ import { cn as f } from "./index.es63.js";
5
+ import { Input as u } from "./index.es29.js";
6
+ const x = o.forwardRef(
7
+ ({
8
+ className: a,
9
+ showLabel: r = "Show password",
10
+ hideLabel: i = "Hide password",
11
+ disabled: e,
12
+ ...l
13
+ }, n) => {
14
+ const [t, p] = o.useState(!1);
15
+ return /* @__PURE__ */ s.jsxs("div", { className: "relative w-full", children: [
16
+ /* @__PURE__ */ s.jsx(
17
+ u,
18
+ {
19
+ ref: n,
20
+ type: t ? "text" : "password",
21
+ disabled: e,
22
+ className: f("pr-10", a),
23
+ ...l
24
+ }
28
25
  ),
29
- ...t
30
- }
31
- );
32
- }
33
- const d = s(
34
- "flex h-auto cursor-text select-none items-center justify-center gap-2 py-1.5 text-sm font-medium text-[#7f7d83] group-data-[disabled=true]/input-group:text-[#b3b3b3] [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",
35
- {
36
- variants: {
37
- align: {
38
- "inline-start": "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
39
- "inline-end": "order-last pr-3 has-[>button]:mr-[-0.4rem] has-[>kbd]:mr-[-0.35rem]",
40
- "block-start": "[.border-b]:pb-3 order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5",
41
- "block-end": "[.border-t]:pt-3 order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5"
42
- }
43
- },
44
- defaultVariants: {
45
- align: "inline-start"
46
- }
26
+ /* @__PURE__ */ s.jsx(
27
+ "button",
28
+ {
29
+ type: "button",
30
+ onClick: () => p((m) => !m),
31
+ disabled: e,
32
+ "aria-label": t ? i : r,
33
+ className: "absolute right-3 top-1/2 -translate-y-1/2 text-[#7f7d83] transition-colors hover:text-[#111111] focus-visible:outline-none disabled:cursor-not-allowed disabled:text-[#b3b3b3]",
34
+ children: t ? /* @__PURE__ */ s.jsx(c, { className: "h-4 w-4" }) : /* @__PURE__ */ s.jsx(d, { className: "h-4 w-4" })
35
+ }
36
+ )
37
+ ] });
47
38
  }
48
39
  );
49
- function v({
50
- className: e,
51
- align: t = "inline-start",
52
- ...o
53
- }) {
54
- return /* @__PURE__ */ a.createElement(
55
- "div",
56
- {
57
- role: "group",
58
- "data-slot": "input-group-addon",
59
- "data-align": t,
60
- className: r(d({ align: t }), e),
61
- onClick: (n) => {
62
- n.target.closest("button") || n.currentTarget.parentElement?.querySelector("input")?.focus();
63
- },
64
- ...o
65
- }
66
- );
67
- }
68
- const c = s(
69
- "flex items-center gap-2 text-sm shadow-none",
70
- {
71
- variants: {
72
- size: {
73
- xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",
74
- sm: "h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5",
75
- "icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
76
- "icon-sm": "size-8 p-0 has-[>svg]:p-0"
77
- }
78
- },
79
- defaultVariants: {
80
- size: "xs"
81
- }
82
- }
83
- );
84
- function k({
85
- className: e,
86
- type: t = "button",
87
- variant: o = "ghost",
88
- size: n = "xs",
89
- ...i
90
- }) {
91
- return /* @__PURE__ */ a.createElement(
92
- u,
93
- {
94
- type: t,
95
- "data-size": n,
96
- variant: o,
97
- className: r(c({ size: n }), e),
98
- ...i
99
- }
100
- );
101
- }
102
- function z({ className: e, ...t }) {
103
- return /* @__PURE__ */ a.createElement(
104
- "span",
105
- {
106
- className: r(
107
- "text-muted-foreground flex items-center gap-2 text-sm [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none",
108
- e
109
- ),
110
- ...t
111
- }
112
- );
113
- }
114
- function w({
115
- className: e,
116
- ...t
117
- }) {
118
- return /* @__PURE__ */ a.createElement(
119
- p,
120
- {
121
- "data-slot": "input-group-control",
122
- className: r(
123
- "flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",
124
- e
125
- ),
126
- ...t
127
- }
128
- );
129
- }
130
- function G({
131
- className: e,
132
- ...t
133
- }) {
134
- return /* @__PURE__ */ a.createElement(
135
- l,
136
- {
137
- "data-slot": "input-group-control",
138
- className: r(
139
- "flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent",
140
- e
141
- ),
142
- ...t
143
- }
144
- );
145
- }
40
+ x.displayName = "PasswordInput";
146
41
  export {
147
- h as InputGroup,
148
- v as InputGroupAddon,
149
- k as InputGroupButton,
150
- w as InputGroupInput,
151
- z as InputGroupText,
152
- G as InputGroupTextarea
42
+ x as PasswordInput
153
43
  };
154
44
  //# sourceMappingURL=index.es30.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es30.js","sources":["../src/components/ui/input-group.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Input } from \"@/components/ui/input\"\nimport { Textarea } from \"@/components/ui/textarea\"\n\nfunction InputGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"input-group\"\n role=\"group\"\n className={cn(\n \"group/input-group relative flex w-full items-center rounded-[8px] border border-[#e6e6e6] bg-white text-[14px] leading-[20px] text-foreground transition-colors\",\n \"h-10 has-[>textarea]:h-auto\",\n\n // Variants based on alignment.\n \"has-[>[data-align=inline-start]]:[&>input]:pl-2\",\n \"has-[>[data-align=inline-end]]:[&>input]:pr-2\",\n \"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3\",\n \"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3\",\n\n // Focus state.\n \"focus-within:border-[#1D1C20]\",\n\n // Error state.\n \"has-[[data-slot][aria-invalid=true]]:border-[#ff3b30]\",\n\n // Disabled state.\n \"data-[disabled=true]:cursor-not-allowed data-[disabled=true]:bg-[#f2f2f2] data-[disabled=true]:text-[#9ca3af]\",\n\n className\n )}\n {...props}\n />\n )\n}\n\nconst inputGroupAddonVariants = cva(\n \"flex h-auto cursor-text select-none items-center justify-center gap-2 py-1.5 text-sm font-medium text-[#7f7d83] group-data-[disabled=true]/input-group:text-[#b3b3b3] [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4\",\n {\n variants: {\n align: {\n \"inline-start\":\n \"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]\",\n \"inline-end\":\n \"order-last pr-3 has-[>button]:mr-[-0.4rem] has-[>kbd]:mr-[-0.35rem]\",\n \"block-start\":\n \"[.border-b]:pb-3 order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5\",\n \"block-end\":\n \"[.border-t]:pt-3 order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5\",\n },\n },\n defaultVariants: {\n align: \"inline-start\",\n },\n }\n)\n\nfunction InputGroupAddon({\n className,\n align = \"inline-start\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof inputGroupAddonVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"input-group-addon\"\n data-align={align}\n className={cn(inputGroupAddonVariants({ align }), className)}\n onClick={(e) => {\n if ((e.target as HTMLElement).closest(\"button\")) {\n return\n }\n e.currentTarget.parentElement?.querySelector(\"input\")?.focus()\n }}\n {...props}\n />\n )\n}\n\nconst inputGroupButtonVariants = cva(\n \"flex items-center gap-2 text-sm shadow-none\",\n {\n variants: {\n size: {\n xs: \"h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5\",\n sm: \"h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5\",\n \"icon-xs\":\n \"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0\",\n \"icon-sm\": \"size-8 p-0 has-[>svg]:p-0\",\n },\n },\n defaultVariants: {\n size: \"xs\",\n },\n }\n)\n\nfunction InputGroupButton({\n className,\n type = \"button\",\n variant = \"ghost\",\n size = \"xs\",\n ...props\n}: Omit<React.ComponentProps<typeof Button>, \"size\"> &\n VariantProps<typeof inputGroupButtonVariants>) {\n return (\n <Button\n type={type}\n data-size={size}\n variant={variant}\n className={cn(inputGroupButtonVariants({ size }), className)}\n {...props}\n />\n )\n}\n\nfunction InputGroupText({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n className={cn(\n \"text-muted-foreground flex items-center gap-2 text-sm [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction InputGroupInput({\n className,\n ...props\n}: React.ComponentProps<\"input\">) {\n return (\n <Input\n data-slot=\"input-group-control\"\n className={cn(\n \"flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction InputGroupTextarea({\n className,\n ...props\n}: React.ComponentProps<\"textarea\">) {\n return (\n <Textarea\n data-slot=\"input-group-control\"\n className={cn(\n \"flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupText,\n InputGroupInput,\n InputGroupTextarea,\n}\n"],"names":["InputGroup","className","props","React","cn","inputGroupAddonVariants","cva","InputGroupAddon","align","e","inputGroupButtonVariants","InputGroupButton","type","variant","size","Button","InputGroupText","InputGroupInput","Input","InputGroupTextarea","Textarea"],"mappings":"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"}
1
+ {"version":3,"file":"index.es30.js","sources":["../src/components/ui/password-input.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Eye, EyeOff } from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\n\nimport { Input } from \"./input\";\n\ntype PasswordInputProps = Omit<React.ComponentProps<\"input\">, \"type\"> & {\n showLabel?: string;\n hideLabel?: string;\n};\n\nconst PasswordInput = React.forwardRef<HTMLInputElement, PasswordInputProps>(\n (\n {\n className,\n showLabel = \"Show password\",\n hideLabel = \"Hide password\",\n disabled,\n ...props\n },\n ref,\n ) => {\n const [isVisible, setIsVisible] = React.useState(false);\n\n return (\n <div className=\"relative w-full\">\n <Input\n ref={ref}\n type={isVisible ? \"text\" : \"password\"}\n disabled={disabled}\n className={cn(\"pr-10\", className)}\n {...props}\n />\n <button\n type=\"button\"\n onClick={() => setIsVisible((value) => !value)}\n disabled={disabled}\n aria-label={isVisible ? hideLabel : showLabel}\n className=\"absolute right-3 top-1/2 -translate-y-1/2 text-[#7f7d83] transition-colors hover:text-[#111111] focus-visible:outline-none disabled:cursor-not-allowed disabled:text-[#b3b3b3]\"\n >\n {isVisible ? (\n <EyeOff className=\"h-4 w-4\" />\n ) : (\n <Eye className=\"h-4 w-4\" />\n )}\n </button>\n </div>\n );\n },\n);\nPasswordInput.displayName = \"PasswordInput\";\n\nexport { PasswordInput };\nexport type { PasswordInputProps };\n"],"names":["PasswordInput","React","className","showLabel","hideLabel","disabled","props","ref","isVisible","setIsVisible","jsxs","jsx","Input","cn","value","EyeOff","Eye"],"mappings":";;;;;AAYA,MAAMA,IAAgBC,EAAM;AAAA,EAC1B,CACE;AAAA,IACE,WAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,WAAAC,IAAY;AAAA,IACZ,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAM,CAACC,GAAWC,CAAY,IAAIR,EAAM,SAAS,EAAK;AAEtD,WACES,gBAAAA,EAAAA,KAAC,OAAA,EAAI,WAAU,mBACb,UAAA;AAAA,MAAAC,gBAAAA,EAAAA;AAAAA,QAACC;AAAA,QAAA;AAAA,UACC,KAAAL;AAAA,UACA,MAAMC,IAAY,SAAS;AAAA,UAC3B,UAAAH;AAAA,UACA,WAAWQ,EAAG,SAASX,CAAS;AAAA,UAC/B,GAAGI;AAAA,QAAA;AAAA,MAAA;AAAA,MAENK,gBAAAA,EAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,SAAS,MAAMF,EAAa,CAACK,MAAU,CAACA,CAAK;AAAA,UAC7C,UAAAT;AAAA,UACA,cAAYG,IAAYJ,IAAYD;AAAA,UACpC,WAAU;AAAA,UAET,UAAAK,0BACEO,GAAA,EAAO,WAAU,WAAU,IAE5BJ,gBAAAA,EAAAA,IAACK,GAAA,EAAI,WAAU,UAAA,CAAU;AAAA,QAAA;AAAA,MAAA;AAAA,IAE7B,GACF;AAAA,EAEJ;AACF;AACAhB,EAAc,cAAc;"}
@@ -1,46 +1,381 @@
1
- import * as e from "react";
2
- import { OTPInput as c, OTPInputContext as d } from "input-otp";
3
- import { Minus as p } from "lucide-react";
4
- import { cn as n } from "./index.es60.js";
5
- const u = e.forwardRef(({ className: t, containerClassName: r, ...a }, o) => /* @__PURE__ */ e.createElement(
6
- c,
7
- {
8
- ref: o,
9
- containerClassName: n(
10
- "flex items-center gap-2 has-[:disabled]:opacity-50",
11
- r
12
- ),
13
- className: n("disabled:cursor-not-allowed", t),
14
- ...a
15
- }
16
- ));
17
- u.displayName = "InputOTP";
18
- const f = e.forwardRef(({ className: t, ...r }, a) => /* @__PURE__ */ e.createElement("div", { ref: a, className: n("flex items-center", t), ...r }));
19
- f.displayName = "InputOTPGroup";
20
- const O = e.forwardRef(({ index: t, className: r, ...a }, o) => {
21
- const s = e.useContext(d), { char: i, hasFakeCaret: l, isActive: m } = s.slots[t];
22
- return /* @__PURE__ */ e.createElement(
23
- "div",
24
- {
25
- ref: o,
26
- className: n(
27
- "relative flex h-9 w-9 items-center justify-center border-y border-r border-input text-sm shadow-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",
28
- m && "z-10 ring-1 ring-ring",
29
- r
1
+ import { j as t } from "./index.es62.js";
2
+ import * as l from "react";
3
+ import { startOfMonth as p, addMonths as z, isAfter as v, isBefore as J, setMonth as ce, setYear as fe, format as me } from "date-fns";
4
+ import { CalendarDays as ue, ChevronLeft as xe, ChevronDown as W, ChevronRight as be } from "lucide-react";
5
+ import { DayPicker as he } from "react-day-picker";
6
+ import { cn as x } from "./index.es63.js";
7
+ import { Button as q } from "./index.es10.js";
8
+ import { Popover as pe, PopoverTrigger as ge, PopoverContent as we } from "./index.es43.js";
9
+ const ve = "dd/MM/yyyy", De = "DD/MM/YYYY - DD/MM/YYYY", je = Array.from(
10
+ { length: 12 },
11
+ (e, n) => new Date(2020, n, 1).toLocaleString("default", { month: "long" })
12
+ ), N = (e, n, i) => J(e, n) ? n : v(e, i) ? i : e, C = (e) => {
13
+ if (!(!e?.from && !e?.to))
14
+ return e.from && e.to && v(e.from, e.to) ? {
15
+ from: e.to,
16
+ to: e.from
17
+ } : {
18
+ from: e.from,
19
+ to: e.to
20
+ };
21
+ }, S = (e, n) => {
22
+ if (e)
23
+ return me(e, n);
24
+ }, ye = (e, n) => {
25
+ const i = S(e?.from, n), m = S(e?.to, n);
26
+ return !i || !m ? "" : `${i} - ${m}`;
27
+ }, Me = (e, n) => {
28
+ const i = S(e?.from, n) ?? "DD/MM/YYYY", m = S(e?.to, n) ?? "DD/MM/YYYY";
29
+ return `${i} - ${m}`;
30
+ };
31
+ function G({
32
+ label: e,
33
+ month: n,
34
+ minMonth: i,
35
+ maxMonth: m,
36
+ minDate: Y,
37
+ maxDate: k,
38
+ selectedDate: E,
39
+ disabledMatcher: D,
40
+ disabled: g,
41
+ years: j,
42
+ onMonthChange: u,
43
+ onSelectDate: y
44
+ }) {
45
+ const w = () => {
46
+ u(z(n, -1));
47
+ }, P = () => {
48
+ u(z(n, 1));
49
+ }, A = g || !v(n, i), f = g || !J(n, m);
50
+ return /* @__PURE__ */ t.jsxs("div", { className: "w-full min-w-0", children: [
51
+ /* @__PURE__ */ t.jsxs("div", { className: "flex flex-wrap items-center gap-2 sm:flex-nowrap", children: [
52
+ /* @__PURE__ */ t.jsx(
53
+ "button",
54
+ {
55
+ type: "button",
56
+ onClick: w,
57
+ disabled: A,
58
+ className: x(
59
+ "inline-flex h-8 w-8 items-center justify-center rounded-md text-[#6e6d71] transition-colors lg:h-9 lg:w-9",
60
+ "hover:bg-[#f5f5f5] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#1d1c20]/20",
61
+ "disabled:cursor-not-allowed disabled:opacity-40"
62
+ ),
63
+ "aria-label": `Previous month for ${e.toLowerCase()}`,
64
+ children: /* @__PURE__ */ t.jsx(xe, { className: "h-4 w-4 lg:h-5 lg:w-5" })
65
+ }
30
66
  ),
31
- ...a
32
- },
33
- i,
34
- l && /* @__PURE__ */ e.createElement("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center" }, /* @__PURE__ */ e.createElement("div", { className: "h-4 w-px animate-caret-blink bg-foreground duration-1000" }))
35
- );
36
- });
37
- O.displayName = "InputOTPSlot";
38
- const P = e.forwardRef(({ ...t }, r) => /* @__PURE__ */ e.createElement("div", { ref: r, role: "separator", ...t }, /* @__PURE__ */ e.createElement(p, null)));
39
- P.displayName = "InputOTPSeparator";
67
+ /* @__PURE__ */ t.jsxs("div", { className: "relative min-w-0 flex-1", children: [
68
+ /* @__PURE__ */ t.jsx(
69
+ "select",
70
+ {
71
+ value: n.getMonth(),
72
+ onChange: (s) => {
73
+ const a = Number(s.target.value);
74
+ u(ce(n, a));
75
+ },
76
+ disabled: g,
77
+ className: x(
78
+ "h-9 w-full appearance-none rounded-md border border-[#b7b7b9] bg-white px-3 pr-8 text-left text-sm font-medium leading-5 text-[#111111] lg:h-10 lg:px-4 lg:pr-10",
79
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#1d1c20]/20",
80
+ "disabled:cursor-not-allowed disabled:bg-[#f2f2f2] disabled:text-[#b3b3b3]"
81
+ ),
82
+ "aria-label": `Month for ${e.toLowerCase()}`,
83
+ children: je.map((s, a) => /* @__PURE__ */ t.jsx("option", { value: a, children: s }, s))
84
+ }
85
+ ),
86
+ /* @__PURE__ */ t.jsx(W, { className: "pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-[#7f7d83] lg:right-3" })
87
+ ] }),
88
+ /* @__PURE__ */ t.jsxs("div", { className: "relative w-[104px] shrink-0 sm:w-[120px]", children: [
89
+ /* @__PURE__ */ t.jsx(
90
+ "select",
91
+ {
92
+ value: n.getFullYear(),
93
+ onChange: (s) => {
94
+ const a = Number(s.target.value);
95
+ u(fe(n, a));
96
+ },
97
+ disabled: g,
98
+ className: x(
99
+ "h-9 w-full appearance-none rounded-md border border-[#b7b7b9] bg-white px-3 pr-8 text-left text-sm font-medium leading-5 text-[#111111] lg:h-10 lg:px-4 lg:pr-9",
100
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#1d1c20]/20",
101
+ "disabled:cursor-not-allowed disabled:bg-[#f2f2f2] disabled:text-[#b3b3b3]"
102
+ ),
103
+ "aria-label": `Year for ${e.toLowerCase()}`,
104
+ children: j.map((s) => /* @__PURE__ */ t.jsx("option", { value: s, children: s }, s))
105
+ }
106
+ ),
107
+ /* @__PURE__ */ t.jsx(W, { className: "pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-[#7f7d83] lg:right-3" })
108
+ ] }),
109
+ /* @__PURE__ */ t.jsx(
110
+ "button",
111
+ {
112
+ type: "button",
113
+ onClick: P,
114
+ disabled: f,
115
+ className: x(
116
+ "inline-flex h-8 w-8 items-center justify-center rounded-md text-[#6e6d71] transition-colors lg:h-9 lg:w-9",
117
+ "hover:bg-[#f5f5f5] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#1d1c20]/20",
118
+ "disabled:cursor-not-allowed disabled:opacity-40"
119
+ ),
120
+ "aria-label": `Next month for ${e.toLowerCase()}`,
121
+ children: /* @__PURE__ */ t.jsx(be, { className: "h-4 w-4 lg:h-5 lg:w-5" })
122
+ }
123
+ )
124
+ ] }),
125
+ /* @__PURE__ */ t.jsx("p", { className: "mt-1.5 text-center text-sm font-medium leading-5 text-[#666666] lg:mt-2", children: e }),
126
+ /* @__PURE__ */ t.jsx(
127
+ he,
128
+ {
129
+ mode: "single",
130
+ month: n,
131
+ onMonthChange: u,
132
+ selected: E,
133
+ onSelect: y,
134
+ showOutsideDays: !0,
135
+ fixedWeeks: !0,
136
+ hideNavigation: !0,
137
+ disabled: [
138
+ { before: Y },
139
+ { after: k },
140
+ ...D ? [D] : []
141
+ ],
142
+ className: "mt-1 p-0 [--drp-cell-size:1.625rem] md:[--drp-cell-size:1.875rem] xl:[--drp-cell-size:2.125rem]",
143
+ classNames: {
144
+ root: "w-full",
145
+ months: "w-full",
146
+ month: "w-full",
147
+ month_caption: "hidden",
148
+ month_grid: "w-full border-collapse",
149
+ weekdays: "grid grid-cols-7",
150
+ weekday: "h-[calc(var(--drp-cell-size)-0.25rem)] text-center text-[11px] font-medium leading-4 text-[#666666] lg:text-xs",
151
+ weeks: "grid gap-0",
152
+ week: "grid grid-cols-7",
153
+ day: "flex h-[var(--drp-cell-size)] w-full items-center justify-center p-0",
154
+ day_button: "h-[--drp-cell-size] w-[--drp-cell-size] rounded-md border border-transparent bg-transparent p-0 text-[13px] font-normal leading-none text-[#444444] transition-colors hover:border-[#cccccc] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#2bbd8f]/25 lg:text-sm",
155
+ selected: "[&>button]:border-[#2bbd8f] [&>button]:bg-[#2bbd8f] [&>button]:text-[#111111]",
156
+ today: "font-medium",
157
+ outside: "text-[#a4a4a8]",
158
+ disabled: "pointer-events-none text-[#d3d3d6]",
159
+ hidden: "invisible"
160
+ }
161
+ }
162
+ )
163
+ ] });
164
+ }
165
+ const Ne = l.forwardRef(
166
+ ({
167
+ value: e,
168
+ defaultValue: n,
169
+ onValueChange: i,
170
+ wrapperClassName: m,
171
+ popoverClassName: Y,
172
+ popoverSide: k = "bottom",
173
+ popoverAvoidCollisions: E = !0,
174
+ className: D,
175
+ placeholder: g = De,
176
+ dateFormat: j = ve,
177
+ minYear: u = 2e3,
178
+ maxYear: y = 2100,
179
+ disabled: w,
180
+ ...P
181
+ }, A) => {
182
+ const f = Math.min(u, y), s = Math.max(u, y), a = l.useMemo(
183
+ () => p(new Date(f, 0, 1)),
184
+ [f]
185
+ ), b = l.useMemo(
186
+ () => p(new Date(s, 11, 1)),
187
+ [s]
188
+ ), R = l.useMemo(() => new Date(f, 0, 1), [f]), O = l.useMemo(
189
+ () => new Date(s, 11, 31),
190
+ [s]
191
+ ), $ = l.useMemo(
192
+ () => Array.from(
193
+ { length: s - f + 1 },
194
+ (o, c) => f + c
195
+ ),
196
+ [f, s]
197
+ ), B = e !== void 0, [K, Q] = l.useState(
198
+ C(n)
199
+ ), h = C(B ? e : K), L = l.useCallback(
200
+ (o) => {
201
+ const c = p(/* @__PURE__ */ new Date()), r = N(
202
+ p(o?.from ?? c),
203
+ a,
204
+ b
205
+ ), ie = o?.to ? p(o.to) : z(r, 1), de = N(ie, a, b);
206
+ return {
207
+ start: r,
208
+ end: de
209
+ };
210
+ },
211
+ [a, b]
212
+ ), [T, V] = l.useState(!1), [d, _] = l.useState(
213
+ h
214
+ ), H = L(h), [X, U] = l.useState(H.start), [Z, F] = l.useState(H.end), M = l.useCallback(
215
+ (o) => {
216
+ const c = C(o);
217
+ _(c);
218
+ const r = L(c);
219
+ U(r.start), F(r.end);
220
+ },
221
+ [L]
222
+ );
223
+ l.useEffect(() => {
224
+ T || M(h);
225
+ }, [h, T, M]);
226
+ const ee = (o) => {
227
+ U(N(p(o), a, b));
228
+ }, te = (o) => {
229
+ F(N(p(o), a, b));
230
+ }, oe = (o) => {
231
+ o && _((c) => {
232
+ const r = {
233
+ from: o,
234
+ to: c?.to
235
+ };
236
+ return r.to && v(o, r.to) && (r.to = o), r;
237
+ });
238
+ }, ne = (o) => {
239
+ o && _((c) => {
240
+ const r = {
241
+ from: c?.from,
242
+ to: o
243
+ };
244
+ return r.from && v(r.from, o) && (r.from = o), r;
245
+ });
246
+ }, se = () => {
247
+ M(h), V(!1);
248
+ }, re = () => {
249
+ const o = C(d);
250
+ B || Q(o), i?.(o), V(!1);
251
+ }, le = !!(d?.from && d?.to), I = ye(h, j), ae = Me(d, j);
252
+ return /* @__PURE__ */ t.jsx("div", { className: x("w-full", m), children: /* @__PURE__ */ t.jsxs(
253
+ pe,
254
+ {
255
+ open: T,
256
+ onOpenChange: (o) => {
257
+ w || (o && M(h), V(o));
258
+ },
259
+ children: [
260
+ /* @__PURE__ */ t.jsx(ge, { asChild: !0, children: /* @__PURE__ */ t.jsxs(
261
+ "button",
262
+ {
263
+ ref: A,
264
+ type: "button",
265
+ disabled: w,
266
+ className: x(
267
+ "flex h-10 w-full items-center justify-between rounded-[8px] border border-[#e6e6e6] bg-white px-3 py-2 text-left text-[14px] leading-[20px] transition-colors",
268
+ "focus-visible:outline-none focus-visible:border-[#1D1C20] focus-visible:ring-0",
269
+ "disabled:cursor-not-allowed disabled:bg-[#f2f2f2] disabled:text-[#9ca3af] disabled:opacity-100",
270
+ D
271
+ ),
272
+ ...P,
273
+ children: [
274
+ /* @__PURE__ */ t.jsx(
275
+ "span",
276
+ {
277
+ className: x(
278
+ "truncate text-[14px] font-normal leading-[20px]",
279
+ I ? "text-[#111111]" : "text-[#b3b3b3]"
280
+ ),
281
+ children: I || g
282
+ }
283
+ ),
284
+ /* @__PURE__ */ t.jsx(ue, { className: "ml-3 h-4 w-4 shrink-0 text-[#111111]" })
285
+ ]
286
+ }
287
+ ) }),
288
+ /* @__PURE__ */ t.jsxs(
289
+ we,
290
+ {
291
+ side: k,
292
+ avoidCollisions: E,
293
+ align: "start",
294
+ sideOffset: 10,
295
+ className: x(
296
+ "w-[min(95vw,760px)] max-h-[var(--radix-popover-content-available-height)] overflow-y-auto overscroll-contain rounded-xl border border-[#d8d8da] bg-[#f7f7f8] p-3 shadow-[0px_12px_24px_rgba(0,0,0,0.08)] sm:p-4",
297
+ Y
298
+ ),
299
+ children: [
300
+ /* @__PURE__ */ t.jsxs("div", { className: "grid gap-3 md:grid-cols-2 md:gap-4", children: [
301
+ /* @__PURE__ */ t.jsx(
302
+ G,
303
+ {
304
+ label: "Start date",
305
+ month: X,
306
+ minMonth: a,
307
+ maxMonth: b,
308
+ minDate: R,
309
+ maxDate: O,
310
+ selectedDate: d?.from,
311
+ disabledMatcher: d?.to ? { after: d.to } : void 0,
312
+ disabled: w,
313
+ years: $,
314
+ onMonthChange: ee,
315
+ onSelectDate: oe
316
+ }
317
+ ),
318
+ /* @__PURE__ */ t.jsx(
319
+ G,
320
+ {
321
+ label: "End date",
322
+ month: Z,
323
+ minMonth: a,
324
+ maxMonth: b,
325
+ minDate: R,
326
+ maxDate: O,
327
+ selectedDate: d?.to,
328
+ disabledMatcher: d?.from ? { before: d.from } : void 0,
329
+ disabled: w,
330
+ years: $,
331
+ onMonthChange: te,
332
+ onSelectDate: ne
333
+ }
334
+ )
335
+ ] }),
336
+ /* @__PURE__ */ t.jsxs("div", { className: "mt-2.5 border-t border-[#d8d8da] pt-2.5", children: [
337
+ /* @__PURE__ */ t.jsx(
338
+ "input",
339
+ {
340
+ readOnly: !0,
341
+ value: ae,
342
+ className: "h-9 w-full rounded-md border border-[#e6e6e6] bg-white px-3 py-2 text-sm leading-5 text-[#111111] outline-none transition-colors placeholder:text-[#b3b3b3] focus-visible:border-[#1D1C20]",
343
+ "aria-label": "Selected date range"
344
+ }
345
+ ),
346
+ /* @__PURE__ */ t.jsxs("div", { className: "mt-2.5 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", children: [
347
+ /* @__PURE__ */ t.jsx(
348
+ q,
349
+ {
350
+ type: "button",
351
+ variant: "outline",
352
+ className: "h-9 rounded-md px-4 text-sm",
353
+ onClick: se,
354
+ children: "Cancel"
355
+ }
356
+ ),
357
+ /* @__PURE__ */ t.jsx(
358
+ q,
359
+ {
360
+ type: "button",
361
+ className: "h-9 rounded-md px-4 text-sm",
362
+ disabled: !le,
363
+ onClick: re,
364
+ children: "Apply"
365
+ }
366
+ )
367
+ ] })
368
+ ] })
369
+ ]
370
+ }
371
+ )
372
+ ]
373
+ }
374
+ ) });
375
+ }
376
+ );
377
+ Ne.displayName = "DateRangePicker";
40
378
  export {
41
- u as InputOTP,
42
- f as InputOTPGroup,
43
- P as InputOTPSeparator,
44
- O as InputOTPSlot
379
+ Ne as DateRangePicker
45
380
  };
46
381
  //# sourceMappingURL=index.es31.js.map