@sequenceholdings/atlas-ui 3.7.1 → 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.
@@ -3,28 +3,31 @@ import { cn as e } from "../../lib/utils.mjs";
3
3
  import { buttonVariants as t } from "./button.mjs";
4
4
  import { DialogLayer as n } from "./dialog-layer.mjs";
5
5
  import { useArtifactViewportOverlayBridge as r } from "./artifact-overlay-bridge.mjs";
6
- import { useOverlayPortalTarget as i } from "./use-overlay-portal-target.mjs";
7
- import { MODAL_SCRIM_CLASS as a } from "./overlay-scrim.mjs";
8
- import { Action as o, Cancel as s, Content as c, Description as l, Overlay as u, Portal as d, Root as f, Title as p, Trigger as m } from "../../../vendor/@radix-ui_react-alert-dialog@1.1.15_@types_react-dom@19.2.3_@types_react@19.2.14__@type_91d5036573779c1b9f41b61cd4660f3d/dist/index.mjs";
9
- import * as h from "react";
10
- import { jsx as g, jsxs as _ } from "react/jsx-runtime";
6
+ import { OverlayOpenContext as i, useOverlayPortalTarget as a } from "./use-overlay-portal-target.mjs";
7
+ import { MODAL_SCRIM_CLASS as o } from "./overlay-scrim.mjs";
8
+ import { Action as s, Cancel as c, Content as l, Description as u, Overlay as d, Portal as f, Root as p, Title as m, Trigger as h } from "../../../vendor/@radix-ui_react-alert-dialog@1.1.15_@types_react-dom@19.2.3_@types_react@19.2.14__@type_91d5036573779c1b9f41b61cd4660f3d/dist/index.mjs";
9
+ import * as g from "react";
10
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
11
11
  //#region ../../../atlas/src/shared/components/ui/alert-dialog.tsx
