@ogcio/design-system-react 1.12.3 → 1.13.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 (96) 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 +124 -198
  4. package/dist/autocomplete/types.d.ts +23 -5
  5. package/dist/autocomplete/use-autocomplete-controller.d.ts +10 -0
  6. package/dist/autocomplete/use-autocomplete-controller.js +125 -0
  7. package/dist/button/helpers.d.ts +1 -1
  8. package/dist/button/helpers.js +14 -12
  9. package/dist/button/types.d.ts +1 -1
  10. package/dist/button-group/button-group.d.ts +1 -0
  11. package/dist/button-group/button-group.js +67 -60
  12. package/dist/card/card-next.js +28 -28
  13. package/dist/checkbox/checkbox.d.ts +7 -1
  14. package/dist/combo-box/dropdown-item.js +30 -30
  15. package/dist/data-grid/editable-table-cell.d.ts +3 -0
  16. package/dist/data-grid/editable-table-cell.js +73 -0
  17. package/dist/data-grid/tanstack/tanstack-helpers.d.ts +11 -0
  18. package/dist/data-grid/tanstack/tanstack-helpers.js +1799 -0
  19. package/dist/data-grid/types.d.ts +20 -0
  20. package/dist/data-grid/types.js +1 -0
  21. package/dist/drawer/drawer.content.js +6 -6
  22. package/dist/drawer/drawer.js +8 -8
  23. package/dist/error-text/error-text.js +1 -1
  24. package/dist/forms/form-field/form-field.js +15 -15
  25. package/dist/forms/form-field-with-tag/form-field-with-tag.js +1 -1
  26. package/dist/header/components/header-slot.js +38 -27
  27. package/dist/header/header.js +5 -5
  28. package/dist/heading/heading.js +1 -1
  29. package/dist/hint-text/hint-text.js +1 -1
  30. package/dist/hooks/use-aria-hider.d.ts +1 -0
  31. package/dist/hooks/use-aria-hider.js +20 -0
  32. package/dist/hooks/use-focus-trap.d.ts +2 -0
  33. package/dist/hooks/use-focus-trap.js +678 -0
  34. package/dist/icon/icon.js +32 -32
  35. package/dist/icon/icons.d.ts +2 -2
  36. package/dist/icon/icons.js +5 -1
  37. package/dist/icon/svgs/placeholder.js +2 -2
  38. package/dist/icon-button/icon-button.js +17 -17
  39. package/dist/index-2sRBqKFV.js +78 -0
  40. package/dist/{index-DNkhmzZp.js → index-CB-zPpNk.js} +44 -44
  41. package/dist/index.d.ts +6 -4
  42. package/dist/index.js +135 -130
  43. package/dist/input-checkbox/input-checkbox.d.ts +9 -2
  44. package/dist/input-checkbox/input-checkbox.js +65 -42
  45. package/dist/input-checkbox/types.d.ts +5 -0
  46. package/dist/input-checkbox-group/input-checkbox-group.js +22 -16
  47. package/dist/input-checkbox-group/types.d.ts +1 -0
  48. package/dist/input-radio/input-radio.js +15 -15
  49. package/dist/input-radio-group/input-radio-group.js +24 -17
  50. package/dist/input-radio-group/types.d.ts +1 -0
  51. package/dist/input-text/input-text.d.ts +22 -0
  52. package/dist/input-text/input-text.js +121 -100
  53. package/dist/input-text/type.d.ts +5 -0
  54. package/dist/label/label.js +1 -1
  55. package/dist/link/link.js +1 -1
  56. package/dist/list/list.js +2 -2
  57. package/dist/lodash-D1c5hFAM.js +3677 -0
  58. package/dist/modal/modal.content.js +1 -1
  59. package/dist/modal/modal.js +141 -127
  60. package/dist/popover/popover.js +464 -466
  61. package/dist/primitives/anchor.js +1 -1
  62. package/dist/progress-bar/progress-bar.js +8 -8
  63. package/dist/progress-stepper/progress-stepper.js +12 -12
  64. package/dist/score-select/score-select.js +3 -3
  65. package/dist/select/select-menu.d.ts +1 -1
  66. package/dist/select/select-menu.js +96 -90
  67. package/dist/select/select-native.d.ts +5 -2
  68. package/dist/select/select-native.js +45 -15
  69. package/dist/select/select-next.d.ts +3 -2
  70. package/dist/select/select-next.js +125 -92
  71. package/dist/select/select-search.d.ts +3 -0
  72. package/dist/select/select-search.js +24 -0
  73. package/dist/select/select.d.ts +4 -2
  74. package/dist/select/select.js +3 -2
  75. package/dist/select/types.d.ts +22 -0
  76. package/dist/side-nav/side-nav.js +23 -23
  77. package/dist/spinner/spinner.js +1 -1
  78. package/dist/stack/stack.js +40 -49
  79. package/dist/styles.css +2 -3
  80. package/dist/table/index.d.ts +8 -0
  81. package/dist/table/index.js +19 -0
  82. package/dist/table/table-data.d.ts +16 -2
  83. package/dist/table/table-data.js +64 -17
  84. package/dist/table/table-header.d.ts +4 -1
  85. package/dist/table/table-header.js +58 -18
  86. package/dist/table/table-pagination.d.ts +8 -0
  87. package/dist/table/table-pagination.js +97 -0
  88. package/dist/table/table-row.js +7 -6
  89. package/dist/table/table.d.ts +4 -1
  90. package/dist/table/table.js +22 -15
  91. package/dist/text-input/text-input.d.ts +1 -0
  92. package/dist/textarea/textarea.js +18 -17
  93. package/dist/toast/ds-toast.js +1 -1
  94. package/dist/tooltip/tooltip.js +1 -1
  95. package/package.json +5 -5
  96. package/dist/index-ntYL1VRC.js +0 -64
