@nyxwire/css 0.0.0-stage → 0.1.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 (134) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +133 -2
  3. package/dist/base.css +850 -0
  4. package/dist/components.css +10508 -0
  5. package/dist/docs/components/accordion.md +83 -0
  6. package/dist/docs/components/alert.md +52 -0
  7. package/dist/docs/components/avatar.md +55 -0
  8. package/dist/docs/components/badge.md +64 -0
  9. package/dist/docs/components/breadcrumbs.md +64 -0
  10. package/dist/docs/components/button.md +197 -0
  11. package/dist/docs/components/card.md +103 -0
  12. package/dist/docs/components/checkbox.md +45 -0
  13. package/dist/docs/components/chip.md +30 -0
  14. package/dist/docs/components/cluster.md +33 -0
  15. package/dist/docs/components/code.md +65 -0
  16. package/dist/docs/components/container.md +24 -0
  17. package/dist/docs/components/dialog.md +199 -0
  18. package/dist/docs/components/divider.md +31 -0
  19. package/dist/docs/components/dl.md +24 -0
  20. package/dist/docs/components/effect-utilities.md +82 -0
  21. package/dist/docs/components/empty.md +40 -0
  22. package/dist/docs/components/frame.md +27 -0
  23. package/dist/docs/components/grid.md +31 -0
  24. package/dist/docs/components/hud.md +75 -0
  25. package/dist/docs/components/input-group.md +28 -0
  26. package/dist/docs/components/input.md +52 -0
  27. package/dist/docs/components/kbd.md +42 -0
  28. package/dist/docs/components/label-and-field.md +31 -0
  29. package/dist/docs/components/link.md +41 -0
  30. package/dist/docs/components/list.md +67 -0
  31. package/dist/docs/components/menu.md +85 -0
  32. package/dist/docs/components/meter.md +77 -0
  33. package/dist/docs/components/navbar.md +66 -0
  34. package/dist/docs/components/pagination.md +64 -0
  35. package/dist/docs/components/popover.md +59 -0
  36. package/dist/docs/components/progress.md +32 -0
  37. package/dist/docs/components/prose.md +29 -0
  38. package/dist/docs/components/select.md +51 -0
  39. package/dist/docs/components/sidebar.md +35 -0
  40. package/dist/docs/components/sidenav.md +45 -0
  41. package/dist/docs/components/skeleton.md +36 -0
  42. package/dist/docs/components/slider.md +32 -0
  43. package/dist/docs/components/spinner.md +30 -0
  44. package/dist/docs/components/stack.md +26 -0
  45. package/dist/docs/components/steps.md +49 -0
  46. package/dist/docs/components/switch.md +19 -0
  47. package/dist/docs/components/table.md +83 -0
  48. package/dist/docs/components/tabs.md +207 -0
  49. package/dist/docs/components/textarea.md +13 -0
  50. package/dist/docs/components/toast.md +86 -0
  51. package/dist/docs/components/tooltip.md +39 -0
  52. package/dist/docs/components/typography-classes.md +38 -0
  53. package/dist/docs/families/data-display.md +15 -0
  54. package/dist/docs/families/feedback.md +13 -0
  55. package/dist/docs/families/forms.md +141 -0
  56. package/dist/docs/families/layout-typography.md +17 -0
  57. package/dist/docs/families/navigation.md +13 -0
  58. package/dist/docs/families/overlays.md +13 -0
  59. package/dist/docs/families/surfaces.md +11 -0
  60. package/dist/docs/foundations/accessibility.md +71 -0
  61. package/dist/docs/foundations/color-roles.md +114 -0
  62. package/dist/docs/foundations/effects-motion.md +150 -0
  63. package/dist/docs/foundations/flavors.md +156 -0
  64. package/dist/docs/foundations/icons.md +45 -0
  65. package/dist/docs/foundations/palette.md +180 -0
  66. package/dist/docs/foundations/spacing-elevation.md +168 -0
  67. package/dist/docs/foundations/typography.md +80 -0
  68. package/dist/docs/index.md +233 -0
  69. package/dist/docs/manifest.json +859 -0
  70. package/dist/fonts/inter-OFL.txt +93 -0
  71. package/dist/fonts/inter-latin-ext-wght-italic.woff2 +0 -0
  72. package/dist/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
  73. package/dist/fonts/inter-latin-wght-italic.woff2 +0 -0
  74. package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
  75. package/dist/fonts/martian-mono-OFL.txt +93 -0
  76. package/dist/fonts/martian-mono-latin-ext-wdth-normal.woff2 +0 -0
  77. package/dist/fonts/martian-mono-latin-wdth-normal.woff2 +0 -0
  78. package/dist/fonts/space-grotesk-OFL.txt +93 -0
  79. package/dist/fonts/space-grotesk-latin-ext-wght-normal.woff2 +0 -0
  80. package/dist/fonts/space-grotesk-latin-wght-normal.woff2 +0 -0
  81. package/dist/fonts.css +73 -0
  82. package/dist/nyxwire.css +12183 -0
  83. package/dist/tokens.css +579 -0
  84. package/dist/utilities.css +176 -0
  85. package/nyxwire.d.ts +2 -0
  86. package/package.json +66 -3
  87. package/skills/nyxwire/SKILL.md +63 -0
  88. package/src/base.css +158 -0
  89. package/src/components/accordion.css +280 -0
  90. package/src/components/alert.css +176 -0
  91. package/src/components/avatar.css +262 -0
  92. package/src/components/badge.css +193 -0
  93. package/src/components/breadcrumbs.css +209 -0
  94. package/src/components/btn.css +517 -0
  95. package/src/components/card.css +327 -0
  96. package/src/components/checkbox.css +202 -0
  97. package/src/components/chip.css +345 -0
  98. package/src/components/code.css +340 -0
  99. package/src/components/dialog.css +411 -0
  100. package/src/components/divider.css +201 -0
  101. package/src/components/empty.css +216 -0
  102. package/src/components/field.css +161 -0
  103. package/src/components/hud.css +212 -0
  104. package/src/components/index.css +50 -0
  105. package/src/components/input.css +383 -0
  106. package/src/components/kbd.css +197 -0
  107. package/src/components/layout.css +344 -0
  108. package/src/components/link.css +178 -0
  109. package/src/components/list.css +353 -0
  110. package/src/components/menu.css +347 -0
  111. package/src/components/meter.css +238 -0
  112. package/src/components/navbar.css +309 -0
  113. package/src/components/pagination.css +302 -0
  114. package/src/components/popover.css +352 -0
  115. package/src/components/progress.css +241 -0
  116. package/src/components/select.css +121 -0
  117. package/src/components/sidenav.css +326 -0
  118. package/src/components/skeleton.css +193 -0
  119. package/src/components/slider.css +201 -0
  120. package/src/components/spinner.css +200 -0
  121. package/src/components/stat.css +263 -0
  122. package/src/components/steps.css +311 -0
  123. package/src/components/switch.css +183 -0
  124. package/src/components/table.css +290 -0
  125. package/src/components/tabs.css +271 -0
  126. package/src/components/toast.css +413 -0
  127. package/src/components/tooltip.css +288 -0
  128. package/src/fonts.css +92 -0
  129. package/src/index.css +6 -0
  130. package/src/motion.css +177 -0
  131. package/src/semantic.css +85 -0
  132. package/src/tokens.css +276 -0
  133. package/src/typography.css +430 -0
  134. package/src/utilities.css +198 -0
