@ogcio/design-system-react 1.21.0 → 1.22.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/alert/alert.d.ts +3 -90
- package/dist/alert/alert.js +43 -74
- package/dist/alert/types.d.ts +11 -0
- package/dist/alert/types.js +1 -0
- package/dist/alert/variants.d.ts +76 -0
- package/dist/alert/variants.js +36 -0
- package/dist/autocomplete/autocomplete.js +105 -97
- package/dist/checkbox/types.d.ts +0 -1
- package/dist/drawer/drawer.d.ts +2 -3
- package/dist/drawer/drawer.js +59 -36
- package/dist/forms/form-field/form-field.d.ts +2 -3
- package/dist/forms/form-field/form-field.js +69 -60
- package/dist/forms/form-field/types.d.ts +3 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +236 -234
- package/dist/input-checkbox/input-checkbox.d.ts +1 -1
- package/dist/input-checkbox/input-checkbox.js +33 -35
- package/dist/input-checkbox/types.d.ts +0 -1
- package/dist/input-checkbox/types.js +2 -3
- package/dist/link/link.d.ts +2 -2
- package/dist/link/link.js +18 -19
- package/dist/modal/modal.js +158 -178
- package/dist/select/select-next.js +151 -144
- package/dist/styles.css +1 -1
- package/dist/toast/ds-toast.d.ts +1 -1
- package/dist/toast/ds-toast.js +29 -40
- package/dist/toast/toast.d.ts +1 -1
- package/dist/toast/toast.js +65 -57
- package/dist/toast/types.d.ts +3 -2
- package/package.json +4 -4
package/dist/alert/alert.d.ts
CHANGED
|
@@ -1,90 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
variant: {
|
|
5
|
-
info: {
|
|
6
|
-
base: string;
|
|
7
|
-
baseDismissible: string;
|
|
8
|
-
};
|
|
9
|
-
danger: {
|
|
10
|
-
base: string;
|
|
11
|
-
baseDismissible: string;
|
|
12
|
-
};
|
|
13
|
-
success: {
|
|
14
|
-
base: string;
|
|
15
|
-
baseDismissible: string;
|
|
16
|
-
};
|
|
17
|
-
warning: {
|
|
18
|
-
base: string;
|
|
19
|
-
baseDismissible: string;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
}, {
|
|
23
|
-
base: string;
|
|
24
|
-
baseDismissible: string;
|
|
25
|
-
container: string;
|
|
26
|
-
heading: string;
|
|
27
|
-
dismiss: string;
|
|
28
|
-
}, undefined, TVConfig<V, EV>, {
|
|
29
|
-
variant: {
|
|
30
|
-
info: {
|
|
31
|
-
base: string;
|
|
32
|
-
baseDismissible: string;
|
|
33
|
-
};
|
|
34
|
-
danger: {
|
|
35
|
-
base: string;
|
|
36
|
-
baseDismissible: string;
|
|
37
|
-
};
|
|
38
|
-
success: {
|
|
39
|
-
base: string;
|
|
40
|
-
baseDismissible: string;
|
|
41
|
-
};
|
|
42
|
-
warning: {
|
|
43
|
-
base: string;
|
|
44
|
-
baseDismissible: string;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
}, {
|
|
48
|
-
base: string;
|
|
49
|
-
baseDismissible: string;
|
|
50
|
-
container: string;
|
|
51
|
-
heading: string;
|
|
52
|
-
dismiss: string;
|
|
53
|
-
}, import('tailwind-variants').TVReturnType<{
|
|
54
|
-
variant: {
|
|
55
|
-
info: {
|
|
56
|
-
base: string;
|
|
57
|
-
baseDismissible: string;
|
|
58
|
-
};
|
|
59
|
-
danger: {
|
|
60
|
-
base: string;
|
|
61
|
-
baseDismissible: string;
|
|
62
|
-
};
|
|
63
|
-
success: {
|
|
64
|
-
base: string;
|
|
65
|
-
baseDismissible: string;
|
|
66
|
-
};
|
|
67
|
-
warning: {
|
|
68
|
-
base: string;
|
|
69
|
-
baseDismissible: string;
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
}, {
|
|
73
|
-
base: string;
|
|
74
|
-
baseDismissible: string;
|
|
75
|
-
container: string;
|
|
76
|
-
heading: string;
|
|
77
|
-
dismiss: string;
|
|
78
|
-
}, undefined, TVConfig<V, EV>, unknown, unknown, undefined>>;
|
|
79
|
-
type AlertProps = {
|
|
80
|
-
variant?: VariantProps<typeof alertVariants>['variant'];
|
|
81
|
-
title?: string;
|
|
82
|
-
children?: ReactNode;
|
|
83
|
-
dismissible?: boolean;
|
|
84
|
-
dataTestid?: string;
|
|
85
|
-
className?: string;
|
|
86
|
-
onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
87
|
-
};
|
|
88
|
-
declare function Alert({ title, children, variant, dismissible, onClose, dataTestid, className, }: AlertProps): import("react/jsx-runtime").JSX.Element | null;
|
|
89
|
-
export { Alert, alertVariants };
|
|
90
|
-
export type { AlertProps };
|
|
1
|
+
import { AlertProps } from './types.js';
|
|
2
|
+
declare function Alert({ title, children, variant, showIcon, dismissible, onClose, className, ...props }: AlertProps): import("react/jsx-runtime").JSX.Element | null;
|
|
3
|
+
export { Alert };
|
package/dist/alert/alert.js
CHANGED
|
@@ -1,116 +1,86 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "@ogcio/design-system-react/browser-check";
|
|
3
|
-
import { jsxs as n, jsx as
|
|
3
|
+
import { jsxs as n, jsx as s } from "react/jsx-runtime";
|
|
4
4
|
import { useState as v } from "react";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
baseDismissible: "gi-alert-base-dismissible",
|
|
14
|
-
container: "gi-alert-container",
|
|
15
|
-
heading: "gi-alert-title",
|
|
16
|
-
dismiss: "gi-alert-dismiss"
|
|
17
|
-
},
|
|
18
|
-
variants: {
|
|
19
|
-
variant: {
|
|
20
|
-
info: {
|
|
21
|
-
base: "gi-alert-info",
|
|
22
|
-
baseDismissible: "gi-alert-info"
|
|
23
|
-
},
|
|
24
|
-
danger: {
|
|
25
|
-
base: "gi-alert-danger",
|
|
26
|
-
baseDismissible: "gi-alert-danger"
|
|
27
|
-
},
|
|
28
|
-
success: {
|
|
29
|
-
base: "gi-alert-success",
|
|
30
|
-
baseDismissible: "gi-alert-success"
|
|
31
|
-
},
|
|
32
|
-
warning: {
|
|
33
|
-
base: "gi-alert-warning",
|
|
34
|
-
baseDismissible: "gi-alert-warning"
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
defaultVariants: {
|
|
39
|
-
variant: "info"
|
|
40
|
-
}
|
|
41
|
-
}), I = ({ variant: a }) => {
|
|
42
|
-
let s;
|
|
43
|
-
switch (a) {
|
|
5
|
+
import { cn as c } from "../cn.js";
|
|
6
|
+
import { translate as D } from "../i18n/utility.js";
|
|
7
|
+
import { Icon as w } from "../icon/icon.js";
|
|
8
|
+
import { IconButton as x } from "../icon-button/icon-button.js";
|
|
9
|
+
import { alertVariants as I } from "./variants.js";
|
|
10
|
+
const V = ({ variant: r }) => {
|
|
11
|
+
let a;
|
|
12
|
+
switch (r) {
|
|
44
13
|
case "warning": {
|
|
45
|
-
|
|
14
|
+
a = "warning";
|
|
46
15
|
break;
|
|
47
16
|
}
|
|
48
17
|
case "success": {
|
|
49
|
-
|
|
18
|
+
a = "check_circle";
|
|
50
19
|
break;
|
|
51
20
|
}
|
|
52
21
|
case "danger": {
|
|
53
|
-
|
|
22
|
+
a = "error";
|
|
54
23
|
break;
|
|
55
24
|
}
|
|
56
25
|
default:
|
|
57
|
-
|
|
26
|
+
a = "info";
|
|
58
27
|
}
|
|
59
|
-
return
|
|
28
|
+
return a;
|
|
60
29
|
};
|
|
61
30
|
function y({
|
|
62
|
-
title:
|
|
63
|
-
children:
|
|
64
|
-
variant:
|
|
31
|
+
title: r,
|
|
32
|
+
children: a,
|
|
33
|
+
variant: e = "info",
|
|
34
|
+
showIcon: o = !0,
|
|
65
35
|
dismissible: t,
|
|
66
|
-
onClose:
|
|
67
|
-
|
|
68
|
-
|
|
36
|
+
onClose: i,
|
|
37
|
+
className: l,
|
|
38
|
+
...m
|
|
69
39
|
}) {
|
|
70
|
-
const [
|
|
71
|
-
variant:
|
|
72
|
-
}),
|
|
73
|
-
return
|
|
40
|
+
const [d, u] = v(!1), { base: f, heading: p, container: g, dismiss: b, baseDismissible: h } = I({
|
|
41
|
+
variant: e
|
|
42
|
+
}), k = t ? h : f;
|
|
43
|
+
return d ? null : /* @__PURE__ */ n(
|
|
74
44
|
"div",
|
|
75
45
|
{
|
|
76
|
-
className:
|
|
77
|
-
"data-testid": c,
|
|
46
|
+
className: c(k(), l, "gi-not-prose"),
|
|
78
47
|
role: "alert",
|
|
79
48
|
"aria-live": "assertive",
|
|
49
|
+
...m,
|
|
80
50
|
children: [
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
|
|
51
|
+
o ? /* @__PURE__ */ s(
|
|
52
|
+
w,
|
|
83
53
|
{
|
|
84
|
-
icon:
|
|
54
|
+
icon: V({ variant: e }),
|
|
85
55
|
ariaHidden: !0,
|
|
86
56
|
className: "gi-alert-icon",
|
|
87
|
-
"data-variant":
|
|
57
|
+
"data-variant": e
|
|
88
58
|
}
|
|
89
|
-
),
|
|
59
|
+
) : null,
|
|
90
60
|
/* @__PURE__ */ n(
|
|
91
61
|
"div",
|
|
92
62
|
{
|
|
93
|
-
className:
|
|
94
|
-
"gi-gap-1":
|
|
63
|
+
className: c(g(), {
|
|
64
|
+
"gi-gap-1": r
|
|
95
65
|
}),
|
|
96
66
|
children: [
|
|
97
|
-
|
|
98
|
-
|
|
67
|
+
r && /* @__PURE__ */ s("p", { className: p(), children: r }),
|
|
68
|
+
a
|
|
99
69
|
]
|
|
100
70
|
}
|
|
101
71
|
),
|
|
102
|
-
t && /* @__PURE__ */
|
|
103
|
-
|
|
72
|
+
t && /* @__PURE__ */ s(
|
|
73
|
+
x,
|
|
104
74
|
{
|
|
105
|
-
onClick: (
|
|
106
|
-
|
|
75
|
+
onClick: (N) => {
|
|
76
|
+
u(!0), i == null || i(N);
|
|
107
77
|
},
|
|
108
|
-
className:
|
|
78
|
+
className: b(),
|
|
109
79
|
size: "small",
|
|
110
80
|
appearance: "dark",
|
|
111
81
|
variant: "flat",
|
|
112
82
|
icon: { icon: "close" },
|
|
113
|
-
"aria-label":
|
|
83
|
+
"aria-label": D("alert.dismissAlert", {
|
|
114
84
|
defaultValue: "Dismiss alert"
|
|
115
85
|
})
|
|
116
86
|
}
|
|
@@ -120,6 +90,5 @@ function y({
|
|
|
120
90
|
);
|
|
121
91
|
}
|
|
122
92
|
export {
|
|
123
|
-
y as Alert
|
|
124
|
-
x as alertVariants
|
|
93
|
+
y as Alert
|
|
125
94
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { VariantProps } from 'tailwind-variants';
|
|
3
|
+
import { alertVariants } from './variants.js';
|
|
4
|
+
export type AlertProps = ComponentPropsWithoutRef<'div'> & {
|
|
5
|
+
variant?: VariantProps<typeof alertVariants>['variant'];
|
|
6
|
+
title?: string;
|
|
7
|
+
dismissible?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
10
|
+
showIcon?: boolean;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export declare const alertVariants: import('tailwind-variants').TVReturnType<{
|
|
2
|
+
variant: {
|
|
3
|
+
info: {
|
|
4
|
+
base: string;
|
|
5
|
+
baseDismissible: string;
|
|
6
|
+
};
|
|
7
|
+
danger: {
|
|
8
|
+
base: string;
|
|
9
|
+
baseDismissible: string;
|
|
10
|
+
};
|
|
11
|
+
success: {
|
|
12
|
+
base: string;
|
|
13
|
+
baseDismissible: string;
|
|
14
|
+
};
|
|
15
|
+
warning: {
|
|
16
|
+
base: string;
|
|
17
|
+
baseDismissible: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
}, {
|
|
21
|
+
base: string;
|
|
22
|
+
baseDismissible: string;
|
|
23
|
+
container: string;
|
|
24
|
+
heading: string;
|
|
25
|
+
dismiss: string;
|
|
26
|
+
}, undefined, TVConfig<V, EV>, {
|
|
27
|
+
variant: {
|
|
28
|
+
info: {
|
|
29
|
+
base: string;
|
|
30
|
+
baseDismissible: string;
|
|
31
|
+
};
|
|
32
|
+
danger: {
|
|
33
|
+
base: string;
|
|
34
|
+
baseDismissible: string;
|
|
35
|
+
};
|
|
36
|
+
success: {
|
|
37
|
+
base: string;
|
|
38
|
+
baseDismissible: string;
|
|
39
|
+
};
|
|
40
|
+
warning: {
|
|
41
|
+
base: string;
|
|
42
|
+
baseDismissible: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
}, {
|
|
46
|
+
base: string;
|
|
47
|
+
baseDismissible: string;
|
|
48
|
+
container: string;
|
|
49
|
+
heading: string;
|
|
50
|
+
dismiss: string;
|
|
51
|
+
}, import('tailwind-variants').TVReturnType<{
|
|
52
|
+
variant: {
|
|
53
|
+
info: {
|
|
54
|
+
base: string;
|
|
55
|
+
baseDismissible: string;
|
|
56
|
+
};
|
|
57
|
+
danger: {
|
|
58
|
+
base: string;
|
|
59
|
+
baseDismissible: string;
|
|
60
|
+
};
|
|
61
|
+
success: {
|
|
62
|
+
base: string;
|
|
63
|
+
baseDismissible: string;
|
|
64
|
+
};
|
|
65
|
+
warning: {
|
|
66
|
+
base: string;
|
|
67
|
+
baseDismissible: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
}, {
|
|
71
|
+
base: string;
|
|
72
|
+
baseDismissible: string;
|
|
73
|
+
container: string;
|
|
74
|
+
heading: string;
|
|
75
|
+
dismiss: string;
|
|
76
|
+
}, undefined, TVConfig<V, EV>, unknown, unknown, undefined>>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { c as i } from "../index-CB-zPpNk.js";
|
|
2
|
+
const a = i({
|
|
3
|
+
slots: {
|
|
4
|
+
base: "gi-alert-base",
|
|
5
|
+
baseDismissible: "gi-alert-base-dismissible",
|
|
6
|
+
container: "gi-alert-container",
|
|
7
|
+
heading: "gi-alert-title",
|
|
8
|
+
dismiss: "gi-alert-dismiss"
|
|
9
|
+
},
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
info: {
|
|
13
|
+
base: "gi-alert-info",
|
|
14
|
+
baseDismissible: "gi-alert-info"
|
|
15
|
+
},
|
|
16
|
+
danger: {
|
|
17
|
+
base: "gi-alert-danger",
|
|
18
|
+
baseDismissible: "gi-alert-danger"
|
|
19
|
+
},
|
|
20
|
+
success: {
|
|
21
|
+
base: "gi-alert-success",
|
|
22
|
+
baseDismissible: "gi-alert-success"
|
|
23
|
+
},
|
|
24
|
+
warning: {
|
|
25
|
+
base: "gi-alert-warning",
|
|
26
|
+
baseDismissible: "gi-alert-warning"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
defaultVariants: {
|
|
31
|
+
variant: "info"
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
export {
|
|
35
|
+
a as alertVariants
|
|
36
|
+
};
|