@ogcio/design-system-react 1.15.3 → 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 +1 -0
- 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/select/select-next.js +42 -40
- 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/package.json +4 -3
package/dist/drawer/drawer.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as s, jsxs as x, Fragment as y } from "react/jsx-runtime";
|
|
3
3
|
import { useState as D, cloneElement as O } from "react";
|
|
4
4
|
import { cn as a } from "../cn.js";
|
|
5
5
|
import { ModalBody as F, ModalFooter as M, ModalWrapper as N } from "../modal/modal.js";
|
|
6
6
|
const b = ({
|
|
7
7
|
children: o,
|
|
8
8
|
className: e,
|
|
9
|
-
...
|
|
10
|
-
}) => /* @__PURE__ */
|
|
9
|
+
...r
|
|
10
|
+
}) => /* @__PURE__ */ s(N, { className: a("gi-drawer-container", e), ...r, children: o }), I = ({
|
|
11
11
|
children: o,
|
|
12
12
|
triggerButton: e,
|
|
13
|
-
startsOpen:
|
|
13
|
+
startsOpen: r,
|
|
14
14
|
closeButtonLabel: p,
|
|
15
15
|
position: i = "right",
|
|
16
16
|
className: m,
|
|
17
17
|
closeButtonSize: f
|
|
18
18
|
}) => {
|
|
19
|
-
const [t, n] = D(!!
|
|
19
|
+
const [t, n] = D(!!r), w = () => n(!0), C = () => n(!1), h = O(e, {
|
|
20
20
|
"data-testid": "drawer-trigger-button-container",
|
|
21
21
|
onClick: (k) => {
|
|
22
22
|
var l, d;
|
|
@@ -26,7 +26,7 @@ const b = ({
|
|
|
26
26
|
});
|
|
27
27
|
return /* @__PURE__ */ x(y, { children: [
|
|
28
28
|
h,
|
|
29
|
-
/* @__PURE__ */
|
|
29
|
+
/* @__PURE__ */ s(
|
|
30
30
|
b,
|
|
31
31
|
{
|
|
32
32
|
children: o,
|
|
@@ -39,7 +39,11 @@ const b = ({
|
|
|
39
39
|
}
|
|
40
40
|
)
|
|
41
41
|
] });
|
|
42
|
-
}, S = ({ children: o, className: e }) => /* @__PURE__ */
|
|
42
|
+
}, S = ({ children: o, className: e }) => /* @__PURE__ */ s(F, { className: a("gi-drawer-body", e), children: o }), T = ({
|
|
43
|
+
children: o,
|
|
44
|
+
className: e,
|
|
45
|
+
stacked: r
|
|
46
|
+
}) => /* @__PURE__ */ s(M, { stacked: r, className: a("gi-drawer-footer", e), children: o });
|
|
43
47
|
export {
|
|
44
48
|
I as Drawer,
|
|
45
49
|
S as DrawerBody,
|
|
@@ -6,4 +6,6 @@ export type FileUploadProps = InputFileProps;
|
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated Use <InputFile /> instead of <FileUpload />.
|
|
8
8
|
*/
|
|
9
|
-
export declare const FileUpload: import('react').ForwardRefExoticComponent<
|
|
9
|
+
export declare const FileUpload: import('react').ForwardRefExoticComponent<{
|
|
10
|
+
dataTestid?: string;
|
|
11
|
+
} & import('react').InputHTMLAttributes<Omit<HTMLInputElement, "type">> & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -12,7 +12,7 @@ declare const FormFieldHint: {
|
|
|
12
12
|
displayName: string;
|
|
13
13
|
};
|
|
14
14
|
declare const FormFieldError: {
|
|
15
|
-
({ children, text, size, className, }: ErrorTextProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
({ children, text, size, className, ...props }: ErrorTextProps): import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
export { FormField, FormFieldLabel, FormFieldHint, FormFieldError };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as o, jsxs as
|
|
2
|
+
import { jsx as o, jsxs as a } from "react/jsx-runtime";
|
|
3
3
|
import { S as g } from "../../index-2sRBqKFV.js";
|
|
4
4
|
import { createContext as x, useContext as v, Children as L, isValidElement as C } from "react";
|
|
5
|
-
import { cn as
|
|
5
|
+
import { cn as d } from "../../cn.js";
|
|
6
6
|
import { ErrorText as E } from "../../error-text/error-text.js";
|
|
7
7
|
import { HintText as N } from "../../hint-text/hint-text.js";
|
|
8
8
|
import { Label as T } from "../../label/label.js";
|
|
@@ -10,18 +10,18 @@ const c = x(null);
|
|
|
10
10
|
function s(e) {
|
|
11
11
|
v(c) || console.error(`[${e}] must be used within a <FormField>.`);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function m(e) {
|
|
14
14
|
var r, i;
|
|
15
15
|
return C(e) && (((r = e.type) == null ? void 0 : r.componentType) || ((i = e.props) == null ? void 0 : i.__mdxType)) || null;
|
|
16
16
|
}
|
|
17
17
|
function H(e) {
|
|
18
18
|
return ["FormFieldLabel", "FormFieldHint", "FormFieldError"].includes(
|
|
19
|
-
|
|
19
|
+
m(e) ?? ""
|
|
20
20
|
);
|
|
21
21
|
}
|
|
22
22
|
const _ = (e) => ["error", "hint", "label"].some((l) => l in e) ? (console.warn(
|
|
23
23
|
"[FormField] Using legacy props. Please migrate to the new composable API."
|
|
24
|
-
), /* @__PURE__ */ o(c.Provider, { value: !0, children: /* @__PURE__ */
|
|
24
|
+
), /* @__PURE__ */ o(c.Provider, { value: !0, children: /* @__PURE__ */ a(y, { ...e, children: [
|
|
25
25
|
e.label && /* @__PURE__ */ o(F, { ...e.label }),
|
|
26
26
|
e.hint && /* @__PURE__ */ o(u, { ...e.hint }),
|
|
27
27
|
e.error && /* @__PURE__ */ o(f, { ...e.error }),
|
|
@@ -31,22 +31,22 @@ const _ = (e) => ["error", "hint", "label"].some((l) => l in e) ? (console.warn(
|
|
|
31
31
|
className: r,
|
|
32
32
|
...i
|
|
33
33
|
}) => {
|
|
34
|
-
const l = L.toArray(e),
|
|
35
|
-
(t) =>
|
|
34
|
+
const l = L.toArray(e), n = l.find(
|
|
35
|
+
(t) => m(t) === "FormFieldLabel"
|
|
36
36
|
), p = l.find(
|
|
37
|
-
(t) =>
|
|
37
|
+
(t) => m(t) === "FormFieldHint"
|
|
38
38
|
), b = l.find(
|
|
39
|
-
(t) =>
|
|
39
|
+
(t) => m(t) === "FormFieldError"
|
|
40
40
|
), h = l.filter((t) => !H(t));
|
|
41
|
-
return /* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ a(
|
|
42
42
|
"fieldset",
|
|
43
43
|
{
|
|
44
|
-
className:
|
|
44
|
+
className: d({ "gi-error-state": !!b }, r),
|
|
45
45
|
...i,
|
|
46
46
|
children: [
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
|
|
47
|
+
/* @__PURE__ */ a("div", { className: "gi-pb-3 gi-flex gi-flex-col gi-gap-1", children: [
|
|
48
|
+
/* @__PURE__ */ a("div", { children: [
|
|
49
|
+
n,
|
|
50
50
|
p
|
|
51
51
|
] }),
|
|
52
52
|
b
|
|
@@ -60,14 +60,14 @@ const _ = (e) => ["error", "hint", "label"].some((l) => l in e) ? (console.warn(
|
|
|
60
60
|
text: r,
|
|
61
61
|
size: i,
|
|
62
62
|
htmlFor: l,
|
|
63
|
-
className:
|
|
63
|
+
className: n
|
|
64
64
|
}) => (s("FormFieldLabel"), /* @__PURE__ */ o(
|
|
65
65
|
T,
|
|
66
66
|
{
|
|
67
67
|
text: r,
|
|
68
68
|
size: i,
|
|
69
69
|
htmlFor: l,
|
|
70
|
-
className:
|
|
70
|
+
className: d("gi-font-bold", n),
|
|
71
71
|
children: e
|
|
72
72
|
}
|
|
73
73
|
));
|
|
@@ -77,7 +77,7 @@ Object.defineProperty(F, "componentType", {
|
|
|
77
77
|
enumerable: !1
|
|
78
78
|
});
|
|
79
79
|
F.displayName = "FormFieldLabel";
|
|
80
|
-
const u = ({ children: e, text: r, size: i, className: l }) => (s("FormFieldHint"), /* @__PURE__ */ o(N, { text: r, size: i, className:
|
|
80
|
+
const u = ({ children: e, text: r, size: i, className: l }) => (s("FormFieldHint"), /* @__PURE__ */ o(N, { text: r, size: i, className: d("gi-mb-1", l), children: e }));
|
|
81
81
|
Object.defineProperty(u, "componentType", {
|
|
82
82
|
value: "FormFieldHint",
|
|
83
83
|
writable: !1,
|
|
@@ -88,8 +88,18 @@ const f = ({
|
|
|
88
88
|
children: e,
|
|
89
89
|
text: r,
|
|
90
90
|
size: i,
|
|
91
|
-
className: l
|
|
92
|
-
|
|
91
|
+
className: l,
|
|
92
|
+
...n
|
|
93
|
+
}) => (s("FormFieldError"), /* @__PURE__ */ o(
|
|
94
|
+
E,
|
|
95
|
+
{
|
|
96
|
+
text: r,
|
|
97
|
+
size: i,
|
|
98
|
+
className: d("gi-mb-1", l),
|
|
99
|
+
...n,
|
|
100
|
+
children: e
|
|
101
|
+
}
|
|
102
|
+
));
|
|
93
103
|
Object.defineProperty(f, "componentType", {
|
|
94
104
|
value: "FormFieldError",
|
|
95
105
|
writable: !1,
|
|
@@ -1,97 +1,103 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as t, jsx as o } from "react/jsx-runtime";
|
|
3
3
|
import { useState as g } from "react";
|
|
4
4
|
import { cn as f } from "../../cn.js";
|
|
5
5
|
import { translate as d } from "../../i18n/utility.js";
|
|
6
|
-
import { Icon as
|
|
7
|
-
import { ListItem as
|
|
8
|
-
const b = ({ index:
|
|
9
|
-
const [
|
|
10
|
-
|
|
6
|
+
import { Icon as h } from "../../icon/icon.js";
|
|
7
|
+
import { ListItem as s } from "../../list-item/list-item.js";
|
|
8
|
+
const b = ({ index: r, item: a }) => {
|
|
9
|
+
const [l, n] = g(!1), e = () => {
|
|
10
|
+
n((i) => !i);
|
|
11
|
+
}, c = (i) => {
|
|
12
|
+
(i.key === "Enter" || i.key === " ") && (i.preventDefault(), e());
|
|
13
|
+
};
|
|
14
|
+
return /* @__PURE__ */ t(
|
|
11
15
|
"div",
|
|
12
16
|
{
|
|
13
|
-
id: `Accordion-item-${
|
|
17
|
+
id: `Accordion-item-${r}`,
|
|
14
18
|
className: "gi-accordion-item-container",
|
|
15
|
-
"data-open":
|
|
19
|
+
"data-open": l.toString(),
|
|
16
20
|
role: "region",
|
|
17
|
-
"aria-labelledby": `Accordion-header-${
|
|
18
|
-
onClick: () => n(!r),
|
|
21
|
+
"aria-labelledby": `Accordion-header-${r}`,
|
|
19
22
|
children: [
|
|
20
|
-
/* @__PURE__ */
|
|
23
|
+
/* @__PURE__ */ o(
|
|
21
24
|
"div",
|
|
22
25
|
{
|
|
23
26
|
"aria-label": a.label,
|
|
24
|
-
id: `Accordion-header-${
|
|
27
|
+
id: `Accordion-header-${r}`,
|
|
25
28
|
role: "button",
|
|
26
|
-
"aria-expanded":
|
|
27
|
-
"aria-controls": `Accordion-slot-${
|
|
29
|
+
"aria-expanded": l,
|
|
30
|
+
"aria-controls": `Accordion-slot-${r}`,
|
|
28
31
|
className: "gi-header-accordion-item-toggle",
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
tabIndex: 0,
|
|
33
|
+
onClick: e,
|
|
34
|
+
onKeyDown: c,
|
|
35
|
+
children: /* @__PURE__ */ t("div", { children: [
|
|
36
|
+
/* @__PURE__ */ o("span", { className: "gi-text-sm gi-font-bold gi-ml-1", children: a.label }),
|
|
37
|
+
/* @__PURE__ */ o(h, { icon: "chevron_right", className: "gi-accordion-item-icon" })
|
|
32
38
|
] })
|
|
33
39
|
}
|
|
34
40
|
),
|
|
35
|
-
/* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ o(
|
|
36
42
|
"div",
|
|
37
43
|
{
|
|
38
|
-
id: `Accordion-slot-${
|
|
44
|
+
id: `Accordion-slot-${r}`,
|
|
39
45
|
role: "region",
|
|
40
46
|
className: f("gi-accordion-item-slot", {
|
|
41
|
-
"gi-hidden": !
|
|
47
|
+
"gi-hidden": !l
|
|
42
48
|
}),
|
|
43
49
|
children: a.slot
|
|
44
50
|
}
|
|
45
51
|
)
|
|
46
52
|
]
|
|
47
53
|
},
|
|
48
|
-
`Accordion-item-${
|
|
54
|
+
`Accordion-item-${r}`
|
|
49
55
|
);
|
|
50
56
|
}, m = ({
|
|
51
|
-
items:
|
|
57
|
+
items: r,
|
|
52
58
|
secondaryLinks: a
|
|
53
|
-
}) => /* @__PURE__ */
|
|
54
|
-
|
|
55
|
-
const [
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
}) => /* @__PURE__ */ t("ul", { children: [
|
|
60
|
+
r == null ? void 0 : r.map(({ itemType: l, label: n, ...e }, c) => {
|
|
61
|
+
const [i, u] = [
|
|
62
|
+
l === "link" || l === "custom-link",
|
|
63
|
+
l === "slot"
|
|
58
64
|
];
|
|
59
65
|
if (!n)
|
|
60
66
|
return null;
|
|
61
|
-
if (
|
|
62
|
-
return /* @__PURE__ */
|
|
63
|
-
|
|
67
|
+
if (i)
|
|
68
|
+
return /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o(
|
|
69
|
+
s,
|
|
64
70
|
{
|
|
65
|
-
href:
|
|
71
|
+
href: e == null ? void 0 : e.href,
|
|
66
72
|
label: n,
|
|
67
|
-
external:
|
|
68
|
-
slot:
|
|
73
|
+
external: e == null ? void 0 : e.external,
|
|
74
|
+
slot: e == null ? void 0 : e.component
|
|
69
75
|
}
|
|
70
76
|
) }, `navLink-${n}-${c}`);
|
|
71
77
|
if (u)
|
|
72
|
-
return /* @__PURE__ */
|
|
78
|
+
return /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o(
|
|
73
79
|
b,
|
|
74
80
|
{
|
|
75
81
|
index: c,
|
|
76
82
|
item: {
|
|
77
83
|
label: n,
|
|
78
|
-
slot:
|
|
84
|
+
slot: e == null ? void 0 : e.component
|
|
79
85
|
}
|
|
80
86
|
}
|
|
81
87
|
) }, `toolItems-${n}-${c}`);
|
|
82
88
|
}),
|
|
83
|
-
a == null ? void 0 : a.map((
|
|
84
|
-
|
|
89
|
+
a == null ? void 0 : a.map((l, n) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o(
|
|
90
|
+
s,
|
|
85
91
|
{
|
|
86
|
-
href:
|
|
87
|
-
label:
|
|
92
|
+
href: l.href,
|
|
93
|
+
label: l.label,
|
|
88
94
|
bold: !1,
|
|
89
|
-
slot:
|
|
95
|
+
slot: l.slot
|
|
90
96
|
}
|
|
91
|
-
) }, `secondary-${
|
|
97
|
+
) }, `secondary-${l.label}-${n}`))
|
|
92
98
|
] });
|
|
93
|
-
function I({ ...
|
|
94
|
-
return /* @__PURE__ */
|
|
99
|
+
function I({ ...r }) {
|
|
100
|
+
return /* @__PURE__ */ t(
|
|
95
101
|
"div",
|
|
96
102
|
{
|
|
97
103
|
id: "HeaderMenuContainer",
|
|
@@ -100,7 +106,7 @@ function I({ ...o }) {
|
|
|
100
106
|
defaultValue: "Mobile Navigation Menu"
|
|
101
107
|
}),
|
|
102
108
|
children: [
|
|
103
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ o("div", { children: /* @__PURE__ */ o("div", { className: "gi-flex gi-items-center", children: /* @__PURE__ */ t(
|
|
104
110
|
"label",
|
|
105
111
|
{
|
|
106
112
|
htmlFor: "MobileMenuTrigger",
|
|
@@ -109,12 +115,12 @@ function I({ ...o }) {
|
|
|
109
115
|
defaultValue: "Close Mobile Menu"
|
|
110
116
|
}),
|
|
111
117
|
children: [
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
/* @__PURE__ */
|
|
118
|
+
/* @__PURE__ */ o("span", { children: "Close" }),
|
|
119
|
+
/* @__PURE__ */ o(h, { icon: "close" })
|
|
114
120
|
]
|
|
115
121
|
}
|
|
116
122
|
) }) }),
|
|
117
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ o(m, { ...r })
|
|
118
124
|
]
|
|
119
125
|
}
|
|
120
126
|
);
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { HeaderItem } from '../types.js';
|
|
1
|
+
import { HeaderAppearance, HeaderItem } from '../types.js';
|
|
2
2
|
type HeaderSlotProps = {
|
|
3
3
|
item: HeaderItem;
|
|
4
4
|
index: number;
|
|
5
|
+
appearance: HeaderAppearance;
|
|
5
6
|
};
|
|
6
7
|
type HeaderSlotContainerProps = {
|
|
7
8
|
slot: React.ReactNode;
|
|
8
9
|
index: number;
|
|
10
|
+
appearance: HeaderAppearance;
|
|
9
11
|
};
|
|
10
|
-
export declare const SlotContainer: ({ index, slot }: HeaderSlotContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export declare const SlotItemAction: ({ item, index }: HeaderSlotProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const SlotContainer: ({ index, slot, appearance, }: HeaderSlotContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const SlotItemAction: ({ item, index, appearance, }: HeaderSlotProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
14
|
export {};
|
|
@@ -1,74 +1,80 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { DrawerWrapper as
|
|
5
|
-
import { translate as
|
|
6
|
-
import { Icon as
|
|
7
|
-
import { Input as
|
|
8
|
-
|
|
1
|
+
import { jsx as a, jsxs as s, Fragment as I } from "react/jsx-runtime";
|
|
2
|
+
import { useState as $ } from "react";
|
|
3
|
+
import { cn as n } from "../../cn.js";
|
|
4
|
+
import { DrawerWrapper as f, DrawerBody as T } from "../../drawer/drawer.js";
|
|
5
|
+
import { translate as c } from "../../i18n/utility.js";
|
|
6
|
+
import { Icon as i } from "../../icon/icon.js";
|
|
7
|
+
import { Input as h } from "../../primitives/input.js";
|
|
8
|
+
import { headerSlotContainerVariants as b, headerToolItemVariants as p } from "../variants.js";
|
|
9
|
+
const y = ({
|
|
10
|
+
index: e,
|
|
11
|
+
slot: r,
|
|
12
|
+
appearance: t
|
|
13
|
+
}) => /* @__PURE__ */ a(
|
|
9
14
|
"div",
|
|
10
15
|
{
|
|
11
16
|
id: `SlotContainer-${e}`,
|
|
12
17
|
"data-testid": `SlotContainer-${e}`,
|
|
13
18
|
"data-index": e,
|
|
14
|
-
"aria-label":
|
|
19
|
+
"aria-label": c("header.headerSlot", {
|
|
15
20
|
index: e + 1,
|
|
16
21
|
defaultValue: `Slot Container ${e + 1}`
|
|
17
22
|
}),
|
|
18
|
-
className:
|
|
23
|
+
className: n(b({ appearance: t }), "gi-hidden"),
|
|
19
24
|
children: r
|
|
20
25
|
}
|
|
21
|
-
),
|
|
26
|
+
), C = ({
|
|
22
27
|
index: e,
|
|
23
|
-
item: { component: r, drawerPosition:
|
|
28
|
+
item: { component: r, drawerPosition: t, icon: d, label: l, ariaLabel: m },
|
|
29
|
+
appearance: u
|
|
24
30
|
}) => {
|
|
25
|
-
const [
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */
|
|
31
|
+
const [o, g] = $(!1);
|
|
32
|
+
return /* @__PURE__ */ s(I, { children: [
|
|
33
|
+
/* @__PURE__ */ s(
|
|
28
34
|
"label",
|
|
29
35
|
{
|
|
30
36
|
htmlFor: `ItemActionDrawerTrigger-${e}`,
|
|
31
|
-
className:
|
|
32
|
-
onClick: () =>
|
|
37
|
+
className: p({ appearance: u }),
|
|
38
|
+
onClick: () => g(!0),
|
|
33
39
|
children: [
|
|
34
40
|
/* @__PURE__ */ a(
|
|
35
|
-
|
|
41
|
+
h,
|
|
36
42
|
{
|
|
37
43
|
"data-testid": `ItemActionDrawerTrigger-${e}`,
|
|
38
|
-
className: "gi-
|
|
44
|
+
className: "gi-header-tool-item-input",
|
|
39
45
|
id: `ItemActionDrawerTrigger-${e}`,
|
|
40
46
|
"data-index": e,
|
|
41
|
-
"aria-label":
|
|
47
|
+
"aria-label": m || l || "",
|
|
42
48
|
type: "checkbox"
|
|
43
49
|
}
|
|
44
50
|
),
|
|
45
|
-
|
|
51
|
+
l && /* @__PURE__ */ a(
|
|
46
52
|
"span",
|
|
47
53
|
{
|
|
48
54
|
id: `ItemActionDrawerTrigger-${e}-label`,
|
|
49
55
|
className: "label",
|
|
50
|
-
"aria-hidden":
|
|
51
|
-
children:
|
|
56
|
+
"aria-hidden": m ? "true" : "false",
|
|
57
|
+
children: l
|
|
52
58
|
}
|
|
53
59
|
),
|
|
54
|
-
|
|
55
|
-
|
|
60
|
+
d && /* @__PURE__ */ a(
|
|
61
|
+
i,
|
|
56
62
|
{
|
|
57
|
-
className:
|
|
58
|
-
"gi-hidden":
|
|
59
|
-
"gi-block": !
|
|
63
|
+
className: n({
|
|
64
|
+
"gi-hidden": o,
|
|
65
|
+
"gi-block": !o
|
|
60
66
|
}),
|
|
61
|
-
icon:
|
|
67
|
+
icon: d,
|
|
62
68
|
id: `ItemIconDrawerActionTrigger-${e}`,
|
|
63
69
|
ariaHidden: !0
|
|
64
70
|
}
|
|
65
71
|
),
|
|
66
72
|
/* @__PURE__ */ a(
|
|
67
|
-
|
|
73
|
+
i,
|
|
68
74
|
{
|
|
69
|
-
className:
|
|
70
|
-
"gi-hidden": !
|
|
71
|
-
"gi-block":
|
|
75
|
+
className: n({
|
|
76
|
+
"gi-hidden": !o,
|
|
77
|
+
"gi-block": o
|
|
72
78
|
}),
|
|
73
79
|
id: `ItemCloseTrigger-${e}`,
|
|
74
80
|
ariaHidden: !0,
|
|
@@ -80,35 +86,40 @@ const D = ({ index: e, slot: r }) => /* @__PURE__ */ a(
|
|
|
80
86
|
}
|
|
81
87
|
),
|
|
82
88
|
/* @__PURE__ */ a(
|
|
83
|
-
|
|
89
|
+
f,
|
|
84
90
|
{
|
|
85
|
-
isOpen:
|
|
86
|
-
onClose: () =>
|
|
87
|
-
position:
|
|
88
|
-
closeButtonLabel:
|
|
91
|
+
isOpen: o,
|
|
92
|
+
onClose: () => g(!1),
|
|
93
|
+
position: t || "right",
|
|
94
|
+
closeButtonLabel: c("header.drawer.close", {
|
|
89
95
|
defaultValue: "Close"
|
|
90
96
|
}),
|
|
91
97
|
closeButtonSize: "large",
|
|
92
|
-
children: /* @__PURE__ */ a(
|
|
98
|
+
children: /* @__PURE__ */ a(T, { children: r })
|
|
93
99
|
}
|
|
94
100
|
)
|
|
95
101
|
] });
|
|
96
|
-
},
|
|
102
|
+
}, B = ({
|
|
103
|
+
item: e,
|
|
104
|
+
index: r,
|
|
105
|
+
appearance: t
|
|
106
|
+
}) => e.slotAppearance === "drawer" ? /* @__PURE__ */ a(C, { index: r, item: e, appearance: t }) : /* @__PURE__ */ s(
|
|
97
107
|
"label",
|
|
98
108
|
{
|
|
99
109
|
htmlFor: `ItemActionTrigger-${r}`,
|
|
100
|
-
"aria-label":
|
|
110
|
+
"aria-label": c("header.toggleActionItem", {
|
|
101
111
|
item: e.label || `item ${r + 1}`,
|
|
102
112
|
defaultValue: `Toggle item action for ${e.label || `item ${r + 1}`}`
|
|
103
113
|
}),
|
|
104
|
-
className:
|
|
114
|
+
className: p({ appearance: t }),
|
|
105
115
|
"data-label-index": r,
|
|
106
116
|
children: [
|
|
107
117
|
/* @__PURE__ */ a(
|
|
108
|
-
|
|
118
|
+
h,
|
|
109
119
|
{
|
|
110
120
|
"data-testid": `ItemActionTrigger-${r}`,
|
|
111
121
|
id: `ItemActionTrigger-${r}`,
|
|
122
|
+
className: "gi-header-tool-item-input",
|
|
112
123
|
"data-index": r,
|
|
113
124
|
"aria-expanded": "false",
|
|
114
125
|
"aria-controls": `SlotContainer-${r + 1}`,
|
|
@@ -117,7 +128,7 @@ const D = ({ index: e, slot: r }) => /* @__PURE__ */ a(
|
|
|
117
128
|
),
|
|
118
129
|
e.label && /* @__PURE__ */ a("span", { className: "label", children: e.label }),
|
|
119
130
|
e.icon && /* @__PURE__ */ a(
|
|
120
|
-
|
|
131
|
+
i,
|
|
121
132
|
{
|
|
122
133
|
icon: e.icon,
|
|
123
134
|
ariaHidden: !0,
|
|
@@ -125,7 +136,7 @@ const D = ({ index: e, slot: r }) => /* @__PURE__ */ a(
|
|
|
125
136
|
}
|
|
126
137
|
),
|
|
127
138
|
/* @__PURE__ */ a(
|
|
128
|
-
|
|
139
|
+
i,
|
|
129
140
|
{
|
|
130
141
|
className: "gi-hidden close-icon",
|
|
131
142
|
ariaHidden: !0,
|
|
@@ -138,6 +149,6 @@ const D = ({ index: e, slot: r }) => /* @__PURE__ */ a(
|
|
|
138
149
|
}
|
|
139
150
|
);
|
|
140
151
|
export {
|
|
141
|
-
|
|
142
|
-
|
|
152
|
+
y as SlotContainer,
|
|
153
|
+
B as SlotItemAction
|
|
143
154
|
};
|
package/dist/header/header.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { HeaderProps } from './types.js';
|
|
2
|
-
export declare function Header({ title, items, logo, secondaryLinks, fullWidth, addDefaultMobileMenu, mobileMenuLabel, showMenuLabel, showTitleOnMobile, dataTestid, }: HeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function Header({ title, items, logo, secondaryLinks, fullWidth, addDefaultMobileMenu, mobileMenuLabel, showMenuLabel, showTitleOnMobile, dataTestid, appearance, }: HeaderProps): import("react/jsx-runtime").JSX.Element;
|