@helsenorge/designsystem-react 14.6.0 → 14.7.1

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 (281) hide show
  1. package/lib/AnchorLink.js +2 -2
  2. package/lib/AnchorLink.js.map +1 -1
  3. package/lib/Avatar.js +2 -2
  4. package/lib/Avatar.js.map +1 -1
  5. package/lib/Badge.js +2 -2
  6. package/lib/Badge.js.map +1 -1
  7. package/lib/Button.js +6 -6
  8. package/lib/Button.js.map +1 -1
  9. package/lib/CHANGELOG.md +17 -0
  10. package/lib/Checkbox.js +6 -6
  11. package/lib/Checkbox.js.map +1 -1
  12. package/lib/Chip.js +60 -0
  13. package/lib/Chip.js.map +1 -0
  14. package/lib/Close.js +3 -3
  15. package/lib/Close.js.map +1 -1
  16. package/lib/DictionaryTrigger.js +2 -2
  17. package/lib/DictionaryTrigger.js.map +1 -1
  18. package/lib/Drawer.js +42 -19
  19. package/lib/Drawer.js.map +1 -1
  20. package/lib/DrawerNavigation.js +81 -0
  21. package/lib/DrawerNavigation.js.map +1 -0
  22. package/lib/DrawerNavigation2.js +5 -0
  23. package/lib/DrawerNavigation2.js.map +1 -0
  24. package/lib/Duolist.js +5 -5
  25. package/lib/Duolist.js.map +1 -1
  26. package/lib/ElementHeader.js +9 -9
  27. package/lib/ElementHeader.js.map +1 -1
  28. package/lib/ElementHeaderText.js +4 -4
  29. package/lib/ElementHeaderText.js.map +1 -1
  30. package/lib/ErrorWrapper.js +2 -2
  31. package/lib/ErrorWrapper.js.map +1 -1
  32. package/lib/Expander.js +8 -8
  33. package/lib/Expander.js.map +1 -1
  34. package/lib/Filter.js +44 -0
  35. package/lib/Filter.js.map +1 -0
  36. package/lib/FilterButton.js +40 -0
  37. package/lib/FilterButton.js.map +1 -0
  38. package/lib/FilterButtonAndChipsWrapper.js +14 -0
  39. package/lib/FilterButtonAndChipsWrapper.js.map +1 -0
  40. package/lib/FilterDrawer.js +91 -0
  41. package/lib/FilterDrawer.js.map +1 -0
  42. package/lib/FilterLinkList.js +61 -0
  43. package/lib/FilterLinkList.js.map +1 -0
  44. package/lib/FilterLinkList2.js +5 -0
  45. package/lib/FilterLinkList2.js.map +1 -0
  46. package/lib/FilterOverviewLinkList.js +22 -0
  47. package/lib/FilterOverviewLinkList.js.map +1 -0
  48. package/lib/FilterOverviewSearch.js +16 -0
  49. package/lib/FilterOverviewSearch.js.map +1 -0
  50. package/lib/FilterResultCountAndSortWrapper.js +19 -0
  51. package/lib/FilterResultCountAndSortWrapper.js.map +1 -0
  52. package/lib/FilterSearch.js +87 -0
  53. package/lib/FilterSearch.js.map +1 -0
  54. package/lib/FilterSearch2.js +5 -0
  55. package/lib/FilterSearch2.js.map +1 -0
  56. package/lib/FilterSort.js +30 -0
  57. package/lib/FilterSort.js.map +1 -0
  58. package/lib/FormFieldTag.js +2 -2
  59. package/lib/FormFieldTag.js.map +1 -1
  60. package/lib/FormGroup.js +6 -6
  61. package/lib/FormGroup.js.map +1 -1
  62. package/lib/FormLayout.js +3 -3
  63. package/lib/FormLayout.js.map +1 -1
  64. package/lib/HelpDetails.js +3 -3
  65. package/lib/HelpDetails.js.map +1 -1
  66. package/lib/HelpTriggerIcon.js +2 -2
  67. package/lib/HelpTriggerIcon.js.map +1 -1
  68. package/lib/HelpTriggerStandalone.js +2 -2
  69. package/lib/HelpTriggerStandalone.js.map +1 -1
  70. package/lib/HighlightPanel.js +3 -3
  71. package/lib/HighlightPanel.js.map +1 -1
  72. package/lib/HorizontalScroll.js +4 -4
  73. package/lib/HorizontalScroll.js.map +1 -1
  74. package/lib/Icon.js +2 -2
  75. package/lib/Icon.js.map +1 -1
  76. package/lib/InfoTeaser.js +3 -3
  77. package/lib/InfoTeaser.js.map +1 -1
  78. package/lib/Input.js +4 -4
  79. package/lib/Input.js.map +1 -1
  80. package/lib/LinkList.js +5 -5
  81. package/lib/LinkList.js.map +1 -1
  82. package/lib/List.js +2 -2
  83. package/lib/List.js.map +1 -1
  84. package/lib/ListEditMode.js +4 -4
  85. package/lib/ListEditMode.js.map +1 -1
  86. package/lib/MaxCharacters.js +2 -2
  87. package/lib/MaxCharacters.js.map +1 -1
  88. package/lib/PanelTitle.js +2 -2
  89. package/lib/PanelTitle.js.map +1 -1
  90. package/lib/PopOver.js +2 -2
  91. package/lib/PopOver.js.map +1 -1
  92. package/lib/Search.js +26 -0
  93. package/lib/Search.js.map +1 -0
  94. package/lib/Select.js +7 -6
  95. package/lib/Select.js.map +1 -1
  96. package/lib/SingleSelectItem.js +3 -3
  97. package/lib/SingleSelectItem.js.map +1 -1
  98. package/lib/Slider.js +4 -4
  99. package/lib/Slider.js.map +1 -1
  100. package/lib/Spacer.js +2 -2
  101. package/lib/Spacer.js.map +1 -1
  102. package/lib/StatusDot.js +4 -4
  103. package/lib/StatusDot.js.map +1 -1
  104. package/lib/StatusDotList.js +2 -2
  105. package/lib/StatusDotList.js.map +1 -1
  106. package/lib/StepButtons.js +5 -5
  107. package/lib/StepButtons.js.map +1 -1
  108. package/lib/TabList.js +8 -8
  109. package/lib/TabList.js.map +1 -1
  110. package/lib/TabPanel.js +2 -2
  111. package/lib/TabPanel.js.map +1 -1
  112. package/lib/TableBody.js +2 -2
  113. package/lib/TableBody.js.map +1 -1
  114. package/lib/TableCell.js +2 -2
  115. package/lib/TableCell.js.map +1 -1
  116. package/lib/TableExpandedRow.js +4 -4
  117. package/lib/TableExpandedRow.js.map +1 -1
  118. package/lib/TableExpanderCell.js +2 -2
  119. package/lib/TableExpanderCell.js.map +1 -1
  120. package/lib/TableHead.js +2 -2
  121. package/lib/TableHead.js.map +1 -1
  122. package/lib/TableHeadCell.js +3 -3
  123. package/lib/TableHeadCell.js.map +1 -1
  124. package/lib/TableRow.js +3 -3
  125. package/lib/TableRow.js.map +1 -1
  126. package/lib/Textarea.js +4 -4
  127. package/lib/Textarea.js.map +1 -1
  128. package/lib/Title.js +4 -3
  129. package/lib/Title.js.map +1 -1
  130. package/lib/Toast.js +3 -3
  131. package/lib/Toast.js.map +1 -1
  132. package/lib/components/ArticleTeaser/index.js +4 -4
  133. package/lib/components/ArticleTeaser/index.js.map +1 -1
  134. package/lib/components/Chip/index.js +1 -59
  135. package/lib/components/Drawer/Drawer.d.ts +6 -0
  136. package/lib/components/Drawer/styles.module.scss +19 -0
  137. package/lib/components/Drawer/styles.module.scss.d.ts +1 -0
  138. package/lib/components/Dropdown/index.js +5 -5
  139. package/lib/components/Dropdown/index.js.map +1 -1
  140. package/lib/components/DropdownOld/index.js +3 -3
  141. package/lib/components/DropdownOld/index.js.map +1 -1
  142. package/lib/components/EmptyState/index.js +2 -2
  143. package/lib/components/EmptyState/index.js.map +1 -1
  144. package/lib/components/ExpanderHierarchy/index.js +7 -7
  145. package/lib/components/ExpanderHierarchy/index.js.map +1 -1
  146. package/lib/components/ExpanderList/index.js +6 -6
  147. package/lib/components/ExpanderList/index.js.map +1 -1
  148. package/lib/components/FavoriteButton/index.js +2 -2
  149. package/lib/components/FavoriteButton/index.js.map +1 -1
  150. package/lib/components/Filter/DrawerNavigation/DrawerNavigation.d.ts +35 -0
  151. package/lib/components/Filter/DrawerNavigation/FinnFastlegeFlyt.example.d.ts +2 -0
  152. package/lib/components/Filter/DrawerNavigation/FinnFastlegeFlyt.module.scss +15 -0
  153. package/lib/components/Filter/DrawerNavigation/FinnFastlegeFlyt.module.scss.d.ts +11 -0
  154. package/lib/components/Filter/DrawerNavigation/index.d.ts +4 -0
  155. package/lib/components/Filter/DrawerNavigation/index.js +3 -0
  156. package/lib/components/Filter/DrawerNavigation/useDrawerNavigation.d.ts +7 -0
  157. package/lib/components/Filter/FilterButton/FilterButton.d.ts +7 -0
  158. package/lib/components/Filter/FilterButton/index.d.ts +3 -0
  159. package/lib/components/Filter/FilterButton/index.js +2 -0
  160. package/lib/components/Filter/FilterButton/styles.module.scss +52 -0
  161. package/lib/components/Filter/FilterButton/styles.module.scss.d.ts +12 -0
  162. package/lib/components/Filter/FilterButtonAndChipsWrapper/FilterButtonAndChipsWrapper.d.ts +11 -0
  163. package/lib/components/Filter/FilterButtonAndChipsWrapper/index.d.ts +3 -0
  164. package/lib/components/Filter/FilterButtonAndChipsWrapper/index.js +2 -0
  165. package/lib/components/Filter/FilterButtonAndChipsWrapper/styles.module.scss +8 -0
  166. package/lib/components/Filter/FilterButtonAndChipsWrapper/styles.module.scss.d.ts +9 -0
  167. package/lib/components/Filter/FilterDrawer/FilterDrawer.d.ts +42 -0
  168. package/lib/components/Filter/FilterDrawer/index.d.ts +3 -0
  169. package/lib/components/Filter/FilterDrawer/index.js +2 -0
  170. package/lib/components/Filter/FilterDrawer/styles.module.scss +29 -0
  171. package/lib/components/Filter/FilterDrawer/styles.module.scss.d.ts +10 -0
  172. package/lib/components/Filter/FilterLinkList/FilterLinkList.d.ts +35 -0
  173. package/lib/components/Filter/FilterLinkList/FilterLinkList.module.scss +89 -0
  174. package/lib/components/Filter/FilterLinkList/FilterLinkList.module.scss.d.ts +14 -0
  175. package/lib/components/Filter/FilterLinkList/index.d.ts +3 -0
  176. package/lib/components/Filter/FilterLinkList/index.js +3 -0
  177. package/lib/components/Filter/FilterOverviewLinkList/FilterOverviewLinkList.d.ts +19 -0
  178. package/lib/components/Filter/FilterOverviewLinkList/index.d.ts +3 -0
  179. package/lib/components/Filter/FilterOverviewLinkList/index.js +2 -0
  180. package/lib/components/Filter/FilterOverviewSearch/FilterOverviewSearch.d.ts +9 -0
  181. package/lib/components/Filter/FilterOverviewSearch/index.d.ts +3 -0
  182. package/lib/components/Filter/FilterOverviewSearch/index.js +2 -0
  183. package/lib/components/Filter/FilterOverviewSearch/styles.module.scss +14 -0
  184. package/lib/components/Filter/FilterOverviewSearch/styles.module.scss.d.ts +9 -0
  185. package/lib/components/Filter/FilterResultCountAndSortWrapper/FilterResultCountAndSortWrapper.d.ts +8 -0
  186. package/lib/components/Filter/FilterResultCountAndSortWrapper/index.d.ts +3 -0
  187. package/lib/components/Filter/FilterResultCountAndSortWrapper/index.js +2 -0
  188. package/lib/components/Filter/FilterResultCountAndSortWrapper/styles.module.scss +17 -0
  189. package/lib/components/Filter/FilterResultCountAndSortWrapper/styles.module.scss.d.ts +11 -0
  190. package/lib/components/Filter/FilterSearch/FilterSearch.d.ts +19 -0
  191. package/lib/components/Filter/FilterSearch/index.d.ts +3 -0
  192. package/lib/components/Filter/FilterSearch/index.js +2 -0
  193. package/lib/components/Filter/FilterSearch/styles.module.scss +181 -0
  194. package/lib/components/Filter/FilterSearch/styles.module.scss.d.ts +16 -0
  195. package/lib/components/Filter/FilterSort/FilterSort.d.ts +8 -0
  196. package/lib/components/Filter/FilterSort/index.d.ts +3 -0
  197. package/lib/components/Filter/FilterSort/index.js +2 -0
  198. package/lib/components/Filter/FilterSort/styles.module.scss +33 -0
  199. package/lib/components/Filter/FilterSort/styles.module.scss.d.ts +11 -0
  200. package/lib/components/Filter/getFilterChips/getFilterChips.d.ts +17 -0
  201. package/lib/components/Filter/getFilterChips/index.d.ts +3 -0
  202. package/lib/components/Filter/getFilterChips/index.js +2 -0
  203. package/lib/components/Filter/index.d.ts +25 -0
  204. package/lib/components/Filter/index.js +137 -0
  205. package/lib/components/Filter/index.js.map +1 -0
  206. package/lib/components/Filter/resourceHelper.d.ts +3 -0
  207. package/lib/components/Filter/resourcesMock.d.ts +41 -0
  208. package/lib/components/Filter/useFilter.d.ts +20 -0
  209. package/lib/components/Filter/useFilterDrawer.d.ts +11 -0
  210. package/lib/components/Filter/utils.d.ts +81 -0
  211. package/lib/components/HelpBubble/index.js +3 -3
  212. package/lib/components/HelpBubble/index.js.map +1 -1
  213. package/lib/components/HelpPanel/index.js +2 -2
  214. package/lib/components/HelpPanel/index.js.map +1 -1
  215. package/lib/components/HelpTriggerInline/index.js +2 -2
  216. package/lib/components/HelpTriggerInline/index.js.map +1 -1
  217. package/lib/components/Icons/Filter.js +1 -43
  218. package/lib/components/Icons/Search.js +1 -25
  219. package/lib/components/Label/utils.d.ts +1 -0
  220. package/lib/components/Loader/index.js +4 -4
  221. package/lib/components/Loader/index.js.map +1 -1
  222. package/lib/components/Modal/index.js +9 -9
  223. package/lib/components/Modal/index.js.map +1 -1
  224. package/lib/components/NotificationPanel/index.js +6 -6
  225. package/lib/components/NotificationPanel/index.js.map +1 -1
  226. package/lib/components/Panel/index.js +12 -12
  227. package/lib/components/Panel/index.js.map +1 -1
  228. package/lib/components/PanelList/index.js +3 -3
  229. package/lib/components/PanelList/index.js.map +1 -1
  230. package/lib/components/PopMenu/index.js +3 -3
  231. package/lib/components/PopMenu/index.js.map +1 -1
  232. package/lib/components/Progressbar/index.js +2 -2
  233. package/lib/components/Progressbar/index.js.map +1 -1
  234. package/lib/components/PromoPanel/index.js +2 -2
  235. package/lib/components/PromoPanel/index.js.map +1 -1
  236. package/lib/components/Select/Select.d.ts +2 -0
  237. package/lib/components/Select/styles.module.scss +1 -0
  238. package/lib/components/ServiceMessage/index.js +5 -5
  239. package/lib/components/ServiceMessage/index.js.map +1 -1
  240. package/lib/components/SharingStatus/index.js +4 -4
  241. package/lib/components/SharingStatus/index.js.map +1 -1
  242. package/lib/components/Step/index.js +2 -2
  243. package/lib/components/Step/index.js.map +1 -1
  244. package/lib/components/Stepper/index.js +2 -2
  245. package/lib/components/Stepper/index.js.map +1 -1
  246. package/lib/components/StickyNote/index.js +8 -8
  247. package/lib/components/StickyNote/index.js.map +1 -1
  248. package/lib/components/Table/index.js +2 -2
  249. package/lib/components/Table/index.js.map +1 -1
  250. package/lib/components/Tabs/index.js +4 -4
  251. package/lib/components/Tabs/index.js.map +1 -1
  252. package/lib/components/Tag/index.js +2 -2
  253. package/lib/components/Tag/index.js.map +1 -1
  254. package/lib/components/Tile/index.js +4 -4
  255. package/lib/components/Tile/index.js.map +1 -1
  256. package/lib/components/Title/Title.d.ts +2 -0
  257. package/lib/components/Toggle/index.js +7 -7
  258. package/lib/components/Toggle/index.js.map +1 -1
  259. package/lib/components/Validation/index.js +2 -2
  260. package/lib/components/Validation/index.js.map +1 -1
  261. package/lib/getFilterChips.js +30 -0
  262. package/lib/getFilterChips.js.map +1 -0
  263. package/lib/index.d.ts +1 -0
  264. package/lib/index.js +2 -1
  265. package/lib/resource.js +4 -0
  266. package/lib/resource.js.map +1 -0
  267. package/lib/resourceHelper.js +31 -0
  268. package/lib/resourceHelper.js.map +1 -0
  269. package/lib/resources/HN.Designsystem.Drawer.nn-NO.json.d.ts +7 -0
  270. package/lib/resources/HN.Designsystem.Filter.en-GB.json.d.ts +13 -0
  271. package/lib/resources/HN.Designsystem.Filter.nb-NO.json.d.ts +13 -0
  272. package/lib/utils/resource.d.ts +6 -0
  273. package/lib/utils/resource.js +2 -0
  274. package/lib/utils2.js +11 -9
  275. package/lib/utils2.js.map +1 -1
  276. package/lib/utils3.js +5 -5
  277. package/lib/utils3.js.map +1 -1
  278. package/package.json +1 -1
  279. package/lib/components/Chip/index.js.map +0 -1
  280. package/lib/components/Icons/Filter.js.map +0 -1
  281. package/lib/components/Icons/Search.js.map +0 -1
