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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +179 -0
- data/README.md +22 -26
- data/STYLE_GUIDE.md +10 -0
- data/app/assets/stylesheets/nitro_kit-tailwind-v4.css +3 -3
- data/app/assets/stylesheets/nitro_kit.css +1220 -572
- data/app/components/nitro_kit/accordion.rb +1 -19
- data/app/components/nitro_kit/alert.rb +1 -11
- data/app/components/nitro_kit/app_navigation.rb +44 -9
- data/app/components/nitro_kit/appearance_picker.rb +10 -1
- data/app/components/nitro_kit/badge.rb +13 -4
- data/app/components/nitro_kit/combobox.rb +1 -17
- data/app/components/nitro_kit/command_palette.rb +1 -0
- data/app/components/nitro_kit/dropzone.rb +1 -1
- data/app/components/nitro_kit/form_builder.rb +1 -1
- data/app/components/nitro_kit/select.rb +1 -14
- data/app/components/nitro_kit/tabs.rb +1 -0
- data/app/javascript/controllers/nk/command_palette_controller.js +4 -0
- data/app/javascript/controllers/nk/tabs_controller.js +13 -1
- data/docs/agent_guide.md +63 -138
- data/docs/agent_native_spec.md +72 -400
- data/docs/browser_support.md +77 -188
- data/docs/component_contracts.md +56 -36
- data/docs/customization.md +675 -89
- data/docs/hotwire.md +61 -99
- data/docs/initialization_prompt.md +27 -57
- data/docs/migration_1_to_2.md +34 -18
- data/docs/patterns/application_foundation.md +45 -121
- data/docs/patterns/crud_resource.md +44 -129
- data/docs/patterns/destructive_action.md +45 -102
- data/docs/patterns/flash_and_toast.md +18 -36
- data/docs/patterns/inline_edit.md +21 -44
- data/docs/patterns/queryable_collection.md +65 -161
- data/docs/patterns/resource_form.md +33 -81
- data/docs/rails_conventions.md +38 -78
- data/docs/rails_integration.md +96 -474
- data/lib/nitro_kit/installation.rb +11 -3
- data/lib/nitro_kit/migration_inventory.rb +15 -8
- data/lib/nitro_kit/version.rb +1 -1
- data/plugins/nitro-kit/skills/nitro-kit-rails/SKILL.md +7 -0
- data/plugins/nitro-kit/skills/nitro-kit-ui/SKILL.md +15 -8
- data/src/stylesheets/nitro_kit/components/accordion.css +4 -4
- data/src/stylesheets/nitro_kit/components/alert.css +20 -29
- data/src/stylesheets/nitro_kit/components/app_navigation.css +74 -2
- data/src/stylesheets/nitro_kit/components/app_shell.css +3 -3
- data/src/stylesheets/nitro_kit/components/appearance_picker.css +20 -8
- data/src/stylesheets/nitro_kit/components/auth_shell.css +2 -2
- data/src/stylesheets/nitro_kit/components/avatar.css +12 -8
- data/src/stylesheets/nitro_kit/components/avatar_stack.css +12 -10
- data/src/stylesheets/nitro_kit/components/badge.css +13 -9
- data/src/stylesheets/nitro_kit/components/button.css +42 -25
- data/src/stylesheets/nitro_kit/components/card.css +2 -2
- data/src/stylesheets/nitro_kit/components/checkbox.css +29 -46
- data/src/stylesheets/nitro_kit/components/checkbox_group.css +3 -3
- data/src/stylesheets/nitro_kit/components/combobox.css +6 -6
- data/src/stylesheets/nitro_kit/components/command_palette.css +62 -4
- data/src/stylesheets/nitro_kit/components/container.css +6 -6
- data/src/stylesheets/nitro_kit/components/control_group.css +9 -9
- data/src/stylesheets/nitro_kit/components/danger_zone.css +6 -6
- data/src/stylesheets/nitro_kit/components/data_section.css +4 -4
- data/src/stylesheets/nitro_kit/components/details_table.css +7 -5
- data/src/stylesheets/nitro_kit/components/dialog.css +3 -3
- data/src/stylesheets/nitro_kit/components/dropdown.css +7 -7
- data/src/stylesheets/nitro_kit/components/dropzone.css +7 -7
- data/src/stylesheets/nitro_kit/components/empty_state.css +4 -4
- data/src/stylesheets/nitro_kit/components/field.css +2 -2
- data/src/stylesheets/nitro_kit/components/fieldset.css +2 -2
- data/src/stylesheets/nitro_kit/components/flex.css +1 -1
- data/src/stylesheets/nitro_kit/components/grid.css +1 -1
- data/src/stylesheets/nitro_kit/components/icon.css +5 -5
- data/src/stylesheets/nitro_kit/components/input.css +33 -6
- data/src/stylesheets/nitro_kit/components/page_header.css +4 -4
- data/src/stylesheets/nitro_kit/components/pagination.css +3 -3
- data/src/stylesheets/nitro_kit/components/pagination_bar.css +2 -2
- data/src/stylesheets/nitro_kit/components/palette.css +140 -72
- data/src/stylesheets/nitro_kit/components/progressive_image.css +1 -1
- data/src/stylesheets/nitro_kit/components/radio_button.css +28 -33
- data/src/stylesheets/nitro_kit/components/radio_button_group.css +6 -6
- data/src/stylesheets/nitro_kit/components/rich_text_area.css +2 -2
- data/src/stylesheets/nitro_kit/components/select.css +24 -8
- data/src/stylesheets/nitro_kit/components/settings_layout.css +5 -5
- data/src/stylesheets/nitro_kit/components/settings_section.css +2 -2
- data/src/stylesheets/nitro_kit/components/sheet.css +10 -10
- data/src/stylesheets/nitro_kit/components/stat_grid.css +1 -1
- data/src/stylesheets/nitro_kit/components/switch.css +34 -40
- data/src/stylesheets/nitro_kit/components/table.css +8 -4
- data/src/stylesheets/nitro_kit/components/tabs.css +5 -1
- data/src/stylesheets/nitro_kit/components/textarea.css +20 -5
- data/src/stylesheets/nitro_kit/components/toast.css +11 -58
- data/src/stylesheets/nitro_kit/components/toolbar.css +2 -2
- data/src/stylesheets/nitro_kit/components/tooltip.css +4 -0
- data/src/stylesheets/nitro_kit/components/typeset.css +4 -4
- data/src/stylesheets/nitro_kit/reset.css +6 -6
- data/src/stylesheets/nitro_kit/tokens.css +497 -74
- metadata +1 -2
- data/docs/new_app_strategy.md +0 -22
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f4ea3ffdd5e6404639ac11c27f5eb4798b2d29b0103b360404b964c46ffed908
|
|
4
|
+
data.tar.gz: 5a1141716d12a4e3f30969f9971da1d844d44d057e856bd6ed2d1ea0a99fec2d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
|
7
|
+
**Audience:** Rails developers evaluating or installing Nitro Kit.
|
|
8
8
|
|
|
9
|
-
Nitro Kit is a gem-owned
|
|
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
|
[](https://rubygems.org/gems/nitro_kit)
|
|
12
13
|
|
|
13
|
-
##
|
|
14
|
+
## Install
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
Pin the prerelease:
|
|
16
17
|
|
|
17
18
|
```ruby
|
|
18
|
-
gem "nitro_kit", "2.0.0.alpha.
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
32
|
+
Start with:
|
|
38
33
|
|
|
39
|
-
|
|
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
|
|
42
|
-
|
|
43
|
-
|
|
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
|
|
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
|
|
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-
|
|
23
|
-
--color-destructive-content: var(--nk-color-
|
|
24
|
-
--color-destructive-foreground: var(--nk-color-
|
|
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);
|