@rogieking/figui3 6.9.6 → 6.9.8
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 +16 -5
- package/base.css +5 -1
- package/components.css +18 -15
- package/dist/base.css +1 -1
- package/dist/components.css +1 -1
- package/dist/fig.css +1 -1
- package/dist/fig.js +12 -12
- package/fig.js +51 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1174,6 +1174,7 @@ Unified media component that supports image/video modes and shared sizing/upload
|
|
|
1174
1174
|
| `aspect-ratio` | string | — | CSS aspect-ratio (e.g. `"16 / 9"`); fills container width |
|
|
1175
1175
|
| `fit` | string | `"contain"` | CSS object-fit (`"cover"`, `"contain"`, etc.) |
|
|
1176
1176
|
| `checkerboard` | boolean | `false` | Show checkerboard behind transparent media |
|
|
1177
|
+
| `caption` | string | — | Caption text rendered below the media preview |
|
|
1177
1178
|
| `controls` | boolean | `false` | Show playback controls for video |
|
|
1178
1179
|
| `autoplay` | boolean | `false` | Video autoplay |
|
|
1179
1180
|
| `loop` | boolean | `false` | Video loop |
|
|
@@ -1186,9 +1187,14 @@ Use meaningful `alt` text for informative images. Use `alt=""` only when the ima
|
|
|
1186
1187
|
```html
|
|
1187
1188
|
<fig-media type="image" src="photo.jpg" alt="Selected image"></fig-media>
|
|
1188
1189
|
<fig-media type="image" src="photo.jpg" alt="Cover image" aspect-ratio="16 / 9" fit="cover"></fig-media>
|
|
1189
|
-
<fig-media type="video" src="clip.mp4" aria-label="Product demo video" controls muted></fig-media>
|
|
1190
|
+
<fig-media type="video" src="clip.mp4" aria-label="Product demo video" caption="Looping product demo" controls muted></fig-media>
|
|
1191
|
+
<fig-media type="image" src="photo.jpg" alt="Selected image">
|
|
1192
|
+
<figcaption>Selected image from the current document.</figcaption>
|
|
1193
|
+
</fig-media>
|
|
1190
1194
|
```
|
|
1191
1195
|
|
|
1196
|
+
Use the `caption` attribute for a plain-text caption, or a direct `<figcaption>` child for authored caption content.
|
|
1197
|
+
|
|
1192
1198
|
---
|
|
1193
1199
|
|
|
1194
1200
|
#### Image
|
|
@@ -1207,14 +1213,16 @@ An image display component with optional upload, aspect ratio, and object-fit co
|
|
|
1207
1213
|
| `aspect-ratio` | string | — | CSS aspect-ratio (e.g. `"16 / 9"`); fills container width |
|
|
1208
1214
|
| `fit` | string | `"contain"` | CSS object-fit (`"cover"`, `"contain"`, etc.) |
|
|
1209
1215
|
| `checkerboard` | boolean | `false` | Show checkerboard behind transparent images |
|
|
1216
|
+
| `caption` | string | — | Caption text rendered below the image preview |
|
|
1210
1217
|
|
|
1211
1218
|
Use meaningful `alt` text for informative images. Use `alt=""` for decorative previews, thumbnails with visible labels, or upload placeholders.
|
|
1212
1219
|
|
|
1213
1220
|
```html
|
|
1214
1221
|
<fig-image src="photo.jpg" alt="Selected image"></fig-image>
|
|
1215
|
-
<fig-image src="photo.jpg" alt="Cover image" aspect-ratio="16 / 9" fit="cover"></fig-image>
|
|
1222
|
+
<fig-image src="photo.jpg" alt="Cover image" aspect-ratio="16 / 9" fit="cover" caption="Cover image"></fig-image>
|
|
1216
1223
|
<fig-image upload label="Upload Image" alt=""></fig-image>
|
|
1217
1224
|
<fig-image src="photo.jpg" alt="Selected image">
|
|
1225
|
+
<figcaption>Selected image from the current document.</figcaption>
|
|
1218
1226
|
<fig-input-file slot="overlay" variant="overlay" label="Change image"></fig-input-file>
|
|
1219
1227
|
</fig-image>
|
|
1220
1228
|
```
|
|
@@ -1243,13 +1251,16 @@ Video display/upload component with the same preview styling model as `fig-image
|
|
|
1243
1251
|
| `muted` | boolean | `false` | Mute video |
|
|
1244
1252
|
| `poster` | string | — | Poster image URL (forwarded to inner `<video>`) |
|
|
1245
1253
|
| `aria-label` | string | — | Accessible label forwarded to the generated `<video>` |
|
|
1254
|
+
| `caption` | string | — | Caption text rendered below the video preview |
|
|
1246
1255
|
|
|
1247
|
-
Prefer `controls` for videos that play motion.
|
|
1256
|
+
Prefer `controls` for videos that play motion. Use native `<track>` text tracks when the video includes speech or essential audio.
|
|
1248
1257
|
|
|
1249
1258
|
```html
|
|
1250
|
-
<fig-video src="clip.mp4" aria-label="Product demo video" controls></fig-video>
|
|
1259
|
+
<fig-video src="clip.mp4" aria-label="Product demo video" caption="Product demo" controls></fig-video>
|
|
1251
1260
|
<fig-video src="clip.mp4" aria-label="Product demo video" aspect-ratio="16 / 9" controls></fig-video>
|
|
1252
|
-
<fig-video upload label="Upload Video" aria-label="Uploaded video preview" controls muted
|
|
1261
|
+
<fig-video upload label="Upload Video" aria-label="Uploaded video preview" controls muted>
|
|
1262
|
+
<figcaption>Uploaded video preview.</figcaption>
|
|
1263
|
+
</fig-video>
|
|
1253
1264
|
```
|
|
1254
1265
|
|
|
1255
1266
|
---
|
package/base.css
CHANGED
|
@@ -25,6 +25,7 @@ h1,
|
|
|
25
25
|
h2 {
|
|
26
26
|
font-weight: var(--body-large-strong-fontWeight);
|
|
27
27
|
font-size: var(--body-large-fontSize);
|
|
28
|
+
text-wrap: pretty;
|
|
28
29
|
}
|
|
29
30
|
h3 {
|
|
30
31
|
font-weight: var(--body-medium-strong-fontWeight);
|
|
@@ -118,6 +119,7 @@ iframe{
|
|
|
118
119
|
/* Defaults */
|
|
119
120
|
p {
|
|
120
121
|
margin-block: 1em;
|
|
122
|
+
text-wrap: pretty;
|
|
121
123
|
}
|
|
122
124
|
p:first-child {
|
|
123
125
|
margin-block-start: 0;
|
|
@@ -126,13 +128,15 @@ p:last-child {
|
|
|
126
128
|
margin-block-end: 0;
|
|
127
129
|
}
|
|
128
130
|
|
|
129
|
-
label, p, li {
|
|
131
|
+
label, p, li, figcaption {
|
|
130
132
|
color: var(--figma-color-text-secondary);
|
|
133
|
+
text-wrap: pretty;
|
|
131
134
|
}
|
|
132
135
|
|
|
133
136
|
h2 {
|
|
134
137
|
font-weight: var(--body-medium-strong-fontWeight);
|
|
135
138
|
margin: var(--spacer-2) 0;
|
|
139
|
+
text-wrap: pretty;
|
|
136
140
|
}
|
|
137
141
|
|
|
138
142
|
a{
|
package/components.css
CHANGED
|
@@ -1796,6 +1796,16 @@ fig-video {
|
|
|
1796
1796
|
width: 100%;
|
|
1797
1797
|
pointer-events: auto;
|
|
1798
1798
|
}
|
|
1799
|
+
|
|
1800
|
+
> figcaption {
|
|
1801
|
+
display: block;
|
|
1802
|
+
width: 100%;
|
|
1803
|
+
color: var(--figma-color-text-secondary);
|
|
1804
|
+
font-size: var(--font-size-small);
|
|
1805
|
+
line-height: var(--line-height);
|
|
1806
|
+
text-align: left;
|
|
1807
|
+
white-space: normal;
|
|
1808
|
+
}
|
|
1799
1809
|
}
|
|
1800
1810
|
|
|
1801
1811
|
fig-media-controls {
|
|
@@ -3487,7 +3497,7 @@ fig-footer {
|
|
|
3487
3497
|
display: flex;
|
|
3488
3498
|
flex-shrink: 0;
|
|
3489
3499
|
width: 100%;
|
|
3490
|
-
flex-wrap:
|
|
3500
|
+
flex-wrap: nowrap;
|
|
3491
3501
|
align-items: flex-start;
|
|
3492
3502
|
justify-content: flex-end;
|
|
3493
3503
|
gap: var(--spacer-2);
|
|
@@ -3509,6 +3519,7 @@ fig-footer {
|
|
|
3509
3519
|
min-height: var(--spacer-4);
|
|
3510
3520
|
display: flex;
|
|
3511
3521
|
align-items: center;
|
|
3522
|
+
text-wrap: pretty;
|
|
3512
3523
|
}
|
|
3513
3524
|
|
|
3514
3525
|
& > fig-button {
|
|
@@ -3521,25 +3532,17 @@ fig-footer {
|
|
|
3521
3532
|
text-align: center;
|
|
3522
3533
|
}
|
|
3523
3534
|
|
|
3524
|
-
|
|
3525
|
-
flex-
|
|
3526
|
-
align-items: stretch;
|
|
3535
|
+
&:has(> :is(fig-button, fig-tooltip) ~ :is(fig-button, fig-tooltip)) {
|
|
3536
|
+
flex-wrap: wrap;
|
|
3527
3537
|
|
|
3528
3538
|
& > :is(label, h3) {
|
|
3529
|
-
flex-grow:
|
|
3539
|
+
flex-grow: 1;
|
|
3540
|
+
width: 100%;
|
|
3530
3541
|
justify-content: flex-start;
|
|
3531
3542
|
text-align: start;
|
|
3543
|
+
|
|
3532
3544
|
}
|
|
3533
|
-
|
|
3534
|
-
& > fig-button,
|
|
3535
|
-
& > .fig-footer-action {
|
|
3536
|
-
width: 100%;
|
|
3537
|
-
}
|
|
3538
|
-
|
|
3539
|
-
& > .fig-footer-action fig-button {
|
|
3540
|
-
width: 100%;
|
|
3541
|
-
}
|
|
3542
|
-
}*/
|
|
3545
|
+
}
|
|
3543
3546
|
|
|
3544
3547
|
&[borderless] {
|
|
3545
3548
|
box-shadow: none;
|
package/dist/base.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
html,:host{width:100%;height:100%;color:var(--figma-color-text);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:var(--font-family);font-size:16px;font-weight:var(--body-medium-fontWeight);letter-spacing:var(--body-letter-spacing);background-color:var(--figma-color-bg);margin:0;padding:0;line-height:1rem}body,:host{font-size:var(--body-medium-fontSize);letter-spacing:var(--body-letter-spacing);line-height:1.4545em}h1,h2{font-weight:var(--body-large-strong-fontWeight);font-size:var(--body-large-fontSize)}h3{font-weight:var(--body-medium-strong-fontWeight);font-size:var(--body-medium-fontSize)}strong{font-weight:var(--body-medium-strong-fontWeight)}section{padding:var(--spacer-1) var(--spacer-3);margin-bottom:var(--spacer-2);&:last-child{margin-bottom:0}}fieldset{padding:var(--spacer-1) var(--spacer-3)}hr{background-color:var(--figma-color-border);width:100%;height:1px;margin:var(--spacer-2) 0;border:none;&[vertical]{width:1px;height:100%;margin:0 var(--spacer-2)}}iframe{background-color:#0000;border:0;flex:auto;width:100%;max-width:100%;height:max-content;min-height:0;max-height:100%;margin:0;display:block}*,:before,:after{box-sizing:border-box}::selection{background-color:var(--figma-color-text-selection)}::selection{background-color:var(--figma-color-text-selection)}::-webkit-scrollbar{width:var(--spacer-1);height:var(--spacer-1)}::-webkit-scrollbar-thumb{background-color:var(--figma-color-bg-tertiary);border-radius:calc(var(--spacer-1) / 2)}::-webkit-scrollbar-thumb:hover{background-color:var(--figma-color-bg-secondary)}*{scrollbar-width:thin;scrollbar-color:var(--figma-color-bg-tertiary) var(--figma-color-bg-secondary)}.subtle{color:var(--figma-color-text-tertiary)}p{margin-block:1em}p:first-child{margin-block-start:0}p:last-child{margin-block-end:0}label,p,li{color:var(--figma-color-text-secondary)}h2{font-weight:var(--body-medium-strong-fontWeight);margin:var(--spacer-2) 0}a{color:var(--figma-color-text-brand);text-decoration:none;&:hover{text-decoration:underline}}
|
|
1
|
+
html,:host{width:100%;height:100%;color:var(--figma-color-text);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:var(--font-family);font-size:16px;font-weight:var(--body-medium-fontWeight);letter-spacing:var(--body-letter-spacing);background-color:var(--figma-color-bg);margin:0;padding:0;line-height:1rem}body,:host{font-size:var(--body-medium-fontSize);letter-spacing:var(--body-letter-spacing);line-height:1.4545em}h1,h2{font-weight:var(--body-large-strong-fontWeight);font-size:var(--body-large-fontSize);text-wrap:pretty}h3{font-weight:var(--body-medium-strong-fontWeight);font-size:var(--body-medium-fontSize)}strong{font-weight:var(--body-medium-strong-fontWeight)}section{padding:var(--spacer-1) var(--spacer-3);margin-bottom:var(--spacer-2);&:last-child{margin-bottom:0}}fieldset{padding:var(--spacer-1) var(--spacer-3)}hr{background-color:var(--figma-color-border);width:100%;height:1px;margin:var(--spacer-2) 0;border:none;&[vertical]{width:1px;height:100%;margin:0 var(--spacer-2)}}iframe{background-color:#0000;border:0;flex:auto;width:100%;max-width:100%;height:max-content;min-height:0;max-height:100%;margin:0;display:block}*,:before,:after{box-sizing:border-box}::selection{background-color:var(--figma-color-text-selection)}::selection{background-color:var(--figma-color-text-selection)}::-webkit-scrollbar{width:var(--spacer-1);height:var(--spacer-1)}::-webkit-scrollbar-thumb{background-color:var(--figma-color-bg-tertiary);border-radius:calc(var(--spacer-1) / 2)}::-webkit-scrollbar-thumb:hover{background-color:var(--figma-color-bg-secondary)}*{scrollbar-width:thin;scrollbar-color:var(--figma-color-bg-tertiary) var(--figma-color-bg-secondary)}.subtle{color:var(--figma-color-text-tertiary)}p{text-wrap:pretty;margin-block:1em}p:first-child{margin-block-start:0}p:last-child{margin-block-end:0}label,p,li,figcaption{color:var(--figma-color-text-secondary);text-wrap:pretty}h2{font-weight:var(--body-medium-strong-fontWeight);margin:var(--spacer-2) 0;text-wrap:pretty}a{color:var(--figma-color-text-brand);text-decoration:none;&:hover{text-decoration:underline}}
|