@ogcio/design-system-react 1.11.3 → 1.12.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 (47) hide show
  1. package/dist/accordion/accordion-item.js +1 -1
  2. package/dist/alert/alert.js +1 -1
  3. package/dist/autocomplete/autocomplete.js +4 -4
  4. package/dist/button-group/button-group.js +44 -44
  5. package/dist/card/card-next.js +28 -28
  6. package/dist/combo-box/dropdown-item.js +30 -30
  7. package/dist/drawer/drawer.content.js +6 -6
  8. package/dist/drawer/drawer.js +8 -8
  9. package/dist/error-text/error-text.js +1 -1
  10. package/dist/forms/form-field/form-field.d.ts +18 -0
  11. package/dist/forms/form-field/form-field.js +85 -0
  12. package/dist/forms/form-field/types.d.ts +13 -0
  13. package/dist/forms/form-field/types.js +1 -0
  14. package/dist/forms/form-field-with-tag/form-field-with-tag.js +1 -1
  15. package/dist/heading/heading.js +1 -1
  16. package/dist/hint-text/hint-text.js +1 -1
  17. package/dist/icon/icon.js +32 -32
  18. package/dist/index-2sRBqKFV.js +78 -0
  19. package/dist/{index-DNkhmzZp.js → index-CB-zPpNk.js} +44 -44
  20. package/dist/index.d.ts +3 -1
  21. package/dist/index.js +162 -155
  22. package/dist/input-checkbox/input-checkbox.js +13 -13
  23. package/dist/input-radio/input-radio.js +15 -15
  24. package/dist/label/label.js +1 -1
  25. package/dist/link/link.js +1 -1
  26. package/dist/list/list.js +2 -2
  27. package/dist/modal/modal.content.js +1 -1
  28. package/dist/modal/modal.js +3 -3
  29. package/dist/popover/popover.js +471 -467
  30. package/dist/primitives/anchor.js +1 -1
  31. package/dist/progress-bar/progress-bar.js +8 -8
  32. package/dist/progress-stepper/progress-stepper.js +10 -10
  33. package/dist/score-select/score-select.js +29 -29
  34. package/dist/select/select-menu.js +1 -0
  35. package/dist/select/select-next.js +11 -10
  36. package/dist/side-nav/side-nav.js +23 -23
  37. package/dist/spinner/spinner.js +1 -1
  38. package/dist/stack/stack.js +2 -2
  39. package/dist/styles.css +1 -1
  40. package/dist/table/table.js +1 -1
  41. package/dist/textarea/textarea.js +7 -7
  42. package/dist/toast/ds-toast.js +1 -1
  43. package/dist/tooltip/tooltip.js +1 -1
  44. package/package.json +5 -4
  45. package/dist/forms/form-field.d.ts +0 -11
  46. package/dist/forms/form-field.js +0 -41
  47. package/dist/index-ntYL1VRC.js +0 -64
