@uxf/ui 1.0.0-beta.99 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (573) hide show
  1. package/README.md +4 -0
  2. package/_file-input-base/file-input-base.d.ts +12 -0
  3. package/_file-input-base/file-input-base.js +32 -0
  4. package/_file-input-base/index.d.ts +2 -0
  5. package/_file-input-base/index.js +5 -0
  6. package/_input-with-popover/index.d.ts +2 -0
  7. package/_input-with-popover/index.js +5 -0
  8. package/_input-with-popover/input-with-popover.d.ts +27 -0
  9. package/_input-with-popover/input-with-popover.js +89 -0
  10. package/_private-utils/get-provider-config.js +1 -0
  11. package/_select-base/_select-base.d.ts +53 -0
  12. package/_select-base/_select-base.js +94 -0
  13. package/_select-base/index.d.ts +2 -0
  14. package/_select-base/index.js +5 -0
  15. package/avatar/avatar.js +25 -5
  16. package/avatar/avatar.spec.js +2 -2
  17. package/avatar/avatar.stories.d.ts +1 -1
  18. package/avatar/index.d.ts +2 -1
  19. package/avatar/index.js +3 -15
  20. package/avatar-file-input/avatar-file-input.d.ts +5 -30
  21. package/avatar-file-input/avatar-file-input.js +12 -34
  22. package/avatar-file-input/avatar-file-input.spec.d.ts +1 -0
  23. package/avatar-file-input/avatar-file-input.spec.js +9 -0
  24. package/avatar-file-input/avatar-file-input.stories.d.ts +1 -1
  25. package/avatar-file-input/avatar-file-input.stories.js +44 -18
  26. package/avatar-file-input/index.d.ts +2 -1
  27. package/avatar-file-input/index.js +3 -15
  28. package/badge/badge.d.ts +1 -1
  29. package/badge/badge.js +25 -5
  30. package/badge/badge.spec.d.ts +1 -0
  31. package/badge/badge.spec.js +9 -0
  32. package/badge/badge.stories.d.ts +1 -1
  33. package/badge/index.d.ts +3 -1
  34. package/badge/index.js +3 -15
  35. package/badge/theme.d.ts +1 -0
  36. package/button/button.d.ts +3 -3
  37. package/button/button.js +26 -8
  38. package/button/button.spec.d.ts +1 -0
  39. package/button/button.spec.js +9 -0
  40. package/button/button.stories.d.ts +2 -6
  41. package/button/button.stories.js +19 -17
  42. package/button/index.d.ts +3 -1
  43. package/button/index.js +3 -15
  44. package/button/theme.d.ts +3 -0
  45. package/button-group/button-group.d.ts +6 -0
  46. package/button-group/button-group.js +13 -0
  47. package/button-group/button-group.spec.d.ts +1 -0
  48. package/button-group/button-group.spec.js +9 -0
  49. package/button-group/button-group.stories.d.ts +7 -0
  50. package/button-group/button-group.stories.js +40 -0
  51. package/button-group/index.d.ts +2 -0
  52. package/button-group/index.js +5 -0
  53. package/button-list/button-list.d.ts +21 -0
  54. package/button-list/button-list.js +77 -0
  55. package/button-list/button-list.spec.d.ts +1 -0
  56. package/button-list/button-list.spec.js +9 -0
  57. package/button-list/button-list.stories.d.ts +7 -0
  58. package/button-list/button-list.stories.js +55 -0
  59. package/button-list/index.d.ts +2 -0
  60. package/button-list/index.js +5 -0
  61. package/calendar/calendar-day-cell.d.ts +7 -0
  62. package/{date-picker-input/date-picker-day.js → calendar/calendar-day-cell.js} +8 -9
  63. package/calendar/calendar-provider.d.ts +6 -0
  64. package/{date-picker-input/date-picker-provider.js → calendar/calendar-provider.js} +9 -9
  65. package/calendar/calendar.d.ts +7 -0
  66. package/calendar/calendar.js +53 -0
  67. package/calendar/calendar.stories.d.ts +10 -0
  68. package/calendar/calendar.stories.js +49 -0
  69. package/calendar/index.d.ts +1 -0
  70. package/{form-control → calendar}/index.js +1 -1
  71. package/checkbox/checkbox.d.ts +6 -7
  72. package/checkbox/checkbox.js +48 -13
  73. package/checkbox/checkbox.spec.js +2 -4
  74. package/checkbox/checkbox.stories.d.ts +2 -2
  75. package/checkbox/checkbox.stories.js +8 -6
  76. package/checkbox/index.d.ts +3 -1
  77. package/checkbox/index.js +3 -15
  78. package/{checkbox-visual → checkbox}/theme.d.ts +1 -0
  79. package/checkbox-button/checkbox-button.d.ts +3 -2
  80. package/checkbox-button/checkbox-button.js +26 -6
  81. package/checkbox-button/checkbox-button.spec.js +2 -3
  82. package/checkbox-button/checkbox-button.stories.d.ts +1 -1
  83. package/checkbox-button/checkbox-button.stories.js +8 -18
  84. package/checkbox-button/index.d.ts +2 -1
  85. package/checkbox-button/index.js +3 -15
  86. package/checkbox-input/checkbox-input.d.ts +12 -0
  87. package/checkbox-input/checkbox-input.js +37 -0
  88. package/checkbox-input/checkbox-input.spec.d.ts +1 -0
  89. package/checkbox-input/checkbox-input.spec.js +9 -0
  90. package/{checkbox-visual/checkbox-visual.stories.d.ts → checkbox-input/checkbox-input.stories.d.ts} +2 -2
  91. package/{checkbox-visual/checkbox-visual.stories.js → checkbox-input/checkbox-input.stories.js} +9 -7
  92. package/checkbox-input/index.d.ts +2 -0
  93. package/checkbox-input/index.js +5 -0
  94. package/chip/chip.d.ts +5 -4
  95. package/chip/chip.js +26 -6
  96. package/chip/chip.stories.d.ts +2 -6
  97. package/chip/chip.stories.js +2 -2
  98. package/chip/theme.d.ts +5 -4
  99. package/color-radio/color-radio.d.ts +12 -0
  100. package/color-radio/color-radio.js +65 -0
  101. package/color-radio/color-radio.spec.d.ts +1 -0
  102. package/color-radio/color-radio.spec.js +9 -0
  103. package/color-radio/color-radio.stories.d.ts +7 -0
  104. package/color-radio/color-radio.stories.js +31 -0
  105. package/color-radio/index.d.ts +2 -0
  106. package/color-radio/index.js +5 -0
  107. package/color-radio-group/color-radio-group.d.ts +3 -2
  108. package/color-radio-group/color-radio-group.js +12 -10
  109. package/color-radio-group/color-radio-group.spec.d.ts +1 -0
  110. package/color-radio-group/color-radio-group.spec.js +9 -0
  111. package/color-radio-group/color-radio-group.stories.d.ts +1 -1
  112. package/color-radio-group/color-radio-group.stories.js +4 -2
  113. package/color-radio-group/index.d.ts +2 -1
  114. package/color-radio-group/index.js +3 -15
  115. package/color-scheme/index.d.ts +1 -0
  116. package/color-scheme/index.js +3 -1
  117. package/color-scheme/use-color-scheme.d.ts +1 -0
  118. package/color-scheme/use-color-scheme.js +19 -0
  119. package/combobox/combobox.d.ts +19 -20
  120. package/combobox/combobox.js +19 -31
  121. package/combobox/combobox.spec.d.ts +1 -0
  122. package/combobox/combobox.spec.js +10 -0
  123. package/combobox/combobox.stories.d.ts +7 -4
  124. package/combobox/combobox.stories.js +25 -12
  125. package/combobox/index.d.ts +2 -1
  126. package/combobox/index.js +3 -15
  127. package/config/icons-config.d.ts +1 -1
  128. package/config/icons-config.js +1 -1
  129. package/config/icons.d.ts +41 -1
  130. package/config/icons.js +8 -0
  131. package/content/types.d.ts +3 -3
  132. package/context/context.d.ts +2 -1
  133. package/context/provider.d.ts +1 -1
  134. package/context/provider.js +3 -0
  135. package/context/use-component-context.d.ts +1 -1
  136. package/date-picker/date-picker-content.d.ts +2 -0
  137. package/{date-picker-input/date-picker.js → date-picker/date-picker-content.js} +5 -3
  138. package/{date-picker-input → date-picker}/date-picker-decade.js +12 -10
  139. package/{date-picker-input → date-picker}/date-picker-month.js +21 -15
  140. package/date-picker/date-picker-navigation.d.ts +9 -0
  141. package/date-picker/date-picker-navigation.js +19 -0
  142. package/{date-picker-input → date-picker}/date-picker-year.js +16 -11
  143. package/date-picker/date-picker.d.ts +10 -0
  144. package/date-picker/date-picker.js +27 -0
  145. package/date-picker/date-picker.spec.d.ts +1 -0
  146. package/date-picker/date-picker.spec.js +9 -0
  147. package/date-picker/date-picker.stories.d.ts +7 -0
  148. package/date-picker/date-picker.stories.js +43 -0
  149. package/date-picker/index.d.ts +3 -0
  150. package/date-picker/index.js +5 -0
  151. package/date-picker/types.d.ts +1 -0
  152. package/date-picker-input/date-picker-input.d.ts +9 -18
  153. package/date-picker-input/date-picker-input.js +54 -59
  154. package/date-picker-input/date-picker-input.spec.d.ts +1 -0
  155. package/date-picker-input/date-picker-input.spec.js +9 -0
  156. package/date-picker-input/date-picker-input.stories.d.ts +1 -8
  157. package/date-picker-input/date-picker-input.stories.js +9 -14
  158. package/date-picker-input/index.d.ts +2 -3
  159. package/date-picker-input/index.js +6 -17
  160. package/datetime-picker/datetime-picker.d.ts +13 -0
  161. package/datetime-picker/datetime-picker.js +94 -0
  162. package/datetime-picker/datetime-picker.spec.d.ts +1 -0
  163. package/datetime-picker/datetime-picker.spec.js +9 -0
  164. package/datetime-picker/datetime-picker.stories.d.ts +7 -0
  165. package/datetime-picker/datetime-picker.stories.js +43 -0
  166. package/datetime-picker/index.d.ts +2 -0
  167. package/datetime-picker/index.js +7 -0
  168. package/datetime-picker-input/datetime-picker-input.d.ts +12 -0
  169. package/datetime-picker-input/datetime-picker-input.js +81 -0
  170. package/datetime-picker-input/datetime-picker-input.spec.d.ts +1 -0
  171. package/datetime-picker-input/datetime-picker-input.spec.js +9 -0
  172. package/datetime-picker-input/datetime-picker-input.stories.d.ts +7 -0
  173. package/datetime-picker-input/datetime-picker-input.stories.js +49 -0
  174. package/datetime-picker-input/index.d.ts +2 -0
  175. package/datetime-picker-input/index.js +7 -0
  176. package/dropdown/dropdown.d.ts +4 -4
  177. package/dropdown/dropdown.js +27 -6
  178. package/dropdown/dropdown.spec.d.ts +1 -0
  179. package/dropdown/dropdown.spec.js +9 -0
  180. package/dropdown/dropdown.stories.d.ts +2 -2
  181. package/dropdown/index.d.ts +2 -1
  182. package/dropdown/index.js +3 -15
  183. package/dropzone/dropzone-input.d.ts +19 -0
  184. package/dropzone/dropzone-input.js +121 -0
  185. package/dropzone/dropzone-list.d.ts +10 -0
  186. package/dropzone/dropzone-list.js +92 -0
  187. package/dropzone/dropzone.spec.d.ts +1 -0
  188. package/dropzone/dropzone.spec.js +9 -0
  189. package/dropzone/dropzone.stories.d.ts +10 -0
  190. package/dropzone/dropzone.stories.js +63 -0
  191. package/dropzone/index.d.ts +6 -0
  192. package/dropzone/index.js +6 -0
  193. package/dropzone/types.d.ts +10 -0
  194. package/dropzone/types.js +2 -0
  195. package/error-message/error-message.d.ts +3 -4
  196. package/error-message/error-message.js +3 -2
  197. package/error-message/error-message.spec.d.ts +1 -0
  198. package/error-message/error-message.spec.js +9 -0
  199. package/error-message/error-message.stories.d.ts +3 -4
  200. package/error-message/index.d.ts +1 -1
  201. package/error-message/index.js +3 -15
  202. package/file-input/file-input.d.ts +12 -0
  203. package/file-input/file-input.js +75 -0
  204. package/file-input/file-input.spec.d.ts +1 -0
  205. package/file-input/file-input.spec.js +9 -0
  206. package/file-input/file-input.stories.d.ts +7 -0
  207. package/file-input/file-input.stories.js +50 -0
  208. package/file-input/index.d.ts +2 -0
  209. package/file-input/index.js +5 -0
  210. package/flash-messages/flash-message.d.ts +1 -1
  211. package/flash-messages/flash-message.js +1 -0
  212. package/flash-messages/flash-messages.js +1 -1
  213. package/flash-messages/flash-messages.spec.d.ts +1 -0
  214. package/flash-messages/flash-messages.spec.js +9 -0
  215. package/flash-messages/flash-messages.stories.d.ts +1 -1
  216. package/flash-messages/flash-messages.stories.js +12 -7
  217. package/flash-messages/index.d.ts +3 -0
  218. package/flash-messages/index.js +8 -0
  219. package/{form-control/form-control.d.ts → form-component/form-component.d.ts} +2 -2
  220. package/form-component/form-component.js +41 -0
  221. package/form-component/form-component.spec.d.ts +1 -0
  222. package/form-component/form-component.spec.js +9 -0
  223. package/{form-control/form-control.stories.d.ts → form-component/form-component.stories.d.ts} +2 -2
  224. package/form-component/form-component.stories.js +25 -0
  225. package/form-component/index.d.ts +2 -0
  226. package/form-component/index.js +5 -0
  227. package/hooks/use-async-loading.d.ts +4 -0
  228. package/hooks/use-async-loading.js +32 -0
  229. package/hooks/use-dropdown.d.ts +32 -2
  230. package/hooks/use-dropdown.js +4 -6
  231. package/hooks/use-input-submit.d.ts +1 -1
  232. package/icon/icon.d.ts +3 -3
  233. package/icon/icon.js +25 -5
  234. package/icon/icon.spec.d.ts +1 -0
  235. package/icon/icon.spec.js +10 -0
  236. package/icon/icon.stories.d.ts +6 -10
  237. package/icon/icon.stories.js +2 -2
  238. package/icon/index.d.ts +2 -1
  239. package/icon/index.js +3 -15
  240. package/icon/types.d.ts +1 -1
  241. package/image-gallery/components/arrow-button.d.ts +7 -0
  242. package/image-gallery/components/{previous-button.js → arrow-button.js} +7 -5
  243. package/image-gallery/components/close-button.d.ts +4 -3
  244. package/image-gallery/components/close-button.js +9 -5
  245. package/image-gallery/components/dot.d.ts +3 -3
  246. package/image-gallery/components/dot.js +6 -4
  247. package/image-gallery/components/gallery.d.ts +4 -3
  248. package/image-gallery/components/gallery.js +20 -20
  249. package/image-gallery/context.d.ts +1 -1
  250. package/image-gallery/image-gallery.d.ts +4 -4
  251. package/image-gallery/image-gallery.js +7 -8
  252. package/image-gallery/image-gallery.spec.d.ts +1 -0
  253. package/image-gallery/image-gallery.spec.js +9 -0
  254. package/image-gallery/image-gallery.stories.d.ts +5 -4
  255. package/image-gallery/image-gallery.stories.js +21 -10
  256. package/image-gallery/image.d.ts +2 -3
  257. package/image-gallery/image.js +8 -4
  258. package/image-gallery/index.d.ts +6 -4
  259. package/image-gallery/index.js +6 -24
  260. package/image-gallery/types.d.ts +4 -2
  261. package/image-gallery/use-image.js +3 -2
  262. package/input/index.d.ts +9 -8
  263. package/input/index.js +4 -2
  264. package/input/input-element.d.ts +2 -1
  265. package/input/input-element.js +28 -6
  266. package/input/input-left-addon.d.ts +3 -7
  267. package/input/input-left-addon.js +6 -4
  268. package/input/input-left-element.d.ts +3 -7
  269. package/input/input-left-element.js +3 -3
  270. package/input/input-remove-button.d.ts +5 -0
  271. package/input/input-remove-button.js +29 -0
  272. package/input/input-right-addon.d.ts +2 -5
  273. package/input/input-right-addon.js +6 -4
  274. package/input/input-right-element.d.ts +3 -7
  275. package/input/input-right-element.js +3 -3
  276. package/input/input.d.ts +11 -1
  277. package/input/input.js +23 -23
  278. package/input/input.spec.d.ts +1 -0
  279. package/input/input.spec.js +10 -0
  280. package/input/input.stories.d.ts +10 -9
  281. package/input/input.stories.js +13 -10
  282. package/input/theme.d.ts +2 -0
  283. package/label/index.d.ts +2 -1
  284. package/label/index.js +3 -15
  285. package/label/label.js +28 -6
  286. package/label/label.spec.d.ts +1 -0
  287. package/label/label.spec.js +9 -0
  288. package/label/label.stories.d.ts +1 -1
  289. package/layout/index.d.ts +2 -1
  290. package/layout/index.js +3 -15
  291. package/layout/layout.js +5 -4
  292. package/layout/layout.spec.d.ts +1 -0
  293. package/layout/layout.spec.js +9 -0
  294. package/layout/layout.stories.d.ts +1 -1
  295. package/list-item/index.d.ts +2 -1
  296. package/list-item/index.js +3 -15
  297. package/list-item/list-item.js +25 -5
  298. package/list-item/list-item.spec.d.ts +1 -0
  299. package/list-item/list-item.spec.js +9 -0
  300. package/list-item/list-item.stories.d.ts +1 -1
  301. package/list-item/list-item.stories.js +7 -5
  302. package/loader/index.d.ts +2 -0
  303. package/loader/index.js +5 -0
  304. package/loader/loader.d.ts +5 -2
  305. package/loader/loader.js +27 -6
  306. package/loader/loader.spec.d.ts +1 -0
  307. package/loader/loader.spec.js +9 -0
  308. package/loader/loader.stories.d.ts +2 -2
  309. package/loader/loader.stories.js +4 -3
  310. package/modal/index.d.ts +3 -0
  311. package/modal/index.js +9 -0
  312. package/modal/modal-dialog.d.ts +11 -0
  313. package/modal/modal-dialog.js +38 -0
  314. package/modal/modal-service.d.ts +5 -0
  315. package/modal/modal-service.js +21 -0
  316. package/modal/modal.d.ts +14 -0
  317. package/modal/modal.js +51 -0
  318. package/modal/modal.spec.d.ts +1 -0
  319. package/modal/modal.spec.js +9 -0
  320. package/modal/modal.stories.d.ts +7 -0
  321. package/modal/modal.stories.js +50 -0
  322. package/modal/theme.d.ts +5 -0
  323. package/modal/theme.js +2 -0
  324. package/multi-combobox/_multi-combobox-base.d.ts +8 -0
  325. package/multi-combobox/_multi-combobox-base.js +112 -0
  326. package/multi-combobox/index.d.ts +2 -0
  327. package/multi-combobox/index.js +5 -0
  328. package/multi-combobox/multi-combobox.d.ts +3 -0
  329. package/multi-combobox/multi-combobox.js +67 -0
  330. package/multi-combobox/multi-combobox.spec.d.ts +1 -0
  331. package/multi-combobox/multi-combobox.spec.js +10 -0
  332. package/multi-combobox/multi-combobox.stories.d.ts +10 -0
  333. package/multi-combobox/multi-combobox.stories.js +86 -0
  334. package/multi-combobox/types.d.ts +36 -0
  335. package/multi-combobox/types.js +2 -0
  336. package/multi-select/_multi-select-base.d.ts +8 -0
  337. package/multi-select/_multi-select-base.js +77 -0
  338. package/multi-select/index.d.ts +2 -0
  339. package/multi-select/index.js +5 -0
  340. package/multi-select/multi-select.d.ts +3 -0
  341. package/multi-select/multi-select.js +55 -0
  342. package/multi-select/multi-select.spec.d.ts +1 -0
  343. package/multi-select/multi-select.spec.js +9 -0
  344. package/multi-select/multi-select.stories.d.ts +9 -0
  345. package/{mutli-combobox/multi-combobox.stories.js → multi-select/multi-select.stories.js} +17 -22
  346. package/multi-select/types.d.ts +31 -0
  347. package/multi-select/types.js +2 -0
  348. package/package.json +11 -11
  349. package/pagination/index.d.ts +2 -0
  350. package/pagination/index.js +5 -0
  351. package/pagination/pagination.d.ts +3 -0
  352. package/pagination/pagination.js +11 -6
  353. package/pagination/pagination.spec.d.ts +1 -0
  354. package/pagination/pagination.spec.js +9 -0
  355. package/pagination/pagination.stories.d.ts +4 -1
  356. package/pagination/pagination.stories.js +23 -3
  357. package/pagination/theme.d.ts +7 -0
  358. package/pagination/theme.js +2 -0
  359. package/paper/index.d.ts +2 -0
  360. package/paper/index.js +5 -0
  361. package/paper/paper.d.ts +2 -2
  362. package/paper/paper.js +25 -5
  363. package/paper/paper.spec.d.ts +1 -0
  364. package/paper/paper.spec.js +9 -0
  365. package/paper/paper.stories.d.ts +2 -2
  366. package/radio/index.d.ts +3 -1
  367. package/radio/index.js +3 -15
  368. package/radio/radio.d.ts +9 -6
  369. package/radio/radio.js +45 -9
  370. package/radio/radio.spec.js +2 -3
  371. package/radio/radio.stories.d.ts +2 -2
  372. package/radio/radio.stories.js +12 -12
  373. package/radio/theme.d.ts +1 -0
  374. package/radio-group/index.d.ts +3 -1
  375. package/radio-group/index.js +3 -15
  376. package/radio-group/radio-group.d.ts +3 -4
  377. package/radio-group/radio-group.js +10 -8
  378. package/radio-group/radio-group.spec.js +2 -17
  379. package/radio-group/radio-group.stories.d.ts +1 -1
  380. package/radio-group/radio-group.stories.js +7 -4
  381. package/radio-group/theme.d.ts +2 -0
  382. package/raster-image/index.d.ts +2 -1
  383. package/raster-image/index.js +3 -15
  384. package/raster-image/raster-image.d.ts +3 -3
  385. package/raster-image/raster-image.js +2 -1
  386. package/raster-image/raster-image.spec.d.ts +1 -0
  387. package/raster-image/raster-image.spec.js +9 -0
  388. package/raster-image/raster-image.stories.d.ts +2 -25
  389. package/select/index.d.ts +2 -1
  390. package/select/index.js +3 -15
  391. package/select/select.d.ts +16 -17
  392. package/select/select.js +16 -52
  393. package/select/select.spec.d.ts +1 -0
  394. package/select/select.spec.js +9 -0
  395. package/select/select.stories.d.ts +6 -4
  396. package/select/select.stories.js +24 -27
  397. package/select/theme.d.ts +5 -0
  398. package/select/theme.js +2 -0
  399. package/tabs/index.d.ts +2 -1
  400. package/tabs/index.js +3 -15
  401. package/tabs/tabs.d.ts +2 -1
  402. package/tabs/tabs.js +4 -3
  403. package/tabs/tabs.spec.d.ts +1 -0
  404. package/tabs/tabs.spec.js +9 -0
  405. package/tabs/tabs.stories.d.ts +1 -1
  406. package/text-input/index.d.ts +2 -1
  407. package/text-input/index.js +3 -15
  408. package/text-input/text-input.d.ts +2 -2
  409. package/text-input/text-input.js +12 -19
  410. package/text-input/text-input.spec.js +2 -2
  411. package/text-input/text-input.stories.d.ts +2 -2
  412. package/text-input/text-input.stories.js +23 -7
  413. package/text-link/index.d.ts +2 -1
  414. package/text-link/index.js +3 -15
  415. package/text-link/text-link.d.ts +3 -0
  416. package/text-link/text-link.js +27 -7
  417. package/text-link/text-link.spec.d.ts +1 -0
  418. package/text-link/text-link.spec.js +9 -0
  419. package/text-link/text-link.stories.d.ts +1 -1
  420. package/text-link/text-link.stories.js +4 -2
  421. package/text-link/theme.d.ts +3 -0
  422. package/text-link/theme.js +2 -0
  423. package/textarea/index.d.ts +2 -1
  424. package/textarea/index.js +3 -15
  425. package/textarea/textarea.js +11 -19
  426. package/textarea/textarea.spec.d.ts +1 -0
  427. package/textarea/textarea.spec.js +9 -0
  428. package/textarea/textarea.stories.d.ts +1 -1
  429. package/textarea/textarea.stories.js +4 -2
  430. package/time-picker/index.d.ts +2 -0
  431. package/time-picker/index.js +5 -0
  432. package/{time-picker-input → time-picker}/time-picker-hour.js +2 -0
  433. package/{time-picker-input → time-picker}/time-picker-hours.js +1 -0
  434. package/time-picker/time-picker-input.spec.d.ts +1 -0
  435. package/time-picker/time-picker-input.spec.js +9 -0
  436. package/time-picker/time-picker-input.stories.d.ts +7 -0
  437. package/time-picker/time-picker-input.stories.js +43 -0
  438. package/{time-picker-input → time-picker}/time-picker-minute.js +2 -0
  439. package/{time-picker-input → time-picker}/time-picker-minutes.js +1 -0
  440. package/{time-picker-input → time-picker}/time-picker.d.ts +1 -1
  441. package/{time-picker-input → time-picker}/time-picker.js +2 -1
  442. package/time-picker-input/index.d.ts +2 -2
  443. package/time-picker-input/index.js +6 -16
  444. package/time-picker-input/time-picker-input.d.ts +7 -19
  445. package/time-picker-input/time-picker-input.js +51 -62
  446. package/time-picker-input/time-picker-input.spec.d.ts +1 -0
  447. package/time-picker-input/time-picker-input.spec.js +9 -0
  448. package/time-picker-input/time-picker-input.stories.d.ts +1 -1
  449. package/time-picker-input/time-picker-input.stories.js +9 -6
  450. package/toggle/index.d.ts +3 -1
  451. package/toggle/index.js +3 -15
  452. package/toggle/theme.d.ts +1 -0
  453. package/toggle/toggle.d.ts +6 -6
  454. package/toggle/toggle.js +26 -6
  455. package/toggle/toggle.spec.d.ts +1 -0
  456. package/toggle/toggle.spec.js +9 -0
  457. package/toggle/toggle.stories.d.ts +1 -1
  458. package/toggle/toggle.stories.js +6 -12
  459. package/tooltip/index.d.ts +4 -0
  460. package/tooltip/index.js +7 -0
  461. package/tooltip/tooltip.d.ts +9 -0
  462. package/tooltip/tooltip.js +70 -0
  463. package/tooltip/tooltip.spec.d.ts +1 -0
  464. package/tooltip/tooltip.spec.js +9 -0
  465. package/tooltip/tooltip.stories.d.ts +7 -0
  466. package/tooltip/tooltip.stories.js +19 -0
  467. package/tooltip/use-tooltip.d.ts +43 -0
  468. package/tooltip/use-tooltip.js +36 -0
  469. package/tw-tokens/tw-box-shadow.d.ts +1 -1
  470. package/tw-tokens/tw-colors.d.ts +27 -1
  471. package/tw-tokens/tw-colors.js +26 -0
  472. package/tw-tokens/tw-containers.d.ts +1 -1
  473. package/tw-tokens/tw-font-size.d.ts +1 -1
  474. package/tw-tokens/tw-font-weight.d.ts +1 -1
  475. package/tw-tokens/tw-line-height.d.ts +1 -1
  476. package/tw-tokens/tw-screens.d.ts +1 -1
  477. package/tw-tokens/tw-spacing.d.ts +1 -1
  478. package/tw-tokens/tw-z-index.d.ts +1 -1
  479. package/types/color.d.ts +2 -2
  480. package/types/file-response.d.ts +12 -0
  481. package/types/file-response.js +2 -0
  482. package/types/form-control-props.d.ts +10 -6
  483. package/types/index.d.ts +1 -0
  484. package/types/index.js +1 -0
  485. package/typography/typography.spec.js +2 -14
  486. package/typography/typography.stories.d.ts +2 -2
  487. package/utils/component-structure-analyzer.d.ts +2 -2
  488. package/utils/files/get-file-url.d.ts +2 -0
  489. package/utils/files/get-file-url.js +7 -0
  490. package/utils/icons-config.js +40 -0
  491. package/utils/mocks/uploadFIle.mock.d.ts +2 -0
  492. package/utils/mocks/uploadFIle.mock.js +46 -0
  493. package/utils/snap-test.js +5 -0
  494. package/utils/storybook-config.d.ts +2 -2
  495. package/utils/storybook-config.js +1 -1
  496. package/utils/tailwind-config.js +17 -74
  497. package/utils/tailwind-plugins/container.js +39 -0
  498. package/utils/tailwind-plugins/variants.js +15 -0
  499. package/utils/tailwind-theme-defaults.js +20 -0
  500. package/checkbox-visual/checkbox-visual.d.ts +0 -10
  501. package/checkbox-visual/checkbox-visual.js +0 -17
  502. package/checkbox-visual/index.d.ts +0 -1
  503. package/checkbox-visual/index.js +0 -17
  504. package/color-radio-group/color-radio.d.ts +0 -7
  505. package/color-radio-group/color-radio.js +0 -22
  506. package/css/avatar-file-input.css +0 -7
  507. package/css/avatar.css +0 -15
  508. package/css/badge.css +0 -23
  509. package/css/button.css +0 -221
  510. package/css/button.old.css +0 -231
  511. package/css/checkbox-button.css +0 -98
  512. package/css/checkbox.css +0 -147
  513. package/css/chip.css +0 -171
  514. package/css/chip.old.css +0 -37
  515. package/css/color-radio-group.css +0 -21
  516. package/css/color-radio.css +0 -21
  517. package/css/combobox.css +0 -108
  518. package/css/combobox.old.css +0 -102
  519. package/css/component-structure-analyzer.css +0 -31
  520. package/css/date-picker-input.css +0 -135
  521. package/css/date-picker.css +0 -90
  522. package/css/dropdown.css +0 -24
  523. package/css/dropdown.old.css +0 -24
  524. package/css/error-message.css +0 -3
  525. package/css/flash-messages.css +0 -28
  526. package/css/form-control.css +0 -7
  527. package/css/icon.css +0 -7
  528. package/css/input-basic.css +0 -18
  529. package/css/input.css +0 -205
  530. package/css/input.old.css +0 -193
  531. package/css/label.css +0 -15
  532. package/css/layout.css +0 -47
  533. package/css/list-item.css +0 -29
  534. package/css/loader.css +0 -11
  535. package/css/multi-combobox.css +0 -72
  536. package/css/pagination.css +0 -28
  537. package/css/paper.css +0 -3
  538. package/css/radio-group.css +0 -160
  539. package/css/radio.css +0 -105
  540. package/css/raster-image.css +0 -20
  541. package/css/select.css +0 -72
  542. package/css/select.old.css +0 -66
  543. package/css/tabs.css +0 -131
  544. package/css/text-link.css +0 -12
  545. package/css/textarea.css +0 -117
  546. package/css/time-picker-input.css +0 -138
  547. package/css/time-picker.css +0 -27
  548. package/css/toggle.css +0 -80
  549. package/css/typography.css +0 -51
  550. package/date-picker-input/date-picker-day.d.ts +0 -8
  551. package/date-picker-input/date-picker-provider.d.ts +0 -8
  552. package/date-picker-input/date-picker.d.ts +0 -3
  553. package/date-picker-input/types.d.ts +0 -5
  554. package/form-control/form-control.js +0 -19
  555. package/form-control/form-control.stories.js +0 -25
  556. package/form-control/index.d.ts +0 -1
  557. package/image-gallery/components/next-button.d.ts +0 -6
  558. package/image-gallery/components/next-button.js +0 -12
  559. package/image-gallery/components/previous-button.d.ts +0 -6
  560. package/mutli-combobox/index.d.ts +0 -1
  561. package/mutli-combobox/index.js +0 -17
  562. package/mutli-combobox/multi-combobox.d.ts +0 -27
  563. package/mutli-combobox/multi-combobox.js +0 -94
  564. package/mutli-combobox/multi-combobox.stories.d.ts +0 -10
  565. /package/{checkbox-visual → checkbox}/theme.js +0 -0
  566. /package/{date-picker-input → date-picker}/date-picker-decade.d.ts +0 -0
  567. /package/{date-picker-input → date-picker}/date-picker-month.d.ts +0 -0
  568. /package/{date-picker-input → date-picker}/date-picker-year.d.ts +0 -0
  569. /package/{date-picker-input → date-picker}/types.js +0 -0
  570. /package/{time-picker-input → time-picker}/time-picker-hour.d.ts +0 -0
  571. /package/{time-picker-input → time-picker}/time-picker-hours.d.ts +0 -0
  572. /package/{time-picker-input → time-picker}/time-picker-minute.d.ts +0 -0
  573. /package/{time-picker-input → time-picker}/time-picker-minutes.d.ts +0 -0
