@fremtind/jokul 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (300) hide show
  1. package/build/build-stats.html +1 -1
  2. package/build/cjs/components/card/Card.js +1 -1
  3. package/build/cjs/components/card/Card.js.map +1 -1
  4. package/build/cjs/components/card/CardImage.js +1 -1
  5. package/build/cjs/components/card/CardImage.js.map +1 -1
  6. package/build/cjs/components/card/index.js +1 -1
  7. package/build/cjs/components/icon/Icon.js.map +1 -1
  8. package/build/cjs/components/index.js +1 -1
  9. package/build/cjs/components/input-group/FieldGroup.js +2 -0
  10. package/build/cjs/components/input-group/FieldGroup.js.map +1 -0
  11. package/build/cjs/components/input-group/InputGroup.js +2 -0
  12. package/build/cjs/components/input-group/InputGroup.js.map +1 -0
  13. package/build/cjs/components/input-group/Label.js +2 -0
  14. package/build/cjs/components/input-group/Label.js.map +1 -0
  15. package/build/cjs/components/input-group/SupportLabel.js +2 -0
  16. package/build/cjs/components/input-group/SupportLabel.js.map +1 -0
  17. package/build/cjs/components/input-group/index.js +2 -0
  18. package/build/cjs/components/link/Link.js.map +1 -1
  19. package/build/cjs/components/link/NavLink.js.map +1 -1
  20. package/build/cjs/components/link-list/LinkList.js.map +1 -1
  21. package/build/cjs/components/tooltip/PopupTip.js +2 -0
  22. package/build/cjs/components/tooltip/PopupTip.js.map +1 -0
  23. package/build/cjs/components/tooltip/Tooltip.js +2 -0
  24. package/build/cjs/components/tooltip/Tooltip.js.map +1 -0
  25. package/build/cjs/components/tooltip/TooltipContent.js +2 -0
  26. package/build/cjs/components/tooltip/TooltipContent.js.map +1 -0
  27. package/build/cjs/components/tooltip/TooltipTrigger.js +2 -0
  28. package/build/cjs/components/tooltip/TooltipTrigger.js.map +1 -0
  29. package/build/cjs/components/tooltip/index.js +2 -0
  30. package/build/cjs/core/index.js +1 -1
  31. package/build/cjs/core/tokens.js +1 -1
  32. package/build/cjs/core/tokens.js.map +1 -1
  33. package/build/cjs/hooks/useAnimatedHeight/useAnimatedHeight.js +1 -1
  34. package/build/cjs/hooks/useAnimatedHeight/useAnimatedHeight.js.map +1 -1
  35. package/build/cjs/hooks/useAnimatedHeight/useAnimatedHeightBetween.js +1 -1
  36. package/build/cjs/hooks/useAnimatedHeight/useAnimatedHeightBetween.js.map +1 -1
  37. package/build/cjs/hooks/useAnimatedHeight/useAutoAnimateHeight.js +1 -1
  38. package/build/cjs/hooks/useAnimatedHeight/useAutoAnimateHeight.js.map +1 -1
  39. package/build/cjs/hooks/useScreen/useScreen.js +1 -1
  40. package/build/cjs/hooks/useScreen/useScreen.js.map +1 -1
  41. package/build/cjs/index.js +1 -1
  42. package/build/cjs/utilities/constants/index.js +2 -0
  43. package/build/cjs/utilities/constants/index.js.map +1 -0
  44. package/build/cjs/utilities/constants/unicode.js +2 -0
  45. package/build/cjs/utilities/constants/unicode.js.map +1 -0
  46. package/build/cjs/utilities/formatters/avstand/formatAvstand.js +2 -0
  47. package/build/cjs/utilities/formatters/avstand/formatAvstand.js.map +1 -0
  48. package/build/cjs/utilities/formatters/bytes/formatBytes.js +2 -0
  49. package/build/cjs/utilities/formatters/bytes/formatBytes.js.map +1 -0
  50. package/build/cjs/utilities/formatters/date/formatDate.js +2 -0
  51. package/build/cjs/utilities/formatters/date/formatDate.js.map +1 -0
  52. package/build/cjs/utilities/formatters/fodselsnummer/formatFodselsnummer.js +2 -0
  53. package/build/cjs/utilities/formatters/fodselsnummer/formatFodselsnummer.js.map +1 -0
  54. package/build/cjs/utilities/formatters/index.js +2 -0
  55. package/build/cjs/utilities/formatters/index.js.map +1 -0
  56. package/build/cjs/utilities/formatters/kontonummer/formatKontonummer.js +2 -0
  57. package/build/cjs/utilities/formatters/kontonummer/formatKontonummer.js.map +1 -0
  58. package/build/cjs/utilities/formatters/kortnummer/formatKortnummer.js +2 -0
  59. package/build/cjs/utilities/formatters/kortnummer/formatKortnummer.js.map +1 -0
  60. package/build/cjs/utilities/formatters/organisasjonsnummer/formatOrganisasjonsnummer.js +2 -0
  61. package/build/cjs/utilities/formatters/organisasjonsnummer/formatOrganisasjonsnummer.js.map +1 -0
  62. package/build/cjs/utilities/formatters/telefonnummer/formatTelefonnummer.js +2 -0
  63. package/build/cjs/utilities/formatters/telefonnummer/formatTelefonnummer.js.map +1 -0
  64. package/build/cjs/utilities/formatters/util/formatNumber.js +2 -0
  65. package/build/cjs/utilities/formatters/util/formatNumber.js.map +1 -0
  66. package/build/cjs/utilities/formatters/util/parseNumber.js +2 -0
  67. package/build/cjs/utilities/formatters/util/parseNumber.js.map +1 -0
  68. package/build/cjs/utilities/formatters/util/registerWithMask.js +2 -0
  69. package/build/cjs/utilities/formatters/util/registerWithMask.js.map +1 -0
  70. package/build/cjs/utilities/formatters/valuta/formatValuta.js +2 -0
  71. package/build/cjs/utilities/formatters/valuta/formatValuta.js.map +1 -0
  72. package/build/cjs/utilities/index.js +2 -0
  73. package/build/cjs/utilities/index.js.map +1 -0
  74. package/build/cjs/utilities/polymorphism/SlotComponent.js +2 -0
  75. package/build/cjs/utilities/polymorphism/SlotComponent.js.map +1 -0
  76. package/build/cjs/utilities/polymorphism/index.js +2 -0
  77. package/build/cjs/utilities/polymorphism/index.js.map +1 -0
  78. package/build/cjs/utilities/polymorphism/mergeProps.js.map +1 -0
  79. package/build/cjs/utilities/polymorphism/mergeRefs.js.map +1 -0
  80. package/build/cjs/utilities/tabListener.js.map +1 -0
  81. package/build/cjs/{core/utils/getValuePair.js → utilities/valuePair.js} +1 -1
  82. package/build/cjs/utilities/valuePair.js.map +1 -0
  83. package/build/components/card/Card.d.ts +1 -1
  84. package/build/components/card/CardImage.d.ts +1 -1
  85. package/build/components/icon/Icon.d.ts +1 -1
  86. package/build/components/index.d.ts +2 -1
  87. package/build/components/input-group/FieldGroup.d.ts +16 -0
  88. package/build/components/input-group/InputGroup.d.ts +40 -0
  89. package/build/components/input-group/Label.d.ts +14 -0
  90. package/build/components/input-group/SupportLabel.d.ts +61 -0
  91. package/build/components/input-group/index.d.ts +4 -0
  92. package/build/components/link/Link.d.ts +1 -1
  93. package/build/components/link/NavLink.d.ts +1 -1
  94. package/build/components/link-list/LinkList.d.ts +1 -1
  95. package/build/components/tooltip/PopupTip.d.ts +13 -0
  96. package/build/components/tooltip/Tooltip.d.ts +122 -0
  97. package/build/components/tooltip/TooltipContent.d.ts +2 -0
  98. package/build/components/tooltip/TooltipTrigger.d.ts +2 -0
  99. package/build/components/tooltip/index.d.ts +4 -0
  100. package/build/core/index.d.ts +1 -6
  101. package/build/core/tokens.d.ts +22 -1
  102. package/build/core/types.d.ts +4 -5
  103. package/build/es/components/card/Card.js +1 -1
  104. package/build/es/components/card/Card.js.map +1 -1
  105. package/build/es/components/card/CardImage.js +1 -1
  106. package/build/es/components/card/CardImage.js.map +1 -1
  107. package/build/es/components/card/index.js +1 -1
  108. package/build/es/components/icon/Icon.js.map +1 -1
  109. package/build/es/components/index.js +1 -1
  110. package/build/es/components/input-group/FieldGroup.js +2 -0
  111. package/build/es/components/input-group/FieldGroup.js.map +1 -0
  112. package/build/es/components/input-group/InputGroup.js +2 -0
  113. package/build/es/components/input-group/InputGroup.js.map +1 -0
  114. package/build/es/components/input-group/Label.js +2 -0
  115. package/build/es/components/input-group/Label.js.map +1 -0
  116. package/build/es/components/input-group/SupportLabel.js +2 -0
  117. package/build/es/components/input-group/SupportLabel.js.map +1 -0
  118. package/build/es/components/input-group/index.js +2 -0
  119. package/build/es/components/input-group/index.js.map +1 -0
  120. package/build/es/components/link/Link.js.map +1 -1
  121. package/build/es/components/link/NavLink.js.map +1 -1
  122. package/build/es/components/link-list/LinkList.js.map +1 -1
  123. package/build/es/components/tooltip/PopupTip.js +2 -0
  124. package/build/es/components/tooltip/PopupTip.js.map +1 -0
  125. package/build/es/components/tooltip/Tooltip.js +2 -0
  126. package/build/es/components/tooltip/Tooltip.js.map +1 -0
  127. package/build/es/components/tooltip/TooltipContent.js +2 -0
  128. package/build/es/components/tooltip/TooltipContent.js.map +1 -0
  129. package/build/es/components/tooltip/TooltipTrigger.js +2 -0
  130. package/build/es/components/tooltip/TooltipTrigger.js.map +1 -0
  131. package/build/es/components/tooltip/index.js +2 -0
  132. package/build/es/components/tooltip/index.js.map +1 -0
  133. package/build/es/core/index.js +1 -1
  134. package/build/es/core/tokens.js +1 -1
  135. package/build/es/core/tokens.js.map +1 -1
  136. package/build/es/hooks/useAnimatedHeight/useAnimatedHeight.js +1 -1
  137. package/build/es/hooks/useAnimatedHeight/useAnimatedHeight.js.map +1 -1
  138. package/build/es/hooks/useAnimatedHeight/useAnimatedHeightBetween.js +1 -1
  139. package/build/es/hooks/useAnimatedHeight/useAnimatedHeightBetween.js.map +1 -1
  140. package/build/es/hooks/useAnimatedHeight/useAutoAnimateHeight.js +1 -1
  141. package/build/es/hooks/useAnimatedHeight/useAutoAnimateHeight.js.map +1 -1
  142. package/build/es/hooks/useScreen/useScreen.js +1 -1
  143. package/build/es/hooks/useScreen/useScreen.js.map +1 -1
  144. package/build/es/index.js +1 -1
  145. package/build/es/utilities/constants/index.js +2 -0
  146. package/build/es/utilities/constants/index.js.map +1 -0
  147. package/build/es/utilities/constants/unicode.js +2 -0
  148. package/build/es/utilities/constants/unicode.js.map +1 -0
  149. package/build/es/utilities/formatters/avstand/formatAvstand.js +2 -0
  150. package/build/es/utilities/formatters/avstand/formatAvstand.js.map +1 -0
  151. package/build/es/utilities/formatters/bytes/formatBytes.js +2 -0
  152. package/build/es/utilities/formatters/bytes/formatBytes.js.map +1 -0
  153. package/build/es/utilities/formatters/date/formatDate.js +2 -0
  154. package/build/es/utilities/formatters/date/formatDate.js.map +1 -0
  155. package/build/es/utilities/formatters/fodselsnummer/formatFodselsnummer.js +2 -0
  156. package/build/es/utilities/formatters/fodselsnummer/formatFodselsnummer.js.map +1 -0
  157. package/build/es/utilities/formatters/index.js +2 -0
  158. package/build/es/utilities/formatters/index.js.map +1 -0
  159. package/build/es/utilities/formatters/kontonummer/formatKontonummer.js +2 -0
  160. package/build/es/utilities/formatters/kontonummer/formatKontonummer.js.map +1 -0
  161. package/build/es/utilities/formatters/kortnummer/formatKortnummer.js +2 -0
  162. package/build/es/utilities/formatters/kortnummer/formatKortnummer.js.map +1 -0
  163. package/build/es/utilities/formatters/organisasjonsnummer/formatOrganisasjonsnummer.js +2 -0
  164. package/build/es/utilities/formatters/organisasjonsnummer/formatOrganisasjonsnummer.js.map +1 -0
  165. package/build/es/utilities/formatters/telefonnummer/formatTelefonnummer.js +2 -0
  166. package/build/es/utilities/formatters/telefonnummer/formatTelefonnummer.js.map +1 -0
  167. package/build/es/utilities/formatters/util/formatNumber.js +2 -0
  168. package/build/es/utilities/formatters/util/formatNumber.js.map +1 -0
  169. package/build/es/utilities/formatters/util/parseNumber.js +2 -0
  170. package/build/es/utilities/formatters/util/parseNumber.js.map +1 -0
  171. package/build/es/utilities/formatters/util/registerWithMask.js +2 -0
  172. package/build/es/utilities/formatters/util/registerWithMask.js.map +1 -0
  173. package/build/es/utilities/formatters/valuta/formatValuta.js +2 -0
  174. package/build/es/utilities/formatters/valuta/formatValuta.js.map +1 -0
  175. package/build/es/utilities/index.js +2 -0
  176. package/build/es/utilities/index.js.map +1 -0
  177. package/build/es/utilities/polymorphism/SlotComponent.js +2 -0
  178. package/build/es/utilities/polymorphism/SlotComponent.js.map +1 -0
  179. package/build/es/utilities/polymorphism/index.js +2 -0
  180. package/build/es/utilities/polymorphism/index.js.map +1 -0
  181. package/build/es/utilities/polymorphism/mergeProps.js.map +1 -0
  182. package/build/es/utilities/polymorphism/mergeRefs.js.map +1 -0
  183. package/build/es/utilities/tabListener.js.map +1 -0
  184. package/build/es/{core/utils/getValuePair.js → utilities/valuePair.js} +1 -1
  185. package/build/es/utilities/valuePair.js.map +1 -0
  186. package/build/index-DfvUcA5T.js +2 -0
  187. package/build/index-DfvUcA5T.js.map +1 -0
  188. package/build/index-hKyqa1PH.cjs +2 -0
  189. package/build/index-hKyqa1PH.cjs.map +1 -0
  190. package/build/index.d.ts +1 -0
  191. package/build/utilities/constants/index.d.ts +2 -0
  192. package/build/utilities/constants/unicode.d.ts +13 -0
  193. package/build/utilities/formatters/avstand/formatAvstand.d.ts +23 -0
  194. package/build/utilities/formatters/bytes/formatBytes.d.ts +8 -0
  195. package/build/utilities/formatters/date/formatDate.d.ts +15 -0
  196. package/build/utilities/formatters/fodselsnummer/formatFodselsnummer.d.ts +15 -0
  197. package/build/utilities/formatters/index.d.ts +14 -0
  198. package/build/utilities/formatters/kontonummer/formatKontonummer.d.ts +16 -0
  199. package/build/utilities/formatters/kortnummer/formatKortnummer.d.ts +15 -0
  200. package/build/utilities/formatters/organisasjonsnummer/formatOrganisasjonsnummer.d.ts +15 -0
  201. package/build/utilities/formatters/telefonnummer/formatTelefonnummer.d.ts +18 -0
  202. package/build/utilities/formatters/util/formatNumber.d.ts +14 -0
  203. package/build/utilities/formatters/util/parseNumber.d.ts +6 -0
  204. package/build/utilities/formatters/util/registerWithMask.d.ts +42 -0
  205. package/build/utilities/formatters/valuta/formatValuta.d.ts +18 -0
  206. package/build/utilities/index.d.ts +5 -0
  207. package/build/utilities/polymorphism/index.d.ts +5 -0
  208. package/build/utilities/valuePair.d.ts +6 -0
  209. package/package.json +19 -8
  210. package/src/components/card/styles/_index.scss +1 -0
  211. package/src/components/card/styles/_info-card.scss +40 -0
  212. package/src/components/card/styles/_nav-card.scss +113 -0
  213. package/src/components/card/styles/_task-card.scss +55 -0
  214. package/src/components/card/styles/card.css +332 -0
  215. package/src/components/card/styles/card.min.css +1 -0
  216. package/src/components/card/styles/card.scss +99 -0
  217. package/src/components/icon/styles/icon.css +1 -1
  218. package/src/components/icon-button/styles/_index.scss +1 -0
  219. package/src/components/icon-button/styles/icon-button.css +98 -0
  220. package/src/components/icon-button/styles/icon-button.min.css +1 -0
  221. package/src/components/icon-button/styles/icon-button.scss +59 -0
  222. package/src/components/image/styles/_index.scss +1 -0
  223. package/src/components/image/styles/image.css +30 -0
  224. package/src/components/image/styles/image.min.css +1 -0
  225. package/src/components/image/styles/image.scss +35 -0
  226. package/src/components/link/styles/link.css +1 -1
  227. package/src/components/link-list/styles/link-list.css +1 -1
  228. package/src/components/loader/styles/loader.css +7 -7
  229. package/src/components/loader/styles/loader.min.css +1 -1
  230. package/src/components/loader/styles/skeleton-loader.css +6 -6
  231. package/src/components/loader/styles/skeleton-loader.min.css +1 -1
  232. package/src/components/tag/styles/_index.scss +1 -0
  233. package/src/components/tag/styles/tag.css +71 -0
  234. package/src/components/tag/styles/tag.min.css +1 -0
  235. package/src/components/tag/styles/tag.scss +73 -0
  236. package/src/core/jkl/_legacy-tokens.scss +1 -1
  237. package/src/core/jkl/_tokens.scss +14 -1
  238. package/src/core/styles/_color-tokens.scss +1 -1
  239. package/src/core/styles/_legacy-tokens.scss +1 -1
  240. package/src/core/styles/_tokens.scss +1 -1
  241. package/src/core/styles/core.css +4 -4
  242. package/src/core/styles/vind.css +1 -1
  243. package/src/core/tokens.less +14 -1
  244. package/build/CardImage-CRhZdMQc.js +0 -2
  245. package/build/CardImage-CRhZdMQc.js.map +0 -1
  246. package/build/CardImage-CW7cnY5T.cjs +0 -2
  247. package/build/CardImage-CW7cnY5T.cjs.map +0 -1
  248. package/build/cjs/components/SlotComponent.js +0 -2
  249. package/build/cjs/components/SlotComponent.js.map +0 -1
  250. package/build/cjs/core/utils/breakpoints.js +0 -2
  251. package/build/cjs/core/utils/breakpoints.js.map +0 -1
  252. package/build/cjs/core/utils/density.js +0 -2
  253. package/build/cjs/core/utils/density.js.map +0 -1
  254. package/build/cjs/core/utils/getValuePair.js.map +0 -1
  255. package/build/cjs/core/utils/index.js +0 -2
  256. package/build/cjs/core/utils/mergeProps.js.map +0 -1
  257. package/build/cjs/core/utils/mergeRefs.js.map +0 -1
  258. package/build/cjs/core/utils/motion.js +0 -2
  259. package/build/cjs/core/utils/motion.js.map +0 -1
  260. package/build/cjs/core/utils/tabListener.js.map +0 -1
  261. package/build/core/utils/breakpoints.d.ts +0 -6
  262. package/build/core/utils/density.d.ts +0 -1
  263. package/build/core/utils/getValuePair.d.ts +0 -2
  264. package/build/core/utils/index.d.ts +0 -8
  265. package/build/core/utils/motion.d.ts +0 -16
  266. package/build/es/components/SlotComponent.js +0 -2
  267. package/build/es/components/SlotComponent.js.map +0 -1
  268. package/build/es/core/utils/breakpoints.js +0 -2
  269. package/build/es/core/utils/breakpoints.js.map +0 -1
  270. package/build/es/core/utils/density.js +0 -2
  271. package/build/es/core/utils/density.js.map +0 -1
  272. package/build/es/core/utils/getValuePair.js.map +0 -1
  273. package/build/es/core/utils/index.js +0 -2
  274. package/build/es/core/utils/mergeProps.js.map +0 -1
  275. package/build/es/core/utils/mergeRefs.js.map +0 -1
  276. package/build/es/core/utils/motion.js +0 -2
  277. package/build/es/core/utils/motion.js.map +0 -1
  278. package/build/es/core/utils/tabListener.js.map +0 -1
  279. /package/build/cjs/{core/utils → components/input-group}/index.js.map +0 -0
  280. /package/build/{es/core/utils → cjs/components/tooltip}/index.js.map +0 -0
  281. /package/build/cjs/{core → utilities/polymorphism}/as-child.js +0 -0
  282. /package/build/cjs/{core → utilities/polymorphism}/as-child.js.map +0 -0
  283. /package/build/cjs/{core/utils → utilities/polymorphism}/mergeProps.js +0 -0
  284. /package/build/cjs/{core/utils → utilities/polymorphism}/mergeRefs.js +0 -0
  285. /package/build/cjs/{core → utilities/polymorphism}/polymorphism.js +0 -0
  286. /package/build/cjs/{core → utilities/polymorphism}/polymorphism.js.map +0 -0
  287. /package/build/cjs/{core/utils → utilities}/tabListener.js +0 -0
  288. /package/build/es/{core → utilities/polymorphism}/as-child.js +0 -0
  289. /package/build/es/{core → utilities/polymorphism}/as-child.js.map +0 -0
  290. /package/build/es/{core/utils → utilities/polymorphism}/mergeProps.js +0 -0
  291. /package/build/es/{core/utils → utilities/polymorphism}/mergeRefs.js +0 -0
  292. /package/build/es/{core → utilities/polymorphism}/polymorphism.js +0 -0
  293. /package/build/es/{core → utilities/polymorphism}/polymorphism.js.map +0 -0
  294. /package/build/es/{core/utils → utilities}/tabListener.js +0 -0
  295. /package/build/{components → utilities/polymorphism}/SlotComponent.d.ts +0 -0
  296. /package/build/{core → utilities/polymorphism}/as-child.d.ts +0 -0
  297. /package/build/{core/utils → utilities/polymorphism}/mergeProps.d.ts +0 -0
  298. /package/build/{core/utils → utilities/polymorphism}/mergeRefs.d.ts +0 -0
  299. /package/build/{core → utilities/polymorphism}/polymorphism.d.ts +0 -0
  300. /package/build/{core/utils → utilities}/tabListener.d.ts +0 -0
