ml-uikit 1.1.4 → 1.1.6

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/components/ui/date-range-picker.d.ts +19 -0
  2. package/dist/components/ui/date-range-picker.d.ts.map +1 -0
  3. package/dist/components/ui/phone-input.d.ts.map +1 -1
  4. package/dist/components/ui/table.d.ts +5 -1
  5. package/dist/components/ui/table.d.ts.map +1 -1
  6. package/dist/index.cjs.js +1 -1
  7. package/dist/index.cjs10.js +1 -1
  8. package/dist/index.cjs11.js +1 -1
  9. package/dist/index.cjs12.js +1 -1
  10. package/dist/index.cjs13.js +1 -1
  11. package/dist/index.cjs14.js +1 -1
  12. package/dist/index.cjs15.js +1 -1
  13. package/dist/index.cjs16.js +1 -1
  14. package/dist/index.cjs17.js +1 -1
  15. package/dist/index.cjs19.js +1 -1
  16. package/dist/index.cjs20.js +1 -1
  17. package/dist/index.cjs21.js +1 -1
  18. package/dist/index.cjs22.js +1 -1
  19. package/dist/index.cjs23.js +1 -1
  20. package/dist/index.cjs24.js +1 -1
  21. package/dist/index.cjs25.js +1 -1
  22. package/dist/index.cjs26.js +1 -1
  23. package/dist/index.cjs27.js +1 -1
  24. package/dist/index.cjs28.js +1 -1
  25. package/dist/index.cjs29.js +1 -1
  26. package/dist/index.cjs29.js.map +1 -1
  27. package/dist/index.cjs3.js +1 -1
  28. package/dist/index.cjs30.js +1 -1
  29. package/dist/index.cjs30.js.map +1 -1
  30. package/dist/index.cjs31.js +1 -1
  31. package/dist/index.cjs31.js.map +1 -1
  32. package/dist/index.cjs32.js +1 -1
  33. package/dist/index.cjs32.js.map +1 -1
  34. package/dist/index.cjs33.js +1 -1
  35. package/dist/index.cjs33.js.map +1 -1
  36. package/dist/index.cjs34.js +1 -1
  37. package/dist/index.cjs34.js.map +1 -1
  38. package/dist/index.cjs35.js +1 -1
  39. package/dist/index.cjs35.js.map +1 -1
  40. package/dist/index.cjs36.js +1 -1
  41. package/dist/index.cjs36.js.map +1 -1
  42. package/dist/index.cjs37.js +1 -1
  43. package/dist/index.cjs37.js.map +1 -1
  44. package/dist/index.cjs38.js +1 -1
  45. package/dist/index.cjs38.js.map +1 -1
  46. package/dist/index.cjs39.js +1 -1
  47. package/dist/index.cjs39.js.map +1 -1
  48. package/dist/index.cjs4.js +1 -1
  49. package/dist/index.cjs40.js +1 -1
  50. package/dist/index.cjs40.js.map +1 -1
  51. package/dist/index.cjs41.js +1 -1
  52. package/dist/index.cjs41.js.map +1 -1
  53. package/dist/index.cjs42.js +1 -1
  54. package/dist/index.cjs42.js.map +1 -1
  55. package/dist/index.cjs43.js +1 -1
  56. package/dist/index.cjs43.js.map +1 -1
  57. package/dist/index.cjs44.js +1 -1
  58. package/dist/index.cjs44.js.map +1 -1
  59. package/dist/index.cjs45.js +1 -1
  60. package/dist/index.cjs45.js.map +1 -1
  61. package/dist/index.cjs46.js +1 -1
  62. package/dist/index.cjs46.js.map +1 -1
  63. package/dist/index.cjs47.js +1 -1
  64. package/dist/index.cjs47.js.map +1 -1
  65. package/dist/index.cjs48.js +1 -1
  66. package/dist/index.cjs48.js.map +1 -1
  67. package/dist/index.cjs49.js +1 -1
  68. package/dist/index.cjs49.js.map +1 -1
  69. package/dist/index.cjs5.js +1 -1
  70. package/dist/index.cjs50.js +1 -1
  71. package/dist/index.cjs50.js.map +1 -1
  72. package/dist/index.cjs51.js +1 -1
  73. package/dist/index.cjs51.js.map +1 -1
  74. package/dist/index.cjs52.js +1 -1
  75. package/dist/index.cjs52.js.map +1 -1
  76. package/dist/index.cjs53.js +1 -1
  77. package/dist/index.cjs53.js.map +1 -1
  78. package/dist/index.cjs54.js +1 -1
  79. package/dist/index.cjs54.js.map +1 -1
  80. package/dist/index.cjs55.js +1 -1
  81. package/dist/index.cjs55.js.map +1 -1
  82. package/dist/index.cjs56.js +1 -1
  83. package/dist/index.cjs56.js.map +1 -1
  84. package/dist/index.cjs57.js +1 -1
  85. package/dist/index.cjs57.js.map +1 -1
  86. package/dist/index.cjs58.js +1 -1
  87. package/dist/index.cjs58.js.map +1 -1
  88. package/dist/index.cjs59.js +1 -1
  89. package/dist/index.cjs59.js.map +1 -1
  90. package/dist/index.cjs60.js +2 -0
  91. package/dist/index.cjs60.js.map +1 -0
  92. package/dist/index.cjs61.js +2 -0
  93. package/dist/index.cjs61.js.map +1 -0
  94. package/dist/index.cjs62.js +2 -0
  95. package/dist/index.cjs62.js.map +1 -0
  96. package/dist/index.cjs7.js +1 -1
  97. package/dist/index.cjs8.js +1 -1
  98. package/dist/index.cjs9.js +1 -1
  99. package/dist/index.d.ts +2 -0
  100. package/dist/index.d.ts.map +1 -1
  101. package/dist/index.es.js +208 -206
  102. package/dist/index.es.js.map +1 -1
  103. package/dist/index.es10.js +1 -1
  104. package/dist/index.es11.js +1 -1
  105. package/dist/index.es12.js +2 -2
  106. package/dist/index.es13.js +1 -1
  107. package/dist/index.es14.js +1 -1
  108. package/dist/index.es15.js +1 -1
  109. package/dist/index.es16.js +1 -1
  110. package/dist/index.es17.js +1 -1
  111. package/dist/index.es19.js +1 -1
  112. package/dist/index.es20.js +1 -1
  113. package/dist/index.es21.js +1 -1
  114. package/dist/index.es22.js +1 -1
  115. package/dist/index.es23.js +1 -1
  116. package/dist/index.es24.js +1 -1
  117. package/dist/index.es25.js +3 -3
  118. package/dist/index.es26.js +2 -2
  119. package/dist/index.es27.js +1 -1
  120. package/dist/index.es28.js +1 -1
  121. package/dist/index.es29.js +330 -138
  122. package/dist/index.es29.js.map +1 -1
  123. package/dist/index.es3.js +1 -1
  124. package/dist/index.es30.js +145 -37
  125. package/dist/index.es30.js.map +1 -1
  126. package/dist/index.es31.js +41 -150
  127. package/dist/index.es31.js.map +1 -1
  128. package/dist/index.es32.js +177 -253
  129. package/dist/index.es32.js.map +1 -1
  130. package/dist/index.es33.js +253 -185
  131. package/dist/index.es33.js.map +1 -1
  132. package/dist/index.es34.js +174 -18
  133. package/dist/index.es34.js.map +1 -1
  134. package/dist/index.es35.js +29 -16
  135. package/dist/index.es35.js.map +1 -1
  136. package/dist/index.es36.js +15 -92
  137. package/dist/index.es36.js.map +1 -1
  138. package/dist/index.es37.js +91 -189
  139. package/dist/index.es37.js.map +1 -1
  140. package/dist/index.es38.js +165 -71
  141. package/dist/index.es38.js.map +1 -1
  142. package/dist/index.es39.js +85 -84
  143. package/dist/index.es39.js.map +1 -1
  144. package/dist/index.es4.js +1 -1
  145. package/dist/index.es40.js +92 -17
  146. package/dist/index.es40.js.map +1 -1
  147. package/dist/index.es41.js +19 -21
  148. package/dist/index.es41.js.map +1 -1
  149. package/dist/index.es42.js +19 -26
  150. package/dist/index.es42.js.map +1 -1
  151. package/dist/index.es43.js +22 -25
  152. package/dist/index.es43.js.map +1 -1
  153. package/dist/index.es44.js +23 -172
  154. package/dist/index.es44.js.map +1 -1
  155. package/dist/index.es45.js +180 -19
  156. package/dist/index.es45.js.map +1 -1
  157. package/dist/index.es46.js +19 -97
  158. package/dist/index.es46.js.map +1 -1
  159. package/dist/index.es47.js +76 -533
  160. package/dist/index.es47.js.map +1 -1
  161. package/dist/index.es48.js +552 -11
  162. package/dist/index.es48.js.map +1 -1
  163. package/dist/index.es49.js +13 -45
  164. package/dist/index.es49.js.map +1 -1
  165. package/dist/index.es5.js +1 -1
  166. package/dist/index.es50.js +44 -19
  167. package/dist/index.es50.js.map +1 -1
  168. package/dist/index.es51.js +19 -12
  169. package/dist/index.es51.js.map +1 -1
  170. package/dist/index.es52.js +13 -25
  171. package/dist/index.es52.js.map +1 -1
  172. package/dist/index.es53.js +23 -202
  173. package/dist/index.es53.js.map +1 -1
  174. package/dist/index.es54.js +203 -34
  175. package/dist/index.es54.js.map +1 -1
  176. package/dist/index.es55.js +43 -12
  177. package/dist/index.es55.js.map +1 -1
  178. package/dist/index.es56.js +12 -28
  179. package/dist/index.es56.js.map +1 -1
  180. package/dist/index.es57.js +30 -34
  181. package/dist/index.es57.js.map +1 -1
  182. package/dist/index.es58.js +37 -19
  183. package/dist/index.es58.js.map +1 -1
  184. package/dist/index.es59.js +20 -6
  185. package/dist/index.es59.js.map +1 -1
  186. package/dist/index.es60.js +9 -0
  187. package/dist/index.es60.js.map +1 -0
  188. package/dist/index.es61.js +270 -0
  189. package/dist/index.es61.js.map +1 -0
  190. package/dist/index.es62.js +6271 -0
  191. package/dist/index.es62.js.map +1 -0
  192. package/dist/index.es7.js +1 -1
  193. package/dist/index.es8.js +1 -1
  194. package/dist/index.es9.js +1 -1
  195. package/dist/style.css +151 -0
  196. package/package.json +14 -13