@@ -1 +1,2 @@
1
- export * from "./checkbox-button";
1
+ export type { CheckboxButtonProps } from "./checkbox-button";
2
+ export { CheckboxButton } from "./checkbox-button";
@@ -1,17 +1,5 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
2
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./checkbox-button"), exports);
3
+ exports.CheckboxButton = void 0;
4
+ var checkbox_button_1 = require("./checkbox-button");
5
+ Object.defineProperty(exports, "CheckboxButton", { enumerable: true, get: function () { return checkbox_button_1.CheckboxButton; } });
@@ -0,0 +1,12 @@
1
+ import React, { CSSProperties, ReactNode } from "react";
2
+ import { FormControlProps } from "../types";
3
+ import { CheckboxSize } from "../checkbox";
4
+ export interface CheckboxInputProps extends FormControlProps<boolean | undefined> {
5
+ className?: string;
6
+ id?: string;
7
+ indeterminate?: boolean;
8
+ label: ReactNode;
9
+ size?: CheckboxSize;
10
+ style?: CSSProperties;
11
+ }
12
+ export declare const CheckboxInput: React.ForwardRefExoticComponent<CheckboxInputProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.CheckboxInput = void 0;
27
+ const react_1 = require("@headlessui/react");
28
+ const react_2 = __importStar(require("react"));
29
+ const checkbox_1 = require("../checkbox");
30
+ exports.CheckboxInput = (0, react_2.forwardRef)((props, ref) => {
31
+ var _a;
32
+ return (react_2.default.createElement(react_1.Switch.Group, null,
33
+ react_2.default.createElement("div", { className: `uxf-checkbox-input__wrapper ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}` },
34
+ react_2.default.createElement(react_1.Switch, { as: react_2.Fragment, checked: props.value, name: props.name, onChange: props.onChange }, ({ checked }) => (react_2.default.createElement(checkbox_1.Checkbox, { className: "uxf-checkbox-input", id: props.id, indeterminate: props.indeterminate, isDisabled: props.isDisabled, isFocused: props.isFocused, isInvalid: props.isInvalid, isReadOnly: props.isReadOnly, isRequired: props.isRequired, onChange: props.onChange, ref: ref, size: props.size, style: props.style, value: checked }))),
35
+ react_2.default.createElement(react_1.Switch.Label, { className: "uxf-checkbox-input__label" }, props.label))));
36
+ });
37
+ exports.CheckboxInput.displayName = "UxfUiCheckboxInput";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ const snap_test_1 = require("../utils/snap-test");
8
+ const checkbox_input_stories_1 = require("./checkbox-input.stories");
9
+ (0, snap_test_1.snapTest)("render stories", react_1.default.createElement(checkbox_input_stories_1.Default, null));
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  declare const _default: {
3
3
  title: string;
4
- component: React.ForwardRefExoticComponent<import("./checkbox-visual").CheckboxVisualProps & React.RefAttributes<HTMLDivElement>>;
4
+ component: React.ForwardRefExoticComponent<import("./checkbox-input").CheckboxInputProps & React.RefAttributes<HTMLDivElement>>;
5
5
  };
