@sequenceholdings/atlas-ui 4.0.0 → 4.1.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/index.d.ts +77 -8
- package/dist/index.mjs +53 -52
- package/dist/next.mjs +1 -1
- package/dist/shared/components/ui/alert-dialog.mjs +41 -38
- package/dist/shared/components/ui/button.mjs +13 -13
- package/dist/shared/components/ui/chart.mjs +1 -1
- package/dist/shared/components/ui/date-field.mjs +83 -66
- package/dist/shared/components/ui/dialog.mjs +43 -40
- package/dist/shared/components/ui/iso-date-field.mjs +11 -10
- package/dist/shared/components/ui/pro-data-table.mjs +274 -251
- package/dist/shared/components/ui/segmented-control.mjs +2 -2
- package/dist/shared/components/ui/spinner.mjs +11 -9
- package/dist/shared/components/ui/table-heatmap.mjs +40 -0
- package/dist/shared/components/ui/tabs.mjs +2 -2
- package/dist/shared/components/ui/toggle-group.mjs +22 -22
- package/dist/shared/components/ui/toggle.mjs +13 -8
- package/dist/shared/components/ui/use-overlay-portal-target.mjs +18 -15
- package/package.json +1 -1
|
@@ -69,34 +69,44 @@ var g = [
|
|
|
69
69
|
}
|
|
70
70
|
];
|
|
71
71
|
function v(o) {
|
|
72
|
-
let l = o.mode ?? "single", { id: u, placeholder: m, disabled: h, max: v, min:
|
|
72
|
+
let l = o.mode ?? "single", { id: u, placeholder: m, disabled: h, max: v, min: y, referenceDate: T, align: E = "start", presets: D, containerClassName: O, className: k, popoverClassName: A, ariaLabel: j, "aria-describedby": M, "aria-invalid": N, variant: P = "field", yearBias: F = "past" } = o, I = o.clearable ?? P === "field", L = P === "pill", [R, z] = d.useState(!1), B = d.useMemo(() => T ?? /* @__PURE__ */ new Date(), [T, R]), V = D ?? (l === "range" ? _ : g), H = o.value, U = o.formatTrigger, W = d.useMemo(() => H === null ? null : l === "range" ? (U ?? c)(H) : (U ?? s)(H), [
|
|
73
|
+
l,
|
|
74
|
+
H,
|
|
75
|
+
U
|
|
76
|
+
]);
|
|
73
77
|
return /* @__PURE__ */ p(r, {
|
|
74
|
-
open:
|
|
75
|
-
onOpenChange: (e) => !h &&
|
|
78
|
+
open: R,
|
|
79
|
+
onOpenChange: (e) => !h && z(e),
|
|
76
80
|
modal: !1,
|
|
77
81
|
children: [/* @__PURE__ */ p("div", {
|
|
78
|
-
className: e("relative inline-flex",
|
|
82
|
+
className: e("relative inline-flex", O),
|
|
79
83
|
children: [/* @__PURE__ */ f(a, {
|
|
80
84
|
asChild: !0,
|
|
81
85
|
children: /* @__PURE__ */ p("button", {
|
|
82
86
|
id: u,
|
|
83
87
|
type: "button",
|
|
84
88
|
disabled: h,
|
|
85
|
-
"aria-label":
|
|
86
|
-
"aria-describedby":
|
|
87
|
-
"aria-invalid":
|
|
89
|
+
"aria-label": j ?? (u ? void 0 : "Select date"),
|
|
90
|
+
"aria-describedby": M,
|
|
91
|
+
"aria-invalid": N,
|
|
88
92
|
"aria-haspopup": "dialog",
|
|
89
|
-
"aria-expanded":
|
|
90
|
-
|
|
91
|
-
|
|
93
|
+
"aria-expanded": R,
|
|
94
|
+
"data-variant": P,
|
|
95
|
+
className: b({
|
|
96
|
+
variant: P,
|
|
97
|
+
hasValue: W !== null,
|
|
98
|
+
showClear: I && W !== null && !h,
|
|
99
|
+
className: k
|
|
100
|
+
}),
|
|
101
|
+
children: [!L && /* @__PURE__ */ f(t, {
|
|
92
102
|
className: "size-icon shrink-0 text-muted-foreground",
|
|
93
103
|
stroke: 1.75
|
|
94
104
|
}), /* @__PURE__ */ f("span", {
|
|
95
105
|
className: "flex-1 truncate text-left",
|
|
96
|
-
children:
|
|
106
|
+
children: W ?? m ?? x(l)
|
|
97
107
|
})]
|
|
98
108
|
})
|
|
99
|
-
}),
|
|
109
|
+
}), I && W && !h && /* @__PURE__ */ f("button", {
|
|
100
110
|
type: "button",
|
|
101
111
|
onClick: (e) => {
|
|
102
112
|
e.preventDefault(), e.stopPropagation(), o.onChange(null);
|
|
@@ -106,61 +116,68 @@ function v(o) {
|
|
|
106
116
|
children: /* @__PURE__ */ f(n, { className: "size-icon-inline" })
|
|
107
117
|
})]
|
|
108
118
|
}), /* @__PURE__ */ f(i, {
|
|
109
|
-
align:
|
|
110
|
-
className: e("w-auto p-0 border-input",
|
|
111
|
-
onInteractOutside:
|
|
112
|
-
children: /* @__PURE__ */ f(
|
|
119
|
+
align: E,
|
|
120
|
+
className: e("w-auto p-0 border-input", A),
|
|
121
|
+
onInteractOutside: S,
|
|
122
|
+
children: /* @__PURE__ */ f(w, {
|
|
113
123
|
mode: l,
|
|
114
124
|
value: o.value,
|
|
115
|
-
now:
|
|
116
|
-
min:
|
|
125
|
+
now: B,
|
|
126
|
+
min: y,
|
|
117
127
|
max: v,
|
|
118
|
-
presets:
|
|
119
|
-
yearBias:
|
|
128
|
+
presets: V,
|
|
129
|
+
yearBias: F,
|
|
120
130
|
onApply: (e) => {
|
|
121
131
|
if (e === null) {
|
|
122
|
-
o.onChange(null),
|
|
132
|
+
o.onChange(null), z(!1);
|
|
123
133
|
return;
|
|
124
134
|
}
|
|
125
135
|
if (l === "range") {
|
|
126
|
-
let t =
|
|
136
|
+
let t = C(e) ? e : {
|
|
127
137
|
from: e,
|
|
128
138
|
to: e
|
|
129
139
|
};
|
|
130
140
|
o.onChange(t);
|
|
131
141
|
} else {
|
|
132
|
-
let t =
|
|
142
|
+
let t = C(e) ? e.from : e;
|
|
133
143
|
o.onChange(t);
|
|
134
144
|
}
|
|
135
|
-
|
|
145
|
+
z(!1);
|
|
136
146
|
},
|
|
137
|
-
onClose: () =>
|
|
147
|
+
onClose: () => z(!1)
|
|
138
148
|
})
|
|
139
149
|
})]
|
|
140
150
|
});
|
|
141
151
|
}
|
|
142
|
-
|
|
152
|
+
var y = {
|
|
153
|
+
field: "h-9 w-full gap-2 rounded-field border border-input bg-field px-3 text-sm hover:border-input hover:bg-accent",
|
|
154
|
+
pill: "max-w-full rounded-control bg-transparent px-1.5 py-0.5 text-xs font-medium hover:bg-accent"
|
|
155
|
+
};
|
|
156
|
+
function b({ variant: t, hasValue: n, showClear: r, className: i }) {
|
|
157
|
+
return e("inline-flex items-center text-foreground transition-colors", y[t], "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", "disabled:cursor-not-allowed disabled:opacity-50", !n && "text-muted-foreground", r && (t === "pill" ? "pr-7" : "pr-9"), i);
|
|
158
|
+
}
|
|
159
|
+
function x(e) {
|
|
143
160
|
return e === "range" ? "Select range" : "Select date";
|
|
144
161
|
}
|
|
145
|
-
function
|
|
162
|
+
function S(e) {
|
|
146
163
|
let t = ("detail" in e && e.detail && "originalEvent" in e.detail ? e.detail.originalEvent : e)?.target;
|
|
147
164
|
t && (t.closest("[role=\"listbox\"]") || t.closest("[data-radix-popper-content-wrapper]")) && "preventDefault" in e && typeof e.preventDefault == "function" && e.preventDefault();
|
|
148
165
|
}
|
|
149
|
-
function
|
|
166
|
+
function C(e) {
|
|
150
167
|
return typeof e == "object" && !!e && !(e instanceof Date) && "from" in e && "to" in e && e.from instanceof Date && e.to instanceof Date;
|
|
151
168
|
}
|
|
152
|
-
function
|
|
153
|
-
let [_, v] = d.useState(n instanceof Date ? n : null), [y, b] = d.useState(
|
|
169
|
+
function w({ mode: t, value: n, now: r, min: i, max: a, presets: s, showClear: c = !0, yearBias: m = "past", onApply: h, onClose: g }) {
|
|
170
|
+
let [_, v] = d.useState(n instanceof Date ? n : null), [y, b] = d.useState(C(n) ? {
|
|
154
171
|
from: n.from,
|
|
155
172
|
to: n.to
|
|
156
|
-
} : null), [
|
|
173
|
+
} : null), [x, S] = d.useState(""), [w, E] = d.useState(null), D = d.useRef(null), O = d.useRef(null), j = d.useRef(!1), M = d.useRef(null), N = t === "range" ? C(n) ? `${n.from.getTime()}:${n.to.getTime()}` : "none" : n instanceof Date ? String(n.getTime()) : "none";
|
|
157
174
|
d.useEffect(() => {
|
|
158
|
-
t === "range" ? (b(
|
|
175
|
+
t === "range" ? (b(C(n) ? {
|
|
159
176
|
from: n.from,
|
|
160
177
|
to: n.to
|
|
161
|
-
} : null), v(null)) : (v(n instanceof Date ? n : null), b(null)),
|
|
178
|
+
} : null), v(null)) : (v(n instanceof Date ? n : null), b(null)), S(""), E(null);
|
|
162
179
|
}, [t, N]), d.useEffect(() => {
|
|
163
|
-
let e = window.requestAnimationFrame(() =>
|
|
180
|
+
let e = window.requestAnimationFrame(() => D.current?.focus());
|
|
164
181
|
return () => window.cancelAnimationFrame(e);
|
|
165
182
|
}, []);
|
|
166
183
|
let P = t === "range";
|
|
@@ -182,7 +199,7 @@ function S({ mode: t, value: n, now: r, min: i, max: a, presets: s, showClear: c
|
|
|
182
199
|
E("Couldn't parse that date range");
|
|
183
200
|
return;
|
|
184
201
|
}
|
|
185
|
-
if (!
|
|
202
|
+
if (!T(e.from, i, a) || !T(e.to, i, a)) {
|
|
186
203
|
E("That range is outside the allowed window");
|
|
187
204
|
return;
|
|
188
205
|
}
|
|
@@ -199,27 +216,27 @@ function S({ mode: t, value: n, now: r, min: i, max: a, presets: s, showClear: c
|
|
|
199
216
|
E("Couldn't parse that date");
|
|
200
217
|
return;
|
|
201
218
|
}
|
|
202
|
-
if (!
|
|
219
|
+
if (!T(e, i, a)) {
|
|
203
220
|
E("That date is outside the allowed window");
|
|
204
221
|
return;
|
|
205
222
|
}
|
|
206
223
|
v(e), E(null), h(e);
|
|
207
224
|
}
|
|
208
225
|
}, I = (e) => {
|
|
209
|
-
if (
|
|
226
|
+
if (x.trim() === "") return;
|
|
210
227
|
let t = e.relatedTarget;
|
|
211
|
-
t !== null &&
|
|
228
|
+
t !== null && O.current?.contains(t) || j.current || F(x);
|
|
212
229
|
}, L = (e) => {
|
|
213
230
|
if (e === null) return null;
|
|
214
231
|
if (P) {
|
|
215
|
-
let t =
|
|
232
|
+
let t = C(e) ? e : {
|
|
216
233
|
from: e,
|
|
217
234
|
to: e
|
|
218
235
|
};
|
|
219
|
-
return !
|
|
236
|
+
return !T(t.from, i, a) || !T(t.to, i, a) ? null : k(t);
|
|
220
237
|
}
|
|
221
|
-
let t =
|
|
222
|
-
return
|
|
238
|
+
let t = C(e) ? e.from : e;
|
|
239
|
+
return T(t, i, a) ? t : null;
|
|
223
240
|
}, R = (e) => {
|
|
224
241
|
let t = L(e.resolve(r));
|
|
225
242
|
t !== null && h(t);
|
|
@@ -238,7 +255,7 @@ function S({ mode: t, value: n, now: r, min: i, max: a, presets: s, showClear: c
|
|
|
238
255
|
return;
|
|
239
256
|
}
|
|
240
257
|
if (b(e), e.from && e.to) {
|
|
241
|
-
let t =
|
|
258
|
+
let t = k({
|
|
242
259
|
from: e.from,
|
|
243
260
|
to: e.to
|
|
244
261
|
});
|
|
@@ -249,7 +266,7 @@ function S({ mode: t, value: n, now: r, min: i, max: a, presets: s, showClear: c
|
|
|
249
266
|
}
|
|
250
267
|
}, V = y?.from ?? _ ?? (n instanceof Date ? n : null) ?? r, H = [...i ? [{ before: i }] : [], ...a ? [{ after: a }] : []], U = i ?? new Date(r.getFullYear() - 10, 0, 1), W = a ?? new Date(r.getFullYear() + 10, 11, 31);
|
|
251
268
|
return /* @__PURE__ */ p("div", {
|
|
252
|
-
ref:
|
|
269
|
+
ref: O,
|
|
253
270
|
className: "flex",
|
|
254
271
|
onPointerDownCapture: () => {
|
|
255
272
|
j.current = !0, M.current !== null && window.clearTimeout(M.current), M.current = window.setTimeout(() => {
|
|
@@ -259,7 +276,7 @@ function S({ mode: t, value: n, now: r, min: i, max: a, presets: s, showClear: c
|
|
|
259
276
|
children: [s.length > 0 && /* @__PURE__ */ f("div", {
|
|
260
277
|
className: e("flex flex-col gap-0.5 border-r border-border p-2", "max-h-85 w-37 overflow-y-auto"),
|
|
261
278
|
children: s.map((t) => {
|
|
262
|
-
let n = t.resolve(r), i = L(n), a = n !== null && i !== null &&
|
|
279
|
+
let n = t.resolve(r), i = L(n), a = n !== null && i !== null && A(P ? y?.from && y?.to ? k({
|
|
263
280
|
from: y.from,
|
|
264
281
|
to: y.to
|
|
265
282
|
}) : null : _, i, P);
|
|
@@ -279,24 +296,24 @@ function S({ mode: t, value: n, now: r, min: i, max: a, presets: s, showClear: c
|
|
|
279
296
|
children: /* @__PURE__ */ p("div", {
|
|
280
297
|
className: "flex flex-col gap-1",
|
|
281
298
|
children: [/* @__PURE__ */ f("input", {
|
|
282
|
-
ref:
|
|
299
|
+
ref: D,
|
|
283
300
|
type: "text",
|
|
284
|
-
value:
|
|
301
|
+
value: x,
|
|
285
302
|
onChange: (e) => {
|
|
286
|
-
|
|
303
|
+
S(e.target.value), w && E(null);
|
|
287
304
|
},
|
|
288
305
|
onBlur: I,
|
|
289
306
|
onKeyDown: (e) => {
|
|
290
|
-
e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), F(
|
|
307
|
+
e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), F(x));
|
|
291
308
|
},
|
|
292
309
|
placeholder: P ? "Jan – Mar, last 7 days, Q1 2024…" : "Jan 15, today, last Friday…",
|
|
293
|
-
"aria-invalid":
|
|
310
|
+
"aria-invalid": w ? "true" : void 0,
|
|
294
311
|
"aria-label": P ? "Type a date range" : "Type a date",
|
|
295
|
-
className: e("h-8 w-full rounded-field border bg-field px-2 text-[13px] outline-none transition-colors placeholder:text-muted-foreground",
|
|
296
|
-
}),
|
|
312
|
+
className: e("h-8 w-full rounded-field border bg-field px-2 text-[13px] outline-none transition-colors placeholder:text-muted-foreground", w ? "border-red-300 focus-visible:ring-1 focus-visible:ring-red-200 dark:border-red-800 dark:focus-visible:ring-red-800" : "border-input focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring")
|
|
313
|
+
}), w && /* @__PURE__ */ f("p", {
|
|
297
314
|
className: "px-0.5 text-[11px] text-red-600 dark:text-red-400",
|
|
298
315
|
role: "alert",
|
|
299
|
-
children:
|
|
316
|
+
children: w
|
|
300
317
|
})]
|
|
301
318
|
})
|
|
302
319
|
}),
|
|
@@ -338,43 +355,43 @@ function S({ mode: t, value: n, now: r, min: i, max: a, presets: s, showClear: c
|
|
|
338
355
|
})]
|
|
339
356
|
});
|
|
340
357
|
}
|
|
341
|
-
function
|
|
342
|
-
return !(t && e.getTime() <
|
|
358
|
+
function T(e, t, n) {
|
|
359
|
+
return !(t && e.getTime() < E(t).getTime() || n && e.getTime() > D(n).getTime());
|
|
343
360
|
}
|
|
344
|
-
function
|
|
361
|
+
function E(e) {
|
|
345
362
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate());
|
|
346
363
|
}
|
|
347
|
-
function
|
|
364
|
+
function D(e) {
|
|
348
365
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate(), 23, 59, 59, 999);
|
|
349
366
|
}
|
|
350
|
-
function
|
|
367
|
+
function O(e, t) {
|
|
351
368
|
return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate();
|
|
352
369
|
}
|
|
353
|
-
function
|
|
370
|
+
function k(e) {
|
|
354
371
|
return e.from.getTime() <= e.to.getTime() ? e : {
|
|
355
372
|
from: e.to,
|
|
356
373
|
to: e.from
|
|
357
374
|
};
|
|
358
375
|
}
|
|
359
|
-
function
|
|
376
|
+
function A(e, t, n) {
|
|
360
377
|
if (e === null) return !1;
|
|
361
378
|
if (n) {
|
|
362
|
-
let n =
|
|
379
|
+
let n = C(e) ? e : {
|
|
363
380
|
from: e,
|
|
364
381
|
to: e
|
|
365
|
-
}, r =
|
|
382
|
+
}, r = C(t) ? t : {
|
|
366
383
|
from: t,
|
|
367
384
|
to: t
|
|
368
385
|
};
|
|
369
|
-
return
|
|
386
|
+
return O(n.from, r.from) && O(n.to, r.to);
|
|
370
387
|
}
|
|
371
|
-
return
|
|
388
|
+
return O(C(e) ? e.from : e, C(t) ? t.from : t);
|
|
372
389
|
}
|
|
373
|
-
function
|
|
390
|
+
function j(e) {
|
|
374
391
|
return /* @__PURE__ */ f(v, {
|
|
375
392
|
...e,
|
|
376
393
|
mode: "range"
|
|
377
394
|
});
|
|
378
395
|
}
|
|
379
396
|
//#endregion
|
|
380
|
-
export { _ as DEFAULT_RANGE_PRESETS, g as DEFAULT_SINGLE_PRESETS, v as DateField,
|
|
397
|
+
export { _ as DEFAULT_RANGE_PRESETS, g as DEFAULT_SINGLE_PRESETS, v as DateField, w as DateFieldBody, j as DateRangeField, S as shouldKeepDateFieldOpen };
|
|
@@ -4,27 +4,30 @@ import t from "../../../vendor/lucide-react@0.546.0_react@19.2.6/dist/esm/icons/
|
|
|
4
4
|
import { DialogLayer as n } from "./dialog-layer.mjs";
|
|
5
5
|
import { Close as r, Content as i, Description as a, Overlay as o, Portal as s, Root as c, Title as l, Trigger as u } from "../../../vendor/@radix-ui_react-dialog@1.1.15_@types_react-dom@19.2.3_@types_react@19.2.14__@types_reac_340425d8afbecb0b8c61fd2281bc18a1/dist/index.mjs";
|
|
6
6
|
import { useArtifactViewportOverlayBridge as d } from "./artifact-overlay-bridge.mjs";
|
|
7
|
-
import {
|
|
8
|
-
import { MODAL_SCRIM_CLASS as
|
|
9
|
-
import * as
|
|
10
|
-
import { jsx as
|
|
7
|
+
import { OverlayOpenContext as f, useOverlayPortalTarget as p } from "./use-overlay-portal-target.mjs";
|
|
8
|
+
import { MODAL_SCRIM_CLASS as m } from "./overlay-scrim.mjs";
|
|
9
|
+
import * as h from "react";
|
|
10
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
11
11
|
//#region ../../../atlas/src/shared/components/ui/dialog.tsx
|
|
12
|
-
function
|
|
13
|
-
let [i, a] =
|
|
14
|
-
return d(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
function v({ open: e, defaultOpen: t, onOpenChange: n, ...r }) {
|
|
13
|
+
let [i, a] = h.useState(t ?? !1), o = e ?? i;
|
|
14
|
+
return d(o), /* @__PURE__ */ g(f.Provider, {
|
|
15
|
+
value: o,
|
|
16
|
+
children: /* @__PURE__ */ g(c, {
|
|
17
|
+
open: e,
|
|
18
|
+
defaultOpen: t,
|
|
19
|
+
onOpenChange: (t) => {
|
|
20
|
+
e === void 0 && a(t), n?.(t);
|
|
21
|
+
},
|
|
22
|
+
...r
|
|
23
|
+
})
|
|
21
24
|
});
|
|
22
25
|
}
|
|
23
|
-
|
|
24
|
-
var
|
|
25
|
-
function
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
container:
|
|
26
|
+
v.displayName = c.displayName;
|
|
27
|
+
var y = u;
|
|
28
|
+
function b({ container: e, ...t }) {
|
|
29
|
+
return /* @__PURE__ */ g(s, {
|
|
30
|
+
container: p({
|
|
28
31
|
container: e,
|
|
29
32
|
escapeMfeContainment: !0,
|
|
30
33
|
fallbackId: "shared-dialog-portal-root"
|
|
@@ -32,67 +35,67 @@ function y({ container: e, ...t }) {
|
|
|
32
35
|
...t
|
|
33
36
|
});
|
|
34
37
|
}
|
|
35
|
-
var
|
|
38
|
+
var x = r, S = h.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ g(o, {
|
|
36
39
|
ref: r,
|
|
37
40
|
"data-overlay-scope": "viewport",
|
|
38
|
-
className: e("fixed inset-0 z-50",
|
|
41
|
+
className: e("fixed inset-0 z-50", m, "data-[state=open]:animate-in data-[state=closed]:animate-out", "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", t),
|
|
39
42
|
...n
|
|
40
43
|
}));
|
|
41
|
-
|
|
42
|
-
var
|
|
44
|
+
S.displayName = o.displayName;
|
|
45
|
+
var C = h.forwardRef(({ className: a, children: o, showCloseButton: s = !0, overlayClassName: c, ...l }, u) => /* @__PURE__ */ _(b, { children: [/* @__PURE__ */ g(S, { className: c }), /* @__PURE__ */ _(i, {
|
|
43
46
|
"data-density": "default",
|
|
44
47
|
"data-overlay-scope": "viewport",
|
|
45
48
|
ref: u,
|
|
46
49
|
className: e("fixed left-[50%] top-[50%] z-50 w-full max-w-lg translate-x-[-50%] translate-y-[-50%]", "max-h-[calc(100vh-4rem)]", "flex flex-col overflow-hidden", "rounded-surface border border-border bg-card shadow-modal", "[&>*:not([data-slot^=dialog-])]:flex-1", "[&>*:not([data-slot^=dialog-])]:min-h-0", "[&>*:not([data-slot^=dialog-])]:overflow-y-auto", "[&>*:not([data-slot^=dialog-])]:px-6", "[&>*:not([data-slot^=dialog-])]:py-4", "duration-200", "data-[state=open]:animate-in data-[state=closed]:animate-out", "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95", a),
|
|
47
50
|
...l,
|
|
48
|
-
children: [/* @__PURE__ */
|
|
51
|
+
children: [/* @__PURE__ */ g(n, {
|
|
49
52
|
className: a,
|
|
50
53
|
children: o
|
|
51
|
-
}), s && /* @__PURE__ */
|
|
54
|
+
}), s && /* @__PURE__ */ _(r, {
|
|
52
55
|
"data-slot": "dialog-close",
|
|
53
56
|
className: e("absolute right-4 top-3 z-10 flex size-6 items-center justify-center rounded-control", "text-muted-foreground opacity-80 transition-opacity hover:opacity-100 hover:bg-accent", "focus:outline-none focus:ring-1 focus:ring-ring", "disabled:pointer-events-none", "data-[state=open]:bg-accent data-[state=open]:text-accent-foreground"),
|
|
54
|
-
children: [/* @__PURE__ */
|
|
57
|
+
children: [/* @__PURE__ */ g(t, { className: "size-icon" }), /* @__PURE__ */ g("span", {
|
|
55
58
|
className: "sr-only",
|
|
56
59
|
children: "Close"
|
|
57
60
|
})]
|
|
58
61
|
})]
|
|
59
62
|
})] }));
|
|
60
|
-
|
|
61
|
-
function
|
|
62
|
-
return /* @__PURE__ */
|
|
63
|
+
C.displayName = i.displayName;
|
|
64
|
+
function w({ className: t, ...n }) {
|
|
65
|
+
return /* @__PURE__ */ g("div", {
|
|
63
66
|
"data-slot": "dialog-header",
|
|
64
67
|
className: e("shrink-0", "flex flex-col gap-1.5 px-6 py-4 border-b border-border", "pr-12", "text-left", t),
|
|
65
68
|
...n
|
|
66
69
|
});
|
|
67
70
|
}
|
|
68
|
-
|
|
69
|
-
function
|
|
70
|
-
return /* @__PURE__ */
|
|
71
|
+
w.displayName = "DialogHeader";
|
|
72
|
+
function T({ className: t, ...n }) {
|
|
73
|
+
return /* @__PURE__ */ g("div", {
|
|
71
74
|
"data-slot": "dialog-body",
|
|
72
75
|
className: e("flex-1 min-h-0 overflow-y-auto", "px-6 py-4", t),
|
|
73
76
|
...n
|
|
74
77
|
});
|
|
75
78
|
}
|
|
76
|
-
|
|
77
|
-
function
|
|
78
|
-
return /* @__PURE__ */
|
|
79
|
+
T.displayName = "DialogBody";
|
|
80
|
+
function E({ className: t, ...n }) {
|
|
81
|
+
return /* @__PURE__ */ g("div", {
|
|
79
82
|
"data-slot": "dialog-footer",
|
|
80
83
|
className: e("shrink-0", "flex flex-col-reverse gap-2 px-6 py-4 border-t border-border", "sm:flex-row sm:justify-end", t),
|
|
81
84
|
...n
|
|
82
85
|
});
|
|
83
86
|
}
|
|
84
|
-
|
|
85
|
-
var
|
|
87
|
+
E.displayName = "DialogFooter";
|
|
88
|
+
var D = h.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ g(l, {
|
|
86
89
|
ref: r,
|
|
87
90
|
className: e("text-base font-semibold leading-none tracking-tight text-foreground", t),
|
|
88
91
|
...n
|
|
89
92
|
}));
|
|
90
|
-
|
|
91
|
-
var
|
|
93
|
+
D.displayName = l.displayName;
|
|
94
|
+
var O = h.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ g(a, {
|
|
92
95
|
ref: r,
|
|
93
96
|
className: e("text-body-sm text-muted-foreground", t),
|
|
94
97
|
...n
|
|
95
98
|
}));
|
|
96
|
-
|
|
99
|
+
O.displayName = a.displayName;
|
|
97
100
|
//#endregion
|
|
98
|
-
export {
|
|
101
|
+
export { v as Dialog, T as DialogBody, x as DialogClose, C as DialogContent, O as DialogDescription, E as DialogFooter, w as DialogHeader, S as DialogOverlay, b as DialogPortal, D as DialogTitle, y as DialogTrigger };
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { DateField as e } from "./date-field.mjs";
|
|
2
|
-
import { fromIsoDate as t,
|
|
3
|
-
import { jsx as
|
|
2
|
+
import { fromIsoDate as t, toIsoDate as n, toIsoDateOrNull as r } from "../../lib/iso-date.mjs";
|
|
3
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
4
4
|
//#region ../../../atlas/src/shared/components/ui/iso-date-field.tsx
|
|
5
|
-
function
|
|
6
|
-
return /* @__PURE__ */
|
|
5
|
+
function a({ value: a, onChange: o, min: s, max: c, formatTrigger: l, ...u }) {
|
|
6
|
+
return /* @__PURE__ */ i(e, {
|
|
7
7
|
mode: "single",
|
|
8
|
-
value: t(
|
|
9
|
-
onChange: (e) =>
|
|
10
|
-
min: t(
|
|
11
|
-
max: t(
|
|
12
|
-
|
|
8
|
+
value: t(a),
|
|
9
|
+
onChange: (e) => o(r(e)),
|
|
10
|
+
min: t(s) ?? void 0,
|
|
11
|
+
max: t(c) ?? void 0,
|
|
12
|
+
formatTrigger: l ? (e) => l(n(e)) : void 0,
|
|
13
|
+
...u
|
|
13
14
|
});
|
|
14
15
|
}
|
|
15
16
|
//#endregion
|
|
16
|
-
export {
|
|
17
|
+
export { a as IsoDateField };
|