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
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
inset-block-end: calc(var(--nk-space) * 5);
|
|
11
11
|
display: flex;
|
|
12
12
|
flex-direction: column;
|
|
13
|
-
inline-size: min(26rem, calc(
|
|
13
|
+
inline-size: min(26rem, calc(100% - (var(--nk-space) * 10)));
|
|
14
14
|
gap: calc(var(--nk-space) * 3);
|
|
15
15
|
margin: 0;
|
|
16
16
|
padding: 0;
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
background: var(--_nk-toast-background);
|
|
34
34
|
border: var(--nk-border-width) solid var(--_nk-toast-border);
|
|
35
35
|
border-radius: var(--nk-radius-lg);
|
|
36
|
-
box-shadow: var(--nk-shadow-
|
|
36
|
+
box-shadow: var(--nk-shadow-md);
|
|
37
37
|
transition:
|
|
38
38
|
opacity var(--nk-duration-normal) var(--nk-ease),
|
|
39
39
|
transform var(--nk-duration-normal) var(--nk-ease);
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
:where([data-nk="toast-item"] [data-slot="toast-item-title"]) {
|
|
50
|
-
font-size: var(--nk-
|
|
51
|
-
font-weight: var(--nk-
|
|
50
|
+
font-size: var(--nk-title-compact-size);
|
|
51
|
+
font-weight: var(--nk-title-compact-weight);
|
|
52
52
|
line-height: var(--nk-leading-tight);
|
|
53
53
|
text-wrap: balance;
|
|
54
54
|
}
|
|
@@ -66,60 +66,13 @@
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
@layer nitro-kit.variant {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
);
|
|
75
|
-
--_nk-toast-foreground: var(--
|
|
76
|
-
--_nk-toast-border: color-mix(
|
|
77
|
-
in oklab,
|
|
78
|
-
var(--nk-color-info) 45%,
|
|
79
|
-
transparent
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
:where([data-nk="toast-item"][data-variant="success"]) {
|
|
84
|
-
--_nk-toast-background: color-mix(
|
|
85
|
-
in oklab,
|
|
86
|
-
var(--nk-color-success) 10%,
|
|
87
|
-
var(--nk-color-surface)
|
|
88
|
-
);
|
|
89
|
-
--_nk-toast-foreground: var(--nk-color-success-content);
|
|
90
|
-
--_nk-toast-border: color-mix(
|
|
91
|
-
in oklab,
|
|
92
|
-
var(--nk-color-success) 45%,
|
|
93
|
-
transparent
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
:where([data-nk="toast-item"][data-variant="warning"]) {
|
|
98
|
-
--_nk-toast-background: color-mix(
|
|
99
|
-
in oklab,
|
|
100
|
-
var(--nk-color-warning) 10%,
|
|
101
|
-
var(--nk-color-surface)
|
|
102
|
-
);
|
|
103
|
-
--_nk-toast-foreground: var(--nk-color-warning-content);
|
|
104
|
-
--_nk-toast-border: color-mix(
|
|
105
|
-
in oklab,
|
|
106
|
-
var(--nk-color-warning) 45%,
|
|
107
|
-
transparent
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
:where([data-nk="toast-item"][data-variant="error"]) {
|
|
112
|
-
--_nk-toast-background: color-mix(
|
|
113
|
-
in oklab,
|
|
114
|
-
var(--nk-color-danger) 10%,
|
|
115
|
-
var(--nk-color-surface)
|
|
116
|
-
);
|
|
117
|
-
--_nk-toast-foreground: var(--nk-color-danger-content);
|
|
118
|
-
--_nk-toast-border: color-mix(
|
|
119
|
-
in oklab,
|
|
120
|
-
var(--nk-color-danger) 45%,
|
|
121
|
-
transparent
|
|
122
|
-
);
|
|
69
|
+
/* Colour, tint strength, and appearance switching all come from the shared
|
|
70
|
+
semantic palette, so a Toast and an Alert of the same variant render
|
|
71
|
+
identically. */
|
|
72
|
+
:where([data-nk="toast-item"][data-variant]) {
|
|
73
|
+
--_nk-toast-background: var(--_nk-semantic-surface);
|
|
74
|
+
--_nk-toast-border: var(--_nk-semantic-border);
|
|
75
|
+
--_nk-toast-foreground: var(--_nk-semantic-content);
|
|
123
76
|
}
|
|
124
77
|
}
|
|
125
78
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@layer nitro-kit.base {
|
|
2
2
|
:where([data-nk="toolbar"]) {
|
|
3
3
|
display: flex;
|
|
4
|
-
min-
|
|
4
|
+
min-inline-size: 0;
|
|
5
5
|
flex-wrap: wrap;
|
|
6
6
|
align-items: center;
|
|
7
7
|
justify-content: space-between;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
[data-nk="toolbar"] > [data-slot="toolbar-trailing"]
|
|
14
14
|
) {
|
|
15
15
|
display: flex;
|
|
16
|
-
min-
|
|
16
|
+
min-inline-size: 0;
|
|
17
17
|
/* Regions never exceed the toolbar, so nested content such as a
|
|
18
18
|
scrolling ButtonGroup receives real width pressure when stacked. */
|
|
19
19
|
max-inline-size: 100%;
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
position: absolute;
|
|
9
9
|
z-index: 50;
|
|
10
10
|
inline-size: max-content;
|
|
11
|
+
/* Absolutely positioned inside its wrapper, so a percentage would resolve
|
|
12
|
+
against the trigger, not the viewport. 100vw can overshoot by a classic
|
|
13
|
+
scrollbar's width, but only below a 22.5rem viewport, where scrollbars
|
|
14
|
+
overlay. The fixed overlays use 100% of the initial containing block. */
|
|
11
15
|
max-inline-size: min(20rem, calc(100vw - (var(--nk-space) * 8)));
|
|
12
16
|
padding: calc(var(--nk-space) * 1.5) calc(var(--nk-space) * 2.5);
|
|
13
17
|
color: var(--nk-color-foreground);
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
border-radius: var(--nk-radius-sm);
|
|
107
107
|
}
|
|
108
108
|
:where([data-nk="typeset"]) > table:not([data-nk], [data-typeset="off"]) {
|
|
109
|
-
|
|
109
|
+
inline-size: 100%;
|
|
110
110
|
border-collapse: collapse;
|
|
111
111
|
font-size: 0.925em;
|
|
112
112
|
}
|
|
@@ -250,7 +250,7 @@
|
|
|
250
250
|
}
|
|
251
251
|
|
|
252
252
|
table {
|
|
253
|
-
|
|
253
|
+
inline-size: 100%;
|
|
254
254
|
border-collapse: collapse;
|
|
255
255
|
font-size: 0.925em;
|
|
256
256
|
}
|
|
@@ -267,8 +267,8 @@
|
|
|
267
267
|
}
|
|
268
268
|
|
|
269
269
|
:where(img, video, svg) {
|
|
270
|
-
max-
|
|
271
|
-
|
|
270
|
+
max-inline-size: 100%;
|
|
271
|
+
block-size: auto;
|
|
272
272
|
border-radius: var(--nk-radius-md);
|
|
273
273
|
}
|
|
274
274
|
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
/* Nitro-owned boxes never establish a min-content floor, so long slot
|
|
20
20
|
content shrinks instead of overflowing its flex or grid parent. */
|
|
21
21
|
:where([data-nk], [data-nk] [data-slot]) {
|
|
22
|
-
min-
|
|
22
|
+
min-inline-size: 0;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
:where(html, :host) {
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
:where(input)::-webkit-date-and-time-value {
|
|
122
|
-
min-
|
|
122
|
+
min-block-size: 1lh;
|
|
123
123
|
text-align: inherit;
|
|
124
124
|
}
|
|
125
125
|
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
|
|
135
135
|
:where(input)::-webkit-inner-spin-button,
|
|
136
136
|
:where(input)::-webkit-outer-spin-button {
|
|
137
|
-
|
|
137
|
+
block-size: auto;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
:where(input):-moz-ui-invalid {
|
|
@@ -164,12 +164,12 @@
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
:where(img, video) {
|
|
167
|
-
max-
|
|
168
|
-
|
|
167
|
+
max-inline-size: 100%;
|
|
168
|
+
block-size: auto;
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
:where(hr) {
|
|
172
|
-
|
|
172
|
+
block-size: 0;
|
|
173
173
|
color: inherit;
|
|
174
174
|
border-top-width: var(--nk-border-width);
|
|
175
175
|
}
|