@channel.io/bezier-react 1.7.0 → 1.7.2

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 (278) hide show
  1. package/dist/cjs/_virtual/_rollupPluginBabelHelpers.js +35 -0
  2. package/dist/cjs/_virtual/_rollupPluginBabelHelpers.js.map +1 -0
  3. package/dist/cjs/components/Banner/Banner.const.js +4 -2
  4. package/dist/cjs/components/Banner/Banner.const.js.map +1 -1
  5. package/dist/cjs/components/Forms/FormControl/FormControl.js +1 -1
  6. package/dist/cjs/components/Forms/FormControl/FormControl.js.map +1 -1
  7. package/dist/cjs/components/Forms/FormControl/FormControlContext.js +4 -3
  8. package/dist/cjs/components/Forms/FormControl/FormControlContext.js.map +1 -1
  9. package/dist/cjs/components/Forms/FormGroup/FormGroup.js +2 -2
  10. package/dist/cjs/components/Forms/FormGroup/FormGroup.js.map +1 -1
  11. package/dist/cjs/components/Forms/FormHelperText/FormHelperText.js +2 -2
  12. package/dist/cjs/components/Forms/FormHelperText/FormHelperText.js.map +1 -1
  13. package/dist/cjs/components/Forms/FormLabel/FormLabel.js +2 -2
  14. package/dist/cjs/components/Forms/FormLabel/FormLabel.js.map +1 -1
  15. package/dist/cjs/components/Forms/Inputs/mixins.js +41 -22
  16. package/dist/cjs/components/Forms/Inputs/mixins.js.map +1 -1
  17. package/dist/cjs/components/Forms/SegmentedControl/SegmentedControlContext.js +3 -15
  18. package/dist/cjs/components/Forms/SegmentedControl/SegmentedControlContext.js.map +1 -1
  19. package/dist/cjs/components/Forms/useFormFieldProps.js +2 -2
  20. package/dist/cjs/components/Forms/useFormFieldProps.js.map +1 -1
  21. package/dist/cjs/components/ListItem/ListItem.styled.js +1 -1
  22. package/dist/cjs/components/ListItem/utils.js +20 -8
  23. package/dist/cjs/components/ListItem/utils.js.map +1 -1
  24. package/dist/cjs/components/Modals/Modal/Modal.js.map +1 -1
  25. package/dist/cjs/components/Modals/Modal/Modal.types.js.map +1 -1
  26. package/dist/cjs/components/Modals/Modal/ModalAnimation.styled.js +57 -11
  27. package/dist/cjs/components/Modals/Modal/ModalAnimation.styled.js.map +1 -1
  28. package/dist/cjs/components/Modals/Modal/ModalContent.js +1 -1
  29. package/dist/cjs/components/Modals/Modal/ModalContent.js.map +1 -1
  30. package/dist/cjs/components/Modals/Modal/ModalContentContext.js +4 -6
  31. package/dist/cjs/components/Modals/Modal/ModalContentContext.js.map +1 -1
  32. package/dist/cjs/components/Modals/Modal/ModalHeader.js +1 -1
  33. package/dist/cjs/components/Modals/Modal/ModalHeader.js.map +1 -1
  34. package/dist/cjs/components/OutlineItem/OutlineItem.js +2 -3
  35. package/dist/cjs/components/OutlineItem/OutlineItem.js.map +1 -1
  36. package/dist/cjs/components/OutlineItem/OutlineItemContext.js +9 -5
  37. package/dist/cjs/components/OutlineItem/OutlineItemContext.js.map +1 -1
  38. package/dist/cjs/components/Overlay/utils.js +6 -2
  39. package/dist/cjs/components/Overlay/utils.js.map +1 -1
  40. package/dist/cjs/components/Spinner/Spinner.styled.js +1 -1
  41. package/dist/cjs/components/Tabs/TabAction.js +1 -1
  42. package/dist/cjs/components/Tabs/TabAction.js.map +1 -1
  43. package/dist/cjs/components/Tabs/TabItem.js +1 -1
  44. package/dist/cjs/components/Tabs/TabItem.js.map +1 -1
  45. package/dist/cjs/components/Tabs/TabList.js +1 -1
  46. package/dist/cjs/components/Tabs/TabList.js.map +1 -1
  47. package/dist/cjs/components/Tabs/TabListContext.js +4 -6
  48. package/dist/cjs/components/Tabs/TabListContext.js.map +1 -1
  49. package/dist/cjs/components/Toast/ToastContext.js +4 -6
  50. package/dist/cjs/components/Toast/ToastContext.js.map +1 -1
  51. package/dist/cjs/components/Toast/ToastProvider.js +2 -5
  52. package/dist/cjs/components/Toast/ToastProvider.js.map +1 -1
  53. package/dist/cjs/components/Toast/ToastService.js +9 -9
  54. package/dist/cjs/components/Toast/ToastService.js.map +1 -1
  55. package/dist/cjs/components/Toast/useToast.js +2 -3
  56. package/dist/cjs/components/Toast/useToast.js.map +1 -1
  57. package/dist/cjs/components/Toast/utils.js +11 -5
  58. package/dist/cjs/components/Toast/utils.js.map +1 -1
  59. package/dist/cjs/components/Tooltip/Tooltip.js +4 -16
  60. package/dist/cjs/components/Tooltip/Tooltip.js.map +1 -1
  61. package/dist/cjs/components/Tooltip/Tooltip.styled.js +3 -56
  62. package/dist/cjs/components/Tooltip/Tooltip.styled.js.map +1 -1
  63. package/dist/cjs/components/Tooltip/Tooltip.types.js.map +1 -1
  64. package/dist/cjs/features/FeatureProvider.js +4 -3
  65. package/dist/cjs/features/FeatureProvider.js.map +1 -1
  66. package/dist/cjs/features/SmoothCornersFeature/SmoothCornersFeature.js +2 -2
  67. package/dist/cjs/features/SmoothCornersFeature/SmoothCornersFeature.js.map +1 -1
  68. package/dist/cjs/index.js +1 -3
  69. package/dist/cjs/index.js.map +1 -1
  70. package/dist/cjs/node_modules/@babel/runtime/helpers/esm/extends.js +21 -0
  71. package/dist/cjs/node_modules/@babel/runtime/helpers/esm/extends.js.map +1 -0
  72. package/dist/cjs/node_modules/@radix-ui/react-checkbox/dist/index.js +4 -4
  73. package/dist/cjs/node_modules/@radix-ui/react-dialog/dist/index.js +12 -12
  74. package/dist/cjs/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +2 -2
  75. package/dist/cjs/node_modules/@radix-ui/react-focus-scope/dist/index.js +2 -2
  76. package/dist/cjs/node_modules/@radix-ui/react-popper/dist/index.js +3 -3
  77. package/dist/cjs/node_modules/@radix-ui/react-portal/dist/index.js +2 -2
  78. package/dist/cjs/node_modules/@radix-ui/react-primitive/dist/index.js +2 -2
  79. package/dist/cjs/node_modules/@radix-ui/react-radio-group/dist/index.js +7 -7
  80. package/dist/cjs/node_modules/@radix-ui/react-roving-focus/dist/index.js +4 -4
  81. package/dist/cjs/node_modules/@radix-ui/react-separator/dist/index.js +2 -2
  82. package/dist/cjs/node_modules/@radix-ui/react-slider/dist/index.js +10 -10
  83. package/dist/cjs/node_modules/@radix-ui/react-slot/dist/index.js +3 -3
  84. package/dist/cjs/node_modules/@radix-ui/react-switch/dist/index.js +4 -4
  85. package/dist/cjs/node_modules/@radix-ui/react-tabs/dist/index.js +7 -7
  86. package/dist/cjs/node_modules/@radix-ui/react-toggle-group/dist/index.js +0 -1
  87. package/dist/cjs/node_modules/@radix-ui/react-toggle-group/dist/index.js.map +1 -1
  88. package/dist/cjs/node_modules/@radix-ui/react-toolbar/dist/index.js +7 -7
  89. package/dist/cjs/node_modules/@radix-ui/react-tooltip/dist/index.js +7 -7
  90. package/dist/cjs/node_modules/@radix-ui/react-visually-hidden/dist/index.js +2 -2
  91. package/dist/cjs/node_modules/react-textarea-autosize/dist/react-textarea-autosize.esm.js +4 -4
  92. package/dist/cjs/node_modules/react-textarea-autosize/dist/react-textarea-autosize.esm.js.map +1 -1
  93. package/dist/cjs/node_modules/react-textarea-autosize/node_modules/@babel/runtime/helpers/esm/extends.js +21 -0
  94. package/dist/cjs/node_modules/react-textarea-autosize/node_modules/@babel/runtime/helpers/esm/extends.js.map +1 -0
  95. package/dist/cjs/node_modules/react-textarea-autosize/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +19 -0
  96. package/dist/cjs/node_modules/react-textarea-autosize/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js.map +1 -0
  97. package/dist/cjs/utils/reactUtils.js +21 -0
  98. package/dist/cjs/utils/reactUtils.js.map +1 -1
  99. package/dist/cjs/utils/styleUtils.js +26 -2
  100. package/dist/cjs/utils/styleUtils.js.map +1 -1
  101. package/dist/esm/_virtual/_rollupPluginBabelHelpers.mjs +31 -0
  102. package/dist/esm/_virtual/_rollupPluginBabelHelpers.mjs.map +1 -0
  103. package/dist/esm/components/Banner/Banner.const.mjs +4 -2
  104. package/dist/esm/components/Banner/Banner.const.mjs.map +1 -1
  105. package/dist/esm/components/Forms/FormControl/FormControl.mjs +2 -2
  106. package/dist/esm/components/Forms/FormControl/FormControl.mjs.map +1 -1
  107. package/dist/esm/components/Forms/FormControl/FormControlContext.mjs +3 -3
  108. package/dist/esm/components/Forms/FormControl/FormControlContext.mjs.map +1 -1
  109. package/dist/esm/components/Forms/FormGroup/FormGroup.mjs +1 -1
  110. package/dist/esm/components/Forms/FormGroup/FormGroup.mjs.map +1 -1
  111. package/dist/esm/components/Forms/FormHelperText/FormHelperText.mjs +1 -1
  112. package/dist/esm/components/Forms/FormHelperText/FormHelperText.mjs.map +1 -1
  113. package/dist/esm/components/Forms/FormLabel/FormLabel.mjs +1 -1
  114. package/dist/esm/components/Forms/FormLabel/FormLabel.mjs.map +1 -1
  115. package/dist/esm/components/Forms/Inputs/mixins.mjs +41 -22
  116. package/dist/esm/components/Forms/Inputs/mixins.mjs.map +1 -1
  117. package/dist/esm/components/Forms/SegmentedControl/SegmentedControlContext.mjs +3 -15
  118. package/dist/esm/components/Forms/SegmentedControl/SegmentedControlContext.mjs.map +1 -1
  119. package/dist/esm/components/Forms/useFormFieldProps.mjs +1 -1
  120. package/dist/esm/components/Forms/useFormFieldProps.mjs.map +1 -1
  121. package/dist/esm/components/ListItem/ListItem.styled.mjs +1 -1
  122. package/dist/esm/components/ListItem/utils.mjs +20 -8
  123. package/dist/esm/components/ListItem/utils.mjs.map +1 -1
  124. package/dist/esm/components/Modals/Modal/Modal.mjs.map +1 -1
  125. package/dist/esm/components/Modals/Modal/Modal.types.mjs.map +1 -1
  126. package/dist/esm/components/Modals/Modal/ModalAnimation.styled.mjs +57 -11
  127. package/dist/esm/components/Modals/Modal/ModalAnimation.styled.mjs.map +1 -1
  128. package/dist/esm/components/Modals/Modal/ModalContent.mjs +2 -2
  129. package/dist/esm/components/Modals/Modal/ModalContent.mjs.map +1 -1
  130. package/dist/esm/components/Modals/Modal/ModalContentContext.mjs +3 -4
  131. package/dist/esm/components/Modals/Modal/ModalContentContext.mjs.map +1 -1
  132. package/dist/esm/components/Modals/Modal/ModalHeader.mjs +3 -3
  133. package/dist/esm/components/Modals/Modal/ModalHeader.mjs.map +1 -1
  134. package/dist/esm/components/OutlineItem/OutlineItem.mjs +2 -3
  135. package/dist/esm/components/OutlineItem/OutlineItem.mjs.map +1 -1
  136. package/dist/esm/components/OutlineItem/OutlineItemContext.mjs +8 -3
  137. package/dist/esm/components/OutlineItem/OutlineItemContext.mjs.map +1 -1
  138. package/dist/esm/components/Overlay/utils.mjs +6 -2
  139. package/dist/esm/components/Overlay/utils.mjs.map +1 -1
  140. package/dist/esm/components/Spinner/Spinner.styled.mjs +1 -1
  141. package/dist/esm/components/Tabs/TabAction.mjs +3 -3
  142. package/dist/esm/components/Tabs/TabAction.mjs.map +1 -1
  143. package/dist/esm/components/Tabs/TabItem.mjs +3 -3
  144. package/dist/esm/components/Tabs/TabItem.mjs.map +1 -1
  145. package/dist/esm/components/Tabs/TabList.mjs +2 -2
  146. package/dist/esm/components/Tabs/TabList.mjs.map +1 -1
  147. package/dist/esm/components/Tabs/TabListContext.mjs +3 -4
  148. package/dist/esm/components/Tabs/TabListContext.mjs.map +1 -1
  149. package/dist/esm/components/Toast/ToastContext.mjs +3 -4
  150. package/dist/esm/components/Toast/ToastContext.mjs.map +1 -1
  151. package/dist/esm/components/Toast/ToastProvider.mjs +3 -6
  152. package/dist/esm/components/Toast/ToastProvider.mjs.map +1 -1
  153. package/dist/esm/components/Toast/ToastService.mjs +1 -1
  154. package/dist/esm/components/Toast/useToast.mjs +3 -4
  155. package/dist/esm/components/Toast/useToast.mjs.map +1 -1
  156. package/dist/esm/components/Toast/utils.mjs +11 -5
  157. package/dist/esm/components/Toast/utils.mjs.map +1 -1
  158. package/dist/esm/components/Tooltip/Tooltip.mjs +4 -16
  159. package/dist/esm/components/Tooltip/Tooltip.mjs.map +1 -1
  160. package/dist/esm/components/Tooltip/Tooltip.styled.mjs +3 -56
  161. package/dist/esm/components/Tooltip/Tooltip.styled.mjs.map +1 -1
  162. package/dist/esm/components/Tooltip/Tooltip.types.mjs.map +1 -1
  163. package/dist/esm/features/FeatureProvider.mjs +5 -4
  164. package/dist/esm/features/FeatureProvider.mjs.map +1 -1
  165. package/dist/esm/features/SmoothCornersFeature/SmoothCornersFeature.mjs +1 -1
  166. package/dist/esm/index.mjs +1 -2
  167. package/dist/esm/index.mjs.map +1 -1
  168. package/dist/esm/node_modules/@babel/runtime/helpers/esm/extends.mjs +17 -0
  169. package/dist/esm/node_modules/@babel/runtime/helpers/esm/extends.mjs.map +1 -0
  170. package/dist/esm/node_modules/@radix-ui/react-checkbox/dist/index.mjs +4 -4
  171. package/dist/esm/node_modules/@radix-ui/react-dialog/dist/index.mjs +12 -12
  172. package/dist/esm/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs +2 -2
  173. package/dist/esm/node_modules/@radix-ui/react-focus-scope/dist/index.mjs +2 -2
  174. package/dist/esm/node_modules/@radix-ui/react-popper/dist/index.mjs +3 -3
  175. package/dist/esm/node_modules/@radix-ui/react-portal/dist/index.mjs +2 -2
  176. package/dist/esm/node_modules/@radix-ui/react-primitive/dist/index.mjs +2 -2
  177. package/dist/esm/node_modules/@radix-ui/react-radio-group/dist/index.mjs +7 -7
  178. package/dist/esm/node_modules/@radix-ui/react-roving-focus/dist/index.mjs +4 -4
  179. package/dist/esm/node_modules/@radix-ui/react-separator/dist/index.mjs +2 -2
  180. package/dist/esm/node_modules/@radix-ui/react-slider/dist/index.mjs +10 -10
  181. package/dist/esm/node_modules/@radix-ui/react-slot/dist/index.mjs +3 -3
  182. package/dist/esm/node_modules/@radix-ui/react-switch/dist/index.mjs +4 -4
  183. package/dist/esm/node_modules/@radix-ui/react-tabs/dist/index.mjs +7 -7
  184. package/dist/esm/node_modules/@radix-ui/react-toggle-group/dist/index.mjs +0 -1
  185. package/dist/esm/node_modules/@radix-ui/react-toggle-group/dist/index.mjs.map +1 -1
  186. package/dist/esm/node_modules/@radix-ui/react-toolbar/dist/index.mjs +7 -7
  187. package/dist/esm/node_modules/@radix-ui/react-tooltip/dist/index.mjs +7 -7
  188. package/dist/esm/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs +2 -2
  189. package/dist/esm/node_modules/react-textarea-autosize/dist/react-textarea-autosize.esm.mjs +3 -3
  190. package/dist/esm/node_modules/react-textarea-autosize/dist/react-textarea-autosize.esm.mjs.map +1 -1
  191. package/dist/esm/node_modules/react-textarea-autosize/node_modules/@babel/runtime/helpers/esm/extends.mjs +17 -0
  192. package/dist/esm/node_modules/react-textarea-autosize/node_modules/@babel/runtime/helpers/esm/extends.mjs.map +1 -0
  193. package/dist/esm/node_modules/react-textarea-autosize/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.mjs +15 -0
  194. package/dist/esm/node_modules/react-textarea-autosize/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.mjs.map +1 -0
  195. package/dist/esm/utils/reactUtils.mjs +21 -1
  196. package/dist/esm/utils/reactUtils.mjs.map +1 -1
  197. package/dist/esm/utils/styleUtils.mjs +26 -2
  198. package/dist/esm/utils/styleUtils.mjs.map +1 -1
  199. package/dist/types/components/Forms/FormControl/FormControlContext.d.ts +1 -1
  200. package/dist/types/components/Forms/FormControl/FormControlContext.d.ts.map +1 -1
  201. package/dist/types/components/Forms/FormControl/index.d.ts +1 -1
  202. package/dist/types/components/Forms/FormControl/index.d.ts.map +1 -1
  203. package/dist/types/components/Forms/SegmentedControl/SegmentedControlContext.d.ts +3 -3
  204. package/dist/types/components/Forms/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
  205. package/dist/types/components/Forms/index.d.ts +1 -2
  206. package/dist/types/components/Forms/index.d.ts.map +1 -1
  207. package/dist/types/components/Forms/useFormFieldProps.d.ts.map +1 -1
  208. package/dist/types/components/Modals/Modal/Modal.types.d.ts +1 -1
  209. package/dist/types/components/Modals/Modal/Modal.types.d.ts.map +1 -1
  210. package/dist/types/components/Modals/Modal/ModalContentContext.d.ts +2 -3
  211. package/dist/types/components/Modals/Modal/ModalContentContext.d.ts.map +1 -1
  212. package/dist/types/components/Modals/Modal/ModalHeader.d.ts.map +1 -1
  213. package/dist/types/components/OutlineItem/OutlineItem.d.ts.map +1 -1
  214. package/dist/types/components/OutlineItem/OutlineItemContext.d.ts +4 -10
  215. package/dist/types/components/OutlineItem/OutlineItemContext.d.ts.map +1 -1
  216. package/dist/types/components/Tabs/TabAction.d.ts.map +1 -1
  217. package/dist/types/components/Tabs/TabItem.d.ts.map +1 -1
  218. package/dist/types/components/Tabs/TabListContext.d.ts +1 -2
  219. package/dist/types/components/Tabs/TabListContext.d.ts.map +1 -1
  220. package/dist/types/components/Toast/ToastContext.d.ts +1 -2
  221. package/dist/types/components/Toast/ToastContext.d.ts.map +1 -1
  222. package/dist/types/components/Toast/ToastProvider.d.ts.map +1 -1
  223. package/dist/types/components/Toast/useToast.d.ts.map +1 -1
  224. package/dist/types/components/Tooltip/Tooltip.d.ts.map +1 -1
  225. package/dist/types/components/Tooltip/Tooltip.styled.d.ts.map +1 -1
  226. package/dist/types/components/Tooltip/Tooltip.types.d.ts +3 -3
  227. package/dist/types/features/FeatureProvider.d.ts.map +1 -1
  228. package/dist/types/utils/reactUtils.d.ts +14 -0
  229. package/dist/types/utils/reactUtils.d.ts.map +1 -1
  230. package/package.json +1 -4
  231. package/src/components/Forms/FormControl/FormControl.tsx +3 -3
  232. package/src/components/Forms/FormControl/FormControlContext.ts +5 -2
  233. package/src/components/Forms/FormControl/index.ts +1 -1
  234. package/src/components/Forms/FormGroup/FormGroup.tsx +1 -1
  235. package/src/components/Forms/FormHelperText/FormHelperText.tsx +1 -1
  236. package/src/components/Forms/FormLabel/FormLabel.tsx +1 -1
  237. package/src/components/Forms/SegmentedControl/SegmentedControlContext.ts +3 -26
  238. package/src/components/Forms/Slider/Slider.test.tsx +11 -4
  239. package/src/components/Forms/index.ts +0 -2
  240. package/src/components/Forms/useFormFieldProps.ts +1 -2
  241. package/src/components/KeyValueListItem/KeyValueListItem.test.tsx +4 -1
  242. package/src/components/Modals/Modal/Modal.stories.tsx +1 -1
  243. package/src/components/Modals/Modal/Modal.tsx +0 -1
  244. package/src/components/Modals/Modal/Modal.types.ts +1 -1
  245. package/src/components/Modals/Modal/ModalContent.tsx +3 -3
  246. package/src/components/Modals/Modal/ModalContentContext.ts +5 -4
  247. package/src/components/Modals/Modal/ModalHeader.tsx +3 -6
  248. package/src/components/OutlineItem/OutlineItem.tsx +6 -4
  249. package/src/components/OutlineItem/OutlineItemContext.ts +16 -5
  250. package/src/components/Tabs/TabAction.tsx +3 -6
  251. package/src/components/Tabs/TabItem.tsx +3 -6
  252. package/src/components/Tabs/TabList.tsx +3 -3
  253. package/src/components/Tabs/TabListContext.ts +5 -4
  254. package/src/components/Toast/ToastContext.ts +5 -5
  255. package/src/components/Toast/ToastProvider.tsx +3 -5
  256. package/src/components/Toast/useToast.ts +3 -5
  257. package/src/components/Tooltip/Tooltip.stories.tsx +2 -2
  258. package/src/components/Tooltip/Tooltip.styled.ts +0 -77
  259. package/src/components/Tooltip/Tooltip.test.tsx +8 -2
  260. package/src/components/Tooltip/Tooltip.tsx +4 -27
  261. package/src/components/Tooltip/Tooltip.types.ts +3 -3
  262. package/src/components/Tooltip/index.ts +0 -1
  263. package/src/features/FeatureProvider.tsx +9 -6
  264. package/src/utils/reactUtils.ts +41 -0
  265. package/dist/cjs/components/Forms/useFormControlContext.js +0 -13
  266. package/dist/cjs/components/Forms/useFormControlContext.js.map +0 -1
  267. package/dist/cjs/components/OutlineItem/useOutlineItemContext.js +0 -16
  268. package/dist/cjs/components/OutlineItem/useOutlineItemContext.js.map +0 -1
  269. package/dist/esm/components/Forms/useFormControlContext.mjs +0 -9
  270. package/dist/esm/components/Forms/useFormControlContext.mjs.map +0 -1
  271. package/dist/esm/components/OutlineItem/useOutlineItemContext.mjs +0 -12
  272. package/dist/esm/components/OutlineItem/useOutlineItemContext.mjs.map +0 -1
  273. package/dist/types/components/Forms/useFormControlContext.d.ts +0 -3
  274. package/dist/types/components/Forms/useFormControlContext.d.ts.map +0 -1
  275. package/dist/types/components/OutlineItem/useOutlineItemContext.d.ts +0 -4
  276. package/dist/types/components/OutlineItem/useOutlineItemContext.d.ts.map +0 -1
  277. package/src/components/Forms/useFormControlContext.ts +0 -9
  278. package/src/components/OutlineItem/useOutlineItemContext.ts +0 -16