@@ -1,7 +1,7 @@
1
1
  import * as a from "react";
2
2
  import { ChevronLeftIcon as x, ChevronRightIcon as b, ChevronDownIcon as w } from "lucide-react";
3
3
  import { getDefaultClassNames as g, DayPicker as h } from "react-day-picker";
4
- import { cn as e } from "./index.es59.js";
4
+ import { cn as e } from "./index.es60.js";
5
5
  import { buttonVariants as m, Button as _ } from "./index.es10.js";
6
6
  function C({
7
7
  className: c,
@@ -1,5 +1,5 @@
1
1
  import * as e from "react";
2
- import { cn as d } from "./index.es59.js";
2
+ import { cn as d } from "./index.es60.js";
3
3
  const o = e.forwardRef(({ className: a, ...r }, t) => /* @__PURE__ */ e.createElement(
4
4
  "div",
5
5
  {
@@ -1,7 +1,7 @@
1
1
  import * as e from "react";
2
2
  import P from "embla-carousel-react";
3
3
  import { ArrowLeft as S, ArrowRight as R } from "lucide-react";
4
- import { cn as m } from "./index.es59.js";
4
+ import { cn as m } from "./index.es60.js";
5
5
  import { Button as x } from "./index.es10.js";
6
6
  const w = e.createContext(null);
7
7
  function d() {
@@ -1,6 +1,6 @@
1
1
  import * as e from "react";
2
2
  import * as C from "recharts";
3
- import { cn as i } from "./index.es59.js";
3
+ import { cn as i } from "./index.es60.js";
4
4
  const $ = { light: "", dark: ".dark" }, k = e.createContext(null);
5
5
  function w() {
6
6
  const s = e.useContext(k);
@@ -1,7 +1,7 @@
1
1
  import * as e from "react";
2
2
  import * as t from "@radix-ui/react-checkbox";
3
3
  import { Check as o, Minus as s } from "lucide-react";
4
- import { cn as a } from "./index.es59.js";
4
+ import { cn as a } from "./index.es60.js";
5
5
  const b = e.forwardRef(({ className: d, ...r }, i) => /* @__PURE__ */ e.createElement(
6
6
  t.Root,
7
7
  {
@@ -1,7 +1,7 @@
1
1
  import * as e from "react";
2
2
  import { Command as m } from "cmdk";
3
3
  import { Search as n } from "lucide-react";
4
- import { cn as o } from "./index.es59.js";
4
+ import { cn as o } from "./index.es60.js";
5
5
  import { Dialog as s, DialogContent as p } from "./index.es21.js";
6
6
  const d = e.forwardRef(({ className: t, ...a }, r) => /* @__PURE__ */ e.createElement(
7
7
  m,
@@ -1,7 +1,7 @@
1
1
  import * as e from "react";
2
2
  import * as t from "@radix-ui/react-context-menu";
3
3
  import { Check as l, Circle as i, ChevronRight as m } from "lucide-react";
4
- import { cn as s } from "./index.es59.js";
4
+ import { cn as s } from "./index.es60.js";
5
5
  const w = t.Root, E = t.Trigger, M = t.Group, v = t.Portal, R = t.Sub, I = t.RadioGroup, c = e.forwardRef(({ className: a, inset: o, children: n, ...r }, d) => /* @__PURE__ */ e.createElement(
6
6
  t.SubTrigger,
7
7
  {
@@ -1,7 +1,7 @@
1
1
  import * as e from "react";
2
2
  import * as t from "@radix-ui/react-dialog";
3
3
  import { X as r } from "lucide-react";
4
- import { cn as l } from "./index.es59.js";
4
+ import { cn as l } from "./index.es60.js";
5
5
  const N = t.Root, x = t.Trigger, d = t.Portal, D = t.Close, n = e.forwardRef(({ className: a, ...o }, s) => /* @__PURE__ */ e.createElement(
6
6
  t.Overlay,
7
7
  {
@@ -1,6 +1,6 @@
1
1
  import * as e from "react";
2
2
  import { Drawer as t } from "vaul";
3
- import { cn as o } from "./index.es59.js";
3
+ import { cn as o } from "./index.es60.js";
4
4
  const m = ({
5
5
  shouldScaleBackground: r = !0,
6
6
  ...a
@@ -1,7 +1,7 @@
1
1
  import * as e from "react";
2
2
  import * as t from "@radix-ui/react-dropdown-menu";
3
3
  import { Check as i, Circle as l, ChevronRight as m } from "lucide-react";
4
- import { cn as s } from "./index.es59.js";
4
+ import { cn as s } from "./index.es60.js";
5
5
  const v = t.Root, D = t.Trigger, E = t.Group, M = t.Portal, R = t.Sub, I = t.RadioGroup, c = e.forwardRef(({ className: o, inset: a, children: n, ...r }, d) => /* @__PURE__ */ e.createElement(
6
6
  t.SubTrigger,
7
7
  {
@@ -1,6 +1,6 @@
1
1
  import * as n from "react";
2
2
  import { cva as i } from "class-variance-authority";
3
- import { cn as a } from "./index.es59.js";
3
+ import { cn as a } from "./index.es60.js";
4
4
  function c({ className: t, ...e }) {
5
5
  return /* @__PURE__ */ n.createElement(
6
6
  "div",
@@ -1,8 +1,8 @@
1
1
  import { useMemo as n } from "react";
2
2
  import { cva as s } from "class-variance-authority";
3
- import { cn as l } from "./index.es59.js";
4
- import { Label as c } from "./index.es35.js";
5
- import { Separator as f } from "./index.es45.js";
3
+ import { cn as l } from "./index.es60.js";
4
+ import { Label as c } from "./index.es36.js";
5
+ import { Separator as f } from "./index.es46.js";
6
6
  function h({ className: t, ...e }) {
7
7
  return /* @__PURE__ */ React.createElement(
8
8
  "fieldset",
@@ -1,8 +1,8 @@
1
1
  import * as e from "react";
2
2
  import { Slot as f } from "@radix-ui/react-slot";
3
3
  import { FormProvider as u, useFormContext as F, Controller as p } from "react-hook-form";
4
- import { cn as a } from "./index.es59.js";
5
- import { Label as I } from "./index.es35.js";
4
+ import { cn as a } from "./index.es60.js";
5
+ import { Label as I } from "./index.es36.js";
6
6
  const h = u, c = e.createContext(null), R = ({
7
7
  ...r
8
8
  }) => /* @__PURE__ */ e.createElement(c.Provider, { value: { name: r.name } }, /* @__PURE__ */ e.createElement(p, { ...r })), i = () => {
@@ -1,6 +1,6 @@
1
1
  import * as o from "react";
2
2
  import * as t from "@radix-ui/react-hover-card";
3
- import { cn as n } from "./index.es59.js";
3
+ import { cn as n } from "./index.es60.js";
4
4
  const p = t.Root, f = t.Trigger, s = o.forwardRef(({ className: e, align: a = "center", sideOffset: r = 4, ...d }, i) => /* @__PURE__ */ o.createElement(
5
5
  t.Content,
6
6
  {
@@ -1,5 +1,5 @@
1
1
  import * as e from "react";
2
- import { cn as l } from "./index.es59.js";
2
+ import { cn as l } from "./index.es60.js";
3
3
  const a = e.forwardRef(
4
4
  ({ className: i, type: r, ...t }, o) => /* @__PURE__ */ e.createElement(
5
5
  "input",
@@ -1,154 +1,346 @@
1
- import * as a from "react";
2
- import { cva as s } from "class-variance-authority";
3
- import { cn as r } from "./index.es59.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.es55.js";
7
- function h({ className: e, ...t }) {
8
- return /* @__PURE__ */ a.createElement(
9
- "div",
1
+ import * as e from "react";
2
+ import { startOfMonth as g, addMonths as _, isAfter as v, isBefore as W, setMonth as le, setYear as ie, format as ce } from "date-fns";
3
+ import { CalendarDays as de, ChevronLeft as fe, ChevronDown as U, ChevronRight as me } from "lucide-react";
4
+ import { DayPicker as ue } from "react-day-picker";
5
+ import { cn as p } from "./index.es60.js";
6
+ import { Button as F } from "./index.es10.js";
7
+ import { Popover as be, PopoverTrigger as pe, PopoverContent as xe } from "./index.es41.js";
8
+ const he = "dd/MM/yyyy", ge = "DD/MM/YYYY - DD/MM/YYYY", we = Array.from(
9
+ { length: 12 },
10
+ (t, o) => new Date(2020, o, 1).toLocaleString("default", { month: "long" })
11
+ ), D = (t, o, s) => W(t, o) ? o : v(t, s) ? s : t, M = (t) => {
12
+ if (!(!t?.from && !t?.to))
13
+ return t.from && t.to && v(t.from, t.to) ? {
14
+ from: t.to,
15
+ to: t.from
16
+ } : {
17
+ from: t.from,
18
+ to: t.to
19
+ };
20
+ }, N = (t, o) => {
21
+ if (t)
22
+ return ce(t, o);
23
+ }, ve = (t, o) => {
24
+ const s = N(t?.from, o), m = N(t?.to, o);
25
+ return !s || !m ? "" : `${s} - ${m}`;
26
+ }, Ee = (t, o) => {
27
+ const s = N(t?.from, o) ?? "DD/MM/YYYY", m = N(t?.to, o) ?? "DD/MM/YYYY";
28
+ return `${s} - ${m}`;
29
+ };
30
+ function I({
31
+ label: t,
32
+ month: o,
33
+ minMonth: s,
34
+ maxMonth: m,
35
+ minDate: C,
36
+ maxDate: S,
37
+ selectedDate: Y,
38
+ disabledMatcher: w,
39
+ disabled: x,
40
+ years: E,
41
+ onMonthChange: l,
42
+ onSelectDate: k
43
+ }) {
44
+ const P = () => {
45
+ l(_(o, -1));
46
+ }, d = () => {
47
+ l(_(o, 1));
48
+ }, u = x || !v(o, s), f = x || !W(o, m);
49
+ return /* @__PURE__ */ e.createElement("div", { className: "w-full min-w-0" }, /* @__PURE__ */ e.createElement("div", { className: "flex items-center gap-2 md:gap-3" }, /* @__PURE__ */ e.createElement(
50
+ "button",
10
51
  {
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
52
+ type: "button",
53
+ onClick: P,
54
+ disabled: u,
55
+ className: p(
56
+ "inline-flex h-10 w-10 items-center justify-center rounded-[8px] text-[#6e6d71] transition-colors",
57
+ "hover:bg-[#f5f5f5] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#1d1c20]/20",
58
+ "disabled:cursor-not-allowed disabled:opacity-40"
28
59
  ),
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
- }
60
+ "aria-label": `Previous month for ${t.toLowerCase()}`
43
61
  },
44
- defaultVariants: {
45
- align: "inline-start"
46
- }
47
- }
48
- );
49
- function v({
50
- className: e,
51
- align: t = "inline-start",
52
- ...o
53
- }) {
54
- return /* @__PURE__ */ a.createElement(
55
- "div",
62
+ /* @__PURE__ */ e.createElement(fe, { className: "h-6 w-6" })
63
+ ), /* @__PURE__ */ e.createElement("div", { className: "relative min-w-0 flex-1" }, /* @__PURE__ */ e.createElement(
64
+ "select",
56
65
  {
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();
66
+ value: o.getMonth(),
67
+ onChange: (r) => {
68
+ const b = Number(r.target.value);
69
+ l(le(o, b));
63
70
  },
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
- }
71
+ disabled: x,
72
+ className: p(
73
+ "h-14 w-full appearance-none rounded-[14px] border border-[#b7b7b9] bg-white px-5 pr-11 text-left text-[16px] font-medium leading-[22px] text-[#111111]",
74
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#1d1c20]/20",
75
+ "disabled:cursor-not-allowed disabled:bg-[#f2f2f2] disabled:text-[#b3b3b3]"
76
+ ),
77
+ "aria-label": `Month for ${t.toLowerCase()}`
78
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,
79
+ we.map((r, b) => /* @__PURE__ */ e.createElement("option", { key: r, value: b }, r))
80
+ ), /* @__PURE__ */ e.createElement(U, { className: "pointer-events-none absolute right-4 top-1/2 h-5 w-5 -translate-y-1/2 text-[#7f7d83]" })), /* @__PURE__ */ e.createElement("div", { className: "relative w-[132px] shrink-0" }, /* @__PURE__ */ e.createElement(
81
+ "select",
93
82
  {
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
83
+ value: o.getFullYear(),
84
+ onChange: (r) => {
85
+ const b = Number(r.target.value);
86
+ l(ie(o, b));
87
+ },
88
+ disabled: x,
89
+ className: p(
90
+ "h-14 w-full appearance-none rounded-[14px] border border-[#b7b7b9] bg-white px-5 pr-10 text-left text-[16px] font-medium leading-[22px] text-[#111111]",
91
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#1d1c20]/20",
92
+ "disabled:cursor-not-allowed disabled:bg-[#f2f2f2] disabled:text-[#b3b3b3]"
109
93
  ),
110
- ...t
111
- }
112
- );
113
- }
114
- function w({
115
- className: e,
116
- ...t
117
- }) {
118
- return /* @__PURE__ */ a.createElement(
119
- p,
94
+ "aria-label": `Year for ${t.toLowerCase()}`
95
+ },
96
+ E.map((r) => /* @__PURE__ */ e.createElement("option", { key: r, value: r }, r))
97
+ ), /* @__PURE__ */ e.createElement(U, { className: "pointer-events-none absolute right-4 top-1/2 h-5 w-5 -translate-y-1/2 text-[#7f7d83]" })), /* @__PURE__ */ e.createElement(
98
+ "button",
120
99
  {
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
100
+ type: "button",
101
+ onClick: d,
102
+ disabled: f,
103
+ className: p(
104
+ "inline-flex h-10 w-10 items-center justify-center rounded-[8px] text-[#6e6d71] transition-colors",
105
+ "hover:bg-[#f5f5f5] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#1d1c20]/20",
106
+ "disabled:cursor-not-allowed disabled:opacity-40"
125
107
  ),
126
- ...t
127
- }
128
- );
129
- }
130
- function G({
131
- className: e,
132
- ...t
133
- }) {
134
- return /* @__PURE__ */ a.createElement(
135
- l,
108
+ "aria-label": `Next month for ${t.toLowerCase()}`
109
+ },
110
+ /* @__PURE__ */ e.createElement(me, { className: "h-6 w-6" })
111
+ )), /* @__PURE__ */ e.createElement("p", { className: "mt-4 text-center text-[16px] font-medium leading-[22px] text-[#666666]" }, t), /* @__PURE__ */ e.createElement(
112
+ ue,
136
113
  {
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
114
+ mode: "single",
115
+ month: o,
116
+ onMonthChange: l,
117
+ selected: Y,
118
+ onSelect: k,
119
+ showOutsideDays: !0,
120
+ fixedWeeks: !0,
121
+ hideNavigation: !0,
122
+ disabled: [
123
+ { before: C },
124
+ { after: S },
125
+ ...w ? [w] : []
126
+ ],
127
+ className: "mt-2 p-0",
128
+ classNames: {
129
+ root: "w-full",
130
+ months: "w-full",
131
+ month: "w-full",
132
+ month_caption: "hidden",
133
+ month_grid: "w-full border-collapse",
134
+ weekdays: "grid grid-cols-7",
135
+ weekday: "h-10 text-center text-[16px] font-medium leading-[22px] text-[#666666]",
136
+ weeks: "grid gap-1",
137
+ week: "grid grid-cols-7",
138
+ day: "flex h-12 w-full items-center justify-center p-0",
139
+ day_button: "h-10 w-10 rounded-[12px] border border-transparent bg-transparent p-0 text-[18px] font-normal leading-none text-[#444444] transition-colors hover:border-[#cccccc] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#2bbd8f]/25 aria-selected:border-[#2bbd8f] aria-selected:text-[#111111]",
140
+ selected: "",
141
+ today: "font-medium",
142
+ outside: "text-[#a4a4a8]",
143
+ disabled: "pointer-events-none text-[#d3d3d6]",
144
+ hidden: "invisible"
145
+ }
143
146
  }
144
- );
147
+ ));
145
148
  }
149
+ const ye = e.forwardRef(
150
+ ({
151
+ value: t,
152
+ defaultValue: o,
153
+ onValueChange: s,
154
+ wrapperClassName: m,
155
+ popoverClassName: C,
156
+ className: S,
157
+ placeholder: Y = ge,
158
+ dateFormat: w = he,
159
+ minYear: x = 2e3,
160
+ maxYear: E = 2100,
161
+ disabled: l,
162
+ ...k
163
+ }, P) => {
164
+ const d = Math.min(x, E), u = Math.max(x, E), f = e.useMemo(
165
+ () => g(new Date(d, 0, 1)),
166
+ [d]
167
+ ), r = e.useMemo(
168
+ () => g(new Date(u, 11, 1)),
169
+ [u]
170
+ ), b = e.useMemo(() => new Date(d, 0, 1), [d]), R = e.useMemo(
171
+ () => new Date(u, 11, 31),
172
+ [u]
173
+ ), O = e.useMemo(
174
+ () => Array.from(
175
+ { length: u - d + 1 },
176
+ (n, c) => d + c
177
+ ),
178
+ [d, u]
179
+ ), $ = t !== void 0, [q, G] = e.useState(
180
+ M(o)
181
+ ), h = M($ ? t : q), A = e.useCallback(
182
+ (n) => {
183
+ const c = g(/* @__PURE__ */ new Date()), a = D(
184
+ g(n?.from ?? c),
185
+ f,
186
+ r
187
+ ), ae = n?.to ? g(n.to) : _(a, 1), se = D(ae, f, r);
188
+ return {
189
+ start: a,
190
+ end: se
191
+ };
192
+ },
193
+ [f, r]
194
+ ), [L, T] = e.useState(!1), [i, V] = e.useState(
195
+ h
196
+ ), j = A(h), [J, B] = e.useState(j.start), [K, z] = e.useState(j.end), y = e.useCallback(
197
+ (n) => {
198
+ const c = M(n);
199
+ V(c);
200
+ const a = A(c);
201
+ B(a.start), z(a.end);
202
+ },
203
+ [A]
204
+ );
205
+ e.useEffect(() => {
206
+ L || y(h);
207
+ }, [h, L, y]);
208
+ const Q = (n) => {
209
+ B(D(g(n), f, r));
210
+ }, X = (n) => {
211
+ z(D(g(n), f, r));
212
+ }, Z = (n) => {
213
+ n && V((c) => {
214
+ const a = {
215
+ from: n,
216
+ to: c?.to
217
+ };
218
+ return a.to && v(n, a.to) && (a.to = n), a;
219
+ });
220
+ }, ee = (n) => {
221
+ n && V((c) => {
222
+ const a = {
223
+ from: c?.from,
224
+ to: n
225
+ };
226
+ return a.from && v(a.from, n) && (a.from = n), a;
227
+ });
228
+ }, te = () => {
229
+ y(h), T(!1);
230
+ }, ne = () => {
231
+ const n = M(i);
232
+ $ || G(n), s?.(n), T(!1);
233
+ }, oe = !!(i?.from && i?.to), H = ve(h, w), re = Ee(i, w);
234
+ return /* @__PURE__ */ e.createElement("div", { className: p("w-full", m) }, /* @__PURE__ */ e.createElement(
235
+ be,
236
+ {
237
+ open: L,
238
+ onOpenChange: (n) => {
239
+ l || (n && y(h), T(n));
240
+ }
241
+ },
242
+ /* @__PURE__ */ e.createElement(pe, { asChild: !0 }, /* @__PURE__ */ e.createElement(
243
+ "button",
244
+ {
245
+ ref: P,
246
+ type: "button",
247
+ disabled: l,
248
+ className: p(
249
+ "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",
250
+ "focus-visible:outline-none focus-visible:border-[#1D1C20] focus-visible:ring-0",
251
+ "disabled:cursor-not-allowed disabled:bg-[#f2f2f2] disabled:text-[#9ca3af] disabled:opacity-100",
252
+ S
253
+ ),
254
+ ...k
255
+ },
256
+ /* @__PURE__ */ e.createElement(
257
+ "span",
258
+ {
259
+ className: p(
260
+ "truncate text-[14px] font-normal leading-[20px]",
261
+ H ? "text-[#111111]" : "text-[#b3b3b3]"
262
+ )
263
+ },
264
+ H || Y
265
+ ),
266
+ /* @__PURE__ */ e.createElement(de, { className: "ml-3 h-4 w-4 shrink-0 text-[#111111]" })
267
+ )),
268
+ /* @__PURE__ */ e.createElement(
269
+ xe,
270
+ {
271
+ align: "start",
272
+ sideOffset: 10,
273
+ className: p(
274
+ "w-[min(96vw,980px)] rounded-[16px] border border-[#d8d8da] bg-[#f7f7f8] p-4 shadow-[0px_12px_24px_rgba(0,0,0,0.08)] md:p-6",
275
+ C
276
+ )
277
+ },
278
+ /* @__PURE__ */ e.createElement("div", { className: "grid gap-8 md:grid-cols-2 md:gap-10" }, /* @__PURE__ */ e.createElement(
279
+ I,
280
+ {
281
+ label: "Start date",
282
+ month: J,
283
+ minMonth: f,
284
+ maxMonth: r,
285
+ minDate: b,
286
+ maxDate: R,
287
+ selectedDate: i?.from,
288
+ disabledMatcher: i?.to ? { after: i.to } : void 0,
289
+ disabled: l,
290
+ years: O,
291
+ onMonthChange: Q,
292
+ onSelectDate: Z
293
+ }
294
+ ), /* @__PURE__ */ e.createElement(
295
+ I,
296
+ {
297
+ label: "End date",
298
+ month: K,
299
+ minMonth: f,
300
+ maxMonth: r,
301
+ minDate: b,
302
+ maxDate: R,
303
+ selectedDate: i?.to,
304
+ disabledMatcher: i?.from ? { before: i.from } : void 0,
305
+ disabled: l,
306
+ years: O,
307
+ onMonthChange: X,
308
+ onSelectDate: ee
309
+ }
310
+ )),
311
+ /* @__PURE__ */ e.createElement("div", { className: "mt-5 border-t border-[#d8d8da] pt-4" }, /* @__PURE__ */ e.createElement(
312
+ "input",
313
+ {
314
+ readOnly: !0,
315
+ value: re,
316
+ className: "h-10 w-full rounded-[8px] border border-[#e6e6e6] bg-white px-3 py-2 text-[14px] leading-[20px] text-[#111111] outline-none transition-colors placeholder:text-[#b3b3b3] focus-visible:border-[#1D1C20]",
317
+ "aria-label": "Selected date range"
318
+ }
319
+ ), /* @__PURE__ */ e.createElement("div", { className: "mt-4 flex justify-end gap-3" }, /* @__PURE__ */ e.createElement(
320
+ F,
321
+ {
322
+ type: "button",
323
+ variant: "outline",
324
+ className: "h-12 rounded-[14px] px-7 text-[14px]",
325
+ onClick: te
326
+ },
327
+ "Cancel"
328
+ ), /* @__PURE__ */ e.createElement(
329
+ F,
330
+ {
331
+ type: "button",
332
+ className: "h-12 rounded-[14px] px-7 text-[14px]",
333
+ disabled: !oe,
334
+ onClick: ne
335
+ },
336
+ "Apply"
337
+ )))
338
+ )
339
+ ));
340
+ }
341
+ );
342
+ ye.displayName = "DateRangePicker";
146
343
  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
344
+ ye as DateRangePicker
153
345
  };
154
346
  //# sourceMappingURL=index.es29.js.map