nitro_kit 2.0.0.alpha.2 → 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 (138) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +229 -1
  3. data/README.md +25 -10
  4. data/STYLE_GUIDE.md +47 -5
  5. data/app/assets/stylesheets/nitro_kit-tailwind-v4.css +3 -3
  6. data/app/assets/stylesheets/nitro_kit.css +2820 -1816
  7. data/app/components/nitro_kit/accordion.rb +2 -26
  8. data/app/components/nitro_kit/alert.rb +1 -11
  9. data/app/components/nitro_kit/app_navigation.rb +45 -11
  10. data/app/components/nitro_kit/app_shell.rb +1 -7
  11. data/app/components/nitro_kit/appearance_picker.rb +11 -12
  12. data/app/components/nitro_kit/avatar.rb +6 -1
  13. data/app/components/nitro_kit/avatar_stack.rb +3 -0
  14. data/app/components/nitro_kit/badge.rb +13 -4
  15. data/app/components/nitro_kit/button_group.rb +2 -2
  16. data/app/components/nitro_kit/checkbox.rb +7 -4
  17. data/app/components/nitro_kit/checkbox_group.rb +0 -25
  18. data/app/components/nitro_kit/combobox.rb +4 -33
  19. data/app/components/nitro_kit/command_palette.rb +42 -59
  20. data/app/components/nitro_kit/component.rb +57 -5
  21. data/app/components/nitro_kit/danger_zone.rb +5 -1
  22. data/app/components/nitro_kit/data_section.rb +28 -4
  23. data/app/components/nitro_kit/details_table.rb +19 -8
  24. data/app/components/nitro_kit/dialog.rb +23 -19
  25. data/app/components/nitro_kit/dropdown.rb +1 -6
  26. data/app/components/nitro_kit/dropzone.rb +4 -15
  27. data/app/components/nitro_kit/empty_state.rb +21 -2
  28. data/app/components/nitro_kit/field.rb +35 -11
  29. data/app/components/nitro_kit/form_builder.rb +1 -2
  30. data/app/components/nitro_kit/progressive_image.rb +2 -2
  31. data/app/components/nitro_kit/radio_button.rb +7 -4
  32. data/app/components/nitro_kit/radio_button_group.rb +0 -25
  33. data/app/components/nitro_kit/select.rb +4 -17
  34. data/app/components/nitro_kit/settings_layout.rb +17 -4
  35. data/app/components/nitro_kit/{form_section.rb → settings_section.rb} +18 -11
  36. data/app/components/nitro_kit/sheet.rb +29 -20
  37. data/app/components/nitro_kit/stat_grid.rb +18 -2
  38. data/app/components/nitro_kit/table.rb +22 -3
  39. data/app/components/nitro_kit/tabs.rb +2 -13
  40. data/app/components/nitro_kit/toast.rb +4 -2
  41. data/app/components/nitro_kit/toolbar.rb +2 -0
  42. data/app/components/nitro_kit/tooltip.rb +7 -10
  43. data/app/javascript/controllers/nk/app_shell_controller.js +3 -3
  44. data/app/javascript/controllers/nk/appearance_controller.js +6 -0
  45. data/app/javascript/controllers/nk/combobox_controller.js +51 -1
  46. data/app/javascript/controllers/nk/command_palette_controller.js +25 -11
  47. data/app/javascript/controllers/nk/dialog_controller.js +54 -0
  48. data/app/javascript/controllers/nk/dropdown_controller.js +45 -0
  49. data/app/javascript/controllers/nk/dropzone_controller.js +2 -2
  50. data/app/javascript/controllers/nk/progressive_image_controller.js +11 -7
  51. data/app/javascript/controllers/nk/tabs_controller.js +21 -2
  52. data/app/javascript/controllers/nk/tooltip_controller.js +9 -0
  53. data/config/locales/en.yml +4 -1
  54. data/docs/agent_guide.md +63 -123
  55. data/docs/agent_native_spec.md +72 -383
  56. data/docs/browser_support.md +82 -0
  57. data/docs/component_contracts.md +108 -82
  58. data/docs/customization.md +689 -91
  59. data/docs/hotwire.md +50 -76
  60. data/docs/initialization_prompt.md +26 -31
  61. data/docs/migration_1_to_2.md +88 -30
  62. data/docs/patterns/application_foundation.md +45 -119
  63. data/docs/patterns/crud_resource.md +44 -126
  64. data/docs/patterns/destructive_action.md +45 -77
  65. data/docs/patterns/flash_and_toast.md +18 -36
  66. data/docs/patterns/inline_edit.md +21 -44
  67. data/docs/patterns/queryable_collection.md +65 -161
  68. data/docs/patterns/resource_form.md +33 -81
  69. data/docs/rails_conventions.md +38 -75
  70. data/docs/rails_integration.md +96 -446
  71. data/lib/generators/nitro_kit/upgrade_smoke_tests_generator.rb +12 -0
  72. data/lib/nitro_kit/installation.rb +20 -7
  73. data/lib/nitro_kit/migration_inventory.rb +275 -8
  74. data/lib/nitro_kit/upgrade_smoke_test.rb +10 -12
  75. data/lib/nitro_kit/version.rb +1 -1
  76. data/lib/rails/commands/nitro_kit/nitro_kit_command.rb +10 -3
  77. data/plugins/nitro-kit/skills/nitro-kit-hotwire/SKILL.md +4 -0
  78. data/plugins/nitro-kit/skills/nitro-kit-rails/SKILL.md +13 -1
  79. data/plugins/nitro-kit/skills/nitro-kit-ui/SKILL.md +32 -15
  80. data/src/stylesheets/nitro_kit/components/accordion.css +44 -44
  81. data/src/stylesheets/nitro_kit/components/alert.css +27 -36
  82. data/src/stylesheets/nitro_kit/components/app_navigation.css +92 -20
  83. data/src/stylesheets/nitro_kit/components/app_shell.css +199 -196
  84. data/src/stylesheets/nitro_kit/components/appearance_picker.css +61 -39
  85. data/src/stylesheets/nitro_kit/components/auth_shell.css +2 -2
  86. data/src/stylesheets/nitro_kit/components/avatar.css +15 -11
  87. data/src/stylesheets/nitro_kit/components/avatar_stack.css +48 -29
  88. data/src/stylesheets/nitro_kit/components/badge.css +13 -9
  89. data/src/stylesheets/nitro_kit/components/button.css +121 -79
  90. data/src/stylesheets/nitro_kit/components/button_group.css +19 -14
  91. data/src/stylesheets/nitro_kit/components/card.css +12 -6
  92. data/src/stylesheets/nitro_kit/components/checkbox.css +54 -67
  93. data/src/stylesheets/nitro_kit/components/checkbox_group.css +16 -16
  94. data/src/stylesheets/nitro_kit/components/combobox.css +39 -29
  95. data/src/stylesheets/nitro_kit/components/command_palette.css +110 -51
  96. data/src/stylesheets/nitro_kit/components/container.css +6 -6
  97. data/src/stylesheets/nitro_kit/components/control_group.css +61 -67
  98. data/src/stylesheets/nitro_kit/components/danger_zone.css +8 -8
  99. data/src/stylesheets/nitro_kit/components/data_section.css +4 -4
  100. data/src/stylesheets/nitro_kit/components/details_table.css +17 -15
  101. data/src/stylesheets/nitro_kit/components/dialog.css +8 -5
  102. data/src/stylesheets/nitro_kit/components/dropdown.css +36 -30
  103. data/src/stylesheets/nitro_kit/components/dropzone.css +78 -35
  104. data/src/stylesheets/nitro_kit/components/empty_state.css +7 -7
  105. data/src/stylesheets/nitro_kit/components/field.css +32 -28
  106. data/src/stylesheets/nitro_kit/components/field_group.css +13 -0
  107. data/src/stylesheets/nitro_kit/components/fieldset.css +8 -2
  108. data/src/stylesheets/nitro_kit/components/flex.css +1 -1
  109. data/src/stylesheets/nitro_kit/components/grid.css +1 -1
  110. data/src/stylesheets/nitro_kit/components/icon.css +5 -5
  111. data/src/stylesheets/nitro_kit/components/input.css +42 -8
  112. data/src/stylesheets/nitro_kit/components/layout.css +165 -165
  113. data/src/stylesheets/nitro_kit/components/page_header.css +7 -7
  114. data/src/stylesheets/nitro_kit/components/pagination.css +58 -49
  115. data/src/stylesheets/nitro_kit/components/pagination_bar.css +9 -9
  116. data/src/stylesheets/nitro_kit/components/palette.css +145 -77
  117. data/src/stylesheets/nitro_kit/components/progressive_image.css +45 -55
  118. data/src/stylesheets/nitro_kit/components/radio_button.css +48 -46
  119. data/src/stylesheets/nitro_kit/components/radio_button_group.css +49 -49
  120. data/src/stylesheets/nitro_kit/components/rich_text_area.css +16 -1
  121. data/src/stylesheets/nitro_kit/components/select.css +24 -15
  122. data/src/stylesheets/nitro_kit/components/settings_layout.css +26 -23
  123. data/src/stylesheets/nitro_kit/components/settings_section.css +84 -0
  124. data/src/stylesheets/nitro_kit/components/sheet.css +30 -10
  125. data/src/stylesheets/nitro_kit/components/stat_grid.css +11 -10
  126. data/src/stylesheets/nitro_kit/components/switch.css +60 -62
  127. data/src/stylesheets/nitro_kit/components/table.css +43 -35
  128. data/src/stylesheets/nitro_kit/components/tabs.css +48 -40
  129. data/src/stylesheets/nitro_kit/components/textarea.css +20 -5
  130. data/src/stylesheets/nitro_kit/components/toast.css +11 -47
  131. data/src/stylesheets/nitro_kit/components/toolbar.css +16 -41
  132. data/src/stylesheets/nitro_kit/components/tooltip.css +38 -29
  133. data/src/stylesheets/nitro_kit/components/typeset.css +150 -4
  134. data/src/stylesheets/nitro_kit/reset.css +15 -15
  135. data/src/stylesheets/nitro_kit/tokens.css +501 -79
  136. metadata +4 -4
  137. data/docs/new_app_strategy.md +0 -22
  138. data/src/stylesheets/nitro_kit/components/form_section.css +0 -71
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2cfb9e904d8890216a6c778b5dd10655e22f77fa7508fd4d9eb9521453b61cd8
4
- data.tar.gz: 3c9564fa27b68e1a10c1febe8b7104416251a5203b1bd25aa89b1617cab1e116
3
+ metadata.gz: f4ea3ffdd5e6404639ac11c27f5eb4798b2d29b0103b360404b964c46ffed908
4
+ data.tar.gz: 5a1141716d12a4e3f30969f9971da1d844d44d057e856bd6ed2d1ea0a99fec2d
5
5
  SHA512:
