@pega/cosmos-react-core 2.0.0-dev.12.1 → 2.0.0-dev.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (260) hide show
  1. package/README.md +3 -3
  2. package/lib/components/Actions/Actions.js +1 -1
  3. package/lib/components/Actions/Actions.js.map +1 -1
  4. package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
  5. package/lib/components/AppShell/AppHeader.js +1 -2
  6. package/lib/components/AppShell/AppHeader.js.map +1 -1
  7. package/lib/components/AppShell/AppShell.d.ts.map +1 -1
  8. package/lib/components/AppShell/AppShell.js +16 -6
  9. package/lib/components/AppShell/AppShell.js.map +1 -1
  10. package/lib/components/AppShell/AppShell.styles.d.ts +3 -3
  11. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  12. package/lib/components/AppShell/AppShell.styles.js +32 -43
  13. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  14. package/lib/components/AppShell/AppShell.types.d.ts +1 -1
  15. package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
  16. package/lib/components/AppShell/AppShell.types.js.map +1 -1
  17. package/lib/components/AppShell/AppShellList.d.ts.map +1 -1
  18. package/lib/components/AppShell/AppShellList.js +4 -4
  19. package/lib/components/AppShell/AppShellList.js.map +1 -1
  20. package/lib/components/AppShell/Drawer.js +1 -1
  21. package/lib/components/AppShell/Drawer.js.map +1 -1
  22. package/lib/components/Avatar/Avatar.d.ts.map +1 -1
  23. package/lib/components/Avatar/Avatar.js +3 -2
  24. package/lib/components/Avatar/Avatar.js.map +1 -1
  25. package/lib/components/Backdrop/Backdrop.d.ts +1 -1
  26. package/lib/components/Backdrop/Backdrop.d.ts.map +1 -1
  27. package/lib/components/Backdrop/Backdrop.js +1 -0
  28. package/lib/components/Backdrop/Backdrop.js.map +1 -1
  29. package/lib/components/Button/Button.d.ts +5 -0
  30. package/lib/components/Button/Button.d.ts.map +1 -1
  31. package/lib/components/Button/Button.js +16 -7
  32. package/lib/components/Button/Button.js.map +1 -1
  33. package/lib/components/Card/Card.d.ts.map +1 -1
  34. package/lib/components/Card/Card.js +2 -1
  35. package/lib/components/Card/Card.js.map +1 -1
  36. package/lib/components/Card/CardContent.d.ts.map +1 -1
  37. package/lib/components/Card/CardContent.js +4 -3
  38. package/lib/components/Card/CardContent.js.map +1 -1
  39. package/lib/components/Card/CardFooter.d.ts.map +1 -1
  40. package/lib/components/Card/CardFooter.js +3 -2
  41. package/lib/components/Card/CardFooter.js.map +1 -1
  42. package/lib/components/Card/CardHeader.d.ts +3 -1
  43. package/lib/components/Card/CardHeader.d.ts.map +1 -1
  44. package/lib/components/Card/CardHeader.js +9 -6
  45. package/lib/components/Card/CardHeader.js.map +1 -1
  46. package/lib/components/ComboBox/ComboBox.d.ts +1 -1
  47. package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
  48. package/lib/components/ComboBox/ComboBox.js +2 -1
  49. package/lib/components/ComboBox/ComboBox.js.map +1 -1
  50. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts.map +1 -1
  51. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +1 -0
  52. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
  53. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.d.ts.map +1 -1
  54. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js +1 -0
  55. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js.map +1 -1
  56. package/lib/components/Configuration/Configuration.js +1 -1
  57. package/lib/components/Configuration/Configuration.js.map +1 -1
  58. package/lib/components/DateTime/Input/DateTime.styles.js +1 -1
  59. package/lib/components/DateTime/Input/DateTime.styles.js.map +1 -1
  60. package/lib/components/DateTime/Input/DateTimeInput.js +1 -1
  61. package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
  62. package/lib/components/DateTime/Input/DayOfWeekInput.d.ts.map +1 -1
  63. package/lib/components/DateTime/Input/DayOfWeekInput.js +4 -1
  64. package/lib/components/DateTime/Input/DayOfWeekInput.js.map +1 -1
  65. package/lib/components/DateTime/Input/QuarterInput.d.ts +9 -0
  66. package/lib/components/DateTime/Input/QuarterInput.d.ts.map +1 -0
  67. package/lib/components/DateTime/Input/QuarterInput.js +102 -0
  68. package/lib/components/DateTime/Input/QuarterInput.js.map +1 -0
  69. package/lib/components/DateTime/Input/utils.d.ts +5 -3
  70. package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
  71. package/lib/components/DateTime/Input/utils.js +14 -5
  72. package/lib/components/DateTime/Input/utils.js.map +1 -1
  73. package/lib/components/DateTime/Picker/Calendar.d.ts.map +1 -1
  74. package/lib/components/DateTime/Picker/Calendar.js +5 -1
  75. package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
  76. package/lib/components/DateTime/Picker/Calendar.styles.d.ts +2 -2
  77. package/lib/components/DateTime/Picker/Calendar.styles.d.ts.map +1 -1
  78. package/lib/components/DateTime/Picker/Calendar.styles.js +2 -2
  79. package/lib/components/DateTime/Picker/Calendar.styles.js.map +1 -1
  80. package/lib/components/DateTime/Picker/DatePicker.js +1 -1
  81. package/lib/components/DateTime/Picker/DatePicker.js.map +1 -1
  82. package/lib/components/DateTime/index.d.ts +2 -0
  83. package/lib/components/DateTime/index.d.ts.map +1 -1
  84. package/lib/components/DateTime/index.js +1 -0
  85. package/lib/components/DateTime/index.js.map +1 -1
  86. package/lib/components/EmptyState/EmptyState.d.ts +14 -0
  87. package/lib/components/EmptyState/EmptyState.d.ts.map +1 -0
  88. package/lib/components/{NoItems/NoItems.js → EmptyState/EmptyState.js} +6 -6
  89. package/lib/components/EmptyState/EmptyState.js.map +1 -0
  90. package/lib/components/EmptyState/index.d.ts +4 -0
  91. package/lib/components/EmptyState/index.d.ts.map +1 -0
  92. package/lib/components/EmptyState/index.js +3 -0
  93. package/lib/components/EmptyState/index.js.map +1 -0
  94. package/lib/components/File/FileDisplay.d.ts +4 -1
  95. package/lib/components/File/FileDisplay.d.ts.map +1 -1
  96. package/lib/components/File/FileDisplay.js.map +1 -1
  97. package/lib/components/File/FileInput.d.ts +1 -1
  98. package/lib/components/File/FileInput.d.ts.map +1 -1
  99. package/lib/components/Flex/Flex.d.ts +2 -2
  100. package/lib/components/Flex/Flex.d.ts.map +1 -1
  101. package/lib/components/Flex/Flex.js.map +1 -1
  102. package/lib/components/FormControl/FormControl.d.ts +1 -1
  103. package/lib/components/FormControl/FormControl.d.ts.map +1 -1
  104. package/lib/components/Grid/Grid.d.ts +1 -1
  105. package/lib/components/Grid/Grid.d.ts.map +1 -1
  106. package/lib/components/Input/Input.styles.js +2 -2
  107. package/lib/components/Input/Input.styles.js.map +1 -1
  108. package/lib/components/Menu/FlyoutMenuList.d.ts.map +1 -1
  109. package/lib/components/Menu/FlyoutMenuList.js +6 -4
  110. package/lib/components/Menu/FlyoutMenuList.js.map +1 -1
  111. package/lib/components/Menu/Menu.styles.d.ts +10 -0
  112. package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
  113. package/lib/components/Menu/Menu.styles.js +198 -3
  114. package/lib/components/Menu/Menu.styles.js.map +1 -1
  115. package/lib/components/Menu/Menu.types.d.ts +17 -8
  116. package/lib/components/Menu/Menu.types.d.ts.map +1 -1
  117. package/lib/components/Menu/Menu.types.js.map +1 -1
  118. package/lib/components/Menu/MenuGroup.d.ts +6 -0
  119. package/lib/components/Menu/MenuGroup.d.ts.map +1 -0
  120. package/lib/components/Menu/MenuGroup.js +17 -0
  121. package/lib/components/Menu/MenuGroup.js.map +1 -0
  122. package/lib/components/Menu/MenuItem.d.ts +0 -3
  123. package/lib/components/Menu/MenuItem.d.ts.map +1 -1
  124. package/lib/components/Menu/MenuItem.js +9 -116
  125. package/lib/components/Menu/MenuItem.js.map +1 -1
  126. package/lib/components/Menu/MenuList.d.ts.map +1 -1
  127. package/lib/components/Menu/MenuList.js +8 -7
  128. package/lib/components/Menu/MenuList.js.map +1 -1
  129. package/lib/components/Menu/MenuListHeader.d.ts +0 -1
  130. package/lib/components/Menu/MenuListHeader.d.ts.map +1 -1
  131. package/lib/components/Menu/MenuListHeader.js +4 -54
  132. package/lib/components/Menu/MenuListHeader.js.map +1 -1
  133. package/lib/components/Menu/helpers.d.ts +13 -12
  134. package/lib/components/Menu/helpers.d.ts.map +1 -1
  135. package/lib/components/Menu/helpers.js +32 -22
  136. package/lib/components/Menu/helpers.js.map +1 -1
  137. package/lib/components/Menu/index.d.ts +2 -3
  138. package/lib/components/Menu/index.d.ts.map +1 -1
  139. package/lib/components/Menu/index.js +1 -2
  140. package/lib/components/Menu/index.js.map +1 -1
  141. package/lib/components/Modal/Modal.d.ts +1 -6
  142. package/lib/components/Modal/Modal.d.ts.map +1 -1
  143. package/lib/components/Modal/Modal.js +23 -111
  144. package/lib/components/Modal/Modal.js.map +1 -1
  145. package/lib/components/Modal/Modal.styles.d.ts +9 -0
  146. package/lib/components/Modal/Modal.styles.d.ts.map +1 -0
  147. package/lib/components/Modal/Modal.styles.js +133 -0
  148. package/lib/components/Modal/Modal.styles.js.map +1 -0
  149. package/lib/components/Modal/Modal.types.d.ts +19 -4
  150. package/lib/components/Modal/Modal.types.d.ts.map +1 -1
  151. package/lib/components/Modal/Modal.types.js.map +1 -1
  152. package/lib/components/Modal/ModalManager.js +1 -1
  153. package/lib/components/Modal/ModalManager.js.map +1 -1
  154. package/lib/components/MultiStep/MultiStep.js +1 -1
  155. package/lib/components/MultiStep/MultiStep.js.map +1 -1
  156. package/lib/components/MultiStep/MultiStep.styles.js +1 -1
  157. package/lib/components/MultiStep/MultiStep.styles.js.map +1 -1
  158. package/lib/components/MultiStep/MultiStep.types.d.ts +2 -0
  159. package/lib/components/MultiStep/MultiStep.types.d.ts.map +1 -1
  160. package/lib/components/MultiStep/MultiStep.types.js.map +1 -1
  161. package/lib/components/Number/NumberInput.styles.d.ts +2 -2
  162. package/lib/components/Number/NumberInput.styles.d.ts.map +1 -1
  163. package/lib/components/PageTemplates/CategorySubPage.d.ts +1 -1
  164. package/lib/components/PageTemplates/CategorySubPage.d.ts.map +1 -1
  165. package/lib/components/PageTemplates/CategorySubPage.js.map +1 -1
  166. package/lib/components/PageTemplates/PageTemplates.d.ts +2 -0
  167. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  168. package/lib/components/PageTemplates/PageTemplates.js +19 -22
  169. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  170. package/lib/components/Popover/Popover.d.ts +0 -4
  171. package/lib/components/Popover/Popover.d.ts.map +1 -1
  172. package/lib/components/Popover/Popover.js +1 -115
  173. package/lib/components/Popover/Popover.js.map +1 -1
  174. package/lib/components/Popover/Popover.styles.d.ts +5 -0
  175. package/lib/components/Popover/Popover.styles.d.ts.map +1 -0
  176. package/lib/components/Popover/Popover.styles.js +116 -0
  177. package/lib/components/Popover/Popover.styles.js.map +1 -0
  178. package/lib/components/Popover/index.d.ts +1 -1
  179. package/lib/components/Popover/index.d.ts.map +1 -1
  180. package/lib/components/Popover/index.js +1 -1
  181. package/lib/components/Popover/index.js.map +1 -1
  182. package/lib/components/Progress/Bar.js +1 -1
  183. package/lib/components/Progress/Bar.js.map +1 -1
  184. package/lib/components/Progress/Ring.js +1 -1
  185. package/lib/components/Progress/Ring.js.map +1 -1
  186. package/lib/components/RadioCheck/RadioCheck.js +3 -3
  187. package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
  188. package/lib/components/RadioCheckGroup/RadioCheckGroup.js +2 -2
  189. package/lib/components/RadioCheckGroup/RadioCheckGroup.js.map +1 -1
  190. package/lib/components/Rating/Rating.js +1 -1
  191. package/lib/components/Rating/Rating.js.map +1 -1
  192. package/lib/components/SearchInput/SearchInput.js +7 -7
  193. package/lib/components/SearchInput/SearchInput.js.map +1 -1
  194. package/lib/components/Select/Select.js +2 -2
  195. package/lib/components/Select/Select.js.map +1 -1
  196. package/lib/components/Slider/Slider.styles.d.ts +1 -1
  197. package/lib/components/Slider/Slider.styles.js +1 -1
  198. package/lib/components/Slider/Slider.styles.js.map +1 -1
  199. package/lib/components/SummaryList/SummaryList.d.ts +8 -2
  200. package/lib/components/SummaryList/SummaryList.d.ts.map +1 -1
  201. package/lib/components/SummaryList/SummaryList.js +9 -5
  202. package/lib/components/SummaryList/SummaryList.js.map +1 -1
  203. package/lib/components/SummaryList/ViewAll.d.ts +1 -1
  204. package/lib/components/SummaryList/ViewAll.d.ts.map +1 -1
  205. package/lib/components/SummaryList/ViewAll.js +7 -6
  206. package/lib/components/SummaryList/ViewAll.js.map +1 -1
  207. package/lib/components/Switch/Switch.d.ts.map +1 -1
  208. package/lib/components/Switch/Switch.js +39 -29
  209. package/lib/components/Switch/Switch.js.map +1 -1
  210. package/lib/components/Table/Table.js +2 -2
  211. package/lib/components/Table/Table.js.map +1 -1
  212. package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
  213. package/lib/components/Tabs/TabPanel.js +7 -1
  214. package/lib/components/Tabs/TabPanel.js.map +1 -1
  215. package/lib/components/Tabs/Tabs.d.ts.map +1 -1
  216. package/lib/components/Tabs/Tabs.js +2 -2
  217. package/lib/components/Tabs/Tabs.js.map +1 -1
  218. package/lib/components/Text/Text.d.ts +1 -1
  219. package/lib/components/Text/Text.d.ts.map +1 -1
  220. package/lib/components/Tree/StandardTree.styles.js +1 -1
  221. package/lib/components/Tree/StandardTree.styles.js.map +1 -1
  222. package/lib/hooks/index.d.ts +1 -0
  223. package/lib/hooks/index.d.ts.map +1 -1
  224. package/lib/hooks/index.js +1 -0
  225. package/lib/hooks/index.js.map +1 -1
  226. package/lib/hooks/useDraggable.d.ts +8 -0
  227. package/lib/hooks/useDraggable.d.ts.map +1 -0
  228. package/lib/hooks/useDraggable.js +64 -0
  229. package/lib/hooks/useDraggable.js.map +1 -0
  230. package/lib/hooks/useI18n.d.ts +22 -0
  231. package/lib/hooks/useI18n.d.ts.map +1 -1
  232. package/lib/i18n/default.json +23 -1
  233. package/lib/i18n/i18n.d.ts +44 -0
  234. package/lib/i18n/i18n.d.ts.map +1 -1
  235. package/lib/index.d.ts +2 -2
  236. package/lib/index.d.ts.map +1 -1
  237. package/lib/index.js +2 -2
  238. package/lib/index.js.map +1 -1
  239. package/lib/styles/GlobalStyle.d.ts.map +1 -1
  240. package/lib/styles/GlobalStyle.js +2 -26
  241. package/lib/styles/GlobalStyle.js.map +1 -1
  242. package/lib/theme/theme.d.ts +41 -11
  243. package/lib/theme/theme.d.ts.map +1 -1
  244. package/lib/theme/themeDefinition.json +50 -30
  245. package/lib/theme/themeOverrides.schema.json +15 -3
  246. package/lib/types/types.d.ts +4 -1
  247. package/lib/types/types.d.ts.map +1 -1
  248. package/lib/types/types.js.map +1 -1
  249. package/lib/utils/utils.d.ts +14 -0
  250. package/lib/utils/utils.d.ts.map +1 -1
  251. package/lib/utils/utils.js +24 -0
  252. package/lib/utils/utils.js.map +1 -1
  253. package/package.json +9 -9
  254. package/lib/components/NoItems/NoItems.d.ts +0 -14
  255. package/lib/components/NoItems/NoItems.d.ts.map +0 -1
  256. package/lib/components/NoItems/NoItems.js.map +0 -1
  257. package/lib/components/NoItems/index.d.ts +0 -4
  258. package/lib/components/NoItems/index.d.ts.map +0 -1
  259. package/lib/components/NoItems/index.js +0 -3
  260. package/lib/components/NoItems/index.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  export { default } from './Popover';
