@rogieking/figui3 2.15.0 → 2.17.1

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.
Files changed (4) hide show
  1. package/components.css +40 -0
  2. package/fig.js +102 -4
  3. package/index.html +140 -19
  4. package/package.json +1 -1
package/components.css CHANGED
@@ -2268,6 +2268,36 @@ fig-header {
2268
2268
  }
2269
2269
  }
2270
2270
 
2271
+ fig-footer {
2272
+ display: flex;
2273
+ align-items: center;
2274
+ justify-content: flex-end;
2275
+ gap: var(--spacer-2);
2276
+ height: var(--spacer-6);
2277
+ padding: var(--spacer-1) var(--spacer-2) var(--spacer-1) var(--spacer-3);
2278
+ box-shadow: inset 0 1px 0 0 var(--figma-color-border);
2279
+
2280
+ & h3 {
2281
+ font-weight: var(--body-medium-strong-fontWeight);
2282
+ flex-grow: 1;
2283
+ display: flex;
2284
+ align-items: baseline;
2285
+ gap: var(--spacer-half);
2286
+ }
2287
+
2288
+ &[borderless] {
2289
+ box-shadow: none;
2290
+ }
2291
+
2292
+ &[sticky]:not([sticky="false"]) {
2293
+ position: sticky;
2294
+ bottom: 0;
2295
+ z-index: 10;
2296
+ margin-top: auto;
2297
+ background: var(--figma-color-bg);
2298
+ }
2299
+ }
2300
+
2271
2301
  fig-content {
2272
2302
  padding: var(--spacer-2) 0;
2273
2303
  display: block;
@@ -2522,6 +2552,16 @@ fig-segmented-control {
2522
2552
  }
2523
2553
  }
2524
2554
  }
2555
+
2556
+ &[disabled]:not([disabled="false"]) {
2557
+ pointer-events: none;
2558
+
2559
+ fig-segment {
2560
+ color: var(--figma-color-text-disabled);
2561
+ background-color: transparent;
2562
+ box-shadow: none;
2563
+ }
2564
+ }
2525
2565
  }
2526
2566
 
