@vokality/design-system 5.1.2 → 6.0.0
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.
- package/CHANGELOG.md +7 -0
- package/README.md +22 -1
- package/dist/appearance.d.ts +6 -0
- package/dist/appearance.js +1 -0
- package/dist/chat.d.ts +3 -1
- package/dist/components/Accordion/Accordion.d.ts +9 -6
- package/dist/components/Accordion/Accordion.js +4 -8
- package/dist/components/AppShell/AppShell.js +1 -1
- package/dist/components/Badge/Badge.d.ts +5 -1
- package/dist/components/Badge/Badge.js +2 -2
- package/dist/components/Button/Button.d.ts +11 -10
- package/dist/components/Button/Button.js +6 -14
- package/dist/components/ChatPanel/transcript.js +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.js +2 -2
- package/dist/components/Combobox/Combobox.d.ts +3 -0
- package/dist/components/Combobox/Combobox.js +3 -3
- package/dist/components/Combobox/ListPanel.d.ts +3 -1
- package/dist/components/Combobox/ListPanel.js +2 -2
- package/dist/components/Container/Container.d.ts +7 -4
- package/dist/components/Container/Container.js +3 -4
- package/dist/components/DatePicker/DatePicker.d.ts +3 -0
- package/dist/components/DatePicker/DatePicker.js +3 -3
- package/dist/components/Dialog/Dialog.d.ts +2 -4
- package/dist/components/Dialog/Dialog.js +2 -3
- package/dist/components/Grid/Grid.d.ts +3 -3
- package/dist/components/Heading/Heading.d.ts +14 -9
- package/dist/components/Heading/Heading.js +6 -5
- package/dist/components/IconButton/IconButton.d.ts +7 -7
- package/dist/components/IconButton/IconButton.js +2 -10
- package/dist/components/Inline/Inline.d.ts +2 -2
- package/dist/components/Input/Input.d.ts +6 -1
- package/dist/components/Input/Input.js +3 -3
- package/dist/components/Link/Link.d.ts +18 -3
- package/dist/components/Link/Link.js +7 -7
- package/dist/components/Menu/Menu.d.ts +27 -8
- package/dist/components/Menu/Menu.js +6 -11
- package/dist/components/MultiSelect/MultiSelect.d.ts +3 -0
- package/dist/components/MultiSelect/MultiSelect.js +3 -3
- package/dist/components/OtpInput/OtpInput.d.ts +16 -15
- package/dist/components/OtpInput/OtpInput.js +10 -8
- package/dist/components/PageHeader/PageHeader.d.ts +2 -2
- package/dist/components/PageHeader/PageHeader.js +2 -2
- package/dist/components/Popover/Popover.d.ts +16 -7
- package/dist/components/Popover/Popover.js +4 -3
- package/dist/components/Progress/Progress.d.ts +10 -10
- package/dist/components/Progress/Progress.js +8 -12
- package/dist/components/Prose/Prose.d.ts +4 -3
- package/dist/components/Prose/Prose.js +2 -2
- package/dist/components/Radio/Radio.d.ts +3 -3
- package/dist/components/Radio/Radio.js +4 -3
- package/dist/components/RadioGroup/RadioGroup.d.ts +7 -2
- package/dist/components/RadioGroup/RadioGroup.js +2 -2
- package/dist/components/SearchInput/SearchInput.d.ts +6 -1
- package/dist/components/SearchInput/SearchInput.js +2 -2
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +8 -8
- package/dist/components/SegmentedControl/SegmentedControl.js +4 -3
- package/dist/components/Select/Select.d.ts +4 -9
- package/dist/components/Select/Select.js +2 -7
- package/dist/components/Slider/Slider.d.ts +26 -19
- package/dist/components/Slider/Slider.js +20 -25
- package/dist/components/Sparkline/Sparkline.d.ts +2 -2
- package/dist/components/Sparkline/Sparkline.js +3 -3
- package/dist/components/Stack/Stack.d.ts +2 -2
- package/dist/components/Switch/Switch.d.ts +1 -1
- package/dist/components/Switch/Switch.js +2 -2
- package/dist/components/Table/Table.js +1 -1
- package/dist/components/Tabs/Tabs.d.ts +11 -9
- package/dist/components/Tabs/Tabs.js +5 -5
- package/dist/components/Text/Text.d.ts +12 -5
- package/dist/components/Text/Text.js +3 -3
- package/dist/components/Textarea/Textarea.d.ts +2 -0
- package/dist/components/Textarea/Textarea.js +3 -3
- package/dist/components/TimePicker/TimePicker.d.ts +2 -0
- package/dist/components/TimePicker/TimePicker.js +5 -5
- package/dist/components/Tooltip/Tooltip.d.ts +11 -6
- package/dist/components/Tooltip/Tooltip.js +5 -3
- package/dist/components.css +273 -129
- package/dist/internal/choice.d.ts +7 -2
- package/dist/internal/choice.js +4 -4
- package/dist/lib/space.d.ts +2 -1
- package/dist/lib/space.js +2 -6
- package/dist/tokens.css +2 -0
- package/dist/tokens.dtcg.json +10 -0
- package/dist/tokens.json +10 -0
- package/dist/types.d.ts +4 -3
- package/dist/typography.d.ts +8 -0
- package/dist/typography.js +34 -0
- package/dist/vokality.css +275 -129
- package/dist/vokality.iife.js +1945 -1863
- package/docs/brand.md +6 -2
- package/docs/components/Accordion/README.md +5 -2
- package/docs/components/Badge/README.md +2 -2
- package/docs/components/Button/README.md +15 -11
- package/docs/components/Checkbox/README.md +4 -0
- package/docs/components/Combobox/README.md +6 -0
- package/docs/components/Container/README.md +2 -1
- package/docs/components/DatePicker/README.md +6 -0
- package/docs/components/Dialog/README.md +2 -2
- package/docs/components/Grid/README.md +2 -1
- package/docs/components/Heading/README.md +4 -2
- package/docs/components/IconButton/README.md +7 -3
- package/docs/components/Inline/README.md +3 -3
- package/docs/components/Input/README.md +6 -0
- package/docs/components/Link/README.md +3 -1
- package/docs/components/Menu/README.md +7 -1
- package/docs/components/MultiSelect/README.md +8 -0
- package/docs/components/NumberInput/README.md +6 -0
- package/docs/components/OtpInput/README.md +10 -2
- package/docs/components/PageHeader/README.md +1 -1
- package/docs/components/PasswordInput/README.md +6 -0
- package/docs/components/Popover/README.md +6 -2
- package/docs/components/Progress/README.md +2 -2
- package/docs/components/Prose/README.md +1 -1
- package/docs/components/Radio/README.md +4 -0
- package/docs/components/RadioGroup/README.md +4 -0
- package/docs/components/SearchInput/README.md +6 -0
- package/docs/components/SegmentedControl/README.md +4 -1
- package/docs/components/Select/README.md +8 -3
- package/docs/components/Slider/README.md +13 -3
- package/docs/components/Sparkline/README.md +1 -1
- package/docs/components/Stack/README.md +1 -1
- package/docs/components/Switch/README.md +4 -0
- package/docs/components/Tabs/README.md +3 -1
- package/docs/components/Text/README.md +6 -3
- package/docs/components/Textarea/README.md +4 -0
- package/docs/components/ThemeProvider/README.md +1 -1
- package/docs/components/TimePicker/README.md +6 -0
- package/docs/components/Tooltip/README.md +4 -3
- package/package.json +9 -1
- package/skills/vokality-design-system/SKILL.md +1 -1
package/dist/components.css
CHANGED
|
@@ -34,7 +34,7 @@ body {
|
|
|
34
34
|
/* Icon */
|
|
35
35
|
.vk-icon { display: block; flex-shrink: 0; }
|
|
36
36
|
|
|
37
|
-
/*
|
|
37
|
+
/* Native action button; appearance is shared through data-vk-color and data-vk-variant. */
|
|
38
38
|
.vk-btn {
|
|
39
39
|
display: inline-flex;
|
|
40
40
|
align-items: stretch;
|
|
@@ -49,6 +49,7 @@ body {
|
|
|
49
49
|
letter-spacing: 0.14em;
|
|
50
50
|
text-transform: uppercase;
|
|
51
51
|
line-height: 1.25;
|
|
52
|
+
border: 1px solid transparent;
|
|
52
53
|
border-radius: var(--radius, 0);
|
|
53
54
|
text-decoration: none;
|
|
54
55
|
cursor: pointer;
|
|
@@ -57,82 +58,40 @@ body {
|
|
|
57
58
|
color var(--motion-normal) var(--ease-standard);
|
|
58
59
|
}
|
|
59
60
|
.vk-btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }
|
|
60
|
-
.vk-btn-primary {
|
|
61
|
-
font-weight: 700;
|
|
62
|
-
color: var(--primary-foreground);
|
|
63
|
-
background: var(--primary);
|
|
64
|
-
border: 1px solid var(--primary);
|
|
65
|
-
}
|
|
66
|
-
.vk-btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
|
|
67
|
-
.vk-btn-outline {
|
|
68
|
-
font-weight: 600;
|
|
69
|
-
color: var(--foreground);
|
|
70
|
-
background: transparent;
|
|
71
|
-
border: 1px solid var(--primary);
|
|
72
|
-
}
|
|
73
|
-
.vk-btn-outline:hover { background: var(--primary-tint); border-color: var(--primary-hover); }
|
|
74
|
-
.vk-btn-ghost {
|
|
75
|
-
font-weight: 600;
|
|
76
|
-
color: var(--foreground);
|
|
77
|
-
background: transparent;
|
|
78
|
-
border: 1px solid transparent;
|
|
79
|
-
}
|
|
80
|
-
.vk-btn-ghost:hover { background: var(--primary-tint); }
|
|
81
|
-
.vk-btn-sm { min-height: var(--button-height-sm, 32px); font-size: 0.6875rem; }
|
|
82
|
-
.vk-btn-sm .vk-btn-label { padding: 0.4rem 0.75rem 0.4rem 0.85rem; }
|
|
83
|
-
.vk-btn-sm .vk-btn-label:only-child { padding-right: 0.85rem; }
|
|
84
|
-
.vk-btn-sm .vk-btn-glyph { width: 1.85rem; }
|
|
85
61
|
.vk-btn-label { display: inline-flex; align-items: center; padding: 0.65rem 1.1rem 0.65rem 1.25rem; }
|
|
86
62
|
.vk-btn-label:only-child { padding-right: 1.25rem; }
|
|
87
|
-
.vk-btn-glyph {
|
|
88
|
-
|
|
89
|
-
align-items: center;
|
|
90
|
-
justify-content: center;
|
|
91
|
-
align-self: stretch;
|
|
92
|
-
width: 2.25rem;
|
|
93
|
-
flex-shrink: 0;
|
|
94
|
-
}
|
|
95
|
-
.vk-btn-outline .vk-btn-glyph { color: var(--primary); }
|
|
96
|
-
.vk-btn-outline:hover .vk-btn-glyph { color: var(--primary-hover); }
|
|
97
|
-
@media (max-width: 40rem) {
|
|
98
|
-
.vk-btn { width: 100%; justify-content: space-between; }
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/* A named record can be an action without adopting an uppercase action label. */
|
|
102
|
-
.vk-btn-text {
|
|
63
|
+
.vk-btn-glyph { display: flex; align-items: center; justify-content: center; align-self: stretch; width: 2.25rem; flex-shrink: 0; }
|
|
64
|
+
.vk-btn[data-vk-variant="text"] {
|
|
103
65
|
width: auto;
|
|
104
|
-
min-height: var(--button-height-sm);
|
|
66
|
+
min-height: var(--button-height-sm, 32px);
|
|
105
67
|
justify-content: flex-start;
|
|
106
68
|
font-size: var(--text-sm);
|
|
107
69
|
font-weight: 500;
|
|
108
70
|
letter-spacing: normal;
|
|
109
71
|
text-transform: none;
|
|
110
72
|
text-align: left;
|
|
111
|
-
color: var(--foreground);
|
|
112
|
-
background: transparent;
|
|
113
|
-
border: 1px solid transparent;
|
|
114
73
|
}
|
|
115
|
-
.vk-btn-
|
|
116
|
-
|
|
117
|
-
.vk-btn-text .vk-btn-glyph { width: auto; padding-left: var(--space-xs); }
|
|
118
|
-
.vk-btn-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
color: var(--muted-subtle);
|
|
126
|
-
background: transparent;
|
|
127
|
-
text-decoration: none;
|
|
74
|
+
.vk-btn[data-vk-variant="text"] .vk-btn-label,
|
|
75
|
+
.vk-btn[data-vk-variant="text"] .vk-btn-label:only-child { padding: var(--space-xs) 0; }
|
|
76
|
+
.vk-btn[data-vk-variant="text"] .vk-btn-glyph { width: auto; padding-left: var(--space-xs); }
|
|
77
|
+
.vk-btn[data-vk-size="sm"] { font-size: 0.6875rem; }
|
|
78
|
+
.vk-btn[data-vk-size="sm"] .vk-btn-label { padding: 0.4rem 0.75rem 0.4rem 0.85rem; }
|
|
79
|
+
.vk-btn[data-vk-size="sm"] .vk-btn-label:only-child { padding-right: 0.85rem; }
|
|
80
|
+
.vk-btn[data-vk-size="sm"] .vk-btn-glyph { width: 1.85rem; }
|
|
81
|
+
.vk-btn[data-vk-variant="text"][data-vk-size="sm"] { font-size: var(--text-sm); }
|
|
82
|
+
@media (max-width: 40rem) {
|
|
83
|
+
.vk-btn:not([data-vk-variant="text"]):not([data-vk-size="xs"]) { width: 100%; justify-content: space-between; }
|
|
128
84
|
}
|
|
129
|
-
|
|
130
|
-
.vk-btn
|
|
131
|
-
.vk-btn-
|
|
132
|
-
|
|
133
|
-
.vk-btn
|
|
85
|
+
@media (pointer: fine) and (not (any-pointer: coarse)) {
|
|
86
|
+
.vk-btn[data-vk-size="xs"] { width: auto; font-size: 0.6875rem; }
|
|
87
|
+
.vk-btn[data-vk-size="xs"] .vk-btn-label,
|
|
88
|
+
.vk-btn[data-vk-size="xs"] .vk-btn-label:only-child { padding: 0 var(--space-sm); }
|
|
89
|
+
.vk-btn[data-vk-size="xs"] .vk-btn-glyph { width: var(--control-height); }
|
|
90
|
+
.vk-btn[data-vk-variant="text"][data-vk-size="xs"] { font-size: var(--text-xs); }
|
|
91
|
+
.vk-btn[data-vk-variant="text"][data-vk-size="xs"] .vk-btn-label,
|
|
92
|
+
.vk-btn[data-vk-variant="text"][data-vk-size="xs"] .vk-btn-label:only-child { padding: 0; }
|
|
93
|
+
.vk-btn[data-vk-variant="text"][data-vk-size="xs"] .vk-btn-glyph { width: auto; }
|
|
134
94
|
}
|
|
135
|
-
|
|
136
95
|
/* Square glyph */
|
|
137
96
|
@keyframes vk-glyph-blink {
|
|
138
97
|
0%, 72%, 100% { opacity: 1; filter: brightness(1); }
|
|
@@ -499,7 +458,7 @@ body {
|
|
|
499
458
|
color: var(--foreground);
|
|
500
459
|
}
|
|
501
460
|
|
|
502
|
-
/*
|
|
461
|
+
/* Native square action button. */
|
|
503
462
|
.vk-icon-btn {
|
|
504
463
|
display: inline-flex;
|
|
505
464
|
align-items: center;
|
|
@@ -508,26 +467,14 @@ body {
|
|
|
508
467
|
width: var(--button-height, 40px);
|
|
509
468
|
height: var(--button-height, 40px);
|
|
510
469
|
padding: 0;
|
|
511
|
-
color: var(--foreground);
|
|
512
|
-
background: transparent;
|
|
513
470
|
border: 1px solid transparent;
|
|
514
471
|
border-radius: var(--radius, 0);
|
|
515
472
|
cursor: pointer;
|
|
516
473
|
text-decoration: none;
|
|
517
474
|
transition: color var(--motion-fast) var(--ease-standard), background var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard);
|
|
518
475
|
}
|
|
519
|
-
.vk-icon-btn:hover { background: var(--primary-tint); }
|
|
520
|
-
.vk-icon-btn-outline { border-color: var(--muted-subtle); }
|
|
521
|
-
.vk-icon-btn-outline:hover { border-color: var(--primary-hover); }
|
|
522
476
|
.vk-icon-btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
|
|
523
|
-
|
|
524
|
-
.vk-icon-btn:disabled { cursor: not-allowed; color: var(--muted-subtle); background: transparent; }
|
|
525
|
-
.vk-icon-btn-outline:disabled { border-style: dashed; border-color: var(--muted-subtle); }
|
|
526
|
-
@media (forced-colors: active) {
|
|
527
|
-
.vk-icon-btn:disabled { color: GrayText; }
|
|
528
|
-
.vk-icon-btn-outline:disabled { border-color: GrayText; }
|
|
529
|
-
}
|
|
530
|
-
|
|
477
|
+
.vk-icon-btn[data-vk-size="xs"] .vk-icon { width: 16px; height: 16px; }
|
|
531
478
|
/* Dismiss and remove buttons inside alerts, toasts and upload rows keep a 16px glyph. */
|
|
532
479
|
.vk-alert-close .vk-icon, .vk-upload-item .vk-icon-btn .vk-icon { width: 16px; height: 16px; }
|
|
533
480
|
/* Link */
|
|
@@ -544,9 +491,15 @@ body {
|
|
|
544
491
|
}
|
|
545
492
|
.vk-link:hover { color: var(--primary-hover); text-decoration-color: currentColor; }
|
|
546
493
|
.vk-link:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
|
|
547
|
-
.vk-link-
|
|
494
|
+
.vk-link:not([data-vk-variant]) { color: var(--vk-color-fg); }
|
|
495
|
+
.vk-link[data-vk-color="neutral"].vk-emphasis-muted:not([data-vk-variant]) { color: var(--muted-foreground); text-decoration-color: currentColor; }
|
|
496
|
+
.vk-link[data-vk-color="neutral"].vk-emphasis-subtle:not([data-vk-variant]) { color: var(--muted-subtle); text-decoration-color: currentColor; }
|
|
497
|
+
.vk-link.vk-btn { text-decoration: none; align-items: stretch; gap: 0; }
|
|
498
|
+
.vk-link.vk-btn .vk-btn-label { gap: var(--space-xs); align-items: center; }
|
|
548
499
|
.vk-link-icon { align-self: center; }
|
|
549
500
|
|
|
501
|
+
|
|
502
|
+
.vk-link:not([data-vk-variant]):hover { color: var(--vk-color-hover); text-decoration-color: currentColor; }
|
|
550
503
|
/* Form fields */
|
|
551
504
|
.vk-field { display: grid; gap: 0.4rem; min-width: 0; }
|
|
552
505
|
.vk-field-optional { font-weight: 500; letter-spacing: 0.04em; text-transform: none; color: var(--muted-subtle); }
|
|
@@ -769,6 +722,25 @@ textarea.vk-input, .vk-textarea { resize: vertical; min-height: 8rem; padding-bl
|
|
|
769
722
|
/* Checkbox glyphs follow the state supplied by Radix. */
|
|
770
723
|
.vk-choice-box:not([data-state="indeterminate"]) .vk-choice-dash,
|
|
771
724
|
.vk-choice-box[data-state="indeterminate"] .vk-choice-check { display: none; }
|
|
725
|
+
|
|
726
|
+
/* Explicit appearance belongs to the styled label; Radix continues to own state. */
|
|
727
|
+
@media (forced-colors: none) {
|
|
728
|
+
.vk-choice[data-vk-color]:not(.vk-choice-disabled):hover :is(.vk-choice-box, .vk-switch-track) { border-color: var(--vk-color-hover); }
|
|
729
|
+
.vk-choice[data-vk-color]:not(.vk-choice-disabled) .vk-choice-box:is([data-state="checked"], [data-state="indeterminate"]),
|
|
730
|
+
.vk-choice[data-vk-color]:not(.vk-choice-disabled) .vk-choice-input:checked + .vk-choice-box { border-color: var(--vk-color-fg); }
|
|
731
|
+
.vk-choice[data-vk-color]:not(.vk-choice-disabled) .vk-choice-box:not(.vk-choice-box-radio):is([data-state="checked"], [data-state="indeterminate"]),
|
|
732
|
+
.vk-choice[data-vk-color]:not(.vk-choice-disabled) .vk-switch-track[data-state="checked"] { background: var(--vk-color-solid); border-color: var(--vk-color-solid); color: var(--vk-color-on-solid); }
|
|
733
|
+
.vk-choice[data-vk-color]:not(.vk-choice-disabled) .vk-choice-dot { background: var(--vk-color-fg); }
|
|
734
|
+
.vk-choice[data-vk-color]:not(.vk-choice-disabled) .vk-switch-thumb[data-state="checked"] { background: var(--vk-color-on-solid); }
|
|
735
|
+
}
|
|
736
|
+
.vk-choice[data-vk-size] { min-height: var(--control-height); --vk-choice-box-size: 18px; }
|
|
737
|
+
.vk-choice[data-vk-size="xs"] { --vk-choice-box-size: 14px; }
|
|
738
|
+
.vk-choice[data-vk-size="sm"] { --vk-choice-box-size: 16px; }
|
|
739
|
+
.vk-choice[data-vk-size] .vk-choice-box { width: var(--vk-choice-box-size); height: var(--vk-choice-box-size); }
|
|
740
|
+
.vk-choice[data-vk-size] :is(.vk-choice-label, .vk-choice-description) { font-size: var(--control-font-size); }
|
|
741
|
+
.vk-choice[data-vk-size] .vk-switch-track { width: calc(var(--vk-choice-box-size) * 2); height: calc(var(--vk-choice-box-size) + 2px); }
|
|
742
|
+
.vk-choice[data-vk-size] .vk-switch-thumb { width: calc(var(--vk-choice-box-size) - 4px); height: calc(var(--vk-choice-box-size) - 4px); }
|
|
743
|
+
.vk-choice[data-vk-size] .vk-switch-thumb[data-state="checked"] { transform: translateX(var(--vk-choice-box-size)); }
|
|
772
744
|
/* Tag */
|
|
773
745
|
.vk-tag {
|
|
774
746
|
display: inline-flex;
|
|
@@ -952,15 +924,12 @@ textarea.vk-input, .vk-textarea { resize: vertical; min-height: 8rem; padding-bl
|
|
|
952
924
|
.vk-day[aria-disabled="true"]:hover { border-color: transparent; }
|
|
953
925
|
.vk-day-selected[aria-disabled="true"] { color: var(--primary-foreground); border-color: var(--primary); }
|
|
954
926
|
|
|
955
|
-
/* Badge
|
|
956
|
-
.vk-badge-
|
|
957
|
-
.vk-badge-
|
|
958
|
-
.vk-badge-
|
|
959
|
-
.vk-
|
|
960
|
-
.vk-badge-danger { color: var(--danger); border-color: var(--danger-line); }
|
|
961
|
-
.vk-table .vk-icon-btn { width: var(--button-height-sm, 32px); height: var(--button-height-sm, 32px); }
|
|
927
|
+
/* Badge palettes use the shared appearance recipe. */
|
|
928
|
+
.vk-badge[data-vk-color] { color: var(--vk-color-fg); border-color: var(--vk-color-border); }
|
|
929
|
+
.vk-badge[data-vk-variant="solid"] { color: var(--vk-color-on-solid); background: var(--vk-color-solid); border-color: var(--vk-color-solid); }
|
|
930
|
+
.vk-badge[data-vk-variant="soft"] { color: var(--vk-color-on-soft); background: var(--vk-color-bg); }
|
|
931
|
+
.vk-table .vk-icon-btn:not([data-vk-size]) { width: var(--button-height-sm, 32px); height: var(--button-height-sm, 32px); }
|
|
962
932
|
.vk-table td:has(.vk-menu-root) { padding-top: 0.25rem; padding-bottom: 0.25rem; }
|
|
963
|
-
|
|
964
933
|
/* Utilities */
|
|
965
934
|
.vk-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
|
|
966
935
|
.vk-choice-mixed .vk-choice-box { background: var(--primary); border-color: var(--primary); }
|
|
@@ -1129,10 +1098,6 @@ textarea.vk-input, .vk-textarea { resize: vertical; min-height: 8rem; padding-bl
|
|
|
1129
1098
|
.vk-overlay[data-state], .vk-dialog[data-state], .vk-popover-panel[data-state], .vk-shell-scrim[data-state], .vk-shell-sidebar[data-state] { animation: none; }
|
|
1130
1099
|
}
|
|
1131
1100
|
|
|
1132
|
-
/* Danger button */
|
|
1133
|
-
.vk-btn-danger { font-weight: 700; color: var(--on-status); background: var(--danger); border: 1px solid var(--danger); }
|
|
1134
|
-
.vk-btn-danger:hover { background: color-mix(in srgb, var(--danger) 88%, var(--foreground)); }
|
|
1135
|
-
|
|
1136
1101
|
/* Tabs (Radix Tabs: data-state=active|inactive and data-disabled set by Radix) */
|
|
1137
1102
|
.vk-tablist { display: flex; gap: 1.75rem; overflow-x: auto; border-bottom: 1px solid var(--border-subtle); scrollbar-width: none; }
|
|
1138
1103
|
/* A tab list that scrolls fades the edge with more tabs behind it, since its scrollbar is hidden. */
|
|
@@ -1181,6 +1146,13 @@ textarea.vk-input, .vk-textarea { resize: vertical; min-height: 8rem; padding-bl
|
|
|
1181
1146
|
|
|
1182
1147
|
/* Radix forceMount preserves content; inactive panels remain visually and accessibly hidden. */
|
|
1183
1148
|
.vk-tabpanel[data-state="inactive"] { display: none; }
|
|
1149
|
+
|
|
1150
|
+
/* Directional keyboard behavior and the visual arrangement share Radix's orientation. */
|
|
1151
|
+
.vk-tabs[data-orientation="vertical"] { display: flex; gap: var(--space-lg); }
|
|
1152
|
+
.vk-tablist[data-orientation="vertical"] { flex-direction: column; flex-shrink: 0; gap: 0; overflow-x: visible; border-bottom: 0; border-inline-end: 1px solid var(--border-subtle); mask-image: none; animation: none; }
|
|
1153
|
+
.vk-tablist[data-orientation="vertical"] .vk-tab { padding: var(--space-sm) var(--space-md); text-align: start; }
|
|
1154
|
+
.vk-tablist[data-orientation="vertical"] .vk-tab::after { left: auto; right: auto; top: 0; bottom: 0; inset-inline-end: -1px; width: 2px; height: auto; }
|
|
1155
|
+
.vk-tabpanel[data-orientation="vertical"] { min-width: 0; padding-top: 0; }
|
|
1184
1156
|
/* Segmented control (Radix RadioGroup: each segment is an item with data-state) */
|
|
1185
1157
|
.vk-segmented { display: inline-flex; box-sizing: border-box; width: fit-content; min-width: 0; max-width: 100%; border: 1px solid var(--border-subtle); border-radius: var(--radius, 0); }
|
|
1186
1158
|
.vk-segment {
|
|
@@ -1188,7 +1160,7 @@ textarea.vk-input, .vk-textarea { resize: vertical; min-height: 8rem; padding-bl
|
|
|
1188
1160
|
align-items: center;
|
|
1189
1161
|
gap: 0.4rem;
|
|
1190
1162
|
min-width: 0;
|
|
1191
|
-
min-height:
|
|
1163
|
+
min-height: calc(var(--button-height, 40px) - 2px);
|
|
1192
1164
|
padding: 0 0.9rem;
|
|
1193
1165
|
font: inherit;
|
|
1194
1166
|
font-size: var(--text-sm);
|
|
@@ -1201,15 +1173,149 @@ textarea.vk-input, .vk-textarea { resize: vertical; min-height: 8rem; padding-bl
|
|
|
1201
1173
|
}
|
|
1202
1174
|
.vk-segment:first-child { border-left: 0; }
|
|
1203
1175
|
.vk-segment:hover { color: var(--foreground); }
|
|
1204
|
-
.vk-segment[data-state="checked"] { color: var(--foreground); background: var(--primary-tint); box-shadow: inset 0 -2px 0 var(--primary); }
|
|
1205
1176
|
.vk-segment:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; position: relative; }
|
|
1206
1177
|
.vk-segment:disabled { color: var(--muted-subtle); cursor: not-allowed; }
|
|
1207
|
-
.vk-segmented-sm .vk-segment {
|
|
1178
|
+
.vk-segmented[data-vk-size="sm"] .vk-segment { padding: 0 0.65rem; font-size: 0.8125rem; }
|
|
1179
|
+
.vk-segmented[data-vk-size="xs"] .vk-segment { padding: 0 var(--space-sm); font-size: var(--text-xs); }
|
|
1208
1180
|
|
|
1209
1181
|
@media (max-width: 28rem) {
|
|
1210
1182
|
.vk-segment { padding-inline: 0.65rem; }
|
|
1211
1183
|
}
|
|
1212
1184
|
|
|
1185
|
+
|
|
1186
|
+
.vk-segmented[data-orientation="vertical"] { flex-direction: column; }
|
|
1187
|
+
.vk-segmented[data-orientation="vertical"] .vk-segment { border-left: 0; border-top: 1px solid var(--border-subtle); }
|
|
1188
|
+
.vk-segmented[data-orientation="vertical"] .vk-segment:first-child { border-top: 0; }
|
|
1189
|
+
/* Semantic palette recipes. Components share color roles, never raw palette values. */
|
|
1190
|
+
:where([data-vk-color]) { --vk-color-on-soft: var(--vk-color-fg); }
|
|
1191
|
+
:where([data-vk-color="neutral"]) {
|
|
1192
|
+
--vk-color-fg: var(--foreground);
|
|
1193
|
+
--vk-color-bg: var(--card);
|
|
1194
|
+
--vk-color-border: var(--border);
|
|
1195
|
+
--vk-color-solid: var(--foreground);
|
|
1196
|
+
--vk-color-on-solid: var(--background);
|
|
1197
|
+
--vk-color-hover: var(--muted-foreground);
|
|
1198
|
+
}
|
|
1199
|
+
:where([data-vk-color="primary"]) {
|
|
1200
|
+
--vk-color-fg: var(--primary);
|
|
1201
|
+
--vk-color-bg: var(--primary-tint);
|
|
1202
|
+
--vk-color-border: var(--primary-line);
|
|
1203
|
+
--vk-color-solid: var(--primary);
|
|
1204
|
+
--vk-color-on-solid: var(--primary-foreground);
|
|
1205
|
+
--vk-color-hover: var(--primary-hover);
|
|
1206
|
+
--vk-color-on-soft: var(--primary-hover);
|
|
1207
|
+
}
|
|
1208
|
+
:where([data-vk-color="info"]) {
|
|
1209
|
+
--vk-color-fg: var(--info);
|
|
1210
|
+
--vk-color-bg: var(--info-tint);
|
|
1211
|
+
--vk-color-border: var(--info-line);
|
|
1212
|
+
--vk-color-solid: var(--info);
|
|
1213
|
+
--vk-color-on-solid: var(--on-status);
|
|
1214
|
+
--vk-color-hover: color-mix(in srgb, var(--info) 88%, var(--foreground));
|
|
1215
|
+
}
|
|
1216
|
+
:where([data-vk-color="success"]) {
|
|
1217
|
+
--vk-color-fg: var(--success);
|
|
1218
|
+
--vk-color-bg: var(--success-tint);
|
|
1219
|
+
--vk-color-border: var(--success-line);
|
|
1220
|
+
--vk-color-solid: var(--success);
|
|
1221
|
+
--vk-color-on-solid: var(--on-status);
|
|
1222
|
+
--vk-color-hover: color-mix(in srgb, var(--success) 88%, var(--foreground));
|
|
1223
|
+
}
|
|
1224
|
+
:where([data-vk-color="warning"]) {
|
|
1225
|
+
--vk-color-fg: var(--warning);
|
|
1226
|
+
--vk-color-bg: var(--warning-tint);
|
|
1227
|
+
--vk-color-border: var(--warning-line);
|
|
1228
|
+
--vk-color-solid: var(--warning);
|
|
1229
|
+
--vk-color-on-solid: var(--on-status);
|
|
1230
|
+
--vk-color-hover: color-mix(in srgb, var(--warning) 88%, var(--foreground));
|
|
1231
|
+
}
|
|
1232
|
+
:where([data-vk-color="danger"]) {
|
|
1233
|
+
--vk-color-fg: var(--danger);
|
|
1234
|
+
--vk-color-bg: var(--danger-tint);
|
|
1235
|
+
--vk-color-border: var(--danger-line);
|
|
1236
|
+
--vk-color-solid: var(--danger);
|
|
1237
|
+
--vk-color-on-solid: var(--on-status);
|
|
1238
|
+
--vk-color-hover: color-mix(in srgb, var(--danger) 88%, var(--foreground));
|
|
1239
|
+
}
|
|
1240
|
+
:where([data-vk-color="info"]), :where([data-vk-color="success"]), :where([data-vk-color="warning"]), :where([data-vk-color="danger"]) {
|
|
1241
|
+
--vk-color-on-soft: var(--vk-color-hover);
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
/* Color and treatment are independent. Primary actions retain the system's neutral label on outline, ghost and text. */
|
|
1245
|
+
:is(.vk-btn, .vk-icon-btn) {
|
|
1246
|
+
--vk-action-fg: var(--vk-color-fg);
|
|
1247
|
+
font-weight: 600;
|
|
1248
|
+
color: var(--vk-action-fg);
|
|
1249
|
+
background: transparent;
|
|
1250
|
+
}
|
|
1251
|
+
:is(.vk-btn, .vk-icon-btn):where([data-vk-color="primary"]) { --vk-action-fg: var(--foreground); }
|
|
1252
|
+
:is(.vk-btn, .vk-icon-btn):where([data-vk-variant="solid"]) {
|
|
1253
|
+
color: var(--vk-color-on-solid);
|
|
1254
|
+
background: var(--vk-color-solid);
|
|
1255
|
+
border-color: var(--vk-color-solid);
|
|
1256
|
+
font-weight: 700;
|
|
1257
|
+
}
|
|
1258
|
+
:is(.vk-btn, .vk-icon-btn):where([data-vk-variant="soft"]) {
|
|
1259
|
+
color: var(--vk-color-on-soft);
|
|
1260
|
+
background: var(--vk-color-bg);
|
|
1261
|
+
border-color: transparent;
|
|
1262
|
+
}
|
|
1263
|
+
:is(.vk-btn, .vk-icon-btn):where([data-vk-variant="outline"]) { border-color: var(--vk-color-solid); }
|
|
1264
|
+
.vk-icon-btn:where([data-vk-color="primary"]):where([data-vk-variant="outline"]) { border-color: var(--muted-subtle); }
|
|
1265
|
+
:is(.vk-btn, .vk-icon-btn):where(:hover, :active, [data-state="open"]):where(:not(:disabled)) {
|
|
1266
|
+
color: var(--vk-color-on-soft);
|
|
1267
|
+
background: var(--vk-color-bg);
|
|
1268
|
+
border-color: var(--vk-color-hover);
|
|
1269
|
+
}
|
|
1270
|
+
:is(.vk-btn, .vk-icon-btn):where([data-vk-color="primary"]):is(:where([data-vk-variant="outline"]), :where([data-vk-variant="ghost"])):where(:hover, :active, [data-state="open"]):where(:not(:disabled)) { color: var(--foreground); }
|
|
1271
|
+
:is(.vk-btn, .vk-icon-btn):where([data-vk-variant="solid"]):where(:hover, :active, [data-state="open"]):where(:not(:disabled)) {
|
|
1272
|
+
color: var(--vk-color-on-solid);
|
|
1273
|
+
background: var(--vk-color-hover);
|
|
1274
|
+
border-color: var(--vk-color-hover);
|
|
1275
|
+
}
|
|
1276
|
+
:is(.vk-btn, .vk-icon-btn):is(:where([data-vk-variant="ghost"]), :where([data-vk-variant="text"])):where(:hover, :active, [data-state="open"]):where(:not(:disabled)) { border-color: transparent; }
|
|
1277
|
+
.vk-btn:where([data-vk-variant="outline"]) .vk-btn-glyph { color: var(--vk-color-fg); }
|
|
1278
|
+
.vk-btn:where([data-vk-variant="text"]) { font-weight: 500; }
|
|
1279
|
+
.vk-btn:where([data-vk-variant="text"]):where(:hover, :active, [data-state="open"]):where(:not(:disabled)) {
|
|
1280
|
+
color: var(--vk-color-hover);
|
|
1281
|
+
background: transparent;
|
|
1282
|
+
text-decoration: underline;
|
|
1283
|
+
text-underline-offset: var(--space-xs);
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
/* SegmentedControl selects one item; the group holds the semantic palette. */
|
|
1287
|
+
.vk-segmented .vk-segment:where([data-state="checked"]) { color: var(--vk-color-fg); }
|
|
1288
|
+
.vk-segmented:where([data-vk-variant="solid"]) .vk-segment:where([data-state="checked"]) { color: var(--vk-color-on-solid); background: var(--vk-color-solid); }
|
|
1289
|
+
.vk-segmented:where([data-vk-variant="soft"]) .vk-segment:where([data-state="checked"]) {
|
|
1290
|
+
color: var(--foreground);
|
|
1291
|
+
background: var(--vk-color-bg);
|
|
1292
|
+
box-shadow: inset 0 -2px 0 var(--vk-color-solid);
|
|
1293
|
+
}
|
|
1294
|
+
.vk-segmented:where([data-vk-variant="outline"]) .vk-segment:where([data-state="checked"]) { box-shadow: inset 0 0 0 1px var(--vk-color-solid); }
|
|
1295
|
+
.vk-segmented .vk-segment:disabled { color: var(--muted-subtle); cursor: not-allowed; }
|
|
1296
|
+
|
|
1297
|
+
/* Availability is independent from color and treatment; busy actions retain their fill. */
|
|
1298
|
+
:is(.vk-btn, .vk-icon-btn):disabled:not(.vk-btn-loading) {
|
|
1299
|
+
color: var(--muted-subtle);
|
|
1300
|
+
background: transparent;
|
|
1301
|
+
cursor: not-allowed;
|
|
1302
|
+
text-decoration: none;
|
|
1303
|
+
}
|
|
1304
|
+
:is(.vk-btn, .vk-icon-btn):is(:where([data-vk-variant="solid"]), :where([data-vk-variant="soft"]), :where([data-vk-variant="outline"])):disabled:not(.vk-btn-loading) {
|
|
1305
|
+
border: 1px dashed var(--muted-subtle);
|
|
1306
|
+
}
|
|
1307
|
+
.vk-btn:disabled:not(.vk-btn-loading) .vk-btn-glyph { color: inherit; }
|
|
1308
|
+
.vk-btn-loading:disabled { cursor: progress; opacity: 0.7; }
|
|
1309
|
+
@media (forced-colors: active) {
|
|
1310
|
+
:is(.vk-btn, .vk-icon-btn):disabled:not(.vk-btn-loading) { color: GrayText; border-color: GrayText; }
|
|
1311
|
+
.vk-segmented:where([data-vk-variant]) .vk-segment:where([data-state="checked"]) {
|
|
1312
|
+
forced-color-adjust: none;
|
|
1313
|
+
color: HighlightText;
|
|
1314
|
+
background: Highlight;
|
|
1315
|
+
box-shadow: none;
|
|
1316
|
+
}
|
|
1317
|
+
.vk-segmented:where([data-vk-variant]) .vk-segment:where([data-state="checked"]):disabled { color: GrayText; background: Canvas; outline: 1px solid GrayText; }
|
|
1318
|
+
}
|
|
1213
1319
|
/* Breadcrumbs */
|
|
1214
1320
|
.vk-breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0; margin: 0; padding: 0; list-style: none; font-size: var(--text-sm); }
|
|
1215
1321
|
.vk-breadcrumbs li { display: inline-flex; align-items: center; }
|
|
@@ -1350,18 +1456,15 @@ textarea.vk-input, .vk-textarea { resize: vertical; min-height: 8rem; padding-bl
|
|
|
1350
1456
|
.vk-accordion-panel[data-state] { animation: none; }
|
|
1351
1457
|
}
|
|
1352
1458
|
/* Progress (Radix Progress: data-state indeterminate | loading | complete on the track), spinner, skeleton */
|
|
1353
|
-
.vk-progress {
|
|
1354
|
-
.vk-progress-success { --vk-tone: var(--success); }
|
|
1355
|
-
.vk-progress-warning { --vk-tone: var(--warning); }
|
|
1356
|
-
.vk-progress-danger { --vk-tone: var(--danger); }
|
|
1459
|
+
.vk-progress { display: grid; gap: 0.45rem; }
|
|
1357
1460
|
.vk-progress-row { display: flex; justify-content: space-between; gap: 1rem; font-size: var(--text-sm); }
|
|
1358
1461
|
.vk-progress-label { color: var(--foreground); }
|
|
1359
1462
|
.vk-progress-value { font-family: var(--font-numeric); font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
|
|
1360
1463
|
.vk-progress-track { position: relative; height: 6px; overflow: hidden; background: var(--card); border: 1px solid var(--border-subtle); }
|
|
1361
|
-
.vk-progress-fill { height: 100%; background: var(--vk-
|
|
1464
|
+
.vk-progress-fill { height: 100%; background: var(--vk-color-fg); transition: width var(--motion-normal) var(--ease-standard); }
|
|
1362
1465
|
.vk-progress-track[data-state="indeterminate"] {
|
|
1363
1466
|
background-color: var(--card);
|
|
1364
|
-
background-image: repeating-linear-gradient(-45deg, transparent, transparent 4px, var(--vk-
|
|
1467
|
+
background-image: repeating-linear-gradient(-45deg, transparent, transparent 4px, var(--vk-color-fg) 4px, var(--vk-color-fg) 6px);
|
|
1365
1468
|
background-size: 17px 100%;
|
|
1366
1469
|
animation: vk-hatch-move 0.6s linear infinite;
|
|
1367
1470
|
}
|
|
@@ -1496,10 +1599,10 @@ textarea.vk-input, .vk-textarea { resize: vertical; min-height: 8rem; padding-bl
|
|
|
1496
1599
|
.vk-layout-stack { display: flex; flex-direction: column; min-width: 0; }
|
|
1497
1600
|
.vk-layout-inline { display: flex; min-width: 0; }
|
|
1498
1601
|
.vk-layout-grid { display: grid; min-width: 0; }
|
|
1499
|
-
/* A row that holds a field sizes
|
|
1500
|
-
.vk-layout-inline:has(.vk-input) > .vk-btn { min-height: var(--control-height, 44px); }
|
|
1501
|
-
.vk-layout-inline:has(.vk-input) > .vk-icon-btn { width: var(--control-height, 44px); height: var(--control-height, 44px); }
|
|
1502
|
-
.vk-layout-inline:has(.vk-input) > .vk-segmented .vk-segment { min-height: calc(var(--control-height, 44px) - 2px); }
|
|
1602
|
+
/* A row that holds a field sizes actions without an explicit size to the field, so toolbars and inline forms sit flush at --control-height. */
|
|
1603
|
+
.vk-layout-inline:has(.vk-input) > .vk-btn:not([data-vk-size]) { min-height: var(--control-height, 44px); }
|
|
1604
|
+
.vk-layout-inline:has(.vk-input) > .vk-icon-btn:not([data-vk-size]) { width: var(--control-height, 44px); height: var(--control-height, 44px); }
|
|
1605
|
+
.vk-layout-inline:has(.vk-input) > .vk-segmented:not([data-vk-size]) .vk-segment { min-height: calc(var(--control-height, 44px) - 2px); }
|
|
1503
1606
|
@media (max-width: 40rem) { .vk-layout-grid-fixed { grid-template-columns: 1fr !important; } }
|
|
1504
1607
|
.vk-container { box-sizing: border-box; width: 100%; max-width: var(--content-max); margin-inline: auto; }
|
|
1505
1608
|
.vk-container-prose { max-width: calc(var(--prose-max) + 2 * var(--section-gutter)); }
|
|
@@ -1668,8 +1771,16 @@ textarea.vk-input, .vk-textarea { resize: vertical; min-height: 8rem; padding-bl
|
|
|
1668
1771
|
.vk-slider-track[data-disabled] { cursor: not-allowed; }
|
|
1669
1772
|
.vk-slider-fill[data-disabled], .vk-slider-thumb[data-disabled] { background: var(--muted-subtle); cursor: not-allowed; }
|
|
1670
1773
|
.vk-slider-limits { grid-column: 1; display: flex; justify-content: space-between; font-family: var(--font-numeric); font-size: 0.6875rem; color: var(--muted-subtle); }
|
|
1774
|
+
|
|
1775
|
+
/* Radix positions the range and thumbs along the native vertical axis. */
|
|
1776
|
+
.vk-slider[data-orientation="vertical"] { width: max-content; align-items: start; }
|
|
1777
|
+
.vk-slider-track[data-orientation="vertical"] { flex-direction: column; justify-content: center; width: 28px; height: 10rem; }
|
|
1778
|
+
.vk-slider-track[data-orientation="vertical"]::before { left: 50%; right: auto; top: 0; bottom: 0; width: 4px; height: auto; translate: -50% 0; }
|
|
1779
|
+
.vk-slider-fill[data-orientation="vertical"] { left: 50%; top: auto; width: 4px; height: auto; translate: -50% 0; }
|
|
1780
|
+
.vk-slider[data-orientation="vertical"] .vk-slider-limits { flex-direction: column-reverse; gap: var(--space-sm); }
|
|
1671
1781
|
/* One-time code */
|
|
1672
1782
|
.vk-otp { display: flex; flex-wrap: wrap; gap: 0.5rem; }
|
|
1783
|
+
.vk-otp[data-orientation="vertical"] { flex-direction: column; align-items: flex-start; }
|
|
1673
1784
|
.vk-otp-box { width: clamp(24px, calc((100% + 0.5rem) / var(--vk-otp-length, 6) - 0.5rem), 44px); padding: 0; text-align: center; font-family: var(--font-numeric); font-size: 1.25rem; font-variant-numeric: tabular-nums; }
|
|
1674
1785
|
|
|
1675
1786
|
/* Error summary */
|
|
@@ -1835,11 +1946,9 @@ textarea.vk-input, .vk-textarea { resize: vertical; min-height: 8rem; padding-bl
|
|
|
1835
1946
|
.vk-weight-medium { font-weight: 500; }
|
|
1836
1947
|
.vk-weight-semibold { font-weight: 600; }
|
|
1837
1948
|
.vk-weight-bold { font-weight: 700; }
|
|
1838
|
-
.vk-
|
|
1839
|
-
.vk-
|
|
1840
|
-
.vk-
|
|
1841
|
-
.vk-tone-danger { color: var(--danger); }
|
|
1842
|
-
.vk-tone-success { color: var(--success); }
|
|
1949
|
+
.vk-emphasis-muted { color: var(--muted-foreground); }
|
|
1950
|
+
.vk-emphasis-subtle { color: var(--muted-subtle); }
|
|
1951
|
+
.vk-text[data-vk-color]:not([data-vk-color="neutral"]), .vk-heading[data-vk-color]:not([data-vk-color="neutral"]) { color: var(--vk-color-fg); }
|
|
1843
1952
|
.vk-code { padding: 0.1em 0.35em; font-family: var(--font-mono); font-size: 0.875em; color: var(--foreground); background: var(--card); border: 1px solid var(--border-subtle); }
|
|
1844
1953
|
.vk-prose { max-width: var(--prose-max); font-size: var(--text-base); line-height: 1.7; color: var(--muted-foreground); }
|
|
1845
1954
|
.vk-prose > :first-child { margin-top: 0; }
|
|
@@ -2139,8 +2248,8 @@ html[data-density="compact"] body { font-size: var(--text-sm); }
|
|
|
2139
2248
|
[data-density="compact"] .vk-prose > :first-child { margin-top: 0; }
|
|
2140
2249
|
[data-density="compact"] .vk-prose > :last-child { margin-bottom: 0; }
|
|
2141
2250
|
[data-density="compact"] .vk-accordion-trigger { font-size: var(--text-sm); padding-block: var(--space-sm); }
|
|
2142
|
-
[data-density="compact"] .vk-btn-text { font-size: var(--text-sm); }
|
|
2143
|
-
[data-density="compact"] .vk-btn:not(
|
|
2251
|
+
[data-density="compact"] .vk-btn[data-vk-variant="text"]:not([data-vk-size]) { font-size: var(--text-sm); }
|
|
2252
|
+
[data-density="compact"] .vk-btn:not([data-vk-size], [data-vk-variant="text"]) .vk-btn-label { padding: var(--space-xs) var(--space-sm); }
|
|
2144
2253
|
[data-density="compact"] .vk-segmented { min-width: 0; max-width: 100%; align-self: flex-start; }
|
|
2145
2254
|
[data-density="compact"] .vk-segment { min-width: 0; min-height: calc(var(--control-height) - 2px); padding: var(--space-xs) var(--space-sm); font-size: var(--text-sm); overflow-wrap: anywhere; }
|
|
2146
2255
|
@container (max-width: 40rem) {
|
|
@@ -2163,26 +2272,61 @@ html[data-density="compact"] body { font-size: var(--text-sm); }
|
|
|
2163
2272
|
@media (pointer: fine) and (not (any-pointer: coarse)) {
|
|
2164
2273
|
[data-density="compact"] { --control-height: 32px; --control-font-size: var(--text-sm); --control-padding-block: var(--space-xs); }
|
|
2165
2274
|
}
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2275
|
+
/* Explicit sizes share one geometry across actions and fields. Omitted sizes keep density defaults. */
|
|
2276
|
+
[data-vk-size] {
|
|
2277
|
+
--control-height: var(--control-height-md);
|
|
2278
|
+
--control-font-size: var(--text-base);
|
|
2279
|
+
--control-padding-block: var(--space-sm);
|
|
2280
|
+
--control-padding-inline: 0.75rem;
|
|
2281
|
+
--control-icon-size: 16px;
|
|
2282
|
+
--control-end-size: var(--control-height);
|
|
2283
|
+
--button-height: var(--control-height);
|
|
2284
|
+
--button-height-sm: var(--control-height);
|
|
2170
2285
|
}
|
|
2171
|
-
/* Extra-small controls for toolbars, record rows and status lines: size="xs" on Button, IconButton,
|
|
2172
|
-
Menu, Popover, SegmentedControl and Select. Fine pointers only; with any coarse pointer they keep the 44px touch target. */
|
|
2173
2286
|
@media (pointer: fine) and (not (any-pointer: coarse)) {
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2287
|
+
[data-vk-size] { --control-end-size: min(32px, var(--control-height)); }
|
|
2288
|
+
[data-vk-size="xs"] {
|
|
2289
|
+
--control-height: var(--control-height-xs);
|
|
2290
|
+
--control-font-size: var(--text-xs);
|
|
2291
|
+
--control-padding-block: 0;
|
|
2292
|
+
--control-padding-inline: var(--space-sm);
|
|
2293
|
+
--control-icon-size: 14px;
|
|
2294
|
+
}
|
|
2295
|
+
[data-vk-size="sm"] {
|
|
2296
|
+
--control-height: var(--control-height-sm);
|
|
2297
|
+
--control-font-size: var(--text-sm);
|
|
2298
|
+
--control-padding-block: var(--space-xs);
|
|
2299
|
+
--control-padding-inline: 0.625rem;
|
|
2300
|
+
}
|
|
2185
2301
|
}
|
|
2302
|
+
/* Size applies to the complete field, including its affixes, icons and trailing controls. */
|
|
2303
|
+
[data-vk-size].vk-search .vk-input { min-height: var(--control-height); }
|
|
2304
|
+
[data-vk-size] :is(.vk-search-icon, .vk-select-icon, .vk-date-icon, .vk-select-check) { width: var(--control-icon-size); height: var(--control-icon-size); }
|
|
2305
|
+
[data-vk-size] :is(.vk-search-icon, .vk-select-icon, .vk-field-clear) { top: calc(var(--control-height) / 2); }
|
|
2306
|
+
[data-vk-size] .vk-search-icon { left: var(--control-padding-inline); }
|
|
2307
|
+
[data-vk-size] .vk-select-icon { right: var(--control-padding-inline); }
|
|
2308
|
+
[data-vk-size] .vk-field-clear { width: var(--control-end-size); height: var(--control-end-size); right: 0; }
|
|
2309
|
+
[data-vk-size] :is(.vk-affix-addon, .vk-affix-button, .vk-stepper-unit) { padding-inline: var(--control-padding-inline); }
|
|
2310
|
+
[data-vk-size] :is(.vk-affix-addon, .vk-stepper-unit) { font-size: var(--control-font-size); }
|
|
2311
|
+
[data-vk-size] .vk-stepper-btn { width: var(--control-height); }
|
|
2312
|
+
[data-vk-size].vk-input, [data-vk-size] .vk-input { padding-inline: var(--control-padding-inline); }
|
|
2313
|
+
/* Reserve space for the leading icon and trailing clear or calendar control. */
|
|
2314
|
+
[data-vk-size] :is(.vk-select-trigger, .vk-combobox-input) { padding-right: calc(var(--control-padding-inline) + var(--control-icon-size) + var(--space-sm)); }
|
|
2315
|
+
[data-vk-size] :is(.vk-search-input, .vk-date-input, .vk-combobox-input:has(+ .vk-field-clear)) { padding-right: calc(var(--control-end-size) + var(--space-xs)); }
|
|
2316
|
+
[data-vk-size] :is(.vk-search-input, .vk-has-lead) { padding-left: calc(var(--control-padding-inline) + var(--control-icon-size) + var(--space-xs)); }
|
|
2317
|
+
[data-vk-size] .vk-date-trigger { padding-right: var(--control-padding-inline); }
|
|
2318
|
+
[data-vk-size].vk-input.vk-textarea { padding-block: var(--control-padding-block); }
|
|
2319
|
+
/* Menus carry their own size because their portal is outside the field's DOM. */
|
|
2320
|
+
[data-vk-size].vk-select-menu { font-size: var(--control-font-size); }
|
|
2321
|
+
[data-vk-size].vk-select-menu .vk-select-option { box-sizing: border-box; min-height: var(--control-height); padding: var(--control-padding-block) var(--control-padding-inline); }
|
|
2322
|
+
[data-vk-size].vk-select-menu .vk-select-option-description { font-size: var(--control-font-size); }
|
|
2323
|
+
/* A multi-value field can grow by rows while each row uses the selected control size. */
|
|
2324
|
+
[data-vk-size].vk-multiselect { --vk-multiselect-item-height: min(26px, calc(var(--control-height) - 2px)); }
|
|
2325
|
+
[data-vk-size] .vk-multiselect-field { padding-block: max(0px, calc((var(--control-height) - var(--vk-multiselect-item-height) - 2px) / 2)); padding-right: calc(var(--control-padding-inline) + var(--control-icon-size) + var(--space-sm)); }
|
|
2326
|
+
[data-vk-size] .vk-multiselect-input { height: var(--vk-multiselect-item-height); }
|
|
2327
|
+
[data-vk-size].vk-multiselect .vk-tag { min-height: var(--vk-multiselect-item-height); padding-block: 0; font-size: var(--control-font-size); }
|
|
2328
|
+
[data-vk-size].vk-multiselect .vk-tag-remove { width: calc(var(--vk-multiselect-item-height) - 2px); height: calc(var(--vk-multiselect-item-height) - 2px); }
|
|
2329
|
+
[data-vk-size].vk-otp .vk-otp-box { width: clamp(24px, calc((100% + 0.5rem) / var(--vk-otp-length, 6) - 0.5rem), var(--control-height)); padding: 0; font-size: var(--control-font-size); }
|
|
2186
2330
|
/* Touch: buttons and rows meet a 44px target in every density (WCAG 2.5.5, Apple HIG); density only tightens fine-pointer layouts. */
|
|
2187
2331
|
@media (any-pointer: coarse) {
|
|
2188
2332
|
:root { --button-height: var(--control-height); --button-height-sm: var(--control-height); }
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ControlSize, SemanticColor } from "../appearance.js";
|
|
2
|
+
import type { ReactNode, Ref } from "react";
|
|
2
3
|
import type { RadioProps } from "../components/Radio/Radio.js";
|
|
3
4
|
export interface ChoiceTextProps {
|
|
5
|
+
/** Shared dimensions for the control and its label. */
|
|
6
|
+
size?: ControlSize;
|
|
7
|
+
/** Semantic palette of the selected control. */
|
|
8
|
+
color?: SemanticColor;
|
|
4
9
|
label: ReactNode;
|
|
5
10
|
description?: ReactNode;
|
|
6
11
|
hideLabel?: boolean;
|
|
@@ -23,5 +28,5 @@ export declare function hiddenLabel(props: {
|
|
|
23
28
|
/** Radix data-state selects the check or indeterminate dash through CSS. */
|
|
24
29
|
export declare function checkMark(): import("react/jsx-runtime").JSX.Element;
|
|
25
30
|
/** A standalone Radio uses the native control because Radix RadioGroup requires a group. */
|
|
26
|
-
export declare function nativeRadio(props: RadioProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare function nativeRadio(props: RadioProps, ref?: Ref<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
|
|
27
32
|
export {};
|
package/dist/internal/choice.js
CHANGED
|
@@ -6,7 +6,7 @@ import { cx } from "../lib/cx.js";
|
|
|
6
6
|
import { omit } from "../lib/omit.js";
|
|
7
7
|
/** The label around a choice control, then its label and description; clicking anywhere on it toggles the control. */
|
|
8
8
|
export function ChoiceLabel(props) {
|
|
9
|
-
return (_jsxs("label", { className: cx("vk-choice", props.kind, props.disabled && "vk-choice-disabled", props.className), children: [props.children, props.hideLabel ? null : (_jsxs("span", { className: "vk-choice-text", children: [_jsx("span", { className: "vk-choice-label", children: props.label }), props.description ? _jsx("span", { className: "vk-choice-description", children: props.description }) : null] }))] }));
|
|
9
|
+
return (_jsxs("label", { "data-vk-size": props.size, "data-vk-color": props.color, className: cx("vk-choice", props.kind, props.disabled && "vk-choice-disabled", props.className), children: [props.children, props.hideLabel ? null : (_jsxs("span", { className: "vk-choice-text", children: [_jsx("span", { className: "vk-choice-label", children: props.label }), props.description ? _jsx("span", { className: "vk-choice-description", children: props.description }) : null] }))] }));
|
|
10
10
|
}
|
|
11
11
|
/** Extract readable label text when the visible choice label is hidden. */
|
|
12
12
|
export function hiddenLabel(props) {
|
|
@@ -17,7 +17,7 @@ export function checkMark() {
|
|
|
17
17
|
return (_jsxs("svg", { className: "vk-choice-mark", viewBox: "0 0 16 16", width: 12, height: 12, fill: "none", "aria-hidden": "true", children: [_jsx("path", { className: "vk-choice-check", d: CHECK_PATH, stroke: "currentColor", strokeWidth: 2, strokeLinecap: "square" }), _jsx("path", { className: "vk-choice-dash", d: "M4 8h8", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "square" })] }));
|
|
18
18
|
}
|
|
19
19
|
/** A standalone Radio uses the native control because Radix RadioGroup requires a group. */
|
|
20
|
-
export function nativeRadio(props) {
|
|
21
|
-
const rest = omit(props, ["label", "description", "className", "hideLabel"]);
|
|
22
|
-
return (_jsxs(ChoiceLabel, { label: props.label, description: props.description, hideLabel: props.hideLabel, disabled: props.disabled, className: props.className, children: [_jsx("input", { type: "radio", className: "vk-choice-input", "aria-label": hiddenLabel(props), ...rest }), _jsx("span", { className: "vk-choice-box vk-choice-box-radio", "aria-hidden": "true", children: _jsx("span", { className: "vk-choice-dot", "aria-hidden": "true" }) })] }));
|
|
20
|
+
export function nativeRadio(props, ref) {
|
|
21
|
+
const rest = omit(props, ["label", "description", "className", "hideLabel", "size", "color"]);
|
|
22
|
+
return (_jsxs(ChoiceLabel, { size: props.size, color: props.color, label: props.label, description: props.description, hideLabel: props.hideLabel, disabled: props.disabled, className: props.className, children: [_jsx("input", { ref: ref, type: "radio", className: "vk-choice-input", "aria-label": hiddenLabel(props), ...rest }), _jsx("span", { className: "vk-choice-box vk-choice-box-radio", "aria-hidden": "true", children: _jsx("span", { className: "vk-choice-dot", "aria-hidden": "true" }) })] }));
|
|
23
23
|
}
|
package/dist/lib/space.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { SpaceStep } from "../types.js";
|
|
2
2
|
export declare const SPACE: Record<SpaceStep, string>;
|
|
3
|
-
|
|
3
|
+
/** Resolve a typed spacing step to its token, using the fallback when omitted. */
|
|
4
|
+
export declare function space(value: SpaceStep | undefined, fallback: SpaceStep): string;
|
package/dist/lib/space.js
CHANGED
|
@@ -2,11 +2,7 @@ export const SPACE = {
|
|
|
2
2
|
none: "0", xs: "var(--space-xs)", sm: "var(--space-sm)", md: "var(--space-md)", lg: "var(--space-lg)",
|
|
3
3
|
xl: "var(--space-xl)", "2xl": "var(--space-2xl)", "3xl": "var(--space-3xl)",
|
|
4
4
|
};
|
|
5
|
-
/**
|
|
6
|
-
function isSpaceStep(value) {
|
|
7
|
-
return Object.hasOwn(SPACE, value);
|
|
8
|
-
}
|
|
5
|
+
/** Resolve a typed spacing step to its token, using the fallback when omitted. */
|
|
9
6
|
export function space(value, fallback) {
|
|
10
|
-
|
|
11
|
-
return isSpaceStep(v) ? SPACE[v] : v;
|
|
7
|
+
return SPACE[value ?? fallback];
|
|
12
8
|
}
|