@remix-run/ui 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (395) hide show
  1. package/README.md +50 -164
  2. package/dist/accordion/index.d.ts +46 -0
  3. package/dist/accordion/index.js +142 -0
  4. package/dist/accordion/index.js.map +1 -0
  5. package/dist/accordion/primitives.d.ts +104 -0
  6. package/dist/accordion/primitives.js +312 -0
  7. package/dist/accordion/primitives.js.map +1 -0
  8. package/dist/{components/anchor/anchor.d.ts → anchor/index.d.ts} +8 -1
  9. package/dist/{components/anchor/anchor.js → anchor/index.js} +31 -12
  10. package/dist/anchor/index.js.map +1 -0
  11. package/dist/animation/demos/aspect-ratio.d.ts +2 -0
  12. package/dist/animation/demos/aspect-ratio.js +69 -0
  13. package/dist/animation/demos/aspect-ratio.js.map +1 -0
  14. package/dist/animation/demos/bouncy-switch.d.ts +2 -0
  15. package/dist/animation/demos/bouncy-switch.js +36 -0
  16. package/dist/animation/demos/bouncy-switch.js.map +1 -0
  17. package/dist/animation/demos/color-interpolation.d.ts +1 -0
  18. package/dist/animation/demos/color-interpolation.js +53 -0
  19. package/dist/animation/demos/color-interpolation.js.map +1 -0
  20. package/dist/animation/demos/cube.d.ts +2 -0
  21. package/dist/animation/demos/cube.js +86 -0
  22. package/dist/animation/demos/cube.js.map +1 -0
  23. package/dist/animation/demos/default-animate.d.ts +2 -0
  24. package/dist/animation/demos/default-animate.js +89 -0
  25. package/dist/animation/demos/default-animate.js.map +1 -0
  26. package/dist/animation/demos/drag-release.d.ts +24 -0
  27. package/dist/animation/demos/drag-release.js +96 -0
  28. package/dist/animation/demos/drag-release.js.map +1 -0
  29. package/dist/animation/demos/enter.d.ts +1 -0
  30. package/dist/animation/demos/enter.js +19 -0
  31. package/dist/animation/demos/enter.js.map +1 -0
  32. package/dist/animation/demos/exit.d.ts +2 -0
  33. package/dist/animation/demos/exit.js +58 -0
  34. package/dist/animation/demos/exit.js.map +1 -0
  35. package/dist/animation/demos/flip-toggle.d.ts +2 -0
  36. package/dist/animation/demos/flip-toggle.js +37 -0
  37. package/dist/animation/demos/flip-toggle.js.map +1 -0
  38. package/dist/animation/demos/hold-to-confirm.d.ts +13 -0
  39. package/dist/animation/demos/hold-to-confirm.js +211 -0
  40. package/dist/animation/demos/hold-to-confirm.js.map +1 -0
  41. package/dist/animation/demos/html-content.d.ts +2 -0
  42. package/dist/animation/demos/html-content.js +30 -0
  43. package/dist/animation/demos/html-content.js.map +1 -0
  44. package/dist/animation/demos/interruptible-keyframes.d.ts +1 -0
  45. package/dist/animation/demos/interruptible-keyframes.js +48 -0
  46. package/dist/animation/demos/interruptible-keyframes.js.map +1 -0
  47. package/dist/animation/demos/keyframes.d.ts +1 -0
  48. package/dist/animation/demos/keyframes.js +24 -0
  49. package/dist/animation/demos/keyframes.js.map +1 -0
  50. package/dist/animation/demos/material-ripple.d.ts +2 -0
  51. package/dist/animation/demos/material-ripple.js +127 -0
  52. package/dist/animation/demos/material-ripple.js.map +1 -0
  53. package/dist/animation/demos/mixin-presence-list.d.ts +2 -0
  54. package/dist/animation/demos/mixin-presence-list.js +88 -0
  55. package/dist/animation/demos/mixin-presence-list.js.map +1 -0
  56. package/dist/animation/demos/mixin-reclaim.d.ts +2 -0
  57. package/dist/animation/demos/mixin-reclaim.js +90 -0
  58. package/dist/animation/demos/mixin-reclaim.js.map +1 -0
  59. package/dist/animation/demos/multi-state-badge.d.ts +2 -0
  60. package/dist/animation/demos/multi-state-badge.js +231 -0
  61. package/dist/animation/demos/multi-state-badge.js.map +1 -0
  62. package/dist/animation/demos/press.d.ts +2 -0
  63. package/dist/animation/demos/press.js +63 -0
  64. package/dist/animation/demos/press.js.map +1 -0
  65. package/dist/animation/demos/reordering.d.ts +2 -0
  66. package/dist/animation/demos/reordering.js +53 -0
  67. package/dist/animation/demos/reordering.js.map +1 -0
  68. package/dist/animation/demos/rolling-square.d.ts +2 -0
  69. package/dist/animation/demos/rolling-square.js +42 -0
  70. package/dist/animation/demos/rolling-square.js.map +1 -0
  71. package/dist/animation/demos/rotate.d.ts +1 -0
  72. package/dist/animation/demos/rotate.js +18 -0
  73. package/dist/animation/demos/rotate.js.map +1 -0
  74. package/dist/animation/demos/shared-layout.d.ts +2 -0
  75. package/dist/animation/demos/shared-layout.js +114 -0
  76. package/dist/animation/demos/shared-layout.js.map +1 -0
  77. package/dist/animation/demos/transition-options.d.ts +1 -0
  78. package/dist/animation/demos/transition-options.js +21 -0
  79. package/dist/animation/demos/transition-options.js.map +1 -0
  80. package/dist/animation/spring.d.ts +22 -0
  81. package/dist/animation/spring.js +22 -0
  82. package/dist/animation/spring.js.map +1 -1
  83. package/dist/{components/breadcrumbs/breadcrumbs.js → breadcrumbs/index.js} +19 -19
  84. package/dist/breadcrumbs/index.js.map +1 -0
  85. package/dist/button/index.d.ts +15 -0
  86. package/dist/button/index.js +128 -0
  87. package/dist/button/index.js.map +1 -0
  88. package/dist/checkbox/index.d.ts +14 -0
  89. package/dist/checkbox/index.js +125 -0
  90. package/dist/checkbox/index.js.map +1 -0
  91. package/dist/combobox/index.d.ts +21 -0
  92. package/dist/combobox/index.js +58 -0
  93. package/dist/combobox/index.js.map +1 -0
  94. package/dist/{components/combobox/combobox.d.ts → combobox/primitives.d.ts} +3 -7
  95. package/dist/{components/combobox/combobox.js → combobox/primitives.js} +8 -61
  96. package/dist/combobox/primitives.js.map +1 -0
  97. package/dist/input/index.d.ts +13 -0
  98. package/dist/input/index.js +121 -0
  99. package/dist/input/index.js.map +1 -0
  100. package/dist/listbox/flash-attribute.js.map +1 -0
  101. package/dist/{components/listbox/listbox.d.ts → listbox/index.d.ts} +2 -6
  102. package/dist/{components/listbox/listbox.js → listbox/index.js} +4 -82
  103. package/dist/listbox/index.js.map +1 -0
  104. package/dist/menu/hover-aim.js.map +1 -0
  105. package/dist/menu/index.d.ts +42 -0
  106. package/dist/menu/index.js +250 -0
  107. package/dist/menu/index.js.map +1 -0
  108. package/dist/{components/menu/menu.d.ts → menu/primitives.d.ts} +6 -32
  109. package/dist/{components/menu/menu.js → menu/primitives.js} +117 -279
  110. package/dist/menu/primitives.js.map +1 -0
  111. package/dist/{components/popover/popover.d.ts → popover/index.d.ts} +3 -5
  112. package/dist/{components/popover/popover.js → popover/index.js} +15 -51
  113. package/dist/popover/index.js.map +1 -0
  114. package/dist/{interactions/outside-click/outside-click-mixin.js → popover/outside-click.js} +1 -1
  115. package/dist/popover/outside-click.js.map +1 -0
  116. package/dist/popover/scroll-lock.d.ts +1 -0
  117. package/dist/{utils → popover}/scroll-lock.js +0 -18
  118. package/dist/popover/scroll-lock.js.map +1 -0
  119. package/dist/radio/index.d.ts +12 -0
  120. package/dist/radio/index.js +77 -0
  121. package/dist/radio/index.js.map +1 -0
  122. package/dist/runtime/client-entries.d.ts +1 -2
  123. package/dist/runtime/client-entries.js.map +1 -1
  124. package/dist/runtime/component.d.ts +2 -2
  125. package/dist/runtime/component.js +1 -1
  126. package/dist/runtime/component.js.map +1 -1
  127. package/dist/runtime/diff-dom.js +194 -21
  128. package/dist/runtime/diff-dom.js.map +1 -1
  129. package/dist/runtime/frame.d.ts +7 -0
  130. package/dist/runtime/frame.js +176 -41
  131. package/dist/runtime/frame.js.map +1 -1
  132. package/dist/runtime/jsx.d.ts +2 -3
  133. package/dist/runtime/jsx.js.map +1 -1
  134. package/dist/runtime/reconcile.js +11 -5
  135. package/dist/runtime/reconcile.js.map +1 -1
  136. package/dist/runtime/vdom.js +3 -0
  137. package/dist/runtime/vdom.js.map +1 -1
  138. package/dist/select/index.d.ts +19 -0
  139. package/dist/select/index.js +95 -0
  140. package/dist/select/index.js.map +1 -0
  141. package/dist/select/keydown.js.map +1 -0
  142. package/dist/{components/select/select.d.ts → select/primitives.d.ts} +4 -6
  143. package/dist/{components/select/select.js → select/primitives.js} +12 -64
  144. package/dist/select/primitives.js.map +1 -0
  145. package/dist/server/stream.js +5 -4
  146. package/dist/server/stream.js.map +1 -1
  147. package/dist/shared/focus-styles.d.ts +1 -0
  148. package/dist/shared/focus-styles.js +2 -0
  149. package/dist/shared/focus-styles.js.map +1 -0
  150. package/dist/shared/icons.d.ts +9 -0
  151. package/dist/shared/icons.js +42 -0
  152. package/dist/shared/icons.js.map +1 -0
  153. package/dist/shared/listbox-popover-styles.d.ts +6 -0
  154. package/dist/shared/listbox-popover-styles.js +137 -0
  155. package/dist/shared/listbox-popover-styles.js.map +1 -0
  156. package/dist/shared/style-values.d.ts +78 -0
  157. package/dist/{theme/presets/rmx-01/index.js → shared/style-values.js} +3 -34
  158. package/dist/shared/style-values.js.map +1 -0
  159. package/dist/{interactions/typeahead/typeahead-mixin.js → shared/typeahead.js} +1 -1
  160. package/dist/shared/typeahead.js.map +1 -0
  161. package/dist/shared/wait-for-css-transition.js.map +1 -0
  162. package/dist/shared/wait.js.map +1 -0
  163. package/dist/style/style.js +27 -10
  164. package/dist/style/style.js.map +1 -1
  165. package/dist/tabs/index.d.ts +32 -0
  166. package/dist/tabs/index.js +157 -0
  167. package/dist/tabs/index.js.map +1 -0
  168. package/dist/tabs/primitives.d.ts +57 -0
  169. package/dist/tabs/primitives.js +238 -0
  170. package/dist/tabs/primitives.js.map +1 -0
  171. package/dist/toggle/index.d.ts +9 -0
  172. package/dist/toggle/index.js +108 -0
  173. package/dist/toggle/index.js.map +1 -0
  174. package/dist/toggle/primitives.d.ts +29 -0
  175. package/dist/toggle/primitives.js +127 -0
  176. package/dist/toggle/primitives.js.map +1 -0
  177. package/package.json +74 -45
  178. package/src/{components/accordion → accordion}/README.md +50 -14
  179. package/src/accordion/index.tsx +285 -0
  180. package/src/accordion/primitives.tsx +512 -0
  181. package/src/{components/anchor → anchor}/README.md +48 -5
  182. package/src/{components/anchor/anchor.ts → anchor/index.ts} +53 -12
  183. package/src/animation/demos/aspect-ratio.tsx +120 -0
  184. package/src/animation/demos/bouncy-switch.tsx +47 -0
  185. package/src/animation/demos/color-interpolation.tsx +73 -0
  186. package/src/animation/demos/cube.tsx +116 -0
  187. package/src/animation/demos/default-animate.tsx +129 -0
  188. package/src/animation/demos/drag-release.ts +118 -0
  189. package/src/animation/demos/enter.tsx +22 -0
  190. package/src/animation/demos/exit.tsx +79 -0
  191. package/src/animation/demos/flip-toggle.tsx +46 -0
  192. package/src/animation/demos/hold-to-confirm.tsx +317 -0
  193. package/src/animation/demos/html-content.tsx +41 -0
  194. package/src/animation/demos/interruptible-keyframes.tsx +62 -0
  195. package/src/animation/demos/keyframes.tsx +29 -0
  196. package/src/animation/demos/material-ripple.tsx +158 -0
  197. package/src/animation/demos/mixin-presence-list.tsx +121 -0
  198. package/src/animation/demos/mixin-reclaim.tsx +125 -0
  199. package/src/animation/demos/multi-state-badge.tsx +426 -0
  200. package/src/animation/demos/press.tsx +67 -0
  201. package/src/animation/demos/reordering.tsx +68 -0
  202. package/src/animation/demos/rolling-square.tsx +57 -0
  203. package/src/animation/demos/rotate.tsx +21 -0
  204. package/src/animation/demos/shared-layout.tsx +211 -0
  205. package/src/animation/demos/transition-options.tsx +24 -0
  206. package/src/animation/spring.ts +22 -0
  207. package/src/{components/breadcrumbs → breadcrumbs}/README.md +4 -4
  208. package/src/{components/breadcrumbs/breadcrumbs.tsx → breadcrumbs/index.tsx} +18 -18
  209. package/src/button/README.md +44 -0
  210. package/src/button/index.ts +168 -0
  211. package/src/checkbox/README.md +59 -0
  212. package/src/checkbox/index.ts +162 -0
  213. package/src/{components/combobox → combobox}/README.md +58 -9
  214. package/src/combobox/index.tsx +112 -0
  215. package/src/{components/combobox/combobox.tsx → combobox/primitives.tsx} +5 -91
  216. package/src/input/README.md +52 -0
  217. package/src/input/index.ts +147 -0
  218. package/src/{components/listbox → listbox}/README.md +9 -41
  219. package/src/{components/listbox/listbox.ts → listbox/index.ts} +2 -87
  220. package/src/menu/README.md +161 -0
  221. package/src/menu/index.tsx +354 -0
  222. package/src/{components/menu/menu.tsx → menu/primitives.tsx} +117 -359
  223. package/src/{components/popover → popover}/README.md +20 -39
  224. package/src/{components/popover/popover.ts → popover/index.ts} +16 -61
  225. package/src/{utils → popover}/scroll-lock.ts +0 -28
  226. package/src/radio/README.md +53 -0
  227. package/src/radio/index.ts +100 -0
  228. package/src/runtime/client-entries.ts +1 -5
  229. package/src/runtime/component.ts +3 -3
  230. package/src/runtime/demos/readme.demo.tsx +704 -0
  231. package/src/runtime/diff-dom.ts +270 -20
  232. package/src/runtime/frame.ts +218 -41
  233. package/src/runtime/jsx.ts +6 -10
  234. package/src/runtime/reconcile.ts +11 -5
  235. package/src/runtime/vdom.ts +3 -0
  236. package/src/{components/select → select}/README.md +29 -19
  237. package/src/select/index.tsx +159 -0
  238. package/src/{components/select/select.tsx → select/primitives.tsx} +11 -99
  239. package/src/server/stream.ts +10 -5
  240. package/src/shared/focus-styles.ts +2 -0
  241. package/src/shared/icons.tsx +62 -0
  242. package/src/shared/listbox-popover-styles.ts +146 -0
  243. package/src/shared/style-values.ts +165 -0
  244. package/src/style/style.ts +29 -10
  245. package/src/tabs/README.md +141 -0
  246. package/src/tabs/index.tsx +244 -0
  247. package/src/tabs/primitives.ts +365 -0
  248. package/src/toggle/README.md +56 -0
  249. package/src/toggle/index.tsx +134 -0
  250. package/src/toggle/primitives.ts +192 -0
  251. package/dist/components/accordion/accordion.d.ts +0 -92
  252. package/dist/components/accordion/accordion.js +0 -335
  253. package/dist/components/accordion/accordion.js.map +0 -1
  254. package/dist/components/accordion/demos/card.demo.d.ts +0 -6
  255. package/dist/components/accordion/demos/card.demo.js +0 -58
  256. package/dist/components/accordion/demos/card.demo.js.map +0 -1
  257. package/dist/components/accordion/demos/multiple.demo.d.ts +0 -6
  258. package/dist/components/accordion/demos/multiple.demo.js +0 -19
  259. package/dist/components/accordion/demos/multiple.demo.js.map +0 -1
  260. package/dist/components/accordion/demos/overview.demo.d.ts +0 -6
  261. package/dist/components/accordion/demos/overview.demo.js +0 -19
  262. package/dist/components/accordion/demos/overview.demo.js.map +0 -1
  263. package/dist/components/anchor/anchor.js.map +0 -1
  264. package/dist/components/breadcrumbs/breadcrumbs.js.map +0 -1
  265. package/dist/components/breadcrumbs/demos/basic.demo.d.ts +0 -5
  266. package/dist/components/breadcrumbs/demos/basic.demo.js +0 -14
  267. package/dist/components/breadcrumbs/demos/basic.demo.js.map +0 -1
  268. package/dist/components/breadcrumbs/demos/separator.demo.d.ts +0 -5
  269. package/dist/components/breadcrumbs/demos/separator.demo.js +0 -14
  270. package/dist/components/breadcrumbs/demos/separator.demo.js.map +0 -1
  271. package/dist/components/button/button.d.ts +0 -105
  272. package/dist/components/button/button.js +0 -207
  273. package/dist/components/button/button.js.map +0 -1
  274. package/dist/components/button/demos/aliases.demo.d.ts +0 -6
  275. package/dist/components/button/demos/aliases.demo.js +0 -18
  276. package/dist/components/button/demos/aliases.demo.js.map +0 -1
  277. package/dist/components/button/demos/basic.demo.d.ts +0 -6
  278. package/dist/components/button/demos/basic.demo.js +0 -19
  279. package/dist/components/button/demos/basic.demo.js.map +0 -1
  280. package/dist/components/button/demos/states.demo.d.ts +0 -6
  281. package/dist/components/button/demos/states.demo.js +0 -29
  282. package/dist/components/button/demos/states.demo.js.map +0 -1
  283. package/dist/components/combobox/combobox.js.map +0 -1
  284. package/dist/components/combobox/demos/overview.demo.d.ts +0 -6
  285. package/dist/components/combobox/demos/overview.demo.js +0 -153
  286. package/dist/components/combobox/demos/overview.demo.js.map +0 -1
  287. package/dist/components/glyph/glyph.d.ts +0 -14
  288. package/dist/components/glyph/glyph.js +0 -65
  289. package/dist/components/glyph/glyph.js.map +0 -1
  290. package/dist/components/listbox/demos/overview.demo.d.ts +0 -6
  291. package/dist/components/listbox/demos/overview.demo.js +0 -64
  292. package/dist/components/listbox/demos/overview.demo.js.map +0 -1
  293. package/dist/components/listbox/listbox.js.map +0 -1
  294. package/dist/components/menu/demos/bubbling.demo.d.ts +0 -5
  295. package/dist/components/menu/demos/bubbling.demo.js +0 -15
  296. package/dist/components/menu/demos/bubbling.demo.js.map +0 -1
  297. package/dist/components/menu/demos/overview.demo.d.ts +0 -6
  298. package/dist/components/menu/demos/overview.demo.js +0 -32
  299. package/dist/components/menu/demos/overview.demo.js.map +0 -1
  300. package/dist/components/menu/hover-aim.js.map +0 -1
  301. package/dist/components/menu/menu.js.map +0 -1
  302. package/dist/components/popover/demos/overview.demo.d.ts +0 -6
  303. package/dist/components/popover/demos/overview.demo.js +0 -64
  304. package/dist/components/popover/demos/overview.demo.js.map +0 -1
  305. package/dist/components/popover/popover.js.map +0 -1
  306. package/dist/components/select/demos/deconstructed.demo.d.ts +0 -6
  307. package/dist/components/select/demos/deconstructed.demo.js +0 -53
  308. package/dist/components/select/demos/deconstructed.demo.js.map +0 -1
  309. package/dist/components/select/demos/overview.demo.d.ts +0 -5
  310. package/dist/components/select/demos/overview.demo.js +0 -27
  311. package/dist/components/select/demos/overview.demo.js.map +0 -1
  312. package/dist/components/select/select.js.map +0 -1
  313. package/dist/components/separator/separator.d.ts +0 -2
  314. package/dist/components/separator/separator.js +0 -15
  315. package/dist/components/separator/separator.js.map +0 -1
  316. package/dist/components/tabs/tabs.d.ts +0 -78
  317. package/dist/components/tabs/tabs.js +0 -339
  318. package/dist/components/tabs/tabs.js.map +0 -1
  319. package/dist/interactions/keydown/keydown.js.map +0 -1
  320. package/dist/interactions/outside-click/outside-click-mixin.js.map +0 -1
  321. package/dist/interactions/typeahead/typeahead-mixin.js.map +0 -1
  322. package/dist/theme/contract.d.ts +0 -61
  323. package/dist/theme/contract.js +0 -131
  324. package/dist/theme/contract.js.map +0 -1
  325. package/dist/theme/glyph-contract.d.ts +0 -11
  326. package/dist/theme/glyph-contract.js +0 -34
  327. package/dist/theme/glyph-contract.js.map +0 -1
  328. package/dist/theme/presets/rmx-01/glyphs.d.ts +0 -2
  329. package/dist/theme/presets/rmx-01/glyphs.js +0 -252
  330. package/dist/theme/presets/rmx-01/glyphs.js.map +0 -1
  331. package/dist/theme/presets/rmx-01/index.d.ts +0 -4
  332. package/dist/theme/presets/rmx-01/index.js.map +0 -1
  333. package/dist/theme/runtime.d.ts +0 -2
  334. package/dist/theme/runtime.js +0 -84
  335. package/dist/theme/runtime.js.map +0 -1
  336. package/dist/theme/theme.d.ts +0 -6
  337. package/dist/theme/theme.js +0 -5
  338. package/dist/theme/theme.js.map +0 -1
  339. package/dist/utils/flash-attribute.js.map +0 -1
  340. package/dist/utils/scroll-lock.d.ts +0 -3
  341. package/dist/utils/scroll-lock.js.map +0 -1
  342. package/dist/utils/wait-for-css-transition.js.map +0 -1
  343. package/dist/utils/wait.js.map +0 -1
  344. package/src/components/accordion/accordion.tsx +0 -565
  345. package/src/components/accordion/demos/card.demo.tsx +0 -113
  346. package/src/components/accordion/demos/multiple.demo.tsx +0 -56
  347. package/src/components/accordion/demos/overview.demo.tsx +0 -56
  348. package/src/components/breadcrumbs/demos/basic.demo.tsx +0 -17
  349. package/src/components/breadcrumbs/demos/separator.demo.tsx +0 -18
  350. package/src/components/button/README.md +0 -44
  351. package/src/components/button/button.tsx +0 -286
  352. package/src/components/button/demos/aliases.demo.tsx +0 -27
  353. package/src/components/button/demos/basic.demo.tsx +0 -30
  354. package/src/components/button/demos/states.demo.tsx +0 -52
  355. package/src/components/combobox/demos/overview.demo.tsx +0 -199
  356. package/src/components/glyph/README.md +0 -72
  357. package/src/components/glyph/glyph.tsx +0 -110
  358. package/src/components/listbox/demos/overview.demo.tsx +0 -101
  359. package/src/components/menu/README.md +0 -96
  360. package/src/components/menu/demos/bubbling.demo.tsx +0 -34
  361. package/src/components/menu/demos/overview.demo.tsx +0 -76
  362. package/src/components/popover/demos/overview.demo.tsx +0 -143
  363. package/src/components/select/demos/deconstructed.demo.tsx +0 -95
  364. package/src/components/select/demos/overview.demo.tsx +0 -51
  365. package/src/components/separator/separator.ts +0 -19
  366. package/src/components/tabs/README.md +0 -105
  367. package/src/components/tabs/tabs.tsx +0 -504
  368. package/src/theme/README.md +0 -103
  369. package/src/theme/contract.ts +0 -215
  370. package/src/theme/glyph-contract.ts +0 -59
  371. package/src/theme/presets/rmx-01/glyphs.tsx +0 -308
  372. package/src/theme/presets/rmx-01/index.ts +0 -123
  373. package/src/theme/runtime.ts +0 -119
  374. package/src/theme/theme.ts +0 -15
  375. package/src/utils/scroll-lock/README.md +0 -33
  376. /package/dist/{components/breadcrumbs/breadcrumbs.d.ts → breadcrumbs/index.d.ts} +0 -0
  377. /package/dist/{utils → listbox}/flash-attribute.d.ts +0 -0
  378. /package/dist/{utils → listbox}/flash-attribute.js +0 -0
  379. /package/dist/{components/menu → menu}/hover-aim.d.ts +0 -0
  380. /package/dist/{components/menu → menu}/hover-aim.js +0 -0
  381. /package/dist/{interactions/outside-click/outside-click-mixin.d.ts → popover/outside-click.d.ts} +0 -0
  382. /package/dist/{interactions/keydown → select}/keydown.d.ts +0 -0
  383. /package/dist/{interactions/keydown → select}/keydown.js +0 -0
  384. /package/dist/{interactions/typeahead/typeahead-mixin.d.ts → shared/typeahead.d.ts} +0 -0
  385. /package/dist/{utils → shared}/wait-for-css-transition.d.ts +0 -0
  386. /package/dist/{utils → shared}/wait-for-css-transition.js +0 -0
  387. /package/dist/{utils → shared}/wait.d.ts +0 -0
  388. /package/dist/{utils → shared}/wait.js +0 -0
  389. /package/src/{utils → listbox}/flash-attribute.ts +0 -0
  390. /package/src/{components/menu → menu}/hover-aim.ts +0 -0
  391. /package/src/{interactions/outside-click/outside-click-mixin.ts → popover/outside-click.ts} +0 -0
  392. /package/src/{interactions/keydown → select}/keydown.ts +0 -0
  393. /package/src/{interactions/typeahead/typeahead-mixin.ts → shared/typeahead.ts} +0 -0
  394. /package/src/{utils → shared}/wait-for-css-transition.ts +0 -0
  395. /package/src/{utils → shared}/wait.ts +0 -0
