@rogieking/figui3 10.0.0 → 10.0.2

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.
@@ -641,7 +641,10 @@ toastRef.current?.showToast();
641
641
  />
642
642
  ```
643
643
 
644
- - Attrs: `src`, `label`, `sublabel`, `selected`, `disabled`, `full`, `size`, `aspect-ratio`, `fit`, `label-line-clamp`
644
+ - Attrs: `src`, `label`, `sublabel`, `selected`, `disabled`, `full`, `size`, `direction`, `aspect-ratio`, `fit`, `label-line-clamp`, `label-overflow`
645
+ - `direction="horizontal"` uses a 40px media preview on the left (`56px` with `size="large"`) and stacks label/sublabel content on the right.
646
+ - `label-overflow="fade"` adds `fig-overflow-fade fig-overflow-fade-horizontal` to both labels; the default is `ellipsis`.
647
+ - Thumbnail vars: `--fig-card-thumbnail-width` (`2.5rem`, or `3.5rem` when large), `--fig-card-thumbnail-height` (`auto`).
645
648
 
646
649
  ### `fig-media-controls`
647
650
 
package/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [10.0.2]
6
+
7
+ ### Added
8
+
9
+ - Added `direction="horizontal"` list layouts to `fig-card` with size-aware thumbnails and configurable thumbnail dimensions.
10
+ - Added `label-overflow="fade"` for horizontal label and sublabel fades.
11
+
12
+ ### Changed
13
+
14
+ - Horizontal cards use 40px thumbnails by default, 56px thumbnails when large, and extra trailing padding at the default size.
15
+
16
+ ## [10.0.1]
17
+
18
+ ### Changed
19
+
20
+ - Refined the hue slider handle with an inset thumb-color ring and layered shadow.
21
+
5
22
  ## [10.0.0]
6
23
 
7
24
  ### Added
package/README.md CHANGED
@@ -1623,12 +1623,18 @@ A media card with a truncated label and attribute-only selection chrome. With `s
1623
1623
  | `disabled` | boolean | `false` | Dim + non-interactive |
1624
1624
  | `full` | boolean | `false` | Stretch to the available width (cards are already `width: 100%` by default) |
1625
1625
  | `size` | string | default | Set to `"large"` for `--spacer-2` card padding and `--spacer-1` label spacing |
1626
+ | `direction` | string | `"vertical"` | Set to `"horizontal"` for a list layout with 40px media on the left (56px with `size="large"`) and stacked labels on the right |
1626
1627
  | `aspect-ratio` | string | `"1/1"` | Forwarded to generated `fig-image` |
1627
1628
  | `fit` | string | `"contain"` | Forwarded to generated `fig-image` |
1628
1629
  | `label-line-clamp` | string | `"1"` | `"1"` or `"2"` line clamp for the label |
1630
+ | `label-overflow` | string | `"ellipsis"` | Set to `"fade"` to apply horizontal overflow fades to the label and sublabel |
1631
+
1632
+ Horizontal thumbnail sizing uses `--fig-card-thumbnail-width` (`2.5rem` by default, `3.5rem` with `size="large"`) and `--fig-card-thumbnail-height` (`auto` by default). Leaving height at `auto` preserves the media `aspect-ratio`.
1629
1633
 
1630
1634
  ```html
1631
1635
  <fig-card src="photo.jpg" label="Autumn field"></fig-card>
1636
+ <fig-card src="photo.jpg" label="Autumn field" sublabel="Landscape photography" direction="horizontal"></fig-card>
1637
+ <fig-card src="photo.jpg" label="A long card label" sublabel="A long card sublabel" direction="horizontal" label-overflow="fade"></fig-card>
1632
1638
  <fig-card src="photo.jpg" label="Large card" size="large"></fig-card>
1633
1639
  <fig-card src="photo.jpg" label="Shader pill" sublabel="Generative tools/effects" selected></fig-card>
1634
1640
  <fig-card src="photo.jpg" label="Wide card" aspect-ratio="16/9" full></fig-card>
@@ -1641,6 +1647,8 @@ A media card with a truncated label and attribute-only selection chrome. With `s
1641
1647
  </fig-card>
