@pega/cosmos-react-core 2.0.0-dev.19.0 → 2.0.0-dev.21.0

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 (350) hide show
  1. package/lib/components/Actions/Actions.js +1 -1
  2. package/lib/components/Actions/Actions.js.map +1 -1
  3. package/lib/components/AppShell/AppHeader.js +1 -1
  4. package/lib/components/AppShell/AppHeader.js.map +1 -1
  5. package/lib/components/AppShell/AppShell.d.ts.map +1 -1
  6. package/lib/components/AppShell/AppShell.js +44 -30
  7. package/lib/components/AppShell/AppShell.js.map +1 -1
  8. package/lib/components/AppShell/AppShell.styles.d.ts +4 -11
  9. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  10. package/lib/components/AppShell/AppShell.styles.js +102 -89
  11. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  12. package/lib/components/AppShell/AppShell.types.d.ts +2 -2
  13. package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
  14. package/lib/components/AppShell/AppShell.types.js.map +1 -1
  15. package/lib/components/AppShell/AppShellContext.d.ts +2 -0
  16. package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
  17. package/lib/components/AppShell/AppShellContext.js +1 -0
  18. package/lib/components/AppShell/AppShellContext.js.map +1 -1
  19. package/lib/components/AppShell/AppShellList.js +6 -6
  20. package/lib/components/AppShell/AppShellList.js.map +1 -1
  21. package/lib/components/AppShell/Drawer.js +2 -2
  22. package/lib/components/AppShell/Drawer.js.map +1 -1
  23. package/lib/components/AppShell/Operator.js +3 -3
  24. package/lib/components/AppShell/Operator.js.map +1 -1
  25. package/lib/components/AppShell/SkipNavigation.js +2 -2
  26. package/lib/components/AppShell/SkipNavigation.js.map +1 -1
  27. package/lib/components/Avatar/Avatar.js +1 -1
  28. package/lib/components/Avatar/Avatar.js.map +1 -1
  29. package/lib/components/Backdrop/Backdrop.js +1 -1
  30. package/lib/components/Backdrop/Backdrop.js.map +1 -1
  31. package/lib/components/Badges/Alert.js +1 -1
  32. package/lib/components/Badges/Alert.js.map +1 -1
  33. package/lib/components/Badges/Count.js +1 -1
  34. package/lib/components/Badges/Count.js.map +1 -1
  35. package/lib/components/Badges/Selection.js +1 -1
  36. package/lib/components/Badges/Selection.js.map +1 -1
  37. package/lib/components/Badges/Status.js +1 -1
  38. package/lib/components/Badges/Status.js.map +1 -1
  39. package/lib/components/Badges/Tag.js +1 -1
  40. package/lib/components/Badges/Tag.js.map +1 -1
  41. package/lib/components/Banner/Banner.js +3 -3
  42. package/lib/components/Banner/Banner.js.map +1 -1
  43. package/lib/components/Boolean/BooleanDisplay.js +1 -1
  44. package/lib/components/Boolean/BooleanDisplay.js.map +1 -1
  45. package/lib/components/Breadcrumbs/Breadcrumbs.js +5 -5
  46. package/lib/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
  47. package/lib/components/Button/BareButton.js +2 -2
  48. package/lib/components/Button/BareButton.js.map +1 -1
  49. package/lib/components/Button/BareRoleButton.d.ts +12 -0
  50. package/lib/components/Button/BareRoleButton.d.ts.map +1 -0
  51. package/lib/components/Button/BareRoleButton.js +20 -0
  52. package/lib/components/Button/BareRoleButton.js.map +1 -0
  53. package/lib/components/Button/Button.js +2 -2
  54. package/lib/components/Button/Button.js.map +1 -1
  55. package/lib/components/Card/Card.js +1 -1
  56. package/lib/components/Card/Card.js.map +1 -1
  57. package/lib/components/Card/CardContent.js +1 -1
  58. package/lib/components/Card/CardContent.js.map +1 -1
  59. package/lib/components/Card/CardFooter.js +2 -2
  60. package/lib/components/Card/CardFooter.js.map +1 -1
  61. package/lib/components/Card/CardHeader.js +1 -1
  62. package/lib/components/Card/CardHeader.js.map +1 -1
  63. package/lib/components/Card/CardMedia.js +1 -1
  64. package/lib/components/Card/CardMedia.js.map +1 -1
  65. package/lib/components/Card/CollapsibleCard.js +1 -1
  66. package/lib/components/Card/CollapsibleCard.js.map +1 -1
  67. package/lib/components/Card/SelectableCard.js +1 -1
  68. package/lib/components/Card/SelectableCard.js.map +1 -1
  69. package/lib/components/Checkbox/Checkbox.js +1 -1
  70. package/lib/components/Checkbox/Checkbox.js.map +1 -1
  71. package/lib/components/ColorPicker/ColorPicker.js +3 -3
  72. package/lib/components/ColorPicker/ColorPicker.js.map +1 -1
  73. package/lib/components/ComboBox/ComboBox.js +15 -15
  74. package/lib/components/ComboBox/ComboBox.js.map +1 -1
  75. package/lib/components/ComboBox/ComboBoxInput.js +4 -4
  76. package/lib/components/ComboBox/ComboBoxInput.js.map +1 -1
  77. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts.map +1 -1
  78. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +14 -10
  79. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
  80. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.d.ts.map +1 -1
  81. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js +15 -11
  82. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js.map +1 -1
  83. package/lib/components/Configuration/Configuration.js +5 -5
  84. package/lib/components/Configuration/Configuration.js.map +1 -1
  85. package/lib/components/Currency/CurrencyDisplay.d.ts +3 -1
  86. package/lib/components/Currency/CurrencyDisplay.d.ts.map +1 -1
  87. package/lib/components/Currency/CurrencyDisplay.js +11 -16
  88. package/lib/components/Currency/CurrencyDisplay.js.map +1 -1
  89. package/lib/components/Currency/CurrencyInput.js +14 -14
  90. package/lib/components/Currency/CurrencyInput.js.map +1 -1
  91. package/lib/components/Currency/CurrencyInput.types.d.ts +3 -1
  92. package/lib/components/Currency/CurrencyInput.types.d.ts.map +1 -1
  93. package/lib/components/Currency/CurrencyInput.types.js.map +1 -1
  94. package/lib/components/Currency/utils.d.ts +12 -1
  95. package/lib/components/Currency/utils.d.ts.map +1 -1
  96. package/lib/components/Currency/utils.js +30 -2
  97. package/lib/components/Currency/utils.js.map +1 -1
  98. package/lib/components/DateTime/DateTimeDisplay.d.ts.map +1 -1
  99. package/lib/components/DateTime/DateTimeDisplay.js +2 -1
  100. package/lib/components/DateTime/DateTimeDisplay.js.map +1 -1
  101. package/lib/components/DateTime/DurationDisplay.d.ts.map +1 -1
  102. package/lib/components/DateTime/DurationDisplay.js +11 -6
  103. package/lib/components/DateTime/DurationDisplay.js.map +1 -1
  104. package/lib/components/DateTime/Input/DateInput.js +6 -6
  105. package/lib/components/DateTime/Input/DateInput.js.map +1 -1
  106. package/lib/components/DateTime/Input/DateRangeInput.js +1 -1
  107. package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
  108. package/lib/components/DateTime/Input/DateTime.styles.d.ts.map +1 -1
  109. package/lib/components/DateTime/Input/DateTime.styles.js +13 -2
  110. package/lib/components/DateTime/Input/DateTime.styles.js.map +1 -1
  111. package/lib/components/DateTime/Input/DateTimeInput.js +9 -9
  112. package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
  113. package/lib/components/DateTime/Input/DayOfWeekInput.js +2 -2
  114. package/lib/components/DateTime/Input/DayOfWeekInput.js.map +1 -1
  115. package/lib/components/DateTime/Input/Duration/DurationInput.js +2 -2
  116. package/lib/components/DateTime/Input/Duration/DurationInput.js.map +1 -1
  117. package/lib/components/DateTime/Input/Duration/NumberUnit.js +2 -2
  118. package/lib/components/DateTime/Input/Duration/NumberUnit.js.map +1 -1
  119. package/lib/components/DateTime/Input/Duration/Time.js +2 -2
  120. package/lib/components/DateTime/Input/Duration/Time.js.map +1 -1
  121. package/lib/components/DateTime/Input/MonthInput.js +6 -6
  122. package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
  123. package/lib/components/DateTime/Input/PartInput.js +1 -1
  124. package/lib/components/DateTime/Input/PartInput.js.map +1 -1
  125. package/lib/components/DateTime/Input/QuarterInput.js +6 -6
  126. package/lib/components/DateTime/Input/QuarterInput.js.map +1 -1
  127. package/lib/components/DateTime/Input/TimeInput.js +9 -9
  128. package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
  129. package/lib/components/DateTime/Input/WeekInput.js +6 -6
  130. package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
  131. package/lib/components/DateTime/Picker/Calendar.js +11 -11
  132. package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
  133. package/lib/components/DateTime/Picker/DatePicker.d.ts.map +1 -1
  134. package/lib/components/DateTime/Picker/DatePicker.js +7 -9
  135. package/lib/components/DateTime/Picker/DatePicker.js.map +1 -1
  136. package/lib/components/DateTime/Picker/DateRangePicker.d.ts.map +1 -1
  137. package/lib/components/DateTime/Picker/DateRangePicker.js +7 -9
  138. package/lib/components/DateTime/Picker/DateRangePicker.js.map +1 -1
  139. package/lib/components/DateTime/Picker/TimePicker.js +4 -4
  140. package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
  141. package/lib/components/DateTime/Picker/Weeks.js +4 -4
  142. package/lib/components/DateTime/Picker/Weeks.js.map +1 -1
  143. package/lib/components/DateTime/Picker/utils.d.ts +1 -0
  144. package/lib/components/DateTime/Picker/utils.d.ts.map +1 -1
  145. package/lib/components/DateTime/Picker/utils.js +3 -0
  146. package/lib/components/DateTime/Picker/utils.js.map +1 -1
  147. package/lib/components/Drawer/Drawer.js +1 -1
  148. package/lib/components/Drawer/Drawer.js.map +1 -1
  149. package/lib/components/Email/EmailDisplay.js +2 -2
  150. package/lib/components/Email/EmailDisplay.js.map +1 -1
  151. package/lib/components/EmojiPicker/EmojiDisplay.js +1 -1
  152. package/lib/components/EmojiPicker/EmojiDisplay.js.map +1 -1
  153. package/lib/components/EmojiPicker/EmojiPicker.js +1 -1
  154. package/lib/components/EmojiPicker/EmojiPicker.js.map +1 -1
  155. package/lib/components/EmptyState/EmptyState.js +1 -1
  156. package/lib/components/EmptyState/EmptyState.js.map +1 -1
  157. package/lib/components/ErrorState/ErrorState.js +1 -1
  158. package/lib/components/ErrorState/ErrorState.js.map +1 -1
  159. package/lib/components/ExpandCollapse/ExpandCollapse.js +1 -1
  160. package/lib/components/ExpandCollapse/ExpandCollapse.js.map +1 -1
  161. package/lib/components/FieldGroup/FieldGroup.js +3 -3
  162. package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
  163. package/lib/components/FieldGroup/FieldGroupList.js +4 -4
  164. package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
  165. package/lib/components/FieldValueList/FieldValueList.js +5 -5
  166. package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
  167. package/lib/components/File/FileDisplay.js +7 -7
  168. package/lib/components/File/FileDisplay.js.map +1 -1
  169. package/lib/components/File/FileInput.js +9 -9
  170. package/lib/components/File/FileInput.js.map +1 -1
  171. package/lib/components/File/FileItem.js +1 -1
  172. package/lib/components/File/FileItem.js.map +1 -1
  173. package/lib/components/File/FileUploadItem.js +4 -4
  174. package/lib/components/File/FileUploadItem.js.map +1 -1
  175. package/lib/components/File/FileVisual.js +4 -4
  176. package/lib/components/File/FileVisual.js.map +1 -1
  177. package/lib/components/Flex/Flex.js +1 -1
  178. package/lib/components/Flex/Flex.js.map +1 -1
  179. package/lib/components/Form/Form.js +1 -1
  180. package/lib/components/Form/Form.js.map +1 -1
  181. package/lib/components/FormControl/FormControl.js +1 -1
  182. package/lib/components/FormControl/FormControl.js.map +1 -1
  183. package/lib/components/FormField/FormField.js +7 -7
  184. package/lib/components/FormField/FormField.js.map +1 -1
  185. package/lib/components/Grid/Grid.js +1 -1
  186. package/lib/components/Grid/Grid.js.map +1 -1
  187. package/lib/components/Icon/Icon.js +1 -1
  188. package/lib/components/Icon/Icon.js.map +1 -1
  189. package/lib/components/Image/Image.js +1 -1
  190. package/lib/components/Image/Image.js.map +1 -1
  191. package/lib/components/Input/Input.js +11 -11
  192. package/lib/components/Input/Input.js.map +1 -1
  193. package/lib/components/Label/Label.js +1 -1
  194. package/lib/components/Label/Label.js.map +1 -1
  195. package/lib/components/Link/Link.js +1 -1
  196. package/lib/components/Link/Link.js.map +1 -1
  197. package/lib/components/List/CommaSeparatedList.js +3 -3
  198. package/lib/components/List/CommaSeparatedList.js.map +1 -1
  199. package/lib/components/List/List.js +1 -1
  200. package/lib/components/List/List.js.map +1 -1
  201. package/lib/components/List/OrderedList.js +1 -1
  202. package/lib/components/List/OrderedList.js.map +1 -1
  203. package/lib/components/List/UnorderedList.js +1 -1
  204. package/lib/components/List/UnorderedList.js.map +1 -1
  205. package/lib/components/Location/CurrentLocationButton.js +1 -1
  206. package/lib/components/Location/CurrentLocationButton.js.map +1 -1
  207. package/lib/components/Location/LocationDisplay.js +7 -7
  208. package/lib/components/Location/LocationDisplay.js.map +1 -1
  209. package/lib/components/Location/LocationInput.js +19 -19
  210. package/lib/components/Location/LocationInput.js.map +1 -1
  211. package/lib/components/Location/LocationView.js +1 -1
  212. package/lib/components/Location/LocationView.js.map +1 -1
  213. package/lib/components/Menu/FlyoutMenuList.js +3 -3
  214. package/lib/components/Menu/FlyoutMenuList.js.map +1 -1
  215. package/lib/components/Menu/Menu.d.ts.map +1 -1
  216. package/lib/components/Menu/Menu.js +4 -3
  217. package/lib/components/Menu/Menu.js.map +1 -1
  218. package/lib/components/Menu/Menu.types.d.ts +2 -0
  219. package/lib/components/Menu/Menu.types.d.ts.map +1 -1
  220. package/lib/components/Menu/Menu.types.js.map +1 -1
  221. package/lib/components/Menu/MenuGroup.js +2 -2
  222. package/lib/components/Menu/MenuGroup.js.map +1 -1
  223. package/lib/components/Menu/MenuItem.js +11 -11
  224. package/lib/components/Menu/MenuItem.js.map +1 -1
  225. package/lib/components/Menu/MenuList.js +5 -5
  226. package/lib/components/Menu/MenuList.js.map +1 -1
  227. package/lib/components/Menu/MenuListHeader.js +2 -2
  228. package/lib/components/Menu/MenuListHeader.js.map +1 -1
  229. package/lib/components/MenuButton/MenuButton.js +3 -3
  230. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  231. package/lib/components/MetaList/MetaList.js +4 -4
  232. package/lib/components/MetaList/MetaList.js.map +1 -1
  233. package/lib/components/Modal/DockedModals.d.ts.map +1 -1
  234. package/lib/components/Modal/DockedModals.js +4 -6
  235. package/lib/components/Modal/DockedModals.js.map +1 -1
  236. package/lib/components/Modal/MinimizedModal.d.ts.map +1 -1
  237. package/lib/components/Modal/MinimizedModal.js +37 -34
  238. package/lib/components/Modal/MinimizedModal.js.map +1 -1
  239. package/lib/components/Modal/Modal.d.ts.map +1 -1
  240. package/lib/components/Modal/Modal.js +26 -21
  241. package/lib/components/Modal/Modal.js.map +1 -1
  242. package/lib/components/Modal/ModalManager.js +6 -6
  243. package/lib/components/Modal/ModalManager.js.map +1 -1
  244. package/lib/components/MultiStep/MultiStep.js +7 -7
  245. package/lib/components/MultiStep/MultiStep.js.map +1 -1
  246. package/lib/components/Number/NumberDisplay.js +1 -1
  247. package/lib/components/Number/NumberDisplay.js.map +1 -1
  248. package/lib/components/Number/NumberInput.js +5 -5
  249. package/lib/components/Number/NumberInput.js.map +1 -1
  250. package/lib/components/PageTemplates/CategorySubPage.js +7 -7
  251. package/lib/components/PageTemplates/CategorySubPage.js.map +1 -1
  252. package/lib/components/PageTemplates/DashboardPage.js +9 -9
  253. package/lib/components/PageTemplates/DashboardPage.js.map +1 -1
  254. package/lib/components/PageTemplates/PageTemplates.js +20 -20
  255. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  256. package/lib/components/Pagination/Pagination.js +3 -3
  257. package/lib/components/Pagination/Pagination.js.map +1 -1
  258. package/lib/components/Phone/PhoneDisplay.js +2 -2
  259. package/lib/components/Phone/PhoneDisplay.js.map +1 -1
  260. package/lib/components/Phone/PhoneInput.js +3 -3
  261. package/lib/components/Phone/PhoneInput.js.map +1 -1
  262. package/lib/components/Popover/Popover.d.ts.map +1 -1
  263. package/lib/components/Popover/Popover.js +7 -1
  264. package/lib/components/Popover/Popover.js.map +1 -1
  265. package/lib/components/Popover/PopoverManager.js +2 -2
  266. package/lib/components/Popover/PopoverManager.js.map +1 -1
  267. package/lib/components/Progress/Bar.js +1 -1
  268. package/lib/components/Progress/Bar.js.map +1 -1
  269. package/lib/components/Progress/Ellipsis.js +1 -1
  270. package/lib/components/Progress/Ellipsis.js.map +1 -1
  271. package/lib/components/Progress/Progress.js +2 -2
  272. package/lib/components/Progress/Progress.js.map +1 -1
  273. package/lib/components/Progress/Ring.js +1 -1
  274. package/lib/components/Progress/Ring.js.map +1 -1
  275. package/lib/components/RadioButton/RadioButton.js +1 -1
  276. package/lib/components/RadioButton/RadioButton.js.map +1 -1
  277. package/lib/components/RadioCheck/RadioCheck.js +2 -2
  278. package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
  279. package/lib/components/RadioCheckGroup/RadioCheckGroup.js +10 -10
  280. package/lib/components/RadioCheckGroup/RadioCheckGroup.js.map +1 -1
  281. package/lib/components/Rating/Rating.js +2 -2
  282. package/lib/components/Rating/Rating.js.map +1 -1
  283. package/lib/components/SearchInput/SearchInput.js +2 -2
  284. package/lib/components/SearchInput/SearchInput.js.map +1 -1
  285. package/lib/components/Select/Option.js +1 -1
  286. package/lib/components/Select/Option.js.map +1 -1
  287. package/lib/components/Select/Select.js +13 -13
  288. package/lib/components/Select/Select.js.map +1 -1
  289. package/lib/components/Sentiment/Sentiment.js +1 -1
  290. package/lib/components/Sentiment/Sentiment.js.map +1 -1
  291. package/lib/components/Skeleton/LineSkeleton.js +1 -1
  292. package/lib/components/Skeleton/LineSkeleton.js.map +1 -1
  293. package/lib/components/Skeleton/ParagraphSkeleton.js +1 -1
  294. package/lib/components/Skeleton/ParagraphSkeleton.js.map +1 -1
  295. package/lib/components/Skeleton/RectangleSkeleton.js +1 -1
  296. package/lib/components/Skeleton/RectangleSkeleton.js.map +1 -1
  297. package/lib/components/Slider/Slider.js +5 -5
  298. package/lib/components/Slider/Slider.js.map +1 -1
  299. package/lib/components/Slider/SliderTicks.js +4 -4
  300. package/lib/components/Slider/SliderTicks.js.map +1 -1
  301. package/lib/components/SummaryItem/SummaryItem.js +2 -2
  302. package/lib/components/SummaryItem/SummaryItem.js.map +1 -1
  303. package/lib/components/SummaryList/SummaryList.js +3 -3
  304. package/lib/components/SummaryList/SummaryList.js.map +1 -1
  305. package/lib/components/SummaryList/ViewAll.js +1 -1
  306. package/lib/components/SummaryList/ViewAll.js.map +1 -1
  307. package/lib/components/Switch/Switch.js +1 -1
  308. package/lib/components/Switch/Switch.js.map +1 -1
  309. package/lib/components/Table/Table.d.ts.map +1 -1
  310. package/lib/components/Table/Table.js +13 -8
  311. package/lib/components/Table/Table.js.map +1 -1
  312. package/lib/components/Tabs/Tab.js +1 -1
  313. package/lib/components/Tabs/Tab.js.map +1 -1
  314. package/lib/components/Tabs/TabPanel.js +1 -1
  315. package/lib/components/Tabs/TabPanel.js.map +1 -1
  316. package/lib/components/Tabs/Tabs.js +4 -4
  317. package/lib/components/Tabs/Tabs.js.map +1 -1
  318. package/lib/components/Text/Text.js +1 -1
  319. package/lib/components/Text/Text.js.map +1 -1
  320. package/lib/components/TextArea/TextArea.js +23 -23
  321. package/lib/components/TextArea/TextArea.js.map +1 -1
  322. package/lib/components/Toaster/Toaster.js +4 -4
  323. package/lib/components/Toaster/Toaster.js.map +1 -1
  324. package/lib/components/Tooltip/Tooltip.js +1 -1
  325. package/lib/components/Tooltip/Tooltip.js.map +1 -1
  326. package/lib/components/Tree/StandardTree.js +6 -6
  327. package/lib/components/Tree/StandardTree.js.map +1 -1
  328. package/lib/components/Tree/Tree.js +3 -3
  329. package/lib/components/Tree/Tree.js.map +1 -1
  330. package/lib/components/Tree/helpers.d.ts +1 -0
  331. package/lib/components/Tree/helpers.d.ts.map +1 -1
  332. package/lib/components/Tree/helpers.js +20 -0
  333. package/lib/components/Tree/helpers.js.map +1 -1
  334. package/lib/components/URL/URLDisplay.js +2 -2
  335. package/lib/components/URL/URLDisplay.js.map +1 -1
  336. package/lib/hooks/index.d.ts +6 -6
  337. package/lib/hooks/index.d.ts.map +1 -1
  338. package/lib/hooks/index.js +6 -5
  339. package/lib/hooks/index.js.map +1 -1
  340. package/lib/hooks/useI18n.d.ts +1 -0
  341. package/lib/hooks/useI18n.d.ts.map +1 -1
  342. package/lib/hooks/useTransitionState.d.ts +39 -0
  343. package/lib/hooks/useTransitionState.d.ts.map +1 -0
  344. package/lib/hooks/useTransitionState.js +56 -0
  345. package/lib/hooks/useTransitionState.js.map +1 -0
  346. package/lib/i18n/default.json +1 -0
  347. package/lib/i18n/i18n.d.ts +2 -0
  348. package/lib/i18n/i18n.d.ts.map +1 -1
  349. package/lib/theme/themes/buildTheme.json +2 -1
  350. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"Ring.js","sourceRoot":"","sources":["../../../src/components/Progress/Ring.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,UAAU,EAAmB,MAAM,OAAO,CAAC;AACxD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAK/C,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAC1C,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,EAAE;IACpC,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;oBAsBM,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;;;;;;;;;sBASnC,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC;uDACV,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK;gBACjE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI;;cAElC,CAAC,WAAW;QACd,GAAG,CAAA;gDACiC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK;aAC7D;;;;;QAKL,SAAS,KAAK,QAAQ;QACtB,CAAC,CAAC,GAAG,CAAA;;;WAGF;QACH,CAAC,CAAC,GAAG,CAAA;qBACQ,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;sBACjC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG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ultThemeProp } from '../../theme';\nimport { ForwardProps } from '../../types';\n\nimport { ProgressProps } from './Progress.types';\n\nexport const StyledProgressRing = styled.div<ProgressProps & { determinate: boolean }>(\n ({ theme, placement, determinate }) => {\n return css`\n position: relative;\n min-width: 1em;\n min-height: 1em;\n\n @keyframes LoadingRing {\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n }\n\n svg {\n display: block;\n position: absolute;\n height: 100%;\n\n circle {\n fill: transparent;\n stroke: ${theme.base.colors.gray['extra-light']};\n stroke-width: 2;\n r: 45%;\n cx: 50%;\n cy: 50%;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n\n &:nth-child(2) {\n stroke: ${theme.components.progress['progress-color']};\n transition: stroke-dashoffset calc(0.5 * ${theme.base.animation.speed})\n ${theme.base.animation.timing.ease};\n\n ${!determinate &&\n css`\n animation: LoadingRing calc(4 * ${theme.base.animation.speed}) linear infinite;\n `}\n }\n }\n }\n\n ${placement === 'inline'\n ? css`\n display: inline-flex;\n vertical-align: top;\n `\n : css`\n width: ${placement === 'global' ? '4' : '2'}rem;\n height: ${placement === 'global' ? '4' : '2'}rem;\n `}\n `;\n }\n);\n\nStyledProgressRing.defaultProps = defaultThemeProp;\n\nconst Ring: FC<ProgressProps & ForwardProps> = forwardRef(\n (\n {\n value,\n minValue = 0,\n maxValue = 100,\n placement,\n ...restProps\n }: PropsWithoutRef<ProgressProps>,\n ref: ProgressProps['ref']\n ) => {\n let strokeDashoffset;\n const circumference = 18 * Math.PI;\n\n if (typeof value !== 'number') strokeDashoffset = (1 - 33 / 100) * circumference;\n else if (value > maxValue || minValue > maxValue) strokeDashoffset = 0;\n else if (value < minValue) strokeDashoffset = circumference;\n else strokeDashoffset = (1 - (value - minValue) / (maxValue - minValue)) * circumference;\n\n return (\n <StyledProgressRing\n ref={ref}\n role='progressbar'\n aria-valuemin={minValue}\n aria-valuemax={maxValue}\n aria-valuenow={value}\n placement={placement}\n determinate={typeof value === 'number'}\n {...restProps}\n >\n <svg viewBox='0 0 20 20'>\n <circle />\n <circle strokeDasharray={circumference} style={{ strokeDashoffset }} />\n </svg>\n </StyledProgressRing>\n );\n }\n);\n\nexport default Ring;\n"]}
