@rogieking/figui3 9.2.1 → 9.2.3

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.
@@ -30,7 +30,8 @@ Handlers below assume `onInput` / `onChange` / `onClick` from [react.md](react.m
30
30
  </fig-property-button>
31
31
  ```
32
32
 
33
- - Attrs: `icon` (required fig-icon name), `selected`, `disabled`, `aria-haspopup`, `aria-expanded`, `aria-controls`
33
+ - Attrs: `icon` (generated fig-icon name), `selected`, `disabled`, `aria-haspopup`, `aria-expanded`, `aria-controls`
34
+ - Custom icon: author an element with `slot="prepend"` instead of `icon`; authored prepend content takes precedence
34
35
  - Fixed presentation: secondary, full width, start aligned, leading icon
35
36
  - Trigger only: the consumer owns and positions the corresponding popup/dialog
36
37
  - Events: `click`
@@ -18,7 +18,7 @@ Public API: `README.md`. React recipes: [components.md](components.md).
18
18
 
19
19
  ## `fig-property-button`
20
20
 
21
- - `icon`: required `fig-icon` name
21
+ - `icon`: generated `fig-icon` name; optional when authoring custom `slot="prepend"` content
22
22
  - `selected`, `disabled`
23
23
  - `aria-haspopup`, `aria-expanded`, `aria-controls`
24
24
  - Fixed secondary, full-width, start-aligned presentation
package/README.md CHANGED
@@ -185,11 +185,12 @@ Minimal example:
185
185
 
186
186
  `<fig-property-button>` — [demo](https://rog.ie/figui3/#property-button)
187
187
 
188
- A full-width secondary trigger for opening an effect editor, binding editor, preset picker, or other property-specific flyout. The component supplies the surface and generated leading icon but does not create or position a popup.
188
+ A full-width secondary trigger for opening an effect editor, binding editor, preset picker, or other property-specific flyout. The component supplies the surface and can generate a leading icon from `icon`, or accept custom prepend content, but does not create or position a popup.
189
189
 
190
190
  | Attribute | Type | Default | Description |
191
191
  |---|---|---|---|
192
- | `icon` | string | required | `fig-icon` name rendered in the prepend slot |
192
+ | `icon` | string | — | `fig-icon` name rendered in the prepend slot |
193
+ | `slot="prepend"` | element | — | Custom leading icon/content; takes precedence over `icon` |
193
194
  | `selected` | boolean | `false` | Selected styling, typically while the editor is open |
194
195
  | `disabled` | boolean | `false` | Disabled state |
195
196
  | `aria-haspopup` | string | — | Popup type exposed to assistive technology |
@@ -206,6 +207,11 @@ A full-width secondary trigger for opening an effect editor, binding editor, pre
206
207
  Effects
207
208
  </fig-property-button>
208
209
 
210
+ <fig-property-button>
211
+ <fig-icon name="sun" slot="prepend"></fig-icon>
212
+ Lighting effect
213
+ </fig-property-button>
214
+
209
215
  <dialog
210
216
  is="fig-popup"
211
217
  id="effects-editor"
package/components.css CHANGED
@@ -1150,7 +1150,10 @@ fig-property-button {
1150
1150
  }
1151
1151
  }
1152
1152
 
1153
- fig-property-button[icon]:not([icon="false"]) {
1153
+ fig-property-button:is(
1154
+ [icon]:not([icon="false"]),
1155
+ :has(> [slot="prepend"])
1156
+ ) {
1154
1157
  width: 100%;
1155
1158
  flex: 1 1 auto;
1156
1159
  padding: 0 calc(var(--spacer-2) - 1px) 0 0;
@@ -1197,25 +1200,29 @@ fig-input-combo {
1197
1200
  }
1198
1201
 
1199
1202
  :is(.fig-button-combo, fig-button-combo, .fig-input-combo, fig-input-combo):not(
1200
- :has(> :not([variant="secondary"]))
1201
- ) {
1203
+ :has(> :not([variant="secondary"]):not(fig-tooltip))
1204
+ ):not(:has(> fig-tooltip > :not([variant="secondary"]))) {
1202
1205
  gap: 0;
1203
1206
  border-radius: var(--radius-medium);
1204
1207
  box-shadow: inset 0 0 0 1px var(--figma-color-bordertranslucent);
1205
1208
 
1206
- > [variant="secondary"] {
1209
+ > [variant="secondary"],
1210
+ > fig-tooltip > [variant="secondary"] {
1207
1211
  box-shadow: none;
1208
1212
  }
1209
1213
 
1210
- > [variant="secondary"] + [variant="secondary"] {
1211
- box-shadow: none;
1212
- background-image: linear-gradient(
1213
- var(--figma-color-bordertranslucent),
1214
- var(--figma-color-bordertranslucent)
1215
- );
1216
- background-position: left 1px;
1217
- background-repeat: no-repeat;
1218
- background-size: 1px calc(100% - 2px);
1214
+ > :is([variant="secondary"], fig-tooltip:has(> [variant="secondary"])) {
1215
+ + [variant="secondary"],
1216
+ + fig-tooltip > [variant="secondary"] {
1217
+ box-shadow: none;
1218
+ background-image: linear-gradient(
1219
+ var(--figma-color-bordertranslucent),
1220
+ var(--figma-color-bordertranslucent)
1221
+ );
1222
+ background-position: left 1px;
1223
+ background-repeat: no-repeat;
1224
+ background-size: 1px calc(100% - 2px);
1225
+ }
1219
1226
  }
1220
1227
  }
1221
1228