@botiverse/raft-ui 0.0.0-stage → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +561 -0
- package/LICENSE +21 -0
- package/README.md +103 -2
- package/codemods/package-name.mjs +166 -0
- package/codemods/token-names.mjs +150 -0
- package/dist/cn.d.mts +5 -0
- package/dist/cn.mjs +48 -0
- package/dist/components/combobox-select/combobox-select.css +286 -0
- package/dist/components/float-button/float-button.css +316 -0
- package/dist/components/steps/otter-indicator.css +141 -0
- package/dist/components/steps/steps.css +370 -0
- package/dist/components/timeline/timeline.css +255 -0
- package/dist/dialog-CY6S-Xqf.mjs +505 -0
- package/dist/fonts.css +13 -0
- package/dist/foundation.css +623 -0
- package/dist/index-B3_j9XYd.d.mts +329 -0
- package/dist/index.d.mts +5114 -0
- package/dist/index.mjs +16442 -0
- package/dist/style.css +1315 -0
- package/dist/styles.css +391 -0
- package/dist/tokens.json +3811 -0
- package/dist/wip.d.mts +92 -0
- package/dist/wip.mjs +517 -0
- package/package.json +92 -3
- package/skills/raft-ui-critique/SKILL.md +167 -0
- package/skills/raft-ui-critique/agents/openai.yaml +4 -0
- package/skills/raft-ui-critique/references/theme-lenses.md +69 -0
- package/skills/raft-ui-guide/SKILL.md +96 -0
- package/skills/raft-ui-guide/agents/openai.yaml +4 -0
- package/skills/raft-ui-guide/rules/adoption.md +55 -0
- package/skills/raft-ui-guide/rules/composition.md +14 -0
- package/skills/raft-ui-guide/rules/conversation.md +15 -0
- package/skills/raft-ui-guide/rules/display.md +14 -0
- package/skills/raft-ui-guide/rules/feedback.md +13 -0
- package/skills/raft-ui-guide/rules/forms.md +13 -0
- package/skills/raft-ui-guide/rules/layout.md +15 -0
- package/skills/raft-ui-guide/rules/lookup.md +78 -0
- package/skills/raft-ui-guide/rules/overlays.md +13 -0
- package/skills/raft-ui-guide/rules/overview.md +30 -0
- package/skills/raft-ui-guide/rules/styling.md +17 -0
- package/skills/raft-ui-guide/rules/technical-overview.md +80 -0
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
/* Options-driven combobox. Visual rules consume rui semantic tokens. */
|
|
2
|
+
.r-combobox-select {
|
|
3
|
+
min-width: 0;
|
|
4
|
+
position: relative;
|
|
5
|
+
}
|
|
6
|
+
.r-combobox-select__control {
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
min-width: 0;
|
|
9
|
+
min-height: 44px;
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
gap: 0.5rem;
|
|
13
|
+
padding: 0 6px 0 12px;
|
|
14
|
+
border: 1.5px solid var(--line-strong);
|
|
15
|
+
border-radius: 8px;
|
|
16
|
+
outline: 0;
|
|
17
|
+
background: var(--layer-card);
|
|
18
|
+
color: var(--foreground);
|
|
19
|
+
box-shadow: none;
|
|
20
|
+
font-size: 16px;
|
|
21
|
+
line-height: 24px;
|
|
22
|
+
transition: box-shadow 90ms ease-out;
|
|
23
|
+
}
|
|
24
|
+
.r-combobox-select__control:focus-within {
|
|
25
|
+
box-shadow: var(--focus-ring);
|
|
26
|
+
}
|
|
27
|
+
.r-combobox-select__input {
|
|
28
|
+
box-sizing: border-box;
|
|
29
|
+
min-width: 3rem;
|
|
30
|
+
width: 100%;
|
|
31
|
+
flex: 1;
|
|
32
|
+
padding: 0;
|
|
33
|
+
border: 0;
|
|
34
|
+
outline: 0;
|
|
35
|
+
background: transparent;
|
|
36
|
+
color: inherit;
|
|
37
|
+
font: inherit;
|
|
38
|
+
}
|
|
39
|
+
.r-combobox-select__input::placeholder {
|
|
40
|
+
color: var(--foreground-hint);
|
|
41
|
+
}
|
|
42
|
+
.r-combobox-select__chips {
|
|
43
|
+
min-height: 28px;
|
|
44
|
+
min-width: 0;
|
|
45
|
+
margin-inline-start: -6px;
|
|
46
|
+
padding: 6px 0;
|
|
47
|
+
display: flex;
|
|
48
|
+
flex: 1;
|
|
49
|
+
flex-wrap: wrap;
|
|
50
|
+
align-items: center;
|
|
51
|
+
gap: 6px;
|
|
52
|
+
border: 0;
|
|
53
|
+
}
|
|
54
|
+
.r-combobox-select__chips .r-combobox-select__input {
|
|
55
|
+
min-height: 28px;
|
|
56
|
+
padding: 0 4px;
|
|
57
|
+
}
|
|
58
|
+
.r-combobox-select__chip {
|
|
59
|
+
max-width: 100%;
|
|
60
|
+
min-height: 28px;
|
|
61
|
+
padding: 0 2px 0 8px;
|
|
62
|
+
display: inline-flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
gap: 6px;
|
|
65
|
+
overflow: hidden;
|
|
66
|
+
border-radius: 6px;
|
|
67
|
+
background: var(--fill-muted);
|
|
68
|
+
color: var(--foreground);
|
|
69
|
+
font-size: 13px;
|
|
70
|
+
line-height: 18px;
|
|
71
|
+
font-weight: 600;
|
|
72
|
+
}
|
|
73
|
+
.r-combobox-select__control:not(:focus-within) .r-combobox-select__chip[data-overflow] {
|
|
74
|
+
display: none;
|
|
75
|
+
}
|
|
76
|
+
.r-combobox-select__text {
|
|
77
|
+
min-width: 0;
|
|
78
|
+
overflow: hidden;
|
|
79
|
+
text-overflow: ellipsis;
|
|
80
|
+
white-space: nowrap;
|
|
81
|
+
}
|
|
82
|
+
.r-combobox-select__actions {
|
|
83
|
+
display: inline-flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
gap: 0.125rem;
|
|
86
|
+
flex: 0 0 auto;
|
|
87
|
+
}
|
|
88
|
+
.r-combobox-select__action,
|
|
89
|
+
.r-combobox-select__remove {
|
|
90
|
+
display: inline-flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
flex: 0 0 auto;
|
|
94
|
+
padding: 0;
|
|
95
|
+
border: 0;
|
|
96
|
+
background: transparent;
|
|
97
|
+
outline: 0;
|
|
98
|
+
transition:
|
|
99
|
+
color 150ms ease,
|
|
100
|
+
background-color 150ms ease;
|
|
101
|
+
}
|
|
102
|
+
.r-combobox-select__remove {
|
|
103
|
+
width: 22px;
|
|
104
|
+
height: 22px;
|
|
105
|
+
border-radius: 4px;
|
|
106
|
+
color: var(--foreground-hint);
|
|
107
|
+
}
|
|
108
|
+
.r-combobox-select__action {
|
|
109
|
+
width: 32px;
|
|
110
|
+
height: 32px;
|
|
111
|
+
border-radius: 8px;
|
|
112
|
+
color: var(--foreground-hint);
|
|
113
|
+
}
|
|
114
|
+
.r-combobox-select__action > svg,
|
|
115
|
+
.r-combobox-select__remove > svg {
|
|
116
|
+
pointer-events: none;
|
|
117
|
+
}
|
|
118
|
+
.r-combobox-select__action > svg {
|
|
119
|
+
width: 16px;
|
|
120
|
+
height: 16px;
|
|
121
|
+
}
|
|
122
|
+
.r-combobox-select__remove > svg {
|
|
123
|
+
width: 0.875rem;
|
|
124
|
+
height: 0.875rem;
|
|
125
|
+
}
|
|
126
|
+
.r-combobox-select__action:hover,
|
|
127
|
+
.r-combobox-select__remove:hover {
|
|
128
|
+
background: var(--fill-pressed);
|
|
129
|
+
color: var(--foreground);
|
|
130
|
+
}
|
|
131
|
+
.r-combobox-select__action:focus-visible,
|
|
132
|
+
.r-combobox-select__remove:focus-visible {
|
|
133
|
+
box-shadow: var(--focus-ring);
|
|
134
|
+
}
|
|
135
|
+
.r-combobox-select__positioner {
|
|
136
|
+
z-index: 50;
|
|
137
|
+
isolation: isolate;
|
|
138
|
+
outline: 0;
|
|
139
|
+
}
|
|
140
|
+
.r-combobox-select__popup {
|
|
141
|
+
box-sizing: border-box;
|
|
142
|
+
width: var(--anchor-width, max-content);
|
|
143
|
+
min-width: 13.75rem;
|
|
144
|
+
max-width: var(--available-width);
|
|
145
|
+
max-height: min(var(--available-height), 24rem);
|
|
146
|
+
overflow: hidden;
|
|
147
|
+
border: 0;
|
|
148
|
+
border-radius: 10px;
|
|
149
|
+
background: var(--layer-popover);
|
|
150
|
+
color: var(--foreground);
|
|
151
|
+
box-shadow:
|
|
152
|
+
0 0 0 1px var(--line-seam),
|
|
153
|
+
var(--elevation-float);
|
|
154
|
+
outline: 0;
|
|
155
|
+
}
|
|
156
|
+
.r-combobox-select__list {
|
|
157
|
+
max-height: 16rem;
|
|
158
|
+
overflow-y: auto;
|
|
159
|
+
overscroll-behavior: contain;
|
|
160
|
+
scroll-padding-block: 6px;
|
|
161
|
+
padding: 6px;
|
|
162
|
+
}
|
|
163
|
+
.r-combobox-select__option {
|
|
164
|
+
box-sizing: border-box;
|
|
165
|
+
width: 100%;
|
|
166
|
+
min-height: 36px;
|
|
167
|
+
padding: 0 10px;
|
|
168
|
+
display: flex;
|
|
169
|
+
align-items: center;
|
|
170
|
+
justify-content: space-between;
|
|
171
|
+
gap: 10px;
|
|
172
|
+
overflow: hidden;
|
|
173
|
+
border-radius: 8px;
|
|
174
|
+
cursor: default;
|
|
175
|
+
user-select: none;
|
|
176
|
+
color: var(--foreground);
|
|
177
|
+
font-size: 14px;
|
|
178
|
+
line-height: 20px;
|
|
179
|
+
font-weight: 500;
|
|
180
|
+
outline: 0;
|
|
181
|
+
transition:
|
|
182
|
+
background-color 120ms ease,
|
|
183
|
+
color 120ms ease;
|
|
184
|
+
}
|
|
185
|
+
.r-combobox-select__option:hover,
|
|
186
|
+
.r-combobox-select__option[data-highlighted] {
|
|
187
|
+
background: var(--brand-soft);
|
|
188
|
+
color: var(--foreground);
|
|
189
|
+
}
|
|
190
|
+
.r-combobox-select__option[data-selected] {
|
|
191
|
+
font-weight: 700;
|
|
192
|
+
}
|
|
193
|
+
.r-combobox-select__option[data-disabled] {
|
|
194
|
+
pointer-events: none;
|
|
195
|
+
background: transparent;
|
|
196
|
+
color: var(--foreground-disabled);
|
|
197
|
+
}
|
|
198
|
+
.r-combobox-select__option > svg {
|
|
199
|
+
width: 16px;
|
|
200
|
+
height: 16px;
|
|
201
|
+
flex: 0 0 auto;
|
|
202
|
+
pointer-events: none;
|
|
203
|
+
color: var(--foreground-muted);
|
|
204
|
+
}
|
|
205
|
+
.r-combobox-select__indicator {
|
|
206
|
+
margin-inline-start: auto;
|
|
207
|
+
display: inline-flex;
|
|
208
|
+
align-items: center;
|
|
209
|
+
justify-content: center;
|
|
210
|
+
flex: 0 0 auto;
|
|
211
|
+
color: var(--foreground);
|
|
212
|
+
}
|
|
213
|
+
.r-combobox-select__indicator > svg {
|
|
214
|
+
width: 16px;
|
|
215
|
+
height: 16px;
|
|
216
|
+
}
|
|
217
|
+
.r-combobox-select__group-label {
|
|
218
|
+
padding: 8px 10px 4px;
|
|
219
|
+
color: var(--foreground-hint);
|
|
220
|
+
font-size: 12px;
|
|
221
|
+
line-height: 16px;
|
|
222
|
+
font-weight: 700;
|
|
223
|
+
}
|
|
224
|
+
.r-combobox-select__message {
|
|
225
|
+
padding: 14px 16px;
|
|
226
|
+
color: var(--foreground-hint);
|
|
227
|
+
font-size: 14px;
|
|
228
|
+
line-height: 20px;
|
|
229
|
+
text-align: start;
|
|
230
|
+
}
|
|
231
|
+
.r-combobox-select__overflow {
|
|
232
|
+
color: var(--foreground-hint);
|
|
233
|
+
font-family: var(--mono-font, ui-monospace, monospace);
|
|
234
|
+
font-size: 12px;
|
|
235
|
+
line-height: 16px;
|
|
236
|
+
}
|
|
237
|
+
.r-combobox-select__spinner {
|
|
238
|
+
width: 0.875rem;
|
|
239
|
+
height: 0.875rem;
|
|
240
|
+
animation: r-combobox-select-spin 700ms linear infinite;
|
|
241
|
+
}
|
|
242
|
+
.r-combobox-select--sm.r-combobox-select__control {
|
|
243
|
+
min-height: 1.75rem;
|
|
244
|
+
font-size: 13px;
|
|
245
|
+
line-height: 18px;
|
|
246
|
+
}
|
|
247
|
+
.r-combobox-select--sm .r-combobox-select__chips {
|
|
248
|
+
min-height: 1.5rem;
|
|
249
|
+
padding: 1px 0;
|
|
250
|
+
}
|
|
251
|
+
.r-combobox-select--sm .r-combobox-select__chip {
|
|
252
|
+
min-height: 1.375rem;
|
|
253
|
+
}
|
|
254
|
+
.r-combobox-select--sm .r-combobox-select__action {
|
|
255
|
+
width: 1.5rem;
|
|
256
|
+
height: 1.5rem;
|
|
257
|
+
}
|
|
258
|
+
.r-combobox-select--lg.r-combobox-select__control {
|
|
259
|
+
min-height: 52px;
|
|
260
|
+
}
|
|
261
|
+
.r-combobox-select__control[data-status="error"] {
|
|
262
|
+
border-color: var(--danger-strong);
|
|
263
|
+
}
|
|
264
|
+
.r-combobox-select__control[data-invalid] {
|
|
265
|
+
border-color: var(--danger-strong);
|
|
266
|
+
}
|
|
267
|
+
.r-combobox-select__control[data-status="warning"] {
|
|
268
|
+
border-color: var(--warning-strong);
|
|
269
|
+
}
|
|
270
|
+
.r-combobox-select__control[data-disabled] {
|
|
271
|
+
border-color: var(--line-hairline);
|
|
272
|
+
background: var(--fill-muted);
|
|
273
|
+
color: var(--foreground-disabled);
|
|
274
|
+
}
|
|
275
|
+
@keyframes r-combobox-select-spin {
|
|
276
|
+
to {
|
|
277
|
+
transform: rotate(360deg);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
@media (prefers-reduced-motion: reduce) {
|
|
281
|
+
.r-combobox-select *,
|
|
282
|
+
.r-combobox-select__positioner {
|
|
283
|
+
transition-duration: 0.01ms !important;
|
|
284
|
+
animation-duration: 0.01ms !important;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
/* FloatButton pure CSS styling following pattern/Button.css architecture
|
|
2
|
+
- Local CSS variables (--r-float-button-*) declared on component root
|
|
3
|
+
- Modifier classes rebind local variables
|
|
4
|
+
- Component styles strictly consume local variables
|
|
5
|
+
- An icon button: surface + 1.5px ink edge, control radius on every shape,
|
|
6
|
+
no shadow, press overlay, focus ring.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/* ─────────────────────────────────────────────────────────────────────────
|
|
10
|
+
1. Local Variable Definitions & Modifier Overrides
|
|
11
|
+
───────────────────────────────────────────────────────────────────────── */
|
|
12
|
+
|
|
13
|
+
.r-float-button {
|
|
14
|
+
--r-float-button-size: 32px;
|
|
15
|
+
--r-float-button-width: var(--r-float-button-size);
|
|
16
|
+
--r-float-button-padding-x: 0px;
|
|
17
|
+
--r-float-button-border-radius: 8px;
|
|
18
|
+
--r-float-button-border-width: 1.5px;
|
|
19
|
+
--r-float-button-border-style: solid;
|
|
20
|
+
--r-float-button-border-color: var(--line-strong);
|
|
21
|
+
--r-float-button-bg: var(--layer-card);
|
|
22
|
+
--r-float-button-bg-hover: var(--layer-card);
|
|
23
|
+
--r-float-button-press: var(--fill-pressed);
|
|
24
|
+
--r-float-button-text-color: var(--foreground);
|
|
25
|
+
--r-float-button-text-hover-color: var(--foreground);
|
|
26
|
+
--r-float-button-text-disabled-color: var(--foreground-disabled);
|
|
27
|
+
--r-float-button-box-shadow: none;
|
|
28
|
+
--r-float-button-shadow-hover: none;
|
|
29
|
+
--r-float-button-shadow-active: none;
|
|
30
|
+
--r-float-button-transform-hover: none;
|
|
31
|
+
--r-float-button-transform-active: none;
|
|
32
|
+
--r-float-button-outline: 2px solid var(--line-strong);
|
|
33
|
+
--r-float-button-outline-offset: 2px;
|
|
34
|
+
--r-float-button-font-size: 12px;
|
|
35
|
+
--r-float-button-font-weight: 700;
|
|
36
|
+
--r-float-button-desc-font-size: 10px;
|
|
37
|
+
--r-float-button-icon-size: 16px;
|
|
38
|
+
--r-float-button-opacity-disabled: 1;
|
|
39
|
+
|
|
40
|
+
/* Sizes: xs (24px), sm (28px), md (32px), lg (36px) */
|
|
41
|
+
&.r-float-button--xs {
|
|
42
|
+
--r-float-button-size: 24px;
|
|
43
|
+
--r-float-button-icon-size: 12px;
|
|
44
|
+
--r-float-button-font-size: 11px;
|
|
45
|
+
--r-float-button-desc-font-size: 8px;
|
|
46
|
+
--r-float-button-padding-x: 8px;
|
|
47
|
+
}
|
|
48
|
+
&.r-float-button--sm {
|
|
49
|
+
--r-float-button-size: 28px;
|
|
50
|
+
--r-float-button-icon-size: 14px;
|
|
51
|
+
--r-float-button-font-size: 12px;
|
|
52
|
+
--r-float-button-desc-font-size: 9px;
|
|
53
|
+
--r-float-button-padding-x: 10px;
|
|
54
|
+
}
|
|
55
|
+
&.r-float-button--md {
|
|
56
|
+
--r-float-button-size: 32px;
|
|
57
|
+
--r-float-button-icon-size: 16px;
|
|
58
|
+
--r-float-button-font-size: 12px;
|
|
59
|
+
--r-float-button-desc-font-size: 10px;
|
|
60
|
+
--r-float-button-padding-x: 12px;
|
|
61
|
+
}
|
|
62
|
+
&.r-float-button--lg {
|
|
63
|
+
--r-float-button-size: 36px;
|
|
64
|
+
--r-float-button-icon-size: 18px;
|
|
65
|
+
--r-float-button-font-size: 14px;
|
|
66
|
+
--r-float-button-desc-font-size: 11px;
|
|
67
|
+
--r-float-button-padding-x: 14px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* Extended with text (adaptive width & horizontal padding) */
|
|
71
|
+
&.r-float-button--with-text {
|
|
72
|
+
--r-float-button-width: auto;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* Shapes: every shape takes the control radius; a pill sizes to its text. */
|
|
76
|
+
&.r-float-button--pill {
|
|
77
|
+
--r-float-button-width: auto;
|
|
78
|
+
padding-left: var(--r-float-button-padding-x);
|
|
79
|
+
padding-right: var(--r-float-button-padding-x);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* Variants: default and outline are the base surface. Filled variants are
|
|
83
|
+
stickers: ink edge and ink text on the fill, pressed with the sticker
|
|
84
|
+
overlay. */
|
|
85
|
+
&.r-float-button--primary,
|
|
86
|
+
&.r-float-button--accent {
|
|
87
|
+
--r-float-button-border-color: var(--sticker-ink);
|
|
88
|
+
--r-float-button-bg: var(--attention-400);
|
|
89
|
+
--r-float-button-bg-hover: var(--attention-400);
|
|
90
|
+
--r-float-button-press: var(--sticker-pressed);
|
|
91
|
+
--r-float-button-text-color: var(--sticker-ink);
|
|
92
|
+
--r-float-button-text-hover-color: var(--sticker-ink);
|
|
93
|
+
}
|
|
94
|
+
&.r-float-button--warning {
|
|
95
|
+
--r-float-button-border-color: var(--sticker-ink);
|
|
96
|
+
--r-float-button-bg: var(--warning);
|
|
97
|
+
--r-float-button-bg-hover: var(--warning);
|
|
98
|
+
--r-float-button-press: var(--sticker-pressed);
|
|
99
|
+
--r-float-button-text-color: var(--sticker-ink);
|
|
100
|
+
--r-float-button-text-hover-color: var(--sticker-ink);
|
|
101
|
+
}
|
|
102
|
+
&.r-float-button--danger {
|
|
103
|
+
--r-float-button-border-color: var(--sticker-ink);
|
|
104
|
+
--r-float-button-bg: var(--danger);
|
|
105
|
+
--r-float-button-bg-hover: var(--danger);
|
|
106
|
+
--r-float-button-press: var(--sticker-pressed);
|
|
107
|
+
--r-float-button-text-color: var(--sticker-ink);
|
|
108
|
+
--r-float-button-text-hover-color: var(--sticker-ink);
|
|
109
|
+
}
|
|
110
|
+
&.r-float-button--ghost {
|
|
111
|
+
--r-float-button-border-color: transparent;
|
|
112
|
+
--r-float-button-bg: transparent;
|
|
113
|
+
--r-float-button-bg-hover: var(--fill-pressed);
|
|
114
|
+
--r-float-button-press: transparent;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* ─────────────────────────────────────────────────────────────────────────
|
|
119
|
+
2. Base Element Rules Consuming Local Variables
|
|
120
|
+
───────────────────────────────────────────────────────────────────────── */
|
|
121
|
+
|
|
122
|
+
.r-float-button {
|
|
123
|
+
position: relative;
|
|
124
|
+
display: inline-flex;
|
|
125
|
+
flex-shrink: 0;
|
|
126
|
+
align-items: center;
|
|
127
|
+
justify-content: center;
|
|
128
|
+
user-select: none;
|
|
129
|
+
cursor: pointer;
|
|
130
|
+
box-sizing: border-box;
|
|
131
|
+
padding: 0;
|
|
132
|
+
width: var(--r-float-button-width, var(--r-float-button-size));
|
|
133
|
+
min-width: var(--r-float-button-size);
|
|
134
|
+
height: var(--r-float-button-size);
|
|
135
|
+
border-radius: var(--r-float-button-border-radius);
|
|
136
|
+
border-width: var(--r-float-button-border-width);
|
|
137
|
+
border-style: var(--r-float-button-border-style);
|
|
138
|
+
border-color: var(--r-float-button-border-color);
|
|
139
|
+
background-color: var(--r-float-button-bg);
|
|
140
|
+
color: var(--r-float-button-text-color);
|
|
141
|
+
box-shadow: var(--r-float-button-box-shadow);
|
|
142
|
+
font-size: var(--r-float-button-font-size);
|
|
143
|
+
font-weight: var(--r-float-button-font-weight);
|
|
144
|
+
outline: none;
|
|
145
|
+
transition:
|
|
146
|
+
transform 150ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
147
|
+
box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
148
|
+
background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
149
|
+
border-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
150
|
+
color 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
151
|
+
|
|
152
|
+
@media (prefers-reduced-motion: reduce) {
|
|
153
|
+
transition: none;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
&.r-float-button--with-text,
|
|
157
|
+
&.r-float-button--pill {
|
|
158
|
+
padding-left: var(--r-float-button-padding-x);
|
|
159
|
+
padding-right: var(--r-float-button-padding-x);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
&:hover:not(:disabled) {
|
|
163
|
+
background-color: var(--r-float-button-bg-hover);
|
|
164
|
+
color: var(--r-float-button-text-hover-color);
|
|
165
|
+
box-shadow: var(--r-float-button-shadow-hover);
|
|
166
|
+
transform: var(--r-float-button-transform-hover);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
&:active:not(:disabled) {
|
|
170
|
+
box-shadow: var(--r-float-button-shadow-active);
|
|
171
|
+
transform: var(--r-float-button-transform-active);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&:focus-visible {
|
|
175
|
+
outline: var(--r-float-button-outline);
|
|
176
|
+
outline-offset: var(--r-float-button-outline-offset);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/* Press feedback lays one overlay over the resting fill instead of
|
|
180
|
+
swapping it. */
|
|
181
|
+
&:is(:hover, :active):not(:disabled) {
|
|
182
|
+
background-image: linear-gradient(var(--r-float-button-press), var(--r-float-button-press));
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/* Disabled is the sunken surface, not an opacity fade. */
|
|
186
|
+
&:disabled {
|
|
187
|
+
pointer-events: none;
|
|
188
|
+
opacity: var(--r-float-button-opacity-disabled);
|
|
189
|
+
cursor: not-allowed;
|
|
190
|
+
border-color: var(--line-hairline);
|
|
191
|
+
background-color: var(--fill-muted);
|
|
192
|
+
background-image: none;
|
|
193
|
+
color: var(--r-float-button-text-disabled-color);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
&.r-float-button--ghost:disabled {
|
|
197
|
+
border-color: transparent;
|
|
198
|
+
background-color: transparent;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
& svg {
|
|
202
|
+
pointer-events: none;
|
|
203
|
+
flex-shrink: 0;
|
|
204
|
+
width: var(--r-float-button-icon-size);
|
|
205
|
+
height: var(--r-float-button-icon-size);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
& > .r-float-button__content {
|
|
209
|
+
display: inline-flex;
|
|
210
|
+
align-items: center;
|
|
211
|
+
justify-content: center;
|
|
212
|
+
gap: 6px;
|
|
213
|
+
white-space: nowrap;
|
|
214
|
+
|
|
215
|
+
&.r-float-button__content--with-desc {
|
|
216
|
+
flex-direction: column;
|
|
217
|
+
gap: 2px;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
&.r-float-button--square.r-float-button--with-desc {
|
|
222
|
+
padding-top: 2px;
|
|
223
|
+
padding-bottom: 2px;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
& .r-float-button__text {
|
|
227
|
+
display: inline-flex;
|
|
228
|
+
align-items: center;
|
|
229
|
+
line-height: 1;
|
|
230
|
+
white-space: nowrap;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
& .r-float-button__desc {
|
|
234
|
+
font-size: var(--r-float-button-desc-font-size);
|
|
235
|
+
text-align: center;
|
|
236
|
+
line-height: 1.25;
|
|
237
|
+
overflow: hidden;
|
|
238
|
+
text-overflow: ellipsis;
|
|
239
|
+
white-space: nowrap;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/* ─────────────────────────────────────────────────────────────────────────
|
|
244
|
+
3. FloatButtonGroup
|
|
245
|
+
───────────────────────────────────────────────────────────────────────── */
|
|
246
|
+
|
|
247
|
+
.r-float-button-group {
|
|
248
|
+
--r-float-button-group-gap: 10px;
|
|
249
|
+
|
|
250
|
+
display: inline-flex;
|
|
251
|
+
align-items: center;
|
|
252
|
+
user-select: none;
|
|
253
|
+
box-sizing: border-box;
|
|
254
|
+
gap: var(--r-float-button-group-gap);
|
|
255
|
+
|
|
256
|
+
&.r-float-button-group--vertical {
|
|
257
|
+
flex-direction: column;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
&.r-float-button-group--horizontal {
|
|
261
|
+
flex-direction: row;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
&.r-float-button-group--attached {
|
|
265
|
+
--r-float-button-group-gap: 0px;
|
|
266
|
+
gap: 0;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/* Attached: seamless borders */
|
|
270
|
+
&.r-float-button-group--attached.r-float-button-group--vertical
|
|
271
|
+
> .r-float-button:not(:last-child) {
|
|
272
|
+
border-bottom-width: 0;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
&.r-float-button-group--attached.r-float-button-group--vertical
|
|
276
|
+
> .r-float-button:not(:first-child):not(:last-child) {
|
|
277
|
+
border-radius: 0;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
&.r-float-button-group--attached.r-float-button-group--horizontal
|
|
281
|
+
> .r-float-button:not(:last-child) {
|
|
282
|
+
border-right-width: 0;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
&.r-float-button-group--attached.r-float-button-group--horizontal
|
|
286
|
+
> .r-float-button:not(:first-child):not(:last-child) {
|
|
287
|
+
border-radius: 0;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/* Attached square: square corners on every button; the outer-corner rules
|
|
291
|
+
below round the ends of a run of two or more. */
|
|
292
|
+
&.r-float-button-group--attached.r-float-button-group--square > .r-float-button {
|
|
293
|
+
border-radius: 0;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/* Attached: control radius on the outer corners, whatever the shape */
|
|
297
|
+
&.r-float-button-group--attached.r-float-button-group--vertical
|
|
298
|
+
> .r-float-button:first-child:not(:last-child) {
|
|
299
|
+
border-radius: 8px 8px 0 0;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
&.r-float-button-group--attached.r-float-button-group--vertical
|
|
303
|
+
> .r-float-button:last-child:not(:first-child) {
|
|
304
|
+
border-radius: 0 0 8px 8px;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
&.r-float-button-group--attached.r-float-button-group--horizontal
|
|
308
|
+
> .r-float-button:first-child:not(:last-child) {
|
|
309
|
+
border-radius: 8px 0 0 8px;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
&.r-float-button-group--attached.r-float-button-group--horizontal
|
|
313
|
+
> .r-float-button:last-child:not(:first-child) {
|
|
314
|
+
border-radius: 0 8px 8px 0;
|
|
315
|
+
}
|
|
316
|
+
}
|