@kanzo-tech/ui 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/dist/analytics.d.ts +1 -0
  2. package/dist/analytics.d.ts.map +1 -1
  3. package/dist/charts/chart-inputs.d.ts +6 -5
  4. package/dist/charts/chart-inputs.d.ts.map +1 -1
  5. package/dist/charts/chart-inputs.js +78 -77
  6. package/dist/charts/chart-inputs.js.map +1 -1
  7. package/dist/charts/chart-marks.d.ts +2 -1
  8. package/dist/charts/chart-marks.d.ts.map +1 -1
  9. package/dist/charts/chart-marks.js.map +1 -1
  10. package/dist/charts/chart-root.d.ts +8 -3
  11. package/dist/charts/chart-root.d.ts.map +1 -1
  12. package/dist/charts/chart-root.js +60 -60
  13. package/dist/charts/chart-root.js.map +1 -1
  14. package/dist/charts/chart-spec.d.ts +11 -4
  15. package/dist/charts/chart-spec.d.ts.map +1 -1
  16. package/dist/charts/chart-spec.js +44 -40
  17. package/dist/charts/chart-spec.js.map +1 -1
  18. package/dist/charts/chart-stat.d.ts +3 -2
  19. package/dist/charts/chart-stat.d.ts.map +1 -1
  20. package/dist/charts/chart-stat.js +10 -9
  21. package/dist/charts/chart-stat.js.map +1 -1
  22. package/dist/composites/language-picker.d.ts +7 -0
  23. package/dist/composites/language-picker.d.ts.map +1 -1
  24. package/dist/composites/language-picker.js +38 -36
  25. package/dist/composites/language-picker.js.map +1 -1
  26. package/dist/index.d.ts +1 -1
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +661 -660
  29. package/dist/lib/control-size.d.ts +26 -0
  30. package/dist/lib/control-size.d.ts.map +1 -0
  31. package/dist/lib/control-size.js +11 -0
  32. package/dist/lib/control-size.js.map +1 -0
  33. package/dist/simples/button.d.ts.map +1 -1
  34. package/dist/simples/button.js +34 -33
  35. package/dist/simples/button.js.map +1 -1
  36. package/dist/simples/checkbox.d.ts.map +1 -1
  37. package/dist/simples/checkbox.js +42 -42
  38. package/dist/simples/checkbox.js.map +1 -1
  39. package/dist/simples/combobox.d.ts.map +1 -1
  40. package/dist/simples/combobox.js +48 -49
  41. package/dist/simples/combobox.js.map +1 -1
  42. package/dist/simples/date-picker.d.ts +58 -2
  43. package/dist/simples/date-picker.d.ts.map +1 -1
  44. package/dist/simples/date-picker.js +207 -76
  45. package/dist/simples/date-picker.js.map +1 -1
  46. package/dist/simples/input-group.d.ts +9 -9
  47. package/dist/simples/input-group.d.ts.map +1 -1
  48. package/dist/simples/input-group.js +68 -78
  49. package/dist/simples/input-group.js.map +1 -1
  50. package/dist/simples/input.d.ts +9 -9
  51. package/dist/simples/input.d.ts.map +1 -1
  52. package/dist/simples/input.js +13 -14
  53. package/dist/simples/input.js.map +1 -1
  54. package/dist/simples/native-select.d.ts +9 -9
  55. package/dist/simples/native-select.d.ts.map +1 -1
  56. package/dist/simples/native-select.js +29 -28
  57. package/dist/simples/native-select.js.map +1 -1
  58. package/dist/simples/number-input.d.ts +9 -9
  59. package/dist/simples/number-input.d.ts.map +1 -1
  60. package/dist/simples/number-input.js +27 -27
  61. package/dist/simples/number-input.js.map +1 -1
  62. package/dist/simples/password-input.d.ts.map +1 -1
  63. package/dist/simples/password-input.js +24 -20
  64. package/dist/simples/password-input.js.map +1 -1
  65. package/dist/simples/pin-input.d.ts +9 -9
  66. package/dist/simples/pin-input.d.ts.map +1 -1
  67. package/dist/simples/pin-input.js +30 -29
  68. package/dist/simples/pin-input.js.map +1 -1
  69. package/dist/simples/radio-group.d.ts.map +1 -1
  70. package/dist/simples/radio-group.js +44 -43
  71. package/dist/simples/radio-group.js.map +1 -1
  72. package/dist/simples/segment-group.d.ts +8 -0
  73. package/dist/simples/segment-group.d.ts.map +1 -1
  74. package/dist/simples/segment-group.js +55 -47
  75. package/dist/simples/segment-group.js.map +1 -1
  76. package/dist/simples/switch.d.ts.map +1 -1
  77. package/dist/simples/switch.js +18 -12
  78. package/dist/simples/switch.js.map +1 -1
  79. package/dist/simples/tags-input.d.ts.map +1 -1
  80. package/dist/simples/tags-input.js +44 -39
  81. package/dist/simples/tags-input.js.map +1 -1
  82. package/dist/simples/toggle.d.ts +9 -9
  83. package/dist/simples/toggle.d.ts.map +1 -1
  84. package/dist/simples/toggle.js +24 -23
  85. package/dist/simples/toggle.js.map +1 -1
  86. package/package.json +5 -5
