@arbeidstilsynet/design-react 0.3.0 → 0.3.2

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/index.cjs CHANGED
@@ -86,7 +86,7 @@ function requireReactJsxRuntime_development() {
86
86
  case REACT_PORTAL_TYPE:
87
87
  return "Portal";
88
88
  case REACT_CONTEXT_TYPE:
89
- return (type.displayName || "Context") + ".Provider";
89
+ return type.displayName || "Context";
90
90
  case REACT_CONSUMER_TYPE:
91
91
  return (type._context.displayName || "Context") + ".Consumer";
92
92
  case REACT_FORWARD_REF_TYPE:
@@ -174,8 +174,8 @@ function requireReactJsxRuntime_development() {
174
174
  componentName = this.props.ref;
175
175
  return void 0 !== componentName ? componentName : null;
176
176
  }
177
- function ReactElement(type, key, self, source, owner, props, debugStack, debugTask) {
178
- self = props.ref;
177
+ function ReactElement(type, key, props, owner, debugStack, debugTask) {
178
+ var refProp = props.ref;
179
179
  type = {
180
180
  $$typeof: REACT_ELEMENT_TYPE,
181
181
  type,
@@ -183,7 +183,7 @@ function requireReactJsxRuntime_development() {
183
183
  props,
184
184
  _owner: owner
185
185
  };
186
- null !== (void 0 !== self ? self : null) ? Object.defineProperty(type, "ref", {
186
+ null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
187
187
  enumerable: false,
188
188
  get: elementRefGetterWithDeprecationWarning
189
189
  }) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
@@ -215,7 +215,7 @@ function requireReactJsxRuntime_development() {
215
215
  Object.freeze && (Object.freeze(type.props), Object.freeze(type));
216
216
  return type;
217
217
  }
218
- function jsxDEVImpl(type, config, maybeKey, isStaticChildren, source, self, debugStack, debugTask) {
218
+ function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) {
219
219
  var children = config.children;
220
220
  if (void 0 !== children)
221
221
  if (isStaticChildren)
@@ -257,19 +257,19 @@ function requireReactJsxRuntime_development() {
257
257
  return ReactElement(
258
258
  type,
259
259
  children,
260
- self,
261
- source,
262
- getOwner(),
263
260
  maybeKey,
261
+ getOwner(),
264
262
  debugStack,
265
263
  debugTask
266
264
  );
267
265
  }
268
266
  function validateChildKeys(node) {
269
- "object" === typeof node && null !== node && node.$$typeof === REACT_ELEMENT_TYPE && node._store && (node._store.validated = 1);
267
+ isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
270
268
  }
271
- var React = require$$0, REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler");
272
- var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
269
+ function isValidElement(object) {
270
+ return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
271
+ }
272
+ var React = require$$0, REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
273
273
  return null;
274
274
  };
275
275
  React = {
@@ -286,28 +286,24 @@ function requireReactJsxRuntime_development() {
286
286
  var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
287
287
  var didWarnAboutKeySpread = {};
288
288
  reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
289
- reactJsxRuntime_development.jsx = function(type, config, maybeKey, source, self) {
289
+ reactJsxRuntime_development.jsx = function(type, config, maybeKey) {
290
290
  var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
291
291
  return jsxDEVImpl(
292
292
  type,
293
293
  config,
294
294
  maybeKey,
295
295
  false,
296
- source,
297
- self,
298
296
  trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
299
297
  trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
300
298
  );
301
299
  };
302
- reactJsxRuntime_development.jsxs = function(type, config, maybeKey, source, self) {
300
+ reactJsxRuntime_development.jsxs = function(type, config, maybeKey) {
303
301
  var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
304
302
  return jsxDEVImpl(
305
303
  type,
306
304
  config,
307
305
  maybeKey,
308
306
  true,
309
- source,
310
- self,
311
307
  trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
312
308
  trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
313
309
  );
@@ -401,7 +397,7 @@ const FilePickerContext = require$$0.createContext({
401
397
  }
402
398
  });
403
399
  function FilePicker$1(t0) {
404
- const $ = compilerRuntimeExports.c(28);
400
+ const $ = compilerRuntimeExports.c(29);
405
401
  let children;
406
402
  let className;
407
403
  let errors;
@@ -488,33 +484,35 @@ function FilePicker$1(t0) {
488
484
  t5 = $[22];
489
485
  }
490
486
  let t6;
491
- if ($[23] !== ref || $[24] !== rest || $[25] !== t3 || $[26] !== t5) {
492
- t6 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref, className: t3, ...rest, children: t5 });
493
- $[23] = ref;
494
- $[24] = rest;
495
- $[25] = t3;
496
- $[26] = t5;
497
- $[27] = t6;
487
+ if ($[23] !== disabled || $[24] !== ref || $[25] !== rest || $[26] !== t3 || $[27] !== t5) {
488
+ t6 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref, className: t3, "data-disabled": disabled, ...rest, children: t5 });
489
+ $[23] = disabled;
490
+ $[24] = ref;
491
+ $[25] = rest;
492
+ $[26] = t3;
493
+ $[27] = t5;
494
+ $[28] = t6;
498
495
  } else {
499
- t6 = $[27];
496
+ t6 = $[28];
500
497
  }
501
498
  return t6;
502
499
  }
503
500
  function DefaultLabel(t0) {
504
- const $ = compilerRuntimeExports.c(10);
501
+ const $ = compilerRuntimeExports.c(11);
505
502
  const {
506
503
  defaultLabelText
507
504
  } = t0;
508
505
  const text1 = defaultLabelText?.[0];
509
506
  const text2 = defaultLabelText?.[1];
507
+ const text3 = defaultLabelText?.[2];
510
508
  let t1;
511
509
  let t2;
512
510
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
513
- t1 = {
511
+ t1 = /* @__PURE__ */ jsxRuntimeExports.jsx(akselIcons.CloudUpIcon, { title: "Cloud" });
512
+ t2 = {
514
513
  display: "flex",
515
514
  flexFlow: "row"
516
515
  };
517
- t2 = /* @__PURE__ */ jsxRuntimeExports.jsx(akselIcons.CloudUpIcon, { title: "Cloud" });
518
516
  $[0] = t1;
519
517
  $[1] = t2;
520
518
  } else {
@@ -531,40 +529,42 @@ function DefaultLabel(t0) {
531
529
  t3 = $[2];
532
530
  }
533
531
  let t4;
534
- if ($[3] !== text1) {
535
- t4 = /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { style: t1, children: [
536
- t2,
537
- /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Label, { style: t3, children: text1 })
538
- ] });
539
- $[3] = text1;
532
+ if ($[3] !== text2) {
533
+ t4 = /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: t3, children: text2 });
534
+ $[3] = text2;
540
535
  $[4] = t4;
541
536
  } else {
542
537
  t4 = $[4];
543
538
  }
544
539
  let t5;
545
- if ($[5] !== text2) {
546
- t5 = text2 && /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Label, { children: text2 });
547
- $[5] = text2;
548
- $[6] = t5;
540
+ if ($[5] !== t4 || $[6] !== text1) {
541
+ t5 = /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { style: t2, children: [
542
+ text1,
543
+ t4
544
+ ] });
545
+ $[5] = t4;
546
+ $[6] = text1;
547
+ $[7] = t5;
549
548
  } else {
550
- t5 = $[6];
549
+ t5 = $[7];
551
550
  }
552
551
  let t6;
553
- if ($[7] !== t4 || $[8] !== t5) {
552
+ if ($[8] !== t5 || $[9] !== text3) {
554
553
  t6 = /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
555
- t4,
556
- t5
554
+ t1,
555
+ t5,
556
+ text3
557
557
  ] });
558
- $[7] = t4;
559
558
  $[8] = t5;
560
- $[9] = t6;
559
+ $[9] = text3;
560
+ $[10] = t6;
561
561
  } else {
562
- t6 = $[9];
562
+ t6 = $[10];
563
563
  }
564
564
  return t6;
565
565
  }
