@k8o/arte-odyssey 10.6.0 → 10.6.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.
|
@@ -12,6 +12,8 @@ type Props = {
|
|
|
12
12
|
tone: Status;
|
|
13
13
|
message: string | string[];
|
|
14
14
|
action?: AlertAction;
|
|
15
|
+
onClose?: () => void;
|
|
16
|
+
closeLabel?: string;
|
|
15
17
|
} & Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'role' | 'className' | 'style'>;
|
|
16
18
|
declare const Alert: FC<Props>;
|
|
17
19
|
//#endregion
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { cn } from "../../../helpers/cn.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { IconButton } from "../../buttons/icon-button/icon-button.mjs";
|
|
3
|
+
import { AlertIcon, CloseIcon } from "../../icons/lucide.mjs";
|
|
3
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
//#region src/components/feedback/alert/alert.tsx
|
|
5
6
|
const STATUS_LABEL = {
|
|
@@ -8,7 +9,7 @@ const STATUS_LABEL = {
|
|
|
8
9
|
warning: "警告",
|
|
9
10
|
error: "エラー"
|
|
10
11
|
};
|
|
11
|
-
const Alert = ({ tone, message, action, ...rest }) => {
|
|
12
|
+
const Alert = ({ tone, message, action, onClose, closeLabel = "閉じる", ...rest }) => {
|
|
12
13
|
const actionNode = action ? action.renderItem({ children: action.label }) : null;
|
|
13
14
|
const inlineAction = action ? /* @__PURE__ */ jsx("span", {
|
|
14
15
|
className: "ml-1",
|
|
@@ -32,16 +33,32 @@ const Alert = ({ tone, message, action, ...rest }) => {
|
|
|
32
33
|
...rest,
|
|
33
34
|
className: cn("flex items-center gap-3 rounded-lg p-4", tone === "success" && "bg-bg-success", tone === "info" && "bg-bg-info", tone === "warning" && "bg-bg-warning", tone === "error" && "bg-bg-error"),
|
|
34
35
|
role: tone === "error" || tone === "warning" ? "alert" : "status",
|
|
35
|
-
children: [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ jsxs("span", {
|
|
38
|
+
className: cn("shrink-0", tone === "success" && "text-fg-success", tone === "info" && "text-fg-info", tone === "warning" && "text-fg-warning", tone === "error" && "text-fg-error"),
|
|
39
|
+
children: [/* @__PURE__ */ jsx(AlertIcon, {
|
|
40
|
+
size: "md",
|
|
41
|
+
status: tone
|
|
42
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
43
|
+
className: "sr-only",
|
|
44
|
+
children: STATUS_LABEL[tone]
|
|
45
|
+
})]
|
|
46
|
+
}),
|
|
47
|
+
/* @__PURE__ */ jsx("div", {
|
|
48
|
+
className: "min-w-0 flex-1",
|
|
49
|
+
children: messageContent
|
|
50
|
+
}),
|
|
51
|
+
onClose ? /* @__PURE__ */ jsx("span", {
|
|
52
|
+
className: "shrink-0",
|
|
53
|
+
children: /* @__PURE__ */ jsx(IconButton, {
|
|
54
|
+
label: closeLabel,
|
|
55
|
+
onClick: onClose,
|
|
56
|
+
size: "sm",
|
|
57
|
+
tooltipDisabled: true,
|
|
58
|
+
children: /* @__PURE__ */ jsx(CloseIcon, { size: "sm" })
|
|
59
|
+
})
|
|
60
|
+
}) : null
|
|
61
|
+
]
|
|
45
62
|
});
|
|
46
63
|
};
|
|
47
64
|
//#endregion
|
|
@@ -215,9 +215,9 @@ declare const iconButtonProps: z.ZodObject<{
|
|
|
215
215
|
lg: "lg";
|
|
216
216
|
}>>;
|
|
217
217
|
color: z.ZodOptional<z.ZodEnum<{
|
|
218
|
+
transparent: "transparent";
|
|
218
219
|
primary: "primary";
|
|
219
220
|
secondary: "secondary";
|
|
220
|
-
transparent: "transparent";
|
|
221
221
|
base: "base";
|
|
222
222
|
}>>;
|
|
223
223
|
}, z.core.$strip>;
|
|
@@ -374,8 +374,8 @@ declare const toastProps: z.ZodObject<{
|
|
|
374
374
|
}, z.core.$strip>;
|
|
375
375
|
declare const separatorProps: z.ZodObject<{
|
|
376
376
|
orientation: z.ZodOptional<z.ZodEnum<{
|
|
377
|
-
vertical: "vertical";
|
|
378
377
|
horizontal: "horizontal";
|
|
378
|
+
vertical: "vertical";
|
|
379
379
|
}>>;
|
|
380
380
|
color: z.ZodOptional<z.ZodEnum<{
|
|
381
381
|
base: "base";
|
|
@@ -389,18 +389,18 @@ declare const stackProps: z.ZodObject<{
|
|
|
389
389
|
column: "column";
|
|
390
390
|
}>>;
|
|
391
391
|
gap: z.ZodOptional<z.ZodEnum<{
|
|
392
|
-
none: "none";
|
|
393
392
|
sm: "sm";
|
|
394
393
|
md: "md";
|
|
395
394
|
lg: "lg";
|
|
396
395
|
xl: "xl";
|
|
396
|
+
none: "none";
|
|
397
397
|
}>>;
|
|
398
398
|
padding: z.ZodOptional<z.ZodEnum<{
|
|
399
|
-
none: "none";
|
|
400
399
|
sm: "sm";
|
|
401
400
|
md: "md";
|
|
402
401
|
lg: "lg";
|
|
403
402
|
xl: "xl";
|
|
403
|
+
none: "none";
|
|
404
404
|
}>>;
|
|
405
405
|
align: z.ZodOptional<z.ZodEnum<{
|
|
406
406
|
start: "start";
|
|
@@ -419,11 +419,11 @@ declare const gridProps: z.ZodObject<{
|
|
|
419
419
|
cols: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<6>, z.ZodLiteral<"auto-fill">, z.ZodLiteral<"auto-fit">]>>;
|
|
420
420
|
minItemSize: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<24>, z.ZodLiteral<32>, z.ZodLiteral<40>, z.ZodLiteral<48>, z.ZodLiteral<64>, z.ZodLiteral<80>]>>;
|
|
421
421
|
gap: z.ZodOptional<z.ZodEnum<{
|
|
422
|
-
none: "none";
|
|
423
422
|
sm: "sm";
|
|
424
423
|
md: "md";
|
|
425
424
|
lg: "lg";
|
|
426
425
|
xl: "xl";
|
|
426
|
+
none: "none";
|
|
427
427
|
}>>;
|
|
428
428
|
}, z.core.$strip>;
|
|
429
429
|
declare const scrollLinkedProps: z.ZodObject<{}, z.core.$strip>;
|
|
@@ -42,18 +42,18 @@ declare const catalog: import("@json-render/core").Catalog<{
|
|
|
42
42
|
column: "column";
|
|
43
43
|
}>>;
|
|
44
44
|
gap: z.ZodOptional<z.ZodEnum<{
|
|
45
|
-
none: "none";
|
|
46
45
|
sm: "sm";
|
|
47
46
|
md: "md";
|
|
48
47
|
lg: "lg";
|
|
49
48
|
xl: "xl";
|
|
49
|
+
none: "none";
|
|
50
50
|
}>>;
|
|
51
51
|
padding: z.ZodOptional<z.ZodEnum<{
|
|
52
|
-
none: "none";
|
|
53
52
|
sm: "sm";
|
|
54
53
|
md: "md";
|
|
55
54
|
lg: "lg";
|
|
56
55
|
xl: "xl";
|
|
56
|
+
none: "none";
|
|
57
57
|
}>>;
|
|
58
58
|
align: z.ZodOptional<z.ZodEnum<{
|
|
59
59
|
start: "start";
|
|
@@ -76,11 +76,11 @@ declare const catalog: import("@json-render/core").Catalog<{
|
|
|
76
76
|
cols: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<6>, z.ZodLiteral<"auto-fill">, z.ZodLiteral<"auto-fit">]>>;
|
|
77
77
|
minItemSize: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<24>, z.ZodLiteral<32>, z.ZodLiteral<40>, z.ZodLiteral<48>, z.ZodLiteral<64>, z.ZodLiteral<80>]>>;
|
|
78
78
|
gap: z.ZodOptional<z.ZodEnum<{
|
|
79
|
-
none: "none";
|
|
80
79
|
sm: "sm";
|
|
81
80
|
md: "md";
|
|
82
81
|
lg: "lg";
|
|
83
82
|
xl: "xl";
|
|
83
|
+
none: "none";
|
|
84
84
|
}>>;
|
|
85
85
|
}, z.core.$strip>;
|
|
86
86
|
slots: string[];
|
|
@@ -192,8 +192,8 @@ declare const catalog: import("@json-render/core").Catalog<{
|
|
|
192
192
|
Separator: {
|
|
193
193
|
props: z.ZodObject<{
|
|
194
194
|
orientation: z.ZodOptional<z.ZodEnum<{
|
|
195
|
-
vertical: "vertical";
|
|
196
195
|
horizontal: "horizontal";
|
|
196
|
+
vertical: "vertical";
|
|
197
197
|
}>>;
|
|
198
198
|
color: z.ZodOptional<z.ZodEnum<{
|
|
199
199
|
base: "base";
|
|
@@ -508,9 +508,9 @@ declare const catalog: import("@json-render/core").Catalog<{
|
|
|
508
508
|
lg: "lg";
|
|
509
509
|
}>>;
|
|
510
510
|
color: z.ZodOptional<z.ZodEnum<{
|
|
511
|
+
transparent: "transparent";
|
|
511
512
|
primary: "primary";
|
|
512
513
|
secondary: "secondary";
|
|
513
|
-
transparent: "transparent";
|
|
514
514
|
base: "base";
|
|
515
515
|
}>>;
|
|
516
516
|
}, z.core.$strip>;
|
package/package.json
CHANGED