stimeo-ui 0.15.0 → 0.17.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 (115) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +209 -0
  3. data/README.md +128 -1
  4. data/dist/cable/index.js +392 -417
  5. data/dist/controllers/accordion_controller.js +228 -28
  6. data/dist/controllers/alert_dialog_controller.js +862 -221
  7. data/dist/controllers/announcer_controller.js +135 -191
  8. data/dist/controllers/aspect_ratio_controller.js +0 -10
  9. data/dist/controllers/auto_submit_controller.js +295 -110
  10. data/dist/controllers/avatar_controller.js +172 -106
  11. data/dist/controllers/breadcrumb_controller.js +0 -129
  12. data/dist/controllers/bulk_select_controller.js +264 -53
  13. data/dist/controllers/calendar_controller.js +346 -180
  14. data/dist/controllers/carousel_controller.js +587 -300
  15. data/dist/controllers/character_counter_controller.js +271 -143
  16. data/dist/controllers/checkbox_controller.js +77 -75
  17. data/dist/controllers/clipboard_controller.js +187 -108
  18. data/dist/controllers/collapsible_controller.js +374 -108
  19. data/dist/controllers/color_picker_controller.js +183 -127
  20. data/dist/controllers/combobox_controller.js +426 -109
  21. data/dist/controllers/command_palette_controller.js +994 -350
  22. data/dist/controllers/conditional_fields_controller.js +212 -125
  23. data/dist/controllers/confirm_controller.js +939 -245
  24. data/dist/controllers/context_menu_controller.js +275 -127
  25. data/dist/controllers/count_up_controller.js +73 -21
  26. data/dist/controllers/countdown_controller.js +235 -97
  27. data/dist/controllers/currency_input_controller.js +241 -118
  28. data/dist/controllers/data_grid_controller.js +229 -135
  29. data/dist/controllers/date_range_picker_controller.js +359 -165
  30. data/dist/controllers/dialog_controller.js +887 -225
  31. data/dist/controllers/direct_upload_controller.js +80 -142
  32. data/dist/controllers/dirty_form_controller.js +26 -47
  33. data/dist/controllers/dismissible_controller.js +175 -20
  34. data/dist/controllers/drawer_controller.js +963 -336
  35. data/dist/controllers/dropdown_controller.js +342 -85
  36. data/dist/controllers/editable_controller.js +182 -58
  37. data/dist/controllers/empty_state_controller.js +67 -53
  38. data/dist/controllers/file_dropzone_controller.js +426 -229
  39. data/dist/controllers/filter_controller.js +78 -36
  40. data/dist/controllers/flash_controller.js +328 -211
  41. data/dist/controllers/focus_controller.js +654 -239
  42. data/dist/controllers/form_field_controller.js +153 -136
  43. data/dist/controllers/form_validation_controller.js +29 -96
  44. data/dist/controllers/frame_loading_controller.js +263 -198
  45. data/dist/controllers/highlight_controller.js +119 -70
  46. data/dist/controllers/hover_card_controller.js +335 -118
  47. data/dist/controllers/idle_controller.js +316 -65
  48. data/dist/controllers/input_mask_controller.js +116 -61
  49. data/dist/controllers/intersection_controller.js +147 -103
  50. data/dist/controllers/lazy_frame_controller.js +9 -56
  51. data/dist/controllers/listbox_controller.js +413 -153
  52. data/dist/controllers/local_time_controller.js +54 -64
  53. data/dist/controllers/masonry_controller.js +70 -95
  54. data/dist/controllers/menu_controller.js +254 -167
  55. data/dist/controllers/menubar_controller.js +206 -331
  56. data/dist/controllers/meter_controller.js +159 -71
  57. data/dist/controllers/multi_select_controller.js +797 -388
  58. data/dist/controllers/navigation_menu_controller.js +156 -231
  59. data/dist/controllers/nested_form_controller.js +373 -174
  60. data/dist/controllers/network_status_controller.js +241 -45
  61. data/dist/controllers/number_input_controller.js +387 -227
  62. data/dist/controllers/optimistic_controller.js +28 -75
  63. data/dist/controllers/otp_controller.js +344 -196
  64. data/dist/controllers/overflow_indicator_controller.js +167 -93
  65. data/dist/controllers/overflow_menu_controller.js +408 -277
  66. data/dist/controllers/pagination_controller.js +342 -120
  67. data/dist/controllers/password_reveal_controller.js +424 -99
  68. data/dist/controllers/password_strength_controller.js +99 -153
  69. data/dist/controllers/persist_controller.js +252 -96
  70. data/dist/controllers/pointer_drag_controller.js +263 -164
  71. data/dist/controllers/popover_controller.js +267 -94
  72. data/dist/controllers/portal_controller.js +209 -72
  73. data/dist/controllers/preview_guard_controller.js +243 -112
  74. data/dist/controllers/progress_controller.js +132 -59
  75. data/dist/controllers/radio_group_controller.js +138 -133
  76. data/dist/controllers/range_slider_controller.js +245 -112
  77. data/dist/controllers/rating_controller.js +429 -194
  78. data/dist/controllers/read_more_controller.js +185 -47
  79. data/dist/controllers/reading_progress_controller.js +147 -135
  80. data/dist/controllers/relative_time_controller.js +145 -110
  81. data/dist/controllers/{reset_before_cache_controller.js → reset_on_restore_controller.js} +97 -38
  82. data/dist/controllers/resizable_controller.js +294 -118
  83. data/dist/controllers/roving_controller.js +39 -84
  84. data/dist/controllers/scroll_area_controller.js +428 -221
  85. data/dist/controllers/scroll_restore_controller.js +0 -53
  86. data/dist/controllers/scroll_visibility_controller.js +395 -146
  87. data/dist/controllers/scrollspy_controller.js +181 -236
  88. data/dist/controllers/separator_controller.js +288 -132
  89. data/dist/controllers/sidebar_controller.js +1071 -375
  90. data/dist/controllers/skeleton_controller.js +248 -92
  91. data/dist/controllers/slider_controller.js +211 -96
  92. data/dist/controllers/smart_sticky_header_controller.js +163 -54
  93. data/dist/controllers/sortable_controller.js +13 -110
  94. data/dist/controllers/spinner_controller.js +277 -161
  95. data/dist/controllers/step_indicator_controller.js +107 -53
  96. data/dist/controllers/stepper_controller.js +171 -48
  97. data/dist/controllers/stick_to_bottom_controller.js +310 -116
  98. data/dist/controllers/sticky_observer_controller.js +214 -49
  99. data/dist/controllers/submit_once_controller.js +294 -192
  100. data/dist/controllers/switch_controller.js +107 -43
  101. data/dist/controllers/tabs_controller.js +50 -25
  102. data/dist/controllers/tags_input_controller.js +290 -149
  103. data/dist/controllers/textarea_autosize_controller.js +71 -58
  104. data/dist/controllers/theme_controller.js +148 -80
  105. data/dist/controllers/time_picker_controller.js +162 -81
  106. data/dist/controllers/toast_controller.js +365 -193
  107. data/dist/controllers/toggle_group_controller.js +194 -99
  108. data/dist/controllers/toolbar_controller.js +92 -90
  109. data/dist/controllers/tooltip_controller.js +185 -125
  110. data/dist/controllers/transition_controller.js +123 -115
  111. data/dist/controllers/tree_view_controller.js +248 -290
  112. data/dist/index.js +8649 -8572
  113. data/dist/positioning/index.js +148 -45
  114. data/lib/stimeo/ui/version.rb +1 -1
  115. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 401c70da7398b7e246c7858cebc821e6f9b6e6a079b196ad277180187aa1ae9d
