@ogcio/design-system-react 1.13.0 → 1.15.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.
Files changed (55) hide show
  1. package/dist/autocomplete/autocomplete.d.ts +21 -3
  2. package/dist/autocomplete/autocomplete.js +208 -159
  3. package/dist/autocomplete/types.d.ts +8 -4
  4. package/dist/autocomplete/types.js +2 -1
  5. package/dist/autocomplete/use-autocomplete-controller.d.ts +4 -2
  6. package/dist/autocomplete/use-autocomplete-controller.js +123 -79
  7. package/dist/button/button.js +27 -22
  8. package/dist/data-grid/data-grid-footer.d.ts +12 -0
  9. package/dist/data-grid/data-grid-footer.js +66 -0
  10. package/dist/data-grid/data-grid-header.d.ts +12 -0
  11. package/dist/data-grid/data-grid-header.js +82 -0
  12. package/dist/header/components/header-slot.js +34 -31
  13. package/dist/header/helper.d.ts +0 -1
  14. package/dist/header/helper.js +37 -62
  15. package/dist/hooks/use-combined-refs.d.ts +5 -0
  16. package/dist/hooks/use-combined-refs.js +10 -0
  17. package/dist/hooks/use-scroll-highlighted-item.d.ts +1 -0
  18. package/dist/hooks/use-scroll-highlighted-item.js +16 -0
  19. package/dist/icon/icon.js +15 -15
  20. package/dist/icon-button/icon-button.js +14 -12
  21. package/dist/index.d.ts +5 -2
  22. package/dist/index.js +68 -63
  23. package/dist/list/list.js +1 -1
  24. package/dist/modal/modal.d.ts +8 -2
  25. package/dist/modal/modal.js +155 -134
  26. package/dist/popover/popover.d.ts +1 -1
  27. package/dist/popover/popover.js +296 -286
  28. package/dist/popover/types.d.ts +1 -0
  29. package/dist/popover/utilities.d.ts +2 -0
  30. package/dist/popover/utilities.js +16 -0
  31. package/dist/primitives/button.d.ts +3 -0
  32. package/dist/primitives/button.js +9 -0
  33. package/dist/select/select-menu.d.ts +2 -2
  34. package/dist/select/select-menu.js +96 -99
  35. package/dist/select/select-next.d.ts +13 -2
  36. package/dist/select/select-next.js +182 -167
  37. package/dist/select/select-search.js +17 -17
  38. package/dist/select/types.d.ts +3 -1
  39. package/dist/styles.css +1 -1
  40. package/dist/table/table-data.js +1 -1
  41. package/dist/tabs/scrollable-tab-list.d.ts +9 -0
  42. package/dist/tabs/scrollable-tab-list.js +84 -0
  43. package/dist/tabs/tab-item.d.ts +9 -15
  44. package/dist/tabs/tab-item.js +85 -38
  45. package/dist/tabs/tab-list.d.ts +2 -5
  46. package/dist/tabs/tab-list.js +83 -49
  47. package/dist/tabs/tab-panel.d.ts +2 -7
  48. package/dist/tabs/tab-panel.js +2 -5
  49. package/dist/tabs/tabs.d.ts +2 -7
  50. package/dist/tabs/tabs.js +24 -20
  51. package/dist/tabs/types.d.ts +64 -0
  52. package/dist/tabs/types.js +1 -0
  53. package/dist/textarea/textarea.d.ts +1 -2
  54. package/dist/textarea/textarea.js +60 -61
  55. package/package.json +4 -4