@@ -1,199 +0,0 @@
1
- import { css, type Handle } from '@remix-run/ui'
2
- import { Combobox, ComboboxOption, onComboboxChange } from '@remix-run/ui/combobox'
3
- import { theme } from '@remix-run/ui/theme'
4
-
5
- /**
6
- * @name Combobox Overview
7
- * @description A searchable combobox with keyboard navigation. Try typing airport names or codes like ord, lax, or jfk.
8
- */
9
- export default function Example(handle: Handle) {
10
- let value: string | null = null
11
-
12
- return () => (
13
- <div mix={stackCss}>
14
- <div mix={fieldCss}>
15
- <label for="airport-combobox" mix={labelCss}>
16
- Airport
17
- </label>
18
-
19
- <Combobox
20
- inputId="airport-combobox"
21
- mix={[
22
- comboboxCss,
23
- onComboboxChange((event) => {
24
- value = event.value
25
- void handle.update()
26
- }),
27
- ]}
28
- name="airport"
29
- placeholder="Search airports or codes"
30
- >
31
- {airportOptions.map((airport) => (
32
- <ComboboxOption
33
- key={airport.value}
34
- disabled={airport.disabled}
35
- label={airport.label}
36
- searchValue={airport.searchValue}
37
- value={airport.value}
38
- />
39
- ))}
40
- </Combobox>
41
-
42
- <div mix={helpCss}>
43
- Try typing `san`, `wash`, or airport codes like `ord`, `lax`, or `jfk`, then use ArrowDown
44
- and Enter.
45
- </div>
46
- </div>
47
-
48
- <p mix={valueCss}>{`value=${value ?? 'null'}`}</p>
49
- </div>
50
- )
51
- }
52
-
53
- type AirportOption = {
54
- disabled?: boolean
55
- label: string
56
- searchValue: string[]
57
- value: string
58
- }
59
-
60
- const airportOptions: AirportOption[] = [
61
- {
62
- label: 'Hartsfield-Jackson Atlanta International',
63
- searchValue: ['atl', 'atlanta', 'hartsfield-jackson atlanta international'],
64
- value: 'ATL',
65
- },
66
- {
67
- label: 'Austin-Bergstrom International',
68
- searchValue: ['aus', 'austin', 'austin-bergstrom international'],
69
- value: 'AUS',
70
- },
71
- {
72
- label: 'Boston Logan International',
73
- searchValue: ['bos', 'boston', 'boston logan international'],
74
- value: 'BOS',
75
- },
76
- {
77
- label: 'Baltimore/Washington International',
78
- searchValue: ['bwi', 'baltimore', 'washington', 'baltimore/washington international'],
79
- value: 'BWI',
80
- },
81
- {
82
- label: 'Ronald Reagan Washington National',
83
- searchValue: ['dca', 'reagan', 'washington', 'ronald reagan washington national'],
84
- value: 'DCA',
85
- },
86
- {
87
- label: 'Denver International',
88
- searchValue: ['den', 'denver', 'denver international'],
89
- value: 'DEN',
90
- },
91
- {
92
- label: 'Dallas/Fort Worth International',
93
- searchValue: ['dfw', 'dallas', 'fort worth', 'dallas/fort worth international'],
94
- value: 'DFW',
95
- },
96
- {
97
- label: 'Newark Liberty International',
98
- searchValue: ['ewr', 'newark', 'newark liberty international'],
99
- value: 'EWR',
100
- },
101
- {
102
- label: 'Daniel K. Inouye International',
103
- searchValue: ['hnl', 'honolulu', 'daniel k. inouye international'],
104
- value: 'HNL',
105
- },
106
- {
107
- label: 'Washington Dulles International',
108
- searchValue: ['iad', 'dulles', 'washington', 'washington dulles international'],
109
- value: 'IAD',
110
- },
111
- {
112
- label: 'John F. Kennedy International',
113
- searchValue: ['jfk', 'kennedy', 'new york', 'john f. kennedy international'],
114
- value: 'JFK',
115
- },
116
- {
117
- label: 'Harry Reid International',
118
- searchValue: ['las', 'las vegas', 'harry reid international'],
119
- value: 'LAS',
120
- },
121
- {
122
- label: 'Los Angeles International',
123
- searchValue: ['lax', 'los angeles', 'los angeles international'],
124
- value: 'LAX',
125
- },
126
- {
127
- label: 'Orlando International',
128
- searchValue: ['mco', 'orlando', 'orlando international'],
129
- value: 'MCO',
130
- },
131
- {
132
- label: 'Miami International',
133
- searchValue: ['mia', 'miami', 'miami international'],
134
- value: 'MIA',
135
- },
136
- {
137
- label: "Chicago O'Hare International",
138
- searchValue: ['ord', 'ohare', 'chicago', "chicago o'hare international"],
139
- value: 'ORD',
140
- },
141
- {
142
- label: 'Portland International',
143
- searchValue: ['pdx', 'portland', 'portland international'],
144
- value: 'PDX',
145
- },
146
- {
147
- label: 'San Diego International',
148
- searchValue: ['san', 'san diego', 'san diego international'],
149
- value: 'SAN',
150
- },
151
- {
152
- label: 'San Francisco International',
153
- searchValue: ['sfo', 'san francisco', 'san francisco international'],
154
- value: 'SFO',
155
- },
156
- {
157
- disabled: true,
158
- label: 'San Jose Mineta International',
159
- searchValue: ['sjc', 'san jose', 'san jose mineta international'],
160
- value: 'SJC',
161
- },
162
- ]
163
-
164
- const comboboxCss = css({
165
- width: '16rem',
166
- })
167
-
168
- const stackCss = css({
169
- display: 'flex',
170
- flexDirection: 'column',
171
- gap: theme.space.sm,
172
- width: '100%',
173
- })
174
-
175
- const fieldCss = css({
176
- display: 'flex',
177
- flexDirection: 'column',
178
- gap: theme.space.xs,
179
- })
180
-
181
- const labelCss = css({
182
- margin: 0,
183
- fontSize: theme.fontSize.xs,
184
- fontWeight: theme.fontWeight.semibold,
185
- color: theme.colors.text.primary,
186
- })
187
-
188
- const helpCss = css({
189
- fontSize: theme.fontSize.xs,
190
- lineHeight: theme.lineHeight.relaxed,
191
- color: theme.colors.text.secondary,
192
- })
193
-
194
- const valueCss = css({
195
- margin: 0,
196
- fontFamily: theme.fontFamily.mono,
197
- fontSize: theme.fontSize.xs,
198
- color: theme.colors.text.secondary,
199
- })
@@ -1,72 +0,0 @@
1
- # glyph
2
-
3
- `Glyph` renders references into a shared SVG sprite sheet. Render a glyph sheet once, then render individual `Glyph` instances by name.
4
-
5
- ## Usage
6
-
7
- ```tsx
8
- import { Glyph } from 'remix/ui/glyph'
9
- import { RMX_01_GLYPHS } from 'remix/ui/theme'
10
-
11
- function Layout() {
12
- return (
13
- <html>
14
- <body>
15
- <RMX_01_GLYPHS />
16
- <button aria-label="Delete">
17
- <Glyph name="trash" />
18
- </button>
19
- </body>
20
- </html>
21
- )
22
- }
23
- ```
24
-
25
- Most glyphs are decorative because the surrounding control supplies the accessible name. `Glyph` sets `aria-hidden` by default in that case.
26
-
27
- ```tsx
28
- <button aria-label="Search">
29
- <Glyph name="search" />
30
- </button>
31
- ```
32
-
33
- Give the glyph its own label only when the SVG itself is the accessible element.
34
-
35
- ```tsx
36
- <Glyph aria-label="Search" name="search" viewBox="0 0 20 20" width="24" />
37
- ```
38
-
39
- Use `createGlyphSheet` when a theme or app provides its own complete glyph set. The generated sheet exposes the stable symbol ids and the original values for reuse.
40
-
41
- ```tsx
42
- import { createGlyphSheet, type GlyphValues } from 'remix/ui/glyph'
43
-
44
- declare const glyphValues: GlyphValues
45
-
46
- export const AppGlyphs = createGlyphSheet(glyphValues)
47
-
48
- AppGlyphs.ids.trash
49
- AppGlyphs.values.trash
50
- ```
51
-
52
- ## `glyph.*`
53
-
54
- - `Glyph`: renders an `<svg>` with a `<use>` element that points at the package-owned symbol id for `name`.
55
- - `createGlyphSheet(values)`: creates a hidden SVG sprite sheet component from a complete glyph value set.
56
- - `GlyphName`: typed union of supported glyph names.
57
- - `GlyphProps`: props accepted by `Glyph`.
58
- - `GlyphSheetProps`: props accepted by generated glyph sheet components.
59
- - `GlyphSymbol`: SVG symbol value accepted by glyph value maps.
60
- - `GlyphValues`: object shape expected by `createGlyphSheet`.
61
- - `GlyphSheetComponent`: generated sprite sheet component with `ids` and `values` attached.
62
-
63
- The built-in glyph names are `add`, `alert`, `check`, `chevronDown`, `chevronVertical`, `chevronUp`, `chevronRight`, `close`, `copy`, `edit`, `expand`, `info`, `menu`, `open`, `search`, `spinner`, and `trash`.
64
-
65
- ## Behavior Notes
66
-
67
- - Render the glyph sheet once before rendering glyph instances that reference it.
68
- - `createGlyphSheet` renders a hidden zero-size SVG and clones each provided `<symbol>` with the stable package id.
69
- - `Glyph` is `aria-hidden` by default when no accessible label or labelled-by relationship is provided.
70
- - Labeled glyphs keep their accessible label and do not force `aria-hidden`.
71
- - Host SVG props such as `viewBox`, `width`, `mix`, and `aria-label` are preserved.
72
- - `createGlyphSheet` throws if a provided glyph value is not a `<symbol>` element.
@@ -1,110 +0,0 @@
1
- import { createElement } from '@remix-run/ui'
2
- import type { Handle, Props, RemixElement } from '@remix-run/ui'
3
-
4
- import {
5
- glyphContract,
6
- glyphNames,
7
- type GlyphName,
8
- type GlyphValues,
9
- } from '../../theme/glyph-contract.ts'
10
-
11
- export type { GlyphName, GlyphSymbol, GlyphValues } from '../../theme/glyph-contract.ts'
12
-
13
- export type GlyphSheetProps = Omit<Props<'svg'>, 'children'>
14
-
15
- type GlyphSheetRenderer = (handle: Handle<GlyphSheetProps>) => () => RemixElement
16
-
17
- export type GlyphSheetComponent = GlyphSheetRenderer & {
18
- ids: Readonly<Record<GlyphName, string>>
19
- values: GlyphValues
20
- }
21
-
22
- export type GlyphProps = Omit<Props<'svg'>, 'children'> & {
23
- name: GlyphName
24
- }
25
-
26
- export function createGlyphSheet(values: GlyphValues): GlyphSheetComponent {
27
- let ids = Object.freeze(
28
- Object.fromEntries(glyphNames.map((name) => [name, glyphContract[name].id])) as Record<
29
- GlyphName,
30
- string
31
- >,
32
- )
33
-
34
- function GlyphSheet(handle: Handle<GlyphSheetProps>): () => RemixElement {
35
- return () => {
36
- let { style, ...svgProps } = handle.props
37
- let hiddenStyle = {
38
- position: 'absolute',
39
- width: '0',
40
- height: '0',
41
- overflow: 'hidden',
42
- pointerEvents: 'none',
43
- }
44
- let nextStyle =
45
- typeof style === 'object' && style !== null ? { ...hiddenStyle, ...style } : hiddenStyle
46
-
47
- return createElement(
48
- 'svg',
49
- {
50
- ...svgProps,
51
- 'aria-hidden': handle.props['aria-hidden'] ?? true,
52
- focusable: handle.props.focusable ?? 'false',
53
- height: handle.props.height ?? '0',
54
- style: nextStyle,
55
- width: handle.props.width ?? '0',
56
- xmlns: 'http://www.w3.org/2000/svg',
57
- },
58
- glyphNames.map((name) => {
59
- let glyph = values[name]
60
-
61
- return cloneGlyphSymbol(name, glyph, ids[name])
62
- }),
63
- )
64
- }
65
- }
66
-
67
- return Object.assign(GlyphSheet, {
68
- ids,
69
- values,
70
- })
71
- }
72
-
73
- export function Glyph(handle: Handle<GlyphProps>): () => RemixElement {
74
- return () => {
75
- let { fill, name, ...svgProps } = handle.props
76
- let glyphId = glyphContract[name].id
77
- let hiddenByDefault =
78
- handle.props['aria-hidden'] === undefined &&
79
- handle.props['aria-label'] === undefined &&
80
- handle.props['aria-labelledby'] === undefined
81
-
82
- return createElement(
83
- 'svg',
84
- {
85
- ...svgProps,
86
- 'aria-hidden': hiddenByDefault ? true : handle.props['aria-hidden'],
87
- fill: fill ?? 'none',
88
- xmlns: 'http://www.w3.org/2000/svg',
89
- },
90
- createElement('use', {
91
- xlinkHref: `#${glyphId}`,
92
- }),
93
- )
94
- }
95
- }
96
-
97
- function cloneGlyphSymbol(name: GlyphName, glyph: RemixElement, id: string): RemixElement {
98
- if (glyph.type !== 'symbol') {
99
- throw new TypeError(`Expected glyph "${name}" to be a <symbol> element`)
100
- }
101
-
102
- return {
103
- ...glyph,
104
- key: name,
105
- props: {
106
- ...glyph.props,
107
- id,
108
- },
109
- }
110
- }
@@ -1,101 +0,0 @@
1
- import { css, on, type Handle } from '@remix-run/ui'
2
- import { Glyph } from '@remix-run/ui/glyph'
3
- import * as listbox from '@remix-run/ui/listbox'
4
- import type { ListboxValue } from '@remix-run/ui/listbox'
5
- import { theme } from '@remix-run/ui/theme'
6
-
7
- /**
8
- * @name Listbox Overview
9
- * @description A keyboard-navigable listbox with selection, highlighting, and an optional flash-selection animation.
10
- */
11
- export default function Example(handle: Handle) {
12
- let value: ListboxValue = options[0]!.value
13
- let activeValue: ListboxValue = options[0]!.value
14
- let flashSelection = false
15
-
16
- return () => {
17
- return (
18
- <div mix={stackCss}>
19
- <listbox.Context
20
- value={value}
21
- activeValue={activeValue}
22
- flashSelection={flashSelection}
23
- onSelect={(nextValue) => {
24
- value = nextValue
25
- handle.update()
26
- }}
27
- onHighlight={(nextActiveValue) => {
28
- activeValue = nextActiveValue
29
- handle.update()
30
- }}
31
- >
32
- <div tabIndex={0} mix={[listbox.listStyle, listbox.list(), containerCss]}>
33
- {options.map((option) => (
34
- <div key={option.value} mix={[listbox.optionStyle, listbox.option(option)]}>
35
- <Glyph mix={listbox.glyphStyle} name="check" />
36
- <span mix={listbox.labelStyle}>{option.label}</span>
37
- </div>
38
- ))}
39
- </div>
40
- </listbox.Context>
41
- <div mix={controlsCss}>
42
- <label mix={checkboxLabelCss}>
43
- <input
44
- type="checkbox"
45
- defaultChecked={flashSelection}
46
- mix={on('change', (event) => {
47
- flashSelection = event.currentTarget.checked
48
- handle.update()
49
- })}
50
- />{' '}
51
- Flash selection
52
- </label>
53
- <p mix={valueCss}>{`value=${value ?? 'null'}`}</p>
54
- </div>
55
- </div>
56
- )
57
- }
58
- }
59
-
60
- const options = [
61
- { label: 'Apple', value: 'apple' },
62
- { label: 'Banana', value: 'banana' },
63
- { label: 'Cherry', value: 'cherry' },
64
- { label: 'Date', value: 'date' },
65
- { label: 'Elderberry', value: 'elderberry' },
66
- { label: 'Fig', value: 'fig' },
67
- { label: 'Grape', value: 'grape' },
68
- ] as const
69
-
70
- const containerCss = css({
71
- borderColor: theme.colors.border.subtle,
72
- padding: theme.space.xs,
73
- borderRadius: theme.radius.lg,
74
- borderStyle: 'solid',
75
- })
76
-
77
- const stackCss = css({
78
- display: 'flex',
79
- flexDirection: 'column',
80
- gap: theme.space.md,
81
- width: '100%',
82
- })
83
-
84
- const controlsCss = css({
85
- display: 'flex',
86
- flexDirection: 'column',
87
- gap: theme.space.xs,
88
- })
89
-
90
- const checkboxLabelCss = css({
91
- fontSize: theme.fontSize.sm,
92
- lineHeight: theme.lineHeight.normal,
93
- color: theme.colors.text.secondary,
94
- })
95
-
96
- const valueCss = css({
97
- margin: 0,
98
- fontFamily: theme.fontFamily.mono,
99
- fontSize: theme.fontSize.xs,
100
- color: theme.colors.text.secondary,
101
- })
@@ -1,96 +0,0 @@
1
- # menu
2
-
3
- `Menu` renders a button-triggered menu with keyboard navigation, checked items, selection events, and nested submenus. Use it for action menus and command groups.
4
-
5
- ## Usage
6
-
7
- ```tsx
8
- import type { Handle } from 'remix/ui'
9
- import { Menu, MenuItem, Submenu, onMenuSelect } from 'remix/ui/menu'
10
- import { separatorStyle } from 'remix/ui/separator'
11
-
12
- export function ViewMenu(handle: Handle) {
13
- let wordWrap = false
14
- let density = 'comfortable'
15
-
16
- return () => (
17
- <Menu
18
- label="View"
19
- mix={onMenuSelect((event) => {
20
- if (event.item.name === 'wordWrap') {
21
- wordWrap = event.item.checked ?? false
22
- } else if (event.item.name === 'density' && event.item.value) {
23
- density = event.item.value
24
- }
25
-
26
- void handle.update()
27
- })}
28
- >
29
- <MenuItem checked={wordWrap} name="wordWrap" type="checkbox">
30
- Word wrap
31
- </MenuItem>
32
- <MenuItem disabled name="minimap">
33
- Minimap
34
- </MenuItem>
35
- <hr mix={separatorStyle} />
36
- <MenuItem checked={density === 'compact'} name="density" type="radio" value="compact">
37
- Compact
38
- </MenuItem>
39
- <MenuItem checked={density === 'comfortable'} name="density" type="radio" value="comfortable">
40
- Comfortable
41
- </MenuItem>
42
- <Submenu label="Zoom">
43
- <MenuItem name="zoomIn" value="zoom-in">
44
- Zoom in
45
- </MenuItem>
46
- <MenuItem name="zoomOut" value="zoom-out">
47
- Zoom out
48
- </MenuItem>
49
- </Submenu>
50
- </Menu>
51
- )
52
- }
53
- ```
54
-
55
- Use `label` or `searchValue` when the rendered item content is not the text that should be used for event labels or typeahead.
56
-
57
- ```tsx
58
- <MenuItem label="Open command palette" name="commandPalette" searchValue="palette">
59
- Command palette
60
- </MenuItem>
61
- ```
62
-
63
- Use `menuLabel` when the menu surface needs a different accessible label from the visible trigger.
64
-
65
- ```tsx
66
- <Menu label="..." menuLabel="Project actions">
67
- <MenuItem name="rename">Rename project</MenuItem>
68
- </Menu>
69
- ```
70
-
71
- ## `menu.*`
72
-
73
- - `Menu`: composed trigger, popover, and list component for the common menu case.
74
- - `MenuItem`: menu item wrapper. Supports regular, checkbox, and radio item roles through `type`, `checked`, `name`, `value`, `label`, `disabled`, and `searchValue`.
75
- - `Submenu`: nested menu wrapper with its own trigger and child menu surface.
76
- - `MenuList`: lower-level list wrapper for custom composition.
77
- - `onMenuSelect(...)`: event mixin for the bubbling `MenuSelectEvent`.
78
- - `MenuSelectEvent`: bubbling event class whose `item` describes the selected item.
79
- - `MenuSelectItem`: selected item shape with `checked`, `id`, `label`, `name`, `type`, and `value`.
80
- - `menu.Context`, `menu.trigger()`, `menu.popover()`, `menu.list()`, `menu.item(...)`, and `menu.submenuTrigger(...)`: lower-level composition primitives.
81
- - `buttonStyle`, `popoverStyle`, `listStyle`, `itemStyle`, `itemSlotStyle`, `itemLabelStyle`, `itemGlyphStyle`, and `triggerGlyphStyle`: flat style mixins used by the wrappers.
82
- - `MenuProps`, `MenuItemProps`, `MenuListProps`, `MenuProviderProps`, `MenuTriggerOptions`, `MenuItemOptions`, and `SubmenuProps`: public TypeScript props and option types.
83
-
84
- ## Behavior Notes
85
-
86
- - Click opens the root menu and focuses the list; clicking the trigger again closes it and restores focus.
87
- - `ArrowDown` opens from the trigger at the first enabled item. `ArrowUp` opens at the last enabled item. Enter and Space open the menu with focus on the list.
88
- - Keyboard navigation skips disabled items and does not wrap past the first or last enabled item.
89
- - `Home` and `End` move to the first and last enabled item. Enter and Space activate the highlighted item.
90
- - Printable keys use typeahead. Typeahead matches `searchValue` when provided and otherwise uses the item label.
91
- - Submenus open with `ArrowRight`, close with `ArrowLeft`, and are anchored to the submenu trigger with `right-start` placement.
92
- - Pointer movement highlights enabled items. Submenus open after a short focus/pointer delay and use hover aim so they stay open while moving toward the child surface.
93
- - Selecting a regular item flashes that item. Selecting a checkbox or radio item flashes the committed checked state.
94
- - Selection dispatches one bubbled `MenuSelectEvent`, closes the full menu tree, and restores focus to the root trigger.
95
- - The composed `Menu` re-dispatches selection from its trigger so handlers on the `Menu` button and shared ancestors see the event once.
96
- - `menuLabel`, `Submenu.menuLabel`, and `Submenu.listProps` let composed menus label and customize menu surfaces separately from trigger content.
@@ -1,34 +0,0 @@
1
- import { on } from '@remix-run/ui'
2
- import { Menu, MenuItem, onMenuSelect } from '@remix-run/ui/menu'
3
-
4
- /**
5
- * @name Menu Event Bubbling
6
- * @description Item-level handlers fire before the root handler, letting individual items intercept events while others bubble up.
7
- */
8
- export default function Example() {
9
- return () => (
10
- <Menu
11
- label="Project"
12
- menuLabel="Project actions"
13
- mix={onMenuSelect((event) => {
14
- console.log('Menu root handler:', event.item)
15
- })}
16
- >
17
- <MenuItem name="open" value="open-project">
18
- Open project
19
- </MenuItem>
20
- <MenuItem
21
- name="rename"
22
- value="rename-project"
23
- mix={onMenuSelect((event) => {
24
- console.log('Menu item handler:', event.item)
25
- })}
26
- >
27
- Rename project
28
- </MenuItem>
29
- <MenuItem name="duplicate" value="duplicate-project">
30
- Duplicate project
31
- </MenuItem>
32
- </Menu>
33
- )
34
- }
@@ -1,76 +0,0 @@
1
- import { type Handle } from '@remix-run/ui'
2
- import { Menu, MenuItem, onMenuSelect, Submenu } from '@remix-run/ui/menu'
3
- import { separatorStyle } from '@remix-run/ui/separator'
4
-
5
- /**
6
- * @name Menu Overview
7
- * @description A hierarchical menu with checkboxes, radio groups, submenus, and separators.
8
- */
9
- export default function Example(handle: Handle) {
10
- type Density = 'comfortable' | 'compact'
11
- let wordWrap = true
12
- let minimap = false
13
- let showGutter = true
14
- let density: Density = 'comfortable'
15
-
16
- return () => (
17
- <Menu
18
- label="View"
19
- menuLabel="View options"
20
- mix={onMenuSelect((event) => {
21
- switch (event.item.name) {
22
- case 'wordWrap':
23
- wordWrap = !wordWrap
24
- break
25
- case 'minimap':
26
- minimap = !minimap
27
- break
28
- case 'showGutter':
29
- showGutter = !showGutter
30
- break
31
- case 'density':
32
- density = event.item.value as Density
33
- break
34
- }
35
- handle.update()
36
- })}
37
- >
38
- <MenuItem name="wordWrap" type="checkbox" checked={wordWrap}>
39
- Word wrap
40
- </MenuItem>
41
- <MenuItem name="minimap" type="checkbox" checked={minimap}>
42
- Minimap
43
- </MenuItem>
44
- <MenuItem name="showGutter" type="checkbox" checked={showGutter}>
45
- Show gutter
46
- </MenuItem>
47
-
48
- <hr mix={separatorStyle} />
49
- <Submenu label="Zoom">
50
- <MenuItem name="zoomIn" value="zoom-in">
51
- Zoom In
52
- </MenuItem>
53
- <MenuItem name="zoomOut" value="zoom-out">
54
- Zoom Out
55
- </MenuItem>
56
- <MenuItem name="resetZoom" value="reset-zoom">
57
- Reset Zoom
58
- </MenuItem>
59
- </Submenu>
60
-
61
- <Submenu label="Density">
62
- <MenuItem
63
- name="density"
64
- type="radio"
65
- value="comfortable"
66
- checked={density === 'comfortable'}
67
- >
68
- Comfortable
69
- </MenuItem>
70
- <MenuItem name="density" type="radio" value="compact" checked={density === 'compact'}>
71
- Compact
72
- </MenuItem>
73
- </Submenu>
74
- </Menu>
75
- )
76
- }