@@ -1,5 +1,5 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { a } from "../index-ntYL1VRC.js";
2
+ import { a } from "../index-2sRBqKFV.js";
3
3
  const f = ({
4
4
  external: o = !1,
5
5
  asChild: r,
@@ -1,13 +1,13 @@
1
1
  import { jsxs as l, jsx as a } from "react/jsx-runtime";
2
- import { cn as n } from "../cn.js";
3
- import { translate as t } from "../i18n/utility.js";
2
+ import { cn as t } from "../cn.js";
3
+ import { translate as g } from "../i18n/utility.js";
4
4
  function d({
5
5
  value: s = 0,
6
6
  max: e = 100,
7
7
  isIndeterminate: r,
8
- label: i
8
+ label: o
9
9
  }) {
10
- const o = s * 100 / e;
10
+ const i = s * 100 / e;
11
11
  return /* @__PURE__ */ l("div", { className: "gi-progress-bar-container", children: [
12
12
  /* @__PURE__ */ a(
13
13
  "div",
@@ -16,7 +16,7 @@ function d({
16
16
  "aria-valuenow": r ? void 0 : s,
17
17
  "aria-valuemin": 0,
18
18
  "aria-valuemax": e,
19
- "aria-label": t("progressBar.progressBar", {
19
+ "aria-label": g("progressBar.progressBar", {
20
20
  defaultValue: "Progress bar"
21
21
  }),
22
22
  "data-testid": "progress-bar",
@@ -24,15 +24,15 @@ function d({
24
24
  children: /* @__PURE__ */ a(
25
25
  "div",
26
26
  {
27
- className: n({
27
+ className: t({
28
28
  "gi-progress-bar-indeterminate": r
29
29
  }),
30
- style: r ? {} : { width: `${o}%` }
30
+ style: r ? {} : { width: `${i}%` }
31
31
  }
32
32
  )
33
33
  }
34
34
  ),
35
- i && /* @__PURE__ */ a("span", { children: i })
35
+ o && /* @__PURE__ */ a("span", { children: o })
36
36
  ] });
37
37
  }
38
38
  export {
@@ -1,8 +1,8 @@
1
- import { jsxs as f, jsx as r } from "react/jsx-runtime";
1
+ import { jsxs as v, jsx as r } from "react/jsx-runtime";
2
2
  import { Children as P } from "react";
3
3
  import { cn as $ } from "../cn.js";
4
4
  import { Icon as z } from "../icon/icon.js";
5
- import { ProgressStepperIndicator as v } from "./types.js";
5
+ import { ProgressStepperIndicator as f } from "./types.js";
6
6
  const j = (e) => `calc(100% + ${e * 4 - 36}px)`, k = ({
7
7
  isNextStep: e,
8
8
  orientation: t = "horizontal",
@@ -11,7 +11,7 @@ const j = (e) => `calc(100% + ${e * 4 - 36}px)`, k = ({
11
11
  verticalGap: l
12
12
  }) => {
13
13
  const o = t === "vertical" ? { height: j(l) } : void 0;
14
- return /* @__PURE__ */ f(
14
+ return /* @__PURE__ */ v(
15
15
  "div",
16
16
  {
17
17
  "data-orientation": t,
@@ -28,19 +28,19 @@ const j = (e) => `calc(100% + ${e * 4 - 36}px)`, k = ({
28
28
  }
29
29
  );
30
30
  }, x = (e) => ({
31
- [v.Hashtag]: {
31
+ [f.Hashtag]: {
32
32
  completed: /* @__PURE__ */ r(z, { icon: "check" }),
33
33
  current: () => "#",
34
34
  next: () => "#"
35
35
  },
36
- [v.Number]: {
36
+ [f.Number]: {
37
37
  completed: /* @__PURE__ */ r(z, { icon: "check" }),
38
38
  current: (s) => s,
39
39
  next: (s) => s
40
40
  }
41
41
  })[e], V = (e, t, s, a) => {
42
42
  const { current: l, completed: o, next: i } = x(
43
- e || v.Hashtag
43
+ e || f.Hashtag
44
44
  );
45
45
  return s ? o : a ? l(t) : i(t);
46
46
  }, B = ({
@@ -58,8 +58,8 @@ const j = (e) => `calc(100% + ${e * 4 - 36}px)`, k = ({
58
58
  verticalGap: h
59
59
  }) => {
60
60
  const m = !t && !e, c = l === "vertical" && (e || d || t), p = !!o;
61
- return /* @__PURE__ */ f("div", { className: "gi-relative", children: [
62
- /* @__PURE__ */ f(
61
+ return /* @__PURE__ */ v("div", { className: "gi-relative", children: [
62
+ /* @__PURE__ */ v(
63
63
  "div",
64
64
  {
65
65
  className: "gi-progress-stepper-step-container",
@@ -74,7 +74,7 @@ const j = (e) => `calc(100% + ${e * 4 - 36}px)`, k = ({
74
74
  "aria-label": p ? void 0 : g,
75
75
  children: [
76
76
  /* @__PURE__ */ r("div", { className: "gi-progress-stepper-step", "data-indicator": i, children: V(
77
- i || v.Hashtag,
77
+ i || f.Hashtag,
78
78
  a,
79
79
  t,
80
80
  e
@@ -126,7 +126,7 @@ const j = (e) => `calc(100% + ${e * 4 - 36}px)`, k = ({
126
126
  }) => {
127
127
  var g, h;
128
128
  const d = (h = (g = e[t]) == null ? void 0 : g.props) == null ? void 0 : h.children, u = s === "horizontal" && d;
129
- return /* @__PURE__ */ f(
129
+ return /* @__PURE__ */ v(
130
130
  "div",
131
131
  {
132
132
  className: $("gi-w-full", {
@@ -1,21 +1,21 @@
1
1
  "use client";
2
- import { jsx as r, jsxs as d } from "react/jsx-runtime";
3
- import f from "react";
4
- import { ButtonGroup as k, ButtonGroupItem as y } from "../button-group/button-group.js";
5
- import { FormField as N } from "../forms/form-field.js";
2
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
3
+ import k from "react";
4
+ import { ButtonGroup as y, ButtonGroupItem as N } from "../button-group/button-group.js";
5
+ import { FormField as f } from "../forms/form-field/form-field.js";
6
6
  const G = ({
7
7
  name: p,
8
8
  size: $ = "medium",
9
9
  value: s,
10
10
  label: x,
11
- hint: i,
11
+ hint: v,
12
12
  leftLabel: a,
13
- rightLabel: u,
14
- onChange: c,
13
+ rightLabel: r,
14
+ onChange: i,
15
15
  type: I
16
16
  }) => {
17
- var o, n;
18
- const t = f.useId(), v = `${t}-label`, b = i ? `${t}-hint` : void 0;
17
+ var t, m;
18
+ const o = k.useId(), c = `${o}-label`, b = v ? `${o}-hint` : void 0;
19
19
  let l = [];
20
20
  switch (I) {
21
21
  case "1-5": {
@@ -57,51 +57,51 @@ const G = ({
57
57
  break;
58
58
  }
59
59
  }
60
- return /* @__PURE__ */ r(
61
- N,
60
+ return /* @__PURE__ */ u(
61
+ f,
62
62
  {
63
63
  className: "gi-w-full",
64
- label: { text: x, id: v },
65
- hint: i ? { text: i, id: b } : void 0,
64
+ label: { text: x, id: c },
65
+ hint: v ? { text: v, id: b } : void 0,
66
66
  children: /* @__PURE__ */ d(
67
67
  "div",
68
68
  {
69
69
  className: "gi-score-select-button-group",
70
70
  role: "group",
71
- "aria-labelledby": v,
71
+ "aria-labelledby": c,
72
72
  "aria-describedby": b,
73
73
  children: [
74
- a && u && l.length > 2 && /* @__PURE__ */ d("div", { className: "gi-score-select-labels-responsive", "aria-hidden": "true", children: [
74
+ a && r && l.length > 2 && /* @__PURE__ */ d("div", { className: "gi-score-select-labels-responsive", "aria-hidden": "true", children: [
75
75
  /* @__PURE__ */ d("div", { children: [
76
- (o = l[0]) == null ? void 0 : o.label,
76
+ (t = l[0]) == null ? void 0 : t.label,
77
77
  " – ",
78
78
  a
79
79
  ] }),
80
80
  /* @__PURE__ */ d("div", { children: [
81
- (n = l.at(-1)) == null ? void 0 : n.label,
81
+ (m = l.at(-1)) == null ? void 0 : m.label,
82
82
  " – ",
83
- u
83
+ r
84
84
  ] })
85
85
  ] }),
86
- /* @__PURE__ */ r(
87
- k,
86
+ /* @__PURE__ */ u(
87
+ y,
88
88
  {
89
89
  name: p,
90
90
  size: $,
91
91
  defaultValue: s,
92
- onChange: (e) => c == null ? void 0 : c(e),
92
+ onChange: (e) => i == null ? void 0 : i(e),
93
93
  role: "radiogroup",
94
- "aria-labelledby": v,
94
+ "aria-labelledby": c,
95
95
  "aria-describedby": b,
96
96
  children: l.map((e) => {
97
- var m, h;
98
- return /* @__PURE__ */ r(
99
- y,
97
+ var n, h;
98
+ return /* @__PURE__ */ u(
99
+ N,
100
100
  {
101
101
  value: e.value,
102
102
  role: "radio",
103
103
  "aria-checked": s === e.value,
104
- "aria-label": `${e.label}${a && e.value === ((m = l[0]) == null ? void 0 : m.value) ? ` - ${a}` : ""}${u && e.value === ((h = l.at(-1)) == null ? void 0 : h.value) ? ` - ${u}` : ""}`,
104
+ "aria-label": `${e.label}${a && e.value === ((n = l[0]) == null ? void 0 : n.value) ? ` - ${a}` : ""}${r && e.value === ((h = l.at(-1)) == null ? void 0 : h.value) ? ` - ${r}` : ""}`,
105
105
  children: e.label
106
106
  },
107
107
  e.value
@@ -109,9 +109,9 @@ const G = ({
109
109
  })
110
110
  }
111
111
  ),
112
- (a || u) && /* @__PURE__ */ d("div", { className: "gi-score-select-labels", "aria-hidden": "true", children: [
113
- /* @__PURE__ */ r("div", { children: a }),
114
- /* @__PURE__ */ r("div", { children: u })
112
+ (a || r) && /* @__PURE__ */ d("div", { className: "gi-score-select-labels", "aria-hidden": "true", children: [
113
+ /* @__PURE__ */ u("div", { children: a }),
114
+ /* @__PURE__ */ u("div", { children: r })
115
115
  ] })
116
116
  ]
117
117
  }
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsxs as h, jsx as c } from "react/jsx-runtime";
2
3
  import { useState as C, useEffect as K, Children as D, isValidElement as $, cloneElement as w } from "react";
3
4
  import { cn as A } from "../cn.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsxs as A, jsx as c } from "react/jsx-runtime";
2
3
  import { useRef as D, useState as S, Children as y, isValidElement as d, useEffect as K } from "react";
3
4
  import { cn as b } from "../cn.js";
@@ -13,7 +14,7 @@ const X = ({
13
14
  disabled: r,
14
15
  ...x
15
16
  }) => {
16
- const n = D(null), [a, E] = S(k), [G, m] = S(!1), [N, P] = S(""), f = y.toArray(T).filter(
17
+ const n = D(null), [s, E] = S(k), [G, m] = S(!1), [N, P] = S(""), f = y.toArray(T).filter(
17
18
  (e) => d(e)
18
19
  ), g = () => {
19
20
  var e;
@@ -33,13 +34,13 @@ const X = ({
33
34
  }
34
35
  };
35
36
  K(() => {
36
- var l, s;
37
+ var l, a;
37
38
  let e;
38
39
  for (const t of f) {
39
40
  const i = (l = t.type) == null ? void 0 : l.componentType;
40
41
  if (i === "SelectItemNext") {
41
42
  const o = t;
42
- if (o.props.value === a) {
43
+ if (o.props.value === s) {
43
44
  e = o;
44
45
  break;
45
46
  }
@@ -48,7 +49,7 @@ const X = ({
48
49
  const o = t, p = y.toArray(o.props.children).find(
49
50
  (u) => {
50
51
  var h;
51
- return ((h = u == null ? void 0 : u.type) == null ? void 0 : h.componentType) === "SelectItemNext" && u.props.value === a;
52
+ return ((h = u == null ? void 0 : u.type) == null ? void 0 : h.componentType) === "SelectItemNext" && u.props.value === s;
52
53
  }
53
54
  );
54
55
  if (p && d(p)) {
@@ -57,8 +58,8 @@ const X = ({
57
58
  }
58
59
  }
59
60
  }
60
- e && P(((s = e.props.children) == null ? void 0 : s.toString()) || "");
61
- }, [a, f]);
61
+ e && P(((a = e.props.children) == null ? void 0 : a.toString()) || "");
62
+ }, [s, f]);
62
63
  const V = (e) => {
63
64
  e.key === "Enter" && !r && g();
64
65
  };
@@ -109,15 +110,15 @@ const X = ({
109
110
  ]
110
111
  },
111
112
  children: /* @__PURE__ */ c($, { onChange: O, enableSearch: C, children: f.map((e) => {
112
- var s;
113
- const l = (s = e == null ? void 0 : e.type) == null ? void 0 : s.componentType;
113
+ var a;
114
+ const l = (a = e == null ? void 0 : e.type) == null ? void 0 : a.componentType;
114
115
  if (l === "SelectItemNext") {
115
116
  const t = e;
116
117
  return /* @__PURE__ */ c(
117
118
  w,
118
119
  {
119
120
  ...t.props,
120
- selected: a.toString() === t.props.value.toString()
121
+ selected: s.toString() === t.props.value.toString()
121
122
  },
122
123
  `SelectItemNext-${t.props.value.toString()}`
123
124
  );
@@ -128,7 +129,7 @@ const X = ({
128
129
  w,
129
130
  {
130
131
  ...p,
131
- selected: a.toString() === p.value.toString(),
132
+ selected: s.toString() === p.value.toString(),
132
133
  onChange: O
133
134
  },
134
135
  `SelectGroupItemNext-SelectItemNext-${p.value.toString()}`
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import { jsxs as w, Fragment as V, jsx as s } from "react/jsx-runtime";
3
- import N, { memo as B, useEffect as q, useCallback as v, useState as _ } from "react";
3
+ import f, { memo as B, useEffect as q, useCallback as v, useState as _ } from "react";
4
4
  import { Button as A } from "../button/button.js";
5
- import { cn as f } from "../cn.js";
5
+ import { cn as N } from "../cn.js";
6
6
  import { Icon as $ } from "../icon/icon.js";
7
7
  import { Link as G } from "../link/link.js";
8
8
  import { Paragraph as H } from "../paragraph/paragraph.js";
9
- const j = N.createContext(
9
+ const j = f.createContext(
10
10
  void 0
11
11
  ), z = B(
12
12
  ({
@@ -22,41 +22,41 @@ const j = N.createContext(
22
22
  c && /* @__PURE__ */ s("div", { className: "gi-side-nav-expandable-icon", children: /* @__PURE__ */ s(
23
23
  $,
24
24
  {
25
- className: f(e && "gi-rotate-180"),
25
+ className: N(e && "gi-rotate-180"),
26
26
  icon: "keyboard_arrow_down"
27
27
  }
28
28
  ) })
29
29
  ] })
30
- ), J = N.memo(
30
+ ), J = f.memo(
31
31
  ({
32
32
  children: n,
33
33
  primary: i,
34
34
  secondary: c,
35
35
  expandable: e,
36
- label: o,
36
+ label: a,
37
37
  value: t,
38
38
  icon: u,
39
39
  href: m,
40
40
  asChild: g,
41
41
  open: r
42
42
  }) => {
43
- const l = N.useContext(j);
43
+ const l = f.useContext(j);
44
44
  if (!l)
45
45
  throw new Error("SideNavItem must be used within a SideNav");
46
46
  const {
47
- openItemIds: a,
47
+ openItemIds: o,
48
48
  selectedItemId: S,
49
49
  setOpenItemIds: p,
50
50
  setSelectedItemId: C,
51
51
  navId: P
52
- } = l, I = a.includes(t), x = S === t;
52
+ } = l, I = o.includes(t), x = S === t;
53
53
  q(() => {
54
54
  r && p((d) => d.includes(t) ? d : [...d, t]);
55
55
  }, [r, p, t]);
56
56
  const h = v(() => {
57
- const d = I ? a.filter((R) => R !== t) : [...a, t];
57
+ const d = I ? o.filter((R) => R !== t) : [...o, t];
58
58
  p(d);
59
- }, [I, a, p, t]), k = v(() => {
59
+ }, [I, o, p, t]), k = v(() => {
60
60
  C(t);
61
61
  }, [C, t]), E = `${P}-${t}`, O = i && e, b = m !== void 0, D = v(() => {
62
62
  i && e && h(), k();
@@ -65,11 +65,11 @@ const j = N.createContext(
65
65
  d.preventDefault(), i && e ? h() : k();
66
66
  },
67
67
  [i, e, h, k]
68
- ), L = f("gi-side-nav-item", {
68
+ ), L = N("gi-side-nav-item", {
69
69
  "gi-side-nav-item-selected": x,
70
70
  "gi-side-nav-item-primary": i,
71
71
  "gi-side-nav-item-secondary": c
72
- }), M = f("gi-side-nav-item", {
72
+ }), M = N("gi-side-nav-item", {
73
73
  "gi-side-nav-item-selected": x,
74
74
  "gi-side-nav-item-primary": i,
75
75
  "gi-side-nav-item-secondary": c
@@ -78,7 +78,7 @@ const j = N.createContext(
78
78
  "div",
79
79
  {
80
80
  role: "group",
81
- "aria-label": `${o} ${i && e ? "dropdown" : "item"}`,
81
+ "aria-label": `${a} ${i && e ? "dropdown" : "item"}`,
82
82
  children: [
83
83
  b ? /* @__PURE__ */ s(
84
84
  G,
@@ -97,7 +97,7 @@ const j = N.createContext(
97
97
  z,
98
98
  {
99
99
  icon: u,
100
- label: o,
100
+ label: a,
101
101
  showExpandableIcon: O,
102
102
  isOpen: I
103
103
  }
@@ -116,7 +116,7 @@ const j = N.createContext(
116
116
  z,
117
117
  {
118
118
  icon: u,
119
- label: o,
119
+ label: a,
120
120
  showExpandableIcon: O,
121
121
  isOpen: I
122
122
  }
@@ -126,7 +126,7 @@ const j = N.createContext(
126
126
  e && i && /* @__PURE__ */ s(
127
127
  "div",
128
128
  {
129
- className: f(I ? "gi-side-nav-item-content" : "gi-hidden"),
129
+ className: N(I ? "gi-side-nav-item-content" : "gi-hidden"),
130
130
  children: n
131
131
  }
132
132
  )
@@ -135,15 +135,15 @@ const j = N.createContext(
135
135
  );
136
136
  }
137
137
  ), K = B(
138
- ({ children: n, className: i, dataTestid: c, onChange: e, value: o }) => {
138
+ ({ children: n, className: i, dataTestid: c, onChange: e, value: a }) => {
139
139
  const [t, u] = _([]), [m, g] = _(
140
- o
141
- ), r = N.useId(), l = v(
140
+ a
141
+ ), r = f.useId(), l = v(
142
142
  (S) => {
143
143
  g(S), e == null || e(S);
144
144
  },
145
145
  [e]
146
- ), a = N.useMemo(
146
+ ), o = f.useMemo(
147
147
  () => ({
148
148
  openItemIds: t,
149
149
  selectedItemId: m,
@@ -153,10 +153,10 @@ const j = N.createContext(
153
153
  }),
154
154
  [t, m, l, r]
155
155
  );
156
- return /* @__PURE__ */ s(j.Provider, { value: a, children: /* @__PURE__ */ s(
156
+ return /* @__PURE__ */ s(j.Provider, { value: o, children: /* @__PURE__ */ s(
157
157
  "div",
158
158
  {
159
- className: f("gi-side-nav-container", i),
159
+ className: N("gi-side-nav-container", i),
160
160
  "data-testid": c,
161
161
  children: n
162
162
  }
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as e, jsxs as i } from "react/jsx-runtime";
3
- import { c as o } from "../index-DNkhmzZp.js";
3
+ import { c as o } from "../index-CB-zPpNk.js";
4
4
  import { cn as l } from "../cn.js";
5
5
  const c = {
6
6
  xl: "gi-w-10 gi-h-10",
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as C, jsxs as h } from "react/jsx-runtime";
3
- import { Children as R, Fragment as y, isValidElement as d, cloneElement as X } from "react";
3
+ import { Children as R, Fragment as y, cloneElement as d, isValidElement as X } from "react";
4
4
  import { cn as c } from "../cn.js";
5
5
  const p = (l) => typeof l == "string" ? {} : {
6
6
  isBaseColumn: l.base === "column",
@@ -168,7 +168,7 @@ const p = (l) => typeof l == "string" ? {} : {
168
168
  children: (() => {
169
169
  const n = R.toArray(l);
170
170
  return n.map((o, i) => /* @__PURE__ */ h(y, { children: [
171
- d(o) ? X(
171
+ X(o) ? d(
172
172
  o,
173
173
  {
174
174
  "data-testid": `govie-stack-item-${i}`