nitro_kit 2.0.0.beta.1 → 2.0.0.beta.3
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 +96 -1
- data/README.md +16 -2
- data/STYLE_GUIDE.md +4 -2
- data/app/assets/stylesheets/nitro_kit.css +567 -36
- data/app/assets/tailwind/nitro_kit/engine.css +15 -0
- data/app/components/nitro_kit/app_shell.rb +41 -5
- data/app/components/nitro_kit/avatar.rb +21 -2
- data/app/components/nitro_kit/card.rb +28 -1
- data/app/javascript/controllers/nk/app_shell_controller.js +64 -2
- data/config/locales/en.yml +1 -0
- data/docs/agent_native_spec.md +5 -4
- data/docs/browser_support.md +7 -1
- data/docs/component_contracts.md +93 -5
- data/docs/customization.md +35 -15
- data/docs/eject.md +86 -0
- data/docs/migration_1_to_2.md +1 -1
- data/docs/patterns/application_foundation.md +22 -0
- data/docs/patterns/inset_workspace.md +9 -1
- data/docs/rails_integration.md +4 -2
- data/lib/generators/nitro_kit/eject_generator.rb +26 -0
- data/lib/nitro_kit/ejection.rb +136 -0
- data/lib/nitro_kit/engine.rb +13 -0
- data/lib/nitro_kit/installation.rb +29 -7
- data/lib/nitro_kit/version.rb +1 -1
- data/lib/tasks/nitro_kit_tasks.rake +1 -1
- data/src/stylesheets/nitro_kit/components/app_navigation.css +4 -1
- data/src/stylesheets/nitro_kit/components/app_shell.css +209 -0
- data/src/stylesheets/nitro_kit/components/avatar.css +10 -0
- data/src/stylesheets/nitro_kit/components/avatar_stack.css +9 -5
- data/src/stylesheets/nitro_kit/components/card.css +206 -15
- data/src/stylesheets/nitro_kit/components/danger_zone.css +1 -1
- data/src/stylesheets/nitro_kit/components/dropzone.css +15 -0
- data/src/stylesheets/nitro_kit/components/empty_state.css +3 -3
- data/src/stylesheets/nitro_kit/components/field_group.css +6 -2
- data/src/stylesheets/nitro_kit/components/pagination_bar.css +3 -0
- data/src/stylesheets/nitro_kit/components/progressive_image.css +2 -0
- data/src/stylesheets/nitro_kit/components/settings_layout.css +2 -0
- data/src/stylesheets/nitro_kit/components/stat_grid.css +4 -4
- data/src/stylesheets/nitro_kit/components/toolbar.css +12 -0
- data/src/stylesheets/nitro_kit/components/tooltip.css +15 -1
- data/src/stylesheets/nitro_kit/components/typeset.css +4 -0
- data/src/stylesheets/nitro_kit/layers.css +8 -0
- data/src/stylesheets/nitro_kit/reset.css +12 -2
- data/{app/assets/stylesheets/nitro_kit-tailwind-v4.css → src/stylesheets/nitro_kit/tailwind.css} +4 -5
- data/src/stylesheets/nitro_kit/tokens.css +3 -2
- metadata +7 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 84caf95e1c63e0461bef9e9a0183b67d02bf3c00fee964f0d0ee321a23b5457f
|
|
4
|
+
data.tar.gz: 9ebac7e5aa8f5cc74f4930838b0760a364eaebc7f1d9a01d99d8a15ce152b135
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 56d6151cb701d8254ee9671d900f8053ddcd023435b03157f590dbad2f5f283e489f4db54e34de122996006af532c725cd86cc0491d48810b17fa343e1654da4
|
|
7
|
+
data.tar.gz: 482fa5ddf8c57c09c3f7d6f3e4e607fcd125dcecf8ff23500474cb8926469e73c139a4126610bf4df7e59d37ada2ea47d38e2bcc462649a95248cf7009424ac1
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,101 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 2.0.0.beta.3
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Ship `app/assets/tailwind/nitro_kit/engine.css` for `tailwindcss-rails`
|
|
8
|
+
engine support, so a Tailwind CSS v4 application can `@import
|
|
9
|
+
"../builds/tailwind/nitro_kit"` and load Nitro Kit through its single
|
|
10
|
+
compiled `tailwind` stylesheet. The engine keeps that entry out of the asset
|
|
11
|
+
pipeline, and `nitro_kit:doctor` and the installer expect only `tailwind`
|
|
12
|
+
when the import is present.
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- Fold the Tailwind CSS v4 adapter into `nitro_kit.css`. The distribution
|
|
17
|
+
stylesheet now opens with the global cascade-layer order and carries the
|
|
18
|
+
Tailwind theme aliases from `src/stylesheets/nitro_kit/tailwind.css`, so a
|
|
19
|
+
Tailwind application links `nitro_kit` then `tailwind` and nothing else.
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- Replace the invalid `::file-selector-button:disabled` reset selector with
|
|
24
|
+
`:disabled::file-selector-button`, which Lightning CSS otherwise warns about
|
|
25
|
+
when the stylesheet goes through a Tailwind build.
|
|
26
|
+
|
|
27
|
+
### Removed
|
|
28
|
+
|
|
29
|
+
- The separate `nitro_kit-tailwind-v4.css` asset. Remove it from the layout's
|
|
30
|
+
`stylesheet_link_tag`; `nitro_kit:doctor` flags a leftover link.
|
|
31
|
+
|
|
32
|
+
### Upgrade notes
|
|
33
|
+
|
|
34
|
+
- Pin `2.0.0.beta.3` explicitly. Beta releases may still change APIs; review
|
|
35
|
+
release notes before updating.
|
|
36
|
+
- Delete `"nitro_kit-tailwind-v4"` from every `stylesheet_link_tag`. The
|
|
37
|
+
`nitro_kit` stylesheet now provides the cascade-layer order and Tailwind
|
|
38
|
+
theme aliases itself, and must load before the compiled `tailwind`
|
|
39
|
+
stylesheet. Run `nitro_kit:doctor` to confirm the layout.
|
|
40
|
+
- A `tailwindcss-rails` application can optionally collapse to one stylesheet:
|
|
41
|
+
add `@import "../builds/tailwind/nitro_kit";` above `@import "tailwindcss";`
|
|
42
|
+
in `app/assets/tailwind/application.css` and link only `tailwind`.
|
|
43
|
+
|
|
44
|
+
## 2.0.0.beta.2
|
|
45
|
+
|
|
46
|
+
### Added
|
|
47
|
+
|
|
48
|
+
- Redesign Card with `header`, `description`, and `actions` slots so call sites
|
|
49
|
+
stop hand-rolling headers and footers. `actions` inside a `header` trail the
|
|
50
|
+
title and description; inside a `footer` they push to the end.
|
|
51
|
+
- Add Card `size: :sm | :md | :lg` density and `variant: :default | :muted |
|
|
52
|
+
:outline` surfaces, emitted as owned `data-size` and `data-variant`
|
|
53
|
+
attributes. Sizes coordinate padding, part gaps, corners, and title size.
|
|
54
|
+
- Add explicit `nitro_kit:eject COMPONENT` source-level customization, with
|
|
55
|
+
isolated Ruby/CSS/Stimulus dependencies, version provenance, and safe whole-snapshot
|
|
56
|
+
skip behavior unless `--force` is requested.
|
|
57
|
+
- Desktop AppShell sidebar rail with hover/focus overlay peek and an accessible
|
|
58
|
+
pin toggle, enabled with `collapsible: true`. The default sidebar stays
|
|
59
|
+
expanded without a toggle or peek behavior; `sidebar: :collapsed` starts an
|
|
60
|
+
opted-in sidebar unpinned.
|
|
61
|
+
Mobile keeps its native drawer, and reduced motion disables rail animation.
|
|
62
|
+
- Align rail selection backgrounds and pin controls, keep peek surfaces opaque,
|
|
63
|
+
and isolate nested shells. `brand(icon:)` keeps a brand mark on the rail
|
|
64
|
+
without cropping the full logotype.
|
|
65
|
+
- Unpinning with a pointer collapses the sidebar immediately; hover peek
|
|
66
|
+
resumes after the pointer first leaves the sidebar.
|
|
67
|
+
- Synchronize sidebar panel, reserved content track, and selection-highlight
|
|
68
|
+
transitions so pinning and unpinning do not snap ahead of the animation.
|
|
69
|
+
Keep the pin control outside hover/focus peek so direct expansion starts
|
|
70
|
+
the panel and content transitions together.
|
|
71
|
+
- Preserve client sidebar pin state and its accessible toggle state across
|
|
72
|
+
Turbo morph refreshes without persisting it across page loads.
|
|
73
|
+
|
|
74
|
+
### Changed
|
|
75
|
+
|
|
76
|
+
- Card titles scale with the card's own size instead of the shared
|
|
77
|
+
`--nk-title-surface-size` role, which now covers dialogs, sheets, empty
|
|
78
|
+
states, and fieldsets.
|
|
79
|
+
- Give card sections set apart by a divider at the top or bottom edge even
|
|
80
|
+
spacing, fixing the uneven medium footer padding. Tables inside `full`
|
|
81
|
+
regions align with the card gutter, and a trailing footer stays on the
|
|
82
|
+
bottom edge of a card stretched by a Grid row.
|
|
83
|
+
- Align StatGrid, DangerZone, and EmptyState panels with the card's padding
|
|
84
|
+
and corners.
|
|
85
|
+
- Stop FieldGroup spacing from counting hidden inputs as neighbours.
|
|
86
|
+
- Replace ghost menu triggers inside gallery cards with the default button
|
|
87
|
+
treatment and rebuild the card gallery around header, body, and footer
|
|
88
|
+
recipes.
|
|
89
|
+
|
|
90
|
+
### Upgrade notes
|
|
91
|
+
|
|
92
|
+
- Pin `2.0.0.beta.2` explicitly. Beta releases may still change APIs; review
|
|
93
|
+
release notes before updating.
|
|
94
|
+
- Cards no longer read `--nk-title-surface-size`; a theme that tuned card
|
|
95
|
+
headings through that token should pick a card `size:` instead.
|
|
96
|
+
- Review application-owned card headers and footers built from raw `Flex`
|
|
97
|
+
rows and move them onto `header`, `description`, and `actions`. Existing
|
|
98
|
+
copied or ejected source is not updated automatically by this gem release.
|
|
4
99
|
|
|
5
100
|
## 2.0.0.beta.1
|
|
6
101
|
|
data/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
**Audience:** Rails developers evaluating or installing Nitro Kit.
|
|
8
8
|
|
|
9
|
-
Nitro Kit is a gem-owned Phlex UI system for Rails. The `2.0.0.beta.
|
|
9
|
+
Nitro Kit is a gem-owned Phlex UI system for Rails. The `2.0.0.beta.3` prerelease
|
|
10
10
|
is under active testing and is not stable.
|
|
11
11
|
|
|
12
12
|
[](https://rubygems.org/gems/nitro_kit)
|
|
@@ -16,7 +16,7 @@ is under active testing and is not stable.
|
|
|
16
16
|
Pin the prerelease:
|
|
17
17
|
|
|
18
18
|
```ruby
|
|
19
|
-
gem "nitro_kit", "2.0.0.beta.
|
|
19
|
+
gem "nitro_kit", "2.0.0.beta.3"
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
```sh
|
|
@@ -34,6 +34,7 @@ Start with:
|
|
|
34
34
|
- [Rails integration](docs/rails_integration.md)
|
|
35
35
|
- [Component contracts](docs/component_contracts.md)
|
|
36
36
|
- [Customization](docs/customization.md)
|
|
37
|
+
- [Eject a component into application-owned code](docs/eject.md)
|
|
37
38
|
- [Browser support](docs/browser_support.md)
|
|
38
39
|
- [Nitro Kit 1.x migration](docs/migration_1_to_2.md)
|
|
39
40
|
- [Coding-agent guide](docs/agent_guide.md)
|
|
@@ -60,6 +61,19 @@ Set up Nitro Kit before planning or implementing the product:
|
|
|
60
61
|
Maintaining Nitro Kit 1? Its frozen documentation remains at
|
|
61
62
|
[v1.nitrokit.dev](https://v1.nitrokit.dev).
|
|
62
63
|
|
|
64
|
+
## Eject for source-level customization
|
|
65
|
+
|
|
66
|
+
Prefer tokens and composition. When you need to change a component's source:
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
bin/rails generate nitro_kit:eject Button
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Render `Ui::EjectedButton::Button.new("Save")` and load `ejected_button.css`
|
|
73
|
+
after `nitro_kit.css`. Ruby, CSS, and Stimulus dependencies become application-owned;
|
|
74
|
+
keep the gem installed for the shared kernel and tokens. See [Eject](docs/eject.md)
|
|
75
|
+
for integration, collision handling, and upgrade responsibilities.
|
|
76
|
+
|
|
63
77
|
## License
|
|
64
78
|
|
|
65
79
|
Nitro Kit uses the custom [NitroKit License](LICENSE).
|
data/STYLE_GUIDE.md
CHANGED
|
@@ -73,7 +73,8 @@ test/dummy/app/components/gallery/ # Phlex gallery pages
|
|
|
73
73
|
test/integration/ # catalog-driven route coverage
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
-
Do not add component helper modules or
|
|
76
|
+
Do not add component helper modules or default copy-install. The explicit
|
|
77
|
+
user-requested eject generator is the sole copying exception; see `docs/eject.md`.
|
|
77
78
|
|
|
78
79
|
## Component anatomy
|
|
79
80
|
|
|
@@ -329,7 +330,7 @@ Before JavaScript connects, `:root` follows `prefers-color-scheme`. Explicit `[d
|
|
|
329
330
|
|
|
330
331
|
Customization tools may read, preview, and export documented public tokens. Model customizer state as an immutable, explicitly versioned value object with closed named choices and readable URL parameters; never serialize an opaque arbitrary-token blob. Exports use stable selector and declaration ordering, cover light, dark, and system fallback, and contain only documented public variables. Structural preview choices may emit copyable component-composition examples, but never component implementations. Customization tools must not expose private `--_nk-*` values, edit the generated distribution asset, generate component copies, or turn arbitrary CSS into a Nitro contract.
|
|
331
332
|
|
|
332
|
-
|
|
333
|
+
`src/stylesheets/nitro_kit/tailwind.css` declares the global cascade-layer order and maps Nitro values into Tailwind v4 theme variables so a compiled Tailwind stylesheet composes with the distribution asset. Tailwind compilation, source detection, and utilities remain application concerns. Do not add Tailwind as a Nitro runtime dependency.
|
|
333
334
|
|
|
334
335
|
## Baseline
|
|
335
336
|
|
|
@@ -443,6 +444,7 @@ Every component includes:
|
|
|
443
444
|
- Structural and component-specific accessibility assertions.
|
|
444
445
|
- A gallery combination page with meaningful permutations.
|
|
445
446
|
- Long, missing optional, disabled, validation/error, dark, and narrow-width examples where relevant.
|
|
447
|
+
- An "Under pressure" example flagged `stress: true`, composed from `Gallery::Hostile`, that the stress sweep audits.
|
|
446
448
|
- Behavior tests for interactive components.
|
|
447
449
|
|
|
448
450
|
The gallery uses explicit Phlex page classes and `Gallery::Catalog`. Do not add ERB component examples or infer routes from filenames. Every `Gallery::Example` pairs Preview and Code tabs. Keep the preview in the block passed to the gallery helper so `Gallery::SourceCode` can extract, highlight, and copy its executable Ruby body; use a concrete method source for inherited flow wrappers instead of duplicating snippets.
|