@@ -0,0 +1,40 @@
1
+ import { default as React, CSSProperties, ReactNode } from 'react';
2
+ import { WithOptionalChildren, Density, DataTestAutoId } from '../../core';
3
+ import { PopupTipProps } from '../tooltip';
4
+ import { LabelProps } from './Label';
5
+ import { SupportLabelProps } from './SupportLabel';
6
+ export interface InputProps {
7
+ "aria-describedby"?: string;
8
+ "aria-invalid"?: boolean;
9
+ id?: string;
10
+ }
11
+ export type InputGroupProps = WithOptionalChildren & DataTestAutoId & {
12
+ id?: string;
13
+ className?: string;
14
+ "data-testid"?: string;
15
+ density?: Density;
16
+ errorLabel?: ReactNode;
17
+ helpLabel?: ReactNode;
18
+ inline?: boolean;
19
+ label: ReactNode;
20
+ labelProps?: Omit<LabelProps, "children" | "density">;
21
+ supportLabelProps?: Omit<SupportLabelProps, "id" | "errorLabel" | "helpLabel" | "density">;
22
+ tooltipProps?: PopupTipProps;
23
+ style?: CSSProperties;
24
+ render?: (props: InputProps) => JSX.Element;
25
+ };
26
+ export declare const InputGroup: React.ForwardRefExoticComponent<WithOptionalChildren & DataTestAutoId & {
27
+ id?: string | undefined;
28
+ className?: string | undefined;
29
+ "data-testid"?: string | undefined;
30
+ density?: Density | undefined;
31
+ errorLabel?: ReactNode;
32
+ helpLabel?: ReactNode;
33
+ inline?: boolean | undefined;
34
+ label: ReactNode;
35
+ labelProps?: Omit<LabelProps, "children" | "density"> | undefined;
36
+ supportLabelProps?: Omit<SupportLabelProps, "id" | "density" | "helpLabel" | "errorLabel"> | undefined;
37
+ tooltipProps?: PopupTipProps | undefined;
38
+ style?: React.CSSProperties | undefined;
39
+ render?: ((props: InputProps) => JSX.Element) | undefined;
40
+ } & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,14 @@
1
+ import { CSSProperties, FC } from 'react';
2
+ import { WithChildren, Density } from '../../core';
3
+ export type LabelVariant = "small" | "medium" | "large";
4
+ export interface LabelProps extends WithChildren {
5
+ id?: string;
6
+ variant?: LabelVariant;
7
+ density?: Density;
8
+ srOnly?: boolean;
9
+ standAlone?: boolean;
10
+ htmlFor?: string;
11
+ className?: string;
12
+ style?: CSSProperties;
13
+ }
14
+ export declare const Label: FC<LabelProps>;
@@ -0,0 +1,61 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { Density } from '../../core';
3
+ export type SupportLabelType = "help" | "error" | "warning" | "success";
4
+ export interface SupportLabelProps {
5
+ /**
6
+ * En ID er påkrevd for å kunne referere til SupportLabel med aria-describedby.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * const uid = useId();
11
+ * const supportId = useId();
12
+ * const hasSupportText = helpLabel || errorLabel;
13
+ * const describedBy = hasSupportText ? supportId : undefined;
14
+ *
15
+ * return (
16
+ * <div>
17
+ * <Label standAlone htmlFor={uid}>
18
+ * Velg en tekst
19
+ * </Label>
20
+ * <select
21
+ * id={uid}
22
+ * aria-describedby={describedBy}
23
+ * >
24
+ * <option value="e">Example</option>
25
+ * </select>
26
+ * <SupportLabel
27
+ * id={supportId}
28
+ * label={errorLabel}
29
+ * labelType="error"
30
+ * density={density}
31
+ * />
32
+ * </div>
33
+ * );
34
+ * ```
35
+ */
36
+ id: string;
37
+ /**
38
+ * @deprecated Bruk `label` for å få samme resultat.
39
+ */
40
+ helpLabel?: ReactNode;
41
+ /**
42
+ * @deprecated Bruk `label` og `labelType="warning"` for å få samme resultat.
43
+ */
44
+ errorLabel?: ReactNode;
45
+ label?: ReactNode;
46
+ /**
47
+ * Bestemmer hvilket ikon som skal vises:
48
+ *
49
+ * - "help" viser ikke noe ikon
50
+ * - "warning" viser WarningIcon, det som tidligere ble vist med `errorLabel`
51
+ * - "error" viser ErrorIcon
52
+ * - "success" viser SuccessIcon
53
+ *
54
+ * @default "help"
55
+ */
56
+ labelType?: SupportLabelType;
57
+ density?: Density;
58
+ className?: string;
59
+ srOnly?: boolean;
60
+ }
61
+ export declare const SupportLabel: FC<SupportLabelProps>;
@@ -0,0 +1,4 @@
1
+ export { FieldGroup, type FieldGroupProps } from './FieldGroup';
2
+ export { InputGroup, type InputGroupProps, type InputProps } from './InputGroup';
3
+ export { Label, type LabelProps, type LabelVariant } from './Label';
4
+ export { SupportLabel, type SupportLabelProps, type SupportLabelType } from './SupportLabel';
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { PolymorphicPropsWithRef } from '../../core';
2
+ import { PolymorphicPropsWithRef } from '../../utilities';
3
3
  export type LinkProps<ElementType extends React.ElementType> = PolymorphicPropsWithRef<ElementType, {
4
4
  external?: boolean;
5
5
  }>;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { PolymorphicPropsWithRef } from '../../core';
