@alfadocs/ui-kit 0.42.0 → 0.44.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.
- package/dist/_chunks/{ar-Cn_NxqkN.js → ar-DEz65ZJW.js} +2 -2
- package/dist/_chunks/bmi-calculator-DFPWL2OJ.js +273 -0
- package/dist/_chunks/{booking-4mCw3Mpl.js → booking-CtLwaxkK.js} +4 -4
- package/dist/_chunks/{calculator-dialog-B74fqpFZ.js → calculator-dialog-D-nfvteH.js} +2 -2
- package/dist/_chunks/{chart-Cbt0_sKv.js → chart-Cg3e9EH9.js} +101 -99
- package/dist/_chunks/{cycle-calculator-DsZbyzX6.js → cycle-calculator-ChHBcjet.js} +65 -56
- package/dist/_chunks/{date-picker-CvQfs6Xh.js → date-picker-Bq7xhMA-.js} +109 -108
- package/dist/_chunks/date-picker-variants-DLi1Va_e.js +3238 -0
- package/dist/_chunks/{date-range-picker-U9fn1g9d.js → date-range-picker-DcXuI9y7.js} +20 -19
- package/dist/_chunks/{date-time-picker-Cva0ZCWw.js → date-time-picker-RimumeLR.js} +18 -17
- package/dist/_chunks/{de-BMM2H7Bs.js → de-bTBGdjPS.js} +2 -2
- package/dist/_chunks/dialog-BTpZV6It.js +223 -0
- package/dist/_chunks/{due-date-calculator-s_CBgaFs.js → due-date-calculator-CYXKLoof.js} +65 -45
- package/dist/_chunks/{editable-currency-cell-renderer-BhUkRiPZ.js → editable-currency-cell-renderer-9jqwDv5x.js} +2 -2
- package/dist/_chunks/{el-BYPonAaK.js → el-BWG5RXxa.js} +6 -6
- package/dist/_chunks/{es-CMkVCQ4F.js → es-DfO_G435.js} +2 -2
- package/dist/_chunks/{fr-BcuWxqft.js → fr-BTn24bs8.js} +2 -2
- package/dist/_chunks/{gestation-BXEgDGmP.js → gestation-mWF4AXea.js} +3 -3
- package/dist/_chunks/gestational-age-calculator-sRmoqgVr.js +190 -0
- package/dist/_chunks/{header-CTZWX-tm.js → header-Ce1Br27u.js} +70 -75
- package/dist/_chunks/{hi-wkq_rQAh.js → hi-Dj3oYd84.js} +2 -2
- package/dist/_chunks/insert-result-CoC1oo6R.js +334 -0
- package/dist/_chunks/{isSameWeek-Bim5ftRd.js → isSameWeek-HfxKk6Lz.js} +2 -2
- package/dist/_chunks/{it-GiQrQ9p4.js → it-Y85ofIQQ.js} +7 -7
- package/dist/_chunks/{ja-qfYg3Rua.js → ja-CQ7J6YoA.js} +2 -2
- package/dist/_chunks/{marketplace-app-shell-kVAVycz_.js → marketplace-app-shell-Dc5cTIt8.js} +186 -149
- package/dist/_chunks/{nl-xOogO4sZ.js → nl-D9kHCmp3.js} +2 -2
- package/dist/_chunks/{patient-shell-lDX3wwu6.js → patient-shell-CnT4L8gn.js} +2 -2
- package/dist/_chunks/{pl-GnOW6eGK.js → pl-B3Smqpkr.js} +3 -3
- package/dist/_chunks/{pregnancy-weight-gain-B7kBK-ZR.js → pregnancy-weight-gain-C5YhfYnL.js} +60 -50
- package/dist/_chunks/{pt-_bV5b5RW.js → pt-D3J-1c_7.js} +6 -6
- package/dist/_chunks/{ro-BEcyh5Nj.js → ro-BKAbbEA3.js} +2 -2
- package/dist/_chunks/{ru-Bi86hqMf.js → ru-BeG8f0Ep.js} +3 -3
- package/dist/_chunks/{sign-document-QHfcNKFj.js → sign-document-B-3k_0LO.js} +165 -137
- package/dist/_chunks/{sq-BujHSAWu.js → sq-_hRPaeUy.js} +6 -6
- package/dist/_chunks/subDays-Dv7q9S7u.js +8 -0
- package/dist/_chunks/{sv-C8AeDrTA.js → sv-g009fSpe.js} +2 -2
- package/dist/_chunks/{tab-bar-C4II-7ej.js → tab-bar-Xetknddo.js} +53 -34
- package/dist/_chunks/{tr-CMSs_Vgf.js → tr-OKUOuhMW.js} +2 -2
- package/dist/_chunks/{unit-converter-D1UrEUxa.js → unit-converter-Ds9jalbN.js} +78 -67
- package/dist/_chunks/{zh-CN-eXB-PFu4.js → zh-CN-De4zwEhx.js} +3 -3
- package/dist/agent-catalog.json +1 -1
- package/dist/components/_shared/calendar-class-names.d.ts +8 -0
- package/dist/components/_shared/index.d.ts +2 -0
- package/dist/components/_shared/insert-result.d.ts +149 -4
- package/dist/components/badge/badge.d.ts +1 -1
- package/dist/components/bmi-calculator/bmi-calculator.d.ts +6 -0
- package/dist/components/bmi-calculator/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/calculator-dialog/index.js +1 -1
- package/dist/components/card/card.d.ts +1 -1
- package/dist/components/chart/chart.d.ts +10 -0
- package/dist/components/chart/index.js +1 -1
- package/dist/components/cycle-calculator/cycle-calculator.d.ts +6 -0
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/date-picker/date-picker.d.ts +0 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-range-picker/date-range-picker.d.ts +0 -1
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/date-time-picker.d.ts +0 -1
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/dialog/dialog.d.ts +1 -0
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/due-date-calculator/due-date-calculator.d.ts +6 -0
- package/dist/components/due-date-calculator/index.js +2 -2
- package/dist/components/gestational-age-calculator/gestational-age-calculator.d.ts +6 -0
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/header/header.d.ts +8 -0
- package/dist/components/header/index.js +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/pregnancy-weight-gain/index.js +1 -1
- package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.d.ts +6 -0
- package/dist/components/public-header/public-header.d.ts +1 -1
- package/dist/components/sign-document/index.js +1 -1
- package/dist/components/sign-document/sign-document.d.ts +12 -0
- package/dist/components/stat/stat.d.ts +1 -1
- package/dist/components/tab-bar/index.d.ts +1 -1
- package/dist/components/tab-bar/index.js +1 -1
- package/dist/components/tab-bar/tab-bar.d.ts +44 -1
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/components/unit-converter/unit-converter.d.ts +6 -0
- package/dist/index.js +504 -502
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/marketplace-app-shell.d.ts +57 -1
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/tokens.css +1411 -2
- package/package.json +1 -1
- package/dist/_chunks/bmi-calculator-D4juUcyF.js +0 -219
- package/dist/_chunks/dialog-Cee13rHU.js +0 -215
- package/dist/_chunks/gestational-age-calculator-CWOG3bkI.js +0 -178
- package/dist/_chunks/insert-result-DtQQeSSf.js +0 -227
- package/dist/_chunks/react-day-picker-CdtIiKjx.js +0 -3174
- package/dist/_chunks/subDays-_T9YeKPX.js +0 -8
|
@@ -4,13 +4,13 @@ import { useTranslation as ee } from "react-i18next";
|
|
|
4
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 { b as ne, u as re, g as se, c as oe, e as T, s as W, f as ie, h as de, j as v, d as ce, C as le, k as pe, t as ge, p as ue, D as me, l as fe, m as he } from "./
|
|
8
|
-
import { s as R } from "./subDays-
|
|
9
|
-
import { u as
|
|
10
|
-
function
|
|
7
|
+
import { b as ne, u as re, g as se, c as oe, e as T, s as W, f as ie, h as de, j as v, d as ce, C as le, k as pe, t as ge, p as ue, D as me, l as fe, m as he, n as ke } from "./date-picker-variants-DLi1Va_e.js";
|
|
8
|
+
import { s as R } from "./subDays-Dv7q9S7u.js";
|
|
9
|
+
import { u as ye } from "./registry-nPAVE19X.js";
|
|
10
|
+
function be(a, s, i) {
|
|
11
11
|
return ne(a, -1, i);
|
|
12
12
|
}
|
|
13
|
-
const
|
|
13
|
+
const ve = {
|
|
14
14
|
id: "date-range-picker",
|
|
15
15
|
capabilities: ["range_pick", "open", "close"],
|
|
16
16
|
state: {
|
|
@@ -81,7 +81,7 @@ const be = {
|
|
|
81
81
|
description: "Sourced from the id prop."
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
},
|
|
84
|
+
}, Re = Q(
|
|
85
85
|
({
|
|
86
86
|
value: a,
|
|
87
87
|
defaultValue: s,
|
|
@@ -137,7 +137,7 @@ const be = {
|
|
|
137
137
|
{
|
|
138
138
|
label: r("inputs.dateRangePicker.presets.lastWeek", "Last week"),
|
|
139
139
|
range: () => {
|
|
140
|
-
const e =
|
|
140
|
+
const e = be(/* @__PURE__ */ new Date());
|
|
141
141
|
return {
|
|
142
142
|
from: W(e, { locale: o }),
|
|
143
143
|
to: T(e, { locale: o })
|
|
@@ -163,13 +163,13 @@ const be = {
|
|
|
163
163
|
}, J = (e) => {
|
|
164
164
|
const u = e.range();
|
|
165
165
|
d(u), O(u.from), g(!1);
|
|
166
|
-
},
|
|
166
|
+
}, N = (() => {
|
|
167
167
|
if (t.from && t.to) {
|
|
168
168
|
const e = v(t.from, y, { locale: o }), u = v(t.to, y, { locale: o });
|
|
169
169
|
return `${e} – ${u}`;
|
|
170
170
|
}
|
|
171
171
|
return t.from ? v(t.from, y, { locale: o }) : "";
|
|
172
|
-
})(),
|
|
172
|
+
})(), M = (() => {
|
|
173
173
|
if (t.from && t.to) {
|
|
174
174
|
const e = ce(t.to, t.from) + 1;
|
|
175
175
|
return r("inputs.dateRangePicker.days", "{{count}} days", {
|
|
@@ -188,7 +188,7 @@ const be = {
|
|
|
188
188
|
}),
|
|
189
189
|
[t, d, p]
|
|
190
190
|
);
|
|
191
|
-
return z(B, () => b, [b]),
|
|
191
|
+
return z(B, () => b, [b]), ye(ve, b, k), /* @__PURE__ */ n(f.Root, { open: p, onOpenChange: g, children: /* @__PURE__ */ m(
|
|
192
192
|
"div",
|
|
193
193
|
{
|
|
194
194
|
className: j,
|
|
@@ -211,8 +211,8 @@ const be = {
|
|
|
211
211
|
/* @__PURE__ */ n(
|
|
212
212
|
"span",
|
|
213
213
|
{
|
|
214
|
-
className:
|
|
215
|
-
children:
|
|
214
|
+
className: N ? "ds:text-foreground" : "ds:text-muted-foreground",
|
|
215
|
+
children: N || _
|
|
216
216
|
}
|
|
217
217
|
),
|
|
218
218
|
/* @__PURE__ */ n(
|
|
@@ -231,7 +231,7 @@ const be = {
|
|
|
231
231
|
{
|
|
232
232
|
sideOffset: 4,
|
|
233
233
|
align: "start",
|
|
234
|
-
className:
|
|
234
|
+
className: ke(),
|
|
235
235
|
children: /* @__PURE__ */ m("div", { className: "ds:flex ds:gap-[var(--spacing-md)]", children: [
|
|
236
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(
|
|
237
237
|
"button",
|
|
@@ -258,16 +258,17 @@ const be = {
|
|
|
258
258
|
showOutsideDays: !0,
|
|
259
259
|
fixedWeeks: !0,
|
|
260
260
|
pagedNavigation: !0,
|
|
261
|
+
classNames: he,
|
|
261
262
|
components: { Chevron: fe }
|
|
262
263
|
}
|
|
263
264
|
),
|
|
264
|
-
|
|
265
|
+
M ? /* @__PURE__ */ n(
|
|
265
266
|
"div",
|
|
266
267
|
{
|
|
267
268
|
role: "status",
|
|
268
269
|
"aria-live": "polite",
|
|
269
270
|
className: "type-body-sm ds:text-muted-foreground ds:mt-[var(--spacing-sm)] ds:text-center",
|
|
270
|
-
children:
|
|
271
|
+
children: M
|
|
271
272
|
}
|
|
272
273
|
) : null
|
|
273
274
|
] })
|
|
@@ -279,9 +280,9 @@ const be = {
|
|
|
279
280
|
) });
|
|
280
281
|
}
|
|
281
282
|
);
|
|
282
|
-
|
|
283
|
+
Re.displayName = "DateRangePicker";
|
|
283
284
|
export {
|
|
284
|
-
|
|
285
|
-
|
|
285
|
+
Re as D,
|
|
286
|
+
ve as d
|
|
286
287
|
};
|
|
287
|
-
//# sourceMappingURL=date-range-picker-
|
|
288
|
+
//# sourceMappingURL=date-range-picker-DcXuI9y7.js.map
|
|
@@ -6,8 +6,8 @@ import * as k from "@radix-ui/react-popover";
|
|
|
6
6
|
import { u as me } from "./use-controllable-state-BiY4xTzM.js";
|
|
7
7
|
import { u as pe } from "./form-field-context-B3APVHKx.js";
|
|
8
8
|
import { T as fe } from "./time-picker-B5umYwfv.js";
|
|
9
|
-
import { u as ge, c as he,
|
|
10
|
-
import { u as
|
|
9
|
+
import { u as ge, c as he, o as ve, i as be, j as ye, C as Te, k as ke, t as we, D as De, l as Ce, m as Pe, n as xe } from "./date-picker-variants-DLi1Va_e.js";
|
|
10
|
+
import { u as Oe } from "./registry-nPAVE19X.js";
|
|
11
11
|
import { t as j } from "./isSameDay-DUEiAT0G.js";
|
|
12
12
|
function K(e, t, r) {
|
|
13
13
|
const i = j(e, r == null ? void 0 : r.in);
|
|
@@ -17,7 +17,7 @@ function A(e, t, r) {
|
|
|
17
17
|
const i = j(e, r == null ? void 0 : r.in);
|
|
18
18
|
return i.setMinutes(t), i;
|
|
19
19
|
}
|
|
20
|
-
const
|
|
20
|
+
const Ne = {
|
|
21
21
|
id: "date-time-picker",
|
|
22
22
|
capabilities: ["pick", "open", "close"],
|
|
23
23
|
state: {
|
|
@@ -96,7 +96,7 @@ function Me(e, t) {
|
|
|
96
96
|
return "";
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function Ve(e) {
|
|
100
100
|
if (!e || e === "local") return !1;
|
|
101
101
|
try {
|
|
102
102
|
const t = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
@@ -105,7 +105,7 @@ function Ne(e) {
|
|
|
105
105
|
return !1;
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
const
|
|
108
|
+
const Se = ce(
|
|
109
109
|
[
|
|
110
110
|
"ds:w-full ds:rounded-[var(--radius-sm)]",
|
|
111
111
|
"ds:bg-primary ds:text-primary-foreground",
|
|
@@ -125,7 +125,7 @@ const Ve = ce(
|
|
|
125
125
|
},
|
|
126
126
|
defaultVariants: { size: "md" }
|
|
127
127
|
}
|
|
128
|
-
),
|
|
128
|
+
), Ie = ne(
|
|
129
129
|
({
|
|
130
130
|
value: e,
|
|
131
131
|
defaultValue: t,
|
|
@@ -142,10 +142,10 @@ const Ve = ce(
|
|
|
142
142
|
className: E,
|
|
143
143
|
id: U
|
|
144
144
|
}, W) => {
|
|
145
|
-
const { t: l, i18n:
|
|
145
|
+
const { t: l, i18n: N } = ue(), c = pe(), D = U ?? c.id, M = c.disabled || _, q = c.invalid ? "error" : "default", V = ge(N.language), G = z ?? l("inputs.dateTimePicker.placeholder", "Select date and time"), J = l("inputs.dateTimePicker.apply", "Apply"), Q = l(
|
|
146
146
|
"inputs.dateTimePicker.outOfRange",
|
|
147
147
|
"Date/time is out of allowed range"
|
|
148
|
-
), S = (w !== void 0 ? w :
|
|
148
|
+
), S = (w !== void 0 ? w : Ve(i)) ? Me(N.language, i) : "", [X, I] = me({
|
|
149
149
|
value: e,
|
|
150
150
|
defaultValue: t,
|
|
151
151
|
onChange: r
|
|
@@ -192,20 +192,20 @@ const Ve = ce(
|
|
|
192
192
|
}),
|
|
193
193
|
[n, b, h]
|
|
194
194
|
);
|
|
195
|
-
return le(W, () => x, [x]),
|
|
195
|
+
return le(W, () => x, [x]), Oe(Ne, x, D), /* @__PURE__ */ s(k.Root, { open: h, onOpenChange: ee, children: /* @__PURE__ */ y(
|
|
196
196
|
"div",
|
|
197
197
|
{
|
|
198
198
|
className: E,
|
|
199
199
|
"data-component": "date-time-picker",
|
|
200
200
|
"data-component-id": D,
|
|
201
201
|
children: [
|
|
202
|
-
/* @__PURE__ */ s(k.Trigger, { asChild: !0, disabled:
|
|
202
|
+
/* @__PURE__ */ s(k.Trigger, { asChild: !0, disabled: M, children: /* @__PURE__ */ y(
|
|
203
203
|
"button",
|
|
204
204
|
{
|
|
205
205
|
ref: L,
|
|
206
206
|
id: D,
|
|
207
207
|
type: "button",
|
|
208
|
-
disabled:
|
|
208
|
+
disabled: M,
|
|
209
209
|
"aria-describedby": c.describedBy || void 0,
|
|
210
210
|
"aria-invalid": c.invalid || void 0,
|
|
211
211
|
"aria-haspopup": "dialog",
|
|
@@ -235,7 +235,7 @@ const Ve = ce(
|
|
|
235
235
|
{
|
|
236
236
|
sideOffset: 4,
|
|
237
237
|
align: "start",
|
|
238
|
-
className:
|
|
238
|
+
className: xe(),
|
|
239
239
|
children: /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:sm:flex-row ds:gap-[var(--spacing-md)]", children: [
|
|
240
240
|
/* @__PURE__ */ s("div", { role: "region", "aria-label": re, children: /* @__PURE__ */ s(
|
|
241
241
|
De,
|
|
@@ -249,6 +249,7 @@ const Ve = ce(
|
|
|
249
249
|
locale: V,
|
|
250
250
|
showOutsideDays: !0,
|
|
251
251
|
fixedWeeks: !0,
|
|
252
|
+
classNames: Pe,
|
|
252
253
|
components: { Chevron: Ce }
|
|
253
254
|
}
|
|
254
255
|
) }),
|
|
@@ -287,7 +288,7 @@ const Ve = ce(
|
|
|
287
288
|
type: "button",
|
|
288
289
|
onClick: se,
|
|
289
290
|
disabled: !o || R,
|
|
290
|
-
className:
|
|
291
|
+
className: Se({ size: f }),
|
|
291
292
|
children: J
|
|
292
293
|
}
|
|
293
294
|
)
|
|
@@ -302,9 +303,9 @@ const Ve = ce(
|
|
|
302
303
|
) });
|
|
303
304
|
}
|
|
304
305
|
);
|
|
305
|
-
|
|
306
|
+
Ie.displayName = "DateTimePicker";
|
|
306
307
|
export {
|
|
307
|
-
|
|
308
|
-
|
|
308
|
+
Ie as D,
|
|
309
|
+
Ne as d
|
|
309
310
|
};
|
|
310
|
-
//# sourceMappingURL=date-time-picker-
|
|
311
|
+
//# sourceMappingURL=date-time-picker-RimumeLR.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { q as s, r as n, v as o, w as u } from "./date-picker-variants-DLi1Va_e.js";
|
|
2
2
|
const d = {
|
|
3
3
|
lessThanXSeconds: {
|
|
4
4
|
standalone: {
|
|
@@ -474,4 +474,4 @@ const d = {
|
|
|
474
474
|
export {
|
|
475
475
|
O as de
|
|
476
476
|
};
|
|
477
|
-
//# sourceMappingURL=de-
|
|
477
|
+
//# sourceMappingURL=de-bTBGdjPS.js.map
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { jsx as t, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as j, useEffect as O, useMemo as T, forwardRef as i, useContext as x, createContext as B } from "react";
|
|
3
|
+
import * as s from "@radix-ui/react-dialog";
|
|
4
|
+
import { c as k } from "./index-D2ZczOXr.js";
|
|
5
|
+
import { useTranslation as S } from "react-i18next";
|
|
6
|
+
import { u as w } from "./use-controllable-state-BiY4xTzM.js";
|
|
7
|
+
import { u as A } from "./registry-nPAVE19X.js";
|
|
8
|
+
import { X as E } from "./x-CCcI3eJp.js";
|
|
9
|
+
const H = {
|
|
10
|
+
id: "dialog",
|
|
11
|
+
capabilities: ["open", "close", "dismiss"],
|
|
12
|
+
state: {
|
|
13
|
+
isOpen: {
|
|
14
|
+
type: "boolean",
|
|
15
|
+
description: "True when the dialog is currently open.",
|
|
16
|
+
read: (e) => e.getIsOpen()
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
actions: {
|
|
20
|
+
open: {
|
|
21
|
+
safety: "read",
|
|
22
|
+
description: "Open the dialog.",
|
|
23
|
+
invoke: (e) => {
|
|
24
|
+
e.open();
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
close: {
|
|
28
|
+
safety: "write",
|
|
29
|
+
description: "Close the dialog. Reversible by reopening.",
|
|
30
|
+
invoke: (e) => {
|
|
31
|
+
e.close();
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
dismiss: {
|
|
35
|
+
safety: "destructive",
|
|
36
|
+
description: "Dismiss the dialog. Loses any in-progress input that has not been committed.",
|
|
37
|
+
invoke: (e) => {
|
|
38
|
+
e.close();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
domHooks: {
|
|
43
|
+
root: { attr: "data-component", value: "dialog" },
|
|
44
|
+
instanceId: {
|
|
45
|
+
attr: "data-component-id",
|
|
46
|
+
sourceProp: "id",
|
|
47
|
+
description: "Sourced from the id prop on Dialog.Root."
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}, I = [
|
|
51
|
+
"ds-dialog__backdrop",
|
|
52
|
+
"ds:backdrop-blur-sm",
|
|
53
|
+
"ds:data-[state=open]:animate-in ds:data-[state=open]:fade-in-0",
|
|
54
|
+
"ds:data-[state=closed]:animate-out ds:data-[state=closed]:fade-out-0",
|
|
55
|
+
"ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none"
|
|
56
|
+
].join(" "), z = [
|
|
57
|
+
"ds:focus-visible:outline-none",
|
|
58
|
+
"ds:data-[state=open]:animate-in ds:data-[state=open]:fade-in-0 ds:data-[state=open]:zoom-in-95",
|
|
59
|
+
"ds:data-[state=closed]:animate-out ds:data-[state=closed]:fade-out-0 ds:data-[state=closed]:zoom-out-95",
|
|
60
|
+
"ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none"
|
|
61
|
+
].join(" "), F = k(`ds-dialog ds-dialog__surface ${z}`, {
|
|
62
|
+
variants: {
|
|
63
|
+
size: {
|
|
64
|
+
sm: "ds-dialog__surface--sm",
|
|
65
|
+
md: "",
|
|
66
|
+
lg: "ds-dialog__surface--lg",
|
|
67
|
+
fullscreen: "ds-dialog__surface--fullscreen"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
defaultVariants: { size: "md" }
|
|
71
|
+
}), f = B(void 0), g = ({
|
|
72
|
+
children: e,
|
|
73
|
+
id: o,
|
|
74
|
+
open: a,
|
|
75
|
+
defaultOpen: r,
|
|
76
|
+
onOpenChange: c,
|
|
77
|
+
...m
|
|
78
|
+
}) => {
|
|
79
|
+
const [p, n] = w({
|
|
80
|
+
value: a,
|
|
81
|
+
defaultValue: r ?? !1,
|
|
82
|
+
onChange: c
|
|
83
|
+
}), d = p ?? !1, l = j(d);
|
|
84
|
+
O(() => {
|
|
85
|
+
l.current = d;
|
|
86
|
+
}, [d]);
|
|
87
|
+
const R = T(
|
|
88
|
+
() => ({
|
|
89
|
+
getIsOpen: () => l.current,
|
|
90
|
+
open: () => n(!0),
|
|
91
|
+
close: () => n(!1)
|
|
92
|
+
}),
|
|
93
|
+
[n]
|
|
94
|
+
);
|
|
95
|
+
return A(H, R, o), /* @__PURE__ */ t(f.Provider, { value: o, children: /* @__PURE__ */ t(s.Root, { open: d, onOpenChange: n, ...m, children: e }) });
|
|
96
|
+
};
|
|
97
|
+
g.displayName = "Dialog.Root";
|
|
98
|
+
const D = i(({ children: e, ...o }, a) => /* @__PURE__ */ t(s.Trigger, { ref: a, ...o, children: e }));
|
|
99
|
+
D.displayName = "Dialog.Trigger";
|
|
100
|
+
const y = i(({ children: e, ...o }, a) => /* @__PURE__ */ t(s.Close, { ref: a, ...o, children: e }));
|
|
101
|
+
y.displayName = "Dialog.Close";
|
|
102
|
+
const v = i(
|
|
103
|
+
({
|
|
104
|
+
size: e = "md",
|
|
105
|
+
variant: o = "default",
|
|
106
|
+
hideCloseButton: a = !0,
|
|
107
|
+
className: r,
|
|
108
|
+
children: c,
|
|
109
|
+
...m
|
|
110
|
+
}, p) => {
|
|
111
|
+
const { t: n } = S(), d = x(f), l = o === "alert" ? { role: "alertdialog" } : {};
|
|
112
|
+
return /* @__PURE__ */ u(s.Portal, { children: [
|
|
113
|
+
/* @__PURE__ */ t(
|
|
114
|
+
s.Overlay,
|
|
115
|
+
{
|
|
116
|
+
"data-component": "dialog-overlay",
|
|
117
|
+
className: I
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
/* @__PURE__ */ u(
|
|
121
|
+
s.Content,
|
|
122
|
+
{
|
|
123
|
+
ref: p,
|
|
124
|
+
...l,
|
|
125
|
+
"data-component": "dialog",
|
|
126
|
+
"data-component-id": d,
|
|
127
|
+
className: F({ size: e, className: r }),
|
|
128
|
+
...m,
|
|
129
|
+
children: [
|
|
130
|
+
c,
|
|
131
|
+
!a && // The close is a plain button carrying the `ds-dialog__close`
|
|
132
|
+
// contract class — the SAME class a vanilla host renders. The CSS
|
|
133
|
+
// (src/styles.css) owns its position, sizing, glyph size, hover
|
|
134
|
+
// wash, and focus ring from tokens, so the React and non-React
|
|
135
|
+
// close buttons are identical and can't drift.
|
|
136
|
+
/* @__PURE__ */ t(
|
|
137
|
+
s.Close,
|
|
138
|
+
{
|
|
139
|
+
type: "button",
|
|
140
|
+
className: "ds-dialog__close",
|
|
141
|
+
"aria-label": n("common.close", "Close"),
|
|
142
|
+
children: /* @__PURE__ */ t(E, { "aria-hidden": "true" })
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
)
|
|
148
|
+
] });
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
v.displayName = "Dialog.Content";
|
|
152
|
+
const C = i(
|
|
153
|
+
({ className: e, ...o }, a) => /* @__PURE__ */ t(
|
|
154
|
+
"div",
|
|
155
|
+
{
|
|
156
|
+
ref: a,
|
|
157
|
+
className: ["ds-dialog__header", e].filter(Boolean).join(" "),
|
|
158
|
+
...o
|
|
159
|
+
}
|
|
160
|
+
)
|
|
161
|
+
);
|
|
162
|
+
C.displayName = "Dialog.Header";
|
|
163
|
+
const _ = i(
|
|
164
|
+
({ className: e, ...o }, a) => /* @__PURE__ */ t(
|
|
165
|
+
"div",
|
|
166
|
+
{
|
|
167
|
+
ref: a,
|
|
168
|
+
className: ["ds-dialog__body", e].filter(Boolean).join(" "),
|
|
169
|
+
...o
|
|
170
|
+
}
|
|
171
|
+
)
|
|
172
|
+
);
|
|
173
|
+
_.displayName = "Dialog.Body";
|
|
174
|
+
const b = i(({ className: e, ...o }, a) => /* @__PURE__ */ t(
|
|
175
|
+
s.Title,
|
|
176
|
+
{
|
|
177
|
+
ref: a,
|
|
178
|
+
className: ["ds-dialog__title type-title-card ds:break-words", e].filter(Boolean).join(" "),
|
|
179
|
+
...o
|
|
180
|
+
}
|
|
181
|
+
));
|
|
182
|
+
b.displayName = "Dialog.Title";
|
|
183
|
+
const h = i(({ className: e, ...o }, a) => /* @__PURE__ */ t(
|
|
184
|
+
s.Description,
|
|
185
|
+
{
|
|
186
|
+
ref: a,
|
|
187
|
+
className: ["type-body-sm ds:text-[var(--muted-foreground)]", e].filter(Boolean).join(" "),
|
|
188
|
+
...o
|
|
189
|
+
}
|
|
190
|
+
));
|
|
191
|
+
h.displayName = "Dialog.Description";
|
|
192
|
+
const N = i(
|
|
193
|
+
({ className: e, divider: o = !1, ...a }, r) => /* @__PURE__ */ t(
|
|
194
|
+
"div",
|
|
195
|
+
{
|
|
196
|
+
ref: r,
|
|
197
|
+
className: [
|
|
198
|
+
"ds:flex ds:items-center ds:justify-end ds:gap-[var(--spacing-sm)]",
|
|
199
|
+
"ds:mt-[var(--spacing-md)]",
|
|
200
|
+
o && "ds:border-t ds:border-[color:var(--border)] ds:pt-[var(--spacing-md)]",
|
|
201
|
+
e
|
|
202
|
+
].filter(Boolean).join(" "),
|
|
203
|
+
...a
|
|
204
|
+
}
|
|
205
|
+
)
|
|
206
|
+
);
|
|
207
|
+
N.displayName = "Dialog.Footer";
|
|
208
|
+
const $ = Object.assign(g, {
|
|
209
|
+
Root: g,
|
|
210
|
+
Trigger: D,
|
|
211
|
+
Content: v,
|
|
212
|
+
Header: C,
|
|
213
|
+
Title: b,
|
|
214
|
+
Description: h,
|
|
215
|
+
Body: _,
|
|
216
|
+
Footer: N,
|
|
217
|
+
Close: y
|
|
218
|
+
});
|
|
219
|
+
export {
|
|
220
|
+
$ as D,
|
|
221
|
+
H as d
|
|
222
|
+
};
|
|
223
|
+
//# sourceMappingURL=dialog-BTpZV6It.js.map
|