@scaleflex/ui-tw 0.0.2 → 0.0.3

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 (361) hide show
  1. package/LICENSE +1 -33
  2. package/README.md +2 -16
  3. package/{core/button → button}/button.component.d.ts +2 -3
  4. package/{core/button → button}/button.component.js +8 -9
  5. package/{core/button → button}/button.const.d.ts +0 -2
  6. package/{core/button → button}/button.const.js +2 -2
  7. package/{core/button → button}/button.types.d.ts +3 -5
  8. package/{core/button → button}/button.types.js +2 -4
  9. package/{core/button → button}/button.utils.d.ts +1 -1
  10. package/{core/button → button}/button.utils.js +1 -1
  11. package/{core/button → button}/components/end-icon.d.ts +1 -1
  12. package/{core/button → button}/components/end-icon.js +3 -3
  13. package/{core/button → button}/components/start-icon.d.ts +2 -2
  14. package/{core/button → button}/components/start-icon.js +3 -3
  15. package/button/index.d.ts +3 -0
  16. package/button/index.js +2 -0
  17. package/form/components/form-field-group.component.d.ts +19 -0
  18. package/form/components/form-field-group.component.js +41 -0
  19. package/form/form.component.d.ts +30 -0
  20. package/form/form.component.js +123 -0
  21. package/form/form.types.d.ts +7 -0
  22. package/{core/switcher/switcher-size.js → form/form.types.js} +1 -1
  23. package/form/index.d.ts +2 -0
  24. package/form/index.js +2 -0
  25. package/input/index.d.ts +3 -0
  26. package/input/index.js +2 -0
  27. package/input/input.component.d.ts +7 -0
  28. package/input/input.component.js +42 -0
  29. package/input/input.types.d.ts +17 -0
  30. package/input/input.types.js +10 -0
  31. package/label/components/info-outline-icon.d.ts +3 -0
  32. package/label/components/info-outline-icon.js +30 -0
  33. package/label/components/label-icon.d.ts +7 -0
  34. package/label/components/label-icon.js +43 -0
  35. package/label/index.d.ts +1 -0
  36. package/label/index.js +1 -0
  37. package/label/label.component.d.ts +4 -0
  38. package/label/label.component.js +44 -0
  39. package/label/label.types.d.ts +14 -0
  40. package/{core/tab/types/size.js → label/label.types.js} +1 -1
  41. package/label/label.utils.d.ts +2 -0
  42. package/label/label.utils.js +16 -0
  43. package/package.json +8 -4
  44. package/{theme/theme.css → theme.css} +4 -4
  45. package/tooltip/index.d.ts +1 -0
  46. package/tooltip/index.js +1 -0
  47. package/tooltip/tooltip.component.d.ts +10 -0
  48. package/tooltip/tooltip.component.js +51 -0
  49. package/tooltip/tooltip.types.d.ts +5 -0
  50. package/core/accordion/accordion.component.d.ts +0 -3
  51. package/core/accordion/accordion.component.js +0 -50
  52. package/core/accordion/accordion.props.d.ts +0 -13
  53. package/core/accordion/accordion.props.js +0 -1
  54. package/core/accordion/index.d.ts +0 -2
  55. package/core/accordion/index.js +0 -1
  56. package/core/accordion-details/accordion-details.component.d.ts +0 -3
  57. package/core/accordion-details/accordion-details.component.js +0 -16
  58. package/core/accordion-details/accordion-details.props.d.ts +0 -4
  59. package/core/accordion-details/index.d.ts +0 -2
  60. package/core/accordion-details/index.js +0 -1
  61. package/core/accordion-header/accordion-header.component.d.ts +0 -3
  62. package/core/accordion-header/accordion-header.component.js +0 -48
  63. package/core/accordion-header/accordion-header.props.d.ts +0 -11
  64. package/core/accordion-header/accordion-header.props.js +0 -1
  65. package/core/accordion-header/index.d.ts +0 -2
  66. package/core/accordion-header/index.js +0 -1
  67. package/core/arrow/arrow.component.d.ts +0 -3
  68. package/core/arrow/arrow.component.js +0 -22
  69. package/core/arrow/arrow.props.d.ts +0 -14
  70. package/core/arrow/arrow.props.js +0 -6
  71. package/core/arrow/index.d.ts +0 -2
  72. package/core/arrow/index.js +0 -1
  73. package/core/arrow-tick/arrow-tick.component.d.ts +0 -3
  74. package/core/arrow-tick/arrow-tick.component.js +0 -21
  75. package/core/arrow-tick/arrow-tick.props.d.ts +0 -14
  76. package/core/arrow-tick/arrow-tick.props.js +0 -6
  77. package/core/arrow-tick/index.d.ts +0 -2
  78. package/core/arrow-tick/index.js +0 -1
  79. package/core/button/index.d.ts +0 -4
  80. package/core/button/index.js +0 -3
  81. package/core/check-box/check-box.component.d.ts +0 -0
  82. package/core/check-box/check-box.component.js +0 -77
  83. package/core/check-box/check-box.props.d.ts +0 -15
  84. package/core/check-box/check-box.props.js +0 -1
  85. package/core/check-box/check-box.utils.d.ts +0 -3
  86. package/core/check-box/check-box.utils.js +0 -21
  87. package/core/check-box/index.d.ts +0 -0
  88. package/core/check-box/index.js +0 -2
  89. package/core/check-box/types/index.d.ts +0 -2
  90. package/core/check-box/types/index.js +0 -2
  91. package/core/check-box/types/size.d.ts +0 -4
  92. package/core/check-box/types/size.js +0 -4
  93. package/core/check-box/types/type.d.ts +0 -4
  94. package/core/check-box/types/type.js +0 -4
  95. package/core/check-box-group/check-box-group.component.d.ts +0 -0
  96. package/core/check-box-group/check-box-group.component.js +0 -75
  97. package/core/check-box-group/check-box-group.props.d.ts +0 -0
  98. package/core/check-box-group/check-box-group.props.js +0 -23
  99. package/core/check-box-group/index.d.ts +0 -0
  100. package/core/check-box-group/index.js +0 -2
  101. package/core/check-box-group/types/index.d.ts +0 -1
  102. package/core/check-box-group/types/index.js +0 -1
  103. package/core/check-box-group/types/label-position.d.ts +0 -4
  104. package/core/check-box-group/types/label-position.js +0 -4
  105. package/core/cross-button/cross-button.component.d.ts +0 -3
  106. package/core/cross-button/cross-button.component.js +0 -37
  107. package/core/cross-button/cross-button.props.d.ts +0 -8
  108. package/core/cross-button/cross-button.props.js +0 -1
  109. package/core/cross-button/index.d.ts +0 -2
  110. package/core/cross-button/index.js +0 -1
  111. package/core/cross-button/types/index.d.ts +0 -1
  112. package/core/cross-button/types/index.js +0 -1
  113. package/core/cross-button/types/size.d.ts +0 -6
  114. package/core/cross-button/types/size.js +0 -6
  115. package/core/dot/dot.component.d.ts +0 -3
  116. package/core/dot/dot.component.js +0 -15
  117. package/core/dot/dot.props.d.ts +0 -4
  118. package/core/dot/dot.props.js +0 -1
  119. package/core/dot/index.d.ts +0 -2
  120. package/core/dot/index.js +0 -1
  121. package/core/dots-navigation/dots-navigation.component.d.ts +0 -3
  122. package/core/dots-navigation/dots-navigation.component.js +0 -24
  123. package/core/dots-navigation/dots-navigation.props.d.ts +0 -5
  124. package/core/dots-navigation/dots-navigation.props.js +0 -1
  125. package/core/dots-navigation/index.d.ts +0 -2
  126. package/core/dots-navigation/index.js +0 -1
  127. package/core/input/components/clear-icon.d.ts +0 -6
  128. package/core/input/components/clear-icon.js +0 -12
  129. package/core/input/components/copy-icon.d.ts +0 -6
  130. package/core/input/components/copy-icon.js +0 -13
  131. package/core/input/components/password-icon.d.ts +0 -7
  132. package/core/input/components/password-icon.js +0 -24
  133. package/core/input/components/render-icon.d.ts +0 -7
  134. package/core/input/components/render-icon.js +0 -26
  135. package/core/input/index.d.ts +0 -2
  136. package/core/input/index.js +0 -1
  137. package/core/input/input.component.d.ts +0 -3
  138. package/core/input/input.component.js +0 -233
  139. package/core/input/input.const.d.ts +0 -6
  140. package/core/input/input.const.js +0 -6
  141. package/core/input/input.types.d.ts +0 -56
  142. package/core/input/input.types.js +0 -16
  143. package/core/input/input.utils.d.ts +0 -2
  144. package/core/input/input.utils.js +0 -13
  145. package/core/modal/index.d.ts +0 -2
  146. package/core/modal/index.js +0 -1
  147. package/core/modal/modal-menu-context.d.ts +0 -5
  148. package/core/modal/modal-menu-context.js +0 -10
  149. package/core/modal/modal.component.d.ts +0 -3
  150. package/core/modal/modal.component.js +0 -97
  151. package/core/modal/modal.props.d.ts +0 -16
  152. package/core/modal/modal.props.js +0 -1
  153. package/core/modal/modal.utils.d.ts +0 -1
  154. package/core/modal/modal.utils.js +0 -4
  155. package/core/modal/types/index.d.ts +0 -1
  156. package/core/modal/types/index.js +0 -1
  157. package/core/modal/types/size.d.ts +0 -7
  158. package/core/modal/types/size.js +0 -7
  159. package/core/modal-actions/index.d.ts +0 -2
  160. package/core/modal-actions/index.js +0 -1
  161. package/core/modal-actions/modal-actions.component.d.ts +0 -3
  162. package/core/modal-actions/modal-actions.component.js +0 -18
  163. package/core/modal-actions/modal-actions.props.d.ts +0 -8
  164. package/core/modal-actions/modal-actions.props.js +0 -1
  165. package/core/modal-actions/types/align.d.ts +0 -5
  166. package/core/modal-actions/types/align.js +0 -5
  167. package/core/modal-actions/types/index.d.ts +0 -1
  168. package/core/modal-actions/types/index.js +0 -1
  169. package/core/modal-content/index.d.ts +0 -2
  170. package/core/modal-content/index.js +0 -1
  171. package/core/modal-content/modal-content.component.d.ts +0 -3
  172. package/core/modal-content/modal-content.component.js +0 -15
  173. package/core/modal-content/modal-content.props.d.ts +0 -4
  174. package/core/modal-content/modal-content.props.js +0 -1
  175. package/core/modal-title/index.d.ts +0 -2
  176. package/core/modal-title/index.js +0 -1
  177. package/core/modal-title/modal-title.component.d.ts +0 -6
  178. package/core/modal-title/modal-title.component.js +0 -37
  179. package/core/modal-title/modal-title.props.d.ts +0 -14
  180. package/core/modal-title/modal-title.props.js +0 -1
  181. package/core/modal-title/types/index.d.ts +0 -1
  182. package/core/modal-title/types/index.js +0 -1
  183. package/core/modal-title/types/variant.d.ts +0 -4
  184. package/core/modal-title/types/variant.js +0 -4
  185. package/core/pagination/index.d.ts +0 -2
  186. package/core/pagination/index.js +0 -1
  187. package/core/pagination/pagination.component.d.ts +0 -3
  188. package/core/pagination/pagination.component.js +0 -81
  189. package/core/pagination/pagination.props.d.ts +0 -11
  190. package/core/pagination/pagination.props.js +0 -1
  191. package/core/popper/index.d.ts +0 -2
  192. package/core/popper/index.js +0 -1
  193. package/core/popper/popper.component.d.ts +0 -3
  194. package/core/popper/popper.component.js +0 -113
  195. package/core/popper/popper.props.d.ts +0 -41
  196. package/core/popper/popper.props.js +0 -1
  197. package/core/popper/popper.utils.d.ts +0 -1
  198. package/core/popper/popper.utils.js +0 -10
  199. package/core/popper/types/index.d.ts +0 -3
  200. package/core/popper/types/index.js +0 -3
  201. package/core/popper/types/phases.d.ts +0 -11
  202. package/core/popper/types/phases.js +0 -11
  203. package/core/popper/types/position.d.ts +0 -17
  204. package/core/popper/types/position.js +0 -17
  205. package/core/popper/types/strategy.d.ts +0 -4
  206. package/core/popper/types/strategy.js +0 -4
  207. package/core/radio/index.d.ts +0 -3
  208. package/core/radio/index.js +0 -2
  209. package/core/radio/radio.component.d.ts +0 -3
  210. package/core/radio/radio.component.js +0 -38
  211. package/core/radio/radio.props.d.ts +0 -13
  212. package/core/radio/radio.props.js +0 -1
  213. package/core/radio/size.d.ts +0 -4
  214. package/core/radio/size.js +0 -4
  215. package/core/radio-group/index.d.ts +0 -2
  216. package/core/radio-group/index.js +0 -1
  217. package/core/radio-group/radio-group.component.d.ts +0 -3
  218. package/core/radio-group/radio-group.component.js +0 -48
  219. package/core/radio-group/radio-group.props.d.ts +0 -15
  220. package/core/radio-group/radio-group.props.js +0 -1
  221. package/core/switcher/index.d.ts +0 -3
  222. package/core/switcher/index.js +0 -2
  223. package/core/switcher/switcher-size.d.ts +0 -5
  224. package/core/switcher/switcher.component.d.ts +0 -3
  225. package/core/switcher/switcher.component.js +0 -54
  226. package/core/switcher/switcher.props.d.ts +0 -14
  227. package/core/switcher/switcher.props.js +0 -1
  228. package/core/switcher/switcher.utils.d.ts +0 -4
  229. package/core/switcher/switcher.utils.js +0 -37
  230. package/core/switcher-group/index.d.ts +0 -2
  231. package/core/switcher-group/index.js +0 -1
  232. package/core/switcher-group/switcher-group.component.d.ts +0 -3
  233. package/core/switcher-group/switcher-group.component.js +0 -41
  234. package/core/switcher-group/switcher-group.props.d.ts +0 -13
  235. package/core/switcher-group/switcher-group.props.js +0 -1
  236. package/core/tab/index.d.ts +0 -2
  237. package/core/tab/index.js +0 -1
  238. package/core/tab/tab.component.d.ts +0 -6
  239. package/core/tab/tab.component.js +0 -52
  240. package/core/tab/tab.props.d.ts +0 -15
  241. package/core/tab/tab.props.js +0 -1
  242. package/core/tab/types/index.d.ts +0 -1
  243. package/core/tab/types/index.js +0 -1
  244. package/core/tab/types/size.d.ts +0 -5
  245. package/core/tab-panel/index.d.ts +0 -2
  246. package/core/tab-panel/index.js +0 -1
  247. package/core/tab-panel/tab-panel.component.d.ts +0 -3
  248. package/core/tab-panel/tab-panel.component.js +0 -18
  249. package/core/tab-panel/tab-panel.props.d.ts +0 -6
  250. package/core/tab-panel/tab-panel.props.js +0 -1
  251. package/core/upload-input/index.d.ts +0 -2
  252. package/core/upload-input/index.js +0 -1
  253. package/core/upload-input/upload-input.component.d.ts +0 -3
  254. package/core/upload-input/upload-input.component.js +0 -68
  255. package/core/upload-input/upload-input.props.d.ts +0 -9
  256. package/core/upload-input/upload-input.props.js +0 -1
  257. package/hooks/README.md +0 -26
  258. package/hooks/use-controlled.d.ts +0 -1
  259. package/hooks/use-controlled.js +0 -20
  260. package/hooks/use-debounce.d.ts +0 -2
  261. package/hooks/use-debounce.js +0 -19
  262. package/hooks/use-drag.d.ts +0 -5
  263. package/hooks/use-drag.js +0 -37
  264. package/hooks/use-enhanced-effect.d.ts +0 -3
  265. package/hooks/use-enhanced-effect.js +0 -3
  266. package/hooks/use-event-callback.d.ts +0 -4
  267. package/hooks/use-event-callback.js +0 -19
  268. package/hooks/use-pagination.d.ts +0 -3
  269. package/hooks/use-pagination.js +0 -106
  270. package/hooks/use-portal.d.ts +0 -14
  271. package/hooks/use-portal.js +0 -75
  272. package/theme/README.md +0 -9
  273. package/utils/README.md +0 -11
  274. package/utils/functions/apply-display-names.d.ts +0 -6
  275. package/utils/functions/apply-display-names.js +0 -12
  276. package/utils/functions/apply-polymorphic-function-prop.d.ts +0 -6
  277. package/utils/functions/apply-polymorphic-function-prop.js +0 -11
  278. package/utils/functions/color-picker/color-converters.d.ts +0 -11
  279. package/utils/functions/color-picker/color-converters.js +0 -159
  280. package/utils/functions/convert-to-string.d.ts +0 -1
  281. package/utils/functions/convert-to-string.js +0 -3
  282. package/utils/functions/escape-regexp.d.ts +0 -1
  283. package/utils/functions/escape-regexp.js +0 -3
  284. package/utils/functions/generate-class-names.d.ts +0 -1
  285. package/utils/functions/generate-class-names.js +0 -22
  286. package/utils/functions/get-elem-document-coords.d.ts +0 -6
  287. package/utils/functions/get-elem-document-coords.js +0 -21
  288. package/utils/functions/ignore-event.d.ts +0 -1
  289. package/utils/functions/ignore-event.js +0 -9
  290. package/utils/functions/index.d.ts +0 -11
  291. package/utils/functions/index.js +0 -12
  292. package/utils/functions/intrinsic-component.d.ts +0 -0
  293. package/utils/functions/intrinsic-component.js +0 -28
  294. package/utils/functions/object-keys.d.ts +0 -6
  295. package/utils/functions/object-keys.js +0 -6
  296. package/utils/functions/object-values.d.ts +0 -7
  297. package/utils/functions/object-values.js +0 -6
  298. package/utils/functions/on-click-by-mouse-down.d.ts +0 -2
  299. package/utils/functions/on-click-by-mouse-down.js +0 -9
  300. package/utils/functions/set-ref.d.ts +0 -8
  301. package/utils/functions/set-ref.js +0 -13
  302. package/utils/functions/slider/utils.d.ts +0 -47
  303. package/utils/functions/slider/utils.js +0 -124
  304. package/utils/functions/use-fork-ref.d.ts +0 -2
  305. package/utils/functions/use-fork-ref.js +0 -18
  306. package/utils/types/color/icon-button-color.d.ts +0 -5
  307. package/utils/types/color/icon-button-color.js +0 -5
  308. package/utils/types/color/index.d.ts +0 -0
  309. package/utils/types/color/index.js +0 -2
  310. package/utils/types/color/input-background-color.d.ts +0 -4
  311. package/utils/types/color/input-background-color.js +0 -4
  312. package/utils/types/css/align.d.ts +0 -11
  313. package/utils/types/css/align.js +0 -11
  314. package/utils/types/css/breakpoint.d.ts +0 -18
  315. package/utils/types/css/breakpoint.js +0 -18
  316. package/utils/types/css/direction.d.ts +0 -8
  317. package/utils/types/css/direction.js +0 -4
  318. package/utils/types/css/index.d.ts +0 -4
  319. package/utils/types/css/index.js +0 -4
  320. package/utils/types/css/position.d.ts +0 -6
  321. package/utils/types/css/position.js +0 -6
  322. package/utils/types/index.d.ts +0 -6
  323. package/utils/types/index.js +0 -3
  324. package/utils/types/intrinsic-component.d.ts +0 -1
  325. package/utils/types/keys.d.ts +0 -4
  326. package/utils/types/palette/color.d.ts +0 -133
  327. package/utils/types/palette/color.js +0 -133
  328. package/utils/types/palette/index.d.ts +0 -1
  329. package/utils/types/palette/index.js +0 -1
  330. package/utils/types/position/index.d.ts +0 -1
  331. package/utils/types/position/index.js +0 -1
  332. package/utils/types/position/position.d.ts +0 -6
  333. package/utils/types/position/position.js +0 -6
  334. package/utils/types/prop-types/index.d.ts +0 -1
  335. package/utils/types/prop-types/index.js +0 -1
  336. package/utils/types/prop-types/record.d.ts +0 -1
  337. package/utils/types/prop-types/record.js +0 -6
  338. package/utils/types/shadows/index.d.ts +0 -1
  339. package/utils/types/shadows/index.js +0 -1
  340. package/utils/types/shadows/shadows.d.ts +0 -14
  341. package/utils/types/shadows/shadows.js +0 -14
  342. package/utils/types/shape/border-radius-size.d.ts +0 -5
  343. package/utils/types/shape/border-radius-size.js +0 -5
  344. package/utils/types/shape/index.d.ts +0 -1
  345. package/utils/types/shape/index.js +0 -1
  346. package/utils/types/stylable-component.d.ts +0 -7
  347. package/utils/types/typography/font-variant.d.ts +0 -58
  348. package/utils/types/typography/font-variant.js +0 -58
  349. package/utils/types/typography/font-weight.d.ts +0 -11
  350. package/utils/types/typography/font-weight.js +0 -11
  351. package/utils/types/typography/index.d.ts +0 -4
  352. package/utils/types/typography/index.js +0 -4
  353. package/utils/types/typography/text-align.d.ts +0 -5
  354. package/utils/types/typography/text-align.js +0 -5
  355. package/utils/types/typography/text-decoration.d.ts +0 -5
  356. package/utils/types/typography/text-decoration.js +0 -5
  357. package/utils/types/with.d.ts +0 -4
  358. /package/{core/accordion-details/accordion-details.props.js → tooltip/tooltip.types.js} +0 -0
  359. /package/{utils/types → types}/values.d.ts +0 -0
  360. /package/utils/{functions/shadcn-utils.d.ts → cn.d.ts} +0 -0
  361. /package/utils/{functions/shadcn-utils.js → cn.js} +0 -0
