@yuno-payments/dashboard-design-system 0.0.137 → 0.0.138-beta.2

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.
@@ -1,21 +1,21 @@
1
1
  import { j as e } from "../../../_virtual/jsx-runtime.js";
2
- import { forwardRef as x, useState as A, useMemo as M } from "react";
3
- import { Button as g } from "../../../vendor/shadcn/button.js";
2
+ import { forwardRef as f, useState as A, useMemo as M } from "react";
3
+ import { Button as j } from "../../../vendor/shadcn/button.js";
4
4
  import { Badge as C } from "../../../vendor/shadcn/badge.js";
5
5
  import { Separator as p } from "../../../vendor/shadcn/separator.js";
6
- import { Checkbox as Q } from "../../../vendor/shadcn/checkbox.js";
7
- import { RadioGroup as E, RadioGroupItem as L } from "../../../vendor/shadcn/radio-group.js";
6
+ import { Checkbox as E } from "../../../vendor/shadcn/checkbox.js";
7
+ import { RadioGroup as Q, RadioGroupItem as L } from "../../../vendor/shadcn/radio-group.js";
8
8
  import { Icon as y } from "../icon/icon.js";
9
- import { cn as u } from "../../../lib/utils.js";
9
+ import { cn as g } from "../../../lib/utils.js";
10
10
  import { Field as k } from "../field/field.js";
11
11
  import { Tooltip as v } from "../tooltip/tooltip.js";
