@ogcio/design-system-react 1.32.0 → 1.33.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 (42) hide show
  1. package/dist/accordion/accordion-item.js +62 -57
  2. package/dist/alert/alert.js +37 -39
  3. package/dist/alert/variants.d.ts +49 -52
  4. package/dist/alert/variants.js +17 -18
  5. package/dist/atoms/Button.d.ts +2 -2
  6. package/dist/atoms/Button.js +2 -1
  7. package/dist/button/button.d.ts +2 -9
  8. package/dist/button/button.js +65 -32
  9. package/dist/button/helpers.d.ts +2 -1
  10. package/dist/button/types.d.ts +25 -8
  11. package/dist/button-group/button-group.js +43 -45
  12. package/dist/button-group/types.d.ts +5 -5
  13. package/dist/card/card-legacy.js +1 -1
  14. package/dist/card/types.d.ts +1 -1
  15. package/dist/combo-box/dropdown-item.js +1 -1
  16. package/dist/cookie-banner/cookie-banner.d.ts +1 -1
  17. package/dist/data-table/data-table-header.js +1 -1
  18. package/dist/drawer/drawer.d.ts +1 -1
  19. package/dist/drawer/drawer.js +17 -17
  20. package/dist/error-text/error-text.js +28 -27
  21. package/dist/forms/form-field/form-field.js +24 -25
  22. package/dist/header/components/header-search.js +2 -2
  23. package/dist/hint-text/hint-text.js +26 -20
  24. package/dist/icon-button/icon-button.d.ts +3 -5
  25. package/dist/index.d.ts +1 -1
  26. package/dist/label/label.d.ts +78 -30
  27. package/dist/label/label.js +29 -14
  28. package/dist/modal/modal.content.js +1 -1
  29. package/dist/modal/modal.js +38 -38
  30. package/dist/modal/types.d.ts +5 -4
  31. package/dist/pagination/pagination.js +27 -28
  32. package/dist/score-select/type.d.ts +2 -2
  33. package/dist/select/select-next.js +87 -87
  34. package/dist/side-nav/side-nav.js +1 -1
  35. package/dist/styles.css +1 -1
  36. package/dist/tabs/tab-item.js +53 -71
  37. package/dist/tabs/variants.d.ts +269 -0
  38. package/dist/tabs/variants.js +87 -0
  39. package/dist/tooltip/tooltip.js +27 -35
  40. package/dist/tooltip/variants.d.ts +115 -0
  41. package/dist/tooltip/variants.js +59 -0
  42. package/package.json +2 -2
@@ -1,35 +1,35 @@
1
1
  "use client";
2
2
  import { jsx as s, jsxs as _ } from "react/jsx-runtime";
3
- import { forwardRef as B, useRef as T, useState as k, useImperativeHandle as ee, Children as R, isValidElement as G, useEffect as O, useCallback as te } from "react";
4
- import { cn as H } from "../cn.js";
3
+ import { forwardRef as B, useRef as T, useState as k, useImperativeHandle as ee, Children as G, isValidElement as H, useEffect as O, useCallback as te } from "react";
4
+ import { cn as P } from "../cn.js";
5
5
  import { useDomId as re } from "../hooks/use-dom-id.js";
6
6
  import { useScrollHighlightedItem as ne } from "../hooks/use-scroll-highlighted-item.js";
7
- import { translate as F } from "../i18n/utility.js";
7
+ import { translate as J } from "../i18n/utility.js";
8
8
  import { InputText as oe } from "../input-text/input-text.js";
9
- import { Popover as le } from "../popover/popover.js";
10
- import { cycleEnabledIndex as ae } from "../utilities.js";
11
- import { SelectMenu as se, SelectMenuOption as J, SelectMenuGroupItem as ce } from "./select-menu.js";
9
+ import { Popover as ae } from "../popover/popover.js";
10
+ import { cycleEnabledIndex as le } from "../utilities.js";
11
+ import { SelectMenu as se, SelectMenuOption as M, SelectMenuGroupItem as ce } from "./select-menu.js";
12
12
  import { SelectSearch as ie } from "./select-search.js";
