@ogcio/design-system-react 1.22.1 → 1.24.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 (95) hide show
  1. package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
  2. package/dist/accordion/accordion-item.d.ts +3 -5
  3. package/dist/accordion/accordion-item.js +32 -28
  4. package/dist/accordion/accordion.d.ts +3 -5
  5. package/dist/accordion/accordion.js +22 -33
  6. package/dist/alert/alert.js +19 -20
  7. package/dist/autocomplete/autocomplete.js +167 -169
  8. package/dist/autocomplete/use-autocomplete-controller.js +1 -1
  9. package/dist/browser-support/runtime.js +2 -3
  10. package/dist/button/button.js +11 -12
  11. package/dist/button-group/button-group.js +4 -5
  12. package/dist/card/card-next.js +122 -125
  13. package/dist/card/card.js +4 -5
  14. package/dist/checkbox/checkbox-group.js +3 -4
  15. package/dist/checkbox/checkbox.js +4 -5
  16. package/dist/chip/chip.js +11 -12
  17. package/dist/clsx-OuTLNxxd.js +16 -0
  18. package/dist/cn.js +4 -16
  19. package/dist/combo-box/dropdown-item.js +2 -3
  20. package/dist/cookie-banner/cookie-banner.js +6 -7
  21. package/dist/data-table/editable-table-cell.js +3 -4
  22. package/dist/data-table/index.d.ts +7 -0
  23. package/dist/data-table/index.js +20 -0
  24. package/dist/details/details.js +6 -7
  25. package/dist/drawer/drawer.js +18 -19
  26. package/dist/footer/footer.js +2 -3
  27. package/dist/forms/form-field/form-field.js +2 -3
  28. package/dist/header/components/header-menu.js +17 -18
  29. package/dist/header/header-legacy.js +2 -3
  30. package/dist/header/header-next/components/header-logo.js +3 -4
  31. package/dist/header/header-next/components/header-title.js +0 -1
  32. package/dist/header/header-next/components/menu/components/header-menu-item-button.js +4 -5
  33. package/dist/header/header-next/components/menu/components/header-menu-item-link.js +0 -1
  34. package/dist/header/header-next/components/menu/components/header-menu-item-separator.js +4 -5
  35. package/dist/header/header-next/components/menu/components/header-menu-item-slot.js +0 -1
  36. package/dist/header/header-next/components/menu/header-menu-context.js +9 -10
  37. package/dist/header/header-next/components/menu/header-primary-menu.js +4 -5
  38. package/dist/header/header-next/components/menu/header-secondary-menu.js +0 -1
  39. package/dist/header/header-next/header-context.js +4 -5
  40. package/dist/header/header-next/header-next.js +2 -3
  41. package/dist/hooks/use-breakpoint.js +7 -8
  42. package/dist/hooks/use-toggle-map.js +12 -13
  43. package/dist/i18n/config.d.ts +1 -1
  44. package/dist/i18n/config.js +14 -11
  45. package/dist/i18n/utility.js +1 -1
  46. package/dist/i18nInstance-D_96ADqd.js +48 -0
  47. package/dist/i18next-B_GQfCrJ.js +1362 -0
  48. package/dist/icon/icon.d.ts +16 -4
  49. package/dist/icon/icon.js +79 -167
  50. package/dist/icon-button/icon-button.js +4 -5
  51. package/dist/index.d.ts +2 -5
  52. package/dist/index.js +231 -220
  53. package/dist/input-checkbox/input-checkbox.js +15 -16
  54. package/dist/input-checkbox-group/input-checkbox-group.js +9 -10
  55. package/dist/input-password/input-password.js +0 -1
  56. package/dist/input-radio/input-radio.js +11 -12
  57. package/dist/input-radio-group/input-radio-group.js +8 -9
  58. package/dist/input-text/input-text.js +2 -3
  59. package/dist/{lodash-D1c5hFAM.js → lodash-LsP9-6SV.js} +1343 -1342
  60. package/dist/modal/modal.js +4 -5
  61. package/dist/pagination/pagination.js +713 -58
  62. package/dist/phase-banner/phase-banner.js +2 -3
  63. package/dist/popover/popover.js +2 -3
  64. package/dist/radio/radio-group.js +0 -1
  65. package/dist/radio/radio.js +0 -1
  66. package/dist/score-select/score-select.js +3 -4
  67. package/dist/select/select-menu.js +43 -41
  68. package/dist/select/select-next.js +193 -161
  69. package/dist/select/select.js +3 -4
  70. package/dist/side-nav/side-nav.js +9 -10
  71. package/dist/spinner/spinner.js +2 -3
  72. package/dist/stack/stack.js +20 -21
  73. package/dist/styles.css +1 -1
  74. package/dist/summary-list/summary-list-action.js +6 -7
  75. package/dist/summary-list/summary-list-context.js +4 -5
  76. package/dist/summary-list/summary-list-header.js +12 -13
  77. package/dist/summary-list/summary-list-row.js +17 -18
  78. package/dist/summary-list/summary-list-value.js +0 -1
  79. package/dist/summary-list/summary-list.js +4 -5
  80. package/dist/table/table-data.js +11 -12
  81. package/dist/table/table-header.js +2 -3
  82. package/dist/tabs/tab-item.d.ts +1 -1
  83. package/dist/tabs/tab-item.js +0 -1
  84. package/dist/tabs/tab-list.js +23 -24
  85. package/dist/tag/tag.d.ts +9 -3
  86. package/dist/tag/tag.js +35 -18
  87. package/dist/text-input/text-input.js +0 -1
  88. package/dist/textarea/textarea.js +12 -13
  89. package/dist/toast/ds-toast.js +10 -11
  90. package/dist/toast/toast.js +15 -16
  91. package/dist/tooltip/tooltip.js +12 -13
  92. package/dist/utilities.d.ts +4 -1
  93. package/dist/utilities.js +29 -16
  94. package/package.json +6 -5
  95. package/dist/i18next-DxWa09nx.js +0 -1395