12
- function v({ open: e, defaultOpen: t, onOpenChange: n, ...i }) {
13
- let [a, o] = h.useState(t ?? !1);
14
- return r(e ?? a), /* @__PURE__ */ g(f, {
15
- open: e,
16
- defaultOpen: t,
17
- onOpenChange: (t) => {
18
- e === void 0 && o(t), n?.(t);
19
- },
20
- ...i
12
+ function y({ open: e, defaultOpen: t, onOpenChange: n, ...a }) {
13
+ let [o, s] = g.useState(t ?? !1), c = e ?? o;
14
+ return r(c), /* @__PURE__ */ _(i.Provider, {
15
+ value: c,
16
+ children: /* @__PURE__ */ _(p, {
17
+ open: e,
18
+ defaultOpen: t,
19
+ onOpenChange: (t) => {
20
+ e === void 0 && s(t), n?.(t);
21
+ },
22
+ ...a
23
+ })
21
24
  });
22
25
  }
23
- v.displayName = f.displayName;
24
- var y = m;
25
- function b({ container: e, ...t }) {
26
- return /* @__PURE__ */ g(d, {
27
- container: i({
26
+ y.displayName = p.displayName;
27
+ var b = h;
28
+ function x({ container: e, ...t }) {
29
+ return /* @__PURE__ */ _(f, {
30
+ container: a({
28
31
  container: e,
29
32
  escapeMfeContainment: !0,
30
33
  fallbackId: "shared-alert-dialog-portal-root"
@@ -32,58 +35,58 @@ function b({ container: e, ...t }) {
32
35
  ...t
33
36
  });
34
37
  }
35
- var x = h.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ g(u, {
38
+ var S = g.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ _(d, {
36
39
  ref: r,
37
40
  "data-overlay-scope": "viewport",
38
- className: e("fixed inset-0 z-50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", a, t),
41
+ className: e("fixed inset-0 z-50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", o, t),
39
42
  ...n
40
43
  }));
41
- x.displayName = u.displayName;
42
- var S = h.forwardRef(({ className: t, overlayClassName: r, children: i, ...a }, o) => /* @__PURE__ */ _(b, { children: [/* @__PURE__ */ g(x, { className: r }), /* @__PURE__ */ g(c, {
44
+ S.displayName = d.displayName;
45
+ var C = g.forwardRef(({ className: t, overlayClassName: r, children: i, ...a }, o) => /* @__PURE__ */ v(x, { children: [/* @__PURE__ */ _(S, { className: r }), /* @__PURE__ */ _(l, {
43
46
  "data-density": "default",
44
47
  "data-overlay-scope": "viewport",
45
48
  ref: o,
46
49
  className: e("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 overflow-hidden border border-border bg-card p-6 shadow-modal 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 sm:rounded-surface", t),
47
50
  ...a,
48
- children: /* @__PURE__ */ g(n, {
51
+ children: /* @__PURE__ */ _(n, {
49
52
  className: t,
50
53
  children: i
51
54
  })
52
55
  })] }));
53
- S.displayName = c.displayName;
54
- var C = ({ className: t, ...n }) => /* @__PURE__ */ g("div", {
56
+ C.displayName = l.displayName;
57
+ var w = ({ className: t, ...n }) => /* @__PURE__ */ _("div", {
55
58
  className: e("flex flex-col gap-1.5 text-left", t),
56
59
  ...n
57
60
  });
58
- C.displayName = "AlertDialogHeader";
59
- var w = ({ className: t, ...n }) => /* @__PURE__ */ g("div", {
61
+ w.displayName = "AlertDialogHeader";
62
+ var T = ({ className: t, ...n }) => /* @__PURE__ */ _("div", {
60
63
  className: e("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", t),
61
64
  ...n
62
65
  });
63
- w.displayName = "AlertDialogFooter";
64
- var T = h.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ g(p, {
66
+ T.displayName = "AlertDialogFooter";
67
+ var E = g.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ _(m, {
65
68
  ref: r,
66
69
  className: e("text-base font-semibold leading-none tracking-tight text-foreground", t),
67
70
  ...n
68
71
  }));
69
- T.displayName = p.displayName;
70
- var E = h.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ g(l, {
72
+ E.displayName = m.displayName;
73
+ var D = g.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ _(u, {
71
74
  ref: r,
72
75
  className: e("text-body-sm text-muted-foreground", t),
73
76
  ...n
74
77
  }));
75
- E.displayName = l.displayName;
76
- var D = h.forwardRef(({ className: n, ...r }, i) => /* @__PURE__ */ g(o, {
78
+ D.displayName = u.displayName;
79
+ var O = g.forwardRef(({ className: n, ...r }, i) => /* @__PURE__ */ _(s, {
77
80
  ref: i,
78
81
  className: e(t(), n),
79
82
  ...r
80
83
  }));
81
- D.displayName = o.displayName;
82
- var O = h.forwardRef(({ className: n, ...r }, i) => /* @__PURE__ */ g(s, {
84
+ O.displayName = s.displayName;
85
+ var k = g.forwardRef(({ className: n, ...r }, i) => /* @__PURE__ */ _(c, {
83
86
  ref: i,
84
87
  className: e(t({ variant: "outline" }), n),
85
88
  ...r
86
89
  }));
87
- O.displayName = s.displayName;
90
+ k.displayName = c.displayName;
88
91
  //#endregion
89
- export { v as AlertDialog, D as AlertDialogAction, O as AlertDialogCancel, S as AlertDialogContent, E as AlertDialogDescription, w as AlertDialogFooter, C as AlertDialogHeader, x as AlertDialogOverlay, b as AlertDialogPortal, T as AlertDialogTitle, y as AlertDialogTrigger };
92
+ export { y as AlertDialog, O as AlertDialogAction, k as AlertDialogCancel, C as AlertDialogContent, D as AlertDialogDescription, T as AlertDialogFooter, w as AlertDialogHeader, S as AlertDialogOverlay, x as AlertDialogPortal, E as AlertDialogTitle, b as AlertDialogTrigger };
@@ -4,17 +4,17 @@ import { Root as n } from "../../../vendor/@radix-ui_react-slot@1.2.4_@types_rea
4
4
  import * as r from "react";
5
5
  import { jsx as i } from "react/jsx-runtime";
6
6
  //#region ../../../atlas/src/shared/components/ui/button.tsx
7
- var a = t("inline-flex cursor-pointer items-center justify-center gap-inline whitespace-nowrap rounded-control text-control transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-']):not([class^='icon-']):not([class*='_icon-'])]:size-icon [&_svg]:shrink-0", {
7
+ var a = "[&_svg:not([class*='size-']):not([class^='icon-']):not([class*='_icon-'])]:size-icon", o = t("inline-flex cursor-pointer items-center justify-center gap-inline whitespace-nowrap rounded-control text-control transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", {
8
8
  variants: {
9
9
  variant: {
10
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
11
- destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
12
- outline: "border border-input bg-card text-foreground hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:hover:bg-input/50",
13
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
14
- ghost: "hover:bg-accent hover:text-accent-foreground",
10
+ default: `bg-primary text-primary-foreground hover:bg-primary/90 ${a}`,
11
+ destructive: `bg-destructive text-destructive-foreground hover:bg-destructive/90 ${a}`,
12
+ outline: `border border-input bg-card text-foreground hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:hover:bg-input/50 ${a}`,
13
+ secondary: `bg-secondary text-secondary-foreground hover:bg-secondary/80 ${a}`,
14
+ ghost: `hover:bg-accent hover:text-accent-foreground ${a}`,
15
15
  row: "hover:bg-accent",
16
- link: "text-primary underline-offset-4 hover:underline",
17
- submit: "bg-success text-success-foreground hover:bg-success/90"
16
+ link: `text-primary underline-offset-4 hover:underline ${a}`,
17
+ submit: `bg-success text-success-foreground hover:bg-success/90 ${a}`
18
18
  },
19
19
  size: {
20
20
  default: "h-9 px-4 py-2",
@@ -37,15 +37,15 @@ var a = t("inline-flex cursor-pointer items-center justify-center gap-inline whi
37
37
  variant: "default",
38
38
  size: "default"
39
39
  }
40
- }), o = r.forwardRef(({ className: t, variant: r, size: o, asChild: s = !1, ...c }, l) => /* @__PURE__ */ i(s ? n : "button", {
41
- className: e(a({
40
+ }), s = r.forwardRef(({ className: t, variant: r, size: a, asChild: s = !1, ...c }, l) => /* @__PURE__ */ i(s ? n : "button", {
41
+ className: e(o({
42
42
  variant: r,
43
- size: o,
43
+ size: a,
44
44
  className: t
45
45
  })),
46
46
  ref: l,
47
47
  ...c
48
48
  }));
49
- o.displayName = "Button";
49
+ s.displayName = "Button";
50
50
  //#endregion
51
- export { o as Button, a as buttonVariants };
51
+ export { s as Button, o as buttonVariants };
@@ -160,7 +160,7 @@ var b = t;
160
160
  function x({ className: t, hideIcon: n = !1, payload: r, verticalAlign: i = "bottom", nameKey: a }) {
161
161
  let { config: c } = u();
162
162
  return r?.length ? /* @__PURE__ */ o("div", {
163
- className: e("flex items-center justify-center gap-4", i === "top" ? "pb-3" : "pt-3", t),
163
+ className: e("flex items-center justify-center gap-roomy", i === "top" ? "pb-default" : "pt-default", t),
164
164
  children: r.map((e) => {
165
165
  let t = `${a ?? e.dataKey ?? "value"}`, r = S(c, e, t);
166
166
  return /* @__PURE__ */ s("div", {
@@ -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: C, referenceDate: w, align: T = "start", presets: E, containerClassName: D, className: O, popoverClassName: k, ariaLabel: A, "aria-describedby": j, "aria-invalid": M, clearable: N = !0, yearBias: P = "past" } = o, [F, I] = d.useState(!1), L = d.useMemo(() => w ?? /* @__PURE__ */ new Date(), [w, F]), R = E ?? (l === "range" ? _ : g), z = o.value, B = d.useMemo(() => z === null ? null : l === "range" ? c(z) : s(z), [l, z]);
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: F,
75
- onOpenChange: (e) => !h && I(e),
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", D),
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": A ?? "Select date",
86
- "aria-describedby": j,
87
- "aria-invalid": M,
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": F,
90
- className: e("inline-flex h-9 w-full items-center gap-2 rounded-field border bg-field px-3 text-sm transition-colors", "border-input text-foreground hover:border-input hover:bg-accent", "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", "disabled:cursor-not-allowed disabled:opacity-50", !B && "text-muted-foreground", N && B && !h && "pr-9", O),
91
- children: [/* @__PURE__ */ f(t, {
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: B ?? m ?? y(l)
106
+ children: W ?? m ?? x(l)
97
107
  })]
98
108
  })
99
- }), N && B && !h && /* @__PURE__ */ f("button", {
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: T,
110
- className: e("w-auto p-0 border-input", k),
111
- onInteractOutside: b,
112
- children: /* @__PURE__ */ f(S, {
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: L,
116
- min: C,
125
+ now: B,
126
+ min: y,
117
127
  max: v,
118
- presets: R,
119
- yearBias: P,
128
+ presets: V,
129
+ yearBias: F,
120
130
  onApply: (e) => {
121
131
  if (e === null) {
122
- o.onChange(null), I(!1);
132
+ o.onChange(null), z(!1);
123
133
  return;
124
134
  }
125
135
  if (l === "range") {
126
- let t = x(e) ? e : {
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 = x(e) ? e.from : e;
142
+ let t = C(e) ? e.from : e;
133
143
  o.onChange(t);
134
144
  }
135
- I(!1);
145
+ z(!1);
136
146
  },
137
- onClose: () => I(!1)
147
+ onClose: () => z(!1)
138
148
  })
139
149
  })]
140
150
  });
141
151
  }
142
- function y(e) {
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 b(e) {
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 x(e) {
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 S({ mode: t, value: n, now: r, min: i, max: a, presets: s, showClear: c = !0, yearBias: m = "past", onApply: h, onClose: g }) {
153
- let [_, v] = d.useState(n instanceof Date ? n : null), [y, b] = d.useState(x(n) ? {
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), [S, w] = d.useState(""), [T, E] = d.useState(null), k = d.useRef(null), A = d.useRef(null), j = d.useRef(!1), M = d.useRef(null), N = t === "range" ? x(n) ? `${n.from.getTime()}:${n.to.getTime()}` : "none" : n instanceof Date ? String(n.getTime()) : "none";
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(x(n) ? {
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)), w(""), E(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(() => k.current?.focus());
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 (!C(e.from, i, a) || !C(e.to, i, a)) {
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 (!C(e, i, a)) {
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 (S.trim() === "") return;
226
+ if (x.trim() === "") return;
210
227
  let t = e.relatedTarget;
211
- t !== null && A.current?.contains(t) || j.current || F(S);
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 = x(e) ? e : {
232
+ let t = C(e) ? e : {
216
233
  from: e,
217
234
  to: e
218
235
  };
219
- return !C(t.from, i, a) || !C(t.to, i, a) ? null : D(t);
236
+ return !T(t.from, i, a) || !T(t.to, i, a) ? null : k(t);
220
237
  }
221
- let t = x(e) ? e.from : e;
222
- return C(t, i, a) ? t : null;
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 = D({
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: A,
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 && O(P ? y?.from && y?.to ? D({
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: k,
299
+ ref: D,
283
300
  type: "text",
284
- value: S,
301
+ value: x,
285
302
  onChange: (e) => {
286
- w(e.target.value), T && E(null);
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(S));
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": T ? "true" : void 0,
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", T ? "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")
296
- }), T && /* @__PURE__ */ f("p", {
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: T
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 C(e, t, n) {
342
- return !(t && e.getTime() < w(t).getTime() || n && e.getTime() > T(n).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 w(e) {
361
+ function E(e) {
345
362
  return new Date(e.getFullYear(), e.getMonth(), e.getDate());
346
363
  }
347
- function T(e) {
364
+ function D(e) {
348
365
  return new Date(e.getFullYear(), e.getMonth(), e.getDate(), 23, 59, 59, 999);
349
366
  }
350
- function E(e, t) {
367
+ function O(e, t) {
351
368
  return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate();
352
369
  }
353
- function D(e) {
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 O(e, t, n) {
376
+ function A(e, t, n) {
360
377
  if (e === null) return !1;
361
378
  if (n) {
362
- let n = x(e) ? e : {
379
+ let n = C(e) ? e : {
363
380
  from: e,
364
381
  to: e
365
- }, r = x(t) ? t : {
382
+ }, r = C(t) ? t : {
366
383
  from: t,
367
384
  to: t
368
385
  };
369
- return E(n.from, r.from) && E(n.to, r.to);
386
+ return O(n.from, r.from) && O(n.to, r.to);
370
387
  }
371
- return E(x(e) ? e.from : e, x(t) ? t.from : t);
388
+ return O(C(e) ? e.from : e, C(t) ? t.from : t);
372
389
  }
373
- function k(e) {
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, S as DateFieldBody, k as DateRangeField, b as shouldKeepDateFieldOpen };
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 { useOverlayPortalTarget as f } from "./use-overlay-portal-target.mjs";
8
- import { MODAL_SCRIM_CLASS as p } from "./overlay-scrim.mjs";
9
- import * as m from "react";
10
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
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 _({ open: e, defaultOpen: t, onOpenChange: n, ...r }) {
13
- let [i, a] = m.useState(t ?? !1);
14
- return d(e ?? i), /* @__PURE__ */ h(c, {
15
- open: e,
16
- defaultOpen: t,
17
- onOpenChange: (t) => {
18
- e === void 0 && a(t), n?.(t);
19
- },
20
- ...r
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
- _.displayName = c.displayName;
24
- var v = u;
25
- function y({ container: e, ...t }) {
26
- return /* @__PURE__ */ h(s, {
27
- container: f({
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 b = r, x = m.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ h(o, {
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", p, "data-[state=open]:animate-in data-[state=closed]:animate-out", "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", t),
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
- x.displayName = o.displayName;
42
- var S = m.forwardRef(({ className: a, children: o, showCloseButton: s = !0, overlayClassName: c, ...l }, u) => /* @__PURE__ */ g(y, { children: [/* @__PURE__ */ h(x, { className: c }), /* @__PURE__ */ g(i, {
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__ */ h(n, {
51
+ children: [/* @__PURE__ */ g(n, {
49
52
  className: a,
50
53
  children: o
51
- }), s && /* @__PURE__ */ g(r, {
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__ */ h(t, { className: "size-icon" }), /* @__PURE__ */ h("span", {
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
- S.displayName = i.displayName;
61
- function C({ className: t, ...n }) {
62
- return /* @__PURE__ */ h("div", {
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
- C.displayName = "DialogHeader";
69
- function w({ className: t, ...n }) {
70
- return /* @__PURE__ */ h("div", {
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
- w.displayName = "DialogBody";
77
- function T({ className: t, ...n }) {
78
- return /* @__PURE__ */ h("div", {
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
- T.displayName = "DialogFooter";
85
- var E = m.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ h(l, {
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
- E.displayName = l.displayName;
91
- var D = m.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ h(a, {
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
- D.displayName = a.displayName;
99
+ O.displayName = a.displayName;
97
100
  //#endregion
98
- export { _ as Dialog, w as DialogBody, b as DialogClose, S as DialogContent, D as DialogDescription, T as DialogFooter, C as DialogHeader, x as DialogOverlay, y as DialogPortal, E as DialogTitle, v as DialogTrigger };
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 };