@sdxc/kit 2026.10.17 → 2026.10.21

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 (295) hide show
  1. package/README.md +397 -22
  2. package/changelog.jsonl +1171 -1092
  3. package/config.schema.json +53 -1
  4. package/dist/cli.js +12 -0
  5. package/dist/commands/deploy.d.ts +23 -0
  6. package/dist/commands/deploy.js +167 -0
  7. package/dist/commands/destroy.d.ts +22 -0
  8. package/dist/commands/destroy.js +92 -0
  9. package/dist/commands/doctor.d.ts +26 -0
  10. package/dist/commands/doctor.js +65 -0
  11. package/dist/commands/initializers.d.ts +16 -0
  12. package/dist/commands/initializers.js +23 -0
  13. package/dist/commands/make.d.ts +78 -6
  14. package/dist/commands/make.js +134 -20
  15. package/dist/commands/middleware.d.ts +16 -0
  16. package/dist/commands/middleware.js +21 -0
  17. package/dist/commands/models.d.ts +18 -0
  18. package/dist/commands/models.js +29 -0
  19. package/dist/commands/notes.d.ts +17 -0
  20. package/dist/commands/notes.js +27 -0
  21. package/dist/commands/routes.d.ts +25 -0
  22. package/dist/commands/routes.js +50 -0
  23. package/dist/commands/run.d.ts +16 -0
  24. package/dist/commands/run.js +32 -11
  25. package/dist/commands/scaffold.d.ts +30 -0
  26. package/dist/commands/scaffold.js +34 -0
  27. package/dist/commands/schedule.d.ts +16 -0
  28. package/dist/commands/schedule.js +21 -0
  29. package/dist/commands/stats.d.ts +16 -0
  30. package/dist/commands/stats.js +21 -0
  31. package/dist/commands/ui/update.d.ts +6 -3
  32. package/dist/commands/ui/update.js +24 -7
  33. package/dist/commands/upgrade.d.ts +3 -1
  34. package/dist/commands/upgrade.js +88 -23
  35. package/dist/config.d.ts +20 -0
  36. package/dist/config.js +32 -1
  37. package/dist/contract.d.ts +101 -3
  38. package/dist/contract.js +371 -26
  39. package/dist/create/templates.js +3 -2
  40. package/dist/dependencies.d.ts +5 -1
  41. package/dist/dependencies.js +16 -1
  42. package/dist/deploy/plan.d.ts +49 -0
  43. package/dist/deploy/plan.js +68 -0
  44. package/dist/destroy.d.ts +40 -0
  45. package/dist/destroy.js +317 -0
  46. package/dist/doctor/check.d.ts +71 -0
  47. package/dist/doctor/check.js +53 -0
  48. package/dist/doctor/checks.d.ts +23 -0
  49. package/dist/doctor/checks.js +70 -0
  50. package/dist/doctor/define.d.ts +59 -0
  51. package/dist/doctor/define.js +16 -0
  52. package/dist/doctor/emails.d.ts +18 -0
  53. package/dist/doctor/emails.js +243 -0
  54. package/dist/doctor/env.d.ts +26 -0
  55. package/dist/doctor/env.js +88 -0
  56. package/dist/doctor/files.d.ts +14 -0
  57. package/dist/doctor/files.js +34 -0
  58. package/dist/doctor/fixture.d.ts +23 -0
  59. package/dist/doctor/fixture.js +46 -0
  60. package/dist/doctor/install.d.ts +17 -0
  61. package/dist/doctor/install.js +37 -0
  62. package/dist/doctor/installed.d.ts +11 -0
  63. package/dist/doctor/installed.js +79 -0
  64. package/dist/doctor/jsdoc.d.ts +44 -0
  65. package/dist/doctor/jsdoc.js +201 -0
  66. package/dist/doctor/layout.d.ts +23 -0
  67. package/dist/doctor/layout.js +83 -0
  68. package/dist/doctor/migrations.d.ts +16 -0
  69. package/dist/doctor/migrations.js +96 -0
  70. package/dist/doctor/models.d.ts +13 -0
  71. package/dist/doctor/models.js +69 -0
  72. package/dist/doctor/pins.d.ts +15 -0
  73. package/dist/doctor/pins.js +79 -0
  74. package/dist/doctor/project.d.ts +58 -0
  75. package/dist/doctor/project.js +261 -0
  76. package/dist/doctor/remix.d.ts +14 -0
  77. package/dist/doctor/remix.js +44 -0
  78. package/dist/doctor/routes.d.ts +11 -0
  79. package/dist/doctor/routes.js +49 -0
  80. package/dist/doctor/typegen.d.ts +13 -0
  81. package/dist/doctor/typegen.js +57 -0
  82. package/dist/doctor/ui.d.ts +14 -0
  83. package/dist/doctor/ui.js +51 -0
  84. package/dist/initializers.d.ts +25 -0
  85. package/dist/initializers.js +89 -0
  86. package/dist/lock.d.ts +2 -2
  87. package/dist/make/actions.d.ts +23 -0
  88. package/dist/make/actions.js +82 -0
  89. package/dist/make/declare.d.ts +31 -3
  90. package/dist/make/declare.js +284 -9
  91. package/dist/make/email.d.ts +23 -0
  92. package/dist/make/email.js +111 -0
  93. package/dist/make/from-fields.d.ts +30 -0
  94. package/dist/make/from-fields.js +162 -0
  95. package/dist/make/from-model.d.ts +39 -0
  96. package/dist/make/from-model.js +161 -0
  97. package/dist/make/generate.d.ts +25 -5
  98. package/dist/make/generate.js +76 -22
  99. package/dist/make/guard.d.ts +35 -0
  100. package/dist/make/guard.js +73 -0
  101. package/dist/make/imports.d.ts +6 -0
  102. package/dist/make/imports.js +19 -0
  103. package/dist/make/index.d.ts +49 -4
  104. package/dist/make/index.js +290 -29
  105. package/dist/make/kinds.d.ts +34 -2
  106. package/dist/make/kinds.js +92 -8
  107. package/dist/make/mount.d.ts +25 -0
  108. package/dist/make/mount.js +135 -0
  109. package/dist/make/schema-diff.d.ts +58 -0
  110. package/dist/make/schema-diff.js +609 -0
  111. package/dist/make/schema.d.ts +76 -0
  112. package/dist/make/schema.js +206 -0
  113. package/dist/make/stubs.d.ts +14 -7
  114. package/dist/make/stubs.js +24 -8
  115. package/dist/make/test.d.ts +43 -0
  116. package/dist/make/test.js +150 -0
  117. package/dist/make/trigger.d.ts +31 -0
  118. package/dist/make/trigger.js +163 -0
  119. package/dist/models.d.ts +42 -0
  120. package/dist/models.js +149 -0
  121. package/dist/notes.d.ts +28 -0
  122. package/dist/notes.js +66 -0
  123. package/dist/reference.d.ts +27 -0
  124. package/dist/reference.js +103 -0
  125. package/dist/releases.d.ts +9 -0
  126. package/dist/releases.js +29 -8
  127. package/dist/routes/chains.d.ts +34 -0
  128. package/dist/routes/chains.js +95 -0
  129. package/dist/routes/filter.d.ts +53 -0
  130. package/dist/routes/filter.js +147 -0
  131. package/dist/routes/format.d.ts +23 -0
  132. package/dist/routes/format.js +123 -0
  133. package/dist/routes/helpers.d.ts +21 -0
  134. package/dist/routes/helpers.js +165 -0
  135. package/dist/routes/index.d.ts +56 -0
  136. package/dist/routes/index.js +167 -0
  137. package/dist/routes/modules.d.ts +116 -0
  138. package/dist/routes/modules.js +235 -0
  139. package/dist/routes/parse.d.ts +161 -0
  140. package/dist/routes/parse.js +621 -0
  141. package/dist/routes/routers.d.ts +69 -0
  142. package/dist/routes/routers.js +327 -0
  143. package/dist/scaffold/fields.d.ts +129 -0
  144. package/dist/scaffold/fields.js +421 -0
  145. package/dist/scaffold/index.d.ts +39 -0
  146. package/dist/scaffold/index.js +622 -0
  147. package/dist/scaffold/render.d.ts +61 -0
  148. package/dist/scaffold/render.js +417 -0
  149. package/dist/schedule.d.ts +45 -0
  150. package/dist/schedule.js +124 -0
  151. package/dist/stats.d.ts +37 -0
  152. package/dist/stats.js +126 -0
  153. package/dist/ui/commands.d.ts +10 -3
  154. package/dist/ui/commands.js +85 -15
  155. package/dist/ui/registry.d.ts +8 -8
  156. package/dist/upgrade/agents.d.ts +49 -0
  157. package/dist/upgrade/agents.js +110 -0
  158. package/dist/upgrade/changelog.d.ts +2 -2
  159. package/dist/upgrade/project.d.ts +4 -0
  160. package/dist/upgrade/project.js +11 -1
  161. package/dist/upgrade/prompt.d.ts +11 -0
  162. package/dist/upgrade/prompt.js +50 -7
  163. package/package.json +6 -4
  164. package/registry/ui/alert-dialog.json +2 -2
  165. package/registry/ui/attachment.json +2 -2
  166. package/registry/ui/calendar.json +2 -2
  167. package/registry/ui/color-picker.json +2 -2
  168. package/registry/ui/command.json +2 -2
  169. package/registry/ui/date-picker.json +2 -2
  170. package/registry/ui/date-range-picker.json +2 -2
  171. package/registry/ui/dialog.json +2 -2
  172. package/registry/ui/file-trigger.json +2 -2
  173. package/registry/ui/heading-scope.json +2 -2
  174. package/registry/ui/message-scroller.json +2 -2
  175. package/registry/ui/number-field.json +2 -2
  176. package/registry/ui/range-calendar.json +2 -2
  177. package/registry/ui/resizable.json +2 -2
  178. package/registry/ui/select.json +2 -2
  179. package/registry/ui/shared-element.json +2 -2
  180. package/registry/ui/sidebar.json +3 -3
  181. package/registry/ui/typeset.json +3 -3
  182. package/stubs/command.spec.stub +15 -0
  183. package/stubs/controller.api.resource.stub +23 -0
  184. package/stubs/controller.api.spec.stub +15 -0
  185. package/stubs/controller.form.stub +2 -2
  186. package/stubs/controller.form.test.stub +2 -2
  187. package/stubs/controller.resource.form.stub +67 -0
  188. package/stubs/controller.resource.stub +28 -0
  189. package/stubs/controller.spec.stub +15 -0
  190. package/stubs/email.stub +9 -14
  191. package/stubs/email.test.stub +9 -9
  192. package/stubs/factory.stub +1 -1
  193. package/stubs/mcp.spec.stub +16 -0
  194. package/stubs/model.stub +3 -3
  195. package/stubs/policy.test.stub +34 -8
  196. package/stubs/scaffold.api.create.stub +34 -0
  197. package/stubs/scaffold.api.create.test.stub +37 -0
  198. package/stubs/scaffold.api.destroy.stub +34 -0
  199. package/stubs/scaffold.api.destroy.test.stub +44 -0
  200. package/stubs/scaffold.api.index.stub +23 -0
  201. package/stubs/scaffold.api.index.test.stub +31 -0
  202. package/stubs/scaffold.api.show.stub +27 -0
  203. package/stubs/scaffold.api.show.test.stub +41 -0
  204. package/stubs/scaffold.api.update.stub +44 -0
  205. package/stubs/scaffold.api.update.test.stub +46 -0
  206. package/stubs/scaffold.command.create.stub +22 -0
  207. package/stubs/scaffold.command.create.test.stub +30 -0
  208. package/stubs/scaffold.command.delete.stub +20 -0
  209. package/stubs/scaffold.command.delete.test.stub +39 -0
  210. package/stubs/scaffold.command.list.stub +18 -0
  211. package/stubs/scaffold.command.list.test.stub +31 -0
  212. package/stubs/scaffold.command.show.stub +19 -0
  213. package/stubs/scaffold.command.show.test.stub +37 -0
  214. package/stubs/scaffold.controller.destroy.stub +35 -0
  215. package/stubs/scaffold.controller.destroy.test.stub +65 -0
  216. package/stubs/scaffold.controller.edit.stub +97 -0
  217. package/stubs/scaffold.controller.edit.test.stub +91 -0
  218. package/stubs/scaffold.controller.index.stub +55 -0
  219. package/stubs/scaffold.controller.index.test.stub +32 -0
  220. package/stubs/scaffold.controller.new.stub +70 -0
  221. package/stubs/scaffold.controller.new.test.stub +81 -0
  222. package/stubs/scaffold.controller.show.stub +59 -0
  223. package/stubs/scaffold.controller.show.test.stub +43 -0
  224. package/stubs/scaffold.factory.stub +16 -0
  225. package/stubs/scaffold.form.stub +75 -0
  226. package/stubs/scaffold.mcp.create.stub +24 -0
  227. package/stubs/scaffold.mcp.create.test.stub +36 -0
  228. package/stubs/scaffold.mcp.delete.stub +31 -0
  229. package/stubs/scaffold.mcp.delete.test.stub +43 -0
  230. package/stubs/scaffold.mcp.get.stub +21 -0
  231. package/stubs/scaffold.mcp.get.test.stub +31 -0
  232. package/stubs/scaffold.mcp.list.stub +23 -0
  233. package/stubs/scaffold.mcp.list.test.stub +25 -0
  234. package/stubs/scaffold.mcp.update.stub +37 -0
  235. package/stubs/scaffold.mcp.update.test.stub +40 -0
  236. package/stubs/scaffold.migration.stub +3 -0
  237. package/stubs/scaffold.model.stub +35 -0
  238. package/stubs/scaffold.model.test.stub +25 -0
  239. package/stubs/scaffold.spec.stub +7 -0
  240. package/stubs/scaffold.test-database.stub +33 -0
  241. package/stubs/scaffold.test-mcp.stub +92 -0
  242. package/stubs/scaffold.validator.stub +18 -0
  243. package/stubs/scaffold.validator.test.stub +26 -0
  244. package/templates/app/AGENTS.md +167 -0
  245. package/templates/app/CLAUDE.md +1 -0
  246. package/templates/app/README.md +33 -15
  247. package/templates/app/app/commands/console.test.ts +26 -0
  248. package/templates/app/app/commands/console.ts +19 -0
  249. package/templates/app/app/commands/db/fresh.test.ts +57 -0
  250. package/templates/app/app/commands/db/fresh.ts +37 -0
  251. package/templates/app/app/commands/db/migrate.test.ts +17 -1
  252. package/templates/app/app/commands/db/migrate.ts +51 -18
  253. package/templates/app/app/commands/db/prepare.test.ts +39 -0
  254. package/templates/app/app/commands/db/prepare.ts +35 -0
  255. package/templates/app/app/commands/db/seed.test.ts +38 -0
  256. package/templates/app/app/commands/db/seed.ts +26 -0
  257. package/templates/app/app/commands/deploy.test.ts +34 -0
  258. package/templates/app/app/commands/deploy.ts +18 -0
  259. package/templates/app/app/commands/emails/preview.test.tsx +63 -0
  260. package/templates/app/app/commands/emails/preview.ts +24 -0
  261. package/templates/app/app/commands/index.ts +57 -2
  262. package/templates/app/app/commands/typegen.test.ts +20 -1
  263. package/templates/app/app/commands/typegen.ts +16 -2
  264. package/templates/app/app/emails/index.ts +10 -0
  265. package/templates/app/app/http/middleware/access.test.ts +43 -0
  266. package/templates/app/app/http/middleware/access.ts +41 -0
  267. package/templates/app/app/http/middleware/api.ts +12 -3
  268. package/templates/app/app/http/middleware/page.test.ts +4 -1
  269. package/templates/app/app/http/middleware/page.ts +7 -5
  270. package/templates/app/app/initializers/cli.ts +35 -2
  271. package/templates/app/app/initializers/dispatcher.ts +9 -1
  272. package/templates/app/app/initializers/mail-transport.test.ts +33 -0
  273. package/templates/app/app/initializers/mail-transport.ts +26 -0
  274. package/templates/app/app/initializers/mail.test.ts +17 -17
  275. package/templates/app/app/initializers/mail.ts +15 -7
  276. package/templates/app/app/initializers/router.test.ts +7 -0
  277. package/templates/app/app/initializers/router.tsx +13 -3
  278. package/templates/app/app/jobs/email.test.tsx +70 -0
  279. package/templates/app/app/jobs/email.ts +16 -0
  280. package/templates/app/app/jobs/index.ts +6 -2
  281. package/templates/app/app/policies/abilities.ts +13 -0
  282. package/templates/app/app/policies/policy.test.ts +15 -0
  283. package/templates/app/app/policies/policy.ts +30 -0
  284. package/templates/app/app/services/commands.ts +30 -0
  285. package/templates/app/app/services/migrations.test.ts +48 -1
  286. package/templates/app/app/services/migrations.ts +66 -9
  287. package/templates/app/app/test/cloudflare-workers.ts +2 -0
  288. package/templates/app/app/test/local-database.ts +67 -0
  289. package/templates/app/app/test/session.ts +28 -0
  290. package/templates/app/bootstrap/console.ts +13 -0
  291. package/templates/app/cloudflare.config.ts +3 -3
  292. package/templates/app/database/seed.ts +12 -0
  293. package/templates/app/package.json +3 -1
  294. package/templates/app/spec/config.jsonc +16 -0
  295. package/stubs/policy.stub +0 -16
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "range-calendar",
3
- "changedIn": "2026.10.13",
3
+ "changedIn": "2026.10.20",
4
4
  "dependencies": [
5
5
  "calendar",
6
6
  "input"
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "source": {
12
12
  "path": "range-calendar.tsx",
13
- "content": "/**\n * A calendar surface for choosing a start and end date as one connected\n * range, sharing every header, grid, and row part with {@link Calendar} and\n * layering range position on top of its day cell. Used bare, with no\n * composed children, it renders a pair of native `<input type=\"date\">`\n * fields instead — start and end, each independently keyboard-operable —\n * ready for the `calendarKeys()`/`rangePreview()` mixins a consumer attaches\n * to turn the composed grid into a live, drag- or arrow-key-extended range.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { bg, fg } from \"@sdxc/u/color\";\nimport { roundedCorner } from \"@sdxc/u/effects\";\nimport { flex, gap, items } from \"@sdxc/u/layout\";\nimport { when } from \"@sdxc/u/state\";\nimport { attrs } from \"remix/component\";\n\nimport { Calendar } from \"@sdxc/ui/calendar\";\nimport { Input } from \"@sdxc/ui/input\";\n\n/** Semantic color role {@link RangeCalendar}'s bare fallback pair falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: RangeCalendar.Color = \"neutral\";\n\n/**\n * Prop types for {@link RangeCalendar} and its compound parts. Every part\n * but {@link RangeCalendar.Cell} aliases {@link Calendar}'s matching part,\n * sharing its header, grid, and row markup.\n */\nexport namespace RangeCalendar {\n\t/**\n\t * Semantic color role for the bare fallback pair's keyboard focus rings,\n\t * mapped to `--ui-*` variables like {@link Calendar.Color}. The composed\n\t * grid's day cells always use fixed semantic roles, regardless of this value.\n\t */\n\texport type Color = Calendar.Color;\n\n\t/**\n\t * Per-part styling for the bare fallback pair's two internally composed\n\t * inputs, layered after each input's own built-in styling. Style the\n\t * composed grid's parts through {@link Calendar}'s own compound parts.\n\t */\n\texport interface PartsProps {\n\t\t/** Styling for the bare fallback's start-date input, rendered through {@link Input}. */\n\t\tstart?: TagProps<\"input\">[\"mix\"];\n\t\t/** Styling for the bare fallback's end-date input, rendered through {@link Input}. */\n\t\tend?: TagProps<\"input\">[\"mix\"];\n\t}\n\n\t/**\n\t * Props accepted by {@link RangeCalendar}. Composing\n\t * {@link RangeCalendar.Header} and {@link RangeCalendar.Grid} as `children`\n\t * renders the visual month surface; omitting `children` renders a bare native `<input type=\"date\">` pair from the fields below.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** Semantic color role for the bare fallback pair's focus rings. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t\t/** Native `name` submitted with an enclosing form, read only by the bare fallback's start-date input. */\n\t\tstartName?: string;\n\t\t/** Native `name` submitted with an enclosing form, read only by the bare fallback's end-date input. */\n\t\tendName?: string;\n\t\t/** Current start-of-range value, in `YYYY-MM-DD` form, for a bare fallback pair a consumer tracks itself. */\n\t\tstartValue?: string;\n\t\t/** Current end-of-range value, in `YYYY-MM-DD` form, for a bare fallback pair a consumer tracks itself. */\n\t\tendValue?: string;\n\t\t/** Initial start-of-range value, in `YYYY-MM-DD` form, for a bare fallback pair left to the platform's own uncontrolled state. */\n\t\tstartDefaultValue?: string;\n\t\t/** Initial end-of-range value, in `YYYY-MM-DD` form, for a bare fallback pair left to the platform's own uncontrolled state. */\n\t\tendDefaultValue?: string;\n\t\t/** Earliest accepted date, in `YYYY-MM-DD` form, read by both of the bare fallback pair's inputs. */\n\t\tmin?: string;\n\t\t/** Latest accepted date, in `YYYY-MM-DD` form, read by both of the bare fallback pair's inputs. */\n\t\tmax?: string;\n\t\t/** Granularity, in days, both of the bare fallback pair's values must fall on. */\n\t\tstep?: number;\n\t\t/** Marks both of the bare fallback pair's inputs required for their enclosing form. */\n\t\trequired?: boolean;\n\t\t/** Marks both of the bare fallback pair's inputs inert and excluded from the tab order. */\n\t\tdisabled?: boolean;\n\t\t/** Marks both of the bare fallback pair's inputs' values fixed, while keeping them focusable and included in form submission. */\n\t\treadOnly?: boolean;\n\t\t/** Native autofill hint for both of the bare fallback pair's inputs, e.g. `\"bday\"`. */\n\t\tautoComplete?: string;\n\t\t/** Accessible label for the bare fallback pair's start-date input. Read only when `children` is unset. */\n\t\tstartLabel?: string;\n\t\t/** Accessible label for the bare fallback pair's end-date input. Read only when `children` is unset. */\n\t\tendLabel?: string;\n\t\t/** Per-part styling for the bare fallback pair's internally composed inputs. */\n\t\tparts?: PartsProps;\n\t}\n\n\t/** Every prop {@link Calendar.HeaderProps} accepts, unchanged. */\n\texport interface HeaderProps extends Calendar.HeaderProps {}\n\n\t/** Every prop {@link Calendar.PreviousButtonProps} accepts, unchanged. */\n\texport interface PreviousButtonProps extends Calendar.PreviousButtonProps {}\n\n\t/** Every prop {@link Calendar.NextButtonProps} accepts, unchanged. */\n\texport interface NextButtonProps extends Calendar.NextButtonProps {}\n\n\t/** Every prop {@link Calendar.HeadingProps} accepts, unchanged. */\n\texport interface HeadingProps extends Calendar.HeadingProps {}\n\n\t/** Every prop {@link Calendar.GridProps} accepts, unchanged. */\n\texport interface GridProps extends Calendar.GridProps {}\n\n\t/** Every prop {@link Calendar.GridHeaderProps} accepts, unchanged. */\n\texport interface GridHeaderProps extends Calendar.GridHeaderProps {}\n\n\t/** Every prop {@link Calendar.RowProps} accepts, unchanged. */\n\texport interface RowProps extends Calendar.RowProps {}\n\n\t/** Every prop {@link Calendar.HeaderCellProps} accepts, unchanged. */\n\texport interface HeaderCellProps extends Calendar.HeaderCellProps {}\n\n\t/** Every prop {@link Calendar.GridBodyProps} accepts, unchanged. */\n\texport interface GridBodyProps extends Calendar.GridBodyProps {}\n\n\t/**\n\t * Every prop {@link Calendar.CellProps} accepts, unchanged. Set\n\t * `data-selection-start` on the range's first day, `data-selection-end`\n\t * on its last, and `aria-selected=\"true\"` alone on the days between — each read straight off what the consumer sets on this instance.\n\t */\n\texport interface CellProps extends Calendar.CellProps {}\n}\n\n/**\n * Renders {@link RangeCalendar}'s root through {@link Calendar}. Composing\n * {@link RangeCalendar.Header} and {@link RangeCalendar.Grid} as `children`\n * renders the visual month surface; omitting `children` renders a bare, script-free native `<input type=\"date\">` pair from this instance's own fields.\n *\n * @param handle Runtime handle carrying the root element's props.\n * @returns The render function producing the range calendar's markup.\n * @example\n * <RangeCalendar startLabel={t(\"form.stay.checkIn\")} endLabel={t(\"form.stay.checkOut\")} startName=\"checkIn\" endName=\"checkOut\" />\n * @example\n * <RangeCalendar aria-label={t(\"calendar.label\")}>\n * \t<RangeCalendar.Header>\n * \t\t<RangeCalendar.PreviousButton aria-label={t(\"calendar.previous\")} />\n * \t\t<RangeCalendar.Heading>{monthLabel}</RangeCalendar.Heading>\n * \t\t<RangeCalendar.NextButton aria-label={t(\"calendar.next\")} />\n * \t</RangeCalendar.Header>\n * \t<RangeCalendar.Grid aria-label={monthLabel}>\n * \t\t<RangeCalendar.GridHeader>\n * \t\t\t<RangeCalendar.Row>\n * \t\t\t\t{weekdayLabels.map((day) => (\n * \t\t\t\t\t<RangeCalendar.HeaderCell key={day}>{day}</RangeCalendar.HeaderCell>\n * \t\t\t\t))}\n * \t\t\t</RangeCalendar.Row>\n * \t\t</RangeCalendar.GridHeader>\n * \t\t<RangeCalendar.GridBody>\n * \t\t\t{weeks.map((week) => (\n * \t\t\t\t<RangeCalendar.Row key={week[0].iso}>\n * \t\t\t\t\t{week.map((day) => (\n * \t\t\t\t\t\t<RangeCalendar.Cell\n * \t\t\t\t\t\t\tkey={day.iso}\n * \t\t\t\t\t\t\taria-selected={day.inRange ? \"true\" : undefined}\n * \t\t\t\t\t\t\tdata-selection-start={day.iso === range.start ? \"\" : undefined}\n * \t\t\t\t\t\t\tdata-selection-end={day.iso === range.end ? \"\" : undefined}\n * \t\t\t\t\t\t>\n * \t\t\t\t\t\t\t{day.label}\n * \t\t\t\t\t\t</RangeCalendar.Cell>\n * \t\t\t\t\t))}\n * \t\t\t\t</RangeCalendar.Row>\n * \t\t\t))}\n * \t\t</RangeCalendar.GridBody>\n * \t</RangeCalendar.Grid>\n * </RangeCalendar>\n */\nexport function RangeCalendar(handle: Handle<RangeCalendar.Props>) {\n\treturn () => {\n\t\tlet {\n\t\t\tcolor,\n\t\t\tstartName,\n\t\t\tendName,\n\t\t\tstartValue,\n\t\t\tendValue,\n\t\t\tstartDefaultValue,\n\t\t\tendDefaultValue,\n\t\t\tmin,\n\t\t\tmax,\n\t\t\tstep,\n\t\t\trequired,\n\t\t\tdisabled,\n\t\t\treadOnly,\n\t\t\tautoComplete,\n\t\t\tstartLabel,\n\t\t\tendLabel,\n\t\t\tparts,\n\t\t\tchildren,\n\t\t\tmix,\n\t\t\t...rest\n\t\t} = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\n\t\tif (import.meta.env.DEV && !children) {\n\t\t\tif (!startLabel) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'RangeCalendar: falling back to a plain \"input type=date\" pair needs a \"startLabel\" describing the range\\'s start for assistive technology.',\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (!endLabel) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'RangeCalendar: falling back to a plain \"input type=date\" pair needs an \"endLabel\" describing the range\\'s end for assistive technology.',\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn (\n\t\t\t<Calendar {...rest} mix={mix}>\n\t\t\t\t{children ?? (\n\t\t\t\t\t<div\n\t\t\t\t\t\tdata-slot=\"fields\"\n\t\t\t\t\t\tmix={[attrs({ role: \"group\" }), flex(), items(\"center\"), gap(\"0.5rem\")]}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\ttype=\"date\"\n\t\t\t\t\t\t\tdata-slot=\"start-input\"\n\t\t\t\t\t\t\tcolor={resolvedColor}\n\t\t\t\t\t\t\tname={startName}\n\t\t\t\t\t\t\tvalue={startValue}\n\t\t\t\t\t\t\tdefaultValue={startDefaultValue}\n\t\t\t\t\t\t\tmin={min}\n\t\t\t\t\t\t\tmax={max}\n\t\t\t\t\t\t\tstep={step}\n\t\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\t\t\taria-label={startLabel}\n\t\t\t\t\t\t\tmix={parts?.start}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\ttype=\"date\"\n\t\t\t\t\t\t\tdata-slot=\"end-input\"\n\t\t\t\t\t\t\tcolor={resolvedColor}\n\t\t\t\t\t\t\tname={endName}\n\t\t\t\t\t\t\tvalue={endValue}\n\t\t\t\t\t\t\tdefaultValue={endDefaultValue}\n\t\t\t\t\t\t\tmin={min}\n\t\t\t\t\t\t\tmax={max}\n\t\t\t\t\t\t\tstep={step}\n\t\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\t\t\taria-label={endLabel}\n\t\t\t\t\t\t\tmix={parts?.end}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Calendar>\n\t\t);\n\t};\n}\n\n/**\n * Renders {@link RangeCalendar.HeaderProps.children} as the nav row: identical\n * to {@link Calendar.Header}, since {@link RangeCalendar} reuses\n * {@link Calendar}'s grid markup for its own header.\n *\n * @param handle Runtime handle carrying the host `<header>`'s props.\n * @returns The render function producing the nav row's markup.\n * @example\n * <RangeCalendar.Header>\n * \t<RangeCalendar.PreviousButton aria-label={t(\"calendar.previous\")} />\n * \t<RangeCalendar.Heading>{monthLabel}</RangeCalendar.Heading>\n * \t<RangeCalendar.NextButton aria-label={t(\"calendar.next\")} />\n * </RangeCalendar.Header>\n */\nRangeCalendar.Header = Calendar.Header;\n\n/**\n * Renders a control standing for \"show the previous month\": identical to\n * {@link Calendar.PreviousButton}.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the control's markup.\n * @example\n * <RangeCalendar.PreviousButton aria-label={t(\"calendar.previous\")} />\n */\nRangeCalendar.PreviousButton = Calendar.PreviousButton;\n\n/**\n * Renders a control standing for \"show the following month\": identical to\n * {@link Calendar.NextButton}.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the control's markup.\n * @example\n * <RangeCalendar.NextButton aria-label={t(\"calendar.next\")} />\n */\nRangeCalendar.NextButton = Calendar.NextButton;\n\n/**\n * Renders the calendar's visible month/year caption: identical to\n * {@link Calendar.Heading}.\n *\n * @param handle Runtime handle carrying the host heading element's props.\n * @returns The render function producing the caption's markup.\n * @example\n * <RangeCalendar.Heading>{monthLabel}</RangeCalendar.Heading>\n */\nRangeCalendar.Heading = Calendar.Heading;\n\n/**\n * Renders the day grid's native `<table>` host: identical to\n * {@link Calendar.Grid}.\n *\n * @param handle Runtime handle carrying the host `<table>`'s props.\n * @returns The render function producing the grid's markup.\n * @example\n * <RangeCalendar.Grid aria-label={monthLabel}>\n * \t<RangeCalendar.GridHeader>...</RangeCalendar.GridHeader>\n * \t<RangeCalendar.GridBody>...</RangeCalendar.GridBody>\n * </RangeCalendar.Grid>\n */\nRangeCalendar.Grid = Calendar.Grid;\n\n/**\n * Renders the grid's `<thead>` host: identical to {@link Calendar.GridHeader}.\n *\n * @param handle Runtime handle carrying the host `<thead>`'s props.\n * @returns The render function producing the header section's markup.\n * @example\n * <RangeCalendar.GridHeader>\n * \t<RangeCalendar.Row>\n * \t\t<RangeCalendar.HeaderCell>{t(\"calendar.weekdays.sun\")}</RangeCalendar.HeaderCell>\n * \t</RangeCalendar.Row>\n * </RangeCalendar.GridHeader>\n */\nRangeCalendar.GridHeader = Calendar.GridHeader;\n\n/**\n * Renders a native `<tr>` host: identical to {@link Calendar.Row}. Composes\n * a row of {@link RangeCalendar.HeaderCell} inside\n * {@link RangeCalendar.GridHeader}, or a week's row of {@link RangeCalendar.Cell} inside {@link RangeCalendar.GridBody}.\n *\n * @param handle Runtime handle carrying the host `<tr>`'s props.\n * @returns The render function producing the row's markup.\n * @example\n * <RangeCalendar.Row>\n * \t<RangeCalendar.Cell>{day.label}</RangeCalendar.Cell>\n * </RangeCalendar.Row>\n */\nRangeCalendar.Row = Calendar.Row;\n\n/**\n * Renders a weekday abbreviation: identical to {@link Calendar.HeaderCell}.\n *\n * @param handle Runtime handle carrying the host `<th>`'s props.\n * @returns The render function producing the weekday header's markup.\n * @example\n * <RangeCalendar.HeaderCell>{t(\"calendar.weekdays.sun\")}</RangeCalendar.HeaderCell>\n */\nRangeCalendar.HeaderCell = Calendar.HeaderCell;\n\n/**\n * Renders the grid's `<tbody>` host: identical to {@link Calendar.GridBody}.\n *\n * @param handle Runtime handle carrying the host `<tbody>`'s props.\n * @returns The render function producing the body section's markup.\n * @example\n * <RangeCalendar.GridBody>\n * \t{weeks.map((week) => (\n * \t\t<RangeCalendar.Row key={week[0].iso}>...</RangeCalendar.Row>\n * \t))}\n * </RangeCalendar.GridBody>\n */\nRangeCalendar.GridBody = Calendar.GridBody;\n\n/**\n * Renders one calendar day for {@link RangeCalendar}, building on\n * {@link Calendar.Cell}. `data-selection-start`/`data-selection-end`\n * square off each end's outer corners so the range reads as one unbroken bar, driven by whatever state the consumer sets for the `calendarKeys()`/`rangePreview()` mixins.\n *\n * @param handle Runtime handle carrying the host `<td>`'s props.\n * @returns The render function producing the day's markup.\n * @example\n * <RangeCalendar.Cell data-selection-start=\"\">{day.label}</RangeCalendar.Cell>\n * @example\n * <RangeCalendar.Cell aria-selected=\"true\">{day.label}</RangeCalendar.Cell>\n * @example\n * <RangeCalendar.Cell data-selection-end=\"\">{day.label}</RangeCalendar.Cell>\n */\nRangeCalendar.Cell = function RangeCalendarCell(handle: Handle<RangeCalendar.CellProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<Calendar.Cell\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\t/**\n\t\t\t\t\t * A day is the range's opening, its closing, both at once, or one of the days\n\t\t\t\t\t * between. The four are written under selectors that match one apiece, so each\n\t\t\t\t\t * day keeps its own shape however the cascade orders the set.\n\t\t\t\t\t */\n\t\t\t\t\twhen(\"&[data-selection-start]:not([data-selection-end])\", [\n\t\t\t\t\t\tbg(\"brand.solid\"),\n\t\t\t\t\t\tfg(\"brand.onSolid\"),\n\t\t\t\t\t\troundedCorner(\"start-end\", \"none\"),\n\t\t\t\t\t\troundedCorner(\"end-end\", \"none\"),\n\t\t\t\t\t]),\n\t\t\t\t\twhen(\"&[data-selection-end]:not([data-selection-start])\", [\n\t\t\t\t\t\tbg(\"brand.solid\"),\n\t\t\t\t\t\tfg(\"brand.onSolid\"),\n\t\t\t\t\t\troundedCorner(\"start-start\", \"none\"),\n\t\t\t\t\t\troundedCorner(\"end-start\", \"none\"),\n\t\t\t\t\t]),\n\t\t\t\t\t/**\n\t\t\t\t\t * A range of one day opens and closes on itself, so it reads as a single day.\n\t\t\t\t\t */\n\t\t\t\t\twhen(\"&[data-selection-start][data-selection-end]\", [\n\t\t\t\t\t\tbg(\"brand.solid\"),\n\t\t\t\t\t\tfg(\"brand.onSolid\"),\n\t\t\t\t\t]),\n\t\t\t\t\twhen('&[aria-selected=\"true\"]:not([data-selection-start]):not([data-selection-end])', [\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The days between carry the range across the row, so the band reads as one\n\t\t\t\t\t\t * run at a glance while the two ends stay the strongest thing in the month.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tbg(\"brand.bg-tint-hover\"),\n\t\t\t\t\t\tfg(\"brand.emphasis\"),\n\t\t\t\t\t\troundedCorner(\"start-start\", \"none\"),\n\t\t\t\t\t\troundedCorner(\"start-end\", \"none\"),\n\t\t\t\t\t\troundedCorner(\"end-start\", \"none\"),\n\t\t\t\t\t\troundedCorner(\"end-end\", \"none\"),\n\t\t\t\t\t]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n"
13
+ "content": "/**\n * A calendar surface for choosing a start and end date as one connected\n * range, sharing every header, grid, and row part with {@link Calendar} and\n * layering range position on top of its day cell. Used bare, with no\n * composed children, it renders a pair of native `<input type=\"date\">`\n * fields instead — start and end, each independently keyboard-operable —\n * ready for the `calendarKeys()`/`rangePreview()` mixins a consumer attaches\n * to turn the composed grid into a live, drag- or arrow-key-extended range.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { bg, fg } from \"@sdxc/u/color\";\nimport { roundedCorner } from \"@sdxc/u/effects\";\nimport { flex, gap, items } from \"@sdxc/u/layout\";\nimport { when } from \"@sdxc/u/state\";\nimport { attrs } from \"remix/component\";\n\nimport { Calendar } from \"@sdxc/ui/calendar\";\nimport { Input } from \"@sdxc/ui/input\";\n\n/** Semantic color role {@link RangeCalendar}'s bare fallback pair falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: RangeCalendar.Color = \"neutral\";\n\n/**\n * Prop types for {@link RangeCalendar} and its compound parts. Every part\n * but {@link RangeCalendar.Cell} aliases {@link Calendar}'s matching part,\n * sharing its header, grid, and row markup.\n */\nexport namespace RangeCalendar {\n\t/**\n\t * Semantic color role for the bare fallback pair's keyboard focus rings,\n\t * mapped to `--ui-*` variables like {@link Calendar.Color}. The composed\n\t * grid's day cells always use fixed semantic roles, regardless of this value.\n\t */\n\texport type Color = Calendar.Color;\n\n\t/**\n\t * Per-part styling for the bare fallback pair's two internally composed\n\t * inputs, layered after each input's own built-in styling. Style the\n\t * composed grid's parts through {@link Calendar}'s own compound parts.\n\t */\n\texport interface PartsProps {\n\t\t/** Styling for the bare fallback's start-date input, rendered through {@link Input}. */\n\t\tstart?: TagProps<\"input\">[\"mix\"];\n\t\t/** Styling for the bare fallback's end-date input, rendered through {@link Input}. */\n\t\tend?: TagProps<\"input\">[\"mix\"];\n\t}\n\n\t/**\n\t * Props accepted by {@link RangeCalendar}. Composing\n\t * {@link RangeCalendar.Header} and {@link RangeCalendar.Grid} as `children`\n\t * renders the visual month surface; omitting `children` renders a bare native `<input type=\"date\">` pair from the fields below.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** Semantic color role for the bare fallback pair's focus rings. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t\t/** Native `name` submitted with an enclosing form, read only by the bare fallback's start-date input. */\n\t\tstartName?: string;\n\t\t/** Native `name` submitted with an enclosing form, read only by the bare fallback's end-date input. */\n\t\tendName?: string;\n\t\t/** Current start-of-range value, in `YYYY-MM-DD` form, for a bare fallback pair a consumer tracks itself. */\n\t\tstartValue?: string;\n\t\t/** Current end-of-range value, in `YYYY-MM-DD` form, for a bare fallback pair a consumer tracks itself. */\n\t\tendValue?: string;\n\t\t/** Initial start-of-range value, in `YYYY-MM-DD` form, for a bare fallback pair left to the platform's own uncontrolled state. */\n\t\tstartDefaultValue?: string;\n\t\t/** Initial end-of-range value, in `YYYY-MM-DD` form, for a bare fallback pair left to the platform's own uncontrolled state. */\n\t\tendDefaultValue?: string;\n\t\t/** Earliest accepted date, in `YYYY-MM-DD` form, read by both of the bare fallback pair's inputs. */\n\t\tmin?: string;\n\t\t/** Latest accepted date, in `YYYY-MM-DD` form, read by both of the bare fallback pair's inputs. */\n\t\tmax?: string;\n\t\t/** Granularity, in days, both of the bare fallback pair's values must fall on. */\n\t\tstep?: number;\n\t\t/** Marks both of the bare fallback pair's inputs required for their enclosing form. */\n\t\trequired?: boolean;\n\t\t/** Marks both of the bare fallback pair's inputs inert and excluded from the tab order. */\n\t\tdisabled?: boolean;\n\t\t/** Marks both of the bare fallback pair's inputs' values fixed, while keeping them focusable and included in form submission. */\n\t\treadOnly?: boolean;\n\t\t/** Native autofill hint for both of the bare fallback pair's inputs, e.g. `\"bday\"`. */\n\t\tautoComplete?: string;\n\t\t/** Accessible label for the bare fallback pair's start-date input. Read only when `children` is unset. */\n\t\tstartLabel?: string;\n\t\t/** Accessible label for the bare fallback pair's end-date input. Read only when `children` is unset. */\n\t\tendLabel?: string;\n\t\t/** Per-part styling for the bare fallback pair's internally composed inputs. */\n\t\tparts?: PartsProps;\n\t}\n\n\t/** Every prop {@link Calendar.HeaderProps} accepts, unchanged. */\n\texport interface HeaderProps extends Calendar.HeaderProps {}\n\n\t/** Every prop {@link Calendar.PreviousButtonProps} accepts, unchanged. */\n\texport interface PreviousButtonProps extends Calendar.PreviousButtonProps {}\n\n\t/** Every prop {@link Calendar.NextButtonProps} accepts, unchanged. */\n\texport interface NextButtonProps extends Calendar.NextButtonProps {}\n\n\t/** Every prop {@link Calendar.HeadingProps} accepts, unchanged. */\n\texport interface HeadingProps extends Calendar.HeadingProps {}\n\n\t/** Every prop {@link Calendar.GridProps} accepts, unchanged. */\n\texport interface GridProps extends Calendar.GridProps {}\n\n\t/** Every prop {@link Calendar.GridHeaderProps} accepts, unchanged. */\n\texport interface GridHeaderProps extends Calendar.GridHeaderProps {}\n\n\t/** Every prop {@link Calendar.RowProps} accepts, unchanged. */\n\texport interface RowProps extends Calendar.RowProps {}\n\n\t/** Every prop {@link Calendar.HeaderCellProps} accepts, unchanged. */\n\texport interface HeaderCellProps extends Calendar.HeaderCellProps {}\n\n\t/** Every prop {@link Calendar.GridBodyProps} accepts, unchanged. */\n\texport interface GridBodyProps extends Calendar.GridBodyProps {}\n\n\t/**\n\t * Every prop {@link Calendar.CellProps} accepts, unchanged. Set\n\t * `data-selection-start` on the range's first day, `data-selection-end`\n\t * on its last, and `aria-selected=\"true\"` alone on the days between — each read straight off what the consumer sets on this instance.\n\t */\n\texport interface CellProps extends Calendar.CellProps {}\n}\n\n/**\n * Renders {@link RangeCalendar}'s root through {@link Calendar}. Composing\n * {@link RangeCalendar.Header} and {@link RangeCalendar.Grid} as `children`\n * renders the visual month surface; omitting `children` renders a bare, script-free native `<input type=\"date\">` pair from this instance's own fields.\n *\n * @param handle Runtime handle carrying the root element's props.\n * @returns The render function producing the range calendar's markup.\n * @example\n * <RangeCalendar startLabel={t(\"form.stay.checkIn\")} endLabel={t(\"form.stay.checkOut\")} startName=\"checkIn\" endName=\"checkOut\" />\n * @example\n * <RangeCalendar aria-label={t(\"calendar.label\")}>\n * \t<RangeCalendar.Header>\n * \t\t<RangeCalendar.PreviousButton aria-label={t(\"calendar.previous\")} />\n * \t\t<RangeCalendar.Heading>{monthLabel}</RangeCalendar.Heading>\n * \t\t<RangeCalendar.NextButton aria-label={t(\"calendar.next\")} />\n * \t</RangeCalendar.Header>\n * \t<RangeCalendar.Grid aria-label={monthLabel}>\n * \t\t<RangeCalendar.GridHeader>\n * \t\t\t<RangeCalendar.Row>\n * \t\t\t\t{weekdayLabels.map((day) => (\n * \t\t\t\t\t<RangeCalendar.HeaderCell key={day}>{day}</RangeCalendar.HeaderCell>\n * \t\t\t\t))}\n * \t\t\t</RangeCalendar.Row>\n * \t\t</RangeCalendar.GridHeader>\n * \t\t<RangeCalendar.GridBody>\n * \t\t\t{weeks.map((week) => (\n * \t\t\t\t<RangeCalendar.Row key={week[0].iso}>\n * \t\t\t\t\t{week.map((day) => (\n * \t\t\t\t\t\t<RangeCalendar.Cell\n * \t\t\t\t\t\t\tkey={day.iso}\n * \t\t\t\t\t\t\taria-selected={day.inRange ? \"true\" : undefined}\n * \t\t\t\t\t\t\tdata-selection-start={day.iso === range.start ? \"\" : undefined}\n * \t\t\t\t\t\t\tdata-selection-end={day.iso === range.end ? \"\" : undefined}\n * \t\t\t\t\t\t>\n * \t\t\t\t\t\t\t{day.label}\n * \t\t\t\t\t\t</RangeCalendar.Cell>\n * \t\t\t\t\t))}\n * \t\t\t\t</RangeCalendar.Row>\n * \t\t\t))}\n * \t\t</RangeCalendar.GridBody>\n * \t</RangeCalendar.Grid>\n * </RangeCalendar>\n */\nexport function RangeCalendar(handle: Handle<RangeCalendar.Props>) {\n\treturn () => {\n\t\tlet {\n\t\t\tcolor,\n\t\t\tstartName,\n\t\t\tendName,\n\t\t\tstartValue,\n\t\t\tendValue,\n\t\t\tstartDefaultValue,\n\t\t\tendDefaultValue,\n\t\t\tmin,\n\t\t\tmax,\n\t\t\tstep,\n\t\t\trequired,\n\t\t\tdisabled,\n\t\t\treadOnly,\n\t\t\tautoComplete,\n\t\t\tstartLabel,\n\t\t\tendLabel,\n\t\t\tparts,\n\t\t\tchildren,\n\t\t\tmix,\n\t\t\t...rest\n\t\t} = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\n\t\tif (import.meta.env?.DEV && !children) {\n\t\t\tif (!startLabel) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'RangeCalendar: falling back to a plain \"input type=date\" pair needs a \"startLabel\" describing the range\\'s start for assistive technology.',\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (!endLabel) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'RangeCalendar: falling back to a plain \"input type=date\" pair needs an \"endLabel\" describing the range\\'s end for assistive technology.',\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn (\n\t\t\t<Calendar {...rest} mix={mix}>\n\t\t\t\t{children ?? (\n\t\t\t\t\t<div\n\t\t\t\t\t\tdata-slot=\"fields\"\n\t\t\t\t\t\tmix={[attrs({ role: \"group\" }), flex(), items(\"center\"), gap(\"0.5rem\")]}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\ttype=\"date\"\n\t\t\t\t\t\t\tdata-slot=\"start-input\"\n\t\t\t\t\t\t\tcolor={resolvedColor}\n\t\t\t\t\t\t\tname={startName}\n\t\t\t\t\t\t\tvalue={startValue}\n\t\t\t\t\t\t\tdefaultValue={startDefaultValue}\n\t\t\t\t\t\t\tmin={min}\n\t\t\t\t\t\t\tmax={max}\n\t\t\t\t\t\t\tstep={step}\n\t\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\t\t\taria-label={startLabel}\n\t\t\t\t\t\t\tmix={parts?.start}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\ttype=\"date\"\n\t\t\t\t\t\t\tdata-slot=\"end-input\"\n\t\t\t\t\t\t\tcolor={resolvedColor}\n\t\t\t\t\t\t\tname={endName}\n\t\t\t\t\t\t\tvalue={endValue}\n\t\t\t\t\t\t\tdefaultValue={endDefaultValue}\n\t\t\t\t\t\t\tmin={min}\n\t\t\t\t\t\t\tmax={max}\n\t\t\t\t\t\t\tstep={step}\n\t\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\t\t\taria-label={endLabel}\n\t\t\t\t\t\t\tmix={parts?.end}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Calendar>\n\t\t);\n\t};\n}\n\n/**\n * Renders {@link RangeCalendar.HeaderProps.children} as the nav row: identical\n * to {@link Calendar.Header}, since {@link RangeCalendar} reuses\n * {@link Calendar}'s grid markup for its own header.\n *\n * @param handle Runtime handle carrying the host `<header>`'s props.\n * @returns The render function producing the nav row's markup.\n * @example\n * <RangeCalendar.Header>\n * \t<RangeCalendar.PreviousButton aria-label={t(\"calendar.previous\")} />\n * \t<RangeCalendar.Heading>{monthLabel}</RangeCalendar.Heading>\n * \t<RangeCalendar.NextButton aria-label={t(\"calendar.next\")} />\n * </RangeCalendar.Header>\n */\nRangeCalendar.Header = Calendar.Header;\n\n/**\n * Renders a control standing for \"show the previous month\": identical to\n * {@link Calendar.PreviousButton}.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the control's markup.\n * @example\n * <RangeCalendar.PreviousButton aria-label={t(\"calendar.previous\")} />\n */\nRangeCalendar.PreviousButton = Calendar.PreviousButton;\n\n/**\n * Renders a control standing for \"show the following month\": identical to\n * {@link Calendar.NextButton}.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the control's markup.\n * @example\n * <RangeCalendar.NextButton aria-label={t(\"calendar.next\")} />\n */\nRangeCalendar.NextButton = Calendar.NextButton;\n\n/**\n * Renders the calendar's visible month/year caption: identical to\n * {@link Calendar.Heading}.\n *\n * @param handle Runtime handle carrying the host heading element's props.\n * @returns The render function producing the caption's markup.\n * @example\n * <RangeCalendar.Heading>{monthLabel}</RangeCalendar.Heading>\n */\nRangeCalendar.Heading = Calendar.Heading;\n\n/**\n * Renders the day grid's native `<table>` host: identical to\n * {@link Calendar.Grid}.\n *\n * @param handle Runtime handle carrying the host `<table>`'s props.\n * @returns The render function producing the grid's markup.\n * @example\n * <RangeCalendar.Grid aria-label={monthLabel}>\n * \t<RangeCalendar.GridHeader>...</RangeCalendar.GridHeader>\n * \t<RangeCalendar.GridBody>...</RangeCalendar.GridBody>\n * </RangeCalendar.Grid>\n */\nRangeCalendar.Grid = Calendar.Grid;\n\n/**\n * Renders the grid's `<thead>` host: identical to {@link Calendar.GridHeader}.\n *\n * @param handle Runtime handle carrying the host `<thead>`'s props.\n * @returns The render function producing the header section's markup.\n * @example\n * <RangeCalendar.GridHeader>\n * \t<RangeCalendar.Row>\n * \t\t<RangeCalendar.HeaderCell>{t(\"calendar.weekdays.sun\")}</RangeCalendar.HeaderCell>\n * \t</RangeCalendar.Row>\n * </RangeCalendar.GridHeader>\n */\nRangeCalendar.GridHeader = Calendar.GridHeader;\n\n/**\n * Renders a native `<tr>` host: identical to {@link Calendar.Row}. Composes\n * a row of {@link RangeCalendar.HeaderCell} inside\n * {@link RangeCalendar.GridHeader}, or a week's row of {@link RangeCalendar.Cell} inside {@link RangeCalendar.GridBody}.\n *\n * @param handle Runtime handle carrying the host `<tr>`'s props.\n * @returns The render function producing the row's markup.\n * @example\n * <RangeCalendar.Row>\n * \t<RangeCalendar.Cell>{day.label}</RangeCalendar.Cell>\n * </RangeCalendar.Row>\n */\nRangeCalendar.Row = Calendar.Row;\n\n/**\n * Renders a weekday abbreviation: identical to {@link Calendar.HeaderCell}.\n *\n * @param handle Runtime handle carrying the host `<th>`'s props.\n * @returns The render function producing the weekday header's markup.\n * @example\n * <RangeCalendar.HeaderCell>{t(\"calendar.weekdays.sun\")}</RangeCalendar.HeaderCell>\n */\nRangeCalendar.HeaderCell = Calendar.HeaderCell;\n\n/**\n * Renders the grid's `<tbody>` host: identical to {@link Calendar.GridBody}.\n *\n * @param handle Runtime handle carrying the host `<tbody>`'s props.\n * @returns The render function producing the body section's markup.\n * @example\n * <RangeCalendar.GridBody>\n * \t{weeks.map((week) => (\n * \t\t<RangeCalendar.Row key={week[0].iso}>...</RangeCalendar.Row>\n * \t))}\n * </RangeCalendar.GridBody>\n */\nRangeCalendar.GridBody = Calendar.GridBody;\n\n/**\n * Renders one calendar day for {@link RangeCalendar}, building on\n * {@link Calendar.Cell}. `data-selection-start`/`data-selection-end`\n * square off each end's outer corners so the range reads as one unbroken bar, driven by whatever state the consumer sets for the `calendarKeys()`/`rangePreview()` mixins.\n *\n * @param handle Runtime handle carrying the host `<td>`'s props.\n * @returns The render function producing the day's markup.\n * @example\n * <RangeCalendar.Cell data-selection-start=\"\">{day.label}</RangeCalendar.Cell>\n * @example\n * <RangeCalendar.Cell aria-selected=\"true\">{day.label}</RangeCalendar.Cell>\n * @example\n * <RangeCalendar.Cell data-selection-end=\"\">{day.label}</RangeCalendar.Cell>\n */\nRangeCalendar.Cell = function RangeCalendarCell(handle: Handle<RangeCalendar.CellProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<Calendar.Cell\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\t/**\n\t\t\t\t\t * A day is the range's opening, its closing, both at once, or one of the days\n\t\t\t\t\t * between. The four are written under selectors that match one apiece, so each\n\t\t\t\t\t * day keeps its own shape however the cascade orders the set.\n\t\t\t\t\t */\n\t\t\t\t\twhen(\"&[data-selection-start]:not([data-selection-end])\", [\n\t\t\t\t\t\tbg(\"brand.solid\"),\n\t\t\t\t\t\tfg(\"brand.onSolid\"),\n\t\t\t\t\t\troundedCorner(\"start-end\", \"none\"),\n\t\t\t\t\t\troundedCorner(\"end-end\", \"none\"),\n\t\t\t\t\t]),\n\t\t\t\t\twhen(\"&[data-selection-end]:not([data-selection-start])\", [\n\t\t\t\t\t\tbg(\"brand.solid\"),\n\t\t\t\t\t\tfg(\"brand.onSolid\"),\n\t\t\t\t\t\troundedCorner(\"start-start\", \"none\"),\n\t\t\t\t\t\troundedCorner(\"end-start\", \"none\"),\n\t\t\t\t\t]),\n\t\t\t\t\t/**\n\t\t\t\t\t * A range of one day opens and closes on itself, so it reads as a single day.\n\t\t\t\t\t */\n\t\t\t\t\twhen(\"&[data-selection-start][data-selection-end]\", [\n\t\t\t\t\t\tbg(\"brand.solid\"),\n\t\t\t\t\t\tfg(\"brand.onSolid\"),\n\t\t\t\t\t]),\n\t\t\t\t\twhen('&[aria-selected=\"true\"]:not([data-selection-start]):not([data-selection-end])', [\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The days between carry the range across the row, so the band reads as one\n\t\t\t\t\t\t * run at a glance while the two ends stay the strongest thing in the month.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tbg(\"brand.bg-tint-hover\"),\n\t\t\t\t\t\tfg(\"brand.emphasis\"),\n\t\t\t\t\t\troundedCorner(\"start-start\", \"none\"),\n\t\t\t\t\t\troundedCorner(\"start-end\", \"none\"),\n\t\t\t\t\t\troundedCorner(\"end-start\", \"none\"),\n\t\t\t\t\t\troundedCorner(\"end-end\", \"none\"),\n\t\t\t\t\t]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n"
14
14
  },
15
15
  "test": null
16
16
  }
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "resizable",
3
- "changedIn": "2026.10.13",
3
+ "changedIn": "2026.10.20",
4
4
  "dependencies": [],
