@helsenorge/designsystem-react 8.0.2 → 8.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 (41) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/components/Close/styles.module.scss +5 -6
  3. package/components/ExpanderList/styles.module.scss +5 -6
  4. package/components/EyebrowHeader/styles.module.scss +1 -1
  5. package/components/EyebrowHeader/styles.module.scss.d.ts +9 -0
  6. package/components/FormGroup/styles.module.scss +2 -2
  7. package/components/HighlightPanel/styles.module.scss +5 -0
  8. package/components/HorizontalScroll/HorizontalScroll.js +16 -15
  9. package/components/HorizontalScroll/HorizontalScroll.js.map +1 -1
  10. package/components/Input/Input.d.ts +2 -0
  11. package/components/Input/Input.js +63 -51
  12. package/components/Input/Input.js.map +1 -1
  13. package/components/Input/styles.module.scss +2 -2
  14. package/components/Loader/Loader.d.ts +3 -3
  15. package/components/Loader/Loader.js +19 -20
  16. package/components/Loader/Loader.js.map +1 -1
  17. package/components/Loader/styles.module.scss +7 -7
  18. package/components/Modal/Modal.d.ts +1 -12
  19. package/components/Modal/Modal.js +81 -78
  20. package/components/Modal/Modal.js.map +1 -1
  21. package/components/Modal/styles.module.scss +3 -3
  22. package/components/Panel/styles.module.scss +2 -2
  23. package/components/PopOver/styles.module.scss +4 -5
  24. package/components/Table/styles.module.scss +3 -3
  25. package/components/Tabs/TabList/TabItem.d.ts +13 -0
  26. package/components/Tabs/TabList/TabItem.js +45 -0
  27. package/components/Tabs/TabList/TabItem.js.map +1 -0
  28. package/components/Tabs/TabList/TabList.js +23 -50
  29. package/components/Tabs/TabList/TabList.js.map +1 -1
  30. package/components/Tabs/Tabs.d.ts +3 -0
  31. package/components/Tabs/Tabs.js +45 -39
  32. package/components/Tabs/Tabs.js.map +1 -1
  33. package/components/Validation/ValidationSummary.js +20 -12
  34. package/components/Validation/ValidationSummary.js.map +1 -1
  35. package/hooks/usestopPropagation.d.ts +6 -0
  36. package/hooks/usestopPropagation.js +15 -0
  37. package/hooks/usestopPropagation.js.map +1 -0
  38. package/package.json +1 -1
  39. package/utils/refs.d.ts +1 -1
  40. package/utils/refs.js +5 -5
  41. package/utils/refs.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Loader.js","sources":["../../../src/components/Loader/Loader.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, ZIndex } from '../../constants';\nimport { PaletteNames } from '../../theme/palette';\nimport { uuid } from '../../utils/uuid';\n\nimport loaderStyles from './styles.module.scss';\n\nexport type LoaderColors = PaletteNames;\nexport type LoaderSizes = 'tiny' | 'small' | 'medium' | 'large';\nexport enum Overlay {\n screen = 'screen',\n parent = 'parent',\n}\n\nexport interface LoaderProps {\n /** Sets the color of the loader */\n color?: LoaderColors;\n /**\tAdds custom classes to the element. */\n className?: string;\n /** Changes the size of the loader. */\n size?: LoaderSizes;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** id of the label */\n labelId?: string;\n /** Centers the loader in a container */\n center?: boolean;\n /** Inline the loader so it can be used in a span or paragraph */\n inline?: boolean;\n /** Loader is displayed with grey background covering the entire screen */\n overlay?: keyof typeof Overlay;\n /** Individual id for loading icon (aria-labelledby). */\n ariaLabelledById?: string;\n /** String that labels the current loading element */\n ariaLabel?: string;\n}\n\nconst Loader: React.FC<LoaderProps> = props => {\n const {\n overlay,\n color = overlay ? 'black' : 'neutral',\n size = 'small',\n className = '',\n labelId = uuid(),\n testId,\n center,\n inline,\n ariaLabelledById,\n ariaLabel = 'Laster inn',\n } = props;\n\n const showLoader = (): boolean => {\n if (overlay === Overlay.parent || inline) {\n return false;\n }\n\n return true;\n };\n\n const [display, setDisplay] = useState(showLoader());\n\n const isSmall = size === 'small';\n const isMedium = size === 'medium';\n const isLarge = size === 'large';\n\n const loaderWrapperClasses = classNames({\n [loaderStyles['loader-wrapper--center']]: center,\n [loaderStyles['loader-wrapper--overlay']]: overlay,\n [loaderStyles['loader-wrapper--overlay-screen']]: overlay === Overlay.screen,\n [loaderStyles['loader-wrapper--overlay-parent']]: overlay === Overlay.parent && display,\n [loaderStyles['loader-wrapper--inline']]: inline && display,\n });\n const loaderClasses = classNames(\n loaderStyles.loader,\n {\n [loaderStyles['loader--small']]: isSmall,\n [loaderStyles['loader--medium']]: isMedium,\n [loaderStyles['loader--large']]: isLarge,\n },\n className\n );\n const loaderDotClasses = classNames(loaderStyles.loader__dot, {\n [loaderStyles['loader__dot--small']]: isSmall,\n [loaderStyles['loader__dot--medium']]: isMedium,\n [loaderStyles['loader__dot--large']]: isLarge,\n [loaderStyles['loader__dot--banana']]: color === 'banana',\n [loaderStyles['loader__dot--cherry']]: color === 'cherry',\n [loaderStyles['loader__dot--kiwi']]: color === 'kiwi',\n [loaderStyles['loader__dot--neutral']]: color === 'neutral',\n [loaderStyles['loader__dot--plum']]: color === 'plum',\n [loaderStyles['loader__dot--black']]: color === 'black',\n [loaderStyles['loader__dot--white']]: color === 'white',\n });\n\n const wrapperRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (overlay === Overlay.parent && wrapperRef.current?.parentElement?.style) {\n wrapperRef.current.parentElement.style.position = 'relative';\n setDisplay(true);\n }\n\n if (inline && wrapperRef.current?.parentElement?.style) {\n wrapperRef.current.parentElement.style.display = 'flex';\n setDisplay(true);\n }\n }, []);\n\n return (\n <div className={loaderWrapperClasses} ref={wrapperRef} style={overlay === Overlay.screen ? { zIndex: ZIndex.OverlayScreen } : {}}>\n {display && (\n <div\n data-testid={testId}\n data-analyticsid={AnalyticsId.Loader}\n role=\"progressbar\"\n aria-labelledby={ariaLabelledById || labelId}\n className={loaderClasses}\n >\n <div className={loaderDotClasses} />\n <div className={loaderDotClasses} />\n <div className={loaderDotClasses} />\n <div className={loaderDotClasses} />\n {!ariaLabelledById && (\n <span id={labelId} className={loaderStyles['loader__hidden-text']}>\n {ariaLabel}\n </span>\n )}\n </div>\n )}\n </div>\n );\n};\n\nexport default Loader;\n"],"names":["Overlay","Loader","props","overlay","color","size","className","labelId","uuid","testId","center","inline","ariaLabelledById","ariaLabel","showLoader","display","setDisplay","useState","isSmall","isMedium","isLarge","loaderWrapperClasses","classNames","loaderStyles","loaderClasses","loaderDotClasses","wrapperRef","useRef","useEffect","_b","_a","_d","_c","ZIndex","React","AnalyticsId"],"mappings":";;;;;AAYY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,SAAS,UAFCA,IAAAA,KAAA,CAAA,CAAA;AA4BZ,MAAMC,IAAgC,CAASC,MAAA;AACvC,QAAA;AAAA,IACJ,SAAAC;AAAA,IACA,OAAAC,IAAQD,IAAU,UAAU;AAAA,IAC5B,MAAAE,IAAO;AAAA,IACP,WAAAC,IAAY;AAAA,IACZ,SAAAC,IAAUC,EAAK;AAAA,IACf,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,EACV,IAAAX,GAEEY,IAAa,MACb,EAAAX,MAAY,YAAkBQ,IAO9B,CAACI,GAASC,CAAU,IAAIC,EAASH,EAAY,CAAA,GAE7CI,IAAUb,MAAS,SACnBc,IAAWd,MAAS,UACpBe,IAAUf,MAAS,SAEnBgB,IAAuBC,EAAW;AAAA,IACtC,CAACC,EAAa,wBAAwB,CAAC,GAAGb;AAAA,IAC1C,CAACa,EAAa,yBAAyB,CAAC,GAAGpB;AAAA,IAC3C,CAACoB,EAAa,gCAAgC,CAAC,GAAGpB,MAAY;AAAA,IAC9D,CAACoB,EAAa,gCAAgC,CAAC,GAAGpB,MAAY,YAAkBY;AAAA,IAChF,CAACQ,EAAa,wBAAwB,CAAC,GAAGZ,KAAUI;AAAA,EAAA,CACrD,GACKS,IAAgBF;AAAA,IACpBC,EAAa;AAAA,IACb;AAAA,MACE,CAACA,EAAa,eAAe,CAAC,GAAGL;AAAA,MACjC,CAACK,EAAa,gBAAgB,CAAC,GAAGJ;AAAA,MAClC,C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,MAAK;AAAA,MACL,mBAAiBvB,KAAoBL;AAAA,MACrC,WAAWiB;AAAA,IAAA;AAAA,IAEXU,gBAAAA,EAAA,cAAC,OAAI,EAAA,WAAWT,EAAkB,CAAA;AAAA,IAClCS,gBAAAA,EAAA,cAAC,OAAI,EAAA,WAAWT,EAAkB,CAAA;AAAA,IAClCS,gBAAAA,EAAA,cAAC,OAAI,EAAA,WAAWT,EAAkB,CAAA;AAAA,IAClCS,gBAAAA,EAAA,cAAC,OAAI,EAAA,WAAWT,EAAkB,CAAA;AAAA,IACjC,CAACb,KACAsB,gBAAAA,EAAA,cAAC,QAAK,EAAA,IAAI3B,GAAS,WAAWgB,EAAa,qBAAqB,EAAA,GAC7DV,CACH;AAAA,EAAA,CAIR;AAEJ;"}
1
+ {"version":3,"file":"Loader.js","sources":["../../../src/components/Loader/Loader.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, ZIndex } from '../../constants';\nimport { PaletteNames } from '../../theme/palette';\nimport { uuid } from '../../utils/uuid';\n\nimport loaderStyles from './styles.module.scss';\n\nexport type LoaderColors = PaletteNames;\nexport type LoaderSizes = 'tiny' | 'small' | 'medium' | 'large';\nexport enum Overlay {\n screen = 'screen',\n parent = 'parent',\n}\n\nexport interface LoaderProps {\n /** Sets the color of the loader. If overlay is used, the color will always be white. */\n color?: LoaderColors;\n /**\tAdds custom classes to the element. */\n className?: string;\n /** Changes the size of the loader. */\n size?: LoaderSizes;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** id of the label */\n labelId?: string;\n /** Centers the loader in a container */\n center?: boolean;\n /** Inline the loader so it can be used in a span or paragraph */\n inline?: boolean;\n /** Loader is displayed with grey background covering the entire screen */\n overlay?: keyof typeof Overlay;\n /** Individual id for loading icon (aria-labelledby). */\n ariaLabelledById?: string;\n /** String that labels the current loading element */\n ariaLabel?: string;\n}\n\nconst Loader: React.FC<LoaderProps> = props => {\n const {\n overlay,\n size = 'small',\n className = '',\n labelId = uuid(),\n testId,\n center,\n inline,\n ariaLabelledById,\n ariaLabel = 'Laster inn',\n } = props;\n const color = props.overlay ? 'white' : props.color || 'neutral';\n\n const showLoader = (): boolean => {\n if (overlay === Overlay.parent || inline) {\n return false;\n }\n\n return true;\n };\n\n const [display, setDisplay] = useState(showLoader());\n\n const isSmall = size === 'small';\n const isMedium = size === 'medium';\n const isLarge = size === 'large';\n\n const loaderWrapperClasses = classNames({\n [loaderStyles['loader-wrapper--center']]: center,\n [loaderStyles['loader-wrapper--overlay']]: overlay,\n [loaderStyles['loader-wrapper--overlay-screen']]: overlay === Overlay.screen,\n [loaderStyles['loader-wrapper--overlay-parent']]: overlay === Overlay.parent && display,\n [loaderStyles['loader-wrapper--inline']]: inline && display,\n });\n const loaderClasses = classNames(\n loaderStyles.loader,\n {\n [loaderStyles['loader--small']]: isSmall,\n [loaderStyles['loader--medium']]: isMedium,\n [loaderStyles['loader--large']]: isLarge,\n },\n className\n );\n const loaderDotClasses = classNames(loaderStyles.loader__dot, {\n [loaderStyles['loader__dot--small']]: isSmall,\n [loaderStyles['loader__dot--medium']]: isMedium,\n [loaderStyles['loader__dot--large']]: isLarge,\n [loaderStyles['loader__dot--banana']]: color === 'banana',\n [loaderStyles['loader__dot--cherry']]: color === 'cherry',\n [loaderStyles['loader__dot--kiwi']]: color === 'kiwi',\n [loaderStyles['loader__dot--neutral']]: color === 'neutral',\n [loaderStyles['loader__dot--plum']]: color === 'plum',\n [loaderStyles['loader__dot--black']]: color === 'black',\n [loaderStyles['loader__dot--white']]: color === 'white',\n });\n\n const wrapperRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (overlay === Overlay.parent && wrapperRef.current?.parentElement?.style) {\n wrapperRef.current.parentElement.style.position = 'relative';\n setDisplay(true);\n }\n\n if (inline && wrapperRef.current?.parentElement?.style) {\n wrapperRef.current.parentElement.style.display = 'flex';\n setDisplay(true);\n }\n }, []);\n\n return (\n <div className={loaderWrapperClasses} ref={wrapperRef} style={overlay === Overlay.screen ? { zIndex: ZIndex.OverlayScreen } : {}}>\n {display && (\n <div\n data-testid={testId}\n data-analyticsid={AnalyticsId.Loader}\n role=\"progressbar\"\n aria-labelledby={ariaLabelledById || labelId}\n className={loaderClasses}\n >\n <div className={loaderDotClasses} />\n <div className={loaderDotClasses} />\n <div className={loaderDotClasses} />\n <div className={loaderDotClasses} />\n {!ariaLabelledById && (\n <span id={labelId} className={loaderStyles['loader__hidden-text']}>\n {ariaLabel}\n </span>\n )}\n </div>\n )}\n </div>\n );\n};\n\nexport default Loader;\n"],"names":["Overlay","Loader","props","overlay","size","className","labelId","uuid","testId","center","inline","ariaLabelledById","ariaLabel","color","showLoader","display","setDisplay","useState","isSmall","isMedium","isLarge","loaderWrapperClasses","classNames","loaderStyles","loaderClasses","loaderDotClasses","wrapperRef","useRef","useEffect","_b","_a","_d","_c","ZIndex","React","AnalyticsId"],"mappings":";;;;;AAYY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,SAAS,UAFCA,IAAAA,KAAA,CAAA,CAAA;AA4BZ,MAAMC,IAAgC,CAASC,MAAA;AACvC,QAAA;AAAA,IACJ,SAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,WAAAC,IAAY;AAAA,IACZ,SAAAC,IAAUC,EAAK;AAAA,IACf,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,EACV,IAAAV,GACEW,IAAQX,EAAM,UAAU,UAAUA,EAAM,SAAS,WAEjDY,IAAa,MACb,EAAAX,MAAY,YAAkBO,IAO9B,CAACK,GAASC,CAAU,IAAIC,EAASH,EAAY,CAAA,GAE7CI,IAAUd,MAAS,SACnBe,IAAWf,MAAS,UACpBgB,IAAUhB,MAAS,SAEnBiB,IAAuBC,EAAW;AAAA,IACtC,CAACC,EAAa,wBAAwB,CAAC,GAAGd;AAAA,IAC1C,CAACc,EAAa,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X,gBAAAM,EAAoB,kBAApB,QAAAD,EAAmC,WACpCL,EAAA,QAAQ,cAAc,MAAM,UAAU,QACjDV,EAAW,EAAI;AAAA,EAEnB,GAAG,CAAE,CAAA,mCAGF,OAAI,EAAA,WAAWK,GAAsB,KAAKK,GAAY,OAAOvB,MAAY,WAAiB,EAAE,QAAQ8B,EAAO,cAAkB,IAAA,MAC3HlB,KACCmB,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,eAAa1B;AAAA,MACb,oBAAkB2B,EAAY;AAAA,MAC9B,MAAK;AAAA,MACL,mBAAiBxB,KAAoBL;AAAA,MACrC,WAAWkB;AAAA,IAAA;AAAA,IAEXU,gBAAAA,EAAA,cAAC,OAAI,EAAA,WAAWT,EAAkB,CAAA;AAAA,IAClCS,gBAAAA,EAAA,cAAC,OAAI,EAAA,WAAWT,EAAkB,CAAA;AAAA,IAClCS,gBAAAA,EAAA,cAAC,OAAI,EAAA,WAAWT,EAAkB,CAAA;AAAA,IAClCS,gBAAAA,EAAA,cAAC,OAAI,EAAA,WAAWT,EAAkB,CAAA;AAAA,IACjC,CAACd,KACAuB,gBAAAA,EAAA,cAAC,QAAK,EAAA,IAAI5B,GAAS,WAAWiB,EAAa,qBAAqB,EAAA,GAC7DX,CACH;AAAA,EAAA,CAIR;AAEJ;"}
@@ -14,6 +14,8 @@
14
14
  }