6
- metadata.gz: de02c676e41ea2cb0d674de967efa9c73aa8d6f65195af0bfae0ce35e305dc9fb5e53979659e5feed738cf0fdc4e968902931be726a5d1bd67f22a400ce3c0b2
7
- data.tar.gz: 2ffdd83fe0f4005c5146a3d9e4fa13e7ce8a6b6d84d0a7e881aace598a6ff938836b20c15f29bde5f9d72e9bed8ef2e4a6b8a083add6986a0acdacb653221a4e
6
+ metadata.gz: 03b102d89337de8a13f54b0e1e52163897f5d215ea1810d979f3fa4d0985b86e03bd8c9702e9aedccf21d9252e3cdfab23ccf6686cf79caa85f7d383c1af65f0
7
+ data.tar.gz: f2a33cc6791355080ff7439e714dd2d7c44f4ce706f36817cb7c1c9f42286323bec458c9238e1adb3bbf6807aae57ffedc40b2fd3b49b523027d7b9aa97a0d95
data/CHANGELOG.md CHANGED
@@ -1,5 +1,233 @@
1
1
  # Changelog
2
2
 
3
+ ## Unreleased
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
+
184
+ ## 2.0.0.alpha.3
185
+
186
+ ### Added
187
+
188
+ - Add a dated browser verification matrix with full Chrome coverage, focused
189
+ Firefox and macOS Safari lanes, and explicit Android, iOS, and near-floor
190
+ release checks.
191
+ - Add `--nk-button-radius` so applications can preserve a button-specific shape without changing inputs and surfaces.
192
+ - Add structured JSON output to `nitro_kit:doctor` for migration automation.
193
+
194
+ ### Changed
195
+
196
+ - Accept Rails-style nested and conditional class values through `desperately_need_a_class:`, normalizing retained external-integration hooks without manual string formatting, while directing migrations to review every use and aim for zero.
197
+ - Make migration diagnostics surface usages of application-owned button treatments and provable 2.0 Table/Button runtime contract errors, and require semantic theme translation plus wide and narrow browser comparison.
198
+ - Recognize explicit Stimulus controller registration used by JavaScript bundlers.
199
+ - Explain the purpose and limits of generated host-integration smoke tests in each generated file.
200
+
201
+ ### Documentation
202
+
203
+ - Define the rolling evergreen browser-support policy, with Mobile Safari as a
204
+ first-class target and standards-first, feature-detected fallbacks for core
205
+ behavior.
206
+ - Classify every interactive component's no-JavaScript baseline as full,
207
+ reduced, or unavailable.
208
+ - Document native month and week inputs as progressive enhancement, including
209
+ server-side ISO validation and bounded Select guidance.
210
+ - Document Accordion's reduced single-group behavior where named details are
211
+ unavailable instead of adding a compatibility controller.
212
+
213
+ ### Fixed
214
+
215
+ - Keep Dialog, Sheet, and CommandPalette controls working when Invoker Commands
216
+ are unavailable while preserving the native declarative path and consistent
217
+ focus restoration in Safari.
218
+ - Stack AppShell toolbar actions below the title on narrow screens instead of
219
+ clipping child-route titles when a Back affordance and several actions share
220
+ the header.
221
+ - Restore Dropdown outside-tap dismissal on affected Mobile Safari Popover
222
+ implementations and keep its reduced placement inside the viewport.
223
+ - Provide readable Typeset styling in Firefox versions without CSS `@scope`.
224
+ - Keep settled progressive images visible when Turbo restores a cached page.
225
+ - Keep arbitrary multi-element Button content aligned inside the label slot.
226
+ - Keep the command palette at a stable height while filtering destinations.
227
+ - Use a neutral elevated surface instead of the primary accent for tooltips.
228
+ - Resolve implicit FormBuilder labels only when rendered, so custom field blocks work under strict i18n.
229
+ - Allow generated upgrade smoke tests to coexist with host catch-all routes while still rejecting exact route collisions.
230
+
3
231
  ## 2.0.0.alpha.2
