@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,245 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Part: text
|
|
3
|
+
*
|
|
4
|
+
* <span|div|label|p class="text" [data-size="0–9"]
|
|
5
|
+
* [data-weight="light|regular|medium|semibold|bold"]
|
|
6
|
+
* [data-align="left|center|right"]
|
|
7
|
+
* [data-trim="normal|start|end|both"] [data-truncate]
|
|
8
|
+
* [data-wrap="wrap|nowrap|pretty|balance"]
|
|
9
|
+
* [data-color="accent|gray|danger|warning|success|info"]
|
|
10
|
+
* [data-high-contrast]>
|
|
11
|
+
*
|
|
12
|
+
* Radix Themes' text on the system's type scale. Unset, `size` inherits the
|
|
13
|
+
* surrounding text's size and line height, and the text keeps the color
|
|
14
|
+
* around it. A color draws it in the scale's text step; high contrast in
|
|
15
|
+
* step 12, which also applies inside any element that sets a color.
|
|
16
|
+
*
|
|
17
|
+
* This file also holds the text props the other text components share, as
|
|
18
|
+
* Radix keeps them in shared utilities, each taking the ones its
|
|
19
|
+
* definition lists: heading all of them; link all but alignment;
|
|
20
|
+
* blockquote size, weight, truncate, wrap and color; code weight,
|
|
21
|
+
* truncate and wrap; em, strong and quote truncate and wrap. Truncating needs a block or a flex or grid item: an inline
|
|
22
|
+
* element doesn't clip.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
@layer components {
|
|
26
|
+
.text {
|
|
27
|
+
margin: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@media (pointer: coarse) {
|
|
31
|
+
label.text {
|
|
32
|
+
-webkit-tap-highlight-color: transparent;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
label.text:active {
|
|
36
|
+
outline: 0.75em solid var(--gray-a4);
|
|
37
|
+
outline-offset: -0.6em;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* ---- sizes ---- */
|
|
42
|
+
|
|
43
|
+
:is(.text, .heading, .link, .blockquote)[data-size="0"] {
|
|
44
|
+
font-size: var(--font-size-0);
|
|
45
|
+
line-height: var(--line-height-0);
|
|
46
|
+
letter-spacing: var(--letter-spacing-0);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:is(.text, .heading, .link, .blockquote)[data-size="1"] {
|
|
50
|
+
font-size: var(--font-size-1);
|
|
51
|
+
line-height: var(--line-height-1);
|
|
52
|
+
letter-spacing: var(--letter-spacing-1);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:is(.text, .heading, .link, .blockquote)[data-size="2"] {
|
|
56
|
+
font-size: var(--font-size-2);
|
|
57
|
+
line-height: var(--line-height-2);
|
|
58
|
+
letter-spacing: var(--letter-spacing-2);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:is(.text, .heading, .link, .blockquote)[data-size="3"] {
|
|
62
|
+
font-size: var(--font-size-3);
|
|
63
|
+
line-height: var(--line-height-3);
|
|
64
|
+
letter-spacing: var(--letter-spacing-3);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:is(.text, .heading, .link, .blockquote)[data-size="4"] {
|
|
68
|
+
font-size: var(--font-size-4);
|
|
69
|
+
line-height: var(--line-height-4);
|
|
70
|
+
letter-spacing: var(--letter-spacing-4);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:is(.text, .heading, .link, .blockquote)[data-size="5"] {
|
|
74
|
+
font-size: var(--font-size-5);
|
|
75
|
+
line-height: var(--line-height-5);
|
|
76
|
+
letter-spacing: var(--letter-spacing-5);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:is(.text, .heading, .link, .blockquote)[data-size="6"] {
|
|
80
|
+
font-size: var(--font-size-6);
|
|
81
|
+
line-height: var(--line-height-6);
|
|
82
|
+
letter-spacing: var(--letter-spacing-6);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
:is(.text, .heading, .link, .blockquote)[data-size="7"] {
|
|
86
|
+
font-size: var(--font-size-7);
|
|
87
|
+
line-height: var(--line-height-7);
|
|
88
|
+
letter-spacing: var(--letter-spacing-7);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
:is(.text, .heading, .link, .blockquote)[data-size="8"] {
|
|
92
|
+
font-size: var(--font-size-8);
|
|
93
|
+
line-height: var(--line-height-8);
|
|
94
|
+
letter-spacing: var(--letter-spacing-8);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:is(.text, .heading, .link, .blockquote)[data-size="9"] {
|
|
98
|
+
font-size: var(--font-size-9);
|
|
99
|
+
line-height: var(--line-height-9);
|
|
100
|
+
letter-spacing: var(--letter-spacing-9);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* ---- weight and alignment ---- */
|
|
104
|
+
|
|
105
|
+
:is(.text, .heading, .link, .blockquote, .code)[data-weight="light"] {
|
|
106
|
+
font-weight: var(--font-weight-light);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
:is(.text, .heading, .link, .blockquote, .code)[data-weight="regular"] {
|
|
110
|
+
font-weight: var(--font-weight-regular);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
:is(.text, .heading, .link, .blockquote, .code)[data-weight="medium"] {
|
|
114
|
+
font-weight: var(--font-weight-medium);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
:is(.text, .heading, .link, .blockquote, .code)[data-weight="semibold"] {
|
|
118
|
+
font-weight: var(--font-weight-semibold);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
:is(.text, .heading, .link, .blockquote, .code)[data-weight="bold"] {
|
|
122
|
+
font-weight: var(--font-weight-bold);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
:is(.text, .heading)[data-align="left"] {
|
|
126
|
+
text-align: left;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
:is(.text, .heading)[data-align="center"] {
|
|
130
|
+
text-align: center;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
:is(.text, .heading)[data-align="right"] {
|
|
134
|
+
text-align: right;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* ---- leading trim ---- */
|
|
138
|
+
|
|
139
|
+
:is(.text, .heading, .link):is(
|
|
140
|
+
[data-trim="start"],
|
|
141
|
+
[data-trim="both"]
|
|
142
|
+
)::before,
|
|
143
|
+
:is(.text, .heading, .link):is([data-trim="end"], [data-trim="both"])::after {
|
|
144
|
+
content: "";
|
|
145
|
+
display: table;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/*
|
|
149
|
+
* Radix's trims, measured from the middle of the line: the top lands on
|
|
150
|
+
* the ascenders and the bottom on the baseline, in Inter as in Radix's
|
|
151
|
+
* system stack.
|
|
152
|
+
*/
|
|
153
|
+
:is(.text, .heading, .link):is(
|
|
154
|
+
[data-trim="start"],
|
|
155
|
+
[data-trim="both"]
|
|
156
|
+
)::before {
|
|
157
|
+
margin-bottom: calc(0.42em - 0.5lh);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
:is(.text, .heading, .link):is([data-trim="end"], [data-trim="both"])::after {
|
|
161
|
+
margin-top: calc(0.36em - 0.5lh);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/* ---- truncate and wrap ---- */
|
|
165
|
+
|
|
166
|
+
:is(
|
|
167
|
+
.text,
|
|
168
|
+
.heading,
|
|
169
|
+
.link,
|
|
170
|
+
.blockquote,
|
|
171
|
+
.code,
|
|
172
|
+
.em,
|
|
173
|
+
.strong,
|
|
174
|
+
.quote
|
|
175
|
+
)[data-truncate] {
|
|
176
|
+
overflow: hidden;
|
|
177
|
+
text-overflow: ellipsis;
|
|
178
|
+
white-space: nowrap;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
:is(
|
|
182
|
+
.text,
|
|
183
|
+
.heading,
|
|
184
|
+
.link,
|
|
185
|
+
.blockquote,
|
|
186
|
+
.code,
|
|
187
|
+
.em,
|
|
188
|
+
.strong,
|
|
189
|
+
.quote
|
|
190
|
+
)[data-wrap="wrap"] {
|
|
191
|
+
white-space: normal;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
:is(
|
|
195
|
+
.text,
|
|
196
|
+
.heading,
|
|
197
|
+
.link,
|
|
198
|
+
.blockquote,
|
|
199
|
+
.code,
|
|
200
|
+
.em,
|
|
201
|
+
.strong,
|
|
202
|
+
.quote
|
|
203
|
+
)[data-wrap="nowrap"] {
|
|
204
|
+
white-space: nowrap;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
:is(
|
|
208
|
+
.text,
|
|
209
|
+
.heading,
|
|
210
|
+
.link,
|
|
211
|
+
.blockquote,
|
|
212
|
+
.code,
|
|
213
|
+
.em,
|
|
214
|
+
.strong,
|
|
215
|
+
.quote
|
|
216
|
+
)[data-wrap="pretty"] {
|
|
217
|
+
white-space: normal;
|
|
218
|
+
text-wrap: pretty;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
:is(
|
|
222
|
+
.text,
|
|
223
|
+
.heading,
|
|
224
|
+
.link,
|
|
225
|
+
.blockquote,
|
|
226
|
+
.code,
|
|
227
|
+
.em,
|
|
228
|
+
.strong,
|
|
229
|
+
.quote
|
|
230
|
+
)[data-wrap="balance"] {
|
|
231
|
+
white-space: normal;
|
|
232
|
+
text-wrap: balance;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/* ---- color ---- */
|
|
236
|
+
|
|
237
|
+
:is(.text, .heading, .blockquote)[data-color] {
|
|
238
|
+
color: var(--accent-text);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
:is(.text, .heading, .blockquote)[data-color][data-high-contrast],
|
|
242
|
+
[data-color] :is(.text, .heading, .blockquote)[data-high-contrast] {
|
|
243
|
+
color: var(--accent-12);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Part: toast
|
|
3
|
+
*
|
|
4
|
+
* <div class="toast-portal" [data-anchored]> Base UI Toast.Portal, in the anchor
|
|
5
|
+
* <div class="toast-viewport" role="region" aria-label aria-keyshortcuts="F6"
|
|
6
|
+
* [data-expanded] [data-yielding]> Base UI Toast.Viewport
|
|
7
|
+
* <div class="toast" data-variant="surface|soft|solid"
|
|
8
|
+
* data-color="accent|gray|danger|warning|success|info"
|
|
9
|
+
* [data-high-contrast] [data-type] [data-expanded] [data-limited]
|
|
10
|
+
* [data-swiping] [data-swipe-direction]
|
|
11
|
+
* [data-starting-style] [data-ending-style]> Toast.Root
|
|
12
|
+
* <div class="toast-content" [data-behind] [data-expanded]> Toast.Content
|
|
13
|
+
* <span class="toast-icon"> the status icon, or a Spinner while loading
|
|
14
|
+
* <div class="toast-text">
|
|
15
|
+
* <h2 class="toast-title"> Toast.Title
|
|
16
|
+
* <p class="toast-description"> Toast.Description
|
|
17
|
+
* <button class="button toast-action"> a second action, then Toast.Action
|
|
18
|
+
* <button class="icon-button toast-close"> Toast.Close
|
|
19
|
+
*
|
|
20
|
+
* Toasts stack at the bottom right: the newest in front, the older ones
|
|
21
|
+
* peeking above it, shrunk and clamped to its height with their content
|
|
22
|
+
* hidden. Hovering or focusing the viewport fans them out. A swipe down or
|
|
23
|
+
* right dismisses one, and it leaves the way it was swiped. Base UI writes
|
|
24
|
+
* the index, offsets and swipe movement as `--toast-*` variables. A new
|
|
25
|
+
* toast slides up a step and fades in; under reduced motion it only fades.
|
|
26
|
+
*
|
|
27
|
+
* The portal renders inside the anchor, the app's canvas, and is fixed over
|
|
28
|
+
* its visible box (the Toaster measures it), so the stack sits at the
|
|
29
|
+
* canvas's bottom right however it scrolls, clear of the side panels.
|
|
30
|
+
* Without an anchor it covers the window: a fallback. The stack is inset by
|
|
31
|
+
* `--toast-offset` (16px) and the safe-area insets, and grows upward.
|
|
32
|
+
*
|
|
33
|
+
* Clearance: an app with a bottom-centered toolbar sets
|
|
34
|
+
* `--toast-inset-bottom` on the anchor. Where the canvas is too narrow for
|
|
35
|
+
* a toast beside a toolbar up to 448px wide (2 × (360 + 16) + 448 = 1200px),
|
|
36
|
+
* the stack lifts by it; wider, it stays on the toolbar's baseline.
|
|
37
|
+
*
|
|
38
|
+
* While focus is on an
|
|
39
|
+
* element outside it that a toast would cover, the Toaster sets
|
|
40
|
+
* `data-yielding` and the stack fades out of the way until focus moves on
|
|
41
|
+
* or the pointer or focus enters the stack.
|
|
42
|
+
*
|
|
43
|
+
* Surface and soft lay the color's tint over the raised surface, so a toast
|
|
44
|
+
* stays opaque over the page; the title is step 12 and the description the
|
|
45
|
+
* accessible text step. Solid fills with the color. Gray, the default, is
|
|
46
|
+
* neutral.
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
@layer components {
|
|
50
|
+
.toast-portal {
|
|
51
|
+
position: fixed;
|
|
52
|
+
inset: 0;
|
|
53
|
+
z-index: var(--layer-toast);
|
|
54
|
+
pointer-events: none;
|
|
55
|
+
container: toast-anchor / inline-size;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* The Toaster writes the anchor's visible box as left, top, width, height. */
|
|
59
|
+
.toast-portal[data-anchored] {
|
|
60
|
+
inset: auto;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.toast-viewport {
|
|
64
|
+
--_toast-offset: var(--toast-offset, var(--space-4));
|
|
65
|
+
--_toast-lift: 0px;
|
|
66
|
+
|
|
67
|
+
position: absolute;
|
|
68
|
+
inset-block-end: calc(
|
|
69
|
+
var(--_toast-offset) + var(--_toast-lift) +
|
|
70
|
+
env(safe-area-inset-bottom, 0px)
|
|
71
|
+
);
|
|
72
|
+
inset-inline-end: calc(
|
|
73
|
+
var(--_toast-offset) + env(safe-area-inset-right, 0px)
|
|
74
|
+
);
|
|
75
|
+
width: 360px;
|
|
76
|
+
max-width: calc(100% - 2 * var(--_toast-offset));
|
|
77
|
+
outline: none;
|
|
78
|
+
pointer-events: auto;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@container toast-anchor (width < 1200px) {
|
|
82
|
+
.toast-viewport {
|
|
83
|
+
--_toast-lift: var(--toast-inset-bottom, 0px);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.toast-viewport[data-yielding]:not([data-expanded]) .toast {
|
|
88
|
+
opacity: 0;
|
|
89
|
+
pointer-events: none;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.toast {
|
|
93
|
+
--toast-gap: var(--space-3);
|
|
94
|
+
--toast-peek: var(--space-3);
|
|
95
|
+
--toast-scale: max(0, 1 - var(--toast-index) * 0.05);
|
|
96
|
+
--toast-shrink: calc(1 - var(--toast-scale));
|
|
97
|
+
--toast-clamped-height: var(--toast-frontmost-height, var(--toast-height));
|
|
98
|
+
--toast-expanded-y: calc(
|
|
99
|
+
var(--toast-offset-y) * -1 - var(--toast-index) * var(--toast-gap) +
|
|
100
|
+
var(--toast-swipe-movement-y)
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
position: absolute;
|
|
104
|
+
inset-block-end: 0;
|
|
105
|
+
inset-inline-end: 0;
|
|
106
|
+
z-index: calc(1000 - var(--toast-index));
|
|
107
|
+
box-sizing: border-box;
|
|
108
|
+
width: 100%;
|
|
109
|
+
height: var(--toast-clamped-height);
|
|
110
|
+
border-radius: calc(var(--shape-popup) * var(--corner-scale, 1));
|
|
111
|
+
corner-shape: var(--corner-shape, round);
|
|
112
|
+
background-color: var(--surface-raised);
|
|
113
|
+
color: var(--accent-text);
|
|
114
|
+
box-shadow: var(--shadow-4);
|
|
115
|
+
font-size: var(--font-size-2);
|
|
116
|
+
line-height: var(--line-height-2);
|
|
117
|
+
-webkit-user-select: none;
|
|
118
|
+
user-select: none;
|
|
119
|
+
cursor: default;
|
|
120
|
+
transform-origin: bottom center;
|
|
121
|
+
transform: translateX(var(--toast-swipe-movement-x))
|
|
122
|
+
translateY(
|
|
123
|
+
calc(
|
|
124
|
+
var(--toast-swipe-movement-y) - var(--toast-index) *
|
|
125
|
+
var(--toast-peek) - var(--toast-shrink) *
|
|
126
|
+
var(--toast-clamped-height)
|
|
127
|
+
)
|
|
128
|
+
)
|
|
129
|
+
scale(var(--toast-scale));
|
|
130
|
+
transition-property: transform, opacity, height;
|
|
131
|
+
transition-duration:
|
|
132
|
+
var(--duration-3), var(--duration-3), var(--duration-2);
|
|
133
|
+
transition-timing-function: var(--ease-enter);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* Keeps the stack expanded while the pointer crosses the gap below a toast. */
|
|
137
|
+
.toast::after {
|
|
138
|
+
content: "";
|
|
139
|
+
position: absolute;
|
|
140
|
+
inset-block-start: 100%;
|
|
141
|
+
inset-inline: 0;
|
|
142
|
+
height: calc(var(--toast-gap) + 1px);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.toast[data-expanded] {
|
|
146
|
+
height: var(--toast-height);
|
|
147
|
+
transform: translateX(var(--toast-swipe-movement-x))
|
|
148
|
+
translateY(var(--toast-expanded-y));
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.toast[data-starting-style],
|
|
152
|
+
.toast[data-ending-style] {
|
|
153
|
+
opacity: 0;
|
|
154
|
+
transform: translateY(var(--space-4));
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.toast[data-ending-style] {
|
|
158
|
+
transition-timing-function: var(--ease-exit);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.toast[data-limited] {
|
|
162
|
+
opacity: 0;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.toast[data-ending-style][data-swipe-direction="up"] {
|
|
166
|
+
transform: translateY(calc(var(--toast-swipe-movement-y) - 150%));
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.toast[data-ending-style][data-swipe-direction="down"] {
|
|
170
|
+
transform: translateY(calc(var(--toast-swipe-movement-y) + 150%));
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.toast[data-ending-style][data-swipe-direction="left"] {
|
|
174
|
+
transform: translateX(calc(var(--toast-swipe-movement-x) - 150%))
|
|
175
|
+
translateY(var(--toast-expanded-y));
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.toast[data-ending-style][data-swipe-direction="right"] {
|
|
179
|
+
transform: translateX(calc(var(--toast-swipe-movement-x) + 150%))
|
|
180
|
+
translateY(var(--toast-expanded-y));
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.toast[data-swiping] {
|
|
184
|
+
transition-duration: 0s, var(--duration-3), var(--duration-2);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.toast:focus-visible {
|
|
188
|
+
outline: var(--focus-ring-width) solid var(--line-focus);
|
|
189
|
+
outline-offset: var(--focus-ring-offset);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
@media (prefers-reduced-motion: reduce) {
|
|
193
|
+
.toast {
|
|
194
|
+
transition-property: opacity;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/* Everything aligns to the first line, centered on the 24px buttons. */
|
|
199
|
+
.toast-content {
|
|
200
|
+
--toast-line-inset: calc(
|
|
201
|
+
(var(--control-height-3) - var(--line-height-2)) / 2
|
|
202
|
+
);
|
|
203
|
+
display: flex;
|
|
204
|
+
align-items: flex-start;
|
|
205
|
+
gap: var(--space-2);
|
|
206
|
+
box-sizing: border-box;
|
|
207
|
+
height: 100%;
|
|
208
|
+
padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
|
|
209
|
+
overflow: hidden;
|
|
210
|
+
transition: opacity var(--duration-3) var(--ease-standard);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.toast-content[data-behind] {
|
|
214
|
+
opacity: 0;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.toast-content[data-expanded] {
|
|
218
|
+
opacity: 1;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.toast-icon {
|
|
222
|
+
display: flex;
|
|
223
|
+
flex-shrink: 0;
|
|
224
|
+
align-items: center;
|
|
225
|
+
height: var(--control-height-3);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.toast-icon svg {
|
|
229
|
+
width: var(--control-icon-size-3);
|
|
230
|
+
height: var(--control-icon-size-3);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.toast-text {
|
|
234
|
+
display: flex;
|
|
235
|
+
flex: 1;
|
|
236
|
+
flex-direction: column;
|
|
237
|
+
gap: var(--space-1);
|
|
238
|
+
min-width: 0;
|
|
239
|
+
padding-block: var(--toast-line-inset);
|
|
240
|
+
overflow-wrap: anywhere;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.toast-title {
|
|
244
|
+
margin: 0;
|
|
245
|
+
color: var(--accent-12);
|
|
246
|
+
font-size: inherit;
|
|
247
|
+
line-height: inherit;
|
|
248
|
+
font-weight: var(--font-weight-medium);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.toast-description {
|
|
252
|
+
margin: 0;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/* A description alone is the message. */
|
|
256
|
+
.toast-description:only-child {
|
|
257
|
+
color: var(--accent-12);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.toast-action,
|
|
261
|
+
.toast-close {
|
|
262
|
+
flex-shrink: 0;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.toast-close {
|
|
266
|
+
margin-inline-start: var(--space-1);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/* ---- variants ---- */
|
|
270
|
+
|
|
271
|
+
.toast[data-variant="surface"] {
|
|
272
|
+
background-image: linear-gradient(
|
|
273
|
+
var(--accent-surface),
|
|
274
|
+
var(--accent-surface)
|
|
275
|
+
);
|
|
276
|
+
box-shadow:
|
|
277
|
+
inset 0 0 0 1px var(--accent-a7),
|
|
278
|
+
var(--shadow-4);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.toast[data-variant="soft"] {
|
|
282
|
+
background-image: linear-gradient(var(--accent-a3), var(--accent-a3));
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.toast[data-variant="solid"] {
|
|
286
|
+
background-color: var(--accent-solid);
|
|
287
|
+
color: var(--accent-contrast);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.toast[data-variant="solid"] :is(.toast-title, .toast-description) {
|
|
291
|
+
color: inherit;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.toast[data-high-contrast] {
|
|
295
|
+
color: var(--accent-12);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.toast[data-variant="solid"][data-high-contrast] {
|
|
299
|
+
background-color: var(--accent-12);
|
|
300
|
+
color: var(--accent-1);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Part: toggle-group
|
|
3
|
+
*
|
|
4
|
+
* <div class="toggle-group" role="group" Base UI ToggleGroup
|
|
5
|
+
* data-size="1|2|3|4" data-variant="ghost|soft|surface|outline"
|
|
6
|
+
* [data-color] [data-high-contrast] [data-radius]
|
|
7
|
+
* [data-orientation] [data-multiple] [data-disabled]>
|
|
8
|
+
* <button class="toggle" [data-pressed]> Toggle, one per option
|
|
9
|
+
*
|
|
10
|
+
* A row or column of toggles a control gap apart. Its props are the
|
|
11
|
+
* defaults of the toggles inside it, which draw them; the group itself only
|
|
12
|
+
* lays them out.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
@layer components {
|
|
16
|
+
.toggle-group {
|
|
17
|
+
display: inline-flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
gap: var(--control-gap);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.toggle-group[data-orientation="vertical"] {
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
}
|
|
25
|
+
}
|