@ogcio/design-system-react 1.15.2 → 1.16.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/assets/logos/gov-of-ireland/harp-black.d.ts +2 -0
  2. package/dist/assets/logos/gov-of-ireland/harp-black.js +322 -0
  3. package/dist/assets/logos/harp/harp-black.d.ts +2 -0
  4. package/dist/assets/logos/harp/harp-black.js +63 -0
  5. package/dist/autocomplete/autocomplete.js +56 -53
  6. package/dist/button/button.js +1 -1
  7. package/dist/drawer/drawer.content.js +29 -43
  8. package/dist/drawer/drawer.d.ts +2 -1
  9. package/dist/drawer/drawer.js +11 -7
  10. package/dist/file-upload/file-upload.d.ts +3 -1
  11. package/dist/forms/form-field/form-field.d.ts +1 -1
  12. package/dist/forms/form-field/form-field.js +29 -19
  13. package/dist/header/components/header-menu.js +53 -47
  14. package/dist/header/components/header-slot.d.ts +5 -3
  15. package/dist/header/components/header-slot.js +58 -47
  16. package/dist/header/header.d.ts +1 -1
  17. package/dist/header/header.js +128 -106
  18. package/dist/header/types.d.ts +2 -0
  19. package/dist/header/variants.d.ts +160 -0
  20. package/dist/header/variants.js +88 -0
  21. package/dist/input-file/input-file.d.ts +3 -2
  22. package/dist/input-file/input-file.js +13 -12
  23. package/dist/input-file/types.d.ts +3 -1
  24. package/dist/input-text/input-text.d.ts +2 -0
  25. package/dist/input-text/input-text.js +56 -55
  26. package/dist/input-text/type.d.ts +1 -0
  27. package/dist/modal/modal.d.ts +2 -2
  28. package/dist/modal/modal.js +185 -149
  29. package/dist/modal/types.d.ts +5 -0
  30. package/dist/phase-banner/phase-banner.d.ts +4 -2
  31. package/dist/phase-banner/phase-banner.js +30 -7
  32. package/dist/popover/popover.js +560 -524
  33. package/dist/select/select-menu.js +61 -63
  34. package/dist/select/select-next.js +61 -57
  35. package/dist/select/types.d.ts +0 -3
  36. package/dist/styles.css +1 -1
  37. package/dist/table/table-pagination.js +63 -46
  38. package/dist/table/table.js +18 -18
  39. package/dist/text-input/text-input.d.ts +1 -0
  40. package/dist/textarea/textarea.js +52 -49
  41. package/dist/toast/toast.js +6 -9
  42. package/package.json +4 -3