@@ -0,0 +1,35 @@
1
+ 'use strict';
2
+
3
+ function _defineProperty(obj, key, value) {
4
+ key = _toPropertyKey(key);
5
+ if (key in obj) {
6
+ Object.defineProperty(obj, key, {
7
+ value: value,
8
+ enumerable: true,
9
+ configurable: true,
10
+ writable: true
11
+ });
12
+ } else {
13
+ obj[key] = value;
14
+ }
15
+ return obj;
16
+ }
17
+ function _toPrimitive(input, hint) {
18
+ if (typeof input !== "object" || input === null) return input;
19
+ var prim = input[Symbol.toPrimitive];
20
+ if (prim !== undefined) {
21
+ var res = prim.call(input, hint || "default");
22
+ if (typeof res !== "object") return res;
23
+ throw new TypeError("@@toPrimitive must return a primitive value.");
24
+ }
25
+ return (hint === "string" ? String : Number)(input);
26
+ }
27
+ function _toPropertyKey(arg) {
28
+ var key = _toPrimitive(arg, "string");
29
+ return typeof key === "symbol" ? key : String(key);
30
+ }
31
+
32
+ exports.defineProperty = _defineProperty;
33
+ exports.toPrimitive = _toPrimitive;
34
+ exports.toPropertyKey = _toPropertyKey;
35
+ //# sourceMappingURL=_rollupPluginBabelHelpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_rollupPluginBabelHelpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -41,9 +41,11 @@ const TEXT_COLORS = {
41
41
  [Banner_types.BannerVariant.Alt]: 'txt-black-darker'
42
42
  };
