@rogieking/figui3 6.4.8 → 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 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
- display: flex;
1201
+ --fig-overflow-size: var(--spacer-4);
1202
+ display: block;
1203
+ min-width: 0;
1204
+ position: relative;
1156
1205
  width: 100%;
1157
- gap: var(--spacer-1);
1158
- padding: var(--spacer-1) var(--spacer-2);
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-2) var(--spacer-1) var(--spacer-3);
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: 0.25rem;
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] {
@@ -4456,68 +4557,66 @@ fig-chooser {
4456
4557
  --chooser-fade-size: var(--spacer-4);
4457
4558
  --fig-chooser-gap: var(--spacer-2);
4458
4559
 
4459
- display: flex;
4460
- flex-direction: column;
4461
- gap: 0;
4462
- overflow: visible auto;
4463
- scrollbar-width: none;
4464
- scroll-snap-type: y mandatory;
4560
+ display: block;
4561
+ min-width: 0;
4562
+ overflow: visible;
4563
+ position: relative;
4465
4564
 
4466
- > * {
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
+ }
4578
+
4579
+ > .fig-chooser-scroll > * {
4467
4580
  scroll-snap-align: start;
4468
- &:not(.fig-chooser-nav-start):not(.fig-chooser-nav-end) {
4469
- margin-block-end: var(--fig-chooser-gap);
4470
- }
4471
4581
  }
4472
4582
 
4473
4583
  &[overflow="scrollbar"] {
4474
- scrollbar-width: thin;
4475
- scrollbar-color: var(--figma-color-border) transparent;
4584
+ > .fig-chooser-scroll {
4585
+ scrollbar-width: thin;
4586
+ scrollbar-color: var(--figma-color-border) transparent;
4587
+ }
4476
4588
  }
4477
4589
 
4478
4590
  &[layout="horizontal"] {
4479
- flex-direction: row;
4480
- flex-wrap: nowrap;
4481
- overflow: auto hidden;
4482
- scrollbar-width: none;
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
+ }
4483
4598
 
4484
4599
  &[overflow="scrollbar"] {
4485
- scrollbar-width: thin;
4486
- scrollbar-color: var(--figma-color-border) transparent;
4600
+ > .fig-chooser-scroll {
4601
+ scrollbar-width: thin;
4602
+ scrollbar-color: var(--figma-color-border) transparent;
4603
+ }
4487
4604
  }
4488
4605
 
4489
- > :not(.fig-chooser-nav-start):not(.fig-chooser-nav-end) {
4606
+ > .fig-chooser-scroll > * {
4490
4607
  flex: 1 1 0%;
4491
4608
  }
4492
-
4493
- > * {
4494
- &:not(.fig-chooser-nav-start):not(.fig-chooser-nav-end) {
4495
- margin-inline-end: var(--fig-chooser-gap);
4496
- margin-block-end: 0;
4497
- }
4498
- }
4499
4609
  }
4500
4610
 
4501
4611
  &[layout="grid"] {
4502
- display: grid;
4503
- grid-template-columns: 1fr 1fr;
4504
-
4505
- fig-choice {
4506
- margin-inline-end: var(--fig-chooser-gap);
4507
- margin-bottom: 0;
4508
- &:nth-child(2n + 1){
4509
- margin-inline-end: 0;
4510
- }
4612
+ > .fig-chooser-scroll {
4613
+ display: grid;
4614
+ grid-template-columns: 1fr 1fr;
4511
4615
  }
4512
4616
 
4513
- > * {
4617
+ > .fig-chooser-scroll > * {
4514
4618
  min-width: 0;
4515
4619
  }
4516
-
4517
- > .fig-chooser-nav-start,
4518
- > .fig-chooser-nav-end {
4519
- grid-column: 1 / -1;
4520
- }
4521
4620
  }
4522
4621
 
4523
4622
  &[full]:not([full="false"]) {
@@ -4529,63 +4628,28 @@ fig-chooser {
4529
4628
  opacity: 0.4;
4530
4629
  }
4531
4630
 
4532
- .fig-chooser-nav-start,
4533
- .fig-chooser-nav-end {
4534
- all: unset;
4535
- position: sticky;
4536
- z-index: 3;
4537
- flex-shrink: 0;
4538
- display: flex;
4539
- align-items: center;
4540
- justify-content: center;
4631
+ > .fig-overflow {
4541
4632
  left: 0;
4542
4633
  right: 0;
4543
4634
  width: 100%;
4544
4635
  height: var(--chooser-fade-size);
4545
- cursor: pointer;
4546
- opacity: 0;
4547
- pointer-events: none;
4548
- color: var(--figma-color-icon);
4549
- background: var(--figma-color-bg) !important;
4550
- &:before{
4551
- content: "";
4552
- position: absolute;
4553
- inset: 0;
4554
- border-radius: var(--radius-medium);
4555
- background: var(--figma-color-bg) !important;
4556
- z-index: -1;
4557
- }
4558
-
4559
- &:hover:before{
4560
- background: var(--figma-color-bg-hover) !important;
4561
- }
4562
-
4563
- .fig-chooser-nav-chevron{
4564
- position: relative;
4565
- }
4566
-
4567
- &:active .fig-chooser-nav-chevron {
4568
- transform: translateY(1px);
4569
- }
4570
4636
  }
4571
4637
 
4572
- .fig-chooser-nav-start {
4638
+ > .fig-overflow-start {
4573
4639
  top: 0;
4574
- margin-bottom: calc(var(--chooser-fade-size) * -1);
4575
4640
  box-shadow: 0 1px 0 0 var(--figma-color-bordertranslucent);
4576
4641
  &:before{
4577
4642
  border-radius: var(--radius-medium) 0 0 var(--radius-medium);
4578
4643
  }
4579
4644
 
4580
4645
 
4581
- .fig-chooser-nav-chevron {
4646
+ .fig-overflow-chevron {
4582
4647
  rotate: 180deg;
4583
4648
  }
4584
4649
  }
4585
4650
 
4586
- .fig-chooser-nav-end {
4651
+ > .fig-overflow-end {
4587
4652
  bottom: 0;
4588
- margin-top: calc(var(--chooser-fade-size) * -1);
4589
4653
  box-shadow: 0 -1px 0 0 var(--figma-color-bordertranslucent);
4590
4654
  &:before{
4591
4655
  border-radius: 0 var(--radius-medium) var(--radius-medium) 0;
@@ -4593,8 +4657,7 @@ fig-chooser {
4593
4657
  }
4594
4658
 
4595
4659
  &[layout="horizontal"] {
4596
- .fig-chooser-nav-start,
4597
- .fig-chooser-nav-end {
4660
+ > .fig-overflow {
4598
4661
  top: 0;
4599
4662
  bottom: 0;
4600
4663
  height: auto;
@@ -4603,51 +4666,39 @@ fig-chooser {
4603
4666
  margin: 0;
4604
4667
  }
4605
4668
 
4606
- .fig-chooser-nav-start {
4669
+ > .fig-overflow-start {
4607
4670
  left: 0;
4608
4671
  right: auto;
4609
- margin-right: calc(var(--chooser-fade-size) * -1);
4610
4672
  box-shadow: 1px 0 0 0 var(--figma-color-bordertranslucent);
4611
4673
 
4612
- .fig-chooser-nav-chevron {
4674
+ .fig-overflow-chevron {
4613
4675
  rotate: 90deg;
4614
4676
  }
4615
4677
  }
4616
4678
 
4617
- .fig-chooser-nav-end {
4679
+ > .fig-overflow-end {
4618
4680
  right: 0;
4619
4681
  left: auto;
4620
- margin-left: calc(var(--chooser-fade-size) * -1);
4621
4682
  box-shadow: -1px 0 0 0 var(--figma-color-bordertranslucent);
4622
4683
 
4623
- .fig-chooser-nav-chevron {
4684
+ .fig-overflow-chevron {
4624
4685
  rotate: -90deg;
4625
4686
  }
4626
4687
  }
4627
4688
  }
4628
4689
  &[layout="vertical"],
4629
4690
  &[layout="grid"]{
4630
- .fig-chooser-nav-start{
4691
+ > .fig-overflow-start{
4631
4692
  &:before{
4632
4693
  border-radius: var(--radius-medium) var(--radius-medium) 0 0;
4633
4694
  }
4634
4695
  }
4635
- .fig-chooser-nav-end {
4696
+ > .fig-overflow-end {
4636
4697
  &:before{
4637
4698
  border-radius: 0 0 var(--radius-medium) var(--radius-medium);
4638
4699
  }
4639
4700
  }
4640
4701
  }
4641
-
4642
- &.overflow-start > .fig-chooser-nav-start {
4643
- opacity: 1;
4644
- pointer-events: auto;
4645
- }
4646
-
4647
- &.overflow-end > .fig-chooser-nav-end {
4648
- opacity: 1;
4649
- pointer-events: auto;
4650
- }
4651
4702
  }
4652
4703
 
4653
4704
  fig-choice {