@dorsk/tsumikit 0.80.3 → 0.82.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.
Files changed (103) hide show
  1. package/README.md +180 -2
  2. package/dist/breakpoints.d.ts +15 -0
  3. package/dist/breakpoints.js +14 -0
  4. package/dist/components/atoms/Artwork.svelte +37 -10
  5. package/dist/components/atoms/Badge.svelte +2 -1
  6. package/dist/components/atoms/Button.svelte +17 -6
  7. package/dist/components/atoms/Button.svelte.d.ts +2 -0
  8. package/dist/components/atoms/Input.svelte +2 -1
  9. package/dist/components/atoms/Slider.svelte +1 -1
  10. package/dist/components/atoms/Text.svelte +4 -4
  11. package/dist/components/atoms/Text.svelte.d.ts +1 -1
  12. package/dist/components/layouts/AppShell.svelte +14 -0
  13. package/dist/components/layouts/Backdrop.svelte +152 -0
  14. package/dist/components/layouts/Backdrop.svelte.d.ts +30 -0
  15. package/dist/components/layouts/NavSection.svelte +2 -2
  16. package/dist/components/molecules/AttachmentList.svelte +1 -1
  17. package/dist/components/molecules/CapBar.svelte +1 -1
  18. package/dist/components/molecules/Composer.svelte +1 -1
  19. package/dist/components/molecules/Dropzone.svelte +1 -1
  20. package/dist/components/molecules/EmptyState.svelte +13 -6
  21. package/dist/components/molecules/EmptyState.svelte.d.ts +3 -0
  22. package/dist/components/molecules/Field.svelte +1 -1
  23. package/dist/components/molecules/FilterInput.svelte +8 -6
  24. package/dist/components/molecules/Meter.svelte +1 -1
  25. package/dist/components/molecules/Metric.svelte +6 -4
  26. package/dist/components/molecules/Modal.svelte +4 -4
  27. package/dist/components/molecules/Pagination.svelte +26 -2
  28. package/dist/components/molecules/Pagination.svelte.d.ts +3 -1
  29. package/dist/components/molecules/Prose.svelte +1 -0
  30. package/dist/components/molecules/RadioGroup.svelte +2 -2
  31. package/dist/components/molecules/RichSelect.svelte.d.ts +2 -2
  32. package/dist/components/molecules/SectionHeader.svelte +1 -1
  33. package/dist/components/molecules/SegmentedControl.svelte +59 -26
  34. package/dist/components/molecules/SegmentedControl.svelte.d.ts +4 -0
  35. package/dist/components/molecules/SortableList.svelte +1 -1
  36. package/dist/components/molecules/StatusBar.svelte +2 -2
  37. package/dist/components/molecules/Tabs.svelte +32 -0
  38. package/dist/components/molecules/Tabs.svelte.d.ts +4 -0
  39. package/dist/components/molecules/ThemePicker.svelte +3 -3
  40. package/dist/components/molecules/VolumeSlider.svelte.d.ts +1 -1
  41. package/dist/components/organisms/DataTable.svelte +2 -2
  42. package/dist/dev-audit.d.ts +19 -0
  43. package/dist/dev-audit.js +259 -0
  44. package/dist/index.d.ts +6 -1
  45. package/dist/index.js +6 -1
  46. package/dist/media.svelte.d.ts +8 -0
  47. package/dist/media.svelte.js +26 -0
  48. package/dist/pending.svelte.d.ts +16 -0
  49. package/dist/pending.svelte.js +75 -0
  50. package/dist/stores/toast.svelte.d.ts +22 -0
  51. package/dist/stores/toast.svelte.js +54 -2
  52. package/dist/styles/app.css +2 -1
  53. package/dist/styles/font.css +19 -0
  54. package/dist/styles/fonts/LICENSE-Inter.txt +92 -0
  55. package/dist/styles/fonts/inter.woff2 +0 -0
  56. package/dist/styles/themes.css +58 -58
  57. package/dist/styles/tokens.css +17 -5
  58. package/dist/url-state.svelte.d.ts +22 -0
  59. package/dist/url-state.svelte.js +64 -0
  60. package/lint/breakpoints.mjs +33 -0
  61. package/lint/cli.mjs +99 -0
  62. package/lint/context.mjs +242 -0
  63. package/lint/index.mjs +97 -0
  64. package/lint/rules/breakpoints.mjs +25 -0
  65. package/lint/rules/img-alt.mjs +13 -0
  66. package/lint/rules/motion.mjs +85 -0
  67. package/lint/rules/no-raw-color.mjs +59 -0
  68. package/lint/rules/no-raw-control.mjs +23 -0
  69. package/lint/rules/no-raw-font.mjs +64 -0
  70. package/lint/rules/one-primary.mjs +74 -0
  71. package/lint/rules/spacing-scale.mjs +66 -0
  72. package/package.json +12 -2
  73. package/principles/01-visibility-of-status.md +32 -0
  74. package/principles/02-one-primary-action.md +31 -0
  75. package/principles/03-emphasise-by-de-emphasising.md +31 -0
  76. package/principles/04-labels-last-resort.md +30 -0
  77. package/principles/05-tint-the-greys.md +30 -0
  78. package/principles/06-depth-from-shade.md +30 -0
  79. package/principles/07-one-accent.md +31 -0
  80. package/principles/08-spacing-scale.md +30 -0
  81. package/principles/09-group-with-space.md +31 -0
  82. package/principles/10-real-typeface-fixed-scale.md +33 -0
  83. package/principles/11-mono-only-for-code.md +30 -0
  84. package/principles/12-measure.md +29 -0
  85. package/principles/13-imagery-sets-the-mood.md +32 -0
  86. package/principles/14-instant-calm-feedback.md +32 -0
  87. package/principles/15-undo-over-confirm.md +30 -0
  88. package/principles/16-empty-states.md +31 -0
  89. package/principles/17-errors-in-plain-words.md +31 -0
  90. package/principles/18-match-the-real-world.md +31 -0
  91. package/principles/19-consistency-and-standards.md +32 -0
  92. package/principles/20-error-prevention.md +31 -0
  93. package/principles/21-recognition-over-recall.md +31 -0
  94. package/principles/22-flexibility-and-shortcuts.md +31 -0
  95. package/principles/23-url-is-state.md +31 -0
  96. package/principles/24-links-are-links.md +31 -0
  97. package/principles/25-visible-focus.md +32 -0
  98. package/principles/26-generous-targets.md +31 -0
  99. package/principles/27-cheap-motion-respect-preferences.md +32 -0
  100. package/principles/28-less-but-better.md +31 -0
  101. package/principles/29-colour-is-not-the-only-cue.md +31 -0
  102. package/principles/30-help-where-needed.md +31 -0
  103. package/principles/README.md +62 -0
