@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,194 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Part: code
|
|
3
|
+
*
|
|
4
|
+
* <code class="code" data-variant="solid|soft|outline|ghost"
|
|
5
|
+
* [data-size="0–9"] [data-weight="light|regular|medium|semibold|bold"]
|
|
6
|
+
* [data-truncate] [data-wrap="wrap|nowrap|pretty|balance"]
|
|
7
|
+
* [data-color="accent|gray|danger|warning|success|info"]
|
|
8
|
+
* [data-high-contrast]>
|
|
9
|
+
*
|
|
10
|
+
* Radix Themes' code: inline code in the mono family, sized in em so it
|
|
11
|
+
* follows the text around it, or a step of the type scale when `size` is
|
|
12
|
+
* set. Variants fill as Badge's do. Ghost drops the padding and the fill,
|
|
13
|
+
* and keeps the surrounding text's color unless a color is set. Inside a
|
|
14
|
+
* link, or rendered as one, it takes a hover fill. The weight,
|
|
15
|
+
* truncation and wrapping are in text.css.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
@layer components {
|
|
19
|
+
.code {
|
|
20
|
+
/* Radix's mono adjustments: filled variants sit a step smaller than ghost. */
|
|
21
|
+
--code-scale: 0.9025;
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
/* Holds its own height in a flex or grid row instead of stretching. */
|
|
24
|
+
height: fit-content;
|
|
25
|
+
padding: 0.1em 0.25em;
|
|
26
|
+
border-radius: calc((0.5px + 0.2em) * var(--radius-factor));
|
|
27
|
+
corner-shape: var(--corner-shape, round);
|
|
28
|
+
font-family: var(--font-family-mono);
|
|
29
|
+
font-size: calc(var(--code-scale) * 1em);
|
|
30
|
+
font-style: normal;
|
|
31
|
+
line-height: 1.25;
|
|
32
|
+
letter-spacing: -0.007em;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.code .code {
|
|
36
|
+
font-size: inherit;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* ---- sizes ---- */
|
|
40
|
+
|
|
41
|
+
.code[data-size="0"] {
|
|
42
|
+
font-size: calc(var(--font-size-0) * var(--code-scale));
|
|
43
|
+
line-height: var(--line-height-0);
|
|
44
|
+
letter-spacing: calc(var(--letter-spacing-0) - 0.007em);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.code[data-size="1"] {
|
|
48
|
+
font-size: calc(var(--font-size-1) * var(--code-scale));
|
|
49
|
+
line-height: var(--line-height-1);
|
|
50
|
+
letter-spacing: calc(var(--letter-spacing-1) - 0.007em);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.code[data-size="2"] {
|
|
54
|
+
font-size: calc(var(--font-size-2) * var(--code-scale));
|
|
55
|
+
line-height: var(--line-height-2);
|
|
56
|
+
letter-spacing: calc(var(--letter-spacing-2) - 0.007em);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.code[data-size="3"] {
|
|
60
|
+
font-size: calc(var(--font-size-3) * var(--code-scale));
|
|
61
|
+
line-height: var(--line-height-3);
|
|
62
|
+
letter-spacing: calc(var(--letter-spacing-3) - 0.007em);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.code[data-size="4"] {
|
|
66
|
+
font-size: calc(var(--font-size-4) * var(--code-scale));
|
|
67
|
+
line-height: var(--line-height-4);
|
|
68
|
+
letter-spacing: calc(var(--letter-spacing-4) - 0.007em);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.code[data-size="5"] {
|
|
72
|
+
font-size: calc(var(--font-size-5) * var(--code-scale));
|
|
73
|
+
line-height: var(--line-height-5);
|
|
74
|
+
letter-spacing: calc(var(--letter-spacing-5) - 0.007em);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.code[data-size="6"] {
|
|
78
|
+
font-size: calc(var(--font-size-6) * var(--code-scale));
|
|
79
|
+
line-height: var(--line-height-6);
|
|
80
|
+
letter-spacing: calc(var(--letter-spacing-6) - 0.007em);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.code[data-size="7"] {
|
|
84
|
+
font-size: calc(var(--font-size-7) * var(--code-scale));
|
|
85
|
+
line-height: var(--line-height-7);
|
|
86
|
+
letter-spacing: calc(var(--letter-spacing-7) - 0.007em);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.code[data-size="8"] {
|
|
90
|
+
font-size: calc(var(--font-size-8) * var(--code-scale));
|
|
91
|
+
line-height: var(--line-height-8);
|
|
92
|
+
letter-spacing: calc(var(--letter-spacing-8) - 0.007em);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.code[data-size="9"] {
|
|
96
|
+
font-size: calc(var(--font-size-9) * var(--code-scale));
|
|
97
|
+
line-height: var(--line-height-9);
|
|
98
|
+
letter-spacing: calc(var(--letter-spacing-9) - 0.007em);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* ---- variants ---- */
|
|
102
|
+
|
|
103
|
+
.code[data-variant="solid"] {
|
|
104
|
+
background-color: var(--accent-solid);
|
|
105
|
+
color: var(--accent-contrast);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.code[data-variant="solid"]::selection {
|
|
109
|
+
background-color: var(--accent-7);
|
|
110
|
+
color: var(--accent-12);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.code[data-variant="solid"][data-high-contrast] {
|
|
114
|
+
background-color: var(--accent-12);
|
|
115
|
+
color: var(--accent-1);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.code[data-variant="solid"][data-high-contrast]::selection {
|
|
119
|
+
background-color: var(--accent-solid);
|
|
120
|
+
color: var(--accent-contrast);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.code[data-variant="soft"] {
|
|
124
|
+
background-color: var(--accent-a3);
|
|
125
|
+
color: var(--accent-text);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.code[data-variant="outline"] {
|
|
129
|
+
box-shadow: inset 0 0 0 max(1px, 0.033em) var(--accent-a8);
|
|
130
|
+
color: var(--accent-text);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.code[data-variant="outline"][data-high-contrast] {
|
|
134
|
+
box-shadow:
|
|
135
|
+
inset 0 0 0 max(1px, 0.033em) var(--accent-a7),
|
|
136
|
+
inset 0 0 0 max(1px, 0.033em) var(--gray-a11);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.code[data-variant="ghost"] {
|
|
140
|
+
--code-scale: 0.95;
|
|
141
|
+
padding: 0;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.code[data-variant="ghost"][data-color] {
|
|
145
|
+
color: var(--accent-text);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.code:is([data-variant="soft"], [data-variant="outline"])[data-high-contrast],
|
|
149
|
+
.code[data-variant="ghost"][data-color][data-high-contrast],
|
|
150
|
+
[data-color] .code[data-variant="ghost"][data-high-contrast] {
|
|
151
|
+
color: var(--accent-12);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/* ---- in a link ---- */
|
|
155
|
+
|
|
156
|
+
@media (hover: hover) {
|
|
157
|
+
:is(.link .code, .code:is(:any-link, button))[data-variant="solid"]:hover {
|
|
158
|
+
background-color: var(--accent-solid-hover);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
:is(
|
|
162
|
+
.link .code,
|
|
163
|
+
.code:is(:any-link, button)
|
|
164
|
+
)[data-variant="solid"][data-high-contrast]:hover {
|
|
165
|
+
background-color: var(--accent-12);
|
|
166
|
+
filter: contrast(0.88) saturate(1.1) brightness(1.1);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
:is(.link .code, .code:is(:any-link, button))[data-variant="soft"]:hover {
|
|
170
|
+
background-color: var(--accent-a4);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
:is(
|
|
174
|
+
.link .code,
|
|
175
|
+
.code:is(:any-link, button)
|
|
176
|
+
)[data-variant="outline"]:hover {
|
|
177
|
+
background-color: var(--accent-a2);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
:is(.link .code, .code:is(:any-link, button)) {
|
|
182
|
+
/* Its own stacking context at rest, so the hover filter doesn't open one. */
|
|
183
|
+
isolation: isolate;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.code:is(:any-link, button) {
|
|
187
|
+
cursor: pointer;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.code:is(:any-link, button):focus-visible {
|
|
191
|
+
outline: var(--focus-ring-width) solid var(--line-focus);
|
|
192
|
+
outline-offset: var(--focus-ring-offset);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Part: collapsible
|
|
3
|
+
*
|
|
4
|
+
* <div class="collapsible"> Base UI Collapsible.Root
|
|
5
|
+
* <button class="collapsible-trigger" Collapsible.Trigger [data-panel-open]
|
|
6
|
+
* <div class="collapsible-panel"> Collapsible.Panel [data-open]
|
|
7
|
+
*
|
|
8
|
+
* Behavior only, as Radix's Collapsible primitive: the trigger takes the
|
|
9
|
+
* look of whatever it renders as (an Icon Button, an Item), a chevron
|
|
10
|
+
* marked `collapsible-chevron` turning as the panel opens, and the panel
|
|
11
|
+
* animates its height open and closed.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
@layer components {
|
|
15
|
+
.collapsible-chevron {
|
|
16
|
+
transition: rotate var(--duration-2) var(--ease-standard);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.collapsible-trigger[data-panel-open] .collapsible-chevron {
|
|
20
|
+
rotate: 180deg;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.collapsible-panel {
|
|
24
|
+
height: var(--collapsible-panel-height);
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
transition: height var(--duration-2) var(--ease-standard);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.collapsible-panel[data-starting-style],
|
|
30
|
+
.collapsible-panel[data-ending-style] {
|
|
31
|
+
height: 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@media (prefers-reduced-motion: reduce) {
|
|
35
|
+
.collapsible-chevron,
|
|
36
|
+
.collapsible-panel {
|
|
37
|
+
transition: none;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Part: combobox
|
|
3
|
+
*
|
|
4
|
+
* <div class="input" Base UI Combobox.InputGroup, drawn by input.css
|
|
5
|
+
* data-size="1|2|3|4" data-variant="surface|soft"
|
|
6
|
+
* [data-color] [data-radius] [data-popup-open] [data-placeholder] [data-disabled]>
|
|
7
|
+
* <input class="input-control"> Combobox.Input; or, with `multiple`:
|
|
8
|
+
* <div class="combobox-chips"> Combobox.Chips
|
|
9
|
+
* <div class="combobox-chip" [data-disabled]> Combobox.Chip, one per selected value
|
|
10
|
+
* label
|
|
11
|
+
* <button class="combobox-chip-remove"> Combobox.ChipRemove
|
|
12
|
+
* <input class="input-control">
|
|
13
|
+
* <div class="input-slot">
|
|
14
|
+
* <button class="combobox-clear"> Combobox.Clear, while there is a value
|
|
15
|
+
* <button class="combobox-trigger"> Combobox.Trigger [data-popup-open]
|
|
16
|
+
*
|
|
17
|
+
* <div class="combobox-positioner">
|
|
18
|
+
* <div class="combobox-popup" …> as the autocomplete's popup
|
|
19
|
+
* <div class="combobox-status"> <div class="combobox-empty">
|
|
20
|
+
* <div class="combobox-list" role="listbox">
|
|
21
|
+
* <div class="combobox-group"> <div class="combobox-group-label">
|
|
22
|
+
* <div class="combobox-item" [data-highlighted] [data-selected] [data-disabled]
|
|
23
|
+
* <span class="combobox-item-indicator"> Combobox.ItemIndicator, the check
|
|
24
|
+
* label
|
|
25
|
+
* <div class="combobox-separator">
|
|
26
|
+
*
|
|
27
|
+
* A select you can filter. Its field is the input part and its popup and
|
|
28
|
+
* rows are the autocomplete's: autocomplete.css draws both parts' classes.
|
|
29
|
+
* This file adds what selection needs. Rows reserve a leading column for the
|
|
30
|
+
* check, as Select's do, so labels and group labels share one start edge.
|
|
31
|
+
*
|
|
32
|
+
* With `multiple`, the selected values are chips before the text, and the
|
|
33
|
+
* field grows a line at a time to hold them. Chips are 16px (20px in a size
|
|
34
|
+
* 4 field), inset from the edge by half the difference to the field's
|
|
35
|
+
* height, as an icon is. They are neutral in a surface field and take the
|
|
36
|
+
* color in a soft one. Arrow keys and Backspace move into them from the
|
|
37
|
+
* text, so a focused chip shows the focus ring.
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
@layer components {
|
|
41
|
+
/* ---- the check column ---- */
|
|
42
|
+
|
|
43
|
+
:is(.combobox-item, .combobox-group-label) {
|
|
44
|
+
padding-inline-start: calc(
|
|
45
|
+
var(--space-2) + var(--_row-icon, var(--control-icon-size-3)) +
|
|
46
|
+
var(--control-gap)
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.combobox-item-indicator {
|
|
51
|
+
position: absolute;
|
|
52
|
+
inset-inline-start: var(--space-2);
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
width: var(--_row-icon, var(--control-icon-size-3));
|
|
57
|
+
height: var(--_row-icon, var(--control-icon-size-3));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* ---- chips ---- */
|
|
61
|
+
|
|
62
|
+
.input:has(> .combobox-chips) {
|
|
63
|
+
align-items: flex-start;
|
|
64
|
+
height: auto;
|
|
65
|
+
min-height: var(--_height);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.input:has(> .combobox-chips) > .input-slot {
|
|
69
|
+
min-height: var(--_height);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.combobox-chips {
|
|
73
|
+
--_chip: var(--control-height-1);
|
|
74
|
+
--_chip-inset: calc((var(--_height) - var(--_chip)) / 2);
|
|
75
|
+
|
|
76
|
+
display: flex;
|
|
77
|
+
flex: 1;
|
|
78
|
+
flex-wrap: wrap;
|
|
79
|
+
align-items: center;
|
|
80
|
+
gap: var(--space-1);
|
|
81
|
+
box-sizing: border-box;
|
|
82
|
+
min-width: 0;
|
|
83
|
+
padding: var(--_chip-inset);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.input[data-size="4"] > .combobox-chips {
|
|
87
|
+
--_chip: var(--control-height-2);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.combobox-chips > .input-control {
|
|
91
|
+
flex: 1 0 var(--space-9);
|
|
92
|
+
width: auto;
|
|
93
|
+
min-width: var(--space-9);
|
|
94
|
+
height: var(--_chip);
|
|
95
|
+
padding-inline: calc(var(--_padding) - var(--_chip-inset));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.combobox-chip ~ .input-control {
|
|
99
|
+
padding-inline-start: var(--space-1);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.combobox-chip {
|
|
103
|
+
display: inline-flex;
|
|
104
|
+
flex-shrink: 0;
|
|
105
|
+
align-items: center;
|
|
106
|
+
box-sizing: border-box;
|
|
107
|
+
max-width: 100%;
|
|
108
|
+
height: var(--_chip);
|
|
109
|
+
padding-inline-start: calc(var(--space-1) * 1.5);
|
|
110
|
+
/* Concentric with the field: its radius less the inset. */
|
|
111
|
+
border-radius: max(
|
|
112
|
+
0px,
|
|
113
|
+
calc(var(--shape-control) * var(--corner-scale, 1) - var(--_chip-inset))
|
|
114
|
+
);
|
|
115
|
+
corner-shape: var(--corner-shape, round);
|
|
116
|
+
background-color: var(--gray-a4);
|
|
117
|
+
color: var(--fg-default);
|
|
118
|
+
font-size: var(--font-size-1);
|
|
119
|
+
line-height: var(--line-height-1);
|
|
120
|
+
white-space: nowrap;
|
|
121
|
+
cursor: default;
|
|
122
|
+
outline-style: none;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.input[data-variant="soft"] .combobox-chip {
|
|
126
|
+
background-color: var(--accent-a4);
|
|
127
|
+
color: var(--accent-12);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.combobox-chip:focus-visible {
|
|
131
|
+
outline: var(--focus-ring-width) solid var(--line-focus);
|
|
132
|
+
outline-offset: var(--focus-ring-offset);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.combobox-chip[data-disabled] {
|
|
136
|
+
background-color: var(--gray-a3);
|
|
137
|
+
color: var(--gray-a8);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.combobox-chip-remove {
|
|
141
|
+
display: inline-flex;
|
|
142
|
+
flex-shrink: 0;
|
|
143
|
+
align-items: center;
|
|
144
|
+
justify-content: center;
|
|
145
|
+
width: var(--_chip);
|
|
146
|
+
height: var(--_chip);
|
|
147
|
+
margin: 0;
|
|
148
|
+
padding: 0;
|
|
149
|
+
border: 0;
|
|
150
|
+
border-radius: inherit;
|
|
151
|
+
background-color: transparent;
|
|
152
|
+
color: inherit;
|
|
153
|
+
cursor: default;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.combobox-chip-remove svg {
|
|
157
|
+
width: var(--control-icon-size-1);
|
|
158
|
+
height: var(--control-icon-size-1);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
@media (hover: hover) {
|
|
162
|
+
.combobox-chip-remove:not([data-disabled]):hover {
|
|
163
|
+
background-color: var(--gray-a4);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.input[data-variant="soft"]
|
|
167
|
+
.combobox-chip-remove:not([data-disabled]):hover {
|
|
168
|
+
background-color: var(--accent-a4);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Part: context-menu
|
|
3
|
+
*
|
|
4
|
+
* <div class="context-menu-trigger"> Base UI ContextMenu.Trigger
|
|
5
|
+
*
|
|
6
|
+
* Everything else a context menu draws is the menu part's: its popup, rows
|
|
7
|
+
* and submenus are `.menu-*`, with the same `data-size`, `data-variant`,
|
|
8
|
+
* `data-color` and `data-high-contrast` on the popup and `data-color` on a
|
|
9
|
+
* row. menu.css is their one stylesheet.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
@layer components {
|
|
13
|
+
/* A long press opens the menu, so the system's own press callout stays out
|
|
14
|
+
of its way. */
|
|
15
|
+
.context-menu-trigger {
|
|
16
|
+
-webkit-touch-callout: none;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Part: data-list
|
|
3
|
+
*
|
|
4
|
+
* <dl class="data-list" data-orientation="horizontal|vertical"
|
|
5
|
+
* data-size="1|2|3" [data-trim="normal|start|end|both"]>
|
|
6
|
+
* <div class="data-list-item">
|
|
7
|
+
* <dt class="data-list-label">
|
|
8
|
+
* <dd class="data-list-value">
|
|
9
|
+
*
|
|
10
|
+
* Radix Themes' data list: label and value pairs. Horizontal sets the
|
|
11
|
+
* labels in one column beside their values, aligned on the first line's
|
|
12
|
+
* baseline; vertical stacks each label over its value. Sizes 1 to 3 step
|
|
13
|
+
* the type (12, 14 and 16px) and the space between rows. A taller value,
|
|
14
|
+
* such as a Badge or a Button, may hang a little past its row in a
|
|
15
|
+
* horizontal list so the rows keep the type's rhythm; the first and last
|
|
16
|
+
* rows keep it inside the list. `trim` removes the half-leading above the
|
|
17
|
+
* first row, below the last, or both, so the list sits flush with its box.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
@layer components {
|
|
21
|
+
.data-list {
|
|
22
|
+
--data-list-gap: var(--space-3);
|
|
23
|
+
--data-list-line-height: var(--line-height-2);
|
|
24
|
+
--data-list-trim: calc((1em - var(--data-list-line-height)) / 2);
|
|
25
|
+
|
|
26
|
+
margin: 0;
|
|
27
|
+
gap: var(--data-list-gap);
|
|
28
|
+
color: var(--fg-default);
|
|
29
|
+
font-size: var(--font-size-2);
|
|
30
|
+
font-weight: var(--font-weight-regular);
|
|
31
|
+
font-style: normal;
|
|
32
|
+
line-height: var(--data-list-line-height);
|
|
33
|
+
text-align: start;
|
|
34
|
+
overflow-wrap: anywhere;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.data-list-label {
|
|
38
|
+
display: flex;
|
|
39
|
+
color: var(--fg-muted);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.data-list-value {
|
|
43
|
+
display: flex;
|
|
44
|
+
min-width: 0;
|
|
45
|
+
margin: 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* A zero-width joiner gives an empty or flex-only cell a baseline to align on. */
|
|
49
|
+
.data-list-label::before,
|
|
50
|
+
.data-list-value::before {
|
|
51
|
+
content: "\200D";
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* ---- sizes ---- */
|
|
55
|
+
|
|
56
|
+
.data-list[data-size="1"] {
|
|
57
|
+
--data-list-gap: var(--space-2);
|
|
58
|
+
--data-list-line-height: var(--line-height-1);
|
|
59
|
+
font-size: var(--font-size-1);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.data-list[data-size="3"] {
|
|
63
|
+
--data-list-gap: var(--space-4);
|
|
64
|
+
--data-list-line-height: var(--line-height-3);
|
|
65
|
+
font-size: var(--font-size-3);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* ---- orientation ---- */
|
|
69
|
+
|
|
70
|
+
.data-list[data-orientation="horizontal"] {
|
|
71
|
+
display: grid;
|
|
72
|
+
grid-template-columns: auto 1fr;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.data-list[data-orientation="horizontal"] .data-list-item {
|
|
76
|
+
display: grid;
|
|
77
|
+
grid-template-columns: inherit;
|
|
78
|
+
grid-template-columns: subgrid;
|
|
79
|
+
grid-column: span 2;
|
|
80
|
+
gap: inherit;
|
|
81
|
+
align-items: baseline;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.data-list[data-orientation="horizontal"] .data-list-label {
|
|
85
|
+
min-width: 120px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.data-list[data-orientation="horizontal"] .data-list-value {
|
|
89
|
+
margin-block: -0.25em;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.data-list[data-orientation="horizontal"]
|
|
93
|
+
.data-list-item:first-child
|
|
94
|
+
.data-list-value {
|
|
95
|
+
margin-top: 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.data-list[data-orientation="horizontal"]
|
|
99
|
+
.data-list-item:last-child
|
|
100
|
+
.data-list-value {
|
|
101
|
+
margin-bottom: 0;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.data-list[data-orientation="vertical"] {
|
|
105
|
+
display: flex;
|
|
106
|
+
flex-direction: column;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.data-list[data-orientation="vertical"] .data-list-item {
|
|
110
|
+
display: flex;
|
|
111
|
+
flex-direction: column;
|
|
112
|
+
gap: var(--space-1);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.data-list[data-orientation="vertical"] .data-list-label {
|
|
116
|
+
min-width: 0;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* ---- trim ---- */
|
|
120
|
+
|
|
121
|
+
.data-list:is([data-trim="start"], [data-trim="both"])
|
|
122
|
+
.data-list-item:first-child {
|
|
123
|
+
margin-top: var(--data-list-trim);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.data-list:is([data-trim="end"], [data-trim="both"])
|
|
127
|
+
.data-list-item:last-child {
|
|
128
|
+
margin-bottom: var(--data-list-trim);
|
|
129
|
+
}
|
|
130
|
+
}
|