@helsenorge/designsystem-react 1.0.0 → 1.0.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.
- package/HorizontalScroll-d65b118a.js +2 -0
- package/HorizontalScroll-d65b118a.js.map +1 -0
- package/Modal-eebb821b.js +2 -0
- package/Modal-eebb821b.js.map +1 -0
- package/components/ButtonWithModal/index.js +1 -1
- package/components/HighlightBox/HighlightBox.d.ts.map +1 -1
- package/components/HighlightBox/index.js +1 -1
- package/components/HighlightBox/styles.module.scss +0 -2
- package/components/HorizontalScroll/HorizontalScroll.d.ts +4 -0
- package/components/HorizontalScroll/HorizontalScroll.d.ts.map +1 -0
- package/components/HorizontalScroll/componentdata.json +3 -0
- package/components/HorizontalScroll/index.d.ts +4 -0
- package/components/HorizontalScroll/index.d.ts.map +1 -0
- package/components/HorizontalScroll/index.js +2 -0
- package/components/HorizontalScroll/index.js.map +1 -0
- package/components/HorizontalScroll/styles.module.scss +31 -0
- package/components/HorizontalScroll/styles.module.scss.d.ts +14 -0
- package/components/Modal/index.js +1 -1
- package/components/Panel/styles.module.scss +0 -1
- package/components/Panel/styles.module.scss.d.ts +0 -2320
- package/components/PanelList/styles.module.scss +0 -1
- package/components/PanelList/styles.module.scss.d.ts +0 -2320
- package/components/Table/Table.d.ts +7 -1
- package/components/Table/Table.d.ts.map +1 -1
- package/components/Table/index.js +1 -1
- package/components/Table/styles.module.scss +0 -1
- package/components/Table/styles.module.scss.d.ts +35 -0
- package/hooks/useIsVisible.d.ts +2 -1
- package/hooks/useIsVisible.d.ts.map +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/scss/_breakpoints.scss +2 -0
- package/scss/_grid.scss +5 -1
- package/scss/helsenorge.scss +1 -1
- package/{useIsVisible-bef05e5e.js → useFocusTrap-4a5fb65d.js} +2 -2
- package/useFocusTrap-4a5fb65d.js.map +1 -0
- package/useIsVisible-27ff4012.js +2 -0
- package/useIsVisible-27ff4012.js.map +1 -0
- package/Modal-3ed00fd4.js +0 -2
- package/Modal-3ed00fd4.js.map +0 -1
- package/useIsVisible-bef05e5e.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import r,{useRef as o}from"react";import{c as l}from"./index-d1c0552c.js";import{a as e}from"./useIsVisible-27ff4012.js";import i from"./components/HorizontalScroll/styles.module.scss";var t=function(t){var a=t.children,n=o(null),c=o(null),s=o(null),m=e(c,1,{root:null==n?void 0:n.current,rootMargin:"3px"}),d=e(s,1,{root:null==n?void 0:n.current,rootMargin:"3px"});return r.createElement("div",{className:i.horizontalscroll},r.createElement("div",{className:i.horizontalscroll__viewport,ref:n},r.createElement("div",{className:l(i.horizontalscroll__indicator,i["horizontalscroll__indicator--left"],!m&&i["horizontalscroll__indicator--visible"])}),r.createElement("div",{className:l(i.horizontalscroll__indicator,i["horizontalscroll__indicator--right"],!d&&i["horizontalscroll__indicator--visible"])}),r.createElement("div",{ref:c}),a,r.createElement("div",{ref:s})))};export{t as H};
|
|
2
|
+
//# sourceMappingURL=HorizontalScroll-d65b118a.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HorizontalScroll-d65b118a.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{_ as e,d as a}from"./_rollupPluginBabelHelpers-0f007973.js";import t,{useEffect as r}from"react";import{c as l}from"./index-d1c0552c.js";import{p as o}from"./palette-f206f488.js";import{B as n}from"./Button-78f848e6.js";import{I as s}from"./Icon-d69d65b3.js";import{Z as i,A as c,I as m}from"./constants-dbdea596.js";import d from"./components/Modal/styles.module.scss";import{A as u}from"./AlertSignStroke-32f09751.js";import{A as p}from"./AlertSignFill-5df5b7c7.js";import{a as _}from"./useFocusTrap-4a5fb65d.js";import{a as v}from"./useIsVisible-27ff4012.js";import{T as f}from"./Title-01820508.js";import{u as E}from"./uuid-11037462.js";import{C as g}from"./Close-08d48540.js";import{C as b}from"./CheckOutline-86cddefd.js";import{P as y}from"./index-28ed5ede.js";var h,N;!function(e){e.normal="normal",e.warning="warning",e.error="error",e.success="success",e.image="image"}(h||(h={})),function(e){e.large="large",e.medium="medium"}(N||(N={}));var C={variant:h.normal,primaryButtonText:"OK",titleId:E(),className:"",size:N.large,zIndex:i.Modal},w=function(e,a){var r=function(e){return e===h.error?t.createElement(s,{size:m.Small,svgIcon:p,color:o.cherry500}):e===h.warning?t.createElement(s,{size:m.Small,svgIcon:u,color:o.black}):e===h.success?t.createElement(s,{size:m.Small,svgIcon:b,color:o.kiwi900}):null}(e);return r?t.createElement("div",{className:d.modal__iconWrapper},r):a?t.createElement("div",{className:d.modal__iconWrapper},t.cloneElement(a,{size:m.Small})):null},B=function(o){var s,i,m,u=t.useState(0),p=e(u,2),E=p[0],b=p[1],N=t.useRef(null),C=t.useRef(null),B=t.useRef(null),j=v(C),I=t.useRef(null),x=v(I),k=B.current&&B.current.scrollHeight>B.current.clientHeight;function T(e){"Escape"===e.key&&o.onClose&&(e.stopPropagation(),o.onClose())}function W(e){e.target&&L.current===e.target&&o.onClose&&(e.stopPropagation(),o.onClose())}var z=o.variant===h.image,L=t.useRef(null),S=o.secondaryButtonText&&(null===(i=o.secondaryButtonText)||void 0===i?void 0:i.length)>0||o.onSuccess,P=o.ariaLabelledBy?void 0:o.ariaLabel,A=o.ariaLabelledBy?o.ariaLabelledBy:o.ariaLabel?void 0:o.titleId;r((function(){var e,a=L.current;return null===(e=N.current)||void 0===e||e.focus(),document.body.style.overflow="hidden",o.disableCloseEvents||!a||S||(a.addEventListener("keydown",T),a.addEventListener("click",W)),function(){document.body.style.removeProperty("overflow"),o.disableCloseEvents||!a||S||(a.removeEventListener("keydown",T),a.removeEventListener("click",W))}}),[]);var M=l(o.className,d.modal,d["modal--".concat(o.variant)],d["modal--".concat(o.size)],k&&!S&&d["modal--no-actions"]),R=l((a(s={},d["modal__title--error"],o.variant===h.error),a(s,d["modal__title--success"],o.variant===h.success),s)),H=t.createElement("div",{"data-testid":"dialog-container"},t.createElement("div",{ref:L,className:d["modal-overlay"],"data-testid":o.testId,"data-analyticsid":c.Modal,style:{zIndex:o.zIndex}},t.createElement("div",{className:d.align,ref:_()},t.createElement("div",{className:M,role:"dialog","aria-label":P,"aria-labelledby":A},t.createElement("div",{tabIndex:E,ref:N,onBlur:function(){return b(-1)}}),t.createElement("div",{className:l(d.modal__shadow,d["modal__shadow--top"],a({},d["modal__shadow--show"],!j&&k))}),t.createElement("div",{className:l(d.modal__contentWrapper,a({},d["modal__contentWrapper--image"],z)),ref:B},!o.noCloseButton&&t.createElement("div",{className:d.modal__closeWrapper},t.createElement("div",{className:l(d.modal__closeWrapper__close)},t.createElement(g,{onClick:o.onClose,ariaLabel:o.ariaLabelCloseBtn}))),t.createElement("div",{className:l(d["modal__contentWrapper__scroll--".concat(o.size)],a({},d["modal__contentWrapper__scroll--image"],z))},t.createElement("div",{ref:C}),t.createElement("div",{className:d.modal__contentWrapper__title},w(o.variant,o.icon),t.createElement(f,{id:A,htmlMarkup:"h3",appearance:"title3",className:R},o.title),o.afterTitleChildren&&t.createElement("div",{className:d.modal__afterTitleChildren},o.afterTitleChildren)),z&&t.createElement("div",null,t.createElement("div",{className:d.modal__contentWrapper__imageWrapper},o.children),t.createElement("span",{className:d.modal__contentWrapper__imageDescription},o.description)),!z&&o.children&&t.createElement("div",null,o.children),!z&&!o.children&&t.createElement("p",{className:d.modal__description},o.description),t.createElement("div",{ref:I}))),t.createElement("div",{className:l(d.modal__shadow,d["modal__shadow--bottom"],a({},d["modal__shadow--show"],!x&&k))}),S&&t.createElement("div",{className:l(d["modal__call-to-action"],d["modal__call-to-action--".concat(o.size)])},o.onSuccess&&t.createElement(n,{onClick:o.onSuccess},o.primaryButtonText),o.secondaryButtonText&&(null===(m=o.secondaryButtonText)||void 0===m?void 0:m.length)>0&&t.createElement(n,{variant:"borderless",onClick:o.onClose},o.secondaryButtonText))))));if(o.printable){var F="print-modal";return t.createElement(y,{className:F,testId:"print-modal"},t.createElement("style",{media:"print"},"body > *:not(.".concat(F,") {display: none;}")),H)}return H};B.defaultProps=C;export{B as M,h as a,N as b};
|
|
2
|
+
//# sourceMappingURL=Modal-eebb821b.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Modal-eebb821b.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as t}from"../../_rollupPluginBabelHelpers-0f007973.js";import
|
|
1
|
+
import{_ as t}from"../../_rollupPluginBabelHelpers-0f007973.js";import s,{useState as e}from"react";import{B as o}from"../../Button-78f848e6.js";import{M as r}from"../../Modal-eebb821b.js";import"../../_tslib-b219470a.js";import"../../constants-dbdea596.js";import"../../color-e7d082c1.js";import"../../index-d1c9177a.js";import"../../palette-f206f488.js";import"../../grid-c105cad1.js";import"../../Icon-d69d65b3.js";import"../../index-d1c0552c.js";import"../../useUuid-3b1e73f2.js";import"../../uuid-11037462.js";import"../../Loader-06293a27.js";import"../Loader/styles.module.scss";import"../../useHover-18479690.js";import"../../useBreakpoint-a74f5af5.js";import"../Button/styles.module.scss";import"../Modal/styles.module.scss";import"../../AlertSignStroke-32f09751.js";import"../../AlertSignFill-5df5b7c7.js";import"../../useFocusTrap-4a5fb65d.js";import"../../useIsVisible-27ff4012.js";import"../../Title-01820508.js";import"../Title/styles.module.scss";import"../../Close-08d48540.js";import"../../X-867957f2.js";import"../Close/styles.module.scss";import"../../CheckOutline-86cddefd.js";import"../../index-28ed5ede.js";import"react-dom";var i=s.forwardRef((function(i,m){var d=e(!1),p=t(d,2),l=p[0],a=p[1];return s.createElement("div",{"data-testid":i.testId},s.createElement(o,{onClick:function(){return a(!0)}},i.buttonText),l&&s.createElement(r,Object.assign({},i,{onClose:function(){return a(!1)}})))}));export{i as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HighlightBox.d.ts","sourceRoot":"","sources":["../../../src/components/HighlightBox/HighlightBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAInD,OAAa,EAAE,OAAO,EAAY,MAAM,UAAU,CAAC;AAGnD,oBAAY,kBAAkB,GAAG,OAAO,CAAC,YAAY,EAAE,OAAO,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC,CAAC;AAEvH,oBAAY,gBAAgB;IAC1B,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AAED,oBAAY,gBAAgB,GAAG,OAAO,CACpC,MAAM,qBAAqB,EAC3B,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,CAC1E,CAAC;AAEF,UAAU,iBAAiB;IACzB,yBAAyB;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,mDAAmD;IACnD,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,OAAO,gBAAgB,CAAC;IACrC,wCAAwC;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mDAAmD;IACnD,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAuBD,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"HighlightBox.d.ts","sourceRoot":"","sources":["../../../src/components/HighlightBox/HighlightBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAInD,OAAa,EAAE,OAAO,EAAY,MAAM,UAAU,CAAC;AAGnD,oBAAY,kBAAkB,GAAG,OAAO,CAAC,YAAY,EAAE,OAAO,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC,CAAC;AAEvH,oBAAY,gBAAgB;IAC1B,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AAED,oBAAY,gBAAgB,GAAG,OAAO,CACpC,MAAM,qBAAqB,EAC3B,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,CAC1E,CAAC;AAEF,UAAU,iBAAiB;IACzB,yBAAyB;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,mDAAmD;IACnD,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,OAAO,gBAAgB,CAAC;IACrC,wCAAwC;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mDAAmD;IACnD,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAuBD,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAiF7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"react";import{c as t}from"../../index-d1c0552c.js";import i from"./styles.module.scss";import{A as a,I as l}from"../../constants-dbdea596.js";import{I as
|
|
1
|
+
import e from"react";import{c as t}from"../../index-d1c0552c.js";import i from"./styles.module.scss";import{A as a,I as l}from"../../constants-dbdea596.js";import{I as r}from"../../Icon-d69d65b3.js";import"../../palette-f206f488.js";import"../../grid-c105cad1.js";import{u as s,B as o}from"../../useBreakpoint-a74f5af5.js";import"../../_tslib-b219470a.js";import"../../useUuid-3b1e73f2.js";import"../../_rollupPluginBabelHelpers-0f007973.js";import"../../uuid-11037462.js";var c;!function(e){e.medium="medium",e.large="large",e.fluid="fluid"}(c||(c={}));var m=function(a){var l=a.className,r=a.size,s=a.children;return e.createElement("div",{className:l},e.createElement("div",{className:i.highlightbox__row},e.createElement("div",{className:t(i.highlightbox__col,r===c.medium&&i["highlightbox__col--offset"])},s)))},n=function(a){var l=a.children;return e.createElement("div",{className:i["highlightbox__content-wrapper"]},e.createElement("div",{className:t(i.highlightbox__row)},l))},h=function(h){var d=h.children,g=h.color,u=void 0===g?"white":g,f=h.size,_=void 0===f?c.medium:f,b=h.testId,p=h.svgIcon,x=h.htmlMarkup,v=void 0===x?"div":x,E=s(),N=t(i.highlightbox,i["highlightbox--".concat(u)],i["highlightbox--".concat(_)],p&&i["highlightbox--has-icon"],{container:"medium"===_||"large"===_}),j=function(){if(p){var t=_===c.large&&E&&E>=o.md?l.Medium:l.Small;return e.createElement(e.Fragment,null,e.createElement("div",{className:i.highlightbox__icon},e.createElement(r,{svgIcon:p,size:t})),e.createElement("div",{className:i.highlightbox__content},d))}return d},w=v;return _===c.medium?e.createElement(m,{className:N,size:_},e.createElement(w,{className:i["highlightbox__content-wrapper"],"data-testid":b,"data-analyticsid":a.HighlightBox},j())):_===c.large&&p?e.createElement(m,{className:N,size:_},e.createElement(n,null,e.createElement(w,{className:t(i.highlightbox__col,i["highlightbox__col--large-with-icon"]),"data-testid":b,"data-analyticsid":a.HighlightBox},j()))):_===c.large?e.createElement(m,{className:N,size:_},e.createElement(n,null,e.createElement(w,{className:t(i.highlightbox__col,i["highlightbox__col--offset"]),"data-testid":b,"data-analyticsid":a.HighlightBox},j()))):_===c.fluid?e.createElement(w,{className:N,"data-testid":b},j()):null};export{c as HighlightBoxSize,h as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HorizontalScroll.d.ts","sourceRoot":"","sources":["../../../src/components/HorizontalScroll/HorizontalScroll.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAQtC,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EA8BpC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/HorizontalScroll/index.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,cAAc,oBAAoB,CAAC;AACnC,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export{H as HorizontalScroll,H as default}from"../../HorizontalScroll-d65b118a.js";import"react";import"../../index-d1c0552c.js";import"../../useIsVisible-27ff4012.js";import"../../_rollupPluginBabelHelpers-0f007973.js";import"./styles.module.scss";
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
@import '../../scss/_breakpoints.scss';
|
|
2
|
+
|
|
3
|
+
$gradient: rgba(0, 0, 0, 0.27), rgba(0, 0, 0, 0.27) 18%, transparent;
|
|
4
|
+
|
|
5
|
+
.horizontalscroll {
|
|
6
|
+
transform: translateZ(0); // Gjør at position: fixed på child-elementer er relativ til denne parenten
|
|
7
|
+
&__viewport {
|
|
8
|
+
display: flex;
|
|
9
|
+
overflow-x: auto;
|
|
10
|
+
overflow-y: hidden;
|
|
11
|
+
}
|
|
12
|
+
&__indicator {
|
|
13
|
+
position: fixed;
|
|
14
|
+
width: 23px;
|
|
15
|
+
top: 0;
|
|
16
|
+
height: 100%;
|
|
17
|
+
opacity: 0;
|
|
18
|
+
transition: opacity 0.25s ease-in-out;
|
|
19
|
+
&--left {
|
|
20
|
+
left: 0;
|
|
21
|
+
background: linear-gradient(to right, $gradient);
|
|
22
|
+
}
|
|
23
|
+
&--right {
|
|
24
|
+
right: 0;
|
|
25
|
+
background: linear-gradient(to left, $gradient);
|
|
26
|
+
}
|
|
27
|
+
&--visible {
|
|
28
|
+
opacity: 1;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type Styles = {
|
|
2
|
+
horizontalscroll: string;
|
|
3
|
+
horizontalscroll__indicator: string;
|
|
4
|
+
'horizontalscroll__indicator--left': string;
|
|
5
|
+
'horizontalscroll__indicator--right': string;
|
|
6
|
+
'horizontalscroll__indicator--visible': string;
|
|
7
|
+
horizontalscroll__viewport: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type ClassNames = keyof Styles;
|
|
11
|
+
|
|
12
|
+
declare const styles: Styles;
|
|
13
|
+
|
|
14
|
+
export default styles;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{b as ModalSize,a as ModalVariants,M as default}from"../../Modal-
|
|
1
|
+
export{b as ModalSize,a as ModalVariants,M as default}from"../../Modal-eebb821b.js";import"../../_rollupPluginBabelHelpers-0f007973.js";import"react";import"../../index-d1c0552c.js";import"../../palette-f206f488.js";import"../../Button-78f848e6.js";import"../../_tslib-b219470a.js";import"../../constants-dbdea596.js";import"../../color-e7d082c1.js";import"../../index-d1c9177a.js";import"../../grid-c105cad1.js";import"../../Icon-d69d65b3.js";import"../../useUuid-3b1e73f2.js";import"../../uuid-11037462.js";import"../../Loader-06293a27.js";import"../Loader/styles.module.scss";import"../../useHover-18479690.js";import"../../useBreakpoint-a74f5af5.js";import"../Button/styles.module.scss";import"./styles.module.scss";import"../../AlertSignStroke-32f09751.js";import"../../AlertSignFill-5df5b7c7.js";import"../../useFocusTrap-4a5fb65d.js";import"../../useIsVisible-27ff4012.js";import"../../Title-01820508.js";import"../Title/styles.module.scss";import"../../Close-08d48540.js";import"../../X-867957f2.js";import"../Close/styles.module.scss";import"../../CheckOutline-86cddefd.js";import"../../index-28ed5ede.js";import"react-dom";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|