@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.
Files changed (41) hide show
  1. package/HorizontalScroll-d65b118a.js +2 -0
  2. package/HorizontalScroll-d65b118a.js.map +1 -0
  3. package/Modal-eebb821b.js +2 -0
  4. package/Modal-eebb821b.js.map +1 -0
  5. package/components/ButtonWithModal/index.js +1 -1
  6. package/components/HighlightBox/HighlightBox.d.ts.map +1 -1
  7. package/components/HighlightBox/index.js +1 -1
  8. package/components/HighlightBox/styles.module.scss +0 -2
  9. package/components/HorizontalScroll/HorizontalScroll.d.ts +4 -0
  10. package/components/HorizontalScroll/HorizontalScroll.d.ts.map +1 -0
  11. package/components/HorizontalScroll/componentdata.json +3 -0
  12. package/components/HorizontalScroll/index.d.ts +4 -0
  13. package/components/HorizontalScroll/index.d.ts.map +1 -0
  14. package/components/HorizontalScroll/index.js +2 -0
  15. package/components/HorizontalScroll/index.js.map +1 -0
  16. package/components/HorizontalScroll/styles.module.scss +31 -0
  17. package/components/HorizontalScroll/styles.module.scss.d.ts +14 -0
  18. package/components/Modal/index.js +1 -1
  19. package/components/Panel/styles.module.scss +0 -1
  20. package/components/Panel/styles.module.scss.d.ts +0 -2320
  21. package/components/PanelList/styles.module.scss +0 -1
  22. package/components/PanelList/styles.module.scss.d.ts +0 -2320
  23. package/components/Table/Table.d.ts +7 -1
  24. package/components/Table/Table.d.ts.map +1 -1
  25. package/components/Table/index.js +1 -1
  26. package/components/Table/styles.module.scss +0 -1
  27. package/components/Table/styles.module.scss.d.ts +35 -0
  28. package/hooks/useIsVisible.d.ts +2 -1
  29. package/hooks/useIsVisible.d.ts.map +1 -1
  30. package/index.js +1 -1
  31. package/package.json +1 -1
  32. package/scss/_breakpoints.scss +2 -0
  33. package/scss/_grid.scss +5 -1
  34. package/scss/helsenorge.scss +1 -1
  35. package/{useIsVisible-bef05e5e.js → useFocusTrap-4a5fb65d.js} +2 -2
  36. package/useFocusTrap-4a5fb65d.js.map +1 -0
  37. package/useIsVisible-27ff4012.js +2 -0
  38. package/useIsVisible-27ff4012.js.map +1 -0
  39. package/Modal-3ed00fd4.js +0 -2
  40. package/Modal-3ed00fd4.js.map +0 -1
  41. package/useIsVisible-bef05e5e.js.map +0 -1
@@ -1,6 +1,12 @@
1
1
  import React from 'react';
2
2
  export declare enum SmallViewportVariant {
3
+ /**
4
+ * Show horizontal scrollbar when table is too big for the screen
5
+ */
3
6
  horizontalscroll = "horizontalscroll",
7
+ /**
8
+ * Collapse to two columns on small screens
9
+ */
4
10
  block = "block"
5
11
  }
