@helsenorge/designsystem-react 1.0.0-beta131 → 1.0.0-beta132

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.
@@ -1,2 +1,2 @@
1
- import{_ as e}from"../../_rollupPluginBabelHelpers-0f007973.js";import t,{useState as a,useRef as r,useEffect as n}from"react";import{I as o}from"../../Icon-a7d7e9bc.js";import{Z as s,A as i,I as d}from"../../constants-088e1d4a.js";import{u as c}from"../../useHover-b995a0e6.js";import{u as l}from"../../usePrevious-ae293b10.js";import p from"./styles.module.scss";import{c as m}from"../../index-d1c0552c.js";import{C as _}from"../../ChevronDown-43493477.js";import{C as u}from"../../ChevronUp-9eb92084.js";import{B as x}from"../../Button-1352276a.js";import{a as f}from"../../useSticky-abffc922.js";import"../../_tslib-b219470a.js";import"../../color-e7d082c1.js";import"../../index-d1c9177a.js";import"../../palette-f206f488.js";import"../../grid-c105cad1.js";import"../../Loader-bef282a3.js";import"../../uuid-11037462.js";import"../Loader/styles.module.scss";import"../../useBreakpoint-a74f5af5.js";import"../Button/styles.module.scss";var g;!function(e){e.small="small",e.large="large"}(g||(g={}));var v=function(v){var b=v.title,j=v.children,E=v.size,y=void 0===E?g.small:E,I=v.color,h=v.svgIcon,k=v.expanded,N=void 0!==k&&k,C=v.noNestedLine,H=void 0!==C&&C,z=v.sticky,B=void 0!==z&&z,w=v.testId,L=v.onExpand,S=a(N),W=e(S,2),X=W[0],P=W[1],T=l(X),A=r(null),D=r(null),O=r(null),U=c(D).isHovered,Z=f(A,D),q=Z.isOutsideWindow,F=Z.isLeavingWindow,G=Z.offsetHeight,J=Z.contentWidth,K=B&&X&&q;n((function(){N!==X&&P(N)}),[N]),n((function(){L&&X!==!!T&&L(X)}),[X,L]);var M=function(e){return t.createElement("span",{className:m(p.expander__icon,p["expander__icon--".concat(e)])},t.createElement(o,{svgIcon:X?u:_,size:d.XSmall,isHovered:U}))},Q=m(p.expander__trigger,p["expander__trigger--".concat(y)],y===g.large&&p["expander__trigger--".concat(I||"neutral")],y===g.large&&h&&p["expander__trigger--icon"],X&&p["expander__trigger--expanded"],K&&!F&&p["expander__trigger--sticky"],K&&F&&p["expander__trigger--absolute"]),R=m(p.expander__button,X&&p["expander__button--expanded"],K&&!F&&p["expander__button--sticky"],K&&F&&p["expander__button--absolute"]),V=m(p.expander__content,p["expander__content--".concat(y)],y===g.large&&p["expander__content--".concat(I||"neutral")],y===g.large&&h&&p["expander__content--icon"],X&&p["expander__content--expanded"],y===g.small&&!H&&p["expander__content--nested-line"]);return t.createElement("div",{className:p.expander,ref:A,style:{paddingTop:K&&G?"".concat(G,"px"):void 0}},y===g.large?t.createElement("button",{type:"button",className:Q,style:{zIndex:U||K?s.ExpanderTrigger:void 0,width:K&&J?"".concat(J,"px"):void 0},"aria-expanded":X,ref:D,onClick:function(){return P(!X)},"data-testid":w,"data-analyticsid":i.Expander},y===g.small&&M("left"),h&&t.createElement("span",{className:m(p.expander__icon,p["expander__icon--left"])},t.createElement(o,{svgIcon:h,size:d.XSmall,isHovered:U})),b,y===g.large&&M("right")):t.createElement(x,{variant:"borderless",className:R,"aria-expanded":X,ref:D,onClick:function(){return P(!X)},testId:w,"data-analyticsid":i.Expander},t.createElement(o,{svgIcon:X?u:_,size:d.XSmall}),b),t.createElement("div",{className:V,ref:O},j))};export{g as ExpanderSize,v as default};
1
+ import{_ as e}from"../../_rollupPluginBabelHelpers-0f007973.js";import t,{useState as a,useRef as r,useEffect as n}from"react";import{I as o}from"../../Icon-a7d7e9bc.js";import{Z as s,A as i,I as d}from"../../constants-088e1d4a.js";import{u as c}from"../../useHover-b995a0e6.js";import{u as l}from"../../usePrevious-ae293b10.js";import p from"./styles.module.scss";import{c as m}from"../../index-d1c0552c.js";import{C as _}from"../../ChevronDown-43493477.js";import{C as u}from"../../ChevronUp-9eb92084.js";import{B as x}from"../../Button-1352276a.js";import{a as f}from"../../useSticky-445a0370.js";import"../../_tslib-b219470a.js";import"../../color-e7d082c1.js";import"../../index-d1c9177a.js";import"../../palette-f206f488.js";import"../../grid-c105cad1.js";import"../../Loader-bef282a3.js";import"../../uuid-11037462.js";import"../Loader/styles.module.scss";import"../../useBreakpoint-a74f5af5.js";import"../Button/styles.module.scss";var g;!function(e){e.small="small",e.large="large"}(g||(g={}));var v=function(v){var j=v.title,b=v.children,E=v.size,y=void 0===E?g.small:E,I=v.color,h=v.svgIcon,k=v.expanded,N=void 0!==k&&k,C=v.noNestedLine,H=void 0!==C&&C,z=v.sticky,B=void 0!==z&&z,w=v.testId,L=v.onExpand,S=a(N),W=e(S,2),X=W[0],P=W[1],T=l(X),A=r(null),D=r(null),O=r(null),U=c(D).isHovered,Z=f(A,D),q=Z.isOutsideWindow,F=Z.isLeavingWindow,G=Z.offsetHeight,J=Z.contentWidth,K=B&&X&&q;n((function(){N!==X&&P(N)}),[N]),n((function(){L&&X!==!!T&&L(X)}),[X,L]);var M=function(e){return t.createElement("span",{className:m(p.expander__icon,p["expander__icon--".concat(e)])},t.createElement(o,{svgIcon:X?u:_,size:d.XSmall,isHovered:U}))},Q=m(p.expander__trigger,p["expander__trigger--".concat(y)],y===g.large&&p["expander__trigger--".concat(I||"neutral")],y===g.large&&h&&p["expander__trigger--icon"],X&&p["expander__trigger--expanded"],K&&!F&&p["expander__trigger--sticky"],K&&F&&p["expander__trigger--absolute"]),R=m(p.expander__button,X&&p["expander__button--expanded"],K&&!F&&p["expander__button--sticky"],K&&F&&p["expander__button--absolute"]),V=m(p.expander__content,p["expander__content--".concat(y)],y===g.large&&p["expander__content--".concat(I||"neutral")],y===g.large&&h&&p["expander__content--icon"],X&&p["expander__content--expanded"],y===g.small&&!H&&p["expander__content--nested-line"]);return t.createElement("div",{className:p.expander,ref:A,style:{paddingTop:K&&G?"".concat(G,"px"):void 0}},y===g.large?t.createElement("button",{type:"button",className:Q,style:{zIndex:U||K?s.ExpanderTrigger:void 0,width:K&&J?"".concat(J,"px"):void 0},"aria-expanded":X,ref:D,onClick:function(){return P(!X)},"data-testid":w,"data-analyticsid":i.Expander},y===g.small&&M("left"),h&&t.createElement("span",{className:m(p.expander__icon,p["expander__icon--left"])},t.createElement(o,{svgIcon:h,size:d.XSmall,isHovered:U})),j,y===g.large&&M("right")):t.createElement(x,{variant:"borderless",className:R,"aria-expanded":X,ref:D,onClick:function(){return P(!X)},testId:w,"data-analyticsid":i.Expander},t.createElement(o,{svgIcon:X?u:_,size:d.XSmall}),j),t.createElement("div",{className:V,ref:O},b))};export{g as ExpanderSize,v as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -27,6 +27,8 @@
27
27
  }