4
232
 
5
233
  This alpha keeps the 2.0 API experimental while incorporating the first full
@@ -73,7 +301,7 @@ Nitro Kit 2.0 alpha is a ground-up, intentionally incompatible rebuild around ge
73
301
  - Static zero-specificity CSS, light and dark theme tokens with a no-JavaScript system fallback, and a separate Tailwind CSS v4 adapter.
74
302
  - Responsive Flex and Grid layouts with fixed mobile-first breakpoints, closed values, classless data contracts, and no Tailwind runtime; plus the constrained-width Container.
75
303
  - Sortable `Table` headers with caller-owned URLs, native `aria-sort`, and an optional Ransack gallery recipe.
76
- - Eleven blocks and shells: AuthShell, AppShell, SettingsLayout, Toolbar, PaginationBar, PageHeader, StatGrid, DataSection, FormSection, DangerZone, and EmptyState.
304
+ - Eleven blocks and shells: AuthShell, AppShell, SettingsLayout, Toolbar, PaginationBar, PageHeader, StatGrid, DataSection, SettingsSection, DangerZone, and EmptyState.
77
305
  - AppNavigation, AppearancePicker, DetailsTable, Dropzone, and ProgressiveImage components, plus the non-visual AppearanceBootstrap runtime.
78
306
  - Typed Choice values and direct-Phlex Rails FormBuilder integration with Active Model errors, native and direct uploads, and Turbo Frame/Stream examples.
