@dxos/react-ui 0.1.12 → 0.1.14

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 (493) hide show
  1. package/README.md +83 -5
  2. package/dist/lib/browser/index.mjs +2092 -0
  3. package/dist/lib/browser/index.mjs.map +7 -0
  4. package/dist/lib/browser/meta.json +1 -0
  5. package/dist/plugin/node/esbuild-plugin.cjs +469 -0
  6. package/dist/plugin/node/esbuild-plugin.cjs.map +7 -0
  7. package/dist/plugin/node/meta.json +1 -0
  8. package/dist/plugin/node/plugin.cjs +460 -0
  9. package/dist/plugin/node/plugin.cjs.map +7 -0
  10. package/dist/{src → plugin/node}/theme.css +15 -19
  11. package/dist/plugin/node/theme.css.map +7 -0
  12. package/dist/{src → types/src}/components/Alert/Alert.d.ts +7 -2
  13. package/dist/types/src/components/Alert/Alert.d.ts.map +1 -0
  14. package/dist/{src → types/src}/components/Alert/Alert.stories.d.ts +1 -1
  15. package/dist/types/src/components/Alert/Alert.stories.d.ts.map +1 -0
  16. package/dist/{src → types/src}/components/Alert/index.d.ts +0 -0
  17. package/dist/types/src/components/Alert/index.d.ts.map +1 -0
  18. package/dist/types/src/components/AlertDialog/AlertDialog.d.ts +26 -0
  19. package/dist/types/src/components/AlertDialog/AlertDialog.d.ts.map +1 -0
  20. package/dist/{src → types/src}/components/AlertDialog/AlertDialog.stories.d.ts +1 -1
  21. package/dist/types/src/components/AlertDialog/AlertDialog.stories.d.ts.map +1 -0
  22. package/dist/{src → types/src}/components/AlertDialog/index.d.ts +0 -0
  23. package/dist/types/src/components/AlertDialog/index.d.ts.map +1 -0
  24. package/dist/types/src/components/Avatar/Avatar.d.ts +22 -0
  25. package/dist/types/src/components/Avatar/Avatar.d.ts.map +1 -0
  26. package/dist/types/src/components/Avatar/Avatar.stories.d.ts +12 -0
  27. package/dist/types/src/components/Avatar/Avatar.stories.d.ts.map +1 -0
  28. package/dist/{src → types/src}/components/Avatar/index.d.ts +0 -0
  29. package/dist/types/src/components/Avatar/index.d.ts.map +1 -0
  30. package/dist/types/src/components/Button/Button.d.ts +4 -0
  31. package/dist/types/src/components/Button/Button.d.ts.map +1 -0
  32. package/dist/types/src/components/Button/Button.stories.d.ts +13 -0
  33. package/dist/types/src/components/Button/Button.stories.d.ts.map +1 -0
  34. package/dist/{src → types/src}/components/Button/ButtonGroup.d.ts +0 -0
  35. package/dist/types/src/components/Button/ButtonGroup.d.ts.map +1 -0
  36. package/dist/{src → types/src}/components/Button/ButtonProps.d.ts +0 -2
  37. package/dist/types/src/components/Button/ButtonProps.d.ts.map +1 -0
  38. package/dist/{src → types/src}/components/Button/buttonStyles.d.ts +0 -0
  39. package/dist/types/src/components/Button/buttonStyles.d.ts.map +1 -0
  40. package/dist/{src → types/src}/components/Button/index.d.ts +0 -0
  41. package/dist/types/src/components/Button/index.d.ts.map +1 -0
  42. package/dist/{src → types/src}/components/CompoundButton/CompoundButton.d.ts +0 -0
  43. package/dist/types/src/components/CompoundButton/CompoundButton.d.ts.map +1 -0
  44. package/dist/{src → types/src}/components/CompoundButton/CompoundButton.stories.d.ts +0 -0
  45. package/dist/types/src/components/CompoundButton/CompoundButton.stories.d.ts.map +1 -0
  46. package/dist/{src → types/src}/components/CompoundButton/index.d.ts +0 -0
  47. package/dist/types/src/components/CompoundButton/index.d.ts.map +1 -0
  48. package/dist/types/src/components/Dialog/Dialog.d.ts +26 -0
  49. package/dist/types/src/components/Dialog/Dialog.d.ts.map +1 -0
  50. package/dist/{src → types/src}/components/Dialog/Dialog.stories.d.ts +1 -1
  51. package/dist/types/src/components/Dialog/Dialog.stories.d.ts.map +1 -0
  52. package/dist/{src → types/src}/components/Dialog/index.d.ts +0 -0
  53. package/dist/types/src/components/Dialog/index.d.ts.map +1 -0
  54. package/dist/{src → types/src}/components/Group/Group.d.ts +1 -1
  55. package/dist/types/src/components/Group/Group.d.ts.map +1 -0
  56. package/dist/{src → types/src}/components/Group/Group.stories.d.ts +1 -1
  57. package/dist/types/src/components/Group/Group.stories.d.ts.map +1 -0
  58. package/dist/{src → types/src}/components/Group/index.d.ts +0 -0
  59. package/dist/types/src/components/Group/index.d.ts.map +1 -0
  60. package/dist/{src → types/src}/components/Heading/Heading.d.ts +5 -8
  61. package/dist/types/src/components/Heading/Heading.d.ts.map +1 -0
  62. package/dist/{src → types/src}/components/Heading/Heading.stories.d.ts +5 -8
  63. package/dist/{src → types/src}/components/Heading/Heading.stories.d.ts.map +1 -1
  64. package/dist/{src → types/src}/components/Heading/index.d.ts +0 -0
  65. package/dist/types/src/components/Heading/index.d.ts.map +1 -0
  66. package/dist/{src → types/src}/components/Input/BarePinInput.d.ts +17 -16
  67. package/dist/types/src/components/Input/BarePinInput.d.ts.map +1 -0
  68. package/dist/types/src/components/Input/BareTextInput.d.ts +7 -0
  69. package/dist/types/src/components/Input/BareTextInput.d.ts.map +1 -0
  70. package/dist/types/src/components/Input/BareTextareaInput.d.ts +7 -0
  71. package/dist/types/src/components/Input/BareTextareaInput.d.ts.map +1 -0
  72. package/dist/types/src/components/Input/Input.d.ts +4 -0
  73. package/dist/types/src/components/Input/Input.d.ts.map +1 -0
  74. package/dist/{src → types/src}/components/Input/Input.stories.d.ts +1 -1
  75. package/dist/types/src/components/Input/Input.stories.d.ts.map +1 -0
  76. package/dist/types/src/components/Input/InputProps.d.ts +37 -0
  77. package/dist/types/src/components/Input/InputProps.d.ts.map +1 -0
  78. package/dist/{src → types/src}/components/Input/index.d.ts +0 -0
  79. package/dist/types/src/components/Input/index.d.ts.map +1 -0
  80. package/dist/types/src/components/Loading/Loading.d.ts +15 -0
  81. package/dist/types/src/components/Loading/Loading.d.ts.map +1 -0
  82. package/dist/{src → types/src}/components/Loading/Loading.stories.d.ts +1 -3
  83. package/dist/types/src/components/Loading/Loading.stories.d.ts.map +1 -0
  84. package/dist/{src → types/src}/components/Loading/index.d.ts +0 -0
  85. package/dist/types/src/components/Loading/index.d.ts.map +1 -0
  86. package/dist/{src → types/src}/components/NavMenu/NavMenu.d.ts +11 -3
  87. package/dist/types/src/components/NavMenu/NavMenu.d.ts.map +1 -0
  88. package/dist/{src → types/src}/components/NavMenu/NavMenu.stories.d.ts +1 -1
  89. package/dist/types/src/components/NavMenu/NavMenu.stories.d.ts.map +1 -0
  90. package/dist/{src → types/src}/components/NavMenu/index.d.ts +0 -0
  91. package/dist/types/src/components/NavMenu/index.d.ts.map +1 -0
  92. package/dist/types/src/components/Popover/Popover.d.ts +21 -0
  93. package/dist/types/src/components/Popover/Popover.d.ts.map +1 -0
  94. package/dist/{src → types/src}/components/Popover/Popover.stories.d.ts +1 -1
  95. package/dist/types/src/components/Popover/Popover.stories.d.ts.map +1 -0
  96. package/dist/{src → types/src}/components/Popover/index.d.ts +0 -0
  97. package/dist/types/src/components/Popover/index.d.ts.map +1 -0
  98. package/dist/types/src/components/QrCode/QrCode.d.ts +39 -0
  99. package/dist/types/src/components/QrCode/QrCode.d.ts.map +1 -0
  100. package/dist/{src → types/src}/components/QrCode/QrCode.stories.d.ts +1 -1
  101. package/dist/types/src/components/QrCode/QrCode.stories.d.ts.map +1 -0
  102. package/dist/{src → types/src}/components/QrCode/index.d.ts +0 -0
  103. package/dist/types/src/components/QrCode/index.d.ts.map +1 -0
  104. package/dist/types/src/components/Tag/Tag.d.ts +8 -0
  105. package/dist/types/src/components/Tag/Tag.d.ts.map +1 -0
  106. package/dist/{src → types/src}/components/Tag/Tag.stories.d.ts +1 -1
  107. package/dist/types/src/components/Tag/Tag.stories.d.ts.map +1 -0
  108. package/dist/{src → types/src}/components/Tag/index.d.ts +0 -0
  109. package/dist/types/src/components/Tag/index.d.ts.map +1 -0
  110. package/dist/{src → types/src}/components/Toast/Toast.d.ts +10 -1
  111. package/dist/types/src/components/Toast/Toast.d.ts.map +1 -0
  112. package/dist/{src → types/src}/components/Toast/Toast.stories.d.ts +1 -1
  113. package/dist/types/src/components/Toast/Toast.stories.d.ts.map +1 -0
  114. package/dist/{src → types/src}/components/Toast/index.d.ts +0 -0
  115. package/dist/types/src/components/Toast/index.d.ts.map +1 -0
  116. package/dist/types/src/components/Tooltip/Tooltip.d.ts +19 -0
  117. package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -0
  118. package/dist/{src → types/src}/components/Tooltip/Tooltip.stories.d.ts +1 -1
  119. package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts.map +1 -0
  120. package/dist/{src → types/src}/components/Tooltip/index.d.ts +0 -0
  121. package/dist/types/src/components/Tooltip/index.d.ts.map +1 -0
  122. package/dist/{src → types/src}/components/UiProvider/UiProvider.d.ts +1 -1
  123. package/dist/types/src/components/UiProvider/UiProvider.d.ts.map +1 -0
  124. package/dist/{src → types/src}/components/UiProvider/index.d.ts +0 -0
  125. package/dist/types/src/components/UiProvider/index.d.ts.map +1 -0
  126. package/dist/{src → types/src}/components/index.d.ts +0 -0
  127. package/dist/types/src/components/index.d.ts.map +1 -0
  128. package/dist/types/src/config/index.d.ts +2 -0
  129. package/dist/types/src/config/index.d.ts.map +1 -0
  130. package/dist/types/src/config/tailwind.d.ts +7 -0
  131. package/dist/types/src/config/tailwind.d.ts.map +1 -0
  132. package/dist/types/src/esbuild-plugin.d.ts +6 -0
  133. package/dist/types/src/esbuild-plugin.d.ts.map +1 -0
  134. package/dist/{src → types/src}/hooks/index.d.ts +0 -0
  135. package/dist/types/src/hooks/index.d.ts.map +1 -0
  136. package/dist/{src → types/src}/hooks/useForwardedRef.d.ts +0 -0
  137. package/dist/types/src/hooks/useForwardedRef.d.ts.map +1 -0
  138. package/dist/{src → types/src}/hooks/useId.d.ts +0 -0
  139. package/dist/types/src/hooks/useId.d.ts.map +1 -0
  140. package/dist/{src → types/src}/hooks/useIsFocused.d.ts +0 -0
  141. package/dist/types/src/hooks/useIsFocused.d.ts.map +1 -0
  142. package/dist/{src → types/src}/index.d.ts +3 -2
  143. package/dist/types/src/index.d.ts.map +1 -0
  144. package/dist/{src → types/src}/plugin.d.ts +1 -1
  145. package/dist/types/src/plugin.d.ts.map +1 -0
  146. package/dist/types/src/props/Elevation.d.ts +2 -0
  147. package/dist/types/src/props/Elevation.d.ts.map +1 -0
  148. package/dist/types/src/props/MessageValence.d.ts +2 -0
  149. package/dist/types/src/props/MessageValence.d.ts.map +1 -0
  150. package/dist/types/src/props/Size.d.ts +2 -0
  151. package/dist/types/src/props/Size.d.ts.map +1 -0
  152. package/dist/{src → types/src}/props/index.d.ts +0 -0
  153. package/dist/types/src/props/index.d.ts.map +1 -0
  154. package/dist/{src → types/src}/styles/active.d.ts +0 -0
  155. package/dist/types/src/styles/active.d.ts.map +1 -0
  156. package/dist/{src → types/src}/styles/disabled.d.ts +0 -0
  157. package/dist/types/src/styles/disabled.d.ts.map +1 -0
  158. package/dist/{src → types/src}/styles/focus.d.ts +0 -0
  159. package/dist/types/src/styles/focus.d.ts.map +1 -0
  160. package/dist/{src → types/src}/styles/group.d.ts +0 -0
  161. package/dist/types/src/styles/group.d.ts.map +1 -0
  162. package/dist/{src → types/src}/styles/hover.d.ts +0 -0
  163. package/dist/types/src/styles/hover.d.ts.map +1 -0
  164. package/dist/{src → types/src}/styles/index.d.ts +0 -0
  165. package/dist/types/src/styles/index.d.ts.map +1 -0
  166. package/dist/types/src/styles/input.d.ts +11 -0
  167. package/dist/types/src/styles/input.d.ts.map +1 -0
  168. package/dist/{src → types/src}/styles/ornament.d.ts +0 -0
  169. package/dist/types/src/styles/ornament.d.ts.map +1 -0
  170. package/dist/{src → types/src}/styles/shimmer.d.ts +0 -0
  171. package/dist/types/src/styles/shimmer.d.ts.map +1 -0
  172. package/dist/{src → types/src}/styles/size.d.ts +1 -1
  173. package/dist/types/src/styles/size.d.ts.map +1 -0
  174. package/dist/{src → types/src}/styles/text.d.ts +0 -0
  175. package/dist/types/src/styles/text.d.ts.map +1 -0
  176. package/dist/{src → types/src}/styles/valence.d.ts +0 -0
  177. package/dist/types/src/styles/valence.d.ts.map +1 -0
  178. package/dist/{src → types/src}/testing/index.d.ts +0 -0
  179. package/dist/types/src/testing/index.d.ts.map +1 -0
  180. package/dist/{src → types/src}/testing/templateForComponent.d.ts +0 -0
  181. package/dist/types/src/testing/templateForComponent.d.ts.map +1 -0
  182. package/dist/types/src/util/index.d.ts +2 -0
  183. package/dist/types/src/util/index.d.ts.map +1 -0
  184. package/dist/types/src/util/mx.d.ts +2 -0
  185. package/dist/types/src/util/mx.d.ts.map +1 -0
  186. package/dist/types/src/util/withLogical.d.ts +3 -0
  187. package/dist/types/src/util/withLogical.d.ts.map +1 -0
  188. package/package.json +9 -5
  189. package/plugin.d.ts +1 -1
  190. package/plugin.js +1 -1
  191. package/src/components/Alert/Alert.tsx +12 -6
  192. package/src/components/AlertDialog/AlertDialog.tsx +31 -11
  193. package/src/components/Avatar/Avatar.tsx +35 -13
  194. package/src/components/Button/Button.tsx +11 -13
  195. package/src/components/Button/ButtonGroup.tsx +3 -2
  196. package/src/components/Button/ButtonProps.ts +0 -2
  197. package/src/components/Button/buttonStyles.ts +4 -7
  198. package/src/components/CompoundButton/CompoundButton.tsx +3 -3
  199. package/src/components/Dialog/Dialog.tsx +47 -14
  200. package/src/components/Group/Group.tsx +10 -5
  201. package/src/components/Heading/Heading.tsx +5 -4
  202. package/src/components/Input/BarePinInput.tsx +18 -13
  203. package/src/components/Input/BareTextInput.tsx +18 -15
  204. package/src/components/Input/BareTextareaInput.tsx +17 -16
  205. package/src/components/Input/Input.tsx +17 -23
  206. package/src/components/Input/InputProps.ts +23 -11
  207. package/src/components/Loading/Loading.tsx +18 -8
  208. package/src/components/NavMenu/NavMenu.stories.tsx +1 -1
  209. package/src/components/NavMenu/NavMenu.tsx +42 -19
  210. package/src/components/Popover/Popover.stories.tsx +7 -3
  211. package/src/components/Popover/Popover.tsx +54 -20
  212. package/src/components/QrCode/QrCode.tsx +61 -49
  213. package/src/components/Tag/Tag.tsx +6 -6
  214. package/src/components/Toast/Toast.tsx +48 -26
  215. package/src/components/Tooltip/Tooltip.tsx +32 -13
  216. package/src/components/UiProvider/UiProvider.tsx +3 -3
  217. package/src/config/index.ts +5 -0
  218. package/src/config/tailwind.ts +250 -0
  219. package/src/esbuild-plugin.ts +42 -0
  220. package/src/index.ts +3 -2
  221. package/src/plugin.ts +5 -240
  222. package/src/styles/active.ts +2 -2
  223. package/src/styles/group.ts +2 -3
  224. package/src/styles/input.ts +7 -26
  225. package/src/styles/size.ts +3 -4
  226. package/src/typings.d.ts +0 -1
  227. package/src/util/index.ts +5 -0
  228. package/src/util/mx.ts +28 -0
  229. package/src/util/withLogical.ts +103 -0
  230. package/dist/src/components/Alert/Alert.d.ts.map +0 -1
  231. package/dist/src/components/Alert/Alert.js +0 -21
  232. package/dist/src/components/Alert/Alert.js.map +0 -1
  233. package/dist/src/components/Alert/Alert.stories.d.ts.map +0 -1
  234. package/dist/src/components/Alert/Alert.stories.js +0 -30
  235. package/dist/src/components/Alert/Alert.stories.js.map +0 -1
  236. package/dist/src/components/Alert/index.d.ts.map +0 -1
  237. package/dist/src/components/Alert/index.js +0 -21
  238. package/dist/src/components/Alert/index.js.map +0 -1
  239. package/dist/src/components/AlertDialog/AlertDialog.d.ts +0 -17
  240. package/dist/src/components/AlertDialog/AlertDialog.d.ts.map +0 -1
  241. package/dist/src/components/AlertDialog/AlertDialog.js +0 -65
  242. package/dist/src/components/AlertDialog/AlertDialog.js.map +0 -1
  243. package/dist/src/components/AlertDialog/AlertDialog.stories.d.ts.map +0 -1
  244. package/dist/src/components/AlertDialog/AlertDialog.stories.js +0 -37
  245. package/dist/src/components/AlertDialog/AlertDialog.stories.js.map +0 -1
  246. package/dist/src/components/AlertDialog/index.d.ts.map +0 -1
  247. package/dist/src/components/AlertDialog/index.js +0 -21
  248. package/dist/src/components/AlertDialog/index.js.map +0 -1
  249. package/dist/src/components/Avatar/Avatar.d.ts +0 -13
  250. package/dist/src/components/Avatar/Avatar.d.ts.map +0 -1
  251. package/dist/src/components/Avatar/Avatar.js +0 -53
  252. package/dist/src/components/Avatar/Avatar.js.map +0 -1
  253. package/dist/src/components/Avatar/Avatar.stories.d.ts +0 -10
  254. package/dist/src/components/Avatar/Avatar.stories.d.ts.map +0 -1
  255. package/dist/src/components/Avatar/Avatar.stories.js +0 -30
  256. package/dist/src/components/Avatar/Avatar.stories.js.map +0 -1
  257. package/dist/src/components/Avatar/index.d.ts.map +0 -1
  258. package/dist/src/components/Avatar/index.js +0 -21
  259. package/dist/src/components/Avatar/index.js.map +0 -1
  260. package/dist/src/components/Button/Button.d.ts +0 -4
  261. package/dist/src/components/Button/Button.d.ts.map +0 -1
  262. package/dist/src/components/Button/Button.js +0 -37
  263. package/dist/src/components/Button/Button.js.map +0 -1
  264. package/dist/src/components/Button/Button.stories.d.ts +0 -13
  265. package/dist/src/components/Button/Button.stories.d.ts.map +0 -1
  266. package/dist/src/components/Button/Button.stories.js +0 -33
  267. package/dist/src/components/Button/Button.stories.js.map +0 -1
  268. package/dist/src/components/Button/ButtonGroup.d.ts.map +0 -1
  269. package/dist/src/components/Button/ButtonGroup.js +0 -16
  270. package/dist/src/components/Button/ButtonGroup.js.map +0 -1
  271. package/dist/src/components/Button/ButtonProps.d.ts.map +0 -1
  272. package/dist/src/components/Button/ButtonProps.js +0 -6
  273. package/dist/src/components/Button/ButtonProps.js.map +0 -1
  274. package/dist/src/components/Button/buttonStyles.d.ts.map +0 -1
  275. package/dist/src/components/Button/buttonStyles.js +0 -26
  276. package/dist/src/components/Button/buttonStyles.js.map +0 -1
  277. package/dist/src/components/Button/index.d.ts.map +0 -1
  278. package/dist/src/components/Button/index.js +0 -24
  279. package/dist/src/components/Button/index.js.map +0 -1
  280. package/dist/src/components/CompoundButton/CompoundButton.d.ts.map +0 -1
  281. package/dist/src/components/CompoundButton/CompoundButton.js +0 -27
  282. package/dist/src/components/CompoundButton/CompoundButton.js.map +0 -1
  283. package/dist/src/components/CompoundButton/CompoundButton.stories.d.ts.map +0 -1
  284. package/dist/src/components/CompoundButton/CompoundButton.stories.js +0 -40
  285. package/dist/src/components/CompoundButton/CompoundButton.stories.js.map +0 -1
  286. package/dist/src/components/CompoundButton/index.d.ts.map +0 -1
  287. package/dist/src/components/CompoundButton/index.js +0 -21
  288. package/dist/src/components/CompoundButton/index.js.map +0 -1
  289. package/dist/src/components/Dialog/Dialog.d.ts +0 -14
  290. package/dist/src/components/Dialog/Dialog.d.ts.map +0 -1
  291. package/dist/src/components/Dialog/Dialog.js +0 -59
  292. package/dist/src/components/Dialog/Dialog.js.map +0 -1
  293. package/dist/src/components/Dialog/Dialog.stories.d.ts.map +0 -1
  294. package/dist/src/components/Dialog/Dialog.stories.js +0 -37
  295. package/dist/src/components/Dialog/Dialog.stories.js.map +0 -1
  296. package/dist/src/components/Dialog/index.d.ts.map +0 -1
  297. package/dist/src/components/Dialog/index.js +0 -21
  298. package/dist/src/components/Dialog/index.js.map +0 -1
  299. package/dist/src/components/Group/Group.d.ts.map +0 -1
  300. package/dist/src/components/Group/Group.js +0 -22
  301. package/dist/src/components/Group/Group.js.map +0 -1
  302. package/dist/src/components/Group/Group.stories.d.ts.map +0 -1
  303. package/dist/src/components/Group/Group.stories.js +0 -27
  304. package/dist/src/components/Group/Group.stories.js.map +0 -1
  305. package/dist/src/components/Group/index.d.ts.map +0 -1
  306. package/dist/src/components/Group/index.js +0 -21
  307. package/dist/src/components/Group/index.js.map +0 -1
  308. package/dist/src/components/Heading/Heading.d.ts.map +0 -1
  309. package/dist/src/components/Heading/Heading.js +0 -28
  310. package/dist/src/components/Heading/Heading.js.map +0 -1
  311. package/dist/src/components/Heading/Heading.stories.js +0 -34
  312. package/dist/src/components/Heading/Heading.stories.js.map +0 -1
  313. package/dist/src/components/Heading/index.d.ts.map +0 -1
  314. package/dist/src/components/Heading/index.js +0 -21
  315. package/dist/src/components/Heading/index.js.map +0 -1
  316. package/dist/src/components/Input/BarePinInput.d.ts.map +0 -1
  317. package/dist/src/components/Input/BarePinInput.js +0 -62
  318. package/dist/src/components/Input/BarePinInput.js.map +0 -1
  319. package/dist/src/components/Input/BareTextInput.d.ts +0 -5
  320. package/dist/src/components/Input/BareTextInput.d.ts.map +0 -1
  321. package/dist/src/components/Input/BareTextInput.js +0 -29
  322. package/dist/src/components/Input/BareTextInput.js.map +0 -1
  323. package/dist/src/components/Input/BareTextareaInput.d.ts +0 -5
  324. package/dist/src/components/Input/BareTextareaInput.d.ts.map +0 -1
  325. package/dist/src/components/Input/BareTextareaInput.js +0 -23
  326. package/dist/src/components/Input/BareTextareaInput.js.map +0 -1
  327. package/dist/src/components/Input/Input.d.ts +0 -4
  328. package/dist/src/components/Input/Input.d.ts.map +0 -1
  329. package/dist/src/components/Input/Input.js +0 -87
  330. package/dist/src/components/Input/Input.js.map +0 -1
  331. package/dist/src/components/Input/Input.stories.d.ts.map +0 -1
  332. package/dist/src/components/Input/Input.stories.js +0 -86
  333. package/dist/src/components/Input/Input.stories.js.map +0 -1
  334. package/dist/src/components/Input/InputProps.d.ts +0 -26
  335. package/dist/src/components/Input/InputProps.d.ts.map +0 -1
  336. package/dist/src/components/Input/InputProps.js +0 -6
  337. package/dist/src/components/Input/InputProps.js.map +0 -1
  338. package/dist/src/components/Input/index.d.ts.map +0 -1
  339. package/dist/src/components/Input/index.js +0 -21
  340. package/dist/src/components/Input/index.js.map +0 -1
  341. package/dist/src/components/Loading/Loading.d.ts +0 -12
  342. package/dist/src/components/Loading/Loading.d.ts.map +0 -1
  343. package/dist/src/components/Loading/Loading.js +0 -29
  344. package/dist/src/components/Loading/Loading.js.map +0 -1
  345. package/dist/src/components/Loading/Loading.stories.d.ts.map +0 -1
  346. package/dist/src/components/Loading/Loading.stories.js +0 -39
  347. package/dist/src/components/Loading/Loading.stories.js.map +0 -1
  348. package/dist/src/components/Loading/index.d.ts.map +0 -1
  349. package/dist/src/components/Loading/index.js +0 -21
  350. package/dist/src/components/Loading/index.js.map +0 -1
  351. package/dist/src/components/NavMenu/NavMenu.d.ts.map +0 -1
  352. package/dist/src/components/NavMenu/NavMenu.js +0 -71
  353. package/dist/src/components/NavMenu/NavMenu.js.map +0 -1
  354. package/dist/src/components/NavMenu/NavMenu.stories.d.ts.map +0 -1
  355. package/dist/src/components/NavMenu/NavMenu.stories.js +0 -50
  356. package/dist/src/components/NavMenu/NavMenu.stories.js.map +0 -1
  357. package/dist/src/components/NavMenu/index.d.ts.map +0 -1
  358. package/dist/src/components/NavMenu/index.js +0 -21
  359. package/dist/src/components/NavMenu/index.js.map +0 -1
  360. package/dist/src/components/Popover/Popover.d.ts +0 -11
  361. package/dist/src/components/Popover/Popover.d.ts.map +0 -1
  362. package/dist/src/components/Popover/Popover.js +0 -56
  363. package/dist/src/components/Popover/Popover.js.map +0 -1
  364. package/dist/src/components/Popover/Popover.stories.d.ts.map +0 -1
  365. package/dist/src/components/Popover/Popover.stories.js +0 -39
  366. package/dist/src/components/Popover/Popover.stories.js.map +0 -1
  367. package/dist/src/components/Popover/index.d.ts.map +0 -1
  368. package/dist/src/components/Popover/index.js +0 -21
  369. package/dist/src/components/Popover/index.js.map +0 -1
  370. package/dist/src/components/QrCode/QrCode.d.ts +0 -22
  371. package/dist/src/components/QrCode/QrCode.d.ts.map +0 -1
  372. package/dist/src/components/QrCode/QrCode.js +0 -79
  373. package/dist/src/components/QrCode/QrCode.js.map +0 -1
  374. package/dist/src/components/QrCode/QrCode.stories.d.ts.map +0 -1
  375. package/dist/src/components/QrCode/QrCode.stories.js +0 -42
  376. package/dist/src/components/QrCode/QrCode.stories.js.map +0 -1
  377. package/dist/src/components/QrCode/index.d.ts.map +0 -1
  378. package/dist/src/components/QrCode/index.js +0 -21
  379. package/dist/src/components/QrCode/index.js.map +0 -1
  380. package/dist/src/components/Tag/Tag.d.ts +0 -8
  381. package/dist/src/components/Tag/Tag.d.ts.map +0 -1
  382. package/dist/src/components/Tag/Tag.js +0 -23
  383. package/dist/src/components/Tag/Tag.js.map +0 -1
  384. package/dist/src/components/Tag/Tag.stories.d.ts.map +0 -1
  385. package/dist/src/components/Tag/Tag.stories.js +0 -24
  386. package/dist/src/components/Tag/Tag.stories.js.map +0 -1
  387. package/dist/src/components/Tag/index.d.ts.map +0 -1
  388. package/dist/src/components/Tag/index.js +0 -21
  389. package/dist/src/components/Tag/index.js.map +0 -1
  390. package/dist/src/components/Toast/Toast.d.ts.map +0 -1
  391. package/dist/src/components/Toast/Toast.js +0 -54
  392. package/dist/src/components/Toast/Toast.js.map +0 -1
  393. package/dist/src/components/Toast/Toast.stories.d.ts.map +0 -1
  394. package/dist/src/components/Toast/Toast.stories.js +0 -32
  395. package/dist/src/components/Toast/Toast.stories.js.map +0 -1
  396. package/dist/src/components/Toast/index.d.ts.map +0 -1
  397. package/dist/src/components/Toast/index.js +0 -21
  398. package/dist/src/components/Toast/index.js.map +0 -1
  399. package/dist/src/components/Tooltip/Tooltip.d.ts +0 -12
  400. package/dist/src/components/Tooltip/Tooltip.d.ts.map +0 -1
  401. package/dist/src/components/Tooltip/Tooltip.js +0 -50
  402. package/dist/src/components/Tooltip/Tooltip.js.map +0 -1
  403. package/dist/src/components/Tooltip/Tooltip.stories.d.ts.map +0 -1
  404. package/dist/src/components/Tooltip/Tooltip.stories.js +0 -30
  405. package/dist/src/components/Tooltip/Tooltip.stories.js.map +0 -1
  406. package/dist/src/components/Tooltip/index.d.ts.map +0 -1
  407. package/dist/src/components/Tooltip/index.js +0 -21
  408. package/dist/src/components/Tooltip/index.js.map +0 -1
  409. package/dist/src/components/UiProvider/UiProvider.d.ts.map +0 -1
  410. package/dist/src/components/UiProvider/UiProvider.js +0 -21
  411. package/dist/src/components/UiProvider/UiProvider.js.map +0 -1
  412. package/dist/src/components/UiProvider/index.d.ts.map +0 -1
  413. package/dist/src/components/UiProvider/index.js +0 -21
  414. package/dist/src/components/UiProvider/index.js.map +0 -1
  415. package/dist/src/components/index.d.ts.map +0 -1
  416. package/dist/src/components/index.js +0 -37
  417. package/dist/src/components/index.js.map +0 -1
  418. package/dist/src/hooks/index.d.ts.map +0 -1
  419. package/dist/src/hooks/index.js +0 -23
  420. package/dist/src/hooks/index.js.map +0 -1
  421. package/dist/src/hooks/useForwardedRef.d.ts.map +0 -1
  422. package/dist/src/hooks/useForwardedRef.js +0 -24
  423. package/dist/src/hooks/useForwardedRef.js.map +0 -1
  424. package/dist/src/hooks/useId.d.ts.map +0 -1
  425. package/dist/src/hooks/useId.js +0 -20
  426. package/dist/src/hooks/useId.js.map +0 -1
  427. package/dist/src/hooks/useIsFocused.d.ts.map +0 -1
  428. package/dist/src/hooks/useIsFocused.js +0 -34
  429. package/dist/src/hooks/useIsFocused.js.map +0 -1
  430. package/dist/src/index.d.ts.map +0 -1
  431. package/dist/src/index.js +0 -24
  432. package/dist/src/index.js.map +0 -1
  433. package/dist/src/plugin.d.ts.map +0 -1
  434. package/dist/src/plugin.js +0 -276
  435. package/dist/src/plugin.js.map +0 -1
  436. package/dist/src/props/Elevation.d.ts +0 -2
  437. package/dist/src/props/Elevation.d.ts.map +0 -1
  438. package/dist/src/props/Elevation.js +0 -6
  439. package/dist/src/props/Elevation.js.map +0 -1
  440. package/dist/src/props/MessageValence.d.ts +0 -2
  441. package/dist/src/props/MessageValence.d.ts.map +0 -1
  442. package/dist/src/props/MessageValence.js +0 -6
  443. package/dist/src/props/MessageValence.js.map +0 -1
  444. package/dist/src/props/Size.d.ts +0 -2
  445. package/dist/src/props/Size.d.ts.map +0 -1
  446. package/dist/src/props/Size.js +0 -6
  447. package/dist/src/props/Size.js.map +0 -1
  448. package/dist/src/props/index.d.ts.map +0 -1
  449. package/dist/src/props/index.js +0 -23
  450. package/dist/src/props/index.js.map +0 -1
  451. package/dist/src/styles/active.d.ts.map +0 -1
  452. package/dist/src/styles/active.js +0 -12
  453. package/dist/src/styles/active.js.map +0 -1
  454. package/dist/src/styles/disabled.d.ts.map +0 -1
  455. package/dist/src/styles/disabled.js +0 -8
  456. package/dist/src/styles/disabled.js.map +0 -1
  457. package/dist/src/styles/focus.d.ts.map +0 -1
  458. package/dist/src/styles/focus.js +0 -9
  459. package/dist/src/styles/focus.js.map +0 -1
  460. package/dist/src/styles/group.d.ts.map +0 -1
  461. package/dist/src/styles/group.js +0 -26
  462. package/dist/src/styles/group.js.map +0 -1
  463. package/dist/src/styles/hover.d.ts.map +0 -1
  464. package/dist/src/styles/hover.js +0 -12
  465. package/dist/src/styles/hover.js.map +0 -1
  466. package/dist/src/styles/index.d.ts.map +0 -1
  467. package/dist/src/styles/index.js +0 -30
  468. package/dist/src/styles/index.js.map +0 -1
  469. package/dist/src/styles/input.d.ts +0 -17
  470. package/dist/src/styles/input.d.ts.map +0 -1
  471. package/dist/src/styles/input.js +0 -24
  472. package/dist/src/styles/input.js.map +0 -1
  473. package/dist/src/styles/ornament.d.ts.map +0 -1
  474. package/dist/src/styles/ornament.js +0 -9
  475. package/dist/src/styles/ornament.js.map +0 -1
  476. package/dist/src/styles/shimmer.d.ts.map +0 -1
  477. package/dist/src/styles/shimmer.js +0 -9
  478. package/dist/src/styles/shimmer.js.map +0 -1
  479. package/dist/src/styles/size.d.ts.map +0 -1
  480. package/dist/src/styles/size.js +0 -89
  481. package/dist/src/styles/size.js.map +0 -1
  482. package/dist/src/styles/text.d.ts.map +0 -1
  483. package/dist/src/styles/text.js +0 -11
  484. package/dist/src/styles/text.js.map +0 -1
  485. package/dist/src/styles/valence.d.ts.map +0 -1
  486. package/dist/src/styles/valence.js +0 -66
  487. package/dist/src/styles/valence.js.map +0 -1
  488. package/dist/src/testing/index.d.ts.map +0 -1
  489. package/dist/src/testing/index.js +0 -21
  490. package/dist/src/testing/index.js.map +0 -1
  491. package/dist/src/testing/templateForComponent.d.ts.map +0 -1
  492. package/dist/src/testing/templateForComponent.js +0 -18
  493. package/dist/src/testing/templateForComponent.js.map +0 -1
