@bbl-digital/snorre 4.0.22 → 4.0.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. package/dist/bundle.js +113 -27
  2. package/esm/core/Button/Button.stories.js +50 -48
  3. package/esm/core/Card/index.js +4 -3
  4. package/esm/core/Checkbox/index.js +32 -9
  5. package/esm/core/CollapseList/Item.js +4 -3
  6. package/esm/core/CollapseList/index.js +4 -3
  7. package/esm/core/Datepicker/Datepicker.stories.js +7 -6
  8. package/esm/core/DatepickerRange/DatepickerRange.stories.js +4 -3
  9. package/esm/core/DropdownMenu/DropdownMenu.stories.js +34 -26
  10. package/esm/core/DropdownMenu/DropdownMenuOption.js +2 -0
  11. package/esm/core/DropdownMenu/index.js +16 -0
  12. package/esm/core/Editor/Editor.stories.js +31 -30
  13. package/esm/core/FileInput/index.js +7 -1
  14. package/esm/core/GoogleButton/GoogleButton.stories.js +4 -4
  15. package/esm/core/Header/Header.stories.js +42 -45
  16. package/esm/core/HighlightText/HighlightText.stories.js +11 -11
  17. package/esm/core/Image/index.js +19 -4
  18. package/esm/core/ImagePicker/ImagePicker.stories.js +2 -1
  19. package/esm/core/ImagePicker/index.js +4 -0
  20. package/esm/core/ImageViewer/index.js +15 -5
  21. package/esm/core/InfoButton/InfoButton.stories.js +23 -22
  22. package/esm/core/InfoButton/index.js +4 -0
  23. package/esm/core/Input/index.js +4 -0
  24. package/lib/core/Button/Button.stories.d.ts +20 -63
  25. package/lib/core/Button/Button.stories.d.ts.map +1 -1
  26. package/lib/core/Button/Button.stories.js +50 -48
  27. package/lib/core/Card/index.d.ts +14 -15
  28. package/lib/core/Card/index.d.ts.map +1 -1
  29. package/lib/core/Card/index.js +4 -3
  30. package/lib/core/Checkbox/index.d.ts +3 -3
  31. package/lib/core/Checkbox/index.d.ts.map +1 -1
  32. package/lib/core/Checkbox/index.js +32 -9
  33. package/lib/core/CollapseList/Item.d.ts +1 -1
  34. package/lib/core/CollapseList/Item.d.ts.map +1 -1
  35. package/lib/core/CollapseList/Item.js +4 -3
  36. package/lib/core/CollapseList/index.d.ts +1 -1
  37. package/lib/core/CollapseList/index.d.ts.map +1 -1
  38. package/lib/core/CollapseList/index.js +4 -3
  39. package/lib/core/Datepicker/Datepicker.stories.d.ts +6 -6
  40. package/lib/core/Datepicker/Datepicker.stories.d.ts.map +1 -1
  41. package/lib/core/Datepicker/Datepicker.stories.js +7 -6
  42. package/lib/core/DatepickerRange/DatepickerRange.stories.d.ts +6 -7
  43. package/lib/core/DatepickerRange/DatepickerRange.stories.d.ts.map +1 -1
  44. package/lib/core/DatepickerRange/DatepickerRange.stories.js +4 -3
  45. package/lib/core/DropdownMenu/DropdownMenu.stories.d.ts +8 -15
  46. package/lib/core/DropdownMenu/DropdownMenu.stories.d.ts.map +1 -1
  47. package/lib/core/DropdownMenu/DropdownMenu.stories.js +34 -26
  48. package/lib/core/DropdownMenu/DropdownMenuOption.d.ts.map +1 -1
  49. package/lib/core/DropdownMenu/DropdownMenuOption.js +2 -0
  50. package/lib/core/DropdownMenu/index.d.ts.map +1 -1
  51. package/lib/core/DropdownMenu/index.js +16 -0
  52. package/lib/core/Editor/Editor.stories.d.ts +10 -23
  53. package/lib/core/Editor/Editor.stories.d.ts.map +1 -1
  54. package/lib/core/Editor/Editor.stories.js +31 -30
  55. package/lib/core/FileInput/index.d.ts +3 -1
  56. package/lib/core/FileInput/index.d.ts.map +1 -1
  57. package/lib/core/FileInput/index.js +7 -1
  58. package/lib/core/GoogleButton/GoogleButton.stories.d.ts +6 -7
  59. package/lib/core/GoogleButton/GoogleButton.stories.d.ts.map +1 -1
  60. package/lib/core/GoogleButton/GoogleButton.stories.js +4 -4
  61. package/lib/core/Header/Header.stories.d.ts +13 -35
  62. package/lib/core/Header/Header.stories.d.ts.map +1 -1
  63. package/lib/core/Header/Header.stories.js +42 -45
  64. package/lib/core/HighlightText/HighlightText.stories.d.ts +7 -11
  65. package/lib/core/HighlightText/HighlightText.stories.d.ts.map +1 -1
  66. package/lib/core/HighlightText/HighlightText.stories.js +11 -11
  67. package/lib/core/Image/index.d.ts +1 -0
  68. package/lib/core/Image/index.d.ts.map +1 -1
  69. package/lib/core/Image/index.js +19 -4
  70. package/lib/core/ImagePicker/ImagePicker.stories.d.ts +6 -17
  71. package/lib/core/ImagePicker/ImagePicker.stories.d.ts.map +1 -1
  72. package/lib/core/ImagePicker/ImagePicker.stories.js +2 -1
  73. package/lib/core/ImagePicker/index.d.ts.map +1 -1
  74. package/lib/core/ImagePicker/index.js +4 -0
  75. package/lib/core/ImageViewer/index.d.ts.map +1 -1
  76. package/lib/core/ImageViewer/index.js +15 -5
  77. package/lib/core/InfoButton/InfoButton.stories.d.ts +10 -23
  78. package/lib/core/InfoButton/InfoButton.stories.d.ts.map +1 -1
  79. package/lib/core/InfoButton/InfoButton.stories.js +23 -22
  80. package/lib/core/InfoButton/index.d.ts.map +1 -1
  81. package/lib/core/InfoButton/index.js +4 -0
  82. package/lib/core/Input/index.d.ts +1 -1
  83. package/lib/core/Input/index.d.ts.map +1 -1
  84. package/lib/core/Input/index.js +4 -0
  85. package/package.json +1 -1
