oneslash-design-system 2.23.1 → 2.25.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.
- package/README.md +1 -1
- package/dist/DESIGN.md +20 -5
- package/dist/cases/activity-timeline/activity.d.ts +1 -0
- package/dist/cases/activity-timeline/activity.jsx +43 -0
- package/dist/cases/activity-timeline/versions.d.ts +1 -0
- package/dist/cases/activity-timeline/versions.jsx +130 -0
- package/dist/cases/activity-timeline.md +315 -0
- package/dist/cases/agent-plan-proposal.md +1 -0
- package/dist/cases/ask-page/answered.d.ts +1 -0
- package/dist/cases/ask-page/answered.jsx +248 -0
- package/dist/cases/ask-page/first-visit.d.ts +1 -0
- package/dist/cases/ask-page/first-visit.jsx +118 -0
- package/dist/cases/ask-page.md +551 -0
- package/dist/cases/billing-page/self-serve.jsx +4 -4
- package/dist/cases/billing-page/trial.d.ts +1 -0
- package/dist/cases/billing-page/trial.jsx +115 -0
- package/dist/cases/billing-page.md +166 -5
- package/dist/cases/chart/bars.d.ts +1 -0
- package/dist/cases/chart/bars.jsx +83 -0
- package/dist/cases/chart/lines.d.ts +1 -0
- package/dist/cases/chart/lines.jsx +71 -0
- package/dist/cases/chart.md +258 -0
- package/dist/cases/collapsible-search/popover.jsx +1 -1
- package/dist/cases/collapsible-search.md +2 -2
- package/dist/cases/comment-thread/card.d.ts +1 -0
- package/dist/cases/comment-thread/card.jsx +141 -0
- package/dist/cases/comment-thread/thread.d.ts +1 -0
- package/dist/cases/comment-thread/thread.jsx +87 -0
- package/dist/cases/comment-thread.md +349 -0
- package/dist/cases/cookie-choice/banner.d.ts +1 -0
- package/dist/cases/cookie-choice/banner.jsx +82 -0
- package/dist/cases/cookie-choice/settings.d.ts +1 -0
- package/dist/cases/cookie-choice/settings.jsx +75 -0
- package/dist/cases/cookie-choice.md +234 -0
- package/dist/cases/dashboard/numbers-first.jsx +63 -2
- package/dist/cases/dashboard/work-first.jsx +1 -1
- package/dist/cases/dashboard.md +77 -5
- package/dist/cases/data-table-page/all-rows.jsx +1 -1
- package/dist/cases/data-table-page/paged.jsx +1 -1
- package/dist/cases/data-table-page.md +2 -2
- package/dist/cases/invoice-list/table.jsx +21 -9
- package/dist/cases/invoice-list.md +27 -12
- package/dist/cases/leaderboard/ranked.d.ts +1 -0
- package/dist/cases/leaderboard/ranked.jsx +44 -0
- package/dist/cases/leaderboard/table.d.ts +1 -0
- package/dist/cases/leaderboard/table.jsx +87 -0
- package/dist/cases/leaderboard.md +177 -0
- package/dist/cases/message-reactions/picker.jsx +1 -1
- package/dist/cases/message-reactions.md +2 -2
- package/dist/cases/message-row.md +2 -1
- package/dist/cases/newsletter-signup/inline.d.ts +1 -0
- package/dist/cases/newsletter-signup/inline.jsx +72 -0
- package/dist/cases/newsletter-signup/section.d.ts +1 -0
- package/dist/cases/newsletter-signup/section.jsx +72 -0
- package/dist/cases/newsletter-signup.md +234 -0
- package/dist/cases/number-format.md +9 -3
- package/dist/cases/onboarding/checklist.d.ts +1 -0
- package/dist/cases/onboarding/checklist.jsx +92 -0
- package/dist/cases/onboarding/steps.d.ts +3 -0
- package/dist/cases/onboarding/steps.jsx +177 -0
- package/dist/cases/onboarding.md +368 -0
- package/dist/cases/people-row/stack.jsx +1 -1
- package/dist/cases/people-row.md +2 -2
- package/dist/cases/plan-comparison/table.d.ts +1 -0
- package/dist/cases/plan-comparison/table.jsx +47 -0
- package/dist/cases/plan-comparison.md +94 -0
- package/dist/cases/plan-picker.md +1 -0
- package/dist/cases/plan-sign-off/one-approver.d.ts +1 -0
- package/dist/cases/plan-sign-off/one-approver.jsx +129 -0
- package/dist/cases/plan-sign-off/team.d.ts +1 -0
- package/dist/cases/plan-sign-off/team.jsx +213 -0
- package/dist/cases/plan-sign-off.md +541 -0
- package/dist/cases/pricing-section.md +1 -1
- package/dist/cases/site-footer/columns.jsx +2 -1
- package/dist/cases/site-footer.md +3 -1
- package/dist/cases/stat-row/tiles.jsx +2 -1
- package/dist/cases/stat-row.md +5 -2
- package/dist/cases/task-header/agent-sets-status.d.ts +1 -0
- package/dist/cases/task-header/agent-sets-status.jsx +164 -0
- package/dist/cases/task-header/people-change-status.d.ts +1 -0
- package/dist/cases/task-header/people-change-status.jsx +175 -0
- package/dist/cases/task-header.md +576 -0
- package/dist/cases.json +883 -30
- package/dist/components/alert.d.ts +3 -1
- package/dist/components/alert.jsx +5 -5
- package/dist/components/barChart.d.ts +35 -0
- package/dist/components/barChart.jsx +92 -0
- package/dist/components/dateField.jsx +1 -1
- package/dist/components/formatNumber.d.ts +10 -2
- package/dist/components/formatNumber.js +44 -9
- package/dist/components/heading.d.ts +2 -2
- package/dist/components/heading.jsx +5 -3
- package/dist/components/layout.d.ts +4 -2
- package/dist/components/layout.jsx +13 -2
- package/dist/components/lineChart.d.ts +39 -0
- package/dist/components/lineChart.jsx +128 -0
- package/dist/components/markdown.d.ts +24 -0
- package/dist/components/markdown.jsx +81 -0
- package/dist/components/pageShell.d.ts +3 -3
- package/dist/components/pageShell.jsx +6 -5
- package/dist/components/popover.d.ts +5 -1
- package/dist/components/popover.jsx +3 -2
- package/dist/components/progress.jsx +1 -1
- package/dist/components/select.jsx +5 -2
- package/dist/components/statTile.d.ts +1 -1
- package/dist/components/statTile.jsx +7 -2
- package/dist/components/tableCell.d.ts +4 -3
- package/dist/components/tableCell.jsx +2 -2
- package/dist/components/timeline.d.ts +32 -0
- package/dist/components/timeline.jsx +54 -0
- package/dist/components/titleBar.d.ts +3 -1
- package/dist/components/titleBar.jsx +9 -4
- package/dist/components/toaster.jsx +81 -11
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/internal/chart.d.ts +39 -0
- package/dist/internal/chart.js +110 -0
- package/dist/internal/chartFrame.d.ts +29 -0
- package/dist/internal/chartFrame.jsx +57 -0
- package/dist/internal/markdown.d.ts +40 -0
- package/dist/internal/markdown.js +577 -0
- package/dist/internal/toaster.d.ts +2 -0
- package/dist/internal/toaster.js +8 -0
- package/dist/native-mapping.json +28 -4
- package/dist/stories/BarChart.stories.d.ts +10 -0
- package/dist/stories/BarChart.stories.jsx +104 -0
- package/dist/stories/Cases.generated.stories.d.ts +22 -0
- package/dist/stories/Cases.generated.stories.jsx +44 -0
- package/dist/stories/Heading.stories.d.ts +1 -0
- package/dist/stories/Heading.stories.jsx +17 -0
- package/dist/stories/LineChart.stories.d.ts +9 -0
- package/dist/stories/LineChart.stories.jsx +34 -0
- package/dist/stories/Markdown.stories.d.ts +9 -0
- package/dist/stories/Markdown.stories.jsx +66 -0
- package/dist/stories/Onboarding.probe.stories.d.ts +6 -0
- package/dist/stories/Onboarding.probe.stories.jsx +12 -0
- package/dist/stories/Popover.stories.d.ts +2 -0
- package/dist/stories/Popover.stories.jsx +33 -0
- package/dist/stories/StatTile.stories.d.ts +4 -0
- package/dist/stories/StatTile.stories.jsx +47 -2
- package/dist/stories/Timeline.stories.d.ts +8 -0
- package/dist/stories/Timeline.stories.jsx +49 -0
- package/dist/stories/TitleBar.stories.d.ts +1 -0
- package/dist/stories/TitleBar.stories.jsx +13 -0
- package/dist/stories/Toaster.stories.d.ts +4 -0
- package/dist/stories/Toaster.stories.jsx +30 -0
- package/package.json +1 -1
|
@@ -0,0 +1,577 @@
|
|
|
1
|
+
// The markdown subset a message needs: headings, lists one level deep, fenced code, rules, bold,
|
|
2
|
+
// italic, inline code and safe links. Everything else reads as text. One pass over the lines, then a
|
|
3
|
+
// hand-written scanner per block whose lookups are tables built once, so no input makes it backtrack.
|
|
4
|
+
var __assign = (this && this.__assign) || function () {
|
|
5
|
+
__assign = Object.assign || function(t) {
|
|
6
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
7
|
+
s = arguments[i];
|
|
8
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
9
|
+
t[p] = s[p];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
return __assign.apply(this, arguments);
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Only `http:`, `https:` and `mailto:` links, with the scheme in lower case. Anything else gives null:
|
|
17
|
+
* `javascript:`, `data:`, `vbscript:`, relative paths, and any URL with a space or a control character
|
|
18
|
+
* in it (which a browser would strip before it reads the scheme). Entities are never decoded.
|
|
19
|
+
*/
|
|
20
|
+
export function safeHref(href) {
|
|
21
|
+
var url = href.trim();
|
|
22
|
+
for (var i = 0; i < url.length; i += 1) {
|
|
23
|
+
var code = url.charCodeAt(i);
|
|
24
|
+
if (code <= 0x20 || code === 0x7f)
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
var head = url.slice(0, 8).toLowerCase();
|
|
28
|
+
if (head.startsWith('https://'))
|
|
29
|
+
return "https://".concat(url.slice(8));
|
|
30
|
+
if (head.startsWith('http://'))
|
|
31
|
+
return "http://".concat(url.slice(7));
|
|
32
|
+
if (head.startsWith('mailto:') && url.length > 7)
|
|
33
|
+
return "mailto:".concat(url.slice(7));
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
// ---- Inline ----
|
|
37
|
+
// A link's destination: the URL, with an optional title after it ("t", 't' or (t)) dropped
|
|
38
|
+
function linkHref(dest) {
|
|
39
|
+
var text = dest.trim();
|
|
40
|
+
var w = 0;
|
|
41
|
+
while (w < text.length && !isSpace(text[w]))
|
|
42
|
+
w += 1;
|
|
43
|
+
var title = text.slice(w).trim();
|
|
44
|
+
if (title) {
|
|
45
|
+
var open_1 = title[0];
|
|
46
|
+
var close_1 = open_1 === '(' ? ')' : open_1;
|
|
47
|
+
if (title.length < 2 || (open_1 !== '"' && open_1 !== "'" && open_1 !== '(') || title[title.length - 1] !== close_1)
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
return safeHref(text.slice(0, w));
|
|
51
|
+
}
|
|
52
|
+
// Deeper than this, the rest of a span reads as text, so no input can nest without end.
|
|
53
|
+
var MAX_DEPTH = 8;
|
|
54
|
+
var PUNCTUATION = '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~';
|
|
55
|
+
var isSpace = function (ch) { return ch === ' ' || ch === '\t' || ch === '\n'; };
|
|
56
|
+
var isAlnum = function (ch) {
|
|
57
|
+
var c = ch.charCodeAt(0);
|
|
58
|
+
return (c >= 48 && c <= 57) || (c >= 65 && c <= 90) || (c >= 97 && c <= 122) || c > 127;
|
|
59
|
+
};
|
|
60
|
+
var STRONG = 0;
|
|
61
|
+
var EM_STAR = 1;
|
|
62
|
+
var EM_UNDERSCORE = 2;
|
|
63
|
+
function parseInline(s) {
|
|
64
|
+
var _a;
|
|
65
|
+
var n = s.length;
|
|
66
|
+
if (n === 0)
|
|
67
|
+
return [];
|
|
68
|
+
// A backslash before punctuation makes it a plain character
|
|
69
|
+
var esc = new Uint8Array(n);
|
|
70
|
+
for (var i = 0; i < n; i += 1) {
|
|
71
|
+
if (s[i] === '\\' && i + 1 < n && PUNCTUATION.includes(s[i + 1])) {
|
|
72
|
+
esc[i + 1] = 1;
|
|
73
|
+
i += 1;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// Code spans: a run of backticks pairs with the next run of the same length
|
|
77
|
+
var codeClose = new Int32Array(n).fill(-1);
|
|
78
|
+
var runLength = new Int32Array(n);
|
|
79
|
+
var isCode = new Uint8Array(n);
|
|
80
|
+
var starts = [];
|
|
81
|
+
for (var i = 0; i < n;) {
|
|
82
|
+
if (s[i] === '`' && !esc[i]) {
|
|
83
|
+
var j = i;
|
|
84
|
+
while (j < n && s[j] === '`')
|
|
85
|
+
j += 1;
|
|
86
|
+
starts.push(i);
|
|
87
|
+
runLength[i] = j - i;
|
|
88
|
+
i = j;
|
|
89
|
+
}
|
|
90
|
+
else
|
|
91
|
+
i += 1;
|
|
92
|
+
}
|
|
93
|
+
var nextSame = new Int32Array(starts.length);
|
|
94
|
+
var last = new Map();
|
|
95
|
+
for (var r = starts.length - 1; r >= 0; r -= 1) {
|
|
96
|
+
var len = runLength[starts[r]];
|
|
97
|
+
nextSame[r] = (_a = last.get(len)) !== null && _a !== void 0 ? _a : -1;
|
|
98
|
+
last.set(len, r);
|
|
99
|
+
}
|
|
100
|
+
for (var r = 0; r < starts.length;) {
|
|
101
|
+
var m = nextSame[r];
|
|
102
|
+
if (m < 0) {
|
|
103
|
+
r += 1;
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
var open_2 = starts[r];
|
|
107
|
+
var close_2 = starts[m];
|
|
108
|
+
codeClose[open_2] = close_2;
|
|
109
|
+
isCode.fill(1, open_2, close_2 + runLength[close_2]);
|
|
110
|
+
r = m + 1;
|
|
111
|
+
}
|
|
112
|
+
// Brackets and parentheses outside code, matched with a stack
|
|
113
|
+
var bracketClose = new Int32Array(n).fill(-1);
|
|
114
|
+
var parenClose = new Int32Array(n).fill(-1);
|
|
115
|
+
var brackets = [];
|
|
116
|
+
var parens = [];
|
|
117
|
+
for (var i = 0; i < n; i += 1) {
|
|
118
|
+
if (isCode[i] || esc[i])
|
|
119
|
+
continue;
|
|
120
|
+
var ch = s[i];
|
|
121
|
+
if (ch === '[')
|
|
122
|
+
brackets.push(i);
|
|
123
|
+
else if (ch === ']') {
|
|
124
|
+
var o = brackets.pop();
|
|
125
|
+
if (o !== undefined)
|
|
126
|
+
bracketClose[o] = i;
|
|
127
|
+
}
|
|
128
|
+
else if (ch === '(')
|
|
129
|
+
parens.push(i);
|
|
130
|
+
else if (ch === ')') {
|
|
131
|
+
var o = parens.pop();
|
|
132
|
+
if (o !== undefined)
|
|
133
|
+
parenClose[o] = i;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
// A link's URL is never read for emphasis (a star in a path stays in the path)
|
|
137
|
+
var cover = new Int32Array(n + 1);
|
|
138
|
+
for (var o = 0; o < n; o += 1) {
|
|
139
|
+
var c = bracketClose[o];
|
|
140
|
+
if (c < 0 || s[c + 1] !== '(' || parenClose[c + 1] < 0)
|
|
141
|
+
continue;
|
|
142
|
+
cover[c + 2] += 1;
|
|
143
|
+
cover[parenClose[c + 1]] -= 1;
|
|
144
|
+
}
|
|
145
|
+
var isUrl = new Uint8Array(n);
|
|
146
|
+
for (var i = 0, depth = 0; i < n; i += 1) {
|
|
147
|
+
depth += cover[i];
|
|
148
|
+
if (depth > 0)
|
|
149
|
+
isUrl[i] = 1;
|
|
150
|
+
}
|
|
151
|
+
// Emphasis runs: '**' is strong, '*' and '_' are em. Each closer kind has a next-closer table.
|
|
152
|
+
var runKind = new Int8Array(n).fill(-1);
|
|
153
|
+
var canOpen = new Uint8Array(n);
|
|
154
|
+
var nextClose = [new Int32Array(n + 1), new Int32Array(n + 1), new Int32Array(n + 1)];
|
|
155
|
+
var canClose = new Uint8Array(n);
|
|
156
|
+
for (var i = 0; i < n;) {
|
|
157
|
+
var ch = s[i];
|
|
158
|
+
if ((ch !== '*' && ch !== '_') || esc[i] || isCode[i] || isUrl[i]) {
|
|
159
|
+
i += 1;
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
var j = i;
|
|
163
|
+
while (j < n && s[j] === ch && !esc[j] && !isUrl[j])
|
|
164
|
+
j += 1;
|
|
165
|
+
var len = j - i;
|
|
166
|
+
var kind = ch === '*' ? (len === 1 ? EM_STAR : len === 2 ? STRONG : -1) : len === 1 ? EM_UNDERSCORE : -1;
|
|
167
|
+
if (kind >= 0) {
|
|
168
|
+
var before = i > 0 ? s[i - 1] : ' ';
|
|
169
|
+
var after = j < n ? s[j] : ' ';
|
|
170
|
+
runKind[i] = kind;
|
|
171
|
+
canOpen[i] = !isSpace(after) && (kind !== EM_UNDERSCORE || !isAlnum(before)) ? 1 : 0;
|
|
172
|
+
canClose[i] = !isSpace(before) && (kind !== EM_UNDERSCORE || !isAlnum(after)) ? 1 : 0;
|
|
173
|
+
}
|
|
174
|
+
i = j;
|
|
175
|
+
}
|
|
176
|
+
for (var _i = 0, nextClose_1 = nextClose; _i < nextClose_1.length; _i++) {
|
|
177
|
+
var table = nextClose_1[_i];
|
|
178
|
+
table[n] = -1;
|
|
179
|
+
}
|
|
180
|
+
for (var i = n - 1; i >= 0; i -= 1) {
|
|
181
|
+
for (var k = 0; k < 3; k += 1)
|
|
182
|
+
nextClose[k][i] = runKind[i] === k && canClose[i] ? i : nextClose[k][i + 1];
|
|
183
|
+
}
|
|
184
|
+
// Plain text of a range, with escapes resolved, for an image's alt text and spans past the depth limit
|
|
185
|
+
var plainText = function (start, end) {
|
|
186
|
+
var out = '';
|
|
187
|
+
for (var i = start; i < end; i += 1) {
|
|
188
|
+
if (s[i] === '\\' && i + 1 < end && esc[i + 1])
|
|
189
|
+
i += 1;
|
|
190
|
+
out += s[i];
|
|
191
|
+
}
|
|
192
|
+
return out;
|
|
193
|
+
};
|
|
194
|
+
var scan = function (start, end, depth, inLink) {
|
|
195
|
+
var out = [];
|
|
196
|
+
var buf = '';
|
|
197
|
+
var push = function (node) {
|
|
198
|
+
var prev = out[out.length - 1];
|
|
199
|
+
if (node.type === 'text' && prev && prev.type === 'text')
|
|
200
|
+
prev.text += node.text;
|
|
201
|
+
else
|
|
202
|
+
out.push(node);
|
|
203
|
+
};
|
|
204
|
+
var flush = function () {
|
|
205
|
+
if (buf)
|
|
206
|
+
push({ type: 'text', text: buf });
|
|
207
|
+
buf = '';
|
|
208
|
+
};
|
|
209
|
+
var i = start;
|
|
210
|
+
while (i < end) {
|
|
211
|
+
var ch = s[i];
|
|
212
|
+
if (ch === '\\' && i + 1 < end && esc[i + 1]) {
|
|
213
|
+
buf += s[i + 1];
|
|
214
|
+
i += 2;
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
if (ch === '`' && !esc[i] && runLength[i] > 0) {
|
|
218
|
+
var len = runLength[i];
|
|
219
|
+
var close_3 = codeClose[i];
|
|
220
|
+
if (close_3 >= 0 && close_3 + len <= end) {
|
|
221
|
+
var code = s.slice(i + len, close_3);
|
|
222
|
+
if (code.length > 1 && code[0] === ' ' && code[code.length - 1] === ' ' && code.trim() !== '')
|
|
223
|
+
code = code.slice(1, -1);
|
|
224
|
+
flush();
|
|
225
|
+
push({ type: 'code', text: code });
|
|
226
|
+
i = close_3 + len;
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
buf += s.slice(i, i + len);
|
|
230
|
+
i += len;
|
|
231
|
+
}
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
// A link, or an image (``), which reads as its alt text. Both are found at their first character.
|
|
235
|
+
var image = ch === '!' && !esc[i] && i + 1 < end && s[i + 1] === '[';
|
|
236
|
+
if ((ch === '[' || image) && !esc[i] && !isCode[i]) {
|
|
237
|
+
var o = image ? i + 1 : i;
|
|
238
|
+
var c = bracketClose[o];
|
|
239
|
+
var p = c >= 0 && c + 1 < end && s[c + 1] === '(' ? parenClose[c + 1] : -1;
|
|
240
|
+
if (p >= 0 && p < end) {
|
|
241
|
+
if (image)
|
|
242
|
+
buf += plainText(o + 1, c);
|
|
243
|
+
else {
|
|
244
|
+
var href = inLink ? null : linkHref(plainText(c + 2, p));
|
|
245
|
+
var children = depth + 1 < MAX_DEPTH ? scan(o + 1, c, depth + 1, true) : [{ type: 'text', text: plainText(o + 1, c) }];
|
|
246
|
+
flush();
|
|
247
|
+
if (href)
|
|
248
|
+
push({ type: 'link', href: href, children: children.length ? children : [{ type: 'text', text: href }] });
|
|
249
|
+
// Not safe, or a link inside a link: its text, and no link
|
|
250
|
+
else
|
|
251
|
+
children.forEach(push);
|
|
252
|
+
}
|
|
253
|
+
i = p + 1;
|
|
254
|
+
continue;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
var kind = runKind[i];
|
|
258
|
+
if (kind >= 0) {
|
|
259
|
+
var len = kind === STRONG ? 2 : 1;
|
|
260
|
+
var j = canOpen[i] ? nextClose[kind][i + len] : -1;
|
|
261
|
+
if (j > i + len && j + len <= end && depth + 1 < MAX_DEPTH) {
|
|
262
|
+
flush();
|
|
263
|
+
push({ type: kind === STRONG ? 'strong' : 'em', children: scan(i + len, j, depth + 1, inLink) });
|
|
264
|
+
i = j + len;
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
buf += s.slice(i, i + len);
|
|
268
|
+
i += len;
|
|
269
|
+
}
|
|
270
|
+
continue;
|
|
271
|
+
}
|
|
272
|
+
buf += ch;
|
|
273
|
+
i += 1;
|
|
274
|
+
}
|
|
275
|
+
flush();
|
|
276
|
+
return out;
|
|
277
|
+
};
|
|
278
|
+
return scan(0, n, 0, false);
|
|
279
|
+
}
|
|
280
|
+
// ---- Blocks ----
|
|
281
|
+
// Columns of leading space (a tab is 4) and where the text starts
|
|
282
|
+
function indentOf(line) {
|
|
283
|
+
var indent = 0;
|
|
284
|
+
var at = 0;
|
|
285
|
+
while (at < line.length && (line[at] === ' ' || line[at] === '\t')) {
|
|
286
|
+
indent += line[at] === '\t' ? 4 : 1;
|
|
287
|
+
at += 1;
|
|
288
|
+
}
|
|
289
|
+
return { indent: indent, at: at };
|
|
290
|
+
}
|
|
291
|
+
// Drops block quote markers ('> '), so a quote reads as its text
|
|
292
|
+
function stripQuote(line) {
|
|
293
|
+
var i = 0;
|
|
294
|
+
var quoted = false;
|
|
295
|
+
for (;;) {
|
|
296
|
+
var j = i;
|
|
297
|
+
var spaces = 0;
|
|
298
|
+
while (j < line.length && line[j] === ' ' && spaces < 3) {
|
|
299
|
+
j += 1;
|
|
300
|
+
spaces += 1;
|
|
301
|
+
}
|
|
302
|
+
if (line[j] !== '>')
|
|
303
|
+
break;
|
|
304
|
+
quoted = true;
|
|
305
|
+
i = j + 1;
|
|
306
|
+
if (line[i] === ' ')
|
|
307
|
+
i += 1;
|
|
308
|
+
}
|
|
309
|
+
return { line: quoted ? line.slice(i) : line, quoted: quoted };
|
|
310
|
+
}
|
|
311
|
+
function isRule(line) {
|
|
312
|
+
var _a = indentOf(line), indent = _a.indent, at = _a.at;
|
|
313
|
+
if (indent > 3)
|
|
314
|
+
return false;
|
|
315
|
+
var mark = line[at];
|
|
316
|
+
if (mark !== '-' && mark !== '*' && mark !== '_')
|
|
317
|
+
return false;
|
|
318
|
+
var count = 0;
|
|
319
|
+
for (var i = at; i < line.length; i += 1) {
|
|
320
|
+
if (line[i] === mark)
|
|
321
|
+
count += 1;
|
|
322
|
+
else if (line[i] !== ' ' && line[i] !== '\t')
|
|
323
|
+
return false;
|
|
324
|
+
}
|
|
325
|
+
return count >= 3;
|
|
326
|
+
}
|
|
327
|
+
function headingOf(line) {
|
|
328
|
+
var _a = indentOf(line), indent = _a.indent, at = _a.at;
|
|
329
|
+
if (indent > 3 || line[at] !== '#')
|
|
330
|
+
return null;
|
|
331
|
+
var j = at;
|
|
332
|
+
while (j < line.length && line[j] === '#')
|
|
333
|
+
j += 1;
|
|
334
|
+
var hashes = j - at;
|
|
335
|
+
if (hashes > 6 || (line[j] !== ' ' && line[j] !== '\t'))
|
|
336
|
+
return null;
|
|
337
|
+
var text = line.slice(j).trim();
|
|
338
|
+
// A closing run of '#' goes, when a space sets it off
|
|
339
|
+
var k = text.length;
|
|
340
|
+
while (k > 0 && text[k - 1] === '#')
|
|
341
|
+
k -= 1;
|
|
342
|
+
if (k < text.length && (k === 0 || text[k - 1] === ' ' || text[k - 1] === '\t'))
|
|
343
|
+
text = text.slice(0, k).trim();
|
|
344
|
+
if (!text)
|
|
345
|
+
return null;
|
|
346
|
+
return { depth: Math.min(hashes, 3), text: text };
|
|
347
|
+
}
|
|
348
|
+
function fenceOf(line) {
|
|
349
|
+
var _a = indentOf(line), indent = _a.indent, at = _a.at;
|
|
350
|
+
var mark = line[at];
|
|
351
|
+
if (mark !== '`' && mark !== '~')
|
|
352
|
+
return null;
|
|
353
|
+
var j = at;
|
|
354
|
+
while (j < line.length && line[j] === mark)
|
|
355
|
+
j += 1;
|
|
356
|
+
if (j - at < 3)
|
|
357
|
+
return null;
|
|
358
|
+
var info = line.slice(j).trim();
|
|
359
|
+
if (mark === '`' && info.includes('`'))
|
|
360
|
+
return null;
|
|
361
|
+
var word = info.split(/\s/, 1)[0];
|
|
362
|
+
return word ? { mark: mark, length: j - at, indent: indent, language: word } : { mark: mark, length: j - at, indent: indent };
|
|
363
|
+
}
|
|
364
|
+
function closesFence(line, fence) {
|
|
365
|
+
var at = indentOf(line).at;
|
|
366
|
+
var j = at;
|
|
367
|
+
while (j < line.length && line[j] === fence.mark)
|
|
368
|
+
j += 1;
|
|
369
|
+
return j - at >= fence.length && line.slice(j).trim() === '';
|
|
370
|
+
}
|
|
371
|
+
function itemOf(line) {
|
|
372
|
+
var _a = indentOf(line), indent = _a.indent, at = _a.at;
|
|
373
|
+
var ch = line[at];
|
|
374
|
+
var j = at;
|
|
375
|
+
var ordered = false;
|
|
376
|
+
if (ch === '-' || ch === '*' || ch === '+')
|
|
377
|
+
j += 1;
|
|
378
|
+
else {
|
|
379
|
+
while (j < line.length && j - at < 9 && line[j] >= '0' && line[j] <= '9')
|
|
380
|
+
j += 1;
|
|
381
|
+
if (j === at || (line[j] !== '.' && line[j] !== ')'))
|
|
382
|
+
return null;
|
|
383
|
+
j += 1;
|
|
384
|
+
ordered = true;
|
|
385
|
+
}
|
|
386
|
+
if (line[j] !== ' ' && line[j] !== '\t')
|
|
387
|
+
return null;
|
|
388
|
+
var text = line.slice(j).trim();
|
|
389
|
+
return text ? { indent: indent, ordered: ordered, text: text } : null;
|
|
390
|
+
}
|
|
391
|
+
function isTableDelimiter(line) {
|
|
392
|
+
if (line === undefined || !line.includes('|') || !line.includes('-'))
|
|
393
|
+
return false;
|
|
394
|
+
for (var i = 0; i < line.length; i += 1) {
|
|
395
|
+
if ('|-: \t'.indexOf(line[i]) < 0)
|
|
396
|
+
return false;
|
|
397
|
+
}
|
|
398
|
+
return true;
|
|
399
|
+
}
|
|
400
|
+
var paragraph = function (lines) {
|
|
401
|
+
var children = parseInline(lines.join(' '));
|
|
402
|
+
return children.length ? { type: 'paragraph', children: children } : null;
|
|
403
|
+
};
|
|
404
|
+
function flushItemLines(item) {
|
|
405
|
+
if (item.lines) {
|
|
406
|
+
var p = paragraph(item.lines);
|
|
407
|
+
if (p)
|
|
408
|
+
item.blocks.push(p);
|
|
409
|
+
item.lines = null;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
function flushNested(item) {
|
|
413
|
+
if (item.nested) {
|
|
414
|
+
var _a = item.nested, ordered = _a.ordered, items = _a.items;
|
|
415
|
+
item.blocks.push({ type: 'list', ordered: ordered, items: items.map(function (lines) { return [paragraph(lines)].filter(Boolean); }) });
|
|
416
|
+
item.nested = null;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
function flushItem(item) {
|
|
420
|
+
flushItemLines(item);
|
|
421
|
+
flushNested(item);
|
|
422
|
+
}
|
|
423
|
+
export function parseMarkdown(text) {
|
|
424
|
+
var _a;
|
|
425
|
+
var lines = text.split(/\r\n|\r|\n/);
|
|
426
|
+
var blocks = [];
|
|
427
|
+
var para = null;
|
|
428
|
+
var list = null;
|
|
429
|
+
var fence = null;
|
|
430
|
+
var closePara = function () {
|
|
431
|
+
if (para) {
|
|
432
|
+
var p = paragraph(para);
|
|
433
|
+
if (p)
|
|
434
|
+
blocks.push(p);
|
|
435
|
+
para = null;
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
var closeList = function () {
|
|
439
|
+
if (list) {
|
|
440
|
+
list.items.forEach(flushItem);
|
|
441
|
+
blocks.push({ type: 'list', ordered: list.ordered, items: list.items.map(function (item) { return item.blocks; }) });
|
|
442
|
+
list = null;
|
|
443
|
+
}
|
|
444
|
+
};
|
|
445
|
+
var closeFence = function (unclosed) {
|
|
446
|
+
if (unclosed === void 0) { unclosed = false; }
|
|
447
|
+
if (fence) {
|
|
448
|
+
// A fence still open at the end (a reply that is streaming) does not grow a blank last line
|
|
449
|
+
if (unclosed && fence.lines.at(-1) === '')
|
|
450
|
+
fence.lines.pop();
|
|
451
|
+
var block = fence.language
|
|
452
|
+
? { type: 'code', language: fence.language, code: fence.lines.join('\n') }
|
|
453
|
+
: { type: 'code', code: fence.lines.join('\n') };
|
|
454
|
+
fence.into.push(block);
|
|
455
|
+
fence = null;
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
var newItem = function (itemText) { return ({ blocks: [], lines: [itemText], nested: null }); };
|
|
459
|
+
for (var index = 0; index < lines.length; index += 1) {
|
|
460
|
+
var raw = lines[index];
|
|
461
|
+
if (fence) {
|
|
462
|
+
var line_1 = fence.quoted ? stripQuote(raw).line : raw;
|
|
463
|
+
if (closesFence(line_1, fence)) {
|
|
464
|
+
closeFence();
|
|
465
|
+
continue;
|
|
466
|
+
}
|
|
467
|
+
// Up to the fence's own indent comes off each line
|
|
468
|
+
var k = 0;
|
|
469
|
+
while (k < fence.indent && line_1[k] === ' ')
|
|
470
|
+
k += 1;
|
|
471
|
+
fence.lines.push(line_1.slice(k));
|
|
472
|
+
continue;
|
|
473
|
+
}
|
|
474
|
+
var _b = stripQuote(raw), line = _b.line, quoted = _b.quoted;
|
|
475
|
+
if (line.trim() === '') {
|
|
476
|
+
closePara();
|
|
477
|
+
if (list) {
|
|
478
|
+
list.blank = true;
|
|
479
|
+
flushItemLines(list.items[list.items.length - 1]);
|
|
480
|
+
}
|
|
481
|
+
continue;
|
|
482
|
+
}
|
|
483
|
+
var indent = indentOf(line).indent;
|
|
484
|
+
var opened = fenceOf(line);
|
|
485
|
+
if (opened) {
|
|
486
|
+
var into = blocks;
|
|
487
|
+
var current = list;
|
|
488
|
+
if (current && indent >= current.indent + 2) {
|
|
489
|
+
var item = current.items[current.items.length - 1];
|
|
490
|
+
flushItem(item);
|
|
491
|
+
into = item.blocks;
|
|
492
|
+
current.blank = false;
|
|
493
|
+
}
|
|
494
|
+
else {
|
|
495
|
+
closePara();
|
|
496
|
+
closeList();
|
|
497
|
+
}
|
|
498
|
+
fence = __assign(__assign({}, opened), { lines: [], quoted: quoted, into: into });
|
|
499
|
+
continue;
|
|
500
|
+
}
|
|
501
|
+
if (list) {
|
|
502
|
+
var current = list;
|
|
503
|
+
var item = current.items[current.items.length - 1];
|
|
504
|
+
var marker_1 = isRule(line) ? null : itemOf(line);
|
|
505
|
+
if (marker_1 && marker_1.indent >= current.indent + 2) {
|
|
506
|
+
// One level of nesting; anything deeper joins that level
|
|
507
|
+
flushItemLines(item);
|
|
508
|
+
if (item.nested && item.nested.ordered !== marker_1.ordered)
|
|
509
|
+
flushNested(item);
|
|
510
|
+
if (!item.nested)
|
|
511
|
+
item.nested = { ordered: marker_1.ordered, indent: marker_1.indent, items: [] };
|
|
512
|
+
item.nested.items.push([marker_1.text]);
|
|
513
|
+
current.blank = false;
|
|
514
|
+
continue;
|
|
515
|
+
}
|
|
516
|
+
if (marker_1 && marker_1.ordered === current.ordered) {
|
|
517
|
+
flushItem(item);
|
|
518
|
+
current.items.push(newItem(marker_1.text));
|
|
519
|
+
current.blank = false;
|
|
520
|
+
continue;
|
|
521
|
+
}
|
|
522
|
+
var startsBlock = isRule(line) || marker_1 || headingOf(line) || (line.includes('|') && isTableDelimiter(lines[index + 1]));
|
|
523
|
+
if (!startsBlock && (!current.blank || indent >= current.indent + 2)) {
|
|
524
|
+
var nested = item.nested;
|
|
525
|
+
if (nested && (!current.blank || indent >= nested.indent + 2)) {
|
|
526
|
+
nested.items[nested.items.length - 1].push(line.trim());
|
|
527
|
+
}
|
|
528
|
+
else {
|
|
529
|
+
flushNested(item);
|
|
530
|
+
if (!item.lines)
|
|
531
|
+
item.lines = [];
|
|
532
|
+
item.lines.push(line.trim());
|
|
533
|
+
}
|
|
534
|
+
current.blank = false;
|
|
535
|
+
continue;
|
|
536
|
+
}
|
|
537
|
+
closeList();
|
|
538
|
+
}
|
|
539
|
+
var heading = headingOf(line);
|
|
540
|
+
if (heading) {
|
|
541
|
+
closePara();
|
|
542
|
+
blocks.push({ type: 'heading', depth: heading.depth, children: parseInline(heading.text) });
|
|
543
|
+
continue;
|
|
544
|
+
}
|
|
545
|
+
if (isRule(line)) {
|
|
546
|
+
closePara();
|
|
547
|
+
blocks.push({ type: 'rule' });
|
|
548
|
+
continue;
|
|
549
|
+
}
|
|
550
|
+
if (line.includes('|') && isTableDelimiter(stripQuote((_a = lines[index + 1]) !== null && _a !== void 0 ? _a : '').line)) {
|
|
551
|
+
closePara();
|
|
552
|
+
var rows = [line.trim()];
|
|
553
|
+
while (index + 1 < lines.length) {
|
|
554
|
+
var next = stripQuote(lines[index + 1]).line;
|
|
555
|
+
if (next.trim() === '' || !next.includes('|'))
|
|
556
|
+
break;
|
|
557
|
+
rows.push(next.trim());
|
|
558
|
+
index += 1;
|
|
559
|
+
}
|
|
560
|
+
blocks.push({ type: 'code', code: rows.join('\n'), table: true });
|
|
561
|
+
continue;
|
|
562
|
+
}
|
|
563
|
+
var marker = indent <= 3 ? itemOf(line) : null;
|
|
564
|
+
if (marker) {
|
|
565
|
+
closePara();
|
|
566
|
+
list = { ordered: marker.ordered, indent: marker.indent, items: [newItem(marker.text)], blank: false };
|
|
567
|
+
continue;
|
|
568
|
+
}
|
|
569
|
+
if (!para)
|
|
570
|
+
para = [];
|
|
571
|
+
para.push(line.trim());
|
|
572
|
+
}
|
|
573
|
+
closeFence(true);
|
|
574
|
+
closePara();
|
|
575
|
+
closeList();
|
|
576
|
+
return blocks;
|
|
577
|
+
}
|
|
@@ -16,4 +16,6 @@ type PauseState = {
|
|
|
16
16
|
type PauseEvent = 'pointerEnter' | 'pointerLeave' | 'focus' | 'blur';
|
|
17
17
|
export declare function pauseReducer(state: PauseState, event: PauseEvent): PauseState;
|
|
18
18
|
export declare const isPaused: ({ hovered, focused }: PauseState) => boolean;
|
|
19
|
+
export declare function announcementText(item: ToastItem): string;
|
|
20
|
+
export declare const liveRegionFor: (type: ToastItem["type"]) => "polite" | "assertive";
|
|
19
21
|
export {};
|
package/dist/internal/toaster.js
CHANGED
|
@@ -48,3 +48,11 @@ export var isPaused = function (_a) {
|
|
|
48
48
|
var hovered = _a.hovered, focused = _a.focused;
|
|
49
49
|
return hovered || focused;
|
|
50
50
|
};
|
|
51
|
+
// What a screen reader hears for a toast: the message, then the second line as its own sentence
|
|
52
|
+
export function announcementText(item) {
|
|
53
|
+
if (!item.secondMessage)
|
|
54
|
+
return item.message;
|
|
55
|
+
return /[.!?…]$/.test(item.message.trim()) ? "".concat(item.message, " ").concat(item.secondMessage) : "".concat(item.message, ". ").concat(item.secondMessage);
|
|
56
|
+
}
|
|
57
|
+
// Errors interrupt; everything else waits for a pause
|
|
58
|
+
export var liveRegionFor = function (type) { return (type === 'error' ? 'assertive' : 'polite'); };
|
package/dist/native-mapping.json
CHANGED
|
@@ -24,6 +24,12 @@
|
|
|
24
24
|
"compose": "A `Row` with `Arrangement.spacedBy((-8).dp)` of avatars and a count circle, with `semantics(mergeDescendants = true)` and a label naming the people",
|
|
25
25
|
"note": "To list everyone, make the stack a `Button` that opens a popover (iPad, Mac) or a sheet (iPhone) / a `DropdownMenu` or `ModalBottomSheet`."
|
|
26
26
|
},
|
|
27
|
+
{
|
|
28
|
+
"ods": "barChart",
|
|
29
|
+
"swiftui": "Swift Charts `Chart` of `BarMark`s with `.accessibilityLabel` and `.accessibilityValue` per mark",
|
|
30
|
+
"compose": "No system chart: draw the bars on a `Canvas` with `semantics` per bar, or show the table",
|
|
31
|
+
"note": "Bars in `primary.main`, the highlighted one in `text.primary`, gridlines in `misc.divider`. The y axis starts at 0; ticks are short (`.compact`), the value and the table exact. A missing day draws no bar and reads \"No data\". Keep a way to show the values as a table."
|
|
32
|
+
},
|
|
27
33
|
{
|
|
28
34
|
"ods": "button",
|
|
29
35
|
"swiftui": "`Button` with `.odsProminentButton()` for accent (`.odsProminentButton(.glass)` for the glass style), `.bordered` for primary",
|
|
@@ -173,6 +179,12 @@
|
|
|
173
179
|
"swiftui": "`Divider`",
|
|
174
180
|
"compose": "`HorizontalDivider`, `VerticalDivider`"
|
|
175
181
|
},
|
|
182
|
+
{
|
|
183
|
+
"ods": "lineChart",
|
|
184
|
+
"swiftui": "Swift Charts `Chart` of `LineMark`s, the second series told apart by `.lineStyle(StrokeStyle(dash:))` in place of `.foregroundStyle(by:)`, with an `AXChartDescriptor`",
|
|
185
|
+
"compose": "No system chart: draw each line as a `Path` on a `Canvas` with `semantics` per point, or show the table",
|
|
186
|
+
"note": "One or two series: the first solid in `primary.main`, the second dashed in `text.secondary`, with a legend. A missing day breaks the line and reads \"No data\"; never draw it as 0. The y axis starts at 0; ticks are short (`.compact`), the readout and the table exact. Keep a way to show the values as a table."
|
|
187
|
+
},
|
|
176
188
|
{
|
|
177
189
|
"ods": "link",
|
|
178
190
|
"swiftui": "`Link`",
|
|
@@ -195,6 +207,12 @@
|
|
|
195
207
|
"swiftui": "`ProgressView`",
|
|
196
208
|
"compose": "`CircularProgressIndicator`"
|
|
197
209
|
},
|
|
210
|
+
{
|
|
211
|
+
"ods": "markdown",
|
|
212
|
+
"swiftui": "A `VStack` of the same subset of blocks, each line of text a `Text(AttributedString(markdown:options: .init(interpretedSyntax: .inlineOnlyPreservingWhitespace)))`, code in `codeBlock`",
|
|
213
|
+
"compose": "A `Column` of the same subset, parsed by hand (Compose has no system markdown), each line of text a `Text` with an `AnnotatedString` whose links are `LinkAnnotation.Url`",
|
|
214
|
+
"note": "Headings to three levels, lists one level deep, fenced code, rules, bold, italic, inline code and links. Only http, https and mailto links open; a table shows as code and an image as its alt text."
|
|
215
|
+
},
|
|
198
216
|
{
|
|
199
217
|
"ods": "menu",
|
|
200
218
|
"swiftui": "`Menu` or `.contextMenu`",
|
|
@@ -357,7 +375,7 @@
|
|
|
357
375
|
"ods": "statTile",
|
|
358
376
|
"swiftui": "A `VStack` of `Text`s with `.accessibilityElement(children: .combine)`",
|
|
359
377
|
"compose": "A `Column` with `Modifier.semantics(mergeDescendants = true)`",
|
|
360
|
-
"note": "Not colored by good or bad. Numbers: `.number.notation(.compactName)` / `.currency(code:)` on Apple; `CompactDecimalFormat` / `NumberFormat.getCurrencyInstance` on Android. Loading: `.redacted(reason: .placeholder)`."
|
|
378
|
+
"note": "Not colored by good or bad. A percent's change is in points ('Up 3 pts'), not a percent of a percent, and its accessibility label says 'percentage points'. Money uses the currency's own decimals. Numbers: `.number.notation(.compactName)` / `.currency(code:)` on Apple; `CompactDecimalFormat` / `NumberFormat.getCurrencyInstance` on Android. Loading: `.redacted(reason: .placeholder)`."
|
|
361
379
|
},
|
|
362
380
|
{
|
|
363
381
|
"ods": "tab",
|
|
@@ -375,7 +393,7 @@
|
|
|
375
393
|
"ods": "tableCell",
|
|
376
394
|
"swiftui": "A `TableColumn` content view",
|
|
377
395
|
"compose": "`Text` in a `Row` with `Modifier.weight`",
|
|
378
|
-
"note": "Material 3 has no table."
|
|
396
|
+
"note": "Material 3 has no table. `rowHeader` makes the first cell name its row: the first `TableColumn` on Apple, and `semantics { heading() }` on that cell on Android."
|
|
379
397
|
},
|
|
380
398
|
{
|
|
381
399
|
"ods": "tableContainer",
|
|
@@ -428,17 +446,23 @@
|
|
|
428
446
|
"swiftui": "`Text(_:style:)` (`.relative`) or `Text(_:format:)` (`.dateTime`)",
|
|
429
447
|
"compose": "`Text` with `DateUtils.getRelativeTimeSpanString` or `DateTimeFormatter.ofLocalizedDateTime`"
|
|
430
448
|
},
|
|
449
|
+
{
|
|
450
|
+
"ods": "timeline",
|
|
451
|
+
"swiftui": "A `List` of rows with a leading `Circle` and a connecting `Rectangle` in an `.overlay`; a selectable row is a `Button`",
|
|
452
|
+
"compose": "A `LazyColumn` of rows with the dot and the connecting line drawn in `Modifier.drawBehind`; a selectable row is `Modifier.clickable`",
|
|
453
|
+
"note": "The dot is the same for every row: color carries nothing. No line after the last row. Mark the selected row with `.accessibilityAddTraits(.isSelected)` / `semantics { selected = true }`. Format the time with `Text(_:format:)` / `DateTimeFormatter.ofLocalizedDateTime`."
|
|
454
|
+
},
|
|
431
455
|
{
|
|
432
456
|
"ods": "titleBar",
|
|
433
457
|
"swiftui": "`.navigationTitle` with `.toolbar` items",
|
|
434
458
|
"compose": "`TopAppBar` with `navigationIcon` and `actions`",
|
|
435
|
-
"note": "The main action stays in the toolbar; the rest go in a `Menu` / an overflow `DropdownMenu`."
|
|
459
|
+
"note": "The main action stays in the toolbar; the rest go in a `Menu` / an overflow `DropdownMenu`. The `meta` line is a `.navigationSubtitle` on Mac and a toolbar `principal` item on iPhone; on Android a second `Text` in the top bar's `title` slot."
|
|
436
460
|
},
|
|
437
461
|
{
|
|
438
462
|
"ods": "toaster",
|
|
439
463
|
"swiftui": "`ODSBanner` for an inline message; a system banner (a local notification) when the app is not in front",
|
|
440
464
|
"compose": "`Snackbar` in a `SnackbarHost`",
|
|
441
|
-
"note": "SwiftUI has no toast, so ODS adds none: show the message in the screen."
|
|
465
|
+
"note": "SwiftUI has no toast, so ODS adds none: show the message in the screen. SwiftUI posts `AccessibilityNotification.Announcement`; Compose sets `liveRegion` on the snackbar host."
|
|
442
466
|
},
|
|
443
467
|
{
|
|
444
468
|
"ods": "tooltip",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import BarChart from "../components/barChart";
|
|
3
|
+
declare const meta: Meta<typeof BarChart>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof BarChart>;
|
|
6
|
+
export declare const Week: Story;
|
|
7
|
+
export declare const Month: Story;
|
|
8
|
+
export declare const Empty: Story;
|
|
9
|
+
export declare const Loading: Story;
|
|
10
|
+
export declare const Highlighted: Story;
|