nitro_kit 2.0.0.alpha.6 → 2.0.0.beta.2

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 (40) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +68 -1
  3. data/README.md +16 -2
  4. data/STYLE_GUIDE.md +3 -1
  5. data/app/assets/stylesheets/nitro_kit.css +519 -35
  6. data/app/components/nitro_kit/app_shell.rb +41 -5
  7. data/app/components/nitro_kit/avatar.rb +21 -2
  8. data/app/components/nitro_kit/card.rb +28 -1
  9. data/app/javascript/controllers/nk/app_shell_controller.js +64 -2
  10. data/config/locales/en.yml +1 -0
  11. data/docs/agent_native_spec.md +5 -4
  12. data/docs/component_contracts.md +93 -5
  13. data/docs/customization.md +2 -2
  14. data/docs/eject.md +86 -0
  15. data/docs/migration_1_to_2.md +1 -1
  16. data/docs/patterns/application_foundation.md +22 -0
  17. data/docs/patterns/inset_workspace.md +9 -1
  18. data/docs/rails_integration.md +1 -1
  19. data/lib/generators/nitro_kit/eject_generator.rb +26 -0
  20. data/lib/nitro_kit/ejection.rb +136 -0
  21. data/lib/nitro_kit/version.rb +1 -1
  22. data/src/stylesheets/nitro_kit/components/app_navigation.css +4 -1
  23. data/src/stylesheets/nitro_kit/components/app_shell.css +209 -0
  24. data/src/stylesheets/nitro_kit/components/avatar.css +10 -0
  25. data/src/stylesheets/nitro_kit/components/avatar_stack.css +9 -5
  26. data/src/stylesheets/nitro_kit/components/card.css +206 -15
  27. data/src/stylesheets/nitro_kit/components/danger_zone.css +1 -1
  28. data/src/stylesheets/nitro_kit/components/dropzone.css +15 -0
  29. data/src/stylesheets/nitro_kit/components/empty_state.css +3 -3
  30. data/src/stylesheets/nitro_kit/components/field_group.css +6 -2
  31. data/src/stylesheets/nitro_kit/components/pagination_bar.css +3 -0
  32. data/src/stylesheets/nitro_kit/components/progressive_image.css +2 -0
  33. data/src/stylesheets/nitro_kit/components/settings_layout.css +2 -0
  34. data/src/stylesheets/nitro_kit/components/stat_grid.css +4 -4
  35. data/src/stylesheets/nitro_kit/components/toolbar.css +12 -0
  36. data/src/stylesheets/nitro_kit/components/tooltip.css +15 -1
  37. data/src/stylesheets/nitro_kit/components/typeset.css +4 -0
  38. data/src/stylesheets/nitro_kit/reset.css +11 -1
  39. data/src/stylesheets/nitro_kit/tokens.css +3 -2
  40. metadata +5 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 932180abe87b1ff01427a3eb1b60d0b6b6622d480823c9539ac087f318da698a
4
- data.tar.gz: 486d63611904e1182195e1377e4da4ecca32ddaeea5c0d004c387da21baec537
3
+ metadata.gz: d426e47dadcb1efcc115e21074c210e35c4120fca8c4093abf1cc5c431689ce4
4
+ data.tar.gz: 04e353250240db16067074982096a1753afd7ba45f0da04675cff2621e48ac50
5
5
  SHA512:
6
- metadata.gz: c61d31729b7d0209a20bb79b2b0b2e91c4bb02494fcf8c60d9d8ad676c9b5123d2c7c6ba172c11b00d64cf870c0d9647bcf5a29813c32badfb7c7772c040ab80
7
- data.tar.gz: 1a73beddfd13e1fd4300482f48b03346d6f568a2a7d50af8b7c1aa93c5be845bb19d883493e8bf0a5f4e342b1b15825962e949b33ec680dce08b39e4b11741fa
6
+ metadata.gz: b2874c385257fbaeae559112addd4702d06b12b510eefcde84c8408f422ce54e7326329f27d2843b420245abbde08acf95aa68f4fd85c69041ca6b477350910a
7
+ data.tar.gz: 153c7c83078bc7521af05540b4750ac3e82b5e5f99da6255c3372c37fa6ef3d1a084aad094e72f45d7da89a06dc294eb249f569dc67d9d8bfa594213a99945f4
data/CHANGELOG.md CHANGED
@@ -1,6 +1,73 @@
1
1
  # Changelog
