nitro_kit 2.0.0.alpha.3 → 2.0.0.alpha.4

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 (96) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +179 -0
  3. data/README.md +22 -26
  4. data/STYLE_GUIDE.md +10 -0
  5. data/app/assets/stylesheets/nitro_kit-tailwind-v4.css +3 -3
  6. data/app/assets/stylesheets/nitro_kit.css +1220 -572
  7. data/app/components/nitro_kit/accordion.rb +1 -19
  8. data/app/components/nitro_kit/alert.rb +1 -11
  9. data/app/components/nitro_kit/app_navigation.rb +44 -9
  10. data/app/components/nitro_kit/appearance_picker.rb +10 -1
  11. data/app/components/nitro_kit/badge.rb +13 -4
  12. data/app/components/nitro_kit/combobox.rb +1 -17
  13. data/app/components/nitro_kit/command_palette.rb +1 -0
  14. data/app/components/nitro_kit/dropzone.rb +1 -1
  15. data/app/components/nitro_kit/form_builder.rb +1 -1
  16. data/app/components/nitro_kit/select.rb +1 -14
  17. data/app/components/nitro_kit/tabs.rb +1 -0
  18. data/app/javascript/controllers/nk/command_palette_controller.js +4 -0
  19. data/app/javascript/controllers/nk/tabs_controller.js +13 -1
  20. data/docs/agent_guide.md +63 -138
  21. data/docs/agent_native_spec.md +72 -400
  22. data/docs/browser_support.md +77 -188
  23. data/docs/component_contracts.md +56 -36
  24. data/docs/customization.md +675 -89
  25. data/docs/hotwire.md +61 -99
  26. data/docs/initialization_prompt.md +27 -57
  27. data/docs/migration_1_to_2.md +34 -18
  28. data/docs/patterns/application_foundation.md +45 -121
  29. data/docs/patterns/crud_resource.md +44 -129
  30. data/docs/patterns/destructive_action.md +45 -102
  31. data/docs/patterns/flash_and_toast.md +18 -36
  32. data/docs/patterns/inline_edit.md +21 -44
  33. data/docs/patterns/queryable_collection.md +65 -161
  34. data/docs/patterns/resource_form.md +33 -81
  35. data/docs/rails_conventions.md +38 -78
  36. data/docs/rails_integration.md +96 -474
  37. data/lib/nitro_kit/installation.rb +11 -3
  38. data/lib/nitro_kit/migration_inventory.rb +15 -8
  39. data/lib/nitro_kit/version.rb +1 -1
  40. data/plugins/nitro-kit/skills/nitro-kit-rails/SKILL.md +7 -0
  41. data/plugins/nitro-kit/skills/nitro-kit-ui/SKILL.md +15 -8
  42. data/src/stylesheets/nitro_kit/components/accordion.css +4 -4
  43. data/src/stylesheets/nitro_kit/components/alert.css +20 -29
  44. data/src/stylesheets/nitro_kit/components/app_navigation.css +74 -2
  45. data/src/stylesheets/nitro_kit/components/app_shell.css +3 -3
  46. data/src/stylesheets/nitro_kit/components/appearance_picker.css +20 -8
  47. data/src/stylesheets/nitro_kit/components/auth_shell.css +2 -2
  48. data/src/stylesheets/nitro_kit/components/avatar.css +12 -8
  49. data/src/stylesheets/nitro_kit/components/avatar_stack.css +12 -10
  50. data/src/stylesheets/nitro_kit/components/badge.css +13 -9
  51. data/src/stylesheets/nitro_kit/components/button.css +42 -25
  52. data/src/stylesheets/nitro_kit/components/card.css +2 -2
  53. data/src/stylesheets/nitro_kit/components/checkbox.css +29 -46
  54. data/src/stylesheets/nitro_kit/components/checkbox_group.css +3 -3
  55. data/src/stylesheets/nitro_kit/components/combobox.css +6 -6
  56. data/src/stylesheets/nitro_kit/components/command_palette.css +62 -4
  57. data/src/stylesheets/nitro_kit/components/container.css +6 -6
  58. data/src/stylesheets/nitro_kit/components/control_group.css +9 -9
  59. data/src/stylesheets/nitro_kit/components/danger_zone.css +6 -6
  60. data/src/stylesheets/nitro_kit/components/data_section.css +4 -4
  61. data/src/stylesheets/nitro_kit/components/details_table.css +7 -5
  62. data/src/stylesheets/nitro_kit/components/dialog.css +3 -3
  63. data/src/stylesheets/nitro_kit/components/dropdown.css +7 -7
  64. data/src/stylesheets/nitro_kit/components/dropzone.css +7 -7
  65. data/src/stylesheets/nitro_kit/components/empty_state.css +4 -4
  66. data/src/stylesheets/nitro_kit/components/field.css +2 -2
  67. data/src/stylesheets/nitro_kit/components/fieldset.css +2 -2
  68. data/src/stylesheets/nitro_kit/components/flex.css +1 -1
  69. data/src/stylesheets/nitro_kit/components/grid.css +1 -1
  70. data/src/stylesheets/nitro_kit/components/icon.css +5 -5
  71. data/src/stylesheets/nitro_kit/components/input.css +33 -6
  72. data/src/stylesheets/nitro_kit/components/page_header.css +4 -4
  73. data/src/stylesheets/nitro_kit/components/pagination.css +3 -3
  74. data/src/stylesheets/nitro_kit/components/pagination_bar.css +2 -2
  75. data/src/stylesheets/nitro_kit/components/palette.css +140 -72
  76. data/src/stylesheets/nitro_kit/components/progressive_image.css +1 -1
  77. data/src/stylesheets/nitro_kit/components/radio_button.css +28 -33
  78. data/src/stylesheets/nitro_kit/components/radio_button_group.css +6 -6
  79. data/src/stylesheets/nitro_kit/components/rich_text_area.css +2 -2
  80. data/src/stylesheets/nitro_kit/components/select.css +24 -8
  81. data/src/stylesheets/nitro_kit/components/settings_layout.css +5 -5
  82. data/src/stylesheets/nitro_kit/components/settings_section.css +2 -2
  83. data/src/stylesheets/nitro_kit/components/sheet.css +10 -10
  84. data/src/stylesheets/nitro_kit/components/stat_grid.css +1 -1
  85. data/src/stylesheets/nitro_kit/components/switch.css +34 -40
  86. data/src/stylesheets/nitro_kit/components/table.css +8 -4
  87. data/src/stylesheets/nitro_kit/components/tabs.css +5 -1
  88. data/src/stylesheets/nitro_kit/components/textarea.css +20 -5
  89. data/src/stylesheets/nitro_kit/components/toast.css +11 -58
  90. data/src/stylesheets/nitro_kit/components/toolbar.css +2 -2
  91. data/src/stylesheets/nitro_kit/components/tooltip.css +4 -0
  92. data/src/stylesheets/nitro_kit/components/typeset.css +4 -4
  93. data/src/stylesheets/nitro_kit/reset.css +6 -6
  94. data/src/stylesheets/nitro_kit/tokens.css +497 -74
  95. metadata +1 -2
  96. data/docs/new_app_strategy.md +0 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac13933782cc8434035e1b9e27f836b19dfe96a0f98124b91f2a4d62a4222d7e