6
6
  export default _default;
7
- export declare function Default(): JSX.Element;
7
+ export declare function Default(): React.JSX.Element;
@@ -24,19 +24,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.Default = void 0;
27
- const index_1 = require("./index");
28
27
  const react_1 = __importStar(require("react"));
28
+ const checkbox_input_1 = require("./checkbox-input");
29
+ const action_1 = require("../utils/action");
29
30
  exports.default = {
30
- title: "UI/CheckboxVisual",
31
- component: index_1.CheckboxVisual,
31
+ title: "UI/CheckboxInput",
32
+ component: checkbox_input_1.CheckboxInput,
32
33
  };
33
34
  function Default() {
34
35
  const [checked, setChecked] = (0, react_1.useState)(true);
36
+ const onChange = (0, action_1.action)("onChange", () => setChecked((prev) => !prev));
35
37
  const checkboxes = (react_1.default.createElement(react_1.default.Fragment, null,
36
- react_1.default.createElement(index_1.CheckboxVisual, { onChange: () => setChecked((prev) => !prev), value: checked }),
37
- react_1.default.createElement(index_1.CheckboxVisual, { isDisabled: true, onChange: () => setChecked((prev) => !prev), value: checked }),
38
- react_1.default.createElement(index_1.CheckboxVisual, { isInvalid: true, onChange: () => setChecked((prev) => !prev), value: checked }),
39
- react_1.default.createElement(index_1.CheckboxVisual, { onChange: () => setChecked((prev) => !prev), value: checked, size: "lg" })));
38
+ react_1.default.createElement(checkbox_input_1.CheckboxInput, { label: "Opravdu?", onChange: onChange, value: checked }),
39
+ react_1.default.createElement(checkbox_input_1.CheckboxInput, { label: "Opravdu?", isDisabled: true, onChange: onChange, value: checked }),
40
+ react_1.default.createElement(checkbox_input_1.CheckboxInput, { label: "Opravdu?", isInvalid: true, onChange: onChange, value: checked }),
41
+ react_1.default.createElement(checkbox_input_1.CheckboxInput, { label: "Opravdu? (size lg)", onChange: onChange, value: checked, size: "lg" })));
40
42
  return (react_1.default.createElement("div", { className: "flex" },
41
43
  react_1.default.createElement("div", { className: "light flex flex-col gap-4 p-20" }, checkboxes),
42
44
  react_1.default.createElement("div", { className: "dark flex flex-col gap-4 bg-gray-900 p-20" }, checkboxes)));
