@rogieking/figui3 6.40.1 → 7.1.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 +2 -5
- package/components.css +42 -83
- package/dist/components.css +1 -1
- package/dist/fig-editor.js +1 -1
- package/dist/fig.css +1 -1
- package/dist/fig.js +22 -22
- package/fig-editor.js +1 -1
- package/fig.js +44 -120
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1418,7 +1418,7 @@ Use `slot="overlay"` for custom overlay controls. Slotted overlays stay as direc
|
|
|
1418
1418
|
|
|
1419
1419
|
`<fig-card>` — [demo](https://rog.ie/figui3/#card)
|
|
1420
1420
|
|
|
1421
|
-
A media card with a truncated label
|
|
1421
|
+
A media card with a truncated label and attribute-only selection chrome. With `src`, it composes a generated `fig-image`. The `label` and `sublabel` attributes render inside a generated `fig-footer`.
|
|
1422
1422
|
|
|
1423
1423
|
| Attribute | Type | Default | Description |
|
|
1424
1424
|
|---|---|---|---|
|
|
@@ -1427,10 +1427,8 @@ A media card with a truncated label, optional link, and attribute-only selection
|
|
|
1427
1427
|
| `label` | string | — | Card title (preferred over `text`) |
|
|
1428
1428
|
| `text` | string | — | Alias for `label` |
|
|
1429
1429
|
| `sublabel` | string | — | Secondary one-line text under the label |
|
|
1430
|
-
| `href` | string | — | When set, wraps content in a real `<a>` |
|
|
1431
|
-
| `target` | string | — | Forwarded to the `<a>` (`_blank` adds `rel="noopener noreferrer"`) |
|
|
1432
1430
|
| `selected` | boolean | `false` | Selected chrome only (no click-toggle) |
|
|
1433
|
-
| `disabled` | boolean | `false` | Dim + non-interactive
|
|
1431
|
+
| `disabled` | boolean | `false` | Dim + non-interactive |
|
|
1434
1432
|
| `full` | boolean | `false` | Stretch to the available width (cards are already `width: 100%` by default) |
|
|
1435
1433
|
| `size` | string | default | Set to `"large"` for `--spacer-2` card padding and `--spacer-1` label spacing |
|
|
1436
1434
|
| `aspect-ratio` | string | `"1/1"` | Forwarded to generated `fig-image` |
|
|
@@ -1441,7 +1439,6 @@ A media card with a truncated label, optional link, and attribute-only selection
|
|
|
1441
1439
|
<fig-card src="photo.jpg" label="Autumn field"></fig-card>
|
|
1442
1440
|
<fig-card src="photo.jpg" label="Large card" size="large"></fig-card>
|
|
1443
1441
|
<fig-card src="photo.jpg" label="Shader pill" sublabel="Generative tools/effects" selected></fig-card>
|
|
1444
|
-
<fig-card src="photo.jpg" label="Open asset" href="#asset"></fig-card>
|
|
1445
1442
|
<fig-card src="photo.jpg" label="Wide card" aspect-ratio="16/9" full></fig-card>
|
|
1446
1443
|
<fig-card label="Custom preview">
|
|
1447
1444
|
<fig-preview>...</fig-preview>
|
package/components.css
CHANGED
|
@@ -1239,7 +1239,7 @@ fig-tabs,
|
|
|
1239
1239
|
gap: var(--spacer-1);
|
|
1240
1240
|
min-width: 0;
|
|
1241
1241
|
overflow: auto hidden;
|
|
1242
|
-
padding: var(--spacer-
|
|
1242
|
+
padding: var(--spacer-1) 0;
|
|
1243
1243
|
padding-inline: var(--fig-tabs-inline-padding);
|
|
1244
1244
|
margin: 0;
|
|
1245
1245
|
margin-left: var(--fig-tabs-margin-left);
|
|
@@ -1405,7 +1405,7 @@ input[type="color"] {
|
|
|
1405
1405
|
}
|
|
1406
1406
|
}
|
|
1407
1407
|
|
|
1408
|
-
fig-swatch {
|
|
1408
|
+
:is(fig-swatch, fig-chit) {
|
|
1409
1409
|
--size: 1.5rem;
|
|
1410
1410
|
--padding: 5px;
|
|
1411
1411
|
--width: var(--size);
|
|
@@ -2320,7 +2320,7 @@ fig-combo-input fig-button[type="select"] {
|
|
|
2320
2320
|
color: var(--figma-color-text);
|
|
2321
2321
|
}
|
|
2322
2322
|
|
|
2323
|
-
& > *:not(fig-swatch){
|
|
2323
|
+
& > *:not(fig-swatch):not(fig-chit){
|
|
2324
2324
|
&:first-child:not(:last-child),
|
|
2325
2325
|
&:first-child:not(:last-child) > * {
|
|
2326
2326
|
border-top-right-radius: 0;
|
|
@@ -3055,7 +3055,7 @@ dialog,
|
|
|
3055
3055
|
background: var(--figma-color-bg);
|
|
3056
3056
|
min-width: min(var(--popover-min-width), var(--dialog-max-width));
|
|
3057
3057
|
box-shadow: var(--figma-elevation-500-modal-window);
|
|
3058
|
-
max-height: calc(
|
|
3058
|
+
max-height: calc(100vh - var(--spacer-4) * 2);
|
|
3059
3059
|
max-width: min(var(--dialog-max-width), 30rem);
|
|
3060
3060
|
height: max-content;
|
|
3061
3061
|
& > fig-content,
|
|
@@ -3790,14 +3790,14 @@ fig-input-fill {
|
|
|
3790
3790
|
outline-offset: -1px !important;
|
|
3791
3791
|
}
|
|
3792
3792
|
|
|
3793
|
-
& > .input-combo > fig-swatch:not(:only-child),
|
|
3794
|
-
& > .input-combo > fig-swatch:not(:only-child) input,
|
|
3793
|
+
& > .input-combo > :is(fig-swatch, fig-chit):not(:only-child),
|
|
3794
|
+
& > .input-combo > :is(fig-swatch, fig-chit):not(:only-child) input,
|
|
3795
3795
|
& > .input-combo > fig-fill-picker:not(:only-child),
|
|
3796
|
-
& > .input-combo > fig-fill-picker:not(:only-child) > fig-swatch > input,
|
|
3796
|
+
& > .input-combo > fig-fill-picker:not(:only-child) > :is(fig-swatch, fig-chit) > input,
|
|
3797
3797
|
& > .input-combo > label,
|
|
3798
3798
|
& fig-fill-picker:not(:only-child),
|
|
3799
3799
|
fig-input-text,
|
|
3800
|
-
fig-swatch {
|
|
3800
|
+
:is(fig-swatch, fig-chit) {
|
|
3801
3801
|
&,
|
|
3802
3802
|
&:focus,
|
|
3803
3803
|
&:hover {
|
|
@@ -3808,8 +3808,8 @@ fig-input-fill {
|
|
|
3808
3808
|
--selected: 0;
|
|
3809
3809
|
}
|
|
3810
3810
|
}
|
|
3811
|
-
fig-swatch ~ fig-input-text > input,
|
|
3812
|
-
fig-swatch ~ label,
|
|
3811
|
+
:is(fig-swatch, fig-chit) ~ fig-input-text > input,
|
|
3812
|
+
:is(fig-swatch, fig-chit) ~ label,
|
|
3813
3813
|
fig-fill-picker ~ fig-input-text > input {
|
|
3814
3814
|
padding-left: 0 !important;
|
|
3815
3815
|
}
|
|
@@ -3956,8 +3956,8 @@ fig-input-gradient {
|
|
|
3956
3956
|
display: contents;
|
|
3957
3957
|
}
|
|
3958
3958
|
}
|
|
3959
|
-
& > fig-swatch,
|
|
3960
|
-
& > fig-fill-picker > fig-swatch {
|
|
3959
|
+
& > :is(fig-swatch, fig-chit),
|
|
3960
|
+
& > fig-fill-picker > :is(fig-swatch, fig-chit) {
|
|
3961
3961
|
--width: 100%;
|
|
3962
3962
|
width: var(--width);
|
|
3963
3963
|
--border-radius: var(--fig-input-gradient-swatch-border-radius);
|
|
@@ -3970,7 +3970,7 @@ fig-input-gradient {
|
|
|
3970
3970
|
.fig-input-gradient-track {
|
|
3971
3971
|
inset: 0;
|
|
3972
3972
|
}
|
|
3973
|
-
> fig-swatch{
|
|
3973
|
+
> :is(fig-swatch, fig-chit){
|
|
3974
3974
|
--size: var(--fig-input-gradient-height);
|
|
3975
3975
|
}
|
|
3976
3976
|
}
|
|
@@ -4048,7 +4048,7 @@ fig-input-palette {
|
|
|
4048
4048
|
&:focus-within {
|
|
4049
4049
|
outline: 0 !important;
|
|
4050
4050
|
}
|
|
4051
|
-
fig-swatch {
|
|
4051
|
+
:is(fig-swatch, fig-chit) {
|
|
4052
4052
|
--border-radius: 0px;
|
|
4053
4053
|
--width: 100%;
|
|
4054
4054
|
--padding: 0px;
|
|
@@ -4069,7 +4069,7 @@ fig-input-palette {
|
|
|
4069
4069
|
}
|
|
4070
4070
|
}
|
|
4071
4071
|
&:first-child{
|
|
4072
|
-
& fig-swatch::after{
|
|
4072
|
+
& :is(fig-swatch, fig-chit)::after{
|
|
4073
4073
|
box-shadow: none;
|
|
4074
4074
|
}
|
|
4075
4075
|
}
|
|
@@ -4122,7 +4122,7 @@ fig-input-palette {
|
|
|
4122
4122
|
grid-column: button;
|
|
4123
4123
|
}
|
|
4124
4124
|
|
|
4125
|
-
fig-swatch {
|
|
4125
|
+
:is(fig-swatch, fig-chit) {
|
|
4126
4126
|
--border-radius: var(--radius-medium);
|
|
4127
4127
|
width: auto !important;
|
|
4128
4128
|
height: var(--size);
|
|
@@ -4144,7 +4144,7 @@ fig-field {
|
|
|
4144
4144
|
--fig-field-right-padding: var(--spacer-3);
|
|
4145
4145
|
--fig-field-top-padding: var(--spacer-1);
|
|
4146
4146
|
--fig-field-bottom-padding: var(--spacer-1);
|
|
4147
|
-
--fig-field-label-max-height: var(--spacer-
|
|
4147
|
+
--fig-field-label-max-height: var(--spacer-4);
|
|
4148
4148
|
--fig-field-label-ratio: 1fr;
|
|
4149
4149
|
--fig-field-input-ratio: 2fr;
|
|
4150
4150
|
display: grid;
|
|
@@ -5120,6 +5120,9 @@ fig-card {
|
|
|
5120
5120
|
gap: var(--spacer-1);
|
|
5121
5121
|
width: 100%;
|
|
5122
5122
|
min-width: 0;
|
|
5123
|
+
padding: var(--fig-card-padding);
|
|
5124
|
+
border-radius: 0.5625rem;
|
|
5125
|
+
box-sizing: border-box;
|
|
5123
5126
|
|
|
5124
5127
|
&[full]:not([full="false"]) {
|
|
5125
5128
|
width: 100%;
|
|
@@ -5128,8 +5131,7 @@ fig-card {
|
|
|
5128
5131
|
&[size="large"] {
|
|
5129
5132
|
--fig-card-padding: var(--spacer-2);
|
|
5130
5133
|
|
|
5131
|
-
> fig-footer
|
|
5132
|
-
.fig-card-link > fig-footer {
|
|
5134
|
+
> fig-footer {
|
|
5133
5135
|
margin-top: var(--spacer-1);
|
|
5134
5136
|
}
|
|
5135
5137
|
|
|
@@ -5139,58 +5141,29 @@ fig-card {
|
|
|
5139
5141
|
}
|
|
5140
5142
|
}
|
|
5141
5143
|
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
box-sizing: border-box;
|
|
5146
|
-
}
|
|
5147
|
-
|
|
5148
|
-
.fig-card-link {
|
|
5149
|
-
display: flex;
|
|
5150
|
-
flex-direction: column;
|
|
5151
|
-
gap: var(--spacer-1);
|
|
5152
|
-
padding: var(--fig-card-padding);
|
|
5153
|
-
border-radius: 0.5625rem;
|
|
5154
|
-
text-decoration: none;
|
|
5155
|
-
color: inherit;
|
|
5156
|
-
outline: none;
|
|
5157
|
-
box-sizing: border-box;
|
|
5158
|
-
width: 100%;
|
|
5159
|
-
min-width: 0;
|
|
5160
|
-
}
|
|
5161
|
-
|
|
5162
|
-
.fig-card-link:focus-visible {
|
|
5163
|
-
outline: var(--figma-focus-outline);
|
|
5164
|
-
outline-offset: var(--figma-focus-outline-offset);
|
|
5165
|
-
}
|
|
5166
|
-
|
|
5167
|
-
.fig-card-link > fig-image,
|
|
5168
|
-
.fig-card-link > fig-media,
|
|
5169
|
-
.fig-card-link > fig-preview,
|
|
5170
|
-
&:is(:not([src]), [src=""]) > fig-image,
|
|
5171
|
-
&:is(:not([src]), [src=""]) > fig-media,
|
|
5172
|
-
&:is(:not([src]), [src=""]) > fig-preview {
|
|
5173
|
-
display: block;
|
|
5144
|
+
> fig-image,
|
|
5145
|
+
> fig-media,
|
|
5146
|
+
> fig-preview {
|
|
5174
5147
|
width: 100%;
|
|
5175
5148
|
max-width: none;
|
|
5176
5149
|
gap: 0;
|
|
5177
5150
|
border-radius: var(--fig-card-media-radius);
|
|
5178
5151
|
}
|
|
5179
5152
|
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5153
|
+
> fig-preview {
|
|
5154
|
+
display: grid;
|
|
5155
|
+
}
|
|
5156
|
+
|
|
5157
|
+
> fig-image > fig-preview,
|
|
5158
|
+
> fig-media > fig-preview,
|
|
5159
|
+
> fig-preview {
|
|
5186
5160
|
width: 100%;
|
|
5187
5161
|
max-width: none;
|
|
5188
5162
|
border-radius: var(--fig-card-media-radius);
|
|
5189
5163
|
min-height: auto;
|
|
5190
5164
|
}
|
|
5191
5165
|
|
|
5192
|
-
> fig-footer
|
|
5193
|
-
.fig-card-link > fig-footer {
|
|
5166
|
+
> fig-footer {
|
|
5194
5167
|
display: flex;
|
|
5195
5168
|
flex-direction: column;
|
|
5196
5169
|
flex-wrap: nowrap;
|
|
@@ -5204,8 +5177,7 @@ fig-card {
|
|
|
5204
5177
|
min-width: 0;
|
|
5205
5178
|
}
|
|
5206
5179
|
|
|
5207
|
-
> fig-footer[hidden]
|
|
5208
|
-
.fig-card-link > fig-footer[hidden] {
|
|
5180
|
+
> fig-footer[hidden] {
|
|
5209
5181
|
display: none;
|
|
5210
5182
|
}
|
|
5211
5183
|
|
|
@@ -5230,10 +5202,14 @@ fig-card {
|
|
|
5230
5202
|
}
|
|
5231
5203
|
|
|
5232
5204
|
.fig-card-sublabel {
|
|
5205
|
+
box-sizing: border-box;
|
|
5206
|
+
display: block;
|
|
5233
5207
|
font-size: var(--font-size-small);
|
|
5234
5208
|
line-height: var(--line-height);
|
|
5235
5209
|
color: var(--figma-color-text-secondary);
|
|
5236
5210
|
padding-inline: var(--spacer-1);
|
|
5211
|
+
width: 100%;
|
|
5212
|
+
max-width: 100%;
|
|
5237
5213
|
min-width: 0;
|
|
5238
5214
|
min-height: 0;
|
|
5239
5215
|
justify-content: flex-start;
|
|
@@ -5247,42 +5223,25 @@ fig-card {
|
|
|
5247
5223
|
display: none;
|
|
5248
5224
|
}
|
|
5249
5225
|
|
|
5250
|
-
&:hover:not(
|
|
5251
|
-
[disabled]:not([disabled="false"])
|
|
5252
|
-
):not([aria-disabled="true"])
|
|
5253
|
-
.fig-card-link,
|
|
5254
|
-
&:is(:not([src]), [src=""]):hover:not(
|
|
5226
|
+
&:hover:not(
|
|
5255
5227
|
[selected]:not([selected="false"])
|
|
5256
5228
|
):not([disabled]:not([disabled="false"])):not([aria-disabled="true"]) {
|
|
5257
5229
|
background: var(--figma-color-bg-secondary);
|
|
5258
5230
|
}
|
|
5259
5231
|
|
|
5260
|
-
&[selected]:not([selected="false"])
|
|
5261
|
-
&:is(:not([src]), [src=""])[selected]:not([selected="false"]) {
|
|
5232
|
+
&[selected]:not([selected="false"]) {
|
|
5262
5233
|
background: var(--figma-color-bg-selected);
|
|
5263
5234
|
}
|
|
5264
5235
|
|
|
5265
|
-
&[selected]:not([selected="false"])
|
|
5266
|
-
.fig-card-link
|
|
5267
|
-
> :is(fig-image, fig-media, fig-preview),
|
|
5268
|
-
&:is(:not([src]), [src=""])[selected]:not([selected="false"])
|
|
5269
|
-
> :is(fig-image, fig-media, fig-preview) {
|
|
5236
|
+
&[selected]:not([selected="false"]) > :is(fig-image, fig-media, fig-preview) {
|
|
5270
5237
|
outline: var(--figma-focus-outline);
|
|
5271
5238
|
outline-offset: var(--figma-focus-outline-offset);
|
|
5272
5239
|
}
|
|
5273
5240
|
|
|
5274
5241
|
&[selected]:not([selected="false"])
|
|
5275
|
-
.fig-card-link
|
|
5276
|
-
> :is(fig-image, fig-media)
|
|
5277
|
-
> fig-preview::after,
|
|
5278
|
-
&[selected]:not([selected="false"])
|
|
5279
|
-
.fig-card-link
|
|
5280
|
-
> fig-preview::after,
|
|
5281
|
-
&:is(:not([src]), [src=""])[selected]:not([selected="false"])
|
|
5282
5242
|
> :is(fig-image, fig-media)
|
|
5283
5243
|
> fig-preview::after,
|
|
5284
|
-
|
|
5285
|
-
> fig-preview::after {
|
|
5244
|
+
&[selected]:not([selected="false"]) > fig-preview::after {
|
|
5286
5245
|
box-shadow: inset 0 0 0 1px var(--figma-color-border-selected);
|
|
5287
5246
|
}
|
|
5288
5247
|
|
|
@@ -5536,7 +5495,7 @@ fig-color-tip {
|
|
|
5536
5495
|
cursor: pointer;
|
|
5537
5496
|
}
|
|
5538
5497
|
|
|
5539
|
-
fig-swatch {
|
|
5498
|
+
:is(fig-swatch, fig-chit) {
|
|
5540
5499
|
input[type="color"] {
|
|
5541
5500
|
background: transparent;
|
|
5542
5501
|
}
|