4
- data.tar.gz: ff726d279d0e91491558b60e69bacf76ae8a3d340c7ee5cd94982f8bc00e02d7
3
+ metadata.gz: 0ab94f6bcd6de9b272ef9049a92e84b7e69af7d955dee82d24fef5dc09f61682
4
+ data.tar.gz: 180f338981fd0e02a0c5dc9b30032eedfcdb0841d5734524d02d00862bbfad57
5
5
  SHA512:
6
- metadata.gz: 70da6b350c9495cfada5f6f17606e11092274160587faf5e62b8b7767e685d8dc4aa63bf096cf62d1f9e1ad6ee9629a7bbbba9eecd0999d061c0baff993648ce
7
- data.tar.gz: 93f0139a4720f0b00109f0bb8ff3833be11d4780db1a8993effb7624b39f327861c09f3b7b6c0d37f8dbba4c26101aec6d0c81f2c35382f6f0c938655f42704f
6
+ metadata.gz: f65e42f9fdbe28e84af7ecc703f2bd92620bbe75ef197dfd478255286f23278625a1bc3c57237c3390b60c3f0d1714ffdc60ddb6584a334187e2775dbc36072a
7
+ data.tar.gz: 8c832a6e93363515f8343913f2456113086812f7d6fbd63f8751b2279cecb8e3682482978cd5adee9354fd871fbae0b328d38797fdcd7a81e4a8703016bf78a8
data/CHANGELOG.md CHANGED
@@ -7,6 +7,212 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
  While the version is `0.x`, the public API (the `stimeo--*` data attributes) may
