@ogcio/design-system-react 1.13.0 → 1.15.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 (55) hide show
  1. package/dist/autocomplete/autocomplete.d.ts +21 -3
  2. package/dist/autocomplete/autocomplete.js +208 -159
  3. package/dist/autocomplete/types.d.ts +8 -4
  4. package/dist/autocomplete/types.js +2 -1
  5. package/dist/autocomplete/use-autocomplete-controller.d.ts +4 -2
  6. package/dist/autocomplete/use-autocomplete-controller.js +123 -79
  7. package/dist/button/button.js +27 -22
  8. package/dist/data-grid/data-grid-footer.d.ts +12 -0
  9. package/dist/data-grid/data-grid-footer.js +66 -0
  10. package/dist/data-grid/data-grid-header.d.ts +12 -0
  11. package/dist/data-grid/data-grid-header.js +82 -0
  12. package/dist/header/components/header-slot.js +34 -31
  13. package/dist/header/helper.d.ts +0 -1
  14. package/dist/header/helper.js +37 -62
  15. package/dist/hooks/use-combined-refs.d.ts +5 -0
  16. package/dist/hooks/use-combined-refs.js +10 -0
  17. package/dist/hooks/use-scroll-highlighted-item.d.ts +1 -0
  18. package/dist/hooks/use-scroll-highlighted-item.js +16 -0
  19. package/dist/icon/icon.js +15 -15
  20. package/dist/icon-button/icon-button.js +14 -12
  21. package/dist/index.d.ts +5 -2
  22. package/dist/index.js +68 -63
  23. package/dist/list/list.js +1 -1
  24. package/dist/modal/modal.d.ts +8 -2
  25. package/dist/modal/modal.js +155 -134
  26. package/dist/popover/popover.d.ts +1 -1
  27. package/dist/popover/popover.js +296 -286
  28. package/dist/popover/types.d.ts +1 -0
  29. package/dist/popover/utilities.d.ts +2 -0
  30. package/dist/popover/utilities.js +16 -0
  31. package/dist/primitives/button.d.ts +3 -0
  32. package/dist/primitives/button.js +9 -0
  33. package/dist/select/select-menu.d.ts +2 -2
  34. package/dist/select/select-menu.js +96 -99
  35. package/dist/select/select-next.d.ts +13 -2
  36. package/dist/select/select-next.js +182 -167
  37. package/dist/select/select-search.js +17 -17
  38. package/dist/select/types.d.ts +3 -1
  39. package/dist/styles.css +1 -1
  40. package/dist/table/table-data.js +1 -1
  41. package/dist/tabs/scrollable-tab-list.d.ts +9 -0
  42. package/dist/tabs/scrollable-tab-list.js +84 -0
  43. package/dist/tabs/tab-item.d.ts +9 -15
  44. package/dist/tabs/tab-item.js +85 -38
  45. package/dist/tabs/tab-list.d.ts +2 -5
  46. package/dist/tabs/tab-list.js +83 -49
  47. package/dist/tabs/tab-panel.d.ts +2 -7
  48. package/dist/tabs/tab-panel.js +2 -5
  49. package/dist/tabs/tabs.d.ts +2 -7
  50. package/dist/tabs/tabs.js +24 -20
  51. package/dist/tabs/types.d.ts +64 -0
  52. package/dist/tabs/types.js +1 -0
  53. package/dist/textarea/textarea.d.ts +1 -2
  54. package/dist/textarea/textarea.js +60 -61
  55. package/package.json +4 -4
@@ -1,74 +1,73 @@
1
1
  "use client";