2
2
  export { default as PopoverManager } from './PopoverManager';
3
3
  export { PopoverManagerContext } from './PopoverContext';
4
- export { StyledPopover } from './Popover';
4
+ export { StyledPopover } from './Popover.styles';
5
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Popover/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAGzD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC","sourcesContent":["export { default } from './Popover';\nexport { default as PopoverManager } from './PopoverManager';\nexport { PopoverManagerContext } from './PopoverContext';\nexport { Delay } from './Popover';\nexport { PopoverProps } from './Popover';\nexport { StyledPopover } from './Popover';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Popover/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAGzD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["export { default } from './Popover';\nexport { default as PopoverManager } from './PopoverManager';\nexport { PopoverManagerContext } from './PopoverContext';\nexport { Delay } from './Popover';\nexport { PopoverProps } from './Popover';\nexport { StyledPopover } from './Popover.styles';\n"]}
@@ -5,7 +5,7 @@ import { defaultThemeProp } from '../../theme';
5
5
  export const StyledProgressBar = styled.div(({ theme, placement, determinate }) => {
6
6
  return css `
7
7
  height: 0.375rem;
8
- background-color: ${theme.base.colors.gray.light};
8
+ background-color: ${theme.base.colors.gray['extra-light']};
9
9
  border-radius: ${theme.base['border-radius']};
10
10
  min-width: 2rem;
11
11
  overflow: hidden;
@@ -1 +1 @@
1
- {"version":3,"file":"Bar.js","sourceRoot":"","sources":["../../../src/components/Progress/Bar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,UAAU,EAAkC,MAAM,OAAO,CAAC;AACvE,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAK/C,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CACzC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,EAAE;IACpC,OAAO,GAAG,CAA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,CACL,KAAC,iBAAiB,kBAChB,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,aAAa,mBACH,QAAQ,mBACR,QAAQ,mBACR,KAAK,EACpB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,OAAO,KAAK,KAAK,QAAQ,EACtC,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,GAAG,CAAC,CAAC,CAAC,EAAE,EAAmB,IAClF,SAAS,UACb,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,GAAG,CAAC","sourcesContent":["import { FC, forwardRef, PropsWithoutRef, CSSProperties } 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 StyledProgressBar = styled.div<ProgressProps & { determinate: boolean }>(\n ({ theme, placement, determinate }) => {\n return css`\n height: 0.375rem;\n background-color: ${theme.base.colors.gray.light};\n border-radius: ${theme.base['border-radius']};\n min-width: 2rem;\n overflow: hidden;\n\n @keyframes LoadingBar {\n 0% {\n transform: translateX(-100%);\n }\n\n 100% {\n transform: translateX(200%);\n }\n }\n\n ::before {\n content: '';\n display: block;\n height: 100%;\n width: 100%;\n left: 0;\n border-radius: ${theme.base['border-radius']};\n background-color: ${theme.components.progress['progress-color']};\n ${determinate &&\n css`\n transform: translateX(var(--progress, 0));\n transform-origin: 0 50%;\n transition: transform calc(0.5 * ${theme.base.animation.speed})\n ${theme.base.animation.timing.ease};\n `}\n\n ${!determinate &&\n css`\n animation: LoadingBar calc(8 * ${theme.base.animation.speed}) linear infinite;\n width: 50%;\n `}\n }\n\n ${placement === 'inline'\n ? css`\n display: inline-block;\n position: relative;\n `\n : css`\n width: 50%;\n `}\n `;\n }\n);\n\nStyledProgressBar.defaultProps = defaultThemeProp;\n\nconst Bar: FC<ProgressProps & ForwardProps> = forwardRef(\n (\n {\n value,\n minValue = 0,\n maxValue = 100,\n message,\n placement,\n style,\n ...restProps\n }: PropsWithoutRef<ProgressProps & { style?: CSSProperties }>,\n ref: ProgressProps['ref']\n ) => {\n let percentage = value;\n\n if (typeof value === 'number') {\n if (value > maxValue || minValue > maxValue) percentage = 0;\n else if (value < minValue) percentage = 100;\n else percentage = (1 - (value - minValue) / (maxValue - minValue)) * -100;\n }\n\n return (\n <StyledProgressBar\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 style={{ ...style, '--progress': percentage ? `${percentage}%` : '' } as CSSProperties}\n {...restProps}\n />\n );\n }\n);\n\nexport default Bar;\n"]}
1
+ {"version":3,"file":"Bar.js","sourceRoot":"","sources":["../../../src/components/Progress/Bar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,UAAU,EAAkC,MAAM,OAAO,CAAC;AACvE,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAK/C,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CACzC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,EAAE;IACpC,OAAO,GAAG,CAAA;;0BAEY,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;uBACxC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;;;;;;;;;;;;;;;;;;;;yBAoBzB,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;4BACxB,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC;UAC7D,WAAW;QACb,GAAG,CAAA;;;6CAGkC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK;cACzD,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI;SACrC;;UAEC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forwardRef, PropsWithoutRef, CSSProperties } 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 StyledProgressBar = styled.div<ProgressProps & { determinate: boolean }>(\n ({ theme, placement, determinate }) => {\n return css`\n height: 0.375rem;\n background-color: ${theme.base.colors.gray['extra-light']};\n border-radius: ${theme.base['border-radius']};\n min-width: 2rem;\n overflow: hidden;\n\n @keyframes LoadingBar {\n 0% {\n transform: translateX(-100%);\n }\n\n 100% {\n transform: translateX(200%);\n }\n }\n\n ::before {\n content: '';\n display: block;\n height: 100%;\n width: 100%;\n left: 0;\n border-radius: ${theme.base['border-radius']};\n background-color: ${theme.components.progress['progress-color']};\n ${determinate &&\n css`\n transform: translateX(var(--progress, 0));\n transform-origin: 0 50%;\n transition: transform calc(0.5 * ${theme.base.animation.speed})\n ${theme.base.animation.timing.ease};\n `}\n\n ${!determinate &&\n css`\n animation: LoadingBar calc(8 * ${theme.base.animation.speed}) linear infinite;\n width: 50%;\n `}\n }\n\n ${placement === 'inline'\n ? css`\n display: inline-block;\n position: relative;\n `\n : css`\n width: 50%;\n `}\n `;\n }\n);\n\nStyledProgressBar.defaultProps = defaultThemeProp;\n\nconst Bar: FC<ProgressProps & ForwardProps> = forwardRef(\n (\n {\n value,\n minValue = 0,\n maxValue = 100,\n message,\n placement,\n style,\n ...restProps\n }: PropsWithoutRef<ProgressProps & { style?: CSSProperties }>,\n ref: ProgressProps['ref']\n ) => {\n let percentage = value;\n\n if (typeof value === 'number') {\n if (value > maxValue || minValue > maxValue) percentage = 0;\n else if (value < minValue) percentage = 100;\n else percentage = (1 - (value - minValue) / (maxValue - minValue)) * -100;\n }\n\n return (\n <StyledProgressBar\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 style={{ ...style, '--progress': percentage ? `${percentage}%` : '' } as CSSProperties}\n {...restProps}\n />\n );\n }\n);\n\nexport default Bar;\n"]}
@@ -25,7 +25,7 @@ export const StyledProgressRing = styled.div(({ theme, placement, determinate })
25
25
 
26
26
  circle {
27
27
  fill: transparent;
28
- stroke: ${theme.base.colors.gray.light};
28
+ stroke: ${theme.base.colors.gray['extra-light']};
29
29
  stroke-width: 2;
30
30
  r: 45%;
31
31
  cx: 50%;
@@ -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,KAAK;;;;;;;;;sBAS1B,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,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\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.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,kBACjB,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,aAAa,mBACH,QAAQ,mBACR,QAAQ,mBACR,KAAK,EACpB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,OAAO,KAAK,KAAK,QAAQ,IAClC,SAAS,cAEb,6BAAK,OAAO,EAAC,WAAW,iBACtB,0BAAU,EACV,iBAAQ,eAAe,EAAE,aAAa,EAAE,KAAK,EAAE,EAAE,gBAAgB,EAAE,WAAI,aACnE,YACa,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"]}
@@ -127,10 +127,10 @@ export const StyledRadioCheck = styled.div(props => {
127
127
  font-size: ${fontSize.s};
128
128
  color: ${labelColor};
129
129
  margin: 0;
130
- min-height: ${base.sizes['touch-mouse']};
130
+ min-height: ${base['hit-area']['mouse-min']};
131
131
 
132
132
  @media (pointer: coarse) {
133
- min-height: ${base.sizes['touch-finger']};
133
+ min-height: ${base['hit-area']['finger-min']};
134
134
  }
135
135
  }
136
136
 
@@ -152,7 +152,7 @@ export const StyledRadioCheckCard = styled.label(({ disabled, readOnly, status,
152
152
  background-color: ${card.background};
153
153
  border-radius: ${card['border-radius']};
154
154
  border: 0.0625rem solid ${useBorderColor};
155
- padding: calc(1.5 * ${spacing});
155
+ padding: ${spacing};
156
156
 
157
157
  ${disabled &&
158
158
  css `
@@ -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,CAAC,GAAG,CAC9C,K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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.sizes['touch-mouse']};\n\n @media (pointer: coarse) {\n min-height: ${base.sizes['touch-finger']};\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: calc(1.5 * ${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 >\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,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAAoB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AAE,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,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 >\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"]}
@@ -55,8 +55,8 @@ const RadioCheckGroup = forwardRef((props, ref) => {
55
55
  disabled,
56
56
  ...restProps
57
57
  }, { children: _jsx(Grid, Object.assign({ ref: setOptionsEl, container: {
58
- colGap: 2,
59
- rowGap: variant === 'card' ? 2 : 0,
58
+ colGap: 1,
59
+ rowGap: variant === 'card' ? 1 : 0,
60
60
  cols: renderInline ? 'repeat(auto-fit, minmax(1ch, max-content))' : '1fr'
61
61
  } }, { children: Children.map(children, child => cloneElement(child, {
62
62
  name,
@@ -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;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,QAAQ,EAAE,KAAK;CAChB,CAAC;AAEF,MAAM,qBAAqB,GAAG,MAAM,CAAC,QAAQ,CAAA;;QAErC,eAAe;;;;CAItB,CAAC;AAEF,MAAM,eAAe,GAA4C,UAAU,CACzE,CAAC,KAA4C,EAAE,GAAgC,EAAE,EAAE;IACjF,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IACrB,MAAM,EACJ,QAAQ,EACR,IAAI,GAAG,GAAG,EACV,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,MAAM,GAAG,KAAK,EACd,SAAS,GAAG,IAAI,EAChB,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J,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: 2,\n rowGap: variant === 'card' ? 2 : 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,QAAQ,EAAE,KAAK;CAChB,CAAC;AAEF,MAAM,qBAAqB,GAAG,MAAM,CAAC,QAAQ,CAAA;;QAErC,eAAe;;;;CAItB,CAAC;AAEF,MAAM,eAAe,GAA4C,UAAU,CACzE,CAAC,KAA4C,EAAE,GAAgC,EAAE,EAAE;IACjF,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IACrB,MAAM,EACJ,QAAQ,EACR,IAAI,GAAG,GAAG,EACV,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,MAAM,GAAG,KAAK,EACd,SAAS,GAAG,IAAI,EAChB,OAAO,GAAG,QAAQ,EAClB,GAAG,SAAS,EACb,GAAG,KAAK,CAAC;IAEV,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,UAAU,EAAkB,CAAC;IAC/D,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC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import 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"]}
@@ -64,7 +64,7 @@ const Rating = (props) => {
64
64
  }
65
65
  starsOutline.push(_jsx(RatingItem, { fill: fillValue }, `star-${i}`));
66
66
  }
67
- return (_jsxs(StyledRating, Object.assign({ "aria-label": ariaLabel, title: ariaLabel, tabIndex: tabIndex }, restProps, { children: [_jsx(StyledRatingItemsContainer, { children: starsOutline }, void 0), metaInfo && _jsxs(StyledRatingMetaInfo, { children: ["(", metaInfo, ")"] }, void 0), ' '] }), void 0));
67
+ 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));
68
68
  };
69
69
  Rating.defaultProps = defaultProps;
70
70
  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,MAAM,SAAS,CAAC;AA0B3B,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,MA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C,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 from '../Icon';\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} title={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,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AAC,IAAI,CAAC,EAAE;QACtC,IAAI,SAAS,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACnC,IAAI,cAAc,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YAC5C,SAAS,GAAG,KAAK,GAAG,IAAI,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 from '../Icon';\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"]}
@@ -16,8 +16,8 @@ export const StyledSearchIcon = styled.div(props => {
16
16
  z-index: 1;
17
17
  inset-inline-start: 0.0625rem;
18
18
  top: 0.0625rem;
19
- width: calc(${base.sizes['touch-mouse']} - 0.125rem);
20
- height: calc(${base.sizes['touch-mouse']} - 0.125rem);
19
+ width: calc(${base['hit-area']['mouse-min']} - 0.125rem);
20
+ height: calc(${base['hit-area']['mouse-min']} - 0.125rem);
21
21
  border-radius: calc(${base['border-radius']} * ${searchInput['border-radius']});
22
22
  padding: 0;
23
23
  background: ${formControl['background-color']};
@@ -33,11 +33,11 @@ export const StyledSearchTextInput = styled(Input)(props => {
33
33
  return css `
34
34
  position: relative;
35
35
  width: 100%;
36
- height: ${theme.base.sizes['touch-mouse']};
37
- min-height: ${theme.base.sizes['touch-mouse']};
36
+ height: ${theme.base['hit-area']['mouse-min']};
37
+ min-height: ${theme.base['hit-area']['mouse-min']};
38
38
  padding-inline-start: 0;
39
- padding-inline-end: calc(${theme.base.sizes['touch-mouse']} - 0.125rem);
40
- text-indent: calc(${theme.base.sizes['touch-mouse']} - 0.125rem);
39
+ padding-inline-end: calc(${theme.base['hit-area']['mouse-min']} - 0.125rem);
40
+ text-indent: calc(${theme.base['hit-area']['mouse-min']} - 0.125rem);
41
41
  border-radius: calc(${comp['border-radius']} * ${theme.base['border-radius']});
42
42
  &::-ms-clear {
43
43
  display: none;
@@ -59,7 +59,7 @@ export const StyledSearchInput = styled.div(({ theme: { base, components } }) =>
59
59
  const iconColor = tryCatch(() => transparentize(0.3, base.palette['foreground-color']));
60
60
  return css `
61
61
  position: relative;
62
- height: ${base.sizes['touch-mouse']};
62
+ height: ${base['hit-area']['mouse-min']};
63
63
  border-radius: calc(${components['search-input']['border-radius']} * ${base['border-radius']});
64
64
 
65
65
  &:focus-within {
@@ -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,MAAM,SAAS,CAAC;AAE3B,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;AA4BvC,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;IACjD,MAAM,EACJ,KAAK,EAAE,EACL,IAAI,EACJ,UAAU,EAAE,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,EACzE,EACF,GAAG,KAAK,CAAC;IACV,MAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;IACzF,OAAO,GAAG,CAAA;;;;;kBAKM,IAAI,CAAC,KAAK,CAAC,a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,EAAE;QACrC,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,EAAE;YACrB,QAAQ,EAAE,CAAC;SACZ;IACH,CAAC,EACD,CAAC,gBAAgB,CAAC,CACnB,CAAC;IAEF,qBAAqB,CAAC,GAAG,EAAE;QACzB,IAAI,cAAc;YAAE,cAAc,CAAC,gBAAgB,CAAC,CAAC;IACvD,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAEvB,OAAO,CACL,MAAC,IAAI,kBAAC,SAAS,QAAC,EAAE,EAAE,iBAAiB,iBACnC,KAAC,qBAAqB,kBACpB,GAAG,EAAE,QAAQ,EACb,IAAI,EAAC,QAAQ,gBACD,oBAAoB,EAChC,WAAW,EAAE,WAAW,IACpB,SAAS,IACb,KAAK,EAAE,gBAAgB,EACvB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,YACpB,EACF,KAAC,IAAI,kBACH,EAAE,EAAE,gBAAgB,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,gBAED,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 from '../Icon';\nimport { FormControlProps } from '../FormControl';\nimport { useAfterInitialEffect, useConsolidatedRef, useI18n } from '../../hooks';\nimport Flex from '../Flex';\nimport { tryCatch } from '../../utils';\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.sizes['touch-mouse']} - 0.125rem);\n height: calc(${base.sizes['touch-mouse']} - 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.sizes['touch-mouse']};\n min-height: ${theme.base.sizes['touch-mouse']};\n padding-inline-start: 0;\n padding-inline-end: calc(${theme.base.sizes['touch-mouse']} - 0.125rem);\n text-indent: calc(${theme.base.sizes['touch-mouse']} - 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.sizes['touch-mouse']};\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,MAAM,SAAS,CAAC;AAE3B,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;AA4BvC,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;IACjD,MAAM,EACJ,KAAK,EAAE,EACL,IAAI,EACJ,UAAU,EAAE,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,EACzE,EACF,GAAG,KAAK,CAAC;IACV,MAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;IACzF,OAAO,GAAG,CAAA;;;;;kBAKM,IAAI,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC;mBAC5B,IAAI,CAAC,UA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,EAAE,EAAE;QACrC,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,EAAE;YACrB,QAAQ,EAAE,CAAC;SACZ;IACH,CAAC,EACD,CAAC,gBAAgB,CAAC,CACnB,CAAC;IAEF,qBAAqB,CAAC,GAAG,EAAE;QACzB,IAAI,cAAc;YAAE,cAAc,CAAC,gBAAgB,CAAC,CAAC;IACvD,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAEvB,OAAO,CACL,MAAC,IAAI,kBAAC,SAAS,QAAC,EAAE,EAAE,iBAAiB,iBACnC,KAAC,qBAAqB,kBACpB,GAAG,EAAE,QAAQ,EACb,IAAI,EAAC,QAAQ,gBACD,oBAAoB,EAChC,WAAW,EAAE,WAAW,IACpB,SAAS,IACb,KAAK,EAAE,gBAAgB,EACvB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,YACpB,EACF,KAAC,IAAI,kBACH,EAAE,EAAE,gBAAgB,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,gBAED,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 from '../Icon';\nimport { FormControlProps } from '../FormControl';\nimport { useAfterInitialEffect, useConsolidatedRef, useI18n } from '../../hooks';\nimport Flex from '../Flex';\nimport { tryCatch } from '../../utils';\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"]}
@@ -16,7 +16,7 @@ export const StyledSelect = styled.select(props => {
16
16
  text-overflow: ellipsis;
17
17
  width: 100%;
18
18
  height: ${select.height};
19
- min-height: ${base.sizes['touch-mouse']};
19
+ min-height: ${base['hit-area']['mouse-min']};
20
20
  padding-inline-start: ${select.padding};
21
21
  padding-inline-end: calc(4 * ${base.spacing});
22
22
 
@@ -38,7 +38,7 @@ export const StyledSelect = styled.select(props => {
38
38
  }
39
39
 
40
40
  @media (pointer: coarse) {
41
- min-height: ${base.sizes['touch-finger']};
41
+ min-height: ${base['hit-area']['finger-min']};
42
42
  }
43
43
  `;
44
44
  });
@@ -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,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAoB,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAuCnD,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAsB,KAAK,CAAC,EAAE;IACrE,MAAM,EACJ,IAAI,EACJ,UAAU,EAAE,EACV,cAAc,EAAE,EAAE,kBAAkB,EAAE,EAAE,EAAE,EAC1C,MAAM,EACP,EACF,GAAG,KAAK,CAAC,KAAK,CAAC;IAEhB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AQ,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,gBAGd,QAAQ,YACS,CACrB,CAAC;IAEF,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,KAAC,SAAS,oBACJ;QACF,KAAK;QACL,WAAW;QACX,EAAE;QACF,UAAU,EAAE,CAAC,CAAC;QACd,IAAI;QACJ,MAAM;QACN,QAAQ;QACR,QAAQ;QACR,QAAQ;QACR,OAAO;KACR,cAEA,IAAI,YACK,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.sizes['touch-mouse']};\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.sizes['touch-finger']};\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 labelOrder: -1,\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,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAuCnD,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAsB,KAAK,CAAC,EAAE;IACrE,MAAM,EACJ,IAAI,EACJ,UAAU,EAAE,EACV,cAAc,EAAE,EAAE,kBAAkB,EAAE,EAAE,EAAE,EAC1C,MAAM,EACP,EACF,GAAG,KAAK,CAAC,KAAK,CAAC;IAEhB,MAAM,UAAU,GAAG,kBAAkB,CAAC,EAAE,CAAC,CAAC;IAC1C,MAAM,EAAE,GAAG,EAAE,GAAG,YAAY,EAAE,CAA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,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,gBAGd,QAAQ,YACS,CACrB,CAAC;IAEF,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,KAAC,SAAS,oBACJ;QACF,KAAK;QACL,WAAW;QACX,EAAE;QACF,UAAU,EAAE,CAAC,CAAC;QACd,IAAI;QACJ,MAAM;QACN,QAAQ;QACR,QAAQ;QACR,QAAQ;QACR,OAAO;KACR,cAEA,IAAI,YACK,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 labelOrder: -1,\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"]}
@@ -13,7 +13,7 @@ export declare const StyledSlider: import("styled-components").StyledComponent<"
13
13
  orientation: 'vertical' | 'horizontal';
14
14
  status: FormControlProps['status'];
15
15
  }, never>;
16
- export declare const StyledTickItem: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, Omit<import("../Grid").GridProps, never> & Required<Pick<import("../Grid").GridProps, never>> & {
16
+ export declare const StyledTickItem: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("../../types").OmitStrict<import("../Grid").GridProps, never> & Required<Pick<import("../Grid").GridProps, never>> & {
17
17
  lowerBoundaryItem?: boolean | undefined;
18
18
  upperBoundaryItem?: boolean | undefined;
19
19
  orientation: 'horizontal' | 'vertical';
@@ -38,7 +38,7 @@ export const StyledBar = styled.div(({ theme, showProgress }) => {
38
38
  width: 100%;
39
39
  overflow: hidden;
40
40
  position: relative;
41
- background-color: ${colors.gray.medium};
41
+ background-color: ${colors.gray.light};
42
42
 
43
43
  ${showProgress &&
44
44
  css `
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.styles.js","sourceRoot":"","sources":["../../../src/components/Slider/Slider.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAA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;;cAKhB,iBAAiB,SAAS,UAAU;iCACjB,OAAO;wBAChB,OAAO;;;;;;;;;;KAU1B;;;;;;;QAOG,WAAW;;;;QAIX,WAAW;;wBAEK,OAAO,CAAC,aAAa,CAAC;;;8BAGhB,OAAO,CAAC,kBAAkB,CAAC;;;;GAItD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,YAAY,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE7C,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC,CAI7C,CAAC,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,EAAE;IAClE,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;IAEnC,MAAM,EAAE,GAAG,EAAE,GAAG,YAAY,EAAE,CAAC;IAE/B,OAAO,GAAG,CAAA;;;;MAIN,WAAW,KAAK,YAAY;QAC9B,GAAG,CAAA;;;;;;kBAMW,OAAO;;;;;QAKjB,iBAAiB;YACnB,GAAG,CAAA;;;;;;OAMF;;QAEC,iBAAiB;YACnB,GAAG,CAAA;;;;;;OAMF;KACF;;MAEC,WAAW,KAAK,UAAU;QAC5B,GAAG,CAAA;;;;;iBAKU,OAAO;uBACD,OAAO;UACpB,GAAG;YACH,CAAC,CAAC,GAAG,CAAA;;aAEF;YACH,CAAC,CAAC,GAAG,CAAA;;aAEF;;KAER;;;;GAIF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAA;;;;;;;CAO1C,CAAC;AAEF,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import { mix } from 'polished';\nimport styled, { css } from 'styled-components';\n\nimport { useDirection } from '../../hooks';\nimport { defaultThemeProp } from '../../theme';\nimport { PropsWithDefaults } from '../../types';\nimport { tryCatch } from '../../utils';\nimport { FormControlProps } from '../FormControl';\nimport { StyledGrid } from '../Grid';\nimport StyledNumberInput from '../Number/NumberInput.styles';\nimport { StyledText } from '../Text';\n\nimport SliderProps from './Slider.types';\n\nexport type SliderPropsWithDefaults = PropsWithDefaults<SliderProps>;\n\nexport const StyledThumb = styled.div(\n ({\n theme: {\n base: {\n palette: { 'primary-background': bgColor, 'border-line': borderColor },\n spacing,\n 'border-radius': borderRadius\n },\n components: {\n progress: { 'progress-color': fgColor },\n button\n }\n }\n }) => {\n const hoverBgColor = tryCatch(() => mix(0.2, fgColor, bgColor));\n\n return css`\n border: ${button['border-width']} solid ${borderColor};\n border-radius: calc(${borderRadius} * 3);\n outline: none;\n background-color: ${bgColor};\n width: calc(${spacing} * 3);\n height: calc(${spacing} * 3);\n cursor: pointer;\n\n &:focus {\n box-shadow: ${button['focus-shadow']};\n }\n\n &:hover,\n &:active {\n background-color: ${hoverBgColor};\n border-color: ${fgColor};\n }\n `;\n }\n);\n\nStyledThumb.defaultProps = defaultThemeProp;\n\nexport const StyledBar = styled.div<{ showProgress?: boolean }>(({ theme, showProgress }) => {\n const {\n base: { spacing, colors, 'border-radius': borderRadius },\n components: {\n progress: { 'progress-color': progressColor }\n }\n } = theme;\n\n const { ltr } = useDirection();\n\n return css`\n border-radius: ${borderRadius};\n height: ${spacing};\n width: 100%;\n overflow: hidden;\n position: relative;\n background-color: ${colors.gray.medium};\n\n ${showProgress &&\n css`\n ::before {\n position: absolute;\n left: 0;\n top: 0;\n content: '';\n display: block;\n width: 100%;\n height: 100%;\n background-color: ${progressColor};\n ${ltr\n ? css`\n transform: translateX(calc(-100% + var(--slider-value, 0)));\n `\n : css`\n transform: translateX(calc(100% - var(--slider-value, 0)));\n `}\n }\n `}\n `;\n});\n\nStyledBar.defaultProps = defaultThemeProp;\n\nexport const StyledTrack = styled.div(\n ({\n theme: {\n base: { spacing }\n }\n }) => {\n const { ltr } = useDirection();\n return css`\n height: calc(${spacing} * 4);\n width: 100%;\n cursor: pointer;\n position: relative;\n\n > ${StyledThumb} {\n z-index: 1;\n position: absolute;\n top: calc(${spacing} / 2);\n left: var(--slider-value);\n right: var(--slider-value);\n ${ltr\n ? css`\n transform: translate(-50%, 0);\n `\n : css`\n transform: translate(50%, 0);\n `}\n }\n `;\n }\n);\n\nStyledTrack.defaultProps = defaultThemeProp;\n\nexport const StyledTicksContainer = styled.div`\n width: 100%;\n\n div {\n &::before {\n content: '';\n display: table;\n background: ${p => p.theme.base.palette['foreground-color']};\n }\n }\n`;\n\nStyledTicksContainer.defaultProps = defaultThemeProp;\n\nexport const StyledSliderTrackWrapper = styled.div`\n width: 100%;\n`;\n\nStyledSliderTrackWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledSlider = styled.div<{\n orientation: 'vertical' | 'horizontal';\n status: FormControlProps['status'];\n}>(props => {\n const {\n theme: {\n base: { spacing, palette },\n components: { 'form-field': formField }\n },\n status,\n orientation\n } = props;\n\n const statusColor =\n status && formField[status] ? formField[status]['status-color'] : 'transparent';\n const thumbBgColor = tryCatch(() => mix(0.2, statusColor, palette['primary-background']));\n\n const borderColor =\n status && formField[status] ? formField[status]['status-color'] : palette['border-line'];\n\n return css`\n ${StyledText} {\n line-height: calc(${spacing} * 4);\n }\n\n ${status &&\n css`\n ${StyledBar}::before {\n background-color: ${statusColor};\n }\n\n ${StyledThumb} {\n border-color: ${borderColor};\n :hover,\n :active {\n background-color: ${thumbBgColor};\n }\n }\n `}\n\n ${orientation === 'horizontal' &&\n css`\n ${StyledSliderTrackWrapper} {\n ${StyledTrack},\n ${StyledThumb} {\n grid-row: 1;\n }\n\n ${StyledTicksContainer} {\n grid-row: 2;\n }\n\n & + ${StyledNumberInput}, & + ${StyledText} {\n margin-inline-start: calc(2 * ${spacing});\n }\n }\n `}\n\n /* disabling 'duplicate selectors' rule to keep the css rules grouped by orientation prop */\n\n /* stylelint-disable no-duplicate-selectors */\n ${orientation === 'vertical' &&\n css`\n ${StyledSliderTrackWrapper} {\n grid-template-columns: calc(${spacing} * 4) minmax(0, 1fr);\n grid-template-rows: 0.5em [track-start] minmax(calc(${spacing} * 20), max-content) [track-end] 0.5em;\n margin-top: ${spacing};\n\n ${StyledTrack} {\n grid-row: track-start / track-end;\n height: 100%;\n transform: scale(-1);\n\n ${StyledBar} {\n height: 100%;\n width: ${spacing};\n\n ::before {\n transform: translateY(calc(-100% + var(--slider-value, 0)));\n }\n }\n }\n\n ${StyledThumb} {\n grid-row: track-start / track-end;\n top: auto;\n bottom: calc(100% - var(--slider-value));\n left: calc(${spacing} / 2);\n right: calc(${spacing} / 2);\n transform: translate(0, 50%);\n }\n\n ${StyledTicksContainer} {\n grid-row: 1 / -1;\n height: 100%;\n }\n\n & + ${StyledNumberInput}, & + ${StyledText} {\n margin-top: calc(2 * ${spacing});\n width: calc(${spacing} * 4);\n text-align: center;\n\n /* fix NumberInput double padding issue */\n &,\n & > input {\n padding: 0;\n }\n }\n }\n `}\n\n /* stylelint-enable no-duplicate-selectors */\n\n\n &[disabled],\n &[readonly] {\n ${StyledTrack} {\n cursor: default;\n }\n\n ${StyledThumb} {\n cursor: default;\n border-color: ${palette['border-line']};\n :hover,\n :active {\n background-color: ${palette['background-color']};\n }\n }\n }\n `;\n});\n\nStyledSlider.defaultProps = defaultThemeProp;\n\nexport const StyledTickItem = styled(StyledGrid)<{\n lowerBoundaryItem?: boolean;\n upperBoundaryItem?: boolean;\n orientation: 'horizontal' | 'vertical';\n}>(({ lowerBoundaryItem, upperBoundaryItem, orientation, theme }) => {\n const spacing = theme.base.spacing;\n\n const { ltr } = useDirection();\n\n return css`\n /* disabling 'duplicate selectors' rule to keep the css rules grouped by orientation prop */\n\n /* stylelint-disable no-duplicate-selectors */\n ${orientation === 'horizontal' &&\n css`\n text-align: center;\n text-overflow: ellipsis;\n white-space: nowrap;\n &::before {\n width: 0.0625rem;\n height: ${spacing};\n transform: translateY(-50%);\n margin: 0 auto;\n }\n\n ${lowerBoundaryItem &&\n css`\n text-align: start;\n transform: translate(-0.5ch, 0);\n &::before {\n margin-inline-start: 0.5ch;\n }\n `}\n\n ${upperBoundaryItem &&\n css`\n text-align: end;\n transform: translate(0.5ch, 0);\n &::before {\n margin-inline-end: 0.5ch;\n }\n `}\n `}\n\n ${orientation === 'vertical' &&\n css`\n display: flex;\n align-items: center;\n\n &::before {\n width: ${spacing};\n height: calc(${spacing} / 8);\n ${ltr\n ? css`\n transform: translateX(-50%);\n `\n : css`\n transform: translateX(50%);\n `}\n }\n `}\n\n /* stylelint-enable no-duplicate-selectors */\n overflow: hidden;\n `;\n});\n\nStyledTickItem.defaultProps = defaultThemeProp;\n\nexport const StyledTickButton = styled.span`\n cursor: pointer;\n line-height: 1em;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n outline: 0;\n`;\n\nStyledTickButton.defaultProps = defaultThemeProp;\n"]}
1
+ {"version":3,"file":"Slider.styles.js","sourceRoot":"","sources":["../../../src/components/Slider/Slider.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,iBAAiB,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAMrC,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CACnC,CAAC,EACC,KAAK,EAAE,EACL,IAAI,EAAE,EACJ,OAAO,EAAE,EAAE,oBAAoB,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,EACtE,OAAO,EACP,eAAe,EAAE,YAAY,EAC9B,EACD,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;IAE/B,OAAO,GAAG,CAAA;;;;MAIN,WAAW,KAAK,YAAY;QAC9B,GAAG,CAAA;;;;;;kBAMW,OAAO;;;;;QAKjB,iBAAiB;YACnB,GAAG,CAAA;;;;;;OAMF;;QAEC,iBAAiB;YACnB,GAAG,CAAA;;;;;;OAMF;KACF;;MAEC,WAAW,KAAK,UAAU;QAC5B,GAAG,CAAA;;;;;iBAKU,OAAO;uBACD,OAAO;UACpB,GAAG;YACH,CAAC,CAAC,GAAG,CAAA;;aAEF;YACH,CAAC,CAAC,GAAG,CAAA;;aAEF;;KAER;;;;GAIF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAA;;;;;;;CAO1C,CAAC;AAEF,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import { mix } from 'polished';\nimport styled, { css } from 'styled-components';\n\nimport { useDirection } from '../../hooks';\nimport { defaultThemeProp } from '../../theme';\nimport { PropsWithDefaults } from '../../types';\nimport { tryCatch } from '../../utils';\nimport { FormControlProps } from '../FormControl';\nimport { StyledGrid } from '../Grid';\nimport StyledNumberInput from '../Number/NumberInput.styles';\nimport { StyledText } from '../Text';\n\nimport SliderProps from './Slider.types';\n\nexport type SliderPropsWithDefaults = PropsWithDefaults<SliderProps>;\n\nexport const StyledThumb = styled.div(\n ({\n theme: {\n base: {\n palette: { 'primary-background': bgColor, 'border-line': borderColor },\n spacing,\n 'border-radius': borderRadius\n },\n components: {\n progress: { 'progress-color': fgColor },\n button\n }\n }\n }) => {\n const hoverBgColor = tryCatch(() => mix(0.2, fgColor, bgColor));\n\n return css`\n border: ${button['border-width']} solid ${borderColor};\n border-radius: calc(${borderRadius} * 3);\n outline: none;\n background-color: ${bgColor};\n width: calc(${spacing} * 3);\n height: calc(${spacing} * 3);\n cursor: pointer;\n\n &:focus {\n box-shadow: ${button['focus-shadow']};\n }\n\n &:hover,\n &:active {\n background-color: ${hoverBgColor};\n border-color: ${fgColor};\n }\n `;\n }\n);\n\nStyledThumb.defaultProps = defaultThemeProp;\n\nexport const StyledBar = styled.div<{ showProgress?: boolean }>(({ theme, showProgress }) => {\n const {\n base: { spacing, colors, 'border-radius': borderRadius },\n components: {\n progress: { 'progress-color': progressColor }\n }\n } = theme;\n\n const { ltr } = useDirection();\n\n return css`\n border-radius: ${borderRadius};\n height: ${spacing};\n width: 100%;\n overflow: hidden;\n position: relative;\n background-color: ${colors.gray.light};\n\n ${showProgress &&\n css`\n ::before {\n position: absolute;\n left: 0;\n top: 0;\n content: '';\n display: block;\n width: 100%;\n height: 100%;\n background-color: ${progressColor};\n ${ltr\n ? css`\n transform: translateX(calc(-100% + var(--slider-value, 0)));\n `\n : css`\n transform: translateX(calc(100% - var(--slider-value, 0)));\n `}\n }\n `}\n `;\n});\n\nStyledBar.defaultProps = defaultThemeProp;\n\nexport const StyledTrack = styled.div(\n ({\n theme: {\n base: { spacing }\n }\n }) => {\n const { ltr } = useDirection();\n return css`\n height: calc(${spacing} * 4);\n width: 100%;\n cursor: pointer;\n position: relative;\n\n > ${StyledThumb} {\n z-index: 1;\n position: absolute;\n top: calc(${spacing} / 2);\n left: var(--slider-value);\n right: var(--slider-value);\n ${ltr\n ? css`\n transform: translate(-50%, 0);\n `\n : css`\n transform: translate(50%, 0);\n `}\n }\n `;\n }\n);\n\nStyledTrack.defaultProps = defaultThemeProp;\n\nexport const StyledTicksContainer = styled.div`\n width: 100%;\n\n div {\n &::before {\n content: '';\n display: table;\n background: ${p => p.theme.base.palette['foreground-color']};\n }\n }\n`;\n\nStyledTicksContainer.defaultProps = defaultThemeProp;\n\nexport const StyledSliderTrackWrapper = styled.div`\n width: 100%;\n`;\n\nStyledSliderTrackWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledSlider = styled.div<{\n orientation: 'vertical' | 'horizontal';\n status: FormControlProps['status'];\n}>(props => {\n const {\n theme: {\n base: { spacing, palette },\n components: { 'form-field': formField }\n },\n status,\n orientation\n } = props;\n\n const statusColor =\n status && formField[status] ? formField[status]['status-color'] : 'transparent';\n const thumbBgColor = tryCatch(() => mix(0.2, statusColor, palette['primary-background']));\n\n const borderColor =\n status && formField[status] ? formField[status]['status-color'] : palette['border-line'];\n\n return css`\n ${StyledText} {\n line-height: calc(${spacing} * 4);\n }\n\n ${status &&\n css`\n ${StyledBar}::before {\n background-color: ${statusColor};\n }\n\n ${StyledThumb} {\n border-color: ${borderColor};\n :hover,\n :active {\n background-color: ${thumbBgColor};\n }\n }\n `}\n\n ${orientation === 'horizontal' &&\n css`\n ${StyledSliderTrackWrapper} {\n ${StyledTrack},\n ${StyledThumb} {\n grid-row: 1;\n }\n\n ${StyledTicksContainer} {\n grid-row: 2;\n }\n\n & + ${StyledNumberInput}, & + ${StyledText} {\n margin-inline-start: calc(2 * ${spacing});\n }\n }\n `}\n\n /* disabling 'duplicate selectors' rule to keep the css rules grouped by orientation prop */\n\n /* stylelint-disable no-duplicate-selectors */\n ${orientation === 'vertical' &&\n css`\n ${StyledSliderTrackWrapper} {\n grid-template-columns: calc(${spacing} * 4) minmax(0, 1fr);\n grid-template-rows: 0.5em [track-start] minmax(calc(${spacing} * 20), max-content) [track-end] 0.5em;\n margin-top: ${spacing};\n\n ${StyledTrack} {\n grid-row: track-start / track-end;\n height: 100%;\n transform: scale(-1);\n\n ${StyledBar} {\n height: 100%;\n width: ${spacing};\n\n ::before {\n transform: translateY(calc(-100% + var(--slider-value, 0)));\n }\n }\n }\n\n ${StyledThumb} {\n grid-row: track-start / track-end;\n top: auto;\n bottom: calc(100% - var(--slider-value));\n left: calc(${spacing} / 2);\n right: calc(${spacing} / 2);\n transform: translate(0, 50%);\n }\n\n ${StyledTicksContainer} {\n grid-row: 1 / -1;\n height: 100%;\n }\n\n & + ${StyledNumberInput}, & + ${StyledText} {\n margin-top: calc(2 * ${spacing});\n width: calc(${spacing} * 4);\n text-align: center;\n\n /* fix NumberInput double padding issue */\n &,\n & > input {\n padding: 0;\n }\n }\n }\n `}\n\n /* stylelint-enable no-duplicate-selectors */\n\n\n &[disabled],\n &[readonly] {\n ${StyledTrack} {\n cursor: default;\n }\n\n ${StyledThumb} {\n cursor: default;\n border-color: ${palette['border-line']};\n :hover,\n :active {\n background-color: ${palette['background-color']};\n }\n }\n }\n `;\n});\n\nStyledSlider.defaultProps = defaultThemeProp;\n\nexport const StyledTickItem = styled(StyledGrid)<{\n lowerBoundaryItem?: boolean;\n upperBoundaryItem?: boolean;\n orientation: 'horizontal' | 'vertical';\n}>(({ lowerBoundaryItem, upperBoundaryItem, orientation, theme }) => {\n const spacing = theme.base.spacing;\n\n const { ltr } = useDirection();\n\n return css`\n /* disabling 'duplicate selectors' rule to keep the css rules grouped by orientation prop */\n\n /* stylelint-disable no-duplicate-selectors */\n ${orientation === 'horizontal' &&\n css`\n text-align: center;\n text-overflow: ellipsis;\n white-space: nowrap;\n &::before {\n width: 0.0625rem;\n height: ${spacing};\n transform: translateY(-50%);\n margin: 0 auto;\n }\n\n ${lowerBoundaryItem &&\n css`\n text-align: start;\n transform: translate(-0.5ch, 0);\n &::before {\n margin-inline-start: 0.5ch;\n }\n `}\n\n ${upperBoundaryItem &&\n css`\n text-align: end;\n transform: translate(0.5ch, 0);\n &::before {\n margin-inline-end: 0.5ch;\n }\n `}\n `}\n\n ${orientation === 'vertical' &&\n css`\n display: flex;\n align-items: center;\n\n &::before {\n width: ${spacing};\n height: calc(${spacing} / 8);\n ${ltr\n ? css`\n transform: translateX(-50%);\n `\n : css`\n transform: translateX(50%);\n `}\n }\n `}\n\n /* stylelint-enable no-duplicate-selectors */\n overflow: hidden;\n `;\n});\n\nStyledTickItem.defaultProps = defaultThemeProp;\n\nexport const StyledTickButton = styled.span`\n cursor: pointer;\n line-height: 1em;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n outline: 0;\n`;\n\nStyledTickButton.defaultProps = defaultThemeProp;\n"]}
@@ -1,7 +1,8 @@
1
1
  import { Ref, FC } from 'react';
2
- import { NoItemsProps } from '../NoItems';
2
+ import { EmptyStateProps } from '../EmptyState';
3
3
  import { ForwardProps, NoChildrenProp, OmitStrict, Action } from '../../types';
4
4
  import SummaryItem, { SummaryItemProps } from '../SummaryItem';
5
+ import type { ErrorStateProps } from '../ErrorState';
5
6
  export interface SummaryListProps extends NoChildrenProp {
6
7
  /** Name of the utility to be used as its heading along with associated actions and aria attributes. */
7
8
  name?: string;
@@ -18,7 +19,12 @@ export interface SummaryListProps extends NoChildrenProp {
18
19
  /** User click initiated callback for when to show view all modal. List lengths less than the count prop will display a "View all" button with this function is bound to. */
19
20
  onViewAll?: (callback: Function) => void;
20
21
  /** A simple message to display when there are no items. */
21
- noItemsText?: NoItemsProps['message'];
22
+ noItemsText?: EmptyStateProps['message'];
23
+ /**
24
+ * Indicate an error occurred while acquiring data for the list.
25
+ * The default error state may be overridden with custom props.
26
+ */
27
+ error?: boolean | ErrorStateProps;
22
28
  /** Ref for the SummaryList's root element. */
23
29
  ref?: Ref<HTMLElement>;
24
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SummaryList.d.ts","sourceRoot":"","sources":["../../../src/components/SummaryList/SummaryList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,GAAG,EAAE,EAAE,EAAW,MAAM,OAAO,CAAC;AAStE,OAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAI/E,OAAO,WAAW,EAAE,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAI/D,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACtD,uGAAuG;IACvG,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC;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