nitro_kit 2.0.0.alpha.3 → 2.0.0.alpha.5

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 (101) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +194 -0
  3. data/README.md +34 -23
  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 +85 -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 +33 -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 +19 -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/.codex-plugin/plugin.json +4 -4
  41. data/plugins/nitro-kit/skills/nitro-kit-hotwire/SKILL.md +12 -0
  42. data/plugins/nitro-kit/skills/nitro-kit-hotwire/agents/openai.yaml +1 -1
  43. data/plugins/nitro-kit/skills/nitro-kit-rails/SKILL.md +22 -0
  44. data/plugins/nitro-kit/skills/nitro-kit-rails/agents/openai.yaml +1 -1
  45. data/plugins/nitro-kit/skills/nitro-kit-ui/SKILL.md +33 -11
  46. data/plugins/nitro-kit/skills/nitro-kit-ui/agents/openai.yaml +1 -1
  47. data/src/stylesheets/nitro_kit/components/accordion.css +4 -4
  48. data/src/stylesheets/nitro_kit/components/alert.css +20 -29
  49. data/src/stylesheets/nitro_kit/components/app_navigation.css +74 -2
  50. data/src/stylesheets/nitro_kit/components/app_shell.css +3 -3
  51. data/src/stylesheets/nitro_kit/components/appearance_picker.css +20 -8
  52. data/src/stylesheets/nitro_kit/components/auth_shell.css +2 -2
  53. data/src/stylesheets/nitro_kit/components/avatar.css +12 -8
  54. data/src/stylesheets/nitro_kit/components/avatar_stack.css +12 -10
  55. data/src/stylesheets/nitro_kit/components/badge.css +13 -9
  56. data/src/stylesheets/nitro_kit/components/button.css +42 -25
  57. data/src/stylesheets/nitro_kit/components/card.css +2 -2
  58. data/src/stylesheets/nitro_kit/components/checkbox.css +29 -46
  59. data/src/stylesheets/nitro_kit/components/checkbox_group.css +3 -3
  60. data/src/stylesheets/nitro_kit/components/combobox.css +6 -6
  61. data/src/stylesheets/nitro_kit/components/command_palette.css +62 -4
  62. data/src/stylesheets/nitro_kit/components/container.css +6 -6
  63. data/src/stylesheets/nitro_kit/components/control_group.css +9 -9
  64. data/src/stylesheets/nitro_kit/components/danger_zone.css +6 -6
  65. data/src/stylesheets/nitro_kit/components/data_section.css +4 -4
  66. data/src/stylesheets/nitro_kit/components/details_table.css +7 -5
  67. data/src/stylesheets/nitro_kit/components/dialog.css +3 -3
  68. data/src/stylesheets/nitro_kit/components/dropdown.css +7 -7
  69. data/src/stylesheets/nitro_kit/components/dropzone.css +7 -7
  70. data/src/stylesheets/nitro_kit/components/empty_state.css +4 -4
  71. data/src/stylesheets/nitro_kit/components/field.css +2 -2
  72. data/src/stylesheets/nitro_kit/components/fieldset.css +2 -2
  73. data/src/stylesheets/nitro_kit/components/flex.css +1 -1
  74. data/src/stylesheets/nitro_kit/components/grid.css +1 -1
  75. data/src/stylesheets/nitro_kit/components/icon.css +5 -5
  76. data/src/stylesheets/nitro_kit/components/input.css +33 -6
  77. data/src/stylesheets/nitro_kit/components/page_header.css +4 -4
  78. data/src/stylesheets/nitro_kit/components/pagination.css +3 -3
  79. data/src/stylesheets/nitro_kit/components/pagination_bar.css +2 -2
  80. data/src/stylesheets/nitro_kit/components/palette.css +140 -72
  81. data/src/stylesheets/nitro_kit/components/progressive_image.css +1 -1
  82. data/src/stylesheets/nitro_kit/components/radio_button.css +28 -33
  83. data/src/stylesheets/nitro_kit/components/radio_button_group.css +6 -6
  84. data/src/stylesheets/nitro_kit/components/rich_text_area.css +2 -2
  85. data/src/stylesheets/nitro_kit/components/select.css +24 -8
  86. data/src/stylesheets/nitro_kit/components/settings_layout.css +5 -5
  87. data/src/stylesheets/nitro_kit/components/settings_section.css +2 -2
  88. data/src/stylesheets/nitro_kit/components/sheet.css +10 -10
  89. data/src/stylesheets/nitro_kit/components/stat_grid.css +1 -1
  90. data/src/stylesheets/nitro_kit/components/switch.css +34 -40
  91. data/src/stylesheets/nitro_kit/components/table.css +8 -4
  92. data/src/stylesheets/nitro_kit/components/tabs.css +5 -1
  93. data/src/stylesheets/nitro_kit/components/textarea.css +20 -5
  94. data/src/stylesheets/nitro_kit/components/toast.css +11 -58
  95. data/src/stylesheets/nitro_kit/components/toolbar.css +2 -2
  96. data/src/stylesheets/nitro_kit/components/tooltip.css +4 -0
  97. data/src/stylesheets/nitro_kit/components/typeset.css +4 -4
  98. data/src/stylesheets/nitro_kit/reset.css +6 -6
  99. data/src/stylesheets/nitro_kit/tokens.css +497 -74
  100. metadata +1 -2
  101. 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: 2f703b97ad2c84b8c66a306453dd1070554fe7c45f994a36672639af781856ed
