@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,238 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Part: button (and icon-button, which shares every rule here)
|
|
3
|
+
*
|
|
4
|
+
* <button class="button | icon-button"
|
|
5
|
+
* data-size="1|2|3|4" data-variant="solid|soft|surface|outline|ghost"
|
|
6
|
+
* [data-color="accent|gray|danger|warning|success|info"]
|
|
7
|
+
* [data-high-contrast] [data-radius] [data-loading] [data-disabled]>
|
|
8
|
+
* <span class="button-content"> the label, hidden while loading
|
|
9
|
+
* <span class="button-spinner"> the Spinner, while loading
|
|
10
|
+
*
|
|
11
|
+
* Radix Themes' button on the system's scale: sizes 1 to 4 are the 16, 20,
|
|
12
|
+
* 24 and 32px control heights. A variant decides how the color applies, and
|
|
13
|
+
* the color is whichever `data-color` is nearest, the theme's accent at the
|
|
14
|
+
* root. Every variant reads the `--accent-*` steps, so a new color needs no
|
|
15
|
+
* rule here. An icon button is the same button made square. Loading
|
|
16
|
+
* disables the button, which draws it in the disabled colors, as Radix does.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
@layer components {
|
|
20
|
+
:is(.button, .icon-button) {
|
|
21
|
+
--control-font-size: var(--control-font-size-3);
|
|
22
|
+
--control-line-height: var(--control-line-height-3);
|
|
23
|
+
position: relative;
|
|
24
|
+
display: inline-flex;
|
|
25
|
+
flex-shrink: 0;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
gap: var(--control-gap);
|
|
29
|
+
box-sizing: border-box;
|
|
30
|
+
height: var(--control-height-3);
|
|
31
|
+
padding: 0 var(--control-padding-x-3);
|
|
32
|
+
border: 0;
|
|
33
|
+
border-radius: calc(var(--shape-control) * var(--corner-scale, 1));
|
|
34
|
+
corner-shape: var(--corner-shape, round);
|
|
35
|
+
font: inherit;
|
|
36
|
+
font-size: var(--control-font-size);
|
|
37
|
+
line-height: var(--control-line-height);
|
|
38
|
+
font-weight: var(--font-weight-medium);
|
|
39
|
+
white-space: nowrap;
|
|
40
|
+
vertical-align: top;
|
|
41
|
+
-webkit-user-select: none;
|
|
42
|
+
user-select: none;
|
|
43
|
+
outline-style: none;
|
|
44
|
+
transition-property: color, background-color, box-shadow, scale;
|
|
45
|
+
transition-duration: var(--duration-2);
|
|
46
|
+
transition-timing-function: var(--ease-standard);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:is(.button, .icon-button) svg {
|
|
50
|
+
pointer-events: none;
|
|
51
|
+
flex-shrink: 0;
|
|
52
|
+
width: var(--control-icon-size-3);
|
|
53
|
+
height: var(--control-icon-size-3);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* ---- sizes ---- */
|
|
57
|
+
|
|
58
|
+
:is(.button, .icon-button)[data-size="1"] {
|
|
59
|
+
--control-font-size: var(--control-font-size-1);
|
|
60
|
+
--control-line-height: var(--control-line-height-1);
|
|
61
|
+
height: var(--control-height-1);
|
|
62
|
+
padding-inline: var(--control-padding-x-1);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:is(.button, .icon-button)[data-size="2"] {
|
|
66
|
+
--control-font-size: var(--control-font-size-2);
|
|
67
|
+
--control-line-height: var(--control-line-height-2);
|
|
68
|
+
height: var(--control-height-2);
|
|
69
|
+
padding-inline: var(--control-padding-x-2);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
:is(.button, .icon-button)[data-size="4"] {
|
|
73
|
+
--control-font-size: var(--control-font-size-4);
|
|
74
|
+
--control-line-height: var(--control-line-height-4);
|
|
75
|
+
height: var(--control-height-4);
|
|
76
|
+
padding-inline: var(--control-padding-x-4);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:is(.button, .icon-button)[data-size="1"] svg {
|
|
80
|
+
width: var(--control-icon-size-1);
|
|
81
|
+
height: var(--control-icon-size-1);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:is(.button, .icon-button)[data-size="2"] svg {
|
|
85
|
+
width: var(--control-icon-size-2);
|
|
86
|
+
height: var(--control-icon-size-2);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
:is(.button, .icon-button)[data-size="4"] svg {
|
|
90
|
+
width: var(--control-icon-size-4);
|
|
91
|
+
height: var(--control-icon-size-4);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* ---- variants ---- */
|
|
95
|
+
|
|
96
|
+
:is(.button, .icon-button)[data-variant="solid"] {
|
|
97
|
+
background-color: var(--accent-solid);
|
|
98
|
+
color: var(--accent-contrast);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
:is(.button, .icon-button)[data-variant="soft"] {
|
|
102
|
+
background-color: var(--accent-a3);
|
|
103
|
+
color: var(--accent-text);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
:is(.button, .icon-button)[data-variant="surface"] {
|
|
107
|
+
background-color: var(--accent-surface);
|
|
108
|
+
box-shadow: inset 0 0 0 1px var(--accent-a7);
|
|
109
|
+
color: var(--accent-text);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
:is(.button, .icon-button)[data-variant="outline"] {
|
|
113
|
+
background-color: transparent;
|
|
114
|
+
box-shadow: inset 0 0 0 1px var(--accent-a8);
|
|
115
|
+
color: var(--accent-text);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
:is(.button, .icon-button)[data-variant="ghost"] {
|
|
119
|
+
background-color: transparent;
|
|
120
|
+
color: var(--accent-text);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
:is(.button, .icon-button)[data-high-contrast]:not(
|
|
124
|
+
[data-variant="solid"]
|
|
125
|
+
) {
|
|
126
|
+
color: var(--accent-12);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
:is(.button, .icon-button)[data-variant="solid"][data-high-contrast] {
|
|
130
|
+
background-color: var(--accent-12);
|
|
131
|
+
color: var(--accent-1);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
@media (hover: hover) {
|
|
135
|
+
:is(.button, .icon-button)[data-variant="solid"]:hover {
|
|
136
|
+
background-color: var(--accent-solid-hover);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
:is(.button, .icon-button)[data-variant="solid"][data-high-contrast]:hover {
|
|
140
|
+
background-color: var(--accent-12);
|
|
141
|
+
filter: contrast(0.88) saturate(1.1) brightness(1.1);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
:is(.button, .icon-button)[data-variant="soft"]:hover {
|
|
145
|
+
background-color: var(--accent-a4);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
:is(.button, .icon-button)[data-variant="surface"]:hover {
|
|
149
|
+
box-shadow: inset 0 0 0 1px var(--accent-a8);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
:is(.button, .icon-button)[data-variant="outline"]:hover {
|
|
153
|
+
background-color: var(--accent-a2);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
:is(.button, .icon-button)[data-variant="ghost"]:hover {
|
|
157
|
+
background-color: var(--accent-a3);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
:is(.button, .icon-button)[data-variant="soft"]:active,
|
|
162
|
+
:is(.button, .icon-button)[data-variant="soft"][data-popup-open] {
|
|
163
|
+
background-color: var(--accent-a5);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
:is(.button, .icon-button)[data-variant="surface"]:active,
|
|
167
|
+
:is(.button, .icon-button)[data-variant="outline"]:active,
|
|
168
|
+
:is(.button, .icon-button)[data-variant="surface"][data-popup-open],
|
|
169
|
+
:is(.button, .icon-button)[data-variant="outline"][data-popup-open] {
|
|
170
|
+
background-color: var(--accent-a3);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
:is(.button, .icon-button)[data-variant="ghost"]:active,
|
|
174
|
+
:is(.button, .icon-button)[data-variant="ghost"][data-popup-open] {
|
|
175
|
+
background-color: var(--accent-a4);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
:is(.button, .icon-button):active {
|
|
179
|
+
scale: 0.98;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
@media (prefers-reduced-motion: reduce) {
|
|
183
|
+
:is(.button, .icon-button):active {
|
|
184
|
+
scale: 1;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
:is(.button, .icon-button):focus-visible {
|
|
189
|
+
outline: var(--focus-ring-width) solid var(--line-focus);
|
|
190
|
+
outline-offset: var(--focus-ring-offset);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/* ---- loading and disabled ---- */
|
|
194
|
+
|
|
195
|
+
.button-content {
|
|
196
|
+
display: contents;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
:is(.button, .icon-button)[data-loading] .button-content {
|
|
200
|
+
visibility: hidden;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.button-spinner {
|
|
204
|
+
position: absolute;
|
|
205
|
+
inset: 0;
|
|
206
|
+
display: flex;
|
|
207
|
+
align-items: center;
|
|
208
|
+
justify-content: center;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
:is(.button, .icon-button):is(:disabled, [data-disabled]) {
|
|
212
|
+
cursor: not-allowed;
|
|
213
|
+
scale: 1;
|
|
214
|
+
filter: none;
|
|
215
|
+
color: var(--gray-a8);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
:is(.button, .icon-button):is(:disabled, [data-disabled]):is(
|
|
219
|
+
[data-variant="solid"],
|
|
220
|
+
[data-variant="soft"]
|
|
221
|
+
) {
|
|
222
|
+
background-color: var(--gray-a3);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
:is(.button, .icon-button):is(:disabled, [data-disabled]):is(
|
|
226
|
+
[data-variant="surface"],
|
|
227
|
+
[data-variant="outline"]
|
|
228
|
+
) {
|
|
229
|
+
background-color: transparent;
|
|
230
|
+
box-shadow: inset 0 0 0 1px var(--gray-a6);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
:is(.button, .icon-button):is(:disabled, [data-disabled])[
|
|
234
|
+
data-variant="ghost"
|
|
235
|
+
] {
|
|
236
|
+
background-color: transparent;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Part: callout
|
|
3
|
+
*
|
|
4
|
+
* <div class="callout" data-size="1|2|3" data-variant="soft|surface|outline"
|
|
5
|
+
* [data-color="accent|gray|danger|warning|success|info"]
|
|
6
|
+
* [data-high-contrast]>
|
|
7
|
+
* <div class="callout-icon" aria-hidden> an icon, before the message
|
|
8
|
+
* <p class="callout-text"> what happened; several stack
|
|
9
|
+
* <div class="callout-actions"> what answers it, at the end
|
|
10
|
+
*
|
|
11
|
+
* Radix Themes' callout on the system's scale: a message standing in a
|
|
12
|
+
* page or a list, its text and icon in the nearest `data-color`. Soft is a
|
|
13
|
+
* tint, surface a lighter tint with an edge, outline the edge alone. Texts
|
|
14
|
+
* stack in the middle column; the icon and the actions sit beside the
|
|
15
|
+
* first. Actions are the system's addition, so a notice can carry its
|
|
16
|
+
* Retry button.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
@layer components {
|
|
20
|
+
.callout {
|
|
21
|
+
--callout-gap: var(--space-3);
|
|
22
|
+
display: grid;
|
|
23
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
24
|
+
align-items: center;
|
|
25
|
+
row-gap: var(--space-2);
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
padding: var(--space-3) var(--space-4);
|
|
28
|
+
border-radius: calc(var(--shape-panel) * var(--corner-scale, 1));
|
|
29
|
+
corner-shape: var(--corner-shape, round);
|
|
30
|
+
color: var(--accent-text);
|
|
31
|
+
font-size: var(--font-size-2);
|
|
32
|
+
line-height: var(--line-height-2);
|
|
33
|
+
text-align: start;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.callout > * {
|
|
37
|
+
grid-column: 2;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* The edge columns' spacing is on their content, so an absent icon or
|
|
41
|
+
action leaves no gap. */
|
|
42
|
+
.callout-icon {
|
|
43
|
+
display: flex;
|
|
44
|
+
grid-row: 1;
|
|
45
|
+
grid-column: 1;
|
|
46
|
+
align-items: center;
|
|
47
|
+
margin-inline-end: var(--callout-gap);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.callout-icon svg {
|
|
51
|
+
width: var(--control-icon-size-3);
|
|
52
|
+
height: var(--control-icon-size-3);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.callout-text {
|
|
56
|
+
margin: 0;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.callout-actions {
|
|
60
|
+
display: flex;
|
|
61
|
+
grid-row: 1;
|
|
62
|
+
grid-column: 3;
|
|
63
|
+
align-items: center;
|
|
64
|
+
gap: var(--space-2);
|
|
65
|
+
margin-inline-start: var(--callout-gap);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* ---- sizes ---- */
|
|
69
|
+
|
|
70
|
+
.callout[data-size="1"] {
|
|
71
|
+
--callout-gap: var(--space-2);
|
|
72
|
+
padding: var(--space-2) var(--space-3);
|
|
73
|
+
font-size: var(--font-size-1);
|
|
74
|
+
line-height: var(--line-height-1);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.callout[data-size="1"] .callout-icon svg {
|
|
78
|
+
width: var(--control-icon-size-1);
|
|
79
|
+
height: var(--control-icon-size-1);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.callout[data-size="3"] {
|
|
83
|
+
--callout-gap: var(--space-4);
|
|
84
|
+
row-gap: var(--space-3);
|
|
85
|
+
padding: var(--space-4) var(--space-5);
|
|
86
|
+
font-size: var(--font-size-3);
|
|
87
|
+
line-height: var(--line-height-3);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* ---- variants ---- */
|
|
91
|
+
|
|
92
|
+
.callout[data-variant="soft"] {
|
|
93
|
+
background-color: var(--accent-a3);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.callout[data-variant="surface"] {
|
|
97
|
+
background-color: var(--accent-a2);
|
|
98
|
+
box-shadow: inset 0 0 0 1px var(--accent-a6);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.callout[data-variant="outline"] {
|
|
102
|
+
box-shadow: inset 0 0 0 1px var(--accent-a7);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.callout[data-high-contrast] {
|
|
106
|
+
color: var(--accent-12);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Part: card
|
|
3
|
+
*
|
|
4
|
+
* <div class="card" data-size="1|2|3|4|5" data-variant="surface|ghost">
|
|
5
|
+
* ... any content; an Inset runs to its edge
|
|
6
|
+
* <a href class="card" ...> a card that is a link
|
|
7
|
+
* <button class="card" ...> a card that is a button
|
|
8
|
+
*
|
|
9
|
+
* Radix Themes' card on the system's scale: sizes 1 to 5 pad it 8, 12, 16,
|
|
10
|
+
* 24 and 32px. Surface is the raised surface with a hairline drawn over its
|
|
11
|
+
* content, so media an Inset runs to the edge keeps the edge. Ghost has no
|
|
12
|
+
* frame: its padding hangs outside the box, so its content lines up with
|
|
13
|
+
* the content around it and its hover fill shows around it. A card that
|
|
14
|
+
* renders as a link, button or label takes hover, pressed and focus states.
|
|
15
|
+
* The corner is `--shape-card`, so a `data-radius` above it reaches it.
|
|
16
|
+
*
|
|
17
|
+
* Card hands Inset its padding, radius and edge as the `--inset-*`
|
|
18
|
+
* properties inset.css documents; Inset reads nothing else of the card.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
@layer components {
|
|
22
|
+
.card {
|
|
23
|
+
--card-padding: var(--space-3);
|
|
24
|
+
--card-border-width: 1px;
|
|
25
|
+
--card-radius: calc(var(--shape-card) * var(--corner-scale, 1));
|
|
26
|
+
--card-line: var(--line-subtle);
|
|
27
|
+
|
|
28
|
+
--inset-border-width: var(--card-border-width);
|
|
29
|
+
--inset-border-radius: var(--card-radius);
|
|
30
|
+
--inset-padding-top: calc(var(--card-padding) - var(--card-border-width));
|
|
31
|
+
--inset-padding-right: calc(var(--card-padding) - var(--card-border-width));
|
|
32
|
+
--inset-padding-bottom: calc(
|
|
33
|
+
var(--card-padding) - var(--card-border-width)
|
|
34
|
+
);
|
|
35
|
+
--inset-padding-left: calc(var(--card-padding) - var(--card-border-width));
|
|
36
|
+
|
|
37
|
+
position: relative;
|
|
38
|
+
display: block;
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
padding: var(--card-padding);
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
border: 0;
|
|
43
|
+
border-radius: var(--card-radius);
|
|
44
|
+
corner-shape: var(--corner-shape, round);
|
|
45
|
+
color: var(--fg-default);
|
|
46
|
+
font-weight: var(--font-weight-regular);
|
|
47
|
+
font-style: normal;
|
|
48
|
+
text-align: start;
|
|
49
|
+
text-decoration: none;
|
|
50
|
+
outline-style: none;
|
|
51
|
+
transition-property: background-color;
|
|
52
|
+
transition-duration: var(--duration-1);
|
|
53
|
+
transition-timing-function: var(--ease-standard);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* The edge, over the content so media an Inset brings to the edge keeps it. */
|
|
57
|
+
.card::after {
|
|
58
|
+
content: "";
|
|
59
|
+
position: absolute;
|
|
60
|
+
inset: 0;
|
|
61
|
+
border-radius: inherit;
|
|
62
|
+
corner-shape: inherit;
|
|
63
|
+
box-shadow: inset 0 0 0 var(--card-border-width) var(--card-line);
|
|
64
|
+
pointer-events: none;
|
|
65
|
+
transition: box-shadow var(--duration-1) var(--ease-standard);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
button.card {
|
|
69
|
+
width: 100%;
|
|
70
|
+
font: inherit;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* ---- sizes ---- */
|
|
74
|
+
|
|
75
|
+
.card[data-size="1"] {
|
|
76
|
+
--card-padding: var(--space-2);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.card[data-size="3"] {
|
|
80
|
+
--card-padding: var(--space-4);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.card[data-size="4"] {
|
|
84
|
+
--card-padding: var(--space-5);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.card[data-size="5"] {
|
|
88
|
+
--card-padding: var(--space-6);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* ---- variants ---- */
|
|
92
|
+
|
|
93
|
+
.card[data-variant="surface"] {
|
|
94
|
+
background-color: var(--surface-raised);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.card[data-variant="ghost"] {
|
|
98
|
+
--card-border-width: 0px;
|
|
99
|
+
margin: calc(var(--card-padding) * -1);
|
|
100
|
+
background-color: transparent;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* A button doesn't stretch as a block does; this one spans its margins too. */
|
|
104
|
+
button.card[data-variant="ghost"] {
|
|
105
|
+
width: calc(100% + var(--card-padding) * 2);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* ---- a card that is a control ---- */
|
|
109
|
+
|
|
110
|
+
@media (hover: hover) {
|
|
111
|
+
.card[data-variant="surface"]:is(a[href], button, label):hover {
|
|
112
|
+
--card-line: var(--gray-a7);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.card[data-variant="ghost"]:is(a[href], button, label):hover {
|
|
116
|
+
background-color: var(--gray-a3);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.card[data-variant="surface"]:is(a[href], button, label)[data-popup-open] {
|
|
121
|
+
--card-line: var(--gray-a7);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.card[data-variant="ghost"]:is(a[href], button, label)[data-popup-open] {
|
|
125
|
+
background-color: var(--gray-a3);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.card[data-variant="surface"]:is(a[href], button, label):active:not(
|
|
129
|
+
[data-popup-open]
|
|
130
|
+
) {
|
|
131
|
+
--card-line: var(--gray-a6);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.card[data-variant="ghost"]:is(a[href], button, label):active:not(
|
|
135
|
+
[data-popup-open]
|
|
136
|
+
) {
|
|
137
|
+
background-color: var(--gray-a4);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.card:focus-visible {
|
|
141
|
+
outline: var(--focus-ring-width) solid var(--line-focus);
|
|
142
|
+
outline-offset: var(--focus-ring-offset);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Part: checkbox-cards
|
|
3
|
+
*
|
|
4
|
+
* <div class="checkbox-cards" Base UI CheckboxGroup
|
|
5
|
+
* data-size="1|2|3" data-variant="surface|soft"
|
|
6
|
+
* [data-color="accent|gray|danger|warning|success|info"]
|
|
7
|
+
* [data-high-contrast]
|
|
8
|
+
* [style="--checkbox-cards-columns: …; --checkbox-cards-gap: …"]>
|
|
9
|
+
* <span class="checkbox-cards-item" role="checkbox" Checkbox.Root, with the group's
|
|
10
|
+
* data-size data-variant [data-color] props written on it, holding
|
|
11
|
+
* [data-high-contrast] [data-checked] the card's content
|
|
12
|
+
* [data-unchecked] [data-invalid] [data-disabled]>
|
|
13
|
+
* <span class="checkbox checkbox-cards-checkbox" Checkbox.Indicator, always mounted:
|
|
14
|
+
* data-size data-variant="surface" the checkbox part at the card's
|
|
15
|
+
* [data-checked] [data-unchecked] ...> size, drawn for the card
|
|
16
|
+
* <span class="checkbox-indicator"> a check, while checked
|
|
17
|
+
*
|
|
18
|
+
* Radix Themes' checkbox cards: a grid of cards, each a checkbox whose
|
|
19
|
+
* content is its name, so the whole card is the hit area. The cards draw
|
|
20
|
+
* with radio-cards.css's `.checkbox-cards-item` rules (sizes, surface and
|
|
21
|
+
* soft, hover, focus, disabled), so the two stay one look. Here: the grid,
|
|
22
|
+
* whose columns are `--checkbox-cards-columns` (cards at least 200px wide,
|
|
23
|
+
* as many as fit, by default) and gap `--checkbox-cards-gap`, and the
|
|
24
|
+
* corner checkbox at the card's inline end, the checkbox part at the
|
|
25
|
+
* card's size. As in Radix, the checkbox alone shows the card is checked.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
@layer components {
|
|
29
|
+
.checkbox-cards {
|
|
30
|
+
display: grid;
|
|
31
|
+
grid-template-columns: var(
|
|
32
|
+
--checkbox-cards-columns,
|
|
33
|
+
repeat(auto-fit, minmax(200px, 1fr))
|
|
34
|
+
);
|
|
35
|
+
gap: var(--checkbox-cards-gap, var(--space-4));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* Room at the inline end for the checkbox: its width, kept in step with
|
|
39
|
+
checkbox.css's sizes, and the card's padding on both sides of it. */
|
|
40
|
+
.checkbox-cards-item {
|
|
41
|
+
--_box: var(--space-4);
|
|
42
|
+
--_padding-end: calc(var(--_padding-x) * 2 + var(--_box));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.checkbox-cards-item[data-size="1"] {
|
|
46
|
+
--_box: var(--space-3);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.checkbox-cards-item[data-size="3"] {
|
|
50
|
+
--_box: calc(var(--space-4) * 1.25);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.checkbox-cards-item > .checkbox-cards-checkbox {
|
|
54
|
+
position: absolute;
|
|
55
|
+
top: 50%;
|
|
56
|
+
inset-inline-end: var(--_padding-x);
|
|
57
|
+
translate: 0 -50%;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Part: checkbox-group
|
|
3
|
+
*
|
|
4
|
+
* <div class="checkbox-group" Base UI CheckboxGroup
|
|
5
|
+
* data-size="1|2|3" data-variant="surface|soft"
|
|
6
|
+
* [data-color] [data-high-contrast]>
|
|
7
|
+
* <span class="checkbox"> Checkbox, one per value
|
|
8
|
+
*
|
|
9
|
+
* Stacks its checkboxes, each usually inside a Field. Its props are the
|
|
10
|
+
* defaults of the checkboxes inside it, which draw them; the group itself
|
|
11
|
+
* only lays them out.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
@layer components {
|
|
15
|
+
.checkbox-group {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
gap: var(--space-2);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Part: checkbox
|
|
3
|
+
*
|
|
4
|
+
* <span class="checkbox" role="checkbox" Base UI Checkbox.Root
|
|
5
|
+
* data-size="1|2|3" data-variant="surface|soft"
|
|
6
|
+
* [data-color="accent|gray|danger|warning|success|info"]
|
|
7
|
+
* [data-high-contrast] [data-checked] [data-unchecked]
|
|
8
|
+
* [data-indeterminate] [data-invalid] [data-disabled]>
|
|
9
|
+
* <span class="checkbox-indicator"> Checkbox.Indicator, a check or a dash
|
|
10
|
+
*
|
|
11
|
+
* Radix Themes' checkbox on the system's scale: sizes 1 to 3 are 12, 16 and
|
|
12
|
+
* 20px boxes, each with a hit area 4px wider on every side. Surface is a
|
|
13
|
+
* field with a gray edge that fills with the nearest color's indicator when
|
|
14
|
+
* checked; soft is a tint whose check is drawn in the color's text step.
|
|
15
|
+
* The unchecked edge is gray step a10, not Radix's a7, so the box keeps a
|
|
16
|
+
* 3:1 contrast against the page.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
@layer components {
|
|
20
|
+
.checkbox {
|
|
21
|
+
--_size: var(--space-4);
|
|
22
|
+
--_indicator: var(--control-icon-size-1);
|
|
23
|
+
|
|
24
|
+
position: relative;
|
|
25
|
+
display: inline-flex;
|
|
26
|
+
flex-shrink: 0;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
box-sizing: border-box;
|
|
30
|
+
width: var(--_size);
|
|
31
|
+
height: var(--_size);
|
|
32
|
+
border-radius: calc(var(--radius-2) * var(--corner-scale, 1));
|
|
33
|
+
corner-shape: var(--corner-shape, round);
|
|
34
|
+
vertical-align: top;
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
outline-style: none;
|
|
37
|
+
transition-property: color, background-color, box-shadow;
|
|
38
|
+
transition-duration: var(--duration-1);
|
|
39
|
+
transition-timing-function: var(--ease-standard);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.checkbox::after {
|
|
43
|
+
content: "";
|
|
44
|
+
position: absolute;
|
|
45
|
+
inset: calc(var(--space-1) * -1);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.checkbox-indicator {
|
|
49
|
+
display: flex;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.checkbox-indicator svg {
|
|
53
|
+
width: var(--_indicator);
|
|
54
|
+
height: var(--_indicator);
|
|
55
|
+
stroke-width: 3;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* ---- sizes ---- */
|
|
59
|
+
|
|
60
|
+
.checkbox[data-size="1"] {
|
|
61
|
+
--_size: var(--space-3);
|
|
62
|
+
--_indicator: 10px;
|
|
63
|
+
|
|
64
|
+
border-radius: calc(var(--radius-2) * 0.75 * var(--corner-scale, 1));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.checkbox[data-size="3"] {
|
|
68
|
+
--_size: calc(var(--space-4) * 1.25);
|
|
69
|
+
--_indicator: var(--control-icon-size-3);
|
|
70
|
+
|
|
71
|
+
border-radius: calc(var(--radius-2) * 1.25 * var(--corner-scale, 1));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* ---- variants ---- */
|
|
75
|
+
|
|
76
|
+
.checkbox[data-variant="surface"] {
|
|
77
|
+
background-color: var(--fill-field);
|
|
78
|
+
box-shadow: inset 0 0 0 1px var(--gray-a10);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.checkbox[data-variant="surface"]:where(
|
|
82
|
+
[data-checked],
|
|
83
|
+
[data-indeterminate]
|
|
84
|
+
) {
|
|
85
|
+
background-color: var(--accent-indicator);
|
|
86
|
+
box-shadow: none;
|
|
87
|
+
color: var(--accent-contrast);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.checkbox[data-variant="surface"][data-high-contrast]:where(
|
|
91
|
+
[data-checked],
|
|
92
|
+
[data-indeterminate]
|
|
93
|
+
) {
|
|
94
|
+
background-color: var(--accent-12);
|
|
95
|
+
color: var(--accent-1);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.checkbox[data-variant="soft"] {
|
|
99
|
+
background-color: var(--accent-a5);
|
|
100
|
+
color: var(--accent-text);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.checkbox[data-variant="soft"][data-high-contrast] {
|
|
104
|
+
color: var(--accent-12);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.checkbox[data-invalid][data-unchecked] {
|
|
108
|
+
box-shadow: inset 0 0 0 1px var(--fill-danger);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.checkbox:focus-visible {
|
|
112
|
+
outline: var(--focus-ring-width) solid var(--line-focus);
|
|
113
|
+
outline-offset: var(--focus-ring-offset);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/* ---- disabled ---- */
|
|
117
|
+
|
|
118
|
+
.checkbox[data-disabled][data-variant] {
|
|
119
|
+
cursor: not-allowed;
|
|
120
|
+
background-color: var(--gray-a3);
|
|
121
|
+
color: var(--gray-a8);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.checkbox[data-disabled][data-variant="surface"] {
|
|
125
|
+
box-shadow: inset 0 0 0 1px var(--gray-a6);
|
|
126
|
+
}
|
|
127
|
+
}
|