@joralvmel/cosmos-core 0.2.0 → 0.4.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 (157) hide show
  1. package/dist/catalog.d.ts +3 -3
  2. package/dist/catalog.d.ts.map +1 -1
  3. package/dist/catalog.js +25 -6
  4. package/dist/catalog.js.map +1 -1
  5. package/dist/codegen.d.ts +16 -0
  6. package/dist/codegen.d.ts.map +1 -1
  7. package/dist/codegen.js +396 -57
  8. package/dist/codegen.js.map +1 -1
  9. package/dist/headless/calendar.d.ts +32 -0
  10. package/dist/headless/calendar.d.ts.map +1 -0
  11. package/dist/headless/calendar.js +242 -0
  12. package/dist/headless/calendar.js.map +1 -0
  13. package/dist/headless/listbox.d.ts +9 -0
  14. package/dist/headless/listbox.d.ts.map +1 -0
  15. package/dist/headless/listbox.js +103 -0
  16. package/dist/headless/listbox.js.map +1 -0
  17. package/dist/headless/pagination.d.ts +34 -0
  18. package/dist/headless/pagination.d.ts.map +1 -0
  19. package/dist/headless/pagination.js +92 -0
  20. package/dist/headless/pagination.js.map +1 -0
  21. package/dist/headless/radio-group.d.ts +10 -0
  22. package/dist/headless/radio-group.d.ts.map +1 -0
  23. package/dist/headless/radio-group.js +59 -0
  24. package/dist/headless/radio-group.js.map +1 -0
  25. package/dist/headless/select.d.ts +4 -0
  26. package/dist/headless/select.d.ts.map +1 -0
  27. package/dist/headless/select.js +7 -0
  28. package/dist/headless/select.js.map +1 -0
  29. package/dist/headless/size.d.ts +3 -0
  30. package/dist/headless/size.d.ts.map +1 -0
  31. package/dist/headless/size.js +7 -0
  32. package/dist/headless/size.js.map +1 -0
  33. package/dist/headless/text-field.d.ts +25 -0
  34. package/dist/headless/text-field.d.ts.map +1 -0
  35. package/dist/headless/text-field.js +12 -0
  36. package/dist/headless/text-field.js.map +1 -0
  37. package/dist/index.d.ts +1709 -19
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +60 -1
  40. package/dist/index.js.map +1 -1
  41. package/dist/markdown.d.ts.map +1 -1
  42. package/dist/markdown.js +7 -3
  43. package/dist/markdown.js.map +1 -1
  44. package/dist/specs/badge.d.ts +65 -0
  45. package/dist/specs/badge.d.ts.map +1 -0
  46. package/dist/specs/badge.js +64 -0
  47. package/dist/specs/badge.js.map +1 -0
  48. package/dist/specs/badge.scenarios.d.ts +21 -0
  49. package/dist/specs/badge.scenarios.d.ts.map +1 -0
  50. package/dist/specs/badge.scenarios.js +35 -0
  51. package/dist/specs/badge.scenarios.js.map +1 -0
  52. package/dist/specs/calendar.d.ts +120 -0
  53. package/dist/specs/calendar.d.ts.map +1 -0
  54. package/dist/specs/calendar.js +121 -0
  55. package/dist/specs/calendar.js.map +1 -0
  56. package/dist/specs/calendar.scenarios.d.ts +39 -0
  57. package/dist/specs/calendar.scenarios.d.ts.map +1 -0
  58. package/dist/specs/calendar.scenarios.js +139 -0
  59. package/dist/specs/calendar.scenarios.js.map +1 -0
  60. package/dist/specs/checkbox.d.ts +139 -0
  61. package/dist/specs/checkbox.d.ts.map +1 -0
  62. package/dist/specs/checkbox.js +129 -0
  63. package/dist/specs/checkbox.js.map +1 -0
  64. package/dist/specs/checkbox.scenarios.d.ts +28 -0
  65. package/dist/specs/checkbox.scenarios.d.ts.map +1 -0
  66. package/dist/specs/checkbox.scenarios.js +54 -0
  67. package/dist/specs/checkbox.scenarios.js.map +1 -0
  68. package/dist/specs/dialog.d.ts +167 -0
  69. package/dist/specs/dialog.d.ts.map +1 -0
  70. package/dist/specs/dialog.js +136 -0
  71. package/dist/specs/dialog.js.map +1 -0
  72. package/dist/specs/dialog.scenarios.d.ts +42 -0
  73. package/dist/specs/dialog.scenarios.d.ts.map +1 -0
  74. package/dist/specs/dialog.scenarios.js +129 -0
  75. package/dist/specs/dialog.scenarios.js.map +1 -0
  76. package/dist/specs/icon-button.d.ts +136 -0
  77. package/dist/specs/icon-button.d.ts.map +1 -0
  78. package/dist/specs/icon-button.js +119 -0
  79. package/dist/specs/icon-button.js.map +1 -0
  80. package/dist/specs/icon-button.scenarios.d.ts +28 -0
  81. package/dist/specs/icon-button.scenarios.d.ts.map +1 -0
  82. package/dist/specs/icon-button.scenarios.js +95 -0
  83. package/dist/specs/icon-button.scenarios.js.map +1 -0
  84. package/dist/specs/icon.d.ts +11 -20
  85. package/dist/specs/icon.d.ts.map +1 -1
  86. package/dist/specs/icon.js +11 -20
  87. package/dist/specs/icon.js.map +1 -1
  88. package/dist/specs/icon.scenarios.d.ts +9 -1
  89. package/dist/specs/icon.scenarios.d.ts.map +1 -1
  90. package/dist/specs/icon.scenarios.js +70 -6
  91. package/dist/specs/icon.scenarios.js.map +1 -1
  92. package/dist/specs/listbox.d.ts +157 -0
  93. package/dist/specs/listbox.d.ts.map +1 -0
  94. package/dist/specs/listbox.js +144 -0
  95. package/dist/specs/listbox.js.map +1 -0
  96. package/dist/specs/listbox.scenarios.d.ts +37 -0
  97. package/dist/specs/listbox.scenarios.d.ts.map +1 -0
  98. package/dist/specs/listbox.scenarios.js +110 -0
  99. package/dist/specs/listbox.scenarios.js.map +1 -0
  100. package/dist/specs/pagination.d.ts +147 -0
  101. package/dist/specs/pagination.d.ts.map +1 -0
  102. package/dist/specs/pagination.js +122 -0
  103. package/dist/specs/pagination.js.map +1 -0
  104. package/dist/specs/pagination.scenarios.d.ts +15 -0
  105. package/dist/specs/pagination.scenarios.d.ts.map +1 -0
  106. package/dist/specs/pagination.scenarios.js +29 -0
  107. package/dist/specs/pagination.scenarios.js.map +1 -0
  108. package/dist/specs/popover.d.ts +201 -0
  109. package/dist/specs/popover.d.ts.map +1 -0
  110. package/dist/specs/popover.js +169 -0
  111. package/dist/specs/popover.js.map +1 -0
  112. package/dist/specs/popover.scenarios.d.ts +83 -0
  113. package/dist/specs/popover.scenarios.d.ts.map +1 -0
  114. package/dist/specs/popover.scenarios.js +368 -0
  115. package/dist/specs/popover.scenarios.js.map +1 -0
  116. package/dist/specs/radio-group.d.ts +154 -0
  117. package/dist/specs/radio-group.d.ts.map +1 -0
  118. package/dist/specs/radio-group.js +133 -0
  119. package/dist/specs/radio-group.js.map +1 -0
  120. package/dist/specs/radio-group.scenarios.d.ts +35 -0
  121. package/dist/specs/radio-group.scenarios.d.ts.map +1 -0
  122. package/dist/specs/radio-group.scenarios.js +67 -0
  123. package/dist/specs/radio-group.scenarios.js.map +1 -0
  124. package/dist/specs/select.d.ts +167 -0
  125. package/dist/specs/select.d.ts.map +1 -0
  126. package/dist/specs/select.js +148 -0
  127. package/dist/specs/select.js.map +1 -0
  128. package/dist/specs/select.scenarios.d.ts +37 -0
  129. package/dist/specs/select.scenarios.d.ts.map +1 -0
  130. package/dist/specs/select.scenarios.js +77 -0
  131. package/dist/specs/select.scenarios.js.map +1 -0
  132. package/dist/specs/switch.d.ts +123 -0
  133. package/dist/specs/switch.d.ts.map +1 -0
  134. package/dist/specs/switch.js +113 -0
  135. package/dist/specs/switch.js.map +1 -0
  136. package/dist/specs/switch.scenarios.d.ts +27 -0
  137. package/dist/specs/switch.scenarios.d.ts.map +1 -0
  138. package/dist/specs/switch.scenarios.js +54 -0
  139. package/dist/specs/switch.scenarios.js.map +1 -0
  140. package/dist/specs/text-field.d.ts +232 -0
  141. package/dist/specs/text-field.d.ts.map +1 -0
  142. package/dist/specs/text-field.js +220 -0
  143. package/dist/specs/text-field.js.map +1 -0
  144. package/dist/specs/text-field.scenarios.d.ts +52 -0
  145. package/dist/specs/text-field.scenarios.d.ts.map +1 -0
  146. package/dist/specs/text-field.scenarios.js +106 -0
  147. package/dist/specs/text-field.scenarios.js.map +1 -0
  148. package/dist/specs/textarea.d.ts +144 -0
  149. package/dist/specs/textarea.d.ts.map +1 -0
  150. package/dist/specs/textarea.js +134 -0
  151. package/dist/specs/textarea.js.map +1 -0
  152. package/dist/specs/textarea.scenarios.d.ts +33 -0
  153. package/dist/specs/textarea.scenarios.d.ts.map +1 -0
  154. package/dist/specs/textarea.scenarios.js +82 -0
  155. package/dist/specs/textarea.scenarios.js.map +1 -0
  156. package/llms.md +797 -6
  157. package/package.json +1 -1