5
5
  "exports": [
6
6
  "Resizable"
7
7
  ],
8
8
  "source": {
9
9
  "path": "resizable.tsx",
10
- "content": "/**\n * A split-pane layout arranging {@link Resizable.Panel} and\n * {@link Resizable.Handle} parts along a shared axis, each panel taking up\n * its own declared share of the group's main axis and each handle between\n * two panels reserving a fixed track across the cross axis. Every part\n * mirrors the root's orientation onto itself through component context, so a\n * panel's own minimum and maximum share and a handle's cursor and track both\n * switch axis together without a consumer repeating the orientation on each\n * one.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { bg, border, fg, outline, outlineStyle } from \"@sdxc/u/color\";\nimport { opacity, rounded } from \"@sdxc/u/effects\";\nimport { cursor, pseudoContent, touchAction, userSelect } from \"@sdxc/u/general\";\nimport {\n\tbasis,\n\tflex,\n\tflexCol,\n\tflexRow,\n\tgrow,\n\titems,\n\tjustify,\n\trelative,\n\tshrink,\n} from \"@sdxc/u/layout\";\nimport { overflow } from \"@sdxc/u/overflow\";\nimport { bs, is, maxBs, maxIs, minBs, minIs } from \"@sdxc/u/size\";\nimport { before, data, focusVisible, hover, when } from \"@sdxc/u/state\";\nimport { attrs } from \"remix/component\";\n\nimport { hitArea } from \"@sdxc/ui/styles\";\nimport { mergeStyle } from \"@sdxc/ui/utils\";\n\n/** Default {@link Resizable.Props} orientation, applied when `orientation` is omitted. */\nconst DEFAULT_ORIENTATION: Resizable.Orientation = \"horizontal\";\n\n/** `role=\"separator\"` applied to {@link Resizable.Handle} through {@link attrs} unless a consumer supplies its own `role`. */\nconst DEFAULT_HANDLE_ROLE = \"separator\";\n\n/**\n * Default {@link Resizable.HandleProps} tab index, applied through\n * {@link attrs} unless a consumer supplies its own, keeping a handle\n * reachable in Tab order per the WAI-ARIA window splitter pattern.\n */\nconst DEFAULT_HANDLE_TAB_INDEX = 0;\n\n/**\n * Prop types for {@link Resizable} and its compound parts.\n */\nexport namespace Resizable {\n\t/**\n\t * Axis the panels lay out along: a row of panels side by side, or a\n\t * column of panels stacked one above another.\n\t */\n\texport type Orientation = \"horizontal\" | \"vertical\";\n\n\t/**\n\t * Value {@link Resizable} stores in component context so every\n\t * {@link Resizable.Panel} and {@link Resizable.Handle} nested inside reads\n\t * the same axis for its own `data-orientation`, sizing, and cursor.\n\t */\n\texport interface Context {\n\t\t/** The root's resolved layout axis. */\n\t\torientation: Orientation;\n\t}\n\n\t/**\n\t * Props accepted by {@link Resizable}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** Layout axis. Defaults to {@link DEFAULT_ORIENTATION}. */\n\t\torientation?: Orientation;\n\t}\n\n\t/**\n\t * Props accepted by {@link Resizable.Panel}.\n\t */\n\texport interface PanelProps extends TagProps<\"div\"> {\n\t\t/**\n\t\t * Starting share of the group's main axis, as a percentage (e.g. `30`\n\t\t * for 30%). Panels left without one split whatever share remains\n\t\t * evenly among themselves.\n\t\t */\n\t\tdefaultSize?: number;\n\t\t/**\n\t\t * Smallest share of the group's main axis this panel will shrink to,\n\t\t * as a percentage. Left unset, the panel can shrink down to nothing.\n\t\t */\n\t\tminSize?: number;\n\t\t/**\n\t\t * Largest share of the group's main axis this panel will grow to, as\n\t\t * a percentage. Left unset, the panel can grow up to the group's\n\t\t * entire main axis.\n\t\t */\n\t\tmaxSize?: number;\n\t}\n\n\t/**\n\t * Props accepted by {@link Resizable.Handle}. Its accessible name comes\n\t * entirely from `aria-label` or `aria-labelledby`; pair it with\n\t * `aria-controls` naming the panels on either side.\n\t */\n\texport interface HandleProps extends TagProps<\"div\"> {}\n}\n\n/**\n * Renders the root host: a `<div>` laying {@link Resizable.Panel} and\n * {@link Resizable.Handle} children out in a row, or a column when\n * `orientation` is `\"vertical\"`, sharing the resolved axis through context; set `aria-disabled=\"true\"` to dim the whole group.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props and providing {@link Resizable.Context}.\n * @returns The render function producing the root's markup.\n * @example\n * <Resizable aria-label={t(\"layout.panes\")}>\n * \t<Resizable.Panel id=\"sidebar\" defaultSize={30} minSize={15}>\n * \t\t{t(\"layout.sidebar\")}\n * \t</Resizable.Panel>\n * \t<Resizable.Handle aria-label={t(\"layout.resizeSidebar\")} aria-controls=\"sidebar main\" />\n * \t<Resizable.Panel id=\"main\" defaultSize={70}>\n * \t\t{t(\"layout.main\")}\n * \t</Resizable.Panel>\n * </Resizable>\n * @example\n * <Resizable orientation=\"vertical\" aria-label={t(\"layout.panes\")}>\n * \t<Resizable.Panel defaultSize={60}>{t(\"layout.top\")}</Resizable.Panel>\n * \t<Resizable.Handle aria-label={t(\"layout.resizeVertically\")} />\n * \t<Resizable.Panel defaultSize={40}>{t(\"layout.bottom\")}</Resizable.Panel>\n * </Resizable>\n */\nexport function Resizable(handle: Handle<Resizable.Props, Resizable.Context>) {\n\treturn () => {\n\t\tlet { orientation, mix, ...rest } = handle.props;\n\t\tlet resolvedOrientation = orientation ?? DEFAULT_ORIENTATION;\n\n\t\thandle.context.set({ orientation: resolvedOrientation });\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tdata-orientation={resolvedOrientation}\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tflex(),\n\t\t\t\t\tflexRow(),\n\t\t\t\t\tis(\"full\"),\n\t\t\t\t\toverflow(\"hidden\"),\n\t\t\t\t\twhen('&[data-orientation=\"vertical\"]', flexCol()),\n\t\t\t\t\twhen('&[aria-disabled=\"true\"]', opacity(70)),\n\t\t\t\t\trounded(\"lg\"),\n\t\t\t\t\tborder({ color: \"neutral\", width: 1 }),\n\t\t\t\t\tbg(\"neutral.tint\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n}\n\n/**\n * Renders a single pane: a `<div>` that grows and shrinks to fill its share\n * of the group's main axis, clipping overflow with scrolling. Each of\n * `defaultSize`/`minSize`/`maxSize` lives on a `--ui-resizable-panel-*` custom property a pointer-tracking behavior can update to resize it live.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the pane's markup.\n * @example\n * <Resizable.Panel defaultSize={30} minSize={15} maxSize={50}>\n * \t{t(\"layout.sidebar\")}\n * </Resizable.Panel>\n */\nResizable.Panel = function ResizablePanel(handle: Handle<Resizable.PanelProps>) {\n\treturn () => {\n\t\tlet { mix, style, defaultSize, minSize, maxSize, ...rest } = handle.props;\n\t\tlet context = handle.context.get(Resizable);\n\n\t\tlet resolvedStyle = mergeStyle(style, {\n\t\t\t\"--ui-resizable-panel-size\": defaultSize == null ? null : `${defaultSize}%`,\n\t\t\t\"--ui-resizable-panel-min-size\": minSize == null ? null : `${minSize}%`,\n\t\t\t\"--ui-resizable-panel-max-size\": maxSize == null ? null : `${maxSize}%`,\n\t\t});\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tdata-orientation={context.orientation}\n\t\t\t\tdata-default-size={defaultSize}\n\t\t\t\tdata-min-size={minSize}\n\t\t\t\tdata-max-size={maxSize}\n\t\t\t\t{...rest}\n\t\t\t\tstyle={resolvedStyle}\n\t\t\t\tmix={[\n\t\t\t\t\tgrow(),\n\t\t\t\t\tshrink(1),\n\t\t\t\t\tbasis(\"var(--ui-resizable-panel-size, 0%)\"),\n\t\t\t\t\tminBs(0),\n\t\t\t\t\tminIs(0),\n\t\t\t\t\tdata(\"orientation\", \"horizontal\", [\n\t\t\t\t\t\tminIs(\"var(--ui-resizable-panel-min-size, 0%)\"),\n\t\t\t\t\t\tmaxIs(\"var(--ui-resizable-panel-max-size, 100%)\"),\n\t\t\t\t\t]),\n\t\t\t\t\tdata(\"orientation\", \"vertical\", [\n\t\t\t\t\t\tminBs(\"var(--ui-resizable-panel-min-size, 0%)\"),\n\t\t\t\t\t\tmaxBs(\"var(--ui-resizable-panel-max-size, 100%)\"),\n\t\t\t\t\t]),\n\t\t\t\t\toverflow(\"auto\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a draggable divider between two adjacent panels: a\n * `role=\"separator\"` `<div>` reachable in Tab order, its bar darkening on\n * hover and ready for `&[data-resizing]` to color it during a drag. Its accessible name comes entirely from `aria-label`/`aria-labelledby`, paired with `aria-controls` naming the panels it resizes.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the handle's markup.\n * @example\n * <Resizable.Handle aria-label={t(\"layout.resizeSidebar\")} aria-controls=\"sidebar main\" />\n * @example\n * <Resizable.Handle aria-label={t(\"layout.resizeSidebar\")} aria-disabled=\"true\" />\n */\nResizable.Handle = function ResizableHandle(handle: Handle<Resizable.HandleProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\t\tlet context = handle.context.get(Resizable);\n\n\t\tif (import.meta.env.DEV && !rest[\"aria-label\"] && !rest[\"aria-labelledby\"]) {\n\t\t\tconsole.warn(\n\t\t\t\t\"Resizable.Handle: a resize handle with no `aria-label` or `aria-labelledby` needs one describing what it resizes — assistive technology has no accessible name to announce otherwise.\",\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tdata-orientation={context.orientation}\n\t\t\t\taria-orientation={context.orientation}\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ role: DEFAULT_HANDLE_ROLE, tabIndex: DEFAULT_HANDLE_TAB_INDEX }),\n\t\t\t\t\trelative(),\n\t\t\t\t\tflex(),\n\t\t\t\t\tgrow(0),\n\t\t\t\t\tshrink(0),\n\t\t\t\t\tbasis(\"var(--ui-resizable-handle-size, 0.75rem)\"),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\tuserSelect(),\n\t\t\t\t\ttouchAction(),\n\t\t\t\t\toutlineStyle(\"none\"),\n\t\t\t\t\twhen('&[data-orientation=\"horizontal\"]', cursor(\"col-resize\")),\n\t\t\t\t\twhen('&[data-orientation=\"vertical\"]', cursor(\"row-resize\")),\n\t\t\t\t\tbefore(pseudoContent('\"\"')),\n\t\t\t\t\tdata(\"orientation\", \"horizontal\", before([bs(\"2.5rem\"), is(\"0.125rem\")])),\n\t\t\t\t\tdata(\"orientation\", \"vertical\", before([bs(\"0.125rem\"), is(\"2.5rem\")])),\n\t\t\t\t\twhen('&[aria-disabled=\"true\"]', [cursor(\"not-allowed\"), opacity(50)]),\n\t\t\t\t\tfg(\"neutral.muted\"),\n\t\t\t\t\twhen(\"&::before\", [rounded(\"full\"), bg(\"neutral.border\")]),\n\t\t\t\t\thover(when(\"&::before\", bg(\"neutral.strong\"))),\n\t\t\t\t\twhen(\"&[data-resizing]::before\", bg(\"brand.solid\")),\n\t\t\t\t\tfocusVisible(outline({ color: \"brand.ring\" })),\n\t\t\t\t\t/**\n\t\t\t\t\t * The handle's thin axis grows to `--ui-target-size` through an invisible box\n\t\t\t\t\t * over the panels' edges, leaving the layout and the drawn line unchanged.\n\t\t\t\t\t */\n\t\t\t\t\thitArea(),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n"
10
+ "content": "/**\n * A split-pane layout arranging {@link Resizable.Panel} and\n * {@link Resizable.Handle} parts along a shared axis, each panel taking up\n * its own declared share of the group's main axis and each handle between\n * two panels reserving a fixed track across the cross axis. Every part\n * mirrors the root's orientation onto itself through component context, so a\n * panel's own minimum and maximum share and a handle's cursor and track both\n * switch axis together without a consumer repeating the orientation on each\n * one.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { bg, border, fg, outline, outlineStyle } from \"@sdxc/u/color\";\nimport { opacity, rounded } from \"@sdxc/u/effects\";\nimport { cursor, pseudoContent, touchAction, userSelect } from \"@sdxc/u/general\";\nimport {\n\tbasis,\n\tflex,\n\tflexCol,\n\tflexRow,\n\tgrow,\n\titems,\n\tjustify,\n\trelative,\n\tshrink,\n} from \"@sdxc/u/layout\";\nimport { overflow } from \"@sdxc/u/overflow\";\nimport { bs, is, maxBs, maxIs, minBs, minIs } from \"@sdxc/u/size\";\nimport { before, data, focusVisible, hover, when } from \"@sdxc/u/state\";\nimport { attrs } from \"remix/component\";\n\nimport { hitArea } from \"@sdxc/ui/styles\";\nimport { mergeStyle } from \"@sdxc/ui/utils\";\n\n/** Default {@link Resizable.Props} orientation, applied when `orientation` is omitted. */\nconst DEFAULT_ORIENTATION: Resizable.Orientation = \"horizontal\";\n\n/** `role=\"separator\"` applied to {@link Resizable.Handle} through {@link attrs} unless a consumer supplies its own `role`. */\nconst DEFAULT_HANDLE_ROLE = \"separator\";\n\n/**\n * Default {@link Resizable.HandleProps} tab index, applied through\n * {@link attrs} unless a consumer supplies its own, keeping a handle\n * reachable in Tab order per the WAI-ARIA window splitter pattern.\n */\nconst DEFAULT_HANDLE_TAB_INDEX = 0;\n\n/**\n * Prop types for {@link Resizable} and its compound parts.\n */\nexport namespace Resizable {\n\t/**\n\t * Axis the panels lay out along: a row of panels side by side, or a\n\t * column of panels stacked one above another.\n\t */\n\texport type Orientation = \"horizontal\" | \"vertical\";\n\n\t/**\n\t * Value {@link Resizable} stores in component context so every\n\t * {@link Resizable.Panel} and {@link Resizable.Handle} nested inside reads\n\t * the same axis for its own `data-orientation`, sizing, and cursor.\n\t */\n\texport interface Context {\n\t\t/** The root's resolved layout axis. */\n\t\torientation: Orientation;\n\t}\n\n\t/**\n\t * Props accepted by {@link Resizable}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** Layout axis. Defaults to {@link DEFAULT_ORIENTATION}. */\n\t\torientation?: Orientation;\n\t}\n\n\t/**\n\t * Props accepted by {@link Resizable.Panel}.\n\t */\n\texport interface PanelProps extends TagProps<\"div\"> {\n\t\t/**\n\t\t * Starting share of the group's main axis, as a percentage (e.g. `30`\n\t\t * for 30%). Panels left without one split whatever share remains\n\t\t * evenly among themselves.\n\t\t */\n\t\tdefaultSize?: number;\n\t\t/**\n\t\t * Smallest share of the group's main axis this panel will shrink to,\n\t\t * as a percentage. Left unset, the panel can shrink down to nothing.\n\t\t */\n\t\tminSize?: number;\n\t\t/**\n\t\t * Largest share of the group's main axis this panel will grow to, as\n\t\t * a percentage. Left unset, the panel can grow up to the group's\n\t\t * entire main axis.\n\t\t */\n\t\tmaxSize?: number;\n\t}\n\n\t/**\n\t * Props accepted by {@link Resizable.Handle}. Its accessible name comes\n\t * entirely from `aria-label` or `aria-labelledby`; pair it with\n\t * `aria-controls` naming the panels on either side.\n\t */\n\texport interface HandleProps extends TagProps<\"div\"> {}\n}\n\n/**\n * Renders the root host: a `<div>` laying {@link Resizable.Panel} and\n * {@link Resizable.Handle} children out in a row, or a column when\n * `orientation` is `\"vertical\"`, sharing the resolved axis through context; set `aria-disabled=\"true\"` to dim the whole group.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props and providing {@link Resizable.Context}.\n * @returns The render function producing the root's markup.\n * @example\n * <Resizable aria-label={t(\"layout.panes\")}>\n * \t<Resizable.Panel id=\"sidebar\" defaultSize={30} minSize={15}>\n * \t\t{t(\"layout.sidebar\")}\n * \t</Resizable.Panel>\n * \t<Resizable.Handle aria-label={t(\"layout.resizeSidebar\")} aria-controls=\"sidebar main\" />\n * \t<Resizable.Panel id=\"main\" defaultSize={70}>\n * \t\t{t(\"layout.main\")}\n * \t</Resizable.Panel>\n * </Resizable>\n * @example\n * <Resizable orientation=\"vertical\" aria-label={t(\"layout.panes\")}>\n * \t<Resizable.Panel defaultSize={60}>{t(\"layout.top\")}</Resizable.Panel>\n * \t<Resizable.Handle aria-label={t(\"layout.resizeVertically\")} />\n * \t<Resizable.Panel defaultSize={40}>{t(\"layout.bottom\")}</Resizable.Panel>\n * </Resizable>\n */\nexport function Resizable(handle: Handle<Resizable.Props, Resizable.Context>) {\n\treturn () => {\n\t\tlet { orientation, mix, ...rest } = handle.props;\n\t\tlet resolvedOrientation = orientation ?? DEFAULT_ORIENTATION;\n\n\t\thandle.context.set({ orientation: resolvedOrientation });\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tdata-orientation={resolvedOrientation}\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tflex(),\n\t\t\t\t\tflexRow(),\n\t\t\t\t\tis(\"full\"),\n\t\t\t\t\toverflow(\"hidden\"),\n\t\t\t\t\twhen('&[data-orientation=\"vertical\"]', flexCol()),\n\t\t\t\t\twhen('&[aria-disabled=\"true\"]', opacity(70)),\n\t\t\t\t\trounded(\"lg\"),\n\t\t\t\t\tborder({ color: \"neutral\", width: 1 }),\n\t\t\t\t\tbg(\"neutral.tint\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n}\n\n/**\n * Renders a single pane: a `<div>` that grows and shrinks to fill its share\n * of the group's main axis, clipping overflow with scrolling. Each of\n * `defaultSize`/`minSize`/`maxSize` lives on a `--ui-resizable-panel-*` custom property a pointer-tracking behavior can update to resize it live.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the pane's markup.\n * @example\n * <Resizable.Panel defaultSize={30} minSize={15} maxSize={50}>\n * \t{t(\"layout.sidebar\")}\n * </Resizable.Panel>\n */\nResizable.Panel = function ResizablePanel(handle: Handle<Resizable.PanelProps>) {\n\treturn () => {\n\t\tlet { mix, style, defaultSize, minSize, maxSize, ...rest } = handle.props;\n\t\tlet context = handle.context.get(Resizable);\n\n\t\tlet resolvedStyle = mergeStyle(style, {\n\t\t\t\"--ui-resizable-panel-size\": defaultSize == null ? null : `${defaultSize}%`,\n\t\t\t\"--ui-resizable-panel-min-size\": minSize == null ? null : `${minSize}%`,\n\t\t\t\"--ui-resizable-panel-max-size\": maxSize == null ? null : `${maxSize}%`,\n\t\t});\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tdata-orientation={context.orientation}\n\t\t\t\tdata-default-size={defaultSize}\n\t\t\t\tdata-min-size={minSize}\n\t\t\t\tdata-max-size={maxSize}\n\t\t\t\t{...rest}\n\t\t\t\tstyle={resolvedStyle}\n\t\t\t\tmix={[\n\t\t\t\t\tgrow(),\n\t\t\t\t\tshrink(1),\n\t\t\t\t\tbasis(\"var(--ui-resizable-panel-size, 0%)\"),\n\t\t\t\t\tminBs(0),\n\t\t\t\t\tminIs(0),\n\t\t\t\t\tdata(\"orientation\", \"horizontal\", [\n\t\t\t\t\t\tminIs(\"var(--ui-resizable-panel-min-size, 0%)\"),\n\t\t\t\t\t\tmaxIs(\"var(--ui-resizable-panel-max-size, 100%)\"),\n\t\t\t\t\t]),\n\t\t\t\t\tdata(\"orientation\", \"vertical\", [\n\t\t\t\t\t\tminBs(\"var(--ui-resizable-panel-min-size, 0%)\"),\n\t\t\t\t\t\tmaxBs(\"var(--ui-resizable-panel-max-size, 100%)\"),\n\t\t\t\t\t]),\n\t\t\t\t\toverflow(\"auto\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a draggable divider between two adjacent panels: a\n * `role=\"separator\"` `<div>` reachable in Tab order, its bar darkening on\n * hover and ready for `&[data-resizing]` to color it during a drag. Its accessible name comes entirely from `aria-label`/`aria-labelledby`, paired with `aria-controls` naming the panels it resizes.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the handle's markup.\n * @example\n * <Resizable.Handle aria-label={t(\"layout.resizeSidebar\")} aria-controls=\"sidebar main\" />\n * @example\n * <Resizable.Handle aria-label={t(\"layout.resizeSidebar\")} aria-disabled=\"true\" />\n */\nResizable.Handle = function ResizableHandle(handle: Handle<Resizable.HandleProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\t\tlet context = handle.context.get(Resizable);\n\n\t\tif (import.meta.env?.DEV && !rest[\"aria-label\"] && !rest[\"aria-labelledby\"]) {\n\t\t\tconsole.warn(\n\t\t\t\t\"Resizable.Handle: a resize handle with no `aria-label` or `aria-labelledby` needs one describing what it resizes — assistive technology has no accessible name to announce otherwise.\",\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tdata-orientation={context.orientation}\n\t\t\t\taria-orientation={context.orientation}\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ role: DEFAULT_HANDLE_ROLE, tabIndex: DEFAULT_HANDLE_TAB_INDEX }),\n\t\t\t\t\trelative(),\n\t\t\t\t\tflex(),\n\t\t\t\t\tgrow(0),\n\t\t\t\t\tshrink(0),\n\t\t\t\t\tbasis(\"var(--ui-resizable-handle-size, 0.75rem)\"),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\tuserSelect(),\n\t\t\t\t\ttouchAction(),\n\t\t\t\t\toutlineStyle(\"none\"),\n\t\t\t\t\twhen('&[data-orientation=\"horizontal\"]', cursor(\"col-resize\")),\n\t\t\t\t\twhen('&[data-orientation=\"vertical\"]', cursor(\"row-resize\")),\n\t\t\t\t\tbefore(pseudoContent('\"\"')),\n\t\t\t\t\tdata(\"orientation\", \"horizontal\", before([bs(\"2.5rem\"), is(\"0.125rem\")])),\n\t\t\t\t\tdata(\"orientation\", \"vertical\", before([bs(\"0.125rem\"), is(\"2.5rem\")])),\n\t\t\t\t\twhen('&[aria-disabled=\"true\"]', [cursor(\"not-allowed\"), opacity(50)]),\n\t\t\t\t\tfg(\"neutral.muted\"),\n\t\t\t\t\twhen(\"&::before\", [rounded(\"full\"), bg(\"neutral.border\")]),\n\t\t\t\t\thover(when(\"&::before\", bg(\"neutral.strong\"))),\n\t\t\t\t\twhen(\"&[data-resizing]::before\", bg(\"brand.solid\")),\n\t\t\t\t\tfocusVisible(outline({ color: \"brand.ring\" })),\n\t\t\t\t\t/**\n\t\t\t\t\t * The handle's thin axis grows to `--ui-target-size` through an invisible box\n\t\t\t\t\t * over the panels' edges, leaving the layout and the drawn line unchanged.\n\t\t\t\t\t */\n\t\t\t\t\thitArea(),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n"
11
11
  },
