@rogieking/figui3 2.18.3 → 2.19.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.
package/components.css CHANGED
@@ -306,9 +306,10 @@
306
306
  --icon-swap: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.35355 6.35355C8.54882 6.15829 8.54882 5.84171 8.35355 5.64645C8.15829 5.45118 7.84171 5.45118 7.64645 5.64645L5.14645 8.14645C4.95118 8.34171 4.95118 8.65829 5.14645 8.85355L7.64645 11.3536C7.84171 11.5488 8.15829 11.5488 8.35355 11.3536C8.54882 11.1583 8.54882 10.8417 8.35355 10.6464L6.70711 9H18.5C18.7761 9 19 8.77614 19 8.5C19 8.22386 18.7761 8 18.5 8H6.70711L8.35355 6.35355ZM15.6464 13.3536C15.4512 13.1583 15.4512 12.8417 15.6464 12.6464C15.8417 12.4512 16.1583 12.4512 16.3536 12.6464L18.8536 15.1464C19.0488 15.3417 19.0488 15.6583 18.8536 15.8536L16.3536 18.3536C16.1583 18.5488 15.8417 18.5488 15.6464 18.3536C15.4512 18.1583 15.4512 17.8417 15.6464 17.6464L17.2929 16H5.5C5.22386 16 5 15.7761 5 15.5C5 15.2239 5.22386 15 5.5 15H17.2929L15.6464 13.3536Z' fill='currentColor'/%3E%3C/svg%3E");
307
307
 
308
308
  /* Elevations - light theme defaults */
309
- --elevation-500-modal-window:
310
- 0px 0px 0.5px rgba(0, 0, 0, 0.08), 0px 10px 24px rgba(0, 0, 0, 0.18),
311
- 0px 2px 5px rgba(0, 0, 0, 0.15);
309
+ --figma-elevation-500-modal-window:
310
+ 0 0 0.5px 0 rgba(0, 0, 0, 0.08), 0 10px 24px 0 rgba(0, 0, 0, 0.18),
311
+ 0 2px 5px 0 rgba(0, 0, 0, 0.15);
312
+
312
313
  --figma-elevation-100:
313
314
  0px 0px 0.5px 0px rgba(0, 0, 0, 0.3), 0px 1px 3px 0px rgba(0, 0, 0, 0.15);
314
315
  --figma-elevation-200:
@@ -324,9 +325,10 @@
324
325
  }
325
326
 
326
327
  /* Dark theme overrides for non-color values (shadows, elevations) */