package/llms.md CHANGED
@@ -67,17 +67,15 @@ Triggers an action or submits a form.
67
67
 
68
68
  ### `icon` (`<cosm-icon>`)
69
69
 
70
- Renders a structured SVG icon. Decorative icons are hidden from assistive technology; informative icons require a text label.
70
+ Renders a structured SVG icon. Icons are decorative and hidden from assistive technology unless a nonempty label makes them informative.
71
71
 
72
72
  | Prop | Type | Default | Description |
73
73
  | --- | --- | --- | --- |
74
74
  | `icon` | IconDefinition | Required | Structured icon definition, commonly imported from @joralvmel/cosmos-icons. |
75
75
  | `size` | 'sm' \| 'md' \| 'lg' \| number | `md` | Semantic size (16, 20 or 24) or a positive finite number in pixels / native units. |
76
- | `stroke` | string | `currentColor` | Stroke paint; currentColor inherits on web and resolves to the theme foreground on native. |
77
- | `fill` | string | `none` | Root fill paint. Explicit node fills take precedence. |
78
- | `strokeWidth` | number | `2` | Finite nonnegative stroke width in SVG viewBox units. |
79
- | `label` | string | — | Accessible name required when decorative is false. |
80
- | `decorative` | boolean | `true` | Hides the icon from assistive technology when true. |
76
+ | `variant` | 'outline' \| 'filled' | `outline` | Appearance. outline draws only the stroke; filled also fills the shapes with the icon color (for example a favorite star or heart). Explicit node fills in the definition always win. |
77
+ | `color` | string | `currentColor` | Icon color (stroke, currentColor fills and the filled variant). currentColor inherits the surrounding text color on web and the parent control or theme foreground on native; otherwise a supported color without URLs. |
78
+ | `label` | string | — | Accessible name. A nonempty label makes the icon an informative image; without one the icon is decorative and hidden from assistive technology. |
81
79
 
82
80
  **Events**
83
81
 
@@ -95,6 +93,799 @@ No events.
95
93
  | --- | --- |
96
94
  | `--cosm-icon-size` | Override the rendered icon width and height. |
97
95
 