8
8
  change between releases.
9
9
 
10
+ ## [Unreleased]
11
+
12
+ ## [0.17.0] - 2026-10-04
13
+
14
+ ### Changed
15
+
16
+ - **Breaking** Replace `reset-before-cache` with `reset-on-restore` (class, export,
17
+ and subpath).
18
+ Reset runs on restoration; remove `dispatchReset` and `:request` bindings.
19
+ Restored drawers and command palettes start closed.
20
+ - **Breaking** Rename calendar, combobox, and command-palette `selectByClick`, and
21
+ tree-view `onClick`, to `select`; replace calendar `selectDayElement` with
22
+ `select(element)`.
23
+ Accordion `toggle`, theme `set`, and scrollspy `scrollTo` require owned targets.
24
+ - **Breaking** State events are silent for unchanged state and superseded pending
25
+ reports.
26
+ For child edits within partial checkbox groups, use the children's native `change`.
27
+ Number Values and action params enforce finite values and their declared domains.
28
+ Update Inspector integrations to schema v15 and run `stimeo check` before deploying.
29
+ - Target actions accept owned elements; user state reports include `detail.reason`.
30
+ Toast duration, persist debounce, and count-up duration changes apply to the next
31
+ operation. Portal destination changes update mounts; Cable params cannot replace
32
+ the declared channel.
33
+
34
+ ### Fixed
35
+
36
+ - Preserve live state across Turbo caching, repair derived state after retained
37
+ morphs, and restore focus reliably across nested layers and Shadow DOM.
38
+
39
+ ## [0.16.0] - 2026-09-26
40
+
41
+ Minor release with no new components. Widgets now report their own state
42
+ changes — `open` / `close`, and `reconcile` when the page rather than the user
43
+ moves committed state — mirror their value into hidden form fields that fire a
44
+ native `change`, and no longer write normalized values back to their Values.
45
+ Several event, detail, action, and Value names were unified, so read Changed and
46
+ Removed before upgrading. The Inspector manifest moves to schema v14, and
47
+ **`stimeo check` can report errors on views that passed under 0.15.0** (row
48
+ templates, action params, event names, submit-once's `idle` / `busy` pairs), so
49
+ run it before deploying.
50
+
51
+ ### Added
52
+
53
+ - accordion, collapsible, context-menu, dialog, drawer, dropdown, hover-card,
54
+ menu, menubar, navigation-menu, popover, read-more, sidebar, and tooltip:
55
+ `open` / `close` events whose `detail.reason` says why the state moved, typed
56
+ by the new `StateReason` type export. accordion also carries
57
+ `{ index, trigger, panel }`, menubar `{ index, menu }`, navigation-menu
58
+ `{ index, panel }`, and sidebar `{ mode }`.
59
+ - tabs: a `change` event with `{ index, total, previous }`.
60
+ - A `reconcile` event, once per batch and never on connect, when the page — code
61
+ writing a Value or an attribute, or a morph — rather than the user moves
62
+ committed state: calendar `{ date }`, currency-input `{ value, formatted }`,
63
+ data-grid `{ rows }`, date-range-picker `{ start, end }`, listbox
64
+ `{ value, option }`, pagination `{ page, total, previous }`, range-slider
65
+ `{ start, end }`, resizable `{ value, fraction }`, separator and slider
66
+ `{ value }`, stepper `{ index, previous, total, step }`, switch `{ checked }`,
67
+ theme `{ mode, resolved }`, toggle-group `{ values }`, and tree-view
68
+ `{ item }`. sidebar reports `reconcile` `{ mode, open }` when crossing its
69
+ breakpoint switches the mode.
70
+ - Hidden form fields that fire a native `change` on a user commit and stay
71
+ silent on connect, morphs, and Value writes: calendar `field` / `monthField`,
72
+ range-slider `startField` / `endField`, and a `field` on slider, switch
73
+ (`"true"` / `"false"`), and tree-view (the selected item's `data-value`).
74
+ toggle-group and data-grid mirror into a `fields` container with `name`
75
+ (`values[]` / `rows[]`) and `form` Values, data-grid from the selected rows'
76
+ `data-value`. tags-input gains the `form` Value multi-select already has.
77
+ - Label pairs the controller swaps with the state: `expandedLabel` /
78
+ `collapsedLabel` on accordion, collapsible, and read-more, and `onLabel` /
79
+ `offLabel` on carousel's play toggle and password-reveal. Regions it shows
80
+ only in their state: `empty` on combobox and multi-select, `hasNew` on
81
+ stick-to-bottom, and `prompt` / `idle` on idle, which also sets `data-prompt`
82
+ while the warning stands.
83
+ - listbox: a `placeholder` Value the trigger shows while nothing is selected.
84
+ - clipboard: `copy` carries `message`, the `copiedLabel` or `errorLabel` for the
85
+ outcome, so `stimeo--clipboard:copy->stimeo--toast#show` needs no script.
86
+ - stepper: `change` also carries `total`, so it wires straight into
87
+ step-indicator's `setIndex`.
88
+ - Inspector: `unknown-action-event`, `invalid-template-root`, and action-param
89
+ checks (`missing-action-param`, `invalid-action-param`, and the warning
90
+ `confusable-action-param`) for overflow-indicator's `direction`, stepper's
91
+ `index`, toast's `type`, and announcer's `assertive`.
92
+
93
+ ### Changed
94
+
95
+ - **Breaking** switch: the event is `change` (was `changed`).
96
+ - **Breaking** step-indicator: the `current` Value is `index`, `setCurrent` is
97
+ `setIndex` and reads `detail.index`, and `change` carries
98
+ `{ index, previous, total }`.
99
+ - **Breaking** toast: `body` → `message` (param, detail, and
100
+ `data-toast-slot`).
101
+ - **Breaking** toast, tags-input, multi-select, and file-dropzone: the row
102
+ `<template>` must hold exactly one element, and that element carries the
103
+ `item` / `tag` target itself. A wrapped row or a second element adds nothing;
104
+ tags-input, multi-select, and file-dropzone say so on the console once per
105
+ connection, and `stimeo check` reports `invalid-template-root`.
106
+ - **Breaking** detail keys: filter `visible` → `visibleCount`, overflow-menu
107
+ `{ visible, hidden }` → `{ overflowCount, total }`, portal `mount`
108
+ `target` → `destination`.
109
+ - **Breaking** slider, range-slider, separator, resizable, rating, color-picker,
110
+ stepper, pagination, bulk-select, carousel (`autoplay`), and calendar (`month`)
111
+ no longer write a normalized value back to their Values: the attribute keeps
112
+ what the page wrote, only a user move writes it, and a declared value takes
113
+ effect again once the bounds allow it. Read the published state
114
+ from ARIA, the hidden field, or the events. theme still writes a stored choice
115
+ back to `mode`.
116
+ - **Breaking** a page-driven move reports `reconcile`, not `change`:
117
+ currency-input on a `locale`, `currency`, or `precision` change, a swapped-in
118
+ display, or a reconnect that re-rounds; otp on a native form reset or a
119
+ `pattern` change that drops entered characters, with no `complete` either.
120
+ rating's `reconcile` reports every move of the shown rating the page causes, an
121
+ in-range `value` write included, and nothing for a clamp that leaves it where
122
+ it was.
123
+ - **Breaking** color-picker, date-range-picker, multi-select, rating, and
124
+ tags-input fire a native `change` on a user commit — from the hidden `field`,
125
+ or from the `fields` container on multi-select and tags-input — so a form with
126
+ `stimeo--auto-submit` or a `change` listener now reacts to it.
127
+ - **Breaking** number-input: a step from the buttons, the arrow and Page keys,
128
+ Home and End, or press-and-hold fires the native `input` and `change` a typed
129
+ value does, ahead of `stimeo--number-input:change`, so a form with
130
+ `stimeo--auto-submit` or a `change` listener now reacts to each step.
131
+ - **Breaking** calendar: without a `month`, the grid opens on the selected day's
132
+ month instead of today's and leaves `month` empty (read the shown month from
133
+ `monthField`). A `selected` day outside `min` / `max` is withheld — no
134
+ `aria-selected`, an empty `field` — and published again once the bounds allow
135
+ it; the `selected` Value is never rewritten. Focus inside the grid follows a
136
+ `month` change that moves the painted month to the new month's tab stop.
137
+ - **Breaking** date-range-picker: a confirmed range whose ends `min`, `max`, or
138
+ `disabledDates` exclude narrows to the nearest selectable days, or clears when
139
+ none remain, and reports `reconcile`; `connect()` narrows a range read from its
140
+ fields the same way, silently.
141
+ - **Breaking** flash and toast never evict a hovered or focused notification for
142
+ `max`: the stack stays over the cap until that hold ends, then the oldest
143
+ unheld ones go. toast evicts with reason `limit` (was `timeout`), and a `max`
144
+ of `0` or less, or not a finite number, means no limit (toast used to remove
145
+ every toast).
146
+ - **Breaking** carousel: the `autoplay` Value is no longer switched off at the
147
+ end of a non-looping set or under reduced motion. The declared rotation
148
+ resumes once a slide lies ahead again; reduced motion holds it until the user
149
+ presses play or the page changes `autoplay`.
150
+ - **Breaking** resizable and filter dispatch `change` only when the outcome
151
+ moved: resizable's position, filter's `{ active, visibleCount, total }`.
152
+ - **Breaking** slider, range-slider, and separator decide a user move's
153
+ `change` against the last published value; toggle-group, calendar, and
154
+ date-range-picker skip a `change` or `select` that a listener superseded.
155
+ - Components follow more runtime changes: calendar repaints on `min`, `max`, and
156
+ `weekStart`, and a consumer's `aria-disabled` moves with its date to the cell
157
+ that shows it; countdown follows `completeLabel`; clipboard rewrites a shown
158
+ result on `copiedLabel` / `errorLabel`; flash applies a changed `max` at once;
159
+ theme applies a `mode` declaration, reported as `reconcile`, while a stored
160
+ choice still wins; overflow-menu relabels its More trigger on `moreLabel`;
161
+ stepper re-derives every step when steps are added or removed.
162
+ - countdown: the completion text it wrote, marked
163
+ `data-stimeo--countdown-owns-status`, is taken back when the timer leaves
164
+ `complete`, and a `deadline` moved forward returns it to `paused`.
165
+ overflow-menu marks the More label it wrote the same way
166
+ (`data-stimeo--overflow-menu-owns-label`) and leaves alone a trigger the
167
+ consumer put elements or a name into.
168
+ - listbox: with nothing selected the trigger shows `placeholder`, else the text
169
+ it held before the first selection, instead of keeping the last selected
170
+ option's text.
171
+ - number-input: a text-type spinbutton reads full-width digits and signs
172
+ (`34`, `-5`) as numbers.
173
+ - color-picker: a repaint that does not move the color no longer overwrites text
174
+ being typed into the hex input.
175
+ - carousel: an in-page move keeps a running rotation without a new `play`, and a
176
+ real detach while the element stays in the document emits `pause`.
177
+ - Target attributes are read as a token list: calendar, date-range-picker,
178
+ flash, nested-form, and toast find a target that also carries other names, and
179
+ `stimeo check` resolves them the same way.
180
+ - currency-input, input-mask, number-input, and otp hold a page write that
181
+ arrives during IME composition until the composition ends.
182
+ - Inspector: submit-once's `idle` / `busy` pair is checked per submit control,
183
+ so a button holding one half is reported (`missing-conditional-target`) even
184
+ when another button holds both.
185
+
186
+ ### Removed
187
+
188
+ - **Breaking** overflow-indicator: the `update` action. The controller listens
189
+ to its viewport's `scroll` itself, and `stimeo check` reports a leftover
190
+ `scroll->stimeo--overflow-indicator#update` as `unknown-action-method`.
191
+ - **Breaking** calendar: the public `render()` method; the grid repaints itself
192
+ when `min`, `max`, or `weekStart` change.
193
+
194
+ ### Fixed
195
+
196
+ - A user-clicked form reset re-derives checkbox, conditional-fields, and otp
197
+ state.
198
+ - pointer-drag: a `setPointerCapture()` that throws no longer locks the handle
199
+ out of both pointer and keyboard dragging. slider, range-slider, and
200
+ color-picker: another element taking the pointer capture mid-drag no longer
201
+ ends the drag.
202
+ - otp: an edit that reaches a field right after an IME confirmation without a
203
+ keystroke — dictation, autofill, a drop — is taken instead of dropped.
204
+ - otp: the authored `aria-invalid`, `aria-errormessage`, and `aria-describedby`
205
+ come back even when a page cached while an error showed is restored under
206
+ another connection; while the error shows, each field carries a
207
+ `data-otp-*-lease` marker holding them.
208
+ - tags-input, multi-select, and file-dropzone: a row whose root is itself the
209
+ `remove` button or the `label` can be removed, focused, and relabelled.
210
+ - stepper: `goto` stays put on an `index` param that is empty or that Stimulus
211
+ reads as a boolean, `null`, or an array (`"true"`, `"null"`, `"[1]"`), instead
212
+ of jumping to a step; `stimeo check` already reports these params.
213
+ - The type declarations link `open`, `close`, `confirm`, and `scrollTo` to the
214
+ component's own method instead of the DOM global of the same name.
215
+
10
216
  ## [0.15.0] - 2026-09-20
11
217
 
12
218
  Minor release with no new components. Shared internals were consolidated across
@@ -1101,6 +1307,9 @@ Initial public alpha: 101 behavior-only, accessible Stimulus controllers driven
1101
1307
  by `data-*` attributes, shipping no CSS. Published to npm (with provenance) and
1102
1308
  RubyGems.
1103
1309
 
1310
+ [Unreleased]: https://github.com/taiyaky/stimeo-ui/compare/v0.17.0...HEAD
1311
+ [0.17.0]: https://github.com/taiyaky/stimeo-ui/releases/tag/v0.17.0
1312
+ [0.16.0]: https://github.com/taiyaky/stimeo-ui/releases/tag/v0.16.0
1104
1313
  [0.15.0]: https://github.com/taiyaky/stimeo-ui/releases/tag/v0.15.0
1105
1314
  [0.14.0]: https://github.com/taiyaky/stimeo-ui/releases/tag/v0.14.0
1106
1315
  [0.13.0]: https://github.com/taiyaky/stimeo-ui/releases/tag/v0.13.0
data/README.md CHANGED
@@ -62,7 +62,14 @@ registerStimeo(application); // registers every stimeo--* controller
62
62
  ```
63
63
 
64
64
  Need only a few controllers? Import them individually from
65
- `stimeo-ui/controllers/*` and register them under your own identifiers.
65
+ `stimeo-ui/controllers/*` and register them under your own identifiers. Each
66
+ file loads on its own, yet the coordination between components — which layer
67
+ Escape closes, a focus trap's `Tab` and background, the value two components
68
+ lend the same attribute — is kept once per page, whichever files the
69
+ controllers came from, `stimeo-ui` itself included.
70
+ Copies of the same controller also share dirty-form confirmations, highlight
71
+ deadlines and portal origins. Opt-in Cable copies share the consumer, subscriptions
72
+ and peer departure decisions; generated ARIA ids stay distinct across copies too.
66
73
 
67
74
  - **Peer dependencies:** `@hotwired/stimulus` (always), `@floating-ui/dom` (only
68
75
  if you use the opt-in `stimeo-ui/positioning` module — tooltips, popovers, etc.
@@ -114,6 +121,126 @@ The `eslint-plugin-jsx-a11y` equivalents are
114
121
  `no-noninteractive-tabindex`. These components' real accessibility is exercised
115
122
  with axe-core and real screen readers in this project's own test suite.
116
123
 
124
+ ## Composing components
125
+
126
+ Parts dispatch `stimeo--<identifier>:<event>` with a `detail`, and Stimulus can bind
127
+ one part's event straight to another part's action. Wiring two parts is a
128
+ `data-action`, not a `<script>`.
129
+
130
+ ```html
131
+ <!-- Copy a link and say so, with nothing in between. -->
132
+ <div data-controller="stimeo--toast"
133
+ data-action="stimeo--clipboard:copy->stimeo--toast#show">
134
+ <div data-controller="stimeo--clipboard"
135
+ data-stimeo--clipboard-text-value="https://example.com/share"
136
+ data-stimeo--clipboard-copied-label-value="Copied"
137
+ data-stimeo--clipboard-error-label-value="Copy failed">
138
+ <button type="button" data-stimeo--clipboard-target="button"
139
+ data-action="click->stimeo--clipboard#copy">Copy</button>
140
+ </div>
141
+ <ol data-stimeo--toast-target="list"></ol>
142
+ <template data-stimeo--toast-target="template">
143
+ <li data-stimeo--toast-target="item"><span data-toast-slot="message"></span></li>
144
+ </template>
145
+ </div>
146
+ ```
147
+
148
+ ```html
149
+ <!-- A wizard moves a read-only progress indicator. -->
150
+ <div data-controller="stimeo--stepper">
151
+ <ol data-controller="stimeo--step-indicator"
152
+ data-action="stimeo--stepper:change@window->stimeo--step-indicator#setIndex">
153
+ <li data-stimeo--step-indicator-target="step">Cart</li>
154
+ <li data-stimeo--step-indicator-target="step">Shipping</li>
155
+ </ol>
156
+ <!-- the stepper's own step targets and buttons -->
157
+ </div>
158
+ ```
159
+
160
+ ```html
161
+ <!-- A value a widget stepped submits the form, through the events a browser
162
+ would have fired for its own control. -->
163
+ <form data-controller="stimeo--auto-submit"
164
+ data-action="change->stimeo--auto-submit#submit">
165
+ <div data-controller="stimeo--number-input">
166
+ <input type="number" name="quantity" value="1" aria-label="Quantity"
167
+ data-stimeo--number-input-target="input"
168
+ data-action="change->stimeo--number-input#onInput
169
+ keydown->stimeo--number-input#onKeydown" />
170
+ <button type="button" aria-label="Increase" tabindex="-1"
171
+ data-stimeo--number-input-target="increment"
172
+ data-action="click->stimeo--number-input#increment">+</button>
173
+ </div>
174
+ </form>
175
+ ```
176
+
177
+ Two things to know:
178
+
179
+ - **Events bubble from the part that dispatched them.** The receiver has to be an
180
+ ancestor. Anywhere else — a sibling, or a receiver nested *inside* the part that
181
+ dispatches — needs `@window`, because bubbling only ever goes up:
182
+ `stimeo--clipboard:copy@window->stimeo--toast#show`.
183
+ - **Do not say the same thing twice.** A toast's message slot is a `role="status"`
184
+ live region. Wiring the same result to the shared announcer as well
185
+ (`announce-copied-text`, …) reads it out twice. Pick one.
186
+
187
+ `stimeo check` verifies both halves of a wire: the controller and action on the
188
+ receiving side, and the event name on the emitting side.
189
+
190
+ ## Styling notes
191
+
192
+ ### `hidden` under a utility CSS layer
193
+
194
+ Controllers show and hide their own declared regions with the `hidden` attribute —
195
+ a listbox option filtered out, an "empty" row, the half of a label that does not
196
+ belong to the current state. `hidden` only carries `display: none` from the user-agent
197
+ stylesheet, so any rule that sets `display` wins over it.
198
+
199
+ Utility-first frameworks make that collision likely. Tailwind v4 declares
200
+ `@layer theme, base, components, utilities`, and DaisyUI puts component classes such
201
+ as `.menu li`, `.tabs`, and `.steps` in the **last** layer. A hidden element inside one
202
+ of them stays visible, and a `display: none` you add in `@layer components` still loses.
203
+
204
+ Put the override **outside every layer** — unlayered rules beat layered ones, so no
205
+ `!important` is needed:
206
+
207
+ ```css
208
+ /* not inside @layer */
209
+ .menu li[hidden],
210
+ .menu [role="option"][hidden] {
211
+ display: none;
212
+ }
213
+ ```
214
+
215
+ Most visible with `combobox`, `listbox`, `multi-select`, `empty-state`, `filter`, and
216
+ `command-palette`, whose options and empty rows are the ones being hidden.
217
+
218
+ ### State-dependent text belongs in markup
219
+
220
+ It is tempting to put the words that change with a state into CSS:
221
+
222
+ ```css
223
+ /* don't */
224
+ .play::after { content: "Auto-advance: off"; }
225
+ .play[aria-pressed="true"]::after { content: "Auto-advance: on"; }
226
+ ```
227
+
228
+ Text in `content` never reaches a translation catalogue, and the usual "find untranslated
229
+ strings" scan reads HTML, so it does not turn up there either. `content: attr(aria-valuetext)`
230
+ has the same problem from the other side: the attribute is composed at runtime in one
231
+ language. Keep the words in markup and let the controller show the half that applies:
232
+
233
+ ```html
234
+ <button data-stimeo--read-more-target="trigger" aria-expanded="false">
235
+ <span data-stimeo--read-more-target="collapsedLabel">Read more</span>
236
+ <span data-stimeo--read-more-target="expandedLabel" hidden>Show less</span>
237
+ </button>
238
+ ```
239
+
240
+ Controllers that read out a composed value take the wording as an attribute instead —
241
+ `color-picker` accepts `data-value-text`, and the announcing controllers accept
242
+ `announce-*-text`.
243
+
117
244
  ## Inspector CLI & MCP server
118
245
 
119
246
  Stimeo UI bundles a zero-dependency static checker for its own markup contract