@fremtind/jokul 0.8.1 → 0.10.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 (360) hide show
  1. package/build/NativeSelect-DSmX3GZo.cjs +2 -0
  2. package/build/NativeSelect-DSmX3GZo.cjs.map +1 -0
  3. package/build/NativeSelect-EidDABsT.js +2 -0
  4. package/build/NativeSelect-EidDABsT.js.map +1 -0
  5. package/build/build-stats.html +1 -1
  6. package/build/cjs/components/accordion/Accordion.js +2 -0
  7. package/build/cjs/components/accordion/Accordion.js.map +1 -0
  8. package/build/cjs/components/accordion/AccordionItem.js +2 -0
  9. package/build/cjs/components/accordion/AccordionItem.js.map +1 -0
  10. package/build/cjs/components/accordion/index.js +2 -0
  11. package/build/cjs/components/accordion/index.js.map +1 -0
  12. package/build/cjs/components/breadcrumb/Breadcrumb.js +2 -0
  13. package/build/cjs/components/breadcrumb/Breadcrumb.js.map +1 -0
  14. package/build/cjs/components/breadcrumb/BreadcrumbItem.js +2 -0
  15. package/build/cjs/components/breadcrumb/BreadcrumbItem.js.map +1 -0
  16. package/build/cjs/components/breadcrumb/index.js +2 -0
  17. package/build/cjs/components/breadcrumb/index.js.map +1 -0
  18. package/build/cjs/components/button/Button.js +2 -0
  19. package/build/cjs/components/button/Button.js.map +1 -0
  20. package/build/cjs/components/button/index.js +2 -0
  21. package/build/cjs/components/button/index.js.map +1 -0
  22. package/build/cjs/components/button/types.js +2 -0
  23. package/build/cjs/components/button/types.js.map +1 -0
  24. package/build/cjs/components/checkbox/Checkbox.js +2 -0
  25. package/build/cjs/components/checkbox/Checkbox.js.map +1 -0
  26. package/build/cjs/components/checkbox/index.js +2 -0
  27. package/build/cjs/components/checkbox/index.js.map +1 -0
  28. package/build/cjs/components/combobox/Combobox.js +2 -0
  29. package/build/cjs/components/combobox/Combobox.js.map +1 -0
  30. package/build/cjs/components/combobox/index.js +2 -0
  31. package/build/cjs/components/combobox/index.js.map +1 -0
  32. package/build/cjs/components/cookie-consent/CookieConsent.js +2 -0
  33. package/build/cjs/components/cookie-consent/CookieConsent.js.map +1 -0
  34. package/build/cjs/components/cookie-consent/CookieConsentContext.js +2 -0
  35. package/build/cjs/components/cookie-consent/CookieConsentContext.js.map +1 -0
  36. package/build/cjs/components/cookie-consent/CookieConsentModal.js +2 -0
  37. package/build/cjs/components/cookie-consent/CookieConsentModal.js.map +1 -0
  38. package/build/cjs/components/cookie-consent/consents/CustomConsents.js +2 -0
  39. package/build/cjs/components/cookie-consent/consents/CustomConsents.js.map +1 -0
  40. package/build/cjs/components/cookie-consent/consents/DefaultConsents.js +2 -0
  41. package/build/cjs/components/cookie-consent/consents/DefaultConsents.js.map +1 -0
  42. package/build/cjs/components/cookie-consent/consents/RequirementCheckbox.js +2 -0
  43. package/build/cjs/components/cookie-consent/consents/RequirementCheckbox.js.map +1 -0
  44. package/build/cjs/components/cookie-consent/cookieConsentUtils.js +2 -0
  45. package/build/cjs/components/cookie-consent/cookieConsentUtils.js.map +1 -0
  46. package/build/cjs/components/cookie-consent/index.js +2 -0
  47. package/build/cjs/components/cookie-consent/index.js.map +1 -0
  48. package/build/cjs/components/cookie-consent/types.js +2 -0
  49. package/build/cjs/components/cookie-consent/types.js.map +1 -0
  50. package/build/cjs/components/datepicker/DatePicker.js +2 -0
  51. package/build/cjs/components/datepicker/DatePicker.js.map +1 -0
  52. package/build/cjs/components/datepicker/index.js +2 -0
  53. package/build/cjs/components/datepicker/index.js.map +1 -0
  54. package/build/cjs/components/datepicker/internal/Calendar.js +2 -0
  55. package/build/cjs/components/datepicker/internal/Calendar.js.map +1 -0
  56. package/build/cjs/components/datepicker/internal/calendarReducer.js +2 -0
  57. package/build/cjs/components/datepicker/internal/calendarReducer.js.map +1 -0
  58. package/build/cjs/components/datepicker/internal/useCalendar.js +2 -0
  59. package/build/cjs/components/datepicker/internal/useCalendar.js.map +1 -0
  60. package/build/cjs/components/datepicker/internal/utils.js +2 -0
  61. package/build/cjs/components/datepicker/internal/utils.js.map +1 -0
  62. package/build/cjs/components/datepicker/types.js +2 -0
  63. package/build/cjs/components/datepicker/types.js.map +1 -0
  64. package/build/cjs/components/datepicker/utils.js +2 -0
  65. package/build/cjs/components/datepicker/utils.js.map +1 -0
  66. package/build/cjs/components/datepicker/validation.js +2 -0
  67. package/build/cjs/components/datepicker/validation.js.map +1 -0
  68. package/build/cjs/components/index.js +1 -1
  69. package/build/cjs/components/input-group/FieldGroup.js +1 -1
  70. package/build/cjs/components/input-group/FieldGroup.js.map +1 -1
  71. package/build/cjs/components/input-group/InputGroup.js +1 -1
  72. package/build/cjs/components/input-group/InputGroup.js.map +1 -1
  73. package/build/cjs/components/input-group/Label.js +1 -1
  74. package/build/cjs/components/input-group/Label.js.map +1 -1
  75. package/build/cjs/components/input-group/SupportLabel.js +1 -1
  76. package/build/cjs/components/input-group/SupportLabel.js.map +1 -1
  77. package/build/cjs/components/list/List.js +2 -0
  78. package/build/cjs/components/list/List.js.map +1 -0
  79. package/build/cjs/components/list/ListItem.js +2 -0
  80. package/build/cjs/components/list/ListItem.js.map +1 -0
  81. package/build/cjs/components/list/index.js +2 -0
  82. package/build/cjs/components/list/index.js.map +1 -0
  83. package/build/cjs/components/modal/Modal.js +2 -0
  84. package/build/cjs/components/modal/Modal.js.map +1 -0
  85. package/build/cjs/components/modal/index.js +2 -0
  86. package/build/cjs/components/modal/index.js.map +1 -0
  87. package/build/cjs/components/modal/useModal.js +2 -0
  88. package/build/cjs/components/modal/useModal.js.map +1 -0
  89. package/build/cjs/components/radio-button/BaseRadioButton.js +2 -0
  90. package/build/cjs/components/radio-button/BaseRadioButton.js.map +1 -0
  91. package/build/cjs/components/radio-button/RadioButton.js +2 -0
  92. package/build/cjs/components/radio-button/RadioButton.js.map +1 -0
  93. package/build/cjs/components/radio-button/RadioButtonGroup.js +2 -0
  94. package/build/cjs/components/radio-button/RadioButtonGroup.js.map +1 -0
  95. package/build/cjs/components/radio-button/index.js +2 -0
  96. package/build/cjs/components/radio-button/index.js.map +1 -0
  97. package/build/cjs/components/radio-button/radioGroupContext.js +2 -0
  98. package/build/cjs/components/radio-button/radioGroupContext.js.map +1 -0
  99. package/build/cjs/components/select/NativeSelect.js +2 -0
  100. package/build/cjs/components/select/NativeSelect.js.map +1 -0
  101. package/build/cjs/components/select/Select.js +2 -0
  102. package/build/cjs/components/select/Select.js.map +1 -0
  103. package/build/cjs/components/select/index.js +2 -0
  104. package/build/cjs/components/select/index.js.map +1 -0
  105. package/build/cjs/components/select/select-utils.js +2 -0
  106. package/build/cjs/components/select/select-utils.js.map +1 -0
  107. package/build/cjs/components/tag/Tag.js +1 -1
  108. package/build/cjs/components/tag/Tag.js.map +1 -1
  109. package/build/cjs/components/text-input/BaseTextArea.js +2 -0
  110. package/build/cjs/components/text-input/BaseTextArea.js.map +1 -0
  111. package/build/cjs/components/text-input/BaseTextInput.js +2 -0
  112. package/build/cjs/components/text-input/BaseTextInput.js.map +1 -0
  113. package/build/cjs/components/text-input/TextArea.js +2 -0
  114. package/build/cjs/components/text-input/TextArea.js.map +1 -0
  115. package/build/cjs/components/text-input/TextInput.js +2 -0
  116. package/build/cjs/components/text-input/TextInput.js.map +1 -0
  117. package/build/cjs/components/text-input/index.js +2 -0
  118. package/build/cjs/components/text-input/index.js.map +1 -0
  119. package/build/cjs/components/tooltip/PopupTip.js +1 -1
  120. package/build/cjs/components/tooltip/PopupTip.js.map +1 -1
  121. package/build/cjs/components/tooltip/TooltipContent.js +1 -1
  122. package/build/cjs/components/tooltip/TooltipContent.js.map +1 -1
  123. package/build/cjs/components/tooltip/TooltipTrigger.js +1 -1
  124. package/build/cjs/components/tooltip/TooltipTrigger.js.map +1 -1
  125. package/build/cjs/index.js +1 -1
  126. package/build/components/accordion/Accordion.d.ts +8 -0
  127. package/build/components/accordion/AccordionItem.d.ts +10 -0
  128. package/build/components/accordion/index.d.ts +4 -0
  129. package/build/components/breadcrumb/Breadcrumb.d.ts +6 -0
  130. package/build/components/breadcrumb/BreadcrumbItem.d.ts +10 -0
  131. package/build/components/breadcrumb/index.d.ts +4 -0
  132. package/build/components/button/Button.d.ts +7 -0
  133. package/build/components/button/index.d.ts +2 -0
  134. package/build/components/button/types.d.ts +19 -0
  135. package/build/components/checkbox/Checkbox.d.ts +17 -0
  136. package/build/components/checkbox/index.d.ts +2 -0
  137. package/build/components/combobox/Combobox.d.ts +39 -0
  138. package/build/components/combobox/index.d.ts +2 -0
  139. package/build/components/cookie-consent/CookieConsent.d.ts +6 -0
  140. package/build/components/cookie-consent/CookieConsentContext.d.ts +48 -0
  141. package/build/components/cookie-consent/CookieConsentModal.d.ts +3 -0
  142. package/build/components/cookie-consent/consents/CustomConsents.d.ts +9 -0
  143. package/build/components/cookie-consent/consents/DefaultConsents.d.ts +9 -0
  144. package/build/components/cookie-consent/consents/RequirementCheckbox.d.ts +9 -0
  145. package/build/components/cookie-consent/cookieConsentUtils.d.ts +23 -0
  146. package/build/components/cookie-consent/index.d.ts +5 -0
  147. package/build/components/cookie-consent/types.d.ts +12 -0
  148. package/build/components/datepicker/DatePicker.d.ts +3 -0
  149. package/build/components/datepicker/index.d.ts +4 -0
  150. package/build/components/datepicker/internal/Calendar.d.ts +18 -0
  151. package/build/components/datepicker/internal/calendarReducer.d.ts +18 -0
  152. package/build/components/datepicker/internal/useCalendar.d.ts +59 -0
  153. package/build/components/datepicker/internal/utils.d.ts +167 -0
  154. package/build/components/datepicker/types.d.ts +269 -0
  155. package/build/components/datepicker/utils.d.ts +23 -0
  156. package/build/components/datepicker/validation.d.ts +11 -0
  157. package/build/components/index.d.ts +12 -0
  158. package/build/components/list/List.d.ts +8 -0
  159. package/build/components/list/ListItem.d.ts +8 -0
  160. package/build/components/list/index.d.ts +3 -0
  161. package/build/components/modal/Modal.d.ts +72 -0
  162. package/build/components/modal/index.d.ts +4 -0
  163. package/build/components/modal/useModal.d.ts +69 -0
  164. package/build/components/radio-button/BaseRadioButton.d.ts +10 -0
  165. package/build/components/radio-button/RadioButton.d.ts +15 -0
  166. package/build/components/radio-button/RadioButtonGroup.d.ts +24 -0
  167. package/build/components/radio-button/index.d.ts +6 -0
  168. package/build/components/radio-button/radioGroupContext.d.ts +16 -0
  169. package/build/components/select/NativeSelect.d.ts +19 -0
  170. package/build/components/select/Select.d.ts +53 -0
  171. package/build/components/select/index.d.ts +4 -0
  172. package/build/components/select/select-utils.d.ts +2 -0
  173. package/build/components/text-input/BaseTextArea.d.ts +27 -0
  174. package/build/components/text-input/BaseTextInput.d.ts +34 -0
  175. package/build/components/text-input/TextArea.d.ts +6 -0
  176. package/build/components/text-input/TextInput.d.ts +9 -0
  177. package/build/components/text-input/index.d.ts +4 -0
  178. package/build/es/components/accordion/Accordion.js +2 -0
  179. package/build/es/components/accordion/Accordion.js.map +1 -0
  180. package/build/es/components/accordion/AccordionItem.js +2 -0
  181. package/build/es/components/accordion/AccordionItem.js.map +1 -0
  182. package/build/es/components/accordion/index.js +2 -0
  183. package/build/es/components/accordion/index.js.map +1 -0
  184. package/build/es/components/breadcrumb/Breadcrumb.js +2 -0
  185. package/build/es/components/breadcrumb/Breadcrumb.js.map +1 -0
  186. package/build/es/components/breadcrumb/BreadcrumbItem.js +2 -0
  187. package/build/es/components/breadcrumb/BreadcrumbItem.js.map +1 -0
  188. package/build/es/components/breadcrumb/index.js +2 -0
  189. package/build/es/components/breadcrumb/index.js.map +1 -0
  190. package/build/es/components/button/Button.js +2 -0
  191. package/build/es/components/button/Button.js.map +1 -0
  192. package/build/es/components/button/index.js +2 -0
  193. package/build/es/components/button/index.js.map +1 -0
  194. package/build/es/components/button/types.js +2 -0
  195. package/build/es/components/button/types.js.map +1 -0
  196. package/build/es/components/checkbox/Checkbox.js +2 -0
  197. package/build/es/components/checkbox/Checkbox.js.map +1 -0
  198. package/build/es/components/checkbox/index.js +2 -0
  199. package/build/es/components/checkbox/index.js.map +1 -0
  200. package/build/es/components/combobox/Combobox.js +2 -0
  201. package/build/es/components/combobox/Combobox.js.map +1 -0
  202. package/build/es/components/combobox/index.js +2 -0
  203. package/build/es/components/combobox/index.js.map +1 -0
  204. package/build/es/components/cookie-consent/CookieConsent.js +2 -0
  205. package/build/es/components/cookie-consent/CookieConsent.js.map +1 -0
  206. package/build/es/components/cookie-consent/CookieConsentContext.js +2 -0
  207. package/build/es/components/cookie-consent/CookieConsentContext.js.map +1 -0
  208. package/build/es/components/cookie-consent/CookieConsentModal.js +2 -0
  209. package/build/es/components/cookie-consent/CookieConsentModal.js.map +1 -0
  210. package/build/es/components/cookie-consent/consents/CustomConsents.js +2 -0
  211. package/build/es/components/cookie-consent/consents/CustomConsents.js.map +1 -0
  212. package/build/es/components/cookie-consent/consents/DefaultConsents.js +2 -0
  213. package/build/es/components/cookie-consent/consents/DefaultConsents.js.map +1 -0
  214. package/build/es/components/cookie-consent/consents/RequirementCheckbox.js +2 -0
  215. package/build/es/components/cookie-consent/consents/RequirementCheckbox.js.map +1 -0
  216. package/build/es/components/cookie-consent/cookieConsentUtils.js +2 -0
  217. package/build/es/components/cookie-consent/cookieConsentUtils.js.map +1 -0
  218. package/build/es/components/cookie-consent/index.js +2 -0
  219. package/build/es/components/cookie-consent/index.js.map +1 -0
  220. package/build/es/components/cookie-consent/types.js +2 -0
  221. package/build/es/components/cookie-consent/types.js.map +1 -0
  222. package/build/es/components/datepicker/DatePicker.js +2 -0
  223. package/build/es/components/datepicker/DatePicker.js.map +1 -0
  224. package/build/es/components/datepicker/index.js +2 -0
  225. package/build/es/components/datepicker/index.js.map +1 -0
  226. package/build/es/components/datepicker/internal/Calendar.js +2 -0
  227. package/build/es/components/datepicker/internal/Calendar.js.map +1 -0
  228. package/build/es/components/datepicker/internal/calendarReducer.js +2 -0
  229. package/build/es/components/datepicker/internal/calendarReducer.js.map +1 -0
  230. package/build/es/components/datepicker/internal/useCalendar.js +2 -0
  231. package/build/es/components/datepicker/internal/useCalendar.js.map +1 -0
  232. package/build/es/components/datepicker/internal/utils.js +2 -0
  233. package/build/es/components/datepicker/internal/utils.js.map +1 -0
  234. package/build/es/components/datepicker/types.js +2 -0
  235. package/build/es/components/datepicker/types.js.map +1 -0
  236. package/build/es/components/datepicker/utils.js +2 -0
  237. package/build/es/components/datepicker/utils.js.map +1 -0
  238. package/build/es/components/datepicker/validation.js +2 -0
  239. package/build/es/components/datepicker/validation.js.map +1 -0
  240. package/build/es/components/index.js +1 -1
  241. package/build/es/components/input-group/FieldGroup.js +1 -1
  242. package/build/es/components/input-group/FieldGroup.js.map +1 -1
  243. package/build/es/components/input-group/InputGroup.js +1 -1
  244. package/build/es/components/input-group/InputGroup.js.map +1 -1
  245. package/build/es/components/input-group/Label.js +1 -1
  246. package/build/es/components/input-group/Label.js.map +1 -1
  247. package/build/es/components/input-group/SupportLabel.js +1 -1
  248. package/build/es/components/input-group/SupportLabel.js.map +1 -1
  249. package/build/es/components/list/List.js +2 -0
  250. package/build/es/components/list/List.js.map +1 -0
  251. package/build/es/components/list/ListItem.js +2 -0
  252. package/build/es/components/list/ListItem.js.map +1 -0
  253. package/build/es/components/list/index.js +2 -0
  254. package/build/es/components/list/index.js.map +1 -0
  255. package/build/es/components/modal/Modal.js +2 -0
  256. package/build/es/components/modal/Modal.js.map +1 -0
  257. package/build/es/components/modal/index.js +2 -0
  258. package/build/es/components/modal/index.js.map +1 -0
  259. package/build/es/components/modal/useModal.js +2 -0
  260. package/build/es/components/modal/useModal.js.map +1 -0
  261. package/build/es/components/radio-button/BaseRadioButton.js +2 -0
  262. package/build/es/components/radio-button/BaseRadioButton.js.map +1 -0
  263. package/build/es/components/radio-button/RadioButton.js +2 -0
  264. package/build/es/components/radio-button/RadioButton.js.map +1 -0
  265. package/build/es/components/radio-button/RadioButtonGroup.js +2 -0
  266. package/build/es/components/radio-button/RadioButtonGroup.js.map +1 -0
  267. package/build/es/components/radio-button/index.js +2 -0
  268. package/build/es/components/radio-button/index.js.map +1 -0
  269. package/build/es/components/radio-button/radioGroupContext.js +2 -0
  270. package/build/es/components/radio-button/radioGroupContext.js.map +1 -0
  271. package/build/es/components/select/NativeSelect.js +2 -0
  272. package/build/es/components/select/NativeSelect.js.map +1 -0
  273. package/build/es/components/select/Select.js +2 -0
  274. package/build/es/components/select/Select.js.map +1 -0
  275. package/build/es/components/select/index.js +2 -0
  276. package/build/es/components/select/index.js.map +1 -0
  277. package/build/es/components/select/select-utils.js +2 -0
  278. package/build/es/components/select/select-utils.js.map +1 -0
  279. package/build/es/components/tag/Tag.js +1 -1
  280. package/build/es/components/tag/Tag.js.map +1 -1
  281. package/build/es/components/text-input/BaseTextArea.js +2 -0
  282. package/build/es/components/text-input/BaseTextArea.js.map +1 -0
  283. package/build/es/components/text-input/BaseTextInput.js +2 -0
  284. package/build/es/components/text-input/BaseTextInput.js.map +1 -0
  285. package/build/es/components/text-input/TextArea.js +2 -0
  286. package/build/es/components/text-input/TextArea.js.map +1 -0
  287. package/build/es/components/text-input/TextInput.js +2 -0
  288. package/build/es/components/text-input/TextInput.js.map +1 -0
  289. package/build/es/components/text-input/index.js +2 -0
  290. package/build/es/components/text-input/index.js.map +1 -0
  291. package/build/es/components/tooltip/PopupTip.js +1 -1
  292. package/build/es/components/tooltip/PopupTip.js.map +1 -1
  293. package/build/es/components/tooltip/TooltipContent.js +1 -1
  294. package/build/es/components/tooltip/TooltipContent.js.map +1 -1
  295. package/build/es/components/tooltip/TooltipTrigger.js +1 -1
  296. package/build/es/components/tooltip/TooltipTrigger.js.map +1 -1
  297. package/build/es/index.js +1 -1
  298. package/build/hooks/useAriaLiveRegion/useAriaLiveRegion.d.ts +1 -1
  299. package/package.json +31 -4
  300. package/src/components/accordion/styles/_index.scss +1 -0
  301. package/src/components/accordion/styles/accordion.css +166 -0
  302. package/src/components/accordion/styles/accordion.min.css +1 -0
  303. package/src/components/accordion/styles/accordion.scss +147 -0
  304. package/src/components/breadcrumb/styles/_index.scss +1 -0
  305. package/src/components/breadcrumb/styles/breadcrumb.css +29 -0
  306. package/src/components/breadcrumb/styles/breadcrumb.min.css +1 -0
  307. package/src/components/breadcrumb/styles/breadcrumb.scss +34 -0
  308. package/src/components/button/styles/_index.scss +1 -0
  309. package/src/components/button/styles/button.css +251 -0
  310. package/src/components/button/styles/button.min.css +1 -0
  311. package/src/components/button/styles/button.scss +294 -0
  312. package/src/components/checkbox/styles/_index.scss +1 -0
  313. package/src/components/checkbox/styles/checkbox.css +191 -0
  314. package/src/components/checkbox/styles/checkbox.min.css +1 -0
  315. package/src/components/checkbox/styles/checkbox.scss +229 -0
  316. package/src/components/combobox/styles/_index.scss +1 -0
  317. package/src/components/combobox/styles/combobox.css +337 -0
  318. package/src/components/combobox/styles/combobox.min.css +1 -0
  319. package/src/components/combobox/styles/combobox.scss +307 -0
  320. package/src/components/cookie-consent/styles/_index.scss +1 -0
  321. package/src/components/cookie-consent/styles/cookie-consent.css +94 -0
  322. package/src/components/cookie-consent/styles/cookie-consent.min.css +1 -0
  323. package/src/components/cookie-consent/styles/cookie-consent.scss +79 -0
  324. package/src/components/datepicker/styles/_calendar-date-button.scss +100 -0
  325. package/src/components/datepicker/styles/_calendar-navigation-dropdown.scss +53 -0
  326. package/src/components/datepicker/styles/_calendar-navigation.scss +54 -0
  327. package/src/components/datepicker/styles/_calendar-table.scss +27 -0
  328. package/src/components/datepicker/styles/_calendar.scss +68 -0
  329. package/src/components/datepicker/styles/_index.scss +1 -0
  330. package/src/components/datepicker/styles/datepicker.css +453 -0
  331. package/src/components/datepicker/styles/datepicker.min.css +1 -0
  332. package/src/components/datepicker/styles/datepicker.scss +63 -0
  333. package/src/components/list/styles/_index.scss +1 -0
  334. package/src/components/list/styles/list.css +128 -0
  335. package/src/components/list/styles/list.min.css +1 -0
  336. package/src/components/list/styles/list.scss +166 -0
  337. package/src/components/loader/styles/loader.css +6 -6
  338. package/src/components/loader/styles/loader.min.css +1 -1
  339. package/src/components/loader/styles/skeleton-loader.css +5 -5
  340. package/src/components/loader/styles/skeleton-loader.min.css +1 -1
  341. package/src/components/modal/styles/_index.scss +1 -0
  342. package/src/components/modal/styles/modal.css +115 -0
  343. package/src/components/modal/styles/modal.min.css +1 -0
  344. package/src/components/modal/styles/modal.scss +100 -0
  345. package/src/components/radio-button/styles/_index.scss +1 -0
  346. package/src/components/radio-button/styles/radio-button.css +180 -0
  347. package/src/components/radio-button/styles/radio-button.min.css +1 -0
  348. package/src/components/radio-button/styles/radio-button.scss +201 -0
  349. package/src/components/select/styles/_index.scss +1 -0
  350. package/src/components/select/styles/select.css +350 -0
  351. package/src/components/select/styles/select.min.css +1 -0
  352. package/src/components/select/styles/select.scss +330 -0
  353. package/src/components/text-input/styles/_index.scss +1 -0
  354. package/src/components/text-input/styles/text-input.css +513 -0
  355. package/src/components/text-input/styles/text-input.min.css +1 -0
  356. package/src/components/text-input/styles/text-input.scss +389 -0
  357. package/src/components/tooltip/styles/_index.scss +1 -0
  358. package/src/components/tooltip/styles/tooltip.css +136 -0
  359. package/src/components/tooltip/styles/tooltip.min.css +1 -0
  360. package/src/components/tooltip/styles/tooltip.scss +105 -0
