asma-ui-core 3.68.1 → 3.68.3

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.
@@ -1,14 +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 = {
1
+ var e = "_root_1k8wv_1", _ = "_shell_1k8wv_5", a = "_shellCompact_1k8wv_9", v = "_shellExpanded_1k8wv_13", r = "_content_1k8wv_17", t = "_compactItems_1k8wv_21", o = "_compactItemsStacked_1k8wv_25", m = "_expandedItems_1k8wv_29", s = "_measureRow_1k8wv_33", c = "_measureLayer_1k8wv_37", l = "_chevron_1k8wv_41", d = {
2
2
  root: e,
3
3
  shell: _,
4
4
  shellCompact: a,
5
- shellExpanded: t,
6
- content: s,
7
- compactItems: r,
8
- expandedItems: o,
9
- measureRow: l,
10
- measureLayer: m,
11
- chevron: v
5
+ shellExpanded: v,
6
+ content: r,
7
+ compactItems: t,
8
+ compactItemsStacked: o,
9
+ expandedItems: m,
10
+ measureRow: s,
11
+ measureLayer: c,
12
+ chevron: l
12
13
  };
13
14
  export {
14
15
  d as default
@@ -1,17 +1,17 @@
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";
1
+ import { cn as b } from "../../../helpers/cn.js";
2
+ import { ChevronDownIcon as F } from "../../icons/chevron-down-icon/ChevronDownIcon.js";
3
+ import { ChevronUpIcon as O } from "../../icons/chevron-up-icon/ChevronUpIcon.js";
4
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;
8
- function D() {
9
- const [i, n] = x(null), d = R((t) => {
5
+ import { useCallback as I, useEffect as M, useLayoutEffect as j, useMemo as y, useRef as R, useState as x, useSyncExternalStore as P } from "react";
6
+ import { Fragment as D, jsx as e, jsxs as k } from "react/jsx-runtime";
7
+ var _ = typeof window < "u" ? j : M;
8
+ function q() {
9
+ const [i, n] = x(null), d = I((t) => {
10
10
  n(t);
11
- }, []), s = R(() => i ? Math.floor(i.getBoundingClientRect().width) : 0, [i]);
11
+ }, []), s = I(() => i ? Math.floor(i.getBoundingClientRect().width) : 0, [i]);
12
12
  return {
13
13
  ref: d,
14
- width: O(R((t) => {
14
+ width: P(I((t) => {
15
15
  if (!i || typeof ResizeObserver > "u") return () => {
16
16
  console.log("Node is missing or ResizeObserver is undefined");
17
17
  };
@@ -25,33 +25,33 @@ function D() {
25
25
  }, [i]), s, () => 0)
26
26
  };
27
27
  }
28
- function M(i) {
28
+ function A(i) {
29
29
  return [...i].sort((n, d) => {
30
30
  const s = n.order ?? 0, t = d.order ?? 0;
31
31
  return s !== t ? s - t : n.id.localeCompare(d.id);
32
32
  });
33
33
  }
34
- function _(i) {
35
- const { items: n, leadSlot: d, actionSlot: s } = i, t = w({}), a = w(null), o = w(null), [l, p] = x({
34
+ function K(i) {
35
+ const { items: n, leadSlot: d, actionSlot: s } = i, t = R({}), a = R(null), o = R(null), [l, v] = x({
36
36
  itemWidths: {},
37
37
  leadWidth: 0,
38
38
  actionWidth: 0
39
- }), f = w(l);
40
- y(() => {
39
+ }), f = R(l);
40
+ M(() => {
41
41
  f.current = l;
42
42
  }, [l]);
43
- const v = R((c) => (m) => {
44
- t.current[c] = m;
43
+ const p = I((r) => (m) => {
44
+ t.current[r] = m;
45
45
  }, []);
46
- return P(() => {
47
- const c = {};
46
+ return _(() => {
47
+ const r = {};
48
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;
49
+ const w = t.current[u.id], N = Math.ceil(w?.getBoundingClientRect().width ?? u.estimatedWidth ?? 0);
50
+ r[u.id] = N;
51
51
  }
52
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,
53
+ (!(Object.keys(W.itemWidths).length === Object.keys(r).length && n.every((u) => W.itemWidths[u.id] === r[u.id])) || W.leadWidth !== m || W.actionWidth !== g) && v({
54
+ itemWidths: r,
55
55
  leadWidth: m,
56
56
  actionWidth: g
57
57
  });
@@ -61,84 +61,84 @@ function _(i) {
61
61
  s
62
62
  ]), {
63
63
  measurements: l,
64
- registerItemRef: v,
64
+ registerItemRef: p,
65
65
  leadRef: a,
66
66
  actionRef: o
67
67
  };
68
68
  }
69
- function q(i) {
69
+ function U(i) {
70
70
  const { items: n, availableWidth: d, gapPx: s, itemWidths: t } = i, a = [];
71
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;
72
+ for (const l of A(n)) {
73
+ const v = Math.max(0, t[l.id] ?? l.estimatedWidth ?? 0), f = a.length === 0 ? v : o + s + v;
74
74
  if (f > d) break;
75
75
  a.push(l), o = f;
76
76
  }
77
77
  return a;
78
78
  }
79
- function b({ item: i, compact: n }) {
80
- return /* @__PURE__ */ e(j, { children: i.render({ compact: n }) });
79
+ function C({ item: i, compact: n }) {
80
+ return /* @__PURE__ */ e(D, { children: i.render({ compact: n }) });
81
81
  }
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,
82
+ function Y({ items: i, expanded: n, onToggleExpanded: d, leadSlot: s, actionSlot: t, className: a, leadReservePx: o = 140, actionReservePx: l = 44 }) {
83
+ const { ref: v, width: f } = q(), p = !n, r = y(() => A(i), [i]), { measurements: m, registerItemRef: g, leadRef: W, actionRef: u } = K({
84
+ items: r,
85
85
  leadSlot: s,
86
86
  actionSlot: t
87
- }), k = C(() => {
88
- if (n) return c;
89
- const r = 24, A = 24, E = s ? Math.max(o, m.leadWidth + 12) : 0, L = t ? Math.max(l, m.actionWidth) : 0;
90
- return q({
91
- items: c,
92
- availableWidth: Math.max(0, f - r - A - E - L - 24),
87
+ }), w = y(() => {
88
+ if (n) return r;
89
+ const c = 24, L = 24, z = s ? Math.max(o, m.leadWidth + 12) : 0, B = t ? Math.max(l, m.actionWidth) : 0;
90
+ return U({
91
+ items: r,
92
+ availableWidth: Math.max(0, f - c - L - z - B - 24),
93
93
  gapPx: 12,
94
94
  itemWidths: m.itemWidths
95
95
  });
96
96
  }, [
97
97
  n,
98
- c,
98
+ r,
99
99
  f,
100
100
  s,
101
101
  t,
102
102
  o,
103
103
  l,
104
104
  m
105
- ]);
106
- return /* @__PURE__ */ N("div", {
107
- ref: p,
108
- className: I(h.root, v ? "overflow-hidden" : "overflow-visible", a),
105
+ ]), N = p && w.length < Math.min(2, r.length), E = N ? r.slice(0, 2) : w;
106
+ return /* @__PURE__ */ k("div", {
107
+ ref: v,
108
+ className: b(h.root, p ? "overflow-hidden" : "overflow-visible", a),
109
109
  "aria-expanded": n,
110
110
  role: "button",
111
111
  tabIndex: 0,
112
112
  onClick: d,
113
- onKeyDown: (r) => {
114
- (r.key === "Enter" || r.key === " ") && (r.preventDefault(), d());
113
+ onKeyDown: (c) => {
114
+ (c.key === "Enter" || c.key === " ") && (c.preventDefault(), d());
115
115
  },
116
116
  children: [
117
- /* @__PURE__ */ N("div", {
118
- className: I(h.shell, v ? h.shellCompact : h.shellExpanded),
117
+ /* @__PURE__ */ k("div", {
118
+ className: b(h.shell, p ? h.shellCompact : h.shellExpanded),
119
119
  children: [s ? /* @__PURE__ */ e("div", {
120
120
  className: "shrink-0",
121
121
  children: s
122
122
  }) : null, /* @__PURE__ */ e("div", {
123
123
  className: h.content,
124
- children: v ? /* @__PURE__ */ e("div", {
125
- className: h.compactItems,
126
- children: k.map((r) => /* @__PURE__ */ e("div", {
124
+ children: p ? /* @__PURE__ */ e("div", {
125
+ className: b(h.compactItems, N && h.compactItemsStacked),
126
+ children: E.map((c) => /* @__PURE__ */ e("div", {
127
127
  className: "shrink-0 whitespace-nowrap",
128
- children: /* @__PURE__ */ e(b, {
129
- item: r,
130
- compact: v
128
+ children: /* @__PURE__ */ e(C, {
129
+ item: c,
130
+ compact: p
131
131
  })
132
- }, r.id))
133
- }) : /* @__PURE__ */ N("div", {
132
+ }, c.id))
133
+ }) : /* @__PURE__ */ k("div", {
134
134
  className: h.expandedItems,
135
- children: [c.map((r) => /* @__PURE__ */ e("div", {
135
+ children: [r.map((c) => /* @__PURE__ */ e("div", {
136
136
  className: "shrink-0 whitespace-nowrap",
137
- children: /* @__PURE__ */ e(b, {
138
- item: r,
139
- compact: v
137
+ children: /* @__PURE__ */ e(C, {
138
+ item: c,
139
+ compact: p
140
140
  })
141
- }, r.id)), t ? /* @__PURE__ */ e("div", {
141
+ }, c.id)), t ? /* @__PURE__ */ e("div", {
142
142
  className: "shrink-0",
143
143
  children: /* @__PURE__ */ e("div", {
144
144
  ref: u,
@@ -150,12 +150,12 @@ function Q({ items: i, expanded: n, onToggleExpanded: d, leadSlot: s, actionSlot
150
150
  }),
151
151
  /* @__PURE__ */ e("div", {
152
152
  className: h.chevron,
153
- children: n ? /* @__PURE__ */ e(B, { className: "size-6" }) : /* @__PURE__ */ e(z, { className: "size-6" })
153
+ children: n ? /* @__PURE__ */ e(O, { className: "size-6" }) : /* @__PURE__ */ e(F, { className: "size-6" })
154
154
  }),
155
155
  /* @__PURE__ */ e("div", {
156
156
  "aria-hidden": !0,
157
157
  className: h.measureLayer,
158
- children: /* @__PURE__ */ N("div", {
158
+ children: /* @__PURE__ */ k("div", {
159
159
  className: h.measureRow,
160
160
  children: [
161
161
  s ? /* @__PURE__ */ e("div", {
@@ -165,14 +165,14 @@ function Q({ items: i, expanded: n, onToggleExpanded: d, leadSlot: s, actionSlot
165
165
  children: s
166
166
  })
167
167
  }) : null,
168
- c.map((r) => /* @__PURE__ */ e("div", {
169
- ref: g(r.id),
168
+ r.map((c) => /* @__PURE__ */ e("div", {
169
+ ref: g(c.id),
170
170
  className: "shrink-0 whitespace-nowrap",
171
- children: /* @__PURE__ */ e(b, {
172
- item: r,
171
+ children: /* @__PURE__ */ e(C, {
172
+ item: c,
173
173
  compact: !0
174
174
  })
175
- }, r.id)),
175
+ }, c.id)),
176
176
  t ? /* @__PURE__ */ e("div", {
177
177
  className: "shrink-0",
178
178
  children: /* @__PURE__ */ e("div", {
@@ -187,5 +187,5 @@ function Q({ items: i, expanded: n, onToggleExpanded: d, leadSlot: s, actionSlot
187
187
  });
188
188
  }
189
189
  export {
190
- Q as PathfinderCard
190
+ Y as PathfinderCard
191
191
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.68.1",
6
+ "version": "3.68.3",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",