@ogcio/design-system-react 1.18.0 → 1.19.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 +15 -14
- package/dist/alert/alert.d.ts +1 -1
- package/dist/alert/alert.js +36 -27
- package/dist/autocomplete/autocomplete.js +3 -2
- package/dist/browser-support/runtime.d.ts +43 -0
- package/dist/browser-support/runtime.js +283 -0
- package/dist/button/button.js +12 -11
- package/dist/button-group/button-group.js +5 -4
- package/dist/card/card-next.js +16 -15
- package/dist/checkbox/checkbox-group.js +4 -3
- package/dist/checkbox/checkbox.js +5 -4
- package/dist/chip/chip.js +12 -11
- package/dist/combo-box/dropdown-item.js +3 -2
- package/dist/cookie-banner/cookie-banner.js +7 -6
- package/dist/data-table/data-table-footer.d.ts +2 -1
- package/dist/data-table/data-table-footer.js +38 -38
- package/dist/data-table/data-table-header.d.ts +3 -3
- package/dist/data-table/data-table-header.js +73 -76
- package/dist/data-table/editable-table-cell.js +3 -2
- package/dist/details/details.js +7 -6
- package/dist/drawer/drawer.js +7 -6
- package/dist/footer/footer.js +3 -2
- package/dist/forms/form-field/form-field.js +7 -6
- package/dist/header/components/header-menu.d.ts +1 -2
- package/dist/header/components/header-menu.js +43 -73
- package/dist/header/components/header-slot.js +19 -19
- package/dist/header/header.js +3 -2
- package/dist/header/types.d.ts +4 -0
- package/dist/hooks/use-breakpoint.js +8 -7
- package/dist/icon/icon.js +3 -2
- package/dist/icon-button/icon-button.js +5 -4
- package/dist/input-checkbox/input-checkbox.js +5 -4
- package/dist/input-checkbox-group/input-checkbox-group.js +10 -9
- package/dist/input-password/input-password.js +1 -0
- package/dist/input-radio/input-radio.js +5 -4
- package/dist/input-radio-group/input-radio-group.js +9 -8
- package/dist/input-text/input-text.js +14 -12
- package/dist/modal/modal.js +5 -4
- package/dist/pagination/pagination.js +26 -25
- package/dist/phase-banner/phase-banner.js +3 -2
- package/dist/popover/popover.js +3 -2
- package/dist/radio/radio-group.js +1 -0
- package/dist/radio/radio.js +1 -0
- package/dist/score-select/score-select.js +4 -3
- package/dist/select/select-menu.js +16 -15
- package/dist/select/select-next.js +3 -2
- package/dist/select/select.js +4 -3
- package/dist/side-nav/side-nav.js +10 -9
- package/dist/spinner/spinner.js +3 -2
- package/dist/stack/stack.js +21 -20
- package/dist/styles.css +1 -1
- package/dist/table/table-data.js +12 -11
- package/dist/table/table-header.js +3 -2
- package/dist/table/table-pagination.js +38 -38
- package/dist/tabs/tab-item.js +7 -6
- package/dist/tabs/tab-list.js +3 -2
- package/dist/text-input/text-input.js +1 -0
- package/dist/textarea/textarea.js +13 -12
- package/dist/toast/ds-toast.js +3 -2
- package/dist/toast/toast.js +12 -11
- package/dist/tooltip/tooltip.js +13 -12
- package/package.json +6 -4
package/dist/drawer/drawer.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import "@ogcio/design-system-react/browser-check";
|
|
2
3
|
import { jsx as a, jsxs as x, Fragment as y } from "react/jsx-runtime";
|
|
3
4
|
import { useState as D, cloneElement as M } from "react";
|
|
4
5
|
import { cn as r } from "../cn.js";
|
|
@@ -7,7 +8,7 @@ const b = ({
|
|
|
7
8
|
children: o,
|
|
8
9
|
className: e,
|
|
9
10
|
...s
|
|
10
|
-
}) => /* @__PURE__ */ a(N, { className: r("gi-drawer-container", e), ...s, children: o }),
|
|
11
|
+
}) => /* @__PURE__ */ a(N, { className: r("gi-drawer-container", e), ...s, children: o }), S = ({
|
|
11
12
|
children: o,
|
|
12
13
|
triggerButton: e,
|
|
13
14
|
startsOpen: s,
|
|
@@ -39,21 +40,21 @@ const b = ({
|
|
|
39
40
|
}
|
|
40
41
|
)
|
|
41
42
|
] });
|
|
42
|
-
},
|
|
43
|
+
}, T = ({ children: o, className: e }) => /* @__PURE__ */ a(
|
|
43
44
|
O,
|
|
44
45
|
{
|
|
45
46
|
includeModalClass: !1,
|
|
46
47
|
className: r("gi-drawer-body", e),
|
|
47
48
|
children: o
|
|
48
49
|
}
|
|
49
|
-
),
|
|
50
|
+
), q = ({
|
|
50
51
|
children: o,
|
|
51
52
|
className: e,
|
|
52
53
|
stacked: s
|
|
53
54
|
}) => /* @__PURE__ */ a(F, { stacked: s, className: r("gi-drawer-footer", e), children: o });
|
|
54
55
|
export {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
S as Drawer,
|
|
57
|
+
T as DrawerBody,
|
|
58
|
+
q as DrawerFooter,
|
|
58
59
|
b as DrawerWrapper
|
|
59
60
|
};
|
package/dist/footer/footer.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import "@ogcio/design-system-react/browser-check";
|
|
2
3
|
import { jsxs as i, jsx as t, Fragment as u } from "react/jsx-runtime";
|
|
3
4
|
import { renderToStaticMarkup as c } from "react-dom/server";
|
|
4
5
|
import h from "../assets/logos/gov-of-ireland/harp-gold-text-green.js";
|
|
@@ -24,7 +25,7 @@ function l({ logo: e }) {
|
|
|
24
25
|
)
|
|
25
26
|
] });
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
+
function M({
|
|
28
29
|
primarySlot: e,
|
|
29
30
|
secondarySlot: o,
|
|
30
31
|
utilitySlot: n,
|
|
@@ -104,5 +105,5 @@ function H({
|
|
|
104
105
|
);
|
|
105
106
|
}
|
|
106
107
|
export {
|
|
107
|
-
|
|
108
|
+
M as Footer
|
|
108
109
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import "@ogcio/design-system-react/browser-check";
|
|
2
3
|
import { jsx as t, jsxs as a } from "react/jsx-runtime";
|
|
3
4
|
import { S as g } from "../../index-2sRBqKFV.js";
|
|
4
5
|
import { createContext as x, useContext as v, Children as L, isValidElement as C } from "react";
|
|
@@ -19,21 +20,21 @@ function P(e) {
|
|
|
19
20
|
m(e) ?? ""
|
|
20
21
|
);
|
|
21
22
|
}
|
|
22
|
-
const
|
|
23
|
+
const B = (e) => ["error", "hint", "label"].some((l) => l in e) ? (console.warn(
|
|
23
24
|
"[FormField] Using legacy props. Please migrate to the new composable API."
|
|
24
|
-
), /* @__PURE__ */ t(c.Provider, { value: !0, children: /* @__PURE__ */ a(
|
|
25
|
+
), /* @__PURE__ */ t(c.Provider, { value: !0, children: /* @__PURE__ */ a(p, { ...e, children: [
|
|
25
26
|
e.label && /* @__PURE__ */ t(F, { ...e.label }),
|
|
26
27
|
e.hint && /* @__PURE__ */ t(u, { ...e.hint }),
|
|
27
28
|
e.error && /* @__PURE__ */ t(f, { ...e.error }),
|
|
28
29
|
e.children
|
|
29
|
-
] }) })) : /* @__PURE__ */ t(c.Provider, { value: !0, children: /* @__PURE__ */ t(
|
|
30
|
+
] }) })) : /* @__PURE__ */ t(c.Provider, { value: !0, children: /* @__PURE__ */ t(p, { ...e, children: e.children }) }), p = ({
|
|
30
31
|
children: e,
|
|
31
32
|
className: r,
|
|
32
33
|
...i
|
|
33
34
|
}) => {
|
|
34
35
|
const l = L.toArray(e), n = l.find(
|
|
35
36
|
(o) => m(o) === "FormFieldLabel"
|
|
36
|
-
),
|
|
37
|
+
), y = l.find(
|
|
37
38
|
(o) => m(o) === "FormFieldHint"
|
|
38
39
|
), b = l.find(
|
|
39
40
|
(o) => m(o) === "FormFieldError"
|
|
@@ -47,7 +48,7 @@ const _ = (e) => ["error", "hint", "label"].some((l) => l in e) ? (console.warn(
|
|
|
47
48
|
/* @__PURE__ */ a("div", { className: "gi-pb-3 gi-flex gi-flex-col gi-gap-1", children: [
|
|
48
49
|
/* @__PURE__ */ a("div", { children: [
|
|
49
50
|
n,
|
|
50
|
-
|
|
51
|
+
y
|
|
51
52
|
] }),
|
|
52
53
|
b
|
|
53
54
|
] }),
|
|
@@ -107,7 +108,7 @@ Object.defineProperty(f, "componentType", {
|
|
|
107
108
|
});
|
|
108
109
|
f.displayName = "FormFieldError";
|
|
109
110
|
export {
|
|
110
|
-
|
|
111
|
+
B as FormField,
|
|
111
112
|
f as FormFieldError,
|
|
112
113
|
u as FormFieldHint,
|
|
113
114
|
F as FormFieldLabel
|
|
@@ -9,5 +9,4 @@ type MenuItemAccordionProps = {
|
|
|
9
9
|
};
|
|
10
10
|
export declare const MenuItemAccordion: ({ index, item }: MenuItemAccordionProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export declare const MobileHeaderMenuItems: ({ items, secondaryLinks, }: MobileHeaderMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
|
|
13
|
-
export default HeaderMenu;
|
|
12
|
+
export {};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import "@ogcio/design-system-react/browser-check";
|
|
3
|
+
import { jsxs as i, jsx as n } from "react/jsx-runtime";
|
|
4
|
+
import { useState as h } from "react";
|
|
4
5
|
import { cn as f } from "../../cn.js";
|
|
5
|
-
import {
|
|
6
|
-
import { Icon as h } from "../../icon/icon.js";
|
|
6
|
+
import { Icon as p } from "../../icon/icon.js";
|
|
7
7
|
import { ListItem as s } from "../../list-item/list-item.js";
|
|
8
|
-
const
|
|
9
|
-
const [r,
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
(
|
|
8
|
+
const g = ({ index: l, item: e }) => {
|
|
9
|
+
const [r, c] = h(!1), o = () => {
|
|
10
|
+
c((t) => !t);
|
|
11
|
+
}, a = (t) => {
|
|
12
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), o());
|
|
13
13
|
};
|
|
14
|
-
return /* @__PURE__ */
|
|
14
|
+
return /* @__PURE__ */ i(
|
|
15
15
|
"div",
|
|
16
16
|
{
|
|
17
17
|
id: `Accordion-item-${l}`,
|
|
@@ -19,25 +19,25 @@ const m = ({ index: l, item: a }) => {
|
|
|
19
19
|
"data-open": r.toString(),
|
|
20
20
|
role: "presentation",
|
|
21
21
|
children: [
|
|
22
|
-
/* @__PURE__ */
|
|
22
|
+
/* @__PURE__ */ n(
|
|
23
23
|
"div",
|
|
24
24
|
{
|
|
25
|
-
"aria-label":
|
|
25
|
+
"aria-label": e.label,
|
|
26
26
|
id: `Accordion-header-${l}`,
|
|
27
27
|
role: "button",
|
|
28
28
|
"aria-expanded": r,
|
|
29
29
|
"aria-controls": `Accordion-slot-${l}`,
|
|
30
30
|
className: "gi-header-accordion-item-toggle",
|
|
31
31
|
tabIndex: 0,
|
|
32
|
-
onClick:
|
|
33
|
-
onKeyDown:
|
|
34
|
-
children: /* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
32
|
+
onClick: o,
|
|
33
|
+
onKeyDown: a,
|
|
34
|
+
children: /* @__PURE__ */ i("div", { children: [
|
|
35
|
+
/* @__PURE__ */ n("span", { className: "gi-text-sm gi-font-bold gi-ml-1", children: e.label }),
|
|
36
|
+
/* @__PURE__ */ n(p, { icon: "chevron_right", className: "gi-accordion-item-icon" })
|
|
37
37
|
] })
|
|
38
38
|
}
|
|
39
39
|
),
|
|
40
|
-
/* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ n(
|
|
41
41
|
"div",
|
|
42
42
|
{
|
|
43
43
|
id: `Accordion-slot-${l}`,
|
|
@@ -45,47 +45,47 @@ const m = ({ index: l, item: a }) => {
|
|
|
45
45
|
className: f("gi-accordion-item-slot", {
|
|
46
46
|
"gi-hidden": !r
|
|
47
47
|
}),
|
|
48
|
-
children:
|
|
48
|
+
children: e.slot
|
|
49
49
|
}
|
|
50
50
|
)
|
|
51
51
|
]
|
|
52
52
|
},
|
|
53
53
|
`Accordion-item-${l}`
|
|
54
54
|
);
|
|
55
|
-
},
|
|
55
|
+
}, v = ({
|
|
56
56
|
items: l,
|
|
57
|
-
secondaryLinks:
|
|
58
|
-
}) => /* @__PURE__ */
|
|
59
|
-
l == null ? void 0 : l.map(({ itemType: r, label:
|
|
60
|
-
const [
|
|
57
|
+
secondaryLinks: e
|
|
58
|
+
}) => /* @__PURE__ */ i("ul", { children: [
|
|
59
|
+
l == null ? void 0 : l.map(({ itemType: r, label: c, ...o }, a) => {
|
|
60
|
+
const [t, d] = [
|
|
61
61
|
r === "link" || r === "custom-link",
|
|
62
62
|
r === "slot"
|
|
63
63
|
];
|
|
64
|
-
if (!
|
|
64
|
+
if (!c)
|
|
65
65
|
return null;
|
|
66
|
-
if (
|
|
67
|
-
return /* @__PURE__ */
|
|
66
|
+
if (t)
|
|
67
|
+
return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
|
|
68
68
|
s,
|
|
69
69
|
{
|
|
70
|
-
href:
|
|
71
|
-
label:
|
|
72
|
-
external:
|
|
73
|
-
slot:
|
|
70
|
+
href: o == null ? void 0 : o.href,
|
|
71
|
+
label: c,
|
|
72
|
+
external: o == null ? void 0 : o.external,
|
|
73
|
+
slot: o == null ? void 0 : o.component
|
|
74
74
|
}
|
|
75
|
-
) }, `navLink-${
|
|
76
|
-
if (
|
|
77
|
-
return /* @__PURE__ */
|
|
78
|
-
|
|
75
|
+
) }, `navLink-${c}-${a}`);
|
|
76
|
+
if (d)
|
|
77
|
+
return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
|
|
78
|
+
g,
|
|
79
79
|
{
|
|
80
|
-
index:
|
|
80
|
+
index: a,
|
|
81
81
|
item: {
|
|
82
|
-
label:
|
|
83
|
-
slot:
|
|
82
|
+
label: c,
|
|
83
|
+
slot: o == null ? void 0 : o.component
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
) }, `toolItems-${
|
|
86
|
+
) }, `toolItems-${c}-${a}`);
|
|
87
87
|
}),
|
|
88
|
-
|
|
88
|
+
e == null ? void 0 : e.map((r, c) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
|
|
89
89
|
s,
|
|
90
90
|
{
|
|
91
91
|
href: r.href,
|
|
@@ -93,39 +93,9 @@ const m = ({ index: l, item: a }) => {
|
|
|
93
93
|
bold: !1,
|
|
94
94
|
slot: r.slot
|
|
95
95
|
}
|
|
96
|
-
) }, `secondary-${r.label}-${
|
|
96
|
+
) }, `secondary-${r.label}-${c}`))
|
|
97
97
|
] });
|
|
98
|
-
function I({ ...l }) {
|
|
99
|
-
return /* @__PURE__ */ t(
|
|
100
|
-
"div",
|
|
101
|
-
{
|
|
102
|
-
id: "HeaderMenuContainer",
|
|
103
|
-
className: "gi-header-menu-container lg:gi-hidden",
|
|
104
|
-
"aria-label": d("header.mobileNavigationMenu", {
|
|
105
|
-
defaultValue: "Mobile Navigation Menu"
|
|
106
|
-
}),
|
|
107
|
-
children: [
|
|
108
|
-
/* @__PURE__ */ o("div", { children: /* @__PURE__ */ o("div", { className: "gi-flex gi-items-center", children: /* @__PURE__ */ t(
|
|
109
|
-
"label",
|
|
110
|
-
{
|
|
111
|
-
htmlFor: "MobileMenuTrigger",
|
|
112
|
-
className: "gi-header-menu-mobile-trigger",
|
|
113
|
-
"aria-label": d("header.closeMobileMenu", {
|
|
114
|
-
defaultValue: "Close Mobile Menu"
|
|
115
|
-
}),
|
|
116
|
-
children: [
|
|
117
|
-
/* @__PURE__ */ o("span", { children: "Close" }),
|
|
118
|
-
/* @__PURE__ */ o(h, { icon: "close" })
|
|
119
|
-
]
|
|
120
|
-
}
|
|
121
|
-
) }) }),
|
|
122
|
-
/* @__PURE__ */ o(p, { ...l })
|
|
123
|
-
]
|
|
124
|
-
}
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
98
|
export {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
I as default
|
|
99
|
+
g as MenuItemAccordion,
|
|
100
|
+
v as MobileHeaderMenuItems
|
|
131
101
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as a, jsxs as s, Fragment as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsx as a, jsxs as s, Fragment as $ } from "react/jsx-runtime";
|
|
2
|
+
import { useState as f } from "react";
|
|
3
3
|
import { cn as n } from "../../cn.js";
|
|
4
|
-
import { DrawerWrapper as
|
|
4
|
+
import { DrawerWrapper as T, DrawerBody as b } from "../../drawer/drawer.js";
|
|
5
5
|
import { translate as c } from "../../i18n/utility.js";
|
|
6
6
|
import { Icon as i } from "../../icon/icon.js";
|
|
7
7
|
import { Input as h } from "../../primitives/input.js";
|
|
8
|
-
import { headerSlotContainerVariants as
|
|
9
|
-
const
|
|
8
|
+
import { headerSlotContainerVariants as C, headerToolItemVariants as p } from "../variants.js";
|
|
9
|
+
const B = ({
|
|
10
10
|
index: e,
|
|
11
11
|
slot: r,
|
|
12
12
|
appearance: t
|
|
@@ -20,21 +20,21 @@ const y = ({
|
|
|
20
20
|
index: e + 1,
|
|
21
21
|
defaultValue: `Slot Container ${e + 1}`
|
|
22
22
|
}),
|
|
23
|
-
className: n(
|
|
23
|
+
className: n(C({ appearance: t }), "gi-hidden"),
|
|
24
24
|
children: r
|
|
25
25
|
}
|
|
26
|
-
),
|
|
26
|
+
), A = ({
|
|
27
27
|
index: e,
|
|
28
|
-
item: { component: r, drawerPosition: t, icon: d, label: l, ariaLabel: m },
|
|
29
|
-
appearance:
|
|
28
|
+
item: { component: r, drawerPosition: t, icon: d, label: l, ariaLabel: m, closeLabel: u },
|
|
29
|
+
appearance: I
|
|
30
30
|
}) => {
|
|
31
|
-
const [o, g] =
|
|
32
|
-
return /* @__PURE__ */ s(
|
|
31
|
+
const [o, g] = f(!1);
|
|
32
|
+
return /* @__PURE__ */ s($, { children: [
|
|
33
33
|
/* @__PURE__ */ s(
|
|
34
34
|
"label",
|
|
35
35
|
{
|
|
36
36
|
htmlFor: `ItemActionDrawerTrigger-${e}`,
|
|
37
|
-
className: p({ appearance:
|
|
37
|
+
className: p({ appearance: I }),
|
|
38
38
|
onClick: () => g(!0),
|
|
39
39
|
children: [
|
|
40
40
|
/* @__PURE__ */ a(
|
|
@@ -86,24 +86,24 @@ const y = ({
|
|
|
86
86
|
}
|
|
87
87
|
),
|
|
88
88
|
/* @__PURE__ */ a(
|
|
89
|
-
|
|
89
|
+
T,
|
|
90
90
|
{
|
|
91
91
|
isOpen: o,
|
|
92
92
|
onClose: () => g(!1),
|
|
93
93
|
position: t || "right",
|
|
94
94
|
closeButtonLabel: c("header.drawer.close", {
|
|
95
|
-
defaultValue: "Close"
|
|
95
|
+
defaultValue: u || "Close"
|
|
96
96
|
}),
|
|
97
97
|
closeButtonSize: "large",
|
|
98
|
-
children: /* @__PURE__ */ a(
|
|
98
|
+
children: /* @__PURE__ */ a(b, { children: r })
|
|
99
99
|
}
|
|
100
100
|
)
|
|
101
101
|
] });
|
|
102
|
-
},
|
|
102
|
+
}, F = ({
|
|
103
103
|
item: e,
|
|
104
104
|
index: r,
|
|
105
105
|
appearance: t
|
|
106
|
-
}) => e.slotAppearance === "drawer" ? /* @__PURE__ */ a(
|
|
106
|
+
}) => e.slotAppearance === "drawer" ? /* @__PURE__ */ a(A, { index: r, item: e, appearance: t }) : /* @__PURE__ */ s(
|
|
107
107
|
"label",
|
|
108
108
|
{
|
|
109
109
|
htmlFor: `ItemActionTrigger-${r}`,
|
|
@@ -149,6 +149,6 @@ const y = ({
|
|
|
149
149
|
}
|
|
150
150
|
);
|
|
151
151
|
export {
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
B as SlotContainer,
|
|
153
|
+
F as SlotItemAction
|
|
154
154
|
};
|
package/dist/header/header.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import "@ogcio/design-system-react/browser-check";
|
|
2
3
|
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
3
4
|
import { useEffect as H, useMemo as T, createElement as I } from "react";
|
|
4
5
|
import { renderToStaticMarkup as v } from "react-dom/server";
|
|
@@ -84,7 +85,7 @@ const K = (r, n, t) => [{
|
|
|
84
85
|
appearance: n
|
|
85
86
|
}
|
|
86
87
|
)) });
|
|
87
|
-
function
|
|
88
|
+
function fe({
|
|
88
89
|
title: r,
|
|
89
90
|
items: n,
|
|
90
91
|
logo: t,
|
|
@@ -216,5 +217,5 @@ function ue({
|
|
|
216
217
|
);
|
|
217
218
|
}
|
|
218
219
|
export {
|
|
219
|
-
|
|
220
|
+
fe as Header
|
|
220
221
|
};
|
package/dist/header/types.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ type CommonProps = {
|
|
|
11
11
|
type ConditionalProps = {
|
|
12
12
|
label?: string;
|
|
13
13
|
ariaLabel?: string;
|
|
14
|
+
closeLabel?: string;
|
|
14
15
|
icon?: IconId;
|
|
15
16
|
component: React.ReactNode;
|
|
16
17
|
href?: never;
|
|
@@ -22,6 +23,7 @@ type ConditionalProps = {
|
|
|
22
23
|
} | {
|
|
23
24
|
label?: never;
|
|
24
25
|
ariaLabel?: string;
|
|
26
|
+
closeLabel?: string;
|
|
25
27
|
icon?: never;
|
|
26
28
|
component?: never;
|
|
27
29
|
href?: never;
|
|
@@ -33,6 +35,7 @@ type ConditionalProps = {
|
|
|
33
35
|
} | {
|
|
34
36
|
label?: string;
|
|
35
37
|
ariaLabel?: string;
|
|
38
|
+
closeLabel?: string;
|
|
36
39
|
icon?: IconId;
|
|
37
40
|
component?: never;
|
|
38
41
|
href?: string;
|
|
@@ -44,6 +47,7 @@ type ConditionalProps = {
|
|
|
44
47
|
} | {
|
|
45
48
|
label?: never;
|
|
46
49
|
ariaLabel?: string;
|
|
50
|
+
closeLabel?: string;
|
|
47
51
|
icon?: never;
|
|
48
52
|
component: React.ReactNode;
|
|
49
53
|
href?: never;
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import "@ogcio/design-system-react/browser-check";
|
|
3
|
+
import { useState as i, useEffect as l } from "react";
|
|
3
4
|
const r = {
|
|
4
5
|
ExtraSmall: "xs",
|
|
5
6
|
Small: "sm",
|
|
6
7
|
Medium: "md",
|
|
7
8
|
Large: "lg",
|
|
8
9
|
ExtraLarge: "xl"
|
|
9
|
-
}, u = (e) => e < 480 ? r.ExtraSmall : e < 640 ? r.Small : e < 768 ? r.Medium : e < 1024 ? r.Large : r.ExtraLarge,
|
|
10
|
-
const [e, a] = i(null), [
|
|
11
|
-
return
|
|
10
|
+
}, u = (e) => e < 480 ? r.ExtraSmall : e < 640 ? r.Small : e < 768 ? r.Medium : e < 1024 ? r.Large : r.ExtraLarge, d = () => {
|
|
11
|
+
const [e, a] = i(null), [o, s] = i(null);
|
|
12
|
+
return l(() => {
|
|
12
13
|
const t = () => {
|
|
13
14
|
const n = globalThis.window.innerWidth;
|
|
14
|
-
|
|
15
|
+
s(n), a(u(n));
|
|
15
16
|
};
|
|
16
17
|
return t(), globalThis.window.addEventListener("resize", t), () => {
|
|
17
18
|
globalThis.window.removeEventListener("resize", t);
|
|
18
19
|
};
|
|
19
|
-
}, []), { breakpoint: e, width:
|
|
20
|
+
}, []), { breakpoint: e, width: o };
|
|
20
21
|
};
|
|
21
22
|
export {
|
|
22
23
|
r as Breakpoint,
|
|
23
|
-
|
|
24
|
+
d as useBreakpoint
|
|
24
25
|
};
|
package/dist/icon/icon.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import "@ogcio/design-system-react/browser-check";
|
|
2
3
|
import { jsx as e } from "react/jsx-runtime";
|
|
3
4
|
import { cn as i } from "../cn.js";
|
|
4
5
|
import b from "./svgs/bluesky.js";
|
|
@@ -10,7 +11,7 @@ import h from "./svgs/threads.js";
|
|
|
10
11
|
import x from "./svgs/tiktok.js";
|
|
11
12
|
import _ from "./svgs/x.js";
|
|
12
13
|
import n from "./svgs/youtube.js";
|
|
13
|
-
function
|
|
14
|
+
function B({
|
|
14
15
|
icon: t,
|
|
15
16
|
size: g = "md",
|
|
16
17
|
filled: c,
|
|
@@ -169,5 +170,5 @@ function j({
|
|
|
169
170
|
);
|
|
170
171
|
}
|
|
171
172
|
export {
|
|
172
|
-
|
|
173
|
+
B as Icon
|
|
173
174
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import "@ogcio/design-system-react/browser-check";
|
|
2
3
|
import { jsx as m } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef as
|
|
4
|
+
import { forwardRef as f } from "react";
|
|
4
5
|
import { isButtonDisabled as B, getButtonIconSizeClass as I, getVariantAppearanceClass as b } from "../button/helpers.js";
|
|
5
6
|
import { cn as d } from "../cn.js";
|
|
6
7
|
import { Icon as g } from "../icon/icon.js";
|
|
7
|
-
const x =
|
|
8
|
+
const x = f(
|
|
8
9
|
({
|
|
9
10
|
icon: i,
|
|
10
11
|
variant: o,
|
|
@@ -17,7 +18,7 @@ const x = p(
|
|
|
17
18
|
dataTestid: a,
|
|
18
19
|
...u
|
|
19
20
|
}, l) => {
|
|
20
|
-
const
|
|
21
|
+
const p = r === "small" ? "sm" : "md";
|
|
21
22
|
return /* @__PURE__ */ m(
|
|
22
23
|
"button",
|
|
23
24
|
{
|
|
@@ -36,7 +37,7 @@ const x = p(
|
|
|
36
37
|
B({ disabled: t, variant: o, appearance: n }),
|
|
37
38
|
e
|
|
38
39
|
),
|
|
39
|
-
children: /* @__PURE__ */ m(g, { size:
|
|
40
|
+
children: /* @__PURE__ */ m(g, { size: p, ...i })
|
|
40
41
|
}
|
|
41
42
|
);
|
|
42
43
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import "@ogcio/design-system-react/browser-check";
|
|
3
|
+
import { jsxs as n, Fragment as p, jsx as i } from "react/jsx-runtime";
|
|
4
|
+
import { forwardRef as u, useId as b } from "react";
|
|
4
5
|
import { cn as x } from "../cn.js";
|
|
5
6
|
import { HintText as g } from "../hint-text/hint-text.js";
|
|
6
7
|
import { Input as k } from "../primitives/input.js";
|
|
@@ -17,7 +18,7 @@ const f = (e) => {
|
|
|
17
18
|
}, C = (e) => {
|
|
18
19
|
let t = "gi-w-8";
|
|
19
20
|
return e === a.Large && (t = "gi-w-11"), e === a.Small && (t = "gi-w-6"), t;
|
|
20
|
-
}, r =
|
|
21
|
+
}, r = u(
|
|
21
22
|
({
|
|
22
23
|
id: e,
|
|
23
24
|
size: t = a.Medium,
|
|
@@ -28,7 +29,7 @@ const f = (e) => {
|
|
|
28
29
|
...d
|
|
29
30
|
}, h) => {
|
|
30
31
|
const c = e || b();
|
|
31
|
-
return /* @__PURE__ */ n(
|
|
32
|
+
return /* @__PURE__ */ n(p, { children: [
|
|
32
33
|
/* @__PURE__ */ n("div", { className: "gi-input-checkbox-container", ...m, children: [
|
|
33
34
|
/* @__PURE__ */ i(
|
|
34
35
|
k,
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import "@ogcio/design-system-react/browser-check";
|
|
3
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
4
|
+
import { useState as f, useEffect as g, Children as v, isValidElement as k, cloneElement as E } from "react";
|
|
5
|
+
const I = ({ size: p, groupId: e, inline: u, onChange: t, children: d, values: n }) => {
|
|
6
|
+
const [l, s] = f(
|
|
6
7
|
n || []
|
|
7
8
|
);
|
|
8
|
-
|
|
9
|
+
g(() => {
|
|
9
10
|
s(n || []);
|
|
10
11
|
}, [n]);
|
|
11
12
|
const o = n === void 0 ? l : n, a = (i) => {
|
|
12
|
-
let
|
|
13
|
-
|
|
13
|
+
let r = [];
|
|
14
|
+
r = o.includes(i) ? o.filter((m) => m !== i) : [...o, i], n === void 0 && s(r), t == null || t(r);
|
|
14
15
|
}, h = v.map(d, (i) => k(i) ? E(i, {
|
|
15
16
|
onChange: () => a(i.props.value),
|
|
16
17
|
checked: o.includes(i.props.value),
|
|
17
18
|
size: p,
|
|
18
19
|
name: e
|
|
19
20
|
}) : i);
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
+
return /* @__PURE__ */ c("div", { className: "gi-input-group-container", children: /* @__PURE__ */ c("div", { className: "gi-input-group-options-container", children: /* @__PURE__ */ c(
|
|
21
22
|
"div",
|
|
22
23
|
{
|
|
23
24
|
className: u ? "gi-input-group-options-inline" : "gi-input-group-options-stacked",
|
|
@@ -26,5 +27,5 @@ const C = ({ size: p, groupId: e, inline: u, onChange: t, children: d, values: n
|
|
|
26
27
|
) }) });
|
|
27
28
|
};
|
|
28
29
|
export {
|
|
29
|
-
|
|
30
|
+
I as InputCheckboxGroup
|
|
30
31
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import "@ogcio/design-system-react/browser-check";
|
|
2
3
|
import { jsx as e, Fragment as c, jsxs as n } from "react/jsx-runtime";
|
|
3
4
|
import { useId as u } from "react";
|
|
4
5
|
import { cn as g } from "../cn.js";
|
|
@@ -10,10 +11,10 @@ import { InputRadioSizeEnum as d } from "./types.js";
|
|
|
10
11
|
const x = (r) => {
|
|
11
12
|
let i = "gi-input-radio-medium";
|
|
12
13
|
return r === d.Large && (i = "gi-input-radio-large"), r === d.Small && (i = "gi-input-radio-small"), i;
|
|
13
|
-
},
|
|
14
|
+
}, y = (r) => {
|
|
14
15
|
let i = "gi-w-8";
|
|
15
16
|
return r === d.Large && (i = "gi-w-11"), r === d.Small && (i = "gi-w-6"), i;
|
|
16
|
-
},
|
|
17
|
+
}, F = ({
|
|
17
18
|
label: r,
|
|
18
19
|
hint: i,
|
|
19
20
|
id: s,
|
|
@@ -63,6 +64,6 @@ const x = (r) => {
|
|
|
63
64
|
] }) });
|
|
64
65
|
};
|
|
65
66
|
export {
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
F as InputRadio,
|
|
68
|
+
y as getRadioWidth
|
|
68
69
|
};
|