@@ -1,10 +1,9 @@
1
1
  "use client";
2
- import "@ogcio/design-system-react/browser-check";
3
2
  import { jsx as n, jsxs as d } from "react/jsx-runtime";
4
3
  import { Container as r } from "../container/container.js";
5
4
  import { useBreakpoint as c } from "../hooks/use-breakpoint.js";
6
5
  import { Tag as l } from "../tag/tag.js";
7
- function b({
6
+ function h({
8
7
  level: s,
9
8
  children: a,
10
9
  wrap: i = "none",
@@ -30,5 +29,5 @@ function b({
30
29
  return i === "container" ? /* @__PURE__ */ n(r, { children: e }) : i === "container-full-width" ? /* @__PURE__ */ n(r, { fullWidth: !0, children: e }) : e;
31
30
  }
32
31
  export {
33
- b as PhaseBanner
32
+ h as PhaseBanner
34
33
  };
@@ -1,5 +1,4 @@
1
1
  "use client";
2
- import "@ogcio/design-system-react/browser-check";
3
2
  import { jsx as dt } from "react/jsx-runtime";
4
3
  import { useRef as Ee, useEffect as Ae } from "react";
5
4
  import { cn as mt } from "../cn.js";
@@ -905,7 +904,7 @@ function br(e) {
905
904
  var wr = [Xt, sr, Ft, kt, or, er, ur, Wt, rr], xr = /* @__PURE__ */ br({
906
905
  defaultModifiers: wr
907
906
  });
908
- const Br = ({
907
+ const Dr = ({
909
908
  triggerRef: e,
910
909
  children: t,
911
910
  className: r,
@@ -1002,5 +1001,5 @@ const Br = ({
1002
1001
  ) : null;
1003
1002
  };
1004
1003
  export {
1005
- Br as Popover
1004
+ Dr as Popover
1006
1005
  };
@@ -1,5 +1,4 @@
1
1
  "use client";
2
- import "@ogcio/design-system-react/browser-check";
3
2
  import { InputRadioGroup as o } from "../input-radio-group/input-radio-group.js";
4
3
  const p = o;
5
4
  p.displayName = "RadioGroup";
@@ -1,5 +1,4 @@
1
1
  "use client";
2
- import "@ogcio/design-system-react/browser-check";
3
2
  import { InputRadio as o } from "../input-radio/input-radio.js";
4
3
  const i = o;
5
4
  i.displayName = "Radio";
@@ -1,12 +1,11 @@
1
1
  "use client";
2
- import "@ogcio/design-system-react/browser-check";
3
2
  import { jsxs as a, jsx as s, Fragment as F } from "react/jsx-runtime";
4
3
  import { useId as G } from "react";
5
4
  import { ButtonGroup as j, ButtonGroupItem as w } from "../button-group/button-group.js";
6
5
  import { cn as o } from "../cn.js";
7
6
  import { FormField as O, FormFieldLabel as V, FormFieldHint as E } from "../forms/form-field/form-field.js";
8
7
  import { useBreakpoint as H, Breakpoint as $ } from "../hooks/use-breakpoint.js";
9
- const P = ({
8
+ const K = ({
10
9
  name: B,
11
10
  size: x = "medium",
12
11
  orientation: t = "horizontal",
@@ -19,7 +18,7 @@ const P = ({
19
18
  onChange: v,
20
19
  type: f
21
20
  }) => {
22
- const p = G(), b = `${p}-label`, n = d ? `${p}-hint` : void 0, { breakpoint: h } = H(), g = h === $.ExtraSmall || h === $.Small;
21
+ const h = G(), b = `${h}-label`, n = d ? `${h}-hint` : void 0, { breakpoint: p } = H(), g = p === $.ExtraSmall || p === $.Small;
23
22
  let l = [];
24
23
  switch (f) {
25
24
  case "1-5": {
@@ -157,5 +156,5 @@ const P = ({
157
156
  ] });
158
157
  };
159
158
  export {
160
- P as ScoreSelect
159
+ K as ScoreSelect
161
160
  };
@@ -1,16 +1,15 @@
1
1
  "use client";
2
- import "@ogcio/design-system-react/browser-check";
3
2
  import { jsxs as v, jsx as r } from "react/jsx-runtime";
4
- import { forwardRef as F, useState as $, useEffect as R, Children as z, isValidElement as A, cloneElement as h } from "react";
3
+ import { forwardRef as F, useState as $, useEffect as R, Children as z, isValidElement as A, cloneElement as b } from "react";
5
4
  import { cn as P } from "../cn.js";
6
5
  import { translate as K } from "../i18n/utility.js";
7
6
  import { Icon as q } from "../icon/icon.js";
8
- import { InputText as H } from "../input-text/input-text.js";
9
- import { Label as J } from "../label/label.js";
10
- import { Spinner as Q } from "../spinner/spinner.js";
11
- const ie = F(
12
- ({ children: o, className: i, onChange: l, enableSearch: n, isLoading: c, showNoData: d }, g) => {
13
- const [s, O] = $(""), [S, w] = $([]);
7
+ import { InputText as J } from "../input-text/input-text.js";
8
+ import { Label as Q } from "../label/label.js";
9
+ import { Spinner as U } from "../spinner/spinner.js";
10
+ const ne = F(
11
+ ({ children: o, className: i, onChange: l, enableSearch: n, isLoading: c, showNoData: g }, O) => {
12
+ const [s, S] = $(""), [m, w] = $([]);
14
13
  R(() => {
15
14
  const u = z.toArray(o).filter(
16
15
  (a) => A(a)
@@ -23,7 +22,7 @@ const ie = F(
23
22
  if (typeof e.props.value == "string") {
24
23
  const D = ((I = (M = (L = e == null ? void 0 : e.props) == null ? void 0 : L.children) == null ? void 0 : M.toString()) == null ? void 0 : I.toLowerCase()) || "", E = (k = (T = e == null ? void 0 : e.props) == null ? void 0 : T.value) == null ? void 0 : k.toLowerCase();
25
24
  if (D.includes(x) || E.includes(x))
26
- return h(e, {
25
+ return b(e, {
27
26
  onChange: l,
28
27
  enableSearch: n
29
28
  });
@@ -35,15 +34,15 @@ const ie = F(
35
34
  e.props.children
36
35
  ).filter((t) => A(t)).map((t) => {
37
36
  var p;
38
- return ((p = t == null ? void 0 : t.type) == null ? void 0 : p.componentType) === "SelectMenuOption" ? h(t, { onChange: l }) : null;
37
+ return ((p = t == null ? void 0 : t.type) == null ? void 0 : p.componentType) === "SelectMenuOption" ? b(t, { onChange: l }) : null;
39
38
  }).filter(
40
39
  (t) => t !== null
41
40
  ).filter((t) => {
42
- var j, C, V;
43
- const p = ((C = (j = t.props.children) == null ? void 0 : j.toString()) == null ? void 0 : C.toLowerCase()) || "", f = ((V = t.props.value) == null ? void 0 : V.toLowerCase()) || "";
41
+ var j, V, C;
42
+ const p = ((V = (j = t.props.children) == null ? void 0 : j.toString()) == null ? void 0 : V.toLowerCase()) || "", f = ((C = t.props.value) == null ? void 0 : C.toLowerCase()) || "";
44
43
  return (p == null ? void 0 : p.includes(s.toLowerCase())) || (f == null ? void 0 : f.includes(s.toLowerCase()));
45
44
  });
46
- return G.length > 0 || s === "" ? h(e, {
45
+ return G.length > 0 || s === "" ? b(e, {
47
46
  children: G
48
47
  }) : null;
49
48
  }
@@ -53,42 +52,44 @@ const ie = F(
53
52
  }).filter(Boolean);
54
53
  w(u);
55
54
  }, [o, s, l]);
56
- const y = (m) => {
57
- O(m.target.value);
58
- }, b = () => c ? /* @__PURE__ */ r("div", { className: "gi-select-menu-loading", children: /* @__PURE__ */ r(Q, { size: "md" }) }) : d ? /* @__PURE__ */ r("div", { className: "gi-select-menu-option-not-found", children: K("autocomplete.noData", {
55
+ const y = (d) => {
56
+ S(d.target.value);
57
+ }, h = () => c ? /* @__PURE__ */ r("div", { className: "gi-select-menu-loading", children: /* @__PURE__ */ r(U, { size: "md" }) }) : g ? /* @__PURE__ */ r("div", { className: "gi-select-menu-option-not-found", children: K("autocomplete.noData", {
59
58
  defaultValue: "No data found."
60
- }) }) : /* @__PURE__ */ r("ul", { "aria-label": "options", role: "listbox", children: S });
61
- return /* @__PURE__ */ v("div", { ref: g, className: P("gi-select-menu-container", i), children: [
59
+ }) }) : /* @__PURE__ */ r("ul", { "aria-label": "options", role: "listbox", children: m });
60
+ return /* @__PURE__ */ v("div", { ref: O, className: P("gi-select-menu-container", i), children: [
62
61
  n && /* @__PURE__ */ r("div", { className: "gi-select-menu-input-container", children: /* @__PURE__ */ r(
63
- H,
62
+ J,
64
63
  {
65
64
  tabIndex: 0,
66
- placeholder: K("input.search"),
65
+ placeholder: K("input.search", {
66
+ defaultValue: "Search"
67
+ }),
67
68
  iconEnd: "search",
68
69
  onChange: y,
69
70
  value: s
70
71
  }
71
72
  ) }),
72
- /* @__PURE__ */ r("div", { className: "gi-select-menu-option-container", children: b() })
73
+ /* @__PURE__ */ r("div", { className: "gi-select-menu-option-container", children: h() })
73
74
  ] });
74
75
  }
75
- ), U = ({
76
+ ), W = ({
76
77
  children: o,
77
78
  value: i,
78
79
  selected: l,
79
80
  onChange: n,
80
81
  disabled: c,
81
- dataTestid: d,
82
- className: g,
82
+ dataTestid: g,
83
+ className: O,
83
84
  hidden: s,
84
- enableSearch: O,
85
- isHighlighted: S,
85
+ enableSearch: S,
86
+ isHighlighted: m,
86
87
  index: w,
87
88
  ...y
88
89
  }) => {
89
- const b = (u) => {
90
+ const h = (u) => {
90
91
  (u.key === "Enter" || u.key === " ") && (u.preventDefault(), n == null || n(i));
91
- }, m = () => {
92
+ }, d = () => {
92
93
  c || n == null || n(i);
93
94
  };
94
95
  return s ? null : /* @__PURE__ */ v(
@@ -100,18 +101,19 @@ const ie = F(
100
101
  "aria-selected": l,
101
102
  "aria-label": o == null ? void 0 : o.toString(),
102
103
  "aria-disabled": c,
103
- onKeyDown: b,
104
- onClick: m,
104
+ onKeyDown: h,
105
+ onClick: d,
105
106
  className: P(
106
107
  "gi-select-option-item",
107
108
  {
108
109
  "gi-select-option-item-disabled": c,
109
- "gi-select-option-item-highlighted": S
110
+ "gi-select-option-item-highlighted": m
110
111
  },
111
- g
112
+ O
112
113
  ),
113
- "data-search-enabled": O,
114
- "data-testid": d || `option-${i}`,
114
+ "data-highlighted": m,
115
+ "data-search-enabled": S,
116
+ "data-testid": g || `option-${i}`,
115
117
  ...y,
116
118
  children: [
117
119
  /* @__PURE__ */ r("span", { className: "gi-text-sm", children: o }),
@@ -121,26 +123,26 @@ const ie = F(
121
123
  `${o}-${i}`
122
124
  );
123
125
  };
124
- Object.defineProperty(U, "componentType", {
126
+ Object.defineProperty(W, "componentType", {
125
127
  value: "SelectMenuOption",
126
128
  writable: !1,
127
129
  enumerable: !1
128
130
  });
129
- const W = ({
131
+ const X = ({
130
132
  children: o,
131
133
  label: i,
132
134
  ...l
133
135
  }) => /* @__PURE__ */ v("div", { ...l, role: "group", className: "gi-px-3", children: [
134
- /* @__PURE__ */ r(J, { text: i, size: "sm", className: "gi-font-bold gi-pb-1" }),
136
+ /* @__PURE__ */ r(Q, { text: i, size: "sm", className: "gi-font-bold gi-pb-1" }),
135
137
  o
136
138
  ] });
137
- Object.defineProperty(W, "componentType", {
139
+ Object.defineProperty(X, "componentType", {
138
140
  value: "SelectMenuGroupItem",
139
141
  writable: !1,
140
142
  enumerable: !1
141
143
  });
142
144
  export {
143
- ie as SelectMenu,
144
- W as SelectMenuGroupItem,
145
- U as SelectMenuOption
145
+ ne as SelectMenu,
146
+ X as SelectMenuGroupItem,
147
+ W as SelectMenuOption
146
148
  };