@@ -1,35 +1,36 @@
1
- import { jsxs as t, jsx as l } from "react/jsx-runtime";
2
- import { cn as f } from "../cn.js";
3
- import { translate as e } from "../i18n/utility.js";
4
- import { IconButton as o } from "../icon-button/icon-button.js";
5
- const v = ({
6
- currentPage: i,
7
- totalPages: a,
8
- onPageChange: n,
9
- align: s = "end"
1
+ import { jsxs as o, jsx as i } from "react/jsx-runtime";
2
+ import { cn as m } from "../cn.js";
3
+ import { translate as s } from "../i18n/utility.js";
4
+ import { IconButton as n } from "../icon-button/icon-button.js";
5
+ import { SelectNative as f, SelectItem as v } from "../select/select-native.js";
6
+ const j = ({
7
+ currentPage: a,
8
+ totalPages: l,
9
+ onPageChange: e,
10
+ align: t = "end"
10
11
  }) => {
11
- const c = () => {
12
- i > 1 && n(i - 1);
13
- }, d = () => {
14
- i < a && n(i + 1);
12
+ const d = () => {
13
+ a > 1 && e(a - 1);
14
+ }, p = () => {
15
+ a < l && e(a + 1);
15
16
  };
16
- return /* @__PURE__ */ t(
17
+ return /* @__PURE__ */ o(
17
18
  "div",
18
19
  {
19
- className: f(
20
+ className: m(
20
21
  {
21
- "gi-justify-first": s === "start",
22
- "gi-justify-center": s === "center",
23
- "gi-justify-end": s === "end"
22
+ "gi-justify-first": t === "start",
23
+ "gi-justify-center": t === "center",
24
+ "gi-justify-end": t === "end"
24
25
  },
25
26
  "gi-table-pagination"
26
27
  ),
27
28
  children: [
28
- /* @__PURE__ */ l(
29
- o,
29
+ /* @__PURE__ */ i(
30
+ n,
30
31
  {
31
- disabled: i === 1,
32
- onClick: () => n(1),
32
+ disabled: a === 1,
33
+ onClick: () => e(1),
33
34
  appearance: "dark",
34
35
  variant: "flat",
35
36
  className: "gi-mr-4",
@@ -38,11 +39,11 @@ const v = ({
38
39
  }
39
40
  }
40
41
  ),
41
- /* @__PURE__ */ l(
42
- o,
42
+ /* @__PURE__ */ i(
43
+ n,
43
44
  {
44
- disabled: i === 1,
45
- onClick: c,
45
+ disabled: a === 1,
46
+ onClick: d,
46
47
  appearance: "dark",
47
48
  variant: "flat",
48
49
  className: "gi-mr-2",
@@ -51,21 +52,37 @@ const v = ({
51
52
  }
52
53
  }
53
54
  ),
54
- /* @__PURE__ */ t("div", { className: "gi-table-pagination-label", "aria-live": "polite", children: [
55
- /* @__PURE__ */ l("span", { className: "gi-font-bold", children: e("table.pagination.page", {
56
- currentPage: i,
57
- defaultValue: `Page ${i} `
58
- }) }),
59
- e("table.pagination.ofTotal", {
60
- totalPages: a,
61
- defaultValue: `of ${a}`
62
- })
63
- ] }),
64
- /* @__PURE__ */ l(
65
- o,
55
+ /* @__PURE__ */ o(
56
+ "div",
66
57
  {
67
- onClick: d,
68
- disabled: i === a,
58
+ className: "gi-table-pagination-label gi-space-x-2",
59
+ "aria-live": "polite",
60
+ children: [
61
+ /* @__PURE__ */ i("span", { children: s("table.pagination.page", {
62
+ defaultValue: "Page"
63
+ }) }),
64
+ /* @__PURE__ */ i(
65
+ f,
66
+ {
67
+ "aria-label": "Select page",
68
+ value: a,
69
+ className: "!gi-min-w-12",
70
+ onChange: (r) => e(Number(r.target.value)),
71
+ children: Array.from({ length: l }, (r, c) => /* @__PURE__ */ i(v, { value: c + 1, children: c + 1 }, c + 1))
72
+ }
73
+ ),
74
+ /* @__PURE__ */ i("span", { children: s("table.pagination.ofTotal", {
75
+ totalPages: l,
76
+ defaultValue: `of ${l}`
77
+ }) })
78
+ ]
79
+ }
80
+ ),
81
+ /* @__PURE__ */ i(
82
+ n,
83
+ {
84
+ onClick: p,
85
+ disabled: a === l,
69
86
  appearance: "dark",
70
87
  variant: "flat",
71
88
  className: "gi-ml-2",
@@ -74,11 +91,11 @@ const v = ({
74
91
  }
75
92
  }
76
93
  ),
77
- /* @__PURE__ */ l(
78
- o,
94
+ /* @__PURE__ */ i(
95
+ n,
79
96
  {
80
- disabled: i === a,
81
- onClick: () => n(a),
97
+ disabled: a === l,
98
+ onClick: () => e(l),
82
99
  appearance: "dark",
83
100
  variant: "flat",
84
101
  className: "gi-ml-4",
@@ -92,6 +109,6 @@ const v = ({
92
109
  );
93
110
  };
94
111
  export {
95
- v as TablePagination,
96
- v as default
112
+ j as TablePagination,
113
+ j as default
97
114
  };
@@ -1,7 +1,7 @@
1
- import { jsx as d } from "react/jsx-runtime";
2
- import { c as b } from "../index-CB-zPpNk.js";
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { c as d } from "../index-CB-zPpNk.js";
3
3
  import { cn as f } from "../cn.js";
4
- const m = b({
4
+ const m = d({
5
5
  base: "gi-table",
6
6
  variants: {
7
7
  layout: {
@@ -10,31 +10,31 @@ const m = b({
10
10
  }
11
11
  }
12
12
  });
13
- function g({
14
- layout: t = "auto",
15
- rowSize: a = "md",
16
- stripped: e = !1,
17
- noBorder: o = !1,
13
+ function p({
14
+ layout: a = "auto",
15
+ rowSize: e = "md",
16
+ stripped: o = !1,
17
+ noBorder: t = !1,
18
18
  dataTestid: r,
19
- children: s,
20
- className: i,
19
+ children: i,
20
+ className: s,
21
21
  ...l
22
22
  }) {
23
- const n = m({ layout: t });
24
- return /* @__PURE__ */ d(
23
+ const b = m({ layout: a });
24
+ return /* @__PURE__ */ n(
25
25
  "table",
26
26
  {
27
- className: f(n, i),
27
+ className: f(b, s, t && "gi-table-no-border"),
28
28
  role: "table",
29
29
  "data-testid": r,
30
- "data-row-size": a,
31
- "data-stripped": e.toString(),
32
- "data-no-border": o.toString(),
30
+ "data-row-size": e,
31
+ "data-stripped": o.toString(),
32
+ "data-no-border": t.toString(),
33
33
  ...l,
34
- children: s
34
+ children: i
35
35
  }
36
36
  );
37
37
  }
38
38
  export {
39
- g as Table
39
+ p as Table
40
40
  };
@@ -19,6 +19,7 @@ export declare const TextInput: import('react').ForwardRefExoticComponent<import
19
19
  halfFluid?: boolean;
20
20
  clearButtonEnabled?: boolean;
21
21
  containerProps?: any;
22
+ dataTestId?: string;
22
23
  } & import('react').RefAttributes<HTMLInputElement>>;
23
24
  /** @deprecated Use InputTextProps instead */
24
25
  export type TextInputProps = InputTextProps;
@@ -1,73 +1,76 @@
1
1
  "use client";
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(
2
+ import { jsxs as g, Fragment as j, jsx as e } from "react/jsx-runtime";
3
+ import { forwardRef as z, useRef as A, useState as v, useImperativeHandle as H, useEffect as O } from "react";
4
+ import { cn as h } from "../cn.js";
5
+ import { HintText as F } from "../hint-text/hint-text.js";
6
+ import { translate as L } from "../i18n/utility.js";
7
+ import { Icon as Y } from "../icon/icon.js";
8
+ import { IconButton as $ } from "../icon-button/icon-button.js";
9
+ const q = z(
10
10
  ({
11
- value: o,
12
- rows: h = 4,
13
- cols: p = 100,
14
- autoComplete: x = "on",
11
+ value: d,
12
+ rows: p = 4,
13
+ cols: x = 100,
14
+ autoComplete: b = "on",
15
15
  maxChars: t,
16
16
  halfFluid: N = !1,
17
17
  iconStart: i,
18
- className: b,
19
- clearButtonEnabled: d,
18
+ className: R,
19
+ clearButtonEnabled: u,
20
20
  onChange: a,
21
- ...r
22
- }, R) => {
23
- const n = z(null), [m, V] = g(
21
+ name: r,
22
+ ...l
23
+ }, V) => {
24
+ const n = A(null), [f, I] = v(
24
25
  t
25
26
  );
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);
27
+ H(V, () => n.current);
28
+ const [T, m] = v(""), s = d !== void 0, c = s ? String(d) : T;
29
+ O(() => {
30
+ t !== void 0 && I(t - c.length);
31
+ }, [c, t]);
32
+ const k = (o) => {
33
+ const y = o.target.value;
34
+ s || m(y), a && a(o);
34
35
  }, w = () => {
35
- n.current && (l || f(""), a && a({
36
- target: {
37
- value: ""
38
- }
36
+ n.current && (s || m(""), a && a({
37
+ target: { name: r, value: "" },
38
+ currentTarget: { name: r, value: "" },
39
+ type: "change",
40
+ bubbles: !0
39
41
  }), n.current.focus());
40
42
  };
41
- return /* @__PURE__ */ u(j, { children: [
42
- /* @__PURE__ */ e("div", { className: "gi-textarea-container", children: /* @__PURE__ */ u(
43
+ return /* @__PURE__ */ g(j, { children: [
44
+ /* @__PURE__ */ e("div", { className: "gi-textarea-container", children: /* @__PURE__ */ g(
43
45
  "div",
44
46
  {
45
- className: v("gi-textarea-inner", {
47
+ className: h("gi-textarea-inner", {
46
48
  "gi-input-half-width": N
47
49
  }),
48
50
  children: [
49
- i && /* @__PURE__ */ e("div", { className: "gi-text-area-icon-start", children: /* @__PURE__ */ e(L, { icon: i, size: "md", disabled: r.disabled }) }),
51
+ i && /* @__PURE__ */ e("div", { className: "gi-text-area-icon-start", children: /* @__PURE__ */ e(Y, { icon: i, size: "md", disabled: l.disabled }) }),
50
52
  /* @__PURE__ */ e(
51
53
  "textarea",
52
54
  {
53
- rows: h,
54
- cols: p,
55
- autoComplete: x,
56
- className: v(b, "gi-textarea"),
55
+ name: r,
56
+ rows: p,
57
+ cols: x,
58
+ autoComplete: b,
59
+ className: h(R, "gi-textarea"),
57
60
  ref: n,
58
61
  "data-icon-start": !!i,
59
- "data-clear-enabled": d,
62
+ "data-clear-enabled": u,
60
63
  maxLength: t,
61
- value: s,
64
+ value: c,
62
65
  onChange: k,
63
- ...r
66
+ ...l
64
67
  }
65
68
  ),
66
- d ? /* @__PURE__ */ e("div", { className: "gi-text-area-end-element", children: /* @__PURE__ */ e(
67
- Y,
69
+ u ? /* @__PURE__ */ e("div", { className: "gi-text-area-end-element", children: /* @__PURE__ */ e(
70
+ $,
68
71
  {
69
72
  type: "button",
70
- disabled: r.disabled,
73
+ disabled: l.disabled,
71
74
  icon: {
72
75
  icon: "close"
73
76
  },
@@ -81,18 +84,18 @@ const $ = y(
81
84
  }
82
85
  ) }),
83
86
  t && /* @__PURE__ */ e("div", { className: "gi-textarea-remaining-chars", children: /* @__PURE__ */ e(
84
- O,
87
+ F,
85
88
  {
86
- text: F("textarea.remainingChars", {
87
- remainingChars: m,
88
- defaultValue: `You have ${m} characters remaining`
89
+ text: L("textarea.remainingChars", {
90
+ remainingChars: f,
91
+ defaultValue: `You have ${f} characters remaining`
89
92
  })
90
93
  }
91
94
  ) })
92
95
  ] });
93
96
  }
94
97
  );
95
- $.displayName = "TextArea";
98
+ q.displayName = "TextArea";
96
99
  export {
97
- $ as TextArea
100
+ q as TextArea
98
101
  };
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { jsx as o, Fragment as v } from "react/jsx-runtime";
2
+ import { jsx as o, Fragment as y } from "react/jsx-runtime";
3
3
  import { useState as i, useEffect as m } from "react";
4
4
  import { createPortal as h } from "react-dom";
5
5
  import { cn as T } from "../cn.js";
@@ -7,13 +7,10 @@ import { translate as $ } from "../i18n/utility.js";
7
7
  import { Toast as w } from "./ds-toast.js";
8
8
  const b = [
9
9
  { x: "left", y: "top" },
10
- { x: "left", y: "center" },
11
10
  { x: "left", y: "bottom" },
12
11
  { x: "center", y: "top" },
13
- { x: "center", y: "center" },
14
12
  { x: "center", y: "bottom" },
15
13
  { x: "right", y: "top" },
16
- { x: "right", y: "center" },
17
14
  { x: "right", y: "bottom" }
18
15
  ], u = {
19
16
  isMounted: !1
@@ -31,7 +28,7 @@ const b = [
31
28
  t
32
29
  ), u.isMounted = !1;
33
30
  };
34
- }, []), l ? /* @__PURE__ */ o(v, { children: b.map((t) => {
31
+ }, []), l ? /* @__PURE__ */ o(y, { children: b.map((t) => {
35
32
  const d = e.filter(
36
33
  (a) => {
37
34
  var s, n;
@@ -84,18 +81,18 @@ const b = [
84
81
  animation: a = "fadeinup",
85
82
  slotAction: s
86
83
  }) => {
87
- const [n, x] = i(!0), [y, g] = i(!1);
84
+ const [n, g] = i(!0), [v, x] = i(!1);
88
85
  m(() => {
89
86
  setTimeout(() => {
90
87
  f();
91
88
  }, d);
92
89
  }, []), m(() => {
93
90
  n || setTimeout(() => {
94
- g(!0);
91
+ x(!0);
95
92
  }, 300);
96
93
  }, [n]);
97
- const f = () => x(!1);
98
- return y ? null : /* @__PURE__ */ o(
94
+ const f = () => g(!1);
95
+ return v ? null : /* @__PURE__ */ o(
99
96
  "div",
100
97
  {
101
98
  "data-testid": `${r}-${e || "info"}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ogcio/design-system-react",
3
- "version": "1.15.2",
3
+ "version": "1.16.0",
4
4
  "description": "The GOV IE design system React components.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -51,8 +51,8 @@
51
51
  "react": "19.0.0",
52
52
  "react-dom": "19.0.0",
53
53
  "@ogcio/design-system-eslint-config": "1.2.6",
54
- "@ogcio/design-system-tailwind": "1.13.3",
55
54
  "@ogcio/design-system-prettier-config": "1.0.6",
55
+ "@ogcio/design-system-tailwind": "1.14.0",
56
56
  "@ogcio/theme-doete": "1.0.0",
57
57
  "@ogcio/theme-govie": "1.7.0"
58
58
  },
@@ -70,6 +70,7 @@
70
70
  "storybook:build": "storybook build --stats-json",
71
71
  "storybook:test": "vitest --project=storybook",
72
72
  "storybook:coverage": "vitest --project=storybook --coverage",
73
- "percy": "pnpm storybook:build && percy storybook ./storybook-static --config percy.yaml"
73
+ "percy": "pnpm storybook:build && percy storybook ./storybook-static --config percy.yaml",
74
+ "typecheck": "tsc -p tsconfig.json --noEmit"
74
75
  }
75
76
  }