radiant-docs 0.1.31 → 0.1.34

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "radiant-docs",
3
- "version": "0.1.31",
3
+ "version": "0.1.34",
4
4
  "description": "CLI tool for previewing Radiant documentation locally",
5
5
  "type": "module",
6
6
  "bin": {
@@ -33,10 +33,16 @@ const {
33
33
  bodyDefaultKind,
34
34
  } = Astro.props;
35
35
  const config = await getConfig();
36
- const proxyEnabled = config.playground?.proxy !== false;
36
+ const configuredProxyUrl =
37
+ typeof import.meta.env.PUBLIC_PROXY_URL === "string"
38
+ ? import.meta.env.PUBLIC_PROXY_URL.trim()
39
+ : "";
37
40
  const proxyUrl =
38
- import.meta.env.PUBLIC_PROXY_URL ||
39
- "https://docs-proxy.stefanjoseph-dev.workers.dev";
41
+ configuredProxyUrl ||
42
+ (import.meta.env.DEV
43
+ ? "https://docs-proxy-dev.stefanjoseph-dev.workers.dev"
44
+ : "");
45
+ const proxyEnabled = config.playground?.proxy !== false && proxyUrl.length > 0;
40
46
  const formattedBodyDescription = bodyDescription
41
47
  ? await renderMarkdown(bodyDescription)
42
48
  : null;
@@ -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 checkIcon from "../../assets/icons/check.svg?url";
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" | "check";
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
- check: {
44
- icon: checkIcon,
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", "check"] },
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 name={icon} class="size-4" style={color && { color: color }} />
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", "check"] },
120
+ * type: { enum: ["warning", "info", "tip", "danger", "success"] },
121
121
  * title: { type: "string" },
122
122
  * }, Astro.url.pathname);
123
123
  */