@@ -0,0 +1,2 @@
1
+ import{List as s,OrderedList as t,UnorderedList as e}from"./List.js";import{CheckListItem as i,CrossListItem as r,ListItem as L}from"./ListItem.js";export{i as CheckListItem,r as CrossListItem,s as List,L as ListItem,t as OrderedList,e as UnorderedList};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{jsx as o}from"react/jsx-runtime";import{c as n}from"../../../clsx-BeLtu-UY.js";import{forwardRef as s}from"react";import"../icon/Icon.js";import"../icon/icons/animated/ArrowVerticalAnimated.js";import"../icon/icons/animated/ArrowHorizontalAnimated.js";import"../icon/icons/animated/PlusRemoveAnimated.js";import"../icon/icons/ArrowDownIcon.js";import"../icon/icons/ArrowLeftIcon.js";import"../icon/icons/ArrowNorthEastIcon.js";import"../icon/icons/ArrowRightIcon.js";import"../icon/icons/ArrowUpIcon.js";import"../icon/icons/CalendarIcon.js";import"../icon/icons/CheckIcon.js";import"../icon/icons/ChevronDownIcon.js";import"../icon/icons/ChevronLeftIcon.js";import"../icon/icons/ChevronRightIcon.js";import"../icon/icons/ChevronUpIcon.js";import{CloseIcon as i}from"../icon/icons/CloseIcon.js";import"../icon/icons/CopyIcon.js";import"../icon/icons/DotsIcon.js";import"../icon/icons/DragIcon.js";import"../icon/icons/ErrorIcon.js";import"../icon/icons/GreenCheckIcon.js";import"../icon/icons/HamburgerIcon.js";import"../icon/icons/InfoIcon.js";import"../icon/icons/LinkIcon.js";import"../icon/icons/PlusIcon.js";import"../icon/icons/QuestionIcon.js";import"../icon/icons/RedCrossIcon.js";import"../icon/icons/SearchIcon.js";import"../icon/icons/SuccessIcon.js";import"../icon/icons/WarningIcon.js";import"../icon/icons/MinusIcon.js";import"../icon/icons/ThumbDownIcon.js";import"../icon/icons/ThumbUpIcon.js";import"../icon/icons/TrashCanIcon.js";import"../icon/icons/PenIcon.js";import{IconButton as c}from"../icon-button/IconButton.js";const a=s((({className:s,...i},c)=>o("div",{className:n("jkl-modal-container",s),...i,ref:c})));a.displayName="ModalContainer";const r=s((({className:s,transparent:i,...c},a)=>o("div",{className:n("jkl-modal-overlay",s,{"jkl-modal-overlay--transparent":i}),...c,ref:a})));r.displayName="ModalOverlay";const t=s((({className:s,component:i,padding:c,style:a,...r},t)=>o(i||"div",{className:n("jkl jkl-modal",s),style:{"--jkl-modal-padding":c?`var(--jkl-spacing-${c})`:void 0,...a},...r,ref:t})));t.displayName="Modal";const e=s((({className:s,...i},c)=>o("div",{className:n("jkl-modal-header",s),...i,ref:c})));e.displayName="ModalHeader";const m=s((({className:s,...i},c)=>o("p",{className:n("jkl-modal-title",s),...i,ref:c})));m.displayName="ModalTitle";const l=s((({className:s,...a},r)=>o(c,{className:n("jkl-modal-close",s),"data-testautoid":"jkl-modal-close",...a,ref:r,children:o(i,{variant:"medium"})})));l.displayName="ModalCloseButton";const d=s((({className:s,...i},c)=>o("div",{className:n("jkl-modal-body",s),...i,ref:c})));d.displayName="ModalBody";const p=s((({className:s,...i},c)=>o("div",{className:n("jkl-modal-actions",s),...i,ref:c})));p.displayName="ModalActions";export{t as Modal,p as ModalActions,d as ModalBody,l as ModalCloseButton,a as ModalContainer,e as ModalHeader,r as ModalOverlay,m as ModalTitle};
2
+ //# sourceMappingURL=Modal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Modal.js","sources":["../../../../src/components/modal/Modal.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { forwardRef } from \"react\";\nimport type { WithOptionalChildren } from \"../..\";\nimport { CloseIcon } from \"../icon\";\nimport { IconButton, type IconButtonProps } from \"../icon-button\";\nimport { ModalConfig } from \"./useModal\";\n\nexport interface ModalProps extends WithOptionalChildren {\n id?: string;\n className?: string;\n component?: React.ElementType;\n style?: React.CSSProperties;\n /**\n * Overstyrer padding på modalen via en CSS-variabel.\n */\n padding?: 16 | 24 | 40;\n}\n\ntype BaseModalProps = Omit<ModalProps, \"padding\" | \"component\">;\n\n/**\n * Ment å brukes med `useModal`.\n */\nexport const ModalContainer = forwardRef<HTMLDivElement, ModalConfig[\"container\"] & BaseModalProps>(\n ({ className, ...rest }, ref) => {\n return <div className={clsx(\"jkl-modal-container\", className)} {...rest} ref={ref} />;\n },\n);\nModalContainer.displayName = \"ModalContainer\";\n\ntype ModalOverlayProps = ModalConfig[\"overlay\"] &\n BaseModalProps & {\n /**\n * Rendre uten bakgrunnsfarge, men med click target for å lukke modalen ved klikk utenfor.\n */\n transparent?: boolean;\n };\n\n/**\n * Ment å brukes med `useModal`.\n */\nexport const ModalOverlay = forwardRef<HTMLDivElement, ModalOverlayProps>(\n ({ className, transparent, ...rest }, ref) => (\n <div\n className={clsx(\"jkl-modal-overlay\", className, {\n \"jkl-modal-overlay--transparent\": transparent,\n })}\n {...rest}\n ref={ref}\n />\n ),\n);\nModalOverlay.displayName = \"ModalOverlay\";\n\n/**\n * Ment å brukes med `useModal`.\n */\nexport const Modal = forwardRef<HTMLElement, ModalConfig[\"modal\"] & ModalProps>(\n ({ className, component, padding, style, ...rest }, ref) => {\n const C = component || \"div\";\n return (\n <C\n className={clsx(\"jkl jkl-modal\", className)}\n style={\n {\n \"--jkl-modal-padding\": padding ? `var(--jkl-spacing-${padding})` : undefined,\n ...style,\n } as React.CSSProperties\n }\n {...rest}\n ref={ref}\n />\n );\n },\n);\nModal.displayName = \"Modal\";\n\n/**\n * Ment å brukes med `useModal`.\n */\nexport const ModalHeader = forwardRef<HTMLDivElement, BaseModalProps>(({ className, ...rest }, ref) => (\n <div className={clsx(\"jkl-modal-header\", className)} {...rest} ref={ref} />\n));\nModalHeader.displayName = \"ModalHeader\";\n\n/**\n * Ment å brukes med `useModal`.\n */\nexport const ModalTitle = forwardRef<HTMLParagraphElement, ModalConfig[\"title\"] & BaseModalProps>(\n ({ className, ...rest }, ref) => <p className={clsx(\"jkl-modal-title\", className)} {...rest} ref={ref} />,\n);\nModalTitle.displayName = \"ModalTitle\";\n\n/**\n * Ment å brukes med `useModal`.\n */\nexport const ModalCloseButton = forwardRef<\n HTMLButtonElement,\n Omit<ModalConfig[\"closeButton\"], \"onClick\"> & BaseModalProps & IconButtonProps\n>(({ className, ...rest }, ref) => (\n <IconButton className={clsx(\"jkl-modal-close\", className)} data-testautoid=\"jkl-modal-close\" {...rest} ref={ref}>\n <CloseIcon variant=\"medium\" />\n </IconButton>\n));\nModalCloseButton.displayName = \"ModalCloseButton\";\n\n/**\n * Ment å brukes med `useModal`.\n */\nexport const ModalBody = forwardRef<HTMLDivElement, BaseModalProps>(({ className, ...rest }, ref) => (\n <div className={clsx(\"jkl-modal-body\", className)} {...rest} ref={ref} />\n));\nModalBody.displayName = \"ModalBody\";\n\n/**\n * Ment å brukes med `useModal`.\n */\nexport const ModalActions = forwardRef<HTMLDivElement, BaseModalProps>(({ className, ...rest }, ref) => (\n <div className={clsx(\"jkl-modal-actions\", className)} {...rest} ref={ref} />\n));\nModalActions.displayName = \"ModalActions\";\n"],"names":["ModalContainer","forwardRef","className","rest","ref","jsx","clsx","displayName","ModalOverlay","transparent","Modal","component","padding","style","ModalHeader","ModalTitle","ModalCloseButton","IconButton","children","CloseIcon","variant","ModalBody","ModalActions"],"mappings":"0gDAuBO,MAAMA,EAAiBC,GAC1B,EAAGC,UAAAA,KAAcC,GAAQC,IACdC,EAAC,OAAIH,UAAWI,EAAK,sBAAuBJ,MAAgBC,EAAMC,IAAAA,MAGjFJ,EAAeO,YAAc,iBAatB,MAAMC,EAAeP,GACxB,EAAGC,UAAAA,EAAWO,YAAAA,KAAgBN,GAAQC,IAClCC,EAAC,MAAA,CACGH,UAAWI,EAAK,oBAAqBJ,EAAW,CAC5C,iCAAkCO,OAElCN,EACJC,IAAAA,MAIZI,EAAaD,YAAc,eAKpB,MAAMG,EAAQT,GACjB,EAAGC,UAAAA,EAAWS,UAAAA,EAAWC,QAAAA,EAASC,MAAAA,KAAUV,GAAQC,IAG5CC,EAFMM,GAAa,MAElB,CACGT,UAAWI,EAAK,gBAAiBJ,GACjCW,MACI,CACI,sBAAuBD,EAAU,qBAAqBA,UAAa,KAChEC,MAGPV,EACJC,IAAAA,MAKhBM,EAAMH,YAAc,QAKb,MAAMO,EAAcb,GAA2C,EAAGC,UAAAA,KAAcC,GAAQC,MAC1F,MAAI,CAAAF,UAAWI,EAAK,mBAAoBJ,MAAgBC,EAAMC,IAAAA,MAEnEU,EAAYP,YAAc,cAKnB,MAAMQ,EAAad,GACtB,EAAGC,UAAAA,KAAcC,GAAQC,IAAQC,EAAC,IAAE,CAAAH,UAAWI,EAAK,kBAAmBJ,MAAgBC,EAAMC,IAAAA,MAEjGW,EAAWR,YAAc,aAKZ,MAAAS,EAAmBf,GAG9B,EAAGC,UAAAA,KAAcC,GAAQC,IACtBC,EAAAY,EAAA,CAAWf,UAAWI,EAAK,kBAAmBJ,GAAY,kBAAgB,qBAAsBC,EAAMC,IAAAA,EACnGc,SAAAb,EAACc,EAAU,CAAAC,QAAQ,eAG3BJ,EAAiBT,YAAc,mBAKxB,MAAMc,EAAYpB,GAA2C,EAAGC,UAAAA,KAAcC,GAAQC,MACxF,MAAI,CAAAF,UAAWI,EAAK,iBAAkBJ,MAAgBC,EAAMC,IAAAA,MAEjEiB,EAAUd,YAAc,YAKjB,MAAMe,EAAerB,GAA2C,EAAGC,UAAAA,KAAcC,GAAQC,MAC3F,MAAI,CAAAF,UAAWI,EAAK,oBAAqBJ,MAAgBC,EAAMC,IAAAA,MAEpEkB,EAAaf,YAAc"}
@@ -0,0 +1,2 @@
1
+ import{Modal as a,ModalActions as o,ModalBody as s,ModalCloseButton as l,ModalContainer as d,ModalHeader as M,ModalOverlay as e,ModalTitle as t}from"./Modal.js";import{useModal as r}from"./useModal.js";export{a as Modal,o as ModalActions,s as ModalBody,l as ModalCloseButton,d as ModalContainer,M as ModalHeader,e as ModalOverlay,t as ModalTitle,r as useModal};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{useA11yDialog as o}from"react-a11y-dialog";import"react";import"../../hooks/useScreen/useScreen.js";import{useId as e}from"../../hooks/useId/useId.js";function a(a){const{id:s,role:l="dialog",closeButtonLabel:r="Lukk",...t}=a,i=e(s||"jkl-modal",{generateSuffix:!s}),[u,d]=o({id:i,role:l,...t}),{dialog:n,...c}=d;return[u,{modal:d.dialog,...c,closeButton:{...d.closeButton,"aria-label":r}}]}export{a as useModal};
2
+ //# sourceMappingURL=useModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useModal.js","sources":["../../../../src/components/modal/useModal.ts"],"sourcesContent":["import { A11yDialogConfig, A11yDialogProps, useA11yDialog } from \"react-a11y-dialog\";\nimport { useId } from \"../../hooks\";\n\nexport interface UseModalOptions extends Omit<A11yDialogProps, \"id\" | \"closeButtonPosition\"> {\n id?: string;\n /**\n * @default \"Lukk\"\n */\n closeButtonLabel?: string;\n /**\n * Sett til `alertdialog` om du ønsker å slå av muligheten til å lukke med ESC og klikk utenfor.\n *\n * @default \"dialog\"\n */\n role?: \"dialog\" | \"alertdialog\";\n /**\n * Påkrevd for universell utforming. Tittelen kan gjenbrukes som `children` i `<ModalTitle>` med en konstant.\n */\n title: string;\n}\n\nexport type ModalInstance = ReturnType<typeof useModal>[0];\n\nexport interface ModalConfig extends Omit<A11yDialogConfig, \"dialog\"> {\n modal: A11yDialogConfig[\"dialog\"];\n closeButton: A11yDialogConfig[\"closeButton\"] & {\n \"aria-label\": string;\n };\n}\n\n/**\n * @example\n * ```jsx\n * const heading = \"Bekreft sletting\";\n * const [instance, { title, overlay, container, modal, closeButton }] = useModal({ title: heading });\n *\n * useEffect(() => {\n * if (!instance) {\n * return;\n * }\n * instance.show();\n * }, [instance]);\n *\n * return ReactDOM.createPortal(\n * <ModalContainer {...container}>\n * <ModalOverlay {...overlay} />\n * <Modal {...modal}>\n * <ModalHeader>\n * <ModalTitle {...title}>{heading}</ModalTitle>\n * <ModalCloseButton {...closeButton} />\n * </ModalHeader>\n * <ModalBody>\n * Er du sikker på at du vil slette Foo Bar Baz?\n * </ModalBody>\n * <ModalActions>\n * <PrimaryButton\n * onClick={() => {\n * // Do the thing\n * instance?.hide()\n * }}\n * >\n * Bekreft\n * </PrimaryButton>\n * <TertiaryButton onClick={() => instance?.hide()}>\n * Avbryt\n * </TertiaryButton>\n * </ModalActions>\n * </Modal>\n * </ModalContainer>,\n * document.body,\n * );\n * ```\n */\nexport function useModal(props: UseModalOptions) {\n const { id: idProp, role = \"dialog\", closeButtonLabel = \"Lukk\", ...rest } = props;\n\n const id = useId(idProp || \"jkl-modal\", { generateSuffix: !idProp });\n\n const [instance, config] = useA11yDialog({\n id,\n role,\n ...rest,\n });\n\n const { dialog, ...restConfig } = config;\n\n const modalConfig: ModalConfig = {\n modal: config.dialog,\n ...restConfig,\n closeButton: {\n ...config.closeButton,\n \"aria-label\": closeButtonLabel,\n },\n };\n\n return [instance, modalConfig] as const;\n}\n"],"names":["useModal","props","id","idProp","role","closeButtonLabel","rest","useId","generateSuffix","instance","config","useA11yDialog","dialog","restConfig","modal","closeButton"],"mappings":"8JAyEO,SAASA,EAASC,GACf,MAAEC,GAAIC,EAAQC,KAAAA,EAAO,SAAUC,iBAAAA,EAAmB,UAAWC,GAASL,EAEtEC,EAAKK,EAAMJ,GAAU,YAAa,CAAEK,gBAAiBL,KAEpDM,EAAUC,GAAUC,EAAc,CACrCT,GAAAA,EACAE,KAAAA,KACGE,KAGCM,OAAAA,KAAWC,GAAeH,EAW3B,MAAA,CAACD,EATyB,CAC7BK,MAAOJ,EAAOE,UACXC,EACHE,YAAa,IACNL,EAAOK,YACV,aAAcV,IAK1B"}
@@ -0,0 +1,2 @@
1
+ import{jsxs as a,jsx as e}from"react/jsx-runtime";import{c as t}from"../../../clsx-BeLtu-UY.js";import{forwardRef as o}from"react";import"../../hooks/useScreen/useScreen.js";import{useId as s}from"../../hooks/useId/useId.js";const i=o(((o,i)=>{const{id:n,className:r,checked:d,children:l,label:u,density:c,inline:m,invalid:j,name:b,value:k,onChange:h,...p}=o,_=s(n||"jkl-radio-button",{generateSuffix:!n});return a("div",{className:t("jkl-radio-button",r,{"jkl-radio-button--inline":m,"jkl-radio-button--error":j}),"data-density":c,children:[e("input",{name:b,ref:i,...p,id:_,className:"jkl-radio-button__input",type:"radio",onChange:h,value:k,checked:d}),a("label",{"data-testid":"jkl-radio-button__label-tag",htmlFor:_,className:"jkl-radio-button__label",children:[e("span",{"aria-hidden":!0,className:"jkl-radio-button__dot"}),e("span",{className:"jkl-radio-button__text",children:u||l})]})]})}));i.displayName="BaseRadioButton";export{i as BaseRadioButton};
2
+ //# sourceMappingURL=BaseRadioButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseRadioButton.js","sources":["../../../../src/components/radio-button/BaseRadioButton.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { ChangeEventHandler, forwardRef } from \"react\";\nimport { Density } from \"../..\";\nimport { useId } from \"../../hooks\";\nimport { RadioButtonProps } from \"./RadioButton\";\n\nexport interface BaseRadioButtonProps extends RadioButtonProps {\n inline?: boolean;\n density?: Density;\n invalid?: boolean;\n onChange?: ChangeEventHandler<HTMLInputElement>;\n}\n\nexport const BaseRadioButton = forwardRef<HTMLInputElement, BaseRadioButtonProps>((props, ref) => {\n const { id, className, checked, children, label, density, inline, invalid, name, value, onChange, ...rest } = props;\n\n const inputId = useId(id || \"jkl-radio-button\", { generateSuffix: !id });\n\n return (\n <div\n className={clsx(\"jkl-radio-button\", className, {\n \"jkl-radio-button--inline\": inline,\n \"jkl-radio-button--error\": invalid,\n })}\n data-density={density}\n >\n <input\n name={name}\n ref={ref}\n {...rest}\n id={inputId}\n className=\"jkl-radio-button__input\"\n type=\"radio\"\n onChange={onChange}\n value={value}\n checked={checked}\n />\n <label data-testid=\"jkl-radio-button__label-tag\" htmlFor={inputId} className=\"jkl-radio-button__label\">\n <span aria-hidden className=\"jkl-radio-button__dot\" />\n <span className=\"jkl-radio-button__text\">{label || children}</span>\n </label>\n </div>\n );\n});\n\nBaseRadioButton.displayName = \"BaseRadioButton\";\n"],"names":["BaseRadioButton","forwardRef","props","ref","id","className","checked","children","label","density","inline","invalid","name","value","onChange","rest","inputId","useId","generateSuffix","jsxs","clsx","jsx","type","htmlFor","displayName"],"mappings":"iOAaO,MAAMA,EAAkBC,GAAmD,CAACC,EAAOC,KACtF,MAAQC,GAAAA,EAAIC,UAAAA,EAAWC,QAAAA,EAASC,SAAAA,EAAUC,MAAAA,EAAOC,QAAAA,EAASC,OAAAA,EAAQC,QAAAA,EAASC,KAAAA,EAAMC,MAAAA,EAAOC,SAAAA,KAAaC,GAASb,EAExGc,EAAUC,EAAMb,GAAM,mBAAoB,CAAEc,gBAAiBd,IAG/D,OAAAe,EAAC,MAAA,CACGd,UAAWe,EAAK,mBAAoBf,EAAW,CAC3C,2BAA4BK,EAC5B,0BAA2BC,IAE/B,eAAcF,EAEdF,SAAA,CAAAc,EAAC,QAAA,CACGT,KAAAA,EACAT,IAAAA,KACIY,EACJX,GAAIY,EACJX,UAAU,0BACViB,KAAK,QACLR,SAAAA,EACAD,MAAAA,EACAP,QAAAA,MAEH,QAAM,CAAA,cAAY,8BAA8BiB,QAASP,EAASX,UAAU,0BACzEE,SAAA,CAAAc,EAAC,OAAK,CAAA,eAAW,EAAChB,UAAU,0BAC3BgB,EAAA,OAAA,CAAKhB,UAAU,yBAA0BE,YAASA,SACvD,IAKZP,EAAgBwB,YAAc"}
@@ -0,0 +1,2 @@
1
+ import{jsxs as o,Fragment as i,jsx as n}from"react/jsx-runtime";import{forwardRef as s}from"react";import"../../hooks/useScreen/useScreen.js";import{useId as c}from"../../hooks/useId/useId.js";import"../tooltip/Tooltip.js";import"../tooltip/TooltipContent.js";import"../tooltip/TooltipTrigger.js";import"../icon/Icon.js";import"../icon/icons/animated/ArrowVerticalAnimated.js";import"../icon/icons/animated/ArrowHorizontalAnimated.js";import"../icon/icons/animated/PlusRemoveAnimated.js";import"../icon/icons/ArrowDownIcon.js";import"../icon/icons/ArrowLeftIcon.js";import"../icon/icons/ArrowNorthEastIcon.js";import"../icon/icons/ArrowRightIcon.js";import"../icon/icons/ArrowUpIcon.js";import"../icon/icons/CalendarIcon.js";import"../icon/icons/CheckIcon.js";import"../icon/icons/ChevronDownIcon.js";import"../icon/icons/ChevronLeftIcon.js";import"../icon/icons/ChevronRightIcon.js";import"../icon/icons/ChevronUpIcon.js";import"../icon/icons/CloseIcon.js";import"../icon/icons/CopyIcon.js";import"../icon/icons/DotsIcon.js";import"../icon/icons/DragIcon.js";import"../icon/icons/ErrorIcon.js";import"../icon/icons/GreenCheckIcon.js";import"../icon/icons/HamburgerIcon.js";import"../icon/icons/InfoIcon.js";import"../icon/icons/LinkIcon.js";import"../icon/icons/PlusIcon.js";import"../icon/icons/QuestionIcon.js";import"../icon/icons/RedCrossIcon.js";import"../icon/icons/SearchIcon.js";import"../icon/icons/SuccessIcon.js";import"../icon/icons/WarningIcon.js";import"../icon/icons/MinusIcon.js";import"../icon/icons/ThumbDownIcon.js";import"../icon/icons/ThumbUpIcon.js";import"../icon/icons/TrashCanIcon.js";import"../icon/icons/PenIcon.js";import{SupportLabel as r}from"../input-group/SupportLabel.js";import"../input-group/InputGroup.js";import{BaseRadioButton as t}from"./BaseRadioButton.js";import{useRadioGroupContext as p}from"./radioGroupContext.js";const e=s(((s,e)=>{const{checked:m,value:a,supportLabelProps:j,helpLabel:u,...I}=s,{value:l,density:d,...h}=p(),f=c("jkl-support-label");return o(i,{children:[n(t,{...h,...I,ref:e,checked:typeof m<"u"?m:typeof l<"u"?a===l:void 0,value:a,"aria-describedby":u?f:void 0}),n(r,{...j,label:u,labelType:"help",id:f,density:d})]})}));e.displayName="RadioButton";export{e as RadioButton};
2
+ //# sourceMappingURL=RadioButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RadioButton.js","sources":["../../../../src/components/radio-button/RadioButton.tsx"],"sourcesContent":["import React, { forwardRef, InputHTMLAttributes, ChangeEventHandler, ReactNode } from \"react\";\nimport { useId } from \"../../hooks\";\nimport { SupportLabel, SupportLabelProps } from \"../input-group\";\nimport { BaseRadioButton } from \"./BaseRadioButton\";\nimport { useRadioGroupContext } from \"./radioGroupContext\";\n\nexport interface RadioButtonProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"children\"> {\n children?: ReactNode;\n value: string;\n /** Kan også settes på RadioButtonGroup, men settes på RadioButton f. eks. av react-hook-form */\n name?: string;\n /** Kan også settes på RadioButtonGroup, men settes på RadioButton f. eks. av react-hook-form */\n onChange?: ChangeEventHandler<HTMLInputElement>;\n /** @deprecated Bruk children */\n label?: ReactNode;\n helpLabel?: ReactNode;\n supportLabelProps?: Omit<SupportLabelProps, \"id\" | \"errorLabel\" | \"helpLabel\" | \"density\">;\n}\n\nexport const RadioButton = forwardRef<HTMLInputElement, RadioButtonProps>((props, ref) => {\n const { checked, value, supportLabelProps, helpLabel, ...rest } = props;\n const { value: selectedValue, density, ...context } = useRadioGroupContext();\n const supportId = useId(\"jkl-support-label\");\n\n return (\n <>\n <BaseRadioButton\n {...context}\n {...rest}\n ref={ref}\n checked={\n typeof checked !== \"undefined\"\n ? checked\n : typeof selectedValue !== \"undefined\"\n ? value === selectedValue\n : undefined\n }\n value={value}\n aria-describedby={helpLabel ? supportId : undefined}\n />\n <SupportLabel\n {...supportLabelProps}\n label={helpLabel}\n labelType={\"help\"}\n id={supportId}\n density={density}\n />\n </>\n );\n});\n\nRadioButton.displayName = \"RadioButton\";\n"],"names":["RadioButton","forwardRef","props","ref","checked","value","supportLabelProps","helpLabel","rest","selectedValue","density","context","useRadioGroupContext","supportId","useId","jsxs","Fragment","children","jsx","BaseRadioButton","SupportLabel","label","labelType","id","displayName"],"mappings":"o0DAmBO,MAAMA,EAAcC,GAA+C,CAACC,EAAOC,KACxE,MAAEC,QAAAA,EAASC,MAAAA,EAAOC,kBAAAA,EAAmBC,UAAAA,KAAcC,GAASN,GAC1DG,MAAOI,EAAeC,QAAAA,KAAYC,GAAYC,IAChDC,EAAYC,EAAM,qBAExB,OAEQC,EAAAC,EAAA,CAAAC,SAAA,CAAAC,EAACC,EAAA,IACOR,KACAH,EACJL,IAAAA,EACAC,eACWA,EAAY,IACbA,SACOK,EAAkB,IACzBJ,IAAUI,OACV,EAEVJ,MAAAA,EACA,mBAAkBE,EAAYM,OAAY,IAE9CK,EAACE,EAAA,IACOd,EACJe,MAAOd,EACPe,UAAW,OACXC,GAAIV,EACJH,QAAAA,MAER,IAIRV,EAAYwB,YAAc"}
@@ -0,0 +1,2 @@
1
+ import{jsx as o}from"react/jsx-runtime";import{FieldGroup as n}from"../input-group/FieldGroup.js";import"../input-group/InputGroup.js";import"../icon/Icon.js";import"../icon/icons/animated/ArrowVerticalAnimated.js";import"../icon/icons/animated/ArrowHorizontalAnimated.js";import"../icon/icons/animated/PlusRemoveAnimated.js";import"../icon/icons/ArrowDownIcon.js";import"../icon/icons/ArrowLeftIcon.js";import"../icon/icons/ArrowNorthEastIcon.js";import"../icon/icons/ArrowRightIcon.js";import"../icon/icons/ArrowUpIcon.js";import"../icon/icons/CalendarIcon.js";import"../icon/icons/CheckIcon.js";import"../icon/icons/ChevronDownIcon.js";import"../icon/icons/ChevronLeftIcon.js";import"../icon/icons/ChevronRightIcon.js";import"../icon/icons/ChevronUpIcon.js";import"../icon/icons/CloseIcon.js";import"../icon/icons/CopyIcon.js";import"../icon/icons/DotsIcon.js";import"../icon/icons/DragIcon.js";import"../icon/icons/ErrorIcon.js";import"../icon/icons/GreenCheckIcon.js";import"../icon/icons/HamburgerIcon.js";import"../icon/icons/InfoIcon.js";import"../icon/icons/LinkIcon.js";import"../icon/icons/PlusIcon.js";import"../icon/icons/QuestionIcon.js";import"../icon/icons/RedCrossIcon.js";import"../icon/icons/SearchIcon.js";import"../icon/icons/SuccessIcon.js";import"../icon/icons/WarningIcon.js";import"../icon/icons/MinusIcon.js";import"../icon/icons/ThumbDownIcon.js";import"../icon/icons/ThumbUpIcon.js";import"../icon/icons/TrashCanIcon.js";import"../icon/icons/PenIcon.js";import{RadioGroupContextProvider as i}from"./radioGroupContext.js";const c=c=>{const{name:r,value:s,onChange:t,errorLabel:p,inline:e=!1,density:m,labelProps:a={variant:"medium"},...j}=c;return o(i,{state:{onChange:t,value:s,name:r,invalid:!!p,inline:e,density:m},children:o(n,{errorLabel:p,labelProps:a,"data-testid":"jkl-radio-button-group",density:m,...j,role:"radiogroup","aria-invalid":!!p})})};export{c as RadioButtonGroup};
2
+ //# sourceMappingURL=RadioButtonGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RadioButtonGroup.js","sources":["../../../../src/components/radio-button/RadioButtonGroup.tsx"],"sourcesContent":["import React, { ChangeEventHandler, FC } from \"react\";\nimport { Density } from \"../..\";\nimport { FieldGroup, type FieldGroupProps } from \"../input-group\";\nimport { RadioGroupContextProvider } from \"./radioGroupContext\";\n\nexport interface RadioButtonGroupProps extends Omit<FieldGroupProps, \"onChange\"> {\n legend: string;\n /** Alle RadioButton i gruppen får dette som name. */\n name?: string;\n /** Om gruppen skal være controlled setter du den valgte verdien her. */\n value?: string;\n onChange?: ChangeEventHandler<HTMLInputElement>;\n helpLabel?: string;\n /**\n * Erstatter hjelpeteksten (hvis noen) med en feilmelding.\n * Merker samtidig alle RadioButton i gruppen som ugyldige.\n */\n errorLabel?: string;\n /**\n * Setter inline-modifieren på alle RadioButton i gruppen.\n * @default false\n */\n inline?: boolean;\n density?: Density;\n}\n\nexport const RadioButtonGroup: FC<RadioButtonGroupProps> = (props) => {\n const {\n name,\n value,\n onChange,\n errorLabel,\n inline = false,\n density,\n labelProps = { variant: \"medium\" },\n ...rest\n } = props;\n\n return (\n <RadioGroupContextProvider\n state={{\n onChange,\n value,\n name,\n invalid: Boolean(errorLabel),\n inline,\n density,\n }}\n >\n <FieldGroup\n errorLabel={errorLabel}\n labelProps={labelProps}\n data-testid=\"jkl-radio-button-group\"\n density={density}\n {...rest}\n role=\"radiogroup\"\n aria-invalid={Boolean(errorLabel)}\n />\n </RadioGroupContextProvider>\n );\n};\n"],"names":["RadioButtonGroup","props","name","value","onChange","errorLabel","inline","density","labelProps","variant","rest","jsx","RadioGroupContextProvider","state","invalid","children","FieldGroup","role"],"mappings":"6gDA0Ba,MAAAA,EAA+CC,IAClD,MACFC,KAAAA,EACAC,MAAAA,EACAC,SAAAA,EACAC,WAAAA,EACAC,OAAAA,GAAS,EACTC,QAAAA,EACAC,WAAAA,EAAa,CAAEC,QAAS,aACrBC,GACHT,EAGA,OAAAU,EAACC,EAAA,CACGC,MAAO,CACHT,SAAAA,EACAD,MAAAA,EACAD,KAAAA,EACAY,UAAiBT,EACjBC,OAAAA,EACAC,QAAAA,GAGJQ,SAAAJ,EAACK,EAAA,CACGX,WAAAA,EACAG,WAAAA,EACA,cAAY,yBACZD,QAAAA,KACIG,EACJO,KAAK,aACL,iBAAsBZ,KAC1B"}
@@ -0,0 +1,2 @@
1
+ import{RadioButton as o}from"./RadioButton.js";import{RadioButtonGroup as t}from"./RadioButtonGroup.js";import{BaseRadioButton as a}from"./BaseRadioButton.js";export{a as BaseRadioButton,o as RadioButton,t as RadioButtonGroup};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{createContext as o,useContext as t}from"react";const i=o({name:void 0,value:void 0,onChange:()=>{},inline:!1,density:void 0,invalid:!1}),r=()=>t(i),a=({state:o,children:t})=>e(i.Provider,{value:o,children:t});export{a as RadioGroupContextProvider,r as useRadioGroupContext};
2
+ //# sourceMappingURL=radioGroupContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radioGroupContext.js","sources":["../../../../src/components/radio-button/radioGroupContext.tsx"],"sourcesContent":["import React, { createContext, useContext, ChangeEventHandler } from \"react\";\nimport { Density, WithChildren } from \"../..\";\n\ntype RadioGroupContext = {\n name: string | undefined;\n value: string | undefined;\n inline: boolean;\n density?: Density;\n invalid: boolean;\n onChange: ChangeEventHandler<HTMLInputElement> | undefined;\n};\n\nconst radioGroupContext = createContext<RadioGroupContext>({\n name: undefined,\n value: undefined,\n onChange: () => {\n return;\n },\n inline: false,\n density: undefined,\n invalid: false,\n});\n\nexport const useRadioGroupContext = (): RadioGroupContext => useContext(radioGroupContext);\n\ninterface Props extends WithChildren {\n state: RadioGroupContext;\n}\n\nexport const RadioGroupContextProvider: React.FC<Props> = ({ state, children }) => (\n <radioGroupContext.Provider value={state}>{children}</radioGroupContext.Provider>\n);\n"],"names":["radioGroupContext","createContext","name","value","onChange","inline","density","invalid","useRadioGroupContext","useContext","RadioGroupContextProvider","state","children","jsx","Provider"],"mappings":"8FAYA,MAAMA,EAAoBC,EAAiC,CACvDC,UAAM,EACNC,WAAO,EACPC,SAAU,OAGVC,QAAQ,EACRC,aAAS,EACTC,SAAS,IAGAC,EAAuB,IAAyBC,EAAWT,GAM3DU,EAA6C,EAAGC,MAAAA,EAAOC,SAAAA,KAC/DC,EAAAb,EAAkBc,SAAlB,CAA2BX,MAAOQ,EAAQC,SAAAA"}
@@ -0,0 +1,2 @@
1
+ import"react/jsx-runtime";import"../../../clsx-BeLtu-UY.js";import"react";import"../../hooks/useScreen/useScreen.js";import"../../hooks/useId/useId.js";import"../icon/Icon.js";import"../icon/icons/animated/ArrowVerticalAnimated.js";import"../icon/icons/animated/ArrowHorizontalAnimated.js";import"../icon/icons/animated/PlusRemoveAnimated.js";import"../icon/icons/ArrowDownIcon.js";import"../icon/icons/ArrowLeftIcon.js";import"../icon/icons/ArrowNorthEastIcon.js";import"../icon/icons/ArrowRightIcon.js";import"../icon/icons/ArrowUpIcon.js";import"../icon/icons/CalendarIcon.js";import"../icon/icons/CheckIcon.js";import"../icon/icons/ChevronDownIcon.js";import"../icon/icons/ChevronLeftIcon.js";import"../icon/icons/ChevronRightIcon.js";import"../icon/icons/ChevronUpIcon.js";import"../icon/icons/CloseIcon.js";import"../icon/icons/CopyIcon.js";import"../icon/icons/DotsIcon.js";import"../icon/icons/DragIcon.js";import"../icon/icons/ErrorIcon.js";import"../icon/icons/GreenCheckIcon.js";import"../icon/icons/HamburgerIcon.js";import"../icon/icons/InfoIcon.js";import"../icon/icons/LinkIcon.js";import"../icon/icons/PlusIcon.js";import"../icon/icons/QuestionIcon.js";import"../icon/icons/RedCrossIcon.js";import"../icon/icons/SearchIcon.js";import"../icon/icons/SuccessIcon.js";import"../icon/icons/WarningIcon.js";import"../icon/icons/MinusIcon.js";import"../icon/icons/ThumbDownIcon.js";import"../icon/icons/ThumbUpIcon.js";import"../icon/icons/TrashCanIcon.js";import"../icon/icons/PenIcon.js";import"../button/Button.js";import"../card/Card.js";import"../card/CardImage.js";import"../card/NavCard.js";import"../checkbox/Checkbox.js";import"../combobox/Combobox.js";import"../cookie-consent/CookieConsentContext.js";import"react-dom";import"../modal/Modal.js";import"react-a11y-dialog";import"../list/List.js";import"../list/ListItem.js";import"../datepicker/DatePicker.js";import"../icon-button/IconButton.js";import"../tooltip/Tooltip.js";import"../tooltip/TooltipContent.js";import"../tooltip/TooltipTrigger.js";import"../input-group/InputGroup.js";import"../link/Link.js";import"../link/NavLink.js";import"../link-list/LinkList.js";import"../radio-button/RadioButton.js";import"../radio-button/radioGroupContext.js";import"../radio-button/BaseRadioButton.js";import{N as o}from"../../../NativeSelect-EidDABsT.js";import"../tag/Tag.js";import"../text-input/BaseTextArea.js";import"../text-input/BaseTextInput.js";import"../text-input/TextArea.js";import"../text-input/TextInput.js";import"../../utilities/polymorphism/SlotComponent.js";import"../../utilities/valuePair.js";export{o as NativeSelect};
2
+ //# sourceMappingURL=NativeSelect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeSelect.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import"react/jsx-runtime";import"../../../clsx-BeLtu-UY.js";import"react";import"../../hooks/useAnimatedHeight/useAnimatedHeight.js";import"../../hooks/usePreviousValue/usePreviousValue.js";import"../../hooks/useScreen/useScreen.js";import"../../hooks/useId/useId.js";import"../../hooks/useListNavigation/useListNavigation.js";import"../icon/Icon.js";import"../icon/icons/animated/ArrowVerticalAnimated.js";import"../icon/icons/animated/ArrowHorizontalAnimated.js";import"../icon/icons/animated/PlusRemoveAnimated.js";import"../icon/icons/ArrowDownIcon.js";import"../icon/icons/ArrowLeftIcon.js";import"../icon/icons/ArrowNorthEastIcon.js";import"../icon/icons/ArrowRightIcon.js";import"../icon/icons/ArrowUpIcon.js";import"../icon/icons/CalendarIcon.js";import"../icon/icons/CheckIcon.js";import"../icon/icons/ChevronDownIcon.js";import"../icon/icons/ChevronLeftIcon.js";import"../icon/icons/ChevronRightIcon.js";import"../icon/icons/ChevronUpIcon.js";import"../icon/icons/CloseIcon.js";import"../icon/icons/CopyIcon.js";import"../icon/icons/DotsIcon.js";import"../icon/icons/DragIcon.js";import"../icon/icons/ErrorIcon.js";import"../icon/icons/GreenCheckIcon.js";import"../icon/icons/HamburgerIcon.js";import"../icon/icons/InfoIcon.js";import"../icon/icons/LinkIcon.js";import"../icon/icons/PlusIcon.js";import"../icon/icons/QuestionIcon.js";import"../icon/icons/RedCrossIcon.js";import"../icon/icons/SearchIcon.js";import"../icon/icons/SuccessIcon.js";import"../icon/icons/WarningIcon.js";import"../icon/icons/MinusIcon.js";import"../icon/icons/ThumbDownIcon.js";import"../icon/icons/ThumbUpIcon.js";import"../icon/icons/TrashCanIcon.js";import"../icon/icons/PenIcon.js";import"../button/Button.js";import"../card/Card.js";import"../card/CardImage.js";import"../card/NavCard.js";import"../checkbox/Checkbox.js";import"../combobox/Combobox.js";import"../cookie-consent/CookieConsentContext.js";import"react-dom";import"../modal/Modal.js";import"react-a11y-dialog";import"../list/List.js";import"../list/ListItem.js";import"../datepicker/DatePicker.js";import"../icon-button/IconButton.js";import"../tooltip/Tooltip.js";import"../tooltip/TooltipContent.js";import"../tooltip/TooltipTrigger.js";import"../input-group/InputGroup.js";import"../link/Link.js";import"../link/NavLink.js";import"../link-list/LinkList.js";import"../radio-button/RadioButton.js";import"../radio-button/radioGroupContext.js";import"../radio-button/BaseRadioButton.js";import{S as o}from"../../../NativeSelect-EidDABsT.js";import"../tag/Tag.js";import"../text-input/BaseTextArea.js";import"../text-input/BaseTextInput.js";import"../text-input/TextArea.js";import"../text-input/TextInput.js";import"../../utilities/polymorphism/SlotComponent.js";import"../../utilities/valuePair.js";import"./select-utils.js";export{o as Select};
2
+ //# sourceMappingURL=Select.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Select.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{N as e,S as t}from"../../../NativeSelect-EidDABsT.js";export{e as NativeSelect,t as Select};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ function e(e=""){return e.toLowerCase().replace(/[\W_]+/g,"")}function o(e,o){let l=null;o&&(l=e.querySelector('[aria-selected="true"]:not([hidden])')),(!o||!l)&&(l=e.querySelector('[role="option"]')),null==l||l.focus(),e.scrollTop=(null==l?void 0:l.offsetTop)||0}export{o as focusSelected,e as toLower};
2
+ //# sourceMappingURL=select-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select-utils.js","sources":["../../../../src/components/select/select-utils.ts"],"sourcesContent":["export function toLower(str = \"\") {\n return str.toLowerCase().replace(/[\\W_]+/g, \"\"); // strip all non-alphanumeric chars\n}\n\nexport function focusSelected(listEl: HTMLElement, selected: string | undefined) {\n let focusedItem: HTMLElement | null = null;\n if (selected) {\n // Move focus to selected option\n focusedItem = listEl.querySelector(`[aria-selected=\"true\"]:not([hidden])`);\n }\n if (!selected || !focusedItem) {\n // Move focus to first option if either no selected value or the value could not be found.\n // This may happen with searchable selects if the currently selected value is filtered out.\n focusedItem = listEl.querySelector('[role=\"option\"]');\n }\n focusedItem?.focus();\n // Make sure the selected/focused item is visible in the list if it scrolls\n listEl.scrollTop = focusedItem?.offsetTop || 0;\n}\n"],"names":["toLower","str","toLowerCase","replace","focusSelected","listEl","selected","focusedItem","querySelector","focus","scrollTop","offsetTop"],"mappings":"AAAgB,SAAAA,EAAQC,EAAM,IAC1B,OAAOA,EAAIC,cAAcC,QAAQ,UAAW,GAChD,CAEgB,SAAAC,EAAcC,EAAqBC,GAC/C,IAAIC,EAAkC,KAClCD,IAEcC,EAAAF,EAAOG,cAAc,2CAElCF,IAAaC,KAGAA,EAAAF,EAAOG,cAAc,oBAEvC,MAAAD,GAAAA,EAAaE,QAENJ,EAAAK,WAAY,MAAAH,OAAAA,EAAAA,EAAaI,YAAa,CACjD"}
@@ -1,2 +1,2 @@
1
- import{jsxs as o,jsx as n}from"react/jsx-runtime";import i from"classnames";import"../icon/Icon.js";import"../icon/icons/animated/ArrowVerticalAnimated.js";import"../icon/icons/animated/ArrowHorizontalAnimated.js";import"../icon/icons/animated/PlusRemoveAnimated.js";import"../icon/icons/ArrowDownIcon.js";import"../icon/icons/ArrowLeftIcon.js";import"../icon/icons/ArrowNorthEastIcon.js";import"../icon/icons/ArrowRightIcon.js";import"../icon/icons/ArrowUpIcon.js";import"../icon/icons/CalendarIcon.js";import"../icon/icons/CheckIcon.js";import"../icon/icons/ChevronDownIcon.js";import"../icon/icons/ChevronLeftIcon.js";import"../icon/icons/ChevronRightIcon.js";import"../icon/icons/ChevronUpIcon.js";import{CloseIcon as c}from"../icon/icons/CloseIcon.js";import"../icon/icons/CopyIcon.js";import"../icon/icons/DotsIcon.js";import"../icon/icons/DragIcon.js";import"../icon/icons/ErrorIcon.js";import"../icon/icons/GreenCheckIcon.js";import"../icon/icons/HamburgerIcon.js";import"../icon/icons/InfoIcon.js";import"../icon/icons/LinkIcon.js";import"../icon/icons/PlusIcon.js";import"../icon/icons/QuestionIcon.js";import"../icon/icons/RedCrossIcon.js";import"../icon/icons/SearchIcon.js";import"../icon/icons/SuccessIcon.js";import"../icon/icons/WarningIcon.js";import"../icon/icons/MinusIcon.js";import"../icon/icons/ThumbDownIcon.js";import"../icon/icons/ThumbUpIcon.js";import"../icon/icons/TrashCanIcon.js";import"../icon/icons/PenIcon.js";import{IconButton as s}from"../icon-button/IconButton.js";function r(r){const t=({className:t,density:a,dismissAction:e,children:m,...j})=>o("span",{className:i("jkl-tag",{"jkl-tag--info":"info"===r,"jkl-tag--error":"error"===r,"jkl-tag--warning":"warning"===r,"jkl-tag--success":"success"===r},t),"data-density":a,...j,children:[m,e&&n(s,{className:"jkl-tag__dismiss-action",density:a,title:e.label,onClick:e.onClick,onFocus:e.onFocus,onBlur:e.onBlur,children:n(c,{variant:"small",bold:!0})})]});return t.displayName=function(o){switch(o){case"info":return"InfoTag";case"error":return"ErrorTag";case"warning":return"WarningTag";case"success":return"SuccessTag";default:return"Tag"}}(r),t}const t=r(),a=r("info"),e=r("error"),m=r("warning"),j=r("success");export{e as ErrorTag,a as InfoTag,j as SuccessTag,t as Tag,m as WarningTag};
1
+ import{jsxs as o,jsx as n}from"react/jsx-runtime";import{c as i}from"../../../clsx-BeLtu-UY.js";import"../icon/Icon.js";import"../icon/icons/animated/ArrowVerticalAnimated.js";import"../icon/icons/animated/ArrowHorizontalAnimated.js";import"../icon/icons/animated/PlusRemoveAnimated.js";import"../icon/icons/ArrowDownIcon.js";import"../icon/icons/ArrowLeftIcon.js";import"../icon/icons/ArrowNorthEastIcon.js";import"../icon/icons/ArrowRightIcon.js";import"../icon/icons/ArrowUpIcon.js";import"../icon/icons/CalendarIcon.js";import"../icon/icons/CheckIcon.js";import"../icon/icons/ChevronDownIcon.js";import"../icon/icons/ChevronLeftIcon.js";import"../icon/icons/ChevronRightIcon.js";import"../icon/icons/ChevronUpIcon.js";import{CloseIcon as c}from"../icon/icons/CloseIcon.js";import"../icon/icons/CopyIcon.js";import"../icon/icons/DotsIcon.js";import"../icon/icons/DragIcon.js";import"../icon/icons/ErrorIcon.js";import"../icon/icons/GreenCheckIcon.js";import"../icon/icons/HamburgerIcon.js";import"../icon/icons/InfoIcon.js";import"../icon/icons/LinkIcon.js";import"../icon/icons/PlusIcon.js";import"../icon/icons/QuestionIcon.js";import"../icon/icons/RedCrossIcon.js";import"../icon/icons/SearchIcon.js";import"../icon/icons/SuccessIcon.js";import"../icon/icons/WarningIcon.js";import"../icon/icons/MinusIcon.js";import"../icon/icons/ThumbDownIcon.js";import"../icon/icons/ThumbUpIcon.js";import"../icon/icons/TrashCanIcon.js";import"../icon/icons/PenIcon.js";import{IconButton as s}from"../icon-button/IconButton.js";function r(r){const t=({className:t,density:a,dismissAction:e,children:m,...j})=>o("span",{className:i("jkl-tag",{"jkl-tag--info":"info"===r,"jkl-tag--error":"error"===r,"jkl-tag--warning":"warning"===r,"jkl-tag--success":"success"===r},t),"data-density":a,...j,children:[m,e&&n(s,{className:"jkl-tag__dismiss-action",density:a,title:e.label,onClick:e.onClick,onFocus:e.onFocus,onBlur:e.onBlur,children:n(c,{variant:"small",bold:!0})})]});return t.displayName=function(o){switch(o){case"info":return"InfoTag";case"error":return"ErrorTag";case"warning":return"WarningTag";case"success":return"SuccessTag";default:return"Tag"}}(r),t}const t=r(),a=r("info"),e=r("error"),m=r("warning"),j=r("success");export{e as ErrorTag,a as InfoTag,j as SuccessTag,t as Tag,m as WarningTag};
2
2
  //# sourceMappingURL=Tag.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.js","sources":["../../../../src/components/tag/Tag.tsx"],"sourcesContent":["import cx from \"classnames\";\nimport React, { ButtonHTMLAttributes, FC, HTMLAttributes, MouseEventHandler } from \"react\";\nimport { Density } from \"../../core\";\nimport { CloseIcon } from \"../icon\";\nimport { IconButton } from \"../icon-button\";\n\nexport interface DismissAction extends Exclude<ButtonHTMLAttributes<HTMLButtonElement>, \"disabled\"> {\n label: string;\n onClick: MouseEventHandler<HTMLButtonElement>;\n}\n\nexport interface TagProps extends HTMLAttributes<HTMLSpanElement> {\n density?: Density;\n dismissAction?: DismissAction;\n}\n\ntype Variant = \"info\" | \"error\" | \"warning\" | \"success\";\n\nfunction getDisplayName(variant?: Variant) {\n switch (variant) {\n case \"info\":\n return \"InfoTag\";\n case \"error\":\n return \"ErrorTag\";\n case \"warning\":\n return \"WarningTag\";\n case \"success\":\n return \"SuccessTag\";\n default:\n return \"Tag\";\n }\n}\n\nfunction tagFactory(variant?: Variant) {\n const Tag: FC<TagProps> = ({ className, density, dismissAction, children, ...rest }) => (\n <span\n className={cx(\n \"jkl-tag\",\n {\n \"jkl-tag--info\": variant === \"info\",\n \"jkl-tag--error\": variant === \"error\",\n \"jkl-tag--warning\": variant === \"warning\",\n \"jkl-tag--success\": variant === \"success\",\n },\n className,\n )}\n data-density={density}\n {...rest}\n >\n {children}\n {dismissAction && (\n <IconButton\n className=\"jkl-tag__dismiss-action\"\n density={density}\n title={dismissAction.label}\n onClick={dismissAction.onClick}\n onFocus={dismissAction.onFocus}\n onBlur={dismissAction.onBlur}\n >\n <CloseIcon variant=\"small\" bold />\n </IconButton>\n )}\n </span>\n );\n Tag.displayName = getDisplayName(variant);\n return Tag;\n}\n\nexport const Tag = tagFactory();\nexport const InfoTag = tagFactory(\"info\");\nexport const ErrorTag = tagFactory(\"error\");\nexport const WarningTag = tagFactory(\"warning\");\nexport const SuccessTag = tagFactory(\"success\");\n"],"names":["tagFactory","variant","Tag","className","density","dismissAction","children","rest","jsxs","cx","jsx","IconButton","title","label","onClick","onFocus","onBlur","CloseIcon","bold","displayName","getDisplayName","InfoTag","ErrorTag","WarningTag","SuccessTag"],"mappings":"69CAiCA,SAASA,EAAWC,GACVC,MAAAA,EAAoB,EAAGC,UAAAA,EAAWC,QAAAA,EAASC,cAAAA,EAAeC,SAAAA,KAAaC,KACzEC,EAAC,OAAA,CACGL,UAAWM,EACP,UACA,CACI,gBAA6B,SAAZR,EACjB,iBAA8B,UAAZA,EAClB,mBAAgC,YAAZA,EACpB,mBAAgC,YAAZA,GAExBE,GAEJ,eAAcC,KACVG,EAEHD,SAAA,CAAAA,EACAD,GACGK,EAACC,EAAA,CACGR,UAAU,0BACVC,QAAAA,EACAQ,MAAOP,EAAcQ,MACrBC,QAAST,EAAcS,QACvBC,QAASV,EAAcU,QACvBC,OAAQX,EAAcW,OAEtBV,SAACI,EAAAO,EAAA,CAAUhB,QAAQ,QAAQiB,MAAI,SAK/ChB,OAAAA,EAAIiB,YA9CR,SAAwBlB,GACpB,OAAQA,GACJ,IAAK,OACM,MAAA,UACX,IAAK,QACM,MAAA,WACX,IAAK,UACM,MAAA,aACX,IAAK,UACM,MAAA,aACX,QACW,MAAA,MAEnB,CAiCsBmB,CAAenB,GAC1BC,CACX,CAEO,MAAMA,EAAMF,IACNqB,EAAUrB,EAAW,QACrBsB,EAAWtB,EAAW,SACtBuB,EAAavB,EAAW,WACxBwB,EAAaxB,EAAW"}