79
307
  - Direct optional Pagy integration through `Pagination(pagy:)`, with an explicit URL callable for caller-owned destinations.
data/README.md CHANGED
@@ -4,32 +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.2` 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 alpha 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.2"
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
- The [agent guide](docs/agent_guide.md), [Rails integration guide](docs/rails_integration.md), and [component contracts](docs/component_contracts.md) are included with the gem.
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:
33
+
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
+
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.
30
44
 
31
- 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).
32
47
 
33
48
  ## License
34
49
 
35
- Nitro Kit is distributed under the custom [NitroKit License](LICENSE).
50
+ Nitro Kit uses the custom [NitroKit License](LICENSE).
data/STYLE_GUIDE.md CHANGED
@@ -32,6 +32,35 @@ render immediately and only work from a Phlex context; they do not work in ERB.
32
32
  - Let applications customize themes and compose product-specific UI without editing Nitro internals.
33
33
  - Keep behavior minimal, progressive, and Turbo-safe.
34
34
 
35
+ ## Browser compatibility
36
+
37
+ The public compatibility contract lives in
38
+ [`docs/browser_support.md`](docs/browser_support.md). Use modern standards while
39
+ keeping essential behavior usable for the overwhelming majority of people on
40
+ maintained browsers. The practical target is current stable and popular
41
+ evergreen Chrome, Edge, Firefox, macOS Safari, and iOS Safari releases from
42
+ roughly the previous two years. Treat Mobile Safari as a primary browser. The
43
+ dated release matrix sets the actual floor by release date and usage, not equal
44
+ major-version counts.
45
+
46
+ Prefer approved native standards even when their support is newer than the
47
+ window, but do not confuse standards adoption with baseline availability.
48
+ Feature-detect the preferred path and add the smallest Nitro-owned fallback
49
+ when its absence breaks core content, navigation, submission, disclosure, or
50
+ overlay operation. A simpler layout, placement, wrapping, or animation is an
51
+ acceptable fallback. Copying controllers into applications, requiring every
52
+ consumer to choose a polyfill, or silently leaving a control inert is not.
53
+
54
+ Record no-JavaScript behavior per interactive component. Test the native and
55
+ fallback paths, Turbo cache and reconnect lifecycles, keyboard behavior, and a
56
+ representative browser near the support-window floor. Chromium emulation alone
57
+ does not establish Safari or iOS compatibility.
58
+
59
+ Place a broadly supported CSS declaration before a newer visual enhancement,
60
+ or use a feature query when unsupported syntax would invalidate layout, color,
61
+ contrast, focus visibility, or interaction. Unsupported polish may disappear;
62
+ readability and operability may not.
63
+
35
64
  ## File layout
36
65
 
37
66
  ```text
