@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.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import require$$0, { createContext, use
|
|
3
|
-
import { CloudUpIcon,
|
|
2
|
+
import require$$0, { createContext, use } from "react";
|
|
3
|
+
import { CloudUpIcon, FileTextIcon, TrashIcon } from "@navikt/aksel-icons";
|
|
4
4
|
import { useDropzone } from "react-dropzone";
|
|
5
|
-
import { Spinner,
|
|
6
|
-
import { Alert
|
|
5
|
+
import { Spinner, Button, ValidationMessage, Table, Link, Avatar, Search } from "@digdir/designsystemet-react";
|
|
6
|
+
import { Alert, Avatar as Avatar2, Badge, BadgePosition, Breadcrumbs, BreadcrumbsItem, BreadcrumbsLink, BreadcrumbsList, Button as Button2, Card, CardBlock, Checkbox, Chip, ChipButton, ChipCheckbox, ChipRadio, ChipRemovable, Combobox, ComboboxEmpty, ComboboxOption, Details, DetailsContent, DetailsSummary, Dialog, DialogBlock, DialogTrigger, DialogTriggerContext, Divider, Dropdown, DropdownButton, DropdownHeading, DropdownItem, DropdownList, DropdownTrigger, DropdownTriggerContext, EXPERIMENTAL_Suggestion, EXPERIMENTAL_SuggestionClear, EXPERIMENTAL_SuggestionEmpty, EXPERIMENTAL_SuggestionInput, EXPERIMENTAL_SuggestionList, EXPERIMENTAL_SuggestionOption, ErrorSummary, ErrorSummaryHeading, ErrorSummaryItem, ErrorSummaryLink, ErrorSummaryList, Field, FieldAffix, FieldAffixes, FieldCounter, FieldDescription, Fieldset, FieldsetDescription, FieldsetLegend, Heading, Input, Label, Link as Link2, List, ListItem, ListOrdered, ListUnordered, Pagination, PaginationButton, PaginationItem, PaginationList, Paragraph, Popover, PopoverTrigger, PopoverTriggerContext, Radio, RovingFocusItem, RovingFocusRoot, Search as Search2, SearchButton, SearchClear, SearchInput, Select, SelectOptgroup, SelectOption, Skeleton, SkipLink, Spinner as Spinner2, Switch, Table as Table2, TableBody, TableCell, TableFoot, TableHead, TableHeaderCell, TableRow, Tabs, TabsList, TabsPanel, TabsTab, Tag, Textarea, Textfield, ToggleGroup, ToggleGroupItem, Tooltip, ValidationMessage as ValidationMessage2, omit, useCheckboxGroup, useDebounceCallback, useIsomorphicLayoutEffect, useMediaQuery, usePagination, useRadioGroup, useSynchronizedAnimation } from "@digdir/designsystemet-react";
|
|
7
7
|
import { Slot } from "@radix-ui/react-slot";
|
|
8
8
|
var jsxRuntime = { exports: {} };
|
|
9
9
|
var reactJsxRuntime_production = {};
|
|
@@ -400,7 +400,7 @@ const FilePickerContext = createContext({
|
|
|
400
400
|
}
|
|
401
401
|
});
|
|
402
402
|
function FilePicker$1(t0) {
|
|
403
|
-
const $ = compilerRuntimeExports.c(
|
|
403
|
+
const $ = compilerRuntimeExports.c(29);
|
|
404
404
|
let children;
|
|
405
405
|
let className;
|
|
406
406
|
let errors;
|
|
@@ -487,33 +487,35 @@ function FilePicker$1(t0) {
|
|
|
487
487
|
t5 = $[22];
|
|
488
488
|
}
|
|
489
489
|
let t6;
|
|
490
|
-
if ($[23] !==
|
|
491
|
-
t6 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref, className: t3, ...rest, children: t5 });
|
|
492
|
-
$[23] =
|
|
493
|
-
$[24] =
|
|
494
|
-
$[25] =
|
|
495
|
-
$[26] =
|
|
496
|
-
$[27] =
|
|
490
|
+
if ($[23] !== disabled || $[24] !== ref || $[25] !== rest || $[26] !== t3 || $[27] !== t5) {
|
|
491
|
+
t6 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref, className: t3, "data-disabled": disabled, ...rest, children: t5 });
|
|
492
|
+
$[23] = disabled;
|
|
493
|
+
$[24] = ref;
|
|
494
|
+
$[25] = rest;
|
|
495
|
+
$[26] = t3;
|
|
496
|
+
$[27] = t5;
|
|
497
|
+
$[28] = t6;
|
|
497
498
|
} else {
|
|
498
|
-
t6 = $[
|
|
499
|
+
t6 = $[28];
|
|
499
500
|
}
|
|
500
501
|
return t6;
|
|
501
502
|
}
|
|
502
503
|
function DefaultLabel(t0) {
|
|
503
|
-
const $ = compilerRuntimeExports.c(
|
|
504
|
+
const $ = compilerRuntimeExports.c(11);
|
|
504
505
|
const {
|
|
505
506
|
defaultLabelText
|
|
506
507
|
} = t0;
|
|
507
508
|
const text1 = defaultLabelText?.[0];
|
|
508
509
|
const text2 = defaultLabelText?.[1];
|
|
510
|
+
const text3 = defaultLabelText?.[2];
|
|
509
511
|
let t1;
|
|
510
512
|
let t2;
|
|
511
513
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
512
|
-
t1 = {
|
|
514
|
+
t1 = /* @__PURE__ */ jsxRuntimeExports.jsx(CloudUpIcon, { title: "Cloud" });
|
|
515
|
+
t2 = {
|
|
513
516
|
display: "flex",
|
|
514
517
|
flexFlow: "row"
|
|
515
518
|
};
|
|
516
|
-
t2 = /* @__PURE__ */ jsxRuntimeExports.jsx(CloudUpIcon, { title: "Cloud" });
|
|
517
519
|
$[0] = t1;
|
|
518
520
|
$[1] = t2;
|
|
519
521
|
} else {
|
|
@@ -530,40 +532,42 @@ function DefaultLabel(t0) {
|
|
|
530
532
|
t3 = $[2];
|
|
531
533
|
}
|
|
532
534
|
let t4;
|
|
533
|
-
if ($[3] !==
|
|
534
|
-
t4 = /* @__PURE__ */ jsxRuntimeExports.
|
|
535
|
-
|
|
536
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Label, { style: t3, children: text1 })
|
|
537
|
-
] });
|
|
538
|
-
$[3] = text1;
|
|
535
|
+
if ($[3] !== text2) {
|
|
536
|
+
t4 = /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: t3, children: text2 });
|
|
537
|
+
$[3] = text2;
|
|
539
538
|
$[4] = t4;
|
|
540
539
|
} else {
|
|
541
540
|
t4 = $[4];
|
|
542
541
|
}
|
|
543
542
|
let t5;
|
|
544
|
-
if ($[5] !==
|
|
545
|
-
t5 =
|
|
546
|
-
|
|
547
|
-
|
|
543
|
+
if ($[5] !== t4 || $[6] !== text1) {
|
|
544
|
+
t5 = /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { style: t2, children: [
|
|
545
|
+
text1,
|
|
546
|
+
t4
|
|
547
|
+
] });
|
|
548
|
+
$[5] = t4;
|
|
549
|
+
$[6] = text1;
|
|
550
|
+
$[7] = t5;
|
|
548
551
|
} else {
|
|
549
|
-
t5 = $[
|
|
552
|
+
t5 = $[7];
|
|
550
553
|
}
|
|
551
554
|
let t6;
|
|
552
|
-
if ($[
|
|
555
|
+
if ($[8] !== t5 || $[9] !== text3) {
|
|
553
556
|
t6 = /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
554
|
-
|
|
555
|
-
t5
|
|
557
|
+
t1,
|
|
558
|
+
t5,
|
|
559
|
+
text3
|
|
556
560
|
] });
|
|
557
|
-
$[7] = t4;
|
|
558
561
|
$[8] = t5;
|
|
559
|
-
$[9] =
|
|
562
|
+
$[9] = text3;
|
|
563
|
+
$[10] = t6;
|
|
560
564
|
} else {
|
|
561
|
-
t6 = $[
|
|
565
|
+
t6 = $[10];
|
|
562
566
|
}
|
|
563
567
|
return t6;
|
|
564
568
|
}
|
|
565
569
|
function FilePickerDropzone(t0) {
|
|
566
|
-
const $ = compilerRuntimeExports.c(
|
|
570
|
+
const $ = compilerRuntimeExports.c(37);
|
|
567
571
|
const {
|
|
568
572
|
className,
|
|
569
573
|
label,
|
|
@@ -573,7 +577,7 @@ function FilePickerDropzone(t0) {
|
|
|
573
577
|
} = t0;
|
|
574
578
|
let t3;
|
|
575
579
|
if ($[0] !== t1) {
|
|
576
|
-
t3 = t1 === void 0 ? ["Last opp fil", "Filformater: pdf, txt og docx"] : t1;
|
|
580
|
+
t3 = t1 === void 0 ? ["Dra og slipp eller", "Last opp fil", "Filformater: pdf, txt og docx"] : t1;
|
|
577
581
|
$[0] = t1;
|
|
578
582
|
$[1] = t3;
|
|
579
583
|
} else {
|
|
@@ -584,7 +588,8 @@ function FilePickerDropzone(t0) {
|
|
|
584
588
|
const {
|
|
585
589
|
onAdd,
|
|
586
590
|
disabled,
|
|
587
|
-
isWaiting
|
|
591
|
+
isWaiting,
|
|
592
|
+
errors
|
|
588
593
|
} = use(FilePickerContext);
|
|
589
594
|
const isDisabled = Boolean(disabled || isWaiting);
|
|
590
595
|
let t4;
|
|
@@ -618,99 +623,109 @@ function FilePickerDropzone(t0) {
|
|
|
618
623
|
isDragActive,
|
|
619
624
|
open
|
|
620
625
|
} = useDropzone(t5);
|
|
621
|
-
|
|
626
|
+
let t6;
|
|
627
|
+
if ($[7] !== dropLabel) {
|
|
628
|
+
t6 = typeof dropLabel === "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: {
|
|
629
|
+
textDecoration: "underline"
|
|
630
|
+
}, children: dropLabel }) : dropLabel;
|
|
631
|
+
$[7] = dropLabel;
|
|
632
|
+
$[8] = t6;
|
|
633
|
+
} else {
|
|
634
|
+
t6 = $[8];
|
|
635
|
+
}
|
|
636
|
+
const dragNode = t6;
|
|
637
|
+
const t7 = getRootProps({
|
|
622
638
|
role: "group",
|
|
623
639
|
"aria-disabled": isDisabled || void 0,
|
|
624
|
-
className: clsx("at-filepicker-dropzone-wrapper",
|
|
640
|
+
className: clsx("at-filepicker-dropzone-wrapper", className),
|
|
625
641
|
...rest
|
|
626
642
|
});
|
|
627
|
-
let t7;
|
|
628
|
-
if ($[7] !== getInputProps) {
|
|
629
|
-
t7 = getInputProps();
|
|
630
|
-
$[7] = getInputProps;
|
|
631
|
-
$[8] = t7;
|
|
632
|
-
} else {
|
|
633
|
-
t7 = $[8];
|
|
634
|
-
}
|
|
635
643
|
let t8;
|
|
636
|
-
if ($[9] !==
|
|
637
|
-
t8 =
|
|
638
|
-
$[9] =
|
|
644
|
+
if ($[9] !== getInputProps) {
|
|
645
|
+
t8 = getInputProps();
|
|
646
|
+
$[9] = getInputProps;
|
|
639
647
|
$[10] = t8;
|
|
640
648
|
} else {
|
|
641
649
|
t8 = $[10];
|
|
642
650
|
}
|
|
643
|
-
|
|
651
|
+
let t9;
|
|
652
|
+
if ($[11] !== t8) {
|
|
653
|
+
t9 = /* @__PURE__ */ jsxRuntimeExports.jsx("input", { ...t8, "aria-hidden": true });
|
|
654
|
+
$[11] = t8;
|
|
655
|
+
$[12] = t9;
|
|
656
|
+
} else {
|
|
657
|
+
t9 = $[12];
|
|
658
|
+
}
|
|
644
659
|
let t10;
|
|
645
|
-
if ($[
|
|
646
|
-
t10 =
|
|
647
|
-
$[
|
|
648
|
-
$[
|
|
660
|
+
if ($[13] !== isWaiting) {
|
|
661
|
+
t10 = isWaiting && /* @__PURE__ */ jsxRuntimeExports.jsx(Spinner, { "aria-label": "Processing files", "data-size": "lg" });
|
|
662
|
+
$[13] = isWaiting;
|
|
663
|
+
$[14] = t10;
|
|
649
664
|
} else {
|
|
650
|
-
t10 = $[
|
|
665
|
+
t10 = $[14];
|
|
651
666
|
}
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
667
|
+
const t11 = isDragActive && "is-drag";
|
|
668
|
+
const t12 = errors && errors.length > 0 && "has-error";
|
|
669
|
+
let t13;
|
|
670
|
+
if ($[15] !== t11 || $[16] !== t12) {
|
|
671
|
+
t13 = clsx("at-filepicker-dropzone", t11, t12);
|
|
672
|
+
$[15] = t11;
|
|
673
|
+
$[16] = t12;
|
|
674
|
+
$[17] = t13;
|
|
675
|
+
} else {
|
|
676
|
+
t13 = $[17];
|
|
677
|
+
}
|
|
678
|
+
let t14;
|
|
679
|
+
if ($[18] !== isDisabled || $[19] !== open) {
|
|
680
|
+
t14 = () => {
|
|
655
681
|
if (!isDisabled) {
|
|
656
682
|
open();
|
|
657
683
|
}
|
|
658
684
|
};
|
|
659
|
-
$[
|
|
660
|
-
$[
|
|
661
|
-
$[
|
|
685
|
+
$[18] = isDisabled;
|
|
686
|
+
$[19] = open;
|
|
687
|
+
$[20] = t14;
|
|
662
688
|
} else {
|
|
663
|
-
|
|
689
|
+
t14 = $[20];
|
|
664
690
|
}
|
|
665
|
-
let
|
|
666
|
-
if ($[
|
|
667
|
-
|
|
668
|
-
$[
|
|
669
|
-
$[
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
if ($[18] !== defaultLabelText || $[19] !== dropLabel || $[20] !== isDragActive || $[21] !== isWaiting || $[22] !== label) {
|
|
675
|
-
t13 = !isWaiting && (isDragActive ? /* @__PURE__ */ jsxRuntimeExports.jsx(Label, { children: dropLabel }) : label ?? /* @__PURE__ */ jsxRuntimeExports.jsx(DefaultLabel, { defaultLabelText }));
|
|
676
|
-
$[18] = defaultLabelText;
|
|
677
|
-
$[19] = dropLabel;
|
|
678
|
-
$[20] = isDragActive;
|
|
679
|
-
$[21] = isWaiting;
|
|
680
|
-
$[22] = label;
|
|
681
|
-
$[23] = t13;
|
|
691
|
+
let t15;
|
|
692
|
+
if ($[21] !== defaultLabelText || $[22] !== dragNode || $[23] !== isDragActive || $[24] !== isWaiting || $[25] !== label) {
|
|
693
|
+
t15 = !isWaiting && (isDragActive ? dragNode : label ?? /* @__PURE__ */ jsxRuntimeExports.jsx(DefaultLabel, { defaultLabelText }));
|
|
694
|
+
$[21] = defaultLabelText;
|
|
695
|
+
$[22] = dragNode;
|
|
696
|
+
$[23] = isDragActive;
|
|
697
|
+
$[24] = isWaiting;
|
|
698
|
+
$[25] = label;
|
|
699
|
+
$[26] = t15;
|
|
682
700
|
} else {
|
|
683
|
-
|
|
701
|
+
t15 = $[26];
|
|
684
702
|
}
|
|
685
|
-
let
|
|
686
|
-
if ($[
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
]
|
|
691
|
-
$[
|
|
692
|
-
$[
|
|
693
|
-
$[
|
|
694
|
-
$[27] = t12;
|
|
695
|
-
$[28] = t13;
|
|
696
|
-
$[29] = t14;
|
|
703
|
+
let t16;
|
|
704
|
+
if ($[27] !== isDisabled || $[28] !== t10 || $[29] !== t13 || $[30] !== t14 || $[31] !== t15) {
|
|
705
|
+
t16 = /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { type: "button", disabled: isDisabled, loading: t10, className: t13, onClick: t14, children: t15 });
|
|
706
|
+
$[27] = isDisabled;
|
|
707
|
+
$[28] = t10;
|
|
708
|
+
$[29] = t13;
|
|
709
|
+
$[30] = t14;
|
|
710
|
+
$[31] = t15;
|
|
711
|
+
$[32] = t16;
|
|
697
712
|
} else {
|
|
698
|
-
|
|
713
|
+
t16 = $[32];
|
|
699
714
|
}
|
|
700
|
-
let
|
|
701
|
-
if ($[
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
715
|
+
let t17;
|
|
716
|
+
if ($[33] !== t16 || $[34] !== t7 || $[35] !== t9) {
|
|
717
|
+
t17 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ...t7, children: [
|
|
718
|
+
t9,
|
|
719
|
+
t16
|
|
705
720
|
] });
|
|
706
|
-
$[
|
|
707
|
-
$[
|
|
708
|
-
$[
|
|
709
|
-
$[
|
|
721
|
+
$[33] = t16;
|
|
722
|
+
$[34] = t7;
|
|
723
|
+
$[35] = t9;
|
|
724
|
+
$[36] = t17;
|
|
710
725
|
} else {
|
|
711
|
-
|
|
726
|
+
t17 = $[36];
|
|
712
727
|
}
|
|
713
|
-
return
|
|
728
|
+
return t17;
|
|
714
729
|
}
|
|
715
730
|
function FilePickerErrors(t0) {
|
|
716
731
|
const $ = compilerRuntimeExports.c(11);
|
|
@@ -752,7 +767,7 @@ function FilePickerErrors(t0) {
|
|
|
752
767
|
}
|
|
753
768
|
let t3;
|
|
754
769
|
if ($[7] !== rest || $[8] !== t1 || $[9] !== t2) {
|
|
755
|
-
t3 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: t1, ...rest, children: t2 });
|
|
770
|
+
t3 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: t1, role: "status", ...rest, children: t2 });
|
|
756
771
|
$[7] = rest;
|
|
757
772
|
$[8] = t1;
|
|
758
773
|
$[9] = t2;
|
|
@@ -763,7 +778,7 @@ function FilePickerErrors(t0) {
|
|
|
763
778
|
return t3;
|
|
764
779
|
}
|
|
765
780
|
function _temp$1(error, index) {
|
|
766
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
781
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ValidationMessage, { children: error }, index);
|
|
767
782
|
}
|
|
768
783
|
function formatFileSize(bytes) {
|
|
769
784
|
if (bytes === 0) return "0 Bytes";
|
|
@@ -773,21 +788,39 @@ function formatFileSize(bytes) {
|
|
|
773
788
|
return parseFloat((bytes / Math.pow(k, i)).toFixed(1)) + " " + sizes[i];
|
|
774
789
|
}
|
|
775
790
|
function FilePickerFiles(t0) {
|
|
776
|
-
const $ = compilerRuntimeExports.c(
|
|
791
|
+
const $ = compilerRuntimeExports.c(38);
|
|
777
792
|
let className;
|
|
778
793
|
let rest;
|
|
794
|
+
let t1;
|
|
795
|
+
let t2;
|
|
779
796
|
if ($[0] !== t0) {
|
|
780
797
|
({
|
|
781
798
|
className,
|
|
799
|
+
columnNames: t1,
|
|
800
|
+
removeButtonLabel: t2,
|
|
782
801
|
...rest
|
|
783
802
|
} = t0);
|
|
784
803
|
$[0] = t0;
|
|
785
804
|
$[1] = className;
|
|
786
805
|
$[2] = rest;
|
|
806
|
+
$[3] = t1;
|
|
807
|
+
$[4] = t2;
|
|
787
808
|
} else {
|
|
788
809
|
className = $[1];
|
|
789
810
|
rest = $[2];
|
|
811
|
+
t1 = $[3];
|
|
812
|
+
t2 = $[4];
|
|
790
813
|
}
|
|
814
|
+
let t3;
|
|
815
|
+
if ($[5] !== t1) {
|
|
816
|
+
t3 = t1 === void 0 ? ["Navn", "Størrelse", ""] : t1;
|
|
817
|
+
$[5] = t1;
|
|
818
|
+
$[6] = t3;
|
|
819
|
+
} else {
|
|
820
|
+
t3 = $[6];
|
|
821
|
+
}
|
|
822
|
+
const columnNames = t3;
|
|
823
|
+
const removeButtonLabel = t2 === void 0 ? "Fjern" : t2;
|
|
791
824
|
const {
|
|
792
825
|
files,
|
|
793
826
|
onRemove,
|
|
@@ -796,63 +829,123 @@ function FilePickerFiles(t0) {
|
|
|
796
829
|
if (!files?.length) {
|
|
797
830
|
return null;
|
|
798
831
|
}
|
|
799
|
-
let
|
|
800
|
-
if ($[
|
|
801
|
-
|
|
802
|
-
$[
|
|
803
|
-
$[
|
|
832
|
+
let t4;
|
|
833
|
+
if ($[7] !== className) {
|
|
834
|
+
t4 = clsx("at-filepicker-files-table", className);
|
|
835
|
+
$[7] = className;
|
|
836
|
+
$[8] = t4;
|
|
804
837
|
} else {
|
|
805
|
-
|
|
838
|
+
t4 = $[8];
|
|
806
839
|
}
|
|
807
|
-
let
|
|
808
|
-
if ($[
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
840
|
+
let t5;
|
|
841
|
+
if ($[9] !== columnNames[0]) {
|
|
842
|
+
t5 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.HeaderCell, { title: columnNames[0], children: columnNames[0] });
|
|
843
|
+
$[9] = columnNames[0];
|
|
844
|
+
$[10] = t5;
|
|
845
|
+
} else {
|
|
846
|
+
t5 = $[10];
|
|
847
|
+
}
|
|
848
|
+
let t6;
|
|
849
|
+
if ($[11] !== columnNames[1]) {
|
|
850
|
+
t6 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.HeaderCell, { title: columnNames[1], children: columnNames[1] });
|
|
851
|
+
$[11] = columnNames[1];
|
|
852
|
+
$[12] = t6;
|
|
853
|
+
} else {
|
|
854
|
+
t6 = $[12];
|
|
855
|
+
}
|
|
856
|
+
let t7;
|
|
857
|
+
if ($[13] !== columnNames[2]) {
|
|
858
|
+
t7 = columnNames[2] || /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ds-sr-only", children: "Action" });
|
|
859
|
+
$[13] = columnNames[2];
|
|
860
|
+
$[14] = t7;
|
|
861
|
+
} else {
|
|
862
|
+
t7 = $[14];
|
|
863
|
+
}
|
|
864
|
+
let t8;
|
|
865
|
+
if ($[15] !== columnNames[2] || $[16] !== t7) {
|
|
866
|
+
t8 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.HeaderCell, { title: columnNames[2], children: t7 });
|
|
867
|
+
$[15] = columnNames[2];
|
|
868
|
+
$[16] = t7;
|
|
869
|
+
$[17] = t8;
|
|
870
|
+
} else {
|
|
871
|
+
t8 = $[17];
|
|
872
|
+
}
|
|
873
|
+
let t9;
|
|
874
|
+
if ($[18] !== t5 || $[19] !== t6 || $[20] !== t8) {
|
|
875
|
+
t9 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Head, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Table.Row, { children: [
|
|
876
|
+
t5,
|
|
877
|
+
t6,
|
|
878
|
+
t8
|
|
879
|
+
] }) });
|
|
880
|
+
$[18] = t5;
|
|
881
|
+
$[19] = t6;
|
|
882
|
+
$[20] = t8;
|
|
883
|
+
$[21] = t9;
|
|
884
|
+
} else {
|
|
885
|
+
t9 = $[21];
|
|
886
|
+
}
|
|
887
|
+
let t10;
|
|
888
|
+
if ($[22] !== disabled || $[23] !== files || $[24] !== onRemove || $[25] !== removeButtonLabel) {
|
|
889
|
+
let t112;
|
|
890
|
+
if ($[27] !== disabled || $[28] !== onRemove || $[29] !== removeButtonLabel) {
|
|
891
|
+
t112 = (t122) => {
|
|
812
892
|
const {
|
|
813
893
|
id,
|
|
814
894
|
file,
|
|
815
|
-
|
|
816
|
-
} =
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
820
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
821
|
-
|
|
822
|
-
] }),
|
|
823
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
")
|
|
827
|
-
] })
|
|
828
|
-
|
|
829
|
-
] }) }, id);
|
|
895
|
+
hasError
|
|
896
|
+
} = t122;
|
|
897
|
+
const size = formatFileSize(file.size);
|
|
898
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Table.Row, { "data-error": hasError, children: [
|
|
899
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Table.Cell, { title: file.name, className: "at-filepicker-files-file__name", "data-color": "info", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Link, { href: disabled ? void 0 : URL.createObjectURL(file), target: "_blank", rel: "noreferrer", "aria-disabled": disabled, children: [
|
|
900
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(FileTextIcon, { "aria-hidden": "true", fontSize: "1.5em" }),
|
|
901
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "at-filepicker-files-file__text", children: file.name })
|
|
902
|
+
] }) }),
|
|
903
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Table.Cell, { title: size, children: size }),
|
|
904
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Table.Cell, { "data-color": "danger", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { variant: "tertiary", "data-size": "sm", disabled, "aria-label": `Remove ${file.name}`, onClick: () => onRemove(id), children: [
|
|
905
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "at-filepicker-files-file__remove-text", children: removeButtonLabel }),
|
|
906
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TrashIcon, { "aria-hidden": true })
|
|
907
|
+
] }) })
|
|
908
|
+
] }, id);
|
|
830
909
|
};
|
|
831
|
-
$[
|
|
832
|
-
$[
|
|
833
|
-
$[
|
|
910
|
+
$[27] = disabled;
|
|
911
|
+
$[28] = onRemove;
|
|
912
|
+
$[29] = removeButtonLabel;
|
|
913
|
+
$[30] = t112;
|
|
834
914
|
} else {
|
|
835
|
-
|
|
915
|
+
t112 = $[30];
|
|
836
916
|
}
|
|
837
|
-
|
|
838
|
-
$[
|
|
839
|
-
$[
|
|
840
|
-
$[
|
|
841
|
-
$[
|
|
917
|
+
t10 = files.map(t112);
|
|
918
|
+
$[22] = disabled;
|
|
919
|
+
$[23] = files;
|
|
920
|
+
$[24] = onRemove;
|
|
921
|
+
$[25] = removeButtonLabel;
|
|
922
|
+
$[26] = t10;
|
|
842
923
|
} else {
|
|
843
|
-
|
|
924
|
+
t10 = $[26];
|
|
844
925
|
}
|
|
845
|
-
let
|
|
846
|
-
if ($[
|
|
847
|
-
|
|
848
|
-
$[
|
|
849
|
-
$[
|
|
850
|
-
$[14] = t2;
|
|
851
|
-
$[15] = t3;
|
|
926
|
+
let t11;
|
|
927
|
+
if ($[31] !== t10) {
|
|
928
|
+
t11 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Body, { children: t10 });
|
|
929
|
+
$[31] = t10;
|
|
930
|
+
$[32] = t11;
|
|
852
931
|
} else {
|
|
853
|
-
|
|
932
|
+
t11 = $[32];
|
|
854
933
|
}
|
|
855
|
-
|
|
934
|
+
let t12;
|
|
935
|
+
if ($[33] !== rest || $[34] !== t11 || $[35] !== t4 || $[36] !== t9) {
|
|
936
|
+
t12 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Table, { className: t4, ...rest, children: [
|
|
937
|
+
t9,
|
|
938
|
+
t11
|
|
939
|
+
] });
|
|
940
|
+
$[33] = rest;
|
|
941
|
+
$[34] = t11;
|
|
942
|
+
$[35] = t4;
|
|
943
|
+
$[36] = t9;
|
|
944
|
+
$[37] = t12;
|
|
945
|
+
} else {
|
|
946
|
+
t12 = $[37];
|
|
947
|
+
}
|
|
948
|
+
return t12;
|
|
856
949
|
}
|
|
857
950
|
const FilePicker = Object.assign(FilePicker$1, {
|
|
858
951
|
Dropzone: FilePickerDropzone,
|
|
@@ -1597,7 +1690,7 @@ const LogoGreen = (t0) => {
|
|
|
1597
1690
|
return t21;
|
|
1598
1691
|
};
|
|
1599
1692
|
export {
|
|
1600
|
-
|
|
1693
|
+
Alert,
|
|
1601
1694
|
Avatar2 as Avatar,
|
|
1602
1695
|
Badge,
|
|
1603
1696
|
BadgePosition,
|
|
@@ -1662,9 +1755,9 @@ export {
|
|
|
1662
1755
|
HeaderTitle,
|
|
1663
1756
|
Heading,
|
|
1664
1757
|
Input,
|
|
1665
|
-
|
|
1758
|
+
Label,
|
|
1666
1759
|
LightDarkLogo,
|
|
1667
|
-
Link,
|
|
1760
|
+
Link2 as Link,
|
|
1668
1761
|
List,
|
|
1669
1762
|
ListItem,
|
|
1670
1763
|
ListOrdered,
|
|
@@ -1694,7 +1787,7 @@ export {
|
|
|
1694
1787
|
SkipLink,
|
|
1695
1788
|
Spinner2 as Spinner,
|
|
1696
1789
|
Switch,
|
|
1697
|
-
Table,
|
|
1790
|
+
Table2 as Table,
|
|
1698
1791
|
TableBody,
|
|
1699
1792
|
TableCell,
|
|
1700
1793
|
TableFoot,
|