@ogcio/design-system-react 1.15.3 → 1.17.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/autocomplete/use-autocomplete-controller.js +55 -54
- package/dist/breadcrumbs/breadcrumbs.js +29 -23
- package/dist/button/button.js +1 -1
- package/dist/card/card-next.js +1 -1
- package/dist/data-table/data-table-footer.d.ts +12 -0
- package/dist/data-table/data-table-footer.js +66 -0
- package/dist/data-table/data-table-header.d.ts +28 -0
- package/dist/data-table/data-table-header.js +157 -0
- package/dist/data-table/data-table-selected-rows.d.ts +6 -0
- package/dist/data-table/data-table-selected-rows.js +23 -0
- package/dist/{data-grid → data-table}/tanstack/tanstack-helpers.d.ts +1 -0
- package/dist/{data-grid → data-table}/tanstack/tanstack-helpers.js +27 -25
- 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 +40 -30
- package/dist/header/components/header-menu.js +49 -44
- 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/index.d.ts +4 -4
- package/dist/index.js +43 -43
- 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-radio/input-radio.js +31 -31
- 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 +183 -146
- package/dist/modal/types.d.ts +5 -0
- package/dist/phase-banner/phase-banner.d.ts +4 -2
- package/dist/phase-banner/phase-banner.js +30 -7
- package/dist/popover/popover.js +10 -1
- package/dist/select/select-menu.js +27 -27
- package/dist/select/select-next.js +42 -40
- package/dist/styles.css +1 -1
- package/dist/table/table-pagination.js +65 -48
- package/dist/table/table.js +18 -18
- package/dist/text-input/text-input.d.ts +1 -0
- package/dist/textarea/textarea.js +52 -49
- package/dist/utils/utilities.d.ts +1 -0
- package/dist/utils/utilities.js +17 -12
- package/package.json +6 -5
- package/dist/data-grid/data-grid-footer.d.ts +0 -12
- package/dist/data-grid/data-grid-footer.js +0 -66
- package/dist/data-grid/data-grid-header.d.ts +0 -12
- package/dist/data-grid/data-grid-header.js +0 -82
- /package/dist/{data-grid → data-table}/editable-table-cell.d.ts +0 -0
- /package/dist/{data-grid → data-table}/editable-table-cell.js +0 -0
- /package/dist/{data-grid → data-table}/types.d.ts +0 -0
- /package/dist/{data-grid → data-table}/types.js +0 -0
|
@@ -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;
|
package/dist/header/header.js
CHANGED
|
@@ -1,26 +1,38 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
3
|
-
import { useEffect as
|
|
4
|
-
import { renderToStaticMarkup as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import h from "../
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
3
|
+
import { useEffect as H, useMemo as T, createElement as I } from "react";
|
|
4
|
+
import { renderToStaticMarkup as v } from "react-dom/server";
|
|
5
|
+
import x from "../assets/logos/gov-of-ireland/harp-black.js";
|
|
6
|
+
import D from "../assets/logos/gov-of-ireland/harp-white.js";
|
|
7
|
+
import L from "../assets/logos/harp/harp-black.js";
|
|
8
|
+
import C from "../assets/logos/harp/harp-white.js";
|
|
9
|
+
import { cn as k } from "../cn.js";
|
|
10
|
+
import { Container as p } from "../container/container.js";
|
|
11
|
+
import { translate as h } from "../i18n/utility.js";
|
|
12
|
+
import { Icon as A } from "../icon/icon.js";
|
|
13
|
+
import u from "../primitives/anchor.js";
|
|
14
|
+
import { MobileHeaderMenuItems as j } from "./components/header-menu.js";
|
|
15
|
+
import { SlotContainer as E, SlotItemAction as G } from "./components/header-slot.js";
|
|
16
|
+
import { attachEventsToItemActionTriggers as B } from "./helper.js";
|
|
17
|
+
import { headerVariants as F, headerMenuVariants as O, headerLogoVariants as P, headerTitleVariants as U, headerSecondaryLinksVariants as W, headerDividerVariants as q, headerToolItemVariants as y, headerSecondaryLinkItemVariants as z, headerSecondaryLinkSlotItemVariants as J } from "./variants.js";
|
|
18
|
+
function S({ logo: r, appearance: n = "default" }) {
|
|
19
|
+
const t = {
|
|
20
|
+
harp: {
|
|
21
|
+
default: /* @__PURE__ */ e(C, {}),
|
|
22
|
+
light: /* @__PURE__ */ e(L, {})
|
|
23
|
+
},
|
|
24
|
+
withText: {
|
|
25
|
+
default: /* @__PURE__ */ e(D, {}),
|
|
26
|
+
light: /* @__PURE__ */ e(x, {})
|
|
27
|
+
}
|
|
28
|
+
}, o = `data:image/svg+xml;base64,${btoa(v(t.harp[n]))}`, b = `data:image/svg+xml;base64,${btoa(
|
|
29
|
+
v(t.withText[n])
|
|
18
30
|
)}`;
|
|
19
31
|
return /* @__PURE__ */ c("picture", { children: [
|
|
20
32
|
/* @__PURE__ */ e(
|
|
21
33
|
"source",
|
|
22
34
|
{
|
|
23
|
-
srcSet: (
|
|
35
|
+
srcSet: (r == null ? void 0 : r.imageLarge) || b,
|
|
24
36
|
media: "(min-width: 640px)"
|
|
25
37
|
}
|
|
26
38
|
),
|
|
@@ -28,165 +40,175 @@ function N({ logo: a }) {
|
|
|
28
40
|
"img",
|
|
29
41
|
{
|
|
30
42
|
className: "gi-h-10 sm:gi-h-14",
|
|
31
|
-
src: (
|
|
32
|
-
alt: (
|
|
43
|
+
src: (r == null ? void 0 : r.imageSmall) || o,
|
|
44
|
+
alt: (r == null ? void 0 : r.alt) || h("logo.govieLogo", { defaultValue: "Gov.ie logo" })
|
|
33
45
|
}
|
|
34
46
|
)
|
|
35
47
|
] });
|
|
36
48
|
}
|
|
37
|
-
const
|
|
38
|
-
label:
|
|
49
|
+
const K = (r, n, t) => [{
|
|
50
|
+
label: r,
|
|
39
51
|
icon: "menu",
|
|
40
52
|
itemType: "slot",
|
|
41
|
-
component: /* @__PURE__ */ e(
|
|
53
|
+
component: /* @__PURE__ */ e(j, { items: n, secondaryLinks: t }),
|
|
42
54
|
slotAppearance: "drawer",
|
|
43
55
|
showItemMode: "mobile-only"
|
|
44
|
-
}, ...
|
|
45
|
-
href:
|
|
46
|
-
label:
|
|
56
|
+
}, ...n], Q = ({
|
|
57
|
+
href: r,
|
|
58
|
+
label: n,
|
|
47
59
|
slot: t,
|
|
48
|
-
index:
|
|
49
|
-
|
|
50
|
-
|
|
60
|
+
index: l,
|
|
61
|
+
appearance: o = "default"
|
|
62
|
+
}) => /* @__PURE__ */ e("li", { children: r ? /* @__PURE__ */ e(
|
|
63
|
+
u,
|
|
64
|
+
{
|
|
65
|
+
"aria-label": n,
|
|
66
|
+
"data-testid": `secondary-link-desktop-${l}`,
|
|
67
|
+
href: r,
|
|
68
|
+
className: z({ appearance: o }),
|
|
69
|
+
children: n
|
|
70
|
+
}
|
|
71
|
+
) : /* @__PURE__ */ e(
|
|
72
|
+
"div",
|
|
51
73
|
{
|
|
52
|
-
|
|
53
|
-
"data-
|
|
54
|
-
|
|
55
|
-
className: "gi-header-secondary-item",
|
|
56
|
-
children: i
|
|
74
|
+
className: J({ appearance: o }),
|
|
75
|
+
"data-appearance": o,
|
|
76
|
+
children: t
|
|
57
77
|
}
|
|
58
|
-
)
|
|
59
|
-
|
|
78
|
+
) }), R = ({ links: r, appearance: n }) => /* @__PURE__ */ e("ul", { children: r == null ? void 0 : r.map((t, l) => /* @__PURE__ */ I(
|
|
79
|
+
Q,
|
|
60
80
|
{
|
|
61
|
-
...
|
|
62
|
-
index:
|
|
63
|
-
key: `secondary-${
|
|
81
|
+
...t,
|
|
82
|
+
index: l,
|
|
83
|
+
key: `secondary-${t.label}-${l}`,
|
|
84
|
+
appearance: n
|
|
64
85
|
}
|
|
65
86
|
)) });
|
|
66
|
-
function
|
|
67
|
-
title:
|
|
68
|
-
items:
|
|
87
|
+
function ue({
|
|
88
|
+
title: r,
|
|
89
|
+
items: n,
|
|
69
90
|
logo: t,
|
|
70
|
-
secondaryLinks:
|
|
71
|
-
fullWidth:
|
|
72
|
-
addDefaultMobileMenu:
|
|
73
|
-
mobileMenuLabel:
|
|
74
|
-
showMenuLabel:
|
|
75
|
-
showTitleOnMobile:
|
|
76
|
-
dataTestid:
|
|
91
|
+
secondaryLinks: l,
|
|
92
|
+
fullWidth: o = !1,
|
|
93
|
+
addDefaultMobileMenu: f,
|
|
94
|
+
mobileMenuLabel: b,
|
|
95
|
+
showMenuLabel: N = !0,
|
|
96
|
+
showTitleOnMobile: M,
|
|
97
|
+
dataTestid: V,
|
|
98
|
+
appearance: i = "default"
|
|
77
99
|
}) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
P();
|
|
100
|
+
H(() => {
|
|
101
|
+
B();
|
|
81
102
|
}, []);
|
|
82
|
-
const
|
|
83
|
-
item:
|
|
84
|
-
index:
|
|
103
|
+
const $ = ({
|
|
104
|
+
item: a,
|
|
105
|
+
index: s
|
|
85
106
|
}) => {
|
|
86
|
-
switch (
|
|
107
|
+
switch (a.itemType) {
|
|
87
108
|
case "slot":
|
|
88
|
-
return /* @__PURE__ */ e(
|
|
109
|
+
return /* @__PURE__ */ e(G, { index: s, item: a, appearance: i });
|
|
89
110
|
case "link":
|
|
90
111
|
return /* @__PURE__ */ c(
|
|
91
|
-
|
|
112
|
+
u,
|
|
92
113
|
{
|
|
93
|
-
className:
|
|
94
|
-
href:
|
|
95
|
-
onClick:
|
|
96
|
-
"aria-label":
|
|
97
|
-
"data-testid": `item-link-${
|
|
98
|
-
external:
|
|
114
|
+
className: y({ appearance: i }),
|
|
115
|
+
href: a.href,
|
|
116
|
+
onClick: a.onClick,
|
|
117
|
+
"aria-label": a.label || `link ${s}`,
|
|
118
|
+
"data-testid": `item-link-${s}`,
|
|
119
|
+
external: a.external,
|
|
99
120
|
children: [
|
|
100
|
-
|
|
101
|
-
|
|
121
|
+
a.label && a.label,
|
|
122
|
+
a.icon && /* @__PURE__ */ e(A, { icon: a.icon })
|
|
102
123
|
]
|
|
103
124
|
}
|
|
104
125
|
);
|
|
105
126
|
case "custom-link":
|
|
106
|
-
return /* @__PURE__ */ e(
|
|
127
|
+
return /* @__PURE__ */ e(u, { asChild: !0, className: y({ appearance: i }), children: a.component });
|
|
107
128
|
default:
|
|
108
|
-
return /* @__PURE__ */ e("div", { className:
|
|
129
|
+
return /* @__PURE__ */ e("div", { className: q({ appearance: i }) });
|
|
109
130
|
}
|
|
110
|
-
},
|
|
111
|
-
const
|
|
112
|
-
return
|
|
113
|
-
}, [
|
|
131
|
+
}, w = N ? b || h("header.menu", { defaultValue: "Menu" }) : "", d = T(() => {
|
|
132
|
+
const a = n || [];
|
|
133
|
+
return f ? K(w, a, l || []) : a;
|
|
134
|
+
}, [f]);
|
|
114
135
|
return /* @__PURE__ */ c(
|
|
115
136
|
"header",
|
|
116
137
|
{
|
|
117
138
|
id: "GovieHeader",
|
|
118
|
-
"aria-label":
|
|
119
|
-
className:
|
|
120
|
-
"data-testid":
|
|
139
|
+
"aria-label": h("header.siteHeader", { defaultValue: "Site Header" }),
|
|
140
|
+
className: F({ appearance: i }),
|
|
141
|
+
"data-testid": V,
|
|
121
142
|
children: [
|
|
122
143
|
/* @__PURE__ */ e(
|
|
123
|
-
|
|
144
|
+
p,
|
|
124
145
|
{
|
|
125
146
|
id: "HeaderContainer",
|
|
126
147
|
className: "gi-order-2",
|
|
127
|
-
fullWidth:
|
|
128
|
-
children: /* @__PURE__ */ c("div", { className:
|
|
129
|
-
/* @__PURE__ */ c("div", { className:
|
|
148
|
+
fullWidth: o,
|
|
149
|
+
children: /* @__PURE__ */ c("div", { className: O({ appearance: i }), children: [
|
|
150
|
+
/* @__PURE__ */ c("div", { className: P({ appearance: i }), children: [
|
|
130
151
|
(t == null ? void 0 : t.href) && /* @__PURE__ */ e(
|
|
131
|
-
|
|
152
|
+
u,
|
|
132
153
|
{
|
|
133
154
|
href: t.href,
|
|
134
|
-
"aria-label":
|
|
155
|
+
"aria-label": h("header.goToHomePage", {
|
|
135
156
|
defaultValue: "Go to Home Page"
|
|
136
157
|
}),
|
|
137
158
|
"data-testid": "logo-link",
|
|
138
159
|
external: t.external,
|
|
139
|
-
children:
|
|
160
|
+
children: S({ logo: t, appearance: i })
|
|
140
161
|
}
|
|
141
162
|
),
|
|
142
|
-
!(t != null && t.href) &&
|
|
163
|
+
!(t != null && t.href) && S({ logo: t, appearance: i })
|
|
143
164
|
] }),
|
|
144
165
|
/* @__PURE__ */ e(
|
|
145
166
|
"div",
|
|
146
167
|
{
|
|
147
|
-
className:
|
|
148
|
-
"gi-hidden": !
|
|
168
|
+
className: k(U({ appearance: i }), {
|
|
169
|
+
"gi-hidden": !M
|
|
149
170
|
}),
|
|
150
|
-
children:
|
|
171
|
+
children: r
|
|
151
172
|
}
|
|
152
173
|
),
|
|
153
|
-
/* @__PURE__ */ e("div", { className: "gi-flex gi-items-center gi-gap-2 md:gi-gap-4 gi-flex-none", children:
|
|
154
|
-
const { label:
|
|
174
|
+
/* @__PURE__ */ e("div", { className: "gi-flex gi-items-center gi-gap-2 md:gi-gap-4 gi-flex-none", children: d == null ? void 0 : d.map((a, s) => {
|
|
175
|
+
const { label: g, showItemMode: m = "desktop-only" } = a;
|
|
155
176
|
return /* @__PURE__ */ e(
|
|
156
177
|
"div",
|
|
157
178
|
{
|
|
158
|
-
"aria-label":
|
|
159
|
-
"data-testid": `header-item-${
|
|
160
|
-
className:
|
|
161
|
-
"gi-block":
|
|
162
|
-
"gi-block lg:gi-hidden":
|
|
163
|
-
"gi-hidden lg:gi-block":
|
|
179
|
+
"aria-label": a.ariaLabel,
|
|
180
|
+
"data-testid": `header-item-${s}`,
|
|
181
|
+
className: k({
|
|
182
|
+
"gi-block": m === "always",
|
|
183
|
+
"gi-block lg:gi-hidden": m === "mobile-only",
|
|
184
|
+
"gi-hidden lg:gi-block": m === "desktop-only"
|
|
164
185
|
}),
|
|
165
|
-
children: /* @__PURE__ */ e(
|
|
186
|
+
children: /* @__PURE__ */ e($, { item: a, index: s })
|
|
166
187
|
},
|
|
167
|
-
`item-${
|
|
188
|
+
`item-${g}-${s}`
|
|
168
189
|
);
|
|
169
190
|
}) })
|
|
170
191
|
] })
|
|
171
192
|
}
|
|
172
193
|
),
|
|
173
|
-
|
|
174
|
-
|
|
194
|
+
l && /* @__PURE__ */ e("div", { className: W({ appearance: i }), children: /* @__PURE__ */ e(
|
|
195
|
+
p,
|
|
175
196
|
{
|
|
176
197
|
className: "gi-flex gi-justify-end gi-items-center",
|
|
177
|
-
fullWidth:
|
|
178
|
-
children:
|
|
198
|
+
fullWidth: o,
|
|
199
|
+
children: l && /* @__PURE__ */ e(R, { links: l, appearance: i })
|
|
179
200
|
}
|
|
180
201
|
) }),
|
|
181
|
-
|
|
182
|
-
if (
|
|
183
|
-
return
|
|
184
|
-
|
|
202
|
+
d == null ? void 0 : d.map(({ itemType: a, component: s, slotAppearance: g }, m) => {
|
|
203
|
+
if (a === "slot")
|
|
204
|
+
return s && g !== "drawer" ? /* @__PURE__ */ e(
|
|
205
|
+
E,
|
|
185
206
|
{
|
|
186
|
-
slot:
|
|
187
|
-
index:
|
|
207
|
+
slot: s,
|
|
208
|
+
index: m,
|
|
209
|
+
appearance: i
|
|
188
210
|
},
|
|
189
|
-
`slot-container-${
|
|
211
|
+
`slot-container-${m}`
|
|
190
212
|
) : null;
|
|
191
213
|
})
|
|
192
214
|
]
|
|
@@ -194,5 +216,5 @@ function ie({
|
|
|
194
216
|
);
|
|
195
217
|
}
|
|
196
218
|
export {
|
|
197
|
-
|
|
219
|
+
ue as Header
|
|
198
220
|
};
|
package/dist/header/types.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { IconId } from '../icon/icon.js';
|
|
|
4
4
|
export type HeaderItemMode = 'always' | 'mobile-only' | 'desktop-only';
|
|
5
5
|
export type HeaderItemAppearance = 'dropdown' | 'drawer';
|
|
6
6
|
export type HeaderItemType = 'slot' | 'divider' | 'link' | 'custom-link';
|
|
7
|
+
export type HeaderAppearance = 'default' | 'light';
|
|
7
8
|
type CommonProps = {
|
|
8
9
|
showItemMode?: HeaderItemMode;
|
|
9
10
|
};
|
|
@@ -73,5 +74,6 @@ export type HeaderProps = {
|
|
|
73
74
|
fullWidth?: boolean;
|
|
74
75
|
showTitleOnMobile?: boolean;
|
|
75
76
|
dataTestid?: string;
|
|
77
|
+
appearance?: HeaderAppearance;
|
|
76
78
|
};
|
|
77
79
|
export {};
|