@uxf/ui 10.0.0-beta.8 → 10.0.0-beta.80

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 (370) hide show
  1. package/_file-input-base/file-input-base.js +15 -1
  2. package/_file-input-base/index.d.ts +1 -1
  3. package/_input-with-popover/input-with-popover.d.ts +4 -3
  4. package/_input-with-popover/input-with-popover.js +26 -26
  5. package/_select-base/_select-base.d.ts +2 -2
  6. package/_select-base/_select-base.js +4 -3
  7. package/_select-base/index.d.ts +1 -1
  8. package/alert-bubble/alert-bubble.d.ts +8 -0
  9. package/alert-bubble/alert-bubble.js +22 -0
  10. package/alert-bubble/alert-bubble.spec.d.ts +1 -0
  11. package/alert-bubble/alert-bubble.spec.js +9 -0
  12. package/alert-bubble/alert-bubble.stories.d.ts +7 -0
  13. package/alert-bubble/alert-bubble.stories.js +50 -0
  14. package/alert-bubble/index.d.ts +3 -0
  15. package/alert-bubble/index.js +5 -0
  16. package/alert-bubble/theme.d.ts +16 -0
  17. package/alert-bubble/theme.js +2 -0
  18. package/avatar/README.md +8 -0
  19. package/avatar/avatar.stories.js +1 -1
  20. package/avatar/index.d.ts +1 -1
  21. package/avatar-file-input/README.md +1 -0
  22. package/avatar-file-input/avatar-file-input.d.ts +3 -0
  23. package/avatar-file-input/avatar-file-input.js +12 -6
  24. package/avatar-file-input/avatar-file-input.stories.js +5 -5
  25. package/avatar-file-input/index.d.ts +1 -1
  26. package/avatar-file-input/theme.d.ts +5 -0
  27. package/avatar-file-input/theme.js +2 -0
  28. package/badge/README.md +1 -0
  29. package/badge/badge.d.ts +1 -1
  30. package/badge/badge.stories.js +1 -1
  31. package/badge/index.d.ts +1 -1
  32. package/button/README.md +68 -0
  33. package/button/button.stories.js +0 -1
  34. package/button/index.d.ts +1 -1
  35. package/button/theme.d.ts +1 -0
  36. package/button-group/README.md +1 -0
  37. package/button-group/button-group.js +1 -1
  38. package/button-group/button-group.stories.js +1 -1
  39. package/button-group/index.d.ts +1 -1
  40. package/button-list/README.md +1 -0
  41. package/button-list/button-list.d.ts +1 -1
  42. package/button-list/button-list.js +22 -22
  43. package/button-list/index.d.ts +1 -1
  44. package/calendar/README.md +1 -0
  45. package/calendar/calendar-day-cell.d.ts +4 -1
  46. package/calendar/calendar-day-cell.js +18 -18
  47. package/{date-picker/date-picker-navigation.d.ts → calendar/calendar-navigation.d.ts} +2 -3
  48. package/{date-picker/date-picker-navigation.js → calendar/calendar-navigation.js} +6 -6
  49. package/calendar/calendar-provider.js +2 -2
  50. package/calendar/calendar.d.ts +5 -0
  51. package/calendar/calendar.js +6 -9
  52. package/calendar/calendar.stories.js +1 -1
  53. package/calendar/index.d.ts +4 -1
  54. package/calendar/index.js +5 -15
  55. package/checkbox/README.md +1 -0
  56. package/checkbox/checkbox.stories.js +1 -1
  57. package/checkbox/index.d.ts +1 -1
  58. package/checkbox-button/README.md +1 -0
  59. package/checkbox-button/checkbox-button.js +2 -2
  60. package/checkbox-button/checkbox-button.stories.js +1 -1
  61. package/checkbox-button/index.d.ts +1 -1
  62. package/checkbox-input/README.md +1 -0
  63. package/checkbox-input/checkbox-input.d.ts +1 -1
  64. package/checkbox-input/checkbox-input.stories.js +1 -1
  65. package/checkbox-input/index.d.ts +1 -1
  66. package/chip/README.md +1 -0
  67. package/chip/chip.d.ts +1 -1
  68. package/chip/chip.js +7 -5
  69. package/chip/chip.stories.js +37 -28
  70. package/chip/index.d.ts +2 -2
  71. package/color-radio/README.md +8 -0
  72. package/color-radio/color-radio.js +1 -1
  73. package/color-radio/index.d.ts +1 -1
  74. package/color-radio-group/README.md +9 -0
  75. package/color-radio-group/color-radio-group.js +3 -3
  76. package/color-radio-group/color-radio-group.stories.js +1 -1
  77. package/color-radio-group/index.d.ts +1 -1
  78. package/combobox/README.md +12 -0
  79. package/combobox/combobox.d.ts +1 -1
  80. package/combobox/combobox.stories.d.ts +2 -1
  81. package/combobox/combobox.stories.js +7 -3
  82. package/combobox/index.d.ts +1 -1
  83. package/config/icons-config.d.ts +1 -1
  84. package/config/icons-config.js +1 -1
  85. package/config/icons.d.ts +13 -3
  86. package/config/icons.js +3 -1
  87. package/content/types.d.ts +1 -1
  88. package/context/provider.js +1 -1
  89. package/css/alert-bubble.css +100 -0
  90. package/css/avatar-file-input.css +54 -20
  91. package/css/avatar.css +4 -4
  92. package/css/badge.css +5 -5
  93. package/css/button-group.css +1 -1
  94. package/css/button-list.css +2 -2
  95. package/css/button.css +78 -32
  96. package/css/calendar.css +115 -51
  97. package/css/checkbox-button.css +10 -10
  98. package/css/checkbox.css +9 -9
  99. package/css/chip.css +217 -318
  100. package/css/color-radio-group.css +1 -1
  101. package/css/color-radio.css +3 -3
  102. package/css/component-structure-analyzer.css +12 -12
  103. package/css/date-picker.css +10 -3
  104. package/css/date-range-picker.css +21 -0
  105. package/css/datetime-picker.css +2 -2
  106. package/css/dialog.css +55 -0
  107. package/css/dropdown.css +11 -3
  108. package/css/dropzone.css +6 -6
  109. package/css/error-message.css +1 -1
  110. package/css/file-input.css +2 -2
  111. package/css/flash-messages.css +133 -9
  112. package/css/icon.css +1 -1
  113. package/css/image-gallery.css +8 -8
  114. package/css/input-with-popover.css +1 -1
  115. package/css/input.css +10 -10
  116. package/css/layout.css +4 -4
  117. package/css/list-item.css +2 -2
  118. package/css/message.css +92 -0
  119. package/css/modal.css +10 -54
  120. package/css/multi-combobox.css +12 -12
  121. package/css/pagination.css +14 -14
  122. package/css/paper.css +1 -1
  123. package/css/radio-group.css +3 -3
  124. package/css/radio.css +7 -7
  125. package/css/raster-image.css +1 -1
  126. package/css/select-base.css +1 -1
  127. package/css/tabs.css +16 -16
  128. package/css/text-link.css +4 -4
  129. package/css/textarea.css +68 -76
  130. package/css/time-picker.css +12 -16
  131. package/css/toggle.css +3 -3
  132. package/css/tooltip.css +2 -2
  133. package/date-picker/README.md +9 -0
  134. package/date-picker/date-picker-content.d.ts +5 -2
  135. package/date-picker/date-picker-content.js +4 -3
  136. package/date-picker/date-picker-decade.js +10 -10
  137. package/date-picker/date-picker-month.js +6 -6
  138. package/date-picker/date-picker-year.js +2 -2
  139. package/date-picker/date-picker.d.ts +4 -1
  140. package/date-picker/date-picker.js +4 -2
  141. package/date-picker/index.d.ts +1 -1
  142. package/date-picker-input/README.md +11 -0
  143. package/date-picker-input/date-picker-input.d.ts +2 -0
  144. package/date-picker-input/date-picker-input.js +5 -3
  145. package/date-picker-input/date-picker-input.stories.js +1 -1
  146. package/date-picker-input/index.d.ts +1 -1
  147. package/date-picker-input/index.js +3 -3
  148. package/date-range-picker/README.md +1 -0
  149. package/date-range-picker/date-range-picker-content.d.ts +5 -0
  150. package/date-range-picker/date-range-picker-content.js +56 -0
  151. package/date-range-picker/date-range-picker-decade.d.ts +6 -0
  152. package/date-range-picker/date-range-picker-decade.js +72 -0
  153. package/date-range-picker/date-range-picker-month.d.ts +8 -0
  154. package/date-range-picker/date-range-picker-month.js +69 -0
  155. package/date-range-picker/date-range-picker-year.d.ts +7 -0
  156. package/date-range-picker/date-range-picker-year.js +80 -0
  157. package/date-range-picker/date-range-picker.d.ts +11 -0
  158. package/date-range-picker/date-range-picker.js +51 -0
  159. package/date-range-picker/date-range-picker.spec.d.ts +1 -0
  160. package/date-range-picker/date-range-picker.spec.js +9 -0
  161. package/date-range-picker/date-range-picker.stories.d.ts +7 -0
  162. package/date-range-picker/date-range-picker.stories.js +43 -0
  163. package/date-range-picker/index.d.ts +3 -0
  164. package/date-range-picker/index.js +5 -0
  165. package/date-range-picker/types.d.ts +5 -0
  166. package/date-range-picker/types.js +2 -0
  167. package/date-range-picker-input/README.md +1 -0
  168. package/date-range-picker-input/date-range-picker-input.d.ts +17 -0
  169. package/date-range-picker-input/date-range-picker-input.js +62 -0
  170. package/date-range-picker-input/date-range-picker-input.spec.d.ts +1 -0
  171. package/date-range-picker-input/date-range-picker-input.spec.js +9 -0
  172. package/date-range-picker-input/date-range-picker-input.stories.d.ts +10 -0
  173. package/date-range-picker-input/date-range-picker-input.stories.js +53 -0
  174. package/date-range-picker-input/index.d.ts +2 -0
  175. package/date-range-picker-input/index.js +5 -0
  176. package/datetime-picker/README.md +13 -0
  177. package/datetime-picker/datetime-picker.d.ts +3 -1
  178. package/datetime-picker/datetime-picker.js +5 -5
  179. package/datetime-picker/index.d.ts +1 -1
  180. package/datetime-picker/index.js +2 -2
  181. package/datetime-picker-input/README.md +1 -0
  182. package/datetime-picker-input/datetime-picker-input.d.ts +2 -0
  183. package/datetime-picker-input/datetime-picker-input.js +5 -3
  184. package/datetime-picker-input/datetime-picker-input.stories.js +1 -1
  185. package/datetime-picker-input/index.d.ts +1 -1
  186. package/datetime-picker-input/index.js +2 -2
  187. package/dialog/dialog.d.ts +9 -0
  188. package/{modal/modal-dialog.js → dialog/dialog.js} +8 -9
  189. package/dialog/dialog.spec.d.ts +1 -0
  190. package/dialog/dialog.spec.js +9 -0
  191. package/dialog/dialog.stories.d.ts +7 -0
  192. package/dialog/dialog.stories.js +47 -0
  193. package/dialog/index.d.ts +2 -0
  194. package/dialog/index.js +5 -0
  195. package/dropdown/README.md +1 -0
  196. package/dropdown/dropdown.stories.js +2 -2
  197. package/dropdown/index.d.ts +1 -1
  198. package/dropzone/README.md +8 -0
  199. package/dropzone/dropzone-input.js +10 -6
  200. package/dropzone/dropzone.stories.js +7 -7
  201. package/error-message/README.md +7 -0
  202. package/error-message/error-message.stories.js +1 -1
  203. package/file-input/README.md +11 -0
  204. package/file-input/file-input.d.ts +3 -0
  205. package/file-input/file-input.js +10 -22
  206. package/file-input/file-input.stories.js +5 -5
  207. package/file-input/index.d.ts +1 -1
  208. package/flash-messages/README.md +23 -0
  209. package/flash-messages/flash-message.d.ts +1 -1
  210. package/flash-messages/flash-message.js +1 -1
  211. package/flash-messages/flash-messages.js +52 -18
  212. package/flash-messages/flash-messages.stories.js +12 -0
  213. package/flash-messages/index.d.ts +2 -2
  214. package/flash-messages/index.js +4 -4
  215. package/form-component/README.md +7 -0
  216. package/form-component/index.d.ts +1 -1
  217. package/hooks/use-dropdown.d.ts +16 -8
  218. package/icon/README.md +11 -0
  219. package/icon/icon.stories.js +1 -1
  220. package/icon/index.d.ts +1 -1
  221. package/image-gallery/components/close-button.d.ts +2 -1
  222. package/image-gallery/components/close-button.js +2 -3
  223. package/image-gallery/components/gallery.d.ts +4 -1
  224. package/image-gallery/components/gallery.js +6 -5
  225. package/image-gallery/components/next-button.d.ts +7 -0
  226. package/image-gallery/components/next-button.js +14 -0
  227. package/image-gallery/components/prev-button.d.ts +7 -0
  228. package/image-gallery/components/prev-button.js +14 -0
  229. package/image-gallery/image-gallery.d.ts +4 -1
  230. package/image-gallery/image-gallery.js +2 -2
  231. package/image-gallery/image-gallery.stories.js +5 -1
  232. package/image-gallery/image.d.ts +1 -1
  233. package/image-gallery/image.js +1 -1
  234. package/image-gallery/use-image.js +1 -1
  235. package/input/README.md +8 -0
  236. package/input/input-element.d.ts +1 -0
  237. package/input/input-element.js +1 -1
  238. package/input/input.d.ts +2 -2
  239. package/input/input.js +3 -3
  240. package/input/input.stories.js +3 -3
  241. package/label/README.md +7 -0
  242. package/label/index.d.ts +1 -1
  243. package/label/label.stories.js +1 -1
  244. package/layout/index.d.ts +1 -1
  245. package/layout/layout.js +28 -28
  246. package/list-item/README.md +7 -0
  247. package/list-item/index.d.ts +1 -1
  248. package/list-item/list-item.stories.js +1 -1
  249. package/loader/README.md +7 -0
  250. package/loader/index.d.ts +1 -1
  251. package/message/README.md +1 -0
  252. package/message/index.d.ts +3 -0
  253. package/message/index.js +7 -0
  254. package/message/message-content.d.ts +17 -0
  255. package/message/message-content.js +41 -0
  256. package/message/message-service.d.ts +13 -0
  257. package/message/message-service.js +29 -0
  258. package/message/message.d.ts +20 -0
  259. package/message/message.js +47 -0
  260. package/message/message.spec.d.ts +1 -0
  261. package/message/message.spec.js +9 -0
  262. package/message/message.stories.d.ts +7 -0
  263. package/message/message.stories.js +82 -0
  264. package/message/theme.d.ts +12 -0
  265. package/message/theme.js +2 -0
  266. package/modal/README.md +24 -0
  267. package/modal/index.d.ts +3 -2
  268. package/modal/index.js +3 -3
  269. package/modal/modal.d.ts +5 -4
  270. package/modal/modal.js +9 -9
  271. package/modal/modal.stories.js +12 -0
  272. package/modal/theme.d.ts +3 -0
  273. package/multi-combobox/README.md +10 -0
  274. package/multi-combobox/_multi-combobox-base.js +28 -22
  275. package/multi-combobox/multi-combobox.js +1 -1
  276. package/multi-combobox/multi-combobox.stories.js +7 -4
  277. package/multi-combobox/types.d.ts +5 -1
  278. package/multi-select/README.md +11 -0
  279. package/multi-select/_multi-select-base.js +21 -21
  280. package/multi-select/index.d.ts +1 -1
  281. package/multi-select/multi-select.js +1 -1
  282. package/multi-select/multi-select.stories.js +6 -3
  283. package/multi-select/types.d.ts +1 -1
  284. package/package.json +17 -10
  285. package/pagination/README.md +31 -0
  286. package/pagination/index.d.ts +1 -1
  287. package/pagination/pagination.d.ts +1 -1
  288. package/pagination/pagination.js +2 -2
  289. package/pagination/pagination.stories.d.ts +0 -3
  290. package/pagination/pagination.stories.js +14 -30
  291. package/paper/README.md +7 -0
  292. package/paper/index.d.ts +1 -1
  293. package/paper/paper.stories.js +1 -1
  294. package/radio/README.md +7 -0
  295. package/radio/index.d.ts +1 -1
  296. package/radio/radio.stories.js +1 -1
  297. package/radio-group/README.md +8 -0
  298. package/radio-group/index.d.ts +2 -2
  299. package/radio-group/radio-group.d.ts +3 -3
  300. package/radio-group/radio-group.js +2 -2
  301. package/radio-group/radio-group.stories.js +5 -5
  302. package/raster-image/README.md +7 -0
  303. package/raster-image/index.d.ts +1 -1
  304. package/raster-image/raster-image.js +1 -1
  305. package/scripts/generate-tw-tokens.js +40 -32
  306. package/select/README.md +11 -0
  307. package/select/index.d.ts +1 -1
  308. package/select/select.d.ts +1 -1
  309. package/select/select.js +1 -1
  310. package/select/select.stories.d.ts +2 -1
  311. package/select/select.stories.js +9 -3
  312. package/tabs/README.md +7 -0
  313. package/tabs/index.d.ts +1 -1
  314. package/text-input/README.md +10 -0
  315. package/text-input/index.d.ts +1 -1
  316. package/text-input/text-input.d.ts +1 -0
  317. package/text-input/text-input.js +2 -2
  318. package/text-link/README.md +19 -0
  319. package/text-link/index.d.ts +1 -1
  320. package/text-link/text-link.d.ts +1 -1
  321. package/textarea/README.md +9 -0
  322. package/textarea/index.d.ts +1 -1
  323. package/textarea/textarea.js +5 -5
  324. package/textarea/textarea.stories.js +1 -1
  325. package/time-picker/README.md +8 -0
  326. package/time-picker/index.d.ts +1 -1
  327. package/time-picker/time-picker-hour.js +6 -6
  328. package/time-picker/time-picker-hours.js +2 -2
  329. package/time-picker/time-picker-minute.js +6 -6
  330. package/time-picker/time-picker-minutes.js +2 -2
  331. package/time-picker/time-picker.d.ts +2 -1
  332. package/time-picker/time-picker.js +7 -6
  333. package/time-picker-input/README.md +9 -0
  334. package/time-picker-input/index.d.ts +1 -1
  335. package/time-picker-input/index.js +3 -3
  336. package/time-picker-input/time-picker-input.js +6 -4
  337. package/time-picker-input/time-picker-input.stories.js +1 -1
  338. package/toggle/README.md +7 -0
  339. package/toggle/index.d.ts +1 -1
  340. package/toggle/toggle.js +8 -8
  341. package/toggle/toggle.stories.js +1 -1
  342. package/tooltip/README.md +7 -0
  343. package/tooltip/index.d.ts +2 -2
  344. package/tooltip/tooltip.js +27 -25
  345. package/tooltip/tooltip.stories.js +1 -1
  346. package/tooltip/use-tooltip.d.ts +19 -11
  347. package/tooltip/use-tooltip.js +15 -15
  348. package/tw-tokens/tw-colors.d.ts +283 -282
  349. package/tw-tokens/tw-colors.js +283 -282
  350. package/tw-tokens/tw-line-height.d.ts +8 -8
  351. package/tw-tokens/tw-line-height.js +8 -8
  352. package/tw-tokens/tw-spacing.d.ts +34 -34
  353. package/tw-tokens/tw-spacing.js +34 -34
  354. package/tw-tokens/tw-z-index.d.ts +7 -7
  355. package/tw-tokens/tw-z-index.js +7 -7
  356. package/types/index.d.ts +1 -1
  357. package/types/index.js +1 -1
  358. package/typography/README.md +7 -0
  359. package/utils/action.d.ts +2 -1
  360. package/utils/action.js +2 -2
  361. package/utils/icons-config.js +13 -3
  362. package/utils/mocks/{uploadFIle.mock.js → upload-file.mock.js} +1 -1
  363. package/utils/snap-test.js +1 -1
  364. package/utils/storybook-config.d.ts +12 -2
  365. package/utils/storybook-config.js +9 -1
  366. package/utils/tailwind-config.js +10 -1
  367. package/image-gallery/components/arrow-button.d.ts +0 -7
  368. package/image-gallery/components/arrow-button.js +0 -14
  369. package/modal/modal-dialog.d.ts +0 -11
  370. /package/utils/mocks/{uploadFIle.mock.d.ts → upload-file.mock.d.ts} +0 -0
