@nurvus/ui 0.1.0-alpha.17 → 0.1.0-alpha.18

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 (40) hide show
  1. package/README.md +7 -0
  2. package/dist/icons.svg +1 -0
  3. package/dist/index.js +1 -1
  4. package/dist/nurvus.css +4 -1
  5. package/dist/respawn.js +1 -1
  6. package/dist/types/anchor.d.ts +10 -2
  7. package/dist/types/components/Anchor/Anchor.d.ts +8 -5
  8. package/dist/types/components/Kbd/Kbd.d.ts +16 -0
  9. package/dist/types/components/NavToggle/NavToggle.d.ts +27 -0
  10. package/dist/types/components/Tooltip/Tooltip.d.ts +27 -0
  11. package/dist/types/icons.d.ts +1 -0
  12. package/dist/types/index.d.ts +7 -0
  13. package/dist/types/respawn/Anchor.d.ts +2 -0
  14. package/dist/types/respawn/Kbd.d.ts +10 -0
  15. package/dist/types/respawn/NavToggle.d.ts +22 -0
  16. package/dist/types/respawn/Tooltip.d.ts +20 -0
  17. package/dist/types/respawn/index.d.ts +7 -0
  18. package/dist/types/tooltip.d.ts +4 -0
  19. package/package.json +1 -1
  20. package/src/anchor.ts +30 -7
  21. package/src/components/Anchor/Anchor.scss +26 -3
  22. package/src/components/Anchor/Anchor.tsx +23 -14
  23. package/src/components/Kbd/Kbd.md +14 -0
  24. package/src/components/Kbd/Kbd.scss +30 -0
  25. package/src/components/Kbd/Kbd.tsx +28 -0
  26. package/src/components/NavToggle/NavToggle.md +51 -0
  27. package/src/components/NavToggle/NavToggle.scss +162 -0
  28. package/src/components/NavToggle/NavToggle.tsx +68 -0
  29. package/src/components/Tooltip/Tooltip.md +19 -0
  30. package/src/components/Tooltip/Tooltip.scss +75 -0
  31. package/src/components/Tooltip/Tooltip.tsx +69 -0
  32. package/src/css.ts +3 -0
  33. package/src/icons.ts +1 -0
  34. package/src/index.ts +7 -0
  35. package/src/respawn/Anchor.ts +26 -17
  36. package/src/respawn/Kbd.ts +22 -0
  37. package/src/respawn/NavToggle.ts +78 -0
  38. package/src/respawn/Tooltip.ts +63 -0
  39. package/src/respawn/index.ts +7 -0
  40. package/src/tooltip.ts +14 -0
package/README.md CHANGED
@@ -78,6 +78,13 @@ Themes nest (`<nav data-theme="tokyo-neon">` inside a light page), and your own
78
78
  ### New in 0.1.0-alpha.15
79
79
  - **`Icon`**: icons drawn for NURVUS on a 24-unit grid, in the text color, **1em by default** so an icon is as big as the text it sits in (`<Icon name="search" />`; `label` for an icon that stands alone). Names are typed (`IconName`); `ICONS` / `ICON_NAMES` list them. Same markup in `@nurvus/ui/respawn`.
80
80
 
81
+ ### New in 0.1.0-alpha.18
82
+ - **`NavToggle`**: the button that shows and hides navigation. The hamburger (even or asymmetric lines; eight ways to turn into a close mark: slide, cross, squeeze, elastic, spin, arrow, chevron, collapse) or the sidebar icon (its pane fills while the sidebar shows; closed, it shrinks away and the divider slides left). Says what it will do and whether it is open.
83
+ - **`Tooltip`**: a short label for a control, on hover (after a short rest) and keyboard focus, with an optional shortcut as key caps. WCAG 1.4.13: Esc hides it, the pointer can move onto it, it stays while hovered or focused. Describes the control (`aria-describedby`).
84
+ - **`Kbd`**: key caps for shortcuts (`<kbd>` per key), sized in em. `modKey()` returns ⌘ on Apple devices and Ctrl elsewhere.
85
+ - **`Anchor`**: the list icon before its title, a dot at each end of the rail, the highlight over every section in view (the first is `aria-current`), and `fade`: a soft wash behind the row being read.
86
+ - **`align-left` icon** (72).
87
+
81
88
  ### New in 0.1.0-alpha.17
82
89
  - **`Dropdown`**: a button that opens a menu of actions (the WAI-ARIA menu button: `aria-haspopup`, ↓ / ↑ / Enter / Space open it, Esc and choosing put focus back on the button, a click outside or Tab closes it).
83
90
  - **`Anchor`**: "On this page". A rail beside the rows bends in and out with the nesting, and a highlight slides along it to the section in view (scroll-spy on the page or inside `scrollRoot`); picking a row scrolls there and moves focus. Drawn from the items alone (rows are 1.75rem), so it renders the same on the server.
package/dist/icons.svg CHANGED
@@ -62,6 +62,7 @@
62
62
  <symbol id="heart" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20s-8-4.6-8-10.2A4.3 4.3 0 0 1 12 7.4a4.3 4.3 0 0 1 8 2.4C20 15.4 12 20 12 20z"/></symbol>
63
63
  <symbol id="grid" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="4" width="6" height="6" rx="1"/><rect x="14" y="4" width="6" height="6" rx="1"/><rect x="4" y="14" width="6" height="6" rx="1"/><rect x="14" y="14" width="6" height="6" rx="1"/></symbol>
64
64
  <symbol id="list" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 6h11M9 12h11M9 18h11"/><path d="M4.5 6h.01"/><path d="M4.5 12h.01"/><path d="M4.5 18h.01"/></symbol>
65
+ <symbol id="align-left" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6h16M4 12h10M4 18h13"/></symbol>
65
66
  <symbol id="link" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 14a4 4 0 0 0 5.66 0l3-3a4 4 0 0 0-5.66-5.66l-1 1"/><path d="M14 10a4 4 0 0 0-5.66 0l-3 3a4 4 0 0 0 5.66 5.66l1-1"/></symbol>
66
67
  <symbol id="sun" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"/></symbol>
67
68
  <symbol id="moon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 14.5A8 8 0 1 1 9.5 4a6.5 6.5 0 0 0 10.5 10.5z"/></symbol>