1
+ {"version":3,"file":"Ring.js","sourceRoot":"","sources":["../../../src/components/Progress/Ring.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,UAAU,EAAmB,MAAM,OAAO,CAAC;AACxD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAK/C,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAC1C,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,EAAE;IACpC,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;oBAsBM,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;;;;;;;;;sBASnC,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC;uDACV,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK;gBACjE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI;;cAElC,CAAC,WAAW;QACd,GAAG,CAAA;gDACiC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK;aAC7D;;;;;QAKL,SAAS,KAAK,QAAQ;QACtB,CAAC,CAAC,GAAG,CAAA;;;WAGF;QACH,CAAC,CAAC,GAAG,CAAA;qBACQ,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;sBACjC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;WAC7C;KACN,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEnD,MAAM,IAAI,GAAqC,UAAU,CACvD,CACE,EACE,KAAK,EACL,QAAQ,GAAG,CAAC,EACZ,QAAQ,GAAG,GAAG,EACd,SAAS,EACT,GAAG,SAAS,EACmB,EACjC,GAAyB,EACzB,EAAE;IACF,IAAI,gBAAgB,CAAC;IACrB,MAAM,aAAa,GAAG,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;IAEnC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,gBAAgB,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC,GAAG,aAAa,CAAC;SAC5E,IAAI,KAAK,GAAG,QAAQ,IAAI,QAAQ,GAAG,QAAQ;QAAE,gBAAgB,GAAG,CAAC,CAAC;SAClE,IAAI,KAAK,GAAG,QAAQ;QAAE,gBAAgB,GAAG,aAAa,CAAC;;QACvD,gBAAgB,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC,GAAG,aAAa,CAAC;IAEzF,OAAO,CACL,KAAC,kBAAkB,IACjB,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,aAAa,mBACH,QAAQ,mBACR,QAAQ,mBACR,KAAK,EACpB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,OAAO,KAAK,KAAK,QAAQ,KAClC,SAAS,YAEb,eAAK,OAAO,EAAC,WAAW,aACtB,0BAAU,EACV,iBAAQ,eAAe,EAAE,aAAa,EAAE,KAAK,EAAE,EAAE,gBAAgB,EAAE,WAAI,YACnE,WACa,CACtB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import { FC, forwardRef, PropsWithoutRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../theme';\nimport { ForwardProps } from '../../types';\n\nimport { ProgressProps } from './Progress.types';\n\nexport const StyledProgressRing = styled.div<ProgressProps & { determinate: boolean }>(\n ({ theme, placement, determinate }) => {\n return css`\n position: relative;\n min-width: 1em;\n min-height: 1em;\n\n @keyframes LoadingRing {\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n }\n\n svg {\n display: block;\n position: absolute;\n height: 100%;\n\n circle {\n fill: transparent;\n stroke: ${theme.base.colors.gray['extra-light']};\n stroke-width: 2;\n r: 45%;\n cx: 50%;\n cy: 50%;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n\n &:nth-child(2) {\n stroke: ${theme.components.progress['progress-color']};\n transition: stroke-dashoffset calc(0.5 * ${theme.base.animation.speed})\n ${theme.base.animation.timing.ease};\n\n ${!determinate &&\n css`\n animation: LoadingRing calc(4 * ${theme.base.animation.speed}) linear infinite;\n `}\n }\n }\n }\n\n ${placement === 'inline'\n ? css`\n display: inline-flex;\n vertical-align: top;\n `\n : css`\n width: ${placement === 'global' ? '4' : '2'}rem;\n height: ${placement === 'global' ? '4' : '2'}rem;\n `}\n `;\n }\n);\n\nStyledProgressRing.defaultProps = defaultThemeProp;\n\nconst Ring: FC<ProgressProps & ForwardProps> = forwardRef(\n (\n {\n value,\n minValue = 0,\n maxValue = 100,\n placement,\n ...restProps\n }: PropsWithoutRef<ProgressProps>,\n ref: ProgressProps['ref']\n ) => {\n let strokeDashoffset;\n const circumference = 18 * Math.PI;\n\n if (typeof value !== 'number') strokeDashoffset = (1 - 33 / 100) * circumference;\n else if (value > maxValue || minValue > maxValue) strokeDashoffset = 0;\n else if (value < minValue) strokeDashoffset = circumference;\n else strokeDashoffset = (1 - (value - minValue) / (maxValue - minValue)) * circumference;\n\n return (\n <StyledProgressRing\n ref={ref}\n role='progressbar'\n aria-valuemin={minValue}\n aria-valuemax={maxValue}\n aria-valuenow={value}\n placement={placement}\n determinate={typeof value === 'number'}\n {...restProps}\n >\n <svg viewBox='0 0 20 20'>\n <circle />\n <circle strokeDasharray={circumference} style={{ strokeDashoffset }} />\n </svg>\n </StyledProgressRing>\n );\n }\n);\n\nexport default Ring;\n"]}
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from 'react';
3
3
  import RadioCheck from '../RadioCheck';
4
4
  // Odd issue with SB doc prop table not being generated when called RadioButton...so using RB
5
- const RB = forwardRef((props, ref) => (_jsx(RadioCheck, Object.assign({}, props, { type: 'radio', ref: ref }), void 0)));
5
+ const RB = forwardRef((props, ref) => (_jsx(RadioCheck, { ...props, type: 'radio', ref: ref }, void 0)));
6
6
  // Adding here for doc purposes only
7
7
  RB.defaultProps = RadioCheck.defaultProps;
8
8
  export default RB;
@@ -1 +1 @@
1
- {"version":3,"file":"RadioButton.js","sourceRoot":"","sources":["../../../src/components/RadioButton/RadioButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,UAAU,EAAO,MAAM,OAAO,CAAC;AAG5C,OAAO,UAA+B,MAAM,eAAe,CAAC;AA8B5D,6FAA6F;AAC7F,MAAM,EAAE,GAAwC,UAAU,CACxD,CAAC,KAAuB,EAAE,GAA0B,EAAE,EAAE,CAAC,CACvD,KAAC,UAAU,oBAAK,KAAK,IAAE,IAAI,EAAC,OAAO,EAAC,GAAG,EAAE,GAAG,YAAI,CACjD,CACF,CAAC;AAEF,oCAAoC;AACpC,EAAE,CAAC,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;AAE1C,eAAe,EAAE,CAAC","sourcesContent":["import { FC, forwardRef, Ref } from 'react';\n\nimport { FormControlProps } from '../FormControl';\nimport RadioCheck, { RadioCheckProps } from '../RadioCheck';\nimport { ForwardProps } from '../../types';\n\nexport interface RadioButtonProps {\n /**\n * Sets DOM id for the control and associates label element via 'for' attribute.\n * If an id is not pass, a random id will be generated for any render.\n */\n id?: FormControlProps['id'];\n /** Pass a string or a fragment with an Icon and string. */\n label?: FormControlProps['label'];\n /** Indicate if the field is required. The browser defaults to false. */\n required?: FormControlProps['required'];\n /** Disable the control. The browser defaults to false. */\n disabled?: FormControlProps['disabled'];\n /** Set visual state based on a validation state. */\n status?: FormControlProps['status'];\n /** Sets html name attribute for the underlying control. Useful for mapping to a data field. */\n name?: FormControlProps['name'];\n /** Sets checked prop via onChange when using as controlled component. */\n checked?: RadioCheckProps['checked'];\n /** Initialize checked prop when using as uncontrolled component. */\n defaultChecked?: RadioCheckProps['defaultChecked'];\n /**\n * Sets Radio Button to an an [indeterminate state](https://css-tricks.com/almanac/selectors/i/indeterminate/#indeterminate-radio-buttons).\n * @default false\n */\n indeterminate?: RadioCheckProps['indeterminate'];\n}\n\n// Odd issue with SB doc prop table not being generated when called RadioButton...so using RB\nconst RB: FC<RadioButtonProps & ForwardProps> = forwardRef(\n (props: RadioButtonProps, ref: Ref<HTMLInputElement>) => (\n <RadioCheck {...props} type='radio' ref={ref} />\n )\n);\n\n// Adding here for doc purposes only\nRB.defaultProps = RadioCheck.defaultProps;\n\nexport default RB;\n"]}
1
+ {"version":3,"file":"RadioButton.js","sourceRoot":"","sources":["../../../src/components/RadioButton/RadioButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,UAAU,EAAO,MAAM,OAAO,CAAC;AAG5C,OAAO,UAA+B,MAAM,eAAe,CAAC;AA8B5D,6FAA6F;AAC7F,MAAM,EAAE,GAAwC,UAAU,CACxD,CAAC,KAAuB,EAAE,GAA0B,EAAE,EAAE,CAAC,CACvD,KAAC,UAAU,OAAK,KAAK,EAAE,IAAI,EAAC,OAAO,EAAC,GAAG,EAAE,GAAG,WAAI,CACjD,CACF,CAAC;AAEF,oCAAoC;AACpC,EAAE,CAAC,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;AAE1C,eAAe,EAAE,CAAC","sourcesContent":["import { FC, forwardRef, Ref } from 'react';\n\nimport { FormControlProps } from '../FormControl';\nimport RadioCheck, { RadioCheckProps } from '../RadioCheck';\nimport { ForwardProps } from '../../types';\n\nexport interface RadioButtonProps {\n /**\n * Sets DOM id for the control and associates label element via 'for' attribute.\n * If an id is not pass, a random id will be generated for any render.\n */\n id?: FormControlProps['id'];\n /** Pass a string or a fragment with an Icon and string. */\n label?: FormControlProps['label'];\n /** Indicate if the field is required. The browser defaults to false. */\n required?: FormControlProps['required'];\n /** Disable the control. The browser defaults to false. */\n disabled?: FormControlProps['disabled'];\n /** Set visual state based on a validation state. */\n status?: FormControlProps['status'];\n /** Sets html name attribute for the underlying control. Useful for mapping to a data field. */\n name?: FormControlProps['name'];\n /** Sets checked prop via onChange when using as controlled component. */\n checked?: RadioCheckProps['checked'];\n /** Initialize checked prop when using as uncontrolled component. */\n defaultChecked?: RadioCheckProps['defaultChecked'];\n /**\n * Sets Radio Button to an an [indeterminate state](https://css-tricks.com/almanac/selectors/i/indeterminate/#indeterminate-radio-buttons).\n * @default false\n */\n indeterminate?: RadioCheckProps['indeterminate'];\n}\n\n// Odd issue with SB doc prop table not being generated when called RadioButton...so using RB\nconst RB: FC<RadioButtonProps & ForwardProps> = forwardRef(\n (props: RadioButtonProps, ref: Ref<HTMLInputElement>) => (\n <RadioCheck {...props} type='radio' ref={ref} />\n )\n);\n\n// Adding here for doc purposes only\nRB.defaultProps = RadioCheck.defaultProps;\n\nexport default RB;\n"]}
@@ -194,7 +194,7 @@ const RadioCheck = forwardRef((props, ref) => {
194
194
  newRef.current.indeterminate = !!indeterminate;
195
195
  }
196
196
  }, [newRef, indeterminate, isRadio]);
197
- return (_jsx(FormField, Object.assign({ as: card ? StyledRadioCheckCard : StyledRadioCheck, label: _jsxs(_Fragment, { children: [_jsx(StyledPseudoRadioCheck, { status: status, isRadio: isRadio, as: StyledFormControl, required: required, disabled: disabled, readOnly: readOnly }, void 0), label] }, void 0), labelAs: card ? 'div' : undefined, id: id, required: required, disabled: disabled, readOnly: readOnly, status: status, inline: true, labelAfter: true }, { children: _jsx(StyledRadioCheckInput, Object.assign({}, restProps, { id: id, type: type, required: required, disabled: disabled, readOnly: readOnly, "aria-readonly": readOnly, onClick: (e) => {
197
+ return (_jsx(FormField, { as: card ? StyledRadioCheckCard : StyledRadioCheck, label: _jsxs(_Fragment, { children: [_jsx(StyledPseudoRadioCheck, { status: status, isRadio: isRadio, as: StyledFormControl, required: required, disabled: disabled, readOnly: readOnly }, void 0), label] }, void 0), labelAs: card ? 'div' : undefined, id: id, required: required, disabled: disabled, readOnly: readOnly, status: status, inline: true, labelAfter: true, children: _jsx(StyledRadioCheckInput, { ...restProps, id: id, type: type, required: required, disabled: disabled, readOnly: readOnly, "aria-readonly": readOnly, onClick: (e) => {
198
198
  if (readOnly)
199
199
  e.preventDefault();
200
200
  onClick?.(e);
@@ -206,7 +206,7 @@ const RadioCheck = forwardRef((props, ref) => {
206
206
  e.preventDefault();
207
207
  }
208
208
  onKeyDown?.(e);
209
- }, ref: newRef }), void 0) }), void 0));
209
+ }, ref: newRef }, void 0) }, void 0));
210
210
  });