2
- import { jsxs as d, Fragment as k, jsx as n } from "react/jsx-runtime";
3
- import { forwardRef as R, useRef as j, useState as m, useImperativeHandle as p, useEffect as y } from "react";
4
- import { cn as u } from "../cn.js";
5
- import { HintText as z } from "../hint-text/hint-text.js";
6
- import { translate as A } from "../i18n/utility.js";
7
- import { Icon as H } from "../icon/icon.js";
8
- import { IconButton as O } from "../icon-button/icon-button.js";
9
- const E = R(
2
+ import { jsxs as u, Fragment as j, jsx as e } from "react/jsx-runtime";
3
+ import { forwardRef as y, useRef as z, useState as g, useImperativeHandle as A, useEffect as H } from "react";
4
+ import { cn as v } from "../cn.js";
5
+ import { HintText as O } from "../hint-text/hint-text.js";
6
+ import { translate as F } from "../i18n/utility.js";
7
+ import { Icon as L } from "../icon/icon.js";
8
+ import { IconButton as Y } from "../icon-button/icon-button.js";
9
+ const $ = y(
10
10
  ({
11
- value: i,
12
- rows: g = 4,
13
- cols: f = 100,
14
- autoComplete: h = "on",
11
+ value: o,
12
+ rows: h = 4,
13
+ cols: p = 100,
14
+ autoComplete: x = "on",
15
15
  maxChars: t,
16
- halfFluid: v = !1,
17
- iconStart: c,
18
- className: x,
19
- clearButtonEnabled: s,
20
- ...a
21
- }, N) => {
22
- const e = j(null), [o, C] = m(
16
+ halfFluid: N = !1,
17
+ iconStart: i,
18
+ className: b,
19
+ clearButtonEnabled: d,
20
+ onChange: a,
21
+ ...r
22
+ }, R) => {
23
+ const n = z(null), [m, V] = g(
23
24
  t
24
25
  );
25
- p(N, () => e.current);
26
- const [I, V] = m(""), l = typeof i == "string" ? i : I;
27
- y(() => {
28
- t !== void 0 && C(t - l.length);
29
- }, [l, t]);
30
- const b = (r) => {
31
- const T = r.target.value;
32
- i === void 0 && V(T), a.onChange && a.onChange(r);
26
+ A(R, () => n.current);
27
+ const [I, f] = g(""), l = o !== void 0, s = l ? String(o) : I;
28
+ H(() => {
29
+ t !== void 0 && V(t - s.length);
30
+ }, [s, t]);
31
+ const k = (c) => {
32
+ const T = c.target.value;
33
+ l || f(T), a && a(c);
33
34
  }, w = () => {
34
- if (e != null && e.current) {
35
- e.current.value = "", e.current.focus();
36
- const r = {
37
- target: e.current,
38
- currentTarget: e.current
39
- };
40
- a.onChange && a.onChange(r);
41
- }
35
+ n.current && (l || f(""), a && a({
36
+ target: {
37
+ value: ""
38
+ }
39
+ }), n.current.focus());
42
40
  };
43
- return /* @__PURE__ */ d(k, { children: [
44
- /* @__PURE__ */ n("div", { className: "gi-textarea-container", children: /* @__PURE__ */ d(
41
+ return /* @__PURE__ */ u(j, { children: [
42
+ /* @__PURE__ */ e("div", { className: "gi-textarea-container", children: /* @__PURE__ */ u(
45
43
  "div",
46
44
  {
47
- className: u("gi-textarea-inner", {
48
- "gi-input-half-width": v
45
+ className: v("gi-textarea-inner", {
46
+ "gi-input-half-width": N
49
47
  }),
50
48
  children: [
51
- c && /* @__PURE__ */ n("div", { className: "gi-text-area-icon-start", children: /* @__PURE__ */ n(H, { icon: c, size: "md", disabled: a.disabled }) }),
52
- /* @__PURE__ */ n(
49
+ i && /* @__PURE__ */ e("div", { className: "gi-text-area-icon-start", children: /* @__PURE__ */ e(L, { icon: i, size: "md", disabled: r.disabled }) }),
50
+ /* @__PURE__ */ e(
53
51
  "textarea",
54
52
  {
55
- rows: g,
56
- cols: f,
57
- autoComplete: h,
58
- className: u(x, "gi-textarea"),
59
- ref: e,
60
- "data-icon-start": !!c,
61
- "data-clear-enabled": s,
53
+ rows: h,
54
+ cols: p,
55
+ autoComplete: x,
56
+ className: v(b, "gi-textarea"),
57
+ ref: n,
58
+ "data-icon-start": !!i,
59
+ "data-clear-enabled": d,
62
60
  maxLength: t,
63
- value: l,
64
- onChange: b,
65
- ...a
61
+ value: s,
62
+ onChange: k,
63
+ ...r
66
64
  }
67
65
  ),
68
- s ? /* @__PURE__ */ n("div", { className: "gi-text-area-end-element", children: /* @__PURE__ */ n(
69
- O,
66
+ d ? /* @__PURE__ */ e("div", { className: "gi-text-area-end-element", children: /* @__PURE__ */ e(
67
+ Y,
70
68
  {
71
- disabled: a.disabled,
69
+ type: "button",
70
+ disabled: r.disabled,
72
71
  icon: {
73
72
  icon: "close"
74
73
  },
@@ -81,19 +80,19 @@ const E = R(
81
80
  ]
82
81
  }
83
82
  ) }),
84
- t && /* @__PURE__ */ n("div", { className: "gi-textarea-remaining-chars", children: /* @__PURE__ */ n(
85
- z,
83
+ t && /* @__PURE__ */ e("div", { className: "gi-textarea-remaining-chars", children: /* @__PURE__ */ e(
84
+ O,
86
85
  {
87
- text: A("textarea.remainingChars", {
88
- remainingChars: o,
89
- defaultValue: `You have ${o} characters remaining`
86
+ text: F("textarea.remainingChars", {
87
+ remainingChars: m,
88
+ defaultValue: `You have ${m} characters remaining`
90
89
  })
91
90
  }
92
91
  ) })
93
92
  ] });
94
93
  }
95
94
  );
96
- E.displayName = "TextArea";
95
+ $.displayName = "TextArea";
97
96
  export {
98
- E as TextArea
97
+ $ as TextArea
99
98
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ogcio/design-system-react",
3
- "version": "1.13.0",
3
+ "version": "1.15.0",
4
4
  "description": "The GOV IE design system React components.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -50,11 +50,11 @@
50
50
  "postcss-import": "^16.1.0",
51
51
  "react": "19.0.0",
52
52
  "react-dom": "19.0.0",
53
- "@ogcio/design-system-eslint-config": "1.2.6",
54
53
  "@ogcio/design-system-prettier-config": "1.0.6",
55
- "@ogcio/design-system-tailwind": "1.12.0",
54
+ "@ogcio/design-system-eslint-config": "1.2.6",
55
+ "@ogcio/design-system-tailwind": "1.13.1",
56
56
  "@ogcio/theme-doete": "1.0.0",
57
- "@ogcio/theme-govie": "1.6.0"
57
+ "@ogcio/theme-govie": "1.7.0"
58
58
  },
59
59
  "scripts": {
60
60
  "format": "prettier 'src/**/*.{ts,tsx}' --write",