@ogcio/design-system-react 1.28.0 → 1.30.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 (80) hide show
  1. package/README.md +11 -33
  2. package/dist/alert/variants.d.ts +78 -2
  3. package/dist/assets/logos/LogoBlack.d.ts +3 -0
  4. package/dist/assets/logos/LogoBlack.js +322 -0
  5. package/dist/assets/logos/LogoGoldGreen.d.ts +3 -0
  6. package/dist/assets/logos/LogoGoldGreen.js +322 -0
  7. package/dist/assets/logos/LogoGoldWhite.d.ts +3 -0
  8. package/dist/assets/logos/LogoGoldWhite.js +82 -0
  9. package/dist/assets/logos/LogoHarpBlack.d.ts +3 -0
  10. package/dist/assets/logos/{harp/harp-white.js → LogoHarpBlack.js} +24 -21
  11. package/dist/assets/logos/LogoHarpWhite.d.ts +3 -0
  12. package/dist/assets/logos/LogoHarpWhite.js +60 -0
  13. package/dist/assets/logos/LogoWhite.d.ts +3 -0
  14. package/dist/assets/logos/LogoWhite.js +322 -0
  15. package/dist/assets/logos/index.d.ts +6 -0
  16. package/dist/assets/logos/index.js +14 -0
  17. package/dist/atoms/DsButton.d.ts +194 -0
  18. package/dist/atoms/DsButton.js +329 -0
  19. package/dist/atoms/icons/Close.d.ts +3 -0
  20. package/dist/atoms/icons/Close.js +22 -0
  21. package/dist/atoms/icons/KeyboardArrowDown.d.ts +3 -0
  22. package/dist/atoms/icons/KeyboardArrowDown.js +22 -0
  23. package/dist/atoms/icons/KeyboardArrowUp.d.ts +3 -0
  24. package/dist/atoms/icons/KeyboardArrowUp.js +22 -0
  25. package/dist/atoms/icons/Visibility.d.ts +3 -0
  26. package/dist/atoms/icons/Visibility.js +22 -0
  27. package/dist/atoms/icons/VisibilityOff.d.ts +3 -0
  28. package/dist/atoms/icons/VisibilityOff.js +22 -0
  29. package/dist/atoms/icons/index.d.ts +6 -0
  30. package/dist/atoms/icons/index.js +12 -0
  31. package/dist/atoms/icons/types.d.ts +10 -0
  32. package/dist/atoms/icons/types.js +1 -0
  33. package/dist/atoms/index.d.ts +2 -0
  34. package/dist/atoms/index.js +14 -0
  35. package/dist/autocomplete/autocomplete.js +131 -115
  36. package/dist/combo-box/dropdown-item.js +39 -40
  37. package/dist/data-table/data-table-footer.js +57 -51
  38. package/dist/data-table/data-table-header.d.ts +7 -7
  39. package/dist/data-table/data-table-header.js +97 -110
  40. package/dist/data-table/data-table-selected-rows.d.ts +1 -0
  41. package/dist/data-table/data-table-selected-rows.js +15 -19
  42. package/dist/footer/footer.js +9 -9
  43. package/dist/forms/form-field/form-field.d.ts +2 -2
  44. package/dist/forms/form-field/form-field.js +40 -30
  45. package/dist/forms/form-field/types.d.ts +10 -3
  46. package/dist/header/components/header-slot.js +33 -32
  47. package/dist/header/header-legacy.js +41 -41
  48. package/dist/header/variants.d.ts +220 -20
  49. package/dist/heading/heading.d.ts +70 -2
  50. package/dist/hooks/use-breakpoint.js +15 -12
  51. package/dist/icon/icon.d.ts +10 -0
  52. package/dist/icon/icon.js +64 -52
  53. package/dist/icon/icons.d.ts +1 -1
  54. package/dist/index.d.ts +1 -0
  55. package/dist/index.js +174 -171
  56. package/dist/input-password/input-password.js +13 -12
  57. package/dist/input-text/input-text.js +18 -16
  58. package/dist/label/label.d.ts +43 -0
  59. package/dist/label/label.js +7 -6
  60. package/dist/modal/modal.js +8 -7
  61. package/dist/spinner/spinner.d.ts +30 -2
  62. package/dist/styles.css +12 -2
  63. package/dist/table/table.d.ts +22 -2
  64. package/dist/tabs/tab-item.d.ts +2 -2
  65. package/dist/text-input/text-input.d.ts +1 -1
  66. package/dist/textarea/textarea.js +27 -28
  67. package/dist/toast/ds-toast.d.ts +78 -2
  68. package/dist/utils/placeholder.d.ts +2 -0
  69. package/dist/utils/placeholder.js +24 -0
  70. package/fonts.css +10 -0
  71. package/package.json +21 -8
  72. package/dist/assets/logos/gov-of-ireland/harp-black.d.ts +0 -2
  73. package/dist/assets/logos/gov-of-ireland/harp-black.js +0 -322
  74. package/dist/assets/logos/gov-of-ireland/harp-gold-text-green.d.ts +0 -2
  75. package/dist/assets/logos/gov-of-ireland/harp-gold-text-green.js +0 -322
  76. package/dist/assets/logos/gov-of-ireland/harp-white.d.ts +0 -2
  77. package/dist/assets/logos/gov-of-ireland/harp-white.js +0 -322
  78. package/dist/assets/logos/harp/harp-black.d.ts +0 -2
  79. package/dist/assets/logos/harp/harp-black.js +0 -63
  80. package/dist/assets/logos/harp/harp-white.d.ts +0 -2