211
211
  export default RadioCheck;
212
212
  //# sourceMappingURL=RadioCheck.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RadioCheck.js","sourceRoot":"","sources":["../../../src/components/RadioCheck/RadioCheck.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAGV,SAAS,EAMV,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE5D,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAAoB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AA4CjD,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,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,CAAC,cAAc,EAAE,CAAC;iBACpB;gBACD,IAAI,IAAI,KAAK,OAAO,IAAI,QAAQ,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;oBAC3D,CAAC,CAAC,cAAc,EAAE,CAAC;iBACpB;gBAED,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;YACjB,CAAC,EACD,GAAG,EAAE,MAAM,YACX,YACQ,CACb,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import {\n forwardRef,\n FC,\n Ref,\n useEffect,\n MouseEvent,\n KeyboardEvent,\n PropsWithoutRef,\n MouseEventHandler,\n KeyboardEventHandler\n} from 'react';\nimport styled, { css } from 'styled-components';\nimport { readableColor, hideVisually, mix } from 'polished';\n\nimport FormField from '../FormField';\nimport { FormControlProps, StyledFormControl } from '../FormControl';\nimport { defaultThemeProp } from '../../theme';\nimport { tryCatch } from '../../utils/utils';\nimport { BaseProps, ForwardProps } from '../../types';\nimport { useConsolidatedRef, useDirection, useUID } from '../../hooks';\nimport { StyledLabel } from '../Label';\nimport { calculateFontSize } from '../../styles';\n\nexport interface RadioCheckProps extends BaseProps {\n /**\n * Sets DOM id for the control and associates label element via 'for' attribute.\n * If an id is not pass, a random id will be generated for any render.\n */\n id?: FormControlProps['id'];\n /** Pass a string or a fragment with an Icon and string. */\n label?: FormControlProps['label'];\n /** Indicate if the field is required. The browser defaults to false. */\n required?: FormControlProps['required'];\n /** Disable the control. The browser defaults to false. */\n disabled?: FormControlProps['disabled'];\n /** Makes the input non editable and non clickable. The browser defaults to false. */\n readOnly?: FormControlProps['readOnly'];\n /** Set visual state based on a validation state. */\n status?: FormControlProps['status'];\n /** Sets html name attribute for the underlying control. Useful for mapping to a data field. */\n name?: FormControlProps['name'];\n /** Sets the type of input. */\n type: 'radio' | 'checkbox';\n /** Sets checked prop via onChange when using as controlled component. */\n checked?: boolean;\n /** Initialize checked prop when using as uncontrolled component. */\n defaultChecked?: boolean;\n /**\n * Sets control to an an indeterminate state.\n * @default false\n */\n indeterminate?: boolean;\n /**\n * Controls the styling of the RadioCheck.\n * @default 'simple'\n */\n variant?: 'simple' | 'card';\n /** Callback function for onClick events. */\n onClick?: MouseEventHandler<HTMLInputElement>;\n /** Callback function for onKeyDown events. */\n onKeyDown?: KeyboardEventHandler<HTMLInputElement>;\n /** Ref forwarded to the underlying input. */\n ref?: Ref<HTMLInputElement>;\n}\n\nexport const StyledPseudoRadioCheck = styled.div<Pick<RadioCheckProps, 'readOnly' | 'status'>>(\n props => {\n const {\n theme: {\n base: {\n spacing,\n palette: { 'primary-background': primaryBackground }\n },\n components: {\n 'form-field': formField,\n 'radio-check': {\n size,\n 'touch-size': touchSize,\n 'background-color': backgroundColor,\n 'border-color': borderColor,\n 'border-width': borderWidth\n }\n }\n },\n status\n } = props;\n\n const useBorderColor = status === 'error' ? formField.error['status-color'] : borderColor;\n const useBackgroundColor =\n status && formField[status]\n ? tryCatch(() => mix(0.8, primaryBackground, formField[status]['status-color']))\n : backgroundColor;\n\n return css`\n display: flex;\n flex-shrink: 0;\n position: relative;\n width: ${size};\n height: ${size};\n margin-inline-end: ${spacing};\n border: ${borderWidth} solid ${useBorderColor};\n background-color: ${useBackgroundColor};\n\n @media (pointer: coarse) {\n width: ${touchSize};\n height: ${touchSize};\n }\n\n &::after {\n content: '';\n display: none;\n }\n `;\n }\n);\n\nStyledPseudoRadioCheck.defaultProps = defaultThemeProp;\n\nexport const StyledRadioCheckInput = styled.input(props => {\n const {\n theme: {\n base: { 'border-radius': baseBorderRadius },\n components: {\n 'form-control': {\n ':focus': { 'box-shadow': shadow, 'border-color': focusBorderColor },\n ':read-only': { 'background-color': readOnlyBackgroundColor }\n },\n 'radio-check': {\n ':checked': {\n 'background-color': checkedBackgroundColor,\n 'border-color': checkedBorderColor\n }\n },\n checkbox: { 'border-radius': checkRadius },\n 'radio-button': { 'border-radius': radioRadius }\n }\n }\n } = props;\n\n const backgroundColor = props.readOnly ? readOnlyBackgroundColor : checkedBackgroundColor;\n const foreground = tryCatch(() => readableColor(backgroundColor));\n\n const prcSelector = `+ ${StyledLabel} ${StyledPseudoRadioCheck}`;\n const { ltr } = useDirection();\n\n return css`\n ${hideVisually}\n\n ${!(props.disabled || props.readOnly) &&\n css`\n &:focus ${prcSelector} {\n box-shadow: ${shadow};\n border-color: ${focusBorderColor};\n }\n `}\n\n &:checked\n ${prcSelector},\n &:checked:disabled\n ${prcSelector},\n &[type='checkbox']:indeterminate\n ${prcSelector},\n &[type='checkbox']:indeterminate:disabled\n ${prcSelector} {\n border-color: ${props.readOnly ? 'inherit' : checkedBorderColor};\n background-color: ${backgroundColor};\n\n &::after {\n display: block;\n }\n }\n\n &[type='radio'] ${prcSelector}, &[type='radio'] ${prcSelector}::after {\n border-radius: ${radioRadius};\n }\n\n &[type='radio'] ${prcSelector}::after {\n margin: auto;\n width: 100%;\n height: 100%;\n background-color: ${foreground};\n transform: scale(0.4);\n }\n\n &[type='checkbox'] ${prcSelector} {\n border-radius: min(calc(${baseBorderRadius} * ${checkRadius}), 0.25rem);\n }\n\n &[type='checkbox']:not(:indeterminate) ${prcSelector} {\n &::after {\n width: 40%;\n height: 75%;\n ${ltr\n ? css`\n transform: rotate(45deg) translate(50%, -30%);\n `\n : css`\n transform: rotate(45deg) translate(-50%, 30%);\n `}\n border-right: 0.15em solid ${foreground};\n border-bottom: 0.15em solid ${foreground};\n }\n }\n\n &[type='checkbox']:indeterminate ${prcSelector} {\n display: flex;\n &::after {\n width: 90%;\n height: 0.15em;\n margin: auto;\n background-color: ${foreground};\n }\n }\n `;\n});\n\nStyledRadioCheckInput.defaultProps = defaultThemeProp;\n\nexport const StyledRadioCheck = styled.div<Pick<RadioCheckProps, 'disabled' | 'readOnly'>>(\n props => {\n const {\n disabled,\n readOnly,\n theme: {\n base,\n components: {\n 'radio-check': {\n label: { color: labelColor, 'font-weight': labelFontWeight }\n },\n 'form-control': {\n ':hover': { 'border-color': hoverBorderColor }\n }\n }\n }\n } = props;\n\n const fontSize = calculateFontSize(base['font-size'], base['font-scale']);\n\n return css`\n > ${StyledLabel} {\n cursor: pointer;\n display: flex;\n align-items: center;\n font-weight: ${labelFontWeight};\n word-break: break-word;\n font-size: ${fontSize.s};\n color: ${labelColor};\n margin: 0;\n min-height: ${base['hit-area']['mouse-min']};\n\n @media (pointer: coarse) {\n min-height: ${base['hit-area']['finger-min']};\n }\n }\n\n ${!(disabled || readOnly) &&\n css`\n &:not(:focus-within) > ${StyledLabel}:hover ${StyledPseudoRadioCheck} {\n border-color: ${hoverBorderColor};\n }\n `}\n `;\n }\n);\n\nStyledRadioCheck.defaultProps = defaultThemeProp;\n\nexport const StyledRadioCheckCard = styled.label<\n Pick<RadioCheckProps, 'disabled' | 'readOnly' | 'status'>\n>(\n ({\n disabled,\n readOnly,\n status,\n theme: {\n base: { palette, shadow, spacing },\n components: {\n card,\n 'form-field': formField,\n 'radio-check': { label },\n 'form-control': {\n ':hover': { 'border-color': hoverBorderColor }\n }\n }\n }\n }) => {\n const useBorderColor =\n status === 'error' ? formField.error['status-color'] : palette['border-line'];\n\n return css`\n min-width: min-content;\n align-items: start;\n cursor: pointer;\n background-color: ${card.background};\n border-radius: ${card['border-radius']};\n border: 0.0625rem solid ${useBorderColor};\n padding: ${spacing};\n\n ${disabled &&\n css`\n cursor: not-allowed;\n `}\n\n ${!(disabled || readOnly) &&\n css`\n :hover:not(:focus-within) {\n border-color: ${hoverBorderColor};\n ${StyledLabel} ${StyledPseudoRadioCheck} {\n border-color: ${hoverBorderColor};\n }\n }\n\n :focus-within {\n box-shadow: ${shadow.focus};\n border-color: transparent;\n }\n `}\n\n > ${StyledLabel} {\n display: grid;\n grid-template-columns: auto 1fr;\n color: ${label.color};\n font-weight: ${label['font-weight']};\n }\n `;\n }\n);\n\nStyledRadioCheckCard.defaultProps = defaultThemeProp;\n\nconst RadioCheck: FC<RadioCheckProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<RadioCheckProps>, ref: RadioCheckProps['ref']) => {\n const uid = useUID();\n const {\n type,\n id = uid,\n label,\n required = false,\n disabled = false,\n indeterminate = false,\n readOnly = false,\n variant = 'simple',\n onClick,\n onKeyDown,\n status,\n ...restProps\n } = props;\n\n const isRadio = type === 'radio';\n const card = variant === 'card';\n const newRef = useConsolidatedRef(ref);\n\n useEffect(() => {\n if (!isRadio && newRef.current) {\n newRef.current.indeterminate = !!indeterminate;\n }\n }, [newRef, indeterminate, isRadio]);\n\n return (\n <FormField\n as={card ? StyledRadioCheckCard : StyledRadioCheck}\n label={\n <>\n <StyledPseudoRadioCheck\n status={status}\n isRadio={isRadio}\n as={StyledFormControl}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n />\n {label}\n </>\n }\n labelAs={card ? 'div' : undefined}\n id={id}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n status={status}\n inline\n labelAfter\n >\n <StyledRadioCheckInput\n {...restProps}\n id={id}\n type={type}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n aria-readonly={readOnly}\n onClick={(e: MouseEvent<HTMLInputElement>) => {\n if (readOnly) e.preventDefault();\n\n onClick?.(e);\n }}\n onKeyDown={(e: KeyboardEvent<HTMLInputElement>) => {\n if (type === 'checkbox' && readOnly && e.key === ' ') {\n e.preventDefault();\n }\n if (type === 'radio' && readOnly && e.key.includes('Arrow')) {\n e.preventDefault();\n }\n\n onKeyDown?.(e);\n }}\n ref={newRef}\n />\n </FormField>\n );\n }\n);\n\nexport default RadioCheck;\n"]}
