division-ds 0.1.1 → 0.1.2
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/package.json
CHANGED
|
@@ -7306,6 +7306,11 @@
|
|
|
7306
7306
|
"type": "{ label: string; altText: string; onAction: () => void }",
|
|
7307
7307
|
"description": "Optional. Radix (the library the toast is built on) requires altText: what to do somewhere else if someone can't reach the toast in time."
|
|
7308
7308
|
},
|
|
7309
|
+
{
|
|
7310
|
+
"name": "replace (ToastOptions)",
|
|
7311
|
+
"type": "string",
|
|
7312
|
+
"description": "Optional. Closes any open toast raised with the same string as this one opens, so an action repeated quickly (\"Alert acknowledged\" three times) shows one toast instead of a stack."
|
|
7313
|
+
},
|
|
7309
7314
|
{
|
|
7310
7315
|
"name": "useToast()",
|
|
7311
7316
|
"type": "{ toast: (options: ToastOptions) => string; dismiss: (id: string) => void }",
|
|
@@ -7316,7 +7321,7 @@
|
|
|
7316
7321
|
{
|
|
7317
7322
|
"name": "ToastOptions",
|
|
7318
7323
|
"kind": "type",
|
|
7319
|
-
"code": "export type ToastOptions = {\n title: string\n description?: string\n tone?: Tone\n /** ms before it leaves on its own. Default 5000; 8000 for hostile. */\n duration?: number\n /** Radix requires altText: the way to do the same thing for someone who cannot reach the toast\n * before it leaves. */\n action?: { label: string; altText: string; onAction: () => void }\n}",
|
|
7324
|
+
"code": "export type ToastOptions = {\n title: string\n description?: string\n tone?: Tone\n /** ms before it leaves on its own. Default 5000; 8000 for hostile. */\n duration?: number\n /** Radix requires altText: the way to do the same thing for someone who cannot reach the toast\n * before it leaves. */\n action?: { label: string; altText: string; onAction: () => void }\n /** Any open toast raised with the same string closes as this one opens, so a repeated action\n * (\"Alert acknowledged\" three times) shows one toast, not a stack over the page. */\n replace?: string\n}",
|
|
7320
7325
|
"from": "src/components/molecules/toast/Toast"
|
|
7321
7326
|
},
|
|
7322
7327
|
{
|
|
@@ -7350,6 +7355,7 @@
|
|
|
7350
7355
|
"Use a toast to confirm something the person just did.",
|
|
7351
7356
|
"Give every action an altText that says where else it can be done.",
|
|
7352
7357
|
"Keep the title under about six words.",
|
|
7358
|
+
"After an action runs, focus goes back to where it was before it entered the toast. If the action changes the page (Undo puts a row back), move focus to what changed yourself.",
|
|
7353
7359
|
"A toast follows the innermost open overlay (a dialog or panel on top of the page). If it's raised while one is open, or is already showing when one opens, it shows inside that overlay, and it moves back to the page corner when the overlay closes. AlertDialog is the exception: its toasts always show in the page corner, above the scrim (the dimmed layer behind the dialog)."
|
|
7354
7360
|
],
|
|
7355
7361
|
"donts": [
|
package/scripts/division-ds.mjs
CHANGED
|
@@ -154,6 +154,9 @@ async function check(options) {
|
|
|
154
154
|
console.error('Each component\'s props, values and examples: /docs/components/<slug>.md. Tokens: public/manifest/tokens.json.')
|
|
155
155
|
} else {
|
|
156
156
|
console.log(`division-ds check passed: ${files.length} file(s), ${index.size} components, ${tokenNames.length} tokens, 0 findings.`)
|
|
157
|
+
// It reads code, not the running page: say so, or a pass reads as "the screen works" (the
|
|
158
|
+
// 2026-10-20 outside test shipped three runtime bugs past a clean check).
|
|
159
|
+
console.log('Checked: colours, tokens, button spacing and props. Not checked: how the screen behaves; run the review checklist (commands/review.md) in a browser.')
|
|
157
160
|
}
|
|
158
161
|
process.exit(findings.length > 0 ? 1 : 0)
|
|
159
162
|
}
|
|
@@ -416,11 +416,12 @@ const SKILL_COMMANDS = {
|
|
|
416
416
|
'- [ ] **Buttons.** Two or more side by side share a parent with a gap. One primary button per view. A busy button takes `loading`; a disabled one says why nearby. Icon-only actions are `IconButton` with a `label`.',
|
|
417
417
|
'- [ ] **Forms.** Every `Input`, `Textarea`, `Select`, `MultiSelect` and `QuantityStepper` is inside a `FormField`; `Switch`, `Checkbox` and `Radio` have an `id` and a `<label htmlFor>`. A failed submit shows `ErrorSummary` and focuses it.',
|
|
418
418
|
'- [ ] **Status.** Every status has a word, not only a colour.',
|
|
419
|
-
'- [ ] **Focus.** Everything interactive is reached by Tab in reading order and shows the focus ring; anything styled by hand has the `focus-visible:outline-*` classes. An overlay hands focus back to what opened it.',
|
|
419
|
+
'- [ ] **Focus.** Everything interactive is reached by Tab in reading order and shows the focus ring; anything styled by hand has the `focus-visible:outline-*` classes. An overlay hands focus back to what opened it. A button that removes its own row or item (Acknowledge, Delete, Dismiss) moves focus to the next one, else the previous one, else the empty state; focus never drops to the page.',
|
|
420
420
|
'- [ ] **Text size.** Secondary text is 14px or larger; 11 to 12px only for uppercase mono labels.',
|
|
421
421
|
'- [ ] **320px.** At 320px wide nothing scrolls sideways (`document.documentElement.scrollWidth <= 320`) and button rows wrap.',
|
|
422
422
|
'- [ ] **Both themes.** It reads in dark and in light (`data-theme="light"` on `<html>`).',
|
|
423
423
|
'- [ ] **Motion.** Anything animated by hand stops under reduced motion; nothing moves on its own.',
|
|
424
|
+
'- [ ] **Live data.** Values that update on their own change in place, with no announcement for each number; a change of status (good to unhealthy) is announced once, through one polite live region (`role="status"`). Charts animate only their first draw, so new data every few seconds is fine.',
|
|
424
425
|
'',
|
|
425
426
|
'## Check',
|
|
426
427
|
'',
|
|
@@ -502,6 +503,10 @@ export function skillFiles(split, componentCount) {
|
|
|
502
503
|
'',
|
|
503
504
|
`> Load when ${command.when}. Generated by \`npm run agent-docs\`; the procedure lives in scripts/lib/agent-docs.mjs.`,
|
|
504
505
|
'',
|
|
506
|
+
// A project that installed the components has no public/ folder of ours (the 2026-10-20
|
|
507
|
+
// outside test followed these steps to files that did not exist).
|
|
508
|
+
`Paths starting \`public/\` are in the Division DS repository. In a project that uses the components, read them online: \`public/llms.txt\` is \`${DOCS_SITE}llms.txt\`, and so on.`,
|
|
509
|
+
'',
|
|
505
510
|
...command.body,
|
|
506
511
|
'',
|
|
507
512
|
].join('\n')
|