package/lib/utils2.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils2.js","names":["Sublabel: React.FC<SublabelProps>","Label: FunctionComponent<LabelProps>"],"sources":["../src/components/Label/SubLabel.tsx","../src/components/Label/Label.tsx","../src/components/Label/utils.tsx"],"sourcesContent":["import cn from 'classnames';\n\nimport type { LabelText } from './Label';\n\nimport { AnalyticsId, FormOnColor } from '../../constants';\nimport Spacer from '../Spacer';\n\nimport styles from './styles.module.scss';\n\nexport interface SublabelProps {\n /** Sets the content of the Sublabel */\n children?: React.ReactNode;\n /** Adds custom classes to the element. */\n className?: string;\n /** id that is placed on the wrapper */\n id: string;\n /** Array of sublabel strings. Can be of type semibold or normal */\n onColor?: FormOnColor;\n /** Array of sublabel strings. Can be of type semibold or normal */\n sublabelTexts?: LabelText[];\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport const Sublabel: React.FC<SublabelProps> = ({ children, className, id, onColor, sublabelTexts, testId }) => {\n const mapSublabels = (hideFromScreenReader?: boolean): React.ReactNode => {\n return (\n sublabelTexts &&\n sublabelTexts.map((sublabelText, index) => {\n const labelClasses = cn(styles.label, styles['sublabel'], {\n [styles['sublabel--subdued']]: sublabelText.type === 'subdued',\n [styles['sublabel--on-dark']]: onColor === FormOnColor.ondark,\n });\n return (\n hideFromScreenReader === sublabelText.hideFromScreenReader && (\n <span className={labelClasses} key={index}>\n {sublabelText.text}\n </span>\n )\n );\n })\n );\n };\n\n const subLabels = mapSublabels();\n const ariaHiddenSublabels = mapSublabels(true);\n\n return (\n <>\n <Spacer size={'3xs'} />\n {(subLabels || children) && (\n <div className={className} id={id} data-testid={testId} data-analyticsid={AnalyticsId.Sublabel}>\n {subLabels}\n {children}\n </div>\n )}\n {ariaHiddenSublabels && (\n <div className={className} data-testid={testId}>\n {ariaHiddenSublabels}\n </div>\n )}\n </>\n );\n};\n","import type { FunctionComponent } from 'react';\nimport React from 'react';\n\nimport cn from 'classnames';\n\nimport type { SublabelProps } from './SubLabel';\nimport type { FormFieldTagProps } from '../FormFieldTag';\nimport type { StatusDotProps } from '../StatusDot';\n\nimport { Sublabel } from './SubLabel';\nimport { AnalyticsId, FormOnColor } from '../../constants';\nimport { isComponent } from '../../utils/component';\nimport FormFieldTag from '../FormFieldTag';\nimport Spacer from '../Spacer';\nimport StatusDot from '../StatusDot';\n\nimport styles from './styles.module.scss';\n\nexport type LabelText = {\n hideFromScreenReader?: boolean;\n text: string;\n type?: 'normal' | 'subdued';\n};\n\nexport type LabelTags = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'span' | 'label' | 'p' | 'legend';\n\nexport interface LabelProps {\n /** Component shown after label - discourage use of this */\n afterLabelChildren?: React.ReactNode;\n /** Sets the content of the Label */\n children?: React.ReactNode;\n /** Sets a tag that describes whether the form field is required or optional */\n formFieldTag?: React.ReactNode;\n /** Adds custom classes to the label tag. */\n labelClassName?: string;\n /** Adds custom classes to the label text. */\n labelTextClassName?: string;\n /** Adds custom classes to the element. */\n className?: string;\n /** Id that is put on the \"for\" attribute of the label */\n htmlFor?: string;\n /** Changes the underlying element of the label */\n htmlMarkup?: LabelTags;\n /** Id som plasseres på <label/> */\n labelId?: string;\n /** Array of main label strings. Can be of type semibold or normal */\n labelTexts?: LabelText[];\n /** Array of sublabel strings. Can be of type semibold or normal */\n onColor?: keyof typeof FormOnColor;\n /** StatusDot placed underneath the last sublabel */\n statusDot?: React.ReactNode;\n /** Sublabel component */\n sublabel?: React.ReactNode;\n /** Adds custom classes to the div wrapping the sublabels. */\n sublabelWrapperClassName?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Gives a custom classname to the afterLabelChildren wrapper. Used in checkbox and radiobutton */\n afterLabelChildrenClassName?: string;\n}\n\nconst Label: FunctionComponent<LabelProps> = ({\n afterLabelChildren,\n children,\n className,\n formFieldTag,\n htmlFor,\n htmlMarkup = 'label',\n labelClassName,\n labelTextClassName,\n labelId,\n labelTexts,\n onColor = FormOnColor.onwhite,\n statusDot,\n sublabel,\n sublabelWrapperClassName,\n testId,\n afterLabelChildrenClassName,\n}) => {\n const hasChildren = children && typeof children !== 'undefined';\n const labelWrapperClasses = cn(styles['label-wrapper'], { [styles['label-wrapper--no-bottom-margin']]: hasChildren }, className);\n const mainLabelWrapperClasses = cn({\n [styles['label-wrapper--after-label-children']]: afterLabelChildren,\n });\n const afterLabelChildrenClasses = cn(styles['after-label-children'], afterLabelChildrenClassName);\n\n const mapLabels = (): React.ReactNode => {\n if (typeof labelTexts === 'undefined') return null;\n\n return labelTexts.map((labelText, index) => {\n const labelClasses = cn(\n styles.label,\n {\n [styles['label--subdued']]: labelText.type === 'subdued',\n [styles['label--on-dark']]: onColor === FormOnColor.ondark,\n },\n labelTextClassName\n );\n return (\n <span aria-hidden={labelText.hideFromScreenReader} className={labelClasses} key={index}>\n {labelText.text}\n </span>\n );\n });\n };\n const CustomTag = htmlMarkup;\n\n return (\n <div className={labelWrapperClasses}>\n <div className={mainLabelWrapperClasses}>\n <CustomTag className={labelClassName} id={labelId} htmlFor={htmlFor} data-testid={testId} data-analyticsid={AnalyticsId.Label}>\n <span className={styles['label-content-wrapper']}>\n {children}\n <span className={styles.label__texts}>{mapLabels()}</span>\n </span>\n </CustomTag>\n {afterLabelChildren && <div className={afterLabelChildrenClasses}>{afterLabelChildren}</div>}\n </div>\n {(sublabel || statusDot || formFieldTag) && (\n <div className={sublabelWrapperClassName}>\n {formFieldTag && isComponent<FormFieldTagProps>(formFieldTag, FormFieldTag) && React.cloneElement(formFieldTag)}\n {sublabel &&\n isComponent<SublabelProps>(sublabel, Sublabel) &&\n React.cloneElement(sublabel, {\n onColor: onColor as FormOnColor,\n })}\n {statusDot && isComponent<StatusDotProps>(statusDot, StatusDot) && (\n <>\n <Spacer size={'3xs'} />\n {React.cloneElement(statusDot, {\n onColor: onColor === FormOnColor.ondark ? 'ondark' : 'onwhite',\n })}\n </>\n )}\n </div>\n )}\n </div>\n );\n};\n\nexport default Label;\n","import React from 'react';\n\nimport cn from 'classnames';\n\nimport type { LabelProps, LabelTags } from './Label';\nimport type { FormOnColor } from '../../constants';\n\nimport Label from './Label';\nimport { isComponent } from '../../utils/component';\n\nexport const getLabelText = (label: React.ReactNode): string => {\n let allLabelText = '';\n\n if (isComponent<LabelProps>(label, Label)) {\n label.props.labelTexts?.forEach(labelText => {\n allLabelText += !labelText.hideFromScreenReader ? labelText.text : '';\n });\n }\n\n return allLabelText;\n};\n\ninterface RenderLabelProps {\n label: React.ReactNode;\n inputId: string;\n onColor: FormOnColor;\n markup?: LabelTags;\n}\n\nexport const renderLabel = (props: RenderLabelProps): React.ReactNode => {\n return (\n <>\n {props.label && isComponent<LabelProps>(props.label, Label)\n ? React.cloneElement(props.label, {\n htmlFor: props.inputId,\n htmlMarkup: props.markup || 'label',\n onColor: props.onColor,\n })\n : typeof props.label === 'string' && (\n <Label labelTexts={[{ text: props.label, type: 'normal' }]} htmlFor={props.inputId} onColor={props.onColor} />\n )}\n </>\n );\n};\n\ninterface RenderLabelAsParentProps {\n label: React.ReactNode;\n children: React.ReactNode;\n inputId: string;\n onColor: FormOnColor;\n labelClassName?: string;\n labelTextClassName?: string;\n sublabelWrapperClassName?: string;\n large?: boolean;\n markup?: LabelTags;\n afterLabelChildrenClassName?: string;\n}\n\nexport const renderLabelAsParent = (props: RenderLabelAsParentProps): React.ReactNode => {\n return (\n <>\n {props.label && isComponent<LabelProps>(props.label, Label)\n ? React.cloneElement(props.label, {\n htmlFor: props.inputId,\n onColor: props.onColor,\n children: props.children,\n labelClassName: cn(props.labelClassName, props.label.props.labelClassName),\n labelTextClassName: props.labelTextClassName,\n htmlMarkup: props.markup || 'label',\n sublabelWrapperClassName: props.sublabelWrapperClassName,\n sublabel: props.large ? undefined : props.label.props.sublabel,\n statusDot: props.large ? undefined : props.label.props.statusDot,\n afterLabelChildrenClassName: props.afterLabelChildrenClassName,\n })\n : typeof props.label === 'string' && (\n <Label\n labelTexts={[{ text: props.label, type: 'subdued' }]}\n htmlFor={props.inputId}\n onColor={props.onColor}\n htmlMarkup={props.markup || 'label'}\n labelClassName={props.labelClassName}\n labelTextClassName={props.labelTextClassName}\n sublabelWrapperClassName={props.sublabelWrapperClassName}\n afterLabelChildrenClassName={props.afterLabelChildrenClassName}\n >\n {props.children}\n </Label>\n )}\n </>\n );\n};\n"],"mappings":";;;;;;;;;AAwBA,MAAaA,YAAqC,EAAE,UAAU,WAAW,IAAI,SAAS,eAAe,aAAa;CAChH,MAAM,gBAAgB,yBAAoD;AACxE,SACE,iBACA,cAAc,KAAK,cAAc,UAAU;GACzC,MAAM,eAAe,WAAG,OAAO,OAAO,OAAO,aAAa;KACvD,OAAO,uBAAuB,aAAa,SAAS;KACpD,OAAO,uBAAuB,YAAY,YAAY;IACxD,CAAC;AACF,UACE,yBAAyB,aAAa,wBACpC,oBAAC,QAAA;IAAK,WAAW;cACd,aAAa;MADoB,MAE7B;IAGX;;CAIN,MAAM,YAAY,cAAc;CAChC,MAAM,sBAAsB,aAAa,KAAK;AAE9C,QACE,qBAAA,UAAA,EAAA,UAAA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M;EAChC,UAAU,MAAM,QAAQ,KAAA,IAAY,MAAM,MAAM,MAAM;EACtD,WAAW,MAAM,QAAQ,KAAA,IAAY,MAAM,MAAM,MAAM;EACvD,6BAA6B,MAAM;EACpC,CAAC,GACF,OAAO,MAAM,UAAU,YACrB,oBAAC,eAAA;EACC,YAAY,CAAC;GAAE,MAAM,MAAM;GAAO,MAAM;GAAW,CAAC;EACpD,SAAS,MAAM;EACf,SAAS,MAAM;EACf,YAAY,MAAM,UAAU;EAC5B,gBAAgB,MAAM;EACtB,oBAAoB,MAAM;EAC1B,0BAA0B,MAAM;EAChC,6BAA6B,MAAM;YAElC,MAAM;GACD,EAAA,CAEb"}
1
+ {"version":3,"file":"utils2.js","names":["Sublabel: React.FC<SublabelProps>","Label: FunctionComponent<LabelProps>"],"sources":["../src/components/Label/SubLabel.tsx","../src/components/Label/Label.tsx","../src/components/Label/utils.tsx"],"sourcesContent":["import cn from 'classnames';\n\nimport type { LabelText } from './Label';\n\nimport { AnalyticsId, FormOnColor } from '../../constants';\nimport Spacer from '../Spacer';\n\nimport styles from './styles.module.scss';\n\nexport interface SublabelProps {\n /** Sets the content of the Sublabel */\n children?: React.ReactNode;\n /** Adds custom classes to the element. */\n className?: string;\n /** id that is placed on the wrapper */\n id: string;\n /** Array of sublabel strings. Can be of type semibold or normal */\n onColor?: FormOnColor;\n /** Array of sublabel strings. Can be of type semibold or normal */\n sublabelTexts?: LabelText[];\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport const Sublabel: React.FC<SublabelProps> = ({ children, className, id, onColor, sublabelTexts, testId }) => {\n const mapSublabels = (hideFromScreenReader?: boolean): React.ReactNode => {\n return (\n sublabelTexts &&\n sublabelTexts.map((sublabelText, index) => {\n const labelClasses = cn(styles.label, styles['sublabel'], {\n [styles['sublabel--subdued']]: sublabelText.type === 'subdued',\n [styles['sublabel--on-dark']]: onColor === FormOnColor.ondark,\n });\n return (\n hideFromScreenReader === sublabelText.hideFromScreenReader && (\n <span className={labelClasses} key={index}>\n {sublabelText.text}\n </span>\n )\n );\n })\n );\n };\n\n const subLabels = mapSublabels();\n const ariaHiddenSublabels = mapSublabels(true);\n\n return (\n <>\n <Spacer size={'3xs'} />\n {(subLabels || children) && (\n <div className={className} id={id} data-testid={testId} data-analyticsid={AnalyticsId.Sublabel}>\n {subLabels}\n {children}\n </div>\n )}\n {ariaHiddenSublabels && (\n <div className={className} data-testid={testId}>\n {ariaHiddenSublabels}\n </div>\n )}\n </>\n );\n};\n","import type { FunctionComponent } from 'react';\nimport React from 'react';\n\nimport cn from 'classnames';\n\nimport type { SublabelProps } from './SubLabel';\nimport type { FormFieldTagProps } from '../FormFieldTag';\nimport type { StatusDotProps } from '../StatusDot';\n\nimport { Sublabel } from './SubLabel';\nimport { AnalyticsId, FormOnColor } from '../../constants';\nimport { isComponent } from '../../utils/component';\nimport FormFieldTag from '../FormFieldTag';\nimport Spacer from '../Spacer';\nimport StatusDot from '../StatusDot';\n\nimport styles from './styles.module.scss';\n\nexport type LabelText = {\n hideFromScreenReader?: boolean;\n text: string;\n type?: 'normal' | 'subdued';\n};\n\nexport type LabelTags = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'span' | 'label' | 'p' | 'legend';\n\nexport interface LabelProps {\n /** Component shown after label - discourage use of this */\n afterLabelChildren?: React.ReactNode;\n /** Sets the content of the Label */\n children?: React.ReactNode;\n /** Sets a tag that describes whether the form field is required or optional */\n formFieldTag?: React.ReactNode;\n /** Adds custom classes to the label tag. */\n labelClassName?: string;\n /** Adds custom classes to the label text. */\n labelTextClassName?: string;\n /** Adds custom classes to the element. */\n className?: string;\n /** Id that is put on the \"for\" attribute of the label */\n htmlFor?: string;\n /** Changes the underlying element of the label */\n htmlMarkup?: LabelTags;\n /** Id som plasseres på <label/> */\n labelId?: string;\n /** Array of main label strings. Can be of type semibold or normal */\n labelTexts?: LabelText[];\n /** Array of sublabel strings. Can be of type semibold or normal */\n onColor?: keyof typeof FormOnColor;\n /** StatusDot placed underneath the last sublabel */\n statusDot?: React.ReactNode;\n /** Sublabel component */\n sublabel?: React.ReactNode;\n /** Adds custom classes to the div wrapping the sublabels. */\n sublabelWrapperClassName?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Gives a custom classname to the afterLabelChildren wrapper. Used in checkbox and radiobutton */\n afterLabelChildrenClassName?: string;\n}\n\nconst Label: FunctionComponent<LabelProps> = ({\n afterLabelChildren,\n children,\n className,\n formFieldTag,\n htmlFor,\n htmlMarkup = 'label',\n labelClassName,\n labelTextClassName,\n labelId,\n labelTexts,\n onColor = FormOnColor.onwhite,\n statusDot,\n sublabel,\n sublabelWrapperClassName,\n testId,\n afterLabelChildrenClassName,\n}) => {\n const hasChildren = children && typeof children !== 'undefined';\n const labelWrapperClasses = cn(styles['label-wrapper'], { [styles['label-wrapper--no-bottom-margin']]: hasChildren }, className);\n const mainLabelWrapperClasses = cn({\n [styles['label-wrapper--after-label-children']]: afterLabelChildren,\n });\n const afterLabelChildrenClasses = cn(styles['after-label-children'], afterLabelChildrenClassName);\n\n const mapLabels = (): React.ReactNode => {\n if (typeof labelTexts === 'undefined') return null;\n\n return labelTexts.map((labelText, index) => {\n const labelClasses = cn(\n styles.label,\n {\n [styles['label--subdued']]: labelText.type === 'subdued',\n [styles['label--on-dark']]: onColor === FormOnColor.ondark,\n },\n labelTextClassName\n );\n return (\n <span aria-hidden={labelText.hideFromScreenReader} className={labelClasses} key={index}>\n {labelText.text}\n </span>\n );\n });\n };\n const CustomTag = htmlMarkup;\n\n return (\n <div className={labelWrapperClasses}>\n <div className={mainLabelWrapperClasses}>\n <CustomTag className={labelClassName} id={labelId} htmlFor={htmlFor} data-testid={testId} data-analyticsid={AnalyticsId.Label}>\n <span className={styles['label-content-wrapper']}>\n {children}\n <span className={styles.label__texts}>{mapLabels()}</span>\n </span>\n </CustomTag>\n {afterLabelChildren && <div className={afterLabelChildrenClasses}>{afterLabelChildren}</div>}\n </div>\n {(sublabel || statusDot || formFieldTag) && (\n <div className={sublabelWrapperClassName}>\n {formFieldTag && isComponent<FormFieldTagProps>(formFieldTag, FormFieldTag) && React.cloneElement(formFieldTag)}\n {sublabel &&\n isComponent<SublabelProps>(sublabel, Sublabel) &&\n React.cloneElement(sublabel, {\n onColor: onColor as FormOnColor,\n })}\n {statusDot && isComponent<StatusDotProps>(statusDot, StatusDot) && (\n <>\n <Spacer size={'3xs'} />\n {React.cloneElement(statusDot, {\n onColor: onColor === FormOnColor.ondark ? 'ondark' : 'onwhite',\n })}\n </>\n )}\n </div>\n )}\n </div>\n );\n};\n\nexport default Label;\n","import React from 'react';\n\nimport cn from 'classnames';\n\nimport type { LabelProps, LabelTags } from './Label';\nimport type { FormOnColor } from '../../constants';\n\nimport Label from './Label';\nimport { isComponent } from '../../utils/component';\n\nexport const getLabelText = (label: React.ReactNode): string => {\n let allLabelText = '';\n\n if (isComponent<LabelProps>(label, Label)) {\n label.props.labelTexts?.forEach(labelText => {\n allLabelText += !labelText.hideFromScreenReader ? labelText.text : '';\n });\n }\n\n return allLabelText;\n};\n\ninterface RenderLabelProps {\n label: React.ReactNode;\n inputId: string;\n onColor: FormOnColor;\n markup?: LabelTags;\n className?: string;\n}\n\nexport const renderLabel = (props: RenderLabelProps): React.ReactNode => {\n return (\n <>\n {props.label && isComponent<LabelProps>(props.label, Label)\n ? React.cloneElement(props.label, {\n htmlFor: props.inputId,\n htmlMarkup: props.markup || 'label',\n onColor: props.onColor,\n className: props.className,\n })\n : typeof props.label === 'string' && (\n <Label\n labelTexts={[{ text: props.label, type: 'normal' }]}\n htmlFor={props.inputId}\n onColor={props.onColor}\n className={props.className}\n />\n )}\n </>\n );\n};\n\ninterface RenderLabelAsParentProps {\n label: React.ReactNode;\n children: React.ReactNode;\n inputId: string;\n onColor: FormOnColor;\n labelClassName?: string;\n labelTextClassName?: string;\n sublabelWrapperClassName?: string;\n large?: boolean;\n markup?: LabelTags;\n afterLabelChildrenClassName?: string;\n}\n\nexport const renderLabelAsParent = (props: RenderLabelAsParentProps): React.ReactNode => {\n return (\n <>\n {props.label && isComponent<LabelProps>(props.label, Label)\n ? React.cloneElement(props.label, {\n htmlFor: props.inputId,\n onColor: props.onColor,\n children: props.children,\n labelClassName: cn(props.labelClassName, props.label.props.labelClassName),\n labelTextClassName: props.labelTextClassName,\n htmlMarkup: props.markup || 'label',\n sublabelWrapperClassName: props.sublabelWrapperClassName,\n sublabel: props.large ? undefined : props.label.props.sublabel,\n statusDot: props.large ? undefined : props.label.props.statusDot,\n afterLabelChildrenClassName: props.afterLabelChildrenClassName,\n })\n : typeof props.label === 'string' && (\n <Label\n labelTexts={[{ text: props.label, type: 'subdued' }]}\n htmlFor={props.inputId}\n onColor={props.onColor}\n htmlMarkup={props.markup || 'label'}\n labelClassName={props.labelClassName}\n labelTextClassName={props.labelTextClassName}\n sublabelWrapperClassName={props.sublabelWrapperClassName}\n afterLabelChildrenClassName={props.afterLabelChildrenClassName}\n >\n {props.children}\n </Label>\n )}\n </>\n );\n};\n"],"mappings":";;;;;;;;;AAwBA,MAAaA,YAAqC,EAAE,UAAU,WAAW,IAAI,SAAS,eAAe,aAAa;CAChH,MAAM,gBAAgB,yBAAoD;AACxE,SACE,iBACA,cAAc,KAAK,cAAc,UAAU;GACzC,MAAM,eAAe,GAAG,OAAO,OAAO,OAAO,aAAa;KACvD,OAAO,uBAAuB,aAAa,SAAS;KACpD,OAAO,uBAAuB,YAAY,YAAY;IACxD,CAAC;AACF,UACE,yBAAyB,aAAa,wBACpC,oBAAC,QAAA;IAAK,WAAW;cACd,aAAa;MADoB,MAE7B;IAGX;;CAIN,MAAM,YAAY,cAAc;CAChC,MAAM,sBAAsB,aAAa,KAAK;AAE9C,QACE,qBAAA,UAAA,EAAA,UAAA;EACE,oBAAC,gBAAA,EAAO,MAAM,OAAA,CAAS;GACrB,aAAa,aACb,qBAAC,OAAA;GAAe;GAAe;GAAI,eAAa;GAAQ,oBAAkB,YAAY;cACnF,WACA,SAAA;IACG;EAEP,uBACC,oBAAC,O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;EACpC,CAAC,GACF,OAAO,MAAM,UAAU,YACrB,oBAAC,eAAA;EACC,YAAY,CAAC;GAAE,MAAM,MAAM;GAAO,MAAM;GAAW,CAAC;EACpD,SAAS,MAAM;EACf,SAAS,MAAM;EACf,YAAY,MAAM,UAAU;EAC5B,gBAAgB,MAAM;EACtB,oBAAoB,MAAM;EAC1B,0BAA0B,MAAM;EAChC,6BAA6B,MAAM;YAElC,MAAM;GACD,EAAA,CAEb"}
package/lib/utils3.js CHANGED
@@ -6,7 +6,7 @@ import { t as useIdWithFallback } from "./useIdWithFallback.js";
6
6
  import { t as getAriaDescribedBy } from "./accessibility.js";
7
7
  import { t as ErrorWrapper_default } from "./ErrorWrapper.js";
8
8
  import { r as renderLabelAsParent, t as getLabelText } from "./utils2.js";
9
- import classNames from "classnames";
9
+ import cn from "classnames";
10
10
  import { useState } from "react";
11
11
  import { jsx } from "react/jsx-runtime";
12
12
  import radioButtonStyles from "./components/RadioButton/styles.module.scss";
@@ -21,14 +21,14 @@ const RadioButton = (props) => {
21
21
  const { refObject, isFocused } = usePseudoClasses(isMutableRefObject(ref) ? ref : null);
22
22
  const mergedRefs = mergeRefs([ref, refObject]);
23
23
  const errorTextId = useIdWithFallback(errorTextIdProp);
24
- const radioButtonWrapperClasses = classNames(radioButtonStyles["radio-button-wrapper"], {
24
+ const radioButtonWrapperClasses = cn(radioButtonStyles["radio-button-wrapper"], {
25
25
  [radioButtonStyles["radio-button-wrapper__large"]]: isLarge,
26
26
  [radioButtonStyles["radio-button-wrapper__large--focused"]]: isLarge && isFocused,
27
27
  [radioButtonStyles["radio-button-wrapper__large--selected"]]: isLarge && checked && isFocused,
28
28
  [radioButtonStyles["radio-button-wrapper__large--invalid"]]: isLarge && onCherry && isFocused,
29
29
  [radioButtonStyles["radio-button-wrapper__large--on-blueberry"]]: isLarge && onBlueberry && isFocused
30
30
  });
31
- const radioButtonLabelClasses = classNames(radioButtonStyles["radio-button-label"], {
31
+ const radioButtonLabelClasses = cn(radioButtonStyles["radio-button-label"], {
32
32
  [radioButtonStyles["radio-button-label--disabled"]]: disabled,
33
33
  [radioButtonStyles["radio-button-label--on-dark"]]: onDark,
34
34
  [radioButtonStyles["radio-button-label--invalid"]]: invalid,
@@ -36,7 +36,7 @@ const RadioButton = (props) => {
36
36
  [radioButtonStyles["radio-button-label__large--focused"]]: isFocused && isLarge,
37
37
  [radioButtonStyles["radio-button-label__large--disabled"]]: isLarge && disabled
38
38
  }, labelClassNames);
39
- const radioButtonClasses = classNames(radioButtonStyles["radio-button"], {
39
+ const radioButtonClasses = cn(radioButtonStyles["radio-button"], {
40
40
  [radioButtonStyles["radio-button--on-dark"]]: onDark,
41
41
  [radioButtonStyles["radio-button--disabled"]]: disabled,
42
42
  [radioButtonStyles["radio-button--on-blueberry"]]: onBlueberry,
@@ -89,7 +89,7 @@ var RadioButton_default = RadioButton;
89
89
  const getRadioLabelClasses = (radioId, onColor, large, checkedRadioId) => {
90
90
  const onCherry = onColor === "oninvalid";
91
91
  const checked = radioId === checkedRadioId;
92
- return classNames({
92
+ return cn({
93
93
  [radioButtonStyles["radio-button-label__large--on-grey"]]: large && onColor === "ongrey" && !checked,
94
94
  [radioButtonStyles["radio-button-label__large--on-blueberry"]]: onColor === "onblueberry" && !checked && large,
95
95
  [radioButtonStyles["radio-button-label__large--selected"]]: large && checked && !onCherry,
package/lib/utils3.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils3.js","names":["RadioButton: React.FC<RadioButtonProps>"],"sources":["../src/components/RadioButton/RadioButton.tsx","../src/components/RadioButton/utils.ts"],"sourcesContent":["import { useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport type { ErrorWrapperClassNameProps } from '../ErrorWrapper';\n\nimport { AnalyticsId, FormOnColor, FormSize } from '../../constants';\nimport { useIdWithFallback } from '../../hooks/useIdWithFallback';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\nimport { getAriaDescribedBy } from '../../utils/accessibility';\nimport { isMutableRefObject, mergeRefs } from '../../utils/refs';\nimport { uuid } from '../../utils/uuid';\nimport ErrorWrapper from '../ErrorWrapper';\nimport { getLabelText, renderLabelAsParent } from '../Label/utils';\n\nimport radioButtonStyles from './styles.module.scss';\n\nexport interface RadioButtonProps\n extends\n ErrorWrapperClassNameProps,\n Pick<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'aria-describedby' | 'name' | 'value' | 'disabled' | 'checked' | 'defaultChecked' | 'required' | 'onChange'\n > {\n /** Adds custom classes to the element. */\n className?: string;\n /** The <Label/> next to the radioButton - sublabels kan ikke kombineres med large variant */\n label: React.ReactNode;\n /** Adds custom classes to the label element. */\n labelClassNames?: string;\n /** input id of the radioButton */\n inputId?: string;\n /** Changes the visuals of the radioButton */\n onColor?: keyof typeof FormOnColor;\n /** Changes the visuals of the radioButton. Large version only works when used inside a FormGroup wrapper. */\n size?: keyof typeof FormSize;\n /** Activates Error style for the radioButton - This is can be true while errorText is empty, when in a FormGroup */\n error?: boolean;\n /** Error text to show above the component */\n errorText?: string;\n /** Error text id */\n errorTextId?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Ref passed to the input element */\n ref?: React.Ref<HTMLInputElement | null>;\n}\n\nexport const RadioButton: React.FC<RadioButtonProps> = props => {\n const {\n className,\n defaultChecked,\n onChange,\n disabled,\n label,\n inputId = uuid(),\n onColor = FormOnColor.onwhite,\n name = inputId,\n size,\n errorText,\n errorTextId: errorTextIdProp,\n error = !!errorText,\n errorWrapperClassName,\n value = getLabelText(label),\n testId,\n required,\n labelClassNames,\n ref,\n ...rest\n } = props;\n const invalid = error || onColor === FormOnColor.oninvalid;\n const onDark = onColor === FormOnColor.ondark;\n const onBlueberry = onColor === FormOnColor.onblueberry;\n const onCherry = onColor === FormOnColor.oninvalid;\n const isLarge = size === FormSize.large;\n const [checked, changeChecked] = useState<boolean>();\n const { refObject, isFocused } = usePseudoClasses<HTMLInputElement>(isMutableRefObject(ref) ? ref : null);\n const mergedRefs = mergeRefs([ref, refObject]);\n const errorTextId = useIdWithFallback(errorTextIdProp);\n\n const radioButtonWrapperClasses = classNames(radioButtonStyles['radio-button-wrapper'], {\n [radioButtonStyles['radio-button-wrapper__large']]: isLarge,\n [radioButtonStyles['radio-button-wrapper__large--focused']]: isLarge && isFocused,\n [radioButtonStyles['radio-button-wrapper__large--selected']]: isLarge && checked && isFocused,\n [radioButtonStyles['radio-button-wrapper__large--invalid']]: isLarge && onCherry && isFocused,\n [radioButtonStyles['radio-button-wrapper__large--on-blueberry']]: isLarge && onBlueberry && isFocused,\n });\n const radioButtonLabelClasses = classNames(\n radioButtonStyles['radio-button-label'],\n {\n [radioButtonStyles['radio-button-label--disabled']]: disabled,\n [radioButtonStyles['radio-button-label--on-dark']]: onDark,\n [radioButtonStyles['radio-button-label--invalid']]: invalid,\n [radioButtonStyles['radio-button-label__large']]: isLarge,\n [radioButtonStyles['radio-button-label__large--focused']]: isFocused && isLarge,\n [radioButtonStyles['radio-button-label__large--disabled']]: isLarge && disabled,\n },\n labelClassNames\n );\n const radioButtonClasses = classNames(\n radioButtonStyles['radio-button'],\n {\n [radioButtonStyles['radio-button--on-dark']]: onDark,\n [radioButtonStyles['radio-button--disabled']]: disabled,\n [radioButtonStyles['radio-button--on-blueberry']]: onBlueberry,\n [radioButtonStyles['radio-button--invalid']]: invalid,\n [radioButtonStyles['radio-button__large']]: isLarge,\n [radioButtonStyles['radio-button__large--disabled']]: isLarge && disabled,\n [radioButtonStyles['radio-button__large--invalid']]: isLarge && invalid,\n },\n className\n );\n\n const change = (e: React.ChangeEvent<HTMLInputElement>): void => {\n changeChecked(e.target.checked);\n if (onChange) onChange(e);\n };\n\n const getLabelContent = (): React.ReactNode => (\n <input\n {...rest}\n id={inputId}\n name={name}\n className={radioButtonClasses}\n type=\"radio\"\n disabled={disabled}\n value={value}\n ref={mergedRefs}\n defaultChecked={defaultChecked}\n aria-describedby={getAriaDescribedBy(props, errorTextId)}\n required={required}\n onChange={(e): void => change(e)}\n />\n );\n\n return (\n <ErrorWrapper className={errorWrapperClassName} errorText={errorText} errorTextId={errorTextId}>\n <div data-testid={testId} data-analyticsid={AnalyticsId.RadioButton} className={radioButtonWrapperClasses}>\n {renderLabelAsParent({\n label: label,\n children: getLabelContent(),\n inputId: inputId,\n onColor: onColor as FormOnColor,\n labelClassName: radioButtonLabelClasses,\n sublabelWrapperClassName: radioButtonStyles['radiobutton-sublabel-wrapper'],\n large: isLarge,\n afterLabelChildrenClassName: radioButtonStyles['radiobutton-afterlabelchildren-wrapper'],\n })}\n </div>\n </ErrorWrapper>\n );\n};\n\nRadioButton.displayName = 'RadioButton';\n\nexport default RadioButton;\n","import classNames from 'classnames';\n\nimport type { FormOnColor } from '../../constants';\n\nimport radioButtonStyles from './styles.module.scss';\n\nexport const getRadioLabelClasses = (\n radioId: string,\n onColor: FormOnColor,\n large: boolean,\n checkedRadioId?: string\n): string | undefined => {\n const onCherry = onColor === 'oninvalid';\n const checked = radioId === checkedRadioId;\n\n return classNames({\n [radioButtonStyles['radio-button-label__large--on-grey']]: large && onColor === 'ongrey' && !checked,\n [radioButtonStyles['radio-button-label__large--on-blueberry']]: onColor === 'onblueberry' && !checked && large,\n [radioButtonStyles['radio-button-label__large--selected']]: large && checked && !onCherry,\n [radioButtonStyles['radio-button-label__large--selected-invalid']]: large && checked && onCherry,\n });\n};\n"],"mappings":";;;;;;;;;;;;AAgDA,MAAaA,eAA0C,UAAS;CAC9D,MAAM,EACJ,WACA,gBACA,UACA,UACA,OACA,UAAU,MAAM,EAChB,UAAU,YAAY,SACtB,OAAO,SACP,MACA,WACA,aAAa,iBACb,QAAQ,CAAC,CAAC,WACV,uBACA,QAAQ,aAAa,MAAM,EAC3B,QACA,UACA,iBACA,KACA,GAAG,SACD;CACJ,MAAM,UAAU,SAAS,YAAY,YAAY;CACjD,MAAM,SAAS,YAAY,YAAY;CACvC,MAAM,cAAc,YAAY,YAAY;CAC5C,MAAM,WAAW,YAAY,YAAY;CACzC,MAAM,UAAU,SAAS,SAAS;CAClC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AAW;aAC7E,oBAAoB;IACZ;IACP,UAAU,iBAAiB;IAClB;IACA;IACT,gBAAgB;IAChB,0BAA0B,kBAAkB;IAC5C,OAAO;IACP,6BAA6B,kBAAkB;IAChD,CAAC;IACE;GACO;;AAInB,YAAY,cAAc;AAE1B,IAAA,sBAAe;ACrJf,MAAa,wBACX,SACA,SACA,OACA,mBACuB;CACvB,MAAM,WAAW,YAAY;CAC7B,MAAM,UAAU,YAAY;AAE5B,QAAO,WAAW;GACf,kBAAkB,wCAAwC,SAAS,YAAY,YAAY,CAAC;GAC5F,kBAAkB,6CAA6C,YAAY,iBAAiB,CAAC,WAAW;GACxG,kBAAkB,yCAAyC,SAAS,WAAW,CAAC;GAChF,kBAAkB,iDAAiD,SAAS,WAAW;EACzF,CAAC"}
1
+ {"version":3,"file":"utils3.js","names":["RadioButton: React.FC<RadioButtonProps>"],"sources":["../src/components/RadioButton/RadioButton.tsx","../src/components/RadioButton/utils.ts"],"sourcesContent":["import { useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport type { ErrorWrapperClassNameProps } from '../ErrorWrapper';\n\nimport { AnalyticsId, FormOnColor, FormSize } from '../../constants';\nimport { useIdWithFallback } from '../../hooks/useIdWithFallback';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\nimport { getAriaDescribedBy } from '../../utils/accessibility';\nimport { isMutableRefObject, mergeRefs } from '../../utils/refs';\nimport { uuid } from '../../utils/uuid';\nimport ErrorWrapper from '../ErrorWrapper';\nimport { getLabelText, renderLabelAsParent } from '../Label/utils';\n\nimport radioButtonStyles from './styles.module.scss';\n\nexport interface RadioButtonProps\n extends\n ErrorWrapperClassNameProps,\n Pick<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'aria-describedby' | 'name' | 'value' | 'disabled' | 'checked' | 'defaultChecked' | 'required' | 'onChange'\n > {\n /** Adds custom classes to the element. */\n className?: string;\n /** The <Label/> next to the radioButton - sublabels kan ikke kombineres med large variant */\n label: React.ReactNode;\n /** Adds custom classes to the label element. */\n labelClassNames?: string;\n /** input id of the radioButton */\n inputId?: string;\n /** Changes the visuals of the radioButton */\n onColor?: keyof typeof FormOnColor;\n /** Changes the visuals of the radioButton. Large version only works when used inside a FormGroup wrapper. */\n size?: keyof typeof FormSize;\n /** Activates Error style for the radioButton - This is can be true while errorText is empty, when in a FormGroup */\n error?: boolean;\n /** Error text to show above the component */\n errorText?: string;\n /** Error text id */\n errorTextId?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Ref passed to the input element */\n ref?: React.Ref<HTMLInputElement | null>;\n}\n\nexport const RadioButton: React.FC<RadioButtonProps> = props => {\n const {\n className,\n defaultChecked,\n onChange,\n disabled,\n label,\n inputId = uuid(),\n onColor = FormOnColor.onwhite,\n name = inputId,\n size,\n errorText,\n errorTextId: errorTextIdProp,\n error = !!errorText,\n errorWrapperClassName,\n value = getLabelText(label),\n testId,\n required,\n labelClassNames,\n ref,\n ...rest\n } = props;\n const invalid = error || onColor === FormOnColor.oninvalid;\n const onDark = onColor === FormOnColor.ondark;\n const onBlueberry = onColor === FormOnColor.onblueberry;\n const onCherry = onColor === FormOnColor.oninvalid;\n const isLarge = size === FormSize.large;\n const [checked, changeChecked] = useState<boolean>();\n const { refObject, isFocused } = usePseudoClasses<HTMLInputElement>(isMutableRefObject(ref) ? ref : null);\n const mergedRefs = mergeRefs([ref, refObject]);\n const errorTextId = useIdWithFallback(errorTextIdProp);\n\n const radioButtonWrapperClasses = classNames(radioButtonStyles['radio-button-wrapper'], {\n [radioButtonStyles['radio-button-wrapper__large']]: isLarge,\n [radioButtonStyles['radio-button-wrapper__large--focused']]: isLarge && isFocused,\n [radioButtonStyles['radio-button-wrapper__large--selected']]: isLarge && checked && isFocused,\n [radioButtonStyles['radio-button-wrapper__large--invalid']]: isLarge && onCherry && isFocused,\n [radioButtonStyles['radio-button-wrapper__large--on-blueberry']]: isLarge && onBlueberry && isFocused,\n });\n const radioButtonLabelClasses = classNames(\n radioButtonStyles['radio-button-label'],\n {\n [radioButtonStyles['radio-button-label--disabled']]: disabled,\n [radioButtonStyles['radio-button-label--on-dark']]: onDark,\n [radioButtonStyles['radio-button-label--invalid']]: invalid,\n [radioButtonStyles['radio-button-label__large']]: isLarge,\n [radioButtonStyles['radio-button-label__large--focused']]: isFocused && isLarge,\n [radioButtonStyles['radio-button-label__large--disabled']]: isLarge && disabled,\n },\n labelClassNames\n );\n const radioButtonClasses = classNames(\n radioButtonStyles['radio-button'],\n {\n [radioButtonStyles['radio-button--on-dark']]: onDark,\n [radioButtonStyles['radio-button--disabled']]: disabled,\n [radioButtonStyles['radio-button--on-blueberry']]: onBlueberry,\n [radioButtonStyles['radio-button--invalid']]: invalid,\n [radioButtonStyles['radio-button__large']]: isLarge,\n [radioButtonStyles['radio-button__large--disabled']]: isLarge && disabled,\n [radioButtonStyles['radio-button__large--invalid']]: isLarge && invalid,\n },\n className\n );\n\n const change = (e: React.ChangeEvent<HTMLInputElement>): void => {\n changeChecked(e.target.checked);\n if (onChange) onChange(e);\n };\n\n const getLabelContent = (): React.ReactNode => (\n <input\n {...rest}\n id={inputId}\n name={name}\n className={radioButtonClasses}\n type=\"radio\"\n disabled={disabled}\n value={value}\n ref={mergedRefs}\n defaultChecked={defaultChecked}\n aria-describedby={getAriaDescribedBy(props, errorTextId)}\n required={required}\n onChange={(e): void => change(e)}\n />\n );\n\n return (\n <ErrorWrapper className={errorWrapperClassName} errorText={errorText} errorTextId={errorTextId}>\n <div data-testid={testId} data-analyticsid={AnalyticsId.RadioButton} className={radioButtonWrapperClasses}>\n {renderLabelAsParent({\n label: label,\n children: getLabelContent(),\n inputId: inputId,\n onColor: onColor as FormOnColor,\n labelClassName: radioButtonLabelClasses,\n sublabelWrapperClassName: radioButtonStyles['radiobutton-sublabel-wrapper'],\n large: isLarge,\n afterLabelChildrenClassName: radioButtonStyles['radiobutton-afterlabelchildren-wrapper'],\n })}\n </div>\n </ErrorWrapper>\n );\n};\n\nRadioButton.displayName = 'RadioButton';\n\nexport default RadioButton;\n","import classNames from 'classnames';\n\nimport type { FormOnColor } from '../../constants';\n\nimport radioButtonStyles from './styles.module.scss';\n\nexport const getRadioLabelClasses = (\n radioId: string,\n onColor: FormOnColor,\n large: boolean,\n checkedRadioId?: string\n): string | undefined => {\n const onCherry = onColor === 'oninvalid';\n const checked = radioId === checkedRadioId;\n\n return classNames({\n [radioButtonStyles['radio-button-label__large--on-grey']]: large && onColor === 'ongrey' && !checked,\n [radioButtonStyles['radio-button-label__large--on-blueberry']]: onColor === 'onblueberry' && !checked && large,\n [radioButtonStyles['radio-button-label__large--selected']]: large && checked && !onCherry,\n [radioButtonStyles['radio-button-label__large--selected-invalid']]: large && checked && onCherry,\n });\n};\n"],"mappings":";;;;;;;;;;;;AAgDA,MAAaA,eAA0C,UAAS;CAC9D,MAAM,EACJ,WACA,gBACA,UACA,UACA,OACA,UAAU,MAAM,EAChB,UAAU,YAAY,SACtB,OAAO,SACP,MACA,WACA,aAAa,iBACb,QAAQ,CAAC,CAAC,WACV,uBACA,QAAQ,aAAa,MAAM,EAC3B,QACA,UACA,iBACA,KACA,GAAG,SACD;CACJ,MAAM,UAAU,SAAS,YAAY,YAAY;CACjD,MAAM,SAAS,YAAY,YAAY;CACvC,MAAM,cAAc,YAAY,YAAY;CAC5C,MAAM,WAAW,YAAY,YAAY;CACzC,MAAM,UAAU,SAAS,SAAS;CAClC,MAAM,CAAC,SAAS,iBAAiB,UAAmB;CACpD,MAAM,EAAE,WAAW,cAAc,iBAAmC,mBAAmB,IAAI,GAAG,MAAM,KAAK;CACzG,MAAM,aAAa,UAAU,CAAC,KAAK,UAAU,CAAC;CAC9C,MAAM,cAAc,kBAAkB,gBAAgB;CAEtD,MAAM,4BAA4B,GAAW,kBAAkB,yBAAyB;GACrF,kBAAkB,iCAAiC;GACnD,kBAAkB,0CAA0C,WAAW;GACvE,kBAAkB,2CAA2C,WAAW,WAAW;GACnF,kBAAkB,0CAA0C,WAAW,YAAY;GACnF,kBAAkB,+CAA+C,WAAW,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AC,WAAW;GACxG,kBAAkB,yCAAyC,SAAS,WAAW,CAAC;GAChF,kBAAkB,iDAAiD,SAAS,WAAW;EACzF,CAAC"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@helsenorge/designsystem-react",
3
3
  "sideEffects": false,
4
4
  "private": false,
5
- "version": "14.6.0",
5
+ "version": "14.7.1",
6
6
  "description": "The official design system for Helsenorge built with React.",
7
7
  "repository": {
8
8
  "type": "git",
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["Chip: React.FC<ChipProps>","mergedResources: HNDesignsystemChip"],"sources":["../../../src/resources/HN.Designsystem.Chip.en-GB.json","../../../src/resources/HN.Designsystem.Chip.nb-NO.json","../../../src/components/Chip/resourceHelper.ts","../../../src/components/Chip/Chip.tsx","../../../src/components/Chip/index.ts"],"sourcesContent":["{\n \"removeAriaLabel\": \"Remove\"\n}\n","{\n \"removeAriaLabel\": \"Fjern\"\n}\n","import type { HNDesignsystemChip } from '../../resources/Resources';\n\nimport { LanguageLocales } from '../../constants';\nimport enGB from '../../resources/HN.Designsystem.Chip.en-GB.json';\nimport nbNO from '../../resources/HN.Designsystem.Chip.nb-NO.json';\n\nexport const getResources = (language: LanguageLocales): HNDesignsystemChip => {\n switch (language) {\n case LanguageLocales.ENGLISH:\n return enGB;\n case LanguageLocales.NORWEGIAN:\n default:\n return nbNO;\n }\n};\n","import classNames from 'classnames';\n\nimport type { HNDesignsystemChip } from '../../resources/Resources';\n\nimport { getResources } from './resourceHelper';\nimport { AnalyticsId, LanguageLocales } from '../../constants';\nimport { useLanguage } from '../../hooks/useLanguage';\nimport Icon, { IconSize } from '../Icon';\nimport X from '../Icons/X';\n\nimport styles from './styles.module.scss';\n\nexport interface ChipProps {\n /** @deprecated Called when action is set and the chip is clicked on. action must also be set. */\n onClick?: () => void;\n /** Sets the text of the chip */\n children: string;\n /** Wether or not to have a close button */\n withCloseButton?: boolean;\n /** onClick handler for text-part of the chip */\n onChipClick?: () => void;\n /** Button props for main chip button */\n chipButtonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;\n /** onClick handler for close button */\n onCloseClick?: () => void;\n /** Button props for the close button */\n closeButtonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;\n /** Sets the data-testid attribute on the expander button. */\n testId?: string;\n /** Resources for the component */\n resources?: Partial<HNDesignsystemChip>;\n}\n\nconst Chip: React.FC<ChipProps> = props => {\n const {\n onClick,\n children,\n onChipClick,\n onCloseClick,\n chipButtonProps,\n closeButtonProps,\n testId,\n withCloseButton = true,\n resources,\n } = props;\n const { language } = useLanguage<LanguageLocales>(LanguageLocales.NORWEGIAN);\n const defaultResources = getResources(language);\n const mergedResources: HNDesignsystemChip = {\n ...defaultResources,\n ...resources,\n removeAriaLabel: closeButtonProps?.['aria-label'] || resources?.removeAriaLabel || `${defaultResources.removeAriaLabel} ${children}`,\n };\n\n return (\n <div className={styles['chip']}>\n <button\n {...chipButtonProps}\n className={classNames(styles['chip__chip'])}\n onClick={onClick ? onClick : onChipClick}\n type=\"button\"\n data-testid={testId}\n data-analyticsid={AnalyticsId.Tag}\n >\n <span\n className={classNames(styles['chip__chip__inner'], {\n [styles['chip__chip__inner--without-close']]: !withCloseButton,\n })}\n >\n {children}\n </span>\n </button>\n {withCloseButton && (\n <button\n {...closeButtonProps}\n aria-label={mergedResources.removeAriaLabel}\n className={classNames(styles['chip__close'])}\n onClick={onClick ? onClick : onCloseClick}\n type=\"button\"\n data-testid={`${testId}-close`}\n data-analyticsid={AnalyticsId.Tag}\n >\n <span className={styles['chip__close__inner']}>\n <Icon svgIcon={X} size={IconSize.XXSmall} />\n </span>\n </button>\n )}\n </div>\n );\n};\n\nexport default Chip;\n","import Chip from './Chip';\nexport * from './Chip';\nexport default Chip;\n"],"mappings":";;;;;;;;;AEMA,MAAa,gBAAgB,aAAkD;AAC7E,SAAQ,UAAR;EACE,KAAK,gBAAgB,QACnB,QAAO;EACT,KAAK,gBAAgB;EACrB,QACE,QAAO;;;ACqBb,IAAMA,QAA4B,UAAS;CACzC,MAAM,EACJ,SACA,UACA,aACA,cACA,iBACA,kBACA,QACA,kBAAkB,MAClB,cACE;CACJ,MAAM,EAAE,aAAa,YAA6B,gBAAgB,UAAU;CAC5E,MAAM,mBAAmB,aAAa,SAAS;CAC/C,MAAMC,kBAAsC;EAC1C,GAAG;EACH,GAAG;EACH,iBAAiB,mBAAmB,iBAAiB,WAAW,mBAAmB,GAAG,iBAAiB,gBAAgB,GAAG;EAC3H;AAED,QACE,qBAAC,OAAA;EAAI,WAAW,OAAO;aACrB,oBAAC,UAAA;GACC,GAAI;GACJ,WAAW,WAAW,OAAO,cAAc;GAC3C,SAAS,UAAU,UAAU;GAC7B,MAAK;GACL,eAAa;GACb,oBAAkB,YAAY;aAE9B,oBAAC,QAAA;IACC,WAAW,WAAW,OAAO,sBAAsB,GAChD,OAAO,sCAAsC,CAAC,iBAChD,CAAC;IAED;KACI;IACA,EACR,mBACC,oBAAC,UAAA;GACC,GAAI;GACJ,cAAY,gBAAgB;GAC5B,WAAW,WAAW,OAAO,eAAe;GAC5C,SAAS,UAAU,UAAU;GAC7B,MAAK;GACL,eAAa,GAAG,OAAO;GACvB,oBAAkB,YAAY;aAE9B,oBAAC,QAAA;IAAK,WAAW,OAAO;cACtB,oBAAC,cAAA;KAAK,SAAS;KAAG,MAAM,SAAS;MAAW;KACvC;IACA,CAAA;GAEP;;ACpFV,IAAA,eDwFe"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Filter.js","names":["Filter: React.FC<SvgPathProps>"],"sources":["../../../src/components/Icons/Filter.tsx"],"sourcesContent":["import type { SvgPathProps } from '../Icon';\n\nimport { getIcon } from '../Icon/utils';\n\nconst Filter: React.FC<SvgPathProps> = ({ size, isHovered }: SvgPathProps): React.ReactElement => {\n const normal = (\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M21.034 30.338a4 4 0 0 1 3.926 3.234H41v1.3H24.998a4 4 0 0 1-7.94-.1H7v-1.2h10.108a4 4 0 0 1 3.926-3.234Zm0 1.3a2.7 2.7 0 1 0 .001 5.4 2.7 2.7 0 0 0 0-5.4ZM32.697 20a4 4 0 0 1 3.936 3.286H41v1.3h-4.346a4 4 0 0 1-7.914 0H7v-1.3h21.762A4 4 0 0 1 32.697 20Zm0 1.3a2.7 2.7 0 1 0 0 5.4 2.7 2.7 0 0 0 0-5.4ZM16.571 9.726A4 4 0 0 1 20.505 13H41v1.3H20.53a4 4 0 0 1-7.917 0H7V13h5.638a4 4 0 0 1 3.933-3.274Zm0 1.3a2.7 2.7 0 1 0 0 5.4 2.7 2.7 0 0 0 0-5.4Z\"\n />\n );\n\n const normalHover = (\n <>\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M17.0332 30.3389C18.9803 30.3389 20.6015 31.7297 20.959 33.5723H40.999V34.8721H20.9971C20.7361 36.8288 19.0613 38.3389 17.0332 38.3389C15.0051 38.3389 13.3303 36.8288 13.0693 34.8721H6.99902V33.5723H13.1074C13.4649 31.7297 15.0861 30.3389 17.0332 30.3389ZM17.0332 31.6387C15.542 31.6387 14.333 32.8477 14.333 34.3389C14.3333 35.8298 15.5422 37.0391 17.0332 37.0391C18.5242 37.0391 19.7331 35.8298 19.7334 34.3389C19.7334 32.8477 18.5244 31.6387 17.0332 31.6387Z\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M32.6963 20C34.6617 20 36.2952 21.4177 36.6318 23.2861H40.999V24.5859H36.6533C36.3698 26.5173 34.7064 28 32.6963 28C30.6862 28 29.0228 26.5173 28.7393 24.5859H6.99902V23.2861H28.7607C29.0974 21.4177 30.7309 20 32.6963 20ZM32.6963 21.2998C31.2051 21.2998 29.9961 22.5088 29.9961 24C29.9961 25.4912 31.2051 26.7002 32.6963 26.7002C34.1875 26.7002 35.3965 25.4912 35.3965 24C35.3965 22.5088 34.1875 21.2998 32.6963 21.2998Z\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M19.5703 9.72461C21.5318 9.72461 23.1627 11.1371 23.5039 13H40.999V14.2998H23.5283C23.2496 16.2366 21.5843 17.7256 19.5703 17.7256C17.5564 17.7256 15.891 16.2366 15.6123 14.2998H6.99902V13H15.6367C15.9779 11.1371 17.6088 9.72461 19.5703 9.72461ZM19.5703 11.0254C18.0791 11.0254 16.8701 12.2344 16.8701 13.7256C16.8704 15.2165 18.0793 16.4258 19.5703 16.4258C21.0613 16.4258 22.2702 15.2165 22.2705 13.7256C22.2705 12.2344 21.0615 11.0254 19.5703 11.0254Z\"\n />\n </>\n );\n\n const xSmall = (\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M22.111 27.892a2.974 2.974 0 0 1 2.905 2.342h11.935v1.264H25.015a2.973 2.973 0 0 1-2.904 2.34l-.303-.015a2.973 2.973 0 0 1-2.6-2.325H11.68v-1.264h7.529a2.973 2.973 0 0 1 2.903-2.342Zm0 1.263a1.71 1.71 0 1 0 .001 3.42 1.71 1.71 0 0 0 0-3.42Zm8.669-8.229a2.974 2.974 0 0 1 2.904 2.343h3.267v1.263h-3.268a2.973 2.973 0 0 1-2.904 2.341l-.303-.016a2.973 2.973 0 0 1-2.599-2.325H11.679v-1.263h16.197a2.973 2.973 0 0 1 2.903-2.343Zm0 1.263a1.71 1.71 0 1 0 0 3.421 1.71 1.71 0 0 0 0-3.42Zm-11.987-8.295a2.974 2.974 0 0 1 2.905 2.34h15.253v1.264H21.697a2.973 2.973 0 0 1-2.904 2.342l-.303-.015a2.973 2.973 0 0 1-2.6-2.327h-4.21v-1.263h4.21a2.973 2.973 0 0 1 2.903-2.341Zm0 1.263a1.71 1.71 0 1 0 .001 3.42 1.71 1.71 0 0 0 0-3.42Z\"\n />\n );\n\n const xSmallHover = (\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M19.585 27.892a2.975 2.975 0 0 1 2.906 2.342h14.46v1.264H22.489a2.973 2.973 0 0 1-2.904 2.34l-.303-.015a2.974 2.974 0 0 1-2.6-2.327h-5.003v-1.263h5.001a2.974 2.974 0 0 1 2.905-2.341Zm0 1.263a1.71 1.71 0 1 0 0 3.42 1.71 1.71 0 0 0 0-3.42Zm11.195-8.229a2.974 2.974 0 0 1 2.904 2.343h3.267v1.263h-3.268a2.973 2.973 0 0 1-2.904 2.341l-.303-.016a2.973 2.973 0 0 1-2.599-2.325H11.679v-1.263h16.197a2.973 2.973 0 0 1 2.903-2.343Zm0 1.263a1.71 1.71 0 1 0 0 3.421 1.71 1.71 0 0 0 0-3.42Zm-9.46-8.295a2.974 2.974 0 0 1 2.904 2.34h12.727v1.264H24.223a2.973 2.973 0 0 1-2.904 2.342l-.303-.015a2.973 2.973 0 0 1-2.6-2.327H11.68v-1.263h6.737a2.973 2.973 0 0 1 2.903-2.341Zm0 1.263a1.71 1.71 0 1 0 0 3.42 1.71 1.71 0 0 0 0-3.42Z\"\n />\n );\n\n return getIcon({ size, isHovered, normal, normalHover, xSmall, xSmallHover });\n};\n\nexport default Filter;\n"],"mappings":";;AAIA,IAAMA,UAAkC,EAAE,MAAM,gBAAkD;AA6ChG,QAAO,QAAQ;EAAE;EAAM;EAAW,QA3ChC,oBAAC,QAAA;GACC,aAAU;GACV,aAAU;GACV,GAAE;IACF;EAuCsC,aAnCxC,qBAAA,UAAA,EAAA,UAAA;GACE,oBAAC,QAAA;IACC,aAAU;IACV,aAAU;IACV,GAAE;KACF;GACF,oBAAC,QAAA;IACC,aAAU;IACV,aAAU;IACV,GAAE;KACF;GACF,oBAAC,QAAA;IACC,aAAU;IACV,aAAU;IACV,GAAE;KACF;MACD;EAmBkD,QAfrD,oBAAC,QAAA;GACC,aAAU;GACV,aAAU;GACV,GAAE;IACF;EAW2D,aAP7D,oBAAC,QAAA;GACC,aAAU;GACV,aAAU;GACV,GAAE;IACF;EAGwE,CAAC;;AAG/E,IAAA,iBAAe"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Search.js","names":["Search: React.FC<SvgPathProps>"],"sources":["../../../src/components/Icons/Search.tsx"],"sourcesContent":["import type { SvgPathProps } from '../Icon';\n\nimport { getIcon } from '../Icon/utils';\n\nconst Search: React.FC<SvgPathProps> = ({ size, isHovered }: SvgPathProps): React.ReactElement => {\n const normal = (\n <path d=\"M21.277 7.738c7.27 0 13.165 5.895 13.165 13.166 0 2.222-.55 4.316-1.523 6.153l6.268 6.268a3.929 3.929 0 01-5.41 5.695l-.146-.139-6.289-6.289a13.11 13.11 0 01-6.065 1.478c-7.272 0-13.166-5.895-13.166-13.166 0-7.271 5.894-13.166 13.166-13.166zM32 28.542a13.24 13.24 0 01-3.164 3.142l5.996 5.995a2.229 2.229 0 003.26-3.036l-.108-.116zM21.277 9.438c-6.333 0-11.466 5.133-11.466 11.466 0 6.332 5.133 11.466 11.466 11.466 2.258 0 4.365-.654 6.14-1.781l.163-.163.034.035a11.529 11.529 0 003.165-3.14l-.047-.048.228-.226a11.412 11.412 0 001.782-6.143c0-6.333-5.133-11.466-11.465-11.466z\" />\n );\n\n const normalHover = (\n <path d=\"M21.527 6.932c7.932 0 14.363 6.43 14.363 14.362 0 2.556-.668 4.956-1.838 7.035l5.386 5.386a3.929 3.929 0 01-5.41 5.696l-.146-.14-5.406-5.404a14.298 14.298 0 01-6.949 1.79c-7.932 0-14.362-6.43-14.362-14.363 0-7.932 6.43-14.362 14.362-14.362zM33.11 29.79a14.445 14.445 0 01-3.162 3.141l5.137 5.138a2.229 2.229 0 003.26-3.035l-.108-.117zM21.527 8.632c-6.993 0-12.662 5.669-12.662 12.662 0 6.993 5.669 12.663 12.662 12.663 6.993 0 12.663-5.67 12.663-12.663S28.52 8.632 21.527 8.632z\" />\n );\n\n const xSmall = (\n <path d=\"M34.476 34.206c-.486.487-1.333.487-1.82 0l-4.402-4.403a10.426 10.426 0 001.78-1.857l4.442 4.44c.243.243.376.567.376.91 0 .345-.133.668-.376.91M21.742 30.07c-4.592 0-8.327-3.737-8.327-8.327 0-4.592 3.735-8.327 8.327-8.327 4.591 0 8.327 3.735 8.327 8.327 0 4.59-3.736 8.327-8.327 8.327m14.181.871l-4.8-4.8c.63-1.338.991-2.825.991-4.398 0-5.72-4.653-10.374-10.372-10.374-5.72 0-10.374 4.653-10.374 10.374 0 5.72 4.653 10.372 10.374 10.372 1.717 0 3.333-.426 4.76-1.168l4.708 4.708a3.312 3.312 0 002.357.976c.89 0 1.727-.348 2.356-.976a3.339 3.339 0 000-4.714\" />\n );\n\n const xSmallHover = (\n <path d=\"M34.7 34.43c-.486.485-1.338.487-1.823 0l-3.388-3.39c.663-.55 1.255-1.18 1.785-1.859l3.426 3.424c.244.242.377.567.377.911 0 .346-.133.669-.377.914m-12.76-2.994c-5.238 0-9.5-4.26-9.5-9.499 0-5.238 4.262-9.499 9.5-9.499 5.237 0 9.498 4.261 9.498 9.5 0 5.237-4.26 9.498-9.499 9.498m14.21-.28l-3.734-3.736a11.744 11.744 0 001.356-5.483c0-6.524-5.31-11.832-11.832-11.832-6.524 0-11.834 5.308-11.834 11.832 0 6.525 5.31 11.834 11.834 11.834 2.12 0 4.108-.57 5.831-1.55l3.656 3.658c.633.63 1.47.979 2.362.979.893 0 1.732-.348 2.36-.98.632-.63.98-1.467.98-2.362 0-.89-.348-1.73-.98-2.36\" />\n );\n\n const xxSmall = (\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M20.1738 6.88672C27.4533 6.88672 33.3765 12.8075 33.377 20.0879C33.377 22.0407 32.934 23.8871 32.1699 25.5547L38.0918 31.4785C39.7973 33.1852 39.7973 35.9613 38.0918 37.668C37.2652 38.4933 36.1671 38.9509 34.998 38.9512C33.8287 38.9512 32.7281 38.4937 31.9023 37.668L26.1016 31.8672C24.3175 32.7694 22.3071 33.291 20.1738 33.291C12.8934 33.2906 6.97266 27.3673 6.97266 20.0879C6.97311 12.8077 12.8937 6.88717 20.1738 6.88672ZM33.9766 35.8223C34.0595 35.8891 34.1486 35.9464 34.2422 35.9941L34.1055 35.9141C34.0613 35.8856 34.0179 35.8555 33.9766 35.8223ZM30.5879 28.166C30.0088 28.9128 29.3558 29.5973 28.6309 30.2051L34 35.5742C34.5316 36.105 35.4668 36.1054 35.998 35.5742C36.2647 35.3076 36.4102 34.9522 36.4102 34.5742C36.4099 34.1967 36.264 33.8424 35.998 33.5762L30.5879 28.166ZM12.3984 30.5039C12.4725 30.5593 12.5498 30.6102 12.625 30.6641C12.3803 30.4889 12.1399 30.3085 11.9082 30.1172L12.3984 30.5039ZM20.1758 9.85156C14.5314 9.85197 9.93993 14.4435 9.93945 20.0879C9.93945 25.7316 14.5311 30.3258 20.1758 30.3262C25.8208 30.3262 30.4141 25.7318 30.4141 20.0879C30.4136 14.4432 25.8205 9.85156 20.1758 9.85156ZM24.2363 29.7051C24.392 29.6391 24.5456 29.5693 24.6973 29.4961C24.3933 29.6428 24.0811 29.7753 23.7617 29.8926L24.2363 29.7051ZM30.4199 18.0801C30.5472 18.7301 30.6152 19.4012 30.6152 20.0879L30.6016 19.5527C30.5761 19.0518 30.5139 18.5601 30.4199 18.0801ZM30.5898 12.3145C30.6024 12.3312 30.6145 12.3484 30.627 12.3652C30.4902 12.1806 30.3492 11.9993 30.2031 11.8223L30.5898 12.3145ZM23.2754 10.1211C24.0922 10.3756 24.8663 10.7276 25.584 11.1641L25.1484 10.9121C24.5564 10.59 23.9293 10.3248 23.2754 10.1211Z\"\n />\n );\n\n const xxSmallHover = (\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M20.0664 5.13281C28.324 5.13306 35.0464 11.8511 35.0469 20.1113C35.0469 22.5634 34.442 24.8729 33.3926 26.918L37.957 31.4863C38.7823 32.3116 39.2383 33.4111 39.2383 34.5762C39.2382 35.7464 38.7821 36.8427 37.957 37.668C37.1342 38.4934 36.0347 38.9492 34.8672 38.9492C33.6999 38.9491 32.6029 38.4943 31.7754 37.6699L27.3105 33.2031C25.1607 34.3979 22.6954 35.0956 20.0664 35.0957C11.806 35.0954 5.08398 28.3719 5.08398 20.1113C5.08443 11.8511 11.8063 5.13314 20.0664 5.13281ZM31.7402 29.459C31.1525 30.1928 30.5023 30.8761 29.7871 31.4902L33.8711 35.5762C34.3983 36.1051 35.3349 36.1032 35.8633 35.5762C36.1311 35.3083 36.2772 34.9554 36.2773 34.5762C36.2773 34.1993 36.132 33.8448 35.8652 33.5801L31.7402 29.459ZM26.5273 33.3926C25.4214 33.9344 24.2397 34.3442 23.002 34.5977C23.3028 34.5361 23.6006 34.4664 23.8945 34.3867C25.1149 34.0558 26.2734 33.5714 27.3496 32.959C27.0807 33.112 26.8062 33.256 26.5273 33.3926ZM38.0957 31.9355C38.3575 32.2543 38.5693 32.6057 38.7246 32.9805C38.5174 32.4804 38.2105 32.0211 37.8164 31.627L38.0957 31.9355ZM20.0664 8.44531C13.6343 8.44564 8.40039 13.6791 8.40039 20.1113C8.40058 26.5434 13.6344 31.777 20.0664 31.7773C26.4984 31.777 31.7322 26.5434 31.7324 20.1113C31.7324 13.6791 26.4985 8.44568 20.0664 8.44531ZM17.6777 8.48633C16.327 8.76346 15.0598 9.27215 13.918 9.9668C14.7339 9.47055 15.6142 9.07065 16.543 8.78125C16.9139 8.66566 17.2923 8.56542 17.6777 8.48633ZM22.4551 8.48828C22.6482 8.52791 22.8397 8.57217 23.0293 8.62109C22.6501 8.52325 22.2639 8.443 21.8711 8.38281L22.4551 8.48828ZM20.0664 8.24609C19.6577 8.24609 19.2537 8.2661 18.8555 8.30664L19.457 8.26172C19.6589 8.25145 19.862 8.2461 20.0664 8.24609Z\"\n />\n );\n\n return getIcon({ size, isHovered, normal, normalHover, xSmall, xSmallHover, xxSmall, xxSmallHover });\n};\n\nexport default Search;\n"],"mappings":";;AAIA,IAAMA,UAAkC,EAAE,MAAM,gBAAkD;AAiChG,QAAO,QAAQ;EAAE;EAAM;EAAW,QA/BhC,oBAAC,QAAA,EAAK,GAAE,skBAAA,CAAukB;EA+BviB,aA3BxC,oBAAC,QAAA,EAAK,GAAE,keAAA,CAAme;EA2Btb,QAvBrD,oBAAC,QAAA,EAAK,GAAE,+iBAAA,CAAgjB;EAuB3f,aAnB7D,oBAAC,QAAA,EAAK,GAAE,qkBAAA,CAAskB;EAmBpgB,SAf1E,oBAAC,QAAA;GACC,aAAU;GACV,aAAU;GACV,GAAE;IACF;EAWiF,cAPnF,oBAAC,QAAA;GACC,aAAU;GACV,aAAU;GACV,GAAE;IACF;EAG+F,CAAC;;AAGtG,IAAA,iBAAe"}