1
+ {"version":3,"file":"RadioCheck.js","sourceRoot":"","sources":["../../../src/components/RadioCheck/RadioCheck.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAGV,SAAS,EAMV,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE5D,OA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I,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,mBACH,QAAQ,EACvB,OAAO,EAAE,CAAC,CAA+B,EAAE,EAAE;gBAC3C,IAAI,QAAQ;oBAAE,CAAC,CAAC,cAAc,EAAE,CAAC;gBAEjC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;YACf,CAAC,EACD,SAAS,EAAE,CAAC,CAAkC,EAAE,EAAE;gBAChD,IAAI,IAAI,KAAK,UAAU,IAAI,QAAQ,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,EAAE;oBACpD,CAAC,CAAC,cAAc,EAAE,CAAC;iBACpB;gBACD,IAAI,IAAI,KAAK,OAAO,IAAI,QAAQ,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;oBAC3D,CAAC,CAAC,cAAc,EAAE,CAAC;iBACpB;gBAED,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;YACjB,CAAC,EACD,GAAG,EAAE,MAAM,WACX,WACQ,CACb,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import {\n forwardRef,\n FC,\n Ref,\n useEffect,\n MouseEvent,\n KeyboardEvent,\n PropsWithoutRef,\n MouseEventHandler,\n KeyboardEventHandler\n} from 'react';\nimport styled, { css } from 'styled-components';\nimport { readableColor, hideVisually, mix } from 'polished';\n\nimport FormField from '../FormField';\nimport { FormControlProps, StyledFormControl } from '../FormControl';\nimport { defaultThemeProp } from '../../theme';\nimport { tryCatch } from '../../utils/utils';\nimport { BaseProps, ForwardProps } from '../../types';\nimport { useConsolidatedRef, useDirection, useUID } from '../../hooks';\nimport { StyledLabel } from '../Label';\nimport { calculateFontSize } from '../../styles';\n\nexport interface RadioCheckProps extends BaseProps {\n /**\n * Sets DOM id for the control and associates label element via 'for' attribute.\n * If an id is not pass, a random id will be generated for any render.\n */\n id?: FormControlProps['id'];\n /** Pass a string or a fragment with an Icon and string. */\n label?: FormControlProps['label'];\n /** Indicate if the field is required. The browser defaults to false. */\n required?: FormControlProps['required'];\n /** Disable the control. The browser defaults to false. */\n disabled?: FormControlProps['disabled'];\n /** Makes the input non editable and non clickable. The browser defaults to false. */\n readOnly?: FormControlProps['readOnly'];\n /** Set visual state based on a validation state. */\n status?: FormControlProps['status'];\n /** Sets html name attribute for the underlying control. Useful for mapping to a data field. */\n name?: FormControlProps['name'];\n /** Sets the type of input. */\n type: 'radio' | 'checkbox';\n /** Sets checked prop via onChange when using as controlled component. */\n checked?: boolean;\n /** Initialize checked prop when using as uncontrolled component. */\n defaultChecked?: boolean;\n /**\n * Sets control to an an indeterminate state.\n * @default false\n */\n indeterminate?: boolean;\n /**\n * Controls the styling of the RadioCheck.\n * @default 'simple'\n */\n variant?: 'simple' | 'card';\n /** Callback function for onClick events. */\n onClick?: MouseEventHandler<HTMLInputElement>;\n /** Callback function for onKeyDown events. */\n onKeyDown?: KeyboardEventHandler<HTMLInputElement>;\n /** Ref forwarded to the underlying input. */\n ref?: Ref<HTMLInputElement>;\n}\n\nexport const StyledPseudoRadioCheck = styled.div<Pick<RadioCheckProps, 'readOnly' | 'status'>>(\n props => {\n const {\n theme: {\n base: {\n spacing,\n palette: { 'primary-background': primaryBackground }\n },\n components: {\n 'form-field': formField,\n 'radio-check': {\n size,\n 'touch-size': touchSize,\n 'background-color': backgroundColor,\n 'border-color': borderColor,\n 'border-width': borderWidth\n }\n }\n },\n status\n } = props;\n\n const useBorderColor = status === 'error' ? formField.error['status-color'] : borderColor;\n const useBackgroundColor =\n status && formField[status]\n ? tryCatch(() => mix(0.8, primaryBackground, formField[status]['status-color']))\n : backgroundColor;\n\n return css`\n display: flex;\n flex-shrink: 0;\n position: relative;\n width: ${size};\n height: ${size};\n margin-inline-end: ${spacing};\n border: ${borderWidth} solid ${useBorderColor};\n background-color: ${useBackgroundColor};\n\n @media (pointer: coarse) {\n width: ${touchSize};\n height: ${touchSize};\n }\n\n &::after {\n content: '';\n display: none;\n }\n `;\n }\n);\n\nStyledPseudoRadioCheck.defaultProps = defaultThemeProp;\n\nexport const StyledRadioCheckInput = styled.input(props => {\n const {\n theme: {\n base: { 'border-radius': baseBorderRadius },\n components: {\n 'form-control': {\n ':focus': { 'box-shadow': shadow, 'border-color': focusBorderColor },\n ':read-only': { 'background-color': readOnlyBackgroundColor }\n },\n 'radio-check': {\n ':checked': {\n 'background-color': checkedBackgroundColor,\n 'border-color': checkedBorderColor\n }\n },\n checkbox: { 'border-radius': checkRadius },\n 'radio-button': { 'border-radius': radioRadius }\n }\n }\n } = props;\n\n const backgroundColor = props.readOnly ? readOnlyBackgroundColor : checkedBackgroundColor;\n const foreground = tryCatch(() => readableColor(backgroundColor));\n\n const prcSelector = `+ ${StyledLabel} ${StyledPseudoRadioCheck}`;\n const { ltr } = useDirection();\n\n return css`\n ${hideVisually}\n\n ${!(props.disabled || props.readOnly) &&\n css`\n &:focus ${prcSelector} {\n box-shadow: ${shadow};\n border-color: ${focusBorderColor};\n }\n `}\n\n &:checked\n ${prcSelector},\n &:checked:disabled\n ${prcSelector},\n &[type='checkbox']:indeterminate\n ${prcSelector},\n &[type='checkbox']:indeterminate:disabled\n ${prcSelector} {\n border-color: ${props.readOnly ? 'inherit' : checkedBorderColor};\n background-color: ${backgroundColor};\n\n &::after {\n display: block;\n }\n }\n\n &[type='radio'] ${prcSelector}, &[type='radio'] ${prcSelector}::after {\n border-radius: ${radioRadius};\n }\n\n &[type='radio'] ${prcSelector}::after {\n margin: auto;\n width: 100%;\n height: 100%;\n background-color: ${foreground};\n transform: scale(0.4);\n }\n\n &[type='checkbox'] ${prcSelector} {\n border-radius: min(calc(${baseBorderRadius} * ${checkRadius}), 0.25rem);\n }\n\n &[type='checkbox']:not(:indeterminate) ${prcSelector} {\n &::after {\n width: 40%;\n height: 75%;\n ${ltr\n ? css`\n transform: rotate(45deg) translate(50%, -30%);\n `\n : css`\n transform: rotate(45deg) translate(-50%, 30%);\n `}\n border-right: 0.15em solid ${foreground};\n border-bottom: 0.15em solid ${foreground};\n }\n }\n\n &[type='checkbox']:indeterminate ${prcSelector} {\n display: flex;\n &::after {\n width: 90%;\n height: 0.15em;\n margin: auto;\n background-color: ${foreground};\n }\n }\n `;\n});\n\nStyledRadioCheckInput.defaultProps = defaultThemeProp;\n\nexport const StyledRadioCheck = styled.div<Pick<RadioCheckProps, 'disabled' | 'readOnly'>>(\n props => {\n const {\n disabled,\n readOnly,\n theme: {\n base,\n components: {\n 'radio-check': {\n label: { color: labelColor, 'font-weight': labelFontWeight }\n },\n 'form-control': {\n ':hover': { 'border-color': hoverBorderColor }\n }\n }\n }\n } = props;\n\n const fontSize = calculateFontSize(base['font-size'], base['font-scale']);\n\n return css`\n > ${StyledLabel} {\n cursor: pointer;\n display: flex;\n align-items: center;\n font-weight: ${labelFontWeight};\n word-break: break-word;\n font-size: ${fontSize.s};\n color: ${labelColor};\n margin: 0;\n min-height: ${base['hit-area']['mouse-min']};\n\n @media (pointer: coarse) {\n min-height: ${base['hit-area']['finger-min']};\n }\n }\n\n ${!(disabled || readOnly) &&\n css`\n &:not(:focus-within) > ${StyledLabel}:hover ${StyledPseudoRadioCheck} {\n border-color: ${hoverBorderColor};\n }\n `}\n `;\n }\n);\n\nStyledRadioCheck.defaultProps = defaultThemeProp;\n\nexport const StyledRadioCheckCard = styled.label<\n Pick<RadioCheckProps, 'disabled' | 'readOnly' | 'status'>\n>(\n ({\n disabled,\n readOnly,\n status,\n theme: {\n base: { palette, shadow, spacing },\n components: {\n card,\n 'form-field': formField,\n 'radio-check': { label },\n 'form-control': {\n ':hover': { 'border-color': hoverBorderColor }\n }\n }\n }\n }) => {\n const useBorderColor =\n status === 'error' ? formField.error['status-color'] : palette['border-line'];\n\n return css`\n min-width: min-content;\n align-items: start;\n cursor: pointer;\n background-color: ${card.background};\n border-radius: ${card['border-radius']};\n border: 0.0625rem solid ${useBorderColor};\n padding: ${spacing};\n\n ${disabled &&\n css`\n cursor: not-allowed;\n `}\n\n ${!(disabled || readOnly) &&\n css`\n :hover:not(:focus-within) {\n border-color: ${hoverBorderColor};\n ${StyledLabel} ${StyledPseudoRadioCheck} {\n border-color: ${hoverBorderColor};\n }\n }\n\n :focus-within {\n box-shadow: ${shadow.focus};\n border-color: transparent;\n }\n `}\n\n > ${StyledLabel} {\n display: grid;\n grid-template-columns: auto 1fr;\n color: ${label.color};\n font-weight: ${label['font-weight']};\n }\n `;\n }\n);\n\nStyledRadioCheckCard.defaultProps = defaultThemeProp;\n\nconst RadioCheck: FC<RadioCheckProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<RadioCheckProps>, ref: RadioCheckProps['ref']) => {\n const uid = useUID();\n const {\n type,\n id = uid,\n label,\n required = false,\n disabled = false,\n indeterminate = false,\n readOnly = false,\n variant = 'simple',\n onClick,\n onKeyDown,\n status,\n ...restProps\n } = props;\n\n const isRadio = type === 'radio';\n const card = variant === 'card';\n const newRef = useConsolidatedRef(ref);\n\n useEffect(() => {\n if (!isRadio && newRef.current) {\n newRef.current.indeterminate = !!indeterminate;\n }\n }, [newRef, indeterminate, isRadio]);\n\n return (\n <FormField\n as={card ? StyledRadioCheckCard : StyledRadioCheck}\n label={\n <>\n <StyledPseudoRadioCheck\n status={status}\n isRadio={isRadio}\n as={StyledFormControl}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n />\n {label}\n </>\n }\n labelAs={card ? 'div' : undefined}\n id={id}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n status={status}\n inline\n labelAfter\n >\n <StyledRadioCheckInput\n {...restProps}\n id={id}\n type={type}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n aria-readonly={readOnly}\n onClick={(e: MouseEvent<HTMLInputElement>) => {\n if (readOnly) e.preventDefault();\n\n onClick?.(e);\n }}\n onKeyDown={(e: KeyboardEvent<HTMLInputElement>) => {\n if (type === 'checkbox' && readOnly && e.key === ' ') {\n e.preventDefault();\n }\n if (type === 'radio' && readOnly && e.key.includes('Arrow')) {\n e.preventDefault();\n }\n\n onKeyDown?.(e);\n }}\n ref={newRef}\n />\n </FormField>\n );\n }\n);\n\nexport default RadioCheck;\n"]}
@@ -47,18 +47,18 @@ const RadioCheckGroup = forwardRef((props, ref) => {
47
47
  };
48
48
  }
49
49
  }, [optionsEl, inline, autoStack]);
50
- return (_jsx(FormField, Object.assign({}, {
51
- as: StyledRadioCheckGroup,
52
- labelAs: 'legend',
53
- ref,
54
- name,
55
- disabled,
56
- ...restProps
57
- }, { children: _jsx(Grid, Object.assign({ ref: setOptionsEl, container: {
50
+ return (_jsx(FormField, { ...{
51
+ as: StyledRadioCheckGroup,
52
+ labelAs: 'legend',
53
+ ref,
54
+ name,
55
+ disabled,
56
+ ...restProps
57
+ }, children: _jsx(Grid, { ref: setOptionsEl, container: {
58
58
  colGap: 1,
59
59
  rowGap: variant === 'card' ? 1 : 0,
60
60
  cols: renderInline ? 'repeat(auto-fit, minmax(1ch, max-content))' : '1fr'
61
- } }, { children: Children.map(children, child => cloneElement(child, {
61
+ }, children: Children.map(children, child => cloneElement(child, {
62
62
  name,
63
63
  disabled: disabled || child.props.disabled,
64
64
  readOnly: readOnly || child.props.readOnly,
@@ -71,7 +71,7 @@ const RadioCheckGroup = forwardRef((props, ref) => {
71
71
  }
72
72
  }
73
73
  : child.props.onChange
74
- })) }), void 0) }), void 0));
74
+ })) }, void 0) }, void 0));
75
75
  });
76
76
  RadioCheckGroup.defaultProps = defaultProps;
77
77
  export default RadioCheckGroup;