@@ -206,7 +235,7 @@ component translates each string the controller needs and emits it through the
206
235
  Stimulus values API:
207
236
 
208
237
  ```html
209
- <div data-nk--dropzone-queued-value="Queued">
238
+ <div data-nk--dropzone-queued-value="Queued"></div>
210
239
  ```
211
240
 
212
241
  The controller reads the value and keeps the shipped English literal only as an
@@ -219,10 +248,13 @@ a translator sees one grammar in both languages.
219
248
  Nitro components never emit or depend on classes. The only exception is:
220
249
 
221
250
  ```ruby
222
- desperately_need_a_class: "external-widget-hook"
251
+ desperately_need_a_class: [
252
+ "external-widget-hook",
253
+ { "is-active": active? }
254
+ ]
223
255
  ```
224
256
 
225
- It must produce both the class and `data-nk-escape="class"`. Blank or non-string values raise. Implement this once in the base component.
257
+ It accepts Rails `class_names` values—strings, symbols, nested arrays, and conditional hashes—and normalizes them into a deduplicated string. It must contain at least one class and produce both the class and `data-nk-escape="class"`. Implement this once in the base component. Tailwind applications may run a Tailwind-aware merger before passing classes when conflicting utilities need resolution; Nitro does not require one.
226
258
 
