@rogieking/figui3 6.40.0 → 7.0.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 +45 -82
- 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
|
@@ -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;
|
|
@@ -3579,10 +3579,14 @@ fig-content {
|
|
|
3579
3579
|
}
|
|
3580
3580
|
}
|
|
3581
3581
|
|
|
3582
|
-
fig-content[padding]:not([padding="false"]) {
|
|
3582
|
+
fig-content[padding]:not([padding="false"]):not(:empty) {
|
|
3583
3583
|
padding-inline: var(--spacer-3);
|
|
3584
3584
|
}
|
|
3585
3585
|
|
|
3586
|
+
fig-content:empty {
|
|
3587
|
+
padding: 0;
|
|
3588
|
+
}
|
|
3589
|
+
|
|
3586
3590
|
vstack,
|
|
3587
3591
|
.vstack,
|
|
3588
3592
|
[vstack] {
|
|
@@ -3786,14 +3790,14 @@ fig-input-fill {
|
|
|
3786
3790
|
outline-offset: -1px !important;
|
|
3787
3791
|
}
|
|
3788
3792
|
|
|
3789
|
-
& > .input-combo > fig-swatch:not(:only-child),
|
|
3790
|
-
& > .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,
|
|
3791
3795
|
& > .input-combo > fig-fill-picker:not(:only-child),
|
|
3792
|
-
& > .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,
|
|
3793
3797
|
& > .input-combo > label,
|
|
3794
3798
|
& fig-fill-picker:not(:only-child),
|
|
3795
3799
|
fig-input-text,
|
|
3796
|
-
fig-swatch {
|
|
3800
|
+
:is(fig-swatch, fig-chit) {
|
|
3797
3801
|
&,
|
|
3798
3802
|
&:focus,
|
|
3799
3803
|
&:hover {
|
|
@@ -3804,8 +3808,8 @@ fig-input-fill {
|
|
|
3804
3808
|
--selected: 0;
|
|
3805
3809
|
}
|
|
3806
3810
|
}
|
|
3807
|
-
fig-swatch ~ fig-input-text > input,
|
|
3808
|
-
fig-swatch ~ label,
|
|
3811
|
+
:is(fig-swatch, fig-chit) ~ fig-input-text > input,
|
|
3812
|
+
:is(fig-swatch, fig-chit) ~ label,
|
|
3809
3813
|
fig-fill-picker ~ fig-input-text > input {
|
|
3810
3814
|
padding-left: 0 !important;
|
|
3811
3815
|
}
|
|
@@ -3952,8 +3956,8 @@ fig-input-gradient {
|
|
|
3952
3956
|
display: contents;
|
|
3953
3957
|
}
|
|
3954
3958
|
}
|
|
3955
|
-
& > fig-swatch,
|
|
3956
|
-
& > fig-fill-picker > fig-swatch {
|
|
3959
|
+
& > :is(fig-swatch, fig-chit),
|
|
3960
|
+
& > fig-fill-picker > :is(fig-swatch, fig-chit) {
|
|
3957
3961
|
--width: 100%;
|
|
3958
3962
|
width: var(--width);
|
|
3959
3963
|
--border-radius: var(--fig-input-gradient-swatch-border-radius);
|
|
@@ -3966,7 +3970,7 @@ fig-input-gradient {
|
|
|
3966
3970
|
.fig-input-gradient-track {
|
|
3967
3971
|
inset: 0;
|
|
3968
3972
|
}
|
|
3969
|
-
> fig-swatch{
|
|
3973
|
+
> :is(fig-swatch, fig-chit){
|
|
3970
3974
|
--size: var(--fig-input-gradient-height);
|
|
3971
3975
|
}
|
|
3972
3976
|
}
|
|
@@ -4044,7 +4048,7 @@ fig-input-palette {
|
|
|
4044
4048
|
&:focus-within {
|
|
4045
4049
|
outline: 0 !important;
|
|
4046
4050
|
}
|
|
4047
|
-
fig-swatch {
|
|
4051
|
+
:is(fig-swatch, fig-chit) {
|
|
4048
4052
|
--border-radius: 0px;
|
|
4049
4053
|
--width: 100%;
|
|
4050
4054
|
--padding: 0px;
|
|
@@ -4065,7 +4069,7 @@ fig-input-palette {
|
|
|
4065
4069
|
}
|
|
4066
4070
|
}
|
|
4067
4071
|
&:first-child{
|
|
4068
|
-
& fig-swatch::after{
|
|
4072
|
+
& :is(fig-swatch, fig-chit)::after{
|
|
4069
4073
|
box-shadow: none;
|
|
4070
4074
|
}
|
|
4071
4075
|
}
|
|
@@ -4118,7 +4122,7 @@ fig-input-palette {
|
|
|
4118
4122
|
grid-column: button;
|
|
4119
4123
|
}
|
|
4120
4124
|
|
|
4121
|
-
fig-swatch {
|
|
4125
|
+
:is(fig-swatch, fig-chit) {
|
|
4122
4126
|
--border-radius: var(--radius-medium);
|
|
4123
4127
|
width: auto !important;
|
|
4124
4128
|
height: var(--size);
|
|
@@ -5098,7 +5102,7 @@ fig-chooser {
|
|
|
5098
5102
|
}
|
|
5099
5103
|
|
|
5100
5104
|
&[full]:not([full="false"]) {
|
|
5101
|
-
width: 100
|
|
5105
|
+
width: calc(100% - var(--fig-chooser-inline-margin) * 2);
|
|
5102
5106
|
}
|
|
5103
5107
|
|
|
5104
5108
|
&[disabled]:not([disabled="false"]) {
|
|
@@ -5116,6 +5120,9 @@ fig-card {
|
|
|
5116
5120
|
gap: var(--spacer-1);
|
|
5117
5121
|
width: 100%;
|
|
5118
5122
|
min-width: 0;
|
|
5123
|
+
padding: var(--fig-card-padding);
|
|
5124
|
+
border-radius: 0.5625rem;
|
|
5125
|
+
box-sizing: border-box;
|
|
5119
5126
|
|
|
5120
5127
|
&[full]:not([full="false"]) {
|
|
5121
5128
|
width: 100%;
|
|
@@ -5124,8 +5131,7 @@ fig-card {
|
|
|
5124
5131
|
&[size="large"] {
|
|
5125
5132
|
--fig-card-padding: var(--spacer-2);
|
|
5126
5133
|
|
|
5127
|
-
> fig-footer
|
|
5128
|
-
.fig-card-link > fig-footer {
|
|
5134
|
+
> fig-footer {
|
|
5129
5135
|
margin-top: var(--spacer-1);
|
|
5130
5136
|
}
|
|
5131
5137
|
|
|
@@ -5135,58 +5141,29 @@ fig-card {
|
|
|
5135
5141
|
}
|
|
5136
5142
|
}
|
|
5137
5143
|
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
box-sizing: border-box;
|
|
5142
|
-
}
|
|
5143
|
-
|
|
5144
|
-
.fig-card-link {
|
|
5145
|
-
display: flex;
|
|
5146
|
-
flex-direction: column;
|
|
5147
|
-
gap: var(--spacer-1);
|
|
5148
|
-
padding: var(--fig-card-padding);
|
|
5149
|
-
border-radius: 0.5625rem;
|
|
5150
|
-
text-decoration: none;
|
|
5151
|
-
color: inherit;
|
|
5152
|
-
outline: none;
|
|
5153
|
-
box-sizing: border-box;
|
|
5154
|
-
width: 100%;
|
|
5155
|
-
min-width: 0;
|
|
5156
|
-
}
|
|
5157
|
-
|
|
5158
|
-
.fig-card-link:focus-visible {
|
|
5159
|
-
outline: var(--figma-focus-outline);
|
|
5160
|
-
outline-offset: var(--figma-focus-outline-offset);
|
|
5161
|
-
}
|
|
5162
|
-
|
|
5163
|
-
.fig-card-link > fig-image,
|
|
5164
|
-
.fig-card-link > fig-media,
|
|
5165
|
-
.fig-card-link > fig-preview,
|
|
5166
|
-
&:is(:not([src]), [src=""]) > fig-image,
|
|
5167
|
-
&:is(:not([src]), [src=""]) > fig-media,
|
|
5168
|
-
&:is(:not([src]), [src=""]) > fig-preview {
|
|
5169
|
-
display: block;
|
|
5144
|
+
> fig-image,
|
|
5145
|
+
> fig-media,
|
|
5146
|
+
> fig-preview {
|
|
5170
5147
|
width: 100%;
|
|
5171
5148
|
max-width: none;
|
|
5172
5149
|
gap: 0;
|
|
5173
5150
|
border-radius: var(--fig-card-media-radius);
|
|
5174
5151
|
}
|
|
5175
5152
|
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5153
|
+
> fig-preview {
|
|
5154
|
+
display: grid;
|
|
5155
|
+
}
|
|
5156
|
+
|
|
5157
|
+
> fig-image > fig-preview,
|
|
5158
|
+
> fig-media > fig-preview,
|
|
5159
|
+
> fig-preview {
|
|
5182
5160
|
width: 100%;
|
|
5183
5161
|
max-width: none;
|
|
5184
5162
|
border-radius: var(--fig-card-media-radius);
|
|
5185
5163
|
min-height: auto;
|
|
5186
5164
|
}
|
|
5187
5165
|
|
|
5188
|
-
> fig-footer
|
|
5189
|
-
.fig-card-link > fig-footer {
|
|
5166
|
+
> fig-footer {
|
|
5190
5167
|
display: flex;
|
|
5191
5168
|
flex-direction: column;
|
|
5192
5169
|
flex-wrap: nowrap;
|
|
@@ -5200,8 +5177,7 @@ fig-card {
|
|
|
5200
5177
|
min-width: 0;
|
|
5201
5178
|
}
|
|
5202
5179
|
|
|
5203
|
-
> fig-footer[hidden]
|
|
5204
|
-
.fig-card-link > fig-footer[hidden] {
|
|
5180
|
+
> fig-footer[hidden] {
|
|
5205
5181
|
display: none;
|
|
5206
5182
|
}
|
|
5207
5183
|
|
|
@@ -5226,10 +5202,14 @@ fig-card {
|
|
|
5226
5202
|
}
|
|
5227
5203
|
|
|
5228
5204
|
.fig-card-sublabel {
|
|
5205
|
+
box-sizing: border-box;
|
|
5206
|
+
display: block;
|
|
5229
5207
|
font-size: var(--font-size-small);
|
|
5230
5208
|
line-height: var(--line-height);
|
|
5231
5209
|
color: var(--figma-color-text-secondary);
|
|
5232
5210
|
padding-inline: var(--spacer-1);
|
|
5211
|
+
width: 100%;
|
|
5212
|
+
max-width: 100%;
|
|
5233
5213
|
min-width: 0;
|
|
5234
5214
|
min-height: 0;
|
|
5235
5215
|
justify-content: flex-start;
|
|
@@ -5243,42 +5223,25 @@ fig-card {
|
|
|
5243
5223
|
display: none;
|
|
5244
5224
|
}
|
|
5245
5225
|
|
|
5246
|
-
&:hover:not(
|
|
5247
|
-
[disabled]:not([disabled="false"])
|
|
5248
|
-
):not([aria-disabled="true"])
|
|
5249
|
-
.fig-card-link,
|
|
5250
|
-
&:is(:not([src]), [src=""]):hover:not(
|
|
5226
|
+
&:hover:not(
|
|
5251
5227
|
[selected]:not([selected="false"])
|
|
5252
5228
|
):not([disabled]:not([disabled="false"])):not([aria-disabled="true"]) {
|
|
5253
5229
|
background: var(--figma-color-bg-secondary);
|
|
5254
5230
|
}
|
|
5255
5231
|
|
|
5256
|
-
&[selected]:not([selected="false"])
|
|
5257
|
-
&:is(:not([src]), [src=""])[selected]:not([selected="false"]) {
|
|
5232
|
+
&[selected]:not([selected="false"]) {
|
|
5258
5233
|
background: var(--figma-color-bg-selected);
|
|
5259
5234
|
}
|
|
5260
5235
|
|
|
5261
|
-
&[selected]:not([selected="false"])
|
|
5262
|
-
.fig-card-link
|
|
5263
|
-
> :is(fig-image, fig-media, fig-preview),
|
|
5264
|
-
&:is(:not([src]), [src=""])[selected]:not([selected="false"])
|
|
5265
|
-
> :is(fig-image, fig-media, fig-preview) {
|
|
5236
|
+
&[selected]:not([selected="false"]) > :is(fig-image, fig-media, fig-preview) {
|
|
5266
5237
|
outline: var(--figma-focus-outline);
|
|
5267
5238
|
outline-offset: var(--figma-focus-outline-offset);
|
|
5268
5239
|
}
|
|
5269
5240
|
|
|
5270
5241
|
&[selected]:not([selected="false"])
|
|
5271
|
-
.fig-card-link
|
|
5272
|
-
> :is(fig-image, fig-media)
|
|
5273
|
-
> fig-preview::after,
|
|
5274
|
-
&[selected]:not([selected="false"])
|
|
5275
|
-
.fig-card-link
|
|
5276
|
-
> fig-preview::after,
|
|
5277
|
-
&:is(:not([src]), [src=""])[selected]:not([selected="false"])
|
|
5278
5242
|
> :is(fig-image, fig-media)
|
|
5279
5243
|
> fig-preview::after,
|
|
5280
|
-
|
|
5281
|
-
> fig-preview::after {
|
|
5244
|
+
&[selected]:not([selected="false"]) > fig-preview::after {
|
|
5282
5245
|
box-shadow: inset 0 0 0 1px var(--figma-color-border-selected);
|
|
5283
5246
|
}
|
|
5284
5247
|
|
|
@@ -5532,7 +5495,7 @@ fig-color-tip {
|
|
|
5532
5495
|
cursor: pointer;
|
|
5533
5496
|
}
|
|
5534
5497
|
|
|
5535
|
-
fig-swatch {
|
|
5498
|
+
:is(fig-swatch, fig-chit) {
|
|
5536
5499
|
input[type="color"] {
|
|
5537
5500
|
background: transparent;
|
|
5538
5501
|
}
|