@ogcio/design-system-react 1.22.0 → 1.23.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 (94) hide show
  1. package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
  2. package/dist/accordion/accordion-item.js +14 -15
  3. package/dist/alert/alert.js +19 -20
  4. package/dist/autocomplete/autocomplete.js +167 -169
  5. package/dist/autocomplete/use-autocomplete-controller.js +1 -1
  6. package/dist/browser-support/runtime.js +2 -3
  7. package/dist/button/button.js +11 -12
  8. package/dist/button-group/button-group.js +4 -5
  9. package/dist/card/card-next.js +122 -125
  10. package/dist/card/card.js +4 -5
  11. package/dist/checkbox/checkbox-group.js +3 -4
  12. package/dist/checkbox/checkbox.js +4 -5
  13. package/dist/chip/chip.js +11 -12
  14. package/dist/combo-box/dropdown-item.js +2 -3
  15. package/dist/cookie-banner/cookie-banner.js +6 -7
  16. package/dist/data-table/data-table-header.d.ts +0 -1
  17. package/dist/data-table/data-table-header.js +43 -60
  18. package/dist/data-table/editable-table-cell.js +3 -4
  19. package/dist/data-table/index.d.ts +7 -0
  20. package/dist/data-table/index.js +20 -0
  21. package/dist/data-table/tanstack/tanstack-helpers.d.ts +1 -0
  22. package/dist/data-table/tanstack/tanstack-helpers.js +31 -30
  23. package/dist/details/details.js +6 -7
  24. package/dist/drawer/drawer.js +18 -19
  25. package/dist/footer/footer.js +2 -3
  26. package/dist/forms/form-field/form-field.js +2 -3
  27. package/dist/header/components/header-menu.js +17 -18
  28. package/dist/header/header-legacy.js +2 -3
  29. package/dist/header/header-next/components/header-logo.js +3 -4
  30. package/dist/header/header-next/components/header-title.js +0 -1
  31. package/dist/header/header-next/components/menu/components/header-menu-item-button.js +4 -5
  32. package/dist/header/header-next/components/menu/components/header-menu-item-link.js +0 -1
  33. package/dist/header/header-next/components/menu/components/header-menu-item-separator.js +4 -5
  34. package/dist/header/header-next/components/menu/components/header-menu-item-slot.js +0 -1
  35. package/dist/header/header-next/components/menu/header-menu-context.js +9 -10
  36. package/dist/header/header-next/components/menu/header-primary-menu.js +4 -5
  37. package/dist/header/header-next/components/menu/header-secondary-menu.js +0 -1
  38. package/dist/header/header-next/header-context.js +4 -5
  39. package/dist/header/header-next/header-next.js +2 -3
  40. package/dist/hooks/use-breakpoint.js +7 -8
  41. package/dist/hooks/use-toggle-map.js +12 -13
  42. package/dist/i18n/config.d.ts +1 -1
  43. package/dist/i18n/config.js +14 -11
  44. package/dist/i18n/utility.js +1 -1
  45. package/dist/i18nInstance-D_96ADqd.js +48 -0
  46. package/dist/i18next-B_GQfCrJ.js +1362 -0
  47. package/dist/icon/icon.js +2 -3
  48. package/dist/icon-button/icon-button.js +4 -5
  49. package/dist/index.d.ts +1 -4
  50. package/dist/index.js +231 -220
  51. package/dist/input-checkbox/input-checkbox.js +36 -37
  52. package/dist/input-checkbox-group/input-checkbox-group.js +9 -10
  53. package/dist/input-password/input-password.js +0 -1
  54. package/dist/input-radio/input-radio.js +31 -34
  55. package/dist/input-radio-group/input-radio-group.js +8 -9
  56. package/dist/input-text/input-text.js +2 -3
  57. package/dist/{lodash-D1c5hFAM.js → lodash-LsP9-6SV.js} +1343 -1342
  58. package/dist/modal/modal.js +4 -5
  59. package/dist/pagination/pagination.js +713 -58
  60. package/dist/phase-banner/phase-banner.js +2 -3
  61. package/dist/popover/popover.js +2 -3
  62. package/dist/radio/radio-group.js +0 -1
  63. package/dist/radio/radio.js +0 -1
  64. package/dist/score-select/score-select.js +3 -4
  65. package/dist/select/select-menu.js +43 -41
  66. package/dist/select/select-next.js +190 -161
  67. package/dist/select/select.js +3 -4
  68. package/dist/side-nav/side-nav.js +9 -10
  69. package/dist/spinner/spinner.js +2 -3
  70. package/dist/stack/stack.js +20 -21
  71. package/dist/styles.css +1 -1
  72. package/dist/summary-list/summary-list-action.js +6 -7
  73. package/dist/summary-list/summary-list-context.js +4 -5
  74. package/dist/summary-list/summary-list-header.js +12 -13
  75. package/dist/summary-list/summary-list-row.js +17 -18
  76. package/dist/summary-list/summary-list-value.js +0 -1
  77. package/dist/summary-list/summary-list.js +4 -5
  78. package/dist/table/table-data.js +11 -12
  79. package/dist/table/table-header.js +2 -3
  80. package/dist/tabs/tab-item.d.ts +3 -2
  81. package/dist/tabs/tab-item.js +89 -67
  82. package/dist/tabs/tab-list.js +81 -66
  83. package/dist/tabs/tabs.d.ts +1 -1
  84. package/dist/tabs/tabs.js +12 -12
  85. package/dist/tabs/types.d.ts +9 -2
  86. package/dist/text-input/text-input.js +0 -1
  87. package/dist/textarea/textarea.js +12 -13
  88. package/dist/toast/ds-toast.js +10 -11
  89. package/dist/toast/toast.js +15 -16
  90. package/dist/tooltip/tooltip.js +12 -13
  91. package/dist/utilities.d.ts +4 -1
  92. package/dist/utilities.js +29 -16
  93. package/package.json +7 -6
  94. package/dist/i18next-DxWa09nx.js +0 -1395