@@ -24,7 +24,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports._MultiSelectBase = void 0;
27
- const react_1 = require("@headlessui/react");
27
+ const react_1 = require("@floating-ui/react");
28
+ const react_2 = require("@headlessui/react");
28
29
  const classes_1 = require("@uxf/core/constants/classes");
29
30
  const useInputFocus_1 = require("@uxf/core/hooks/useInputFocus");
30
31
  const composeRefs_1 = require("@uxf/core/utils/composeRefs");
@@ -33,14 +34,13 @@ const icon_1 = require("@uxf/ui//icon");
33
34
  const chip_1 = require("@uxf/ui/chip");
34
35
  const use_dropdown_1 = require("@uxf/ui/hooks/use-dropdown");
35
36
  const label_1 = require("@uxf/ui/label");
36
- const react_2 = __importStar(require("react"));
37
- const react_3 = require("@floating-ui/react");
38
- exports._MultiSelectBase = (0, react_2.forwardRef)((props, ref) => {
37
+ const react_3 = __importStar(require("react"));
38
+ exports._MultiSelectBase = (0, react_3.forwardRef)((props, ref) => {
39
39
  var _a, _b, _c;
40
- const innerRef = (0, react_2.useRef)(null);
40
+ const innerRef = (0, react_3.useRef)(null);
41
41
  const input = (0, useInputFocus_1.useInputFocus)(innerRef, props.onBlur, props.onFocus);
42
42
  const dropdown = (0, use_dropdown_1.useDropdown)((_a = props.dropdownPlacement) !== null && _a !== void 0 ? _a : "bottom", true, props.dropdownStrategy);
43
- const stableRef = (0, react_2.useMemo)(() => (0, composeRefs_1.composeRefs)(innerRef, ref, dropdown.refs.setReference), [ref, dropdown.refs.setReference]);
43
+ const stableRef = (0, react_3.useMemo)(() => (0, composeRefs_1.composeRefs)(innerRef, ref, dropdown.refs.setReference), [ref, dropdown.refs.setReference]);
44
44
  const iconName = (_b = props.iconName) !== null && _b !== void 0 ? _b : "caretDown";
45
45
  const selectedOptions = (_c = props.value) !== null && _c !== void 0 ? _c : [];
46
46
  const filteredOptions = props.options.filter((option) => !selectedOptions.map((i) => i.id).includes(option.id));
@@ -54,25 +54,25 @@ exports._MultiSelectBase = (0, react_2.forwardRef)((props, ref) => {
54
54
  props.onChange((_b = (_a = props.value) === null || _a === void 0 ? void 0 : _a.filter((v) => v.id !== valueId)) !== null && _b !== void 0 ? _b : []);
55
55
  };
56
56
  const withoutPopover = !props.withPopover;
57
- return (react_2.default.createElement(react_1.Listbox, { as: "div", className: (0, cx_1.cx)(withoutPopover && "uxf-form-component", "uxf-multi-combobox", props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isRequired && classes_1.CLASSES.IS_REQUIRED, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.className), disabled: props.isDisabled || props.isReadOnly, multiple: true, onChange: handleSelectValueChange, value: selectedOptions }, (renderProps) => {
57
+ return (react_3.default.createElement(react_2.Listbox, { as: "div", className: (0, cx_1.cx)(withoutPopover && "uxf-form-component", "uxf-multi-combobox", props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isRequired && classes_1.CLASSES.IS_REQUIRED, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.className), disabled: props.isDisabled || props.isReadOnly, multiple: true, onChange: handleSelectValueChange, value: selectedOptions }, (renderProps) => {
58
58
  var _a, _b;
59
- const inputElement = (react_2.default.createElement(react_2.default.Fragment, null,
60
- react_2.default.createElement(react_1.Listbox.Button, { "aria-invalid": props.isInvalid, "aria-describedby": props.errorId, as: "div", className: (0, cx_1.cx)("uxf-multi-combobox__button", (renderProps.open || input.focused) && classes_1.CLASSES.IS_FOCUSED, renderProps.disabled && classes_1.CLASSES.IS_DISABLED, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isInvalid && classes_1.CLASSES.IS_INVALID, dropdown.placement === "bottom" && `${classes_1.CLASSES.IS_OPEN}--bottom`, dropdown.placement === "top" && `${classes_1.CLASSES.IS_OPEN}--top`, renderProps.open && classes_1.CLASSES.IS_OPEN), onBlur: input.onBlur, onFocus: input.onFocus, tabIndex: props.isDisabled || props.isReadOnly ? undefined : 0, ref: stableRef },
61
- react_2.default.createElement("div", { className: (0, cx_1.cx)("uxf-multi-select__input", selectedOptions.length === 0 && "uxf-multi-select__input--is-empty") }, selectedOptions.length === 0
59
+ const inputElement = (react_3.default.createElement(react_3.default.Fragment, null,
60
+ react_3.default.createElement(react_2.Listbox.Button, { "aria-invalid": props.isInvalid, "aria-describedby": props.errorId, as: "div", className: (0, cx_1.cx)("uxf-multi-combobox__button", (renderProps.open || input.focused) && classes_1.CLASSES.IS_FOCUSED, renderProps.disabled && classes_1.CLASSES.IS_DISABLED, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isInvalid && classes_1.CLASSES.IS_INVALID, dropdown.placement === "bottom" && `${classes_1.CLASSES.IS_OPEN}--bottom`, dropdown.placement === "top" && `${classes_1.CLASSES.IS_OPEN}--top`, renderProps.open && classes_1.CLASSES.IS_OPEN), onBlur: input.onBlur, onFocus: input.onFocus, tabIndex: props.isDisabled || props.isReadOnly ? undefined : 0, ref: stableRef },
61
+ react_3.default.createElement("div", { className: (0, cx_1.cx)("uxf-multi-select__input", selectedOptions.length === 0 && "uxf-multi-select__input--is-empty") }, selectedOptions.length === 0
62
62
  ? props.placeholder
63
- : selectedOptions.map((item) => (react_2.default.createElement(chip_1.Chip, { className: "uxf-multi-combobox__input-chip", color: item.color, key: item.id, onClose: handleRemove(item.id), size: "large", suppressFocus: true }, item.label)))),
64
- react_2.default.createElement(icon_1.Icon, { className: (0, cx_1.cx)("uxf-select-base__arrow-icon", renderProps.open && classes_1.CLASSES.IS_OPEN), name: iconName })),
65
- renderProps.open && (react_2.default.createElement(react_3.FloatingPortal, null,
66
- react_2.default.createElement(react_1.Listbox.Options, { className: (0, cx_1.cx)("uxf-dropdown", `uxf-dropdown--size-${(_a = props.size) !== null && _a !== void 0 ? _a : "default"}`, `uxf-dropdown--variant-${(_b = props.variant) !== null && _b !== void 0 ? _b : "default"}`, dropdown.placement === "bottom" && "uxf-dropdown--bottom", dropdown.placement === "top" && "uxf-dropdown--top"), ref: dropdown.refs.setFloating, static: true, style: dropdown.floatingStyles }, filteredOptions.map((option) => {
67
- var _a;
63
+ : selectedOptions.map((item) => (react_3.default.createElement(chip_1.Chip, { className: "uxf-multi-combobox__input-chip", color: item.color, key: item.id, onClose: handleRemove(item.id), size: "large", suppressFocus: true }, item.label)))),
64
+ react_3.default.createElement(icon_1.Icon, { className: (0, cx_1.cx)("uxf-select-base__arrow-icon", renderProps.open && classes_1.CLASSES.IS_OPEN), name: iconName })),
65
+ renderProps.open && (react_3.default.createElement(react_1.FloatingPortal, null,
66
+ react_3.default.createElement(react_2.Listbox.Options, { className: (0, cx_1.cx)("uxf-dropdown", `uxf-dropdown--size-${(_a = props.size) !== null && _a !== void 0 ? _a : "default"}`, `uxf-dropdown--variant-${(_b = props.variant) !== null && _b !== void 0 ? _b : "default"}`, dropdown.placement === "bottom" && "uxf-dropdown--bottom", dropdown.placement === "top" && "uxf-dropdown--top"), ref: dropdown.refs.setFloating, static: true, style: dropdown.floatingStyles }, filteredOptions.map((option) => {
67
+ var _a, _b, _c;
68
68
  const optionKey = (_a = props.keyExtractor) === null || _a === void 0 ? void 0 : _a.call(props, option);
69
- return (react_2.default.createElement(react_1.Listbox.Option, { className: (optionState) => (0, cx_1.cx)("uxf-dropdown__item uxf-multi-select__dropdown-item", optionState.active && classes_1.CLASSES.IS_ACTIVE, optionState.disabled && classes_1.CLASSES.IS_DISABLED, optionState.selected && classes_1.CLASSES.IS_SELECTED), key: optionKey !== null && optionKey !== void 0 ? optionKey : option.id, value: option }, optionKey !== null && optionKey !== void 0 ? optionKey : option.label));
69
+ return (react_3.default.createElement(react_2.Listbox.Option, { className: (optionState) => (0, cx_1.cx)("uxf-dropdown__item uxf-multi-select__dropdown-item", optionState.active && classes_1.CLASSES.IS_ACTIVE, optionState.disabled && classes_1.CLASSES.IS_DISABLED, optionState.selected && classes_1.CLASSES.IS_SELECTED), key: optionKey !== null && optionKey !== void 0 ? optionKey : option.id, value: option, disabled: option.disabled }, (_c = (_b = props.renderOption) === null || _b === void 0 ? void 0 : _b.call(props, option)) !== null && _c !== void 0 ? _c : option.label));
70
70
  })))),
71
- props.helperText && withoutPopover && (react_2.default.createElement("div", { className: (0, cx_1.cx)("uxf-helper-text", props.isInvalid && classes_1.CLASSES.IS_INVALID), id: props.errorId }, props.helperText))));
72
- return (react_2.default.createElement(react_2.default.Fragment, null, withoutPopover ? (react_2.default.createElement(react_2.default.Fragment, null,
73
- react_2.default.createElement("div", { className: "uxf-form-component__label" },
74
- react_2.default.createElement(react_1.Listbox.Label, { as: label_1.Label, isHidden: props.hiddenLabel, onClick: props.isDisabled || props.isReadOnly ? undefined : input.focus }, props.label)),
75
- react_2.default.createElement("div", { className: "uxf-form-component__input" }, inputElement))) : (inputElement)));
71
+ props.helperText && withoutPopover && (react_3.default.createElement("div", { className: (0, cx_1.cx)("uxf-helper-text", props.isInvalid && classes_1.CLASSES.IS_INVALID), id: props.errorId }, props.helperText))));
72
+ return (react_3.default.createElement(react_3.default.Fragment, null, withoutPopover ? (react_3.default.createElement(react_3.default.Fragment, null,
73
+ react_3.default.createElement("div", { className: "uxf-form-component__label" },
74
+ react_3.default.createElement(react_2.Listbox.Label, { as: label_1.Label, isHidden: props.hiddenLabel, onClick: props.isDisabled || props.isReadOnly ? undefined : input.focus }, props.label)),
75
+ react_3.default.createElement("div", { className: "uxf-form-component__input" }, inputElement))) : (inputElement)));
76
76
  }));
77
77
  });
78
78
  exports._MultiSelectBase.displayName = "UxfUiMultiSelectBase";
@@ -1,2 +1,2 @@
1
1
  export { MultiSelect } from "./multi-select";
2
- export type { MultiSelectOption, MultiSelectProps, MultiSelectValueId, MultiSelectTypeRef } from "./types";
2
+ export type { MultiSelectOption, MultiSelectProps, MultiSelectTypeRef, MultiSelectValueId } from "./types";
@@ -27,9 +27,9 @@ exports.MultiSelect = void 0;
27
27
  const react_1 = require("@headlessui/react");
28
28
  const classes_1 = require("@uxf/core/constants/classes");
29
29
  const cx_1 = require("@uxf/core/utils/cx");
30
- const form_component_1 = require("../form-component");
31
30
  const icon_1 = require("@uxf/ui/icon");
32
31
  const react_2 = __importStar(require("react"));
32
+ const form_component_1 = require("../form-component");
33
33
  const _multi_select_base_1 = require("./_multi-select-base");
34
34
  exports.MultiSelect = (0, react_2.forwardRef)((props, ref) => {
35
35
  var _a, _b, _c;
@@ -29,8 +29,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.ComponentStructure = exports.Default = void 0;
30
30
  const component_structure_analyzer_1 = __importDefault(require("@uxf/ui/utils/component-structure-analyzer"));
31
31
  const react_1 = __importStar(require("react"));
32
- const index_1 = require("./index");
33
32
  const action_1 = require("../utils/action");
33
+ const index_1 = require("./index");
34
34
  exports.default = {
35
35
  title: "UI/MultiSelect",
36
36
  component: index_1.MultiSelect,
@@ -40,7 +40,7 @@ const options = [
40
40
  { id: "two", label: "Option blue", color: "blue" },
41
41
  { id: "three", label: "Option green", color: "green" },
42
42
  { id: "four", label: "Option four" },
43
- { id: "five", label: "Option five" },
43
+ { id: "five", label: "Option five disabled", disabled: true },
44
44
  { id: "six", label: "Option with diacritics (ěščřžýáíé)" },
45
45
  ];
46
46
  const Default = () => {
@@ -52,7 +52,10 @@ const Default = () => {
52
52
  });
53
53
  const component = (react_1.default.createElement(react_1.default.Fragment, null,
54
54
  react_1.default.createElement(index_1.MultiSelect, { id: "multi-select-1", label: "MultiSelect", name: "multi-select", onChange: onChange, options: options, placeholder: "Vyberte pros\u00EDm jednu nebo v\u00EDce mo\u017Enost\u00ED", value: value }),
55
- react_1.default.createElement(index_1.MultiSelect, { id: "multi-select-2", label: "MultiSelect with popover", name: "multi-select", onChange: onChange, options: options, placeholder: "Vyberte...", value: value, withPopover: true })));
55
+ react_1.default.createElement(index_1.MultiSelect, { id: "multi-select-2", label: "MultiSelect with popover", name: "multi-select", onChange: onChange, options: options, placeholder: "Vyberte...", value: value, withPopover: true }),
56
+ react_1.default.createElement(index_1.MultiSelect, { id: "multi-select-3", label: "MultiSelect with renderOption", name: "multi-select", onChange: onChange, options: options, placeholder: "Vyberte...", value: value, renderOption: (option) => react_1.default.createElement(react_1.default.Fragment, null,
57
+ "Option: ",
58
+ option.label) })));
56
59
  return (react_1.default.createElement("div", { className: "flex flex-col lg:flex-row" },
57
60
  react_1.default.createElement("div", { className: "light space-y-2 p-20 lg:w-1/2" }, component),
58
61
  react_1.default.createElement("div", { className: "dark space-y-2 bg-gray-900 p-20 lg:w-1/2" }, component)));
@@ -1,9 +1,9 @@
1
1
  import { Placement, Strategy } from "@floating-ui/react";
2
+ import { InputGroupSizes, InputGroupVariants } from "@uxf/ui/input/theme";
2
3
  import { ReactNode } from "react";
3
4
  import { ChipColor } from "../chip";
4
5
  import { IconsSet } from "../icon/theme";
5
6
  import { FormControlProps } from "../types";
6
- import { InputGroupSizes, InputGroupVariants } from "@uxf/ui/input/theme";
7
7
  export type MultiSelectValueId = number | string;
8
8
  export type MultiSelectOption<T = MultiSelectValueId> = {
9
9
  color?: ChipColor;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/ui",
3
- "version": "10.0.0-beta.8",
3
+ "version": "10.0.0-beta.80",
4
4
  "description": "",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -8,24 +8,31 @@
8
8
  "scripts": {
9
9
  "prepareCss": "rm -rf ./css && mkdir css && cp ./**/*.css ./css/",
10
10
  "build": "npm run prepareCss && tsc -P tsconfig.json",
11
+ "tw-tokens:check": "ts-node ./scripts/generate-tw-tokens.js --mode=\"check\" --twConfig=\"./utils/tailwind-config.js\" --outputPath=\"./tw-tokens/\"",
12
+ "tw-tokens:gen": "ts-node ./scripts/generate-tw-tokens.js --twConfig=\"./utils/tailwind-config.js\" --outputPath=\"./tw-tokens/\"",
11
13
  "typecheck": "../../node_modules/.bin/tsc --noEmit --skipLibCheck"
12
14
  },
13
15
  "author": "UX Fans s.r.o",
14
16
  "license": "MIT",
15
17
  "dependencies": {
16
- "@floating-ui/react": "0.24.2",
18
+ "@floating-ui/react": "0.26.0",
17
19
  "@headlessui/react": "1.7.14",
18
- "@uxf/core": "10.0.0-beta.8",
19
- "@uxf/datepicker": "1.2.1",
20
- "@uxf/styles": "2.1.2",
21
- "color2k": "^2.0.2",
22
- "dayjs": "^1.11.7",
23
- "jump.js": "^1.0.2",
20
+ "@uxf/core": "10.0.0-beta.80",
21
+ "@uxf/datepicker": "10.0.0-beta.80",
22
+ "@uxf/styles": "10.0.0-beta.80",
23
+ "color2k": "2.0.2",
24
+ "dayjs": "1.11.10",
25
+ "jump.js": "1.0.2",
24
26
  "react-dropzone": "14.2.3",
25
27
  "react-swipeable": "7.0.1"
26
28
  },
29
+ "peerDependencies": {
30
+ "react": ">= 18.2.0",
31
+ "react-dom": ">= 18.2.0"
32
+ },
27
33
  "devDependencies": {
28
- "@types/jump.js": "^1.0.4",
29
- "@uxf/icons-generator": "^1.3.0"
34
+ "@types/jump.js": "1.0.4",
35
+ "@types/react": "18.2.27",
36
+ "@types/react-dom": "18.2.12"
30
37
  }
31
38
  }
@@ -0,0 +1,31 @@
1
+ # Pagination
2
+
3
+ ## CSS dependencies
4
+
5
+ ```css
6
+ @import url("@uxf/ui/pagination/pagination.css");
7
+ @import url("@uxf/ui/icon/icon.css");
8
+ ```
9
+
10
+ ## Required icons
11
+
12
+ - `chevronsLeft`
13
+ - `chevronLeft`
14
+ - `chevronRight`
15
+ - `chevronsRight`
16
+
17
+ ## Props configuration
18
+
19
+ ```tsx
20
+ // pagination.d.ts
21
+
22
+ declare module "@uxf/ui/pagination/theme" {
23
+ export interface PaginationSizes {
24
+ xs: true;
25
+ sm: true;
26
+ default: true;
27
+ lg: true;
28
+ xl: true;
29
+ }
30
+ }
31
+ ```
@@ -1,2 +1,2 @@
1
- export type { PaginationProps } from "./pagination";
2
1
  export { Pagination } from "./pagination";
2
+ export type { PaginationProps } from "./pagination";
@@ -1,5 +1,5 @@
1
- import { FC } from "react";
2
1
  import { PaginationSizes } from "@uxf/ui/pagination/theme";
2
+ import { FC } from "react";
3
3
  export interface PaginationProps {
4
4
  count: number;
5
5
  page: number;
@@ -4,10 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.Pagination = void 0;
7
+ const usePagination_1 = require("@uxf/core/hooks/usePagination");
8
+ const cx_1 = require("@uxf/core/utils/cx");
7
9
  const react_1 = __importDefault(require("react"));
8
10
  const icon_1 = require("../icon");
9
- const cx_1 = require("@uxf/core/utils/cx");
10
- const usePagination_1 = require("@uxf/core/hooks/usePagination");
11
11
  const Pagination = (props) => {
12
12
  var _a;
13
13
  const isCurrentPageFirst = props.page === 1;
@@ -2,9 +2,6 @@ import React from "react";
2
2
  declare const _default: {
3
3
  title: string;
4
4
  component: React.FC<import("./pagination").PaginationProps>;
5
- parameters: {
6
- docs: {};
7
- };
8
5
  };
9
6
  export default _default;
10
7
  export declare function Default(): React.JSX.Element;
@@ -24,44 +24,28 @@ 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 pagination_1 = require("./pagination");
28
27
  const react_1 = __importStar(require("react"));
29
- // import Docs from "./pagination.docs.mdx";
30
28
  const action_1 = require("../utils/action");
29
+ const pagination_1 = require("./pagination");
31
30
  exports.default = {
32
31
  title: "UI/Pagination",
33
32
  component: pagination_1.Pagination,
34
- parameters: {
35
- docs: {
36
- // page: Docs,
37
- },
38
- },
39
33
  };
40
34
  function Default() {
41
35
  const [page, setPage] = (0, react_1.useState)(1);
42
36
  const onPageChange = (0, action_1.action)("onPageChange", setPage);
43
- return (react_1.default.createElement("div", null,
44
- react_1.default.createElement("p", { className: "pb-4" },
45
- "Je pot\u0159eba ikona ",
46
- react_1.default.createElement("b", null, "chevronsLeft"),
47
- ", ",
48
- react_1.default.createElement("b", null, "chevronLeft"),
49
- ", ",
50
- react_1.default.createElement("b", null, "chevronRight"),
51
- " a ",
52
- react_1.default.createElement("b", null, "chevronsRight")),
53
- react_1.default.createElement("div", { className: "flex flex-col lg:flex-row" },
54
- react_1.default.createElement("div", { className: "light space-y-2 p-20 lg:w-1/2" },
55
- react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "xs" }),
56
- react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "sm" }),
57
- react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "default" }),
58
- react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "lg" }),
59
- react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "xl" })),
60
- react_1.default.createElement("div", { className: "dark space-y-2 bg-gray-900 p-20 text-white lg:w-1/2" },
61
- react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "xs" }),
62
- react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "sm" }),
63
- react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "default" }),
64
- react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "lg" }),
65
- react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "xl" })))));
37
+ return (react_1.default.createElement("div", { className: "flex flex-col lg:flex-row" },
38
+ react_1.default.createElement("div", { className: "light space-y-2 p-20 lg:w-1/2" },
39
+ react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "xs" }),
40
+ react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "sm" }),
41
+ react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "default" }),
42
+ react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "lg" }),
43
+ react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "xl" })),
44
+ react_1.default.createElement("div", { className: "dark space-y-2 bg-gray-900 p-20 text-white lg:w-1/2" },
45
+ react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "xs" }),
46
+ react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "sm" }),
47
+ react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "default" }),
48
+ react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "lg" }),
49
+ react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "xl" }))));
66
50
  }