@@ -1 +1 @@
1
- {"version":3,"file":"RadioCheckGroup.js","sourceRoot":"","sources":["../../../src/components/RadioCheckGroup/RadioCheckGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGL,UAAU,EAEV,QAAQ,EACR,YAAY,EAGZ,QAAQ,EACR,SAAS,EACT,MAAM,EACP,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAGvC,OAAO,SAA6B,MAAM,cAAc,CAAC;AAC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AAC,EAAE,CAC9B,YAAY,CAAC,KAAK,EAAE;gBAClB,IAAI;gBACJ,QAAQ,EAAE,QAAQ,IAAI,KAAK,CAAC,KAAK,CAAC,QAAQ;gBAC1C,QAAQ,EAAE,QAAQ,IAAI,KAAK,CAAC,KAAK,CAAC,QAAQ;gBAC1C,OAAO;gBACP,QAAQ,EAAE,QAAQ;oBAChB,CAAC,CAAC,CAAC,CAAgC,EAAE,EAAE;wBACnC,IAAI,CAAC,CAAC,QAAQ,IAAI,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE;4BACvC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;4BAC1B,QAAQ,CAAC,CAAC,CAAC,CAAC;yBACb;oBACH,CAAC;oBACH,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ;aACzB,CAAC,CACH,YACI,YACG,CACb,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,CAAC,YAAY,GAAG,YAAY,CAAC;AAE5C,eAAe,eAAe,CAAC","sourcesContent":["import {\n FC,\n Ref,\n forwardRef,\n PropsWithoutRef,\n Children,\n cloneElement,\n ReactElement,\n ChangeEvent,\n useState,\n useEffect,\n useRef\n} from 'react';\nimport styled from 'styled-components';\n\nimport { ForwardProps } from '../../types';\nimport FormField, { FormFieldProps } from '../FormField';\nimport { StyledFormField } from '../FormField/FormField';\nimport { FormControlProps } from '../FormControl';\nimport { RadioCheckProps } from '../RadioCheck';\nimport Grid from '../Grid';\nimport { useElement, useUID } from '../../hooks';\n\nexport interface RadioCheckGroupProps {\n /** Accepts Checkboxes or RadioButtons as children. */\n children: ReactElement | ReactElement[];\n /**\n * Conveniently pass an onChange handler to the group to be notified when any of the inputs change.\n * Additionally, onChange can be passed to individual children.\n * Both handlers will be called, child followed by group.\n */\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\n /** Set visual state based on a validation state. */\n status?: FormControlProps['status'];\n /** Pass a string or a fragment with an Icon and string. */\n label?: FormControlProps['label'];\n /** Visually hides the label region. */\n labelHidden?: FormControlProps['labelHidden'];\n /** It is recommended to pass a simple string to offer guidance. Text will be styled based on status prop. */\n info?: FormControlProps['info'];\n /** Indicate if the field is required. The browser defaults to false. */\n required?: FormControlProps['required'];\n /** Disable the control. The browser defaults to false. */\n disabled?: FormControlProps['disabled'];\n /** Makes the input non editable and non clickable. The browser defaults to false. */\n readOnly?: FormControlProps['readOnly'];\n /**\n * Layout field elements inline in a row.\n * @default false\n */\n inline?: FormFieldProps['inline'];\n /** Used to toggle the auto stacking feature of an inlined group.\n * @default true\n */\n autoStack?: boolean;\n /** Sets html name attribute for the underlying control. Useful for mapping to a data field. */\n name?: FormControlProps['name'];\n /**\n * Controls the styling of the child RadioChecks.\n * @default 'simple'\n */\n variant?: RadioCheckProps['variant'];\n /** Ref forwarded to the wrapping element. */\n ref?: Ref<HTMLElement>;\n}\n\nconst defaultProps = {\n required: false,\n disabled: false\n};\n\nconst StyledRadioCheckGroup = styled.fieldset`\n &[disabled] {\n > ${StyledFormField} {\n opacity: unset;\n }\n }\n`;\n\nconst RadioCheckGroup: FC<RadioCheckGroupProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<RadioCheckGroupProps>, ref: RadioCheckGroupProps['ref']) => {\n const uid = useUID();\n const {\n children,\n name = uid,\n disabled,\n onChange,\n readOnly,\n inline = false,\n autoStack = true,\n variant = 'simple',\n ...restProps\n } = props;\n\n const [optionsEl, setOptionsEl] = useElement<HTMLDivElement>();\n const [renderInline, setRenderInline] = useState(inline);\n const renderInlineRef = useRef(inline);\n const minInlineWidth = useRef(0);\n\n useEffect(() => {\n if (inline && optionsEl && autoStack) {\n const intersectionObserver = new IntersectionObserver(\n entries => {\n if (entries[0].intersectionRatio < 1) {\n if (entries[0].rootBounds) minInlineWidth.current = entries[0].rootBounds.width + 1;\n renderInlineRef.current = false;\n setRenderInline(false);\n }\n },\n { root: optionsEl, threshold: 1 }\n );\n\n const resizeObserver = new ResizeObserver(entries => {\n if (!renderInlineRef.current && entries[0].contentRect.width > minInlineWidth.current) {\n renderInlineRef.current = true;\n setRenderInline(true);\n }\n });\n\n intersectionObserver.observe(optionsEl.lastChild as Element);\n resizeObserver.observe(optionsEl);\n\n return () => {\n intersectionObserver.disconnect();\n resizeObserver.disconnect();\n };\n }\n }, [optionsEl, inline, autoStack]);\n\n return (\n <FormField\n {...{\n as: StyledRadioCheckGroup,\n labelAs: 'legend',\n ref,\n name,\n disabled,\n ...restProps\n }}\n >\n <Grid\n ref={setOptionsEl}\n container={{\n colGap: 1,\n rowGap: variant === 'card' ? 1 : 0,\n cols: renderInline ? 'repeat(auto-fit, minmax(1ch, max-content))' : '1fr'\n }}\n >\n {Children.map(children, child =>\n cloneElement(child, {\n name,\n disabled: disabled || child.props.disabled,\n readOnly: readOnly || child.props.readOnly,\n variant,\n onChange: onChange\n ? (e: ChangeEvent<HTMLInputElement>) => {\n if (!(readOnly || child.props.readOnly)) {\n child.props.onChange?.(e);\n onChange(e);\n }\n }\n : child.props.onChange\n })\n )}\n </Grid>\n </FormField>\n );\n }\n);\n\nRadioCheckGroup.defaultProps = defaultProps;\n\nexport default RadioCheckGroup;\n"]}
1
+ {"version":3,"file":"RadioCheckGroup.js","sourceRoot":"","sources":["../../../src/components/RadioCheckGroup/RadioCheckGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGL,UAAU,EAEV,QAAQ,EACR,YAAY,EAGZ,QAAQ,EACR,SAAS,EACT,MAAM,EACP,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAGvC,OAAO,SAA6B,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAGzD,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AA6CjD,MAAM,YAAY,GAAG;IACnB,QAAQ,EAAE,KAAK;IACf,QAA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Q,EAAE,QAAQ;oBAChB,CAAC,CAAC,CAAC,CAAgC,EAAE,EAAE;wBACnC,IAAI,CAAC,CAAC,QAAQ,IAAI,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE;4BACvC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;4BAC1B,QAAQ,CAAC,CAAC,CAAC,CAAC;yBACb;oBACH,CAAC;oBACH,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ;aACzB,CAAC,CACH,WACI,WACG,CACb,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,CAAC,YAAY,GAAG,YAAY,CAAC;AAE5C,eAAe,eAAe,CAAC","sourcesContent":["import {\n FC,\n Ref,\n forwardRef,\n PropsWithoutRef,\n Children,\n cloneElement,\n ReactElement,\n ChangeEvent,\n useState,\n useEffect,\n useRef\n} from 'react';\nimport styled from 'styled-components';\n\nimport { ForwardProps } from '../../types';\nimport FormField, { FormFieldProps } from '../FormField';\nimport { StyledFormField } from '../FormField/FormField';\nimport { FormControlProps } from '../FormControl';\nimport { RadioCheckProps } from '../RadioCheck';\nimport Grid from '../Grid';\nimport { useElement, useUID } from '../../hooks';\n\nexport interface RadioCheckGroupProps {\n /** Accepts Checkboxes or RadioButtons as children. */\n children: ReactElement | ReactElement[];\n /**\n * Conveniently pass an onChange handler to the group to be notified when any of the inputs change.\n * Additionally, onChange can be passed to individual children.\n * Both handlers will be called, child followed by group.\n */\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\n /** Set visual state based on a validation state. */\n status?: FormControlProps['status'];\n /** Pass a string or a fragment with an Icon and string. */\n label?: FormControlProps['label'];\n /** Visually hides the label region. */\n labelHidden?: FormControlProps['labelHidden'];\n /** It is recommended to pass a simple string to offer guidance. Text will be styled based on status prop. */\n info?: FormControlProps['info'];\n /** Indicate if the field is required. The browser defaults to false. */\n required?: FormControlProps['required'];\n /** Disable the control. The browser defaults to false. */\n disabled?: FormControlProps['disabled'];\n /** Makes the input non editable and non clickable. The browser defaults to false. */\n readOnly?: FormControlProps['readOnly'];\n /**\n * Layout field elements inline in a row.\n * @default false\n */\n inline?: FormFieldProps['inline'];\n /** Used to toggle the auto stacking feature of an inlined group.\n * @default true\n */\n autoStack?: boolean;\n /** Sets html name attribute for the underlying control. Useful for mapping to a data field. */\n name?: FormControlProps['name'];\n /**\n * Controls the styling of the child RadioChecks.\n * @default 'simple'\n */\n variant?: RadioCheckProps['variant'];\n /** Ref forwarded to the wrapping element. */\n ref?: Ref<HTMLElement>;\n}\n\nconst defaultProps = {\n required: false,\n disabled: false\n};\n\nconst StyledRadioCheckGroup = styled.fieldset`\n &[disabled] {\n > ${StyledFormField} {\n opacity: unset;\n }\n }\n`;\n\nconst RadioCheckGroup: FC<RadioCheckGroupProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<RadioCheckGroupProps>, ref: RadioCheckGroupProps['ref']) => {\n const uid = useUID();\n const {\n children,\n name = uid,\n disabled,\n onChange,\n readOnly,\n inline = false,\n autoStack = true,\n variant = 'simple',\n ...restProps\n } = props;\n\n const [optionsEl, setOptionsEl] = useElement<HTMLDivElement>();\n const [renderInline, setRenderInline] = useState(inline);\n const renderInlineRef = useRef(inline);\n const minInlineWidth = useRef(0);\n\n useEffect(() => {\n if (inline && optionsEl && autoStack) {\n const intersectionObserver = new IntersectionObserver(\n entries => {\n if (entries[0].intersectionRatio < 1) {\n if (entries[0].rootBounds) minInlineWidth.current = entries[0].rootBounds.width + 1;\n renderInlineRef.current = false;\n setRenderInline(false);\n }\n },\n { root: optionsEl, threshold: 1 }\n );\n\n const resizeObserver = new ResizeObserver(entries => {\n if (!renderInlineRef.current && entries[0].contentRect.width > minInlineWidth.current) {\n renderInlineRef.current = true;\n setRenderInline(true);\n }\n });\n\n intersectionObserver.observe(optionsEl.lastChild as Element);\n resizeObserver.observe(optionsEl);\n\n return () => {\n intersectionObserver.disconnect();\n resizeObserver.disconnect();\n };\n }\n }, [optionsEl, inline, autoStack]);\n\n return (\n <FormField\n {...{\n as: StyledRadioCheckGroup,\n labelAs: 'legend',\n ref,\n name,\n disabled,\n ...restProps\n }}\n >\n <Grid\n ref={setOptionsEl}\n container={{\n colGap: 1,\n rowGap: variant === 'card' ? 1 : 0,\n cols: renderInline ? 'repeat(auto-fit, minmax(1ch, max-content))' : '1fr'\n }}\n >\n {Children.map(children, child =>\n cloneElement(child, {\n name,\n disabled: disabled || child.props.disabled,\n readOnly: readOnly || child.props.readOnly,\n variant,\n onChange: onChange\n ? (e: ChangeEvent<HTMLInputElement>) => {\n if (!(readOnly || child.props.readOnly)) {\n child.props.onChange?.(e);\n onChange(e);\n }\n }\n : child.props.onChange\n })\n )}\n </Grid>\n </FormField>\n );\n }\n);\n\nRadioCheckGroup.defaultProps = defaultProps;\n\nexport default RadioCheckGroup;\n"]}
@@ -50,7 +50,7 @@ StyledRatingMetaInfo.defaultProps = defaultThemeProp;
50
50
  const RatingItem = (props) => {
51
51
  const { fill, ...restProps } = props;
52
52
  const fillPercentage = Math.round((100 / 1) * fill);
53
- return (_jsxs(_Fragment, { children: [fillPercentage === 0 && _jsx(Icon, Object.assign({}, restProps, { name: 'star' }), void 0), fillPercentage === 100 && _jsx(Icon, Object.assign({}, restProps, { name: 'star-solid' }), void 0), fillPercentage > 0 && fillPercentage < 100 && (_jsxs(StyledPartialRatingContainer, { children: [_jsx(Icon, Object.assign({}, restProps, { name: 'star' }), void 0), _jsx(StyledPartialRating, Object.assign({ ratingPercentage: fillPercentage }, { children: _jsx(Icon, Object.assign({}, restProps, { name: 'star-solid' }), void 0) }), void 0)] }, void 0))] }, void 0));
53
+ return (_jsxs(_Fragment, { children: [fillPercentage === 0 && _jsx(Icon, { ...restProps, name: 'star' }, void 0), fillPercentage === 100 && _jsx(Icon, { ...restProps, name: 'star-solid' }, void 0), fillPercentage > 0 && fillPercentage < 100 && (_jsxs(StyledPartialRatingContainer, { children: [_jsx(Icon, { ...restProps, name: 'star' }, void 0), _jsx(StyledPartialRating, { ratingPercentage: fillPercentage, children: _jsx(Icon, { ...restProps, name: 'star-solid' }, void 0) }, void 0)] }, void 0))] }, void 0));
54
54
  };
55
55
  const Rating = (props) => {
56
56
  const starsOutline = [];
@@ -67,7 +67,7 @@ const Rating = (props) => {
67
67
  }
68
68
  starsOutline.push(_jsx(RatingItem, { fill: fillValue }, `star-${i}`));
69
69
  }
70
- return (_jsxs(StyledRating, Object.assign({ "aria-label": ariaLabel, tabIndex: tabIndex }, restProps, { children: [_jsx(StyledRatingItemsContainer, { children: starsOutline }, void 0), metaInfo && _jsxs(StyledRatingMetaInfo, { children: ["(", metaInfo, ")"] }, void 0), ' '] }), void 0));
70
+ return (_jsxs(StyledRating, { "aria-label": ariaLabel, tabIndex: tabIndex, ...restProps, children: [_jsx(StyledRatingItemsContainer, { children: starsOutline }, void 0), metaInfo && _jsxs(StyledRatingMetaInfo, { children: ["(", metaInfo, ")"] }, void 0), ' '] }, void 0));
71
71
  };
72
72
  Rating.defaultProps = defaultProps;
73
73
  export default Rating;
@@ -1 +1 @@
1
- {"version":3,"file":"Rating.js","sourceRoot":"","sources":["../../../src/components/Rating/Rating.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,aAAa,MAAM,+BAA+B,CAAC;AAE/D,YAAY,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;AA0BtC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAE7B,MAAM,YAAY,GAAyB;IACzC,QAAQ,EAAE,KAAK;IACf,SAAS,EAAE,kBAAkB;IAC7B,QAAQ,EAAE,CAAC;CACZ,CAAC;AAEF,MAAM,YAAY,GAA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,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACvC;QACD,YAAY,CAAC,IAAI,CAAC,KAAC,UAAU,IAAmB,IAAI,EAAE,SAAS,IAA5B,QAAQ,CAAC,EAAE,CAAqB,CAAC,CAAC;KACtE;IAED,OAAO,CACL,MAAC,YAAY,gCAAa,SAAS,EAAE,QAAQ,EAAE,QAAQ,IAAM,SAAS,eACpE,KAAC,0BAA0B,cAAE,YAAY,WAA8B,EACtE,QAAQ,IAAI,MAAC,oBAAoB,oBAAG,QAAQ,iBAAyB,EAAE,GAAG,aAC9D,CAChB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;AAEnC,eAAe,MAAM,CAAC","sourcesContent":["import { FunctionComponent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { BaseProps, ForwardProps } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport Icon, { registerIcon } from '../Icon';\nimport * as starIcon from '../Icon/icons/star.icon';\nimport * as starSolidIcon from '../Icon/icons/star-solid.icon';\n\nregisterIcon(starIcon, starSolidIcon);\n\nexport interface RatingProps extends BaseProps {\n /**\n * Sets the rating to read only.\n * @default false\n */\n readOnly?: boolean;\n /**\n * The maximum rating allowed. Must be an integer greater than 1.\n * @default 5\n */\n maxRating?: number;\n /** The value of the Rating. Could be a decimal or integer. */\n value: number;\n /** Text that is displayed in parentheses inline with the Rating stars. */\n metaInfo?: string;\n /** Aria label for screen readers. */\n 'aria-label'?: string;\n /**\n * The tabIndex to control focus.\n * @default 0\n */\n tabIndex?: number;\n}\n\nconst DEFAULT_MAX_RATING = 5;\n\nconst defaultProps: Partial<RatingProps> = {\n readOnly: false,\n maxRating: DEFAULT_MAX_RATING,\n tabIndex: 0\n};\n\nconst StyledRating = styled.div`\n display: inline-block;\n vertical-align: middle;\n`;\n\nconst StyledRatingItemsContainer = styled.div(props => {\n const { theme } = props;\n return css`\n color: ${theme.components.rating.color};\n line-height: 1;\n vertical-align: middle;\n display: inline-block;\n `;\n});\n\nStyledRatingItemsContainer.defaultProps = defaultThemeProp;\n\nconst StyledPartialRatingContainer = styled.div`\n position: relative;\n display: inline-block;\n`;\n\ninterface StyledPartialRatingProps {\n ratingPercentage: number;\n}\n\nexport const StyledPartialRating = styled.div<StyledPartialRatingProps>(props => {\n const { ratingPercentage } = props;\n return css`\n display: inline-block;\n position: absolute;\n inset-inline-start: 0;\n width: ${ratingPercentage}%;\n overflow: hidden;\n white-space: nowrap;\n `;\n});\n\nconst StyledRatingMetaInfo = styled.span(props => {\n const { theme } = props;\n return css`\n margin-inline-start: ${theme.base.spacing};\n `;\n});\n\nStyledRatingMetaInfo.defaultProps = defaultThemeProp;\n\ninterface RatingItemProps {\n fill: number;\n}\n\nconst RatingItem: FunctionComponent<RatingItemProps> = (props: RatingItemProps) => {\n const { fill, ...restProps } = props;\n const fillPercentage = Math.round((100 / 1) * fill);\n return (\n <>\n {fillPercentage === 0 && <Icon {...restProps} name='star' />}\n {fillPercentage === 100 && <Icon {...restProps} name='star-solid' />}\n {fillPercentage > 0 && fillPercentage < 100 && (\n <StyledPartialRatingContainer>\n <Icon {...restProps} name='star' />\n <StyledPartialRating ratingPercentage={fillPercentage}>\n <Icon {...restProps} name='star-solid' />\n </StyledPartialRating>\n </StyledPartialRatingContainer>\n )}\n </>\n );\n};\n\nconst Rating: FunctionComponent<RatingProps & ForwardProps> = (props: RatingProps) => {\n const starsOutline = [];\n const { 'aria-label': ariaLabel, metaInfo, tabIndex, readOnly, ...restProps } = props;\n\n let { maxRating, value } = props;\n maxRating = typeof maxRating !== 'number' ? DEFAULT_MAX_RATING : maxRating;\n maxRating = Math.max(1, maxRating);\n value = Math.min(maxRating, value);\n\n const isDecimalValue = Math.round(value) !== value;\n for (let i = 1; i <= maxRating; i += 1) {\n let fillValue = i <= value ? 1 : 0;\n if (isDecimalValue && Math.ceil(value) === i) {\n fillValue = value - Math.floor(value);\n }\n starsOutline.push(<RatingItem key={`star-${i}`} fill={fillValue} />);\n }\n\n return (\n <StyledRating aria-label={ariaLabel} tabIndex={tabIndex} {...restProps}>\n <StyledRatingItemsContainer>{starsOutline}</StyledRatingItemsContainer>\n {metaInfo && <StyledRatingMetaInfo>({metaInfo})</StyledRatingMetaInfo>}{' '}\n </StyledRating>\n );\n};\n\nRating.defaultProps = defaultProps;\n\nexport default Rating;\n"]}
1
+ {"version":3,"file":"Rating.js","sourceRoot":"","sources":["../../../src/components/Rating/Rating.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,aAAa,MAAM,+BAA+B,CAAC;AAE/D,YAAY,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;AA0BtC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAE7B,MAAM,YAAY,GAAyB;IACzC,QAAQ,EAAE,KAAK;IACf,SAAS,EAAE,kBAAkB;IAC7B,QAAQ,EAAE,CAAC;CACZ,CAAC;AAEF,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAG9B,CAAC;AAEF,MAAM,0BAA0B,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;IACpD,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACxB,OAAO,GAAG,CAAA;aACC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK;;;;GAIvC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,0BAA0B,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE3D,MAAM,4BAA4B,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAG9C,CAAC;AAMF,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC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MAAM,CAAC","sourcesContent":["import { FunctionComponent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { BaseProps, ForwardProps } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport Icon, { registerIcon } from '../Icon';\nimport * as starIcon from '../Icon/icons/star.icon';\nimport * as starSolidIcon from '../Icon/icons/star-solid.icon';\n\nregisterIcon(starIcon, starSolidIcon);\n\nexport interface RatingProps extends BaseProps {\n /**\n * Sets the rating to read only.\n * @default false\n */\n readOnly?: boolean;\n /**\n * The maximum rating allowed. Must be an integer greater than 1.\n * @default 5\n */\n maxRating?: number;\n /** The value of the Rating. Could be a decimal or integer. */\n value: number;\n /** Text that is displayed in parentheses inline with the Rating stars. */\n metaInfo?: string;\n /** Aria label for screen readers. */\n 'aria-label'?: string;\n /**\n * The tabIndex to control focus.\n * @default 0\n */\n tabIndex?: number;\n}\n\nconst DEFAULT_MAX_RATING = 5;\n\nconst defaultProps: Partial<RatingProps> = {\n readOnly: false,\n maxRating: DEFAULT_MAX_RATING,\n tabIndex: 0\n};\n\nconst StyledRating = styled.div`\n display: inline-block;\n vertical-align: middle;\n`;\n\nconst StyledRatingItemsContainer = styled.div(props => {\n const { theme } = props;\n return css`\n color: ${theme.components.rating.color};\n line-height: 1;\n vertical-align: middle;\n display: inline-block;\n `;\n});\n\nStyledRatingItemsContainer.defaultProps = defaultThemeProp;\n\nconst StyledPartialRatingContainer = styled.div`\n position: relative;\n display: inline-block;\n`;\n\ninterface StyledPartialRatingProps {\n ratingPercentage: number;\n}\n\nexport const StyledPartialRating = styled.div<StyledPartialRatingProps>(props => {\n const { ratingPercentage } = props;\n return css`\n display: inline-block;\n position: absolute;\n inset-inline-start: 0;\n width: ${ratingPercentage}%;\n overflow: hidden;\n white-space: nowrap;\n `;\n});\n\nconst StyledRatingMetaInfo = styled.span(props => {\n const { theme } = props;\n return css`\n margin-inline-start: ${theme.base.spacing};\n `;\n});\n\nStyledRatingMetaInfo.defaultProps = defaultThemeProp;\n\ninterface RatingItemProps {\n fill: number;\n}\n\nconst RatingItem: FunctionComponent<RatingItemProps> = (props: RatingItemProps) => {\n const { fill, ...restProps } = props;\n const fillPercentage = Math.round((100 / 1) * fill);\n return (\n <>\n {fillPercentage === 0 && <Icon {...restProps} name='star' />}\n {fillPercentage === 100 && <Icon {...restProps} name='star-solid' />}\n {fillPercentage > 0 && fillPercentage < 100 && (\n <StyledPartialRatingContainer>\n <Icon {...restProps} name='star' />\n <StyledPartialRating ratingPercentage={fillPercentage}>\n <Icon {...restProps} name='star-solid' />\n </StyledPartialRating>\n </StyledPartialRatingContainer>\n )}\n </>\n );\n};\n\nconst Rating: FunctionComponent<RatingProps & ForwardProps> = (props: RatingProps) => {\n const starsOutline = [];\n const { 'aria-label': ariaLabel, metaInfo, tabIndex, readOnly, ...restProps } = props;\n\n let { maxRating, value } = props;\n maxRating = typeof maxRating !== 'number' ? DEFAULT_MAX_RATING : maxRating;\n maxRating = Math.max(1, maxRating);\n value = Math.min(maxRating, value);\n\n const isDecimalValue = Math.round(value) !== value;\n for (let i = 1; i <= maxRating; i += 1) {\n let fillValue = i <= value ? 1 : 0;\n if (isDecimalValue && Math.ceil(value) === i) {\n fillValue = value - Math.floor(value);\n }\n starsOutline.push(<RatingItem key={`star-${i}`} fill={fillValue} />);\n }\n\n return (\n <StyledRating aria-label={ariaLabel} tabIndex={tabIndex} {...restProps}>\n <StyledRatingItemsContainer>{starsOutline}</StyledRatingItemsContainer>\n {metaInfo && <StyledRatingMetaInfo>({metaInfo})</StyledRatingMetaInfo>}{' '}\n </StyledRating>\n );\n};\n\nRating.defaultProps = defaultProps;\n\nexport default Rating;\n"]}
@@ -99,9 +99,9 @@ const SearchInput = forwardRef((props, ref) => {
99
99
  if (onSearchChange)
100
100
  onSearchChange(searchInputValue);
101
101
  }, [searchInputValue]);
102
- return (_jsxs(Flex, Object.assign({ container: true, as: StyledSearchInput }, { children: [_jsx(StyledSearchTextInput, Object.assign({ ref: innerRef, type: 'search', "aria-label": searchInputAriaLabel, placeholder: placeholder }, restProps, { value: searchInputValue, onChange: onChange, onKeyDown: onKeyDown }), void 0), _jsx(Flex, Object.assign({ as: StyledSearchIcon, container: { justify: 'center', alignItems: 'center' }, onClick: () => {
102
+ return (_jsxs(Flex, { container: true, as: StyledSearchInput, children: [_jsx(StyledSearchTextInput, { ref: innerRef, type: 'search', "aria-label": searchInputAriaLabel, placeholder: placeholder, ...restProps, value: searchInputValue, onChange: onChange, onKeyDown: onKeyDown }, void 0), _jsx(Flex, { as: StyledSearchIcon, container: { justify: 'center', alignItems: 'center' }, onClick: () => {
103
103
  innerRef.current?.focus();
104
- } }, { children: _jsx(Icon, { name: 'search' }, void 0) }), void 0)] }), void 0));
104
+ }, children: _jsx(Icon, { name: 'search' }, void 0) }, void 0)] }, void 0));
105
105
  });
106
106
  export default SearchInput;
107
107
  //# sourceMappingURL=SearchInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SearchInput.js","sourceRoot":"","sources":["../../../src/components/SearchInput/SearchInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAIL,UAAU,EACV,QAAQ,EAER,WAAW,EAEX,SAAS,EACV,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,YAAY,CAAC,UAAU,CAAC,CAAC;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ED,KAAC,IAAI,IAAC,IAAI,EAAC,QAAQ,WAAG,YACjB,aACF,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import {\n FunctionComponent,\n PropsWithoutRef,\n Ref,\n forwardRef,\n useState,\n ChangeEvent,\n useCallback,\n KeyboardEvent,\n useEffect\n} from 'react';\nimport styled, { css } from 'styled-components';\nimport { transparentize } from 'polished';\n\nimport { ForwardProps } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport Input from '../Input';\nimport Icon, { registerIcon } from '../Icon';\nimport * as searchIcon from '../Icon/icons/search.icon';\nimport { FormControlProps } from '../FormControl';\nimport { useAfterInitialEffect, useConsolidatedRef, useI18n } from '../../hooks';\nimport Flex from '../Flex';\nimport { tryCatch } from '../../utils';\n\nregisterIcon(searchIcon);\n\nexport interface SearchInputProps {\n /**\n * Placeholder text. The default value is a locale translation of 'Search…'\n * @default \"Search…\"\n */\n placeholder?: FormControlProps['placeholder'];\n /**\n * Creates a controlled input and sets the value. Requires an onChange handler to update value.\n * value + onChange is the recommended method per React team.\n */\n value?: FormControlProps['value'];\n /**\n * If you wish to use an [uncontrolled input](https://reactjs.org/docs/uncontrolled-components.html), pass a defaultValue prop and a ref to access the input's native value prop or by other DOM ref means.\n */\n defaultValue?: FormControlProps['defaultValue'];\n /** Called when the SearchInput value changes. */\n onSearchChange?: (value: string) => void;\n /**\n * Called when the SearchButton is clicked or when the Enter key is pressed while SearchInput is in focus.\n * NOTE: this does not trigger an actual form submit event. It simply represents an explicit action by the user to search as opposed to onSearchChange.\n */\n onSearchSubmit?: (value: string) => void;\n /** Aria label for search input, used by screen readers. */\n searchInputAriaLabel?: string;\n}\n\nexport const StyledSearchIcon = styled.div(props => {\n const {\n theme: {\n base,\n components: { 'search-input': searchInput, 'form-control': formControl }\n }\n } = props;\n const iconColor = tryCatch(() => transparentize(0.75, base.palette['foreground-color']));\n return css`\n position: absolute;\n z-index: 1;\n inset-inline-start: 0.0625rem;\n top: 0.0625rem;\n width: calc(${base['hit-area']['mouse-min']} - 0.125rem);\n height: calc(${base['hit-area']['mouse-min']} - 0.125rem);\n border-radius: calc(${base['border-radius']} * ${searchInput['border-radius']});\n padding: 0;\n background: ${formControl['background-color']};\n color: ${iconColor};\n cursor: text;\n line-height: 1;\n `;\n});\n\nStyledSearchIcon.defaultProps = defaultThemeProp;\n\nexport const StyledSearchTextInput = styled(Input)(props => {\n const { theme } = props;\n const comp = theme.components['search-input'];\n return css`\n position: relative;\n width: 100%;\n height: ${theme.base['hit-area']['mouse-min']};\n min-height: ${theme.base['hit-area']['mouse-min']};\n padding-inline-start: 0;\n padding-inline-end: calc(${theme.base['hit-area']['mouse-min']} - 0.125rem);\n text-indent: calc(${theme.base['hit-area']['mouse-min']} - 0.125rem);\n border-radius: calc(${comp['border-radius']} * ${theme.base['border-radius']});\n &::-ms-clear {\n display: none;\n }\n &::-webkit-search-cancel-button {\n display: none;\n }\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n\n &:focus:not([disabled]) {\n box-shadow: none;\n }\n `;\n});\n\nStyledSearchTextInput.defaultProps = defaultThemeProp;\n\nexport const StyledSearchInput = styled.div(({ theme: { base, components } }) => {\n const iconColor = tryCatch(() => transparentize(0.3, base.palette['foreground-color']));\n\n return css`\n position: relative;\n height: ${base['hit-area']['mouse-min']};\n border-radius: calc(${components['search-input']['border-radius']} * ${base['border-radius']});\n\n &:focus-within {\n box-shadow: ${base.shadow.focus};\n\n ${StyledSearchIcon} {\n color: ${iconColor};\n }\n }\n `;\n});\n\nStyledSearchInput.defaultProps = defaultThemeProp;\n\nconst SearchInput: FunctionComponent<SearchInputProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<SearchInputProps>, ref: Ref<HTMLInputElement>) => {\n const t = useI18n();\n\n const {\n defaultValue,\n value,\n placeholder = t('search_placeholder_default'),\n onSearchChange,\n onSearchSubmit,\n searchInputAriaLabel,\n ...restProps\n } = props;\n\n const [searchInputValue, setValue] = useState<string>(value || defaultValue || '');\n\n const innerRef = useConsolidatedRef(ref);\n\n useEffect(() => {\n if (typeof value === 'string' && value !== searchInputValue) {\n setValue(value);\n }\n }, [value]);\n\n const onChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n setValue(e.target.value);\n },\n [searchInputValue]\n );\n\n const onSubmit = useCallback(() => {\n onSearchSubmit?.(searchInputValue);\n }, [searchInputValue]);\n\n const onKeyDown = useCallback(\n (e: KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter') {\n onSubmit();\n }\n },\n [searchInputValue]\n );\n\n useAfterInitialEffect(() => {\n if (onSearchChange) onSearchChange(searchInputValue);\n }, [searchInputValue]);\n\n return (\n <Flex container as={StyledSearchInput}>\n <StyledSearchTextInput\n ref={innerRef}\n type='search'\n aria-label={searchInputAriaLabel}\n placeholder={placeholder}\n {...restProps}\n value={searchInputValue}\n onChange={onChange}\n onKeyDown={onKeyDown}\n />\n <Flex\n as={StyledSearchIcon}\n container={{ justify: 'center', alignItems: 'center' }}\n onClick={() => {\n innerRef.current?.focus();\n }}\n >\n <Icon name='search' />\n </Flex>\n </Flex>\n );\n }\n);\n\nexport default SearchInput;\n"]}
1
+ {"version":3,"file":"SearchInput.js","sourceRoot":"","sources":["../../../src/components/SearchInput/SearchInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAIL,UAAU,EACV,QAAQ,EAER,WAAW,EAEX,SAAS,EACV,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,q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gB,EACpB,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,EACtD,OAAO,EAAE,GAAG,EAAE;oBACZ,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;gBAC5B,CAAC,YAED,KAAC,IAAI,IAAC,IAAI,EAAC,QAAQ,WAAG,WACjB,YACF,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import {\n FunctionComponent,\n PropsWithoutRef,\n Ref,\n forwardRef,\n useState,\n ChangeEvent,\n useCallback,\n KeyboardEvent,\n useEffect\n} from 'react';\nimport styled, { css } from 'styled-components';\nimport { transparentize } from 'polished';\n\nimport { ForwardProps } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport Input from '../Input';\nimport Icon, { registerIcon } from '../Icon';\nimport * as searchIcon from '../Icon/icons/search.icon';\nimport { FormControlProps } from '../FormControl';\nimport { useAfterInitialEffect, useConsolidatedRef, useI18n } from '../../hooks';\nimport Flex from '../Flex';\nimport { tryCatch } from '../../utils';\n\nregisterIcon(searchIcon);\n\nexport interface SearchInputProps {\n /**\n * Placeholder text. The default value is a locale translation of 'Search…'\n * @default \"Search…\"\n */\n placeholder?: FormControlProps['placeholder'];\n /**\n * Creates a controlled input and sets the value. Requires an onChange handler to update value.\n * value + onChange is the recommended method per React team.\n */\n value?: FormControlProps['value'];\n /**\n * If you wish to use an [uncontrolled input](https://reactjs.org/docs/uncontrolled-components.html), pass a defaultValue prop and a ref to access the input's native value prop or by other DOM ref means.\n */\n defaultValue?: FormControlProps['defaultValue'];\n /** Called when the SearchInput value changes. */\n onSearchChange?: (value: string) => void;\n /**\n * Called when the SearchButton is clicked or when the Enter key is pressed while SearchInput is in focus.\n * NOTE: this does not trigger an actual form submit event. It simply represents an explicit action by the user to search as opposed to onSearchChange.\n */\n onSearchSubmit?: (value: string) => void;\n /** Aria label for search input, used by screen readers. */\n searchInputAriaLabel?: string;\n}\n\nexport const StyledSearchIcon = styled.div(props => {\n const {\n theme: {\n base,\n components: { 'search-input': searchInput, 'form-control': formControl }\n }\n } = props;\n const iconColor = tryCatch(() => transparentize(0.75, base.palette['foreground-color']));\n return css`\n position: absolute;\n z-index: 1;\n inset-inline-start: 0.0625rem;\n top: 0.0625rem;\n width: calc(${base['hit-area']['mouse-min']} - 0.125rem);\n height: calc(${base['hit-area']['mouse-min']} - 0.125rem);\n border-radius: calc(${base['border-radius']} * ${searchInput['border-radius']});\n padding: 0;\n background: ${formControl['background-color']};\n color: ${iconColor};\n cursor: text;\n line-height: 1;\n `;\n});\n\nStyledSearchIcon.defaultProps = defaultThemeProp;\n\nexport const StyledSearchTextInput = styled(Input)(props => {\n const { theme } = props;\n const comp = theme.components['search-input'];\n return css`\n position: relative;\n width: 100%;\n height: ${theme.base['hit-area']['mouse-min']};\n min-height: ${theme.base['hit-area']['mouse-min']};\n padding-inline-start: 0;\n padding-inline-end: calc(${theme.base['hit-area']['mouse-min']} - 0.125rem);\n text-indent: calc(${theme.base['hit-area']['mouse-min']} - 0.125rem);\n border-radius: calc(${comp['border-radius']} * ${theme.base['border-radius']});\n &::-ms-clear {\n display: none;\n }\n &::-webkit-search-cancel-button {\n display: none;\n }\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n\n &:focus:not([disabled]) {\n box-shadow: none;\n }\n `;\n});\n\nStyledSearchTextInput.defaultProps = defaultThemeProp;\n\nexport const StyledSearchInput = styled.div(({ theme: { base, components } }) => {\n const iconColor = tryCatch(() => transparentize(0.3, base.palette['foreground-color']));\n\n return css`\n position: relative;\n height: ${base['hit-area']['mouse-min']};\n border-radius: calc(${components['search-input']['border-radius']} * ${base['border-radius']});\n\n &:focus-within {\n box-shadow: ${base.shadow.focus};\n\n ${StyledSearchIcon} {\n color: ${iconColor};\n }\n }\n `;\n});\n\nStyledSearchInput.defaultProps = defaultThemeProp;\n\nconst SearchInput: FunctionComponent<SearchInputProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<SearchInputProps>, ref: Ref<HTMLInputElement>) => {\n const t = useI18n();\n\n const {\n defaultValue,\n value,\n placeholder = t('search_placeholder_default'),\n onSearchChange,\n onSearchSubmit,\n searchInputAriaLabel,\n ...restProps\n } = props;\n\n const [searchInputValue, setValue] = useState<string>(value || defaultValue || '');\n\n const innerRef = useConsolidatedRef(ref);\n\n useEffect(() => {\n if (typeof value === 'string' && value !== searchInputValue) {\n setValue(value);\n }\n }, [value]);\n\n const onChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n setValue(e.target.value);\n },\n [searchInputValue]\n );\n\n const onSubmit = useCallback(() => {\n onSearchSubmit?.(searchInputValue);\n }, [searchInputValue]);\n\n const onKeyDown = useCallback(\n (e: KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter') {\n onSubmit();\n }\n },\n [searchInputValue]\n );\n\n useAfterInitialEffect(() => {\n if (onSearchChange) onSearchChange(searchInputValue);\n }, [searchInputValue]);\n\n return (\n <Flex container as={StyledSearchInput}>\n <StyledSearchTextInput\n ref={innerRef}\n type='search'\n aria-label={searchInputAriaLabel}\n placeholder={placeholder}\n {...restProps}\n value={searchInputValue}\n onChange={onChange}\n onKeyDown={onKeyDown}\n />\n <Flex\n as={StyledSearchIcon}\n container={{ justify: 'center', alignItems: 'center' }}\n onClick={() => {\n innerRef.current?.focus();\n }}\n >\n <Icon name='search' />\n </Flex>\n </Flex>\n );\n }\n);\n\nexport default SearchInput;\n"]}
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  const defaultProps = {};
3
3
  const Option = (props) => {
4
4
  const { children, ...restProps } = props;
5
- return _jsx("option", Object.assign({}, restProps, { children: children }), void 0);
5
+ return _jsx("option", { ...restProps, children: children }, void 0);
6
6
  };
7
7
  Option.defaultProps = defaultProps;
8
8
  export default Option;
@@ -1 +1 @@
1
- {"version":3,"file":"Option.js","sourceRoot":"","sources":["../../../src/components/Select/Option.tsx"],"names":[],"mappings":";AAWA,MAAM,YAAY,GAAyB,EAAE,CAAC;AAE9C,MAAM,MAAM,GAAkD,CAAC,KAAkB,EAAE,EAAE;IACnF,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IACzC,OAAO,iCAAY,SAAS,cAAG,QAAQ,YAAU,CAAC;AACpD,CAAC,CAAC;AAEF,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;AAEnC,eAAe,MAAM,CAAC","sourcesContent":["import { FunctionComponent } from 'react';\n\nimport { BaseProps, ForwardProps } from '../../types';\n\nexport interface OptionProps extends BaseProps {\n /** Text content for the Option. */\n children: string;\n /** Value associated with the Option. This value is passed to the Select onChange function. */\n value?: string;\n}\n\nconst defaultProps: Partial<OptionProps> = {};\n\nconst Option: FunctionComponent<OptionProps & ForwardProps> = (props: OptionProps) => {\n const { children, ...restProps } = props;\n return <option {...restProps}>{children}</option>;\n};\n\nOption.defaultProps = defaultProps;\n\nexport default Option;\n"]}
1
+ {"version":3,"file":"Option.js","sourceRoot":"","sources":["../../../src/components/Select/Option.tsx"],"names":[],"mappings":";AAWA,MAAM,YAAY,GAAyB,EAAE,CAAC;AAE9C,MAAM,MAAM,GAAkD,CAAC,KAAkB,EAAE,EAAE;IACnF,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IACzC,OAAO,oBAAY,SAAS,YAAG,QAAQ,WAAU,CAAC;AACpD,CAAC,CAAC;AAEF,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;AAEnC,eAAe,MAAM,CAAC","sourcesContent":["import { FunctionComponent } from 'react';\n\nimport { BaseProps, ForwardProps } from '../../types';\n\nexport interface OptionProps extends BaseProps {\n /** Text content for the Option. */\n children: string;\n /** Value associated with the Option. This value is passed to the Select onChange function. */\n value?: string;\n}\n\nconst defaultProps: Partial<OptionProps> = {};\n\nconst Option: FunctionComponent<OptionProps & ForwardProps> = (props: OptionProps) => {\n const { children, ...restProps } = props;\n return <option {...restProps}>{children}</option>;\n};\n\nOption.defaultProps = defaultProps;\n\nexport default Option;\n"]}
@@ -46,7 +46,7 @@ StyledSelect.defaultProps = defaultThemeProp;
46
46
  const Select = forwardRef((props, ref) => {
47
47
  const uid = useUID();
48
48
  const { children, id = uid, label, labelHidden, info, status, required = false, disabled = false, readOnly = false, actions, ...restProps } = props;
49
- const Comp = (_jsx(StyledFormControl, Object.assign({}, restProps, { as: StyledSelect, id: id, status: status, required: required, disabled: disabled, readOnly: readOnly, "aria-readonly": readOnly ? 'true' : undefined, ref: ref, onMouseDown: readOnly
49
+ const Comp = (_jsx(StyledFormControl, { ...restProps, as: StyledSelect, id: id, status: status, required: required, disabled: disabled, readOnly: readOnly, "aria-readonly": readOnly ? 'true' : undefined, ref: ref, onMouseDown: readOnly
50
50
  ? (e) => {
51
51
  e.preventDefault();
52
52
  }
@@ -56,18 +56,18 @@ const Select = forwardRef((props, ref) => {
56
56
  if (!['Escape', 'Tab'].includes(e.key))
57
57
  e.preventDefault();
58
58
  }
59
- : undefined }, { children: children }), void 0));
60
- return label ? (_jsx(FormField, Object.assign({}, {
61
- label,
62
- labelHidden,
63
- id,
64
- info,
65
- status,
66
- required,
67
- disabled,
68
- readOnly,
69
- actions
70
- }, { children: Comp }), void 0)) : (Comp);
59
+ : undefined, children: children }, void 0));
60
+ return label ? (_jsx(FormField, { ...{
61
+ label,
62
+ labelHidden,
63
+ id,
64
+ info,
65
+ status,
66
+ required,
67
+ disabled,
68
+ readOnly,
69
+ actions
70
+ }, children: Comp }, void 0)) : (Comp);
71
71
  });
72
72
  export default Select;
73
73
  //# sourceMappingURL=Select.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAOX,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,g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ent":["import {\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n Ref,\n ReactNode,\n ChangeEventHandler,\n MouseEvent\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../theme';\nimport { Action, ForwardProps } from '../../types';\nimport FormField from '../FormField';\nimport { StyledFormControl, FormControlProps } from '../FormControl';\nimport { useDirection, useUID } from '../../hooks';\n\nexport interface SelectProps {\n /** Pass Options components as children to render the options of the Select list. */\n children: ReactNode;\n /** Called when an Option is chosen within the list. */\n onChange?: ChangeEventHandler<HTMLSelectElement>;\n /**\n * Sets DOM id for the control and associates label element via 'for' attribute.\n * If an id is not pass, a random id will be generated for any render.\n */\n id?: FormControlProps['id'];\n /** Set visual state based on a validation state. */\n status?: FormControlProps['status'];\n /** Pass a string or a fragment with an Icon and string. */\n label?: FormControlProps['label'];\n /** Visually hides the label region. */\n labelHidden?: FormControlProps['labelHidden'];\n /** It is recommended to pass a simple string to offer guidance. Text will be styled based on status prop. */\n info?: FormControlProps['info'];\n /** Indicate if the field is required. The browser defaults to false. */\n required?: FormControlProps['required'];\n /**\n * Creates a controlled input and sets the value. Requires an onChange handler to update value.\n * value + onChange is the recommended method per React team.\n */\n value?: FormControlProps['value'];\n /** Disable the control. The browser defaults to false. */\n disabled?: FormControlProps['disabled'];\n /** Makes the input non editable and non clickable. The browser defaults to false. */\n readOnly?: FormControlProps['readOnly'];\n /** Sets html name attribute for the underlying control. Useful for mapping to a data field. */\n name?: FormControlProps['name'];\n /** Pass an array of Action objects to append button(s) inline with the Select. */\n actions?: Action[];\n /** A ref to the select element. */\n ref?: Ref<HTMLSelectElement>;\n}\n\nexport const StyledSelect = styled.select<{ status: boolean }>(props => {\n const {\n base,\n components: {\n 'form-control': { 'foreground-color': fg },\n select\n }\n } = props.theme;\n\n const foreground = encodeURIComponent(fg);\n const { rtl } = useDirection();\n\n return css`\n appearance: none;\n -webkit-appearance: none;\n overflow-x: hidden;\n text-overflow: ellipsis;\n width: 100%;\n height: ${select.height};\n min-height: ${base['hit-area']['mouse-min']};\n padding-inline-start: ${select.padding};\n padding-inline-end: calc(4 * ${base.spacing});\n\n /* cSpell:disable-next-line */\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 25 25' fill='${foreground}'%3E%3Cpath d='M12.1476563,16.5726562 C12.1476563,16.5726562 3.2875,9.72421875 3.2875,9.72421875 C3.2875,9.72421875 3.14375,9.58046875 3.14375,9.58046875 C3.04765625,9.3890625 3,9.19765625 3,9.00546875 C3,9.00546875 3,9.00546875 3,9.00546875 C3,8.33515625 3.33515625,8 3.9578125,8 C3.9578125,8 3.9578125,8 3.9578125,8 C4.1015625,8 4.29296875,8.09609375 4.628125,8.2390625 C4.628125,8.2390625 4.628125,8.2390625 4.628125,8.2390625 C4.628125,8.2390625 12.8179688,14.2257813 12.8179688,14.2257813 C12.8179688,14.2257813 21.103125,8.19140625 21.103125,8.19140625 C21.3421875,8.04765625 21.534375,8 21.678125,8 C21.678125,8 21.678125,8 21.678125,8 C22.3007813,8 22.6359375,8.33515625 22.6359375,9.00546875 C22.6359375,9.00546875 22.6359375,9.00546875 22.6359375,9.00546875 C22.6359375,9.196875 22.5882813,9.38828125 22.4921875,9.58046875 C22.4921875,9.58046875 22.4921875,9.58046875 22.4921875,9.58046875 C22.4921875,9.58046875 22.3484375,9.72421875 22.3484375,9.72421875 C22.3484375,9.72421875 13.4882812,16.525 13.4882812,16.525 C13.296875,16.7164063 13.0570312,16.8125 12.8179688,16.8125 C12.8179688,16.8125 12.8179688,16.8125 12.8179688,16.8125 C12.5789062,16.8125 12.3867188,16.7164062 12.1476563,16.5734375 C12.1476563,16.5734375 12.1476563,16.5734375 12.1476563,16.5734375 L12.1476563,16.5726562 Z'/%3E%3C/svg%3E\");\n background-repeat: no-repeat;\n background-size: calc(2 * ${base.spacing}) auto;\n background-position: ${rtl ? base.spacing : `calc(100% - ${base.spacing}) `} 60%;\n border-width: ${select['border-width']};\n border-radius: calc(${base['border-radius']} * ${select['border-radius']});\n\n ${!props.status &&\n css`\n border-color: ${select['border-color']};\n `}\n\n &::-ms-expand {\n display: none;\n }\n\n @media (pointer: coarse) {\n min-height: ${base['hit-area']['finger-min']};\n }\n `;\n});\n\nStyledSelect.defaultProps = defaultThemeProp;\n\nconst Select: FunctionComponent<SelectProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<SelectProps>, ref: SelectProps['ref']) => {\n const uid = useUID();\n const {\n children,\n id = uid,\n label,\n labelHidden,\n info,\n status,\n required = false,\n disabled = false,\n readOnly = false,\n actions,\n ...restProps\n } = props;\n\n const Comp = (\n <StyledFormControl\n {...restProps}\n as={StyledSelect}\n id={id}\n status={status}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n aria-readonly={readOnly ? 'true' : undefined}\n ref={ref}\n onMouseDown={\n readOnly\n ? (e: MouseEvent<HTMLSelectElement>) => {\n e.preventDefault();\n }\n : undefined\n }\n onKeyDown={\n readOnly\n ? (e: KeyboardEvent) => {\n // TODO: FOr future consider key modifiers at play e.g. \"ctrl p\"\n if (!['Escape', 'Tab'].includes(e.key)) e.preventDefault();\n }\n : undefined\n }\n >\n {children}\n </StyledFormControl>\n );\n\n return label ? (\n <FormField\n {...{\n label,\n labelHidden,\n id,\n info,\n status,\n required,\n disabled,\n readOnly,\n actions\n }}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n);\n\nexport default Select;\n"]}
1
+ {"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAOX,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAoB,MAAM,gBAAgB,CAAC;AACrE,OA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G,KAAK,EAChB,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,EAChB,OAAO,EACP,GAAG,SAAS,EACb,GAAG,KAAK,CAAC;IAEV,MAAM,IAAI,GAAG,CACX,KAAC,iBAAiB,OACZ,SAAS,EACb,EAAE,EAAE,YAAY,EAChB,EAAE,EAAE,EAAE,EACN,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,mBACH,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC5C,GAAG,EAAE,GAAG,EACR,WAAW,EACT,QAAQ;YACN,CAAC,CAAC,CAAC,CAAgC,EAAE,EAAE;gBACnC,CAAC,CAAC,cAAc,EAAE,CAAC;YACrB,CAAC;YACH,CAAC,CAAC,SAAS,EAEf,SAAS,EACP,QAAQ;YACN,CAAC,CAAC,CAAC,CAAgB,EAAE,EAAE;gBACnB,gEAAgE;gBAChE,IAAI,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC;oBAAE,CAAC,CAAC,cAAc,EAAE,CAAC;YAC7D,CAAC;YACH,CAAC,CAAC,SAAS,YAGd,QAAQ,WACS,CACrB,CAAC;IAEF,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,KAAC,SAAS,OACJ;YACF,KAAK;YACL,WAAW;YACX,EAAE;YACF,IAAI;YACJ,MAAM;YACN,QAAQ;YACR,QAAQ;YACR,QAAQ;YACR,OAAO;SACR,YAEA,IAAI,WACK,CACb,CAAC,CAAC,CAAC,CACF,IAAI,CACL,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n Ref,\n ReactNode,\n ChangeEventHandler,\n MouseEvent\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../theme';\nimport { Action, ForwardProps } from '../../types';\nimport FormField from '../FormField';\nimport { StyledFormControl, FormControlProps } from '../FormControl';\nimport { useDirection, useUID } from '../../hooks';\n\nexport interface SelectProps {\n /** Pass Options components as children to render the options of the Select list. */\n children: ReactNode;\n /** Called when an Option is chosen within the list. */\n onChange?: ChangeEventHandler<HTMLSelectElement>;\n /**\n * Sets DOM id for the control and associates label element via 'for' attribute.\n * If an id is not pass, a random id will be generated for any render.\n */\n id?: FormControlProps['id'];\n /** Set visual state based on a validation state. */\n status?: FormControlProps['status'];\n /** Pass a string or a fragment with an Icon and string. */\n label?: FormControlProps['label'];\n /** Visually hides the label region. */\n labelHidden?: FormControlProps['labelHidden'];\n /** It is recommended to pass a simple string to offer guidance. Text will be styled based on status prop. */\n info?: FormControlProps['info'];\n /** Indicate if the field is required. The browser defaults to false. */\n required?: FormControlProps['required'];\n /**\n * Creates a controlled input and sets the value. Requires an onChange handler to update value.\n * value + onChange is the recommended method per React team.\n */\n value?: FormControlProps['value'];\n /** Disable the control. The browser defaults to false. */\n disabled?: FormControlProps['disabled'];\n /** Makes the input non editable and non clickable. The browser defaults to false. */\n readOnly?: FormControlProps['readOnly'];\n /** Sets html name attribute for the underlying control. Useful for mapping to a data field. */\n name?: FormControlProps['name'];\n /** Pass an array of Action objects to append button(s) inline with the Select. */\n actions?: Action[];\n /** A ref to the select element. */\n ref?: Ref<HTMLSelectElement>;\n}\n\nexport const StyledSelect = styled.select<{ status: boolean }>(props => {\n const {\n base,\n components: {\n 'form-control': { 'foreground-color': fg },\n select\n }\n } = props.theme;\n\n const foreground = encodeURIComponent(fg);\n const { rtl } = useDirection();\n\n return css`\n appearance: none;\n -webkit-appearance: none;\n overflow-x: hidden;\n text-overflow: ellipsis;\n width: 100%;\n height: ${select.height};\n min-height: ${base['hit-area']['mouse-min']};\n padding-inline-start: ${select.padding};\n padding-inline-end: calc(4 * ${base.spacing});\n\n /* cSpell:disable-next-line */\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 25 25' fill='${foreground}'%3E%3Cpath d='M12.1476563,16.5726562 C12.1476563,16.5726562 3.2875,9.72421875 3.2875,9.72421875 C3.2875,9.72421875 3.14375,9.58046875 3.14375,9.58046875 C3.04765625,9.3890625 3,9.19765625 3,9.00546875 C3,9.00546875 3,9.00546875 3,9.00546875 C3,8.33515625 3.33515625,8 3.9578125,8 C3.9578125,8 3.9578125,8 3.9578125,8 C4.1015625,8 4.29296875,8.09609375 4.628125,8.2390625 C4.628125,8.2390625 4.628125,8.2390625 4.628125,8.2390625 C4.628125,8.2390625 12.8179688,14.2257813 12.8179688,14.2257813 C12.8179688,14.2257813 21.103125,8.19140625 21.103125,8.19140625 C21.3421875,8.04765625 21.534375,8 21.678125,8 C21.678125,8 21.678125,8 21.678125,8 C22.3007813,8 22.6359375,8.33515625 22.6359375,9.00546875 C22.6359375,9.00546875 22.6359375,9.00546875 22.6359375,9.00546875 C22.6359375,9.196875 22.5882813,9.38828125 22.4921875,9.58046875 C22.4921875,9.58046875 22.4921875,9.58046875 22.4921875,9.58046875 C22.4921875,9.58046875 22.3484375,9.72421875 22.3484375,9.72421875 C22.3484375,9.72421875 13.4882812,16.525 13.4882812,16.525 C13.296875,16.7164063 13.0570312,16.8125 12.8179688,16.8125 C12.8179688,16.8125 12.8179688,16.8125 12.8179688,16.8125 C12.5789062,16.8125 12.3867188,16.7164062 12.1476563,16.5734375 C12.1476563,16.5734375 12.1476563,16.5734375 12.1476563,16.5734375 L12.1476563,16.5726562 Z'/%3E%3C/svg%3E\");\n background-repeat: no-repeat;\n background-size: calc(2 * ${base.spacing}) auto;\n background-position: ${rtl ? base.spacing : `calc(100% - ${base.spacing}) `} 60%;\n border-width: ${select['border-width']};\n border-radius: calc(${base['border-radius']} * ${select['border-radius']});\n\n ${!props.status &&\n css`\n border-color: ${select['border-color']};\n `}\n\n &::-ms-expand {\n display: none;\n }\n\n @media (pointer: coarse) {\n min-height: ${base['hit-area']['finger-min']};\n }\n `;\n});\n\nStyledSelect.defaultProps = defaultThemeProp;\n\nconst Select: FunctionComponent<SelectProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<SelectProps>, ref: SelectProps['ref']) => {\n const uid = useUID();\n const {\n children,\n id = uid,\n label,\n labelHidden,\n info,\n status,\n required = false,\n disabled = false,\n readOnly = false,\n actions,\n ...restProps\n } = props;\n\n const Comp = (\n <StyledFormControl\n {...restProps}\n as={StyledSelect}\n id={id}\n status={status}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n aria-readonly={readOnly ? 'true' : undefined}\n ref={ref}\n onMouseDown={\n readOnly\n ? (e: MouseEvent<HTMLSelectElement>) => {\n e.preventDefault();\n }\n : undefined\n }\n onKeyDown={\n readOnly\n ? (e: KeyboardEvent) => {\n // TODO: FOr future consider key modifiers at play e.g. \"ctrl p\"\n if (!['Escape', 'Tab'].includes(e.key)) e.preventDefault();\n }\n : undefined\n }\n >\n {children}\n </StyledFormControl>\n );\n\n return label ? (\n <FormField\n {...{\n label,\n labelHidden,\n id,\n info,\n status,\n required,\n disabled,\n readOnly,\n actions\n }}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n);\n\nexport default Select;\n"]}
@@ -27,7 +27,7 @@ const Sentiment = forwardRef((props, ref) => {
27
27
  neutral: t('sentiment_neutral')
28
28
  };
29
29
  const { 'aria-label': ariaLabel, variant, labelHidden = false, labels = {}, icons = {}, ...restProps } = props;
30
- return (_jsxs(Flex, Object.assign({ "aria-label": ariaLabel, ref: ref, variant: variant }, restProps, { as: StyledSentiment, container: { gap: 1 } }, { children: [_jsx(Icon, { "aria-hidden": 'true', name: icons[variant] || defaultIcons[variant] }, void 0), !labelHidden && _jsx("span", { children: labels[variant] || defaultLabels[variant] }, void 0)] }), void 0));
30
+ return (_jsxs(Flex, { "aria-label": ariaLabel, ref: ref, variant: variant, ...restProps, as: StyledSentiment, container: { gap: 1 }, children: [_jsx(Icon, { "aria-hidden": 'true', name: icons[variant] || defaultIcons[variant] }, void 0), !labelHidden && _jsx("span", { children: labels[variant] || defaultLabels[variant] }, void 0)] }, void 0));
31
31
  });
