@rogieking/figui3 6.19.1 → 6.20.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/README.md +34 -0
- package/components.css +138 -10
- package/dist/components.css +1 -1
- package/dist/fig-editor.css +1 -1
- package/dist/fig-lab.css +1 -1
- package/dist/fig.css +1 -1
- package/dist/fig.js +26 -26
- package/fig-lab.css +91 -50
- package/fig.js +273 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -125,6 +125,7 @@ Minimal example:
|
|
|
125
125
|
| [Preview](#preview) | `<fig-preview>` | Thin visual preview layer |
|
|
126
126
|
| [Media](#media) | `<fig-media>` | Shared media host for image/video |
|
|
127
127
|
| [Image](#image) | `<fig-image>` | Image display/upload |
|
|
128
|
+
| [Card](#card) | `<fig-card>` | Media card with label, link, and selection chrome |
|
|
128
129
|
| [Video](#video) | `<fig-video>` | Video display/upload with playback controls |
|
|
129
130
|
| [Avatar](#avatar) | `<fig-avatar>` | Profile image or initials |
|
|
130
131
|
| [Icon](#icon) | `<fig-icon>` | Masked icon from design tokens |
|
|
@@ -1324,6 +1325,39 @@ Use `slot="overlay"` for custom overlay controls. Slotted overlays stay as direc
|
|
|
1324
1325
|
|
|
1325
1326
|
---
|
|
1326
1327
|
|
|
1328
|
+
#### Card
|
|
1329
|
+
|
|
1330
|
+
`<fig-card>` — [demo](https://rog.ie/figui3/#card)
|
|
1331
|
+
|
|
1332
|
+
A media card with a truncated label, optional link, and attribute-only selection chrome. Composes a generated `fig-image` (or an authored `fig-image` / `fig-media` / `fig-preview` child).
|
|
1333
|
+
|
|
1334
|
+
| Attribute | Type | Default | Description |
|
|
1335
|
+
|---|---|---|---|
|
|
1336
|
+
| `src` | string | — | Image URL forwarded to generated `fig-image` |
|
|
1337
|
+
| `alt` | string | `""` | Alt text forwarded to generated `fig-image` |
|
|
1338
|
+
| `label` | string | — | Card title (preferred over `text`) |
|
|
1339
|
+
| `text` | string | — | Alias for `label` |
|
|
1340
|
+
| `sublabel` | string | — | Secondary one-line text under the label |
|
|
1341
|
+
| `href` | string | — | When set, wraps content in a real `<a>` |
|
|
1342
|
+
| `target` | string | — | Forwarded to the `<a>` (`_blank` adds `rel="noopener noreferrer"`) |
|
|
1343
|
+
| `selected` | boolean | `false` | Selected chrome only (no click-toggle) |
|
|
1344
|
+
| `disabled` | boolean | `false` | Dim + non-interactive; no `<a>` when disabled |
|
|
1345
|
+
| `full` | boolean | `false` | Stretch to the available width (cards are already `width: 100%` by default) |
|
|
1346
|
+
| `aspect-ratio` | string | `"1/1"` | Forwarded to generated `fig-image` |
|
|
1347
|
+
| `fit` | string | `"contain"` | Forwarded to generated `fig-image` |
|
|
1348
|
+
| `label-line-clamp` | string | `"1"` | `"1"` or `"2"` line clamp for the label |
|
|
1349
|
+
|
|
1350
|
+
```html
|
|
1351
|
+
<fig-card src="photo.jpg" label="Autumn field"></fig-card>
|
|
1352
|
+
<fig-card src="photo.jpg" label="Shader pill" sublabel="Generative tools/effects" selected></fig-card>
|
|
1353
|
+
<fig-card src="photo.jpg" label="Open asset" href="#asset"></fig-card>
|
|
1354
|
+
<fig-card src="photo.jpg" label="Wide card" aspect-ratio="16/9" full></fig-card>
|
|
1355
|
+
```
|
|
1356
|
+
|
|
1357
|
+
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.
|
|
1358
|
+
|
|
1359
|
+
---
|
|
1360
|
+
|
|
1327
1361
|
#### Video
|
|
1328
1362
|
|
|
1329
1363
|
`<fig-video>`
|
package/components.css
CHANGED
|
@@ -2791,6 +2791,12 @@ fig-slider {
|
|
|
2791
2791
|
min-width: 0;
|
|
2792
2792
|
height: var(--slider-field-height);
|
|
2793
2793
|
transition: var(--slider-transition);
|
|
2794
|
+
outline: none;
|
|
2795
|
+
|
|
2796
|
+
&:has(input[type="range"]:focus-visible) {
|
|
2797
|
+
outline: var(--figma-focus-outline);
|
|
2798
|
+
outline-offset: var(--figma-focus-outline-offset);
|
|
2799
|
+
}
|
|
2794
2800
|
|
|
2795
2801
|
& .slider {
|
|
2796
2802
|
flex: 1 1 0;
|
|
@@ -2896,16 +2902,7 @@ fig-slider {
|
|
|
2896
2902
|
}
|
|
2897
2903
|
|
|
2898
2904
|
&:focus-visible {
|
|
2899
|
-
|
|
2900
|
-
--figma-focus-outline-offset: 1px;
|
|
2901
|
-
outline: var(--figma-focus-outline);
|
|
2902
|
-
outline-offset: var(--figma-focus-outline-offset);
|
|
2903
|
-
}
|
|
2904
|
-
&::-moz-range-thumb {
|
|
2905
|
-
--figma-focus-outline-offset: 1px;
|
|
2906
|
-
outline: var(--figma-focus-outline);
|
|
2907
|
-
outline-offset: var(--figma-focus-outline-offset);
|
|
2908
|
-
}
|
|
2905
|
+
outline: none;
|
|
2909
2906
|
}
|
|
2910
2907
|
|
|
2911
2908
|
&:disabled {
|
|
@@ -5054,6 +5051,137 @@ fig-chooser {
|
|
|
5054
5051
|
}
|
|
5055
5052
|
}
|
|
5056
5053
|
|
|
5054
|
+
fig-card {
|
|
5055
|
+
--fig-card-label-line-clamp: 1;
|
|
5056
|
+
--fig-card-media-radius: var(--radius-medium);
|
|
5057
|
+
display: block;
|
|
5058
|
+
width: 100%;
|
|
5059
|
+
min-width: 0;
|
|
5060
|
+
|
|
5061
|
+
&[full]:not([full="false"]) {
|
|
5062
|
+
width: 100%;
|
|
5063
|
+
}
|
|
5064
|
+
|
|
5065
|
+
.fig-card-link {
|
|
5066
|
+
display: flex;
|
|
5067
|
+
flex-direction: column;
|
|
5068
|
+
gap: var(--spacer-1);
|
|
5069
|
+
padding: var(--spacer-1);
|
|
5070
|
+
border-radius: 0.5625rem;
|
|
5071
|
+
text-decoration: none;
|
|
5072
|
+
color: inherit;
|
|
5073
|
+
outline: none;
|
|
5074
|
+
box-sizing: border-box;
|
|
5075
|
+
width: 100%;
|
|
5076
|
+
min-width: 0;
|
|
5077
|
+
}
|
|
5078
|
+
|
|
5079
|
+
.fig-card-link:focus-visible {
|
|
5080
|
+
outline: var(--figma-focus-outline);
|
|
5081
|
+
outline-offset: var(--figma-focus-outline-offset);
|
|
5082
|
+
}
|
|
5083
|
+
|
|
5084
|
+
.fig-card-media {
|
|
5085
|
+
position: relative;
|
|
5086
|
+
border-radius: var(--fig-card-media-radius);
|
|
5087
|
+
background: var(--figma-color-bg-secondary);
|
|
5088
|
+
overflow: hidden;
|
|
5089
|
+
min-width: 0;
|
|
5090
|
+
}
|
|
5091
|
+
|
|
5092
|
+
.fig-card-media > fig-image,
|
|
5093
|
+
.fig-card-media > fig-media,
|
|
5094
|
+
.fig-card-media > fig-preview {
|
|
5095
|
+
display: block;
|
|
5096
|
+
width: 100%;
|
|
5097
|
+
max-width: none;
|
|
5098
|
+
gap: 0;
|
|
5099
|
+
border-radius: var(--fig-card-media-radius);
|
|
5100
|
+
}
|
|
5101
|
+
|
|
5102
|
+
.fig-card-media > fig-image > fig-preview,
|
|
5103
|
+
.fig-card-media > fig-media > fig-preview,
|
|
5104
|
+
.fig-card-media > fig-preview {
|
|
5105
|
+
width: 100%;
|
|
5106
|
+
max-width: none;
|
|
5107
|
+
border-radius: var(--fig-card-media-radius);
|
|
5108
|
+
min-height: auto;
|
|
5109
|
+
}
|
|
5110
|
+
|
|
5111
|
+
.fig-card-text {
|
|
5112
|
+
display: flex;
|
|
5113
|
+
flex-direction: column;
|
|
5114
|
+
gap: 0;
|
|
5115
|
+
min-width: 0;
|
|
5116
|
+
}
|
|
5117
|
+
|
|
5118
|
+
.fig-card-text[hidden] {
|
|
5119
|
+
display: none;
|
|
5120
|
+
}
|
|
5121
|
+
|
|
5122
|
+
.fig-card-label {
|
|
5123
|
+
font-size: var(--font-size-small);
|
|
5124
|
+
line-height: var(--line-height);
|
|
5125
|
+
color: var(--figma-color-text);
|
|
5126
|
+
min-width: 0;
|
|
5127
|
+
padding-inline: var(--spacer-1);
|
|
5128
|
+
display: -webkit-box;
|
|
5129
|
+
-webkit-box-orient: vertical;
|
|
5130
|
+
-webkit-line-clamp: var(--fig-card-label-line-clamp);
|
|
5131
|
+
overflow: hidden;
|
|
5132
|
+
word-break: break-word;
|
|
5133
|
+
}
|
|
5134
|
+
|
|
5135
|
+
.fig-card-label[hidden] {
|
|
5136
|
+
display: none;
|
|
5137
|
+
}
|
|
5138
|
+
|
|
5139
|
+
.fig-card-sublabel {
|
|
5140
|
+
font-size: var(--font-size-small);
|
|
5141
|
+
line-height: var(--line-height);
|
|
5142
|
+
color: var(--figma-color-text-secondary);
|
|
5143
|
+
padding-inline: var(--spacer-1);
|
|
5144
|
+
min-width: 0;
|
|
5145
|
+
white-space: nowrap;
|
|
5146
|
+
overflow: hidden;
|
|
5147
|
+
text-overflow: ellipsis;
|
|
5148
|
+
}
|
|
5149
|
+
|
|
5150
|
+
.fig-card-sublabel[hidden] {
|
|
5151
|
+
display: none;
|
|
5152
|
+
}
|
|
5153
|
+
|
|
5154
|
+
&:hover:not([selected]:not([selected="false"])):not(
|
|
5155
|
+
[disabled]:not([disabled="false"])
|
|
5156
|
+
):not([aria-disabled="true"])
|
|
5157
|
+
.fig-card-link {
|
|
5158
|
+
background: var(--figma-color-bg-secondary);
|
|
5159
|
+
}
|
|
5160
|
+
|
|
5161
|
+
&[selected]:not([selected="false"]) .fig-card-link {
|
|
5162
|
+
background: var(--figma-color-bg-selected);
|
|
5163
|
+
}
|
|
5164
|
+
|
|
5165
|
+
&[selected]:not([selected="false"]) .fig-card-media {
|
|
5166
|
+
outline: var(--figma-focus-outline);
|
|
5167
|
+
outline-offset: var(--figma-focus-outline-offset);
|
|
5168
|
+
}
|
|
5169
|
+
|
|
5170
|
+
&[selected]:not([selected="false"])
|
|
5171
|
+
.fig-card-media
|
|
5172
|
+
> :is(fig-image, fig-media)
|
|
5173
|
+
> fig-preview::after,
|
|
5174
|
+
&[selected]:not([selected="false"]) .fig-card-media > fig-preview::after {
|
|
5175
|
+
box-shadow: inset 0 0 0 1px var(--figma-color-border-selected);
|
|
5176
|
+
}
|
|
5177
|
+
|
|
5178
|
+
&[disabled]:not([disabled="false"]),
|
|
5179
|
+
&[aria-disabled="true"] {
|
|
5180
|
+
pointer-events: none;
|
|
5181
|
+
opacity: 0.4;
|
|
5182
|
+
}
|
|
5183
|
+
}
|
|
5184
|
+
|
|
5057
5185
|
fig-choice {
|
|
5058
5186
|
--fig-choice-selection-ring-width: 1px;
|
|
5059
5187
|
--fig-choice-padding: 0px;
|