43
43
  const ELEVATIONS = {
44
- [Banner_types.BannerVariant.Alt]: FoundationStyledComponent.css(["", ""], ({
44
+ [Banner_types.BannerVariant.Alt]: FoundationStyledComponent.css`
45
+ ${({
45
46
  foundation
46
- }) => foundation?.elevation?.ev2())
47
+ }) => foundation?.elevation?.ev2()}
48
+ `
47
49
  };
48
50
 
49
51
  exports.ACTION_BUTTON_COLOR_VARIANTS = ACTION_BUTTON_COLOR_VARIANTS;
@@ -1 +1 @@
1
- {"version":3,"file":"Banner.const.js","sources":["../../../../src/components/Banner/Banner.const.ts"],"sourcesContent":["import {\n type SemanticNames,\n css,\n} from '~/src/foundation'\n\nimport type { InjectedInterpolation } from '~/src/types/Foundation'\n\nimport { ButtonColorVariant } from '~/src/components/Button'\n\nimport { BannerVariant } from './Banner.types'\n\nexport const BACKGROUND_COLORS: Record<BannerVariant, SemanticNames> = {\n [BannerVariant.Default]: 'bg-black-lighter',\n [BannerVariant.Blue]: 'bgtxt-blue-lightest',\n [BannerVariant.Cobalt]: 'bgtxt-cobalt-lightest',\n [BannerVariant.Green]: 'bgtxt-green-lightest',\n [BannerVariant.Orange]: 'bgtxt-orange-lightest',\n [BannerVariant.Red]: 'bgtxt-red-lightest',\n [BannerVariant.Alt]: 'bg-grey-lighter',\n}\n\nexport const DEFAULT_ICON_COLORS: Record<BannerVariant, SemanticNames> = {\n [BannerVariant.Default]: 'txt-black-darker',\n [BannerVariant.Blue]: 'bgtxt-blue-normal',\n [BannerVariant.Cobalt]: 'bgtxt-cobalt-normal',\n [BannerVariant.Green]: 'bgtxt-green-normal',\n [BannerVariant.Orange]: 'bgtxt-orange-normal',\n [BannerVariant.Red]: 'bgtxt-red-normal',\n [BannerVariant.Alt]: 'bgtxt-red-normal',\n}\n\nexport const ACTION_BUTTON_COLOR_VARIANTS: Record<BannerVariant, ButtonColorVariant> = {\n [BannerVariant.Default]: ButtonColorVariant.MonochromeDark,\n [BannerVariant.Blue]: ButtonColorVariant.Blue,\n [BannerVariant.Cobalt]: ButtonColorVariant.Cobalt,\n [BannerVariant.Green]: ButtonColorVariant.Green,\n [BannerVariant.Orange]: ButtonColorVariant.Orange,\n [BannerVariant.Red]: ButtonColorVariant.Red,\n [BannerVariant.Alt]: ButtonColorVariant.MonochromeDark,\n}\n\nexport const TEXT_COLORS: Record<BannerVariant, SemanticNames> = {\n [BannerVariant.Default]: 'txt-black-darker',\n [BannerVariant.Blue]: 'bgtxt-blue-normal',\n [BannerVariant.Cobalt]: 'bgtxt-cobalt-normal',\n [BannerVariant.Green]: 'bgtxt-green-normal',\n [BannerVariant.Orange]: 'bgtxt-orange-normal',\n [BannerVariant.Red]: 'bgtxt-red-normal',\n [BannerVariant.Alt]: 'txt-black-darker',\n}\n\nexport const ELEVATIONS: { [key in BannerVariant]?: InjectedInterpolation } = {\n [BannerVariant.Alt]: css`\n ${({ foundation }) => foundation?.elevation?.ev2()}\n `,\n}\n"],"names":["BACKGROUND_COLORS","BannerVariant","Default","Blue","Cobalt","Green","Orange","Red","Alt","DEFAULT_ICON_COLORS","ACTION_BUTTON_COLOR_VARIANTS","ButtonColorVariant","MonochromeDark","TEXT_COLORS","ELEVATIONS","css","foundation","elevation","ev2"],"mappings":";;;;;;AAWO,MAAMA,iBAAuD,GAAG;AACrE,EAAA,CAACC,0BAAa,CAACC,OAAO,GAAG,kBAAkB;AAC3C,EAAA,CAACD,0BAAa,CAACE,IAAI,GAAG,qBAAqB;AAC3C,EAAA,CAACF,0BAAa,CAACG,MAAM,GAAG,uBAAuB;AAC/C,EAAA,CAACH,0BAAa,CAACI,KAAK,GAAG,sBAAsB;AAC7C,EAAA,CAACJ,0BAAa,CAACK,MAAM,GAAG,uBAAuB;AAC/C,EAAA,CAACL,0BAAa,CAACM,GAAG,GAAG,oBAAoB;EACzC,CAACN,0BAAa,CAACO,GAAG,GAAG,iBAAA;AACvB,EAAC;AAEM,MAAMC,mBAAyD,GAAG;AACvE,EAAA,CAACR,0BAAa,CAACC,OAAO,GAAG,kBAAkB;AAC3C,EAAA,CAACD,0BAAa,CAACE,IAAI,GAAG,mBAAmB;AACzC,EAAA,CAACF,0BAAa,CAACG,MAAM,GAAG,qBAAqB;AAC7C,EAAA,CAACH,0BAAa,CAACI,KAAK,GAAG,oBAAoB;AAC3C,EAAA,CAACJ,0BAAa,CAACK,MAAM,GAAG,qBAAqB;AAC7C,E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":["../../../../src/components/Banner/Banner.const.ts"],"sourcesContent":["import {\n type SemanticNames,\n css,\n} from '~/src/foundation'\n\nimport type { InjectedInterpolation } from '~/src/types/Foundation'\n\nimport { ButtonColorVariant } from '~/src/components/Button'\n\nimport { BannerVariant } from './Banner.types'\n\nexport const BACKGROUND_COLORS: Record<BannerVariant, SemanticNames> = {\n [BannerVariant.Default]: 'bg-black-lighter',\n [BannerVariant.Blue]: 'bgtxt-blue-lightest',\n [BannerVariant.Cobalt]: 'bgtxt-cobalt-lightest',\n [BannerVariant.Green]: 'bgtxt-green-lightest',\n [BannerVariant.Orange]: 'bgtxt-orange-lightest',\n [BannerVariant.Red]: 'bgtxt-red-lightest',\n [BannerVariant.Alt]: 'bg-grey-lighter',\n}\n\nexport const DEFAULT_ICON_COLORS: Record<BannerVariant, SemanticNames> = {\n [BannerVariant.Default]: 'txt-black-darker',\n [BannerVariant.Blue]: 'bgtxt-blue-normal',\n [BannerVariant.Cobalt]: 'bgtxt-cobalt-normal',\n [BannerVariant.Green]: 'bgtxt-green-normal',\n [BannerVariant.Orange]: 'bgtxt-orange-normal',\n [BannerVariant.Red]: 'bgtxt-red-normal',\n [BannerVariant.Alt]: 'bgtxt-red-normal',\n}\n\nexport const ACTION_BUTTON_COLOR_VARIANTS: Record<BannerVariant, ButtonColorVariant> = {\n [BannerVariant.Default]: ButtonColorVariant.MonochromeDark,\n [BannerVariant.Blue]: ButtonColorVariant.Blue,\n [BannerVariant.Cobalt]: ButtonColorVariant.Cobalt,\n [BannerVariant.Green]: ButtonColorVariant.Green,\n [BannerVariant.Orange]: ButtonColorVariant.Orange,\n [BannerVariant.Red]: ButtonColorVariant.Red,\n [BannerVariant.Alt]: ButtonColorVariant.MonochromeDark,\n}\n\nexport const TEXT_COLORS: Record<BannerVariant, SemanticNames> = {\n [BannerVariant.Default]: 'txt-black-darker',\n [BannerVariant.Blue]: 'bgtxt-blue-normal',\n [BannerVariant.Cobalt]: 'bgtxt-cobalt-normal',\n [BannerVariant.Green]: 'bgtxt-green-normal',\n [BannerVariant.Orange]: 'bgtxt-orange-normal',\n [BannerVariant.Red]: 'bgtxt-red-normal',\n [BannerVariant.Alt]: 'txt-black-darker',\n}\n\nexport const ELEVATIONS: { [key in BannerVariant]?: InjectedInterpolation } = {\n [BannerVariant.Alt]: css`\n ${({ foundation }) => foundation?.elevation?.ev2()}\n `,\n}\n"],"names":["BACKGROUND_COLORS","BannerVariant","Default","Blue","Cobalt","Green","Orange","Red","Alt","DEFAULT_ICON_COLORS","ACTION_BUTTON_COLOR_VARIANTS","ButtonColorVariant","MonochromeDark","TEXT_COLORS","ELEVATIONS","css","foundation","elevation","ev2"],"mappings":";;;;;;AAWO,MAAMA,iBAAuD,GAAG;AACrE,EAAA,CAACC,0BAAa,CAACC,OAAO,GAAG,kBAAkB;AAC3C,EAAA,CAACD,0BAAa,CAACE,IAAI,GAAG,qBAAqB;AAC3C,EAAA,CAACF,0BAAa,CAACG,MAAM,GAAG,uBAAuB;AAC/C,EAAA,CAACH,0BAAa,CAACI,KAAK,GAAG,sBAAsB;AAC7C,EAAA,CAACJ,0BAAa,CAACK,MAAM,GAAG,uBAAuB;AAC/C,EAAA,CAACL,0BAAa,CAACM,GAAG,GAAG,oBAAoB;EACzC,CAACN,0BAAa,CAACO,GAAG,GAAG,iBAAA;AACvB,EAAC;AAEM,MAAMC,mBAAyD,GAAG;AACvE,EAAA,CAACR,0BAAa,CAACC,OAAO,GAAG,kBAAkB;AAC3C,EAAA,CAACD,0BAAa,CAACE,IAAI,GAAG,mBAAmB;AACzC,EAAA,CAACF,0BAAa,CAACG,MAAM,GAAG,qBAAqB;AAC7C,EAAA,CAACH,0BAAa,CAACI,KAAK,GAAG,oBAAoB;AAC3C,EAAA,CAACJ,0BAAa,CAACK,MAAM,GAAG,qBAAqB;AAC7C,EAAA,CAACL,0BAAa,CAACM,GAAG,GAAG,kBAAkB;EACvC,CAACN,0BAAa,CAACO,GAAG,GAAG,kBAAA;AACvB,EAAC;AAEM,MAAME,4BAAuE,GAAG;AACrF,EAAA,CAACT,0BAAa,CAACC,OAAO,GAAGS,+BAAkB,CAACC,cAAc;AAC1D,EAAA,CAACX,0BAAa,CAACE,IAAI,GAAGQ,+BAAkB,CAACR,IAAI;AAC7C,EAAA,CAACF,0BAAa,CAACG,MAAM,GAAGO,+BAAkB,CAACP,MAAM;AACjD,EAAA,CAACH,0BAAa,CAACI,KAAK,GAAGM,+BAAkB,CAACN,KAAK;AAC/C,EAAA,CAACJ,0BAAa,CAACK,MAAM,GAAGK,+BAAkB,CAACL,MAAM;AACjD,EAAA,CAACL,0BAAa,CAACM,GAAG,GAAGI,+BAAkB,CAACJ,GAAG;AAC3C,EAAA,CAACN,0BAAa,CAACO,GAAG,GAAGG,+BAAkB,CAACC,cAAAA;AAC1C,EAAC;AAEM,MAAMC,WAAiD,GAAG;AAC/D,EAAA,CAACZ,0BAAa,CAACC,OAAO,GAAG,kBAAkB;AAC3C,EAAA,CAACD,0BAAa,CAACE,IAAI,GAAG,mBAAmB;AACzC,EAAA,CAACF,0BAAa,CAACG,MAAM,GAAG,qBAAqB;AAC7C,EAAA,CAACH,0BAAa,CAACI,KAAK,GAAG,oBAAoB;AAC3C,EAAA,CAACJ,0BAAa,CAACK,MAAM,GAAG,qBAAqB;AAC7C,EAAA,CAACL,0BAAa,CAACM,GAAG,GAAG,kBAAkB;EACvC,CAACN,0BAAa,CAACO,GAAG,GAAG,kBAAA;AACvB,EAAC;AAEM,MAAMM,UAA8D,GAAG;AAC5E,EAAA,CAACb,0BAAa,CAACO,GAAG,GAAGO,6BAAI,CAAA;AAC3B,IAAA,EAAM,CAAC;AAAEC,IAAAA,UAAAA;AAAW,GAAC,KAAKA,UAAU,EAAEC,SAAS,EAAEC,GAAG,EAAG,CAAA;AACvD,EAAA,CAAA;AACA;;;;;;;;"}
@@ -114,7 +114,7 @@ const FormControl = /*#__PURE__*/React.forwardRef(function FormControl({
114
114
  if (!children) {
115
115
  return null;
116
116
  }
117
- return /*#__PURE__*/React.createElement(FormControlContext.FormControlContext.Provider, {
117
+ return /*#__PURE__*/React.createElement(FormControlContext.FormControlContextProvider, {
118
118
  value: contextValue
119
119
  }, /*#__PURE__*/React.createElement(Container, Object.assign({}, bezierProps, {
120
120
  ref: forwardedRef,
@@ -1 +1 @@
1
- {"version":3,"file":"FormControl.js","sources":["../../../../../src/components/Forms/FormControl/FormControl.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useCallback,\n useMemo,\n useState,\n} from 'react'\n\nimport { Typography } from '~/src/foundation'\n\nimport useId from '~/src/hooks/useId'\nimport {\n omitBezierComponentProps,\n pickBezierComponentProps,\n} from '~/src/utils/propsUtils'\nimport { isNil } from '~/src/utils/typeUtils'\n\nimport { AlphaStack } from '~/src/components/AlphaStack'\n\n// eslint-disable-next-line no-restricted-imports\nimport FormFieldSize from '../FormFieldSize'\n\nimport {\n type ContainerProps,\n type ErrorMessagePropsGetter,\n type FieldPropsGetter,\n type FormControlProps,\n type GroupPropsGetter,\n type HelperTextPropsGetter,\n type LabelPropsGetter,\n} from './FormControl.types'\nimport { FormControlContext } from './FormControlContext'\n\nimport * as Styled from './FormControl.styled'\n\nexport const FORM_CONTROL_TEST_ID = 'bezier-react-form-control'\n\nconst Container = forwardRef<HTMLElement, ContainerProps>(function Container({\n labelPosition,\n children,\n testId,\n ...rest\n}, forwardedRef) {\n switch (labelPosition) {\n case 'top':\n return (\n <AlphaStack\n ref={forwardedRef}\n direction=\"vertical\"\n testId={testId}\n {...rest}\n >\n { children }\n </AlphaStack>\n )\n\n case 'left':\n default:\n return (\n <Styled.Grid\n ref={forwardedRef}\n data-testid={testId}\n {...rest}\n >\n { children }\n </Styled.Grid>\n )\n }\n})\n\nexport const FormControl = forwardRef<HTMLElement, FormControlProps>(function FormControl({\n id: idProp,\n testId = FORM_CONTROL_TEST_ID,\n labelPosition = 'top',\n leftLabelWrapperHeight = FormFieldSize.M,\n style,\n children,\n ...rest\n}, forwardedRef) {\n const [groupNode, setGroupNode] = useState<HTMLElement | null>(null)\n const [helperTextNode, setHelperTextNode] = useState<HTMLElement | null>(null)\n const [errorMessageNode, setErrorMessageNode] = useState<HTMLElement | null>(null)\n\n const id = useId(idProp, 'field')\n const groupId = `${id}-group`\n const labelId = `${id}-label`\n const helperTextId = `${id}-help-text`\n const errorMessageId = `${id}-error-message`\n\n const fieldId = groupNode ? undefined : id\n\n const describerId = useMemo(() => {\n if (errorMessageNode) { return errorMessageId }\n if (helperTextNode) { return helperTextId }\n return undefined\n }, [\n errorMessageNode,\n helperTextNode,\n errorMessageId,\n helperTextId,\n ])\n\n const bezierProps = useMemo(() => pickBezierComponentProps(rest), [rest])\n const formCommonProps = useMemo(() => omitBezierComponentProps(rest), [rest])\n\n const getGroupProps = useCallback<GroupPropsGetter>(ownProps => ({\n id: groupId,\n 'aria-labelledby': labelId,\n 'aria-describedby': describerId,\n ref: setGroupNode,\n ...ownProps,\n }), [\n groupId,\n labelId,\n describerId,\n ])\n\n const getLabelProps = useCallback<LabelPropsGetter>(ownProps => ({\n id: labelId,\n htmlFor: fieldId,\n typo: labelPosition === 'top' ? Typography.Size13 : Typography.Size14,\n Wrapper: labelPosition === 'top'\n ? Styled.TopLabelWrapper\n : Styled.LeftLabelWrapper,\n ...ownProps,\n }), [\n fieldId,\n labelId,\n labelPosition,\n ])\n\n const getFieldProps = useCallback<FieldPropsGetter>(ownProps => ({\n id: fieldId,\n 'aria-describedby': groupNode ? undefined : describerId,\n ...formCommonProps,\n ...ownProps,\n }), [\n fieldId,\n describerId,\n formCommonProps,\n groupNode,\n ])\n\n const getHelperTextProps = useCallback<HelperTextPropsGetter>(ownProps => ({\n id: helperTextId,\n visible: isNil(formCommonProps?.hasError) || !formCommonProps?.hasError,\n ref: setHelperTextNode,\n Wrapper: labelPosition === 'top'\n ? Styled.TopHelperTextWrapper\n : Styled.LeftHelperTextWrapper,\n ...ownProps,\n }), [\n helperTextId,\n labelPosition,\n formCommonProps,\n ])\n\n const getErrorMessageProps = useCallback<ErrorMessagePropsGetter>(ownProps => ({\n id: errorMessageId,\n visible: isNil(formCommonProps?.hasError) || formCommonProps?.hasError,\n ref: setErrorMessageNode,\n Wrapper: labelPosition === 'top'\n ? Styled.TopHelperTextWrapper\n : Styled.LeftHelperTextWrapper,\n ...ownProps,\n }), [\n errorMessageId,\n labelPosition,\n formCommonProps,\n ])\n\n const contextValue = useMemo(() => ({\n id,\n labelId,\n helperTextId,\n errorMessageId,\n getGroupProps,\n getLabelProps,\n getFieldProps,\n getHelperTextProps,\n getErrorMessageProps,\n ...formCommonProps,\n }), [\n id,\n labelId,\n helperTextId,\n errorMessageId,\n getGroupProps,\n getLabelProps,\n getFieldProps,\n getHelperTextProps,\n getErrorMessageProps,\n formCommonProps,\n ])\n\n const containerStyle = useMemo(() => ({\n ...style,\n '--bezier-form-control-left-label-wrapper-height': `${leftLabelWrapperHeight}px`,\n } as React.CSSProperties), [\n style,\n leftLabelWrapperHeight,\n ])\n\n if (!children) { return null }\n\n return (\n <FormControlContext.Provider value={contextValue}>\n <Container\n {...bezierProps}\n ref={forwardedRef}\n style={containerStyle}\n testId={testId}\n labelPosition={labelPosition}\n >\n { children }\n </Container>\n </FormControlContext.Provider>\n )\n})\n"],"names":["FORM_CONTROL_TEST_ID","Container","forwardRef","labelPosition","children","testId","rest","forwardedRef","React","createElement","AlphaStack","Object","assign","ref","direction","Styled","FormControl","id","idProp","leftLabelWrapperHeight","FormFieldSize","M","style","groupNode","setGroupNode","useState","helperTextNode","setHelperTextNode","errorMessageNode","setErrorMessageNode","useId","groupId","labelId","helperTextId","errorMessageId","fieldId","undefined","describerId","useMemo","bezierProps","pickBezierComponentProps","formCommonProps","omitBezierComponentProps","getGroupProps","useCallback","ownProps","getLabelProps","htmlFor","typo","Typography","Size13","Size14","Wrapper","getFieldProps","getHelperTextProps","visible","isNil","hasError","getErrorMessageProps","contextValue","containerStyle","FormControlContext","Provider","value"],"mappings":";;;;;;;;;;;;AAkCO,MAAMA,oBAAoB,GAAG,4BAA2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AA,KAAK,EAAEsC,cAAe;AACtBvD,IAAAA,MAAM,EAAEA,MAAO;AACfF,IAAAA,aAAa,EAAEA,aAAAA;GAEbC,CAAAA,EAAAA,QACO,CACgB,CAAC,CAAA;AAElC,CAAC;;;;;"}
1
+ {"version":3,"file":"FormControl.js","sources":["../../../../../src/components/Forms/FormControl/FormControl.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useCallback,\n useMemo,\n useState,\n} from 'react'\n\nimport { Typography } from '~/src/foundation'\n\nimport useId from '~/src/hooks/useId'\nimport {\n omitBezierComponentProps,\n pickBezierComponentProps,\n} from '~/src/utils/propsUtils'\nimport { isNil } from '~/src/utils/typeUtils'\n\nimport { AlphaStack } from '~/src/components/AlphaStack'\n\n// eslint-disable-next-line no-restricted-imports\nimport FormFieldSize from '../FormFieldSize'\n\nimport {\n type ContainerProps,\n type ErrorMessagePropsGetter,\n type FieldPropsGetter,\n type FormControlProps,\n type GroupPropsGetter,\n type HelperTextPropsGetter,\n type LabelPropsGetter,\n} from './FormControl.types'\nimport { FormControlContextProvider } from './FormControlContext'\n\nimport * as Styled from './FormControl.styled'\n\nexport const FORM_CONTROL_TEST_ID = 'bezier-react-form-control'\n\nconst Container = forwardRef<HTMLElement, ContainerProps>(function Container({\n labelPosition,\n children,\n testId,\n ...rest\n}, forwardedRef) {\n switch (labelPosition) {\n case 'top':\n return (\n <AlphaStack\n ref={forwardedRef}\n direction=\"vertical\"\n testId={testId}\n {...rest}\n >\n { children }\n </AlphaStack>\n )\n\n case 'left':\n default:\n return (\n <Styled.Grid\n ref={forwardedRef}\n data-testid={testId}\n {...rest}\n >\n { children }\n </Styled.Grid>\n )\n }\n})\n\nexport const FormControl = forwardRef<HTMLElement, FormControlProps>(function FormControl({\n id: idProp,\n testId = FORM_CONTROL_TEST_ID,\n labelPosition = 'top',\n leftLabelWrapperHeight = FormFieldSize.M,\n style,\n children,\n ...rest\n}, forwardedRef) {\n const [groupNode, setGroupNode] = useState<HTMLElement | null>(null)\n const [helperTextNode, setHelperTextNode] = useState<HTMLElement | null>(null)\n const [errorMessageNode, setErrorMessageNode] = useState<HTMLElement | null>(null)\n\n const id = useId(idProp, 'field')\n const groupId = `${id}-group`\n const labelId = `${id}-label`\n const helperTextId = `${id}-help-text`\n const errorMessageId = `${id}-error-message`\n\n const fieldId = groupNode ? undefined : id\n\n const describerId = useMemo(() => {\n if (errorMessageNode) { return errorMessageId }\n if (helperTextNode) { return helperTextId }\n return undefined\n }, [\n errorMessageNode,\n helperTextNode,\n errorMessageId,\n helperTextId,\n ])\n\n const bezierProps = useMemo(() => pickBezierComponentProps(rest), [rest])\n const formCommonProps = useMemo(() => omitBezierComponentProps(rest), [rest])\n\n const getGroupProps = useCallback<GroupPropsGetter>(ownProps => ({\n id: groupId,\n 'aria-labelledby': labelId,\n 'aria-describedby': describerId,\n ref: setGroupNode,\n ...ownProps,\n }), [\n groupId,\n labelId,\n describerId,\n ])\n\n const getLabelProps = useCallback<LabelPropsGetter>(ownProps => ({\n id: labelId,\n htmlFor: fieldId,\n typo: labelPosition === 'top' ? Typography.Size13 : Typography.Size14,\n Wrapper: labelPosition === 'top'\n ? Styled.TopLabelWrapper\n : Styled.LeftLabelWrapper,\n ...ownProps,\n }), [\n fieldId,\n labelId,\n labelPosition,\n ])\n\n const getFieldProps = useCallback<FieldPropsGetter>(ownProps => ({\n id: fieldId,\n 'aria-describedby': groupNode ? undefined : describerId,\n ...formCommonProps,\n ...ownProps,\n }), [\n fieldId,\n describerId,\n formCommonProps,\n groupNode,\n ])\n\n const getHelperTextProps = useCallback<HelperTextPropsGetter>(ownProps => ({\n id: helperTextId,\n visible: isNil(formCommonProps?.hasError) || !formCommonProps?.hasError,\n ref: setHelperTextNode,\n Wrapper: labelPosition === 'top'\n ? Styled.TopHelperTextWrapper\n : Styled.LeftHelperTextWrapper,\n ...ownProps,\n }), [\n helperTextId,\n labelPosition,\n formCommonProps,\n ])\n\n const getErrorMessageProps = useCallback<ErrorMessagePropsGetter>(ownProps => ({\n id: errorMessageId,\n visible: isNil(formCommonProps?.hasError) || formCommonProps?.hasError,\n ref: setErrorMessageNode,\n Wrapper: labelPosition === 'top'\n ? Styled.TopHelperTextWrapper\n : Styled.LeftHelperTextWrapper,\n ...ownProps,\n }), [\n errorMessageId,\n labelPosition,\n formCommonProps,\n ])\n\n const contextValue = useMemo(() => ({\n id,\n labelId,\n helperTextId,\n errorMessageId,\n getGroupProps,\n getLabelProps,\n getFieldProps,\n getHelperTextProps,\n getErrorMessageProps,\n ...formCommonProps,\n }), [\n id,\n labelId,\n helperTextId,\n errorMessageId,\n getGroupProps,\n getLabelProps,\n getFieldProps,\n getHelperTextProps,\n getErrorMessageProps,\n formCommonProps,\n ])\n\n const containerStyle = useMemo(() => ({\n ...style,\n '--bezier-form-control-left-label-wrapper-height': `${leftLabelWrapperHeight}px`,\n } as React.CSSProperties), [\n style,\n leftLabelWrapperHeight,\n ])\n\n if (!children) { return null }\n\n return (\n <FormControlContextProvider value={contextValue}>\n <Container\n {...bezierProps}\n ref={forwardedRef}\n style={containerStyle}\n testId={testId}\n labelPosition={labelPosition}\n >\n { children }\n </Container>\n </FormControlContextProvider>\n )\n})\n"],"names":["FORM_CONTROL_TEST_ID","Container","forwardRef","labelPosition","children","testId","rest","forwardedRef","React","createElement","AlphaStack","Object","assign","ref","direction","Styled","FormControl","id","idProp","leftLabelWrapperHeight","FormFieldSize","M","style","groupNode","setGroupNode","useState","helperTextNode","setHelperTextNode","errorMessageNode","setErrorMessageNode","useId","groupId","labelId","helperTextId","errorMessageId","fieldId","undefined","describerId","useMemo","bezierProps","pickBezierComponentProps","formCommonProps","omitBezierComponentProps","getGroupProps","useCallback","ownProps","getLabelProps","htmlFor","typo","Typography","Size13","Size14","Wrapper","getFieldProps","getHelperTextProps","visible","isNil","hasError","getErrorMessageProps","contextValue","containerStyle","FormControlContextProvider","value"],"mappings":";;;;;;;;;;;;AAkCO,MAAMA,oBAAoB,GAAG,4BAA2B;AAE/D,MAAMC,SAAS,gB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MAAM,EAAEA,MAAO;AACfF,IAAAA,aAAa,EAAEA,aAAAA;GAEbC,CAAAA,EAAAA,QACO,CACe,CAAC,CAAA;AAEjC,CAAC;;;;;"}
@@ -1,8 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var React = require('react');
3
+ var reactUtils = require('../../../utils/reactUtils.js');
4
4
 
5
- const FormControlContext = /*#__PURE__*/React.createContext(undefined);
5
+ const [FormControlContextProvider, useFormControlContext] = reactUtils.createContext(undefined);
6
6
 
7
- exports.FormControlContext = FormControlContext;
7
+ exports.FormControlContextProvider = FormControlContextProvider;
8
+ exports.useFormControlContext = useFormControlContext;
8
9
  //# sourceMappingURL=FormControlContext.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormControlContext.js","sources":["../../../../../src/components/Forms/FormControl/FormControlContext.ts"],"sourcesContent":["import { createContext } from 'react'\n\nimport { type FormControlContextValue } from '~/src/components/Forms/FormControl'\n\nexport const FormControlContext = createContext<FormControlContextValue | undefined>(undefined)\n"],"names":["FormControlContext","createContext","undefined"],"mappings":";;;;MAIaA,kBAAkB,gBAAGC,mBAAa,CAAsCC,SAAS;;;;"}
1
+ {"version":3,"file":"FormControlContext.js","sources":["../../../../../src/components/Forms/FormControl/FormControlContext.ts"],"sourcesContent":["import { createContext } from '~/src/utils/reactUtils'\n\nimport { type FormControlContextValue } from '~/src/components/Forms/FormControl'\n\nexport const [\n FormControlContextProvider,\n useFormControlContext,\n] = createContext<FormControlContextValue | undefined>(undefined)\n"],"names":["FormControlContextProvider","useFormControlContext","createContext","undefined"],"mappings":";;;;AAIO,MAAM,CACXA,0BAA0B,EAC1BC,qBAAqB,CACtB,GAAGC,wBAAa,CAAsCC,SAAS;;;;;"}
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var React = require('react');
6
6
  var useMergeRefs = require('../../../hooks/useMergeRefs.js');
7
7
  var functionUtils = require('../../../utils/functionUtils.js');
8
- var useFormControlContext = require('../useFormControlContext.js');
9
8
  var FormGroup_styled = require('./FormGroup.styled.js');
9
+ var FormControlContext = require('../FormControl/FormControlContext.js');
10
10
 
11
11
  const FORM_GROUP_TEST_ID = 'bezier-react-form-group';
12
12
  function FormGroup({
@@ -17,7 +17,7 @@ function FormGroup({
17
17
  children,
18
18
  ...rest
19
19
  }, forwardedRef) {
20
- const contextValue = useFormControlContext.default();
20
+ const contextValue = FormControlContext.useFormControlContext();
21
21
  const {
22
22
  ref,
23
23
  ...ownProps
@@ -1 +1 @@
1
- {"version":3,"file":"FormGroup.js","sources":["../../../../../src/components/Forms/FormGroup/FormGroup.tsx"],"sourcesContent":["import React, { forwardRef } from 'react'\n\nimport useMergeRefs from '~/src/hooks/useMergeRefs'\nimport { noop } from '~/src/utils/functionUtils'\n\nimport useFormControlContext from '~/src/components/Forms/useFormControlContext'\n\nimport type FormGroupProps from './FormGroup.types'\n\nimport * as Styled from './FormGroup.styled'\n\nconst FORM_GROUP_TEST_ID = 'bezier-react-form-group'\n\nfunction FormGroup({\n testId = FORM_GROUP_TEST_ID,\n spacing = 6,\n direction = 'vertical',\n role = 'group',\n children,\n ...rest\n}: FormGroupProps,\nforwardedRef: React.Ref<HTMLDivElement>,\n) {\n const contextValue = useFormControlContext()\n\n const {\n ref,\n ...ownProps\n } = contextValue?.getGroupProps(rest) ?? {\n ref: noop,\n ...rest,\n }\n\n const mergedRef = useMergeRefs(ref, forwardedRef)\n\n return (\n <Styled.Stack\n {...ownProps}\n data-testid={testId}\n ref={mergedRef}\n justify=\"start\"\n align=\"stretch\"\n spacing={spacing}\n direction={direction}\n role={role}\n >\n { children }\n </Styled.Stack>\n )\n}\n\nexport default forwardRef(FormGroup)\n"],"names":["FORM_GROUP_TEST_ID","FormGroup","testId","spacing","direction","role","children","rest","forwardedRef","contextValue","useFormControlContext","ref","ownProps","getGroupProps","noop","mergedRef","useMergeRefs","React","createElement","Styled","Object","assign","justify","align","forwardRef"],"mappings":";;;;;;;;;;AAWA,MAAMA,kBAAkB,GAAG,yBAAyB,CAAA;AAEpD,SAASC,SAASA,CAAC;AACjBC,EAAAA,MAAM,GAAGF,kBAAkB;AAC3BG,EAAAA,OAAO,GAAG,CAAC;AACXC,EAAAA,SAAS,GAAG,UAAU;AACtBC,EAAAA,IAAI,GAAG,OAAO;EACdC,QAAQ;EACR,GAAGC,IAAAA;AACW,CAAC,EACjBC,YAAuC,EACrC;AACA,EAAA,MAAMC,YAAY,GAAGC,6BAAqB,EAAE,CAAA;EAE5C,MAAM;IACJC,GAAG;IACH,GAAGC,QAAAA;AACL,GAAC,GAAGH,YAAY,EAAEI,aAAa,CAACN,IAAI,CAAC,IAAI;AACvCI,IAAAA,GAAG,EAAEG,kBAAI;IACT,GAAGP,IAAAA;GACJ,CAAA;AAED,EAAA,MAAMQ,SAAS,GAAGC,oBAAY,CAACL,GAAG,EAAEH,YAAY,CAAC,CAAA;AAEjD,EAAA,oBACES,KAAA,CAAAC,aAAA,CAACC,sBAAY,EAAAC,MAAA,CAAAC,MAAA,CAAA,EAAA,EACPT,QAAQ,EAAA;AACZ,IAAA,aAAA,EAAaV,MAAO;AACpBS,IAAAA,GAAG,EAAEI,SAAU;AACfO,IAAAA,OAAO,EAAC,OAAO;AACfC,IAAAA,KAAK,EAAC,SAAS;AACfpB,IAAAA,OAAO,EAAEA,OAAQ;AACjBC,IAAAA,SAAS,EAAEA,SAAU;AACrBC,IAAAA,IAAI,EAAEA,IAAAA;AAAK,GAAA,CAAA,EAETC,QACU,CAAC,CAAA;AAEnB,CAAA;AAEA,kBAAekB,aAAAA,gBAAU,CAACvB,SAAS,CAAC;;;;"}
1
+ {"version":3,"file":"FormGroup.js","sources":["../../../../../src/components/Forms/FormGroup/FormGroup.tsx"],"sourcesContent":["import React, { forwardRef } from 'react'\n\nimport useMergeRefs from '~/src/hooks/useMergeRefs'\nimport { noop } from '~/src/utils/functionUtils'\n\nimport { useFormControlContext } from '~/src/components/Forms/FormControl'\n\nimport type FormGroupProps from './FormGroup.types'\n\nimport * as Styled from './FormGroup.styled'\n\nconst FORM_GROUP_TEST_ID = 'bezier-react-form-group'\n\nfunction FormGroup({\n testId = FORM_GROUP_TEST_ID,\n spacing = 6,\n direction = 'vertical',\n role = 'group',\n children,\n ...rest\n}: FormGroupProps,\nforwardedRef: React.Ref<HTMLDivElement>,\n) {\n const contextValue = useFormControlContext()\n\n const {\n ref,\n ...ownProps\n } = contextValue?.getGroupProps(rest) ?? {\n ref: noop,\n ...rest,\n }\n\n const mergedRef = useMergeRefs(ref, forwardedRef)\n\n return (\n <Styled.Stack\n {...ownProps}\n data-testid={testId}\n ref={mergedRef}\n justify=\"start\"\n align=\"stretch\"\n spacing={spacing}\n direction={direction}\n role={role}\n >\n { children }\n </Styled.Stack>\n )\n}\n\nexport default forwardRef(FormGroup)\n"],"names":["FORM_GROUP_TEST_ID","FormGroup","testId","spacing","direction","role","children","rest","forwardedRef","contextValue","useFormControlContext","ref","ownProps","getGroupProps","noop","mergedRef","useMergeRefs","React","createElement","Styled","Object","assign","justify","align","forwardRef"],"mappings":";;;;;;;;;;AAWA,MAAMA,kBAAkB,GAAG,yBAAyB,CAAA;AAEpD,SAASC,SAASA,CAAC;AACjBC,EAAAA,MAAM,GAAGF,kBAAkB;AAC3BG,EAAAA,OAAO,GAAG,CAAC;AACXC,EAAAA,SAAS,GAAG,UAAU;AACtBC,EAAAA,IAAI,GAAG,OAAO;EACdC,QAAQ;EACR,GAAGC,IAAAA;AACW,CAAC,EACjBC,YAAuC,EACrC;AACA,EAAA,MAAMC,YAAY,GAAGC,wCAAqB,EAAE,CAAA;EAE5C,MAAM;IACJC,GAAG;IACH,GAAGC,QAAAA;AACL,GAAC,GAAGH,YAAY,EAAEI,aAAa,CAACN,IAAI,CAAC,IAAI;AACvCI,IAAAA,GAAG,EAAEG,kBAAI;IACT,GAAGP,IAAAA;GACJ,CAAA;AAED,EAAA,MAAMQ,SAAS,GAAGC,oBAAY,CAACL,GAAG,EAAEH,YAAY,CAAC,CAAA;AAEjD,EAAA,oBACES,KAAA,CAAAC,aAAA,CAACC,sBAAY,EAAAC,MAAA,CAAAC,MAAA,CAAA,EAAA,EACPT,QAAQ,EAAA;AACZ,IAAA,aAAA,EAAaV,MAAO;AACpBS,IAAAA,GAAG,EAAEI,SAAU;AACfO,IAAAA,OAAO,EAAC,OAAO;AACfC,IAAAA,KAAK,EAAC,SAAS;AACfpB,IAAAA,OAAO,EAAEA,OAAQ;AACjBC,IAAAA,SAAS,EAAEA,SAAU;AACrBC,IAAAA,IAAI,EAAEA,IAAAA;AAAK,GAAA,CAAA,EAETC,QACU,CAAC,CAAA;AAEnB,CAAA;AAEA,kBAAekB,aAAAA,gBAAU,CAACvB,SAAS,CAAC;;;;"}
@@ -4,8 +4,8 @@ var React = require('react');
4
4
  var useMergeRefs = require('../../../hooks/useMergeRefs.js');
5
5
  var functionUtils = require('../../../utils/functionUtils.js');
6
6
  var typeUtils = require('../../../utils/typeUtils.js');
7
- var useFormControlContext = require('../useFormControlContext.js');
8
7
  var FormHelperText_styled = require('./FormHelperText.styled.js');
8
+ var FormControlContext = require('../FormControl/FormControlContext.js');
9
9
  var Typography = require('../../../foundation/Typography.js');
10
10
 
11
11
  const FORM_HELPER_TEXT_TEST_ID = 'bezier-react-form-helper-text';
@@ -17,7 +17,7 @@ const BaseHelperText = /*#__PURE__*/React.forwardRef(({
17
17
  children,
18
18
  ...rest
19
19
  }, forwardedRef) => {
20
- const contextValue = useFormControlContext.default();
20
+ const contextValue = FormControlContext.useFormControlContext();
21
21
  const getProps = type === 'info' ? contextValue?.getHelperTextProps : contextValue?.getErrorMessageProps;
22
22
  const {
23
23
  visible,
@@ -1 +1 @@
1
- {"version":3,"file":"FormHelperText.js","sources":["../../../../../src/components/Forms/FormHelperText/FormHelperText.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useMemo,\n} from 'react'\n\nimport { Typography } from '~/src/foundation'\n\nimport useMergeRefs from '~/src/hooks/useMergeRefs'\nimport { noop } from '~/src/utils/functionUtils'\nimport { isEmpty } from '~/src/utils/typeUtils'\n\nimport useFormControlContext from '~/src/components/Forms/useFormControlContext'\n\nimport type {\n BaseHelperTextProps,\n FormErrorMessageProps,\n FormHelperTextProps,\n} from './FormHelperText.types'\n\nimport * as Styled from './FormHelperText.styled'\n\ntype ForwardedRef = React.Ref<HTMLParamElement>\n\nexport const FORM_HELPER_TEXT_TEST_ID = 'bezier-react-form-helper-text'\nexport const FORM_ERROR_MESSAGE_TEST_ID = 'bezier-react-form-error-message'\n\nconst BaseHelperText = forwardRef(({\n as = 'p',\n type,\n typo = Typography.Size13,\n children,\n ...rest\n}: BaseHelperTextProps,\nforwardedRef: ForwardedRef,\n) => {\n const contextValue = useFormControlContext()\n const getProps = type === 'info'\n ? contextValue?.getHelperTextProps\n : contextValue?.getErrorMessageProps\n\n const {\n visible,\n ref,\n Wrapper,\n ...ownProps\n } = getProps?.(rest) ?? {\n visible: true,\n ref: noop,\n Wrapper: React.Fragment,\n ...rest,\n }\n\n const mergedRef = useMergeRefs(ref, forwardedRef)\n\n const shouldRendered = useMemo(() => (\n !isEmpty(children) && visible\n ), [\n visible,\n children,\n ])\n\n if (!shouldRendered) { return null }\n\n return (\n <Wrapper>\n <Styled.HelperText\n {...ownProps}\n ref={mergedRef}\n forwardedAs={as}\n typo={typo}\n >\n { children }\n </Styled.HelperText>\n </Wrapper>\n )\n})\n\nexport const FormHelperText = forwardRef(({\n testId = FORM_HELPER_TEXT_TEST_ID,\n color = 'txt-black-dark',\n children,\n ...rest\n}: FormHelperTextProps,\nforwardedRef: ForwardedRef,\n) => (\n <BaseHelperText\n {...rest}\n type=\"info\"\n ref={forwardedRef}\n testId={testId}\n color={color}\n >\n { children }\n </BaseHelperText>\n))\n\nexport const FormErrorMessage = forwardRef(({\n testId = FORM_ERROR_MESSAGE_TEST_ID,\n color = 'bgtxt-orange-normal',\n children,\n ...rest\n}: FormErrorMessageProps,\nforwardedRef: ForwardedRef,\n) => (\n <BaseHelperText\n {...rest}\n aria-live=\"polite\"\n type=\"error\"\n ref={forwardedRef}\n testId={testId}\n color={color}\n >\n { children }\n </BaseHelperText>\n))\n"],"names":["FORM_HELPER_TEXT_TEST_ID","FORM_ERROR_MESSAGE_TEST_ID","BaseHelperText","forwardRef","as","type","typo","Typography","Size13","children","rest","forwardedRef","contextValue","useFormControlContext","getProps","getHelperTextProps","getErrorMessageProps","visible","ref","Wrapper","ownProps","noop","React","Fragment","mergedRef","useMergeRefs","shouldRendered","useMemo","isEmpty","createElement","Styled","Object","assign","forwardedAs","FormHelperText","testId","color","FormErrorMessage"],"mappings":";;;;;;;;;;AAuBO,MAAMA,wBAAwB,GAAG,gCAA+B;AAChE,MAAMC,0BAA0B,GAAG,kCAAiC;AAE3E,MAAMC,cAAc,gBAAGC,gBAAU,CAAC,CAAC;AACjCC,EAAAA,EAAE,GAAG,GAAG;EACRC,IAAI;EACJC,IAAI,GAAGC,qBAAU,CAACC,MAAM;EACxBC,QAAQ;EACR,GAAGC,IAAAA;AACgB,CAAC,EACtBC,YAA0B,KACrB;AACH,EAAA,MAAMC,YAAY,GAAGC,6BAAqB,EAAE,CAAA;AAC5C,EAAA,MAAMC,QAAQ,GAAGT,IAAI,KAAK,MAAM,GAC5BO,YAAY,EAAEG,kBAAkB,GAChCH,YAAY,EAAEI,oBAAoB,CAAA;EAEtC,MAAM;IACJC,OAAO;IACPC,GAAG;IACHC,OAAO;IACP,GAAGC,QAAAA;AACL,GAAC,GAAGN,QAAQ,GAAGJ,IAAI,CAAC,IAAI;AACtBO,IAAAA,OAAO,EAAE,IAAI;AACbC,IAAAA,GAAG,EAAEG,kBAAI;IACTF,OAAO,EAAEG,KAAK,CAACC,QAAQ;IACvB,GAAGb,IAAAA;GACJ,CAAA;AAED,EAAA,MAAMc,SAAS,GAAGC,oBAAY,CAACP,GAAG,EAAEP,YAAY,CAAC,CAAA;AAEjD,EAAA,MAAMe,cAAc,GAAGC,aAAO,CAAC,MAC7B,CAACC,iBAAO,CAACnB,QAAQ,CAAC,IAAIQ,OACvB,EAA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AO;AACZa,EAAAA,GAAG,EAAEP,YAAa;AAClBwB,EAAAA,MAAM,EAAEA,MAAO;AACfC,EAAAA,KAAK,EAAEA,KAAAA;AAAM,CAEX3B,CAAAA,EAAAA,QACY,CACjB;;;;;;;"}
1
+ {"version":3,"file":"FormHelperText.js","sources":["../../../../../src/components/Forms/FormHelperText/FormHelperText.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useMemo,\n} from 'react'\n\nimport { Typography } from '~/src/foundation'\n\nimport useMergeRefs from '~/src/hooks/useMergeRefs'\nimport { noop } from '~/src/utils/functionUtils'\nimport { isEmpty } from '~/src/utils/typeUtils'\n\nimport { useFormControlContext } from '~/src/components/Forms/FormControl'\n\nimport type {\n BaseHelperTextProps,\n FormErrorMessageProps,\n FormHelperTextProps,\n} from './FormHelperText.types'\n\nimport * as Styled from './FormHelperText.styled'\n\ntype ForwardedRef = React.Ref<HTMLParamElement>\n\nexport const FORM_HELPER_TEXT_TEST_ID = 'bezier-react-form-helper-text'\nexport const FORM_ERROR_MESSAGE_TEST_ID = 'bezier-react-form-error-message'\n\nconst BaseHelperText = forwardRef(({\n as = 'p',\n type,\n typo = Typography.Size13,\n children,\n ...rest\n}: BaseHelperTextProps,\nforwardedRef: ForwardedRef,\n) => {\n const contextValue = useFormControlContext()\n const getProps = type === 'info'\n ? contextValue?.getHelperTextProps\n : contextValue?.getErrorMessageProps\n\n const {\n visible,\n ref,\n Wrapper,\n ...ownProps\n } = getProps?.(rest) ?? {\n visible: true,\n ref: noop,\n Wrapper: React.Fragment,\n ...rest,\n }\n\n const mergedRef = useMergeRefs(ref, forwardedRef)\n\n const shouldRendered = useMemo(() => (\n !isEmpty(children) && visible\n ), [\n visible,\n children,\n ])\n\n if (!shouldRendered) { return null }\n\n return (\n <Wrapper>\n <Styled.HelperText\n {...ownProps}\n ref={mergedRef}\n forwardedAs={as}\n typo={typo}\n >\n { children }\n </Styled.HelperText>\n </Wrapper>\n )\n})\n\nexport const FormHelperText = forwardRef(({\n testId = FORM_HELPER_TEXT_TEST_ID,\n color = 'txt-black-dark',\n children,\n ...rest\n}: FormHelperTextProps,\nforwardedRef: ForwardedRef,\n) => (\n <BaseHelperText\n {...rest}\n type=\"info\"\n ref={forwardedRef}\n testId={testId}\n color={color}\n >\n { children }\n </BaseHelperText>\n))\n\nexport const FormErrorMessage = forwardRef(({\n testId = FORM_ERROR_MESSAGE_TEST_ID,\n color = 'bgtxt-orange-normal',\n children,\n ...rest\n}: FormErrorMessageProps,\nforwardedRef: ForwardedRef,\n) => (\n <BaseHelperText\n {...rest}\n aria-live=\"polite\"\n type=\"error\"\n ref={forwardedRef}\n testId={testId}\n color={color}\n >\n { children }\n </BaseHelperText>\n))\n"],"names":["FORM_HELPER_TEXT_TEST_ID","FORM_ERROR_MESSAGE_TEST_ID","BaseHelperText","forwardRef","as","type","typo","Typography","Size13","children","rest","forwardedRef","contextValue","useFormControlContext","getProps","getHelperTextProps","getErrorMessageProps","visible","ref","Wrapper","ownProps","noop","React","Fragment","mergedRef","useMergeRefs","shouldRendered","useMemo","isEmpty","createElement","Styled","Object","assign","forwardedAs","FormHelperText","testId","color","FormErrorMessage"],"mappings":";;;;;;;;;;AAuBO,MAAMA,wBAAwB,GAAG,gCAA+B;AAChE,MAAMC,0BAA0B,GAAG,kCAAiC;AAE3E,MAAMC,cAAc,gBAAGC,gBAAU,CAAC,CAAC;AACjCC,EAAAA,EAAE,GAAG,GAAG;EACRC,IAAI;EACJC,IAAI,GAAGC,qBAAU,CAACC,MAAM;EACxBC,QAAQ;EACR,GAAGC,IAAAA;AACgB,CAAC,EACtBC,YAA0B,KACrB;AACH,EAAA,MAAMC,YAAY,GAAGC,wCAAqB,EAAE,CAAA;AAC5C,EAAA,MAAMC,QAAQ,GAAGT,IAAI,KAAK,MAAM,GAC5BO,YAAY,EAAEG,kBAAkB,GAChCH,YAAY,EAAEI,oBAAoB,CAAA;EAEtC,MAAM;IACJC,OAAO;IACPC,GAAG;IACHC,OAAO;IACP,GAAGC,Q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X3B,CAAAA,EAAAA,QACY,CACjB,EAAC;AAEW4B,MAAAA,gBAAgB,gBAAGlC,gBAAU,CAAC,CAAC;AAC1CgC,EAAAA,MAAM,GAAGlC,0BAA0B;AACnCmC,EAAAA,KAAK,GAAG,qBAAqB;EAC7B3B,QAAQ;EACR,GAAGC,IAAAA;AACkB,CAAC,EACxBC,YAA0B,kBAExBW,KAAA,CAAAO,aAAA,CAAC3B,cAAc,EAAA6B,MAAA,CAAAC,MAAA,KACTtB,IAAI,EAAA;AACR,EAAA,WAAA,EAAU,QAAQ;AAClBL,EAAAA,IAAI,EAAC,OAAO;AACZa,EAAAA,GAAG,EAAEP,YAAa;AAClBwB,EAAAA,MAAM,EAAEA,MAAO;AACfC,EAAAA,KAAK,EAAEA,KAAAA;AAAM,CAEX3B,CAAAA,EAAAA,QACY,CACjB;;;;;;;"}
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
6
  var typeUtils = require('../../../utils/typeUtils.js');
7
- var useFormControlContext = require('../useFormControlContext.js');
8
7
  var Help = require('../../Help/Help.js');
9
8
  var FormLabel_styled = require('./FormLabel.styled.js');
9
+ var FormControlContext = require('../FormControl/FormControlContext.js');
10
10
  var Typography = require('../../../foundation/Typography.js');
11
11
  var HStack = require('../../Stack/HStack/HStack.js');
12
12
  var StackItem = require('../../Stack/StackItem/StackItem.js');
@@ -21,7 +21,7 @@ function FormLabel({
21
21
  children,
22
22
  ...rest
23
23
  }, forwardedRef) {
24
- const contextValue = useFormControlContext.default();
24
+ const contextValue = FormControlContext.useFormControlContext();
25
25
  const {
26
26
  Wrapper,
27
27
  typo,
@@ -1 +1 @@
1
- {"version":3,"file":"FormLabel.js","sources":["../../../../../src/components/Forms/FormLabel/FormLabel.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useMemo,\n} from 'react'\n\nimport { Typography } from '~/src/foundation'\n\nimport { isEmpty } from '~/src/utils/typeUtils'\n\nimport useFormControlContext from '~/src/components/Forms/useFormControlContext'\nimport { Help } from '~/src/components/Help'\nimport { HELP_DISPLAY_NAME } from '~/src/components/Help/Help'\nimport {\n HStack,\n StackItem,\n} from '~/src/components/Stack'\n\nimport type FormLabelProps from './FormLabel.types'\n\nimport * as Styled from './FormLabel.styled'\n\nexport const FORM_LABEL_TEST_ID = 'bezier-react-form-label'\n\nfunction FormLabel({\n testId = FORM_LABEL_TEST_ID,\n help,\n as = 'label',\n bold = true,\n color = 'txt-black-darkest',\n children,\n ...rest\n}: FormLabelProps,\nforwardedRef: React.Ref<HTMLLabelElement>,\n) {\n const contextValue = useFormControlContext()\n\n const { Wrapper, typo, ...ownProps } = contextValue?.getLabelProps(rest) ?? {\n Wrapper: React.Fragment,\n typo: Typography.Size13,\n ...rest,\n }\n\n const LabelComponent = useMemo(() => (\n <Styled.Label\n {...ownProps}\n ref={forwardedRef}\n testId={testId}\n forwardedAs={as}\n bold={bold}\n typo={typo}\n color={color}\n >\n { children }\n </Styled.Label>\n ), [\n as,\n typo,\n bold,\n color,\n testId,\n children,\n forwardedRef,\n ownProps,\n ])\n\n const HelpComponent = useMemo(() => {\n if (isEmpty(help)) { return null }\n\n if (React.isValidElement(help)) {\n // FIXME(@bora): string, JSXElementCostructor 타입에 displayName 속성이 존재하지 않음, 임시로 any 타입으로 설정\n const { displayName } = help?.type as any\n if (displayName === HELP_DISPLAY_NAME) {\n return help\n }\n }\n\n return (\n <Help>\n { help }\n </Help>\n )\n }, [help])\n\n if (isEmpty(children)) { return null }\n\n return (\n <Wrapper>\n { !HelpComponent\n ? LabelComponent\n : (\n <HStack align=\"center\" spacing={6}>\n <StackItem shrink weight={1}>\n { LabelComponent }\n </StackItem>\n <StackItem>\n { HelpComponent }\n </StackItem>\n </HStack>\n ) }\n </Wrapper>\n )\n}\n\nexport default forwardRef(FormLabel)\n"],"names":["FORM_LABEL_TEST_ID","FormLabel","testId","help","as","bold","color","children","rest","forwardedRef","contextValue","useFormControlContext","Wrapper","typo","ownProps","getLabelProps","React","Fragment","Typography","Size13","LabelComponent","useMemo","createElement","Styled","Object","assign","ref","forwardedAs","HelpComponent","isEmpty","isValidElement","displayName","type","HELP_DISPLAY_NAME","Help","HStack","align","spacing","StackItem","shrink","weight","forwardRef"],"mappings":";;;;;;;;;;;;;AAqBO,MAAMA,kBAAkB,GAAG,0BAAyB;AAE3D,SAASC,SAASA,CAAC;AACjBC,EAAAA,MAAM,GAAGF,kBAAkB;EAC3BG,IAAI;AACJC,EAAAA,EAAE,GAAG,OAAO;AACZC,EAAAA,IAAI,GAAG,IAAI;AACXC,EAAAA,KAAK,GAAG,mBAAmB;EAC3BC,QAAQ;EACR,GAAGC,IAAAA;AACW,CAAC,EACjBC,YAAyC,EACvC;AACA,EAAA,MAAMC,YAAY,GAAGC,6BAAqB,EAAE,CAAA;EAE5C,MAAM;IAAEC,OAAO;IAAEC,IAAI;IAAE,GAAGC,QAAAA;AAAS,GAAC,GAAGJ,YAAY,EAAEK,aAAa,CAACP,IAAI,CAAC,IAAI;IAC1EI,OAAO,EAAEI,KAAK,CAACC,QAAQ;IACvBJ,IAAI,EAAEK,qBAAU,CAACC,MAAM;IACvB,GAAGX,IAAAA;GACJ,CAAA;AAED,EAAA,MAAMY,cAAc,GAAGC,aAAO,CAAC,mBAC7BL,KAAA,CAAAM,aAAA,CAACC,sBAAY,EAAAC,MAAA,CAAAC,MAAA,KACPX,QAAQ,EAAA;AACZY,IAAAA,GAAG,EAAEjB,YAAa;AAClBP,IAAAA,MAAM,EAAEA,MAAO;AACfyB,IAAAA,WAAW,EAAEvB,EAAG;AAChBC,IAAAA,IAAI,EAAEA,IAAK;AACXQ,IAAAA,IAAI,EAAEA,IAAK;AACXP,IAAAA,KAAK,EAAEA,KAAAA;GAELC,CAAAA,EAAAA,QACU,CACf,EAAE,CACDH,EAAE,EACFS,IAAI,EACJR,IAAI,EACJC,KAAK,EACLJ,MAAM,EACNK,QAAQ,EACRE,YAAY,EACZK,QAAQ,CACT,CAAC,CAAA;AAEF,EAAA,MAAMc,aAAa,GAAGP,aAAO,CAAC,MAAM;AAClC,IAAA,IAAIQ,iBAAO,CAAC1B,IAAI,CAAC,EAAE;AAAE,MAAA,OAAO,IAAI,CAAA;AAAC,KAAA;AAEjC,IAAA,kBAAIa,KAAK,CAACc,cAAc,CAAC3B,IAAI,CAAC,EAAE;AAC9B;MACA,MAAM;AAAE4B,QAAAA,WAAAA;OAAa,GAAG5B,IAAI,EAAE6B,IAAW,CAAA;MACzC,IAAID,WAAW,KAAKE,sBAAiB,EAAE;AACrC,QAAA,OAAO9B,IAAI,CAAA;AACb,OAAA;AACF,KAAA;AAEA,IAAA,oBACEa,KAAA,CAAAM,aAAA,CAACY,YAAI,EAAA,IAAA,EACD/B,IACE,CAAC,CAAA;AAEX,GAAC,EAAE,CAACA,IAAI,CAAC,CAAC,CAAA;AAEV,EAAA,IAAI0B,iBAAO,CAACtB,QAAQ,CAAC,EAAE;AAAE,IAAA,OAAO,IAAI,CAAA;AAAC,GAAA;AAErC,EAAA,oBACES,KAAA,CAAAM,aAAA,CAACV,OAAO,EACJ,IAAA,EAAA,CAACgB,aAAa,GACZR,cAAc,gBAEdJ,KAAA,CAAAM,aAAA,CAACa,aAAM,EAAA;AAACC,IAAAA,KAAK,EAAC,QAAQ;AAACC,IAAAA,OAAO,EAAE,CAAA;AAAE,GAAA,eAChCrB,KAAA,CAAAM,aAAA,CAACgB,mBAAS,EAAA;IAACC,MAAM,EAAA,IAAA;AAACC,IAAAA,MAAM,EAAE,CAAA;AAAE,GAAA,EACxBpB,cACO,CAAC,eACZJ,KAAA,CAAAM,aAAA,CAACgB,mBAAS,EACNV,IAAAA,EAAAA,aACO,CACL,CAEL,CAAC,CAAA;AAEd,CAAA;AAEA,kBAAea,aAAAA,gBAAU,CAACxC,SAAS,CAAC;;;;;"}
1
+ {"version":3,"file":"FormLabel.js","sources":["../../../../../src/components/Forms/FormLabel/FormLabel.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useMemo,\n} from 'react'\n\nimport { Typography } from '~/src/foundation'\n\nimport { isEmpty } from '~/src/utils/typeUtils'\n\nimport { useFormControlContext } from '~/src/components/Forms/FormControl'\nimport { Help } from '~/src/components/Help'\nimport { HELP_DISPLAY_NAME } from '~/src/components/Help/Help'\nimport {\n HStack,\n StackItem,\n} from '~/src/components/Stack'\n\nimport type FormLabelProps from './FormLabel.types'\n\nimport * as Styled from './FormLabel.styled'\n\nexport const FORM_LABEL_TEST_ID = 'bezier-react-form-label'\n\nfunction FormLabel({\n testId = FORM_LABEL_TEST_ID,\n help,\n as = 'label',\n bold = true,\n color = 'txt-black-darkest',\n children,\n ...rest\n}: FormLabelProps,\nforwardedRef: React.Ref<HTMLLabelElement>,\n) {\n const contextValue = useFormControlContext()\n\n const { Wrapper, typo, ...ownProps } = contextValue?.getLabelProps(rest) ?? {\n Wrapper: React.Fragment,\n typo: Typography.Size13,\n ...rest,\n }\n\n const LabelComponent = useMemo(() => (\n <Styled.Label\n {...ownProps}\n ref={forwardedRef}\n testId={testId}\n forwardedAs={as}\n bold={bold}\n typo={typo}\n color={color}\n >\n { children }\n </Styled.Label>\n ), [\n as,\n typo,\n bold,\n color,\n testId,\n children,\n forwardedRef,\n ownProps,\n ])\n\n const HelpComponent = useMemo(() => {\n if (isEmpty(help)) { return null }\n\n if (React.isValidElement(help)) {\n // FIXME(@bora): string, JSXElementCostructor 타입에 displayName 속성이 존재하지 않음, 임시로 any 타입으로 설정\n const { displayName } = help?.type as any\n if (displayName === HELP_DISPLAY_NAME) {\n return help\n }\n }\n\n return (\n <Help>\n { help }\n </Help>\n )\n }, [help])\n\n if (isEmpty(children)) { return null }\n\n return (\n <Wrapper>\n { !HelpComponent\n ? LabelComponent\n : (\n <HStack align=\"center\" spacing={6}>\n <StackItem shrink weight={1}>\n { LabelComponent }\n </StackItem>\n <StackItem>\n { HelpComponent }\n </StackItem>\n </HStack>\n ) }\n </Wrapper>\n )\n}\n\nexport default forwardRef(FormLabel)\n"],"names":["FORM_LABEL_TEST_ID","FormLabel","testId","help","as","bold","color","children","rest","forwardedRef","contextValue","useFormControlContext","Wrapper","typo","ownProps","getLabelProps","React","Fragment","Typography","Size13","LabelComponent","useMemo","createElement","Styled","Object","assign","ref","forwardedAs","HelpComponent","isEmpty","isValidElement","displayName","type","HELP_DISPLAY_NAME","Help","HStack","align","spacing","StackItem","shrink","weight","forwardRef"],"mappings":";;;;;;;;;;;;;AAqBO,MAAMA,kBAAkB,GAAG,0BAAyB;AAE3D,SAASC,SAASA,CAAC;AACjBC,EAAAA,MAAM,GAAGF,kBAAkB;EAC3BG,IAAI;AACJC,EAAAA,EAAE,GAAG,OAAO;AACZC,EAAAA,IAAI,GAAG,IAAI;AACXC,EAAAA,KAAK,GAAG,mBAAmB;EAC3BC,QAAQ;EACR,GAAGC,IAAAA;AACW,CAAC,EACjBC,YAAyC,EACvC;AACA,EAAA,MAAMC,YAAY,GAAGC,wCAAqB,EAAE,CAAA;EAE5C,MAAM;IAAEC,OAAO;IAAEC,IAAI;IAAE,GAAGC,QAAAA;AAAS,GAAC,GAAGJ,YAAY,EAAEK,aAAa,CAACP,IAAI,CAAC,IAAI;IAC1EI,OAAO,EAAEI,KAAK,CAACC,QAAQ;IACvBJ,IAAI,EAAEK,qBAAU,CAACC,MAAM;IACvB,GAAGX,IAAAA;GACJ,CAAA;AAED,EAAA,MAAMY,cAAc,GAAGC,aAAO,CAAC,mBAC7BL,KAAA,CAAAM,aAAA,CAACC,sBAAY,EAAAC,MAAA,CAAAC,MAAA,KACPX,QAAQ,EAAA;AACZY,IAAAA,GAAG,EAAEjB,YAAa;AAClBP,IAAAA,MAAM,EAAEA,MAAO;AACfyB,IAAAA,WAAW,EAAEvB,EAAG;AAChBC,IAAAA,IAAI,EAAEA,IAAK;AACXQ,IAAAA,IAAI,EAAEA,IAAK;AACXP,IAAAA,KAAK,EAAEA,KAAAA;GAELC,CAAAA,EAAAA,QACU,CACf,EAAE,CACDH,EAAE,EACFS,IAAI,EACJR,IAAI,EACJC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
  var FoundationStyledComponent = require('../../../foundation/FoundationStyledComponent.js');
4
4
 
5
- const inputTextStyle = /*#__PURE__*/FoundationStyledComponent.css(["color:", ";", ""], ({
5
+ const inputTextStyle = FoundationStyledComponent.css`
6
+ color: ${({
6
7
  foundation
7
- }) => foundation?.theme?.['txt-black-darkest'], props => props?.readOnly && FoundationStyledComponent.css(["color:", ";"], ({
8
- foundation
9
- }) => foundation?.theme?.['txt-black-darker']));
10
- const inputPlaceholderStyle = /*#__PURE__*/FoundationStyledComponent.css(["&::placeholder{color:", ";}"], ({
11
- foundation
12
- }) => foundation?.theme?.['txt-black-dark']);
13
- const inputWrapperStyle = /*#__PURE__*/FoundationStyledComponent.css(["box-shadow:0 1px 2px ", ",inset 0 0 0 1px ", ";"], ({
14
- foundation
15
- }) => foundation?.theme?.['bg-black-lighter'], ({
16
- foundation
17
- }) => foundation?.theme?.['bg-black-dark']);
18
- const focusedInputWrapperStyle = /*#__PURE__*/FoundationStyledComponent.css(["box-shadow:0 0 0 3px ", ",inset 0 0 0 1px ", ";"], ({
19
- foundation
20
- }) => foundation?.theme?.['bgtxt-blue-light'], ({
21
- foundation
22
- }) => foundation?.theme?.['bgtxt-blue-normal']);
23
- const erroredInputWrapperStyle = /*#__PURE__*/FoundationStyledComponent.css(["box-shadow:0 0 0 3px ", ",inset 0 0 0 1px ", ";"], ({
24
- foundation
25
- }) => foundation?.theme?.['bgtxt-orange-light'], ({
26
- foundation
27
- }) => foundation?.theme?.['bgtxt-orange-normal']);
8
+ }) => foundation?.theme?.['txt-black-darkest']};
9
+
10
+ ${props => props?.readOnly && FoundationStyledComponent.css`
11
+ color: ${({
12
+ foundation
13
+ }) => foundation?.theme?.['txt-black-darker']};
14
+ `}
15
+ `;
16
+ const inputPlaceholderStyle = FoundationStyledComponent.css`
17
+ &::placeholder {
18
+ color: ${({
19
+ foundation
20
+ }) => foundation?.theme?.['txt-black-dark']};
21
+ }
22
+ `;
23
+ const inputWrapperStyle = FoundationStyledComponent.css`
24
+ box-shadow: 0 1px 2px ${({
25
+ foundation
26
+ }) => foundation?.theme?.['bg-black-lighter']},
27
+ inset 0 0 0 1px ${({
28
+ foundation
29
+ }) => foundation?.theme?.['bg-black-dark']};
30
+ `;
31
+ const focusedInputWrapperStyle = FoundationStyledComponent.css`
32
+ box-shadow: 0 0 0 3px ${({
33
+ foundation
34
+ }) => foundation?.theme?.['bgtxt-blue-light']},
35
+ inset 0 0 0 1px ${({
36
+ foundation
37
+ }) => foundation?.theme?.['bgtxt-blue-normal']};
38
+ `;
39
+ const erroredInputWrapperStyle = FoundationStyledComponent.css`
40
+ box-shadow: 0 0 0 3px ${({
41
+ foundation
42
+ }) => foundation?.theme?.['bgtxt-orange-light']},
43
+ inset 0 0 0 1px ${({
44
+ foundation
45
+ }) => foundation?.theme?.['bgtxt-orange-normal']};
46
+ `;
28
47
 
29
48
  exports.erroredInputWrapperStyle = erroredInputWrapperStyle;
30
49
  exports.focusedInputWrapperStyle = focusedInputWrapperStyle;
@@ -1 +1 @@
1
- {"version":3,"file":"mixins.js","sources":["../../../../../src/components/Forms/Inputs/mixins.ts"],"sourcesContent":["import { css } from '~/src/foundation'\n\nimport { type FormComponentProps } from '~/src/components/Forms/Form.types'\n\nexport const inputTextStyle = css`\n color: ${({ foundation }) => foundation?.theme?.['txt-black-darkest']};\n\n ${(props: FormComponentProps) => props?.readOnly && css`\n color: ${({ foundation }) => foundation?.theme?.['txt-black-darker']};\n `}\n`\n\nexport const inputPlaceholderStyle = css`\n &::placeholder {\n color: ${({ foundation }) => foundation?.theme?.['txt-black-dark']};\n }\n`\n\nexport const inputWrapperStyle = css`\n box-shadow: 0 1px 2px ${({ foundation }) => foundation?.theme?.['bg-black-lighter']},\n inset 0 0 0 1px ${({ foundation }) => foundation?.theme?.['bg-black-dark']};\n`\n\nexport const focusedInputWrapperStyle = css`\n box-shadow: 0 0 0 3px ${({ foundation }) => foundation?.theme?.['bgtxt-blue-light']},\n inset 0 0 0 1px ${({ foundation }) => foundation?.theme?.['bgtxt-blue-normal']};\n`\n\nexport const erroredInputWrapperStyle = css`\n box-shadow: 0 0 0 3px ${({ foundation }) => foundation?.theme?.['bgtxt-orange-light']},\n inset 0 0 0 1px ${({ foundation }) => foundation?.theme?.['bgtxt-orange-normal']};\n`\n"],"names":["inputTextStyle","css","foundation","theme","props","readOnly","inputPlaceholderStyle","inputWrapperStyle","focusedInputWrapperStyle","erroredInputWrapperStyle"],"mappings":";;;;AAIaA,MAAAA,cAAc,gBAAGC,6BAAG,sBACtB,CAAC;AAAEC,EAAAA,UAAAA;AAAW,CAAC,KAAKA,UAAU,EAAEC,KAAK,GAAG,mBAAmB,CAAC,EAElEC,KAAyB,IAAKA,KAAK,EAAEC,QAAQ,IAAIJ,6BAAG,kBAC5C,CAAC;AAAEC,EAAAA,UAAAA;AAAW,CAAC,KAAKA,UAAU,EAAEC,KAAK,GAAG,kBAAkB,CAAC,CACrE,EACF;AAEYG,MAAAA,qBAAqB,gBAAGL,6BAAG,kCAE3B,CAAC;AAAEC,EAAAA,UAAAA;AAAW,CAAC,KAAKA,UAAU,EAAEC,KAAK,GAAG,gBAAgB,CAAC,EAErE;AAEYI,MAAAA,iBAAiB,gBAAGN,6BAAG,sDACV,CAAC;AAAEC,EAAAA,UAAAA;AAAW,CAAC,KAAKA,UAAU,EAAEC,KAAK,GAAG,kBAAkB,CAAC,EAC/D,CAAC;AAAED,EAAAA,UAAAA;AAAW,CAAC,KAAKA,UAAU,EAAEC,KAAK,GAAG,eAAe,CAAC,EAC7E;AAEYK,MAAAA,wBAAwB,gBAAGP,6BAAG,sDACjB,CAAC;AAAEC,EAAAA,UAAAA;AAAW,CAAC,KAAKA,UAAU,EAAEC,KAAK,GAAG,kBAAkB,CAAC,EAC/D,CAAC;AAAED,EAAAA,UAAAA;AAAW,CAAC,KAAKA,UAAU,EAAEC,KAAK,GAAG,mBAAmB,CAAC,EACjF;AAEYM,MAAAA,wBAAwB,gBAAGR,6BAAG,sDACjB,CAAC;AAAEC,EAAAA,UAAAA;AAAW,CAAC,KAAKA,UAAU,EAAEC,KAAK,GAAG,oBAAoB,CAAC,EACjE,CAAC;AAAED,EAAAA,UAAAA;AAAW,CAAC,KAAKA,UAAU,EAAEC,KAAK,GAAG,qBAAqB,CAAC;;;;;;;;"}
1
+ {"version":3,"file":"mixins.js","sources":["../../../../../src/components/Forms/Inputs/mixins.ts"],"sourcesContent":["import { css } from '~/src/foundation'\n\nimport { type FormComponentProps } from '~/src/components/Forms/Form.types'\n\nexport const inputTextStyle = css`\n color: ${({ foundation }) => foundation?.theme?.['txt-black-darkest']};\n\n ${(props: FormComponentProps) => props?.readOnly && css`\n color: ${({ foundation }) => foundation?.theme?.['txt-black-darker']};\n `}\n`\n\nexport const inputPlaceholderStyle = css`\n &::placeholder {\n color: ${({ foundation }) => foundation?.theme?.['txt-black-dark']};\n }\n`\n\nexport const inputWrapperStyle = css`\n box-shadow: 0 1px 2px ${({ foundation }) => foundation?.theme?.['bg-black-lighter']},\n inset 0 0 0 1px ${({ foundation }) => foundation?.theme?.['bg-black-dark']};\n`\n\nexport const focusedInputWrapperStyle = css`\n box-shadow: 0 0 0 3px ${({ foundation }) => foundation?.theme?.['bgtxt-blue-light']},\n inset 0 0 0 1px ${({ foundation }) => foundation?.theme?.['bgtxt-blue-normal']};\n`\n\nexport const erroredInputWrapperStyle = css`\n box-shadow: 0 0 0 3px ${({ foundation }) => foundation?.theme?.['bgtxt-orange-light']},\n inset 0 0 0 1px ${({ foundation }) => foundation?.theme?.['bgtxt-orange-normal']};\n`\n"],"names":["inputTextStyle","css","foundation","theme","props","readOnly","inputPlaceholderStyle","inputWrapperStyle","focusedInputWrapperStyle","erroredInputWrapperStyle"],"mappings":";;;;AAIO,MAAMA,cAAc,GAAGC,6BAAI,CAAA;AAClC,SAAA,EAAW,CAAC;AAAEC,EAAAA,UAAAA;AAAW,CAAC,KAAKA,UAAU,EAAEC,KAAK,GAAG,mBAAmB,CAAE,CAAA;AACxE;AACA,EAAA,EAAKC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21 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var React = require('react');
3
+ var reactUtils = require('../../../utils/reactUtils.js');
4
4
 
5
- // TODO: (@ed) Evolve it into a commonly reusable function
6
- function createContext(providerName, defaultValue) {
7
- const Context = /*#__PURE__*/React.createContext(defaultValue);
8
- function useContext(consumerName) {
9
- const contextValue = React.useContext(Context);
10
- if (!contextValue) {
11
- throw new Error(`'${consumerName}' must be used within '${providerName}'`);
12
- }
13
- return contextValue;
14
- }
15
- return [Context.Provider, useContext];
16
- }
17
- const [SegmentedControlContextProvider, useSegmentedControlContext] = createContext('SegmentedControl', null);
18
- const [SegmentedControlItemListContextProvider, useSegmentedControlItemListContext] = createContext('SegmentedControlItemList', null);
5
+ const [SegmentedControlContextProvider, useSegmentedControlContext] = reactUtils.createContext(null, 'SegmentedControl');
6
+ const [SegmentedControlItemListContextProvider, useSegmentedControlItemListContext] = reactUtils.createContext(null, 'SegmentedControlItemList');
19
7
 
20
8
  exports.SegmentedControlContextProvider = SegmentedControlContextProvider;
21
9
  exports.SegmentedControlItemListContextProvider = SegmentedControlItemListContextProvider;
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedControlContext.js","sources":["../../../../../src/components/Forms/SegmentedControl/SegmentedControlContext.ts"],"sourcesContent":["import React from 'react'\n\nimport {\n type SegmentedControlProps,\n type SegmentedControlType,\n} from './SegmentedControl.types'\n\n// TODO: (@ed) Evolve it into a commonly reusable function\nfunction createContext<ContextValue>(\n providerName: string,\n defaultValue: ContextValue,\n) {\n const Context = React.createContext<ContextValue>(defaultValue)\n\n function useContext(consumerName: string) {\n const contextValue = React.useContext(Context)\n\n if (!contextValue) {\n throw new Error(`'${consumerName}' must be used within '${providerName}'`)\n }\n\n return contextValue\n }\n\n return [\n Context.Provider,\n useContext,\n ] as const\n}\n\ntype SegmentedControlContextValue = Required<Pick<SegmentedControlProps<SegmentedControlType, string>, 'type' | 'size' | 'width'>>\n\nexport const [\n SegmentedControlContextProvider,\n useSegmentedControlContext,\n] = createContext<SegmentedControlContextValue | null>('SegmentedControl', null)\n\ninterface SegmentedControlItemListContextValue {\n setSelectedElement: (node: HTMLButtonElement | null) => void\n}\n\nexport const [\n SegmentedControlItemListContextProvider,\n useSegmentedControlItemListContext,\n] = createContext<SegmentedControlItemListContextValue | null>('SegmentedControlItemList', null)\n"],"names":["createContext","providerName","defaultValue","Context","React","useContext","consumerName","contextValue","Error","Provider","SegmentedControlContextProvider","useSegmentedControlContext","SegmentedControlItemListContextProvider","useSegmentedControlItemListContext"],"mappings":";;;;AAOA;AACA,SAASA,aAAaA,CACpBC,YAAoB,EACpBC,YAA0B,EAC1B;AACA,EAAA,MAAMC,OAAO,gBAAGC,KAAK,CAACJ,aAAa,CAAeE,YAAY,CAAC,CAAA;EAE/D,SAASG,UAAUA,CAACC,YAAoB,EAAE;AACxC,IAAA,MAAMC,YAAY,GAAGH,KAAK,CAACC,UAAU,CAACF,OAAO,CAAC,CAAA;IAE9C,IAAI,CAACI,YAAY,EAAE;MACjB,MAAM,IAAIC,KAAK,CAAE,CAAA,CAAA,EAAGF,YAAa,CAAyBL,uBAAAA,EAAAA,YAAa,GAAE,CAAC,CAAA;AAC5E,KAAA;AAEA,IAAA,OAAOM,YAAY,CAAA;AACrB,GAAA;AAEA,EAAA,OAAO,CACLJ,OAAO,CAACM,QAAQ,EAChBJ,UAAU,CACX,CAAA;AACH,CAAA;AAIa,MAAA,CACXK,+BAA+B,EAC/BC,0BAA0B,CAC3B,GAAGX,aAAa,CAAsC,kBAAkB,EAAE,IAAI,EAAC;AAMnE,MAAA,CACXY,uCAAuC,EACvCC,kCAAkC,CACnC,GAAGb,aAAa,CAA8C,0BAA0B,EAAE,IAAI;;;;;;;"}
1
+ {"version":3,"file":"SegmentedControlContext.js","sources":["../../../../../src/components/Forms/SegmentedControl/SegmentedControlContext.ts"],"sourcesContent":["import { createContext } from '~/src/utils/reactUtils'\n\nimport {\n type SegmentedControlProps,\n type SegmentedControlType,\n} from './SegmentedControl.types'\n\ntype SegmentedControlContextValue = Required<Pick<SegmentedControlProps<SegmentedControlType, string>, 'type' | 'size' | 'width'>>\n\nexport const [\n SegmentedControlContextProvider,\n useSegmentedControlContext,\n] = createContext<SegmentedControlContextValue | null>(null, 'SegmentedControl')\n\ninterface SegmentedControlItemListContextValue {\n setSelectedElement: (node: HTMLButtonElement | null) => void\n}\n\nexport const [\n SegmentedControlItemListContextProvider,\n useSegmentedControlItemListContext,\n] = createContext<SegmentedControlItemListContextValue | null>(null, 'SegmentedControlItemList')\n"],"names":["SegmentedControlContextProvider","useSegmentedControlContext","createContext","SegmentedControlItemListContextProvider","useSegmentedControlItemListContext"],"mappings":";;;;AASa,MAAA,CACXA,+BAA+B,EAC/BC,0BAA0B,CAC3B,GAAGC,wBAAa,CAAsC,IAAI,EAAE,kBAAkB,EAAC;AAMnE,MAAA,CACXC,uCAAuC,EACvCC,kCAAkC,CACnC,GAAGF,wBAAa,CAA8C,IAAI,EAAE,0BAA0B;;;;;;;"}
@@ -4,11 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
6
  var domUtils = require('../../utils/domUtils.js');
7
- var useFormControlContext = require('./useFormControlContext.js');
7
+ var FormControlContext = require('./FormControl/FormControlContext.js');
8
8
 
9
9
  // TODO: 테스트 추가
10
10
  function useFormFieldProps(props) {
11
- const contextValue = useFormControlContext.default();
11
+ const contextValue = FormControlContext.useFormControlContext();
12
12
  const formFieldProps = React.useMemo(() => {
13
13
  const mergedProps = contextValue?.getFieldProps(props) ?? {
14
14
  ...props
@@ -1 +1 @@
1
- {"version":3,"file":"useFormFieldProps.js","sources":["../../../../src/components/Forms/useFormFieldProps.ts"],"sourcesContent":["import { useMemo } from 'react'\n\nimport { ariaAttr } from '~/src/utils/domUtils'\n\nimport type { FormComponentProps } from '~/src/components/Forms/Form.types'\n\nimport useFormControlContext from './useFormControlContext'\n\n// TODO: 테스트 추가\nfunction useFormFieldProps<Props extends FormComponentProps>(props?: Props) {\n const contextValue = useFormControlContext()\n\n const formFieldProps = useMemo(() => {\n const mergedProps = contextValue?.getFieldProps(props) ?? { ...props }\n\n const {\n disabled = false,\n readOnly = false,\n required = false,\n hasError = false,\n ...rest\n } = mergedProps\n\n return {\n ...rest,\n 'aria-disabled': ariaAttr(disabled),\n 'aria-invalid': ariaAttr(hasError),\n 'aria-required': ariaAttr(required),\n 'aria-readonly': ariaAttr(readOnly),\n disabled,\n hasError,\n required,\n readOnly,\n }\n }, [\n props,\n contextValue,\n ])\n\n return formFieldProps as typeof formFieldProps & Props\n}\n\nexport default useFormFieldProps\n"],"names":["useFormFieldProps","props","contextValue","useFormControlContext","formFieldProps","useMemo","mergedProps","getFieldProps","disabled","readOnly","required","hasError","rest","ariaAttr"],"mappings":";;;;;;;;AAQA;AACA,SAASA,iBAAiBA,CAAmCC,KAAa,EAAE;AAC1E,EAAA,MAAMC,YAAY,GAAGC,6BAAqB,EAAE,CAAA;AAE5C,EAAA,MAAMC,cAAc,GAAGC,aAAO,CAAC,MAAM;IACnC,MAAMC,WAAW,GAAGJ,YAAY,EAAEK,aAAa,CAACN,KAAK,CAAC,IAAI;MAAE,GAAGA,KAAAA;KAAO,CAAA;IAEtE,MAAM;AACJO,MAAAA,QAAQ,GAAG,KAAK;AAChBC,MAAAA,QAAQ,GAAG,KAAK;AAChBC,MAAAA,QAAQ,GAAG,KAAK;AAChBC,MAAAA,QAAQ,GAAG,KAAK;MAChB,GAAGC,IAAAA;AACL,KAAC,GAAGN,WAAW,CAAA;IAEf,OAAO;AACL,MAAA,GAAGM,IAAI;AACP,MAAA,eAAe,EAAEC,iBAAQ,CAACL,QAAQ,CAAC;AACnC,MAAA,cAAc,EAAEK,iBAAQ,CAACF,QAAQ,CAAC;AAClC,MAAA,eAAe,EAAEE,iBAAQ,CAACH,QAAQ,CAAC;AACnC,MAAA,eAAe,EAAEG,iBAAQ,CAACJ,QAAQ,CAAC;MACnCD,QAAQ;MACRG,QAAQ;MACRD,QAAQ;AACRD,MAAAA,QAAAA;KACD,CAAA;AACH,GAAC,EAAE,CACDR,KAAK,EACLC,YAAY,CACb,CAAC,CAAA;AAEF,EAAA,OAAOE,cAAc,CAAA;AACvB;;;;"}
1
+ {"version":3,"file":"useFormFieldProps.js","sources":["../../../../src/components/Forms/useFormFieldProps.ts"],"sourcesContent":["import { useMemo } from 'react'\n\nimport { ariaAttr } from '~/src/utils/domUtils'\n\nimport type { FormComponentProps } from '~/src/components/Forms/Form.types'\nimport { useFormControlContext } from '~/src/components/Forms/FormControl'\n\n// TODO: 테스트 추가\nfunction useFormFieldProps<Props extends FormComponentProps>(props?: Props) {\n const contextValue = useFormControlContext()\n\n const formFieldProps = useMemo(() => {\n const mergedProps = contextValue?.getFieldProps(props) ?? { ...props }\n\n const {\n disabled = false,\n readOnly = false,\n required = false,\n hasError = false,\n ...rest\n } = mergedProps\n\n return {\n ...rest,\n 'aria-disabled': ariaAttr(disabled),\n 'aria-invalid': ariaAttr(hasError),\n 'aria-required': ariaAttr(required),\n 'aria-readonly': ariaAttr(readOnly),\n disabled,\n hasError,\n required,\n readOnly,\n }\n }, [\n props,\n contextValue,\n ])\n\n return formFieldProps as typeof formFieldProps & Props\n}\n\nexport default useFormFieldProps\n"],"names":["useFormFieldProps","props","contextValue","useFormControlContext","formFieldProps","useMemo","mergedProps","getFieldProps","disabled","readOnly","required","hasError","rest","ariaAttr"],"mappings":";;;;;;;;AAOA;AACA,SAASA,iBAAiBA,CAAmCC,KAAa,EAAE;AAC1E,EAAA,MAAMC,YAAY,GAAGC,wCAAqB,EAAE,CAAA;AAE5C,EAAA,MAAMC,cAAc,GAAGC,aAAO,CAAC,MAAM;IACnC,MAAMC,WAAW,GAAGJ,YAAY,EAAEK,aAAa,CAACN,KAAK,CAAC,IAAI;MAAE,GAAGA,KAAAA;KAAO,CAAA;IAEtE,MAAM;AACJO,MAAAA,QAAQ,GAAG,KAAK;AAChBC,MAAAA,QAAQ,GAAG,KAAK;AAChBC,MAAAA,QAAQ,GAAG,KAAK;AAChBC,MAAAA,QAAQ,GAAG,KAAK;MAChB,GAAGC,IAAAA;AACL,KAAC,GAAGN,WAAW,CAAA;IAEf,OAAO;AACL,MAAA,GAAGM,IAAI;AACP,MAAA,eAAe,EAAEC,iBAAQ,CAACL,QAAQ,CAAC;AACnC,MAAA,cAAc,EAAEK,iBAAQ,CAACF,QAAQ,CAAC;AAClC,MAAA,eAAe,EAAEE,iBAAQ,CAACH,QAAQ,CAAC;AACnC,MAAA,eAAe,EAAEG,iBAAQ,CAACJ,QAAQ,CAAC;MACnCD,QAAQ;MACRG,QAAQ;MACRD,QAAQ;AACRD,MAAAA,QAAAA;KACD,CAAA;AACH,GAAC,EAAE,CACDR,KAAK,EACLC,YAAY,CACb,CAAC,CAAA;AAEF,EAAA,OAAOE,cAAc,CAAA;AACvB;;;;"}
@@ -4,10 +4,10 @@ var DisabledOpacity = require('../../constants/DisabledOpacity.js');
4
4
  var ListItem_types = require('./ListItem.types.js');
5
5
  var utils = require('./utils.js');
6
6
  var Icon = require('../Icon/Icon.js');
7
+ var index = require('../../foundation/Transition/index.js');
7
8
  var FoundationStyledComponent = require('../../foundation/FoundationStyledComponent.js');
8
9
  var Mixins = require('../../foundation/Mixins.js');
9
10
  var Typography = require('../../foundation/Typography.js');
10
- var index = require('../../foundation/Transition/index.js');
11
11
 
12
12
  const getColorFromColorVariantWithDefaultValue = (variant, defaultValue) => {
13
13
  switch (variant) {
@@ -6,22 +6,34 @@ var FoundationStyledComponent = require('../../foundation/FoundationStyledCompon
6
6
  function getStyleOfSize(size) {
7
7
  switch (size) {
8
8
  case ListItem_types.ListItemSize.S:
9
- return FoundationStyledComponent.css(["padding:4px 6px;", ";"], ({
9
+ return FoundationStyledComponent.css`
10
+ padding: 4px 6px;
11
+ ${({
10
12
  foundation
11
- }) => foundation?.rounding.round6);
13
+ }) => foundation?.rounding.round6};
14
+ `;
12
15
  case ListItem_types.ListItemSize.L:
13
- return FoundationStyledComponent.css(["padding:8px 6px;", ";"], ({
16
+ return FoundationStyledComponent.css`
17
+ padding: 8px 6px;
18
+ ${({
14
19
  foundation
15
- }) => foundation?.rounding.round8);
20
+ }) => foundation?.rounding.round8};
21
+ `;
16
22
  case ListItem_types.ListItemSize.XL:
17
- return FoundationStyledComponent.css(["padding:10px 6px;", ";"], ({
23
+ return FoundationStyledComponent.css`
24
+ padding: 10px 6px;
25
+ ${({
18
26
  foundation
19
- }) => foundation?.rounding.round12);
27
+ }) => foundation?.rounding.round12};
28
+ `;
20
29
  case ListItem_types.ListItemSize.M:
21
30
  default:
22
- return FoundationStyledComponent.css(["padding:6px;", ";"], ({
31
+ return FoundationStyledComponent.css`
32
+ padding: 6px;
33
+ ${({
23
34
  foundation
24
- }) => foundation?.rounding.round6);
35
+ }) => foundation?.rounding.round6};
36
+ `;
25
37
  }
26
38
  }
27
39
 
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../src/components/ListItem/utils.ts"],"sourcesContent":["import { css } from '~/src/foundation'\n\nimport { ListItemSize } from './ListItem.types'\n\nexport function getStyleOfSize(size?: ListItemSize) {\n switch (size) {\n case ListItemSize.S:\n return css`\n padding: 4px 6px;\n ${({ foundation }) => foundation?.rounding.round6};\n `\n case ListItemSize.L:\n return css`\n padding: 8px 6px;\n ${({ foundation }) => foundation?.rounding.round8};\n `\n case ListItemSize.XL:\n return css`\n padding: 10px 6px;\n ${({ foundation }) => foundation?.rounding.round12};\n `\n case ListItemSize.M:\n default:\n return css`\n padding: 6px;\n ${({ foundation }) => foundation?.rounding.round6};\n `\n }\n}\n"],"names":["getStyleOfSize","size","ListItemSize","S","css","foundation","rounding","round6","L","round8","XL","round12","M"],"mappings":";;;;;AAIO,SAASA,cAAcA,CAACC,IAAmB,EAAE;AAClD,EAAA,QAAQA,IAAI;IACV,KAAKC,2BAAY,CAACC,CAAC;MACjB,OAAOC,6BAAG,4BAEN,CAAC;AAAEC,QAAAA,UAAAA;AAAW,OAAC,KAAKA,UAAU,EAAEC,QAAQ,CAACC,MAAM,CAAA,CAAA;IAErD,KAAKL,2BAAY,CAACM,CAAC;MACjB,OAAOJ,6BAAG,4BAEN,CAAC;AAAEC,QAAAA,UAAAA;AAAW,OAAC,KAAKA,UAAU,EAAEC,QAAQ,CAACG,MAAM,CAAA,CAAA;IAErD,KAAKP,2BAAY,CAACQ,EAAE;MAClB,OAAON,6BAAG,6BAEN,CAAC;AAAEC,QAAAA,UAAAA;AAAW,OAAC,KAAKA,UAAU,EAAEC,QAAQ,CAACK,OAAO,CAAA,CAAA;IAEtD,KAAKT,2BAAY,CAACU,CAAC,CAAA;AACnB,IAAA;MACE,OAAOR,6BAAG,wBAEN,CAAC;AAAEC,QAAAA,UAAAA;AAAW,OAAC,KAAKA,UAAU,EAAEC,QAAQ,CAACC,MAAM,CAAA,CAAA;AAEvD,GAAA;AACF;;;;"}
1
+ {"version":3,"file":"utils.js","sources":["../../../../src/components/ListItem/utils.ts"],"sourcesContent":["import { css } from '~/src/foundation'\n\nimport { ListItemSize } from './ListItem.types'\n\nexport function getStyleOfSize(size?: ListItemSize) {\n switch (size) {\n case ListItemSize.S:\n return css`\n padding: 4px 6px;\n ${({ foundation }) => foundation?.rounding.round6};\n `\n case ListItemSize.L:\n return css`\n padding: 8px 6px;\n ${({ foundation }) => foundation?.rounding.round8};\n `\n case ListItemSize.XL:\n return css`\n padding: 10px 6px;\n ${({ foundation }) => foundation?.rounding.round12};\n `\n case ListItemSize.M:\n default:\n return css`\n padding: 6px;\n ${({ foundation }) => foundation?.rounding.round6};\n `\n }\n}\n"],"names":["getStyleOfSize","size","ListItemSize","S","css","foundation","rounding","round6","L","round8","XL","round12","M"],"mappings":";;;;;AAIO,SAASA,cAAcA,CAACC,IAAmB,EAAE;AAClD,EAAA,QAAQA,IAAI;IACV,KAAKC,2BAAY,CAACC,CAAC;AACjB,MAAA,OAAOC,6BAAI,CAAA;AACjB;AACA,QAAA,EAAU,CAAC;AAAEC,QAAAA,UAAAA;AAAW,OAAC,KAAKA,UAAU,EAAEC,QAAQ,CAACC,MAAO,CAAA;AAC1D,MAAO,CAAA,CAAA;IACH,KAAKL,2BAAY,CAACM,CAAC;AACjB,MAAA,OAAOJ,6BAAI,CAAA;AACjB;AACA,QAAA,EAAU,CAAC;AAAEC,QAAAA,UAAAA;AAAW,OAAC,KAAKA,UAAU,EAAEC,QAAQ,CAACG,MAAO,CAAA;AAC1D,MAAO,CAAA,CAAA;IACH,KAAKP,2BAAY,CAACQ,EAAE;AAClB,MAAA,OAAON,6BAAI,CAAA;AACjB;AACA,QAAA,EAAU,CAAC;AAAEC,QAAAA,UAAAA;AAAW,OAAC,KAAKA,UAAU,EAAEC,QAAQ,CAACK,OAAQ,CAAA;AAC3D,MAAO,CAAA,CAAA;IACH,KAAKT,2BAAY,CAACU,CAAC,CAAA;AACnB,IAAA;AACE,MAAA,OAAOR,6BAAI,CAAA;AACjB;AACA,QAAA,EAAU,CAAC;AAAEC,QAAAA,UAAAA;AAAW,OAAC,KAAKA,UAAU,EAAEC,QAAQ,CAACC,MAAO,CAAA;AAC1D,MAAO,CAAA,CAAA;AACL,GAAA;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.js","sources":["../../../../../src/components/Modals/Modal/Modal.tsx"],"sourcesContent":["import React, { useCallback } from 'react'\n\nimport * as DialogPrimitive from '@radix-ui/react-dialog'\n\nimport { noop } from '~/src/utils/functionUtils'\n\nimport { type ModalProps } from './Modal.types'\n\n/**\n * `Modal` is a dialog that appears on top of the page.\n *\n * `Modal` is a context of the Modal-related components. It doesn't render any DOM node.\n * It controls the visibility of the entire component and provides\n * handlers and accessibility properties to Modal-related components.\n *\n * @example\n *\n * ```tsx\n * // Anatomy of the Modal\n * <Modal>\n * <ModalTrigger />\n * <ModalContent>\n * <ModalHeader />\n * <ModalBody />\n * <ModalFooter />\n * </ModalContent>\n * </Modal>\n * ```\n */\nexport function Modal({\n children,\n show,\n defaultShow,\n onShow = noop,\n onHide = noop,\n}: ModalProps) {\n const onOpenChange = useCallback<NonNullable<DialogPrimitive.DialogProps['onOpenChange']>>((open) => {\n const callback = open ? onShow : onHide\n callback()\n }, [\n onShow,\n onHide,\n ])\n\n return (\n <DialogPrimitive.Root\n open={show}\n defaultOpen={defaultShow}\n onOpenChange={onOpenChange}\n >\n { children }\n </DialogPrimitive.Root>\n )\n}\n\n"],"names":["Modal","children","show","defaultShow","onShow","noop","onHide","onOpenChange","useCallback","open","callback","React","createElement","DialogPrimitive","defaultOpen"],"mappings":";;;;;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,KAAKA,CAAC;EACpBC,QAAQ;EACRC,IAAI;EACJC,WAAW;AACXC,EAAAA,MAAM,GAAGC,kBAAI;AACbC,EAAAA,MAAM,GAAGD,kBAAAA;AACC,CAAC,EAAE;AACb,EAAA,MAAME,YAAY,GAAGC,iBAAW,CAA4DC,IAAI,IAAK;AACnG,IAAA,MAAMC,QAAQ,GAAGD,IAAI,GAAGL,MAAM,GAAGE,MAAM,CAAA;AACvCI,IAAAA,QAAQ,EAAE,CAAA;AACZ,GAAC,EAAE,CACDN,MAAM,EACNE,MAAM,CACP,CAAC,CAAA;AAEF,EAAA,oBACEK,KAAA,CAAAC,aAAA,CAACC,UAAoB,EAAA;AACnBJ,IAAAA,IAAI,EAAEP,IAAK;AACXY,IAAAA,WAAW,EAAEX,WAAY;AACzBI,IAAAA,YAAY,EAAEA,YAAAA;AAAa,GAAA,EAEzBN,QACkB,CAAC,CAAA;AAE3B;;;;"}
1
+ {"version":3,"file":"Modal.js","sources":["../../../../../src/components/Modals/Modal/Modal.tsx"],"sourcesContent":["import React, { useCallback } from 'react'\n\nimport * as DialogPrimitive from '@radix-ui/react-dialog'\n\nimport { noop } from '~/src/utils/functionUtils'\n\nimport { type ModalProps } from './Modal.types'\n\n/**\n * `Modal` is a dialog that appears on top of the page.\n *\n * `Modal` is a context of the Modal-related components. It doesn't render any DOM node.\n * It controls the visibility of the entire component and provides\n * handlers and accessibility properties to Modal-related components.\n *\n * @example\n *\n * ```tsx\n * // Anatomy of the Modal\n * <Modal>\n * <ModalTrigger />\n * <ModalContent>\n * <ModalHeader />\n * <ModalBody />\n * <ModalFooter />\n * </ModalContent>\n * </Modal>\n * ```\n */\nexport function Modal({\n children,\n show,\n defaultShow,\n onShow = noop,\n onHide = noop,\n}: ModalProps) {\n const onOpenChange = useCallback<NonNullable<DialogPrimitive.DialogProps['onOpenChange']>>((open) => {\n const callback = open ? onShow : onHide\n callback()\n }, [\n onShow,\n onHide,\n ])\n\n return (\n <DialogPrimitive.Root\n open={show}\n defaultOpen={defaultShow}\n onOpenChange={onOpenChange}\n >\n { children }\n </DialogPrimitive.Root>\n )\n}\n"],"names":["Modal","children","show","defaultShow","onShow","noop","onHide","onOpenChange","useCallback","open","callback","React","createElement","DialogPrimitive","defaultOpen"],"mappings":";;;;;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,KAAKA,CAAC;EACpBC,QAAQ;EACRC,IAAI;EACJC,WAAW;AACXC,EAAAA,MAAM,GAAGC,kBAAI;AACbC,EAAAA,MAAM,GAAGD,kBAAAA;AACC,CAAC,EAAE;AACb,EAAA,MAAME,YAAY,GAAGC,iBAAW,CAA4DC,IAAI,IAAK;AACnG,IAAA,MAAMC,QAAQ,GAAGD,IAAI,GAAGL,MAAM,GAAGE,MAAM,CAAA;AACvCI,IAAAA,QAAQ,EAAE,CAAA;AACZ,GAAC,EAAE,CACDN,MAAM,EACNE,MAAM,CACP,CAAC,CAAA;AAEF,EAAA,oBACEK,KAAA,CAAAC,aAAA,CAACC,UAAoB,EAAA;AACnBJ,IAAAA,IAAI,EAAEP,IAAK;AACXY,IAAAA,WAAW,EAAEX,WAAY;AACzBI,IAAAA,YAAY,EAAEA,YAAAA;AAAa,GAAA,EAEzBN,QACkB,CAAC,CAAA;AAE3B;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.types.js","sources":["../../../../../src/components/Modals/Modal/Modal.types.ts"],"sourcesContent":["import {\n type BezierComponentProps,\n type ChildrenProps,\n type SideContentProps,\n} from '~/src/types/ComponentProps'\n\nexport enum ModalTitleSize {\n L = 'L',\n M = 'M',\n}\n\ninterface ModalOptions {\n /**\n * The controlled open state of the modal.\n * Must be used in conjunction with `onShow` and `onHide`.\n */\n show?: boolean\n\n /**\n * The open state of the modal when it is initially rendered.\n * Use when you **do not need to control** its open state.\n */\n defaultShow?: boolean\n\n /**\n * Callback function to be called when the modal is opened.\n * @default noop\n */\n onShow?: () => void\n\n /**\n * Callback function to be called when the modal is closed.\n * @default noop\n */\n onHide?: () => void\n}\n\ninterface ModalContentOptions {\n /**\n * Specify a container element to portal the content into.\n * @default document.body\n */\n container?: HTMLElement | null\n\n /**\n * Show close icon button that closes the modal when clicked.\n * @default false\n */\n showCloseIcon?: boolean\n\n /**\n * Width of the modal.\n * @default 'max-content'\n */\n width?: React.CSSProperties['width']\n\n /**\n * Height of the modal.\n * @default 'fit-content'\n */\n height?: React.CSSProperties['height']\n\n /**\n * z-index of the modal content.\n * Rather than using this option, Please check modal is positioned in the proper stacking context.\n * @default ZIndex.Modal\n */\n zIndex?: React.CSSProperties['zIndex']\n}\n\ninterface ModalHeaderOptions {\n /**\n * An accessible title to be announced when the modal is opened.\n */\n title: React.ReactNode\n\n /**\n * An accessible subtitle to be announced when the modal is opened.\n */\n subtitle?: React.ReactNode\n\n /**\n * An accessible description to be announced when the modal is opened.\n */\n description?: React.ReactNode\n\n /**\n * Size of the title\n * @default ModalTitleSize.L\n */\n titleSize?: ModalTitleSize\n\n /**\n * Hides content from the screen in an accessible way.\n * @default false\n */\n hidden?: boolean\n}\n\ntype ModalFooterSideContent = React.ReactNode\n\ninterface ModalFooterOptions extends\n SideContentProps<ModalFooterSideContent, ModalFooterSideContent> {}\n\nexport interface ModalProps extends\n ChildrenProps,\n ModalOptions {}\n\nexport interface ModalContentProps extends\n BezierComponentProps,\n ChildrenProps,\n React.HTMLAttributes<HTMLDivElement>,\n ModalContentOptions {}\n\nexport interface ModalHeaderProps extends\n BezierComponentProps,\n Omit<React.HTMLAttributes<HTMLElement>, keyof ModalHeaderOptions>,\n ModalHeaderOptions {}\n\nexport interface ModalBodyProps extends\n BezierComponentProps,\n ChildrenProps,\n React.HTMLAttributes<HTMLDivElement> {}\n\nexport interface ModalFooterProps extends\n BezierComponentProps,\n React.HTMLAttributes<HTMLElement>,\n ModalFooterOptions {}\n\nexport interface ModalTriggerProps extends\n ChildrenProps<React.ReactElement> {}\n\nexport interface ModalCloseProps extends\n ChildrenProps<React.ReactElement> {}\n\nexport interface ModalContentContextValue extends\n NonNullable<Pick<ModalContentOptions, 'showCloseIcon'>> {}\n"],"names":["ModalTitleSize"],"mappings":";;AAMYA,IAAAA,cAAc,0BAAdA,cAAc,EAAA;EAAdA,cAAc,CAAA,GAAA,CAAA,GAAA,GAAA,CAAA;EAAdA,cAAc,CAAA,GAAA,CAAA,GAAA,GAAA,CAAA;AAAA,EAAA,OAAdA,cAAc,CAAA;AAAA,CAAA,CAAA,EAAA;;;;"}
1
+ {"version":3,"file":"Modal.types.js","sources":["../../../../../src/components/Modals/Modal/Modal.types.ts"],"sourcesContent":["import {\n type BezierComponentProps,\n type ChildrenProps,\n type SideContentProps,\n} from '~/src/types/ComponentProps'\n\nexport enum ModalTitleSize {\n L = 'L',\n M = 'M',\n}\n\ninterface ModalOptions {\n /**\n * The controlled open state of the modal.\n * Must be used in conjunction with `onShow` and `onHide`.\n */\n show?: boolean\n\n /**\n * The open state of the modal when it is initially rendered.\n * Use when you **do not need to control** its open state.\n */\n defaultShow?: boolean\n\n /**\n * Callback function to be called when the modal is opened.\n * @default noop\n */\n onShow?: () => void\n\n /**\n * Callback function to be called when the modal is closed.\n * @default noop\n */\n onHide?: () => void\n}\n\ninterface ModalContentOptions {\n /**\n * Specify a container element to portal the content into.\n * @default document.body\n */\n container?: HTMLElement | null\n\n /**\n * Show close icon button that closes the modal when clicked.\n * @default false\n */\n showCloseIcon?: boolean\n\n /**\n * Width of the modal.\n * @default 'max-content'\n */\n width?: React.CSSProperties['width']\n\n /**\n * Height of the modal.\n * @default 'fit-content'\n */\n height?: React.CSSProperties['height']\n\n /**\n * z-index of the modal content.\n * Rather than using this option, Please check modal is positioned in the proper stacking context.\n * @default ZIndex.Modal\n */\n zIndex?: React.CSSProperties['zIndex']\n}\n\ninterface ModalHeaderOptions {\n /**\n * An accessible title to be announced when the modal is opened.\n */\n title: React.ReactNode\n\n /**\n * An accessible subtitle to be announced when the modal is opened.\n */\n subtitle?: React.ReactNode\n\n /**\n * An accessible description to be announced when the modal is opened.\n */\n description?: React.ReactNode\n\n /**\n * Size of the title\n * @default ModalTitleSize.L\n */\n titleSize?: ModalTitleSize\n\n /**\n * Hides content from the screen in an accessible way.\n * @default false\n */\n hidden?: boolean\n}\n\ntype ModalFooterSideContent = React.ReactNode\n\ninterface ModalFooterOptions extends\n SideContentProps<ModalFooterSideContent, ModalFooterSideContent> {}\n\nexport interface ModalProps extends\n ChildrenProps,\n ModalOptions {}\n\nexport interface ModalContentProps extends\n BezierComponentProps,\n ChildrenProps,\n React.HTMLAttributes<HTMLDivElement>,\n ModalContentOptions {}\n\nexport interface ModalHeaderProps extends\n BezierComponentProps,\n Omit<React.HTMLAttributes<HTMLElement>, keyof ModalHeaderOptions>,\n ModalHeaderOptions {}\n\nexport interface ModalBodyProps extends\n BezierComponentProps,\n ChildrenProps,\n React.HTMLAttributes<HTMLDivElement> {}\n\nexport interface ModalFooterProps extends\n BezierComponentProps,\n React.HTMLAttributes<HTMLElement>,\n ModalFooterOptions {}\n\nexport interface ModalTriggerProps extends\n ChildrenProps<React.ReactElement> {}\n\nexport interface ModalCloseProps extends\n ChildrenProps<React.ReactElement> {}\n\nexport interface ModalContentContextValue extends\n Required<Pick<ModalContentOptions, 'showCloseIcon'>> {}\n"],"names":["ModalTitleSize"],"mappings":";;AAMYA,IAAAA,cAAc,0BAAdA,cAAc,EAAA;EAAdA,cAAc,CAAA,GAAA,CAAA,GAAA,GAAA,CAAA;EAAdA,cAAc,CAAA,GAAA,CAAA,GAAA,GAAA,CAAA;AAAA,EAAA,OAAdA,cAAc,CAAA;AAAA,CAAA,CAAA,EAAA;;;;"}