@remix-run/ui 0.3.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 (308) 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.js → anchor/index.js} +1 -1
  9. package/dist/anchor/index.js.map +1 -0
  10. package/dist/animation/demos/reordering.js +9 -6
  11. package/dist/animation/demos/reordering.js.map +1 -1
  12. package/dist/{components/breadcrumbs/breadcrumbs.js → breadcrumbs/index.js} +19 -19
  13. package/dist/breadcrumbs/index.js.map +1 -0
  14. package/dist/button/index.d.ts +15 -0
  15. package/dist/button/index.js +128 -0
  16. package/dist/button/index.js.map +1 -0
  17. package/dist/checkbox/index.d.ts +14 -0
  18. package/dist/checkbox/index.js +125 -0
  19. package/dist/checkbox/index.js.map +1 -0
  20. package/dist/combobox/index.d.ts +21 -0
  21. package/dist/combobox/index.js +58 -0
  22. package/dist/combobox/index.js.map +1 -0
  23. package/dist/{components/combobox/combobox.d.ts → combobox/primitives.d.ts} +3 -7
  24. package/dist/{components/combobox/combobox.js → combobox/primitives.js} +8 -61
  25. package/dist/combobox/primitives.js.map +1 -0
  26. package/dist/input/index.d.ts +13 -0
  27. package/dist/input/index.js +121 -0
  28. package/dist/input/index.js.map +1 -0
  29. package/dist/listbox/flash-attribute.js.map +1 -0
  30. package/dist/{components/listbox/listbox.d.ts → listbox/index.d.ts} +2 -6
  31. package/dist/{components/listbox/listbox.js → listbox/index.js} +4 -82
  32. package/dist/listbox/index.js.map +1 -0
  33. package/dist/menu/hover-aim.js.map +1 -0
  34. package/dist/menu/index.d.ts +42 -0
  35. package/dist/menu/index.js +250 -0
  36. package/dist/menu/index.js.map +1 -0
  37. package/dist/{components/menu/menu.d.ts → menu/primitives.d.ts} +3 -32
  38. package/dist/{components/menu/menu.js → menu/primitives.js} +97 -314
  39. package/dist/menu/primitives.js.map +1 -0
  40. package/dist/{components/popover/popover.d.ts → popover/index.d.ts} +2 -4
  41. package/dist/{components/popover/popover.js → popover/index.js} +5 -48
  42. package/dist/popover/index.js.map +1 -0
  43. package/dist/{interactions/outside-click/outside-click-mixin.js → popover/outside-click.js} +1 -1
  44. package/dist/popover/outside-click.js.map +1 -0
  45. package/dist/popover/scroll-lock.d.ts +1 -0
  46. package/dist/{utils → popover}/scroll-lock.js +0 -18
  47. package/dist/popover/scroll-lock.js.map +1 -0
  48. package/dist/radio/index.d.ts +12 -0
  49. package/dist/radio/index.js +77 -0
  50. package/dist/radio/index.js.map +1 -0
  51. package/dist/runtime/reconcile.js +11 -5
  52. package/dist/runtime/reconcile.js.map +1 -1
  53. package/dist/runtime/vdom.js +3 -0
  54. package/dist/runtime/vdom.js.map +1 -1
  55. package/dist/select/index.d.ts +19 -0
  56. package/dist/select/index.js +95 -0
  57. package/dist/select/index.js.map +1 -0
  58. package/dist/select/keydown.js.map +1 -0
  59. package/dist/{components/select/select.d.ts → select/primitives.d.ts} +4 -6
  60. package/dist/{components/select/select.js → select/primitives.js} +11 -63
  61. package/dist/select/primitives.js.map +1 -0
  62. package/dist/server/stream.js +2 -2
  63. package/dist/server/stream.js.map +1 -1
  64. package/dist/shared/focus-styles.d.ts +1 -0
  65. package/dist/shared/focus-styles.js +2 -0
  66. package/dist/shared/focus-styles.js.map +1 -0
  67. package/dist/shared/icons.d.ts +9 -0
  68. package/dist/shared/icons.js +42 -0
  69. package/dist/shared/icons.js.map +1 -0
  70. package/dist/shared/listbox-popover-styles.d.ts +6 -0
  71. package/dist/shared/listbox-popover-styles.js +137 -0
  72. package/dist/shared/listbox-popover-styles.js.map +1 -0
  73. package/dist/shared/style-values.d.ts +78 -0
  74. package/dist/{theme/presets/rmx-01/index.js → shared/style-values.js} +3 -34
  75. package/dist/shared/style-values.js.map +1 -0
  76. package/dist/{interactions/typeahead/typeahead-mixin.js → shared/typeahead.js} +1 -1
  77. package/dist/shared/typeahead.js.map +1 -0
  78. package/dist/shared/wait-for-css-transition.js.map +1 -0
  79. package/dist/shared/wait.js.map +1 -0
  80. package/dist/tabs/index.d.ts +32 -0
  81. package/dist/tabs/index.js +157 -0
  82. package/dist/tabs/index.js.map +1 -0
  83. package/dist/tabs/primitives.d.ts +57 -0
  84. package/dist/tabs/primitives.js +238 -0
  85. package/dist/tabs/primitives.js.map +1 -0
  86. package/dist/toggle/index.d.ts +9 -0
  87. package/dist/toggle/index.js +108 -0
  88. package/dist/toggle/index.js.map +1 -0
  89. package/dist/toggle/primitives.d.ts +29 -0
  90. package/dist/toggle/primitives.js +127 -0
  91. package/dist/toggle/primitives.js.map +1 -0
  92. package/package.json +73 -44
  93. package/src/{components/accordion → accordion}/README.md +50 -14
  94. package/src/accordion/index.tsx +285 -0
  95. package/src/accordion/primitives.tsx +512 -0
  96. package/src/{components/anchor → anchor}/README.md +37 -2
  97. package/src/animation/demos/reordering.tsx +9 -6
  98. package/src/{components/breadcrumbs → breadcrumbs}/README.md +4 -4
  99. package/src/{components/breadcrumbs/breadcrumbs.tsx → breadcrumbs/index.tsx} +18 -18
  100. package/src/button/README.md +44 -0
  101. package/src/button/index.ts +168 -0
  102. package/src/checkbox/README.md +59 -0
  103. package/src/checkbox/index.ts +162 -0
  104. package/src/{components/combobox → combobox}/README.md +58 -9
  105. package/src/combobox/index.tsx +112 -0
  106. package/src/{components/combobox/combobox.tsx → combobox/primitives.tsx} +5 -91
  107. package/src/input/README.md +52 -0
  108. package/src/input/index.ts +147 -0
  109. package/src/{components/listbox → listbox}/README.md +9 -41
  110. package/src/{components/listbox/listbox.ts → listbox/index.ts} +2 -87
  111. package/src/{components/menu → menu}/README.md +55 -14
  112. package/src/menu/index.tsx +354 -0
  113. package/src/{components/menu/menu.tsx → menu/primitives.tsx} +99 -413
  114. package/src/{components/popover → popover}/README.md +20 -39
  115. package/src/{components/popover/popover.ts → popover/index.ts} +3 -57
  116. package/src/{utils → popover}/scroll-lock.ts +0 -28
  117. package/src/radio/README.md +53 -0
  118. package/src/radio/index.ts +100 -0
  119. package/src/runtime/demos/readme.demo.tsx +16 -14
  120. package/src/runtime/reconcile.ts +11 -5
  121. package/src/runtime/vdom.ts +3 -0
  122. package/src/{components/select → select}/README.md +29 -19
  123. package/src/select/index.tsx +159 -0
  124. package/src/{components/select/select.tsx → select/primitives.tsx} +10 -98
  125. package/src/server/stream.ts +3 -3
  126. package/src/shared/focus-styles.ts +2 -0
  127. package/src/shared/icons.tsx +62 -0
  128. package/src/shared/listbox-popover-styles.ts +146 -0
  129. package/src/shared/style-values.ts +165 -0
  130. package/src/tabs/README.md +141 -0
  131. package/src/tabs/index.tsx +244 -0
  132. package/src/tabs/primitives.ts +365 -0
  133. package/src/toggle/README.md +56 -0
  134. package/src/toggle/index.tsx +134 -0
  135. package/src/toggle/primitives.ts +192 -0
  136. package/dist/animation/demos/animation.demo.d.ts +0 -5
  137. package/dist/animation/demos/animation.demo.js +0 -92
  138. package/dist/animation/demos/animation.demo.js.map +0 -1
  139. package/dist/animation/demos/spring.demo.d.ts +0 -6
  140. package/dist/animation/demos/spring.demo.js +0 -304
  141. package/dist/animation/demos/spring.demo.js.map +0 -1
  142. package/dist/components/accordion/accordion.d.ts +0 -92
  143. package/dist/components/accordion/accordion.js +0 -335
  144. package/dist/components/accordion/accordion.js.map +0 -1
  145. package/dist/components/accordion/demos/card.demo.d.ts +0 -7
  146. package/dist/components/accordion/demos/card.demo.js +0 -59
  147. package/dist/components/accordion/demos/card.demo.js.map +0 -1
  148. package/dist/components/accordion/demos/multiple.demo.d.ts +0 -7
  149. package/dist/components/accordion/demos/multiple.demo.js +0 -20
  150. package/dist/components/accordion/demos/multiple.demo.js.map +0 -1
  151. package/dist/components/accordion/demos/overview.demo.d.ts +0 -7
  152. package/dist/components/accordion/demos/overview.demo.js +0 -20
  153. package/dist/components/accordion/demos/overview.demo.js.map +0 -1
  154. package/dist/components/anchor/anchor.js.map +0 -1
  155. package/dist/components/breadcrumbs/basic.demo.d.ts +0 -6
  156. package/dist/components/breadcrumbs/basic.demo.js +0 -15
  157. package/dist/components/breadcrumbs/basic.demo.js.map +0 -1
  158. package/dist/components/breadcrumbs/breadcrumbs.js.map +0 -1
  159. package/dist/components/breadcrumbs/separator.demo.d.ts +0 -6
  160. package/dist/components/breadcrumbs/separator.demo.js +0 -15
  161. package/dist/components/breadcrumbs/separator.demo.js.map +0 -1
  162. package/dist/components/button/button.d.ts +0 -105
  163. package/dist/components/button/button.js +0 -207
  164. package/dist/components/button/button.js.map +0 -1
  165. package/dist/components/button/demos/aliases.demo.d.ts +0 -7
  166. package/dist/components/button/demos/aliases.demo.js +0 -19
  167. package/dist/components/button/demos/aliases.demo.js.map +0 -1
  168. package/dist/components/button/demos/basic.demo.d.ts +0 -7
  169. package/dist/components/button/demos/basic.demo.js +0 -20
  170. package/dist/components/button/demos/basic.demo.js.map +0 -1
  171. package/dist/components/button/demos/states.demo.d.ts +0 -7
  172. package/dist/components/button/demos/states.demo.js +0 -30
  173. package/dist/components/button/demos/states.demo.js.map +0 -1
  174. package/dist/components/combobox/combobox.js.map +0 -1
  175. package/dist/components/combobox/overview.demo.d.ts +0 -7
  176. package/dist/components/combobox/overview.demo.js +0 -154
  177. package/dist/components/combobox/overview.demo.js.map +0 -1
  178. package/dist/components/glyph/glyph.d.ts +0 -14
  179. package/dist/components/glyph/glyph.js +0 -65
  180. package/dist/components/glyph/glyph.js.map +0 -1
  181. package/dist/components/listbox/listbox.js.map +0 -1
  182. package/dist/components/listbox/overview.demo.d.ts +0 -7
  183. package/dist/components/listbox/overview.demo.js +0 -65
  184. package/dist/components/listbox/overview.demo.js.map +0 -1
  185. package/dist/components/menu/demos/bubbling.demo.d.ts +0 -6
  186. package/dist/components/menu/demos/bubbling.demo.js +0 -16
  187. package/dist/components/menu/demos/bubbling.demo.js.map +0 -1
  188. package/dist/components/menu/demos/context-trigger.demo.d.ts +0 -7
  189. package/dist/components/menu/demos/context-trigger.demo.js +0 -87
  190. package/dist/components/menu/demos/context-trigger.demo.js.map +0 -1
  191. package/dist/components/menu/demos/overview.demo.d.ts +0 -7
  192. package/dist/components/menu/demos/overview.demo.js +0 -33
  193. package/dist/components/menu/demos/overview.demo.js.map +0 -1
  194. package/dist/components/menu/hover-aim.js.map +0 -1
  195. package/dist/components/menu/menu.js.map +0 -1
  196. package/dist/components/popover/overview.demo.d.ts +0 -7
  197. package/dist/components/popover/overview.demo.js +0 -65
  198. package/dist/components/popover/overview.demo.js.map +0 -1
  199. package/dist/components/popover/popover.js.map +0 -1
  200. package/dist/components/select/deconstructed.demo.d.ts +0 -7
  201. package/dist/components/select/deconstructed.demo.js +0 -54
  202. package/dist/components/select/deconstructed.demo.js.map +0 -1
  203. package/dist/components/select/overview.demo.d.ts +0 -6
  204. package/dist/components/select/overview.demo.js +0 -28
  205. package/dist/components/select/overview.demo.js.map +0 -1
  206. package/dist/components/select/select.js.map +0 -1
  207. package/dist/components/separator/separator.d.ts +0 -2
  208. package/dist/components/separator/separator.js +0 -15
  209. package/dist/components/separator/separator.js.map +0 -1
  210. package/dist/components/tabs/tabs.d.ts +0 -78
  211. package/dist/components/tabs/tabs.js +0 -339
  212. package/dist/components/tabs/tabs.js.map +0 -1
  213. package/dist/interactions/keydown/keydown.js.map +0 -1
  214. package/dist/interactions/outside-click/outside-click-mixin.js.map +0 -1
  215. package/dist/interactions/typeahead/typeahead-mixin.js.map +0 -1
  216. package/dist/runtime/demos/basic.demo.d.ts +0 -6
  217. package/dist/runtime/demos/basic.demo.js +0 -16
  218. package/dist/runtime/demos/basic.demo.js.map +0 -1
  219. package/dist/runtime/demos/controlled-uncontrolled-values.demo.d.ts +0 -6
  220. package/dist/runtime/demos/controlled-uncontrolled-values.demo.js +0 -77
  221. package/dist/runtime/demos/controlled-uncontrolled-values.demo.js.map +0 -1
  222. package/dist/runtime/demos/keyed-list.demo.d.ts +0 -6
  223. package/dist/runtime/demos/keyed-list.demo.js +0 -62
  224. package/dist/runtime/demos/keyed-list.demo.js.map +0 -1
  225. package/dist/runtime/demos/readme.demo.d.ts +0 -5
  226. package/dist/runtime/demos/readme.demo.js +0 -396
  227. package/dist/runtime/demos/readme.demo.js.map +0 -1
  228. package/dist/theme/contract.d.ts +0 -61
  229. package/dist/theme/contract.js +0 -131
  230. package/dist/theme/contract.js.map +0 -1
  231. package/dist/theme/glyph-contract.d.ts +0 -11
  232. package/dist/theme/glyph-contract.js +0 -34
  233. package/dist/theme/glyph-contract.js.map +0 -1
  234. package/dist/theme/presets/rmx-01/glyphs.d.ts +0 -2
  235. package/dist/theme/presets/rmx-01/glyphs.js +0 -252
  236. package/dist/theme/presets/rmx-01/glyphs.js.map +0 -1
  237. package/dist/theme/presets/rmx-01/index.d.ts +0 -4
  238. package/dist/theme/presets/rmx-01/index.js.map +0 -1
  239. package/dist/theme/runtime.d.ts +0 -2
  240. package/dist/theme/runtime.js +0 -84
  241. package/dist/theme/runtime.js.map +0 -1
  242. package/dist/theme/theme.d.ts +0 -6
  243. package/dist/theme/theme.js +0 -5
  244. package/dist/theme/theme.js.map +0 -1
  245. package/dist/utils/flash-attribute.js.map +0 -1
  246. package/dist/utils/scroll-lock.d.ts +0 -3
  247. package/dist/utils/scroll-lock.js.map +0 -1
  248. package/dist/utils/wait-for-css-transition.js.map +0 -1
  249. package/dist/utils/wait.js.map +0 -1
  250. package/src/animation/demos/animation.demo.tsx +0 -194
  251. package/src/animation/demos/spring.demo.tsx +0 -385
  252. package/src/components/accordion/accordion.tsx +0 -565
  253. package/src/components/accordion/demos/card.demo.tsx +0 -114
  254. package/src/components/accordion/demos/multiple.demo.tsx +0 -57
  255. package/src/components/accordion/demos/overview.demo.tsx +0 -57
  256. package/src/components/breadcrumbs/basic.demo.tsx +0 -18
  257. package/src/components/breadcrumbs/separator.demo.tsx +0 -19
  258. package/src/components/button/README.md +0 -44
  259. package/src/components/button/button.tsx +0 -286
  260. package/src/components/button/demos/aliases.demo.tsx +0 -28
  261. package/src/components/button/demos/basic.demo.tsx +0 -31
  262. package/src/components/button/demos/states.demo.tsx +0 -53
  263. package/src/components/combobox/overview.demo.tsx +0 -200
  264. package/src/components/glyph/README.md +0 -72
  265. package/src/components/glyph/glyph.tsx +0 -110
  266. package/src/components/listbox/overview.demo.tsx +0 -102
  267. package/src/components/menu/demos/bubbling.demo.tsx +0 -35
  268. package/src/components/menu/demos/context-trigger.demo.tsx +0 -133
  269. package/src/components/menu/demos/overview.demo.tsx +0 -77
  270. package/src/components/popover/overview.demo.tsx +0 -144
  271. package/src/components/select/deconstructed.demo.tsx +0 -96
  272. package/src/components/select/overview.demo.tsx +0 -52
  273. package/src/components/separator/separator.ts +0 -19
  274. package/src/components/tabs/README.md +0 -105
  275. package/src/components/tabs/tabs.tsx +0 -504
  276. package/src/runtime/demos/basic.demo.tsx +0 -21
  277. package/src/runtime/demos/controlled-uncontrolled-values.demo.tsx +0 -177
  278. package/src/runtime/demos/keyed-list.demo.tsx +0 -94
  279. package/src/theme/README.md +0 -103
  280. package/src/theme/contract.ts +0 -215
  281. package/src/theme/glyph-contract.ts +0 -59
  282. package/src/theme/presets/rmx-01/glyphs.tsx +0 -308
  283. package/src/theme/presets/rmx-01/index.ts +0 -123
  284. package/src/theme/runtime.ts +0 -119
  285. package/src/theme/theme.ts +0 -15
  286. package/src/utils/scroll-lock/README.md +0 -33
  287. /package/dist/{components/anchor/anchor.d.ts → anchor/index.d.ts} +0 -0
  288. /package/dist/{components/breadcrumbs/breadcrumbs.d.ts → breadcrumbs/index.d.ts} +0 -0
  289. /package/dist/{utils → listbox}/flash-attribute.d.ts +0 -0
  290. /package/dist/{utils → listbox}/flash-attribute.js +0 -0
  291. /package/dist/{components/menu → menu}/hover-aim.d.ts +0 -0
  292. /package/dist/{components/menu → menu}/hover-aim.js +0 -0
  293. /package/dist/{interactions/outside-click/outside-click-mixin.d.ts → popover/outside-click.d.ts} +0 -0
  294. /package/dist/{interactions/keydown → select}/keydown.d.ts +0 -0
  295. /package/dist/{interactions/keydown → select}/keydown.js +0 -0
  296. /package/dist/{interactions/typeahead/typeahead-mixin.d.ts → shared/typeahead.d.ts} +0 -0
  297. /package/dist/{utils → shared}/wait-for-css-transition.d.ts +0 -0
  298. /package/dist/{utils → shared}/wait-for-css-transition.js +0 -0
  299. /package/dist/{utils → shared}/wait.d.ts +0 -0
  300. /package/dist/{utils → shared}/wait.js +0 -0
  301. /package/src/{components/anchor/anchor.ts → anchor/index.ts} +0 -0
  302. /package/src/{utils → listbox}/flash-attribute.ts +0 -0
  303. /package/src/{components/menu → menu}/hover-aim.ts +0 -0
  304. /package/src/{interactions/outside-click/outside-click-mixin.ts → popover/outside-click.ts} +0 -0
  305. /package/src/{interactions/keydown → select}/keydown.ts +0 -0
  306. /package/src/{interactions/typeahead/typeahead-mixin.ts → shared/typeahead.ts} +0 -0
  307. /package/src/{utils → shared}/wait-for-css-transition.ts +0 -0
  308. /package/src/{utils → shared}/wait.ts +0 -0