6
12
  export interface Props {
@@ -15,6 +21,6 @@ export interface Props {
15
21
  /** Sets the content of the table. Use TableHead and TableBody */
16
22
  children: React.ReactNode;
17
23
  }
18
- export declare const Table: ({ id, testId, className, children, smallViewportVariant }: Props) => JSX.Element;
24
+ export declare const Table: ({ id, testId, className, children, smallViewportVariant, }: Props) => JSX.Element;
19
25
  export default Table;
20
26
  //# sourceMappingURL=Table.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../src/components/Table/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,oBAAY,oBAAoB;IAC9B,gBAAgB,qBAAqB;IACrC,KAAK,UAAU;CAChB;AAED,MAAM,WAAW,KAAK;IACpB,gBAAgB;IAChB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,0BAA0B;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,KAAK,8DAA0G,KAAK,gBAYhI,CAAC;AAEF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../src/components/Table/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,oBAAY,oBAAoB;IAC9B;;OAEG;IACH,gBAAgB,qBAAqB;IACrC;;OAEG;IACH,KAAK,UAAU;CAChB;AAED,MAAM,WAAW,KAAK;IACpB,gBAAgB;IAChB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,0BAA0B;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,KAAK,+DAMf,KAAK,gBAcP,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -1,2 +1,2 @@
1
- import{d as e}from"../../_rollupPluginBabelHelpers-0f007973.js";import o from"react";import{c as r}from"../../index-d1c0552c.js";import s from"./styles.module.scss";import{A as t}from"../../constants-dbdea596.js";export{T as TableBody}from"../../TableBody-eac2c23b.js";export{T as TableCell,a as TextAlign}from"../../TableCell-cc644eb5.js";export{T as TableExpandedRow}from"../../TableExpandedRow-44b09912.js";export{T as TableExpanderCell}from"../../TableExpanderCell-015d3db2.js";export{H as HeaderCategory,T as TableHead}from"../../TableHead-5ed58948.js";export{S as SortDirection,T as TableHeadCell}from"../../TableHeadCell-84651910.js";export{T as TableRow}from"../../TableRow-692099ee.js";import"../../Button-78f848e6.js";import"../../_tslib-b219470a.js";import"../../color-e7d082c1.js";import"../../index-d1c9177a.js";import"../../palette-f206f488.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"../../ChevronUp-dfafe27b.js";import"../../ChevronDown-2b3daace.js";import"../../ArrowUp-e7787d9c.js";import"../../ArrowDown-88b2c27a.js";var l;!function(e){e.horizontalscroll="horizontalscroll",e.block="block"}(l||(l={}));var d=function(a){var d=a.id,i=a.testId,p=a.className,m=a.children,c=a.smallViewportVariant,b=void 0===c?l.block:c,n=r(s.table,e({},s["table--collapse2col"],b===l.block),p);return o.createElement("table",{className:n,id:d,"data-testid":i,"data-analyticsid":t.Table},m)};export{l as SmallViewportVariant,d as Table,d as default};
1
+ import{d as e}from"../../_rollupPluginBabelHelpers-0f007973.js";import o from"react";import{c as r}from"../../index-d1c0552c.js";import s from"./styles.module.scss";import{A as l}from"../../constants-dbdea596.js";import{H as t}from"../../HorizontalScroll-d65b118a.js";export{T as TableBody}from"../../TableBody-eac2c23b.js";export{T as TableCell,a as TextAlign}from"../../TableCell-cc644eb5.js";export{T as TableExpandedRow}from"../../TableExpandedRow-44b09912.js";export{T as TableExpanderCell}from"../../TableExpanderCell-015d3db2.js";export{H as HeaderCategory,T as TableHead}from"../../TableHead-5ed58948.js";export{S as SortDirection,T as TableHeadCell}from"../../TableHeadCell-84651910.js";export{T as TableRow}from"../../TableRow-692099ee.js";import"../../useIsVisible-27ff4012.js";import"../HorizontalScroll/styles.module.scss";import"../../Button-78f848e6.js";import"../../_tslib-b219470a.js";import"../../color-e7d082c1.js";import"../../index-d1c9177a.js";import"../../palette-f206f488.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"../../ChevronUp-dfafe27b.js";import"../../ChevronDown-2b3daace.js";import"../../ArrowUp-e7787d9c.js";import"../../ArrowDown-88b2c27a.js";var i;!function(e){e.horizontalscroll="horizontalscroll",e.block="block"}(i||(i={}));var d=function(a){var d=a.id,m=a.testId,p=a.className,c=a.children,b=a.smallViewportVariant,n=void 0===b?i.horizontalscroll:b,j=r(s.table,e({},s["table--collapse2col"],n===i.block),p);return o.createElement(t,null,o.createElement("table",{className:j,id:d,"data-testid":m,"data-analyticsid":l.Table},c))};export{i as SmallViewportVariant,d as Table,d as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,6 @@
1
1
  @import '../../scss/_spacers.scss';
2
2
  @import '../../scss/_breakpoints.scss';
3
3
  @import '../../scss/_palette.scss';
4
- @import '../../scss/_grid.scss';
5
4
  @import '../../scss/_font-settings.scss';
6
5
 
7
6
  /* fix outline for Safari */
@@ -0,0 +1,35 @@
1
+ export type Styles = {
2
+ 'expandable-container': string;
3
+ table: string;
4
+ table__cell: string;
5
+ 'table__cell--center': string;
6
+ 'table__cell--nowrap': string;
7
+ 'table__cell--right': string;
8
+ 'table__cell-expander': string;
9
+ 'table__expanded-row': string;
10
+ 'table__expanded-row--expanded': string;
11
+ 'table__expanded-row-button': string;
12
+ 'table__expanded-row-container': string;
13
+ 'table__expanded-row-container--open': string;
14
+ 'table__expander-button-mobile': string;
15
+ 'table__expander-button-mobile--expanded': string;
16
+ 'table__expander-cell-mobile': string;
17
+ 'table__expander-cell-mobile--expanded': string;
18
+ table__head: string;
19
+ 'table__head--normal': string;
20
+ 'table__head--sortable': string;
21
+ 'table__head--transparent': string;
22
+ 'table__head-cell': string;
23
+ 'table__head-cell--sortable': string;
24
+ 'table__head-cell--sorted': string;
25
+ 'table__head-cell-sort-icon-wrapper': string;
26
+ 'table__row--expandable': string;
27
+ 'table__row--expandable--selected': string;
28
+ 'table--collapse2col': string;
29
+ };
30
+
31
+ export type ClassNames = keyof Styles;
32
+
33
+ declare const styles: Styles;
34
+
35
+ export default styles;
@@ -3,7 +3,8 @@
3
3
  *
4
4
  * @param ref Element som skal observeres
5
5
  * @param threshold Hvor synlig må elementet være? Default = 1 (helt synlig)
6
+ * @param options Objekt med options for IntersectionObserver, f.eks. threshold for å bestemme når callbacken skal fyres
6
7
  * @returns true hvis objektet er synlig lik threshold eller mer, false hvis ikke
7
8
  */
8
- export declare const useIsVisible: (ref: React.RefObject<HTMLElement>, threshold?: number) => boolean;
9
+ export declare const useIsVisible: (ref: React.RefObject<HTMLElement>, threshold?: number, options?: IntersectionObserverInit | undefined) => boolean;
9
10
  //# sourceMappingURL=useIsVisible.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useIsVisible.d.ts","sourceRoot":"","sources":["../../src/hooks/useIsVisible.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,QAAS,MAAM,SAAS,CAAC,WAAW,CAAC,yBAAkB,OAU/E,CAAC"}
1
+ {"version":3,"file":"useIsVisible.d.ts","sourceRoot":"","sources":["../../src/hooks/useIsVisible.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,QAAS,MAAM,SAAS,CAAC,WAAW,CAAC,yEAAsD,OAUnH,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-18479690.js";import{d as e}from"./useSticky-432642c9.js";export{u as useLayoutEvent,a as useSticky}from"./useSticky-432642c9.js";export{u as usePrevious}from"./usePrevious-ae293b10.js";import{_ as s,a as r}from"./_rollupPluginBabelHelpers-0f007973.js";import{useState as o,useEffect as n}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-dbdea596.js";import"./palette-f206f488.js";import"./grid-c105cad1.js";var i=function(t){var u=o(),a=s(u,2),i=a[0],c=a[1];return n((function(){if("undefined"!=typeof ResizeObserver){var o=new ResizeObserver((function(e){c(e[0].target.getBoundingClientRect())}));return(null==t?void 0:t.current)&&o.observe(null==t?void 0:t.current),o.disconnect}if("object"===("undefined"==typeof window?"undefined":r(window))){var n=["layoutchange","resize","orientationchange"],u=e((function(){(null==t?void 0:t.current)&&c(t.current.getBoundingClientRect())}),10),a=s(u,2),i=a[0],d=a[1];return n.forEach((function(e){return window.addEventListener(e,i)})),i(),function(){d(),n.forEach((function(e){return window.removeEventListener(e,i)}))}}}),[t]),i};export{i 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}from"./useFocusTrap-4a5fb65d.js";export{u as useHover}from"./useHover-18479690.js";export{u as useIntersectionObserver,a as useIsVisible}from"./useIsVisible-27ff4012.js";import{d as e}from"./useSticky-432642c9.js";export{u as useLayoutEvent,a as useSticky}from"./useSticky-432642c9.js";export{u as usePrevious}from"./usePrevious-ae293b10.js";import{_ as s,a as r}from"./_rollupPluginBabelHelpers-0f007973.js";import{useState as o,useEffect as n}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-dbdea596.js";import"./palette-f206f488.js";import"./grid-c105cad1.js";var i=function(t){var u=o(),a=s(u,2),i=a[0],f=a[1];return n((function(){if("undefined"!=typeof ResizeObserver){var o=new ResizeObserver((function(e){f(e[0].target.getBoundingClientRect())}));return(null==t?void 0:t.current)&&o.observe(null==t?void 0:t.current),o.disconnect}if("object"===("undefined"==typeof window?"undefined":r(window))){var u=["layoutchange","resize","orientationchange"],n=e((function(){(null==t?void 0:t.current)&&f(t.current.getBoundingClientRect())}),10),a=s(n,2),i=a[0],d=a[1];return u.forEach((function(e){return window.addEventListener(e,i)})),i(),function(){d(),u.forEach((function(e){return window.removeEventListener(e,i)}))}}}),[t]),i};export{i 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",
4
+ "version": "1.0.1",
5
5
  "description": "The official design system for Helsenorge built with React.",
6
6
  "repository": {
7
7
  "type": "tfs",
@@ -2,6 +2,8 @@
2
2
 
3
3
  $grid-gutter-width: map-get($spacers, 5);
4
4
 
5
+ $grid-columns: 12;
6
+
5
7
  $grid-breakpoints: (
6
8
  xxs: 0,
7
9
  xs: 360px,
package/scss/_grid.scss CHANGED
@@ -1 +1,5 @@
1
- @import '~bootstrap/scss/bootstrap-grid.scss';
1
+ $enable-deprecation-messages: true;
2
+ @import '~bootstrap/scss/vendor/_rfs.scss';
3
+ @import '~bootstrap/scss/mixins/_deprecate.scss';
4
+ @import '~bootstrap/scss/mixins/_breakpoints.scss';
5
+ @import '~bootstrap/scss/mixins/_grid.scss';
@@ -1,7 +1,7 @@
1
1
  @import 'reset';
2
2
  @import 'spacers';
3
3
  @import 'breakpoints';
4
- @import 'grid';
4
+ @import '~bootstrap/scss/bootstrap-grid.scss';
5
5
  @import 'palette';
6
6
  @import 'fonts';
7
7
  @import 'body';
@@ -1,2 +1,2 @@
1
- import{useState as t,useEffect as e,useRef as n}from"react";import{_ as r}from"./_rollupPluginBabelHelpers-0f007973.js";var o=['a[href]:not([tabindex^="-"])','area[href]:not([tabindex^="-"])','input:not([type="hidden"]):not([type="radio"]):not([disabled]):not([tabindex^="-"])','input[type="radio"]:not([disabled]):not([tabindex^="-"])','select:not([disabled]):not([tabindex^="-"])','textarea:not([disabled]):not([tabindex^="-"])','button:not([disabled]):not([tabindex^="-"])','iframe:not([tabindex^="-"])','audio[controls]:not([tabindex^="-"])','video[controls]:not([tabindex^="-"])','[contenteditable]:not([tabindex^="-"])','[tabindex]:not([tabindex^="-"])'].join(","),i=function(n,i){var a=t(),u=r(a,2),c=u[0],l=u[1];return e((function(){var t=function(){var t,e=null===(t=n.current)||void 0===t?void 0:t.querySelectorAll(o);l(e)},e=new MutationObserver(t);return(null==n?void 0:n.current)&&e.observe(n.current,{subtree:!0,childList:!0}),t(),function(){e.disconnect()}}),[n]),e((function(){var t="tabindex",e="data-tabindex";i?null==c||c.forEach((function(n){var r=n.getAttribute(e);r?n.setAttribute(t,r):n.removeAttribute(t)})):null==c||c.forEach((function(n){n.hasAttribute(t)&&n.setAttribute(e,"".concat(n.tabIndex)),n.tabIndex=-1}))}),[i,c]),c};function a(){var t=n(null);function r(e){var n=t.current,r="Tab"===e.key;if(n&&r){var i=function(t){try{return("string"==typeof t?document.querySelector(t):t).getRootNode().activeElement}catch(e){return console.error("Feil ved å ta tak i active element basert på angitt node: ",t,e),null}}(n),a=null==n?void 0:n.querySelectorAll(o),u=a[0],c=1===a.length?u:a[a.length-1];e.shiftKey?i===u&&(c.focus(),e.preventDefault()):i===c&&(u.focus(),e.preventDefault())}}function i(e){var n=t.current;if(n){var r=n.querySelectorAll('a[href], button, textarea, input[type="text"], input[type="radio"], input[type="checkbox"], select');1===r.length&&(r[0].focus(),e.preventDefault())}}return e((function(){var e=t.current;return e.addEventListener("keydown",r),e.addEventListener("click",i),function(){e.removeEventListener("keydown",r),e.removeEventListener("click",i)}}),[]),t}var u=function(t,n,r){e((function(){var e=new IntersectionObserver(n,r);return(null==t?void 0:t.current)&&e.observe(t.current),function(){(null==t?void 0:t.current)&&e.unobserve(t.current)}}),[t])},c=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=t(!1),i=r(o,2),a=i[0],c=i[1],l=function(t){c(t[0].intersectionRatio>=n)};return u(e,l,{threshold:n}),a};export{a,u as b,c,i as u};
2
- //# sourceMappingURL=useIsVisible-bef05e5e.js.map
1
+ import{useState as t,useEffect as e,useRef as n}from"react";import{_ as r}from"./_rollupPluginBabelHelpers-0f007973.js";var o=['a[href]:not([tabindex^="-"])','area[href]:not([tabindex^="-"])','input:not([type="hidden"]):not([type="radio"]):not([disabled]):not([tabindex^="-"])','input[type="radio"]:not([disabled]):not([tabindex^="-"])','select:not([disabled]):not([tabindex^="-"])','textarea:not([disabled]):not([tabindex^="-"])','button:not([disabled]):not([tabindex^="-"])','iframe:not([tabindex^="-"])','audio[controls]:not([tabindex^="-"])','video[controls]:not([tabindex^="-"])','[contenteditable]:not([tabindex^="-"])','[tabindex]:not([tabindex^="-"])'].join(","),i=function(n,i){var a=t(),u=r(a,2),d=u[0],l=u[1];return e((function(){var t=function(){var t,e=null===(t=n.current)||void 0===t?void 0:t.querySelectorAll(o);l(e)},e=new MutationObserver(t);return(null==n?void 0:n.current)&&e.observe(n.current,{subtree:!0,childList:!0}),t(),function(){e.disconnect()}}),[n]),e((function(){var t="tabindex",e="data-tabindex";i?null==d||d.forEach((function(n){var r=n.getAttribute(e);r?n.setAttribute(t,r):n.removeAttribute(t)})):null==d||d.forEach((function(n){n.hasAttribute(t)&&n.setAttribute(e,"".concat(n.tabIndex)),n.tabIndex=-1}))}),[i,d]),d};function a(){var t=n(null);function r(e){var n=t.current,r="Tab"===e.key;if(n&&r){var i=function(t){try{return("string"==typeof t?document.querySelector(t):t).getRootNode().activeElement}catch(e){return console.error("Feil ved å ta tak i active element basert på angitt node: ",t,e),null}}(n),a=null==n?void 0:n.querySelectorAll(o),u=a[0],d=1===a.length?u:a[a.length-1];e.shiftKey?i===u&&(d.focus(),e.preventDefault()):i===d&&(u.focus(),e.preventDefault())}}function i(e){var n=t.current;if(n){var r=n.querySelectorAll('a[href], button, textarea, input[type="text"], input[type="radio"], input[type="checkbox"], select');1===r.length&&(r[0].focus(),e.preventDefault())}}return e((function(){var e=t.current;return e.addEventListener("keydown",r),e.addEventListener("click",i),function(){e.removeEventListener("keydown",r),e.removeEventListener("click",i)}}),[]),t}export{a,i as u};
2
+ //# sourceMappingURL=useFocusTrap-4a5fb65d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFocusTrap-4a5fb65d.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{_ as r}from"./_rollupPluginBabelHelpers-0f007973.js";import{useEffect as n,useState as e}from"react";var t=function(r,e,t){n((function(){var n=new IntersectionObserver(e,t);return(null==r?void 0:r.current)&&n.observe(r.current),function(){(null==r?void 0:r.current)&&n.unobserve(r.current)}}),[r,t])},o=function(n){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2?arguments[2]:void 0,u=e(!1),c=r(u,2),s=c[0],l=c[1],a=function(r){l(r[0].intersectionRatio>=o)};return t(n,a,Object.assign({threshold:o},i)),s};export{o as a,t as u};
2
+ //# sourceMappingURL=useIsVisible-27ff4012.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIsVisible-27ff4012.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/Modal-3ed00fd4.js DELETED
@@ -1,2 +0,0 @@
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{c as _,a as v}from"./useIsVisible-bef05e5e.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),I=_(C),j=t.useRef(null),x=_(j),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:v()},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"],!I&&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:j}))),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 O="print-modal";return t.createElement(y,{className:O,testId:"print-modal"},t.createElement("style",{media:"print"},"body > *:not(.".concat(O,") {display: none;}")),H)}return H};B.defaultProps=C;export{B as M,h as a,N as b};
2
- //# sourceMappingURL=Modal-3ed00fd4.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Modal-3ed00fd4.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useIsVisible-bef05e5e.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}