@@ -1,83 +1,67 @@
1
1
  "use client";
2
- import { jsxs as z, jsx as h } from "react/jsx-runtime";
3
- import { forwardRef as J, useRef as N, useImperativeHandle as Q, useEffect as W, useCallback as D, createElement as Y, Children as Z, isValidElement as ee } from "react";
4
- import { cn as P } from "../cn.js";
5
- import { useDomId as te } from "../hooks/use-dom-id.js";
2
+ import { jsxs as z, jsx as y } from "react/jsx-runtime";
3
+ import { forwardRef as J, useRef as D, useImperativeHandle as Q, useEffect as W, useCallback as P, createElement as Y, Children as Z, isValidElement as ee } from "react";
4
+ import { c as te } from "../index-CB-zPpNk.js";
5
+ import { cn as oe } from "../cn.js";
6
+ import { useDomId as ne } from "../hooks/use-dom-id.js";
6
7
  import { translate as G } from "../i18n/utility.js";
7
- import { InputText as oe } from "../input-text/input-text.js";
8
- import { Popover as ne } from "../popover/popover.js";
9
- import { SelectMenu as ae, SelectMenuOption as L, SelectMenuGroupItem as re } from "../select/select-menu.js";
10
- import { cycleEnabledIndex as le } from "../utilities.js";
11
- import { AUTOCOMPLETE_ACTIONS as pe } from "./types.js";
12
- import { useAutocompleteController as ie } from "./use-autocomplete-controller.js";
8
+ import { InputText as re } from "../input-text/input-text.js";
9
+ import { Popover as ae } from "../popover/popover.js";
10
+ import { SelectMenu as le, SelectMenuOption as L, SelectMenuGroupItem as pe } from "../select/select-menu.js";
11
+ import { cycleEnabledIndex as ie } from "../utilities.js";
12
+ import { AUTOCOMPLETE_ACTIONS as se } from "./types.js";
13
+ import { useAutocompleteController as ce } from "./use-autocomplete-controller.js";
13
14
  const {
14
- ON_RESET: se,
15
- ON_SELECT_ITEM: ce,
15
+ ON_RESET: ue,
16
+ ON_SELECT_ITEM: de,
16
17
  SET_INPUT_VALUE: R,
17
18
  SET_IS_OPEN: i,
18
- TOGGLE_CLEAR_BUTTON: C,
19
- SET_HIGHLIGHTED_INDEX: ue,
20
- SET_VALUE: de
21
- } = pe, me = (a) => a ? "keyboard_arrow_up" : "keyboard_arrow_down", T = (a, r) => (p) => {
22
- a && a({
23
- target: { name: r, value: p },
24
- currentTarget: { name: r, value: p },
25
- type: "change",
26
- bubbles: !0,
27
- isTrusted: !0
28
- });
29
- }, fe = (a, r) => (p) => {
30
- a && a({
31
- target: { name: r, value: p },
32
- currentTarget: { name: r, value: p },
33
- type: "blur",
34
- bubbles: !0,
35
- isTrusted: !0
36
- });
37
- }, ke = J(
38
- (a, r) => {
39
- var x;
40
- const p = N(null), {
41
- disabled: l,
42
- children: c,
43
- placeholder: y,
19
+ TOGGLE_CLEAR_BUTTON: S,
20
+ SET_HIGHLIGHTED_INDEX: me,
21
+ SET_VALUE: fe
22
+ } = se, Pe = J(
23
+ (r, a) => {
24
+ var k;
25
+ const l = D(null), {
26
+ disabled: p = !1,
27
+ children: s,
28
+ placeholder: h,
44
29
  onSelectItem: m,
45
30
  isLoading: g,
46
- freeSolo: s = !1,
31
+ freeSolo: c = !1,
47
32
  onChange: b,
48
33
  onBlur: B,
49
34
  name: u,
50
35
  value: E,
51
36
  id: M
52
- } = a, v = N(!1), {
37
+ } = r, v = D(!1), C = be({ freeSolo: c, disabled: p }), {
53
38
  state: t,
54
39
  dispatch: o,
55
40
  inputRef: f,
56
- getOptionLabelByValue: S,
57
- listRef: A,
58
- debouncedFilter: U,
59
- validChildren: be
60
- } = ie({
61
- ...a,
41
+ getOptionLabelByValue: A,
42
+ listRef: _,
43
+ debouncedFilter: U
44
+ } = ce({
45
+ ...r,
62
46
  onChange: T(b, u)
63
- }), _ = te();
64
- Q(r, () => f.current), W(() => {
65
- E !== void 0 && (o({ type: de, payload: E }), o({
47
+ }), w = ne();
48
+ Q(a, () => f.current), W(() => {
49
+ E !== void 0 && (o({ type: fe, payload: E }), o({
66
50
  type: R,
67
- payload: S(c, E)
68
- }), o({ type: C }));
51
+ payload: A(s, E)
52
+ }), o({ type: S }));
69
53
  }, [E]);
70
- const w = a["aria-label"] ?? G("autocomplete.placeholder", { defaultValue: "Type to Search" }), V = (e) => {
71
- o({ type: i, payload: e }), e || o({ type: C, payload: !1 });
54
+ const x = r["aria-label"] ?? G("autocomplete.placeholder", { defaultValue: "Type to Search" }), V = (e) => {
55
+ o({ type: i, payload: e }), e || o({ type: S, payload: !1 });
72
56
  }, H = () => {
73
- o({ type: se }), o({ type: i, payload: !1 }), T(b, u)("");
57
+ o({ type: ue }), o({ type: i, payload: !1 }), T(b, u)("");
74
58
  }, j = (e) => {
75
- o({ type: R, payload: e }), s && T(b, u)(e), e && o({ type: i, payload: !0 }), U(e);
59
+ o({ type: R, payload: e }), c && T(b, u)(e), e && o({ type: i, payload: !0 }), U(e);
76
60
  }, $ = (e) => {
77
61
  const {
78
62
  target: { value: n }
79
63
  } = e;
80
- e.__origin === "clear_button" && H(), !/^\s/.test(n) && (j(n), o({ type: C }), setTimeout(() => {
64
+ e.__origin === "clear_button" && H(), !/^\s/.test(n) && (j(n), o({ type: S }), setTimeout(() => {
81
65
  var d;
82
66
  return (d = f.current) == null ? void 0 : d.focus();
83
67
  }));
@@ -89,12 +73,12 @@ const {
89
73
  type: i,
90
74
  payload: !0
91
75
  });
92
- }, I = D(
76
+ }, I = P(
93
77
  (e) => {
94
78
  o({
95
- type: ce,
79
+ type: de,
96
80
  payload: {
97
- inputValue: S(c, e),
81
+ inputValue: A(s, e),
98
82
  value: e
99
83
  }
100
84
  }), T(b, u)(e), setTimeout(() => {
@@ -102,28 +86,28 @@ const {
102
86
  (n = f.current) == null || n.focus();
103
87
  }, 0), m == null || m(e);
104
88
  },
105
- [c, o, u, b, m]
89
+ [s, o, u, b, m]
106
90
  ), X = (e) => {
107
- var O, k;
91
+ var O, N;
108
92
  const { relatedTarget: n } = e;
109
- if (n && ((O = A.current) != null && O.contains(n) || (k = p.current) != null && k.contains(n)) || v.current) {
93
+ if (n && ((O = _.current) != null && O.contains(n) || (N = l.current) != null && N.contains(n)) || v.current) {
110
94
  setTimeout(() => v.current = !1, 0);
111
95
  return;
112
96
  }
113
97
  const d = t.value ?? t.inputValue ?? "";
114
- fe(B, u)(d);
115
- }, q = D(
98
+ Ie(B, u)(d);
99
+ }, q = P(
116
100
  (e) => {
117
101
  switch (e.key) {
118
102
  case "ArrowDown":
119
103
  case "ArrowUp": {
120
104
  e.preventDefault();
121
- const n = () => t.highlightedIndex === -1 ? d === -1 ? 0 : -1 : t.highlightedIndex, d = e.key === "ArrowDown" ? 1 : -1, O = le(
105
+ const n = () => t.highlightedIndex === -1 ? d === -1 ? 0 : -1 : t.highlightedIndex, d = e.key === "ArrowDown" ? 1 : -1, O = ie(
122
106
  t.autocompleteOptions,
123
107
  n(),
124
108
  d
125
109
  );
126
- o({ type: ue, payload: O }), o({ type: i, payload: !0 });
110
+ o({ type: me, payload: O }), o({ type: i, payload: !0 });
127
111
  break;
128
112
  }
129
113
  case "Enter":
@@ -149,12 +133,12 @@ const {
149
133
  return /* @__PURE__ */ z(
150
134
  "div",
151
135
  {
152
- "aria-disabled": l,
153
- className: P("gi-autocomplete gi-not-prose", a.className),
136
+ "aria-disabled": p,
137
+ className: oe(C.root(), r.className),
154
138
  children: [
155
- /* @__PURE__ */ h("span", { id: _, className: "gi-sr-only", children: w }),
156
- /* @__PURE__ */ h(
157
- oe,
139
+ /* @__PURE__ */ y("span", { id: w, className: "gi-sr-only", children: x }),
140
+ /* @__PURE__ */ y(
141
+ re,
158
142
  {
159
143
  autoComplete: "off",
160
144
  id: M,
@@ -166,28 +150,25 @@ const {
166
150
  onBlur: X,
167
151
  clearButtonEnabled: t.isClearButtonEnabled,
168
152
  inputActionPosition: "beforeSuffix",
169
- "aria-label": w,
170
- "aria-labelledby": _,
171
- "aria-disabled": l,
172
- disabled: l,
173
- placeholder: y ?? G("autocomplete.placeholder", { defaultValue: "Type to Search" }),
174
- iconEndClassName: P({
175
- "gi-cursor-pointer": !l && !s,
176
- "gi-cursor-not-allowed gi-pointer-events-none": l && !s
177
- }),
178
- iconEnd: s ? void 0 : me(t.isOpen),
153
+ "aria-label": x,
154
+ "aria-labelledby": w,
155
+ "aria-disabled": p,
156
+ disabled: p,
157
+ placeholder: h ?? G("autocomplete.placeholder", { defaultValue: "Type to Search" }),
158
+ iconEndClassName: C.iconEnd(),
159
+ iconEnd: c ? void 0 : Ee(t.isOpen),
179
160
  ref: f,
180
- iconEndRef: p,
161
+ iconEndRef: l,
181
162
  value: t.inputValue,
182
163
  "data-highlighted-index": t.highlightedIndex
183
164
  }
184
165
  ),
185
- /* @__PURE__ */ h(
186
- ne,
166
+ /* @__PURE__ */ y(
167
+ ae,
187
168
  {
188
169
  onOpenChange: V,
189
170
  triggerRef: f,
190
- extraRefs: [p],
171
+ extraRefs: [l],
191
172
  open: t.isOpen,
192
173
  maxHeight: 304,
193
174
  options: {
@@ -201,14 +182,14 @@ const {
201
182
  }
202
183
  ]
203
184
  },
204
- children: /* @__PURE__ */ h(
205
- ae,
185
+ children: /* @__PURE__ */ y(
186
+ le,
206
187
  {
207
188
  onChange: I,
208
189
  isLoading: g,
209
- showNoData: !((x = t.autocompleteOptions) != null && x.length),
210
- ref: A,
211
- children: he(
190
+ showNoData: !((k = t.autocompleteOptions) != null && k.length),
191
+ ref: _,
192
+ children: ye(
212
193
  t.autocompleteOptions,
213
194
  t,
214
195
  I
@@ -221,44 +202,44 @@ const {
221
202
  }
222
203
  );
223
204
  }
224
- ), he = (a, r, p) => a.map((l, c) => {
225
- if (r.optionType === "AutocompleteItem")
205
+ ), ye = (r, a, l) => r.map((p, s) => {
206
+ if (a.optionType === "AutocompleteItem")
226
207
  return /* @__PURE__ */ Y(
227
208
  L,
228
209
  {
229
- ...l.props,
230
- key: `AutocompleteItem-${l.props.value}`,
231
- selected: r.value === l.props.value,
232
- isHighlighted: c === r.highlightedIndex,
233
- index: c
210
+ ...p.props,
211
+ key: `AutocompleteItem-${p.props.value}`,
212
+ selected: a.value === p.props.value,
213
+ isHighlighted: s === a.highlightedIndex,
214
+ index: s
234
215
  }
235
216
  );
236
- if (r.optionType === "AutocompleteGroupItem") {
237
- const y = l, m = Z.toArray(y.props.children).filter((g) => ee(g)).map((g) => {
238
- const s = g.props;
239
- return /* @__PURE__ */ h(
217
+ if (a.optionType === "AutocompleteGroupItem") {
218
+ const h = p, m = Z.toArray(h.props.children).filter((g) => ee(g)).map((g) => {
219
+ const c = g.props;
220
+ return /* @__PURE__ */ y(
240
221
  L,
241
222
  {
242
- ...s,
243
- selected: r.value.toString() === s.value.toString(),
244
- onChange: p,
245
- index: c
223
+ ...c,
224
+ selected: a.value.toString() === c.value.toString(),
225
+ onChange: l,
226
+ index: s
246
227
  },
247
- `SelectGroupItemNext-SelectItemNext-${s.value.toString()}`
228
+ `SelectGroupItemNext-SelectItemNext-${c.value.toString()}`
248
229
  );
249
230
  });
250
- return /* @__PURE__ */ h(
251
- re,
231
+ return /* @__PURE__ */ y(
232
+ pe,
252
233
  {
253
- label: y.props.label,
234
+ label: h.props.label,
254
235
  children: m
255
236
  },
256
- `Group-${y.props.label}`
237
+ `Group-${h.props.label}`
257
238
  );
258
239
  }
259
240
  return null;
260
- }), ye = () => null;
261
- Object.defineProperty(ye, "componentType", {
241
+ }), he = () => null;
242
+ Object.defineProperty(he, "componentType", {
262
243
  value: "AutocompleteItem",
263
244
  writable: !1,
264
245
  enumerable: !1
@@ -269,9 +250,44 @@ Object.defineProperty(ge, "componentType", {
269
250
  writable: !1,
270
251
  enumerable: !1
271
252
  });
253
+ const be = te({
254
+ slots: {
255
+ root: "gi-relative gi-w-full gi-not-prose",
256
+ iconEnd: ""
257
+ },
258
+ variants: {
259
+ freeSolo: {
260
+ true: {},
261
+ false: {
262
+ iconEnd: "gi-cursor-pointer"
263
+ }
264
+ },
265
+ disabled: {
266
+ true: {
267
+ iconEnd: "gi-cursor-not-allowed gi-pointer-events-none"
268
+ }
269
+ }
270
+ }
271
+ }), Ee = (r) => r ? "keyboard_arrow_up" : "keyboard_arrow_down", T = (r, a) => (l) => {
272
+ r == null || r({
273
+ target: { name: a, value: l },
274
+ currentTarget: { name: a, value: l },
275
+ type: "change",
276
+ bubbles: !0,
277
+ isTrusted: !0
278
+ });
279
+ }, Ie = (r, a) => (l) => {
280
+ r && r({
281
+ target: { name: a, value: l },
282
+ currentTarget: { name: a, value: l },
283
+ type: "blur",
284
+ bubbles: !0,
285
+ isTrusted: !0
286
+ });
287
+ };
272
288
  export {
273
- ke as Autocomplete,
289
+ Pe as Autocomplete,
274
290
  ge as AutocompleteGroupItem,
275
- ye as AutocompleteItem,
276
- he as renderSelectMenuOptions
291
+ he as AutocompleteItem,
292
+ ye as renderSelectMenuOptions
277
293
  };
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { jsxs as n, jsx as s } from "react/jsx-runtime";
2
+ import { jsxs as n, jsx as a } from "react/jsx-runtime";
3
3
  import { useState as u, useId as j, useEffect as q } from "react";
4
4
  import { Button as B } from "../button/button.js";
5
5
  import { cn as x } from "../cn.js";
@@ -11,33 +11,33 @@ import { InputText as O } from "../input-text/input-text.js";
11
11
  import { Paragraph as y } from "../paragraph/paragraph.js";
12
12
  import { Tag as A, TagTypeEnum as F } from "../tag/tag.js";
13
13
  import { slugify as P } from "../utilities.js";
14
- const oo = ({
14
+ const ee = ({
15
15
  children: c,
16
16
  noSearch: h,
17
17
  options: p,
18
18
  value: v,
19
- defaultValue: k = [],
19
+ defaultValue: C = [],
20
20
  onChange: g,
21
21
  onSearch: l
22
22
  }) => {
23
- const [m, C] = u(!1), [d, $] = u(""), [I, _] = u(!1), [T, V] = u(k), r = c ? `${P(`${c}-${j()}`)}` : "", w = v !== void 0, t = w ? v : T, z = () => [
23
+ const [m, k] = u(!1), [d, $] = u(""), [I, _] = u(!1), [T, V] = u(C), r = c ? `${P(`${c}-${j()}`)}` : "", w = v !== void 0, t = w ? v : T, z = () => [
24
24
  ...globalThis.window.document.querySelectorAll(
25
25
  `div.gi-combobox-checkbox.gi-combobox-key-${r}`
26
26
  )
27
27
  ];
28
28
  q(() => {
29
- var a, i;
30
- let o = 0;
31
- const e = z();
32
- for (const b of e) {
33
- const f = (a = b.querySelector("label")) == null ? void 0 : a.textContent;
34
- (i = f == null ? void 0 : f.toLowerCase()) != null && i.includes(d.toLowerCase()) ? b.style.display = "flex" : (b.style.display = "none", o++);
29
+ var s, i;
30
+ let e = 0;
31
+ const o = z();
32
+ for (const b of o) {
33
+ const f = (s = b.querySelector("label")) == null ? void 0 : s.textContent;
34
+ (i = f == null ? void 0 : f.toLowerCase()) != null && i.includes(d.toLowerCase()) ? b.style.display = "flex" : (b.style.display = "none", e++);
35
35
  }
36
- _(o === p.length);
36
+ _(e === p.length);
37
37
  }, [d, p.length]);
38
- const R = (o, e) => {
39
- const a = e ? [...t || [], o] : (t || []).filter((i) => i !== o);
40
- w || V(a), g == null || g(a);
38
+ const R = (e, o) => {
39
+ const s = o ? [...t || [], e] : (t || []).filter((i) => i !== e);
40
+ w || V(s), g == null || g(s);
41
41
  };
42
42
  return /* @__PURE__ */ n(
43
43
  "div",
@@ -52,18 +52,18 @@ const oo = ({
52
52
  variant: "flat",
53
53
  appearance: "dark",
54
54
  size: "large",
55
- onClick: (o) => {
56
- o.preventDefault(), C(!m);
55
+ onClick: (e) => {
56
+ e.preventDefault(), k(!m);
57
57
  },
58
58
  className: x("gi-combobox-toggle", {
59
59
  "gi-combobox-toggle-open": m
60
60
  }),
61
61
  children: [
62
62
  /* @__PURE__ */ n("div", { className: "gi-combobox-toggle-content", children: [
63
- /* @__PURE__ */ s(y, { size: "md", children: c }),
64
- (t == null ? void 0 : t.length) > 0 && /* @__PURE__ */ s(A, { type: F.Counter, text: t.length.toString() })
63
+ /* @__PURE__ */ a(y, { size: "md", children: c }),
64
+ (t == null ? void 0 : t.length) > 0 && /* @__PURE__ */ a(A, { type: F.Counter, text: t.length.toString() })
65
65
  ] }),
66
- /* @__PURE__ */ s(
66
+ /* @__PURE__ */ a(
67
67
  D,
68
68
  {
69
69
  className: x({ "gi-rotate-180": m }),
@@ -80,19 +80,19 @@ const oo = ({
80
80
  id: `${r}-search`,
81
81
  children: [
82
82
  !h && /* @__PURE__ */ n("div", { className: "gi-combobox-search", children: [
83
- /* @__PURE__ */ s(
83
+ /* @__PURE__ */ a(
84
84
  O,
85
85
  {
86
86
  placeholder: N("dropdownItem.search", { defaultValue: "Search" }),
87
87
  className: "gi-combobox-search-input",
88
88
  value: d,
89
- onChange: (o) => {
90
- const e = o.target.value;
91
- $(e), l == null || l(e);
89
+ onChange: (e) => {
90
+ const o = e.target.value;
91
+ $(o), l == null || l(o);
92
92
  }
93
93
  }
94
94
  ),
95
- d && /* @__PURE__ */ s(
95
+ d && /* @__PURE__ */ a(
96
96
  E,
97
97
  {
98
98
  variant: "flat",
@@ -102,9 +102,8 @@ const oo = ({
102
102
  onClick: () => {
103
103
  l == null || l(""), $("");
104
104
  },
105
- icon: {
106
- icon: "close"
107
- }
105
+ icon: { icon: "close" },
106
+ "aria-label": "Clear input"
108
107
  }
109
108
  )
110
109
  ] }),
@@ -115,29 +114,29 @@ const oo = ({
115
114
  "gi-h-64": !h
116
115
  }),
117
116
  children: [
118
- I && /* @__PURE__ */ s(y, { className: "gi-combobox-checkbox-paragraph", children: N("dropdownItem.noResultFound", {
117
+ I && /* @__PURE__ */ a(y, { className: "gi-combobox-checkbox-paragraph", children: N("dropdownItem.noResultFound", {
119
118
  defaultValue: "No results found."
120
119
  }) }),
121
- p.map((o, e) => {
122
- const a = t == null ? void 0 : t.includes(o.value);
123
- return /* @__PURE__ */ s(
120
+ p.map((e, o) => {
121
+ const s = t == null ? void 0 : t.includes(e.value);
122
+ return /* @__PURE__ */ a(
124
123
  "div",
125
124
  {
126
125
  className: `gi-combobox-checkbox gi-combobox-key-${r}`,
127
- children: /* @__PURE__ */ s(
126
+ children: /* @__PURE__ */ a(
128
127
  L,
129
128
  {
130
- onChange: (i) => R(o.value, i.target.checked),
131
- checked: a,
132
- id: `${e}_${r}_${o.value}`,
133
- label: o.label,
134
- name: `${e}_${o.label}_${r}`,
135
- value: o.value,
129
+ onChange: (i) => R(e.value, i.target.checked),
130
+ checked: s,
131
+ id: `${o}_${r}_${e.value}`,
132
+ label: e.label,
133
+ name: `${o}_${e.label}_${r}`,
134
+ value: e.value,
136
135
  size: "sm"
137
136
  }
138
137
  )
139
138
  },
140
- `${e}_${r}_${o.value}`
139
+ `${o}_${r}_${e.value}`
141
140
  );
142
141
  })
143
142
  ]
@@ -151,5 +150,5 @@ const oo = ({
151
150
  );
152
151
  };
153
152
  export {
154
- oo as DropdownItem
153
+ ee as DropdownItem
155
154
  };
@@ -1,66 +1,72 @@
1
- import { jsx as a, jsxs as E } from "react/jsx-runtime";
2
- import i from "react";
3
- import { cn as o } from "../cn.js";
4
- const r = (e, t) => i.isValidElement(e) && e.type === t, l = (e, t, s) => e ? /* @__PURE__ */ a(
5
- "div",
6
- {
7
- className: o(
8
- t,
9
- s,
10
- e.props.className
11
- ),
12
- style: e.props.style,
13
- children: e.props.children
14
- }
15
- ) : null, T = ({
1
+ import { jsx as o, jsxs as v } from "react/jsx-runtime";
2
+ import c from "react";
3
+ import { c as x } from "../index-CB-zPpNk.js";
4
+ import { cn as i } from "../cn.js";
5
+ const b = ({
16
6
  children: e,
17
7
  ...t
18
- }) => /* @__PURE__ */ a("div", { ...t, children: e });
19
- T.displayName = "DataTableFooterStart";
20
- const h = ({
8
+ }) => /* @__PURE__ */ o("div", { ...t, children: e });
9
+ b.displayName = "DataTableFooterStart";
10
+ const S = ({
21
11
  children: e,
22
12
  ...t
23
- }) => /* @__PURE__ */ a("div", { ...t, children: e });
24
- h.displayName = "DataTableFooterCenter";
25
- const D = ({
13
+ }) => /* @__PURE__ */ o("div", { ...t, children: e });
14
+ S.displayName = "DataTableFooterCenter";
15
+ const y = ({
26
16
  children: e,
27
17
  ...t
28
- }) => /* @__PURE__ */ a("div", { ...t, children: e });
29
- D.displayName = "DataTableFooterEnd";
30
- const v = ({
18
+ }) => /* @__PURE__ */ o("div", { ...t, children: e });
19
+ y.displayName = "DataTableFooterEnd";
20
+ const C = ({
31
21
  children: e,
32
22
  className: t,
33
- standalone: s = !1,
34
- ...c
23
+ standalone: F = !1,
24
+ ...d
35
25
  }) => {
36
- const S = i.useMemo(() => {
37
- let g = null, y = null, F = null;
38
- return i.Children.forEach(e, (n) => {
39
- r(n, T) ? g = n : r(n, h) ? y = n : r(n, D) && (F = n);
40
- }), { start: g, center: y, end: F };
41
- }, [e]), { start: d, center: p, end: m } = S, f = !!!d && !!!p && !!m, b = "gi-data-table-footer-base", C = `${b} gi-text-center`, N = o("gi-min-w-0", {
42
- "gi-basis-1/2 gi-text-right": !f
43
- }), u = /* @__PURE__ */ E(
26
+ const h = c.useMemo(() => {
27
+ let n = null, r = null, u = null;
28
+ return c.Children.forEach(e, (a) => {
29
+ l(a, b) ? n = a : l(a, S) ? r = a : l(a, y) && (u = a);
30
+ }), { start: n, center: r, end: u };
31
+ }, [e]), { start: f, center: g, end: m } = h, D = !!!f && !!!g && !!m, { footer: T, baseSection: w, centerSection: E, endSection: N } = j({
32
+ onlyEnd: D
33
+ }), s = (n, r) => n ? /* @__PURE__ */ o(
44
34
  "div",
45
35
  {
46
- className: o(
47
- "gi-data-table-footer",
48
- f ? "gi-justify-end" : "gi-gap-2",
49
- t
50
- ),
51
- children: [
52
- l(d, b),
53
- l(p, C),
54
- l(m, N)
55
- ]
36
+ className: i(r, n.props.className),
37
+ style: n.props.style,
38
+ children: n.props.children
56
39
  }
57
- );
58
- return s ? /* @__PURE__ */ a("div", { ...c, className: o("gi-w-full gi-p-2", t), children: u }) : /* @__PURE__ */ a("tfoot", { ...c, children: /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: 999, className: "gi-p-2", children: u }) }) });
40
+ ) : null, p = /* @__PURE__ */ v("div", { className: i(T(), t), children: [
41
+ s(f, w()),
42
+ s(g, E()),
43
+ s(m, N())
44
+ ] });
45
+ return F ? /* @__PURE__ */ o("div", { ...d, className: i("gi-w-full gi-p-2", t), children: p }) : /* @__PURE__ */ o("tfoot", { ...d, children: /* @__PURE__ */ o("tr", { children: /* @__PURE__ */ o("td", { colSpan: 999, className: "gi-p-2", children: p }) }) });
59
46
  };
60
- v.displayName = "DataTableFooter";
47
+ C.displayName = "DataTableFooter";
48
+ const j = x({
49
+ slots: {
50
+ footer: "gi-flex gi-flex-row gi-w-full gi-items-center",
51
+ baseSection: "gi-grow gi-basis-0 gi-min-w-0",
52
+ centerSection: "gi-grow gi-basis-0 gi-min-w-0 gi-text-center",
53
+ endSection: "gi-min-w-0"
54
+ },
55
+ variants: {
56
+ onlyEnd: {
57
+ true: {
58
+ footer: "gi-justify-end"
59
+ },
60
+ false: {
61
+ footer: "gi-gap-2",
62
+ endSection: "gi-basis-1/2 gi-text-right"
63
+ }
64
+ }
65
+ }
66
+ }), l = (e, t) => c.isValidElement(e) && e.type === t;
61
67
  export {
62
- v as DataTableFooter,
63
- h as DataTableFooterCenter,
64
- D as DataTableFooterEnd,
65
- T as DataTableFooterStart
68
+ C as DataTableFooter,
69
+ S as DataTableFooterCenter,
70
+ y as DataTableFooterEnd,
71
+ b as DataTableFooterStart
66
72
  };