@helsenorge/designsystem-react 4.3.0 → 4.4.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 (125) hide show
  1. package/CHANGELOG.md +28 -3
  2. package/Close.js +1 -1
  3. package/Close.js.map +1 -1
  4. package/ListHeader.js +1 -1
  5. package/ListHeader.js.map +1 -1
  6. package/Panel.js +1 -1
  7. package/Panel.js.map +1 -1
  8. package/Table.js +1 -1
  9. package/Table.js.map +1 -1
  10. package/TableBody.js +1 -1
  11. package/TableBody.js.map +1 -1
  12. package/TableExpandedRow.js +1 -1
  13. package/TableExpandedRow.js.map +1 -1
  14. package/TableHead.js +1 -1
  15. package/TableHead.js.map +1 -1
  16. package/TableRow.js +1 -1
  17. package/TableRow.js.map +1 -1
  18. package/Textarea.js +1 -1
  19. package/Textarea.js.map +1 -1
  20. package/Trigger.js +2 -0
  21. package/Trigger.js.map +1 -0
  22. package/components/AnchorLink/index.js +1 -1
  23. package/components/Button/index.js +1 -1
  24. package/components/ButtonWithModal/index.js +1 -1
  25. package/components/ButtonWithModal/index.js.map +1 -1
  26. package/components/Checkbox/styles.module.scss +13 -0
  27. package/components/Close/Close.d.ts +0 -2
  28. package/components/Close/Close.d.ts.map +1 -1
  29. package/components/Close/componentdata.json +1 -1
  30. package/components/Close/index.js +1 -1
  31. package/components/Dropdown/index.js +1 -1
  32. package/components/Dropdown/index.js.map +1 -1
  33. package/components/Dropdown/styles.module.scss +1 -0
  34. package/components/Expander/index.js +1 -1
  35. package/components/Expander/index.js.map +1 -1
  36. package/components/ExpanderHierarchy/ExpanderButton.d.ts.map +1 -1
  37. package/components/ExpanderHierarchy/expander.module.scss +14 -7
  38. package/components/ExpanderHierarchy/expander.module.scss.d.ts +2 -0
  39. package/components/ExpanderHierarchy/index.js +1 -1
  40. package/components/ExpanderHierarchy/index.js.map +1 -1
  41. package/components/ExpanderList/index.js +1 -1
  42. package/components/ExpanderList/index.js.map +1 -1
  43. package/components/FormExample/index.js +1 -1
  44. package/components/HelpBubble/index.js +1 -1
  45. package/components/HelpBubbleExample/index.js +1 -1
  46. package/components/HelpBubbleExample/index.js.map +1 -1
  47. package/components/HelpQuestion/HelpQuestion.d.ts +22 -0
  48. package/components/HelpQuestion/HelpQuestion.d.ts.map +1 -0
  49. package/components/HelpQuestion/componentdata.json +1 -0
  50. package/components/HelpQuestion/index.d.ts +4 -0
  51. package/components/HelpQuestion/index.d.ts.map +1 -0
  52. package/components/HelpQuestion/index.js +2 -0
  53. package/components/HelpQuestion/index.js.map +1 -0
  54. package/components/HelpQuestion/styles.module.scss +49 -0
  55. package/components/HelpQuestion/styles.module.scss.d.ts +10 -0
  56. package/components/Label/componentdata.json +1 -1
  57. package/components/LinkList/index.js +1 -1
  58. package/components/Logo/Logo.d.ts +2 -2
  59. package/components/Logo/Logo.d.ts.map +1 -1
  60. package/components/Logo/componentdata.json +1 -1
  61. package/components/Logo/index.js +1 -1
  62. package/components/Logo/index.js.map +1 -1
  63. package/components/Modal/index.js +1 -1
  64. package/components/Modal/styles.module.scss +1 -0
  65. package/components/NotificationPanel/index.js +1 -1
  66. package/components/NotificationPanel/index.js.map +1 -1
  67. package/components/Panel/Panel.d.ts +2 -2
  68. package/components/Panel/Panel.d.ts.map +1 -1
  69. package/components/Panel/componentdata.json +1 -1
  70. package/components/Panel/index.js +1 -1
  71. package/components/Panel/styles.module.scss +1 -0
  72. package/components/PanelList/index.js +1 -1
  73. package/components/PanelList/index.js.map +1 -1
  74. package/components/PopMenu/PopMenu.d.ts.map +1 -1
  75. package/components/PopMenu/index.js +1 -1
  76. package/components/PopMenu/index.js.map +1 -1
  77. package/components/RadioButton/styles.module.scss +13 -0
  78. package/components/ServiceMessage/ServiceMessage.d.ts +6 -3
  79. package/components/ServiceMessage/ServiceMessage.d.ts.map +1 -1
  80. package/components/ServiceMessage/componentdata.json +1 -1
  81. package/components/ServiceMessage/index.js +1 -1
  82. package/components/ServiceMessage/index.js.map +1 -1
  83. package/components/ServiceMessage/styles.module.scss +139 -238
  84. package/components/ServiceMessage/styles.module.scss.d.ts +17 -34
  85. package/components/Step/Step.d.ts +2 -0
  86. package/components/Step/Step.d.ts.map +1 -1
  87. package/components/Step/componentdata.json +1 -1
  88. package/components/Step/index.js +1 -1
  89. package/components/Step/index.js.map +1 -1
  90. package/components/Step/styles.module.scss +23 -1
  91. package/components/Step/styles.module.scss.d.ts +5 -1
  92. package/components/Table/TableExpandedRow/TableExpandedRow.d.ts +3 -1
  93. package/components/Table/TableExpandedRow/TableExpandedRow.d.ts.map +1 -1
  94. package/components/Table/TableExpandedRow/componentdata.json +1 -1
  95. package/components/Table/TableExpandedRow/index.js +1 -1
  96. package/components/Table/TableExpanderCell/index.js +1 -1
  97. package/components/Table/TableRow/index.js +1 -1
  98. package/components/Table/index.js +1 -1
  99. package/components/Tag/index.js +1 -1
  100. package/components/Tag/index.js.map +1 -1
  101. package/components/Tile/index.js +1 -1
  102. package/components/Tile/index.js.map +1 -1
  103. package/components/Tooltip/index.js +1 -1
  104. package/components/TooltipExample/index.js +1 -1
  105. package/components/TooltipExample/index.js.map +1 -1
  106. package/components/Trigger/Trigger.d.ts +9 -0
  107. package/components/Trigger/Trigger.d.ts.map +1 -1
  108. package/components/Trigger/componentdata.json +1 -1
  109. package/components/Trigger/index.js +1 -1
  110. package/components/Trigger/index.js.map +1 -1
  111. package/components/Trigger/styles.module.scss +23 -20
  112. package/components/Trigger/styles.module.scss.d.ts +2 -0
  113. package/constants.d.ts +4 -3
  114. package/constants.d.ts.map +1 -1
  115. package/constants.js +1 -1
  116. package/constants.js.map +1 -1
  117. package/hooks/useHover.d.ts.map +1 -1
  118. package/hooks/useHover.js +1 -1
  119. package/hooks/useHover.js.map +1 -1
  120. package/hooks/useSticky.d.ts +5 -4
  121. package/hooks/useSticky.d.ts.map +1 -1
  122. package/hooks/useSticky.js +1 -1
  123. package/hooks/useSticky.js.map +1 -1
  124. package/index.js +1 -1
  125. package/package.json +4 -1
