@alfadocs/ui-kit 0.33.9 → 0.33.11

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,18 +1,16 @@
1
- import { jsx as n, jsxs as f } from "react/jsx-runtime";
1
+ import { jsx as n, jsxs as m } from "react/jsx-runtime";
2
2
  import { forwardRef as Q, useState as I, useRef as U, useCallback as X, useMemo as Z, useImperativeHandle as z } from "react";
3
3
  import { useTranslation as ee } from "react-i18next";
4
- import * as m from "@radix-ui/react-popover";
4
+ import * as f from "@radix-ui/react-popover";
5
5
  import { u as te } from "./use-controllable-state-BiY4xTzM.js";
6
6
  import { u as ae } from "./form-field-context-B3APVHKx.js";
7
- import { a as ne, b as re, u as se, g as oe, c as ie, e as T, s as W, d as de, f as ce, h as v, i as le, C as pe, j as ge, t as ue, p as fe, D as me, k as he, l as ke } from "./react-day-picker-DsjfS7uI.js";
8
- import { u as ye } from "./registry-nPAVE19X.js";
9
- function R(t, r, o) {
10
- return ne(t, -r, o);
7
+ import { b as ne, u as re, g as se, c as oe, e as T, s as W, d as ie, f as de, h as v, i as ce, C as le, j as pe, t as ge, p as ue, D as me, k as fe, l as he } from "./react-day-picker-DsjfS7uI.js";
8
+ import { s as R } from "./subDays-CANHP9hz.js";
9
+ import { u as ke } from "./registry-nPAVE19X.js";
10
+ function ye(a, s, i) {
11
+ return ne(a, -1, i);
11
12
  }
12
- function be(t, r, o) {
13
- return re(t, -1, o);
14
- }
15
- const ve = {
13
+ const be = {
16
14
  id: "date-range-picker",
17
15
  capabilities: ["range_pick", "open", "close"],
18
16
  state: {
@@ -20,12 +18,12 @@ const ve = {
20
18
  type: "{ from: iso-date | null, to: iso-date | null }",
21
19
  descriptionKey: "ui.agent.dateRangePicker.state.range",
22
20
  description: "Currently-selected ISO date range endpoints, each possibly null.",
23
- read: (t) => {
24
- var o, l;
25
- const r = t.getRange();
21
+ read: (a) => {
22
+ var i, l;
23
+ const s = a.getRange();
26
24
  return {
27
- from: ((o = r.from) == null ? void 0 : o.toISOString()) ?? null,
28
- to: ((l = r.to) == null ? void 0 : l.toISOString()) ?? null
25
+ from: ((i = s.from) == null ? void 0 : i.toISOString()) ?? null,
26
+ to: ((l = s.to) == null ? void 0 : l.toISOString()) ?? null
29
27
  };
30
28
  }
31
29
  },
@@ -33,7 +31,7 @@ const ve = {
33
31
  type: "boolean",
34
32
  descriptionKey: "ui.agent.dateRangePicker.state.isOpen",
35
33
  description: "Whether the range calendar popover is open.",
36
- read: (t) => t.isOpen()
34
+ read: (a) => a.isOpen()
37
35
  }
38
36
  },
39
37
  actions: {
@@ -42,32 +40,32 @@ const ve = {
42
40
  argsType: "{ from: string, to: string }",
43
41
  descriptionKey: "ui.agent.dateRangePicker.actions.setRange",
44
42
  description: "Replace the selected range with the given ISO endpoints.",
45
- invoke: (t, r) => {
46
- t.setRange({ from: new Date(r.from), to: new Date(r.to) });
43
+ invoke: (a, s) => {
44
+ a.setRange({ from: new Date(s.from), to: new Date(s.to) });
47
45
  }
48
46
  },
49
47
  clear: {
50
48
  safety: "destructive",
51
49
  descriptionKey: "ui.agent.dateRangePicker.actions.clear",
52
50
  description: "Clear the selected range.",
53
- invoke: (t) => {
54
- t.clear();
51
+ invoke: (a) => {
52
+ a.clear();
55
53
  }
56
54
  },
57
55
  open: {
58
56
  safety: "read",
59
57
  descriptionKey: "ui.agent.dateRangePicker.actions.open",
60
58
  description: "Open the range calendar popover.",
61
- invoke: (t) => {
62
- t.open();
59
+ invoke: (a) => {
60
+ a.open();
63
61
  }
64
62
  },
65
63
  close: {
66
64
  safety: "read",
67
65
  descriptionKey: "ui.agent.dateRangePicker.actions.close",
68
66
  description: "Close the range calendar popover.",
69
- invoke: (t) => {
70
- t.close();
67
+ invoke: (a) => {
68
+ a.close();
71
69
  }
72
70
  }
73
71
  },
@@ -83,11 +81,11 @@ const ve = {
83
81
  description: "Sourced from the id prop."
84
82
  }
85
83
  }
86
- }, Re = Q(
84
+ }, ve = Q(
87
85
  ({
88
- value: t,
89
- defaultValue: r,
90
- onChange: o,
86
+ value: a,
87
+ defaultValue: s,
88
+ onChange: i,
91
89
  minDate: l,
92
90
  maxDate: V,
93
91
  presets: h,
@@ -98,63 +96,63 @@ const ve = {
98
96
  className: j,
99
97
  id: A
100
98
  }, B) => {
101
- const { t: s, i18n: P } = ee(), c = ae(), k = A ?? c.id, w = c.disabled || F, H = c.invalid ? "error" : "default", i = se(P.language), y = oe(P.language), _ = L ?? s("inputs.dateRangePicker.placeholder", "Select date range"), [$, C] = te({
102
- value: t,
103
- defaultValue: r ?? {},
104
- onChange: o
105
- }), a = $ ?? {}, [p, g] = I(!1), [Y, O] = I(a.from ?? /* @__PURE__ */ new Date()), q = U(null), d = X(
99
+ const { t: r, i18n: P } = ee(), c = ae(), k = A ?? c.id, w = c.disabled || F, H = c.invalid ? "error" : "default", o = re(P.language), y = se(P.language), _ = L ?? r("inputs.dateRangePicker.placeholder", "Select date range"), [$, C] = te({
100
+ value: a,
101
+ defaultValue: s ?? {},
102
+ onChange: i
103
+ }), t = $ ?? {}, [p, g] = I(!1), [Y, O] = I(t.from ?? /* @__PURE__ */ new Date()), q = U(null), d = X(
106
104
  (e) => {
107
105
  C(e);
108
106
  },
109
107
  [C]
110
- ), E = ie(l, V), x = [
108
+ ), E = oe(l, V), x = [
111
109
  {
112
- label: s("inputs.dateRangePicker.presets.today", "Today"),
110
+ label: r("inputs.dateRangePicker.presets.today", "Today"),
113
111
  range: () => {
114
112
  const e = /* @__PURE__ */ new Date();
115
113
  return { from: e, to: e };
116
114
  }
117
115
  },
118
116
  {
119
- label: s("inputs.dateRangePicker.presets.yesterday", "Yesterday"),
117
+ label: r("inputs.dateRangePicker.presets.yesterday", "Yesterday"),
120
118
  range: () => {
121
119
  const e = R(/* @__PURE__ */ new Date(), 1);
122
120
  return { from: e, to: e };
123
121
  }
124
122
  },
125
123
  {
126
- label: s("inputs.dateRangePicker.presets.last7", "Last 7 days"),
124
+ label: r("inputs.dateRangePicker.presets.last7", "Last 7 days"),
127
125
  range: () => ({
128
126
  from: R(/* @__PURE__ */ new Date(), 6),
129
127
  to: /* @__PURE__ */ new Date()
130
128
  })
131
129
  },
132
130
  {
133
- label: s("inputs.dateRangePicker.presets.thisWeek", "This week"),
131
+ label: r("inputs.dateRangePicker.presets.thisWeek", "This week"),
134
132
  range: () => ({
135
- from: W(/* @__PURE__ */ new Date(), { locale: i }),
136
- to: T(/* @__PURE__ */ new Date(), { locale: i })
133
+ from: W(/* @__PURE__ */ new Date(), { locale: o }),
134
+ to: T(/* @__PURE__ */ new Date(), { locale: o })
137
135
  })
138
136
  },
139
137
  {
140
- label: s("inputs.dateRangePicker.presets.lastWeek", "Last week"),
138
+ label: r("inputs.dateRangePicker.presets.lastWeek", "Last week"),
141
139
  range: () => {
142
- const e = be(/* @__PURE__ */ new Date());
140
+ const e = ye(/* @__PURE__ */ new Date());
143
141
  return {
144
- from: W(e, { locale: i }),
145
- to: T(e, { locale: i })
142
+ from: W(e, { locale: o }),
143
+ to: T(e, { locale: o })
146
144
  };
147
145
  }
148
146
  },
149
147
  {
150
- label: s("inputs.dateRangePicker.presets.thisMonth", "This month"),
148
+ label: r("inputs.dateRangePicker.presets.thisMonth", "This month"),
151
149
  range: () => ({
152
- from: ce(/* @__PURE__ */ new Date()),
153
- to: de(/* @__PURE__ */ new Date())
150
+ from: de(/* @__PURE__ */ new Date()),
151
+ to: ie(/* @__PURE__ */ new Date())
154
152
  })
155
153
  },
156
154
  {
157
- label: s("inputs.dateRangePicker.presets.last30", "Last 30 days"),
155
+ label: r("inputs.dateRangePicker.presets.last30", "Last 30 days"),
158
156
  range: () => ({
159
157
  from: R(/* @__PURE__ */ new Date(), 29),
160
158
  to: /* @__PURE__ */ new Date()
@@ -166,38 +164,38 @@ const ve = {
166
164
  const u = e.range();
167
165
  d(u), O(u.from), g(!1);
168
166
  }, M = (() => {
169
- if (a.from && a.to) {
170
- const e = v(a.from, y, { locale: i }), u = v(a.to, y, { locale: i });
167
+ if (t.from && t.to) {
168
+ const e = v(t.from, y, { locale: o }), u = v(t.to, y, { locale: o });
171
169
  return `${e} – ${u}`;
172
170
  }
173
- return a.from ? v(a.from, y, { locale: i }) : "";
171
+ return t.from ? v(t.from, y, { locale: o }) : "";
174
172
  })(), N = (() => {
175
- if (a.from && a.to) {
176
- const e = le(a.to, a.from) + 1;
177
- return s("inputs.dateRangePicker.days", "{{count}} days", {
173
+ if (t.from && t.to) {
174
+ const e = ce(t.to, t.from) + 1;
175
+ return r("inputs.dateRangePicker.days", "{{count}} days", {
178
176
  count: e
179
177
  });
180
178
  }
181
179
  return "";
182
180
  })(), b = Z(
183
181
  () => ({
184
- getRange: () => a,
182
+ getRange: () => t,
185
183
  setRange: (e) => d(e),
186
184
  clear: () => d({}),
187
185
  isOpen: () => p,
188
186
  open: () => g(!0),
189
187
  close: () => g(!1)
190
188
  }),
191
- [a, d, p]
189
+ [t, d, p]
192
190
  );
193
- return z(B, () => b, [b]), ye(ve, b, k), /* @__PURE__ */ n(m.Root, { open: p, onOpenChange: g, children: /* @__PURE__ */ f(
191
+ return z(B, () => b, [b]), ke(be, b, k), /* @__PURE__ */ n(f.Root, { open: p, onOpenChange: g, children: /* @__PURE__ */ m(
194
192
  "div",
195
193
  {
196
194
  className: j,
197
195
  "data-component": "date-range-picker",
198
196
  "data-component-id": k,
199
197
  children: [
200
- /* @__PURE__ */ n(m.Trigger, { asChild: !0, disabled: w, children: /* @__PURE__ */ f(
198
+ /* @__PURE__ */ n(f.Trigger, { asChild: !0, disabled: w, children: /* @__PURE__ */ m(
201
199
  "button",
202
200
  {
203
201
  ref: q,
@@ -208,7 +206,7 @@ const ve = {
208
206
  "aria-invalid": c.invalid || void 0,
209
207
  "aria-haspopup": "dialog",
210
208
  "aria-expanded": p,
211
- className: ue({ size: D, tone: H }),
209
+ className: ge({ size: D, tone: H }),
212
210
  children: [
213
211
  /* @__PURE__ */ n(
214
212
  "span",
@@ -221,46 +219,46 @@ const ve = {
221
219
  "span",
222
220
  {
223
221
  "aria-hidden": "true",
224
- className: ge({ size: D }),
225
- children: /* @__PURE__ */ n(pe, {})
222
+ className: pe({ size: D }),
223
+ children: /* @__PURE__ */ n(le, {})
226
224
  }
227
225
  )
228
226
  ]
229
227
  }
230
228
  ) }),
231
- /* @__PURE__ */ n(m.Portal, { children: /* @__PURE__ */ n(
232
- m.Content,
229
+ /* @__PURE__ */ n(f.Portal, { children: /* @__PURE__ */ n(
230
+ f.Content,
233
231
  {
234
232
  sideOffset: 4,
235
233
  align: "start",
236
- className: ke(),
237
- children: /* @__PURE__ */ f("div", { className: "ds:flex ds:gap-[var(--spacing-md)]", children: [
234
+ className: he(),
235
+ children: /* @__PURE__ */ m("div", { className: "ds:flex ds:gap-[var(--spacing-md)]", children: [
238
236
  S.length > 0 ? /* @__PURE__ */ n("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:min-w-[8rem] ds:border-e ds:border-border ds:pe-[var(--spacing-md)]", children: S.map((e) => /* @__PURE__ */ n(
239
237
  "button",
240
238
  {
241
239
  type: "button",
242
240
  onClick: () => J(e),
243
- className: fe(),
241
+ className: ue(),
244
242
  children: e.label
245
243
  },
246
244
  e.label
247
245
  )) }) : null,
248
- /* @__PURE__ */ f("div", { children: [
246
+ /* @__PURE__ */ m("div", { children: [
249
247
  /* @__PURE__ */ n(
250
248
  me,
251
249
  {
252
250
  mode: "range",
253
- selected: a.from ? { from: a.from, to: a.to } : void 0,
251
+ selected: t.from ? { from: t.from, to: t.to } : void 0,
254
252
  onSelect: G,
255
253
  month: Y,
256
254
  onMonthChange: O,
257
255
  numberOfMonths: 2,
258
256
  disabled: E,
259
- locale: i,
257
+ locale: o,
260
258
  showOutsideDays: !0,
261
259
  fixedWeeks: !0,
262
260
  pagedNavigation: !0,
263
- components: { Chevron: he }
261
+ components: { Chevron: fe }
264
262
  }
265
263
  ),
266
264
  N ? /* @__PURE__ */ n(
@@ -281,9 +279,9 @@ const ve = {
281
279
  ) });
282
280
  }
283
281
  );
284
- Re.displayName = "DateRangePicker";
282
+ ve.displayName = "DateRangePicker";
285
283
  export {
286
- Re as D,
287
- ve as d
284
+ ve as D,
285
+ be as d
288
286
  };
289
- //# sourceMappingURL=date-range-picker-D4dgDlLU.js.map
287
+ //# sourceMappingURL=date-range-picker-D8CHNYQT.js.map
@@ -26,7 +26,7 @@ import { S as Ie } from "./select-hsCaJSX3.js";
26
26
  import { u as zt } from "./use-prefers-reduced-motion-BMwIQRjB.js";
27
27
  import { u as At } from "./use-theme-C2dHKUAN.js";
28
28
  import { u as Pt } from "./registry-nPAVE19X.js";
29
- import { D as ze } from "./date-range-picker-D4dgDlLU.js";
29
+ import { D as ze } from "./date-range-picker-D8CHNYQT.js";
30
30
  import { M as Ot } from "./multi-select-DOLO3K_z.js";
31
31
  import { A as Ae } from "./autocomplete-DIgdhCGJ.js";
32
32
  import { N as ee } from "./number-input-Dj5L3pXK.js";
@@ -2332,4 +2332,4 @@ export {
2332
2332
  Be as q,
2333
2333
  xn as u
2334
2334
  };
2335
- //# sourceMappingURL=editable-currency-cell-renderer-B9VRSV_S.js.map
2335
+ //# sourceMappingURL=editable-currency-cell-renderer-CZcVWBPo.js.map