12
12
  "test": null
13
13
  }
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "select",
3
- "changedIn": "2026.10.13",
3
+ "changedIn": "2026.10.20",
4
4
  "dependencies": [],
5
5
  "exports": [
6
6
  "Select"
7
7
  ],
8
8
  "source": {
9
9
  "path": "select.tsx",
10
- "content": "/**\n * A native `<select>` styled as a bordered, rounded field and progressively\n * upgraded with customizable-select rendering — a custom trigger button, a\n * value slot mirroring the current selection, and richly styled options and\n * groups — wherever the browser resolves `appearance: base-select`. The\n * trigger, value, and picker styling layer on top of ordinary\n * `<option>`/`<optgroup>` markup, so every browser renders a working\n * dropdown from that same markup.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { ChevronDownIcon } from \"@sdxc/icons\";\nimport { bg, border, borderEdge, fg, outline, outlineStyle, outlineWidth } from \"@sdxc/u/color\";\nimport {\n\topacity,\n\trounded,\n\ttransition,\n\ttransitionBehavior,\n\ttransitionDuration,\n} from \"@sdxc/u/effects\";\nimport { cursor, raw } from \"@sdxc/u/general\";\nimport {\n\tappearance,\n\tbasis,\n\tflex,\n\tgap,\n\tgrow,\n\tinlineFlex,\n\tinset,\n\titems,\n\tjustify,\n\tshrink,\n} from \"@sdxc/u/layout\";\nimport { overflow } from \"@sdxc/u/overflow\";\nimport { media, startingStyle } from \"@sdxc/u/responsive\";\nimport { bs, is, m, maxBs, p, pb, pi } from \"@sdxc/u/size\";\nimport { data, hover, when } from \"@sdxc/u/state\";\nimport { text, textAlign, truncate } from \"@sdxc/u/typography\";\nimport { attrs } from \"remix/component\";\n\nimport { durations } from \"@sdxc/ui/animations\";\nimport { mirrorSelectedOption } from \"@sdxc/ui/mixins\";\nimport { floatingSurface, surfaceInset } from \"@sdxc/ui/styles\";\n\n/**\n * The `<selectedcontent>` element mirrors the currently selected\n * `<option>`'s rendered content inside a customized `<select>`'s trigger\n * button, its attribute shape declared here to match a plain `<span>`'s.\n */\ndeclare global {\n\tnamespace JSX {\n\t\tinterface IntrinsicHTMLElements {\n\t\t\tselectedcontent: IntrinsicHTMLElements[\"span\"];\n\t\t}\n\t}\n}\n\n/** Semantic color role {@link Select} falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: Select.Color = \"neutral\";\n\n/**\n * `type` {@link Select.Trigger} falls back to when a consumer doesn't supply\n * one, keeping a click on the trigger from submitting a surrounding `<form>`\n * the way a bare `<button>`'s default type otherwise would.\n */\nconst DEFAULT_TRIGGER_TYPE: NonNullable<Select.TriggerProps[\"type\"]> = \"button\";\n\n/**\n * `aria-hidden` applied through {@link attrs} to {@link Select.Trigger}'s\n * default chevron glyph unless a consumer overrides it, keeping the\n * decorative icon out of the accessibility tree.\n */\nconst DEFAULT_ICON_ARIA_HIDDEN = \"true\";\n\n/**\n * Prop types for {@link Select} and its compound parts.\n */\nexport namespace Select {\n\t/**\n\t * Semantic color role, each mapped to its matching `--ui-*` variables.\n\t */\n\texport type Color = \"brand\" | \"neutral\" | \"success\" | \"warning\" | \"danger\";\n\n\t/**\n\t * Every native `<select>` attribute, unchanged, plus the `mix` passthrough.\n\t * `multiple` and a `size` greater than `1` remain functional but switch\n\t * rendering back to the plain list-box; `role` is already implicit.\n\t */\n\t/**\n\t * `value` and `defaultValue` are left out on purpose. A `<select>` takes its selection\n\t * from the option carrying `selected` and nothing else reads either attribute, so a\n\t * value passed here goes unread and the field quietly shows its first option. Mark the\n\t * option instead: `<Select.Option value=\"eu\" selected>`.\n\t */\n\texport interface Props extends Omit<TagProps<\"select\">, \"role\" | \"defaultValue\" | \"value\"> {\n\t\t/** Semantic color role for the focus-visible ring. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t}\n\n\t/**\n\t * Every native `<button>` attribute, unchanged, plus the `mix` passthrough.\n\t * `type` defaults to {@link DEFAULT_TRIGGER_TYPE}.\n\t */\n\texport interface TriggerProps extends TagProps<\"button\"> {}\n\n\t/**\n\t * Every attribute a plain `<span>` accepts, unchanged, plus the `mix`\n\t * passthrough. Any `children` supplied render as a fallback in browsers\n\t * treating `<selectedcontent>` as unknown — see {@link Select.Value}.\n\t */\n\texport interface ValueProps extends TagProps<\"selectedcontent\"> {}\n\n\t/**\n\t * Every native `<option>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface OptionProps extends TagProps<\"option\"> {}\n\n\t/**\n\t * Every native `<optgroup>` attribute, unchanged, plus the `mix`\n\t * passthrough.\n\t */\n\texport interface GroupProps extends TagProps<\"optgroup\"> {}\n}\n\n/**\n * Renders a native `<select>` styled as a bordered, rounded field that\n * progressively upgrades to customizable-select rendering via\n * `appearance: base-select`, falling back to the platform's own dropdown.\n *\n * @param handle Runtime handle carrying the host `<select>`'s props.\n * @returns The render function producing the field's markup.\n * @example\n * <Select aria-label={t(\"form.country.label\")} required>\n * \t<Select.Option value=\"\">{t(\"form.country.placeholder\")}</Select.Option>\n * \t<Select.Option value=\"us\">{t(\"countries.us\")}</Select.Option>\n * \t<Select.Option value=\"ca\">{t(\"countries.ca\")}</Select.Option>\n * </Select>\n * @example\n * <Select aria-label={t(\"form.plan.label\")} color=\"brand\">\n * \t<Select.Trigger />\n * \t<Select.Group label={t(\"form.plan.groups.personal\")}>\n * \t\t<Select.Option value=\"free\">{t(\"plans.free\")}</Select.Option>\n * \t\t<Select.Option value=\"pro\">{t(\"plans.pro\")}</Select.Option>\n * \t</Select.Group>\n * </Select>\n */\nexport function Select(handle: Handle<Select.Props>) {\n\treturn () => {\n\t\tlet { color, multiple, size, mix, ...rest } = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\n\t\tif (import.meta.env.DEV && (multiple || (typeof size === \"number\" && size > 1))) {\n\t\t\tconsole.warn(\n\t\t\t\t\"Select: `appearance: base-select` styling has no effect on a `multiple` select or one with a `size` greater than 1 — the browser keeps its plain list-box rendering there instead of the customized trigger, value, and option styling.\",\n\t\t\t);\n\t\t}\n\n\t\tlet fieldMix = [\n\t\t\tflex(),\n\t\t\titems(\"center\"),\n\t\t\tjustify(\"between\"),\n\t\t\tcursor(\"default\"),\n\t\t\ttext(\"sm\"),\n\t\t\t/**\n\t\t\t * Focus draws a ring standing off the field and the border steps only to its hover weight,\n\t\t\t * so the field keeps its shape. The pointer and keyboard selectors exclude each other because\n\t\t\t * `outline: none` is a shorthand that, from a later layer, resets the whole ring.\n\t\t\t */\n\t\t\twhen(\"&:focus:not(:focus-visible)\", outline(\"none\")),\n\t\t\twhen(\"&:focus-visible\", [\n\t\t\t\tborder(\"neutral.border-hover\"),\n\t\t\t\toutline({ color: \"brand.ring\", offset: 2 }),\n\t\t\t\tdata(\"color\", \"success\", outline(\"success.ring\")),\n\t\t\t\tdata(\"color\", \"warning\", outline(\"warning.ring\")),\n\t\t\t\tdata(\"color\", \"danger\", outline(\"danger.ring\")),\n\t\t\t]),\n\t\t\twhen('&[aria-invalid=\"true\"], &:user-invalid', [\n\t\t\t\toutlineWidth(\"2px\"),\n\t\t\t\toutlineStyle(\"solid\"),\n\t\t\t\traw({ outlineOffset: \"2px\" }),\n\t\t\t]),\n\t\t\twhen(\"&:disabled\", [cursor(\"not-allowed\"), opacity(50)]),\n\n\t\t\twhen(\"&::picker(select)\", [\n\t\t\t\tfloatingSurface(),\n\t\t\t\tsurfaceInset(),\n\t\t\t\tm(0),\n\t\t\t\tinset(\"auto\"),\n\t\t\t\tmaxBs(\"15rem\"),\n\t\t\t\toverflow(\"auto\"),\n\t\t\t\toutline(\"none\"),\n\t\t\t\topacity(0),\n\t\t\t\ttransition(\"opacity, display, overlay\", { duration: durations.fast }),\n\t\t\t\ttransitionBehavior(\"allow-discrete\"),\n\t\t\t]),\n\t\t\twhen(\"&:open::picker(select)\", opacity(100)),\n\t\t\tstartingStyle(when(\"&:open::picker(select)\", opacity(0))),\n\t\t\tmedia(\n\t\t\t\t\"(prefers-reduced-motion: reduce)\",\n\t\t\t\twhen(\"&::picker(select)\", transitionDuration(\"0s\")),\n\t\t\t),\n\t\t\traw({\n\t\t\t\t\"&:open\": {\n\t\t\t\t\t'& [data-slot=\"icon\"]': {\n\t\t\t\t\t\ttransform: \"rotate(180deg)\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t\"&:has(option:checked:disabled)\": {\n\t\t\t\t\t\"& selectedcontent\": {\n\t\t\t\t\t\tcolor: \"var(--ui-neutral-fg-muted)\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t\tgap(\"0.5rem\"),\n\t\t\tis(\"full\"),\n\t\t\tbs(\"2.5rem\"),\n\t\t\trounded(\"md\"),\n\t\t\tborder({ color: \"neutral\", width: 1 }),\n\t\t\tbg(\"neutral.tint\"),\n\t\t\tfg(\"neutral.emphasis\"),\n\t\t\tpi(\"0.75rem\"),\n\t\t\tpb(\"0.5rem\"),\n\t\t\tappearance(\"base-select\"),\n\t\t\ttransition(\n\t\t\t\t\"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter\",\n\t\t\t),\n\t\t\thover(border(\"neutral.border-hover\")),\n\t\t\twhen(\"&:focus\", border(\"neutral.border-hover\")),\n\t\t\twhen('&[aria-invalid=\"true\"], &:user-invalid', [\n\t\t\t\tborder(\"danger\"),\n\t\t\t\toutline({ color: \"danger.ring\", offset: 2 }),\n\t\t\t]),\n\t\t\twhen(\"&:disabled\", bg(\"neutral.bg-tint-hover\")),\n\t\t\traw({\n\t\t\t\t\"&::picker(select)\": {\n\t\t\t\t\tborderRadius: \"var(--ui-radius-lg, 0.5rem)\",\n\t\t\t\t\tborderWidth: \"1px\",\n\t\t\t\t\tborderStyle: \"solid\",\n\t\t\t\t\tborderColor: \"var(--ui-neutral-border)\",\n\t\t\t\t\tbackgroundColor: \"var(--ui-neutral-bg-tint)\",\n\t\t\t\t},\n\t\t\t\t\"&::picker-icon\": {\n\t\t\t\t\tcolor: \"var(--ui-neutral-fg-muted)\",\n\t\t\t\t},\n\t\t\t}),\n\t\t\tmix,\n\t\t] as unknown as Select.Props[\"mix\"];\n\n\t\treturn (\n\t\t\t<select multiple={multiple} size={size} data-color={resolvedColor} {...rest} mix={fieldMix} />\n\t\t);\n\t};\n}\n\n/**\n * Renders {@link Select}'s customizable trigger: a native `<button>` placed\n * as {@link Select}'s first child, showing {@link Select.Value} and a\n * rotating chevron by default, filling the field's box edge to edge.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the trigger's markup.\n * @example\n * <Select.Trigger />\n * @example\n * <Select.Trigger>\n * \t<Select.Value>{t(\"form.plan.placeholder\")}</Select.Value>\n * </Select.Trigger>\n */\nSelect.Trigger = function SelectTrigger(handle: Handle<Select.TriggerProps>) {\n\treturn () => {\n\t\tlet { type, children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\ttype={type ?? DEFAULT_TRIGGER_TYPE}\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tflex(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"between\"),\n\t\t\t\t\tgap(\"0.5rem\"),\n\t\t\t\t\tis(\"full\"),\n\t\t\t\t\tbs(\"full\"),\n\t\t\t\t\tm(0),\n\t\t\t\t\tp(0),\n\t\t\t\t\tborder({ width: 0, style: \"none\" }),\n\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\tfg(\"inherit\"),\n\t\t\t\t\traw({ font: \"inherit\" }),\n\t\t\t\t\ttextAlign(\"start\"),\n\t\t\t\t\tcursor(\"inherit\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children ?? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Select.Value />\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tdata-slot=\"icon\"\n\t\t\t\t\t\t\tmix={[\n\t\t\t\t\t\t\t\tattrs({ \"aria-hidden\": DEFAULT_ICON_ARIA_HIDDEN }),\n\t\t\t\t\t\t\t\tinlineFlex(),\n\t\t\t\t\t\t\t\tshrink(),\n\t\t\t\t\t\t\t\ttransition(\"transform\"),\n\t\t\t\t\t\t\t\twhen(\"& svg\", [is(\"1rem\"), bs(\"1rem\")]),\n\t\t\t\t\t\t\t\tmedia(\"(prefers-reduced-motion: reduce)\", transitionDuration(\"0s\")),\n\t\t\t\t\t\t\t\tfg(\"neutral.muted\"),\n\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ChevronDownIcon />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</button>\n\t\t);\n\t};\n};\n\n/**\n * Renders a native `<selectedcontent>` element inside {@link Select.Trigger},\n * mirroring the currently selected {@link Select.Option}'s content via the\n * platform; `children` render as a fallback where it's treated as unknown.\n *\n * @param handle Runtime handle carrying the host element's props.\n * @returns The render function producing the value slot's markup.\n * @example\n * <Select.Value />\n * @example\n * <Select.Value>{t(\"form.plan.placeholder\")}</Select.Value>\n */\nSelect.Value = function SelectValue(handle: Handle<Select.ValueProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<selectedcontent\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tmirrorSelectedOption(),\n\t\t\t\t\tgrow(),\n\t\t\t\t\tshrink(1),\n\t\t\t\t\tbasis(\"0%\"),\n\t\t\t\t\ttruncate(),\n\t\t\t\t\ttextAlign(\"start\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a native `<option>` styled for the rounded, padded row a\n * supporting browser shows inside {@link Select}'s `::picker(select)`\n * dropdown, reading its own hover, focus, checked, and disabled states.\n *\n * @param handle Runtime handle carrying the host `<option>`'s props.\n * @returns The render function producing the option's markup.\n * @example\n * <Select.Option value=\"us\">{t(\"countries.us\")}</Select.Option>\n * @example\n * <Select.Option value=\"\" disabled>{t(\"form.country.placeholder\")}</Select.Option>\n */\nSelect.Option = function SelectOption(handle: Handle<Select.OptionProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<option\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tcursor(\"default\"),\n\t\t\t\t\tpi(\"0.75rem\"),\n\t\t\t\t\tpb(\"0.5rem\"),\n\t\t\t\t\ttext(\"sm\"),\n\t\t\t\t\toutline(\"none\"),\n\t\t\t\t\twhen(\"&:disabled\", opacity(50)),\n\t\t\t\t\twhen(\"&::checkmark\", fg(\"currentColor\")),\n\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\ttransition(\n\t\t\t\t\t\t\"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke\",\n\t\t\t\t\t),\n\t\t\t\t\twhen(\"&:hover\", bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\twhen(\"&:active\", bg(\"neutral.bg-tint-pressed\")),\n\t\t\t\t\twhen(\"&:focus\", bg(\"brand.tint\")),\n\t\t\t\t\twhen(\"&:checked\", [bg(\"brand.solid\"), fg(\"brand.onSolid\")]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a native `<optgroup>` styled as a padded run of\n * {@link Select.Option}s, set off from the group before it by a\n * block-start divider on every group after the first.\n *\n * @param handle Runtime handle carrying the host `<optgroup>`'s props.\n * @returns The render function producing the group's markup.\n * @example\n * <Select.Group label={t(\"form.plan.groups.personal\")}>\n * \t<Select.Option value=\"free\">{t(\"plans.free\")}</Select.Option>\n * \t<Select.Option value=\"pro\">{t(\"plans.pro\")}</Select.Option>\n * </Select.Group>\n */\nSelect.Group = function SelectGroup(handle: Handle<Select.GroupProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\tif (import.meta.env.DEV && !rest.label) {\n\t\t\tconsole.warn(\n\t\t\t\t\"Select.Group: an `optgroup` with no `label` renders with no visible heading for its options — pass a `label` describing the group.\",\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<optgroup\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\twhen(\"&:not(:first-child)\", borderEdge(\"block-start\", { width: 1 })),\n\t\t\t\t\tpb(\"0.25rem\"),\n\t\t\t\t\twhen(\"&:not(:first-child)\", border(\"neutral\")),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n"
10
+ "content": "/**\n * A native `<select>` styled as a bordered, rounded field and progressively\n * upgraded with customizable-select rendering — a custom trigger button, a\n * value slot mirroring the current selection, and richly styled options and\n * groups — wherever the browser resolves `appearance: base-select`. The\n * trigger, value, and picker styling layer on top of ordinary\n * `<option>`/`<optgroup>` markup, so every browser renders a working\n * dropdown from that same markup.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { ChevronDownIcon } from \"@sdxc/icons\";\nimport { bg, border, borderEdge, fg, outline, outlineStyle, outlineWidth } from \"@sdxc/u/color\";\nimport {\n\topacity,\n\trounded,\n\ttransition,\n\ttransitionBehavior,\n\ttransitionDuration,\n} from \"@sdxc/u/effects\";\nimport { cursor, raw } from \"@sdxc/u/general\";\nimport {\n\tappearance,\n\tbasis,\n\tflex,\n\tgap,\n\tgrow,\n\tinlineFlex,\n\tinset,\n\titems,\n\tjustify,\n\tshrink,\n} from \"@sdxc/u/layout\";\nimport { overflow } from \"@sdxc/u/overflow\";\nimport { media, startingStyle } from \"@sdxc/u/responsive\";\nimport { bs, is, m, maxBs, p, pb, pi } from \"@sdxc/u/size\";\nimport { data, hover, when } from \"@sdxc/u/state\";\nimport { text, textAlign, truncate } from \"@sdxc/u/typography\";\nimport { attrs } from \"remix/component\";\n\nimport { durations } from \"@sdxc/ui/animations\";\nimport { mirrorSelectedOption } from \"@sdxc/ui/mixins\";\nimport { floatingSurface, surfaceInset } from \"@sdxc/ui/styles\";\n\n/**\n * The `<selectedcontent>` element mirrors the currently selected\n * `<option>`'s rendered content inside a customized `<select>`'s trigger\n * button, its attribute shape declared here to match a plain `<span>`'s.\n */\ndeclare global {\n\tnamespace JSX {\n\t\tinterface IntrinsicHTMLElements {\n\t\t\tselectedcontent: IntrinsicHTMLElements[\"span\"];\n\t\t}\n\t}\n}\n\n/** Semantic color role {@link Select} falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: Select.Color = \"neutral\";\n\n/**\n * `type` {@link Select.Trigger} falls back to when a consumer doesn't supply\n * one, keeping a click on the trigger from submitting a surrounding `<form>`\n * the way a bare `<button>`'s default type otherwise would.\n */\nconst DEFAULT_TRIGGER_TYPE: NonNullable<Select.TriggerProps[\"type\"]> = \"button\";\n\n/**\n * `aria-hidden` applied through {@link attrs} to {@link Select.Trigger}'s\n * default chevron glyph unless a consumer overrides it, keeping the\n * decorative icon out of the accessibility tree.\n */\nconst DEFAULT_ICON_ARIA_HIDDEN = \"true\";\n\n/**\n * Prop types for {@link Select} and its compound parts.\n */\nexport namespace Select {\n\t/**\n\t * Semantic color role, each mapped to its matching `--ui-*` variables.\n\t */\n\texport type Color = \"brand\" | \"neutral\" | \"success\" | \"warning\" | \"danger\";\n\n\t/**\n\t * Every native `<select>` attribute, unchanged, plus the `mix` passthrough.\n\t * `multiple` and a `size` greater than `1` remain functional but switch\n\t * rendering back to the plain list-box; `role` is already implicit.\n\t */\n\t/**\n\t * `value` and `defaultValue` are left out on purpose. A `<select>` takes its selection\n\t * from the option carrying `selected` and nothing else reads either attribute, so a\n\t * value passed here goes unread and the field quietly shows its first option. Mark the\n\t * option instead: `<Select.Option value=\"eu\" selected>`.\n\t */\n\texport interface Props extends Omit<TagProps<\"select\">, \"role\" | \"defaultValue\" | \"value\"> {\n\t\t/** Semantic color role for the focus-visible ring. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t}\n\n\t/**\n\t * Every native `<button>` attribute, unchanged, plus the `mix` passthrough.\n\t * `type` defaults to {@link DEFAULT_TRIGGER_TYPE}.\n\t */\n\texport interface TriggerProps extends TagProps<\"button\"> {}\n\n\t/**\n\t * Every attribute a plain `<span>` accepts, unchanged, plus the `mix`\n\t * passthrough. Any `children` supplied render as a fallback in browsers\n\t * treating `<selectedcontent>` as unknown — see {@link Select.Value}.\n\t */\n\texport interface ValueProps extends TagProps<\"selectedcontent\"> {}\n\n\t/**\n\t * Every native `<option>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface OptionProps extends TagProps<\"option\"> {}\n\n\t/**\n\t * Every native `<optgroup>` attribute, unchanged, plus the `mix`\n\t * passthrough.\n\t */\n\texport interface GroupProps extends TagProps<\"optgroup\"> {}\n}\n\n/**\n * Renders a native `<select>` styled as a bordered, rounded field that\n * progressively upgrades to customizable-select rendering via\n * `appearance: base-select`, falling back to the platform's own dropdown.\n *\n * @param handle Runtime handle carrying the host `<select>`'s props.\n * @returns The render function producing the field's markup.\n * @example\n * <Select aria-label={t(\"form.country.label\")} required>\n * \t<Select.Option value=\"\">{t(\"form.country.placeholder\")}</Select.Option>\n * \t<Select.Option value=\"us\">{t(\"countries.us\")}</Select.Option>\n * \t<Select.Option value=\"ca\">{t(\"countries.ca\")}</Select.Option>\n * </Select>\n * @example\n * <Select aria-label={t(\"form.plan.label\")} color=\"brand\">\n * \t<Select.Trigger />\n * \t<Select.Group label={t(\"form.plan.groups.personal\")}>\n * \t\t<Select.Option value=\"free\">{t(\"plans.free\")}</Select.Option>\n * \t\t<Select.Option value=\"pro\">{t(\"plans.pro\")}</Select.Option>\n * \t</Select.Group>\n * </Select>\n */\nexport function Select(handle: Handle<Select.Props>) {\n\treturn () => {\n\t\tlet { color, multiple, size, mix, ...rest } = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\n\t\tif (import.meta.env?.DEV && (multiple || (typeof size === \"number\" && size > 1))) {\n\t\t\tconsole.warn(\n\t\t\t\t\"Select: `appearance: base-select` styling has no effect on a `multiple` select or one with a `size` greater than 1 — the browser keeps its plain list-box rendering there instead of the customized trigger, value, and option styling.\",\n\t\t\t);\n\t\t}\n\n\t\tlet fieldMix = [\n\t\t\tflex(),\n\t\t\titems(\"center\"),\n\t\t\tjustify(\"between\"),\n\t\t\tcursor(\"default\"),\n\t\t\ttext(\"sm\"),\n\t\t\t/**\n\t\t\t * Focus draws a ring standing off the field and the border steps only to its hover weight,\n\t\t\t * so the field keeps its shape. The pointer and keyboard selectors exclude each other because\n\t\t\t * `outline: none` is a shorthand that, from a later layer, resets the whole ring.\n\t\t\t */\n\t\t\twhen(\"&:focus:not(:focus-visible)\", outline(\"none\")),\n\t\t\twhen(\"&:focus-visible\", [\n\t\t\t\tborder(\"neutral.border-hover\"),\n\t\t\t\toutline({ color: \"brand.ring\", offset: 2 }),\n\t\t\t\tdata(\"color\", \"success\", outline(\"success.ring\")),\n\t\t\t\tdata(\"color\", \"warning\", outline(\"warning.ring\")),\n\t\t\t\tdata(\"color\", \"danger\", outline(\"danger.ring\")),\n\t\t\t]),\n\t\t\twhen('&[aria-invalid=\"true\"], &:user-invalid', [\n\t\t\t\toutlineWidth(\"2px\"),\n\t\t\t\toutlineStyle(\"solid\"),\n\t\t\t\traw({ outlineOffset: \"2px\" }),\n\t\t\t]),\n\t\t\twhen(\"&:disabled\", [cursor(\"not-allowed\"), opacity(50)]),\n\n\t\t\twhen(\"&::picker(select)\", [\n\t\t\t\tfloatingSurface(),\n\t\t\t\tsurfaceInset(),\n\t\t\t\tm(0),\n\t\t\t\tinset(\"auto\"),\n\t\t\t\tmaxBs(\"15rem\"),\n\t\t\t\toverflow(\"auto\"),\n\t\t\t\toutline(\"none\"),\n\t\t\t\topacity(0),\n\t\t\t\ttransition(\"opacity, display, overlay\", { duration: durations.fast }),\n\t\t\t\ttransitionBehavior(\"allow-discrete\"),\n\t\t\t]),\n\t\t\twhen(\"&:open::picker(select)\", opacity(100)),\n\t\t\tstartingStyle(when(\"&:open::picker(select)\", opacity(0))),\n\t\t\tmedia(\n\t\t\t\t\"(prefers-reduced-motion: reduce)\",\n\t\t\t\twhen(\"&::picker(select)\", transitionDuration(\"0s\")),\n\t\t\t),\n\t\t\traw({\n\t\t\t\t\"&:open\": {\n\t\t\t\t\t'& [data-slot=\"icon\"]': {\n\t\t\t\t\t\ttransform: \"rotate(180deg)\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t\"&:has(option:checked:disabled)\": {\n\t\t\t\t\t\"& selectedcontent\": {\n\t\t\t\t\t\tcolor: \"var(--ui-neutral-fg-muted)\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t\tgap(\"0.5rem\"),\n\t\t\tis(\"full\"),\n\t\t\tbs(\"2.5rem\"),\n\t\t\trounded(\"md\"),\n\t\t\tborder({ color: \"neutral\", width: 1 }),\n\t\t\tbg(\"neutral.tint\"),\n\t\t\tfg(\"neutral.emphasis\"),\n\t\t\tpi(\"0.75rem\"),\n\t\t\tpb(\"0.5rem\"),\n\t\t\tappearance(\"base-select\"),\n\t\t\ttransition(\n\t\t\t\t\"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter\",\n\t\t\t),\n\t\t\thover(border(\"neutral.border-hover\")),\n\t\t\twhen(\"&:focus\", border(\"neutral.border-hover\")),\n\t\t\twhen('&[aria-invalid=\"true\"], &:user-invalid', [\n\t\t\t\tborder(\"danger\"),\n\t\t\t\toutline({ color: \"danger.ring\", offset: 2 }),\n\t\t\t]),\n\t\t\twhen(\"&:disabled\", bg(\"neutral.bg-tint-hover\")),\n\t\t\traw({\n\t\t\t\t\"&::picker(select)\": {\n\t\t\t\t\tborderRadius: \"var(--ui-radius-lg, 0.5rem)\",\n\t\t\t\t\tborderWidth: \"1px\",\n\t\t\t\t\tborderStyle: \"solid\",\n\t\t\t\t\tborderColor: \"var(--ui-neutral-border)\",\n\t\t\t\t\tbackgroundColor: \"var(--ui-neutral-bg-tint)\",\n\t\t\t\t},\n\t\t\t\t\"&::picker-icon\": {\n\t\t\t\t\tcolor: \"var(--ui-neutral-fg-muted)\",\n\t\t\t\t},\n\t\t\t}),\n\t\t\tmix,\n\t\t] as unknown as Select.Props[\"mix\"];\n\n\t\treturn (\n\t\t\t<select multiple={multiple} size={size} data-color={resolvedColor} {...rest} mix={fieldMix} />\n\t\t);\n\t};\n}\n\n/**\n * Renders {@link Select}'s customizable trigger: a native `<button>` placed\n * as {@link Select}'s first child, showing {@link Select.Value} and a\n * rotating chevron by default, filling the field's box edge to edge.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the trigger's markup.\n * @example\n * <Select.Trigger />\n * @example\n * <Select.Trigger>\n * \t<Select.Value>{t(\"form.plan.placeholder\")}</Select.Value>\n * </Select.Trigger>\n */\nSelect.Trigger = function SelectTrigger(handle: Handle<Select.TriggerProps>) {\n\treturn () => {\n\t\tlet { type, children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\ttype={type ?? DEFAULT_TRIGGER_TYPE}\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tflex(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"between\"),\n\t\t\t\t\tgap(\"0.5rem\"),\n\t\t\t\t\tis(\"full\"),\n\t\t\t\t\tbs(\"full\"),\n\t\t\t\t\tm(0),\n\t\t\t\t\tp(0),\n\t\t\t\t\tborder({ width: 0, style: \"none\" }),\n\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\tfg(\"inherit\"),\n\t\t\t\t\traw({ font: \"inherit\" }),\n\t\t\t\t\ttextAlign(\"start\"),\n\t\t\t\t\tcursor(\"inherit\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children ?? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Select.Value />\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tdata-slot=\"icon\"\n\t\t\t\t\t\t\tmix={[\n\t\t\t\t\t\t\t\tattrs({ \"aria-hidden\": DEFAULT_ICON_ARIA_HIDDEN }),\n\t\t\t\t\t\t\t\tinlineFlex(),\n\t\t\t\t\t\t\t\tshrink(),\n\t\t\t\t\t\t\t\ttransition(\"transform\"),\n\t\t\t\t\t\t\t\twhen(\"& svg\", [is(\"1rem\"), bs(\"1rem\")]),\n\t\t\t\t\t\t\t\tmedia(\"(prefers-reduced-motion: reduce)\", transitionDuration(\"0s\")),\n\t\t\t\t\t\t\t\tfg(\"neutral.muted\"),\n\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ChevronDownIcon />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</button>\n\t\t);\n\t};\n};\n\n/**\n * Renders a native `<selectedcontent>` element inside {@link Select.Trigger},\n * mirroring the currently selected {@link Select.Option}'s content via the\n * platform; `children` render as a fallback where it's treated as unknown.\n *\n * @param handle Runtime handle carrying the host element's props.\n * @returns The render function producing the value slot's markup.\n * @example\n * <Select.Value />\n * @example\n * <Select.Value>{t(\"form.plan.placeholder\")}</Select.Value>\n */\nSelect.Value = function SelectValue(handle: Handle<Select.ValueProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<selectedcontent\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tmirrorSelectedOption(),\n\t\t\t\t\tgrow(),\n\t\t\t\t\tshrink(1),\n\t\t\t\t\tbasis(\"0%\"),\n\t\t\t\t\ttruncate(),\n\t\t\t\t\ttextAlign(\"start\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a native `<option>` styled for the rounded, padded row a\n * supporting browser shows inside {@link Select}'s `::picker(select)`\n * dropdown, reading its own hover, focus, checked, and disabled states.\n *\n * @param handle Runtime handle carrying the host `<option>`'s props.\n * @returns The render function producing the option's markup.\n * @example\n * <Select.Option value=\"us\">{t(\"countries.us\")}</Select.Option>\n * @example\n * <Select.Option value=\"\" disabled>{t(\"form.country.placeholder\")}</Select.Option>\n */\nSelect.Option = function SelectOption(handle: Handle<Select.OptionProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<option\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tcursor(\"default\"),\n\t\t\t\t\tpi(\"0.75rem\"),\n\t\t\t\t\tpb(\"0.5rem\"),\n\t\t\t\t\ttext(\"sm\"),\n\t\t\t\t\toutline(\"none\"),\n\t\t\t\t\twhen(\"&:disabled\", opacity(50)),\n\t\t\t\t\twhen(\"&::checkmark\", fg(\"currentColor\")),\n\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\ttransition(\n\t\t\t\t\t\t\"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke\",\n\t\t\t\t\t),\n\t\t\t\t\twhen(\"&:hover\", bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\twhen(\"&:active\", bg(\"neutral.bg-tint-pressed\")),\n\t\t\t\t\twhen(\"&:focus\", bg(\"brand.tint\")),\n\t\t\t\t\twhen(\"&:checked\", [bg(\"brand.solid\"), fg(\"brand.onSolid\")]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a native `<optgroup>` styled as a padded run of\n * {@link Select.Option}s, set off from the group before it by a\n * block-start divider on every group after the first.\n *\n * @param handle Runtime handle carrying the host `<optgroup>`'s props.\n * @returns The render function producing the group's markup.\n * @example\n * <Select.Group label={t(\"form.plan.groups.personal\")}>\n * \t<Select.Option value=\"free\">{t(\"plans.free\")}</Select.Option>\n * \t<Select.Option value=\"pro\">{t(\"plans.pro\")}</Select.Option>\n * </Select.Group>\n */\nSelect.Group = function SelectGroup(handle: Handle<Select.GroupProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\tif (import.meta.env?.DEV && !rest.label) {\n\t\t\tconsole.warn(\n\t\t\t\t\"Select.Group: an `optgroup` with no `label` renders with no visible heading for its options — pass a `label` describing the group.\",\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<optgroup\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\twhen(\"&:not(:first-child)\", borderEdge(\"block-start\", { width: 1 })),\n\t\t\t\t\tpb(\"0.25rem\"),\n\t\t\t\t\twhen(\"&:not(:first-child)\", border(\"neutral\")),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n"
11
11
  },
