@fremtind/jokul 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (358) hide show
  1. package/LICENSE +21 -0
  2. package/build/build-stats.html +4842 -0
  3. package/build/cjs/components/ScreenReaderOnly.js +2 -0
  4. package/build/cjs/components/ScreenReaderOnly.js.map +1 -0
  5. package/build/cjs/components/SlotComponent.js +2 -0
  6. package/build/cjs/components/SlotComponent.js.map +1 -0
  7. package/build/cjs/components/index.js +2 -0
  8. package/build/cjs/components/index.js.map +1 -0
  9. package/build/cjs/components/navigation/Link.js +2 -0
  10. package/build/cjs/components/navigation/Link.js.map +1 -0
  11. package/build/cjs/components/navigation/NavLink.js +2 -0
  12. package/build/cjs/components/navigation/NavLink.js.map +1 -0
  13. package/build/cjs/components/navigation/index.js +2 -0
  14. package/build/cjs/components/navigation/index.js.map +1 -0
  15. package/build/cjs/core/as-child.js +2 -0
  16. package/build/cjs/core/as-child.js.map +1 -0
  17. package/build/cjs/core/index.js +2 -0
  18. package/build/cjs/core/index.js.map +1 -0
  19. package/build/cjs/core/polymorphism.js +2 -0
  20. package/build/cjs/core/polymorphism.js.map +1 -0
  21. package/build/cjs/core/tokens.js +2 -0
  22. package/build/cjs/core/tokens.js.map +1 -0
  23. package/build/cjs/core/types.js +2 -0
  24. package/build/cjs/core/types.js.map +1 -0
  25. package/build/cjs/core/utils/breakpoints.js +2 -0
  26. package/build/cjs/core/utils/breakpoints.js.map +1 -0
  27. package/build/cjs/core/utils/density.js +2 -0
  28. package/build/cjs/core/utils/density.js.map +1 -0
  29. package/build/cjs/core/utils/getValuePair.js +2 -0
  30. package/build/cjs/core/utils/getValuePair.js.map +1 -0
  31. package/build/cjs/core/utils/index.js +2 -0
  32. package/build/cjs/core/utils/index.js.map +1 -0
  33. package/build/cjs/core/utils/mergeProps.js +2 -0
  34. package/build/cjs/core/utils/mergeProps.js.map +1 -0
  35. package/build/cjs/core/utils/mergeRefs.js +2 -0
  36. package/build/cjs/core/utils/mergeRefs.js.map +1 -0
  37. package/build/cjs/core/utils/motion.js +2 -0
  38. package/build/cjs/core/utils/motion.js.map +1 -0
  39. package/build/cjs/core/utils/tabListener.js +2 -0
  40. package/build/cjs/core/utils/tabListener.js.map +1 -0
  41. package/build/cjs/hooks/index.js +2 -0
  42. package/build/cjs/hooks/index.js.map +1 -0
  43. package/build/cjs/hooks/mediaQueryUtils.js +2 -0
  44. package/build/cjs/hooks/mediaQueryUtils.js.map +1 -0
  45. package/build/cjs/hooks/useAnimatedDetails/index.js +2 -0
  46. package/build/cjs/hooks/useAnimatedDetails/index.js.map +1 -0
  47. package/build/cjs/hooks/useAnimatedDetails/useAnimatedDetails.js +2 -0
  48. package/build/cjs/hooks/useAnimatedDetails/useAnimatedDetails.js.map +1 -0
  49. package/build/cjs/hooks/useAnimatedHeight/index.js +2 -0
  50. package/build/cjs/hooks/useAnimatedHeight/index.js.map +1 -0
  51. package/build/cjs/hooks/useAnimatedHeight/types.js +2 -0
  52. package/build/cjs/hooks/useAnimatedHeight/types.js.map +1 -0
  53. package/build/cjs/hooks/useAnimatedHeight/useAnimatedHeight.js +2 -0
  54. package/build/cjs/hooks/useAnimatedHeight/useAnimatedHeight.js.map +1 -0
  55. package/build/cjs/hooks/useAnimatedHeight/useAnimatedHeightBetween.js +2 -0
  56. package/build/cjs/hooks/useAnimatedHeight/useAnimatedHeightBetween.js.map +1 -0
  57. package/build/cjs/hooks/useAnimatedHeight/useAutoAnimateHeight.js +2 -0
  58. package/build/cjs/hooks/useAnimatedHeight/useAutoAnimateHeight.js.map +1 -0
  59. package/build/cjs/hooks/useAriaLiveRegion/index.js +2 -0
  60. package/build/cjs/hooks/useAriaLiveRegion/index.js.map +1 -0
  61. package/build/cjs/hooks/useAriaLiveRegion/useAriaLiveRegion.js +2 -0
  62. package/build/cjs/hooks/useAriaLiveRegion/useAriaLiveRegion.js.map +1 -0
  63. package/build/cjs/hooks/useBrowserPreferences/index.js +2 -0
  64. package/build/cjs/hooks/useBrowserPreferences/index.js.map +1 -0
  65. package/build/cjs/hooks/useBrowserPreferences/useBrowserPreferences.js +2 -0
  66. package/build/cjs/hooks/useBrowserPreferences/useBrowserPreferences.js.map +1 -0
  67. package/build/cjs/hooks/useClickOutside/index.js +2 -0
  68. package/build/cjs/hooks/useClickOutside/index.js.map +1 -0
  69. package/build/cjs/hooks/useClickOutside/useClickOutside.js +2 -0
  70. package/build/cjs/hooks/useClickOutside/useClickOutside.js.map +1 -0
  71. package/build/cjs/hooks/useElementDimensions/index.js +2 -0
  72. package/build/cjs/hooks/useElementDimensions/index.js.map +1 -0
  73. package/build/cjs/hooks/useElementDimensions/useElementDimensions.js +2 -0
  74. package/build/cjs/hooks/useElementDimensions/useElementDimensions.js.map +1 -0
  75. package/build/cjs/hooks/useFocusOutside/index.js +2 -0
  76. package/build/cjs/hooks/useFocusOutside/index.js.map +1 -0
  77. package/build/cjs/hooks/useFocusOutside/useFocusOutside.js +2 -0
  78. package/build/cjs/hooks/useFocusOutside/useFocusOutside.js.map +1 -0
  79. package/build/cjs/hooks/useId/index.js +2 -0
  80. package/build/cjs/hooks/useId/index.js.map +1 -0
  81. package/build/cjs/hooks/useId/useId.js +2 -0
  82. package/build/cjs/hooks/useId/useId.js.map +1 -0
  83. package/build/cjs/hooks/useIntersectionObserver/index.js +2 -0
  84. package/build/cjs/hooks/useIntersectionObserver/index.js.map +1 -0
  85. package/build/cjs/hooks/useIntersectionObserver/useIntersectionObserver.js +2 -0
  86. package/build/cjs/hooks/useIntersectionObserver/useIntersectionObserver.js.map +1 -0
  87. package/build/cjs/hooks/useKeyListener/index.js +2 -0
  88. package/build/cjs/hooks/useKeyListener/index.js.map +1 -0
  89. package/build/cjs/hooks/useKeyListener/useKeyListener.js +2 -0
  90. package/build/cjs/hooks/useKeyListener/useKeyListener.js.map +1 -0
  91. package/build/cjs/hooks/useListNavigation/index.js +2 -0
  92. package/build/cjs/hooks/useListNavigation/index.js.map +1 -0
  93. package/build/cjs/hooks/useListNavigation/useListNavigation.js +2 -0
  94. package/build/cjs/hooks/useListNavigation/useListNavigation.js.map +1 -0
  95. package/build/cjs/hooks/useLocalStorage/index.js +2 -0
  96. package/build/cjs/hooks/useLocalStorage/index.js.map +1 -0
  97. package/build/cjs/hooks/useLocalStorage/useLocalStorage.js +2 -0
  98. package/build/cjs/hooks/useLocalStorage/useLocalStorage.js.map +1 -0
  99. package/build/cjs/hooks/useMutationObserver/index.js +2 -0
  100. package/build/cjs/hooks/useMutationObserver/index.js.map +1 -0
  101. package/build/cjs/hooks/useMutationObserver/useMutationObserver.js +2 -0
  102. package/build/cjs/hooks/useMutationObserver/useMutationObserver.js.map +1 -0
  103. package/build/cjs/hooks/usePreviousValue/index.js +2 -0
  104. package/build/cjs/hooks/usePreviousValue/index.js.map +1 -0
  105. package/build/cjs/hooks/usePreviousValue/usePreviousValue.js +2 -0
  106. package/build/cjs/hooks/usePreviousValue/usePreviousValue.js.map +1 -0
  107. package/build/cjs/hooks/useProgressiveImg/index.js +2 -0
  108. package/build/cjs/hooks/useProgressiveImg/index.js.map +1 -0
  109. package/build/cjs/hooks/useProgressiveImg/useProgressiveImg.js +2 -0
  110. package/build/cjs/hooks/useProgressiveImg/useProgressiveImg.js.map +1 -0
  111. package/build/cjs/hooks/useScreen/index.js +2 -0
  112. package/build/cjs/hooks/useScreen/index.js.map +1 -0
  113. package/build/cjs/hooks/useScreen/state.js +2 -0
  114. package/build/cjs/hooks/useScreen/state.js.map +1 -0
  115. package/build/cjs/hooks/useScreen/useScreen.js +2 -0
  116. package/build/cjs/hooks/useScreen/useScreen.js.map +1 -0
  117. package/build/cjs/hooks/useScrollIntoView/index.js +2 -0
  118. package/build/cjs/hooks/useScrollIntoView/index.js.map +1 -0
  119. package/build/cjs/hooks/useScrollIntoView/useScrollIntoView.js +2 -0
  120. package/build/cjs/hooks/useScrollIntoView/useScrollIntoView.js.map +1 -0
  121. package/build/cjs/hooks/useSwipeGesture/index.js +2 -0
  122. package/build/cjs/hooks/useSwipeGesture/index.js.map +1 -0
  123. package/build/cjs/hooks/useSwipeGesture/useSwipeGesture.js +2 -0
  124. package/build/cjs/hooks/useSwipeGesture/useSwipeGesture.js.map +1 -0
  125. package/build/clsx-BeLtu-UY.js +2 -0
  126. package/build/clsx-BeLtu-UY.js.map +1 -0
  127. package/build/clsx-E3yX_9sL.cjs +2 -0
  128. package/build/clsx-E3yX_9sL.cjs.map +1 -0
  129. package/build/components/ScreenReaderOnly.d.ts +6 -0
  130. package/build/components/SlotComponent.d.ts +7 -0
  131. package/build/components/index.d.ts +2 -0
  132. package/build/components/navigation/Link.d.ts +5 -0
  133. package/build/components/navigation/NavLink.d.ts +6 -0
  134. package/build/components/navigation/index.d.ts +2 -0
  135. package/build/core/as-child.d.ts +39 -0
  136. package/build/core/index.d.ts +7 -0
  137. package/build/core/polymorphism.d.ts +11 -0
  138. package/build/core/tokens.d.ts +351 -0
  139. package/build/core/types.d.ts +42 -0
  140. package/build/core/utils/breakpoints.d.ts +6 -0
  141. package/build/core/utils/density.d.ts +1 -0
  142. package/build/core/utils/getValuePair.d.ts +2 -0
  143. package/build/core/utils/index.d.ts +8 -0
  144. package/build/core/utils/mergeProps.d.ts +3 -0
  145. package/build/core/utils/mergeRefs.d.ts +3 -0
  146. package/build/core/utils/motion.d.ts +16 -0
  147. package/build/core/utils/tabListener.d.ts +1 -0
  148. package/build/es/components/ScreenReaderOnly.js +2 -0
  149. package/build/es/components/ScreenReaderOnly.js.map +1 -0
  150. package/build/es/components/SlotComponent.js +2 -0
  151. package/build/es/components/SlotComponent.js.map +1 -0
  152. package/build/es/components/index.js +2 -0
  153. package/build/es/components/index.js.map +1 -0
  154. package/build/es/components/navigation/Link.js +2 -0
  155. package/build/es/components/navigation/Link.js.map +1 -0
  156. package/build/es/components/navigation/NavLink.js +2 -0
  157. package/build/es/components/navigation/NavLink.js.map +1 -0
  158. package/build/es/components/navigation/index.js +2 -0
  159. package/build/es/components/navigation/index.js.map +1 -0
  160. package/build/es/core/as-child.js +2 -0
  161. package/build/es/core/as-child.js.map +1 -0
  162. package/build/es/core/index.js +2 -0
  163. package/build/es/core/index.js.map +1 -0
  164. package/build/es/core/polymorphism.js +2 -0
  165. package/build/es/core/polymorphism.js.map +1 -0
  166. package/build/es/core/tokens.js +2 -0
  167. package/build/es/core/tokens.js.map +1 -0
  168. package/build/es/core/types.js +2 -0
  169. package/build/es/core/types.js.map +1 -0
  170. package/build/es/core/utils/breakpoints.js +2 -0
  171. package/build/es/core/utils/breakpoints.js.map +1 -0
  172. package/build/es/core/utils/density.js +2 -0
  173. package/build/es/core/utils/density.js.map +1 -0
  174. package/build/es/core/utils/getValuePair.js +2 -0
  175. package/build/es/core/utils/getValuePair.js.map +1 -0
  176. package/build/es/core/utils/index.js +2 -0
  177. package/build/es/core/utils/index.js.map +1 -0
  178. package/build/es/core/utils/mergeProps.js +2 -0
  179. package/build/es/core/utils/mergeProps.js.map +1 -0
  180. package/build/es/core/utils/mergeRefs.js +2 -0
  181. package/build/es/core/utils/mergeRefs.js.map +1 -0
  182. package/build/es/core/utils/motion.js +2 -0
  183. package/build/es/core/utils/motion.js.map +1 -0
  184. package/build/es/core/utils/tabListener.js +2 -0
  185. package/build/es/core/utils/tabListener.js.map +1 -0
  186. package/build/es/hooks/index.js +2 -0
  187. package/build/es/hooks/index.js.map +1 -0
  188. package/build/es/hooks/mediaQueryUtils.js +2 -0
  189. package/build/es/hooks/mediaQueryUtils.js.map +1 -0
  190. package/build/es/hooks/useAnimatedDetails/index.js +2 -0
  191. package/build/es/hooks/useAnimatedDetails/index.js.map +1 -0
  192. package/build/es/hooks/useAnimatedDetails/useAnimatedDetails.js +2 -0
  193. package/build/es/hooks/useAnimatedDetails/useAnimatedDetails.js.map +1 -0
  194. package/build/es/hooks/useAnimatedHeight/index.js +2 -0
  195. package/build/es/hooks/useAnimatedHeight/index.js.map +1 -0
  196. package/build/es/hooks/useAnimatedHeight/types.js +2 -0
  197. package/build/es/hooks/useAnimatedHeight/types.js.map +1 -0
  198. package/build/es/hooks/useAnimatedHeight/useAnimatedHeight.js +2 -0
  199. package/build/es/hooks/useAnimatedHeight/useAnimatedHeight.js.map +1 -0
  200. package/build/es/hooks/useAnimatedHeight/useAnimatedHeightBetween.js +2 -0
  201. package/build/es/hooks/useAnimatedHeight/useAnimatedHeightBetween.js.map +1 -0
  202. package/build/es/hooks/useAnimatedHeight/useAutoAnimateHeight.js +2 -0
  203. package/build/es/hooks/useAnimatedHeight/useAutoAnimateHeight.js.map +1 -0
  204. package/build/es/hooks/useAriaLiveRegion/index.js +2 -0
  205. package/build/es/hooks/useAriaLiveRegion/index.js.map +1 -0
  206. package/build/es/hooks/useAriaLiveRegion/useAriaLiveRegion.js +2 -0
  207. package/build/es/hooks/useAriaLiveRegion/useAriaLiveRegion.js.map +1 -0
  208. package/build/es/hooks/useBrowserPreferences/index.js +2 -0
  209. package/build/es/hooks/useBrowserPreferences/index.js.map +1 -0
  210. package/build/es/hooks/useBrowserPreferences/useBrowserPreferences.js +2 -0
  211. package/build/es/hooks/useBrowserPreferences/useBrowserPreferences.js.map +1 -0
  212. package/build/es/hooks/useClickOutside/index.js +2 -0
  213. package/build/es/hooks/useClickOutside/index.js.map +1 -0
  214. package/build/es/hooks/useClickOutside/useClickOutside.js +2 -0
  215. package/build/es/hooks/useClickOutside/useClickOutside.js.map +1 -0
  216. package/build/es/hooks/useElementDimensions/index.js +2 -0
  217. package/build/es/hooks/useElementDimensions/index.js.map +1 -0
  218. package/build/es/hooks/useElementDimensions/useElementDimensions.js +2 -0
  219. package/build/es/hooks/useElementDimensions/useElementDimensions.js.map +1 -0
  220. package/build/es/hooks/useFocusOutside/index.js +2 -0
  221. package/build/es/hooks/useFocusOutside/index.js.map +1 -0
  222. package/build/es/hooks/useFocusOutside/useFocusOutside.js +2 -0
  223. package/build/es/hooks/useFocusOutside/useFocusOutside.js.map +1 -0
  224. package/build/es/hooks/useId/index.js +2 -0
  225. package/build/es/hooks/useId/index.js.map +1 -0
  226. package/build/es/hooks/useId/useId.js +2 -0
  227. package/build/es/hooks/useId/useId.js.map +1 -0
  228. package/build/es/hooks/useIntersectionObserver/index.js +2 -0
  229. package/build/es/hooks/useIntersectionObserver/index.js.map +1 -0
  230. package/build/es/hooks/useIntersectionObserver/useIntersectionObserver.js +2 -0
  231. package/build/es/hooks/useIntersectionObserver/useIntersectionObserver.js.map +1 -0
  232. package/build/es/hooks/useKeyListener/index.js +2 -0
  233. package/build/es/hooks/useKeyListener/index.js.map +1 -0
  234. package/build/es/hooks/useKeyListener/useKeyListener.js +2 -0
  235. package/build/es/hooks/useKeyListener/useKeyListener.js.map +1 -0
  236. package/build/es/hooks/useListNavigation/index.js +2 -0
  237. package/build/es/hooks/useListNavigation/index.js.map +1 -0
  238. package/build/es/hooks/useListNavigation/useListNavigation.js +2 -0
  239. package/build/es/hooks/useListNavigation/useListNavigation.js.map +1 -0
  240. package/build/es/hooks/useLocalStorage/index.js +2 -0
  241. package/build/es/hooks/useLocalStorage/index.js.map +1 -0
  242. package/build/es/hooks/useLocalStorage/useLocalStorage.js +2 -0
  243. package/build/es/hooks/useLocalStorage/useLocalStorage.js.map +1 -0
  244. package/build/es/hooks/useMutationObserver/index.js +2 -0
  245. package/build/es/hooks/useMutationObserver/index.js.map +1 -0
  246. package/build/es/hooks/useMutationObserver/useMutationObserver.js +2 -0
  247. package/build/es/hooks/useMutationObserver/useMutationObserver.js.map +1 -0
  248. package/build/es/hooks/usePreviousValue/index.js +2 -0
  249. package/build/es/hooks/usePreviousValue/index.js.map +1 -0
  250. package/build/es/hooks/usePreviousValue/usePreviousValue.js +2 -0
  251. package/build/es/hooks/usePreviousValue/usePreviousValue.js.map +1 -0
  252. package/build/es/hooks/useProgressiveImg/index.js +2 -0
  253. package/build/es/hooks/useProgressiveImg/index.js.map +1 -0
  254. package/build/es/hooks/useProgressiveImg/useProgressiveImg.js +2 -0
  255. package/build/es/hooks/useProgressiveImg/useProgressiveImg.js.map +1 -0
  256. package/build/es/hooks/useScreen/index.js +2 -0
  257. package/build/es/hooks/useScreen/index.js.map +1 -0
  258. package/build/es/hooks/useScreen/state.js +2 -0
  259. package/build/es/hooks/useScreen/state.js.map +1 -0
  260. package/build/es/hooks/useScreen/useScreen.js +2 -0
  261. package/build/es/hooks/useScreen/useScreen.js.map +1 -0
  262. package/build/es/hooks/useScrollIntoView/index.js +2 -0
  263. package/build/es/hooks/useScrollIntoView/index.js.map +1 -0
  264. package/build/es/hooks/useScrollIntoView/useScrollIntoView.js +2 -0
  265. package/build/es/hooks/useScrollIntoView/useScrollIntoView.js.map +1 -0
  266. package/build/es/hooks/useSwipeGesture/index.js +2 -0
  267. package/build/es/hooks/useSwipeGesture/index.js.map +1 -0
  268. package/build/es/hooks/useSwipeGesture/useSwipeGesture.js +2 -0
  269. package/build/es/hooks/useSwipeGesture/useSwipeGesture.js.map +1 -0
  270. package/build/hooks/index.d.ts +18 -0
  271. package/build/hooks/mediaQueryUtils.d.ts +21 -0
  272. package/build/hooks/useAnimatedDetails/index.d.ts +1 -0
  273. package/build/hooks/useAnimatedDetails/useAnimatedDetails.d.ts +20 -0
  274. package/build/hooks/useAnimatedHeight/index.d.ts +4 -0
  275. package/build/hooks/useAnimatedHeight/types.d.ts +26 -0
  276. package/build/hooks/useAnimatedHeight/useAnimatedHeight.d.ts +10 -0
  277. package/build/hooks/useAnimatedHeight/useAnimatedHeightBetween.d.ts +10 -0
  278. package/build/hooks/useAnimatedHeight/useAutoAnimateHeight.d.ts +20 -0
  279. package/build/hooks/useAriaLiveRegion/index.d.ts +1 -0
  280. package/build/hooks/useAriaLiveRegion/useAriaLiveRegion.d.ts +15 -0
  281. package/build/hooks/useBrowserPreferences/index.d.ts +1 -0
  282. package/build/hooks/useBrowserPreferences/useBrowserPreferences.d.ts +12 -0
  283. package/build/hooks/useClickOutside/index.d.ts +1 -0
  284. package/build/hooks/useClickOutside/useClickOutside.d.ts +7 -0
  285. package/build/hooks/useElementDimensions/index.d.ts +1 -0
  286. package/build/hooks/useElementDimensions/useElementDimensions.d.ts +11 -0
  287. package/build/hooks/useFocusOutside/index.d.ts +1 -0
  288. package/build/hooks/useFocusOutside/useFocusOutside.d.ts +7 -0
  289. package/build/hooks/useId/index.d.ts +1 -0
  290. package/build/hooks/useId/useId.d.ts +11 -0
  291. package/build/hooks/useIntersectionObserver/index.d.ts +1 -0
  292. package/build/hooks/useIntersectionObserver/useIntersectionObserver.d.ts +13 -0
  293. package/build/hooks/useKeyListener/index.d.ts +1 -0
  294. package/build/hooks/useKeyListener/useKeyListener.d.ts +8 -0
  295. package/build/hooks/useListNavigation/index.d.ts +1 -0
  296. package/build/hooks/useListNavigation/useListNavigation.d.ts +7 -0
  297. package/build/hooks/useLocalStorage/index.d.ts +1 -0
  298. package/build/hooks/useLocalStorage/useLocalStorage.d.ts +1 -0
  299. package/build/hooks/useMutationObserver/index.d.ts +1 -0
  300. package/build/hooks/useMutationObserver/useMutationObserver.d.ts +9 -0
  301. package/build/hooks/usePreviousValue/index.d.ts +1 -0
  302. package/build/hooks/usePreviousValue/usePreviousValue.d.ts +6 -0
  303. package/build/hooks/useProgressiveImg/index.d.ts +1 -0
  304. package/build/hooks/useProgressiveImg/useProgressiveImg.d.ts +10 -0
  305. package/build/hooks/useScreen/index.d.ts +2 -0
  306. package/build/hooks/useScreen/state.d.ts +17 -0
  307. package/build/hooks/useScreen/useScreen.d.ts +6 -0
  308. package/build/hooks/useScrollIntoView/index.d.ts +1 -0
  309. package/build/hooks/useScrollIntoView/useScrollIntoView.d.ts +11 -0
  310. package/build/hooks/useSwipeGesture/index.d.ts +1 -0
  311. package/build/hooks/useSwipeGesture/useSwipeGesture.d.ts +27 -0
  312. package/package.json +83 -0
  313. package/src/components/navigation/styles/link.css +152 -0
  314. package/src/components/navigation/styles/link.min.css +1 -0
  315. package/src/components/navigation/styles/link.scss +138 -0
  316. package/src/core/jkl/_colors.scss +26 -0
  317. package/src/core/jkl/_convert.scss +96 -0
  318. package/src/core/jkl/_helpers.scss +20 -0
  319. package/src/core/jkl/_index.scss +18 -0
  320. package/src/core/jkl/_legacy-tokens.scss +22 -0
  321. package/src/core/jkl/_motion.scss +62 -0
  322. package/src/core/jkl/_navigation.scss +9 -0
  323. package/src/core/jkl/_ornaments.scss +26 -0
  324. package/src/core/jkl/_reset.scss +43 -0
  325. package/src/core/jkl/_responsive-units.scss +30 -0
  326. package/src/core/jkl/_screenreader.scss +59 -0
  327. package/src/core/jkl/_screens.scss +135 -0
  328. package/src/core/jkl/_shadows.scss +25 -0
  329. package/src/core/jkl/_spacing.scss +210 -0
  330. package/src/core/jkl/_theme.scss +144 -0
  331. package/src/core/jkl/_tokens.scss +148 -0
  332. package/src/core/jkl/_typography.scss +327 -0
  333. package/src/core/jkl/_underline.scss +16 -0
  334. package/src/core/jkl/_z-index.scss +23 -0
  335. package/src/core/styles/_color-tokens.scss +75 -0
  336. package/src/core/styles/_headings.scss +29 -0
  337. package/src/core/styles/_index.scss +10 -0
  338. package/src/core/styles/_legacy-tokens.scss +26 -0
  339. package/src/core/styles/_normalize.scss +250 -0
  340. package/src/core/styles/_paragraphs.scss +16 -0
  341. package/src/core/styles/_reset.scss +66 -0
  342. package/src/core/styles/_screen-reader.scss +9 -0
  343. package/src/core/styles/_spacing.scss +75 -0
  344. package/src/core/styles/_tokens.scss +114 -0
  345. package/src/core/styles/core.css +1614 -0
  346. package/src/core/styles/core.min.css +1 -0
  347. package/src/core/styles/core.scss +71 -0
  348. package/src/core/styles/vind/_flex.scss +113 -0
  349. package/src/core/styles/vind/_font.scss +19 -0
  350. package/src/core/styles/vind/_margin.scss +43 -0
  351. package/src/core/styles/vind/_padding.scss +43 -0
  352. package/src/core/styles/vind/_space-between.scss +13 -0
  353. package/src/core/styles/vind/_typography.scss +47 -0
  354. package/src/core/styles/vind/_vind.scss +6 -0
  355. package/src/core/styles/vind.css +1742 -0
  356. package/src/core/styles/vind.min.css +1 -0
  357. package/src/core/styles/vind.scss +3 -0
  358. package/src/core/tokens.less +196 -0