96
+ ### `text-field` (`<cosm-text-field>`)
97
+
98
+ Accepts a single line of text with an accessible label, optional helper and error text, and native form validation on the web.
99
+
100
+ | Prop | Type | Default | Description |
101
+ | --- | --- | --- | --- |
102
+ | `label` | string | Required | Accessible name for the editable control. It is rendered above the control unless visually hidden. |
103
+ | `labelHidden` | boolean | `false` | Visually hides the label while keeping it available to assistive technology. |
104
+ | `value` | string | — | Current text. When bound, edits are proposals and the component waits for the owner to supply the accepted value. |
105
+ | `defaultValue` | string | `` | Initial value for autonomous use. Web form reset restores this value; it does not control subsequent edits. |
106
+ | `type` | 'text' \| 'email' \| 'password' \| 'tel' \| 'url' \| 'search' | `text` | Single-line input type. Native maps it to supported keyboard, autofill and secure-entry behavior. |
107
+ | `variant` | 'outlined' \| 'filled' | `outlined` | Visual treatment of the editable control. |
108
+ | `size` | 'sm' \| 'md' \| 'lg' | `md` | Small, medium or large editable control. |
109
+ | `placeholder` | string | — | Short input hint; it never replaces the accessible label. |
110
+ | `helperText` | string | — | Optional supporting text associated with the editable control. |
111
+ | `errorText` | string | — | Optional consumer-localized error text associated with the editable control; a nonempty trimmed value also exposes invalid state. |
112
+ | `invalid` | boolean | `false` | External invalid state when the visible error is supplied elsewhere, independent of browser constraints or consumer business validation. |
113
+ | `required` | boolean | `false` | Exposes required semantics. On web, participates in native HTML constraint validation. |
114
+ | `disabled` | boolean | `false` | Disables editing and interaction. On web, follows disabled fieldsets and excludes the value from form submission. |
115
+ | `readOnly` | boolean | `false` | Prevents editing while remaining focusable and form-submittable on web; distinct from disabled. |
116
+ | `minLength` | number | — | Minimum number of characters. Web uses native HTML validity; native business validation remains the consumer’s responsibility. |
117
+ | `maxLength` | number | — | Maximum number of characters. Web uses native HTML validity and native applies supported input limits. |
118
+ | `pattern` | string | — | Web-only HTML pattern constraint. Native does not emulate HTML regular-expression validation. |
119
+ | `name` | string | — | Form field name on web. React Native has no HTML form association or name-based submission. |
120
+ | `autoComplete` | string | — | Consumer-provided completion/autofill hint, mapped to attributes supported by each platform. |
121
+ | `inputMode` | 'none' \| 'text' \| 'decimal' \| 'numeric' \| 'tel' \| 'search' \| 'email' \| 'url' | — | Input or keyboard hint (none, text, decimal, numeric, tel, search, email or url); it does not add numeric or multiline field behavior. |
122
+ | `startIcon` | IconDefinition | — | Optional structured decorative icon before the editable text. |
123
+ | `endIcon` | IconDefinition | — | Optional structured decorative icon after the editable text. |
124
+ | `prefix` | string | — | Optional non-interactive text decoration before the editable text. |
125
+ | `suffix` | string | — | Optional non-interactive text decoration after the editable text. |
126
+ | `clearable` | boolean | `false` | Shows a clear action for non-empty editable fields. Supply clearLabel when enabled. |
127
+ | `clearLabel` | string | — | Consumer-supplied localized accessible name for the clear action. |
128
+ | `passwordReveal` | boolean | `false` | Opts into a reveal action for password fields. Supply both revealPasswordLabel and hidePasswordLabel when enabled. |
129
+ | `revealPasswordLabel` | string | — | Consumer-supplied localized accessible name while the password is concealed. |
130
+ | `hidePasswordLabel` | string | — | Consumer-supplied localized accessible name while the password is revealed. |
131
+
132
+ **Events**
133
+
134
+ | DOM | React | Angular | React Native | Detail | Description |
135
+ | --- | --- | --- | --- | --- | --- |
136
+ | `cosm-change` | `onChange` | `(valueChange)` | `onValueChange` | `TextFieldChangeDetail` | Proposes the current text after each user edit, including clear; this is not a blur/commit event. |
137
+ | `cosm-submit` | `onSubmit` | `(submit)` | `onSubmitEditing` | `TextFieldSubmitDetail` | Reports the current text when the user invokes the field submit action (Enter/return). |
138
+
139
+ **CSS parts**
140
+
141
+ | Name | Description |
142
+ | --- | --- |
143
+ | `label` | Accessible label above the control. |
144
+ | `control` | Visual control containing the editable input and decorations. |
145
+ | `input` | The single-line editable input. |
146
+ | `start` | Start icon or prefix decoration. |
147
+ | `end` | End icon, suffix decoration or clear/reveal action. |
148
+ | `help` | Supporting text associated with the editable input. |
149
+ | `error` | External or native-validity error text associated with the editable input. |
150
+ | `clear-button` | Optional accessible clear action. |
151
+ | `reveal-button` | Optional accessible password visibility action. |
152
+
153
+ **CSS custom properties**
154
+
155
+ | Name | Description |
156
+ | --- | --- |
157
+ | `--cosm-text-field-background` | Editable control background. |
158
+ | `--cosm-text-field-color` | Editable and decoration text color. |
159
+ | `--cosm-text-field-placeholder` | Placeholder text color. |
160
+ | `--cosm-text-field-border` | Editable control boundary color. |
161
+ | `--cosm-text-field-focus` | Visible focus indicator color. |
162
+ | `--cosm-text-field-radius` | Editable control corner radius. |
163
+ | `--cosm-text-field-start-icon-color` | Start icon color, independent of text and affixes. |
164
+ | `--cosm-text-field-end-icon-color` | End icon color, independent of text and affixes. |
165
+
166
+ **Keyboard**
167
+
168
+ | Keys | Action |
169
+ | --- | --- |
170
+ | `Tab`, `Shift+Tab` | Moves focus to or from the enabled editable control. |
171
+ | `Enter` | Invokes the submit action; web form behavior remains native. |
172
+
173
+ ### `icon-button` (`<cosm-icon-button>`)
174
+
175
+ Activates an action or toggles a boolean state using a labeled icon.
176
+
177
+ | Prop | Type | Default | Description |
178
+ | --- | --- | --- | --- |
179
+ | `label` | string | Required | Required localized accessible name. Missing, empty or whitespace-only labels are rejected. |
180
+ | `mode` | 'action' \| 'toggle' | `action` | Action activates without toggle state; toggle exposes and changes pressed state. |
181
+ | `variant` | 'solid' \| 'soft' \| 'outline' \| 'ghost' | `solid` | Visual emphasis, from highest (solid) to lowest (ghost). |
182
+ | `tone` | 'primary' \| 'neutral' \| 'danger' | `primary` | Color role. Use danger for destructive actions. |
183
+ | `size` | 'sm' \| 'md' \| 'lg' | `md` | Size of the square visual control. |
184
+ | `disabled` | boolean | `false` | Prevents activation and removes the web button from the tab order. |
185
+ | `type` | 'button' \| 'submit' \| 'reset' | `button` | Native web button form behavior. |
186
+ | `pressed` | boolean | `false` | Toggle state. If supplied, including false, activation proposes changes without committing them until the owner updates this prop. |
187
+ | `defaultPressed` | boolean | `false` | Initial toggle state when pressed is not supplied; it does not control later changes. |
188
+
189
+ **Events**
190
+
191
+ | DOM | React | Angular | React Native | Detail | Description |
192
+ | --- | --- | --- | --- | --- | --- |
193
+ | `cosm-press` | `onPress` | `(press)` | `onPress` | `IconButtonPressDetail` | Reports each enabled activation by pointer, keyboard or programmatically. |
194
+ | `cosm-pressed-change` | `onPressedChange` | `(pressedChange)` | `onPressedChange` | `IconButtonPressedChangeDetail` | Reports the proposed next pressed state on toggle activation; controlled state waits for the owner. |
195
+
196
+ **Slots**
197
+
198
+ | Name | Description |
199
+ | --- | --- |
200
+ | `(default)` | Decorative icon content; the label supplies the accessible name. |
201
+
202
+ **CSS parts**
203
+
204
+ | Name | Description |
205
+ | --- | --- |
206
+ | `base` | The native button element. |
207
+
208
+ **CSS custom properties**
209
+
210
+ | Name | Description |
211
+ | --- | --- |
212
+ | `--cosm-icon-button-background` | Control background. |
213
+ | `--cosm-icon-button-color` | Icon foreground color. |
214
+ | `--cosm-icon-button-border` | Control border color. |
215
+ | `--cosm-icon-button-radius` | Control corner radius. |
216
+ | `--cosm-icon-button-focus` | Visible focus indicator color. |
217
+
218
+ **Keyboard**
219
+
220
+ | Keys | Action |
221
+ | --- | --- |
222
+ | `Tab`, `Shift+Tab` | Moves focus to or from the enabled button. |
223
+ | `Enter`, `Space` | Activates the button; toggle mode also proposes a change. |
224
+
225
+ ### `popover` (`<cosm-popover>`)
226
+
227
+ Non-modal content anchored to a consumer trigger, with cancelable close requests and no imposed panel semantics.
228
+
229
+ | Prop | Type | Default | Description |
230
+ | --- | --- | --- | --- |
231
+ | `open` | boolean | `false` | Committed visibility. Supplying this prop, including false, controls state; its metadata default does not establish a binding. |
232
+ | `defaultOpen` | boolean | `false` | Initial autonomous visibility only; ignored when open is supplied. Later updates do not reset state. |
233
+ | `triggerMode` | 'press' \| 'hover' | `press` | Hover adds pointer and keyboard-focus opening on web and React Native Web, while keeping press activation. Android/iOS use press. Does not change panel semantics. |
234
+ | `closable` | boolean | `false` | Shows a built-in IconButton with an X. Requests a cancelable close with reason close-button. |
235
+ | `closeLabel` | string | `Close` | Localized accessible name of the close button. Must be non-empty when closable is true. |
236
+ | `arrow` | boolean | `false` | Shows a decorative triangular pointer (16 wide, 8 deep), following the actual side, panel background and border. Hidden if it cannot point to the trigger without crossing a corner or viewport edge. |
237
+ | `closeOnEscape` | boolean | `true` | Requests closure on unhandled Escape on web and React Native Web. Native Android and iOS hardware Escape is not supported. |
238
+ | `closeOnOutsidePress` | boolean | `true` | Requests closure on an outside press without preventing its interaction or restoring trigger focus. |
239
+ | `side` | 'top' \| 'right' \| 'bottom' \| 'left' | `bottom` | Requested physical side; actual placement flips to the opposite side when that reduces viewport/safe-area overflow, then shifts within bounds. |
240
+ | `align` | 'start' \| 'center' \| 'end' | `center` | Cross-axis alignment. On top/bottom, start/end follow inline direction (RTL reverses them); on left/right they mean top/bottom. |
241
+
242
+ **Events**
243
+
244
+ | DOM | React | Angular | React Native | Detail | Description |
245
+ | --- | --- | --- | --- | --- | --- |
246
+ | `cosm-open-change` | `onOpenChange` | `(openChange)` | `onOpenChange` | `PopoverOpenChangeDetail` | Proposes visibility changes by trigger, hover or focus, or closure by Escape, outside press, panel action, close button or Android Back. Closing only is cancelable, synchronously via the web event or detail.preventDefault(); native uses detail.preventDefault(). Not a committed-state notification. (cancelable) |
247
+
248
+ **Slots**
249
+
250
+ | Name | Description |
251
+ | --- | --- |
252
+ | `trigger` | Consumer-supplied accessible trigger; its appearance and label belong to the consumer. Native accepts content or a render function receiving onPress, ref and accessibilityState for composing an IconButton without nested buttons. |
253
+ | `(default)` | Consumer-supplied panel content and semantics. Native maps this content to children. |
254
+
255
+ **CSS parts**
256
+
257
+ | Name | Description |
258
+ | --- | --- |
259
+ | `trigger` | Trigger container. |
260
+ | `panel` | Non-modal anchored surface. |
261
+ | `body` | Scrollable consumer content. |
262
+ | `close` | Optional close IconButton. |
263
+ | `arrow` | Decorative pointer; follows panel colors. |
264
+
265
+ **CSS custom properties**
266
+
267
+ | Name | Description |
268
+ | --- | --- |
269
+ | `--cosm-popover-z-index` | Panel stacking level. |
270
+ | `--cosm-popover-padding` | Panel padding. |
271
+ | `--cosm-popover-radius` | Panel corner radius. |
272
+ | `--cosm-popover-shadow` | Panel shadow. |
273
+
274
+ **Keyboard**
275
+
276
+ | Keys | Action |
277
+ | --- | --- |
278
+ | `Enter`, `Space` | The focused trigger activates once and toggles open. |
279
+ | `Escape` | On web and React Native Web, requests close when open and closeOnEscape is true, unless a child already handled the key. |
280
+ | `Tab`, `Shift+Tab` | Moves focus normally without a focus trap or automatic dismissal. |
281
+ | `Android Back` | Requests close while open on Android only. |
282
+
283
+ ### `listbox` (`<cosm-listbox>`)
284
+
285
+ Selects one or more values from a named vertical collection, with groups, descriptions, icons and independent keyboard focus.
286
+
287
+ | Prop | Type | Default | Description |
288
+ | --- | --- | --- | --- |
289
+ | `label` | string | Required | Required nonempty accessible label, visible unless labelHidden is true. |
290
+ | `labelHidden` | boolean | `false` | Visually hides the label without removing its accessible name. |
291
+ | `items` | ListboxItems | Required | Readonly collection of options or named groups. Options have globally unique nonempty value and label strings, optional description, decorative IconDefinition and disabled. Groups have a nonempty label and options array. |
292
+ | `selectionMode` | 'single' \| 'multiple' | `single` | Single permits at most one selected value; multiple toggles each activation. |
293
+ | `selectedValues` | ListboxValues | — | Controlled selected values, including an empty array. Activation only proposes changes until the owner updates this prop. Missing collection values are retained, not automatically selected or removed. |
294
+ | `defaultSelectedValues` | ListboxValues | — | Initial autonomous selected values (empty by default). Later changes do not reset selection. |
295
+ | `variant` | 'plain' \| 'outlined' | `plain` | Plain composes inside a panel; outlined adds a standalone container boundary. |
296
+ | `size` | 'sm' \| 'md' \| 'lg' | `md` | Small, medium or large option rows. Content may grow; native touch targets remain at least 44. |
297
+ | `disabled` | boolean | `false` | Prevents interaction and removes the list from keyboard navigation. |
298
+ | `readOnly` | boolean | `false` | Allows exploring options without proposing or committing selection changes. |
299
+ | `locale` | string | — | BCP 47 locale for typeahead. Web inherits the nearest language; native uses the runtime locale when omitted. Invalid locale identifiers are rejected. |
300
+
301
+ **Events**
302
+
303
+ | DOM | React | Angular | React Native | Detail | Description |
304
+ | --- | --- | --- | --- | --- | --- |
305
+ | `cosm-selection-change` | `onSelectionChange` | `(selectionChange)` | `onSelectionChange` | `ListboxSelectionChangeDetail` | Proposes the next selectedValues for an enabled activation. Autonomous selection commits; controlled selection waits for the owner. Arrows and typeahead never select. |
306
+
307
+ **CSS parts**
308
+
309
+ | Name | Description |
310
+ | --- | --- |
311
+ | `base` | Outer container. |
312
+ | `label` | Visible or visually hidden accessible label. |
313
+ | `list` | Scrollable listbox. |
314
+ | `group` | Named option group. |
315
+ | `group-label` | Noninteractive group heading. |
316
+ | `option` | Selectable row; selected, disabled and active states are exposed on the row. |
317
+ | `icon` | Decorative option icon. |
318
+ | `content` | Text content wrapper. |
319
+ | `option-label` | Primary option text. |
320
+ | `description` | Optional supporting text. |
321
+ | `indicator` | Decorative selected-state indicator. |
322
+
323
+ **CSS custom properties**
324
+
325
+ | Name | Description |
326
+ | --- | --- |
327
+ | `--cosm-listbox-background` | Container background. |
328
+ | `--cosm-listbox-color` | Primary foreground. |
329
+ | `--cosm-listbox-border` | Outlined container border color. |
330
+ | `--cosm-listbox-radius` | Container and option corner radius. |
331
+ | `--cosm-listbox-option-height` | Minimum option height. |
332
+ | `--cosm-listbox-option-padding` | Option padding. |
333
+ | `--cosm-listbox-gap` | Space between icon, content and selection indicator. |
334
+ | `--cosm-listbox-font-size` | Primary option text size. |
335
+ | `--cosm-listbox-description-color` | Supporting text color. |
336
+ | `--cosm-listbox-selected-background` | Selected option background. |
337
+ | `--cosm-listbox-selected-color` | Selected option foreground. |
338
+ | `--cosm-listbox-focus` | Visible keyboard focus outline color. |
339
+ | `--cosm-listbox-max-height` | Maximum scrollable list height. |
340
+
341
+ **Keyboard**
342
+
343
+ | Keys | Action |
344
+ | --- | --- |
345
+ | `Tab`, `Shift+Tab` | Enters or leaves the list as one Tab stop. |
346
+ | `ArrowDown`, `ArrowUp`, `Home`, `End` | Moves focus among enabled options without changing selection; stops at the ends. |
347
+ | `Enter`, `Space` | Selects the focused option; multiple mode toggles it. Read-only never changes selection. |
348
+ | `Printable characters` | Moves focus to a matching option using locale-aware typeahead without filtering. |
349
+
350
+ ### `checkbox` (`<cosm-checkbox>`)
351
+
352
+ Selects an independent boolean value with accessible labeling and native form behavior on the web.
353
+
354
+ | Prop | Type | Default | Description |
355
+ | --- | --- | --- | --- |
356
+ | `label` | string | Required | Required accessible name, visible unless labelHidden is true. |
357
+ | `labelHidden` | boolean | `false` | Visually hides the label while keeping it available to assistive technology. |
358
+ | `checked` | boolean | `false` | Controlled checked value when supplied, including false; activation proposes changes without self-committing. |
359
+ | `defaultChecked` | boolean | `false` | Initial autonomous checked value; later changes do not reset it. |
360
+ | `indeterminate` | boolean | `false` | Presentation-only mixed state. Autonomous activation clears it; controlled use leaves it to the owner. |
361
+ | `size` | 'sm' \| 'md' \| 'lg' | `md` | Small, medium or large visual box. |
362
+ | `disabled` | boolean | `false` | Prevents user interaction and excludes the value from web form submission. |
363
+ | `required` | boolean | `false` | Exposes required semantics and participates in native web form validation. Native has no automatic validation. |
364
+ | `invalid` | boolean | `false` | Externally supplied invalid presentation state when the visible error is supplied elsewhere; web form validity remains based on required. |
365
+ | `helperText` | string | — | Optional consumer-localized supporting text associated with the checkbox. |
366
+ | `errorText` | string | — | Optional consumer-localized error description; a nonempty trimmed value also exposes invalid state. |
367
+ | `name` | string | — | Web form field name; React Native has no HTML form association. |
368
+ | `value` | string | `on` | Web form value submitted when checked and enabled; defaults to on. Angular Forms uses checked as its boolean value. |
369
+
370
+ **Events**
371
+
372
+ | DOM | React | Angular | React Native | Detail | Description |
373
+ | --- | --- | --- | --- | --- | --- |
374
+ | `cosm-checked-change` | `onCheckedChange` | `(checkedChange)` | `onCheckedChange` | `CheckboxCheckedChangeDetail` | Proposes the next checked value after enabled user activation; controlled state waits for the owner. |
375
+
376
+ **Slots**
377
+
378
+ | Name | Description |
379
+ | --- | --- |
380
+ | `(default)` | Optional noninteractive inline label content; links and buttons are not allowed. |
381
+
382
+ **CSS parts**
383
+
384
+ | Name | Description |
385
+ | --- | --- |
386
+ | `base` | The label and visual checkbox control. |
387
+ | `input` | The native checkbox input and web focus target. |
388
+ | `box` | The visible checkbox box and indicator. |
389
+ | `label` | Visible or visually hidden label text. |
390
+ | `help-text` | Supporting text associated with the checkbox. |
391
+ | `error-text` | Error description associated with the checkbox. |
392
+
393
+ **CSS custom properties**
394
+
395
+ | Name | Description |
396
+ | --- | --- |
397
+ | `--cosm-checkbox-size` | Visual box width and height. |
398
+ | `--cosm-checkbox-background` | Unchecked box background. |
399
+ | `--cosm-checkbox-checked-background` | Checked and mixed box background. |
400
+ | `--cosm-checkbox-color` | Checked indicator foreground. |
401
+ | `--cosm-checkbox-border` | Box boundary color. |
402
+ | `--cosm-checkbox-radius` | Box corner radius. |
403
+ | `--cosm-checkbox-focus` | Visible keyboard focus indicator color. |
404
+ | `--cosm-checkbox-gap` | Space between the box and label. |
405
+
406
+ **Keyboard**
407
+
408
+ | Keys | Action |
409
+ | --- | --- |
410
+ | `Tab`, `Shift+Tab` | Moves focus to or from the enabled checkbox. |
411
+ | `Space` | Toggles checked state and emits a checkedChange proposal. |
412
+
413
+ ### `switch` (`<cosm-switch>`)
414
+
415
+ Toggles a binary setting immediately with a stable accessible name and form behavior on the web.
416
+
417
+ | Prop | Type | Default | Description |
418
+ | --- | --- | --- | --- |
419
+ | `label` | string | Required | Required nonempty accessible name; remains stable in both states. |
420
+ | `labelHidden` | boolean | `false` | Visually hides the label while retaining its accessible name. |
421
+ | `checked` | boolean | `false` | Controlled checked value when supplied, including false; activation proposes changes without self-committing. |
422
+ | `defaultChecked` | boolean | `false` | Initial autonomous checked value; later changes do not reset it. |
423
+ | `size` | 'sm' \| 'md' \| 'lg' | `md` | Small, medium or large web switch. Native uses system Switch sizing. |
424
+ | `disabled` | boolean | `false` | Prevents user interaction and excludes the value from web form submission. |
425
+ | `invalid` | boolean | `false` | Externally supplied invalid presentation. Does not change checked state or form validity; native uses danger colors without an equivalent system invalid trait. |
426
+ | `helperText` | string | — | Optional consumer-localized supporting text associated with the switch. |
427
+ | `name` | string | — | Web form field name; React Native has no HTML form association. |
428
+ | `value` | string | `on` | Web form value submitted when checked and enabled; defaults to on. Angular Forms uses checked as its boolean value. |
429
+
430
+ **Events**
431
+
432
+ | DOM | React | Angular | React Native | Detail | Description |
433
+ | --- | --- | --- | --- | --- | --- |
434
+ | `cosm-checked-change` | `onCheckedChange` | `(checkedChange)` | `onCheckedChange` | `SwitchCheckedChangeDetail` | Proposes the next checked value after enabled user activation; controlled state waits for the owner. |
435
+
436
+ **CSS parts**
437
+
438
+ | Name | Description |
439
+ | --- | --- |
440
+ | `base` | Label, control and supporting text layout. |
441
+ | `input` | Native checkbox input and web focus target. |
442
+ | `track` | Visible switch track. |
443
+ | `thumb` | Visible switch thumb. |
444
+ | `label` | Visible or visually hidden label text. |
445
+ | `help-text` | Supporting text associated with the switch. |
446
+
447
+ **CSS custom properties**
448
+
449
+ | Name | Description |
450
+ | --- | --- |
451
+ | `--cosm-switch-width` | Track width. |
452
+ | `--cosm-switch-height` | Track height. |
453
+ | `--cosm-switch-thumb-size` | Thumb diameter. |
454
+ | `--cosm-switch-track-background` | Unchecked track background. |
455
+ | `--cosm-switch-checked-track-background` | Checked track background. |
456
+ | `--cosm-switch-thumb-background` | Thumb background. |
457
+ | `--cosm-switch-border` | Unchecked track boundary color. |
458
+ | `--cosm-switch-radius` | Track corner radius. |
459
+ | `--cosm-switch-gap` | Space between the switch and label. |
460
+ | `--cosm-switch-focus` | Visible keyboard focus indicator color. |
461
+
462
+ **Keyboard**
463
+
464
+ | Keys | Action |
465
+ | --- | --- |
466
+ | `Tab`, `Shift+Tab` | Moves focus to or from the enabled switch. |
467
+ | `Space` | Toggles checked state and emits a checkedChange proposal. |
468
+
469
+ ### `badge` (`<cosm-badge>`)
470
+
471
+ Displays a noninteractive status or category label, or caller-formatted count, with an optional decorative leading icon.
472
+
473
+ | Prop | Type | Default | Description |
474
+ | --- | --- | --- | --- |
475
+ | `variant` | 'soft' \| 'solid' \| 'outline' | `soft` | Visual treatment of the static label. |
476
+ | `tone` | 'neutral' \| 'info' \| 'success' \| 'warning' \| 'danger' | `neutral` | Semantic color intent of the static label. |
477
+ | `size` | 'sm' \| 'md' \| 'lg' | `md` | Semantic label size. |
478
+ | `startIcon` | IconDefinition | — | Optional structured decorative icon before the label. |
479
+
480
+ **Events**
481
+
482
+ No events.
483
+
484
+ **Slots**
485
+
486
+ | Name | Description |
487
+ | --- | --- |
488
+ | `(default)` | Label or caller-formatted count text. |
489
+
490
+ **CSS parts**
491
+
492
+ | Name | Description |
493
+ | --- | --- |
494
+ | `base` | Rounded label container. |
495
+ | `label` | Label or caller-formatted count text. |
496
+ | `icon` | Optional decorative leading icon wrapper. |
497
+
498
+ **CSS custom properties**
499
+
500
+ | Name | Description |
501
+ | --- | --- |
502
+ | `--cosm-badge-background` | Badge background color. |
503
+ | `--cosm-badge-color` | Badge text and icon color. |
504
+ | `--cosm-badge-border` | Badge border color. |
505
+ | `--cosm-badge-padding-inline` | Badge inline padding. |
506
+ | `--cosm-badge-padding-block` | Badge block padding. |
507
+ | `--cosm-badge-gap` | Space between the icon and label. |
508
+ | `--cosm-badge-font-family` | Badge label font family. |
509
+ | `--cosm-badge-font-size` | Badge label font size. |
510
+ | `--cosm-badge-font-weight` | Badge label font weight. |
511
+ | `--cosm-badge-line-height` | Badge label line height. |
512
+ | `--cosm-badge-radius` | Badge corner radius. |
513
+
514
+ ### `calendar` (`<cosm-calendar>`)
515
+
516
+ Selects one Gregorian date from an inline, localized calendar with keyboard navigation and optional bounds. Month and year can be selected directly.
517
+
518
+ | Prop | Type | Default | Description |
519
+ | --- | --- | --- | --- |
520
+ | `value` | string | — | Controlled selected date in YYYY-MM-DD format; when supplied, selection proposals wait for the owner to update this value. |
521
+ | `defaultValue` | string | — | Initial autonomous selected date in YYYY-MM-DD format; later changes do not reset selection. |
522
+ | `min` | string | — | Earliest selectable date in YYYY-MM-DD format, inclusive. |
523
+ | `max` | string | — | Latest selectable date in YYYY-MM-DD format, inclusive. |
524
+ | `locale` | string | — | BCP 47 locale for month and weekday names, week start, and text direction; defaults to the environment locale. Invalid locale identifiers are rejected. |
525
+ | `disabled` | boolean | `false` | Disables date selection and calendar navigation. |
526
+
527
+ **Events**
528
+
529
+ | DOM | React | Angular | React Native | Detail | Description |
530
+ | --- | --- | --- | --- | --- | --- |
531
+ | `cosm-change` | `onChange` | `(valueChange)` | `onValueChange` | `CalendarChangeDetail` | Proposes an enabled selected date as a YYYY-MM-DD value; autonomous selection commits and controlled selection waits for the owner. |
532
+
533
+ **CSS parts**
534
+
535
+ | Name | Description |
536
+ | --- | --- |
537
+ | `base` | Calendar root. |
538
+ | `header` | Month heading and navigation controls. |
539
+ | `previous` | Previous-month navigation button. |
540
+ | `heading` | Localized month and year heading. |
541
+ | `next` | Next-month navigation button. |
542
+ | `weekday` | Localized weekday heading. |
543
+ | `grid` | Seven-column date grid. |
544
+ | `day` | Date button, including adjacent-month dates. |
545
+ | `month-trigger` | Button that opens direct month selection. |
546
+ | `year-trigger` | Button that opens direct year selection. |
547
+ | `month-option` | Month choice in the month selection view. |
548
+ | `year-option` | Year choice in the year selection view. |
549
+
550
+ **CSS custom properties**
551
+
552
+ | Name | Description |
553
+ | --- | --- |
554
+ | `--cosm-calendar-background` | Calendar surface background. |
555
+ | `--cosm-calendar-color` | Primary calendar text color. |
556
+ | `--cosm-calendar-muted-color` | Adjacent-month and weekday text color. |
557
+ | `--cosm-calendar-selected-background` | Selected-date background. |
558
+ | `--cosm-calendar-selected-color` | Selected-date text color. |
559
+ | `--cosm-calendar-day-size` | Minimum date target dimensions. |
560
+ | `--cosm-calendar-gap` | Space between date targets. |
561
+ | `--cosm-calendar-radius` | Date target corner radius. |
562
+ | `--cosm-calendar-focus` | Visible keyboard focus indicator color. |
563
+ | `--cosm-calendar-today-border` | Non-color-only today marker. |
564
+
565
+ **Keyboard**
566
+
567
+ | Keys | Action |
568
+ | --- | --- |
569
+ | `Tab`, `Shift+Tab` | Moves between the navigation controls and one active date. |
570
+ | `ArrowLeft`, `ArrowRight` | Moves the active date by one day; direction follows the visual RTL/LTR order. |
571
+ | `ArrowUp`, `ArrowDown` | Moves the active date by one week. |
572
+ | `Home`, `End` | Moves to the first or last day of the localized week. |
573
+ | `PageUp`, `PageDown` | Moves the active date by one month. |
574
+ | `Shift+PageUp`, `Shift+PageDown` | Moves the active date by one year. |
575
+ | `Enter`, `Space` | Proposes selection of the active enabled date. |
576
+
577
+ ### `textarea` (`<cosm-textarea>`)
578
+
579
+ Accepts multiline plain text with an accessible label, optional helper and error text, and native form behavior on the web.
580
+
581
+ | Prop | Type | Default | Description |
582
+ | --- | --- | --- | --- |
583
+ | `label` | string | Required | Accessible name for the editable control. It is rendered above the control unless visually hidden. |
584
+ | `labelHidden` | boolean | `false` | Visually hides the label while keeping it available to assistive technology. |
585
+ | `value` | string | — | Current text. When bound, edits are proposals and the component waits for the owner to supply the accepted value. |
586
+ | `defaultValue` | string | `` | Initial value for autonomous use. Web form reset restores this value; it does not control subsequent edits. |
587
+ | `rows` | number | `4` | Visible line count of the multiline editor. It is independent of the visual size. |
588
+ | `variant` | 'outlined' \| 'filled' | `outlined` | Visual treatment of the editable control. |
589
+ | `size` | 'sm' \| 'md' \| 'lg' | `md` | Visual size of the editable control, independent of rows. |
590
+ | `placeholder` | string | — | Short input hint; it never replaces the accessible label. |
591
+ | `helperText` | string | — | Optional supporting text associated with the editable control. |
592
+ | `errorText` | string | — | Optional consumer-localized error text associated with the editable control; a nonempty trimmed value also exposes invalid state. |
593
+ | `invalid` | boolean | `false` | External invalid state when the visible error is supplied elsewhere, independent of browser constraints or consumer business validation. |
594
+ | `required` | boolean | `false` | Exposes required semantics. On web, participates in native HTML constraint validation. |
595
+ | `disabled` | boolean | `false` | Disables editing and interaction. On web, follows disabled fieldsets and excludes the value from form submission. |
596
+ | `readOnly` | boolean | `false` | Prevents editing while remaining focusable and form-submittable on web; distinct from disabled. |
597
+ | `maxLength` | number | — | Maximum number of characters. Web uses native HTML length constraints and native applies supported input limits. |
598
+ | `name` | string | — | Form field name on web. React Native has no HTML form association or name-based submission. |
599
+
600
+ **Events**
601
+
602
+ | DOM | React | Angular | React Native | Detail | Description |
603
+ | --- | --- | --- | --- | --- | --- |
604
+ | `cosm-change` | `onChange` | `(valueChange)` | `onValueChange` | `TextareaChangeDetail` | Proposes the current text after each user edit; this is not a blur/commit event. |
605
+
606
+ **CSS parts**
607
+
608
+ | Name | Description |
609
+ | --- | --- |
610
+ | `label` | Accessible label above the control. |
611
+ | `control` | Visual control containing the editable textarea. |
612
+ | `textarea` | The native multiline editable textarea. |
613
+ | `help` | Supporting text associated with the editable textarea. |
614
+ | `error` | External or native-constraint error text associated with the editable textarea. |
615
+
616
+ **CSS custom properties**
617
+
618
+ | Name | Description |
619
+ | --- | --- |
620
+ | `--cosm-textarea-background` | Editable control background. |
621
+ | `--cosm-textarea-color` | Editable text color. |
622
+ | `--cosm-textarea-placeholder` | Placeholder text color. |
623
+ | `--cosm-textarea-border` | Editable control boundary color. |
624
+ | `--cosm-textarea-focus` | Visible focus indicator color. |
625
+ | `--cosm-textarea-radius` | Editable control corner radius. |
626
+
627
+ **Keyboard**
628
+
629
+ | Keys | Action |
630
+ | --- | --- |
631
+ | `Tab`, `Shift+Tab` | Moves focus to or from the enabled editable control. |
632
+ | `Enter` | Inserts a newline in the editable text. |
633
+
634
+ ### `radio-group` (`<cosm-radio-group>`)
635
+
636
+ Selects one option from a labeled collection, with optional selection and native Web form behavior.
637
+
638
+ | Prop | Type | Default | Description |
639
+ | --- | --- | --- | --- |
640
+ | `label` | string | Required | Required visible accessible name for the group. |
641
+ | `options` | RadioGroupOptions | Required | Readonly flat options with unique nonempty values and labels, optional descriptions and disabled states. |
642
+ | `value` | RadioGroupValue | — | Controlled selected value; null means no selection, and a supplied null remains controlled. |
643
+ | `defaultValue` | RadioGroupValue | — | Initial autonomous selection; null by default. |
644
+ | `size` | 'sm' \| 'md' \| 'lg' | `md` | Small, medium or large radio indicator. |
645
+ | `orientation` | 'vertical' \| 'horizontal' | `vertical` | Vertical list or wrapping horizontal options. |
646
+ | `disabled` | boolean | `false` | Prevents interaction and excludes the value from Web form submission. |
647
+ | `required` | boolean | `false` | Requires a selection in Web form validation; Native exposes descriptive semantics. |
648
+ | `invalid` | boolean | `false` | Externally supplied invalid presentation state when the visible error is supplied elsewhere. |
649
+ | `helperText` | string | — | Optional supporting text associated with the group. |
650
+ | `errorText` | string | — | Optional consumer-localized error text; a nonempty trimmed value also exposes invalid state. |
651
+ | `name` | string | — | Web form field name; React Native has no HTML form association. |
652
+
653
+ **Events**
654
+
655
+ | DOM | React | Angular | React Native | Detail | Description |
656
+ | --- | --- | --- | --- | --- | --- |
657
+ | `cosm-change` | `onChange` | `(valueChange)` | `onValueChange` | `RadioGroupChangeDetail` | Proposes a selection after enabled user activation; autonomous state commits and controlled state waits for the owner. |
658
+
659
+ **CSS parts**
660
+
661
+ | Name | Description |
662
+ | --- | --- |
663
+ | `base` | Group wrapper and accessible fieldset. |
664
+ | `label` | Visible group label. |
665
+ | `options` | Option collection. |
666
+ | `option` | Selectable option row. |
667
+ | `input` | Native radio input and Web focus target. |
668
+ | `control` | Visible circular radio boundary. |
669
+ | `indicator` | Selected radio dot. |
670
+ | `option-label` | Primary option text. |
671
+ | `description` | Optional option description. |
672
+ | `help-text` | Supporting text associated with the group. |
673
+ | `error-text` | Error description associated with the group. |
674
+
675
+ **CSS custom properties**
676
+
677
+ | Name | Description |
678
+ | --- | --- |
679
+ | `--cosm-radio-group-gap` | Space between option rows. |
680
+ | `--cosm-radio-group-option-gap` | Space between the radio control and option content. |
681
+ | `--cosm-radio-group-control-size` | Diameter of the visible radio control. |
682
+ | `--cosm-radio-group-border` | Unchecked radio boundary color. |
683
+ | `--cosm-radio-group-selected-border` | Selected radio boundary color. |
684
+ | `--cosm-radio-group-indicator` | Selected radio dot color. |
685
+ | `--cosm-radio-group-focus` | Visible keyboard focus indicator color. |
686
+
687
+ **Keyboard**
688
+
689
+ | Keys | Action |
690
+ | --- | --- |
691
+ | `Tab`, `Shift+Tab` | Enters or leaves the group as one tab stop. |
692
+ | `Space` | Selects the focused enabled option. |
693
+ | `ArrowRight`, `ArrowDown`, `ArrowLeft`, `ArrowUp` | Moves focus and selection through enabled options with wrapping. |
694
+
695
+ ### `select` (`<cosm-select>`)
696
+
697
+ Selects one option from an accessible collection, with native Web form behavior.
698
+
699
+ | Prop | Type | Default | Description |
700
+ | --- | --- | --- | --- |
701
+ | `label` | string | Required | Required visible accessible name for the control. |
702
+ | `items` | SelectItems | Required | Readonly flat options with unique nonempty values, nonempty labels, and optional disabled state. |
703
+ | `value` | SelectValue | — | Controlled selected value; null means no selection, and a supplied null remains controlled. |
704
+ | `defaultValue` | SelectValue | — | Initial autonomous selection; null by default. |
705
+ | `placeholder` | string | Required | Consumer-localized text shown when no value is selected. |
706
+ | `variant` | 'outlined' \| 'filled' | `outlined` | Outlined or filled trigger appearance. |
707
+ | `size` | 'sm' \| 'md' \| 'lg' | `md` | Small, medium, or large control size. |
708
+ | `disabled` | boolean | `false` | Prevents interaction and excludes the value from Web form submission. |
709
+ | `required` | boolean | `false` | Requires a selection in Web form validation; Native exposes descriptive semantics. |
710
+ | `invalid` | boolean | `false` | Externally supplied invalid presentation state when the visible error is supplied elsewhere. |
711
+ | `helperText` | string | — | Optional supporting text associated with the control. |
712
+ | `errorText` | string | — | Optional consumer-localized error text; a nonempty trimmed value also exposes invalid state. |
713
+ | `name` | string | — | Web form field name; React Native has no HTML form association. |
714
+
715
+ **Events**
716
+
717
+ | DOM | React | Angular | React Native | Detail | Description |
718
+ | --- | --- | --- | --- | --- | --- |
719
+ | `cosm-change` | `onChange` | `(valueChange)` | `onValueChange` | `SelectChangeDetail` | Proposes a selected value after user activation; autonomous state commits and controlled state waits for the owner. |
720
+
721
+ **CSS parts**
722
+
723
+ | Name | Description |
724
+ | --- | --- |
725
+ | `base` | Field wrapper. |
726
+ | `label` | Visible accessible label. |
727
+ | `trigger` | Select-only combobox trigger. |
728
+ | `value` | Selected option text. |
729
+ | `placeholder` | Text displayed when no option is selected. |
730
+ | `popup` | Anchored popup surface. |
731
+ | `listbox` | Single-selection option collection. |
732
+ | `option` | Selectable row with selected, active, and disabled states. |
733
+ | `content` | Option text wrapper. |
734
+ | `option-label` | Primary option text. |
735
+ | `help` | Supporting text associated with the control. |
736
+ | `error` | Error description associated with the control. |
737
+
738
+ **CSS custom properties**
739
+
740
+ | Name | Description |
741
+ | --- | --- |
742
+ | `--cosm-select-background` | Control background. |
743
+ | `--cosm-select-color` | Control and value text color. |
744
+ | `--cosm-select-placeholder` | Placeholder text color. |
745
+ | `--cosm-select-border` | Control boundary color. |
746
+ | `--cosm-select-focus` | Visible keyboard focus indicator color. |
747
+ | `--cosm-select-radius` | Control corner radius. |
748
+ | `--cosm-select-trigger-min-height` | Custom minimum trigger height. |
749
+ | `--cosm-select-option-selected-background` | Selected option background. |
750
+ | `--cosm-select-option-selected-color` | Selected option text color. |
751
+
752
+ **Keyboard**
753
+
754
+ | Keys | Action |
755
+ | --- | --- |
756
+ | `Tab`, `Shift+Tab` | Moves focus to or from the enabled combobox trigger. |
757
+ | `Enter`, `Space`, `ArrowDown`, `ArrowUp` | On Web, opens the popup; arrows move the active option without changing selection. |
758
+ | `ArrowDown`, `ArrowUp`, `Home`, `End` | On Web, moves the active option without changing the selected value. |
759
+ | `Printable characters` | On Web and React Native Web, moves to a matching option using locale-aware typeahead. Native iOS/Android use touch and platform accessibility navigation; React Native core does not expose hardware key events on this control. |
760
+ | `Enter`, `Space` | On Web, selects the active enabled option. |
761
+ | `Escape` | On Web, closes the popup without changing the selected value. |
762
+
763
+ ### `pagination` (`<cosm-pagination>`)
764
+
765
+ Navigates a known number of pages using buttons.
766
+
767
+ | Prop | Type | Default | Description |
768
+ | --- | --- | --- | --- |
769
+ | `totalPages` | number | Required | Required nonnegative safe integer page count. |
770
+ | `page` | number | — | Controlled one-based safe integer page; out-of-range values are displayed clamped. |
771
+ | `defaultPage` | number | `1` | Initial one-based page for autonomous state. |
772
+ | `label` | string | Required | Required localized navigation landmark label. |
773
+ | `previousLabel` | string | `Previous page` | Previous button label. |
774
+ | `nextLabel` | string | `Next page` | Next button label. |
775
+ | `firstLabel` | string | `First page` | First button label. |
776
+ | `lastLabel` | string | `Last page` | Last button label. |
777
+ | `pageLabel` | string | `Page {page}` | Page button label template; {page} is replaced with the localized number. |
778
+ | `summaryLabel` | string | `Page {page} of {total}` | Compact summary template with {page} and {total} placeholders. |
779
+ | `locale` | string | — | Locale for formatted page numbers. |
780
+ | `direction` | 'ltr' \| 'rtl' | `ltr` | Layout and directional icon direction. |
781
+ | `presentation` | 'numbered' \| 'compact' | `numbered` | Show up to seven fixed-width numbered positions or a compact summary. |
782
+ | `variant` | 'solid' \| 'soft' \| 'outline' | `solid` | Selected page emphasis. |
783
+ | `size` | 'sm' \| 'md' \| 'lg' | `md` | Control size. |
784
+ | `showFirstLast` | boolean | `false` | Show first and last page controls. |
785
+ | `disabled` | boolean | `false` | Disable all controls. |
786
+
787
+ **Events**
788
+
789
+ | DOM | React | Angular | React Native | Detail | Description |
790
+ | --- | --- | --- | --- | --- | --- |
791
+ | `cosm-change` | `onChange` | `(pageChange)` | `onPageChange` | `PaginationChangeDetail` | Proposes a different page after enabled user activation. |
792
+
793
+ **CSS parts**
794
+
795
+ | Name | Description |
796
+ | --- | --- |
797
+ | `base` | Navigation landmark. |
798
+ | `control` | Navigation control. |
799
+ | `page` | Page control. |
800
+ | `current` | Current page control. |
801
+ | `ellipsis` | Decorative omitted-page indicator. |
802
+ | `summary` | Compact summary. |
803
+
804
+ **CSS custom properties**
805
+
806
+ | Name | Description |
807
+ | --- | --- |
808
+ | `--cosm-pagination-gap` | Gap between controls. |
809
+ | `--cosm-pagination-min-height` | Minimum control height. |
810
+ | `--cosm-pagination-radius` | Control corner radius. |
811
+ | `--cosm-pagination-current-background` | Current page background. |
812
+ | `--cosm-pagination-current-color` | Current page foreground. |
813
+ | `--cosm-pagination-current-border` | Current page border color. |
814
+
815
+ **Keyboard**
816
+
817
+ | Keys | Action |
818
+ | --- | --- |
819
+ | `Tab`, `Shift+Tab` | Moves between enabled controls. |
820
+ | `Enter`, `Space` | Activates the focused control. |
821
+
822
+ ### `dialog` (`<cosm-dialog>`)
823
+
824
+ Modal content with a title, actions and cancelable close requests.
825
+
826
+ | Prop | Type | Default | Description |
827
+ | --- | --- | --- | --- |
828
+ | `open` | boolean | `false` | Committed visibility; supplying this prop, including false, controls state. |
829
+ | `defaultOpen` | boolean | `false` | Initial autonomous visibility; subsequent changes do not reset state. |
830
+ | `presentation` | 'standard' \| 'fullscreen' | `standard` | Centered standard surface or fullscreen surface. |
831
+ | `size` | 'sm' \| 'md' \| 'lg' | `md` | Maximum standard width: sm 400, md 640, lg 960 pixels or logical points. |
832
+ | `responsiveFullscreen` | boolean | `false` | Use fullscreen when available viewport width is below 640 pixels or logical points. |
833
+ | `closeLabel` | string | `Close` | Non-empty localized accessible name of the built-in close button. |
834
+ | `closeOnEscape` | boolean | `true` | Request closure on unhandled Escape on web. |
835
+ | `closeOnAndroidBack` | boolean | `true` | Request closure on Android Back; consume Back even if the request is canceled. |
836
+ | `closeOnBackdropPress` | boolean | `false` | Request closure when the backdrop itself is pressed. |
837
+ | `initialFocusTarget` | DialogFocusTarget | — | Optional platform focus target used on committed opening; it must be inside the dialog. |
838
+ | `returnFocusTarget` | DialogFocusTarget | — | Optional platform focus target used after committed closure. |
839
+
840
+ **Events**
841
+
842
+ | DOM | React | Angular | React Native | Detail | Description |
843
+ | --- | --- | --- | --- | --- | --- |
844
+ | `cosm-open-change` | `onOpenChange` | `(openChange)` | `onOpenChange` | `DialogOpenChangeDetail` | Proposes opening or closing; only closing is synchronously cancelable. (cancelable) |
845
+
846
+ **Slots**
847
+
848
+ | Name | Description |
849
+ | --- | --- |
850
+ | `title` | Required accessible title content. |
851
+ | `description` | Optional short accessible description. |
852
+ | `(default)` | Scrollable body content. |
853
+ | `actions` | Consumer-supplied actions. |
854
+
855
+ **CSS parts**
856
+
857
+ | Name | Description |
858
+ | --- | --- |
859
+ | `backdrop` | Modal backdrop. |
860
+ | `base` | Dialog surface. |
861
+ | `header` | Title and close control area. |
862
+ | `title` | Title container. |
863
+ | `description` | Description container. |
864
+ | `body` | Scrollable body. |
865
+ | `actions` | Actions container. |
866
+ | `close` | Close IconButton. |
867
+
868
+ **CSS custom properties**
869
+
870
+ | Name | Description |
871
+ | --- | --- |
872
+ | `--cosm-dialog-z-index` | Modal stacking level. |
873
+ | `--cosm-dialog-max-width` | Standard surface maximum width. |
874
+ | `--cosm-dialog-backdrop` | Backdrop background. |
875
+ | `--cosm-dialog-surface` | Surface background. |
876
+ | `--cosm-dialog-border` | Surface border. |
877
+ | `--cosm-dialog-radius` | Surface radius. |
878
+ | `--cosm-dialog-shadow` | Surface shadow. |
879
+ | `--cosm-dialog-padding` | Section spacing. |
880
+
881
+ **Keyboard**
882
+
883
+ | Keys | Action |
884
+ | --- | --- |
885
+ | `Escape` | On web request close unless handled by a child or disabled. |
886
+ | `Tab`, `Shift+Tab` | Keep keyboard focus inside the modal. |
887
+ | `Android Back` | On Android request close unless disabled. |
888
+
98
889
 
99
890
  ## Rules for AI assistants
100
891