67
51
  exports.Default = Default;
@@ -0,0 +1,7 @@
1
+ # Paper
2
+
3
+ ## CSS dependencies
4
+
5
+ ```css
6
+ @import url("@uxf/ui/paper/paper.css");
7
+ ```
package/paper/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export type { PaperProps } from "./paper";
2
1
  export { Paper } from "./paper";
2
+ export type { PaperProps } from "./paper";
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.Default = void 0;
7
- const paper_1 = require("./paper");
8
7
  const react_1 = __importDefault(require("react"));
8
+ const paper_1 = require("./paper");
9
9
  exports.default = {
10
10
  title: "UI/Paper",
11
11
  component: paper_1.Paper,
@@ -0,0 +1,7 @@
1
+ # Radio
2
+
3
+ ## CSS dependencies
4
+
5
+ ```css
6
+ @import url("@uxf/ui/radio/radio.css");
7
+ ```
package/radio/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
+ export { Radio } from "./radio";
1
2
  export type { RadioProps } from "./radio";
2
3
  export type { RadioSize } from "./theme";
3
- export { Radio } from "./radio";
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.Default = void 0;
7
- const index_1 = require("./index");
8
7
  const react_1 = __importDefault(require("react"));
8
+ const index_1 = require("./index");
9
9
  exports.default = {
10
10
  title: "UI/Radio",
11
11
  component: index_1.Radio,
@@ -0,0 +1,8 @@
1
+ # RadioGroup
2
+
3
+ ## CSS dependencies
4
+
5
+ ```css
6
+ @import url("@uxf/ui/radio/radio.css");
7
+ @import url("@uxf/ui/radio-group/radio-group.css");
8
+ ```
@@ -1,3 +1,3 @@
1
- export type { RadioGroupOption, RadioGroupOptionValue, RadioGroupProps } from "./radio-group";
2
- export type { RadioGroupVariant } from "./theme";
3
1
  export { RadioGroup } from "./radio-group";
2
+ export type { RadioGroupOption, RadioGroupOptionValueId, RadioGroupProps } from "./radio-group";
3
+ export type { RadioGroupVariant } from "./theme";
@@ -2,13 +2,13 @@ import React, { CSSProperties, ReactNode } from "react";
2
2
  import { RadioSize } from "../radio";
3
3
  import { FormControlProps } from "../types";
4
4
  import { RadioGroupVariant } from "./theme";
5
- export type RadioGroupOptionValue = string | number;
5
+ export type RadioGroupOptionValueId = string | number;
6
6
  export interface RadioGroupOption {
7
7
  disabled?: boolean;
8
+ id: RadioGroupOptionValueId;
8
9
  label: string;
9
- value: RadioGroupOptionValue;
10
10
  }
11
- export interface RadioGroupProps extends FormControlProps<RadioGroupOptionValue | null> {
11
+ export interface RadioGroupProps extends FormControlProps<RadioGroupOptionValueId | null> {
12
12
  className?: string;
13
13
  helperText?: ReactNode;
14
14
  forceColumn?: boolean;
@@ -43,9 +43,9 @@ exports.RadioGroup = (0, react_2.forwardRef)((props, ref) => {
43
43
  react_2.default.createElement("div", { className: "uxf-form-component__label" },
44
44
  react_2.default.createElement(react_1.RadioGroup.Label, { as: label_1.Label, className: "uxf-radio-group__label", isHidden: props.hiddenLabel, ref: ref }, props.label)),
45
45
  react_2.default.createElement("div", { className: "uxf-form-component__input" },
46
- react_2.default.createElement("div", { className: "uxf-radio-group__options-wrapper" }, props.options.map((option) => (react_2.default.createElement(react_1.RadioGroup.Option, { className: (0, cx_1.cx)("uxf-radio-group__option", props.isDisabled && classes_1.CLASSES.IS_DISABLED), disabled: option.disabled, key: option.value.toString(), value: option.value }, (o) => (react_2.default.createElement("div", { className: (0, cx_1.cx)("uxf-radio-group__option-wrapper", o.checked && classes_1.CLASSES.IS_SELECTED) },
46
+ react_2.default.createElement("div", { className: "uxf-radio-group__options-wrapper" }, props.options.map((option) => (react_2.default.createElement(react_1.RadioGroup.Option, { className: (0, cx_1.cx)("uxf-radio-group__option", props.isDisabled && classes_1.CLASSES.IS_DISABLED), disabled: option.disabled, key: option.id.toString(), value: option.id }, (o) => (react_2.default.createElement("div", { className: (0, cx_1.cx)("uxf-radio-group__option-wrapper", o.checked && classes_1.CLASSES.IS_SELECTED) },
47
47
  react_2.default.createElement("span", { className: "uxf-radio-group__option-label" }, option.label),
48
- react_2.default.createElement(radio_1.Radio, { checked: o.checked, isDisabled: props.isDisabled || o.disabled, isInvalid: props.isInvalid, ref: o.checked ? innerRef : undefined, size: radioSize, value: option.value }))))))),
48
+ react_2.default.createElement(radio_1.Radio, { checked: o.checked, isDisabled: props.isDisabled || o.disabled, isInvalid: props.isInvalid, ref: o.checked ? innerRef : undefined, size: radioSize, value: option.id }))))))),
49
49
  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)))));
50
50
  });
