@sdxc/ui 0.0.0-pre.1

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 (399) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +812 -0
  3. package/dist/animations/index.d.ts +12 -0
  4. package/dist/animations/index.js +12 -0
  5. package/dist/animations/keyframes.d.ts +162 -0
  6. package/dist/animations/keyframes.js +297 -0
  7. package/dist/animations/scroll.d.ts +154 -0
  8. package/dist/animations/scroll.js +228 -0
  9. package/dist/animations/tokens.d.ts +47 -0
  10. package/dist/animations/tokens.js +47 -0
  11. package/dist/animations/transitions.d.ts +143 -0
  12. package/dist/animations/transitions.js +147 -0
  13. package/dist/behaviors/announcer.d.ts +90 -0
  14. package/dist/behaviors/announcer.js +93 -0
  15. package/dist/behaviors/calendar-model.d.ts +218 -0
  16. package/dist/behaviors/calendar-model.js +376 -0
  17. package/dist/behaviors/drag-session.d.ts +119 -0
  18. package/dist/behaviors/drag-session.js +110 -0
  19. package/dist/behaviors/filter-model.d.ts +117 -0
  20. package/dist/behaviors/filter-model.js +185 -0
  21. package/dist/behaviors/index.d.ts +16 -0
  22. package/dist/behaviors/index.js +16 -0
  23. package/dist/behaviors/resize-session.d.ts +115 -0
  24. package/dist/behaviors/resize-session.js +157 -0
  25. package/dist/behaviors/scroll-follow-model.d.ts +180 -0
  26. package/dist/behaviors/scroll-follow-model.js +197 -0
  27. package/dist/behaviors/selection-model.d.ts +129 -0
  28. package/dist/behaviors/selection-model.js +259 -0
  29. package/dist/behaviors/toaster.d.ts +144 -0
  30. package/dist/behaviors/toaster.js +228 -0
  31. package/dist/components/accordion.d.ts +93 -0
  32. package/dist/components/accordion.js +165 -0
  33. package/dist/components/alert-dialog.d.ts +110 -0
  34. package/dist/components/alert-dialog.js +169 -0
  35. package/dist/components/alert.d.ts +109 -0
  36. package/dist/components/alert.js +160 -0
  37. package/dist/components/aspect-ratio.d.ts +44 -0
  38. package/dist/components/aspect-ratio.js +35 -0
  39. package/dist/components/attachment.d.ts +146 -0
  40. package/dist/components/attachment.js +320 -0
  41. package/dist/components/avatar.d.ts +118 -0
  42. package/dist/components/avatar.js +89 -0
  43. package/dist/components/badge.d.ts +66 -0
  44. package/dist/components/badge.js +129 -0
  45. package/dist/components/breadcrumbs.d.ts +67 -0
  46. package/dist/components/breadcrumbs.js +121 -0
  47. package/dist/components/bubble.d.ts +91 -0
  48. package/dist/components/bubble.js +216 -0
  49. package/dist/components/button.d.ts +78 -0
  50. package/dist/components/button.js +207 -0
  51. package/dist/components/calendar.d.ts +166 -0
  52. package/dist/components/calendar.js +320 -0
  53. package/dist/components/card.d.ts +82 -0
  54. package/dist/components/card.js +126 -0
  55. package/dist/components/carousel.d.ts +96 -0
  56. package/dist/components/carousel.js +214 -0
  57. package/dist/components/chart.d.ts +485 -0
  58. package/dist/components/chart.js +563 -0
  59. package/dist/components/checkbox-group.d.ts +58 -0
  60. package/dist/components/checkbox-group.js +53 -0
  61. package/dist/components/checkbox.d.ts +61 -0
  62. package/dist/components/checkbox.js +81 -0
  63. package/dist/components/color-area.d.ts +83 -0
  64. package/dist/components/color-area.js +251 -0
  65. package/dist/components/color-field.d.ts +128 -0
  66. package/dist/components/color-field.js +73 -0
  67. package/dist/components/color-picker.d.ts +132 -0
  68. package/dist/components/color-picker.js +183 -0
  69. package/dist/components/color-slider.d.ts +103 -0
  70. package/dist/components/color-slider.js +198 -0
  71. package/dist/components/color-swatch-picker.d.ts +106 -0
  72. package/dist/components/color-swatch-picker.js +75 -0
  73. package/dist/components/color-swatch.d.ts +57 -0
  74. package/dist/components/color-swatch.js +82 -0
  75. package/dist/components/color-wheel.d.ts +58 -0
  76. package/dist/components/color-wheel.js +160 -0
  77. package/dist/components/combobox.d.ts +73 -0
  78. package/dist/components/combobox.js +108 -0
  79. package/dist/components/command.d.ts +80 -0
  80. package/dist/components/command.js +151 -0
  81. package/dist/components/confirm.d.ts +124 -0
  82. package/dist/components/confirm.js +56 -0
  83. package/dist/components/context-menu.d.ts +108 -0
  84. package/dist/components/context-menu.js +200 -0
  85. package/dist/components/date-field.d.ts +110 -0
  86. package/dist/components/date-field.js +49 -0
  87. package/dist/components/date-picker.d.ts +136 -0
  88. package/dist/components/date-picker.js +155 -0
  89. package/dist/components/date-range-picker.d.ts +152 -0
  90. package/dist/components/date-range-picker.js +106 -0
  91. package/dist/components/description.d.ts +36 -0
  92. package/dist/components/description.js +21 -0
  93. package/dist/components/dialog.d.ts +97 -0
  94. package/dist/components/dialog.js +203 -0
  95. package/dist/components/disclosure.d.ts +85 -0
  96. package/dist/components/disclosure.js +180 -0
  97. package/dist/components/drawer.d.ts +82 -0
  98. package/dist/components/drawer.js +162 -0
  99. package/dist/components/drop-indicator.d.ts +43 -0
  100. package/dist/components/drop-indicator.js +47 -0
  101. package/dist/components/drop-zone.d.ts +73 -0
  102. package/dist/components/drop-zone.js +54 -0
  103. package/dist/components/empty.d.ts +89 -0
  104. package/dist/components/empty.js +129 -0
  105. package/dist/components/field-error.d.ts +41 -0
  106. package/dist/components/field-error.js +36 -0
  107. package/dist/components/file-trigger.d.ts +84 -0
  108. package/dist/components/file-trigger.js +169 -0
  109. package/dist/components/form.d.ts +118 -0
  110. package/dist/components/form.js +113 -0
  111. package/dist/components/grid-list.d.ts +112 -0
  112. package/dist/components/grid-list.js +220 -0
  113. package/dist/components/group.d.ts +45 -0
  114. package/dist/components/group.js +44 -0
  115. package/dist/components/header.d.ts +33 -0
  116. package/dist/components/header.js +29 -0
  117. package/dist/components/heading-scope.d.ts +83 -0
  118. package/dist/components/heading-scope.js +82 -0
  119. package/dist/components/heading.d.ts +50 -0
  120. package/dist/components/heading.js +31 -0
  121. package/dist/components/hover-card.d.ts +77 -0
  122. package/dist/components/hover-card.js +151 -0
  123. package/dist/components/image-placeholder.d.ts +105 -0
  124. package/dist/components/image-placeholder.js +212 -0
  125. package/dist/components/index.d.ts +109 -0
  126. package/dist/components/index.js +109 -0
  127. package/dist/components/input.d.ts +53 -0
  128. package/dist/components/input.js +76 -0
  129. package/dist/components/item.d.ts +97 -0
  130. package/dist/components/item.js +185 -0
  131. package/dist/components/keyboard.d.ts +33 -0
  132. package/dist/components/keyboard.js +20 -0
  133. package/dist/components/label.d.ts +38 -0
  134. package/dist/components/label.js +24 -0
  135. package/dist/components/link-button.d.ts +59 -0
  136. package/dist/components/link-button.js +174 -0
  137. package/dist/components/link.d.ts +43 -0
  138. package/dist/components/link.js +85 -0
  139. package/dist/components/listbox.d.ts +119 -0
  140. package/dist/components/listbox.js +114 -0
  141. package/dist/components/logo.d.ts +117 -0
  142. package/dist/components/logo.js +89 -0
  143. package/dist/components/marker.d.ts +82 -0
  144. package/dist/components/marker.js +163 -0
  145. package/dist/components/menu.d.ts +90 -0
  146. package/dist/components/menu.js +146 -0
  147. package/dist/components/menubar.d.ts +54 -0
  148. package/dist/components/menubar.js +118 -0
  149. package/dist/components/message-scroller.d.ts +109 -0
  150. package/dist/components/message-scroller.js +180 -0
  151. package/dist/components/message.d.ts +104 -0
  152. package/dist/components/message.js +200 -0
  153. package/dist/components/meter.d.ts +60 -0
  154. package/dist/components/meter.js +110 -0
  155. package/dist/components/modal.d.ts +71 -0
  156. package/dist/components/modal.js +120 -0
  157. package/dist/components/nav-link.d.ts +53 -0
  158. package/dist/components/nav-link.js +83 -0
  159. package/dist/components/navigation-menu.d.ts +150 -0
  160. package/dist/components/navigation-menu.js +381 -0
  161. package/dist/components/number-field.d.ts +76 -0
  162. package/dist/components/number-field.js +190 -0
  163. package/dist/components/otp-field.d.ts +68 -0
  164. package/dist/components/otp-field.js +46 -0
  165. package/dist/components/overlay-arrow.d.ts +51 -0
  166. package/dist/components/overlay-arrow.js +77 -0
  167. package/dist/components/pagination.d.ts +67 -0
  168. package/dist/components/pagination.js +164 -0
  169. package/dist/components/popover.d.ts +69 -0
  170. package/dist/components/popover.js +68 -0
  171. package/dist/components/progress-bar.d.ts +53 -0
  172. package/dist/components/progress-bar.js +90 -0
  173. package/dist/components/radio-group.d.ts +102 -0
  174. package/dist/components/radio-group.js +114 -0
  175. package/dist/components/range-calendar.d.ts +169 -0
  176. package/dist/components/range-calendar.js +216 -0
  177. package/dist/components/resizable.d.ts +98 -0
  178. package/dist/components/resizable.js +151 -0
  179. package/dist/components/scroll-area.d.ts +54 -0
  180. package/dist/components/scroll-area.js +89 -0
  181. package/dist/components/search-field.d.ts +55 -0
  182. package/dist/components/search-field.js +49 -0
  183. package/dist/components/section.d.ts +37 -0
  184. package/dist/components/section.js +22 -0
  185. package/dist/components/select.d.ts +96 -0
  186. package/dist/components/select.js +285 -0
  187. package/dist/components/selection-indicator.d.ts +47 -0
  188. package/dist/components/selection-indicator.js +50 -0
  189. package/dist/components/sentinel-row.d.ts +22 -0
  190. package/dist/components/sentinel-row.js +29 -0
  191. package/dist/components/separator.d.ts +35 -0
  192. package/dist/components/separator.js +48 -0
  193. package/dist/components/shared-element.d.ts +45 -0
  194. package/dist/components/shared-element.js +48 -0
  195. package/dist/components/sheet.d.ts +78 -0
  196. package/dist/components/sheet.js +167 -0
  197. package/dist/components/sidebar.d.ts +288 -0
  198. package/dist/components/sidebar.js +1068 -0
  199. package/dist/components/skeleton.d.ts +36 -0
  200. package/dist/components/skeleton.js +38 -0
  201. package/dist/components/slider.d.ts +102 -0
  202. package/dist/components/slider.js +179 -0
  203. package/dist/components/spinner.d.ts +55 -0
  204. package/dist/components/spinner.js +51 -0
  205. package/dist/components/switch.d.ts +47 -0
  206. package/dist/components/switch.js +82 -0
  207. package/dist/components/table.d.ts +139 -0
  208. package/dist/components/table.js +216 -0
  209. package/dist/components/tabs.d.ts +124 -0
  210. package/dist/components/tabs.js +246 -0
  211. package/dist/components/tag-group.d.ts +83 -0
  212. package/dist/components/tag-group.js +157 -0
  213. package/dist/components/text-field.d.ts +119 -0
  214. package/dist/components/text-field.js +51 -0
  215. package/dist/components/text.d.ts +34 -0
  216. package/dist/components/text.js +19 -0
  217. package/dist/components/textarea.d.ts +52 -0
  218. package/dist/components/textarea.js +82 -0
  219. package/dist/components/time-field.d.ts +110 -0
  220. package/dist/components/time-field.js +48 -0
  221. package/dist/components/toast.d.ts +149 -0
  222. package/dist/components/toast.js +365 -0
  223. package/dist/components/toggle-button.d.ts +115 -0
  224. package/dist/components/toggle-button.js +237 -0
  225. package/dist/components/toolbar.d.ts +47 -0
  226. package/dist/components/toolbar.js +54 -0
  227. package/dist/components/tooltip.d.ts +52 -0
  228. package/dist/components/tooltip.js +92 -0
  229. package/dist/components/tree.d.ts +123 -0
  230. package/dist/components/tree.js +239 -0
  231. package/dist/components/typeset.d.ts +53 -0
  232. package/dist/components/typeset.js +271 -0
  233. package/dist/index.d.ts +8 -0
  234. package/dist/index.js +8 -0
  235. package/dist/mixins/aria-checked.d.ts +42 -0
  236. package/dist/mixins/aria-checked.js +127 -0
  237. package/dist/mixins/attachment-trigger.d.ts +64 -0
  238. package/dist/mixins/attachment-trigger.js +190 -0
  239. package/dist/mixins/calendar-keys.d.ts +27 -0
  240. package/dist/mixins/calendar-keys.js +113 -0
  241. package/dist/mixins/carousel-controls.d.ts +30 -0
  242. package/dist/mixins/carousel-controls.js +222 -0
  243. package/dist/mixins/chart-tooltip.d.ts +118 -0
  244. package/dist/mixins/chart-tooltip.js +323 -0
  245. package/dist/mixins/clear-field.d.ts +60 -0
  246. package/dist/mixins/clear-field.js +100 -0
  247. package/dist/mixins/color-area-drag.d.ts +58 -0
  248. package/dist/mixins/color-area-drag.js +162 -0
  249. package/dist/mixins/color-channel-sync.d.ts +73 -0
  250. package/dist/mixins/color-channel-sync.js +169 -0
  251. package/dist/mixins/color-preview.d.ts +28 -0
  252. package/dist/mixins/color-preview.js +77 -0
  253. package/dist/mixins/color-wheel-drag.d.ts +58 -0
  254. package/dist/mixins/color-wheel-drag.js +139 -0
  255. package/dist/mixins/combobox-filter.d.ts +59 -0
  256. package/dist/mixins/combobox-filter.js +81 -0
  257. package/dist/mixins/command-filter.d.ts +55 -0
  258. package/dist/mixins/command-filter.js +121 -0
  259. package/dist/mixins/command-keys.d.ts +31 -0
  260. package/dist/mixins/command-keys.js +116 -0
  261. package/dist/mixins/context-menu.d.ts +24 -0
  262. package/dist/mixins/context-menu.js +64 -0
  263. package/dist/mixins/copy-to-clipboard.d.ts +64 -0
  264. package/dist/mixins/copy-to-clipboard.js +109 -0
  265. package/dist/mixins/dismiss.d.ts +77 -0
  266. package/dist/mixins/dismiss.js +151 -0
  267. package/dist/mixins/drag-reorder.d.ts +88 -0
  268. package/dist/mixins/drag-reorder.js +214 -0
  269. package/dist/mixins/drop-zone.d.ts +52 -0
  270. package/dist/mixins/drop-zone.js +132 -0
  271. package/dist/mixins/dual-range.d.ts +60 -0
  272. package/dist/mixins/dual-range.js +100 -0
  273. package/dist/mixins/grid-list-keys.d.ts +34 -0
  274. package/dist/mixins/grid-list-keys.js +260 -0
  275. package/dist/mixins/heading-level-fallback.d.ts +81 -0
  276. package/dist/mixins/heading-level-fallback.js +112 -0
  277. package/dist/mixins/hotkey.d.ts +26 -0
  278. package/dist/mixins/hotkey.js +132 -0
  279. package/dist/mixins/image-fallback.d.ts +57 -0
  280. package/dist/mixins/image-fallback.js +86 -0
  281. package/dist/mixins/index.d.ts +48 -0
  282. package/dist/mixins/index.js +48 -0
  283. package/dist/mixins/listbox-keys.d.ts +52 -0
  284. package/dist/mixins/listbox-keys.js +63 -0
  285. package/dist/mixins/long-press.d.ts +76 -0
  286. package/dist/mixins/long-press.js +130 -0
  287. package/dist/mixins/menu-keys.d.ts +40 -0
  288. package/dist/mixins/menu-keys.js +117 -0
  289. package/dist/mixins/menubar-keys.d.ts +59 -0
  290. package/dist/mixins/menubar-keys.js +230 -0
  291. package/dist/mixins/message-follow.d.ts +56 -0
  292. package/dist/mixins/message-follow.js +368 -0
  293. package/dist/mixins/otp-slots.d.ts +53 -0
  294. package/dist/mixins/otp-slots.js +175 -0
  295. package/dist/mixins/persist.d.ts +36 -0
  296. package/dist/mixins/persist.js +78 -0
  297. package/dist/mixins/press-toggle.d.ts +43 -0
  298. package/dist/mixins/press-toggle.js +61 -0
  299. package/dist/mixins/range-preview.d.ts +26 -0
  300. package/dist/mixins/range-preview.js +120 -0
  301. package/dist/mixins/resize-handle.d.ts +101 -0
  302. package/dist/mixins/resize-handle.js +288 -0
  303. package/dist/mixins/stepper.d.ts +81 -0
  304. package/dist/mixins/stepper.js +194 -0
  305. package/dist/mixins/tab-keys.d.ts +30 -0
  306. package/dist/mixins/tab-keys.js +63 -0
  307. package/dist/mixins/theme-toggle.d.ts +82 -0
  308. package/dist/mixins/theme-toggle.js +158 -0
  309. package/dist/mixins/track-host-node.d.ts +34 -0
  310. package/dist/mixins/track-host-node.js +42 -0
  311. package/dist/mixins/treeKeys.d.ts +57 -0
  312. package/dist/mixins/treeKeys.js +266 -0
  313. package/dist/mixins/validate.d.ts +65 -0
  314. package/dist/mixins/validate.js +139 -0
  315. package/dist/mixins/view-transition.d.ts +56 -0
  316. package/dist/mixins/view-transition.js +111 -0
  317. package/dist/styles/chart-palette.d.ts +34 -0
  318. package/dist/styles/chart-palette.js +27 -0
  319. package/dist/styles/field-stack-layout.d.ts +27 -0
  320. package/dist/styles/field-stack-layout.js +16 -0
  321. package/dist/styles/floating-surface.d.ts +32 -0
  322. package/dist/styles/floating-surface.js +30 -0
  323. package/dist/styles/graphic-host.d.ts +25 -0
  324. package/dist/styles/graphic-host.js +18 -0
  325. package/dist/styles/index.d.ts +20 -0
  326. package/dist/styles/index.js +20 -0
  327. package/dist/styles/interactive-transition.d.ts +32 -0
  328. package/dist/styles/interactive-transition.js +32 -0
  329. package/dist/styles/legend-toggle.d.ts +29 -0
  330. package/dist/styles/legend-toggle.js +24 -0
  331. package/dist/styles/output-caption-text.d.ts +22 -0
  332. package/dist/styles/output-caption-text.js +15 -0
  333. package/dist/styles/panel-chrome.d.ts +34 -0
  334. package/dist/styles/panel-chrome.js +26 -0
  335. package/dist/styles/range-thumb-appearance.d.ts +36 -0
  336. package/dist/styles/range-thumb-appearance.js +76 -0
  337. package/dist/styles/rtl-aware-gradient-direction.d.ts +28 -0
  338. package/dist/styles/rtl-aware-gradient-direction.js +28 -0
  339. package/dist/styles/semantic-color-panel.d.ts +35 -0
  340. package/dist/styles/semantic-color-panel.js +41 -0
  341. package/dist/utils/chart-marker-indices.d.ts +22 -0
  342. package/dist/utils/chart-marker-indices.js +45 -0
  343. package/dist/utils/chart-path.d.ts +86 -0
  344. package/dist/utils/chart-path.js +122 -0
  345. package/dist/utils/chart-scale.d.ts +182 -0
  346. package/dist/utils/chart-scale.js +221 -0
  347. package/dist/utils/color-math.d.ts +252 -0
  348. package/dist/utils/color-math.js +480 -0
  349. package/dist/utils/command-event.d.ts +24 -0
  350. package/dist/utils/command-event.js +26 -0
  351. package/dist/utils/css-styles.d.ts +21 -0
  352. package/dist/utils/css-styles.js +11 -0
  353. package/dist/utils/decorative-icon.d.ts +15 -0
  354. package/dist/utils/decorative-icon.js +15 -0
  355. package/dist/utils/disabled-selector.d.ts +22 -0
  356. package/dist/utils/disabled-selector.js +22 -0
  357. package/dist/utils/dispatch-change.d.ts +17 -0
  358. package/dist/utils/dispatch-change.js +19 -0
  359. package/dist/utils/field-parts.d.ts +26 -0
  360. package/dist/utils/field-parts.js +12 -0
  361. package/dist/utils/full-turn-radians.d.ts +16 -0
  362. package/dist/utils/full-turn-radians.js +16 -0
  363. package/dist/utils/geometry.d.ts +14 -0
  364. package/dist/utils/geometry.js +9 -0
  365. package/dist/utils/has-accessible-text.d.ts +19 -0
  366. package/dist/utils/has-accessible-text.js +30 -0
  367. package/dist/utils/hue-spectrum.d.ts +19 -0
  368. package/dist/utils/hue-spectrum.js +19 -0
  369. package/dist/utils/index.d.ts +35 -0
  370. package/dist/utils/index.js +35 -0
  371. package/dist/utils/is-new-primary-press.d.ts +29 -0
  372. package/dist/utils/is-new-primary-press.js +31 -0
  373. package/dist/utils/keyboard-nav.d.ts +64 -0
  374. package/dist/utils/keyboard-nav.js +79 -0
  375. package/dist/utils/merge-style.d.ts +33 -0
  376. package/dist/utils/merge-style.js +30 -0
  377. package/dist/utils/paired-range-inputs.d.ts +26 -0
  378. package/dist/utils/paired-range-inputs.js +29 -0
  379. package/dist/utils/placement.d.ts +18 -0
  380. package/dist/utils/placement.js +12 -0
  381. package/dist/utils/prefers-reduced-motion.d.ts +17 -0
  382. package/dist/utils/prefers-reduced-motion.js +19 -0
  383. package/dist/utils/resolve-field-wiring.d.ts +83 -0
  384. package/dist/utils/resolve-field-wiring.js +53 -0
  385. package/dist/utils/resolve-fill-percent.d.ts +28 -0
  386. package/dist/utils/resolve-fill-percent.js +34 -0
  387. package/dist/utils/round-precision.d.ts +22 -0
  388. package/dist/utils/round-precision.js +25 -0
  389. package/dist/utils/semantic-color-panel.d.ts +35 -0
  390. package/dist/utils/semantic-color-panel.js +28 -0
  391. package/dist/utils/semantic-color.d.ts +17 -0
  392. package/dist/utils/semantic-color.js +11 -0
  393. package/dist/utils/warn-if-no-accessible-name.d.ts +52 -0
  394. package/dist/utils/warn-if-no-accessible-name.js +55 -0
  395. package/dist/utils/write-cookie.d.ts +35 -0
  396. package/dist/utils/write-cookie.js +37 -0
  397. package/package.json +32 -0
  398. package/src/reset.css +223 -0
  399. package/src/theme.css +146 -0
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx } from "remix/ui/jsx-runtime";
2
+ import { fg } from "@sdxc/u/color";
3
+ import { text, weight } from "@sdxc/u/typography";
4
+ import { attrs } from "remix/ui";
5
+ /**
6
+ * `data-field-error` applied through {@link attrs} unless a consumer
7
+ * overrides it, marking the host as a field's error slot so a validation
8
+ * script can locate it via the field's `aria-describedby` list.
9
+ */
10
+ const DEFAULT_FIELD_ERROR_ATTRIBUTE = true;
11
+ /**
12
+ * Renders a field's validation message. `id` falls back to `handle.id` so
13
+ * a sibling `aria-describedby` can target it via `data-field-error`; pass
14
+ * `hidden` to keep it out of layout until the field is invalid.
15
+ *
16
+ * @param handle Runtime handle carrying the host `<span>`'s props.
17
+ * @returns The render function producing the error message's markup.
18
+ * @example
19
+ * <input id="email" type="email" required aria-describedby="email-error" />
20
+ * <FieldError id="email-error">{t("fields.email.required")}</FieldError>
21
+ * @example
22
+ * <input type="email" required aria-describedby={handle.id} />
23
+ * <FieldError hidden={!errors.email}>{errors.email}</FieldError>
24
+ */
25
+ export function FieldError(handle) {
26
+ return () => {
27
+ let { id, mix, ...rest } = handle.props;
28
+ return (_jsx("span", { id: id ?? handle.id, ...rest, mix: [
29
+ attrs({ "data-field-error": DEFAULT_FIELD_ERROR_ATTRIBUTE }),
30
+ fg("danger"),
31
+ weight("medium"),
32
+ text("sm"),
33
+ mix,
34
+ ] }));
35
+ };
36
+ }
@@ -0,0 +1,84 @@
1
+ /**
2
+ * A pressable surface that opens the platform's file picker, backed by a
3
+ * native `<input type="file">` wrapped in a `<label>` so the platform itself
4
+ * handles the trigger-to-picker wiring. Its visible content renders inside
5
+ * the same label as a button-like surface, colored, weighted, and sized
6
+ * through the same semantic contract as this library's other pressable
7
+ * controls.
8
+ *
9
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
10
+ * @copyright Sergio Xalambrí 2026
11
+ */
12
+ import type { Handle, Props as TagProps, RemixNode } from "remix/ui";
13
+ /**
14
+ * Prop types for {@link FileTrigger}.
15
+ */
16
+ export declare namespace FileTrigger {
17
+ /**
18
+ * Semantic color role, each mapped to its matching `--ui-*` variables.
19
+ */
20
+ type Color = "brand" | "neutral" | "success" | "warning" | "danger";
21
+ /**
22
+ * Visual weight the trigger renders with: a solid fill with an on-solid
23
+ * foreground, a transparent fill with a strong colored border, or a fully
24
+ * transparent fill with just a colored label.
25
+ */
26
+ type Variant = "solid" | "outline" | "ghost";
27
+ /**
28
+ * Size variant controlling the trigger's padding and font size.
29
+ */
30
+ type Size = "sm" | "md" | "lg";
31
+ /**
32
+ * Per-part styling for the elements this component composes besides its
33
+ * own host `<input>`.
34
+ */
35
+ interface PartsProps {
36
+ /** Styling for the `<label>` rendering as the trigger's visible, pressable surface. */
37
+ trigger?: TagProps<"label">["mix"];
38
+ }
39
+ /**
40
+ * Props accepted by {@link FileTrigger}. Every native `<input type="file">`
41
+ * attribute applies unchanged except `type` (fixed `"file"`), `role` (not
42
+ * overridable on a file input), and `size` (repurposed for visual size).
43
+ */
44
+ interface Props extends Omit<TagProps<"input">, "type" | "role" | "size"> {
45
+ /** Semantic color role. Defaults to {@link DEFAULT_COLOR}. */
46
+ color?: Color;
47
+ /** Visual weight. Defaults to {@link DEFAULT_VARIANT}. */
48
+ variant?: Variant;
49
+ /** Size variant. Defaults to {@link DEFAULT_SIZE}. */
50
+ size?: Size;
51
+ /**
52
+ * Switches the picker from choosing individual files to choosing whole
53
+ * directories, carrying every file nested inside the chosen directory.
54
+ */
55
+ acceptDirectory?: boolean;
56
+ /**
57
+ * The trigger's visible content, rendered inside the same `<label>` that
58
+ * wraps the host `<input>` — an icon, text, or both, kept decorative so
59
+ * the platform's label-to-control association reaches the input on click.
60
+ */
61
+ children?: RemixNode;
62
+ /** Per-part styling for this component's internally composed elements. */
63
+ parts?: PartsProps;
64
+ }
65
+ }
66
+ /**
67
+ * Renders a native `<input type="file">` wrapped in a `<label>` styled
68
+ * through this library's shared `data-color`/`data-variant`/`data-size`
69
+ * contract; in dev mode, content lacking an accessible name logs a warning.
70
+ *
71
+ * @param handle Runtime handle carrying the host `<input>`'s props.
72
+ * @returns The render function producing the trigger's markup.
73
+ * @example
74
+ * <FileTrigger name="avatar" accept="image/png, image/jpeg">
75
+ * {t("profile.chooseFile")}
76
+ * </FileTrigger>
77
+ * @example
78
+ * <FileTrigger name="attachments" multiple color="brand" variant="outline">
79
+ * {t("thread.attachFiles")}
80
+ * </FileTrigger>
81
+ * @example
82
+ * <FileTrigger name="folder" acceptDirectory aria-label={t("importer.chooseFolder")} />
83
+ */
84
+ export declare function FileTrigger(handle: Handle<FileTrigger.Props>): () => import("remix/ui").RemixElement;
@@ -0,0 +1,169 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "remix/ui/jsx-runtime";
2
+ import { visuallyHidden } from "@sdxc/u/a11y";
3
+ import { bg, border, fg, outline } from "@sdxc/u/color";
4
+ import { opacity, rounded } from "@sdxc/u/effects";
5
+ import { cursor, userSelect } from "@sdxc/u/general";
6
+ import { gap, inlineFlex, items, justify } from "@sdxc/u/layout";
7
+ import { pb, pi } from "@sdxc/u/size";
8
+ import { active, data, hover, when } from "@sdxc/u/state";
9
+ import { text, weight } from "@sdxc/u/typography";
10
+ import { attrs } from "remix/ui";
11
+ import { interactiveTransition } from "../styles/interactive-transition.js";
12
+ import { hasAccessibleText } from "../utils/has-accessible-text.js";
13
+ /** Semantic color role {@link FileTrigger} falls back to when `color` is omitted. */
14
+ const DEFAULT_COLOR = "neutral";
15
+ /** Visual weight {@link FileTrigger} falls back to when `variant` is omitted. */
16
+ const DEFAULT_VARIANT = "solid";
17
+ /** Size variant {@link FileTrigger} falls back to when `size` is omitted. */
18
+ const DEFAULT_SIZE = "md";
19
+ /**
20
+ * Renders a native `<input type="file">` wrapped in a `<label>` styled
21
+ * through this library's shared `data-color`/`data-variant`/`data-size`
22
+ * contract; in dev mode, content lacking an accessible name logs a warning.
23
+ *
24
+ * @param handle Runtime handle carrying the host `<input>`'s props.
25
+ * @returns The render function producing the trigger's markup.
26
+ * @example
27
+ * <FileTrigger name="avatar" accept="image/png, image/jpeg">
28
+ * {t("profile.chooseFile")}
29
+ * </FileTrigger>
30
+ * @example
31
+ * <FileTrigger name="attachments" multiple color="brand" variant="outline">
32
+ * {t("thread.attachFiles")}
33
+ * </FileTrigger>
34
+ * @example
35
+ * <FileTrigger name="folder" acceptDirectory aria-label={t("importer.chooseFolder")} />
36
+ */
37
+ export function FileTrigger(handle) {
38
+ return () => {
39
+ let { color, variant, size, acceptDirectory, children, parts, mix, ...rest } = handle.props;
40
+ let resolvedColor = color ?? DEFAULT_COLOR;
41
+ let resolvedVariant = variant ?? DEFAULT_VARIANT;
42
+ let resolvedSize = size ?? DEFAULT_SIZE;
43
+ if (import.meta.env.DEV &&
44
+ !handle.props["aria-label"] &&
45
+ !handle.props["aria-labelledby"] &&
46
+ !hasAccessibleText(children)) {
47
+ console.warn("FileTrigger: a trigger with no visible label text needs an `aria-label` describing what it opens — assistive technology has no accessible name to announce otherwise.");
48
+ }
49
+ return (_jsxs("label", { "data-slot": "trigger", "data-color": resolvedColor, "data-variant": resolvedVariant, "data-size": resolvedSize, mix: [
50
+ interactiveTransition(),
51
+ inlineFlex(),
52
+ items("center"),
53
+ justify("center"),
54
+ gap(2),
55
+ rounded("md"),
56
+ weight("medium"),
57
+ when("&:has(input:focus-visible)", [
58
+ outline({ color: "brand.ring", offset: 2 }),
59
+ data("color", "neutral", outline("neutral.ring")),
60
+ data("color", "success", outline("success.ring")),
61
+ data("color", "warning", outline("warning.ring")),
62
+ data("color", "danger", outline("danger.ring")),
63
+ ]),
64
+ when("&:has(input:disabled)", [opacity(50), cursor("not-allowed")]),
65
+ cursor("default"),
66
+ userSelect(),
67
+ pi("1rem"),
68
+ pb("0.5rem"),
69
+ text("sm"),
70
+ data("size", "sm", [pi("0.75rem"), pb("0.375rem"), text("xs")]),
71
+ data("size", "lg", [pi("1.25rem"), pb("0.625rem"), text("base")]),
72
+ data("variant", "solid", [
73
+ data("color", "brand", [
74
+ bg("brand.solid"),
75
+ fg("brand.onSolid"),
76
+ hover(bg("brand.bg-solid-hover")),
77
+ active(bg("brand.bg-solid-pressed")),
78
+ ]),
79
+ data("color", "neutral", [
80
+ bg("neutral.solid"),
81
+ fg("neutral.onSolid"),
82
+ hover(bg("neutral.bg-solid-hover")),
83
+ active(bg("neutral.bg-solid-pressed")),
84
+ ]),
85
+ data("color", "success", [
86
+ bg("success.solid"),
87
+ fg("success.onSolid"),
88
+ hover(bg("success.bg-solid-hover")),
89
+ active(bg("success.bg-solid-pressed")),
90
+ ]),
91
+ data("color", "warning", [
92
+ bg("warning.solid"),
93
+ fg("warning.onSolid"),
94
+ hover(bg("warning.bg-solid-hover")),
95
+ active(bg("warning.bg-solid-pressed")),
96
+ ]),
97
+ data("color", "danger", [
98
+ bg("danger.solid"),
99
+ fg("danger.onSolid"),
100
+ hover(bg("danger.bg-solid-hover")),
101
+ active(bg("danger.bg-solid-pressed")),
102
+ ]),
103
+ ]),
104
+ data("variant", "outline", [
105
+ border({ width: 2, noStyleDefault: true }),
106
+ bg("transparent"),
107
+ data("color", "brand", [
108
+ border("brand.strong"),
109
+ fg("brand"),
110
+ hover(bg("brand.tint")),
111
+ active(bg("brand.bg-tint-hover")),
112
+ ]),
113
+ data("color", "neutral", [
114
+ border("neutral.strong"),
115
+ fg("neutral"),
116
+ hover(bg("neutral.tint")),
117
+ active(bg("neutral.bg-tint-hover")),
118
+ ]),
119
+ data("color", "success", [
120
+ border("success.strong"),
121
+ fg("success"),
122
+ hover(bg("success.tint")),
123
+ active(bg("success.bg-tint-hover")),
124
+ ]),
125
+ data("color", "warning", [
126
+ border("warning.strong"),
127
+ fg("warning"),
128
+ hover(bg("warning.tint")),
129
+ active(bg("warning.bg-tint-hover")),
130
+ ]),
131
+ data("color", "danger", [
132
+ border("danger.strong"),
133
+ fg("danger"),
134
+ hover(bg("danger.tint")),
135
+ active(bg("danger.bg-tint-hover")),
136
+ ]),
137
+ ]),
138
+ data("variant", "ghost", [
139
+ bg("transparent"),
140
+ data("color", "brand", [
141
+ fg("brand"),
142
+ hover(bg("brand.tint")),
143
+ active(bg("brand.bg-tint-hover")),
144
+ ]),
145
+ data("color", "neutral", [
146
+ fg("neutral"),
147
+ hover(bg("neutral.bg-tint-hover")),
148
+ active(bg("neutral.bg-tint-pressed")),
149
+ ]),
150
+ data("color", "success", [
151
+ fg("success"),
152
+ hover(bg("success.tint")),
153
+ active(bg("success.bg-tint-hover")),
154
+ ]),
155
+ data("color", "warning", [
156
+ fg("warning"),
157
+ hover(bg("warning.tint")),
158
+ active(bg("warning.bg-tint-hover")),
159
+ ]),
160
+ data("color", "danger", [
161
+ fg("danger"),
162
+ hover(bg("danger.tint")),
163
+ active(bg("danger.bg-tint-hover")),
164
+ ]),
165
+ ]),
166
+ parts?.trigger,
167
+ ], children: [children, _jsx("input", { type: "file", ...rest, mix: [acceptDirectory && attrs({ webkitdirectory: true }), visuallyHidden(), mix] })] }));
168
+ };
169
+ }
@@ -0,0 +1,118 @@
1
+ /**
2
+ * The wrapper every multi-field layout starts from: a native `<form>` laying
3
+ * its children out in a single spaced column, and the point where a parsed
4
+ * validation result enters the tree. Set `issues` from a `parseSafe` (or any
5
+ * other Standard Schema compliant) result and every field beneath it can
6
+ * pick out its own errors by name through component context, with no
7
+ * `issues` prop threaded down by hand.
8
+ *
9
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
10
+ * @copyright Sergio Xalambrí 2026
11
+ */
12
+ import type { Handle, Props as TagProps, RemixNode } from "remix/ui";
13
+ /**
14
+ * Prop types for {@link Form} and the context value it provides to
15
+ * descendant fields.
16
+ */
17
+ export declare namespace Form {
18
+ /**
19
+ * A single validation failure as reported by a Standard Schema compliant
20
+ * validator. `path` locates the field the issue belongs to — a plain key,
21
+ * an index, or a `{ key }` segment — or is omitted for a form-level issue.
22
+ */
23
+ interface Issue {
24
+ /** Human-readable failure message, rendered verbatim by a field's `FieldError`. */
25
+ readonly message: string;
26
+ /** Field location of the issue, e.g. `["email"]` or `["address", "zip"]`. Omitted for a form-level issue. */
27
+ readonly path?: ReadonlyArray<PropertyKey | {
28
+ readonly key: PropertyKey;
29
+ }>;
30
+ }
31
+ /**
32
+ * Value {@link Form} stores in component context. A field reads it with
33
+ * `handle.context.get(Form)` to find its own issues by name and learn
34
+ * whether it's the field that should carry `autofocus` on this render.
35
+ */
36
+ interface Context {
37
+ /**
38
+ * Every issue whose `path` resolves to `name` (segments joined with
39
+ * `"."`, e.g. `"address.zip"`), or an empty array when the field has
40
+ * none.
41
+ *
42
+ * @param name Field name to look up, matching its `name` attribute.
43
+ * @returns The issues addressed to that field, in {@link Form.Props.issues} order.
44
+ */
45
+ getIssues(name: string): ReadonlyArray<Issue>;
46
+ /**
47
+ * `true` for the single field name that comes first among
48
+ * {@link Form.Props.issues}, so exactly one invalid field renders
49
+ * `autofocus`, landing keyboard focus on it after a server re-render.
50
+ *
51
+ * @param name Field name to check, matching its `name` attribute.
52
+ * @returns Whether `name` is the first invalid field this render.
53
+ */
54
+ isFirstInvalid(name: string): boolean;
55
+ }
56
+ /**
57
+ * Props accepted by {@link Form}.
58
+ */
59
+ interface Props extends TagProps<"form"> {
60
+ /**
61
+ * Validation issues from a `parseSafe` (or equivalent Standard Schema)
62
+ * result, provided to every descendant field through component
63
+ * context. Defaults to no issues, matching a first render.
64
+ *
65
+ * @example
66
+ * let result = parseSafe(ContactSchema, await request.formData());
67
+ * if (!result.success) return ctx.render(<ContactPage issues={result.issues} />, { status: 400 });
68
+ */
69
+ issues?: ReadonlyArray<Issue>;
70
+ }
71
+ }
72
+ /**
73
+ * Renders a native `<form>` laying children out in a single column, and
74
+ * provides {@link Form.Context} so descendant fields resolve their own
75
+ * issues by name and focus the first invalid field with no client JS.
76
+ *
77
+ * @param handle Runtime handle carrying the host `<form>`'s props and providing {@link Form.Context}.
78
+ * @returns The render function producing the form's markup.
79
+ * @example
80
+ * let result = parseSafe(ContactSchema, formData);
81
+ * <Form method="post" issues={result.success ? undefined : result.issues}>
82
+ * <TextField name="email" label={t("contact.email")} />
83
+ * <Button type="submit">{t("contact.submit")}</Button>
84
+ * </Form>
85
+ */
86
+ export declare function Form(handle: Handle<Form.Props, Form.Context>): () => import("remix/ui").RemixElement;
87
+ /**
88
+ * What a field resolved for its own validation state this render, from its
89
+ * own props and from whatever the enclosing {@link Form} knows about it.
90
+ */
91
+ export interface FieldIssueState {
92
+ /** Message the field renders through its `FieldError`, or `undefined` for a field with nothing to report. */
93
+ errorMessage: RemixNode | undefined;
94
+ /** Whether this is the field that should carry `autofocus`, so focus lands on the first problem after a server round-trip. */
95
+ isFirstInvalid: boolean;
96
+ }
97
+ /**
98
+ * Reads the {@link Form.Context} provided by the nearest ancestor
99
+ * {@link Form}, resolving to `undefined` when no Form wraps the caller so
100
+ * every field renders safely inside or outside a Form.
101
+ *
102
+ * @param handle Runtime handle of the field performing the lookup.
103
+ * @returns The enclosing form's context, or `undefined` where no Form wraps the caller.
104
+ */
105
+ export declare function readFormContext(handle: Handle<unknown, any>): Form.Context | undefined;
106
+ /**
107
+ * Resolves the validation state a field renders: an explicit `errorMessage`
108
+ * always wins over a matching {@link Form} issue for `name`, which is how
109
+ * `Form`'s `issues` reach a field with no per-field prop threaded by hand.
110
+ *
111
+ * @param handle Runtime handle of the field resolving its state.
112
+ * @param name The field's `name` attribute, used to look its issues up.
113
+ * @param errorMessage An `errorMessage` passed directly to the field, if any.
114
+ * @returns The message to render and whether this field carries `autofocus`.
115
+ * @example
116
+ * let { errorMessage, isFirstInvalid } = resolveFieldIssue(handle, "email", handle.props.errorMessage);
117
+ */
118
+ export declare function resolveFieldIssue(handle: Handle<unknown, any>, name: string | undefined, errorMessage?: RemixNode): FieldIssueState;
@@ -0,0 +1,113 @@
1
+ import { jsx as _jsx } from "remix/ui/jsx-runtime";
2
+ import { flex, flexCol, gap } from "@sdxc/u/layout";
3
+ /** {@link Form.Props.issues} fallback for a first, not-yet-submitted render. */
4
+ const DEFAULT_ISSUES = [];
5
+ /** Shared empty result {@link Form.Context.getIssues} returns for a field with no matching issue. */
6
+ const NO_ISSUES = [];
7
+ /**
8
+ * Resolves the flat field name an issue's `path` addresses, joining every
9
+ * segment with `"."` (`["address", "zip"]` becomes `"address.zip"`).
10
+ *
11
+ * @param path Issue path to resolve, or `undefined` for a form-level issue.
12
+ * @returns The joined field name, or `undefined` when `path` is missing or empty.
13
+ */
14
+ function resolveFieldName(path) {
15
+ if (!path || path.length === 0)
16
+ return undefined;
17
+ return path
18
+ .map((segment) => (typeof segment === "object" ? String(segment.key) : String(segment)))
19
+ .join(".");
20
+ }
21
+ /**
22
+ * Groups `issues` by the field name each one's `path` resolves to, dropping
23
+ * form-level issues that carry no path.
24
+ *
25
+ * @param issues Issues to group, typically {@link Form.Props.issues} as-is.
26
+ * @returns A map from field name to every issue addressed to it, in `issues` order.
27
+ */
28
+ function groupIssuesByField(issues) {
29
+ let byField = new Map();
30
+ for (let issue of issues) {
31
+ let name = resolveFieldName(issue.path);
32
+ if (name === undefined)
33
+ continue;
34
+ let bucket = byField.get(name);
35
+ if (bucket)
36
+ bucket.push(issue);
37
+ else
38
+ byField.set(name, [issue]);
39
+ }
40
+ return byField;
41
+ }
42
+ /**
43
+ * Renders a native `<form>` laying children out in a single column, and
44
+ * provides {@link Form.Context} so descendant fields resolve their own
45
+ * issues by name and focus the first invalid field with no client JS.
46
+ *
47
+ * @param handle Runtime handle carrying the host `<form>`'s props and providing {@link Form.Context}.
48
+ * @returns The render function producing the form's markup.
49
+ * @example
50
+ * let result = parseSafe(ContactSchema, formData);
51
+ * <Form method="post" issues={result.success ? undefined : result.issues}>
52
+ * <TextField name="email" label={t("contact.email")} />
53
+ * <Button type="submit">{t("contact.submit")}</Button>
54
+ * </Form>
55
+ */
56
+ export function Form(handle) {
57
+ return () => {
58
+ let { issues = DEFAULT_ISSUES, mix, ...rest } = handle.props;
59
+ let byField = groupIssuesByField(issues);
60
+ let firstInvalidField = issues
61
+ .map((issue) => resolveFieldName(issue.path))
62
+ .find((name) => name !== undefined);
63
+ handle.context.set({
64
+ getIssues(name) {
65
+ return byField.get(name) ?? NO_ISSUES;
66
+ },
67
+ isFirstInvalid(name) {
68
+ return name === firstInvalidField;
69
+ },
70
+ });
71
+ return _jsx("form", { ...rest, mix: [flex(), flexCol(), gap(4), mix] });
72
+ };
73
+ }
74
+ /**
75
+ * Reads the {@link Form.Context} provided by the nearest ancestor
76
+ * {@link Form}, resolving to `undefined` when no Form wraps the caller so
77
+ * every field renders safely inside or outside a Form.
78
+ *
79
+ * @param handle Runtime handle of the field performing the lookup.
80
+ * @returns The enclosing form's context, or `undefined` where no Form wraps the caller.
81
+ */
82
+ export function readFormContext(handle) {
83
+ try {
84
+ return handle.context.get(Form);
85
+ }
86
+ catch {
87
+ return undefined;
88
+ }
89
+ }
90
+ /**
91
+ * Resolves the validation state a field renders: an explicit `errorMessage`
92
+ * always wins over a matching {@link Form} issue for `name`, which is how
93
+ * `Form`'s `issues` reach a field with no per-field prop threaded by hand.
94
+ *
95
+ * @param handle Runtime handle of the field resolving its state.
96
+ * @param name The field's `name` attribute, used to look its issues up.
97
+ * @param errorMessage An `errorMessage` passed directly to the field, if any.
98
+ * @returns The message to render and whether this field carries `autofocus`.
99
+ * @example
100
+ * let { errorMessage, isFirstInvalid } = resolveFieldIssue(handle, "email", handle.props.errorMessage);
101
+ */
102
+ export function resolveFieldIssue(handle, name, errorMessage) {
103
+ if (name === undefined)
104
+ return { errorMessage, isFirstInvalid: false };
105
+ let context = readFormContext(handle);
106
+ if (!context)
107
+ return { errorMessage, isFirstInvalid: false };
108
+ let resolved = errorMessage ?? context.getIssues(name)[0]?.message;
109
+ return {
110
+ errorMessage: resolved,
111
+ isFirstInvalid: Boolean(resolved) && context.isFirstInvalid(name),
112
+ };
113
+ }
@@ -0,0 +1,112 @@
1
+ /**
2
+ * An interactive row list built from plain, already-ordered markup: each
3
+ * {@link GridList.Item} carries a stable key a paired selection,
4
+ * keyboard-navigation, or reorder behavior can read, while the list itself
5
+ * renders as a fully static document by default. {@link GridList.Section}
6
+ * groups related rows under an optional {@link GridList.Header} label,
7
+ * {@link GridList.LoadMoreItem} holds a trailing loading placeholder, and
8
+ * {@link GridList.DragHandle} marks the one element inside a row a
9
+ * pointer-driven reorder behavior may grab.
10
+ *
11
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
12
+ * @copyright Sergio Xalambrí 2026
13
+ */
14
+ import type { Handle, Props as TagProps, RemixNode } from "remix/ui";
15
+ import { SentinelRow } from "./sentinel-row.js";
16
+ /**
17
+ * Prop types for {@link GridList} and its compound parts.
18
+ */
19
+ export declare namespace GridList {
20
+ /**
21
+ * Arrangement of {@link GridList.Item} rows: `"stack"` renders them as a
22
+ * single column, `"grid"` wraps them into a multi-column layout growing
23
+ * from two columns up to four as the list's own container widens.
24
+ */
25
+ type Layout = "stack" | "grid";
26
+ /**
27
+ * Per-part styling for the elements {@link GridList} renders besides its
28
+ * own host.
29
+ */
30
+ interface PartsProps {
31
+ /**
32
+ * Styling for the inner wrapper that switches between the `"stack"`
33
+ * and `"grid"` layouts and virtualizes a long list through
34
+ * `content-visibility: auto`.
35
+ */
36
+ list?: TagProps<"div">["mix"];
37
+ }
38
+ /**
39
+ * Props accepted by {@link GridList}.
40
+ */
41
+ interface Props extends TagProps<"div"> {
42
+ /** Row arrangement. Defaults to {@link DEFAULT_LAYOUT}. */
43
+ layout?: Layout;
44
+ /** {@link GridList.Item}, {@link GridList.Section}, and {@link GridList.LoadMoreItem} rows to render. */
45
+ children: RemixNode;
46
+ /** Per-part styling for the list's internal row-list wrapper. */
47
+ parts?: PartsProps;
48
+ }
49
+ /**
50
+ * Props accepted by {@link GridList.Item}.
51
+ */
52
+ interface ItemProps extends TagProps<"div"> {
53
+ /**
54
+ * Stable identifier for this row, mirrored onto both the rendered
55
+ * element's own `id` and a `data-rmx-key` attribute, so the row is already
56
+ * correlation-ready for a paired behavior once one is attached.
57
+ */
58
+ id: string;
59
+ }
60
+ /**
61
+ * Props accepted by {@link GridList.Section}.
62
+ */
63
+ interface SectionProps extends TagProps<"div"> {
64
+ /** The section's optional {@link GridList.Header} label, followed by its {@link GridList.Item} rows. */
65
+ children: RemixNode;
66
+ }
67
+ /**
68
+ * Props accepted by {@link GridList.Header}.
69
+ */
70
+ interface HeaderProps extends TagProps<"header"> {
71
+ }
72
+ /**
73
+ * Props accepted by {@link GridList.LoadMoreItem}.
74
+ */
75
+ interface LoadMoreItemProps extends TagProps<"div"> {
76
+ }
77
+ /**
78
+ * Props accepted by {@link GridList.DragHandle}: every native `<button>`
79
+ * attribute except `type`, fixed to `"button"` so it never submits an
80
+ * enclosing form, and `children`, fixed to the handle's own grip glyph.
81
+ */
82
+ interface DragHandleProps extends Omit<TagProps<"button">, "type" | "children"> {
83
+ /** Accessible name for the icon-only control, e.g. "Reorder" or "Drag to reorder". */
84
+ "aria-label": string;
85
+ }
86
+ }
87
+ /**
88
+ * Renders the list's root host as a bordered `<div>` with `role="grid"`,
89
+ * keeping its row-list layer in an inner wrapper since a `@container` query
90
+ * can't resolve against the host that declares it; reach `parts.list` to adjust it.
91
+ *
92
+ * @param handle Runtime handle carrying the host `<div>`'s props.
93
+ * @returns The render function producing the list's markup.
94
+ * @example
95
+ * <GridList aria-label={t("playlist.title")}>
96
+ * <GridList.Item id="track-1">{t("playlist.track", { title: "Intro" })}</GridList.Item>
97
+ * <GridList.Item id="track-2">{t("playlist.track", { title: "Chorus" })}</GridList.Item>
98
+ * </GridList>
99
+ * @example
100
+ * <GridList aria-label={t("gallery.title")} layout="grid">
101
+ * <GridList.Item id="photo-1">{t("gallery.photo", { name: "Sunset" })}</GridList.Item>
102
+ * <GridList.Item id="photo-2">{t("gallery.photo", { name: "Harbor" })}</GridList.Item>
103
+ * </GridList>
104
+ */
105
+ export declare function GridList(handle: Handle<GridList.Props>): () => import("remix/ui").RemixElement;
106
+ export declare namespace GridList {
107
+ var Item: (handle: Handle<GridList.ItemProps>) => () => import("remix/ui").RemixElement;
108
+ var Section: (handle: Handle<GridList.SectionProps>) => () => import("remix/ui").RemixElement;
109
+ var Header: (handle: Handle<GridList.HeaderProps>) => () => import("remix/ui").RemixElement;
110
+ var LoadMoreItem: typeof SentinelRow;
111
+ var DragHandle: (handle: Handle<GridList.DragHandleProps>) => () => import("remix/ui").RemixElement;
112
+ }