1
+ {"version":3,"file":"Tag.js","sources":["../../../../src/components/tag/Tag.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { ButtonHTMLAttributes, FC, HTMLAttributes, MouseEventHandler } from \"react\";\nimport { Density } from \"../../core\";\nimport { CloseIcon } from \"../icon\";\nimport { IconButton } from \"../icon-button\";\n\nexport interface DismissAction extends Exclude<ButtonHTMLAttributes<HTMLButtonElement>, \"disabled\"> {\n label: string;\n onClick: MouseEventHandler<HTMLButtonElement>;\n}\n\nexport interface TagProps extends HTMLAttributes<HTMLSpanElement> {\n density?: Density;\n dismissAction?: DismissAction;\n}\n\ntype Variant = \"info\" | \"error\" | \"warning\" | \"success\";\n\nfunction getDisplayName(variant?: Variant) {\n switch (variant) {\n case \"info\":\n return \"InfoTag\";\n case \"error\":\n return \"ErrorTag\";\n case \"warning\":\n return \"WarningTag\";\n case \"success\":\n return \"SuccessTag\";\n default:\n return \"Tag\";\n }\n}\n\nfunction tagFactory(variant?: Variant) {\n const Tag: FC<TagProps> = ({ className, density, dismissAction, children, ...rest }) => (\n <span\n className={clsx(\n \"jkl-tag\",\n {\n \"jkl-tag--info\": variant === \"info\",\n \"jkl-tag--error\": variant === \"error\",\n \"jkl-tag--warning\": variant === \"warning\",\n \"jkl-tag--success\": variant === \"success\",\n },\n className,\n )}\n data-density={density}\n {...rest}\n >\n {children}\n {dismissAction && (\n <IconButton\n className=\"jkl-tag__dismiss-action\"\n density={density}\n title={dismissAction.label}\n onClick={dismissAction.onClick}\n onFocus={dismissAction.onFocus}\n onBlur={dismissAction.onBlur}\n >\n <CloseIcon variant=\"small\" bold />\n </IconButton>\n )}\n </span>\n );\n Tag.displayName = getDisplayName(variant);\n return Tag;\n}\n\nexport const Tag = tagFactory();\nexport const InfoTag = tagFactory(\"info\");\nexport const ErrorTag = tagFactory(\"error\");\nexport const WarningTag = tagFactory(\"warning\");\nexport const SuccessTag = tagFactory(\"success\");\n"],"names":["tagFactory","variant","Tag","className","density","dismissAction","children","rest","jsxs","clsx","jsx","IconButton","title","label","onClick","onFocus","onBlur","CloseIcon","bold","displayName","getDisplayName","InfoTag","ErrorTag","WarningTag","SuccessTag"],"mappings":"i/CAiCA,SAASA,EAAWC,GACVC,MAAAA,EAAoB,EAAGC,UAAAA,EAAWC,QAAAA,EAASC,cAAAA,EAAeC,SAAAA,KAAaC,KACzEC,EAAC,OAAA,CACGL,UAAWM,EACP,UACA,CACI,gBAA6B,SAAZR,EACjB,iBAA8B,UAAZA,EAClB,mBAAgC,YAAZA,EACpB,mBAAgC,YAAZA,GAExBE,GAEJ,eAAcC,KACVG,EAEHD,SAAA,CAAAA,EACAD,GACGK,EAACC,EAAA,CACGR,UAAU,0BACVC,QAAAA,EACAQ,MAAOP,EAAcQ,MACrBC,QAAST,EAAcS,QACvBC,QAASV,EAAcU,QACvBC,OAAQX,EAAcW,OAEtBV,SAACI,EAAAO,EAAA,CAAUhB,QAAQ,QAAQiB,MAAI,SAK/ChB,OAAAA,EAAIiB,YA9CR,SAAwBlB,GACpB,OAAQA,GACJ,IAAK,OACM,MAAA,UACX,IAAK,QACM,MAAA,WACX,IAAK,UACM,MAAA,aACX,IAAK,UACM,MAAA,aACX,QACW,MAAA,MAEnB,CAiCsBmB,CAAenB,GAC1BC,CACX,CAEO,MAAMA,EAAMF,IACNqB,EAAUrB,EAAW,QACrBsB,EAAWtB,EAAW,SACtBuB,EAAavB,EAAW,WACxBwB,EAAaxB,EAAW"}
@@ -0,0 +1,2 @@
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{forwardRef as a,useState as r,useRef as s,useEffect as n}from"react";const o=a(((a,o)=>{const{autoExpand:l,counter:i,onBlur:c,onFocus:u,rows:d=7,placeholder:h=" ",startOpen:x,style:f,value:g,"aria-invalid":v,onChange:p,...m}=a,[y,_]=r((()=>typeof g>"u"?0:"number"==typeof g?String(g).length:g.length)),[j,k]=r(!1),w=s(null),N=o||w;n((()=>{const e=N.current;if(e){if(!l)return void(e.style.height="");j||g?(e.style.height="auto",e.style.height=`${e.scrollHeight}px`):e.style.height=""}}),[l,N,g,j]);const B=(null==i?void 0:i.maxLength)||0,$=B-y;const A=!(!v&&!(i&&y>B?`Du har skrevet ${y-B} tegn for mye`:void 0));return e("div",{className:"jkl-text-input-wrapper","data-invalid":A,"data-has-content":y>0,children:[t("textarea",{"aria-invalid":A,className:`jkl-text-area__text-area jkl-text-area__text-area--${d}-rows`,onBlur:function(e){k(!1),c&&c(e)},onFocus:function(e){k(!0),u&&u(e)},onChange:function(e){_(e.target.value.length),p&&p(e)},ref:N,style:{...f,...{overflowX:l?"hidden":void 0}},placeholder:h,value:g,...m}),i&&e("div",{className:"jkl-text-area__counter","aria-hidden":"true",children:[e("div",{className:"jkl-text-area__counter-count",children:[y," / ",B]}),!i.hideProgress&&t("div",{className:"jkl-text-area__counter-progress",style:{"--progress-width":(C=$,E=B,C<=0||0===E?0:100*C/E)+"%"}})]})]});var C,E}));o.displayName="BaseTextArea";export{o as BaseTextArea};
2
+ //# sourceMappingURL=BaseTextArea.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseTextArea.js","sources":["../../../../src/components/text-input/BaseTextArea.tsx"],"sourcesContent":["import React, {\n type FocusEvent,\n forwardRef,\n type RefObject,\n type TextareaHTMLAttributes,\n useRef,\n useState,\n useEffect,\n ChangeEvent,\n} from \"react\";\n\ntype Counter = {\n /** Antall tegn før telleren når maksimum og vi viser en feilmelding */\n maxLength: number;\n /**\n * Med teller vises en progress-bar i bunnen av tekstfeltet som krymper\n * ned fra 100% (null tegn skrevet) til 0% (maks antall tegn skrevet).\n * Om du vil skjule den, sett denne propen til true.\n *\n * @default false\n */\n hideProgress?: boolean;\n};\n\nexport interface BaseTextAreaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, \"children\"> {\n /**\n * Viser en teller i tekstfeltet når det har fokus.\n */\n counter?: Counter;\n /** Sett antall rader skjemafeltet ekspanderes til ved focus. Innholdet scroller om feltet fylles med mer innhold enn det er plass til. */\n rows?: number;\n inline?: boolean;\n startOpen?: boolean;\n /** Gjør så skjemafeltet ekspanderer seg til å vise alt innhold i stedet for å scrolle */\n autoExpand?: boolean;\n}\n\nexport const BaseTextArea = forwardRef<HTMLTextAreaElement, BaseTextAreaProps>((props, ref) => {\n const {\n autoExpand,\n counter,\n onBlur,\n onFocus,\n rows = 7,\n placeholder = \" \", // This space intentionally left blank. Denne + rows trengs for å få den ekspanderende effekten.\n startOpen,\n style,\n value,\n \"aria-invalid\": ariaInvalid,\n onChange,\n ...rest\n } = props;\n\n const [counterCurrent, setCounterCurrent] = useState(() => {\n if (typeof value === \"undefined\") {\n return 0;\n } else if (typeof value === \"number\") {\n return String(value).length;\n } else {\n return value.length;\n }\n });\n const [textAreaFocused, setTextAreaFocused] = useState(false);\n const internalRef = useRef<HTMLTextAreaElement>(null);\n const textAreaRef = (ref as RefObject<HTMLTextAreaElement>) || internalRef;\n\n useEffect(() => {\n const textAreaElement = textAreaRef.current;\n if (textAreaElement) {\n if (!autoExpand) {\n textAreaElement.style.height = \"\";\n return;\n }\n\n if (textAreaFocused || value) {\n textAreaElement.style.height = \"auto\"; // Sett til auto før scrollhøyden leses, sånn at redusering av høyde ved sletting av tekst fungerer\n textAreaElement.style.height = `${textAreaElement.scrollHeight}px`;\n } else {\n textAreaElement.style.height = \"\";\n }\n }\n }, [autoExpand, textAreaRef, value, textAreaFocused]);\n\n function handleOnFocus(e: FocusEvent<HTMLTextAreaElement>) {\n setTextAreaFocused(true);\n if (onFocus) {\n onFocus(e);\n }\n }\n\n function handleOnBlur(e: FocusEvent<HTMLTextAreaElement>) {\n setTextAreaFocused(false);\n if (onBlur) {\n onBlur(e);\n }\n }\n\n function handleOnChange(e: ChangeEvent<HTMLTextAreaElement>) {\n setCounterCurrent(e.target.value.length);\n if (onChange) {\n onChange(e);\n }\n }\n\n const counterTotal: number = counter?.maxLength || 0;\n const progressCurrent: number = counterTotal - counterCurrent;\n function calculatePercentage(current: number, total: number): number {\n if (current <= 0) {\n return 0;\n }\n return total === 0 ? 0 : (current * 100) / total;\n }\n const counterLabel =\n counter && counterCurrent > counterTotal\n ? `Du har skrevet ${counterCurrent - counterTotal} tegn for mye`\n : undefined;\n\n const invalid = Boolean(ariaInvalid || counterLabel);\n\n const overflowStyle = {\n overflowX: autoExpand ? \"hidden\" : undefined, // Must set overflowX hidden for Firefox https://stackoverflow.com/a/22700700\n } as React.CSSProperties;\n\n return (\n <div className=\"jkl-text-input-wrapper\" data-invalid={invalid} data-has-content={counterCurrent > 0}>\n <textarea\n aria-invalid={invalid}\n className={`jkl-text-area__text-area jkl-text-area__text-area--${rows}-rows`}\n onBlur={handleOnBlur}\n onFocus={handleOnFocus}\n onChange={handleOnChange}\n ref={textAreaRef}\n style={{ ...style, ...overflowStyle }}\n placeholder={placeholder}\n value={value}\n {...rest}\n />\n {counter && (\n <div className=\"jkl-text-area__counter\" aria-hidden=\"true\">\n <div className=\"jkl-text-area__counter-count\">\n {counterCurrent}&nbsp;/&nbsp;{counterTotal}\n </div>\n {!counter.hideProgress && (\n <div\n className=\"jkl-text-area__counter-progress\"\n style={{\n [\"--progress-width\" as string]: `${calculatePercentage(\n progressCurrent,\n counterTotal,\n )}%`,\n }}\n />\n )}\n </div>\n )}\n </div>\n );\n});\nBaseTextArea.displayName = \"BaseTextArea\";\n"],"names":["BaseTextArea","forwardRef","props","ref","autoExpand","counter","onBlur","onFocus","rows","placeholder","startOpen","style","value","ariaInvalid","onChange","rest","counterCurrent","setCounterCurrent","useState","String","length","textAreaFocused","setTextAreaFocused","internalRef","useRef","textAreaRef","useEffect","textAreaElement","current","height","scrollHeight","counterTotal","maxLength","progressCurrent","invalid","jsxs","className","children","jsx","e","target","overflowX","hideProgress","total","calculatePercentage","displayName"],"mappings":"8HAqCO,MAAMA,EAAeC,GAAmD,CAACC,EAAOC,KAC7E,MACFC,WAAAA,EACAC,QAAAA,EACAC,OAAAA,EACAC,QAAAA,EACAC,KAAAA,EAAO,EACPC,YAAAA,EAAc,IACdC,UAAAA,EACAC,MAAAA,EACAC,MAAAA,EACA,eAAgBC,EAChBC,SAAAA,KACGC,GACHb,GAEGc,EAAgBC,GAAqBC,GAAS,WACtCN,EAAU,IACV,EACiB,iBAAVA,EACPO,OAAOP,GAAOQ,OAEdR,EAAMQ,UAGdC,EAAiBC,GAAsBJ,GAAS,GACjDK,EAAcC,EAA4B,MAC1CC,EAAetB,GAA0CoB,EAE/DG,GAAU,KACN,MAAMC,EAAkBF,EAAYG,QACpC,GAAID,EAAiB,CACjB,IAAKvB,EAED,YADAuB,EAAgBhB,MAAMkB,OAAS,IAI/BR,GAAmBT,GACnBe,EAAgBhB,MAAMkB,OAAS,OAC/BF,EAAgBhB,MAAMkB,OAAS,GAAGF,EAAgBG,kBAElDH,EAAgBhB,MAAMkB,OAAS,EAEvC,IACD,CAACzB,EAAYqB,EAAab,EAAOS,IAuB9B,MAAAU,GAAuB,MAAA1B,OAAA,EAAAA,EAAS2B,YAAa,EAC7CC,EAA0BF,EAAef,EAO/C,MAKMkB,KAAkBrB,KAJpBR,GAAWW,EAAiBe,EACtB,kBAAkBf,EAAiBe,sBACnC,IASN,OAAAI,EAAC,OAAIC,UAAU,yBAAyB,eAAcF,EAAS,mBAAkBlB,EAAiB,EAC9FqB,SAAA,CAAAC,EAAC,WAAA,CACG,eAAcJ,EACdE,UAAW,sDAAsD5B,SACjEF,OAtCZ,SAAsBiC,GAClBjB,GAAmB,GACfhB,GACAA,EAAOiC,EAEf,EAkCYhC,QA9CZ,SAAuBgC,GACnBjB,GAAmB,GACff,GACAA,EAAQgC,EAEhB,EA0CYzB,SAjCZ,SAAwByB,GACFtB,EAAAsB,EAAEC,OAAO5B,MAAMQ,QAC7BN,GACAA,EAASyB,EAEjB,EA6BYpC,IAAKsB,EACLd,MAAO,IAAKA,KAbF,CAClB8B,UAAWrC,EAAa,cAAW,IAa3BK,YAAAA,EACAG,MAAAA,KACIG,IAEPV,GACI8B,EAAA,MAAA,CAAIC,UAAU,yBAAyB,cAAY,OAChDC,SAAA,CAACF,EAAA,MAAA,CAAIC,UAAU,+BACVC,SAAA,CAAArB,EAAe,MAAce,MAEhC1B,EAAQqC,cACNJ,EAAC,MAAA,CACGF,UAAU,kCACVzB,MAAO,CACF,oBAxCAiB,EAyCGK,EAzCcU,EA0CdZ,EAzCxBH,GAAW,GAGE,IAAVe,EAFI,EAEyB,IAAVf,EAAiBe,GAoCa,aAxCnDC,IAAoBhB,EAAiBe,CAiD1C,IAGR3C,EAAa6C,YAAc"}
@@ -0,0 +1,2 @@
1
+ import{jsxs as t,jsx as n}from"react/jsx-runtime";import i from"classnames";import{forwardRef as a}from"react";import{IconButton as e}from"../icon-button/IconButton.js";function s(t,n){return t?{width:t}:n?{width:`calc(${Math.min(n,40)}ch + 24px)`}:void 0}const o=a(((a,o)=>{const{action:l,align:r="left","aria-invalid":c,className:u="",density:p,maxLength:m,style:d,type:x="text",unit:h,width:f,...j}=a;return t("div",{className:"jkl-text-input-wrapper","data-invalid":c,style:{...d,...s(f,m)},children:[n("input",{"aria-invalid":c,ref:o,className:i("jkl-text-input__input",u,{"jkl-text-input__input--align-right":"right"===r}),maxLength:m,type:x,...j}),h&&n("span",{className:"jkl-text-input__unit",children:h}),l&&n(e,{density:p,className:i("jkl-text-input-action-button",l.className),title:l.label,onClick:l.onClick,onFocus:l.onFocus,onBlur:l.onBlur,ref:l.buttonRef,type:l.type||"button",children:l.icon})]})}));o.displayName="BaseInputField";export{o as BaseTextInput};
2
+ //# sourceMappingURL=BaseTextInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseTextInput.js","sources":["../../../../src/components/text-input/BaseTextInput.tsx"],"sourcesContent":["import cn from \"classnames\";\nimport React, {\n type CSSProperties,\n forwardRef,\n type MouseEventHandler,\n type ReactNode,\n InputHTMLAttributes,\n HTMLProps,\n} from \"react\";\nimport { Density } from \"../../core\";\nimport { IconProps } from \"../icon\";\nimport { IconButton } from \"../icon-button\";\n\nfunction getWidthAsStyle(width?: string, maxLength?: number): CSSProperties | undefined {\n if (width) {\n return { width }; // prioritize width prop\n }\n\n if (maxLength) {\n // adapt to maxLength, but capped at 40ch\n const length = `${Math.min(maxLength, 40)}ch`;\n const padding = \"24px\"; // left + right padding\n return { width: `calc(${length} + ${padding})` };\n }\n\n return undefined;\n}\n\ninterface ActionBaseProps extends Exclude<HTMLProps<HTMLButtonElement>, \"disabled\"> {\n icon: React.ReactElement<IconProps>;\n label: string;\n buttonRef?: React.Ref<HTMLButtonElement>;\n}\n\nexport interface ActionButton extends ActionBaseProps {\n type?: \"button\" | \"reset\";\n onClick: MouseEventHandler<HTMLButtonElement>;\n}\n\nexport interface ActionSubmit extends ActionBaseProps {\n type: \"submit\";\n onClick?: MouseEventHandler<HTMLButtonElement>;\n}\n\nexport type Action = ActionButton | ActionSubmit;\n\nexport interface BaseTextInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"children\"> {\n /**\n * Brukes til inputfelter hvor det brukes maskering, for formatering av store tall. Brukes typisk bare til valuta.\n * @default \"left\"\n */\n align?: \"left\" | \"right\";\n action?: Action;\n density?: Density;\n /**\n * Benevnelse for feltet. Unngå å bruke både benevnelse og handling samtidig\n * @example \"kr\"\n * */\n unit?: ReactNode;\n width?: string;\n}\n\nexport const BaseTextInput = forwardRef<HTMLInputElement, BaseTextInputProps>((props, ref) => {\n const {\n action,\n align = \"left\",\n \"aria-invalid\": ariaInvalid,\n className = \"\",\n density,\n maxLength,\n style,\n type = \"text\",\n unit,\n width,\n ...rest\n } = props;\n\n return (\n <div\n className=\"jkl-text-input-wrapper\"\n data-invalid={ariaInvalid}\n style={{ ...style, ...getWidthAsStyle(width, maxLength) }}\n >\n <input\n aria-invalid={ariaInvalid}\n ref={ref}\n className={cn(\"jkl-text-input__input\", className, {\n \"jkl-text-input__input--align-right\": align === \"right\",\n })}\n maxLength={maxLength}\n type={type}\n {...rest}\n />\n {unit && <span className=\"jkl-text-input__unit\">{unit}</span>}\n {action && (\n <IconButton\n density={density}\n className={cn(\"jkl-text-input-action-button\", action.className)}\n title={action.label}\n onClick={action.onClick}\n onFocus={action.onFocus}\n onBlur={action.onBlur}\n ref={action.buttonRef}\n type={action.type || \"button\"}\n >\n {action.icon}\n </IconButton>\n )}\n </div>\n );\n});\n\nBaseTextInput.displayName = \"BaseInputField\";\n"],"names":["getWidthAsStyle","width","maxLength","Math","min","BaseTextInput","forwardRef","props","ref","action","align","ariaInvalid","className","density","style","type","unit","rest","jsxs","children","jsx","cn","IconButton","title","label","onClick","onFocus","onBlur","buttonRef","icon","displayName"],"mappings":"yKAaA,SAASA,EAAgBC,EAAgBC,GACjCD,OAAAA,EACO,CAAEA,MAAAA,GAGTC,EAIO,CAAED,MAAO,QAFEE,KAAKC,IAAIF,EAAW,sBAFtCA,CAQR,CAoCO,MAAMG,EAAgBC,GAAiD,CAACC,EAAOC,KAC5E,MACFC,OAAAA,EACAC,MAAAA,EAAQ,OACR,eAAgBC,EAChBC,UAAAA,EAAY,GACZC,QAAAA,EACAX,UAAAA,EACAY,MAAAA,EACAC,KAAAA,EAAO,OACPC,KAAAA,EACAf,MAAAA,KACGgB,GACHV,EAGA,OAAAW,EAAC,MAAA,CACGN,UAAU,yBACV,eAAcD,EACdG,MAAO,IAAKA,KAAUd,EAAgBC,EAAOC,IAE7CiB,SAAA,CAAAC,EAAC,QAAA,CACG,eAAcT,EACdH,IAAAA,EACAI,UAAWS,EAAG,wBAAyBT,EAAW,CAC9C,qCAAgD,UAAVF,IAE1CR,UAAAA,EACAa,KAAAA,KACIE,IAEPD,GAAQI,EAAC,OAAK,CAAAR,UAAU,uBAAwBO,SAAKH,IACrDP,GACGW,EAACE,EAAA,CACGT,QAAAA,EACAD,UAAWS,EAAG,+BAAgCZ,EAAOG,WACrDW,MAAOd,EAAOe,MACdC,QAAShB,EAAOgB,QAChBC,QAASjB,EAAOiB,QAChBC,OAAQlB,EAAOkB,OACfnB,IAAKC,EAAOmB,UACZb,KAAMN,EAAOM,MAAQ,SAEpBI,SAAOV,EAAAoB,SACZ,IAMhBxB,EAAcyB,YAAc"}
@@ -0,0 +1,2 @@
1
+ import{jsx as o}from"react/jsx-runtime";import n from"classnames";import{forwardRef as i}from"react";import"../../hooks/useScreen/useScreen.js";import"../../hooks/useId/useId.js";import"../tooltip/Tooltip.js";import"../tooltip/TooltipContent.js";import"../tooltip/TooltipTrigger.js";import"../icon/Icon.js";import"../icon/icons/animated/ArrowVerticalAnimated.js";import"../icon/icons/animated/ArrowHorizontalAnimated.js";import"../icon/icons/animated/PlusRemoveAnimated.js";import"../icon/icons/ArrowDownIcon.js";import"../icon/icons/ArrowLeftIcon.js";import"../icon/icons/ArrowNorthEastIcon.js";import"../icon/icons/ArrowRightIcon.js";import"../icon/icons/ArrowUpIcon.js";import"../icon/icons/CalendarIcon.js";import"../icon/icons/CheckIcon.js";import"../icon/icons/ChevronDownIcon.js";import"../icon/icons/ChevronLeftIcon.js";import"../icon/icons/ChevronRightIcon.js";import"../icon/icons/ChevronUpIcon.js";import"../icon/icons/CloseIcon.js";import"../icon/icons/CopyIcon.js";import"../icon/icons/DotsIcon.js";import"../icon/icons/DragIcon.js";import"../icon/icons/ErrorIcon.js";import"../icon/icons/GreenCheckIcon.js";import"../icon/icons/HamburgerIcon.js";import"../icon/icons/InfoIcon.js";import"../icon/icons/LinkIcon.js";import"../icon/icons/PlusIcon.js";import"../icon/icons/QuestionIcon.js";import"../icon/icons/RedCrossIcon.js";import"../icon/icons/SearchIcon.js";import"../icon/icons/SuccessIcon.js";import"../icon/icons/WarningIcon.js";import"../icon/icons/MinusIcon.js";import"../icon/icons/ThumbDownIcon.js";import"../icon/icons/ThumbUpIcon.js";import"../icon/icons/TrashCanIcon.js";import"../icon/icons/PenIcon.js";import{InputGroup as r}from"../input-group/InputGroup.js";import{BaseTextArea as s}from"./BaseTextArea.js";const c=i(((i,c)=>{const{autoExpand:t,className:e,counter:p,density:a,errorLabel:m,helpLabel:j,inline:l,label:I,labelProps:u,startOpen:d,supportLabelProps:h,tooltipProps:x,...A}=i,b={label:I,density:a,errorLabel:m,helpLabel:j,labelProps:u,inline:l,supportLabelProps:h,tooltipProps:x},C={autoExpand:t,counter:p,startOpen:d};return o(r,{className:n("jkl-text-area",e,{"jkl-text-area--start-open":d,"jkl-text-area--auto-expand":t}),"data-testid":"jkl-text-area",...b,children:o(s,{ref:c,...A,...C})})}));c.displayName="TextArea";export{c as TextArea};
2
+ //# sourceMappingURL=TextArea.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.js","sources":["../../../../src/components/text-input/TextArea.tsx"],"sourcesContent":["import cn from \"classnames\";\nimport React, { forwardRef } from \"react\";\nimport { InputGroup, InputGroupProps } from \"../input-group\";\nimport { BaseTextArea, BaseTextAreaProps } from \"./BaseTextArea\";\n\nexport interface TextAreaProps extends Omit<InputGroupProps, \"children\">, BaseTextAreaProps {}\n\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>((props, ref) => {\n const {\n autoExpand,\n className,\n counter,\n density,\n errorLabel,\n helpLabel,\n inline,\n label,\n labelProps,\n startOpen,\n supportLabelProps,\n tooltipProps,\n ...rest\n } = props;\n const inputGroupProps = {\n label,\n density,\n errorLabel,\n helpLabel,\n labelProps,\n inline,\n supportLabelProps,\n tooltipProps,\n };\n const textAreaProps = { autoExpand, counter, startOpen };\n return (\n <InputGroup\n className={cn(\"jkl-text-area\", className, {\n \"jkl-text-area--start-open\": startOpen,\n \"jkl-text-area--auto-expand\": autoExpand,\n })}\n data-testid=\"jkl-text-area\"\n {...inputGroupProps}\n >\n <BaseTextArea ref={ref} {...rest} {...textAreaProps} />\n </InputGroup>\n );\n});\nTextArea.displayName = \"TextArea\";\n"],"names":["TextArea","forwardRef","props","ref","autoExpand","className","counter","density","errorLabel","helpLabel","inline","label","labelProps","startOpen","supportLabelProps","tooltipProps","rest","inputGroupProps","textAreaProps","jsx","InputGroup","cn","children","BaseTextArea","displayName"],"mappings":"ysDAOO,MAAMA,EAAWC,GAA+C,CAACC,EAAOC,KACrE,MACFC,WAAAA,EACAC,UAAAA,EACAC,QAAAA,EACAC,QAAAA,EACAC,WAAAA,EACAC,UAAAA,EACAC,OAAAA,EACAC,MAAAA,EACAC,WAAAA,EACAC,UAAAA,EACAC,kBAAAA,EACAC,aAAAA,KACGC,GACHd,EACEe,EAAkB,CACpBN,MAAAA,EACAJ,QAAAA,EACAC,WAAAA,EACAC,UAAAA,EACAG,WAAAA,EACAF,OAAAA,EACAI,kBAAAA,EACAC,aAAAA,GAEEG,EAAgB,CAAEd,WAAAA,EAAYE,QAAAA,EAASO,UAAAA,GAEzC,OAAAM,EAACC,EAAA,CACGf,UAAWgB,EAAG,gBAAiBhB,EAAW,CACtC,4BAA6BQ,EAC7B,6BAA8BT,IAElC,cAAY,mBACRa,EAEJK,WAACC,EAAa,CAAApB,IAAAA,KAAca,KAAUE,KAAe,IAIjElB,EAASwB,YAAc"}
@@ -0,0 +1,2 @@
1
+ import{jsx as o}from"react/jsx-runtime";import i from"classnames";import{forwardRef as n}from"react";import"../../hooks/useScreen/useScreen.js";import"../../hooks/useId/useId.js";import"../tooltip/Tooltip.js";import"../tooltip/TooltipContent.js";import"../tooltip/TooltipTrigger.js";import"../icon/Icon.js";import"../icon/icons/animated/ArrowVerticalAnimated.js";import"../icon/icons/animated/ArrowHorizontalAnimated.js";import"../icon/icons/animated/PlusRemoveAnimated.js";import"../icon/icons/ArrowDownIcon.js";import"../icon/icons/ArrowLeftIcon.js";import"../icon/icons/ArrowNorthEastIcon.js";import"../icon/icons/ArrowRightIcon.js";import"../icon/icons/ArrowUpIcon.js";import"../icon/icons/CalendarIcon.js";import"../icon/icons/CheckIcon.js";import"../icon/icons/ChevronDownIcon.js";import"../icon/icons/ChevronLeftIcon.js";import"../icon/icons/ChevronRightIcon.js";import"../icon/icons/ChevronUpIcon.js";import"../icon/icons/CloseIcon.js";import"../icon/icons/CopyIcon.js";import"../icon/icons/DotsIcon.js";import"../icon/icons/DragIcon.js";import"../icon/icons/ErrorIcon.js";import"../icon/icons/GreenCheckIcon.js";import"../icon/icons/HamburgerIcon.js";import"../icon/icons/InfoIcon.js";import"../icon/icons/LinkIcon.js";import"../icon/icons/PlusIcon.js";import"../icon/icons/QuestionIcon.js";import"../icon/icons/RedCrossIcon.js";import"../icon/icons/SearchIcon.js";import"../icon/icons/SuccessIcon.js";import"../icon/icons/WarningIcon.js";import"../icon/icons/MinusIcon.js";import"../icon/icons/ThumbDownIcon.js";import"../icon/icons/ThumbUpIcon.js";import"../icon/icons/TrashCanIcon.js";import"../icon/icons/PenIcon.js";import{InputGroup as s}from"../input-group/InputGroup.js";import{BaseTextInput as c}from"./BaseTextInput.js";const r=n(((n,r)=>{const{label:t,className:p,density:e,errorLabel:m,helpLabel:a,inline:j,inputClassName:l,labelProps:I,supportLabelProps:u,tooltipProps:d,...h}=n;return o(s,{label:t,density:e,errorLabel:m,helpLabel:a,labelProps:I,inline:j,supportLabelProps:u,tooltipProps:d,className:i(p,"jkl-text-input",{"jkl-text-input--inline":j}),"data-testid":"jkl-text-input",density:j?"compact":e,children:o(c,{ref:r,...h,className:l})})}));r.displayName="TextInput";export{r as TextInput};
2
+ //# sourceMappingURL=TextInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextInput.js","sources":["../../../../src/components/text-input/TextInput.tsx"],"sourcesContent":["import cn from \"classnames\";\nimport React, { forwardRef } from \"react\";\nimport { InputGroup, InputGroupProps } from \"../input-group\";\nimport { BaseTextInput, BaseTextInputProps } from \"./BaseTextInput\";\n\nexport interface TextInputProps extends Omit<InputGroupProps, \"children\">, BaseTextInputProps {\n \"data-testautoid\"?: string;\n inline?: boolean;\n inputClassName?: string;\n}\n\nexport const TextInput = forwardRef<HTMLInputElement, TextInputProps>((props, ref) => {\n const {\n label,\n className,\n density,\n errorLabel,\n helpLabel,\n inline,\n inputClassName,\n labelProps,\n supportLabelProps,\n tooltipProps,\n ...rest\n } = props;\n const inputGroupProps = {\n label,\n density,\n errorLabel,\n helpLabel,\n labelProps,\n inline,\n supportLabelProps,\n tooltipProps,\n };\n return (\n <InputGroup\n {...inputGroupProps}\n className={cn(className, \"jkl-text-input\", {\n \"jkl-text-input--inline\": inline,\n })}\n data-testid=\"jkl-text-input\"\n density={inline ? \"compact\" : density}\n >\n <BaseTextInput ref={ref} {...rest} className={inputClassName} />\n </InputGroup>\n );\n});\n\nTextInput.displayName = \"TextInput\";\n"],"names":["TextInput","forwardRef","props","ref","label","className","density","errorLabel","helpLabel","inline","inputClassName","labelProps","supportLabelProps","tooltipProps","rest","jsx","InputGroup","cn","children","BaseTextInput","displayName"],"mappings":"2sDAWO,MAAMA,EAAYC,GAA6C,CAACC,EAAOC,KACpE,MACFC,MAAAA,EACAC,UAAAA,EACAC,QAAAA,EACAC,WAAAA,EACAC,UAAAA,EACAC,OAAAA,EACAC,eAAAA,EACAC,WAAAA,EACAC,kBAAAA,EACAC,aAAAA,KACGC,GACHZ,EAYA,OAAAa,EAACC,EAAA,CAVDZ,MAAAA,EACAE,QAAAA,EACAC,WAAAA,EACAC,UAAAA,EACAG,WAAAA,EACAF,OAAAA,EACAG,kBAAAA,EACAC,aAAAA,EAKIR,UAAWY,EAAGZ,EAAW,iBAAkB,CACvC,yBAA0BI,IAE9B,cAAY,iBACZH,QAASG,EAAS,UAAYH,EAE9BY,WAACC,EAAc,CAAAhB,IAAAA,KAAcW,EAAMT,UAAWK,KAAgB,IAK1EV,EAAUoB,YAAc"}
@@ -0,0 +1,2 @@
1
+ import{BaseTextArea as e}from"./BaseTextArea.js";import{BaseTextInput as t}from"./BaseTextInput.js";import{TextArea as a}from"./TextArea.js";import{TextInput as s}from"./TextInput.js";export{e as BaseTextArea,t as BaseTextInput,a as TextArea,s as TextInput};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- import{jsxs as o,jsx as n}from"react/jsx-runtime";import i from"classnames";import{useState as c}from"react";import"../icon/Icon.js";import"../icon/icons/animated/ArrowVerticalAnimated.js";import"../icon/icons/animated/ArrowHorizontalAnimated.js";import"../icon/icons/animated/PlusRemoveAnimated.js";import"../icon/icons/ArrowDownIcon.js";import"../icon/icons/ArrowLeftIcon.js";import"../icon/icons/ArrowNorthEastIcon.js";import"../icon/icons/ArrowRightIcon.js";import"../icon/icons/ArrowUpIcon.js";import"../icon/icons/CalendarIcon.js";import"../icon/icons/CheckIcon.js";import"../icon/icons/ChevronDownIcon.js";import"../icon/icons/ChevronLeftIcon.js";import"../icon/icons/ChevronRightIcon.js";import"../icon/icons/ChevronUpIcon.js";import"../icon/icons/CloseIcon.js";import"../icon/icons/CopyIcon.js";import"../icon/icons/DotsIcon.js";import"../icon/icons/DragIcon.js";import"../icon/icons/ErrorIcon.js";import"../icon/icons/GreenCheckIcon.js";import"../icon/icons/HamburgerIcon.js";import"../icon/icons/InfoIcon.js";import"../icon/icons/LinkIcon.js";import"../icon/icons/PlusIcon.js";import{QuestionIcon as s}from"../icon/icons/QuestionIcon.js";import"../icon/icons/RedCrossIcon.js";import"../icon/icons/SearchIcon.js";import"../icon/icons/SuccessIcon.js";import"../icon/icons/WarningIcon.js";import"../icon/icons/MinusIcon.js";import"../icon/icons/ThumbDownIcon.js";import"../icon/icons/ThumbUpIcon.js";import"../icon/icons/TrashCanIcon.js";import"../icon/icons/PenIcon.js";import{Tooltip as r}from"./Tooltip.js";import{TooltipContent as t}from"./TooltipContent.js";import{TooltipTrigger as m}from"./TooltipTrigger.js";const p=({content:p,triggerProps:e,...a})=>{const[j,l]=c(!1);return o(r,{triggerOn:"click",...a,children:[n(m,{children:o("button",{...e,onFocus:o=>{var n;l(!0),null==(n=null==e?void 0:e.onFocus)||n.call(e,o)},onBlur:o=>{var n;l(!1),null==(n=null==e?void 0:e.onBlur)||n.call(e,o)},type:"button",className:i("jkl-tooltip-question-button",null==e?void 0:e.className),children:[n(s,{variant:"inherit",bold:j}),n("span",{className:"jkl-sr-only",children:"Vis hjelpetekst"})]})}),n(t,{children:p})]})};export{p as PopupTip};
1
+ import{jsxs as o,jsx as n}from"react/jsx-runtime";import{c as i}from"../../../clsx-BeLtu-UY.js";import{useState as c}from"react";import"../icon/Icon.js";import"../icon/icons/animated/ArrowVerticalAnimated.js";import"../icon/icons/animated/ArrowHorizontalAnimated.js";import"../icon/icons/animated/PlusRemoveAnimated.js";import"../icon/icons/ArrowDownIcon.js";import"../icon/icons/ArrowLeftIcon.js";import"../icon/icons/ArrowNorthEastIcon.js";import"../icon/icons/ArrowRightIcon.js";import"../icon/icons/ArrowUpIcon.js";import"../icon/icons/CalendarIcon.js";import"../icon/icons/CheckIcon.js";import"../icon/icons/ChevronDownIcon.js";import"../icon/icons/ChevronLeftIcon.js";import"../icon/icons/ChevronRightIcon.js";import"../icon/icons/ChevronUpIcon.js";import"../icon/icons/CloseIcon.js";import"../icon/icons/CopyIcon.js";import"../icon/icons/DotsIcon.js";import"../icon/icons/DragIcon.js";import"../icon/icons/ErrorIcon.js";import"../icon/icons/GreenCheckIcon.js";import"../icon/icons/HamburgerIcon.js";import"../icon/icons/InfoIcon.js";import"../icon/icons/LinkIcon.js";import"../icon/icons/PlusIcon.js";import{QuestionIcon as s}from"../icon/icons/QuestionIcon.js";import"../icon/icons/RedCrossIcon.js";import"../icon/icons/SearchIcon.js";import"../icon/icons/SuccessIcon.js";import"../icon/icons/WarningIcon.js";import"../icon/icons/MinusIcon.js";import"../icon/icons/ThumbDownIcon.js";import"../icon/icons/ThumbUpIcon.js";import"../icon/icons/TrashCanIcon.js";import"../icon/icons/PenIcon.js";import{Tooltip as r}from"./Tooltip.js";import{TooltipContent as t}from"./TooltipContent.js";import{TooltipTrigger as m}from"./TooltipTrigger.js";const p=({content:p,triggerProps:e,...a})=>{const[j,l]=c(!1);return o(r,{triggerOn:"click",...a,children:[n(m,{children:o("button",{...e,onFocus:o=>{var n;l(!0),null==(n=null==e?void 0:e.onFocus)||n.call(e,o)},onBlur:o=>{var n;l(!1),null==(n=null==e?void 0:e.onBlur)||n.call(e,o)},type:"button",className:i("jkl-tooltip-question-button",null==e?void 0:e.className),children:[n(s,{variant:"inherit",bold:j}),n("span",{className:"jkl-sr-only",children:"Vis hjelpetekst"})]})}),n(t,{children:p})]})};export{p as PopupTip};
2
2
  //# sourceMappingURL=PopupTip.js.map
