@bbl-digital/snorre 4.0.21 → 4.0.23
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/dist/bundle.js +117 -31
- package/esm/core/BoxedTable/TableBody/index.js +10 -0
- package/esm/core/BoxedTable/TableBody/styles.js +16 -0
- package/esm/core/Button/Button.stories.js +51 -49
- package/esm/core/Card/index.js +4 -3
- package/esm/core/Checkbox/index.js +32 -9
- package/esm/core/CollapseList/Item.js +4 -3
- package/esm/core/CollapseList/index.js +4 -3
- package/esm/core/Datepicker/Datepicker.stories.js +7 -6
- package/esm/core/DatepickerRange/DatepickerRange.stories.js +4 -3
- package/esm/core/Dropdown/index.js +0 -1
- package/esm/core/DropdownMenu/DropdownMenu.stories.js +34 -26
- package/esm/core/DropdownMenu/DropdownMenuOption.js +2 -0
- package/esm/core/DropdownMenu/index.js +16 -0
- package/esm/core/Editor/Editor.stories.js +31 -30
- package/esm/core/FileInput/index.js +7 -1
- package/esm/core/GoogleButton/GoogleButton.stories.js +4 -4
- package/esm/core/Header/Header.stories.js +42 -45
- package/esm/core/HighlightText/HighlightText.stories.js +11 -11
- package/esm/core/Image/index.js +19 -4
- package/esm/core/ImagePicker/ImagePicker.stories.js +2 -1
- package/esm/core/ImagePicker/index.js +4 -0
- package/esm/core/ImageViewer/index.js +15 -5
- package/esm/core/InfoButton/InfoButton.stories.js +23 -22
- package/esm/core/InfoButton/index.js +4 -0
- package/esm/core/Input/index.js +4 -0
- package/esm/core/private/ButtonOrLink.js +4 -3
- package/lib/core/Autocomplete/styles.d.ts +39 -1
- package/lib/core/Autocomplete/styles.d.ts.map +1 -1
- package/lib/core/Box/styles.d.ts +39 -1
- package/lib/core/Box/styles.d.ts.map +1 -1
- package/lib/core/BoxedTable/TableBody/index.d.ts +7 -0
- package/lib/core/BoxedTable/TableBody/index.d.ts.map +1 -0
- package/lib/core/BoxedTable/TableBody/index.js +10 -0
- package/lib/core/BoxedTable/TableBody/styles.d.ts +6 -0
- package/lib/core/BoxedTable/TableBody/styles.d.ts.map +1 -0
- package/lib/core/BoxedTable/TableBody/styles.js +16 -0
- package/lib/core/Button/Button.stories.d.ts +20 -63
- package/lib/core/Button/Button.stories.d.ts.map +1 -1
- package/lib/core/Button/Button.stories.js +51 -49
- package/lib/core/Button/index.d.ts +54 -3
- package/lib/core/Button/index.d.ts.map +1 -1
- package/lib/core/Card/index.d.ts +14 -15
- package/lib/core/Card/index.d.ts.map +1 -1
- package/lib/core/Card/index.js +4 -3
- package/lib/core/Checkbox/index.d.ts +3 -3
- package/lib/core/Checkbox/index.d.ts.map +1 -1
- package/lib/core/Checkbox/index.js +32 -9
- package/lib/core/CollapseList/Item.d.ts +1 -1
- package/lib/core/CollapseList/Item.d.ts.map +1 -1
- package/lib/core/CollapseList/Item.js +4 -3
- package/lib/core/CollapseList/index.d.ts +1 -1
- package/lib/core/CollapseList/index.d.ts.map +1 -1
- package/lib/core/CollapseList/index.js +4 -3
- package/lib/core/CollapseList/styles.d.ts +39 -1
- package/lib/core/CollapseList/styles.d.ts.map +1 -1
- package/lib/core/Datepicker/Datepicker.stories.d.ts +6 -6
- package/lib/core/Datepicker/Datepicker.stories.d.ts.map +1 -1
- package/lib/core/Datepicker/Datepicker.stories.js +7 -6
- package/lib/core/DatepickerRange/DatepickerRange.stories.d.ts +6 -7
- package/lib/core/DatepickerRange/DatepickerRange.stories.d.ts.map +1 -1
- package/lib/core/DatepickerRange/DatepickerRange.stories.js +4 -3
- package/lib/core/Dropdown/index.d.ts.map +1 -1
- package/lib/core/Dropdown/index.js +0 -1
- package/lib/core/DropdownMenu/DropdownMenu.stories.d.ts +8 -15
- package/lib/core/DropdownMenu/DropdownMenu.stories.d.ts.map +1 -1
- package/lib/core/DropdownMenu/DropdownMenu.stories.js +34 -26
- package/lib/core/DropdownMenu/DropdownMenuOption.d.ts.map +1 -1
- package/lib/core/DropdownMenu/DropdownMenuOption.js +2 -0
- package/lib/core/DropdownMenu/index.d.ts.map +1 -1
- package/lib/core/DropdownMenu/index.js +16 -0
- package/lib/core/Editor/Editor.stories.d.ts +10 -23
- package/lib/core/Editor/Editor.stories.d.ts.map +1 -1
- package/lib/core/Editor/Editor.stories.js +31 -30
- package/lib/core/FileInput/index.d.ts +3 -1
- package/lib/core/FileInput/index.d.ts.map +1 -1
- package/lib/core/FileInput/index.js +7 -1
- package/lib/core/FileInput/styles.d.ts +39 -1
- package/lib/core/FileInput/styles.d.ts.map +1 -1
- package/lib/core/GoogleButton/GoogleButton.stories.d.ts +6 -7
- package/lib/core/GoogleButton/GoogleButton.stories.d.ts.map +1 -1
- package/lib/core/GoogleButton/GoogleButton.stories.js +4 -4
- package/lib/core/Header/Header.stories.d.ts +13 -35
- package/lib/core/Header/Header.stories.d.ts.map +1 -1
- package/lib/core/Header/Header.stories.js +42 -45
- package/lib/core/HighlightText/HighlightText.stories.d.ts +7 -11
- package/lib/core/HighlightText/HighlightText.stories.d.ts.map +1 -1
- package/lib/core/HighlightText/HighlightText.stories.js +11 -11
- package/lib/core/Image/index.d.ts +1 -0
- package/lib/core/Image/index.d.ts.map +1 -1
- package/lib/core/Image/index.js +19 -4
- package/lib/core/ImagePicker/ImagePicker.stories.d.ts +6 -17
- package/lib/core/ImagePicker/ImagePicker.stories.d.ts.map +1 -1
- package/lib/core/ImagePicker/ImagePicker.stories.js +2 -1
- package/lib/core/ImagePicker/index.d.ts.map +1 -1
- package/lib/core/ImagePicker/index.js +4 -0
- package/lib/core/ImageViewer/index.d.ts.map +1 -1
- package/lib/core/ImageViewer/index.js +15 -5
- package/lib/core/InfoButton/InfoButton.stories.d.ts +10 -23
- package/lib/core/InfoButton/InfoButton.stories.d.ts.map +1 -1
- package/lib/core/InfoButton/InfoButton.stories.js +23 -22
- package/lib/core/InfoButton/index.d.ts.map +1 -1
- package/lib/core/InfoButton/index.js +4 -0
- package/lib/core/InfoButton/styles.d.ts +39 -1
- package/lib/core/InfoButton/styles.d.ts.map +1 -1
- package/lib/core/Input/index.d.ts +1 -1
- package/lib/core/Input/index.d.ts.map +1 -1
- package/lib/core/Input/index.js +4 -0
- package/lib/core/private/ButtonOrLink.d.ts +46 -3
- package/lib/core/private/ButtonOrLink.d.ts.map +1 -1
- package/lib/core/private/ButtonOrLink.js +4 -3
- package/lib/layout/Footer/FooterButton/styles.d.ts +3 -3
- package/lib/layout/Footer/FooterLink/styles.d.ts +3 -3
- package/lib/layout/Menu/MenuTop/styles.d.ts +3 -3
- package/package.json +1 -1
- package/esm/core/Autocomplete/utils/useHandleOptionsHeight.js +0 -16
- package/esm/core/CheckboxController/index.js +0 -22
- package/esm/core/Datepicker/yearMonthForm.js +0 -56
- package/esm/core/EditorOld/config.js +0 -69
- package/esm/core/EditorOld/index.js +0 -147
- package/esm/core/EditorOld/styles.js +0 -65
- package/esm/core/ImageCarousel/index.js +0 -70
- package/esm/core/ImageCarousel/styles.js +0 -58
- package/esm/enums/ModifierKey.js +0 -13
- package/lib/core/Autocomplete/utils/useHandleOptionsHeight.d.ts +0 -7
- package/lib/core/Autocomplete/utils/useHandleOptionsHeight.d.ts.map +0 -1
- package/lib/core/Autocomplete/utils/useHandleOptionsHeight.js +0 -16
- package/lib/core/CheckboxController/index.d.ts +0 -1
- package/lib/core/CheckboxController/index.d.ts.map +0 -1
- package/lib/core/CheckboxController/index.js +0 -22
- package/lib/core/Datepicker/yearMonthForm.d.ts +0 -10
- package/lib/core/Datepicker/yearMonthForm.d.ts.map +0 -1
- package/lib/core/Datepicker/yearMonthForm.js +0 -56
- package/lib/core/EditorOld/config.d.ts +0 -56
- package/lib/core/EditorOld/config.d.ts.map +0 -1
- package/lib/core/EditorOld/config.js +0 -69
- package/lib/core/EditorOld/index.d.ts +0 -39
- package/lib/core/EditorOld/index.d.ts.map +0 -1
- package/lib/core/EditorOld/index.js +0 -147
- package/lib/core/EditorOld/styles.d.ts +0 -23
- package/lib/core/EditorOld/styles.d.ts.map +0 -1
- package/lib/core/EditorOld/styles.js +0 -65
- package/lib/core/ImageCarousel/index.d.ts +0 -11
- package/lib/core/ImageCarousel/index.d.ts.map +0 -1
- package/lib/core/ImageCarousel/index.js +0 -70
- package/lib/core/ImageCarousel/styles.d.ts +0 -26
- package/lib/core/ImageCarousel/styles.d.ts.map +0 -1
- package/lib/core/ImageCarousel/styles.js +0 -58
- package/lib/enums/ModifierKey.d.ts +0 -12
- package/lib/enums/ModifierKey.d.ts.map +0 -1
- package/lib/enums/ModifierKey.js +0 -13
package/dist/bundle.js
CHANGED
|
@@ -138,7 +138,6 @@
|
|
|
138
138
|
beforeIcon,
|
|
139
139
|
children,
|
|
140
140
|
disabled = false,
|
|
141
|
-
flexAlign,
|
|
142
141
|
href = '',
|
|
143
142
|
loading = false,
|
|
144
143
|
openInNewWindow = false,
|
|
@@ -153,6 +152,7 @@
|
|
|
153
152
|
onMouseUp,
|
|
154
153
|
onEnterKeyPress,
|
|
155
154
|
onEscapeKeyPress,
|
|
155
|
+
onCustomKeyPress,
|
|
156
156
|
onKeyPress,
|
|
157
157
|
...restProps
|
|
158
158
|
}, ref) => {
|
|
@@ -175,10 +175,11 @@
|
|
|
175
175
|
const handleKeyPress = event => {
|
|
176
176
|
if (onEnterKeyPress && event.key === 'Enter') onEnterKeyPress(event);
|
|
177
177
|
if (onEscapeKeyPress && event.key === 'Escape') onEscapeKeyPress(event);
|
|
178
|
-
if (
|
|
178
|
+
if (onCustomKeyPress && event.key === onCustomKeyPress.key) onCustomKeyPress.action(event);
|
|
179
|
+
if (onKeyPress) onKeyPress(event);
|
|
179
180
|
};
|
|
180
181
|
React.useEffect(() => {
|
|
181
|
-
const hasKeyPressEvents = onEnterKeyPress || onEscapeKeyPress || onKeyPress;
|
|
182
|
+
const hasKeyPressEvents = onEnterKeyPress || onEscapeKeyPress || onKeyPress || onCustomKeyPress;
|
|
182
183
|
if (!hasKeyPressEvents) return;
|
|
183
184
|
window.addEventListener('keyup', handleKeyPress);
|
|
184
185
|
return () => {
|
|
@@ -601,10 +602,10 @@
|
|
|
601
602
|
}({});
|
|
602
603
|
|
|
603
604
|
/** @jsxImportSource @emotion/react */
|
|
604
|
-
const Card = ({
|
|
605
|
+
const Card = /*#__PURE__*/React__default["default"].forwardRef(({
|
|
605
606
|
className,
|
|
606
607
|
...props
|
|
607
|
-
}) => {
|
|
608
|
+
}, ref) => {
|
|
608
609
|
const handleOnKeyPress = e => {
|
|
609
610
|
if (e.key === Key.enter || e.key === Key.space) {
|
|
610
611
|
if (props.onClick) {
|
|
@@ -613,6 +614,7 @@
|
|
|
613
614
|
}
|
|
614
615
|
};
|
|
615
616
|
return jsxRuntime.jsx("div", {
|
|
617
|
+
ref: ref,
|
|
616
618
|
css: theme => [styles$y.default(theme), props.shadow && styles$y.shadow(theme), props.withhover && styles$y.withHover(theme), props.primary && styles$y.primary(theme), props.gray && styles$y.gray, props.noPadding && styles$y.noPadding, props.height && styles$y.height(props.height), props.nobackground && styles$y.nobackground, props.largePadding && styles$y.largePadding, props.overflowvisible && styles$y.overflowvisible, props.css && props.css],
|
|
617
619
|
tabIndex: props.onClick ? 0 : undefined,
|
|
618
620
|
onClick: props.onClick,
|
|
@@ -621,7 +623,7 @@
|
|
|
621
623
|
...props,
|
|
622
624
|
children: props.children
|
|
623
625
|
});
|
|
624
|
-
};
|
|
626
|
+
});
|
|
625
627
|
|
|
626
628
|
function _EMOTION_STRINGIFIED_CSS_ERROR__$1b() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
627
629
|
const styles$x = {
|
|
@@ -753,7 +755,6 @@
|
|
|
753
755
|
onClick: onClick,
|
|
754
756
|
css: css,
|
|
755
757
|
className: className,
|
|
756
|
-
...restProps,
|
|
757
758
|
children: label ? label : '- Velg'
|
|
758
759
|
}), open && jsxRuntime.jsx("div", {
|
|
759
760
|
css: theme => styles$w.default(theme),
|
|
@@ -1266,6 +1267,7 @@
|
|
|
1266
1267
|
}, [showTooltip, ref]);
|
|
1267
1268
|
return jsxRuntime.jsxs(Wrapper$E, {
|
|
1268
1269
|
ref: ref,
|
|
1270
|
+
className: className,
|
|
1269
1271
|
children: [jsxRuntime.jsx(StyledButton, {
|
|
1270
1272
|
"aria-label": ariaLabel,
|
|
1271
1273
|
trackingName: trackingName,
|
|
@@ -1278,6 +1280,9 @@
|
|
|
1278
1280
|
timeout: 80,
|
|
1279
1281
|
classNames: "tooltip",
|
|
1280
1282
|
children: jsxRuntime.jsx(Tooltip$1, {
|
|
1283
|
+
role: "tooltip",
|
|
1284
|
+
id: "info-tooltip",
|
|
1285
|
+
"aria-hidden": !showTooltip,
|
|
1281
1286
|
css: () => [styles$t.default, place === 'top' && styles$t.top, place === 'right' && styles$t.right, place === 'bottom' && styles$t.bottom, place === 'left' && styles$t.left, width && styles$t.width(width, place)],
|
|
1282
1287
|
children: jsxRuntime.jsx(Text, {
|
|
1283
1288
|
children: children ? children : ''
|
|
@@ -1351,12 +1356,14 @@
|
|
|
1351
1356
|
return jsxRuntime.jsxs("div", {
|
|
1352
1357
|
css: styles$u.relative,
|
|
1353
1358
|
children: [jsxRuntime.jsxs("label", {
|
|
1359
|
+
htmlFor: props.id,
|
|
1354
1360
|
css: theme => [styles$u.default(theme), props.highlight && styles$u.highligted(height), type === 'search' && styles$u.searchLabel(theme), (props.invalid || props.invalidMessage) && styles$u.invalid(theme), height && styles$u.height(height)],
|
|
1355
1361
|
className: className,
|
|
1356
1362
|
children: [props.label && jsxRuntime.jsx("span", {
|
|
1357
1363
|
css: info && styles$u.pr4,
|
|
1358
1364
|
children: props.label
|
|
1359
1365
|
}), jsxRuntime.jsx("input", {
|
|
1366
|
+
id: props.id,
|
|
1360
1367
|
type: type,
|
|
1361
1368
|
...(type !== 'password' && {
|
|
1362
1369
|
value
|
|
@@ -1370,6 +1377,7 @@
|
|
|
1370
1377
|
maxLength: maxlength,
|
|
1371
1378
|
ref: ref,
|
|
1372
1379
|
name: props.name,
|
|
1380
|
+
"aria-describedby": props.invalidMessage ? 'input-error-message' : undefined,
|
|
1373
1381
|
css: theme => [type === 'text' && styles$u.text(theme), type === 'search' && styles$u.search(theme), type === 'password' && styles$u.password(theme), type === 'number' && styles$u.number(theme), props.disabled && styles$u.disabled(theme), cardInput && styles$u.cardInput(theme)],
|
|
1374
1382
|
children: React__default["default"].Children.map(props.children, child => {
|
|
1375
1383
|
if (!child) {
|
|
@@ -1380,6 +1388,7 @@
|
|
|
1380
1388
|
}), type === 'search' && jsxRuntime.jsx(IconSearch$1, {}), props.invalidMessage && jsxRuntime.jsx(IconErrorOutline$1, {
|
|
1381
1389
|
size: "16px"
|
|
1382
1390
|
}), props.invalidMessage && jsxRuntime.jsx("span", {
|
|
1391
|
+
id: "input-error-message",
|
|
1383
1392
|
css: theme => [styles$u.errorMessage(theme), !props?.label && styles$u.errorMessageNoLabel],
|
|
1384
1393
|
children: props.invalidMessage
|
|
1385
1394
|
})]
|
|
@@ -1436,16 +1445,31 @@
|
|
|
1436
1445
|
radius,
|
|
1437
1446
|
withPlaceholder,
|
|
1438
1447
|
fallbackUrl,
|
|
1448
|
+
interactive,
|
|
1439
1449
|
...restProps
|
|
1440
1450
|
}) => {
|
|
1441
1451
|
const [imageLoaded, setImageLoaded] = React.useState(false);
|
|
1442
1452
|
const [imageSrc, setImageSrc] = React.useState(src || blob && convertBlobToObjectUrl(blob) || undefined);
|
|
1453
|
+
const altText = React.useMemo(() => {
|
|
1454
|
+
if (!imageLoaded && withPlaceholder) return 'Laster bilde...';
|
|
1455
|
+
if (!imageSrc) return 'Bilde ikke tilgjengelig';
|
|
1456
|
+
return alt;
|
|
1457
|
+
}, [imageLoaded, imageSrc, alt]);
|
|
1458
|
+
const handleLoad = () => {
|
|
1459
|
+
setImageLoaded(true);
|
|
1460
|
+
};
|
|
1461
|
+
const handleError = () => {
|
|
1462
|
+
setImageSrc(fallbackUrl);
|
|
1463
|
+
setImageLoaded(false);
|
|
1464
|
+
};
|
|
1443
1465
|
return jsxRuntime.jsx("img", {
|
|
1444
1466
|
src: imageSrc,
|
|
1445
|
-
alt:
|
|
1446
|
-
onLoad: withPlaceholder ? () =>
|
|
1447
|
-
onError: fallbackUrl ? () =>
|
|
1467
|
+
alt: altText,
|
|
1468
|
+
onLoad: withPlaceholder ? () => handleLoad() : undefined,
|
|
1469
|
+
onError: fallbackUrl ? () => handleError() : undefined,
|
|
1448
1470
|
css: theme => [height && styles$r.height(height), width && styles$r.width(width), responsive && styles$r.responsive, objectFit && styles$r.objectFit(objectFit), withPlaceholder && !imageLoaded && styles$r.placeholder(theme), radius && styles$r.radius(radius), css && css],
|
|
1471
|
+
tabIndex: interactive ? 0 : undefined,
|
|
1472
|
+
role: interactive ? 'button' : undefined,
|
|
1449
1473
|
...restProps
|
|
1450
1474
|
});
|
|
1451
1475
|
};
|
|
@@ -2152,8 +2176,25 @@
|
|
|
2152
2176
|
};
|
|
2153
2177
|
|
|
2154
2178
|
/** @jsxImportSource @emotion/react */
|
|
2155
|
-
const Checkbox =
|
|
2179
|
+
const Checkbox = /*#__PURE__*/React__default["default"].forwardRef(({
|
|
2180
|
+
...props
|
|
2181
|
+
}, ref) => {
|
|
2156
2182
|
const [value, setValue] = React.useState(props.checked ? true : false);
|
|
2183
|
+
const {
|
|
2184
|
+
checked,
|
|
2185
|
+
disabled,
|
|
2186
|
+
className,
|
|
2187
|
+
disabledHoverState,
|
|
2188
|
+
nomargin,
|
|
2189
|
+
child,
|
|
2190
|
+
type,
|
|
2191
|
+
name,
|
|
2192
|
+
onChange,
|
|
2193
|
+
onClick,
|
|
2194
|
+
id,
|
|
2195
|
+
children,
|
|
2196
|
+
...restProps
|
|
2197
|
+
} = props;
|
|
2157
2198
|
React.useEffect(() => {
|
|
2158
2199
|
setValue(props.checked ? true : false);
|
|
2159
2200
|
}, [props.checked]);
|
|
@@ -2164,20 +2205,26 @@
|
|
|
2164
2205
|
};
|
|
2165
2206
|
return jsxRuntime.jsxs("label", {
|
|
2166
2207
|
"aria-label": props['aria-label'],
|
|
2167
|
-
|
|
2168
|
-
|
|
2208
|
+
htmlFor: id,
|
|
2209
|
+
className: className,
|
|
2210
|
+
css: theme => [styles$n.default(theme), disabled && styles$n.disabled(theme, disabledHoverState), nomargin && styles$n.nomargin, child && styles$n.child, type === 'subtle' && styles$n.subtle(theme)],
|
|
2169
2211
|
onClick: e => e.stopPropagation(),
|
|
2170
2212
|
children: [jsxRuntime.jsx("input", {
|
|
2213
|
+
ref: ref,
|
|
2171
2214
|
type: "checkbox",
|
|
2215
|
+
role: "checkbox",
|
|
2216
|
+
"aria-checked": value,
|
|
2172
2217
|
checked: value,
|
|
2173
2218
|
value: props.value,
|
|
2174
|
-
name:
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2219
|
+
name: name,
|
|
2220
|
+
id: id,
|
|
2221
|
+
disabled: disabled,
|
|
2222
|
+
onClick: onClick,
|
|
2223
|
+
onChange: handleChange,
|
|
2224
|
+
...restProps
|
|
2225
|
+
}), jsxRuntime.jsx("span", {}), children]
|
|
2179
2226
|
});
|
|
2180
|
-
};
|
|
2227
|
+
});
|
|
2181
2228
|
|
|
2182
2229
|
function _EMOTION_STRINGIFIED_CSS_ERROR__$X() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
2183
2230
|
const styles$m = {
|
|
@@ -26932,6 +26979,7 @@
|
|
|
26932
26979
|
rotateIcon,
|
|
26933
26980
|
isControlledState,
|
|
26934
26981
|
controlledFiles,
|
|
26982
|
+
id = 'file-input',
|
|
26935
26983
|
onChange
|
|
26936
26984
|
}) => {
|
|
26937
26985
|
const [uncontrolledFiles, setUncontrolledFiles] = React.useState(initialFiles);
|
|
@@ -26940,6 +26988,7 @@
|
|
|
26940
26988
|
const files = isControlledState ? controlledFiles || [] : uncontrolledFiles;
|
|
26941
26989
|
const hiddenFileInput = React.useRef(null);
|
|
26942
26990
|
const handleClick = () => {
|
|
26991
|
+
if (!hiddenFileInput.current) return;
|
|
26943
26992
|
const node = hiddenFileInput.current;
|
|
26944
26993
|
node.click();
|
|
26945
26994
|
};
|
|
@@ -26986,6 +27035,7 @@
|
|
|
26986
27035
|
};
|
|
26987
27036
|
return /*#__PURE__*/jsxRuntime$1.jsxs(Wrapper$u, {
|
|
26988
27037
|
children: [label && /*#__PURE__*/jsxRuntime$1.jsx(Label$5, {
|
|
27038
|
+
id: id,
|
|
26989
27039
|
children: label
|
|
26990
27040
|
}), /*#__PURE__*/jsxRuntime$1.jsxs(FileWrapper, {
|
|
26991
27041
|
children: [files.length > 0 && !hideFileList && /*#__PURE__*/jsxRuntime$1.jsx(DocumentList, {
|
|
@@ -27012,6 +27062,7 @@
|
|
|
27012
27062
|
width: width,
|
|
27013
27063
|
type: "button",
|
|
27014
27064
|
nostyle: nostyle,
|
|
27065
|
+
"aria-labelledby": "fileInputLabel",
|
|
27015
27066
|
children: !nostyle ? /*#__PURE__*/jsxRuntime$1.jsxs(ButtonContent, {
|
|
27016
27067
|
children: [text, /*#__PURE__*/jsxRuntime$1.jsx(Icon, {
|
|
27017
27068
|
rotated: rotateIcon ? 1 : 0,
|
|
@@ -27026,7 +27077,8 @@
|
|
|
27026
27077
|
onChange: handleChange,
|
|
27027
27078
|
multiple: multiple,
|
|
27028
27079
|
accept: accept,
|
|
27029
|
-
ref: hiddenFileInput
|
|
27080
|
+
ref: hiddenFileInput,
|
|
27081
|
+
"aria-hidden": "true"
|
|
27030
27082
|
})]
|
|
27031
27083
|
})]
|
|
27032
27084
|
}), invalidMessage && /*#__PURE__*/jsxRuntime$1.jsx(ErrorMessage$5, {
|
|
@@ -27034,6 +27086,7 @@
|
|
|
27034
27086
|
}), sizeError && /*#__PURE__*/jsxRuntime$1.jsxs(Alert, {
|
|
27035
27087
|
danger: true,
|
|
27036
27088
|
onClose: () => setSizeError(false),
|
|
27089
|
+
"aria-live": "assertive",
|
|
27037
27090
|
children: ["Fil kan ikke overstige ", formatBytes(fileMaxsixe)]
|
|
27038
27091
|
})]
|
|
27039
27092
|
});
|
|
@@ -29740,24 +29793,25 @@
|
|
|
29740
29793
|
};
|
|
29741
29794
|
|
|
29742
29795
|
/** @jsxImportSource @emotion/react */
|
|
29743
|
-
const CollapseList = ({
|
|
29796
|
+
const CollapseList = /*#__PURE__*/React__default["default"].forwardRef(({
|
|
29744
29797
|
children,
|
|
29745
29798
|
...restProps
|
|
29746
|
-
}) => {
|
|
29799
|
+
}, ref) => {
|
|
29747
29800
|
return jsxRuntime.jsx("div", {
|
|
29801
|
+
ref: ref,
|
|
29748
29802
|
css: theme => [styles$b.default(theme)],
|
|
29749
29803
|
...restProps,
|
|
29750
29804
|
children: children
|
|
29751
29805
|
});
|
|
29752
|
-
};
|
|
29806
|
+
});
|
|
29753
29807
|
|
|
29754
29808
|
const headerTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'Header'];
|
|
29755
|
-
const CollapseListItem = ({
|
|
29809
|
+
const CollapseListItem = /*#__PURE__*/React__default["default"].forwardRef(({
|
|
29756
29810
|
header,
|
|
29757
29811
|
content,
|
|
29758
29812
|
initialOpen,
|
|
29759
29813
|
...restProps
|
|
29760
|
-
}) => {
|
|
29814
|
+
}, ref) => {
|
|
29761
29815
|
const [open, setOpen] = React.useState(initialOpen ? true : false);
|
|
29762
29816
|
const contentRef = React.useRef(null);
|
|
29763
29817
|
const contentId = `content-${Math.random().toString(36).substring(2, 9)}`;
|
|
@@ -29782,6 +29836,7 @@
|
|
|
29782
29836
|
};
|
|
29783
29837
|
|
|
29784
29838
|
return /*#__PURE__*/jsxRuntime$1.jsxs("div", {
|
|
29839
|
+
ref: ref,
|
|
29785
29840
|
className: "item",
|
|
29786
29841
|
...restProps,
|
|
29787
29842
|
role: restProps['role'] || 'listitem',
|
|
@@ -29811,7 +29866,7 @@
|
|
|
29811
29866
|
children: content
|
|
29812
29867
|
})]
|
|
29813
29868
|
});
|
|
29814
|
-
};
|
|
29869
|
+
});
|
|
29815
29870
|
|
|
29816
29871
|
const IconVisa = props => {
|
|
29817
29872
|
return /*#__PURE__*/jsxRuntime$1.jsx("svg", {
|
|
@@ -30961,6 +31016,7 @@
|
|
|
30961
31016
|
children
|
|
30962
31017
|
}) => {
|
|
30963
31018
|
const [open, setOpen] = React.useState(false);
|
|
31019
|
+
const dropdownRef = React__default["default"].useRef(null);
|
|
30964
31020
|
React.useEffect(() => {
|
|
30965
31021
|
const handleClickOutside = e => {
|
|
30966
31022
|
setTimeout(() => {
|
|
@@ -30976,9 +31032,22 @@
|
|
|
30976
31032
|
document.removeEventListener('mousedown', handleClickOutside);
|
|
30977
31033
|
};
|
|
30978
31034
|
}, [open]);
|
|
31035
|
+
React.useEffect(() => {
|
|
31036
|
+
if (!dropdownRef?.current) return;
|
|
31037
|
+
if (open) {
|
|
31038
|
+
// Focus the first focusable element in the dropdown when it opens
|
|
31039
|
+
const focusableElements = dropdownRef.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
31040
|
+
if (focusableElements.length) {
|
|
31041
|
+
const element = focusableElements[0];
|
|
31042
|
+
element.focus();
|
|
31043
|
+
}
|
|
31044
|
+
}
|
|
31045
|
+
}, [open]);
|
|
30979
31046
|
return /*#__PURE__*/jsxRuntime$1.jsxs(Wrapper$6, {
|
|
30980
31047
|
className: className,
|
|
30981
31048
|
children: [/*#__PURE__*/jsxRuntime$1.jsx(Button, {
|
|
31049
|
+
"aria-haspopup": true,
|
|
31050
|
+
"aria-expanded": open,
|
|
30982
31051
|
nostyle: true,
|
|
30983
31052
|
focusable: true,
|
|
30984
31053
|
onClick: () => setOpen(!open),
|
|
@@ -30986,6 +31055,8 @@
|
|
|
30986
31055
|
trackingName: "Topbar",
|
|
30987
31056
|
children: icon ? icon : ''
|
|
30988
31057
|
}), open && /*#__PURE__*/jsxRuntime$1.jsx(Content, {
|
|
31058
|
+
ref: dropdownRef,
|
|
31059
|
+
role: "menu",
|
|
30989
31060
|
children: children
|
|
30990
31061
|
})]
|
|
30991
31062
|
});
|
|
@@ -30998,12 +31069,14 @@
|
|
|
30998
31069
|
children
|
|
30999
31070
|
}) => {
|
|
31000
31071
|
return jsxRuntime.jsxs(Link, {
|
|
31072
|
+
role: "menuitem",
|
|
31001
31073
|
trackingName: "Topbar",
|
|
31002
31074
|
trackingEvent: 'DropdownMenu click: ' + (children ? children : ''),
|
|
31003
31075
|
css: theme => [dropdownMenuOption(theme)],
|
|
31004
31076
|
onClick: onClick,
|
|
31005
31077
|
removeUnderline: true,
|
|
31006
31078
|
small: true,
|
|
31079
|
+
"aria-label": children ? `Option: ${children}${counter ? `, ${counter} notifications` : ''}` : '',
|
|
31007
31080
|
children: [children ? children : '', counter ? ` (${counter})` : '']
|
|
31008
31081
|
});
|
|
31009
31082
|
};
|
|
@@ -33884,6 +33957,7 @@ to {top: 100vh;}
|
|
|
33884
33957
|
focusable: true,
|
|
33885
33958
|
css: styles$2.deleteButton,
|
|
33886
33959
|
onClick: () => onImageRemove(0),
|
|
33960
|
+
"aria-label": "Fjern bilde",
|
|
33887
33961
|
children: jsxRuntime.jsx(IconWithBackground, {
|
|
33888
33962
|
variant: "delete",
|
|
33889
33963
|
icon: jsxRuntime.jsx(IconDelete$1, {})
|
|
@@ -33901,6 +33975,7 @@ to {top: 100vh;}
|
|
|
33901
33975
|
nostyle: true,
|
|
33902
33976
|
focusable: true,
|
|
33903
33977
|
css: styles$2.pinButton,
|
|
33978
|
+
"aria-label": "Sett som hovedbilde",
|
|
33904
33979
|
onClick: () => setMainImage(index + 1),
|
|
33905
33980
|
children: jsxRuntime.jsx(IconWithBackground, {
|
|
33906
33981
|
icon: jsxRuntime.jsx(IconImage$1, {}),
|
|
@@ -33910,6 +33985,7 @@ to {top: 100vh;}
|
|
|
33910
33985
|
nostyle: true,
|
|
33911
33986
|
focusable: true,
|
|
33912
33987
|
css: styles$2.deleteButton,
|
|
33988
|
+
"aria-label": "Fjern bilde",
|
|
33913
33989
|
onClick: () => onImageRemove(index + 1),
|
|
33914
33990
|
children: jsxRuntime.jsx(IconWithBackground, {
|
|
33915
33991
|
variant: "delete",
|
|
@@ -33923,6 +33999,7 @@ to {top: 100vh;}
|
|
|
33923
33999
|
...dragProps
|
|
33924
34000
|
})]
|
|
33925
34001
|
}), errors?.acceptType && jsxRuntime.jsx(Text, {
|
|
34002
|
+
role: "alert",
|
|
33926
34003
|
children: "Bilde formatet st\xF8ttes ikke"
|
|
33927
34004
|
})]
|
|
33928
34005
|
});
|
|
@@ -34035,10 +34112,15 @@ to {top: 100vh;}
|
|
|
34035
34112
|
const hasMultipleImages = Boolean(images.length > 1);
|
|
34036
34113
|
return jsxRuntime.jsx("div", {
|
|
34037
34114
|
css: styles.overlay,
|
|
34038
|
-
children: jsxRuntime.
|
|
34115
|
+
children: jsxRuntime.jsxs("div", {
|
|
34039
34116
|
css: styles.carousel,
|
|
34040
34117
|
role: "dialog",
|
|
34041
|
-
|
|
34118
|
+
"aria-modal": true,
|
|
34119
|
+
"aria-labelledby": "carousel-heading",
|
|
34120
|
+
children: [jsxRuntime.jsx(reactAria.VisuallyHidden, {
|
|
34121
|
+
id: "carousel-heading",
|
|
34122
|
+
children: "Bildevisning"
|
|
34123
|
+
}), jsxRuntime.jsx(Carousel__default["default"], {
|
|
34042
34124
|
enableKeyboardControls: true,
|
|
34043
34125
|
swiping: hasMultipleImages,
|
|
34044
34126
|
dragging: hasMultipleImages,
|
|
@@ -34049,6 +34131,7 @@ to {top: 100vh;}
|
|
|
34049
34131
|
renderTopRightControls: () => jsxRuntime.jsx("button", {
|
|
34050
34132
|
css: styles.closeBtn,
|
|
34051
34133
|
onClick: onClose,
|
|
34134
|
+
"aria-label": "Lukk bildevisning",
|
|
34052
34135
|
children: jsxRuntime.jsx(IconClose$1, {
|
|
34053
34136
|
color: "white"
|
|
34054
34137
|
})
|
|
@@ -34058,6 +34141,7 @@ to {top: 100vh;}
|
|
|
34058
34141
|
}) => hasMultipleImages && jsxRuntime.jsx("button", {
|
|
34059
34142
|
css: styles.controlBtn('right'),
|
|
34060
34143
|
onClick: nextSlide,
|
|
34144
|
+
"aria-label": "Naviger til neste bilde",
|
|
34061
34145
|
children: jsxRuntime.jsx(IconChevronLeft$1, {
|
|
34062
34146
|
size: 18,
|
|
34063
34147
|
color: theme.btnDefaultFontColor,
|
|
@@ -34069,6 +34153,7 @@ to {top: 100vh;}
|
|
|
34069
34153
|
}) => hasMultipleImages && jsxRuntime.jsx("button", {
|
|
34070
34154
|
css: styles.controlBtn('left'),
|
|
34071
34155
|
onClick: previousSlide,
|
|
34156
|
+
"aria-label": "Naviger til forrige bilde",
|
|
34072
34157
|
children: jsxRuntime.jsx(IconChevronLeft$1, {
|
|
34073
34158
|
size: 18,
|
|
34074
34159
|
color: theme.btnDefaultFontColor
|
|
@@ -34081,19 +34166,20 @@ to {top: 100vh;}
|
|
|
34081
34166
|
children: jsxRuntime.jsxs(Text, {
|
|
34082
34167
|
color: theme.btnDefaultFontColor,
|
|
34083
34168
|
size: "14px",
|
|
34169
|
+
"aria-label": `Bilde ${currentSlide + 1} av ${images.length}`,
|
|
34084
34170
|
children: [currentSlide + 1, " / ", images.length]
|
|
34085
34171
|
})
|
|
34086
34172
|
}),
|
|
34087
34173
|
children: images.map((imageSrc, i) => jsxRuntime.jsx("div", {
|
|
34088
|
-
css: [styles.imageContainer(isZoomed), process.env.NODE_ENV === "production" ? "" : ";label:ImageViewer;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
34174
|
+
css: [styles.imageContainer(isZoomed), process.env.NODE_ENV === "production" ? "" : ";label:ImageViewer;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wYWNrYWdlcy9jb3JlL0ltYWdlVmlld2VyL2luZGV4LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF5R3lCIiwiZmlsZSI6Ii4uLy4uLy4uL3NyYy9wYWNrYWdlcy9jb3JlL0ltYWdlVmlld2VyL2luZGV4LnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4SW1wb3J0U291cmNlIEBlbW90aW9uL3JlYWN0ICovXG5pbXBvcnQgeyB1c2VUaGVtZSB9IGZyb20gJ0BlbW90aW9uL3JlYWN0J1xuaW1wb3J0IHsgc3R5bGVzIH0gZnJvbSAnLi9zdHlsZXMnXG5pbXBvcnQgSW1hZ2UgZnJvbSAnLi4vSW1hZ2UnXG5pbXBvcnQgQ2Fyb3VzZWwgZnJvbSAnbnVrYS1jYXJvdXNlbCdcbmltcG9ydCBUZXh0IGZyb20gJy4uL1RleHQnXG5pbXBvcnQgSWNvbkNoZXZyb25MZWZ0IGZyb20gJy4uLy4uL2ljb25zL0dlbmVyYWwvSWNvbkNoZXZyb25MZWZ0J1xuaW1wb3J0IEljb25DbG9zZSBmcm9tICcuLi8uLi9pY29ucy9HZW5lcmFsL0ljb25DbG9zZSdcbmltcG9ydCB7IHVzZUVmZmVjdCwgdXNlU3RhdGUgfSBmcm9tICdyZWFjdCdcbmltcG9ydCB7IEtleSB9IGZyb20gJy4uLy4uL2VudW1zL0tleWJvYXJkJ1xuaW1wb3J0IHsgVmlzdWFsbHlIaWRkZW4gfSBmcm9tICdyZWFjdC1hcmlhJ1xuXG50eXBlIFByb3BzID0ge1xuICAvKiogSW1hZ2Ugc3JjJ3MgKi9cbiAgaW1hZ2VzOiBzdHJpbmdbXVxuICAvKiogSW1hZ2UgbGlzdCBpbmRleCB0byBkaXNwbGF5IGluaXRpYWxseSwgZGVmYXVsdHMgdG8gMCAqL1xuICBpbml0aWFsSW1hZ2U6IG51bWJlclxuICAvKiogT24gY2xvc2UgY2FsbGJhY2sgKi9cbiAgb25DbG9zZTogKCkgPT4gdm9pZFxufVxuXG5jb25zdCBJbWFnZVZpZXdlciA9ICh7IGltYWdlcywgaW5pdGlhbEltYWdlID0gMCwgb25DbG9zZSB9OiBQcm9wcykgPT4ge1xuICBjb25zdCB0aGVtZSA9IHVzZVRoZW1lKClcbiAgY29uc3QgW2lzWm9vbWVkLCBzZXRJc1pvb21lZF0gPSB1c2VTdGF0ZShmYWxzZSlcblxuICB1c2VFZmZlY3QoKCkgPT4ge1xuICAgIC8vIFRyaWdnZXIgY2xvc2UgZXZlbnQgb24gXCJlc2NhcGVcIiBrZXlkb3duXG4gICAgY29uc3QgaGFuZGxlS2V5RG93biA9IChldmVudDogS2V5Ym9hcmRFdmVudCkgPT4ge1xuICAgICAgaWYgKGV2ZW50LmtleSA9PT0gS2V5LmVzY2FwZSkgb25DbG9zZSgpXG4gICAgfVxuICAgIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoJ2tleWRvd24nLCBoYW5kbGVLZXlEb3duKVxuXG4gICAgcmV0dXJuICgpID0+IHtcbiAgICAgIGRvY3VtZW50LnJlbW92ZUV2ZW50TGlzdGVuZXIoJ2tleWRvd24nLCBoYW5kbGVLZXlEb3duKVxuICAgIH1cbiAgfSwgW10pXG5cbiAgY29uc3QgaGFzTXVsdGlwbGVJbWFnZXMgPSBCb29sZWFuKGltYWdlcy5sZW5ndGggPiAxKVxuXG4gIHJldHVybiAoXG4gICAgPGRpdiBjc3M9e3N0eWxlcy5vdmVybGF5fT5cbiAgICAgIDxkaXZcbiAgICAgICAgY3NzPXtzdHlsZXMuY2Fyb3VzZWx9XG4gICAgICAgIHJvbGU9XCJkaWFsb2dcIlxuICAgICAgICBhcmlhLW1vZGFsPXt0cnVlfVxuICAgICAgICBhcmlhLWxhYmVsbGVkYnk9XCJjYXJvdXNlbC1oZWFkaW5nXCJcbiAgICAgID5cbiAgICAgICAgPFZpc3VhbGx5SGlkZGVuIGlkPVwiY2Fyb3VzZWwtaGVhZGluZ1wiPkJpbGRldmlzbmluZzwvVmlzdWFsbHlIaWRkZW4+XG4gICAgICAgIDxDYXJvdXNlbFxuICAgICAgICAgIGVuYWJsZUtleWJvYXJkQ29udHJvbHNcbiAgICAgICAgICBzd2lwaW5nPXtoYXNNdWx0aXBsZUltYWdlc31cbiAgICAgICAgICBkcmFnZ2luZz17aGFzTXVsdGlwbGVJbWFnZXN9XG4gICAgICAgICAgd3JhcEFyb3VuZFxuICAgICAgICAgIHNsaWRlSW5kZXg9e2luaXRpYWxJbWFnZX1cbiAgICAgICAgICBjZWxsU3BhY2luZz17MTV9XG4gICAgICAgICAgb25Vc2VyTmF2aWdhdGlvbj17KCkgPT4gc2V0SXNab29tZWQoZmFsc2UpfVxuICAgICAgICAgIHJlbmRlclRvcFJpZ2h0Q29udHJvbHM9eygpID0+IChcbiAgICAgICAgICAgIDxidXR0b25cbiAgICAgICAgICAgICAgY3NzPXtzdHlsZXMuY2xvc2VCdG59XG4gICAgICAgICAgICAgIG9uQ2xpY2s9e29uQ2xvc2V9XG4gICAgICAgICAgICAgIGFyaWEtbGFiZWw9XCJMdWtrIGJpbGRldmlzbmluZ1wiXG4gICAgICAgICAgICA+XG4gICAgICAgICAgICAgIDxJY29uQ2xvc2UgY29sb3I9XCJ3aGl0ZVwiIC8+XG4gICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICApfVxuICAgICAgICAgIHJlbmRlckNlbnRlclJpZ2h0Q29udHJvbHM9eyh7IG5leHRTbGlkZSB9KSA9PlxuICAgICAgICAgICAgaGFzTXVsdGlwbGVJbWFnZXMgJiYgKFxuICAgICAgICAgICAgICA8YnV0dG9uXG4gICAgICAgICAgICAgICAgY3NzPXtzdHlsZXMuY29udHJvbEJ0bigncmlnaHQnKX1cbiAgICAgICAgICAgICAgICBvbkNsaWNrPXtuZXh0U2xpZGV9XG4gICAgICAgICAgICAgICAgYXJpYS1sYWJlbD1cIk5hdmlnZXIgdGlsIG5lc3RlIGJpbGRlXCJcbiAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgIHsvKiBVc2VzIEljb25DaGV2cm9uTGVmdCwgYmVjYXVzZSBJY29uQ2hldnJvblJpZ2h0IGlzIG5vdCBjZW50ZXJlZCBwcm9wZXJseSAgKi99XG4gICAgICAgICAgICAgICAgPEljb25DaGV2cm9uTGVmdFxuICAgICAgICAgICAgICAgICAgc2l6ZT17MTh9XG4gICAgICAgICAgICAgICAgICBjb2xvcj17dGhlbWUuYnRuRGVmYXVsdEZvbnRDb2xvcn1cbiAgICAgICAgICAgICAgICAgIGZsaXBcbiAgICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgIClcbiAgICAgICAgICB9XG4gICAgICAgICAgcmVuZGVyQ2VudGVyTGVmdENvbnRyb2xzPXsoeyBwcmV2aW91c1NsaWRlIH0pID0+XG4gICAgICAgICAgICBoYXNNdWx0aXBsZUltYWdlcyAmJiAoXG4gICAgICAgICAgICAgIDxidXR0b25cbiAgICAgICAgICAgICAgICBjc3M9e3N0eWxlcy5jb250cm9sQnRuKCdsZWZ0Jyl9XG4gICAgICAgICAgICAgICAgb25DbGljaz17cHJldmlvdXNTbGlkZX1cbiAgICAgICAgICAgICAgICBhcmlhLWxhYmVsPVwiTmF2aWdlciB0aWwgZm9ycmlnZSBiaWxkZVwiXG4gICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICA8SWNvbkNoZXZyb25MZWZ0IHNpemU9ezE4fSBjb2xvcj17dGhlbWUuYnRuRGVmYXVsdEZvbnRDb2xvcn0gLz5cbiAgICAgICAgICAgICAgPC9idXR0b24+XG4gICAgICAgICAgICApXG4gICAgICAgICAgfVxuICAgICAgICAgIHJlbmRlckJvdHRvbUNlbnRlckNvbnRyb2xzPXsoeyBjdXJyZW50U2xpZGUgfSkgPT4gKFxuICAgICAgICAgICAgPGRpdiBjc3M9e3N0eWxlcy5wYWdlSW5mb30+XG4gICAgICAgICAgICAgIDxUZXh0XG4gICAgICAgICAgICAgICAgY29sb3I9e3RoZW1lLmJ0bkRlZmF1bHRGb250Q29sb3J9XG4gICAgICAgICAgICAgICAgc2l6ZT1cIjE0cHhcIlxuICAgICAgICAgICAgICAgIGFyaWEtbGFiZWw9e2BCaWxkZSAke2N1cnJlbnRTbGlkZSArIDF9IGF2ICR7aW1hZ2VzLmxlbmd0aH1gfVxuICAgICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAge2N1cnJlbnRTbGlkZSArIDF9IC8ge2ltYWdlcy5sZW5ndGh9XG4gICAgICAgICAgICAgIDwvVGV4dD5cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICl9XG4gICAgICAgID5cbiAgICAgICAgICB7aW1hZ2VzLm1hcCgoaW1hZ2VTcmMsIGkpID0+IChcbiAgICAgICAgICAgIDxkaXYga2V5PXtpfSBjc3M9e1tzdHlsZXMuaW1hZ2VDb250YWluZXIoaXNab29tZWQpXX0+XG4gICAgICAgICAgICAgIDxJbWFnZVxuICAgICAgICAgICAgICAgIHNyYz17aW1hZ2VTcmN9XG4gICAgICAgICAgICAgICAgYWx0PXtgQmlsZGUgJHtpICsgMX0gYXYgJHtpbWFnZXMubGVuZ3RofWB9XG4gICAgICAgICAgICAgICAgb2JqZWN0Rml0PVwiY29udGFpblwiXG4gICAgICAgICAgICAgICAgb25DbGljaz17KCkgPT4gc2V0SXNab29tZWQoIWlzWm9vbWVkKX1cbiAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICkpfVxuICAgICAgICA8L0Nhcm91c2VsPlxuICAgICAgPC9kaXY+XG4gICAgPC9kaXY+XG4gIClcbn1cbmV4cG9ydCBkZWZhdWx0IEltYWdlVmlld2VyXG4iXX0= */"],
|
|
34089
34175
|
children: jsxRuntime.jsx(Image, {
|
|
34090
34176
|
src: imageSrc,
|
|
34091
|
-
alt:
|
|
34177
|
+
alt: `Bilde ${i + 1} av ${images.length}`,
|
|
34092
34178
|
objectFit: "contain",
|
|
34093
34179
|
onClick: () => setIsZoomed(!isZoomed)
|
|
34094
34180
|
})
|
|
34095
34181
|
}, i))
|
|
34096
|
-
})
|
|
34182
|
+
})]
|
|
34097
34183
|
})
|
|
34098
34184
|
});
|
|
34099
34185
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import _styled from "@emotion/styled/base";
|
|
2
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
3
|
+
export const BodyWrapper = /*#__PURE__*/_styled("tbody", process.env.NODE_ENV === "production" ? {
|
|
4
|
+
target: "e1u8g1t20"
|
|
5
|
+
} : {
|
|
6
|
+
target: "e1u8g1t20",
|
|
7
|
+
label: "BodyWrapper"
|
|
8
|
+
})(process.env.NODE_ENV === "production" ? {
|
|
9
|
+
name: "ixi98c",
|
|
10
|
+
styles: "display:flex;flex-direction:column;grid-row-gap:1em"
|
|
11
|
+
} : {
|
|
12
|
+
name: "ixi98c",
|
|
13
|
+
styles: "display:flex;flex-direction:column;grid-row-gap:1em",
|
|
14
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9wYWNrYWdlcy9jb3JlL0JveGVkVGFibGUvVGFibGVCb2R5L3N0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFdUMiLCJmaWxlIjoiLi4vLi4vLi4vLi4vc3JjL3BhY2thZ2VzL2NvcmUvQm94ZWRUYWJsZS9UYWJsZUJvZHkvc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnXG5cbmV4cG9ydCBjb25zdCBCb2R5V3JhcHBlciA9IHN0eWxlZC50Ym9keWBcbiAgZGlzcGxheTogZmxleDtcbiAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcbiAgZ3JpZC1yb3ctZ2FwOiAxZW07XG5gXG4iXX0= */",
|
|
15
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
16
|
+
});
|
|
@@ -1,121 +1,123 @@
|
|
|
1
1
|
import Button from '.';
|
|
2
2
|
import IconCaretDown from '../../icons/General/IconCaretDown';
|
|
3
|
-
import IconEdit from '../../icons/General/IconEdit';
|
|
4
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
|
|
4
|
+
const meta = {
|
|
6
5
|
title: 'Core/Button',
|
|
7
6
|
component: Button
|
|
8
7
|
};
|
|
8
|
+
export default meta;
|
|
9
9
|
export const Default = {
|
|
10
|
-
|
|
11
|
-
children:
|
|
12
|
-
}
|
|
10
|
+
args: {
|
|
11
|
+
children: 'Standard button'
|
|
12
|
+
},
|
|
13
13
|
name: 'Default'
|
|
14
14
|
};
|
|
15
15
|
export const IconBefore = {
|
|
16
|
-
|
|
16
|
+
args: {
|
|
17
17
|
beforeIcon: /*#__PURE__*/_jsx(IconCaretDown, {}),
|
|
18
|
-
children:
|
|
19
|
-
}
|
|
18
|
+
children: 'Standard button'
|
|
19
|
+
},
|
|
20
20
|
name: 'Icon before'
|
|
21
21
|
};
|
|
22
|
+
|
|
23
|
+
// Rewrite all stories to use args instead of render
|
|
24
|
+
|
|
22
25
|
export const IconAfter = {
|
|
23
|
-
|
|
26
|
+
args: {
|
|
24
27
|
afterIcon: /*#__PURE__*/_jsx(IconCaretDown, {}),
|
|
25
|
-
children:
|
|
26
|
-
}
|
|
28
|
+
children: 'Standard button'
|
|
29
|
+
},
|
|
27
30
|
name: 'Icon after'
|
|
28
31
|
};
|
|
29
32
|
export const Success = {
|
|
30
|
-
|
|
33
|
+
args: {
|
|
31
34
|
success: true,
|
|
32
|
-
children:
|
|
33
|
-
}
|
|
35
|
+
children: 'Success button'
|
|
36
|
+
},
|
|
34
37
|
name: 'Success'
|
|
35
38
|
};
|
|
36
39
|
export const Danger = {
|
|
37
|
-
|
|
40
|
+
args: {
|
|
38
41
|
danger: true,
|
|
39
|
-
children:
|
|
40
|
-
}
|
|
42
|
+
children: 'Danger button'
|
|
43
|
+
},
|
|
41
44
|
name: 'Danger'
|
|
42
45
|
};
|
|
43
46
|
export const Loading = {
|
|
44
|
-
|
|
47
|
+
args: {
|
|
45
48
|
loading: true,
|
|
46
|
-
children:
|
|
47
|
-
}
|
|
49
|
+
children: 'Loading button'
|
|
50
|
+
},
|
|
48
51
|
name: 'Loading'
|
|
49
52
|
};
|
|
50
53
|
export const Disabled = {
|
|
51
|
-
|
|
54
|
+
args: {
|
|
52
55
|
disabled: true,
|
|
53
|
-
children:
|
|
54
|
-
}
|
|
56
|
+
children: 'Disabled button'
|
|
57
|
+
},
|
|
55
58
|
name: 'Disabled'
|
|
56
59
|
};
|
|
57
60
|
export const Highlighted = {
|
|
58
|
-
|
|
61
|
+
args: {
|
|
59
62
|
highlight: true,
|
|
60
|
-
children:
|
|
61
|
-
}
|
|
63
|
+
children: 'Hightlighted button'
|
|
64
|
+
},
|
|
62
65
|
name: 'Highlighted'
|
|
63
66
|
};
|
|
64
67
|
export const OutlineHighlighted = {
|
|
65
|
-
|
|
68
|
+
args: {
|
|
66
69
|
highlight: true,
|
|
67
70
|
outline: true,
|
|
68
|
-
children:
|
|
69
|
-
}
|
|
71
|
+
children: 'Hightlighted outline button'
|
|
72
|
+
},
|
|
70
73
|
name: 'Outline highlighted'
|
|
71
74
|
};
|
|
72
75
|
export const Back = {
|
|
73
|
-
|
|
76
|
+
args: {
|
|
74
77
|
back: true,
|
|
75
|
-
children:
|
|
76
|
-
}
|
|
78
|
+
children: 'Go back'
|
|
79
|
+
},
|
|
77
80
|
name: 'Back'
|
|
78
81
|
};
|
|
79
82
|
export const Small = {
|
|
80
|
-
|
|
83
|
+
args: {
|
|
81
84
|
small: true,
|
|
82
|
-
children:
|
|
83
|
-
}
|
|
85
|
+
children: 'Small button'
|
|
86
|
+
},
|
|
84
87
|
name: 'Small'
|
|
85
88
|
};
|
|
86
89
|
export const DangerOutline = {
|
|
87
|
-
|
|
90
|
+
args: {
|
|
88
91
|
danger: true,
|
|
89
92
|
outline: true,
|
|
90
|
-
children:
|
|
91
|
-
}
|
|
93
|
+
children: 'Danger outline'
|
|
94
|
+
},
|
|
92
95
|
name: 'Danger outline'
|
|
93
96
|
};
|
|
94
97
|
export const TransparentBackground = {
|
|
95
|
-
|
|
98
|
+
args: {
|
|
96
99
|
outline: true,
|
|
97
100
|
transparentBg: true,
|
|
98
|
-
children:
|
|
99
|
-
}
|
|
101
|
+
children: 'Danger outline'
|
|
102
|
+
},
|
|
100
103
|
name: 'Transparent background'
|
|
101
104
|
};
|
|
102
105
|
export const NoStyle = {
|
|
103
|
-
|
|
106
|
+
args: {
|
|
104
107
|
nostyle: true,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}),
|
|
108
|
+
children: 'No style'
|
|
109
|
+
},
|
|
108
110
|
name: 'No style'
|
|
109
111
|
};
|
|
110
112
|
export const EventKeyPresses = {
|
|
111
|
-
|
|
113
|
+
args: {
|
|
112
114
|
onEnterKeyPress: () => console.log('Enter pressed'),
|
|
113
115
|
onEscapeKeyPress: () => console.log('Escape pressed'),
|
|
114
|
-
|
|
116
|
+
onCustomKeyPress: {
|
|
115
117
|
key: 'E',
|
|
116
118
|
action: e => console.log('Key pressed', e.key)
|
|
117
119
|
},
|
|
118
|
-
children:
|
|
119
|
-
}
|
|
120
|
+
children: 'Actionlistener button'
|
|
121
|
+
},
|
|
120
122
|
name: 'Event key presses'
|
|
121
123
|
};
|