@rogieking/figui3 6.4.7 → 6.5.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/README.md +1 -0
- package/components.css +161 -109
- package/dist/components.css +1 -1
- package/dist/fig.css +1 -1
- package/dist/fig.js +33 -33
- package/fig.js +375 -81
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -645,6 +645,7 @@ Segmented controls expose a radio-group pattern. Arrow keys, Home, and End move
|
|
|
645
645
|
`<fig-chooser>` / `<fig-choice>`
|
|
646
646
|
|
|
647
647
|
A selection list controller. `<fig-choice>` elements are selectable options within a `<fig-chooser>`.
|
|
648
|
+
When app code rebuilds a chooser by setting `fig-chooser.innerHTML`, the chooser restores its internal light-DOM overflow buttons automatically.
|
|
648
649
|
|
|
649
650
|
**fig-chooser attributes:**
|
|
650
651
|
|
package/components.css
CHANGED
|
@@ -1150,12 +1150,106 @@ fig-tab,
|
|
|
1150
1150
|
}
|
|
1151
1151
|
}
|
|
1152
1152
|
|
|
1153
|
+
.fig-overflow {
|
|
1154
|
+
all: unset;
|
|
1155
|
+
position: absolute;
|
|
1156
|
+
z-index: 3;
|
|
1157
|
+
flex-shrink: 0;
|
|
1158
|
+
display: flex;
|
|
1159
|
+
align-items: center;
|
|
1160
|
+
justify-content: center;
|
|
1161
|
+
cursor: pointer;
|
|
1162
|
+
opacity: 0;
|
|
1163
|
+
pointer-events: none;
|
|
1164
|
+
color: var(--figma-color-icon);
|
|
1165
|
+
background: var(--figma-color-bg) !important;
|
|
1166
|
+
|
|
1167
|
+
&:before{
|
|
1168
|
+
content: "";
|
|
1169
|
+
position: absolute;
|
|
1170
|
+
inset: 0;
|
|
1171
|
+
border-radius: var(--radius-medium);
|
|
1172
|
+
background: var(--figma-color-bg) !important;
|
|
1173
|
+
z-index: -1;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
&:hover:before{
|
|
1177
|
+
background: var(--figma-color-bg-hover) !important;
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
.fig-overflow-chevron{
|
|
1181
|
+
position: relative;
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
&:active .fig-overflow-chevron {
|
|
1185
|
+
transform: translateY(1px);
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
.overflow-start > .fig-overflow-start {
|
|
1190
|
+
opacity: 1;
|
|
1191
|
+
pointer-events: auto;
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
.overflow-end > .fig-overflow-end {
|
|
1195
|
+
opacity: 1;
|
|
1196
|
+
pointer-events: auto;
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1153
1199
|
fig-tabs,
|
|
1154
1200
|
.tabs {
|
|
1155
|
-
|
|
1201
|
+
--fig-overflow-size: var(--spacer-4);
|
|
1202
|
+
display: block;
|
|
1203
|
+
min-width: 0;
|
|
1204
|
+
position: relative;
|
|
1156
1205
|
width: 100%;
|
|
1157
|
-
|
|
1158
|
-
|
|
1206
|
+
overflow: hidden;
|
|
1207
|
+
|
|
1208
|
+
> .fig-tabs-scroll {
|
|
1209
|
+
box-sizing: border-box;
|
|
1210
|
+
display: flex;
|
|
1211
|
+
gap: var(--spacer-1);
|
|
1212
|
+
overflow: auto hidden;
|
|
1213
|
+
padding: var(--spacer-1) var(--spacer-2);
|
|
1214
|
+
scrollbar-width: none;
|
|
1215
|
+
width: 100%;
|
|
1216
|
+
min-width: 0;
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
> .fig-overflow {
|
|
1220
|
+
top: 0;
|
|
1221
|
+
bottom: 0;
|
|
1222
|
+
height: auto;
|
|
1223
|
+
width: var(--fig-overflow-size);
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
> .fig-overflow-start {
|
|
1227
|
+
left: 0;
|
|
1228
|
+
right: auto;
|
|
1229
|
+
box-shadow: 1px 0 0 0 var(--figma-color-bordertranslucent);
|
|
1230
|
+
|
|
1231
|
+
&:before{
|
|
1232
|
+
border-radius: var(--radius-medium) 0 0 var(--radius-medium);
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
.fig-overflow-chevron {
|
|
1236
|
+
rotate: 90deg;
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
> .fig-overflow-end {
|
|
1241
|
+
right: 0;
|
|
1242
|
+
left: auto;
|
|
1243
|
+
box-shadow: -1px 0 0 0 var(--figma-color-bordertranslucent);
|
|
1244
|
+
|
|
1245
|
+
&:before{
|
|
1246
|
+
border-radius: 0 var(--radius-medium) var(--radius-medium) 0;
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
.fig-overflow-chevron {
|
|
1250
|
+
rotate: -90deg;
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1159
1253
|
}
|
|
1160
1254
|
|
|
1161
1255
|
fig-tab-content,
|
|
@@ -3183,18 +3277,25 @@ fig-input-color {
|
|
|
3183
3277
|
fig-header {
|
|
3184
3278
|
height: var(--spacer-6);
|
|
3185
3279
|
margin: 0;
|
|
3186
|
-
padding: var(--spacer-1) var(--spacer-
|
|
3280
|
+
padding: var(--spacer-1) var(--spacer-3);
|
|
3187
3281
|
display: flex;
|
|
3188
3282
|
align-items: center;
|
|
3189
3283
|
box-shadow: inset 0 -1px 0 0 var(--figma-color-border);
|
|
3190
|
-
gap:
|
|
3284
|
+
gap: var(--spacer-2);
|
|
3191
3285
|
user-select: none;
|
|
3286
|
+
color: var(--figma-color-text-secondary);
|
|
3287
|
+
|
|
3288
|
+
|
|
3289
|
+
& >fig-button[icon][variant="ghost"] {
|
|
3290
|
+
margin-right: calc(var(--spacer-2) * -1);
|
|
3291
|
+
}
|
|
3192
3292
|
|
|
3193
3293
|
& h3 {
|
|
3194
3294
|
font-weight: var(--body-medium-strong-fontWeight);
|
|
3195
3295
|
flex-grow: 1;
|
|
3196
3296
|
display: flex;
|
|
3197
3297
|
align-items: center;
|
|
3298
|
+
color: var(--figma-color-text);
|
|
3198
3299
|
}
|
|
3199
3300
|
|
|
3200
3301
|
&[borderless] {
|
|
@@ -3427,20 +3528,21 @@ fig-input-number {
|
|
|
3427
3528
|
}
|
|
3428
3529
|
}
|
|
3429
3530
|
|
|
3430
|
-
& input
|
|
3531
|
+
& input,
|
|
3532
|
+
& textarea {
|
|
3431
3533
|
background-color: transparent !important;
|
|
3432
3534
|
flex: 1;
|
|
3433
3535
|
|
|
3434
3536
|
&:focus,
|
|
3435
3537
|
&:active {
|
|
3436
|
-
outline: 0;
|
|
3538
|
+
outline: 0 !important;
|
|
3437
3539
|
box-shadow: none !important;
|
|
3438
3540
|
}
|
|
3439
3541
|
}
|
|
3440
3542
|
|
|
3441
3543
|
& input[type="text"]:focus,
|
|
3442
3544
|
& input[type="text"]:active {
|
|
3443
|
-
outline: 0;
|
|
3545
|
+
outline: 0 !important;
|
|
3444
3546
|
box-shadow: none !important;
|
|
3445
3547
|
}
|
|
3446
3548
|
|
|
@@ -3455,7 +3557,7 @@ fig-input-number {
|
|
|
3455
3557
|
}
|
|
3456
3558
|
}
|
|
3457
3559
|
|
|
3458
|
-
&:has(input:focus) {
|
|
3560
|
+
&:has(:is(input, textarea):focus) {
|
|
3459
3561
|
outline: var(--figma-focus-outline);
|
|
3460
3562
|
outline-offset: var(--figma-focus-outline-offset);
|
|
3461
3563
|
}
|
|
@@ -4455,68 +4557,66 @@ fig-chooser {
|
|
|
4455
4557
|
--chooser-fade-size: var(--spacer-4);
|
|
4456
4558
|
--fig-chooser-gap: var(--spacer-2);
|
|
4457
4559
|
|
|
4458
|
-
display:
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4560
|
+
display: block;
|
|
4561
|
+
min-width: 0;
|
|
4562
|
+
overflow: visible;
|
|
4563
|
+
position: relative;
|
|
4564
|
+
|
|
4565
|
+
> .fig-chooser-scroll {
|
|
4566
|
+
display: flex;
|
|
4567
|
+
flex-direction: column;
|
|
4568
|
+
gap: var(--fig-chooser-gap);
|
|
4569
|
+
overflow: visible auto;
|
|
4570
|
+
scrollbar-width: none;
|
|
4571
|
+
scroll-snap-type: y mandatory;
|
|
4572
|
+
width: 100%;
|
|
4573
|
+
height: inherit;
|
|
4574
|
+
max-height: inherit;
|
|
4575
|
+
max-width: inherit;
|
|
4576
|
+
min-width: 0;
|
|
4577
|
+
}
|
|
4464
4578
|
|
|
4465
|
-
> * {
|
|
4579
|
+
> .fig-chooser-scroll > * {
|
|
4466
4580
|
scroll-snap-align: start;
|
|
4467
|
-
&:not(.fig-chooser-nav-start):not(.fig-chooser-nav-end) {
|
|
4468
|
-
margin-block-end: var(--fig-chooser-gap);
|
|
4469
|
-
}
|
|
4470
4581
|
}
|
|
4471
4582
|
|
|
4472
4583
|
&[overflow="scrollbar"] {
|
|
4473
|
-
|
|
4474
|
-
|
|
4584
|
+
> .fig-chooser-scroll {
|
|
4585
|
+
scrollbar-width: thin;
|
|
4586
|
+
scrollbar-color: var(--figma-color-border) transparent;
|
|
4587
|
+
}
|
|
4475
4588
|
}
|
|
4476
4589
|
|
|
4477
4590
|
&[layout="horizontal"] {
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4591
|
+
> .fig-chooser-scroll {
|
|
4592
|
+
flex-direction: row;
|
|
4593
|
+
flex-wrap: nowrap;
|
|
4594
|
+
overflow: auto hidden;
|
|
4595
|
+
scrollbar-width: none;
|
|
4596
|
+
scroll-snap-type: x mandatory;
|
|
4597
|
+
}
|
|
4482
4598
|
|
|
4483
4599
|
&[overflow="scrollbar"] {
|
|
4484
|
-
|
|
4485
|
-
|
|
4600
|
+
> .fig-chooser-scroll {
|
|
4601
|
+
scrollbar-width: thin;
|
|
4602
|
+
scrollbar-color: var(--figma-color-border) transparent;
|
|
4603
|
+
}
|
|
4486
4604
|
}
|
|
4487
4605
|
|
|
4488
|
-
>
|
|
4606
|
+
> .fig-chooser-scroll > * {
|
|
4489
4607
|
flex: 1 1 0%;
|
|
4490
4608
|
}
|
|
4491
|
-
|
|
4492
|
-
> * {
|
|
4493
|
-
&:not(.fig-chooser-nav-start):not(.fig-chooser-nav-end) {
|
|
4494
|
-
margin-inline-end: var(--fig-chooser-gap);
|
|
4495
|
-
margin-block-end: 0;
|
|
4496
|
-
}
|
|
4497
|
-
}
|
|
4498
4609
|
}
|
|
4499
4610
|
|
|
4500
4611
|
&[layout="grid"] {
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
fig-choice {
|
|
4505
|
-
margin-inline-end: var(--fig-chooser-gap);
|
|
4506
|
-
margin-bottom: 0;
|
|
4507
|
-
&:nth-child(2n + 1){
|
|
4508
|
-
margin-inline-end: 0;
|
|
4509
|
-
}
|
|
4612
|
+
> .fig-chooser-scroll {
|
|
4613
|
+
display: grid;
|
|
4614
|
+
grid-template-columns: 1fr 1fr;
|
|
4510
4615
|
}
|
|
4511
4616
|
|
|
4512
|
-
> * {
|
|
4617
|
+
> .fig-chooser-scroll > * {
|
|
4513
4618
|
min-width: 0;
|
|
4514
4619
|
}
|
|
4515
|
-
|
|
4516
|
-
> .fig-chooser-nav-start,
|
|
4517
|
-
> .fig-chooser-nav-end {
|
|
4518
|
-
grid-column: 1 / -1;
|
|
4519
|
-
}
|
|
4520
4620
|
}
|
|
4521
4621
|
|
|
4522
4622
|
&[full]:not([full="false"]) {
|
|
@@ -4528,63 +4628,28 @@ fig-chooser {
|
|
|
4528
4628
|
opacity: 0.4;
|
|
4529
4629
|
}
|
|
4530
4630
|
|
|
4531
|
-
.fig-
|
|
4532
|
-
.fig-chooser-nav-end {
|
|
4533
|
-
all: unset;
|
|
4534
|
-
position: sticky;
|
|
4535
|
-
z-index: 3;
|
|
4536
|
-
flex-shrink: 0;
|
|
4537
|
-
display: flex;
|
|
4538
|
-
align-items: center;
|
|
4539
|
-
justify-content: center;
|
|
4631
|
+
> .fig-overflow {
|
|
4540
4632
|
left: 0;
|
|
4541
4633
|
right: 0;
|
|
4542
4634
|
width: 100%;
|
|
4543
4635
|
height: var(--chooser-fade-size);
|
|
4544
|
-
cursor: pointer;
|
|
4545
|
-
opacity: 0;
|
|
4546
|
-
pointer-events: none;
|
|
4547
|
-
color: var(--figma-color-icon);
|
|
4548
|
-
background: var(--figma-color-bg) !important;
|
|
4549
|
-
&:before{
|
|
4550
|
-
content: "";
|
|
4551
|
-
position: absolute;
|
|
4552
|
-
inset: 0;
|
|
4553
|
-
border-radius: var(--radius-medium);
|
|
4554
|
-
background: var(--figma-color-bg) !important;
|
|
4555
|
-
z-index: -1;
|
|
4556
|
-
}
|
|
4557
|
-
|
|
4558
|
-
&:hover:before{
|
|
4559
|
-
background: var(--figma-color-bg-hover) !important;
|
|
4560
|
-
}
|
|
4561
|
-
|
|
4562
|
-
.fig-chooser-nav-chevron{
|
|
4563
|
-
position: relative;
|
|
4564
|
-
}
|
|
4565
|
-
|
|
4566
|
-
&:active .fig-chooser-nav-chevron {
|
|
4567
|
-
transform: translateY(1px);
|
|
4568
|
-
}
|
|
4569
4636
|
}
|
|
4570
4637
|
|
|
4571
|
-
.fig-
|
|
4638
|
+
> .fig-overflow-start {
|
|
4572
4639
|
top: 0;
|
|
4573
|
-
margin-bottom: calc(var(--chooser-fade-size) * -1);
|
|
4574
4640
|
box-shadow: 0 1px 0 0 var(--figma-color-bordertranslucent);
|
|
4575
4641
|
&:before{
|
|
4576
4642
|
border-radius: var(--radius-medium) 0 0 var(--radius-medium);
|
|
4577
4643
|
}
|
|
4578
4644
|
|
|
4579
4645
|
|
|
4580
|
-
.fig-
|
|
4646
|
+
.fig-overflow-chevron {
|
|
4581
4647
|
rotate: 180deg;
|
|
4582
4648
|
}
|
|
4583
4649
|
}
|
|
4584
4650
|
|
|
4585
|
-
.fig-
|
|
4651
|
+
> .fig-overflow-end {
|
|
4586
4652
|
bottom: 0;
|
|
4587
|
-
margin-top: calc(var(--chooser-fade-size) * -1);
|
|
4588
4653
|
box-shadow: 0 -1px 0 0 var(--figma-color-bordertranslucent);
|
|
4589
4654
|
&:before{
|
|
4590
4655
|
border-radius: 0 var(--radius-medium) var(--radius-medium) 0;
|
|
@@ -4592,8 +4657,7 @@ fig-chooser {
|
|
|
4592
4657
|
}
|
|
4593
4658
|
|
|
4594
4659
|
&[layout="horizontal"] {
|
|
4595
|
-
.fig-
|
|
4596
|
-
.fig-chooser-nav-end {
|
|
4660
|
+
> .fig-overflow {
|
|
4597
4661
|
top: 0;
|
|
4598
4662
|
bottom: 0;
|
|
4599
4663
|
height: auto;
|
|
@@ -4602,51 +4666,39 @@ fig-chooser {
|
|
|
4602
4666
|
margin: 0;
|
|
4603
4667
|
}
|
|
4604
4668
|
|
|
4605
|
-
.fig-
|
|
4669
|
+
> .fig-overflow-start {
|
|
4606
4670
|
left: 0;
|
|
4607
4671
|
right: auto;
|
|
4608
|
-
margin-right: calc(var(--chooser-fade-size) * -1);
|
|
4609
4672
|
box-shadow: 1px 0 0 0 var(--figma-color-bordertranslucent);
|
|
4610
4673
|
|
|
4611
|
-
.fig-
|
|
4674
|
+
.fig-overflow-chevron {
|
|
4612
4675
|
rotate: 90deg;
|
|
4613
4676
|
}
|
|
4614
4677
|
}
|
|
4615
4678
|
|
|
4616
|
-
.fig-
|
|
4679
|
+
> .fig-overflow-end {
|
|
4617
4680
|
right: 0;
|
|
4618
4681
|
left: auto;
|
|
4619
|
-
margin-left: calc(var(--chooser-fade-size) * -1);
|
|
4620
4682
|
box-shadow: -1px 0 0 0 var(--figma-color-bordertranslucent);
|
|
4621
4683
|
|
|
4622
|
-
.fig-
|
|
4684
|
+
.fig-overflow-chevron {
|
|
4623
4685
|
rotate: -90deg;
|
|
4624
4686
|
}
|
|
4625
4687
|
}
|
|
4626
4688
|
}
|
|
4627
4689
|
&[layout="vertical"],
|
|
4628
4690
|
&[layout="grid"]{
|
|
4629
|
-
.fig-
|
|
4691
|
+
> .fig-overflow-start{
|
|
4630
4692
|
&:before{
|
|
4631
4693
|
border-radius: var(--radius-medium) var(--radius-medium) 0 0;
|
|
4632
4694
|
}
|
|
4633
4695
|
}
|
|
4634
|
-
.fig-
|
|
4696
|
+
> .fig-overflow-end {
|
|
4635
4697
|
&:before{
|
|
4636
4698
|
border-radius: 0 0 var(--radius-medium) var(--radius-medium);
|
|
4637
4699
|
}
|
|
4638
4700
|
}
|
|
4639
4701
|
}
|
|
4640
|
-
|
|
4641
|
-
&.overflow-start > .fig-chooser-nav-start {
|
|
4642
|
-
opacity: 1;
|
|
4643
|
-
pointer-events: auto;
|
|
4644
|
-
}
|
|
4645
|
-
|
|
4646
|
-
&.overflow-end > .fig-chooser-nav-end {
|
|
4647
|
-
opacity: 1;
|
|
4648
|
-
pointer-events: auto;
|
|
4649
|
-
}
|
|
4650
4702
|
}
|
|
4651
4703
|
|
|
4652
4704
|
fig-choice {
|