@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
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("react/jsx-runtime"),require("../../../clsx-E3yX_9sL.cjs"),require("react");const i=require("../../../CardImage-CW7cnY5T.cjs");require("./NavCard.js"),require("../icon/Icon.js"),require("../icon/icons/animated/ArrowVerticalAnimated.js"),require("../icon/icons/animated/ArrowHorizontalAnimated.js"),require("../icon/icons/animated/PlusRemoveAnimated.js"),require("../icon/icons/ArrowDownIcon.js"),require("../icon/icons/ArrowLeftIcon.js"),require("../icon/icons/ArrowNorthEastIcon.js"),require("../icon/icons/ArrowRightIcon.js"),require("../icon/icons/ArrowUpIcon.js"),require("../icon/icons/CalendarIcon.js"),require("../icon/icons/CheckIcon.js"),require("../icon/icons/ChevronDownIcon.js"),require("../icon/icons/ChevronLeftIcon.js"),require("../icon/icons/ChevronRightIcon.js"),require("../icon/icons/ChevronUpIcon.js"),require("../icon/icons/CloseIcon.js"),require("../icon/icons/CopyIcon.js"),require("../icon/icons/DotsIcon.js"),require("../icon/icons/DragIcon.js"),require("../icon/icons/ErrorIcon.js"),require("../icon/icons/GreenCheckIcon.js"),require("../icon/icons/HamburgerIcon.js"),require("../icon/icons/InfoIcon.js"),require("../icon/icons/LinkIcon.js"),require("../icon/icons/PlusIcon.js"),require("../icon/icons/QuestionIcon.js"),require("../icon/icons/RedCrossIcon.js"),require("../icon/icons/SearchIcon.js"),require("../icon/icons/SuccessIcon.js"),require("../icon/icons/WarningIcon.js"),require("../icon/icons/MinusIcon.js"),require("../icon/icons/ThumbDownIcon.js"),require("../icon/icons/ThumbUpIcon.js"),require("../icon/icons/TrashCanIcon.js"),require("../icon/icons/PenIcon.js"),require("../icon-button/IconButton.js"),require("../link/Link.js"),require("../link/NavLink.js"),require("../link-list/LinkList.js"),require("../tag/Tag.js"),require("../SlotComponent.js"),exports.CARD_PADDINGS=i.CARD_PADDINGS,exports.CARD_VARIANTS=i.CARD_VARIANTS,exports.Card=i.Card;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("../../../clsx-E3yX_9sL.cjs"),t=require("react"),a=require("../../utilities/polymorphism/SlotComponent.js"),s=t.forwardRef((function(t,s){const{className:i,clickable:l=!1,padding:o="s",variant:c="high",asChild:d,as:n="div",...u}=t,p=d?a.SlotComponent:n;return e.jsx(p,{"data-testid":"jkl-card","data-clickable":l,"data-padding":o,className:r.clsx("jkl-card",`jkl-card--${c}`,i),...u,ref:s})}));exports.CARD_PADDINGS=["s","m","l","xl"],exports.CARD_VARIANTS=["outlined","high","low"],exports.Card=s;
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","React","forwardRef","props","ref","className","clickable","padding","variant","asChild","as","componentProps","Component","SlotComponent","jsx","clsx"],"mappings":"2OA6CaA,EAAOC,EAAMC,YAAW,SACjCC,EACAC,GAEM,MACFC,UAAAA,EACAC,UAAAA,GAAY,EACZC,QAAAA,EAAU,IACVC,QAAAA,EAAU,OACVC,QAAAA,EACAC,GAAAA,EAAK,SACFC,GACHR,EAEES,EAAYH,EAAUI,EAAgBA,cAAAH,EAGxC,OAAAI,EAAAA,IAACF,EAAA,CACG,cAAY,WACZ,iBAAgBN,EAChB,eAAcC,EACdF,UAAWU,EAAKA,KAAA,WAAY,aAAaP,IAAWH,MAChDM,EACJP,IAAAA,GAGZ,0BAnE6B,CAAC,IAAK,IAAK,IAAK,4BAEhB,CAAC,WAAY,OAAQ"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("react/jsx-runtime"),require("../../../clsx-E3yX_9sL.cjs"),require("react");const i=require("../../../CardImage-CW7cnY5T.cjs");require("./NavCard.js"),require("../icon/Icon.js"),require("../icon/icons/animated/ArrowVerticalAnimated.js"),require("../icon/icons/animated/ArrowHorizontalAnimated.js"),require("../icon/icons/animated/PlusRemoveAnimated.js"),require("../icon/icons/ArrowDownIcon.js"),require("../icon/icons/ArrowLeftIcon.js"),require("../icon/icons/ArrowNorthEastIcon.js"),require("../icon/icons/ArrowRightIcon.js"),require("../icon/icons/ArrowUpIcon.js"),require("../icon/icons/CalendarIcon.js"),require("../icon/icons/CheckIcon.js"),require("../icon/icons/ChevronDownIcon.js"),require("../icon/icons/ChevronLeftIcon.js"),require("../icon/icons/ChevronRightIcon.js"),require("../icon/icons/ChevronUpIcon.js"),require("../icon/icons/CloseIcon.js"),require("../icon/icons/CopyIcon.js"),require("../icon/icons/DotsIcon.js"),require("../icon/icons/DragIcon.js"),require("../icon/icons/ErrorIcon.js"),require("../icon/icons/GreenCheckIcon.js"),require("../icon/icons/HamburgerIcon.js"),require("../icon/icons/InfoIcon.js"),require("../icon/icons/LinkIcon.js"),require("../icon/icons/PlusIcon.js"),require("../icon/icons/QuestionIcon.js"),require("../icon/icons/RedCrossIcon.js"),require("../icon/icons/SearchIcon.js"),require("../icon/icons/SuccessIcon.js"),require("../icon/icons/WarningIcon.js"),require("../icon/icons/MinusIcon.js"),require("../icon/icons/ThumbDownIcon.js"),require("../icon/icons/ThumbUpIcon.js"),require("../icon/icons/TrashCanIcon.js"),require("../icon/icons/PenIcon.js"),require("../icon-button/IconButton.js"),require("../link/Link.js"),require("../link/NavLink.js"),require("../link-list/LinkList.js"),require("../tag/Tag.js"),require("../SlotComponent.js"),exports.CardImage=i.CardImage;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("../../../clsx-E3yX_9sL.cjs"),t=require("react"),s=require("../../utilities/polymorphism/SlotComponent.js"),o=t.forwardRef((function({as:t,asChild:o,className:a,placement:i="top",...c},l){const m=o?s.SlotComponent:t||"img";return e.jsx(m,{ref:l,className:r.clsx("jkl-card-image",`jkl-card-image--${i}`,a),...c})}));exports.CardImage=o;
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","Component","SlotComponent","jsx","clsx"],"mappings":"2OA0BaA,EAAYC,EAAMC,YAAW,UACpCC,GAAAA,EAAIC,QAAAA,EAASC,UAAAA,EAAWC,UAAAA,EAAY,SAAUC,GAChDC,GAEM,MAAAC,EAAYL,EAAUM,gBAAgBP,GAAM,MAG9C,OAAAQ,EAAAA,IAACF,EAAA,CACGD,IAAAA,EACAH,UAAWO,EAAKA,KAAA,iBAAkB,mBAAmBN,IAAaD,MAC9DE,GAGhB"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../CardImage-CW7cnY5T.cjs"),a=require("./NavCard.js"),e=require("./TaskCard.js"),o=require("./InfoCard.js");exports.Card=r.Card,exports.CardImage=r.CardImage,exports.InfoBlock=a.InfoBlock,exports.NavCard=a.NavCard,exports.TaskCard=e.TaskCard,exports.InfoCard=o.InfoCard;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./Card.js"),e=require("./CardImage.js"),a=require("./NavCard.js"),o=require("./TaskCard.js"),s=require("./InfoCard.js");exports.Card=r.Card,exports.CardImage=e.CardImage,exports.InfoBlock=a.InfoBlock,exports.NavCard=a.NavCard,exports.TaskCard=o.TaskCard,exports.InfoCard=s.InfoCard;
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","forwardRef","props","ref","bold","children","className","filled","variant","iconProps","jsx","clsx"],"mappings":"6JA6BaA,mBAA4BC,YAAW,SAElDC,EAAwCC,GAChC,MAAEC,KAAAA,EAAMC,SAAAA,EAAUC,UAAAA,EAAWC,OAAAA,EAAQC,QAAAA,KAAYC,GAAcP,EAGjE,OAAAQ,EAAAA,IAAC,OAAA,CACG,eAAW,EACXP,IAAAA,EACAG,UAAWK,EAAAA,KAAK,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","forwardRef","props","ref","bold","children","className","filled","variant","iconProps","jsx","clsx"],"mappings":"6JA6BaA,mBAA4BC,YAAW,SAElDC,EAAwCC,GAChC,MAAEC,KAAAA,EAAMC,SAAAA,EAAUC,UAAAA,EAAWC,OAAAA,EAAQC,QAAAA,KAAYC,GAAcP,EAGjE,OAAAQ,EAAAA,IAAC,OAAA,CACG,eAAW,EACXP,IAAAA,EACAG,UAAWK,EAAAA,KAAK,WAAYL,EAAW,CACnC,mBAAoBC,EACpB,iBAAkBH,EAClB,CAAC,aAAaI,OAAcA,OAE5BC,EAEHJ,SAAAA,GAGb"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../CardImage-CW7cnY5T.cjs"),e=require("./card/NavCard.js"),n=require("./card/TaskCard.js"),r=require("./card/InfoCard.js"),s=require("./icon/Icon.js"),c=require("./icon/icons/animated/ArrowVerticalAnimated.js"),t=require("./icon/icons/animated/ArrowHorizontalAnimated.js"),i=require("./icon/icons/animated/PlusRemoveAnimated.js"),a=require("./icon/icons/ArrowDownIcon.js"),I=require("./icon/icons/ArrowLeftIcon.js"),u=require("./icon/icons/ArrowNorthEastIcon.js"),p=require("./icon/icons/ArrowRightIcon.js"),l=require("./icon/icons/ArrowUpIcon.js"),x=require("./icon/icons/CalendarIcon.js"),k=require("./icon/icons/CheckIcon.js"),d=require("./icon/icons/ChevronDownIcon.js"),j=require("./icon/icons/ChevronLeftIcon.js"),q=require("./icon/icons/ChevronRightIcon.js"),C=require("./icon/icons/ChevronUpIcon.js"),S=require("./icon/icons/CloseIcon.js"),h=require("./icon/icons/CopyIcon.js"),m=require("./icon/icons/DotsIcon.js"),A=require("./icon/icons/DragIcon.js"),g=require("./icon/icons/ErrorIcon.js"),T=require("./icon/icons/GreenCheckIcon.js"),w=require("./icon/icons/HamburgerIcon.js"),L=require("./icon/icons/InfoIcon.js"),b=require("./icon/icons/LinkIcon.js"),v=require("./icon/icons/PlusIcon.js"),R=require("./icon/icons/QuestionIcon.js"),f=require("./icon/icons/RedCrossIcon.js"),D=require("./icon/icons/SearchIcon.js"),B=require("./icon/icons/SuccessIcon.js"),E=require("./icon/icons/WarningIcon.js"),P=require("./icon/icons/MinusIcon.js"),G=require("./icon/icons/ThumbDownIcon.js"),N=require("./icon/icons/ThumbUpIcon.js"),U=require("./icon/icons/TrashCanIcon.js"),y=require("./icon/icons/PenIcon.js"),H=require("./icon-button/IconButton.js"),W=require("./link/Link.js"),M=require("./link/NavLink.js"),O=require("./link-list/LinkList.js"),z=require("./loader/Loader.js"),Q=require("./loader/skeletons/SkeletonAnimation.js"),V=require("./loader/skeletons/SkeletonButton.js"),F=require("./loader/skeletons/SkeletonCheckboxGroup.js"),J=require("./loader/skeletons/SkeletonElement.js"),K=require("./loader/skeletons/SkeletonInput.js"),X=require("./loader/skeletons/SkeletonRadioButtonGroup.js"),Y=require("./loader/skeletons/SkeletonTable.js"),Z=require("./loader/skeletons/SkeletonTextArea.js"),$=require("./tag/Tag.js"),_=require("./ScreenReaderOnly.js"),oo=require("./SlotComponent.js");exports.Card=o.Card,exports.CardImage=o.CardImage,exports.InfoBlock=e.InfoBlock,exports.NavCard=e.NavCard,exports.TaskCard=n.TaskCard,exports.InfoCard=r.InfoCard,exports.Icon=s.Icon,exports.ArrowVerticalAnimated=c.ArrowVerticalAnimated,exports.ArrowHorizontalAnimated=t.ArrowHorizontalAnimated,exports.PlusRemoveAnimated=i.PlusRemoveAnimated,exports.ArrowDownIcon=a.ArrowDownIcon,exports.ArrowLeftIcon=I.ArrowLeftIcon,exports.ArrowNorthEastIcon=u.ArrowNorthEastIcon,exports.ArrowRightIcon=p.ArrowRightIcon,exports.ArrowUpIcon=l.ArrowUpIcon,exports.CalendarIcon=x.CalendarIcon,exports.CheckIcon=k.CheckIcon,exports.ChevronDownIcon=d.ChevronDownIcon,exports.ChevronLeftIcon=j.ChevronLeftIcon,exports.ChevronRightIcon=q.ChevronRightIcon,exports.ChevronUpIcon=C.ChevronUpIcon,exports.CloseIcon=S.CloseIcon,exports.CopyIcon=h.CopyIcon,exports.DotsIcon=m.DotsIcon,exports.DragIcon=A.DragIcon,exports.ErrorIcon=g.ErrorIcon,exports.GreenCheckIcon=T.GreenCheckIcon,exports.HamburgerIcon=w.HamburgerIcon,exports.InfoIcon=L.InfoIcon,exports.LinkIcon=b.LinkIcon,exports.PlusIcon=v.PlusIcon,exports.QuestionIcon=R.QuestionIcon,exports.RedCrossIcon=f.RedCrossIcon,exports.SearchIcon=D.SearchIcon,exports.SuccessIcon=B.SuccessIcon,exports.WarningIcon=E.WarningIcon,exports.MinusIcon=P.MinusIcon,exports.ThumbDownIcon=G.ThumbDownIcon,exports.ThumbUpIcon=N.ThumbUpIcon,exports.TrashCanIcon=U.TrashCanIcon,exports.PenIcon=y.PenIcon,exports.IconButton=H.IconButton,exports.Link=W.Link,exports.NavLink=M.NavLink,exports.LinkList=O.LinkList,exports.Loader=z.Loader,exports.SkeletonAnimation=Q.SkeletonAnimation,exports.SkeletonButton=V.SkeletonButton,exports.SkeletonCheckboxGroup=F.SkeletonCheckboxGroup,exports.SkeletonElement=J.SkeletonElement,exports.SkeletonInput=K.SkeletonInput,exports.SkeletonRadioButtonGroup=X.SkeletonRadioButtonGroup,exports.SkeletonTable=Y.SkeletonTable,exports.SkeletonTableHeader=Y.SkeletonTableHeader,exports.SkeletonTableRow=Y.SkeletonTableRow,exports.SkeletonTextArea=Z.SkeletonTextArea,exports.ErrorTag=$.ErrorTag,exports.InfoTag=$.InfoTag,exports.SuccessTag=$.SuccessTag,exports.Tag=$.Tag,exports.WarningTag=$.WarningTag,exports.ScreenReaderOnly=_.ScreenReaderOnly,exports.SlotComponent=oo.SlotComponent;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./card/Card.js"),e=require("./card/CardImage.js"),r=require("./card/NavCard.js"),n=require("./card/TaskCard.js"),s=require("./card/InfoCard.js"),t=require("./icon/Icon.js"),i=require("./icon/icons/animated/ArrowVerticalAnimated.js"),c=require("./icon/icons/animated/ArrowHorizontalAnimated.js"),p=require("./icon/icons/animated/PlusRemoveAnimated.js"),a=require("./icon/icons/ArrowDownIcon.js"),u=require("./icon/icons/ArrowLeftIcon.js"),I=require("./icon/icons/ArrowNorthEastIcon.js"),l=require("./icon/icons/ArrowRightIcon.js"),x=require("./icon/icons/ArrowUpIcon.js"),k=require("./icon/icons/CalendarIcon.js"),j=require("./icon/icons/CheckIcon.js"),d=require("./icon/icons/ChevronDownIcon.js"),q=require("./icon/icons/ChevronLeftIcon.js"),C=require("./icon/icons/ChevronRightIcon.js"),T=require("./icon/icons/ChevronUpIcon.js"),g=require("./icon/icons/CloseIcon.js"),S=require("./icon/icons/CopyIcon.js"),h=require("./icon/icons/DotsIcon.js"),A=require("./icon/icons/DragIcon.js"),m=require("./icon/icons/ErrorIcon.js"),w=require("./icon/icons/GreenCheckIcon.js"),L=require("./icon/icons/HamburgerIcon.js"),b=require("./icon/icons/InfoIcon.js"),v=require("./icon/icons/LinkIcon.js"),R=require("./icon/icons/PlusIcon.js"),f=require("./icon/icons/QuestionIcon.js"),D=require("./icon/icons/RedCrossIcon.js"),G=require("./icon/icons/SearchIcon.js"),P=require("./icon/icons/SuccessIcon.js"),B=require("./icon/icons/WarningIcon.js"),E=require("./icon/icons/MinusIcon.js"),N=require("./icon/icons/ThumbDownIcon.js"),U=require("./icon/icons/ThumbUpIcon.js"),y=require("./icon/icons/TrashCanIcon.js"),H=require("./icon/icons/PenIcon.js"),W=require("./icon-button/IconButton.js"),M=require("./input-group/FieldGroup.js"),O=require("./input-group/InputGroup.js"),z=require("./input-group/Label.js"),F=require("./input-group/SupportLabel.js"),Q=require("./link/Link.js"),V=require("./link/NavLink.js"),J=require("./link-list/LinkList.js"),K=require("./loader/Loader.js"),X=require("./loader/skeletons/SkeletonAnimation.js"),Y=require("./loader/skeletons/SkeletonButton.js"),Z=require("./loader/skeletons/SkeletonCheckboxGroup.js"),$=require("./loader/skeletons/SkeletonElement.js"),_=require("./loader/skeletons/SkeletonInput.js"),oo=require("./loader/skeletons/SkeletonRadioButtonGroup.js"),eo=require("./loader/skeletons/SkeletonTable.js"),ro=require("./loader/skeletons/SkeletonTextArea.js"),no=require("./tag/Tag.js"),so=require("./tooltip/Tooltip.js"),to=require("./tooltip/TooltipContent.js"),io=require("./tooltip/TooltipTrigger.js"),co=require("./tooltip/PopupTip.js"),po=require("./ScreenReaderOnly.js");exports.Card=o.Card,exports.CardImage=e.CardImage,exports.InfoBlock=r.InfoBlock,exports.NavCard=r.NavCard,exports.TaskCard=n.TaskCard,exports.InfoCard=s.InfoCard,exports.Icon=t.Icon,exports.ArrowVerticalAnimated=i.ArrowVerticalAnimated,exports.ArrowHorizontalAnimated=c.ArrowHorizontalAnimated,exports.PlusRemoveAnimated=p.PlusRemoveAnimated,exports.ArrowDownIcon=a.ArrowDownIcon,exports.ArrowLeftIcon=u.ArrowLeftIcon,exports.ArrowNorthEastIcon=I.ArrowNorthEastIcon,exports.ArrowRightIcon=l.ArrowRightIcon,exports.ArrowUpIcon=x.ArrowUpIcon,exports.CalendarIcon=k.CalendarIcon,exports.CheckIcon=j.CheckIcon,exports.ChevronDownIcon=d.ChevronDownIcon,exports.ChevronLeftIcon=q.ChevronLeftIcon,exports.ChevronRightIcon=C.ChevronRightIcon,exports.ChevronUpIcon=T.ChevronUpIcon,exports.CloseIcon=g.CloseIcon,exports.CopyIcon=S.CopyIcon,exports.DotsIcon=h.DotsIcon,exports.DragIcon=A.DragIcon,exports.ErrorIcon=m.ErrorIcon,exports.GreenCheckIcon=w.GreenCheckIcon,exports.HamburgerIcon=L.HamburgerIcon,exports.InfoIcon=b.InfoIcon,exports.LinkIcon=v.LinkIcon,exports.PlusIcon=R.PlusIcon,exports.QuestionIcon=f.QuestionIcon,exports.RedCrossIcon=D.RedCrossIcon,exports.SearchIcon=G.SearchIcon,exports.SuccessIcon=P.SuccessIcon,exports.WarningIcon=B.WarningIcon,exports.MinusIcon=E.MinusIcon,exports.ThumbDownIcon=N.ThumbDownIcon,exports.ThumbUpIcon=U.ThumbUpIcon,exports.TrashCanIcon=y.TrashCanIcon,exports.PenIcon=H.PenIcon,exports.IconButton=W.IconButton,exports.FieldGroup=M.FieldGroup,exports.InputGroup=O.InputGroup,exports.Label=z.Label,exports.SupportLabel=F.SupportLabel,exports.Link=Q.Link,exports.NavLink=V.NavLink,exports.LinkList=J.LinkList,exports.Loader=K.Loader,exports.SkeletonAnimation=X.SkeletonAnimation,exports.SkeletonButton=Y.SkeletonButton,exports.SkeletonCheckboxGroup=Z.SkeletonCheckboxGroup,exports.SkeletonElement=$.SkeletonElement,exports.SkeletonInput=_.SkeletonInput,exports.SkeletonRadioButtonGroup=oo.SkeletonRadioButtonGroup,exports.SkeletonTable=eo.SkeletonTable,exports.SkeletonTableHeader=eo.SkeletonTableHeader,exports.SkeletonTableRow=eo.SkeletonTableRow,exports.SkeletonTextArea=ro.SkeletonTextArea,exports.ErrorTag=no.ErrorTag,exports.InfoTag=no.InfoTag,exports.SuccessTag=no.SuccessTag,exports.Tag=no.Tag,exports.WarningTag=no.WarningTag,exports.Tooltip=so.Tooltip,exports.TooltipContent=to.TooltipContent,exports.TooltipTrigger=io.TooltipTrigger,exports.PopupTip=co.PopupTip,exports.ScreenReaderOnly=po.ScreenReaderOnly;
2
2
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("classnames");require("react"),require("../../hooks/useScreen/useScreen.js");const s=require("../../hooks/useId/useId.js");require("../tooltip/Tooltip.js"),require("../tooltip/TooltipContent.js"),require("../tooltip/TooltipTrigger.js");const t=require("../tooltip/PopupTip.js"),i=require("./Label.js"),l=require("./SupportLabel.js");exports.FieldGroup=o=>{const{id:a,legend:p,labelProps:d,supportLabelProps:u,tooltipProps:n,className:c,children:j,helpLabel:b,errorLabel:g,density:h,"data-testautoid":q,...x}=o,y=s.useId(a||"jkl-field-group",{generateSuffix:!a}),m=`${y}_support-label`,S=g||b,T=g?"error":b?"help":void 0,f=S?m:void 0;return e.jsxs("fieldset",{id:y,className:r("jkl-field-group",c),"data-testautoid":q,...x,"aria-describedby":f,"data-density":h,children:[e.jsx("legend",{className:"jkl-field-group__legend",children:e.jsxs(i.Label,{...d,density:h,children:[!n&&p,n&&e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{whiteSpace:"normal"},children:p})," ",e.jsx(t.PopupTip,{...n})]})]})}),j,(b||g)&&e.jsx(l.SupportLabel,{...u,label:S,labelType:T,id:m,density:h})]})};
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":["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":"+dAmBgDA,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,QAAMb,GAAM,kBAAmB,CAAEc,gBAAiBd,IACxDe,EAAY,GAAGH,kBAEfI,EAAcR,GAAcD,EAC5BU,EAAkBT,EAAa,QAAUD,EAAY,YAAS,EAE9DW,EAAcF,EAAcD,OAAY,EAG1C,OAAAI,EAAAA,KAAC,WAAA,CACGnB,GAAIY,EACJP,UAAWe,EAAG,kBAAmBf,GACjC,kBAAiBK,KACbC,EACJ,mBAAkBO,EAClB,eAAcT,EAEdH,SAAA,CAAAe,EAAAA,IAAC,UAAOhB,UAAU,0BACdC,gBAACgB,EAAAA,MAAO,IAAGpB,EAAYO,QAAAA,EAClBH,SAAA,EAACF,GAAgBH,EACjBG,GAEOe,EAAAA,KAAAI,WAAA,CAAAjB,SAAA,CAAAe,MAAC,QAAKG,MAAO,CAAEC,WAAY,UAAanB,SAAOL,IAC9C,IACDoB,EAAAA,IAACK,EAAUA,SAAA,IAAGtB,YAK7BE,GACCC,GAAaC,IACXa,EAAAA,IAACM,EAAAA,aAAA,IACOxB,EACJyB,MAAOZ,EACPa,UAAWZ,EACXjB,GAAIe,EACJN,QAAAA,MACJ"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("classnames"),i=require("react");require("../../hooks/useScreen/useScreen.js");const l=require("../../hooks/useId/useId.js");require("../tooltip/Tooltip.js"),require("../tooltip/TooltipContent.js"),require("../tooltip/TooltipTrigger.js");const s=require("../tooltip/PopupTip.js"),o=require("./Label.js"),t=require("./SupportLabel.js"),n=i.forwardRef(((n,p)=>{const{className:a,children:u,density:d,errorLabel:c,helpLabel:j,inline:b,label:y,labelProps:h,render:m,supportLabelProps:q,tooltipProps:x,id:S,...g}=n,v=l.useId(S||"jkl-input",{generateSuffix:!S}),T=l.useId("jkl-support-label"),f=c||j,L=c?"error":j?"help":void 0,k={"aria-describedby":f?T:void 0,"aria-invalid":!!c||void 0,id:v},I=m?()=>m(k):()=>{const e=i.Children.toArray(n.children)[0];if(i.isValidElement(e))return i.cloneElement(e,{...k,...e.props})};return e.jsxs("div",{ref:p,className:r(a,"jkl-input-group",{"jkl-input-group--inline":b}),"data-density":d,...g,children:[e.jsxs(o.Label,{standAlone:!0,htmlFor:v,srOnly:b,...h,style:{whiteSpace:x?"nowrap":void 0,...null==h?void 0:h.style},density:d,children:[!x&&y,x&&e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{whiteSpace:"normal"},children:y})," ",e.jsx(s.PopupTip,{...x})]})]}),I(),e.jsx(t.SupportLabel,{srOnly:b,...q,label:f,labelType:L,id:T,density:d})]})}));n.displayName="InputGroup",exports.InputGroup=n;
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":"8cA+BaA,EAAaC,EAAAA,YAA4C,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,QAAMH,GAAM,YAAa,CAAEI,gBAAiBJ,IAClDK,EAAYF,QAAM,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,GAErD,GAAKqB,EAAMG,eAA2BJ,GAE/B,OAAAC,EAAMI,aAAyBL,EAAO,IACtCF,KACAE,EAAMvB,OACZ,EAIP,OAAA6B,EAAAA,KAAC,MAAA,CACG5B,IAAAA,EACAC,UAAW4B,EAAG5B,EAAW,kBAAmB,CACxC,0BAA2BK,IAE/B,eAAcH,KACVU,EAEJX,SAAA,CAAA0B,EAAAA,KAACE,EAAAA,MAAA,CACGC,YAAU,EACVC,QAASlB,EACTmB,OAAQ3B,KACJE,EACJ0B,MAAO,CAAEC,WAAYxB,EAAe,cAAW,KAAc,MAAAH,OAAA,EAAAA,EAAY0B,OACzE/B,QAAAA,EAECD,SAAA,EAACS,GAAgBJ,EACjBI,GAEOiB,EAAAA,KAAAQ,WAAA,CAAAlC,SAAA,CAAAmC,MAAC,QAAKH,MAAO,CAAEC,WAAY,UAAajC,SAAMK,IAC7C,IACD8B,EAAAA,IAACC,EAAUA,SAAA,IAAG3B,UAIzBU,IACDgB,EAAAA,IAACE,EAAAA,aAAA,CACGN,OAAQ3B,KACJI,EACJH,MAAOW,EACPsB,UAAWrB,EACXP,GAAIK,EACJd,QAAAA,MACJ,IAKZN,EAAW4C,YAAc"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("classnames");exports.Label=({variant:s="small",density:a,srOnly:n,children:l,standAlone:o,htmlFor:r,className:i="",...c})=>{const d=t("jkl-label",i,{[`jkl-label--${s}`]:s,"jkl-label--sr-only":n}),p=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.jsx(p,{...c,className:d,htmlFor:r,"data-density":a,children:l})};
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":["variant","density","srOnly","children","standAlone","htmlFor","className","rest","labelClassNames","classNames","C","process","env","NODE_ENV","console","warn","jsx"],"mappings":"2JAiBqC,EACjCA,QAAAA,EAAU,QACVC,QAAAA,EACAC,OAAAA,EACAC,SAAAA,EACAC,WAAAA,EACAC,QAAAA,EACAC,UAAAA,EAAY,MACTC,MAEG,MAAAC,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,MAACN,MAAMH,EAAMD,UAAWE,EAAiBH,QAAAA,EAAkB,eAAcJ,EACpEE,SAAAA,GACL"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),r=require("classnames");require("../icon/Icon.js"),require("../icon/icons/animated/ArrowVerticalAnimated.js"),require("../icon/icons/animated/ArrowHorizontalAnimated.js"),require("../icon/icons/animated/PlusRemoveAnimated.js"),require("../icon/icons/ArrowDownIcon.js"),require("../icon/icons/ArrowLeftIcon.js"),require("../icon/icons/ArrowNorthEastIcon.js"),require("../icon/icons/ArrowRightIcon.js"),require("../icon/icons/ArrowUpIcon.js"),require("../icon/icons/CalendarIcon.js"),require("../icon/icons/CheckIcon.js"),require("../icon/icons/ChevronDownIcon.js"),require("../icon/icons/ChevronLeftIcon.js"),require("../icon/icons/ChevronRightIcon.js"),require("../icon/icons/ChevronUpIcon.js"),require("../icon/icons/CloseIcon.js"),require("../icon/icons/CopyIcon.js"),require("../icon/icons/DotsIcon.js"),require("../icon/icons/DragIcon.js");const n=require("../icon/icons/ErrorIcon.js");require("../icon/icons/GreenCheckIcon.js"),require("../icon/icons/HamburgerIcon.js"),require("../icon/icons/InfoIcon.js"),require("../icon/icons/LinkIcon.js"),require("../icon/icons/PlusIcon.js"),require("../icon/icons/QuestionIcon.js"),require("../icon/icons/RedCrossIcon.js"),require("../icon/icons/SearchIcon.js");const e=require("../icon/icons/SuccessIcon.js"),i=require("../icon/icons/WarningIcon.js");require("../icon/icons/MinusIcon.js"),require("../icon/icons/ThumbDownIcon.js"),require("../icon/icons/ThumbUpIcon.js"),require("../icon/icons/TrashCanIcon.js"),require("../icon/icons/PenIcon.js");exports.SupportLabel=({id:c,helpLabel:s,errorLabel:u,label:a,labelType:l="help",density:j,className:t,srOnly:q,...I})=>{const p=u||s||a,m="error"===l,h="success"===l,b=p?r("jkl-form-support-label",t,{"jkl-form-support-label--sr-only":q,"jkl-form-support-label--help":"help"===l||s&&!u,"jkl-form-support-label--error":m,"jkl-form-support-label--warning":"warning"===l||u,"jkl-form-support-label--success":h}):"jkl-dormant-form-support-label",d=p?I:{},f=m?n.ErrorIcon:h?e.SuccessIcon:i.WarningIcon;return o.jsxs("span",{id:c,className:b,...d,"data-density":j,children:[o.jsx(f,{variant:"small",className:"jkl-form-support-label__icon"}),o.jsx("span",{children:u||s||a})]})};
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":["id","helpLabel","errorLabel","label","labelType","density","className","srOnly","rest","hasLabel","isError","isSuccess","componentClassName","cn","restProps","Icon","ErrorIcon","SuccessIcon","WarningIcon","jsxs","children","jsx","variant"],"mappings":"gmDAiEmD,EAC/CA,GAAAA,EACAC,UAAAA,EACAC,WAAAA,EACAC,MAAAA,EACAC,UAAAA,EAAY,OACZC,QAAAA,EACAC,UAAAA,EACAC,OAAAA,KACGC,MAEG,MAAAC,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,iCAEAG,EAAYL,EAAWD,EAAO,GAE9BO,EAAOL,EAAUM,EAAAA,UAAYL,EAAYM,EAAAA,YAAcC,EAAAA,YAGzD,OAAAC,OAAC,QAAKnB,GAAAA,EAAQM,UAAWM,KAAwBE,EAAW,eAAcT,EACtEe,SAAA,CAAAC,EAAAA,IAACN,EAAK,CAAAO,QAAQ,QAAQhB,UAAU,iCAC/Be,EAAAA,IAAA,OAAA,CAAMD,SAAclB,GAAAD,GAAaE,MACtC"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./FieldGroup.js"),r=require("./InputGroup.js"),p=require("./Label.js"),o=require("./SupportLabel.js");exports.FieldGroup=e.FieldGroup,exports.InputGroup=r.InputGroup,exports.Label=p.Label,exports.SupportLabel=o.SupportLabel;
2
+ //# sourceMappingURL=index.js.map
@@ -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","forwardRef","props","ref","external","className","children","as","rest","Component","jsx","clsx"],"mappings":"6JAeaA,mBAAaC,YAAW,SACjCC,EACAC,GAEM,MAAEC,SAAAA,GAAW,EAAOC,UAAAA,EAAY,GAAIC,SAAAA,EAAUC,GAAAA,EAAK,OAAQC,GAASN,EACpEO,EAAYF,EAGd,OAAAG,EAAAA,IAACD,EAAA,CACGN,IAAAA,EACAE,UAAWM,EAAAA,KAAK,WAAYN,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","forwardRef","props","ref","external","className","children","as","rest","Component","jsx","clsx"],"mappings":"6JAeaA,mBAAaC,YAAW,SACjCC,EACAC,GAEM,MAAEC,SAAAA,GAAW,EAAOC,UAAAA,EAAY,GAAIC,SAAAA,EAAUC,GAAAA,EAAK,OAAQC,GAASN,EACpEO,EAAYF,EAGd,OAAAG,EAAAA,IAACD,EAAA,CACGN,IAAAA,EACAE,UAAWM,EAAAA,KAAK,WAAYN,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","forwardRef","props","ref","active","back","className","children","as","rest","Component","jsx","clsx"],"mappings":"6JAgBaA,mBAAgBC,YAAW,SACpCC,EACAC,GAEM,MAAEC,OAAAA,GAAS,EAAOC,KAAAA,GAAO,EAAOC,UAAAA,EAAWC,SAAAA,EAAUC,GAAAA,EAAK,OAAQC,GAASP,EAC3EQ,EAAYF,EAGd,OAAAG,EAAAA,IAACD,EAAA,CACGP,IAAAA,EACAG,UAAWM,EAAAA,KACP,eACA,CACI,uBAAwBR,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","forwardRef","props","ref","active","back","className","children","as","rest","Component","jsx","clsx"],"mappings":"6JAgBaA,mBAAgBC,YAAW,SACpCC,EACAC,GAEM,MAAEC,OAAAA,GAAS,EAAOC,KAAAA,GAAO,EAAOC,UAAAA,EAAWC,SAAAA,EAAUC,GAAAA,EAAK,OAAQC,GAASP,EAC3EQ,EAAYF,EAGd,OAAAG,EAAAA,IAACD,EAAA,CACGP,IAAAA,EACAG,UAAWM,EAAAA,KACP,eACA,CACI,uBAAwBR,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":"omDAKA,MAQMA,EAAOC,EAAMC,YAAW,SAC1BC,EACAC,GAEM,MAAEC,GAAIC,EAAY,IAAKC,SAAAA,EAAUC,UAAAA,KAAcC,GAASN,EAG1D,OAAAO,OAACJ,GAAUE,UAAWG,EAAAA,KAAK,qBAAsBH,GAAYJ,IAAAA,KAAcK,EACtEF,SAAA,CAAAA,EACDK,EAAAA,IAACC,EAAeA,eAAA,CAAAL,UAAU,gCAGtC,IAYaM,EAAW,EAAGC,QAAAA,EAASP,UAAAA,KAAcC,MACxC,MAAAH,EAAwB,YAAZS,EAAwB,KAAO,KAG7C,OAAAH,EAAAA,IAACN,EAAA,CACGE,UAAWG,EAAAA,KAAK,gBAAiBH,EAAW,CACxC,yBAAsC,YAAZO,EAC1B,2BAAwC,cAAZA,OAE5BN,GAAA,EAKhBK,EAASd,KAAOA,EAChBc,EAASE,KA/C8B,EAAGR,UAAAA,KAAcC,KAC7CG,EAAAA,IAAC,MAAGJ,UAAWG,EAAAA,KAAK,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":"omDAKA,MAQMA,EAAOC,EAAMC,YAAW,SAC1BC,EACAC,GAEM,MAAEC,GAAIC,EAAY,IAAKC,SAAAA,EAAUC,UAAAA,KAAcC,GAASN,EAG1D,OAAAO,OAACJ,GAAUE,UAAWG,EAAAA,KAAK,qBAAsBH,GAAYJ,IAAAA,KAAcK,EACtEF,SAAA,CAAAA,EACDK,EAAAA,IAACC,EAAeA,eAAA,CAAAL,UAAU,gCAGtC,IAYaM,EAAW,EAAGC,QAAAA,EAASP,UAAAA,KAAcC,MACxC,MAAAH,EAAwB,YAAZS,EAAwB,KAAO,KAG7C,OAAAH,EAAAA,IAACN,EAAA,CACGE,UAAWG,EAAAA,KAAK,gBAAiBH,EAAW,CACxC,yBAAsC,YAAZO,EAC1B,2BAAwC,cAAZA,OAE5BN,GAAA,EAKhBK,EAASd,KAAOA,EAChBc,EAASE,KA/C8B,EAAGR,UAAAA,KAAcC,KAC7CG,EAAAA,IAAC,MAAGJ,UAAWG,EAAAA,KAAK,qBAAsBH,MAAgBC"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),n=require("classnames"),i=require("react");require("../icon/Icon.js"),require("../icon/icons/animated/ArrowVerticalAnimated.js"),require("../icon/icons/animated/ArrowHorizontalAnimated.js"),require("../icon/icons/animated/PlusRemoveAnimated.js"),require("../icon/icons/ArrowDownIcon.js"),require("../icon/icons/ArrowLeftIcon.js"),require("../icon/icons/ArrowNorthEastIcon.js"),require("../icon/icons/ArrowRightIcon.js"),require("../icon/icons/ArrowUpIcon.js"),require("../icon/icons/CalendarIcon.js"),require("../icon/icons/CheckIcon.js"),require("../icon/icons/ChevronDownIcon.js"),require("../icon/icons/ChevronLeftIcon.js"),require("../icon/icons/ChevronRightIcon.js"),require("../icon/icons/ChevronUpIcon.js"),require("../icon/icons/CloseIcon.js"),require("../icon/icons/CopyIcon.js"),require("../icon/icons/DotsIcon.js"),require("../icon/icons/DragIcon.js"),require("../icon/icons/ErrorIcon.js"),require("../icon/icons/GreenCheckIcon.js"),require("../icon/icons/HamburgerIcon.js"),require("../icon/icons/InfoIcon.js"),require("../icon/icons/LinkIcon.js"),require("../icon/icons/PlusIcon.js");const e=require("../icon/icons/QuestionIcon.js");require("../icon/icons/RedCrossIcon.js"),require("../icon/icons/SearchIcon.js"),require("../icon/icons/SuccessIcon.js"),require("../icon/icons/WarningIcon.js"),require("../icon/icons/MinusIcon.js"),require("../icon/icons/ThumbDownIcon.js"),require("../icon/icons/ThumbUpIcon.js"),require("../icon/icons/TrashCanIcon.js"),require("../icon/icons/PenIcon.js");const r=require("./Tooltip.js"),c=require("./TooltipContent.js"),s=require("./TooltipTrigger.js");exports.PopupTip=({content:u,triggerProps:t,...j})=>{const[l,q]=i.useState(!1);return o.jsxs(r.Tooltip,{triggerOn:"click",...j,children:[o.jsx(s.TooltipTrigger,{children:o.jsxs("button",{...t,onFocus:o=>{var n;q(!0),null==(n=null==t?void 0:t.onFocus)||n.call(t,o)},onBlur:o=>{var n;q(!1),null==(n=null==t?void 0:t.onBlur)||n.call(t,o)},type:"button",className:n("jkl-tooltip-question-button",null==t?void 0:t.className),children:[o.jsx(e.QuestionIcon,{variant:"inherit",bold:l}),o.jsx("span",{className:"jkl-sr-only",children:"Vis hjelpetekst"})]})}),o.jsx(c.TooltipContent,{children:u})]})};
2
+ //# sourceMappingURL=PopupTip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PopupTip.js","sources":["../../../../src/components/tooltip/PopupTip.tsx"],"sourcesContent":["import cn from \"classnames\";\nimport React, { useState, type FC, type ReactNode, HTMLProps, FocusEventHandler } from \"react\";\nimport { QuestionIcon } from \"../icon\";\nimport { Tooltip, type TooltipProps } from \"./Tooltip\";\nimport { TooltipContent } from \"./TooltipContent\";\nimport { TooltipTrigger } from \"./TooltipTrigger\";\n\nexport interface PopupTipProps extends Omit<TooltipProps, \"triggerOn\" | \"children\"> {\n /**\n * Innholdet i tooltipet som vises\n */\n content: ReactNode;\n /**\n * Eventuelle props du vil sette på trigger-knappen for tooltipet\n */\n triggerProps?: Omit<HTMLProps<HTMLButtonElement>, \"children\" | \"type\">;\n}\n\nexport const PopupTip: FC<PopupTipProps> = ({ content, triggerProps, ...tooltipProps }) => {\n const [isBold, setIsBold] = useState(false);\n\n const handleFocus: FocusEventHandler<HTMLButtonElement> = (event) => {\n setIsBold(true);\n triggerProps?.onFocus?.(event);\n };\n const handleBlur: FocusEventHandler<HTMLButtonElement> = (event) => {\n setIsBold(false);\n triggerProps?.onBlur?.(event);\n };\n\n return (\n <Tooltip triggerOn=\"click\" {...tooltipProps}>\n <TooltipTrigger>\n <button\n {...triggerProps}\n onFocus={handleFocus}\n onBlur={handleBlur}\n type=\"button\"\n className={cn(\"jkl-tooltip-question-button\", triggerProps?.className)}\n >\n <QuestionIcon variant=\"inherit\" bold={isBold} />\n <span className=\"jkl-sr-only\">Vis hjelpetekst</span>\n </button>\n </TooltipTrigger>\n <TooltipContent>{content}</TooltipContent>\n </Tooltip>\n );\n};\n"],"names":["content","triggerProps","tooltipProps","isBold","setIsBold","useState","jsxs","Tooltip","triggerOn","children","jsx","TooltipTrigger","onFocus","event","_a","call","onBlur","type","className","cn","QuestionIcon","variant","bold","TooltipContent"],"mappings":"usDAkB2C,EAAGA,QAAAA,EAASC,aAAAA,KAAiBC,MACpE,MAAOC,EAAQC,GAAaC,YAAS,GAWrC,OACKC,EAAAA,KAAAC,EAAAA,QAAA,CAAQC,UAAU,WAAYN,EAC3BO,SAAA,CAAAC,MAACC,EAAAA,eACG,CAAAF,SAAAH,EAAAA,KAAC,SAAA,IACOL,EACJW,QAd2CC,UACvDT,GAAU,GACV,OAAAU,EAAA,MAAAb,SAAAA,EAAcW,UAAdE,EAAAC,KAAAd,EAAwBY,EAAK,EAajBG,OAX0CH,UACtDT,GAAU,GACV,OAAAU,EAAA,MAAAb,OAAAA,EAAAA,EAAce,SAAdF,EAAAC,KAAAd,EAAuBY,EAAAA,EAUXI,KAAK,SACLC,UAAWC,EAAG,8BAA+B,MAAAlB,SAAAA,EAAciB,WAE3DT,SAAA,CAAAC,EAAAA,IAACU,EAAaA,aAAA,CAAAC,QAAQ,UAAUC,KAAMnB,IACrCO,EAAAA,IAAA,OAAA,CAAKQ,UAAU,cAAcT,SAAe,yBAGrDC,EAAAA,IAACa,kBAAgBd,SAAQT,MAC7B"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("@floating-ui/react"),n=require("react"),o=({initialOpen:e=!1,placement:o="top",delay:r=250,triggerOn:i="hover"})=>{const[s,l]=n.useState(e),u=n.useRef(null),c=n.useRef(null),a=t.useFloating({open:s,onOpenChange:l,placement:o,whileElementsMounted:t.autoUpdate,middleware:[t.offset(16),t.flip(),t.shift({padding:16}),t.arrow({element:u,padding:20})]}),p=t.useRole(a.context,{role:"tooltip"}),d=t.useDismiss(a.context,{referencePress:!1}),x=t.useClick(a.context,{enabled:"click"===i&&!s}),f=t.useHover(a.context,{enabled:"hover"===i,delay:s?0:r}),g=t.useFocus(a.context,{enabled:"click"!==i||s}),m=t.useInteractions([d,g,p,x,f]);return{triggerOn:i,isOpen:s,setOpen:l,arrowElement:u,...a,refs:{...a.refs,description:c,setDescription:e=>c.current=e},...m}},r=n.createContext(null),i=r.Provider;exports.Tooltip=({children:t,...n})=>{const r=o(n);return e.jsx(i,{value:r,children:t})},exports.TooltipProvider=i,exports.useTooltip=o,exports.useTooltipContext=()=>{const e=n.useContext(r);if(null===e)throw new Error("Tooltip-komponentene kan kun brukes inne i <Tooltip />");return e};
2
+ //# sourceMappingURL=Tooltip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tooltip.js","sources":["../../../../src/components/tooltip/Tooltip.tsx"],"sourcesContent":["import {\n type Placement,\n arrow,\n autoUpdate,\n flip,\n offset,\n shift,\n useClick,\n useDismiss,\n useFloating,\n useFocus,\n useHover,\n useInteractions,\n useRole,\n} from \"@floating-ui/react\";\nimport React, { FC, createContext, useContext, useRef, useState } from \"react\";\nimport { type WithChildren } from \"../../core\";\n\nexport type TooltipPlacement = Extract<Placement, \"top-start\" | \"top-end\" | \"left\" | \"right\" | \"top\">;\n\nexport interface TooltipProps {\n /**\n * Sett til true dersom du ønsker at tooltipen skal være åpen som default\n * @default false\n */\n initialOpen?: boolean;\n /**\n * Plassering av tooltipen i forhold til triggeren. Tooltipen vil automatisk\n * bytte posisjon dersom det ikke er plass.\n * @default \"top\"\n */\n placement?: TooltipPlacement;\n /**\n * Valgfri forsinkelse før tooltipen åpner. Ignoreres dersom triggerOn er satt til \"click\"\n * @default 250\n */\n delay?: number;\n /**\n * Angir om tooltipen skal åpnes ved klikk eller hover\n * @default \"hover\"\n */\n triggerOn?: \"click\" | \"hover\";\n}\n\nexport const useTooltip = ({\n initialOpen = false,\n placement = \"top\",\n delay = 250,\n triggerOn = \"hover\",\n}: TooltipProps) => {\n const [isOpen, setOpen] = useState(initialOpen);\n const arrowElement = useRef<HTMLElement>(null);\n const description = useRef<HTMLElement | null>(null);\n const setDescription = (element: HTMLElement | null) => (description.current = element);\n\n const data = useFloating({\n open: isOpen,\n onOpenChange: setOpen,\n placement,\n whileElementsMounted: autoUpdate,\n middleware: [offset(16), flip(), shift({ padding: 16 }), arrow({ element: arrowElement, padding: 20 })],\n });\n\n const role = useRole(data.context, { role: \"tooltip\" });\n const dismiss = useDismiss(data.context, { referencePress: false });\n const click = useClick(data.context, { enabled: triggerOn === \"click\" && !isOpen });\n const hover = useHover(data.context, { enabled: triggerOn === \"hover\", delay: isOpen ? 0 : delay });\n const focus = useFocus(data.context, { enabled: triggerOn === \"click\" ? isOpen : true });\n\n const interactions = useInteractions([dismiss, focus, role, click, hover]);\n\n return {\n triggerOn,\n isOpen,\n setOpen,\n arrowElement,\n ...data,\n refs: {\n ...data.refs,\n description,\n setDescription,\n },\n ...interactions,\n };\n};\n\nexport type TooltipContext = ReturnType<typeof useTooltip> | null;\n\nconst tooltipContext = createContext<TooltipContext>(null);\n\nexport const TooltipProvider = tooltipContext.Provider;\n\nexport const useTooltipContext = () => {\n const context = useContext(tooltipContext);\n\n if (context === null) {\n throw new Error(\"Tooltip-komponentene kan kun brukes inne i <Tooltip />\");\n }\n\n return context;\n};\n\nexport const Tooltip: FC<TooltipProps & WithChildren> = ({ children, ...options }) => {\n const tooltip = useTooltip(options);\n\n return <TooltipProvider value={tooltip}>{children}</TooltipProvider>;\n};\n"],"names":["useTooltip","initialOpen","placement","delay","triggerOn","isOpen","setOpen","useState","arrowElement","useRef","description","data","useFloating","open","onOpenChange","whileElementsMounted","autoUpdate","middleware","offset","flip","shift","padding","arrow","element","role","useRole","context","dismiss","useDismiss","referencePress","click","useClick","enabled","hover","useHover","focus","useFocus","interactions","useInteractions","refs","setDescription","current","tooltipContext","createContext","TooltipProvider","Provider","children","options","tooltip","jsx","value","useContext","Error"],"mappings":"wKA4CaA,EAAa,EACtBC,YAAAA,GAAc,EACdC,UAAAA,EAAY,MACZC,MAAAA,EAAQ,IACRC,UAAAA,EAAY,YAEZ,MAAOC,EAAQC,GAAWC,WAASN,GAC7BO,EAAeC,SAAoB,MACnCC,EAAcD,SAA2B,MAGzCE,EAAOC,EAAAA,YAAY,CACrBC,KAAMR,EACNS,aAAcR,EACdJ,UAAAA,EACAa,qBAAsBC,EAAAA,WACtBC,WAAY,CAACC,EAAAA,OAAO,IAAKC,EAAAA,OAAQC,QAAM,CAAEC,QAAS,KAAOC,QAAM,CAAEC,QAASf,EAAca,QAAS,QAG/FG,EAAOC,EAAAA,QAAQd,EAAKe,QAAS,CAAEF,KAAM,YACrCG,EAAUC,EAAAA,WAAWjB,EAAKe,QAAS,CAAEG,gBAAgB,IACrDC,EAAQC,EAAAA,SAASpB,EAAKe,QAAS,CAAEM,QAAuB,UAAd5B,IAA0BC,IACpE4B,EAAQC,EAAAA,SAASvB,EAAKe,QAAS,CAAEM,QAAuB,UAAd5B,EAAuBD,MAAOE,EAAS,EAAIF,IACrFgC,EAAQC,EAAAA,SAASzB,EAAKe,QAAS,CAAEM,QAAuB,UAAd5B,GAAwBC,IAElEgC,EAAeC,kBAAgB,CAACX,EAASQ,EAAOX,EAAMM,EAAOG,IAE5D,MAAA,CACH7B,UAAAA,EACAC,OAAAA,EACAC,QAAAA,EACAE,aAAAA,KACGG,EACH4B,KAAM,IACC5B,EAAK4B,KACR7B,YAAAA,EACA8B,eA3BgBjB,GAAiCb,EAAY+B,QAAUlB,MA6BxEc,EAAA,EAMLK,EAAiBC,EAAAA,cAA8B,MAExCC,EAAkBF,EAAeG,yBAYU,EAAGC,SAAAA,KAAaC,MAC9D,MAAAC,EAAUhD,EAAW+C,GAE3B,OAAQE,EAAAA,IAAAL,EAAA,CAAgBM,MAAOF,EAAUF,SAAAA,GAAS,2EAbrB,KACvB,MAAApB,EAAUyB,aAAWT,GAE3B,GAAgB,OAAZhB,EACM,MAAA,IAAI0B,MAAM,0DAGb,OAAA1B"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("@floating-ui/react"),r=require("classnames"),s=require("framer-motion"),i=require("react");require("../../hooks/useScreen/useScreen.js");const n=require("../../hooks/useId/useId.js"),o=require("./Tooltip.js");function a(e,t=8){switch(!0){case e.startsWith("top"):return{top:t};case e.startsWith("left"):return{left:t,right:-t};case e.startsWith("bottom"):return{top:-t};case e.startsWith("right"):return{left:-t,right:t};default:return{top:t}}}const l=i.forwardRef((function({className:i,children:l,...c},u){const{triggerOn:p,arrowElement:d,isOpen:f,getFloatingProps:h,placement:g,isPositioned:m,middlewareData:{arrow:j},floatingStyles:x,refs:y}=o.useTooltipContext(),k=t.useMergeRefs([u,y.setFloating]),q=n.useId("jkl-tooltip-content");let v;if(y.reference.current){const e=getComputedStyle(y.reference.current).getPropertyValue("--jkl-background-color");v=parseInt(e.replace("#",""),16)<8388607.5?"dark":"light"}return e.jsx(t.FloatingPortal,{children:e.jsxs(s.AnimatePresence,{children:["hover"===p&&e.jsx("span",{ref:y.setDescription,hidden:!0,children:l},`${q}-trigger`),f&&e.jsx("span",{className:"jkl",children:e.jsxs(s.motion.span,{ref:k,initial:{opacity:0,...a(g,5)},animate:{opacity:1,...a(g,0)},exit:{opacity:0,...a(g,-5),transition:{ease:"easeIn",duration:.15}},transition:{ease:"easeOut",duration:.25},"data-placement":g,"aria-live":"click"===p?"assertive":void 0,className:r("jkl-tooltip-content",i),...h({...c,id:q}),style:{...x},"data-theme":v,children:[l,e.jsx("span",{"aria-hidden":!0,className:"jkl-tooltip-content__arrow",ref:d,style:{left:m?`${null==j?void 0:j.x}px`:"",top:m?`${null==j?void 0:j.y}px`:""}})]},q)},`${q}-wrapper`)]})})}));exports.TooltipContent=l;
2
+ //# sourceMappingURL=TooltipContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TooltipContent.js","sources":["../../../../src/components/tooltip/TooltipContent.tsx"],"sourcesContent":["import { type Placement, useMergeRefs, FloatingPortal } from \"@floating-ui/react\";\nimport cn from \"classnames\";\nimport { AnimatePresence, motion } from \"framer-motion\";\nimport React, { HTMLProps, forwardRef } from \"react\";\nimport { useId } from \"../../hooks\";\nimport { useTooltipContext } from \"./Tooltip\";\n\nfunction getPositionAnimation(placement: Placement, value: number = 8) {\n switch (true) {\n case placement.startsWith(\"top\"):\n return {\n top: value,\n };\n case placement.startsWith(\"left\"):\n return {\n left: value,\n right: -value,\n };\n case placement.startsWith(\"bottom\"):\n return {\n top: -value,\n };\n case placement.startsWith(\"right\"):\n return {\n left: -value,\n right: value,\n };\n\n default:\n return {\n top: value,\n };\n }\n}\n\nexport const TooltipContent = forwardRef<HTMLDivElement, HTMLProps<HTMLDivElement>>(function TooltipContent(\n { className, children, ...props },\n forwardedRef,\n) {\n const {\n triggerOn,\n arrowElement,\n isOpen,\n getFloatingProps,\n placement,\n isPositioned,\n middlewareData: { arrow },\n floatingStyles,\n refs,\n } = useTooltipContext();\n const ref = useMergeRefs([forwardedRef, refs.setFloating]);\n const contentId = useId(\"jkl-tooltip-content\");\n\n // Siden tooltipet rendres på rot må vi hente lokal dark/light-verdi fra triggeren\n // Vi må gjøre dette for å ta hensyn til at tema kan styres lokalt for deler av UIet\n let theme: string | undefined;\n if (refs.reference.current) {\n const backgroundColor = getComputedStyle(refs.reference.current as HTMLElement).getPropertyValue(\n \"--jkl-background-color\",\n );\n // Sett theme til dark hvis bakgrunnsfargen er mørkere enn 50% av hvit\n // dette gir oss slingringsmonn i tilfelle verdien av Jøkuls bakgrunnsfarge endres\n theme = parseInt(backgroundColor.replace(\"#\", \"\"), 16) < 0xffffff / 2 ? \"dark\" : \"light\";\n }\n\n return (\n <FloatingPortal>\n <AnimatePresence>\n {/* For å kunne bruke tekstinnholdet i tooltip som beskrivende tekst, selv når ikke\n tooltip er synlig, må vi rendre et skjult element å referere til for å hente innholdet. */}\n {triggerOn === \"hover\" && (\n <span ref={refs.setDescription} hidden key={`${contentId}-trigger`}>\n {children}\n </span>\n )}\n {isOpen && (\n <span className=\"jkl\" key={`${contentId}-wrapper`}>\n <motion.span\n key={contentId}\n ref={ref}\n initial={{ opacity: 0, ...getPositionAnimation(placement, 5) }}\n animate={{ opacity: 1, ...getPositionAnimation(placement, 0) }}\n exit={{\n opacity: 0,\n ...getPositionAnimation(placement, -5),\n transition: { ease: \"easeIn\", duration: 0.15 },\n }}\n transition={{ ease: \"easeOut\", duration: 0.25 }}\n data-placement={placement}\n aria-live={triggerOn === \"click\" ? \"assertive\" : undefined}\n className={cn(\"jkl-tooltip-content\", className)}\n {...getFloatingProps({ ...props, id: contentId })}\n style={{ ...floatingStyles }}\n data-theme={theme}\n >\n {children}\n <span\n aria-hidden\n className=\"jkl-tooltip-content__arrow\"\n ref={arrowElement}\n style={{\n left: isPositioned ? `${arrow?.x}px` : \"\",\n top: isPositioned ? `${arrow?.y}px` : \"\",\n }}\n />\n </motion.span>\n </span>\n )}\n </AnimatePresence>\n </FloatingPortal>\n );\n});\n"],"names":["getPositionAnimation","placement","value","startsWith","top","left","right","TooltipContent","forwardRef","className","children","props","forwardedRef","triggerOn","arrowElement","isOpen","getFloatingProps","isPositioned","middlewareData","arrow","floatingStyles","refs","useTooltipContext","ref","useMergeRefs","setFloating","contentId","useId","theme","reference","current","backgroundColor","getComputedStyle","getPropertyValue","parseInt","replace","jsx","FloatingPortal","jsxs","AnimatePresence","setDescription","hidden","motion","span","initial","opacity","animate","exit","transition","ease","duration","cn","id","style","x","y"],"mappings":"iVAOA,SAASA,EAAqBC,EAAsBC,EAAgB,GAChE,QAAQ,GACJ,KAAKD,EAAUE,WAAW,OACf,MAAA,CACHC,IAAKF,GAEb,KAAKD,EAAUE,WAAW,QACf,MAAA,CACHE,KAAMH,EACNI,OAAQJ,GAEhB,KAAKD,EAAUE,WAAW,UACf,MAAA,CACHC,KAAMF,GAEd,KAAKD,EAAUE,WAAW,SACf,MAAA,CACHE,MAAOH,EACPI,MAAOJ,GAGf,QACW,MAAA,CACHE,IAAKF,GAGrB,CAEa,MAAAK,EAAiBC,EAAAA,YAAsD,UAC9EC,UAAAA,EAAWC,SAAAA,KAAaC,GAC1BC,GAEM,MACFC,UAAAA,EACAC,aAAAA,EACAC,OAAAA,EACAC,iBAAAA,EACAf,UAAAA,EACAgB,aAAAA,EACAC,gBAAkBC,MAAAA,GAClBC,eAAAA,EACAC,KAAAA,GACAC,EAAkBA,oBAChBC,EAAMC,EAAAA,aAAa,CAACZ,EAAcS,EAAKI,cACvCC,EAAYC,QAAM,uBAIpB,IAAAC,EACA,GAAAP,EAAKQ,UAAUC,QAAS,CACxB,MAAMC,EAAkBC,iBAAiBX,EAAKQ,UAAUC,SAAwBG,iBAC5E,0BAIIL,EAAAM,SAASH,EAAgBI,QAAQ,IAAK,IAAK,IAAM,UAAe,OAAS,OACrF,CAGI,OAAAC,EAAAA,IAACC,EAAAA,eACG,CAAA3B,SAAA4B,EAAAA,KAACC,EAAAA,gBAGI,CAAA7B,SAAA,CAAc,UAAAG,GACVuB,EAAAA,IAAA,OAAA,CAAKb,IAAKF,EAAKmB,eAAgBC,QAAM,EACjC/B,SAAAA,GADuC,GAAGgB,aAIlDX,GACGqB,EAAAA,IAAC,OAAK,CAAA3B,UAAU,MACZC,SAAA4B,EAAAA,KAACI,EAAAA,OAAOC,KAAP,CAEGpB,IAAAA,EACAqB,QAAS,CAAEC,QAAS,KAAM7C,EAAqBC,EAAW,IAC1D6C,QAAS,CAAED,QAAS,KAAM7C,EAAqBC,EAAW,IAC1D8C,KAAM,CACFF,QAAS,KACN7C,EAAqBC,GAAW,GACnC+C,WAAY,CAAEC,KAAM,SAAUC,SAAU,MAE5CF,WAAY,CAAEC,KAAM,UAAWC,SAAU,KACzC,iBAAgBjD,EAChB,YAAyB,UAAdY,EAAwB,iBAAc,EACjDJ,UAAW0C,EAAG,sBAAuB1C,MACjCO,EAAiB,IAAKL,EAAOyC,GAAI1B,IACrC2B,MAAO,IAAKjC,GACZ,aAAYQ,EAEXlB,SAAA,CAAAA,EACD0B,EAAAA,IAAC,OAAA,CACG,eAAW,EACX3B,UAAU,6BACVc,IAAKT,EACLuC,MAAO,CACHhD,KAAMY,EAAe,GAAG,MAAAE,SAAAA,EAAOmC,MAAQ,GACvClD,IAAKa,EAAe,GAAG,MAAAE,SAAAA,EAAOoC,MAAQ,QAxBzC7B,IAFc,GAAGA,iBAmClD"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@floating-ui/react"),t=require("classnames"),o=require("react"),n=require("./Tooltip.js"),l=o.forwardRef((function({children:l,className:s,...i},a){var c,p;const{isOpen:u,setOpen:f,getReferenceProps:d,refs:g,triggerOn:m}=n.useTooltipContext(),x=l.ref,b=r.useMergeRefs([x,g.setReference,a]),j=()=>{"click"===m&&f(!1)},q=[null==(c=g.reference.current)?void 0:c.textContent,null==(p=g.description.current)?void 0:p.textContent].filter(Boolean).join(". ");return o.isValidElement(l)?o.cloneElement(l,d({ref:b,"aria-label":q,...l.props,...i,className:t(l.props.className,s),"data-tooltip-shown":u,style:{...l.props.style},tabIndex:"click"===m?0:void 0,onBlur:()=>{l.props.onBlur&&l.props.onBlur(),j()}})):e.jsx("button",{"data-tooltip-shown":u,...d({className:t(s,"jkl-tooltip-trigger"),type:"button",ref:b,onBlur:j,"aria-label":q,...i}),children:l})}));exports.TooltipTrigger=l;
2
+ //# sourceMappingURL=TooltipTrigger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TooltipTrigger.js","sources":["../../../../src/components/tooltip/TooltipTrigger.tsx"],"sourcesContent":["import { useMergeRefs } from \"@floating-ui/react\";\nimport cn from \"classnames\";\nimport React, { forwardRef, type HTMLProps } from \"react\";\nimport { useTooltipContext } from \"./Tooltip\";\n\nexport const TooltipTrigger = forwardRef<HTMLElement, HTMLProps<HTMLElement>>(function TooltipTrigger(\n { children, className, ...props },\n forwardedRef,\n) {\n const { isOpen, setOpen, getReferenceProps, refs, triggerOn } = useTooltipContext();\n const childrenRef = (children as any).ref;\n const ref = useMergeRefs([childrenRef, refs.setReference, forwardedRef]);\n\n const handleBlur = () => {\n triggerOn === \"click\" && setOpen(false);\n };\n\n const ariaLabel = [\n (refs.reference.current as HTMLElement | null)?.textContent,\n refs.description.current?.textContent,\n ]\n .filter(Boolean)\n .join(\". \");\n\n if (React.isValidElement(children)) {\n return React.cloneElement(\n children,\n getReferenceProps({\n ref,\n \"aria-label\": ariaLabel,\n ...children.props,\n ...props,\n className: cn(children.props.className, className),\n \"data-tooltip-shown\": isOpen,\n style: { ...children.props.style },\n tabIndex: triggerOn === \"click\" ? 0 : undefined,\n onBlur: () => {\n children.props.onBlur && children.props.onBlur();\n handleBlur();\n },\n }),\n );\n }\n\n return (\n <button\n data-tooltip-shown={isOpen}\n {...getReferenceProps({\n className: cn(className, \"jkl-tooltip-trigger\"),\n // Sørg for at vi ikke sender inn skjemaer ved klikk på knappen\n type: \"button\",\n ref,\n onBlur: handleBlur,\n \"aria-label\": ariaLabel,\n ...props,\n })}\n >\n {children}\n </button>\n );\n});\n"],"names":["TooltipTrigger","forwardRef","children","className","props","forwardedRef","isOpen","setOpen","getReferenceProps","refs","triggerOn","useTooltipContext","childrenRef","ref","useMergeRefs","setReference","handleBlur","ariaLabel","_a","reference","current","textContent","_b","description","filter","Boolean","join","React","isValidElement","cloneElement","cn","style","tabIndex","onBlur","jsx","type"],"mappings":"0NAKaA,EAAiBC,EAAAA,YAAgD,UACxEC,SAAAA,EAAUC,UAAAA,KAAcC,GAC1BC,WAEA,MAAQC,OAAAA,EAAQC,QAAAA,EAASC,kBAAAA,EAAmBC,KAAAA,EAAMC,UAAAA,GAAcC,EAAAA,oBAC1DC,EAAeV,EAAiBW,IAChCA,EAAMC,EAAAA,aAAa,CAACF,EAAaH,EAAKM,aAAcV,IAEpDW,EAAa,KACD,UAAAN,GAAWH,GAAQ,EAAK,EAGpCU,EAAY,CACb,OAAAC,EAAAT,EAAKU,UAAUC,gBAAfF,EAA+CG,YAChD,OAAAC,EAAAb,EAAKc,YAAYH,gBAAjBE,EAA0BD,aAEzBG,OAAOC,SACPC,KAAK,MAEN,OAAAC,EAAMC,eAAe1B,GACdyB,EAAME,aACT3B,EACAM,EAAkB,CACdK,IAAAA,EACA,aAAcI,KACXf,EAASE,SACTA,EACHD,UAAW2B,EAAG5B,EAASE,MAAMD,UAAWA,GACxC,qBAAsBG,EACtByB,MAAO,IAAK7B,EAASE,MAAM2B,OAC3BC,SAAwB,UAAdtB,EAAwB,OAAI,EACtCuB,OAAQ,KACJ/B,EAASE,MAAM6B,QAAU/B,EAASE,MAAM6B,SAC7BjB,QAOvBkB,EAAAA,IAAC,SAAA,CACG,qBAAoB5B,KAChBE,EAAkB,CAClBL,UAAW2B,EAAG3B,EAAW,uBAEzBgC,KAAM,SACNtB,IAAAA,EACAoB,OAAQjB,EACR,aAAcC,KACXb,IAGNF,SAAAA,GAGb"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./Tooltip.js"),t=require("./TooltipContent.js"),e=require("./TooltipTrigger.js"),p=require("./PopupTip.js");exports.Tooltip=o.Tooltip,exports.TooltipContent=t.TooltipContent,exports.TooltipTrigger=e.TooltipTrigger,exports.PopupTip=p.PopupTip;
2
+ //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./utils/tabListener.js"),r=require("./utils/getValuePair.js"),s=require("./utils/breakpoints.js"),t=require("./utils/motion.js"),i=require("./utils/mergeRefs.js"),o=require("./utils/mergeProps.js"),u=require("./tokens.js");exports.initTabListener=e.initTabListener,exports.getValuePair=r.getValuePair,exports.breakpoints=s.breakpoints,exports.easings=t.easings,exports.timings=t.timings,exports.mergeRefs=i.mergeRefs,exports.mergeProps=o.mergeProps,exports.tokens=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./tokens.js");exports.tokens=e;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- "use strict";module.exports={color:{brand:{snohvit:"#F9F9F9",varde:"#E0DBD4",granitt:"#1B1917",hvit:"#FFFFFF",svart:"#000000",skifer:"#313030",fjellgra:"#444141",stein:"#636060",svaberg:"#C8C5C3",dis:"#ECE9E5",sand:"#F4F2EF"},functional:{info:"#D3D3F6",infoDark:"#A9A9CA",success:"#ACD3B5",successDark:"#94B79B",warning:"#EFDD9E",warningDark:"#DECC8D",error:"#F6B3B3",errorDark:"#DE9E9E"},background:{page:{light:"#F4F2EF",dark:"#1B1917"},pageVariant:{light:"#F9F9F9",dark:"#1B1917"},container:{light:"#F9F9F9",dark:"#313030"},containerLow:{light:"#ECE9E5",dark:"#000000"},containerHigh:{light:"#FFFFFF",dark:"#313030"},containerInverted:{light:"#1B1917",dark:"#F9F9F9"},containerSubdued:{light:"#C8C5C3",dark:"#636060"},input:{base:{light:"transparent",dark:"transparent"},focus:{light:"#FFFFFF",dark:"#313030"}},action:{light:"#1B1917",dark:"#F9F9F9"},interactive:{light:"transparent",dark:"transparent"},interactiveHover:{light:"#ECE9E5",dark:"#444141"},interactiveSelected:{light:"#E0DBD4",dark:"#636060"},alert:{neutral:{light:"#E0DBD4",dark:"#E0DBD4"},info:{light:"#D3D3F6",dark:"#A9A9CA"},success:{light:"#ACD3B5",dark:"#94B79B"},warning:{light:"#EFDD9E",dark:"#DECC8D"},error:{light:"#F6B3B3",dark:"#DE9E9E"}}},text:{default:{light:"#1B1917",dark:"#F9F9F9"},subdued:{light:"#636060",dark:"#C8C5C3"},inverted:{light:"#F9F9F9",dark:"#1B1917"},onAction:{light:"#F9F9F9",dark:"#1B1917"},interactive:{light:"#1B1917",dark:"#F9F9F9"},interactiveHover:{light:"#636060",dark:"#C8C5C3"},onAlert:{light:"#1B1917",dark:"#1B1917"}},border:{action:{light:"#1B1917",dark:"#F9F9F9"},input:{light:"#636060",dark:"#C8C5C3"},inputFocus:{light:"#1B1917",dark:"#F9F9F9"},separator:{light:"#C8C5C3",dark:"#636060"},separatorStrong:{light:"#636060",dark:"#C8C5C3"},separatorHover:{light:"#1B1917",dark:"#F9F9F9"},subdued:{light:"#C8C5C3",dark:"#636060"}},svart:"#000",granitt:"#1b1917",skifer:"#313030",fjellgra:"#444141",stein:"#636060",svaberg:"#c8c5c3",varde:"#e0dbd4",dis:"#ece9e5",sand:"#f4f2ef",snohvit:"#f9f9f9",hvit:"#fff",suksess:"#acd3b5",suksessDark:"#94b79b",feil:"#f6b3b3",feilDark:"#de9e9e",info:"#d3d3f6",infoDark:"#a9a9ca",advarsel:"#efdd9e",advarselDark:"#decc8d"},spacing:{0:"0",2:"0.125rem",4:"0.25rem",8:"0.5rem",12:"0.75rem",16:"1rem",24:"1.5rem",32:"2rem",40:"2.5rem",64:"4rem",104:"6.5rem",168:"10.5rem"},icon:{weight:{normal:"300",bold:"500"}},typography:{weight:{normal:"400",bold:"700"},font:{size:{16:"1rem",18:"1.125rem",20:"1.25rem",21:"1.3125rem",23:"1.4375rem",25:"1.5625rem",26:"1.625rem",28:"1.75rem",30:"1.875rem",36:"2.25rem",44:"2.75rem",56:"3.5rem"}},line:{height:{24:"1.5rem",28:"1.75rem",32:"2rem",36:"2.25rem",40:"2.5rem",44:"2.75rem",52:"3.25rem",64:"4rem"}},title:{small:{fontSize:"2.25rem",lineHeight:"2.75rem",fontWeight:"400"},base:{fontSize:"3.5rem",lineHeight:"4rem",fontWeight:"400"}},titleSmall:{small:{fontSize:"1.875rem",lineHeight:"2.25rem",fontWeight:"400"},base:{fontSize:"2.75rem",lineHeight:"3.25rem",fontWeight:"400"}},heading_1:{small:{fontSize:"1.625rem",lineHeight:"2rem",fontWeight:"400"},base:{fontSize:"2.25rem",lineHeight:"2.75rem",fontWeight:"400"}},heading_2:{small:{fontSize:"1.4375rem",lineHeight:"2rem",fontWeight:"400"},base:{fontSize:"1.75rem",lineHeight:"2.5rem",fontWeight:"400"}},heading_3:{small:{fontSize:"1.3125rem",lineHeight:"1.75rem",fontWeight:"700"},base:{fontSize:"1.5625rem",lineHeight:"2rem",fontWeight:"700"}},heading_4:{small:{fontSize:"1.125rem",lineHeight:"1.5rem",fontWeight:"700"},base:{fontSize:"1.3125rem",lineHeight:"1.75rem",fontWeight:"700"}},heading_5:{small:{fontSize:"1rem",lineHeight:"1.5rem",fontWeight:"700"},base:{fontSize:"1rem",lineHeight:"1.5rem",fontWeight:"700"}},body:{small:{fontSize:"1.125rem",lineHeight:"1.75rem",fontWeight:"400"},base:{fontSize:"1.25rem",lineHeight:"2rem",fontWeight:"400"}},small:{small:{fontSize:"1rem",lineHeight:"1.5rem",fontWeight:"400"},base:{fontSize:"1rem",lineHeight:"1.5rem",fontWeight:"400"}}}};
1
+ "use strict";module.exports={breakpoint:{medium:"680px",large:"1200px",xl:"1600px"},color:{brand:{snohvit:"#F9F9F9",varde:"#E0DBD4",granitt:"#1B1917",hvit:"#FFFFFF",svart:"#000000",skifer:"#313030",fjellgra:"#444141",stein:"#636060",svaberg:"#C8C5C3",dis:"#ECE9E5",sand:"#F4F2EF"},functional:{info:"#D3D3F6",infoDark:"#A9A9CA",success:"#ACD3B5",successDark:"#94B79B",warning:"#EFDD9E",warningDark:"#DECC8D",error:"#F6B3B3",errorDark:"#DE9E9E"},background:{page:{light:"#F4F2EF",dark:"#1B1917"},pageVariant:{light:"#F9F9F9",dark:"#1B1917"},container:{light:"#F9F9F9",dark:"#313030"},containerLow:{light:"#ECE9E5",dark:"#000000"},containerHigh:{light:"#FFFFFF",dark:"#313030"},containerInverted:{light:"#1B1917",dark:"#F9F9F9"},containerSubdued:{light:"#C8C5C3",dark:"#636060"},input:{base:{light:"transparent",dark:"transparent"},focus:{light:"#FFFFFF",dark:"#313030"}},action:{light:"#1B1917",dark:"#F9F9F9"},interactive:{light:"transparent",dark:"transparent"},interactiveHover:{light:"#ECE9E5",dark:"#444141"},interactiveSelected:{light:"#E0DBD4",dark:"#636060"},alert:{neutral:{light:"#E0DBD4",dark:"#E0DBD4"},info:{light:"#D3D3F6",dark:"#A9A9CA"},success:{light:"#ACD3B5",dark:"#94B79B"},warning:{light:"#EFDD9E",dark:"#DECC8D"},error:{light:"#F6B3B3",dark:"#DE9E9E"}}},text:{default:{light:"#1B1917",dark:"#F9F9F9"},subdued:{light:"#636060",dark:"#C8C5C3"},inverted:{light:"#F9F9F9",dark:"#1B1917"},onAction:{light:"#F9F9F9",dark:"#1B1917"},interactive:{light:"#1B1917",dark:"#F9F9F9"},interactiveHover:{light:"#636060",dark:"#C8C5C3"},onAlert:{light:"#1B1917",dark:"#1B1917"}},border:{action:{light:"#1B1917",dark:"#F9F9F9"},input:{light:"#636060",dark:"#C8C5C3"},inputFocus:{light:"#1B1917",dark:"#F9F9F9"},separator:{light:"#C8C5C3",dark:"#636060"},separatorStrong:{light:"#636060",dark:"#C8C5C3"},separatorHover:{light:"#1B1917",dark:"#F9F9F9"},subdued:{light:"#C8C5C3",dark:"#636060"}},svart:"#000",granitt:"#1b1917",skifer:"#313030",fjellgra:"#444141",stein:"#636060",svaberg:"#c8c5c3",varde:"#e0dbd4",dis:"#ece9e5",sand:"#f4f2ef",snohvit:"#f9f9f9",hvit:"#fff",suksess:"#acd3b5",suksessDark:"#94b79b",feil:"#f6b3b3",feilDark:"#de9e9e",info:"#d3d3f6",infoDark:"#a9a9ca",advarsel:"#efdd9e",advarselDark:"#decc8d"},motion:{timing:{energetic:"75ms",snappy:"100ms",productive:"150ms",expressive:"250ms",lazy:"400ms"},easing:{standard:"ease",entrance:"ease-out",exit:"ease-in",easeInBounceOut:"cubic-bezier(0, 0, 0.375, 1.17)",focus:"cubic-bezier(0.6, 0.2, 0.35, 1)"}},spacing:{0:"0",2:"0.125rem",4:"0.25rem",8:"0.5rem",12:"0.75rem",16:"1rem",24:"1.5rem",32:"2rem",40:"2.5rem",64:"4rem",104:"6.5rem",168:"10.5rem"},icon:{weight:{normal:"300",bold:"500"}},typography:{weight:{normal:"400",bold:"700"},font:{size:{16:"1rem",18:"1.125rem",20:"1.25rem",21:"1.3125rem",23:"1.4375rem",25:"1.5625rem",26:"1.625rem",28:"1.75rem",30:"1.875rem",36:"2.25rem",44:"2.75rem",56:"3.5rem"}},line:{height:{24:"1.5rem",28:"1.75rem",32:"2rem",36:"2.25rem",40:"2.5rem",44:"2.75rem",52:"3.25rem",64:"4rem"}},title:{small:{fontSize:"2.25rem",lineHeight:"2.75rem",fontWeight:"400"},base:{fontSize:"3.5rem",lineHeight:"4rem",fontWeight:"400"}},titleSmall:{small:{fontSize:"1.875rem",lineHeight:"2.25rem",fontWeight:"400"},base:{fontSize:"2.75rem",lineHeight:"3.25rem",fontWeight:"400"}},heading_1:{small:{fontSize:"1.625rem",lineHeight:"2rem",fontWeight:"400"},base:{fontSize:"2.25rem",lineHeight:"2.75rem",fontWeight:"400"}},heading_2:{small:{fontSize:"1.4375rem",lineHeight:"2rem",fontWeight:"400"},base:{fontSize:"1.75rem",lineHeight:"2.5rem",fontWeight:"400"}},heading_3:{small:{fontSize:"1.3125rem",lineHeight:"1.75rem",fontWeight:"700"},base:{fontSize:"1.5625rem",lineHeight:"2rem",fontWeight:"700"}},heading_4:{small:{fontSize:"1.125rem",lineHeight:"1.5rem",fontWeight:"700"},base:{fontSize:"1.3125rem",lineHeight:"1.75rem",fontWeight:"700"}},heading_5:{small:{fontSize:"1rem",lineHeight:"1.5rem",fontWeight:"700"},base:{fontSize:"1rem",lineHeight:"1.5rem",fontWeight:"700"}},body:{small:{fontSize:"1.125rem",lineHeight:"1.75rem",fontWeight:"400"},base:{fontSize:"1.25rem",lineHeight:"2rem",fontWeight:"400"}},small:{small:{fontSize:"1rem",lineHeight:"1.5rem",fontWeight:"400"},base:{fontSize:"1rem",lineHeight:"1.5rem",fontWeight:"400"}}}};
2
2
  //# sourceMappingURL=tokens.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.js","sources":["../../../src/core/tokens.ts"],"sourcesContent":["/**\n * Do not edit directly\n * Generated on Tue, 10 Sep 2024 05:21:22 GMT\n */\n\nexport default {\n color: {\n brand: {\n snohvit: \"#F9F9F9\",\n varde: \"#E0DBD4\",\n granitt: \"#1B1917\",\n hvit: \"#FFFFFF\",\n svart: \"#000000\",\n skifer: \"#313030\",\n fjellgra: \"#444141\",\n stein: \"#636060\",\n svaberg: \"#C8C5C3\",\n dis: \"#ECE9E5\",\n sand: \"#F4F2EF\",\n },\n functional: {\n info: \"#D3D3F6\",\n infoDark: \"#A9A9CA\",\n success: \"#ACD3B5\",\n successDark: \"#94B79B\",\n warning: \"#EFDD9E\",\n warningDark: \"#DECC8D\",\n error: \"#F6B3B3\",\n errorDark: \"#DE9E9E\",\n },\n background: {\n page: {\n light: \"#F4F2EF\",\n dark: \"#1B1917\",\n },\n pageVariant: {\n light: \"#F9F9F9\",\n dark: \"#1B1917\",\n },\n container: {\n light: \"#F9F9F9\",\n dark: \"#313030\",\n },\n containerLow: {\n light: \"#ECE9E5\",\n dark: \"#000000\",\n },\n containerHigh: {\n light: \"#FFFFFF\",\n dark: \"#313030\",\n },\n containerInverted: {\n light: \"#1B1917\",\n dark: \"#F9F9F9\",\n },\n containerSubdued: {\n light: \"#C8C5C3\",\n dark: \"#636060\",\n },\n input: {\n base: {\n light: \"transparent\",\n dark: \"transparent\",\n },\n focus: {\n light: \"#FFFFFF\",\n dark: \"#313030\",\n },\n },\n action: {\n light: \"#1B1917\",\n dark: \"#F9F9F9\",\n },\n interactive: {\n light: \"transparent\",\n dark: \"transparent\",\n },\n interactiveHover: {\n light: \"#ECE9E5\",\n dark: \"#444141\",\n },\n interactiveSelected: {\n light: \"#E0DBD4\",\n dark: \"#636060\",\n },\n alert: {\n neutral: {\n light: \"#E0DBD4\",\n dark: \"#E0DBD4\",\n },\n info: {\n light: \"#D3D3F6\",\n dark: \"#A9A9CA\",\n },\n success: {\n light: \"#ACD3B5\",\n dark: \"#94B79B\",\n },\n warning: {\n light: \"#EFDD9E\",\n dark: \"#DECC8D\",\n },\n error: {\n light: \"#F6B3B3\",\n dark: \"#DE9E9E\",\n },\n },\n },\n text: {\n default: {\n light: \"#1B1917\",\n dark: \"#F9F9F9\",\n },\n subdued: {\n light: \"#636060\",\n dark: \"#C8C5C3\",\n },\n inverted: {\n light: \"#F9F9F9\",\n dark: \"#1B1917\",\n },\n onAction: {\n light: \"#F9F9F9\",\n dark: \"#1B1917\",\n },\n interactive: {\n light: \"#1B1917\",\n dark: \"#F9F9F9\",\n },\n interactiveHover: {\n light: \"#636060\",\n dark: \"#C8C5C3\",\n },\n onAlert: {\n light: \"#1B1917\",\n dark: \"#1B1917\",\n },\n },\n border: {\n action: {\n light: \"#1B1917\",\n dark: \"#F9F9F9\",\n },\n input: {\n light: \"#636060\",\n dark: \"#C8C5C3\",\n },\n inputFocus: {\n light: \"#1B1917\",\n dark: \"#F9F9F9\",\n },\n separator: {\n light: \"#C8C5C3\",\n dark: \"#636060\",\n },\n separatorStrong: {\n light: \"#636060\",\n dark: \"#C8C5C3\",\n },\n separatorHover: {\n light: \"#1B1917\",\n dark: \"#F9F9F9\",\n },\n subdued: {\n light: \"#C8C5C3\",\n dark: \"#636060\",\n },\n },\n svart: \"#000\",\n granitt: \"#1b1917\",\n skifer: \"#313030\",\n fjellgra: \"#444141\",\n stein: \"#636060\",\n svaberg: \"#c8c5c3\",\n varde: \"#e0dbd4\",\n dis: \"#ece9e5\",\n sand: \"#f4f2ef\",\n snohvit: \"#f9f9f9\",\n hvit: \"#fff\",\n suksess: \"#acd3b5\",\n suksessDark: \"#94b79b\",\n feil: \"#f6b3b3\",\n feilDark: \"#de9e9e\",\n info: \"#d3d3f6\",\n infoDark: \"#a9a9ca\",\n advarsel: \"#efdd9e\",\n advarselDark: \"#decc8d\",\n },\n spacing: {\n 0: \"0\",\n 2: \"0.125rem\",\n 4: \"0.25rem\",\n 8: \"0.5rem\",\n 12: \"0.75rem\",\n 16: \"1rem\",\n 24: \"1.5rem\",\n 32: \"2rem\",\n 40: \"2.5rem\",\n 64: \"4rem\",\n 104: \"6.5rem\",\n 168: \"10.5rem\",\n },\n icon: {\n weight: {\n normal: \"300\",\n bold: \"500\",\n },\n },\n typography: {\n weight: {\n normal: \"400\",\n bold: \"700\",\n },\n font: {\n size: {\n 16: \"1rem\",\n 18: \"1.125rem\",\n 20: \"1.25rem\",\n 21: \"1.3125rem\",\n 23: \"1.4375rem\",\n 25: \"1.5625rem\",\n 26: \"1.625rem\",\n 28: \"1.75rem\",\n 30: \"1.875rem\",\n 36: \"2.25rem\",\n 44: \"2.75rem\",\n 56: \"3.5rem\",\n },\n },\n line: {\n height: {\n 24: \"1.5rem\",\n 28: \"1.75rem\",\n 32: \"2rem\",\n 36: \"2.25rem\",\n 40: \"2.5rem\",\n 44: \"2.75rem\",\n 52: \"3.25rem\",\n 64: \"4rem\",\n },\n },\n title: {\n small: {\n fontSize: \"2.25rem\",\n lineHeight: \"2.75rem\",\n fontWeight: \"400\",\n },\n base: {\n fontSize: \"3.5rem\",\n lineHeight: \"4rem\",\n fontWeight: \"400\",\n },\n },\n titleSmall: {\n small: {\n fontSize: \"1.875rem\",\n lineHeight: \"2.25rem\",\n fontWeight: \"400\",\n },\n base: {\n fontSize: \"2.75rem\",\n lineHeight: \"3.25rem\",\n fontWeight: \"400\",\n },\n },\n heading_1: {\n small: {\n fontSize: \"1.625rem\",\n lineHeight: \"2rem\",\n fontWeight: \"400\",\n },\n base: {\n fontSize: \"2.25rem\",\n lineHeight: \"2.75rem\",\n fontWeight: \"400\",\n },\n },\n heading_2: {\n small: {\n fontSize: \"1.4375rem\",\n lineHeight: \"2rem\",\n fontWeight: \"400\",\n },\n base: {\n fontSize: \"1.75rem\",\n lineHeight: \"2.5rem\",\n fontWeight: \"400\",\n },\n },\n heading_3: {\n small: {\n fontSize: \"1.3125rem\",\n lineHeight: \"1.75rem\",\n fontWeight: \"700\",\n },\n base: {\n fontSize: \"1.5625rem\",\n lineHeight: \"2rem\",\n fontWeight: \"700\",\n },\n },\n heading_4: {\n small: {\n fontSize: \"1.125rem\",\n lineHeight: \"1.5rem\",\n fontWeight: \"700\",\n },\n base: {\n fontSize: \"1.3125rem\",\n lineHeight: \"1.75rem\",\n fontWeight: \"700\",\n },\n },\n heading_5: {\n small: {\n fontSize: \"1rem\",\n lineHeight: \"1.5rem\",\n fontWeight: \"700\",\n },\n base: {\n fontSize: \"1rem\",\n lineHeight: \"1.5rem\",\n fontWeight: \"700\",\n },\n },\n body: {\n small: {\n fontSize: \"1.125rem\",\n lineHeight: \"1.75rem\",\n fontWeight: \"400\",\n },\n base: {\n fontSize: \"1.25rem\",\n lineHeight: \"2rem\",\n fontWeight: \"400\",\n },\n },\n small: {\n small: {\n fontSize: \"1rem\",\n lineHeight: \"1.5rem\",\n fontWeight: \"400\",\n },\n base: {\n fontSize: \"1rem\",\n lineHeight: \"1.5rem\",\n fontWeight: \"400\",\n },\n },\n },\n};\n"],"names":["color","brand","snohvit","varde","granitt","hvit","svart","skifer","fjellgra","stein","svaberg","dis","sand","functional","info","infoDark","success","successDark","warning","warningDark","error","errorDark","background","page","light","dark","pageVariant","container","containerLow","containerHigh","containerInverted","containerSubdued","input","base","focus","action","interactive","interactiveHover","interactiveSelected","alert","neutral","text","default","subdued","inverted","onAction","onAlert","border","inputFocus","separator","separatorStrong","separatorHover","suksess","suksessDark","feil","feilDark","advarsel","advarselDark","spacing","icon","weight","normal","bold","typography","font","size","line","height","title","small","fontSize","lineHeight","fontWeight","titleSmall","heading_1","heading_2","heading_3","heading_4","heading_5","body"],"mappings":"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"}