51
51
  exports.RadioGroup.displayName = "UxfUiRadioGroup";
@@ -24,29 +24,29 @@ 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"));
29
28
  const action_1 = require("../utils/action");
29
+ const index_1 = require("./index");
30
30
  exports.default = {
31
31
  title: "UI/RadioGroup",
32
32
  component: index_1.RadioGroup,
33
33
  };
34
34
  const options = [
35
35
  {
36
- value: "1",
36
+ id: "1",
37
37
  label: "Radio one",
38
38
  },
39
39
  {
40
- value: "2",
40
+ id: "2",
41
41
  label: "Radio two",
42
42
  },
43
43
  {
44
- value: "3",
44
+ id: "3",
45
45
  label: "Radio three-sixty",
46
46
  },
47
47
  ];
48
48
  function Default() {
49
- const [value, setValue] = (0, react_1.useState)(options[0].value);
49
+ const [value, setValue] = (0, react_1.useState)(options[0].id);
50
50
  const onChange = (0, action_1.action)("onChange", setValue);
51
51
  const testRadioGroups = (react_1.default.createElement("div", { className: "space-y-10" },
52
52
  react_1.default.createElement(index_1.RadioGroup, { id: "radiogroup", label: "Light Radio group", onChange: onChange, options: options, value: value }),
@@ -0,0 +1,7 @@
1
+ # RasterImage
2
+
3
+ ## CSS dependencies
4
+
5
+ ```css
6
+ @import url("@uxf/ui/raster-image/raster-image.css");
7
+ ```
@@ -1,2 +1,2 @@
1
- export type { RasterImageProps } from "./raster-image";
2
1
  export { RasterImage } from "./raster-image";
2
+ export type { RasterImageProps } from "./raster-image";
@@ -42,7 +42,7 @@ const RasterImage = (props) => {
42
42
  : props.width && props.height
43
43
  ? Math.ceil((props.height / props.width) * w)
44
44
  : "auto", key: `${w}-${i}`, options: props.options, quality: props.quality, src: props.src, width: w }))).reverse()) !== null && _f !== void 0 ? _f : (react_1.default.createElement(image_1.ImgSources, { height: (_g = props.height) !== null && _g !== void 0 ? _g : "auto", options: props.options, quality: props.quality, src: props.src, width: (_h = props.width) !== null && _h !== void 0 ? _h : "auto" })),
