asma-ui-core 3.28.0 → 3.29.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.
@@ -1,52 +1,54 @@
1
- import { resolveToolbarActionWidth as U } from "./planToolbarActions.js";
2
- var l = 8, y = 12, w = 168, C = 44, G = 92, H = 44, Y = 148, D = 44, V = 168, J = 11, K = 96, B = 360, j = 12;
3
- function m(t) {
1
+ import { resolveToolbarActionWidth as C } from "./planToolbarActions.js";
2
+ var l = 8, g = 12, G = 160, H = 44, Y = 92, D = 44, V = 148, J = 44, K = 168, j = 9, q = 56, E = 360, z = 12;
3
+ function L(t) {
4
4
  return {
5
- leading: t?.leadingUtilityWidthPx ?? C,
6
- search: t?.searchWidthPx ?? w,
7
- selectionIndicator: t?.selectionIndicatorWidthPx ?? V,
8
- filter: (i) => i ? t?.filterIconWidthPx ?? H : t?.filterLabelWidthPx ?? G,
9
- trailing: (i) => i ? t?.trailingIconWidthPx ?? D : t?.trailingLabelWidthPx ?? Y
5
+ leading: t?.leadingUtilityWidthPx ?? H,
6
+ search: t?.searchWidthPx ?? G,
7
+ selectionIndicator: t?.selectionIndicatorWidthPx ?? K,
8
+ filter: (i) => i ? t?.filterIconWidthPx ?? D : t?.filterLabelWidthPx ?? Y,
9
+ trailing: (i) => i ? t?.trailingIconWidthPx ?? J : t?.trailingLabelWidthPx ?? V
10
10
  };
11
11
  }
12
- function q(t) {
13
- return t ? typeof t == "string" ? t.length : j : 0;
12
+ function Q(t) {
13
+ return t ? typeof t == "string" ? t.length : z : 0;
14
14
  }
15
- function z(t) {
16
- const i = q(t), e = i > 0 ? i * J + 24 : 0;
17
- return Math.min(B, Math.max(K, e));
15
+ function k(t) {
16
+ const i = Q(t);
17
+ if (i === 0) return 0;
18
+ const e = i > 0 ? i * j + 24 : 0;
19
+ return Math.min(E, Math.max(q, e));
18
20
  }
19
- function Q(t, i) {
20
- return i != null && i > 0 ? Math.min(B, i) : z(t);
21
+ function Z(t, i) {
22
+ return typeof t == "string" ? k(t) : i != null && i > 0 ? Math.min(E, i) : k(t);
21
23
  }
22
- function v(t, i, e) {
24
+ function T(t, i, e) {
23
25
  const n = t.filter((r) => !r.hidden);
24
- return n.length ? n.reduce((r, c) => r + U(c, i, e) + l, 0) - l : 0;
26
+ return n.length ? n.reduce((r, c) => r + C(c, i, e) + l, 0) - l : 0;
25
27
  }
26
- function E(t, i, e) {
28
+ function F(t, i, e) {
27
29
  const n = t.filter((s) => !s.hidden).sort((s, u) => (u.priority ?? 0) - (s.priority ?? 0));
28
30
  if (!n.length) return 0;
29
- const r = n.slice(0, i), c = v(r, !0, e);
31
+ const r = n.slice(0, i), c = T(r, !0, e);
30
32
  return n.length === r.length ? c : c + (r.length ? l : 0) + 40;
31
33
  }
32
- function tt(t, i, e, n = 3) {
33
- return t > 0 ? t : E(i, n, e);
34
+ function it(t, i, e, n = 3) {
35
+ return t > 0 ? t : F(i, n, e);
34
36
  }
35
- function S(t) {
36
- const { hasLeadingUtility: i, hasFilter: e, hasSearch: n, hasTrailingUtility: r, showPageActions: c, showBulkActions: s, filterIconOnly: u, trailingIconOnly: h, pageActionsWidthPx: I, bulkActionsWidthPx: O, searchBeforeFilter: W = !1, measured: g } = t, d = m(g);
37
+ function B(t) {
38
+ const { hasLeadingUtility: i, hasFilter: e, hasSearch: n, hasTrailingUtility: r, showPageActions: c, showBulkActions: s, filterIconOnly: u, trailingIconOnly: h, pageActionsWidthPx: I, bulkActionsWidthPx: O, searchBeforeFilter: W = !1, measured: y } = t, d = L(y);
37
39
  let o = 0;
38
40
  c && i && (o += d.leading + l);
39
41
  const f = e ? d.filter(u) + l : 0, p = n ? d.search + l : 0;
40
42
  return W ? o += p + f : o += f + p, c && (I > 0 && (o += I + l), r && (o += d.trailing(h) + l)), s && O > 0 && (o += O + l), Math.max(0, o - l);
41
43
  }
42
- function it(t) {
43
- const { containerWidth: i, isMobile: e, isSelectionMode: n, compactBreakpointPx: r, reserveBulkActionsWidthPx: c, title: s, hasLeadingUtility: u, hasFilter: h, hasSearch: I, hasTrailingUtility: O, pageActions: W, bulkActions: g, maxVisibleBulkActions: d = 2, measured: o } = t, f = i > 0 ? i : Number.POSITIVE_INFINITY, p = !n, F = n, M = n ? 0 : c, b = m(o), _ = Q(s, o?.titleWidthPx), P = v(W, !0, o?.actionWidthPx), L = v(W, !1, o?.actionWidthPx), k = E(g, d, o?.actionWidthPx), A = (a) => S({
44
+ function nt(t) {
45
+ const { containerWidth: i, isMobile: e, isSelectionMode: n, compactBreakpointPx: r, reserveBulkActionsWidthPx: c, title: s, hasLeadingUtility: u, hasFilter: h, hasSearch: I, hasTrailingUtility: O, pageActions: W, bulkActions: y, maxVisibleBulkActions: d = 2, measured: o } = t, f = i > 0 ? i : Number.POSITIVE_INFINITY, p = !n, M = n, N = n ? 0 : c, v = L(o), _ = Z(s, o?.titleWidthPx), P = T(W, !0, o?.actionWidthPx), b = T(W, !1, o?.actionWidthPx), S = F(y, d, o?.actionWidthPx), A = (a) => B({
44
46
  hasLeadingUtility: u,
45
47
  hasFilter: h,
46
48
  hasSearch: I,
47
49
  hasTrailingUtility: O,
48
50
  showPageActions: p,
49
- showBulkActions: F,
51
+ showBulkActions: M,
50
52
  bulkActionsWidthPx: 0,
51
53
  measured: o,
52
54
  ...a
@@ -55,7 +57,7 @@ function it(t) {
55
57
  const a = (x) => f >= A({
56
58
  ...x,
57
59
  searchBeforeFilter: !0
58
- }), T = (x) => n ? !0 : x;
60
+ }), m = (x) => n ? !0 : x;
59
61
  return a({
60
62
  filterIconOnly: !1,
61
63
  trailingIconOnly: !1,
@@ -63,7 +65,7 @@ function it(t) {
63
65
  }) ? {
64
66
  mode: "compact",
65
67
  filterIconOnly: !1,
66
- trailingIconOnly: T(!1)
68
+ trailingIconOnly: m(!1)
67
69
  } : a({
68
70
  filterIconOnly: !1,
69
71
  trailingIconOnly: !0,
@@ -75,7 +77,7 @@ function it(t) {
75
77
  } : a({
76
78
  filterIconOnly: !1,
77
79
  trailingIconOnly: !0,
78
- pageActionsWidthPx: L
80
+ pageActionsWidthPx: b
79
81
  }) ? {
80
82
  mode: "compact",
81
83
  filterIconOnly: !1,
@@ -87,33 +89,33 @@ function it(t) {
87
89
  };
88
90
  }
89
91
  if (n) {
90
- const a = (R) => S({
92
+ const a = (w) => B({
91
93
  hasLeadingUtility: !1,
92
94
  hasFilter: h,
93
95
  hasSearch: I,
94
96
  hasTrailingUtility: !1,
95
97
  showPageActions: !1,
96
98
  showBulkActions: !1,
97
- filterIconOnly: R,
99
+ filterIconOnly: w,
98
100
  trailingIconOnly: !0,
99
101
  pageActionsWidthPx: 0,
100
102
  bulkActionsWidthPx: 0,
101
103
  measured: o
102
- });
103
- if (f >= _ + b.selectionIndicator + A({
104
+ }), m = s ? g : 0;
105
+ if (f >= _ + v.selectionIndicator + m + A({
104
106
  filterIconOnly: !1,
105
107
  trailingIconOnly: !0,
106
108
  pageActionsWidthPx: 0,
107
- bulkActionsWidthPx: k
108
- }) + y) return {
109
+ bulkActionsWidthPx: S
110
+ }) + g) return {
109
111
  mode: "inline",
110
112
  filterIconOnly: !1,
111
113
  trailingIconOnly: !0
112
114
  };
113
- const T = _ + a(!1) + y, x = b.selectionIndicator + k + y;
114
- return f >= Math.max(T, x) ? {
115
+ const x = _ + a(!1) + g, U = v.selectionIndicator + S + g;
116
+ return f >= Math.max(x, U) ? {
115
117
  mode: "selection-split",
116
- filterIconOnly: f < _ + a(!0) + y,
118
+ filterIconOnly: f < _ + a(!0) + g,
117
119
  trailingIconOnly: !0
118
120
  } : {
119
121
  mode: "compact",
@@ -121,7 +123,7 @@ function it(t) {
121
123
  trailingIconOnly: !0
122
124
  };
123
125
  }
124
- const N = (a) => f >= _ + A(a) + M + y, X = [
126
+ const X = (a) => f >= _ + A(a) + N + g, R = [
125
127
  {
126
128
  filterIconOnly: !1,
127
129
  trailingIconOnly: !1,
@@ -132,18 +134,13 @@ function it(t) {
132
134
  trailingIconOnly: !0,
133
135
  pageActionsWidthPx: P
134
136
  },
135
- {
136
- filterIconOnly: !1,
137
- trailingIconOnly: !0,
138
- pageActionsWidthPx: L
139
- },
140
137
  {
141
138
  filterIconOnly: !0,
142
139
  trailingIconOnly: !0,
143
- pageActionsWidthPx: L
140
+ pageActionsWidthPx: P
144
141
  }
145
142
  ];
146
- for (const a of X) if (N(a)) return {
143
+ for (const a of R) if (X(a)) return {
147
144
  mode: "inline",
148
145
  filterIconOnly: a.filterIconOnly,
149
146
  trailingIconOnly: a.trailingIconOnly
@@ -160,7 +157,7 @@ function it(t) {
160
157
  } : f >= A({
161
158
  filterIconOnly: !0,
162
159
  trailingIconOnly: !0,
163
- pageActionsWidthPx: L,
160
+ pageActionsWidthPx: b,
164
161
  searchBeforeFilter: !0
165
162
  }) ? {
166
163
  mode: "stacked",
@@ -172,18 +169,18 @@ function it(t) {
172
169
  trailingIconOnly: !0
173
170
  };
174
171
  }
175
- function nt(t) {
176
- const { layoutMode: i, containerWidth: e, titleWidth: n, filterIconOnly: r, trailingIconOnly: c, hasFilter: s, hasSearch: u, hasLeadingUtility: h, hasTrailingUtility: I, reserveBulkActionsWidthPx: O, measured: W } = t, g = m(W), d = (h ? g.leading + l : 0) + (s ? g.filter(r) + l : 0) + (u ? g.search + l : 0) + (I ? g.trailing(c) + l : 0);
177
- return i === "stacked" || i === "compact" ? Math.max(80, e - d) : Math.max(80, e - n - d - y - O);
178
- }
179
172
  function et(t) {
180
- const { layoutMode: i, containerWidth: e, titleWidth: n, filterIconOnly: r, hasFilter: c, hasSearch: s, measured: u } = t, h = m(u), I = (c ? h.filter(r) + l : 0) + (s ? h.search + l : 0);
181
- return i === "inline" ? Math.max(120, e - n - h.selectionIndicator - I - y * 2) : Math.max(120, e - h.selectionIndicator - y);
173
+ const { layoutMode: i, containerWidth: e, titleWidth: n, filterIconOnly: r, trailingIconOnly: c, hasFilter: s, hasSearch: u, hasLeadingUtility: h, hasTrailingUtility: I, reserveBulkActionsWidthPx: O, measured: W } = t, y = L(W), d = (h ? y.leading + l : 0) + (s ? y.filter(r) + l : 0) + (u ? y.search + l : 0) + (I ? y.trailing(c) + l : 0);
174
+ return i === "stacked" || i === "compact" ? Math.max(80, e - d) : Math.max(80, e - n - d - g - O);
175
+ }
176
+ function lt(t) {
177
+ const { layoutMode: i, containerWidth: e, titleWidth: n, filterIconOnly: r, hasFilter: c, hasSearch: s, measured: u } = t, h = L(u), I = (c ? h.filter(r) + l : 0) + (s ? h.search + l : 0);
178
+ return i === "inline" ? Math.max(120, e - n - h.selectionIndicator - I - g * 2) : Math.max(120, e - h.selectionIndicator - g);
182
179
  }
183
180
  export {
184
- et as resolveBulkActionsAvailableWidth,
185
- nt as resolvePageActionsAvailableWidth,
186
- tt as resolveReserveBulkActionsWidthPx,
187
- Q as resolveTitleAreaWidth,
188
- it as resolveToolbarLayout
181
+ lt as resolveBulkActionsAvailableWidth,
182
+ et as resolvePageActionsAvailableWidth,
183
+ it as resolveReserveBulkActionsWidthPx,
184
+ Z as resolveTitleAreaWidth,
185
+ nt as resolveToolbarLayout
189
186
  };
@@ -1,11 +1,14 @@
1
- import t from "./StyledWidgetTitle.module.js";
2
- import { jsx as i } from "react/jsx-runtime";
3
- var o = function(e) {
4
- return /* @__PURE__ */ i("div", {
5
- className: t["styled-widget-title"],
1
+ import { cn as i } from "../../../../helpers/cn.js";
2
+ import r from "./StyledWidgetTitle.module.js";
3
+ import { forwardRef as d } from "react";
4
+ import { jsx as l } from "react/jsx-runtime";
5
+ var n = d(function(e, t) {
6
+ return /* @__PURE__ */ l("div", {
7
+ ref: t,
8
+ className: i(r["styled-widget-title"], e.className),
6
9
  children: e.children
7
10
  });
8
- };
11
+ });
9
12
  export {
10
- o as StyledWidgetTitle
13
+ n as StyledWidgetTitle
11
14
  };
@@ -1 +1,5 @@
1
- export declare const StyledWidgetTitle: React.FC<React.PropsWithChildren>;
1
+ export declare const StyledWidgetTitle: import('node_modules/@types/react').ForwardRefExoticComponent<{
2
+ className?: string;
3
+ } & {
4
+ children?: import('node_modules/@types/react').ReactNode | undefined;
5
+ } & import('node_modules/@types/react').RefAttributes<HTMLDivElement>>;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.28.0",
6
+ "version": "3.29.0",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",