@arbeidstilsynet/design-react 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +241 -148
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +249 -156
- package/dist/index.js.map +1 -1
- package/dist/src/components/filepicker/filepickerDropzone.d.ts +14 -6
- package/dist/src/components/filepicker/filepickerErrors.d.ts +3 -0
- package/dist/src/components/filepicker/filepickerFiles.d.ts +13 -2
- package/dist/src/components/filepicker/index.d.ts +4 -3
- package/dist/src/components/filepicker/types.d.ts +2 -2
- package/dist/src/docs-components/CssVariables.d.ts +5 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/types.d.ts +1 -0
- package/package.json +17 -13
package/dist/index.cjs
CHANGED
|
@@ -401,7 +401,7 @@ const FilePickerContext = require$$0.createContext({
|
|
|
401
401
|
}
|
|
402
402
|
});
|
|
403
403
|
function FilePicker$1(t0) {
|
|
404
|
-
const $ = compilerRuntimeExports.c(
|
|
404
|
+
const $ = compilerRuntimeExports.c(29);
|
|
405
405
|
let children;
|
|
406
406
|
let className;
|
|
407
407
|
let errors;
|
|
@@ -488,33 +488,35 @@ function FilePicker$1(t0) {
|
|
|
488
488
|
t5 = $[22];
|
|
489
489
|
}
|
|
490
490
|
let t6;
|
|
491
|
-
if ($[23] !==
|
|
492
|
-
t6 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref, className: t3, ...rest, children: t5 });
|
|
493
|
-
$[23] =
|
|
494
|
-
$[24] =
|
|
495
|
-
$[25] =
|
|
496
|
-
$[26] =
|
|
497
|
-
$[27] =
|
|
491
|
+
if ($[23] !== disabled || $[24] !== ref || $[25] !== rest || $[26] !== t3 || $[27] !== t5) {
|
|
492
|
+
t6 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref, className: t3, "data-disabled": disabled, ...rest, children: t5 });
|
|
493
|
+
$[23] = disabled;
|
|
494
|
+
$[24] = ref;
|
|
495
|
+
$[25] = rest;
|
|
496
|
+
$[26] = t3;
|
|
497
|
+
$[27] = t5;
|
|
498
|
+
$[28] = t6;
|
|
498
499
|
} else {
|
|
499
|
-
t6 = $[
|
|
500
|
+
t6 = $[28];
|
|
500
501
|
}
|
|
501
502
|
return t6;
|
|
502
503
|
}
|
|
503
504
|
function DefaultLabel(t0) {
|
|
504
|
-
const $ = compilerRuntimeExports.c(
|
|
505
|
+
const $ = compilerRuntimeExports.c(11);
|
|
505
506
|
const {
|
|
506
507
|
defaultLabelText
|
|
507
508
|
} = t0;
|
|
508
509
|
const text1 = defaultLabelText?.[0];
|
|
509
510
|
const text2 = defaultLabelText?.[1];
|
|
511
|
+
const text3 = defaultLabelText?.[2];
|
|
510
512
|
let t1;
|
|
511
513
|
let t2;
|
|
512
514
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
513
|
-
t1 = {
|
|
515
|
+
t1 = /* @__PURE__ */ jsxRuntimeExports.jsx(akselIcons.CloudUpIcon, { title: "Cloud" });
|
|
516
|
+
t2 = {
|
|
514
517
|
display: "flex",
|
|
515
518
|
flexFlow: "row"
|
|
516
519
|
};
|
|
517
|
-
t2 = /* @__PURE__ */ jsxRuntimeExports.jsx(akselIcons.CloudUpIcon, { title: "Cloud" });
|
|
518
520
|
$[0] = t1;
|
|
519
521
|
$[1] = t2;
|
|
520
522
|
} else {
|
|
@@ -531,40 +533,42 @@ function DefaultLabel(t0) {
|
|
|
531
533
|
t3 = $[2];
|
|
532
534
|
}
|
|
533
535
|
let t4;
|
|
534
|
-
if ($[3] !==
|
|
535
|
-
t4 = /* @__PURE__ */ jsxRuntimeExports.
|
|
536
|
-
|
|
537
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Label, { style: t3, children: text1 })
|
|
538
|
-
] });
|
|
539
|
-
$[3] = text1;
|
|
536
|
+
if ($[3] !== text2) {
|
|
537
|
+
t4 = /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: t3, children: text2 });
|
|
538
|
+
$[3] = text2;
|
|
540
539
|
$[4] = t4;
|
|
541
540
|
} else {
|
|
542
541
|
t4 = $[4];
|
|
543
542
|
}
|
|
544
543
|
let t5;
|
|
545
|
-
if ($[5] !==
|
|
546
|
-
t5 =
|
|
547
|
-
|
|
548
|
-
|
|
544
|
+
if ($[5] !== t4 || $[6] !== text1) {
|
|
545
|
+
t5 = /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { style: t2, children: [
|
|
546
|
+
text1,
|
|
547
|
+
t4
|
|
548
|
+
] });
|
|
549
|
+
$[5] = t4;
|
|
550
|
+
$[6] = text1;
|
|
551
|
+
$[7] = t5;
|
|
549
552
|
} else {
|
|
550
|
-
t5 = $[
|
|
553
|
+
t5 = $[7];
|
|
551
554
|
}
|
|
552
555
|
let t6;
|
|
553
|
-
if ($[
|
|
556
|
+
if ($[8] !== t5 || $[9] !== text3) {
|
|
554
557
|
t6 = /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
555
|
-
|
|
556
|
-
t5
|
|
558
|
+
t1,
|
|
559
|
+
t5,
|
|
560
|
+
text3
|
|
557
561
|
] });
|
|
558
|
-
$[7] = t4;
|
|
559
562
|
$[8] = t5;
|
|
560
|
-
$[9] =
|
|
563
|
+
$[9] = text3;
|
|
564
|
+
$[10] = t6;
|
|
561
565
|
} else {
|
|
562
|
-
t6 = $[
|
|
566
|
+
t6 = $[10];
|
|
563
567
|
}
|
|
564
568
|
return t6;
|
|
565
569
|
}
|
|
566
570
|
function FilePickerDropzone(t0) {
|
|
567
|
-
const $ = compilerRuntimeExports.c(
|
|
571
|
+
const $ = compilerRuntimeExports.c(37);
|
|
568
572
|
const {
|
|
569
573
|
className,
|
|
570
574
|
label,
|
|
@@ -574,7 +578,7 @@ function FilePickerDropzone(t0) {
|
|
|
574
578
|
} = t0;
|
|
575
579
|
let t3;
|
|
576
580
|
if ($[0] !== t1) {
|
|
577
|
-
t3 = t1 === void 0 ? ["Last opp fil", "Filformater: pdf, txt og docx"] : t1;
|
|
581
|
+
t3 = t1 === void 0 ? ["Dra og slipp eller", "Last opp fil", "Filformater: pdf, txt og docx"] : t1;
|
|
578
582
|
$[0] = t1;
|
|
579
583
|
$[1] = t3;
|
|
580
584
|
} else {
|
|
@@ -585,7 +589,8 @@ function FilePickerDropzone(t0) {
|
|
|
585
589
|
const {
|
|
586
590
|
onAdd,
|
|
587
591
|
disabled,
|
|
588
|
-
isWaiting
|
|
592
|
+
isWaiting,
|
|
593
|
+
errors
|
|
589
594
|
} = require$$0.use(FilePickerContext);
|
|
590
595
|
const isDisabled = Boolean(disabled || isWaiting);
|
|
591
596
|
let t4;
|
|
@@ -619,99 +624,109 @@ function FilePickerDropzone(t0) {
|
|
|
619
624
|
isDragActive,
|
|
620
625
|
open
|
|
621
626
|
} = reactDropzone.useDropzone(t5);
|
|
622
|
-
|
|
627
|
+
let t6;
|
|
628
|
+
if ($[7] !== dropLabel) {
|
|
629
|
+
t6 = typeof dropLabel === "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: {
|
|
630
|
+
textDecoration: "underline"
|
|
631
|
+
}, children: dropLabel }) : dropLabel;
|
|
632
|
+
$[7] = dropLabel;
|
|
633
|
+
$[8] = t6;
|
|
634
|
+
} else {
|
|
635
|
+
t6 = $[8];
|
|
636
|
+
}
|
|
637
|
+
const dragNode = t6;
|
|
638
|
+
const t7 = getRootProps({
|
|
623
639
|
role: "group",
|
|
624
640
|
"aria-disabled": isDisabled || void 0,
|
|
625
|
-
className: clsx("at-filepicker-dropzone-wrapper",
|
|
641
|
+
className: clsx("at-filepicker-dropzone-wrapper", className),
|
|
626
642
|
...rest
|
|
627
643
|
});
|
|
628
|
-
let t7;
|
|
629
|
-
if ($[7] !== getInputProps) {
|
|
630
|
-
t7 = getInputProps();
|
|
631
|
-
$[7] = getInputProps;
|
|
632
|
-
$[8] = t7;
|
|
633
|
-
} else {
|
|
634
|
-
t7 = $[8];
|
|
635
|
-
}
|
|
636
644
|
let t8;
|
|
637
|
-
if ($[9] !==
|
|
638
|
-
t8 =
|
|
639
|
-
$[9] =
|
|
645
|
+
if ($[9] !== getInputProps) {
|
|
646
|
+
t8 = getInputProps();
|
|
647
|
+
$[9] = getInputProps;
|
|
640
648
|
$[10] = t8;
|
|
641
649
|
} else {
|
|
642
650
|
t8 = $[10];
|
|
643
651
|
}
|
|
644
|
-
|
|
652
|
+
let t9;
|
|
653
|
+
if ($[11] !== t8) {
|
|
654
|
+
t9 = /* @__PURE__ */ jsxRuntimeExports.jsx("input", { ...t8, "aria-hidden": true });
|
|
655
|
+
$[11] = t8;
|
|
656
|
+
$[12] = t9;
|
|
657
|
+
} else {
|
|
658
|
+
t9 = $[12];
|
|
659
|
+
}
|
|
645
660
|
let t10;
|
|
646
|
-
if ($[
|
|
647
|
-
t10 =
|
|
648
|
-
$[
|
|
649
|
-
$[
|
|
661
|
+
if ($[13] !== isWaiting) {
|
|
662
|
+
t10 = isWaiting && /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Spinner, { "aria-label": "Processing files", "data-size": "lg" });
|
|
663
|
+
$[13] = isWaiting;
|
|
664
|
+
$[14] = t10;
|
|
650
665
|
} else {
|
|
651
|
-
t10 = $[
|
|
666
|
+
t10 = $[14];
|
|
652
667
|
}
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
668
|
+
const t11 = isDragActive && "is-drag";
|
|
669
|
+
const t12 = errors && errors.length > 0 && "has-error";
|
|
670
|
+
let t13;
|
|
671
|
+
if ($[15] !== t11 || $[16] !== t12) {
|
|
672
|
+
t13 = clsx("at-filepicker-dropzone", t11, t12);
|
|
673
|
+
$[15] = t11;
|
|
674
|
+
$[16] = t12;
|
|
675
|
+
$[17] = t13;
|
|
676
|
+
} else {
|
|
677
|
+
t13 = $[17];
|
|
678
|
+
}
|
|
679
|
+
let t14;
|
|
680
|
+
if ($[18] !== isDisabled || $[19] !== open) {
|
|
681
|
+
t14 = () => {
|
|
656
682
|
if (!isDisabled) {
|
|
657
683
|
open();
|
|
658
684
|
}
|
|
659
685
|
};
|
|
660
|
-
$[
|
|
661
|
-
$[
|
|
662
|
-
$[
|
|
686
|
+
$[18] = isDisabled;
|
|
687
|
+
$[19] = open;
|
|
688
|
+
$[20] = t14;
|
|
663
689
|
} else {
|
|
664
|
-
|
|
690
|
+
t14 = $[20];
|
|
665
691
|
}
|
|
666
|
-
let
|
|
667
|
-
if ($[
|
|
668
|
-
|
|
669
|
-
$[
|
|
670
|
-
$[
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
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;
|
|
692
|
+
let t15;
|
|
693
|
+
if ($[21] !== defaultLabelText || $[22] !== dragNode || $[23] !== isDragActive || $[24] !== isWaiting || $[25] !== label) {
|
|
694
|
+
t15 = !isWaiting && (isDragActive ? dragNode : label ?? /* @__PURE__ */ jsxRuntimeExports.jsx(DefaultLabel, { defaultLabelText }));
|
|
695
|
+
$[21] = defaultLabelText;
|
|
696
|
+
$[22] = dragNode;
|
|
697
|
+
$[23] = isDragActive;
|
|
698
|
+
$[24] = isWaiting;
|
|
699
|
+
$[25] = label;
|
|
700
|
+
$[26] = t15;
|
|
683
701
|
} else {
|
|
684
|
-
|
|
702
|
+
t15 = $[26];
|
|
685
703
|
}
|
|
686
|
-
let
|
|
687
|
-
if ($[
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
]
|
|
692
|
-
$[
|
|
693
|
-
$[
|
|
694
|
-
$[
|
|
695
|
-
$[27] = t12;
|
|
696
|
-
$[28] = t13;
|
|
697
|
-
$[29] = t14;
|
|
704
|
+
let t16;
|
|
705
|
+
if ($[27] !== isDisabled || $[28] !== t10 || $[29] !== t13 || $[30] !== t14 || $[31] !== t15) {
|
|
706
|
+
t16 = /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Button, { type: "button", disabled: isDisabled, loading: t10, className: t13, onClick: t14, children: t15 });
|
|
707
|
+
$[27] = isDisabled;
|
|
708
|
+
$[28] = t10;
|
|
709
|
+
$[29] = t13;
|
|
710
|
+
$[30] = t14;
|
|
711
|
+
$[31] = t15;
|
|
712
|
+
$[32] = t16;
|
|
698
713
|
} else {
|
|
699
|
-
|
|
714
|
+
t16 = $[32];
|
|
700
715
|
}
|
|
701
|
-
let
|
|
702
|
-
if ($[
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
716
|
+
let t17;
|
|
717
|
+
if ($[33] !== t16 || $[34] !== t7 || $[35] !== t9) {
|
|
718
|
+
t17 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ...t7, children: [
|
|
719
|
+
t9,
|
|
720
|
+
t16
|
|
706
721
|
] });
|
|
707
|
-
$[
|
|
708
|
-
$[
|
|
709
|
-
$[
|
|
710
|
-
$[
|
|
722
|
+
$[33] = t16;
|
|
723
|
+
$[34] = t7;
|
|
724
|
+
$[35] = t9;
|
|
725
|
+
$[36] = t17;
|
|
711
726
|
} else {
|
|
712
|
-
|
|
727
|
+
t17 = $[36];
|
|
713
728
|
}
|
|
714
|
-
return
|
|
729
|
+
return t17;
|
|
715
730
|
}
|
|
716
731
|
function FilePickerErrors(t0) {
|
|
717
732
|
const $ = compilerRuntimeExports.c(11);
|
|
@@ -753,7 +768,7 @@ function FilePickerErrors(t0) {
|
|
|
753
768
|
}
|
|
754
769
|
let t3;
|
|
755
770
|
if ($[7] !== rest || $[8] !== t1 || $[9] !== t2) {
|
|
756
|
-
t3 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: t1, ...rest, children: t2 });
|
|
771
|
+
t3 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: t1, role: "status", ...rest, children: t2 });
|
|
757
772
|
$[7] = rest;
|
|
758
773
|
$[8] = t1;
|
|
759
774
|
$[9] = t2;
|
|
@@ -764,7 +779,7 @@ function FilePickerErrors(t0) {
|
|
|
764
779
|
return t3;
|
|
765
780
|
}
|
|
766
781
|
function _temp$1(error, index) {
|
|
767
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.
|
|
782
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.ValidationMessage, { children: error }, index);
|
|
768
783
|
}
|
|
769
784
|
function formatFileSize(bytes) {
|
|
770
785
|
if (bytes === 0) return "0 Bytes";
|
|
@@ -774,21 +789,39 @@ function formatFileSize(bytes) {
|
|
|
774
789
|
return parseFloat((bytes / Math.pow(k, i)).toFixed(1)) + " " + sizes[i];
|
|
775
790
|
}
|
|
776
791
|
function FilePickerFiles(t0) {
|
|
777
|
-
const $ = compilerRuntimeExports.c(
|
|
792
|
+
const $ = compilerRuntimeExports.c(38);
|
|
778
793
|
let className;
|
|
779
794
|
let rest;
|
|
795
|
+
let t1;
|
|
796
|
+
let t2;
|
|
780
797
|
if ($[0] !== t0) {
|
|
781
798
|
({
|
|
782
799
|
className,
|
|
800
|
+
columnNames: t1,
|
|
801
|
+
removeButtonLabel: t2,
|
|
783
802
|
...rest
|
|
784
803
|
} = t0);
|
|
785
804
|
$[0] = t0;
|
|
786
805
|
$[1] = className;
|
|
787
806
|
$[2] = rest;
|
|
807
|
+
$[3] = t1;
|
|
808
|
+
$[4] = t2;
|
|
788
809
|
} else {
|
|
789
810
|
className = $[1];
|
|
790
811
|
rest = $[2];
|
|
812
|
+
t1 = $[3];
|
|
813
|
+
t2 = $[4];
|
|
791
814
|
}
|
|
815
|
+
let t3;
|
|
816
|
+
if ($[5] !== t1) {
|
|
817
|
+
t3 = t1 === void 0 ? ["Navn", "Størrelse", ""] : t1;
|
|
818
|
+
$[5] = t1;
|
|
819
|
+
$[6] = t3;
|
|
820
|
+
} else {
|
|
821
|
+
t3 = $[6];
|
|
822
|
+
}
|
|
823
|
+
const columnNames = t3;
|
|
824
|
+
const removeButtonLabel = t2 === void 0 ? "Fjern" : t2;
|
|
792
825
|
const {
|
|
793
826
|
files,
|
|
794
827
|
onRemove,
|
|
@@ -797,63 +830,123 @@ function FilePickerFiles(t0) {
|
|
|
797
830
|
if (!files?.length) {
|
|
798
831
|
return null;
|
|
799
832
|
}
|
|
800
|
-
let
|
|
801
|
-
if ($[
|
|
802
|
-
|
|
803
|
-
$[
|
|
804
|
-
$[
|
|
833
|
+
let t4;
|
|
834
|
+
if ($[7] !== className) {
|
|
835
|
+
t4 = clsx("at-filepicker-files-table", className);
|
|
836
|
+
$[7] = className;
|
|
837
|
+
$[8] = t4;
|
|
805
838
|
} else {
|
|
806
|
-
|
|
839
|
+
t4 = $[8];
|
|
807
840
|
}
|
|
808
|
-
let
|
|
809
|
-
if ($[
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
841
|
+
let t5;
|
|
842
|
+
if ($[9] !== columnNames[0]) {
|
|
843
|
+
t5 = /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Table.HeaderCell, { title: columnNames[0], children: columnNames[0] });
|
|
844
|
+
$[9] = columnNames[0];
|
|
845
|
+
$[10] = t5;
|
|
846
|
+
} else {
|
|
847
|
+
t5 = $[10];
|
|
848
|
+
}
|
|
849
|
+
let t6;
|
|
850
|
+
if ($[11] !== columnNames[1]) {
|
|
851
|
+
t6 = /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Table.HeaderCell, { title: columnNames[1], children: columnNames[1] });
|
|
852
|
+
$[11] = columnNames[1];
|
|
853
|
+
$[12] = t6;
|
|
854
|
+
} else {
|
|
855
|
+
t6 = $[12];
|
|
856
|
+
}
|
|
857
|
+
let t7;
|
|
858
|
+
if ($[13] !== columnNames[2]) {
|
|
859
|
+
t7 = columnNames[2] || /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ds-sr-only", children: "Action" });
|
|
860
|
+
$[13] = columnNames[2];
|
|
861
|
+
$[14] = t7;
|
|
862
|
+
} else {
|
|
863
|
+
t7 = $[14];
|
|
864
|
+
}
|
|
865
|
+
let t8;
|
|
866
|
+
if ($[15] !== columnNames[2] || $[16] !== t7) {
|
|
867
|
+
t8 = /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Table.HeaderCell, { title: columnNames[2], children: t7 });
|
|
868
|
+
$[15] = columnNames[2];
|
|
869
|
+
$[16] = t7;
|
|
870
|
+
$[17] = t8;
|
|
871
|
+
} else {
|
|
872
|
+
t8 = $[17];
|
|
873
|
+
}
|
|
874
|
+
let t9;
|
|
875
|
+
if ($[18] !== t5 || $[19] !== t6 || $[20] !== t8) {
|
|
876
|
+
t9 = /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Table.Head, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(designsystemetReact.Table.Row, { children: [
|
|
877
|
+
t5,
|
|
878
|
+
t6,
|
|
879
|
+
t8
|
|
880
|
+
] }) });
|
|
881
|
+
$[18] = t5;
|
|
882
|
+
$[19] = t6;
|
|
883
|
+
$[20] = t8;
|
|
884
|
+
$[21] = t9;
|
|
885
|
+
} else {
|
|
886
|
+
t9 = $[21];
|
|
887
|
+
}
|
|
888
|
+
let t10;
|
|
889
|
+
if ($[22] !== disabled || $[23] !== files || $[24] !== onRemove || $[25] !== removeButtonLabel) {
|
|
890
|
+
let t112;
|
|
891
|
+
if ($[27] !== disabled || $[28] !== onRemove || $[29] !== removeButtonLabel) {
|
|
892
|
+
t112 = (t122) => {
|
|
813
893
|
const {
|
|
814
894
|
id,
|
|
815
895
|
file,
|
|
816
|
-
|
|
817
|
-
} =
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
821
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
822
|
-
|
|
823
|
-
] }),
|
|
824
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
")
|
|
828
|
-
] })
|
|
829
|
-
|
|
830
|
-
] }) }, id);
|
|
896
|
+
hasError
|
|
897
|
+
} = t122;
|
|
898
|
+
const size = formatFileSize(file.size);
|
|
899
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(designsystemetReact.Table.Row, { "data-error": hasError, children: [
|
|
900
|
+
/* @__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: [
|
|
901
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(akselIcons.FileTextIcon, { "aria-hidden": "true", fontSize: "1.5em" }),
|
|
902
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "at-filepicker-files-file__text", children: file.name })
|
|
903
|
+
] }) }),
|
|
904
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Table.Cell, { title: size, children: size }),
|
|
905
|
+
/* @__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: [
|
|
906
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "at-filepicker-files-file__remove-text", children: removeButtonLabel }),
|
|
907
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(akselIcons.TrashIcon, { "aria-hidden": true })
|
|
908
|
+
] }) })
|
|
909
|
+
] }, id);
|
|
831
910
|
};
|
|
832
|
-
$[
|
|
833
|
-
$[
|
|
834
|
-
$[
|
|
911
|
+
$[27] = disabled;
|
|
912
|
+
$[28] = onRemove;
|
|
913
|
+
$[29] = removeButtonLabel;
|
|
914
|
+
$[30] = t112;
|
|
835
915
|
} else {
|
|
836
|
-
|
|
916
|
+
t112 = $[30];
|
|
837
917
|
}
|
|
838
|
-
|
|
839
|
-
$[
|
|
840
|
-
$[
|
|
841
|
-
$[
|
|
842
|
-
$[
|
|
918
|
+
t10 = files.map(t112);
|
|
919
|
+
$[22] = disabled;
|
|
920
|
+
$[23] = files;
|
|
921
|
+
$[24] = onRemove;
|
|
922
|
+
$[25] = removeButtonLabel;
|
|
923
|
+
$[26] = t10;
|
|
843
924
|
} else {
|
|
844
|
-
|
|
925
|
+
t10 = $[26];
|
|
845
926
|
}
|
|
846
|
-
let
|
|
847
|
-
if ($[
|
|
848
|
-
|
|
849
|
-
$[
|
|
850
|
-
$[
|
|
851
|
-
$[14] = t2;
|
|
852
|
-
$[15] = t3;
|
|
927
|
+
let t11;
|
|
928
|
+
if ($[31] !== t10) {
|
|
929
|
+
t11 = /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Table.Body, { children: t10 });
|
|
930
|
+
$[31] = t10;
|
|
931
|
+
$[32] = t11;
|
|
853
932
|
} else {
|
|
854
|
-
|
|
933
|
+
t11 = $[32];
|
|
855
934
|
}
|
|
856
|
-
|
|
935
|
+
let t12;
|
|
936
|
+
if ($[33] !== rest || $[34] !== t11 || $[35] !== t4 || $[36] !== t9) {
|
|
937
|
+
t12 = /* @__PURE__ */ jsxRuntimeExports.jsxs(designsystemetReact.Table, { className: t4, ...rest, children: [
|
|
938
|
+
t9,
|
|
939
|
+
t11
|
|
940
|
+
] });
|
|
941
|
+
$[33] = rest;
|
|
942
|
+
$[34] = t11;
|
|
943
|
+
$[35] = t4;
|
|
944
|
+
$[36] = t9;
|
|
945
|
+
$[37] = t12;
|
|
946
|
+
} else {
|
|
947
|
+
t12 = $[37];
|
|
948
|
+
}
|
|
949
|
+
return t12;
|
|
857
950
|
}
|
|
858
951
|
const FilePicker = Object.assign(FilePicker$1, {
|
|
859
952
|
Dropzone: FilePickerDropzone,
|