@@ -1,37 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["secondary", "onClose", "primaryLabelStyles", "variant", "ref"];
4
- import { cn } from '@scaleflex/ui-tw/utils/functions/shadcn-utils';
5
- import React from 'react';
6
- import CrossButton from '../cross-button';
7
- import { Variant } from './types';
8
- var ModalTitle = function ModalTitle(_ref) {
9
- var secondary = _ref.secondary,
10
- onClose = _ref.onClose,
11
- primaryLabelStyles = _ref.primaryLabelStyles,
12
- _ref$variant = _ref.variant,
13
- variant = _ref$variant === void 0 ? Variant.Default : _ref$variant,
14
- ref = _ref.ref,
15
- rest = _objectWithoutProperties(_ref, _excluded);
16
- var modalTitleClasses = cn('relative text-textprimary rounded-tl-sm rounded-tr-sm', variant === Variant.WithIcon ? 'flex flex-col items-center pt-6 pb-3 pl-4.5 pr-4.5' : 'pt-3.5 pb-3.5 pl-4.5 pr-10', variant === Variant.Default ? 'bg-background-primary border-b-1 border-solid border-borders-secondary' : '');
17
- var closeClasses = cn('absolute flex cursor-pointer text-icons-secondary hover:text-accent-primary', variant === Variant.WithIcon ? 'top-0.5 right-0.5' : 'top-2 right-2');
18
- return /*#__PURE__*/React.createElement("div", _extends({
19
- className: modalTitleClasses
20
- }, rest, {
21
- ref: ref
22
- }), rest.icon && /*#__PURE__*/React.createElement("div", {
23
- className: "bg-accent-1-2-opacity text-accent-primary mb-2 flex rounded-full p-3.5"
24
- }, rest.icon), /*#__PURE__*/React.createElement("div", {
25
- className: "text-lg ".concat(variant === Variant.Default ? 'font-normal' : 'font-medium'),
26
- style: primaryLabelStyles
27
- }, rest.primary), variant === Variant.WithIcon && secondary && /*#__PURE__*/React.createElement("div", {
28
- className: "font-xs mt-1"
29
- }, secondary), /*#__PURE__*/React.createElement("div", {
30
- className: closeClasses
31
- }, /*#__PURE__*/React.createElement(CrossButton, {
32
- size: "lg",
33
- onClick: onClose
34
- })));
35
- };
36
- ModalTitle.displayName = 'ModalTitle';
37
- export default ModalTitle;
@@ -1,14 +0,0 @@
1
- import { Ref } from 'react';
2
- import type { Values } from '../../utils/types';
3
- import { Variant } from './types';
4
- export type ModalTitleVariantType = Values<typeof Variant>;
5
- export interface ModalTitleProps extends React.HTMLAttributes<HTMLDivElement> {
6
- primary: React.ReactNode;
7
- secondary?: React.ReactNode;
8
- primaryLabelStyles?: object;
9
- icon?: React.ReactNode;
10
- iconShadow?: boolean;
11
- onClose?: () => void;
12
- variant?: ModalTitleVariantType;
13
- ref?: Ref<HTMLDivElement>;
14
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export * from './variant';
@@ -1 +0,0 @@
1
- export * from './variant';
@@ -1,4 +0,0 @@
1
- export declare const Variant: {
2
- readonly Default: "default";
3
- readonly WithIcon: "with-icon";
4
- };
@@ -1,4 +0,0 @@
1
- export var Variant = {
2
- Default: 'default',
3
- WithIcon: 'with-icon'
4
- };
@@ -1,2 +0,0 @@
1
- export { default } from './pagination.component';
2
- export type { PaginationProps } from './pagination.props';
@@ -1 +0,0 @@
1
- export { default } from './pagination.component';
@@ -1,3 +0,0 @@
1
- import type { PaginationProps } from './pagination.props';
2
- declare const Pagination: (props: PaginationProps) => JSX.Element;
3
- export default Pagination;
@@ -1,81 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- var _excluded = ["getItemAriaLabel", "ref"],
5
- _excluded2 = ["disabled", "page", "selected", "type"];
6
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
7
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
8
- import React from 'react';
9
- import { usePagination } from '../../hooks/use-pagination';
10
- import Arrow from '../arrow';
11
- function defaultGetAriaLabel(type, page, selected) {
12
- if (type === 'page') {
13
- return "".concat(selected ? '' : 'Go to ', "page ").concat(page);
14
- }
15
- return "Go to ".concat(type, " page");
16
- }
17
- var Pagination = function Pagination(props) {
18
- var _usePagination = usePagination(_objectSpread({}, props)),
19
- items = _usePagination.items;
20
- var _props$getItemAriaLab = props.getItemAriaLabel,
21
- getItemAriaLabel = _props$getItemAriaLab === void 0 ? defaultGetAriaLabel : _props$getItemAriaLab,
22
- ref = props.ref,
23
- rest = _objectWithoutProperties(props, _excluded);
24
- var paginationItem = function paginationItem(paginationitems) {
25
- var _paginationitems$disa = paginationitems.disabled,
26
- disabled = _paginationitems$disa === void 0 ? false : _paginationitems$disa,
27
- page = paginationitems.page,
28
- _paginationitems$sele = paginationitems.selected,
29
- selected = _paginationitems$sele === void 0 ? false : _paginationitems$sele,
30
- _paginationitems$type = paginationitems.type,
31
- type = _paginationitems$type === void 0 ? 'page' : _paginationitems$type,
32
- other = _objectWithoutProperties(paginationitems, _excluded2);
33
- var Icons = {
34
- previous: function previous() {
35
- return /*#__PURE__*/React.createElement(Arrow, {
36
- type: "left",
37
- IconProps: {
38
- size: '0.5rem'
39
- }
40
- });
41
- },
42
- next: function next() {
43
- return /*#__PURE__*/React.createElement(Arrow, {
44
- type: "right",
45
- IconProps: {
46
- size: '0.5rem'
47
- }
48
- });
49
- }
50
- // first: FirstPageIcon,
51
- // last: LastPageIcon,
52
- };
53
- var paginationItemClasses = "mx-1 my-0 inline-flex h-6 min-w-6 cursor-pointer items-center justify-center border-0 bg-transparent px-1.5 py-0 text-center outline-0 transition-all duration-100 ease-out select-none text-xs font-normal ".concat(selected ? 'text-primary-hover' : 'text-textprimary');
54
- var Icon = Icons[type];
55
- return type === 'start-ellipsis' || type === 'end-ellipsis' ? /*#__PURE__*/React.createElement("button", _extends({
56
- className: paginationItemClasses,
57
- disabled: disabled,
58
- selected: selected
59
- }, other), "\u2026") : /*#__PURE__*/React.createElement("button", _extends({
60
- className: paginationItemClasses,
61
- ref: ref,
62
- disabled: disabled,
63
- selected: selected
64
- }, other), type === 'page' && page, Icon ? /*#__PURE__*/React.createElement(Icon, null) : null);
65
- };
66
- return /*#__PURE__*/React.createElement("nav", {
67
- className: "pagination-nav",
68
- ref: ref,
69
- style: rest.style
70
- }, /*#__PURE__*/React.createElement("div", {
71
- className: "m-0 flex list-none flex-wrap items-center p-0"
72
- }, items.map(function (item, index) {
73
- return /*#__PURE__*/React.createElement("li", {
74
- key: index
75
- }, paginationItem(_objectSpread(_objectSpread({}, item), {}, {
76
- 'aria-label': getItemAriaLabel(item.type, item.page, item.selected),
77
- varaint: 'text'
78
- })));
79
- })));
80
- };
81
- export default Pagination;
@@ -1,11 +0,0 @@
1
- export interface PaginationProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
2
- boundaryCount?: number;
3
- count?: number;
4
- defaultPage?: number;
5
- disabled?: boolean;
6
- onChange?: (event: any, value: any) => void;
7
- getItemAriaLabel?: (type: string, page: number, selected: boolean) => string;
8
- page?: number;
9
- siblingCount?: number;
10
- ref?: React.Ref<HTMLDivElement>;
11
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- export { default } from './popper.component';
2
- export type { PopperProps, PopperOptions, VirtualElement, Modifiers } from './popper.props';
@@ -1 +0,0 @@
1
- export { default } from './popper.component';
@@ -1,3 +0,0 @@
1
- import { PopperProps } from './popper.props';
2
- declare const Popper: ({ anchorEl, children, open, warning, position: initialPlacement, arrow, popperOptions, overlay, zIndex, enableUnderlayingEvent, wrapperStyles, disablePortal, onClick, ref, ...rest }: PopperProps) => JSX.Element;
3
- export default Popper;
@@ -1,113 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- var _excluded = ["anchorEl", "children", "open", "warning", "position", "arrow", "popperOptions", "overlay", "zIndex", "enableUnderlayingEvent", "wrapperStyles", "disablePortal", "onClick", "ref"];
5
- var _popperArrowPosition;
6
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
7
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
8
- import { createPopper } from '@popperjs/core';
9
- import { cn } from '@scaleflex/ui-tw/utils/functions/shadcn-utils';
10
- import React, { useEffect, useRef } from 'react';
11
- import { createPortal } from 'react-dom';
12
- import usePortal from '../../hooks/use-portal';
13
- import { generateClassNames, useForkRef } from '../../utils/functions';
14
- import { passEventToUnderLayingEvent } from './popper.utils';
15
- import { Position } from './types';
16
- var popperArrowPosition = (_popperArrowPosition = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_popperArrowPosition, Position.Auto, 'top-0 left-0 right-0 bottom-0'), Position.AutoStart, 'top-0 left-0 right-0 bottom-0'), Position.AutoEnd, 'top-0 left-0 right-0 bottom-0'), Position.Right, '-left-1'), Position.RightStart, '-left-1'), Position.RightEnd, '-left-1'), Position.Left, '-right-1'), Position.LeftStart, '-right-1'), Position.LeftEnd, '-right-1'), Position.Top, '-bottom-1'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_popperArrowPosition, Position.TopStart, '-bottom-1'), Position.TopEnd, '-bottom-1'), Position.Bottom, '-top-1'), Position.BottomStart, '-top-1'), Position.BottomEnd, '-top-1'));
17
- var Popper = function Popper(_ref) {
18
- var anchorEl = _ref.anchorEl,
19
- children = _ref.children,
20
- open = _ref.open,
21
- _ref$warning = _ref.warning,
22
- warning = _ref$warning === void 0 ? false : _ref$warning,
23
- _ref$position = _ref.position,
24
- initialPlacement = _ref$position === void 0 ? Position.Bottom : _ref$position,
25
- _ref$arrow = _ref.arrow,
26
- arrow = _ref$arrow === void 0 ? true : _ref$arrow,
27
- _ref$popperOptions = _ref.popperOptions,
28
- popperOptions = _ref$popperOptions === void 0 ? {} : _ref$popperOptions,
29
- _ref$overlay = _ref.overlay,
30
- overlay = _ref$overlay === void 0 ? false : _ref$overlay,
31
- _ref$zIndex = _ref.zIndex,
32
- zIndex = _ref$zIndex === void 0 ? 1300 : _ref$zIndex,
33
- _ref$enableUnderlayin = _ref.enableUnderlayingEvent,
34
- enableUnderlayingEvent = _ref$enableUnderlayin === void 0 ? false : _ref$enableUnderlayin,
35
- _ref$wrapperStyles = _ref.wrapperStyles,
36
- wrapperStyles = _ref$wrapperStyles === void 0 ? {} : _ref$wrapperStyles,
37
- _ref$disablePortal = _ref.disablePortal,
38
- disablePortal = _ref$disablePortal === void 0 ? false : _ref$disablePortal,
39
- onClick = _ref.onClick,
40
- ref = _ref.ref,
41
- rest = _objectWithoutProperties(_ref, _excluded);
42
- var target = usePortal(generateClassNames('Popper'));
43
- var popperRef = useRef(null);
44
- var handlePopperRef = useForkRef(popperRef, ref);
45
- useEffect(function () {
46
- if (!anchorEl || !open || popperRef.current === null) {
47
- return undefined;
48
- }
49
- var defaultModifiers = [{
50
- name: 'arrow',
51
- options: {
52
- element: '[data-popper-arrow]'
53
- }
54
- }, {
55
- name: 'offset',
56
- options: {
57
- offset: [0, 10]
58
- }
59
- }];
60
- var popperModifiers = arrow ? defaultModifiers : [];
61
- if (popperOptions && popperOptions.modifiers != null) {
62
- popperModifiers = popperModifiers.concat(popperOptions.modifiers);
63
- }
64
- var popper = createPopper(anchorEl, popperRef.current, _objectSpread(_objectSpread({
65
- placement: initialPlacement
66
- }, popperOptions), {}, {
67
- modifiers: popperModifiers
68
- }));
69
- handlePopperRef.current = popper;
70
- return function () {
71
- popper.destroy();
72
- handlePopperRef.current = null;
73
- };
74
- }, [anchorEl, open, popperOptions, initialPlacement, arrow]);
75
- var handleOnClicking = function handleOnClicking(event) {
76
- event.persist();
77
- event.preventDefault();
78
- event.stopPropagation();
79
- if (onClick) {
80
- onClick(event);
81
- }
82
- if (enableUnderlayingEvent) {
83
- passEventToUnderLayingEvent(event);
84
- }
85
- };
86
- var renderOverlay = function renderOverlay() {
87
- return /*#__PURE__*/React.createElement("div", {
88
- className: "fixed top-0 right-0 bottom-0 left-0 bg-transparent",
89
- onClick: handleOnClicking,
90
- onContextMenu: handleOnClicking
91
- });
92
- };
93
- var zIndexAdjusted = 1;
94
- if (zIndex === 0) zIndexAdjusted = 0;
95
- if (zIndex > 50) zIndexAdjusted = 50;
96
- if (zIndex > 10 && zIndex < 50) zIndexAdjusted = Math.floor(zIndex / 10) * 10;
97
- if (zIndex !== 0 && zIndex < 10) zIndexAdjusted = 10;
98
- var popperWrapClasses = "relative z-".concat(zIndexAdjusted);
99
- var render = function render() {
100
- return /*#__PURE__*/React.createElement("div", {
101
- className: popperWrapClasses,
102
- style: _objectSpread({}, wrapperStyles)
103
- }, overlay && open && renderOverlay(), /*#__PURE__*/React.createElement("div", _extends({
104
- className: !open ? 'hidden' : '',
105
- ref: handlePopperRef
106
- }, rest), children, arrow && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
107
- "data-popper-arrow": true,
108
- className: cn('absolute h-2 w-2 before:absolute before:top-0 before:left-0 before:-z-1 before:h-2 before:w-2 before:rotate-45 before:content-[""]', warning ? 'before:bg-background-orange' : 'before:bg-background-grey', popperArrowPosition[initialPlacement])
109
- }))));
110
- };
111
- return disablePortal ? render() : /*#__PURE__*/createPortal(render(), target);
112
- };
113
- export default Popper;
@@ -1,41 +0,0 @@
1
- import React from 'react';
2
- import type { Values } from '../../utils/types';
3
- import { Phases, Position, Strategy } from './types';
4
- export type PopperPositionType = Values<typeof Position>;
5
- export type PopperStrategyType = Values<typeof Strategy>;
6
- export type PopperPhasesType = Values<typeof Phases>;
7
- export type VirtualElement = {
8
- getBoundingClientRect: () => DOMRect;
9
- contextElement?: Element;
10
- };
11
- export type Modifiers = {
12
- data?: object;
13
- effect?: () => void;
14
- enabled?: boolean;
15
- fn?: () => void;
16
- name?: any;
17
- options?: object;
18
- phase?: PopperPhasesType;
19
- requires?: string[];
20
- requiresIfExists?: string[];
21
- }[];
22
- export type PopperOptions = {
23
- modifiers?: Modifiers;
24
- onFirstUpdate?: () => void;
25
- placement?: PopperPositionType;
26
- strategy?: PopperStrategyType;
27
- };
28
- export interface PopperProps extends React.HTMLAttributes<HTMLDivElement> {
29
- open: boolean;
30
- anchorEl?: Element | VirtualElement | null;
31
- position: PopperPositionType;
32
- popperOptions?: PopperOptions;
33
- wrapperStyles?: object;
34
- warning?: boolean;
35
- overlay?: boolean;
36
- arrow?: boolean;
37
- zIndex?: number;
38
- enableUnderlayingEvent?: boolean;
39
- disablePortal?: boolean;
40
- ref?: React.Ref<HTMLDivElement>;
41
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export declare const passEventToUnderLayingEvent: (event: React.MouseEvent<HTMLDivElement>) => void;
@@ -1,10 +0,0 @@
1
- export var passEventToUnderLayingEvent = function passEventToUnderLayingEvent(event) {
2
- setTimeout(function () {
3
- if (event.clientX && event.clientY) {
4
- var elem = document.elementFromPoint(event.clientX, event.clientY);
5
- if (elem) {
6
- elem.dispatchEvent(event.nativeEvent);
7
- }
8
- }
9
- }, 0);
10
- };
@@ -1,3 +0,0 @@
1
- export * from './position';
2
- export * from './strategy';
3
- export * from './phases';
@@ -1,3 +0,0 @@
1
- export * from './position';
2
- export * from './strategy';
3
- export * from './phases';
@@ -1,11 +0,0 @@
1
- export declare const Phases: {
2
- readonly AfterMain: "afterMain";
3
- readonly AfterRead: "afterRead";
4
- readonly AfterWrite: "afterWrite";
5
- readonly BeforeMain: "beforeMain";
6
- readonly BeforeRead: "beforeRead";
7
- readonly BeforeWrite: "beforeWrite";
8
- readonly Main: "main";
9
- readonly Read: "read";
10
- readonly Write: "write";
11
- };
@@ -1,11 +0,0 @@
1
- export var Phases = {
2
- AfterMain: 'afterMain',
3
- AfterRead: 'afterRead',
4
- AfterWrite: 'afterWrite',
5
- BeforeMain: 'beforeMain',
6
- BeforeRead: 'beforeRead',
7
- BeforeWrite: 'beforeWrite',
8
- Main: 'main',
9
- Read: 'read',
10
- Write: 'write'
11
- };
@@ -1,17 +0,0 @@
1
- export declare const Position: {
2
- readonly AutoStart: "auto-start";
3
- readonly Auto: "auto";
4
- readonly AutoEnd: "auto-end";
5
- readonly TopStart: "top-start";
6
- readonly Top: "top";
7
- readonly TopEnd: "top-end";
8
- readonly BottomStart: "bottom-start";
9
- readonly Bottom: "bottom";
10
- readonly BottomEnd: "bottom-end";
11
- readonly LeftStart: "left-start";
12
- readonly Left: "left";
13
- readonly LeftEnd: "left-end";
14
- readonly RightStart: "right-start";
15
- readonly Right: "right";
16
- readonly RightEnd: "right-end";
17
- };
@@ -1,17 +0,0 @@
1
- export var Position = {
2
- AutoStart: 'auto-start',
3
- Auto: 'auto',
4
- AutoEnd: 'auto-end',
5
- TopStart: 'top-start',
6
- Top: 'top',
7
- TopEnd: 'top-end',
8
- BottomStart: 'bottom-start',
9
- Bottom: 'bottom',
10
- BottomEnd: 'bottom-end',
11
- LeftStart: 'left-start',
12
- Left: 'left',
13
- LeftEnd: 'left-end',
14
- RightStart: 'right-start',
15
- Right: 'right',
16
- RightEnd: 'right-end'
17
- };
@@ -1,4 +0,0 @@
1
- export declare const Strategy: {
2
- readonly Absloute: "absolute";
3
- readonly Fixed: "fixed";
4
- };
@@ -1,4 +0,0 @@
1
- export var Strategy = {
2
- Absloute: 'absolute',
3
- Fixed: 'fixed'
4
- };
@@ -1,3 +0,0 @@
1
- export { default } from './radio.component';
2
- export type { RadioProps } from './radio.props';
3
- export * from './size';
@@ -1,2 +0,0 @@
1
- export { default } from './radio.component';
2
- export * from './size';
@@ -1,3 +0,0 @@
1
- import type { RadioProps } from './radio.props';
2
- declare const Radio: ({ size, checked, onChange, radioProps, readOnly, disabled, ref, ...rest }: RadioProps) => JSX.Element;
3
- export default Radio;
@@ -1,38 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["size", "checked", "onChange", "radioProps", "readOnly", "disabled", "ref"];
4
- import React from 'react';
5
- import { cn } from '../../utils/functions/shadcn-utils';
6
- import { RadioSize } from './size';
7
- var Radio = function Radio(_ref) {
8
- var _ref$size = _ref.size,
9
- size = _ref$size === void 0 ? RadioSize.Sm : _ref$size,
10
- _ref$checked = _ref.checked,
11
- checked = _ref$checked === void 0 ? false : _ref$checked,
12
- onChange = _ref.onChange,
13
- radioProps = _ref.radioProps,
14
- readOnly = _ref.readOnly,
15
- disabled = _ref.disabled,
16
- ref = _ref.ref,
17
- rest = _objectWithoutProperties(_ref, _excluded);
18
- var cursorStyleClasses = disabled ? 'cursor-default' : 'cursor-pointer';
19
- var radioInputClasses = cn('peer border-borders-primary-stateless absolute z-50 m-0 rounded-full border-1 border-solid opacity-0', cursorStyleClasses, "".concat(size == RadioSize.Sm && 'w-4 h-4'), "".concat(size == RadioSize.Md && 'w-5 h-5'));
20
- var radioBoxTransitionClasses = cn('peer-hover:before:transition-all peer-hover:before:duration-100 peer-hover:before:ease-out', 'peer-checked:before:transition-all peer-checked:before:duration-100 peer-checked:before:ease-out', 'peer-checked:after:transition-all peer-checked:after:duration-100 peer-checked:after:ease-out');
21
- var radioBoxClasses = cn('rounded-full border-1 border-solid box-content relative', "".concat(disabled ? 'border-borders-secondary' : 'border-borders-primary-stateless'), "".concat(size == RadioSize.Sm ? 'w-4 h-4' : ''), "".concat(size == RadioSize.Md ? 'w-5 h-5' : ''), 'before:bg-accent-stateless-0-4-opacity before:absolute before:top-1/2 before:left-1/2 before:-translate-x-1/2 before:-translate-y-1/2 before:block before:rounded-full before:opacity-0 before:content-[""] before:z-10', "".concat(size == RadioSize.Sm ? 'before:w-1.5 before:h-1.5' : ''), "".concat(size == RadioSize.Md ? 'before:w-2 before:h-2' : ''), "".concat(disabled ? 'before:cursor-default' : 'before:cursor-pointer'), 'after:absolute after:top-1/2 after:left-1/2 after:-translate-x-1/2 after:-translate-y-1/2 after:block after:rounded-full after:opacity-0 after:content-[""]', "".concat(size == RadioSize.Sm ? 'after:w-4 after:h-4' : ''), "".concat(size == RadioSize.Md ? 'after:w-5 after:h-5' : ''), "".concat(disabled ? 'after:cursor-default' : 'after:cursor-pointer'), "".concat(disabled ? 'after:bg-background-active' : 'after:bg-accent-primary'), "".concat(disabled ? 'after:opacity-100' : 'after:opacity-0'), 'peer-checked:before:opacity-100 peer-checked:before:bg-icons-invert peer-checked:after:opacity-100', "".concat(disabled ? 'peer-checked:after:bg-background-grey' : 'peer-checked:after:bg-accent-primary'), radioBoxTransitionClasses, 'peer-hover:before:opacity-100 ');
22
- return /*#__PURE__*/React.createElement("div", _extends({
23
- className: cn('items-[inherit] justify-[inherit] relative inline-flex', cursorStyleClasses)
24
- }, rest, {
25
- ref: ref
26
- }), /*#__PURE__*/React.createElement("input", _extends({
27
- className: radioInputClasses,
28
- type: "radio",
29
- checked: checked,
30
- onChange: readOnly || disabled ? undefined : onChange,
31
- disabled: disabled
32
- }, radioProps)), /*#__PURE__*/React.createElement("span", {
33
- className: "peer-checked:before:bg-icons-invert -order-1"
34
- }), /*#__PURE__*/React.createElement("div", {
35
- className: radioBoxClasses
36
- }));
37
- };
38
- export default Radio;
@@ -1,13 +0,0 @@
1
- import { ChangeEvent, Ref } from 'react';
2
- import { Values } from '../../utils/types';
3
- import { RadioSize } from './size';
4
- export type RadioSizeType = Values<typeof RadioSize>;
5
- export interface RadioProps extends React.HTMLAttributes<HTMLInputElement> {
6
- checked?: boolean;
7
- onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
8
- radioProps?: Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'>;
9
- readOnly?: boolean;
10
- disabled?: boolean;
11
- size?: RadioSizeType;
12
- ref?: Ref<HTMLDivElement>;
13
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- export declare const RadioSize: {
2
- readonly Sm: "sm";
3
- readonly Md: "md";
4
- };
@@ -1,4 +0,0 @@
1
- export var RadioSize = {
2
- Sm: 'sm',
3
- Md: 'md'
4
- };
@@ -1,2 +0,0 @@
1
- export { default } from './radio-group.component';
2
- export type { RadioGroupProps } from './radio-group.props';
@@ -1 +0,0 @@
1
- export { default } from './radio-group.component';
@@ -1,3 +0,0 @@
1
- import type { RadioGroupProps } from './radio-group.props';
2
- declare const RadioGroup: ({ label, radioProps, readOnly, disabled, radioStyles, labelStyles, onChange, size, checked, labelReverseOrder, ref, ...rest }: RadioGroupProps) => JSX.Element;
3
- export default RadioGroup;
@@ -1,48 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- var _excluded = ["label", "radioProps", "readOnly", "disabled", "radioStyles", "labelStyles", "onChange", "size", "checked", "labelReverseOrder", "ref"];
5
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
- import React from 'react';
8
- import { cn } from '../../utils/functions/shadcn-utils';
9
- import Radio, { RadioSize } from '../radio';
10
- var RadioGroup = function RadioGroup(_ref) {
11
- var label = _ref.label,
12
- radioProps = _ref.radioProps,
13
- readOnly = _ref.readOnly,
14
- disabled = _ref.disabled,
15
- radioStyles = _ref.radioStyles,
16
- labelStyles = _ref.labelStyles,
17
- onChange = _ref.onChange,
18
- _ref$size = _ref.size,
19
- size = _ref$size === void 0 ? RadioSize.Sm : _ref$size,
20
- _ref$checked = _ref.checked,
21
- checked = _ref$checked === void 0 ? false : _ref$checked,
22
- _ref$labelReverseOrde = _ref.labelReverseOrder,
23
- labelReverseOrder = _ref$labelReverseOrde === void 0 ? false : _ref$labelReverseOrde,
24
- ref = _ref.ref,
25
- rest = _objectWithoutProperties(_ref, _excluded);
26
- var cursorStyleClasses = disabled ? 'cursor-default' : 'cursor-pointer';
27
- var labelClasses = cn("flex items-center gap-2 ".concat(disabled ? 'text-textplaceholder' : 'text-textprimary'), cursorStyleClasses);
28
- var labelTextClasses = "".concat(labelReverseOrder ? 'order-2' : '');
29
- var radioGroupWraperClasses = cn('relative box-content inline-flex items-center', cursorStyleClasses);
30
- return /*#__PURE__*/React.createElement("span", _extends({
31
- className: radioGroupWraperClasses,
32
- ref: ref
33
- }, rest), /*#__PURE__*/React.createElement("label", {
34
- className: labelClasses,
35
- style: _objectSpread({}, labelStyles)
36
- }, /*#__PURE__*/React.createElement("span", {
37
- className: labelTextClasses
38
- }, label), /*#__PURE__*/React.createElement(Radio, {
39
- radioProps: radioProps,
40
- readOnly: readOnly,
41
- disabled: disabled,
42
- checked: checked,
43
- onChange: onChange,
44
- size: size,
45
- style: _objectSpread({}, radioStyles)
46
- })));
47
- };
48
- export default RadioGroup;
@@ -1,15 +0,0 @@
1
- import { Ref } from 'react';
2
- import { RadioSizeType } from '../radio/radio.props';
3
- export interface RadioGroupProps extends React.HTMLAttributes<HTMLLabelElement> {
4
- label?: React.ReactNode;
5
- radioProps?: React.InputHTMLAttributes<HTMLInputElement>;
6
- radioStyles?: object;
7
- labelStyles?: object;
8
- readOnly?: boolean;
9
- disabled?: boolean;
10
- labelReverseOrder?: boolean;
11
- checked?: boolean;
12
- size?: RadioSizeType;
13
- onChange?: (event: any) => void;
14
- ref?: Ref<HTMLLabelElement>;
15
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- export { default } from './switcher.component';
2
- export type { SwitcherProps } from './switcher.props';
3
- export * from './switcher-size';
@@ -1,2 +0,0 @@
1
- export { default } from './switcher.component';
2
- export * from './switcher-size';