@stackone/malachite 2.124.0 → 2.125.0

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,14 +1,14 @@
1
- import { jsxs as p, jsx as x } from "react/jsx-runtime";
2
- import { FOCUS_RING as S } from "./focusRing.js";
3
- import { resolveRel as R } from "./linkRel.js";
4
- import { safeHref as T } from "./safeHref.js";
5
- const j = "inline-flex items-center justify-center gap-1.5 font-medium whitespace-nowrap shrink-0 transition-colors duration-150 ease-in-out", y = {
1
+ import { jsxs as c, jsx as k } from "react/jsx-runtime";
2
+ import { FOCUS_RING as g } from "./focusRing.js";
3
+ import { resolveRel as j } from "./linkRel.js";
4
+ import { safeHref as B } from "./safeHref.js";
5
+ const w = "inline-flex items-center justify-center gap-1.5 font-medium whitespace-nowrap shrink-0 transition-colors duration-150 ease-in-out", z = {
6
6
  pill: "rounded-[var(--malachite-radius-10,10px)]",
7
7
  tab: "rounded-b-[var(--malachite-radius-10,10px)] rounded-t-none"
8
- }, B = {
8
+ }, W = {
9
9
  default: "border-0",
10
10
  assistant: "border border-solid border-[var(--malachite-tag-assistant-border)]"
11
- }, $ = "bg-[var(--malachite-card-background)] text-[var(--malachite-assistant-foreground)]", w = {
11
+ }, A = "bg-[var(--malachite-card-background)] text-[var(--malachite-assistant-foreground)]", H = {
12
12
  // For a row that labels other content rather than being read on its own — a context
13
13
  // strip above a chat, say. The only size that drops below the 13px the others share.
14
14
  xsmall: {
@@ -26,7 +26,7 @@ const j = "inline-flex items-center justify-center gap-1.5 font-medium whitespac
26
26
  padding: "px-2.5",
27
27
  paddingWithIcon: "pl-1.5 pr-2"
28
28
  }
29
- }, z = "bg-[var(--malachite-pillbutton-static-background)] text-[var(--malachite-pillbutton-static-foreground)]", W = "active:opacity-60 cursor-pointer", H = {
29
+ }, P = "bg-[var(--malachite-pillbutton-static-background)] text-[var(--malachite-pillbutton-static-foreground)]", D = "active:opacity-60 cursor-pointer", F = {
30
30
  default: {
31
31
  base: "bg-[var(--malachite-pillbutton-background)] text-[var(--malachite-pillbutton-foreground)]",
32
32
  selected: "bg-[var(--malachite-pillbutton-hover-background)] text-[var(--malachite-pillbutton-hover-foreground)]",
@@ -37,53 +37,76 @@ const j = "inline-flex items-center justify-center gap-1.5 font-medium whitespac
37
37
  selected: "bg-[var(--malachite-pillbutton-inverted-hover-background)] text-[var(--malachite-pillbutton-inverted-hover-foreground)]",
38
38
  hover: "hover:bg-[var(--malachite-pillbutton-inverted-hover-background)] hover:text-[var(--malachite-pillbutton-inverted-hover-foreground)] active:bg-[var(--malachite-pillbutton-inverted-pressed-background)] active:text-[var(--malachite-pillbutton-inverted-pressed-foreground)]"
39
39
  }
40
- }, K = ({
41
- label: r = "Label",
42
- icon: l,
43
- className: k = "",
44
- selected: A = !1,
45
- disabled: m = !1,
46
- interactive: v = !0,
47
- size: C = "small",
48
- variant: L = "default",
49
- shape: I = "pill",
50
- tone: b = "default",
51
- trailingIcon: g,
52
- onClick: n,
53
- href: E,
54
- target: f,
40
+ }, Z = ({
41
+ label: a = "Label",
42
+ icon: d,
43
+ className: C = "",
44
+ selected: L = !1,
45
+ pressed: r,
46
+ disabled: u = !1,
47
+ interactive: f = !0,
48
+ size: I = "small",
49
+ variant: E = "default",
50
+ shape: N = "pill",
51
+ tone: x = "default",
52
+ trailingIcon: S,
53
+ onClick: h,
54
+ href: O,
55
+ target: $,
55
56
  rel: _
56
57
  }) => {
57
- const i = w[C], N = l ? i.paddingWithIcon : i.padding, t = H[L], o = v && !m, s = T(E), a = o && (!!n || !!s), c = a ? ` ${W}` : "";
58
+ const p = H[I], R = d ? p.paddingWithIcon : p.padding, t = F[E], m = f && !u, n = B(O), i = m && (!!h || !!n), v = i ? ` ${D}` : "", b = !n && r !== void 0, T = b ? r : L;
58
59
  let e;
59
- b === "assistant" ? e = a ? `${$}${c}` : $ : v ? A ? e = o ? `${t.selected}${c}` : t.selected : o ? e = `${t.base} ${t.hover}${c}` : e = t.base : e = z;
60
- const O = m ? "opacity-50 cursor-not-allowed pointer-events-none" : "", d = `${j} ${y[I]} ${i.text} ${N} ${B[b]} ${e} ${O} ${k}`, u = l ? /* @__PURE__ */ x("span", { className: "inline-flex items-center justify-center w-4 h-4 shrink-0 [&>img]:max-w-full [&>img]:max-h-full [&>img]:object-contain", children: l }) : null, h = g ? /* @__PURE__ */ x("span", { className: "inline-flex shrink-0 items-center justify-center", children: g }) : null;
61
- return a && s ? /* @__PURE__ */ p(
60
+ x === "assistant" ? e = i ? `${A}${v}` : A : f ? T ? e = m ? `${t.selected}${v}` : t.selected : m ? e = `${t.base} ${t.hover}${v}` : e = t.base : e = P;
61
+ const y = u ? "opacity-50 cursor-not-allowed pointer-events-none" : "", l = `${w} ${z[N]} ${p.text} ${R} ${W[x]} ${e} ${y} ${C}`, o = d ? /* @__PURE__ */ k("span", { className: "inline-flex items-center justify-center w-4 h-4 shrink-0 [&>img]:max-w-full [&>img]:max-h-full [&>img]:object-contain", children: d }) : null, s = S ? /* @__PURE__ */ k("span", { className: "inline-flex shrink-0 items-center justify-center", children: S }) : null;
62
+ return i && n ? /* @__PURE__ */ c(
62
63
  "a",
63
64
  {
64
- href: s,
65
- target: f,
66
- rel: R(_, f),
67
- className: `${S} ${d} no-underline`,
68
- onClick: n,
65
+ href: n,
66
+ target: $,
67
+ rel: j(_, $),
68
+ className: `${g} ${l} no-underline`,
69
+ onClick: h,
69
70
  children: [
70
- u,
71
- r,
72
- h
71
+ o,
72
+ a,
73
+ s
73
74
  ]
74
75
  }
75
- ) : a ? /* @__PURE__ */ p("button", { type: "button", className: `${S} ${d}`, onClick: n, children: [
76
- u,
77
- r,
78
- h
79
- ] }) : /* @__PURE__ */ p("div", { className: d, children: [
80
- u,
81
- r,
82
- h
76
+ ) : i ? /* @__PURE__ */ c(
77
+ "button",
78
+ {
79
+ type: "button",
80
+ "aria-pressed": b ? r : void 0,
81
+ className: `${g} ${l}`,
82
+ onClick: h,
83
+ children: [
84
+ o,
85
+ a,
86
+ s
87
+ ]
88
+ }
89
+ ) : b && u ? /* @__PURE__ */ c(
90
+ "button",
91
+ {
92
+ type: "button",
93
+ "aria-pressed": r,
94
+ "aria-disabled": "true",
95
+ className: `${g} ${l}`,
96
+ children: [
97
+ o,
98
+ a,
99
+ s
100
+ ]
101
+ }
102
+ ) : /* @__PURE__ */ c("div", { className: l, children: [
103
+ o,
104
+ a,
105
+ s
83
106
  ] });
84
107
  };
85
108
  export {
86
- K as PillButton,
87
- K as default
109
+ Z as PillButton,
110
+ Z as default
88
111
  };
89
112
  //# sourceMappingURL=PillButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PillButton.js","sources":["../../src/components/PillButton.tsx"],"sourcesContent":["import React from 'react';\nimport { FOCUS_RING } from './focusRing';\nimport { resolveRel } from './linkRel';\nimport { safeHref } from './safeHref';\n\ntype PillButtonSize = 'xsmall' | 'small' | 'medium';\ntype PillButtonVariant = 'default' | 'inverted';\n/**\n * `tab` squares the top corners so the pill reads as attached to whatever sits above it —\n * a row of controls hanging under an input, rather than free-floating pills.\n */\ntype PillButtonShape = 'pill' | 'tab';\n/**\n * `assistant` is the chrome for AI-authored chips (e.g. `ChangeReview.Jump`): a fixed\n * violet-on-white look with its own border, independent of `variant`/`selected`.\n */\ntype PillButtonTone = 'default' | 'assistant';\n\ninterface PillButtonProps {\n label: string;\n icon?: React.ReactNode;\n className?: string;\n selected?: boolean;\n disabled?: boolean;\n interactive?: boolean;\n size?: PillButtonSize;\n variant?: PillButtonVariant;\n shape?: PillButtonShape;\n tone?: PillButtonTone;\n /** Sits after the label — a caret on a pill that opens a menu. */\n trailingIcon?: React.ReactNode;\n onClick?: (event: React.MouseEvent<HTMLElement>) => void;\n /** Renders the pill as a real anchor, so a link pill keeps cmd-click, copy-link and the status bar. */\n href?: string;\n target?: React.HTMLAttributeAnchorTarget;\n rel?: string;\n}\n\nconst BASE_CLASSES =\n 'inline-flex items-center justify-center gap-1.5 font-medium whitespace-nowrap shrink-0 transition-colors duration-150 ease-in-out';\n\nconst SHAPE_CLASSES: Record<PillButtonShape, string> = {\n pill: 'rounded-[var(--malachite-radius-10,10px)]',\n tab: 'rounded-b-[var(--malachite-radius-10,10px)] rounded-t-none',\n};\n\n// Box-sizing is border-box, so trading `border-0` for a 1px border only eats into the padding\n// box — it never grows the element past the fixed height each size already sets. Only one of these\n// ever applies per render, so there's no `border-0`/`border` class collision to referee.\nconst TONE_BORDER_CLASSES: Record<PillButtonTone, string> = {\n default: 'border-0',\n assistant: 'border border-solid border-[var(--malachite-tag-assistant-border)]',\n};\n\nconst ASSISTANT_COLORS =\n 'bg-[var(--malachite-card-background)] text-[var(--malachite-assistant-foreground)]';\n\nconst SIZE_CLASSES: Record<\n PillButtonSize,\n { text: string; padding: string; paddingWithIcon: string }\n> = {\n // For a row that labels other content rather than being read on its own — a context\n // strip above a chat, say. The only size that drops below the 13px the others share.\n xsmall: {\n text: 'text-[length:var(--malachite-font-size-xsmall,11px)] h-[22px] leading-none',\n padding: 'px-2',\n paddingWithIcon: 'pl-1 pr-1.5',\n },\n small: {\n text: 'text-[length:var(--malachite-font-size-small,13px)] h-[var(--malachite-control-height-small,28px)] leading-none',\n padding: 'px-2.5',\n paddingWithIcon: 'pl-1.5 pr-2',\n },\n medium: {\n text: 'text-[length:var(--malachite-font-size-small,13px)] h-[var(--malachite-control-height-medium,32px)] leading-none',\n padding: 'px-2.5',\n paddingWithIcon: 'pl-1.5 pr-2',\n },\n};\n\nconst STATIC_COLORS =\n 'bg-[var(--malachite-pillbutton-static-background)] text-[var(--malachite-pillbutton-static-foreground)]';\n\nconst CLICKABLE_TAIL = 'active:opacity-60 cursor-pointer';\n\nconst VARIANT_COLORS: Record<PillButtonVariant, { base: string; selected: string; hover: string }> =\n {\n default: {\n base: 'bg-[var(--malachite-pillbutton-background)] text-[var(--malachite-pillbutton-foreground)]',\n selected:\n 'bg-[var(--malachite-pillbutton-hover-background)] text-[var(--malachite-pillbutton-hover-foreground)]',\n hover: 'hover:bg-[var(--malachite-pillbutton-hover-background)] hover:text-[var(--malachite-pillbutton-hover-foreground)] active:bg-[var(--malachite-pillbutton-pressed-background)] active:text-[var(--malachite-pillbutton-pressed-foreground)]',\n },\n inverted: {\n base: 'bg-[var(--malachite-pillbutton-inverted-background)] text-[var(--malachite-pillbutton-inverted-foreground)]',\n selected:\n 'bg-[var(--malachite-pillbutton-inverted-hover-background)] text-[var(--malachite-pillbutton-inverted-hover-foreground)]',\n hover: 'hover:bg-[var(--malachite-pillbutton-inverted-hover-background)] hover:text-[var(--malachite-pillbutton-inverted-hover-foreground)] active:bg-[var(--malachite-pillbutton-inverted-pressed-background)] active:text-[var(--malachite-pillbutton-inverted-pressed-foreground)]',\n },\n };\n\nexport const PillButton: React.FC<PillButtonProps> = ({\n label = 'Label',\n icon,\n className = '',\n selected = false,\n disabled = false,\n interactive = true,\n size = 'small',\n variant = 'default',\n shape = 'pill',\n tone = 'default',\n trailingIcon,\n onClick,\n href,\n target,\n rel,\n}) => {\n const sizeBlock = SIZE_CLASSES[size];\n const padding = icon ? sizeBlock.paddingWithIcon : sizeBlock.padding;\n const variantBlock = VARIANT_COLORS[variant];\n const isInteractiveLook = interactive && !disabled;\n // A rejected href (e.g. `javascript:`) takes the button or static path, never an anchor.\n const linkHref = safeHref(href);\n const isClickable = isInteractiveLook && (!!onClick || !!linkHref);\n const clickableTail = isClickable ? ` ${CLICKABLE_TAIL}` : '';\n\n let colorClasses: string;\n if (tone === 'assistant') {\n // Assistant chips read the same in every interaction state — the click affordance is\n // the shared `active:opacity-60` from `clickableTail`, not a colour swap.\n colorClasses = isClickable ? `${ASSISTANT_COLORS}${clickableTail}` : ASSISTANT_COLORS;\n } else if (!interactive) {\n colorClasses = STATIC_COLORS;\n } else if (selected) {\n colorClasses = isInteractiveLook\n ? `${variantBlock.selected}${clickableTail}`\n : variantBlock.selected;\n } else if (isInteractiveLook) {\n colorClasses = `${variantBlock.base} ${variantBlock.hover}${clickableTail}`;\n } else {\n colorClasses = variantBlock.base;\n }\n\n const disabledClasses = disabled ? 'opacity-50 cursor-not-allowed pointer-events-none' : '';\n\n const merged = `${BASE_CLASSES} ${SHAPE_CLASSES[shape]} ${sizeBlock.text} ${padding} ${TONE_BORDER_CLASSES[tone]} ${colorClasses} ${disabledClasses} ${className}`;\n\n const iconSlot = icon ? (\n <span className=\"inline-flex items-center justify-center w-4 h-4 shrink-0 [&>img]:max-w-full [&>img]:max-h-full [&>img]:object-contain\">\n {icon}\n </span>\n ) : null;\n\n const trailingSlot = trailingIcon ? (\n <span className=\"inline-flex shrink-0 items-center justify-center\">{trailingIcon}</span>\n ) : null;\n\n // An anchor cannot be disabled, so a disabled link pill falls through to the static one.\n if (isClickable && linkHref) {\n return (\n <a\n href={linkHref}\n target={target}\n rel={resolveRel(rel, target)}\n className={`${FOCUS_RING} ${merged} no-underline`}\n onClick={onClick}\n >\n {iconSlot}\n {label}\n {trailingSlot}\n </a>\n );\n }\n\n if (isClickable) {\n return (\n <button type=\"button\" className={`${FOCUS_RING} ${merged}`} onClick={onClick}>\n {iconSlot}\n {label}\n {trailingSlot}\n </button>\n );\n }\n\n return (\n <div className={merged}>\n {iconSlot}\n {label}\n {trailingSlot}\n </div>\n );\n};\n\nexport default PillButton;\n"],"names":["BASE_CLASSES","SHAPE_CLASSES","TONE_BORDER_CLASSES","ASSISTANT_COLORS","SIZE_CLASSES","STATIC_COLORS","CLICKABLE_TAIL","VARIANT_COLORS","PillButton","label","icon","className","selected","disabled","interactive","size","variant","shape","tone","trailingIcon","onClick","href","target","rel","sizeBlock","padding","variantBlock","isInteractiveLook","linkHref","safeHref","isClickable","clickableTail","colorClasses","disabledClasses","merged","iconSlot","jsx","trailingSlot","jsxs","resolveRel","FOCUS_RING"],"mappings":";;;;AAsCA,MAAMA,IACF,qIAEEC,IAAiD;AAAA,EACnD,MAAM;AAAA,EACN,KAAK;AACT,GAKMC,IAAsD;AAAA,EACxD,SAAS;AAAA,EACT,WAAW;AACf,GAEMC,IACF,sFAEEC,IAG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GD,EAAa,QAAQ,GAAGK,CAAa,KACxCL,EAAa,WACZC,IACPK,IAAe,GAAGN,EAAa,IAAI,IAAIA,EAAa,KAAK,GAAGK,CAAa,KAEzEC,IAAeN,EAAa,OAR5BM,IAAe3B;AAWnB,QAAM4B,IAAkBpB,IAAW,sDAAsD,IAEnFqB,IAAS,GAAGlC,CAAY,IAAIC,EAAcgB,CAAK,CAAC,IAAIO,EAAU,IAAI,IAAIC,CAAO,IAAIvB,EAAoBgB,CAAI,CAAC,IAAIc,CAAY,IAAIC,CAAe,IAAItB,CAAS,IAE1JwB,IAAWzB,IACb,gBAAA0B,EAAC,UAAK,WAAU,yHACX,aACL,IACA,MAEEC,IAAelB,IACjB,gBAAAiB,EAAC,UAAK,WAAU,oDAAoD,aAAa,IACjF;AAGJ,SAAIN,KAAeF,IAEX,gBAAAU;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,MAAMV;AAAA,MACN,QAAAN;AAAA,MACA,KAAKiB,EAAWhB,GAAKD,CAAM;AAAA,MAC3B,WAAW,GAAGkB,CAAU,IAAIN,CAAM;AAAA,MAClC,SAAAd;AAAA,MAEC,UAAA;AAAA,QAAAe;AAAA,QACA1B;AAAA,QACA4B;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,IAKTP,IAEI,gBAAAQ,EAAC,UAAA,EAAO,MAAK,UAAS,WAAW,GAAGE,CAAU,IAAIN,CAAM,IAAI,SAAAd,GACvD,UAAA;AAAA,IAAAe;AAAA,IACA1B;AAAA,IACA4B;AAAA,EAAA,GACL,IAKJ,gBAAAC,EAAC,OAAA,EAAI,WAAWJ,GACX,UAAA;AAAA,IAAAC;AAAA,IACA1B;AAAA,IACA4B;AAAA,EAAA,GACL;AAER;"}
1
+ {"version":3,"file":"PillButton.js","sources":["../../src/components/PillButton.tsx"],"sourcesContent":["import React from 'react';\nimport { FOCUS_RING } from './focusRing';\nimport { resolveRel } from './linkRel';\nimport { safeHref } from './safeHref';\n\ntype PillButtonSize = 'xsmall' | 'small' | 'medium';\ntype PillButtonVariant = 'default' | 'inverted';\n/**\n * `tab` squares the top corners so the pill reads as attached to whatever sits above it —\n * a row of controls hanging under an input, rather than free-floating pills.\n */\ntype PillButtonShape = 'pill' | 'tab';\n/**\n * `assistant` is the chrome for AI-authored chips (e.g. `ChangeReview.Jump`): a fixed\n * violet-on-white look with its own border, independent of `variant`/`selected`.\n */\ntype PillButtonTone = 'default' | 'assistant';\n\ninterface PillButtonBaseProps {\n label: string;\n icon?: React.ReactNode;\n className?: string;\n selected?: boolean;\n disabled?: boolean;\n interactive?: boolean;\n size?: PillButtonSize;\n variant?: PillButtonVariant;\n shape?: PillButtonShape;\n /** Sits after the label — a caret on a pill that opens a menu. */\n trailingIcon?: React.ReactNode;\n onClick?: (event: React.MouseEvent<HTMLElement>) => void;\n /** Renders the pill as a real anchor, so a link pill keeps cmd-click, copy-link and the status bar. */\n href?: string;\n target?: React.HTMLAttributeAnchorTarget;\n rel?: string;\n}\n\ntype PillButtonProps = PillButtonBaseProps &\n (\n | {\n tone?: Extract<PillButtonTone, 'default'>;\n pressed?: boolean;\n }\n | { tone: Extract<PillButtonTone, 'assistant'>; pressed?: never }\n );\n\nconst BASE_CLASSES =\n 'inline-flex items-center justify-center gap-1.5 font-medium whitespace-nowrap shrink-0 transition-colors duration-150 ease-in-out';\n\nconst SHAPE_CLASSES: Record<PillButtonShape, string> = {\n pill: 'rounded-[var(--malachite-radius-10,10px)]',\n tab: 'rounded-b-[var(--malachite-radius-10,10px)] rounded-t-none',\n};\n\n// Box-sizing is border-box, so trading `border-0` for a 1px border only eats into the padding\n// box — it never grows the element past the fixed height each size already sets. Only one of these\n// ever applies per render, so there's no `border-0`/`border` class collision to referee.\nconst TONE_BORDER_CLASSES: Record<PillButtonTone, string> = {\n default: 'border-0',\n assistant: 'border border-solid border-[var(--malachite-tag-assistant-border)]',\n};\n\nconst ASSISTANT_COLORS =\n 'bg-[var(--malachite-card-background)] text-[var(--malachite-assistant-foreground)]';\n\nconst SIZE_CLASSES: Record<\n PillButtonSize,\n { text: string; padding: string; paddingWithIcon: string }\n> = {\n // For a row that labels other content rather than being read on its own — a context\n // strip above a chat, say. The only size that drops below the 13px the others share.\n xsmall: {\n text: 'text-[length:var(--malachite-font-size-xsmall,11px)] h-[22px] leading-none',\n padding: 'px-2',\n paddingWithIcon: 'pl-1 pr-1.5',\n },\n small: {\n text: 'text-[length:var(--malachite-font-size-small,13px)] h-[var(--malachite-control-height-small,28px)] leading-none',\n padding: 'px-2.5',\n paddingWithIcon: 'pl-1.5 pr-2',\n },\n medium: {\n text: 'text-[length:var(--malachite-font-size-small,13px)] h-[var(--malachite-control-height-medium,32px)] leading-none',\n padding: 'px-2.5',\n paddingWithIcon: 'pl-1.5 pr-2',\n },\n};\n\nconst STATIC_COLORS =\n 'bg-[var(--malachite-pillbutton-static-background)] text-[var(--malachite-pillbutton-static-foreground)]';\n\nconst CLICKABLE_TAIL = 'active:opacity-60 cursor-pointer';\n\nconst VARIANT_COLORS: Record<PillButtonVariant, { base: string; selected: string; hover: string }> =\n {\n default: {\n base: 'bg-[var(--malachite-pillbutton-background)] text-[var(--malachite-pillbutton-foreground)]',\n selected:\n 'bg-[var(--malachite-pillbutton-hover-background)] text-[var(--malachite-pillbutton-hover-foreground)]',\n hover: 'hover:bg-[var(--malachite-pillbutton-hover-background)] hover:text-[var(--malachite-pillbutton-hover-foreground)] active:bg-[var(--malachite-pillbutton-pressed-background)] active:text-[var(--malachite-pillbutton-pressed-foreground)]',\n },\n inverted: {\n base: 'bg-[var(--malachite-pillbutton-inverted-background)] text-[var(--malachite-pillbutton-inverted-foreground)]',\n selected:\n 'bg-[var(--malachite-pillbutton-inverted-hover-background)] text-[var(--malachite-pillbutton-inverted-hover-foreground)]',\n hover: 'hover:bg-[var(--malachite-pillbutton-inverted-hover-background)] hover:text-[var(--malachite-pillbutton-inverted-hover-foreground)] active:bg-[var(--malachite-pillbutton-inverted-pressed-background)] active:text-[var(--malachite-pillbutton-inverted-pressed-foreground)]',\n },\n };\n\nexport const PillButton: React.FC<PillButtonProps> = ({\n label = 'Label',\n icon,\n className = '',\n selected = false,\n pressed,\n disabled = false,\n interactive = true,\n size = 'small',\n variant = 'default',\n shape = 'pill',\n tone = 'default',\n trailingIcon,\n onClick,\n href,\n target,\n rel,\n}) => {\n const sizeBlock = SIZE_CLASSES[size];\n const padding = icon ? sizeBlock.paddingWithIcon : sizeBlock.padding;\n const variantBlock = VARIANT_COLORS[variant];\n const isInteractiveLook = interactive && !disabled;\n // A rejected href (e.g. `javascript:`) takes the button or static path, never an anchor.\n const linkHref = safeHref(href);\n const isClickable = isInteractiveLook && (!!onClick || !!linkHref);\n const clickableTail = isClickable ? ` ${CLICKABLE_TAIL}` : '';\n const toggle = !linkHref && pressed !== undefined;\n const isOn = toggle ? pressed : selected;\n\n let colorClasses: string;\n if (tone === 'assistant') {\n // Assistant chips read the same in every interaction state — the click affordance is\n // the shared `active:opacity-60` from `clickableTail`, not a colour swap.\n colorClasses = isClickable ? `${ASSISTANT_COLORS}${clickableTail}` : ASSISTANT_COLORS;\n } else if (!interactive) {\n colorClasses = STATIC_COLORS;\n } else if (isOn) {\n colorClasses = isInteractiveLook\n ? `${variantBlock.selected}${clickableTail}`\n : variantBlock.selected;\n } else if (isInteractiveLook) {\n colorClasses = `${variantBlock.base} ${variantBlock.hover}${clickableTail}`;\n } else {\n colorClasses = variantBlock.base;\n }\n\n const disabledClasses = disabled ? 'opacity-50 cursor-not-allowed pointer-events-none' : '';\n\n const merged = `${BASE_CLASSES} ${SHAPE_CLASSES[shape]} ${sizeBlock.text} ${padding} ${TONE_BORDER_CLASSES[tone]} ${colorClasses} ${disabledClasses} ${className}`;\n\n const iconSlot = icon ? (\n <span className=\"inline-flex items-center justify-center w-4 h-4 shrink-0 [&>img]:max-w-full [&>img]:max-h-full [&>img]:object-contain\">\n {icon}\n </span>\n ) : null;\n\n const trailingSlot = trailingIcon ? (\n <span className=\"inline-flex shrink-0 items-center justify-center\">{trailingIcon}</span>\n ) : null;\n\n // An anchor cannot be disabled, so a disabled link pill falls through to the static one.\n if (isClickable && linkHref) {\n return (\n <a\n href={linkHref}\n target={target}\n rel={resolveRel(rel, target)}\n className={`${FOCUS_RING} ${merged} no-underline`}\n onClick={onClick}\n >\n {iconSlot}\n {label}\n {trailingSlot}\n </a>\n );\n }\n\n if (isClickable) {\n return (\n <button\n type=\"button\"\n aria-pressed={toggle ? pressed : undefined}\n className={`${FOCUS_RING} ${merged}`}\n onClick={onClick}\n >\n {iconSlot}\n {label}\n {trailingSlot}\n </button>\n );\n }\n\n if (toggle && disabled) {\n return (\n <button\n type=\"button\"\n aria-pressed={pressed}\n aria-disabled=\"true\"\n className={`${FOCUS_RING} ${merged}`}\n >\n {iconSlot}\n {label}\n {trailingSlot}\n </button>\n );\n }\n\n return (\n <div className={merged}>\n {iconSlot}\n {label}\n {trailingSlot}\n </div>\n );\n};\n\nexport default PillButton;\n"],"names":["BASE_CLASSES","SHAPE_CLASSES","TONE_BORDER_CLASSES","ASSISTANT_COLORS","SIZE_CLASSES","STATIC_COLORS","CLICKABLE_TAIL","VARIANT_COLORS","PillButton","label","icon","className","selected","pressed","disabled","interactive","size","variant","shape","tone","trailingIcon","onClick","href","target","rel","sizeBlock","padding","variantBlock","isInteractiveLook","linkHref","safeHref","isClickable","clickableTail","toggle","isOn","colorClasses","disabledClasses","merged","iconSlot","jsx","trailingSlot","jsxs","resolveRel","FOCUS_RING"],"mappings":";;;;AA8CA,MAAMA,IACF,qIAEEC,IAAiD;AAAA,EACnD,MAAM;AAAA,EACN,KAAK;AACT,GAKMC,IAAsD;AAAA,EACxD,SAAS;AAAA,EACT,WAAW;AACf,GAEMC,IACF,sFAEEC,IAGF;AAAA;AAAA;AAAA,EAGA,QAAQ;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,IACT,iBAAiB;AAAA,EAAA;AAAA,EAErB,OAAO;AAAA,IACH,MAAM;AAAA,IACN,SAAS;AAAA,IACT,iBAAiB;AAAA,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AA,EAAI,WAAWJ,GACX,UAAA;AAAA,IAAAC;AAAA,IACA7B;AAAA,IACA+B;AAAA,EAAA,GACL;AAER;"}
@@ -0,0 +1,79 @@
1
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
+ import d from "./Typography/Text.js";
3
+ const h = {
4
+ neutral: "border-[var(--malachite-text-secondary,rgb(123,123,123))]",
5
+ success: "border-[var(--malachite-text-success,rgb(2,122,66))]",
6
+ warning: "border-[var(--malachite-warning-fill,rgb(201,138,46))]",
7
+ error: "border-[var(--malachite-error-background,rgb(197,63,63))]"
8
+ }, N = {
9
+ backgroundColor: "var(--malachite-warning-fill, rgb(201, 138, 46))",
10
+ backgroundImage: "linear-gradient(90deg, var(--malachite-text-success, rgb(2, 122, 66)) 0%, var(--malachite-warning-fill, rgb(201, 138, 46)) 55%, var(--malachite-error-background, rgb(197, 63, 63)) 100%)"
11
+ }, i = (a) => Math.min(1, Math.max(0, Number.isFinite(a) ? a : 0)), s = (a) => `${i(a) * 100}%`, f = 0.25, w = (a) => i(a) < f || i(a) > 1 - f, u = ({
12
+ at: a,
13
+ shift: n,
14
+ children: o
15
+ }) => /* @__PURE__ */ e(
16
+ "span",
17
+ {
18
+ className: "absolute top-0 flex whitespace-nowrap",
19
+ style: { left: s(a), transform: `translateX(-${n})` },
20
+ children: /* @__PURE__ */ e(d, { size: "xsmall", color: "secondary", children: o })
21
+ }
22
+ ), E = ({
23
+ value: a,
24
+ label: n,
25
+ valueText: o,
26
+ threshold: r,
27
+ thresholdLabel: l,
28
+ lowLabel: m,
29
+ highLabel: x,
30
+ tone: p = "neutral",
31
+ className: g = ""
32
+ }) => {
33
+ const t = r !== void 0 && Number.isFinite(r), b = t && w(r), v = !!(m || x || t && l);
34
+ return /* @__PURE__ */ c(
35
+ "div",
36
+ {
37
+ role: "meter",
38
+ "aria-label": n,
39
+ "aria-valuemin": 0,
40
+ "aria-valuemax": 1,
41
+ "aria-valuenow": i(a),
42
+ "aria-valuetext": o,
43
+ className: `flex w-full flex-col gap-[6px] px-[7px] ${g}`,
44
+ children: [
45
+ /* @__PURE__ */ c("div", { className: "relative h-[8px] rounded-[4px]", style: N, children: [
46
+ t && /* @__PURE__ */ e(
47
+ "span",
48
+ {
49
+ "data-score-meter-threshold": "",
50
+ className: "absolute top-[-3px] -ml-[1px] h-[14px] w-[2px] bg-[var(--malachite-card-background,#fff)] [box-shadow:0_0_0_1px_var(--malachite-text-dimmed,rgb(161,161,161))]",
51
+ style: { left: s(r) }
52
+ }
53
+ ),
54
+ /* @__PURE__ */ e(
55
+ "span",
56
+ {
57
+ "data-score-meter-marker": p,
58
+ className: `absolute top-[-3px] -ml-[7px] box-border h-[14px] w-[14px] rounded-full border-[3px] border-solid bg-[var(--malachite-card-background,#fff)] ${h[p]}`,
59
+ style: { left: s(a) }
60
+ }
61
+ )
62
+ ] }),
63
+ v && /* @__PURE__ */ c("div", { "aria-hidden": "true", className: "flex flex-col gap-[2px]", children: [
64
+ /* @__PURE__ */ c("div", { className: "relative flex h-[16px] justify-between", children: [
65
+ /* @__PURE__ */ e(d, { size: "xsmall", color: "secondary", children: m }),
66
+ l && t && !b && /* @__PURE__ */ e(u, { at: r, shift: "50%", children: l }),
67
+ /* @__PURE__ */ e(d, { size: "xsmall", color: "secondary", children: x })
68
+ ] }),
69
+ l && t && b && /* @__PURE__ */ e("div", { className: "relative h-[16px]", children: /* @__PURE__ */ e(u, { at: r, shift: s(r), children: l }) })
70
+ ] })
71
+ ]
72
+ }
73
+ );
74
+ };
75
+ export {
76
+ E as ScoreMeter,
77
+ E as default
78
+ };
79
+ //# sourceMappingURL=ScoreMeter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScoreMeter.js","sources":["../../src/components/ScoreMeter.tsx"],"sourcesContent":["import type React from 'react';\nimport Text from './Typography/Text';\n\nexport type ScoreMeterTone = 'neutral' | 'success' | 'warning' | 'error';\n\nexport interface ScoreMeterProps {\n value: number;\n label: string;\n valueText?: string;\n threshold?: number;\n thresholdLabel?: string;\n lowLabel?: string;\n highLabel?: string;\n tone?: ScoreMeterTone;\n className?: string;\n}\n\nconst MARKER_RING: Record<ScoreMeterTone, string> = {\n neutral: 'border-[var(--malachite-text-secondary,rgb(123,123,123))]',\n success: 'border-[var(--malachite-text-success,rgb(2,122,66))]',\n warning: 'border-[var(--malachite-warning-fill,rgb(201,138,46))]',\n error: 'border-[var(--malachite-error-background,rgb(197,63,63))]',\n};\n\nconst TRACK_STYLE: React.CSSProperties = {\n backgroundColor: 'var(--malachite-warning-fill, rgb(201, 138, 46))',\n backgroundImage:\n 'linear-gradient(90deg, var(--malachite-text-success, rgb(2, 122, 66)) 0%, var(--malachite-warning-fill, rgb(201, 138, 46)) 55%, var(--malachite-error-background, rgb(197, 63, 63)) 100%)',\n};\n\nconst unit = (value: number): number =>\n Math.min(1, Math.max(0, Number.isFinite(value) ? value : 0));\n\nconst percent = (value: number): string => `${unit(value) * 100}%`;\n\nconst LABEL_EDGE = 0.25;\n\nconst isNearEnd = (threshold: number): boolean =>\n unit(threshold) < LABEL_EDGE || unit(threshold) > 1 - LABEL_EDGE;\n\nconst ThresholdLabel: React.FC<{ at: number; shift: string; children: React.ReactNode }> = ({\n at,\n shift,\n children,\n}) => (\n <span\n className=\"absolute top-0 flex whitespace-nowrap\"\n style={{ left: percent(at), transform: `translateX(-${shift})` }}\n >\n <Text size=\"xsmall\" color=\"secondary\">\n {children}\n </Text>\n </span>\n);\n\nexport const ScoreMeter: React.FC<ScoreMeterProps> = ({\n value,\n label,\n valueText,\n threshold,\n thresholdLabel,\n lowLabel,\n highLabel,\n tone = 'neutral',\n className = '',\n}) => {\n const hasThreshold = threshold !== undefined && Number.isFinite(threshold);\n const nearEnd = hasThreshold && isNearEnd(threshold);\n const hasLabels = Boolean(lowLabel || highLabel || (hasThreshold && thresholdLabel));\n return (\n <div\n role=\"meter\"\n aria-label={label}\n aria-valuemin={0}\n aria-valuemax={1}\n aria-valuenow={unit(value)}\n aria-valuetext={valueText}\n className={`flex w-full flex-col gap-[6px] px-[7px] ${className}`}\n >\n <div className=\"relative h-[8px] rounded-[4px]\" style={TRACK_STYLE}>\n {hasThreshold && (\n <span\n data-score-meter-threshold=\"\"\n className=\"absolute top-[-3px] -ml-[1px] h-[14px] w-[2px] bg-[var(--malachite-card-background,#fff)] [box-shadow:0_0_0_1px_var(--malachite-text-dimmed,rgb(161,161,161))]\"\n style={{ left: percent(threshold) }}\n />\n )}\n <span\n data-score-meter-marker={tone}\n className={`absolute top-[-3px] -ml-[7px] box-border h-[14px] w-[14px] rounded-full border-[3px] border-solid bg-[var(--malachite-card-background,#fff)] ${MARKER_RING[tone]}`}\n style={{ left: percent(value) }}\n />\n </div>\n {hasLabels && (\n <div aria-hidden=\"true\" className=\"flex flex-col gap-[2px]\">\n <div className=\"relative flex h-[16px] justify-between\">\n <Text size=\"xsmall\" color=\"secondary\">\n {lowLabel}\n </Text>\n {thresholdLabel && hasThreshold && !nearEnd && (\n <ThresholdLabel at={threshold} shift=\"50%\">\n {thresholdLabel}\n </ThresholdLabel>\n )}\n <Text size=\"xsmall\" color=\"secondary\">\n {highLabel}\n </Text>\n </div>\n {thresholdLabel && hasThreshold && nearEnd && (\n <div className=\"relative h-[16px]\">\n <ThresholdLabel at={threshold} shift={percent(threshold)}>\n {thresholdLabel}\n </ThresholdLabel>\n </div>\n )}\n </div>\n )}\n </div>\n );\n};\n\nexport default ScoreMeter;\n"],"names":["MARKER_RING","TRACK_STYLE","unit","value","percent","LABEL_EDGE","isNearEnd","threshold","ThresholdLabel","at","shift","children","jsx","Text","ScoreMeter","label","valueText","thresholdLabel","lowLabel","highLabel","tone","className","hasThreshold","nearEnd","hasLabels","jsxs"],"mappings":";;AAiBA,MAAMA,IAA8C;AAAA,EAChD,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACX,GAEMC,IAAmC;AAAA,EACrC,iBAAiB;AAAA,EACjB,iBACI;AACR,GAEMC,IAAO,CAACC,MACV,KAAK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ACG,8BAA2B;AAAA,cAC3B,WAAU;AAAA,cACV,OAAO,EAAE,MAAMR,EAAQG,CAAS,EAAA;AAAA,YAAE;AAAA,UAAA;AAAA,UAG1C,gBAAAK;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,2BAAyBQ;AAAA,cACzB,WAAW,gJAAgJpB,EAAYoB,CAAI,CAAC;AAAA,cAC5K,OAAO,EAAE,MAAMhB,EAAQD,CAAK,EAAA;AAAA,YAAE;AAAA,UAAA;AAAA,QAClC,GACJ;AAAA,QACCqB,KACG,gBAAAC,EAAC,OAAA,EAAI,eAAY,QAAO,WAAU,2BAC9B,UAAA;AAAA,UAAA,gBAAAA,EAAC,OAAA,EAAI,WAAU,0CACX,UAAA;AAAA,YAAA,gBAAAb,EAACC,GAAA,EAAK,MAAK,UAAS,OAAM,aACrB,UAAAK,GACL;AAAA,YACCD,KAAkBK,KAAgB,CAACC,KAChC,gBAAAX,EAACJ,KAAe,IAAID,GAAW,OAAM,OAChC,UAAAU,EAAA,CACL;AAAA,8BAEHJ,GAAA,EAAK,MAAK,UAAS,OAAM,aACrB,UAAAM,EAAA,CACL;AAAA,UAAA,GACJ;AAAA,UACCF,KAAkBK,KAAgBC,KAC/B,gBAAAX,EAAC,OAAA,EAAI,WAAU,qBACX,UAAA,gBAAAA,EAACJ,GAAA,EAAe,IAAID,GAAW,OAAOH,EAAQG,CAAS,GAClD,aACL,EAAA,CACJ;AAAA,QAAA,EAAA,CAER;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIhB;"}
@@ -1,22 +1,23 @@
1
- import { jsx as e, jsxs as a, Fragment as $ } from "react/jsx-runtime";
2
- import { useId as z } from "react";
3
- import { Tag as I } from "./Tag.js";
1
+ import { jsx as e, jsxs as a, Fragment as _ } from "react/jsx-runtime";
2
+ import { useId as j } from "react";
3
+ import { Tag as F } from "./Tag.js";
4
4
  import o from "./Typography/Text.js";
5
- import { getFontWeight as _, getFontFamily as j } from "./Typography/textStyles.js";
6
- import { devWarning as F } from "./devWarning.js";
5
+ import { getFontWeight as W, getFontFamily as E } from "./Typography/textStyles.js";
6
+ import { devWarning as O } from "./devWarning.js";
7
+ import { isRenderableNode as v } from "./renderableNode.js";
7
8
  const p = {
8
9
  neutral: "var(--malachite-text-secondary, rgb(123, 123, 123))",
9
10
  info: "var(--malachite-text-info, rgb(12, 88, 174))",
10
11
  success: "var(--malachite-text-success, rgb(2, 122, 66))",
11
12
  warning: "var(--malachite-text-warning, rgb(150, 88, 10))",
12
13
  error: "var(--malachite-text-error, rgb(237, 53, 54))"
13
- }, E = {
14
- fontFamily: j("mono"),
15
- fontWeight: _("semi-bold"),
14
+ }, R = {
15
+ fontFamily: E("mono"),
16
+ fontWeight: W("semi-bold"),
16
17
  fontSize: "0.92em",
17
18
  wordSpacing: "-0.25em",
18
19
  marginLeft: "0.08em"
19
- }, O = /* @__PURE__ */ e(
20
+ }, A = /* @__PURE__ */ e(
20
21
  "svg",
21
22
  {
22
23
  "data-timeline-skipped": "",
@@ -33,34 +34,58 @@ const p = {
33
34
  }
34
35
  )
35
36
  }
36
- ), W = ({
37
+ ), D = ({
37
38
  title: n,
39
+ eyebrow: s,
38
40
  titleCode: t,
39
41
  time: l,
40
- tone: c,
42
+ tone: N,
41
43
  marker: h,
42
44
  icon: f,
43
- skipped: s = !1,
45
+ skipped: i = !1,
44
46
  stopped: g = !1,
45
47
  stoppedLabel: m,
46
48
  skippedLabel: d,
47
49
  meta: w = [],
48
- children: u,
49
- className: v = ""
50
+ children: y,
51
+ className: T = ""
50
52
  }) => {
51
- const y = z();
52
- if (s && g) {
53
+ const $ = j();
54
+ if (i && g) {
53
55
  const r = typeof n == "string" ? n : "";
54
- F(
55
- `Timeline.Item.skipped+stopped:${r || y}`,
56
+ O(
57
+ `Timeline.Item.skipped+stopped:${r || $}`,
56
58
  `Timeline.Item${r ? ` "${r}"` : " (with a non-string title)"} got both \`skipped\` and \`stopped\`; a step that never ran can't be the one the flow ended on, so the badge is dropped.`
57
59
  );
58
60
  }
59
- const x = g && !s, i = c ?? (x ? "error" : "neutral"), N = s ? O : h, T = !s && !!h, b = t == null ? void 0 : t.trim();
61
+ const x = g && !i, c = N ?? (x ? "error" : "neutral"), z = i ? A : h, S = !i && !!h, b = t == null ? void 0 : t.trim(), u = /* @__PURE__ */ a("div", { className: "flex min-w-0 flex-wrap items-center gap-x-[8px] gap-y-[4px] [overflow-wrap:anywhere]", children: [
62
+ /* @__PURE__ */ a(o, { size: "small", fontWeight: "bold", className: "min-w-0 leading-[18px]", children: [
63
+ n,
64
+ b && /* @__PURE__ */ a(_, { children: [
65
+ n ? " " : null,
66
+ /* @__PURE__ */ e("span", { translate: "no", style: R, children: b })
67
+ ] })
68
+ ] }),
69
+ i && /* @__PURE__ */ a("span", { className: "sr-only", children: [
70
+ ", ",
71
+ (d == null ? void 0 : d.trim()) || "skipped"
72
+ ] }),
73
+ x && /* @__PURE__ */ e("span", { className: "sr-only", children: ", " }),
74
+ x && /* @__PURE__ */ e(
75
+ F,
76
+ {
77
+ value: (m == null ? void 0 : m.trim()) || "Stopped here",
78
+ type: "error",
79
+ fontSize: "xsmall",
80
+ textTransform: "none",
81
+ paddingSize: "compact"
82
+ }
83
+ )
84
+ ] });
60
85
  return /* @__PURE__ */ a(
61
86
  "li",
62
87
  {
63
- className: `relative m-0 flex gap-[14px] pb-[40px] last:pb-0 [&:last-child>[data-timeline-line]]:hidden ${v}`,
88
+ className: `relative m-0 flex gap-[14px] pb-[40px] last:pb-0 [&:last-child>[data-timeline-line]]:hidden ${T}`,
64
89
  children: [
65
90
  /* @__PURE__ */ e(
66
91
  "span",
@@ -74,65 +99,51 @@ const p = {
74
99
  "span",
75
100
  {
76
101
  "aria-hidden": "true",
77
- className: `flex h-[24px] w-[24px] flex-none items-center justify-center overflow-hidden rounded-full ${T ? "" : "border border-solid border-[var(--malachite-card-border,rgb(232,232,232))]"}`,
78
- children: N || (f ? /* @__PURE__ */ e(
102
+ className: `flex h-[24px] w-[24px] flex-none items-center justify-center overflow-hidden rounded-full ${S ? "" : "border border-solid border-[var(--malachite-card-border,rgb(232,232,232))]"}`,
103
+ children: z || (f ? /* @__PURE__ */ e(
79
104
  "span",
80
105
  {
81
- "data-timeline-icon": i,
106
+ "data-timeline-icon": c,
82
107
  className: "flex h-[14px] w-[14px] items-center justify-center overflow-hidden [&>*]:max-h-full [&>*]:max-w-full [&_svg]:max-h-[14px] [&_svg]:max-w-[14px]",
83
- style: { color: p[i] },
108
+ style: { color: p[c] },
84
109
  children: f
85
110
  }
86
111
  ) : /* @__PURE__ */ e(
87
112
  "span",
88
113
  {
89
- "data-timeline-dot": i,
114
+ "data-timeline-dot": c,
90
115
  className: "h-[8px] w-[8px] rounded-full",
91
- style: { backgroundColor: p[i] }
116
+ style: { backgroundColor: p[c] }
92
117
  }
93
118
  ))
94
119
  }
95
120
  ),
96
121
  /* @__PURE__ */ a("div", { className: "flex min-w-0 flex-1 flex-col gap-[8px] pt-[2px]", children: [
97
- /* @__PURE__ */ a("div", { className: "flex items-start justify-between gap-[12px]", children: [
98
- /* @__PURE__ */ a("div", { className: "flex min-w-0 flex-wrap items-center gap-x-[8px] gap-y-[4px] [overflow-wrap:anywhere]", children: [
99
- /* @__PURE__ */ a(o, { size: "small", fontWeight: "bold", className: "min-w-0 leading-[18px]", children: [
100
- n,
101
- b && /* @__PURE__ */ a($, { children: [
102
- n ? " " : null,
103
- /* @__PURE__ */ e("span", { translate: "no", style: E, children: b })
104
- ] })
105
- ] }),
106
- s && /* @__PURE__ */ a("span", { className: "sr-only", children: [
107
- ", ",
108
- (d == null ? void 0 : d.trim()) || "skipped"
109
- ] }),
110
- x && /* @__PURE__ */ e("span", { className: "sr-only", children: ", " }),
111
- x && /* @__PURE__ */ e(
112
- I,
113
- {
114
- value: (m == null ? void 0 : m.trim()) || "Stopped here",
115
- type: "error",
116
- fontSize: "xsmall",
117
- textTransform: "none",
118
- paddingSize: "compact"
119
- }
120
- )
121
- ] }),
122
- (l || l === 0) && /* @__PURE__ */ e("span", { className: "sr-only", children: ", " }),
123
- (l || l === 0) && /* @__PURE__ */ e(
124
- o,
125
- {
126
- size: "xsmall",
127
- color: "secondary",
128
- font: "mono",
129
- wrap: !1,
130
- className: "pt-[2px]",
131
- children: l
132
- }
133
- )
134
- ] }),
135
- w.length > 0 && /* @__PURE__ */ e("dl", { className: "m-0 flex flex-wrap gap-x-[18px] gap-y-[6px] leading-[16px]", children: w.map((r, S) => /* @__PURE__ */ a(
122
+ /* @__PURE__ */ a(
123
+ "div",
124
+ {
125
+ className: `flex justify-between gap-[12px] ${v(s) ? "items-end" : "items-start"}`,
126
+ children: [
127
+ v(s) ? /* @__PURE__ */ a("div", { className: "flex min-w-0 flex-col gap-[2px]", children: [
128
+ /* @__PURE__ */ e(o, { size: "xsmall", color: "secondary", fontWeight: "semi-bold", children: s }),
129
+ u
130
+ ] }) : u,
131
+ (l || l === 0) && /* @__PURE__ */ e("span", { className: "sr-only", children: ", " }),
132
+ (l || l === 0) && /* @__PURE__ */ e(
133
+ o,
134
+ {
135
+ size: "xsmall",
136
+ color: "secondary",
137
+ font: "mono",
138
+ wrap: !1,
139
+ className: "pt-[2px]",
140
+ children: l
141
+ }
142
+ )
143
+ ]
144
+ }
145
+ ),
146
+ w.length > 0 && /* @__PURE__ */ e("dl", { className: "m-0 flex flex-wrap gap-x-[18px] gap-y-[6px] leading-[16px]", children: w.map((r, I) => /* @__PURE__ */ a(
136
147
  "div",
137
148
  {
138
149
  className: "flex min-w-0 items-baseline gap-[3px]",
@@ -141,31 +152,31 @@ const p = {
141
152
  /* @__PURE__ */ e("dd", { className: "m-0 flex min-w-0 [overflow-wrap:anywhere]", children: /* @__PURE__ */ e(o, { size: "xsmall", font: "mono", children: r.value }) })
142
153
  ]
143
154
  },
144
- `${r.label}-${S}`
155
+ `${r.label}-${I}`
145
156
  )) }),
146
- u
157
+ y
147
158
  ] })
148
159
  ]
149
160
  }
150
161
  );
151
- }, A = ({
162
+ }, M = ({
152
163
  children: n,
153
- className: t = "",
154
- "aria-label": l,
155
- "aria-labelledby": c
164
+ className: s = "",
165
+ "aria-label": t,
166
+ "aria-labelledby": l
156
167
  }) => /* @__PURE__ */ e(
157
168
  "ol",
158
169
  {
159
170
  role: "list",
160
- "aria-label": l,
161
- "aria-labelledby": c,
162
- className: `m-0 list-none p-0 ${t}`,
171
+ "aria-label": t,
172
+ "aria-labelledby": l,
173
+ className: `m-0 list-none p-0 ${s}`,
163
174
  children: n
164
175
  }
165
176
  );
166
- A.Item = W;
177
+ M.Item = D;
167
178
  export {
168
- A as Timeline,
169
- A as default
179
+ M as Timeline,
180
+ M as default
170
181
  };
171
182
  //# sourceMappingURL=Timeline.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Timeline.js","sources":["../../src/components/Timeline.tsx"],"sourcesContent":["import React, { useId } from 'react';\nimport Tag from './Tag';\nimport Text from './Typography/Text';\nimport { getFontFamily, getFontWeight } from './Typography/textStyles';\nimport { devWarning } from './devWarning';\n\nexport type TimelineTone = 'neutral' | 'info' | 'success' | 'warning' | 'error';\n\nexport interface TimelineProps {\n children: React.ReactNode;\n className?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n}\n\nexport interface TimelineMetaEntry {\n label: string;\n value: React.ReactNode;\n}\n\nexport interface TimelineItemProps {\n title: React.ReactNode;\n /**\n * Code set after the title in the mono face, as one phrase with it, e.g. `title=\"n8n called\"`\n * with `titleCode=\"Salesforce | Delete contact\"`.\n */\n titleCode?: string;\n /** When the step happened, shown at the right of the title, e.g. `+6 ms`. */\n time?: React.ReactNode;\n /**\n * Paints the dot or the `icon`: `error` on a `stopped` step, else `neutral`, unless set. Colour\n * alone, so the title has to say what happened. Ignored when `skipped` or `marker` is set.\n */\n tone?: TimelineTone;\n /** Replaces the ringed dot with a 24px circle of its own, e.g. the caller's logo at size 24. Decorative: hidden from assistive tech. */\n marker?: React.ReactNode;\n /**\n * A 12-14px glyph drawn inside the ring in place of the dot, e.g. `<McpIcon size={13} />`, painted\n * by `tone` through `currentColor`. Use a filled glyph: inside the shadow root every unmarked svg\n * path is filled, so a stroke-only icon turns solid.\n * Decorative: hidden from assistive tech, so the title has to say what it stands for.\n * Precedence: `skipped`, then `marker`, then `icon`, then the dot.\n */\n icon?: React.ReactNode;\n /** A step that never ran: a grey chevron replaces the dot, `tone`, `marker` and `icon`. Wins over `stopped`. */\n skipped?: boolean;\n /** Marks the step the flow ended on, with a badge after the title. Ignored when `skipped`. */\n stopped?: boolean;\n /** The badge's text when `stopped`. Empty falls back to \"Stopped here\". */\n stoppedLabel?: string;\n /** Read to assistive tech after the title when `skipped`. Empty falls back to \"skipped\". */\n skippedLabel?: string;\n /** Label and value pairs in a wrapping row under the title. */\n meta?: readonly TimelineMetaEntry[];\n /**\n * The step's detail, below the title: tags, copy, payloads. Each child is a row of its own, 8px\n * apart, and unstyled, so wrap copy in `Typography.Text`.\n */\n children?: React.ReactNode;\n className?: string;\n}\n\n// The light theme's values as fallbacks: the dot paints before the theme reaches `:host`.\nconst DOT_COLOR: Record<TimelineTone, string> = {\n neutral: 'var(--malachite-text-secondary, rgb(123, 123, 123))',\n info: 'var(--malachite-text-info, rgb(12, 88, 174))',\n success: 'var(--malachite-text-success, rgb(2, 122, 66))',\n warning: 'var(--malachite-text-warning, rgb(150, 88, 10))',\n error: 'var(--malachite-text-error, rgb(237, 53, 54))',\n};\n\n// Mono runs wider than Inter, so it sits a touch under the title, at 0.92em of whatever size the\n// title is, and colour is the title's. A mono space is as wide as a letter, about twice the\n// title's, so the word spacing closes it to match, and a hair of margin evens the gap before it.\nconst TITLE_CODE_STYLE: React.CSSProperties = {\n fontFamily: getFontFamily('mono'),\n fontWeight: getFontWeight('semi-bold'),\n fontSize: '0.92em',\n wordSpacing: '-0.25em',\n marginLeft: '0.08em',\n};\n\nconst SKIPPED_MARK = (\n <svg\n data-timeline-skipped=\"\"\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n className=\"block\"\n style={{ color: DOT_COLOR.neutral }}\n >\n <path\n fill=\"currentColor\"\n d=\"M5.15 9.85l6 6a1.2 1.2 0 0 0 1.7 0l6-6A1.2 1.2 0 0 0 17.15 8.15L12 13.3 6.85 8.15A1.2 1.2 0 0 0 5.15 9.85Z\"\n />\n </svg>\n);\n\nconst Item: React.FC<TimelineItemProps> = ({\n title,\n titleCode,\n time,\n tone,\n marker,\n icon,\n skipped = false,\n stopped = false,\n stoppedLabel,\n skippedLabel,\n meta = [],\n children,\n className = '',\n}) => {\n const id = useId();\n if (skipped && stopped) {\n const name = typeof title === 'string' ? title : '';\n devWarning(\n `Timeline.Item.skipped+stopped:${name || id}`,\n `Timeline.Item${name ? ` \"${name}\"` : ' (with a non-string title)'} got both \\`skipped\\` and \\`stopped\\`; a step that never ran can't be the one the flow ended on, so the badge is dropped.`,\n );\n }\n const isStopped = stopped && !skipped;\n const dotTone = tone ?? (isStopped ? 'error' : 'neutral');\n const shownMarker = skipped ? SKIPPED_MARK : marker;\n const ringless = !skipped && Boolean(marker);\n const code = titleCode?.trim();\n return (\n <li\n className={`relative m-0 flex gap-[14px] pb-[40px] last:pb-0 [&:last-child>[data-timeline-line]]:hidden ${className}`}\n >\n <span\n data-timeline-line=\"\"\n aria-hidden=\"true\"\n className=\"absolute start-[11px] top-[26px] bottom-[2px] w-[2px] bg-[var(--malachite-card-border,rgb(232,232,232))]\"\n />\n <span\n aria-hidden=\"true\"\n // The ring's border would cut into a marker, so a marker gets the full 24px circle instead.\n className={`flex h-[24px] w-[24px] flex-none items-center justify-center overflow-hidden rounded-full ${ringless ? '' : 'border border-solid border-[var(--malachite-card-border,rgb(232,232,232))]'}`}\n >\n {shownMarker ||\n (icon ? (\n <span\n data-timeline-icon={dotTone}\n className=\"flex h-[14px] w-[14px] items-center justify-center overflow-hidden [&>*]:max-h-full [&>*]:max-w-full [&_svg]:max-h-[14px] [&_svg]:max-w-[14px]\"\n style={{ color: DOT_COLOR[dotTone] }}\n >\n {icon}\n </span>\n ) : (\n <span\n data-timeline-dot={dotTone}\n className=\"h-[8px] w-[8px] rounded-full\"\n style={{ backgroundColor: DOT_COLOR[dotTone] }}\n />\n ))}\n </span>\n <div className=\"flex min-w-0 flex-1 flex-col gap-[8px] pt-[2px]\">\n <div className=\"flex items-start justify-between gap-[12px]\">\n <div className=\"flex min-w-0 flex-wrap items-center gap-x-[8px] gap-y-[4px] [overflow-wrap:anywhere]\">\n <Text size=\"small\" fontWeight=\"bold\" className=\"min-w-0 leading-[18px]\">\n {title}\n {code && (\n <>\n {title ? ' ' : null}\n <span translate=\"no\" style={TITLE_CODE_STYLE}>\n {code}\n </span>\n </>\n )}\n </Text>\n {skipped && (\n <span className=\"sr-only\">, {skippedLabel?.trim() || 'skipped'}</span>\n )}\n {isStopped && <span className=\"sr-only\">, </span>}\n {isStopped && (\n <Tag\n value={stoppedLabel?.trim() || 'Stopped here'}\n type=\"error\"\n fontSize=\"xsmall\"\n textTransform=\"none\"\n paddingSize=\"compact\"\n />\n )}\n </div>\n {(time || time === 0) && <span className=\"sr-only\">, </span>}\n {(time || time === 0) && (\n <Text\n size=\"xsmall\"\n color=\"secondary\"\n font=\"mono\"\n wrap={false}\n className=\"pt-[2px]\"\n >\n {time}\n </Text>\n )}\n </div>\n {meta.length > 0 && (\n <dl className=\"m-0 flex flex-wrap gap-x-[18px] gap-y-[6px] leading-[16px]\">\n {meta.map((entry, index) => (\n <div\n key={`${entry.label}-${index}`}\n className=\"flex min-w-0 items-baseline gap-[3px]\"\n >\n <dt className=\"flex\">\n <Text size=\"xsmall\" color=\"secondary\">\n {entry.label}\n </Text>\n </dt>\n <dd className=\"m-0 flex min-w-0 [overflow-wrap:anywhere]\">\n <Text size=\"xsmall\" font=\"mono\">\n {entry.value}\n </Text>\n </dd>\n </div>\n ))}\n </dl>\n )}\n {children}\n </div>\n </li>\n );\n};\n\n/** A vertical sequence of steps, each with a dot on a connecting line, a title, its timing and a body. */\nconst Timeline: React.FC<TimelineProps> & { Item: typeof Item } = ({\n children,\n className = '',\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n}) => (\n <ol\n // list-style: none strips list semantics in WebKit, so VoiceOver would not announce the steps.\n role=\"list\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className={`m-0 list-none p-0 ${className}`}\n >\n {children}\n </ol>\n);\n\nTimeline.Item = Item;\n\nexport default Timeline;\nexport { Timeline };\n"],"names":["DOT_COLOR","TITLE_CODE_STYLE","getFontFamily","getFontWeight","SKIPPED_MARK","jsx","Item","title","titleCode","time","tone","marker","icon","skipped","stopped","stoppedLabel","skippedLabel","meta","children","className","id","useId","name","devWarning","isStopped","dotTone","shownMarker","ringless","code","jsxs","Text","Fragment","Tag","entry","index","Timeline","ariaLabel","ariaLabelledBy"],"mappings":";;;;;;AA+DA,MAAMA,IAA0C;AAAA,EAC5C,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACX,GAKMC,IAAwC;AAAA,EAC1C,YAAYC,EAAc,MAAM;AAAA,EAChC,YAAYC,EAAc,WAAW;AAAA,EACrC,UAAU;AAAA,EACV,aAAa;AAAA,EACb,YAAY;AAChB,GAEMC,IACF,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,yBAAsB;AAAA,IACtB,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,WAAU;AAAA,IACV,OAAO,EAAE,OAAOL,EAAU,QAAA;AAAA,IAE1B,UAAA,gBAAAK;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,MAAK;AAAA,QACL,GAAE;AAAA,MAAA;AAAA,IAAA;AAAA,EACN;AACJ,GAGEC,IAAoC,CAAC;AAAA,EACvC,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,MAAAC;AAAA,EACA,MAAAC;AAAA,EACA,QAAAC;AAAA,EACA,MAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,SAAAC,IAAU;AAAA,EACV,cAAAC;AAAA,EACA,cAA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,MACd,gBAAAL;AAAA,YAAC;AAAA,YAAA;AAAA,cAEG,WAAU;AAAA,cAEV,UAAA;AAAA,gBAAA,gBAAAxB,EAAC,MAAA,EAAG,WAAU,QACV,UAAA,gBAAAA,EAACyB,GAAA,EAAK,MAAK,UAAS,OAAM,aACrB,UAAAG,EAAM,MAAA,CACX,GACJ;AAAA,gBACA,gBAAA5B,EAAC,MAAA,EAAG,WAAU,6CACV,UAAA,gBAAAA,EAACyB,GAAA,EAAK,MAAK,UAAS,MAAK,QACpB,UAAAG,EAAM,MAAA,CACX,EAAA,CACJ;AAAA,cAAA;AAAA,YAAA;AAAA,YAZK,GAAGA,EAAM,KAAK,IAAIC,CAAK;AAAA,UAAA,CAcnC,GACL;AAAA,UAEHhB;AAAA,QAAA,EAAA,CACL;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGZ,GAGMiB,IAA4D,CAAC;AAAA,EAC/D,UAAAjB;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,cAAciB;AAAA,EACd,mBAAmBC;AACvB,MACI,gBAAAhC;AAAA,EAAC;AAAA,EAAA;AAAA,IAEG,MAAK;AAAA,IACL,cAAY+B;AAAA,IACZ,mBAAiBC;AAAA,IACjB,WAAW,qBAAqBlB,CAAS;AAAA,IAExC,UAAAD;AAAA,EAAA;AACL;AAGJiB,EAAS,OAAO7B;"}
1
+ {"version":3,"file":"Timeline.js","sources":["../../src/components/Timeline.tsx"],"sourcesContent":["import React, { useId } from 'react';\nimport Tag from './Tag';\nimport Text from './Typography/Text';\nimport { getFontFamily, getFontWeight } from './Typography/textStyles';\nimport { devWarning } from './devWarning';\nimport { isRenderableNode } from './renderableNode';\n\nexport type TimelineTone = 'neutral' | 'info' | 'success' | 'warning' | 'error';\n\nexport interface TimelineProps {\n children: React.ReactNode;\n className?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n}\n\nexport interface TimelineMetaEntry {\n label: string;\n value: React.ReactNode;\n}\n\nexport interface TimelineItemProps {\n title: React.ReactNode;\n eyebrow?: React.ReactNode;\n /**\n * Code set after the title in the mono face, as one phrase with it, e.g. `title=\"n8n called\"`\n * with `titleCode=\"Salesforce | Delete contact\"`.\n */\n titleCode?: string;\n /** When the step happened, shown at the right of the title, e.g. `+6 ms`. */\n time?: React.ReactNode;\n /**\n * Paints the dot or the `icon`: `error` on a `stopped` step, else `neutral`, unless set. Colour\n * alone, so the title has to say what happened. Ignored when `skipped` or `marker` is set.\n */\n tone?: TimelineTone;\n /** Replaces the ringed dot with a 24px circle of its own, e.g. the caller's logo at size 24. Decorative: hidden from assistive tech. */\n marker?: React.ReactNode;\n /**\n * A 12-14px glyph drawn inside the ring in place of the dot, e.g. `<McpIcon size={13} />`, painted\n * by `tone` through `currentColor`. Use a filled glyph: inside the shadow root every unmarked svg\n * path is filled, so a stroke-only icon turns solid.\n * Decorative: hidden from assistive tech, so the title has to say what it stands for.\n * Precedence: `skipped`, then `marker`, then `icon`, then the dot.\n */\n icon?: React.ReactNode;\n /** A step that never ran: a grey chevron replaces the dot, `tone`, `marker` and `icon`. Wins over `stopped`. */\n skipped?: boolean;\n /** Marks the step the flow ended on, with a badge after the title. Ignored when `skipped`. */\n stopped?: boolean;\n /** The badge's text when `stopped`. Empty falls back to \"Stopped here\". */\n stoppedLabel?: string;\n /** Read to assistive tech after the title when `skipped`. Empty falls back to \"skipped\". */\n skippedLabel?: string;\n /** Label and value pairs in a wrapping row under the title. */\n meta?: readonly TimelineMetaEntry[];\n /**\n * The step's detail, below the title: tags, copy, payloads. Each child is a row of its own, 8px\n * apart, and unstyled, so wrap copy in `Typography.Text`.\n */\n children?: React.ReactNode;\n className?: string;\n}\n\n// The light theme's values as fallbacks: the dot paints before the theme reaches `:host`.\nconst DOT_COLOR: Record<TimelineTone, string> = {\n neutral: 'var(--malachite-text-secondary, rgb(123, 123, 123))',\n info: 'var(--malachite-text-info, rgb(12, 88, 174))',\n success: 'var(--malachite-text-success, rgb(2, 122, 66))',\n warning: 'var(--malachite-text-warning, rgb(150, 88, 10))',\n error: 'var(--malachite-text-error, rgb(237, 53, 54))',\n};\n\n// Mono runs wider than Inter, so it sits a touch under the title, at 0.92em of whatever size the\n// title is, and colour is the title's. A mono space is as wide as a letter, about twice the\n// title's, so the word spacing closes it to match, and a hair of margin evens the gap before it.\nconst TITLE_CODE_STYLE: React.CSSProperties = {\n fontFamily: getFontFamily('mono'),\n fontWeight: getFontWeight('semi-bold'),\n fontSize: '0.92em',\n wordSpacing: '-0.25em',\n marginLeft: '0.08em',\n};\n\nconst SKIPPED_MARK = (\n <svg\n data-timeline-skipped=\"\"\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n className=\"block\"\n style={{ color: DOT_COLOR.neutral }}\n >\n <path\n fill=\"currentColor\"\n d=\"M5.15 9.85l6 6a1.2 1.2 0 0 0 1.7 0l6-6A1.2 1.2 0 0 0 17.15 8.15L12 13.3 6.85 8.15A1.2 1.2 0 0 0 5.15 9.85Z\"\n />\n </svg>\n);\n\nconst Item: React.FC<TimelineItemProps> = ({\n title,\n eyebrow,\n titleCode,\n time,\n tone,\n marker,\n icon,\n skipped = false,\n stopped = false,\n stoppedLabel,\n skippedLabel,\n meta = [],\n children,\n className = '',\n}) => {\n const id = useId();\n if (skipped && stopped) {\n const name = typeof title === 'string' ? title : '';\n devWarning(\n `Timeline.Item.skipped+stopped:${name || id}`,\n `Timeline.Item${name ? ` \"${name}\"` : ' (with a non-string title)'} got both \\`skipped\\` and \\`stopped\\`; a step that never ran can't be the one the flow ended on, so the badge is dropped.`,\n );\n }\n const isStopped = stopped && !skipped;\n const dotTone = tone ?? (isStopped ? 'error' : 'neutral');\n const shownMarker = skipped ? SKIPPED_MARK : marker;\n const ringless = !skipped && Boolean(marker);\n const code = titleCode?.trim();\n const titleRow = (\n <div className=\"flex min-w-0 flex-wrap items-center gap-x-[8px] gap-y-[4px] [overflow-wrap:anywhere]\">\n <Text size=\"small\" fontWeight=\"bold\" className=\"min-w-0 leading-[18px]\">\n {title}\n {code && (\n <>\n {title ? ' ' : null}\n <span translate=\"no\" style={TITLE_CODE_STYLE}>\n {code}\n </span>\n </>\n )}\n </Text>\n {skipped && <span className=\"sr-only\">, {skippedLabel?.trim() || 'skipped'}</span>}\n {isStopped && <span className=\"sr-only\">, </span>}\n {isStopped && (\n <Tag\n value={stoppedLabel?.trim() || 'Stopped here'}\n type=\"error\"\n fontSize=\"xsmall\"\n textTransform=\"none\"\n paddingSize=\"compact\"\n />\n )}\n </div>\n );\n return (\n <li\n className={`relative m-0 flex gap-[14px] pb-[40px] last:pb-0 [&:last-child>[data-timeline-line]]:hidden ${className}`}\n >\n <span\n data-timeline-line=\"\"\n aria-hidden=\"true\"\n className=\"absolute start-[11px] top-[26px] bottom-[2px] w-[2px] bg-[var(--malachite-card-border,rgb(232,232,232))]\"\n />\n <span\n aria-hidden=\"true\"\n // The ring's border would cut into a marker, so a marker gets the full 24px circle instead.\n className={`flex h-[24px] w-[24px] flex-none items-center justify-center overflow-hidden rounded-full ${ringless ? '' : 'border border-solid border-[var(--malachite-card-border,rgb(232,232,232))]'}`}\n >\n {shownMarker ||\n (icon ? (\n <span\n data-timeline-icon={dotTone}\n className=\"flex h-[14px] w-[14px] items-center justify-center overflow-hidden [&>*]:max-h-full [&>*]:max-w-full [&_svg]:max-h-[14px] [&_svg]:max-w-[14px]\"\n style={{ color: DOT_COLOR[dotTone] }}\n >\n {icon}\n </span>\n ) : (\n <span\n data-timeline-dot={dotTone}\n className=\"h-[8px] w-[8px] rounded-full\"\n style={{ backgroundColor: DOT_COLOR[dotTone] }}\n />\n ))}\n </span>\n <div className=\"flex min-w-0 flex-1 flex-col gap-[8px] pt-[2px]\">\n <div\n className={`flex justify-between gap-[12px] ${isRenderableNode(eyebrow) ? 'items-end' : 'items-start'}`}\n >\n {isRenderableNode(eyebrow) ? (\n <div className=\"flex min-w-0 flex-col gap-[2px]\">\n <Text size=\"xsmall\" color=\"secondary\" fontWeight=\"semi-bold\">\n {eyebrow}\n </Text>\n {titleRow}\n </div>\n ) : (\n titleRow\n )}\n {(time || time === 0) && <span className=\"sr-only\">, </span>}\n {(time || time === 0) && (\n <Text\n size=\"xsmall\"\n color=\"secondary\"\n font=\"mono\"\n wrap={false}\n className=\"pt-[2px]\"\n >\n {time}\n </Text>\n )}\n </div>\n {meta.length > 0 && (\n <dl className=\"m-0 flex flex-wrap gap-x-[18px] gap-y-[6px] leading-[16px]\">\n {meta.map((entry, index) => (\n <div\n key={`${entry.label}-${index}`}\n className=\"flex min-w-0 items-baseline gap-[3px]\"\n >\n <dt className=\"flex\">\n <Text size=\"xsmall\" color=\"secondary\">\n {entry.label}\n </Text>\n </dt>\n <dd className=\"m-0 flex min-w-0 [overflow-wrap:anywhere]\">\n <Text size=\"xsmall\" font=\"mono\">\n {entry.value}\n </Text>\n </dd>\n </div>\n ))}\n </dl>\n )}\n {children}\n </div>\n </li>\n );\n};\n\n/** A vertical sequence of steps, each with a dot on a connecting line, a title, its timing and a body. */\nconst Timeline: React.FC<TimelineProps> & { Item: typeof Item } = ({\n children,\n className = '',\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n}) => (\n <ol\n // list-style: none strips list semantics in WebKit, so VoiceOver would not announce the steps.\n role=\"list\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className={`m-0 list-none p-0 ${className}`}\n >\n {children}\n </ol>\n);\n\nTimeline.Item = Item;\n\nexport default Timeline;\nexport { Timeline };\n"],"names":["DOT_COLOR","TITLE_CODE_STYLE","getFontFamily","getFontWeight","SKIPPED_MARK","jsx","Item","title","eyebrow","titleCode","time","tone","marker","icon","skipped","stopped","stoppedLabel","skippedLabel","meta","children","className","id","useId","name","devWarning","isStopped","dotTone","shownMarker","ringless","code","titleRow","jsxs","Text","Fragment","Tag","isRenderableNode","entry","index","Timeline","ariaLabel","ariaLabelledBy"],"mappings":";;;;;;;AAiEA,MAAMA,IAA0C;AAAA,EAC5C,SAAS;AAAA,EACT,MAAM;AAAA,EAC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