@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.
@@ -1,9 +1,9 @@
1
1
  import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
- export type AdmonitionVariant = "note" | "tip" | "important" | "caution" | "warning" | "unknown";
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 m, jsx as a } from "react/jsx-runtime";
2
- import { Icon as l } from "../../atoms/Icon/Icon.js";
3
- import { Text as u } from "../../atoms/Text/Text.js";
4
- import { c as p } from "../../clsx-OuTLNxxd.js";
5
- import '../../assets/Admonition.css';const N = "_admonition_u2oen_1", g = "_admonitionHeader_u2oen_10", C = "_admonitionTitle_u2oen_16", T = "_admonitionBody_u2oen_20", h = "_admonitionNote_u2oen_32", I = "_admonitionTip_u2oen_36", f = "_admonitionImportant_u2oen_41", x = "_admonitionCaution_u2oen_46", B = "_admonitionWarning_u2oen_52", W = "_admonitionNeutral_u2oen_58", o = {
6
- admonition: N,
7
- admonitionHeader: g,
8
- admonitionTitle: C,
9
- admonitionBody: T,
10
- admonitionNote: h,
11
- admonitionTip: I,
12
- admonitionImportant: f,
13
- admonitionCaution: x,
14
- admonitionWarning: B,
15
- admonitionNeutral: W
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
- important: "Important",
24
+ attention: "Attention",
20
25
  caution: "Caution",
21
26
  warning: "Warning"
22
- }, A = (n) => {
23
- const t = n.trim().replace(/[_-]+/g, " ");
24
- return t ? t.split(/\s+/).map((i) => `${i.charAt(0).toUpperCase()}${i.slice(1).toLowerCase()}`).join(" ") : "Admonition";
25
- }, H = (n) => n === "note" ? o.admonitionNote : n === "tip" ? o.admonitionTip : n === "important" ? o.admonitionImportant : n === "caution" ? o.admonitionCaution : n === "warning" ? o.admonitionWarning : o.admonitionNeutral;
26
- function b({
27
- admonitionType: n,
28
- variant: t,
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: e,
31
- className: d,
32
- children: s,
33
- ...r
41
+ title: c,
42
+ className: r,
43
+ children: m,
44
+ ...l
34
45
  }) {
35
- const c = e ?? y[n] ?? A(n), _ = H(t);
36
- return /* @__PURE__ */ m("aside", { ...r, className: p(o.admonition, _, d), "data-admonition": n, children: [
37
- /* @__PURE__ */ m("div", { className: o.admonitionHeader, children: [
38
- i ? /* @__PURE__ */ a("span", { className: o.admonitionIcon, "aria-hidden": "true", children: /* @__PURE__ */ a(l, { iconKey: i, size: "xs" }) }) : null,
39
- /* @__PURE__ */ a(u, { size: "sm", weight: "semibold", className: o.admonitionTitle, children: c })
40
- ] }),
41
- /* @__PURE__ */ a("div", { className: o.admonitionBody, children: s })
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
- b as Admonition
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" | "important" | "caution" | "warning" | "unknown";
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 r = {
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", "important", "caution", "warning", "unknown"]
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
- }, a = {
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
- }, l = {
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
- a as Playground,
49
- l as UnknownType,
50
- r as default
60
+ l as DefaultIcon,
61
+ r as Playground,
62
+ c as UnknownType,
63
+ s as WithoutIcon,
64
+ a as default
51
65
  };
@@ -8678,7 +8678,7 @@ const Ef = "_markdown_1kgcy_1", or = {
8678
8678
  className: t,
8679
8679
  admonitionType: o,
8680
8680
  variant: l,
8681
- icon: a,
8681
+ icon: a === "none" ? !1 : a,
8682
8682
  title: u,
8683
8683
  children: n
8684
8684
  }
@@ -8,7 +8,7 @@ const w = {
8
8
  tags: ["autodocs"]
9
9
  }, r = `Kason 171 Latch
10
10
 
11
- :::important[Compatibility]
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
- :::important[Compatibility]
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", "important", "caution", "warning"]), f = (t) => t.type === "text" && typeof t.value == "string" ? t.value : t.type === "break" ? `
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("");
@@ -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);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@caseparts-org/caseblocks",
3
3
  "private": false,
4
- "version": "0.0.256",
4
+ "version": "0.0.257",
5
5
  "type": "module",
6
6
  "module": "dist/main.js",
7
7
  "types": "dist/main.d.ts",