@@ -0,0 +1,62 @@
1
+ # Design principles
2
+
3
+ The principles tsumikit is built to serve, one file each. They distil Nielsen's usability heuristics, Laws of UX, Refactoring UI, Practical Typography, the Vercel and Rauno Freiberg web interface guidelines, WCAG 2.2 and Dieter Rams. Each file states the principle in one line, why it holds (with the source), do and don't lists, what the kit provides for it, and a check you can run on a screen.
4
+
5
+ They ship in the package: `node_modules/@dorsk/tsumikit/principles/`. Point a design review, or a coding agent, at them.
6
+
7
+ ## Index
8
+
9
+ | # | Principle | In one line |
10
+ |---|---|---|
11
+ | 01 | [Visibility of system status](01-visibility-of-status.md) | Acknowledge every action within 100 ms and state the outcome. |
12
+ | 02 | [One primary action per view](02-one-primary-action.md) | One filled button; the rest outlined, plain or behind a menu. |
13
+ | 03 | [Emphasise by de-emphasising](03-emphasise-by-de-emphasising.md) | Quiet the surroundings instead of enlarging the subject; three text levels. |
14
+ | 04 | [Labels are a last resort](04-labels-last-resort.md) | Drop labels the value makes obvious; keep the rest small and muted. |
15
+ | 05 | [Tint your greys](05-tint-the-greys.md) | Every grey shares a slight hue; no neutral hexes. |
16
+ | 06 | [Depth from shade, not outlines](06-depth-from-shade.md) | Layers differ by background lightness; borders are faint or absent. |
17
+ | 07 | [One accent, used sparingly](07-one-accent.md) | Accent marks primary, active and focus; status colours mean status. |
18
+ | 08 | [A spacing scale, room to breathe](08-spacing-scale.md) | All spacing from the scale; start airy, then remove. |
19
+ | 09 | [Group with space, not boxes](09-group-with-space.md) | Proximity and shared background group; gaps between groups are larger. |
20
+ | 10 | [A real typeface, a fixed scale](10-real-typeface-fixed-scale.md) | Bundle a screen typeface; fixed type scale, few weights. |
21
+ | 11 | [Monospace only for code](11-mono-only-for-code.md) | Mono for paths, hashes, commands; sans for everything else. |
22
+ | 12 | [Keep lines 45 to 75 characters](12-measure.md) | Cap reading width independent of the viewport. |
23
+ | 13 | [Imagery sets the mood](13-imagery-sets-the-mood.md) | Backdrops with a fade, text on a scrim, designed placeholders. |
24
+ | 14 | [Feedback is instant and calm](14-instant-calm-feedback.md) | Spinner after 200 ms, kept 500 ms; optimistic updates with rollback. |
25
+ | 15 | [Prefer undo over confirmation](15-undo-over-confirm.md) | Reversible actions with undo; confirm only the irreversible. |
26
+ | 16 | [Empty states are design too](16-empty-states.md) | Say what belongs here and offer the action that fills it. |
27
+ | 17 | [Errors in plain words](17-errors-in-plain-words.md) | What happened, why, and what to do next. |
28
+ | 18 | [Speak the user's language](18-match-the-real-world.md) | Names, formats and order from the user's world, not the system's. |
29
+ | 19 | [Consistency beats local cleverness](19-consistency-and-standards.md) | Same thing, same look and behaviour, everywhere; follow conventions. |
30
+ | 20 | [Prevent errors](20-error-prevention.md) | Constrain input, validate early, keep destructive actions apart. |
31
+ | 21 | [Recognition over recall](21-recognition-over-recall.md) | Show location, selection, options and shortcuts on screen. |
32
+ | 22 | [Shortcuts for the experienced](22-flexibility-and-shortcuts.md) | Keyboard, bulk and saved views layered on a simple default. |
33
+ | 23 | [The URL is state](23-url-is-state.md) | Filters, tabs, sort and page survive refresh, Back and sharing. |
34
+ | 24 | [Links are links](24-links-are-links.md) | Anchors navigate, buttons act; middle-click always works. |
35
+ | 25 | [Visible focus](25-visible-focus.md) | Every control shows a focus ring under `:focus-visible`. |
36
+ | 26 | [Generous targets](26-generous-targets.md) | 24px with a pointer, 44px on touch, no dead zones. |
37
+ | 27 | [Cheap motion, respected preferences](27-cheap-motion-respect-preferences.md) | Transform and opacity only; honour reduced motion, zoom, paste. |
38
+ | 28 | [Less, but better](28-less-but-better.md) | Every element earns its place or goes. |
39
+ | 29 | [Colour is never the only cue](29-colour-is-not-the-only-cue.md) | Pair every status colour with an icon, label or shape. |
40
+ | 30 | [Help where it is needed](30-help-where-needed.md) | One line of help beside the thing it explains. |
41
+
42
+ ## Designing a screen: the checklist
43
+
44
+ Run through this before calling a screen done. Each line points at the principle with the full check.
45
+
46
+ 1. The first viewport answers "what is this, what state is it in, what can I do". (28, 21)
47
+ 2. Exactly one filled button; no action bar wraps at 40rem. (02)
48
+ 3. Three text levels at most; muted text passes 4.5:1. (03)
49
+ 4. Every label left on screen is one the value could not do without. (04)
50
+ 5. All greys tinted, layers told apart by shade, borders faint. (05, 06)
51
+ 6. Accent only on primary, active, focus, selection; status colours paired with a cue. (07, 29)
52
+ 7. Every gap and padding is a scale step; gaps between groups are larger than within. (08, 09)
53
+ 8. Bundled typeface, scale sizes only, mono only for code-like text, lines 45 to 75 characters. (10, 11, 12)
54
+ 9. Images fade into the page, text over them sits on a scrim, missing images get a placeholder. (13)
55
+ 10. Every click changes something within 100 ms; spinners appear after 200 ms and stay 500 ms. (01, 14)
56
+ 11. Destructive actions have undo, or a confirm that names the loss. (15, 20)
57
+ 12. Empty, filtered-empty and failed states each have copy and an action; errors say what to do next. (16, 17)
58
+ 13. Labels and messages read like a person talking; the same thing is named the same everywhere. (18, 19)
59
+ 14. Filters, tabs, sort and page are in the URL; navigation is real anchors. (23, 24)
60
+ 15. Tab through the screen: focus is visible everywhere; targets are 24px / 44px. (25, 26)
61
+ 16. No `transition: all`; reduced motion, zoom and paste all respected. (27)
62
+ 17. Help text sits beside the thing it explains; shortcuts are visible. (30, 22)