asma-ui-core 3.126.3 → 3.127.1

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,103 +1,112 @@
1
- import { cn as le } from "../../../helpers/cn.js";
1
+ import { cn as re } from "../../../helpers/cn.js";
2
2
  import { StyledCheckbox as Ne } from "../checkbox/base-ui/StyledCheckbox.js";
3
- import { StyledButton as B } from "../button/StyledButton.js";
4
- import { StyledSearchField as De } from "../search-field/StyledSearchField.js";
5
- import { useAnnouncer as Se } from "../full-screen-picker/PickerLiveRegion.js";
6
- import { nextActiveIndex as $e } from "./listboxCursor.js";
7
- import { FullScreenPicker as Ie } from "../full-screen-picker/FullScreenPicker.js";
8
- import { useEffect as T, useMemo as _e, useRef as ee, useState as y } from "react";
9
- import { jsx as n, jsxs as A } from "react/jsx-runtime";
10
- var Me = 500, re = "px-3 py-2 text-sm text-delta-600", te = "[&>div]:px-0";
11
- function ze({ open: l, dataTest: o, listboxId: u, title: N, name: v, text: a, options: f, multiple: d, value: m, clearable: H, isEqual: b, isOptionDisabled: K, getLabel: j, getOptionKey: E, filterOptions: D, renderOptionRow: ne, optionRowClassName: U, loading: S, loadingText: oe, noOptionsText: ae, allowSelectAll: ce, selectAllLabel: se, onSelect: ie, onClear: de, onApply: ue, onCancel: fe }) {
12
- const [s, $] = y(""), [t, h] = y(null), [i, W] = y([]), [me, he] = y(!1), [pe, we] = y(!1), [ke, I, Ce] = Se();
13
- l !== pe && (we(l), l && ($(""), h(null), W(Array.isArray(m) ? [...m] : []), he(!d && H && m !== null && !Array.isArray(m)), Ce()));
14
- const _ = ee([]), z = d ? null : m, Q = (e) => d ? i.some((r) => b(e, r)) : z !== null && b(e, z), c = _e(() => {
3
+ import { StyledButton as F } from "../button/StyledButton.js";
4
+ import { StyledEmptyPage as De } from "../../feedback/empty-page/StyledEmptyPage.js";
5
+ import { StyledSearchField as Se } from "../search-field/StyledSearchField.js";
6
+ import { useAnnouncer as $e } from "../full-screen-picker/PickerLiveRegion.js";
7
+ import { nextActiveIndex as Ie } from "./listboxCursor.js";
8
+ import { FullScreenPicker as _e } from "../full-screen-picker/FullScreenPicker.js";
9
+ import { useEffect as q, useMemo as Me, useRef as ee, useState as C } from "react";
10
+ import { jsx as t, jsxs as N } from "react/jsx-runtime";
11
+ var Re = 500, Le = "px-3 py-2 text-sm text-delta-600", le = "[&>div]:px-0";
12
+ function Ge({ open: l, dataTest: o, listboxId: u, title: D, name: g, text: a, options: f, multiple: d, value: m, clearable: B, isEqual: v, isOptionDisabled: H, getLabel: K, getOptionKey: j, filterOptions: S, renderOptionRow: te, optionRowClassName: U, loading: x, loadingText: ne, noOptionsText: oe, allowSelectAll: ae, selectAllLabel: se, onSelect: ce, onClear: ie, onApply: de, onCancel: ue }) {
13
+ const [c, $] = C(""), [n, h] = C(null), [i, W] = C([]), [fe, me] = C(!1), [he, pe] = C(!1), [we, I, ke] = $e();
14
+ l !== he && (pe(l), l && ($(""), h(null), W(Array.isArray(m) ? [...m] : []), me(!d && B && m !== null && !Array.isArray(m)), ke()));
15
+ const _ = ee([]), z = d ? null : m, Q = (e) => d ? i.some((r) => v(e, r)) : z !== null && v(e, z), s = Me(() => {
15
16
  const e = [...f];
16
- if (D) return D(e, { inputValue: s });
17
- const r = s.trim().toLowerCase();
18
- return r ? e.filter((k) => j(k).toLowerCase().includes(r)) : e;
17
+ if (S) return S(e, { inputValue: c });
18
+ const r = c.trim().toLowerCase();
19
+ return r ? e.filter((k) => K(k).toLowerCase().includes(r)) : e;
19
20
  }, [
20
21
  f,
21
- s,
22
- D
23
- ]), M = !!(ce && d), p = M ? [-1, ...c.map((e, r) => r)] : c.map((e, r) => r), w = c.findIndex(Q), { noMatches: Y, matchCount: G } = a;
24
- T(() => {
25
- if (s === "") return;
26
- const e = window.setTimeout(() => I(c.length === 0 ? Y : G(c.length)), Me);
22
+ c,
23
+ S
24
+ ]), M = !!(ae && d), p = M ? [-1, ...s.map((e, r) => r)] : s.map((e, r) => r), w = s.findIndex(Q), { noMatches: Y, matchCount: G } = a;
25
+ q(() => {
26
+ if (c === "") return;
27
+ const e = window.setTimeout(() => I(s.length === 0 ? Y : G(s.length)), Re);
27
28
  return () => window.clearTimeout(e);
28
29
  }, [
29
30
  I,
30
- c.length,
31
- s,
31
+ s.length,
32
+ c,
32
33
  Y,
33
34
  G
34
35
  ]);
35
36
  const R = ee(!1);
36
- T(() => {
37
+ q(() => {
37
38
  if (!l) {
38
39
  R.current = !1;
39
40
  return;
40
41
  }
41
- R.current || S || (R.current = !0, w >= 0 && _.current[w]?.scrollIntoView({ block: "center" }));
42
- }, [l, S]);
42
+ R.current || x || (R.current = !0, w >= 0 && _.current[w]?.scrollIntoView({ block: "center" }));
43
+ }, [l, x]);
43
44
  const L = (e) => {
44
45
  h(e), e !== null && e >= 0 && _.current[e]?.scrollIntoView({ block: "nearest" });
45
- }, V = (e, r = a.selectedCount(e.length)) => {
46
+ }, P = (e, r = a.selectedCount(e.length)) => {
46
47
  W(e), I(r);
47
48
  }, ye = (e) => {
48
- V(i.some((r) => b(e, r)) ? i.filter((r) => !b(e, r)) : [...i, e]);
49
- }, g = f.length > 0 && i.length === f.length, J = () => V(g ? [] : [...f]), O = (e, r, k = !0) => {
50
- K(r) || (d ? ye(r) : ie(e, r, k));
51
- }, F = (e, r) => {
52
- t === -1 ? J() : t !== null && c[t] !== void 0 && O(e, c[t], r);
49
+ P(i.some((r) => v(e, r)) ? i.filter((r) => !v(e, r)) : [...i, e]);
50
+ }, b = f.length > 0 && i.length === f.length, J = () => P(b ? [] : [...f]), O = (e, r, k = !0) => {
51
+ H(r) || (d ? ye(r) : ce(e, r, k));
52
+ }, V = (e, r) => {
53
+ n === -1 ? J() : n !== null && s[n] !== void 0 && O(e, s[n], r);
53
54
  }, X = (e) => {
54
- e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), L($e(p, t, w, e.key === "ArrowDown" ? 1 : -1))) : e.key === "Home" || e.key === "End" ? (e.preventDefault(), L(p[e.key === "Home" ? 0 : p.length - 1] ?? null)) : e.key === "Enter" ? (e.preventDefault(), F(e, !0)) : e.key === " " && s === "" && t !== null && (e.preventDefault(), F(e, !1));
55
- }, ve = (e) => {
55
+ e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), L(Ie(p, n, w, e.key === "ArrowDown" ? 1 : -1))) : e.key === "Home" || e.key === "End" ? (e.preventDefault(), L(p[e.key === "Home" ? 0 : p.length - 1] ?? null)) : e.key === "Enter" ? (e.preventDefault(), V(e, !0)) : e.key === " " && c === "" && n !== null && (e.preventDefault(), V(e, !1));
56
+ }, Ce = (e) => {
56
57
  if (e.key !== " ") {
57
58
  X(e);
58
59
  return;
59
60
  }
60
- e.preventDefault(), F(e, !1);
61
- }, be = () => {
62
- t === null && L(w >= 0 ? w : p[0] ?? null);
61
+ e.preventDefault(), V(e, !1);
62
+ }, ge = () => {
63
+ n === null && L(w >= 0 ? w : p[0] ?? null);
63
64
  }, Z = (e) => `${o}-option-${e}`;