@@ -1 +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":["PopupTip","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":"wlDAkBO,MAAMA,EAA8B,EAAGC,QAAAA,EAASC,aAAAA,KAAiBC,MACpE,MAAOC,EAAQC,GAAaC,GAAS,GAYhC,OAAAC,EAAAC,EAAA,CAAQC,UAAU,WAAYN,EAC3BO,SAAA,CAAAC,EAACC,EACG,CAAAF,SAAAH,EAAC,SAAA,IACOL,EACJW,QAd2CC,UACvDT,GAAU,GACV,OAAAU,EAAA,MAAAb,OAAAA,EAAAA,EAAcW,UAAdE,EAAAC,KAAAd,EAAwBY,EAAAA,EAaZG,OAX0CH,UACtDT,GAAU,GACV,OAAAU,EAAA,MAAAb,OAAAA,EAAAA,EAAce,SAAdF,EAAAC,KAAAd,EAAuBY,EAAAA,EAUXI,KAAK,SACLC,UAAWC,EAAG,8BAA+B,MAAAlB,OAAA,EAAAA,EAAciB,WAE3DT,SAAA,CAAAC,EAACU,EAAa,CAAAC,QAAQ,UAAUC,KAAMnB,IACrCO,EAAA,OAAA,CAAKQ,UAAU,cAAcT,SAAe,yBAGrDC,EAACa,GAAgBd,SAAQT,MAC7B"}
1
+ {"version":3,"file":"PopupTip.js","sources":["../../../../src/components/tooltip/PopupTip.tsx"],"sourcesContent":["import clsx from \"clsx\";\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={clsx(\"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":["PopupTip","content","triggerProps","tooltipProps","isBold","setIsBold","useState","jsxs","Tooltip","triggerOn","children","jsx","TooltipTrigger","onFocus","event","_a","call","onBlur","type","className","clsx","QuestionIcon","variant","bold","TooltipContent"],"mappings":"4mDAkBO,MAAMA,EAA8B,EAAGC,QAAAA,EAASC,aAAAA,KAAiBC,MACpE,MAAOC,EAAQC,GAAaC,GAAS,GAYhC,OAAAC,EAAAC,EAAA,CAAQC,UAAU,WAAYN,EAC3BO,SAAA,CAAAC,EAACC,EACG,CAAAF,SAAAH,EAAC,SAAA,IACOL,EACJW,QAd2CC,UACvDT,GAAU,GACV,OAAAU,EAAA,MAAAb,OAAAA,EAAAA,EAAcW,UAAdE,EAAAC,KAAAd,EAAwBY,EAAAA,EAaZG,OAX0CH,UACtDT,GAAU,GACV,OAAAU,EAAA,MAAAb,OAAAA,EAAAA,EAAce,SAAdF,EAAAC,KAAAd,EAAuBY,EAAAA,EAUXI,KAAK,SACLC,UAAWC,EAAK,8BAA+B,MAAAlB,OAAA,EAAAA,EAAciB,WAE7DT,SAAA,CAAAC,EAACU,EAAa,CAAAC,QAAQ,UAAUC,KAAMnB,IACrCO,EAAA,OAAA,CAAKQ,UAAU,cAAcT,SAAe,yBAGrDC,EAACa,GAAgBd,SAAQT,MAC7B"}
@@ -1,2 +1,2 @@
1
- import{jsx as t,jsxs as e}from"react/jsx-runtime";import{useMergeRefs as r,FloatingPortal as o}from"@floating-ui/react";import a from"classnames";import{AnimatePresence as s,motion as i}from"framer-motion";import{forwardRef as n}from"react";import"../../hooks/useScreen/useScreen.js";import{useId as l}from"../../hooks/useId/useId.js";import{useTooltipContext as c}from"./Tooltip.js";function p(t,e=8){switch(!0){case t.startsWith("top"):return{top:e};case t.startsWith("left"):return{left:e,right:-e};case t.startsWith("bottom"):return{top:-e};case t.startsWith("right"):return{left:-e,right:e};default:return{top:e}}}const m=n((function({className:n,children:m,...d},u){const{triggerOn:f,arrowElement:h,isOpen:g,getFloatingProps:j,placement:k,isPositioned:x,middlewareData:{arrow:y},floatingStyles:w,refs:v}=c(),I=r([u,v.setFloating]),P=l("jkl-tooltip-content");let N;if(v.reference.current){const t=getComputedStyle(v.reference.current).getPropertyValue("--jkl-background-color");N=parseInt(t.replace("#",""),16)<8388607.5?"dark":"light"}return t(o,{children:e(s,{children:["hover"===f&&t("span",{ref:v.setDescription,hidden:!0,children:m},`${P}-trigger`),g&&t("span",{className:"jkl",children:e(i.span,{ref:I,initial:{opacity:0,...p(k,5)},animate:{opacity:1,...p(k,0)},exit:{opacity:0,...p(k,-5),transition:{ease:"easeIn",duration:.15}},transition:{ease:"easeOut",duration:.25},"data-placement":k,"aria-live":"click"===f?"assertive":void 0,className:a("jkl-tooltip-content",n),...j({...d,id:P}),style:{...w},"data-theme":N,children:[m,t("span",{"aria-hidden":!0,className:"jkl-tooltip-content__arrow",ref:h,style:{left:x?`${null==y?void 0:y.x}px`:"",top:x?`${null==y?void 0:y.y}px`:""}})]},P)},`${P}-wrapper`)]})})}));export{m as TooltipContent};
1
+ import{jsx as t,jsxs as e}from"react/jsx-runtime";import{useMergeRefs as r,FloatingPortal as o}from"@floating-ui/react";import{c as a}from"../../../clsx-BeLtu-UY.js";import{AnimatePresence as s,motion as i}from"framer-motion";import{forwardRef as n}from"react";import"../../hooks/useScreen/useScreen.js";import{useId as l}from"../../hooks/useId/useId.js";import{useTooltipContext as c}from"./Tooltip.js";function p(t,e=8){switch(!0){case t.startsWith("top"):return{top:e};case t.startsWith("left"):return{left:e,right:-e};case t.startsWith("bottom"):return{top:-e};case t.startsWith("right"):return{left:-e,right:e};default:return{top:e}}}const m=n((function({className:n,children:m,...d},u){const{triggerOn:f,arrowElement:h,isOpen:g,getFloatingProps:j,placement:k,isPositioned:x,middlewareData:{arrow:y},floatingStyles:w,refs:v}=c(),I=r([u,v.setFloating]),P=l("jkl-tooltip-content");let N;if(v.reference.current){const t=getComputedStyle(v.reference.current).getPropertyValue("--jkl-background-color");N=parseInt(t.replace("#",""),16)<8388607.5?"dark":"light"}return t(o,{children:e(s,{children:["hover"===f&&t("span",{ref:v.setDescription,hidden:!0,children:m},`${P}-trigger`),g&&t("span",{className:"jkl",children:e(i.span,{ref:I,initial:{opacity:0,...p(k,5)},animate:{opacity:1,...p(k,0)},exit:{opacity:0,...p(k,-5),transition:{ease:"easeIn",duration:.15}},transition:{ease:"easeOut",duration:.25},"data-placement":k,"aria-live":"click"===f?"assertive":void 0,className:a("jkl-tooltip-content",n),...j({...d,id:P}),style:{...w},"data-theme":N,children:[m,t("span",{"aria-hidden":!0,className:"jkl-tooltip-content__arrow",ref:h,style:{left:x?`${null==y?void 0:y.x}px`:"",top:x?`${null==y?void 0:y.y}px`:""}})]},P)},`${P}-wrapper`)]})})}));export{m as TooltipContent};
2
2
  //# sourceMappingURL=TooltipContent.js.map
@@ -1 +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":"gYAOA,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,GAAsD,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,IACEC,EAAMC,EAAa,CAACZ,EAAcS,EAAKI,cACvCC,EAAYC,EAAM,uBAIpBC,IAAAA,EACAP,GAAAA,EAAKQ,UAAUC,QAAS,CACxB,MAAMC,EAAkBC,iBAAiBX,EAAKQ,UAAUC,SAAwBG,iBAC5E,0BAIIL,EAAAM,SAASH,EAAgBI,QAAQ,IAAK,IAAK,IAAM,UAAe,OAAS,OACrF,CAGI,OAAAC,EAACC,EACG,CAAA3B,SAAA4B,EAACC,EAGI,CAAA7B,SAAA,CAAc,UAAAG,GACVuB,EAAA,OAAA,CAAKb,IAAKF,EAAKmB,eAAgBC,QAAM,EACjC/B,SAAAA,GADuC,GAAGgB,aAIlDX,GACGqB,EAAC,OAAK,CAAA3B,UAAU,MACZC,SAAA4B,EAACI,EAAOC,KAAP,CAEGpB,IAAAA,EACAqB,QAAS,CAAEC,QAAS,KAAM7C,EAAqBC,EAAW,IAC1D6C,QAAS,CAAED,QAAS,KAAM7C,EAAqBC,EAAW,IAC1D8C,KAAM,CACFF,QAAS,KACN7C,EAAqBC,GAAa,GACrC+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,EAAC,OAAA,CACG,eAAW,EACX3B,UAAU,6BACVc,IAAKT,EACLuC,MAAO,CACHhD,KAAMY,EAAe,GAAG,MAAAE,OAAAA,EAAAA,EAAOmC,MAAQ,GACvClD,IAAKa,EAAe,GAAG,MAAAE,OAAAA,EAAAA,EAAOoC,MAAQ,QAxBzC7B,IAFc,GAAGA,iBAmClD"}
1
+ {"version":3,"file":"TooltipContent.js","sources":["../../../../src/components/tooltip/TooltipContent.tsx"],"sourcesContent":["import { type Placement, useMergeRefs, FloatingPortal } from \"@floating-ui/react\";\nimport clsx from \"clsx\";\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={clsx(\"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","clsx","id","style","x","y"],"mappings":"oZAOA,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,GAAsD,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,IACEC,EAAMC,EAAa,CAACZ,EAAcS,EAAKI,cACvCC,EAAYC,EAAM,uBAIpBC,IAAAA,EACAP,GAAAA,EAAKQ,UAAUC,QAAS,CACxB,MAAMC,EAAkBC,iBAAiBX,EAAKQ,UAAUC,SAAwBG,iBAC5E,0BAIIL,EAAAM,SAASH,EAAgBI,QAAQ,IAAK,IAAK,IAAM,UAAe,OAAS,OACrF,CAGI,OAAAC,EAACC,EACG,CAAA3B,SAAA4B,EAACC,EAGI,CAAA7B,SAAA,CAAc,UAAAG,GACVuB,EAAA,OAAA,CAAKb,IAAKF,EAAKmB,eAAgBC,QAAM,EACjC/B,SAAAA,GADuC,GAAGgB,aAIlDX,GACGqB,EAAC,OAAK,CAAA3B,UAAU,MACZC,SAAA4B,EAACI,EAAOC,KAAP,CAEGpB,IAAAA,EACAqB,QAAS,CAAEC,QAAS,KAAM7C,EAAqBC,EAAW,IAC1D6C,QAAS,CAAED,QAAS,KAAM7C,EAAqBC,EAAW,IAC1D8C,KAAM,CACFF,QAAS,KACN7C,EAAqBC,GAAa,GACrC+C,WAAY,CAAEC,KAAM,SAAUC,SAAU,MAE5CF,WAAY,CAAEC,KAAM,UAAWC,SAAU,KACzC,iBAAgBjD,EAChB,YAAyB,UAAdY,EAAwB,iBAAc,EACjDJ,UAAW0C,EAAK,sBAAuB1C,MACnCO,EAAiB,IAAKL,EAAOyC,GAAI1B,IACrC2B,MAAO,IAAKjC,GACZ,aAAYQ,EAEXlB,SAAA,CAAAA,EACD0B,EAAC,OAAA,CACG,eAAW,EACX3B,UAAU,6BACVc,IAAKT,EACLuC,MAAO,CACHhD,KAAMY,EAAe,GAAG,MAAAE,OAAAA,EAAAA,EAAOmC,MAAQ,GACvClD,IAAKa,EAAe,GAAG,MAAAE,OAAAA,EAAAA,EAAOoC,MAAQ,QAxBzC7B,IAFc,GAAGA,iBAmClD"}
@@ -1,2 +1,2 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useMergeRefs as r}from"@floating-ui/react";import t from"classnames";import o,{forwardRef as n}from"react";import{useTooltipContext as s}from"./Tooltip.js";const l=n((function({children:n,className:l,...a},i){var p,c;const{isOpen:f,setOpen:m,getReferenceProps:u,refs:d,triggerOn:g}=s(),x=n.ref,b=r([x,d.setReference,i]),j=()=>{"click"===g&&m(!1)},B=[null==(p=d.reference.current)?void 0:p.textContent,null==(c=d.description.current)?void 0:c.textContent].filter(Boolean).join(". ");return o.isValidElement(n)?o.cloneElement(n,u({ref:b,"aria-label":B,...n.props,...a,className:t(n.props.className,l),"data-tooltip-shown":f,style:{...n.props.style},tabIndex:"click"===g?0:void 0,onBlur:()=>{n.props.onBlur&&n.props.onBlur(),j()}})):e("button",{"data-tooltip-shown":f,...u({className:t(l,"jkl-tooltip-trigger"),type:"button",ref:b,onBlur:j,"aria-label":B,...a}),children:n})}));export{l as TooltipTrigger};
1
+ import{jsx as e}from"react/jsx-runtime";import{useMergeRefs as r}from"@floating-ui/react";import{c as t}from"../../../clsx-BeLtu-UY.js";import o,{forwardRef as s}from"react";import{useTooltipContext as n}from"./Tooltip.js";const l=s((function({children:s,className:l,...i},a){var p,c;const{isOpen:f,setOpen:m,getReferenceProps:u,refs:d,triggerOn:g}=n(),x=s.ref,j=r([x,d.setReference,a]),b=()=>{"click"===g&&m(!1)},B=[null==(p=d.reference.current)?void 0:p.textContent,null==(c=d.description.current)?void 0:c.textContent].filter(Boolean).join(". ");return o.isValidElement(s)?o.cloneElement(s,u({ref:j,"aria-label":B,...s.props,...i,className:t(s.props.className,l),"data-tooltip-shown":f,style:{...s.props.style},tabIndex:"click"===g?0:void 0,onBlur:()=>{s.props.onBlur&&s.props.onBlur(),b()}})):e("button",{"data-tooltip-shown":f,...u({className:t(l,"jkl-tooltip-trigger"),type:"button",ref:j,onBlur:b,"aria-label":B,...i}),children:s})}));export{l as TooltipTrigger};
2
2
  //# sourceMappingURL=TooltipTrigger.js.map