@@ -1,79 +1,78 @@
1
1
  "use client";
2
- import "@ogcio/design-system-react/browser-check";
3
- import { jsxs as n, Fragment as g, jsx as t } from "react/jsx-runtime";
4
- import { forwardRef as k, useId as C } from "react";
5
- import { cn as o } from "../cn.js";
6
- import { HintText as f } from "../hint-text/hint-text.js";
7
- import { Input as I } from "../primitives/input.js";
8
- import { InputCheckboxSizeEnum as s } from "./types.js";
2
+ import { jsxs as a, Fragment as g, jsx as t } from "react/jsx-runtime";
3
+ import { forwardRef as k, useId as f } from "react";
4
+ import { cn as m } from "../cn.js";
5
+ import { HintText as C } from "../hint-text/hint-text.js";
6
+ import { Label as I } from "../label/label.js";
7
+ import { Input as v } from "../primitives/input.js";
8
+ import { InputCheckboxSizeEnum as l } from "./types.js";
9
9
  const N = (e) => {
10
10
  switch (e) {
11
- case s.Small:
11
+ case l.Small:
12
12
  return "gi-input-checkbox-small";
13
13
  default:
14
14
  return "gi-input-checkbox-medium";
15
15
  }
16
- }, v = (e) => e === s.Small ? "gi-w-6" : "gi-w-8", d = k(
16
+ }, S = (e) => e === l.Small ? "gi-w-6" : "gi-w-8", d = k(
17
17
  ({
18
18
  id: e,
19
- size: l = s.Medium,
19
+ size: i = l.Medium,
20
20
  label: b,
21
21
  children: r,
22
- hint: m,
22
+ hint: s,
23
23
  indeterminate: h = !1,
24
24
  containerProps: p,
25
25
  ...u
26
26
  }, x) => {
27
- const i = e || C(), a = !!r, c = r ?? b;
28
- return /* @__PURE__ */ n(g, { children: [
29
- /* @__PURE__ */ n(
27
+ const c = e || f(), n = !!r, o = r ?? b;
28
+ return /* @__PURE__ */ a(g, { children: [
29
+ /* @__PURE__ */ a(
30
30
  "div",
31
31
  {
32
- className: o("gi-input-checkbox-container", {
33
- "!gi-items-start": a
32
+ className: m("gi-input-checkbox-container", {
33
+ "!gi-items-start": n
34
34
  }),
35
35
  ...p,
36
36
  children: [
37
37
  /* @__PURE__ */ t(
38
- I,
38
+ v,
39
39
  {
40
40
  type: "checkbox",
41
41
  ref: x,
42
- id: i,
43
- className: o(N(l), {
42
+ id: c,
43
+ className: m(N(i), {
44
44
  "gi-checkbox-indeterminate": h
45
45
  }),
46
- "aria-labelledby": c ? `${i}-label` : void 0,
46
+ "aria-labelledby": o ? `${c}-label` : void 0,
47
47
  ...u
48
48
  }
49
49
  ),
50
- c && /* @__PURE__ */ t(
51
- "label",
50
+ o && /* @__PURE__ */ t(
51
+ I,
52
52
  {
53
- id: `${i}-label`,
54
- htmlFor: a ? void 0 : i,
55
- className: o({
56
- "gi-rich-label": a
57
- }),
58
- children: c
53
+ id: `${c}-label`,
54
+ htmlFor: n ? void 0 : c,
55
+ size: i,
56
+ className: n ? void 0 : "gi-cursor-pointer",
57
+ children: o
59
58
  }
60
59
  )
61
60
  ]
62
61
  }
63
62
  ),
64
- m && /* @__PURE__ */ n("div", { className: "gi-input-checkbox-hint-container", children: [
65
- /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t("div", { className: v(l) }) }),
66
- /* @__PURE__ */ t(f, { id: `${i}-hint`, text: m })
63
+ s && /* @__PURE__ */ a("div", { className: "gi-input-checkbox-hint-container", children: [
64
+ /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t("div", { className: S(i) }) }),
65
+ /* @__PURE__ */ t(C, { id: `${c}-hint`, text: s })
67
66
  ] })
68
67
  ] });
69
68
  }
70
- ), S = ({
69
+ ), w = ({
71
70
  error: e,
72
- ...l
71
+ ...i
73
72
  }) => /* @__PURE__ */ t(
74
73
  d,
75
74
  {
76
- ...l,
75
+ ...i,
77
76
  size: "sm",
78
77
  containerProps: {
79
78
  "data-table-cell": !0,
@@ -82,9 +81,9 @@ const N = (e) => {
82
81
  }
83
82
  );
84
83
  d.displayName = "InputCheckbox";
85
- S.displayName = "InputCheckboxTableCell";
84
+ w.displayName = "InputCheckboxTableCell";
86
85
  export {
87
86
  d as InputCheckbox,
88
- S as InputCheckboxTableCell,
89
- v as getCheckboxWidth
87
+ w as InputCheckboxTableCell,
88
+ S as getCheckboxWidth
90
89
  };
@@ -1,24 +1,23 @@
1
1
  "use client";
2
- import "@ogcio/design-system-react/browser-check";
3
- import { jsx as c } from "react/jsx-runtime";
4
- import { useState as f, useEffect as g, Children as v, isValidElement as k, cloneElement as E } from "react";
5
- const I = ({ size: p, groupId: e, inline: u, onChange: t, children: d, values: n }) => {
6
- const [l, s] = f(
2
+ import { jsx as r } from "react/jsx-runtime";
3
+ import { useState as g, useEffect as m, Children as v, isValidElement as k, cloneElement as E } from "react";
4
+ const C = ({ size: p, groupId: e, inline: u, onChange: t, children: d, values: n }) => {
5
+ const [l, s] = g(
7
6
  n || []
8
7
  );
9
- g(() => {
8
+ m(() => {
10
9
  s(n || []);
11
10
  }, [n]);
12
11
  const o = n === void 0 ? l : n, a = (i) => {
13
- let r = [];
14
- r = o.includes(i) ? o.filter((m) => m !== i) : [...o, i], n === void 0 && s(r), t == null || t(r);
12
+ let c = [];
13
+ c = o.includes(i) ? o.filter((f) => f !== i) : [...o, i], n === void 0 && s(c), t == null || t(c);
15
14
  }, h = v.map(d, (i) => k(i) ? E(i, {
16
15
  onChange: () => a(i.props.value),
17
16
  checked: o.includes(i.props.value),
18
17
  size: p,
19
18
  name: e
20
19
  }) : i);
21
- return /* @__PURE__ */ c("div", { className: "gi-input-group-container", children: /* @__PURE__ */ c("div", { className: "gi-input-group-options-container", children: /* @__PURE__ */ c(
20
+ return /* @__PURE__ */ r("div", { className: "gi-input-group-container", children: /* @__PURE__ */ r("div", { className: "gi-input-group-options-container", children: /* @__PURE__ */ r(
22
21
  "div",
23
22
  {
24
23
  className: u ? "gi-input-group-options-inline" : "gi-input-group-options-stacked",
@@ -27,5 +26,5 @@ const I = ({ size: p, groupId: e, inline: u, onChange: t, children: d, values: n
27
26
  ) }) });
28
27
  };
29
28
  export {
30
- I as InputCheckboxGroup
29
+ C as InputCheckboxGroup
31
30
  };
@@ -1,5 +1,4 @@
1
1
  "use client";
2
- import "@ogcio/design-system-react/browser-check";
3
2
  import { jsx as e } from "react/jsx-runtime";
4
3
  import { forwardRef as r, useState as c } from "react";
5
4
  import { InputText as l } from "../input-text/input-text.js";
@@ -1,66 +1,63 @@
1
1
  "use client";
2
- import "@ogcio/design-system-react/browser-check";
3
- import { jsxs as n, jsx as i } from "react/jsx-runtime";
4
- import { useId as h } from "react";
5
- import { cn as s } from "../cn.js";
6
- import { HintText as p } from "../hint-text/hint-text.js";
7
- import { InputText as v } from "../input-text/input-text.js";
2
+ import { jsxs as l, jsx as i } from "react/jsx-runtime";
3
+ import { useId as p } from "react";
4
+ import { cn as u } from "../cn.js";
5
+ import { HintText as v } from "../hint-text/hint-text.js";
6
+ import { InputText as h } from "../input-text/input-text.js";
8
7
  import { Label as b } from "../label/label.js";
9
8
  import { Input as x } from "../primitives/input.js";
10
9
  import { InputRadioSizeEnum as g } from "./types.js";
11
- const C = (e) => e === g.Small ? "gi-input-radio-small" : "gi-input-radio-medium", q = (e) => e === g.Small ? "gi-w-6" : "gi-w-8", E = ({
12
- label: e,
13
- children: c,
14
- hint: a,
10
+ const C = (r) => r === g.Small ? "gi-input-radio-small" : "gi-input-radio-medium", T = (r) => r === g.Small ? "gi-w-6" : "gi-w-8", q = ({
11
+ label: r,
12
+ children: s,
13
+ hint: t,
15
14
  id: f,
16
- size: t = "md",
15
+ size: a = "md",
17
16
  conditionalInput: d,
18
17
  checked: o,
19
18
  ...m
20
19
  }) => {
21
- const r = f ?? h(), l = c ?? e, u = !!c;
22
- return /* @__PURE__ */ n("div", { className: "gi-input-radio-container", children: [
20
+ const e = f ?? p(), n = s ?? r, c = !!s;
21
+ return /* @__PURE__ */ l("div", { className: "gi-input-radio-container", children: [
23
22
  /* @__PURE__ */ i(
24
23
  x,
25
24
  {
26
25
  type: "radio",
27
- id: r,
26
+ id: e,
28
27
  ...o === void 0 ? { defaultChecked: m.defaultChecked } : { checked: o, onChange: m.onChange },
29
- className: C(t),
30
- "aria-describedby": a ? `${r}-hint` : void 0,
28
+ className: C(a),
29
+ "aria-describedby": t ? `${e}-hint` : void 0,
31
30
  "aria-required": d ? "true" : "false",
32
- "aria-labelledby": l ? `${r}-label` : void 0,
31
+ "aria-labelledby": n ? `${e}-label` : void 0,
33
32
  ...m
34
33
  }
35
34
  ),
36
- /* @__PURE__ */ n(
35
+ /* @__PURE__ */ l(
37
36
  "div",
38
37
  {
39
- className: s({
40
- "gi-mt-1": t === "md"
38
+ className: u({
39
+ "gi-mt-1": a === "md"
41
40
  }),
42
41
  children: [
43
- l && /* @__PURE__ */ i(
42
+ n && /* @__PURE__ */ i(
44
43
  b,
45
44
  {
46
- id: `${r}-label`,
47
- htmlFor: u ? void 0 : r,
48
- size: t,
49
- className: s({
50
- "gi-rich-label": u
51
- }),
52
- children: l
45
+ id: `${e}-label`,
46
+ htmlFor: c ? void 0 : e,
47
+ size: a,
48
+ className: c ? void 0 : "gi-cursor-pointer",
49
+ children: n
53
50
  }
54
51
  ),
55
- (a || d) && /* @__PURE__ */ i("div", { className: "gi-radio-conditional-divider-container", children: /* @__PURE__ */ n("div", { children: [
56
- a && /* @__PURE__ */ i(p, { text: a, size: t }),
52
+ (t || d) && /* @__PURE__ */ i("div", { className: "gi-radio-conditional-divider-container", children: /* @__PURE__ */ l("div", { children: [
53
+ t && /* @__PURE__ */ i(v, { text: t, size: a }),
57
54
  d && /* @__PURE__ */ i(
58
55
  "div",
59
56
  {
60
- className: s("gi-mt-3", {
57
+ className: u("gi-mt-3", {
61
58
  "gi-hidden": !o
62
59
  }),
63
- children: /* @__PURE__ */ i(v, { ...d })
60
+ children: /* @__PURE__ */ i(h, { ...d })
64
61
  }
65
62
  )
66
63
  ] }) })
@@ -70,6 +67,6 @@ const C = (e) => e === g.Small ? "gi-input-radio-small" : "gi-input-radio-medium
70
67
  ] });
71
68
  };
72
69
  export {
73
- E as InputRadio,
74
- q as getRadioWidth
70
+ q as InputRadio,
71
+ T as getRadioWidth
75
72
  };
@@ -1,13 +1,12 @@
1
1
  "use client";
2
- import "@ogcio/design-system-react/browser-check";
3
2
  import { jsx as r } from "react/jsx-runtime";
4
3
  import { useState as a, useEffect as g, Children as m, isValidElement as v, cloneElement as f } from "react";
5
- const k = ({
6
- groupId: p,
7
- inline: s,
4
+ const N = ({
5
+ groupId: s,
6
+ inline: c,
8
7
  onChange: n,
9
8
  value: o,
10
- children: c
9
+ children: p
11
10
  }) => {
12
11
  const [u, t] = a(
13
12
  o || null
@@ -17,20 +16,20 @@ const k = ({
17
16
  }, [o]);
18
17
  const d = o === void 0 ? u : o, e = (i) => {
19
18
  o === void 0 && t(i.target.value), n == null || n(i);
20
- }, l = m.map(c, (i) => v(i) ? f(i, {
19
+ }, l = m.map(p, (i) => v(i) ? f(i, {
21
20
  onChange: e,
22
21
  checked: d === i.props.value,
23
- name: p
22
+ name: s
24
23
  }) : i);
25
24
  return /* @__PURE__ */ r("div", { className: "gi-input-group-container", children: /* @__PURE__ */ r("div", { className: "gi-input-group-options-container", children: /* @__PURE__ */ r(
26
25
  "div",
27
26
  {
28
27
  role: "radiogroup",
29
- className: s ? "gi-input-group-options-inline" : "gi-input-group-options-stacked",
28
+ className: c ? "gi-input-group-options-inline" : "gi-input-group-options-stacked",
30
29
  children: l
31
30
  }
32
31
  ) }) });
33
32
  };
34
33
  export {
35
- k as InputRadioGroup
34
+ N as InputRadioGroup
36
35
  };
@@ -1,5 +1,4 @@
1
1
  "use client";
2
- import "@ogcio/design-system-react/browser-check";
3
2
  import { jsx as n, jsxs as m } from "react/jsx-runtime";
4
3
  import { forwardRef as d, useRef as W, useImperativeHandle as _, useMemo as j } from "react";
5
4
  import { cn as u } from "../cn.js";
@@ -151,7 +150,7 @@ const H = d(
151
150
  ({ type: a = "text", clearButtonEnabled: e, ...r }, t) => e || a === "search" ? /* @__PURE__ */ n(H, { ref: t, type: a, ...r }) : /* @__PURE__ */ n(h, { ref: t, type: a, ...r })
152
151
  );
153
152
  I.displayName = "InputText";
154
- const G = d(({ type: a = "text", error: e, ...r }, t) => /* @__PURE__ */ n(
153
+ const F = d(({ type: a = "text", error: e, ...r }, t) => /* @__PURE__ */ n(
155
154
  I,
156
155
  {
157
156
  ...r,
@@ -167,5 +166,5 @@ const G = d(({ type: a = "text", error: e, ...r }, t) => /* @__PURE__ */ n(
167
166
  export {
168
167
  p as InputActionButton,
169
168
  I as InputText,
170
- G as InputTextTableCell
169
+ F as InputTextTableCell
171
170
  };