@ogcio/design-system-react 1.17.0 → 1.17.1
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 +0 -1
- package/dist/alert/alert.d.ts +2 -1
- package/dist/alert/alert.js +32 -31
- package/dist/drawer/drawer.js +19 -12
- package/dist/icon-button/icon-button.js +18 -16
- package/dist/modal/modal.d.ts +2 -1
- package/dist/modal/modal.js +160 -148
- package/dist/styles.css +1 -1
- package/dist/utils/utilities.d.ts +1 -0
- package/dist/utils/utilities.js +25 -19
- package/package.json +2 -2
package/dist/alert/alert.d.ts
CHANGED
|
@@ -82,8 +82,9 @@ type AlertProps = {
|
|
|
82
82
|
children?: ReactNode;
|
|
83
83
|
dismissible?: boolean;
|
|
84
84
|
dataTestid?: string;
|
|
85
|
+
className?: string;
|
|
85
86
|
onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
86
87
|
};
|
|
87
|
-
declare function Alert({ title, children, variant, dismissible, onClose, dataTestid, }: AlertProps): import("react/jsx-runtime").JSX.Element | null;
|
|
88
|
+
declare function Alert({ title, children, variant, dismissible, onClose, dataTestid, className, }: AlertProps): import("react/jsx-runtime").JSX.Element | null;
|
|
88
89
|
export { Alert, alertVariants };
|
|
89
90
|
export type { AlertProps };
|
package/dist/alert/alert.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as n, jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import { useState as
|
|
4
|
-
import { c as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { translate as
|
|
7
|
-
import { Icon as
|
|
8
|
-
import { IconButton as
|
|
9
|
-
const
|
|
3
|
+
import { useState as h } from "react";
|
|
4
|
+
import { c as v } from "../index-CB-zPpNk.js";
|
|
5
|
+
import { cn as k } from "../cn.js";
|
|
6
|
+
import { translate as w } from "../i18n/utility.js";
|
|
7
|
+
import { Icon as N } from "../icon/icon.js";
|
|
8
|
+
import { IconButton as V } from "../icon-button/icon-button.js";
|
|
9
|
+
const x = v({
|
|
10
10
|
slots: {
|
|
11
11
|
base: "gi-alert-base",
|
|
12
12
|
baseDismissible: "gi-alert-base-dismissible",
|
|
@@ -30,16 +30,16 @@ const V = h({
|
|
|
30
30
|
},
|
|
31
31
|
warning: {
|
|
32
32
|
base: "gi-alert-warning",
|
|
33
|
-
baseDismissible: "gi-alert-
|
|
33
|
+
baseDismissible: "gi-alert-warning"
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
defaultVariants: {
|
|
38
38
|
variant: "info"
|
|
39
39
|
}
|
|
40
|
-
}),
|
|
40
|
+
}), I = ({ variant: i }) => {
|
|
41
41
|
let s;
|
|
42
|
-
switch (
|
|
42
|
+
switch (i) {
|
|
43
43
|
case "warning": {
|
|
44
44
|
s = "warning";
|
|
45
45
|
break;
|
|
@@ -57,50 +57,51 @@ const V = h({
|
|
|
57
57
|
}
|
|
58
58
|
return s;
|
|
59
59
|
};
|
|
60
|
-
function
|
|
61
|
-
title:
|
|
60
|
+
function q({
|
|
61
|
+
title: i,
|
|
62
62
|
children: s,
|
|
63
|
-
variant:
|
|
63
|
+
variant: a = "info",
|
|
64
64
|
dismissible: t,
|
|
65
|
-
onClose:
|
|
66
|
-
dataTestid: l
|
|
65
|
+
onClose: e,
|
|
66
|
+
dataTestid: l,
|
|
67
|
+
className: c
|
|
67
68
|
}) {
|
|
68
|
-
const [
|
|
69
|
-
variant:
|
|
70
|
-
}),
|
|
71
|
-
return
|
|
69
|
+
const [o, m] = h(!1), { base: d, heading: g, container: b, dismiss: f, baseDismissible: u } = x({
|
|
70
|
+
variant: a
|
|
71
|
+
}), p = t ? u : d;
|
|
72
|
+
return o ? null : /* @__PURE__ */ n(
|
|
72
73
|
"div",
|
|
73
74
|
{
|
|
74
|
-
className:
|
|
75
|
+
className: k(p(), c, "gi-not-prose"),
|
|
75
76
|
"data-testid": l,
|
|
76
77
|
role: "alert",
|
|
77
78
|
"aria-live": "assertive",
|
|
78
79
|
children: [
|
|
79
80
|
/* @__PURE__ */ r(
|
|
80
|
-
|
|
81
|
+
N,
|
|
81
82
|
{
|
|
82
|
-
icon:
|
|
83
|
+
icon: I({ variant: a }),
|
|
83
84
|
ariaHidden: !0,
|
|
84
85
|
className: "gi-alert-icon",
|
|
85
|
-
"data-variant":
|
|
86
|
+
"data-variant": a
|
|
86
87
|
}
|
|
87
88
|
),
|
|
88
89
|
/* @__PURE__ */ n("div", { className: b(), children: [
|
|
89
|
-
/* @__PURE__ */ r("p", { className:
|
|
90
|
+
/* @__PURE__ */ r("p", { className: g(), children: i }),
|
|
90
91
|
s
|
|
91
92
|
] }),
|
|
92
93
|
t && /* @__PURE__ */ r(
|
|
93
|
-
|
|
94
|
+
V,
|
|
94
95
|
{
|
|
95
|
-
onClick: (
|
|
96
|
-
|
|
96
|
+
onClick: (D) => {
|
|
97
|
+
m(!0), e == null || e(D);
|
|
97
98
|
},
|
|
98
|
-
className:
|
|
99
|
+
className: f(),
|
|
99
100
|
size: "small",
|
|
100
101
|
appearance: "dark",
|
|
101
102
|
variant: "flat",
|
|
102
103
|
icon: { icon: "close" },
|
|
103
|
-
"aria-label":
|
|
104
|
+
"aria-label": w("alert.dismissAlert", {
|
|
104
105
|
defaultValue: "Dismiss alert"
|
|
105
106
|
})
|
|
106
107
|
}
|
|
@@ -110,6 +111,6 @@ function _({
|
|
|
110
111
|
);
|
|
111
112
|
}
|
|
112
113
|
export {
|
|
113
|
-
|
|
114
|
-
|
|
114
|
+
q as Alert,
|
|
115
|
+
x as alertVariants
|
|
115
116
|
};
|
package/dist/drawer/drawer.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useState as D, cloneElement as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { ModalBody as
|
|
2
|
+
import { jsx as a, jsxs as x, Fragment as y } from "react/jsx-runtime";
|
|
3
|
+
import { useState as D, cloneElement as M } from "react";
|
|
4
|
+
import { cn as r } from "../cn.js";
|
|
5
|
+
import { ModalBody as O, ModalFooter as F, ModalWrapper as N } from "../modal/modal.js";
|
|
6
6
|
const b = ({
|
|
7
7
|
children: o,
|
|
8
8
|
className: e,
|
|
9
|
-
...
|
|
10
|
-
}) => /* @__PURE__ */
|
|
9
|
+
...s
|
|
10
|
+
}) => /* @__PURE__ */ a(N, { className: r("gi-drawer-container", e), ...s, children: o }), I = ({
|
|
11
11
|
children: o,
|
|
12
12
|
triggerButton: e,
|
|
13
|
-
startsOpen:
|
|
13
|
+
startsOpen: s,
|
|
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(!!s), w = () => n(!0), C = () => n(!1), h = M(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__ */ a(
|
|
30
30
|
b,
|
|
31
31
|
{
|
|
32
32
|
children: o,
|
|
@@ -39,11 +39,18 @@ const b = ({
|
|
|
39
39
|
}
|
|
40
40
|
)
|
|
41
41
|
] });
|
|
42
|
-
}, S = ({ children: o, className: e }) => /* @__PURE__ */
|
|
42
|
+
}, S = ({ children: o, className: e }) => /* @__PURE__ */ a(
|
|
43
|
+
O,
|
|
44
|
+
{
|
|
45
|
+
includeModalClass: !1,
|
|
46
|
+
className: r("gi-drawer-body", e),
|
|
47
|
+
children: o
|
|
48
|
+
}
|
|
49
|
+
), T = ({
|
|
43
50
|
children: o,
|
|
44
51
|
className: e,
|
|
45
|
-
stacked:
|
|
46
|
-
}) => /* @__PURE__ */
|
|
52
|
+
stacked: s
|
|
53
|
+
}) => /* @__PURE__ */ a(F, { stacked: s, className: r("gi-drawer-footer", e), children: o });
|
|
47
54
|
export {
|
|
48
55
|
I as Drawer,
|
|
49
56
|
S as DrawerBody,
|
|
@@ -1,40 +1,42 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as m } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { isButtonDisabled as
|
|
5
|
-
import { cn as
|
|
3
|
+
import { forwardRef as p } from "react";
|
|
4
|
+
import { isButtonDisabled as B, getButtonIconSizeClass as I, getVariantAppearanceClass as b } from "../button/helpers.js";
|
|
5
|
+
import { cn as d } from "../cn.js";
|
|
6
6
|
import { Icon as g } from "../icon/icon.js";
|
|
7
|
-
const x =
|
|
7
|
+
const x = p(
|
|
8
8
|
({
|
|
9
9
|
icon: i,
|
|
10
|
-
variant:
|
|
10
|
+
variant: o,
|
|
11
11
|
appearance: n,
|
|
12
12
|
size: r,
|
|
13
|
-
disabled:
|
|
13
|
+
disabled: t,
|
|
14
14
|
onClick: s,
|
|
15
15
|
className: e = "",
|
|
16
16
|
type: c = "button",
|
|
17
|
+
dataTestid: a,
|
|
17
18
|
...u
|
|
18
|
-
},
|
|
19
|
-
const
|
|
19
|
+
}, l) => {
|
|
20
|
+
const f = r === "small" ? "sm" : "md";
|
|
20
21
|
return /* @__PURE__ */ m(
|
|
21
22
|
"button",
|
|
22
23
|
{
|
|
23
|
-
ref:
|
|
24
|
+
ref: l,
|
|
24
25
|
type: c,
|
|
25
|
-
"aria-disabled":
|
|
26
|
-
disabled:
|
|
26
|
+
"aria-disabled": t,
|
|
27
|
+
disabled: t,
|
|
27
28
|
role: "button",
|
|
28
29
|
onClick: s,
|
|
30
|
+
"data-testid": a,
|
|
29
31
|
...u,
|
|
30
|
-
className:
|
|
32
|
+
className: d(
|
|
31
33
|
"gi-btn",
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
b({ disabled: t, variant: o, appearance: n }),
|
|
35
|
+
I(r),
|
|
36
|
+
B({ disabled: t, variant: o, appearance: n }),
|
|
35
37
|
e
|
|
36
38
|
),
|
|
37
|
-
children: /* @__PURE__ */ m(g, { size:
|
|
39
|
+
children: /* @__PURE__ */ m(g, { size: f, ...i })
|
|
38
40
|
}
|
|
39
41
|
);
|
|
40
42
|
}
|
package/dist/modal/modal.d.ts
CHANGED
|
@@ -6,9 +6,10 @@ export declare const ModalTitle: {
|
|
|
6
6
|
({ children, as, ...props }: HeadingProps): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
|
-
export declare const ModalBody: ({ children, className, }: {
|
|
9
|
+
export declare const ModalBody: ({ children, className, includeModalClass, }: {
|
|
10
10
|
children: ReactNode;
|
|
11
11
|
className?: string;
|
|
12
|
+
includeModalClass?: boolean;
|
|
12
13
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export declare const ModalFooter: {
|
|
14
15
|
({ className, children, orientation, dataModalSize, stacked, }: ModalFooterProps): import("react/jsx-runtime").JSX.Element;
|