@rogieking/figui3 3.0.3 → 3.2.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.
Files changed (4) hide show
  1. package/README.md +19 -1
  2. package/dist/fig.js +30 -30
  3. package/fig.js +187 -26
  4. package/package.json +1 -1
package/README.md CHANGED
@@ -300,7 +300,16 @@ A segmented button group for exclusive selection.
300
300
  | Attribute | Type | Default | Description |
301
301
  |-----------|------|---------|-------------|
302
302
  | `name` | string | — | Control group identifier |
303
- | `value` | string | — | Selected segment value |
303
+ | `value` | string | — | Selected segment value (trimmed, case-sensitive match) |
304
+
305
+ Selection behavior:
306
+ - If `fig-segmented-control[value]` is set, it takes precedence and selects the first matching segment.
307
+ - Segment match value resolves from `fig-segment[value]` when present and non-empty; otherwise it falls back to `fig-segment` text content (`textContent.trim()`).
308
+ - If no segment matches the control `value`, current selection is preserved.
309
+
310
+ Events:
311
+ - Emits bubbling `input` and `change` events when user interaction changes selection.
312
+ - Event `detail` contains the resolved selected value.
304
313
 
305
314
  ```html
306
315
  <fig-segmented-control>
@@ -310,6 +319,15 @@ A segmented button group for exclusive selection.
310
319
  </fig-segmented-control>
311
320
  ```
312
321
 
322
+ ```html
323
+ <!-- Text fallback: no value attrs, value resolves from text -->
324
+ <fig-segmented-control value="Center">
325
+ <fig-segment>Left</fig-segment>
326
+ <fig-segment>Center</fig-segment>
327
+ <fig-segment>Right</fig-segment>
328
+ </fig-segmented-control>
329
+ ```
330
+
313
331
  ---
314
332
 
315
333
  ### Slider (`<fig-slider>`)