@@ -2,9 +2,10 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import cx from 'classnames';
6
5
  import React, { createElement, PropsWithChildren, ReactNode } from 'react';
7
6
 
7
+ import { mx } from '../../util';
8
+
8
9
  export interface HeadingProps extends React.ComponentProps<'h1'> {
9
10
  level?: 1 | 2 | 3 | 4 | 5 | 6;
10
11
  children?: ReactNode;
@@ -19,10 +20,10 @@ const levelClassNameMap = new Map<number, string>([
19
20
  [6, 'text-lg']
20
21
  ]);
21
22
 
22
- export const Heading = ({ level, ...props }: PropsWithChildren<HeadingProps>) => {
23
+ export const Heading = ({ level, ...rootSlot }: PropsWithChildren<HeadingProps>) => {
23
24
  const resolvedLevel = level || 1;
24
25
  return createElement(`h${resolvedLevel}`, {
25
- ...props,
26
- className: cx('font-bold font-display', levelClassNameMap.get(resolvedLevel), props.className)
26
+ ...rootSlot,
27
+ className: mx('font-bold font-display', levelClassNameMap.get(resolvedLevel), rootSlot.className)
27
28
  });
28
29
  };
@@ -2,13 +2,13 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import cx from 'classnames';
6
5
  import { CodeInput, getSegmentCssWidth } from 'rci';
7
6
  import React, { forwardRef, useCallback, ComponentProps } from 'react';
8
7
 
9
8
  import { useForwardedRef, useIsFocused } from '../../hooks';
10
9
  import { staticInput } from '../../styles/input';
11
- import { InputProps } from './InputProps';
10
+ import { mx } from '../../util';
11
+ import { InputProps, InputSlots } from './InputProps';
12
12
 
13
13
  const bareInputStyleProps = {
14
14
  padding: '8px',
@@ -16,12 +16,15 @@ const bareInputStyleProps = {
16
16
  fontFamily: ''
17
17
  };
18
18
 
19
- export type BarePinInputProps = Omit<InputProps, 'ref' | 'label' | 'onChange'> &
20
- Pick<ComponentProps<typeof CodeInput>, 'onChange' | 'value' | 'length'>;
19
+ export type BarePinInputProps = Omit<InputProps, 'ref' | 'label' | 'onChange' | 'slots'> &
20
+ Pick<ComponentProps<typeof CodeInput>, 'onChange' | 'value' | 'length'> & { inputSlot: InputSlots['input'] };
21
21
 
22
22
  // TODO(thure): supplying a `value` prop to CodeInput does not yield correct controlled input interactivity; this may be an issue with RCI (filed as https://github.com/leonardodino/rci/issues/25).
23
23
  export const BarePinInput = forwardRef<HTMLInputElement, BarePinInputProps>(
24
- ({ initialValue, size, validationMessage, validationValence, value, ...inputProps }, ref) => {
24
+ (
25
+ { initialValue, size, validationMessage, validationValence, value, onChange, placeholder, disabled, inputSlot },
26
+ ref
27
+ ) => {
25
28
  const width = getSegmentCssWidth('13px');
26
29
  const inputRef = useForwardedRef(ref);
27
30
  const inputFocused = useIsFocused(inputRef);
@@ -32,29 +35,31 @@ export const BarePinInput = forwardRef<HTMLInputElement, BarePinInputProps>(
32
35
  key={index}
33
36
  className={staticInput({
34
37
  focused: inputFocused && !!state,
35
- disabled: inputProps.disabled,
38
+ disabled,
36
39
  ...(validationMessage && { validationValence })
37
40
  })}
38
41
  data-state={state}
39
42
  style={{ width, height: '100%' }}
40
43
  />
41
44
  ),
42
- [inputFocused, validationValence, validationMessage, inputProps.disabled]
45
+ [inputFocused, validationValence, validationMessage, disabled]
43
46
  );
44
47
 
45
48
  return (
46
49
  <CodeInput
47
50
  {...{
48
51
  spellCheck: false,
49
- ...inputProps,
50
52
  ...bareInputStyleProps,
53
+ ...inputSlot,
54
+ placeholder,
55
+ onChange,
51
56
  inputRef,
52
- className: cx(
57
+ renderSegment,
58
+ className: mx(
53
59
  'font-mono selection:bg-transparent mli-auto',
54
- inputProps.disabled && 'cursor-not-allowed',
55
- inputProps.className
56
- ),
57
- renderSegment
60
+ disabled && 'cursor-not-allowed',
61
+ inputSlot?.className
62
+ )
58
63
  }}
59
64
  />
60
65
  );
@@ -2,11 +2,11 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import cx from 'classnames';
6
5
  import React, { ComponentProps } from 'react';
7
6
 
8
7
  import { defaultInput } from '../../styles/input';
9
- import { InputProps, InputSize } from './InputProps';
8
+ import { mx } from '../../util';
9
+ import { InputProps, InputSize, InputSlots } from './InputProps';
10
10
 
11
11
  const sizeMap: Record<InputSize, string> = {
12
12
  md: 'text-base',
@@ -15,30 +15,33 @@ const sizeMap: Record<InputSize, string> = {
15
15
  textarea: ''
16
16
  };
17
17
 
18
- export type BareTextInputProps = Omit<InputProps, 'label' | 'initialValue' | 'onChange'> &
19
- Pick<ComponentProps<'input'>, 'onChange'>;
18
+ export type BareTextInputProps = Omit<InputProps, 'label' | 'initialValue' | 'onChange' | 'slots'> &
19
+ Pick<ComponentProps<'input'>, 'onChange' | 'value'> & { inputSlot: InputSlots['input'] };
20
20
 
21
21
  export const BareTextInput = ({
22
22
  validationValence,
23
23
  validationMessage,
24
24
  size,
25
- borders,
26
- typography,
27
- rounding,
28
- ...inputProps
25
+ disabled,
26
+ placeholder,
27
+ onChange,
28
+ value,
29
+ inputSlot
29
30
  }: BareTextInputProps) => {
30
31
  return (
31
32
  <input
32
- {...inputProps}
33
- className={cx(
33
+ {...inputSlot}
34
+ placeholder={placeholder}
35
+ onChange={onChange}
36
+ value={value}
37
+ className={mx(
34
38
  defaultInput({
35
- borders,
36
- rounding,
37
- typography: typography ?? sizeMap[size ?? 'md'],
38
- disabled: inputProps.disabled,
39
+ disabled,
39
40
  ...(validationMessage && { validationValence })
40
41
  }),
41
- 'block w-full px-2.5 py-2'
42
+ sizeMap[size ?? 'md'],
43
+ 'block w-full px-2.5 py-2',
44
+ inputSlot?.className
42
45
  )}
43
46
  />
44
47
  );
@@ -2,36 +2,37 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import cx from 'classnames';
6
5
  import React, { ComponentProps } from 'react';
7
6
 
8
7
  import { defaultInput } from '../../styles/input';
9
- import { TextareaProps } from './InputProps';
8
+ import { mx } from '../../util';
9
+ import { TextareaProps, TextareaSlots } from './InputProps';
10
10
 
11
- export type BareTextareaInputProps = Omit<TextareaProps, 'label' | 'initialValue' | 'onChange'> &
12
- Pick<ComponentProps<'textarea'>, 'onChange'>;
11
+ export type BareTextareaInputProps = Omit<TextareaProps, 'label' | 'initialValue' | 'onChange' | 'slots'> &
12
+ Pick<ComponentProps<'textarea'>, 'onChange' | 'value'> & { inputSlot: TextareaSlots['input'] };
13
13
 
14
14
  export const BareTextareaInput = ({
15
15
  validationValence,
16
16
  validationMessage,
17
- size,
18
- borders,
19
- typography,
20
- rounding,
21
- ...inputProps
17
+ onChange,
18
+ value,
19
+ disabled,
20
+ placeholder,
21
+ inputSlot
22
22
  }: BareTextareaInputProps) => {
23
23
  return (
24
24
  <textarea
25
- {...inputProps}
26
- className={cx(
25
+ {...inputSlot}
26
+ placeholder={placeholder}
27
+ onChange={onChange}
28
+ value={value}
29
+ className={mx(
27
30
  defaultInput({
28
- borders,
29
- typography,
30
- rounding,
31
- disabled: inputProps.disabled,
31
+ disabled,
32
32
  ...(validationMessage && { validationValence })
33
33
  }),
34
- 'block w-full px-2.5 py-2'
34
+ 'block w-full px-2.5 py-2',
35
+ inputSlot?.className
35
36
  )}
36
37
  />
37
38
  );
@@ -2,11 +2,11 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import cx from 'classnames';
6
5
  import React, { ChangeEvent, useCallback, useState, useTransition } from 'react';
7
6
 
8
7
  import { useId } from '../../hooks';
9
8
  import { defaultDescription, valenceColorText } from '../../styles';
9
+ import { mx } from '../../util';
10
10
  import { BarePinInput } from './BarePinInput';
11
11
  import { BareTextInput } from './BareTextInput';
12
12
  import { BareTextareaInput, BareTextareaInputProps } from './BareTextareaInput';
@@ -17,25 +17,19 @@ export type InputProps = NaturalInputProps;
17
17
  export const Input = ({
18
18
  label,
19
19
  labelVisuallyHidden,
20
- placeholder,
21
20
  description,
22
21
  descriptionVisuallyHidden,
23
- required,
24
22
  initialValue,
25
23
  onChange,
26
24
  disabled,
27
- className,
25
+ placeholder,
28
26
  size,
29
27
  length = 6,
30
- spacing,
31
- borders,
32
- typography,
33
- rounding,
34
28
  validationMessage,
35
29
  validationValence,
36
- ...inputProps
30
+ slots = {}
37
31
  }: InputProps) => {
38
- const inputId = inputProps.id ?? useId('input');
32
+ const inputId = slots.input?.id ?? useId('input');
39
33
  const descriptionId = useId('input-description');
40
34
  const validationId = useId('input-validation');
41
35
 
@@ -58,23 +52,21 @@ export const Input = ({
58
52
  );
59
53
 
60
54
  const bareInputBaseProps = {
61
- ...inputProps,
55
+ ...slots.input,
62
56
  id: inputId,
63
- ...(required && { required: true }),
57
+ ...(slots.input?.required && { required: true }),
64
58
  ...(disabled && { disabled: true }),
65
59
  ...(description && { 'aria-describedby': descriptionId }),
66
60
  ...(isInvalid && {
67
61
  'aria-invalid': 'true' as const,
68
62
  'aria-errormessage': validationId
69
63
  }),
70
- ...(placeholder && { placeholder }),
64
+ placeholder,
71
65
  value: internalValue,
72
66
  onChange: onInternalChange,
67
+ inputSlot: slots.input,
73
68
  validationMessage,
74
- validationValence,
75
- borders,
76
- typography,
77
- rounding
69
+ validationValence
78
70
  };
79
71
 
80
72
  const bareInput =
@@ -87,12 +79,14 @@ export const Input = ({
87
79
  );
88
80
 
89
81
  return (
90
- <div role='none' className={cx(spacing ?? 'mlb-4', className)}>
82
+ <div role='none' className={mx('mlb-4', slots.root?.className)}>
91
83
  <label
84
+ {...slots.label}
92
85
  htmlFor={inputId}
93
- className={cx(
86
+ className={mx(
94
87
  'block pbe-1 text-sm font-medium text-neutral-900 dark:text-neutral-100',
95
- labelVisuallyHidden && 'sr-only'
88
+ labelVisuallyHidden && 'sr-only',
89
+ slots.label?.className
96
90
  )}
97
91
  >
98
92
  {label}
@@ -101,16 +95,16 @@ export const Input = ({
101
95
  {(description || validationMessage) && (
102
96
  <p
103
97
  {...(!isInvalid && { id: descriptionId })}
104
- className={cx(descriptionVisuallyHidden && !isInvalid && 'sr-only')}
98
+ className={mx(descriptionVisuallyHidden && !isInvalid && 'sr-only')}
105
99
  >
106
100
  {validationMessage && (
107
- <span id={validationId} className={valenceColorText(validationValence)}>
101
+ <span id={validationId} className={mx(valenceColorText(validationValence), slots.validation?.className)}>
108
102
  {validationMessage}{' '}
109
103
  </span>
110
104
  )}
111
105
  <span
112
106
  {...(isInvalid && { id: descriptionId })}
113
- className={cx(defaultDescription, descriptionVisuallyHidden && 'sr-only')}
107
+ className={mx(defaultDescription, descriptionVisuallyHidden && 'sr-only', slots.description?.className)}
114
108
  >
115
109
  {description}
116
110
  </span>
@@ -8,8 +8,9 @@ import { MessageValence } from '../../props';
8
8
 
9
9
  export type InputSize = 'md' | 'lg' | 'pin' | 'textarea';
10
10
 
11
- interface InputPropsExtension {
11
+ interface SharedTextInputProps {
12
12
  label: ReactNode;
13
+ placeholder?: string;
13
14
  labelVisuallyHidden?: boolean;
14
15
  description?: ReactNode;
15
16
  descriptionVisuallyHidden?: boolean;
@@ -20,16 +21,27 @@ interface InputPropsExtension {
20
21
  validationMessage?: ReactNode;
21
22
  validationValence?: MessageValence;
22
23
  length?: number;
23
- spacing?: string;
24
- borders?: string;
25
- typography?: string;
26
- rounding?: string;
27
24
  }
28
25
 
29
- export interface InputProps
30
- extends Omit<ComponentProps<'input'>, 'value' | 'onChange' | 'size' | 'ref'>,
31
- InputPropsExtension {}
26
+ interface SharedSlots {
27
+ root?: Omit<ComponentProps<'div'>, 'children'>;
28
+ label?: Omit<ComponentProps<'label'>, 'children'>;
29
+ description?: Pick<ComponentProps<'span'>, 'className'>;
30
+ validation?: Pick<ComponentProps<'span'>, 'className'>;
31
+ }
32
+
33
+ export interface InputSlots extends SharedSlots {
34
+ input?: Omit<ComponentProps<'input'>, 'value' | 'onChange' | 'size' | 'ref' | 'disabled' | 'placeholder'>;
35
+ }
36
+
37
+ export interface TextareaSlots extends SharedSlots {
38
+ input?: Omit<ComponentProps<'textarea'>, 'value' | 'onChange' | 'size' | 'ref' | 'disabled' | 'placeholder'>;
39
+ }
40
+
41
+ export interface InputProps extends SharedTextInputProps {
42
+ slots?: InputSlots;
43
+ }
32
44
 
33
- export interface TextareaProps
34
- extends Omit<ComponentProps<'textarea'>, 'value' | 'onChange' | 'size' | 'ref'>,
35
- InputPropsExtension {}
45
+ export interface TextareaProps extends SharedTextInputProps {
46
+ slots?: TextareaSlots;
47
+ }
@@ -2,20 +2,25 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import cx from 'classnames';
6
- import React from 'react';
5
+ import React, { ComponentProps } from 'react';
7
6
 
8
7
  import { useId } from '../../hooks';
8
+ import { mx } from '../../util';
9
9
 
10
10
  export type LoadingSize = 'sm' | 'md' | 'lg' | 'xl';
11
11
 
12
12
  export type LoadingColor = 'primary' | 'neutral';
13
13
 
14
+ export interface LoadingSlots {
15
+ root?: Omit<ComponentProps<'div'>, 'children'>;
16
+ svg?: Pick<ComponentProps<'svg'>, 'className'>;
17
+ }
18
+
14
19
  export interface LoadingProps {
15
20
  label: string;
16
21
  size?: LoadingSize;
17
22
  color?: LoadingColor;
18
- className?: string;
23
+ slots?: LoadingSlots;
19
24
  }
20
25
 
21
26
  const sizeMap = new Map<LoadingSize, string>([
@@ -25,18 +30,23 @@ const sizeMap = new Map<LoadingSize, string>([
25
30
  ['xl', 'w-16 h-16']
26
31
  ]);
27
32
 
28
- export const Loading = ({ size, color, className, label }: LoadingProps & { label: string }) => {
33
+ export const Loading = ({ size, color, label, slots = {} }: LoadingProps) => {
29
34
  const labelId = useId('loading-label');
30
35
  const sizeClassName = sizeMap.get(size ?? 'md');
31
36
  return (
32
- <div role='status' className={cx('flex justify-center p-4', className)} aria-labelledby={labelId}>
37
+ <div
38
+ {...slots.root}
39
+ className={mx('flex justify-center p-4', slots.root?.className)}
40
+ role='status'
41
+ aria-labelledby={labelId}
42
+ >
33
43
  <svg
34
44
  role='none'
35
- aria-hidden='true'
36
- className={cx(
45
+ className={mx(
37
46
  sizeClassName,
38
47
  'text-neutral-200/50 animate-spin dark:text-neutral-600/50',
39
- color === 'neutral' ? 'fill-neutral-400' : 'fill-primary-400'
48
+ color === 'neutral' ? 'fill-neutral-400' : 'fill-primary-400',
49
+ slots.svg?.className
40
50
  )}
41
51
  viewBox='0 0 100 101'
42
52
  fill='none'
@@ -46,7 +46,7 @@ Default.args = {
46
46
  triggerLinkProps: { href: '#Goodbye' },
47
47
  tooltip: {
48
48
  content: 'More info about Goodbye',
49
- sideOffset: 8
49
+ slots: { content: { sideOffset: 8 } }
50
50
  },
51
51
  children: 'Goodbye'
52
52
  }
@@ -3,10 +3,10 @@
3
3
  //
4
4
 
5
5
  import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
6
- import cx from 'classnames';
7
6
  import React, { ComponentProps, ForwardedRef, forwardRef, ReactNode } from 'react';
8
7
 
9
8
  import { defaultFocus, defaultHover, defaultInlineSeparator } from '../../styles';
9
+ import { mx } from '../../util';
10
10
  import { defaultButtonColors, primaryButtonColors } from '../Button';
11
11
  import { Tooltip, TooltipProps } from '../Tooltip';
12
12
 
@@ -40,8 +40,17 @@ export type NavMenuItem =
40
40
  | NavMenuInvokerItemProps
41
41
  | NavMenuSeparatorProps;
42
42
 
43
- export interface NavMenuProps extends ComponentProps<typeof NavigationMenuPrimitive.Root> {
43
+ export interface NavMenuSlots {
44
+ root?: Omit<ComponentProps<typeof NavigationMenuPrimitive.Root>, 'children'>;
45
+ viewport?: Omit<ComponentProps<typeof NavigationMenuPrimitive.Viewport>, 'children'>;
46
+ list?: Omit<ComponentProps<typeof NavigationMenuPrimitive.List>, 'children'>;
47
+ indicator?: Omit<ComponentProps<typeof NavigationMenuPrimitive.Indicator>, 'children'>;
48
+ indicatorIcon?: Pick<ComponentProps<'div'>, 'className'>;
49
+ }
50
+
51
+ export interface NavMenuProps {
44
52
  items: NavMenuItem[];
53
+ slots?: NavMenuSlots;
45
54
  }
46
55
 
47
56
  const NavMenuInvokerItem = forwardRef(
@@ -49,7 +58,7 @@ const NavMenuInvokerItem = forwardRef(
49
58
  return (
50
59
  <NavigationMenuPrimitive.Item ref={ref}>
51
60
  <NavigationMenuPrimitive.Trigger
52
- className={cx(
61
+ className={mx(
53
62
  'px-3 py-2 text-sm rounded-md text-sm font-medium transition-color',
54
63
  active ? primaryButtonColors : defaultButtonColors,
55
64
  defaultFocus,
@@ -59,7 +68,7 @@ const NavMenuInvokerItem = forwardRef(
59
68
  {children}
60
69
  </NavigationMenuPrimitive.Trigger>
61
70
  <NavigationMenuPrimitive.Content
62
- className={cx(
71
+ className={mx(
63
72
  'absolute w-auto top-0 left-0 rounded-lg',
64
73
  'radix-motion-from-start:animate-enter-from-left',
65
74
  'radix-motion-from-end:animate-enter-from-right',
@@ -80,7 +89,7 @@ const NavMenuLinkItem = forwardRef(
80
89
  <NavigationMenuPrimitive.Link
81
90
  {...triggerLinkProps}
82
91
  active={active}
83
- className={cx(
92
+ className={mx(
84
93
  'px-3 py-2 text-sm rounded-md transition-color',
85
94
  active ? primaryButtonColors : defaultButtonColors,
86
95
  active ? 'font-medium' : 'font-normal',
@@ -103,7 +112,7 @@ const NavMenuTooltipLinkItem = forwardRef(
103
112
  <NavigationMenuPrimitive.Link
104
113
  {...triggerLinkProps}
105
114
  active={active}
106
- className={cx(
115
+ className={mx(
107
116
  'px-3 py-2 text-sm rounded-md transition-color',
108
117
  active ? primaryButtonColors : defaultButtonColors,
109
118
  active ? 'font-medium' : 'font-normal',
@@ -122,17 +131,23 @@ const NavMenuTooltipLinkItem = forwardRef(
122
131
  export const NavMenuLink = NavigationMenuPrimitive.Link;
123
132
 
124
133
  export const NavMenuSeparatorItem = (_props: NavMenuSeparatorProps) => {
125
- return <span role='none' className={cx(defaultInlineSeparator, 'bs-5')} />;
134
+ return <span role='none' className={mx(defaultInlineSeparator, 'bs-5')} />;
126
135
  };
127
136
 
128
137
  const isTooltipLinkItem = (o: any): o is NavMenuTooltipLinkItemProps => 'tooltip' in o;
129
138
  const isLinkItem = (o: any): o is NavMenuLinkItemProps => 'triggerLinkProps' in o;
130
139
  const isSeparator = (o: any): o is NavMenuSeparatorProps => 'separator' in o;
131
140
 
132
- export const NavMenu = ({ items, ...rootProps }: NavMenuProps) => {
141
+ export const NavMenu = ({ items, slots = {} }: NavMenuProps) => {
133
142
  return (
134
- <NavigationMenuPrimitive.Root {...rootProps} className={cx('flex justify-center', rootProps.className)}>
135
- <NavigationMenuPrimitive.List className='relative flex flex-row items-center gap-1 rounded-lg bg-white dark:bg-neutral-750 p-1 button-elevation overflow-x-auto'>
143
+ <NavigationMenuPrimitive.Root {...slots.root} className={mx('flex justify-center', slots.root?.className)}>
144
+ <NavigationMenuPrimitive.List
145
+ {...slots.list}
146
+ className={mx(
147
+ 'relative flex flex-row items-center gap-1 rounded-lg bg-white dark:bg-neutral-750 p-1 button-elevation overflow-x-auto',
148
+ slots.list?.className
149
+ )}
150
+ >
136
151
  {items.map((item: NavMenuItem, i) => {
137
152
  return isTooltipLinkItem(item) ? (
138
153
  <NavMenuTooltipLinkItem key={i} {...item} />
@@ -146,32 +161,40 @@ export const NavMenu = ({ items, ...rootProps }: NavMenuProps) => {
146
161
  })}
147
162
 
148
163
  <NavigationMenuPrimitive.Indicator
149
- className={cx(
150
- 'z-10',
151
- 'top-[100%] flex items-end justify-center h-2 overflow-hidden',
164
+ {...slots.indicator}
165
+ className={mx(
166
+ 'z-10 top-[100%] flex items-end justify-center h-2 overflow-hidden',
152
167
  'radix-state-visible:animate-fade-in',
153
168
  'radix-state-hidden:animate-fade-out',
154
- 'transition-[width_transform] duration-[250ms] ease-[ease]'
169
+ 'transition-[width_transform] duration-[250ms] ease-[ease]',
170
+ slots.indicator?.className
155
171
  )}
156
172
  >
157
- <div className='top-1 relative bg-white dark:bg-neutral-750 w-2 h-2 rotate-45' />
173
+ <div
174
+ className={mx(
175
+ 'top-1 relative bg-white dark:bg-neutral-750 w-2 h-2 rotate-45',
176
+ slots.indicatorIcon?.className
177
+ )}
178
+ />
158
179
  </NavigationMenuPrimitive.Indicator>
159
180
  </NavigationMenuPrimitive.List>
160
181
 
161
182
  <div
162
- className={cx('absolute flex justify-center', 'w-[140%] left-[-20%] top-[100%]')}
183
+ className={mx('absolute flex justify-center', 'w-[140%] left-[-20%] top-[100%]')}
163
184
  style={{
164
185
  perspective: '2000px'
165
186
  }}
166
187
  >
167
188
  <NavigationMenuPrimitive.Viewport
168
- className={cx(
169
- 'relative mt-2 shadow-lg rounded-md bg-white dark:bg-neutral-750 overflow-hidden',
189
+ {...slots.viewport}
190
+ className={mx(
191
+ 'relative mbs-2 shadow-lg rounded-md bg-white dark:bg-neutral-750 overflow-hidden',
170
192
  'w-radix-navigation-menu-viewport',
171
193
  'h-radix-navigation-menu-viewport',
172
194
  'radix-state-open:animate-scale-in-content',
173
195
  'radix-state-closed:animate-scale-out-content',
174
- 'origin-[top_center] transition-[width_height] duration-300 ease-[ease]'
196
+ 'origin-[top_center] transition-[width_height] duration-300 ease-[ease]',
197
+ slots.viewport?.className
175
198
  )}
176
199
  />
177
200
  </div>
@@ -3,11 +3,11 @@
3
3
  //
4
4
 
5
5
  import '@dxosTheme';
6
- import cx from 'classnames';
7
6
  import React from 'react';
8
7
 
9
8
  import { defaultFocus, defaultHover, defaultActive } from '../../styles';
10
9
  import { templateForComponent } from '../../testing';
10
+ import { mx } from '../../util';
11
11
  import { Avatar } from '../Avatar';
12
12
  import { Button } from '../Button';
13
13
  import { Popover, PopoverProps } from './Popover';
@@ -34,10 +34,14 @@ Default.args = {
34
34
  export const AvatarTrigger = templateForComponent(Template)({
35
35
  openTrigger: (
36
36
  <Avatar
37
- tabIndex={0}
37
+ slots={{
38
+ root: {
39
+ tabIndex: 0,
40
+ className: mx('button-elevation cursor-pointer rounded-md', defaultHover({}), defaultFocus, defaultActive)
41
+ }
42
+ }}
38
43
  label={<span className='sr-only'>Open popover</span>}
39
44
  fallbackValue='open popover'
40
- className={cx('button-elevation cursor-pointer rounded-md', defaultHover({}), defaultFocus, defaultActive)}
41
45
  />
42
46
  ),
43
47
  closeLabel: 'Close',