4
+ data.tar.gz: 9343dd1db39ec96141f560eeebf0edd873d3b68960a36ffdc0abe413b0b66491
5
5
  SHA512:
6
- metadata.gz: 3e7e6d588753fada85d9435dade70583da5322dab94a09a97c125f8847fcef74c99d8ed8654230d839babfb230cc589c73e8de8b60671665f90229a958b1705e
7
- data.tar.gz: c13cc9b6315a6e5e17a34b1bcb9a7d1d8f624abbb3ffc53940a8c3f743c774efb6988dd8cddc36b45224afd44b41d0ccdbb57a0e5eacca07c4731b52cc21fa81
6
+ metadata.gz: 13e10affc36f849b140ee76f99fb6c7ce4403767d1b2da3a20decb2d15fbcc898bf725b637db7d1f2476c7fd12059e4ffb4449a137309253119de03eb18450a6
7
+ data.tar.gz: 4889ff8fdd803acfb652511c0938247a5edc0e1ead51687c5ed97966bf2493038def6d2d34b91a1b498310d78c62390ab29cee5fce3763393e9aa01f986263e0
data/CHANGELOG.md CHANGED
@@ -2,6 +2,200 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 2.0.0.alpha.5
6
+
7
+ ### Added
8
+
9
+ - Add a copyable product bootstrap prompt that tells coding agents to install
10
+ Nitro Kit before planning an application and to discover optional product
11
+ patterns when catalog tools are available.
12
+
13
+ ### Changed
14
+
15
+ - Teach the installed agent guidance and bundled Codex plugin to search an
16
+ available Nitro Kit catalog by product workflow without making catalog access
17
+ a requirement, and clarify that Nitro Kit Doctor checks integration health
18
+ rather than product completeness.
19
+
20
+ ## 2.0.0.alpha.4
21
+
22
+ ### Added
23
+
24
+ - Add `label_visible: false` to `AppearancePicker`'s segmented presentation:
25
+ the legend hides visually while the fieldset keeps its accessible name,
26
+ and the segmented row now fills its container like every other control,
27
+ with the segments sharing the width equally.
28
+ - Add collapsible `AppNavigation` sections: `section(label:, collapsible:
29
+ true, expanded:)` renders native `details` and `summary` with an owned
30
+ chevron, so groups disclose without JavaScript and open state stays on
31
+ the native `open` attribute. Collapsible sections require a label.
32
+ - Assert the stylesheet conventions as tests. Spacing steps, geometry
33
+ through tokens, the type and shadow scales, themeable opacity, guarded
34
+ motion and hover, the four z-index tiers, and the destructive spellings
35
+ are now nine architecture tests with no allowlist, so a new violation
36
+ fails instead of accumulating. The conventions themselves are documented
37
+ in the style guide: the spacing step set, the z-index tiers, the
38
+ color-mix percentage vocabulary, and the single deliberate easing curve.
39
+ - Add `--nk-icon-size-{xs,sm,md,lg,xl}` and `--nk-avatar-size-{xs,sm,md,lg}`.
40
+ The Icon and Avatar ladders were literals repeated across five files;
41
+ AvatarStack duplicated the entire avatar ladder. Alert's status icon and
42
+ Accordion's chevron now resolve through the icon axis, so an application
43
+ retheming icon sizes moves every owned glyph with them.
44
+ - Document the size vocabularies: one contract table of the six size ramps
45
+ and why each stops where it does, so a caller can predict which sizes a
46
+ component accepts without trying them.
47
+ - Add `--nk-choice-size-{md,lg}` and derive every checkbox and radio
48
+ dimension from them: box, glyph proportions, description indent, and the
49
+ native input sizes. The two sizes are one rule apart, the large radio dot
50
+ finally scales with its control, and both indicators share one guarded
51
+ transition.
52
+ - Add `--nk-control-padding-inline`. Buttons, inputs, selects, and textareas
53
+ share one inline padding instead of two nearby values.
54
+ - Add the full color scales as public tokens: `--nk-{family}-{50..950}` for all
55
+ twenty-two families — the five neutrals slate, gray, zinc, neutral, and stone,
56
+ plus seventeen chromatic hues. Every semantic role and badge color samples
57
+ these scales, so swapping the neutral or the accent means re-pointing roles at
58
+ another family rather than inventing values. Scale values are Nitro's own
59
+ harmonized ramps: smooth lightness, chroma, and hue curves fitted through the
60
+ familiar palette, bounded to an imperceptible perceptual distance per value.
61
+ The customization guide documents every step and ships neutral-swap and
62
+ accent recipes.
63
+ - Add `--nk-white` and `--nk-black`. The surface, foreground, and overlay
64
+ roles that used raw white and black resolve through them, so warm-paper and
65
+ true-black themes are two overrides.
66
+ - Add the public tint palette: `--nk-palette-*` roles for all twenty-two
67
+ badge colors — the five semantic families and the seventeen decorative hues —
68
+ so `Badge`'s colors are themeable like every other part of the system. Each
69
+ resolves to a scale step: the 400 tint with a 700-800 foreground in light and
70
+ the 200 foreground in dark. Semantic families default to the same steps as
71
+ their hue families, so an `info` badge renders exactly like a `blue` badge
72
+ and a `warning` alert is amber in both appearances, until a theme separates
73
+ them.
74
+ - Add the title scale: `--nk-title-{page,section,surface,compact}-{size,weight}`.
75
+ Every owned title and legend resolves through one of four roles instead of
76
+ fifteen components choosing among six sizes and two weights. Fieldset
77
+ legends join the other surface titles at bold, and Alert titles match
78
+ Toast titles, which the shared status palette already made visual twins.
79
+ - Add `--nk-disabled-opacity` and `--nk-shadow-xs`, and resolve every
80
+ disabled control and Button's raised shadow through them. Disabled state
81
+ was four different opacities; Button drew its shadows by hand.
82
+
83
+ ### Breaking changes
84
+
85
+ - Settle the destructive vocabulary on two deliberate spellings. Actions and
86
+ Alert say `destructive`: Button and Dropdown items keep their variant,
87
+ and Alert renames its `:error` variant to `:destructive`. Toast items
88
+ keep `:error`, the announcement spelling, and both resolve to the same
89
+ tint family in the shared palette. Badge and AppNavigation rename their
90
+ `danger` semantic color to `destructive`, and the tokens follow:
91
+ `--nk-color-danger*` becomes `--nk-color-destructive*` and
92
+ `--nk-palette-danger*` becomes `--nk-palette-destructive*`. Form and
93
+ field error semantics are unchanged.
94
+ - Remove `Alert::VARIANT_PALETTE`. Alert variants resolve through the shared
95
+ semantic palette instead of mapping to hue families.
96
+ - Remove `zinc` from `Badge`'s color vocabulary; use `neutral`, which renders
97
+ the same by default and follows an application's neutral theme. A gray badge
98
+ frozen to one gray family had no categorical job the semantic name does not
99
+ do better.
100
+ - Change `Badge`'s default color from `:zinc` to `:neutral`. Both render the
101
+ same way; the semantic name is now the default because it follows an
102
+ application's theme.
103
+
104
+ ### Changed
105
+
106
+ - Quiet the dark-mode borders one step, from `--nk-zinc-700` to
107
+ `--nk-zinc-800`, so dark surfaces read as soft fills instead of outlined
108
+ boxes.
109
+ - Render every owned glyph through the Icon component. Accordion, Select,
110
+ Combobox, and AppNavigation drew their chevrons as hand-approximated SVG
111
+ paths; they now render the real Lucide `chevron-down` at the same sizes,
112
+ so one icon set covers the whole library and the glyphs ride the
113
+ `--nk-icon-size-*` axis.
114
+ - Default Dropzone to the `minimal` presentation: the drop target is the
115
+ only visible affordance, and the native file input stays focusable,
116
+ named, and operable underneath — file selection and keyboard flows are
117
+ unchanged. `presentation: :input` still shows the native control beside
118
+ the drop target.
119
+ - Align the default radius at `--nk-radius-lg` (8px): inputs, selects,
120
+ textareas, the rich text editor, navigation rows, pagination links,
121
+ dropzone, grouped choice frames, and the segmented appearance picker now
122
+ share Button's radius instead of sitting one step smaller. Nested pieces
123
+ are concentric — inner radius is the container's minus its padding — so
124
+ segmented options, dropdown items, combobox options, and command palette
125
+ destinations sit flush inside their containers. Buttons' smaller sizes
126
+ keep their own ramp; badges, tooltips, and chips keep their compact radii.
127
+ - Lower the default control height from 40px to 36px:
128
+ `--nk-control-height-md` is now `2.25rem`, so medium buttons, inputs,
129
+ selects, menu rows, and the choice controls' hit areas tighten together.
130
+ - Meet the 44px touch target on coarse pointers: Button extends an
131
+ invisible tap area to the large control step, so a touch just outside a
132
+ small or default button still lands on it while the rendered size stays
133
+ put, asserted by a touch-emulation hit test.
134
+ - Derive the remaining owned geometry from the token system. Switch is now
135
+ four declared inputs — block heights ride the control ramp, the track is
136
+ the block plus the handle's travel — so density presets finally reach
137
+ switches, and Textarea's minimum height rides `--nk-space`. The
138
+ AppearancePicker control resolves through `--nk-choice-size-md` and the
139
+ Accordion trigger through `--nk-control-height-lg`, the values they
140
+ already rendered. Every dimension was verified pixel-identical.
141
+ - Widen the Select chevron gutter from 36px to 40px. The gutter is now
142
+ derived — inline padding, icon, inline padding — so the chevron sits
143
+ symmetrically instead of at an arbitrary offset.
144
+ - Tighten extra-small Badge inline padding from 5px to 4px, making the
145
+ badge padding ramp an even 4/6/8.
146
+ - Size fixed overlays with `100%` instead of `100vw`. Dropdown menus, the
147
+ combobox listbox, the toast column, and the app shell drawer capped
148
+ themselves against `100vw`, which includes the scrollbar, so classic
149
+ scrollbars pushed them past the visible viewport. Percentages resolve
150
+ against the initial containing block, which excludes it. Tooltip keeps
151
+ `100vw` deliberately and documents why.
152
+ - Finish the logical-property pass: the remaining physical `width`,
153
+ `height`, and `min-/max-` declarations now use their logical forms, so
154
+ every component behaves in vertical writing modes.
155
+ - Dim Table's sort indicator through the color channel instead of a raw
156
+ `opacity`, and guard the remaining control transitions and the
157
+ DetailsTable hover for reduced motion and touch.
158
+ - Dress the AvatarStack overflow chip as one of the heads: the same neutral
159
+ fill as the avatar fallbacks and the same hairline ring, instead of an
160
+ elevated fill with no ring.
161
+ - Read data-entry controls at `--nk-text-base` below the md breakpoint and
162
+ `--nk-text-sm` from md up, so a focused control never zooms the viewport
163
+ on small screens; buttons read `--nk-text-sm` at every width. Select and
164
+ Textarea follow the same rule instead of inheriting the page font.
165
+ - Even the control height ramp: `--nk-control-height-sm` is the 2rem small
166
+ Button already rendered, and Button consumes the token, so the theme
167
+ customizer's density exports reach small buttons instead of being
168
+ silently ignored.
169
+ - Resolve `Badge`, `Alert`, and `Toast::Item` colors from public tokens through
170
+ one shared palette. Badge colors were previously hardcoded in private
171
+ `--_nk-*` variables, which are not a theme API, so badge color was the one
172
+ thing in the library an application could not rebrand.
173
+ - Separate `Badge`'s two color axes. Semantic families follow the
174
+ `--nk-palette-{family}` tint roles and move with an application's brand;
175
+ decorative hues follow the `--nk-palette-{hue}` roles and stay the color they
176
+ name. `red` and `danger` previously resolved to identical CSS and are now
177
+ independently themeable.
178
+
179
+ - Soften the toast shadow from the dialog tier to the floating-element tier,
180
+ matching dropdowns and comboboxes. It carried the strongest shadow in the
181
+ system on a card-radius surface, fitting no rung of the elevation ladder.
182
+
183
+ ### Fixed
184
+
185
+ - Stop Avatar rings from painting through overlapping stack siblings. The
186
+ ring pseudo-element carries a z-index but the avatar root was not a
187
+ stacking context, so in an AvatarStack every ring floated above every
188
+ neighboring avatar's fill and the stack looked translucent. Avatars are
189
+ now isolated, so each one paints atomically and covers the ring beneath
190
+ it.
191
+ - Render an `Alert` and a `Toast::Item` of the same variant identically. Both
192
+ declare the same variant vocabulary but resolved it from different sources, so
193
+ one "success" appeared as two different greens and rethemeing a semantic token
194
+ moved only the toast.
195
+ - Raise the orange badge foreground so it clears WCAG AA against its own tint.
196
+ It rendered at 4.31:1 in light appearance. Every semantic family and hue is
197
+ now asserted at 4.5:1 or better in both appearances.
198
+
5
199
  ## 2.0.0.alpha.3