4
- data.tar.gz: 3ac6f8709fba0d6b5bffdac9eca6f21db615408303284afbc7ef7dbb7809d8d4
3
+ metadata.gz: f4ea3ffdd5e6404639ac11c27f5eb4798b2d29b0103b360404b964c46ffed908
4
+ data.tar.gz: 5a1141716d12a4e3f30969f9971da1d844d44d057e856bd6ed2d1ea0a99fec2d
5
5
  SHA512:
6
- metadata.gz: 3e7e6d588753fada85d9435dade70583da5322dab94a09a97c125f8847fcef74c99d8ed8654230d839babfb230cc589c73e8de8b60671665f90229a958b1705e
7
- data.tar.gz: c13cc9b6315a6e5e17a34b1bcb9a7d1d8f624abbb3ffc53940a8c3f743c774efb6988dd8cddc36b45224afd44b41d0ccdbb57a0e5eacca07c4731b52cc21fa81
6
+ metadata.gz: 03b102d89337de8a13f54b0e1e52163897f5d215ea1810d979f3fa4d0985b86e03bd8c9702e9aedccf21d9252e3cdfab23ccf6686cf79caa85f7d383c1af65f0
7
+ data.tar.gz: f2a33cc6791355080ff7439e714dd2d7c44f4ce706f36817cb7c1c9f42286323bec458c9238e1adb3bbf6807aae57ffedc40b2fd3b49b523027d7b9aa97a0d95
data/CHANGELOG.md CHANGED
@@ -2,6 +2,185 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 2.0.0.alpha.4
6
+
7
+ ### Added
8
+
9
+ - Add `label_visible: false` to `AppearancePicker`'s segmented presentation:
10
+ the legend hides visually while the fieldset keeps its accessible name,
11
+ and the segmented row now fills its container like every other control,
12
+ with the segments sharing the width equally.
13
+ - Add collapsible `AppNavigation` sections: `section(label:, collapsible:
14
+ true, expanded:)` renders native `details` and `summary` with an owned
15
+ chevron, so groups disclose without JavaScript and open state stays on
16
+ the native `open` attribute. Collapsible sections require a label.
17
+ - Assert the stylesheet conventions as tests. Spacing steps, geometry
18
+ through tokens, the type and shadow scales, themeable opacity, guarded
19
+ motion and hover, the four z-index tiers, and the destructive spellings
20
+ are now nine architecture tests with no allowlist, so a new violation
21
+ fails instead of accumulating. The conventions themselves are documented
22
+ in the style guide: the spacing step set, the z-index tiers, the
23
+ color-mix percentage vocabulary, and the single deliberate easing curve.
24
+ - Add `--nk-icon-size-{xs,sm,md,lg,xl}` and `--nk-avatar-size-{xs,sm,md,lg}`.
25
+ The Icon and Avatar ladders were literals repeated across five files;
26
+ AvatarStack duplicated the entire avatar ladder. Alert's status icon and
27
+ Accordion's chevron now resolve through the icon axis, so an application
28
+ retheming icon sizes moves every owned glyph with them.
29
+ - Document the size vocabularies: one contract table of the six size ramps
30
+ and why each stops where it does, so a caller can predict which sizes a
31
+ component accepts without trying them.
32
+ - Add `--nk-choice-size-{md,lg}` and derive every checkbox and radio
33
+ dimension from them: box, glyph proportions, description indent, and the
34
+ native input sizes. The two sizes are one rule apart, the large radio dot
35
+ finally scales with its control, and both indicators share one guarded
36
+ transition.
37
+ - Add `--nk-control-padding-inline`. Buttons, inputs, selects, and textareas
38
+ share one inline padding instead of two nearby values.
39
+ - Add the full color scales as public tokens: `--nk-{family}-{50..950}` for all
40
+ twenty-two families — the five neutrals slate, gray, zinc, neutral, and stone,
41
+ plus seventeen chromatic hues. Every semantic role and badge color samples
42
+ these scales, so swapping the neutral or the accent means re-pointing roles at
43
+ another family rather than inventing values. Scale values are Nitro's own
44
+ harmonized ramps: smooth lightness, chroma, and hue curves fitted through the
45
+ familiar palette, bounded to an imperceptible perceptual distance per value.
46
+ The customization guide documents every step and ships neutral-swap and
47
+ accent recipes.
48
+ - Add `--nk-white` and `--nk-black`. The surface, foreground, and overlay
49
+ roles that used raw white and black resolve through them, so warm-paper and
50
+ true-black themes are two overrides.
51
+ - Add the public tint palette: `--nk-palette-*` roles for all twenty-two
52
+ badge colors — the five semantic families and the seventeen decorative hues —
53
+ so `Badge`'s colors are themeable like every other part of the system. Each
54
+ resolves to a scale step: the 400 tint with a 700-800 foreground in light and
55
+ the 200 foreground in dark. Semantic families default to the same steps as
56
+ their hue families, so an `info` badge renders exactly like a `blue` badge
57
+ and a `warning` alert is amber in both appearances, until a theme separates
58
+ them.
59
+ - Add the title scale: `--nk-title-{page,section,surface,compact}-{size,weight}`.
60
+ Every owned title and legend resolves through one of four roles instead of
61
+ fifteen components choosing among six sizes and two weights. Fieldset
62
+ legends join the other surface titles at bold, and Alert titles match
63
+ Toast titles, which the shared status palette already made visual twins.
64
+ - Add `--nk-disabled-opacity` and `--nk-shadow-xs`, and resolve every
65
+ disabled control and Button's raised shadow through them. Disabled state
66
+ was four different opacities; Button drew its shadows by hand.
67
+
68
+ ### Breaking changes
69
+
70
+ - Settle the destructive vocabulary on two deliberate spellings. Actions and
71
+ Alert say `destructive`: Button and Dropdown items keep their variant,
72
+ and Alert renames its `:error` variant to `:destructive`. Toast items
73
+ keep `:error`, the announcement spelling, and both resolve to the same
74
+ tint family in the shared palette. Badge and AppNavigation rename their
75
+ `danger` semantic color to `destructive`, and the tokens follow:
76
+ `--nk-color-danger*` becomes `--nk-color-destructive*` and
77
+ `--nk-palette-danger*` becomes `--nk-palette-destructive*`. Form and
78
+ field error semantics are unchanged.
79
+ - Remove `Alert::VARIANT_PALETTE`. Alert variants resolve through the shared
80
+ semantic palette instead of mapping to hue families.
81
+ - Remove `zinc` from `Badge`'s color vocabulary; use `neutral`, which renders
82
+ the same by default and follows an application's neutral theme. A gray badge
83
+ frozen to one gray family had no categorical job the semantic name does not
84
+ do better.
85
+ - Change `Badge`'s default color from `:zinc` to `:neutral`. Both render the
86
+ same way; the semantic name is now the default because it follows an
87
+ application's theme.
88
+
89
+ ### Changed
90
+
91
+ - Quiet the dark-mode borders one step, from `--nk-zinc-700` to
92
+ `--nk-zinc-800`, so dark surfaces read as soft fills instead of outlined
93
+ boxes.
94
+ - Render every owned glyph through the Icon component. Accordion, Select,
95
+ Combobox, and AppNavigation drew their chevrons as hand-approximated SVG
96
+ paths; they now render the real Lucide `chevron-down` at the same sizes,
97
+ so one icon set covers the whole library and the glyphs ride the
98
+ `--nk-icon-size-*` axis.
99
+ - Default Dropzone to the `minimal` presentation: the drop target is the
100
+ only visible affordance, and the native file input stays focusable,
101
+ named, and operable underneath — file selection and keyboard flows are
102
+ unchanged. `presentation: :input` still shows the native control beside
103
+ the drop target.
104
+ - Align the default radius at `--nk-radius-lg` (8px): inputs, selects,
105
+ textareas, the rich text editor, navigation rows, pagination links,
106
+ dropzone, grouped choice frames, and the segmented appearance picker now
107
+ share Button's radius instead of sitting one step smaller. Nested pieces
108
+ are concentric — inner radius is the container's minus its padding — so
109
+ segmented options, dropdown items, combobox options, and command palette
110
+ destinations sit flush inside their containers. Buttons' smaller sizes
111
+ keep their own ramp; badges, tooltips, and chips keep their compact radii.
112
+ - Lower the default control height from 40px to 36px:
113
+ `--nk-control-height-md` is now `2.25rem`, so medium buttons, inputs,
114
+ selects, menu rows, and the choice controls' hit areas tighten together.
115
+ - Meet the 44px touch target on coarse pointers: Button extends an
116
+ invisible tap area to the large control step, so a touch just outside a
117
+ small or default button still lands on it while the rendered size stays
118
+ put, asserted by a touch-emulation hit test.
119
+ - Derive the remaining owned geometry from the token system. Switch is now
120
+ four declared inputs — block heights ride the control ramp, the track is
121
+ the block plus the handle's travel — so density presets finally reach
122
+ switches, and Textarea's minimum height rides `--nk-space`. The
123
+ AppearancePicker control resolves through `--nk-choice-size-md` and the
124
+ Accordion trigger through `--nk-control-height-lg`, the values they
125
+ already rendered. Every dimension was verified pixel-identical.
126
+ - Widen the Select chevron gutter from 36px to 40px. The gutter is now
127
+ derived — inline padding, icon, inline padding — so the chevron sits
128
+ symmetrically instead of at an arbitrary offset.
129
+ - Tighten extra-small Badge inline padding from 5px to 4px, making the
130
+ badge padding ramp an even 4/6/8.
131
+ - Size fixed overlays with `100%` instead of `100vw`. Dropdown menus, the
132
+ combobox listbox, the toast column, and the app shell drawer capped
133
+ themselves against `100vw`, which includes the scrollbar, so classic
134
+ scrollbars pushed them past the visible viewport. Percentages resolve
135
+ against the initial containing block, which excludes it. Tooltip keeps
136
+ `100vw` deliberately and documents why.
137
+ - Finish the logical-property pass: the remaining physical `width`,
138
+ `height`, and `min-/max-` declarations now use their logical forms, so
139
+ every component behaves in vertical writing modes.
140
+ - Dim Table's sort indicator through the color channel instead of a raw
141
+ `opacity`, and guard the remaining control transitions and the
142
+ DetailsTable hover for reduced motion and touch.
143
+ - Dress the AvatarStack overflow chip as one of the heads: the same neutral
144
+ fill as the avatar fallbacks and the same hairline ring, instead of an
145
+ elevated fill with no ring.
146
+ - Read data-entry controls at `--nk-text-base` below the md breakpoint and
147
+ `--nk-text-sm` from md up, so a focused control never zooms the viewport
148
+ on small screens; buttons read `--nk-text-sm` at every width. Select and
149
+ Textarea follow the same rule instead of inheriting the page font.
150
+ - Even the control height ramp: `--nk-control-height-sm` is the 2rem small
151
+ Button already rendered, and Button consumes the token, so the theme
152
+ customizer's density exports reach small buttons instead of being
153
+ silently ignored.
154
+ - Resolve `Badge`, `Alert`, and `Toast::Item` colors from public tokens through
155
+ one shared palette. Badge colors were previously hardcoded in private
156
+ `--_nk-*` variables, which are not a theme API, so badge color was the one
157
+ thing in the library an application could not rebrand.
158
+ - Separate `Badge`'s two color axes. Semantic families follow the
159
+ `--nk-palette-{family}` tint roles and move with an application's brand;
160
+ decorative hues follow the `--nk-palette-{hue}` roles and stay the color they
161
+ name. `red` and `danger` previously resolved to identical CSS and are now
162
+ independently themeable.
163
+
164
+ - Soften the toast shadow from the dialog tier to the floating-element tier,
165
+ matching dropdowns and comboboxes. It carried the strongest shadow in the
166
+ system on a card-radius surface, fitting no rung of the elevation ladder.
167
+
168
+ ### Fixed
169
+
170
+ - Stop Avatar rings from painting through overlapping stack siblings. The
171
+ ring pseudo-element carries a z-index but the avatar root was not a
172
+ stacking context, so in an AvatarStack every ring floated above every
173
+ neighboring avatar's fill and the stack looked translucent. Avatars are
174
+ now isolated, so each one paints atomically and covers the ring beneath
175
+ it.
176
+ - Render an `Alert` and a `Toast::Item` of the same variant identically. Both
177
+ declare the same variant vocabulary but resolved it from different sources, so
178
+ one "success" appeared as two different greens and rethemeing a semantic token
179
+ moved only the toast.
180
+ - Raise the orange badge foreground so it clears WCAG AA against its own tint.
181
+ It rendered at 4.31:1 in light appearance. Every semantic family and hue is
182
+ now asserted at 4.5:1 or better in both appearances.
183
+
5
184
  ## 2.0.0.alpha.3