@@ -0,0 +1,2 @@
1
+ export type { CheckboxInputProps } from "./checkbox-input";
2
+ export { CheckboxInput } from "./checkbox-input";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CheckboxInput = void 0;
4
+ var checkbox_input_1 = require("./checkbox-input");
5
+ Object.defineProperty(exports, "CheckboxInput", { enumerable: true, get: function () { return checkbox_input_1.CheckboxInput; } });
package/chip/chip.d.ts CHANGED
@@ -1,10 +1,11 @@
1
- import React, { HTMLAttributes } from "react";
2
1
  import { ChipColors, ChipSizes } from "@uxf/ui/chip/theme";
3
- export declare type ChipColor = keyof ChipColors;
4
- export declare type ChipSize = keyof ChipSizes;
2
+ import React, { HTMLAttributes, MouseEventHandler } from "react";
3
+ export type ChipColor = keyof ChipColors;
4
+ export type ChipSize = keyof ChipSizes;
5
5
  export interface ChipProps extends HTMLAttributes<HTMLDivElement> {
6
6
  color?: ChipColor;
7
+ onClose?: MouseEventHandler;
7
8
  size?: ChipSize;
8
- onClose?: () => void;
9
+ suppressFocus?: boolean;
9
10
  }
10
11
  export declare const Chip: React.ForwardRefExoticComponent<ChipProps & React.RefAttributes<HTMLDivElement>>;