@@ -1,308 +0,0 @@
1
- import { createElement } from '@remix-run/ui'
2
- import type { RemixNode } from '@remix-run/ui'
3
-
4
- import type { GlyphValues } from '../../glyph-contract.ts'
5
-
6
- const defaultViewBox = '0 0 16 16'
7
-
8
- function symbol(...content: RemixNode[]) {
9
- return createElement('symbol', { viewBox: defaultViewBox }, ...content)
10
- }
11
-
12
- export const glyphValues: GlyphValues = {
13
- add: symbol(
14
- createElement('path', {
15
- d: 'M8 3.25v9.5M3.25 8h9.5',
16
- fill: 'none',
17
- stroke: 'currentColor',
18
- strokeLinecap: 'round',
19
- strokeLinejoin: 'round',
20
- strokeWidth: '1.5',
21
- }),
22
- ),
23
- alert: symbol(
24
- createElement('path', {
25
- d: 'M8 2.5 13.75 12.5H2.25Z',
26
- fill: 'none',
27
- stroke: 'currentColor',
28
- strokeLinejoin: 'round',
29
- strokeWidth: '1.5',
30
- }),
31
- createElement('path', {
32
- d: 'M8 5.75v3.5',
33
- fill: 'none',
34
- stroke: 'currentColor',
35
- strokeLinecap: 'round',
36
- strokeWidth: '1.5',
37
- }),
38
- createElement('circle', {
39
- cx: '8',
40
- cy: '11.25',
41
- fill: 'currentColor',
42
- r: '0.75',
43
- }),
44
- ),
45
- check: symbol(
46
- createElement('path', {
47
- d: 'm3.5 8.25 2.75 2.75L12.5 4.75',
48
- fill: 'none',
49
- stroke: 'currentColor',
50
- strokeLinecap: 'round',
51
- strokeLinejoin: 'round',
52
- strokeWidth: '1.5',
53
- }),
54
- ),
55
- chevronDown: symbol(
56
- createElement('path', {
57
- d: 'm3.75 6.25 4.25 4 4.25-4',
58
- fill: 'none',
59
- stroke: 'currentColor',
60
- strokeLinecap: 'round',
61
- strokeLinejoin: 'round',
62
- strokeWidth: '1.5',
63
- }),
64
- ),
65
- chevronVertical: symbol(
66
- createElement('path', {
67
- d: 'm3.75 6.5 4.25-4 4.25 4',
68
- fill: 'none',
69
- stroke: 'currentColor',
70
- strokeLinecap: 'round',
71
- strokeLinejoin: 'round',
72
- strokeWidth: '1.5',
73
- }),
74
- createElement('path', {
75
- d: 'm3.75 9.5 4.25 4 4.25-4',
76
- fill: 'none',
77
- stroke: 'currentColor',
78
- strokeLinecap: 'round',
79
- strokeLinejoin: 'round',
80
- strokeWidth: '1.5',
81
- }),
82
- ),
83
- chevronUp: symbol(
84
- createElement('path', {
85
- d: 'm3.75 9.75 4.25-4 4.25 4',
86
- fill: 'none',
87
- stroke: 'currentColor',
88
- strokeLinecap: 'round',
89
- strokeLinejoin: 'round',
90
- strokeWidth: '1.5',
91
- }),
92
- ),
93
- chevronRight: symbol(
94
- createElement('path', {
95
- d: 'm6 4 4 4-4 4',
96
- fill: 'none',
97
- stroke: 'currentColor',
98
- strokeLinecap: 'round',
99
- strokeLinejoin: 'round',
100
- strokeWidth: '1.5',
101
- }),
102
- ),
103
- close: symbol(
104
- createElement('path', {
105
- d: 'm4.5 4.5 7 7m0-7-7 7',
106
- fill: 'none',
107
- stroke: 'currentColor',
108
- strokeLinecap: 'round',
109
- strokeWidth: '1.5',
110
- }),
111
- ),
112
- copy: symbol(
113
- createElement('rect', {
114
- x: '5.25',
115
- y: '3.25',
116
- width: '7.5',
117
- height: '7.5',
118
- rx: '1.5',
119
- fill: 'none',
120
- stroke: 'currentColor',
121
- strokeWidth: '1.5',
122
- }),
123
- createElement('path', {
124
- d: 'M10.75 12.75h-5.5a2 2 0 0 1-2-2v-5.5',
125
- fill: 'none',
126
- stroke: 'currentColor',
127
- strokeLinecap: 'round',
128
- strokeLinejoin: 'round',
129
- strokeWidth: '1.5',
130
- }),
131
- ),
132
- edit: symbol(
133
- createElement('path', {
134
- d: 'm10.75 3.75 1.5 1.5',
135
- fill: 'none',
136
- stroke: 'currentColor',
137
- strokeLinecap: 'round',
138
- strokeLinejoin: 'round',
139
- strokeWidth: '1.5',
140
- }),
141
- createElement('path', {
142
- d: 'm4 12 2.5-.5 5.75-5.75a1.06 1.06 0 0 0 0-1.5l-.5-.5a1.06 1.06 0 0 0-1.5 0L4.5 9.5 4 12Z',
143
- fill: 'none',
144
- stroke: 'currentColor',
145
- strokeLinejoin: 'round',
146
- strokeWidth: '1.5',
147
- }),
148
- ),
149
- expand: symbol(
150
- createElement('path', {
151
- d: 'M9.25 3.5h3.25v3.25',
152
- fill: 'none',
153
- stroke: 'currentColor',
154
- strokeLinecap: 'round',
155
- strokeLinejoin: 'round',
156
- strokeWidth: '1.5',
157
- }),
158
- createElement('path', {
159
- d: 'm12.5 3.5-5.5 5.5',
160
- fill: 'none',
161
- stroke: 'currentColor',
162
- strokeLinecap: 'round',
163
- strokeLinejoin: 'round',
164
- strokeWidth: '1.5',
165
- }),
166
- createElement('path', {
167
- d: 'M6.75 12.5H3.5V9.25',
168
- fill: 'none',
169
- stroke: 'currentColor',
170
- strokeLinecap: 'round',
171
- strokeLinejoin: 'round',
172
- strokeWidth: '1.5',
173
- }),
174
- createElement('path', {
175
- d: 'm3.5 12.5 5.5-5.5',
176
- fill: 'none',
177
- stroke: 'currentColor',
178
- strokeLinecap: 'round',
179
- strokeLinejoin: 'round',
180
- strokeWidth: '1.5',
181
- }),
182
- ),
183
- info: symbol(
184
- createElement('circle', {
185
- cx: '8',
186
- cy: '8',
187
- fill: 'none',
188
- r: '5.75',
189
- stroke: 'currentColor',
190
- strokeWidth: '1.5',
191
- }),
192
- createElement('path', {
193
- d: 'M8 7.25v3',
194
- fill: 'none',
195
- stroke: 'currentColor',
196
- strokeLinecap: 'round',
197
- strokeWidth: '1.5',
198
- }),
199
- createElement('circle', {
200
- cx: '8',
201
- cy: '5',
202
- fill: 'currentColor',
203
- r: '0.75',
204
- }),
205
- ),
206
- menu: symbol(
207
- createElement('path', {
208
- d: 'M3 4.75h10M3 8h10M3 11.25h10',
209
- fill: 'none',
210
- stroke: 'currentColor',
211
- strokeLinecap: 'round',
212
- strokeWidth: '1.5',
213
- }),
214
- ),
215
- open: symbol(
216
- createElement('path', {
217
- d: 'M6.25 4H4.5A1.5 1.5 0 0 0 3 5.5v6A1.5 1.5 0 0 0 4.5 13h6A1.5 1.5 0 0 0 12 11.5V9.75',
218
- fill: 'none',
219
- stroke: 'currentColor',
220
- strokeLinecap: 'round',
221
- strokeLinejoin: 'round',
222
- strokeWidth: '1.5',
223
- }),
224
- createElement('path', {
225
- d: 'M8 3h5v5',
226
- fill: 'none',
227
- stroke: 'currentColor',
228
- strokeLinecap: 'round',
229
- strokeLinejoin: 'round',
230
- strokeWidth: '1.5',
231
- }),
232
- createElement('path', {
233
- d: 'm13 3-6.25 6.25',
234
- fill: 'none',
235
- stroke: 'currentColor',
236
- strokeLinecap: 'round',
237
- strokeLinejoin: 'round',
238
- strokeWidth: '1.5',
239
- }),
240
- ),
241
- search: symbol(
242
- createElement('circle', {
243
- cx: '7',
244
- cy: '7',
245
- fill: 'none',
246
- r: '4.25',
247
- stroke: 'currentColor',
248
- strokeWidth: '1.5',
249
- }),
250
- createElement('path', {
251
- d: 'm10.25 10.25 3 3',
252
- fill: 'none',
253
- stroke: 'currentColor',
254
- strokeLinecap: 'round',
255
- strokeWidth: '1.5',
256
- }),
257
- ),
258
- spinner: symbol(
259
- createElement('circle', {
260
- cx: '8',
261
- cy: '8',
262
- fill: 'none',
263
- opacity: '0.24',
264
- r: '5.25',
265
- stroke: 'currentColor',
266
- strokeWidth: '1.5',
267
- }),
268
- createElement('path', {
269
- d: 'M8 2.75a5.25 5.25 0 0 1 5.25 5.25',
270
- fill: 'none',
271
- stroke: 'currentColor',
272
- strokeLinecap: 'round',
273
- strokeWidth: '1.5',
274
- }),
275
- ),
276
- trash: symbol(
277
- createElement('path', {
278
- d: 'M3.75 4.75h8.5',
279
- fill: 'none',
280
- stroke: 'currentColor',
281
- strokeLinecap: 'round',
282
- strokeWidth: '1.5',
283
- }),
284
- createElement('path', {
285
- d: 'M6.25 4.75V4a1 1 0 0 1 1-1h1.5a1 1 0 0 1 1 1v.75',
286
- fill: 'none',
287
- stroke: 'currentColor',
288
- strokeLinecap: 'round',
289
- strokeLinejoin: 'round',
290
- strokeWidth: '1.5',
291
- }),
292
- createElement('path', {
293
- d: 'm5 6.25.45 5.1A1.5 1.5 0 0 0 6.94 12.75h2.12a1.5 1.5 0 0 0 1.49-1.4L11 6.25',
294
- fill: 'none',
295
- stroke: 'currentColor',
296
- strokeLinecap: 'round',
297
- strokeLinejoin: 'round',
298
- strokeWidth: '1.5',
299
- }),
300
- createElement('path', {
301
- d: 'M7 7.25v3.5M9 7.25v3.5',
302
- fill: 'none',
303
- stroke: 'currentColor',
304
- strokeLinecap: 'round',
305
- strokeWidth: '1.5',
306
- }),
307
- ),
308
- }
@@ -1,123 +0,0 @@
1
- import { createGlyphSheet } from '../../../components/glyph/glyph.tsx'
2
- import { createTheme } from '../../runtime.ts'
3
- import type { GlyphSheetComponent } from '../../../components/glyph/glyph.tsx'
4
- import type { ThemeComponent } from '../../contract.ts'
5
-
6
- import { glyphValues } from './glyphs.tsx'
7
-
8
- export const RMX_01: ThemeComponent = createTheme({
9
- space: {
10
- none: '0px',
11
- px: '1px',
12
- xs: '4px',
13
- sm: '8px',
14
- md: '12px',
15
- lg: '16px',
16
- xl: '24px',
17
- xxl: '32px',
18
- },
19
- radius: {
20
- none: '0px',
21
- sm: '4px',
22
- md: '8px',
23
- lg: '12px',
24
- xl: '16px',
25
- full: '9999px',
26
- },
27
- fontSize: {
28
- xxxs: '10px',
29
- xxs: '11px',
30
- xs: '12px',
31
- sm: '13px',
32
- md: '14px',
33
- lg: '16px',
34
- xl: '20px',
35
- xxl: '28px',
36
- },
37
- fontFamily: {
38
- sans: '"Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
39
- mono: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
40
- },
41
- lineHeight: {
42
- tight: '1.25',
43
- normal: '1.45',
44
- relaxed: '1.65',
45
- },
46
- letterSpacing: {
47
- tight: '-0.03em',
48
- normal: '0',
49
- meta: '0.06em',
50
- wide: '0.08em',
51
- },
52
- fontWeight: {
53
- normal: '400',
54
- medium: '500',
55
- semibold: '600',
56
- bold: '700',
57
- },
58
- control: {
59
- height: {
60
- sm: '28px',
61
- md: '32px',
62
- lg: '36px',
63
- },
64
- },
65
- surface: {
66
- lvl0: '#ffffff',
67
- lvl1: '#f8f8f8',
68
- lvl2: '#f5f5f5',
69
- lvl3: '#f3f3f3',
70
- lvl4: '#efefef',
71
- },
72
- shadow: {
73
- xs: '0 1px 1px rgb(0 0 0 / 0.05)',
74
- sm: '0 1px 2px rgb(0 0 0 / 0.07)',
75
- md: '0 6px 18px rgb(0 0 0 / 0.08)',
76
- lg: '0 16px 34px rgb(0 0 0 / 0.10)',
77
- xl: '0 24px 52px rgb(0 0 0 / 0.14)',
78
- },
79
- colors: {
80
- text: {
81
- primary: '#151515',
82
- secondary: '#4f4f4f',
83
- muted: '#6d6d6d',
84
- link: '#1A72FF',
85
- },
86
- border: {
87
- subtle: '#e7e7e7',
88
- default: '#d1d1d1',
89
- strong: '#b0b0b0',
90
- },
91
- focus: {
92
- ring: '#1A72FF',
93
- },
94
- overlay: {
95
- scrim: 'rgb(0 0 0 / 0.28)',
96
- },
97
- action: {
98
- primary: {
99
- background: '#1A72FF',
100
- backgroundHover: '#1463e0',
101
- backgroundActive: '#0f55c9',
102
- foreground: 'rgb(255 255 255 / 0.92)',
103
- border: '#1A72FF',
104
- },
105
- secondary: {
106
- background: '#ffffff',
107
- backgroundHover: '#fbfbfb',
108
- backgroundActive: '#f3f3f3',
109
- foreground: '#202020',
110
- border: '#d1d1d1',
111
- },
112
- danger: {
113
- background: '#FF3000',
114
- backgroundHover: '#e12b00',
115
- backgroundActive: '#c52600',
116
- foreground: 'rgb(255 255 255 / 0.92)',
117
- border: '#FF3000',
118
- },
119
- },
120
- },
121
- })
122
-
123
- export const RMX_01_GLYPHS: GlyphSheetComponent = createGlyphSheet(glyphValues)
@@ -1,119 +0,0 @@
1
- import { createElement, type Handle } from '@remix-run/ui'
2
-
3
- import { REMIX_UI_RESET_LAYER, REMIX_UI_STYLE_LAYER } from '../style/layers.ts'
4
- import {
5
- theme,
6
- themeVariableNames,
7
- type CreateThemeOptions,
8
- type ThemeComponent,
9
- type ThemeStyleProps,
10
- type ThemeValues,
11
- type ThemeVariableTree,
12
- type ThemeVars,
13
- } from './contract.ts'
14
-
15
- export function createTheme(values: ThemeValues, options: CreateThemeOptions = {}): ThemeComponent {
16
- let selector = options.selector ?? ':root'
17
- let reset = options.reset ?? true
18
- let vars = Object.freeze(collectThemeVars(themeVariableNames, values))
19
- let cssText = serializeThemeCss(selector, vars, { reset })
20
-
21
- function Theme(handle: Handle<ThemeStyleProps>) {
22
- return () =>
23
- createElement('style', {
24
- nonce: handle.props.nonce,
25
- 'data-rmx-theme': '',
26
- 'data-rmx-theme-selector': selector,
27
- innerHTML: escapeStyleText(cssText),
28
- })
29
- }
30
-
31
- return Object.assign(Theme, {
32
- Style: Theme,
33
- cssText,
34
- selector,
35
- values,
36
- vars,
37
- })
38
- }
39
-
40
- function collectThemeVars(
41
- tree: ThemeVariableTree,
42
- values: ThemeValues,
43
- path: string[] = [],
44
- ): Record<string, string> {
45
- let vars: Record<string, string> = {}
46
-
47
- for (let [key, value] of Object.entries(tree)) {
48
- let nextPath = [...path, key]
49
- let themeValue = (values as Record<string, unknown>)[key]
50
-
51
- if (typeof value === 'string') {
52
- if (typeof themeValue !== 'string' && typeof themeValue !== 'number') {
53
- throw new TypeError(
54
- `Expected theme value at "${nextPath.join('.')}" to be a string or number`,
55
- )
56
- }
57
-
58
- vars[value] = String(themeValue)
59
- continue
60
- }
61
-
62
- if (!isPlainObject(themeValue)) {
63
- throw new TypeError(`Expected theme group at "${nextPath.join('.')}" to be an object`)
64
- }
65
-
66
- Object.assign(vars, collectThemeVars(value, themeValue as ThemeValues, nextPath))
67
- }
68
-
69
- return vars
70
- }
71
-
72
- function serializeThemeCss(selector: string, vars: ThemeVars, options: { reset: boolean }): string {
73
- let lines = Object.entries(vars)
74
- .map(([name, value]) => ` ${name}: ${value};`)
75
- .join('\n')
76
-
77
- let blocks = [`${selector} {\n${lines}\n}`]
78
-
79
- if (options.reset) {
80
- let resetCss = serializeThemeResetCss(selector)
81
- blocks.push(`@layer ${REMIX_UI_RESET_LAYER}, ${REMIX_UI_STYLE_LAYER};`)
82
- blocks.push(`@layer ${REMIX_UI_RESET_LAYER} { ${resetCss} }`)
83
- }
84
-
85
- return blocks.join('\n\n')
86
- }
87
-
88
- function serializeThemeResetCss(selector: string): string {
89
- let fontFamily = theme.fontFamily.sans
90
- let fontSize = theme.fontSize.md
91
- let lineHeight = theme.lineHeight.normal
92
- let textColor = theme.colors.text.primary
93
- let backgroundColor = theme.surface.lvl0
94
-
95
- if (selector === ':root') {
96
- return [
97
- `*, *::before, *::after {\n box-sizing: border-box;\n}`,
98
- `html, body {\n margin: 0;\n}`,
99
- `body {\n font-family: ${fontFamily};\n font-size: ${fontSize};\n line-height: ${lineHeight};\n color: ${textColor};\n background-color: ${backgroundColor};\n}`,
100
- `:where(h1, h2, h3, h4, h5, h6, p, ul, ol, dl, figure, blockquote) {\n margin: 0;\n}`,
101
- `:where(img, svg) {\n display: block;\n}`,
102
- ].join('\n\n')
103
- }
104
-
105
- return [
106
- `${selector}, ${selector} *, ${selector} *::before, ${selector} *::after {\n box-sizing: border-box;\n}`,
107
- `${selector} {\n font-family: ${fontFamily};\n font-size: ${fontSize};\n line-height: ${lineHeight};\n color: ${textColor};\n background-color: ${backgroundColor};\n}`,
108
- `${selector} :where(h1, h2, h3, h4, h5, h6, p, ul, ol, dl, figure, blockquote) {\n margin: 0;\n}`,
109
- `${selector} :where(img, svg) {\n display: block;\n}`,
110
- ].join('\n\n')
111
- }
112
-
113
- function escapeStyleText(cssText: string): string {
114
- return cssText.replace(/<\/style/gi, '<\\/style')
115
- }
116
-
117
- function isPlainObject(value: unknown): value is Record<string, unknown> {
118
- return typeof value === 'object' && value !== null && !Array.isArray(value)
119
- }
@@ -1,15 +0,0 @@
1
- export { theme } from './contract.ts'
2
- export type {
3
- CreateThemeOptions,
4
- ThemeComponent,
5
- ThemeMix,
6
- ThemeStyleProps,
7
- ThemeUtility,
8
- ThemeValue,
9
- ThemeValues,
10
- ThemeVars,
11
- } from './contract.ts'
12
- export { glyphContract, glyphNames } from './glyph-contract.ts'
13
- export type { GlyphContract, GlyphName, GlyphSymbol, GlyphValues } from './glyph-contract.ts'
14
- export { createTheme } from './runtime.ts'
15
- export { RMX_01, RMX_01_GLYPHS } from './presets/rmx-01/index.ts'
@@ -1,33 +0,0 @@
1
- # scroll-lock
2
-
3
- `scroll-lock` locks document scrolling while a floating or modal surface is open. Use `lockScroll` directly for imperative flows or `lockScrollOnToggle` for popover-style elements that emit `beforetoggle`.
4
-
5
- ## Usage
6
-
7
- ```tsx
8
- import { lockScroll, lockScrollOnToggle } from 'remix/ui/scroll-lock'
9
-
10
- function DialogSurface() {
11
- return <div popover="auto" mix={lockScrollOnToggle()} />
12
- }
13
-
14
- function openModal() {
15
- let unlock = lockScroll()
16
-
17
- // Later, when the modal closes:
18
- unlock()
19
- }
20
- ```
21
-
22
- ## API
23
-
24
- - `lockScroll(document?)`: locks the target document and returns an idempotent unlock function.
25
- - `lockScrollOnToggle()`: mixin that locks on `beforetoggle` open, unlocks on close, and releases the lock when the host unmounts.
26
-
27
- ## Behavior Notes
28
-
29
- - The lock stores and restores the document element's inline `overflow` and `scrollbarGutter`.
30
- - Scroll position is restored when the last active lock is released.
31
- - Multiple locks are reference-counted, so the document stays locked until every unlock function has run.
32
- - When a scrollbar is present and computed `scrollbar-gutter` is `auto`, the document reserves a stable gutter while locked.
33
- - `lockScrollOnToggle` uses the host element's owner document.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes