@rogieking/figui3 6.31.1 → 6.32.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
@@ -1308,6 +1308,7 @@ A thin styled layer for arbitrary visual content. Use it for generated previews,
1308
1308
 
1309
1309
  | Attribute | Type | Default | Description |
1310
1310
  |---|---|---|---|
1311
+ | `aspect-ratio` | string | `auto` | CSS aspect ratio such as `"1/1"` or `"16/9"` |
1311
1312
  | `fit` | string | `contain` | Object fit for direct media children |
1312
1313
  | `full` | boolean | `false` | Stretch to the available width |
1313
1314
  | `checkerboard` | boolean | `false` | Show checkerboard behind transparent content |
@@ -1404,7 +1405,7 @@ Use `slot="overlay"` for custom overlay controls. Slotted overlays stay as direc
1404
1405
 
1405
1406
  `<fig-card>` — [demo](https://rog.ie/figui3/#card)
1406
1407
 
1407
- A media card with a truncated label, optional link, and attribute-only selection chrome. With `src`, it composes a generated `fig-image`. Without `src`, authored children stay in place and only generated label content is added.
1408
+ A media card with a truncated label, optional link, and attribute-only selection chrome. With `src`, it composes a generated `fig-image`. The `label` and `sublabel` attributes render inside a generated `fig-footer`.
1408
1409
 
1409
1410
  | Attribute | Type | Default | Description |
1410
1411
  |---|---|---|---|
@@ -1432,9 +1433,13 @@ A media card with a truncated label, optional link, and attribute-only selection
1432
1433
  <fig-card label="Custom preview">
1433
1434
  <fig-preview>...</fig-preview>
1434
1435
  </fig-card>
1436
+ <fig-card>
1437
+ <fig-preview>...</fig-preview>
1438
+ <fig-footer><label>Authored footer</label></fig-footer>
1439
+ </fig-card>
1435
1440
  ```
1436
1441
 
1437
- When `src` is omitted, authored direct children such as `fig-image`, `fig-media`, or `fig-preview` remain direct children of the card.
1442
+ 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.
1438
1443
 
1439
1444
  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.
1440
1445
 
package/components.css CHANGED
@@ -3175,8 +3175,10 @@ fig-tooltip {
3175
3175
  fig-preview {
3176
3176
  --fig-preview-fit: contain;
3177
3177
  --fig-preview-background: var(--figma-color-bg-secondary);
3178
+ --fig-preview-aspect-ratio: auto;
3178
3179
 
3179
3180
  display: block;
3181
+ aspect-ratio: var(--fig-preview-aspect-ratio);
3180
3182
  place-items: center;
3181
3183
  min-width: 0;
3182
3184
  max-width: 100%;
@@ -5028,7 +5030,8 @@ fig-card {
5028
5030
  &[size="large"] {
5029
5031
  --fig-card-padding: var(--spacer-2);
5030
5032
 
5031
- .fig-card-text {
5033
+ > fig-footer,
5034
+ .fig-card-link > fig-footer {
5032
5035
  margin-top: var(--spacer-1);
5033
5036
  }
5034
5037
 
@@ -5088,14 +5091,23 @@ fig-card {
5088
5091
  min-height: auto;
5089
5092
  }
5090
5093
 
5091
- .fig-card-text {
5094
+ > fig-footer,
5095
+ .fig-card-link > fig-footer {
5092
5096
  display: flex;
5093
5097
  flex-direction: column;
5098
+ flex-wrap: nowrap;
5099
+ align-items: stretch;
5100
+ justify-content: flex-start;
5094
5101
  gap: 0;
5102
+ width: auto;
5103
+ padding: 0;
5104
+ box-shadow: none;
5105
+ box-sizing: border-box;
5095
5106
  min-width: 0;
5096
5107
  }
5097
5108
 
5098
- .fig-card-text[hidden] {
5109
+ > fig-footer[hidden],
5110
+ .fig-card-link > fig-footer[hidden] {
5099
5111
  display: none;
5100
5112
  }
5101
5113
 
@@ -5104,7 +5116,10 @@ fig-card {
5104
5116
  line-height: var(--line-height);
5105
5117
  color: var(--figma-color-text);
5106
5118
  min-width: 0;
5119
+ min-height: 0;
5107
5120
  padding-inline: var(--spacer-1);
5121
+ justify-content: flex-start;
5122
+ text-align: start;
5108
5123
  display: -webkit-box;
5109
5124
  -webkit-box-orient: vertical;
5110
5125
  -webkit-line-clamp: var(--fig-card-label-line-clamp);
@@ -5122,6 +5137,9 @@ fig-card {
5122
5137
  color: var(--figma-color-text-secondary);
5123
5138
  padding-inline: var(--spacer-1);
5124
5139
  min-width: 0;
5140
+ min-height: 0;
5141
+ justify-content: flex-start;
5142
+ text-align: start;
5125
5143
  white-space: nowrap;
5126
5144
  overflow: hidden;
5127
5145
  text-overflow: ellipsis;