@nurvus/ui 0.1.0-alpha.16 → 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 (55) hide show
  1. package/README.md +13 -0
  2. package/dist/icons.svg +2 -0
  3. package/dist/index.js +1 -1
  4. package/dist/nurvus.css +6 -1
  5. package/dist/respawn.js +1 -1
  6. package/dist/types/anchor.d.ts +45 -0
  7. package/dist/types/components/Anchor/Anchor.d.ts +33 -0
  8. package/dist/types/components/Dropdown/Dropdown.d.ts +31 -0
  9. package/dist/types/components/Kbd/Kbd.d.ts +16 -0
  10. package/dist/types/components/Menu/Menu.d.ts +8 -1
  11. package/dist/types/components/NavToggle/NavToggle.d.ts +27 -0
  12. package/dist/types/components/Tooltip/Tooltip.d.ts +27 -0
  13. package/dist/types/dropdown.d.ts +9 -0
  14. package/dist/types/icons.d.ts +2 -0
  15. package/dist/types/index.d.ts +11 -0
  16. package/dist/types/respawn/Anchor.d.ts +30 -0
  17. package/dist/types/respawn/Dropdown.d.ts +27 -0
  18. package/dist/types/respawn/Kbd.d.ts +10 -0
  19. package/dist/types/respawn/Menu.d.ts +2 -0
  20. package/dist/types/respawn/NavToggle.d.ts +22 -0
  21. package/dist/types/respawn/Tooltip.d.ts +20 -0
  22. package/dist/types/respawn/index.d.ts +11 -0
  23. package/dist/types/tooltip.d.ts +4 -0
  24. package/package.json +1 -1
  25. package/src/anchor.ts +150 -0
  26. package/src/components/Anchor/Anchor.md +59 -0
  27. package/src/components/Anchor/Anchor.scss +88 -0
  28. package/src/components/Anchor/Anchor.tsx +114 -0
  29. package/src/components/Dropdown/Dropdown.md +48 -0
  30. package/src/components/Dropdown/Dropdown.scss +67 -0
  31. package/src/components/Dropdown/Dropdown.tsx +110 -0
  32. package/src/components/Kbd/Kbd.md +14 -0
  33. package/src/components/Kbd/Kbd.scss +30 -0
  34. package/src/components/Kbd/Kbd.tsx +28 -0
  35. package/src/components/Menu/Menu.md +1 -1
  36. package/src/components/Menu/Menu.scss +78 -0
  37. package/src/components/Menu/Menu.tsx +15 -3
  38. package/src/components/NavToggle/NavToggle.md +51 -0
  39. package/src/components/NavToggle/NavToggle.scss +162 -0
  40. package/src/components/NavToggle/NavToggle.tsx +68 -0
  41. package/src/components/Tooltip/Tooltip.md +19 -0
  42. package/src/components/Tooltip/Tooltip.scss +75 -0
  43. package/src/components/Tooltip/Tooltip.tsx +69 -0
  44. package/src/css.ts +5 -0
  45. package/src/dropdown.ts +24 -0
  46. package/src/icons.ts +3 -0
  47. package/src/index.ts +11 -0
  48. package/src/respawn/Anchor.ts +135 -0
  49. package/src/respawn/Dropdown.ts +90 -0
  50. package/src/respawn/Kbd.ts +22 -0
  51. package/src/respawn/Menu.ts +10 -7
  52. package/src/respawn/NavToggle.ts +78 -0
  53. package/src/respawn/Tooltip.ts +63 -0
  54. package/src/respawn/index.ts +11 -0
  55. package/src/tooltip.ts +14 -0
package/README.md CHANGED
@@ -78,6 +78,19 @@ 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
+
88
+ ### New in 0.1.0-alpha.17
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).
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.
91
+ - **`Menu` chevrons at the start** (as Material UI): › closed, ⌄ open, before the title, with a hairline guide down an open section and the current page's bar on it. `chevron="end"` keeps the old look. A menu of actions now carries its `id` (for `aria-controls`).
92
+ - **`contrast` icon** (71 icons): a ring with its right half filled, for theme switches.
93
+
81
94
  ### New in 0.1.0-alpha.16
82
95
  - **Sizes are rem.** Type, spacing, radii and component sizes are in rem (hairlines and focus rings stay px), so everything grows when a reader sets bigger text in their browser. At the default (16px) nothing moves: the same pixels as before.
83
96
  - **`Menu` is links, actions or a tree**, and screen readers hear each as what it is. Items with `href` make navigation (as before); items with `onSelect` make a menu of actions (`role="menu"`, one Tab stop, arrow keys, type to find); `kind="tree"` (or Tree's props) makes a tree. Up and Down move between items in all three. `Tree` is still there: the same as `<Menu kind="tree" />`. Menu with Tree's props no longer warns.
package/dist/icons.svg CHANGED
@@ -62,9 +62,11 @@
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>
69
+ <symbol id="contrast" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M12 3a9 9 0 0 1 0 18z" fill="currentColor"/></symbol>
68
70
  <symbol id="palette" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3a9 9 0 0 0 0 18c1.1 0 1.6-.8 1.6-1.6 0-1-.9-1.4-.9-2.4 0-.9.7-1.5 1.6-1.5H16a5 5 0 0 0 5-5C21 6.4 17 3 12 3z"/><path d="M7.5 11.5h.01"/><path d="M9.5 7.5h.01"/><path d="M14.5 7.5h.01"/></symbol>
69
71
  <symbol id="sparkles" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 4l1.6 4.4L16 10l-4.4 1.6L10 16l-1.6-4.4L4 10l4.4-1.6z"/><path d="M18 14l.8 2.2L21 17l-2.2.8L18 20l-.8-2.2L15 17l2.2-.8z"/></symbol>
70
72
  <symbol id="zap" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M13 2.5L4.5 13.5H11l-1 8 8.5-11H12z"/></symbol>