28
28
  &__button {
29
29
  position: relative;
30
+ padding-right: getSpacer(s);
31
+
30
32
  &:hover {
31
33
  background-color: $blueberry50;
32
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useLayoutEvent.d.ts","sourceRoot":"","sources":["../../src/hooks/useLayoutEvent.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,aAAc,MAAM,IAAI,iDAalD,CAAC"}
1
+ {"version":3,"file":"useLayoutEvent.d.ts","sourceRoot":"","sources":["../../src/hooks/useLayoutEvent.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,aAAc,MAAM,IAAI,iDAclD,CAAC"}
package/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export{t as theme}from"./index-d1c9177a.js";export{B as Breakpoint,u as useBreakpoint}from"./useBreakpoint-a74f5af5.js";export{u as useFocusToggle,a as useFocusTrap,b as useIntersectionObserver,c as useIsVisible}from"./useIsVisible-bef05e5e.js";export{u as useHover}from"./useHover-b995a0e6.js";import{u as e}from"./useSticky-abffc922.js";export{u as useLayoutEvent,a as useSticky}from"./useSticky-abffc922.js";export{u as usePrevious}from"./usePrevious-ae293b10.js";import{_ as s}from"./_rollupPluginBabelHelpers-0f007973.js";import{useState as r}from"react";export{b as useKeyboardEvent,c as useOutsideEvent,u as useResizeObserver,a as useToggle}from"./useOutsideEvent-fb86686d.js";export{u as useUuid}from"./useUuid-3b1e73f2.js";export{u as uuid}from"./uuid-11037462.js";export{A as AnalyticsId,F as FormMode,a as FormVariant,I as IconSize,K as KeyboardEventKey,Z as ZIndex}from"./constants-088e1d4a.js";import"./palette-f206f488.js";import"./grid-c105cad1.js";var o=function(a){var o=r(),u=s(o,2),t=u[0],i=u[1];return e((function(){(null==a?void 0:a.current)&&i(a.current.getBoundingClientRect())})),t};export{o as useSize};
1
+ export{t as theme}from"./index-d1c9177a.js";export{B as Breakpoint,u as useBreakpoint}from"./useBreakpoint-a74f5af5.js";export{u as useFocusToggle,a as useFocusTrap,b as useIntersectionObserver,c as useIsVisible}from"./useIsVisible-bef05e5e.js";export{u as useHover}from"./useHover-b995a0e6.js";import{u as e}from"./useSticky-445a0370.js";export{u as useLayoutEvent,a as useSticky}from"./useSticky-445a0370.js";export{u as usePrevious}from"./usePrevious-ae293b10.js";import{_ as s}from"./_rollupPluginBabelHelpers-0f007973.js";import{useState as r}from"react";export{b as useKeyboardEvent,c as useOutsideEvent,u as useResizeObserver,a as useToggle}from"./useOutsideEvent-fb86686d.js";export{u as useUuid}from"./useUuid-3b1e73f2.js";export{u as uuid}from"./uuid-11037462.js";export{A as AnalyticsId,F as FormMode,a as FormVariant,I as IconSize,K as KeyboardEventKey,Z as ZIndex}from"./constants-088e1d4a.js";import"./palette-f206f488.js";import"./grid-c105cad1.js";var o=function(a){var o=r(),u=s(o,2),t=u[0],i=u[1];return e((function(){(null==a?void 0:a.current)&&i(a.current.getBoundingClientRect())})),t};export{o as useSize};
2
2
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@helsenorge/designsystem-react",
3
3
  "sideEffects": false,
4
- "version": "1.0.0-beta131",
4
+ "version": "1.0.0-beta132",
5
5
  "description": "The official design system for Helsenorge built with React.",
6
6
  "repository": {
7
7
  "type": "tfs",
@@ -0,0 +1,2 @@
1
+ import{a as n,_ as i}from"./_rollupPluginBabelHelpers-0f007973.js";import{useEffect as t,useState as e}from"react";function o(n,i,t){var e;return[function(){var o=this,r=arguments,u=function(){e=null,t||n.apply(o,r)},a=t&&!e;e&&clearTimeout(e),e=setTimeout(u,i),a&&n.apply(o,r)},function(){e&&clearTimeout(e)}]}var r=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["layoutchange","resize","orientationchange"],u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;t((function(){if("object"===("undefined"==typeof window?"undefined":n(window))){var t=o(e,u),a=i(t,2),d=a[0],c=a[1];return r.forEach((function(n){return window.addEventListener(n,d)})),d(),function(){c(),r.forEach((function(n){return window.removeEventListener(n,d)}))}}}),[])},u=function(n,t){var o=e(!1),u=i(o,2),a=u[0],d=u[1],c=e(!1),l=i(c,2),f=l[0],v=l[1],s=e(),g=i(s,2),h=g[0],p=g[1],w=e(),m=i(w,2),y=m[0],E=m[1];return r((function(){var i,e,o,r=(null===(i=n.current)||void 0===i?void 0:i.getBoundingClientRect())||{},u=r.top,a=void 0===u?0:u,c=r.width,l=void 0===c?0:c,f=r.bottom,s=void 0===f?0:f,g=null!==(o=null===(e=t.current)||void 0===e?void 0:e.getBoundingClientRect().height)&&void 0!==o?o:0;d(a<=0),v(s<=g),E(l),p(g)}),["resize","scroll"]),{isOutsideWindow:a,isLeavingWindow:f,offsetHeight:h,contentWidth:y}};export{u as a,r as u};
2
+ //# sourceMappingURL=useSticky-445a0370.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSticky-445a0370.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -4,5 +4,5 @@
4
4
  * @param wait wait for x time
5
5
  * @param immediate run now
6
6
  */
7
- export declare function debounce(func: Function, wait: number, immediate?: boolean): () => void;
7
+ export declare function debounce(func: Function, wait: number, immediate?: boolean): [() => void, () => void];
8
8
  //# sourceMappingURL=debounce.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../src/utils/debounce.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,IAAI,CAoBtF"}
1
+ {"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../src/utils/debounce.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,CAAC,MAAM,IAAI,EAAE,MAAM,IAAI,CAAC,CA0BpG"}
@@ -1,2 +0,0 @@
1
- import{a as n,_ as i}from"./_rollupPluginBabelHelpers-0f007973.js";import{useEffect as t,useState as e}from"react";function o(n,i,t){var e;return function(){var o=this,r=arguments,u=function(){e=null,t||n.apply(o,r)},d=t&&!e;e&&clearTimeout(e),e=setTimeout(u,i),d&&n.apply(o,r)}}var r=function(i){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["layoutchange","resize","orientationchange"],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;t((function(){if("object"===("undefined"==typeof window?"undefined":n(window))){var t=o(i,r);return e.forEach((function(n){return window.addEventListener(n,t)})),t(),function(){e.forEach((function(n){return window.removeEventListener(n,t)}))}}}),[])},u=function(n,t){var o=e(!1),u=i(o,2),d=u[0],a=u[1],c=e(!1),l=i(c,2),f=l[0],v=l[1],s=e(),g=i(s,2),h=g[0],p=g[1],w=e(),m=i(w,2),y=m[0],E=m[1];return r((function(){var i,e,o,r=(null===(i=n.current)||void 0===i?void 0:i.getBoundingClientRect())||{},u=r.top,d=void 0===u?0:u,c=r.width,l=void 0===c?0:c,f=r.bottom,s=void 0===f?0:f,g=null!==(o=null===(e=t.current)||void 0===e?void 0:e.getBoundingClientRect().height)&&void 0!==o?o:0;a(d<=0),v(s<=g),E(l),p(g)}),["resize","scroll"]),{isOutsideWindow:d,isLeavingWindow:f,offsetHeight:h,contentWidth:y}};export{u as a,r as u};
2
- //# sourceMappingURL=useSticky-abffc922.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useSticky-abffc922.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}