@helsenorge/designsystem-react 7.13.4 → 8.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 (108) hide show
  1. package/CHANGELOG.md +80 -3
  2. package/__mocks__/matchMedia.d.ts +1 -1
  3. package/components/Checkbox/Checkbox.js +47 -46
  4. package/components/Checkbox/Checkbox.js.map +1 -1
  5. package/components/Checkbox/styles.module.scss +101 -29
  6. package/components/Checkbox/styles.module.scss.d.ts +0 -1
  7. package/components/Chip/Chip.d.ts +31 -0
  8. package/components/Chip/Chip.js +30 -0
  9. package/components/Chip/Chip.js.map +1 -0
  10. package/components/Chip/index.d.ts +3 -0
  11. package/components/Chip/index.js +9 -0
  12. package/components/Chip/styles.module.scss +98 -0
  13. package/components/Chip/styles.module.scss.d.ts +21 -0
  14. package/components/ErrorWrapper/ErrorWrapper.js +5 -5
  15. package/components/ErrorWrapper/ErrorWrapper.js.map +1 -1
  16. package/components/ErrorWrapper/styles.module.scss +0 -5
  17. package/components/EyebrowHeader/EyebrowHeader.d.ts +17 -0
  18. package/components/EyebrowHeader/EyebrowHeader.js +12 -0
  19. package/components/EyebrowHeader/EyebrowHeader.js.map +1 -0
  20. package/components/EyebrowHeader/index.d.ts +3 -0
  21. package/components/EyebrowHeader/index.js +5 -0
  22. package/components/EyebrowHeader/styles.module.scss +5 -0
  23. package/components/FormGroup/styles.module.scss +3 -0
  24. package/components/GridExample/GridExample.d.ts +1 -0
  25. package/components/GridExample/GridExample.js.map +1 -1
  26. package/components/HelpPanel/HelpPanel.d.ts +2 -2
  27. package/components/HelpPanel/HelpPanel.js +10 -10
  28. package/components/HelpPanel/HelpPanel.js.map +1 -1
  29. package/components/{HighlightBox/HighlightBox.d.ts → HighlightPanel/HighlightPanel.d.ts} +10 -10
  30. package/components/HighlightPanel/HighlightPanel.js +61 -0
  31. package/components/HighlightPanel/HighlightPanel.js.map +1 -0
  32. package/components/HighlightPanel/index.d.ts +3 -0
  33. package/components/HighlightPanel/index.js +7 -0
  34. package/components/HighlightPanel/index.js.map +1 -0
  35. package/components/{HighlightBox → HighlightPanel}/styles.module.scss +17 -17
  36. package/components/HighlightPanel/styles.module.scss.d.ts +25 -0
  37. package/components/HorizontalScroll/HorizontalScroll.d.ts +1 -0
  38. package/components/HorizontalScroll/HorizontalScroll.js.map +1 -1
  39. package/components/NotificationPanel/NotificationPanel.d.ts +1 -1
  40. package/components/NotificationPanel/NotificationPanel.js +23 -23
  41. package/components/NotificationPanel/NotificationPanel.js.map +1 -1
  42. package/components/NotificationPanel/styles.module.scss +0 -14
  43. package/components/NotificationPanel/styles.module.scss.d.ts +0 -1
  44. package/components/RadioButton/RadioButton.js +42 -41
  45. package/components/RadioButton/RadioButton.js.map +1 -1
  46. package/components/RadioButton/styles.module.scss +41 -35
  47. package/components/ServiceMessage/ServiceMessage.js +25 -25
  48. package/components/ServiceMessage/ServiceMessage.js.map +1 -1
  49. package/components/ServiceMessage/styles.module.scss +0 -13
  50. package/components/ServiceMessage/styles.module.scss.d.ts +0 -1
  51. package/components/Tabs/Tabs.d.ts +1 -0
  52. package/components/Tabs/Tabs.js.map +1 -1
  53. package/components/Tag/Tag.d.ts +3 -9
  54. package/components/Tag/Tag.js +16 -42
  55. package/components/Tag/Tag.js.map +1 -1
  56. package/components/Tag/index.js +5 -6
  57. package/components/Tag/styles.module.scss +5 -105
  58. package/components/Tag/styles.module.scss.d.ts +0 -4
  59. package/components/TagList/TagList.d.ts +1 -0
  60. package/components/TagList/TagList.js.map +1 -1
  61. package/components/Tooltip/Tooltip.d.ts +4 -1
  62. package/components/Tooltip/Tooltip.js.map +1 -1
  63. package/components/Validation/Validation.d.ts +0 -5
  64. package/components/Validation/Validation.js +11 -12
  65. package/components/Validation/Validation.js.map +1 -1
  66. package/components/Validation/ValidationSummary.js +2 -2
  67. package/components/Validation/ValidationSummary.js.map +1 -1
  68. package/components/Validation/styles.module.scss +20 -14
  69. package/components/Validation/styles.module.scss.d.ts +5 -5
  70. package/constants.d.ts +5 -2
  71. package/constants.js +2 -2
  72. package/constants.js.map +1 -1
  73. package/package.json +3 -3
  74. package/scss/supernova/index.css +2 -2
  75. package/scss/supernova/styles/colors.css +1 -1
  76. package/utils/tests/setup-test.d.ts +1 -1
  77. package/_virtual/assert.js +0 -5
  78. package/_virtual/assert.js.map +0 -1
  79. package/_virtual/ast.js +0 -5
  80. package/_virtual/ast.js.map +0 -1
  81. package/_virtual/code.js +0 -5
  82. package/_virtual/code.js.map +0 -1
  83. package/_virtual/doctrine.js +0 -5
  84. package/_virtual/doctrine.js.map +0 -1
  85. package/_virtual/errors.js +0 -5
  86. package/_virtual/errors.js.map +0 -1
  87. package/_virtual/index.js +0 -5
  88. package/_virtual/inherits_browser.js +0 -5
  89. package/_virtual/inherits_browser.js.map +0 -1
  90. package/_virtual/keyword.js +0 -5
  91. package/_virtual/keyword.js.map +0 -1
  92. package/_virtual/typed.js +0 -5
  93. package/_virtual/typed.js.map +0 -1
  94. package/_virtual/types.js +0 -5
  95. package/_virtual/types.js.map +0 -1
  96. package/_virtual/util.js +0 -5
  97. package/_virtual/util.js.map +0 -1
  98. package/_virtual/utility.js +0 -5
  99. package/_virtual/utility.js.map +0 -1
  100. package/_virtual/utils.js +0 -5
  101. package/_virtual/utils.js.map +0 -1
  102. package/components/HighlightBox/HighlightBox.js +0 -61
  103. package/components/HighlightBox/HighlightBox.js.map +0 -1
  104. package/components/HighlightBox/index.d.ts +0 -3
  105. package/components/HighlightBox/index.js +0 -7
  106. package/components/HighlightBox/styles.module.scss.d.ts +0 -25
  107. /package/components/{HighlightBox → Chip}/index.js.map +0 -0
  108. /package/{_virtual → components/EyebrowHeader}/index.js.map +0 -0