64
- let x;
65
- t === -1 && M ? x = `${o}-select-all` : t !== null && c[t] !== void 0 && (x = Z(t));
66
- const ge = (e, r) => {
67
- const k = K(e), q = Q(e);
68
- return ne({
69
- key: E ? String(E(e)) : `${j(e)}-${r}`,
70
- ref: (C) => {
71
- _.current[r] = C;
65
+ let A;
66
+ n === -1 && M ? A = `${o}-select-all` : n !== null && s[n] !== void 0 && (A = Z(n));
67
+ const ve = (e, r) => {
68
+ const k = H(e), T = Q(e);
69
+ return te({
70
+ key: j ? String(j(e)) : `${K(e)}-${r}`,
71
+ ref: (y) => {
72
+ _.current[r] = y;
72
73
  },
73
74
  role: "option",
74
75
  id: Z(r),
75
- "aria-selected": q,
76
+ "aria-selected": T,
76
77
  "aria-disabled": k || void 0,
77
- "data-active": t === r ? "" : void 0,
78
+ "data-active": n === r ? "" : void 0,
78
79
  className: U,
79
- onMouseDown: (C) => C.preventDefault(),
80
- onClick: (C) => O(C, e),
80
+ onMouseDown: (y) => y.preventDefault(),
81
+ onClick: (y) => O(y, e),
81
82
  onMouseMove: () => h(null)
82
83
  }, e, {
83
- selected: q,
84
+ selected: T,
84
85
  index: r,
85
- inputValue: s,
86
+ inputValue: c,
86
87
  inPicker: !0
87
88
  });
88
- }, xe = l ? S ? /* @__PURE__ */ n("li", {
89
- role: "presentation",
90
- className: re,
91
- children: oe
92
- }) : c.length === 0 ? /* @__PURE__ */ n("li", {
93
- role: "presentation",
94
- className: re,
95
- "data-testid": `${o}-picker-empty`,
96
- children: s === "" ? ae : a.noMatches
97
- }) : c.map(ge) : null, Ae = /* @__PURE__ */ n(De, {
89
+ }, xe = (() => {
90
+ if (!l) return null;
91
+ if (x) return /* @__PURE__ */ t("li", {
92
+ role: "presentation",
93
+ className: Le,
94
+ children: ne
95
+ });
96
+ if (s.length === 0) {
97
+ const e = c === "" ? oe : a.noMatches;
98
+ return /* @__PURE__ */ t("li", {
99
+ role: "presentation",
100
+ "data-testid": `${o}-picker-empty`,
101
+ className: "flex grow",
102
+ children: typeof e == "string" ? /* @__PURE__ */ t(De, { emptyText: e }) : e
103
+ });
104
+ }
105
+ return s.map(ve);
106
+ })(), be = l && !x && s.length === 0, Ae = /* @__PURE__ */ t(Se, {
98
107
  dataTest: `${o}-picker-search`,
99
108
  label: a.search,
100
- value: s,
109
+ value: c,
101
110
  fullWidth: !0,
102
111
  onChange: (e) => {
103
112
  $(e.target.value), h(null);
@@ -111,67 +120,67 @@ function ze({ open: l, dataTest: o, listboxId: u, title: N, name: v, text: a, op
111
120
  role: "combobox",
112
121
  "aria-controls": u,
113
122
  "aria-expanded": !0,
114
- "aria-activedescendant": x,
123
+ "aria-activedescendant": A,
115
124
  "aria-autocomplete": "list"
116
125
  } }
117
126
  });
118
- let P;
119
- return d ? P = /* @__PURE__ */ n(Re, {
127
+ let E;
128
+ return d ? E = /* @__PURE__ */ t(Pe, {
120
129
  dataTest: o,
121
130
  count: a.selectedCount(i.length),
122
- clearAllLabel: H ? a.clearAll : void 0,
131
+ clearAllLabel: B ? a.clearAll : void 0,
123
132
  clearAllShown: i.length > 0,
124
133
  doneLabel: a.done,
125
- onClearAll: () => V([], a.clearedAll),
126
- onDone: (e) => ue(e, i)
127
- }) : me && (P = /* @__PURE__ */ n(Le, {
134
+ onClearAll: () => P([], a.clearedAll),
135
+ onDone: (e) => de(e, i)
136
+ }) : fe && (E = /* @__PURE__ */ t(Ve, {
128
137
  dataTest: o,
129
138
  label: a.clearOne,
130
- onClear: de
131
- })), /* @__PURE__ */ n(Ie, {
139
+ onClear: ie
140
+ })), /* @__PURE__ */ t(_e, {
132
141
  open: l,
133
- onClose: fe,
142
+ onClose: ue,
134
143
  dataTest: `${o}-picker`,
135
- title: N,
136
- fallbackName: v,
144
+ title: D,
145
+ fallbackName: g,
137
146
  closeLabel: a.close,
138
147
  search: Ae,
139
- headerRow: P,
140
- announcement: ke,
141
- children: /* @__PURE__ */ A("ul", {
148
+ headerRow: E,
149
+ announcement: we,
150
+ children: /* @__PURE__ */ N("ul", {
142
151
  id: u,
143
152
  role: "listbox",
144
- "aria-label": v,
153
+ "aria-label": g,
145
154
  "aria-multiselectable": d || void 0,
146
155
  tabIndex: 0,
147
- "aria-activedescendant": x,
148
- onKeyDown: ve,
149
- onFocus: be,
150
- className: le("m-0 list-none p-0 [&>li:not(:last-child)]:shadow-[inset_0_-1px_0_var(--colors-delta-200)]", p.length > 0 && "outline-none", "[&>li[role=option]]:pr-4 [&>li[role=option]]:text-delta-700", d ? "[&>li[aria-selected=true]:not(:hover)]:bg-white" : "[&>li[aria-selected=true]:not([aria-disabled=true])]:bg-gama-25 [&>li[role=option]]:gap-x-1 [&>li[role=option]]:pl-2"),
151
- children: [M && /* @__PURE__ */ A("li", {
156
+ "aria-activedescendant": A,
157
+ onKeyDown: Ce,
158
+ onFocus: ge,
159
+ className: re("m-0 list-none p-0 [&>li:not(:last-child)]:shadow-[inset_0_-1px_0_var(--colors-delta-200)]", be && "flex grow flex-col", p.length > 0 && "outline-none", "[&>li[role=option]]:pr-4 [&>li[role=option]]:text-delta-700", d ? "[&>li[aria-selected=true]:not(:hover)]:bg-white" : "[&>li[aria-selected=true]:not([aria-disabled=true])]:bg-gama-25 [&>li[role=option]]:gap-x-1 [&>li[role=option]]:pl-2"),
160
+ children: [M && /* @__PURE__ */ N("li", {
152
161
  id: `${o}-select-all`,
153
162
  role: "option",
154
- "aria-selected": g,
155
- "data-active": t === -1 ? "" : void 0,
163
+ "aria-selected": b,
164
+ "data-active": n === -1 ? "" : void 0,
156
165
  tabIndex: -1,
157
166
  onMouseDown: (e) => e.preventDefault(),
158
167
  onClick: J,
159
168
  className: U,
160
169
  children: [
161
- t === -1 && /* @__PURE__ */ n("span", {
170
+ n === -1 && /* @__PURE__ */ t("span", {
162
171
  "aria-hidden": "true",
163
172
  className: "border-l-solid pointer-events-none absolute inset-y-0 left-0 border-l-[3px] border-focus-ring"
164
173
  }),
165
- /* @__PURE__ */ n(Ne, {
174
+ /* @__PURE__ */ t(Ne, {
166
175
  dataTest: `${o}-picker-select-all`,
167
- checked: g,
168
- indeterminate: i.length > 0 && !g,
176
+ checked: b,
177
+ indeterminate: i.length > 0 && !b,
169
178
  size: "medium",
170
179
  checkboxClassName: "!h-4 !w-4",
171
180
  hideWrapper: !0,
172
181
  decorative: !0
173
182
  }),
174
- /* @__PURE__ */ n("span", {
183
+ /* @__PURE__ */ t("span", {
175
184
  className: "min-w-0 flex-1 break-words",
176
185
  children: se
177
186
  })
@@ -180,40 +189,40 @@ function ze({ open: l, dataTest: o, listboxId: u, title: N, name: v, text: a, op
180
189
  })
181
190
  });
182
191
  }
183
- var Re = ({ dataTest: l, count: o, clearAllLabel: u, clearAllShown: N, doneLabel: v, onClearAll: a, onDone: f }) => /* @__PURE__ */ A("div", {
192
+ var Pe = ({ dataTest: l, count: o, clearAllLabel: u, clearAllShown: D, doneLabel: g, onClearAll: a, onDone: f }) => /* @__PURE__ */ N("div", {
184
193
  className: "flex flex-wrap items-center gap-x-6 gap-y-2 px-4 py-2",
185
194
  "data-testid": `${l}-picker-selection-row`,
186
- children: [/* @__PURE__ */ A("div", {
195
+ children: [/* @__PURE__ */ N("div", {
187
196
  className: "flex min-w-min flex-[1_1_0%] flex-wrap items-center gap-x-1",
188
- children: [/* @__PURE__ */ n("span", {
197
+ children: [/* @__PURE__ */ t("span", {
189
198
  className: "text-base text-delta-600",
190
199
  "data-testid": `${l}-picker-count`,
191
200
  children: o
192
- }), u !== void 0 && /* @__PURE__ */ n(B, {
201
+ }), u !== void 0 && /* @__PURE__ */ t(F, {
193
202
  dataTest: `${l}-picker-clear-all`,
194
203
  variant: "text",
195
- className: le(te, !N && "invisible"),
204
+ className: re(le, !D && "invisible"),
196
205
  onClick: a,
197
206
  children: u
198
207
  })]
199
- }), /* @__PURE__ */ n(B, {
208
+ }), /* @__PURE__ */ t(F, {
200
209
  dataTest: `${l}-picker-done`,
201
210
  variant: "contained",
202
211
  className: "ml-auto shrink-0 whitespace-nowrap",
203
212
  onClick: f,
204
- children: v
213
+ children: g
205
214
  })]
206
- }), Le = ({ dataTest: l, label: o, onClear: u }) => /* @__PURE__ */ n("div", {
215
+ }), Ve = ({ dataTest: l, label: o, onClear: u }) => /* @__PURE__ */ t("div", {
207
216
  className: "flex px-4 py-2",
208
217
  "data-testid": `${l}-picker-clear-row`,
209
- children: /* @__PURE__ */ n(B, {
218
+ children: /* @__PURE__ */ t(F, {
210
219
  dataTest: `${l}-picker-clear`,
211
220
  variant: "text",
212
- className: te,
221
+ className: le,
213
222
  onClick: u,
214
223
  children: o
215
224
  })
216
225
  });
217
226
  export {
218
- ze as SelectAutocompletePicker
227
+ Ge as SelectAutocompletePicker
219
228
  };
@@ -1,13 +1,25 @@
1
+ import { SortDirection, SortPreview } from '../../helpers/sortPreview';
1
2
  /**
2
3
  * The sort indicator slot of a sortable header (Figma "Header with sorting", the 20 × 28 `Sorting` frame).
3
- * It is decorative: `aria-sort` on the header cell carries the state. A sorted column always shows the
4
- * glyph in the primary colour; an unsorted one shows it, grey and pointing the way the next click will
5
- * sort, only while the header is hovered or keyboard-focused. The glyph is in the DOM either way; the
6
- * stylesheet gives the slot its 20px only while the column is sorted, hovered or keyboard-focused (UX, ASMA-8597,
7
- * comments 94750 and 94751), and collapses it to nothing otherwise.
4
+ * It is decorative: `aria-sort` on the header cell carries the state.
5
+ *
6
+ * It holds two glyphs, and the stylesheet shows one of them (ASMA-8597, UX round 3, 2026-11-02):
7
+ * - the **current** glyph, at rest, only while the column is sorted: its direction, in `gama-500`;
8
+ * - the **preview** glyph, while the header is hovered or keyboard-focused (`:hover`, `:focus-visible`): what the
9
+ * header will look like right after a plain click, worked out by `getSortPreview` (which mirrors TanStack's
10
+ * `toggleSorting`, multi-sort included). A sorted column whose click sorts again shows that direction, still in
11
+ * `gama-500`. One whose click removes the sort, and an unsorted one, show the grey glyph pointing the way the
12
+ * first click sorts (`getFirstSortDir()`). With Shift held the click multi-sorts instead; the preview still shows
13
+ * the plain click (a known limitation).
14
+ *
15
+ * CSS cannot know the next direction, so it comes in as a prop and is written to the DOM: both glyphs are always
16
+ * there and a data attribute says what each one is. The slot gets its 20px only while the column is sorted, hovered
17
+ * or keyboard-focused (UX, ASMA-8597, comments 94750 and 94751), and collapses to nothing otherwise.
8
18
  */
9
- export declare function SortIndicator({ sorted, nextDirection, }: {
10
- sorted: false | 'asc' | 'desc';
11
- /** Where a click sorts next: `column.getFirstSortDir()` for an unsorted column. */
12
- nextDirection: 'asc' | 'desc';
19
+ export declare function SortIndicator({ sorted, firstDirection, preview, }: {
20
+ sorted: false | SortDirection;
21
+ /** Where a first click sorts: `column.getFirstSortDir()`. */
22
+ firstDirection: SortDirection;
23
+ /** What the header looks like after a plain click: `getSortPreview(...)`. */
24
+ preview: SortPreview;
13
25
  }): JSX.Element;
@@ -0,0 +1,37 @@
1
+ export type SortDirection = 'asc' | 'desc';
2
+ /** What a sortable header previews while it is hovered or keyboard-focused. */
3
+ export interface SortPreview {
4
+ /** The way the previewed triangle points. */
5
+ direction: SortDirection;
6
+ /** `true`: the primary colour, the header will be sorted this way. `false`: grey, the unsorted look. */
7
+ primary: boolean;
8
+ }
9
+ interface SortPreviewInput {
10
+ /** `column.getIsSorted()`. */
11
+ sorted: false | SortDirection;
12
+ /** `column.getFirstSortDir()`. */
13
+ firstDirection: SortDirection;
14
+ /** `column.getNextSortingOrder()`: what a sort toggle does to this column; `false` removes it. */
15
+ nextOrder: false | SortDirection;
16
+ /** Whether this column is the last entry of the sorting state (`sorting.at(-1)`). */
17
+ isLastSortEntry: boolean;
18
+ }
19
+ /**
20
+ * What the header will look like right after a plain click (no Shift), for the hover and focus preview
21
+ * (ASMA-8597, UX round 3, 2026-11-02). It mirrors `column.toggleSorting(undefined, false)` of TanStack Table 8.21,
22
+ * which `getToggleSortingHandler` calls for a click:
23
+ *
24
+ * - A column that is not sorted previews the way its first click sorts, in grey: UX keeps the unsorted look
25
+ * (the click then sorts it that way, or replaces a sort on other columns by it).
26
+ * - A sorted column that is **not the last** entry of the sorting takes the `'replace'` branch (a plain click on
27
+ * one column of a multi-sort drops the others): the whole sorting becomes this column alone with
28
+ * `desc: nextSortingOrder === 'desc'`. It is **never removed**, so a `false` next order (the removal) becomes
29
+ * ascending, in the primary colour.
30
+ * - A sorted column that is the last (or only) entry takes the `'toggle'` branch: it flips to
31
+ * `getNextSortingOrder()`, or is removed when that is `false`, which previews as the grey first direction.
32
+ *
33
+ * Known limitation: with Shift held the click multi-sorts instead (`'add'` or `'toggle'` in place). The preview
34
+ * still shows the plain click, because a key held while hovering is not tracked.
35
+ */
36
+ export declare function getSortPreview({ sorted, firstDirection, nextOrder, isLastSortEntry }: SortPreviewInput): SortPreview;
37
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,63 +1,66 @@
1
- var e = "_tbody_zh7v2_125", _ = "_expanded_row_zh7v2_178", l = "_selected_zh7v2_203", t = "_shadowed_zh7v2_228", a = "_resizer_zh7v2_285", o = "_isResizing_zh7v2_305", r = {
2
- "asma-ui-table-styled-table": "_asma-ui-table-styled-table_zh7v2_1",
3
- "table-wrapper": "_table-wrapper_zh7v2_27",
4
- "table-shell": "_table-shell_zh7v2_34",
5
- "table-wrapper--no-rows": "_table-wrapper--no-rows_zh7v2_40",
6
- "table-wrapper--proxy": "_table-wrapper--proxy_zh7v2_43",
7
- "table-wrapper--proxy-bottom": "_table-wrapper--proxy-bottom_zh7v2_44",
8
- "table-wrapper-fetching": "_table-wrapper-fetching_zh7v2_54",
9
- "table-scroll": "_table-scroll_zh7v2_57",
10
- "table-x--fill-height": "_table-x--fill-height_zh7v2_66",
11
- "table-x": "_table-x_zh7v2_66",
12
- "table-content": "_table-content_zh7v2_81",
13
- "table-header--sticky": "_table-header--sticky_zh7v2_86",
14
- "table-hscroll": "_table-hscroll_zh7v2_91",
15
- "table-hscroll__content": "_table-hscroll__content_zh7v2_101",
16
- "no-rows-overlay-container": "_no-rows-overlay-container_zh7v2_104",
17
- "no-rows-overlay-content": "_no-rows-overlay-content_zh7v2_112",
18
- "styled-table": "_styled-table_zh7v2_116",
19
- tbody: e,
20
- "loading-icon": "_loading-icon_zh7v2_130",
21
- "t-row": "_t-row_zh7v2_137",
22
- "t-cell": "_t-cell_zh7v2_137",
23
- "action-cell": "_action-cell_zh7v2_150",
24
- "fixed-cell": "_fixed-cell_zh7v2_154",
25
- "fixed-right-cell": "_fixed-right-cell_zh7v2_157",
26
- expanded_row: _,
27
- "data-cell": "_data-cell_zh7v2_190",
28
- "select-cell": "_select-cell_zh7v2_200",
29
- selected: l,
30
- "single-selection": "_single-selection_zh7v2_206",
31
- "action-cell--no-shadow": "_action-cell--no-shadow_zh7v2_224",
32
- shadowed: t,
33
- "shadowed-right": "_shadowed-right_zh7v2_264",
34
- "is-loading": "_is-loading_zh7v2_269",
35
- "action-cell-default-background": "_action-cell-default-background_zh7v2_272",
36
- "fixed-cell-default-background": "_fixed-cell-default-background_zh7v2_275",
37
- "fixed-right-cell-default-background": "_fixed-right-cell-default-background_zh7v2_278",
38
- "sortable-column": "_sortable-column_zh7v2_281",
39
- resizer: a,
40
- isResizing: o,
41
- "hide-table-header": "_hide-table-header_zh7v2_319",
42
- "show-table-header": "_show-table-header_zh7v2_323",
43
- "table-header": "_table-header_zh7v2_86",
44
- "has-resize-zone": "_has-resize-zone_zh7v2_366",
45
- "hide-header": "_hide-header_zh7v2_369",
46
- "t-cell__actions": "_t-cell__actions_zh7v2_372",
47
- "t-cell__actions--no-shadow": "_t-cell__actions--no-shadow_zh7v2_381",
48
- "t-cell__fixed": "_t-cell__fixed_zh7v2_386",
49
- "t-cell__fixed-right": "_t-cell__fixed-right_zh7v2_394",
50
- "sort-indicator": "_sort-indicator_zh7v2_402",
51
- "sort-glyph": "_sort-glyph_zh7v2_412",
52
- "sort-indicator--sorted": "_sort-indicator--sorted_zh7v2_416",
53
- "header-content": "_header-content_zh7v2_447",
54
- "table-footer--sticky": "_table-footer--sticky_zh7v2_491",
55
- "table-footer--inline": "_table-footer--inline_zh7v2_502",
56
- "table-bottom": "_table-bottom_zh7v2_513",
57
- "table-bottom--sticky": "_table-bottom--sticky_zh7v2_527",
58
- "cursor-not-allowed": "_cursor-not-allowed_zh7v2_531",
59
- "select-control": "_select-control_zh7v2_535"
1
+ var l = "_tbody_romlq_125", e = "_expanded_row_romlq_178", _ = "_selected_romlq_203", o = "_shadowed_romlq_228", r = "_resizer_romlq_285", t = "_isResizing_romlq_306", a = {
2
+ "asma-ui-table-styled-table": "_asma-ui-table-styled-table_romlq_1",
3
+ "table-wrapper": "_table-wrapper_romlq_27",
4
+ "table-shell": "_table-shell_romlq_34",
5
+ "table-wrapper--no-rows": "_table-wrapper--no-rows_romlq_40",
6
+ "table-wrapper--proxy": "_table-wrapper--proxy_romlq_43",
7
+ "table-wrapper--proxy-bottom": "_table-wrapper--proxy-bottom_romlq_44",
8
+ "table-wrapper-fetching": "_table-wrapper-fetching_romlq_54",
9
+ "table-scroll": "_table-scroll_romlq_57",
10
+ "table-x--fill-height": "_table-x--fill-height_romlq_66",
11
+ "table-x": "_table-x_romlq_66",
12
+ "table-content": "_table-content_romlq_81",
13
+ "table-header--sticky": "_table-header--sticky_romlq_86",
14
+ "table-hscroll": "_table-hscroll_romlq_91",
15
+ "table-hscroll__content": "_table-hscroll__content_romlq_101",
16
+ "no-rows-overlay-container": "_no-rows-overlay-container_romlq_104",
17
+ "no-rows-overlay-content": "_no-rows-overlay-content_romlq_112",
18
+ "styled-table": "_styled-table_romlq_116",
19
+ tbody: l,
20
+ "loading-icon": "_loading-icon_romlq_130",
21
+ "t-row": "_t-row_romlq_137",
22
+ "t-cell": "_t-cell_romlq_137",
23
+ "action-cell": "_action-cell_romlq_150",
24
+ "fixed-cell": "_fixed-cell_romlq_154",
25
+ "fixed-right-cell": "_fixed-right-cell_romlq_157",
26
+ expanded_row: e,
27
+ "data-cell": "_data-cell_romlq_190",
28
+ "select-cell": "_select-cell_romlq_200",
29
+ selected: _,
30
+ "single-selection": "_single-selection_romlq_206",
31
+ "action-cell--no-shadow": "_action-cell--no-shadow_romlq_224",
32
+ shadowed: o,
33
+ "shadowed-right": "_shadowed-right_romlq_264",
34
+ "is-loading": "_is-loading_romlq_269",
35
+ "action-cell-default-background": "_action-cell-default-background_romlq_272",
36
+ "fixed-cell-default-background": "_fixed-cell-default-background_romlq_275",
37
+ "fixed-right-cell-default-background": "_fixed-right-cell-default-background_romlq_278",
38
+ "sortable-column": "_sortable-column_romlq_281",
39
+ resizer: r,
40
+ isResizing: t,
41
+ "hide-table-header": "_hide-table-header_romlq_327",
42
+ "show-table-header": "_show-table-header_romlq_331",
43
+ "table-header": "_table-header_romlq_86",
44
+ "has-resize-zone": "_has-resize-zone_romlq_374",
45
+ "hide-header": "_hide-header_romlq_377",
46
+ "t-cell__actions": "_t-cell__actions_romlq_380",
47
+ "t-cell__actions--no-shadow": "_t-cell__actions--no-shadow_romlq_389",
48
+ "t-cell__fixed": "_t-cell__fixed_romlq_394",
49
+ "t-cell__fixed-right": "_t-cell__fixed-right_romlq_402",
50
+ "sort-indicator": "_sort-indicator_romlq_410",
51
+ "sort-glyph": "_sort-glyph_romlq_420",
52
+ "sort-indicator--sorted": "_sort-indicator--sorted_romlq_425",
53
+ "sort-glyph--current": "_sort-glyph--current_romlq_434",
54
+ "sort-indicator--preview-primary": "_sort-indicator--preview-primary_romlq_440",
55
+ "sort-glyph--preview": "_sort-glyph--preview_romlq_446",
56
+ "header-content": "_header-content_romlq_466",
57
+ "table-footer--sticky": "_table-footer--sticky_romlq_510",
58
+ "table-footer--inline": "_table-footer--inline_romlq_521",
59
+ "table-bottom": "_table-bottom_romlq_532",
60
+ "table-bottom--sticky": "_table-bottom--sticky_romlq_546",
61
+ "cursor-not-allowed": "_cursor-not-allowed_romlq_550",
62
+ "select-control": "_select-control_romlq_554"
60
63
  };
61
64
  export {
62
- r as default
65
+ a as default
63
66
  };
@@ -1,23 +1,30 @@
1
- import t from "../StyledTable.module.js";
2
- import { DropUpIcon as e } from "../../shared-components/DropUpIcon.js";
3
- import { DropDownIcon as s } from "../../shared-components/DropDownIcon.js";
4
- import c from "clsx";
5
- import { jsx as a } from "react/jsx-runtime";
6
- function h({ sorted: o, nextDirection: i }) {
7
- const r = o || i, n = r === "asc" ? e : s;
8
- return /* @__PURE__ */ a("span", {
1
+ import r from "../StyledTable.module.js";
2
+ import { DropUpIcon as s } from "../../shared-components/DropUpIcon.js";
3
+ import { DropDownIcon as n } from "../../shared-components/DropDownIcon.js";
4
+ import e from "clsx";
5
+ import { jsx as c, jsxs as m } from "react/jsx-runtime";
6
+ function g({ sorted: t, firstDirection: p, preview: o }) {
7
+ const i = t || p, a = o.primary, l = i === "asc" ? s : n, d = o.direction === "asc" ? s : n;
8
+ return /* @__PURE__ */ m("span", {
9
9
  "aria-hidden": "true",
10
- className: c(t["sort-indicator"], o && t["sort-indicator--sorted"]),
11
- "data-sort-direction": r,
12
- "data-sort-state": o || "none",
13
- children: /* @__PURE__ */ a(n, {
14
- className: t["sort-glyph"],
10
+ className: e(r["sort-indicator"], t && r["sort-indicator--sorted"], a && r["sort-indicator--preview-primary"]),
11
+ "data-sort-direction": i,
12
+ "data-sort-state": t || "none",
13
+ "data-preview-direction": o.direction,
14
+ "data-preview-tone": a ? "primary" : "neutral",
15
+ children: [/* @__PURE__ */ c(l, {
16
+ className: e(r["sort-glyph"], r["sort-glyph--current"]),
15
17
  focusable: "false",
16
18
  height: 28,
17
19
  width: 28
18
- })
20
+ }), /* @__PURE__ */ c(d, {
21
+ className: e(r["sort-glyph"], r["sort-glyph--preview"]),
22
+ focusable: "false",
23
+ height: 28,
24
+ width: 28
25
+ })]
19
26
  });
20
27
  }
21
28
  export {
22
- h as SortIndicator
29
+ g as SortIndicator
23
30
  };