package/chip/chip.js CHANGED
@@ -1,19 +1,39 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
4
24
  };
5
25
  Object.defineProperty(exports, "__esModule", { value: true });
6
26
  exports.Chip = void 0;
7
27
  const cx_1 = require("@uxf/core/utils/cx");
8
- const react_1 = __importDefault(require("react"));
9
- const forwardRef_1 = require("@uxf/core/utils/forwardRef");
10
- exports.Chip = (0, forwardRef_1.forwardRef)("Chip", (props, ref) => {
28
+ const react_1 = __importStar(require("react"));
29
+ exports.Chip = (0, react_1.forwardRef)((props, ref) => {
11
30
  var _a, _b;
12
31
  const chipClassName = (0, cx_1.cx)("uxf-chip", `uxf-chip--color-${(_a = props.color) !== null && _a !== void 0 ? _a : "default"}`, `uxf-chip--size-${(_b = props.size) !== null && _b !== void 0 ? _b : "default"}`, props.onClose && "has-button", props.className);
13
32
  return (react_1.default.createElement("div", { ref: ref, className: chipClassName },
14
33
  typeof props.children === "string" ? (react_1.default.createElement("span", { className: "uxf-chip__text" }, props.children)) : (props.children),
15
- props.onClose && (react_1.default.createElement("button", { type: "button", onClick: props.onClose, className: "uxf-chip__button" },
34
+ props.onClose && (react_1.default.createElement("button", { className: "uxf-chip__button", onClick: props.onClose, tabIndex: props.suppressFocus ? -1 : undefined, type: "button" },
16
35
  react_1.default.createElement("span", { className: "sr-only" }, "Remove option"),
17
36
  react_1.default.createElement("svg", { stroke: "currentColor", fill: "none", viewBox: "0 0 8 8" },
18
37
  react_1.default.createElement("path", { strokeLinecap: "round", strokeWidth: "1.5", d: "M1 1l6 6m0-6L1 7" }))))));
19
38
  });
39
+ exports.Chip.displayName = "UxfUiChip";
@@ -1,14 +1,10 @@
1
- /// <reference types="mdx" />
2
1
  import React from "react";
3
- import Docs from "./chip.docs.mdx";
4
2
  declare const _default: {
5
3
  title: string;
6
4
  component: React.ForwardRefExoticComponent<import("@uxf/ui/chip").ChipProps & React.RefAttributes<HTMLDivElement>>;
7
5
  parameters: {
8
- docs: {
9
- page: typeof Docs;
10
- };
6
+ docs: {};
11
7
  };
12
8
  };
13
9
  export default _default;
14
- export declare function Default(): JSX.Element;
10
+ export declare function Default(): React.JSX.Element;
@@ -7,13 +7,13 @@ exports.Default = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const chip_1 = require("@uxf/ui/chip");
9
9
  const storybook_config_1 = require("../utils/storybook-config");
10
- const chip_docs_mdx_1 = __importDefault(require("./chip.docs.mdx"));
10
+ // import Docs from "./chip.docs.mdx";
11
11
  exports.default = {
12
12
  title: "UI/Chip",
13
13
  component: chip_1.Chip,
14
14
  parameters: {
15
15
  docs: {
16
- page: chip_docs_mdx_1.default,
16
+ // page: Docs,
17
17
  },
18
18
  },
19
19
  };
package/chip/theme.d.ts CHANGED
@@ -1,12 +1,13 @@
1
1
  export interface ChipColors {
2
- default: true;
2
+ orange: true;
3
3
  red: true;
4
4
  yellow: true;
5
+ pink: true;
6
+ purple: true;
7
+ indigo: true;
5
8
  green: true;
6
9
  blue: true;
7
- indigo: true;
8
- purple: true;
9
- pink: true;
10
+ default: true;
10
11
  }
11
12
  export interface ChipSizes {
12
13
  default: true;
@@ -0,0 +1,12 @@
1
+ import React, { CSSProperties, ReactNode } from "react";
2
+ import { FormControlProps, HexColor } from "../types";
3
+ export interface ColorRadioProps<ValueType = string | number> extends Omit<FormControlProps<ValueType>, "onChange"> {
4
+ checked: boolean;
5
+ className?: string;
6
+ color: HexColor;
7
+ colorLabel: string;
8
+ onChange?: (value: ValueType) => void;
9
+ renderContent?: (className: string, checked: boolean | undefined, colorLabel: string, value: ValueType) => ReactNode;
10
+ style?: CSSProperties;
11
+ }
12
+ export declare const ColorRadio: React.ForwardRefExoticComponent<ColorRadioProps<string | number> & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.ColorRadio = void 0;
27
+ const classes_1 = require("@uxf/core/constants/classes");
28
+ const cx_1 = require("@uxf/core/utils/cx");
29
+ const react_1 = __importStar(require("react"));
30
+ const useClickableProps_1 = require("@uxf/core/hooks/useClickableProps");
31
+ const icon_1 = require("../icon");
32
+ function readableColorIsBlack(bgColor) {
33
+ const color = bgColor.substring(1, 7);
34
+ const r = parseInt(color.substring(0, 2), 16); // hexToR
35
+ const g = parseInt(color.substring(2, 4), 16); // hexToG
36
+ const b = parseInt(color.substring(4, 6), 16); // hexToB
37
+ return r * 0.299 + g * 0.587 + b * 0.114 > 146;
38
+ }
39
+ exports.ColorRadio = (0, react_1.forwardRef)((props, ref) => {
40
+ var _a, _b, _c;
41
+ const colorRadioStyle = {
42
+ "--bg-color": props.color,
43
+ ...((_a = props.style) !== null && _a !== void 0 ? _a : {}),
44
+ };
45
+ const onChange = props.onChange;
46
+ const onClick = onChange ? () => onChange(props.value) : undefined;
47
+ const clickableProps = (0, useClickableProps_1.useClickableProps)({
48
+ "aria-checked": props.checked,
49
+ "aria-disabled": props.isDisabled,
50
+ "aria-invalid": props.isInvalid,
51
+ "aria-readonly": props.isReadOnly,
52
+ "aria-required": props.isRequired,
53
+ className: (0, cx_1.cx)("uxf-color-radio", props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.isFocused && classes_1.CLASSES.IS_FOCUSED, props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.checked && classes_1.CLASSES.IS_SELECTED, props.className),
54
+ onBlur: props.onBlur,
55
+ onClick,
56
+ onFocus: props.onFocus,
57
+ role: "radio",
58
+ style: colorRadioStyle,
59
+ tabIndex: props.isReadOnly ? -1 : undefined,
60
+ });
61
+ const innerClassName = `uxf-color-radio__inner ${readableColorIsBlack(props.color) ? "uxf-color-radio__inner--dark" : ""}`;
62
+ return (react_1.default.createElement("div", { ...clickableProps, ref: ref },
63
+ react_1.default.createElement("span", { className: "uxf-color-radio__color-label" }, props.colorLabel), (_c = (_b = props.renderContent) === null || _b === void 0 ? void 0 : _b.call(props, innerClassName, props.checked, props.colorLabel, props.value)) !== null && _c !== void 0 ? _c : (react_1.default.createElement(icon_1.Icon, { className: innerClassName, name: "check" }))));
64
+ });
65
+ exports.ColorRadio.displayName = "UxfUiColorRadio";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ const snap_test_1 = require("../utils/snap-test");
8
+ const color_radio_stories_1 = require("./color-radio.stories");
9
+ (0, snap_test_1.snapTest)("render stories", react_1.default.createElement(color_radio_stories_1.Default, null));
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ declare const _default: {
3
+ title: string;
4
+ component: React.ForwardRefExoticComponent<import("./color-radio").ColorRadioProps<string | number> & React.RefAttributes<HTMLDivElement>>;
5
+ };
6
+ export default _default;
7
+ export declare function Default(): React.JSX.Element;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Default = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const color_radio_1 = require("./color-radio");
9
+ exports.default = {
10
+ title: "UI/ColorRadio",
11
+ component: color_radio_1.ColorRadio,
12
+ };
13
+ function Default() {
14
+ const radios = (react_1.default.createElement(react_1.default.Fragment, null,
15
+ react_1.default.createElement("div", { className: "mb-2 mt-4 font-semibold" }, "Default"),
16
+ react_1.default.createElement("div", { className: "flex flex-row gap-4" },
17
+ react_1.default.createElement(color_radio_1.ColorRadio, { checked: false, color: "#ff0000", colorLabel: "Red", value: 1 }),
18
+ react_1.default.createElement(color_radio_1.ColorRadio, { checked: true, color: "#cc0000", colorLabel: "Red", value: 2 })),
19
+ react_1.default.createElement("div", { className: "mb-2 mt-4 font-semibold" }, "Invalid"),
20
+ react_1.default.createElement("div", { className: "flex flex-row gap-4" },
21
+ react_1.default.createElement(color_radio_1.ColorRadio, { checked: false, color: "#ff0000", colorLabel: "Red", isInvalid: true, value: 1 }),
22
+ react_1.default.createElement(color_radio_1.ColorRadio, { checked: true, color: "#ff0000", colorLabel: "Red", isInvalid: true, value: 2 })),
23
+ react_1.default.createElement("div", { className: "mb-2 mt-4 font-semibold" }, "Disabled"),
24
+ react_1.default.createElement("div", { className: "flex flex-row gap-4" },
25
+ react_1.default.createElement(color_radio_1.ColorRadio, { checked: false, color: "#ff0000", colorLabel: "Red", isDisabled: true, value: 1 }),
26
+ react_1.default.createElement(color_radio_1.ColorRadio, { checked: true, color: "#ff0000", colorLabel: "Red", isDisabled: true, value: 2 }))));
27
+ return (react_1.default.createElement("div", { className: "flex" },
28
+ react_1.default.createElement("div", { className: "light p-20 " }, radios),
29
+ react_1.default.createElement("div", { className: "dark bg-gray-900 p-20 text-white" }, radios)));
30
+ }
31
+ exports.Default = Default;
@@ -0,0 +1,2 @@
1
+ export type { ColorRadioProps } from "./color-radio";
2
+ export { ColorRadio } from "./color-radio";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ColorRadio = void 0;
4
+ var color_radio_1 = require("./color-radio");
5
+ Object.defineProperty(exports, "ColorRadio", { enumerable: true, get: function () { return color_radio_1.ColorRadio; } });
@@ -1,7 +1,8 @@
1
1
  import React, { CSSProperties, ReactNode } from "react";
2
2
  import { FormControlProps, HexColor } from "../types";
3
- export declare type ColorRadioGroupOptionValue = HexColor;
3
+ export type ColorRadioGroupOptionValue = HexColor;
4
4
  export interface ColorRadioGroupOption {
5
+ disabled?: boolean;
5
6
  label: string;
6
7
  value: ColorRadioGroupOptionValue;
7
8
  }
@@ -9,7 +10,7 @@ export interface ColorRadioGroupProps extends FormControlProps<ColorRadioGroupOp
9
10
  className?: string;
10
11
  helperText?: ReactNode;
11
12
  hiddenLabel?: boolean;
12
- id: string;
13
+ id?: string;
13
14
  label: string;
14
15
  options: ColorRadioGroupOption[];
15
16
  style?: CSSProperties;
@@ -30,18 +30,20 @@ const use_input_submit_1 = require("../hooks/use-input-submit");
30
30
  const label_1 = require("../label");
31
31
  const cx_1 = require("@uxf/core/utils/cx");
32
32
  const classes_1 = require("@uxf/core/constants/classes");
33
- const forwardRef_1 = require("@uxf/core/utils/forwardRef");
34
- const color_radio_1 = require("./color-radio");
35
- exports.ColorRadioGroup = (0, forwardRef_1.forwardRef)("ColorRadioGroup", (props, ref) => {
33
+ const color_radio_1 = require("../color-radio");
34
+ exports.ColorRadioGroup = (0, react_2.forwardRef)((props, ref) => {
36
35
  const innerRef = (0, react_2.useRef)(null);
37
36
  (0, use_input_submit_1.useInputSubmit)(innerRef, "radio-group", props.isDisabled);
38
37
  const errorId = props.isInvalid ? `${props.id}--errormessage` : undefined;
39
- const rootClassName = (0, cx_1.cx)("uxf-color-radio-group-group", props.className);
38
+ const rootClassName = (0, cx_1.cx)("uxf-form-component uxf-color-radio-group__wrapper", props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.isInvalid && classes_1.CLASSES.IS_INVALID, props.className);
40
39
  return (react_2.default.createElement(react_1.RadioGroup, { className: rootClassName, id: props.id, onChange: props.onChange, style: props.style, value: props.value },
41
- react_2.default.createElement(react_1.RadioGroup.Label, { as: label_1.Label, className: "uxf-color-radio-group__label", isHidden: props.hiddenLabel, ref: ref }, props.label),
42
- react_2.default.createElement("div", { className: "uxf-color-radio-group__options-wrapper" }, props.options.map((option) => {
43
- const optionStyle = { "--option-color": option.value };
44
- return (react_2.default.createElement(react_1.RadioGroup.Option, { className: (0, cx_1.cx)("uxf-color-radio-group__option", props.isDisabled && classes_1.CLASSES.IS_DISABLED), key: option.value.toString(), value: option.value, style: optionStyle }, (o) => (react_2.default.createElement(color_radio_1.ColorRadio, { isDisabled: props.isDisabled || o.disabled, colorLabel: option.label, color: option.value, ref: o.checked ? innerRef : undefined, value: o.checked }))));
45
- })),
46
- props.helperText && (react_2.default.createElement("div", { className: (0, cx_1.cx)("uxf-helper-text", props.isInvalid && classes_1.CLASSES.IS_INVALID), id: errorId }, props.helperText))));
40
+ react_2.default.createElement("div", { className: "uxf-form-component__label" },
41
+ react_2.default.createElement(react_1.RadioGroup.Label, { as: label_1.Label, className: "uxf-color-radio-group__label", isHidden: props.hiddenLabel, ref: ref }, props.label)),
42
+ react_2.default.createElement("div", { className: "uxf-form-component__input" },
43
+ react_2.default.createElement("div", { className: "uxf-color-radio-group__options-wrapper" }, props.options.map((option) => {
44
+ const optionStyle = { "--option-color": option.value };
45
+ return (react_2.default.createElement(react_1.RadioGroup.Option, { className: (0, cx_1.cx)("uxf-color-radio-group__option", props.isDisabled && classes_1.CLASSES.IS_DISABLED), key: option.value.toString(), value: option.value, style: optionStyle }, (o) => (react_2.default.createElement(color_radio_1.ColorRadio, { checked: o.checked, isDisabled: props.isDisabled || o.disabled, colorLabel: option.label, color: option.value, ref: o.checked ? innerRef : undefined, value: option.value }))));
46
+ })),
47
+ props.helperText && (react_2.default.createElement("div", { className: (0, cx_1.cx)("uxf-helper-text", props.isInvalid && classes_1.CLASSES.IS_INVALID), id: errorId }, props.helperText)))));
47
48
  });
49
+ exports.ColorRadioGroup.displayName = "UxfUiColorRadioGroup";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ const snap_test_1 = require("../utils/snap-test");
8
+ const color_radio_group_stories_1 = require("./color-radio-group.stories");
9
+ (0, snap_test_1.snapTest)("render stories", react_1.default.createElement(color_radio_group_stories_1.Default, null));
@@ -4,4 +4,4 @@ declare const _default: {
4
4
  component: React.ForwardRefExoticComponent<import("./color-radio-group").ColorRadioGroupProps & React.RefAttributes<HTMLLabelElement>>;
5
5
  };
6
6
  export default _default;
7
- export declare function Default(): JSX.Element;
7
+ export declare function Default(): React.JSX.Element;
@@ -26,6 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.Default = void 0;
27
27
  const index_1 = require("./index");
28
28
  const react_1 = __importStar(require("react"));
29
+ const action_1 = require("../utils/action");
29
30
  exports.default = {
30
31
  title: "UI/ColorRadioGroup",
31
32
  component: index_1.ColorRadioGroup,
@@ -70,10 +71,11 @@ const options = [
70
71
  ];
71
72
  function Default() {
72
73
  const [value, setValue] = (0, react_1.useState)(options[0].value);
74
+ const onChange = (0, action_1.action)("onChange", setValue);
73
75
  return (react_1.default.createElement("div", { className: "flex" },
74
76
  react_1.default.createElement("div", { className: "light w-1/2 p-20" },
75
- react_1.default.createElement(index_1.ColorRadioGroup, { id: "radiogroup", label: "Light Color Radio group", onChange: (v) => setValue(v), options: options, value: value })),
77
+ react_1.default.createElement(index_1.ColorRadioGroup, { id: "radiogroup", label: "Light Color Radio group", onChange: onChange, options: options, value: value })),
76
78
  react_1.default.createElement("div", { className: "dark w-1/2 bg-gray-900 p-20" },
77
- react_1.default.createElement(index_1.ColorRadioGroup, { id: "radiogroup", label: "Dark Color Radio group with helper text", helperText: "Some helper text", onChange: (v) => setValue(v), options: options, value: value }))));
79
+ react_1.default.createElement(index_1.ColorRadioGroup, { id: "radiogroup", label: "Dark Color Radio group with helper text", helperText: "Some helper text", onChange: onChange, options: options, value: value }))));
78
80
  }
79
81
  exports.Default = Default;
@@ -1 +1,2 @@
1
- export * from "./color-radio-group";
1
+ export type { ColorRadioGroupOption, ColorRadioGroupOptionValue, ColorRadioGroupProps } from "./color-radio-group";
2
+ export { ColorRadioGroup } from "./color-radio-group";
@@ -1,17 +1,5 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
2
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./color-radio-group"), exports);
3
+ exports.ColorRadioGroup = void 0;
4
+ var color_radio_group_1 = require("./color-radio-group");
5
+ Object.defineProperty(exports, "ColorRadioGroup", { enumerable: true, get: function () { return color_radio_group_1.ColorRadioGroup; } });
@@ -1,2 +1,3 @@
1
1
  export { COLOR_SCHEME_DEFAULTS } from "./color-scheme-defaults";
2
+ export { useColorScheme } from "./use-color-scheme";
2
3
  export { useToggleColorScheme } from "./use-toggle-color-scheme";
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useToggleColorScheme = exports.COLOR_SCHEME_DEFAULTS = void 0;
3
+ exports.useToggleColorScheme = exports.useColorScheme = exports.COLOR_SCHEME_DEFAULTS = void 0;
4
4
  var color_scheme_defaults_1 = require("./color-scheme-defaults");
5
5
  Object.defineProperty(exports, "COLOR_SCHEME_DEFAULTS", { enumerable: true, get: function () { return color_scheme_defaults_1.COLOR_SCHEME_DEFAULTS; } });
6
+ var use_color_scheme_1 = require("./use-color-scheme");
7
+ Object.defineProperty(exports, "useColorScheme", { enumerable: true, get: function () { return use_color_scheme_1.useColorScheme; } });
6
8
  var use_toggle_color_scheme_1 = require("./use-toggle-color-scheme");
7
9
  Object.defineProperty(exports, "useToggleColorScheme", { enumerable: true, get: function () { return use_toggle_color_scheme_1.useToggleColorScheme; } });
@@ -0,0 +1 @@
1
+ export declare function useColorScheme(): () => "dark" | "light" | undefined;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useColorScheme = void 0;
4
+ const isServer_1 = require("@uxf/core/utils/isServer");
5
+ function useColorScheme() {
6
+ return () => {
7
+ if (isServer_1.isServer) {
8
+ return;
9
+ }
10
+ const bodyClassList = document.body.classList;
11
+ if (bodyClassList.contains("light")) {
12
+ return "light";
13
+ }
14
+ if (bodyClassList.contains("dark")) {
15
+ return "dark";
16
+ }
17
+ };
18
+ }
19
+ exports.useColorScheme = useColorScheme;