@fremtind/jokul 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. package/build/build-stats.html +1 -1
  2. package/build/cjs/components/card/Card.js +1 -1
  3. package/build/cjs/components/card/Card.js.map +1 -1
  4. package/build/cjs/components/card/CardImage.js +1 -1
  5. package/build/cjs/components/card/CardImage.js.map +1 -1
  6. package/build/cjs/components/card/index.js +1 -1
  7. package/build/cjs/components/icon/Icon.js.map +1 -1
  8. package/build/cjs/components/index.js +1 -1
  9. package/build/cjs/components/link/Link.js.map +1 -1
  10. package/build/cjs/components/link/NavLink.js.map +1 -1
  11. package/build/cjs/components/link-list/LinkList.js.map +1 -1
  12. package/build/cjs/core/index.js +1 -1
  13. package/build/cjs/core/tokens.js +1 -1
  14. package/build/cjs/core/tokens.js.map +1 -1
  15. package/build/cjs/hooks/useAnimatedHeight/useAnimatedHeight.js +1 -1
  16. package/build/cjs/hooks/useAnimatedHeight/useAnimatedHeight.js.map +1 -1
  17. package/build/cjs/hooks/useAnimatedHeight/useAnimatedHeightBetween.js +1 -1
  18. package/build/cjs/hooks/useAnimatedHeight/useAnimatedHeightBetween.js.map +1 -1
  19. package/build/cjs/hooks/useAnimatedHeight/useAutoAnimateHeight.js +1 -1
  20. package/build/cjs/hooks/useAnimatedHeight/useAutoAnimateHeight.js.map +1 -1
  21. package/build/cjs/hooks/useScreen/useScreen.js +1 -1
  22. package/build/cjs/hooks/useScreen/useScreen.js.map +1 -1
  23. package/build/cjs/index.js +1 -1
  24. package/build/cjs/utilities/constants/index.js +2 -0
  25. package/build/cjs/utilities/constants/unicode.js +2 -0
  26. package/build/cjs/utilities/constants/unicode.js.map +1 -0
  27. package/build/cjs/utilities/formatters/avstand/formatAvstand.js +2 -0
  28. package/build/cjs/utilities/formatters/avstand/formatAvstand.js.map +1 -0
  29. package/build/cjs/utilities/formatters/bytes/formatBytes.js +2 -0
  30. package/build/cjs/utilities/formatters/bytes/formatBytes.js.map +1 -0
  31. package/build/cjs/utilities/formatters/date/formatDate.js +2 -0
  32. package/build/cjs/utilities/formatters/date/formatDate.js.map +1 -0
  33. package/build/cjs/utilities/formatters/fodselsnummer/formatFodselsnummer.js +2 -0
  34. package/build/cjs/utilities/formatters/fodselsnummer/formatFodselsnummer.js.map +1 -0
  35. package/build/cjs/utilities/formatters/index.js +2 -0
  36. package/build/cjs/utilities/formatters/kontonummer/formatKontonummer.js +2 -0
  37. package/build/cjs/utilities/formatters/kontonummer/formatKontonummer.js.map +1 -0
  38. package/build/cjs/utilities/formatters/kortnummer/formatKortnummer.js +2 -0
  39. package/build/cjs/utilities/formatters/kortnummer/formatKortnummer.js.map +1 -0
  40. package/build/cjs/utilities/formatters/organisasjonsnummer/formatOrganisasjonsnummer.js +2 -0
  41. package/build/cjs/utilities/formatters/organisasjonsnummer/formatOrganisasjonsnummer.js.map +1 -0
  42. package/build/cjs/utilities/formatters/telefonnummer/formatTelefonnummer.js +2 -0
  43. package/build/cjs/utilities/formatters/telefonnummer/formatTelefonnummer.js.map +1 -0
  44. package/build/cjs/utilities/formatters/util/formatNumber.js +2 -0
  45. package/build/cjs/utilities/formatters/util/formatNumber.js.map +1 -0
  46. package/build/cjs/utilities/formatters/util/parseNumber.js +2 -0
  47. package/build/cjs/utilities/formatters/util/parseNumber.js.map +1 -0
  48. package/build/cjs/utilities/formatters/util/registerWithMask.js +2 -0
  49. package/build/cjs/utilities/formatters/util/registerWithMask.js.map +1 -0
  50. package/build/cjs/utilities/formatters/valuta/formatValuta.js +2 -0
  51. package/build/cjs/utilities/formatters/valuta/formatValuta.js.map +1 -0
  52. package/build/cjs/utilities/index.js +2 -0
  53. package/build/cjs/utilities/index.js.map +1 -0
  54. package/build/cjs/utilities/polymorphism/SlotComponent.js +2 -0
  55. package/build/cjs/utilities/polymorphism/SlotComponent.js.map +1 -0
  56. package/build/cjs/utilities/polymorphism/index.js +2 -0
  57. package/build/cjs/utilities/polymorphism/index.js.map +1 -0
  58. package/build/cjs/utilities/polymorphism/mergeProps.js.map +1 -0
  59. package/build/cjs/utilities/polymorphism/mergeRefs.js.map +1 -0
  60. package/build/cjs/utilities/tabListener.js.map +1 -0
  61. package/build/cjs/{core/utils/getValuePair.js → utilities/valuePair.js} +1 -1
  62. package/build/cjs/utilities/valuePair.js.map +1 -0
  63. package/build/components/card/Card.d.ts +1 -1
  64. package/build/components/card/CardImage.d.ts +1 -1
  65. package/build/components/icon/Icon.d.ts +1 -1
  66. package/build/components/index.d.ts +0 -1
  67. package/build/components/link/Link.d.ts +1 -1
  68. package/build/components/link/NavLink.d.ts +1 -1
  69. package/build/components/link-list/LinkList.d.ts +1 -1
  70. package/build/core/index.d.ts +1 -6
  71. package/build/core/tokens.d.ts +22 -1
  72. package/build/core/types.d.ts +4 -5
  73. package/build/es/components/card/Card.js +1 -1
  74. package/build/es/components/card/Card.js.map +1 -1
  75. package/build/es/components/card/CardImage.js +1 -1
  76. package/build/es/components/card/CardImage.js.map +1 -1
  77. package/build/es/components/card/index.js +1 -1
  78. package/build/es/components/icon/Icon.js.map +1 -1
  79. package/build/es/components/index.js +1 -1
  80. package/build/es/components/link/Link.js.map +1 -1
  81. package/build/es/components/link/NavLink.js.map +1 -1
  82. package/build/es/components/link-list/LinkList.js.map +1 -1
  83. package/build/es/core/index.js +1 -1
  84. package/build/es/core/tokens.js +1 -1
  85. package/build/es/core/tokens.js.map +1 -1
  86. package/build/es/hooks/useAnimatedHeight/useAnimatedHeight.js +1 -1
  87. package/build/es/hooks/useAnimatedHeight/useAnimatedHeight.js.map +1 -1
  88. package/build/es/hooks/useAnimatedHeight/useAnimatedHeightBetween.js +1 -1
  89. package/build/es/hooks/useAnimatedHeight/useAnimatedHeightBetween.js.map +1 -1
  90. package/build/es/hooks/useAnimatedHeight/useAutoAnimateHeight.js +1 -1
  91. package/build/es/hooks/useAnimatedHeight/useAutoAnimateHeight.js.map +1 -1
  92. package/build/es/hooks/useScreen/useScreen.js +1 -1
  93. package/build/es/hooks/useScreen/useScreen.js.map +1 -1
  94. package/build/es/index.js +1 -1
  95. package/build/es/utilities/constants/index.js +2 -0
  96. package/build/es/utilities/constants/index.js.map +1 -0
  97. package/build/es/utilities/constants/unicode.js +2 -0
  98. package/build/es/utilities/constants/unicode.js.map +1 -0
  99. package/build/es/utilities/formatters/avstand/formatAvstand.js +2 -0
  100. package/build/es/utilities/formatters/avstand/formatAvstand.js.map +1 -0
  101. package/build/es/utilities/formatters/bytes/formatBytes.js +2 -0
  102. package/build/es/utilities/formatters/bytes/formatBytes.js.map +1 -0
  103. package/build/es/utilities/formatters/date/formatDate.js +2 -0
  104. package/build/es/utilities/formatters/date/formatDate.js.map +1 -0
  105. package/build/es/utilities/formatters/fodselsnummer/formatFodselsnummer.js +2 -0
  106. package/build/es/utilities/formatters/fodselsnummer/formatFodselsnummer.js.map +1 -0
  107. package/build/es/utilities/formatters/index.js +2 -0
  108. package/build/es/utilities/formatters/index.js.map +1 -0
  109. package/build/es/utilities/formatters/kontonummer/formatKontonummer.js +2 -0
  110. package/build/es/utilities/formatters/kontonummer/formatKontonummer.js.map +1 -0
  111. package/build/es/utilities/formatters/kortnummer/formatKortnummer.js +2 -0
  112. package/build/es/utilities/formatters/kortnummer/formatKortnummer.js.map +1 -0
  113. package/build/es/utilities/formatters/organisasjonsnummer/formatOrganisasjonsnummer.js +2 -0
  114. package/build/es/utilities/formatters/organisasjonsnummer/formatOrganisasjonsnummer.js.map +1 -0
  115. package/build/es/utilities/formatters/telefonnummer/formatTelefonnummer.js +2 -0
  116. package/build/es/utilities/formatters/telefonnummer/formatTelefonnummer.js.map +1 -0
  117. package/build/es/utilities/formatters/util/formatNumber.js +2 -0
  118. package/build/es/utilities/formatters/util/formatNumber.js.map +1 -0
  119. package/build/es/utilities/formatters/util/parseNumber.js +2 -0
  120. package/build/es/utilities/formatters/util/parseNumber.js.map +1 -0
  121. package/build/es/utilities/formatters/util/registerWithMask.js +2 -0
  122. package/build/es/utilities/formatters/util/registerWithMask.js.map +1 -0
  123. package/build/es/utilities/formatters/valuta/formatValuta.js +2 -0
  124. package/build/es/utilities/formatters/valuta/formatValuta.js.map +1 -0
  125. package/build/es/utilities/index.js +2 -0
  126. package/build/es/utilities/index.js.map +1 -0
  127. package/build/es/utilities/polymorphism/SlotComponent.js +2 -0
  128. package/build/es/utilities/polymorphism/SlotComponent.js.map +1 -0
  129. package/build/es/utilities/polymorphism/index.js +2 -0
  130. package/build/es/utilities/polymorphism/index.js.map +1 -0
  131. package/build/es/utilities/polymorphism/mergeProps.js.map +1 -0
  132. package/build/es/utilities/polymorphism/mergeRefs.js.map +1 -0
  133. package/build/es/utilities/tabListener.js.map +1 -0
  134. package/build/es/{core/utils/getValuePair.js → utilities/valuePair.js} +1 -1
  135. package/build/es/utilities/valuePair.js.map +1 -0
  136. package/build/index-DfvUcA5T.js +2 -0
  137. package/build/index-DfvUcA5T.js.map +1 -0
  138. package/build/index-hKyqa1PH.cjs +2 -0
  139. package/build/index-hKyqa1PH.cjs.map +1 -0
  140. package/build/index.d.ts +1 -0
  141. package/build/utilities/constants/index.d.ts +2 -0
  142. package/build/utilities/constants/unicode.d.ts +13 -0
  143. package/build/utilities/formatters/avstand/formatAvstand.d.ts +23 -0
  144. package/build/utilities/formatters/bytes/formatBytes.d.ts +8 -0
  145. package/build/utilities/formatters/date/formatDate.d.ts +15 -0
  146. package/build/utilities/formatters/fodselsnummer/formatFodselsnummer.d.ts +15 -0
  147. package/build/utilities/formatters/index.d.ts +14 -0
  148. package/build/utilities/formatters/kontonummer/formatKontonummer.d.ts +16 -0
  149. package/build/utilities/formatters/kortnummer/formatKortnummer.d.ts +15 -0
  150. package/build/utilities/formatters/organisasjonsnummer/formatOrganisasjonsnummer.d.ts +15 -0
  151. package/build/utilities/formatters/telefonnummer/formatTelefonnummer.d.ts +18 -0
  152. package/build/utilities/formatters/util/formatNumber.d.ts +14 -0
  153. package/build/utilities/formatters/util/parseNumber.d.ts +6 -0
  154. package/build/utilities/formatters/util/registerWithMask.d.ts +42 -0
  155. package/build/utilities/formatters/valuta/formatValuta.d.ts +18 -0
  156. package/build/utilities/index.d.ts +5 -0
  157. package/build/utilities/polymorphism/index.d.ts +5 -0
  158. package/build/utilities/valuePair.d.ts +6 -0
  159. package/package.json +12 -7
  160. package/src/components/card/styles/_index.scss +1 -0
  161. package/src/components/card/styles/_info-card.scss +40 -0
  162. package/src/components/card/styles/_nav-card.scss +113 -0
  163. package/src/components/card/styles/_task-card.scss +55 -0
  164. package/src/components/card/styles/card.css +332 -0
  165. package/src/components/card/styles/card.min.css +1 -0
  166. package/src/components/card/styles/card.scss +99 -0
  167. package/src/components/icon/styles/icon.css +1 -1
  168. package/src/components/icon-button/styles/_index.scss +1 -0
  169. package/src/components/icon-button/styles/icon-button.css +98 -0
  170. package/src/components/icon-button/styles/icon-button.min.css +1 -0
  171. package/src/components/icon-button/styles/icon-button.scss +59 -0
  172. package/src/components/image/styles/_index.scss +1 -0
  173. package/src/components/image/styles/image.css +30 -0
  174. package/src/components/image/styles/image.min.css +1 -0
  175. package/src/components/image/styles/image.scss +35 -0
  176. package/src/components/link/styles/link.css +1 -1
  177. package/src/components/link-list/styles/link-list.css +1 -1
  178. package/src/components/loader/styles/loader.css +7 -7
  179. package/src/components/loader/styles/loader.min.css +1 -1
  180. package/src/components/loader/styles/skeleton-loader.css +6 -6
  181. package/src/components/loader/styles/skeleton-loader.min.css +1 -1
  182. package/src/components/tag/styles/_index.scss +1 -0
  183. package/src/components/tag/styles/tag.css +71 -0
  184. package/src/components/tag/styles/tag.min.css +1 -0
  185. package/src/components/tag/styles/tag.scss +73 -0
  186. package/src/core/jkl/_legacy-tokens.scss +1 -1
  187. package/src/core/jkl/_tokens.scss +14 -1
  188. package/src/core/styles/_color-tokens.scss +1 -1
  189. package/src/core/styles/_legacy-tokens.scss +1 -1
  190. package/src/core/styles/_tokens.scss +1 -1
  191. package/src/core/styles/core.css +4 -4
  192. package/src/core/styles/vind.css +1 -1
  193. package/src/core/tokens.less +14 -1
  194. package/build/CardImage-DJa-zPsv.js +0 -2
  195. package/build/CardImage-DJa-zPsv.js.map +0 -1
  196. package/build/CardImage-DsKh2g4S.cjs +0 -2
  197. package/build/CardImage-DsKh2g4S.cjs.map +0 -1
  198. package/build/cjs/components/SlotComponent.js +0 -2
  199. package/build/cjs/components/SlotComponent.js.map +0 -1
  200. package/build/cjs/core/utils/breakpoints.js +0 -2
  201. package/build/cjs/core/utils/breakpoints.js.map +0 -1
  202. package/build/cjs/core/utils/density.js +0 -2
  203. package/build/cjs/core/utils/density.js.map +0 -1
  204. package/build/cjs/core/utils/getValuePair.js.map +0 -1
  205. package/build/cjs/core/utils/index.js +0 -2
  206. package/build/cjs/core/utils/mergeProps.js.map +0 -1
  207. package/build/cjs/core/utils/mergeRefs.js.map +0 -1
  208. package/build/cjs/core/utils/motion.js +0 -2
  209. package/build/cjs/core/utils/motion.js.map +0 -1
  210. package/build/cjs/core/utils/tabListener.js.map +0 -1
  211. package/build/core/utils/breakpoints.d.ts +0 -6
  212. package/build/core/utils/density.d.ts +0 -1
  213. package/build/core/utils/getValuePair.d.ts +0 -2
  214. package/build/core/utils/index.d.ts +0 -8
  215. package/build/core/utils/motion.d.ts +0 -16
  216. package/build/es/components/SlotComponent.js +0 -2
  217. package/build/es/components/SlotComponent.js.map +0 -1
  218. package/build/es/core/utils/breakpoints.js +0 -2
  219. package/build/es/core/utils/breakpoints.js.map +0 -1
  220. package/build/es/core/utils/density.js +0 -2
  221. package/build/es/core/utils/density.js.map +0 -1
  222. package/build/es/core/utils/getValuePair.js.map +0 -1
  223. package/build/es/core/utils/index.js +0 -2
  224. package/build/es/core/utils/mergeProps.js.map +0 -1
  225. package/build/es/core/utils/mergeRefs.js.map +0 -1
  226. package/build/es/core/utils/motion.js +0 -2
  227. package/build/es/core/utils/motion.js.map +0 -1
  228. package/build/es/core/utils/tabListener.js.map +0 -1
  229. /package/build/cjs/{core/utils → utilities/constants}/index.js.map +0 -0
  230. /package/build/{es/core/utils → cjs/utilities/formatters}/index.js.map +0 -0
  231. /package/build/cjs/{core → utilities/polymorphism}/as-child.js +0 -0
  232. /package/build/cjs/{core → utilities/polymorphism}/as-child.js.map +0 -0
  233. /package/build/cjs/{core/utils → utilities/polymorphism}/mergeProps.js +0 -0
  234. /package/build/cjs/{core/utils → utilities/polymorphism}/mergeRefs.js +0 -0
  235. /package/build/cjs/{core → utilities/polymorphism}/polymorphism.js +0 -0
  236. /package/build/cjs/{core → utilities/polymorphism}/polymorphism.js.map +0 -0
  237. /package/build/cjs/{core/utils → utilities}/tabListener.js +0 -0
  238. /package/build/es/{core → utilities/polymorphism}/as-child.js +0 -0
  239. /package/build/es/{core → utilities/polymorphism}/as-child.js.map +0 -0
  240. /package/build/es/{core/utils → utilities/polymorphism}/mergeProps.js +0 -0
  241. /package/build/es/{core/utils → utilities/polymorphism}/mergeRefs.js +0 -0
  242. /package/build/es/{core → utilities/polymorphism}/polymorphism.js +0 -0
  243. /package/build/es/{core → utilities/polymorphism}/polymorphism.js.map +0 -0
  244. /package/build/es/{core/utils → utilities}/tabListener.js +0 -0
  245. /package/build/{components → utilities/polymorphism}/SlotComponent.d.ts +0 -0
  246. /package/build/{core → utilities/polymorphism}/as-child.d.ts +0 -0
  247. /package/build/{core/utils → utilities/polymorphism}/mergeProps.d.ts +0 -0
  248. /package/build/{core/utils → utilities/polymorphism}/mergeRefs.d.ts +0 -0
  249. /package/build/{core → utilities/polymorphism}/polymorphism.d.ts +0 -0
  250. /package/build/{core/utils → utilities}/tabListener.d.ts +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"tabListener.js","sources":["../../../../src/core/utils/tabListener.ts"],"sourcesContent":["let mousenavigation = false;\nlet touchnavigation = false;\nlet touchEventFired = false;\n\nconst listeners = {\n mousedown: handleMouseDown as EventListener,\n keydown: handleKeydown as EventListener,\n touchstart: handleTouchStart as EventListener,\n};\n\nfunction removeAllListeners() {\n (Object.keys(listeners) as Array<keyof typeof listeners>).forEach((listenerType) => {\n document.removeEventListener(listenerType, listeners[listenerType]);\n });\n}\n\nfunction addListener(listenerType: keyof typeof listeners) {\n document.addEventListener(listenerType, listeners[listenerType]);\n}\n\nfunction handleMouseDown() {\n if (!mousenavigation && !touchEventFired) {\n mousenavigation = true;\n touchnavigation = false;\n const htmlElement = document.querySelector(\"html\");\n htmlElement?.setAttribute(\"data-mousenavigation\", \"true\");\n htmlElement?.removeAttribute(\"data-touchnavigation\");\n\n // Reset listeners\n removeAllListeners();\n addListener(\"touchstart\");\n addListener(\"keydown\");\n }\n}\n\nfunction handleKeydown(event: KeyboardEvent) {\n if (event.key === \"Tab\") {\n const htmlElement = document.querySelector(\"html\");\n removeAllListeners();\n htmlElement?.removeAttribute(\"data-mousenavigation\");\n htmlElement?.removeAttribute(\"data-touchnavigation\");\n mousenavigation = false;\n touchnavigation = false;\n\n // Reset listeners\n addListener(\"touchstart\");\n addListener(\"mousedown\");\n }\n}\n\nfunction handleTouchStart() {\n if (!touchnavigation) {\n mousenavigation = false;\n touchnavigation = true;\n const htmlElement = document.querySelector(\"html\");\n htmlElement?.setAttribute(\"data-touchnavigation\", \"true\");\n htmlElement?.removeAttribute(\"data-mousenavigation\");\n\n // Reset listeners\n removeAllListeners();\n addListener(\"touchstart\");\n addListener(\"keydown\");\n addListener(\"mousedown\");\n }\n\n // Most touch devices fire both touch and mouse events on touch (in that order)\n // see https://w3c.github.io/touch-events/#mouse-events\n // Set a check variable to avoid resetting the data-attribute:\n touchEventFired = true;\n setTimeout(() => {\n touchEventFired = false;\n }, 150); // Yes, it can take this long between the events\n}\n\nexport function initTabListener(): void {\n if (typeof document !== \"undefined\") {\n addListener(\"touchstart\");\n addListener(\"mousedown\");\n }\n}\n"],"names":["mousenavigation","touchnavigation","touchEventFired","listeners","mousedown","htmlElement","document","querySelector","setAttribute","removeAttribute","removeAllListeners","addListener","keydown","event","key","touchstart","setTimeout","Object","keys","forEach","listenerType","removeEventListener","addEventListener"],"mappings":"gFAAA,IAAIA,GAAkB,EAClBC,GAAkB,EAClBC,GAAkB,EAEtB,MAAMC,EAAY,CACdC,UAeJ,WACQ,IAACJ,IAAoBE,EAAiB,CACpBF,GAAA,EACAC,GAAA,EACZ,MAAAI,EAAcC,SAASC,cAAc,QAC9B,MAAAF,GAAAA,EAAAG,aAAa,uBAAwB,QAClD,MAAAH,GAAAA,EAAaI,gBAAgB,wBAGVC,IACnBC,EAAY,cACZA,EAAY,UAChB,CACJ,EA3BIC,QA6BJ,SAAuBC,GACf,GAAc,QAAdA,EAAMC,IAAe,CACf,MAAAT,EAAcC,SAASC,cAAc,QACxBG,IACnB,MAAAL,GAAAA,EAAaI,gBAAgB,wBAC7B,MAAAJ,GAAAA,EAAaI,gBAAgB,wBACXT,GAAA,EACAC,GAAA,EAGlBU,EAAY,cACZA,EAAY,YAChB,CACJ,EAzCII,WA2CJ,WACI,IAAKd,EAAiB,CACAD,GAAA,EACAC,GAAA,EACZ,MAAAI,EAAcC,SAASC,cAAc,QAC9B,MAAAF,GAAAA,EAAAG,aAAa,uBAAwB,QAClD,MAAAH,GAAAA,EAAaI,gBAAgB,wBAGVC,IACnBC,EAAY,cACZA,EAAY,WACZA,EAAY,YAChB,CAKkBT,GAAA,EAClBc,YAAW,KACWd,GAAA,CAAA,GACnB,IACP,GA9DA,SAASQ,IACJO,OAAOC,KAAKf,GAA6CgB,SAASC,IAC/Dd,SAASe,oBAAoBD,EAAcjB,EAAUiB,GAAa,GAE1E,CAEA,SAAST,EAAYS,GACjBd,SAASgB,iBAAiBF,EAAcjB,EAAUiB,GACtD,yBAwDO,kBACQd,SAAa,MACpBK,EAAY,cACZA,EAAY,aAEpB"}
