@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.
- package/dist/_chunks/booking-Db4BQ9eH.js +2495 -0
- package/dist/_chunks/{date-range-picker-D4dgDlLU.js → date-range-picker-D8CHNYQT.js} +72 -74
- package/dist/_chunks/{editable-currency-cell-renderer-B9VRSV_S.js → editable-currency-cell-renderer-CZcVWBPo.js} +2 -2
- package/dist/_chunks/slot-grid-BlHHP9Qy.js +502 -0
- package/dist/_chunks/subDays-CANHP9hz.js +8 -0
- package/dist/agent-catalog.json +1 -1
- package/dist/components/booking/booking-types.d.ts +37 -0
- package/dist/components/booking/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/slot-grid/index.js +1 -1
- package/dist/index.js +4 -4
- package/package.json +1 -1
- package/dist/_chunks/booking-CbdbYvWp.js +0 -2340
- package/dist/_chunks/parseISO-DEpUNwxZ.js +0 -120
- package/dist/_chunks/slot-grid-Dz13dH82.js +0 -387
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
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
|
|
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 {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
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: (
|
|
24
|
-
var
|
|
25
|
-
const
|
|
21
|
+
read: (a) => {
|
|
22
|
+
var i, l;
|
|
23
|
+
const s = a.getRange();
|
|
26
24
|
return {
|
|
27
|
-
from: ((
|
|
28
|
-
to: ((l =
|
|
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: (
|
|
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: (
|
|
46
|
-
|
|
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: (
|
|
54
|
-
|
|
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: (
|
|
62
|
-
|
|
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: (
|
|
70
|
-
|
|
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
|
-
},
|
|
84
|
+
}, ve = Q(
|
|
87
85
|
({
|
|
88
|
-
value:
|
|
89
|
-
defaultValue:
|
|
90
|
-
onChange:
|
|
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:
|
|
102
|
-
value:
|
|
103
|
-
defaultValue:
|
|
104
|
-
onChange:
|
|
105
|
-
}),
|
|
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 =
|
|
108
|
+
), E = oe(l, V), x = [
|
|
111
109
|
{
|
|
112
|
-
label:
|
|
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:
|
|
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:
|
|
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:
|
|
131
|
+
label: r("inputs.dateRangePicker.presets.thisWeek", "This week"),
|
|
134
132
|
range: () => ({
|
|
135
|
-
from: W(/* @__PURE__ */ new Date(), { locale:
|
|
136
|
-
to: T(/* @__PURE__ */ new Date(), { locale:
|
|
133
|
+
from: W(/* @__PURE__ */ new Date(), { locale: o }),
|
|
134
|
+
to: T(/* @__PURE__ */ new Date(), { locale: o })
|
|
137
135
|
})
|
|
138
136
|
},
|
|
139
137
|
{
|
|
140
|
-
label:
|
|
138
|
+
label: r("inputs.dateRangePicker.presets.lastWeek", "Last week"),
|
|
141
139
|
range: () => {
|
|
142
|
-
const e =
|
|
140
|
+
const e = ye(/* @__PURE__ */ new Date());
|
|
143
141
|
return {
|
|
144
|
-
from: W(e, { locale:
|
|
145
|
-
to: T(e, { locale:
|
|
142
|
+
from: W(e, { locale: o }),
|
|
143
|
+
to: T(e, { locale: o })
|
|
146
144
|
};
|
|
147
145
|
}
|
|
148
146
|
},
|
|
149
147
|
{
|
|
150
|
-
label:
|
|
148
|
+
label: r("inputs.dateRangePicker.presets.thisMonth", "This month"),
|
|
151
149
|
range: () => ({
|
|
152
|
-
from:
|
|
153
|
-
to:
|
|
150
|
+
from: de(/* @__PURE__ */ new Date()),
|
|
151
|
+
to: ie(/* @__PURE__ */ new Date())
|
|
154
152
|
})
|
|
155
153
|
},
|
|
156
154
|
{
|
|
157
|
-
label:
|
|
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 (
|
|
170
|
-
const e = v(
|
|
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
|
|
171
|
+
return t.from ? v(t.from, y, { locale: o }) : "";
|
|
174
172
|
})(), N = (() => {
|
|
175
|
-
if (
|
|
176
|
-
const e =
|
|
177
|
-
return
|
|
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: () =>
|
|
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
|
-
[
|
|
189
|
+
[t, d, p]
|
|
192
190
|
);
|
|
193
|
-
return z(B, () => b, [b]),
|
|
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(
|
|
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:
|
|
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:
|
|
225
|
-
children: /* @__PURE__ */ n(
|
|
222
|
+
className: pe({ size: D }),
|
|
223
|
+
children: /* @__PURE__ */ n(le, {})
|
|
226
224
|
}
|
|
227
225
|
)
|
|
228
226
|
]
|
|
229
227
|
}
|
|
230
228
|
) }),
|
|
231
|
-
/* @__PURE__ */ n(
|
|
232
|
-
|
|
229
|
+
/* @__PURE__ */ n(f.Portal, { children: /* @__PURE__ */ n(
|
|
230
|
+
f.Content,
|
|
233
231
|
{
|
|
234
232
|
sideOffset: 4,
|
|
235
233
|
align: "start",
|
|
236
|
-
className:
|
|
237
|
-
children: /* @__PURE__ */
|
|
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:
|
|
241
|
+
className: ue(),
|
|
244
242
|
children: e.label
|
|
245
243
|
},
|
|
246
244
|
e.label
|
|
247
245
|
)) }) : null,
|
|
248
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ m("div", { children: [
|
|
249
247
|
/* @__PURE__ */ n(
|
|
250
248
|
me,
|
|
251
249
|
{
|
|
252
250
|
mode: "range",
|
|
253
|
-
selected:
|
|
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:
|
|
257
|
+
locale: o,
|
|
260
258
|
showOutsideDays: !0,
|
|
261
259
|
fixedWeeks: !0,
|
|
262
260
|
pagedNavigation: !0,
|
|
263
|
-
components: { Chevron:
|
|
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
|
-
|
|
282
|
+
ve.displayName = "DateRangePicker";
|
|
285
283
|
export {
|
|
286
|
-
|
|
287
|
-
|
|
284
|
+
ve as D,
|
|
285
|
+
be as d
|
|
288
286
|
};
|
|
289
|
-
//# sourceMappingURL=date-range-picker-
|
|
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-
|
|
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-
|
|
2335
|
+
//# sourceMappingURL=editable-currency-cell-renderer-CZcVWBPo.js.map
|