asma-ui-core 3.58.3 → 3.58.5

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.
@@ -0,0 +1,15 @@
1
+ var e = "_root_t64s4_1", _ = "_shell_t64s4_5", a = "_shellCompact_t64s4_9", t = "_shellExpanded_t64s4_13", s = "_content_t64s4_17", r = "_compactItems_t64s4_21", o = "_expandedItems_t64s4_25", l = "_measureRow_t64s4_29", m = "_measureLayer_t64s4_33", v = "_chevron_t64s4_37", d = {
2
+ root: e,
3
+ shell: _,
4
+ shellCompact: a,
5
+ shellExpanded: t,
6
+ content: s,
7
+ compactItems: r,
8
+ expandedItems: o,
9
+ measureRow: l,
10
+ measureLayer: m,
11
+ chevron: v
12
+ };
13
+ export {
14
+ d as default
15
+ };
@@ -1,146 +1,147 @@
1
- import { cn as y } from "../../../helpers/cn.js";
2
- import { ChevronDownIcon as B } from "../../icons/chevron-down-icon/ChevronDownIcon.js";
3
- import { ChevronUpIcon as E } from "../../icons/chevron-up-icon/ChevronUpIcon.js";
4
- import { useCallback as W, useEffect as k, useLayoutEffect as F, useMemo as R, useRef as g, useState as C, useSyncExternalStore as L } from "react";
5
- import { Fragment as O, jsx as e, jsxs as x } from "react/jsx-runtime";
6
- var j = typeof window < "u" ? F : k;
1
+ import { cn as I } from "../../../helpers/cn.js";
2
+ import { ChevronDownIcon as z } from "../../icons/chevron-down-icon/ChevronDownIcon.js";
3
+ import { ChevronUpIcon as B } from "../../icons/chevron-up-icon/ChevronUpIcon.js";
4
+ import h from "./Pathfinder.module.js";
5
+ import { useCallback as R, useEffect as y, useLayoutEffect as F, useMemo as C, useRef as w, useState as x, useSyncExternalStore as O } from "react";
6
+ import { Fragment as j, jsx as e, jsxs as N } from "react/jsx-runtime";
7
+ var P = typeof window < "u" ? F : y;
7
8
  function D() {
8
- const [i, n] = C(null), o = W((t) => {
9
+ const [i, n] = x(null), d = R((t) => {
9
10
  n(t);
10
- }, []), r = W(() => i ? Math.floor(i.getBoundingClientRect().width) : 0, [i]);
11
+ }, []), s = R(() => i ? Math.floor(i.getBoundingClientRect().width) : 0, [i]);
11
12
  return {
12
- ref: o,
13
- width: L(W((t) => {
13
+ ref: d,
14
+ width: O(R((t) => {
14
15
  if (!i || typeof ResizeObserver > "u") return () => {
15
16
  console.log("Node is missing or ResizeObserver is undefined");
16
17
  };
17
- let c = 0;
18
- const d = new ResizeObserver(() => {
19
- cancelAnimationFrame(c), c = requestAnimationFrame(t);
18
+ let a = 0;
19
+ const o = new ResizeObserver(() => {
20
+ cancelAnimationFrame(a), a = requestAnimationFrame(t);
20
21
  });
21
- return d.observe(i), () => {
22
- cancelAnimationFrame(c), d.disconnect();
22
+ return o.observe(i), () => {
23
+ cancelAnimationFrame(a), o.disconnect();
23
24
  };
24
- }, [i]), r, () => 0)
25
+ }, [i]), s, () => 0)
25
26
  };
26
27
  }
27
- function I(i) {
28
- return [...i].sort((n, o) => {
29
- const r = n.order ?? 0, t = o.order ?? 0;
30
- return r !== t ? r - t : n.id.localeCompare(o.id);
28
+ function M(i) {
29
+ return [...i].sort((n, d) => {
30
+ const s = n.order ?? 0, t = d.order ?? 0;
31
+ return s !== t ? s - t : n.id.localeCompare(d.id);
31
32
  });
32
33
  }
33
- function P(i) {
34
- const { items: n, leadSlot: o, actionSlot: r } = i, t = g({}), c = g(null), d = g(null), [l, p] = C({
34
+ function _(i) {
35
+ const { items: n, leadSlot: d, actionSlot: s } = i, t = w({}), a = w(null), o = w(null), [l, p] = x({
35
36
  itemWidths: {},
36
37
  leadWidth: 0,
37
38
  actionWidth: 0
38
- }), u = g(l);
39
- k(() => {
40
- u.current = l;
39
+ }), f = w(l);
40
+ y(() => {
41
+ f.current = l;
41
42
  }, [l]);
42
- const f = W((a) => (h) => {
43
- t.current[a] = h;
43
+ const v = R((c) => (m) => {
44
+ t.current[c] = m;
44
45
  }, []);
45
- return j(() => {
46
- const a = {};
47
- for (const m of n) {
48
- const b = t.current[m.id], s = Math.ceil(b?.getBoundingClientRect().width ?? m.estimatedWidth ?? 0);
49
- a[m.id] = s;
46
+ return P(() => {
47
+ const c = {};
48
+ for (const u of n) {
49
+ const k = t.current[u.id], r = Math.ceil(k?.getBoundingClientRect().width ?? u.estimatedWidth ?? 0);
50
+ c[u.id] = r;
50
51
  }
51
- const h = o ? Math.ceil(c.current?.getBoundingClientRect().width ?? 0) : 0, w = r ? Math.ceil(d.current?.getBoundingClientRect().width ?? 0) : 0, v = u.current;
52
- (!(Object.keys(v.itemWidths).length === Object.keys(a).length && n.every((m) => v.itemWidths[m.id] === a[m.id])) || v.leadWidth !== h || v.actionWidth !== w) && p({
53
- itemWidths: a,
54
- leadWidth: h,
55
- actionWidth: w
52
+ const m = d ? Math.ceil(a.current?.getBoundingClientRect().width ?? 0) : 0, g = s ? Math.ceil(o.current?.getBoundingClientRect().width ?? 0) : 0, W = f.current;
53
+ (!(Object.keys(W.itemWidths).length === Object.keys(c).length && n.every((u) => W.itemWidths[u.id] === c[u.id])) || W.leadWidth !== m || W.actionWidth !== g) && p({
54
+ itemWidths: c,
55
+ leadWidth: m,
56
+ actionWidth: g
56
57
  });
57
58
  }, [
58
59
  n,
59
- o,
60
- r
60
+ d,
61
+ s
61
62
  ]), {
62
63
  measurements: l,
63
- registerItemRef: f,
64
- leadRef: c,
65
- actionRef: d
64
+ registerItemRef: v,
65
+ leadRef: a,
66
+ actionRef: o
66
67
  };
67
68
  }
68
69
  function q(i) {
69
- const { items: n, availableWidth: o, gapPx: r, itemWidths: t } = i, c = [];
70
- let d = 0;
71
- for (const l of I(n)) {
72
- const p = Math.max(0, t[l.id] ?? l.estimatedWidth ?? 0), u = c.length === 0 ? p : d + r + p;
73
- if (u > o) break;
74
- c.push(l), d = u;
70
+ const { items: n, availableWidth: d, gapPx: s, itemWidths: t } = i, a = [];
71
+ let o = 0;
72
+ for (const l of M(n)) {
73
+ const p = Math.max(0, t[l.id] ?? l.estimatedWidth ?? 0), f = a.length === 0 ? p : o + s + p;
74
+ if (f > d) break;
75
+ a.push(l), o = f;
75
76
  }
76
- return c;
77
+ return a;
77
78
  }
78
- function N({ item: i, compact: n }) {
79
- return /* @__PURE__ */ e(O, { children: i.render({ compact: n }) });
79
+ function b({ item: i, compact: n }) {
80
+ return /* @__PURE__ */ e(j, { children: i.render({ compact: n }) });
80
81
  }
81
- function J({ items: i, expanded: n, onToggleExpanded: o, leadSlot: r, actionSlot: t, className: c, leadReservePx: d = 140, actionReservePx: l = 44 }) {
82
- const { ref: p, width: u } = D(), f = !n, a = R(() => I(i), [i]), { measurements: h, registerItemRef: w, leadRef: v, actionRef: m } = P({
83
- items: a,
84
- leadSlot: r,
82
+ function Q({ items: i, expanded: n, onToggleExpanded: d, leadSlot: s, actionSlot: t, className: a, leadReservePx: o = 140, actionReservePx: l = 44 }) {
83
+ const { ref: p, width: f } = D(), v = !n, c = C(() => M(i), [i]), { measurements: m, registerItemRef: g, leadRef: W, actionRef: u } = _({
84
+ items: c,
85
+ leadSlot: s,
85
86
  actionSlot: t
86
- }), b = R(() => {
87
- if (n) return a;
88
- const s = 24, M = 40, z = r ? Math.max(d, h.leadWidth + 12) : 0, A = t ? Math.max(l, h.actionWidth) : 0;
87
+ }), k = C(() => {
88
+ if (n) return c;
89
+ const r = 24, A = 40, E = s ? Math.max(o, m.leadWidth + 12) : 0, L = t ? Math.max(l, m.actionWidth) : 0;
89
90
  return q({
90
- items: a,
91
- availableWidth: Math.max(0, u - s - M - z - A - 24),
91
+ items: c,
92
+ availableWidth: Math.max(0, f - r - A - E - L - 24),
92
93
  gapPx: 12,
93
- itemWidths: h.itemWidths
94
+ itemWidths: m.itemWidths
94
95
  });
95
96
  }, [
96
97
  n,
97
- a,
98
- u,
99
- r,
98
+ c,
99
+ f,
100
+ s,
100
101
  t,
101
- d,
102
+ o,
102
103
  l,
103
- h
104
+ m
104
105
  ]);
105
- return /* @__PURE__ */ x("div", {
106
+ return /* @__PURE__ */ N("div", {
106
107
  ref: p,
107
- className: y("relative border-2 border-solid border-gama-300 bg-gama-25 transition-all duration-300 ease-in-out", "rounded-lg min-[744px]:rounded-[100px]", f ? "overflow-hidden" : "overflow-visible", c),
108
+ className: I(h.root, v ? "overflow-hidden" : "overflow-visible", a),
108
109
  "aria-expanded": n,
109
110
  role: "button",
110
111
  tabIndex: 0,
111
- onClick: o,
112
- onKeyDown: (s) => {
113
- (s.key === "Enter" || s.key === " ") && (s.preventDefault(), o());
112
+ onClick: d,
113
+ onKeyDown: (r) => {
114
+ (r.key === "Enter" || r.key === " ") && (r.preventDefault(), d());
114
115
  },
115
116
  children: [
116
- /* @__PURE__ */ x("div", {
117
- className: y("flex min-w-0 items-center p-2", f ? "gap-y-0" : "gap-y-1"),
118
- children: [r ? /* @__PURE__ */ e("div", {
117
+ /* @__PURE__ */ N("div", {
118
+ className: I(h.shell, v ? h.shellCompact : h.shellExpanded),
119
+ children: [s ? /* @__PURE__ */ e("div", {
119
120
  className: "shrink-0",
120
- children: r
121
+ children: s
121
122
  }) : null, /* @__PURE__ */ e("div", {
122
- className: "min-w-0 flex-1 px-4",
123
- children: f ? /* @__PURE__ */ e("div", {
124
- className: "flex min-w-0 flex-nowrap items-center gap-x-4 overflow-hidden whitespace-nowrap",
125
- children: b.map((s) => /* @__PURE__ */ e("div", {
123
+ className: h.content,
124
+ children: v ? /* @__PURE__ */ e("div", {
125
+ className: h.compactItems,
126
+ children: k.map((r) => /* @__PURE__ */ e("div", {
126
127
  className: "shrink-0 whitespace-nowrap",
127
- children: /* @__PURE__ */ e(N, {
128
- item: s,
129
- compact: f
128
+ children: /* @__PURE__ */ e(b, {
129
+ item: r,
130
+ compact: v
130
131
  })
131
- }, s.id))
132
- }) : /* @__PURE__ */ x("div", {
133
- className: "flex min-w-0 flex-wrap items-center gap-x-4 gap-y-1 overflow-visible",
134
- children: [a.map((s) => /* @__PURE__ */ e("div", {
132
+ }, r.id))
133
+ }) : /* @__PURE__ */ N("div", {
134
+ className: h.expandedItems,
135
+ children: [c.map((r) => /* @__PURE__ */ e("div", {
135
136
  className: "shrink-0 whitespace-nowrap",
136
- children: /* @__PURE__ */ e(N, {
137
- item: s,
138
- compact: f
137
+ children: /* @__PURE__ */ e(b, {
138
+ item: r,
139
+ compact: v
139
140
  })
140
- }, s.id)), t ? /* @__PURE__ */ e("div", {
141
+ }, r.id)), t ? /* @__PURE__ */ e("div", {
141
142
  className: "shrink-0",
142
143
  children: /* @__PURE__ */ e("div", {
143
- ref: m,
144
+ ref: u,
144
145
  children: t
145
146
  })
146
147
  }) : null]
@@ -148,34 +149,34 @@ function J({ items: i, expanded: n, onToggleExpanded: o, leadSlot: r, actionSlot
148
149
  })]
149
150
  }),
150
151
  /* @__PURE__ */ e("div", {
151
- className: "absolute right-4 top-1/2 z-20 flex-shrink-0 -translate-y-1/2 text-delta-700",
152
- children: n ? /* @__PURE__ */ e(E, { className: "size-6" }) : /* @__PURE__ */ e(B, { className: "size-6" })
152
+ className: h.chevron,
153
+ children: n ? /* @__PURE__ */ e(B, { className: "size-6" }) : /* @__PURE__ */ e(z, { className: "size-6" })
153
154
  }),
154
155
  /* @__PURE__ */ e("div", {
155
156
  "aria-hidden": !0,
156
- className: "pointer-events-none absolute left-0 top-0 -z-10 opacity-0",
157
- children: /* @__PURE__ */ x("div", {
158
- className: "flex min-w-0 flex-nowrap items-center gap-x-4 gap-y-1 whitespace-nowrap",
157
+ className: h.measureLayer,
158
+ children: /* @__PURE__ */ N("div", {
159
+ className: h.measureRow,
159
160
  children: [
160
- r ? /* @__PURE__ */ e("div", {
161
+ s ? /* @__PURE__ */ e("div", {
161
162
  className: "shrink-0",
162
163
  children: /* @__PURE__ */ e("div", {
163
- ref: v,
164
- children: r
164
+ ref: W,
165
+ children: s
165
166
  })
166
167
  }) : null,
167
- a.map((s) => /* @__PURE__ */ e("div", {
168
- ref: w(s.id),
168
+ c.map((r) => /* @__PURE__ */ e("div", {
169
+ ref: g(r.id),
169
170
  className: "shrink-0 whitespace-nowrap",
170
- children: /* @__PURE__ */ e(N, {
171
- item: s,
171
+ children: /* @__PURE__ */ e(b, {
172
+ item: r,
172
173
  compact: !0
173
174
  })
174
- }, s.id)),
175
+ }, r.id)),
175
176
  t ? /* @__PURE__ */ e("div", {
176
177
  className: "shrink-0",
177
178
  children: /* @__PURE__ */ e("div", {
178
- ref: m,
179
+ ref: u,
179
180
  children: t
180
181
  })
181
182
  }) : null
@@ -186,5 +187,5 @@ function J({ items: i, expanded: n, onToggleExpanded: o, leadSlot: r, actionSlot
186
187
  });
187
188
  }
188
189
  export {
189
- J as PathfinderCard
190
+ Q as PathfinderCard
190
191
  };
@@ -8,44 +8,44 @@ import { StyledTooltip as j } from "../../../data-display/tooltip/StyledTooltip.
8
8
  import { StyledInputField as le } from "../../input-field/StyledInputField.js";
9
9
  import { StyledSelectAutocomplete as ae } from "../../select-autocomplete/StyledSelectAutocomplete.js";
10
10
  import { DynamicInteractiveChipGroup as re } from "./DynamicInteractiveChipGroup.js";
11
- import { createElement as B, forwardRef as oe, useCallback as f, useState as ne } from "react";
11
+ import { createElement as B, forwardRef as oe, useCallback as b, useState as ne } from "react";
12
12
  import { Fragment as L, jsx as l, jsxs as T } from "react/jsx-runtime";
13
13
  var ye = oe((S, q) => {
14
- const [E, k] = ne(!1), { options: g, dataTest: x, value: y, readOnly: u, multiple: o, required: F, onChange: C, size: z, title: v, noOptionsText: K, placeholder: _, disabled: I, helperText: H, disableHelperText: R, error: G, valueKey: A = "value", labelKey: W = "label", renderLabel: i, getOptionTooltip: N, startAdornment: J, autocompleteProps: n, loading: m, maxTags: M, onFocus: Q, onBlur: U } = S, p = g.length < 11, s = (e) => typeof e == "object" ? e?.[W]?.toString() ?? "" : e?.toString() ?? "", h = f((e) => typeof e == "object" ? e?.[A] : e, [A]), P = f((e, t) => h(e) === h(t), [h]), w = (e) => {
15
- const t = h(e);
14
+ const [E, k] = ne(!1), { options: f, dataTest: g, value: x, readOnly: u, multiple: o, required: F, onChange: y, size: z, title: C, noOptionsText: K, placeholder: _, disabled: I, helperText: H, disableHelperText: R, error: G, valueKey: A = "value", labelKey: W = "label", renderLabel: i, getOptionTooltip: N, startAdornment: J, autocompleteProps: n, loading: m, maxTags: M, onFocus: Q, onBlur: U } = S, v = f.length < 11, s = (e) => typeof e == "object" ? e?.[W]?.toString() ?? "" : e?.toString() ?? "", p = b((e) => typeof e == "object" ? e?.[A] : e, [A]), P = b((e, t) => p(e) === p(t), [p]), w = (e) => {
15
+ const t = p(e);
16
16
  return t == null ? "" : typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? String(t) : e == null ? "" : s(e);
17
- }, V = f((e) => {
17
+ }, V = b((e) => {
18
18
  k(!0), n?.onOpen?.(e);
19
- }, [n]), X = f((e, t) => {
19
+ }, [n]), X = b((e, t) => {
20
20
  k(!1), n?.onClose?.(e, t);
21
21
  }, [n]);
22
22
  if (o && u) return /* @__PURE__ */ l(re, { ...S });
23
- const O = v ? `${x}-title` : void 0;
23
+ const O = C ? `${g}-title` : void 0;
24
24
  return /* @__PURE__ */ T("div", {
25
25
  className: "flex w-full flex-col gap-y-1",
26
- children: [v && /* @__PURE__ */ l("span", {
26
+ children: [C && /* @__PURE__ */ l("span", {
27
27
  id: O,
28
28
  className: "text-base font-semibold text-delta-800",
29
- children: v
29
+ children: C
30
30
  }), /* @__PURE__ */ l(ae, {
31
31
  open: E,
32
32
  onOpen: V,
33
33
  onClose: X,
34
34
  disableCloseOnSelect: o,
35
- dataTest: x,
35
+ dataTest: g,
36
36
  disabled: !!I || !!m,
37
37
  noOptionsText: K,
38
38
  loading: m,
39
39
  readOnly: u,
40
- value: y,
40
+ value: x,
41
41
  size: z,
42
42
  disableClearable: F,
43
- options: g,
43
+ options: f,
44
44
  fullWidth: !0,
45
45
  classes: { listbox: "max-h-[300px]" },
46
46
  getOptionLabel: n?.getOptionLabel ?? s,
47
47
  onChange: (e, t) => {
48
- C(t);
48
+ y(t);
49
49
  },
50
50
  filterSelectedOptions: !1,
51
51
  isOptionEqualToValue: n?.isOptionEqualToValue ?? P,
@@ -53,7 +53,7 @@ var ye = oe((S, q) => {
53
53
  multiple: o,
54
54
  renderValue: o ? (e) => {
55
55
  if (!Array.isArray(e)) return null;
56
- const t = e, c = M ?? g.length, a = t.slice(0, c), d = t.length - c;
56
+ const t = e, c = M ?? f.length, a = t.slice(0, c), d = t.length - c;
57
57
  return [...a.map((r) => /* @__PURE__ */ l($, {
58
58
  dataTest: `${w(r)}-chip`,
59
59
  readOnly: u,
@@ -65,7 +65,7 @@ var ye = oe((S, q) => {
65
65
  },
66
66
  disabled: !!I || !!m,
67
67
  onDelete: () => {
68
- Array.isArray(y) && C(y.filter((b) => !P(b, r)));
68
+ Array.isArray(x) && y(x.filter((h) => !P(h, r)));
69
69
  }
70
70
  }, w(r))), d > 0 ? /* @__PURE__ */ l($, {
71
71
  dataTest: "remaining-count-tag-chip",
@@ -84,11 +84,11 @@ var ye = oe((S, q) => {
84
84
  renderOption: (e, t, c) => {
85
85
  const a = typeof t == "object" ? !!t?.disabled : !1, d = N ? N(t) : null;
86
86
  if (o) {
87
- const b = c.selected;
87
+ const h = c.selected;
88
88
  return /* @__PURE__ */ B("li", {
89
89
  ...e,
90
90
  role: "option",
91
- "aria-selected": b,
91
+ "aria-selected": h,
92
92
  key: e.id,
93
93
  onClick: a ? void 0 : e.onClick,
94
94
  className: D("flex min-h-10 cursor-pointer items-center gap-x-1 bg-white px-2 text-base aria-selected:bg-gama-50 hover:bg-gama-50", a && "cursor-not-allowed bg-delta-50 aria-selected:!bg-delta-50 hover:!bg-delta-50 [&_*]:cursor-not-allowed"),
@@ -102,7 +102,7 @@ var ye = oe((S, q) => {
102
102
  size: "small",
103
103
  decorative: !0,
104
104
  className: "min-w-[36px]",
105
- checked: b
105
+ checked: h
106
106
  }), i ? i(t) : /* @__PURE__ */ l("span", {
107
107
  className: "h-fit text-base text-delta-700",
108
108
  children: s(t)
@@ -135,7 +135,7 @@ var ye = oe((S, q) => {
135
135
  }));
136
136
  },
137
137
  renderInput: (e) => /* @__PURE__ */ l(le, {
138
- dataTest: `${x}-input-field`,
138
+ dataTest: `${g}-input-field`,
139
139
  ...e,
140
140
  inputRef: q,
141
141
  error: G,
@@ -146,19 +146,19 @@ var ye = oe((S, q) => {
146
146
  readOnly: u,
147
147
  onFocus: Q,
148
148
  onBlur: U,
149
- onKeyDown: p ? (t) => t.preventDefault() : void 0,
150
- autoComplete: p ? "off" : "on",
149
+ onKeyDown: v ? (t) => t.preventDefault() : void 0,
150
+ autoComplete: "off",
151
151
  slotProps: {
152
152
  ...e.slotProps,
153
153
  input: {
154
154
  ...e.slotProps?.input ?? {},
155
155
  startAdornment: J ?? e.slotProps?.input?.startAdornment,
156
- style: p ? { caretColor: "transparent" } : {}
156
+ style: v ? { caretColor: "transparent" } : {}
157
157
  },
158
158
  htmlInput: {
159
159
  ...e.slotProps?.htmlInput ?? {},
160
160
  ...O ? { "aria-labelledby": O } : {},
161
- style: p ? { caretColor: "transparent" } : {}
161
+ style: v ? { caretColor: "transparent" } : {}
162
162
  }
163
163
  }
164
164
  }),