6
185
 
7
186
  ### Added
data/README.md CHANGED
@@ -4,51 +4,47 @@
4
4
 
5
5
  # Nitro Kit
6
6
 
7
- **Rails front-end for the agent era.**
7
+ **Audience:** Rails developers evaluating or installing Nitro Kit.
8
8
 
9
- Nitro Kit is a gem-owned, agent-native UI system for Ruby on Rails. The `2.0.0.alpha.3` prerelease is a ground-up rebuild under active testing and must not be treated as stable. New documentation and the Nitro Kit Pro alpha catalog are coming next.
9
+ Nitro Kit is a gem-owned Phlex UI system for Rails. The `2.0.0.alpha.4` prerelease
10
+ is under active testing and is not stable.
10
11
 
11
12
  [![RubyGems](https://img.shields.io/gem/v/nitro_kit.svg)](https://rubygems.org/gems/nitro_kit)
12
13
 
13
- ## Installation
14
+ ## Install
14
15
 
15
- Install the prerelease explicitly and keep it pinned while evaluating it.
16
+ Pin the prerelease:
16
17
 
17
18
  ```ruby
18
- gem "nitro_kit", "2.0.0.alpha.3"
19
+ gem "nitro_kit", "2.0.0.alpha.4"
19
20
  ```
20
21
 
21
- Use the released gem and commit `Gemfile` with `Gemfile.lock`. Before upgrading, review the changelog, run `bundle update nitro_kit`, rerun the installer, and test the application.
22
-
23
22
  ```sh
24
23
  bundle install
25
24
  bin/rails generate nitro_kit:install
26
25
  bin/rails nitro_kit:doctor
27
26
  ```
28
27
 
29
- Example migration prompt:
30
-
31
- > Upgrade this Rails app to Nitro Kit `2.0.0.alpha.3`. Run the installer, follow its diagnostics, preserve existing behavior and styling, and use Nitro Kit MCP patterns where helpful. Run tests and summarize changes or unresolved issues.
32
-
33
- Example new application prompt:
34
-
35
- > Build this Rails app with Nitro Kit `2.0.0.alpha.3`. Run the installer, follow the included agent guide, compose gem-owned components, and use Nitro Kit MCP patterns where helpful. Add tests and summarize the result.
28
+ Commit `Gemfile` and `Gemfile.lock`. Before upgrading, review the changelog,
29
+ run `bundle update nitro_kit`, rerun the installer, and test the application.
30
+ Production applications should use a released gem with a committed lockfile.
36
31
 
37
- The [agent guide](docs/agent_guide.md), [Rails integration guide](docs/rails_integration.md), [component contracts](docs/component_contracts.md), and [browser support policy](docs/browser_support.md) are included with the gem.
32
+ Start with:
38
33
 
39
- ## Browser support
34
+ - [Rails integration](docs/rails_integration.md)
35
+ - [Component contracts](docs/component_contracts.md)
36
+ - [Customization](docs/customization.md)
37
+ - [Browser support](docs/browser_support.md)
38
+ - [Nitro Kit 1.x migration](docs/migration_1_to_2.md)
39
+ - [Coding-agent guide](docs/agent_guide.md)
40
40
 
41
- Nitro Kit uses modern web standards while keeping core content and actions
42
- usable for the overwhelming majority of people on maintained browsers. The
43
- practical target is current stable and popular evergreen releases from roughly
44
- the previous two years, with Mobile Safari as a first-class target. Small,
45
- feature-detected fallbacks preserve essential behavior without holding
46
- components to the oldest browser's feature set; visual polish may degrade. See
47
- the [browser support policy](docs/browser_support.md) for the dated browser
48
- matrix and canonical full/reduced/unavailable no-JavaScript classifications.
41
+ Nitro Kit targets maintained evergreen browsers from roughly the previous two
42
+ years, with Mobile Safari as a first-class target. See the
43
+ [browser support policy](docs/browser_support.md) for exact fallback behavior.
49
44
 
50
- Maintaining Nitro Kit 1? Its frozen documentation remains at [v1.nitrokit.dev](https://v1.nitrokit.dev).
45
+ Maintaining Nitro Kit 1? Its frozen documentation remains at
46
+ [v1.nitrokit.dev](https://v1.nitrokit.dev).
51
47
 
52
48
  ## License
53
49
 
54
- Nitro Kit is distributed under the custom [NitroKit License](LICENSE).
50
+ Nitro Kit uses the custom [NitroKit License](LICENSE).
data/STYLE_GUIDE.md CHANGED
@@ -303,6 +303,16 @@ Variants assign private values and generic state consumes them:
303
303
 
304
304
  Never target an unqualified `[data-slot]`. Never use `transition: all`.
305
305
 
306
+ Interaction treatments respond to capability: hover effects sit under `@media (hover: hover)`, and Button extends an invisible touch target to the large control step under `@media (pointer: coarse)`, so taps meet the 44px minimum while the rendered size stays put. Control text keys to the width axis: data-entry controls read `--nk-text-base` below the `md` breakpoint, where a focused control under 16px zooms the viewport, and `--nk-text-sm` from `md` up; buttons read `--nk-text-sm` at every width.
307
+
308
+ Spacing multipliers on `--nk-space` come from the step set `0.5 1 1.5 2 2.5 3 4 5 6 7 8 10 12 16 24`. Panel and overlay maximums are viewport policy and stay literal rem values; everything a component owns rides a token or a step.
309
+
310
+ `z-index` has four tiers and no other values: `1`–`3` layer parts inside one component, `10`–`30` layer application-shell chrome, `50` lifts the floating overlays that are not top-layer elements, and `100` is the system tier for the toast column and the skip link. Native dialogs and popovers rely on the top layer instead of a z-index. An element that carries a z-index inside a component must also make its component a stacking context (`isolation: isolate`), or the index leaks into sibling components.
311
+
312
+ Translucency is mixed in `oklab`, never applied through `opacity`, so dimming cannot cascade into descendants; `opacity` is reserved for `--nk-disabled-opacity` and animating whole overlays. The mixing percentages are a fixed vocabulary: hairline rings and quiet borders mix `10%` of the foreground or black pole, hover washes mix `5%` in light and `15%` of white in dark, inset bevel highlights mix `15–20%` of white, status surfaces tint `12%` in light and `20%` in dark, status borders carry `45%` of their accent, and de-emphasized fills mix `40–65%` toward the surface. A new value in this list is a design decision, not a rounding choice.
313
+
314
+ Motion uses the one easing curve `--nk-ease` in both directions, deliberately: enter and exit stay interruptible and reversible, and a dedicated accelerate/decelerate pair is a future decision to make once, globally, not per component. Durations come from the three `--nk-duration-*` steps, and every transition and animation stands down under `prefers-reduced-motion`.
315
+
306
316
  ## Tokens and themes
307
317
 
308
318
  Public `--nk-*` variables cover themeable decisions: semantic colors, paired foregrounds, typography, spacing, radii, control dimensions, shadows, borders, motion, and content widths.
@@ -19,9 +19,9 @@
19
19
  --color-ring: var(--nk-color-focus);
20
20
  --color-primary: var(--nk-color-primary);
21
21
  --color-primary-foreground: var(--nk-color-primary-foreground);
22
- --color-destructive: var(--nk-color-danger);
23
- --color-destructive-content: var(--nk-color-danger-content);
24
- --color-destructive-foreground: var(--nk-color-danger-foreground);
22
+ --color-destructive: var(--nk-color-destructive);
23
+ --color-destructive-content: var(--nk-color-destructive-content);
24
+ --color-destructive-foreground: var(--nk-color-destructive-foreground);
25
25
 
26
26
  --radius-sm: var(--nk-radius-sm);
27
27
  --radius-md: var(--nk-radius-md);