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