@@ -1,6 +0,0 @@
1
- export type Breakpoint = keyof typeof breakpoints;
2
- export declare const breakpoints: {
3
- medium: number;
4
- large: number;
5
- xl: number;
6
- };
@@ -1 +0,0 @@
1
- export type Density = "comfortable" | "compact";
@@ -1,2 +0,0 @@
1
- import { ValuePair } from '../index';
2
- export declare function getValuePair(item: string | ValuePair): ValuePair;
@@ -1,8 +0,0 @@
1
- export { initTabListener } from './tabListener';
2
- export { getValuePair } from './getValuePair';
3
- export { breakpoints } from './breakpoints';
4
- export type { Density } from './density';
5
- export type { Timing, Easing } from './motion';
6
- export { timings, easings } from './motion';
7
- export { type PossibleRef, mergeRefs } from './mergeRefs';
8
- export { mergeProps } from './mergeProps';
@@ -1,16 +0,0 @@
1
- export type Easing = keyof typeof easings;
2
- export declare const easings: Readonly<{
3
- standard: "ease";
4
- entrance: "ease-out";
5
- exit: "ease-in";
6
- easeInBounceOut: "cubic-bezier(0, 0, 0.375, 1.17)";
7
- focus: "cubic-bezier(0.6, 0.2, 0.35, 1)";
8
- }>;
9
- export type Timing = keyof typeof timings;
10
- export declare const timings: Readonly<{
11
- energetic: "75ms";
12
- snappy: "100ms";
13
- productive: "150ms";
14
- expressive: "250ms";
15
- lazy: "400ms";
16
- }>;
@@ -1,2 +0,0 @@
1
- import e from"react";import{mergeRefs as r}from"../core/utils/mergeRefs.js";import{mergeProps as o}from"../core/utils/mergeProps.js";const n=e.forwardRef((function({children:n,...t},m){if(e.isValidElement(n))return e.cloneElement(n,{...o(t,n.props),ref:r(m,n.ref)});if(e.Children.count(n)>1)throw new Error("Du kan kun bruke ett enkelt React-element som children i en komponent med asChild");return null}));export{n as SlotComponent};
2
- //# sourceMappingURL=SlotComponent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SlotComponent.js","sources":["../../../src/components/SlotComponent.tsx"],"sourcesContent":["import React from \"react\";\nimport { mergeRefs, mergeProps } from \"../core/utils\";\n\nexport type SlotComponentProps = React.HTMLAttributes<HTMLElement> & {\n children: React.ReactElement | false | null;\n};\n\nexport const SlotComponent = React.forwardRef<HTMLElement, SlotComponentProps>(function SlotComponent(\n { children, ...slotProps },\n forwardedRef,\n) {\n if (React.isValidElement(children)) {\n return React.cloneElement(children as React.ReactElement, {\n ...mergeProps(slotProps, children.props),\n ref: mergeRefs(forwardedRef, (children as any).ref),\n });\n }\n\n if (React.Children.count(children) > 1) {\n throw new Error(\"Du kan kun bruke ett enkelt React-element som children i en komponent med asChild\");\n }\n\n return null;\n});\n"],"names":["SlotComponent","React","forwardRef","children","slotProps","forwardedRef","isValidElement","cloneElement","mergeProps","props","ref","mergeRefs","Children","count","Error"],"mappings":"qIAOa,MAAAA,EAAgBC,EAAMC,YAA4C,UACzEC,SAAAA,KAAaC,GACfC,GAEIJ,GAAAA,EAAMK,eAAeH,GACdF,OAAAA,EAAMM,aAAaJ,EAAgC,IACnDK,EAAWJ,EAAWD,EAASM,OAClCC,IAAKC,EAAUN,EAAeF,EAAiBO,OAIvD,GAAIT,EAAMW,SAASC,MAAMV,GAAY,EAC3B,MAAA,IAAIW,MAAM,qFAGb,OAAA,IACX"}
@@ -1,2 +0,0 @@
1
- const e={medium:680,large:1200,xl:1600};export{e as breakpoints};
2
- //# sourceMappingURL=breakpoints.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"breakpoints.js","sources":["../../../../src/core/utils/breakpoints.ts"],"sourcesContent":["export type Breakpoint = keyof typeof breakpoints;\n\nexport const breakpoints = {\n medium: 680,\n large: 1200,\n xl: 1600,\n};\n"],"names":["breakpoints","medium","large","xl"],"mappings":"AAEO,MAAMA,EAAc,CACvBC,OAAQ,IACRC,MAAO,KACPC,GAAI"}
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=density.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"density.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"getValuePair.js","sources":["../../../../src/core/utils/getValuePair.ts"],"sourcesContent":["import { ValuePair } from \"../index\";\n\nexport function getValuePair(item: string | ValuePair): ValuePair {\n return typeof item === \"string\" ? { value: item, label: item } : item;\n}\n"],"names":["getValuePair","item","value","label"],"mappings":"AAEO,SAASA,EAAaC,GAClB,MAAgB,iBAATA,EAAoB,CAAEC,MAAOD,EAAME,MAAOF,GAASA,CACrE"}
@@ -1,2 +0,0 @@
1
- import{initTabListener as s}from"./tabListener.js";import{getValuePair as e}from"./getValuePair.js";import{breakpoints as r}from"./breakpoints.js";import{easings as a,timings as i}from"./motion.js";import{mergeRefs as t}from"./mergeRefs.js";import{mergeProps as m}from"./mergeProps.js";export{r as breakpoints,a as easings,e as getValuePair,s as initTabListener,m as mergeProps,t as mergeRefs,i as timings};
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mergeProps.js","sources":["../../../../src/core/utils/mergeProps.ts"],"sourcesContent":["export function mergeProps(baseProps: Record<string, any>, addedProps: Record<string, any>) {\n const overrides = { ...addedProps };\n\n for (const prop in addedProps) {\n const basePropValue = baseProps[prop];\n const addedPropValue = addedProps[prop];\n\n if (/^on[A-Z]/.test(prop)) {\n // Propen er en event handler. Slå sammen hvis\n // den finnes på både base og added\n if (basePropValue && addedPropValue) {\n overrides[prop] = (...args: unknown[]) => {\n addedPropValue(...args);\n basePropValue(...args);\n };\n } else if (basePropValue) {\n overrides[prop] = basePropValue;\n }\n }\n\n if (prop === \"style\") {\n overrides[prop] = { ...basePropValue, ...addedPropValue };\n }\n\n if (prop === \"className\") {\n overrides[prop] = [basePropValue, addedPropValue].filter(Boolean).join(\" \");\n }\n }\n\n return { ...baseProps, ...overrides };\n}\n"],"names":["mergeProps","baseProps","addedProps","overrides","prop","basePropValue","addedPropValue","test","args","filter","Boolean","join"],"mappings":"AAAgB,SAAAA,EAAWC,EAAgCC,GACjDC,MAAAA,EAAY,IAAKD,GAEvB,IAAA,MAAWE,KAAQF,EAAY,CACrB,MAAAG,EAAgBJ,EAAUG,GAC1BE,EAAiBJ,EAAWE,GAE9B,WAAWG,KAAKH,KAGZC,GAAiBC,EACPH,EAAAC,GAAQ,IAAII,KAClBF,KAAkBE,GAClBH,KAAiBG,EAAI,EAElBH,IACPF,EAAUC,GAAQC,IAIb,UAATD,IACAD,EAAUC,GAAQ,IAAKC,KAAkBC,IAGhC,cAATF,IACUD,EAAAC,GAAQ,CAACC,EAAeC,GAAgBG,OAAOC,SAASC,KAAK,KAE/E,CAEA,MAAO,IAAKV,KAAcE,EAC9B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mergeRefs.js","sources":["../../../../src/core/utils/mergeRefs.ts"],"sourcesContent":["import React from \"react\";\n\nexport type PossibleRef<T> = React.LegacyRef<T> | undefined;\n\nexport function mergeRefs<T>(...possibleRefs: PossibleRef<T>[]): React.RefCallback<T> {\n return (instance) =>\n possibleRefs.forEach((ref) => {\n if (typeof ref === \"function\") {\n ref(instance);\n } else if (ref !== null && ref !== undefined) {\n (ref as React.MutableRefObject<T | null>).current = instance;\n }\n });\n}\n"],"names":["mergeRefs","possibleRefs","instance","forEach","ref","current"],"mappings":"AAIO,SAASA,KAAgBC,GAC5B,OAAQC,GACJD,EAAaE,SAASC,IACC,mBAARA,EACPA,EAAIF,GACW,MAARE,IACNA,EAAyCC,QAAUH,EAAAA,GAGpE"}
@@ -1,2 +0,0 @@
1
- const e=Object.freeze({standard:"ease",entrance:"ease-out",exit:"ease-in",easeInBounceOut:"cubic-bezier(0, 0, 0.375, 1.17)",focus:"cubic-bezier(0.6, 0.2, 0.35, 1)"}),s=Object.freeze({energetic:"75ms",snappy:"100ms",productive:"150ms",expressive:"250ms",lazy:"400ms"});export{e as easings,s as timings};
2
- //# sourceMappingURL=motion.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"motion.js","sources":["../../../../src/core/utils/motion.ts"],"sourcesContent":["export type Easing = keyof typeof easings;\n\nexport const easings = Object.freeze({\n standard: \"ease\",\n entrance: \"ease-out\",\n exit: \"ease-in\",\n easeInBounceOut: \"cubic-bezier(0, 0, 0.375, 1.17)\",\n focus: \"cubic-bezier(0.6, 0.2, 0.35, 1)\",\n});\n\nexport type Timing = keyof typeof timings;\n\nexport const timings = Object.freeze({\n energetic: \"75ms\",\n snappy: \"100ms\",\n productive: \"150ms\",\n expressive: \"250ms\",\n lazy: \"400ms\",\n});\n"],"names":["easings","Object","freeze","standard","entrance","exit","easeInBounceOut","focus","timings","energetic","snappy","productive","expressive","lazy"],"mappings":"AAEa,MAAAA,EAAUC,OAAOC,OAAO,CACjCC,SAAU,OACVC,SAAU,WACVC,KAAM,UACNC,gBAAiB,kCACjBC,MAAO,oCAKEC,EAAUP,OAAOC,OAAO,CACjCO,UAAW,OACXC,OAAQ,QACRC,WAAY,QACZC,WAAY,QACZC,KAAM"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tabListener.js","sources":["../../../../src/core/utils/tabListener.ts"],"sourcesContent":["let mousenavigation = false;\nlet touchnavigation = false;\nlet touchEventFired = false;\n\nconst listeners = {\n mousedown: handleMouseDown as EventListener,\n keydown: handleKeydown as EventListener,\n touchstart: handleTouchStart as EventListener,\n};\n\nfunction removeAllListeners() {\n (Object.keys(listeners) as Array<keyof typeof listeners>).forEach((listenerType) => {\n document.removeEventListener(listenerType, listeners[listenerType]);\n });\n}\n\nfunction addListener(listenerType: keyof typeof listeners) {\n document.addEventListener(listenerType, listeners[listenerType]);\n}\n\nfunction handleMouseDown() {\n if (!mousenavigation && !touchEventFired) {\n mousenavigation = true;\n touchnavigation = false;\n const htmlElement = document.querySelector(\"html\");\n htmlElement?.setAttribute(\"data-mousenavigation\", \"true\");\n htmlElement?.removeAttribute(\"data-touchnavigation\");\n\n // Reset listeners\n removeAllListeners();\n addListener(\"touchstart\");\n addListener(\"keydown\");\n }\n}\n\nfunction handleKeydown(event: KeyboardEvent) {\n if (event.key === \"Tab\") {\n const htmlElement = document.querySelector(\"html\");\n removeAllListeners();\n htmlElement?.removeAttribute(\"data-mousenavigation\");\n htmlElement?.removeAttribute(\"data-touchnavigation\");\n mousenavigation = false;\n touchnavigation = false;\n\n // Reset listeners\n addListener(\"touchstart\");\n addListener(\"mousedown\");\n }\n}\n\nfunction handleTouchStart() {\n if (!touchnavigation) {\n mousenavigation = false;\n touchnavigation = true;\n const htmlElement = document.querySelector(\"html\");\n htmlElement?.setAttribute(\"data-touchnavigation\", \"true\");\n htmlElement?.removeAttribute(\"data-mousenavigation\");\n\n // Reset listeners\n removeAllListeners();\n addListener(\"touchstart\");\n addListener(\"keydown\");\n addListener(\"mousedown\");\n }\n\n // Most touch devices fire both touch and mouse events on touch (in that order)\n // see https://w3c.github.io/touch-events/#mouse-events\n // Set a check variable to avoid resetting the data-attribute:\n touchEventFired = true;\n setTimeout(() => {\n touchEventFired = false;\n }, 150); // Yes, it can take this long between the events\n}\n\nexport function initTabListener(): void {\n if (typeof document !== \"undefined\") {\n addListener(\"touchstart\");\n addListener(\"mousedown\");\n }\n}\n"],"names":["mousenavigation","touchnavigation","touchEventFired","listeners","mousedown","htmlElement","document","querySelector","setAttribute","removeAttribute","removeAllListeners","addListener","keydown","event","key","touchstart","setTimeout","Object","keys","forEach","listenerType","removeEventListener","addEventListener","initTabListener"],"mappings":"AAAA,IAAIA,GAAkB,EAClBC,GAAkB,EAClBC,GAAkB,EAEtB,MAAMC,EAAY,CACdC,UAeJ,WACQ,IAACJ,IAAoBE,EAAiB,CACpBF,GAAA,EACAC,GAAA,EACZI,MAAAA,EAAcC,SAASC,cAAc,QAC9B,MAAAF,GAAAA,EAAAG,aAAa,uBAAwB,QAClD,MAAAH,GAAAA,EAAaI,gBAAgB,wBAGVC,IACnBC,EAAY,cACZA,EAAY,UAChB,CACJ,EA3BIC,QA6BJ,SAAuBC,GACfA,GAAc,QAAdA,EAAMC,IAAe,CACfT,MAAAA,EAAcC,SAASC,cAAc,QACxBG,IACnB,MAAAL,GAAAA,EAAaI,gBAAgB,wBAC7B,MAAAJ,GAAAA,EAAaI,gBAAgB,wBACXT,GAAA,EACAC,GAAA,EAGlBU,EAAY,cACZA,EAAY,YAChB,CACJ,EAzCII,WA2CJ,WACI,IAAKd,EAAiB,CACAD,GAAA,EACAC,GAAA,EACZI,MAAAA,EAAcC,SAASC,cAAc,QAC9B,MAAAF,GAAAA,EAAAG,aAAa,uBAAwB,QAClD,MAAAH,GAAAA,EAAaI,gBAAgB,wBAGVC,IACnBC,EAAY,cACZA,EAAY,WACZA,EAAY,YAChB,CAKkBT,GAAA,EAClBc,YAAW,KACWd,GAAA,CAAA,GACnB,IACP,GA9DA,SAASQ,IACJO,OAAOC,KAAKf,GAA6CgB,SAASC,IAC/Dd,SAASe,oBAAoBD,EAAcjB,EAAUiB,GAAa,GAE1E,CAEA,SAAST,EAAYS,GACjBd,SAASgB,iBAAiBF,EAAcjB,EAAUiB,GACtD,CAwDO,SAASG,WACDjB,SAAa,MACpBK,EAAY,cACZA,EAAY,aAEpB"}