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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +229 -1
- data/README.md +25 -10
- data/STYLE_GUIDE.md +47 -5
- data/app/assets/stylesheets/nitro_kit-tailwind-v4.css +3 -3
- data/app/assets/stylesheets/nitro_kit.css +2820 -1816
- data/app/components/nitro_kit/accordion.rb +2 -26
- data/app/components/nitro_kit/alert.rb +1 -11
- data/app/components/nitro_kit/app_navigation.rb +45 -11
- data/app/components/nitro_kit/app_shell.rb +1 -7
- data/app/components/nitro_kit/appearance_picker.rb +11 -12
- data/app/components/nitro_kit/avatar.rb +6 -1
- data/app/components/nitro_kit/avatar_stack.rb +3 -0
- data/app/components/nitro_kit/badge.rb +13 -4
- data/app/components/nitro_kit/button_group.rb +2 -2
- data/app/components/nitro_kit/checkbox.rb +7 -4
- data/app/components/nitro_kit/checkbox_group.rb +0 -25
- data/app/components/nitro_kit/combobox.rb +4 -33
- data/app/components/nitro_kit/command_palette.rb +42 -59
- data/app/components/nitro_kit/component.rb +57 -5
- data/app/components/nitro_kit/danger_zone.rb +5 -1
- data/app/components/nitro_kit/data_section.rb +28 -4
- data/app/components/nitro_kit/details_table.rb +19 -8
- data/app/components/nitro_kit/dialog.rb +23 -19
- data/app/components/nitro_kit/dropdown.rb +1 -6
- data/app/components/nitro_kit/dropzone.rb +4 -15
- data/app/components/nitro_kit/empty_state.rb +21 -2
- data/app/components/nitro_kit/field.rb +35 -11
- data/app/components/nitro_kit/form_builder.rb +1 -2
- data/app/components/nitro_kit/progressive_image.rb +2 -2
- data/app/components/nitro_kit/radio_button.rb +7 -4
- data/app/components/nitro_kit/radio_button_group.rb +0 -25
- data/app/components/nitro_kit/select.rb +4 -17
- data/app/components/nitro_kit/settings_layout.rb +17 -4
- data/app/components/nitro_kit/{form_section.rb → settings_section.rb} +18 -11
- data/app/components/nitro_kit/sheet.rb +29 -20
- data/app/components/nitro_kit/stat_grid.rb +18 -2
- data/app/components/nitro_kit/table.rb +22 -3
- data/app/components/nitro_kit/tabs.rb +2 -13
- data/app/components/nitro_kit/toast.rb +4 -2
- data/app/components/nitro_kit/toolbar.rb +2 -0
- data/app/components/nitro_kit/tooltip.rb +7 -10
- data/app/javascript/controllers/nk/app_shell_controller.js +3 -3
- data/app/javascript/controllers/nk/appearance_controller.js +6 -0
- data/app/javascript/controllers/nk/combobox_controller.js +51 -1
- data/app/javascript/controllers/nk/command_palette_controller.js +25 -11
- data/app/javascript/controllers/nk/dialog_controller.js +54 -0
- data/app/javascript/controllers/nk/dropdown_controller.js +45 -0
- data/app/javascript/controllers/nk/dropzone_controller.js +2 -2
- data/app/javascript/controllers/nk/progressive_image_controller.js +11 -7
- data/app/javascript/controllers/nk/tabs_controller.js +21 -2
- data/app/javascript/controllers/nk/tooltip_controller.js +9 -0
- data/config/locales/en.yml +4 -1
- data/docs/agent_guide.md +63 -123
- data/docs/agent_native_spec.md +72 -383
- data/docs/browser_support.md +82 -0
- data/docs/component_contracts.md +108 -82
- data/docs/customization.md +689 -91
- data/docs/hotwire.md +50 -76
- data/docs/initialization_prompt.md +26 -31
- data/docs/migration_1_to_2.md +88 -30
- data/docs/patterns/application_foundation.md +45 -119
- data/docs/patterns/crud_resource.md +44 -126
- data/docs/patterns/destructive_action.md +45 -77
- 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 -75
- data/docs/rails_integration.md +96 -446
- data/lib/generators/nitro_kit/upgrade_smoke_tests_generator.rb +12 -0
- data/lib/nitro_kit/installation.rb +20 -7
- data/lib/nitro_kit/migration_inventory.rb +275 -8
- data/lib/nitro_kit/upgrade_smoke_test.rb +10 -12
- data/lib/nitro_kit/version.rb +1 -1
- data/lib/rails/commands/nitro_kit/nitro_kit_command.rb +10 -3
- data/plugins/nitro-kit/skills/nitro-kit-hotwire/SKILL.md +4 -0
- data/plugins/nitro-kit/skills/nitro-kit-rails/SKILL.md +13 -1
- data/plugins/nitro-kit/skills/nitro-kit-ui/SKILL.md +32 -15
- data/src/stylesheets/nitro_kit/components/accordion.css +44 -44
- data/src/stylesheets/nitro_kit/components/alert.css +27 -36
- data/src/stylesheets/nitro_kit/components/app_navigation.css +92 -20
- data/src/stylesheets/nitro_kit/components/app_shell.css +199 -196
- data/src/stylesheets/nitro_kit/components/appearance_picker.css +61 -39
- data/src/stylesheets/nitro_kit/components/auth_shell.css +2 -2
- data/src/stylesheets/nitro_kit/components/avatar.css +15 -11
- data/src/stylesheets/nitro_kit/components/avatar_stack.css +48 -29
- data/src/stylesheets/nitro_kit/components/badge.css +13 -9
- data/src/stylesheets/nitro_kit/components/button.css +121 -79
- data/src/stylesheets/nitro_kit/components/button_group.css +19 -14
- data/src/stylesheets/nitro_kit/components/card.css +12 -6
- data/src/stylesheets/nitro_kit/components/checkbox.css +54 -67
- data/src/stylesheets/nitro_kit/components/checkbox_group.css +16 -16
- data/src/stylesheets/nitro_kit/components/combobox.css +39 -29
- data/src/stylesheets/nitro_kit/components/command_palette.css +110 -51
- data/src/stylesheets/nitro_kit/components/container.css +6 -6
- data/src/stylesheets/nitro_kit/components/control_group.css +61 -67
- data/src/stylesheets/nitro_kit/components/danger_zone.css +8 -8
- data/src/stylesheets/nitro_kit/components/data_section.css +4 -4
- data/src/stylesheets/nitro_kit/components/details_table.css +17 -15
- data/src/stylesheets/nitro_kit/components/dialog.css +8 -5
- data/src/stylesheets/nitro_kit/components/dropdown.css +36 -30
- data/src/stylesheets/nitro_kit/components/dropzone.css +78 -35
- data/src/stylesheets/nitro_kit/components/empty_state.css +7 -7
- data/src/stylesheets/nitro_kit/components/field.css +32 -28
- data/src/stylesheets/nitro_kit/components/field_group.css +13 -0
- data/src/stylesheets/nitro_kit/components/fieldset.css +8 -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 +42 -8
- data/src/stylesheets/nitro_kit/components/layout.css +165 -165
- data/src/stylesheets/nitro_kit/components/page_header.css +7 -7
- data/src/stylesheets/nitro_kit/components/pagination.css +58 -49
- data/src/stylesheets/nitro_kit/components/pagination_bar.css +9 -9
- data/src/stylesheets/nitro_kit/components/palette.css +145 -77
- data/src/stylesheets/nitro_kit/components/progressive_image.css +45 -55
- data/src/stylesheets/nitro_kit/components/radio_button.css +48 -46
- data/src/stylesheets/nitro_kit/components/radio_button_group.css +49 -49
- data/src/stylesheets/nitro_kit/components/rich_text_area.css +16 -1
- data/src/stylesheets/nitro_kit/components/select.css +24 -15
- data/src/stylesheets/nitro_kit/components/settings_layout.css +26 -23
- data/src/stylesheets/nitro_kit/components/settings_section.css +84 -0
- data/src/stylesheets/nitro_kit/components/sheet.css +30 -10
- data/src/stylesheets/nitro_kit/components/stat_grid.css +11 -10
- data/src/stylesheets/nitro_kit/components/switch.css +60 -62
- data/src/stylesheets/nitro_kit/components/table.css +43 -35
- data/src/stylesheets/nitro_kit/components/tabs.css +48 -40
- data/src/stylesheets/nitro_kit/components/textarea.css +20 -5
- data/src/stylesheets/nitro_kit/components/toast.css +11 -47
- data/src/stylesheets/nitro_kit/components/toolbar.css +16 -41
- data/src/stylesheets/nitro_kit/components/tooltip.css +38 -29
- data/src/stylesheets/nitro_kit/components/typeset.css +150 -4
- data/src/stylesheets/nitro_kit/reset.css +15 -15
- data/src/stylesheets/nitro_kit/tokens.css +501 -79
- metadata +4 -4
- data/docs/new_app_strategy.md +0 -22
- data/src/stylesheets/nitro_kit/components/form_section.css +0 -71
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
position: fixed;
|
|
8
8
|
inset-block: 0;
|
|
9
9
|
max-block-size: none;
|
|
10
|
-
|
|
10
|
+
block-size: 100dvh;
|
|
11
11
|
margin-block: 0;
|
|
12
12
|
padding: calc(var(--nk-space) * 6);
|
|
13
13
|
overflow: auto;
|
|
@@ -28,15 +28,15 @@
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
:where([data-nk="sheet"][data-size="sm"] > [data-slot="sheet-panel"]) {
|
|
31
|
-
|
|
31
|
+
inline-size: min(calc(100% - (var(--nk-space) * 8)), 20rem);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
:where([data-nk="sheet"][data-size="md"] > [data-slot="sheet-panel"]) {
|
|
35
|
-
|
|
35
|
+
inline-size: min(calc(100% - (var(--nk-space) * 8)), 28rem);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
:where([data-nk="sheet"][data-size="lg"] > [data-slot="sheet-panel"]) {
|
|
39
|
-
|
|
39
|
+
inline-size: min(calc(100% - (var(--nk-space) * 8)), 40rem);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
:where([data-nk="sheet"] > [data-slot="sheet-panel"])::backdrop {
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
|
|
53
53
|
:where([data-nk="sheet"] [data-slot="sheet-title"]) {
|
|
54
54
|
padding-inline-end: calc(var(--nk-space) * 10);
|
|
55
|
-
font-size: var(--nk-
|
|
56
|
-
font-weight: var(--nk-
|
|
55
|
+
font-size: var(--nk-title-surface-size);
|
|
56
|
+
font-weight: var(--nk-title-surface-weight);
|
|
57
57
|
line-height: var(--nk-leading-tight);
|
|
58
58
|
}
|
|
59
59
|
|
|
@@ -73,12 +73,32 @@
|
|
|
73
73
|
animation: nk-sheet-enter var(--nk-duration-slow) var(--nk-ease);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
:where(
|
|
77
|
-
|
|
76
|
+
:where(
|
|
77
|
+
[data-nk="sheet"][data-side="left"] > [data-slot="sheet-panel"][open]
|
|
78
|
+
) {
|
|
79
|
+
--_nk-sheet-from: calc(var(--nk-space) * -4);
|
|
78
80
|
}
|
|
79
81
|
|
|
80
|
-
:where(
|
|
81
|
-
|
|
82
|
+
:where(
|
|
83
|
+
[data-nk="sheet"][data-side="right"] > [data-slot="sheet-panel"][open]
|
|
84
|
+
) {
|
|
85
|
+
--_nk-sheet-from: calc(var(--nk-space) * 4);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* Sides are logical, but translateX is physical; RTL flips the slide so the
|
|
89
|
+
panel still enters from its own edge. */
|
|
90
|
+
:where(
|
|
91
|
+
[data-nk="sheet"][data-side="left"]:dir(rtl)
|
|
92
|
+
> [data-slot="sheet-panel"][open]
|
|
93
|
+
) {
|
|
94
|
+
--_nk-sheet-from: calc(var(--nk-space) * 4);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:where(
|
|
98
|
+
[data-nk="sheet"][data-side="right"]:dir(rtl)
|
|
99
|
+
> [data-slot="sheet-panel"][open]
|
|
100
|
+
) {
|
|
101
|
+
--_nk-sheet-from: calc(var(--nk-space) * -4);
|
|
82
102
|
}
|
|
83
103
|
|
|
84
104
|
@keyframes nk-sheet-enter {
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
@layer nitro-kit.base {
|
|
2
2
|
:where([data-nk="stat-grid"]) {
|
|
3
|
+
inline-size: 100%;
|
|
3
4
|
color: var(--nk-color-foreground);
|
|
4
5
|
}
|
|
5
6
|
|
|
6
7
|
:where(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
[data-nk="stat-grid"]
|
|
9
|
+
> [data-slot="stat-grid-grid"]
|
|
10
|
+
> [data-slot="stat-grid-list"]
|
|
11
|
+
) {
|
|
11
12
|
display: contents;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
:where(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
[data-nk="stat-grid"]
|
|
17
|
+
> [data-slot="stat-grid-grid"]
|
|
18
|
+
> [data-slot="stat-grid-list"]
|
|
19
|
+
> [data-slot="stat-grid-stat"]
|
|
20
|
+
) {
|
|
20
21
|
display: grid;
|
|
21
22
|
align-content: start;
|
|
22
23
|
gap: calc(var(--nk-space) * 2);
|
|
23
|
-
min-
|
|
24
|
+
min-block-size: 100%;
|
|
24
25
|
padding: calc(var(--nk-space) * 5);
|
|
25
26
|
background: var(--nk-color-surface);
|
|
26
27
|
border: var(--nk-border-width) solid var(--nk-color-border);
|
|
@@ -1,9 +1,29 @@
|
|
|
1
1
|
@layer nitro-kit.base {
|
|
2
|
+
/* Four declared inputs; everything else derives. The block heights ride the
|
|
3
|
+
control ramp, the track is the block plus the handle's travel, and the
|
|
4
|
+
handle inset is whatever centers it inside the bordered track. */
|
|
2
5
|
:where([data-nk="switch"]) {
|
|
6
|
+
--_nk-switch-block-size: var(--nk-control-height-xs);
|
|
7
|
+
--_nk-switch-handle-size: calc(var(--nk-space) * 4);
|
|
8
|
+
--_nk-switch-travel: calc(var(--nk-space) * 4);
|
|
9
|
+
--_nk-switch-track-size: calc(
|
|
10
|
+
var(--_nk-switch-block-size) + var(--_nk-switch-travel)
|
|
11
|
+
);
|
|
12
|
+
--_nk-switch-pad: calc(
|
|
13
|
+
(var(--_nk-switch-block-size) - var(--_nk-switch-handle-size)) / 2 -
|
|
14
|
+
var(--nk-border-width)
|
|
15
|
+
);
|
|
16
|
+
|
|
3
17
|
display: inline-grid;
|
|
4
18
|
color: var(--nk-color-foreground);
|
|
5
19
|
}
|
|
6
20
|
|
|
21
|
+
:where([data-nk="switch"][data-size="lg"]) {
|
|
22
|
+
--_nk-switch-block-size: var(--nk-control-height-sm);
|
|
23
|
+
--_nk-switch-handle-size: calc(var(--nk-space) * 6);
|
|
24
|
+
--_nk-switch-travel: calc(var(--nk-space) * 5);
|
|
25
|
+
}
|
|
26
|
+
|
|
7
27
|
:where([data-nk="switch"] > [data-slot="switch-label"]) {
|
|
8
28
|
display: grid;
|
|
9
29
|
grid-template-columns: auto minmax(0, 1fr);
|
|
@@ -14,16 +34,16 @@
|
|
|
14
34
|
}
|
|
15
35
|
|
|
16
36
|
:where(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
37
|
+
[data-nk="switch"] [data-slot="switch-control"],
|
|
38
|
+
[data-nk="switch"] [data-slot="switch-track"]
|
|
39
|
+
) {
|
|
20
40
|
grid-area: 1 / 1;
|
|
21
41
|
}
|
|
22
42
|
|
|
23
43
|
:where([data-nk="switch"] [data-slot="switch-control"]) {
|
|
24
44
|
z-index: 1;
|
|
25
|
-
inline-size:
|
|
26
|
-
block-size:
|
|
45
|
+
inline-size: var(--_nk-switch-track-size);
|
|
46
|
+
block-size: var(--_nk-switch-block-size);
|
|
27
47
|
margin: 0;
|
|
28
48
|
cursor: pointer;
|
|
29
49
|
appearance: none;
|
|
@@ -33,9 +53,9 @@
|
|
|
33
53
|
:where([data-nk="switch"] [data-slot="switch-track"]) {
|
|
34
54
|
display: flex;
|
|
35
55
|
align-items: center;
|
|
36
|
-
inline-size:
|
|
37
|
-
block-size:
|
|
38
|
-
padding:
|
|
56
|
+
inline-size: var(--_nk-switch-track-size);
|
|
57
|
+
block-size: var(--_nk-switch-block-size);
|
|
58
|
+
padding: var(--_nk-switch-pad);
|
|
39
59
|
pointer-events: none;
|
|
40
60
|
background: var(--nk-color-muted);
|
|
41
61
|
border: var(--nk-border-width) solid var(--nk-color-border);
|
|
@@ -45,28 +65,15 @@
|
|
|
45
65
|
border-color var(--nk-duration-normal) var(--nk-ease);
|
|
46
66
|
}
|
|
47
67
|
|
|
48
|
-
:where(
|
|
49
|
-
[data-nk="switch"][data-size="lg"] [data-slot="switch-control"],
|
|
50
|
-
[data-nk="switch"][data-size="lg"] [data-slot="switch-track"]
|
|
51
|
-
) {
|
|
52
|
-
inline-size: 3.25rem;
|
|
53
|
-
block-size: 2rem;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
68
|
:where([data-nk="switch"] [data-slot="switch-handle"]) {
|
|
57
|
-
inline-size:
|
|
58
|
-
block-size:
|
|
69
|
+
inline-size: var(--_nk-switch-handle-size);
|
|
70
|
+
block-size: var(--_nk-switch-handle-size);
|
|
59
71
|
background: var(--nk-color-surface);
|
|
60
72
|
border-radius: var(--nk-radius-full);
|
|
61
73
|
box-shadow: var(--nk-shadow-sm);
|
|
62
74
|
transition: transform var(--nk-duration-normal) var(--nk-ease);
|
|
63
75
|
}
|
|
64
76
|
|
|
65
|
-
:where([data-nk="switch"][data-size="lg"] [data-slot="switch-handle"]) {
|
|
66
|
-
inline-size: 1.5rem;
|
|
67
|
-
block-size: 1.5rem;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
77
|
:where([data-nk="switch"] [data-slot="switch-label-text"]) {
|
|
71
78
|
display: block;
|
|
72
79
|
grid-column: 2;
|
|
@@ -75,77 +82,68 @@
|
|
|
75
82
|
:where([data-nk="switch"] > [data-slot="switch-description"]) {
|
|
76
83
|
display: block;
|
|
77
84
|
margin-block-start: var(--nk-space);
|
|
78
|
-
padding-inline-start: calc(
|
|
85
|
+
padding-inline-start: calc(
|
|
86
|
+
var(--_nk-switch-track-size) + (var(--nk-space) * 3)
|
|
87
|
+
);
|
|
79
88
|
color: var(--nk-color-muted-foreground);
|
|
80
89
|
font-size: var(--nk-text-sm);
|
|
81
90
|
font-weight: var(--nk-font-weight-normal);
|
|
82
91
|
text-wrap: pretty;
|
|
83
92
|
}
|
|
84
|
-
|
|
85
|
-
:where(
|
|
86
|
-
[data-nk="switch"][data-size="lg"] > [data-slot="switch-description"]
|
|
87
|
-
) {
|
|
88
|
-
padding-inline-start: calc(3.25rem + (var(--nk-space) * 3));
|
|
89
|
-
}
|
|
90
93
|
}
|
|
91
94
|
|
|
92
95
|
@layer nitro-kit.state {
|
|
93
96
|
:where(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
97
|
+
[data-nk="switch"]
|
|
98
|
+
[data-slot="switch-control"]:checked
|
|
99
|
+
+ [data-slot="switch-track"]
|
|
100
|
+
) {
|
|
98
101
|
background: var(--nk-color-primary);
|
|
99
102
|
border-color: var(--nk-color-primary);
|
|
100
103
|
}
|
|
101
104
|
|
|
102
105
|
:where(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
transform: translateX(
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
:where(
|
|
112
|
-
[data-nk="switch"][data-size="lg"]
|
|
113
|
-
[data-slot="switch-control"]:checked
|
|
114
|
-
+ [data-slot="switch-track"]
|
|
115
|
-
> [data-slot="switch-handle"]
|
|
116
|
-
) {
|
|
117
|
-
transform: translateX(1.25rem);
|
|
106
|
+
[data-nk="switch"]
|
|
107
|
+
[data-slot="switch-control"]:checked
|
|
108
|
+
+ [data-slot="switch-track"]
|
|
109
|
+
> [data-slot="switch-handle"]
|
|
110
|
+
) {
|
|
111
|
+
transform: translateX(var(--_nk-switch-travel));
|
|
118
112
|
}
|
|
119
113
|
|
|
120
114
|
:where(
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
115
|
+
[data-nk="switch"]
|
|
116
|
+
[data-slot="switch-control"]:focus-visible
|
|
117
|
+
+ [data-slot="switch-track"]
|
|
118
|
+
) {
|
|
125
119
|
outline: var(--nk-focus-width) solid var(--nk-color-focus);
|
|
126
120
|
outline-offset: var(--nk-focus-offset);
|
|
127
121
|
}
|
|
128
122
|
|
|
129
123
|
:where([data-nk="switch"][data-disabled="true"]) {
|
|
130
124
|
cursor: not-allowed;
|
|
131
|
-
opacity:
|
|
125
|
+
opacity: var(--nk-disabled-opacity);
|
|
132
126
|
}
|
|
133
127
|
|
|
128
|
+
/* The server error describes the submitted value. Once the user toggles the
|
|
129
|
+
control and it satisfies its own constraints the error is stale, so the
|
|
130
|
+
destructive border stands down. `:user-valid` never matches before the user
|
|
131
|
+
touches the control, so an untouched invalid switch keeps its border. */
|
|
134
132
|
:where(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
border-color: var(--nk-color-
|
|
133
|
+
[data-nk="switch"]
|
|
134
|
+
[data-slot="switch-control"][aria-invalid="true"]:not(:user-valid)
|
|
135
|
+
+ [data-slot="switch-track"]
|
|
136
|
+
) {
|
|
137
|
+
border-color: var(--nk-color-destructive);
|
|
140
138
|
}
|
|
141
139
|
}
|
|
142
140
|
|
|
143
141
|
@media (prefers-reduced-motion: reduce) {
|
|
144
142
|
@layer nitro-kit.base {
|
|
145
143
|
:where(
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
144
|
+
[data-nk="switch"] [data-slot="switch-track"],
|
|
145
|
+
[data-nk="switch"] [data-slot="switch-handle"]
|
|
146
|
+
) {
|
|
149
147
|
transition-duration: 0.01ms;
|
|
150
148
|
}
|
|
151
149
|
}
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
inline-size: 100%;
|
|
4
4
|
overflow-x: auto;
|
|
5
5
|
color: var(--nk-color-foreground);
|
|
6
|
+
scrollbar-width: thin;
|
|
7
|
+
scrollbar-color: var(--nk-color-border) transparent;
|
|
6
8
|
-webkit-overflow-scrolling: touch;
|
|
7
9
|
}
|
|
8
10
|
|
|
@@ -22,12 +24,14 @@
|
|
|
22
24
|
border-block-end: var(--nk-border-width) solid var(--nk-color-border);
|
|
23
25
|
}
|
|
24
26
|
|
|
27
|
+
/* min-block-size is undefined on table cells, so the 40px minimum comes
|
|
28
|
+
from padding around a single line box instead. */
|
|
25
29
|
:where(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
padding: calc(var(--nk-space) * 2);
|
|
30
|
+
[data-nk="table"] [data-slot="table-header"],
|
|
31
|
+
[data-nk="table"] [data-slot="table-cell"]
|
|
32
|
+
) {
|
|
33
|
+
padding-block: calc((var(--nk-control-height-md) - 1lh) / 2);
|
|
34
|
+
padding-inline: calc(var(--nk-space) * 2);
|
|
31
35
|
text-align: start;
|
|
32
36
|
vertical-align: middle;
|
|
33
37
|
}
|
|
@@ -42,41 +46,45 @@
|
|
|
42
46
|
align-items: center;
|
|
43
47
|
min-block-size: var(--nk-control-height-md);
|
|
44
48
|
gap: calc(var(--nk-space) * 1.5);
|
|
45
|
-
margin-block: calc(var(--nk-
|
|
46
|
-
padding-block: calc(var(--nk-
|
|
49
|
+
margin-block: calc((var(--nk-control-height-md) - 1lh) / -2);
|
|
50
|
+
padding-block: calc((var(--nk-control-height-md) - 1lh) / 2);
|
|
47
51
|
color: inherit;
|
|
48
52
|
text-decoration: none;
|
|
49
53
|
}
|
|
50
54
|
|
|
55
|
+
/* Half-strength through the color channel rather than opacity, so the
|
|
56
|
+
dimming is one declaration and never cascades into descendants. */
|
|
51
57
|
:where([data-nk="table"] [data-slot="table-sort-indicator"]) {
|
|
52
|
-
color:
|
|
53
|
-
|
|
58
|
+
color: color-mix(
|
|
59
|
+
in oklab,
|
|
60
|
+
var(--nk-color-muted-foreground) 50%,
|
|
61
|
+
transparent
|
|
62
|
+
);
|
|
54
63
|
}
|
|
55
64
|
}
|
|
56
65
|
|
|
57
66
|
@layer nitro-kit.state {
|
|
58
67
|
:where(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
[data-nk="table"]
|
|
69
|
+
[data-slot="table-header"]:is(
|
|
70
|
+
[aria-sort="ascending"],
|
|
71
|
+
[aria-sort="descending"]
|
|
72
|
+
)
|
|
73
|
+
[data-slot="table-sort"]
|
|
74
|
+
) {
|
|
66
75
|
color: var(--nk-color-foreground);
|
|
67
76
|
font-weight: var(--nk-font-weight-semibold);
|
|
68
77
|
}
|
|
69
78
|
|
|
70
79
|
:where(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
80
|
+
[data-nk="table"]
|
|
81
|
+
[data-slot="table-header"]:is(
|
|
82
|
+
[aria-sort="ascending"],
|
|
83
|
+
[aria-sort="descending"]
|
|
84
|
+
)
|
|
85
|
+
[data-slot="table-sort-indicator"]
|
|
86
|
+
) {
|
|
78
87
|
color: var(--nk-color-primary);
|
|
79
|
-
opacity: 1;
|
|
80
88
|
}
|
|
81
89
|
|
|
82
90
|
@media (hover: hover) {
|
|
@@ -85,11 +93,11 @@
|
|
|
85
93
|
}
|
|
86
94
|
|
|
87
95
|
:where(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
96
|
+
[data-nk="table"]
|
|
97
|
+
[data-slot="table-sort"]:hover
|
|
98
|
+
[data-slot="table-sort-indicator"]
|
|
99
|
+
) {
|
|
100
|
+
color: var(--nk-color-muted-foreground);
|
|
93
101
|
}
|
|
94
102
|
}
|
|
95
103
|
|
|
@@ -101,15 +109,15 @@
|
|
|
101
109
|
|
|
102
110
|
@layer nitro-kit.compound {
|
|
103
111
|
:where(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
112
|
+
[data-nk="table"] [data-slot="table-header"][data-align="center"],
|
|
113
|
+
[data-nk="table"] [data-slot="table-cell"][data-align="center"]
|
|
114
|
+
) {
|
|
107
115
|
text-align: center;
|
|
108
116
|
}
|
|
109
117
|
:where(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
118
|
+
[data-nk="table"] [data-slot="table-header"][data-align="right"],
|
|
119
|
+
[data-nk="table"] [data-slot="table-cell"][data-align="right"]
|
|
120
|
+
) {
|
|
113
121
|
font-variant-numeric: tabular-nums;
|
|
114
122
|
text-align: right;
|
|
115
123
|
}
|
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
@layer nitro-kit.base {
|
|
2
2
|
:where([data-nk="tabs"]) {
|
|
3
|
-
|
|
3
|
+
inline-size: 100%;
|
|
4
4
|
color: var(--nk-color-foreground);
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
:where([data-nk="tabs"] > [data-slot="tabs-list"]) {
|
|
8
8
|
display: flex;
|
|
9
|
-
max-
|
|
9
|
+
max-inline-size: 100%;
|
|
10
10
|
overflow-x: auto;
|
|
11
11
|
border-block-end: var(--nk-border-width) solid var(--nk-color-border);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
:where([data-nk="tabs"] > [data-slot="tabs-list"] > [data-slot="tabs-tab"]) {
|
|
15
|
-
display:
|
|
16
|
-
min-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
display: block;
|
|
16
|
+
min-inline-size: 0;
|
|
17
|
+
min-block-size: var(--nk-control-height-md);
|
|
18
|
+
align-content: center;
|
|
19
19
|
padding: calc(var(--nk-space) * 2) calc(var(--nk-space) * 3);
|
|
20
20
|
font: inherit;
|
|
21
21
|
font-weight: var(--nk-font-weight-medium);
|
|
22
22
|
color: var(--nk-color-muted-foreground);
|
|
23
|
+
text-align: center;
|
|
23
24
|
white-space: nowrap;
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
text-overflow: ellipsis;
|
|
24
27
|
cursor: pointer;
|
|
25
28
|
background: transparent;
|
|
26
29
|
border: 0;
|
|
@@ -34,6 +37,10 @@
|
|
|
34
37
|
padding-block: calc(var(--nk-space) * 4);
|
|
35
38
|
line-height: var(--nk-leading-normal);
|
|
36
39
|
}
|
|
40
|
+
|
|
41
|
+
:where([data-nk="tabs"] > [data-slot="tabs-panel"][hidden="until-found"]) {
|
|
42
|
+
padding-block: 0;
|
|
43
|
+
}
|
|
37
44
|
}
|
|
38
45
|
|
|
39
46
|
@layer nitro-kit.variant {
|
|
@@ -44,8 +51,8 @@
|
|
|
44
51
|
}
|
|
45
52
|
|
|
46
53
|
:where(
|
|
47
|
-
|
|
48
|
-
|
|
54
|
+
[data-nk="tabs"][data-orientation="vertical"] > [data-slot="tabs-list"]
|
|
55
|
+
) {
|
|
49
56
|
flex-direction: column;
|
|
50
57
|
grid-column: 1;
|
|
51
58
|
grid-row: 1;
|
|
@@ -56,27 +63,26 @@
|
|
|
56
63
|
}
|
|
57
64
|
|
|
58
65
|
:where(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
justify-content: flex-start;
|
|
66
|
+
[data-nk="tabs"][data-orientation="vertical"]
|
|
67
|
+
> [data-slot="tabs-list"]
|
|
68
|
+
> [data-slot="tabs-tab"]
|
|
69
|
+
) {
|
|
64
70
|
text-align: start;
|
|
65
71
|
border-block-end: 0;
|
|
66
72
|
border-inline-end: var(--nk-focus-width) solid transparent;
|
|
67
73
|
}
|
|
68
74
|
|
|
69
75
|
:where(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
[data-nk="tabs"][data-orientation="vertical"]
|
|
77
|
+
> [data-slot="tabs-list"]
|
|
78
|
+
> [data-slot="tabs-tab"][aria-selected="true"]
|
|
79
|
+
) {
|
|
74
80
|
border-inline-end-color: var(--nk-color-primary);
|
|
75
81
|
}
|
|
76
82
|
|
|
77
83
|
:where(
|
|
78
|
-
|
|
79
|
-
|
|
84
|
+
[data-nk="tabs"][data-orientation="vertical"] > [data-slot="tabs-panel"]
|
|
85
|
+
) {
|
|
80
86
|
grid-column: 2;
|
|
81
87
|
grid-row: 1;
|
|
82
88
|
padding-block-start: calc(var(--nk-space) * 2);
|
|
@@ -86,52 +92,54 @@
|
|
|
86
92
|
@layer nitro-kit.state {
|
|
87
93
|
@media (hover: hover) {
|
|
88
94
|
:where(
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
95
|
+
[data-nk="tabs"]
|
|
96
|
+
> [data-slot="tabs-list"]
|
|
97
|
+
> [data-slot="tabs-tab"]:hover:not(:disabled)
|
|
98
|
+
) {
|
|
93
99
|
color: var(--nk-color-foreground);
|
|
94
100
|
}
|
|
95
101
|
}
|
|
96
102
|
|
|
97
103
|
:where(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
104
|
+
[data-nk="tabs"]
|
|
105
|
+
> [data-slot="tabs-list"]
|
|
106
|
+
> [data-slot="tabs-tab"][aria-selected="true"]
|
|
107
|
+
) {
|
|
102
108
|
color: var(--nk-color-foreground);
|
|
103
109
|
border-block-end-color: var(--nk-color-primary);
|
|
104
110
|
}
|
|
105
111
|
|
|
106
112
|
:where(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
113
|
+
[data-nk="tabs"][data-orientation="vertical"]
|
|
114
|
+
> [data-slot="tabs-list"]
|
|
115
|
+
> [data-slot="tabs-tab"][aria-selected="true"]
|
|
116
|
+
) {
|
|
111
117
|
border-block-end-color: transparent;
|
|
112
118
|
}
|
|
113
119
|
|
|
114
120
|
:where(
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
121
|
+
[data-nk="tabs"]
|
|
122
|
+
> [data-slot="tabs-list"]
|
|
123
|
+
> [data-slot="tabs-tab"]:focus-visible
|
|
124
|
+
) {
|
|
119
125
|
outline: var(--nk-focus-width) solid var(--nk-color-focus);
|
|
120
126
|
outline-offset: calc(var(--nk-focus-offset) * -1);
|
|
121
127
|
}
|
|
122
128
|
|
|
123
129
|
:where(
|
|
124
|
-
|
|
125
|
-
|
|
130
|
+
[data-nk="tabs"]
|
|
131
|
+
> [data-slot="tabs-list"]
|
|
132
|
+
> [data-slot="tabs-tab"]:disabled
|
|
133
|
+
) {
|
|
126
134
|
color: var(--nk-color-muted-foreground);
|
|
127
135
|
cursor: not-allowed;
|
|
128
|
-
opacity:
|
|
136
|
+
opacity: var(--nk-disabled-opacity);
|
|
129
137
|
}
|
|
130
138
|
|
|
131
139
|
@media (prefers-reduced-motion: reduce) {
|
|
132
140
|
:where(
|
|
133
|
-
|
|
134
|
-
|
|
141
|
+
[data-nk="tabs"] > [data-slot="tabs-list"] > [data-slot="tabs-tab"]
|
|
142
|
+
) {
|
|
135
143
|
transition-duration: 0.01ms;
|
|
136
144
|
}
|
|
137
145
|
}
|
|
@@ -2,19 +2,34 @@
|
|
|
2
2
|
:where([data-nk="textarea"]) {
|
|
3
3
|
display: block;
|
|
4
4
|
inline-size: 100%;
|
|
5
|
-
min-block-size:
|
|
6
|
-
padding: calc(var(--nk-space) * 2)
|
|
5
|
+
min-block-size: calc(var(--nk-space) * 24);
|
|
6
|
+
padding-block: calc(var(--nk-space) * 2);
|
|
7
|
+
padding-inline: var(--nk-control-padding-inline);
|
|
7
8
|
color: var(--nk-color-foreground);
|
|
8
9
|
font: inherit;
|
|
10
|
+
font-size: var(--nk-text-base);
|
|
9
11
|
line-height: var(--nk-leading-normal);
|
|
10
12
|
resize: vertical;
|
|
11
13
|
background: var(--nk-color-surface);
|
|
12
14
|
border: var(--nk-border-width) solid var(--nk-color-border);
|
|
13
|
-
border-radius: var(--nk-radius-
|
|
15
|
+
border-radius: var(--nk-radius-lg);
|
|
14
16
|
transition:
|
|
15
17
|
border-color var(--nk-duration-normal) var(--nk-ease),
|
|
16
18
|
box-shadow var(--nk-duration-normal) var(--nk-ease);
|
|
17
19
|
}
|
|
20
|
+
|
|
21
|
+
/* Matches the Input width split. */
|
|
22
|
+
@media (min-width: 48rem) {
|
|
23
|
+
:where([data-nk="textarea"]) {
|
|
24
|
+
font-size: var(--nk-text-sm);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@media (prefers-reduced-motion: reduce) {
|
|
29
|
+
:where([data-nk="textarea"]) {
|
|
30
|
+
transition-duration: 0.01ms;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
18
33
|
}
|
|
19
34
|
|
|
20
35
|
@layer nitro-kit.state {
|
|
@@ -30,10 +45,10 @@
|
|
|
30
45
|
|
|
31
46
|
:where([data-nk="textarea"]:disabled) {
|
|
32
47
|
cursor: not-allowed;
|
|
33
|
-
opacity:
|
|
48
|
+
opacity: var(--nk-disabled-opacity);
|
|
34
49
|
}
|
|
35
50
|
|
|
36
51
|
:where([data-nk="textarea"][aria-invalid="true"]) {
|
|
37
|
-
border-color: var(--nk-color-
|
|
52
|
+
border-color: var(--nk-color-destructive);
|
|
38
53
|
}
|
|
39
54
|
}
|