32
32
  export default Sentiment;
33
33
  //# sourceMappingURL=Sentiment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Sentiment.js","sourceRoot":"","sources":["../../../src/components/Sentiment/Sentiment.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA2C,MAAM,OAAO,CAAC;AAC5E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAuB3C,MAAM,YAAY,GAA4B;IAC5C,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,YAAY;IACtB,OAAO,EAAE,YAAY;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAiB,KAAK,CAAC,EAAE;IAChE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IACjC,OAAO,GAAG,CAAA;QACJ,UAAU;eACH,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,KAAK;;GAErD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEhD,MAAM,SAAS,GAAqD,UAAU,CAC5E,CAAC,KAAsC,EAAE,GAA0B,EAAE,EAAE;IACrE,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,MAAM,aAAa,GAA6B;QAC9C,QAAQ,EAAE,CAAC,CAAC,oBAAoB,CAAC;QACjC,QAAQ,EAAE,CAAC,CAAC,oBAAoB,CAAC;QACjC,OAAO,EAAE,CAAC,CAAC,mBAAmB,CAAC;KAChC,CAAC;IAEF,MAAM,EACJ,YAAY,EAAE,SAAS,EACvB,OAAO,EACP,WAAW,GAAG,KAAK,EACnB,MAAM,GAAG,EAAE,EACX,KAAK,GAAG,EAAE,EACV,GAAG,SAAS,EACb,GAAG,KAAK,CAAC;IAEV,OAAO,CACL,MAAC,IAAI,gCACS,SAAS,EACrB,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,OAAO,IACZ,SAAS,IACb,EAAE,EAAE,eAAe,EACnB,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,iBAErB,KAAC,IAAI,mBAAa,MAAM,EAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,YAAY,CAAC,OAAO,CAAE,WAAI,EAC1E,CAAC,WAAW,IAAI,yBAAO,MAAM,CAAC,OAAO,CAAC,IAAI,aAAa,CAAC,OAAO,CAAC,WAAQ,aACpE,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport Flex from '../Flex';\nimport { useI18n } from '../../hooks';\nimport { defaultThemeProp } from '../../theme';\nimport { BaseProps, ForwardProps } from '../../types';\nimport Icon, { StyledIcon } from '../Icon';\n\nexport interface SentimentProps extends BaseProps {\n /** Ref to the element */\n ref?: Ref<HTMLDivElement>;\n /** Variant of the sentiment */\n variant: 'positive' | 'neutral' | 'negative';\n /** Flag that indicates if label needs to be hidden\n * @default false\n */\n labelHidden?: boolean;\n /** Labels for different sentiment variants. If not supplied default labels will be shown */\n labels?: {\n [variant in SentimentProps['variant']]?: string;\n };\n /** Icons for different sentiment variants. If not supplied default icons will be shown */\n icons?: {\n [variant in SentimentProps['variant']]?: string;\n };\n /** Aria label for screen readers. */\n 'aria-label'?: string;\n}\n\nconst defaultIcons: SentimentProps['icons'] = {\n negative: 'face-sad',\n positive: 'face-happy',\n neutral: 'face-blank'\n};\n\nexport const StyledSentiment = styled.div<SentimentProps>(props => {\n const { theme, variant } = props;\n return css`\n > ${StyledIcon} {\n color: ${theme.components.sentiment[variant].color};\n }\n `;\n});\n\nStyledSentiment.defaultProps = defaultThemeProp;\n\nconst Sentiment: FunctionComponent<SentimentProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<SentimentProps>, ref: SentimentProps['ref']) => {\n const t = useI18n();\n\n const defaultLabels: SentimentProps['labels'] = {\n negative: t('sentiment_negative'),\n positive: t('sentiment_positive'),\n neutral: t('sentiment_neutral')\n };\n\n const {\n 'aria-label': ariaLabel,\n variant,\n labelHidden = false,\n labels = {},\n icons = {},\n ...restProps\n } = props;\n\n return (\n <Flex\n aria-label={ariaLabel}\n ref={ref}\n variant={variant}\n {...restProps}\n as={StyledSentiment}\n container={{ gap: 1 }}\n >\n <Icon aria-hidden='true' name={icons[variant] || defaultIcons[variant]!} />\n {!labelHidden && <span>{labels[variant] || defaultLabels[variant]}</span>}\n </Flex>\n );\n }\n);\n\nexport default Sentiment;\n"]}