2527
2567
  fig-input-joystick {
package/fig.js CHANGED
@@ -167,6 +167,8 @@ customElements.define("fig-button", FigButton);
167
167
  class FigDropdown extends HTMLElement {
168
168
  #label = "Menu";
169
169
  #selectedValue = null; // Stores last selected value for dropdown type
170
+ #boundHandleSelectInput;
171
+ #boundHandleSelectChange;
170
172
 
171
173
  get label() {
172
174
  return this.#label;
@@ -179,11 +181,33 @@ class FigDropdown extends HTMLElement {
179
181
  this.select = document.createElement("select");
180
182
  this.optionsSlot = document.createElement("slot");
181
183
  this.attachShadow({ mode: "open" });
184
+ this.#boundHandleSelectInput = this.#handleSelectInput.bind(this);
185
+ this.#boundHandleSelectChange = this.#handleSelectChange.bind(this);
182
186
  }
183
187
 
184
188
  #addEventListeners() {
185
- this.select.addEventListener("input", this.#handleSelectInput.bind(this));
186
- this.select.addEventListener("change", this.#handleSelectChange.bind(this));
189
+ this.select.addEventListener("input", this.#boundHandleSelectInput);
190
+ this.select.addEventListener("change", this.#boundHandleSelectChange);
191
+ }
192
+
193
+ #hasPersistentControl(optionEl) {
194
+ if (!optionEl || !(optionEl instanceof Element)) return false;
195
+ return !!optionEl.querySelector(
196
+ 'fig-checkbox, fig-switch, input[type="checkbox"]'
197
+ );
198
+ }
199
+
200
+ #keepPickerOpen() {
201
+ // Keep menu open for interactive controls inside option content.
202
+ if (typeof this.select.showPicker === "function") {
203
+ requestAnimationFrame(() => {
204
+ try {
205
+ this.select.showPicker();
206
+ } catch {
207
+ // Ignore if browser blocks reopening picker
208
+ }
209
+ });
210
+ }
187
211
  }
188
212
 
189
213
  connectedCallback() {
@@ -224,6 +248,15 @@ class FigDropdown extends HTMLElement {
224
248
  }
225
249
 
226
250
  #handleSelectInput(e) {
251
+ const selectedOption = e.target.selectedOptions?.[0];
252
+ if (this.#hasPersistentControl(selectedOption)) {
253
+ if (this.type === "dropdown") {
254
+ this.select.selectedIndex = -1;
255
+ }
256
+ this.#keepPickerOpen();
257
+ return;
258
+ }
259
+
227
260
  const selectedValue = e.target.value;
228
261
  // Store the selected value for dropdown type (before select gets reset)
229
262
  if (this.type === "dropdown") {
@@ -240,6 +273,15 @@ class FigDropdown extends HTMLElement {
240
273
  }
241
274
 
242
275
  #handleSelectChange(e) {
276
+ const selectedOption = e.target.selectedOptions?.[0];
277
+ if (this.#hasPersistentControl(selectedOption)) {
278
+ if (this.type === "dropdown") {
279
+ this.select.selectedIndex = -1;
280
+ }
281
+ this.#keepPickerOpen();
282
+ return;
283
+ }
284
+
243
285
  // Get the value before resetting (use stored value for dropdown type)
244
286
  const selectedValue =
245
287
  this.type === "dropdown" ? this.#selectedValue : this.select.value;
@@ -1292,6 +1334,14 @@ class FigSegment extends HTMLElement {
1292
1334
  this.removeEventListener("click", this.handleClick);
1293
1335
  }
1294
1336
  handleClick() {
1337
+ const parentControl = this.closest("fig-segmented-control");
1338
+ if (
1339
+ parentControl &&
1340
+ parentControl.hasAttribute("disabled") &&
1341
+ parentControl.getAttribute("disabled") !== "false"
1342
+ ) {
1343
+ return;
1344
+ }
1295
1345
  this.setAttribute("selected", "true");
1296
1346
  }
1297
1347
  get value() {
@@ -1335,9 +1385,16 @@ class FigSegmentedControl extends HTMLElement {
1335
1385
  super();
1336
1386
  }
1337
1387
 
1388
+ static get observedAttributes() {
1389
+ return ["disabled"];
1390
+ }
1391
+
1338
1392
  connectedCallback() {
1339
1393
  this.name = this.getAttribute("name") || "segmented-control";
1340
1394
  this.addEventListener("click", this.handleClick.bind(this));
1395
+ this.#applyDisabled(
1396
+ this.hasAttribute("disabled") && this.getAttribute("disabled") !== "false"
1397
+ );
1341
1398
 
1342
1399
  // Ensure at least one segment is selected (default to first)
1343
1400
  requestAnimationFrame(() => {
@@ -1368,6 +1425,12 @@ class FigSegmentedControl extends HTMLElement {
1368
1425
  }
1369
1426
 
1370
1427
  handleClick(event) {
1428
+ if (
1429
+ this.hasAttribute("disabled") &&
1430
+ this.getAttribute("disabled") !== "false"
1431
+ ) {
1432
+ return;
1433
+ }
1371
1434
  const segment = event.target.closest("fig-segment");
1372
1435
  if (segment) {
1373
1436
  const segments = this.querySelectorAll("fig-segment");
@@ -1380,6 +1443,25 @@ class FigSegmentedControl extends HTMLElement {
1380
1443
  }
1381
1444
  }
1382
1445
  }
1446
+
1447
+ #applyDisabled(disabled) {
1448
+ this.setAttribute("aria-disabled", disabled ? "true" : "false");
1449
+ this.querySelectorAll("fig-segment").forEach((segment) => {
1450
+ if (disabled) {
1451
+ segment.setAttribute("disabled", "");
1452
+ segment.setAttribute("aria-disabled", "true");
1453
+ } else {
1454
+ segment.removeAttribute("disabled");
1455
+ segment.removeAttribute("aria-disabled");
1456
+ }
1457
+ });
1458
+ }
1459
+
1460
+ attributeChangedCallback(name, oldValue, newValue) {
1461
+ if (name === "disabled" && oldValue !== newValue) {
1462
+ this.#applyDisabled(newValue !== null && newValue !== "false");
1463
+ }
1464
+ }
1383
1465
  }
1384
1466
  customElements.define("fig-segmented-control", FigSegmentedControl);
1385
1467
 
@@ -3581,6 +3663,7 @@ customElements.define("fig-input-fill", FigInputFill);
3581
3663
  */
3582
3664
  class FigCheckbox extends HTMLElement {
3583
3665
  #labelElement = null;
3666
+ #boundHandleInput;
3584
3667
 
3585
3668
  constructor() {
3586
3669
  super();
@@ -3591,11 +3674,21 @@ class FigCheckbox extends HTMLElement {
3591
3674
  this.input.setAttribute("name", this.name);
3592
3675
  this.input.setAttribute("type", "checkbox");
3593
3676
  this.input.setAttribute("role", "checkbox");
3677
+ this.#boundHandleInput = this.handleInput.bind(this);
3594
3678
  }
3595
3679
  connectedCallback() {
3680
+ // Reuse cloned internals when this element is duplicated via option.cloneNode(true).
3681
+ const existingInput = this.querySelector(":scope > input");
3682
+ if (existingInput) {
3683
+ this.input = existingInput;
3684
+ } else if (!this.input.parentNode) {
3685
+ this.append(this.input);
3686
+ }
3687
+
3596
3688
  this.input.checked =
3597
3689
  this.hasAttribute("checked") && this.getAttribute("checked") !== "false";
3598
- this.input.addEventListener("change", this.handleInput.bind(this));
3690
+ this.input.removeEventListener("change", this.#boundHandleInput);
3691
+ this.input.addEventListener("change", this.#boundHandleInput);
3599
3692
 
3600
3693
  if (this.hasAttribute("disabled")) {
3601
3694
  this.input.disabled = true;
@@ -3605,7 +3698,11 @@ class FigCheckbox extends HTMLElement {
3605
3698
  this.input.setAttribute("indeterminate", "true");
3606
3699
  }
3607
3700
 
3608
- this.append(this.input);
3701
+ const existingLabel = this.querySelector(":scope > label");
3702
+ if (existingLabel) {
3703
+ this.#labelElement = existingLabel;
3704
+ this.#labelElement.setAttribute("for", this.input.id);
3705
+ }
3609
3706
 
3610
3707
  // Only create label if label attribute is present
3611
3708
  if (this.hasAttribute("label")) {
@@ -3663,6 +3760,7 @@ class FigCheckbox extends HTMLElement {
3663
3760
  }
3664
3761
 
3665
3762
  disconnectedCallback() {
3763
+ this.input.removeEventListener("change", this.#boundHandleInput);
3666
3764
  this.input.remove();
3667
3765
  }
3668
3766
 
package/index.html CHANGED
@@ -107,8 +107,10 @@
107
107
  main {
108
108
  margin-left: 180px;
109
109
  padding: 24px 32px;
110
- overflow-y: auto;
111
110
  max-width: 800px;
111
+ min-height: 100vh;
112
+ display: flex;
113
+ flex-direction: column;
112
114
  }
113
115
 
114
116
  section {
@@ -1168,29 +1170,70 @@
1168
1170
  </p>
1169
1171
  <fig-dropdown experimental="modern">
1170
1172
  <option value="home">
1171
- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
1172
- <path d="M2 6.5L8 2L14 6.5V13.5C14 14 13.5 14.5 13 14.5H3C2.5 14.5 2 14 2 13.5V6.5Z" stroke="currentColor" stroke-opacity="0.9" fill="none"/>
1173
+ <svg width="16"
1174
+ height="16"
1175
+ viewBox="0 0 16 16"
1176
+ fill="none"
1177
+ xmlns="http://www.w3.org/2000/svg">
1178
+ <path d="M2 6.5L8 2L14 6.5V13.5C14 14 13.5 14.5 13 14.5H3C2.5 14.5 2 14 2 13.5V6.5Z"
1179
+ stroke="currentColor"
1180
+ stroke-opacity="0.9"
1181
+ fill="none" />
1173
1182
  </svg>
1174
1183
  <label>Home</label>
1175
1184
  </option>
1176
1185
  <option value="settings">
1177
- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
1178
- <circle cx="8" cy="8" r="2" stroke="currentColor" stroke-opacity="0.9" fill="none"/>
1179
- <path d="M8 1V3M8 13V15M1 8H3M13 8H15M2.5 2.5L4 4M12 12L13.5 13.5M2.5 13.5L4 12M12 4L13.5 2.5" stroke="currentColor" stroke-opacity="0.9"/>
1186
+ <svg width="16"
1187
+ height="16"
1188
+ viewBox="0 0 16 16"
1189
+ fill="none"
1190
+ xmlns="http://www.w3.org/2000/svg">
1191
+ <circle cx="8"
1192
+ cy="8"
1193
+ r="2"
1194
+ stroke="currentColor"
1195
+ stroke-opacity="0.9"
1196
+ fill="none" />
1197
+ <path d="M8 1V3M8 13V15M1 8H3M13 8H15M2.5 2.5L4 4M12 12L13.5 13.5M2.5 13.5L4 12M12 4L13.5 2.5"
1198
+ stroke="currentColor"
1199
+ stroke-opacity="0.9" />
1180
1200
  </svg>
1181
1201
  <label>Settings</label>
1182
1202
  </option>
1183
1203
  <option value="user">
1184
- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
1185
- <circle cx="8" cy="5" r="3" stroke="currentColor" stroke-opacity="0.9" fill="none"/>
1186
- <path d="M2 14C2 11 4.5 9 8 9C11.5 9 14 11 14 14" stroke="currentColor" stroke-opacity="0.9" fill="none"/>
1204
+ <svg width="16"
1205
+ height="16"
1206
+ viewBox="0 0 16 16"
1207
+ fill="none"
1208
+ xmlns="http://www.w3.org/2000/svg">
1209
+ <circle cx="8"
1210
+ cy="5"
1211
+ r="3"
1212
+ stroke="currentColor"
1213
+ stroke-opacity="0.9"
1214
+ fill="none" />
1215
+ <path d="M2 14C2 11 4.5 9 8 9C11.5 9 14 11 14 14"
1216
+ stroke="currentColor"
1217
+ stroke-opacity="0.9"
1218
+ fill="none" />
1187
1219
  </svg>
1188
1220
  <label>User Profile</label>
1189
1221
  </option>
1190
1222
  <option value="search">
1191
- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
1192
- <circle cx="6.5" cy="6.5" r="4" stroke="currentColor" stroke-opacity="0.9" fill="none"/>
1193
- <path d="M10 10L14 14" stroke="currentColor" stroke-opacity="0.9"/>
1223
+ <svg width="16"
1224
+ height="16"
1225
+ viewBox="0 0 16 16"
1226
+ fill="none"
1227
+ xmlns="http://www.w3.org/2000/svg">
1228
+ <circle cx="6.5"
1229
+ cy="6.5"
1230
+ r="4"
1231
+ stroke="currentColor"
1232
+ stroke-opacity="0.9"
1233
+ fill="none" />
1234
+ <path d="M10 10L14 14"
1235
+ stroke="currentColor"
1236
+ stroke-opacity="0.9" />
1194
1237
  </svg>
1195
1238
  <label>Search</label>
1196
1239
  </option>
@@ -1337,7 +1380,8 @@
1337
1380
  <fig-fill-picker mode="image"></fig-fill-picker>
1338
1381
 
1339
1382
  <h3>Limited Mode Selection</h3>
1340
- <p class="description">Use comma-separated values in the <code>mode</code> attribute to limit available modes
1383
+ <p class="description">Use comma-separated values in the <code>mode</code> attribute to limit available
1384
+ modes
1341
1385
  while still allowing switching between them.</p>
1342
1386
 
1343
1387
  <h4>Solid and Gradient Only</h4>
@@ -1347,7 +1391,8 @@
1347
1391
  <fig-fill-picker mode="solid,gradient,image"></fig-fill-picker>
1348
1392
 
1349
1393
  <h4>With fig-input-fill (mode passed through)</h4>
1350
- <fig-input-fill mode="solid,gradient" value='{"type":"solid","color":"#667eea"}'></fig-input-fill>
1394
+ <fig-input-fill mode="solid,gradient"
1395
+ value='{"type":"solid","color":"#667eea"}'></fig-input-fill>
1351
1396
 
1352
1397
  <h3>Event Listening</h3>
1353
1398
  <fig-fill-picker id="fill-picker-events"
@@ -2651,13 +2696,25 @@
2651
2696
  <h3>With Icons</h3>
2652
2697
  <fig-segmented-control>
2653
2698
  <fig-segment selected>
2654
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2655
- <path d="M8.5 5.59686C8.80936 5.41829 9.19064 5.41829 9.5 5.59686L15 8.77264C15.6185 9.12984 15.9998 9.78984 16 10.5041V16.8557C15.9999 17.2128 15.8093 17.5433 15.5 17.7219C15.1907 17.9003 14.8093 17.9003 14.5 17.7219L14.2988 17.6057L14.1025 17.4924L13.9111 17.381L13.7236 17.2736L13.541 17.1672L13.3613 17.0637L13.1846 16.9621L13.0117 16.8625L12.8418 16.7639L12.6738 16.6672L12.5078 16.5715L12.3438 16.4767L12.1816 16.383L12.0205 16.2902L11.8613 16.1974L11.7012 16.1057L11.543 16.0139L11.0654 15.7385L10.9053 15.6457L10.7432 15.5519L10.5801 15.4582L10.416 15.3635L10.249 15.2668L10.0801 15.1691L9.9082 15.0705L9.73438 14.9699L9.55664 14.8674L9.375 14.7619L9.18945 14.6555L9.00098 14.5461C8.38287 14.1892 8.00002 13.5289 8 12.8137V6.46307C8 6.10581 8.1906 5.7755 8.5 5.59686ZM9 12.8137C9.00001 13.1709 9.1916 13.5012 9.50098 13.6799C11.542 14.8584 12.8291 15.6022 15 16.8557V10.5051C15 10.1925 14.8541 9.89983 14.6104 9.7121L14.5 9.63885L9 6.46307V12.8137Z" fill="black" fill-opacity="0.9"/>
2699
+ <svg width="24"
2700
+ height="24"
2701
+ viewBox="0 0 24 24"
2702
+ fill="none"
2703
+ xmlns="http://www.w3.org/2000/svg">
2704
+ <path d="M8.5 5.59686C8.80936 5.41829 9.19064 5.41829 9.5 5.59686L15 8.77264C15.6185 9.12984 15.9998 9.78984 16 10.5041V16.8557C15.9999 17.2128 15.8093 17.5433 15.5 17.7219C15.1907 17.9003 14.8093 17.9003 14.5 17.7219L14.2988 17.6057L14.1025 17.4924L13.9111 17.381L13.7236 17.2736L13.541 17.1672L13.3613 17.0637L13.1846 16.9621L13.0117 16.8625L12.8418 16.7639L12.6738 16.6672L12.5078 16.5715L12.3438 16.4767L12.1816 16.383L12.0205 16.2902L11.8613 16.1974L11.7012 16.1057L11.543 16.0139L11.0654 15.7385L10.9053 15.6457L10.7432 15.5519L10.5801 15.4582L10.416 15.3635L10.249 15.2668L10.0801 15.1691L9.9082 15.0705L9.73438 14.9699L9.55664 14.8674L9.375 14.7619L9.18945 14.6555L9.00098 14.5461C8.38287 14.1892 8.00002 13.5289 8 12.8137V6.46307C8 6.10581 8.1906 5.7755 8.5 5.59686ZM9 12.8137C9.00001 13.1709 9.1916 13.5012 9.50098 13.6799C11.542 14.8584 12.8291 15.6022 15 16.8557V10.5051C15 10.1925 14.8541 9.89983 14.6104 9.7121L14.5 9.63885L9 6.46307V12.8137Z"
2705
+ fill="black"
2706
+ fill-opacity="0.9" />
2656
2707
  </svg>
2657
2708
  </fig-segment>
2658
2709
  <fig-segment>
2659
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2660
- <path d="M14.4998 5.5968C14.8091 5.41823 15.1904 5.41823 15.4998 5.5968C15.8092 5.77543 15.9998 6.10575 15.9998 6.46301V12.8136C15.9997 13.5281 15.6185 14.1888 14.9998 14.546L9.49976 17.7218C9.19046 17.9003 8.80905 17.9003 8.49976 17.7218C8.19043 17.5432 7.99986 17.2127 7.99976 16.8556V10.504C7.99995 9.78978 8.38122 9.12978 8.99976 8.77258L14.4998 5.5968ZM9.49976 9.63879L9.3894 9.71204C9.14564 9.89977 8.99977 10.1924 8.99976 10.505V16.8556L14.4998 13.6798C14.7704 13.5235 14.9502 13.2513 14.991 12.9464L14.9998 12.8136V6.46301L9.49976 9.63879Z" fill="black" fill-opacity="0.9"/>
2710
+ <svg width="24"
2711
+ height="24"
2712
+ viewBox="0 0 24 24"
2713
+ fill="none"
2714
+ xmlns="http://www.w3.org/2000/svg">
2715
+ <path d="M14.4998 5.5968C14.8091 5.41823 15.1904 5.41823 15.4998 5.5968C15.8092 5.77543 15.9998 6.10575 15.9998 6.46301V12.8136C15.9997 13.5281 15.6185 14.1888 14.9998 14.546L9.49976 17.7218C9.19046 17.9003 8.80905 17.9003 8.49976 17.7218C8.19043 17.5432 7.99986 17.2127 7.99976 16.8556V10.504C7.99995 9.78978 8.38122 9.12978 8.99976 8.77258L14.4998 5.5968ZM9.49976 9.63879L9.3894 9.71204C9.14564 9.89977 8.99977 10.1924 8.99976 10.505V16.8556L14.4998 13.6798C14.7704 13.5235 14.9502 13.2513 14.991 12.9464L14.9998 12.8136V6.46301L9.49976 9.63879Z"
2716
+ fill="black"
2717
+ fill-opacity="0.9" />
2661
2718
  </svg>
2662
2719
  </fig-segment>
2663
2720
  </fig-segmented-control>
@@ -2670,6 +2727,39 @@
2670
2727
  <fig-segment>L</fig-segment>
2671
2728
  <fig-segment>XL</fig-segment>
2672
2729
  </fig-segmented-control>
2730
+
2731
+ <h3>Disabled (Text)</h3>
2732
+ <fig-segmented-control disabled>
2733
+ <fig-segment>List</fig-segment>
2734
+ <fig-segment selected>Grid</fig-segment>
2735
+ <fig-segment>Board</fig-segment>
2736
+ </fig-segmented-control>
2737
+
2738
+ <h3>Disabled (Icons)</h3>
2739
+ <fig-segmented-control disabled>
2740
+ <fig-segment selected>
2741
+ <svg width="24"
2742
+ height="24"
2743
+ viewBox="0 0 24 24"
2744
+ fill="none"
2745
+ xmlns="http://www.w3.org/2000/svg">
2746
+ <path d="M8.5 5.59686C8.80936 5.41829 9.19064 5.41829 9.5 5.59686L15 8.77264C15.6185 9.12984 15.9998 9.78984 16 10.5041V16.8557C15.9999 17.2128 15.8093 17.5433 15.5 17.7219C15.1907 17.9003 14.8093 17.9003 14.5 17.7219L14.2988 17.6057L14.1025 17.4924L13.9111 17.381L13.7236 17.2736L13.541 17.1672L13.3613 17.0637L13.1846 16.9621L13.0117 16.8625L12.8418 16.7639L12.6738 16.6672L12.5078 16.5715L12.3438 16.4767L12.1816 16.383L12.0205 16.2902L11.8613 16.1974L11.7012 16.1057L11.543 16.0139L11.0654 15.7385L10.9053 15.6457L10.7432 15.5519L10.5801 15.4582L10.416 15.3635L10.249 15.2668L10.0801 15.1691L9.9082 15.0705L9.73438 14.9699L9.55664 14.8674L9.375 14.7619L9.18945 14.6555L9.00098 14.5461C8.38287 14.1892 8.00002 13.5289 8 12.8137V6.46307C8 6.10581 8.1906 5.7755 8.5 5.59686ZM9 12.8137C9.00001 13.1709 9.1916 13.5012 9.50098 13.6799C11.542 14.8584 12.8291 15.6022 15 16.8557V10.5051C15 10.1925 14.8541 9.89983 14.6104 9.7121L14.5 9.63885L9 6.46307V12.8137Z"
2747
+ fill="black"
2748
+ fill-opacity="0.9" />
2749
+ </svg>
2750
+ </fig-segment>
2751
+ <fig-segment>
2752
+ <svg width="24"
2753
+ height="24"
2754
+ viewBox="0 0 24 24"
2755
+ fill="none"
2756
+ xmlns="http://www.w3.org/2000/svg">
2757
+ <path d="M14.4998 5.5968C14.8091 5.41823 15.1904 5.41823 15.4998 5.5968C15.8092 5.77543 15.9998 6.10575 15.9998 6.46301V12.8136C15.9997 13.5281 15.6185 14.1888 14.9998 14.546L9.49976 17.7218C9.19046 17.9003 8.80905 17.9003 8.49976 17.7218C8.19043 17.5432 7.99986 17.2127 7.99976 16.8556V10.504C7.99995 9.78978 8.38122 9.12978 8.99976 8.77258L14.4998 5.5968ZM9.49976 9.63879L9.3894 9.71204C9.14564 9.89977 8.99977 10.1924 8.99976 10.505V16.8556L14.4998 13.6798C14.7704 13.5235 14.9502 13.2513 14.991 12.9464L14.9998 12.8136V6.46301L9.49976 9.63879Z"
2758
+ fill="black"
2759
+ fill-opacity="0.9" />
2760
+ </svg>
2761
+ </fig-segment>
2762
+ </fig-segmented-control>
2673
2763
  </section>
2674
2764
  <hr>
2675
2765
 
@@ -2729,7 +2819,8 @@
2729
2819
  units="%"></fig-slider>
2730
2820
 
2731
2821
  <h3>With Precision</h3>
2732
- <p class="description">Control decimal places in the text input with the <code>precision</code> attribute.</p>
2822
+ <p class="description">Control decimal places in the text input with the <code>precision</code> attribute.
2823
+ </p>
2733
2824
  <fig-field direction="horizontal">
2734
2825
  <label>Precision 0</label>
2735
2826
  <fig-slider min="0"
@@ -3649,6 +3740,36 @@ button.addEventListener('click', () => {
3649
3740
  </vstack>
3650
3741
  </details>
3651
3742
  </section>
3743
+ <fig-footer sticky="true">
3744
+ <fig-button icon="true"
3745
+ type="select"
3746
+ variant="ghost"
3747
+ title="Fill settings">
3748
+ <svg width="16"
3749
+ height="16"
3750
+ viewBox="0 0 16 16"
3751
+ fill="none"
3752
+ xmlns="http://www.w3.org/2000/svg">
3753
+ <path d="M8 3.5A4.5 4.5 0 1 0 8 12.5A4.5 4.5 0 1 0 8 3.5Z"
3754
+ stroke="currentColor"
3755
+ stroke-opacity="0.9" />
3756
+ <path d="M8 1V2.25M8 13.75V15M15 8H13.75M2.25 8H1M12.95 3.05L12.06 3.94M3.94 12.06L3.05 12.95M12.95 12.95L12.06 12.06M3.94 3.94L3.05 3.05"
3757
+ stroke="currentColor"
3758
+ stroke-opacity="0.9"
3759
+ stroke-linecap="round" />
3760
+ </svg>
3761
+ <fig-dropdown experimental="modern"
3762
+ type="dropdown">
3763
+ <option value="existing-strokes">
3764
+ <fig-checkbox checked
3765
+ label="Apply to existing strokes"></fig-checkbox>
3766
+ </option>
3767
+ <option value="shapes-with-fills">
3768
+ <fig-checkbox label="Apply to shapes with fills"></fig-checkbox>
3769
+ </option>
3770
+ </fig-dropdown>
3771
+ </fig-button>
3772
+ </fig-footer>
3652
3773
  </main>
3653
3774
 
3654
3775
  <script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rogieking/figui3",
3
- "version": "2.15.0",
3
+ "version": "2.17.1",
4
4
  "description": "A lightweight web components library for building Figma plugin and widget UIs with native look and feel",
5
5
  "author": "Rogie King",
6
6
  "license": "MIT",