45
- react_1.default.createElement("img", { alt: props.alt, className: (0, cx_1.cx)(imgClassName), height: props.height, loading: props.loading, src: resizerSrc, width: props.width })));
45
+ react_1.default.createElement("img", { alt: props.alt, className: (0, cx_1.cx)(imgClassName), height: (0, image_1.getImgElementHeight)(props.src, props.width, props.height), loading: props.loading, src: resizerSrc, width: (0, image_1.getImgElementWidth)(props.src, props.width, props.height) })));
46
46
  };
47
47
  exports.RasterImage = RasterImage;
48
48
  exports.RasterImage.displayName = "UxfUiRasterImage";
@@ -47,48 +47,56 @@ const TW_TOKENS = [
47
47
 
48
48
  let error = false;
49
49
 
50
- try {
51
- const mode = process.argv.filter((c) => c.includes("--mode="))[0]?.split("=")[1];
52
- const twConfig = process.argv.filter((c) => c.includes("--twConfig="))[0]?.split("=")[1];
53
- const outputPath = process.argv.filter((c) => c.includes("--outputPath="))[0]?.split("=")[1];
50
+ async function generateTwTokens() {
51
+ try {
52
+ const mode = process.argv.filter((c) => c.includes("--mode="))[0]?.split("=")[1];
53
+ const twConfig = process.argv.filter((c) => c.includes("--twConfig="))[0]?.split("=")[1];
54
+ const outputPath = process.argv.filter((c) => c.includes("--outputPath="))[0]?.split("=")[1];
55
+
56
+ if (!twConfig) {
57
+ throw Error(`Provide valid path to tailwind config. Use "--twConfig" argument.`);
58
+ }
54
59
 
55
- if (!twConfig) {
56
- throw Error(`Provide valid path to tailwind config. Use "--twConfig" argument.`);
57
- }
60
+ if (!outputPath) {
61
+ throw Error(`Provide valid output path to tailwind tokens. Use "--outputPath" argument.`);
62
+ }
58
63
 
59
- if (!outputPath) {
60
- throw Error(`Provide valid output path to tailwind tokens. Use "--outputPath" argument.`);
61
- }
64
+ const loadedTwConfig = resolveConfig(require(path.resolve(process.cwd(), twConfig)));
62
65
 
63
- const loadedTwConfig = resolveConfig(require(path.resolve(process.cwd(), twConfig)));
66
+ const outputDir = path.resolve(process.cwd(), outputPath);
64
67
 
65
- TW_TOKENS.forEach((property) => {
66
- const result = resolveProperty(property, loadedTwConfig.theme) || "";
68
+ if (mode !== "check" && !fs.existsSync(outputDir)) {
69
+ fs.mkdirSync(outputDir);
70
+ }
67
71
 
68
- const filePath = path.resolve(process.cwd(), `${outputPath}tw-${camelToSnakeCase(property)}.ts`);
72
+ for (const token of TW_TOKENS) {
73
+ const result = resolveProperty(token, loadedTwConfig.theme) || "";
69
74
 
70
- if (!result && mode !== "check" && fs.existsSync(filePath)) {
71
- fs.rmSync(filePath);
72
- }
75
+ const filePath = path.resolve(process.cwd(), `${outputPath}tw-${camelToSnakeCase(token)}.ts`);
76
+
77
+ if (!result && mode !== "check" && fs.existsSync(filePath)) {
78
+ fs.rmSync(filePath);
79
+ }
73
80
 
74
- const newContent = prettier.format(result, {
75
- parser: "babel",
76
- tabWidth: 4,
77
- });
81
+ const newContent = await prettier.format(result, {
82
+ parser: "typescript",
83
+ tabWidth: 4,
84
+ });
78
85
 
79
- if (mode === "check") {
80
- const oldContent = fs.existsSync(filePath) ? fs.readFileSync(filePath).toString() : "";
86
+ if (mode === "check") {
87
+ const oldContent = fs.existsSync(filePath) ? fs.readFileSync(filePath).toString() : "";
81
88
 
82
- if (newContent !== oldContent) {
83
- throw new Error("Generated tailwind tokens doesn't match with current tailwind config.");
89
+ if (newContent !== oldContent) {
90
+ throw new Error("Generated tailwind tokens doesn't match with current tailwind config.");
91
+ }
92
+ } else if (newContent) {
93
+ fs.writeFileSync(filePath, newContent, "utf-8");
84
94
  }
85
- } else if (newContent) {
86
- fs.writeFileSync(filePath, newContent, "utf-8");
87
95
  }
88
- });
89
- } catch (err) {
90
- console.error(err.message);
91
- error = true;
96
+ } catch (err) {
97
+ console.error(err.message);
98
+ error = true;
99
+ }
92
100
  }
93
101
 
94
- process.exit(error ? 1 : 0);
102
+ generateTwTokens().then(() => process.exit(error ? 1 : 0));
@@ -0,0 +1,11 @@
1
+ # Select
2
+
3
+ ## CSS dependencies
4
+
5
+ ```css
6
+ @import url("@uxf/ui/form-component/form-component.css");
7
+ @import url("@uxf/ui/input/input-basic.css");
8
+ @import url("@uxf/ui/input/input.css");
9
+ @import url("@uxf/ui/label/label.css");
10
+ @import url("@uxf/ui/dropdown/dropdown.css");
11
+ ```
package/select/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export type { SelectValue, SelectOption, SelectProps } from "./select";
2
1
  export { Select } from "./select";
2
+ export type { SelectOption, SelectProps, SelectValue } from "./select";
@@ -13,7 +13,7 @@ export interface SelectProps<ValueId = SelectValue, Option = SelectOption<ValueI
13
13
  noQueryMessage?: string;
14
14
  notFoundMessage?: string;
15
15
  options: Option[];
16
- renderOption?: (option: Option) => ReactNode;
16
+ renderOption?: (option: Option, isSelected: boolean) => ReactNode;
17
17
  renderSelectedOption?: (option: Option) => ReactNode;
18
18
  }
19
19
  export declare const Select: {
package/select/select.js CHANGED
@@ -5,9 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.Select = void 0;
7
7
  const react_1 = require("@headlessui/react");
8
+ const classes_1 = require("@uxf/core/constants/classes");
8
9
  const react_2 = __importDefault(require("react"));
9
10
  const _select_base_1 = require("../_select-base");
10
- const classes_1 = require("@uxf/core/constants/classes");
11
11
  const Select = (props) => {
12
12
  var _a, _b, _c, _d;
13
13
  const onChange = (v) => { var _a; return props.onChange((_a = v === null || v === void 0 ? void 0 : v.id) !== null && _a !== void 0 ? _a : null); };