@@ -1 +1 @@
1
- {"version":3,"file":"useSticky.d.ts","sourceRoot":"","sources":["../../src/hooks/useSticky.ts"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,UAAU,oBAAoB;IAC5B,6CAA6C;IAC7C,eAAe,EAAE,OAAO,CAAC;IACzB,+CAA+C;IAC/C,eAAe,EAAE,OAAO,CAAC;IACzB,6CAA6C;IAC7C,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,qCAAqC;IACrC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AACD;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,eAAgB,MAAM,SAAS,CAAC,WAAW,CAAC,aAAa,MAAM,SAAS,CAAC,WAAW,CAAC,KAAG,oBAsB7G,CAAC"}
1
+ {"version":3,"file":"useSticky.d.ts","sourceRoot":"","sources":["../../src/hooks/useSticky.ts"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,UAAU,qBAAqB;IAC7B,0DAA0D;IAC1D,eAAe,EAAE,OAAO,CAAC;IACzB,oFAAoF;IACpF,eAAe,EAAE,OAAO,CAAC;IACzB,6CAA6C;IAC7C,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,qCAAqC;IACrC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,eACR,MAAM,SAAS,CAAC,WAAW,CAAC,aAC7B,MAAM,SAAS,CAAC,WAAW,CAAC,mBACvB,KAAK,GAAG,QAAQ,KAC/B,qBAuBF,CAAC"}
@@ -1,2 +1,2 @@
1
- import{useState as t}from"react";import{useLayoutEvent as O}from"./useLayoutEvent.js";import"../utils/debounce.js";const E=(i,s)=>{const[c,d]=t(!1),[h,r]=t(!1),[u,a]=t(),[f,g]=t();return O(()=>{var n,o;const{top:l=0,width:m=0,bottom:C=0}=((n=i.current)==null?void 0:n.getBoundingClientRect())||{},e=((o=s.current)==null?void 0:o.getBoundingClientRect().height)??0;d(l<=0),r(C<=e),g(m),a(e)},["resize","scroll"]),{isOutsideWindow:c,isLeavingWindow:h,offsetHeight:u,contentWidth:f}};export{E as useSticky};
1
+ import{useState as t}from"react";import{useLayoutEvent as C}from"./useLayoutEvent.js";import"../utils/debounce.js";const L=(s,c,d="top")=>{const[h,r]=t(!1),[g,u]=t(!1),[a,f]=t(),[l,m]=t();return C(()=>{var o,i;const{top:p=0,width:w=0,bottom:e=0}=((o=s.current)==null?void 0:o.getBoundingClientRect())||{},n=((i=c.current)==null?void 0:i.getBoundingClientRect().height)??0;r(d==="top"?p<=0:e>window.innerHeight),u(e<=n),m(w),f(n)},["resize","scroll"]),{isOutsideWindow:h,isLeavingWindow:g,offsetHeight:a,contentWidth:l}};export{L as useSticky};
2
2
  //# sourceMappingURL=useSticky.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSticky.js","sources":["../../src/hooks/useSticky.ts"],"sourcesContent":["import React, { useState } from 'react';\n\nimport { useLayoutEvent } from './useLayoutEvent';\n\ninterface UseStickReturnValues {\n /** Toppen av elementet er utenfor vinduet */\n isOutsideWindow: boolean;\n /** Innholdet er på vei helt ut av vinduet */\n isLeavingWindow: boolean;\n /** Høyde på det sticky elementet i pixler */\n offsetHeight: number | undefined;\n /** Bredden til innholdet i pixler */\n contentWidth: number | undefined;\n}\n/**\n * Sett et element til sticky hvis et annet element er delvis utenfor vinduet\n *\n * @param contentRef Element som sjekkes om det er utenfor eller innenfor vinduet\n * @param stickyRef Element som skal bli sticky\n * @returns Properties som kan brukes til å sette elementet sticky eller absolute\n */\nexport const useSticky = (contentRef: React.RefObject<HTMLElement>, stickyRef: React.RefObject<HTMLElement>): UseStickReturnValues => {\n const [isOutsideWindow, setIsOutsideWindow] = useState<boolean>(false);\n const [isLeavingWindow, setIsLeavingWindow] = useState<boolean>(false);\n const [offsetHeight, setOffsetHeight] = useState<number>();\n const [contentWidth, setContentWidth] = useState<number>();\n\n const handleLayoutChange = () => {\n const {\n top: topOfContentElement = 0,\n width: widthOfContentElement = 0,\n bottom: bottomOfContentElement = 0,\n } = contentRef.current?.getBoundingClientRect() || {};\n const heightOfStickyElement = stickyRef.current?.getBoundingClientRect().height ?? 0;\n setIsOutsideWindow(topOfContentElement <= 0);\n setIsLeavingWindow(bottomOfContentElement <= heightOfStickyElement);\n setContentWidth(widthOfContentElement);\n setOffsetHeight(heightOfStickyElement);\n };\n\n useLayoutEvent(handleLayoutChange, ['resize', 'scroll']);\n\n return { isOutsideWindow, isLeavingWindow, offsetHeight, contentWidth };\n};\n"],"names":["useSticky","contentRef","stickyRef","isOutsideWindow","setIsOutsideWindow","useState","isLeavingWindow","setIsLeavingWindow","offsetHeight","setOffsetHeight","contentWidth","setContentWidth","useLayoutEvent","topOfContentElement","widthOfContentElement","bottomOfContentElement","_a","heightOfStickyElement","_b"],"mappings":"mHAqBa,MAAAA,EAAY,CAACC,EAA0CC,IAAkE,CACpI,KAAM,CAACC,EAAiBC,CAAkB,EAAIC,EAAkB,EAAK,EAC/D,CAACC,EAAiBC,CAAkB,EAAIF,EAAkB,EAAK,EAC/D,CAACG,EAAcC,CAAe,EAAIJ,EAAiB,EACnD,CAACK,EAAcC,CAAe,EAAIN,EAAiB,EAezD,OAAAO,EAb2B,IAAM,SACzB,KAAA,CACJ,IAAKC,EAAsB,EAC3B,MAAOC,EAAwB,EAC/B,OAAQC,EAAyB,CAC/B,IAAAC,EAAAf,EAAW,UAAX,YAAAe,EAAoB,0BAA2B,CAAA,EAC7CC,IAAwBC,EAAAhB,EAAU,UAAV,YAAAgB,EAAmB,wBAAwB,SAAU,EACnFd,EAAmBS,GAAuB,CAAC,EAC3CN,EAAmBQ,GAA0BE,CAAqB,EAClEN,EAAgBG,CAAqB,EACrCL,EAAgBQ,CAAqB,CAAA,EAGJ,CAAC,SAAU,QAAQ,CAAC,EAEhD,CAAE,gBAAAd,EAAiB,gBAAAG,EAAiB,aAAAE,EAAc,aAAAE,CAAa,CACxE"}
1
+ {"version":3,"file":"useSticky.js","sources":["../../src/hooks/useSticky.ts"],"sourcesContent":["import React, { useState } from 'react';\n\nimport { useLayoutEvent } from './useLayoutEvent';\n\ninterface UseStickyReturnValues {\n /** Toppen eller bunnen av elementet er utenfor vinduet */\n isOutsideWindow: boolean;\n /** Innholdet er på vei helt ut av vinduet. Fungerer bare med stickyPosition=top. */\n isLeavingWindow: boolean;\n /** Høyde på det sticky elementet i pixler */\n offsetHeight: number | undefined;\n /** Bredden til innholdet i pixler */\n contentWidth: number | undefined;\n}\n\n/**\n * Sett et element til sticky hvis et annet element er delvis utenfor vinduet\n *\n * @param contentRef Element som sjekkes om det er utenfor eller innenfor vinduet\n * @param stickyRef Element som skal bli sticky\n * @param stickyPosition Om det sticky elementet er ment å vises øverst eller nederst på skjermen. Default: top\n * @returns Properties som kan brukes til å sette elementet sticky eller absolute\n */\nexport const useSticky = (\n contentRef: React.RefObject<HTMLElement>,\n stickyRef: React.RefObject<HTMLElement>,\n stickyPosition: 'top' | 'bottom' = 'top'\n): UseStickyReturnValues => {\n const [isOutsideWindow, setIsOutsideWindow] = useState<boolean>(false);\n const [isLeavingWindow, setIsLeavingWindow] = useState<boolean>(false);\n const [offsetHeight, setOffsetHeight] = useState<number>();\n const [contentWidth, setContentWidth] = useState<number>();\n\n const handleLayoutChange = (): void => {\n const {\n top: topOfContentElement = 0,\n width: widthOfContentElement = 0,\n bottom: bottomOfContentElement = 0,\n } = contentRef.current?.getBoundingClientRect() || {};\n const heightOfStickyElement = stickyRef.current?.getBoundingClientRect().height ?? 0;\n setIsOutsideWindow(stickyPosition === 'top' ? topOfContentElement <= 0 : bottomOfContentElement > window.innerHeight);\n\n setIsLeavingWindow(bottomOfContentElement <= heightOfStickyElement);\n setContentWidth(widthOfContentElement);\n setOffsetHeight(heightOfStickyElement);\n };\n\n useLayoutEvent(handleLayoutChange, ['resize', 'scroll']);\n\n return { isOutsideWindow, isLeavingWindow, offsetHeight, contentWidth };\n};\n"],"names":["useSticky","contentRef","stickyRef","stickyPosition","isOutsideWindow","setIsOutsideWindow","useState","isLeavingWindow","setIsLeavingWindow","offsetHeight","setOffsetHeight","contentWidth","setContentWidth","useLayoutEvent","topOfContentElement","widthOfContentElement","bottomOfContentElement","_a","heightOfStickyElement","_b"],"mappings":"mHAuBO,MAAMA,EAAY,CACvBC,EACAC,EACAC,EAAmC,QACT,CAC1B,KAAM,CAACC,EAAiBC,CAAkB,EAAIC,EAAkB,EAAK,EAC/D,CAACC,EAAiBC,CAAkB,EAAIF,EAAkB,EAAK,EAC/D,CAACG,EAAcC,CAAe,EAAIJ,EAAiB,EACnD,CAACK,EAAcC,CAAe,EAAIN,EAAiB,EAgBzD,OAAAO,EAd2B,IAAY,SAC/B,KAAA,CACJ,IAAKC,EAAsB,EAC3B,MAAOC,EAAwB,EAC/B,OAAQC,EAAyB,CAC/B,IAAAC,EAAAhB,EAAW,UAAX,YAAAgB,EAAoB,0BAA2B,CAAA,EAC7CC,IAAwBC,EAAAjB,EAAU,UAAV,YAAAiB,EAAmB,wBAAwB,SAAU,EACnFd,EAAmBF,IAAmB,MAAQW,GAAuB,EAAIE,EAAyB,OAAO,WAAW,EAEpHR,EAAmBQ,GAA0BE,CAAqB,EAClEN,EAAgBG,CAAqB,EACrCL,EAAgBQ,CAAqB,CAAA,EAGJ,CAAC,SAAU,QAAQ,CAAC,EAEhD,CAAE,gBAAAd,EAAiB,gBAAAG,EAAiB,aAAAE,EAAc,aAAAE,CAAa,CACxE"}
package/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{theme as n}from"./theme/index.js";import{Breakpoint as d,useBreakpoint as v}from"./hooks/useBreakpoint.js";import{useFocusToggle as c}from"./hooks/useFocusToggle.js";import{useFocusTrap as I}from"./hooks/useFocusTrap.js";import{useHover as A}from"./hooks/useHover.js";import{useIntersectionObserver as g}from"./hooks/useIntersectionObserver.js";import{useIsVisible as F}from"./hooks/useIsVisible.js";import{useLayoutEvent as k}from"./hooks/useLayoutEvent.js";import{usePrevious as H}from"./hooks/usePrevious.js";import{useSticky as O}from"./hooks/useSticky.js";import{useSize as V}from"./hooks/useSize.js";import{useResizeObserver as B}from"./hooks/useResizeObserver.js";import{useToggle as P}from"./hooks/useToggle.js";import{useKeyboardEvent as D}from"./hooks/useKeyboardEvent.js";import{useOutsideEvent as L}from"./hooks/useOutsideEvent.js";import{useUuid as U}from"./hooks/useUuid.js";import{a as X}from"./uuid.js";import{AVERAGE_CHARACTER_WIDTH_PX as j,AnalyticsId as q,FormMode as w,FormVariant as J,IconSize as N,KeyboardEventKey as Q,ZIndex as Y}from"./constants.js";import"./theme/grid.js";import"./theme/palette.js";import"./theme/spacers.js";import"react";import"./hooks/useElementList.js";import"./hooks/useFocusableElements.js";import"./utils/focus.js";import"./utils/debounce.js";import"./utils/environment.js";export{j as AVERAGE_CHARACTER_WIDTH_PX,q as AnalyticsId,d as Breakpoint,w as FormMode,J as FormVariant,N as IconSize,Q as KeyboardEventKey,Y as ZIndex,n as theme,v as useBreakpoint,c as useFocusToggle,I as useFocusTrap,A as useHover,g as useIntersectionObserver,F as useIsVisible,D as useKeyboardEvent,k as useLayoutEvent,L as useOutsideEvent,H as usePrevious,B as useResizeObserver,V as useSize,O as useSticky,P as useToggle,U as useUuid,X as uuid};
1
+ import{theme as a}from"./theme/index.js";import{Breakpoint as v,useBreakpoint as E}from"./hooks/useBreakpoint.js";import{useFocusToggle as y}from"./hooks/useFocusToggle.js";import{useFocusTrap as b}from"./hooks/useFocusTrap.js";import{useHover as T}from"./hooks/useHover.js";import{useIntersectionObserver as l}from"./hooks/useIntersectionObserver.js";import{useIsVisible as R}from"./hooks/useIsVisible.js";import{useLayoutEvent as z}from"./hooks/useLayoutEvent.js";import{usePrevious as K}from"./hooks/usePrevious.js";import{useSticky as S}from"./hooks/useSticky.js";import{useSize as _}from"./hooks/useSize.js";import{useResizeObserver as C}from"./hooks/useResizeObserver.js";import{useToggle as h}from"./hooks/useToggle.js";import{useKeyboardEvent as G}from"./hooks/useKeyboardEvent.js";import{useOutsideEvent as M}from"./hooks/useOutsideEvent.js";import{useUuid as W}from"./hooks/useUuid.js";import{a as Z}from"./uuid.js";import{AVERAGE_CHARACTER_WIDTH_PX as q,AnalyticsId as w,FormMode as J,FormVariant as N,IconSize as Q,KeyboardEventKey as Y,ZIndex as $}from"./constants.js";import"./theme/grid.js";import"./theme/palette.js";import"./theme/spacers.js";import"react";import"./hooks/useElementList.js";import"./hooks/useFocusableElements.js";import"./utils/focus.js";import"./hooks/usePseudoClasses.js";import"./utils/debounce.js";import"./utils/environment.js";export{q as AVERAGE_CHARACTER_WIDTH_PX,w as AnalyticsId,v as Breakpoint,J as FormMode,N as FormVariant,Q as IconSize,Y as KeyboardEventKey,$ as ZIndex,a as theme,E as useBreakpoint,y as useFocusToggle,b as useFocusTrap,T as useHover,l as useIntersectionObserver,R as useIsVisible,G as useKeyboardEvent,z as useLayoutEvent,M as useOutsideEvent,K as usePrevious,C as useResizeObserver,_ as useSize,S as useSticky,h as useToggle,W as useUuid,Z as uuid};
2
2
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -7,9 +7,12 @@
7
7
  "url": "https://github.com/helsenorge/designsystem"
8
8
  },
9
9
  "homepage": "https://helsenorge.design",
10
- "version": "4.3.0",
10
+ "version": "4.4.0",
11
11
  "author": "Helsenorge",
12
12
  "license": "MIT",
13
+ "dependencies": {
14
+ "storybook-addon-html-validator": "^0.0.12"
15
+ },
13
16
  "peerDependencies": {
14
17
  "bootstrap": "^4.6.2",
15
18
  "classnames": "^2.3.2",