2
2
 
3
- ## Unreleased
3
+ ## 2.0.0.beta.2
4
+
5
+ ### Added
6
+
7
+ - Redesign Card with `header`, `description`, and `actions` slots so call sites
8
+ stop hand-rolling headers and footers. `actions` inside a `header` trail the
9
+ title and description; inside a `footer` they push to the end.
10
+ - Add Card `size: :sm | :md | :lg` density and `variant: :default | :muted |
11
+ :outline` surfaces, emitted as owned `data-size` and `data-variant`
12
+ attributes. Sizes coordinate padding, part gaps, corners, and title size.
13
+ - Add explicit `nitro_kit:eject COMPONENT` source-level customization, with
14
+ isolated Ruby/CSS/Stimulus dependencies, version provenance, and safe whole-snapshot
15
+ skip behavior unless `--force` is requested.
16
+ - Desktop AppShell sidebar rail with hover/focus overlay peek and an accessible
17
+ pin toggle, enabled with `collapsible: true`. The default sidebar stays
18
+ expanded without a toggle or peek behavior; `sidebar: :collapsed` starts an
19
+ opted-in sidebar unpinned.
20
+ Mobile keeps its native drawer, and reduced motion disables rail animation.
21
+ - Align rail selection backgrounds and pin controls, keep peek surfaces opaque,
22
+ and isolate nested shells. `brand(icon:)` keeps a brand mark on the rail
23
+ without cropping the full logotype.
24
+ - Unpinning with a pointer collapses the sidebar immediately; hover peek
25
+ resumes after the pointer first leaves the sidebar.
26
+ - Synchronize sidebar panel, reserved content track, and selection-highlight
27
+ transitions so pinning and unpinning do not snap ahead of the animation.
28
+ Keep the pin control outside hover/focus peek so direct expansion starts
29
+ the panel and content transitions together.
30
+ - Preserve client sidebar pin state and its accessible toggle state across
31
+ Turbo morph refreshes without persisting it across page loads.
32
+
33
+ ### Changed
34
+
35
+ - Card titles scale with the card's own size instead of the shared
36
+ `--nk-title-surface-size` role, which now covers dialogs, sheets, empty
37
+ states, and fieldsets.
38
+ - Give card sections set apart by a divider at the top or bottom edge even
39
+ spacing, fixing the uneven medium footer padding. Tables inside `full`
40
+ regions align with the card gutter, and a trailing footer stays on the
41
+ bottom edge of a card stretched by a Grid row.
42
+ - Align StatGrid, DangerZone, and EmptyState panels with the card's padding
43
+ and corners.
44
+ - Stop FieldGroup spacing from counting hidden inputs as neighbours.
45
+ - Replace ghost menu triggers inside gallery cards with the default button
46
+ treatment and rebuild the card gallery around header, body, and footer
47
+ recipes.
48
+
49
+ ### Upgrade notes
50
+
51
+ - Pin `2.0.0.beta.2` explicitly. Beta releases may still change APIs; review
52
+ release notes before updating.
53
+ - Cards no longer read `--nk-title-surface-size`; a theme that tuned card
54
+ headings through that token should pick a card `size:` instead.
55
+ - Review application-owned card headers and footers built from raw `Flex`
56
+ rows and move them onto `header`, `description`, and `actions`. Existing
57
+ copied or ejected source is not updated automatically by this gem release.
58
+
59
+ ## 2.0.0.beta.1
60
+
61
+ ### Changed
62
+
63
+ - Promote Nitro Kit 2 to beta after application evals and real-project review.
64
+ - Update installation examples and public contracts to pin the beta release.
65
+ - No component runtime or API changes from 2.0.0.alpha.6.
66
+
67
+ ### Upgrade notes
68
+
69
+ - Pin `2.0.0.beta.1` explicitly. Beta releases may still change APIs; review
70
+ release notes before updating. Nitro Kit 1 applications require migration.
4
71
 
5
72
  ## 2.0.0.alpha.6
6
73
 
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.alpha.6` prerelease
9
+ Nitro Kit is a gem-owned Phlex UI system for Rails. The `2.0.0.beta.2` prerelease
10
10
  is under active testing and is not stable.
11
11
 
12
12
  [![RubyGems](https://img.shields.io/gem/v/nitro_kit.svg)](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.alpha.6"
19
+ gem "nitro_kit", "2.0.0.beta.2"
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 copied-component generators.
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
 
@@ -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.