@helsenorge/designsystem-react 11.0.0-beta.3 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +921 -1417
- package/Panel.js +207 -0
- package/Panel.js.map +1 -0
- package/PanelTitle.js +18 -0
- package/PanelTitle.js.map +1 -0
- package/StatusDot.js +3 -1
- package/StatusDot.js.map +1 -1
- package/components/Drawer/index.js +1 -1
- package/components/Drawer/index.js.map +1 -1
- package/components/Dropdown/Dropdown.d.ts +4 -1
- package/components/Dropdown/index.js +34 -8
- package/components/Dropdown/index.js.map +1 -1
- package/components/Dropdown/resourceHelper.d.ts +3 -0
- package/components/Dropdown/styles.module.scss +1 -0
- package/components/ExpanderList/index.js +12 -5
- package/components/ExpanderList/index.js.map +1 -1
- package/components/Icons/AdditionalIconInformation.d.ts +20 -0
- package/components/Icons/AdditionalIconInformation.js +5 -0
- package/components/Icons/AdditionalIconInformation.js.map +1 -1
- package/components/Modal/Modal.d.ts +2 -0
- package/components/Modal/index.js +4 -8
- package/components/Modal/index.js.map +1 -1
- package/components/Panel/Panel.d.ts +65 -0
- package/components/Panel/Panel.test.d.ts +1 -0
- package/components/Panel/PanelExamples.d.ts +8 -0
- package/components/Panel/PanelTitle/PanelTitle.d.ts +15 -0
- package/components/Panel/PanelTitle/index.d.ts +3 -0
- package/components/Panel/PanelTitle/index.js +5 -0
- package/components/Panel/PanelTitle/index.js.map +1 -0
- package/components/Panel/PanelTitle/styles.module.scss +43 -0
- package/components/Panel/PanelTitle/styles.module.scss.d.ts +13 -0
- package/components/Panel/Paneldocs.d.ts +1 -0
- package/components/Panel/index.d.ts +3 -0
- package/components/Panel/index.js +15 -0
- package/components/Panel/index.js.map +1 -0
- package/components/Panel/styles.module.scss +224 -0
- package/components/Panel/styles.module.scss.d.ts +71 -0
- package/components/PanelList/PanelList.d.ts +2 -2
- package/components/PanelList/index.js +15 -7
- package/components/PanelList/index.js.map +1 -1
- package/components/PanelList/styles.module.scss +19 -4
- package/components/PanelList/styles.module.scss.d.ts +4 -1
- package/components/PanelListOld/PanelListOld.d.ts +12 -0
- package/components/PanelListOld/PanelListOld.test.d.ts +1 -0
- package/components/PanelListOld/index.d.ts +3 -0
- package/components/PanelListOld/index.js +20 -0
- package/components/PanelListOld/index.js.map +1 -0
- package/components/PanelListOld/styles.module.scss +14 -0
- package/components/PanelListOld/styles.module.scss.d.ts +9 -0
- package/components/RadioButton/styles.module.scss +3 -3
- package/components/StatusDot/styles.module.scss +8 -16
- package/components/StatusDot/styles.module.scss.d.ts +1 -0
- package/components/Tabs/TabsDocs.d.ts +1 -0
- package/components/Toggle/styles.module.scss +10 -2
- package/constants.d.ts +1 -2
- package/constants.js +1 -2
- package/constants.js.map +1 -1
- package/designsystem-react.css +9 -9
- package/hooks/useBreakpoint.js +3 -1
- package/hooks/useBreakpoint.js.map +1 -1
- package/package.json +1 -1
- package/resources/HN.Designsystem.Dropdown.en-GB.json.d.ts +6 -0
- package/resources/HN.Designsystem.Dropdown.nb-NO.json.d.ts +6 -0
- package/resources/index.d.ts +0 -0
- package/scss/helsenorge.scss +7 -7
- package/scss/supernova/index.css +2 -2
- package/scss/supernova/styles/colors.css +9 -9
- package/utils/scroll.d.ts +2 -0
- package/utils/scroll.js +11 -0
- package/utils/scroll.js.map +1 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PaletteNames } from '../../theme/palette';
|
|
3
|
+
import { PanelTitleProps } from './PanelTitle';
|
|
4
|
+
export declare enum PanelLayout {
|
|
5
|
+
vertical = "vertical",
|
|
6
|
+
horizontal = "horizontal",
|
|
7
|
+
combined = "combined",
|
|
8
|
+
bAsRightCol = "bAsRightCol"
|
|
9
|
+
}
|
|
10
|
+
export type PanelColors = Extract<PaletteNames, 'white' | 'neutral'>;
|
|
11
|
+
export declare enum PanelVariant {
|
|
12
|
+
fill = "fill",
|
|
13
|
+
line = "line",
|
|
14
|
+
outline = "outline"
|
|
15
|
+
}
|
|
16
|
+
export declare enum PanelStacking {
|
|
17
|
+
default = "default",
|
|
18
|
+
bFirst = "bFirst"
|
|
19
|
+
}
|
|
20
|
+
export declare enum PanelStatus {
|
|
21
|
+
none = "none",
|
|
22
|
+
new = "new",
|
|
23
|
+
error = "error",
|
|
24
|
+
draft = "draft"
|
|
25
|
+
}
|
|
26
|
+
export interface PanelProps {
|
|
27
|
+
/** Sets the text on the bottom call to action button */
|
|
28
|
+
buttonBottomText?: string;
|
|
29
|
+
/** Sets the action on the bottom call to action button */
|
|
30
|
+
buttonBottomOnClick?: () => void;
|
|
31
|
+
/** Sets the layout and order of the content boxes */
|
|
32
|
+
layout?: PanelLayout;
|
|
33
|
+
/** Sets the visual variant of panel */
|
|
34
|
+
variant?: PanelVariant;
|
|
35
|
+
/** Sets the color for panel if it has variant fill */
|
|
36
|
+
color?: PanelColors;
|
|
37
|
+
/** Sets classes on the outermost container of the panel */
|
|
38
|
+
className?: string;
|
|
39
|
+
/** Sets the stacking order of the content boxes */
|
|
40
|
+
stacking?: PanelStacking;
|
|
41
|
+
/** Sets the data-testid attribute. */
|
|
42
|
+
testId?: string;
|
|
43
|
+
/** Children elements to be rendered inside the panel */
|
|
44
|
+
children?: React.ReactNode;
|
|
45
|
+
/** Displays a status on the left side: default normal */
|
|
46
|
+
status?: PanelStatus;
|
|
47
|
+
}
|
|
48
|
+
declare const Panel: React.FC<PanelProps> & {
|
|
49
|
+
PreContainer: React.FC<ContentProps>;
|
|
50
|
+
Title: React.FC<PanelTitleProps>;
|
|
51
|
+
A: React.FC<ContentProps>;
|
|
52
|
+
B: React.FC<ContentProps>;
|
|
53
|
+
C: React.FC<ContentProps>;
|
|
54
|
+
ExpandedContent: React.FC<ContentProps>;
|
|
55
|
+
};
|
|
56
|
+
export interface ContentProps {
|
|
57
|
+
/** Children elements to be rendered inside the content box */
|
|
58
|
+
children?: React.ReactNode;
|
|
59
|
+
}
|
|
60
|
+
export declare const PreContainer: React.FC<ContentProps>;
|
|
61
|
+
export declare const A: React.FC<ContentProps>;
|
|
62
|
+
export declare const B: React.FC<ContentProps>;
|
|
63
|
+
export declare const C: React.FC<ContentProps>;
|
|
64
|
+
export declare const ExpandedContent: React.FC<ContentProps>;
|
|
65
|
+
export default Panel;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export declare const MedisinskFødselsregister: React.FC;
|
|
3
|
+
export declare const TimeAvtale: React.FC;
|
|
4
|
+
export declare const PasientReiser: React.FC;
|
|
5
|
+
export declare const Helsekontakter: React.FC;
|
|
6
|
+
export declare const Dokumentliste: React.FC;
|
|
7
|
+
export declare const DokumentlisteDeling: React.FC;
|
|
8
|
+
export declare const NyMelding: React.FC;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface PanelTitleProps {
|
|
3
|
+
/** Badge displayed in title */
|
|
4
|
+
badge?: React.ReactNode;
|
|
5
|
+
/** Icon displayed in title. Only IconSize Small is supported */
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
/** Sets the data-testid attribute. */
|
|
8
|
+
testId?: string;
|
|
9
|
+
/** Title text */
|
|
10
|
+
title: string;
|
|
11
|
+
/** Title HTML markup */
|
|
12
|
+
titleMarkup?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
13
|
+
}
|
|
14
|
+
declare const PanelTitle: React.FC<PanelTitleProps>;
|
|
15
|
+
export default PanelTitle;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../../../scss/spacers' as spacers;
|
|
3
|
+
@use '../../../scss/breakpoints' as breakpoints;
|
|
4
|
+
|
|
5
|
+
.paneltitle {
|
|
6
|
+
display: grid;
|
|
7
|
+
width: 100%;
|
|
8
|
+
gap: spacers.getSpacer(2xs);
|
|
9
|
+
grid-template-areas: 'title';
|
|
10
|
+
|
|
11
|
+
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
12
|
+
gap: spacers.getSpacer(2xs) spacers.getSpacer(s);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&--has-icon {
|
|
16
|
+
margin-left: -3.5rem;
|
|
17
|
+
grid-template-columns: 3rem 1fr;
|
|
18
|
+
grid-template-areas: 'icon title';
|
|
19
|
+
|
|
20
|
+
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
21
|
+
margin-left: -4rem;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&__icon {
|
|
26
|
+
grid-area: icon;
|
|
27
|
+
justify-self: center;
|
|
28
|
+
height: 48px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&__title {
|
|
32
|
+
grid-area: title;
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-flow: row;
|
|
35
|
+
gap: spacers.getSpacer(s);
|
|
36
|
+
margin-top: 8px;
|
|
37
|
+
height: fit-content;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&__badge {
|
|
41
|
+
display: inline;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type Styles = {
|
|
2
|
+
paneltitle: string;
|
|
3
|
+
paneltitle__badge: string;
|
|
4
|
+
paneltitle__icon: string;
|
|
5
|
+
paneltitle__title: string;
|
|
6
|
+
'paneltitle--has-icon': string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export type ClassNames = keyof Styles;
|
|
10
|
+
|
|
11
|
+
declare const styles: Styles;
|
|
12
|
+
|
|
13
|
+
export default styles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PanelDocs: () => React.JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { P as Panel } from "../../Panel.js";
|
|
2
|
+
import { A, B, C, E, a, c, d, b, e } from "../../Panel.js";
|
|
3
|
+
export {
|
|
4
|
+
A,
|
|
5
|
+
B,
|
|
6
|
+
C,
|
|
7
|
+
E as ExpandedContent,
|
|
8
|
+
a as PanelLayout,
|
|
9
|
+
c as PanelStacking,
|
|
10
|
+
d as PanelStatus,
|
|
11
|
+
b as PanelVariant,
|
|
12
|
+
e as PreContainer,
|
|
13
|
+
Panel as default
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../../scss/spacers' as spacers;
|
|
3
|
+
@use '../../scss/breakpoints' as breakpoints;
|
|
4
|
+
@use '../../scss/font-settings' as fonts;
|
|
5
|
+
@use '../Button/styles.module' as button;
|
|
6
|
+
@import '../../scss/supernova/styles/colors.css';
|
|
7
|
+
|
|
8
|
+
.panel {
|
|
9
|
+
$panel: &;
|
|
10
|
+
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-flow: column;
|
|
13
|
+
padding: spacers.getSpacer(s);
|
|
14
|
+
|
|
15
|
+
& > *:not(:last-child) {
|
|
16
|
+
// because of a problem with gap this margin gives space between elements
|
|
17
|
+
margin-bottom: spacers.getSpacer(2xs);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
21
|
+
padding: spacers.getSpacer(m);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&--icon {
|
|
25
|
+
padding-left: calc(3.5rem + spacers.getSpacer(s));
|
|
26
|
+
|
|
27
|
+
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
28
|
+
padding-left: calc(4rem + spacers.getSpacer(m));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&__pre-container {
|
|
33
|
+
width: 100%;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&__content {
|
|
37
|
+
width: 100%;
|
|
38
|
+
height: 100%;
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-flow: column;
|
|
41
|
+
gap: spacers.getSpacer(m);
|
|
42
|
+
|
|
43
|
+
&__item {
|
|
44
|
+
width: 100%;
|
|
45
|
+
height: 100%;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&--b-first {
|
|
49
|
+
.panel__content__item--b {
|
|
50
|
+
order: -1;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&--horizontal {
|
|
55
|
+
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
56
|
+
flex-flow: row;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&--vertical {
|
|
61
|
+
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
62
|
+
flex-flow: column;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&--combined {
|
|
67
|
+
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
68
|
+
display: grid;
|
|
69
|
+
grid-template-areas:
|
|
70
|
+
'contentA contentB'
|
|
71
|
+
'contentC contentC';
|
|
72
|
+
|
|
73
|
+
& .panel__content__item--a {
|
|
74
|
+
grid-area: contentA;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
& .panel__content__item--b {
|
|
78
|
+
grid-area: contentB;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
& .panel__content__item--c {
|
|
82
|
+
grid-area: contentC;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&--bAsRightCol {
|
|
88
|
+
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
89
|
+
display: grid;
|
|
90
|
+
grid-template-areas:
|
|
91
|
+
'contentA contentB'
|
|
92
|
+
'contentC contentB';
|
|
93
|
+
|
|
94
|
+
& .panel__content__item--a {
|
|
95
|
+
grid-area: contentA;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
& .panel__content__item--b {
|
|
99
|
+
grid-area: contentB;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
& .panel__content__item--c {
|
|
103
|
+
grid-area: contentC;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&--white {
|
|
110
|
+
background-color: var(--color-base-background-white);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&--neutral {
|
|
114
|
+
background-color: var(--color-base-background-neutral);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&--line {
|
|
118
|
+
background-color: transparent;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&__border {
|
|
122
|
+
&--outline {
|
|
123
|
+
&--outer {
|
|
124
|
+
border: 1px solid var(--core-color-neutral-300);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&--inner {
|
|
128
|
+
border: 8px solid var(--core-color-neutral-100);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&--line {
|
|
133
|
+
border-top: 1px solid var(--core-color-neutral-600);
|
|
134
|
+
border-bottom: 1px solid var(--core-color-neutral-600);
|
|
135
|
+
border-right: none;
|
|
136
|
+
border-left: none;
|
|
137
|
+
padding: spacers.getSpacer(xs) 0;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&--fill--neutral {
|
|
141
|
+
border: 1px solid var(--core-color-neutral-300);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
&--border {
|
|
146
|
+
border: 2px solid var(--color-base-background-white);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&--status {
|
|
150
|
+
border-left: 6px;
|
|
151
|
+
border-left-style: solid;
|
|
152
|
+
border-left-color: transparent;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
&--new {
|
|
156
|
+
border-left-color: var(--core-color-blueberry-500);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
&--draft {
|
|
160
|
+
border-left: dotted 6px var(--core-color-neutral-500);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&--error {
|
|
164
|
+
border-left-color: var(--core-color-cherry-500);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
&__expander {
|
|
168
|
+
&__border {
|
|
169
|
+
&--expanded {
|
|
170
|
+
border-left: 2px solid var(--color-base-border-onlight-emphasized);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&--not-expanded {
|
|
174
|
+
&--white {
|
|
175
|
+
border-left: 2px solid var(--color-base-background-white);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
&--neutral {
|
|
179
|
+
border-left: 2px solid var(--color-base-background-neutral);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
&--line {
|
|
183
|
+
border-left: 2px solid transparent;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
&__separator {
|
|
189
|
+
height: 1px;
|
|
190
|
+
width: 40px;
|
|
191
|
+
background-color: var(--color-base-border-onlight);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
&__content {
|
|
195
|
+
margin-top: spacers.getSpacer(s);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
&__button-bottom {
|
|
200
|
+
margin-top: spacers.getSpacer(2xs);
|
|
201
|
+
|
|
202
|
+
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
203
|
+
margin-top: spacers.getSpacer(s);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.expander {
|
|
209
|
+
// This is a copy of the button class in Expander
|
|
210
|
+
&__button {
|
|
211
|
+
position: relative;
|
|
212
|
+
padding-right: getSpacer(s);
|
|
213
|
+
text-align: left;
|
|
214
|
+
width: fit-content;
|
|
215
|
+
|
|
216
|
+
&--expanded {
|
|
217
|
+
@include button.outline-borderless-hover;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
&__button &__button__text {
|
|
222
|
+
@include button.outline-borderless-text-hover;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export type Styles = {
|
|
2
|
+
button: string;
|
|
3
|
+
button__arrow: string;
|
|
4
|
+
'button__arrow--both-icons': string;
|
|
5
|
+
'button__both-icons': string;
|
|
6
|
+
'button__left-icon': string;
|
|
7
|
+
'button__only-icon': string;
|
|
8
|
+
'button__right-icon': string;
|
|
9
|
+
'button__right-unicode-arrow': string;
|
|
10
|
+
button__text: string;
|
|
11
|
+
'button__text--centered': string;
|
|
12
|
+
'button__text--ellipsis': string;
|
|
13
|
+
'button--arrow': string;
|
|
14
|
+
'button--arrow--both-icons': string;
|
|
15
|
+
'button--borderless': string;
|
|
16
|
+
'button--both-icons': string;
|
|
17
|
+
'button--destructive': string;
|
|
18
|
+
'button--large': string;
|
|
19
|
+
'button--left-icon': string;
|
|
20
|
+
'button--normal': string;
|
|
21
|
+
'button--on-dark': string;
|
|
22
|
+
'button--only-icon': string;
|
|
23
|
+
'button--outline': string;
|
|
24
|
+
'button--right-icon': string;
|
|
25
|
+
'button-wrapper': string;
|
|
26
|
+
'button-wrapper--fluid': string;
|
|
27
|
+
diagonal: string;
|
|
28
|
+
diagonal__line: string;
|
|
29
|
+
'diagonal--on-dark': string;
|
|
30
|
+
expander__button: string;
|
|
31
|
+
expander__button__text: string;
|
|
32
|
+
'expander__button--expanded': string;
|
|
33
|
+
panel: string;
|
|
34
|
+
'panel__border--fill--neutral': string;
|
|
35
|
+
'panel__border--line': string;
|
|
36
|
+
'panel__border--outline--inner': string;
|
|
37
|
+
'panel__border--outline--outer': string;
|
|
38
|
+
'panel__button-bottom': string;
|
|
39
|
+
panel__content: string;
|
|
40
|
+
panel__content__item: string;
|
|
41
|
+
'panel__content__item--a': string;
|
|
42
|
+
'panel__content__item--b': string;
|
|
43
|
+
'panel__content__item--c': string;
|
|
44
|
+
'panel__content--b-first': string;
|
|
45
|
+
'panel__content--bAsRightCol': string;
|
|
46
|
+
'panel__content--combined': string;
|
|
47
|
+
'panel__content--horizontal': string;
|
|
48
|
+
'panel__content--vertical': string;
|
|
49
|
+
'panel__expander__border--expanded': string;
|
|
50
|
+
'panel__expander__border--not-expanded--line': string;
|
|
51
|
+
'panel__expander__border--not-expanded--neutral': string;
|
|
52
|
+
'panel__expander__border--not-expanded--white': string;
|
|
53
|
+
panel__expander__content: string;
|
|
54
|
+
panel__expander__separator: string;
|
|
55
|
+
'panel__pre-container': string;
|
|
56
|
+
'panel--border': string;
|
|
57
|
+
'panel--draft': string;
|
|
58
|
+
'panel--error': string;
|
|
59
|
+
'panel--icon': string;
|
|
60
|
+
'panel--line': string;
|
|
61
|
+
'panel--neutral': string;
|
|
62
|
+
'panel--new': string;
|
|
63
|
+
'panel--status': string;
|
|
64
|
+
'panel--white': string;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export type ClassNames = keyof Styles;
|
|
68
|
+
|
|
69
|
+
declare const styles: Styles;
|
|
70
|
+
|
|
71
|
+
export default styles;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { PanelVariant } from '../Panel/Panel';
|
|
3
3
|
export interface PanelListProps {
|
|
4
4
|
/** Panels to render inside the PanelList */
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
/** Changes the visual representation of the panel. Default: fill */
|
|
7
|
-
variant?:
|
|
7
|
+
variant?: PanelVariant;
|
|
8
8
|
/** Sets the data-testid attribute. */
|
|
9
9
|
testId?: string;
|
|
10
10
|
}
|
|
@@ -2,17 +2,25 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import React__default from "react";
|
|
3
3
|
import classNames from "classnames";
|
|
4
4
|
import { AnalyticsId } from "../../constants.js";
|
|
5
|
-
import { b as
|
|
5
|
+
import { b as PanelVariant, P as Panel } from "../../Panel.js";
|
|
6
6
|
import styles from "./styles.module.scss";
|
|
7
|
-
const isPanelComponent = (element) => React__default.isValidElement(element) && element.type ===
|
|
7
|
+
const isPanelComponent = (element) => React__default.isValidElement(element) && element.type === Panel;
|
|
8
8
|
const PanelList = React__default.forwardRef(function BadgeForwardedRef(props, ref) {
|
|
9
|
-
const { testId, children, variant =
|
|
10
|
-
const renderPanel = (panel
|
|
9
|
+
const { testId, children, variant = PanelVariant.fill } = props;
|
|
10
|
+
const renderPanel = (panel) => React__default.cloneElement(panel, {
|
|
11
11
|
variant,
|
|
12
|
-
|
|
13
|
-
className: classNames(panel.props.className, variant !== PanelOldVariant.line && styles["panel-list__panel"])
|
|
12
|
+
className: classNames(panel.props.className, styles[`panel-list__panel--${variant}`])
|
|
14
13
|
});
|
|
15
|
-
return /* @__PURE__ */ jsx(
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
ref,
|
|
18
|
+
"data-testid": testId,
|
|
19
|
+
"data-analyticsid": AnalyticsId.PanelList,
|
|
20
|
+
className: classNames({ [styles["panel-list--outline"]]: variant === PanelVariant.outline }),
|
|
21
|
+
children: React__default.Children.map(children, (child) => isPanelComponent(child) ? renderPanel(child) : child)
|
|
22
|
+
}
|
|
23
|
+
);
|
|
16
24
|
});
|
|
17
25
|
export {
|
|
18
26
|
PanelList as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/PanelList/PanelList.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/PanelList/PanelList.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport Panel, { PanelProps, PanelVariant } from '../Panel/Panel';\n\nimport styles from './styles.module.scss';\n\nexport interface PanelListProps {\n /** Panels to render inside the PanelList */\n children?: React.ReactNode;\n /** Changes the visual representation of the panel. Default: fill */\n variant?: PanelVariant;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst isPanelComponent = (element: {} | null | undefined): element is React.ReactElement<PanelProps> =>\n React.isValidElement<PanelProps>(element) && (element as React.ReactElement).type === Panel;\n\nconst PanelList = React.forwardRef(function BadgeForwardedRef(props: PanelListProps, ref: React.ForwardedRef<HTMLDivElement>) {\n const { testId, children, variant = PanelVariant.fill } = props;\n\n const renderPanel = (panel: React.ReactElement<PanelProps>): React.ReactElement<PanelProps> =>\n React.cloneElement(panel, {\n variant: variant,\n className: classNames(panel.props.className, styles[`panel-list__panel--${variant}`]),\n });\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n data-analyticsid={AnalyticsId.PanelList}\n className={classNames({ [styles['panel-list--outline']]: variant === PanelVariant.outline })}\n >\n {React.Children.map(children, child => (isPanelComponent(child) ? renderPanel(child) : child))}\n </div>\n );\n});\n\nexport default PanelList;\n"],"names":["React"],"mappings":";;;;;;AAkBA,MAAM,mBAAmB,CAAC,YACxBA,eAAM,eAA2B,OAAO,KAAM,QAA+B,SAAS;AAExF,MAAM,YAAYA,eAAM,WAAW,SAAS,kBAAkB,OAAuB,KAAyC;AAC5H,QAAM,EAAE,QAAQ,UAAU,UAAU,aAAa,SAAS;AAE1D,QAAM,cAAc,CAAC,UACnBA,eAAM,aAAa,OAAO;AAAA,IACxB;AAAA,IACA,WAAW,WAAW,MAAM,MAAM,WAAW,OAAO,sBAAsB,OAAO,EAAE,CAAC;AAAA,EAAA,CACrF;AAGD,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,eAAa;AAAA,MACb,oBAAkB,YAAY;AAAA,MAC9B,WAAW,WAAW,EAAE,CAAC,OAAO,qBAAqB,CAAC,GAAG,YAAY,aAAa,SAAS;AAAA,MAE1F,UAAAA,eAAM,SAAS,IAAI,UAAU,CAAA,UAAU,iBAAiB,KAAK,IAAI,YAAY,KAAK,IAAI,KAAM;AAAA,IAAA;AAAA,EAC/F;AAEJ,CAAC;"}
|
|
@@ -4,11 +4,26 @@
|
|
|
4
4
|
@use '../../scss/breakpoints' as breakpoints;
|
|
5
5
|
|
|
6
6
|
.panel-list {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
&--outline {
|
|
8
|
+
border: 1px solid var(--core-color-neutral-300);
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
& > div {
|
|
11
|
+
// overstyrer så ikke hvert panel har egen border
|
|
12
|
+
border: none;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&__panel {
|
|
17
|
+
&--line:not(:last-child) {
|
|
18
|
+
margin-bottom: -1px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&--outline:not(:last-child) {
|
|
22
|
+
margin-bottom: -9px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&--fill:not(:last-child) {
|
|
26
|
+
margin-bottom: spacers.getSpacer(xs);
|
|
12
27
|
}
|
|
13
28
|
}
|
|
14
29
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PanelOldVariant } from '../PanelOld';
|
|
3
|
+
export interface PanelListOldProps {
|
|
4
|
+
/** Panels to render inside the PanelList */
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
/** Changes the visual representation of the panel. Default: fill */
|
|
7
|
+
variant?: keyof typeof PanelOldVariant;
|
|
8
|
+
/** Sets the data-testid attribute. */
|
|
9
|
+
testId?: string;
|
|
10
|
+
}
|
|
11
|
+
declare const PanelListOld: React.ForwardRefExoticComponent<PanelListOldProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export default PanelListOld;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React__default from "react";
|
|
3
|
+
import classNames from "classnames";
|
|
4
|
+
import { AnalyticsId } from "../../constants.js";
|
|
5
|
+
import { b as PanelOldVariant, P as PanelOld } from "../../PanelOld.js";
|
|
6
|
+
import styles from "./styles.module.scss";
|
|
7
|
+
const isPanelComponent = (element) => React__default.isValidElement(element) && element.type === PanelOld;
|
|
8
|
+
const PanelListOld = React__default.forwardRef(function BadgeForwardedRef(props, ref) {
|
|
9
|
+
const { testId, children, variant = PanelOldVariant.fill } = props;
|
|
10
|
+
const renderPanel = (panel, firstChild) => React__default.cloneElement(panel, {
|
|
11
|
+
variant,
|
|
12
|
+
noTopBorder: variant === PanelOldVariant.line && !firstChild,
|
|
13
|
+
className: classNames(panel.props.className, variant !== PanelOldVariant.line && styles["panel-list__panel"])
|
|
14
|
+
});
|
|
15
|
+
return /* @__PURE__ */ jsx("div", { ref, "data-testid": testId, "data-analyticsid": AnalyticsId.PanelList, children: React__default.Children.map(children, (child, index) => isPanelComponent(child) ? renderPanel(child, index === 0) : child) });
|
|
16
|
+
});
|
|
17
|
+
export {
|
|
18
|
+
PanelListOld as default
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/PanelListOld/PanelListOld.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport PanelOld, { PanelOldProps, PanelOldVariant } from '../PanelOld';\n\nimport styles from './styles.module.scss';\n\nexport interface PanelListOldProps {\n /** Panels to render inside the PanelList */\n children?: React.ReactNode;\n /** Changes the visual representation of the panel. Default: fill */\n variant?: keyof typeof PanelOldVariant;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst isPanelComponent = (element: {} | null | undefined): element is React.ReactElement<PanelOldProps> =>\n React.isValidElement<PanelOldProps>(element) && (element as React.ReactElement).type === PanelOld;\n\nconst PanelListOld = React.forwardRef(function BadgeForwardedRef(props: PanelListOldProps, ref: React.ForwardedRef<HTMLDivElement>) {\n const { testId, children, variant = PanelOldVariant.fill } = props;\n\n const renderPanel = (panel: React.ReactElement<PanelOldProps>, firstChild: boolean) =>\n React.cloneElement(panel, {\n variant: variant,\n noTopBorder: variant === PanelOldVariant.line && !firstChild,\n className: classNames(panel.props.className, variant !== PanelOldVariant.line && styles['panel-list__panel']),\n });\n\n return (\n <div ref={ref} data-testid={testId} data-analyticsid={AnalyticsId.PanelList}>\n {React.Children.map(children, (child, index) => (isPanelComponent(child) ? renderPanel(child, index === 0) : child))}\n </div>\n );\n});\n\nexport default PanelListOld;\n"],"names":["React"],"mappings":";;;;;;AAkBA,MAAM,mBAAmB,CAAC,YACxBA,eAAM,eAA8B,OAAO,KAAM,QAA+B,SAAS;AAE3F,MAAM,eAAeA,eAAM,WAAW,SAAS,kBAAkB,OAA0B,KAAyC;AAClI,QAAM,EAAE,QAAQ,UAAU,UAAU,gBAAgB,SAAS;AAE7D,QAAM,cAAc,CAAC,OAA0C,eAC7DA,eAAM,aAAa,OAAO;AAAA,IACxB;AAAA,IACA,aAAa,YAAY,gBAAgB,QAAQ,CAAC;AAAA,IAClD,WAAW,WAAW,MAAM,MAAM,WAAW,YAAY,gBAAgB,QAAQ,OAAO,mBAAmB,CAAC;AAAA,EAAA,CAC7G;AAGD,SAAA,oBAAC,OAAI,EAAA,KAAU,eAAa,QAAQ,oBAAkB,YAAY,WAC/D,UAAMA,eAAA,SAAS,IAAI,UAAU,CAAC,OAAO,UAAW,iBAAiB,KAAK,IAAI,YAAY,OAAO,UAAU,CAAC,IAAI,KAAM,EACrH,CAAA;AAEJ,CAAC;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../../scss/spacers' as spacers;
|
|
3
|
+
@use '../../scss/palette' as palette;
|
|
4
|
+
@use '../../scss/breakpoints' as breakpoints;
|
|
5
|
+
|
|
6
|
+
.panel-list {
|
|
7
|
+
&__panel:not(:last-child) {
|
|
8
|
+
margin-bottom: spacers.getSpacer(2xs);
|
|
9
|
+
|
|
10
|
+
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
11
|
+
margin-bottom: spacers.getSpacer(s);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|