327
- /* These cannot use light-dark() as they are complex values */
328
+ /* light-dark() only works for colors, so these use class-based switching */
329
+ /* The @media block is a no-JS fallback — ignored when setTheme() sets classes */
328
330
  @media (prefers-color-scheme: dark) {
329
- :root {
331
+ :root:not(.figma-dark):not(.figma-light) {
330
332
  --handle-shadow:
331
333
  0px 0 0 0.75px rgba(0, 0, 0, 0.1),
332
334
  0px 0px 0.5px 0px rgba(255, 255, 255, 0.1);
@@ -349,7 +351,7 @@
349
351
  }
350
352
  }
351
353
 
352
- /* Class-based dark theme override (for manual theme switching) */
354
+ /* Class-based dark theme override (primary mechanism via setTheme()) */
353
355
  :root.figma-dark {
354
356
  --handle-shadow:
355
357
  0px 0 0 0.75px rgba(0, 0, 0, 0.1),
@@ -747,6 +749,19 @@ fig-button {
747
749
  background-color: var(--figma-color-bg-secondary);
748
750
  box-shadow: none;
749
751
  color: var(--figma-color-text);
752
+
753
+ &:hover {
754
+ box-shadow: inset 0 0 0 1px var(--figma-color-border);
755
+ background-color: var(--figma-color-bg-transparent);
756
+ }
757
+
758
+ &:active {
759
+ background-color: var(--figma-color-bg-secondary);
760
+ }
761
+
762
+ &:focus-visible {
763
+ background-color: var(--figma-color-bg-secondary);
764
+ }
750
765
  }
751
766
 
752
767
  /* Variant: Overlay (for on top of content) */
@@ -1431,13 +1446,14 @@ input[type="checkbox"]:not(.switch) {
1431
1446
  }
1432
1447
  }
1433
1448
  /* Light theme checkbox hover (black checkmark preview) */
1449
+ /* @media is a no-JS fallback — ignored when setTheme() sets classes */
1434
1450
  @media (prefers-color-scheme: light) {
1435
- input[type="checkbox"]:not(.switch):not(:disabled):hover {
1451
+ :root:not(.figma-dark):not(.figma-light) input[type="checkbox"]:not(.switch):not(:disabled):hover {
1436
1452
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.50012 7.5L7.50012 10.5L11.5001 4.5' stroke='black' opacity='0.25' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.125' /%3E%3C/svg%3E%0A");
1437
1453
  }
1438
1454
  }
1439
1455
 
1440
- /* Class-based light theme override (for manual theme switching) */
1456
+ /* Class-based light theme override (primary mechanism via setTheme()) */
1441
1457
  :root.figma-light input[type="checkbox"]:not(.switch):not(:disabled):hover {
1442
1458
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.50012 7.5L7.50012 10.5L11.5001 4.5' stroke='black' opacity='0.25' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.125' /%3E%3C/svg%3E%0A");
1443
1459
  }
package/index.html CHANGED
@@ -288,6 +288,17 @@
288
288
  <label>Link</label>
289
289
  <fig-button variant="link">Link Button</fig-button>
290
290
  </fig-field>
291
+ <fig-field direction="horizontal">
292
+ <label>Input</label>
293
+ <fig-button variant="input">Input Style</fig-button>
294
+ </fig-field>
295
+ <fig-field direction="horizontal">
296
+ <label>Input (with icon)</label>
297
+ <fig-button variant="input">
298
+ Options
299
+ <span class="fig-mask-icon" style="--icon: var(--icon-chevron); --size: 1rem"></span>
300
+ </fig-button>
301
+ </fig-field>
291
302
 
292
303
  <h3>Sizes</h3>
293
304
  <fig-field direction="horizontal">
@@ -323,6 +334,11 @@
323
334
  <fig-button variant="link"
324
335
  disabled>Disabled</fig-button>
325
336
  </fig-field>
337
+ <fig-field direction="horizontal">
338
+ <label>Disabled (input)</label>
339
+ <fig-button variant="input"
340
+ disabled>Disabled</fig-button>
341
+ </fig-field>
326
342
 
327
343
  <h3>Icon Buttons</h3>
328
344
  <fig-field direction="horizontal">
@@ -372,6 +388,13 @@
372
388
  </svg>
373
389
  </fig-button>
374
390
  </fig-field>
391
+ <fig-field direction="horizontal">
392
+ <label>Icon (input)</label>
393
+ <fig-button variant="input"
394
+ icon="true">
395
+ <span class="fig-mask-icon" style="--icon: var(--icon-chevron); --size: 1rem"></span>
396
+ </fig-button>
397
+ </fig-field>
375
398
  <fig-field direction="horizontal">
376
399
  <label>Icon (link)</label>
377
400
  <fig-button variant="link"
@@ -3751,6 +3774,11 @@
3751
3774
  style="--icon: var(--icon-steppers); --size: 1.5rem"></span>
3752
3775
  <code>--icon-steppers</code>
3753
3776
  </vstack>
3777
+ <vstack style="align-items: center; gap: 4px;">
3778
+ <span class="fig-mask-icon"
3779
+ style="--icon: var(--icon-chevron); --size: 1rem"></span>
3780
+ <code>--icon-chevron</code>
3781
+ </vstack>
3754
3782
  </hstack>
3755
3783
 
3756
3784
  <h3>Custom Size</h3>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rogieking/figui3",
3
- "version": "2.18.3",
3
+ "version": "2.19.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",