@agent-native/design-system 0.0.0-stage → 0.229.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/LICENSE +21 -0
- package/README.md +78 -2
- package/THIRD_PARTY_NOTICES.md +58 -0
- package/css/appearances.css +91 -0
- package/css/main.css +174 -0
- package/css/parts/accordion.css +104 -0
- package/css/parts/alert-dialog.css +159 -0
- package/css/parts/app-shell.css +45 -0
- package/css/parts/aspect-ratio.css +20 -0
- package/css/parts/autocomplete.css +366 -0
- package/css/parts/avatar.css +108 -0
- package/css/parts/badge.css +100 -0
- package/css/parts/blockquote.css +23 -0
- package/css/parts/button.css +238 -0
- package/css/parts/callout.css +108 -0
- package/css/parts/card.css +144 -0
- package/css/parts/checkbox-cards.css +59 -0
- package/css/parts/checkbox-group.css +20 -0
- package/css/parts/checkbox.css +127 -0
- package/css/parts/code.css +194 -0
- package/css/parts/collapsible.css +40 -0
- package/css/parts/combobox.css +171 -0
- package/css/parts/context-menu.css +18 -0
- package/css/parts/data-list.css +130 -0
- package/css/parts/dialog.css +251 -0
- package/css/parts/drawer.css +289 -0
- package/css/parts/em.css +16 -0
- package/css/parts/field.css +55 -0
- package/css/parts/fieldset.css +34 -0
- package/css/parts/form.css +18 -0
- package/css/parts/heading.css +25 -0
- package/css/parts/icon-button.css +30 -0
- package/css/parts/input.css +206 -0
- package/css/parts/inset.css +90 -0
- package/css/parts/item.css +208 -0
- package/css/parts/kbd.css +126 -0
- package/css/parts/link.css +99 -0
- package/css/parts/menu.css +342 -0
- package/css/parts/menubar.css +71 -0
- package/css/parts/meter.css +112 -0
- package/css/parts/navigation-menu.css +199 -0
- package/css/parts/number-field.css +124 -0
- package/css/parts/otp-field.css +137 -0
- package/css/parts/page-header.css +45 -0
- package/css/parts/popover.css +149 -0
- package/css/parts/preview-card.css +116 -0
- package/css/parts/progress.css +159 -0
- package/css/parts/quote.css +18 -0
- package/css/parts/radio-cards.css +188 -0
- package/css/parts/radio-group.css +124 -0
- package/css/parts/scroll-area.css +95 -0
- package/css/parts/segmented-control.css +191 -0
- package/css/parts/select.css +378 -0
- package/css/parts/separator.css +48 -0
- package/css/parts/sidebar.css +211 -0
- package/css/parts/skeleton.css +65 -0
- package/css/parts/slider.css +156 -0
- package/css/parts/spinner.css +52 -0
- package/css/parts/strong.css +15 -0
- package/css/parts/switch.css +138 -0
- package/css/parts/tab-nav.css +48 -0
- package/css/parts/table.css +177 -0
- package/css/parts/tabs.css +214 -0
- package/css/parts/text-area.css +140 -0
- package/css/parts/text.css +245 -0
- package/css/parts/toast.css +302 -0
- package/css/parts/toggle-group.css +25 -0
- package/css/parts/toggle.css +181 -0
- package/css/parts/toolbar.css +133 -0
- package/css/parts/tooltip.css +61 -0
- package/css/parts/visually-hidden.css +21 -0
- package/css/styles.css +73 -0
- package/css/themes/agent-native.css +2321 -0
- package/css/themes/analytics.css +1159 -0
- package/css/themes/assets.css +1159 -0
- package/css/themes/baseline.css +1107 -0
- package/css/themes/brain.css +1159 -0
- package/css/themes/calendar.css +1159 -0
- package/css/themes/chat.css +1159 -0
- package/css/themes/clips.css +1159 -0
- package/css/themes/content.css +1159 -0
- package/css/themes/crm.css +1159 -0
- package/css/themes/design.css +1159 -0
- package/css/themes/desktop.css +1159 -0
- package/css/themes/dispatch.css +1159 -0
- package/css/themes/docs.css +1159 -0
- package/css/themes/factory.css +1159 -0
- package/css/themes/forms.css +1159 -0
- package/css/themes/mail.css +1159 -0
- package/css/themes/plan.css +1159 -0
- package/css/themes/slides.css +1159 -0
- package/css/themes/tasks.css +1159 -0
- package/css/tokens.css +1249 -0
- package/package.json +67 -4
- package/src/catalog/components/alert-dialog.ts +9 -0
- package/src/catalog/components/aspect-ratio.ts +6 -0
- package/src/catalog/components/autocomplete.ts +23 -0
- package/src/catalog/components/avatar.ts +16 -0
- package/src/catalog/components/badge.ts +19 -0
- package/src/catalog/components/blockquote.ts +10 -0
- package/src/catalog/components/button.ts +24 -0
- package/src/catalog/components/callout.ts +17 -0
- package/src/catalog/components/card.ts +10 -0
- package/src/catalog/components/checkbox-cards.ts +14 -0
- package/src/catalog/components/checkbox-group.ts +13 -0
- package/src/catalog/components/checkbox.ts +13 -0
- package/src/catalog/components/code.ts +22 -0
- package/src/catalog/components/combobox.ts +23 -0
- package/src/catalog/components/context-menu.ts +20 -0
- package/src/catalog/components/data-list.ts +14 -0
- package/src/catalog/components/dialog.ts +9 -0
- package/src/catalog/components/drawer.ts +9 -0
- package/src/catalog/components/em.ts +7 -0
- package/src/catalog/components/heading.ts +11 -0
- package/src/catalog/components/index.ts +54 -0
- package/src/catalog/components/input.ts +23 -0
- package/src/catalog/components/inset.ts +15 -0
- package/src/catalog/components/item.ts +21 -0
- package/src/catalog/components/kbd.ts +9 -0
- package/src/catalog/components/link.ts +19 -0
- package/src/catalog/components/menu.ts +20 -0
- package/src/catalog/components/menubar.ts +20 -0
- package/src/catalog/components/meter.ts +19 -0
- package/src/catalog/components/number-field.ts +10 -0
- package/src/catalog/components/otp-field.ts +9 -0
- package/src/catalog/components/popover.ts +9 -0
- package/src/catalog/components/preview-card.ts +9 -0
- package/src/catalog/components/progress.ts +24 -0
- package/src/catalog/components/quote.ts +7 -0
- package/src/catalog/components/radio-cards.ts +14 -0
- package/src/catalog/components/radio-group.ts +13 -0
- package/src/catalog/components/scroll-area.ts +15 -0
- package/src/catalog/components/segmented-control.ts +8 -0
- package/src/catalog/components/select.ts +26 -0
- package/src/catalog/components/separator.ts +14 -0
- package/src/catalog/components/skeleton.ts +8 -0
- package/src/catalog/components/slider.ts +19 -0
- package/src/catalog/components/spinner.ts +15 -0
- package/src/catalog/components/strong.ts +7 -0
- package/src/catalog/components/switch.ts +19 -0
- package/src/catalog/components/tab-nav.ts +18 -0
- package/src/catalog/components/table.ts +34 -0
- package/src/catalog/components/tabs.ts +18 -0
- package/src/catalog/components/text-area.ts +24 -0
- package/src/catalog/components/text.ts +11 -0
- package/src/catalog/components/toast.ts +12 -0
- package/src/catalog/components/toggle-group.ts +17 -0
- package/src/catalog/components/toggle.ts +17 -0
- package/src/catalog/components/toolbar.ts +6 -0
- package/src/catalog/index.ts +4 -0
- package/src/catalog/parts.ts +915 -0
- package/src/catalog/prop-types-source.ts +93 -0
- package/src/catalog/prop-types.generated.ts +1402 -0
- package/src/catalog/props.ts +225 -0
- package/src/css.ts +318 -0
- package/src/generated-css.ts +21 -0
- package/src/index.ts +8 -0
- package/src/model/compare.ts +127 -0
- package/src/model/dom.ts +253 -0
- package/src/model/ids.ts +25 -0
- package/src/model/index.ts +6 -0
- package/src/model/styles.ts +254 -0
- package/src/model/types.ts +97 -0
- package/src/model/validate.ts +133 -0
- package/src/themes/appearances.ts +105 -0
- package/src/themes/baseline.ts +27 -0
- package/src/themes/index.ts +85 -0
- package/src/themes/reference.ts +9 -0
- package/src/themes/shadcn.ts +239 -0
- package/src/themes/types.ts +53 -0
- package/src/tokens/at.ts +13 -0
- package/src/tokens/base.ts +48 -0
- package/src/tokens/color/bezier.ts +111 -0
- package/src/tokens/color/index.ts +2 -0
- package/src/tokens/color/radix-generator.ts +516 -0
- package/src/tokens/dtcg.ts +298 -0
- package/src/tokens/files/foundations.tokens.json +318 -0
- package/src/tokens/files/palette.tokens.json +58 -0
- package/src/tokens/files/themes/agent-native.dark.tokens.json +405 -0
- package/src/tokens/files/themes/agent-native.light.tokens.json +405 -0
- package/src/tokens/files/themes/analytics.dark.tokens.json +391 -0
- package/src/tokens/files/themes/analytics.light.tokens.json +391 -0
- package/src/tokens/files/themes/assets.dark.tokens.json +391 -0
- package/src/tokens/files/themes/assets.light.tokens.json +391 -0
- package/src/tokens/files/themes/brain.dark.tokens.json +391 -0
- package/src/tokens/files/themes/brain.light.tokens.json +391 -0
- package/src/tokens/files/themes/calendar.dark.tokens.json +391 -0
- package/src/tokens/files/themes/calendar.light.tokens.json +391 -0
- package/src/tokens/files/themes/chat.dark.tokens.json +391 -0
- package/src/tokens/files/themes/chat.light.tokens.json +391 -0
- package/src/tokens/files/themes/clips.dark.tokens.json +391 -0
- package/src/tokens/files/themes/clips.light.tokens.json +391 -0
- package/src/tokens/files/themes/content.dark.tokens.json +391 -0
- package/src/tokens/files/themes/content.light.tokens.json +391 -0
- package/src/tokens/files/themes/crm.dark.tokens.json +391 -0
- package/src/tokens/files/themes/crm.light.tokens.json +391 -0
- package/src/tokens/files/themes/design.dark.tokens.json +391 -0
- package/src/tokens/files/themes/design.light.tokens.json +391 -0
- package/src/tokens/files/themes/desktop.dark.tokens.json +391 -0
- package/src/tokens/files/themes/desktop.light.tokens.json +391 -0
- package/src/tokens/files/themes/dispatch.dark.tokens.json +391 -0
- package/src/tokens/files/themes/dispatch.light.tokens.json +391 -0
- package/src/tokens/files/themes/docs.dark.tokens.json +391 -0
- package/src/tokens/files/themes/docs.light.tokens.json +391 -0
- package/src/tokens/files/themes/factory.dark.tokens.json +391 -0
- package/src/tokens/files/themes/factory.light.tokens.json +391 -0
- package/src/tokens/files/themes/forms.dark.tokens.json +391 -0
- package/src/tokens/files/themes/forms.light.tokens.json +391 -0
- package/src/tokens/files/themes/mail.dark.tokens.json +391 -0
- package/src/tokens/files/themes/mail.light.tokens.json +391 -0
- package/src/tokens/files/themes/plan.dark.tokens.json +391 -0
- package/src/tokens/files/themes/plan.light.tokens.json +391 -0
- package/src/tokens/files/themes/slides.dark.tokens.json +391 -0
- package/src/tokens/files/themes/slides.light.tokens.json +391 -0
- package/src/tokens/files/themes/tasks.dark.tokens.json +391 -0
- package/src/tokens/files/themes/tasks.light.tokens.json +391 -0
- package/src/tokens/palette.ts +354 -0
- package/src/tokens/primitives.ts +84 -0
- package/src/tokens/roles.ts +269 -0
- package/src/tokens/round-trip.ts +277 -0
- package/src/tokens/source.ts +302 -0
- package/tsconfig.json +26 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Part: icon-button
|
|
3
|
+
*
|
|
4
|
+
* <button class="icon-button" data-size="1|2|3|4" data-variant=…>
|
|
5
|
+
*
|
|
6
|
+
* A button holding only an icon, square at every size. Its colors, states
|
|
7
|
+
* and sizes' heights are Button's: button.css styles both.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
@layer components {
|
|
11
|
+
.icon-button {
|
|
12
|
+
width: var(--control-height-3);
|
|
13
|
+
padding: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.icon-button[data-size="1"] {
|
|
17
|
+
width: var(--control-height-1);
|
|
18
|
+
padding: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.icon-button[data-size="2"] {
|
|
22
|
+
width: var(--control-height-2);
|
|
23
|
+
padding: 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.icon-button[data-size="4"] {
|
|
27
|
+
width: var(--control-height-4);
|
|
28
|
+
padding: 0;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Part: input
|
|
3
|
+
*
|
|
4
|
+
* <div class="input" the frame: edge, fill, focus ring
|
|
5
|
+
* data-size="1|2|3|4" data-variant="surface|soft"
|
|
6
|
+
* [data-color="accent|gray|danger|warning|success|info"] [data-radius]>
|
|
7
|
+
* <input class="input-control" Base UI Input
|
|
8
|
+
* [data-focused] [data-invalid] [data-disabled] [aria-invalid]>
|
|
9
|
+
* <div class="input-slot" [data-side="left|right"]> an icon, a shortcut, a unit, a button
|
|
10
|
+
*
|
|
11
|
+
* Radix Themes' text field on the system's scale: sizes 1 to 4 are the 16,
|
|
12
|
+
* 20, 24 and 32px control heights. The frame draws the field, so its slots
|
|
13
|
+
* sit inside the same edge; the input itself is bare. Slots follow the
|
|
14
|
+
* input in the markup and are placed by `order`: a slot goes before the
|
|
15
|
+
* text unless it is marked right, and a second unmarked slot goes after
|
|
16
|
+
* it. A slot's outer padding belongs to what sits at the edge: the text
|
|
17
|
+
* padding for a unit or a shortcut, and (height - icon) / 2 for an icon or
|
|
18
|
+
* a button, so it sits as far from the edge as from the top and bottom. Surface is the field with an
|
|
19
|
+
* edge, and soft a tint of the color without one; as in Radix, a surface
|
|
20
|
+
* field keeps neutral edges in every color.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
@layer components {
|
|
24
|
+
.input {
|
|
25
|
+
--control-font-size: var(--control-font-size-3);
|
|
26
|
+
--control-line-height: var(--control-line-height-3);
|
|
27
|
+
--_height: var(--control-height-3);
|
|
28
|
+
--_icon: var(--control-icon-size-3);
|
|
29
|
+
--_padding: var(--control-padding-x-4);
|
|
30
|
+
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: stretch;
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
width: 100%;
|
|
35
|
+
min-width: 0;
|
|
36
|
+
height: var(--_height);
|
|
37
|
+
border-radius: calc(var(--shape-control) * var(--corner-scale, 1));
|
|
38
|
+
corner-shape: var(--corner-shape, round);
|
|
39
|
+
font: inherit;
|
|
40
|
+
font-size: var(--control-font-size);
|
|
41
|
+
line-height: var(--control-line-height);
|
|
42
|
+
text-align: start;
|
|
43
|
+
cursor: text;
|
|
44
|
+
transition-property: background-color, box-shadow;
|
|
45
|
+
transition-duration: var(--duration-2);
|
|
46
|
+
transition-timing-function: var(--ease-standard);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* ---- sizes ---- */
|
|
50
|
+
|
|
51
|
+
.input[data-size="1"] {
|
|
52
|
+
--control-font-size: var(--control-font-size-1);
|
|
53
|
+
--control-line-height: var(--control-line-height-1);
|
|
54
|
+
--_height: var(--control-height-1);
|
|
55
|
+
--_icon: var(--control-icon-size-1);
|
|
56
|
+
--_padding: var(--control-padding-x-2);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.input[data-size="2"] {
|
|
60
|
+
--control-font-size: var(--control-font-size-2);
|
|
61
|
+
--control-line-height: var(--control-line-height-2);
|
|
62
|
+
--_height: var(--control-height-2);
|
|
63
|
+
--_icon: var(--control-icon-size-2);
|
|
64
|
+
--_padding: var(--control-padding-x-3);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.input[data-size="4"] {
|
|
68
|
+
--control-font-size: var(--control-font-size-4);
|
|
69
|
+
--control-line-height: var(--control-line-height-4);
|
|
70
|
+
--_height: var(--control-height-4);
|
|
71
|
+
--_icon: var(--control-icon-size-4);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* ---- the input and its slots ---- */
|
|
75
|
+
|
|
76
|
+
.input-control {
|
|
77
|
+
flex: 1;
|
|
78
|
+
width: 100%;
|
|
79
|
+
min-width: 0;
|
|
80
|
+
margin: 0;
|
|
81
|
+
padding: 0 var(--_padding);
|
|
82
|
+
border: 0;
|
|
83
|
+
border-radius: inherit;
|
|
84
|
+
background: transparent;
|
|
85
|
+
color: inherit;
|
|
86
|
+
font: inherit;
|
|
87
|
+
text-align: inherit;
|
|
88
|
+
outline-style: none;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.input-control::placeholder {
|
|
92
|
+
color: var(--fg-subtle);
|
|
93
|
+
opacity: 1;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.input-control::-webkit-search-cancel-button {
|
|
97
|
+
appearance: none;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.input-slot {
|
|
101
|
+
--_edge: var(--_padding);
|
|
102
|
+
|
|
103
|
+
display: flex;
|
|
104
|
+
flex-shrink: 0;
|
|
105
|
+
align-items: center;
|
|
106
|
+
gap: var(--control-gap);
|
|
107
|
+
box-sizing: border-box;
|
|
108
|
+
order: -1;
|
|
109
|
+
padding-inline: var(--_edge) var(--space-2);
|
|
110
|
+
color: var(--fg-muted);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.input-slot[data-side="right"],
|
|
114
|
+
.input-slot:not([data-side="right"]) ~ .input-slot:not([data-side="left"]) {
|
|
115
|
+
order: 0;
|
|
116
|
+
padding-inline: var(--space-2) var(--_edge);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.input-slot:has(> svg, > button) {
|
|
120
|
+
--_edge: calc((var(--_height) - var(--_icon)) / 2);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.input-slot svg {
|
|
124
|
+
flex-shrink: 0;
|
|
125
|
+
width: var(--_icon);
|
|
126
|
+
height: var(--_icon);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.input-control:has(~ .input-slot:not([data-side="right"])) {
|
|
130
|
+
padding-inline-start: 0;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.input-control:has(
|
|
134
|
+
~ .input-slot[data-side="right"],
|
|
135
|
+
~ .input-slot:not([data-side="right"]) ~ .input-slot:not([data-side="left"])
|
|
136
|
+
) {
|
|
137
|
+
padding-inline-end: 0;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* ---- variants ---- */
|
|
141
|
+
|
|
142
|
+
.input[data-variant="surface"] {
|
|
143
|
+
background-color: var(--fill-field);
|
|
144
|
+
box-shadow: inset 0 0 0 1px var(--line-strong);
|
|
145
|
+
color: var(--fg-default);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.input[data-variant="soft"] {
|
|
149
|
+
background-color: var(--accent-a3);
|
|
150
|
+
color: var(--accent-12);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.input[data-variant="soft"] .input-control::placeholder {
|
|
154
|
+
color: var(--accent-text);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.input[data-variant="soft"] .input-slot {
|
|
158
|
+
color: var(--accent-text);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
@media (hover: hover) {
|
|
162
|
+
.input[data-variant="surface"]:hover {
|
|
163
|
+
box-shadow: inset 0 0 0 1px var(--gray-a8);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.input:has(.input-control:focus-visible) {
|
|
168
|
+
outline: var(--focus-ring-width) solid var(--line-focus);
|
|
169
|
+
outline-offset: var(--focus-ring-offset);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/* ---- invalid and disabled ---- */
|
|
173
|
+
|
|
174
|
+
.input:has(.input-control:is([data-invalid], [aria-invalid="true"])) {
|
|
175
|
+
box-shadow: inset 0 0 0 1px var(--fill-danger);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.input:has(
|
|
179
|
+
.input-control:is([data-invalid], [aria-invalid="true"]):focus-visible
|
|
180
|
+
) {
|
|
181
|
+
outline-color: var(--fill-danger);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.input:has(.input-control:disabled) {
|
|
185
|
+
cursor: not-allowed;
|
|
186
|
+
color: var(--gray-a8);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.input:has(.input-control:disabled) :is(.input-control, .input-slot) {
|
|
190
|
+
cursor: not-allowed;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.input:has(.input-control:disabled) .input-control::placeholder,
|
|
194
|
+
.input:has(.input-control:disabled) .input-slot {
|
|
195
|
+
color: var(--gray-a8);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.input[data-variant="surface"]:has(.input-control:disabled) {
|
|
199
|
+
background-color: transparent;
|
|
200
|
+
box-shadow: inset 0 0 0 1px var(--gray-a6);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.input[data-variant="soft"]:has(.input-control:disabled) {
|
|
204
|
+
background-color: var(--gray-a3);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Part: inset
|
|
3
|
+
*
|
|
4
|
+
* <div class="card" ...>
|
|
5
|
+
* <div class="inset" data-side="all|x|y|top|bottom|left|right"
|
|
6
|
+
* data-clip="border-box|padding-box">
|
|
7
|
+
* <img> media that runs to the card's edge
|
|
8
|
+
*
|
|
9
|
+
* Radix Themes' inset: it pulls its content out over its container's
|
|
10
|
+
* padding on the sides `side` names, and rounds the corners it reaches to
|
|
11
|
+
* the container's. `border-box` stops inside the container's hairline,
|
|
12
|
+
* `padding-box` runs under it.
|
|
13
|
+
*
|
|
14
|
+
* A container opts in by setting these, as Card does; outside one, an
|
|
15
|
+
* inset pulls nothing:
|
|
16
|
+
* --inset-padding-top|right|bottom|left its padding, less its edge
|
|
17
|
+
* --inset-border-width its edge's width
|
|
18
|
+
* --inset-border-radius its corner radius
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
@layer components {
|
|
22
|
+
.inset {
|
|
23
|
+
--_inset-radius: calc(
|
|
24
|
+
var(--inset-border-radius, 0px) - var(--inset-border-width, 0px)
|
|
25
|
+
);
|
|
26
|
+
--_inset-top: var(--inset-padding-top, 0px);
|
|
27
|
+
--_inset-right: var(--inset-padding-right, 0px);
|
|
28
|
+
--_inset-bottom: var(--inset-padding-bottom, 0px);
|
|
29
|
+
--_inset-left: var(--inset-padding-left, 0px);
|
|
30
|
+
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.inset[data-clip="padding-box"] {
|
|
36
|
+
--_inset-radius: var(--inset-border-radius, 0px);
|
|
37
|
+
--_inset-top: calc(
|
|
38
|
+
var(--inset-padding-top, 0px) + var(--inset-border-width, 0px)
|
|
39
|
+
);
|
|
40
|
+
--_inset-right: calc(
|
|
41
|
+
var(--inset-padding-right, 0px) + var(--inset-border-width, 0px)
|
|
42
|
+
);
|
|
43
|
+
--_inset-bottom: calc(
|
|
44
|
+
var(--inset-padding-bottom, 0px) + var(--inset-border-width, 0px)
|
|
45
|
+
);
|
|
46
|
+
--_inset-left: calc(
|
|
47
|
+
var(--inset-padding-left, 0px) + var(--inset-border-width, 0px)
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.inset[data-side="all"] {
|
|
52
|
+
margin: calc(var(--_inset-top) * -1) calc(var(--_inset-right) * -1)
|
|
53
|
+
calc(var(--_inset-bottom) * -1) calc(var(--_inset-left) * -1);
|
|
54
|
+
border-radius: var(--_inset-radius);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.inset[data-side="x"] {
|
|
58
|
+
margin-right: calc(var(--_inset-right) * -1);
|
|
59
|
+
margin-left: calc(var(--_inset-left) * -1);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.inset[data-side="y"] {
|
|
63
|
+
margin-top: calc(var(--_inset-top) * -1);
|
|
64
|
+
margin-bottom: calc(var(--_inset-bottom) * -1);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.inset[data-side="top"] {
|
|
68
|
+
margin: calc(var(--_inset-top) * -1) calc(var(--_inset-right) * -1) 0
|
|
69
|
+
calc(var(--_inset-left) * -1);
|
|
70
|
+
border-radius: var(--_inset-radius) var(--_inset-radius) 0 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.inset[data-side="bottom"] {
|
|
74
|
+
margin: 0 calc(var(--_inset-right) * -1) calc(var(--_inset-bottom) * -1)
|
|
75
|
+
calc(var(--_inset-left) * -1);
|
|
76
|
+
border-radius: 0 0 var(--_inset-radius) var(--_inset-radius);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.inset[data-side="left"] {
|
|
80
|
+
margin: calc(var(--_inset-top) * -1) 0 calc(var(--_inset-bottom) * -1)
|
|
81
|
+
calc(var(--_inset-left) * -1);
|
|
82
|
+
border-radius: var(--_inset-radius) 0 0 var(--_inset-radius);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.inset[data-side="right"] {
|
|
86
|
+
margin: calc(var(--_inset-top) * -1) calc(var(--_inset-right) * -1)
|
|
87
|
+
calc(var(--_inset-bottom) * -1) 0;
|
|
88
|
+
border-radius: 0 var(--_inset-radius) var(--_inset-radius) 0;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Part: item
|
|
3
|
+
*
|
|
4
|
+
* <div class="item-group-header"> the label and an action at the end
|
|
5
|
+
* <h2 class="item-group-label" [data-visually-hidden]> names the list
|
|
6
|
+
* <p class="item-description"> optional, under a label: describes the list
|
|
7
|
+
* <div class="item-group" role="list" data-variant="ghost|outline">
|
|
8
|
+
* <div class="item" role="listitem" data-size="1|2"
|
|
9
|
+
* data-variant="ghost|outline|soft">
|
|
10
|
+
* <span class="item-media" [data-framed]>
|
|
11
|
+
* <div class="item-content">
|
|
12
|
+
* <div class="item-title"> <p class="item-description">
|
|
13
|
+
* <div class="item-actions"> a Switch, Buttons, a Menu trigger
|
|
14
|
+
* <div class="item-footer"> across the row's width
|
|
15
|
+
*
|
|
16
|
+
* A row in a list, not in Radix Themes: size 1 is the compact row, 2 the
|
|
17
|
+
* standard one. An outlined group frames its rows on the raised surface
|
|
18
|
+
* and divides them with hairlines; a ghost group is bare rows. On its own
|
|
19
|
+
* an item can draw its edge (outline) or a quiet fill (soft). An item that
|
|
20
|
+
* renders as a link or button takes the hover fill. Framed media sets an
|
|
21
|
+
* icon in a tile.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
@layer components {
|
|
25
|
+
.item-group-header {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-wrap: wrap;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: space-between;
|
|
30
|
+
gap: var(--space-2);
|
|
31
|
+
min-height: var(--control-height-4);
|
|
32
|
+
margin: 0 0 var(--space-2);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.item-group-label {
|
|
36
|
+
margin: 0 0 var(--space-2);
|
|
37
|
+
color: var(--fg-default);
|
|
38
|
+
font-size: var(--font-size-2);
|
|
39
|
+
line-height: var(--line-height-2);
|
|
40
|
+
font-weight: var(--font-weight-semibold);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.item-group-header > .item-group-label {
|
|
44
|
+
min-width: 0;
|
|
45
|
+
margin: 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* Read by assistive technology, drawn at no size. */
|
|
49
|
+
.item-group-label[data-visually-hidden] {
|
|
50
|
+
position: absolute;
|
|
51
|
+
width: 1px;
|
|
52
|
+
height: 1px;
|
|
53
|
+
margin: 0;
|
|
54
|
+
overflow: hidden;
|
|
55
|
+
clip-path: inset(50%);
|
|
56
|
+
white-space: nowrap;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.item-group-label:has(+ .item-description) {
|
|
60
|
+
margin-bottom: var(--space-1);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.item-group-label + .item-description {
|
|
64
|
+
margin-bottom: var(--space-2);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.item-group {
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
color: var(--fg-default);
|
|
71
|
+
font-size: var(--font-size-2);
|
|
72
|
+
line-height: var(--line-height-2);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.item-group[data-variant="outline"] {
|
|
76
|
+
overflow: hidden;
|
|
77
|
+
border: 1px solid var(--line-subtle);
|
|
78
|
+
border-radius: calc(var(--shape-panel) * var(--corner-scale, 1));
|
|
79
|
+
corner-shape: var(--corner-shape, round);
|
|
80
|
+
background-color: var(--surface-raised);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.item-group[data-variant="outline"] > * + * {
|
|
84
|
+
border-top: 1px solid var(--line-subtle);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.item {
|
|
88
|
+
display: flex;
|
|
89
|
+
flex-wrap: wrap;
|
|
90
|
+
align-items: center;
|
|
91
|
+
gap: var(--space-3);
|
|
92
|
+
box-sizing: border-box;
|
|
93
|
+
padding: var(--space-3) var(--space-4);
|
|
94
|
+
color: var(--fg-default);
|
|
95
|
+
font-size: var(--font-size-2);
|
|
96
|
+
line-height: var(--line-height-2);
|
|
97
|
+
text-align: start;
|
|
98
|
+
text-decoration: none;
|
|
99
|
+
outline-style: none;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.item[data-size="1"] {
|
|
103
|
+
padding: var(--space-2) var(--space-3);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* A row that is a control: the whole row is its hit area. */
|
|
107
|
+
button.item {
|
|
108
|
+
width: 100%;
|
|
109
|
+
border: 0;
|
|
110
|
+
border-radius: calc(var(--shape-control) * var(--corner-scale, 1));
|
|
111
|
+
background-color: transparent;
|
|
112
|
+
font: inherit;
|
|
113
|
+
font-size: var(--font-size-2);
|
|
114
|
+
line-height: var(--line-height-2);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.item[data-variant="outline"],
|
|
118
|
+
.item[data-variant="soft"] {
|
|
119
|
+
border-radius: calc(var(--shape-panel) * var(--corner-scale, 1));
|
|
120
|
+
corner-shape: var(--corner-shape, round);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.item[data-variant="outline"] {
|
|
124
|
+
border: 1px solid var(--line-subtle);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.item[data-variant="soft"] {
|
|
128
|
+
background-color: var(--fill-neutral);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@media (hover: hover) {
|
|
132
|
+
a.item:hover,
|
|
133
|
+
button.item:hover {
|
|
134
|
+
background-color: var(--fill-hover);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.item:focus-visible {
|
|
139
|
+
box-shadow: inset 0 0 0 var(--focus-ring-width) var(--line-focus);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.item-media {
|
|
143
|
+
display: inline-flex;
|
|
144
|
+
flex-shrink: 0;
|
|
145
|
+
align-items: center;
|
|
146
|
+
justify-content: center;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.item-media[data-framed] {
|
|
150
|
+
box-sizing: border-box;
|
|
151
|
+
width: var(--size-4);
|
|
152
|
+
height: var(--size-4);
|
|
153
|
+
border: 1px solid var(--line-default);
|
|
154
|
+
border-radius: calc(var(--shape-control) * var(--corner-scale, 1));
|
|
155
|
+
corner-shape: var(--corner-shape, round);
|
|
156
|
+
background-color: var(--surface-canvas);
|
|
157
|
+
color: var(--fg-muted);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.item-media svg {
|
|
161
|
+
width: var(--control-icon-size-3);
|
|
162
|
+
height: var(--control-icon-size-3);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* Media beside a description sits at the title's line, not the center. */
|
|
166
|
+
.item:has(.item-description) > .item-media {
|
|
167
|
+
align-self: flex-start;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.item-content {
|
|
171
|
+
display: flex;
|
|
172
|
+
flex: 1;
|
|
173
|
+
flex-direction: column;
|
|
174
|
+
gap: var(--space-1);
|
|
175
|
+
min-width: 0;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.item-title {
|
|
179
|
+
display: flex;
|
|
180
|
+
flex-wrap: wrap;
|
|
181
|
+
align-items: center;
|
|
182
|
+
gap: var(--space-2);
|
|
183
|
+
color: var(--fg-default);
|
|
184
|
+
font-size: var(--font-size-2);
|
|
185
|
+
line-height: var(--line-height-2);
|
|
186
|
+
font-weight: var(--font-weight-medium);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.item-description {
|
|
190
|
+
margin: 0;
|
|
191
|
+
color: var(--fg-muted);
|
|
192
|
+
font-size: var(--font-size-1);
|
|
193
|
+
line-height: var(--line-height-1);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.item-actions {
|
|
197
|
+
display: flex;
|
|
198
|
+
flex-shrink: 0;
|
|
199
|
+
align-items: center;
|
|
200
|
+
gap: var(--space-2);
|
|
201
|
+
margin-inline-start: auto;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.item-footer {
|
|
205
|
+
flex-basis: 100%;
|
|
206
|
+
min-width: 0;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Part: kbd
|
|
3
|
+
*
|
|
4
|
+
* <kbd class="kbd" [data-size="0–9"] data-variant="surface|soft">
|
|
5
|
+
*
|
|
6
|
+
* Radix Themes' kbd on the system's scale: a keycap holding a whole
|
|
7
|
+
* shortcut, sized in em so it follows the text around it, or a step of the
|
|
8
|
+
* type scale when `size` is set. Surface is a raised cap with a heavier
|
|
9
|
+
* bottom edge; soft is a flat tint. Rendered as a link or button, it takes
|
|
10
|
+
* hover, pressed and focus states.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
@layer components {
|
|
14
|
+
.kbd {
|
|
15
|
+
display: inline-flex;
|
|
16
|
+
flex-shrink: 0;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
/* Holds its own height in a flex or grid row instead of stretching. */
|
|
21
|
+
height: fit-content;
|
|
22
|
+
min-width: 1.6em;
|
|
23
|
+
padding: 0 0.45em;
|
|
24
|
+
border: 0;
|
|
25
|
+
border-radius: var(--radius-2);
|
|
26
|
+
corner-shape: var(--corner-shape, round);
|
|
27
|
+
color: var(--gray-12);
|
|
28
|
+
font-family: inherit;
|
|
29
|
+
font-size: 0.85em;
|
|
30
|
+
line-height: 1.6em;
|
|
31
|
+
font-weight: var(--font-weight-medium);
|
|
32
|
+
letter-spacing: 0.02em;
|
|
33
|
+
white-space: nowrap;
|
|
34
|
+
vertical-align: text-top;
|
|
35
|
+
-webkit-user-select: none;
|
|
36
|
+
user-select: none;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.kbd + .kbd {
|
|
40
|
+
margin-inline-start: var(--space-1);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* ---- sizes ---- */
|
|
44
|
+
|
|
45
|
+
.kbd[data-size="0"] {
|
|
46
|
+
font-size: calc(var(--font-size-0) * 0.85);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.kbd[data-size="1"] {
|
|
50
|
+
font-size: calc(var(--font-size-1) * 0.85);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.kbd[data-size="2"] {
|
|
54
|
+
font-size: calc(var(--font-size-2) * 0.85);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.kbd[data-size="3"] {
|
|
58
|
+
font-size: calc(var(--font-size-3) * 0.85);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.kbd[data-size="4"] {
|
|
62
|
+
font-size: calc(var(--font-size-4) * 0.85);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.kbd[data-size="5"] {
|
|
66
|
+
font-size: calc(var(--font-size-5) * 0.85);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.kbd[data-size="6"] {
|
|
70
|
+
font-size: calc(var(--font-size-6) * 0.85);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.kbd[data-size="7"] {
|
|
74
|
+
font-size: calc(var(--font-size-7) * 0.85);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.kbd[data-size="8"] {
|
|
78
|
+
font-size: calc(var(--font-size-8) * 0.85);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.kbd[data-size="9"] {
|
|
82
|
+
font-size: calc(var(--font-size-9) * 0.85);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* ---- variants ---- */
|
|
86
|
+
|
|
87
|
+
.kbd[data-variant="surface"] {
|
|
88
|
+
background-color: var(--gray-surface);
|
|
89
|
+
box-shadow:
|
|
90
|
+
inset 0 0 0 1px var(--gray-a5),
|
|
91
|
+
inset 0 -1px 0 1px var(--gray-a6);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.kbd[data-variant="soft"] {
|
|
95
|
+
background-color: var(--gray-a3);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
:is(a, button).kbd {
|
|
99
|
+
cursor: pointer;
|
|
100
|
+
outline-style: none;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@media (hover: hover) {
|
|
104
|
+
:is(a, button).kbd[data-variant="surface"]:hover {
|
|
105
|
+
background-color: var(--gray-a2);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
:is(a, button).kbd[data-variant="soft"]:hover {
|
|
109
|
+
background-color: var(--gray-a4);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
:is(a, button).kbd[data-variant="surface"]:active {
|
|
114
|
+
background-color: var(--gray-a3);
|
|
115
|
+
box-shadow: inset 0 0 0 1px var(--gray-a6);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
:is(a, button).kbd[data-variant="soft"]:active {
|
|
119
|
+
background-color: var(--gray-a5);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
:is(a, button).kbd:focus-visible {
|
|
123
|
+
outline: var(--focus-ring-width) solid var(--line-focus);
|
|
124
|
+
outline-offset: var(--focus-ring-offset);
|
|
125
|
+
}
|
|
126
|
+
}
|