1642
1648
  ```
1643
1649
 
1650
+ `label-overflow="fade"` adds both `fig-overflow-fade` and `fig-overflow-fade-horizontal` to generated or authored `.fig-card-label` and `.fig-card-sublabel` elements. Any other value uses the default ellipsis behavior.
1651
+
1644
1652
  When `src` is omitted, authored direct children such as `fig-image`, `fig-media`, or `fig-preview` remain direct children of the card. An authored `fig-footer` is preserved; when no `label`, `text`, or `sublabel` attributes are present, the card does not generate another footer.
1645
1653
 
1646
1654
  Place cards in a CSS grid for multi-column layouts — there is no built-in columns attribute. Prefer `full` in fluid layouts for consistency with other FigUI controls.
package/components.css CHANGED
@@ -3346,6 +3346,13 @@ fig-slider {
3346
3346
  --slider-checkerboard: var(--checkerboard-slider);
3347
3347
  --slider-track-color: var(--figma-color-bg-tertiary);
3348
3348
 
3349
+ &[type="hue"]{
3350
+ --slider-handle-shadow:
3351
+ inset 0 0 0 3px var(--slider-thumb-color),
3352
+ 0 0 0 0.75px rgba(0, 0, 0, 0.075), inset 0 0 0 5px rgba(0, 0, 0, 0.1),
3353
+ var(--figma-elevation-100);
3354
+ }
3355
+
3349
3356
  background-color: var(--figma-color-bg-secondary);
3350
3357
  border-radius: var(--radius-medium);
3351
3358
  padding-left: var(--spacer-2);
@@ -6288,6 +6295,8 @@ fig-card {
6288
6295
  --fig-card-label-line-clamp: 1;
6289
6296
  --fig-card-media-radius: var(--radius-medium);
6290
6297
  --fig-card-padding: var(--spacer-1);
6298
+ --fig-card-thumbnail-width: 2.5rem;
6299
+ --fig-card-thumbnail-height: auto;
6291
6300
  display: flex;
6292
6301
  flex-direction: column;
6293
6302
  gap: var(--spacer-1);
@@ -6303,6 +6312,7 @@ fig-card {
6303
6312
 
6304
6313
  &[size="large"] {
6305
6314
  --fig-card-padding: var(--spacer-2);
6315
+ --fig-card-thumbnail-width: 3.5rem;
6306
6316
 
6307
6317
  > fig-footer {
6308
6318
  margin-top: var(--spacer-1);
@@ -6314,6 +6324,40 @@ fig-card {
6314
6324
  }
6315
6325
  }
6316
6326
 
6327
+ &[direction="horizontal"] {
6328
+ flex-direction: row;
6329
+ align-items: center;
6330
+ gap: var(--spacer-2);
6331
+
6332
+ > :is(fig-image, fig-media, fig-preview) {
6333
+ flex: 0 0 var(--fig-card-thumbnail-width);
6334
+ width: var(--fig-card-thumbnail-width);
6335
+ max-width: var(--fig-card-thumbnail-width);
6336
+ height: var(--fig-card-thumbnail-height);
6337
+ }
6338
+
6339
+ > :is(fig-image, fig-media) > fig-preview,
6340
+ > fig-preview {
6341
+ height: var(--fig-card-thumbnail-height);
6342
+ }
6343
+
6344
+ > fig-footer {
6345
+ flex: 1 1 0;
6346
+ width: auto;
6347
+ margin-top: 0;
6348
+ }
6349
+
6350
+ .fig-card-label,
6351
+ .fig-card-sublabel {
6352
+ padding-inline: 0;
6353
+ }
6354
+ }
6355
+
6356
+ &[direction="horizontal"]:not([size]),
6357
+ &[direction="horizontal"][size=""] {
6358
+ padding-right: var(--spacer-2);
6359
+ }
6360
+
6317
6361
  > fig-image,
6318
6362
  > fig-media,
6319
6363
  > fig-preview {
@@ -6394,6 +6438,17 @@ fig-card {
6394
6438
  display: none;
6395
6439
  }
6396
6440
 
6441
+ :is(.fig-card-label, .fig-card-sublabel).fig-overflow-fade-horizontal {
6442
+ display: block;
6443
+ -webkit-line-clamp: unset;
6444
+ line-clamp: unset;
6445
+ white-space: nowrap;
6446
+ overflow-x: auto;
6447
+ overflow-y: hidden;
6448
+ text-overflow: clip;
6449
+ word-break: normal;
6450
+ }
6451
+
6397
6452
  &:hover:not(
6398
6453
  [selected]:not([selected="false"])
6399
6454
  ):not([disabled]:not([disabled="false"])):not([aria-disabled="true"]) {