@ogcio/design-system-react 1.32.0 → 1.33.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 +2 -1
- 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/combo-box/dropdown-item.js +1 -1
- package/dist/cookie-banner/cookie-banner.d.ts +1 -1
- package/dist/data-table/data-table-header.js +1 -1
- package/dist/drawer/drawer.d.ts +1 -1
- package/dist/drawer/drawer.js +17 -17
- 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/hint-text/hint-text.js +26 -20
- package/dist/icon-button/icon-button.d.ts +3 -5
- package/dist/index.d.ts +1 -1
- package/dist/label/label.d.ts +78 -30
- package/dist/label/label.js +29 -14
- package/dist/modal/modal.content.js +1 -1
- package/dist/modal/modal.js +38 -38
- package/dist/modal/types.d.ts +5 -4
- package/dist/pagination/pagination.js +27 -28
- package/dist/score-select/type.d.ts +2 -2
- package/dist/select/select-next.js +87 -87
- package/dist/side-nav/side-nav.js +1 -1
- package/dist/styles.css +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/tooltip/tooltip.js +27 -35
- package/dist/tooltip/variants.d.ts +115 -0
- package/dist/tooltip/variants.js +59 -0
- package/package.json +2 -2
package/dist/label/label.d.ts
CHANGED
|
@@ -3,52 +3,100 @@ export declare const LabelSize: {
|
|
|
3
3
|
readonly Medium: "md";
|
|
4
4
|
readonly Large: "lg";
|
|
5
5
|
};
|
|
6
|
+
export declare const Label: import('react').ForwardRefExoticComponent<import('react').LabelHTMLAttributes<HTMLLabelElement> & {
|
|
7
|
+
text?: string | React.ReactElement;
|
|
8
|
+
size?: import('./types.js').LabelSizeType;
|
|
9
|
+
} & {
|
|
10
|
+
children?: import('react').ReactNode | undefined;
|
|
11
|
+
} & import('react').RefAttributes<HTMLLabelElement>>;
|
|
6
12
|
export declare const styles: import('tailwind-variants').TVReturnType<{
|
|
7
13
|
size: {
|
|
8
|
-
sm:
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
sm: {
|
|
15
|
+
base: string;
|
|
16
|
+
};
|
|
17
|
+
md: {
|
|
18
|
+
base: string;
|
|
19
|
+
};
|
|
20
|
+
lg: {
|
|
21
|
+
base: string;
|
|
22
|
+
};
|
|
11
23
|
};
|
|
12
|
-
},
|
|
24
|
+
}, {
|
|
25
|
+
base: string;
|
|
26
|
+
}, undefined, import('tailwind-variants/dist/config.js').TVConfig<{
|
|
13
27
|
size: {
|
|
14
|
-
sm:
|
|
15
|
-
|
|
16
|
-
|
|
28
|
+
sm: {
|
|
29
|
+
base: string;
|
|
30
|
+
};
|
|
31
|
+
md: {
|
|
32
|
+
base: string;
|
|
33
|
+
};
|
|
34
|
+
lg: {
|
|
35
|
+
base: string;
|
|
36
|
+
};
|
|
17
37
|
};
|
|
18
38
|
}, {
|
|
19
39
|
size: {
|
|
20
|
-
sm:
|
|
21
|
-
|
|
22
|
-
|
|
40
|
+
sm: {
|
|
41
|
+
base: string;
|
|
42
|
+
};
|
|
43
|
+
md: {
|
|
44
|
+
base: string;
|
|
45
|
+
};
|
|
46
|
+
lg: {
|
|
47
|
+
base: string;
|
|
48
|
+
};
|
|
23
49
|
};
|
|
24
50
|
}>, {
|
|
25
51
|
size: {
|
|
26
|
-
sm:
|
|
27
|
-
|
|
28
|
-
|
|
52
|
+
sm: {
|
|
53
|
+
base: string;
|
|
54
|
+
};
|
|
55
|
+
md: {
|
|
56
|
+
base: string;
|
|
57
|
+
};
|
|
58
|
+
lg: {
|
|
59
|
+
base: string;
|
|
60
|
+
};
|
|
29
61
|
};
|
|
30
|
-
},
|
|
62
|
+
}, {
|
|
63
|
+
base: string;
|
|
64
|
+
}, import('tailwind-variants').TVReturnType<{
|
|
31
65
|
size: {
|
|
32
|
-
sm:
|
|
33
|
-
|
|
34
|
-
|
|
66
|
+
sm: {
|
|
67
|
+
base: string;
|
|
68
|
+
};
|
|
69
|
+
md: {
|
|
70
|
+
base: string;
|
|
71
|
+
};
|
|
72
|
+
lg: {
|
|
73
|
+
base: string;
|
|
74
|
+
};
|
|
35
75
|
};
|
|
36
|
-
},
|
|
76
|
+
}, {
|
|
77
|
+
base: string;
|
|
78
|
+
}, undefined, import('tailwind-variants/dist/config.js').TVConfig<{
|
|
37
79
|
size: {
|
|
38
|
-
sm:
|
|
39
|
-
|
|
40
|
-
|
|
80
|
+
sm: {
|
|
81
|
+
base: string;
|
|
82
|
+
};
|
|
83
|
+
md: {
|
|
84
|
+
base: string;
|
|
85
|
+
};
|
|
86
|
+
lg: {
|
|
87
|
+
base: string;
|
|
88
|
+
};
|
|
41
89
|
};
|
|
42
90
|
}, {
|
|
43
91
|
size: {
|
|
44
|
-
sm:
|
|
45
|
-
|
|
46
|
-
|
|
92
|
+
sm: {
|
|
93
|
+
base: string;
|
|
94
|
+
};
|
|
95
|
+
md: {
|
|
96
|
+
base: string;
|
|
97
|
+
};
|
|
98
|
+
lg: {
|
|
99
|
+
base: string;
|
|
100
|
+
};
|
|
47
101
|
};
|
|
48
102
|
}>, unknown, unknown, undefined>>;
|
|
49
|
-
export declare const Label: import('react').ForwardRefExoticComponent<import('react').LabelHTMLAttributes<HTMLLabelElement> & {
|
|
50
|
-
text?: string | React.ReactElement;
|
|
51
|
-
size?: import('./types.js').LabelSizeType;
|
|
52
|
-
} & {
|
|
53
|
-
children?: import('react').ReactNode | undefined;
|
|
54
|
-
} & import('react').RefAttributes<HTMLLabelElement>>;
|
package/dist/label/label.js
CHANGED
|
@@ -1,28 +1,43 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
4
|
-
const
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as o } from "react";
|
|
3
|
+
import { c as d } from "../index-CB-zPpNk.js";
|
|
4
|
+
const b = {
|
|
5
5
|
Small: "sm",
|
|
6
6
|
Medium: "md",
|
|
7
7
|
Large: "lg"
|
|
8
|
-
},
|
|
9
|
-
|
|
8
|
+
}, c = o(
|
|
9
|
+
({ text: e, size: t = b.Medium, className: s, children: a, ...l }, m) => {
|
|
10
|
+
const { base: i } = g({ size: t });
|
|
11
|
+
return /* @__PURE__ */ r(
|
|
12
|
+
"label",
|
|
13
|
+
{
|
|
14
|
+
className: i({ className: s }),
|
|
15
|
+
"data-testid": "label",
|
|
16
|
+
ref: m,
|
|
17
|
+
...l,
|
|
18
|
+
children: a ?? e
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
c.displayName = "Label";
|
|
24
|
+
const g = d({
|
|
25
|
+
slots: {
|
|
26
|
+
base: "gi-block gi-text-color-text-system-neutral-default"
|
|
27
|
+
},
|
|
10
28
|
variants: {
|
|
11
29
|
size: {
|
|
12
|
-
sm: "gi-text-sm",
|
|
13
|
-
md: "gi-text-md",
|
|
14
|
-
lg: "gi-text-lg"
|
|
30
|
+
sm: { base: "gi-text-sm" },
|
|
31
|
+
md: { base: "gi-text-md" },
|
|
32
|
+
lg: { base: "gi-text-lg" }
|
|
15
33
|
}
|
|
16
34
|
},
|
|
17
35
|
defaultVariants: {
|
|
18
36
|
size: "md"
|
|
19
37
|
}
|
|
20
|
-
})
|
|
21
|
-
({ text: e, size: a = d.Medium, className: m, children: s, ...t }, l) => /* @__PURE__ */ i("label", { className: g({ size: a, className: m }), ref: l, ...t, children: s ?? e })
|
|
22
|
-
);
|
|
23
|
-
c.displayName = "Label";
|
|
38
|
+
});
|
|
24
39
|
export {
|
|
25
40
|
c as Label,
|
|
26
|
-
|
|
41
|
+
b as LabelSize,
|
|
27
42
|
g as styles
|
|
28
43
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as i, jsx as t, Fragment as r } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
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,15 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as B, jsx as j } 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
6
|
import be from "../atoms/icons/ArrowLeft.js";
|
|
7
7
|
import ve from "../atoms/icons/ArrowRight.js";
|
|
8
|
-
import { Button as U } from "../button/button.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
|
|
11
|
+
import { w as ie, i as _, a as X, b as L, I as Ae, u as Ee } from "../useTranslation-DiBQuy8S.js";
|
|
13
12
|
import { k as $e } from "../i18next-Bfi2-LyH.js";
|
|
14
13
|
import { g as Te } from "../_commonjsHelpers-DaMA6jEr.js";
|
|
15
14
|
import { g as oe, b as le, u as ke } from "../i18nInstance-AYICsHJu.js";
|
|
@@ -47,7 +46,7 @@ function ae(e) {
|
|
|
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 Ie = /<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,
|
|
49
|
+
var Ie = /<[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,7 +62,7 @@ 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("<");
|
|
@@ -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,8 +98,8 @@ 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
|
};
|
|
@@ -109,15 +108,15 @@ const G = (e, t) => {
|
|
|
109
108
|
const t = {};
|
|
110
109
|
if (!e) return t;
|
|
111
110
|
const n = (r) => {
|
|
112
|
-
|
|
113
|
-
_(s) || (G(s) ? n(q(s)) :
|
|
111
|
+
S(r).forEach((s) => {
|
|
112
|
+
_(s) || (G(s) ? n(q(s)) : L(s) && !D(s) && Object.assign(t, s));
|
|
114
113
|
});
|
|
115
114
|
};
|
|
116
115
|
return n(e), t;
|
|
117
116
|
}, ue = (e, t, n, r) => {
|
|
118
117
|
if (!e) return "";
|
|
119
118
|
let a = "";
|
|
120
|
-
const s =
|
|
119
|
+
const s = S(e), o = t != null && t.transSupportBasicHtmlNodes ? t.transKeepBasicHtmlNodesFor ?? [] : [];
|
|
121
120
|
return s.forEach((c, f) => {
|
|
122
121
|
if (_(c)) {
|
|
123
122
|
a += `${c}`;
|
|
@@ -150,7 +149,7 @@ const G = (e, t) => {
|
|
|
150
149
|
});
|
|
151
150
|
return;
|
|
152
151
|
}
|
|
153
|
-
if (
|
|
152
|
+
if (L(c)) {
|
|
154
153
|
const {
|
|
155
154
|
format: m,
|
|
156
155
|
...p
|
|
@@ -199,8 +198,8 @@ const G = (e, t) => {
|
|
|
199
198
|
const c = a.transKeepBasicHtmlNodesFor || [], f = n && new RegExp(c.map((u) => `<${u}`).join("|")).test(n);
|
|
200
199
|
if (!e && !t && !f && !o) return [n];
|
|
201
200
|
const m = t ?? {}, p = (u) => {
|
|
202
|
-
|
|
203
|
-
_(y) || (G(y) ? p(q(y)) :
|
|
201
|
+
S(u).forEach((y) => {
|
|
202
|
+
_(y) || (G(y) ? p(q(y)) : L(y) && !D(y) && Object.assign(m, y));
|
|
204
203
|
});
|
|
205
204
|
};
|
|
206
205
|
p(e);
|
|
@@ -224,8 +223,8 @@ const G = (e, t) => {
|
|
|
224
223
|
}), Q(d, O, I ? null : A);
|
|
225
224
|
}));
|
|
226
225
|
}, h = (u, A, y) => {
|
|
227
|
-
const E =
|
|
228
|
-
return
|
|
226
|
+
const E = S(u);
|
|
227
|
+
return S(A).reduce((d, i, O) => {
|
|
229
228
|
var F, H;
|
|
230
229
|
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
230
|
if (i.type === "tag") {
|
|
@@ -240,7 +239,7 @@ const G = (e, t) => {
|
|
|
240
239
|
});
|
|
241
240
|
const b = Object.keys(V).length !== 0 ? we({
|
|
242
241
|
props: V
|
|
243
|
-
}, C) : C, w = D(b), M = w && G(i, !0) && !i.voidElement, W = f &&
|
|
242
|
+
}, C) : C, w = D(b), M = w && G(i, !0) && !i.voidElement, W = f && L(b) && b.dummy && !w, Z = L(t) && Object.hasOwnProperty.call(t, i.name);
|
|
244
243
|
if (_(b)) {
|
|
245
244
|
const v = r.services.interpolator.interpolate(b, g, r.language);
|
|
246
245
|
d.push(v);
|
|
@@ -271,7 +270,7 @@ const G = (e, t) => {
|
|
|
271
270
|
const v = h(E, i.children, y);
|
|
272
271
|
d.push(`<${i.name}>${v}</${i.name}>`);
|
|
273
272
|
}
|
|
274
|
-
else if (
|
|
273
|
+
else if (L(b) && !w) {
|
|
275
274
|
const v = i.children[0] ? k : null;
|
|
276
275
|
v && d.push(v);
|
|
277
276
|
} else
|
|
@@ -287,7 +286,7 @@ const G = (e, t) => {
|
|
|
287
286
|
}, x = h([{
|
|
288
287
|
dummy: !0,
|
|
289
288
|
children: e || []
|
|
290
|
-
}], $,
|
|
289
|
+
}], $, S(e || []));
|
|
291
290
|
return q(x[0]);
|
|
292
291
|
}, pe = (e, t, n) => {
|
|
293
292
|
const r = e.key || t, a = Q(e, {
|
|
@@ -308,9 +307,9 @@ const G = (e, t) => {
|
|
|
308
307
|
[r]: pe(e[r], r, t)
|
|
309
308
|
});
|
|
310
309
|
}), n;
|
|
311
|
-
}, Me = (e, t, n, r) => e ? Array.isArray(e) ? De(e, t) :
|
|
310
|
+
}, 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
311
|
i18nKey: r
|
|
313
|
-
}), null) : null, We = (e) => !
|
|
312
|
+
}), null) : null, We = (e) => !L(e) || Array.isArray(e) ? !1 : Object.keys(e).reduce((t, n) => t && Number.isNaN(Number.parseFloat(n)), !0);
|
|
314
313
|
function Ze({
|
|
315
314
|
children: e,
|
|
316
315
|
count: t,
|
|
@@ -422,7 +421,7 @@ function Ge({
|
|
|
422
421
|
...g
|
|
423
422
|
});
|
|
424
423
|
}
|
|
425
|
-
const
|
|
424
|
+
const at = ({
|
|
426
425
|
currentPage: e,
|
|
427
426
|
totalPages: t,
|
|
428
427
|
onPageChange: n,
|
|
@@ -450,7 +449,7 @@ const it = ({
|
|
|
450
449
|
size: "large",
|
|
451
450
|
appearance: "dark",
|
|
452
451
|
onClick: () => n(l),
|
|
453
|
-
|
|
452
|
+
ariaLabel: a("pagination.goToPage", {
|
|
454
453
|
page: l,
|
|
455
454
|
defaultValue: `Go to page ${l}`
|
|
456
455
|
}),
|
|
@@ -494,11 +493,11 @@ const it = ({
|
|
|
494
493
|
appearance: "dark",
|
|
495
494
|
disabled: e === 1,
|
|
496
495
|
onClick: () => n(e - 1),
|
|
497
|
-
|
|
496
|
+
ariaLabel: a("pagination.goToPrevious", {
|
|
498
497
|
defaultValue: "Go to previous"
|
|
499
498
|
}),
|
|
500
499
|
className: p ? "gi-icon-btn-large" : "",
|
|
501
|
-
|
|
500
|
+
dataTestId: "govie-pagination-prev-btn",
|
|
502
501
|
children: [
|
|
503
502
|
/* @__PURE__ */ j(J.Fragment, { children: /* @__PURE__ */ j(be, { className: "gi-block gi-shrink-0" }) }, "previous-btn-pagination"),
|
|
504
503
|
!p && a("pagination.previous", { defaultValue: "Previous" })
|
|
@@ -514,9 +513,9 @@ const it = ({
|
|
|
514
513
|
size: "large",
|
|
515
514
|
appearance: "dark",
|
|
516
515
|
onClick: () => n(e + 1),
|
|
517
|
-
|
|
516
|
+
ariaLabel: a("pagination.goToNext", { defaultValue: "Go to next" }),
|
|
518
517
|
className: p ? "gi-icon-btn-large" : "",
|
|
519
|
-
|
|
518
|
+
dataTestId: "govie-pagination-next-btn",
|
|
520
519
|
children: [
|
|
521
520
|
!p && a("pagination.next", { defaultValue: "Next" }),
|
|
522
521
|
/* @__PURE__ */ j(J.Fragment, { children: /* @__PURE__ */ j(ve, { className: "gi-block gi-shrink-0" }) }, "next-btn-pagination")
|
|
@@ -528,5 +527,5 @@ const it = ({
|
|
|
528
527
|
);
|
|
529
528
|
};
|
|
530
529
|
export {
|
|
531
|
-
|
|
530
|
+
at as Pagination
|
|
532
531
|
};
|
|
@@ -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;
|