1
+ {"version":3,"file":"tokens.js","sources":["../../../src/core/tokens.ts"],"sourcesContent":["/**\n * Do not edit directly\n * Generated on Mon, 23 Sep 2024 08:51:40 GMT\n */\n\nexport default {\n breakpoint: {\n medium: \"680px\",\n large: \"1200px\",\n xl: \"1600px\",\n },\n color: {\n brand: {\n snohvit: \"#F9F9F9\",\n varde: \"#E0DBD4\",\n granitt: \"#1B1917\",\n hvit: \"#FFFFFF\",\n svart: \"#000000\",\n skifer: \"#313030\",\n fjellgra: \"#444141\",\n stein: \"#636060\",\n svaberg: \"#C8C5C3\",\n dis: \"#ECE9E5\",\n sand: \"#F4F2EF\",\n },\n functional: {\n info: \"#D3D3F6\",\n infoDark: \"#A9A9CA\",\n success: \"#ACD3B5\",\n successDark: \"#94B79B\",\n warning: \"#EFDD9E\",\n warningDark: \"#DECC8D\",\n error: \"#F6B3B3\",\n errorDark: \"#DE9E9E\",\n },\n background: {\n page: {\n light: \"#F4F2EF\",\n dark: \"#1B1917\",\n },\n pageVariant: {\n light: \"#F9F9F9\",\n dark: \"#1B1917\",\n },\n container: {\n light: \"#F9F9F9\",\n dark: \"#313030\",\n },\n containerLow: {\n light: \"#ECE9E5\",\n dark: \"#000000\",\n },\n containerHigh: {\n light: \"#FFFFFF\",\n dark: \"#313030\",\n },\n containerInverted: {\n light: \"#1B1917\",\n dark: \"#F9F9F9\",\n },\n containerSubdued: {\n light: \"#C8C5C3\",\n dark: \"#636060\",\n },\n input: {\n base: {\n light: \"transparent\",\n dark: \"transparent\",\n },\n focus: {\n light: \"#FFFFFF\",\n dark: \"#313030\",\n },\n },\n action: {\n light: \"#1B1917\",\n dark: \"#F9F9F9\",\n },\n interactive: {\n light: \"transparent\",\n dark: \"transparent\",\n },\n interactiveHover: {\n light: \"#ECE9E5\",\n dark: \"#444141\",\n },\n interactiveSelected: {\n light: \"#E0DBD4\",\n dark: \"#636060\",\n },\n alert: {\n neutral: {\n light: \"#E0DBD4\",\n dark: \"#E0DBD4\",\n },\n info: {\n light: \"#D3D3F6\",\n dark: \"#A9A9CA\",\n },\n success: {\n light: \"#ACD3B5\",\n dark: \"#94B79B\",\n },\n warning: {\n light: \"#EFDD9E\",\n dark: \"#DECC8D\",\n },\n error: {\n light: \"#F6B3B3\",\n dark: \"#DE9E9E\",\n },\n },\n },\n text: {\n default: {\n light: \"#1B1917\",\n dark: \"#F9F9F9\",\n },\n subdued: {\n light: \"#636060\",\n dark: \"#C8C5C3\",\n },\n inverted: {\n light: \"#F9F9F9\",\n dark: \"#1B1917\",\n },\n onAction: {\n light: \"#F9F9F9\",\n dark: \"#1B1917\",\n },\n interactive: {\n light: \"#1B1917\",\n dark: \"#F9F9F9\",\n },\n interactiveHover: {\n light: \"#636060\",\n dark: \"#C8C5C3\",\n },\n onAlert: {\n light: \"#1B1917\",\n dark: \"#1B1917\",\n },\n },\n border: {\n action: {\n light: \"#1B1917\",\n dark: \"#F9F9F9\",\n },\n input: {\n light: \"#636060\",\n dark: \"#C8C5C3\",\n },\n inputFocus: {\n light: \"#1B1917\",\n dark: \"#F9F9F9\",\n },\n separator: {\n light: \"#C8C5C3\",\n dark: \"#636060\",\n },\n separatorStrong: {\n light: \"#636060\",\n dark: \"#C8C5C3\",\n },\n separatorHover: {\n light: \"#1B1917\",\n dark: \"#F9F9F9\",\n },\n subdued: {\n light: \"#C8C5C3\",\n dark: \"#636060\",\n },\n },\n svart: \"#000\",\n granitt: \"#1b1917\",\n skifer: \"#313030\",\n fjellgra: \"#444141\",\n stein: \"#636060\",\n svaberg: \"#c8c5c3\",\n varde: \"#e0dbd4\",\n dis: \"#ece9e5\",\n sand: \"#f4f2ef\",\n snohvit: \"#f9f9f9\",\n hvit: \"#fff\",\n suksess: \"#acd3b5\",\n suksessDark: \"#94b79b\",\n feil: \"#f6b3b3\",\n feilDark: \"#de9e9e\",\n info: \"#d3d3f6\",\n infoDark: \"#a9a9ca\",\n advarsel: \"#efdd9e\",\n advarselDark: \"#decc8d\",\n },\n motion: {\n timing: {\n energetic: \"75ms\",\n snappy: \"100ms\",\n productive: \"150ms\",\n expressive: \"250ms\",\n lazy: \"400ms\",\n },\n easing: {\n standard: \"ease\",\n entrance: \"ease-out\",\n exit: \"ease-in\",\n easeInBounceOut: \"cubic-bezier(0, 0, 0.375, 1.17)\",\n focus: \"cubic-bezier(0.6, 0.2, 0.35, 1)\",\n },\n },\n spacing: {\n 0: \"0\",\n 2: \"0.125rem\",\n 4: \"0.25rem\",\n 8: \"0.5rem\",\n 12: \"0.75rem\",\n 16: \"1rem\",\n 24: \"1.5rem\",\n 32: \"2rem\",\n 40: \"2.5rem\",\n 64: \"4rem\",\n 104: \"6.5rem\",\n 168: \"10.5rem\",\n },\n icon: {\n weight: {\n normal: \"300\",\n bold: \"500\",\n },\n },\n typography: {\n weight: {\n normal: \"400\",\n bold: \"700\",\n },\n font: {\n size: {\n 16: \"1rem\",\n 18: \"1.125rem\",\n 20: \"1.25rem\",\n 21: \"1.3125rem\",\n 23: \"1.4375rem\",\n 25: \"1.5625rem\",\n 26: \"1.625rem\",\n 28: \"1.75rem\",\n 30: \"1.875rem\",\n 36: \"2.25rem\",\n 44: \"2.75rem\",\n 56: \"3.5rem\",\n },\n },\n line: {\n height: {\n 24: \"1.5rem\",\n 28: \"1.75rem\",\n 32: \"2rem\",\n 36: \"2.25rem\",\n 40: \"2.5rem\",\n 44: \"2.75rem\",\n 52: \"3.25rem\",\n 64: \"4rem\",\n },\n },\n title: {\n small: {\n fontSize: \"2.25rem\",\n lineHeight: \"2.75rem\",\n fontWeight: \"400\",\n },\n base: {\n fontSize: \"3.5rem\",\n lineHeight: \"4rem\",\n fontWeight: \"400\",\n },\n },\n titleSmall: {\n small: {\n fontSize: \"1.875rem\",\n lineHeight: \"2.25rem\",\n fontWeight: \"400\",\n },\n base: {\n fontSize: \"2.75rem\",\n lineHeight: \"3.25rem\",\n fontWeight: \"400\",\n },\n },\n heading_1: {\n small: {\n fontSize: \"1.625rem\",\n lineHeight: \"2rem\",\n fontWeight: \"400\",\n },\n base: {\n fontSize: \"2.25rem\",\n lineHeight: \"2.75rem\",\n fontWeight: \"400\",\n },\n },\n heading_2: {\n small: {\n fontSize: \"1.4375rem\",\n lineHeight: \"2rem\",\n fontWeight: \"400\",\n },\n base: {\n fontSize: \"1.75rem\",\n lineHeight: \"2.5rem\",\n fontWeight: \"400\",\n },\n },\n heading_3: {\n small: {\n fontSize: \"1.3125rem\",\n lineHeight: \"1.75rem\",\n fontWeight: \"700\",\n },\n base: {\n fontSize: \"1.5625rem\",\n lineHeight: \"2rem\",\n fontWeight: \"700\",\n },\n },\n heading_4: {\n small: {\n fontSize: \"1.125rem\",\n lineHeight: \"1.5rem\",\n fontWeight: \"700\",\n },\n base: {\n fontSize: \"1.3125rem\",\n lineHeight: \"1.75rem\",\n fontWeight: \"700\",\n },\n },\n heading_5: {\n small: {\n fontSize: \"1rem\",\n lineHeight: \"1.5rem\",\n fontWeight: \"700\",\n },\n base: {\n fontSize: \"1rem\",\n lineHeight: \"1.5rem\",\n fontWeight: \"700\",\n },\n },\n body: {\n small: {\n fontSize: \"1.125rem\",\n lineHeight: \"1.75rem\",\n fontWeight: \"400\",\n },\n base: {\n fontSize: \"1.25rem\",\n lineHeight: \"2rem\",\n fontWeight: \"400\",\n },\n },\n small: {\n small: {\n fontSize: \"1rem\",\n lineHeight: \"1.5rem\",\n fontWeight: \"400\",\n },\n base: {\n fontSize: \"1rem\",\n lineHeight: \"1.5rem\",\n fontWeight: \"400\",\n },\n },\n },\n};\n"],"names":["breakpoint","medium","large","xl","color","brand","snohvit","varde","granitt","hvit","svart","skifer","fjellgra","stein","svaberg","dis","sand","functional","info","infoDark","success","successDark","warning","warningDark","error","errorDark","background","page","light","dark","pageVariant","container","containerLow","containerHigh","containerInverted","containerSubdued","input","base","focus","action","interactive","interactiveHover","interactiveSelected","alert","neutral","text","default","subdued","inverted","onAction","onAlert","border","inputFocus","separator","separatorStrong","separatorHover","suksess","suksessDark","feil","feilDark","advarsel","advarselDark","motion","timing","energetic","snappy","productive","expressive","lazy","easing","standard","entrance","exit","easeInBounceOut","spacing","icon","weight","normal","bold","typography","font","size","line","height","title","small","fontSize","lineHeight","fontWeight","titleSmall","heading_1","heading_2","heading_3","heading_4","heading_5","body"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("../../core/utils/motion.js"),r=require("../useBrowserPreferences/useBrowserPreferences.js"),n=require("../usePreviousValue/usePreviousValue.js");exports.useAnimatedHeight=function(i,s){const l=n.usePreviousValue(i),o=(null==s?void 0:s.easing)||"standard",u=(null==s?void 0:s.timing)||"productive",a=(null==s?void 0:s.display)||"block",c=`${t.timings[u]} height ${t.easings[o]}`,{prefersReducedMotion:d}=r.useBrowserPreferences(),v=e.useRef(),f=e.useRef(),y=e.useRef(null);function m(e){var t;const r=y.current;r&&e.target===r&&(i?r.removeAttribute("style"):(r.removeAttribute("style"),r.style.display="none"),null==(t=null==s?void 0:s.onTransitionEnd)||t.call(s,i,y))}const g=e.useCallback((()=>{var e,t,r,n;const o=y.current;if(o&&void 0!==l){if(i){if(i&&l)return}else if(o.style.display="none",!l)return;if(null==(e=null==s?void 0:s.onTransitionStart)||e.call(s,i,y),d)return o.removeAttribute("style"),i&&(null==(t=null==s?void 0:s.onFirstVisible)||t.call(s,i,y)),void(null==(r=null==s?void 0:s.onTransitionEnd)||r.call(s,i,y));if(o.style.transition=c,o.style.display=a,o.style.overflow="hidden",i)null==(n=null==s?void 0:s.onFirstVisible)||n.call(s,i,y),o.style.height="0",o.style.height=`${o.scrollHeight}px`;else{if(0===o.scrollHeight)return void o.removeAttribute("style");o.style.height=`${o.scrollHeight}px`,v.current=requestAnimationFrame((()=>{f.current=requestAnimationFrame((()=>{o.style.height="0px"}))}))}}}),[i,s,l,c,d,a]);return e.useEffect((()=>{g()}),[i,g]),e.useEffect((()=>{const e=y.current;return e&&e.addEventListener("transitionend",m),()=>{e&&e.removeEventListener("transitionend",m)}}),[i]),e.useEffect((()=>{const e=v.current,t=f.current;return()=>{e&&cancelAnimationFrame(e),t&&cancelAnimationFrame(t)}}),[v,f]),[y,g]};
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("../../core/tokens.js"),r=require("../useBrowserPreferences/useBrowserPreferences.js"),n=require("../usePreviousValue/usePreviousValue.js");exports.useAnimatedHeight=function(i,s){const l=n.usePreviousValue(i),o=(null==s?void 0:s.easing)||"standard",u=(null==s?void 0:s.timing)||"productive",a=(null==s?void 0:s.display)||"block",c=`${t.motion.timing[u]} height ${t.motion.easing[o]}`,{prefersReducedMotion:d}=r.useBrowserPreferences(),v=e.useRef(),f=e.useRef(),m=e.useRef(null);function y(e){var t;const r=m.current;r&&e.target===r&&(i?r.removeAttribute("style"):(r.removeAttribute("style"),r.style.display="none"),null==(t=null==s?void 0:s.onTransitionEnd)||t.call(s,i,m))}const g=e.useCallback((()=>{var e,t,r,n;const o=m.current;if(o&&void 0!==l){if(i){if(i&&l)return}else if(o.style.display="none",!l)return;if(null==(e=null==s?void 0:s.onTransitionStart)||e.call(s,i,m),d)return o.removeAttribute("style"),i&&(null==(t=null==s?void 0:s.onFirstVisible)||t.call(s,i,m)),void(null==(r=null==s?void 0:s.onTransitionEnd)||r.call(s,i,m));if(o.style.transition=c,o.style.display=a,o.style.overflow="hidden",i)null==(n=null==s?void 0:s.onFirstVisible)||n.call(s,i,m),o.style.height="0",o.style.height=`${o.scrollHeight}px`;else{if(0===o.scrollHeight)return void o.removeAttribute("style");o.style.height=`${o.scrollHeight}px`,v.current=requestAnimationFrame((()=>{f.current=requestAnimationFrame((()=>{o.style.height="0px"}))}))}}}),[i,s,l,c,d,a]);return e.useEffect((()=>{g()}),[i,g]),e.useEffect((()=>{const e=m.current;return e&&e.addEventListener("transitionend",y),()=>{e&&e.removeEventListener("transitionend",y)}}),[i]),e.useEffect((()=>{const e=v.current,t=f.current;return()=>{e&&cancelAnimationFrame(e),t&&cancelAnimationFrame(t)}}),[v,f]),[m,g]};
2
2
  //# sourceMappingURL=useAnimatedHeight.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAnimatedHeight.js","sources":["../../../../src/hooks/useAnimatedHeight/useAnimatedHeight.ts"],"sourcesContent":["import { type RefObject, useCallback, useEffect, useRef } from \"react\";\nimport { easings, timings } from \"../../core\";\nimport { useBrowserPreferences } from \"../useBrowserPreferences/useBrowserPreferences\";\nimport { usePreviousValue } from \"../usePreviousValue/usePreviousValue\";\nimport { UseAnimatedHeightOptions } from \"./types\";\n\nconst defaultDisplay = \"block\";\nconst defaultEasing = \"standard\";\nconst defaultTiming = \"productive\";\n\n/**\n * Lar deg animere et element opp til sin maksimale høyde, eller ned til 0.\n *\n * @param isOpen Om elementet er åpent eller lukket.\n * @param options Konfigurer display-property, easing og timing, og eventuelle callbacks for life cycle til animasjonen.\n * @returns Ref til elementet som skal animeres, og en funksjon for å trigge animasjonen manuelt.\n */\nexport function useAnimatedHeight<T extends HTMLElement>(\n isOpen: boolean,\n options?: UseAnimatedHeightOptions<T>,\n): [RefObject<T>, () => void] {\n const wasOpen = usePreviousValue(isOpen);\n const easing = options?.easing || defaultEasing;\n const timing = options?.timing || defaultTiming;\n const display = options?.display || defaultDisplay;\n const transition = `${timings[timing]} height ${easings[easing]}`;\n\n const { prefersReducedMotion } = useBrowserPreferences();\n\n const raf1 = useRef<number>();\n const raf2 = useRef<number>();\n const elementRef = useRef<T>(null);\n\n function handleTransitionEnd(event: TransitionEvent) {\n const element = elementRef.current;\n\n // Ignore bubbling transitions from within container\n if (element && event.target === element) {\n if (isOpen) {\n element.removeAttribute(\"style\");\n } else {\n element.removeAttribute(\"style\");\n element.style.display = \"none\";\n }\n options?.onTransitionEnd?.(isOpen, elementRef);\n }\n }\n\n const runAnimation = useCallback(() => {\n const element = elementRef.current;\n\n // Ikke kjør animasjonen hvis elementet ikke er rendret,\n // eller hvis det er første render.\n if (!element || wasOpen === undefined) {\n return;\n }\n\n if (!isOpen) {\n element.style.display = \"none\";\n if (!wasOpen) {\n // Første render eller rerender med isOpen false\n return;\n }\n } else if (isOpen && wasOpen) {\n // Re-render etter å ha vært lukket, men forblitt åpen.\n return;\n }\n\n options?.onTransitionStart?.(isOpen, elementRef);\n\n if (prefersReducedMotion) {\n element.removeAttribute(\"style\");\n if (isOpen) {\n options?.onFirstVisible?.(isOpen, elementRef);\n }\n options?.onTransitionEnd?.(isOpen, elementRef); // make sure to call callback when animation is off\n return;\n }\n\n element.style.transition = transition;\n element.style.display = display;\n element.style.overflow = \"hidden\";\n\n if (isOpen) {\n options?.onFirstVisible?.(isOpen, elementRef);\n element.style.height = \"0\";\n element.style.height = `${element.scrollHeight}px`;\n } else {\n // If the scrollHeight is 0 it means that we are transitioning from height 0 -> 0.\n // This causes the \"transitionend\"-event to never fire and the element gets stuck with\n // style: height: 0; display: block; overflow:hidden\n if (element.scrollHeight === 0) {\n element.removeAttribute(\"style\");\n return;\n }\n\n element.style.height = `${element.scrollHeight}px`;\n\n raf1.current = requestAnimationFrame(() => {\n raf2.current = requestAnimationFrame(() => {\n element.style.height = `${0}px`;\n });\n });\n }\n }, [isOpen, options, wasOpen, transition, prefersReducedMotion, display]);\n\n useEffect(() => {\n runAnimation();\n }, [isOpen, runAnimation]);\n\n useEffect(() => {\n const element = elementRef.current;\n if (element) {\n element.addEventListener(\"transitionend\", handleTransitionEnd);\n }\n\n return () => {\n if (element) {\n element.removeEventListener(\"transitionend\", handleTransitionEnd);\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isOpen]);\n\n useEffect(() => {\n const r1 = raf1.current;\n const r2 = raf2.current;\n return () => {\n r1 && cancelAnimationFrame(r1);\n r2 && cancelAnimationFrame(r2);\n };\n }, [raf1, raf2]);\n\n return [elementRef, runAnimation];\n}\n"],"names":["isOpen","options","wasOpen","usePreviousValue","easing","timing","display","transition","timings","easings","prefersReducedMotion","useBrowserPreferences","raf1","useRef","raf2","elementRef","handleTransitionEnd","event","element","current","target","removeAttribute","style","_a","onTransitionEnd","call","runAnimation","useCallback","onTransitionStart","_b","onFirstVisible","_c","overflow","_d","height","scrollHeight","requestAnimationFrame","useEffect","addEventListener","removeEventListener","r1","r2","cancelAnimationFrame"],"mappings":"+RAiBgB,SACZA,EACAC,GAEM,MAAAC,EAAUC,mBAAiBH,GAC3BI,GAAS,MAAAH,OAAA,EAAAA,EAASG,SAfN,WAgBZC,GAAS,MAAAJ,OAAA,EAAAA,EAASI,SAfN,aAgBZC,GAAU,MAAAL,OAAA,EAAAA,EAASK,UAlBN,QAmBbC,EAAa,GAAGC,EAAAA,QAAQH,aAAkBI,EAAAA,QAAQL,MAEhDM,qBAAAA,GAAyBC,EAAAA,wBAE3BC,EAAOC,EAAAA,SACPC,EAAOD,EAAAA,SACPE,EAAaF,SAAU,MAE7B,SAASG,EAAoBC,SACzB,MAAMC,EAAUH,EAAWI,QAGvBD,GAAWD,EAAMG,SAAWF,IACxBlB,EACAkB,EAAQG,gBAAgB,UAExBH,EAAQG,gBAAgB,SACxBH,EAAQI,MAAMhB,QAAU,QAEnB,OAAAiB,EAAA,MAAAtB,SAAAA,EAAAuB,kBAAAD,EAAAE,KAAAxB,EAAkBD,EAAQe,GAE3C,CAEM,MAAAW,EAAeC,EAAAA,aAAY,iBAC7B,MAAMT,EAAUH,EAAWI,QAIvB,GAACD,QAAuB,IAAZhB,EAIhB,CAAKF,GAAAA,GAML,GAAWA,GAAUE,EAEjB,eAPAgB,EAAQI,MAAMhB,QAAU,QACnBJ,EAED,OASR,GAFS,OAAAqB,EAAA,MAAAtB,OAAA,EAAAA,EAAA2B,oBAAAL,EAAAE,KAAAxB,EAAoBD,EAAQe,GAEjCL,EAMA,OALAQ,EAAQG,gBAAgB,SACpBrB,IACS,OAAA6B,EAAA,MAAA5B,SAAAA,EAAA6B,iBAAAD,EAAAJ,KAAAxB,EAAiBD,EAAQe,SAE7B,OAAAgB,EAAA,MAAA9B,OAAA,EAAAA,EAAAuB,kBAAAO,EAAAN,KAAAxB,EAAkBD,EAAQe,IAQvC,GAJAG,EAAQI,MAAMf,WAAaA,EAC3BW,EAAQI,MAAMhB,QAAUA,EACxBY,EAAQI,MAAMU,SAAW,SAErBhC,EACS,OAAAiC,EAAA,MAAAhC,SAAAA,EAAA6B,iBAAAG,EAAAR,KAAAxB,EAAiBD,EAAQe,GAClCG,EAAQI,MAAMY,OAAS,IACvBhB,EAAQI,MAAMY,OAAS,GAAGhB,EAAQiB,qBAC/B,CAIC,GAAyB,IAAzBjB,EAAQiB,aAER,YADAjB,EAAQG,gBAAgB,SAI5BH,EAAQI,MAAMY,OAAS,GAAGhB,EAAQiB,iBAE7BvB,EAAAO,QAAUiB,uBAAsB,KAC5BtB,EAAAK,QAAUiB,uBAAsB,KACzBlB,EAAAI,MAAMY,OAAS,QAC1B,GAET,CAAA,IACD,CAAClC,EAAQC,EAASC,EAASK,EAAYG,EAAsBJ,IAEhE+B,OAAAA,EAAAA,WAAU,KACOX,MACd,CAAC1B,EAAQ0B,IAEZW,EAAAA,WAAU,KACN,MAAMnB,EAAUH,EAAWI,QAC3B,OAAID,GACQA,EAAAoB,iBAAiB,gBAAiBtB,GAGvC,KACCE,GACQA,EAAAqB,oBAAoB,gBAAiBvB,EAAmB,CACpE,GAGL,CAAChB,IAEJqC,EAAAA,WAAU,KACN,MAAMG,EAAK5B,EAAKO,QACVsB,EAAK3B,EAAKK,QAChB,MAAO,KACHqB,GAAME,qBAAqBF,GAC3BC,GAAMC,qBAAqBD,EAAE,CAAA,GAElC,CAAC7B,EAAME,IAEH,CAACC,EAAYW,EACxB"}
1
+ {"version":3,"file":"useAnimatedHeight.js","sources":["../../../../src/hooks/useAnimatedHeight/useAnimatedHeight.ts"],"sourcesContent":["import { type RefObject, useCallback, useEffect, useRef } from \"react\";\nimport { tokens } from \"../../core\";\nimport { useBrowserPreferences } from \"../useBrowserPreferences/useBrowserPreferences\";\nimport { usePreviousValue } from \"../usePreviousValue/usePreviousValue\";\nimport { UseAnimatedHeightOptions } from \"./types\";\n\nconst defaultDisplay = \"block\";\nconst defaultEasing = \"standard\";\nconst defaultTiming = \"productive\";\n\n/**\n * Lar deg animere et element opp til sin maksimale høyde, eller ned til 0.\n *\n * @param isOpen Om elementet er åpent eller lukket.\n * @param options Konfigurer display-property, easing og timing, og eventuelle callbacks for life cycle til animasjonen.\n * @returns Ref til elementet som skal animeres, og en funksjon for å trigge animasjonen manuelt.\n */\nexport function useAnimatedHeight<T extends HTMLElement>(\n isOpen: boolean,\n options?: UseAnimatedHeightOptions<T>,\n): [RefObject<T>, () => void] {\n const wasOpen = usePreviousValue(isOpen);\n const easing = options?.easing || defaultEasing;\n const timing = options?.timing || defaultTiming;\n const display = options?.display || defaultDisplay;\n const transition = `${tokens.motion.timing[timing]} height ${tokens.motion.easing[easing]}`;\n\n const { prefersReducedMotion } = useBrowserPreferences();\n\n const raf1 = useRef<number>();\n const raf2 = useRef<number>();\n const elementRef = useRef<T>(null);\n\n function handleTransitionEnd(event: TransitionEvent) {\n const element = elementRef.current;\n\n // Ignore bubbling transitions from within container\n if (element && event.target === element) {\n if (isOpen) {\n element.removeAttribute(\"style\");\n } else {\n element.removeAttribute(\"style\");\n element.style.display = \"none\";\n }\n options?.onTransitionEnd?.(isOpen, elementRef);\n }\n }\n\n const runAnimation = useCallback(() => {\n const element = elementRef.current;\n\n // Ikke kjør animasjonen hvis elementet ikke er rendret,\n // eller hvis det er første render.\n if (!element || wasOpen === undefined) {\n return;\n }\n\n if (!isOpen) {\n element.style.display = \"none\";\n if (!wasOpen) {\n // Første render eller rerender med isOpen false\n return;\n }\n } else if (isOpen && wasOpen) {\n // Re-render etter å ha vært lukket, men forblitt åpen.\n return;\n }\n\n options?.onTransitionStart?.(isOpen, elementRef);\n\n if (prefersReducedMotion) {\n element.removeAttribute(\"style\");\n if (isOpen) {\n options?.onFirstVisible?.(isOpen, elementRef);\n }\n options?.onTransitionEnd?.(isOpen, elementRef); // make sure to call callback when animation is off\n return;\n }\n\n element.style.transition = transition;\n element.style.display = display;\n element.style.overflow = \"hidden\";\n\n if (isOpen) {\n options?.onFirstVisible?.(isOpen, elementRef);\n element.style.height = \"0\";\n element.style.height = `${element.scrollHeight}px`;\n } else {\n // If the scrollHeight is 0 it means that we are transitioning from height 0 -> 0.\n // This causes the \"transitionend\"-event to never fire and the element gets stuck with\n // style: height: 0; display: block; overflow:hidden\n if (element.scrollHeight === 0) {\n element.removeAttribute(\"style\");\n return;\n }\n\n element.style.height = `${element.scrollHeight}px`;\n\n raf1.current = requestAnimationFrame(() => {\n raf2.current = requestAnimationFrame(() => {\n element.style.height = `${0}px`;\n });\n });\n }\n }, [isOpen, options, wasOpen, transition, prefersReducedMotion, display]);\n\n useEffect(() => {\n runAnimation();\n }, [isOpen, runAnimation]);\n\n useEffect(() => {\n const element = elementRef.current;\n if (element) {\n element.addEventListener(\"transitionend\", handleTransitionEnd);\n }\n\n return () => {\n if (element) {\n element.removeEventListener(\"transitionend\", handleTransitionEnd);\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isOpen]);\n\n useEffect(() => {\n const r1 = raf1.current;\n const r2 = raf2.current;\n return () => {\n r1 && cancelAnimationFrame(r1);\n r2 && cancelAnimationFrame(r2);\n };\n }, [raf1, raf2]);\n\n return [elementRef, runAnimation];\n}\n"],"names":["isOpen","options","wasOpen","usePreviousValue","easing","timing","display","transition","tokens","motion","prefersReducedMotion","useBrowserPreferences","raf1","useRef","raf2","elementRef","handleTransitionEnd","event","element","current","target","removeAttribute","style","_a","onTransitionEnd","call","runAnimation","useCallback","onTransitionStart","_b","onFirstVisible","_c","overflow","_d","height","scrollHeight","requestAnimationFrame","useEffect","addEventListener","removeEventListener","r1","r2","cancelAnimationFrame"],"mappings":"yRAiBgB,SACZA,EACAC,GAEM,MAAAC,EAAUC,mBAAiBH,GAC3BI,GAAS,MAAAH,OAAA,EAAAA,EAASG,SAfN,WAgBZC,GAAS,MAAAJ,OAAA,EAAAA,EAASI,SAfN,aAgBZC,GAAU,MAAAL,OAAA,EAAAA,EAASK,UAlBN,QAmBbC,EAAa,GAAGC,EAAOC,OAAOJ,OAAOA,aAAkBG,EAAOC,OAAOL,OAAOA,MAE1EM,qBAAAA,GAAyBC,EAAAA,wBAE3BC,EAAOC,EAAAA,SACPC,EAAOD,EAAAA,SACPE,EAAaF,SAAU,MAE7B,SAASG,EAAoBC,SACzB,MAAMC,EAAUH,EAAWI,QAGvBD,GAAWD,EAAMG,SAAWF,IACxBlB,EACAkB,EAAQG,gBAAgB,UAExBH,EAAQG,gBAAgB,SACxBH,EAAQI,MAAMhB,QAAU,QAEnB,OAAAiB,EAAA,MAAAtB,OAAAA,EAAAA,EAAAuB,kBAAAD,EAAAE,KAAAxB,EAAkBD,EAAQe,GAE3C,CAEM,MAAAW,EAAeC,EAAAA,aAAY,iBAC7B,MAAMT,EAAUH,EAAWI,QAIvB,GAACD,QAAuB,IAAZhB,EAIhB,CAAA,GAAKF,GAML,GAAWA,GAAUE,EAEjB,YAPAgB,GAAAA,EAAQI,MAAMhB,QAAU,QACnBJ,EAED,OASR,GAFS,OAAAqB,EAAA,MAAAtB,SAAAA,EAAA2B,oBAAAL,EAAAE,KAAAxB,EAAoBD,EAAQe,GAEjCL,EAMA,OALAQ,EAAQG,gBAAgB,SACpBrB,IACS,OAAA6B,EAAA,MAAA5B,OAAAA,EAAAA,EAAA6B,iBAAAD,EAAAJ,KAAAxB,EAAiBD,EAAQe,SAE7B,OAAAgB,EAAA,MAAA9B,SAAAA,EAAAuB,kBAAAO,EAAAN,KAAAxB,EAAkBD,EAAQe,IAQvC,GAJAG,EAAQI,MAAMf,WAAaA,EAC3BW,EAAQI,MAAMhB,QAAUA,EACxBY,EAAQI,MAAMU,SAAW,SAErBhC,EACS,OAAAiC,EAAA,MAAAhC,SAAAA,EAAA6B,iBAAAG,EAAAR,KAAAxB,EAAiBD,EAAQe,GAClCG,EAAQI,MAAMY,OAAS,IACvBhB,EAAQI,MAAMY,OAAS,GAAGhB,EAAQiB,qBAC/B,CAIC,GAAyB,IAAzBjB,EAAQiB,aAER,YADAjB,EAAQG,gBAAgB,SAI5BH,EAAQI,MAAMY,OAAS,GAAGhB,EAAQiB,iBAE7BvB,EAAAO,QAAUiB,uBAAsB,KAC5BtB,EAAAK,QAAUiB,uBAAsB,KACzBlB,EAAAI,MAAMY,OAAS,QAC1B,GAET,CAAA,IACD,CAAClC,EAAQC,EAASC,EAASK,EAAYG,EAAsBJ,IAEhE+B,OAAAA,EAAAA,WAAU,KACOX,MACd,CAAC1B,EAAQ0B,IAEZW,EAAAA,WAAU,KACN,MAAMnB,EAAUH,EAAWI,QAC3B,OAAID,GACQA,EAAAoB,iBAAiB,gBAAiBtB,GAGvC,KACCE,GACQA,EAAAqB,oBAAoB,gBAAiBvB,EAAmB,CACpE,GAGL,CAAChB,IAEJqC,EAAAA,WAAU,KACN,MAAMG,EAAK5B,EAAKO,QACVsB,EAAK3B,EAAKK,QAChB,MAAO,KACHqB,GAAME,qBAAqBF,GAC3BC,GAAMC,qBAAqBD,EAAE,CAAA,GAElC,CAAC7B,EAAME,IAEH,CAACC,EAAYW,EACxB"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("../../core/utils/motion.js"),r=require("../useBrowserPreferences/useBrowserPreferences.js"),n=require("../usePreviousValue/usePreviousValue.js");exports.useAnimatedHeightBetween=function(s,i){const o=n.usePreviousValue(s),u=(null==i?void 0:i.easing)||"standard",a=(null==i?void 0:i.timing)||"productive",l=`${t.timings[a]} height ${t.easings[u]}`,{prefersReducedMotion:c}=r.useBrowserPreferences(),d=e.useRef(),f=e.useRef(),y=e.useRef(null),p=e.useCallback((e=>{var t;const r=y.current;r&&e.target===r&&(r.removeAttribute("style"),null==(t=null==i?void 0:i.onTransitionEnd)||t.call(i,s,y))}),[i,s]),v=e.useCallback((()=>{var e,t;const r=y.current;if(r&&(void 0===o&&(r.dataset.expanded=s?"true":"false"),!(!s&&!o||s&&o))){if(null==(e=null==i?void 0:i.onTransitionStart)||e.call(i,s,y),c)return r.removeAttribute("style"),r.dataset.expanded=s?"true":"false",void(null==(t=null==i?void 0:i.onTransitionEnd)||t.call(i,s,y));s?function(e,t,r,n){const s=e.current;if(!s)return;s.removeAttribute("style");const i=s.scrollHeight;r.current=requestAnimationFrame((()=>{s.style.removeProperty("transition"),s.dataset.expanded="false";const e=s.getBoundingClientRect().height;s.style.setProperty("height",`${e}px`),s.style.setProperty("overflow-y","hidden"),n.current=requestAnimationFrame((()=>{s.style.setProperty("transition",t),s.style.setProperty("height",`${i}px`),s.dataset.expanded="true"}))}))}(y,l,d,f):function(e,t,r,n){const s=e.current;if(!s)return;s.removeAttribute("style");const i=s.scrollHeight;r.current=requestAnimationFrame((()=>{s.style.removeProperty("transition"),s.dataset.expanded="false";const e=s.getBoundingClientRect().height;s.dataset.expanded="true",s.style.setProperty("height",`${i}px`),s.style.setProperty("overflow-y","hidden"),n.current=requestAnimationFrame((()=>{s.style.setProperty("transition",t),s.style.setProperty("height",`${e}px`),s.dataset.expanded="false"}))}))}(y,l,d,f)}}),[o,s,i,c,l]);return e.useEffect((()=>{v()}),[s,v]),e.useEffect((()=>{const e=y.current;return e&&e.addEventListener("transitionend",p),()=>{e&&e.removeEventListener("transitionend",p)}}),[s]),e.useEffect((()=>{const e=d.current,t=f.current;return()=>{e&&cancelAnimationFrame(e),t&&cancelAnimationFrame(t)}}),[d,f]),[y,v]};
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("../../core/tokens.js"),r=require("../useBrowserPreferences/useBrowserPreferences.js"),n=require("../usePreviousValue/usePreviousValue.js");exports.useAnimatedHeightBetween=function(s,i){const o=n.usePreviousValue(s),u=(null==i?void 0:i.easing)||"standard",a=(null==i?void 0:i.timing)||"productive",l=`${t.motion.timing[a]} height ${t.motion.easing[u]}`,{prefersReducedMotion:c}=r.useBrowserPreferences(),d=e.useRef(),f=e.useRef(),y=e.useRef(null),p=e.useCallback((e=>{var t;const r=y.current;r&&e.target===r&&(r.removeAttribute("style"),null==(t=null==i?void 0:i.onTransitionEnd)||t.call(i,s,y))}),[i,s]),m=e.useCallback((()=>{var e,t;const r=y.current;if(r&&(void 0===o&&(r.dataset.expanded=s?"true":"false"),!(!s&&!o||s&&o))){if(null==(e=null==i?void 0:i.onTransitionStart)||e.call(i,s,y),c)return r.removeAttribute("style"),r.dataset.expanded=s?"true":"false",void(null==(t=null==i?void 0:i.onTransitionEnd)||t.call(i,s,y));s?function(e,t,r,n){const s=e.current;if(!s)return;s.removeAttribute("style");const i=s.scrollHeight;r.current=requestAnimationFrame((()=>{s.style.removeProperty("transition"),s.dataset.expanded="false";const e=s.getBoundingClientRect().height;s.style.setProperty("height",`${e}px`),s.style.setProperty("overflow-y","hidden"),n.current=requestAnimationFrame((()=>{s.style.setProperty("transition",t),s.style.setProperty("height",`${i}px`),s.dataset.expanded="true"}))}))}(y,l,d,f):function(e,t,r,n){const s=e.current;if(!s)return;s.removeAttribute("style");const i=s.scrollHeight;r.current=requestAnimationFrame((()=>{s.style.removeProperty("transition"),s.dataset.expanded="false";const e=s.getBoundingClientRect().height;s.dataset.expanded="true",s.style.setProperty("height",`${i}px`),s.style.setProperty("overflow-y","hidden"),n.current=requestAnimationFrame((()=>{s.style.setProperty("transition",t),s.style.setProperty("height",`${e}px`),s.dataset.expanded="false"}))}))}(y,l,d,f)}}),[o,s,i,c,l]);return e.useEffect((()=>{m()}),[s,m]),e.useEffect((()=>{const e=y.current;return e&&e.addEventListener("transitionend",p),()=>{e&&e.removeEventListener("transitionend",p)}}),[s]),e.useEffect((()=>{const e=d.current,t=f.current;return()=>{e&&cancelAnimationFrame(e),t&&cancelAnimationFrame(t)}}),[d,f]),[y,m]};
2
2
  //# sourceMappingURL=useAnimatedHeightBetween.js.map