@ogcio/design-system-react 1.32.0 → 1.34.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/accordion/accordion-item.js +62 -57
- package/dist/alert/alert.js +37 -39
- package/dist/alert/variants.d.ts +49 -52
- package/dist/alert/variants.js +17 -18
- package/dist/atoms/Button.d.ts +2 -2
- package/dist/atoms/Button.js +3 -2
- package/dist/atoms/heading/styles.js +1 -1
- package/dist/atoms/storybook/Heading.meta.d.ts +1 -1
- package/dist/atoms/storybook/Heading.meta.js +4 -4
- package/dist/atoms/storybook/Icons.meta.d.ts +1 -1
- package/dist/atoms/storybook/Icons.meta.js +7 -7
- package/dist/atoms/storybook/InsetText.meta.d.ts +1 -1
- package/dist/atoms/storybook/InsetText.meta.js +1 -1
- package/dist/atoms/storybook/Logos.meta.d.ts +1 -1
- package/dist/atoms/storybook/Logos.meta.js +1 -1
- package/dist/autocomplete/autocomplete.js +1 -1
- package/dist/autocomplete/use-autocomplete-controller.js +2 -2
- package/dist/browser-support/browser-support.js +202 -30
- package/dist/button/button.d.ts +2 -9
- package/dist/button/button.js +65 -32
- package/dist/button/helpers.d.ts +2 -1
- package/dist/button/types.d.ts +25 -8
- package/dist/button-group/button-group.js +43 -45
- package/dist/button-group/types.d.ts +5 -5
- package/dist/card/card-legacy.js +1 -1
- package/dist/card/types.d.ts +1 -1
- package/dist/chip/chip.js +1 -1
- package/dist/combo-box/dropdown-item.js +1 -1
- package/dist/cookie-banner/cookie-banner.d.ts +1 -1
- package/dist/data-table/data-table-footer.js +2 -2
- package/dist/data-table/data-table-header.js +2 -2
- package/dist/data-table/data-table-selected-rows.js +1 -1
- package/dist/data-table/editable-table-cell.js +1 -1
- package/dist/details/details.js +13 -16
- package/dist/drawer/drawer.d.ts +1 -1
- package/dist/drawer/drawer.js +18 -18
- package/dist/error-text/error-text.js +28 -27
- package/dist/forms/form-field/form-field.js +24 -25
- package/dist/header/components/header-search.js +2 -2
- package/dist/header/header-legacy.js +6 -6
- package/dist/header/header-next/header-next.js +3 -3
- package/dist/header/variants.js +1 -1
- package/dist/hint-text/hint-text.js +26 -20
- package/dist/i18n/config.js +2 -2
- package/dist/i18n/utility.js +1 -1
- package/dist/{i18nInstance-AYICsHJu.js → i18nInstance-DiZ0lVPL.js} +2 -2
- package/dist/i18next-zBkzxGW1.js +1388 -0
- package/dist/icon-button/icon-button.d.ts +3 -5
- package/dist/{index-CB-zPpNk.js → index-C7W4ssMN.js} +1 -1
- package/dist/index-DqBV2TCd.js +23108 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/label/label.d.ts +78 -30
- package/dist/label/label.js +29 -14
- package/dist/{lodash-82PmXrjJ.js → lodash-DTZaBYO8.js} +289 -272
- package/dist/modal/modal.content.js +2 -2
- package/dist/modal/modal.js +38 -38
- package/dist/modal/types.d.ts +5 -4
- package/dist/pagination/pagination.js +82 -80
- package/dist/progress-stepper/progress-stepper.js +1 -1
- package/dist/score-select/type.d.ts +2 -2
- package/dist/select/select-native.js +1 -1
- package/dist/select/select-next.js +87 -87
- package/dist/side-nav/side-nav.js +1 -1
- package/dist/spinner/spinner.js +1 -1
- package/dist/stack/stack.js +2 -2
- package/dist/styles.css +1 -1
- package/dist/table/table.js +1 -1
- package/dist/tabs/tab-item.js +53 -71
- package/dist/tabs/variants.d.ts +269 -0
- package/dist/tabs/variants.js +87 -0
- package/dist/toast/ds-toast.js +1 -1
- package/dist/tooltip/tooltip.js +27 -35
- package/dist/tooltip/variants.d.ts +115 -0
- package/dist/tooltip/variants.js +59 -0
- package/dist/{useTranslation-DiBQuy8S.js → useTranslation-CRbS3UeG.js} +94 -85
- package/package.json +14 -7
- package/dist/i18next-Bfi2-LyH.js +0 -1370
- package/dist/index-Bh2cTIps.js +0 -33899
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as i,
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as i, Fragment as r, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import o from "../atoms/Button.js";
|
|
3
3
|
import { ModalTitle as e, ModalBody as a, ModalFooter as n } from "./modal.js";
|
|
4
4
|
const c = /* @__PURE__ */ i(r, { children: [
|
|
5
5
|
/* @__PURE__ */ t(e, { children: "Modal Title" }),
|
package/dist/modal/modal.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as l, jsxs as y, Fragment as
|
|
3
|
-
import { isValidElement as K, cloneElement as T, useState as
|
|
2
|
+
import { jsx as l, jsxs as y, Fragment as P } from "react/jsx-runtime";
|
|
3
|
+
import { isValidElement as K, cloneElement as T, useState as j, useRef as U, useMemo as W, Children as _, useId as z, useEffect as C } from "react";
|
|
4
4
|
import { createPortal as G } from "react-dom";
|
|
5
5
|
import J from "../Heading.js";
|
|
6
|
-
import
|
|
6
|
+
import A from "../atoms/Button.js";
|
|
7
7
|
import { cn as u } from "../cn.js";
|
|
8
8
|
import { useAriaHider as Q } from "../hooks/use-aria-hider.js";
|
|
9
9
|
import { useFocusTrap as X } from "../hooks/use-focus-trap.js";
|
|
10
10
|
import { Icon as Y } from "../icon/icon.js";
|
|
11
11
|
import { IconButton as Z } from "../icon-button/icon-button.js";
|
|
12
12
|
import { splitAriaProps as O, isSpecialComponent as ee, getSpecialComponentType as te } from "../utils/utilities.js";
|
|
13
|
-
const
|
|
13
|
+
const B = {
|
|
14
14
|
flat: 0,
|
|
15
15
|
secondary: 1,
|
|
16
16
|
primary: 2
|
|
@@ -21,16 +21,16 @@ const I = {
|
|
|
21
21
|
}) => {
|
|
22
22
|
let n = "sm";
|
|
23
23
|
return (o === "large" || o === "medium") && (n = "md"), e ? /* @__PURE__ */ l(
|
|
24
|
-
|
|
24
|
+
A,
|
|
25
25
|
{
|
|
26
26
|
onClick: t.onClick,
|
|
27
27
|
variant: "flat",
|
|
28
28
|
size: o,
|
|
29
29
|
appearance: "dark",
|
|
30
30
|
className: "gi-modal-icon",
|
|
31
|
-
|
|
31
|
+
ariaLabel: e,
|
|
32
32
|
...t,
|
|
33
|
-
children: /* @__PURE__ */ y(
|
|
33
|
+
children: /* @__PURE__ */ y(P, { children: [
|
|
34
34
|
e,
|
|
35
35
|
/* @__PURE__ */ l(Y, { icon: "close", size: n })
|
|
36
36
|
] })
|
|
@@ -72,25 +72,25 @@ const I = {
|
|
|
72
72
|
closeOnOverlayClick: n = !0,
|
|
73
73
|
isOpen: a,
|
|
74
74
|
onClose: d,
|
|
75
|
-
closeButtonLabel:
|
|
75
|
+
closeButtonLabel: v,
|
|
76
76
|
className: s,
|
|
77
77
|
children: f,
|
|
78
78
|
closeButtonSize: r,
|
|
79
79
|
closeOnEscape: i,
|
|
80
80
|
dataTestId: c,
|
|
81
|
-
...
|
|
81
|
+
...h
|
|
82
82
|
}) => {
|
|
83
|
-
var
|
|
83
|
+
var I;
|
|
84
84
|
const M = U(null);
|
|
85
85
|
Q(M, a);
|
|
86
|
-
const [D,
|
|
87
|
-
() => O(
|
|
88
|
-
[
|
|
86
|
+
const [D, L] = W(
|
|
87
|
+
() => O(h),
|
|
88
|
+
[h]
|
|
89
89
|
), F = _.toArray(f), N = (m) => F.find(
|
|
90
90
|
(p) => te(p) === m
|
|
91
|
-
), g = N("ModalTitle"), b = N("ModalFooter") || N("DrawerFooter"),
|
|
91
|
+
), g = N("ModalTitle"), b = N("ModalFooter") || N("DrawerFooter"), R = z(), S = ((I = g == null ? void 0 : g.props) == null ? void 0 : I.id) || `gi-modal-title-${R}`, H = g ? T(g, {
|
|
92
92
|
as: o === "sm" ? "h5" : "h4",
|
|
93
|
-
id:
|
|
93
|
+
id: S
|
|
94
94
|
}) : null, $ = b ? T(b, {
|
|
95
95
|
dataModalSize: o
|
|
96
96
|
}) : null, V = F.filter(
|
|
@@ -109,18 +109,18 @@ const I = {
|
|
|
109
109
|
if (!a || !t || !n)
|
|
110
110
|
return;
|
|
111
111
|
const m = (p) => {
|
|
112
|
-
var
|
|
113
|
-
const
|
|
112
|
+
var k;
|
|
113
|
+
const w = (k = M.current) == null ? void 0 : k.querySelector(
|
|
114
114
|
".gi-modal-container-control"
|
|
115
115
|
);
|
|
116
|
-
|
|
116
|
+
w && (w.contains(p.target) || d());
|
|
117
117
|
};
|
|
118
118
|
return document.addEventListener("pointerdown", m, !0), () => document.removeEventListener("pointerdown", m, !0);
|
|
119
119
|
}, [a, t, n, d]);
|
|
120
120
|
const q = /* @__PURE__ */ l(
|
|
121
121
|
"div",
|
|
122
122
|
{
|
|
123
|
-
...
|
|
123
|
+
...L,
|
|
124
124
|
ref: M,
|
|
125
125
|
className: u("gi-modal", {
|
|
126
126
|
"gi-modal-open": a,
|
|
@@ -153,7 +153,7 @@ const I = {
|
|
|
153
153
|
/* @__PURE__ */ l(
|
|
154
154
|
ae,
|
|
155
155
|
{
|
|
156
|
-
closeButtonLabel:
|
|
156
|
+
closeButtonLabel: v,
|
|
157
157
|
modalTitle: H,
|
|
158
158
|
closeOnClick: t,
|
|
159
159
|
onClose: d,
|
|
@@ -170,14 +170,14 @@ const I = {
|
|
|
170
170
|
}
|
|
171
171
|
);
|
|
172
172
|
return /* @__PURE__ */ l(ne, { modalRef: M, isOpen: a, children: q });
|
|
173
|
-
},
|
|
174
|
-
Object.defineProperty(
|
|
173
|
+
}, E = ({ children: e, as: o = "h4", ...t }) => /* @__PURE__ */ l("div", { className: "gi-flex-1", id: t.id, "aria-label": e == null ? void 0 : e.toString(), children: /* @__PURE__ */ l(J, { as: o, ...t, children: e }) });
|
|
174
|
+
Object.defineProperty(E, "componentType", {
|
|
175
175
|
value: "ModalTitle",
|
|
176
176
|
writable: !1,
|
|
177
177
|
enumerable: !1
|
|
178
178
|
});
|
|
179
|
-
|
|
180
|
-
const
|
|
179
|
+
E.displayName = "ModalTitle";
|
|
180
|
+
const ve = ({
|
|
181
181
|
children: e,
|
|
182
182
|
className: o,
|
|
183
183
|
includeModalClass: t = !0
|
|
@@ -199,10 +199,10 @@ const he = ({
|
|
|
199
199
|
}) => {
|
|
200
200
|
const s = (Array.isArray(o) ? o : [o]).filter((r) => {
|
|
201
201
|
var i, c;
|
|
202
|
-
return K(r) && (r.type ===
|
|
202
|
+
return K(r) && (r.type === A || ((i = r.type) == null ? void 0 : i.displayName) === "Button" || ((c = r.props) == null ? void 0 : c["data-button"]));
|
|
203
203
|
}).sort((r, i) => {
|
|
204
|
-
const c = r.props.variant ?? "primary",
|
|
205
|
-
return (
|
|
204
|
+
const c = r.props.variant ?? "primary", h = i.props.variant ?? "primary";
|
|
205
|
+
return (B[c] || 0) - (B[h] || 0);
|
|
206
206
|
}), f = u({
|
|
207
207
|
"gi-justify-center sm:gi-justify-start": !t && n !== "sm" && !a,
|
|
208
208
|
"gi-justify-center": t === "vertical" || n === "sm" || a,
|
|
@@ -225,7 +225,7 @@ const he = ({
|
|
|
225
225
|
(r, i) => {
|
|
226
226
|
var c;
|
|
227
227
|
return T(r, {
|
|
228
|
-
key: r.key || r.props.id || r.props.
|
|
228
|
+
key: r.key || r.props.id || r.props.dataTestId || `modal-footer-button-${i}`,
|
|
229
229
|
id: r.props.id || `modal-footer-button-${i}`,
|
|
230
230
|
className: u((c = r == null ? void 0 : r.props) == null ? void 0 : c.className, f)
|
|
231
231
|
});
|
|
@@ -247,22 +247,22 @@ const ne = ({
|
|
|
247
247
|
modalRef: o,
|
|
248
248
|
isOpen: t
|
|
249
249
|
}) => {
|
|
250
|
-
const [n, a] =
|
|
250
|
+
const [n, a] = j(!1);
|
|
251
251
|
return C(() => {
|
|
252
252
|
a(!0);
|
|
253
253
|
}, []), X(o, t && n), n ? G(e, document.body) : null;
|
|
254
|
-
},
|
|
254
|
+
}, he = ({
|
|
255
255
|
children: e,
|
|
256
256
|
triggerButton: o,
|
|
257
257
|
startsOpen: t,
|
|
258
258
|
...n
|
|
259
259
|
}) => {
|
|
260
|
-
const [a, d] =
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
onClick:
|
|
260
|
+
const [a, d] = j(!!t), v = () => d(!0), s = () => d(!1), f = T(o, {
|
|
261
|
+
dataTestId: "modal-trigger-button-container",
|
|
262
|
+
ariaHasPopup: "dialog",
|
|
263
|
+
onClick: v
|
|
264
264
|
});
|
|
265
|
-
return /* @__PURE__ */ y(
|
|
265
|
+
return /* @__PURE__ */ y(P, { children: [
|
|
266
266
|
f,
|
|
267
267
|
/* @__PURE__ */ l(
|
|
268
268
|
re,
|
|
@@ -277,9 +277,9 @@ const ne = ({
|
|
|
277
277
|
] });
|
|
278
278
|
};
|
|
279
279
|
export {
|
|
280
|
-
|
|
281
|
-
|
|
280
|
+
he as Modal,
|
|
281
|
+
ve as ModalBody,
|
|
282
282
|
x as ModalFooter,
|
|
283
|
-
|
|
283
|
+
E as ModalTitle,
|
|
284
284
|
re as ModalWrapper
|
|
285
285
|
};
|
package/dist/modal/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, ReactElement } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Props as ButtonProps } from '../atoms/Button';
|
|
3
3
|
import { IconButtonProps } from '../icon-button/icon-button.js';
|
|
4
4
|
import { ModalBody, ModalFooter, ModalTitle } from './modal.js';
|
|
5
5
|
export type ModalPositions = 'center' | 'left' | 'right' | 'bottom';
|
|
@@ -10,7 +10,7 @@ type ModalWrapperOwnProps = {
|
|
|
10
10
|
isOpen: boolean;
|
|
11
11
|
onClose: () => void;
|
|
12
12
|
position?: ModalPositions;
|
|
13
|
-
closeButtonSize?:
|
|
13
|
+
closeButtonSize?: ButtonProps['size'];
|
|
14
14
|
};
|
|
15
15
|
export type ModalWrapperProps = ModalWrapperOwnProps & Omit<ComponentPropsWithoutRef<'div'>, 'role'> & Omit<ModalProps, 'triggerButton'>;
|
|
16
16
|
export type ModalSize = 'sm' | 'md' | 'lg';
|
|
@@ -27,10 +27,11 @@ export type ModalProps = React.AriaAttributes & {
|
|
|
27
27
|
};
|
|
28
28
|
export type ModalCloseButtonProps = {
|
|
29
29
|
label?: string;
|
|
30
|
-
|
|
30
|
+
size?: ButtonProps['size'];
|
|
31
|
+
} & Omit<IconButtonProps, 'className' | 'icon' | 'variant' | 'appearance' | 'size'>;
|
|
31
32
|
export type ModalFooterButton = {
|
|
32
33
|
label: string;
|
|
33
|
-
variant:
|
|
34
|
+
variant: ButtonProps['variant'];
|
|
34
35
|
} & ButtonProps;
|
|
35
36
|
export type ModalFooterProps = {
|
|
36
37
|
className?: string;
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as B, jsx as
|
|
2
|
+
import { jsxs as B, jsx as I } from "react/jsx-runtime";
|
|
3
3
|
import J, { createElement as R, isValidElement as D, cloneElement as Q, Children as me, Fragment as de, useContext as he, useState as ge, useEffect as ye } from "react";
|
|
4
|
-
import "../atoms/Button.js";
|
|
4
|
+
import U from "../atoms/Button.js";
|
|
5
5
|
import "../atoms/heading/styles.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { Button as U } from "../button/button.js";
|
|
6
|
+
import ve from "../atoms/icons/ArrowLeft.js";
|
|
7
|
+
import be from "../atoms/icons/ArrowRight.js";
|
|
9
8
|
import { useBreakpoint as Ne, Breakpoint as ne } from "../hooks/use-breakpoint.js";
|
|
10
9
|
import { Icon as xe } from "../icon/icon.js";
|
|
11
10
|
import { getDisplayPages as re } from "../utils/utilities.js";
|
|
12
|
-
import { w as ie, i as _, a as X, b as
|
|
13
|
-
import { k as $e } from "../i18next-
|
|
11
|
+
import { w as ie, i as _, a as X, b as L, I as Ae, u as Ee } from "../useTranslation-CRbS3UeG.js";
|
|
12
|
+
import { k as $e } from "../i18next-zBkzxGW1.js";
|
|
14
13
|
import { g as Te } from "../_commonjsHelpers-DaMA6jEr.js";
|
|
15
|
-
import { g as oe, b as le, u as ke } from "../i18nInstance-
|
|
14
|
+
import { g as oe, b as le, u as ke } from "../i18nInstance-DiZ0lVPL.js";
|
|
16
15
|
var Y, se;
|
|
17
16
|
function Ce() {
|
|
18
17
|
return se || (se = 1, Y = {
|
|
@@ -34,20 +33,20 @@ function Ce() {
|
|
|
34
33
|
}
|
|
35
34
|
var Oe = Ce();
|
|
36
35
|
const Ve = /* @__PURE__ */ Te(Oe);
|
|
37
|
-
var
|
|
36
|
+
var Ie = /\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;
|
|
38
37
|
function ae(e) {
|
|
39
38
|
var t = { type: "tag", name: "", voidElement: !1, attrs: {}, children: [] }, n = e.match(/<\/?([^\s]+?)[/\s>]/);
|
|
40
39
|
if (n && (t.name = n[1], (Ve[n[1]] || e.charAt(e.length - 2) === "/") && (t.voidElement = !0), t.name.startsWith("!--"))) {
|
|
41
40
|
var r = e.indexOf("-->");
|
|
42
41
|
return { type: "comment", comment: r !== -1 ? e.slice(4, r) : "" };
|
|
43
42
|
}
|
|
44
|
-
for (var a = new RegExp(
|
|
43
|
+
for (var a = new RegExp(Ie), s = null; (s = a.exec(e)) !== null; ) if (s[0].trim()) if (s[1]) {
|
|
45
44
|
var o = s[1].trim(), c = [o, ""];
|
|
46
45
|
o.indexOf("=") > -1 && (c = o.split("=")), t.attrs[c[0]] = c[1], a.lastIndex--;
|
|
47
46
|
} else s[2] && (t.attrs[s[2]] = s[3].trim().substring(1, s[3].length - 1));
|
|
48
47
|
return t;
|
|
49
48
|
}
|
|
50
|
-
var
|
|
49
|
+
var je = /<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g, Le = /^\s*$/, Se = /* @__PURE__ */ Object.create(null);
|
|
51
50
|
function ce(e, t) {
|
|
52
51
|
switch (t.type) {
|
|
53
52
|
case "text":
|
|
@@ -63,13 +62,13 @@ function ce(e, t) {
|
|
|
63
62
|
}
|
|
64
63
|
}
|
|
65
64
|
var _e = { parse: function(e, t) {
|
|
66
|
-
t || (t = {}), t.components || (t.components =
|
|
65
|
+
t || (t = {}), t.components || (t.components = Se);
|
|
67
66
|
var n, r = [], a = [], s = -1, o = !1;
|
|
68
67
|
if (e.indexOf("<") !== 0) {
|
|
69
68
|
var c = e.indexOf("<");
|
|
70
69
|
r.push({ type: "text", content: c === -1 ? e : e.substring(0, c) });
|
|
71
70
|
}
|
|
72
|
-
return e.replace(
|
|
71
|
+
return e.replace(je, function(f, m) {
|
|
73
72
|
if (o) {
|
|
74
73
|
if (f !== "</" + n.name + ">") return;
|
|
75
74
|
o = !1;
|
|
@@ -82,7 +81,7 @@ var _e = { parse: function(e, t) {
|
|
|
82
81
|
if (N && (s++, (n = ae(f)).type === "tag" && t.components[n.name] && (n.type = "component", o = !0), n.voidElement || o || !l || l === "<" || n.children.push({ type: "text", content: e.slice(g, e.indexOf("<", g)) }), s === 0 && r.push(n), (p = a[s - 1]) && p.children.push(n), a[s] = n), (!N || n.voidElement) && (s > -1 && (n.voidElement || n.name === f.slice(2, -1)) && (s--, n = s === -1 ? r : a[s]), !o && l !== "<" && l)) {
|
|
83
82
|
p = s === -1 ? r : a[s].children;
|
|
84
83
|
var h = e.indexOf("<", g), x = e.slice(g, h === -1 ? void 0 : h);
|
|
85
|
-
|
|
84
|
+
Le.test(x) && (x = " "), (h > -1 && s + p.length >= 0 || x !== " ") && p.push({ type: "text", content: x });
|
|
86
85
|
}
|
|
87
86
|
}), r;
|
|
88
87
|
}, stringify: function(e) {
|
|
@@ -99,25 +98,28 @@ const G = (e, t) => {
|
|
|
99
98
|
var n, r;
|
|
100
99
|
if (!e) return [];
|
|
101
100
|
const t = ((n = e.props) == null ? void 0 : n.children) ?? e.children;
|
|
102
|
-
return (r = e.props) != null && r.i18nIsDynamicList ?
|
|
103
|
-
}, Fe = (e) => Array.isArray(e) && e.every(D),
|
|
101
|
+
return (r = e.props) != null && r.i18nIsDynamicList ? S(t) : t;
|
|
102
|
+
}, Fe = (e) => Array.isArray(e) && e.every(D), S = (e) => Array.isArray(e) ? e : [e], we = (e, t) => {
|
|
104
103
|
const n = {
|
|
105
104
|
...t
|
|
106
105
|
};
|
|
107
|
-
return n.props =
|
|
106
|
+
return n.props = {
|
|
107
|
+
...t.props,
|
|
108
|
+
...e.props
|
|
109
|
+
}, n;
|
|
108
110
|
}, Re = (e) => {
|
|
109
111
|
const t = {};
|
|
110
112
|
if (!e) return t;
|
|
111
113
|
const n = (r) => {
|
|
112
|
-
|
|
113
|
-
_(s) || (G(s) ? n(q(s)) :
|
|
114
|
+
S(r).forEach((s) => {
|
|
115
|
+
_(s) || (G(s) ? n(q(s)) : L(s) && !D(s) && Object.assign(t, s));
|
|
114
116
|
});
|
|
115
117
|
};
|
|
116
118
|
return n(e), t;
|
|
117
119
|
}, ue = (e, t, n, r) => {
|
|
118
120
|
if (!e) return "";
|
|
119
121
|
let a = "";
|
|
120
|
-
const s =
|
|
122
|
+
const s = S(e), o = t != null && t.transSupportBasicHtmlNodes ? t.transKeepBasicHtmlNodesFor ?? [] : [];
|
|
121
123
|
return s.forEach((c, f) => {
|
|
122
124
|
if (_(c)) {
|
|
123
125
|
a += `${c}`;
|
|
@@ -150,7 +152,7 @@ const G = (e, t) => {
|
|
|
150
152
|
});
|
|
151
153
|
return;
|
|
152
154
|
}
|
|
153
|
-
if (
|
|
155
|
+
if (L(c)) {
|
|
154
156
|
const {
|
|
155
157
|
format: m,
|
|
156
158
|
...p
|
|
@@ -199,8 +201,8 @@ const G = (e, t) => {
|
|
|
199
201
|
const c = a.transKeepBasicHtmlNodesFor || [], f = n && new RegExp(c.map((u) => `<${u}`).join("|")).test(n);
|
|
200
202
|
if (!e && !t && !f && !o) return [n];
|
|
201
203
|
const m = t ?? {}, p = (u) => {
|
|
202
|
-
|
|
203
|
-
_(y) || (G(y) ? p(q(y)) :
|
|
204
|
+
S(u).forEach((y) => {
|
|
205
|
+
_(y) || (G(y) ? p(q(y)) : L(y) && !D(y) && Object.assign(m, y));
|
|
204
206
|
});
|
|
205
207
|
};
|
|
206
208
|
p(e);
|
|
@@ -209,23 +211,23 @@ const G = (e, t) => {
|
|
|
209
211
|
...s
|
|
210
212
|
}, l = (u, A, y) => {
|
|
211
213
|
var d;
|
|
212
|
-
const E = q(u),
|
|
213
|
-
return Fe(E) &&
|
|
214
|
-
}, T = (u, A, y, E,
|
|
214
|
+
const E = q(u), j = h(E, A.children, y);
|
|
215
|
+
return Fe(E) && j.length === 0 || (d = u.props) != null && d.i18nIsDynamicList ? E : j;
|
|
216
|
+
}, T = (u, A, y, E, j) => {
|
|
215
217
|
u.dummy ? (u.children = A, y.push(Q(u, {
|
|
216
218
|
key: E
|
|
217
|
-
},
|
|
219
|
+
}, j ? void 0 : A))) : y.push(...me.map([u], (d) => {
|
|
218
220
|
const i = "data-i18n-is-dynamic-list", O = {
|
|
219
221
|
key: E,
|
|
220
222
|
[i]: void 0
|
|
221
223
|
};
|
|
222
224
|
return d && d.props && Object.keys(d.props).forEach((k) => {
|
|
223
225
|
k === "ref" || k === "children" || k === "i18nIsDynamicList" || k === i || (O[k] = d.props[k]);
|
|
224
|
-
}), Q(d, O,
|
|
226
|
+
}), Q(d, O, j ? null : A);
|
|
225
227
|
}));
|
|
226
228
|
}, h = (u, A, y) => {
|
|
227
|
-
const E =
|
|
228
|
-
return
|
|
229
|
+
const E = S(u);
|
|
230
|
+
return S(A).reduce((d, i, O) => {
|
|
229
231
|
var F, H;
|
|
230
232
|
const k = ((H = (F = i.children) == null ? void 0 : F[0]) == null ? void 0 : H.content) && r.services.interpolator.interpolate(i.children[0].content, g, r.language);
|
|
231
233
|
if (i.type === "tag") {
|
|
@@ -234,60 +236,60 @@ const G = (e, t) => {
|
|
|
234
236
|
const V = {
|
|
235
237
|
...i.attrs
|
|
236
238
|
};
|
|
237
|
-
o && Object.keys(V).forEach((
|
|
238
|
-
const z = V[
|
|
239
|
-
_(z) && (V[
|
|
239
|
+
o && Object.keys(V).forEach((b) => {
|
|
240
|
+
const z = V[b];
|
|
241
|
+
_(z) && (V[b] = ke(z));
|
|
240
242
|
});
|
|
241
|
-
const
|
|
243
|
+
const v = Object.keys(V).length !== 0 ? we({
|
|
242
244
|
props: V
|
|
243
|
-
}, C) : C, w = D(
|
|
244
|
-
if (_(
|
|
245
|
-
const
|
|
246
|
-
d.push(
|
|
247
|
-
} else if (G(
|
|
248
|
-
const
|
|
249
|
-
T(
|
|
245
|
+
}, C) : C, w = D(v), M = w && G(i, !0) && !i.voidElement, W = f && L(v) && v.dummy && !w, Z = L(t) && Object.hasOwnProperty.call(t, i.name);
|
|
246
|
+
if (_(v)) {
|
|
247
|
+
const b = r.services.interpolator.interpolate(v, g, r.language);
|
|
248
|
+
d.push(b);
|
|
249
|
+
} else if (G(v) || M) {
|
|
250
|
+
const b = l(v, i, y);
|
|
251
|
+
T(v, b, d, O);
|
|
250
252
|
} else if (W) {
|
|
251
|
-
const
|
|
252
|
-
T(
|
|
253
|
+
const b = h(E, i.children, y);
|
|
254
|
+
T(v, b, d, O);
|
|
253
255
|
} else if (Number.isNaN(parseFloat(i.name)))
|
|
254
256
|
if (Z) {
|
|
255
|
-
const
|
|
256
|
-
T(
|
|
257
|
+
const b = l(v, i, y);
|
|
258
|
+
T(v, b, d, O, i.voidElement);
|
|
257
259
|
} else if (a.transSupportBasicHtmlNodes && c.indexOf(i.name) > -1)
|
|
258
260
|
if (i.voidElement)
|
|
259
261
|
d.push(R(i.name, {
|
|
260
262
|
key: `${i.name}-${O}`
|
|
261
263
|
}));
|
|
262
264
|
else {
|
|
263
|
-
const
|
|
265
|
+
const b = h(E, i.children, y);
|
|
264
266
|
d.push(R(i.name, {
|
|
265
267
|
key: `${i.name}-${O}`
|
|
266
|
-
},
|
|
268
|
+
}, b));
|
|
267
269
|
}
|
|
268
270
|
else if (i.voidElement)
|
|
269
271
|
d.push(`<${i.name} />`);
|
|
270
272
|
else {
|
|
271
|
-
const
|
|
272
|
-
d.push(`<${i.name}>${
|
|
273
|
+
const b = h(E, i.children, y);
|
|
274
|
+
d.push(`<${i.name}>${b}</${i.name}>`);
|
|
273
275
|
}
|
|
274
|
-
else if (
|
|
275
|
-
const
|
|
276
|
-
|
|
276
|
+
else if (L(v) && !w) {
|
|
277
|
+
const b = i.children[0] ? k : null;
|
|
278
|
+
b && d.push(b);
|
|
277
279
|
} else
|
|
278
|
-
T(
|
|
280
|
+
T(v, k, d, O, i.children.length !== 1 || !k);
|
|
279
281
|
} else if (i.type === "text") {
|
|
280
|
-
const C = a.transWrapTextNodes, V = typeof a.unescape == "function" ? a.unescape :
|
|
282
|
+
const C = a.transWrapTextNodes, V = typeof a.unescape == "function" ? a.unescape : oe().unescape, v = o ? V(r.services.interpolator.interpolate(i.content, g, r.language)) : r.services.interpolator.interpolate(i.content, g, r.language);
|
|
281
283
|
C ? d.push(R(C, {
|
|
282
284
|
key: `${i.name}-${O}`
|
|
283
|
-
},
|
|
285
|
+
}, v)) : d.push(v);
|
|
284
286
|
}
|
|
285
287
|
return d;
|
|
286
288
|
}, []);
|
|
287
289
|
}, x = h([{
|
|
288
290
|
dummy: !0,
|
|
289
291
|
children: e || []
|
|
290
|
-
}], $,
|
|
292
|
+
}], $, S(e || []));
|
|
291
293
|
return q(x[0]);
|
|
292
294
|
}, pe = (e, t, n) => {
|
|
293
295
|
const r = e.key || t, a = Q(e, {
|
|
@@ -308,9 +310,9 @@ const G = (e, t) => {
|
|
|
308
310
|
[r]: pe(e[r], r, t)
|
|
309
311
|
});
|
|
310
312
|
}), n;
|
|
311
|
-
}, Me = (e, t, n, r) => e ? Array.isArray(e) ? De(e, t) :
|
|
313
|
+
}, Me = (e, t, n, r) => e ? Array.isArray(e) ? De(e, t) : L(e) ? He(e, t) : (ie(n, "TRANS_INVALID_COMPONENTS", '<Trans /> "components" prop expects an object or array', {
|
|
312
314
|
i18nKey: r
|
|
313
|
-
}), null) : null, We = (e) => !
|
|
315
|
+
}), null) : null, We = (e) => !L(e) || Array.isArray(e) ? !1 : Object.keys(e).reduce((t, n) => t && Number.isNaN(Number.parseFloat(n)), !0);
|
|
314
316
|
function Ze({
|
|
315
317
|
children: e,
|
|
316
318
|
count: t,
|
|
@@ -327,15 +329,15 @@ function Ze({
|
|
|
327
329
|
shouldUnescape: $,
|
|
328
330
|
...g
|
|
329
331
|
}) {
|
|
330
|
-
var
|
|
331
|
-
const l = p ||
|
|
332
|
+
var b, z, K, P, ee, te;
|
|
333
|
+
const l = p || le();
|
|
332
334
|
if (!l)
|
|
333
335
|
return ie(l, "NO_I18NEXT_INSTANCE", "Trans: You need to pass in an i18next instance using i18nextReactModule", {
|
|
334
336
|
i18nKey: r
|
|
335
337
|
}), e;
|
|
336
338
|
const T = N || l.t.bind(l) || ((fe) => fe), h = {
|
|
337
|
-
...
|
|
338
|
-
...(
|
|
339
|
+
...oe(),
|
|
340
|
+
...(b = l.options) == null ? void 0 : b.react
|
|
339
341
|
};
|
|
340
342
|
let x = m || T.ns || ((z = l.options) == null ? void 0 : z.defaultNS);
|
|
341
343
|
x = _(x) ? [x] : x || ["translation"];
|
|
@@ -347,7 +349,7 @@ function Ze({
|
|
|
347
349
|
} : s, y = $ ?? (u == null ? void 0 : u.shouldUnescape), E = u != null && u.values ? {
|
|
348
350
|
...u.values,
|
|
349
351
|
...o
|
|
350
|
-
} : o,
|
|
352
|
+
} : o, j = u != null && u.components ? {
|
|
351
353
|
...u.components,
|
|
352
354
|
...f
|
|
353
355
|
} : f, d = ue(e, h, l, r), i = c || (A == null ? void 0 : A.defaultValue) || d || h.transEmptyNodeValue || (typeof r == "function" ? $e(r) : r), {
|
|
@@ -378,9 +380,9 @@ function Ze({
|
|
|
378
380
|
};
|
|
379
381
|
let V = k ? T(k, C) : i;
|
|
380
382
|
V === k && i && (V = i);
|
|
381
|
-
const
|
|
382
|
-
let w =
|
|
383
|
-
We(
|
|
383
|
+
const v = Me(j, V, l, r);
|
|
384
|
+
let w = v || e, M = null;
|
|
385
|
+
We(v) && (M = v, w = e);
|
|
384
386
|
const W = Be(w, M, V, l, h, C, y), Z = n ?? h.defaultTransParent;
|
|
385
387
|
return Z ? R(Z, g, W) : W;
|
|
386
388
|
}
|
|
@@ -404,7 +406,7 @@ function Ge({
|
|
|
404
406
|
const {
|
|
405
407
|
i18n: l,
|
|
406
408
|
defaultNS: T
|
|
407
|
-
} = he(Ae) || {}, h = p || l ||
|
|
409
|
+
} = he(Ae) || {}, h = p || l || le(), x = N || (h == null ? void 0 : h.t.bind(h));
|
|
408
410
|
return Ze({
|
|
409
411
|
children: e,
|
|
410
412
|
count: t,
|
|
@@ -422,7 +424,7 @@ function Ge({
|
|
|
422
424
|
...g
|
|
423
425
|
});
|
|
424
426
|
}
|
|
425
|
-
const
|
|
427
|
+
const at = ({
|
|
426
428
|
currentPage: e,
|
|
427
429
|
totalPages: t,
|
|
428
430
|
onPageChange: n,
|
|
@@ -436,21 +438,21 @@ const it = ({
|
|
|
436
438
|
f(!0);
|
|
437
439
|
}, []);
|
|
438
440
|
const m = c && s === ne.ExtraSmall, p = c && o !== null && o < 639, N = () => (c && s ? re(e, t, s) : re(e, t, ne.Large)).map(
|
|
439
|
-
(l, T) => l === -1 || l === -2 ? /* @__PURE__ */
|
|
441
|
+
(l, T) => l === -1 || l === -2 ? /* @__PURE__ */ I(J.Fragment, { children: /* @__PURE__ */ I(
|
|
440
442
|
xe,
|
|
441
443
|
{
|
|
442
444
|
role: "presentation",
|
|
443
445
|
className: "gi-text-gray-700",
|
|
444
446
|
icon: "more_horiz"
|
|
445
447
|
}
|
|
446
|
-
) }, `ellipsis-${T}`) : /* @__PURE__ */
|
|
448
|
+
) }, `ellipsis-${T}`) : /* @__PURE__ */ I(
|
|
447
449
|
U,
|
|
448
450
|
{
|
|
449
451
|
variant: l === e ? "primary" : "flat",
|
|
450
452
|
size: "large",
|
|
451
453
|
appearance: "dark",
|
|
452
454
|
onClick: () => n(l),
|
|
453
|
-
|
|
455
|
+
ariaLabel: a("pagination.goToPage", {
|
|
454
456
|
page: l,
|
|
455
457
|
defaultValue: `Go to page ${l}`
|
|
456
458
|
}),
|
|
@@ -458,12 +460,12 @@ const it = ({
|
|
|
458
460
|
},
|
|
459
461
|
l
|
|
460
462
|
)
|
|
461
|
-
), $ = () => /* @__PURE__ */
|
|
463
|
+
), $ = () => /* @__PURE__ */ I("span", { className: "gi-text-md gi-leading-6", "aria-live": "polite", children: /* @__PURE__ */ B(
|
|
462
464
|
Ge,
|
|
463
465
|
{
|
|
464
466
|
i18nKey: "pagination.page",
|
|
465
467
|
values: { currentPage: e, totalPages: t },
|
|
466
|
-
components: { bold: /* @__PURE__ */
|
|
468
|
+
components: { bold: /* @__PURE__ */ I("span", { className: "gi-font-bold" }) },
|
|
467
469
|
children: [
|
|
468
470
|
/* @__PURE__ */ B("span", { className: "gi-font-bold", children: [
|
|
469
471
|
"Page ",
|
|
@@ -494,13 +496,13 @@ const it = ({
|
|
|
494
496
|
appearance: "dark",
|
|
495
497
|
disabled: e === 1,
|
|
496
498
|
onClick: () => n(e - 1),
|
|
497
|
-
|
|
499
|
+
ariaLabel: a("pagination.goToPrevious", {
|
|
498
500
|
defaultValue: "Go to previous"
|
|
499
501
|
}),
|
|
500
502
|
className: p ? "gi-icon-btn-large" : "",
|
|
501
|
-
|
|
503
|
+
dataTestId: "govie-pagination-prev-btn",
|
|
502
504
|
children: [
|
|
503
|
-
/* @__PURE__ */
|
|
505
|
+
/* @__PURE__ */ I(J.Fragment, { children: /* @__PURE__ */ I(ve, { className: "gi-block gi-shrink-0" }) }, "previous-btn-pagination"),
|
|
504
506
|
!p && a("pagination.previous", { defaultValue: "Previous" })
|
|
505
507
|
]
|
|
506
508
|
}
|
|
@@ -514,12 +516,12 @@ const it = ({
|
|
|
514
516
|
size: "large",
|
|
515
517
|
appearance: "dark",
|
|
516
518
|
onClick: () => n(e + 1),
|
|
517
|
-
|
|
519
|
+
ariaLabel: a("pagination.goToNext", { defaultValue: "Go to next" }),
|
|
518
520
|
className: p ? "gi-icon-btn-large" : "",
|
|
519
|
-
|
|
521
|
+
dataTestId: "govie-pagination-next-btn",
|
|
520
522
|
children: [
|
|
521
523
|
!p && a("pagination.next", { defaultValue: "Next" }),
|
|
522
|
-
/* @__PURE__ */
|
|
524
|
+
/* @__PURE__ */ I(J.Fragment, { children: /* @__PURE__ */ I(be, { className: "gi-block gi-shrink-0" }) }, "next-btn-pagination")
|
|
523
525
|
]
|
|
524
526
|
}
|
|
525
527
|
)
|
|
@@ -528,5 +530,5 @@ const it = ({
|
|
|
528
530
|
);
|
|
529
531
|
};
|
|
530
532
|
export {
|
|
531
|
-
|
|
533
|
+
at as Pagination
|
|
532
534
|
};
|
|
@@ -2,7 +2,7 @@ import { jsxs as u, jsx as r } from "react/jsx-runtime";
|
|
|
2
2
|
import { Children as V } from "react";
|
|
3
3
|
import { cn as L } from "../cn.js";
|
|
4
4
|
import { Icon as j } from "../icon/icon.js";
|
|
5
|
-
import {
|
|
5
|
+
import { StepStatus as y, ProgressStepperIndicator as b } from "./types.js";
|
|
6
6
|
const B = (t) => `calc(100% + ${t * 4 - 36}px)`, D = ({
|
|
7
7
|
isNextStep: t,
|
|
8
8
|
orientation: a = "horizontal",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Props as ButtonProps } from '../atoms/Button';
|
|
2
2
|
type ScoreSelectType = '1-5' | '1-7' | '0-10';
|
|
3
3
|
export type ScoreSelectProps = {
|
|
4
4
|
name: string;
|
|
5
5
|
value?: string;
|
|
6
|
-
size?:
|
|
6
|
+
size?: ButtonProps['size'];
|
|
7
7
|
label: string;
|
|
8
8
|
hint?: string;
|
|
9
9
|
leftLabel?: string;
|