@@ -0,0 +1,98 @@
1
+ @use 'sass:map';
2
+ @import '../../scss/spacers';
3
+ @import '../../scss/breakpoints';
4
+ @import '../../scss/palette';
5
+ @import '../../scss/font-settings';
6
+
7
+ .chip {
8
+ $chip: &;
9
+
10
+ display: inline-flex;
11
+ justify-content: space-between;
12
+ align-items: center;
13
+ text-transform: uppercase;
14
+ border-width: 1px;
15
+ border-style: solid;
16
+ background-color: transparent;
17
+
18
+ // komponenten bruker ekstra liten font-size og line-height
19
+ font-size: 0.875rem;
20
+ line-height: 1.125rem;
21
+ font-weight: 600;
22
+ border-radius: 100px;
23
+ cursor: pointer;
24
+ font-family: inherit;
25
+
26
+ $colors: 'blueberry', 'neutral', 'cherry', 'banana', 'kiwi', 'plum';
27
+
28
+ @each $color in $colors {
29
+ &--#{$color},
30
+ // Sørg for at fargene overstyrer dersom chip har type=button
31
+ &--#{$color}[type='button'] {
32
+ // banana og kiwi har unntak fra hovedregelen
33
+ @if $color == 'banana' {
34
+ color: map.get($palette-map, #{$color}900);
35
+ border-color: map.get($palette-map, #{$color}300);
36
+ } @else if $color == 'kiwi' {
37
+ color: map.get($palette-map, #{$color}900);
38
+ border-color: map.get($palette-map, #{$color}200);
39
+ } @else {
40
+ color: map.get($palette-map, #{$color}800);
41
+ border-color: map.get($palette-map, #{$color}200);
42
+ }
43
+
44
+ &#{$chip}--normal {
45
+ &:hover {
46
+ background-color: rgba-to-rgb(rgba(map.get($palette-map, #{$color}200), 0.2));
47
+ }
48
+ }
49
+
50
+ &#{$chip}--oncolor {
51
+ background-color: transparent;
52
+
53
+ &:hover {
54
+ background-color: map.get($palette-map, #{$color}100);
55
+ border-color: map.get($palette-map, #{$color}100);
56
+ }
57
+
58
+ &:focus {
59
+ background-color: $white;
60
+ border-color: $white;
61
+ box-shadow: 0 0 0 3px $black;
62
+ }
63
+ }
64
+
65
+ &#{$chip}--emphasised {
66
+ background-color: map.get($palette-map, #{$color}50);
67
+
68
+ &:hover {
69
+ @if $color == 'banana' {
70
+ background-color: rgba-to-rgb(rgba(map.get($palette-map, #{$color}300), 0.5));
71
+ } @else {
72
+ background-color: rgba-to-rgb(rgba(map.get($palette-map, #{$color}200), 0.5));
73
+ }
74
+ }
75
+ }
76
+ }
77
+ }
78
+
79
+ &:focus {
80
+ outline: none;
81
+ border-color: $black;
82
+ box-shadow: inset 0 0 0 2px $black;
83
+ }
84
+
85
+ &#{$chip}--undo {
86
+ text-decoration: line-through;
87
+ }
88
+
89
+ &--medium {
90
+ padding: 0 getSpacer(3xs) 0 getSpacer(xs);
91
+ min-height: 1.875rem;
92
+ }
93
+
94
+ &--large {
95
+ padding: getSpacer(4xs) getSpacer(3xs) getSpacer(4xs) getSpacer(xs);
96
+ min-height: 2.125rem;
97
+ }
98
+ }
@@ -0,0 +1,21 @@
1
+ export type Styles = {
2
+ chip: string;
3
+ 'chip--banana': string;
4
+ 'chip--blueberry': string;
5
+ 'chip--cherry': string;
6
+ 'chip--emphasised': string;
7
+ 'chip--kiwi': string;
8
+ 'chip--large': string;
9
+ 'chip--medium': string;
10
+ 'chip--neutral': string;
11
+ 'chip--normal': string;
12
+ 'chip--oncolor': string;
13
+ 'chip--plum': string;
14
+ 'chip--undo': string;
15
+ };
16
+
17
+ export type ClassNames = keyof Styles;
18
+
19
+ declare const styles: Styles;
20
+
21
+ export default styles;
@@ -1,9 +1,9 @@
1
- import t from "react";
2
- import o from "classnames";
3
- import e from "../ErrorWrapper/styles.module.scss";
1
+ import e from "react";
2
+ import s from "classnames";
3
+ import t from "../ErrorWrapper/styles.module.scss";
4
4
  const c = (r) => {
5
- const a = o(e["error-wrapper"], r.errorText && e["error-wrapper--with-error"], r.className);
6
- return /* @__PURE__ */ t.createElement("div", { className: a, "data-testid": r.testId }, r.errorText && /* @__PURE__ */ t.createElement("p", { className: e["error-wrapper__errors"], id: r.errorTextId }, r.errorText), r.children);
5
+ const a = s(r.errorText && t["error-wrapper--with-error"], r.className);
6
+ return /* @__PURE__ */ e.createElement("div", { className: a, "data-testid": r.testId }, r.errorText && /* @__PURE__ */ e.createElement("p", { className: t["error-wrapper__errors"], id: r.errorTextId }, r.errorText), r.children);
7
7
  };
8
8
  export {
9
9
  c as ErrorWrapper,
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorWrapper.js","sources":["../../../src/components/ErrorWrapper/ErrorWrapper.tsx"],"sourcesContent":["import React from 'react';\n\nimport cn from 'classnames';\n\nimport styles from './styles.module.scss';\n\nexport interface ErrorWrapperProps {\n /** Form component */\n children?: React.ReactNode;\n /** Error message */\n errorText?: string;\n /** Error text id */\n errorTextId?: string;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport const ErrorWrapper: React.FC<ErrorWrapperProps> = props => {\n const errorWrapperClasses = cn(styles['error-wrapper'], props.errorText && styles[`error-wrapper--with-error`], props.className);\n\n return (\n <div className={errorWrapperClasses} data-testid={props.testId}>\n {props.errorText && (\n <p className={styles['error-wrapper__errors']} id={props.errorTextId}>\n {props.errorText}\n </p>\n )}\n {props.children}\n </div>\n );\n};\n\nexport default ErrorWrapper;\n"],"names":["ErrorWrapper","props","errorWrapperClasses","cn","styles","React"],"mappings":";;;AAmBO,MAAMA,IAA4C,CAASC,MAAA;AAC1D,QAAAC,IAAsBC,EAAGC,EAAO,eAAe,GAAGH,EAAM,aAAaG,EAAO,2BAA2B,GAAGH,EAAM,SAAS;AAG7H,SAAAI,gBAAAA,EAAA,cAAC,SAAI,WAAWH,GAAqB,eAAaD,EAAM,OAAA,GACrDA,EAAM,aACJI,gBAAAA,EAAA,cAAA,KAAA,EAAE,WAAWD,EAAO,uBAAuB,GAAG,IAAIH,EAAM,eACtDA,EAAM,SACT,GAEDA,EAAM,QACT;AAEJ;"}
1
+ {"version":3,"file":"ErrorWrapper.js","sources":["../../../src/components/ErrorWrapper/ErrorWrapper.tsx"],"sourcesContent":["import React from 'react';\n\nimport cn from 'classnames';\n\nimport styles from './styles.module.scss';\n\nexport interface ErrorWrapperProps {\n /** Form component */\n children?: React.ReactNode;\n /** Error message */\n errorText?: string;\n /** Error text id */\n errorTextId?: string;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport const ErrorWrapper: React.FC<ErrorWrapperProps> = props => {\n const errorWrapperClasses = cn(props.errorText && styles[`error-wrapper--with-error`], props.className);\n\n return (\n <div className={errorWrapperClasses} data-testid={props.testId}>\n {props.errorText && (\n <p className={styles['error-wrapper__errors']} id={props.errorTextId}>\n {props.errorText}\n </p>\n )}\n {props.children}\n </div>\n );\n};\n\nexport default ErrorWrapper;\n"],"names":["ErrorWrapper","props","errorWrapperClasses","cn","styles","React"],"mappings":";;;AAmBO,MAAMA,IAA4C,CAASC,MAAA;AAC1D,QAAAC,IAAsBC,EAAGF,EAAM,aAAaG,EAAO,2BAA2B,GAAGH,EAAM,SAAS;AAGpG,SAAAI,gBAAAA,EAAA,cAAC,SAAI,WAAWH,GAAqB,eAAaD,EAAM,OAAA,GACrDA,EAAM,aACJI,gBAAAA,EAAA,cAAA,KAAA,EAAE,WAAWD,EAAO,uBAAuB,GAAG,IAAIH,EAAM,eACtDA,EAAM,SACT,GAEDA,EAAM,QACT;AAEJ;"}
@@ -6,11 +6,6 @@
6
6
 
7
7
  .error-wrapper {
8
8
  position: relative;
9
- padding-bottom: getSpacer(m);
10
-
11
- @media (min-width: map.get($grid-breakpoints, md)) {
12
- padding-bottom: getSpacer(l);
13
- }
14
9
 
15
10
  &--with-error {
16
11
  padding-top: getSpacer(s);
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import Title from '../Title';
3
+ export interface SubtitleProps {
4
+ children?: React.ReactNode;
5
+ }
6
+ declare const Subtitle: React.FC<SubtitleProps>;
7
+ export interface EyebrowHeaderProps {
8
+ children?: React.ReactNode;
9
+ /** Sets the data-testid attribute. */
10
+ testId?: string;
11
+ }
12
+ export interface EyebrowHeaderType extends React.FC<EyebrowHeaderProps> {
13
+ Subtitle: typeof Subtitle;
14
+ Title: typeof Title;
15
+ }
16
+ declare const EyebrowHeader: EyebrowHeaderType;
17
+ export default EyebrowHeader;
@@ -0,0 +1,12 @@
1
+ import a from "react";
2
+ import { AnalyticsId as r } from "../../constants.js";
3
+ import { Title as i } from "../Title/Title.js";
4
+ import l from "../EyebrowHeader/styles.module.scss";
5
+ const d = (e) => /* @__PURE__ */ a.createElement("p", { className: l.subtitle }, e.children), t = (e) => /* @__PURE__ */ a.createElement("div", { "data-testid": e.testId, "data-analyticsid": r.EyebrowHeader }, e.children);
6
+ t.Subtitle = d;
7
+ t.Title = i;
8
+ t.displayName = "EyebrowHeader";
9
+ export {
10
+ t as default
11
+ };
12
+ //# sourceMappingURL=EyebrowHeader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EyebrowHeader.js","sources":["../../../src/components/EyebrowHeader/EyebrowHeader.tsx"],"sourcesContent":["import React from 'react';\n\nimport { AnalyticsId } from '../../constants';\nimport Title from '../Title';\n\nimport styles from './styles.module.scss';\n\nexport interface SubtitleProps {\n children?: React.ReactNode;\n}\n\nconst Subtitle: React.FC<SubtitleProps> = props => {\n return <p className={styles.subtitle}>{props.children}</p>;\n};\n\nexport interface EyebrowHeaderProps {\n children?: React.ReactNode;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport interface EyebrowHeaderType extends React.FC<EyebrowHeaderProps> {\n Subtitle: typeof Subtitle;\n Title: typeof Title;\n}\n\nconst EyebrowHeader = ((props: EyebrowHeaderProps): React.JSX.Element => (\n <div data-testid={props.testId} data-analyticsid={AnalyticsId.EyebrowHeader}>\n {props.children}\n </div>\n)) as EyebrowHeaderType;\n\nEyebrowHeader.Subtitle = Subtitle;\nEyebrowHeader.Title = Title;\nEyebrowHeader.displayName = 'EyebrowHeader';\n\nexport default EyebrowHeader;\n"],"names":["Subtitle","props","styles","EyebrowHeader","React","AnalyticsId","Title"],"mappings":";;;;AAWA,MAAMA,IAAoC,CAASC,sCACzC,KAAE,EAAA,WAAWC,EAAO,SAAA,GAAWD,EAAM,QAAS,GAclDE,IAAiB,CAACF,MACtBG,gBAAAA,EAAA,cAAC,OAAI,EAAA,eAAaH,EAAM,QAAQ,oBAAkBI,EAAY,cAC3D,GAAAJ,EAAM,QACT;AAGFE,EAAc,WAAWH;AACzBG,EAAc,QAAQG;AACtBH,EAAc,cAAc;"}
@@ -0,0 +1,3 @@
1
+ import EyebrowHeader from './EyebrowHeader';
2
+ export * from './EyebrowHeader';
3
+ export default EyebrowHeader;
@@ -0,0 +1,5 @@
1
+ import r from "./EyebrowHeader.js";
2
+ export {
3
+ r as default
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,5 @@
1
+ @import '@helsenorge/designsystem-react/scss/spacers';
2
+
3
+ .subtitle {
4
+ margin: 0;
5
+ }
@@ -19,6 +19,9 @@
19
19
  border: none;
20
20
  padding: 0;
21
21
  margin: 0;
22
+ display: flex;
23
+ flex-flow: column;
24
+ gap: getSpacer(s);
22
25
 
23
26
  > div {
24
27
  padding-bottom: 0;
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  type GridLayout = 'helsenorge' | 'padding' | 'none';
3
3
  interface GridExampleProps {
4
4
  gridLayout: GridLayout;
5
+ children?: React.ReactNode;
5
6
  }
6
7
  export declare const GridExample: React.FC<GridExampleProps>;
7
8
  export default GridExample;
@@ -1 +1 @@
1
- {"version":3,"file":"GridExample.js","sources":["../../../src/components/GridExample/GridExample.tsx"],"sourcesContent":["import React from 'react';\n\nimport { isSupernova } from '../../docs';\n\ntype GridLayout = 'helsenorge' | 'padding' | 'none';\n\ninterface GridExampleProps {\n gridLayout: GridLayout;\n}\n\nexport const GridExample: React.FC<GridExampleProps> = ({ gridLayout = isSupernova(), children }) => {\n if (isSupernova() || gridLayout === 'padding') {\n return <div style={{ padding: '0.5rem' }}>{children}</div>;\n }\n\n if (gridLayout === 'helsenorge') {\n return (\n <div className=\"container py-5\">\n <div className=\"row\">\n <div className=\"col\">{children}</div>\n </div>\n </div>\n );\n }\n\n return <>{children}</>;\n};\n\nexport default GridExample;\n"],"names":["GridExample","gridLayout","isSupernova","children","React"],"mappings":";;AAUO,MAAMA,IAA0C,CAAC,EAAE,YAAAC,IAAaC,EAAY,GAAG,UAAAC,QAChFD,EAAA,KAAiBD,MAAe,4CAC1B,OAAI,EAAA,OAAO,EAAE,SAAS,SAAA,KAAaE,CAAS,IAGlDF,MAAe,eAEdG,gBAAAA,EAAA,cAAA,OAAA,EAAI,WAAU,oDACZ,OAAI,EAAA,WAAU,MACb,GAAAA,gBAAAA,EAAA,cAAC,OAAI,EAAA,WAAU,MAAO,GAAAD,CAAS,CACjC,CACF,sDAIMA,CAAS;"}
1
+ {"version":3,"file":"GridExample.js","sources":["../../../src/components/GridExample/GridExample.tsx"],"sourcesContent":["import React from 'react';\n\nimport { isSupernova } from '../../docs';\n\ntype GridLayout = 'helsenorge' | 'padding' | 'none';\n\ninterface GridExampleProps {\n gridLayout: GridLayout;\n children?: React.ReactNode;\n}\n\nexport const GridExample: React.FC<GridExampleProps> = ({ gridLayout = isSupernova(), children }) => {\n if (isSupernova() || gridLayout === 'padding') {\n return <div style={{ padding: '0.5rem' }}>{children}</div>;\n }\n\n if (gridLayout === 'helsenorge') {\n return (\n <div className=\"container py-5\">\n <div className=\"row\">\n <div className=\"col\">{children}</div>\n </div>\n </div>\n );\n }\n\n return <>{children}</>;\n};\n\nexport default GridExample;\n"],"names":["GridExample","gridLayout","isSupernova","children","React"],"mappings":";;AAWO,MAAMA,IAA0C,CAAC,EAAE,YAAAC,IAAaC,EAAY,GAAG,UAAAC,QAChFD,EAAA,KAAiBD,MAAe,4CAC1B,OAAI,EAAA,OAAO,EAAE,SAAS,SAAA,KAAaE,CAAS,IAGlDF,MAAe,eAEdG,gBAAAA,EAAA,cAAA,OAAA,EAAI,WAAU,oDACZ,OAAI,EAAA,WAAU,MACb,GAAAA,gBAAAA,EAAA,cAAC,OAAI,EAAA,WAAU,MAAO,GAAAD,CAAS,CACjC,CACF,sDAIMA,CAAS;"}
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
- import { HighlightBoxSize } from '../HighlightBox';
2
+ import { HighlightPanelSize } from '../HighlightPanel';
3
3
  export interface HelpPanelProps {
4
4
  /** What's in the box? */
5
5
  children: React.ReactNode;
6
6
  /** Changes the size. Default: medium */
7
- size?: keyof typeof HighlightBoxSize;
7
+ size?: keyof typeof HighlightPanelSize;
8
8
  /** Adds custom classes to the element. */
9
9
  className?: string;
10
10
  /** Sets the data-testid attribute. */
@@ -1,21 +1,21 @@
1
1
  import s from "react";
2
- import p from "classnames";
3
- import n from "../HighlightBox/HighlightBox.js";
2
+ import n from "classnames";
3
+ import p from "../HighlightPanel/HighlightPanel.js";
4
4
  import c from "../Icons/HandWaving.js";
5
5
  import e from "../HelpPanel/styles.module.scss";
6
- const d = ({ className: a, testId: t, size: l, children: o, title: r }) => {
7
- const m = p(e["help-panel"], a);
6
+ const d = ({ className: a, testId: l, size: t, children: r, title: m }) => {
7
+ const o = n(e["help-panel"], a);
8
8
  return /* @__PURE__ */ s.createElement(
9
- n,
9
+ p,
10
10
  {
11
- className: m,
11
+ className: o,
12
12
  contentWrapperClassName: e["help-panel"],
13
- testId: t,
14
- size: l,
13
+ testId: l,
14
+ size: t,
15
15
  svgIcon: c,
16
- title: r
16
+ title: m
17
17
  },
18
- o
18
+ r
19
19
  );
20
20
  };
21
21
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"HelpPanel.js","sources":["../../../src/components/HelpPanel/HelpPanel.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport HighlightBox, { HighlightBoxSize } from '../HighlightBox';\nimport HandWaving from '../Icons/HandWaving';\n\nimport styles from './styles.module.scss';\n\nexport interface HelpPanelProps {\n /** What's in the box? */\n children: React.ReactNode;\n /** Changes the size. Default: medium */\n size?: keyof typeof HighlightBoxSize;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Sets title if needed */\n title?: string;\n}\n\nconst HelpPanel: React.FC<HelpPanelProps> = ({ className, testId, size, children, title }) => {\n const helpPanelClassName = classNames(styles['help-panel'], className);\n\n return (\n <HighlightBox\n className={helpPanelClassName}\n contentWrapperClassName={styles['help-panel']}\n testId={testId}\n size={size}\n svgIcon={HandWaving}\n title={title}\n >\n {children}\n </HighlightBox>\n );\n};\n\nexport default HelpPanel;\n"],"names":["HelpPanel","className","testId","size","children","title","helpPanelClassName","classNames","styles","React","HighlightBox","HandWaving"],"mappings":";;;;;AAsBM,MAAAA,IAAsC,CAAC,EAAE,WAAAC,GAAW,QAAAC,GAAQ,MAAAC,GAAM,UAAAC,GAAU,OAAAC,QAAY;AAC5F,QAAMC,IAAqBC,EAAWC,EAAO,YAAY,GAAGP,CAAS;AAGnE,SAAAQ,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWJ;AAAA,MACX,yBAAyBE,EAAO,YAAY;AAAA,MAC5C,QAAAN;AAAA,MACA,MAAAC;AAAA,MACA,SAASQ;AAAA,MACT,OAAAN;AAAA,IAAA;AAAA,IAECD;AAAA,EAAA;AAGP;"}
1
+ {"version":3,"file":"HelpPanel.js","sources":["../../../src/components/HelpPanel/HelpPanel.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport HighlightPanel, { HighlightPanelSize } from '../HighlightPanel';\nimport HandWaving from '../Icons/HandWaving';\n\nimport styles from './styles.module.scss';\n\nexport interface HelpPanelProps {\n /** What's in the box? */\n children: React.ReactNode;\n /** Changes the size. Default: medium */\n size?: keyof typeof HighlightPanelSize;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Sets title if needed */\n title?: string;\n}\n\nconst HelpPanel: React.FC<HelpPanelProps> = ({ className, testId, size, children, title }) => {\n const helpPanelClassName = classNames(styles['help-panel'], className);\n\n return (\n <HighlightPanel\n className={helpPanelClassName}\n contentWrapperClassName={styles['help-panel']}\n testId={testId}\n size={size}\n svgIcon={HandWaving}\n title={title}\n >\n {children}\n </HighlightPanel>\n );\n};\n\nexport default HelpPanel;\n"],"names":["HelpPanel","className","testId","size","children","title","helpPanelClassName","classNames","styles","React","HighlightPanel","HandWaving"],"mappings":";;;;;AAsBM,MAAAA,IAAsC,CAAC,EAAE,WAAAC,GAAW,QAAAC,GAAQ,MAAAC,GAAM,UAAAC,GAAU,OAAAC,QAAY;AAC5F,QAAMC,IAAqBC,EAAWC,EAAO,YAAY,GAAGP,CAAS;AAGnE,SAAAQ,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWJ;AAAA,MACX,yBAAyBE,EAAO,YAAY;AAAA,MAC5C,QAAAN;AAAA,MACA,MAAAC;AAAA,MACA,SAASQ;AAAA,MACT,OAAAN;AAAA,IAAA;AAAA,IAECD;AAAA,EAAA;AAGP;"}
@@ -3,24 +3,24 @@ import { PaletteNames } from '../../theme/palette';
3
3
  import { SvgIcon } from '../Icon';
4
4
  import { IconName } from '../Icons/IconNames';
5
5
  import { TitleTags } from '../Title';
6
- export type HighlightBoxColors = Extract<PaletteNames, 'white' | 'neutral' | 'blueberry' | 'cherry'>;
7
- export declare enum HighlightBoxSize {
6
+ export type HighlightPanelColors = Extract<PaletteNames, 'white' | 'neutral' | 'blueberry' | 'cherry'>;
7
+ export declare enum HighlightPanelSize {
8
8
  medium = "medium",
9
9
  large = "large",
10
10
  fluid = "fluid"
11
11
  }
12
- export type HighlightBoxTags = Exclude<keyof HTMLElementTagNameMap, 'dir' | 'font' | 'frame' | 'frameset' | 'marquee' | 'applet' | 'basefont' | 'search'>;
13
- export interface HighlightBoxProps {
12
+ export type HighlightPanelTags = Exclude<keyof HTMLElementTagNameMap, 'dir' | 'font' | 'frame' | 'frameset' | 'marquee' | 'applet' | 'basefont' | 'search'>;
13
+ export interface HighlightPanelProps {
14
14
  /** What's in the box? */
15
15
  children: React.ReactNode;
16
16
  /** Changes the background color. Default: white */
17
- color?: HighlightBoxColors;
17
+ color?: HighlightPanelColors;
18
18
  /** Changes the size. Default: medium */
19
- size?: keyof typeof HighlightBoxSize;
20
- /** Adds an icon to the highlightbox. */
19
+ size?: keyof typeof HighlightPanelSize;
20
+ /** Adds an icon to the highlightpanel. */
21
21
  svgIcon?: SvgIcon | IconName;
22
22
  /** Changes the underlying element. Default: div */
23
- htmlMarkup?: HighlightBoxTags;
23
+ htmlMarkup?: HighlightPanelTags;
24
24
  /** Adds custom classes to the element. */
25
25
  className?: string;
26
26
  /** Adds custom classes to the content-wrapper */
@@ -32,5 +32,5 @@ export interface HighlightBoxProps {
32
32
  /** Markup props for title */
33
33
  titleHtmlMarkup?: TitleTags;
34
34
  }
35
- declare const HighlightBox: React.FC<HighlightBoxProps>;
36
- export default HighlightBox;
35
+ declare const HighlightPanel: React.FC<HighlightPanelProps>;
36
+ export default HighlightPanel;
@@ -0,0 +1,61 @@
1
+ import e from "react";
2
+ import i from "classnames";
3
+ import "../../theme/grid.js";
4
+ import { useBreakpoint as C, Breakpoint as W } from "../../hooks/useBreakpoint.js";
5
+ import { AnalyticsId as g, IconSize as N } from "../../constants.js";
6
+ import { Icon as z } from "../Icon/Icon.js";
7
+ import { LazyIcon as M } from "../LazyIcon/LazyIcon.js";
8
+ import { Title as H } from "../Title/Title.js";
9
+ import t from "../HighlightPanel/styles.module.scss";
10
+ var b = /* @__PURE__ */ ((l) => (l.medium = "medium", l.large = "large", l.fluid = "fluid", l))(b || {});
11
+ const u = ({ className: l, size: n, children: s }) => /* @__PURE__ */ e.createElement("div", { className: l, "data-testid": "highlightpanel-wrapper" }, /* @__PURE__ */ e.createElement("div", { className: t.highlightpanel__row }, /* @__PURE__ */ e.createElement("div", { className: i(t.highlightpanel__col, n === "medium" && t["highlightpanel__col--offset"]) }, s))), v = (l) => {
12
+ const { children: n, className: s } = l, a = i(t["highlightpanel__content-wrapper"], s);
13
+ return /* @__PURE__ */ e.createElement("div", { className: a }, /* @__PURE__ */ e.createElement("div", { className: i(t.highlightpanel__row) }, n));
14
+ }, S = (l) => {
15
+ const {
16
+ children: n,
17
+ color: s = "white",
18
+ size: a = "medium",
19
+ testId: c,
20
+ svgIcon: r,
21
+ htmlMarkup: I = "div",
22
+ className: k,
23
+ contentWrapperClassName: w,
24
+ title: p,
25
+ titleHtmlMarkup: y = "h2"
26
+ } = l, _ = C(), m = i(
27
+ t[`highlightpanel--${s}`],
28
+ t[`highlightpanel--${a}`],
29
+ r && t["highlightpanel--has-icon"],
30
+ { container: a === "medium" || a === "large" },
31
+ k
32
+ ), o = () => {
33
+ if (r) {
34
+ const f = a === "large" && _ && _ >= W.md ? N.Medium : N.Small, E = /* @__PURE__ */ e.createElement(H, { testId: "titleId", htmlMarkup: y, appearance: "title4" }, p);
35
+ return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { className: t.highlightpanel__icon }, typeof r == "string" ? /* @__PURE__ */ e.createElement(M, { iconName: r, size: f }) : /* @__PURE__ */ e.createElement(z, { svgIcon: r, size: f }), p && /* @__PURE__ */ e.createElement("div", { className: t.mobile }, E)), /* @__PURE__ */ e.createElement("div", { className: t.highlightpanel__content }, p && /* @__PURE__ */ e.createElement("div", { className: t.desktop, "aria-hidden": "true" }, E), n));
36
+ }
37
+ return n;
38
+ }, h = I, d = i(t["highlightpanel__content-wrapper"], w);
39
+ return a === "medium" ? /* @__PURE__ */ e.createElement(u, { className: m, size: a }, /* @__PURE__ */ e.createElement(h, { className: d, "data-testid": c, "data-analyticsid": g.HighlightPanel }, o())) : a === "large" && r ? /* @__PURE__ */ e.createElement(u, { className: m, size: a }, /* @__PURE__ */ e.createElement(v, { className: d }, /* @__PURE__ */ e.createElement(
40
+ h,
41
+ {
42
+ className: i(t.highlightpanel__col, t["highlightpanel__col--large-with-icon"]),
43
+ "data-testid": c,
44
+ "data-analyticsid": g.HighlightPanel
45
+ },
46
+ o()
47
+ ))) : a === "large" ? /* @__PURE__ */ e.createElement(u, { className: m, size: a }, /* @__PURE__ */ e.createElement(v, { className: d }, /* @__PURE__ */ e.createElement(
48
+ h,
49
+ {
50
+ className: i(t.highlightpanel__col, t["highlightpanel__col--offset"]),
51
+ "data-testid": c,
52
+ "data-analyticsid": g.HighlightPanel
53
+ },
54
+ o()
55
+ ))) : a === "fluid" ? /* @__PURE__ */ e.createElement(h, { className: m, "data-testid": c }, o()) : null;
56
+ };
57
+ export {
58
+ b as HighlightPanelSize,
59
+ S as default
60
+ };
61
+ //# sourceMappingURL=HighlightPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HighlightPanel.js","sources":["../../../src/components/HighlightPanel/HighlightPanel.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { useBreakpoint, Breakpoint } from '../..';\nimport { AnalyticsId } from '../../constants';\nimport { PaletteNames } from '../../theme/palette';\nimport Icon, { SvgIcon, IconSize } from '../Icon';\nimport { IconName } from '../Icons/IconNames';\nimport LazyIcon from '../LazyIcon';\nimport Title, { TitleTags } from '../Title';\n\nimport styles from './styles.module.scss';\n\nexport type HighlightPanelColors = Extract<PaletteNames, 'white' | 'neutral' | 'blueberry' | 'cherry'>;\n\nexport enum HighlightPanelSize {\n medium = 'medium',\n large = 'large',\n fluid = 'fluid',\n}\n\nexport type HighlightPanelTags = Exclude<\n keyof HTMLElementTagNameMap,\n 'dir' | 'font' | 'frame' | 'frameset' | 'marquee' | 'applet' | 'basefont' | 'search'\n>;\n\nexport interface HighlightPanelProps {\n /** What's in the box? */\n children: React.ReactNode;\n /** Changes the background color. Default: white */\n color?: HighlightPanelColors;\n /** Changes the size. Default: medium */\n size?: keyof typeof HighlightPanelSize;\n /** Adds an icon to the highlightpanel. */\n svgIcon?: SvgIcon | IconName;\n /** Changes the underlying element. Default: div */\n htmlMarkup?: HighlightPanelTags;\n /** Adds custom classes to the element. */\n className?: string;\n /** Adds custom classes to the content-wrapper */\n contentWrapperClassName?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Element that is set after the icon-element in the DOM, often a title-element */\n title?: string;\n /** Markup props for title */\n titleHtmlMarkup?: TitleTags;\n}\n\ninterface WrapperProps {\n children?: React.ReactNode;\n className: string;\n size?: keyof typeof HighlightPanelSize;\n}\n\nconst Wrapper: React.FC<WrapperProps> = ({ className, size, children }) => (\n <div className={className} data-testid={'highlightpanel-wrapper'}>\n <div className={styles.highlightpanel__row}>\n <div className={classNames(styles.highlightpanel__col, size === HighlightPanelSize.medium && styles['highlightpanel__col--offset'])}>\n {children}\n </div>\n </div>\n </div>\n);\n\ninterface ContentWrapperProps {\n children: React.ReactNode;\n className?: string;\n}\n\nconst ContentWrapper: React.FC<ContentWrapperProps> = props => {\n const { children, className } = props;\n const contentWrapperClasses = classNames(styles['highlightpanel__content-wrapper'], className);\n\n return (\n <div className={contentWrapperClasses}>\n <div className={classNames(styles.highlightpanel__row)}>{children}</div>\n </div>\n );\n};\n\nconst HighlightPanel: React.FC<HighlightPanelProps> = props => {\n const {\n children,\n color = 'white',\n size = HighlightPanelSize.medium,\n testId,\n svgIcon,\n htmlMarkup = 'div',\n className,\n contentWrapperClassName,\n title,\n titleHtmlMarkup = 'h2',\n } = props;\n const breakpoint = useBreakpoint();\n\n const containerClassName = classNames(\n styles[`highlightpanel--${color}`],\n styles[`highlightpanel--${size}`],\n svgIcon && styles['highlightpanel--has-icon'],\n { container: size === 'medium' || size === 'large' },\n className\n );\n\n const renderContent = () => {\n if (svgIcon) {\n const iconSize = size === HighlightPanelSize.large && breakpoint && breakpoint >= Breakpoint.md ? IconSize.Medium : IconSize.Small;\n\n const titleElement = (\n <Title testId=\"titleId\" htmlMarkup={titleHtmlMarkup} appearance=\"title4\">\n {title}\n </Title>\n );\n\n return (\n <>\n <div className={styles.highlightpanel__icon}>\n {typeof svgIcon === 'string' ? <LazyIcon iconName={svgIcon} size={iconSize} /> : <Icon svgIcon={svgIcon} size={iconSize} />}\n {title && <div className={styles['mobile']}>{titleElement}</div>}\n </div>\n <div className={styles.highlightpanel__content}>\n {title && (\n <div className={styles['desktop']} aria-hidden=\"true\">\n {titleElement}\n </div>\n )}\n {children}\n </div>\n </>\n );\n }\n\n return children;\n };\n\n const CustomTag = htmlMarkup;\n\n const contentWrapperClasses = classNames(styles['highlightpanel__content-wrapper'], contentWrapperClassName);\n\n if (size === HighlightPanelSize.medium) {\n return (\n <Wrapper className={containerClassName} size={size}>\n <CustomTag className={contentWrapperClasses} data-testid={testId} data-analyticsid={AnalyticsId.HighlightPanel}>\n {renderContent()}\n </CustomTag>\n </Wrapper>\n );\n }\n\n if (size === HighlightPanelSize.large && svgIcon) {\n return (\n <Wrapper className={containerClassName} size={size}>\n <ContentWrapper className={contentWrapperClasses}>\n <CustomTag\n className={classNames(styles.highlightpanel__col, styles['highlightpanel__col--large-with-icon'])}\n data-testid={testId}\n data-analyticsid={AnalyticsId.HighlightPanel}\n >\n {renderContent()}\n </CustomTag>\n </ContentWrapper>\n </Wrapper>\n );\n }\n\n if (size === HighlightPanelSize.large) {\n return (\n <Wrapper className={containerClassName} size={size}>\n <ContentWrapper className={contentWrapperClasses}>\n <CustomTag\n className={classNames(styles.highlightpanel__col, styles['highlightpanel__col--offset'])}\n data-testid={testId}\n data-analyticsid={AnalyticsId.HighlightPanel}\n >\n {renderContent()}\n </CustomTag>\n </ContentWrapper>\n </Wrapper>\n );\n }\n\n if (size === HighlightPanelSize.fluid) {\n return (\n <CustomTag className={containerClassName} data-testid={testId}>\n {renderContent()}\n </CustomTag>\n );\n }\n\n return null;\n};\n\nexport default HighlightPanel;\n"],"names":["HighlightPanelSize","Wrapper","className","size","children","React","styles","classNames","ContentWrapper","props","contentWrapperClasses","HighlightPanel","color","testId","svgIcon","htmlMarkup","contentWrapperClassName","title","titleHtmlMarkup","breakpoint","useBreakpoint","containerClassName","renderContent","iconSize","Breakpoint","IconSize","titleElement","Title","LazyIcon","Icon","CustomTag","AnalyticsId"],"mappings":"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"}
@@ -0,0 +1,3 @@
1
+ import HighlightPanel from './HighlightPanel';
2
+ export * from './HighlightPanel';
3
+ export default HighlightPanel;
@@ -0,0 +1,7 @@
1
+ import i from "./HighlightPanel.js";
2
+ import { HighlightPanelSize as o } from "./HighlightPanel.js";
3
+ export {
4
+ o as HighlightPanelSize,
5
+ i as default
6
+ };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -22,8 +22,8 @@
22
22
  }
23
23
  }
24
24
 
25
- .highlightbox {
26
- $box: &;
25
+ .highlightpanel {
26
+ $panel: &;
27
27
  $colors: 'neutral', 'blueberry', 'cherry';
28
28
 
29
29
  // Medium og large har bakgrunnsfarge på den indre wrapperen
@@ -31,8 +31,8 @@
31
31
  &--medium,
32
32
  &--large {
33
33
  @each $color in $colors {
34
- &#{$box}--#{$color} {
35
- #{$box}__content-wrapper {
34
+ &#{$panel}--#{$color} {
35
+ #{$panel}__content-wrapper {
36
36
  background-color: var(--color-base-background-#{$color});
37
37
  border: 1px solid var(--color-base-border-#{$color});
38
38
  }
@@ -40,8 +40,8 @@
40
40
  }
41
41
 
42
42
  // Hvit har sin egen regel siden den ikke har valører
43
- &#{$box}--white {
44
- #{$box}__content-wrapper {
43
+ &#{$panel}--white {
44
+ #{$panel}__content-wrapper {
45
45
  background-color: var(--color-base-background-white);
46
46
  border: 1px solid var(--color-base-border-onlight-subtle);
47
47
  }
@@ -52,19 +52,19 @@
52
52
  // slik at bakgrunnsfargen går helt ut til skjermkanten
53
53
  &--large {
54
54
  @each $color in $colors {
55
- &#{$box}--#{$color} {
55
+ &#{$panel}--#{$color} {
56
56
  @include media-breakpoint-down(xs) {
57
57
  background-color: var(--color-base-background-#{$color});
58
58
  }
59
59
  }
60
60
  }
61
61
 
62
- &#{$box}--white {
62
+ &#{$panel}--white {
63
63
  @include media-breakpoint-down(xs) {
64
64
  background-color: var(--color-base-background-white);
65
65
  }
66
66
  }
67
- #{$box}__content-wrapper {
67
+ #{$panel}__content-wrapper {
68
68
  padding-top: getSpacer(m);
69
69
  padding-bottom: getSpacer(l);
70
70
 
@@ -76,7 +76,7 @@
76
76
  }
77
77
 
78
78
  &--medium {
79
- #{$box}__content-wrapper {
79
+ #{$panel}__content-wrapper {
80
80
  padding: getSpacer(m) getSpacer(s) getSpacer(l);
81
81
 
82
82
  @media (min-width: map.get($grid-breakpoints, md)) {
@@ -98,19 +98,19 @@
98
98
  }
99
99
 
100
100
  @each $color in $colors {
101
- &#{$box}--#{$color} {
101
+ &#{$panel}--#{$color} {
102
102
  background-color: var(--color-base-background-#{$color});
103
103
  border: 1px solid var(--color-base-border-#{$color});
104
104
  }
105
105
  }
106
- &#{$box}--white {
106
+ &#{$panel}--white {
107
107
  background-color: var(--color-base-background-white);
108
108
  border: 1px solid var(--color-base-border-onlight-subtle);
109
109
  }
110
110
  }
111
111
 
112
112
  &--has-icon#{&}--medium {
113
- #{$box}__content-wrapper {
113
+ #{$panel}__content-wrapper {
114
114
  @include content-wrapper-with-icon-flex;
115
115
  @include content-wrapper-with-icon-padding;
116
116
 
@@ -121,10 +121,10 @@
121
121
  }
122
122
 
123
123
  &--has-icon#{&}--large {
124
- #{$box}__col {
124
+ #{$panel}__col {
125
125
  @include content-wrapper-with-icon-flex;
126
126
  }
127
- #{$box}__content-wrapper {
127
+ #{$panel}__content-wrapper {
128
128
  @include content-wrapper-with-icon-padding;
129
129
 
130
130
  @media (min-width: map.get($grid-breakpoints, sm)) {
@@ -142,7 +142,7 @@
142
142
  }
143
143
  }
144
144
 
145
- #{$box}__icon {
145
+ #{$panel}__icon {
146
146
  @media (min-width: map.get($grid-breakpoints, lg)) {
147
147
  @include make-col-ready;
148
148
  @include make-col(2);
@@ -154,7 +154,7 @@
154
154
  }
155
155
  }
156
156
 
157
- #{$box}__content {
157
+ #{$panel}__content {
158
158
  @media (min-width: map.get($grid-breakpoints, lg)) {
159
159
  @include make-col-ready;
160
160
  @include make-col(8);
@@ -0,0 +1,25 @@
1
+ export type Styles = {
2
+ desktop: string;
3
+ highlightpanel__col: string;
4
+ 'highlightpanel__col--large-with-icon': string;
5
+ 'highlightpanel__col--offset': string;
6
+ highlightpanel__content: string;
7
+ 'highlightpanel__content-wrapper': string;
8
+ highlightpanel__icon: string;
9
+ highlightpanel__row: string;
10
+ 'highlightpanel--blueberry': string;
11
+ 'highlightpanel--cherry': string;
12
+ 'highlightpanel--fluid': string;
13
+ 'highlightpanel--has-icon': string;
14
+ 'highlightpanel--large': string;
15
+ 'highlightpanel--medium': string;
16
+ 'highlightpanel--neutral': string;
17
+ 'highlightpanel--white': string;
18
+ mobile: string;
19
+ };
20
+
21
+ export type ClassNames = keyof Styles;
22
+
23
+ declare const styles: Styles;
24
+
25
+ export default styles;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { AriaLabelAttributes } from '../../utils/accessibility';
3
3
  interface HorizontalScrollProps {
4
+ children?: React.ReactNode;
4
5
  /**
5
6
  * Bredden på elementet som potensielt vil scrolle horisontalt i px
6
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"HorizontalScroll.js","sources":["../../../src/components/HorizontalScroll/HorizontalScroll.tsx"],"sourcesContent":["import React, { useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { useIsVisible } from '../../hooks/useIsVisible';\nimport { useSize } from '../../hooks/useSize';\nimport { AriaLabelAttributes } from '../../utils/accessibility';\n\nimport styles from './styles.module.scss';\n\n// Scrolle-indikator vises/skjules når det er x px igjen til venstre eller høyre side\nconst ROOT_MARGIN_OFFSET = '3px';\n\ninterface HorizontalScrollProps {\n /**\n * Bredden på elementet som potensielt vil scrolle horisontalt i px\n */\n childWidth: number;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport const HorizontalScroll: React.FC<HorizontalScrollProps & AriaLabelAttributes> = ({ children, childWidth, testId, ...rest }) => {\n const viewportRef = useRef<HTMLDivElement>(null);\n const leftRef = useRef<HTMLDivElement>(null);\n const rightRef = useRef<HTMLDivElement>(null);\n const leftIsVisible = useIsVisible(leftRef, 1, { root: viewportRef?.current, rootMargin: ROOT_MARGIN_OFFSET }, true);\n const rightIsVisible = useIsVisible(rightRef, 1, { root: viewportRef?.current, rootMargin: ROOT_MARGIN_OFFSET }, true);\n const { width: viewPortWidth = 0 } = useSize(viewportRef) || {};\n\n const isOverflowing = childWidth > viewPortWidth;\n const viewportClasses = classNames(styles.horizontalscroll__viewport, isOverflowing && styles['horizontalscroll__viewport--overflow']);\n const hasAriaAttributes = rest['aria-label'] || rest['aria-labelledby'];\n\n return (\n <div className={styles.horizontalscroll} data-testid={testId}>\n {/* viewport-diven må ta tabIndex for å løse et annet UU-problem, at div med overflow: scroll må kunne navigeres med keyboard. */}\n {/* Enten aria-label eller aria-labelledbyid må settes */}\n <div\n className={viewportClasses}\n ref={viewportRef}\n tabIndex={hasAriaAttributes ? 0 : undefined}\n role={hasAriaAttributes ? 'region' : undefined}\n {...rest}\n >\n <div\n className={classNames(\n styles.horizontalscroll__indicator,\n styles['horizontalscroll__indicator--left'],\n !leftIsVisible && styles['horizontalscroll__indicator--visible']\n )}\n />\n <div\n className={classNames(\n styles.horizontalscroll__indicator,\n styles['horizontalscroll__indicator--right'],\n !rightIsVisible && styles['horizontalscroll__indicator--visible']\n )}\n />\n <div ref={leftRef} />\n {children}\n <div ref={rightRef} />\n </div>\n </div>\n );\n};\n\nexport default HorizontalScroll;\n"],"names":["ROOT_MARGIN_OFFSET","HorizontalScroll","children","childWidth","testId","rest","viewportRef","useRef","leftRef","rightRef","leftIsVisible","useIsVisible","rightIsVisible","viewPortWidth","useSize","isOverflowing","viewportClasses","classNames","styles","hasAriaAttributes","React"],"mappings":";;;;;AAWA,MAAMA,IAAqB,OAWdC,IAA0E,CAAC,EAAE,UAAAC,GAAU,YAAAC,GAAY,QAAAC,GAAQ,GAAGC,QAAW;AAC9H,QAAAC,IAAcC,EAAuB,IAAI,GACzCC,IAAUD,EAAuB,IAAI,GACrCE,IAAWF,EAAuB,IAAI,GACtCG,IAAgBC,EAAaH,GAAS,GAAG,EAAE,MAAMF,KAAA,gBAAAA,EAAa,SAAS,YAAYN,EAAmB,GAAG,EAAI,GAC7GY,IAAiBD,EAAaF,GAAU,GAAG,EAAE,MAAMH,KAAA,gBAAAA,EAAa,SAAS,YAAYN,EAAmB,GAAG,EAAI,GAC/G,EAAE,OAAOa,IAAgB,MAAMC,EAAQR,CAAW,KAAK,IAEvDS,IAAgBZ,IAAaU,GAC7BG,IAAkBC,EAAWC,EAAO,4BAA4BH,KAAiBG,EAAO,sCAAsC,CAAC,GAC/HC,IAAoBd,EAAK,YAAY,KAAKA,EAAK,iBAAiB;AAEtE,yCACG,OAAI,EAAA,WAAWa,EAAO,kBAAkB,eAAad,EAGpD,GAAAgB,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWJ;AAAA,MACX,KAAKV;AAAA,MACL,UAAUa,IAAoB,IAAI;AAAA,MAClC,MAAMA,IAAoB,WAAW;AAAA,MACpC,GAAGd;AAAA,IAAA;AAAA,IAEJe,gBAAAA,EAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWH;AAAA,UACTC,EAAO;AAAA,UACPA,EAAO,mCAAmC;AAAA,UAC1C,CAACR,KAAiBQ,EAAO,sCAAsC;AAAA,QACjE;AAAA,MAAA;AAAA,IACF;AAAA,IACAE,gBAAAA,EAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWH;AAAA,UACTC,EAAO;AAAA,UACPA,EAAO,oCAAoC;AAAA,UAC3C,CAACN,KAAkBM,EAAO,sCAAsC;AAAA,QAClE;AAAA,MAAA;AAAA,IACF;AAAA,IACAE,gBAAAA,EAAA,cAAC,OAAI,EAAA,KAAKZ,EAAS,CAAA;AAAA,IAClBN;AAAA,IACDkB,gBAAAA,EAAA,cAAC,OAAI,EAAA,KAAKX,EAAU,CAAA;AAAA,EAAA,CAExB;AAEJ;"}
1
+ {"version":3,"file":"HorizontalScroll.js","sources":["../../../src/components/HorizontalScroll/HorizontalScroll.tsx"],"sourcesContent":["import React, { useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { useIsVisible } from '../../hooks/useIsVisible';\nimport { useSize } from '../../hooks/useSize';\nimport { AriaLabelAttributes } from '../../utils/accessibility';\n\nimport styles from './styles.module.scss';\n\n// Scrolle-indikator vises/skjules når det er x px igjen til venstre eller høyre side\nconst ROOT_MARGIN_OFFSET = '3px';\n\ninterface HorizontalScrollProps {\n children?: React.ReactNode;\n /**\n * Bredden på elementet som potensielt vil scrolle horisontalt i px\n */\n childWidth: number;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport const HorizontalScroll: React.FC<HorizontalScrollProps & AriaLabelAttributes> = ({ children, childWidth, testId, ...rest }) => {\n const viewportRef = useRef<HTMLDivElement>(null);\n const leftRef = useRef<HTMLDivElement>(null);\n const rightRef = useRef<HTMLDivElement>(null);\n const leftIsVisible = useIsVisible(leftRef, 1, { root: viewportRef?.current, rootMargin: ROOT_MARGIN_OFFSET }, true);\n const rightIsVisible = useIsVisible(rightRef, 1, { root: viewportRef?.current, rootMargin: ROOT_MARGIN_OFFSET }, true);\n const { width: viewPortWidth = 0 } = useSize(viewportRef) || {};\n\n const isOverflowing = childWidth > viewPortWidth;\n const viewportClasses = classNames(styles.horizontalscroll__viewport, isOverflowing && styles['horizontalscroll__viewport--overflow']);\n const hasAriaAttributes = rest['aria-label'] || rest['aria-labelledby'];\n\n return (\n <div className={styles.horizontalscroll} data-testid={testId}>\n {/* viewport-diven må ta tabIndex for å løse et annet UU-problem, at div med overflow: scroll må kunne navigeres med keyboard. */}\n {/* Enten aria-label eller aria-labelledbyid må settes */}\n <div\n className={viewportClasses}\n ref={viewportRef}\n tabIndex={hasAriaAttributes ? 0 : undefined}\n role={hasAriaAttributes ? 'region' : undefined}\n {...rest}\n >\n <div\n className={classNames(\n styles.horizontalscroll__indicator,\n styles['horizontalscroll__indicator--left'],\n !leftIsVisible && styles['horizontalscroll__indicator--visible']\n )}\n />\n <div\n className={classNames(\n styles.horizontalscroll__indicator,\n styles['horizontalscroll__indicator--right'],\n !rightIsVisible && styles['horizontalscroll__indicator--visible']\n )}\n />\n <div ref={leftRef} />\n {children}\n <div ref={rightRef} />\n </div>\n </div>\n );\n};\n\nexport default HorizontalScroll;\n"],"names":["ROOT_MARGIN_OFFSET","HorizontalScroll","children","childWidth","testId","rest","viewportRef","useRef","leftRef","rightRef","leftIsVisible","useIsVisible","rightIsVisible","viewPortWidth","useSize","isOverflowing","viewportClasses","classNames","styles","hasAriaAttributes","React"],"mappings":";;;;;AAWA,MAAMA,IAAqB,OAYdC,IAA0E,CAAC,EAAE,UAAAC,GAAU,YAAAC,GAAY,QAAAC,GAAQ,GAAGC,QAAW;AAC9H,QAAAC,IAAcC,EAAuB,IAAI,GACzCC,IAAUD,EAAuB,IAAI,GACrCE,IAAWF,EAAuB,IAAI,GACtCG,IAAgBC,EAAaH,GAAS,GAAG,EAAE,MAAMF,KAAA,gBAAAA,EAAa,SAAS,YAAYN,EAAmB,GAAG,EAAI,GAC7GY,IAAiBD,EAAaF,GAAU,GAAG,EAAE,MAAMH,KAAA,gBAAAA,EAAa,SAAS,YAAYN,EAAmB,GAAG,EAAI,GAC/G,EAAE,OAAOa,IAAgB,MAAMC,EAAQR,CAAW,KAAK,IAEvDS,IAAgBZ,IAAaU,GAC7BG,IAAkBC,EAAWC,EAAO,4BAA4BH,KAAiBG,EAAO,sCAAsC,CAAC,GAC/HC,IAAoBd,EAAK,YAAY,KAAKA,EAAK,iBAAiB;AAEtE,yCACG,OAAI,EAAA,WAAWa,EAAO,kBAAkB,eAAad,EAGpD,GAAAgB,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWJ;AAAA,MACX,KAAKV;AAAA,MACL,UAAUa,IAAoB,IAAI;AAAA,MAClC,MAAMA,IAAoB,WAAW;AAAA,MACpC,GAAGd;AAAA,IAAA;AAAA,IAEJe,gBAAAA,EAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWH;AAAA,UACTC,EAAO;AAAA,UACPA,EAAO,mCAAmC;AAAA,UAC1C,CAACR,KAAiBQ,EAAO,sCAAsC;AAAA,QACjE;AAAA,MAAA;AAAA,IACF;AAAA,IACAE,gBAAAA,EAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWH;AAAA,UACTC,EAAO;AAAA,UACPA,EAAO,oCAAoC;AAAA,UAC3C,CAACN,KAAkBM,EAAO,sCAAsC;AAAA,QAClE;AAAA,MAAA;AAAA,IACF;AAAA,IACAE,gBAAAA,EAAA,cAAC,OAAI,EAAA,KAAKZ,EAAS,CAAA;AAAA,IAClBN;AAAA,IACDkB,gBAAAA,EAAA,cAAC,OAAI,EAAA,KAAKX,EAAU,CAAA;AAAA,EAAA,CAExB;AAEJ;"}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export type NotificationPanelVariants = 'info' | 'warn' | 'alert' | 'error' | 'success';
2
+ export type NotificationPanelVariants = 'info' | 'warn' | 'error' | 'success';
3
3
  export type NotificationCompactVariants = 'basic' | 'outline';
4
4
  export type NotificationPanelSizes = 'small' | 'medium' | 'large';
5
5
  export type LabelTags = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'span';