ml-uikit 1.1.5 → 1.1.7

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