@@ -1 +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":"2MAKa,MAAAA,EAAiBC,GAAgD,UACxEC,SAAAA,EAAUC,UAAAA,KAAcC,GAC1BC,WAEM,MAAEC,OAAAA,EAAQC,QAAAA,EAASC,kBAAAA,EAAmBC,KAAAA,EAAMC,UAAAA,GAAcC,IAC1DC,EAAeV,EAAiBW,IAChCA,EAAMC,EAAa,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,EAAC,SAAA,CACG,qBAAoB5B,KAChBE,EAAkB,CAClBL,UAAW2B,EAAG3B,EAAW,uBAEzBgC,KAAM,SACNtB,IAAAA,EACAoB,OAAQjB,EACR,aAAcC,KACXb,IAGNF,SAAAA,GAGb"}
1
+ {"version":3,"file":"TooltipTrigger.js","sources":["../../../../src/components/tooltip/TooltipTrigger.tsx"],"sourcesContent":["import { useMergeRefs } from \"@floating-ui/react\";\nimport clsx from \"clsx\";\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: clsx(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: clsx(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","clsx","style","tabIndex","onBlur","jsx","type"],"mappings":"+NAKa,MAAAA,EAAiBC,GAAgD,UACxEC,SAAAA,EAAUC,UAAAA,KAAcC,GAC1BC,WAEM,MAAEC,OAAAA,EAAQC,QAAAA,EAASC,kBAAAA,EAAmBC,KAAAA,EAAMC,UAAAA,GAAcC,IAC1DC,EAAeV,EAAiBW,IAChCA,EAAMC,EAAa,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,EAAK5B,EAASE,MAAMD,UAAWA,GAC1C,qBAAsBG,EACtByB,MAAO,IAAK7B,EAASE,MAAM2B,OAC3BC,SAAwB,UAAdtB,EAAwB,OAAI,EACtCuB,OAAQ,KACJ/B,EAASE,MAAM6B,QAAU/B,EAASE,MAAM6B,SAC7BjB,QAOvBkB,EAAC,SAAA,CACG,qBAAoB5B,KAChBE,EAAkB,CAClBL,UAAW2B,EAAK3B,EAAW,uBAE3BgC,KAAM,SACNtB,IAAAA,EACAoB,OAAQjB,EACR,aAAcC,KACXb,IAGNF,SAAAA,GAGb"}
package/build/es/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{Card as o}from"./components/card/Card.js";import{CardImage as s}from"./components/card/CardImage.js";import{InfoBlock as e,NavCard as n}from"./components/card/NavCard.js";import{TaskCard as r}from"./components/card/TaskCard.js";import{InfoCard as t}from"./components/card/InfoCard.js";import{Icon as a}from"./components/icon/Icon.js";import{ArrowVerticalAnimated as i}from"./components/icon/icons/animated/ArrowVerticalAnimated.js";import{ArrowHorizontalAnimated as m}from"./components/icon/icons/animated/ArrowHorizontalAnimated.js";import{PlusRemoveAnimated as c}from"./components/icon/icons/animated/PlusRemoveAnimated.js";import{ArrowDownIcon as p}from"./components/icon/icons/ArrowDownIcon.js";import{ArrowLeftIcon as u}from"./components/icon/icons/ArrowLeftIcon.js";import{ArrowNorthEastIcon as l}from"./components/icon/icons/ArrowNorthEastIcon.js";import{ArrowRightIcon as f}from"./components/icon/icons/ArrowRightIcon.js";import{ArrowUpIcon as I}from"./components/icon/icons/ArrowUpIcon.js";import{CalendarIcon as j}from"./components/icon/icons/CalendarIcon.js";import{CheckIcon as k}from"./components/icon/icons/CheckIcon.js";import{ChevronDownIcon as d}from"./components/icon/icons/ChevronDownIcon.js";import{ChevronLeftIcon as g}from"./components/icon/icons/ChevronLeftIcon.js";import{ChevronRightIcon as h}from"./components/icon/icons/ChevronRightIcon.js";import{ChevronUpIcon as S}from"./components/icon/icons/ChevronUpIcon.js";import{CloseIcon as A}from"./components/icon/icons/CloseIcon.js";import{CopyIcon as C}from"./components/icon/icons/CopyIcon.js";import{DotsIcon as T}from"./components/icon/icons/DotsIcon.js";import{DragIcon as L}from"./components/icon/icons/DragIcon.js";import{ErrorIcon as v}from"./components/icon/icons/ErrorIcon.js";import{GreenCheckIcon as E}from"./components/icon/icons/GreenCheckIcon.js";import{HamburgerIcon as R}from"./components/icon/icons/HamburgerIcon.js";import{InfoIcon as w}from"./components/icon/icons/InfoIcon.js";import{LinkIcon as b}from"./components/icon/icons/LinkIcon.js";import{PlusIcon as M}from"./components/icon/icons/PlusIcon.js";import{QuestionIcon as N}from"./components/icon/icons/QuestionIcon.js";import{RedCrossIcon as O}from"./components/icon/icons/RedCrossIcon.js";import{SearchIcon as G}from"./components/icon/icons/SearchIcon.js";import{SuccessIcon as P}from"./components/icon/icons/SuccessIcon.js";import{WarningIcon as D}from"./components/icon/icons/WarningIcon.js";import{MinusIcon as B}from"./components/icon/icons/MinusIcon.js";import{ThumbDownIcon as H}from"./components/icon/icons/ThumbDownIcon.js";import{ThumbUpIcon as U}from"./components/icon/icons/ThumbUpIcon.js";import{TrashCanIcon as K}from"./components/icon/icons/TrashCanIcon.js";import{PenIcon as y}from"./components/icon/icons/PenIcon.js";import{IconButton as F}from"./components/icon-button/IconButton.js";import{FieldGroup as V}from"./components/input-group/FieldGroup.js";import{InputGroup as W}from"./components/input-group/InputGroup.js";import{Label as X}from"./components/input-group/Label.js";import{SupportLabel as _}from"./components/input-group/SupportLabel.js";import{Link as x}from"./components/link/Link.js";import{NavLink as z}from"./components/link/NavLink.js";import{LinkList as Q}from"./components/link-list/LinkList.js";import{Loader as J}from"./components/loader/Loader.js";import{SkeletonAnimation as q}from"./components/loader/skeletons/SkeletonAnimation.js";import{SkeletonButton as Y}from"./components/loader/skeletons/SkeletonButton.js";import{SkeletonCheckboxGroup as Z}from"./components/loader/skeletons/SkeletonCheckboxGroup.js";import{SkeletonElement as $}from"./components/loader/skeletons/SkeletonElement.js";import{SkeletonInput as oo}from"./components/loader/skeletons/SkeletonInput.js";import{SkeletonRadioButtonGroup as so}from"./components/loader/skeletons/SkeletonRadioButtonGroup.js";import{SkeletonTable as eo,SkeletonTableHeader as no,SkeletonTableRow as ro}from"./components/loader/skeletons/SkeletonTable.js";import{SkeletonTextArea as to}from"./components/loader/skeletons/SkeletonTextArea.js";import{ErrorTag as ao,InfoTag as io,SuccessTag as mo,Tag as co,WarningTag as po}from"./components/tag/Tag.js";import{Tooltip as uo}from"./components/tooltip/Tooltip.js";import{TooltipContent as lo}from"./components/tooltip/TooltipContent.js";import{TooltipTrigger as fo}from"./components/tooltip/TooltipTrigger.js";import{PopupTip as Io}from"./components/tooltip/PopupTip.js";import{ScreenReaderOnly as jo}from"./components/ScreenReaderOnly.js";import{default as ko}from"./core/tokens.js";import{useAnimatedDetails as go}from"./hooks/useAnimatedDetails/useAnimatedDetails.js";import{useAnimatedHeight as ho}from"./hooks/useAnimatedHeight/useAnimatedHeight.js";import{useAnimatedHeightBetween as So}from"./hooks/useAnimatedHeight/useAnimatedHeightBetween.js";import{useAutoAnimatedHeight as Ao}from"./hooks/useAnimatedHeight/useAutoAnimateHeight.js";import{useBrowserPreferences as Co}from"./hooks/useBrowserPreferences/useBrowserPreferences.js";import{useIntersectionObserver as To}from"./hooks/useIntersectionObserver/useIntersectionObserver.js";import{useLocalStorage as Lo}from"./hooks/useLocalStorage/useLocalStorage.js";import{useMutationObserver as vo}from"./hooks/useMutationObserver/useMutationObserver.js";import{usePreviousValue as Eo}from"./hooks/usePreviousValue/usePreviousValue.js";import{useProgressiveImg as Ro}from"./hooks/useProgressiveImg/useProgressiveImg.js";import{useScreen as wo}from"./hooks/useScreen/useScreen.js";import{useScrollIntoView as bo}from"./hooks/useScrollIntoView/useScrollIntoView.js";import{useAriaLiveRegion as Mo}from"./hooks/useAriaLiveRegion/useAriaLiveRegion.js";import{useClickOutside as No}from"./hooks/useClickOutside/useClickOutside.js";import{useFocusOutside as Oo}from"./hooks/useFocusOutside/useFocusOutside.js";import{useElementDimensions as Go}from"./hooks/useElementDimensions/useElementDimensions.js";import{useId as Po}from"./hooks/useId/useId.js";import{useKeyListener as Do}from"./hooks/useKeyListener/useKeyListener.js";import{useListNavigation as Bo}from"./hooks/useListNavigation/useListNavigation.js";import{useSwipeGesture as Ho}from"./hooks/useSwipeGesture/useSwipeGesture.js";import{u as Uo}from"../index-DfvUcA5T.js";import{formatNumber as Ko}from"./utilities/formatters/util/formatNumber.js";import{parseNumber as yo}from"./utilities/formatters/util/parseNumber.js";import{registerWithFodselsnummerMask as Fo,registerWithKontonummerMask as Vo,registerWithKortnummerMask as Wo,registerWithMasks as Xo,registerWithTelefonnummerMask as _o}from"./utilities/formatters/util/registerWithMask.js";import{formatAvstand as xo}from"./utilities/formatters/avstand/formatAvstand.js";import{formatBytes as zo}from"./utilities/formatters/bytes/formatBytes.js";import{formatDate as Qo}from"./utilities/formatters/date/formatDate.js";import{FODSELSNUMMER_REGEX as Jo,formatFodselsnummer as qo}from"./utilities/formatters/fodselsnummer/formatFodselsnummer.js";import{ORGANISASJONSNUMMER_REGEX as Yo,formatOrganisasjonsnummer as Zo}from"./utilities/formatters/organisasjonsnummer/formatOrganisasjonsnummer.js";import{KONTONUMMER_REGEX as $o,formatKontonummer as os}from"./utilities/formatters/kontonummer/formatKontonummer.js";import{KORTNUMMER_REGEX as ss,formatKortnummer as es}from"./utilities/formatters/kortnummer/formatKortnummer.js";import{TELEFONNUMMER_REGEX as ns,formatTelefonnummer as rs}from"./utilities/formatters/telefonnummer/formatTelefonnummer.js";import{formatValuta as ts}from"./utilities/formatters/valuta/formatValuta.js";import{mergeProps as as}from"./utilities/polymorphism/mergeProps.js";import{mergeRefs as is}from"./utilities/polymorphism/mergeRefs.js";import{SlotComponent as ms}from"./utilities/polymorphism/SlotComponent.js";import{initTabListener as cs}from"./utilities/tabListener.js";import{getValuePair as ps}from"./utilities/valuePair.js";export{p as ArrowDownIcon,m as ArrowHorizontalAnimated,u as ArrowLeftIcon,l as ArrowNorthEastIcon,f as ArrowRightIcon,I as ArrowUpIcon,i as ArrowVerticalAnimated,j as CalendarIcon,o as Card,s as CardImage,k as CheckIcon,d as ChevronDownIcon,g as ChevronLeftIcon,h as ChevronRightIcon,S as ChevronUpIcon,A as CloseIcon,C as CopyIcon,T as DotsIcon,L as DragIcon,v as ErrorIcon,ao as ErrorTag,Jo as FODSELSNUMMER_REGEX,V as FieldGroup,E as GreenCheckIcon,R as HamburgerIcon,a as Icon,F as IconButton,e as InfoBlock,t as InfoCard,w as InfoIcon,io as InfoTag,W as InputGroup,$o as KONTONUMMER_REGEX,ss as KORTNUMMER_REGEX,X as Label,x as Link,b as LinkIcon,Q as LinkList,J as Loader,B as MinusIcon,n as NavCard,z as NavLink,Yo as ORGANISASJONSNUMMER_REGEX,y as PenIcon,M as PlusIcon,c as PlusRemoveAnimated,Io as PopupTip,N as QuestionIcon,O as RedCrossIcon,jo as ScreenReaderOnly,G as SearchIcon,q as SkeletonAnimation,Y as SkeletonButton,Z as SkeletonCheckboxGroup,$ as SkeletonElement,oo as SkeletonInput,so as SkeletonRadioButtonGroup,eo as SkeletonTable,no as SkeletonTableHeader,ro as SkeletonTableRow,to as SkeletonTextArea,ms as SlotComponent,P as SuccessIcon,mo as SuccessTag,_ as SupportLabel,ns as TELEFONNUMMER_REGEX,co as Tag,r as TaskCard,H as ThumbDownIcon,U as ThumbUpIcon,uo as Tooltip,lo as TooltipContent,fo as TooltipTrigger,K as TrashCanIcon,D as WarningIcon,po as WarningTag,xo as formatAvstand,zo as formatBytes,Qo as formatDate,qo as formatFodselsnummer,os as formatKontonummer,es as formatKortnummer,Ko as formatNumber,Zo as formatOrganisasjonsnummer,rs as formatTelefonnummer,ts as formatValuta,ps as getValuePair,cs as initTabListener,as as mergeProps,is as mergeRefs,yo as parseNumber,Fo as registerWithFodselsnummerMask,Vo as registerWithKontonummerMask,Wo as registerWithKortnummerMask,Xo as registerWithMasks,_o as registerWithTelefonnummerMask,ko as tokens,Uo as unicode,go as useAnimatedDetails,ho as useAnimatedHeight,So as useAnimatedHeightBetween,Mo as useAriaLiveRegion,Ao as useAutoAnimatedHeight,Co as useBrowserPreferences,No as useClickOutside,Go as useElementDimensions,Oo as useFocusOutside,Po as useId,To as useIntersectionObserver,Do as useKeyListener,Bo as useListNavigation,Lo as useLocalStorage,vo as useMutationObserver,Eo as usePreviousValue,Ro as useProgressiveImg,wo as useScreen,bo as useScrollIntoView,Ho as useSwipeGesture};
1
+ import{AccordionItem as o}from"./components/accordion/AccordionItem.js";import{Accordion as s}from"./components/accordion/Accordion.js";import{Breadcrumb as e}from"./components/breadcrumb/Breadcrumb.js";import{BreadcrumbItem as t}from"./components/breadcrumb/BreadcrumbItem.js";import{Button as r,PrimaryButton as n,SecondaryButton as a,TertiaryButton as i}from"./components/button/Button.js";import{Card as m}from"./components/card/Card.js";import{CardImage as c}from"./components/card/CardImage.js";import{InfoBlock as p,NavCard as u}from"./components/card/NavCard.js";import{TaskCard as l}from"./components/card/TaskCard.js";import{InfoCard as f}from"./components/card/InfoCard.js";import{Checkbox as d}from"./components/checkbox/Checkbox.js";import{Combobox as I,getComboboxValuePair as j}from"./components/combobox/Combobox.js";import{CookieConsent as k}from"./components/cookie-consent/CookieConsent.js";import{CookieConsentProvider as g,useCookieConsent as h}from"./components/cookie-consent/CookieConsentContext.js";import{isCorrectFormat as C,isWithinLowerBound as A,isWithinUpperBound as S}from"./components/datepicker/validation.js";import{dayMonthYearRegex as T,formatInput as b,isBlurTargetOutside as L,parseDateString as B}from"./components/datepicker/utils.js";import{DatePicker as R}from"./components/datepicker/DatePicker.js";import{Icon as M}from"./components/icon/Icon.js";import{ArrowVerticalAnimated as v}from"./components/icon/icons/animated/ArrowVerticalAnimated.js";import{ArrowHorizontalAnimated as E}from"./components/icon/icons/animated/ArrowHorizontalAnimated.js";import{PlusRemoveAnimated as w}from"./components/icon/icons/animated/PlusRemoveAnimated.js";import{ArrowDownIcon as O}from"./components/icon/icons/ArrowDownIcon.js";import{ArrowLeftIcon as N}from"./components/icon/icons/ArrowLeftIcon.js";import{ArrowNorthEastIcon as P}from"./components/icon/icons/ArrowNorthEastIcon.js";import{ArrowRightIcon as x}from"./components/icon/icons/ArrowRightIcon.js";import{ArrowUpIcon as G}from"./components/icon/icons/ArrowUpIcon.js";import{CalendarIcon as D}from"./components/icon/icons/CalendarIcon.js";import{CheckIcon as y}from"./components/icon/icons/CheckIcon.js";import{ChevronDownIcon as U}from"./components/icon/icons/ChevronDownIcon.js";import{ChevronLeftIcon as H}from"./components/icon/icons/ChevronLeftIcon.js";import{ChevronRightIcon as W}from"./components/icon/icons/ChevronRightIcon.js";import{ChevronUpIcon as F}from"./components/icon/icons/ChevronUpIcon.js";import{CloseIcon as K}from"./components/icon/icons/CloseIcon.js";import{CopyIcon as V}from"./components/icon/icons/CopyIcon.js";import{DotsIcon as X}from"./components/icon/icons/DotsIcon.js";import{DragIcon as _}from"./components/icon/icons/DragIcon.js";import{ErrorIcon as z}from"./components/icon/icons/ErrorIcon.js";import{GreenCheckIcon as Q}from"./components/icon/icons/GreenCheckIcon.js";import{HamburgerIcon as J}from"./components/icon/icons/HamburgerIcon.js";import{InfoIcon as Y}from"./components/icon/icons/InfoIcon.js";import{LinkIcon as q}from"./components/icon/icons/LinkIcon.js";import{PlusIcon as Z}from"./components/icon/icons/PlusIcon.js";import{QuestionIcon as $}from"./components/icon/icons/QuestionIcon.js";import{RedCrossIcon as oo}from"./components/icon/icons/RedCrossIcon.js";import{SearchIcon as so}from"./components/icon/icons/SearchIcon.js";import{SuccessIcon as eo}from"./components/icon/icons/SuccessIcon.js";import{WarningIcon as to}from"./components/icon/icons/WarningIcon.js";import{MinusIcon as ro}from"./components/icon/icons/MinusIcon.js";import{ThumbDownIcon as no}from"./components/icon/icons/ThumbDownIcon.js";import{ThumbUpIcon as ao}from"./components/icon/icons/ThumbUpIcon.js";import{TrashCanIcon as io}from"./components/icon/icons/TrashCanIcon.js";import{PenIcon as mo}from"./components/icon/icons/PenIcon.js";import{IconButton as co}from"./components/icon-button/IconButton.js";import{FieldGroup as po}from"./components/input-group/FieldGroup.js";import{InputGroup as uo}from"./components/input-group/InputGroup.js";import{Label as lo}from"./components/input-group/Label.js";import{SupportLabel as fo}from"./components/input-group/SupportLabel.js";import{Link as Io}from"./components/link/Link.js";import{NavLink as jo}from"./components/link/NavLink.js";import{LinkList as ko}from"./components/link-list/LinkList.js";import{List as go,OrderedList as ho,UnorderedList as Co}from"./components/list/List.js";import{CheckListItem as Ao,CrossListItem as So,ListItem as To}from"./components/list/ListItem.js";import{Loader as bo}from"./components/loader/Loader.js";import{SkeletonAnimation as Lo}from"./components/loader/skeletons/SkeletonAnimation.js";import{SkeletonButton as Bo}from"./components/loader/skeletons/SkeletonButton.js";import{SkeletonCheckboxGroup as Ro}from"./components/loader/skeletons/SkeletonCheckboxGroup.js";import{SkeletonElement as Mo}from"./components/loader/skeletons/SkeletonElement.js";import{SkeletonInput as vo}from"./components/loader/skeletons/SkeletonInput.js";import{SkeletonRadioButtonGroup as Eo}from"./components/loader/skeletons/SkeletonRadioButtonGroup.js";import{SkeletonTable as wo,SkeletonTableHeader as Oo,SkeletonTableRow as No}from"./components/loader/skeletons/SkeletonTable.js";import{SkeletonTextArea as Po}from"./components/loader/skeletons/SkeletonTextArea.js";import{Modal as xo,ModalActions as Go,ModalBody as Do,ModalCloseButton as yo,ModalContainer as Uo,ModalHeader as Ho,ModalOverlay as Wo,ModalTitle as Fo}from"./components/modal/Modal.js";import{useModal as Ko}from"./components/modal/useModal.js";import{RadioButton as Vo}from"./components/radio-button/RadioButton.js";import{RadioButtonGroup as Xo}from"./components/radio-button/RadioButtonGroup.js";import{BaseRadioButton as _o}from"./components/radio-button/BaseRadioButton.js";import{N as zo,S as Qo}from"../NativeSelect-EidDABsT.js";import{ErrorTag as Jo,InfoTag as Yo,SuccessTag as qo,Tag as Zo,WarningTag as $o}from"./components/tag/Tag.js";import{BaseTextArea as os}from"./components/text-input/BaseTextArea.js";import{BaseTextInput as ss}from"./components/text-input/BaseTextInput.js";import{TextArea as es}from"./components/text-input/TextArea.js";import{TextInput as ts}from"./components/text-input/TextInput.js";import{Tooltip as rs}from"./components/tooltip/Tooltip.js";import{TooltipContent as ns}from"./components/tooltip/TooltipContent.js";import{TooltipTrigger as as}from"./components/tooltip/TooltipTrigger.js";import{PopupTip as is}from"./components/tooltip/PopupTip.js";import{ScreenReaderOnly as ms}from"./components/ScreenReaderOnly.js";import{default as cs}from"./core/tokens.js";import{useAnimatedDetails as ps}from"./hooks/useAnimatedDetails/useAnimatedDetails.js";import{useAnimatedHeight as us}from"./hooks/useAnimatedHeight/useAnimatedHeight.js";import{useAnimatedHeightBetween as ls}from"./hooks/useAnimatedHeight/useAnimatedHeightBetween.js";import{useAutoAnimatedHeight as fs}from"./hooks/useAnimatedHeight/useAutoAnimateHeight.js";import{useBrowserPreferences as ds}from"./hooks/useBrowserPreferences/useBrowserPreferences.js";import{useIntersectionObserver as Is}from"./hooks/useIntersectionObserver/useIntersectionObserver.js";import{useLocalStorage as js}from"./hooks/useLocalStorage/useLocalStorage.js";import{useMutationObserver as ks}from"./hooks/useMutationObserver/useMutationObserver.js";import{usePreviousValue as gs}from"./hooks/usePreviousValue/usePreviousValue.js";import{useProgressiveImg as hs}from"./hooks/useProgressiveImg/useProgressiveImg.js";import{useScreen as Cs}from"./hooks/useScreen/useScreen.js";import{useScrollIntoView as As}from"./hooks/useScrollIntoView/useScrollIntoView.js";import{useAriaLiveRegion as Ss}from"./hooks/useAriaLiveRegion/useAriaLiveRegion.js";import{useClickOutside as Ts}from"./hooks/useClickOutside/useClickOutside.js";import{useFocusOutside as bs}from"./hooks/useFocusOutside/useFocusOutside.js";import{useElementDimensions as Ls}from"./hooks/useElementDimensions/useElementDimensions.js";import{useId as Bs}from"./hooks/useId/useId.js";import{useKeyListener as Rs}from"./hooks/useKeyListener/useKeyListener.js";import{useListNavigation as Ms}from"./hooks/useListNavigation/useListNavigation.js";import{useSwipeGesture as vs}from"./hooks/useSwipeGesture/useSwipeGesture.js";import{u as Es}from"../index-DfvUcA5T.js";import{formatNumber as ws}from"./utilities/formatters/util/formatNumber.js";import{parseNumber as Os}from"./utilities/formatters/util/parseNumber.js";import{registerWithFodselsnummerMask as Ns,registerWithKontonummerMask as Ps,registerWithKortnummerMask as xs,registerWithMasks as Gs,registerWithTelefonnummerMask as Ds}from"./utilities/formatters/util/registerWithMask.js";import{formatAvstand as ys}from"./utilities/formatters/avstand/formatAvstand.js";import{formatBytes as Us}from"./utilities/formatters/bytes/formatBytes.js";import{formatDate as Hs}from"./utilities/formatters/date/formatDate.js";import{FODSELSNUMMER_REGEX as Ws,formatFodselsnummer as Fs}from"./utilities/formatters/fodselsnummer/formatFodselsnummer.js";import{ORGANISASJONSNUMMER_REGEX as Ks,formatOrganisasjonsnummer as Vs}from"./utilities/formatters/organisasjonsnummer/formatOrganisasjonsnummer.js";import{KONTONUMMER_REGEX as Xs,formatKontonummer as _s}from"./utilities/formatters/kontonummer/formatKontonummer.js";import{KORTNUMMER_REGEX as zs,formatKortnummer as Qs}from"./utilities/formatters/kortnummer/formatKortnummer.js";import{TELEFONNUMMER_REGEX as Js,formatTelefonnummer as Ys}from"./utilities/formatters/telefonnummer/formatTelefonnummer.js";import{formatValuta as qs}from"./utilities/formatters/valuta/formatValuta.js";import{mergeProps as Zs}from"./utilities/polymorphism/mergeProps.js";import{mergeRefs as $s}from"./utilities/polymorphism/mergeRefs.js";import{SlotComponent as oe}from"./utilities/polymorphism/SlotComponent.js";import{initTabListener as se}from"./utilities/tabListener.js";import{getValuePair as ee}from"./utilities/valuePair.js";export{s as Accordion,o as AccordionItem,O as ArrowDownIcon,E as ArrowHorizontalAnimated,N as ArrowLeftIcon,P as ArrowNorthEastIcon,x as ArrowRightIcon,G as ArrowUpIcon,v as ArrowVerticalAnimated,_o as BaseRadioButton,os as BaseTextArea,ss as BaseTextInput,e as Breadcrumb,t as BreadcrumbItem,r as Button,D as CalendarIcon,m as Card,c as CardImage,y as CheckIcon,Ao as CheckListItem,d as Checkbox,U as ChevronDownIcon,H as ChevronLeftIcon,W as ChevronRightIcon,F as ChevronUpIcon,K as CloseIcon,I as Combobox,k as CookieConsent,g as CookieConsentProvider,V as CopyIcon,So as CrossListItem,R as DatePicker,X as DotsIcon,_ as DragIcon,z as ErrorIcon,Jo as ErrorTag,Ws as FODSELSNUMMER_REGEX,po as FieldGroup,Q as GreenCheckIcon,J as HamburgerIcon,M as Icon,co as IconButton,p as InfoBlock,f as InfoCard,Y as InfoIcon,Yo as InfoTag,uo as InputGroup,Xs as KONTONUMMER_REGEX,zs as KORTNUMMER_REGEX,lo as Label,Io as Link,q as LinkIcon,ko as LinkList,go as List,To as ListItem,bo as Loader,ro as MinusIcon,xo as Modal,Go as ModalActions,Do as ModalBody,yo as ModalCloseButton,Uo as ModalContainer,Ho as ModalHeader,Wo as ModalOverlay,Fo as ModalTitle,zo as NativeSelect,u as NavCard,jo as NavLink,Ks as ORGANISASJONSNUMMER_REGEX,ho as OrderedList,mo as PenIcon,Z as PlusIcon,w as PlusRemoveAnimated,is as PopupTip,n as PrimaryButton,$ as QuestionIcon,Vo as RadioButton,Xo as RadioButtonGroup,oo as RedCrossIcon,ms as ScreenReaderOnly,so as SearchIcon,a as SecondaryButton,Qo as Select,Lo as SkeletonAnimation,Bo as SkeletonButton,Ro as SkeletonCheckboxGroup,Mo as SkeletonElement,vo as SkeletonInput,Eo as SkeletonRadioButtonGroup,wo as SkeletonTable,Oo as SkeletonTableHeader,No as SkeletonTableRow,Po as SkeletonTextArea,oe as SlotComponent,eo as SuccessIcon,qo as SuccessTag,fo as SupportLabel,Js as TELEFONNUMMER_REGEX,Zo as Tag,l as TaskCard,i as TertiaryButton,es as TextArea,ts as TextInput,no as ThumbDownIcon,ao as ThumbUpIcon,rs as Tooltip,ns as TooltipContent,as as TooltipTrigger,io as TrashCanIcon,Co as UnorderedList,to as WarningIcon,$o as WarningTag,T as dayMonthYearRegex,ys as formatAvstand,Us as formatBytes,Hs as formatDate,Fs as formatFodselsnummer,b as formatInput,_s as formatKontonummer,Qs as formatKortnummer,ws as formatNumber,Vs as formatOrganisasjonsnummer,Ys as formatTelefonnummer,qs as formatValuta,j as getComboboxValuePair,ee as getValuePair,se as initTabListener,L as isBlurTargetOutside,C as isCorrectFormat,A as isWithinLowerBound,S as isWithinUpperBound,Zs as mergeProps,$s as mergeRefs,B as parseDateString,Os as parseNumber,Ns as registerWithFodselsnummerMask,Ps as registerWithKontonummerMask,xs as registerWithKortnummerMask,Gs as registerWithMasks,Ds as registerWithTelefonnummerMask,cs as tokens,Es as unicode,ps as useAnimatedDetails,us as useAnimatedHeight,ls as useAnimatedHeightBetween,Ss as useAriaLiveRegion,fs as useAutoAnimatedHeight,ds as useBrowserPreferences,Ts as useClickOutside,h as useCookieConsent,Ls as useElementDimensions,bs as useFocusOutside,Bs as useId,Is as useIntersectionObserver,Rs as useKeyListener,Ms as useListNavigation,js as useLocalStorage,Ko as useModal,ks as useMutationObserver,gs as usePreviousValue,hs as useProgressiveImg,Cs as useScreen,As as useScrollIntoView,vs as useSwipeGesture};
2
2
  //# sourceMappingURL=index.js.map
@@ -11,5 +11,5 @@ export interface UseAriaLiveRegionOptions {
11
11
  * @returns
12
12
  */
13
13
  export declare function useAriaLiveRegion(watch: unknown | unknown[], options?: UseAriaLiveRegionOptions): {
14
- "aria-live": "off" | "polite" | "assertive" | undefined;
14
+ "aria-live": "polite" | "assertive" | "off" | undefined;
15
15
  };