@caseparts-org/caseblocks 0.0.256 → 0.0.257
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/assets/Admonition.css +1 -1
- package/dist/assets/Root.css +1 -1
- package/dist/molecules/Admonition/Admonition.d.ts +2 -2
- package/dist/molecules/Admonition/Admonition.js +49 -35
- package/dist/molecules/Admonition/Admonition.stories.d.ts +4 -2
- package/dist/molecules/Admonition/Admonition.stories.js +22 -8
- package/dist/molecules/Markdown/Markdown.js +1 -1
- package/dist/molecules/Markdown/Markdown.stories.js +2 -2
- package/dist/molecules/Markdown/remarkAdmonition.js +1 -1
- package/dist/styles/tokens.css +15 -0
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
-
export type AdmonitionVariant = "note" | "tip" | "
|
|
2
|
+
export type AdmonitionVariant = "note" | "tip" | "attention" | "caution" | "warning" | "unknown";
|
|
3
3
|
export type AdmonitionProps = ComponentPropsWithoutRef<"aside"> & {
|
|
4
4
|
admonitionType: string;
|
|
5
5
|
variant: AdmonitionVariant | string;
|
|
6
|
-
icon?: string;
|
|
6
|
+
icon?: string | false;
|
|
7
7
|
title?: string;
|
|
8
8
|
children?: ReactNode;
|
|
9
9
|
};
|
|
@@ -1,46 +1,60 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Icon as
|
|
3
|
-
import { Text as
|
|
4
|
-
import { c as
|
|
5
|
-
import '../../assets/Admonition.css';const N = "
|
|
6
|
-
admonition:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { jsxs as d, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Icon as f } from "../../atoms/Icon/Icon.js";
|
|
3
|
+
import { Text as j } from "../../atoms/Text/Text.js";
|
|
4
|
+
import { c as s } from "../../clsx-OuTLNxxd.js";
|
|
5
|
+
import '../../assets/Admonition.css';const p = "_admonition_18jak_1", N = "_admonitionBorderLeft_18jak_8", g = "_admonitionPanel_18jak_13", k = "_admonitionWithIcon_18jak_25", C = "_admonitionIcon_18jak_29", h = "_admonitionContent_18jak_33", I = "_admonitionHeader_18jak_39", T = "_admonitionTitle_18jak_45", A = "_admonitionBody_18jak_52", B = "_admonitionNote_18jak_67", W = "_admonitionTip_18jak_73", x = "_admonitionAttention_18jak_88", L = "_admonitionCaution_18jak_103", P = "_admonitionWarning_18jak_118", w = "_admonitionNeutral_18jak_133", n = {
|
|
6
|
+
admonition: p,
|
|
7
|
+
admonitionBorderLeft: N,
|
|
8
|
+
admonitionPanel: g,
|
|
9
|
+
admonitionWithIcon: k,
|
|
10
|
+
admonitionIcon: C,
|
|
11
|
+
admonitionContent: h,
|
|
12
|
+
admonitionHeader: I,
|
|
13
|
+
admonitionTitle: T,
|
|
14
|
+
admonitionBody: A,
|
|
15
|
+
admonitionNote: B,
|
|
16
|
+
admonitionTip: W,
|
|
17
|
+
admonitionAttention: x,
|
|
18
|
+
admonitionCaution: L,
|
|
19
|
+
admonitionWarning: P,
|
|
20
|
+
admonitionNeutral: w
|
|
16
21
|
}, y = {
|
|
17
22
|
note: "Note",
|
|
18
23
|
tip: "Tip",
|
|
19
|
-
|
|
24
|
+
attention: "Attention",
|
|
20
25
|
caution: "Caution",
|
|
21
26
|
warning: "Warning"
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
}, H = {
|
|
28
|
+
note: "fa-regular fa-note",
|
|
29
|
+
tip: "fa-regular fa-circle-info",
|
|
30
|
+
attention: "fa-solid fa-triangle-exclamation",
|
|
31
|
+
caution: "fa-solid fa-circle-exclamation",
|
|
32
|
+
warning: "fa-solid fa-octagon-exclamation"
|
|
33
|
+
}, z = (o) => {
|
|
34
|
+
const a = o.trim().replace(/[_-]+/g, " ");
|
|
35
|
+
return a ? a.split(/\s+/).map((i) => `${i.charAt(0).toUpperCase()}${i.slice(1).toLowerCase()}`).join(" ") : "Admonition";
|
|
36
|
+
}, E = (o) => o === "note" ? n.admonitionNote : o === "tip" ? n.admonitionTip : o === "attention" ? n.admonitionAttention : o === "caution" ? n.admonitionCaution : o === "warning" ? n.admonitionWarning : n.admonitionNeutral;
|
|
37
|
+
function $({
|
|
38
|
+
admonitionType: o,
|
|
39
|
+
variant: a,
|
|
29
40
|
icon: i,
|
|
30
|
-
title:
|
|
31
|
-
className:
|
|
32
|
-
children:
|
|
33
|
-
...
|
|
41
|
+
title: c,
|
|
42
|
+
className: r,
|
|
43
|
+
children: m,
|
|
44
|
+
...l
|
|
34
45
|
}) {
|
|
35
|
-
const
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
|
|
41
|
-
|
|
46
|
+
const _ = c ?? y[o] ?? z(o), u = E(a), e = i === !1 ? void 0 : (i == null ? void 0 : i.trim()) || H[a];
|
|
47
|
+
return /* @__PURE__ */ d("aside", { ...l, className: s(n.admonition, u, r), "data-admonition": o, children: [
|
|
48
|
+
/* @__PURE__ */ t("span", { className: n.admonitionBorderLeft, "aria-hidden": "true" }),
|
|
49
|
+
/* @__PURE__ */ d("div", { className: s(n.admonitionPanel, e && n.admonitionWithIcon), children: [
|
|
50
|
+
e ? /* @__PURE__ */ t("span", { className: n.admonitionIcon, "aria-hidden": "true", children: /* @__PURE__ */ t(f, { iconKey: e, size: "md" }, e) }) : null,
|
|
51
|
+
/* @__PURE__ */ d("div", { className: n.admonitionContent, children: [
|
|
52
|
+
/* @__PURE__ */ t("div", { className: n.admonitionHeader, children: /* @__PURE__ */ t(j, { size: "md", weight: "semibold", className: n.admonitionTitle, children: _ }) }),
|
|
53
|
+
m != null ? /* @__PURE__ */ t("div", { className: n.admonitionBody, children: m }) : null
|
|
54
|
+
] })
|
|
55
|
+
] })
|
|
42
56
|
] });
|
|
43
57
|
}
|
|
44
58
|
export {
|
|
45
|
-
|
|
59
|
+
$ as Admonition
|
|
46
60
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
2
|
type DemoArgs = {
|
|
3
3
|
admonitionType: string;
|
|
4
|
-
variant: "note" | "tip" | "
|
|
4
|
+
variant: "note" | "tip" | "attention" | "caution" | "warning" | "unknown";
|
|
5
5
|
title?: string;
|
|
6
|
-
icon?: string;
|
|
6
|
+
icon?: string | false;
|
|
7
7
|
body: string;
|
|
8
8
|
};
|
|
9
9
|
declare const meta: Meta<DemoArgs>;
|
|
@@ -11,3 +11,5 @@ export default meta;
|
|
|
11
11
|
type Story = StoryObj<DemoArgs>;
|
|
12
12
|
export declare const Playground: Story;
|
|
13
13
|
export declare const UnknownType: Story;
|
|
14
|
+
export declare const DefaultIcon: Story;
|
|
15
|
+
export declare const WithoutIcon: Story;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { Admonition as o } from "./Admonition.js";
|
|
3
|
-
const
|
|
3
|
+
const a = {
|
|
4
4
|
title: "Case Parts/Molecules/Admonition",
|
|
5
5
|
component: o,
|
|
6
6
|
tags: ["autodocs"],
|
|
@@ -11,7 +11,7 @@ const r = {
|
|
|
11
11
|
admonitionType: { control: "text" },
|
|
12
12
|
variant: {
|
|
13
13
|
control: { type: "radio" },
|
|
14
|
-
options: ["note", "tip", "
|
|
14
|
+
options: ["note", "tip", "attention", "caution", "warning", "unknown"]
|
|
15
15
|
},
|
|
16
16
|
title: { control: "text" },
|
|
17
17
|
icon: { control: "text" },
|
|
@@ -21,10 +21,9 @@ const r = {
|
|
|
21
21
|
admonitionType: "warning",
|
|
22
22
|
variant: "warning",
|
|
23
23
|
title: "Electrical Hazard",
|
|
24
|
-
icon: "fa-solid fa-bolt",
|
|
25
24
|
body: "Disconnect power before servicing this unit."
|
|
26
25
|
}
|
|
27
|
-
},
|
|
26
|
+
}, r = {
|
|
28
27
|
render: (t) => /* @__PURE__ */ n("div", { style: { width: 640 }, children: /* @__PURE__ */ n(
|
|
29
28
|
o,
|
|
30
29
|
{
|
|
@@ -35,7 +34,7 @@ const r = {
|
|
|
35
34
|
children: /* @__PURE__ */ n("p", { children: t.body })
|
|
36
35
|
}
|
|
37
36
|
) })
|
|
38
|
-
},
|
|
37
|
+
}, c = {
|
|
39
38
|
args: {
|
|
40
39
|
admonitionType: "custom-alert",
|
|
41
40
|
variant: "unknown",
|
|
@@ -43,9 +42,24 @@ const r = {
|
|
|
43
42
|
icon: "info",
|
|
44
43
|
body: "This renders neutral styling while preserving the custom type."
|
|
45
44
|
}
|
|
45
|
+
}, l = {
|
|
46
|
+
args: {
|
|
47
|
+
admonitionType: "attention",
|
|
48
|
+
variant: "attention",
|
|
49
|
+
body: "This uses the attention default icon."
|
|
50
|
+
}
|
|
51
|
+
}, s = {
|
|
52
|
+
args: {
|
|
53
|
+
admonitionType: "note",
|
|
54
|
+
variant: "note",
|
|
55
|
+
icon: !1,
|
|
56
|
+
body: "This omits the default icon."
|
|
57
|
+
}
|
|
46
58
|
};
|
|
47
59
|
export {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
60
|
+
l as DefaultIcon,
|
|
61
|
+
r as Playground,
|
|
62
|
+
c as UnknownType,
|
|
63
|
+
s as WithoutIcon,
|
|
64
|
+
a as default
|
|
51
65
|
};
|
|
@@ -8,7 +8,7 @@ const w = {
|
|
|
8
8
|
tags: ["autodocs"]
|
|
9
9
|
}, r = `Kason 171 Latch
|
|
10
10
|
|
|
11
|
-
:::
|
|
11
|
+
:::attention[Compatibility]
|
|
12
12
|
Fits only selected revisions.
|
|
13
13
|
:::
|
|
14
14
|
|
|
@@ -118,7 +118,7 @@ Another valid numeric: [172].` })
|
|
|
118
118
|
Confirm model and serial number before ordering.
|
|
119
119
|
:::
|
|
120
120
|
|
|
121
|
-
:::
|
|
121
|
+
:::attention[Compatibility]
|
|
122
122
|
Fits only selected revisions.
|
|
123
123
|
:::
|
|
124
124
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const y = /^[a-z][a-z0-9_-]*/, v = /^\s*(?:[a-z][a-z0-9_-]*="(?:[^"\\]|\\.)*"(?:[ \t]+[a-z][a-z0-9_-]*="(?:[^"\\]|\\.)*")*)?\s*$/, x = /([a-z][a-z0-9_-]*)="((?:[^"\\]|\\.)*)"/g, h = /^:::[ \t]*$/, A = /* @__PURE__ */ new Set(["note", "tip", "
|
|
1
|
+
const y = /^[a-z][a-z0-9_-]*/, v = /^\s*(?:[a-z][a-z0-9_-]*="(?:[^"\\]|\\.)*"(?:[ \t]+[a-z][a-z0-9_-]*="(?:[^"\\]|\\.)*")*)?\s*$/, x = /([a-z][a-z0-9_-]*)="((?:[^"\\]|\\.)*)"/g, h = /^:::[ \t]*$/, A = /* @__PURE__ */ new Set(["note", "tip", "attention", "caution", "warning"]), f = (t) => t.type === "text" && typeof t.value == "string" ? t.value : t.type === "break" ? `
|
|
2
2
|
` : (t.type === "inlineCode" || t.type === "html") && typeof t.value == "string" ? t.value : Array.isArray(t.children) && t.children.length > 0 ? t.children.map(f).join("") : "", p = (t) => {
|
|
3
3
|
if (t.type !== "paragraph" || !t.children || t.children.length === 0) return null;
|
|
4
4
|
const n = t.children.map(f).join("");
|
package/dist/styles/tokens.css
CHANGED
|
@@ -51,6 +51,11 @@
|
|
|
51
51
|
--color-alerts-light-red: #fdf2f2;
|
|
52
52
|
--color-alerts-light-teal-blue: #eaf2f9;
|
|
53
53
|
--color-alerts-light-yellow: #fff6d9;
|
|
54
|
+
--color-alerts-medium-gray: #d5d5d5;
|
|
55
|
+
--color-alerts-medium-green: #bbd8bb;
|
|
56
|
+
--color-alerts-medium-orange: #dfcfc4;
|
|
57
|
+
--color-alerts-medium-red: #eed7d7;
|
|
58
|
+
--color-alerts-medium-yellow: #e7e2ce;
|
|
54
59
|
--color-alerts-masked-edit-mode: #00bce2;
|
|
55
60
|
--color-alerts-success: #00aa00;
|
|
56
61
|
--color-alerts-warning: #f06721;
|
|
@@ -160,15 +165,20 @@
|
|
|
160
165
|
/* Value */
|
|
161
166
|
/* color */
|
|
162
167
|
--border-border-black-box: var(--surface-surface-tertiary-btn);
|
|
168
|
+
--border-border-attention-medium: var(--color-alerts-medium-yellow);
|
|
169
|
+
--border-border-caution-medium: var(--color-alerts-medium-orange);
|
|
163
170
|
--border-border-error-warning: var(--color-alerts-error-warning);
|
|
164
171
|
--border-border-help: var(--color-alerts-caution-tips);
|
|
172
|
+
--border-border-note-medium: var(--color-alerts-medium-gray);
|
|
165
173
|
--border-border-primary: var(--color-neutrals-neutral-2);
|
|
166
174
|
--border-border-primary-btn: var(--color-brand-primary-primary-teal-blue);
|
|
167
175
|
--border-border-primary-chit: var(--color-brand-primary-primary-teal-blue);
|
|
168
176
|
--border-border-secondary: var(--color-brand-secondary-md-teal-blue);
|
|
169
177
|
--border-border-secondary-btn: var(--color-neutrals-neutral-2);
|
|
170
178
|
--border-border-success: var(--color-alerts-success);
|
|
179
|
+
--border-border-tip-medium: var(--color-alerts-medium-green);
|
|
171
180
|
--border-border-warning: var(--color-alerts-warning);
|
|
181
|
+
--border-border-warning-medium: var(--color-alerts-medium-red);
|
|
172
182
|
--icons-icon-caution-tips: #ffd041;
|
|
173
183
|
--icons-icon-default: var(--color-brand-primary-primary-black);
|
|
174
184
|
--icons-icon-error-warning: var(--color-alerts-error-warning);
|
|
@@ -205,10 +215,15 @@
|
|
|
205
215
|
--surface-surface-search-bar: var(--color-neutrals-neutral-1);
|
|
206
216
|
--surface-surface-secondary: var(--color-neutrals-neutral-1);
|
|
207
217
|
--surface-surface-secondary-btn: var(--color-brand-primary-white);
|
|
218
|
+
--surface-surface-attention: var(--color-alerts-light-yellow);
|
|
219
|
+
--surface-surface-caution: var(--color-alerts-light-orange);
|
|
220
|
+
--surface-surface-note: var(--surface-surface-secondary);
|
|
221
|
+
--surface-surface-tip: var(--color-alerts-light-green);
|
|
208
222
|
--surface-surface-tertiary: var(--color-brand-primary-primary-black);
|
|
209
223
|
--surface-surface-tertiary-btn: var(--color-brand-primary-primary-black);
|
|
210
224
|
--surface-surface-tertiary-btn-focus: var(--color-brand-primary-white);
|
|
211
225
|
--surface-surface-text-links: var(--color-brand-primary-white);
|
|
226
|
+
--surface-surface-warning: var(--color-alerts-light-red);
|
|
212
227
|
--surface-surface-searchBar: var(--color-neutrals-neutral-1);
|
|
213
228
|
--text-text-caution: var(--color-brand-primary-primary-tangerine);
|
|
214
229
|
--text-text-disabled: var(--color-neutrals-text-disabled);
|