566
566
  function FilePickerDropzone(t0) {
567
- const $ = compilerRuntimeExports.c(34);
567
+ const $ = compilerRuntimeExports.c(37);
568
568
  const {
569
569
  className,
570
570
  label,
@@ -574,7 +574,7 @@ function FilePickerDropzone(t0) {
574
574
  } = t0;
575
575
  let t3;
576
576
  if ($[0] !== t1) {
577
- t3 = t1 === void 0 ? ["Last opp fil", "Filformater: pdf, txt og docx"] : t1;
577
+ t3 = t1 === void 0 ? ["Dra og slipp eller", "Last opp fil", "Filformater: pdf, txt og docx"] : t1;
578
578
  $[0] = t1;
579
579
  $[1] = t3;
580
580
  } else {
@@ -585,7 +585,8 @@ function FilePickerDropzone(t0) {
585
585
  const {
586
586
  onAdd,
587
587
  disabled,
588
- isWaiting
588
+ isWaiting,
589
+ errors
589
590
  } = require$$0.use(FilePickerContext);
590
591
  const isDisabled = Boolean(disabled || isWaiting);
591
592
  let t4;
@@ -619,99 +620,109 @@ function FilePickerDropzone(t0) {
619
620
  isDragActive,
620
621
  open
621
622
  } = reactDropzone.useDropzone(t5);
622
- const t6 = getRootProps({
623
+ let t6;
624
+ if ($[7] !== dropLabel) {
625
+ t6 = typeof dropLabel === "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: {
626
+ textDecoration: "underline"
627
+ }, children: dropLabel }) : dropLabel;
628
+ $[7] = dropLabel;
629
+ $[8] = t6;
630
+ } else {
631
+ t6 = $[8];
632
+ }
633
+ const dragNode = t6;
634
+ const t7 = getRootProps({
623
635
  role: "group",
624
636
  "aria-disabled": isDisabled || void 0,
625
- className: clsx("at-filepicker-dropzone-wrapper", isDisabled && "is-disabled", className),
637
+ className: clsx("at-filepicker-dropzone-wrapper", className),
626
638
  ...rest
627
639
  });
628
- let t7;
629
- if ($[7] !== getInputProps) {
630
- t7 = getInputProps();
631
- $[7] = getInputProps;
632
- $[8] = t7;
633
- } else {
634
- t7 = $[8];
635
- }
636
640
  let t8;
637
- if ($[9] !== t7) {
638
- t8 = /* @__PURE__ */ jsxRuntimeExports.jsx("input", { ...t7, "aria-hidden": true });
639
- $[9] = t7;
641
+ if ($[9] !== getInputProps) {
642
+ t8 = getInputProps();
643
+ $[9] = getInputProps;
640
644
  $[10] = t8;
641
645
  } else {
642
646
  t8 = $[10];
643
647
  }
644
- const t9 = isDragActive && "is-drag";
648
+ let t9;
649
+ if ($[11] !== t8) {
650
+ t9 = /* @__PURE__ */ jsxRuntimeExports.jsx("input", { ...t8, "aria-hidden": true });
651
+ $[11] = t8;
652
+ $[12] = t9;
653
+ } else {
654
+ t9 = $[12];
655
+ }
645
656
  let t10;
646
- if ($[11] !== t9) {
647
- t10 = clsx("at-filepicker-dropzone", t9);
648
- $[11] = t9;
649
- $[12] = t10;
657
+ if ($[13] !== isWaiting) {
658
+ t10 = isWaiting && /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Spinner, { "aria-label": "Processing files", "data-size": "lg" });
659
+ $[13] = isWaiting;
660
+ $[14] = t10;
650
661
  } else {
651
- t10 = $[12];
662
+ t10 = $[14];
652
663
  }
653
- let t11;
654
- if ($[13] !== isDisabled || $[14] !== open) {
655
- t11 = () => {
664
+ const t11 = isDragActive && "is-drag";
665
+ const t12 = errors && errors.length > 0 && "has-error";
666
+ let t13;
667
+ if ($[15] !== t11 || $[16] !== t12) {
668
+ t13 = clsx("at-filepicker-dropzone", t11, t12);
669
+ $[15] = t11;
670
+ $[16] = t12;
671
+ $[17] = t13;
672
+ } else {
673
+ t13 = $[17];
674
+ }
675
+ let t14;
676
+ if ($[18] !== isDisabled || $[19] !== open) {
677
+ t14 = () => {
656
678
  if (!isDisabled) {
657
679
  open();
658
680
  }
659
681
  };
660
- $[13] = isDisabled;
661
- $[14] = open;
662
- $[15] = t11;
663
- } else {
664
- t11 = $[15];
665
- }
666
- let t12;
667
- if ($[16] !== isWaiting) {
668
- t12 = isWaiting && /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Spinner, { "aria-label": "Processing files", "data-size": "lg" });
669
- $[16] = isWaiting;
670
- $[17] = t12;
682
+ $[18] = isDisabled;
683
+ $[19] = open;
684
+ $[20] = t14;
671
685
  } else {
672
- t12 = $[17];
686
+ t14 = $[20];
673
687
  }
674
- let t13;
675
- if ($[18] !== defaultLabelText || $[19] !== dropLabel || $[20] !== isDragActive || $[21] !== isWaiting || $[22] !== label) {
676
- t13 = !isWaiting && (isDragActive ? /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Label, { children: dropLabel }) : label ?? /* @__PURE__ */ jsxRuntimeExports.jsx(DefaultLabel, { defaultLabelText }));
677
- $[18] = defaultLabelText;
678
- $[19] = dropLabel;
679
- $[20] = isDragActive;
680
- $[21] = isWaiting;
681
- $[22] = label;
682
- $[23] = t13;
688
+ let t15;
689
+ if ($[21] !== defaultLabelText || $[22] !== dragNode || $[23] !== isDragActive || $[24] !== isWaiting || $[25] !== label) {
690
+ t15 = !isWaiting && (isDragActive ? dragNode : label ?? /* @__PURE__ */ jsxRuntimeExports.jsx(DefaultLabel, { defaultLabelText }));
691
+ $[21] = defaultLabelText;
692
+ $[22] = dragNode;
693
+ $[23] = isDragActive;
694
+ $[24] = isWaiting;
695
+ $[25] = label;
696
+ $[26] = t15;
683
697
  } else {
684
- t13 = $[23];
698
+ t15 = $[26];
685
699
  }
686
- let t14;
687
- if ($[24] !== isDisabled || $[25] !== t10 || $[26] !== t11 || $[27] !== t12 || $[28] !== t13) {
688
- t14 = /* @__PURE__ */ jsxRuntimeExports.jsxs(designsystemetReact.Button, { type: "button", disabled: isDisabled, className: t10, onClick: t11, children: [
689
- t12,
690
- t13
691
- ] });
692
- $[24] = isDisabled;
693
- $[25] = t10;
694
- $[26] = t11;
695
- $[27] = t12;
696
- $[28] = t13;
697
- $[29] = t14;
700
+ let t16;
701
+ if ($[27] !== isDisabled || $[28] !== t10 || $[29] !== t13 || $[30] !== t14 || $[31] !== t15) {
702
+ t16 = /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Button, { type: "button", disabled: isDisabled, loading: t10, className: t13, onClick: t14, children: t15 });
703
+ $[27] = isDisabled;
704
+ $[28] = t10;
705
+ $[29] = t13;
706
+ $[30] = t14;
707
+ $[31] = t15;
708
+ $[32] = t16;
698
709
  } else {
699
- t14 = $[29];
710
+ t16 = $[32];
700
711
  }
701
- let t15;
702
- if ($[30] !== t14 || $[31] !== t6 || $[32] !== t8) {
703
- t15 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ...t6, children: [
704
- t8,
705
- t14
712
+ let t17;
713
+ if ($[33] !== t16 || $[34] !== t7 || $[35] !== t9) {
714
+ t17 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ...t7, children: [
715
+ t9,
716
+ t16
706
717
  ] });
707
- $[30] = t14;
708
- $[31] = t6;
709
- $[32] = t8;
710
- $[33] = t15;
718
+ $[33] = t16;
719
+ $[34] = t7;
720
+ $[35] = t9;
721
+ $[36] = t17;
711
722
  } else {
712
- t15 = $[33];
723
+ t17 = $[36];
713
724
  }
714
- return t15;
725
+ return t17;
715
726
  }
716
727
  function FilePickerErrors(t0) {
717
728
  const $ = compilerRuntimeExports.c(11);
@@ -753,7 +764,7 @@ function FilePickerErrors(t0) {
753
764
  }
754
765
  let t3;
755
766
  if ($[7] !== rest || $[8] !== t1 || $[9] !== t2) {
756
- t3 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: t1, ...rest, children: t2 });
767
+ t3 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: t1, role: "status", ...rest, children: t2 });
757
768
  $[7] = rest;
758
769
  $[8] = t1;
759
770
  $[9] = t2;
@@ -764,7 +775,7 @@ function FilePickerErrors(t0) {
764
775
  return t3;
765
776
  }
766
777
  function _temp$1(error, index) {
767
- return /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Alert, { role: "alert", "data-color": "danger", "data-size": "sm", children: error }, index);
778
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.ValidationMessage, { children: error }, index);
768
779
  }