@@ -0,0 +1,152 @@
1
+ @charset "UTF-8";
2
+ /**
3
+ * Do not edit directly
4
+ * Generated on Tue, 10 Sep 2024 05:21:22 GMT
5
+ */
6
+ @media screen and (prefers-color-scheme: light) {
7
+ :root {
8
+ --jkl-link-color: #1b1917;
9
+ --jkl-link-hover-color: #636060;
10
+ --jkl-link-active-color: #1b1917;
11
+ }
12
+ }
13
+ [data-theme=light] {
14
+ --jkl-link-color: #1b1917;
15
+ --jkl-link-hover-color: #636060;
16
+ --jkl-link-active-color: #1b1917;
17
+ }
18
+
19
+ @media screen and (prefers-color-scheme: dark) {
20
+ :root {
21
+ --jkl-link-color: #f9f9f9;
22
+ --jkl-link-hover-color: #c8c5c3;
23
+ --jkl-link-active-color: #f9f9f9;
24
+ }
25
+ }
26
+ [data-theme=dark] {
27
+ --jkl-link-color: #f9f9f9;
28
+ --jkl-link-hover-color: #c8c5c3;
29
+ --jkl-link-active-color: #f9f9f9;
30
+ }
31
+
32
+ .jkl-link {
33
+ color: var(--jkl-link-color);
34
+ background-image: linear-gradient(to bottom, var(--jkl-link-color) 0%, var(--jkl-link-color) 100%);
35
+ background-position: 0 calc(100% - (0.125rem - 0.0625rem));
36
+ background-size: 0.0625rem 0.0625rem;
37
+ background-repeat: repeat-x;
38
+ transition-timing-function: ease;
39
+ transition-duration: 75ms;
40
+ transition-property: color;
41
+ outline: none;
42
+ text-decoration: none;
43
+ /* Show arrow after external links, or links opening
44
+ in a new window or tab: */
45
+ }
46
+ .jkl-link:hover:not(:focus) {
47
+ color: var(--jkl-link-hover-color);
48
+ background-image: linear-gradient(to bottom, var(--jkl-link-hover-color) 0%, var(--jkl-link-hover-color) 100%);
49
+ }
50
+ .jkl-link:hover {
51
+ background-image: linear-gradient(to bottom, var(--jkl-link-hover-color) 0%, var(--jkl-link-hover-color) 100%);
52
+ }
53
+ .jkl-link:focus-visible {
54
+ outline: 2px solid var(--jkl-color-border-action);
55
+ outline-offset: 2px;
56
+ background: none;
57
+ }
58
+ .jkl-link:active {
59
+ background-position: 0 calc(100% - (0.125rem - 0.0625rem));
60
+ }
61
+ .jkl-link[target=_blank]::after, .jkl-link--external::after {
62
+ content: "↗";
63
+ content: "↗"/"";
64
+ alt: " ";
65
+ }
66
+ @media screen and (forced-colors: active) {
67
+ .jkl-link {
68
+ outline: revert;
69
+ text-decoration: revert;
70
+ }
71
+ }
72
+
73
+ .jkl-nav-link {
74
+ color: var(--jkl-link-color);
75
+ box-sizing: border-box;
76
+ font-weight: 400;
77
+ text-decoration: none;
78
+ position: relative;
79
+ outline: 0;
80
+ border-style: none;
81
+ outline-style: none;
82
+ }
83
+ .jkl-nav-link:active, .jkl-nav-link:hover, .jkl-nav-link:focus {
84
+ outline: 0;
85
+ outline-style: none;
86
+ }
87
+ @media screen and (forced-colors: active) {
88
+ .jkl-nav-link {
89
+ outline: revert;
90
+ border-style: revert;
91
+ outline-style: revert;
92
+ }
93
+ .jkl-nav-link:active, .jkl-nav-link:hover, .jkl-nav-link:focus {
94
+ outline: revert;
95
+ outline-style: revert;
96
+ }
97
+ }
98
+ .jkl-nav-link::after {
99
+ content: "→";
100
+ content: "→"/"";
101
+ alt: " ";
102
+ transition-timing-function: ease;
103
+ transition-duration: 150ms;
104
+ transition-property: padding-left, padding-right;
105
+ display: inline;
106
+ margin-left: -0.2em;
107
+ padding-left: 0.35em;
108
+ padding-right: 0.35em;
109
+ }
110
+ .jkl-nav-link:hover:not(:focus) {
111
+ color: var(--jkl-link-hover-color);
112
+ }
113
+ .jkl-nav-link:hover:not(:focus)::after {
114
+ padding-left: 0.7em;
115
+ padding-right: 0;
116
+ }
117
+ .jkl-nav-link:focus-visible {
118
+ outline: 2px solid var(--jkl-color-border-action);
119
+ outline-offset: 2px;
120
+ }
121
+ .jkl-nav-link:focus-visible::after {
122
+ padding-left: 0.7em;
123
+ padding-right: 0;
124
+ }
125
+ .jkl-nav-link--active {
126
+ --jkl-icon-weight: 500;
127
+ font-weight: 700;
128
+ letter-spacing: -0.014em;
129
+ }
130
+
131
+ .jkl-nav-link--back {
132
+ padding-right: 0;
133
+ padding-left: 0.3em;
134
+ margin-left: -0.3em;
135
+ }
136
+ .jkl-nav-link--back::after {
137
+ display: none;
138
+ }
139
+ .jkl-nav-link--back::before {
140
+ content: "←";
141
+ content: "←"/"";
142
+ alt: " ";
143
+ transition-timing-function: ease;
144
+ transition-duration: 150ms;
145
+ transform: translateX(0);
146
+ transition-property: transform;
147
+ display: inline-block;
148
+ padding-right: 0.25rem;
149
+ }
150
+ .jkl-nav-link--back:hover::before, .jkl-nav-link--back:focus-visible::before {
151
+ transform: translateX(-33%);
152
+ }
@@ -0,0 +1 @@
1
+ @charset "UTF-8";@media screen and (prefers-color-scheme:light){:root{--jkl-link-color:#1b1917;--jkl-link-hover-color:#636060;--jkl-link-active-color:#1b1917}}[data-theme=light]{--jkl-link-color:#1b1917;--jkl-link-hover-color:#636060;--jkl-link-active-color:#1b1917}@media screen and (prefers-color-scheme:dark){:root{--jkl-link-color:#f9f9f9;--jkl-link-hover-color:#c8c5c3;--jkl-link-active-color:#f9f9f9}}[data-theme=dark]{--jkl-link-color:#f9f9f9;--jkl-link-hover-color:#c8c5c3;--jkl-link-active-color:#f9f9f9}.jkl-link{background-image:linear-gradient(to bottom,var(--jkl-link-color) 0,var(--jkl-link-color) 100%);background-position:0 calc(100% - .0625rem);background-repeat:repeat-x;background-size:.0625rem .0625rem;color:var(--jkl-link-color);outline:none;text-decoration:none;transition-duration:75ms;transition-property:color;transition-timing-function:ease}.jkl-link:hover:not(:focus){color:var(--jkl-link-hover-color)}.jkl-link:hover,.jkl-link:hover:not(:focus){background-image:linear-gradient(to bottom,var(--jkl-link-hover-color) 0,var(--jkl-link-hover-color) 100%)}.jkl-link:focus-visible{background:none;outline:2px solid var(--jkl-color-border-action);outline-offset:2px}.jkl-link:active{background-position:0 calc(100% - .0625rem)}.jkl-link--external:after,.jkl-link[target=_blank]:after{alt:" ";content:"↗";content:"↗"/""}@media screen and (forced-colors:active){.jkl-link{outline:revert;-webkit-text-decoration:revert;text-decoration:revert}}.jkl-nav-link{border-style:none;box-sizing:border-box;color:var(--jkl-link-color);font-weight:400;position:relative;text-decoration:none}.jkl-nav-link,.jkl-nav-link:active,.jkl-nav-link:focus,.jkl-nav-link:hover{outline:0;outline-style:none}@media screen and (forced-colors:active){.jkl-nav-link{border-style:revert}.jkl-nav-link,.jkl-nav-link:active,.jkl-nav-link:focus,.jkl-nav-link:hover{outline:revert;outline-style:revert}}.jkl-nav-link:after{alt:" ";content:"→";content:"→"/"";display:inline;margin-left:-.2em;padding-left:.35em;padding-right:.35em;transition-duration:.15s;transition-property:padding-left,padding-right;transition-timing-function:ease}.jkl-nav-link:hover:not(:focus){color:var(--jkl-link-hover-color)}.jkl-nav-link:hover:not(:focus):after{padding-left:.7em;padding-right:0}.jkl-nav-link:focus-visible{outline:2px solid var(--jkl-color-border-action);outline-offset:2px}.jkl-nav-link:focus-visible:after{padding-left:.7em;padding-right:0}.jkl-nav-link--active{--jkl-icon-weight:500;font-weight:700;letter-spacing:-.014em}.jkl-nav-link--back{margin-left:-.3em;padding-left:.3em;padding-right:0}.jkl-nav-link--back:after{display:none}.jkl-nav-link--back:before{alt:" ";content:"←";content:"←"/"";display:inline-block;padding-right:.25rem;transform:translateX(0);transition-duration:.15s;transition-property:transform;transition-timing-function:ease}.jkl-nav-link--back:focus-visible:before,.jkl-nav-link--back:hover:before{transform:translateX(-33%)}
@@ -0,0 +1,138 @@
1
+ @use "../../../core/jkl";
2
+
3
+ @mixin _underline-gradient($color) {
4
+ background-image: linear-gradient(to bottom, $color 0%, $color 100%);
5
+ }
6
+
7
+ $_right-arrow: "\2192"; // unicode right arrow
8
+ $_left-arrow: "\2190"; // unicode left arrow
9
+ $_north-east-arrow: "\2197"; // unicode north east arrow (up/right)
10
+
11
+ $_link-underline-thickness: jkl.rem(1px);
12
+ $_link-underline-thickness--focus: jkl.rem(2px);
13
+
14
+ @include jkl.light-mode-variables {
15
+ --jkl-link-color: #{jkl.$color-granitt};
16
+ --jkl-link-hover-color: #{jkl.$color-stein};
17
+ --jkl-link-active-color: #{jkl.$color-granitt};
18
+ }
19
+ @include jkl.dark-mode-variables {
20
+ --jkl-link-color: #{jkl.$color-snohvit};
21
+ --jkl-link-hover-color: #{jkl.$color-svaberg};
22
+ --jkl-link-active-color: #{jkl.$color-snohvit};
23
+ }
24
+
25
+ .jkl-link {
26
+ color: var(--jkl-link-color);
27
+ @include _underline-gradient(var(--jkl-link-color));
28
+ background-position: 0 calc(100% - (#{$_link-underline-thickness--focus} - #{$_link-underline-thickness}));
29
+ background-size: $_link-underline-thickness $_link-underline-thickness;
30
+ background-repeat: repeat-x;
31
+ @include jkl.motion("standard", "energetic");
32
+ transition-property: color;
33
+ outline: none;
34
+ text-decoration: none;
35
+
36
+ &:hover:not(:focus) {
37
+ color: var(--jkl-link-hover-color);
38
+ @include _underline-gradient(var(--jkl-link-hover-color));
39
+ }
40
+
41
+ &:hover {
42
+ @include _underline-gradient(var(--jkl-link-hover-color));
43
+ }
44
+
45
+ &:focus-visible {
46
+ @include jkl.focus-outline;
47
+ background: none;
48
+ }
49
+
50
+ &:active {
51
+ background-position: 0 calc(100% - (#{$_link-underline-thickness--focus} - #{$_link-underline-thickness}));
52
+ }
53
+
54
+ /* Show arrow after external links, or links opening
55
+ in a new window or tab: */
56
+ &[target="_blank"],
57
+ &--external {
58
+ &::after {
59
+ @include jkl.decorative($content: $_north-east-arrow);
60
+ }
61
+ }
62
+
63
+ @include jkl.forced-colors-mode {
64
+ outline: revert;
65
+ text-decoration: revert;
66
+ }
67
+ }
68
+
69
+ .jkl-nav-link {
70
+ color: var(--jkl-link-color);
71
+
72
+ box-sizing: border-box;
73
+ font-weight: jkl.$typography-weight-normal;
74
+ text-decoration: none;
75
+ position: relative;
76
+
77
+ @include jkl.reset-outline;
78
+
79
+ &::after {
80
+ @include jkl.decorative($content: $_right-arrow);
81
+ @include jkl.motion;
82
+ transition-property: padding-left, padding-right;
83
+ display: inline;
84
+ margin-left: -0.2em;
85
+ padding-left: 0.35em;
86
+ padding-right: 0.35em;
87
+ }
88
+
89
+ &:hover:not(:focus) {
90
+ color: var(--jkl-link-hover-color);
91
+
92
+ &::after {
93
+ padding-left: 0.7em;
94
+ padding-right: 0;
95
+ }
96
+ }
97
+
98
+ &:focus-visible {
99
+ @include jkl.focus-outline;
100
+
101
+ &::after {
102
+ padding-left: 0.7em;
103
+ padding-right: 0;
104
+ }
105
+ }
106
+
107
+ &--active {
108
+ @include jkl.no-grow-bold;
109
+ }
110
+ }
111
+
112
+ .jkl-nav-link--back {
113
+ padding-right: 0;
114
+
115
+ $left-arrow-focus-margin: 0.3em; // Unngå at border ved tastaturfokus "kapper" pila
116
+ padding-left: $left-arrow-focus-margin;
117
+ margin-left: -#{$left-arrow-focus-margin};
118
+
119
+ &::after {
120
+ display: none;
121
+ }
122
+
123
+ &::before {
124
+ @include jkl.decorative($content: $_left-arrow);
125
+ @include jkl.motion;
126
+ transform: translateX(0);
127
+ transition-property: transform;
128
+ display: inline-block;
129
+ padding-right: jkl.rem(4px);
130
+ }
131
+
132
+ &:hover,
133
+ &:focus-visible {
134
+ &::before {
135
+ transform: translateX(-33%);
136
+ }
137
+ }
138
+ }
@@ -0,0 +1,26 @@
1
+ @use "sass:map";
2
+ @use "./legacy-tokens" as *;
3
+
4
+ /// @type Color
5
+ $color-focus-color: $color-granitt;
6
+
7
+ /// @type Color
8
+ $color-focus-color--darkbg: $color-snohvit;
9
+
10
+ // Varslingsfarger / Meldingsfarger.
11
+ // Kun til bruk som bakgrunn i komponenter som gir varslinger til bruker.
12
+ $_varslingsfarger: (
13
+ "suksess": var(--jkl-success),
14
+ "feil": var(--jkl-error),
15
+ "info": var(--jkl-info),
16
+ "advarsel": var(--jkl-warning),
17
+ );
18
+
19
+ /// Hent fargekoden til en navngitt varslingsfarge
20
+ /// @param {"suksess" | "feil" | "info" | "advarsel"} $farge - Navn på fargen du ønsker verdien til
21
+ /// @deprecated Bruk tokens direkte ($color-success, $color-error, $color-info, $color-warning)
22
+ /// @return {Color} - fargekoden til den ønskede fargen
23
+ /// @access private - forwardes ikke ut av modulen, men er tilgjengelig ved direkteimport. KUN FOR INTERN BRUK I JØKUL.
24
+ @function varslingsfarge($farge) {
25
+ @return map.get($_varslingsfarger, $farge);
26
+ }
@@ -0,0 +1,96 @@
1
+ @use "sass:color";
2
+ @use "sass:map";
3
+ @use "sass:math";
4
+ @use "sass:string";
5
+
6
+ /// Casts a string into a number
7
+ /// https://hugogiraudel.com/2014/01/15/sass-string-to-number/
8
+ /// @author Hugo Giraudel
9
+ /// @param {String | Number} $value - Value to be parsed
10
+ /// @return {Number} - $value converted to a number
11
+ @function to-number($value) {
12
+ @if type-of($value) == "number" {
13
+ @return $value;
14
+ } @else if type-of($value) != "string" {
15
+ @warn "Value for `to-number` should be a number or a string.";
16
+ }
17
+
18
+ $result: 0;
19
+ $digits: 0;
20
+ $minus: string.slice($value, 1, 1) == "-";
21
+ $numbers: (
22
+ "0": 0,
23
+ "1": 1,
24
+ "2": 2,
25
+ "3": 3,
26
+ "4": 4,
27
+ "5": 5,
28
+ "6": 6,
29
+ "7": 7,
30
+ "8": 8,
31
+ "9": 9,
32
+ );
33
+
34
+ @for $i from if($minus, 2, 1) through str-length($value) {
35
+ $character: string.slice($value, $i, $i);
36
+
37
+ @if not(index(map.keys($numbers), $character) or $character == ".") {
38
+ @return to-length(if($minus, -$result, $result), string.slice($value, $i));
39
+ }
40
+
41
+ @if $character == "." {
42
+ $digits: 1;
43
+ } @else if $digits == 0 {
44
+ $result: $result * 10 + map.get($numbers, $character);
45
+ } @else {
46
+ $digits: $digits * 10;
47
+ $result: $result + math.div(map.get($numbers, $character), $digits);
48
+ }
49
+ }
50
+
51
+ @return if($minus, -$result, $result);
52
+ }
53
+
54
+ /// Add `$unit` to `$value`
55
+ /// @param {Number} $value - Value to add unit to
56
+ /// @param {String} $unit - String representation of the unit
57
+ /// @return {Number} - `$value` expressed in `$unit`
58
+ @function to-length($value, $unit) {
59
+ $units: (
60
+ "px": 1px,
61
+ "cm": 1cm,
62
+ "mm": 1mm,
63
+ "%": 1%,
64
+ "ch": 1ch,
65
+ "pc": 1pc,
66
+ "in": 1in,
67
+ "em": 1em,
68
+ "rem": 1rem,
69
+ "pt": 1pt,
70
+ "ex": 1ex,
71
+ "vw": 1vw,
72
+ "vh": 1vh,
73
+ "vmin": 1vmin,
74
+ "vmax": 1vmax,
75
+ );
76
+
77
+ @if not index(map.keys($units), $unit) {
78
+ @warn "Invalid unit `#{$unit}`.";
79
+ }
80
+
81
+ @return $value * map.get($units, $unit);
82
+ }
83
+
84
+ /// Gjør en fargeverdi URL-safe, for eksempel til bruk i inline SVG
85
+ /// @param {Color} $color - Sass fargetype. Kan være HEX, hsl, hsla, rgb eller rgba.
86
+ /// @return {String} - input konvertert til en URL-safe HEX-verdi
87
+ @function urlencodecolor($color) {
88
+ @if type-of($color) == "color" and str-index(#{$color}, "#") == 1 {
89
+ $hex: string.slice(color.ie-hex-str($color), 4);
90
+ $converted-color: string.unquote("#{$hex}");
91
+
92
+ @return "%23" + $converted-color;
93
+ }
94
+
95
+ @return $color;
96
+ }
@@ -0,0 +1,20 @@
1
+ /// Gjør flexbox litt mindre verbos. Setter display: flex; med gitt align-items og justify-content.
2
+ /// @param {String} $align-items [center] – settes på align-items
3
+ /// @param {String} $justify-content [center] – settes på justify-content
4
+ /// @output display: flex og angitt align-items og justify-content
5
+ @mixin flex($align-items: center, $justify-content: center) {
6
+ display: flex;
7
+ align-items: $align-items;
8
+ justify-content: $justify-content;
9
+ }
10
+
11
+ /// Samle alt som har med posisjonering å gjøre i én mixin. Alle parameternavn matcher CSS-attributtet.
12
+ /// @param {String} $position
13
+ /// @param {String} $top [initial]
14
+ /// @param {String} $left [initial]
15
+ /// @param {String} $right [initial]
16
+ /// @param {String} $bottom [initial]
17
+ @mixin position($position, $top: initial, $left: initial, $right: initial, $bottom: initial) {
18
+ position: $position;
19
+ inset: $top $right $bottom $left;
20
+ }
@@ -0,0 +1,18 @@
1
+ @forward "colors" hide varslingsfarge;
2
+ @forward "convert";
3
+ @forward "helpers";
4
+ @forward "motion";
5
+ @forward "navigation";
6
+ @forward "ornaments";
7
+ @forward "reset";
8
+ @forward "responsive-units";
9
+ @forward "screenreader";
10
+ @forward "screens";
11
+ @forward "shadows";
12
+ @forward "spacing" hide $spacing, $combinations, $positions;
13
+ @forward "theme";
14
+ @forward "tokens";
15
+ @forward "legacy-tokens";
16
+ @forward "typography" hide $text-styles;
17
+ @forward "underline";
18
+ @forward "z-index";
@@ -0,0 +1,22 @@
1
+ // Do not edit directly
2
+ // Generated on Tue, 10 Sep 2024 05:21:22 GMT
3
+
4
+ $color-svart: #000000;
5
+ $color-granitt: #1b1917;
6
+ $color-skifer: #313030;
7
+ $color-fjellgra: #444141;
8
+ $color-stein: #636060;
9
+ $color-svaberg: #c8c5c3;
10
+ $color-varde: #e0dbd4;
11
+ $color-dis: #ece9e5;
12
+ $color-sand: #f4f2ef;
13
+ $color-snohvit: #f9f9f9;
14
+ $color-hvit: #ffffff;
15
+ $color-suksess: #acd3b5;
16
+ $color-suksess-dark: #94b79b;
17
+ $color-feil: #f6b3b3;
18
+ $color-feil-dark: #de9e9e;
19
+ $color-info: #d3d3f6;
20
+ $color-info-dark: #a9a9ca;
21
+ $color-advarsel: #efdd9e;
22
+ $color-advarsel-dark: #decc8d;
@@ -0,0 +1,62 @@
1
+ @use "sass:map";
2
+ @use "sass:list";
3
+
4
+ // Oppdater verdier i motion.ts også
5
+ $_easings: (
6
+ "standard": ease,
7
+ "entrance": ease-out,
8
+ "exit": ease-in,
9
+ "easeInBounceOut": cubic-bezier(0, 0, 0.375, 1.17),
10
+ "focus": cubic-bezier(0.6, 0.2, 0.35, 1),
11
+ );
12
+
13
+ /// Hent en easing til bruk i animasjoner. Se også `timing`-funksjonen og `motion`-mixinen.
14
+ /// @param {"standard" | "entrance" | "exit" | "easeInBounceOut" | "focus"} $name - Navn på easingen du ønsker verdien til
15
+ /// @return {String} - easingverdi til bruk i animasjoner
16
+ /// @see timing
17
+ /// @see motion
18
+ @function easing($name, $easings: $_easings) {
19
+ @if map.has-key($easings, $name) {
20
+ @return map.get($easings, $name);
21
+ } @else {
22
+ @error 'Unable to find an easing named #{$name} in our supported easings.';
23
+ }
24
+ }
25
+
26
+ // Oppdater verdier i motion.ts også
27
+ $_timings: (
28
+ "energetic": 75ms,
29
+ "snappy": 100ms,
30
+ "productive": 150ms,
31
+ "polite": 200ms,
32
+ "expressive": 250ms,
33
+ "lazy": 400ms,
34
+ );
35
+
36
+ /// Hent en timing til bruk i animasjoner. Se også `easing`-funksjonen og `motion`-mixinen.
37
+ /// @param {"energetic" | "snappy" | "productive" | "expressive" | "lazy"} $mode - Navn på timingen du ønsker verdien til
38
+ /// @return {String} - timingverdi til bruk i animasjoner
39
+ /// @see easing
40
+ /// @see motion
41
+ @function timing($mode, $timings: $_timings) {
42
+ @if map.has-key($timings, $mode) {
43
+ @return map.get($timings, $mode);
44
+ } @else {
45
+ @error 'Unable to find a timing named #{$mode} in our supported timings';
46
+ }
47
+ }
48
+
49
+ /// Setter transition-timing-function og transition-duration, for bruk i animasjoner.
50
+ /// Se også `timing`- og `easing`-funksjonene.
51
+ /// @param {"standard" | "entrance" | "exit" | "easeInBounceOut" | "focus"} $name [standard] - Navn på easingen du ønsker verdien til
52
+ /// @param {"energetic" | "snappy" | "productive" | "expressive" | "lazy"} $mode [productive] - Navn på timingen du ønsker verdien til
53
+ /// @param $properties - Kommaseparert liste over egenskapene du ønsker å animere
54
+ /// @see easing
55
+ /// @see timing
56
+ @mixin motion($name: "standard", $mode: "productive", $properties...) {
57
+ transition-timing-function: easing($name);
58
+ transition-duration: timing($mode);
59
+ @if list.length($properties) > 0 {
60
+ transition-property: $properties;
61
+ }
62
+ }
@@ -0,0 +1,9 @@
1
+ /// Brukes for CSS som skal gjelde bare ved tastaturnavigasjon.
2
+ /// Brukes typisk til ekstra tydelige fokus-stiler. Krever at
3
+ /// `initTabListener()` fra core er kjørt. Se README til core.
4
+ /// @content Innholdet plasseres i en selector som bare matcher dersom vi _ikke_ har data-mousenavigation eller data-touchnavigation på html-elementet.
5
+ @mixin keyboard-navigation {
6
+ @at-root html:not([data-mousenavigation]):not([data-touchnavigation]) #{&} {
7
+ @content;
8
+ }
9
+ }
@@ -0,0 +1,26 @@
1
+ @use "motion";
2
+
3
+ @mixin chevron($size, $color, $weight: 0.125rem, $rotate: 0, $state: closed) {
4
+ box-sizing: border-box;
5
+ width: $size;
6
+ height: $size;
7
+
8
+ transform-origin: 26.33% 73.66%; // places origin in center of chevron
9
+ transform: rotate((-45 + $rotate) * 1deg); // default orientation is pointing down
10
+
11
+ border-left: $weight solid $color;
12
+ border-bottom: $weight solid $color;
13
+ transition: transform motion.timing("lazy") ease;
14
+ }
15
+
16
+ @mixin decorative($content) {
17
+ // Detaljer finnes her: https://github.com/fremtind/jokul/issues/2774#issuecomment-1056575107
18
+ content: $content; // Fallback for nettlesere som ikke støtter ny syntaks (Firefox, Safari)
19
+ content: $content / ""; // Tom alternativ tekst
20
+ alt: " "; // WebKit-alternativ, fases ut når varianten fra speccen er støttet
21
+ }
22
+
23
+ @mixin focus-outline($offset: 2px, $thickness: 2px) {
24
+ outline: $thickness solid var(--jkl-color-border-action);
25
+ outline-offset: $offset;
26
+ }
@@ -0,0 +1,43 @@
1
+ @use "theme";
2
+
3
+ /// En omfattende reset for alt av outlines og borders på interaktive elementer
4
+ @mixin reset-outline {
5
+ outline: 0;
6
+ border-style: none;
7
+ outline-style: none;
8
+
9
+ &:active,
10
+ &:hover,
11
+ &:focus {
12
+ outline: 0;
13
+ outline-style: none;
14
+ }
15
+
16
+ // Reset alt som er gjort over hvis brukeren har på forced-colors.
17
+ // Da mister vi box-shadow og er avhengig av at borders og outlines synes.
18
+ @include theme.forced-colors-mode {
19
+ outline: revert;
20
+ border-style: revert;
21
+ outline-style: revert;
22
+
23
+ &:active,
24
+ &:hover,
25
+ &:focus {
26
+ outline: revert;
27
+ outline-style: revert;
28
+ }
29
+ }
30
+ }
31
+
32
+ /// Removes increment and decrement buttons
33
+ /// for number input fields.
34
+ @mixin remove-inner-outer-button {
35
+ input[type="number"]::-webkit-outer-spin-button,
36
+ input[type="number"]::-webkit-inner-spin-button {
37
+ -webkit-appearance: none;
38
+ }
39
+
40
+ input[type="number"] {
41
+ -moz-appearance: textfield;
42
+ }
43
+ }
@@ -0,0 +1,30 @@
1
+ @use "sass:math";
2
+ @use "convert";
3
+
4
+ /// Kalkuler riktig rem-verdi basert på en gitt pixelverdi
5
+ /// @param {Number} $px-size - Pixelverdi, helst med unit
6
+ /// @return {Number} - Pixelverdien konvertert til rem
7
+ /// @example
8
+ /// jkl.rem(16px);
9
+ @function rem($px-size) {
10
+ @if $px-size == 0 {
11
+ @return 0;
12
+ }
13
+ $rem-size: math.div($px-size, 16px);
14
+ // Default font size on html element is 100%, equivalent to 16px;
15
+ @return convert.to-number(#{$rem-size}rem);
16
+ }
17
+
18
+ /// Calculate a responsive size value relative to a given screen size
19
+ /// Will return a CSS rule that corresponds to the given pixel size at
20
+ /// the given screen size and scales with changes in screen size
21
+ /// @param {Number} $px-size - Size to calculate from, in px without unit
22
+ /// @param {Number} $screen-width - Screen width to calculate from, in px without unit, default 1400
23
+ /// @param {Number} $screen-height - Screen height to calculate from, in px without unit, default 900
24
+ /// @return {Number} - Input expressed as a responsive value
25
+ @function relative-size($px-size, $screen-width: 1400, $screen-height: 900) {
26
+ $hor-size: math.div($px-size, $screen-width) * 100 * 1vw;
27
+ $ver-size: math.div($px-size, $screen-height) * 100 * 1vh;
28
+
29
+ @return min(#{$hor-size}, #{$ver-size});
30
+ }