@rogieking/figui3 6.4.1 → 6.4.3
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/components.css +18 -5
- package/dist/components.css +1 -1
- package/dist/fig-lab.css +1 -0
- package/dist/fig-lab.js +14 -0
- package/dist/fig.css +1 -1
- package/fig-lab.css +336 -0
- package/fig-lab.js +1940 -0
- package/package.json +9 -3
package/fig-lab.css
ADDED
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FigUI3 Lab — Experimental component styles
|
|
3
|
+
*
|
|
4
|
+
* Depends on base.css and components.css tokens.
|
|
5
|
+
* Import alongside components.css for opt-in access:
|
|
6
|
+
*
|
|
7
|
+
* <link rel="stylesheet" href="components.css">
|
|
8
|
+
* <link rel="stylesheet" href="fig-lab.css">
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
fig-field-slider {
|
|
12
|
+
display: block;
|
|
13
|
+
position: relative;
|
|
14
|
+
width: 100%;
|
|
15
|
+
border-radius: var(--radius-medium);
|
|
16
|
+
--field-text-shadow: 0 1px 1.5px
|
|
17
|
+
light-dark(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2));
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
&:focus-within {
|
|
21
|
+
outline: 1px solid var(--figma-color-border-selected);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
label {
|
|
25
|
+
pointer-events: none;
|
|
26
|
+
z-index: 1;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&[disabled]:not([disabled="false"]) {
|
|
30
|
+
pointer-events: none;
|
|
31
|
+
|
|
32
|
+
label,
|
|
33
|
+
input {
|
|
34
|
+
color: var(--figma-color-text-disabled);
|
|
35
|
+
}
|
|
36
|
+
fig-slider {
|
|
37
|
+
filter: grayscale(100%) opacity(0.5);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
&[type="hue"] {
|
|
41
|
+
label,
|
|
42
|
+
input {
|
|
43
|
+
text-shadow: var(--field-text-shadow);
|
|
44
|
+
color: white;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
fig-field:not([direction="vertical"]) {
|
|
49
|
+
position: relative;
|
|
50
|
+
padding-left: var(--spacer-2-5);
|
|
51
|
+
display: flex;
|
|
52
|
+
|
|
53
|
+
& > label {
|
|
54
|
+
min-width: 0;
|
|
55
|
+
max-width: none;
|
|
56
|
+
width: 100%;
|
|
57
|
+
flex: 1 1 auto;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
fig-slider {
|
|
61
|
+
position: absolute;
|
|
62
|
+
inset: 0;
|
|
63
|
+
padding: 0;
|
|
64
|
+
background-color: transparent;
|
|
65
|
+
--slider-height: 2rem;
|
|
66
|
+
--slider-field-height: 2rem;
|
|
67
|
+
--slider-thumb-width: var(--spacer-1);
|
|
68
|
+
--slider-thumb-color: light-dark(
|
|
69
|
+
var(--figma-color-text-secondary),
|
|
70
|
+
var(--figma-color-text)
|
|
71
|
+
);
|
|
72
|
+
--slider-thumb-height: calc(
|
|
73
|
+
var(--spacer-2) + (var(--spacer-3) - var(--spacer-2)) *
|
|
74
|
+
min(var(--slider-complete), calc(1 - var(--slider-complete))) * 2
|
|
75
|
+
);
|
|
76
|
+
--slider-border-radius: var(--radius-medium);
|
|
77
|
+
--slider-tick-width: 0.125rem;
|
|
78
|
+
--slider-tick-height: var(--spacer-2);
|
|
79
|
+
--slider-tick-radius: var(--radius-medium);
|
|
80
|
+
--slider-stepper-padding: 0;
|
|
81
|
+
--slider-handle-shadow: inset 0 0 0 var(--slider-thumb-height)
|
|
82
|
+
var(--slider-thumb-color) !important;
|
|
83
|
+
--slider-thumb-opacity: calc(
|
|
84
|
+
min(var(--slider-complete), calc(1 - var(--slider-complete))) * 2
|
|
85
|
+
);
|
|
86
|
+
--slider-tick-opacity: 1;
|
|
87
|
+
|
|
88
|
+
&:has(input[type="range"]:focus-within) {
|
|
89
|
+
--slider-thumb-outline: 1.5px solid var(--figma-color-border-selected) !important;
|
|
90
|
+
--slider-thumb-outline-offset: 2px !important;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.fig-slider-input-container {
|
|
94
|
+
box-shadow: none !important;
|
|
95
|
+
background-color: var(--figma-color-bg-secondary) !important;
|
|
96
|
+
&:hover,
|
|
97
|
+
&:focus-within {
|
|
98
|
+
&::after {
|
|
99
|
+
content: "";
|
|
100
|
+
position: absolute;
|
|
101
|
+
inset: 0;
|
|
102
|
+
pointer-events: none;
|
|
103
|
+
border-radius: var(--slider-border-radius);
|
|
104
|
+
box-shadow: inset 0 0 0 1px var(--figma-color-border) !important;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
&::before {
|
|
108
|
+
background: var(--figma-color-bg-tertiary) !important;
|
|
109
|
+
min-width: 0 !important;
|
|
110
|
+
box-shadow: none !important;
|
|
111
|
+
}
|
|
112
|
+
input[type="range"] {
|
|
113
|
+
border-radius: 0 !important;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&:not([type="delta"]) .fig-slider-input-container::before {
|
|
118
|
+
width: var(--slider-percent) !important;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&[type="delta"] .fig-slider-input-container::before {
|
|
122
|
+
--left-start: calc(
|
|
123
|
+
var(--start-percent) - var(--slider-thumb-width) / 2
|
|
124
|
+
) !important;
|
|
125
|
+
left: min(
|
|
126
|
+
var(--left-start),
|
|
127
|
+
calc(
|
|
128
|
+
var(--slider-percent) - var(--slider-complete) *
|
|
129
|
+
var(--slider-thumb-width)
|
|
130
|
+
)
|
|
131
|
+
) !important;
|
|
132
|
+
--width: calc(var(--slider-percent) - var(--start-percent)) !important;
|
|
133
|
+
--abs-width: max(
|
|
134
|
+
calc(
|
|
135
|
+
var(--width) + var(--slider-thumb-width) / 2 +
|
|
136
|
+
(1 - var(--slider-complete)) * var(--slider-thumb-width)
|
|
137
|
+
),
|
|
138
|
+
calc(
|
|
139
|
+
-1 * var(--width) + var(--slider-thumb-width) / 2 +
|
|
140
|
+
var(--slider-complete) * var(--slider-thumb-width)
|
|
141
|
+
)
|
|
142
|
+
) !important;
|
|
143
|
+
width: var(--abs-width) !important;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
datalist {
|
|
147
|
+
mask-image: linear-gradient(
|
|
148
|
+
to right,
|
|
149
|
+
transparent 0,
|
|
150
|
+
transparent var(--spacer-4),
|
|
151
|
+
white,
|
|
152
|
+
transparent calc(100% - var(--spacer-4)),
|
|
153
|
+
transparent 100%
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
fig-input-number {
|
|
157
|
+
background-color: transparent;
|
|
158
|
+
box-shadow: none !important;
|
|
159
|
+
position: absolute;
|
|
160
|
+
right: var(--spacer-1);
|
|
161
|
+
width: fit-content;
|
|
162
|
+
min-width: fit-content;
|
|
163
|
+
max-width: max-content;
|
|
164
|
+
flex: 0 0 auto;
|
|
165
|
+
border-left: 0;
|
|
166
|
+
border-radius: var(--radius-small);
|
|
167
|
+
|
|
168
|
+
&:hover,
|
|
169
|
+
&:has(input:focus) {
|
|
170
|
+
box-shadow: none !important;
|
|
171
|
+
}
|
|
172
|
+
&:has(input:focus) {
|
|
173
|
+
box-shadow: inset 0 0 0 1px var(--figma-color-border-selected) !important;
|
|
174
|
+
}
|
|
175
|
+
input {
|
|
176
|
+
field-sizing: content;
|
|
177
|
+
border-radius: var(--radius-small);
|
|
178
|
+
width: auto;
|
|
179
|
+
flex: 0 0 auto;
|
|
180
|
+
text-align: right;
|
|
181
|
+
color: var(--field-text-color);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/* Canvas Control */
|
|
188
|
+
fig-canvas-control {
|
|
189
|
+
display: contents;
|
|
190
|
+
--fig-canvas-control-line-stroke: light-dark(
|
|
191
|
+
rgba(255, 255, 255, 1),
|
|
192
|
+
rgba(255, 255, 255, 0.5)
|
|
193
|
+
);
|
|
194
|
+
--fig-canvas-control-radius-stroke: #0D99FF;
|
|
195
|
+
--fig-canvas-control-radius-stroke-halo: #FFFFFF;
|
|
196
|
+
--fig-canvas-control-line-stroke-hover: #0D99FF;
|
|
197
|
+
--fig-canvas-control-line-stroke-active: #0D99FF;
|
|
198
|
+
--fig-canvas-control-line-stroke-width: 1px;
|
|
199
|
+
--fig-canvas-control-line-stroke-width-hover: 2px;
|
|
200
|
+
|
|
201
|
+
&:has(.fig-canvas-control-radius-hit:hover) {
|
|
202
|
+
--fig-canvas-control-line-stroke-width: var(--fig-canvas-control-line-stroke-width-hover);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
& > fig-handle,
|
|
206
|
+
& > fig-tooltip:has(fig-handle:not([size="small"])) {
|
|
207
|
+
z-index: 1;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.fig-canvas-control-radius {
|
|
211
|
+
position: absolute;
|
|
212
|
+
pointer-events: none;
|
|
213
|
+
overflow: visible;
|
|
214
|
+
|
|
215
|
+
circle {
|
|
216
|
+
fill: none;
|
|
217
|
+
stroke: var(--fig-canvas-control-radius-stroke);
|
|
218
|
+
stroke-width: var(--fig-canvas-control-line-stroke-width);
|
|
219
|
+
paint-order: stroke fill;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.fig-canvas-control-radius-halo {
|
|
223
|
+
stroke: var(--fig-canvas-control-radius-stroke-halo);
|
|
224
|
+
stroke-width: calc(var(--fig-canvas-control-line-stroke-width) + 2px);
|
|
225
|
+
filter: none;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.fig-canvas-control-radius-hit {
|
|
229
|
+
stroke: transparent;
|
|
230
|
+
stroke-width: 12px;
|
|
231
|
+
pointer-events: stroke;
|
|
232
|
+
filter: none;
|
|
233
|
+
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
&.fig-canvas-control-ring-active{
|
|
238
|
+
--fig-canvas-control-line-stroke-width: var(--fig-canvas-control-line-stroke-width-hover);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.fig-canvas-control-angle-svg {
|
|
242
|
+
pointer-events: none;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.fig-canvas-control-angle-line {
|
|
246
|
+
stroke: var(--fig-canvas-control-radius-stroke);
|
|
247
|
+
stroke-width: var(--fig-canvas-control-line-stroke-width);
|
|
248
|
+
paint-order: stroke fill;
|
|
249
|
+
filter: drop-shadow(0 0 0.5px rgba(0, 0, 0, 0.3))
|
|
250
|
+
drop-shadow(0 0.5px 1px rgba(0, 0, 0, 0.12));
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.fig-canvas-control-angle-line-halo {
|
|
254
|
+
stroke: var(--fig-canvas-control-radius-stroke-halo);
|
|
255
|
+
stroke-width: calc(var(--fig-canvas-control-line-stroke-width) + 2px);
|
|
256
|
+
stroke-linecap: butt;
|
|
257
|
+
filter: none;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
fig-handle[size="small"] {
|
|
261
|
+
z-index: 2;
|
|
262
|
+
|
|
263
|
+
.fig-handle-hit-area {
|
|
264
|
+
cursor: grab;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/* Angle Input */
|
|
270
|
+
fig-input-angle {
|
|
271
|
+
--size: 1.5rem;
|
|
272
|
+
display: inline-flex;
|
|
273
|
+
align-items: center;
|
|
274
|
+
gap: var(--spacer-2);
|
|
275
|
+
user-select: none;
|
|
276
|
+
|
|
277
|
+
> fig-input-number {
|
|
278
|
+
flex: 0 0 auto;
|
|
279
|
+
width: auto;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
&[full]:not([full="false"]) {
|
|
283
|
+
display: flex;
|
|
284
|
+
width: 100%;
|
|
285
|
+
|
|
286
|
+
> fig-input-number {
|
|
287
|
+
flex: 1 1 auto;
|
|
288
|
+
min-width: 0;
|
|
289
|
+
width: auto;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
fig-field:not([direction="vertical"]) & {
|
|
294
|
+
flex: 1;
|
|
295
|
+
min-width: 0;
|
|
296
|
+
|
|
297
|
+
fig-input-number {
|
|
298
|
+
flex: 0 0 auto;
|
|
299
|
+
width: auto;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.fig-input-angle-plane {
|
|
304
|
+
display: inline-grid;
|
|
305
|
+
place-items: center;
|
|
306
|
+
width: var(--size);
|
|
307
|
+
height: var(--size);
|
|
308
|
+
aspect-ratio: 1/1;
|
|
309
|
+
flex-shrink: 0;
|
|
310
|
+
background-color: var(--figma-color-bg-secondary);
|
|
311
|
+
border-radius: 100%;
|
|
312
|
+
box-shadow: inset 0 0 0 1px var(--figma-color-border);
|
|
313
|
+
&:focus,
|
|
314
|
+
&.dragging {
|
|
315
|
+
outline: 0;
|
|
316
|
+
box-shadow: inset 0 0 0 1px var(--figma-color-border-selected);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
.fig-input-angle-handle {
|
|
320
|
+
display: inline-grid;
|
|
321
|
+
place-items: center;
|
|
322
|
+
grid-area: 1/1;
|
|
323
|
+
width: calc(0.5rem + 2px);
|
|
324
|
+
height: calc(0.5rem + 2px);
|
|
325
|
+
&::before {
|
|
326
|
+
content: "";
|
|
327
|
+
display: block;
|
|
328
|
+
width: 0.5rem;
|
|
329
|
+
height: 0.5rem;
|
|
330
|
+
background: var(--handle-color);
|
|
331
|
+
box-shadow: var(--handle-shadow);
|
|
332
|
+
border-radius: 50%;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|