15
15
 
16
16
  @mixin loader-dot-scale($name, $scale-start, $scale-end) {
17
+ @include animate($name, scale, 0.6s, infinite);
18
+
17
19
  @include keyframes($name) {
18
20
  0% {
19
21
  transform: scale($scale-start);
@@ -23,11 +25,11 @@
23
25
  transform: scale($scale-end);
24
26
  }
25
27
  }
26
-
27
- @include animate($name, scale, 0.6s, infinite);
28
28
  }
29
29
 
30
30
  @mixin loader-dot-translate($name, $distance) {
31
+ @include animate($name, translate, 0.6s, infinite);
32
+
31
33
  @include keyframes($name) {
32
34
  0% {
33
35
  transform: translate(0, 0);
@@ -37,8 +39,6 @@
37
39
  transform: translate($distance, 0);
38
40
  }
39
41
  }
40
-
41
- @include animate($name, translate, 0.6s, infinite);
42
42
  }
43
43
 
44
44
  .loader-wrapper {
@@ -105,6 +105,9 @@
105
105
  background-color: $blueberry500;
106
106
  border-radius: 50%;
107
107
 
108
+ // Sets a form of easing animation curve
109
+ animation-timing-function: cubic-bezier(0, 1, 1, 0);
110
+
108
111
  &--small {
109
112
  width: 12px;
110
113
  height: 12px;
@@ -148,9 +151,6 @@
148
151
  background-color: $white;
149
152
  }
150
153
 
151
- // Sets a form of easing animation curve
152
- animation-timing-function: cubic-bezier(0, 1, 1, 0);
153
-
154
154
  // Scales up the first dot
155
155
  &:nth-child(1) {
156
156
  @include loader-dot-scale(scale-regular, 0, 1);
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { ZIndex } from '../../constants';
3
2
  export declare enum ModalVariants {
4
3
  normal = "normal",
5
4
  warning = "warning",
@@ -55,15 +54,5 @@ export interface ModalProps {
55
54
  /** If disabled, clicking escape or outside the modal will not close it */
56
55
  disableCloseEvents?: boolean;
57
56
  }
58
- declare const Modal: {
59
- (props: ModalProps): JSX.Element;
60
- defaultProps: {
61
- variant: ModalVariants;
62
- primaryButtonText: string;
63
- titleId: string;
64
- className: string;
65
- size: ModalSize;
66
- zIndex: ZIndex;
67
- };
68
- };
57
+ declare const Modal: React.FC<ModalProps>;
69
58
  export default Modal;
@@ -1,142 +1,145 @@
1
- import t, { useEffect as N } from "react";
2
- import n from "classnames";
3
- import { ZIndex as W, AnalyticsId as R, IconSize as c } from "../../constants.js";
4
- import { useFocusTrap as P } from "../../hooks/useFocusTrap.js";
5
- import { useIsVisible as I } from "../../hooks/useIsVisible.js";
6
- import { palette as u } from "../../theme/palette.js";
7
- import { uuid as $ } from "../../utils/uuid.js";
8
- import w from "../Button/Button.js";
9
- import A from "../Close/Close.js";
10
- import { Icon as _ } from "../Icon/Icon.js";
11
- import F from "../Icons/AlertSignFill.js";
12
- import H from "../Icons/AlertSignStroke.js";
13
- import K from "../Icons/CheckOutline.js";
14
- import O from "../Portal/index.js";
15
- import { Title as D } from "../Title/Title.js";
1
+ import t, { useEffect as k } from "react";
2
+ import o from "classnames";
3
+ import { ZIndex as H, AnalyticsId as K, IconSize as d } from "../../constants.js";
4
+ import { useFocusTrap as O } from "../../hooks/useFocusTrap.js";
5
+ import { useIsVisible as L } from "../../hooks/useIsVisible.js";
6
+ import { palette as v } from "../../theme/palette.js";
7
+ import { uuid as D } from "../../utils/uuid.js";
8
+ import S from "../Button/Button.js";
9
+ import V from "../Close/Close.js";
10
+ import { Icon as E } from "../Icon/Icon.js";
11
+ import Z from "../Icons/AlertSignFill.js";
12
+ import j from "../Icons/AlertSignStroke.js";
13
+ import q from "../Icons/CheckOutline.js";
14
+ import G from "../Portal/index.js";
15
+ import { Title as J } from "../Title/Title.js";
16
16
  import a from "../Modal/styles.module.scss";
17
- var V = /* @__PURE__ */ ((e) => (e.normal = "normal", e.warning = "warning", e.error = "error", e.success = "success", e.image = "image", e))(V || {}), Z = /* @__PURE__ */ ((e) => (e.large = "large", e.medium = "medium", e))(Z || {});
18
- const j = {
19
- variant: "normal",
20
- primaryButtonText: "OK",
21
- titleId: $(),
22
- className: "",
23
- size: "large",
24
- zIndex: W.Modal
25
- }, q = (e) => e === "error" ? /* @__PURE__ */ t.createElement(_, { size: c.Small, svgIcon: F, color: u.cherry500 }) : e === "warning" ? /* @__PURE__ */ t.createElement(_, { size: c.Small, svgIcon: H, color: u.black }) : e === "success" ? /* @__PURE__ */ t.createElement(_, { size: c.Small, svgIcon: K, color: u.kiwi900 }) : null, G = (e, r) => {
26
- const o = q(e);
27
- return o ? /* @__PURE__ */ t.createElement("div", { className: a.modal__iconWrapper }, o) : r ? /* @__PURE__ */ t.createElement("div", { className: a.modal__iconWrapper }, t.cloneElement(r, {
28
- size: c.Small
17
+ var M = /* @__PURE__ */ ((e) => (e.normal = "normal", e.warning = "warning", e.error = "error", e.success = "success", e.image = "image", e))(M || {}), Q = /* @__PURE__ */ ((e) => (e.large = "large", e.medium = "medium", e))(Q || {});
18
+ const U = (e) => e === "error" ? /* @__PURE__ */ t.createElement(E, { size: d.Small, svgIcon: Z, color: v.cherry500 }) : e === "warning" ? /* @__PURE__ */ t.createElement(E, { size: d.Small, svgIcon: j, color: v.black }) : e === "success" ? /* @__PURE__ */ t.createElement(E, { size: d.Small, svgIcon: q, color: v.kiwi900 }) : null, X = (e, n) => {
19
+ const m = U(e);
20
+ return m ? /* @__PURE__ */ t.createElement("div", { className: a.modal__iconWrapper }, m) : n ? /* @__PURE__ */ t.createElement("div", { className: a.modal__iconWrapper }, t.cloneElement(n, {
21
+ size: d.Small
29
22
  })) : null;
30
- }, J = (e) => {
31
- var C, h;
32
- const r = t.useRef(null), o = t.useRef(null), m = t.useRef(null);
33
- P(m, !0);
34
- const B = I(r), f = t.useRef(null), k = I(f), s = o.current && o.current.scrollHeight > o.current.clientHeight;
35
- function v(l) {
23
+ }, fe = (e) => {
24
+ var I, B;
25
+ const {
26
+ variant: n = "normal",
27
+ primaryButtonText: m = "OK",
28
+ titleId: W = D(),
29
+ className: x = "",
30
+ size: c = "large",
31
+ zIndex: T = H.Modal
32
+ } = e, b = t.useRef(null), s = t.useRef(null), u = t.useRef(null);
33
+ O(u, !0);
34
+ const R = L(b), g = t.useRef(null), z = L(g), r = s.current && s.current.scrollHeight > s.current.clientHeight;
35
+ function y(l) {
36
36
  l.key === "Escape" && e.onClose && (l.stopPropagation(), e.onClose());
37
37
  }
38
- function E(l) {
39
- l.target && d.current === l.target && e.onClose && (l.stopPropagation(), e.onClose());
38
+ function C(l) {
39
+ l.target && _.current === l.target && e.onClose && (l.stopPropagation(), e.onClose());
40
40
  }
41
- function z() {
41
+ function $() {
42
42
  document.body.style.overflow = "hidden";
43
43
  }
44
- function x() {
44
+ function A() {
45
45
  document.body.style.removeProperty("overflow");
46
46
  }
47
- const i = e.variant === "image", d = t.useRef(null), g = e.secondaryButtonText && ((C = e.secondaryButtonText) == null ? void 0 : C.length) > 0 || e.onSuccess, L = e.ariaLabelledBy ? void 0 : e.ariaLabel, y = e.ariaLabelledBy ? e.ariaLabelledBy : e.ariaLabel ? void 0 : e.titleId;
48
- N(() => {
49
- const l = d.current;
50
- return z(), !e.disableCloseEvents && l && (l.addEventListener("keydown", v), l.addEventListener("click", E)), () => {
51
- x(), !e.disableCloseEvents && l && (l.removeEventListener("keydown", v), l.removeEventListener("click", E));
47
+ const i = n === "image", _ = t.useRef(null), h = e.secondaryButtonText && ((I = e.secondaryButtonText) == null ? void 0 : I.length) > 0 || e.onSuccess, N = e.ariaLabelledBy ? void 0 : e.ariaLabel, f = e.ariaLabelledBy ? e.ariaLabelledBy : e.ariaLabel ? void 0 : W;
48
+ k(() => {
49
+ const l = _.current;
50
+ return $(), !e.disableCloseEvents && l && (l.addEventListener("keydown", y), l.addEventListener("click", C)), () => {
51
+ A(), !e.disableCloseEvents && l && (l.removeEventListener("keydown", y), l.removeEventListener("click", C));
52
52
  };
53
- }, [e.disableCloseEvents]), N(() => {
53
+ }, [e.disableCloseEvents]), k(() => {
54
54
  var l;
55
- (l = m.current) == null || l.focus();
55
+ (l = u.current) == null || l.focus();
56
56
  }, []);
57
- const S = n(
58
- e.className,
57
+ const P = o(
58
+ x,
59
59
  a.modal,
60
- e.variant && a[`modal--${e.variant}`],
61
- e.size && a[`modal--${e.size}`],
62
- s && !g && a["modal--no-actions"]
63
- ), T = n({
64
- [a["modal__title--error"]]: e.variant === "error",
65
- [a["modal__title--success"]]: e.variant === "success"
60
+ n && a[`modal--${n}`],
61
+ c && a[`modal--${c}`],
62
+ r && !h && a["modal--no-actions"]
63
+ ), F = o({
64
+ [a["modal__title--error"]]: n === "error",
65
+ [a["modal__title--success"]]: n === "success"
66
66
  /* success */
67
- }), b = /* @__PURE__ */ t.createElement("div", { "data-testid": "dialog-container" }, /* @__PURE__ */ t.createElement(
67
+ }), w = /* @__PURE__ */ t.createElement("div", { "data-testid": "dialog-container" }, /* @__PURE__ */ t.createElement(
68
68
  "div",
69
69
  {
70
- ref: d,
70
+ ref: _,
71
71
  className: a["modal-overlay"],
72
72
  "data-testid": e.testId,
73
- "data-analyticsid": R.Modal,
74
- style: { zIndex: e.zIndex }
73
+ "data-analyticsid": K.Modal,
74
+ style: { zIndex: T }
75
75
  },
76
76
  /* @__PURE__ */ t.createElement("div", { className: a.align }, /* @__PURE__ */ t.createElement(
77
77
  "div",
78
78
  {
79
- className: S,
79
+ className: P,
80
80
  role: "dialog",
81
81
  "aria-modal": "true",
82
82
  tabIndex: -1,
83
- "aria-label": L,
84
- "aria-labelledby": y,
85
- ref: m
83
+ "aria-label": N,
84
+ "aria-labelledby": f,
85
+ ref: u
86
86
  },
87
87
  /* @__PURE__ */ t.createElement(
88
88
  "div",
89
89
  {
90
- className: n(a.modal__shadow, a["modal__shadow--top"], {
91
- [a["modal__shadow--show"]]: !B && s
90
+ className: o(a.modal__shadow, a["modal__shadow--top"], {
91
+ [a["modal__shadow--show"]]: !R && r
92
92
  })
93
93
  }
94
94
  ),
95
95
  /* @__PURE__ */ t.createElement(
96
96
  "div",
97
97
  {
98
- className: n(a.modal__contentWrapper, {
98
+ className: o(a.modal__contentWrapper, {
99
99
  [a["modal__contentWrapper--image"]]: i
100
100
  }),
101
- ref: o
101
+ tabIndex: r ? 0 : void 0,
102
+ role: r ? "region" : void 0,
103
+ "aria-label": r ? N : void 0,
104
+ "aria-labelledby": r ? f : void 0,
105
+ ref: s
102
106
  },
103
- !e.noCloseButton && /* @__PURE__ */ t.createElement("div", { className: a.modal__closeWrapper }, /* @__PURE__ */ t.createElement("div", { className: n(a.modal__closeWrapper__close) }, /* @__PURE__ */ t.createElement(A, { onClick: e.onClose, ariaLabel: e.ariaLabelCloseBtn }))),
107
+ !e.noCloseButton && /* @__PURE__ */ t.createElement("div", { className: a.modal__closeWrapper }, /* @__PURE__ */ t.createElement("div", { className: o(a.modal__closeWrapper__close) }, /* @__PURE__ */ t.createElement(V, { onClick: e.onClose, ariaLabel: e.ariaLabelCloseBtn }))),
104
108
  /* @__PURE__ */ t.createElement(
105
109
  "div",
106
110
  {
107
- className: n(e.size && a[`modal__contentWrapper__scroll--${e.size}`], {
111
+ className: o(c && a[`modal__contentWrapper__scroll--${c}`], {
108
112
  [a["modal__contentWrapper__scroll--image"]]: i
109
113
  })
110
114
  },
111
- /* @__PURE__ */ t.createElement("div", { ref: r }),
112
- /* @__PURE__ */ t.createElement("div", { className: a.modal__contentWrapper__title }, G(e.variant, e.icon), /* @__PURE__ */ t.createElement(D, { id: y, htmlMarkup: "h3", appearance: "title3", className: T }, e.title), e.afterTitleChildren && /* @__PURE__ */ t.createElement("div", { className: a.modal__afterTitleChildren }, e.afterTitleChildren)),
115
+ /* @__PURE__ */ t.createElement("div", { ref: b }),
116
+ /* @__PURE__ */ t.createElement("div", { className: a.modal__contentWrapper__title }, X(n, e.icon), /* @__PURE__ */ t.createElement(J, { id: f, htmlMarkup: "h3", appearance: "title3", className: F }, e.title), e.afterTitleChildren && /* @__PURE__ */ t.createElement("div", { className: a.modal__afterTitleChildren }, e.afterTitleChildren)),
113
117
  i && /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement("div", { className: a.modal__contentWrapper__imageWrapper }, e.children), /* @__PURE__ */ t.createElement("span", { className: a.modal__contentWrapper__imageDescription }, e.description)),
114
118
  !i && e.children && /* @__PURE__ */ t.createElement("div", null, e.children),
115
119
  !i && !e.children && /* @__PURE__ */ t.createElement("p", { className: a.modal__description }, e.description),
116
- /* @__PURE__ */ t.createElement("div", { ref: f })
120
+ /* @__PURE__ */ t.createElement("div", { ref: g })
117
121
  )
118
122
  ),
119
123
  /* @__PURE__ */ t.createElement(
120
124
  "div",
121
125
  {
122
- className: n(a.modal__shadow, a["modal__shadow--bottom"], {
123
- [a["modal__shadow--show"]]: !k && s
126
+ className: o(a.modal__shadow, a["modal__shadow--bottom"], {
127
+ [a["modal__shadow--show"]]: !z && r
124
128
  })
125
129
  }
126
130
  ),
127
- g && /* @__PURE__ */ t.createElement("div", { className: n(a["modal__call-to-action"], e.size && a[`modal__call-to-action--${e.size}`]) }, e.onSuccess && /* @__PURE__ */ t.createElement(w, { onClick: e.onSuccess }, e.primaryButtonText), e.secondaryButtonText && ((h = e.secondaryButtonText) == null ? void 0 : h.length) > 0 && /* @__PURE__ */ t.createElement(w, { variant: "borderless", onClick: e.onClose }, e.secondaryButtonText))
131
+ h && /* @__PURE__ */ t.createElement("div", { className: o(a["modal__call-to-action"], c && a[`modal__call-to-action--${c}`]) }, e.onSuccess && /* @__PURE__ */ t.createElement(S, { onClick: e.onSuccess }, m), e.secondaryButtonText && ((B = e.secondaryButtonText) == null ? void 0 : B.length) > 0 && /* @__PURE__ */ t.createElement(S, { variant: "borderless", onClick: e.onClose }, e.secondaryButtonText))
128
132
  ))
129
133
  ));
130
134
  if (e.printable) {
131
135
  const l = "print-modal";
132
- return /* @__PURE__ */ t.createElement(O, { className: l, testId: "print-modal" }, /* @__PURE__ */ t.createElement("style", { media: "print" }, `body > *:not(.${l}) {display: none;}`), b);
136
+ return /* @__PURE__ */ t.createElement(G, { className: l, testId: "print-modal" }, /* @__PURE__ */ t.createElement("style", { media: "print" }, `body > *:not(.${l}) {display: none;}`), w);
133
137
  }
134
- return b;
138
+ return w;
135
139
  };
136
- J.defaultProps = j;
137
140
  export {
138
- Z as ModalSize,
139
- V as ModalVariants,
140
- J as default
141
+ Q as ModalSize,
142
+ M as ModalVariants,
143
+ fe as default
141
144
  };
142
145
  //# sourceMappingURL=Modal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.js","sources":["../../../src/components/Modal/Modal.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\n\nimport cn from 'classnames';\n\nimport { AnalyticsId, ZIndex } from '../../constants';\nimport useFocusTrap from '../../hooks/useFocusTrap';\nimport { useIsVisible } from '../../hooks/useIsVisible';\nimport { palette } from '../../theme/palette';\nimport { uuid } from '../../utils/uuid';\nimport Button from '../Button';\nimport Close from '../Close';\nimport Icon, { IconSize } from '../Icon';\nimport AlertSignFill from '../Icons/AlertSignFill';\nimport AlertSignStroke from '../Icons/AlertSignStroke';\nimport CheckOutline from '../Icons/CheckOutline';\nimport Portal from '../Portal';\nimport Title from '../Title/Title';\n\nimport styles from './styles.module.scss';\n\nexport enum ModalVariants {\n normal = 'normal',\n warning = 'warning',\n error = 'error',\n success = 'success',\n image = 'image',\n}\n\nexport enum ModalSize {\n large = 'large',\n medium = 'medium',\n}\n\nexport interface ModalProps {\n /** Title of the modal */\n title: string;\n /** id of the modal title */\n titleId?: string;\n /** Description of the modal. Will not render if the modal has children. */\n description?: string;\n /** Changes the visual representation of the modal */\n variant?: keyof typeof ModalVariants;\n /** Change width of the modal (default: large) */\n size?: keyof typeof ModalSize;\n /** Icon displayed in title */\n icon?: React.ReactElement;\n /** Hides the close button */\n noCloseButton?: boolean;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Primary button text */\n primaryButtonText?: string;\n /** Secondary button text */\n secondaryButtonText?: string;\n /** Sets the aria-label of the modal */\n ariaLabel?: string;\n /** Sets the aria-labelledby of the modal */\n ariaLabelledBy?: string;\n /** Close button aria-label */\n ariaLabelCloseBtn?: string;\n /** Alternative component to modal */\n children?: React.ReactNode;\n /** Component shown after title */\n afterTitleChildren?: React.ReactNode;\n /** Adds custom classes to the element. */\n className?: string;\n /** Customize the z-index of the modal */\n zIndex?: number;\n /** Function is called when user clicks primary button */\n onSuccess?: () => void;\n /** Function is called when user clicks secondary button, clicks escape or outside the modal */\n onClose?: () => void;\n /** When enabled the component will be rendered in the bottom of document.body */\n printable?: boolean;\n /** If disabled, clicking escape or outside the modal will not close it */\n disableCloseEvents?: boolean;\n}\n\nconst defaultProps = {\n variant: ModalVariants.normal,\n primaryButtonText: 'OK',\n titleId: uuid(),\n className: '',\n size: ModalSize.large,\n zIndex: ZIndex.Modal,\n};\n\nconst getVariantIcon = (variant?: ModalProps['variant']): JSX.Element | null => {\n if (variant === ModalVariants.error) {\n return <Icon size={IconSize.Small} svgIcon={AlertSignFill} color={palette.cherry500} />;\n } else if (variant === ModalVariants.warning) {\n return <Icon size={IconSize.Small} svgIcon={AlertSignStroke} color={palette.black} />;\n } else if (variant === ModalVariants.success) {\n return <Icon size={IconSize.Small} svgIcon={CheckOutline} color={palette.kiwi900} />;\n }\n return null;\n};\n\nconst getIcon = (variant?: ModalProps['variant'], icon?: ModalProps['icon']): JSX.Element | null => {\n const variantIcon = getVariantIcon(variant);\n if (variantIcon) {\n return <div className={styles.modal__iconWrapper}>{variantIcon}</div>;\n }\n if (icon) {\n return (\n <div className={styles.modal__iconWrapper}>\n {React.cloneElement(icon, {\n size: IconSize.Small,\n })}\n </div>\n );\n }\n return null;\n};\n\nconst Modal = (props: ModalProps): JSX.Element => {\n const topContent = React.useRef<HTMLDivElement>(null);\n const modalContentRef = React.useRef<HTMLDivElement>(null);\n const dialogRef = React.useRef<HTMLDivElement>(null);\n useFocusTrap(dialogRef, true);\n const topContentVisible = useIsVisible(topContent);\n const bottomContent = React.useRef<HTMLDivElement>(null);\n const bottomContentVisible = useIsVisible(bottomContent);\n const contentIsScrollable = modalContentRef.current && modalContentRef.current.scrollHeight > modalContentRef.current.clientHeight;\n\n function handleKeyboardEvent(e: KeyboardEvent): void {\n if (e.key === 'Escape' && props.onClose) {\n e.stopPropagation();\n props.onClose();\n }\n }\n\n function handleClickEvent(event: MouseEvent): void {\n if (event.target && overlayRef.current === event.target && props.onClose) {\n event.stopPropagation();\n props.onClose();\n }\n }\n\n function disableBodyScroll(): void {\n document.body.style.overflow = 'hidden';\n }\n\n function enableBodyScroll(): void {\n document.body.style.removeProperty('overflow');\n }\n\n /* Displays a full window size modal with image */\n const imageView = props.variant === ModalVariants.image;\n\n const overlayRef = React.useRef<HTMLDivElement>(null);\n\n const showActions = (props.secondaryButtonText && props.secondaryButtonText?.length > 0) || props.onSuccess;\n\n // ariaLabelledBy prioriteres over ariaLabel, men dersom ariaLabel brukes trengs ikke ariaLabelledBy\n const ariaLabel = !props.ariaLabelledBy ? props.ariaLabel : undefined;\n const ariaLabelledBy = props.ariaLabelledBy ? props.ariaLabelledBy : !props.ariaLabel ? props.titleId : undefined;\n\n useEffect(() => {\n const overlayElement = overlayRef.current;\n disableBodyScroll();\n if (!props.disableCloseEvents && overlayElement) {\n overlayElement.addEventListener('keydown', handleKeyboardEvent);\n overlayElement.addEventListener('click', handleClickEvent);\n }\n return (): void => {\n enableBodyScroll();\n if (!props.disableCloseEvents && overlayElement) {\n overlayElement.removeEventListener('keydown', handleKeyboardEvent);\n overlayElement.removeEventListener('click', handleClickEvent);\n }\n };\n }, [props.disableCloseEvents]);\n\n useEffect(() => {\n dialogRef.current?.focus();\n }, []);\n\n const dialogClasses = cn(\n props.className,\n styles.modal,\n props.variant && styles[`modal--${props.variant}`],\n props.size && styles[`modal--${props.size}`],\n contentIsScrollable && !showActions && styles['modal--no-actions']\n );\n\n const titleClasses = cn({\n [styles['modal__title--error']]: props.variant === ModalVariants.error,\n [styles['modal__title--success']]: props.variant === ModalVariants.success,\n });\n\n const Component = (\n <div data-testid=\"dialog-container\">\n <div\n ref={overlayRef}\n className={styles['modal-overlay']}\n data-testid={props.testId}\n data-analyticsid={AnalyticsId.Modal}\n style={{ zIndex: props.zIndex }}\n >\n <div className={styles.align}>\n <div\n className={dialogClasses}\n role=\"dialog\"\n aria-modal=\"true\"\n tabIndex={-1}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n ref={dialogRef}\n >\n <div\n className={cn(styles['modal__shadow'], styles['modal__shadow--top'], {\n [styles['modal__shadow--show']]: !topContentVisible && contentIsScrollable,\n })}\n />\n <div\n className={cn(styles.modal__contentWrapper, {\n [styles['modal__contentWrapper--image']]: imageView,\n })}\n ref={modalContentRef}\n >\n {!props.noCloseButton && (\n <div className={styles.modal__closeWrapper}>\n <div className={cn(styles.modal__closeWrapper__close)}>\n <Close onClick={props.onClose} ariaLabel={props.ariaLabelCloseBtn} />\n </div>\n </div>\n )}\n <div\n className={cn(props.size && styles[`modal__contentWrapper__scroll--${props.size}`], {\n [styles['modal__contentWrapper__scroll--image']]: imageView,\n })}\n >\n <div ref={topContent} />\n <div className={styles.modal__contentWrapper__title}>\n {getIcon(props.variant, props.icon)}\n <Title id={ariaLabelledBy} htmlMarkup=\"h3\" appearance=\"title3\" className={titleClasses}>\n {props.title}\n </Title>\n {props.afterTitleChildren && <div className={styles['modal__afterTitleChildren']}>{props.afterTitleChildren}</div>}\n </div>\n {imageView && (\n <div>\n <div className={styles['modal__contentWrapper__imageWrapper']}>{props.children}</div>\n <span className={styles['modal__contentWrapper__imageDescription']}>{props.description}</span>\n </div>\n )}\n {!imageView && props.children && <div>{props.children}</div>}\n {!imageView && !props.children && <p className={styles.modal__description}>{props.description}</p>}\n <div ref={bottomContent} />\n </div>\n </div>\n <div\n className={cn(styles['modal__shadow'], styles['modal__shadow--bottom'], {\n [styles['modal__shadow--show']]: !bottomContentVisible && contentIsScrollable,\n })}\n />\n {showActions && (\n <div className={cn(styles['modal__call-to-action'], props.size && styles[`modal__call-to-action--${props.size}`])}>\n {props.onSuccess && <Button onClick={props.onSuccess}>{props.primaryButtonText}</Button>}\n {props.secondaryButtonText && props.secondaryButtonText?.length > 0 && (\n <Button variant=\"borderless\" onClick={props.onClose}>\n {props.secondaryButtonText}\n </Button>\n )}\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n );\n\n if (props.printable) {\n const printModal = 'print-modal';\n return (\n <Portal className={printModal} testId=\"print-modal\">\n <style media=\"print\">{`body > *:not(.${printModal}) {display: none;}`}</style>\n {Component}\n </Portal>\n );\n }\n\n return Component;\n};\n\nModal.defaultProps = defaultProps;\n\nexport default Modal;\n"],"names":["ModalVariants","ModalSize","defaultProps","uuid","ZIndex","getVariantIcon","variant","React","Icon","IconSize","AlertSignFill","palette","AlertSignStroke","CheckOutline","getIcon","icon","variantIcon","styles","Modal","props","topContent","modalContentRef","dialogRef","useFocusTrap","topContentVisible","useIsVisible","bottomContent","bottomContentVisible","contentIsScrollable","handleKeyboardEvent","e","handleClickEvent","event","overlayRef","disableBodyScroll","enableBodyScroll","imageView","showActions","_a","ariaLabel","ariaLabelledBy","useEffect","overlayElement","dialogClasses","cn","titleClasses","Component","AnalyticsId","Close","Title","Button","_b","printModal","Portal"],"mappings":";;;;;;;;;;;;;;;;AAoBY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,UAAU,WACVA,EAAA,QAAQ,SACRA,EAAA,UAAU,WACVA,EAAA,QAAQ,SALEA,IAAAA,KAAA,CAAA,CAAA,GAQAC,sBAAAA,OACVA,EAAA,QAAQ,SACRA,EAAA,SAAS,UAFCA,IAAAA,KAAA,CAAA,CAAA;AAkDZ,MAAMC,IAAe;AAAA,EACnB,SAAS;AAAA,EACT,mBAAmB;AAAA,EACnB,SAASC,EAAK;AAAA,EACd,WAAW;AAAA,EACX,MAAM;AAAA,EACN,QAAQC,EAAO;AACjB,GAEMC,IAAiB,CAACC,MAClBA,MAAY,UACPC,gBAAAA,EAAA,cAACC,KAAK,MAAMC,EAAS,OAAO,SAASC,GAAe,OAAOC,EAAQ,UAAW,CAAA,IAC5EL,MAAY,YACdC,gBAAAA,EAAA,cAACC,KAAK,MAAMC,EAAS,OAAO,SAASG,GAAiB,OAAOD,EAAQ,MAAO,CAAA,IAC1EL,MAAY,YACdC,gBAAAA,EAAA,cAACC,KAAK,MAAMC,EAAS,OAAO,SAASI,GAAc,OAAOF,EAAQ,QAAS,CAAA,IAE7E,MAGHG,IAAU,CAACR,GAAiCS,MAAkD;AAC5F,QAAAC,IAAcX,EAAeC,CAAO;AAC1C,SAAIU,IACMT,gBAAAA,EAAA,cAAA,OAAA,EAAI,WAAWU,EAAO,sBAAqBD,CAAY,IAE7DD,oCAEC,OAAI,EAAA,WAAWE,EAAO,sBACpBV,EAAM,aAAaQ,GAAM;AAAA,IACxB,MAAMN,EAAS;AAAA,EAChB,CAAA,CACH,IAGG;AACT,GAEMS,IAAQ,CAACC,MAAmC;;AAC1C,QAAAC,IAAab,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,GAAA,iBAAiB6C,CAAU,oBAAqB,GACrEN,CACH;AAAA,EAEJ;AAEO,SAAAA;AACT;AAEA5B,EAAM,eAAehB;"}
1
+ {"version":3,"file":"Modal.js","sources":["../../../src/components/Modal/Modal.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\n\nimport cn from 'classnames';\n\nimport { AnalyticsId, ZIndex } from '../../constants';\nimport useFocusTrap from '../../hooks/useFocusTrap';\nimport { useIsVisible } from '../../hooks/useIsVisible';\nimport { palette } from '../../theme/palette';\nimport { uuid } from '../../utils/uuid';\nimport Button from '../Button';\nimport Close from '../Close';\nimport Icon, { IconSize } from '../Icon';\nimport AlertSignFill from '../Icons/AlertSignFill';\nimport AlertSignStroke from '../Icons/AlertSignStroke';\nimport CheckOutline from '../Icons/CheckOutline';\nimport Portal from '../Portal';\nimport Title from '../Title/Title';\n\nimport styles from './styles.module.scss';\n\nexport enum ModalVariants {\n normal = 'normal',\n warning = 'warning',\n error = 'error',\n success = 'success',\n image = 'image',\n}\n\nexport enum ModalSize {\n large = 'large',\n medium = 'medium',\n}\n\nexport interface ModalProps {\n /** Title of the modal */\n title: string;\n /** id of the modal title */\n titleId?: string;\n /** Description of the modal. Will not render if the modal has children. */\n description?: string;\n /** Changes the visual representation of the modal */\n variant?: keyof typeof ModalVariants;\n /** Change width of the modal (default: large) */\n size?: keyof typeof ModalSize;\n /** Icon displayed in title */\n icon?: React.ReactElement;\n /** Hides the close button */\n noCloseButton?: boolean;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Primary button text */\n primaryButtonText?: string;\n /** Secondary button text */\n secondaryButtonText?: string;\n /** Sets the aria-label of the modal */\n ariaLabel?: string;\n /** Sets the aria-labelledby of the modal */\n ariaLabelledBy?: string;\n /** Close button aria-label */\n ariaLabelCloseBtn?: string;\n /** Alternative component to modal */\n children?: React.ReactNode;\n /** Component shown after title */\n afterTitleChildren?: React.ReactNode;\n /** Adds custom classes to the element. */\n className?: string;\n /** Customize the z-index of the modal */\n zIndex?: number;\n /** Function is called when user clicks primary button */\n onSuccess?: () => void;\n /** Function is called when user clicks secondary button, clicks escape or outside the modal */\n onClose?: () => void;\n /** When enabled the component will be rendered in the bottom of document.body */\n printable?: boolean;\n /** If disabled, clicking escape or outside the modal will not close it */\n disableCloseEvents?: boolean;\n}\n\nconst getVariantIcon = (variant?: ModalProps['variant']): JSX.Element | null => {\n if (variant === ModalVariants.error) {\n return <Icon size={IconSize.Small} svgIcon={AlertSignFill} color={palette.cherry500} />;\n } else if (variant === ModalVariants.warning) {\n return <Icon size={IconSize.Small} svgIcon={AlertSignStroke} color={palette.black} />;\n } else if (variant === ModalVariants.success) {\n return <Icon size={IconSize.Small} svgIcon={CheckOutline} color={palette.kiwi900} />;\n }\n return null;\n};\n\nconst getIcon = (variant?: ModalProps['variant'], icon?: ModalProps['icon']): JSX.Element | null => {\n const variantIcon = getVariantIcon(variant);\n if (variantIcon) {\n return <div className={styles.modal__iconWrapper}>{variantIcon}</div>;\n }\n if (icon) {\n return (\n <div className={styles.modal__iconWrapper}>\n {React.cloneElement(icon, {\n size: IconSize.Small,\n })}\n </div>\n );\n }\n return null;\n};\n\nconst Modal: React.FC<ModalProps> = props => {\n const {\n variant = ModalVariants.normal,\n primaryButtonText = 'OK',\n titleId = uuid(),\n className = '',\n size = ModalSize.large,\n zIndex = ZIndex.Modal,\n } = props;\n\n const topContent = React.useRef<HTMLDivElement>(null);\n const modalContentRef = React.useRef<HTMLDivElement>(null);\n const dialogRef = React.useRef<HTMLDivElement>(null);\n useFocusTrap(dialogRef, true);\n const topContentVisible = useIsVisible(topContent);\n const bottomContent = React.useRef<HTMLDivElement>(null);\n const bottomContentVisible = useIsVisible(bottomContent);\n const contentIsScrollable = modalContentRef.current && modalContentRef.current.scrollHeight > modalContentRef.current.clientHeight;\n\n function handleKeyboardEvent(e: KeyboardEvent): void {\n if (e.key === 'Escape' && props.onClose) {\n e.stopPropagation();\n props.onClose();\n }\n }\n\n function handleClickEvent(event: MouseEvent): void {\n if (event.target && overlayRef.current === event.target && props.onClose) {\n event.stopPropagation();\n props.onClose();\n }\n }\n\n function disableBodyScroll(): void {\n document.body.style.overflow = 'hidden';\n }\n\n function enableBodyScroll(): void {\n document.body.style.removeProperty('overflow');\n }\n\n /* Displays a full window size modal with image */\n const imageView = variant === ModalVariants.image;\n\n const overlayRef = React.useRef<HTMLDivElement>(null);\n\n const showActions = (props.secondaryButtonText && props.secondaryButtonText?.length > 0) || props.onSuccess;\n\n // ariaLabelledBy prioriteres over ariaLabel, men dersom ariaLabel brukes trengs ikke ariaLabelledBy\n const ariaLabel = !props.ariaLabelledBy ? props.ariaLabel : undefined;\n const ariaLabelledBy = props.ariaLabelledBy ? props.ariaLabelledBy : !props.ariaLabel ? titleId : undefined;\n\n useEffect(() => {\n const overlayElement = overlayRef.current;\n disableBodyScroll();\n if (!props.disableCloseEvents && overlayElement) {\n overlayElement.addEventListener('keydown', handleKeyboardEvent);\n overlayElement.addEventListener('click', handleClickEvent);\n }\n return (): void => {\n enableBodyScroll();\n if (!props.disableCloseEvents && overlayElement) {\n overlayElement.removeEventListener('keydown', handleKeyboardEvent);\n overlayElement.removeEventListener('click', handleClickEvent);\n }\n };\n }, [props.disableCloseEvents]);\n\n useEffect(() => {\n dialogRef.current?.focus();\n }, []);\n\n const dialogClasses = cn(\n className,\n styles.modal,\n variant && styles[`modal--${variant}`],\n size && styles[`modal--${size}`],\n contentIsScrollable && !showActions && styles['modal--no-actions']\n );\n\n const titleClasses = cn({\n [styles['modal__title--error']]: variant === ModalVariants.error,\n [styles['modal__title--success']]: variant === ModalVariants.success,\n });\n\n const Component = (\n <div data-testid=\"dialog-container\">\n <div\n ref={overlayRef}\n className={styles['modal-overlay']}\n data-testid={props.testId}\n data-analyticsid={AnalyticsId.Modal}\n style={{ zIndex }}\n >\n <div className={styles.align}>\n <div\n className={dialogClasses}\n role=\"dialog\"\n aria-modal=\"true\"\n tabIndex={-1}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n ref={dialogRef}\n >\n <div\n className={cn(styles['modal__shadow'], styles['modal__shadow--top'], {\n [styles['modal__shadow--show']]: !topContentVisible && contentIsScrollable,\n })}\n />\n <div\n className={cn(styles.modal__contentWrapper, {\n [styles['modal__contentWrapper--image']]: imageView,\n })}\n tabIndex={contentIsScrollable ? 0 : undefined}\n role={contentIsScrollable ? 'region' : undefined}\n aria-label={contentIsScrollable ? ariaLabel : undefined}\n aria-labelledby={contentIsScrollable ? ariaLabelledBy : undefined}\n ref={modalContentRef}\n >\n {!props.noCloseButton && (\n <div className={styles.modal__closeWrapper}>\n <div className={cn(styles.modal__closeWrapper__close)}>\n <Close onClick={props.onClose} ariaLabel={props.ariaLabelCloseBtn} />\n </div>\n </div>\n )}\n <div\n className={cn(size && styles[`modal__contentWrapper__scroll--${size}`], {\n [styles['modal__contentWrapper__scroll--image']]: imageView,\n })}\n >\n <div ref={topContent} />\n <div className={styles.modal__contentWrapper__title}>\n {getIcon(variant, props.icon)}\n <Title id={ariaLabelledBy} htmlMarkup=\"h3\" appearance=\"title3\" className={titleClasses}>\n {props.title}\n </Title>\n {props.afterTitleChildren && <div className={styles['modal__afterTitleChildren']}>{props.afterTitleChildren}</div>}\n </div>\n {imageView && (\n <div>\n <div className={styles['modal__contentWrapper__imageWrapper']}>{props.children}</div>\n <span className={styles['modal__contentWrapper__imageDescription']}>{props.description}</span>\n </div>\n )}\n {!imageView && props.children && <div>{props.children}</div>}\n {!imageView && !props.children && <p className={styles.modal__description}>{props.description}</p>}\n <div ref={bottomContent} />\n </div>\n </div>\n <div\n className={cn(styles['modal__shadow'], styles['modal__shadow--bottom'], {\n [styles['modal__shadow--show']]: !bottomContentVisible && contentIsScrollable,\n })}\n />\n {showActions && (\n <div className={cn(styles['modal__call-to-action'], size && styles[`modal__call-to-action--${size}`])}>\n {props.onSuccess && <Button onClick={props.onSuccess}>{primaryButtonText}</Button>}\n {props.secondaryButtonText && props.secondaryButtonText?.length > 0 && (\n <Button variant=\"borderless\" onClick={props.onClose}>\n {props.secondaryButtonText}\n </Button>\n )}\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n );\n\n if (props.printable) {\n const printModal = 'print-modal';\n return (\n <Portal className={printModal} testId=\"print-modal\">\n <style media=\"print\">{`body > *:not(.${printModal}) {display: none;}`}</style>\n {Component}\n </Portal>\n );\n }\n\n return Component;\n};\n\nexport default Modal;\n"],"names":["ModalVariants","ModalSize","getVariantIcon","variant","React","Icon","IconSize","AlertSignFill","palette","AlertSignStroke","CheckOutline","getIcon","icon","variantIcon","styles","Modal","props","primaryButtonText","titleId","uuid","className","size","zIndex","ZIndex","topContent","modalContentRef","dialogRef","useFocusTrap","topContentVisible","useIsVisible","bottomContent","bottomContentVisible","contentIsScrollable","handleKeyboardEvent","e","handleClickEvent","event","overlayRef","disableBodyScroll","enableBodyScroll","imageView","showActions","_a","ariaLabel","ariaLabelledBy","useEffect","overlayElement","dialogClasses","cn","titleClasses","Component","AnalyticsId","Close","Title","Button","_b","printModal","Portal"],"mappings":";;;;;;;;;;;;;;;;AAoBY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,UAAU,WACVA,EAAA,QAAQ,SACRA,EAAA,UAAU,WACVA,EAAA,QAAQ,SALEA,IAAAA,KAAA,CAAA,CAAA,GAQAC,sBAAAA,OACVA,EAAA,QAAQ,SACRA,EAAA,SAAS,UAFCA,IAAAA,KAAA,CAAA,CAAA;AAkDZ,MAAMC,IAAiB,CAACC,MAClBA,MAAY,UACPC,gBAAAA,EAAA,cAACC,KAAK,MAAMC,EAAS,OAAO,SAASC,GAAe,OAAOC,EAAQ,UAAW,CAAA,IAC5EL,MAAY,YACdC,gBAAAA,EAAA,cAACC,KAAK,MAAMC,EAAS,OAAO,SAASG,GAAiB,OAAOD,EAAQ,MAAO,CAAA,IAC1EL,MAAY,YACdC,gBAAAA,EAAA,cAACC,KAAK,MAAMC,EAAS,OAAO,SAASI,GAAc,OAAOF,EAAQ,QAAS,CAAA,IAE7E,MAG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AA,OAAA,EAAI,WAAW4C,EAAGlC,EAAO,uBAAuB,GAAGO,KAAQP,EAAO,0BAA0BO,CAAI,EAAE,CAAC,EACjG,GAAAL,EAAM,aAAcZ,gBAAAA,EAAA,cAAAkD,GAAA,EAAO,SAAStC,EAAM,aAAYC,CAAkB,GACxED,EAAM,yBAAuBuC,IAAAvC,EAAM,wBAAN,gBAAAuC,EAA2B,UAAS,KAC/DnD,gBAAAA,EAAA,cAAAkD,GAAA,EAAO,SAAQ,cAAa,SAAStC,EAAM,QACzC,GAAAA,EAAM,mBACT,CAEJ;AAAA,IAAA,CAGN;AAAA,EAAA,CAEJ;AAGF,MAAIA,EAAM,WAAW;AACnB,UAAMwC,IAAa;AACnB,WACGpD,gBAAAA,EAAA,cAAAqD,GAAA,EAAO,WAAWD,GAAY,QAAO,cACpC,GAAApD,gBAAAA,EAAA,cAAC,SAAM,EAAA,OAAM,QAAS,GAAA,iBAAiBoD,CAAU,oBAAqB,GACrEN,CACH;AAAA,EAEJ;AAEO,SAAAA;AACT;"}
@@ -144,13 +144,13 @@
144
144
  }
145
145
 
146
146
  &__closeWrapper {
147
+ position: relative;
148
+ width: 100%;
149
+
147
150
  @media print {
148
151
  display: none;
149
152
  }
150
153
 
151
- position: relative;
152
- width: 100%;
153
-
154
154
  &__close {
155
155
  position: absolute;
156
156
  right: getSpacer(3xs);
@@ -39,8 +39,6 @@ $layout-md-col-gap: getSpacer(m);
39
39
  }
40
40
 
41
41
  .panel {
42
- @include panel-padding;
43
-
44
42
  display: flex;
45
43
  flex-direction: column;
46
44
  justify-content: flex-start;
@@ -49,6 +47,8 @@ $layout-md-col-gap: getSpacer(m);
49
47
  width: 100%;
50
48
  box-sizing: border-box;
51
49
 
50
+ @include panel-padding;
51
+
52
52
  &__layout-1,
53
53
  &__layout-2,
54
54
  &__layout-3 {
@@ -19,11 +19,6 @@
19
19
  background-color: $white;
20
20
  z-index: 3;
21
21
  visibility: hidden;
22
-
23
- &--visible {
24
- visibility: visible;
25
- }
26
-
27
22
  border: getSpacer(4xs) solid $plum600;
28
23
  border-radius: 0.5625rem;
29
24
  box-shadow: 0 0.125rem 1.125rem 0 rgb(0 0 0 / 15%);
@@ -33,6 +28,10 @@
33
28
  line-height: $lineheight-size-md;
34
29
  }
35
30
 
31
+ &--visible {
32
+ visibility: visible;
33
+ }
34
+
36
35
  &__arrow {
37
36
  --drop-shadow-color: #{$plum600};
38
37
 
@@ -17,13 +17,13 @@ table .table-body .table-row {
17
17
  }
18
18
 
19
19
  @mixin block {
20
+ display: block;
21
+ clear: both;
22
+
20
23
  .table__head {
21
24
  display: none;
22
25
  }
23
26
 
24
- display: block;
25
- clear: both;
26
-
27
27
  .table-body,
28
28
  .table-row,
29
29
  .table__head-cell,
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { TabProps } from '../Tab';
3
+ import { TabsColors } from '../Tabs';
4
+ interface TabItemProps {
5
+ tabProps: TabProps;
6
+ index: number;
7
+ color: TabsColors;
8
+ selectedTab: number;
9
+ tabRefs: React.MutableRefObject<React.RefObject<HTMLButtonElement>[] | null | undefined>;
10
+ onTabListClick: (index: number) => void;
11
+ }
12
+ declare const TabItem: React.FC<TabItemProps>;
13
+ export default TabItem;
@@ -0,0 +1,45 @@
1
+ import a, { useRef as R, useEffect as E } from "react";
2
+ import T from "classnames";
3
+ import { useIsVisible as y } from "../../../hooks/useIsVisible.js";
4
+ import { palette as i } from "../../../theme/palette.js";
5
+ import { Icon as C } from "../../Icon/Icon.js";
6
+ import { IconSize as f } from "../../../constants.js";
7
+ import { LazyIcon as z } from "../../LazyIcon/LazyIcon.js";
8
+ import l from "../../Tabs/TabList/styles.module.scss";
9
+ const w = (e) => {
10
+ const t = e.index === e.selectedTab, { title: d, onTabClick: o, icon: n, testId: u } = e.tabProps, _ = () => {
11
+ o && o(e.index), e.onTabListClick(e.index), s(e.index);
12
+ }, x = T(l["tab-list__tab"], l[`tab-list__tab--${e.color}`], {
13
+ [l["tab-list__tab--selected"]]: t,
14
+ [l["tab-list__tab--first"]]: e.index == 0
15
+ }), I = e.tabRefs.current && e.tabRefs.current[e.index], s = (k) => {
16
+ var m;
17
+ const c = e.tabRefs.current && e.tabRefs.current[k];
18
+ (m = c == null ? void 0 : c.current) == null || m.scrollIntoView({ behavior: "smooth", inline: "center", block: "nearest" });
19
+ }, r = R(null), b = y(r);
20
+ return E(() => {
21
+ t && b && s(e.index);
22
+ }, [t && b]), /* @__PURE__ */ a.createElement("li", { role: "presentation", ref: r }, /* @__PURE__ */ a.createElement(
23
+ "button",
24
+ {
25
+ role: "tab",
26
+ "aria-selected": t,
27
+ onClick: _,
28
+ className: x,
29
+ "data-testid": u,
30
+ ref: I
31
+ },
32
+ /* @__PURE__ */ a.createElement("span", { className: l["tab-list__tab__title-and-icon"] }, n && (typeof n == "string" ? /* @__PURE__ */ a.createElement(
33
+ z,
34
+ {
35
+ iconName: n,
36
+ size: f.XSmall,
37
+ color: t ? i.black : i.blueberry500
38
+ }
39
+ ) : /* @__PURE__ */ a.createElement(C, { svgIcon: n, size: f.XSmall, color: t ? i.black : i.blueberry500 })), d)
40
+ ));
41
+ };
42
+ export {
43
+ w as default
44
+ };
45
+ //# sourceMappingURL=TabItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabItem.js","sources":["../../../../src/components/Tabs/TabList/TabItem.tsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { useIsVisible } from '../../../hooks/useIsVisible';\nimport { palette } from '../../../theme/palette';\nimport Icon, { IconSize } from '../../Icon';\nimport { IconName } from '../../Icons/IconNames';\nimport LazyIcon from '../../LazyIcon';\nimport { TabProps } from '../Tab';\nimport { TabsColors } from '../Tabs';\n\nimport styles from './styles.module.scss';\n\ninterface TabItemProps {\n tabProps: TabProps;\n index: number;\n color: TabsColors;\n selectedTab: number;\n tabRefs: React.MutableRefObject<React.RefObject<HTMLButtonElement>[] | null | undefined>;\n onTabListClick: (index: number) => void;\n}\n\nconst TabItem: React.FC<TabItemProps> = props => {\n const isSelected = props.index === props.selectedTab;\n const { title, onTabClick, icon, testId } = props.tabProps;\n const handleClick = (): void => {\n onTabClick && onTabClick(props.index);\n props.onTabListClick(props.index);\n scrollToTab(props.index);\n };\n const tabButtonClasses = classNames(styles['tab-list__tab'], styles[`tab-list__tab--${props.color}`], {\n [styles['tab-list__tab--selected']]: isSelected,\n [styles['tab-list__tab--first']]: props.index == 0,\n });\n\n const currentRef = props.tabRefs.current && props.tabRefs.current[props.index];\n\n const scrollToTab = (index: number): void => {\n const currentRef = props.tabRefs.current && props.tabRefs.current[index];\n currentRef?.current?.scrollIntoView({ behavior: 'smooth', inline: 'center', block: 'nearest' });\n };\n\n const itemRef = useRef<HTMLLIElement>(null);\n const isVisible = useIsVisible(itemRef);\n\n useEffect(() => {\n if (isSelected && isVisible) {\n scrollToTab(props.index);\n }\n }, [isSelected && isVisible]);\n\n return (\n <li role=\"presentation\" ref={itemRef}>\n <button\n role=\"tab\"\n aria-selected={isSelected}\n onClick={handleClick}\n className={tabButtonClasses}\n data-testid={testId}\n ref={currentRef as React.RefObject<HTMLButtonElement>}\n >\n <span className={styles['tab-list__tab__title-and-icon']}>\n {icon &&\n (typeof icon === 'string' ? (\n <LazyIcon\n iconName={icon as IconName}\n size={IconSize.XSmall}\n color={isSelected ? palette[`black`] : palette['blueberry500']}\n />\n ) : (\n <Icon svgIcon={icon} size={IconSize.XSmall} color={isSelected ? palette[`black`] : palette['blueberry500']} />\n ))}\n {title}\n </span>\n </button>\n </li>\n );\n};\n\nexport default TabItem;\n"],"names":["TabItem","props","isSelected","title","onTabClick","icon","testId","handleClick","scrollToTab","tabButtonClasses","classNames","styles","currentRef","index","itemRef","useRef","isVisible","useIsVisible","useEffect","React","LazyIcon","IconSize","palette","Icon"],"mappings":";;;;;;;;AAuBA,MAAMA,IAAkC,CAASC,MAAA;AACzC,QAAAC,IAAaD,EAAM,UAAUA,EAAM,aACnC,EAAE,OAAAE,GAAO,YAAAC,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