@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.
- package/dist/assets/logos/gov-of-ireland/harp-black.d.ts +2 -0
- package/dist/assets/logos/gov-of-ireland/harp-black.js +322 -0
- package/dist/assets/logos/harp/harp-black.d.ts +2 -0
- package/dist/assets/logos/harp/harp-black.js +63 -0
- package/dist/autocomplete/autocomplete.js +56 -53
- package/dist/button/button.js +1 -1
- package/dist/drawer/drawer.content.js +29 -43
- package/dist/drawer/drawer.d.ts +2 -1
- package/dist/drawer/drawer.js +11 -7
- package/dist/file-upload/file-upload.d.ts +3 -1
- package/dist/forms/form-field/form-field.d.ts +1 -1
- package/dist/forms/form-field/form-field.js +29 -19
- package/dist/header/components/header-menu.js +53 -47
- package/dist/header/components/header-slot.d.ts +5 -3
- package/dist/header/components/header-slot.js +58 -47
- package/dist/header/header.d.ts +1 -1
- package/dist/header/header.js +128 -106
- package/dist/header/types.d.ts +2 -0
- package/dist/header/variants.d.ts +160 -0
- package/dist/header/variants.js +88 -0
- package/dist/input-file/input-file.d.ts +3 -2
- package/dist/input-file/input-file.js +13 -12
- package/dist/input-file/types.d.ts +3 -1
- package/dist/input-text/input-text.d.ts +2 -0
- package/dist/input-text/input-text.js +56 -55
- package/dist/input-text/type.d.ts +1 -0
- package/dist/modal/modal.d.ts +2 -2
- package/dist/modal/modal.js +185 -149
- package/dist/modal/types.d.ts +5 -0
- package/dist/phase-banner/phase-banner.d.ts +4 -2
- package/dist/phase-banner/phase-banner.js +30 -7
- package/dist/popover/popover.js +560 -524
- package/dist/select/select-menu.js +61 -63
- package/dist/select/select-next.js +61 -57
- package/dist/select/types.d.ts +0 -3
- package/dist/styles.css +1 -1
- package/dist/table/table-pagination.js +63 -46
- package/dist/table/table.js +18 -18
- package/dist/text-input/text-input.d.ts +1 -0
- package/dist/textarea/textarea.js +52 -49
- package/dist/toast/toast.js +6 -9
- package/package.json +4 -3
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cn as
|
|
3
|
-
import { translate as
|
|
4
|
-
import { IconButton as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
|
|
12
|
+
const d = () => {
|
|
13
|
+
a > 1 && e(a - 1);
|
|
14
|
+
}, p = () => {
|
|
15
|
+
a < l && e(a + 1);
|
|
15
16
|
};
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
+
return /* @__PURE__ */ o(
|
|
17
18
|
"div",
|
|
18
19
|
{
|
|
19
|
-
className:
|
|
20
|
+
className: m(
|
|
20
21
|
{
|
|
21
|
-
"gi-justify-first":
|
|
22
|
-
"gi-justify-center":
|
|
23
|
-
"gi-justify-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__ */
|
|
29
|
-
|
|
29
|
+
/* @__PURE__ */ i(
|
|
30
|
+
n,
|
|
30
31
|
{
|
|
31
|
-
disabled:
|
|
32
|
-
onClick: () =>
|
|
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__ */
|
|
42
|
-
|
|
42
|
+
/* @__PURE__ */ i(
|
|
43
|
+
n,
|
|
43
44
|
{
|
|
44
|
-
disabled:
|
|
45
|
-
onClick:
|
|
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__ */
|
|
55
|
-
|
|
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
|
-
|
|
68
|
-
|
|
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__ */
|
|
78
|
-
|
|
94
|
+
/* @__PURE__ */ i(
|
|
95
|
+
n,
|
|
79
96
|
{
|
|
80
|
-
disabled:
|
|
81
|
-
onClick: () =>
|
|
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
|
-
|
|
96
|
-
|
|
112
|
+
j as TablePagination,
|
|
113
|
+
j as default
|
|
97
114
|
};
|
package/dist/table/table.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
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 =
|
|
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
|
|
14
|
-
layout:
|
|
15
|
-
rowSize:
|
|
16
|
-
stripped:
|
|
17
|
-
noBorder:
|
|
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:
|
|
20
|
-
className:
|
|
19
|
+
children: i,
|
|
20
|
+
className: s,
|
|
21
21
|
...l
|
|
22
22
|
}) {
|
|
23
|
-
const
|
|
24
|
-
return /* @__PURE__ */
|
|
23
|
+
const b = m({ layout: a });
|
|
24
|
+
return /* @__PURE__ */ n(
|
|
25
25
|
"table",
|
|
26
26
|
{
|
|
27
|
-
className: f(
|
|
27
|
+
className: f(b, s, t && "gi-table-no-border"),
|
|
28
28
|
role: "table",
|
|
29
29
|
"data-testid": r,
|
|
30
|
-
"data-row-size":
|
|
31
|
-
"data-stripped":
|
|
32
|
-
"data-no-border":
|
|
30
|
+
"data-row-size": e,
|
|
31
|
+
"data-stripped": o.toString(),
|
|
32
|
+
"data-no-border": t.toString(),
|
|
33
33
|
...l,
|
|
34
|
-
children:
|
|
34
|
+
children: i
|
|
35
35
|
}
|
|
36
36
|
);
|
|
37
37
|
}
|
|
38
38
|
export {
|
|
39
|
-
|
|
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
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { HintText as
|
|
6
|
-
import { translate as
|
|
7
|
-
import { Icon as
|
|
8
|
-
import { IconButton as
|
|
9
|
-
const
|
|
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:
|
|
12
|
-
rows:
|
|
13
|
-
cols:
|
|
14
|
-
autoComplete:
|
|
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:
|
|
19
|
-
clearButtonEnabled:
|
|
18
|
+
className: R,
|
|
19
|
+
clearButtonEnabled: u,
|
|
20
20
|
onChange: a,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
name: r,
|
|
22
|
+
...l
|
|
23
|
+
}, V) => {
|
|
24
|
+
const n = A(null), [f, I] = v(
|
|
24
25
|
t
|
|
25
26
|
);
|
|
26
|
-
|
|
27
|
-
const [
|
|
28
|
-
|
|
29
|
-
t !== void 0 &&
|
|
30
|
-
}, [
|
|
31
|
-
const k = (
|
|
32
|
-
const
|
|
33
|
-
|
|
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 && (
|
|
36
|
-
target: {
|
|
37
|
-
|
|
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__ */
|
|
42
|
-
/* @__PURE__ */ e("div", { className: "gi-textarea-container", children: /* @__PURE__ */
|
|
43
|
+
return /* @__PURE__ */ g(j, { children: [
|
|
44
|
+
/* @__PURE__ */ e("div", { className: "gi-textarea-container", children: /* @__PURE__ */ g(
|
|
43
45
|
"div",
|
|
44
46
|
{
|
|
45
|
-
className:
|
|
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(
|
|
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
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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":
|
|
62
|
+
"data-clear-enabled": u,
|
|
60
63
|
maxLength: t,
|
|
61
|
-
value:
|
|
64
|
+
value: c,
|
|
62
65
|
onChange: k,
|
|
63
|
-
...
|
|
66
|
+
...l
|
|
64
67
|
}
|
|
65
68
|
),
|
|
66
|
-
|
|
67
|
-
|
|
69
|
+
u ? /* @__PURE__ */ e("div", { className: "gi-text-area-end-element", children: /* @__PURE__ */ e(
|
|
70
|
+
$,
|
|
68
71
|
{
|
|
69
72
|
type: "button",
|
|
70
|
-
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
|
-
|
|
87
|
+
F,
|
|
85
88
|
{
|
|
86
|
-
text:
|
|
87
|
-
remainingChars:
|
|
88
|
-
defaultValue: `You have ${
|
|
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
|
-
|
|
98
|
+
q.displayName = "TextArea";
|
|
96
99
|
export {
|
|
97
|
-
|
|
100
|
+
q as TextArea
|
|
98
101
|
};
|
package/dist/toast/toast.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as o, Fragment as
|
|
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(
|
|
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,
|
|
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
|
-
|
|
91
|
+
x(!0);
|
|
95
92
|
}, 300);
|
|
96
93
|
}, [n]);
|
|
97
|
-
const f = () =>
|
|
98
|
-
return
|
|
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.
|
|
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
|
}
|