@helsenorge/designsystem-react 14.10.0 → 14.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/BabyMobileMedium.js +1 -1
- package/lib/CHANGELOG.md +16 -0
- package/lib/Checkbox.js +25 -48
- package/lib/Checkbox.js.map +1 -1
- package/lib/CheckboxMarker.js +60 -0
- package/lib/CheckboxMarker.js.map +1 -0
- package/lib/ChildMedium.js +1 -1
- package/lib/EyeContactMedium.js +79 -0
- package/lib/EyeContactMedium.js.map +1 -0
- package/lib/FacialRecognitionFingerprintMedium.js +1 -1
- package/lib/Filter.js +12 -12
- package/lib/Filter.js.map +1 -1
- package/lib/FormGroup.js +5 -5
- package/lib/FormGroup.js.map +1 -1
- package/lib/GiveBabyFoodMedium.js +1 -1
- package/lib/Illustration.js +1 -1
- package/lib/IllustrationNames.js +4 -0
- package/lib/IllustrationNames.js.map +1 -1
- package/lib/LazyIllustration.js +5 -1
- package/lib/LazyIllustration.js.map +1 -1
- package/lib/Radio.js +73 -0
- package/lib/Radio.js.map +1 -0
- package/lib/RadioButton.js +81 -3
- package/lib/RadioButton.js.map +1 -1
- package/lib/RadioButton2.js +3 -73
- package/lib/RadioButton2.js.map +1 -1
- package/lib/RadioMarker.js +31 -0
- package/lib/RadioMarker.js.map +1 -0
- package/lib/ReadLettersMedium.js +1 -1
- package/lib/Search.js +4 -4
- package/lib/Search.js.map +1 -1
- package/lib/SkinToSkinMedium.js +106 -0
- package/lib/SkinToSkinMedium.js.map +1 -0
- package/lib/StorkMedium.js +1 -1
- package/lib/StrollerMedium.js +1 -1
- package/lib/Support2Medium.js +1 -1
- package/lib/TableBody.js +1 -1
- package/lib/TableHead.js +1 -1
- package/lib/TableRow.js +1 -1
- package/lib/ThinkingMedium.js +1 -1
- package/lib/VisualCheckbox.js +77 -0
- package/lib/VisualCheckbox.js.map +1 -0
- package/lib/VisualRadio.js +62 -0
- package/lib/VisualRadio.js.map +1 -0
- package/lib/__mocks__/matchMedia.js +3 -2
- package/lib/__mocks__/matchMedia.js.map +1 -1
- package/lib/components/Checkbox/CheckboxMarker/CheckboxMarker.d.ts +20 -0
- package/lib/components/Checkbox/CheckboxMarker/styles.module.scss +309 -0
- package/lib/components/Checkbox/CheckboxMarker/styles.module.scss.d.ts +25 -0
- package/lib/components/Checkbox/styles.module.scss +9 -269
- package/lib/components/Checkbox/styles.module.scss.d.ts +1 -17
- package/lib/components/Icons/Sort.js +12 -12
- package/lib/components/Icons/Sort.js.map +1 -1
- package/lib/components/Illustration/index.js +1 -1
- package/lib/components/Illustrations/BabyMobile.js +1 -1
- package/lib/components/Illustrations/Child.js +1 -1
- package/lib/components/Illustrations/Doctor.js +1 -1
- package/lib/components/Illustrations/EyeContact.d.ts +8 -0
- package/lib/components/Illustrations/EyeContact.js +16 -0
- package/lib/components/Illustrations/EyeContact.js.map +1 -0
- package/lib/components/Illustrations/EyeContactMedium.d.ts +3 -0
- package/lib/components/Illustrations/EyeContactMedium.js +2 -0
- package/lib/components/Illustrations/FacialRecognitionFingerprint.js +1 -1
- package/lib/components/Illustrations/GiveBabyFood.js +1 -1
- package/lib/components/Illustrations/HealthcarePersonnel.js +1 -1
- package/lib/components/Illustrations/IllustrationNames.d.ts +1 -1
- package/lib/components/Illustrations/ReadLetters.js +1 -1
- package/lib/components/Illustrations/SkinToSkin.d.ts +8 -0
- package/lib/components/Illustrations/SkinToSkin.js +16 -0
- package/lib/components/Illustrations/SkinToSkin.js.map +1 -0
- package/lib/components/Illustrations/SkinToSkinMedium.d.ts +3 -0
- package/lib/components/Illustrations/SkinToSkinMedium.js +2 -0
- package/lib/components/Illustrations/Stork.js +1 -1
- package/lib/components/Illustrations/Stroller.js +1 -1
- package/lib/components/Illustrations/Support2.js +1 -1
- package/lib/components/Illustrations/Thinking.js +1 -1
- package/lib/components/Panel/index.js +1 -1
- package/lib/components/PanelList/index.js +1 -1
- package/lib/components/RadioButton/RadioMarker/RadioMarker.d.ts +20 -0
- package/lib/components/RadioButton/RadioMarker/styles.module.scss +288 -0
- package/lib/components/RadioButton/RadioMarker/styles.module.scss.d.ts +20 -0
- package/lib/components/RadioButton/index.d.ts +0 -1
- package/lib/components/RadioButton/index.js +3 -3
- package/lib/components/RadioButton/styles.module.scss +13 -275
- package/lib/components/RadioButton/styles.module.scss.d.ts +2 -12
- package/lib/components/Table/index.js +1 -1
- package/lib/components/Validation/index.js +1 -1
- package/lib/components/VisualCheckboxCloud/Checkbox/styles.module.scss +5 -128
- package/lib/components/VisualCheckboxCloud/styles.module.scss +2 -9
- package/lib/components/VisualCheckboxGroup/VisualCheckbox/VisualCheckbox.d.ts +26 -0
- package/lib/components/VisualCheckboxGroup/VisualCheckbox/VisualContent.d.ts +10 -0
- package/lib/components/VisualCheckboxGroup/VisualCheckbox/index.d.ts +3 -0
- package/lib/components/VisualCheckboxGroup/VisualCheckbox/index.js +5 -0
- package/lib/components/VisualCheckboxGroup/VisualCheckbox/index.js.map +1 -0
- package/lib/components/VisualCheckboxGroup/VisualCheckbox/styles.module.scss +7 -0
- package/lib/components/VisualCheckboxGroup/VisualCheckbox/styles.module.scss.d.ts +18 -0
- package/lib/components/VisualCheckboxGroup/VisualCheckboxGroup.d.ts +33 -0
- package/lib/components/VisualCheckboxGroup/index.d.ts +3 -0
- package/lib/components/VisualCheckboxGroup/index.js +43 -0
- package/lib/components/VisualCheckboxGroup/index.js.map +1 -0
- package/lib/components/VisualCheckboxGroup/styles.module.scss +6 -0
- package/lib/components/VisualCheckboxGroup/styles.module.scss.d.ts +10 -0
- package/lib/components/{VisualRadioButtonCloud/RadioButton/RadioButton.d.ts → VisualRadioCloud/Radio/Radio.d.ts} +3 -3
- package/lib/components/VisualRadioCloud/Radio/index.d.ts +3 -0
- package/lib/components/VisualRadioCloud/Radio/index.js +5 -0
- package/lib/components/VisualRadioCloud/Radio/index.js.map +1 -0
- package/lib/components/VisualRadioCloud/Radio/styles.module.scss +7 -0
- package/lib/components/VisualRadioCloud/Radio/styles.module.scss.d.ts +15 -0
- package/lib/components/{VisualRadioButtonCloud/VisualRadioButtonCloud.d.ts → VisualRadioCloud/VisualRadioCloud.d.ts} +8 -8
- package/lib/components/VisualRadioCloud/index.d.ts +3 -0
- package/lib/components/{VisualRadioButtonCloud → VisualRadioCloud}/index.js +7 -7
- package/lib/components/VisualRadioCloud/index.js.map +1 -0
- package/lib/components/VisualRadioCloud/styles.module.scss +6 -0
- package/lib/components/{VisualRadioButtonCloud → VisualRadioCloud}/styles.module.scss.d.ts +1 -1
- package/lib/components/VisualRadioGroup/VisualRadio/VisualContent.d.ts +10 -0
- package/lib/components/VisualRadioGroup/VisualRadio/VisualRadio.d.ts +26 -0
- package/lib/components/VisualRadioGroup/VisualRadio/index.d.ts +3 -0
- package/lib/components/VisualRadioGroup/VisualRadio/index.js +5 -0
- package/lib/components/VisualRadioGroup/VisualRadio/index.js.map +1 -0
- package/lib/components/VisualRadioGroup/VisualRadio/styles.module.scss +7 -0
- package/lib/components/VisualRadioGroup/VisualRadio/styles.module.scss.d.ts +18 -0
- package/lib/components/VisualRadioGroup/VisualRadioGroup.d.ts +39 -0
- package/lib/components/VisualRadioGroup/index.d.ts +3 -0
- package/lib/components/VisualRadioGroup/index.js +63 -0
- package/lib/components/VisualRadioGroup/index.js.map +1 -0
- package/lib/components/VisualRadioGroup/styles.module.scss +6 -0
- package/lib/components/VisualRadioGroup/styles.module.scss.d.ts +10 -0
- package/lib/resourceHelper.js +10 -6
- package/lib/resourceHelper.js.map +1 -1
- package/lib/resources/HN.Designsystem.Filter.en-GB.json.d.ts +5 -3
- package/lib/resources/HN.Designsystem.Filter.nb-NO.json.d.ts +5 -3
- package/lib/resources/Resources.d.ts +10 -2
- package/lib/scss/_visual-form.scss +357 -0
- package/lib/utils3.js +10 -98
- package/lib/utils3.js.map +1 -1
- package/lib/utils4.js +28 -11
- package/lib/utils4.js.map +1 -1
- package/lib/utils5.js +58 -28
- package/lib/utils5.js.map +1 -1
- package/package.json +115 -1
- package/scss/_visual-form.scss +357 -0
- package/lib/components/RadioButton/utils.d.ts +0 -2
- package/lib/components/VisualRadioButtonCloud/RadioButton/index.d.ts +0 -3
- package/lib/components/VisualRadioButtonCloud/RadioButton/index.js +0 -5
- package/lib/components/VisualRadioButtonCloud/RadioButton/index.js.map +0 -1
- package/lib/components/VisualRadioButtonCloud/RadioButton/styles.module.scss +0 -133
- package/lib/components/VisualRadioButtonCloud/RadioButton/styles.module.scss.d.ts +0 -15
- package/lib/components/VisualRadioButtonCloud/index.d.ts +0 -3
- package/lib/components/VisualRadioButtonCloud/index.js.map +0 -1
- package/lib/components/VisualRadioButtonCloud/styles.module.scss +0 -13
- package/lib/utils6.js +0 -60
- package/lib/utils6.js.map +0 -1
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use 'breakpoints' as breakpoints;
|
|
3
|
+
@use 'font-mixins' as fonts;
|
|
4
|
+
|
|
5
|
+
// Wrapper layout shared by VisualCheckboxCloud and VisualRadioCloud
|
|
6
|
+
@mixin visual-form-cloud {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-flow: row wrap;
|
|
9
|
+
gap: var(--core-space-4xs) var(--core-space-xs);
|
|
10
|
+
|
|
11
|
+
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
12
|
+
gap: var(--core-space-m) var(--core-space-s);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Pill-style input shared by VisualCheckboxCloud/Checkbox and VisualRadioCloud/Radio
|
|
17
|
+
@mixin visual-form-pill(
|
|
18
|
+
$pill-padding-mobile: var(--core-space-3xs) var(--core-space-m),
|
|
19
|
+
$checked-pill-padding-md: var(--core-space-3xs) var(--core-space-m) var(--core-space-3xs) 1.25rem
|
|
20
|
+
) {
|
|
21
|
+
position: relative;
|
|
22
|
+
display: inline-flex;
|
|
23
|
+
align-items: stretch;
|
|
24
|
+
min-height: 2.75rem;
|
|
25
|
+
padding: 0.313rem 0;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
|
|
28
|
+
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
29
|
+
padding: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&__input {
|
|
33
|
+
// Hides input while making sure screen reader outline wraps the entire component
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
position: absolute;
|
|
36
|
+
z-index: 0;
|
|
37
|
+
inset: 0;
|
|
38
|
+
width: 100%;
|
|
39
|
+
height: 100%;
|
|
40
|
+
outline: none;
|
|
41
|
+
appearance: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&__pill {
|
|
45
|
+
position: relative;
|
|
46
|
+
z-index: 1;
|
|
47
|
+
display: inline-flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
gap: var(--core-space-2xs);
|
|
50
|
+
box-sizing: border-box;
|
|
51
|
+
min-height: var(--core-space-l);
|
|
52
|
+
padding: $pill-padding-mobile;
|
|
53
|
+
border-radius: 100px;
|
|
54
|
+
background-color: var(--color-action-background-ondark);
|
|
55
|
+
border: 1px solid var(--color-action-border-onlight);
|
|
56
|
+
color: var(--color-base-text-onlight);
|
|
57
|
+
|
|
58
|
+
@include fonts.title6;
|
|
59
|
+
|
|
60
|
+
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
61
|
+
min-height: var(--core-space-xl);
|
|
62
|
+
padding: var(--core-space-3xs) var(--core-space-l);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&:hover &__pill {
|
|
67
|
+
background-color: var(--color-action-background-ondark-hover);
|
|
68
|
+
border-color: var(--color-action-border-onlight-hover);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&:active &__pill {
|
|
72
|
+
background-color: var(--color-action-background-ondark-selected);
|
|
73
|
+
border-color: var(--color-action-border-onlight-hover);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&--checked &__pill,
|
|
77
|
+
&:has(input:checked) &__pill {
|
|
78
|
+
background-color: var(--color-action-background-onlight);
|
|
79
|
+
color: var(--color-action-text-ondark);
|
|
80
|
+
border-color: var(--color-action-background-onlight);
|
|
81
|
+
padding: var(--core-space-3xs) var(--core-space-s);
|
|
82
|
+
|
|
83
|
+
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
84
|
+
padding: $checked-pill-padding-md;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&--checked:hover &__pill,
|
|
89
|
+
&:has(input:checked):hover &__pill {
|
|
90
|
+
background-color: var(--color-action-graphics-onlight-hover);
|
|
91
|
+
border-color: var(--color-action-graphics-onlight-hover);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&--checked:active &__pill,
|
|
95
|
+
&:has(input:checked):active &__pill {
|
|
96
|
+
background-color: var(--color-action-background-onlight-active);
|
|
97
|
+
border-color: var(--color-action-background-onlight-active);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&--invalid &__pill {
|
|
101
|
+
background-color: var(--color-action-background-ondark);
|
|
102
|
+
border-color: var(--color-destructive-border-normal);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&--invalid:hover &__pill {
|
|
106
|
+
background-color: var(--color-destructive-background-normal);
|
|
107
|
+
border-color: var(--color-destructive-border-normal);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&--invalid:active &__pill {
|
|
111
|
+
background-color: var(--color-destructive-background-emphasized);
|
|
112
|
+
border-color: var(--color-destructive-border-normal);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&--invalid#{&}--checked &__pill,
|
|
116
|
+
&--invalid:has(input:checked) &__pill {
|
|
117
|
+
background-color: var(--color-destructive-graphics-normal);
|
|
118
|
+
border-color: var(--color-destructive-graphics-normal);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&--invalid#{&}--checked:hover &__pill,
|
|
122
|
+
&--invalid:has(input:checked):hover &__pill {
|
|
123
|
+
background-color: var(--color-destructive-graphics-hover);
|
|
124
|
+
border-color: var(--color-destructive-graphics-hover);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&--invalid#{&}--checked:active &__pill,
|
|
128
|
+
&--invalid:has(input:checked):active &__pill {
|
|
129
|
+
background-color: var(--color-destructive-graphics-emphasized-onlight);
|
|
130
|
+
border-color: var(--color-destructive-graphics-emphasized-onlight);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&__input:focus-visible + &__pill {
|
|
134
|
+
outline: 3px solid var(--color-action-border-onlight-focus);
|
|
135
|
+
border-color: var(--color-action-border-ondark);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&__icon {
|
|
139
|
+
display: inline-flex;
|
|
140
|
+
align-items: center;
|
|
141
|
+
justify-content: center;
|
|
142
|
+
|
|
143
|
+
svg {
|
|
144
|
+
fill: var(--color-action-graphics-ondark);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&__label {
|
|
149
|
+
text-box: trim-both cap alphabetic;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// Grid layout shared by VisualCheckboxGroup and VisualRadioGroup.
|
|
154
|
+
@mixin visual-form-group {
|
|
155
|
+
display: grid;
|
|
156
|
+
grid-template-columns: repeat(auto-fit, minmax(8.75rem, 1fr));
|
|
157
|
+
gap: var(--core-space-xs);
|
|
158
|
+
|
|
159
|
+
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
160
|
+
gap: 0.75rem var(--core-space-xs, 0.75rem);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&--variant-line {
|
|
164
|
+
grid-template-columns: 1fr;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// Styling shared by VisualCheckbox and VisualRadio
|
|
169
|
+
@mixin visual-form-card {
|
|
170
|
+
display: flex;
|
|
171
|
+
position: relative;
|
|
172
|
+
cursor: pointer;
|
|
173
|
+
width: 100%;
|
|
174
|
+
|
|
175
|
+
&--variant-line {
|
|
176
|
+
flex-direction: row;
|
|
177
|
+
justify-content: flex-start;
|
|
178
|
+
align-items: center;
|
|
179
|
+
min-height: 6rem;
|
|
180
|
+
min-width: 15.125rem;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
&--variant-rectangle {
|
|
184
|
+
flex-direction: column;
|
|
185
|
+
align-items: center;
|
|
186
|
+
min-height: 12.625rem;
|
|
187
|
+
min-width: 8.75rem;
|
|
188
|
+
height: 100%;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
&__input {
|
|
192
|
+
// Hides input while making sure screen reader outline wraps the entire component
|
|
193
|
+
cursor: pointer;
|
|
194
|
+
position: absolute;
|
|
195
|
+
z-index: 0;
|
|
196
|
+
inset: 0;
|
|
197
|
+
width: 100%;
|
|
198
|
+
height: 100%;
|
|
199
|
+
outline: none;
|
|
200
|
+
appearance: none;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
&__frame {
|
|
204
|
+
position: relative;
|
|
205
|
+
width: 100%;
|
|
206
|
+
z-index: 1;
|
|
207
|
+
display: inline-flex;
|
|
208
|
+
border-radius: 4px;
|
|
209
|
+
background: var(--color-action-background-ondark);
|
|
210
|
+
border: 2px solid var(--color-action-border-onlight);
|
|
211
|
+
color: var(--color-base-text-onlight);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
&--variant-line &__frame {
|
|
215
|
+
margin-left: -2.87rem;
|
|
216
|
+
gap: var(--core-space-2xs);
|
|
217
|
+
flex-direction: row;
|
|
218
|
+
justify-content: flex-end;
|
|
219
|
+
align-items: center;
|
|
220
|
+
min-height: 4.63rem;
|
|
221
|
+
min-width: 12.25rem;
|
|
222
|
+
padding: var(--core-space-s) var(--core-space-m) var(--core-space-s) var(--core-space-2xl);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
&--variant-rectangle &__frame {
|
|
226
|
+
margin-top: -4.37rem;
|
|
227
|
+
flex: 1;
|
|
228
|
+
gap: var(--core-space-xs);
|
|
229
|
+
flex-direction: column;
|
|
230
|
+
align-items: center;
|
|
231
|
+
justify-content: flex-end;
|
|
232
|
+
text-align: center;
|
|
233
|
+
min-width: 8.75rem;
|
|
234
|
+
min-height: 10.25rem;
|
|
235
|
+
padding: var(--core-space-3xl) var(--core-space-xs) var(--core-space-m) var(--core-space-xs);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
&__visual-content {
|
|
239
|
+
position: relative;
|
|
240
|
+
z-index: 2;
|
|
241
|
+
display: inline-flex;
|
|
242
|
+
align-items: center;
|
|
243
|
+
justify-content: center;
|
|
244
|
+
overflow: hidden;
|
|
245
|
+
border-radius: 100%;
|
|
246
|
+
background: var(--color-action-background-ondark);
|
|
247
|
+
border: 2px solid var(--color-action-border-ondark);
|
|
248
|
+
|
|
249
|
+
> * {
|
|
250
|
+
width: 100%;
|
|
251
|
+
height: 100%;
|
|
252
|
+
object-fit: cover;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
&--variant-line &__visual-content {
|
|
257
|
+
min-width: var(--core-space-4xl);
|
|
258
|
+
min-height: var(--core-space-4xl);
|
|
259
|
+
|
|
260
|
+
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
261
|
+
min-width: var(--core-space-5xl);
|
|
262
|
+
min-height: var(--core-space-5xl);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
&--variant-rectangle &__visual-content {
|
|
267
|
+
flex-shrink: 0;
|
|
268
|
+
width: calc(100% - 2rem);
|
|
269
|
+
min-width: 6.75rem;
|
|
270
|
+
max-width: 13rem;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
&--checked &__frame,
|
|
274
|
+
&:has(input:checked) &__frame {
|
|
275
|
+
background: var(--color-action-background-onlight);
|
|
276
|
+
color: var(--color-action-text-ondark);
|
|
277
|
+
border-color: var(--color-action-background-onlight);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
&--invalid &__frame {
|
|
281
|
+
background: var(--color-action-background-ondark);
|
|
282
|
+
border-color: var(--core-color-cherry-500);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
&:hover &__frame {
|
|
286
|
+
background: var(--core-color-neutral-50);
|
|
287
|
+
border-color: var(--color-action-border-onlight-hover);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
&:active &__frame {
|
|
291
|
+
background: var(--core-color-neutral-100);
|
|
292
|
+
border-color: var(--color-action-border-onlight-hover);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
&--checked:hover &__frame,
|
|
296
|
+
&:has(input:checked):hover &__frame {
|
|
297
|
+
background: var(--color-action-background-onlight-hover);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
&--checked:active &__frame,
|
|
301
|
+
&:has(input:checked):active &__frame {
|
|
302
|
+
background: var(--color-action-background-onlight-active);
|
|
303
|
+
border-color: var(--color-action-background-onlight-active);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
&--invalid:hover &__frame {
|
|
307
|
+
background: var(--core-color-cherry-50);
|
|
308
|
+
border-color: var(--core-color-cherry-500);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
&--invalid:active &__frame {
|
|
312
|
+
background: var(--core-color-cherry-100);
|
|
313
|
+
border-color: var(--core-color-cherry-500);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
&--invalid#{&}--checked &__frame,
|
|
317
|
+
&--invalid:has(input:checked) &__frame {
|
|
318
|
+
background: var(--core-color-cherry-50);
|
|
319
|
+
color: var(--color-base-text-onlight);
|
|
320
|
+
border-color: var(--core-color-cherry-500);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
&--invalid#{&}--checked:hover &__frame,
|
|
324
|
+
&--invalid:has(input:checked):hover &__frame {
|
|
325
|
+
background: var(--core-color-cherry-100);
|
|
326
|
+
border-color: var(--core-color-cherry-500);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
&--invalid#{&}--checked:active &__frame,
|
|
330
|
+
&--invalid:has(input:checked):active &__frame {
|
|
331
|
+
background: var(--core-color-cherry-200);
|
|
332
|
+
border-color: var(--core-color-cherry-500);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
&__input:focus-visible + &__frame {
|
|
336
|
+
outline: 4px solid var(--color-action-border-onlight-focus);
|
|
337
|
+
border-color: var(--color-action-border-ondark);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
&__icon {
|
|
341
|
+
display: inline-flex;
|
|
342
|
+
align-items: center;
|
|
343
|
+
justify-content: center;
|
|
344
|
+
|
|
345
|
+
svg {
|
|
346
|
+
fill: var(--color-action-graphics-ondark);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
&__label {
|
|
351
|
+
flex: 1;
|
|
352
|
+
min-width: 0;
|
|
353
|
+
overflow-wrap: anywhere;
|
|
354
|
+
|
|
355
|
+
@include fonts.label-subdued;
|
|
356
|
+
}
|
|
357
|
+
}
|
package/lib/utils3.js
CHANGED
|
@@ -1,101 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import { useState } from "react";
|
|
11
|
-
import { jsx } from "react/jsx-runtime";
|
|
12
|
-
import radioButtonStyles from "./components/RadioButton/styles.module.scss";
|
|
13
|
-
const RadioButton = (props) => {
|
|
14
|
-
const { className, defaultChecked, onChange, disabled, label, inputId = uuid(), onColor = FormOnColor.onwhite, name = inputId, size, errorText, errorTextId: errorTextIdProp, error = !!errorText, errorWrapperClassName, value = getLabelText(label), testId, required, labelClassNames, ref, ...rest } = props;
|
|
15
|
-
const invalid = error || onColor === FormOnColor.oninvalid;
|
|
16
|
-
const onDark = onColor === FormOnColor.ondark;
|
|
17
|
-
const onBlueberry = onColor === FormOnColor.onblueberry;
|
|
18
|
-
const onCherry = onColor === FormOnColor.oninvalid;
|
|
19
|
-
const isLarge = size === FormSize.large;
|
|
20
|
-
const [checked, changeChecked] = useState();
|
|
21
|
-
const { refObject, isFocused } = usePseudoClasses(isMutableRefObject(ref) ? ref : null);
|
|
22
|
-
const mergedRefs = mergeRefs([ref, refObject]);
|
|
23
|
-
const errorTextId = useIdWithFallback(errorTextIdProp);
|
|
24
|
-
const radioButtonWrapperClasses = classNames(radioButtonStyles["radio-button-wrapper"], {
|
|
25
|
-
[radioButtonStyles["radio-button-wrapper__large"]]: isLarge,
|
|
26
|
-
[radioButtonStyles["radio-button-wrapper__large--focused"]]: isLarge && isFocused,
|
|
27
|
-
[radioButtonStyles["radio-button-wrapper__large--selected"]]: isLarge && checked && isFocused,
|
|
28
|
-
[radioButtonStyles["radio-button-wrapper__large--invalid"]]: isLarge && onCherry && isFocused,
|
|
29
|
-
[radioButtonStyles["radio-button-wrapper__large--on-blueberry"]]: isLarge && onBlueberry && isFocused
|
|
30
|
-
});
|
|
31
|
-
const radioButtonLabelClasses = classNames(radioButtonStyles["radio-button-label"], {
|
|
32
|
-
[radioButtonStyles["radio-button-label--disabled"]]: disabled,
|
|
33
|
-
[radioButtonStyles["radio-button-label--on-dark"]]: onDark,
|
|
34
|
-
[radioButtonStyles["radio-button-label--invalid"]]: invalid,
|
|
35
|
-
[radioButtonStyles["radio-button-label__large"]]: isLarge,
|
|
36
|
-
[radioButtonStyles["radio-button-label__large--focused"]]: isFocused && isLarge,
|
|
37
|
-
[radioButtonStyles["radio-button-label__large--disabled"]]: isLarge && disabled
|
|
38
|
-
}, labelClassNames);
|
|
39
|
-
const radioButtonClasses = classNames(radioButtonStyles["radio-button"], {
|
|
40
|
-
[radioButtonStyles["radio-button--on-dark"]]: onDark,
|
|
41
|
-
[radioButtonStyles["radio-button--disabled"]]: disabled,
|
|
42
|
-
[radioButtonStyles["radio-button--on-blueberry"]]: onBlueberry,
|
|
43
|
-
[radioButtonStyles["radio-button--invalid"]]: invalid,
|
|
44
|
-
[radioButtonStyles["radio-button__large"]]: isLarge,
|
|
45
|
-
[radioButtonStyles["radio-button__large--disabled"]]: isLarge && disabled,
|
|
46
|
-
[radioButtonStyles["radio-button__large--invalid"]]: isLarge && invalid
|
|
47
|
-
}, className);
|
|
48
|
-
const change = (e) => {
|
|
49
|
-
changeChecked(e.target.checked);
|
|
50
|
-
if (onChange) onChange(e);
|
|
51
|
-
};
|
|
52
|
-
const getLabelContent = () => /* @__PURE__ */ jsx("input", {
|
|
53
|
-
...rest,
|
|
54
|
-
id: inputId,
|
|
55
|
-
name,
|
|
56
|
-
className: radioButtonClasses,
|
|
57
|
-
type: "radio",
|
|
58
|
-
disabled,
|
|
59
|
-
value,
|
|
60
|
-
ref: mergedRefs,
|
|
61
|
-
defaultChecked,
|
|
62
|
-
"aria-describedby": getAriaDescribedBy(props, errorTextId),
|
|
63
|
-
required,
|
|
64
|
-
onChange: (e) => change(e)
|
|
65
|
-
});
|
|
66
|
-
return /* @__PURE__ */ jsx(ErrorWrapper_default, {
|
|
67
|
-
className: errorWrapperClassName,
|
|
68
|
-
errorText,
|
|
69
|
-
errorTextId,
|
|
70
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
71
|
-
"data-testid": testId,
|
|
72
|
-
"data-analyticsid": AnalyticsId.RadioButton,
|
|
73
|
-
className: radioButtonWrapperClasses,
|
|
74
|
-
children: renderLabelAsParent({
|
|
75
|
-
label,
|
|
76
|
-
children: getLabelContent(),
|
|
77
|
-
inputId,
|
|
78
|
-
onColor,
|
|
79
|
-
labelClassName: radioButtonLabelClasses,
|
|
80
|
-
sublabelWrapperClassName: radioButtonStyles["radiobutton-sublabel-wrapper"],
|
|
81
|
-
large: isLarge,
|
|
82
|
-
afterLabelChildrenClassName: radioButtonStyles["radiobutton-afterlabelchildren-wrapper"]
|
|
83
|
-
})
|
|
84
|
-
})
|
|
85
|
-
});
|
|
1
|
+
let ViewBoxSize = /* @__PURE__ */ function(ViewBoxSize$1) {
|
|
2
|
+
ViewBoxSize$1["Medium"] = "0 0 512 512";
|
|
3
|
+
ViewBoxSize$1["Small"] = "0 0 200 200";
|
|
4
|
+
return ViewBoxSize$1;
|
|
5
|
+
}({});
|
|
6
|
+
const getIllustration = ({ size, large, medium, small }) => {
|
|
7
|
+
if (large && (size >= 512 || !medium && !small)) return large;
|
|
8
|
+
if (medium && (size >= 201 || !small)) return medium;
|
|
9
|
+
return small;
|
|
86
10
|
};
|
|
87
|
-
|
|
88
|
-
var RadioButton_default = RadioButton;
|
|
89
|
-
const getRadioLabelClasses = (radioId, onColor, large, checkedRadioId) => {
|
|
90
|
-
const onCherry = onColor === "oninvalid";
|
|
91
|
-
const checked = radioId === checkedRadioId;
|
|
92
|
-
return classNames({
|
|
93
|
-
[radioButtonStyles["radio-button-label__large--on-grey"]]: large && onColor === "ongrey" && !checked,
|
|
94
|
-
[radioButtonStyles["radio-button-label__large--on-blueberry"]]: onColor === "onblueberry" && !checked && large,
|
|
95
|
-
[radioButtonStyles["radio-button-label__large--selected"]]: large && checked && !onCherry,
|
|
96
|
-
[radioButtonStyles["radio-button-label__large--selected-invalid"]]: large && checked && onCherry
|
|
97
|
-
});
|
|
98
|
-
};
|
|
99
|
-
export { RadioButton as n, RadioButton_default as r, getRadioLabelClasses as t };
|
|
11
|
+
export { getIllustration as n, ViewBoxSize as t };
|
|
100
12
|
|
|
101
13
|
//# sourceMappingURL=utils3.js.map
|
package/lib/utils3.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils3.js","names":[
|
|
1
|
+
{"version":3,"file":"utils3.js","names":[],"sources":["../src/components/Illustration/utils.ts"],"sourcesContent":["export enum ViewBoxSize {\n Medium = '0 0 512 512',\n Small = '0 0 200 200',\n}\ninterface IllustrationConfig<T> {\n size: number;\n large?: T;\n medium?: T;\n small?: T;\n}\n\nexport const getIllustration = <T>({ size, large, medium, small }: IllustrationConfig<T>): T => {\n if (large && (size >= 512 || (!medium && !small))) {\n return large;\n }\n\n if (medium && (size >= 201 || !small)) {\n return medium;\n }\n\n return small as T;\n};\n"],"mappings":"AAAA,IAAY,cAAA,yBAAA,eAAL;AACL,eAAA,YAAA;AACA,eAAA,WAAA;;;AASF,MAAa,mBAAsB,EAAE,MAAM,OAAO,QAAQ,YAAsC;AAC9F,KAAI,UAAU,QAAQ,OAAQ,CAAC,UAAU,CAAC,OACxC,QAAO;AAGT,KAAI,WAAW,QAAQ,OAAO,CAAC,OAC7B,QAAO;AAGT,QAAO"}
|
package/lib/utils4.js
CHANGED
|
@@ -1,13 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { createContext } from "react";
|
|
2
|
+
let PanelLayout = /* @__PURE__ */ function(PanelLayout$1) {
|
|
3
|
+
PanelLayout$1["vertical"] = "vertical";
|
|
4
|
+
PanelLayout$1["horizontal"] = "horizontal";
|
|
5
|
+
PanelLayout$1["combined"] = "combined";
|
|
6
|
+
PanelLayout$1["bAsRightCol"] = "bAsRightCol";
|
|
7
|
+
return PanelLayout$1;
|
|
8
|
+
}({});
|
|
9
|
+
let PanelVariant = /* @__PURE__ */ function(PanelVariant$1) {
|
|
10
|
+
PanelVariant$1["fill"] = "fill";
|
|
11
|
+
PanelVariant$1["line"] = "line";
|
|
12
|
+
PanelVariant$1["outline"] = "outline";
|
|
13
|
+
return PanelVariant$1;
|
|
14
|
+
}({});
|
|
15
|
+
let PanelStacking = /* @__PURE__ */ function(PanelStacking$1) {
|
|
16
|
+
PanelStacking$1["default"] = "default";
|
|
17
|
+
PanelStacking$1["bFirst"] = "bFirst";
|
|
18
|
+
return PanelStacking$1;
|
|
19
|
+
}({});
|
|
20
|
+
let PanelStatus = /* @__PURE__ */ function(PanelStatus$1) {
|
|
21
|
+
PanelStatus$1["none"] = "none";
|
|
22
|
+
PanelStatus$1["new"] = "new";
|
|
23
|
+
PanelStatus$1["error"] = "error";
|
|
24
|
+
PanelStatus$1["draft"] = "draft";
|
|
25
|
+
return PanelStatus$1;
|
|
26
|
+
}({});
|
|
27
|
+
const PanelListContext = createContext(null);
|
|
28
|
+
export { PanelVariant as a, PanelStatus as i, PanelLayout as n, PanelStacking as r, PanelListContext as t };
|
|
12
29
|
|
|
13
30
|
//# sourceMappingURL=utils4.js.map
|
package/lib/utils4.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils4.js","names":[],"sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"utils4.js","names":[],"sources":["../src/components/Panel/constants.ts","../src/components/PanelList/utils.tsx"],"sourcesContent":["export enum PanelLayout {\n vertical = 'vertical',\n horizontal = 'horizontal',\n combined = 'combined',\n bAsRightCol = 'bAsRightCol',\n}\n\nexport enum PanelVariant {\n fill = 'fill',\n line = 'line',\n outline = 'outline',\n}\n\nexport enum PanelStacking {\n default = 'default',\n bFirst = 'bFirst',\n}\n\nexport enum PanelStatus {\n none = 'none',\n new = 'new',\n error = 'error',\n draft = 'draft',\n}\n","import { createContext } from 'react';\n\nimport type { PanelVariant } from '../Panel/constants';\n\nexport interface PanelListContextValue {\n variant: PanelVariant;\n highlightText?: string;\n applyPanelClassName: (existingClassName?: string) => string;\n}\n\nexport const PanelListContext = createContext<PanelListContextValue | null>(null);\n"],"mappings":";AAAA,IAAY,cAAA,yBAAA,eAAL;AACL,eAAA,cAAA;AACA,eAAA,gBAAA;AACA,eAAA,cAAA;AACA,eAAA,iBAAA;;;AAGF,IAAY,eAAA,yBAAA,gBAAL;AACL,gBAAA,UAAA;AACA,gBAAA,UAAA;AACA,gBAAA,aAAA;;;AAGF,IAAY,gBAAA,yBAAA,iBAAL;AACL,iBAAA,aAAA;AACA,iBAAA,YAAA;;;AAGF,IAAY,cAAA,yBAAA,eAAL;AACL,eAAA,UAAA;AACA,eAAA,SAAA;AACA,eAAA,WAAA;AACA,eAAA,WAAA;;;ACZF,MAAa,mBAAmB,cAA4C,KAAK"}
|
package/lib/utils5.js
CHANGED
|
@@ -1,30 +1,60 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
import { t as Breakpoint } from "./useBreakpoint.js";
|
|
2
|
+
import { r as ResponsiveTableVariant } from "./constants3.js";
|
|
3
|
+
import { t as isTouchDevice } from "./device.js";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import tableStyles from "./components/Table/styles.module.scss";
|
|
6
|
+
var configUsesCss = (config) => config.variant === ResponsiveTableVariant.centeredoverflow || config.variant === ResponsiveTableVariant.block;
|
|
7
|
+
var mapConfigToClass = (config) => config.variant === "centeredoverflow" || config.variant === "block" ? tableStyles[`table--${config.variant}-${config.breakpoint}`] : "";
|
|
8
|
+
var sortByBreakpointsDescending = (a, b) => Breakpoint[a.breakpoint] - Breakpoint[b.breakpoint];
|
|
9
|
+
var isValidForCurrentBreakpoint = (config, breakpoint) => Breakpoint[config.breakpoint] >= breakpoint;
|
|
10
|
+
var getConfigForBreakpoint = (config, breakpoint) => {
|
|
11
|
+
if (Array.isArray(config)) {
|
|
12
|
+
config.sort(sortByBreakpointsDescending);
|
|
13
|
+
return config.find((x) => isValidForCurrentBreakpoint(x, breakpoint));
|
|
14
|
+
} else if (config && isValidForCurrentBreakpoint(config, breakpoint)) return config;
|
|
15
|
+
};
|
|
16
|
+
const getCurrentConfig = (config, breakpoint, tableWidth, windowWidth) => {
|
|
17
|
+
const breakpointConfig = getConfigForBreakpoint(config, breakpoint);
|
|
18
|
+
const canUseHorizontalScroll = isTouchDevice();
|
|
19
|
+
const canUseCenteredOverflow = tableWidth <= windowWidth;
|
|
20
|
+
if (!breakpointConfig) return;
|
|
21
|
+
if (breakpointConfig.variant === ResponsiveTableVariant.centeredoverflow && !canUseCenteredOverflow && breakpointConfig.fallbackVariant === ResponsiveTableVariant.horizontalscroll) return {
|
|
22
|
+
variant: canUseHorizontalScroll ? ResponsiveTableVariant.horizontalscroll : ResponsiveTableVariant.none,
|
|
23
|
+
breakpoint: breakpointConfig.breakpoint
|
|
24
|
+
};
|
|
25
|
+
if (breakpointConfig.variant === ResponsiveTableVariant.centeredoverflow && !canUseCenteredOverflow && breakpointConfig.fallbackVariant !== ResponsiveTableVariant.centeredoverflow) return {
|
|
26
|
+
variant: breakpointConfig.fallbackVariant ?? ResponsiveTableVariant.none,
|
|
27
|
+
breakpoint: breakpointConfig.breakpoint
|
|
28
|
+
};
|
|
29
|
+
if (breakpointConfig.variant === ResponsiveTableVariant.horizontalscroll && !canUseHorizontalScroll && breakpointConfig.fallbackVariant === ResponsiveTableVariant.centeredoverflow) return {
|
|
30
|
+
variant: canUseCenteredOverflow ? ResponsiveTableVariant.centeredoverflow : ResponsiveTableVariant.none,
|
|
31
|
+
breakpoint: breakpointConfig.breakpoint
|
|
32
|
+
};
|
|
33
|
+
if (breakpointConfig.variant === ResponsiveTableVariant.horizontalscroll && !canUseHorizontalScroll && breakpointConfig.fallbackVariant !== ResponsiveTableVariant.horizontalscroll) return {
|
|
34
|
+
variant: breakpointConfig.fallbackVariant ?? ResponsiveTableVariant.none,
|
|
35
|
+
breakpoint: breakpointConfig.breakpoint
|
|
36
|
+
};
|
|
37
|
+
return breakpointConfig;
|
|
38
|
+
};
|
|
39
|
+
const getBreakpointClass = (config) => config && configUsesCss(config) ? mapConfigToClass(config) : void 0;
|
|
40
|
+
const getCenteredOverflowTableStyle = (parentWidth, tableWidth) => {
|
|
41
|
+
if (parentWidth >= tableWidth) return;
|
|
42
|
+
return { left: `${(parentWidth - tableWidth) / 2 - 8}px` };
|
|
43
|
+
};
|
|
44
|
+
const mapChildrenWithMode = (children, mode) => React.Children.map(children, (child) => {
|
|
45
|
+
if (!React.isValidElement(child)) return child;
|
|
46
|
+
if (child.type === React.Fragment) {
|
|
47
|
+
const fragmentChildren = child.props.children;
|
|
48
|
+
const mapped = React.Children.map(fragmentChildren, (gc) => React.isValidElement(gc) ? React.cloneElement(gc, { mode }) : gc);
|
|
49
|
+
return React.cloneElement(child, void 0, mapped);
|
|
50
|
+
}
|
|
51
|
+
return React.cloneElement(child, { mode });
|
|
52
|
+
});
|
|
53
|
+
const omitProps = (obj, keys) => {
|
|
54
|
+
const clone = { ...obj };
|
|
55
|
+
for (const k of keys) delete clone[k];
|
|
56
|
+
return clone;
|
|
57
|
+
};
|
|
58
|
+
export { omitProps as a, mapChildrenWithMode as i, getCenteredOverflowTableStyle as n, getCurrentConfig as r, getBreakpointClass as t };
|
|
29
59
|
|
|
30
60
|
//# sourceMappingURL=utils5.js.map
|