1
+ {"version":3,"file":"Sentiment.js","sourceRoot":"","sources":["../../../src/components/Sentiment/Sentiment.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA2C,MAAM,OAAO,CAAC;AAC5E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAuB3C,MAAM,YAAY,GAA4B;IAC5C,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,YAAY;IACtB,OAAO,EAAE,YAAY;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,MAA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led, { css } from 'styled-components';\n\nimport Flex from '../Flex';\nimport { useI18n } from '../../hooks';\nimport { defaultThemeProp } from '../../theme';\nimport { BaseProps, ForwardProps } from '../../types';\nimport Icon, { StyledIcon } from '../Icon';\n\nexport interface SentimentProps extends BaseProps {\n /** Ref to the element */\n ref?: Ref<HTMLDivElement>;\n /** Variant of the sentiment */\n variant: 'positive' | 'neutral' | 'negative';\n /** Flag that indicates if label needs to be hidden\n * @default false\n */\n labelHidden?: boolean;\n /** Labels for different sentiment variants. If not supplied default labels will be shown */\n labels?: {\n [variant in SentimentProps['variant']]?: string;\n };\n /** Icons for different sentiment variants. If not supplied default icons will be shown */\n icons?: {\n [variant in SentimentProps['variant']]?: string;\n };\n /** Aria label for screen readers. */\n 'aria-label'?: string;\n}\n\nconst defaultIcons: SentimentProps['icons'] = {\n negative: 'face-sad',\n positive: 'face-happy',\n neutral: 'face-blank'\n};\n\nexport const StyledSentiment = styled.div<SentimentProps>(props => {\n const { theme, variant } = props;\n return css`\n > ${StyledIcon} {\n color: ${theme.components.sentiment[variant].color};\n }\n `;\n});\n\nStyledSentiment.defaultProps = defaultThemeProp;\n\nconst Sentiment: FunctionComponent<SentimentProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<SentimentProps>, ref: SentimentProps['ref']) => {\n const t = useI18n();\n\n const defaultLabels: SentimentProps['labels'] = {\n negative: t('sentiment_negative'),\n positive: t('sentiment_positive'),\n neutral: t('sentiment_neutral')\n };\n\n const {\n 'aria-label': ariaLabel,\n variant,\n labelHidden = false,\n labels = {},\n icons = {},\n ...restProps\n } = props;\n\n return (\n <Flex\n aria-label={ariaLabel}\n ref={ref}\n variant={variant}\n {...restProps}\n as={StyledSentiment}\n container={{ gap: 1 }}\n >\n <Icon aria-hidden='true' name={icons[variant] || defaultIcons[variant]!} />\n {!labelHidden && <span>{labels[variant] || defaultLabels[variant]}</span>}\n </Flex>\n );\n }\n);\n\nexport default Sentiment;\n"]}
@@ -28,7 +28,7 @@ export const StyledLineSkeleton = styled.div(props => {
28
28
  });