227
259
  ## CSS architecture
228
260
 
@@ -271,11 +303,21 @@ Variants assign private values and generic state consumes them:
271
303
 
272
304
  Never target an unqualified `[data-slot]`. Never use `transition: all`.
273
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
+
274
316
  ## Tokens and themes
275
317
 
276
318
  Public `--nk-*` variables cover themeable decisions: semantic colors, paired foregrounds, typography, spacing, radii, control dimensions, shadows, borders, motion, and content widths.
277
319
 
278
- Buttons and data-entry controls share control heights, radii, border geometry, focus treatment, and disabled treatment, but they do not share one surface role. Inputs, selects, textareas, and unchecked controls use the general surface tokens. The raised default Button uses the public `--nk-button-default-background`, `--nk-button-default-hover-background`, `--nk-button-default-foreground`, and `--nk-button-default-border` tokens. Button-like controls such as the native file selector may consume the same treatment; do not make ordinary data-entry surfaces depend on it.
320
+ Buttons and data-entry controls share control heights, the default radius scale, border geometry, focus treatment, and disabled treatment, but they do not share one surface role. `--nk-button-radius` may override only Button shape when an application deliberately distinguishes buttons from inputs and surfaces. Inputs, selects, textareas, and unchecked controls use the general surface tokens. The raised default Button uses the public `--nk-button-default-background`, `--nk-button-default-hover-background`, `--nk-button-default-foreground`, and `--nk-button-default-border` tokens. Button-like controls such as the native file selector may consume the same treatment; do not make ordinary data-entry surfaces depend on it.
279
321
 
280
322
  Private `--_nk-*` variables coordinate component mechanics and are not a theme API.
281
323
 
@@ -370,7 +412,7 @@ Do not add mandatory Dropzone.js, Ransack, or image-processing dependencies to N
370
412
 
371
413
  Native HTML and CSS own behavior when they already provide the required semantics. Stimulus adds the smallest missing enhancement.
372
414
 
373
- - Use `details`/`summary` for disclosure, declarative `command`/`commandfor` for dialogs, native Popover for dropdown visibility, and CSS hover/focus for tooltips.
415
+ - Prefer `details`/`summary` for disclosure, declarative `command`/`commandfor` for dialogs, native Popover for dropdown visibility, and CSS hover/focus for tooltips. Before making one authoritative, verify that it covers `docs/browser_support.md` or pair it with the smallest capability-detected fallback.
374
416
  - Do not mirror browser-owned open state into `data-state`, `aria-expanded`, or hidden attributes. Use targets and values only for state Nitro genuinely owns.
375
417
  - The exception is state HTML cannot express as an attribute at all. A checkbox's `indeterminate` is a DOM property with no markup form, so `Checkbox` mounts `nk--checkable` only when `indeterminate: true`, and that controller's whole scope is applying the property and owning the matching `data-state="indeterminate"`. Ordinary checked state stays native, with no controller and no mirrored `data-state`. Do not widen a controller past the one state the browser cannot express.
376
418
  - Keep native state selectors such as `[open]` and `:popover-open` authoritative in CSS.
@@ -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);