package/dist/bundle.js CHANGED
@@ -602,10 +602,10 @@
602
602
  }({});
603
603
 
604
604
  /** @jsxImportSource @emotion/react */
605
- const Card = ({
605
+ const Card = /*#__PURE__*/React__default["default"].forwardRef(({
606
606
  className,
607
607
  ...props
608
- }) => {
608
+ }, ref) => {
609
609
  const handleOnKeyPress = e => {
610
610
  if (e.key === Key.enter || e.key === Key.space) {
611
611
  if (props.onClick) {
@@ -614,6 +614,7 @@
614
614
  }
615
615
  };
616
616
  return jsxRuntime.jsx("div", {
617
+ ref: ref,
617
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],
618
619
  tabIndex: props.onClick ? 0 : undefined,
619
620
  onClick: props.onClick,
@@ -622,7 +623,7 @@
622
623
  ...props,
623
624
  children: props.children
624
625
  });
625
- };
626
+ });
626
627
 
627
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)."; }
628
629
  const styles$x = {
@@ -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: alt,
1446
- onLoad: withPlaceholder ? () => setImageLoaded(true) : undefined,
1447
- onError: fallbackUrl ? () => setImageSrc(fallbackUrl) : undefined,
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 = props => {
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
- className: props.className,
2168
- css: theme => [styles$n.default(theme), props.disabled && styles$n.disabled(theme, props.disabledHoverState), props.nomargin && styles$n.nomargin, props.child && styles$n.child, props.type === 'subtle' && styles$n.subtle(theme)],
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: props.name,
2175
- disabled: props.disabled,
2176
- onClick: props.onClick,
2177
- onChange: handleChange
2178
- }), jsxRuntime.jsx("span", {}), props.children]
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.jsx("div", {
34115
+ children: jsxRuntime.jsxs("div", {
34039
34116
  css: styles.carousel,
34040
34117
  role: "dialog",
34041
- children: jsxRuntime.jsx(Carousel__default["default"], {
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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wYWNrYWdlcy9jb3JlL0ltYWdlVmlld2VyL2luZGV4LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFrRnlCIiwiZmlsZSI6Ii4uLy4uLy4uL3NyYy9wYWNrYWdlcy9jb3JlL0ltYWdlVmlld2VyL2luZGV4LnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4SW1wb3J0U291cmNlIEBlbW90aW9uL3JlYWN0ICovXG5pbXBvcnQgeyB1c2VUaGVtZSB9IGZyb20gJ0BlbW90aW9uL3JlYWN0J1xuaW1wb3J0IHsgc3R5bGVzIH0gZnJvbSAnLi9zdHlsZXMnXG5pbXBvcnQgSW1hZ2UgZnJvbSAnLi4vSW1hZ2UnXG5pbXBvcnQgQ2Fyb3VzZWwgZnJvbSAnbnVrYS1jYXJvdXNlbCdcbmltcG9ydCBUZXh0IGZyb20gJy4uL1RleHQnXG5pbXBvcnQgSWNvbkNoZXZyb25MZWZ0IGZyb20gJy4uLy4uL2ljb25zL0dlbmVyYWwvSWNvbkNoZXZyb25MZWZ0J1xuaW1wb3J0IEljb25DbG9zZSBmcm9tICcuLi8uLi9pY29ucy9HZW5lcmFsL0ljb25DbG9zZSdcbmltcG9ydCB7IHVzZUVmZmVjdCwgdXNlU3RhdGUgfSBmcm9tICdyZWFjdCdcbmltcG9ydCB7IEtleSB9IGZyb20gJy4uLy4uL2VudW1zL0tleWJvYXJkJ1xuXG50eXBlIFByb3B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ZS5idG5EZWZhdWx0Rm9udENvbG9yfVxuICAgICAgICAgICAgICAgICAgZmxpcFxuICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICAgICAgKVxuICAgICAgICAgIH1cbiAgICAgICAgICByZW5kZXJDZW50ZXJMZWZ0Q29udHJvbHM9eyh7IHByZXZpb3VzU2xpZGUgfSkgPT5cbiAgICAgICAgICAgIGhhc011bHRpcGxlSW1hZ2VzICYmIChcbiAgICAgICAgICAgICAgPGJ1dHRvbiBjc3M9e3N0eWxlcy5jb250cm9sQnRuKCdsZWZ0Jyl9IG9uQ2xpY2s9e3ByZXZpb3VzU2xpZGV9PlxuICAgICAgICAgICAgICAgIDxJY29uQ2hldnJvbkxlZnQgc2l6ZT17MTh9IGNvbG9yPXt0aGVtZS5idG5EZWZhdWx0Rm9udENvbG9yfSAvPlxuICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgIClcbiAgICAgICAgICB9XG4gICAgICAgICAgcmVuZGVyQm90dG9tQ2VudGVyQ29udHJvbHM9eyh7IGN1cnJlbnRTbGlkZSB9KSA9PiAoXG4gICAgICAgICAgICA8ZGl2IGNzcz17c3R5bGVzLnBhZ2VJbmZvfT5cbiAgICAgICAgICAgICAgPFRleHQgY29sb3I9e3RoZW1lLmJ0bkRlZmF1bHRGb250Q29sb3J9IHNpemU9XCIxNHB4XCI+XG4gICAgICAgICAgICAgICAge2N1cnJlbnRTbGlkZSArIDF9IC8ge2ltYWdlcy5sZW5ndGh9XG4gICAgICAgICAgICAgIDwvVGV4dD5cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICl9XG4gICAgICAgID5cbiAgICAgICAgICB7aW1hZ2VzLm1hcCgoaW1hZ2VTcmMsIGkpID0+IChcbiAgICAgICAgICAgIDxkaXYga2V5PXtpfSBjc3M9e1tzdHlsZXMuaW1hZ2VDb250YWluZXIoaXNab29tZWQpXX0+XG4gICAgICAgICAgICAgIDxJbWFnZVxuICAgICAgICAgICAgICAgIHNyYz17aW1hZ2VTcmN9XG4gICAgICAgICAgICAgICAgYWx0PVwiYmlsZGVcIlxuICAgICAgICAgICAgICAgIG9iamVjdEZpdD1cImNvbnRhaW5cIlxuICAgICAgICAgICAgICAgIG9uQ2xpY2s9eygpID0+IHNldElzWm9vbWVkKCFpc1pvb21lZCl9XG4gICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICApKX1cbiAgICAgICAgPC9DYXJvdXNlbD5cbiAgICAgIDwvZGl2PlxuICAgIDwvZGl2PlxuICApXG59XG5leHBvcnQgZGVmYXVsdCBJbWFnZVZpZXdlclxuIl19 */"],
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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wYWNrYWdlcy9jb3JlL0ltYWdlVmlld2VyL2luZGV4LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF5R3lCIiwiZmlsZSI6Ii4uLy4uLy4uL3NyYy9wYWNrYWdlcy9jb3JlL0ltYWdlVmlld2VyL2luZGV4LnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4SW1wb3J0U291cmNlIEBlbW90aW9uL3JlYWN0ICovXG5pbXBvcnQgeyB1c2VUaGVtZSB9IGZyb20gJ0BlbW90aW9uL3JlYWN0J1xuaW1wb3J0IHsgc3R5bGVzIH0gZnJvbSAnLi9zdHlsZXMnXG5pbXBvcnQgSW1hZ2UgZnJvbSAnLi4vSW1hZ2UnXG5pbXBvcnQgQ2Fyb3VzZWwgZnJvbSAnbnVrYS1jYXJvdXNlbCdcbmltcG9ydCBUZXh0IGZyb20gJy4uL1RleHQnXG5pbXBvcnQgSWNvbkNoZXZyb25MZWZ0IGZyb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uQ2xpY2s9e29uQ2xvc2V9XG4gICAgICAgICAgICAgIGFyaWEtbGFiZWw9XCJMdWtrIGJpbGRldmlzbmluZ1wiXG4gICAgICAgICAgICA+XG4gICAgICAgICAgICAgIDxJY29uQ2xvc2UgY29sb3I9XCJ3aGl0ZVwiIC8+XG4gICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICApfVxuICAgICAgICAgIHJlbmRlckNlbnRlclJpZ2h0Q29udHJvbHM9eyh7IG5leHRTbGlkZSB9KSA9PlxuICAgICAgICAgICAgaGFzTXVsdGlwbGVJbWFnZXMgJiYgKFxuICAgICAgICAgICAgICA8YnV0dG9uXG4gICAgICAgICAgICAgICAgY3NzPXtzdHlsZXMuY29udHJvbEJ0bigncmlnaHQnKX1cbiAgICAgICAgICAgICAgICBvbkNsaWNrPXtuZXh0U2xpZGV9XG4gICAgICAgICAgICAgICAgYXJpYS1sYWJlbD1cIk5hdmlnZXIgdGlsIG5lc3RlIGJpbGRlXCJcbiAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgIHsvKiBVc2VzIEljb25DaGV2cm9uTGVmdCwgYmVjYXVzZSBJY29uQ2hldnJvblJpZ2h0IGlzIG5vdCBjZW50ZXJlZCBwcm9wZXJseSAgKi99XG4gICAgICAgICAgICAgICAgPEljb25DaGV2cm9uTGVmdFxuICAgICAgICAgICAgICAgICAgc2l6ZT17MTh9XG4gICAgICAgICAgICAgICAgICBjb2xvcj17dGhlbWUuYnRuRGVmYXVsdEZvbnRDb2xvcn1cbiAgICAgICAgICAgICAgICAgIGZsaXBcbiAgICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgIClcbiAgICAgICAgICB9XG4gICAgICAgICAgcmVuZGVyQ2VudGVyTGVmdENvbnRyb2xzPXsoeyBwcmV2aW91c1NsaWRlIH0pID0+XG4gICAgICAgICAgICBoYXNNdWx0aXBsZUltYWdlcyAmJiAoXG4gICAgICAgICAgICAgIDxidXR0b25cbiAgICAgICAgICAgICAgICBjc3M9e3N0eWxlcy5jb250cm9sQnRuKCdsZWZ0Jyl9XG4gICAgICAgICAgICAgICAgb25DbGljaz17cHJldmlvdXNTbGlkZX1cbiAgICAgICAgICAgICAgICBhcmlhLWxhYmVsPVwiTmF2aWdlciB0aWwgZm9ycmlnZSBiaWxkZVwiXG4gICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICA8SWNvbkNoZXZyb25MZWZ0IHNpemU9ezE4fSBjb2xvcj17dGhlbWUuYnRuRGVmYXVsdEZvbnRDb2xvcn0gLz5cbiAgICAgICAgICAgICAgPC9idXR0b24+XG4gICAgICAgICAgICApXG4gICAgICAgICAgfVxuICAgICAgICAgIHJlbmRlckJvdHRvbUNlbnRlckNvbnRyb2xzPXsoeyBjdXJyZW50U2xpZGUgfSkgPT4gKFxuICAgICAgICAgICAgPGRpdiBjc3M9e3N0eWxlcy5wYWdlSW5mb30+XG4gICAgICAgICAgICAgIDxUZXh0XG4gICAgICAgICAgICAgICAgY29sb3I9e3RoZW1lLmJ0bkRlZmF1bHRGb250Q29sb3J9XG4gICAgICAgICAgICAgICAgc2l6ZT1cIjE0cHhcIlxuICAgICAgICAgICAgICAgIGFyaWEtbGFiZWw9e2BCaWxkZSAke2N1cnJlbnRTbGlkZSArIDF9IGF2ICR7aW1hZ2VzLmxlbmd0aH1gfVxuICAgICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAge2N1cnJlbnRTbGlkZSArIDF9IC8ge2ltYWdlcy5sZW5ndGh9XG4gICAgICAgICAgICAgIDwvVGV4dD5cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICl9XG4gICAgICAgID5cbiAgICAgICAgICB7aW1hZ2VzLm1hcCgoaW1hZ2VTcmMsIGkpID0+IChcbiAgICAgICAgICAgIDxkaXYga2V5PXtpfSBjc3M9e1tzdHlsZXMuaW1hZ2VDb250YWluZXIoaXNab29tZWQpXX0+XG4gICAgICAgICAgICAgIDxJbWFnZVxuICAgICAgICAgICAgICAgIHNyYz17aW1hZ2VTcmN9XG4gICAgICAgICAgICAgICAgYWx0PXtgQmlsZGUgJHtpICsgMX0gYXYgJHtpbWFnZXMubGVuZ3RofWB9XG4gICAgICAgICAgICAgICAgb2JqZWN0Rml0PVwiY29udGFpblwiXG4gICAgICAgICAgICAgICAgb25DbGljaz17KCkgPT4gc2V0SXNab29tZWQoIWlzWm9vbWVkKX1cbiAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICkpfVxuICAgICAgICA8L0Nhcm91c2VsPlxuICAgICAgPC9kaXY+XG4gICAgPC9kaXY+XG4gIClcbn1cbmV4cG9ydCBkZWZhdWx0IEltYWdlVmlld2VyXG4iXX0= */"],
34089
34175
  children: jsxRuntime.jsx(Image, {
34090
34176
  src: imageSrc,
34091
- alt: "bilde",
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
  };
@@ -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
- export default {
4
+ const meta = {
6
5
  title: 'Core/Button',
7
6
  component: Button
8
7
  };
8
+ export default meta;
9
9
  export const Default = {
10
- render: () => /*#__PURE__*/_jsx(Button, {
11
- children: "Standard button"
12
- }),
10
+ args: {
11
+ children: 'Standard button'
12
+ },
13
13
  name: 'Default'
14
14
  };
15
15
  export const IconBefore = {
16
- render: () => /*#__PURE__*/_jsx(Button, {
16
+ args: {
17
17
  beforeIcon: /*#__PURE__*/_jsx(IconCaretDown, {}),
18
- children: "Standard button"
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
- render: () => /*#__PURE__*/_jsx(Button, {
26
+ args: {
24
27
  afterIcon: /*#__PURE__*/_jsx(IconCaretDown, {}),
25
- children: "Standard button"
26
- }),
28
+ children: 'Standard button'
29
+ },
27
30
  name: 'Icon after'
28
31
  };
29
32
  export const Success = {
30
- render: () => /*#__PURE__*/_jsx(Button, {
33
+ args: {
31
34
  success: true,
32
- children: "Success button"
33
- }),
35
+ children: 'Success button'
36
+ },
34
37
  name: 'Success'
35
38
  };
36
39
  export const Danger = {
37
- render: () => /*#__PURE__*/_jsx(Button, {
40
+ args: {
38
41
  danger: true,
39
- children: "Danger button"
40
- }),
42
+ children: 'Danger button'
43
+ },
41
44
  name: 'Danger'
42
45
  };
43
46
  export const Loading = {
44
- render: () => /*#__PURE__*/_jsx(Button, {
47
+ args: {
45
48
  loading: true,
46
- children: "Loading button"
47
- }),
49
+ children: 'Loading button'
50
+ },
48
51
  name: 'Loading'
49
52
  };
50
53
  export const Disabled = {
51
- render: () => /*#__PURE__*/_jsx(Button, {
54
+ args: {
52
55
  disabled: true,
53
- children: "Disabled button"
54
- }),
56
+ children: 'Disabled button'
57
+ },
55
58
  name: 'Disabled'
56
59
  };
57
60
  export const Highlighted = {
58
- render: () => /*#__PURE__*/_jsx(Button, {
61
+ args: {
59
62
  highlight: true,
60
- children: "Hightlighted button"
61
- }),
63
+ children: 'Hightlighted button'
64
+ },
62
65
  name: 'Highlighted'
63
66
  };
64
67
  export const OutlineHighlighted = {
65
- render: () => /*#__PURE__*/_jsx(Button, {
68
+ args: {
66
69
  highlight: true,
67
70
  outline: true,
68
- children: "Hightlighted outline button"
69
- }),
71
+ children: 'Hightlighted outline button'
72
+ },
70
73
  name: 'Outline highlighted'
71
74
  };
72
75
  export const Back = {
73
- render: () => /*#__PURE__*/_jsx(Button, {
76
+ args: {
74
77
  back: true,
75
- children: "Go back"
76
- }),
78
+ children: 'Go back'
79
+ },
77
80
  name: 'Back'
78
81
  };
79
82
  export const Small = {
80
- render: () => /*#__PURE__*/_jsx(Button, {
83
+ args: {
81
84
  small: true,
82
- children: "Small"
83
- }),
85
+ children: 'Small button'
86
+ },
84
87
  name: 'Small'
85
88
  };
86
89
  export const DangerOutline = {
87
- render: () => /*#__PURE__*/_jsx(Button, {
90
+ args: {
88
91
  danger: true,
89
92
  outline: true,
90
- children: "Danger outline"
91
- }),
93
+ children: 'Danger outline'
94
+ },
92
95
  name: 'Danger outline'
93
96
  };
94
97
  export const TransparentBackground = {
95
- render: () => /*#__PURE__*/_jsx(Button, {
98
+ args: {
96
99
  outline: true,
97
100
  transparentBg: true,
98
- children: "Danger outline"
99
- }),
101
+ children: 'Danger outline'
102
+ },
100
103
  name: 'Transparent background'
101
104
  };
102
105
  export const NoStyle = {
103
- render: () => /*#__PURE__*/_jsx(Button, {
106
+ args: {
104
107
  nostyle: true,
105
- focusable: true,
106
- children: /*#__PURE__*/_jsx(IconEdit, {})
107
- }),
108
+ children: 'No style'
109
+ },
108
110
  name: 'No style'
109
111
  };
110
112
  export const EventKeyPresses = {
111
- render: () => /*#__PURE__*/_jsx(Button, {
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: "Actionlistener button"
119
- }),
120
+ children: 'Actionlistener button'
121
+ },
120
122
  name: 'Event key presses'
121
123
  };
@@ -3,10 +3,10 @@ import React from 'react';
3
3
  import { styles } from './styles';
4
4
  import { Key } from '../../enums/Keyboard';
5
5
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
6
- const Card = ({
6
+ const Card = /*#__PURE__*/React.forwardRef(({
7
7
  className,
8
8
  ...props
9
- }) => {
9
+ }, ref) => {
10
10
  const handleOnKeyPress = e => {
11
11
  if (e.key === Key.enter || e.key === Key.space) {
12
12
  if (props.onClick) {
@@ -15,6 +15,7 @@ const Card = ({
15
15
  }
16
16
  };
17
17
  return _jsx("div", {
18
+ ref: ref,
18
19
  css: theme => [styles.default(theme), props.shadow && styles.shadow(theme), props.withhover && styles.withHover(theme), props.primary && styles.primary(theme), props.gray && styles.gray, props.noPadding && styles.noPadding, props.height && styles.height(props.height), props.nobackground && styles.nobackground, props.largePadding && styles.largePadding, props.overflowvisible && styles.overflowvisible, props.css && props.css],
19
20
  tabIndex: props.onClick ? 0 : undefined,
20
21
  onClick: props.onClick,
@@ -23,5 +24,5 @@ const Card = ({
23
24
  ...props,
24
25
  children: props.children
25
26
  });
26
- };
27
+ });
27
28
  export default Card;