29
29
  StyledLineSkeleton.defaultProps = defaultThemeProp;
30
30
  const LineSkeleton = (props) => {
31
- return _jsx(StyledLineSkeleton, Object.assign({}, props, { "aria-disabled": 'true' }), void 0);
31
+ return _jsx(StyledLineSkeleton, { ...props, "aria-disabled": 'true' }, void 0);
32
32
  };
33
33
  LineSkeleton.defaultProps = defaultProps;
34
34
  export default LineSkeleton;
@@ -1 +1 @@
1
- {"version":3,"file":"LineSkeleton.js","sourceRoot":"","sources":["../../../src/components/Skeleton/LineSkeleton.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAe/C,MAAM,YAAY,GAA+B;IAC/C,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,SAAS;CACnB,CAAC;AAEF,MAAM,eAAe,GAAG;IACtB,OAAO,EAAE,MAAM;IACf,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,KAAK;CACT,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAA6B,KAAK,CAAC,EAAE;IAC/E,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IACjC,MAAM,EAAE,QAAQ,EAAE,kBAAkB,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;IAClE,MAAM,aAAa,GAAG,eAAe,CAAC,KAAK,IAAI,SAAS,CAAC,CAAC;IAC1D,MAAM,eAAe,GAAG,sBAAsB,CAAC;IAC/C,OAAO,GAAG,CAAA;;;;aAIC,aAAa;MACpB,OAAO,KAAK,SAAS;QACrB,CAAC,CAAC,qBAAqB,kBAAkB,EAAE;QAC3C,CAAC,CAAC,qBAAqB,eAAe,EAAE;GAC3C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEnD,MAAM,YAAY,GAAwD,CACxE,KAAwB,EACxB,EAAE;IACF,OAAO,KAAC,kBAAkB,oBAAK,KAAK,qBAAgB,MAAM,YAAG,CAAC;AAChE,CAAC,CAAC;AAEF,YAAY,CAAC,YAAY,GAAG,YAAY,CAAC;AAEzC,eAAe,YAAY,CAAC","sourcesContent":["import { FunctionComponent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { BaseProps, ForwardProps } from '../../types';\nimport { defaultThemeProp } from '../../theme';\n\nexport interface LineSkeletonProps extends BaseProps {\n /**\n * Width of the skeleton.\n * @default \"default\"\n */\n width?: 'default' | 'l' | 'm' | 's';\n /**\n * Variant of the skeleton.\n * @default \"default\"\n */\n variant?: 'default' | 'link';\n}\n\nconst defaultProps: Partial<LineSkeletonProps> = {\n width: 'default',\n variant: 'default'\n};\n\nconst lengthToPercent = {\n default: 'auto',\n l: '80%',\n m: '50%',\n s: '30%'\n};\n\nexport const StyledLineSkeleton = styled.div<Partial<LineSkeletonProps>>(props => {\n const { width, variant } = props;\n const { skeleton: skeletonBackground } = props.theme.base.palette;\n const lengthPercent = lengthToPercent[width || 'default'];\n const LinkHeaderColor = 'rgb(135,206,235,0.5)';\n return css`\n flex-grow: 1;\n margin: 0.25rem;\n height: 0.875rem;\n width: ${lengthPercent};\n ${variant === 'default'\n ? `background-color: ${skeletonBackground}`\n : `background-color: ${LinkHeaderColor}`}\n `;\n});\n\nStyledLineSkeleton.defaultProps = defaultThemeProp;\n\nconst LineSkeleton: FunctionComponent<LineSkeletonProps & ForwardProps> = (\n props: LineSkeletonProps\n) => {\n return <StyledLineSkeleton {...props} aria-disabled='true' />;\n};\n\nLineSkeleton.defaultProps = defaultProps;\n\nexport default LineSkeleton;\n"]}
1
+ {"version":3,"file":"LineSkeleton.js","sourceRoot":"","sources":["../../../src/components/Skeleton/LineSkeleton.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAe/C,MAAM,YAAY,GAA+B;IAC/C,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,SAAS;CACnB,CAAC;AAEF,MAAM,eAAe,GAAG;IACtB,OAAO,EAAE,MAAM;IACf,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,KAAK;CACT,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAA6B,KAAK,CAAC,EAAE;IAC/E,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IACjC,MAAM,EAAE,QAAQ,EAAE,kBAAkB,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;IAClE,MAAM,aAAa,GAAG,eAAe,CAAC,KAAK,IAAI,SAAS,CAAC,CAAC;IAC1D,MAAM,eAAe,GAAG,sBAAsB,CAAC;IAC/C,OAAO,GAAG,CAAA;;;;aAIC,aAAa;MACpB,OAAO,KAAK,SAAS;QACrB,CAAC,CAAC,qBAAqB,kBAAkB,EAAE;QAC3C,CAAC,CAAC,qBAAqB,eAAe,EAAE;GAC3C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEnD,MAAM,YAAY,GAAwD,CACxE,KAAwB,EACxB,EAAE;IACF,OAAO,KAAC,kBAAkB,OAAK,KAAK,mBAAgB,MAAM,WAAG,CAAC;AAChE,CAAC,CAAC;AAEF,YAAY,CAAC,YAAY,GAAG,YAAY,CAAC;AAEzC,eAAe,YAAY,CAAC","sourcesContent":["import { FunctionComponent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { BaseProps, ForwardProps } from '../../types';\nimport { defaultThemeProp } from '../../theme';\n\nexport interface LineSkeletonProps extends BaseProps {\n /**\n * Width of the skeleton.\n * @default \"default\"\n */\n width?: 'default' | 'l' | 'm' | 's';\n /**\n * Variant of the skeleton.\n * @default \"default\"\n */\n variant?: 'default' | 'link';\n}\n\nconst defaultProps: Partial<LineSkeletonProps> = {\n width: 'default',\n variant: 'default'\n};\n\nconst lengthToPercent = {\n default: 'auto',\n l: '80%',\n m: '50%',\n s: '30%'\n};\n\nexport const StyledLineSkeleton = styled.div<Partial<LineSkeletonProps>>(props => {\n const { width, variant } = props;\n const { skeleton: skeletonBackground } = props.theme.base.palette;\n const lengthPercent = lengthToPercent[width || 'default'];\n const LinkHeaderColor = 'rgb(135,206,235,0.5)';\n return css`\n flex-grow: 1;\n margin: 0.25rem;\n height: 0.875rem;\n width: ${lengthPercent};\n ${variant === 'default'\n ? `background-color: ${skeletonBackground}`\n : `background-color: ${LinkHeaderColor}`}\n `;\n});\n\nStyledLineSkeleton.defaultProps = defaultThemeProp;\n\nconst LineSkeleton: FunctionComponent<LineSkeletonProps & ForwardProps> = (\n props: LineSkeletonProps\n) => {\n return <StyledLineSkeleton {...props} aria-disabled='true' />;\n};\n\nLineSkeleton.defaultProps = defaultProps;\n\nexport default LineSkeleton;\n"]}
@@ -7,7 +7,7 @@ const StyledParagraphSkeleton = styled.div `
7
7
  `;
8
8
  StyledParagraphSkeleton.defaultProps = defaultThemeProp;
9
9
  const ParagraphSkeleton = (props) => {
10
- return (_jsx(StyledParagraphSkeleton, Object.assign({}, props, { "aria-disabled": 'true' }, { children: props.children }), void 0));
10
+ return (_jsx(StyledParagraphSkeleton, { ...props, "aria-disabled": 'true', children: props.children }, void 0));
11
11
  };
12
12
  ParagraphSkeleton.defaultProps = defaultProps;
13
13
  export default ParagraphSkeleton;
@@ -1 +1 @@
1
- {"version":3,"file":"ParagraphSkeleton.js","sourceRoot":"","sources":["../../../src/components/Skeleton/ParagraphSkeleton.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAGvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAO/C,MAAM,YAAY,GAAoC,EAAE,CAAC;AAEzD,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAwB;;CAEjE,CAAC;AAEF,uBAAuB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAExD,MAAM,iBAAiB,GAA6D,CAClF,KAA6B,EAC7B,EAAE;IACF,OAAO,CACL,KAAC,uBAAuB,oBAAK,KAAK,qBAAgB,MAAM,gBACrD,KAAK,CAAC,QAAQ,YACS,CAC3B,CAAC;AACJ,CAAC,CAAC;AAEF,iBAAiB,CAAC,YAAY,GAAG,YAAY,CAAC;AAE9C,eAAe,iBAAiB,CAAC","sourcesContent":["import { FunctionComponent, ReactNode } from 'react';\nimport styled from 'styled-components';\n\nimport { BaseProps, ForwardProps } from '../../types';\nimport { defaultThemeProp } from '../../theme';\n\nexport interface ParagraphSkeletonProps extends BaseProps {\n /** Children for the skeleton. These should be Line and Rectangle Skeletons. */\n children: ReactNode;\n}\n\nconst defaultProps: Partial<ParagraphSkeletonProps> = {};\n\nconst StyledParagraphSkeleton = styled.div<ParagraphSkeletonProps>`\n margin: 0.25rem 0;\n`;\n\nStyledParagraphSkeleton.defaultProps = defaultThemeProp;\n\nconst ParagraphSkeleton: FunctionComponent<ParagraphSkeletonProps & ForwardProps> = (\n props: ParagraphSkeletonProps\n) => {\n return (\n <StyledParagraphSkeleton {...props} aria-disabled='true'>\n {props.children}\n </StyledParagraphSkeleton>\n );\n};\n\nParagraphSkeleton.defaultProps = defaultProps;\n\nexport default ParagraphSkeleton;\n"]}
1
+ {"version":3,"file":"ParagraphSkeleton.js","sourceRoot":"","sources":["../../../src/components/Skeleton/ParagraphSkeleton.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAGvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAO/C,MAAM,YAAY,GAAoC,EAAE,CAAC;AAEzD,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAwB;;CAEjE,CAAC;AAEF,uBAAuB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAExD,MAAM,iBAAiB,GAA6D,CAClF,KAA6B,EAC7B,EAAE;IACF,OAAO,CACL,KAAC,uBAAuB,OAAK,KAAK,mBAAgB,MAAM,YACrD,KAAK,CAAC,QAAQ,WACS,CAC3B,CAAC;AACJ,CAAC,CAAC;AAEF,iBAAiB,CAAC,YAAY,GAAG,YAAY,CAAC;AAE9C,eAAe,iBAAiB,CAAC","sourcesContent":["import { FunctionComponent, ReactNode } from 'react';\nimport styled from 'styled-components';\n\nimport { BaseProps, ForwardProps } from '../../types';\nimport { defaultThemeProp } from '../../theme';\n\nexport interface ParagraphSkeletonProps extends BaseProps {\n /** Children for the skeleton. These should be Line and Rectangle Skeletons. */\n children: ReactNode;\n}\n\nconst defaultProps: Partial<ParagraphSkeletonProps> = {};\n\nconst StyledParagraphSkeleton = styled.div<ParagraphSkeletonProps>`\n margin: 0.25rem 0;\n`;\n\nStyledParagraphSkeleton.defaultProps = defaultThemeProp;\n\nconst ParagraphSkeleton: FunctionComponent<ParagraphSkeletonProps & ForwardProps> = (\n props: ParagraphSkeletonProps\n) => {\n return (\n <StyledParagraphSkeleton {...props} aria-disabled='true'>\n {props.children}\n </StyledParagraphSkeleton>\n );\n};\n\nParagraphSkeleton.defaultProps = defaultProps;\n\nexport default ParagraphSkeleton;\n"]}
@@ -23,7 +23,7 @@ export const StyledRectangleSkeleton = styled.div(props => {
23
23
  });
24
24
  StyledRectangleSkeleton.defaultProps = defaultThemeProp;
25
25
  const RectangleSkeleton = (props) => {
26
- return _jsx(StyledRectangleSkeleton, Object.assign({}, props, { "aria-disabled": 'true' }), void 0);
26
+ return _jsx(StyledRectangleSkeleton, { ...props, "aria-disabled": 'true' }, void 0);
27
27
  };
28
28
  RectangleSkeleton.defaultProps = defaultProps;
29
29
  export default RectangleSkeleton;