@@ -1,76 +1,207 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as c } from "react/jsx-runtime";
3
- import { useDatePickerContext as m, DatePicker as i } from "@ark-ui/react/date-picker";
4
- import { useFieldContext as g } from "@ark-ui/react/field";
5
- import { Portal as k } from "@ark-ui/react/portal";
6
- import { CalendarIcon as h, ClockIcon as P } from "lucide-react";
7
- import { cn as s } from "../lib/cn.js";
8
- import { Button as x } from "./button.js";
9
- import { Calendar as f, CalendarPresetTrigger as C } from "./calendar.js";
10
- import { InputGroup as d, InputGroupInput as l, InputGroupAddon as p, InputGroupButton as v } from "./input-group.js";
11
- const j = m, V = (r) => {
12
- const { positioning: a = { placement: "top" }, slot: n, ...o } = r, t = g();
13
- return /* @__PURE__ */ e(
14
- f,
2
+ import { jsx as a, jsxs as b } from "react/jsx-runtime";
3
+ import { useDatePickerContext as D, DatePicker as m } from "@ark-ui/react/date-picker";
4
+ import { useFieldContext as P } from "@ark-ui/react/field";
5
+ import { DateInput as y } from "@ark-ui/react/date-input";
6
+ import { Portal as z } from "@ark-ui/react/portal";
7
+ import { useLocale as S } from "./locale.js";
8
+ import { ClockIcon as V, CalendarIcon as $ } from "lucide-react";
9
+ import { toCalendarDateTime as C, parseDateTime as G, CalendarDate as L, CalendarDateTime as F } from "@internationalized/date";
10
+ import { useContext as T, createContext as j } from "react";
11
+ import { cn as x } from "../lib/cn.js";
12
+ import { Calendar as B, CalendarPresetTrigger as H } from "./calendar.js";
13
+ import { InputGroup as k, InputGroupInput as w, InputGroupAddon as I, InputGroupButton as A } from "./input-group.js";
14
+ const oe = D, N = j(null), K = /(\d{1,2}):(\d{2})(?::(\d{2}))?(?:\s*([ap])\.?\s*m?\.?)?/i;
15
+ function R(r, o, s) {
16
+ var h;
17
+ try {
18
+ return G(r.replace(/(Z|[+-]\d{2}:\d{2})$/, ""));
19
+ } catch {
20
+ }
21
+ const e = K.exec(r), c = (h = r.replace((e == null ? void 0 : e[0]) ?? "", " ").match(/\d+/g)) == null ? void 0 : h.map(Number);
22
+ if ((c == null ? void 0 : c.length) !== 3) return;
23
+ const t = /^\D*\d{4}\b/.test(r) ? ["year", "month", "day"] : new Intl.DateTimeFormat(o, { year: "numeric", month: "2-digit", day: "2-digit" }).formatToParts(new Date(2001, 10, 22)).map((u) => u.type).filter((u) => u === "year" || u === "month" || u === "day"), d = (u) => c[t.indexOf(u)], i = s && "hour" in s ? s : void 0;
24
+ let p = Number((e == null ? void 0 : e[1]) ?? (i == null ? void 0 : i.hour) ?? 0);
25
+ e != null && e[4] && (p = p % 12 + (e[4].toLowerCase() === "p" ? 12 : 0));
26
+ const g = Number((e == null ? void 0 : e[2]) ?? (i == null ? void 0 : i.minute) ?? 0), v = Number((e == null ? void 0 : e[3]) ?? (i == null ? void 0 : i.second) ?? 0), l = new L(d("year"), d("month"), d("day"));
27
+ if (!(l.month !== d("month") || l.day !== d("day") || p > 23 || g > 59))
28
+ return new F(l.year, l.month, l.day, p, g, v);
29
+ }
30
+ const ie = (r) => {
31
+ const {
32
+ granularity: o = "day",
33
+ positioning: s = { placement: "top" },
34
+ onValueChange: e,
35
+ slot: c,
36
+ ...n
37
+ } = r, t = P(), d = o !== "day", { locale: i } = S(), p = n.disabled ?? (t == null ? void 0 : t.disabled), g = n.invalid ?? (t == null ? void 0 : t.invalid), v = n.readOnly ?? (t == null ? void 0 : t.readOnly), l = n.required ?? (t == null ? void 0 : t.required);
38
+ return /* @__PURE__ */ a(
39
+ N,
15
40
  {
16
- disabled: t == null ? void 0 : t.disabled,
17
- inline: !1,
18
- invalid: t == null ? void 0 : t.invalid,
19
- positioning: a,
20
- readOnly: t == null ? void 0 : t.readOnly,
21
- required: t == null ? void 0 : t.required,
22
- ...o,
23
- slot: n ?? "date-picker"
41
+ value: d ? {
42
+ granularity: o,
43
+ locale: n.locale ?? i,
44
+ name: n.name,
45
+ disabled: p,
46
+ readOnly: v,
47
+ invalid: g,
48
+ required: l,
49
+ min: n.min,
50
+ max: n.max
51
+ } : null,
52
+ children: /* @__PURE__ */ a(
53
+ B,
54
+ {
55
+ closeOnSelect: !d,
56
+ disabled: t == null ? void 0 : t.disabled,
57
+ inline: !1,
58
+ invalid: t == null ? void 0 : t.invalid,
59
+ positioning: s,
60
+ readOnly: t == null ? void 0 : t.readOnly,
61
+ required: t == null ? void 0 : t.required,
62
+ ...n,
63
+ onValueChange: d ? (h) => e == null ? void 0 : e({
64
+ ...h,
65
+ value: h.value.map((u) => C(u))
66
+ }) : e,
67
+ slot: c ?? "date-picker"
68
+ }
69
+ )
24
70
  }
25
71
  );
26
- }, q = (r) => {
27
- const { className: a, children: n, slot: o, ...t } = r;
28
- return /* @__PURE__ */ e(i.Control, { "data-slot": "date-picker-control", children: /* @__PURE__ */ e(
29
- i.Trigger,
72
+ }, se = (r) => {
73
+ const { className: o, children: s, slot: e, ...c } = r;
74
+ return /* @__PURE__ */ a(m.Control, { "data-slot": "date-picker-control", children: /* @__PURE__ */ a(
75
+ m.Trigger,
30
76
  {
31
- className: s(
77
+ className: x(
32
78
  "justify-start",
33
79
  "text-start data-placeholder-shown:[&>span]:text-muted-foreground",
34
80
  "active:scale-100",
35
81
  "[&_svg:not([class*='text-'])]:opacity-64",
36
- a
82
+ o
37
83
  ),
38
- ...t,
39
- "data-slot": o ?? "date-picker-trigger",
40
- children: n
84
+ ...c,
85
+ "data-slot": e ?? "date-picker-trigger",
86
+ children: s
41
87
  }
42
88
  ) });
43
- }, B = (r) => {
44
- const { size: a, className: n, slot: o, ...t } = r;
45
- return /* @__PURE__ */ e(i.Control, { "data-slot": "date-picker-control", children: /* @__PURE__ */ c(d, { size: a, children: [
46
- /* @__PURE__ */ e(i.Input, { asChild: !0, ...t, children: /* @__PURE__ */ e(l, { slot: o ?? "date-picker-input" }) }),
47
- /* @__PURE__ */ e(p, { align: "inline-end", children: /* @__PURE__ */ e(v, { asChild: !0, size: "icon-sm", variant: "ghost", children: /* @__PURE__ */ e(i.Trigger, { asChild: !0, children: /* @__PURE__ */ e(x, { slot: "date-picker-trigger", variant: "ghost", children: /* @__PURE__ */ e(h, { "aria-hidden": !0, className: "text-muted-foreground" }) }) }) }) })
89
+ }, de = (r) => {
90
+ const o = T(N);
91
+ return o ? /* @__PURE__ */ a(Z, { ...r, timed: o }) : /* @__PURE__ */ a(W, { ...r });
92
+ }, O = () => /* @__PURE__ */ a(I, { align: "inline-end", children: /* @__PURE__ */ a(m.Trigger, { asChild: !0, children: /* @__PURE__ */ a(A, { size: "icon-sm", slot: "date-picker-trigger", variant: "ghost", children: /* @__PURE__ */ a($, { "aria-hidden": !0, className: "text-muted-foreground" }) }) }) }), W = (r) => {
93
+ const { size: o, slot: s, ...e } = r;
94
+ return /* @__PURE__ */ a(m.Control, { "data-slot": "date-picker-control", children: /* @__PURE__ */ b(k, { size: o, children: [
95
+ /* @__PURE__ */ a(m.Input, { asChild: !0, ...e, children: /* @__PURE__ */ a(w, { slot: s ?? "date-picker-input" }) }),
96
+ /* @__PURE__ */ a(O, {})
97
+ ] }) });
98
+ }, Z = (r) => {
99
+ const { size: o, slot: s, timed: e, className: c, "aria-label": n } = r, t = D();
100
+ return /* @__PURE__ */ a(m.Control, { "data-slot": "date-picker-control", children: /* @__PURE__ */ b(k, { size: o, children: [
101
+ /* @__PURE__ */ b(
102
+ y.Root,
103
+ {
104
+ "aria-invalid": e.invalid || void 0,
105
+ className: x(
106
+ "flex min-w-0 flex-1 items-center self-stretch px-3",
107
+ "text-base md:text-sm",
108
+ c
109
+ ),
110
+ "data-slot": s ?? "date-picker-input",
111
+ disabled: e.disabled,
112
+ granularity: e.granularity,
113
+ invalid: e.invalid,
114
+ locale: e.locale,
115
+ max: e.max,
116
+ min: e.min,
117
+ name: e.name,
118
+ onValueChange: (d) => {
119
+ const [i] = d.value;
120
+ t.setValue(i ? [C(i)] : []);
121
+ },
122
+ onPaste: (d) => {
123
+ const i = R(
124
+ d.clipboardData.getData("text/plain").trim(),
125
+ e.locale,
126
+ t.value[0]
127
+ );
128
+ i && t.setValue([i]);
129
+ },
130
+ readOnly: e.readOnly,
131
+ required: e.required,
132
+ value: t.value.map((d) => C(d)),
133
+ children: [
134
+ /* @__PURE__ */ a(y.Control, { className: "flex min-w-0 items-center", "data-slot": "date-picker-segments", children: /* @__PURE__ */ a(y.SegmentGroup, { "aria-label": n, className: "flex items-center gap-px", children: /* @__PURE__ */ a(y.SegmentContext, { children: (d) => /* @__PURE__ */ a(
135
+ y.Segment,
136
+ {
137
+ className: x(
138
+ "tabular-nums",
139
+ "rounded-sm px-0.5 outline-none",
140
+ "focus:bg-primary focus:text-primary-foreground",
141
+ "data-placeholder-shown:text-faint",
142
+ "data-[type=literal]:select-none data-[type=literal]:px-px data-[type=literal]:text-muted-foreground",
143
+ "data-readonly:cursor-default",
144
+ "group-data-invalid/input-group:text-destructive-foreground",
145
+ "group-data-invalid/input-group:focus:bg-destructive group-data-invalid/input-group:focus:text-destructive-content"
146
+ ),
147
+ "data-slot": "date-picker-segment",
148
+ segment: d,
149
+ suppressHydrationWarning: !0
150
+ }
151
+ ) }) }) }),
152
+ /* @__PURE__ */ a(y.HiddenInput, {})
153
+ ]
154
+ }
155
+ ),
156
+ /* @__PURE__ */ a(O, {})
48
157
  ] }) });
49
- }, O = (r) => {
50
- const { id: a, value: n, defaultValue: o, className: t, ...u } = r;
51
- return /* @__PURE__ */ c(d, { ...u, children: [
52
- /* @__PURE__ */ e(p, { children: /* @__PURE__ */ e(P, {}) }),
53
- /* @__PURE__ */ e(
54
- l,
158
+ }, f = (r) => String(r).padStart(2, "0"), ce = (r) => {
159
+ const o = T(N);
160
+ return o ? /* @__PURE__ */ a(_, { granularity: o.granularity, ...r }) : /* @__PURE__ */ a(q, { ...r });
161
+ }, _ = (r) => {
162
+ const { granularity: o, step: s, onChange: e, ...c } = r, n = D(), t = n.value[0], d = (s ?? (o === "second" ? 1 : 60)) < 60, i = t && "hour" in t ? t : void 0, p = i ? `${f(i.hour)}:${f(i.minute)}${d ? `:${f(i.second)}` : ""}` : `00:00${d ? ":00" : ""}`;
163
+ return /* @__PURE__ */ a(
164
+ q,
165
+ {
166
+ ...c,
167
+ onChange: (g) => {
168
+ e == null || e(g);
169
+ const [v, l, h = 0] = g.target.value.split(":").map(Number);
170
+ v === void 0 || l === void 0 || n.setValue([
171
+ C(t ?? n.focusedValue).set({ hour: v, minute: l, second: h })
172
+ ]);
173
+ },
174
+ step: s ?? (o === "second" ? 1 : 60),
175
+ value: p
176
+ }
177
+ );
178
+ }, q = (r) => {
179
+ const { size: o, step: s = 60, className: e, ...c } = r, n = P();
180
+ return /* @__PURE__ */ b(k, { size: o, children: [
181
+ /* @__PURE__ */ a(I, { children: /* @__PURE__ */ a(V, {}) }),
182
+ /* @__PURE__ */ a(
183
+ w,
55
184
  {
56
- className: s(
185
+ "aria-invalid": (n == null ? void 0 : n.invalid) || void 0,
186
+ className: x(
57
187
  "[&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none",
58
- t
188
+ e
59
189
  ),
60
- defaultValue: o,
61
- id: a,
62
- step: "1",
63
- type: "time",
64
- value: n
190
+ disabled: n == null ? void 0 : n.disabled,
191
+ readOnly: n == null ? void 0 : n.readOnly,
192
+ required: n == null ? void 0 : n.required,
193
+ ...c,
194
+ step: s,
195
+ type: "time"
65
196
  }
66
197
  )
67
198
  ] });
68
- }, A = (r) => {
69
- const { className: a, slot: n, ...o } = r;
70
- return /* @__PURE__ */ e(k, { children: /* @__PURE__ */ e(i.Positioner, { "data-slot": "date-picker-positioner", children: /* @__PURE__ */ e(
71
- i.Content,
199
+ }, le = (r) => {
200
+ const { className: o, slot: s, ...e } = r;
201
+ return /* @__PURE__ */ a(z, { children: /* @__PURE__ */ a(m.Positioner, { "data-slot": "date-picker-positioner", children: /* @__PURE__ */ a(
202
+ m.Content,
72
203
  {
73
- className: s(
204
+ className: x(
74
205
  "[--cell-size:--spacing(8)]",
75
206
  "z-[calc(50+var(--layer-index,0))]",
76
207
  "w-fit min-w-72",
@@ -84,40 +215,40 @@ const j = m, V = (r) => {
84
215
  "data-[state=closed]:animate-out data-[state=open]:animate-in",
85
216
  "data-[state=closed]:zoom-out-[98%] data-[state=open]:zoom-in-[98%]",
86
217
  "motion-reduce:animate-none!",
87
- a
218
+ o
88
219
  ),
89
- ...o,
90
- "data-slot": n ?? "date-picker-content"
220
+ ...e,
221
+ "data-slot": s ?? "date-picker-content"
91
222
  }
92
223
  ) }) });
93
- }, F = (r) => {
94
- const { className: a, slot: n, ...o } = r;
95
- return /* @__PURE__ */ e(
96
- i.ValueText,
224
+ }, ue = (r) => {
225
+ const { className: o, slot: s, ...e } = r;
226
+ return /* @__PURE__ */ a(
227
+ m.ValueText,
97
228
  {
98
- className: s("font-medium text-sm", a),
99
- ...o,
100
- "data-slot": n ?? "date-picker-value"
229
+ className: x("font-medium text-sm", o),
230
+ ...e,
231
+ "data-slot": s ?? "date-picker-value"
101
232
  }
102
233
  );
103
- }, _ = ({
234
+ }, me = ({
104
235
  slot: r,
105
- ...a
106
- }) => /* @__PURE__ */ e(
107
- C,
236
+ ...o
237
+ }) => /* @__PURE__ */ a(
238
+ H,
108
239
  {
109
- ...a,
240
+ ...o,
110
241
  slot: r ?? "date-picker-preset-trigger"
111
242
  }
112
243
  );
113
244
  export {
114
- V as DatePicker,
115
- A as DatePickerContent,
116
- B as DatePickerInput,
117
- _ as DatePickerPresetTrigger,
118
- O as DatePickerTimer,
119
- q as DatePickerTrigger,
120
- F as DatePickerValue,
121
- j as useDatePicker
245
+ ie as DatePicker,
246
+ le as DatePickerContent,
247
+ de as DatePickerInput,
248
+ me as DatePickerPresetTrigger,
249
+ ce as DatePickerTimer,
250
+ se as DatePickerTrigger,
251
+ ue as DatePickerValue,
252
+ oe as useDatePicker
122
253
  };
123
254
  //# sourceMappingURL=date-picker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker.js","sources":["../../src/simples/date-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n DatePicker as ArkDatePicker,\n useDatePickerContext,\n} from \"@ark-ui/react/date-picker\";\nimport { type UseFieldContext, useFieldContext } from \"@ark-ui/react/field\";\nimport { Portal } from \"@ark-ui/react/portal\";\nimport { CalendarIcon, ClockIcon } from \"lucide-react\";\nimport type React from \"react\";\nimport { cn } from \"../lib/cn\";\nimport { Button } from \"./button\";\nimport {\n Calendar,\n CalendarPresetTrigger,\n} from \"./calendar\";\nimport type { Input, InputProps } from \"./input\";\nimport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupInput,\n} from \"./input-group\";\n\nexport const useDatePicker = useDatePickerContext;\n\n// Ark's `useDatePicker` reads no `useFieldContext` (it takes environment and locale only), so a\n// `Field disabled` greyed the input while the popover still opened and a click still wrote a value.\n// Bridged here the way `RadioGroup` does it: state flags only, explicit props win, and with no\n// `Field` ancestor every flag is `undefined`, which Ark strips before the machine sees it.\nexport const DatePicker = (props: React.ComponentProps<typeof Calendar>) => {\n const { positioning = { placement: \"top\" }, slot, ...rest } = props;\n\n const field: UseFieldContext | undefined = useFieldContext();\n\n return (\n <Calendar\n disabled={field?.disabled}\n inline={false}\n invalid={field?.invalid}\n positioning={positioning}\n readOnly={field?.readOnly}\n required={field?.required}\n {...rest}\n slot={slot ?? \"date-picker\"}\n />\n );\n};\n\nexport const DatePickerTrigger = (\n props: React.ComponentProps<typeof ArkDatePicker.Trigger>\n) => {\n const { className, children, slot, ...rest } = props;\n\n return (\n <ArkDatePicker.Control data-slot=\"date-picker-control\">\n <ArkDatePicker.Trigger\n className={cn(\n \"justify-start\",\n \"text-start data-placeholder-shown:[&>span]:text-muted-foreground\",\n \"active:scale-100\",\n \"[&_svg:not([class*='text-'])]:opacity-64\",\n className\n )}\n {...rest}\n data-slot={slot ?? \"date-picker-trigger\"}\n >\n {children}\n </ArkDatePicker.Trigger>\n </ArkDatePicker.Control>\n );\n};\n\ninterface DatePickerInputProps\n extends Omit<React.ComponentProps<typeof ArkDatePicker.Input>, \"size\">,\n InputProps {}\n\nexport const DatePickerInput = (props: DatePickerInputProps) => {\n const { size, className, slot, ...rest } = props;\n\n return (\n <ArkDatePicker.Control data-slot=\"date-picker-control\">\n <InputGroup size={size}>\n <ArkDatePicker.Input asChild {...rest}>\n <InputGroupInput slot={slot ?? \"date-picker-input\"} />\n </ArkDatePicker.Input>\n\n <InputGroupAddon align=\"inline-end\">\n {/* One size for the chain, and it used to declare two: the outer `InputGroupButton` asked\n for `icon-sm` and the inner `Button` — which exists only because Ark's Trigger needs a\n child to hand its props to — overrode it with `icon-md`. The outer one is the size a\n control inside a group has, so the inner declares none. */}\n <InputGroupButton asChild size=\"icon-sm\" variant=\"ghost\">\n <ArkDatePicker.Trigger asChild>\n <Button slot=\"date-picker-trigger\" variant=\"ghost\">\n <CalendarIcon aria-hidden className=\"text-muted-foreground\" />\n </Button>\n </ArkDatePicker.Trigger>\n </InputGroupButton>\n </InputGroupAddon>\n </InputGroup>\n </ArkDatePicker.Control>\n );\n};\n\nexport const DatePickerTimer = (props: React.ComponentProps<typeof Input>) => {\n const { id, value, defaultValue, className, ...rest } = props;\n\n return (\n <InputGroup {...rest}>\n <InputGroupAddon>\n <ClockIcon />\n </InputGroupAddon>\n <InputGroupInput\n className={cn(\n \"[&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none\",\n className\n )}\n defaultValue={defaultValue}\n id={id}\n step=\"1\"\n type=\"time\"\n value={value}\n />\n </InputGroup>\n );\n};\n\nexport const DatePickerContent = (\n props: React.ComponentProps<typeof ArkDatePicker.Content>\n) => {\n const { className, slot, ...rest } = props;\n\n return (\n <Portal>\n <ArkDatePicker.Positioner data-slot=\"date-picker-positioner\">\n <ArkDatePicker.Content\n className={cn(\n \"[--cell-size:--spacing(8)]\",\n \"z-[calc(50+var(--layer-index,0))]\",\n \"w-fit min-w-72\",\n \"p-3\",\n \"bg-popover\",\n \"text-popover-foreground\",\n \"rounded-box border shadow-lg/5\",\n \"outline-none\",\n \"origin-(--transform-origin)\",\n \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n \"data-[state=closed]:animate-out data-[state=open]:animate-in\",\n \"data-[state=closed]:zoom-out-[98%] data-[state=open]:zoom-in-[98%]\",\n \"motion-reduce:animate-none!\",\n className\n )}\n {...rest}\n data-slot={slot ?? \"date-picker-content\"}\n />\n </ArkDatePicker.Positioner>\n </Portal>\n );\n};\n\nexport const DatePickerValue = (\n props: React.ComponentProps<typeof ArkDatePicker.ValueText>\n) => {\n const { className, slot, ...rest } = props;\n\n return (\n <ArkDatePicker.ValueText\n className={cn(\"font-medium text-sm\", className)}\n {...rest}\n data-slot={slot ?? \"date-picker-value\"}\n />\n );\n};\n\nexport const DatePickerPresetTrigger = ({\n slot,\n ...rest\n}: React.ComponentProps<typeof ArkDatePicker.PresetTrigger>) => (\n <CalendarPresetTrigger\n {...rest}\n slot={slot ?? \"date-picker-preset-trigger\"}\n />\n);\n"],"names":[],"mappings":";;;;;;;;;;AAwBO;AAOL;AAIA;AACE;AAAC;AAAA;AACkB;AACT;AACQ;AAChB;AACiB;AACA;AACb;AACU;AAAA;AAGpB;AAKE;AAEA;AAEI;AAAe;AAAd;AACY;AACT;AACA;AACA;AACA;AACA;AAAA;AAEE;AACe;AAElB;AAAA;AAIT;AAOE;AAEA;AAGM;AAEA;AAcA;AAIR;AAGE;AAEA;AAEI;AAEA;AACA;AAAC;AAAA;AACY;AACT;AACA;AAAA;AAEF;AACA;AACK;AACA;AACL;AAAA;AAAA;AAIR;AAKE;AAEA;AAGM;AAAe;AAAd;AACY;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAEE;AACe;AAAA;AAK7B;AAKE;AAEA;AACE;AAAe;AAAd;AAC+C;AAC1C;AACe;AAAA;AAGzB;AAEwC;AACtC;AAEF;AACE;AAAC;AAAA;AACK;AACU;AAChB;;;;;;;;;;;"}
1
+ {"version":3,"file":"date-picker.js","sources":["../../src/simples/date-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n DatePicker as ArkDatePicker,\n useDatePickerContext,\n} from \"@ark-ui/react/date-picker\";\nimport { type UseFieldContext, useFieldContext } from \"@ark-ui/react/field\";\nimport { DateInput as ArkDateInput } from \"@ark-ui/react/date-input\";\nimport { Portal } from \"@ark-ui/react/portal\";\nimport { useLocale } from \"./locale\";\nimport { CalendarIcon, ClockIcon } from \"lucide-react\";\nimport {\n CalendarDate,\n CalendarDateTime,\n type DateValue,\n parseDateTime,\n toCalendarDateTime,\n} from \"@internationalized/date\";\nimport { createContext, useContext } from \"react\";\nimport type React from \"react\";\nimport { cn } from \"../lib/cn\";\nimport {\n Calendar,\n CalendarPresetTrigger,\n} from \"./calendar\";\nimport type { Input, InputProps } from \"./input\";\nimport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupInput,\n} from \"./input-group\";\n\nexport const useDatePicker = useDatePickerContext;\n\n/**\n * What the picker holds. `\"day\"` is a date; `\"minute\"` and `\"second\"` are a date **and** a time —\n * one value, one input, one popover.\n */\nexport type DatePickerGranularity = \"day\" | \"minute\" | \"second\";\n\n// Provided by `DatePicker` and read by `DatePickerInput` and `DatePickerTimer`, which is how they\n// know they are inside a timed picker (and so edit the picker's value) rather than standing alone.\n// A context of ours rather than a probe of Ark's, whose hook throws outside a picker.\nconst TimedContext = createContext<TimedPicker | null>(null);\n\n/**\n * What a timed picker's input needs from the picker around it: its own machine reads none of this,\n * because that input is Ark's segmented `DateInput`, a second machine bound to the picker's value.\n */\ninterface TimedPicker {\n granularity: Exclude<DatePickerGranularity, \"day\">;\n locale: string;\n name?: string;\n disabled?: boolean;\n readOnly?: boolean;\n invalid?: boolean;\n required?: boolean;\n min?: DateValue;\n max?: DateValue;\n}\n\nconst CLOCK = /(\\d{1,2}):(\\d{2})(?::(\\d{2}))?(?:\\s*([ap])\\.?\\s*m?\\.?)?/i;\n\n/**\n * A date and a time read from pasted text: an ISO string (`2026-03-14T18:30`), or the locale's own\n * order (`14/03/2026 18:30`, `3/14/2026, 6:30 PM`). Ark's segments take a paste only as a bare ISO\n * date and drop it silently otherwise, which is the one thing a segmented field owes a form that\n * receives a copied timestamp. A date with no time keeps the time of `kept`, and is midnight\n * without one. `undefined` for anything that is not a date.\n */\nfunction parsePasted(text: string, locale: string, kept?: DateValue): DateValue | undefined {\n try {\n return parseDateTime(text.replace(/(Z|[+-]\\d{2}:\\d{2})$/, \"\"));\n } catch {\n // Not ISO: read it in the locale's field order.\n }\n const clock = CLOCK.exec(text);\n const numbers = text.replace(clock?.[0] ?? \"\", \" \").match(/\\d+/g)?.map(Number);\n if (numbers?.length !== 3) return undefined;\n const yearFirst = /^\\D*\\d{4}\\b/.test(text);\n const order = yearFirst\n ? [\"year\", \"month\", \"day\"]\n : new Intl.DateTimeFormat(locale, { year: \"numeric\", month: \"2-digit\", day: \"2-digit\" })\n .formatToParts(new Date(2001, 10, 22))\n .map((part) => part.type)\n .filter((type) => type === \"year\" || type === \"month\" || type === \"day\");\n const at = (type: string) => numbers[order.indexOf(type)] as number;\n const held = kept && \"hour\" in kept ? kept : undefined;\n let hour = Number(clock?.[1] ?? held?.hour ?? 0);\n if (clock?.[4]) hour = (hour % 12) + (clock[4].toLowerCase() === \"p\" ? 12 : 0);\n const minute = Number(clock?.[2] ?? held?.minute ?? 0);\n const second = Number(clock?.[3] ?? held?.second ?? 0);\n const date = new CalendarDate(at(\"year\"), at(\"month\"), at(\"day\"));\n if (date.month !== at(\"month\") || date.day !== at(\"day\") || hour > 23 || minute > 59) {\n return undefined;\n }\n return new CalendarDateTime(date.year, date.month, date.day, hour, minute, second);\n}\n\nexport interface DatePickerProps extends React.ComponentProps<typeof Calendar> {\n /**\n * What the picker holds. With `\"minute\"` or `\"second\"` the value is a date **and** a time: the\n * input is segmented — day, month, year, hour, minute in the locale's order and clock — so both can\n * be typed from empty, picking a day keeps the time, a\n * `DatePickerTimer` in the popover sets the time, and the popover stays open after a day is\n * picked so the time can be set. The value is then a `CalendarDateTime` — build one with\n * `parseDateTime` — and a day picked while there is none arrives at midnight.\n *\n * @default \"day\"\n */\n granularity?: DatePickerGranularity;\n}\n\n// Ark's `useDatePicker` reads no `useFieldContext` (it takes environment and locale only), so a\n// `Field disabled` greyed the input while the popover still opened and a click still wrote a value.\n// Bridged here the way `RadioGroup` does it: state flags only, explicit props win, and with no\n// `Field` ancestor every flag is `undefined`, which Ark strips before the machine sees it.\nexport const DatePicker = (props: DatePickerProps) => {\n const {\n granularity = \"day\",\n positioning = { placement: \"top\" },\n onValueChange,\n slot,\n ...rest\n } = props;\n\n const field: UseFieldContext | undefined = useFieldContext();\n const timed = granularity !== \"day\";\n const { locale: contextLocale } = useLocale();\n const disabled = rest.disabled ?? field?.disabled;\n const invalid = rest.invalid ?? field?.invalid;\n const readOnly = rest.readOnly ?? field?.readOnly;\n const required = rest.required ?? field?.required;\n\n return (\n <TimedContext\n value={\n timed\n ? {\n granularity,\n locale: rest.locale ?? contextLocale,\n name: rest.name,\n disabled,\n readOnly,\n invalid,\n required,\n min: rest.min,\n max: rest.max,\n }\n : null\n }\n >\n <Calendar\n closeOnSelect={!timed}\n disabled={field?.disabled}\n inline={false}\n invalid={field?.invalid}\n positioning={positioning}\n readOnly={field?.readOnly}\n required={field?.required}\n {...rest}\n onValueChange={\n timed\n ? (details) =>\n onValueChange?.({\n ...details,\n value: details.value.map((v) => toCalendarDateTime(v)),\n })\n : onValueChange\n }\n slot={slot ?? \"date-picker\"}\n />\n </TimedContext>\n );\n};\n\nexport const DatePickerTrigger = (\n props: React.ComponentProps<typeof ArkDatePicker.Trigger>\n) => {\n const { className, children, slot, ...rest } = props;\n\n return (\n <ArkDatePicker.Control data-slot=\"date-picker-control\">\n <ArkDatePicker.Trigger\n className={cn(\n \"justify-start\",\n \"text-start data-placeholder-shown:[&>span]:text-muted-foreground\",\n \"active:scale-100\",\n \"[&_svg:not([class*='text-'])]:opacity-64\",\n className\n )}\n {...rest}\n data-slot={slot ?? \"date-picker-trigger\"}\n >\n {children}\n </ArkDatePicker.Trigger>\n </ArkDatePicker.Control>\n );\n};\n\ninterface DatePickerInputProps\n extends Omit<React.ComponentProps<typeof ArkDatePicker.Input>, \"size\">,\n InputProps {}\n\n/**\n * The picker's field, and the calendar button beside it.\n *\n * In a date picker it is a text input that reads what is typed in the locale's date format. In one\n * with a `granularity` it is **segmented** — day, month, year, hour, minute and, in a 12-hour\n * locale, AM/PM, each its own editable part in the locale's order — because a date and a time cannot\n * be typed as one string: Ark's date input admits only digits and the date separator, so a `:` or\n * `PM` never gets in. The segments are Ark's `DateInput`, bound to the picker's value both ways.\n */\nexport const DatePickerInput = (props: DatePickerInputProps) => {\n const timed = useContext(TimedContext);\n return timed ? <SegmentedInput {...props} timed={timed} /> : <TextInput {...props} />;\n};\n\nconst CalendarButton = () => (\n <InputGroupAddon align=\"inline-end\">\n <ArkDatePicker.Trigger asChild>\n <InputGroupButton size=\"icon-sm\" slot=\"date-picker-trigger\" variant=\"ghost\">\n <CalendarIcon aria-hidden className=\"text-muted-foreground\" />\n </InputGroupButton>\n </ArkDatePicker.Trigger>\n </InputGroupAddon>\n);\n\nconst TextInput = (props: DatePickerInputProps) => {\n const { size, slot, ...rest } = props;\n\n return (\n <ArkDatePicker.Control data-slot=\"date-picker-control\">\n <InputGroup size={size}>\n <ArkDatePicker.Input asChild {...rest}>\n <InputGroupInput slot={slot ?? \"date-picker-input\"} />\n </ArkDatePicker.Input>\n <CalendarButton />\n </InputGroup>\n </ArkDatePicker.Control>\n );\n};\n\nconst SegmentedInput = (props: DatePickerInputProps & { timed: TimedPicker }) => {\n const { size, slot, timed, className, \"aria-label\": ariaLabel } = props;\n const api = useDatePickerContext();\n\n return (\n <ArkDatePicker.Control data-slot=\"date-picker-control\">\n <InputGroup size={size}>\n <ArkDateInput.Root\n aria-invalid={timed.invalid || undefined}\n className={cn(\n \"flex min-w-0 flex-1 items-center self-stretch px-3\",\n \"text-base md:text-sm\",\n className\n )}\n data-slot={slot ?? \"date-picker-input\"}\n disabled={timed.disabled}\n granularity={timed.granularity}\n invalid={timed.invalid}\n locale={timed.locale}\n max={timed.max}\n min={timed.min}\n name={timed.name}\n onValueChange={(details) => {\n const [value] = details.value;\n api.setValue(value ? [toCalendarDateTime(value)] : []);\n }}\n onPaste={(event) => {\n const pasted = parsePasted(\n event.clipboardData.getData(\"text/plain\").trim(),\n timed.locale,\n api.value[0]\n );\n if (pasted) api.setValue([pasted]);\n }}\n readOnly={timed.readOnly}\n required={timed.required}\n value={api.value.map((v) => toCalendarDateTime(v))}\n >\n <ArkDateInput.Control className=\"flex min-w-0 items-center\" data-slot=\"date-picker-segments\">\n <ArkDateInput.SegmentGroup aria-label={ariaLabel} className=\"flex items-center gap-px\">\n <ArkDateInput.SegmentContext>\n {(segment) => (\n <ArkDateInput.Segment\n className={cn(\n \"tabular-nums\",\n \"rounded-sm px-0.5 outline-none\",\n \"focus:bg-primary focus:text-primary-foreground\",\n \"data-placeholder-shown:text-faint\",\n \"data-[type=literal]:select-none data-[type=literal]:px-px data-[type=literal]:text-muted-foreground\",\n \"data-readonly:cursor-default\",\n \"group-data-invalid/input-group:text-destructive-foreground\",\n \"group-data-invalid/input-group:focus:bg-destructive group-data-invalid/input-group:focus:text-destructive-content\"\n )}\n data-slot=\"date-picker-segment\"\n // The separators are the runtime's (`Intl`), and the server's and the browser's\n // ICU can disagree on which space one is.\n segment={segment}\n suppressHydrationWarning\n />\n )}\n </ArkDateInput.SegmentContext>\n </ArkDateInput.SegmentGroup>\n </ArkDateInput.Control>\n <ArkDateInput.HiddenInput />\n </ArkDateInput.Root>\n <CalendarButton />\n </InputGroup>\n </ArkDatePicker.Control>\n );\n};\n\nexport interface DatePickerTimerProps\n extends Omit<React.ComponentProps<typeof Input>, \"size\" | \"step\" | \"type\"> {\n /**\n * The control height, one of the shared sizes.\n *\n * @default \"md\"\n */\n size?: \"sm\" | \"md\" | \"lg\";\n /**\n * The step of the time input **in seconds**, as on `<input type=\"time\">`: `60` shows hours and\n * minutes, `1` adds seconds. Inside a `DatePicker` it follows the picker's `granularity`.\n *\n * @default 60\n */\n step?: number;\n}\n\nconst two = (n: number) => String(n).padStart(2, \"0\");\n\n/**\n * A time field: an `InputGroup` around `<input type=\"time\">` with a clock addon.\n *\n * **Inside a `DatePicker`'s `DatePickerContent` it is the picker's time**, and the picker is one\n * date-and-time field: the timer shows the hour and minute of the picker's value and setting it\n * sets the picker's value, so the input above and the calendar beside it follow. Choosing a time\n * before any date takes the day the calendar is showing. **Anywhere else it is a plain time input**\n * you control with `value` and `onChange`.\n *\n * Props go where they read naturally: `size` and the field state (`disabled`, `invalid`, `readOnly`,\n * `required`, taken from an ancestor `Field` unless given) apply to the field, `className` and every\n * other prop go to the `<input>` itself — so `aria-label`, `name` and `onChange` do what they say.\n * The group around it is `w-full`; size it with the element you put it in.\n */\nexport const DatePickerTimer = (props: DatePickerTimerProps) => {\n const timed = useContext(TimedContext);\n return timed ? (\n <PickerTimer granularity={timed.granularity} {...props} />\n ) : (\n <TimeInput {...props} />\n );\n};\n\nconst PickerTimer = (\n props: DatePickerTimerProps & { granularity: DatePickerGranularity }\n) => {\n const { granularity, step, onChange, ...rest } = props;\n const api = useDatePickerContext();\n const current = api.value[0];\n const seconds = (step ?? (granularity === \"second\" ? 1 : 60)) < 60;\n const time = current && \"hour\" in current ? current : undefined;\n const text = time\n ? `${two(time.hour)}:${two(time.minute)}${seconds ? `:${two(time.second)}` : \"\"}`\n : `00:00${seconds ? \":00\" : \"\"}`;\n\n return (\n <TimeInput\n {...rest}\n onChange={(event) => {\n onChange?.(event);\n const [hour, minute, second = 0] = event.target.value.split(\":\").map(Number);\n if (hour === undefined || minute === undefined) return;\n api.setValue([\n toCalendarDateTime(current ?? api.focusedValue).set({ hour, minute, second }),\n ]);\n }}\n step={step ?? (granularity === \"second\" ? 1 : 60)}\n value={text}\n />\n );\n};\n\nconst TimeInput = (props: DatePickerTimerProps) => {\n const { size, step = 60, className, ...rest } = props;\n const field: UseFieldContext | undefined = useFieldContext();\n\n return (\n <InputGroup size={size}>\n <InputGroupAddon>\n <ClockIcon />\n </InputGroupAddon>\n <InputGroupInput\n // Not the field's `id`: the label of a `Field` names the date input, and a second element\n // with that id would steal it.\n aria-invalid={field?.invalid || undefined}\n className={cn(\n \"[&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none\",\n className\n )}\n disabled={field?.disabled}\n readOnly={field?.readOnly}\n required={field?.required}\n {...rest}\n step={step}\n type=\"time\"\n />\n </InputGroup>\n );\n};\n\nexport const DatePickerContent = (\n props: React.ComponentProps<typeof ArkDatePicker.Content>\n) => {\n const { className, slot, ...rest } = props;\n\n return (\n <Portal>\n <ArkDatePicker.Positioner data-slot=\"date-picker-positioner\">\n <ArkDatePicker.Content\n className={cn(\n \"[--cell-size:--spacing(8)]\",\n \"z-[calc(50+var(--layer-index,0))]\",\n \"w-fit min-w-72\",\n \"p-3\",\n \"bg-popover\",\n \"text-popover-foreground\",\n \"rounded-box border shadow-lg/5\",\n \"outline-none\",\n \"origin-(--transform-origin)\",\n \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n \"data-[state=closed]:animate-out data-[state=open]:animate-in\",\n \"data-[state=closed]:zoom-out-[98%] data-[state=open]:zoom-in-[98%]\",\n \"motion-reduce:animate-none!\",\n className\n )}\n {...rest}\n data-slot={slot ?? \"date-picker-content\"}\n />\n </ArkDatePicker.Positioner>\n </Portal>\n );\n};\n\nexport const DatePickerValue = (\n props: React.ComponentProps<typeof ArkDatePicker.ValueText>\n) => {\n const { className, slot, ...rest } = props;\n\n return (\n <ArkDatePicker.ValueText\n className={cn(\"font-medium text-sm\", className)}\n {...rest}\n data-slot={slot ?? \"date-picker-value\"}\n />\n );\n};\n\nexport const DatePickerPresetTrigger = ({\n slot,\n ...rest\n}: React.ComponentProps<typeof ArkDatePicker.PresetTrigger>) => (\n <CalendarPresetTrigger\n {...rest}\n slot={slot ?? \"date-picker-preset-trigger\"}\n />\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;AAiCO;AAsCP;;AACE;AACE;AAA6D;AACvD;AAGR;AAEA;AAEA;AAQA;AACA;AACA;AAGA;AAGA;AACF;AAoBO;AACL;AAAM;AACU;AACa;AAC3B;AACA;AACG;AAWL;AACE;AAAC;AAAA;AAGO;AACE;AACuB;AACZ;AACX;AACA;AACA;AACA;AACU;AACA;AAEZ;AAGN;AAAC;AAAA;AACiB;AACC;AACT;AACQ;AAChB;AACiB;AACA;AACb;AAIoB;AACX;AACkD;AAEzD;AAEQ;AAAA;AAAA;AAChB;AAGN;AAKE;AAEA;AAEI;AAAe;AAAd;AACY;AACT;AACA;AACA;AACA;AACA;AAAA;AAEE;AACe;AAElB;AAAA;AAIT;AAgBE;AACA;AACF;AAaE;AAEA;AAGM;AAEA;AACgB;AAIxB;AAGE;AAGA;AAGM;AAAA;AAAc;AAAb;AACgC;AACpB;AACT;AACA;AACA;AAAA;AAEiB;AACH;AACG;AACJ;AACD;AACH;AACA;AACC;AAEV;AACA;AAAqD;AACvD;AAEE;AAAe;AAC6B;AACpC;AACK;AAEb;AAAiC;AACnC;AACgB;AACA;AACiC;AAEjD;AAIQ;AAAc;AAAb;AACY;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAEQ;AAGV;AACwB;AAAA;AAKlC;AAC0B;AAAA;AAAA;AAAA;AAEZ;AAIxB;AAoCE;AACA;AAKF;AAKE;AASA;AACE;AAAC;AAAA;AACK;AAEF;AACA;AACA;AACa;AACiE;AAC7E;AACH;AAC8C;AACvC;AAAA;AAGb;AAGE;AAGA;AAEI;AAEA;AACA;AAAC;AAAA;AAGiC;AACrB;AACT;AACA;AAAA;AAEe;AACA;AACA;AACb;AACJ;AACK;AAAA;AAAA;AAIb;AAKE;AAEA;AAGM;AAAe;AAAd;AACY;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAEE;AACe;AAAA;AAK7B;AAKE;AAEA;AACE;AAAe;AAAd;AAC+C;AAC1C;AACe;AAAA;AAGzB;AAEwC;AACtC;AAEF;AACE;AAAC;AAAA;AACK;AACU;AAChB;;;;;;;;;;;"}
@@ -6,21 +6,21 @@ import { Input } from './input';
6
6
  import { Textarea } from './textarea';
7
7
  declare const inpuGroupVariants: import('tailwind-variants').TVReturnType<{
8
8
  size: {
9
- sm: string[];
10
- md: string[];
11
- lg: string[];
9
+ readonly sm: "[--size:calc(var(--size-field)*7)]";
10
+ readonly md: "[--size:calc(var(--size-field)*8)]";
11
+ readonly lg: "[--size:calc(var(--size-field)*9)]";
12
12
  };
13
13
  }, undefined, string[], {
14
14
  size: {
15
- sm: string[];
16
- md: string[];
17
- lg: string[];
15
+ readonly sm: "[--size:calc(var(--size-field)*7)]";
16
+ readonly md: "[--size:calc(var(--size-field)*8)]";
17
+ readonly lg: "[--size:calc(var(--size-field)*9)]";
18
18
  };
19
19
  }, undefined, import('tailwind-variants').TVReturnType<{
20
20
  size: {
21
- sm: string[];
22
- md: string[];
23
- lg: string[];
21
+ readonly sm: "[--size:calc(var(--size-field)*7)]";
22
+ readonly md: "[--size:calc(var(--size-field)*8)]";
23
+ readonly lg: "[--size:calc(var(--size-field)*9)]";
24
24
  };
25
25
  }, undefined, string[], unknown, unknown, undefined>>;
26
26
  export interface InputGroupProps extends React.ComponentProps<typeof ark.div>, VariantProps<typeof inpuGroupVariants> {
@@ -1 +1 @@
1
- {"version":3,"file":"input-group.d.ts","sourceRoot":"","sources":["../../src/simples/input-group.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;qDAqDrB,CAAC;AAEH,MAAM,WAAW,eACf,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC,EAC1C,YAAY,CAAC,OAAO,iBAAiB,CAAC;CAAG;AAE7C,eAAO,MAAM,UAAU,GAAI,OAAO,eAAe,sBAYhD,CAAC;AAEF,QAAA,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;qDA8C3B,CAAC;AAEH,UAAU,oBACR,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC,EAC1C,YAAY,CAAC,OAAO,uBAAuB,CAAC;CAAG;AAEnD,eAAO,MAAM,eAAe,GAAI,OAAO,oBAAoB,sBAkB1D,CAAC;AAEF,QAAA,MAAM,wBAAwB;;QAUxB;;;;;;;;;;;;WAYG;;;;;;QAZH;;;;;;;;;;;;WAYG;;;;;;QAZH;;;;;;;;;;;;WAYG;;;;qDAQP,CAAC;AAEH,UAAU,qBACR,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,MAAM,CAAC,EACvD,YAAY,CAAC,OAAO,wBAAwB,CAAC;CAAG;AAEpD,eAAO,MAAM,gBAAgB,GAAI,OAAO,qBAAqB,sBAoB5D,CAAC;AAEF,eAAO,MAAM,cAAc,GACzB,OAAO,KAAK,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,sBAgB7C,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,OAAO,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,sBAiBxE,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,OAAO,KAAK,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC,sBAmB7C,CAAC"}
1
+ {"version":3,"file":"input-group.d.ts","sourceRoot":"","sources":["../../src/simples/input-group.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG1D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;qDAoCrB,CAAC;AAEH,MAAM,WAAW,eACf,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC,EAC1C,YAAY,CAAC,OAAO,iBAAiB,CAAC;CAAG;AAE7C,eAAO,MAAM,UAAU,GAAI,OAAO,eAAe,sBAYhD,CAAC;AAEF,QAAA,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;qDA8C3B,CAAC;AAEH,UAAU,oBACR,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC,EAC1C,YAAY,CAAC,OAAO,uBAAuB,CAAC;CAAG;AAEnD,eAAO,MAAM,eAAe,GAAI,OAAO,oBAAoB,sBAkB1D,CAAC;AAEF,QAAA,MAAM,wBAAwB;;QAUxB;;;;;;;;;;;;WAYG;;;;;;QAZH;;;;;;;;;;;;WAYG;;;;;;QAZH;;;;;;;;;;;;WAYG;;;;qDAWP,CAAC;AAEH,UAAU,qBACR,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,MAAM,CAAC,EACvD,YAAY,CAAC,OAAO,wBAAwB,CAAC;CAAG;AAEpD,eAAO,MAAM,gBAAgB,GAAI,OAAO,qBAAqB,sBAoB5D,CAAC;AAEF,eAAO,MAAM,cAAc,GACzB,OAAO,KAAK,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,sBAgB7C,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,OAAO,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,sBAoBxE,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,OAAO,KAAK,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC,sBAmB7C,CAAC"}