@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,365 @@
1
+ import { jsx as _jsx } from "remix/ui/jsx-runtime";
2
+ import { XIcon } from "@sdxc/icons";
3
+ import { bg, border, colorMix, fg } from "@sdxc/u/color";
4
+ import { backdropBlur, backdropSaturate, rounded, shadow, transition } from "@sdxc/u/effects";
5
+ import { pointerEvents, raw } from "@sdxc/u/general";
6
+ import { absolute, basis, fixed, flex, flexCol, gap, grow, inlineFlex, insBe, insBs, insIe, insIs, items, justify, relative, shrink, } from "@sdxc/u/layout";
7
+ import { media, supports } from "@sdxc/u/responsive";
8
+ import { is, bs, maxIs, minIs, pb, pi, pie } from "@sdxc/u/size";
9
+ import { active, data, hover, when } from "@sdxc/u/state";
10
+ import { translateX } from "@sdxc/u/transform";
11
+ import { fontSize, leading, weight } from "@sdxc/u/typography";
12
+ import { attrs } from "remix/ui";
13
+ import { graphicHostStyle } from "../styles/graphic-host.js";
14
+ import { warnIfNoAccessibleLabel } from "../utils/warn-if-no-accessible-name.js";
15
+ /**
16
+ * `role` applied to {@link Toast} through {@link attrs} unless a consumer
17
+ * supplies its own, announcing the panel as a status update that assistive
18
+ * technology reads after finishing whatever it is currently reading.
19
+ */
20
+ const DEFAULT_ROLE = "status";
21
+ /**
22
+ * Default {@link Toast.Props.color}, rendering a toast with the neutral tone
23
+ * when a consumer names no semantic color.
24
+ */
25
+ const DEFAULT_COLOR = "neutral";
26
+ /**
27
+ * Default {@link Toast.Props.live}, announcing a toast's content politely so
28
+ * each toast waits its turn behind whatever assistive technology is
29
+ * currently reading.
30
+ */
31
+ const DEFAULT_LIVE = "polite";
32
+ /**
33
+ * `aria-atomic="true"` applied through {@link attrs} unless a consumer
34
+ * overrides it, so assistive technology re-reads the whole toast whenever
35
+ * any part of it updates.
36
+ */
37
+ const DEFAULT_ARIA_ATOMIC = "true";
38
+ /**
39
+ * `aria-hidden="true"` applied to {@link Toast.Icon} and {@link Toast.Loader}
40
+ * through {@link attrs} unless a consumer overrides it, keeping a purely
41
+ * decorative graphic out of the accessibility tree.
42
+ */
43
+ const DEFAULT_GRAPHIC_ARIA_HIDDEN = "true";
44
+ /**
45
+ * `type="button"` default applied to {@link Toast.Action} and
46
+ * {@link Toast.Cancel}, matching the script-driven command most toast
47
+ * actions run; pass `type="submit"` for a form control.
48
+ */
49
+ const DEFAULT_BUTTON_TYPE = "button";
50
+ /**
51
+ * Corner {@link Toast.Region} renders in when `placement` is left unset.
52
+ */
53
+ const DEFAULT_PLACEMENT = "bottom-end";
54
+ /**
55
+ * `role` applied to {@link Toast.Region} through {@link attrs} unless a
56
+ * consumer supplies its own, exposing the stack of toasts as a landmark
57
+ * region.
58
+ */
59
+ const DEFAULT_REGION_ROLE = "region";
60
+ /**
61
+ * Renders a single toast panel, tinted, bordered, and shadowed by
62
+ * {@link Toast.Props.color}, with `role` and `aria-atomic` defaulted
63
+ * (overridable); pair a `mix`-driven `enterExit()`, since it holds still.
64
+ *
65
+ * @param handle Runtime handle carrying the host `<div>`'s props.
66
+ * @returns The render function producing the toast's markup.
67
+ * @example
68
+ * <Toast color="success">
69
+ * <Toast.Icon><CircleCheckIcon /></Toast.Icon>
70
+ * <Toast.Content>
71
+ * <Toast.Title>{t("toasts.saved.title")}</Toast.Title>
72
+ * <Toast.Description>{t("toasts.saved.description")}</Toast.Description>
73
+ * </Toast.Content>
74
+ * <Toast.Close aria-label={t("actions.dismiss")} />
75
+ * </Toast>
76
+ * @example
77
+ * <Toast color="danger" live="assertive">
78
+ * <Toast.Content>
79
+ * <Toast.Title>{t("toasts.uploadFailed.title")}</Toast.Title>
80
+ * </Toast.Content>
81
+ * <Toast.Action>{t("actions.retry")}</Toast.Action>
82
+ * <Toast.Cancel>{t("actions.dismiss")}</Toast.Cancel>
83
+ * </Toast>
84
+ */
85
+ export function Toast(handle) {
86
+ return () => {
87
+ let { color = DEFAULT_COLOR, live = DEFAULT_LIVE, "aria-live": ariaLiveProp, children, mix, ...rest } = handle.props;
88
+ let ariaLive = ariaLiveProp ?? (live === "off" ? undefined : live);
89
+ return (_jsx("div", { ...rest, "aria-live": ariaLive, "data-color": color, "data-slot": "toast", mix: [
90
+ attrs({ role: DEFAULT_ROLE, "aria-atomic": DEFAULT_ARIA_ATOMIC }),
91
+ relative(),
92
+ flex(),
93
+ is("full"),
94
+ gap("0.75rem"),
95
+ rounded("lg"),
96
+ border("neutral"),
97
+ fg("neutral.fg-emphasis"),
98
+ pb("1rem"),
99
+ pi("1rem"),
100
+ when('&:has(> [data-slot="close"])', pie("2.5rem")),
101
+ when('&[data-color="brand"]', [border("brand"), fg("brand.fg-emphasis")]),
102
+ when('&[data-color="neutral"]', [border("neutral"), fg("neutral.fg-emphasis")]),
103
+ when('&[data-color="success"]', [border("success"), fg("success.fg-emphasis")]),
104
+ when('&[data-color="warning"]', [border("warning"), fg("warning.fg-emphasis")]),
105
+ when('&[data-color="danger"]', [border("danger"), fg("danger.fg-emphasis")]),
106
+ border({ width: 1 }),
107
+ shadow("lg"),
108
+ items("start"),
109
+ pointerEvents("auto"),
110
+ raw({
111
+ "--ui-toast-bg": "var(--ui-neutral-bg-tint)",
112
+ backgroundColor: "var(--ui-toast-bg)",
113
+ }),
114
+ data("color", "brand", raw({
115
+ "--ui-toast-bg": "var(--ui-brand-bg-tint)",
116
+ backgroundColor: "var(--ui-toast-bg)",
117
+ })),
118
+ data("color", "neutral", raw({
119
+ "--ui-toast-bg": "var(--ui-neutral-bg-tint)",
120
+ backgroundColor: "var(--ui-toast-bg)",
121
+ })),
122
+ data("color", "success", raw({
123
+ "--ui-toast-bg": "var(--ui-success-bg-tint)",
124
+ backgroundColor: "var(--ui-toast-bg)",
125
+ })),
126
+ data("color", "warning", raw({
127
+ "--ui-toast-bg": "var(--ui-warning-bg-tint)",
128
+ backgroundColor: "var(--ui-toast-bg)",
129
+ })),
130
+ data("color", "danger", raw({
131
+ "--ui-toast-bg": "var(--ui-danger-bg-tint)",
132
+ backgroundColor: "var(--ui-toast-bg)",
133
+ })),
134
+ supports("(backdrop-filter: blur(0))", media("(prefers-reduced-transparency: no-preference)", [
135
+ bg(colorMix("oklab", { color: "var(--ui-toast-bg)", weight: 85 }, "transparent")),
136
+ backdropBlur("md"),
137
+ backdropSaturate(1.4),
138
+ ])),
139
+ mix,
140
+ ], children: children }));
141
+ };
142
+ }
143
+ /**
144
+ * Renders {@link Toast.IconProps.children} as the toast's leading icon,
145
+ * hidden from assistive technology since the toast's color and text already
146
+ * carry its meaning; swap in {@link Toast.Loader} while pending.
147
+ *
148
+ * @param handle Runtime handle carrying the host `<div>`'s props.
149
+ * @returns The render function producing the icon's markup.
150
+ */
151
+ Toast.Icon = function ToastIcon(handle) {
152
+ return () => {
153
+ let { children, mix, ...rest } = handle.props;
154
+ return (_jsx("div", { ...rest, "data-slot": "icon", mix: [attrs({ "aria-hidden": DEFAULT_GRAPHIC_ARIA_HIDDEN }), graphicHostStyle(), mix], children: children }));
155
+ };
156
+ };
157
+ /**
158
+ * Renders {@link Toast.LoaderProps.children} as the toast's loading graphic,
159
+ * laid out identically to {@link Toast.Icon} so swapping between them keeps
160
+ * the layout stable; pair a `spin()` `mix` factory for its rotating loop.
161
+ *
162
+ * @param handle Runtime handle carrying the host `<div>`'s props.
163
+ * @returns The render function producing the loading graphic's markup.
164
+ */
165
+ Toast.Loader = function ToastLoader(handle) {
166
+ return () => {
167
+ let { children, mix, ...rest } = handle.props;
168
+ return (_jsx("div", { ...rest, "data-slot": "loader", mix: [attrs({ "aria-hidden": DEFAULT_GRAPHIC_ARIA_HIDDEN }), graphicHostStyle(), mix], children: children }));
169
+ };
170
+ };
171
+ /**
172
+ * Renders {@link Toast.ContentProps.children} as the toast's body block: a
173
+ * column flex container that shrinks to fit alongside a leading icon or
174
+ * trailing action, holding {@link Toast.Title} and {@link Toast.Description}.
175
+ *
176
+ * @param handle Runtime handle carrying the host `<div>`'s props.
177
+ * @returns The render function producing the content block's markup.
178
+ */
179
+ Toast.Content = function ToastContent(handle) {
180
+ return () => {
181
+ let { children, mix, ...rest } = handle.props;
182
+ return (_jsx("div", { ...rest, "data-slot": "content", mix: [flex(), flexCol(), gap("0.25rem"), minIs(0), grow(), shrink(1), basis("0%"), mix], children: children }));
183
+ };
184
+ };
185
+ /**
186
+ * Renders {@link Toast.TitleProps.children} as the toast's heading, in a
187
+ * native `<h3>` sized and weighted as a small, single-line label above the
188
+ * toast's description.
189
+ *
190
+ * @param handle Runtime handle carrying the host `<h3>`'s props.
191
+ * @returns The render function producing the title's markup.
192
+ */
193
+ Toast.Title = function ToastTitle(handle) {
194
+ return () => {
195
+ let { children, mix, ...rest } = handle.props;
196
+ return (_jsx("h3", { ...rest, "data-slot": "title", mix: [weight(500), leading(1), fontSize("sm"), mix], children: children }));
197
+ };
198
+ };
199
+ /**
200
+ * Renders {@link Toast.DescriptionProps.children} as the toast's supporting
201
+ * message, in a native `<p>` set slightly translucent against the toast's
202
+ * foreground color so it reads as secondary to {@link Toast.Title}.
203
+ *
204
+ * @param handle Runtime handle carrying the host `<p>`'s props.
205
+ * @returns The render function producing the description's markup.
206
+ */
207
+ Toast.Description = function ToastDescription(handle) {
208
+ return () => {
209
+ let { children, mix, ...rest } = handle.props;
210
+ return (_jsx("p", { ...rest, "data-slot": "description", mix: [
211
+ fontSize("sm"),
212
+ fg(colorMix("oklab", { color: "currentcolor", weight: 70 }, "transparent")),
213
+ mix,
214
+ ], children: children }));
215
+ };
216
+ };
217
+ /**
218
+ * Renders {@link Toast.ActionProps.children} as the toast's primary trailing
219
+ * control; `type` defaults to `"button"`, ordered before the consumer's
220
+ * attributes so `command`/`commandfor` still run; use `type="submit"` for a form.
221
+ *
222
+ * @param handle Runtime handle carrying the host `<button>`'s props.
223
+ * @returns The render function producing the action control's markup.
224
+ * @example
225
+ * <Toast.Action>{t("actions.undo")}</Toast.Action>
226
+ */
227
+ Toast.Action = function ToastAction(handle) {
228
+ return () => {
229
+ let { type, children, mix, ...rest } = handle.props;
230
+ let resolvedType = type ?? DEFAULT_BUTTON_TYPE;
231
+ return (_jsx("button", { type: resolvedType, ...rest, "data-slot": "action", mix: [
232
+ inlineFlex(),
233
+ items("center"),
234
+ justify("center"),
235
+ rounded("md"),
236
+ border({ width: 1 }),
237
+ pi("0.75rem"),
238
+ pb("0.25rem"),
239
+ weight(500),
240
+ shrink(),
241
+ transition("color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter"),
242
+ fg("currentcolor"),
243
+ border(colorMix("oklab", { color: "currentcolor", weight: 30 }, "transparent")),
244
+ fontSize("xs"),
245
+ hover(bg(colorMix("oklab", { color: "currentcolor", weight: 10 }, "transparent"))),
246
+ active(bg(colorMix("oklab", { color: "currentcolor", weight: 20 }, "transparent"))),
247
+ mix,
248
+ ], children: children }));
249
+ };
250
+ };
251
+ /**
252
+ * Renders {@link Toast.CancelProps.children} as a neutral-tinted, secondary
253
+ * trailing control; `type` defaults to `"button"`, ordered before the
254
+ * consumer's attributes so `command`/`commandfor` still run.
255
+ *
256
+ * @param handle Runtime handle carrying the host `<button>`'s props.
257
+ * @returns The render function producing the cancel control's markup.
258
+ * @example
259
+ * <Toast.Cancel>{t("actions.dismiss")}</Toast.Cancel>
260
+ */
261
+ Toast.Cancel = function ToastCancel(handle) {
262
+ return () => {
263
+ let { type, children, mix, ...rest } = handle.props;
264
+ let resolvedType = type ?? DEFAULT_BUTTON_TYPE;
265
+ return (_jsx("button", { type: resolvedType, ...rest, "data-slot": "cancel", mix: [
266
+ inlineFlex(),
267
+ items("center"),
268
+ justify("center"),
269
+ rounded("md"),
270
+ border({ color: "neutral", width: 1 }),
271
+ pi("0.75rem"),
272
+ pb("0.25rem"),
273
+ weight(500),
274
+ fg("neutral.fg"),
275
+ hover([bg("neutral.bg-tint-hover"), fg("neutral.fg-emphasis")]),
276
+ active(bg("neutral.bg-tint-pressed")),
277
+ shrink(),
278
+ transition("color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter"),
279
+ fontSize("xs"),
280
+ mix,
281
+ ], children: children }));
282
+ };
283
+ };
284
+ /**
285
+ * Renders a dismiss control for the ancestor {@link Toast}: an icon-only
286
+ * `<button>` removable via a consumer's mixin or the `commandfor`/`command`
287
+ * pair; `type="button"` precedes those attributes so the pairing still runs.
288
+ *
289
+ * @param handle Runtime handle carrying the host `<button>`'s props.
290
+ * @returns The render function producing the dismiss control's markup.
291
+ * @example
292
+ * <Toast.Close aria-label={t("actions.dismiss")} />
293
+ */
294
+ Toast.Close = function ToastClose(handle) {
295
+ return () => {
296
+ let { mix, ...rest } = handle.props;
297
+ return (_jsx("button", { type: "button", ...rest, "data-slot": "close", mix: [
298
+ absolute(),
299
+ inlineFlex(),
300
+ items("center"),
301
+ justify("center"),
302
+ is("1.5rem"),
303
+ bs("1.5rem"),
304
+ rounded("md"),
305
+ fg("neutral.fg-muted"),
306
+ hover([bg("neutral.bg-tint-hover"), fg("neutral.fg-emphasis")]),
307
+ transition("color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter"),
308
+ insBs("0.5rem"),
309
+ insIe("0.5rem"),
310
+ mix,
311
+ ], children: _jsx(XIcon, { size: 16 }) }));
312
+ };
313
+ };
314
+ /**
315
+ * Renders the fixed viewport stacking every queued {@link Toast} at a corner
316
+ * via {@link Toast.RegionProps.placement}; `pointer-events` stays `none` so
317
+ * clicks pass through to content behind, restored per toast.
318
+ *
319
+ * @param handle Runtime handle carrying the host `<div>`'s props.
320
+ * @returns The render function producing the viewport's markup.
321
+ * @example
322
+ * <Toast.Region aria-label={t("toasts.region")}>
323
+ * {toasts.map((toast) => (
324
+ * <Toast key={toast.id} color={toast.data.color}>
325
+ * <Toast.Content>
326
+ * <Toast.Title>{toast.data.title}</Toast.Title>
327
+ * </Toast.Content>
328
+ * </Toast>
329
+ * ))}
330
+ * </Toast.Region>
331
+ * @example
332
+ * <Toast.Region aria-label={t("toasts.region")} placement="top-center">
333
+ * <Toast color="warning">
334
+ * <Toast.Content>
335
+ * <Toast.Title>{t("toasts.offline.title")}</Toast.Title>
336
+ * </Toast.Content>
337
+ * </Toast>
338
+ * </Toast.Region>
339
+ */
340
+ Toast.Region = function ToastRegion(handle) {
341
+ return () => {
342
+ let { placement, children, mix, ...rest } = handle.props;
343
+ let resolvedPlacement = placement ?? DEFAULT_PLACEMENT;
344
+ warnIfNoAccessibleLabel(handle.props, 'Toast.Region: needs an "aria-label" or "aria-labelledby" identifying this landmark for assistive technology.');
345
+ return (_jsx("div", { ...rest, "data-placement": resolvedPlacement, "data-slot": "region", mix: [
346
+ attrs({ role: DEFAULT_REGION_ROLE }),
347
+ fixed(),
348
+ flex(),
349
+ flexCol(),
350
+ gap("0.75rem"),
351
+ is("full"),
352
+ maxIs("24rem"),
353
+ pb("1rem"),
354
+ pi("1rem"),
355
+ pointerEvents(),
356
+ raw({ zIndex: "var(--ui-toast-z, 50)" }),
357
+ when('&[data-placement^="top"]', insBs("0")),
358
+ when('&[data-placement^="bottom"]', insBe("0")),
359
+ when('&[data-placement$="start"]', insIs("0")),
360
+ when('&[data-placement$="end"]', insIe("0")),
361
+ when('&[data-placement$="center"]', [insIs("50%"), translateX("-50%")]),
362
+ mix,
363
+ ], children: children }));
364
+ };
365
+ };
@@ -0,0 +1,115 @@
1
+ /**
2
+ * A native `<button>` that reflects an on/off state through its own
3
+ * `aria-pressed` attribute instead of a separate boolean prop — muting a
4
+ * track, toggling bold text, filtering a view. Shares {@link Button}'s
5
+ * semantic color role, visual weight variant, and size, and layers a tinted
6
+ * background on top of the outline and ghost variants once pressed, so a
7
+ * toggled control reads as active without a fourth variant of its own.
8
+ * {@link ToggleButtonGroup} lays a run of these out along a shared axis.
9
+ *
10
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
11
+ * @copyright Sergio Xalambrí 2026
12
+ */
13
+ import type { Handle, Props as TagProps } from "remix/ui";
14
+ import type { SemanticColor } from "../utils/semantic-color.js";
15
+ /**
16
+ * Prop types for {@link ToggleButton}.
17
+ */
18
+ export declare namespace ToggleButton {
19
+ /**
20
+ * Semantic color role, each mapped to its matching `--ui-*` variables.
21
+ */
22
+ type Color = SemanticColor;
23
+ /**
24
+ * Visual weight: a solid fill with an on-solid foreground, a transparent
25
+ * fill with a strong colored border, or a fully transparent fill with
26
+ * just a colored label. Pressing tints `"outline"`/`"ghost"`; `"solid"` already reads filled.
27
+ */
28
+ type Variant = "solid" | "outline" | "ghost";
29
+ /**
30
+ * Size variant controlling the button's padding and font size.
31
+ */
32
+ type Size = "sm" | "md" | "lg";
33
+ /**
34
+ * Props accepted by {@link ToggleButton}, with `aria-pressed` made
35
+ * required: it carries the entire pressed state, read straight off the
36
+ * rendered attribute by this component's styling and the `pressToggle()` mixin.
37
+ */
38
+ interface Props extends Omit<TagProps<"button">, "aria-pressed"> {
39
+ /** The button's pressed state, reflected directly onto the host's own `aria-pressed` attribute. */
40
+ "aria-pressed": NonNullable<TagProps<"button">["aria-pressed"]>;
41
+ /** Semantic color role. Defaults to {@link DEFAULT_COLOR}. */
42
+ color?: Color;
43
+ /** Visual weight. Defaults to {@link DEFAULT_VARIANT}. */
44
+ variant?: Variant;
45
+ /** Size variant. Defaults to {@link DEFAULT_SIZE}. */
46
+ size?: Size;
47
+ }
48
+ }
49
+ /**
50
+ * Renders a native `<button aria-pressed>` host clicking which submits its
51
+ * enclosing form by default, flipping the state through a server round-trip
52
+ * with no script required; pair `pressToggle()` through `mix` in a hydrated island to skip the round-trip.
53
+ *
54
+ * @param handle Runtime handle carrying the host `<button>`'s props.
55
+ * @returns The render function producing the toggle button's markup.
56
+ * @example
57
+ * <ToggleButton aria-pressed={isMuted} aria-label={t("player.mute")}>
58
+ * <VolumeXIcon />
59
+ * </ToggleButton>
60
+ * @example
61
+ * <ToggleButton aria-pressed={isBold} variant="ghost" size="sm" aria-label={t("editor.bold")}>
62
+ * <BoldIcon />
63
+ * </ToggleButton>
64
+ * @example
65
+ * <ToggleButton aria-pressed={filter === "active"} color="brand" name="filter" value="active">
66
+ * {t("tasks.filterActive")}
67
+ * </ToggleButton>
68
+ */
69
+ export declare function ToggleButton(handle: Handle<ToggleButton.Props>): () => import("remix/ui").RemixElement;
70
+ /**
71
+ * Prop types for {@link ToggleButtonGroup}.
72
+ */
73
+ export declare namespace ToggleButtonGroup {
74
+ /**
75
+ * Axis a group's toggle buttons lay out along: a single row, or a single
76
+ * column.
77
+ */
78
+ type Orientation = "horizontal" | "vertical";
79
+ /**
80
+ * Every native `<div>` attribute, unchanged, plus `mix`. Each nested
81
+ * {@link ToggleButton} tracks its own `aria-pressed` and `name`/`value`
82
+ * independently; this host only contributes shared grouping and layout.
83
+ */
84
+ interface Props extends TagProps<"div"> {
85
+ /** Layout axis. Defaults to {@link DEFAULT_GROUP_ORIENTATION}. */
86
+ orientation?: Orientation;
87
+ }
88
+ }
89
+ /**
90
+ * Renders a `role="toolbar"` `<div>` laying a run of independently pressed
91
+ * {@link ToggleButton} children out in a row, or a column when `orientation`
92
+ * is `"vertical"`; each toggle button owns its own `aria-pressed` state, and this host contributes only shared layout and grouping.
93
+ *
94
+ * @param handle Runtime handle carrying the host `<div>`'s props.
95
+ * @returns The render function producing the group's markup.
96
+ * @example
97
+ * <ToggleButtonGroup aria-label={t("editor.textStyle")}>
98
+ * <ToggleButton aria-pressed={isBold} aria-label={t("editor.bold")}>
99
+ * <BoldIcon />
100
+ * </ToggleButton>
101
+ * <ToggleButton aria-pressed={isItalic} aria-label={t("editor.italic")}>
102
+ * <ItalicIcon />
103
+ * </ToggleButton>
104
+ * </ToggleButtonGroup>
105
+ * @example
106
+ * <ToggleButtonGroup aria-label={t("editor.alignment")} orientation="vertical">
107
+ * <ToggleButton aria-pressed={align === "start"} aria-label={t("editor.alignStart")}>
108
+ * <AlignStartIcon />
109
+ * </ToggleButton>
110
+ * <ToggleButton aria-pressed={align === "center"} aria-label={t("editor.alignCenter")}>
111
+ * <AlignCenterIcon />
112
+ * </ToggleButton>
113
+ * </ToggleButtonGroup>
114
+ */
115
+ export declare function ToggleButtonGroup(handle: Handle<ToggleButtonGroup.Props>): () => import("remix/ui").RemixElement;