13
13
  const pe = B(
14
14
  ({
15
15
  children: x,
16
- value: u,
16
+ value: p,
17
17
  defaultValue: E = "",
18
18
  onChange: I,
19
- onMenuClose: f,
19
+ onMenuClose: u,
20
20
  enableSearch: h,
21
- disabled: l,
21
+ disabled: a,
22
22
  name: i,
23
- onBlur: m,
24
- placeholder: P,
23
+ onBlur: f,
24
+ placeholder: $,
25
25
  ...N
26
- }, Q) => {
27
- const c = T(null), D = T(null), A = T(null), $ = T(!1), [a, j] = k(
28
- E || u
29
- ), [S, p] = k(!1), [W, K] = k(""), [g, V] = k(-1);
30
- ee(Q, () => c.current), ne(A, g);
31
- const d = R.toArray(x).filter(
32
- (e) => G(e)
26
+ }, W) => {
27
+ const c = T(null), D = T(null), A = T(null), j = T(!1), [l, K] = k(
28
+ E || p
29
+ ), [m, S] = k(!1), [X, V] = k(""), [g, L] = k(-1);
30
+ ee(W, () => c.current), ne(A, g);
31
+ const d = G.toArray(x).filter(
32
+ (e) => H(e)
33
33
  );
34
34
  O(() => {
35
35
  var r, t;
@@ -38,19 +38,19 @@ const pe = B(
38
38
  const o = (r = n.type) == null ? void 0 : r.componentType;
39
39
  if (o === "SelectItemNext") {
40
40
  const y = n;
41
- if (y.props.value === a) {
41
+ if (y.props.value === l) {
42
42
  e = y;
43
43
  break;
44
44
  }
45
45
  }
46
46
  if (o === "SelectGroupItemNext") {
47
- const y = n, b = R.toArray(y.props.children).find(
47
+ const y = n, b = G.toArray(y.props.children).find(
48
48
  (v) => {
49
- var z;
50
- return ((z = v == null ? void 0 : v.type) == null ? void 0 : z.componentType) === "SelectItemNext" && v.props.value === a;
49
+ var F;
50
+ return ((F = v == null ? void 0 : v.type) == null ? void 0 : F.componentType) === "SelectItemNext" && v.props.value === l;
51
51
  }
52
52
  );
53
- if (b && G(b)) {
53
+ if (b && H(b)) {
54
54
  e = b;
55
55
  break;
56
56
  }
@@ -58,138 +58,138 @@ const pe = B(
58
58
  }
59
59
  if (e) {
60
60
  const n = ((t = e.props.children) == null ? void 0 : t.toString()) || "";
61
- K(n);
61
+ V(n);
62
62
  } else
63
- K(""), c.current && (c.current.value = "");
64
- }, [a, d]), O(() => {
65
- S || V(-1);
66
- }, [S]), O(() => {
67
- u !== void 0 && j(u);
68
- }, [u]);
69
- const L = () => {
63
+ V(""), c.current && (c.current.value = "");
64
+ }, [l, d]), O(() => {
65
+ m || L(-1);
66
+ }, [m]), O(() => {
67
+ p !== void 0 && K(p);
68
+ }, [p]);
69
+ const C = () => {
70
70
  var e;
71
- l || (p(!0), (e = c.current) == null || e.focus());
72
- }, X = (e) => {
73
- p(e), e || f == null || f();
71
+ a || (U(!m), (e = c.current) == null || e.focus());
74
72
  }, U = (e) => {
75
- if (p(!1), j(e), I && (I({
73
+ S(e), e || u == null || u();
74
+ }, q = (e) => {
75
+ if (S(!1), K(e), I && (I({
76
76
  target: { name: i, value: e },
77
77
  currentTarget: { name: i, value: e },
78
78
  type: "change",
79
79
  bubbles: !0
80
- }), m)) {
80
+ }), f)) {
81
81
  const t = {
82
82
  target: { name: i, value: e },
83
83
  currentTarget: { name: i, value: e },
84
84
  type: "blur",
85
85
  bubbles: !0
86
86
  };
87
- m == null || m(t);
87
+ f == null || f(t);
88
88
  }
89
89
  }, Y = te(
90
90
  (e) => {
91
91
  var r;
92
- if (!l)
92
+ if (!a)
93
93
  switch (e.key) {
94
94
  case "ArrowDown":
95
95
  case "ArrowUp": {
96
96
  e.preventDefault();
97
97
  const t = e.key === "ArrowDown" ? 1 : -1;
98
- V((n) => ae(d, n === -1 ? t === -1 ? 0 : -1 : n, t)), p(!0);
98
+ L((n) => le(d, n === -1 ? t === -1 ? 0 : -1 : n, t)), S(!0);
99
99
  break;
100
100
  }
101
101
  case "Enter":
102
102
  case "NumpadEnter": {
103
- if (e.preventDefault(), S && g != -1 && d[g]) {
103
+ if (e.preventDefault(), m && g != -1 && d[g]) {
104
104
  const t = d[g];
105
- (r = t.props) != null && r.disabled || U(t.props.value);
106
- } else
107
- p(!0);
105
+ (r = t.props) != null && r.disabled || q(t.props.value);
106
+ }
107
+ C();
108
108
  break;
109
109
  }
110
110
  case "Tab": {
111
- p(!1);
111
+ S(!1);
112
112
  break;
113
113
  }
114
114
  case "Escape": {
115
- e.preventDefault(), p(!1);
115
+ e.preventDefault(), S(!1);
116
116
  break;
117
117
  }
118
118
  }
119
119
  },
120
- [d, S, g]
120
+ [d, m, g]
121
121
  ), Z = (e) => {
122
122
  var t, n;
123
123
  const r = e.relatedTarget;
124
- if (r && ((t = A.current) != null && t.contains(r) || (n = D.current) != null && n.contains(r)) || $.current) {
125
- setTimeout(() => $.current = !1, 0);
124
+ if (r && ((t = A.current) != null && t.contains(r) || (n = D.current) != null && n.contains(r)) || j.current) {
125
+ setTimeout(() => j.current = !1, 0);
126
126
  return;
127
127
  }
128
- if (m) {
129
- const o = u ?? a ?? "";
130
- m({
128
+ if (f) {
129
+ const o = p ?? l ?? "";
130
+ f({
131
131
  target: { name: i, value: o },
132
132
  currentTarget: { name: i, value: o },
133
133
  type: "blur",
134
134
  bubbles: !0
135
135
  });
136
136
  }
137
- }, C = re(), q = N["aria-label"] ?? F("select.next.placeholder", { defaultValue: "Select" });
137
+ }, R = re(), z = N["aria-label"] ?? J("select.next.placeholder", { defaultValue: "Select" });
138
138
  return O(() => {
139
- c.current && c.current.setAttribute("aria-labelledby", C);
140
- }, [C, h]), h ? /* @__PURE__ */ s("div", { className: H("gi-relative gi-w-full", N.className), children: /* @__PURE__ */ s(
139
+ c.current && c.current.setAttribute("aria-labelledby", R);
140
+ }, [R, h]), h ? /* @__PURE__ */ s("div", { className: P("gi-relative gi-w-full", N.className), children: /* @__PURE__ */ s(
141
141
  ie,
142
142
  {
143
143
  ...N,
144
- value: a,
144
+ value: l,
145
145
  onChange: I,
146
- disabled: l,
146
+ disabled: a,
147
147
  ref: c,
148
- onBlur: m,
148
+ onBlur: f,
149
149
  name: i,
150
- placeholder: P,
150
+ placeholder: $,
151
151
  children: x
152
152
  }
153
153
  ) }) : /* @__PURE__ */ _(
154
154
  "div",
155
155
  {
156
- "aria-disabled": l,
157
- className: H("gi-relative gi-w-full", N.className),
156
+ "aria-disabled": a,
157
+ className: P("gi-relative gi-w-full", N.className),
158
158
  children: [
159
- /* @__PURE__ */ s("span", { id: C, className: "gi-sr-only", children: q }),
159
+ /* @__PURE__ */ s("span", { id: R, className: "gi-sr-only", children: z }),
160
160
  /* @__PURE__ */ s(
161
161
  oe,
162
162
  {
163
163
  ...N,
164
164
  autoComplete: "off",
165
- "aria-label": q,
166
- "aria-disabled": l,
167
- disabled: l,
168
- placeholder: P ?? F("select.next.placeholder", { defaultValue: "Search" }),
165
+ "aria-label": z,
166
+ "aria-disabled": a,
167
+ disabled: a,
168
+ placeholder: $ ?? J("select.next.placeholder", { defaultValue: "Search" }),
169
169
  readOnly: !0,
170
170
  inputClassName: "gi-cursor-pointer",
171
- iconEndClassName: H({
172
- "gi-cursor-pointer": !l,
173
- "gi-cursor-not-allowed gi-pointer-events-none": l
171
+ iconEndClassName: P({
172
+ "gi-cursor-pointer": !a,
173
+ "gi-cursor-not-allowed gi-pointer-events-none": a
174
174
  }),
175
- iconEnd: S ? "keyboard_arrow_up" : "keyboard_arrow_down",
176
- onIconEndClick: L,
175
+ iconEnd: m ? "keyboard_arrow_up" : "keyboard_arrow_down",
176
+ onIconEndClick: C,
177
177
  ref: c,
178
178
  iconEndRef: D,
179
- value: W,
180
- onClick: L,
179
+ value: X,
180
+ onClick: C,
181
181
  onKeyDown: Y,
182
182
  onBlur: Z,
183
183
  name: i
184
184
  }
185
185
  ),
186
186
  /* @__PURE__ */ s(
187
- le,
187
+ ae,
188
188
  {
189
189
  triggerRef: c,
190
190
  extraRefs: [D],
191
- onOpenChange: X,
192
- open: S,
191
+ onOpenChange: U,
192
+ open: m,
193
193
  maxHeight: 304,
194
194
  options: {
195
195
  placement: "bottom-start",
@@ -204,7 +204,7 @@ const pe = B(
204
204
  {
205
205
  ref: A,
206
206
  onChange: (e) => {
207
- p(!1), U(e);
207
+ S(!1), q(e);
208
208
  },
209
209
  enableSearch: h,
210
210
  children: d.map((e, r) => {
@@ -213,24 +213,24 @@ const pe = B(
213
213
  if (t === "SelectItemNext") {
214
214
  const o = e;
215
215
  return /* @__PURE__ */ s(
216
- J,
216
+ M,
217
217
  {
218
218
  ...o.props,
219
219
  isHighlighted: g === r,
220
- selected: (a == null ? void 0 : a.toString()) === o.props.value.toString(),
220
+ selected: (l == null ? void 0 : l.toString()) === o.props.value.toString(),
221
221
  index: r
222
222
  },
223
223
  `SelectItemNext-${o.props.value.toString()}`
224
224
  );
225
225
  } else if (t === "SelectGroupItemNext") {
226
- const o = e, y = R.toArray(o.props.children).filter((b) => G(b)).map((b, v) => {
226
+ const o = e, y = G.toArray(o.props.children).filter((b) => H(b)).map((b, v) => {
227
227
  const w = b.props;
228
228
  return /* @__PURE__ */ s(
229
- J,
229
+ M,
230
230
  {
231
231
  ...w,
232
232
  isHighlighted: g === r,
233
- selected: (a == null ? void 0 : a.toString()) === w.value.toString(),
233
+ selected: (l == null ? void 0 : l.toString()) === w.value.toString(),
234
234
  index: v
235
235
  },
236
236
  `SelectGroupItemNext-SelectItemNext-${w.value.toString()}`
@@ -255,8 +255,8 @@ const pe = B(
255
255
  }
256
256
  );
257
257
  }
258
- ), M = () => null;
259
- Object.defineProperty(M, "componentType", {
258
+ ), Q = () => null;
259
+ Object.defineProperty(Q, "componentType", {
260
260
  value: "SelectItemNext",
261
261
  writable: !1,
262
262
  enumerable: !1
@@ -268,7 +268,7 @@ Object.defineProperty(ue, "componentType", {
268
268
  enumerable: !1
269
269
  });
270
270
  const Ne = (x) => {
271
- const { options: u, defaultValue: E, onChange: I, error: f } = x;
271
+ const { options: p, defaultValue: E, onChange: I, error: u } = x;
272
272
  return /* @__PURE__ */ s(
273
273
  pe,
274
274
  {
@@ -276,14 +276,14 @@ const Ne = (x) => {
276
276
  defaultValue: E,
277
277
  onChange: I,
278
278
  "data-table-cell": "true",
279
- "data-table-cell-error-state": f == null ? void 0 : f.toString(),
280
- children: u.map(({ value: h, label: l }) => /* @__PURE__ */ s(M, { value: h, children: l }, `${h}-${l}`))
279
+ "data-table-cell-error-state": u == null ? void 0 : u.toString(),
280
+ children: p.map(({ value: h, label: a }) => /* @__PURE__ */ s(Q, { value: h, children: a }, `${h}-${a}`))
281
281
  }
282
282
  );
283
283
  };
284
284
  export {
285
285
  ue as SelectGroupItemNext,
286
- M as SelectItemNext,
286
+ Q as SelectItemNext,
287
287
  pe as SelectNext,
288
288
  Ne as SelectNextTableCell
289
289
  };
@@ -2,7 +2,7 @@
2
2
  import { jsxs as x, Fragment as R, jsx as s } from "react/jsx-runtime";
3
3
  import r, { memo as k, useEffect as V, useCallback as g, useState as $ } from "react";
4
4
  import q from "../Heading.js";
5
- import { Button as A } from "../button/button.js";
5
+ import A from "../atoms/Button.js";
6
6
  import { cn as m } from "../cn.js";
7
7
  import { Icon as z } from "../icon/icon.js";
8
8
  import { Link as G } from "../link/link.js";