@rogieking/figui3 8.10.0 → 8.11.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/.cursor/skills/fig-lab/SKILL.md +5 -2
- package/.cursor/skills/fig-lab/components.md +56 -1
- package/.cursor/skills/fig-lab/reference.md +57 -4
- package/.cursor/skills/figui3/components.md +1 -1
- package/.cursor/skills/figui3/react.md +2 -0
- package/.cursor/skills/figui3/reference.md +7 -0
- package/.cursor/skills/propkit/SKILL.md +6 -1
- package/README.md +96 -0
- package/components.css +22 -6
- package/dist/components.css +1 -1
- package/dist/fig-lab.css +1 -1
- package/dist/fig-lab.js +3 -1
- package/dist/fig.css +1 -1
- package/dist/fig.js +1 -1
- package/fig-lab.css +355 -9
- package/fig-lab.js +1422 -129
- package/fig.js +5 -1
- package/package.json +1 -1
|
@@ -33,8 +33,9 @@ import "@rogieking/figui3/fig-lab.js";
|
|
|
33
33
|
|
|
34
34
|
## Shared propskit
|
|
35
35
|
|
|
36
|
-
- Plain labeled component surfaces; joystick, origin, easing,
|
|
37
|
-
vertical label-above-control layout
|
|
36
|
+
- Plain labeled component surfaces; joystick, origin, easing, spring, and image
|
|
37
|
+
use a vertical label-above-control layout. Editable select is intentionally
|
|
38
|
+
label-free with separate edit and add actions.
|
|
38
39
|
- `label` (omitted renders `"Label"`; `label=""` hides it), `disabled`
|
|
39
40
|
- Optional `name` reflects to the host and appears in event details only when non-empty
|
|
40
41
|
- `default` — reset target (may differ from initial `value`)
|
|
@@ -56,7 +57,9 @@ import "@rogieking/figui3/fig-lab.js";
|
|
|
56
57
|
| Labeled exact number | `propskit-number` |
|
|
57
58
|
| Labeled text | `propskit-text` |
|
|
58
59
|
| Labeled discrete list | `propskit-select` (not `fig-dropdown`) |
|
|
60
|
+
| Editable / removable discrete list | `propskit-editable-select` |
|
|
59
61
|
| Labeled palette choice | `propskit-palette` |
|
|
62
|
+
| Labeled image choice/upload | `propskit-image` |
|
|
60
63
|
| Labeled color / fill / gradient | `propskit-color` / `propskit-fill` / `propskit-gradient` |
|
|
61
64
|
| X/Y | `propskit-position` |
|
|
62
65
|
| Interactive X/Y plane | `propskit-joystick` |
|
|
@@ -8,7 +8,8 @@ Handlers below assume `onInput` / `onChange` from the React contract.
|
|
|
8
8
|
|
|
9
9
|
## Shared propskit
|
|
10
10
|
|
|
11
|
-
Plain
|
|
11
|
+
Plain labeled component surfaces. Most are horizontal; spatial, curve, and
|
|
12
|
+
image controls are vertical. Prefer these over hand-rolled label+control rows.
|
|
12
13
|
|
|
13
14
|
Shared attrs: `label` (omitted renders `"Label"`; `label=""` hides it), optional `name`, `disabled`, `default` (reset target, may differ from initial `value`).
|
|
14
15
|
|
|
@@ -98,6 +99,28 @@ rowRef.current?.resetToDefault();
|
|
|
98
99
|
- `options` is an array of palette arrays. Public and event values are typed `{ color, alpha }[]`; omission of `value` selects the first palette.
|
|
99
100
|
- Supports `optionhover`, typed `defaultValue`, `isDefault`, and `resetToDefault()`.
|
|
100
101
|
|
|
102
|
+
### `propskit-image`
|
|
103
|
+
|
|
104
|
+
```tsx
|
|
105
|
+
<propskit-image
|
|
106
|
+
label="Image"
|
|
107
|
+
options='["/images/one.webp","/images/two.webp"]'
|
|
108
|
+
default="/images/one.webp"
|
|
109
|
+
onInput={onInput}
|
|
110
|
+
onChange={onChange}
|
|
111
|
+
/>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
- Inner: a permanent ghost icon upload button plus a conditional
|
|
115
|
+
`fig-chooser layout="grid" columns="2"`.
|
|
116
|
+
- Every `fig-choice` contains a square, cover-fit `fig-image` with an
|
|
117
|
+
attachment-style remove control. Delete and Backspace remove a focused choice.
|
|
118
|
+
- `options` and `.options` are URL arrays; `.value`, `defaultValue`, and event
|
|
119
|
+
values are the selected URL. Omitted or unmatched values select the first.
|
|
120
|
+
- File selection appends local object URLs and selects the first new image.
|
|
121
|
+
Removing a choice updates `options` and revokes its object URL when needed;
|
|
122
|
+
removing the selection falls back to the first remaining image.
|
|
123
|
+
|
|
101
124
|
### `propskit-select`
|
|
102
125
|
|
|
103
126
|
```tsx
|
|
@@ -123,6 +146,38 @@ Rich options (requires editor):
|
|
|
123
146
|
|
|
124
147
|
- Inner: always `fig-select`; editor registration is required. Authored `fig-select-options slot="panel"` wins. Options stay in light DOM.
|
|
125
148
|
|
|
149
|
+
### `propskit-editable-select`
|
|
150
|
+
|
|
151
|
+
```tsx
|
|
152
|
+
<propskit-editable-select
|
|
153
|
+
aria-label="Layer style"
|
|
154
|
+
name="style"
|
|
155
|
+
value="primary"
|
|
156
|
+
options='[{"value":"primary","label":"Primary"},{"value":"secondary","label":"Secondary"}]'
|
|
157
|
+
onInput={onInput}
|
|
158
|
+
onChange={onChange}
|
|
159
|
+
/>
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
- Label-free, always-subtle, content-width `fig-select` on the left in one
|
|
163
|
+
full-row PropsKit surface with default-size secondary edit and add buttons on
|
|
164
|
+
the right.
|
|
165
|
+
- The entire host opens the select except for the edit and add actions.
|
|
166
|
+
- The options menu aligns to and spans the full PropsKit row.
|
|
167
|
+
- Add creates and selects an `item-{index}` value using its zero-based array
|
|
168
|
+
index with the label `"New item"`, then enters rename mode.
|
|
169
|
+
- Edit swaps in a default-size, full-width `fig-input-text`; checkmark, Enter,
|
|
170
|
+
or moving focus outside the input saves, while Escape cancels.
|
|
171
|
+
- Each option has an appended ghost trash action. Delete or Backspace removes
|
|
172
|
+
the focused option from the keyboard.
|
|
173
|
+
- Edit/save, add, and trash icon buttons include descriptive tooltips.
|
|
174
|
+
- The select and trash action disable at one remaining item; edit and add stay
|
|
175
|
+
available.
|
|
176
|
+
- `.options` is normalized `{ value, label }[]`. Renaming changes the label
|
|
177
|
+
while preserving its stable value.
|
|
178
|
+
- `input`, `change`, and `optionhover` detail includes both the stable `value`
|
|
179
|
+
and current `label`.
|
|
180
|
+
|
|
126
181
|
### `propskit-text`
|
|
127
182
|
|
|
128
183
|
```tsx
|
|
@@ -19,9 +19,10 @@ and `input` / `change` event values are boolean.
|
|
|
19
19
|
|
|
20
20
|
## Propskit surfaces and events
|
|
21
21
|
|
|
22
|
-
Surface controls
|
|
23
|
-
|
|
24
|
-
`
|
|
22
|
+
Surface controls do not compose `fig-field`. Most are horizontal; spatial,
|
|
23
|
+
curve, and image controls use vertical layouts. Omitted `label` renders
|
|
24
|
+
`"Label"` and `label=""` hides the visible label. Optional non-empty `name`
|
|
25
|
+
reflects on the host.
|
|
25
26
|
|
|
26
27
|
`input` and `change` dispatch from the outer host with
|
|
27
28
|
`{ control, value, name? }`; `event.target.value` equals `detail.value`.
|
|
@@ -47,9 +48,33 @@ Import `fig-editor.js` and `fig-editor.css`.
|
|
|
47
48
|
- Palette entries: color strings or `{ "color": string, "alpha": number }`
|
|
48
49
|
- `.value`, `defaultValue`, and event `detail.value`: typed `{ color, alpha }[]`
|
|
49
50
|
- First option is the fallback when `value` is omitted or does not match
|
|
50
|
-
- `input`, `change`, and `optionhover`
|
|
51
|
+
- `input`, `change`, and `optionhover` extend the shared PropsKit envelope with
|
|
52
|
+
`label`; `value` remains the stable option value
|
|
51
53
|
- `isDefault` uses structural equality; `resetToDefault()` restores `default`
|
|
52
54
|
|
|
55
|
+
## `propskit-image`
|
|
56
|
+
|
|
57
|
+
Observed: `options`, `value`, `default`, `label`, `aria-label`, `disabled`.
|
|
58
|
+
|
|
59
|
+
Renders a label and permanent ghost upload button above a conditional
|
|
60
|
+
`fig-chooser`. The chooser always uses `layout="grid"` and `columns="2"`;
|
|
61
|
+
each `fig-choice` contains a square, cover-fit `fig-image` and an
|
|
62
|
+
attachment-style remove control.
|
|
63
|
+
|
|
64
|
+
- `options`: optional JSON string array of image URLs
|
|
65
|
+
- `.options`: normalized, de-duplicated URL array
|
|
66
|
+
- `.value`, `defaultValue`, and event `detail.value`: selected URL string
|
|
67
|
+
- First option is the fallback when `value` is omitted or does not match
|
|
68
|
+
- Selecting one or more image files appends object URLs and selects the first
|
|
69
|
+
new image; applications own durable upload and URL replacement
|
|
70
|
+
- Removing a choice reflects the reduced `options` array and revokes an object
|
|
71
|
+
URL when needed; removing the selected choice falls back to the first option
|
|
72
|
+
and emits `input` and `change`
|
|
73
|
+
- Delete and Backspace remove the focused choice
|
|
74
|
+
- `input` and `change` use the shared PropsKit envelope
|
|
75
|
+
- Supports `variant="minimal"`, `isDefault`, `resetToDefault()`, and focus
|
|
76
|
+
delegation
|
|
77
|
+
|
|
53
78
|
## `propskit-select`
|
|
54
79
|
|
|
55
80
|
Observed: `label`, `aria-label`, `options`, `value`.
|
|
@@ -58,6 +83,34 @@ Always renders `fig-select`. Import `fig-editor.js` and `fig-editor.css`; delaye
|
|
|
58
83
|
|
|
59
84
|
Options attr: JSON array, comma, or newline. Authored `fig-select-options slot="panel"` wins for rich menus.
|
|
60
85
|
|
|
86
|
+
## `propskit-editable-select`
|
|
87
|
+
|
|
88
|
+
Observed: `options`, `value`, `default`, `aria-label`, `disabled`.
|
|
89
|
+
|
|
90
|
+
Renders a label-free, always-subtle, content-width `fig-select` on the left,
|
|
91
|
+
with default-size secondary edit and add buttons on the right inside one
|
|
92
|
+
full-row PropsKit surface. The row uses the standard PropsKit padding,
|
|
93
|
+
background, border, color, hover, and focus variables.
|
|
94
|
+
|
|
95
|
+
- `options` accepts comma, newline, or JSON values supported by `fig-select`
|
|
96
|
+
- `.options` returns normalized `{ value, label }[]` entries
|
|
97
|
+
- Clicking the host opens the select except when edit or add is clicked
|
|
98
|
+
- The options menu is positioned and sized to the full PropsKit row
|
|
99
|
+
- Add creates an `item-{index}` value using its zero-based array index with the
|
|
100
|
+
label `"New item"`, selects it, and opens rename mode
|
|
101
|
+
- Edit replaces the select with a default-size, full-width `fig-input-text`;
|
|
102
|
+
checkmark, Enter, or moving focus outside the input commits, while Escape
|
|
103
|
+
cancels
|
|
104
|
+
- Each menu option has an appended ghost trash action; Delete or Backspace
|
|
105
|
+
removes the focused option
|
|
106
|
+
- Edit/save, add, and trash icon buttons include descriptive tooltips
|
|
107
|
+
- At one remaining item, the select and trash action are disabled; add and edit
|
|
108
|
+
remain available
|
|
109
|
+
- Renaming updates the reflected options JSON while preserving the option value
|
|
110
|
+
- `input`, `change`, and `optionhover` use the shared PropsKit envelope
|
|
111
|
+
- Supports `defaultValue`, `isDefault`, `editing`, `resetToDefault()`, disabled
|
|
112
|
+
state propagation, and focus delegation
|
|
113
|
+
|
|
61
114
|
## `propskit-text`
|
|
62
115
|
|
|
63
116
|
Composes `fig-input-text` with `multiline` and `autoresize` enabled by default.
|
|
@@ -68,7 +68,7 @@ Handlers below assume `onInput` / `onChange` / `onClick` from [react.md](react.m
|
|
|
68
68
|
/>
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
- Attrs: `type` (`text`, `email`, `password`, `search`, `url`), `multiline`, `autoresize`, `resizable`, `disabled`, `readonly`, `placeholder`, `full`
|
|
71
|
+
- Attrs: `type` (`text`, `email`, `password`, `search`, `url`), `size` (`large`), `multiline`, `autoresize`, `resizable`, `disabled`, `readonly`, `placeholder`, `full`
|
|
72
72
|
|
|
73
73
|
### `fig-input-number`
|
|
74
74
|
|
|
@@ -118,6 +118,7 @@ type FigTag =
|
|
|
118
118
|
| "propskit-gradient"
|
|
119
119
|
| "propskit-group"
|
|
120
120
|
| "propskit-easing"
|
|
121
|
+
| "propskit-image"
|
|
121
122
|
| "propskit-number"
|
|
122
123
|
| "propskit-oscillator"
|
|
123
124
|
| "propskit-point-point"
|
|
@@ -126,6 +127,7 @@ type FigTag =
|
|
|
126
127
|
| "propskit-position"
|
|
127
128
|
| "propskit-joystick"
|
|
128
129
|
| "propskit-origin"
|
|
130
|
+
| "propskit-editable-select"
|
|
129
131
|
| "propskit-select"
|
|
130
132
|
| "propskit-slider"
|
|
131
133
|
| "propskit-spring"
|
|
@@ -17,6 +17,13 @@ Shared by `fig-dropdown`/`fig-options`/`fig-select`/`propskit-select` `options`:
|
|
|
17
17
|
- `size`: `""`, `large`, `compact`
|
|
18
18
|
- `selected`, `disabled`, `icon` (presence)
|
|
19
19
|
|
|
20
|
+
## `fig-input-text`
|
|
21
|
+
|
|
22
|
+
- `type`: `text`, `email`, `password`, `search`, `url`
|
|
23
|
+
- `size`: `""`, `large` (32px tall)
|
|
24
|
+
- `value`, `placeholder`, `multiline`, `autoresize`, `resizable`, `disabled`, `readonly`, `full`
|
|
25
|
+
- Adornments: `slot="prepend"` and `slot="append"`
|
|
26
|
+
|
|
20
27
|
## `fig-dropdown`
|
|
21
28
|
|
|
22
29
|
- `value`, `type="select|dropdown"`, `variant="ghost"`, `full`, `disabled`
|
|
@@ -59,17 +59,22 @@ Core tags: `figui3` skill + [../figui3/components.md](../figui3/components.md).
|
|
|
59
59
|
| Text | `fig-input-text` | `propskit-text` |
|
|
60
60
|
| Small discrete set (2–5) | `fig-segmented-control` | — |
|
|
61
61
|
| Larger / rich list | `fig-select` (editor) | `propskit-select` |
|
|
62
|
+
| Addable / renameable / removable list | `fig-select` + action buttons | `propskit-editable-select` |
|
|
62
63
|
| Native select only | `fig-dropdown` | — |
|
|
63
64
|
| Color | `fig-input-color` `text="true"` | `propskit-color` (fill-picker swatch) |
|
|
64
65
|
| Fill | `fig-input-fill` | `propskit-fill` (fill-picker swatch) |
|
|
65
66
|
| Gradient | `fig-input-gradient` | `propskit-gradient` |
|
|
66
|
-
| Image | `fig-image` `upload` |
|
|
67
|
+
| Image | `fig-image` `upload` | `propskit-image` |
|
|
67
68
|
| Easing | `fig-easing-curve` | — |
|
|
68
69
|
| Angle | `fig-input-angle` (**lab**) | — |
|
|
69
70
|
| X/Y | `fig-joystick` or two numbers | `propskit-position` |
|
|
70
71
|
|
|
71
72
|
Do not use dropdown/slider for pure on/off. Do not use `fig-dropdown` for Figma-style property selects when `fig-select` is available.
|
|
72
73
|
|
|
74
|
+
Secondary `fig-button` controls nested in PropsKit use the same borderless
|
|
75
|
+
`--propskit-bg-subfield` treatment as ghost subfield selects. This treatment
|
|
76
|
+
persists on hover and while disabled.
|
|
77
|
+
|
|
73
78
|
## Slider rules
|
|
74
79
|
|
|
75
80
|
- Default `type="range"`. Always set `min`, `max`, `step`.
|
package/README.md
CHANGED
|
@@ -110,6 +110,7 @@ Minimal example:
|
|
|
110
110
|
| [Propskit Fill](#propskit-fill) | `<propskit-fill>` | Full-surface labeled fill control |
|
|
111
111
|
| [Propskit Gradient](#propskit-gradient) | `<propskit-gradient>` | Full-surface labeled gradient control |
|
|
112
112
|
| [Propskit Palette](#propskit-palette) | `<propskit-palette>` | Labeled palette selector |
|
|
113
|
+
| [Propskit Image](#propskit-image) | `<propskit-image>` | Labeled image chooser with upload |
|
|
113
114
|
| [Propskit Number](#propskit-number) | `<propskit-number>` | Full-surface labeled number control |
|
|
114
115
|
| [Propskit Position](#propskit-position) | `<propskit-position>` | Compact X/Y control |
|
|
115
116
|
| [Propskit Joystick](#propskit-joystick) | `<propskit-joystick>` | Labeled two-axis joystick |
|
|
@@ -121,6 +122,7 @@ Minimal example:
|
|
|
121
122
|
| [Propskit Point Radius](#propskit-point-radius) | `<propskit-point-radius>` | Collapsible position and radius group |
|
|
122
123
|
| [Propskit Point Radius Angle](#propskit-point-radius-angle) | `<propskit-point-radius-angle>` | Collapsible position, radius, and angle group |
|
|
123
124
|
| [Propskit Select](#propskit-select) | `<propskit-select>` | Full-surface labeled select control |
|
|
125
|
+
| [Propskit Editable Select](#propskit-editable-select) | `<propskit-editable-select>` | Addable and renameable select control |
|
|
124
126
|
| [Propskit Switch](#propskit-switch) | `<propskit-switch>` | Full-surface labeled switch control |
|
|
125
127
|
| [Propskit Text](#propskit-text) | `<propskit-text>` | Full-surface labeled text control |
|
|
126
128
|
| [Text Input](#text-input) | `<fig-input-text>` | Styled text/textarea input |
|
|
@@ -395,6 +397,11 @@ Shared surface variables are `--propskit-padding-block`,
|
|
|
395
397
|
such as `--propskit-select-background` or
|
|
396
398
|
`--propskit-number-input-inline-size`.
|
|
397
399
|
|
|
400
|
+
Nested subfields use `--propskit-bg-subfield` and
|
|
401
|
+
`--propskit-color-border-subfield`. Secondary `fig-button` controls inside any
|
|
402
|
+
PropsKit component use the same borderless subfield background, including
|
|
403
|
+
hover and disabled states.
|
|
404
|
+
|
|
398
405
|
| Attribute | Type | Default | Description |
|
|
399
406
|
|---|---|---|---|
|
|
400
407
|
| `label` | string | `"Label"` | Field label text; use an empty value to hide it |
|
|
@@ -506,6 +513,46 @@ Uses a plain horizontal surface with a selection-only `<fig-input-palette>` prev
|
|
|
506
513
|
|
|
507
514
|
---
|
|
508
515
|
|
|
516
|
+
#### Propskit Image
|
|
517
|
+
|
|
518
|
+
`<propskit-image>`
|
|
519
|
+
|
|
520
|
+
A vertical PropsKit surface with a label and permanent ghost upload button in
|
|
521
|
+
the header. When images exist, it renders a two-column `fig-chooser`; every
|
|
522
|
+
choice contains a square, cover-fit `fig-image` and an attachment-style remove
|
|
523
|
+
control.
|
|
524
|
+
|
|
525
|
+
`options` is an optional JSON array of image URLs. `.options` returns the
|
|
526
|
+
normalized URL array, while `.value`, `defaultValue`, and event values are the
|
|
527
|
+
selected URL string. An omitted or unmatched value falls back to the first
|
|
528
|
+
image.
|
|
529
|
+
|
|
530
|
+
Selecting files appends browser object URLs to `options` and selects the first
|
|
531
|
+
new image. The component previews local files; applications remain responsible
|
|
532
|
+
for uploading and replacing object URLs with durable URLs. Removing an image
|
|
533
|
+
updates the reflected `options` array and revokes its object URL when needed.
|
|
534
|
+
Removing the selected image falls back to the first remaining image and emits
|
|
535
|
+
`input` and `change`; focused choices also support Delete and Backspace.
|
|
536
|
+
|
|
537
|
+
**Attributes:** `label`, `name`, `value`, `default`, `options`, `disabled`,
|
|
538
|
+
`variant="minimal"`
|
|
539
|
+
|
|
540
|
+
**Events:** `input`, `change` — shared PropsKit envelope with the selected URL.
|
|
541
|
+
|
|
542
|
+
**Methods and state:** `defaultValue`, `isDefault`, `resetToDefault()`, and
|
|
543
|
+
focus delegation to the current choice or upload input.
|
|
544
|
+
|
|
545
|
+
```html
|
|
546
|
+
<propskit-image
|
|
547
|
+
label="Image"
|
|
548
|
+
name="image"
|
|
549
|
+
options='["/images/one.webp","/images/two.webp"]'
|
|
550
|
+
default="/images/one.webp"
|
|
551
|
+
></propskit-image>
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
---
|
|
555
|
+
|
|
509
556
|
#### Propskit Switch
|
|
510
557
|
|
|
511
558
|
`<propskit-switch>`
|
|
@@ -554,6 +601,53 @@ Right-click and choose **Reset**, or call `resetToDefault()`, to restore `defaul
|
|
|
554
601
|
|
|
555
602
|
---
|
|
556
603
|
|
|
604
|
+
#### Propskit Editable Select
|
|
605
|
+
|
|
606
|
+
`<propskit-editable-select>`
|
|
607
|
+
|
|
608
|
+
A compact, label-free, subtle `fig-select` aligned to the left at its intrinsic
|
|
609
|
+
width inside one full-row PropsKit surface. Default-size secondary edit and add
|
|
610
|
+
buttons sit on the right within the same row.
|
|
611
|
+
Clicking anywhere on the host opens the select, except the edit and add actions.
|
|
612
|
+
The options menu spans and aligns to the full PropsKit row.
|
|
613
|
+
Edit replaces the select with a default-size, full-width `fig-input-text`; the
|
|
614
|
+
checkmark, Enter, or moving focus outside the input saves, while Escape cancels.
|
|
615
|
+
Add creates a choice with an `item-{index}` value using its zero-based array
|
|
616
|
+
index and a `"New item"` label, selects it, and immediately
|
|
617
|
+
opens rename mode. Every menu
|
|
618
|
+
option includes an appended ghost trash action. Delete removes the item;
|
|
619
|
+
keyboard users can press Delete or Backspace while its option is focused.
|
|
620
|
+
Edit/save, add, and delete icon buttons include descriptive tooltips.
|
|
621
|
+
|
|
622
|
+
`options` accepts the same comma, newline, and JSON formats as `fig-select`.
|
|
623
|
+
`.options` returns normalized `{ value, label }[]` entries. Add, rename, and
|
|
624
|
+
delete mutations reflect this normalized JSON back to `options`. Renaming
|
|
625
|
+
changes only the label, preserving the stable selected value. Deleting the
|
|
626
|
+
selected item falls forward to the next option, then backward at the end. With
|
|
627
|
+
one item remaining, the select and trash action are disabled so the final item
|
|
628
|
+
cannot be deleted; edit and add remain available.
|
|
629
|
+
|
|
630
|
+
**Attributes:** `name`, `value`, `default`, `options`, `aria-label`, `disabled`
|
|
631
|
+
|
|
632
|
+
**Events:** `input`, `change`, `optionhover` — the shared PropsKit envelope is
|
|
633
|
+
extended to `{ control, name?, value, label }`. `value` is the stable option
|
|
634
|
+
value and `label` is its current display label. Add, delete, and successful
|
|
635
|
+
rename actions emit `input` and `change`.
|
|
636
|
+
|
|
637
|
+
**Methods and state:** `.options`, `defaultValue`, `isDefault`, `editing`,
|
|
638
|
+
`resetToDefault()`, and focus delegation.
|
|
639
|
+
|
|
640
|
+
```html
|
|
641
|
+
<propskit-editable-select
|
|
642
|
+
aria-label="Layer style"
|
|
643
|
+
name="style"
|
|
644
|
+
value="primary"
|
|
645
|
+
options='[{"value":"primary","label":"Primary"},{"value":"secondary","label":"Secondary"}]'
|
|
646
|
+
></propskit-editable-select>
|
|
647
|
+
```
|
|
648
|
+
|
|
649
|
+
---
|
|
650
|
+
|
|
557
651
|
#### Propskit Text
|
|
558
652
|
|
|
559
653
|
`<propskit-text>`
|
|
@@ -895,6 +989,7 @@ The internal group always has `compact`. `value` uses the same `{ x, y, x2, y2 }
|
|
|
895
989
|
| `value` | string | — | Input value |
|
|
896
990
|
| `placeholder` | string | — | Placeholder text |
|
|
897
991
|
| `type` | string | `"text"` | `"text"` or `"number"` |
|
|
992
|
+
| `size` | string | — | Set to `"large"` for a 32px-tall input |
|
|
898
993
|
| `disabled` | boolean | `false` | Disabled state |
|
|
899
994
|
| `multiline` | boolean | `false` | Use textarea |
|
|
900
995
|
| `min` | number | — | Min (number type) |
|
|
@@ -904,6 +999,7 @@ The internal group always has `compact`. `value` uses the same `{ x, y, x2, y2 }
|
|
|
904
999
|
|
|
905
1000
|
```html
|
|
906
1001
|
<fig-input-text value="Hello" placeholder="Enter text..."></fig-input-text>
|
|
1002
|
+
<fig-input-text size="large" placeholder="Large input"></fig-input-text>
|
|
907
1003
|
<fig-input-text multiline placeholder="Enter description..."></fig-input-text>
|
|
908
1004
|
```
|
|
909
1005
|
|
package/components.css
CHANGED
|
@@ -363,6 +363,8 @@
|
|
|
363
363
|
/* Icons - colorless shapes for use with mask-image */
|
|
364
364
|
--icon-16-chevron: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.87868 7.12132L8 9.24264L10.1213 7.12132' stroke='grey' stroke-linecap='round'/%3E%3C/svg%3E%0A");
|
|
365
365
|
--icon-24-chevron: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M7.64645 10.1464C7.84171 9.95118 8.15829 9.95118 8.35355 10.1464L12 13.7929L15.6464 10.1464C15.8417 9.95118 16.1583 9.95118 16.3536 10.1464C16.5488 10.3417 16.5488 10.6583 16.3536 10.8536L12.3536 14.8536C12.1583 15.0488 11.8417 15.0488 11.6464 14.8536L7.64645 10.8536C7.45118 10.6583 7.45118 10.3417 7.64645 10.1464Z' fill='black' fill-opacity='0.9'/%3E%3C/svg%3E");
|
|
366
|
+
--icon-24-checkmark: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15.584 7.72241C15.7372 7.49272 16.0476 7.4306 16.2773 7.58374C16.5071 7.73691 16.5691 8.04735 16.416 8.2771L11.416 15.7771C11.3329 15.9017 11.1979 15.983 11.0488 15.9978C10.8999 16.0124 10.7523 15.9591 10.6465 15.8533L7.64648 12.8533C7.45126 12.658 7.45125 12.3415 7.64648 12.1462C7.84174 11.9511 8.15827 11.951 8.35352 12.1462L10.9219 14.7146L15.584 7.72241Z' fill='black' fill-opacity='0.9'/%3E%3C/svg%3E");
|
|
367
|
+
|
|
366
368
|
--icon-16-checkmark: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.5839 3.72266C11.7371 3.49298 12.0476 3.43085 12.2773 3.58399C12.5069 3.73716 12.569 4.04762 12.416 4.27735L7.41596 11.7773C7.33289 11.9019 7.19778 11.9833 7.04877 11.998C6.8999 12.0126 6.75223 11.9593 6.64642 11.8535L3.64642 8.85352C3.4512 8.65826 3.45119 8.34174 3.64642 8.14649C3.84169 7.95133 4.15822 7.95128 4.35346 8.14649L6.92182 10.7148L11.5839 3.72266Z' fill='white'/%3E%3C/svg%3E");
|
|
367
369
|
--icon-16-reset: url("data:image/svg+xml,%3Csvg width='16' height='16' fill='none' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' fill-rule='evenodd' d='M6.354 2.146a.5.5 0 0 1 0 .708L5.207 4H8.5a5 5 0 1 1-5 5 .5.5 0 0 1 1 0 4 4 0 1 0 4-4H5.207l1.147 1.146a.5.5 0 1 1-.708.708l-2-2a.5.5 0 0 1 0-.708l2-2a.5.5 0 0 1 .708 0' clip-rule='evenodd'/%3E%3C/svg%3E");
|
|
368
370
|
--icon-24-reset: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.22473 5.08203C8.41872 4.9541 8.68285 4.97586 8.85364 5.14648C9.0244 5.31725 9.046 5.58134 8.91809 5.77539L8.85364 5.85352L7.70715 7H12.0001C15.3136 7.00005 17.9999 9.68652 18.0001 13C18.0001 16.3137 15.3138 19 12.0001 19C8.68641 19 6.00012 16.3137 6.00012 13C6.00036 12.7241 6.22413 12.5 6.50012 12.5C6.77608 12.5 6.99989 12.7241 7.00012 13C7.00012 15.7614 9.2387 18 12.0001 18C14.7615 18 17.0001 15.7614 17.0001 13C16.9999 10.2388 14.7614 8.00005 12.0001 8H7.70715L8.85364 9.14648L8.91809 9.22461C9.04619 9.41859 9.02426 9.68264 8.85364 9.85352C8.68277 10.0244 8.41881 10.0461 8.22473 9.91797L8.14661 9.85352L6.14661 7.85352C5.95152 7.65824 5.9514 7.34169 6.14661 7.14648L8.14661 5.14648L8.22473 5.08203Z' fill='black' fill-opacity='0.9'/%3E%3C/svg%3E");
|
|
@@ -1396,7 +1398,7 @@ fig-avatar,
|
|
|
1396
1398
|
content: attr(initials);
|
|
1397
1399
|
font-size: var(--body-medium-fontSize);
|
|
1398
1400
|
}
|
|
1399
|
-
|
|
1401
|
+
&:where(fig-input-text)[size="large"] {
|
|
1400
1402
|
--size: 3rem;
|
|
1401
1403
|
}
|
|
1402
1404
|
}
|
|
@@ -1929,7 +1931,8 @@ fig-easing-curve {
|
|
|
1929
1931
|
.fig-easing-curve-svg-container {
|
|
1930
1932
|
border-radius: var(--radius-medium);
|
|
1931
1933
|
background: var(--figma-color-bg-secondary);
|
|
1932
|
-
padding:
|
|
1934
|
+
padding: var(--spacer-4);
|
|
1935
|
+
aspect-ratio: var(--aspect-ratio);
|
|
1933
1936
|
overflow: hidden;
|
|
1934
1937
|
&:is(:hover, :active, :focus, :focus-visible, :focus-within) {
|
|
1935
1938
|
overflow: visible;
|
|
@@ -3807,6 +3810,12 @@ fig-input-number {
|
|
|
3807
3810
|
flex: 1;
|
|
3808
3811
|
width: 100%;
|
|
3809
3812
|
}
|
|
3813
|
+
&:where(fig-input-text)[size="large"] {
|
|
3814
|
+
& > input,
|
|
3815
|
+
& > textarea {
|
|
3816
|
+
padding: var(--spacer-2);
|
|
3817
|
+
}
|
|
3818
|
+
}
|
|
3810
3819
|
&[multiline]:not([multiline="false"]) {
|
|
3811
3820
|
display: flex;
|
|
3812
3821
|
width: 100%;
|
|
@@ -3845,12 +3854,20 @@ fig-input-number {
|
|
|
3845
3854
|
order: 0;
|
|
3846
3855
|
padding-right: 0;
|
|
3847
3856
|
margin-right: calc(var(--spacer-2) * -1);
|
|
3857
|
+
&[size="large"] {
|
|
3858
|
+
height: var(--spacer-6);
|
|
3859
|
+
min-width: var(--spacer-6);
|
|
3860
|
+
}
|
|
3848
3861
|
}
|
|
3849
3862
|
|
|
3850
3863
|
& [slot="append"] {
|
|
3851
3864
|
order: 2;
|
|
3852
3865
|
padding-left: 0;
|
|
3853
3866
|
margin-left: calc(var(--spacer-2) * -1);
|
|
3867
|
+
&[size="large"] {
|
|
3868
|
+
height: var(--spacer-5);
|
|
3869
|
+
min-width: var(--spacer-5);
|
|
3870
|
+
}
|
|
3854
3871
|
}
|
|
3855
3872
|
|
|
3856
3873
|
&[type="search"]:not([data-search-has-value]) [data-generated="search-clear"] {
|
|
@@ -5025,12 +5042,12 @@ fig-icon {
|
|
|
5025
5042
|
height: var(--size);
|
|
5026
5043
|
background: currentColor;
|
|
5027
5044
|
mask-image: var(--icon);
|
|
5028
|
-
mask-size:
|
|
5045
|
+
mask-size: auto;
|
|
5029
5046
|
mask-repeat: no-repeat;
|
|
5030
5047
|
mask-position: center;
|
|
5031
5048
|
flex-shrink: 0;
|
|
5032
5049
|
-webkit-mask-image: var(--icon);
|
|
5033
|
-
-webkit-mask-size:
|
|
5050
|
+
-webkit-mask-size: auto;
|
|
5034
5051
|
-webkit-mask-repeat: no-repeat;
|
|
5035
5052
|
-webkit-mask-position: center;
|
|
5036
5053
|
|
|
@@ -5405,7 +5422,7 @@ fig-card {
|
|
|
5405
5422
|
}
|
|
5406
5423
|
|
|
5407
5424
|
fig-choice {
|
|
5408
|
-
--fig-choice-selection-ring-width:
|
|
5425
|
+
--fig-choice-selection-ring-width: 2px;
|
|
5409
5426
|
--fig-choice-padding: 0px;
|
|
5410
5427
|
--fig-choice-text-padding-inline: var(--spacer-2);
|
|
5411
5428
|
--fig-choice-border-radius: var(--radius-medium);
|
|
@@ -5428,7 +5445,6 @@ fig-choice {
|
|
|
5428
5445
|
padding-inline: var(--fig-choice-text-padding-inline);
|
|
5429
5446
|
}
|
|
5430
5447
|
|
|
5431
|
-
|
|
5432
5448
|
&:hover:not([selected]:not([selected="false"])):not([disabled]:not([disabled="false"])):not([aria-disabled="true"]) {
|
|
5433
5449
|
background-color: var(--figma-color-bg-secondary);
|
|
5434
5450
|
}
|