12
12
  "test": null
13
13
  }
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "shared-element",
3
- "changedIn": "2026.10.2",
3
+ "changedIn": "2026.10.20",
4
4
  "dependencies": [],
5
5
  "exports": [
6
6
  "SharedElement"
7
7
  ],
8
8
  "source": {
9
9
  "path": "shared-element.tsx",
10
- "content": "/**\n * A plain host that carries a stable view-transition identity across\n * separate page loads, so a same-origin, cross-document navigation morphs it\n * from its old position, size, and appearance into its new one instead of\n * replacing it outright. Its identity comes straight from its own `id`,\n * matched against the same `id` on the corresponding element in the document\n * being navigated to or from — no script, snapshotting, or scope wrapper\n * required for this baseline.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { block } from \"@sdxc/u/layout\";\n\nimport { mergeStyle } from \"@sdxc/ui/utils\";\n\n/**\n * Written as plain CSS text inside a `<style>` element: `@view-transition`\n * accepts only descriptors, and `::view-transition-group(*)` selects from\n * the browser's own transition tree, both needing selectors written directly in CSS.\n */\nconst CROSS_DOCUMENT_TRANSITION_STYLESHEET = `\n@view-transition {\n\tnavigation: auto;\n}\n\n@media (prefers-reduced-motion: reduce) {\n\t::view-transition-group(*) {\n\t\tanimation: none;\n\t}\n}\n`;\n\n/**\n * Prop types for {@link SharedElement}.\n */\nexport namespace SharedElement {\n\t/**\n\t * Props accepted by {@link SharedElement}: every native `<div>` attribute\n\t * plus the `mix` passthrough. `id` doubles as the view transition identity,\n\t * matched against the same `id` in the document navigated to or from.\n\t */\n\texport interface Props extends TagProps<\"div\"> {}\n}\n\n/**\n * Renders a plain `<div>` host whose `view-transition-name` comes from its\n * own `id`, so a same-origin, cross-document navigation matching that `id`\n * on the other side morphs the element instead of replacing it outright.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the host's markup.\n * @example\n * // On the listing page\n * <SharedElement id={`cover-${book.slug}`}>\n * \t<img src={book.coverUrl} alt={book.title} />\n * </SharedElement>\n * @example\n * // On the book's own page — the matching `id` lets the browser morph\n * // between the two instead of swapping the image outright.\n * <SharedElement id={`cover-${book.slug}`}>\n * \t<img src={book.coverUrl} alt={book.title} />\n * </SharedElement>\n */\nexport function SharedElement(handle: Handle<SharedElement.Props>) {\n\treturn () => {\n\t\tlet { id, mix, style, ...rest } = handle.props;\n\n\t\tif (import.meta.env.DEV && !id) {\n\t\t\tconsole.warn(\n\t\t\t\t'SharedElement rendered without an \"id\" — the browser has nothing to match it against on the other side of a cross-document view transition.',\n\t\t\t);\n\t\t}\n\n\t\tlet resolvedStyle = mergeStyle(style, { \"view-transition-name\": id });\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<style>{CROSS_DOCUMENT_TRANSITION_STYLESHEET}</style>\n\t\t\t\t<div {...rest} id={id} style={resolvedStyle} mix={[block(), mix]} />\n\t\t\t</>\n\t\t);\n\t};\n}\n"
10
+ "content": "/**\n * A plain host that carries a stable view-transition identity across\n * separate page loads, so a same-origin, cross-document navigation morphs it\n * from its old position, size, and appearance into its new one instead of\n * replacing it outright. Its identity comes straight from its own `id`,\n * matched against the same `id` on the corresponding element in the document\n * being navigated to or from — no script, snapshotting, or scope wrapper\n * required for this baseline.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { block } from \"@sdxc/u/layout\";\n\nimport { mergeStyle } from \"@sdxc/ui/utils\";\n\n/**\n * Written as plain CSS text inside a `<style>` element: `@view-transition`\n * accepts only descriptors, and `::view-transition-group(*)` selects from\n * the browser's own transition tree, both needing selectors written directly in CSS.\n */\nconst CROSS_DOCUMENT_TRANSITION_STYLESHEET = `\n@view-transition {\n\tnavigation: auto;\n}\n\n@media (prefers-reduced-motion: reduce) {\n\t::view-transition-group(*) {\n\t\tanimation: none;\n\t}\n}\n`;\n\n/**\n * Prop types for {@link SharedElement}.\n */\nexport namespace SharedElement {\n\t/**\n\t * Props accepted by {@link SharedElement}: every native `<div>` attribute\n\t * plus the `mix` passthrough. `id` doubles as the view transition identity,\n\t * matched against the same `id` in the document navigated to or from.\n\t */\n\texport interface Props extends TagProps<\"div\"> {}\n}\n\n/**\n * Renders a plain `<div>` host whose `view-transition-name` comes from its\n * own `id`, so a same-origin, cross-document navigation matching that `id`\n * on the other side morphs the element instead of replacing it outright.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the host's markup.\n * @example\n * // On the listing page\n * <SharedElement id={`cover-${book.slug}`}>\n * \t<img src={book.coverUrl} alt={book.title} />\n * </SharedElement>\n * @example\n * // On the book's own page — the matching `id` lets the browser morph\n * // between the two instead of swapping the image outright.\n * <SharedElement id={`cover-${book.slug}`}>\n * \t<img src={book.coverUrl} alt={book.title} />\n * </SharedElement>\n */\nexport function SharedElement(handle: Handle<SharedElement.Props>) {\n\treturn () => {\n\t\tlet { id, mix, style, ...rest } = handle.props;\n\n\t\tif (import.meta.env?.DEV && !id) {\n\t\t\tconsole.warn(\n\t\t\t\t'SharedElement rendered without an \"id\" — the browser has nothing to match it against on the other side of a cross-document view transition.',\n\t\t\t);\n\t\t}\n\n\t\tlet resolvedStyle = mergeStyle(style, { \"view-transition-name\": id });\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<style>{CROSS_DOCUMENT_TRANSITION_STYLESHEET}</style>\n\t\t\t\t<div {...rest} id={id} style={resolvedStyle} mix={[block(), mix]} />\n\t\t\t</>\n\t\t);\n\t};\n}\n"
11
11
  },
12
12
  "test": null
13
13
  }