@stackone/malachite 2.105.0 → 2.105.1
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/components/Accordion.js +80 -79
- package/dist/components/Accordion.js.map +1 -1
- package/dist/components/Button.js +53 -58
- package/dist/components/Button.js.map +1 -1
- package/dist/components/ButtonList.js +10 -10
- package/dist/components/ButtonList.js.map +1 -1
- package/dist/components/LinkCard.js +78 -55
- package/dist/components/LinkCard.js.map +1 -1
- package/dist/components/Surface.js +45 -44
- package/dist/components/Surface.js.map +1 -1
- package/dist/components/Timeline.js +77 -66
- package/dist/components/Timeline.js.map +1 -1
- package/dist/components/chromeStyles.js +4 -2
- package/dist/components/chromeStyles.js.map +1 -1
- package/dist/components/focusRing.js +16 -9
- package/dist/components/focusRing.js.map +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/tailwind.css.js +1 -1
- package/package.json +1 -1
|
@@ -1,59 +1,66 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
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";
|
|
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";
|
|
7
|
+
const p = {
|
|
6
8
|
neutral: "var(--malachite-text-secondary, rgb(123, 123, 123))",
|
|
7
9
|
info: "var(--malachite-text-info, rgb(12, 88, 174))",
|
|
8
10
|
success: "var(--malachite-text-success, rgb(2, 122, 66))",
|
|
9
11
|
warning: "var(--malachite-text-warning, rgb(150, 88, 10))",
|
|
10
12
|
error: "var(--malachite-text-error, rgb(237, 53, 54))"
|
|
11
|
-
},
|
|
12
|
-
fontFamily:
|
|
13
|
-
fontWeight:
|
|
13
|
+
}, E = {
|
|
14
|
+
fontFamily: j("mono"),
|
|
15
|
+
fontWeight: _("semi-bold"),
|
|
14
16
|
fontSize: "0.92em",
|
|
15
17
|
wordSpacing: "-0.25em",
|
|
16
18
|
marginLeft: "0.08em"
|
|
17
|
-
},
|
|
19
|
+
}, O = /* @__PURE__ */ e(
|
|
18
20
|
"svg",
|
|
19
21
|
{
|
|
20
22
|
"data-timeline-skipped": "",
|
|
21
23
|
width: "14",
|
|
22
24
|
height: "14",
|
|
23
25
|
viewBox: "0 0 24 24",
|
|
24
|
-
className: "block
|
|
26
|
+
className: "block",
|
|
27
|
+
style: { color: p.neutral },
|
|
25
28
|
children: /* @__PURE__ */ e(
|
|
26
29
|
"path",
|
|
27
30
|
{
|
|
28
|
-
|
|
29
|
-
d: "
|
|
30
|
-
fill: "none",
|
|
31
|
-
stroke: "currentColor",
|
|
32
|
-
strokeWidth: "2.4",
|
|
33
|
-
strokeLinecap: "round",
|
|
34
|
-
strokeLinejoin: "round"
|
|
31
|
+
fill: "currentColor",
|
|
32
|
+
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"
|
|
35
33
|
}
|
|
36
34
|
)
|
|
37
35
|
}
|
|
38
|
-
),
|
|
36
|
+
), W = ({
|
|
39
37
|
title: n,
|
|
40
|
-
titleCode:
|
|
41
|
-
time:
|
|
42
|
-
tone:
|
|
43
|
-
marker:
|
|
44
|
-
icon:
|
|
45
|
-
skipped:
|
|
46
|
-
stopped:
|
|
47
|
-
stoppedLabel:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
38
|
+
titleCode: t,
|
|
39
|
+
time: l,
|
|
40
|
+
tone: c,
|
|
41
|
+
marker: h,
|
|
42
|
+
icon: f,
|
|
43
|
+
skipped: s = !1,
|
|
44
|
+
stopped: g = !1,
|
|
45
|
+
stoppedLabel: m,
|
|
46
|
+
skippedLabel: d,
|
|
47
|
+
meta: w = [],
|
|
48
|
+
children: u,
|
|
49
|
+
className: v = ""
|
|
51
50
|
}) => {
|
|
52
|
-
const
|
|
53
|
-
|
|
51
|
+
const y = z();
|
|
52
|
+
if (s && g) {
|
|
53
|
+
const r = typeof n == "string" ? n : "";
|
|
54
|
+
F(
|
|
55
|
+
`Timeline.Item.skipped+stopped:${r || y}`,
|
|
56
|
+
`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
|
+
);
|
|
58
|
+
}
|
|
59
|
+
const x = g && !s, i = c ?? (x ? "error" : "neutral"), N = s ? O : h, T = !s && !!h, b = t == null ? void 0 : t.trim();
|
|
60
|
+
return /* @__PURE__ */ a(
|
|
54
61
|
"li",
|
|
55
62
|
{
|
|
56
|
-
className: `relative m-0 flex gap-[14px] pb-[40px] last:pb-0 [&:last-child>[data-timeline-line]]:hidden ${
|
|
63
|
+
className: `relative m-0 flex gap-[14px] pb-[40px] last:pb-0 [&:last-child>[data-timeline-line]]:hidden ${v}`,
|
|
57
64
|
children: [
|
|
58
65
|
/* @__PURE__ */ e(
|
|
59
66
|
"span",
|
|
@@ -67,40 +74,44 @@ const f = {
|
|
|
67
74
|
"span",
|
|
68
75
|
{
|
|
69
76
|
"aria-hidden": "true",
|
|
70
|
-
className: `flex h-[24px] w-[24px] flex-none items-center justify-center overflow-hidden rounded-full ${
|
|
71
|
-
children:
|
|
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(
|
|
72
79
|
"span",
|
|
73
80
|
{
|
|
74
81
|
"data-timeline-icon": i,
|
|
75
82
|
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]",
|
|
76
|
-
style: { color:
|
|
77
|
-
children:
|
|
83
|
+
style: { color: p[i] },
|
|
84
|
+
children: f
|
|
78
85
|
}
|
|
79
86
|
) : /* @__PURE__ */ e(
|
|
80
87
|
"span",
|
|
81
88
|
{
|
|
82
89
|
"data-timeline-dot": i,
|
|
83
90
|
className: "h-[8px] w-[8px] rounded-full",
|
|
84
|
-
style: { backgroundColor:
|
|
91
|
+
style: { backgroundColor: p[i] }
|
|
85
92
|
}
|
|
86
93
|
))
|
|
87
94
|
}
|
|
88
95
|
),
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__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: [
|
|
93
100
|
n,
|
|
94
|
-
|
|
101
|
+
b && /* @__PURE__ */ a($, { children: [
|
|
95
102
|
n ? " " : null,
|
|
96
|
-
/* @__PURE__ */ e("span", { translate: "no", style:
|
|
103
|
+
/* @__PURE__ */ e("span", { translate: "no", style: E, children: b })
|
|
97
104
|
] })
|
|
98
105
|
] }),
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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,
|
|
102
113
|
{
|
|
103
|
-
value: (
|
|
114
|
+
value: (m == null ? void 0 : m.trim()) || "Stopped here",
|
|
104
115
|
type: "error",
|
|
105
116
|
fontSize: "xsmall",
|
|
106
117
|
textTransform: "none",
|
|
@@ -108,53 +119,53 @@ const f = {
|
|
|
108
119
|
}
|
|
109
120
|
)
|
|
110
121
|
] }),
|
|
111
|
-
(
|
|
112
|
-
(
|
|
113
|
-
|
|
122
|
+
(l || l === 0) && /* @__PURE__ */ e("span", { className: "sr-only", children: ", " }),
|
|
123
|
+
(l || l === 0) && /* @__PURE__ */ e(
|
|
124
|
+
o,
|
|
114
125
|
{
|
|
115
126
|
size: "xsmall",
|
|
116
127
|
color: "secondary",
|
|
117
128
|
font: "mono",
|
|
118
129
|
wrap: !1,
|
|
119
130
|
className: "pt-[2px]",
|
|
120
|
-
children:
|
|
131
|
+
children: l
|
|
121
132
|
}
|
|
122
133
|
)
|
|
123
134
|
] }),
|
|
124
|
-
|
|
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(
|
|
125
136
|
"div",
|
|
126
137
|
{
|
|
127
138
|
className: "flex min-w-0 items-baseline gap-[3px]",
|
|
128
139
|
children: [
|
|
129
|
-
/* @__PURE__ */ e("dt", { className: "flex", children: /* @__PURE__ */ e(
|
|
130
|
-
/* @__PURE__ */ e("dd", { className: "m-0 flex min-w-0 [overflow-wrap:anywhere]", children: /* @__PURE__ */ e(
|
|
140
|
+
/* @__PURE__ */ e("dt", { className: "flex", children: /* @__PURE__ */ e(o, { size: "xsmall", color: "secondary", children: r.label }) }),
|
|
141
|
+
/* @__PURE__ */ e("dd", { className: "m-0 flex min-w-0 [overflow-wrap:anywhere]", children: /* @__PURE__ */ e(o, { size: "xsmall", font: "mono", children: r.value }) })
|
|
131
142
|
]
|
|
132
143
|
},
|
|
133
|
-
`${
|
|
144
|
+
`${r.label}-${S}`
|
|
134
145
|
)) }),
|
|
135
|
-
|
|
146
|
+
u
|
|
136
147
|
] })
|
|
137
148
|
]
|
|
138
149
|
}
|
|
139
150
|
);
|
|
140
|
-
},
|
|
151
|
+
}, A = ({
|
|
141
152
|
children: n,
|
|
142
|
-
className:
|
|
143
|
-
"aria-label":
|
|
144
|
-
"aria-labelledby":
|
|
153
|
+
className: t = "",
|
|
154
|
+
"aria-label": l,
|
|
155
|
+
"aria-labelledby": c
|
|
145
156
|
}) => /* @__PURE__ */ e(
|
|
146
157
|
"ol",
|
|
147
158
|
{
|
|
148
159
|
role: "list",
|
|
149
|
-
"aria-label":
|
|
150
|
-
"aria-labelledby":
|
|
151
|
-
className: `m-0 list-none p-0 ${
|
|
160
|
+
"aria-label": l,
|
|
161
|
+
"aria-labelledby": c,
|
|
162
|
+
className: `m-0 list-none p-0 ${t}`,
|
|
152
163
|
children: n
|
|
153
164
|
}
|
|
154
165
|
);
|
|
155
|
-
|
|
166
|
+
A.Item = W;
|
|
156
167
|
export {
|
|
157
|
-
|
|
158
|
-
|
|
168
|
+
A as Timeline,
|
|
169
|
+
A as default
|
|
159
170
|
};
|
|
160
171
|
//# sourceMappingURL=Timeline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Timeline.js","sources":["../../src/components/Timeline.tsx"],"sourcesContent":["import React from 'react';\nimport Tag from './Tag';\nimport Text from './Typography/Text';\nimport { getFontFamily, getFontWeight } from './Typography/textStyles';\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 `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`. */\n skipped?: boolean;\n /** Marks the step the flow ended on, with a badge after the title. */\n stopped?: boolean;\n /** The badge's text when `stopped`. Empty falls back to \"Stopped here\". */\n stoppedLabel?: 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\n// Stroked, so it opts out of the global path fill reset.\nconst SKIPPED_MARK = (\n <svg\n data-timeline-skipped=\"\"\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n className=\"block text-[var(--malachite-text-placeholder,rgb(187,187,187))]\"\n >\n <path\n data-malachite-shape=\"\"\n d=\"M6 9l6 6 6-6\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2.4\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\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 meta = [],\n children,\n className = '',\n}) => {\n const dotTone = tone ?? (stopped ? 'error' : 'neutral');\n const shownMarker = skipped ? SKIPPED_MARK : 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 ${shownMarker ? '' : '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 {stopped && <span className=\"sr-only\">, </span>}\n {stopped && (\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","meta","children","className","dotTone","shownMarker","code","jsxs","Text","Fragment","Tag","entry","index","Timeline","ariaLabel","ariaLabelledBy"],"mappings":";;;;AA4DA,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,GAGMC,IACF,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,yBAAsB;AAAA,IACtB,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,WAAU;AAAA,IAEV,UAAA,gBAAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,wBAAqB;AAAA,QACrB,GAAE;AAAA,QACF,MAAK;AAAA,QACL,QAAO;AAAA,QACP,aAAY;AAAA,QACZ,eAAc;AAAA,QACd,gBAAe;AAAA,MAAA;AAAA,IAAA;AAAA,EACnB;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,MAAAC,IAAO,CAAA;AAAA,EACP,UAAAC;AAAA,E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AAA,IAAA;AAAA,EAAA;AAGZ,GAGMW,IAA4D,CAAC;AAAA,EAC/D,UAAAX;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,cAAcW;AAAA,EACd,mBAAmBC;AACvB,MACI,gBAAAzB;AAAA,EAAC;AAAA,EAAA;AAAA,IAEG,MAAK;AAAA,IACL,cAAYwB;AAAA,IACZ,mBAAiBC;AAAA,IACjB,WAAW,qBAAqBZ,CAAS;AAAA,IAExC,UAAAD;AAAA,EAAA;AACL;AAGJW,EAAS,OAAOtB;"}
|
|
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,cAAAC;AAAA,EACA,MAAAC,IAAO,CAAA;AAAA,EACP,UAAAC;AAAA,EACA,WAAAC,IAAY;AAChB,MAAM;A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BAAAxB,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,6 +1,8 @@
|
|
|
1
|
-
const r = "border-[var(--malachite-card-border,rgb(232,232,232))]", o = "[scrollbar-width:none] [&::-webkit-scrollbar]:hidden";
|
|
1
|
+
const r = "border-[var(--malachite-card-border,rgb(232,232,232))]", o = "[scrollbar-width:none] [&::-webkit-scrollbar]:hidden", t = "transition-colors hover:bg-[var(--malachite-buttonlist-hover-background,rgb(245,245,245))]", a = "var(--malachite-buttonlist-hover-background,rgb(245,245,245))";
|
|
2
2
|
export {
|
|
3
3
|
r as BORDER,
|
|
4
|
-
o as NO_SCROLLBAR
|
|
4
|
+
o as NO_SCROLLBAR,
|
|
5
|
+
t as ROW_HOVER,
|
|
6
|
+
a as ROW_HOVER_COLOR
|
|
5
7
|
};
|
|
6
8
|
//# sourceMappingURL=chromeStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chromeStyles.js","sources":["../../src/components/chromeStyles.ts"],"sourcesContent":["export const BORDER = 'border-[var(--malachite-card-border,rgb(232,232,232))]';\n\nexport const NO_SCROLLBAR = '[scrollbar-width:none] [&::-webkit-scrollbar]:hidden';\n"],"names":["BORDER","NO_SCROLLBAR"],"mappings":"AAAO,MAAMA,IAAS,0DAETC,IAAe;"}
|
|
1
|
+
{"version":3,"file":"chromeStyles.js","sources":["../../src/components/chromeStyles.ts"],"sourcesContent":["export const BORDER = 'border-[var(--malachite-card-border,rgb(232,232,232))]';\n\nexport const NO_SCROLLBAR = '[scrollbar-width:none] [&::-webkit-scrollbar]:hidden';\n\nexport const ROW_HOVER =\n 'transition-colors hover:bg-[var(--malachite-buttonlist-hover-background,rgb(245,245,245))]';\n\nexport const ROW_HOVER_COLOR = 'var(--malachite-buttonlist-hover-background,rgb(245,245,245))';\n"],"names":["BORDER","NO_SCROLLBAR","ROW_HOVER","ROW_HOVER_COLOR"],"mappings":"AAAO,MAAMA,IAAS,0DAETC,IAAe,wDAEfC,IACT,8FAESC,IAAkB;"}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
const
|
|
1
|
+
const t = "outline-none focus-visible:outline-offset-2 focus-visible:[outline:2px_solid_var(--malachite-text-primary)]", s = "outline-none focus-visible:[outline:2px_solid_var(--malachite-text-primary)] focus-visible:[outline-offset:-2px]", i = "pointer-events-none absolute inset-0 hidden [outline:2px_solid_var(--malachite-text-primary)] [outline-offset:-2px]", n = `${i} z-[2] group-focus-visible:block`, l = "outline-none has-[[role=radio]:focus-visible]:outline-offset-2 has-[[role=radio]:focus-visible]:[outline:2px_solid_var(--malachite-text-primary)]", u = "outline-none focus-visible:outline-offset-2 focus-visible:[outline:2px_solid_var(--malachite-selection-bar-foreground)]", r = "outline-none focus-visible:[outline:2px_solid_var(--malachite-inline-confirm-foreground)] focus-visible:[outline-offset:-2px]", c = "outline-none focus-visible:outline-offset-2 focus-visible:[outline:2px_solid_var(--malachite-close-button-inverse-hover-foreground,rgb(255,255,255))]", _ = (o, e = !0) => {
|
|
2
|
+
try {
|
|
3
|
+
return o.matches(":focus-visible");
|
|
4
|
+
} catch {
|
|
5
|
+
return e;
|
|
6
|
+
}
|
|
7
|
+
};
|
|
2
8
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
t as FOCUS_RING,
|
|
10
|
+
c as FOCUS_RING_CLOSE_BUTTON_INVERSE,
|
|
11
|
+
r as FOCUS_RING_INLINE_CONFIRM_INSET,
|
|
12
|
+
s as FOCUS_RING_INSET,
|
|
13
|
+
n as FOCUS_RING_INSET_OVERLAY,
|
|
14
|
+
i as FOCUS_RING_INSET_OVERLAY_HIDDEN,
|
|
15
|
+
u as FOCUS_RING_SELECTION_BAR,
|
|
16
|
+
l as FOCUS_RING_WITHIN_RADIO,
|
|
17
|
+
_ as isFocusVisible
|
|
11
18
|
};
|
|
12
19
|
//# sourceMappingURL=focusRing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focusRing.js","sources":["../../src/components/focusRing.ts"],"sourcesContent":["// Shared keyboard focus indicator for interactive components.\n\n/** Standard focus ring — sits 2px outside the control. */\nexport const FOCUS_RING =\n 'outline-none focus-visible:outline-offset-2 focus-visible:[outline:2px_solid_var(--malachite-text-primary)]';\n\n/**\n * Inset focus ring — drawn 2px inside the element edge. Use for full-bleed elements\n * inside an `overflow-hidden` container (e.g. Surface.Row) where an outset outline\n * would be clipped.\n */\nexport const FOCUS_RING_INSET =\n 'outline-none focus-visible:[outline:2px_solid_var(--malachite-text-primary)] focus-visible:[outline-offset:-2px]';\n\nexport const FOCUS_RING_INSET_OVERLAY_HIDDEN =\n 'pointer-events-none absolute inset-0 hidden [outline:2px_solid_var(--malachite-text-primary)] [outline-offset:-2px]';\n\n/** `FOCUS_RING_INSET` drawn by an overlay while its `group` ancestor has keyboard focus. */\nexport const FOCUS_RING_INSET_OVERLAY = `${FOCUS_RING_INSET_OVERLAY_HIDDEN} z-[2] group-focus-visible:block`;\n\n/** Ring drawn on a wrapper when a control *inside* it takes focus. */\nexport const FOCUS_RING_WITHIN =\n 'outline-none has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:[outline:2px_solid_var(--malachite-text-primary)]';\n\n/**\n * As `FOCUS_RING_WITHIN`, for a card whose control is a `role=\"radio\"` beside its links:\n * `:has(:focus-visible)` would also match a focused link and draw a second ring.\n */\nexport const FOCUS_RING_WITHIN_RADIO =\n 'outline-none has-[[role=radio]:focus-visible]:outline-offset-2 has-[[role=radio]:focus-visible]:[outline:2px_solid_var(--malachite-text-primary)]';\n\n/** Ring for a control on the SelectionBar, where `FOCUS_RING` would be invisible. */\nexport const FOCUS_RING_SELECTION_BAR =\n 'outline-none focus-visible:outline-offset-2 focus-visible:[outline:2px_solid_var(--malachite-selection-bar-foreground)]';\n\n/** Inset ring for a control on the InlineConfirm chip. */\nexport const FOCUS_RING_INLINE_CONFIRM_INSET =\n 'outline-none focus-visible:[outline:2px_solid_var(--malachite-inline-confirm-foreground)] focus-visible:[outline-offset:-2px]';\n\n/** Ring for `CloseButton surface=\"inverse\"`, where `FOCUS_RING` would be invisible on the dark panel. */\nexport const FOCUS_RING_CLOSE_BUTTON_INVERSE =\n 'outline-none focus-visible:outline-offset-2 focus-visible:[outline:2px_solid_var(--malachite-close-button-inverse-hover-foreground,rgb(255,255,255))]';\n"],"names":["FOCUS_RING","FOCUS_RING_INSET","FOCUS_RING_INSET_OVERLAY_HIDDEN","FOCUS_RING_INSET_OVERLAY","FOCUS_RING_WITHIN_RADIO","FOCUS_RING_SELECTION_BAR","FOCUS_RING_INLINE_CONFIRM_INSET","FOCUS_RING_CLOSE_BUTTON_INVERSE"],"mappings":"AAGO,MAAMA,IACT,+GAOSC,IACT,oHAESC,IACT,uHAGSC,IAA2B,GAAGD,CAA+B,oCAU7DE,IACT,qJAGSC,IACT,2HAGSC,IACT,iIAGSC,IACT;"}
|
|
1
|
+
{"version":3,"file":"focusRing.js","sources":["../../src/components/focusRing.ts"],"sourcesContent":["// Shared keyboard focus indicator for interactive components.\n\n/** Standard focus ring — sits 2px outside the control. */\nexport const FOCUS_RING =\n 'outline-none focus-visible:outline-offset-2 focus-visible:[outline:2px_solid_var(--malachite-text-primary)]';\n\n/**\n * Inset focus ring — drawn 2px inside the element edge. Use for full-bleed elements\n * inside an `overflow-hidden` container (e.g. Surface.Row) where an outset outline\n * would be clipped.\n */\nexport const FOCUS_RING_INSET =\n 'outline-none focus-visible:[outline:2px_solid_var(--malachite-text-primary)] focus-visible:[outline-offset:-2px]';\n\nexport const FOCUS_RING_INSET_OVERLAY_HIDDEN =\n 'pointer-events-none absolute inset-0 hidden [outline:2px_solid_var(--malachite-text-primary)] [outline-offset:-2px]';\n\n/** `FOCUS_RING_INSET` drawn by an overlay while its `group` ancestor has keyboard focus. */\nexport const FOCUS_RING_INSET_OVERLAY = `${FOCUS_RING_INSET_OVERLAY_HIDDEN} z-[2] group-focus-visible:block`;\n\n/** Ring drawn on a wrapper when a control *inside* it takes focus. */\nexport const FOCUS_RING_WITHIN =\n 'outline-none has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:[outline:2px_solid_var(--malachite-text-primary)]';\n\n/**\n * As `FOCUS_RING_WITHIN`, for a card whose control is a `role=\"radio\"` beside its links:\n * `:has(:focus-visible)` would also match a focused link and draw a second ring.\n */\nexport const FOCUS_RING_WITHIN_RADIO =\n 'outline-none has-[[role=radio]:focus-visible]:outline-offset-2 has-[[role=radio]:focus-visible]:[outline:2px_solid_var(--malachite-text-primary)]';\n\n/** Ring for a control on the SelectionBar, where `FOCUS_RING` would be invisible. */\nexport const FOCUS_RING_SELECTION_BAR =\n 'outline-none focus-visible:outline-offset-2 focus-visible:[outline:2px_solid_var(--malachite-selection-bar-foreground)]';\n\n/** Inset ring for a control on the InlineConfirm chip. */\nexport const FOCUS_RING_INLINE_CONFIRM_INSET =\n 'outline-none focus-visible:[outline:2px_solid_var(--malachite-inline-confirm-foreground)] focus-visible:[outline-offset:-2px]';\n\n/** Ring for `CloseButton surface=\"inverse\"`, where `FOCUS_RING` would be invisible on the dark panel. */\nexport const FOCUS_RING_CLOSE_BUTTON_INVERSE =\n 'outline-none focus-visible:outline-offset-2 focus-visible:[outline:2px_solid_var(--malachite-close-button-inverse-hover-foreground,rgb(255,255,255))]';\n\n/** `fallback` is the answer where the browser can't match `:focus-visible`. */\nexport const isFocusVisible = (element: Element, fallback = true): boolean => {\n try {\n return element.matches(':focus-visible');\n } catch {\n return fallback;\n }\n};\n"],"names":["FOCUS_RING","FOCUS_RING_INSET","FOCUS_RING_INSET_OVERLAY_HIDDEN","FOCUS_RING_INSET_OVERLAY","FOCUS_RING_WITHIN_RADIO","FOCUS_RING_SELECTION_BAR","FOCUS_RING_INLINE_CONFIRM_INSET","FOCUS_RING_CLOSE_BUTTON_INVERSE","isFocusVisible","element","fallback"],"mappings":"AAGO,MAAMA,IACT,+GAOSC,IACT,oHAESC,IACT,uHAGSC,IAA2B,GAAGD,CAA+B,oCAU7DE,IACT,qJAGSC,IACT,2HAGSC,IACT,iIAGSC,IACT,yJAGSC,IAAiB,CAACC,GAAkBC,IAAW,OAAkB;AAC1E,MAAI;AACA,WAAOD,EAAQ,QAAQ,gBAAgB;AAAA,EAC3C,QAAQ;AACJ,WAAOC;AAAA,EACX;AACJ;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3400,7 +3400,7 @@ export declare const LinkCard: default_2.FC<LinkCardProps>;
|
|
|
3400
3400
|
|
|
3401
3401
|
export declare interface LinkCardProps {
|
|
3402
3402
|
title: string;
|
|
3403
|
-
/** One line under the title;
|
|
3403
|
+
/** One line under the title; shown in full on hover, or when a clickable card takes keyboard focus. */
|
|
3404
3404
|
description?: string;
|
|
3405
3405
|
/** Colours the title. */
|
|
3406
3406
|
tone?: LinkCardTone;
|
|
@@ -6187,7 +6187,7 @@ export declare interface TimelineItemProps {
|
|
|
6187
6187
|
time?: default_2.ReactNode;
|
|
6188
6188
|
/**
|
|
6189
6189
|
* Paints the dot or the `icon`: `error` on a `stopped` step, else `neutral`, unless set. Colour
|
|
6190
|
-
* alone, so the title has to say what happened. Ignored when `marker` is set.
|
|
6190
|
+
* alone, so the title has to say what happened. Ignored when `skipped` or `marker` is set.
|
|
6191
6191
|
*/
|
|
6192
6192
|
tone?: TimelineTone;
|
|
6193
6193
|
/** 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. */
|
|
@@ -6200,12 +6200,14 @@ export declare interface TimelineItemProps {
|
|
|
6200
6200
|
* Precedence: `skipped`, then `marker`, then `icon`, then the dot.
|
|
6201
6201
|
*/
|
|
6202
6202
|
icon?: default_2.ReactNode;
|
|
6203
|
-
/** A step that never ran: a grey chevron replaces the dot, `tone`, `marker` and `icon`. */
|
|
6203
|
+
/** A step that never ran: a grey chevron replaces the dot, `tone`, `marker` and `icon`. Wins over `stopped`. */
|
|
6204
6204
|
skipped?: boolean;
|
|
6205
|
-
/** Marks the step the flow ended on, with a badge after the title. */
|
|
6205
|
+
/** Marks the step the flow ended on, with a badge after the title. Ignored when `skipped`. */
|
|
6206
6206
|
stopped?: boolean;
|
|
6207
6207
|
/** The badge's text when `stopped`. Empty falls back to "Stopped here". */
|
|
6208
6208
|
stoppedLabel?: string;
|
|
6209
|
+
/** Read to assistive tech after the title when `skipped`. Empty falls back to "skipped". */
|
|
6210
|
+
skippedLabel?: string;
|
|
6209
6211
|
/** Label and value pairs in a wrapping row under the title. */
|
|
6210
6212
|
meta?: readonly TimelineMetaEntry[];
|
|
6211
6213
|
/**
|