769
780
  function formatFileSize(bytes) {
770
781
  if (bytes === 0) return "0 Bytes";
@@ -774,21 +785,39 @@ function formatFileSize(bytes) {
774
785
  return parseFloat((bytes / Math.pow(k, i)).toFixed(1)) + " " + sizes[i];
775
786
  }
776
787
  function FilePickerFiles(t0) {
777
- const $ = compilerRuntimeExports.c(16);
788
+ const $ = compilerRuntimeExports.c(38);
778
789
  let className;
779
790
  let rest;
791
+ let t1;
792
+ let t2;
780
793
  if ($[0] !== t0) {
781
794
  ({
782
795
  className,
796
+ columnNames: t1,
797
+ removeButtonLabel: t2,
783
798
  ...rest
784
799
  } = t0);
785
800
  $[0] = t0;
786
801
  $[1] = className;
787
802
  $[2] = rest;
803
+ $[3] = t1;
804
+ $[4] = t2;
788
805
  } else {
789
806
  className = $[1];
790
807
  rest = $[2];
808
+ t1 = $[3];
809
+ t2 = $[4];
810
+ }
811
+ let t3;
812
+ if ($[5] !== t1) {
813
+ t3 = t1 === void 0 ? ["Navn", "Størrelse", ""] : t1;
814
+ $[5] = t1;
815
+ $[6] = t3;
816
+ } else {
817
+ t3 = $[6];
791
818
  }
819
+ const columnNames = t3;
820
+ const removeButtonLabel = t2 === void 0 ? "Fjern" : t2;
792
821
  const {
793
822
  files,
794
823
  onRemove,
@@ -797,63 +826,123 @@ function FilePickerFiles(t0) {
797
826
  if (!files?.length) {
798
827
  return null;
799
828
  }
800
- let t1;
801
- if ($[3] !== className) {
802
- t1 = clsx("at-filepicker-files", className);
803
- $[3] = className;
804
- $[4] = t1;
829
+ let t4;
830
+ if ($[7] !== className) {
831
+ t4 = clsx("at-filepicker-files-table", className);
832
+ $[7] = className;
833
+ $[8] = t4;
805
834
  } else {
806
- t1 = $[4];
835
+ t4 = $[8];
807
836
  }
808
- let t2;
809
- if ($[5] !== disabled || $[6] !== files || $[7] !== onRemove) {
810
- let t32;
811
- if ($[9] !== disabled || $[10] !== onRemove) {
812
- t32 = (t4) => {
837
+ let t5;
838
+ if ($[9] !== columnNames[0]) {
839
+ t5 = /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Table.HeaderCell, { title: columnNames[0], children: columnNames[0] });
840
+ $[9] = columnNames[0];
841
+ $[10] = t5;
842
+ } else {
843
+ t5 = $[10];
844
+ }
845
+ let t6;
846
+ if ($[11] !== columnNames[1]) {
847
+ t6 = /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Table.HeaderCell, { title: columnNames[1], children: columnNames[1] });
848
+ $[11] = columnNames[1];
849
+ $[12] = t6;
850
+ } else {
851
+ t6 = $[12];
852
+ }
853
+ let t7;
854
+ if ($[13] !== columnNames[2]) {
855
+ t7 = columnNames[2] || /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ds-sr-only", children: "Action" });
856
+ $[13] = columnNames[2];
857
+ $[14] = t7;
858
+ } else {
859
+ t7 = $[14];
860
+ }
861
+ let t8;
862
+ if ($[15] !== columnNames[2] || $[16] !== t7) {
863
+ t8 = /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Table.HeaderCell, { title: columnNames[2], children: t7 });
864
+ $[15] = columnNames[2];
865
+ $[16] = t7;
866
+ $[17] = t8;
867
+ } else {
868
+ t8 = $[17];
869
+ }
870
+ let t9;
871
+ if ($[18] !== t5 || $[19] !== t6 || $[20] !== t8) {
872
+ t9 = /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Table.Head, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(designsystemetReact.Table.Row, { children: [
873
+ t5,
874
+ t6,
875
+ t8
876
+ ] }) });
877
+ $[18] = t5;
878
+ $[19] = t6;
879
+ $[20] = t8;
880
+ $[21] = t9;
881
+ } else {
882
+ t9 = $[21];
883
+ }
884
+ let t10;
885
+ if ($[22] !== disabled || $[23] !== files || $[24] !== onRemove || $[25] !== removeButtonLabel) {
886
+ let t112;
887
+ if ($[27] !== disabled || $[28] !== onRemove || $[29] !== removeButtonLabel) {
888
+ t112 = (t122) => {
813
889
  const {
814
890
  id,
815
891
  file,
816
- error
817
- } = t4;
818
- return /* @__PURE__ */ jsxRuntimeExports.jsx(require$$0.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "at-filepicker-file", children: [
819
- /* @__PURE__ */ jsxRuntimeExports.jsx(akselIcons.FileIcon, { "aria-hidden": "true", fontSize: "1.5em" }),
820
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "at-filepicker-file__content", children: [
821
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "at-filepicker-file__name", title: file.name, children: file.name }),
822
- error && /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.ValidationMessage, { className: "at-filepicker-file__error", "data-color": "danger", "data-size": "sm", title: error, children: error })
823
- ] }),
824
- /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "at-filepicker-file__size", "data-size": "sm", children: [
825
- "(",
826
- formatFileSize(file.size),
827
- ")"
828
- ] }),
829
- /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Button, { icon: true, variant: "tertiary", "data-size": "sm", onClick: () => onRemove(id), disabled, "aria-label": `Remove ${file.name}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(akselIcons.XMarkIcon, { "aria-hidden": true }) })
830
- ] }) }, id);
892
+ hasError
893
+ } = t122;
894
+ const size = formatFileSize(file.size);
895
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(designsystemetReact.Table.Row, { "data-error": hasError, children: [
896
+ /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Table.Cell, { title: file.name, className: "at-filepicker-files-file__name", "data-color": "info", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(designsystemetReact.Link, { href: disabled ? void 0 : URL.createObjectURL(file), target: "_blank", rel: "noreferrer", "aria-disabled": disabled, children: [
897
+ /* @__PURE__ */ jsxRuntimeExports.jsx(akselIcons.FileTextIcon, { "aria-hidden": "true", fontSize: "1.5em" }),
898
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "at-filepicker-files-file__text", children: file.name })
899
+ ] }) }),
900
+ /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Table.Cell, { title: size, children: size }),
901
+ /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Table.Cell, { "data-color": "danger", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(designsystemetReact.Button, { variant: "tertiary", "data-size": "sm", disabled, "aria-label": `Remove ${file.name}`, onClick: () => onRemove(id), children: [
902
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "at-filepicker-files-file__remove-text", children: removeButtonLabel }),
903
+ /* @__PURE__ */ jsxRuntimeExports.jsx(akselIcons.TrashIcon, { "aria-hidden": true })
904
+ ] }) })
905
+ ] }, id);
831
906
  };
832
- $[9] = disabled;
833
- $[10] = onRemove;
834
- $[11] = t32;
907
+ $[27] = disabled;
908
+ $[28] = onRemove;
909
+ $[29] = removeButtonLabel;
910
+ $[30] = t112;
835
911
  } else {
836
- t32 = $[11];
912
+ t112 = $[30];
837
913
  }
838
- t2 = files.map(t32);
839
- $[5] = disabled;
840
- $[6] = files;
841
- $[7] = onRemove;
842
- $[8] = t2;
914
+ t10 = files.map(t112);
915
+ $[22] = disabled;
916
+ $[23] = files;
917
+ $[24] = onRemove;
918
+ $[25] = removeButtonLabel;
919
+ $[26] = t10;
843
920
  } else {
844
- t2 = $[8];
921
+ t10 = $[26];
845
922
  }
846
- let t3;
847
- if ($[12] !== rest || $[13] !== t1 || $[14] !== t2) {
848
- t3 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: t1, ...rest, children: t2 });
849
- $[12] = rest;
850
- $[13] = t1;
851
- $[14] = t2;
852
- $[15] = t3;
923
+ let t11;
924
+ if ($[31] !== t10) {
925
+ t11 = /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Table.Body, { children: t10 });
926
+ $[31] = t10;
927
+ $[32] = t11;
853
928
  } else {
854
- t3 = $[15];
929
+ t11 = $[32];
855
930
  }
856
- return t3;
931
+ let t12;
932
+ if ($[33] !== rest || $[34] !== t11 || $[35] !== t4 || $[36] !== t9) {
933
+ t12 = /* @__PURE__ */ jsxRuntimeExports.jsxs(designsystemetReact.Table, { className: t4, ...rest, children: [
934
+ t9,
935
+ t11
936
+ ] });
937
+ $[33] = rest;
938
+ $[34] = t11;
939
+ $[35] = t4;
940
+ $[36] = t9;
941
+ $[37] = t12;
942
+ } else {
943
+ t12 = $[37];
944
+ }
945
+ return t12;
857
946
  }
858
947
  const FilePicker = Object.assign(FilePicker$1, {
859
948
  Dropzone: FilePickerDropzone,