6
200
 
7
201
  ### Added
data/README.md CHANGED
@@ -4,51 +4,62 @@
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.5` 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.5"
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:
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.
31
+
32
+ Start with:
30
33
 
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.
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)
32
40
 
33
- Example new application prompt:
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.
34
44
 
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.
45
+ ## Prompting a coding agent
36
46
 
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.
47
+ Add this to a product bootstrap prompt so the agent installs Nitro Kit, uses
48
+ its guidance, and discovers optional product patterns when available:
38
49
 
39
- ## Browser support
50
+ ```text
51
+ Add Nitro Kit 2 to this Rails app and use it for the product's application UI.
40
52
 
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.
53
+ Set up Nitro Kit before planning or implementing the product:
54
+ - Add and pin the current Nitro Kit 2 prerelease in the Gemfile, run bundle install, run bin/rails generate nitro_kit:install, and run bin/rails nitro_kit:doctor.
55
+ - Load the generated project-local Nitro Kit skills and installed, version-matched docs.
56
+ - Check whether Nitro Kit catalog or MCP tools are available. If they are, inventory and search them by product workflow, retrieve relevant patterns, and state what you will use, adapt, or defer.
57
+ - If no catalog is available, continue with the bundled docs and component contracts; catalog access is optional.
58
+ ```
49
59
 
50
- Maintaining Nitro Kit 1? Its frozen documentation remains at [v1.nitrokit.dev](https://v1.nitrokit.dev).
60
+ Maintaining Nitro Kit 1? Its frozen documentation remains at
61
+ [v1.nitrokit.dev](https://v1.nitrokit.dev).
51
62
 
52
63
  ## License
53
64
 
54
- Nitro Kit is distributed under the custom [NitroKit License](LICENSE).
65
+ 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);