2
+ import { PolymorphicPropsWithRef } from '../../utilities';
3
3
  export type NavLinkProps<ElementType extends React.ElementType> = PolymorphicPropsWithRef<ElementType, {
4
4
  active?: boolean;
5
5
  back?: boolean;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { PolymorphicPropsWithRef } from '../../core';
2
+ import { PolymorphicPropsWithRef } from '../../utilities';
3
3
  type LinkComponent = <ElementType extends React.ElementType = "a">(props: PolymorphicPropsWithRef<ElementType>) => React.ReactElement | null;
4
4
  type UnorderedLinkListProps = React.HTMLAttributes<HTMLUListElement> & {
5
5
  variant: "unordered";
@@ -0,0 +1,13 @@
1
+ import { FC, ReactNode, HTMLProps } from 'react';
2
+ import { TooltipProps } from './Tooltip';
3
+ export interface PopupTipProps extends Omit<TooltipProps, "triggerOn" | "children"> {
4
+ /**
5
+ * Innholdet i tooltipet som vises
6
+ */
7
+ content: ReactNode;
8
+ /**
9
+ * Eventuelle props du vil sette på trigger-knappen for tooltipet
10
+ */
11
+ triggerProps?: Omit<HTMLProps<HTMLButtonElement>, "children" | "type">;
12
+ }
13
+ export declare const PopupTip: FC<PopupTipProps>;
@@ -0,0 +1,122 @@
1
+ import { Placement } from '@floating-ui/react';
2
+ import { default as React, FC } from 'react';
3
+ import { WithChildren } from '../../core';
4
+ export type TooltipPlacement = Extract<Placement, "top-start" | "top-end" | "left" | "right" | "top">;
5
+ export interface TooltipProps {
6
+ /**
7
+ * Sett til true dersom du ønsker at tooltipen skal være åpen som default
8
+ * @default false
9
+ */
10
+ initialOpen?: boolean;
11
+ /**
12
+ * Plassering av tooltipen i forhold til triggeren. Tooltipen vil automatisk
13
+ * bytte posisjon dersom det ikke er plass.
14
+ * @default "top"
15
+ */
16
+ placement?: TooltipPlacement;
17
+ /**
18
+ * Valgfri forsinkelse før tooltipen åpner. Ignoreres dersom triggerOn er satt til "click"
19
+ * @default 250
20
+ */
21
+ delay?: number;
22
+ /**
23
+ * Angir om tooltipen skal åpnes ved klikk eller hover
24
+ * @default "hover"
25
+ */
26
+ triggerOn?: "click" | "hover";
27
+ }
28
+ export declare const useTooltip: ({ initialOpen, placement, delay, triggerOn, }: TooltipProps) => {
29
+ getReferenceProps: (userProps?: React.HTMLProps<Element> | undefined) => Record<string, unknown>;
30
+ getFloatingProps: (userProps?: React.HTMLProps<HTMLElement> | undefined) => Record<string, unknown>;
31
+ getItemProps: (userProps?: React.HTMLProps<HTMLElement> | undefined) => Record<string, unknown>;
32
+ refs: {
33
+ description: React.MutableRefObject<HTMLElement | null>;
34
+ setDescription: (element: HTMLElement | null) => HTMLElement | null;
35
+ reference: React.MutableRefObject<import('@floating-ui/react').ReferenceType | null>;
36
+ floating: React.MutableRefObject<HTMLElement | null>;
37
+ domReference: React.MutableRefObject<Element | null>;
38
+ setReference: (node: import('@floating-ui/react').ReferenceType | null) => void;
39
+ setFloating: (node: HTMLElement | null) => void;
40
+ setPositionReference: (node: import('@floating-ui/react').ReferenceType | null) => void;
41
+ };
42
+ placement: Placement;
43
+ strategy: import('@floating-ui/react').Strategy;
44
+ middlewareData: import('@floating-ui/react').MiddlewareData;
45
+ x: number;
46
+ y: number;
47
+ update: () => void;
48
+ context: {
49
+ x: number;
50
+ y: number;
51
+ placement: Placement;
52
+ strategy: import('@floating-ui/react').Strategy;
53
+ middlewareData: import('@floating-ui/react').MiddlewareData;
54
+ update: () => void;
55
+ isPositioned: boolean;
56
+ floatingStyles: React.CSSProperties;
57
+ open: boolean;
58
+ onOpenChange: (open: boolean) => void;
59
+ events: import('@floating-ui/react').FloatingEvents;
60
+ dataRef: React.MutableRefObject<import('@floating-ui/react').ContextData>;
61
+ nodeId: string | undefined;
62
+ floatingId: string;
63
+ refs: import('@floating-ui/react').ExtendedRefs<import('@floating-ui/react').ReferenceType>;
64
+ elements: import('@floating-ui/react').ExtendedElements<import('@floating-ui/react').ReferenceType>;
65
+ };
66
+ elements: import('@floating-ui/react').ExtendedElements<import('@floating-ui/react').ReferenceType>;
67
+ isPositioned: boolean;
68
+ floatingStyles: React.CSSProperties;
69
+ triggerOn: "click" | "hover";
70
+ isOpen: boolean;
71
+ setOpen: React.Dispatch<React.SetStateAction<boolean>>;
72
+ arrowElement: React.RefObject<HTMLElement>;
73
+ };
74
+ export type TooltipContext = ReturnType<typeof useTooltip> | null;
75
+ export declare const TooltipProvider: React.Provider<TooltipContext>;
76
+ export declare const useTooltipContext: () => {
77
+ getReferenceProps: (userProps?: React.HTMLProps<Element> | undefined) => Record<string, unknown>;
78
+ getFloatingProps: (userProps?: React.HTMLProps<HTMLElement> | undefined) => Record<string, unknown>;
79
+ getItemProps: (userProps?: React.HTMLProps<HTMLElement> | undefined) => Record<string, unknown>;
80
+ refs: {
81
+ description: React.MutableRefObject<HTMLElement | null>;
82
+ setDescription: (element: HTMLElement | null) => HTMLElement | null;
83
+ reference: React.MutableRefObject<import('@floating-ui/react').ReferenceType | null>;
84
+ floating: React.MutableRefObject<HTMLElement | null>;
85
+ domReference: React.MutableRefObject<Element | null>;
86
+ setReference: (node: import('@floating-ui/react').ReferenceType | null) => void;
87
+ setFloating: (node: HTMLElement | null) => void;
88
+ setPositionReference: (node: import('@floating-ui/react').ReferenceType | null) => void;
89
+ };
90
+ placement: Placement;
91
+ strategy: import('@floating-ui/react').Strategy;
92
+ middlewareData: import('@floating-ui/react').MiddlewareData;
93
+ x: number;
94
+ y: number;
95
+ update: () => void;
96
+ context: {
97
+ x: number;
98
+ y: number;
99
+ placement: Placement;
100
+ strategy: import('@floating-ui/react').Strategy;
101
+ middlewareData: import('@floating-ui/react').MiddlewareData;
102
+ update: () => void;
103
+ isPositioned: boolean;
104
+ floatingStyles: React.CSSProperties;
105
+ open: boolean;
106
+ onOpenChange: (open: boolean) => void;
107
+ events: import('@floating-ui/react').FloatingEvents;
108
+ dataRef: React.MutableRefObject<import('@floating-ui/react').ContextData>;
109
+ nodeId: string | undefined;
110
+ floatingId: string;
111
+ refs: import('@floating-ui/react').ExtendedRefs<import('@floating-ui/react').ReferenceType>;
112
+ elements: import('@floating-ui/react').ExtendedElements<import('@floating-ui/react').ReferenceType>;
113
+ };
114
+ elements: import('@floating-ui/react').ExtendedElements<import('@floating-ui/react').ReferenceType>;
115
+ isPositioned: boolean;
116
+ floatingStyles: React.CSSProperties;
117
+ triggerOn: "click" | "hover";
118
+ isOpen: boolean;
119
+ setOpen: React.Dispatch<React.SetStateAction<boolean>>;
120
+ arrowElement: React.RefObject<HTMLElement>;
121
+ };
122
+ export declare const Tooltip: FC<TooltipProps & WithChildren>;
@@ -0,0 +1,2 @@
1
+ import { default as React } from 'react';
2
+ export declare const TooltipContent: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,2 @@
1
+ import { default as React } from 'react';
2
+ export declare const TooltipTrigger: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1,4 @@
1
+ export { Tooltip, type TooltipPlacement, type TooltipProps } from './Tooltip';
2
+ export { TooltipContent } from './TooltipContent';
3
+ export { TooltipTrigger } from './TooltipTrigger';
4
+ export { PopupTip, type PopupTipProps } from './PopupTip';
@@ -1,7 +1,2 @@
1
- export type { Easing, Timing } from './utils';
2
- export { initTabListener, getValuePair, breakpoints, timings, easings, mergeRefs, mergeProps } from './utils';
3
- export type { Density, PossibleRef } from './utils';
4
- export type { ColorScheme, DataTestAutoId, ValuePair, WithChildren, WithOptionalChildren } from './types';
1
+ export type { ColorScheme, Density, Easing, Timing, DataTestAutoId, WithChildren, WithOptionalChildren } from './types';
5
2
  export { default as tokens } from './tokens';
6
- export type { PolymorphicProps, PolymorphicPropsWithRef, PolymorphicRef } from './polymorphism';
7
- export type { AsChildProps } from './as-child';
@@ -1,8 +1,13 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 10 Sep 2024 05:21:22 GMT
3
+ * Generated on Mon, 23 Sep 2024 08:51:40 GMT
4
4
  */
5
5
  declare const _default: {
6
+ breakpoint: {
7
+ medium: string;
8
+ large: string;
9
+ xl: string;
10
+ };
6
11
  color: {
7
12
  brand: {
8
13
  snohvit: string;
@@ -185,6 +190,22 @@ declare const _default: {
185
190
  advarsel: string;
186
191
  advarselDark: string;
187
192
  };
193
+ motion: {
194
+ timing: {
195
+ energetic: string;
196
+ snappy: string;
197
+ productive: string;
198
+ expressive: string;
199
+ lazy: string;
200
+ };
201
+ easing: {
202
+ standard: string;
203
+ entrance: string;
204
+ exit: string;
205
+ easeInBounceOut: string;
206
+ focus: string;
207
+ };
208
+ };
188
209
  spacing: {
189
210
  0: string;
190
211
  2: string;
@@ -1,13 +1,12 @@
1
1
  import { ReactNode } from 'react';
2
+ import { tokens } from './';
2
3
  export interface DataTestAutoId {
3
4
  "data-testautoid"?: string;
4
5
  }
5
6
  export type ColorScheme = "light" | "dark";
6
- export type ValuePair = {
7
- value: string;
8
- label: string;
9
- description?: string;
10
- };
7
+ export type Density = "comfortable" | "compact";
8
+ export type Easing = keyof typeof tokens.motion.easing;
9
+ export type Timing = keyof typeof tokens.motion.timing;
11
10
  /**
12
11
  * Etter React 18 er ikke children lenger en _implicit type_. Tanken er at
13
12
  * TypeScript skal kunne oppdage når komponenten forventer children og ikke
@@ -1,2 +1,2 @@
1
- import"react/jsx-runtime";import"../../../clsx-BeLtu-UY.js";import"react";import{b as o,c as i,C as n}from"../../../CardImage-CRhZdMQc.js";import"./NavCard.js";import"../icon/Icon.js";import"../icon/icons/animated/ArrowVerticalAnimated.js";import"../icon/icons/animated/ArrowHorizontalAnimated.js";import"../icon/icons/animated/PlusRemoveAnimated.js";import"../icon/icons/ArrowDownIcon.js";import"../icon/icons/ArrowLeftIcon.js";import"../icon/icons/ArrowNorthEastIcon.js";import"../icon/icons/ArrowRightIcon.js";import"../icon/icons/ArrowUpIcon.js";import"../icon/icons/CalendarIcon.js";import"../icon/icons/CheckIcon.js";import"../icon/icons/ChevronDownIcon.js";import"../icon/icons/ChevronLeftIcon.js";import"../icon/icons/ChevronRightIcon.js";import"../icon/icons/ChevronUpIcon.js";import"../icon/icons/CloseIcon.js";import"../icon/icons/CopyIcon.js";import"../icon/icons/DotsIcon.js";import"../icon/icons/DragIcon.js";import"../icon/icons/ErrorIcon.js";import"../icon/icons/GreenCheckIcon.js";import"../icon/icons/HamburgerIcon.js";import"../icon/icons/InfoIcon.js";import"../icon/icons/LinkIcon.js";import"../icon/icons/PlusIcon.js";import"../icon/icons/QuestionIcon.js";import"../icon/icons/RedCrossIcon.js";import"../icon/icons/SearchIcon.js";import"../icon/icons/SuccessIcon.js";import"../icon/icons/WarningIcon.js";import"../icon/icons/MinusIcon.js";import"../icon/icons/ThumbDownIcon.js";import"../icon/icons/ThumbUpIcon.js";import"../icon/icons/TrashCanIcon.js";import"../icon/icons/PenIcon.js";import"../icon-button/IconButton.js";import"../link/Link.js";import"../link/NavLink.js";import"../link-list/LinkList.js";import"../tag/Tag.js";import"../SlotComponent.js";export{o as CARD_PADDINGS,i as CARD_VARIANTS,n as Card};
1
+ import{jsx as a}from"react/jsx-runtime";import{c as t}from"../../../clsx-BeLtu-UY.js";import s from"react";import{SlotComponent as o}from"../../utilities/polymorphism/SlotComponent.js";const r=["s","m","l","xl"],i=["outlined","high","low"],l=s.forwardRef((function(s,r){const{className:i,clickable:l=!1,padding:c="s",variant:d="high",asChild:e,as:m="div",...n}=s;return a(e?o:m,{"data-testid":"jkl-card","data-clickable":l,"data-padding":c,className:t("jkl-card",`jkl-card--${d}`,i),...n,ref:r})}));export{r as CARD_PADDINGS,i as CARD_VARIANTS,l as Card};
2
2
  //# sourceMappingURL=Card.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"Card.js","sources":["../../../../src/components/card/Card.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React from \"react\";\nimport { SlotComponent, type AsChildProps, type PolymorphicPropsWithRef, type PolymorphicRef } from \"../../utilities\";\n\nexport const CARD_PADDINGS = [\"s\", \"m\", \"l\", \"xl\"] as const;\nexport type CardPadding = (typeof CARD_PADDINGS)[number];\nexport const CARD_VARIANTS = [\"outlined\", \"high\", \"low\"] as const;\nexport type CardVariant = (typeof CARD_VARIANTS)[number];\n\nexport type CardProps<ElementType extends React.ElementType> = PolymorphicPropsWithRef<\n ElementType,\n {\n className?: string;\n /**\n * Setter padding på kortet. Tilsvarer samme property i Figma.\n * @default \"s\"\n */\n padding?: CardPadding;\n /**\n * Angir hvilken kortvariant du vil bruke. Velg en variant som gir god kontrast\n * til bakgrunnen på siden, slik at det er enkelt å skille innholdet fra hverandre.\n * @default \"high\"\n */\n variant?: CardVariant;\n /**\n * Angir om kortet visuelt skal fremstå som klikkbart. Du må selv rendre\n * kortet som et klikkbart element (f.eks. `<a>` eller en `<Link>` fra\n * et ruting-bibliotek) og gi det en `href` eller `onClick`-handler.\n * HUSK: Sett aria-label for at støtteverktøy, som skjermlesere, ikke\n * skal lese alt innholdet i kortet.\n */\n clickable?: boolean;\n }\n>;\n\ntype CardComponent = <ElementType extends React.ElementType = \"div\">(\n props: CardProps<ElementType> & AsChildProps,\n) => React.ReactElement | null;\n\n/**\n * En allsidig kortkomponent som brukes for å gruppere innhold på en side.\n * Komponenten rendres til vanlig som en `<div>`, men du kan velge å rendre\n * den som andre elementer eller komponenter der du trenger annen semantikk\n * eller funksjonalitet.\n */\nexport const Card = React.forwardRef(function Card<ElementType extends React.ElementType = \"div\">(\n props: CardProps<ElementType>,\n ref?: PolymorphicRef<ElementType>,\n) {\n const {\n className,\n clickable = false,\n padding = \"s\",\n variant = \"high\",\n asChild,\n as = \"div\",\n ...componentProps\n } = props;\n\n const Component = asChild ? SlotComponent : as;\n\n return (\n <Component\n data-testid=\"jkl-card\"\n data-clickable={clickable}\n data-padding={padding}\n className={clsx(\"jkl-card\", `jkl-card--${variant}`, className)}\n {...componentProps}\n ref={ref}\n />\n );\n}) as CardComponent;\n"],"names":["CARD_PADDINGS","CARD_VARIANTS","Card","React","forwardRef","props","ref","className","clickable","padding","variant","asChild","as","componentProps","jsx","SlotComponent","clsx"],"mappings":"yLAIO,MAAMA,EAAgB,CAAC,IAAK,IAAK,IAAK,MAEhCC,EAAgB,CAAC,WAAY,OAAQ,OAuCrCC,EAAOC,EAAMC,YAAW,SACjCC,EACAC,GAEM,MACFC,UAAAA,EACAC,UAAAA,GAAY,EACZC,QAAAA,EAAU,IACVC,QAAAA,EAAU,OACVC,QAAAA,EACAC,GAAAA,EAAK,SACFC,GACHR,EAKA,OAAAS,EAHcH,EAAUI,EAAgBH,EAGvC,CACG,cAAY,WACZ,iBAAgBJ,EAChB,eAAcC,EACdF,UAAWS,EAAK,WAAY,aAAaN,IAAWH,MAChDM,EACJP,IAAAA,GAGZ"}
@@ -1,2 +1,2 @@
1
- import"react/jsx-runtime";import"../../../clsx-BeLtu-UY.js";import"react";import{a as o}from"../../../CardImage-CRhZdMQc.js";import"./NavCard.js";import"../icon/Icon.js";import"../icon/icons/animated/ArrowVerticalAnimated.js";import"../icon/icons/animated/ArrowHorizontalAnimated.js";import"../icon/icons/animated/PlusRemoveAnimated.js";import"../icon/icons/ArrowDownIcon.js";import"../icon/icons/ArrowLeftIcon.js";import"../icon/icons/ArrowNorthEastIcon.js";import"../icon/icons/ArrowRightIcon.js";import"../icon/icons/ArrowUpIcon.js";import"../icon/icons/CalendarIcon.js";import"../icon/icons/CheckIcon.js";import"../icon/icons/ChevronDownIcon.js";import"../icon/icons/ChevronLeftIcon.js";import"../icon/icons/ChevronRightIcon.js";import"../icon/icons/ChevronUpIcon.js";import"../icon/icons/CloseIcon.js";import"../icon/icons/CopyIcon.js";import"../icon/icons/DotsIcon.js";import"../icon/icons/DragIcon.js";import"../icon/icons/ErrorIcon.js";import"../icon/icons/GreenCheckIcon.js";import"../icon/icons/HamburgerIcon.js";import"../icon/icons/InfoIcon.js";import"../icon/icons/LinkIcon.js";import"../icon/icons/PlusIcon.js";import"../icon/icons/QuestionIcon.js";import"../icon/icons/RedCrossIcon.js";import"../icon/icons/SearchIcon.js";import"../icon/icons/SuccessIcon.js";import"../icon/icons/WarningIcon.js";import"../icon/icons/MinusIcon.js";import"../icon/icons/ThumbDownIcon.js";import"../icon/icons/ThumbUpIcon.js";import"../icon/icons/TrashCanIcon.js";import"../icon/icons/PenIcon.js";import"../icon-button/IconButton.js";import"../link/Link.js";import"../link/NavLink.js";import"../link-list/LinkList.js";import"../tag/Tag.js";import"../SlotComponent.js";export{o as CardImage};
1
+ import{jsx as o}from"react/jsx-runtime";import{c as r}from"../../../clsx-BeLtu-UY.js";import m from"react";import{SlotComponent as a}from"../../utilities/polymorphism/SlotComponent.js";const t=m.forwardRef((function({as:m,asChild:t,className:e,placement:s="top",...i},l){return o(t?a:m||"img",{ref:l,className:r("jkl-card-image",`jkl-card-image--${s}`,e),...i})}));export{t as CardImage};
2
2
  //# sourceMappingURL=CardImage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CardImage.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"CardImage.js","sources":["../../../../src/components/card/CardImage.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React from \"react\";\nimport { SlotComponent, type AsChildProps, type PolymorphicPropsWithRef, type PolymorphicRef } from \"../../utilities\";\n\nexport type CardImageProps<ElementType extends React.ElementType> = PolymorphicPropsWithRef<\n ElementType,\n {\n /**\n * Legger til riktig negativ margin avhengig av hvor i kortet bildet\n * skal plasseres. Margin justeres automatisk etter padding i kortet.\n * @default \"top\"\n */\n placement?: \"top\" | \"middle\" | \"bottom\";\n }\n>;\n\ntype CardImageComponent = <ElementType extends React.ElementType = \"img\">(\n props: CardImageProps<ElementType>,\n) => React.ReactElement | null;\n\n/**\n * Bildekomponent som kan brukes i `Card` for å sørge for at bildet\n * blør helt ut i kantene av kortet. Rendres normalt som et `<img>`-\n * element, men du kan overstyre dette med `as` dersom du f.eks. har\n * en egen komponent for å håndtere responsive bilder.\n */\nexport const CardImage = React.forwardRef(function CardImage<ElementType extends React.ElementType = \"img\">(\n { as, asChild, className, placement = \"top\", ...imageProps }: CardImageProps<ElementType> & AsChildProps,\n ref?: PolymorphicRef<ElementType>,\n) {\n const Component = asChild ? SlotComponent : as || \"img\";\n\n return (\n <Component\n ref={ref}\n className={clsx(\"jkl-card-image\", `jkl-card-image--${placement}`, className)}\n {...imageProps}\n />\n );\n}) as CardImageComponent;\n"],"names":["CardImage","React","forwardRef","as","asChild","className","placement","imageProps","ref","jsx","SlotComponent","clsx"],"mappings":"yLA0BO,MAAMA,EAAYC,EAAMC,YAAW,UACpCC,GAAAA,EAAIC,QAAAA,EAASC,UAAAA,EAAWC,UAAAA,EAAY,SAAUC,GAChDC,GAKI,OAAAC,EAHcL,EAAUM,EAAgBP,GAAM,MAG7C,CACGK,IAAAA,EACAH,UAAWM,EAAK,iBAAkB,mBAAmBL,IAAaD,MAC9DE,GAGhB"}
@@ -1,2 +1,2 @@
1
- import{C as a,a as r}from"../../../CardImage-CRhZdMQc.js";import{InfoBlock as s,NavCard as o}from"./NavCard.js";import{TaskCard as C}from"./TaskCard.js";import{InfoCard as d}from"./InfoCard.js";export{a as Card,r as CardImage,s as InfoBlock,d as InfoCard,o as NavCard,C as TaskCard};
1
+ import{Card as a}from"./Card.js";import{CardImage as r}from"./CardImage.js";import{InfoBlock as s,NavCard as o}from"./NavCard.js";import{TaskCard as d}from"./TaskCard.js";import{InfoCard as C}from"./InfoCard.js";export{a as Card,r as CardImage,s as InfoBlock,C as InfoCard,o as NavCard,d as TaskCard};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.js","sources":["../../../../src/components/icon/Icon.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React from \"react\";\nimport { PolymorphicPropsWithRef, PolymorphicRef } from \"../../core\";\nimport { IconVariant } from \"./types\";\n\ntype IconComponentProps<ElementType extends Extract<React.ElementType, \"span\" | \"div\">> = PolymorphicPropsWithRef<\n ElementType,\n {\n \"data-testid\"?: string;\n /**\n * Størrelsesvarianten til ikonet. `\"small\"` er 16px med 20px bounding box, og `\"medium\"` er 20px med 24px bounding box.\n * `\"inherit\"` setter størrelsen til ikonet (ikke bounding box) lik skriftstørrelsen (1em).\n */\n variant?: IconVariant;\n /**\n * Angir om ikonet skal vises i fet versjon\n * @default false\n */\n bold?: boolean;\n filled?: boolean;\n className?: string;\n style?: React.CSSProperties;\n }\n>;\n\nexport type IconComponent = (<ElementType extends Extract<React.ElementType, \"span\" | \"div\"> = \"span\">(\n props: IconComponentProps<ElementType>,\n) => React.ReactElement | null) & { displayName?: string };\n\nexport const Icon: IconComponent = React.forwardRef(function Icon<\n ElementType extends Extract<React.ElementType, \"span\" | \"div\"> = \"span\",\n>(props: IconComponentProps<ElementType>, ref?: PolymorphicRef<ElementType>) {\n const { bold, children, className, filled, variant, ...iconProps } = props;\n\n return (\n <span\n aria-hidden\n ref={ref}\n className={clsx(\"jkl-icon\", className, {\n \"jkl-icon--filled\": filled,\n \"jkl-icon--bold\": bold,\n [`jkl-icon--${variant}`]: !!variant,\n })}\n {...iconProps}\n >\n {children}\n </span>\n );\n}) as IconComponent;\n"],"names":["Icon","React","forwardRef","props","ref","bold","children","className","filled","variant","iconProps","jsx","clsx"],"mappings":"2GA6BO,MAAMA,EAAsBC,EAAMC,YAAW,SAElDC,EAAwCC,GAChC,MAAEC,KAAAA,EAAMC,SAAAA,EAAUC,UAAAA,EAAWC,OAAAA,EAAQC,QAAAA,KAAYC,GAAcP,EAGjE,OAAAQ,EAAC,OAAA,CACG,eAAW,EACXP,IAAAA,EACAG,UAAWK,EAAK,WAAYL,EAAW,CACnC,mBAAoBC,EACpB,iBAAkBH,EAClB,CAAC,aAAaI,OAAcA,OAE5BC,EAEHJ,SAAAA,GAGb"}
1
+ {"version":3,"file":"Icon.js","sources":["../../../../src/components/icon/Icon.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React from \"react\";\nimport { PolymorphicPropsWithRef, PolymorphicRef } from \"../../utilities\";\nimport { IconVariant } from \"./types\";\n\ntype IconComponentProps<ElementType extends Extract<React.ElementType, \"span\" | \"div\">> = PolymorphicPropsWithRef<\n ElementType,\n {\n \"data-testid\"?: string;\n /**\n * Størrelsesvarianten til ikonet. `\"small\"` er 16px med 20px bounding box, og `\"medium\"` er 20px med 24px bounding box.\n * `\"inherit\"` setter størrelsen til ikonet (ikke bounding box) lik skriftstørrelsen (1em).\n */\n variant?: IconVariant;\n /**\n * Angir om ikonet skal vises i fet versjon\n * @default false\n */\n bold?: boolean;\n filled?: boolean;\n className?: string;\n style?: React.CSSProperties;\n }\n>;\n\nexport type IconComponent = (<ElementType extends Extract<React.ElementType, \"span\" | \"div\"> = \"span\">(\n props: IconComponentProps<ElementType>,\n) => React.ReactElement | null) & { displayName?: string };\n\nexport const Icon: IconComponent = React.forwardRef(function Icon<\n ElementType extends Extract<React.ElementType, \"span\" | \"div\"> = \"span\",\n>(props: IconComponentProps<ElementType>, ref?: PolymorphicRef<ElementType>) {\n const { bold, children, className, filled, variant, ...iconProps } = props;\n\n return (\n <span\n aria-hidden\n ref={ref}\n className={clsx(\"jkl-icon\", className, {\n \"jkl-icon--filled\": filled,\n \"jkl-icon--bold\": bold,\n [`jkl-icon--${variant}`]: !!variant,\n })}\n {...iconProps}\n >\n {children}\n </span>\n );\n}) as IconComponent;\n"],"names":["Icon","React","forwardRef","props","ref","bold","children","className","filled","variant","iconProps","jsx","clsx"],"mappings":"2GA6BO,MAAMA,EAAsBC,EAAMC,YAAW,SAElDC,EAAwCC,GAChC,MAAEC,KAAAA,EAAMC,SAAAA,EAAUC,UAAAA,EAAWC,OAAAA,EAAQC,QAAAA,KAAYC,GAAcP,EAGjE,OAAAQ,EAAC,OAAA,CACG,eAAW,EACXP,IAAAA,EACAG,UAAWK,EAAK,WAAYL,EAAW,CACnC,mBAAoBC,EACpB,iBAAkBH,EAClB,CAAC,aAAaI,OAAcA,OAE5BC,EAEHJ,SAAAA,GAGb"}
@@ -1,2 +1,2 @@
1
- import{C as o,a as n}from"../../CardImage-CRhZdMQc.js";import{InfoBlock as s,NavCard as r}from"./card/NavCard.js";import{TaskCard as a}from"./card/TaskCard.js";import{InfoCard as e}from"./card/InfoCard.js";import{Icon as c}from"./icon/Icon.js";import{ArrowVerticalAnimated as i}from"./icon/icons/animated/ArrowVerticalAnimated.js";import{ArrowHorizontalAnimated as t}from"./icon/icons/animated/ArrowHorizontalAnimated.js";import{PlusRemoveAnimated as m}from"./icon/icons/animated/PlusRemoveAnimated.js";import{ArrowDownIcon as I}from"./icon/icons/ArrowDownIcon.js";import{ArrowLeftIcon as l}from"./icon/icons/ArrowLeftIcon.js";import{ArrowNorthEastIcon as p}from"./icon/icons/ArrowNorthEastIcon.js";import{ArrowRightIcon as f}from"./icon/icons/ArrowRightIcon.js";import{ArrowUpIcon as k}from"./icon/icons/ArrowUpIcon.js";import{CalendarIcon as j}from"./icon/icons/CalendarIcon.js";import{CheckIcon as d}from"./icon/icons/CheckIcon.js";import{ChevronDownIcon as C}from"./icon/icons/ChevronDownIcon.js";import{ChevronLeftIcon as u}from"./icon/icons/ChevronLeftIcon.js";import{ChevronRightIcon as h}from"./icon/icons/ChevronRightIcon.js";import{ChevronUpIcon as S}from"./icon/icons/ChevronUpIcon.js";import{CloseIcon as A}from"./icon/icons/CloseIcon.js";import{CopyIcon as T}from"./icon/icons/CopyIcon.js";import{DotsIcon as w}from"./icon/icons/DotsIcon.js";import{DragIcon as g}from"./icon/icons/DragIcon.js";import{ErrorIcon as L}from"./icon/icons/ErrorIcon.js";import{GreenCheckIcon as v}from"./icon/icons/GreenCheckIcon.js";import{HamburgerIcon as b}from"./icon/icons/HamburgerIcon.js";import{InfoIcon as R}from"./icon/icons/InfoIcon.js";import{LinkIcon as D}from"./icon/icons/LinkIcon.js";import{PlusIcon as B}from"./icon/icons/PlusIcon.js";import{QuestionIcon as E}from"./icon/icons/QuestionIcon.js";import{RedCrossIcon as G}from"./icon/icons/RedCrossIcon.js";import{SearchIcon as N}from"./icon/icons/SearchIcon.js";import{SuccessIcon as P}from"./icon/icons/SuccessIcon.js";import{WarningIcon as U}from"./icon/icons/WarningIcon.js";import{MinusIcon as H}from"./icon/icons/MinusIcon.js";import{ThumbDownIcon as x}from"./icon/icons/ThumbDownIcon.js";import{ThumbUpIcon as y}from"./icon/icons/ThumbUpIcon.js";import{TrashCanIcon as W}from"./icon/icons/TrashCanIcon.js";import{PenIcon as z}from"./icon/icons/PenIcon.js";import{IconButton as M}from"./icon-button/IconButton.js";import{Link as O}from"./link/Link.js";import{NavLink as Q}from"./link/NavLink.js";import{LinkList as V}from"./link-list/LinkList.js";import{Loader as q}from"./loader/Loader.js";import{SkeletonAnimation as F}from"./loader/skeletons/SkeletonAnimation.js";import{SkeletonButton as J}from"./loader/skeletons/SkeletonButton.js";import{SkeletonCheckboxGroup as K}from"./loader/skeletons/SkeletonCheckboxGroup.js";import{SkeletonElement as X}from"./loader/skeletons/SkeletonElement.js";import{SkeletonInput as Y}from"./loader/skeletons/SkeletonInput.js";import{SkeletonRadioButtonGroup as Z}from"./loader/skeletons/SkeletonRadioButtonGroup.js";import{SkeletonTable as $,SkeletonTableHeader as _,SkeletonTableRow as oo}from"./loader/skeletons/SkeletonTable.js";import{SkeletonTextArea as no}from"./loader/skeletons/SkeletonTextArea.js";import{ErrorTag as so,InfoTag as ro,SuccessTag as ao,Tag as eo,WarningTag as co}from"./tag/Tag.js";import{ScreenReaderOnly as io}from"./ScreenReaderOnly.js";import{SlotComponent as to}from"./SlotComponent.js";export{I as ArrowDownIcon,t as ArrowHorizontalAnimated,l as ArrowLeftIcon,p as ArrowNorthEastIcon,f as ArrowRightIcon,k as ArrowUpIcon,i as ArrowVerticalAnimated,j as CalendarIcon,o as Card,n as CardImage,d as CheckIcon,C as ChevronDownIcon,u as ChevronLeftIcon,h as ChevronRightIcon,S as ChevronUpIcon,A as CloseIcon,T as CopyIcon,w as DotsIcon,g as DragIcon,L as ErrorIcon,so as ErrorTag,v as GreenCheckIcon,b as HamburgerIcon,c as Icon,M as IconButton,s as InfoBlock,e as InfoCard,R as InfoIcon,ro as InfoTag,O as Link,D as LinkIcon,V as LinkList,q as Loader,H as MinusIcon,r as NavCard,Q as NavLink,z as PenIcon,B as PlusIcon,m as PlusRemoveAnimated,E as QuestionIcon,G as RedCrossIcon,io as ScreenReaderOnly,N as SearchIcon,F as SkeletonAnimation,J as SkeletonButton,K as SkeletonCheckboxGroup,X as SkeletonElement,Y as SkeletonInput,Z as SkeletonRadioButtonGroup,$ as SkeletonTable,_ as SkeletonTableHeader,oo as SkeletonTableRow,no as SkeletonTextArea,to as SlotComponent,P as SuccessIcon,ao as SuccessTag,eo as Tag,a as TaskCard,x as ThumbDownIcon,y as ThumbUpIcon,W as TrashCanIcon,U as WarningIcon,co as WarningTag};
1
+ import{Card as o}from"./card/Card.js";import{CardImage as n}from"./card/CardImage.js";import{InfoBlock as r,NavCard as s}from"./card/NavCard.js";import{TaskCard as a}from"./card/TaskCard.js";import{InfoCard as i}from"./card/InfoCard.js";import{Icon as e}from"./icon/Icon.js";import{ArrowVerticalAnimated as t}from"./icon/icons/animated/ArrowVerticalAnimated.js";import{ArrowHorizontalAnimated as c}from"./icon/icons/animated/ArrowHorizontalAnimated.js";import{PlusRemoveAnimated as m}from"./icon/icons/animated/PlusRemoveAnimated.js";import{ArrowDownIcon as p}from"./icon/icons/ArrowDownIcon.js";import{ArrowLeftIcon as I}from"./icon/icons/ArrowLeftIcon.js";import{ArrowNorthEastIcon as l}from"./icon/icons/ArrowNorthEastIcon.js";import{ArrowRightIcon as f}from"./icon/icons/ArrowRightIcon.js";import{ArrowUpIcon as u}from"./icon/icons/ArrowUpIcon.js";import{CalendarIcon as k}from"./icon/icons/CalendarIcon.js";import{CheckIcon as j}from"./icon/icons/CheckIcon.js";import{ChevronDownIcon as d}from"./icon/icons/ChevronDownIcon.js";import{ChevronLeftIcon as C}from"./icon/icons/ChevronLeftIcon.js";import{ChevronRightIcon as T}from"./icon/icons/ChevronRightIcon.js";import{ChevronUpIcon as g}from"./icon/icons/ChevronUpIcon.js";import{CloseIcon as h}from"./icon/icons/CloseIcon.js";import{CopyIcon as S}from"./icon/icons/CopyIcon.js";import{DotsIcon as A}from"./icon/icons/DotsIcon.js";import{DragIcon as w}from"./icon/icons/DragIcon.js";import{ErrorIcon as L}from"./icon/icons/ErrorIcon.js";import{GreenCheckIcon as b}from"./icon/icons/GreenCheckIcon.js";import{HamburgerIcon as v}from"./icon/icons/HamburgerIcon.js";import{InfoIcon as R}from"./icon/icons/InfoIcon.js";import{LinkIcon as D}from"./icon/icons/LinkIcon.js";import{PlusIcon as G}from"./icon/icons/PlusIcon.js";import{QuestionIcon as P}from"./icon/icons/QuestionIcon.js";import{RedCrossIcon as B}from"./icon/icons/RedCrossIcon.js";import{SearchIcon as E}from"./icon/icons/SearchIcon.js";import{SuccessIcon as N}from"./icon/icons/SuccessIcon.js";import{WarningIcon as U}from"./icon/icons/WarningIcon.js";import{MinusIcon as H}from"./icon/icons/MinusIcon.js";import{ThumbDownIcon as x}from"./icon/icons/ThumbDownIcon.js";import{ThumbUpIcon as y}from"./icon/icons/ThumbUpIcon.js";import{TrashCanIcon as W}from"./icon/icons/TrashCanIcon.js";import{PenIcon as z}from"./icon/icons/PenIcon.js";import{IconButton as F}from"./icon-button/IconButton.js";import{FieldGroup as M}from"./input-group/FieldGroup.js";import{InputGroup as O}from"./input-group/InputGroup.js";import{Label as Q}from"./input-group/Label.js";import{SupportLabel as V}from"./input-group/SupportLabel.js";import{Link as q}from"./link/Link.js";import{NavLink as J}from"./link/NavLink.js";import{LinkList as K}from"./link-list/LinkList.js";import{Loader as X}from"./loader/Loader.js";import{SkeletonAnimation as Y}from"./loader/skeletons/SkeletonAnimation.js";import{SkeletonButton as Z}from"./loader/skeletons/SkeletonButton.js";import{SkeletonCheckboxGroup as $}from"./loader/skeletons/SkeletonCheckboxGroup.js";import{SkeletonElement as _}from"./loader/skeletons/SkeletonElement.js";import{SkeletonInput as oo}from"./loader/skeletons/SkeletonInput.js";import{SkeletonRadioButtonGroup as no}from"./loader/skeletons/SkeletonRadioButtonGroup.js";import{SkeletonTable as ro,SkeletonTableHeader as so,SkeletonTableRow as ao}from"./loader/skeletons/SkeletonTable.js";import{SkeletonTextArea as io}from"./loader/skeletons/SkeletonTextArea.js";import{ErrorTag as eo,InfoTag as to,SuccessTag as co,Tag as mo,WarningTag as po}from"./tag/Tag.js";import{Tooltip as Io}from"./tooltip/Tooltip.js";import{TooltipContent as lo}from"./tooltip/TooltipContent.js";import{TooltipTrigger as fo}from"./tooltip/TooltipTrigger.js";import{PopupTip as uo}from"./tooltip/PopupTip.js";import{ScreenReaderOnly as ko}from"./ScreenReaderOnly.js";export{p as ArrowDownIcon,c as ArrowHorizontalAnimated,I as ArrowLeftIcon,l as ArrowNorthEastIcon,f as ArrowRightIcon,u as ArrowUpIcon,t as ArrowVerticalAnimated,k as CalendarIcon,o as Card,n as CardImage,j as CheckIcon,d as ChevronDownIcon,C as ChevronLeftIcon,T as ChevronRightIcon,g as ChevronUpIcon,h as CloseIcon,S as CopyIcon,A as DotsIcon,w as DragIcon,L as ErrorIcon,eo as ErrorTag,M as FieldGroup,b as GreenCheckIcon,v as HamburgerIcon,e as Icon,F as IconButton,r as InfoBlock,i as InfoCard,R as InfoIcon,to as InfoTag,O as InputGroup,Q as Label,q as Link,D as LinkIcon,K as LinkList,X as Loader,H as MinusIcon,s as NavCard,J as NavLink,z as PenIcon,G as PlusIcon,m as PlusRemoveAnimated,uo as PopupTip,P as QuestionIcon,B as RedCrossIcon,ko as ScreenReaderOnly,E as SearchIcon,Y as SkeletonAnimation,Z as SkeletonButton,$ as SkeletonCheckboxGroup,_ as SkeletonElement,oo as SkeletonInput,no as SkeletonRadioButtonGroup,ro as SkeletonTable,so as SkeletonTableHeader,ao as SkeletonTableRow,io as SkeletonTextArea,N as SuccessIcon,co as SuccessTag,V as SupportLabel,mo as Tag,a as TaskCard,x as ThumbDownIcon,y as ThumbUpIcon,Io as Tooltip,lo as TooltipContent,fo as TooltipTrigger,W as TrashCanIcon,U as WarningIcon,po as WarningTag};
2
2
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,2 @@
1
+ import{jsxs as e,jsx as o,Fragment as r}from"react/jsx-runtime";import t from"classnames";import"react";import"../../hooks/useScreen/useScreen.js";import{useId as s}from"../../hooks/useId/useId.js";import"../tooltip/Tooltip.js";import"../tooltip/TooltipContent.js";import"../tooltip/TooltipTrigger.js";import{PopupTip as i}from"../tooltip/PopupTip.js";import{Label as l}from"./Label.js";import{SupportLabel as p}from"./SupportLabel.js";const a=a=>{const{id:d,legend:n,labelProps:m,supportLabelProps:u,tooltipProps:c,className:j,children:b,helpLabel:f,errorLabel:h,density:g,"data-testautoid":y,...L}=a,T=s(d||"jkl-field-group",{generateSuffix:!d}),S=`${T}_support-label`,k=h||f,x=h?"error":f?"help":void 0,P=k?S:void 0;return e("fieldset",{id:T,className:t("jkl-field-group",j),"data-testautoid":y,...L,"aria-describedby":P,"data-density":g,children:[o("legend",{className:"jkl-field-group__legend",children:e(l,{...m,density:g,children:[!c&&n,c&&e(r,{children:[o("span",{style:{whiteSpace:"normal"},children:n})," ",o(i,{...c})]})]})}),b,(f||h)&&o(p,{...u,label:k,labelType:x,id:S,density:g})]})};export{a as FieldGroup};
2
+ //# sourceMappingURL=FieldGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldGroup.js","sources":["../../../../src/components/input-group/FieldGroup.tsx"],"sourcesContent":["import cn from \"classnames\";\nimport React, { FC, FieldsetHTMLAttributes } from \"react\";\nimport type { Density, DataTestAutoId } from \"../../core\";\nimport { useId } from \"../../hooks\";\nimport { PopupTip, type PopupTipProps } from \"../tooltip\";\nimport { Label, type LabelProps } from \"./Label\";\nimport { SupportLabel, type SupportLabelProps } from \"./SupportLabel\";\n\nexport interface FieldGroupProps extends DataTestAutoId, FieldsetHTMLAttributes<HTMLFieldSetElement> {\n legend: string;\n labelProps?: Omit<LabelProps, \"children\" | \"density\">;\n supportLabelProps?: Omit<SupportLabelProps, \"id\" | \"errorLabel\" | \"helpLabel\" | \"density\">;\n tooltipProps?: PopupTipProps;\n className?: string;\n helpLabel?: string;\n errorLabel?: string;\n density?: Density;\n}\n\nexport const FieldGroup: FC<FieldGroupProps> = (props) => {\n const {\n id,\n legend,\n labelProps,\n supportLabelProps,\n tooltipProps,\n className,\n children,\n helpLabel,\n errorLabel,\n density,\n \"data-testautoid\": testAutoId,\n ...rest\n } = props;\n\n const uid = useId(id || \"jkl-field-group\", { generateSuffix: !id });\n const supportId = `${uid}_support-label`;\n\n const supportText = errorLabel || helpLabel;\n const supportTextType = errorLabel ? \"error\" : helpLabel ? \"help\" : undefined;\n\n const describedBy = supportText ? supportId : undefined;\n\n return (\n <fieldset\n id={uid}\n className={cn(\"jkl-field-group\", className)}\n data-testautoid={testAutoId}\n {...rest}\n aria-describedby={describedBy}\n data-density={density}\n >\n <legend className=\"jkl-field-group__legend\">\n <Label {...labelProps} density={density}>\n {!tooltipProps && legend}\n {tooltipProps && (\n <>\n <span style={{ whiteSpace: \"normal\" }}>{legend}</span>\n {`\\u00A0`}\n <PopupTip {...tooltipProps} />\n </>\n )}\n </Label>\n </legend>\n {children}\n {(helpLabel || errorLabel) && (\n <SupportLabel\n {...supportLabelProps}\n label={supportText}\n labelType={supportTextType}\n id={supportId}\n density={density}\n />\n )}\n </fieldset>\n );\n};\n"],"names":["FieldGroup","props","id","legend","labelProps","supportLabelProps","tooltipProps","className","children","helpLabel","errorLabel","density","testAutoId","rest","uid","useId","generateSuffix","supportId","supportText","supportTextType","describedBy","jsxs","cn","jsx","Label","Fragment","style","whiteSpace","PopupTip","SupportLabel","label","labelType"],"mappings":"obAmBa,MAAAA,EAAmCC,IACtC,MACFC,GAAAA,EACAC,OAAAA,EACAC,WAAAA,EACAC,kBAAAA,EACAC,aAAAA,EACAC,UAAAA,EACAC,SAAAA,EACAC,UAAAA,EACAC,WAAAA,EACAC,QAAAA,EACA,kBAAmBC,KAChBC,GACHZ,EAEEa,EAAMC,EAAMb,GAAM,kBAAmB,CAAEc,gBAAiBd,IACxDe,EAAY,GAAGH,kBAEfI,EAAcR,GAAcD,EAC5BU,EAAkBT,EAAa,QAAUD,EAAY,YAAS,EAE9DW,EAAcF,EAAcD,OAAY,EAG1C,OAAAI,EAAC,WAAA,CACGnB,GAAIY,EACJP,UAAWe,EAAG,kBAAmBf,GACjC,kBAAiBK,KACbC,EACJ,mBAAkBO,EAClB,eAAcT,EAEdH,SAAA,CAAAe,EAAC,UAAOhB,UAAU,0BACdC,WAACgB,EAAO,IAAGpB,EAAYO,QAAAA,EAClBH,SAAA,EAACF,GAAgBH,EACjBG,GAEOe,EAAAI,EAAA,CAAAjB,SAAA,CAAAe,EAAC,QAAKG,MAAO,CAAEC,WAAY,UAAanB,SAAOL,IAC9C,IACDoB,EAACK,EAAU,IAAGtB,YAK7BE,GACCC,GAAaC,IACXa,EAACM,EAAA,IACOxB,EACJyB,MAAOZ,EACPa,UAAWZ,EACXjB,GAAIe,EACJN,QAAAA,MACJ"}
@@ -0,0 +1,2 @@
1
+ import{jsxs as e,Fragment as r,jsx as o}from"react/jsx-runtime";import i from"classnames";import t,{forwardRef as l}from"react";import"../../hooks/useScreen/useScreen.js";import{useId as s}from"../../hooks/useId/useId.js";import"../tooltip/Tooltip.js";import"../tooltip/TooltipContent.js";import"../tooltip/TooltipTrigger.js";import{PopupTip as p}from"../tooltip/PopupTip.js";import{Label as a}from"./Label.js";import{SupportLabel as n}from"./SupportLabel.js";const d=l(((l,d)=>{const{className:m,children:u,density:c,errorLabel:j,helpLabel:b,inline:h,label:f,labelProps:y,render:v,supportLabelProps:L,tooltipProps:S,id:T,...g}=l,k=s(T||"jkl-input",{generateSuffix:!T}),x=s("jkl-support-label"),I=j||b,P=j?"error":b?"help":void 0,w={"aria-describedby":I?x:void 0,"aria-invalid":!!j||void 0,id:k},N=v?()=>v(w):()=>{const e=t.Children.toArray(l.children)[0];if(t.isValidElement(e))return t.cloneElement(e,{...w,...e.props})};return e("div",{ref:d,className:i(m,"jkl-input-group",{"jkl-input-group--inline":h}),"data-density":c,...g,children:[e(a,{standAlone:!0,htmlFor:k,srOnly:h,...y,style:{whiteSpace:S?"nowrap":void 0,...null==y?void 0:y.style},density:c,children:[!S&&f,S&&e(r,{children:[o("span",{style:{whiteSpace:"normal"},children:f})," ",o(p,{...S})]})]}),N(),o(n,{srOnly:h,...L,label:I,labelType:P,id:x,density:c})]})}));d.displayName="InputGroup";export{d as InputGroup};
2
+ //# sourceMappingURL=InputGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputGroup.js","sources":["../../../../src/components/input-group/InputGroup.tsx"],"sourcesContent":["import cn from \"classnames\";\nimport React, { forwardRef, type CSSProperties, type ReactNode } from \"react\";\nimport { type WithOptionalChildren, type Density, type DataTestAutoId } from \"../../core\";\nimport { useId } from \"../../hooks\";\nimport { PopupTip, type PopupTipProps } from \"../tooltip\";\nimport { Label, type LabelProps } from \"./Label\";\nimport { SupportLabel, type SupportLabelProps } from \"./SupportLabel\";\n\nexport interface InputProps {\n \"aria-describedby\"?: string;\n \"aria-invalid\"?: boolean;\n id?: string;\n}\n\nexport type InputGroupProps = WithOptionalChildren &\n DataTestAutoId & {\n id?: string;\n className?: string;\n \"data-testid\"?: string;\n density?: Density;\n errorLabel?: ReactNode;\n helpLabel?: ReactNode;\n inline?: boolean;\n label: ReactNode;\n labelProps?: Omit<LabelProps, \"children\" | \"density\">;\n supportLabelProps?: Omit<SupportLabelProps, \"id\" | \"errorLabel\" | \"helpLabel\" | \"density\">;\n tooltipProps?: PopupTipProps;\n style?: CSSProperties;\n render?: (props: InputProps) => JSX.Element;\n };\n\nexport const InputGroup = forwardRef<HTMLDivElement, InputGroupProps>((props, ref) => {\n const {\n className,\n children,\n density,\n errorLabel,\n helpLabel,\n inline,\n label,\n labelProps,\n render,\n supportLabelProps,\n tooltipProps,\n id,\n ...rest\n } = props;\n\n const uid = useId(id || \"jkl-input\", { generateSuffix: !id });\n const supportId = useId(\"jkl-support-label\");\n\n const supportText = errorLabel || helpLabel;\n const supportTextType = errorLabel ? \"error\" : helpLabel ? \"help\" : undefined;\n\n const describedBy = supportText ? supportId : undefined;\n\n const inputProps: InputProps = {\n \"aria-describedby\": describedBy,\n \"aria-invalid\": Boolean(errorLabel) ? true : undefined,\n id: uid,\n };\n\n const renderInput = render\n ? () => render(inputProps)\n : () => {\n const input = React.Children.toArray(props.children)[0];\n\n if (!React.isValidElement<InputProps>(input)) return;\n\n return React.cloneElement<InputProps>(input, {\n ...inputProps,\n ...input.props,\n });\n };\n\n return (\n <div\n ref={ref}\n className={cn(className, \"jkl-input-group\", {\n \"jkl-input-group--inline\": inline,\n })}\n data-density={density}\n {...rest}\n >\n <Label\n standAlone\n htmlFor={uid}\n srOnly={inline}\n {...labelProps}\n style={{ whiteSpace: tooltipProps ? \"nowrap\" : undefined, ...labelProps?.style }}\n density={density}\n >\n {!tooltipProps && label}\n {tooltipProps && (\n <>\n <span style={{ whiteSpace: \"normal\" }}>{label}</span>\n {`\\u00A0`}\n <PopupTip {...tooltipProps} />\n </>\n )}\n </Label>\n {renderInput()}\n <SupportLabel\n srOnly={inline}\n {...supportLabelProps}\n label={supportText}\n labelType={supportTextType}\n id={supportId}\n density={density}\n />\n </div>\n );\n});\n\nInputGroup.displayName = \"InputGroup\";\n"],"names":["InputGroup","forwardRef","props","ref","className","children","density","errorLabel","helpLabel","inline","label","labelProps","render","supportLabelProps","tooltipProps","id","rest","uid","useId","generateSuffix","supportId","supportText","supportTextType","inputProps","renderInput","input","React","Children","toArray","isValidElement","cloneElement","jsxs","cn","Label","standAlone","htmlFor","srOnly","style","whiteSpace","Fragment","jsx","PopupTip","SupportLabel","labelType","displayName"],"mappings":"4cA+BO,MAAMA,EAAaC,GAA4C,CAACC,EAAOC,KACpE,MACFC,UAAAA,EACAC,SAAAA,EACAC,QAAAA,EACAC,WAAAA,EACAC,UAAAA,EACAC,OAAAA,EACAC,MAAAA,EACAC,WAAAA,EACAC,OAAAA,EACAC,kBAAAA,EACAC,aAAAA,EACAC,GAAAA,KACGC,GACHd,EAEEe,EAAMC,EAAMH,GAAM,YAAa,CAAEI,gBAAiBJ,IAClDK,EAAYF,EAAM,qBAElBG,EAAcd,GAAcC,EAC5Bc,EAAkBf,EAAa,QAAUC,EAAY,YAAS,EAI9De,EAAyB,CAC3B,mBAHgBF,EAAcD,OAAY,EAI1C,iBAAwBb,QAAqB,EAC7CQ,GAAIE,GAGFO,EAAcZ,EACd,IAAMA,EAAOW,GACb,KACI,MAAME,EAAQC,EAAMC,SAASC,QAAQ1B,EAAMG,UAAU,GAEhDqB,GAAAA,EAAMG,eAA2BJ,GAE/BC,OAAAA,EAAMI,aAAyBL,EAAO,IACtCF,KACAE,EAAMvB,OACZ,EAIP,OAAA6B,EAAC,MAAA,CACG5B,IAAAA,EACAC,UAAW4B,EAAG5B,EAAW,kBAAmB,CACxC,0BAA2BK,IAE/B,eAAcH,KACVU,EAEJX,SAAA,CAAA0B,EAACE,EAAA,CACGC,YAAU,EACVC,QAASlB,EACTmB,OAAQ3B,KACJE,EACJ0B,MAAO,CAAEC,WAAYxB,EAAe,cAAW,KAAc,MAAAH,OAAAA,EAAAA,EAAY0B,OACzE/B,QAAAA,EAECD,SAAA,EAACS,GAAgBJ,EACjBI,GAEOiB,EAAAQ,EAAA,CAAAlC,SAAA,CAAAmC,EAAC,QAAKH,MAAO,CAAEC,WAAY,UAAajC,SAAMK,IAC7C,IACD8B,EAACC,EAAU,IAAG3B,UAIzBU,IACDgB,EAACE,EAAA,CACGN,OAAQ3B,KACJI,EACJH,MAAOW,EACPsB,UAAWrB,EACXP,GAAIK,EACJd,QAAAA,MACJ,IAKZN,EAAW4C,YAAc"}
@@ -0,0 +1,2 @@
1
+ import{jsx as e}from"react/jsx-runtime";import a from"classnames";const s=({variant:s="small",density:n,srOnly:t,children:l,standAlone:o,htmlFor:r,className:c="",...i})=>{const d=a("jkl-label",c,{[`jkl-label--${s}`]:s,"jkl-label--sr-only":t}),m=o?"label":"span";return!o&&r&&(r=void 0,"production"!==process.env.NODE_ENV&&console.warn("WARNING: The standard Label component renders as a <span> element, which does not take a htmlFor prop. If you want the Label to belong to a specific input, use the standAlone prop, which renders as a <label> element instead. In most cases the Label component should not be used directly, as it is part of all our input components.")),e(m,{...i,className:d,htmlFor:r,"data-density":n,children:l})};export{s as Label};
2
+ //# sourceMappingURL=Label.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Label.js","sources":["../../../../src/components/input-group/Label.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport React, { type CSSProperties, type FC } from \"react\";\nimport type { WithChildren, Density } from \"../../core\";\n\nexport type LabelVariant = \"small\" | \"medium\" | \"large\";\n\nexport interface LabelProps extends WithChildren {\n id?: string;\n variant?: LabelVariant;\n density?: Density;\n srOnly?: boolean;\n standAlone?: boolean;\n htmlFor?: string;\n className?: string;\n style?: CSSProperties;\n}\n\nexport const Label: FC<LabelProps> = ({\n variant = \"small\",\n density,\n srOnly,\n children,\n standAlone,\n htmlFor,\n className = \"\",\n ...rest\n}) => {\n const labelClassNames = classNames(\"jkl-label\", className, {\n [`jkl-label--${variant}`]: variant,\n \"jkl-label--sr-only\": srOnly,\n });\n\n const C = standAlone ? \"label\" : \"span\";\n\n if (!standAlone && htmlFor) {\n htmlFor = undefined;\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n \"WARNING: The standard Label component renders as a <span> element, which does not take a htmlFor prop. If you want the Label to belong to a specific input, use the standAlone prop, which renders as a <label> element instead. In most cases the Label component should not be used directly, as it is part of all our input components.\",\n );\n }\n }\n\n return (\n <C {...rest} className={labelClassNames} htmlFor={htmlFor} data-density={density}>\n {children}\n </C>\n );\n};\n"],"names":["Label","variant","density","srOnly","children","standAlone","htmlFor","className","rest","labelClassNames","classNames","C","process","env","NODE_ENV","console","warn","jsx"],"mappings":"kEAiBO,MAAMA,EAAwB,EACjCC,QAAAA,EAAU,QACVC,QAAAA,EACAC,OAAAA,EACAC,SAAAA,EACAC,WAAAA,EACAC,QAAAA,EACAC,UAAAA,EAAY,MACTC,MAEGC,MAAAA,EAAkBC,EAAW,YAAaH,EAAW,CACvD,CAAC,cAAcN,KAAYA,EAC3B,qBAAsBE,IAGpBQ,EAAIN,EAAa,QAAU,OAE7B,OAACA,GAAcC,IACLA,OAAA,EACmB,eAAzBM,QAAQC,IAAIC,UACJC,QAAAC,KACJ,+UAMRC,EAACN,MAAMH,EAAMD,UAAWE,EAAiBH,QAAAA,EAAkB,eAAcJ,EACpEE,SAAAA,GACL"}
@@ -0,0 +1,2 @@
1
+ import{jsxs as o,jsx as n}from"react/jsx-runtime";import i from"classnames";import"../icon/Icon.js";import"../icon/icons/animated/ArrowVerticalAnimated.js";import"../icon/icons/animated/ArrowHorizontalAnimated.js";import"../icon/icons/animated/PlusRemoveAnimated.js";import"../icon/icons/ArrowDownIcon.js";import"../icon/icons/ArrowLeftIcon.js";import"../icon/icons/ArrowNorthEastIcon.js";import"../icon/icons/ArrowRightIcon.js";import"../icon/icons/ArrowUpIcon.js";import"../icon/icons/CalendarIcon.js";import"../icon/icons/CheckIcon.js";import"../icon/icons/ChevronDownIcon.js";import"../icon/icons/ChevronLeftIcon.js";import"../icon/icons/ChevronRightIcon.js";import"../icon/icons/ChevronUpIcon.js";import"../icon/icons/CloseIcon.js";import"../icon/icons/CopyIcon.js";import"../icon/icons/DotsIcon.js";import"../icon/icons/DragIcon.js";import{ErrorIcon as c}from"../icon/icons/ErrorIcon.js";import"../icon/icons/GreenCheckIcon.js";import"../icon/icons/HamburgerIcon.js";import"../icon/icons/InfoIcon.js";import"../icon/icons/LinkIcon.js";import"../icon/icons/PlusIcon.js";import"../icon/icons/QuestionIcon.js";import"../icon/icons/RedCrossIcon.js";import"../icon/icons/SearchIcon.js";import{SuccessIcon as s}from"../icon/icons/SuccessIcon.js";import{WarningIcon as r}from"../icon/icons/WarningIcon.js";import"../icon/icons/MinusIcon.js";import"../icon/icons/ThumbDownIcon.js";import"../icon/icons/ThumbUpIcon.js";import"../icon/icons/TrashCanIcon.js";import"../icon/icons/PenIcon.js";const t=({id:t,helpLabel:m,errorLabel:p,label:e,labelType:a="help",density:l,className:j,srOnly:I,...u})=>{const h=p||m||e,b="error"===a,d="success"===a,f=h?i("jkl-form-support-label",j,{"jkl-form-support-label--sr-only":I,"jkl-form-support-label--help":"help"===a||m&&!p,"jkl-form-support-label--error":b,"jkl-form-support-label--warning":"warning"===a||p,"jkl-form-support-label--success":d}):"jkl-dormant-form-support-label";return o("span",{id:t,className:f,...h?u:{},"data-density":l,children:[n(b?c:d?s:r,{variant:"small",className:"jkl-form-support-label__icon"}),n("span",{children:p||m||e})]})};export{t as SupportLabel};
2
+ //# sourceMappingURL=SupportLabel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SupportLabel.js","sources":["../../../../src/components/input-group/SupportLabel.tsx"],"sourcesContent":["import cn from \"classnames\";\nimport React, { type FC, type ReactNode } from \"react\";\nimport { type Density } from \"../../core\";\nimport { ErrorIcon, SuccessIcon, WarningIcon } from \"../icon\";\n\nexport type SupportLabelType = \"help\" | \"error\" | \"warning\" | \"success\";\n\nexport interface SupportLabelProps {\n /**\n * En ID er påkrevd for å kunne referere til SupportLabel med aria-describedby.\n *\n * @example\n * ```tsx\n * const uid = useId();\n * const supportId = useId();\n * const hasSupportText = helpLabel || errorLabel;\n * const describedBy = hasSupportText ? supportId : undefined;\n *\n * return (\n * <div>\n * <Label standAlone htmlFor={uid}>\n * Velg en tekst\n * </Label>\n * <select\n * id={uid}\n * aria-describedby={describedBy}\n * >\n * <option value=\"e\">Example</option>\n * </select>\n * <SupportLabel\n * id={supportId}\n * label={errorLabel}\n * labelType=\"error\"\n * density={density}\n * />\n * </div>\n * );\n * ```\n */\n id: string;\n /**\n * @deprecated Bruk `label` for å få samme resultat.\n */\n helpLabel?: ReactNode;\n /**\n * @deprecated Bruk `label` og `labelType=\"warning\"` for å få samme resultat.\n */\n errorLabel?: ReactNode;\n label?: ReactNode;\n /**\n * Bestemmer hvilket ikon som skal vises:\n *\n * - \"help\" viser ikke noe ikon\n * - \"warning\" viser WarningIcon, det som tidligere ble vist med `errorLabel`\n * - \"error\" viser ErrorIcon\n * - \"success\" viser SuccessIcon\n *\n * @default \"help\"\n */\n labelType?: SupportLabelType;\n density?: Density;\n className?: string;\n srOnly?: boolean;\n}\n\nexport const SupportLabel: FC<SupportLabelProps> = ({\n id,\n helpLabel,\n errorLabel,\n label,\n labelType = \"help\",\n density,\n className,\n srOnly,\n ...rest\n}) => {\n const hasLabel = errorLabel || helpLabel || label;\n\n const isHelp = labelType === \"help\" || (helpLabel && !errorLabel);\n const isWarning = labelType === \"warning\" || errorLabel;\n const isError = labelType === \"error\";\n const isSuccess = labelType === \"success\";\n\n const componentClassName = hasLabel\n ? cn(\"jkl-form-support-label\", className, {\n \"jkl-form-support-label--sr-only\": srOnly,\n \"jkl-form-support-label--help\": isHelp,\n \"jkl-form-support-label--error\": isError,\n \"jkl-form-support-label--warning\": isWarning,\n \"jkl-form-support-label--success\": isSuccess,\n })\n : \"jkl-dormant-form-support-label\";\n\n const restProps = hasLabel ? rest : {};\n\n const Icon = isError ? ErrorIcon : isSuccess ? SuccessIcon : WarningIcon;\n\n return (\n <span id={id} className={componentClassName} {...restProps} data-density={density}>\n <Icon variant=\"small\" className=\"jkl-form-support-label__icon\" />\n <span>{errorLabel || helpLabel || label}</span>\n </span>\n );\n};\n"],"names":["SupportLabel","id","helpLabel","errorLabel","label","labelType","density","className","srOnly","rest","hasLabel","isError","isSuccess","componentClassName","cn","jsxs","children","jsx","ErrorIcon","SuccessIcon","WarningIcon","variant"],"mappings":"+8CAiEO,MAAMA,EAAsC,EAC/CC,GAAAA,EACAC,UAAAA,EACAC,WAAAA,EACAC,MAAAA,EACAC,UAAAA,EAAY,OACZC,QAAAA,EACAC,UAAAA,EACAC,OAAAA,KACGC,MAEGC,MAAAA,EAAWP,GAAcD,GAAaE,EAItCO,EAAwB,UAAdN,EACVO,EAA0B,YAAdP,EAEZQ,EAAqBH,EACrBI,EAAG,yBAA0BP,EAAW,CACpC,kCAAmCC,EACnC,+BARmB,SAAdH,GAAyBH,IAAcC,EAS5C,gCAAiCQ,EACjC,kCATsB,YAAdN,GAA2BF,EAUnC,kCAAmCS,IAEvC,iCAOF,OAAAG,EAAC,QAAKd,GAAAA,EAAQM,UAAWM,KALXH,EAAWD,EAAO,GAK4B,eAAcH,EACtEU,SAAA,CAAAC,EAJKN,EAAUO,EAAYN,EAAYO,EAAcC,EAI/C,CAAAC,QAAQ,QAAQd,UAAU,iCAC/BU,EAAA,OAAA,CAAMD,SAAcb,GAAAD,GAAaE,MACtC"}
@@ -0,0 +1,2 @@
1
+ import{FieldGroup as p}from"./FieldGroup.js";import{InputGroup as o}from"./InputGroup.js";import{Label as r}from"./Label.js";import{SupportLabel as a}from"./SupportLabel.js";export{p as FieldGroup,o as InputGroup,r as Label,a as SupportLabel};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"Link.js","sources":["../../../../src/components/link/Link.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport React from \"react\";\nimport { PolymorphicPropsWithRef, PolymorphicRef } from \"../../core\";\n\nexport type LinkProps<ElementType extends React.ElementType> = PolymorphicPropsWithRef<\n ElementType,\n {\n external?: boolean;\n }\n>;\n\nexport type LinkComponent = <ElementType extends React.ElementType = \"a\">(\n props: LinkProps<ElementType>,\n) => React.ReactElement | null;\n\nexport const Link = React.forwardRef(function Link<ElementType extends React.ElementType = \"a\">(\n props: LinkProps<ElementType>,\n ref?: PolymorphicRef<ElementType>,\n) {\n const { external = false, className = \"\", children, as = \"a\", ...rest } = props;\n const Component = as;\n\n return (\n <Component\n ref={ref}\n className={clsx(\"jkl-link\", className, {\n \"jkl-link--external\": external,\n })}\n {...rest}\n >\n {children}\n </Component>\n );\n});\n"],"names":["Link","React","forwardRef","props","ref","external","className","children","as","rest","jsx","clsx"],"mappings":"2GAeO,MAAMA,EAAOC,EAAMC,YAAW,SACjCC,EACAC,GAEM,MAAEC,SAAAA,GAAW,EAAOC,UAAAA,EAAY,GAAIC,SAAAA,EAAUC,GAAAA,EAAK,OAAQC,GAASN,EAItE,OAAAO,EAHcF,EAGb,CACGJ,IAAAA,EACAE,UAAWK,EAAK,WAAYL,EAAW,CACnC,qBAAsBD,OAEtBI,EAEHF,SAAAA,GAGb"}
1
+ {"version":3,"file":"Link.js","sources":["../../../../src/components/link/Link.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport React from \"react\";\nimport { PolymorphicPropsWithRef, PolymorphicRef } from \"../../utilities\";\n\nexport type LinkProps<ElementType extends React.ElementType> = PolymorphicPropsWithRef<\n ElementType,\n {\n external?: boolean;\n }\n>;\n\nexport type LinkComponent = <ElementType extends React.ElementType = \"a\">(\n props: LinkProps<ElementType>,\n) => React.ReactElement | null;\n\nexport const Link = React.forwardRef(function Link<ElementType extends React.ElementType = \"a\">(\n props: LinkProps<ElementType>,\n ref?: PolymorphicRef<ElementType>,\n) {\n const { external = false, className = \"\", children, as = \"a\", ...rest } = props;\n const Component = as;\n\n return (\n <Component\n ref={ref}\n className={clsx(\"jkl-link\", className, {\n \"jkl-link--external\": external,\n })}\n {...rest}\n >\n {children}\n </Component>\n );\n});\n"],"names":["Link","React","forwardRef","props","ref","external","className","children","as","rest","jsx","clsx"],"mappings":"2GAeO,MAAMA,EAAOC,EAAMC,YAAW,SACjCC,EACAC,GAEM,MAAEC,SAAAA,GAAW,EAAOC,UAAAA,EAAY,GAAIC,SAAAA,EAAUC,GAAAA,EAAK,OAAQC,GAASN,EAItE,OAAAO,EAHcF,EAGb,CACGJ,IAAAA,EACAE,UAAWK,EAAK,WAAYL,EAAW,CACnC,qBAAsBD,OAEtBI,EAEHF,SAAAA,GAGb"}
@@ -1 +1 @@
1
- {"version":3,"file":"NavLink.js","sources":["../../../../src/components/link/NavLink.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport React from \"react\";\nimport { PolymorphicPropsWithRef, PolymorphicRef } from \"../../core\";\n\nexport type NavLinkProps<ElementType extends React.ElementType> = PolymorphicPropsWithRef<\n ElementType,\n {\n active?: boolean;\n back?: boolean;\n }\n>;\n\nexport type LinkComponent = <ElementType extends React.ElementType = \"a\">(\n props: NavLinkProps<ElementType>,\n) => React.ReactElement | null;\n\nexport const NavLink = React.forwardRef(function NavLink<ElementType extends React.ElementType = \"a\">(\n props: NavLinkProps<ElementType>,\n ref?: PolymorphicRef<ElementType>,\n) {\n const { active = false, back = false, className, children, as = \"a\", ...rest } = props;\n const Component = as;\n\n return (\n <Component\n ref={ref}\n className={clsx(\n \"jkl-nav-link\",\n {\n \"jkl-nav-link--active\": active,\n \"jkl-nav-link--back\": back,\n },\n className,\n )}\n {...rest}\n >\n {children}\n </Component>\n );\n});\n"],"names":["NavLink","React","forwardRef","props","ref","active","back","className","children","as","rest","jsx","clsx"],"mappings":"2GAgBO,MAAMA,EAAUC,EAAMC,YAAW,SACpCC,EACAC,GAEM,MAAEC,OAAAA,GAAS,EAAOC,KAAAA,GAAO,EAAOC,UAAAA,EAAWC,SAAAA,EAAUC,GAAAA,EAAK,OAAQC,GAASP,EAI7E,OAAAQ,EAHcF,EAGb,CACGL,IAAAA,EACAG,UAAWK,EACP,eACA,CACI,uBAAwBP,EACxB,qBAAsBC,GAE1BC,MAEAG,EAEHF,SAAAA,GAGb"}
1
+ {"version":3,"file":"NavLink.js","sources":["../../../../src/components/link/NavLink.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport React from \"react\";\nimport { PolymorphicPropsWithRef, PolymorphicRef } from \"../../utilities\";\n\nexport type NavLinkProps<ElementType extends React.ElementType> = PolymorphicPropsWithRef<\n ElementType,\n {\n active?: boolean;\n back?: boolean;\n }\n>;\n\nexport type LinkComponent = <ElementType extends React.ElementType = \"a\">(\n props: NavLinkProps<ElementType>,\n) => React.ReactElement | null;\n\nexport const NavLink = React.forwardRef(function NavLink<ElementType extends React.ElementType = \"a\">(\n props: NavLinkProps<ElementType>,\n ref?: PolymorphicRef<ElementType>,\n) {\n const { active = false, back = false, className, children, as = \"a\", ...rest } = props;\n const Component = as;\n\n return (\n <Component\n ref={ref}\n className={clsx(\n \"jkl-nav-link\",\n {\n \"jkl-nav-link--active\": active,\n \"jkl-nav-link--back\": back,\n },\n className,\n )}\n {...rest}\n >\n {children}\n </Component>\n );\n});\n"],"names":["NavLink","React","forwardRef","props","ref","active","back","className","children","as","rest","jsx","clsx"],"mappings":"2GAgBO,MAAMA,EAAUC,EAAMC,YAAW,SACpCC,EACAC,GAEM,MAAEC,OAAAA,GAAS,EAAOC,KAAAA,GAAO,EAAOC,UAAAA,EAAWC,SAAAA,EAAUC,GAAAA,EAAK,OAAQC,GAASP,EAI7E,OAAAQ,EAHcF,EAGb,CACGL,IAAAA,EACAG,UAAWK,EACP,eACA,CACI,uBAAwBP,EACxB,qBAAsBC,GAE1BC,MAEAG,EAEHF,SAAAA,GAGb"}
@@ -1 +1 @@
1
- {"version":3,"file":"LinkList.js","sources":["../../../../src/components/link-list/LinkList.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { ComponentProps, FC } from \"react\";\nimport { PolymorphicPropsWithRef, PolymorphicRef } from \"../../core\";\nimport { ArrowRightIcon } from \"../icon\";\n\nconst Item: FC<ComponentProps<\"li\">> = ({ className, ...rest }) => {\n return <li className={clsx(\"jkl-link-list-item\", className)} {...rest}></li>;\n};\n\ntype LinkComponent = <ElementType extends React.ElementType = \"a\">(\n props: PolymorphicPropsWithRef<ElementType>,\n) => React.ReactElement | null;\n\nconst Link = React.forwardRef(function LinkListLink<ElementType extends React.ElementType = \"a\">(\n props: PolymorphicPropsWithRef<ElementType>,\n ref: PolymorphicRef<ElementType>,\n) {\n const { as: Component = \"a\", children, className, ...rest } = props;\n\n return (\n <Component className={clsx(\"jkl-link-list-link\", className)} ref={ref} {...rest}>\n {children}\n <ArrowRightIcon className=\"jkl-link-list-link__arrow\" />\n </Component>\n );\n}) as LinkComponent;\n\ntype UnorderedLinkListProps = React.HTMLAttributes<HTMLUListElement> & {\n variant: \"unordered\";\n};\n\ntype OrderedLinkListProps = React.HTMLAttributes<HTMLOListElement> & {\n variant: \"ordered\";\n};\n\ntype LinkListProps = UnorderedLinkListProps | OrderedLinkListProps;\n\nexport const LinkList = ({ variant, className, ...rest }: LinkListProps): React.JSX.Element => {\n const Component = variant === \"ordered\" ? \"ol\" : \"ul\";\n\n return (\n <Component\n className={clsx(\"jkl-link-list\", className, {\n \"jkl-link-list--ordered\": variant === \"ordered\",\n \"jkl-link-list--unordered\": variant === \"unordered\",\n })}\n {...rest}\n />\n );\n};\n\nLinkList.Link = Link;\nLinkList.Item = Item;\n"],"names":["Link","React","forwardRef","props","ref","as","Component","children","className","rest","jsxs","clsx","jsx","ArrowRightIcon","LinkList","variant","Item"],"mappings":"i9CAKA,MAQMA,EAAOC,EAAMC,YAAW,SAC1BC,EACAC,GAEM,MAAEC,GAAIC,EAAY,IAAKC,SAAAA,EAAUC,UAAAA,KAAcC,GAASN,EAG1D,OAAAO,EAACJ,GAAUE,UAAWG,EAAK,qBAAsBH,GAAYJ,IAAAA,KAAcK,EACtEF,SAAA,CAAAA,EACDK,EAACC,EAAe,CAAAL,UAAU,gCAGtC,IAYaM,EAAW,EAAGC,QAAAA,EAASP,UAAAA,KAAcC,KAI1CG,EAH0B,YAAZG,EAAwB,KAAO,KAG5C,CACGP,UAAWG,EAAK,gBAAiBH,EAAW,CACxC,yBAAsC,YAAZO,EAC1B,2BAAwC,cAAZA,OAE5BN,IAKhBK,EAASd,KAAOA,EAChBc,EAASE,KA/C8B,EAAGR,UAAAA,KAAcC,KAC7CG,EAAC,MAAGJ,UAAWG,EAAK,qBAAsBH,MAAgBC"}
1
+ {"version":3,"file":"LinkList.js","sources":["../../../../src/components/link-list/LinkList.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { ComponentProps, FC } from \"react\";\nimport { PolymorphicPropsWithRef, PolymorphicRef } from \"../../utilities\";\nimport { ArrowRightIcon } from \"../icon\";\n\nconst Item: FC<ComponentProps<\"li\">> = ({ className, ...rest }) => {\n return <li className={clsx(\"jkl-link-list-item\", className)} {...rest}></li>;\n};\n\ntype LinkComponent = <ElementType extends React.ElementType = \"a\">(\n props: PolymorphicPropsWithRef<ElementType>,\n) => React.ReactElement | null;\n\nconst Link = React.forwardRef(function LinkListLink<ElementType extends React.ElementType = \"a\">(\n props: PolymorphicPropsWithRef<ElementType>,\n ref: PolymorphicRef<ElementType>,\n) {\n const { as: Component = \"a\", children, className, ...rest } = props;\n\n return (\n <Component className={clsx(\"jkl-link-list-link\", className)} ref={ref} {...rest}>\n {children}\n <ArrowRightIcon className=\"jkl-link-list-link__arrow\" />\n </Component>\n );\n}) as LinkComponent;\n\ntype UnorderedLinkListProps = React.HTMLAttributes<HTMLUListElement> & {\n variant: \"unordered\";\n};\n\ntype OrderedLinkListProps = React.HTMLAttributes<HTMLOListElement> & {\n variant: \"ordered\";\n};\n\ntype LinkListProps = UnorderedLinkListProps | OrderedLinkListProps;\n\nexport const LinkList = ({ variant, className, ...rest }: LinkListProps): React.JSX.Element => {\n const Component = variant === \"ordered\" ? \"ol\" : \"ul\";\n\n return (\n <Component\n className={clsx(\"jkl-link-list\", className, {\n \"jkl-link-list--ordered\": variant === \"ordered\",\n \"jkl-link-list--unordered\": variant === \"unordered\",\n })}\n {...rest}\n />\n );\n};\n\nLinkList.Link = Link;\nLinkList.Item = Item;\n"],"names":["Link","React","forwardRef","props","ref","as","Component","children","className","rest","jsxs","clsx","jsx","ArrowRightIcon","LinkList","variant","Item"],"mappings":"i9CAKA,MAQMA,EAAOC,EAAMC,YAAW,SAC1BC,EACAC,GAEM,MAAEC,GAAIC,EAAY,IAAKC,SAAAA,EAAUC,UAAAA,KAAcC,GAASN,EAG1D,OAAAO,EAACJ,GAAUE,UAAWG,EAAK,qBAAsBH,GAAYJ,IAAAA,KAAcK,EACtEF,SAAA,CAAAA,EACDK,EAACC,EAAe,CAAAL,UAAU,gCAGtC,IAYaM,EAAW,EAAGC,QAAAA,EAASP,UAAAA,KAAcC,KAI1CG,EAH0B,YAAZG,EAAwB,KAAO,KAG5C,CACGP,UAAWG,EAAK,gBAAiBH,EAAW,CACxC,yBAAsC,YAAZO,EAC1B,2BAAwC,cAAZA,OAE5BN,IAKhBK,EAASd,KAAOA,EAChBc,EAASE,KA/C8B,EAAGR,UAAAA,KAAcC,KAC7CG,EAAC,MAAGJ,UAAWG,EAAK,qBAAsBH,MAAgBC"}