@ogcio/design-system-react 1.22.1 → 1.24.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/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/accordion/accordion-item.d.ts +3 -5
- package/dist/accordion/accordion-item.js +32 -28
- package/dist/accordion/accordion.d.ts +3 -5
- package/dist/accordion/accordion.js +22 -33
- package/dist/alert/alert.js +19 -20
- package/dist/autocomplete/autocomplete.js +167 -169
- package/dist/autocomplete/use-autocomplete-controller.js +1 -1
- package/dist/browser-support/runtime.js +2 -3
- package/dist/button/button.js +11 -12
- package/dist/button-group/button-group.js +4 -5
- package/dist/card/card-next.js +122 -125
- package/dist/card/card.js +4 -5
- package/dist/checkbox/checkbox-group.js +3 -4
- package/dist/checkbox/checkbox.js +4 -5
- package/dist/chip/chip.js +11 -12
- package/dist/clsx-OuTLNxxd.js +16 -0
- package/dist/cn.js +4 -16
- package/dist/combo-box/dropdown-item.js +2 -3
- package/dist/cookie-banner/cookie-banner.js +6 -7
- package/dist/data-table/editable-table-cell.js +3 -4
- package/dist/data-table/index.d.ts +7 -0
- package/dist/data-table/index.js +20 -0
- package/dist/details/details.js +6 -7
- package/dist/drawer/drawer.js +18 -19
- package/dist/footer/footer.js +2 -3
- package/dist/forms/form-field/form-field.js +2 -3
- package/dist/header/components/header-menu.js +17 -18
- package/dist/header/header-legacy.js +2 -3
- package/dist/header/header-next/components/header-logo.js +3 -4
- package/dist/header/header-next/components/header-title.js +0 -1
- package/dist/header/header-next/components/menu/components/header-menu-item-button.js +4 -5
- package/dist/header/header-next/components/menu/components/header-menu-item-link.js +0 -1
- package/dist/header/header-next/components/menu/components/header-menu-item-separator.js +4 -5
- package/dist/header/header-next/components/menu/components/header-menu-item-slot.js +0 -1
- package/dist/header/header-next/components/menu/header-menu-context.js +9 -10
- package/dist/header/header-next/components/menu/header-primary-menu.js +4 -5
- package/dist/header/header-next/components/menu/header-secondary-menu.js +0 -1
- package/dist/header/header-next/header-context.js +4 -5
- package/dist/header/header-next/header-next.js +2 -3
- package/dist/hooks/use-breakpoint.js +7 -8
- package/dist/hooks/use-toggle-map.js +12 -13
- package/dist/i18n/config.d.ts +1 -1
- package/dist/i18n/config.js +14 -11
- package/dist/i18n/utility.js +1 -1
- package/dist/i18nInstance-D_96ADqd.js +48 -0
- package/dist/i18next-B_GQfCrJ.js +1362 -0
- package/dist/icon/icon.d.ts +16 -4
- package/dist/icon/icon.js +79 -167
- package/dist/icon-button/icon-button.js +4 -5
- package/dist/index.d.ts +2 -5
- package/dist/index.js +231 -220
- package/dist/input-checkbox/input-checkbox.js +15 -16
- package/dist/input-checkbox-group/input-checkbox-group.js +9 -10
- package/dist/input-password/input-password.js +0 -1
- package/dist/input-radio/input-radio.js +11 -12
- package/dist/input-radio-group/input-radio-group.js +8 -9
- package/dist/input-text/input-text.js +2 -3
- package/dist/{lodash-D1c5hFAM.js → lodash-LsP9-6SV.js} +1343 -1342
- package/dist/modal/modal.js +4 -5
- package/dist/pagination/pagination.js +713 -58
- package/dist/phase-banner/phase-banner.js +2 -3
- package/dist/popover/popover.js +2 -3
- package/dist/radio/radio-group.js +0 -1
- package/dist/radio/radio.js +0 -1
- package/dist/score-select/score-select.js +3 -4
- package/dist/select/select-menu.js +43 -41
- package/dist/select/select-next.js +193 -161
- package/dist/select/select.js +3 -4
- package/dist/side-nav/side-nav.js +9 -10
- package/dist/spinner/spinner.js +2 -3
- package/dist/stack/stack.js +20 -21
- package/dist/styles.css +1 -1
- package/dist/summary-list/summary-list-action.js +6 -7
- package/dist/summary-list/summary-list-context.js +4 -5
- package/dist/summary-list/summary-list-header.js +12 -13
- package/dist/summary-list/summary-list-row.js +17 -18
- package/dist/summary-list/summary-list-value.js +0 -1
- package/dist/summary-list/summary-list.js +4 -5
- package/dist/table/table-data.js +11 -12
- package/dist/table/table-header.js +2 -3
- package/dist/tabs/tab-item.d.ts +1 -1
- package/dist/tabs/tab-item.js +0 -1
- package/dist/tabs/tab-list.js +23 -24
- package/dist/tag/tag.d.ts +9 -3
- package/dist/tag/tag.js +35 -18
- package/dist/text-input/text-input.js +0 -1
- package/dist/textarea/textarea.js +12 -13
- package/dist/toast/ds-toast.js +10 -11
- package/dist/toast/toast.js +15 -16
- package/dist/tooltip/tooltip.js +12 -13
- package/dist/utilities.d.ts +4 -1
- package/dist/utilities.js +29 -16
- package/package.json +6 -5
- package/dist/i18next-DxWa09nx.js +0 -1395
package/dist/toast/toast.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import "@ogcio/design-system-react/browser-check";
|
|
3
2
|
import { jsx as r, Fragment as T } from "react/jsx-runtime";
|
|
4
|
-
import { useState as
|
|
3
|
+
import { useState as i, useEffect as u } from "react";
|
|
5
4
|
import { createPortal as $ } from "react-dom";
|
|
6
5
|
import { cn as b } from "../cn.js";
|
|
7
|
-
import { translate as
|
|
8
|
-
import { Toast as
|
|
6
|
+
import { translate as w } from "../i18n/utility.js";
|
|
7
|
+
import { Toast as p } from "./ds-toast.js";
|
|
9
8
|
const E = [
|
|
10
9
|
{ x: "left", y: "top" },
|
|
11
10
|
{ x: "left", y: "bottom" },
|
|
@@ -15,8 +14,8 @@ const E = [
|
|
|
15
14
|
{ x: "right", y: "bottom" }
|
|
16
15
|
], f = {
|
|
17
16
|
isMounted: !1
|
|
18
|
-
},
|
|
19
|
-
const [e, o] =
|
|
17
|
+
}, I = () => {
|
|
18
|
+
const [e, o] = i([]), [n, c] = i(!1);
|
|
20
19
|
return u(() => {
|
|
21
20
|
c(!0);
|
|
22
21
|
const t = (l) => {
|
|
@@ -32,8 +31,8 @@ const E = [
|
|
|
32
31
|
}, []), n ? /* @__PURE__ */ r(T, { children: E.map((t) => {
|
|
33
32
|
const l = e.filter(
|
|
34
33
|
(a) => {
|
|
35
|
-
var s,
|
|
36
|
-
return ((s = a.position) == null ? void 0 : s.x) === t.x && ((
|
|
34
|
+
var s, d;
|
|
35
|
+
return ((s = a.position) == null ? void 0 : s.x) === t.x && ((d = a.position) == null ? void 0 : d.y) === t.y;
|
|
37
36
|
}
|
|
38
37
|
);
|
|
39
38
|
return $(
|
|
@@ -42,7 +41,7 @@ const E = [
|
|
|
42
41
|
{
|
|
43
42
|
id: `toast-portal-${t.x}-${t.y}`,
|
|
44
43
|
role: "region",
|
|
45
|
-
"aria-label":
|
|
44
|
+
"aria-label": w("toast.position", {
|
|
46
45
|
x: t.x,
|
|
47
46
|
y: t.y,
|
|
48
47
|
defaultValue: `Toasts-${t.y}-${t.x}`
|
|
@@ -56,7 +55,7 @@ const E = [
|
|
|
56
55
|
document.body
|
|
57
56
|
);
|
|
58
57
|
}) }) : null;
|
|
59
|
-
},
|
|
58
|
+
}, L = {
|
|
60
59
|
create: ({ position: e, ...o }) => {
|
|
61
60
|
if (f.isMounted) {
|
|
62
61
|
const n = new CustomEvent("govie:add-toast", {
|
|
@@ -81,10 +80,10 @@ const E = [
|
|
|
81
80
|
duration: l = 5e3,
|
|
82
81
|
animation: a = "fadeinup",
|
|
83
82
|
showIcon: s = !0,
|
|
84
|
-
slotAction:
|
|
83
|
+
slotAction: d,
|
|
85
84
|
...g
|
|
86
85
|
}) => {
|
|
87
|
-
const [m, x] =
|
|
86
|
+
const [m, x] = i(!0), [y, h] = i(!1);
|
|
88
87
|
u(() => {
|
|
89
88
|
setTimeout(() => {
|
|
90
89
|
v();
|
|
@@ -109,7 +108,7 @@ const E = [
|
|
|
109
108
|
"aria-label": o,
|
|
110
109
|
...g,
|
|
111
110
|
children: /* @__PURE__ */ r("div", { className: "gi-wrapper", children: /* @__PURE__ */ r("div", { className: "gi-message", children: /* @__PURE__ */ r(
|
|
112
|
-
|
|
111
|
+
p,
|
|
113
112
|
{
|
|
114
113
|
onClose: v,
|
|
115
114
|
title: o,
|
|
@@ -117,7 +116,7 @@ const E = [
|
|
|
117
116
|
variant: e,
|
|
118
117
|
description: n,
|
|
119
118
|
dismissible: t,
|
|
120
|
-
slotAction:
|
|
119
|
+
slotAction: d,
|
|
121
120
|
showIcon: s
|
|
122
121
|
}
|
|
123
122
|
) }) })
|
|
@@ -126,6 +125,6 @@ const E = [
|
|
|
126
125
|
};
|
|
127
126
|
export {
|
|
128
127
|
C as Toast,
|
|
129
|
-
|
|
130
|
-
|
|
128
|
+
I as ToastProvider,
|
|
129
|
+
L as toaster
|
|
131
130
|
};
|
package/dist/tooltip/tooltip.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import "@ogcio/design-system-react/browser-check";
|
|
3
2
|
import { jsxs as b, jsx as g } from "react/jsx-runtime";
|
|
4
|
-
import { useState as c, useId as h, useCallback as
|
|
3
|
+
import { useState as c, useId as h, useCallback as d, useEffect as v } from "react";
|
|
5
4
|
import { c as y } from "../index-CB-zPpNk.js";
|
|
6
|
-
const
|
|
5
|
+
const T = ["top", "bottom", "left", "right"], E = y({
|
|
7
6
|
base: "gi-tooltip",
|
|
8
7
|
variants: {
|
|
9
8
|
position: {
|
|
@@ -13,17 +12,17 @@ const F = ["top", "bottom", "left", "right"], E = y({
|
|
|
13
12
|
bottom: "gi-tooltip-bottom"
|
|
14
13
|
}
|
|
15
14
|
}
|
|
16
|
-
}),
|
|
15
|
+
}), F = ({
|
|
17
16
|
text: o,
|
|
18
17
|
position: i = "top",
|
|
19
|
-
dataTestid:
|
|
18
|
+
dataTestid: p,
|
|
20
19
|
children: u
|
|
21
20
|
}) => {
|
|
22
|
-
const [e, n] = c(!1), [
|
|
21
|
+
const [e, n] = c(!1), [f, a] = c(!1), l = h(), r = () => n(!0), t = d(() => {
|
|
23
22
|
n(!1), a(!1);
|
|
24
|
-
}, []), s =
|
|
25
|
-
(
|
|
26
|
-
|
|
23
|
+
}, []), s = d(
|
|
24
|
+
(m) => {
|
|
25
|
+
m.key === "Escape" && t();
|
|
27
26
|
},
|
|
28
27
|
[t]
|
|
29
28
|
);
|
|
@@ -35,7 +34,7 @@ const F = ["top", "bottom", "left", "right"], E = y({
|
|
|
35
34
|
className: "gi-tooltip-wrapper",
|
|
36
35
|
onMouseEnter: r,
|
|
37
36
|
onMouseLeave: () => {
|
|
38
|
-
|
|
37
|
+
f || t();
|
|
39
38
|
},
|
|
40
39
|
onFocus: () => {
|
|
41
40
|
a(!0), r();
|
|
@@ -44,7 +43,7 @@ const F = ["top", "bottom", "left", "right"], E = y({
|
|
|
44
43
|
t();
|
|
45
44
|
},
|
|
46
45
|
"aria-describedby": e ? l : void 0,
|
|
47
|
-
"data-testid":
|
|
46
|
+
"data-testid": p,
|
|
48
47
|
children: [
|
|
49
48
|
u,
|
|
50
49
|
e && /* @__PURE__ */ g(
|
|
@@ -63,6 +62,6 @@ const F = ["top", "bottom", "left", "right"], E = y({
|
|
|
63
62
|
);
|
|
64
63
|
};
|
|
65
64
|
export {
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
F as Tooltip,
|
|
66
|
+
T as positionVariants
|
|
68
67
|
};
|
package/dist/utilities.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* Returns a safe for url string representation.
|
|
4
4
|
*
|
|
@@ -10,3 +10,6 @@ export declare function slugify(value?: string): string | undefined;
|
|
|
10
10
|
export declare function generateRandomId(): string;
|
|
11
11
|
export declare function getSpecialComponentType(child: ReactNode): string | null;
|
|
12
12
|
export declare function isSpecialComponent(child: ReactNode, componentList?: Array<string>): boolean;
|
|
13
|
+
export declare const cycleEnabledIndex: (list: ReactElement<{
|
|
14
|
+
hidden?: boolean;
|
|
15
|
+
}>[], currentIndex: number, direction: 1 | -1) => number;
|
package/dist/utilities.js
CHANGED
|
@@ -1,23 +1,36 @@
|
|
|
1
|
-
import { isValidElement as
|
|
2
|
-
function
|
|
3
|
-
if (!
|
|
4
|
-
return
|
|
5
|
-
let
|
|
6
|
-
return
|
|
1
|
+
import { isValidElement as u } from "react";
|
|
2
|
+
function f(e) {
|
|
3
|
+
if (!e)
|
|
4
|
+
return e;
|
|
5
|
+
let n = e.replaceAll(/^\s+|\s+$/g, "");
|
|
6
|
+
return n = n.toLowerCase(), n = n.replaceAll(/[^\d a-z-]/g, "").replaceAll(/\s+/g, "-").replaceAll(/-+/g, "-"), n;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function s() {
|
|
9
9
|
return Math.random().toString(36).slice(2, 11);
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
var
|
|
13
|
-
return
|
|
11
|
+
function a(e) {
|
|
12
|
+
var n, r;
|
|
13
|
+
return u(e) && (((n = e.type) == null ? void 0 : n.componentType) || ((r = e.props) == null ? void 0 : r.__type)) || null;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
return
|
|
15
|
+
function g(e, n = []) {
|
|
16
|
+
return n.includes(a(e) ?? "");
|
|
17
17
|
}
|
|
18
|
+
const d = (e, n, r) => {
|
|
19
|
+
var l, p;
|
|
20
|
+
const t = e.length;
|
|
21
|
+
if (t === 0)
|
|
22
|
+
return -1;
|
|
23
|
+
for (let o = 1; o <= t; o++) {
|
|
24
|
+
const c = (n + r * o) % t;
|
|
25
|
+
if (!((p = (l = e == null ? void 0 : e.at(c)) == null ? void 0 : l.props) != null && p.hidden))
|
|
26
|
+
return (c + t) % t;
|
|
27
|
+
}
|
|
28
|
+
return -1;
|
|
29
|
+
};
|
|
18
30
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
31
|
+
d as cycleEnabledIndex,
|
|
32
|
+
s as generateRandomId,
|
|
33
|
+
a as getSpecialComponentType,
|
|
34
|
+
g as isSpecialComponent,
|
|
35
|
+
f as slugify
|
|
23
36
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ogcio/design-system-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.24.0",
|
|
4
4
|
"description": "The GOV IE design system React components.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"@popperjs/core": "^2.11.8",
|
|
34
34
|
"@radix-ui/react-slot": "^1.1.2",
|
|
35
35
|
"clsx": "^2.1.1",
|
|
36
|
+
"react-i18next": "^16.3.3",
|
|
36
37
|
"rollup-preserve-directives": "^1.1.2"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
@@ -47,16 +48,16 @@
|
|
|
47
48
|
"eslint": "^9.23.0",
|
|
48
49
|
"eslint-plugin-storybook": "^0.12.0",
|
|
49
50
|
"glob": "^11.0.1",
|
|
50
|
-
"i18next": "^
|
|
51
|
+
"i18next": "^25.6.2",
|
|
51
52
|
"postcss": "^8.4.40",
|
|
52
53
|
"postcss-import": "^16.1.0",
|
|
53
54
|
"react": "19.0.0",
|
|
54
55
|
"react-dom": "19.0.0",
|
|
55
56
|
"@ogcio/design-system-eslint-config": "1.2.6",
|
|
56
57
|
"@ogcio/design-system-prettier-config": "1.0.6",
|
|
57
|
-
"@ogcio/design-system-tailwind": "1.
|
|
58
|
-
"@ogcio/theme-
|
|
59
|
-
"@ogcio/theme-
|
|
58
|
+
"@ogcio/design-system-tailwind": "1.20.0",
|
|
59
|
+
"@ogcio/theme-doete": "1.0.0",
|
|
60
|
+
"@ogcio/theme-govie": "1.20.0"
|
|
60
61
|
},
|
|
61
62
|
"scripts": {
|
|
62
63
|
"format": "prettier 'src/**/*.{ts,tsx}' --write",
|