12
- const F = x(
12
+ const F = f(
13
13
  ({ label: s, onRemove: t, className: n, ...l }, i) => /* @__PURE__ */ e.jsxs(
14
14
  C,
15
15
  {
16
16
  ref: i,
17
17
  variant: "secondary",
18
- className: u("h-8 gap-2 px-3 py-2 shadow-xs", n),
18
+ className: g("h-8 gap-2 px-3 py-2 shadow-xs", n),
19
19
  ...l,
20
20
  children: [
21
21
  /* @__PURE__ */ e.jsx("span", { className: "text-xs font-medium leading-none", children: s }),
@@ -33,49 +33,49 @@ const F = x(
33
33
  )
34
34
  );
35
35
  F.displayName = "FilterTag";
36
- const P = x(
36
+ const P = f(
37
37
  ({
38
38
  appliedFilters: s = [],
39
39
  onRemoveFilter: t,
40
40
  onClearAll: n,
41
41
  maxVisibleTags: l = 4,
42
42
  className: i,
43
- ...r
44
- }, d) => {
45
- const c = s.length > 0, h = s.slice(0, l), j = s.length - l;
43
+ ...c
44
+ }, r) => {
45
+ const o = s.length > 0, x = s.slice(0, l), u = s.length - l;
46
46
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-4", children: [
47
47
  /* @__PURE__ */ e.jsxs(
48
- g,
48
+ j,
49
49
  {
50
- ref: d,
50
+ ref: r,
51
51
  variant: "outline",
52
52
  size: "sm",
53
- className: u("h-8 gap-2 px-3 py-2", i),
54
- ...r,
53
+ className: g("h-8 gap-2 px-3 py-2", i),
54
+ ...c,
55
55
  children: [
56
56
  /* @__PURE__ */ e.jsx(y, { name: "FunnelSimple", className: "size-4" }),
57
57
  /* @__PURE__ */ e.jsx("span", { className: "text-xs font-medium leading-none", children: "Add filter" })
58
58
  ]
59
59
  }
60
60
  ),
61
- c && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
61
+ o && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
62
62
  /* @__PURE__ */ e.jsx(p, { orientation: "vertical", className: "h-5" }),
63
63
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
64
- h.map((f) => /* @__PURE__ */ e.jsx(
64
+ x.map((m) => /* @__PURE__ */ e.jsx(
65
65
  F,
66
66
  {
67
- label: f.label,
68
- onRemove: () => t?.(f.id)
67
+ label: m.label,
68
+ onRemove: () => t?.(m.id)
69
69
  },
70
- f.id
70
+ m.id
71
71
  )),
72
- j > 0 && /* @__PURE__ */ e.jsx(C, { variant: "default", className: "h-8 px-3 py-2 shadow-xs", children: /* @__PURE__ */ e.jsxs("span", { className: "text-xs font-medium leading-none", children: [
72
+ u > 0 && /* @__PURE__ */ e.jsx(C, { variant: "default", className: "h-8 px-3 py-2 shadow-xs", children: /* @__PURE__ */ e.jsxs("span", { className: "text-xs font-medium leading-none", children: [
73
73
  "+",
74
- j,
74
+ u,
75
75
  " more"
76
76
  ] }) }),
77
77
  n && /* @__PURE__ */ e.jsx(
78
- g,
78
+ j,
79
79
  {
80
80
  variant: "ghost",
81
81
  size: "sm",
@@ -86,7 +86,7 @@ const P = x(
86
86
  )
87
87
  ] })
88
88
  ] }),
89
- !c && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
89
+ !o && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
90
90
  /* @__PURE__ */ e.jsx(p, { orientation: "vertical", className: "h-5" }),
91
91
  /* @__PURE__ */ e.jsx("span", { className: "text-sm font-normal text-muted-foreground", children: "No filters applied" })
92
92
  ] })
@@ -94,43 +94,43 @@ const P = x(
94
94
  }
95
95
  );
96
96
  P.displayName = "FilterButton";
97
- const X = x(
97
+ const X = f(
98
98
  (s, t) => {
99
99
  const {
100
100
  title: n,
101
101
  items: l,
102
102
  className: i,
103
- searchable: r = !1,
104
- searchPlaceholder: d = "Search...",
105
- showActions: c = !1,
106
- enableSelectAll: h = !0,
107
- enableInverse: j = !0,
108
- enableNone: f = !0
109
- } = s, o = s.type || "checkbox", w = o === "radio", z = o === "checkbox" || !s.type, [N, I] = A(""), b = M(() => N ? l.filter(
103
+ searchable: c = !1,
104
+ searchPlaceholder: r = "Search...",
105
+ showActions: o = !1,
106
+ enableSelectAll: x = !0,
107
+ enableInverse: u = !0,
108
+ enableNone: m = !0
109
+ } = s, d = s.type || "checkbox", w = d === "radio", z = d === "checkbox" || !s.type, [N, I] = A(""), b = M(() => N ? l.filter(
110
110
  (a) => a.label.toLowerCase().includes(N.toLowerCase())
111
111
  ) : l, [l, N]), R = () => {
112
- if (o === "checkbox" && "selectedValues" in s) {
113
- const a = l.map((m) => m.value);
112
+ if (d === "checkbox" && "selectedValues" in s) {
113
+ const a = l.map((h) => h.value);
114
114
  s.onChange(a);
115
115
  }
116
116
  }, T = () => {
117
- if (o === "checkbox" && "selectedValues" in s) {
118
- const a = l.filter((m) => !s.selectedValues.includes(m.value)).map((m) => m.value);
117
+ if (d === "checkbox" && "selectedValues" in s) {
118
+ const a = l.filter((h) => !s.selectedValues.includes(h.value)).map((h) => h.value);
119
119
  s.onChange(a);
120
120
  }
121
121
  }, B = () => {
122
- o === "checkbox" && "selectedValues" in s ? s.onChange([]) : o === "radio" && "selectedValue" in s && s.onChange("");
122
+ d === "checkbox" && "selectedValues" in s ? s.onChange([]) : d === "radio" && "selectedValue" in s && s.onChange("");
123
123
  }, G = (a) => {
124
- if (o === "checkbox" && "selectedValues" in s) {
124
+ if (d === "checkbox" && "selectedValues" in s) {
125
125
  const O = s.selectedValues.includes(a) ? s.selectedValues.filter(($) => $ !== a) : [...s.selectedValues, a];
126
126
  s.onChange(O);
127
127
  }
128
128
  };
129
- return /* @__PURE__ */ e.jsxs("div", { ref: t, className: u("flex flex-col h-full", i), children: [
130
- r && /* @__PURE__ */ e.jsx(
129
+ return /* @__PURE__ */ e.jsxs("div", { ref: t, className: g("flex flex-col h-full", i), children: [
130
+ c && /* @__PURE__ */ e.jsx(
131
131
  k,
132
132
  {
133
- placeholder: d,
133
+ placeholder: r,
134
134
  value: N,
135
135
  onChange: (a) => I(a.target.value),
136
136
  startIcon: "MagnifyingGlass",
@@ -139,9 +139,9 @@ const X = x(
139
139
  ),
140
140
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between mb-1", children: [
141
141
  /* @__PURE__ */ e.jsx("span", { className: "text-sm font-normal text-foreground", children: n }),
142
- c && o === "checkbox" && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-2", children: [
143
- h && /* @__PURE__ */ e.jsx(
144
- g,
142
+ o && d === "checkbox" && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-2", children: [
143
+ x && /* @__PURE__ */ e.jsx(
144
+ j,
145
145
  {
146
146
  variant: "link",
147
147
  size: "sm",
@@ -150,8 +150,8 @@ const X = x(
150
150
  children: "Select all"
151
151
  }
152
152
  ),
153
- j && /* @__PURE__ */ e.jsx(
154
- g,
153
+ u && /* @__PURE__ */ e.jsx(
154
+ j,
155
155
  {
156
156
  variant: "link",
157
157
  size: "sm",
@@ -160,8 +160,8 @@ const X = x(
160
160
  children: "Inverse"
161
161
  }
162
162
  ),
163
- f && /* @__PURE__ */ e.jsx(
164
- g,
163
+ m && /* @__PURE__ */ e.jsx(
164
+ j,
165
165
  {
166
166
  variant: "link",
167
167
  size: "sm",
@@ -174,7 +174,7 @@ const X = x(
174
174
  ] }),
175
175
  /* @__PURE__ */ e.jsx(p, { className: "w-full mb-6" }),
176
176
  w && "selectedValue" in s ? /* @__PURE__ */ e.jsx(
177
- E,
177
+ Q,
178
178
  {
179
179
  value: s.selectedValue,
180
180
  onValueChange: s.onChange,
@@ -194,6 +194,7 @@ const X = x(
194
194
  {
195
195
  label: a.label,
196
196
  description: a.description,
197
+ icon: a.icon,
197
198
  checked: s.selectedValues.includes(a.value),
198
199
  onCheckedChange: () => G(a.value)
199
200
  },
@@ -203,19 +204,30 @@ const X = x(
203
204
  }
204
205
  );
205
206
  X.displayName = "FilterSection";
206
- const V = x(({ label: s, checked: t, onCheckedChange: n, description: l, className: i, maxLabelLength: r = 14 }, d) => {
207
- const c = s.length > r, h = c ? `${s.slice(0, r)}...` : s;
208
- return /* @__PURE__ */ e.jsxs("label", { className: u("flex items-start gap-2 cursor-pointer", i), children: [
209
- /* @__PURE__ */ e.jsx(Q, { ref: d, checked: t, onCheckedChange: n }),
207
+ const V = f(({ label: s, checked: t, onCheckedChange: n, description: l, className: i, maxLabelLength: c = 14, icon: r }, o) => {
208
+ const x = s.length > c, u = x ? `${s.slice(0, c)}...` : s;
209
+ return /* @__PURE__ */ e.jsxs("label", { className: g("flex items-start gap-2 cursor-pointer", i), children: [
210
+ /* @__PURE__ */ e.jsx(E, { ref: o, checked: t, onCheckedChange: n }),
211
+ r && /* @__PURE__ */ e.jsx(
212
+ "img",
213
+ {
214
+ src: r,
215
+ alt: "",
216
+ className: "size-4 object-contain shrink-0",
217
+ onError: (m) => {
218
+ m.currentTarget.style.display = "none";
219
+ }
220
+ }
221
+ ),
210
222
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1.5 min-w-0 flex-1", children: [
211
- /* @__PURE__ */ e.jsx(v, { content: c ? s : "", children: /* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium leading-none truncate", children: h }) }),
223
+ /* @__PURE__ */ e.jsx(v, { content: x ? s : "", children: /* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium leading-none truncate", children: u }) }),
212
224
  l && /* @__PURE__ */ e.jsx("span", { className: "text-sm font-normal leading-5 text-muted-foreground truncate", children: l })
213
225
  ] })
214
226
  ] });
215
227
  });
216
228
  V.displayName = "FilterCheckboxOption";
217
- const S = x(
218
- ({ label: s, value: t, description: n, className: l }, i) => /* @__PURE__ */ e.jsxs("div", { className: u("flex items-start gap-3", l), children: [
229
+ const S = f(
230
+ ({ label: s, value: t, description: n, className: l }, i) => /* @__PURE__ */ e.jsxs("div", { className: g("flex items-start gap-3", l), children: [
219
231
  /* @__PURE__ */ e.jsx(L, { ref: i, value: t, id: `radio-${t}` }),
220
232
  /* @__PURE__ */ e.jsxs(
221
233
  "label",
@@ -231,21 +243,21 @@ const S = x(
231
243
  ] })
232
244
  );
233
245
  S.displayName = "FilterRadioOption";
234
- const q = x(
246
+ const q = f(
235
247
  ({
236
248
  children: s,
237
249
  showSearch: t = !1,
238
250
  searchPlaceholder: n = "Search...",
239
251
  searchValue: l,
240
252
  onSearchChange: i,
241
- className: r
242
- }, d) => /* @__PURE__ */ e.jsxs(
253
+ className: c
254
+ }, r) => /* @__PURE__ */ e.jsxs(
243
255
  "div",
244
256
  {
245
- ref: d,
246
- className: u(
257
+ ref: r,
258
+ className: g(
247
259
  "flex flex-col gap-6 bg-background rounded-md p-6 min-w-[448px]",
248
- r
260
+ c
249
261
  ),
250
262
  children: [
251
263
  t && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
@@ -261,7 +273,7 @@ const q = x(
261
273
  {
262
274
  placeholder: n,
263
275
  value: l,
264
- onChange: (c) => i?.(c.target.value),
276
+ onChange: (o) => i?.(o.target.value),
265
277
  className: "pl-9"
266
278
  }
267
279
  )
@@ -43,6 +43,11 @@ export interface TimePickerProps extends Omit<TimePickerPrimitiveProps, "onChang
43
43
  * @default 140
44
44
  */
45
45
  width?: number | string;
46
+ /**
47
+ * Use 24-hour format (military time) instead of 12-hour with AM/PM
48
+ * @default false
49
+ */
50
+ use24Hour?: boolean;
46
51
  }
47
52
  /**
48
53
  * Time input picker with label, description, and error handling.
@@ -1,139 +1,147 @@
1
- import { j as e } from "../../../_virtual/jsx-runtime.js";
2
- import * as U from "react";
3
- import { useId as B, useState as k, useRef as I, useEffect as S } from "react";
4
- import { cn as s } from "../../../lib/utils.js";
5
- import { Icon as W } from "../icon/icon.js";
6
- import { TimePicker as q } from "../../../vendor/shadcn/time-picker.js";
7
- import { Field as C, FieldLabel as E, FieldDescription as T, FieldError as R } from "../../../vendor/shadcn/field.js";
8
- const G = Array.from({ length: 12 }, (t, n) => n + 1), J = ["AM", "PM"], K = (t) => {
9
- if (t === 0)
1
+ import { j as r } from "../../../_virtual/jsx-runtime.js";
2
+ import * as G from "react";
3
+ import { useId as J, useState as $, useRef as C, useEffect as E } from "react";
4
+ import { cn as c } from "../../../lib/utils.js";
5
+ import { Icon as K } from "../icon/icon.js";
6
+ import { TimePicker as Q } from "../../../vendor/shadcn/time-picker.js";
7
+ import { Field as R, FieldLabel as T, FieldDescription as O, FieldError as _ } from "../../../vendor/shadcn/field.js";
8
+ const X = Array.from({ length: 12 }, (e, n) => n + 1), Y = Array.from({ length: 24 }, (e, n) => n), Z = ["AM", "PM"], H = (e) => {
9
+ if (e === 0)
10
10
  return Array.from({ length: 60 }, (o, i) => i);
11
- const n = 60 / t;
12
- return Array.from({ length: n }, (o, i) => i * t);
13
- }, u = (t) => t.toString().padStart(2, "0"), Q = (t) => {
14
- const n = t >= 12 ? "PM" : "AM";
15
- return { hour: t === 0 ? 12 : t > 12 ? t - 12 : t, meridiem: n };
16
- }, X = (t, n) => t === 12 ? n === "AM" ? 0 : 12 : n === "PM" ? t + 12 : t, Y = U.forwardRef(
11
+ const n = 60 / e;
12
+ return Array.from({ length: n }, (o, i) => i * e);
13
+ }, d = (e) => e.toString().padStart(2, "0"), ee = (e) => {
14
+ const n = e >= 12 ? "PM" : "AM";
15
+ return { hour: e === 0 ? 12 : e > 12 ? e - 12 : e, meridiem: n };
16
+ }, te = (e, n) => e === 12 ? n === "AM" ? 0 : 12 : n === "PM" ? e + 12 : e, re = G.forwardRef(
17
17
  ({
18
- className: t,
18
+ className: e,
19
19
  label: n,
20
20
  error: o,
21
21
  description: i,
22
22
  orientation: x = "vertical",
23
- id: c,
24
- onChange: m,
25
- mode: b = "native",
26
- divisorMinutes: g = 0,
27
- width: l = 140,
28
- value: f,
29
- disabled: y,
30
- ...p
31
- }, M) => {
32
- const N = B(), a = c || N, v = !!o;
33
- if (b === "native") {
34
- const d = /* @__PURE__ */ e.jsx(
35
- q,
23
+ id: m,
24
+ onChange: f,
25
+ mode: y = "native",
26
+ divisorMinutes: j = 0,
27
+ width: s = 140,
28
+ value: l,
29
+ disabled: p,
30
+ use24Hour: w = !1,
31
+ ...h
32
+ }, P) => {
33
+ const S = J(), u = m || S, v = !!o;
34
+ if (y === "native") {
35
+ const k = /* @__PURE__ */ r.jsx(
36
+ Q,
36
37
  {
37
- ref: M,
38
- id: a,
39
- value: f,
40
- disabled: y,
41
- className: s(
38
+ ref: P,
39
+ id: u,
40
+ value: l,
41
+ disabled: p,
42
+ className: c(
42
43
  v && "border-destructive focus-visible:border-destructive",
43
- !(n || o || i) && t
44
+ !(n || o || i) && e
44
45
  ),
45
46
  "aria-invalid": v ? !0 : void 0,
46
- "aria-describedby": i || o ? `${a}-description` : void 0,
47
- ...p,
48
- onChange: (P) => {
49
- m?.(P.target.value);
47
+ "aria-describedby": i || o ? `${u}-description` : void 0,
48
+ ...h,
49
+ onChange: (a) => {
50
+ f?.(a.target.value);
50
51
  }
51
52
  }
52
53
  );
53
- return n || o || i ? /* @__PURE__ */ e.jsxs(
54
- C,
54
+ return n || o || i ? /* @__PURE__ */ r.jsxs(
55
+ R,
55
56
  {
56
57
  orientation: x,
57
58
  "data-invalid": v,
58
- className: s("w-full", t),
59
+ className: c("w-full", e),
59
60
  children: [
60
- n && /* @__PURE__ */ e.jsx(E, { htmlFor: a, children: n }),
61
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2 flex-1", children: [
62
- d,
63
- i && !o && /* @__PURE__ */ e.jsx(T, { id: `${a}-description`, children: i }),
64
- o && /* @__PURE__ */ e.jsx(R, { id: `${a}-description`, children: o })
61
+ n && /* @__PURE__ */ r.jsx(T, { htmlFor: u, children: n }),
62
+ /* @__PURE__ */ r.jsxs("div", { className: "flex flex-col gap-2 flex-1", children: [
63
+ k,
64
+ i && !o && /* @__PURE__ */ r.jsx(O, { id: `${u}-description`, children: i }),
65
+ o && /* @__PURE__ */ r.jsx(_, { id: `${u}-description`, children: o })
65
66
  ] })
66
67
  ]
67
68
  }
68
- ) : d;
69
+ ) : k;
69
70
  }
70
- return /* @__PURE__ */ e.jsx(
71
- Z,
71
+ return /* @__PURE__ */ r.jsx(
72
+ ne,
72
73
  {
73
- value: f || "12:00",
74
- onChange: m,
75
- divisorMinutes: g,
76
- width: l,
74
+ value: l || (w ? "00:00" : "12:00"),
75
+ onChange: f,
76
+ divisorMinutes: j,
77
+ width: s,
77
78
  label: n,
78
79
  error: o,
79
80
  description: i,
80
- disabled: y,
81
- className: t
81
+ disabled: p,
82
+ className: e,
83
+ use24Hour: w
82
84
  }
83
85
  );
84
86
  }
85
87
  );
86
- Y.displayName = "TimePicker";
87
- const Z = ({
88
- value: t,
88
+ re.displayName = "TimePicker";
89
+ const ne = ({
90
+ value: e,
89
91
  onChange: n,
90
92
  divisorMinutes: o,
91
93
  width: i,
92
94
  label: x,
93
- error: c,
94
- description: m,
95
- disabled: b,
96
- className: g
95
+ error: m,
96
+ description: f,
97
+ disabled: y,
98
+ className: j,
99
+ use24Hour: s = !1
97
100
  }) => {
98
- const [l, f] = k(!1), y = I(null), p = I(null), M = (r) => {
99
- const [h, O] = r.split(":"), _ = parseInt(h, 10) || 0, L = parseInt(O, 10) || 0, { hour: V, meridiem: z } = Q(_);
100
- return { hour: V, minute: L, meridiem: z };
101
- }, { hour: N, minute: a, meridiem: v } = M(t), [d, P] = k(N), [j, A] = k(a), [w, D] = k(v), F = K(o);
102
- S(() => {
103
- const r = X(d, w), h = `${u(r)}:${u(j)}`;
104
- n?.(h);
105
- }, [d, j, w, n]), S(() => {
106
- const r = (h) => {
107
- p.current && !p.current.contains(h.target) && f(!1);
101
+ const [l, p] = $(!1), w = C(null), h = C(null), P = (t) => {
102
+ const [g, B] = t.split(":"), N = parseInt(g, 10) || 0, A = parseInt(B, 10) || 0;
103
+ if (s)
104
+ return { hour24: N, minute: A, hour: N, meridiem: "AM" };
105
+ const { hour: W, meridiem: q } = ee(N);
106
+ return { hour24: N, minute: A, hour: W, meridiem: q };
107
+ }, { hour: S, hour24: u, minute: v, meridiem: k } = P(e), [a, D] = $(s ? u : S), [b, F] = $(v), [M, L] = $(k), U = H(o);
108
+ E(() => {
109
+ let t;
110
+ s ? t = a : t = te(a, M);
111
+ const g = `${d(t)}:${d(b)}`;
112
+ n?.(g);
113
+ }, [a, b, M, n, s]), E(() => {
114
+ const t = (g) => {
115
+ h.current && !h.current.contains(g.target) && p(!1);
108
116
  };
109
117
  if (l)
110
- return document.addEventListener("mousedown", r), () => document.removeEventListener("mousedown", r);
118
+ return document.addEventListener("mousedown", t), () => document.removeEventListener("mousedown", t);
111
119
  }, [l]);
112
- const H = `${u(d)}:${u(j)} ${w}`, $ = /* @__PURE__ */ e.jsxs(
120
+ const V = s ? `${d(a)}:${d(b)}` : `${d(a)}:${d(b)} ${M}`, z = s ? Y : X, I = /* @__PURE__ */ r.jsxs(
113
121
  "div",
114
122
  {
115
- ref: p,
116
- className: s("relative inline-block", g),
123
+ ref: h,
124
+ className: c("relative inline-block", j),
117
125
  style: { width: typeof i == "number" ? `${i}px` : i },
118
126
  children: [
119
- /* @__PURE__ */ e.jsxs(
127
+ /* @__PURE__ */ r.jsxs(
120
128
  "button",
121
129
  {
122
130
  type: "button",
123
- disabled: b,
124
- onClick: () => !b && f(!l),
125
- className: s(
131
+ disabled: y,
132
+ onClick: () => !y && p(!l),
133
+ className: c(
126
134
  "flex items-center justify-between w-full h-9 px-3 py-2",
127
135
  "text-sm rounded-md border border-input bg-background",
128
136
  "hover:bg-accent hover:text-accent-foreground",
129
137
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
130
138
  "disabled:cursor-not-allowed disabled:opacity-50",
131
- c && "border-destructive"
139
+ m && "border-destructive"
132
140
  ),
133
141
  children: [
134
- /* @__PURE__ */ e.jsx("span", { children: H }),
135
- /* @__PURE__ */ e.jsx(
136
- W,
142
+ /* @__PURE__ */ r.jsx("span", { children: V }),
143
+ /* @__PURE__ */ r.jsx(
144
+ K,
137
145
  {
138
146
  name: l ? "CaretUp" : "CaretDown",
139
147
  size: "sm",
@@ -143,54 +151,54 @@ const Z = ({
143
151
  ]
144
152
  }
145
153
  ),
146
- l && /* @__PURE__ */ e.jsxs(
154
+ l && /* @__PURE__ */ r.jsxs(
147
155
  "div",
148
156
  {
149
- ref: y,
150
- className: s(
157
+ ref: w,
158
+ className: c(
151
159
  "absolute z-50 mt-1 bg-popover border border-border rounded-md shadow-lg",
152
160
  "flex divide-x divide-border"
153
161
  ),
154
- style: { width: "fit-content", minWidth: "200px" },
162
+ style: { width: "fit-content", minWidth: s ? "140px" : "200px" },
155
163
  children: [
156
- /* @__PURE__ */ e.jsx("div", { className: "flex flex-col overflow-y-auto max-h-[200px] min-w-[60px]", children: G.map((r) => /* @__PURE__ */ e.jsx(
164
+ /* @__PURE__ */ r.jsx("div", { className: "flex flex-col overflow-y-auto max-h-[200px] min-w-[60px]", children: z.map((t) => /* @__PURE__ */ r.jsx(
157
165
  "button",
158
166
  {
159
167
  type: "button",
160
- onClick: () => P(r),
161
- className: s(
168
+ onClick: () => D(t),
169
+ className: c(
162
170
  "px-3 py-2 text-sm text-left hover:bg-accent",
163
- d === r && "bg-primary text-primary-foreground hover:bg-primary"
171
+ a === t && "bg-primary text-primary-foreground hover:bg-primary"
164
172
  ),
165
- children: u(r)
173
+ children: d(t)
166
174
  },
167
- r
175
+ t
168
176
  )) }),
169
- /* @__PURE__ */ e.jsx("div", { className: "flex flex-col overflow-y-auto max-h-[200px] min-w-[60px]", children: F.map((r) => /* @__PURE__ */ e.jsx(
177
+ /* @__PURE__ */ r.jsx("div", { className: "flex flex-col overflow-y-auto max-h-[200px] min-w-[60px]", children: U.map((t) => /* @__PURE__ */ r.jsx(
170
178
  "button",
171
179
  {
172
180
  type: "button",
173
- onClick: () => A(r),
174
- className: s(
181
+ onClick: () => F(t),
182
+ className: c(
175
183
  "px-3 py-2 text-sm text-left hover:bg-accent",
176
- j === r && "bg-primary text-primary-foreground hover:bg-primary"
184
+ b === t && "bg-primary text-primary-foreground hover:bg-primary"
177
185
  ),
178
- children: u(r)
186
+ children: d(t)
179
187
  },
180
- r
188
+ t
181
189
  )) }),
182
- /* @__PURE__ */ e.jsx("div", { className: "flex flex-col min-w-[60px]", children: J.map((r) => /* @__PURE__ */ e.jsx(
190
+ !s && /* @__PURE__ */ r.jsx("div", { className: "flex flex-col min-w-[60px]", children: Z.map((t) => /* @__PURE__ */ r.jsx(
183
191
  "button",
184
192
  {
185
193
  type: "button",
186
- onClick: () => D(r),
187
- className: s(
194
+ onClick: () => L(t),
195
+ className: c(
188
196
  "px-3 py-2 text-sm text-left hover:bg-accent",
189
- w === r && "bg-primary text-primary-foreground hover:bg-primary"
197
+ M === t && "bg-primary text-primary-foreground hover:bg-primary"
190
198
  ),
191
- children: r
199
+ children: t
192
200
  },
193
- r
201
+ t
194
202
  )) })
195
203
  ]
196
204
  }
@@ -198,15 +206,15 @@ const Z = ({
198
206
  ]
199
207
  }
200
208
  );
201
- return x || c || m ? /* @__PURE__ */ e.jsxs(C, { orientation: "vertical", className: s("w-full", g), children: [
202
- x && /* @__PURE__ */ e.jsx(E, { children: x }),
203
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2 flex-1", children: [
204
- $,
205
- m && !c && /* @__PURE__ */ e.jsx(T, { children: m }),
206
- c && /* @__PURE__ */ e.jsx(R, { children: c })
209
+ return x || m || f ? /* @__PURE__ */ r.jsxs(R, { orientation: "vertical", className: c("w-full", j), children: [
210
+ x && /* @__PURE__ */ r.jsx(T, { children: x }),
211
+ /* @__PURE__ */ r.jsxs("div", { className: "flex flex-col gap-2 flex-1", children: [
212
+ I,
213
+ f && !m && /* @__PURE__ */ r.jsx(O, { children: f }),
214
+ m && /* @__PURE__ */ r.jsx(_, { children: m })
207
215
  ] })
208
- ] }) : $;
216
+ ] }) : I;
209
217
  };
210
218
  export {
211
- Y as TimePicker
219
+ re as TimePicker
212
220
  };