@@ -1,28 +1,35 @@
1
1
  "use client";
2
- import { jsx as o } from "react/jsx-runtime";
3
- import { useState as c, Children as l, isValidElement as d, cloneElement as g } from "react";
4
- const v = ({
5
- groupId: t,
6
- inline: n,
7
- onChange: r,
8
- children: e
2
+ import { jsx as r } from "react/jsx-runtime";
3
+ import { useState as a, useEffect as g, Children as m, isValidElement as v, cloneElement as f } from "react";
4
+ const N = ({
5
+ groupId: s,
6
+ inline: c,
7
+ onChange: n,
8
+ value: o,
9
+ children: p
9
10
  }) => {
10
- const [p, s] = c(), u = (i) => {
11
- s(i.target.value), r == null || r(i);
12
- }, a = l.map(e, (i) => d(i) ? g(i, {
13
- onChange: u,
14
- checked: p === i.props.value,
15
- name: t
11
+ const [u, t] = a(
12
+ o || null
13
+ );
14
+ g(() => {
15
+ t(o || null);
16
+ }, [o]);
17
+ const d = o === void 0 ? u : o, e = (i) => {
18
+ o === void 0 && t(i.target.value), n == null || n(i);
19
+ }, l = m.map(p, (i) => v(i) ? f(i, {
20
+ onChange: e,
21
+ checked: d === i.props.value,
22
+ name: s
16
23
  }) : i);
17
- return /* @__PURE__ */ o("div", { className: "gi-input-group-container", children: /* @__PURE__ */ o("div", { className: "gi-input-group-options-container", children: /* @__PURE__ */ o(
24
+ return /* @__PURE__ */ r("div", { className: "gi-input-group-container", children: /* @__PURE__ */ r("div", { className: "gi-input-group-options-container", children: /* @__PURE__ */ r(
18
25
  "div",
19
26
  {
20
27
  role: "radiogroup",
21
- className: n ? "gi-input-group-options-inline" : "gi-input-group-options-stacked",
22
- children: a
28
+ className: c ? "gi-input-group-options-inline" : "gi-input-group-options-stacked",
29
+ children: l
23
30
  }
24
31
  ) }) });
25
32
  };
26
33
  export {
27
- v as InputRadioGroup
34
+ N as InputRadioGroup
28
35
  };
@@ -2,4 +2,5 @@ export type InputRadioGroupProps = {
2
2
  groupId: string;
3
3
  inline?: boolean;
4
4
  onChange?: (event?: React.ChangeEvent<HTMLInputElement>) => void;
5
+ value?: string;
5
6
  };
@@ -16,4 +16,26 @@ export declare const InputText: import('react').ForwardRefExoticComponent<import
16
16
  type?: "text" | "date" | "datetime-local" | "email" | "month" | "number" | "password" | "tel" | "time" | "url" | "week" | "search";
17
17
  halfFluid?: boolean;
18
18
  clearButtonEnabled?: boolean;
19
+ containerProps?: any;
20
+ } & import('react').RefAttributes<HTMLInputElement>>;
21
+ export declare const InputTextTableCell: import('react').ForwardRefExoticComponent<import('react').InputHTMLAttributes<HTMLInputElement> & {
22
+ prefix?: React.ReactNode;
23
+ suffix?: React.ReactNode;
24
+ inputClassName?: string;
25
+ iconStart?: import('../icon/icon.js').IconId;
26
+ onIconStartClick?: () => void;
27
+ iconStartClassName?: string;
28
+ iconEnd?: import('../icon/icon.js').IconId;
29
+ iconEndClassName?: string;
30
+ onIconEndClick?: () => void;
31
+ inputActionButton?: InputActionButtonProps;
32
+ iconEndRef?: any;
33
+ inputActionPosition?: "beforeSuffix" | "afterSuffix";
34
+ type?: "text" | "date" | "datetime-local" | "email" | "month" | "number" | "password" | "tel" | "time" | "url" | "week" | "search";
35
+ halfFluid?: boolean;
36
+ clearButtonEnabled?: boolean;
37
+ containerProps?: any;
38
+ } & {
39
+ error?: boolean;
40
+ disabled?: boolean;
19
41
  } & import('react').RefAttributes<HTMLInputElement>>;
@@ -1,26 +1,26 @@
1
1
  "use client";
2
- import { jsx as t, jsxs as m } from "react/jsx-runtime";
3
- import { forwardRef as f, useRef as _, useImperativeHandle as j, useMemo as C } from "react";
4
- import { cn as c } from "../cn.js";
5
- import { Icon as o } from "../icon/icon.js";
6
- import { IconButton as O } from "../icon-button/icon-button.js";
7
- import { Input as S } from "../primitives/input.js";
8
- const b = f(
9
- ({ onChange: a, ...r }, n) => {
10
- const e = _(null);
11
- return j(n, () => e.current), /* @__PURE__ */ t(
2
+ import { jsx as n, jsxs as f } from "react/jsx-runtime";
3
+ import { forwardRef as u, useRef as S, useImperativeHandle as W, useMemo as _ } from "react";
4
+ import { cn as l } from "../cn.js";
5
+ import { Icon as m } from "../icon/icon.js";
6
+ import { IconButton as j } from "../icon-button/icon-button.js";
7
+ import { Input as O } from "../primitives/input.js";
8
+ const H = u(
9
+ ({ onChange: a, ...e }, r) => {
10
+ const t = S(null);
11
+ return W(r, () => t.current), /* @__PURE__ */ n(
12
12
  p,
13
13
  {
14
- ...r,
14
+ ...e,
15
15
  onChange: a,
16
- ref: e,
16
+ ref: t,
17
17
  inputActionButton: {
18
18
  icon: "close",
19
19
  onClick: () => {
20
- e != null && e.current && (e.current.value = "", e.current.focus());
20
+ t != null && t.current && (t.current.value = "", t.current.focus());
21
21
  const d = {
22
- target: e.current,
23
- currentTarget: e.current,
22
+ target: t.current,
23
+ currentTarget: t.current,
24
24
  __origin: "clear_button"
25
25
  };
26
26
  a && a(d);
@@ -29,112 +29,133 @@ const b = f(
29
29
  }
30
30
  );
31
31
  }
32
- ), p = f(
32
+ ), p = u(
33
33
  ({
34
34
  prefix: a,
35
- inputActionButton: r,
36
- inputActionPosition: n = "beforeSuffix",
37
- suffix: e,
38
- halfFluid: s = !1,
35
+ inputActionButton: e,
36
+ inputActionPosition: r = "beforeSuffix",
37
+ suffix: t,
38
+ halfFluid: c = !1,
39
39
  className: d,
40
- type: h = "text",
41
- iconStart: u,
42
- iconStartClassName: v,
43
- onIconStartClick: g,
44
- iconEnd: l,
45
- iconEndClassName: I,
46
- onIconEndClick: N,
40
+ type: I = "text",
41
+ iconStart: o,
42
+ iconStartClassName: g,
43
+ onIconStartClick: v,
44
+ iconEnd: s,
45
+ iconEndClassName: N,
46
+ onIconEndClick: T,
47
47
  disabled: i,
48
- inputClassName: k,
49
- iconEndRef: T,
50
- ...w
48
+ inputClassName: w,
49
+ iconEndRef: C,
50
+ containerProps: b,
51
+ ...k
51
52
  }, z) => {
52
- const R = C(() => r && n === "beforeSuffix" ? /* @__PURE__ */ t(
53
+ const R = _(() => e && r === "beforeSuffix" ? /* @__PURE__ */ n(
53
54
  "div",
54
55
  {
55
56
  className: "gi-input-text-action-before-suffix",
56
- "data-suffix": !!e,
57
- "data-has-icon-end": !!l,
58
- children: /* @__PURE__ */ t(x, { ...r, disabled: i })
57
+ "data-suffix": !!t,
58
+ "data-has-icon-end": !!s,
59
+ children: /* @__PURE__ */ n(x, { ...e, disabled: i })
59
60
  }
60
- ) : null, [r]);
61
- return /* @__PURE__ */ m("div", { className: c(d, "gi-input-text-container"), children: [
62
- a && /* @__PURE__ */ t("div", { className: "gi-input-text-prefix", "data-disabled": i, children: a }),
63
- /* @__PURE__ */ m(
64
- "div",
65
- {
66
- className: c("gi-input-text-inner", {
67
- "gi-input-half-width": s
68
- }),
69
- children: [
70
- u && /* @__PURE__ */ t(
71
- "div",
72
- {
73
- className: c("gi-input-text-icon-start", v),
74
- onClick: g,
75
- "data-prefix": !!a,
76
- children: /* @__PURE__ */ t(o, { icon: u, size: "md", disabled: i })
77
- }
78
- ),
79
- /* @__PURE__ */ t(
80
- S,
81
- {
82
- type: h,
83
- "data-icon-start": !!u,
84
- "data-icon-end": !!l,
85
- "data-end-element": !!r,
86
- "data-prefix": !!a,
87
- "data-suffix": !!e,
88
- className: c(k, "gi-input-text"),
89
- ref: z,
90
- disabled: i,
91
- ...w
92
- }
93
- ),
94
- l && /* @__PURE__ */ t(
95
- "div",
96
- {
97
- className: c("gi-input-text-icon-end", I),
98
- "data-end-element": !!r && n === "afterSuffix",
99
- "data-suffix": !!e,
100
- onClick: N,
101
- ref: T,
102
- children: /* @__PURE__ */ t(o, { icon: l, size: "md", disabled: i })
103
- }
104
- ),
105
- R
106
- ]
107
- }
108
- ),
109
- r && n === "afterSuffix" && /* @__PURE__ */ t("div", { className: "gi-input-text-end-element", "data-suffix": !!e, children: /* @__PURE__ */ t(x, { ...r, disabled: i }) }),
110
- e && /* @__PURE__ */ t("div", { className: "gi-input-text-suffix", "data-disabled": i, children: e })
111
- ] });
61
+ ) : null, [e]);
62
+ return /* @__PURE__ */ f(
63
+ "div",
64
+ {
65
+ className: l(d, "gi-input-text-container"),
66
+ ...b,
67
+ children: [
68
+ a && /* @__PURE__ */ n("div", { className: "gi-input-text-prefix", "data-disabled": i, children: a }),
69
+ /* @__PURE__ */ f(
70
+ "div",
71
+ {
72
+ className: l("gi-input-text-inner", {
73
+ "gi-input-half-width": c
74
+ }),
75
+ children: [
76
+ o && /* @__PURE__ */ n(
77
+ "div",
78
+ {
79
+ className: l("gi-input-text-icon-start", g),
80
+ onClick: v,
81
+ "data-prefix": !!a,
82
+ children: /* @__PURE__ */ n(m, { icon: o, size: "md", disabled: i })
83
+ }
84
+ ),
85
+ /* @__PURE__ */ n(
86
+ O,
87
+ {
88
+ type: I,
89
+ "data-icon-start": !!o,
90
+ "data-icon-end": !!s,
91
+ "data-end-element": !!e,
92
+ "data-prefix": !!a,
93
+ "data-suffix": !!t,
94
+ className: l("gi-input-text", w),
95
+ ref: z,
96
+ disabled: i,
97
+ ...k
98
+ }
99
+ ),
100
+ s && /* @__PURE__ */ n(
101
+ "div",
102
+ {
103
+ className: l("gi-input-text-icon-end", N),
104
+ "data-end-element": !!e && r === "afterSuffix",
105
+ "data-suffix": !!t,
106
+ onClick: T,
107
+ ref: C,
108
+ children: /* @__PURE__ */ n(m, { icon: s, size: "md", disabled: i })
109
+ }
110
+ ),
111
+ R
112
+ ]
113
+ }
114
+ ),
115
+ e && r === "afterSuffix" && /* @__PURE__ */ n("div", { className: "gi-input-text-end-element", "data-suffix": !!t, children: /* @__PURE__ */ n(x, { ...e, disabled: i }) }),
116
+ t && /* @__PURE__ */ n("div", { className: "gi-input-text-suffix", "data-disabled": i, children: t })
117
+ ]
118
+ }
119
+ );
112
120
  }
113
121
  ), x = ({
114
122
  onClick: a,
115
- ariaLabel: r,
116
- icon: n,
117
- dataTestId: e,
118
- ...s
119
- }) => /* @__PURE__ */ t(
120
- O,
123
+ ariaLabel: e,
124
+ icon: r,
125
+ dataTestId: t,
126
+ ...c
127
+ }) => /* @__PURE__ */ n(
128
+ j,
121
129
  {
122
- ...s,
130
+ ...c,
123
131
  icon: {
124
- icon: n
132
+ icon: r
125
133
  },
126
- "data-testid": e,
127
- "aria-label": r || "",
134
+ "data-testid": t,
135
+ "aria-label": e || "",
128
136
  onClick: a,
129
137
  variant: "flat",
130
138
  size: "small",
131
139
  appearance: "dark"
132
140
  }
133
- ), H = f(
134
- ({ type: a = "text", clearButtonEnabled: r, ...n }, e) => r ? /* @__PURE__ */ t(b, { ref: e, type: a, ...n }) : /* @__PURE__ */ t(p, { ref: e, type: a, ...n })
141
+ ), h = u(
142
+ ({ type: a = "text", clearButtonEnabled: e, ...r }, t) => e || a === "search" ? /* @__PURE__ */ n(H, { ref: t, type: a, ...r }) : /* @__PURE__ */ n(p, { ref: t, type: a, ...r })
135
143
  );
136
- H.displayName = "InputText";
144
+ h.displayName = "InputText";
145
+ const G = u(({ type: a = "text", error: e, ...r }, t) => /* @__PURE__ */ n(
146
+ h,
147
+ {
148
+ ...r,
149
+ containerProps: {
150
+ "data-table-cell": !0,
151
+ "data-table-cell-error-state": e == null ? void 0 : e.toString()
152
+ },
153
+ ref: t,
154
+ type: a
155
+ }
156
+ ));
137
157
  export {
138
158
  x as InputActionButton,
139
- H as InputText
159
+ h as InputText,
160
+ G as InputTextTableCell
140
161
  };
@@ -24,4 +24,9 @@ export type InputTextProps = React.InputHTMLAttributes<HTMLInputElement> & {
24
24
  type?: 'text' | 'date' | 'datetime-local' | 'email' | 'month' | 'number' | 'password' | 'tel' | 'time' | 'url' | 'week' | 'search';
25
25
  halfFluid?: boolean;
26
26
  clearButtonEnabled?: boolean;
27
+ containerProps?: any;
28
+ };
29
+ export type InputTextTableCellProps = InputTextProps & {
30
+ error?: boolean;
31
+ disabled?: boolean;
27
32
  };
@@ -1,6 +1,6 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
2
  import { forwardRef as r } from "react";
3
- import { c as o } from "../index-DNkhmzZp.js";
3
+ import { c as o } from "../index-CB-zPpNk.js";
4
4
  const d = {
5
5
  Small: "sm",
6
6
  Medium: "md",
package/dist/link/link.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx as n, jsxs as S, Fragment as b } from "react/jsx-runtime";
2
- import { a as j } from "../index-ntYL1VRC.js";
2
+ import { a as j } from "../index-2sRBqKFV.js";
3
3
  import { forwardRef as w } from "react";
4
4
  import { getVariantAppearanceClass as I, getSizeClass as L } from "../button/helpers.js";
5
5
  import { cn as A } from "../cn.js";
package/dist/list/list.js CHANGED
@@ -21,7 +21,7 @@ const s = {
21
21
  }
22
22
  return i && e.push("gi-list-spaced"), e.join(" ");
23
23
  };
24
- function o({
24
+ function c({
25
25
  items: i,
26
26
  type: t = s.None,
27
27
  spaced: e,
@@ -39,6 +39,6 @@ function o({
39
39
  );
40
40
  }
41
41
  export {
42
- o as List,
42
+ c as List,
43
43
  s as ListTypeEnum
44
44
  };