@@ -0,0 +1,85 @@
1
+ # .nw-menu
2
+
3
+ Part of [Overlays](../families/overlays.md).
4
+
5
+ `nw-menu` is a list of commands. It works as a static block (sidebars, menus a script renders) or as a Popover API element. A menu is a command surface, so give it `role="menu"` and its items `role="menuitem"`, `menuitemcheckbox` or `menuitemradio`.
6
+
7
+ A popover menu opens and dismisses natively. The arrow-key navigation, typeahead and focus management of the menu pattern are **not** provided by HTML; use the Vue `NwDropdownMenu` family when you need them.
8
+
9
+ ```html
10
+ <button type="button" class="nw-btn nw-btn-secondary" popovertarget="menu-pop" aria-haspopup="menu">Open menu</button>
11
+ <div id="menu-pop" popover class="nw-menu" role="menu" aria-label="Node actions">
12
+ <div class="nw-menu-label">Node</div>
13
+ <button type="button" class="nw-menu-item" role="menuitem"><span class="nw-menu-icon" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M5 12h14M12 5v14"/></svg></span><span class="nw-menu-item-text">Add a node</span><span class="nw-menu-shortcut">N</span></button>
14
+ <button type="button" class="nw-menu-item" role="menuitem"><span class="nw-menu-item-text">Pin to top</span><span class="nw-menu-shortcut">P</span></button>
15
+ <div class="nw-menu-separator" role="separator"></div>
16
+ <button type="button" class="nw-menu-item" role="menuitemcheckbox" aria-checked="true"><span class="nw-menu-item-text">Notify on change</span></button>
17
+ <button type="button" class="nw-menu-item" role="menuitemcheckbox" aria-checked="false"><span class="nw-menu-item-text">Auto-failover</span></button>
18
+ <div class="nw-menu-separator" role="separator"></div>
19
+ <button type="button" class="nw-menu-item nw-menu-item-danger" role="menuitem"><span class="nw-menu-item-text">Drop node</span><span class="nw-menu-shortcut">Del</span></button>
20
+ </div>
21
+ ```
22
+
23
+ Highlight is a wash in the intent ink, on hover, on `:focus-visible` and on `[data-highlighted]`, which is how a script marks the keyboard-active item.
24
+
25
+ ```html
26
+ <div class="nw-menu" role="menu" aria-label="Node" style="position: static; display: flex">
27
+ <div class="nw-menu-label">Actions</div>
28
+ <button type="button" class="nw-menu-item" role="menuitem"><span class="nw-menu-icon" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="12" cy="8" r="4"/><path d="M4 21a8 8 0 0 1 16 0"/></svg></span><span class="nw-menu-item-text">Profile</span><span class="nw-menu-shortcut">P</span></button>
29
+ <button type="button" class="nw-menu-item" role="menuitem" data-highlighted><span class="nw-menu-item-text">Highlighted (data-highlighted)</span><span class="nw-menu-shortcut">I</span></button>
30
+ <button type="button" class="nw-menu-item" role="menuitem"><span class="nw-menu-item-text">With description<span class="nw-menu-item-description">A second line under the label</span></span></button>
31
+ <button type="button" class="nw-menu-item" role="menuitem" aria-haspopup="menu" aria-expanded="false"><span class="nw-menu-item-text">Submenu trigger</span></button>
32
+ <button type="button" class="nw-menu-item" role="menuitem" disabled><span class="nw-menu-item-text">Disabled</span><span class="nw-menu-shortcut">D</span></button>
33
+ <div class="nw-menu-separator" role="separator"></div>
34
+ <div class="nw-menu-label">Toggles</div>
35
+ <button type="button" class="nw-menu-item" role="menuitemcheckbox" aria-checked="true"><span class="nw-menu-item-text">Checked</span></button>
36
+ <button type="button" class="nw-menu-item" role="menuitemcheckbox" aria-checked="false"><span class="nw-menu-item-text">Unchecked</span></button>
37
+ <button type="button" class="nw-menu-item" role="menuitemcheckbox" aria-checked="mixed"><span class="nw-menu-item-text">Mixed</span></button>
38
+ <div class="nw-menu-separator" role="separator"></div>
39
+ <div class="nw-menu-group" role="group" aria-label="Sorting">
40
+ <button type="button" class="nw-menu-item" role="menuitemradio" aria-checked="false"><span class="nw-menu-item-text">Latency</span></button>
41
+ <button type="button" class="nw-menu-item" role="menuitemradio" aria-checked="true"><span class="nw-menu-item-text">Cost</span></button>
42
+ </div>
43
+ <div class="nw-menu-group" role="group">
44
+ <button type="button" class="nw-menu-item nw-menu-item-danger" role="menuitem"><span class="nw-menu-item-text">Drop everything</span><span class="nw-menu-shortcut">Del</span></button>
45
+ </div>
46
+ </div>
47
+ <div class="nw-stack nw-stack-sm">
48
+ <div class="nw-menu nw-menu-sm" role="menu" aria-label="Small" style="position: static; display: flex">
49
+ <div class="nw-menu-label">nw-menu-sm</div>
50
+ <button type="button" class="nw-menu-item" role="menuitem"><span class="nw-menu-item-text">Compact item</span><span class="nw-menu-shortcut">1</span></button>
51
+ </div>
52
+ <div class="nw-menu nw-menu-lg nw-menu-soft nw-menu-success" role="menu" aria-label="Large and soft" style="position: static; display: flex">
53
+ <div class="nw-menu-label">nw-menu-lg, soft, success</div>
54
+ <button type="button" class="nw-menu-item" role="menuitem"><span class="nw-menu-item-text">Roomy item</span><span class="nw-menu-shortcut">2</span></button>
55
+ </div>
56
+ <div class="nw-menubar" role="menubar" aria-label="Menubar">
57
+ <button type="button" class="nw-menu-item" role="menuitem" aria-haspopup="menu">File</button>
58
+ <button type="button" class="nw-menu-item" role="menuitem" aria-haspopup="menu" aria-expanded="true">Edit</button>
59
+ <button type="button" class="nw-menu-item" role="menuitem" aria-haspopup="menu">View</button>
60
+ <button type="button" class="nw-menu-item" role="menuitem" aria-haspopup="menu" disabled>Help</button>
61
+ </div>
62
+ </div>
63
+ ```
64
+
65
+ | Class / selector | Effect |
66
+ | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
67
+ | `nw-menu` | The panel. As `[popover]` it is hidden until open, with the `:popover-open` enter animation. |
68
+ | `nw-menu-sm`, `-lg` | Compact and roomy items. |
69
+ | `nw-menu-soft` | The highlighted item takes the intent wash and ink instead of the neutral hover. |
70
+ | `nw-menu-wire` | The gradient edge around the panel. |
71
+ | `nw-menu-primary` ... `-danger` | The intent of check marks and, in the soft variant, the highlight. |
72
+ | `nw-menu-label` | Non-interactive section heading. |
73
+ | `nw-menu-separator` | Divider line; give it `role="separator"`. |
74
+ | `nw-menu-group` | Wrapper for related items (`role="group"`). |
75
+ | `nw-menu-item` | A row. Use a `<button>`. |
76
+ | `nw-menu-item-text`, `nw-menu-item-description` | The label cell, and a secondary line inside it. |
77
+ | `nw-menu-icon` | Leading icon slot; mark it `aria-hidden`. |
78
+ | `nw-menu-shortcut` | Trailing key hint, in mono. |
79
+ | `nw-menu-item-danger` | Danger ink, and a danger wash when highlighted. |
80
+ | `nw-menubar` | Horizontal row of triggers (`role="menubar"`). |
81
+ | `[aria-checked="true"]`, `[aria-checked="mixed"]`, `[data-state="checked"]` | Draws the check or dash mark on a checkbox or radio item. |
82
+ | `[aria-haspopup]`, `[aria-expanded="true"]` | A submenu trigger: a trailing chevron, and the highlight stays while open. |
83
+ | `:disabled`, `[aria-disabled="true"]`, `[data-disabled]` | Disabled item. |
84
+ | `[data-highlighted]` | Keyboard-active item. |
85
+ | `[data-state="open"]`, `[data-state="closed"]` | Enter and leave motion for a script-rendered menu. |
@@ -0,0 +1,77 @@
1
+ # .nw-meter and .nw-stat
2
+
3
+ Part of [Feedback](../families/feedback.md).
4
+
5
+ A meter is a scalar value inside a known range, such as load, capacity or signal: not task progress. On the native `<meter>` the browser picks the level from `low`, `high` and `optimum`, and the levels paint success (or the chosen intent), warning and danger. The div version reads `--nw-meter` and takes the intent color, so switch to `nw-meter-warning` or `nw-meter-danger` at your own thresholds.
6
+
7
+ ```html
8
+ <div class="nw-stack">
9
+ <div>
10
+ <div class="nw-meter-row"><span id="mt-mem">Memory</span><span class="nw-meter-value">82%</span></div>
11
+ <meter class="nw-meter" min="0" max="100" low="30" high="75" optimum="20" value="82" aria-labelledby="mt-mem"></meter>
12
+ </div>
13
+ <meter class="nw-meter nw-meter-sm" min="0" max="100" low="30" high="75" optimum="20" value="50" aria-label="Disk, suboptimum"></meter>
14
+ <meter class="nw-meter nw-meter-sm" min="0" max="100" low="30" high="75" optimum="20" value="18" aria-label="CPU, optimum"></meter>
15
+ <div class="nw-meter nw-meter-segmented nw-meter-tertiary" role="meter" aria-label="Signal" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="--nw-meter: 0.6"><div class="nw-meter-fill"></div></div>
16
+ <div class="nw-meter nw-meter-pill nw-meter-glow" role="meter" aria-label="Capacity" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="--nw-meter: 0.4"><div class="nw-meter-fill"></div></div>
17
+ <div class="nw-meter nw-meter-critical" role="meter" aria-label="Temperature, critical" aria-valuenow="96" aria-valuemin="0" aria-valuemax="100" style="--nw-meter: 0.96"><div class="nw-meter-fill"></div></div>
18
+ </div>
19
+ <div class="nw-cluster nw-cluster-top">
20
+ <div class="nw-meter nw-meter-vertical nw-meter-success" role="meter" aria-label="Left channel" aria-valuenow="70" aria-valuemin="0" aria-valuemax="100" style="--nw-meter: 0.7"><div class="nw-meter-fill"></div></div>
21
+ <div class="nw-meter nw-meter-vertical nw-meter-warning" role="meter" aria-label="Right channel" aria-valuenow="85" aria-valuemin="0" aria-valuemax="100" style="--nw-meter: 0.85"><div class="nw-meter-fill"></div></div>
22
+ </div>
23
+ ```
24
+
25
+ | Class / selector | Effect |
26
+ | ------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
27
+ | `nw-meter` | The track: on `<meter>`, or on a `role="meter"` div with `--nw-meter` as a 0 to 1 fraction. |
28
+ | `nw-meter-fill`, `nw-meter-row`, `nw-meter-value` | The div fill and the label line. |
29
+ | `nw-meter-xs`, `-sm`, `-md`, `-lg` | Track heights. |
30
+ | `nw-meter-primary` ... `-danger` | The optimum level's intent on a native meter; the fill intent on a div. |
31
+ | `nw-meter-segmented` | Splits the track into cells. |
32
+ | `nw-meter-vertical` | A vertical bar that fills upward. |
33
+ | `nw-meter-pill`, `nw-meter-glow` | Rounded ends and a bloom on the fill. |
34
+ | `nw-meter-critical` | Pulses the danger fill. Stops under reduced motion unless the meter has `nw-motion-essential`. |
35
+
36
+ A stat is one number someone acts on, with its label, trend and context. The value is set in Space Grotesk with tabular numerals; a `<small>` inside it holds the unit.
37
+
38
+ ```html
39
+ <div class="nw-stat-group">
40
+ <div class="nw-stat nw-stat-boxed nw-stat-primary">
41
+ <span class="nw-stat-icon" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M3 12h4l3-8 4 16 3-8h4"/></svg></span>
42
+ <span class="nw-stat-label">Throughput</span>
43
+ <span class="nw-stat-value">12.4<small>k/s</small></span>
44
+ <span class="nw-stat-delta nw-stat-delta-up">+8.2%</span>
45
+ <span class="nw-stat-description">against the previous hour</span>
46
+ </div>
47
+ <div class="nw-stat nw-stat-boxed nw-stat-cut nw-stat-glow nw-stat-secondary">
48
+ <span class="nw-stat-label">Latency</span>
49
+ <span class="nw-stat-value">38<small>ms</small></span>
50
+ <span class="nw-stat-delta nw-stat-delta-down">+4 ms</span>
51
+ </div>
52
+ <div class="nw-stat nw-stat-wire nw-stat-sm">
53
+ <span class="nw-stat-label">Relays</span>
54
+ <span class="nw-stat-value">146</span>
55
+ <span class="nw-stat-delta">no change</span>
56
+ </div>
57
+ </div>
58
+ <div class="nw-stat-group nw-stat-group-divided">
59
+ <div class="nw-stat nw-stat-lg"><span class="nw-stat-label">Uptime</span><span class="nw-stat-value">99.98<small>%</small></span></div>
60
+ <div class="nw-stat nw-stat-lg nw-stat-danger"><span class="nw-stat-label">Errors</span><span class="nw-stat-value">3</span></div>
61
+ </div>
62
+ ```
63
+
64
+ | Class | Effect |
65
+ | ---------------------------------------- | --------------------------------------------------------------------------------------- |
66
+ | `nw-stat` | The column of parts. |
67
+ | `nw-stat-label` | The metric name. |
68
+ | `nw-stat-value` | The number; `<small>` for the unit. |
69
+ | `nw-stat-delta` | The change, in neutral text. |
70
+ | `nw-stat-delta-up`, `nw-stat-delta-down` | An up arrow in success, a down arrow in danger. Pick by meaning: a latency rise is bad. |
71
+ | `nw-stat-description` | Context such as the comparison period. |
72
+ | `nw-stat-icon` | A leading icon in the intent ink. |
73
+ | `nw-stat-sm`, `-md`, `-lg` | Value sizes. |
74
+ | `nw-stat-primary` ... `-danger` | Value and icon ink. |
75
+ | `nw-stat-boxed`, `-wire`, `-cut` | A panel around the stat, the gradient edge, and a chamfered panel. |
76
+ | `nw-stat-glow` | The value blooms in its ink. |
77
+ | `nw-stat-group`, `nw-stat-group-divided` | A wrapping row of stats, with hairlines instead of boxes in the divided version. |
@@ -0,0 +1,66 @@
1
+ # .nw-navbar
2
+
3
+ Part of [Navigation](../families/navigation.md).
4
+
5
+ The navbar is the top bar of an app shell: a brand, a link row and actions, with a toggle that opens the region under 48rem. The toggle needs one line of script to flip `aria-expanded` on itself and `data-state="open"` on the region; the demo uses the `data-toggle` behavior from the script below.
6
+
7
+ ```html
8
+ <header class="nw-navbar">
9
+ <div class="nw-navbar-inner">
10
+ <a class="nw-navbar-brand" href="#nw-navbar">NIGHT<span class="nw-navbar-brand-mark">WIRE</span></a>
11
+ <button type="button" class="nw-navbar-toggle" aria-expanded="false" aria-controls="nav-demo" data-toggle="#nav-demo">Menu</button>
12
+ <div class="nw-navbar-collapse" id="nav-demo">
13
+ <nav class="nw-navbar-nav" aria-label="Primary">
14
+ <a class="nw-navbar-link" href="#nw-navbar" aria-current="page">Overview</a>
15
+ <a class="nw-navbar-link" href="#nw-navbar">Relays</a>
16
+ <a class="nw-navbar-link" href="#nw-navbar" aria-disabled="true">Beta</a>
17
+ </nav>
18
+ <div class="nw-navbar-actions">
19
+ <span class="nw-navbar-spacer"></span>
20
+ <button type="button" class="nw-btn nw-btn-sm nw-btn-ghost nw-btn-neutral">Docs</button>
21
+ <button type="button" class="nw-btn nw-btn-sm">Open console</button>
22
+ </div>
23
+ </div>
24
+ </div>
25
+ </header>
26
+ ```
27
+
28
+ ```html
29
+ <div class="nw-stack nw-stack-sm">
30
+ <header class="nw-navbar nw-navbar-glass">
31
+ <div class="nw-navbar-inner">
32
+ <a class="nw-navbar-brand" href="#nw-navbar">Glass</a>
33
+ <nav class="nw-navbar-nav" aria-label="Glass nav"><a class="nw-navbar-link" href="#nw-navbar" aria-current="page">One</a><a class="nw-navbar-link" href="#nw-navbar">Two</a></nav>
34
+ </div>
35
+ </header>
36
+ <header class="nw-navbar nw-navbar-wire">
37
+ <div class="nw-navbar-inner">
38
+ <a class="nw-navbar-brand" href="#nw-navbar">Wire</a>
39
+ <nav class="nw-navbar-nav" aria-label="Wire nav"><a class="nw-navbar-link" href="#nw-navbar" aria-current="page">One</a><a class="nw-navbar-link" href="#nw-navbar">Two</a></nav>
40
+ </div>
41
+ </header>
42
+ <header class="nw-navbar nw-navbar-solid nw-navbar-danger">
43
+ <div class="nw-navbar-inner">
44
+ <a class="nw-navbar-brand" href="#nw-navbar">Solid, danger</a>
45
+ <nav class="nw-navbar-nav" aria-label="Solid nav"><a class="nw-navbar-link" href="#nw-navbar" aria-current="page">Alarm</a></nav>
46
+ </div>
47
+ </header>
48
+ </div>
49
+ ```
50
+
51
+ | Class / selector | Effect |
52
+ | ------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
53
+ | `nw-navbar` | The bar: hairline bottom edge, glass fill by default. |
54
+ | `nw-navbar-inner` | A row for the brand and the region; add `nw-container` to bound its width. |
55
+ | `nw-navbar-brand` | The wordmark; `nw-navbar-brand-mark` sets the accent half (NIGHT<span>WIRE</span>). |
56
+ | `nw-navbar-nav` | The link row. |
57
+ | `nw-navbar-link` | A bar link; `[aria-current]` and `nw-navbar-link-active` mark the current page. |
58
+ | `nw-navbar-actions`, `nw-navbar-spacer` | The action row, and the spacer that pushes it to the end. |
59
+ | `nw-navbar-toggle` | The narrow-screen trigger. Its glyph swaps when `aria-expanded="true"`. |
60
+ | `nw-navbar-collapse` | The region the toggle opens under 48rem, through `data-state="open"`. |
61
+ | `nw-navbar-sticky` | `position: sticky` at the top. |
62
+ | `nw-navbar-solid`, `-glass`, `-wire`, `-floating` | Sunken fill; translucent glass (default); the gradient wire as the bottom edge; a detached, rounded bar. |
63
+ | `nw-navbar-sm`, `-md`, `-lg` | Bar height. |
64
+ | `nw-navbar-primary` ... `-danger` | The current link's ink and the wire's colors. |
65
+
66
+ Name the collapsed region with `aria-controls` on the toggle, and keep it in the DOM but `data-state="closed"` rather than removing it, so it stays in the accessibility tree.
@@ -0,0 +1,64 @@
1
+ # .nw-pagination
2
+
3
+ Part of [Navigation](../families/navigation.md).
4
+
5
+ Pagination is a `<nav aria-label="Pagination">` around a list. Items are links for server-rendered pages or buttons for client state. The current page carries `aria-current="page"` (or `data-selected`); numerals are mono and tabular so the items keep one width.
6
+
7
+ ```html
8
+ <div class="nw-stack">
9
+ <nav class="nw-pagination nw-pagination-between" aria-label="Relays">
10
+ <span class="nw-pagination-summary">21-40 of 212</span>
11
+ <ul class="nw-pagination-list">
12
+ <li><a class="nw-pagination-item nw-pagination-prev" href="#nw-pagination">Prev</a></li>
13
+ <li><a class="nw-pagination-item" href="#nw-pagination">1</a></li>
14
+ <li><a class="nw-pagination-item" href="#nw-pagination" aria-current="page">2</a></li>
15
+ <li><a class="nw-pagination-item" href="#nw-pagination">3</a></li>
16
+ <li><span class="nw-pagination-ellipsis" aria-hidden="true">...</span></li>
17
+ <li><a class="nw-pagination-item" href="#nw-pagination">11</a></li>
18
+ <li><a class="nw-pagination-item nw-pagination-next" href="#nw-pagination">Next</a></li>
19
+ </ul>
20
+ </nav>
21
+ <nav class="nw-pagination nw-pagination-outline nw-pagination-sm" aria-label="Outline pages">
22
+ <ul class="nw-pagination-list">
23
+ <li><button type="button" class="nw-pagination-item" aria-label="Previous page" disabled>&lsaquo;</button></li>
24
+ <li><button type="button" class="nw-pagination-item" aria-current="page">1</button></li>
25
+ <li><button type="button" class="nw-pagination-item">2</button></li>
26
+ <li><button type="button" class="nw-pagination-item">3</button></li>
27
+ <li><button type="button" class="nw-pagination-item" aria-label="Next page">&rsaquo;</button></li>
28
+ </ul>
29
+ </nav>
30
+ <nav class="nw-pagination nw-pagination-pill nw-pagination-solid nw-pagination-lg nw-pagination-secondary" aria-label="Pill pages">
31
+ <ul class="nw-pagination-list">
32
+ <li><button type="button" class="nw-pagination-item nw-pagination-prev">Prev</button></li>
33
+ <li><button type="button" class="nw-pagination-item">4</button></li>
34
+ <li><button type="button" class="nw-pagination-item" data-selected>5</button></li>
35
+ <li><button type="button" class="nw-pagination-item">6</button></li>
36
+ <li><button type="button" class="nw-pagination-item nw-pagination-next" aria-disabled="true">Next</button></li>
37
+ </ul>
38
+ </nav>
39
+ <nav class="nw-pagination nw-pagination-cut nw-pagination-end" aria-label="Cut pages">
40
+ <ul class="nw-pagination-list">
41
+ <li><button type="button" class="nw-pagination-item">8</button></li>
42
+ <li><button type="button" class="nw-pagination-item" aria-current="page">9</button></li>
43
+ </ul>
44
+ </nav>
45
+ </div>
46
+ ```
47
+
48
+ | Class / selector | Effect |
49
+ | ------------------------------------------------------------------ | -------------------------------------------------------- |
50
+ | `nw-pagination` | The nav wrapper, a row. |
51
+ | `nw-pagination-list` | The list; a bare `<ul>` inside works too. |
52
+ | `nw-pagination-item` | A page, previous or next control (`<a>` or `<button>`). |
53
+ | `nw-pagination-prev`, `-next` | Edge controls; icon-only ones need an `aria-label`. |
54
+ | `nw-pagination-ellipsis` | Gap marker between page numbers. |
55
+ | `nw-pagination-summary` | A caption such as "21-40 of 212". |
56
+ | `nw-pagination-solid` | The current item is filled and glows. |
57
+ | `nw-pagination-outline` | Every item is a bordered control. |
58
+ | `nw-pagination-pill` | Fully rounded items. |
59
+ | `nw-pagination-cut` | Chamfered items; the current one glows through a filter. |
60
+ | `nw-pagination-xs` ... `-lg` | Item sizes. |
61
+ | `nw-pagination-center`, `-end`, `-between` | Aligns the list, or spreads the summary and the list. |
62
+ | `nw-pagination-primary` ... `-danger` | The intent of the current item. |
63
+ | `[aria-current="page"]`, `[data-selected]`, `nw-pagination-active` | The current page. |
64
+ | `:disabled`, `[aria-disabled="true"]` | Disabled item. |
@@ -0,0 +1,59 @@
1
+ # .nw-popover
2
+
3
+ Part of [Overlays](../families/overlays.md).
4
+
5
+ `nw-popover` styles an element with the `popover` attribute. The Popover API gives you toggling with `popovertarget`, light dismiss (click outside, Escape) and top-layer stacking with no script. `popovertargetaction="hide"` on a button inside closes it.
6
+
7
+ The browser centers an unpositioned popover in the viewport, so these demos open in the middle of the window. In a real UI, position it with CSS anchor positioning or a library such as Floating UI.
8
+
9
+ ```html
10
+ <div class="nw-cluster">
11
+ <button type="button" class="nw-btn nw-btn-soft" popovertarget="pop-md">Popover</button>
12
+ <button type="button" class="nw-btn nw-btn-soft" popovertarget="pop-cut">Cut and wired</button>
13
+ <button type="button" class="nw-btn nw-btn-soft" popovertarget="pop-glow">Glowing</button>
14
+ </div>
15
+ <div id="pop-md" popover class="nw-popover">
16
+ <header class="nw-popover-header">
17
+ <h3 class="nw-popover-title">Relay hel-01</h3>
18
+ <p class="nw-popover-description">Helsinki edge node, eu-north</p>
19
+ </header>
20
+ <div class="nw-popover-body"><p>Panel fill, hairline edge and the overlay shadow.</p></div>
21
+ <footer class="nw-popover-footer">
22
+ <button type="button" class="nw-btn nw-btn-ghost nw-btn-neutral nw-btn-sm" popovertarget="pop-md" popovertargetaction="hide">Close</button>
23
+ <button type="button" class="nw-btn nw-btn-sm">Ping</button>
24
+ </footer>
25
+ </div>
26
+ <div id="pop-cut" popover class="nw-popover nw-popover-sm nw-popover-cut nw-popover-wire nw-popover-secondary">
27
+ <div class="nw-popover-body">Cut corners and the gradient wire edge, in the secondary intent.</div>
28
+ </div>
29
+ <div id="pop-glow" popover class="nw-popover nw-popover-md nw-popover-glow nw-popover-success">
30
+ <div class="nw-popover-body">A success glow around the panel.</div>
31
+ </div>
32
+ ```
33
+
34
+ `nw-popover` also works as a plain box, driven by `data-state` and `data-side`, which is how a positioning library renders it. An `.nw-popover-arrow` that is an element (not an `<svg>`) is a rotated square that shares the panel's fill and edge; give it the popover's `data-side` and set its inline inset from the library's arrow coordinates.
35
+
36
+ ```html
37
+ <div class="nw-cluster nw-cluster-top">
38
+ <div class="nw-popover nw-popover-sm" data-state="open" data-side="bottom">data-state="open"</div>
39
+ <div class="nw-popover nw-popover-sm" data-side="top" style="position: relative">
40
+ data-side="top" with an arrow
41
+ <span class="nw-popover-arrow" data-side="bottom" style="top: 100%; left: 50%; translate: -50% 0"></span>
42
+ </div>
43
+ </div>
44
+ ```
45
+
46
+ | Class / selector | Effect |
47
+ | ---------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
48
+ | `nw-popover` | The panel: sunken fill, hairline, radius md, overlay shadow, an enter animation on `:popover-open`. |
49
+ | `nw-popover-xs`, `-sm`, `-md`, `-lg` | Widths 16rem, 20rem, 22rem (default) and 30rem. |
50
+ | `nw-popover-header`, `-title`, `-description` | Header, title (use a heading) and supporting text. |
51
+ | `nw-popover-body`, `-footer` | Content and action row. The body is the scrolling box, so the header stays put. |
52
+ | `nw-popover-close` | Corner close button; needs an `aria-label`. |
53
+ | `nw-popover-arrow` | A rotated square; an `<svg>` arrow is left to the library's own styling. |
54
+ | `nw-popover-primary` ... `-danger` | Intents color the edge and the glow. |
55
+ | `nw-popover-wire`, `-glow`, `-cut` | The gradient edge, a bloom, and cut corners. |
56
+ | `[popover]` | Hidden until open. |
57
+ | `:popover-open`, `[data-state="open"]` | Open state: enter animation. |
58
+ | `[data-state="closed"]` | Leave animation, played by the library's presence wrapper. |
59
+ | `[data-side="top"]`, `"bottom"`, `"left"`, `"right"` | Motion direction, and the arrow's side. |
@@ -0,0 +1,32 @@
1
+ # .nw-progress
2
+
3
+ Part of [Feedback](../families/feedback.md).
4
+
5
+ Progress is task completion toward a known total, or an indeterminate busy bar. It styles the native `<progress>`, which carries its semantics on its own, or a `role="progressbar"` div whose fill reads `--nw-progress` (a 0 to 1 fraction).
6
+
7
+ ```html
8
+ <div class="nw-stack">
9
+ <div>
10
+ <div class="nw-progress-row"><span id="pr-upload">Upload</span><span class="nw-progress-value">64%</span></div>
11
+ <progress class="nw-progress" value="64" max="100" aria-labelledby="pr-upload"></progress>
12
+ </div>
13
+ <progress class="nw-progress nw-progress-xs nw-progress-success" value="90" max="100" aria-label="Extra small, success"></progress>
14
+ <progress class="nw-progress nw-progress-lg nw-progress-striped nw-progress-secondary" value="45" max="100" aria-label="Large, striped, secondary"></progress>
15
+ <progress class="nw-progress nw-progress-pill nw-progress-glow nw-progress-tertiary" value="70" max="100" aria-label="Pill with glow"></progress>
16
+ <progress class="nw-progress nw-progress-md nw-progress-cut nw-progress-warning" value="30" max="100" aria-label="Cut ends"></progress>
17
+ <progress class="nw-progress nw-progress-sm nw-motion-essential" aria-label="Indeterminate"></progress>
18
+ <div class="nw-progress nw-progress-sm nw-progress-info" role="progressbar" aria-label="Div version" aria-valuenow="52" aria-valuemin="0" aria-valuemax="100" style="--nw-progress: 0.52"><div class="nw-progress-fill"></div></div>
19
+ <div class="nw-progress nw-progress-sm nw-progress-indeterminate" role="progressbar" aria-label="Div, indeterminate"><div class="nw-progress-fill"></div></div>
20
+ </div>
21
+ ```
22
+
23
+ | Class / selector | Effect |
24
+ | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
25
+ | `nw-progress` | The track. On a `<progress>`, the value comes from the element; on a div, from `--nw-progress`. |
26
+ | `nw-progress-fill` | The fill element of the div version. |
27
+ | `nw-progress-row`, `nw-progress-value` | A label and value line above the track. |
28
+ | `nw-progress-xs`, `-sm`, `-md`, `-lg` | Track heights. |
29
+ | `nw-progress-primary` ... `-danger` | Fill intent. |
30
+ | `nw-progress-striped`, `-pill`, `-cut`, `-glow` | Diagonal stripes, rounded ends, chamfered ends proportional to the track, and a bloom on the fill. |
31
+ | `:indeterminate`, `nw-progress-indeterminate`, `[data-state="indeterminate"]` | A 40% fill sweeping the track. Omit `value` on the native element. |
32
+ | `nw-motion-essential` | Keeps the sweep under reduced motion; without it the bar shows a static busy state. |
@@ -0,0 +1,29 @@
1
+ # .nw-prose
2
+
3
+ Part of [Layout and typography](../families/layout-typography.md).
4
+
5
+ `nw-prose` gives bare elements their rhythm for long-form content: heading levels, list markers in the primary ink, blockquotes with hairlines, code on a well, tables with rules. Its descendant selectors stay inside `:where()`, so a role class or a component inside prose always wins.
6
+
7
+ ```html
8
+ <div class="nw-prose">
9
+ <h2>Long-form content</h2>
10
+ <p>Bare elements get their rhythm: headings keep their levels, paragraphs relax, lists get markers in the primary ink, and <code>code</code> sits on a well.</p>
11
+ <p>A quoted line gets its hairline:</p>
12
+ <blockquote><p>Every wire carries a story; ours carry packets.</p></blockquote>
13
+ <ul>
14
+ <li>Markers are primary.</li>
15
+ <li><a href="#nw-prose">Links</a> keep the primary ink and brighten on hover.</li>
16
+ </ul>
17
+ <dl><dt>Term</dt><dd>Its detail.</dd></dl>
18
+ </div>
19
+ <div class="nw-prose nw-prose-sm">
20
+ <p>Small prose: 0.875rem, for sidebars and captions.</p>
21
+ </div>
22
+ ```
23
+
24
+ | Class | Effect |
25
+ | ---------------------------- | -------------------------------------------------------- |
26
+ | `nw-prose` | A 68ch measure, base size, relaxed leading, muted ink. |
27
+ | `nw-prose-sm`, `nw-prose-lg` | Smaller and larger prose. |
28
+ | `nw-prose-wide` | No measure limit. |
29
+ | `nw-prose-scroll` | A `<pre>` inside scrolls instead of widening the column. |
@@ -0,0 +1,51 @@
1
+ # Select: .nw-select
2
+
3
+ Part of [Forms](../families/forms.md).
4
+
5
+ `nw-select` styles a native `<select>`. The caret is painted with gradients because the element has no pseudo-elements, and `multiple` or a `size` above 1 turns it into a list box without a caret. The option colors theme the platforms that honor them; the popup itself belongs to the browser. The same class works on a custom listbox trigger (a `<button>` or `role="combobox"`), where `aria-expanded`, `data-state="open"` and `data-placeholder` describe it; that is how the Vue `NwSelect` reuses it.
6
+
7
+ ```html
8
+ <div class="nw-field">
9
+ <label class="nw-label" for="f-flavor">Flavor</label>
10
+ <select class="nw-select" id="f-flavor">
11
+ <option>nocturne</option>
12
+ <option>twilight</option>
13
+ <option>abyss</option>
14
+ <option>lumen</option>
15
+ </select>
16
+ </div>
17
+ <div class="nw-field">
18
+ <label class="nw-label" for="f-accent">Accent (small, invalid)</label>
19
+ <select class="nw-select nw-select-sm" id="f-accent" aria-invalid="true">
20
+ <option value="">Choose an accent</option>
21
+ <optgroup label="Cool">
22
+ <option>indigo</option>
23
+ <option>ice</option>
24
+ <option>arc</option>
25
+ </optgroup>
26
+ <optgroup label="Warm">
27
+ <option>flare</option>
28
+ <option disabled>alarm (reserved)</option>
29
+ </optgroup>
30
+ </select>
31
+ <p class="nw-field-error">Pick an accent.</p>
32
+ </div>
33
+ <div class="nw-field">
34
+ <label class="nw-label" for="f-nodes">Nodes (multiple)</label>
35
+ <select class="nw-select" id="f-nodes" multiple size="4">
36
+ <option selected>hel-01</option>
37
+ <option>fra-02</option>
38
+ <option selected>ams-03</option>
39
+ <option>sto-04</option>
40
+ </select>
41
+ </div>
42
+ ```
43
+
44
+ | Class / selector | Effect |
45
+ | ----------------------------------------------- | ------------------------------------------------------------------------------ |
46
+ | `nw-select` | The input well plus a painted caret. |
47
+ | `nw-select-xs` ... `-lg` | The input sizes. |
48
+ | `nw-select-primary` ... `-danger` | The input intents. |
49
+ | `[multiple]`, `[size]` | List box: no caret, rows sized to the content. |
50
+ | `[aria-expanded="true"]`, `[data-state="open"]` | A custom trigger whose list is open keeps its focus paint and flips the caret. |
51
+ | `[data-placeholder]` | A custom trigger showing its placeholder uses the subtle ink. |
@@ -0,0 +1,35 @@
1
+ # .nw-sidebar and .nw-center
2
+
3
+ Part of [Layout and typography](../families/layout-typography.md).
4
+
5
+ `nw-sidebar` is a fixed-measure aside beside content that takes the rest, stacking when the content would fall under half the width. `nw-center` is a measure-limited, centered block.
6
+
7
+ ```html
8
+ <div class="nw-sidebar">
9
+ <nav class="nw-sidenav" aria-label="Sections">
10
+ <span class="nw-sidenav-label">Filter</span>
11
+ <ul class="nw-sidenav-list">
12
+ <li><a class="nw-sidenav-link" href="#nw-sidebar-and-nw-center" aria-current="page"><span class="nw-sidenav-text">All</span></a></li>
13
+ <li><a class="nw-sidenav-link" href="#nw-sidebar-and-nw-center"><span class="nw-sidenav-text">Online</span></a></li>
14
+ </ul>
15
+ </nav>
16
+ <div class="nw-stack">
17
+ <div class="nw-card nw-card-sm">Content takes the rest of the row.</div>
18
+ <div class="nw-card nw-card-sm">The sidebar is 16rem unless --nw-sidebar-size says otherwise.</div>
19
+ </div>
20
+ </div>
21
+ <div class="nw-center nw-center-text">
22
+ <p class="nw-lead">A measure-limited, centered block: 60ch unless --nw-center-max says otherwise.</p>
23
+ </div>
24
+ ```
25
+
26
+ | Class / property | Effect |
27
+ | ------------------------------------- | -------------------------------------------------------------------- |
28
+ | `nw-sidebar` | A wrapping row: the first child at 16rem, the second takes the rest. |
29
+ | `nw-sidebar-end` | The aside on the inline-end side. |
30
+ | `nw-sidebar-top` | The aside aligns to the top instead of stretching. |
31
+ | `--nw-sidebar-size` | The aside's measure. |
32
+ | `nw-center` | A centered block, at most 60ch. |
33
+ | `nw-center-text` | Centers the text too. |
34
+ | `nw-center-intrinsic`, `nw-center-xy` | Centers the children as a column; centers them in both axes. |
35
+ | `--nw-center-max` | The block's measure. |
@@ -0,0 +1,45 @@
1
+ # .nw-sidenav
2
+
3
+ Part of [Navigation](../families/navigation.md).
4
+
5
+ The sidenav is the vertical navigation of an app shell: sections with labels, links with icons and counts, collapsible groups, a header and a footer.
6
+
7
+ ```html
8
+ <nav class="nw-sidenav" aria-label="Sections">
9
+ <div class="nw-sidenav-header">
10
+ <a class="nw-navbar-brand" href="#nw-sidenav">NIGHT<span class="nw-navbar-brand-mark">WIRE</span></a>
11
+ </div>
12
+ <div class="nw-sidenav-section">
13
+ <span class="nw-sidenav-label">Monitor</span>
14
+ <ul class="nw-sidenav-list">
15
+ <li><a class="nw-sidenav-link" href="#nw-sidenav" aria-current="page"><span class="nw-sidenav-icon" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M3 12h4l3-8 4 16 3-8h4"/></svg></span><span class="nw-sidenav-text">Overview</span></a></li>
16
+ <li><a class="nw-sidenav-link" href="#nw-sidenav"><span class="nw-sidenav-icon" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></svg></span><span class="nw-sidenav-text">Relays</span><span class="nw-sidenav-badge nw-badge-sm">12</span></a></li>
17
+ <li>
18
+ <a class="nw-sidenav-link" href="#nw-sidenav" aria-expanded="false" data-toggle="#sidenav-sub-demo"><span class="nw-sidenav-text">Regions</span></a>
19
+ <ul class="nw-sidenav-sub" id="sidenav-sub-demo" data-state="closed">
20
+ <li><a class="nw-sidenav-link" href="#nw-sidenav"><span class="nw-sidenav-text">eu-north</span></a></li>
21
+ <li><a class="nw-sidenav-link" href="#nw-sidenav"><span class="nw-sidenav-text">us-east</span></a></li>
22
+ </ul>
23
+ </li>
24
+ </ul>
25
+ </div>
26
+ <div class="nw-sidenav-footer">v2.4.0</div>
27
+ </nav>
28
+ ```
29
+
30
+ | Class / selector | Effect |
31
+ | ------------------------------------------------- | ---------------------------------------------------------------------------------------- |
32
+ | `nw-sidenav` | The panel: a stack with a hairline when bordered or solid. |
33
+ | `nw-sidenav-header`, `-footer` | The top and bottom rows. |
34
+ | `nw-sidenav-section`, `nw-sidenav-label` | A titled group of links. |
35
+ | `nw-sidenav-list` | A list of links; its margins collapse. |
36
+ | `nw-sidenav-link` | A link row: icon, text and badge. |
37
+ | `nw-sidenav-icon`, `-text`, `-badge` | The slots; the badge is a `nw-badge`. |
38
+ | `nw-sidenav-sub` | The indented sub list behind a hairline, shown unless `hidden` or `data-state="closed"`. |
39
+ | `[aria-expanded]` on a link | A collapsible group trigger; the chevron turns on `aria-expanded="true"`. |
40
+ | `nw-sidenav-solid` | The current link is a filled, glowing block. |
41
+ | `nw-sidenav-collapsed` | An icon rail: the text and badges stay in the accessibility tree. |
42
+ | `nw-sidenav-flush`, `-sticky`, `-end` | No padding; sticks to the viewport; flips to the inline-end side. |
43
+ | `nw-sidenav-xs` ... `-lg` | Row sizes. |
44
+ | `nw-sidenav-primary` ... `-danger` | The current link's ink. |
45
+ | `[aria-current="page"]`, `nw-sidenav-link-active` | The current link. |
@@ -0,0 +1,36 @@
1
+ # .nw-skeleton
2
+
3
+ Part of [Feedback](../families/feedback.md).
4
+
5
+ A skeleton reserves the shape of content that has not arrived yet. Text lines stack, and the last line of a group is shorter so the block reads as a paragraph.
6
+
7
+ ```html
8
+ <div class="nw-card" aria-busy="true" aria-label="Loading relay">
9
+ <div class="nw-cluster">
10
+ <span class="nw-skeleton nw-skeleton-circle" style="--_size: var(--nw-space-12)"></span>
11
+ <div class="nw-stack nw-stack-sm" style="flex: 1">
12
+ <span class="nw-skeleton nw-skeleton-text"></span>
13
+ <span class="nw-skeleton nw-skeleton-text"></span>
14
+ </div>
15
+ </div>
16
+ <div class="nw-skeleton nw-skeleton-rect"></div>
17
+ </div>
18
+ <div class="nw-stack">
19
+ <div class="nw-skeleton nw-skeleton-rect nw-skeleton-cut nw-skeleton-neon"></div>
20
+ <span class="nw-skeleton nw-skeleton-text nw-skeleton-pulse"></span>
21
+ <span class="nw-skeleton nw-skeleton-text nw-skeleton-static nw-skeleton-secondary"></span>
22
+ <p>Inline: the relay is <span class="nw-skeleton nw-skeleton-inline" style="--_w: 6ch"></span> ms away.</p>
23
+ </div>
24
+ ```
25
+
26
+ | Class / property | Effect |
27
+ | ------------------------------------------------- | --------------------------------------------------------------------------------------------- |
28
+ | `nw-skeleton` | The placeholder block with a shimmer. |
29
+ | `nw-skeleton-text`, `-circle`, `-rect`, `-inline` | A text line, an avatar circle (`--_size`), a media block, or a placeholder inside a sentence. |
30
+ | `nw-skeleton-cut` | A chamfered placeholder for cut-corner cards. |
31
+ | `nw-skeleton-xs` ... `-lg` | Default block heights. |
32
+ | `nw-skeleton-primary` ... `-danger` | A tinted placeholder for intent-tinted panels. |
33
+ | `nw-skeleton-static`, `-pulse`, `-neon` | No shimmer, a fade of the whole block, or a primary-tinted sheen. |
34
+ | `--_w`, `--_h`, `--_size` | Override the width, the height, or the circle's size. |
35
+
36
+ Under reduced motion every skeleton is a static block. Hide skeletons from assistive technology and mark the region that is loading with `aria-busy="true"`.