@@ -1,31 +1,36 @@
1
- import { l as B } from "../lodash-D1c5hFAM.js";
2
- import { useRef as _, useMemo as v, Children as x, useReducer as R, useEffect as y, isValidElement as U } from "react";
3
- import { AUTOCOMPLETE_ACTIONS as w } from "./types.js";
1
+ import { l as D } from "../lodash-D1c5hFAM.js";
2
+ import { useRef as O, useMemo as v, Children as V, useReducer as F, useEffect as T, isValidElement as g, cloneElement as X } from "react";
3
+ import { useScrollHighlightedItem as Y } from "../hooks/use-scroll-highlighted-item.js";
4
+ import { AUTOCOMPLETE_ACTIONS as j } from "./types.js";
4
5
  const {
5
- ON_RESET: V,
6
- ON_SELECT_ITEM: C,
7
- SET_INPUT_VALUE: L,
8
- SET_IS_OPEN: f,
9
- SET_OPTIONS: c,
10
- TOGGLE_CLEAR_BUTTON: b,
11
- SET_VALUE: E,
12
- SET_HIGHLIGHTED_INDEX: G
13
- } = w, M = (e, t) => {
6
+ ON_RESET: R,
7
+ ON_SELECT_ITEM: k,
8
+ SET_INPUT_VALUE: P,
9
+ SET_IS_OPEN: G,
10
+ SET_OPTIONS: _,
11
+ TOGGLE_CLEAR_BUTTON: U,
12
+ SET_VALUE: w,
13
+ SET_HIGHLIGHTED_INDEX: S,
14
+ SET_OPTION_TYPE: H
15
+ } = j, q = (e, t) => {
14
16
  switch (t.type) {
15
- case f:
17
+ case G:
16
18
  return { ...e, isOpen: t.payload };
17
- case L:
19
+ case P:
18
20
  return { ...e, inputValue: t.payload };
19
- case c:
20
- return { ...e, autocompleteOptions: t.payload || [] };
21
- case E:
21
+ case _:
22
+ return {
23
+ ...e,
24
+ autocompleteOptions: t.payload || []
25
+ };
26
+ case w:
22
27
  return { ...e, value: t.payload };
23
- case b:
28
+ case U:
24
29
  return {
25
30
  ...e,
26
31
  isClearButtonEnabled: t.payload || !!e.inputValue
27
32
  };
28
- case V:
33
+ case R:
29
34
  return {
30
35
  ...e,
31
36
  value: "",
@@ -33,7 +38,7 @@ const {
33
38
  isClearButtonEnabled: !1,
34
39
  highlightedIndex: -1
35
40
  };
36
- case C:
41
+ case k:
37
42
  return {
38
43
  ...e,
39
44
  inputValue: t.payload.inputValue,
@@ -41,85 +46,124 @@ const {
41
46
  isOpen: !1,
42
47
  isClearButtonEnabled: !0
43
48
  };
44
- case G:
45
- return { ...e, highlightedIndex: t.payload, isOpen: !0 };
49
+ case S:
50
+ return { ...e, highlightedIndex: t.payload };
51
+ case H:
52
+ return { ...e, optionType: t.payload };
46
53
  default:
47
54
  return e;
48
55
  }
49
- }, P = (e) => {
50
- var p, r;
51
- const t = ((p = e == null ? void 0 : e.type) == null ? void 0 : p.componentType) || ((r = e == null ? void 0 : e.props) == null ? void 0 : r.__mdxType);
52
- return U(e) && t === "AutocompleteItem";
53
- }, H = (e, t) => {
54
- var i, a;
55
- const p = ((i = e.props.children) == null ? void 0 : i.toString().toLowerCase()) || "", r = (a = e.props.value) == null ? void 0 : a.toLowerCase(), o = t.toLowerCase();
56
- return p.includes(o) || r.includes(o);
57
- }, S = (e) => x.toArray(e).filter((t) => P(t)) || [], I = (e, t) => {
58
- var p;
59
- return (((p = S(e).find((r) => r.props.value === t)) == null ? void 0 : p.props.children) || "").toString();
60
- }, X = ({
56
+ }, z = (e) => {
57
+ var s, p;
58
+ const t = ((s = e == null ? void 0 : e.type) == null ? void 0 : s.componentType) || ((p = e == null ? void 0 : e.props) == null ? void 0 : p.__mdxType);
59
+ return g(e) && (t === "AutocompleteItem" || t === "AutocompleteGroupItem");
60
+ }, h = (e, t) => {
61
+ var a, u;
62
+ const s = ((a = e.props.children) == null ? void 0 : a.toString().toLowerCase()) || "", p = (u = e.props.value) == null ? void 0 : u.toLowerCase(), l = t.toLowerCase();
63
+ return s.includes(l) || p.includes(l);
64
+ }, L = (e) => V.toArray(e).filter((t) => z(t)) || [], C = (e, t) => {
65
+ var p, l, a, u, d, f;
66
+ const s = L(e);
67
+ for (const y of s) {
68
+ const i = ((p = y.type) == null ? void 0 : p.componentType) || ((l = y.props) == null ? void 0 : l.__mdxType);
69
+ if (((a = y.props) == null ? void 0 : a.value) === t)
70
+ return ((u = y.props.children) == null ? void 0 : u.toString()) || "";
71
+ if (i === "AutocompleteGroupItem") {
72
+ const E = V.toArray(y.props.children).filter(
73
+ (n) => g(n)
74
+ );
75
+ for (const n of E)
76
+ if (((d = n.props) == null ? void 0 : d.value) === t)
77
+ return ((f = n.props.children) == null ? void 0 : f.toString()) || "";
78
+ }
79
+ }
80
+ return "";
81
+ }, J = (e) => {
82
+ const t = L(e);
83
+ return t != null && t.length && t.every(
84
+ (p) => {
85
+ var l;
86
+ return p.props.__mdxType === "AutocompleteGroupItem" || ((l = p.type) == null ? void 0 : l.componentType) === "AutocompleteGroupItem";
87
+ }
88
+ ) ? "AutocompleteGroupItem" : "AutocompleteItem";
89
+ }, te = ({
61
90
  children: e,
62
91
  defaultValue: t = "",
63
- isOpen: p = !1,
64
- freeSolo: r = !1,
65
- onOpen: o,
66
- onClose: i,
67
- onChange: a
92
+ isOpen: s = !1,
93
+ freeSolo: p = !1,
94
+ onOpen: l,
95
+ onClose: a,
96
+ onChange: u
68
97
  }) => {
69
- const d = _(null), T = _(!1), n = v(
70
- () => S(e || []),
98
+ const d = O(null), f = O(null), y = O(!1), i = v(
99
+ () => L(e || []),
71
100
  [e]
72
- ), O = () => {
73
- var s;
74
- return (s = d.current) == null ? void 0 : s.focus();
75
- }, [u, l] = R(M, null, () => ({
76
- isOpen: !!p,
101
+ ), E = () => {
102
+ var c;
103
+ return (c = d.current) == null ? void 0 : c.focus();
104
+ }, n = v(() => J(e), [e]), [o, r] = F(q, null, () => ({
105
+ isOpen: !!s,
77
106
  value: t,
78
107
  inputValue: t,
79
- autocompleteOptions: n,
108
+ autocompleteOptions: i,
80
109
  isClearButtonEnabled: !1,
81
- highlightedIndex: -1
110
+ highlightedIndex: -1,
111
+ optionType: n
82
112
  }));
83
- y(() => {
84
- l({ type: c, payload: n });
85
- }, [n]), y(() => {
86
- if (!T.current) {
87
- T.current = !0;
113
+ Y(f, o.highlightedIndex), T(() => {
114
+ r({ type: _, payload: i });
115
+ }, [i]), T(() => {
116
+ r({ type: H, payload: n });
117
+ }, [n]), T(() => {
118
+ if (!y.current) {
119
+ y.current = !0;
88
120
  return;
89
121
  }
90
- u.inputValue === "" && u.value === "" && O();
91
- }, [u.isClearButtonEnabled]), y(() => {
92
- if (u.isOpen)
93
- o == null || o(), O();
122
+ o.inputValue === "" && o.value === "" && E();
123
+ }, [o.isClearButtonEnabled]), T(() => {
124
+ if (o.isOpen)
125
+ l == null || l(), E();
94
126
  else {
95
- i == null || i();
96
- const s = I(e, u.value);
97
- s && u.value ? (l({
98
- type: L,
99
- payload: s
100
- }), l({ type: f, payload: !1 }), a == null || a(s, d)) : r || (l({ type: V }), a == null || a("", d)), l({ type: b });
127
+ a == null || a();
128
+ const c = C(e, o.value);
129
+ c && o.value ? (r({
130
+ type: P,
131
+ payload: c
132
+ }), r({ type: G, payload: !1 }), u == null || u(o.value)) : p || (r({ type: R }), u == null || u("")), r({ type: U });
101
133
  }
102
- }, [u.isOpen]);
103
- const m = v(
104
- () => B.debounce((s) => {
105
- if (s) {
106
- const A = n.filter(
107
- (N) => H(N, s)
108
- );
109
- l({ type: c, payload: A }), !u.isOpen && !u.value && l({ type: f, payload: !0 }), r && l({ type: E, payload: "" });
134
+ }, [o.isOpen]);
135
+ const b = v(
136
+ () => D.debounce((c) => {
137
+ if (c) {
138
+ const I = i.map((m) => {
139
+ var x, N;
140
+ const M = ((x = m.type) == null ? void 0 : x.componentType) || ((N = m.props) == null ? void 0 : N.__mdxType);
141
+ if (n === "AutocompleteGroupItem" && M === "AutocompleteGroupItem") {
142
+ const B = V.toArray(
143
+ m.props.children
144
+ ).filter((A) => g(A)).filter(
145
+ (A) => h(A, c)
146
+ );
147
+ return B.length > 0 ? X(m, { children: B }) : null;
148
+ } else if (n === "AutocompleteItem")
149
+ return h(m, c) ? m : null;
150
+ return null;
151
+ }).filter(Boolean);
152
+ r({ type: _, payload: I }), r({ type: S, payload: -1 }), (!o.isOpen && !o.value || (I == null ? void 0 : I.length) === 0) && r({ type: G, payload: !0 });
110
153
  } else
111
- l({ type: E, payload: "" }), l({ type: c, payload: n });
154
+ r({ type: w, payload: "" }), r({ type: _, payload: i }), r({ type: S, payload: -1 });
112
155
  }, 500),
113
- [n, u.isOpen, u.value, r]
156
+ [i, o.isOpen, o.value, p]
114
157
  );
115
- return y(() => (m(u.inputValue), () => m.cancel()), [u.inputValue]), {
116
- state: u,
117
- dispatch: l,
158
+ return T(() => (b(o.inputValue), () => b.cancel()), [o.inputValue]), {
159
+ state: o,
160
+ dispatch: r,
118
161
  inputRef: d,
119
- validChildren: n,
120
- getOptionLabelByValue: I
162
+ listRef: f,
163
+ validChildren: i,
164
+ getOptionLabelByValue: C
121
165
  };
122
166
  };
123
167
  export {
124
- X as useAutocompleteController
168
+ te as useAutocompleteController
125
169
  };
@@ -1,38 +1,43 @@
1
1
  "use client";
2
- import { jsx as u } from "react/jsx-runtime";
3
- import { forwardRef as f } from "react";
4
- import { cn as p } from "../cn.js";
5
- import { isButtonDisabled as c, getSizeClass as g, getVariantAppearanceClass as l } from "./helpers.js";
6
- const B = f(
2
+ import { jsx as l } from "react/jsx-runtime";
3
+ import { forwardRef as p } from "react";
4
+ import { cn as u } from "../cn.js";
5
+ import { getSizeClass as c, isButtonDisabled as b, getVariantAppearanceClass as B } from "./helpers.js";
6
+ const r = p(
7
7
  ({
8
- variant: o,
9
- appearance: r,
10
- size: e,
8
+ variant: e,
9
+ appearance: o,
10
+ size: a,
11
11
  disabled: t,
12
- className: i,
12
+ className: n,
13
13
  children: s,
14
- dataTestid: m,
15
- ...n
16
- }, a) => /* @__PURE__ */ u(
14
+ dataTestid: i,
15
+ ...m
16
+ }, f) => /* @__PURE__ */ l(
17
17
  "button",
18
18
  {
19
- ...n,
20
- "data-testid": m || "govie-button",
21
- ref: a,
19
+ ...m,
20
+ "data-testid": i,
21
+ ref: f,
22
22
  "aria-disabled": t,
23
23
  disabled: t,
24
- className: p(
24
+ className: u(
25
25
  "gi-btn",
26
- l({ disabled: t, variant: o, appearance: r }),
27
- g(e),
28
- c({ disabled: t, variant: o, appearance: r }),
29
- i
26
+ B({ disabled: t, variant: e, appearance: o }),
27
+ b({ disabled: t, variant: e, appearance: o }),
28
+ c(a),
29
+ n
30
30
  ),
31
31
  children: s
32
32
  }
33
33
  )
34
34
  );
35
- B.displayName = "Button";
35
+ r.displayName = "Button";
36
+ Object.defineProperty(r, "componentType", {
37
+ value: "Button",
38
+ writable: !1,
39
+ enumerable: !1
40
+ });
36
41
  export {
37
- B as Button
42
+ r as Button
38
43
  };
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ interface DataGridFooterTypeProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ children: React.ReactNode;
4
+ }
5
+ interface DataGridFooterProps extends React.HTMLAttributes<HTMLDivElement> {
6
+ children?: React.ReactNode;
7
+ }
8
+ export type { DataGridFooterProps, DataGridFooterTypeProps };
9
+ export declare const DataGridFooterStart: React.FC<DataGridFooterTypeProps>;
10
+ export declare const DataGridFooterCenter: React.FC<DataGridFooterTypeProps>;
11
+ export declare const DataGridFooterEnd: React.FC<DataGridFooterTypeProps>;
12
+ export declare const DataGridFooter: React.FC<DataGridFooterProps>;
@@ -0,0 +1,66 @@
1
+ import { jsx as s, jsxs as E } from "react/jsx-runtime";
2
+ import i from "react";
3
+ import { cn as l } from "../cn.js";
4
+ const n = (t, e) => i.isValidElement(t) && t.type === e, o = (t, e, a) => t ? /* @__PURE__ */ s(
5
+ "div",
6
+ {
7
+ className: l(
8
+ e,
9
+ a,
10
+ t.props.className
11
+ ),
12
+ style: t.props.style,
13
+ children: t.props.children
14
+ }
15
+ ) : null, F = ({
16
+ children: t,
17
+ ...e
18
+ }) => /* @__PURE__ */ s("div", { ...e, children: t });
19
+ F.displayName = "DataGridFooterStart";
20
+ const D = ({
21
+ children: t,
22
+ ...e
23
+ }) => /* @__PURE__ */ s("div", { ...e, children: t });
24
+ D.displayName = "DataGridFooterCenter";
25
+ const G = ({
26
+ children: t,
27
+ ...e
28
+ }) => /* @__PURE__ */ s("div", { ...e, children: t });
29
+ G.displayName = "DataGridFooterEnd";
30
+ const N = ({
31
+ children: t,
32
+ className: e,
33
+ ...a
34
+ }) => {
35
+ const C = i.useMemo(() => {
36
+ let f = null, u = null, y = null;
37
+ return i.Children.forEach(t, (r) => {
38
+ n(r, F) ? f = r : n(r, D) ? u = r : n(r, G) && (y = r);
39
+ }), { start: f, center: u, end: y };
40
+ }, [t]), { start: d, center: c, end: m } = C, p = !!!d && !!!c && !!m, g = "gi-grow gi-basis-0 gi-min-w-0", S = `${g} gi-text-center`, x = l("gi-min-w-0", {
41
+ "gi-basis-1/2 gi-text-right": !p
42
+ });
43
+ return /* @__PURE__ */ E(
44
+ "div",
45
+ {
46
+ ...a,
47
+ className: l(
48
+ "gi-flex gi-flex-row gi-w-full gi-items-center gi-py-2",
49
+ p ? "gi-justify-end" : "gi-gap-2",
50
+ e
51
+ ),
52
+ children: [
53
+ o(d, g),
54
+ o(c, S),
55
+ o(m, x)
56
+ ]
57
+ }
58
+ );
59
+ };
60
+ N.displayName = "DataGridFooter";
61
+ export {
62
+ N as DataGridFooter,
63
+ D as DataGridFooterCenter,
64
+ G as DataGridFooterEnd,
65
+ F as DataGridFooterStart
66
+ };
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ interface DataGridHeaderTypeProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ children: React.ReactNode;
4
+ }
5
+ interface DataGridHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
6
+ children?: React.ReactNode;
7
+ }
8
+ export declare const DataGridHeader: React.FC<DataGridHeaderProps>;
9
+ export declare const DataGridHeaderSearch: React.FC<DataGridHeaderTypeProps>;
10
+ export declare const DataGridHeaderFilter: React.FC<DataGridHeaderTypeProps>;
11
+ export declare const DataGridHeaderActions: React.FC<DataGridHeaderTypeProps>;
12
+ export {};
@@ -0,0 +1,82 @@
1
+ import { jsxs as D, jsx as n } from "react/jsx-runtime";
2
+ import s from "react";
3
+ import { cn as i } from "../cn.js";
4
+ const l = (e, a) => s.isValidElement(e) && e.type === a, u = ({
5
+ children: e,
6
+ className: a,
7
+ ...r
8
+ }) => {
9
+ const { search: g, filter: b, actions: y } = s.useMemo(() => {
10
+ let f = null, m = null, p = null;
11
+ return s.Children.forEach(e, (t) => {
12
+ l(t, o) ? f = t : l(t, d) ? m = t : l(t, c) && (p = t);
13
+ }), { search: f, filter: m, actions: p };
14
+ }, [e]);
15
+ return /* @__PURE__ */ D(
16
+ "div",
17
+ {
18
+ ...r,
19
+ className: i(
20
+ "gi-flex gi-flex-wrap gi-items-center gi-w-full gi-gap-4 gi-mb-2",
21
+ a
22
+ ),
23
+ children: [
24
+ g,
25
+ b,
26
+ y
27
+ ]
28
+ }
29
+ );
30
+ };
31
+ u.displayName = "DataGridHeader";
32
+ Object.defineProperty(u, "componentType", {
33
+ value: "DataGridHeader",
34
+ writable: !1,
35
+ enumerable: !1
36
+ });
37
+ const o = ({
38
+ children: e,
39
+ className: a,
40
+ ...r
41
+ }) => /* @__PURE__ */ n("div", { className: i("gi-flex gi-flex-1", a), ...r, children: e });
42
+ o.displayName = "DataGridHeaderSearch";
43
+ Object.defineProperty(o, "componentType", {
44
+ value: "DataGridHeaderSearch",
45
+ writable: !1,
46
+ enumerable: !1
47
+ });
48
+ const d = ({
49
+ children: e,
50
+ className: a,
51
+ ...r
52
+ }) => /* @__PURE__ */ n("div", { className: i("gi-flex gi-items-center", a), ...r, children: e });
53
+ d.displayName = "DataGridHeaderFilter";
54
+ Object.defineProperty(d, "componentType", {
55
+ value: "DataGridHeaderFilter",
56
+ writable: !1,
57
+ enumerable: !1
58
+ });
59
+ const c = ({
60
+ children: e,
61
+ className: a,
62
+ ...r
63
+ }) => /* @__PURE__ */ n(
64
+ "div",
65
+ {
66
+ className: i("gi-flex gi-items-center gi-ml-auto", a),
67
+ ...r,
68
+ children: e
69
+ }
70
+ );
71
+ c.displayName = "DataGridHeaderActions";
72
+ Object.defineProperty(c, "componentType", {
73
+ value: "DataGridHeaderActions",
74
+ writable: !1,
75
+ enumerable: !1
76
+ });
77
+ export {
78
+ u as DataGridHeader,
79
+ c as DataGridHeaderActions,
80
+ d as DataGridHeaderFilter,
81
+ o as DataGridHeaderSearch
82
+ };
@@ -1,34 +1,35 @@
1
- import { jsx as a, jsxs as l, Fragment as u } from "react/jsx-runtime";
2
- import { useState as h } from "react";
1
+ import { jsx as a, jsxs as l, Fragment as p } from "react/jsx-runtime";
2
+ import { useState as u } from "react";
3
3
  import { cn as d } from "../../cn.js";
4
- import { DrawerWrapper as b, DrawerBody as f } from "../../drawer/drawer.js";
5
- import { translate as c } from "../../i18n/utility.js";
6
- import { Icon as i } from "../../icon/icon.js";
4
+ import { DrawerWrapper as b, DrawerBody as I } from "../../drawer/drawer.js";
5
+ import { translate as s } from "../../i18n/utility.js";
6
+ import { Icon as o } from "../../icon/icon.js";
7
7
  import { Input as m } from "../../primitives/input.js";
8
- const S = ({ index: e, slot: r }) => /* @__PURE__ */ a(
8
+ const D = ({ index: e, slot: r }) => /* @__PURE__ */ a(
9
9
  "div",
10
10
  {
11
11
  id: `SlotContainer-${e}`,
12
+ "data-testid": `SlotContainer-${e}`,
12
13
  "data-index": e,
13
- "aria-label": c("header.headerSlot", {
14
+ "aria-label": s("header.headerSlot", {
14
15
  index: e + 1,
15
16
  defaultValue: `Slot Container ${e + 1}`
16
17
  }),
17
18
  className: "gi-hidden gi-bg-gray-50 gi-py-4 gi-px-4 gi-border-b-2xl gi-border-b-color-surface-system-primary-default gi-order-3",
18
19
  children: r
19
20
  }
20
- ), I = ({
21
+ ), $ = ({
21
22
  index: e,
22
- item: { component: r, drawerPosition: p, icon: n, label: o, ariaLabel: s }
23
+ item: { component: r, drawerPosition: h, icon: c, label: i, ariaLabel: g }
23
24
  }) => {
24
- const [t, g] = h(!1);
25
- return /* @__PURE__ */ l(u, { children: [
25
+ const [t, n] = u(!1);
26
+ return /* @__PURE__ */ l(p, { children: [
26
27
  /* @__PURE__ */ l(
27
28
  "label",
28
29
  {
29
30
  htmlFor: `ItemActionDrawerTrigger-${e}`,
30
31
  className: "gi-header-tool-item",
31
- onClick: () => g(!0),
32
+ onClick: () => n(!0),
32
33
  children: [
33
34
  /* @__PURE__ */ a(
34
35
  m,
@@ -37,33 +38,33 @@ const S = ({ index: e, slot: r }) => /* @__PURE__ */ a(
37
38
  className: "gi-block gi-w-0 gi-absolute gi-h-0",
38
39
  id: `ItemActionDrawerTrigger-${e}`,
39
40
  "data-index": e,
40
- "aria-label": s || o || "",
41
- type: "button"
41
+ "aria-label": g || i || "",
42
+ type: "checkbox"
42
43
  }
43
44
  ),
44
- o && /* @__PURE__ */ a(
45
+ i && /* @__PURE__ */ a(
45
46
  "span",
46
47
  {
47
48
  id: `ItemActionDrawerTrigger-${e}-label`,
48
49
  className: "label",
49
- "aria-hidden": s ? "true" : "false",
50
- children: o
50
+ "aria-hidden": g ? "true" : "false",
51
+ children: i
51
52
  }
52
53
  ),
53
- n && /* @__PURE__ */ a(
54
- i,
54
+ c && /* @__PURE__ */ a(
55
+ o,
55
56
  {
56
57
  className: d({
57
58
  "gi-hidden": t,
58
59
  "gi-block": !t
59
60
  }),
60
- icon: n,
61
+ icon: c,
61
62
  id: `ItemIconDrawerActionTrigger-${e}`,
62
63
  ariaHidden: !0
63
64
  }
64
65
  ),
65
66
  /* @__PURE__ */ a(
66
- i,
67
+ o,
67
68
  {
68
69
  className: d({
69
70
  "gi-hidden": !t,
@@ -71,6 +72,7 @@ const S = ({ index: e, slot: r }) => /* @__PURE__ */ a(
71
72
  }),
72
73
  id: `ItemCloseTrigger-${e}`,
73
74
  ariaHidden: !0,
75
+ "data-testid": `ItemCloseTrigger-${e}`,
74
76
  icon: "close"
75
77
  }
76
78
  )
@@ -81,21 +83,21 @@ const S = ({ index: e, slot: r }) => /* @__PURE__ */ a(
81
83
  b,
82
84
  {
83
85
  isOpen: t,
84
- onClose: () => g(!1),
85
- position: p || "right",
86
- closeButtonLabel: c("header.drawer.close", {
86
+ onClose: () => n(!1),
87
+ position: h || "right",
88
+ closeButtonLabel: s("header.drawer.close", {
87
89
  defaultValue: "Close"
88
90
  }),
89
91
  closeButtonSize: "large",
90
- children: /* @__PURE__ */ a(f, { children: r })
92
+ children: /* @__PURE__ */ a(I, { children: r })
91
93
  }
92
94
  )
93
95
  ] });
94
- }, y = ({ item: e, index: r }) => e.slotAppearance === "drawer" ? /* @__PURE__ */ a(I, { index: r, item: e }) : /* @__PURE__ */ l(
96
+ }, y = ({ item: e, index: r }) => e.slotAppearance === "drawer" ? /* @__PURE__ */ a($, { index: r, item: e }) : /* @__PURE__ */ l(
95
97
  "label",
96
98
  {
97
99
  htmlFor: `ItemActionTrigger-${r}`,
98
- "aria-label": c("header.toggleActionItem", {
100
+ "aria-label": s("header.toggleActionItem", {
99
101
  item: e.label || `item ${r + 1}`,
100
102
  defaultValue: `Toggle item action for ${e.label || `item ${r + 1}`}`
101
103
  }),
@@ -115,7 +117,7 @@ const S = ({ index: e, slot: r }) => /* @__PURE__ */ a(
115
117
  ),
116
118
  e.label && /* @__PURE__ */ a("span", { className: "label", children: e.label }),
117
119
  e.icon && /* @__PURE__ */ a(
118
- i,
120
+ o,
119
121
  {
120
122
  icon: e.icon,
121
123
  ariaHidden: !0,
@@ -123,18 +125,19 @@ const S = ({ index: e, slot: r }) => /* @__PURE__ */ a(
123
125
  }
124
126
  ),
125
127
  /* @__PURE__ */ a(
126
- i,
128
+ o,
127
129
  {
128
130
  className: "gi-hidden close-icon",
129
131
  ariaHidden: !0,
130
132
  id: `ItemCloseTrigger-${r}`,
131
- icon: "close"
133
+ icon: "close",
134
+ "data-testid": `ItemCloseTrigger-${r}`
132
135
  }
133
136
  )
134
137
  ]
135
138
  }
136
139
  );
137
140
  export {
138
- S as SlotContainer,
141
+ D as SlotContainer,
139
142
  y as SlotItemAction
140
143
  };
@@ -1,2 +1 @@
1
1
  export declare const attachEventsToItemActionTriggers: () => (() => void) | undefined;
2
- export declare const attachEventsToSearchTrigger: () => () => void;