radiant-docs 0.1.30 → 0.1.33
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/package.json
CHANGED
|
@@ -11,6 +11,15 @@ interface Props {
|
|
|
11
11
|
|
|
12
12
|
const { title, icon, defaultOpen = false, titleSize } = Astro.props;
|
|
13
13
|
|
|
14
|
+
const TITLE_SIZE_CLASS = {
|
|
15
|
+
xs: "text-xs",
|
|
16
|
+
sm: "text-sm",
|
|
17
|
+
md: "text-base",
|
|
18
|
+
lg: "text-lg",
|
|
19
|
+
xl: "text-xl",
|
|
20
|
+
"2xl": "text-2xl",
|
|
21
|
+
} as const;
|
|
22
|
+
|
|
14
23
|
validateProps(
|
|
15
24
|
"Accordion",
|
|
16
25
|
{ title, icon, defaultOpen, titleSize },
|
|
@@ -51,7 +60,7 @@ validateProps(
|
|
|
51
60
|
class="pb-4 pt-4 group flex w-full items-center justify-between gap-2.5 text-left font-medium text-neutral-800"
|
|
52
61
|
>
|
|
53
62
|
{icon && <Icon name={icon} />}
|
|
54
|
-
<span class:list={["flex-1", titleSize &&
|
|
63
|
+
<span class:list={["flex-1", titleSize && TITLE_SIZE_CLASS[titleSize]]}
|
|
55
64
|
>{title}</span
|
|
56
65
|
>
|
|
57
66
|
<Icon
|
|
@@ -4,10 +4,10 @@ import warningIcon from "../../assets/icons/warning.svg?url";
|
|
|
4
4
|
import infoIcon from "../../assets/icons/info.svg?url";
|
|
5
5
|
import lightbulbIcon from "../../assets/icons/lightbulb.svg?url";
|
|
6
6
|
import dangerIcon from "../../assets/icons/danger.svg?url";
|
|
7
|
-
import
|
|
7
|
+
import successIcon from "../../assets/icons/check.svg?url";
|
|
8
8
|
import { validateProps } from "../../lib/component-error";
|
|
9
9
|
|
|
10
|
-
type CalloutType = "warning" | "info" | "tip" | "danger" | "
|
|
10
|
+
type CalloutType = "warning" | "info" | "tip" | "danger" | "success";
|
|
11
11
|
|
|
12
12
|
interface Props {
|
|
13
13
|
type?: CalloutType;
|
|
@@ -18,31 +18,36 @@ interface Props {
|
|
|
18
18
|
|
|
19
19
|
const typeDefaults: Record<
|
|
20
20
|
CalloutType,
|
|
21
|
-
{ icon: string; color: string; title: string }
|
|
21
|
+
{ icon: string; color: string; iconColor: string; title: string }
|
|
22
22
|
> = {
|
|
23
23
|
warning: {
|
|
24
24
|
icon: warningIcon,
|
|
25
25
|
color: "bg-amber-500",
|
|
26
|
+
iconColor: "text-amber-500",
|
|
26
27
|
title: "Warning",
|
|
27
28
|
},
|
|
28
29
|
info: {
|
|
29
30
|
icon: infoIcon,
|
|
30
31
|
color: "bg-sky-600/80",
|
|
32
|
+
iconColor: "text-sky-600/80",
|
|
31
33
|
title: "Info",
|
|
32
34
|
},
|
|
33
35
|
tip: {
|
|
34
36
|
icon: lightbulbIcon,
|
|
35
37
|
color: "bg-yellow-500",
|
|
38
|
+
iconColor: "text-yellow-500",
|
|
36
39
|
title: "Tip",
|
|
37
40
|
},
|
|
38
41
|
danger: {
|
|
39
42
|
icon: dangerIcon,
|
|
40
43
|
color: "bg-red-600",
|
|
44
|
+
iconColor: "text-red-600",
|
|
41
45
|
title: "Danger",
|
|
42
46
|
},
|
|
43
|
-
|
|
44
|
-
icon:
|
|
47
|
+
success: {
|
|
48
|
+
icon: successIcon,
|
|
45
49
|
color: "bg-green-600",
|
|
50
|
+
iconColor: "text-green-600",
|
|
46
51
|
title: "Success",
|
|
47
52
|
},
|
|
48
53
|
};
|
|
@@ -53,7 +58,7 @@ validateProps(
|
|
|
53
58
|
"Callout",
|
|
54
59
|
{ type, title, icon, color },
|
|
55
60
|
{
|
|
56
|
-
type: { enum: ["warning", "info", "tip", "danger", "
|
|
61
|
+
type: { enum: ["warning", "info", "tip", "danger", "success"] },
|
|
57
62
|
title: { type: "string" },
|
|
58
63
|
icon: { type: "string" },
|
|
59
64
|
color: { type: "string" },
|
|
@@ -82,7 +87,11 @@ const resolvedTitle = title ?? defaults.title;
|
|
|
82
87
|
<div class="flex items-center gap-2 not-prose mb-3">
|
|
83
88
|
{
|
|
84
89
|
icon ? (
|
|
85
|
-
<Icon
|
|
90
|
+
<Icon
|
|
91
|
+
name={icon}
|
|
92
|
+
class={`size-4 ${defaults.iconColor}`}
|
|
93
|
+
style={color && { color: color }}
|
|
94
|
+
/>
|
|
86
95
|
) : (
|
|
87
96
|
<img src={defaults.icon} alt="" width="16" height="16" class="" />
|
|
88
97
|
)
|
|
@@ -117,7 +117,7 @@ export function validateType(
|
|
|
117
117
|
*
|
|
118
118
|
* @example
|
|
119
119
|
* validateProps("Callout", Astro.props, {
|
|
120
|
-
* type: { enum: ["warning", "info", "tip", "danger", "
|
|
120
|
+
* type: { enum: ["warning", "info", "tip", "danger", "success"] },
|
|
121
121
|
* title: { type: "string" },
|
|
122
122
|
* }, Astro.url.pathname);
|
|
123
123
|
*/
|