@midas-ds/components 17.28.2 โ†’ 17.29.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,22 @@
1
+ ## 17.29.0 (2026-10-09)
2
+
3
+ ### ๐Ÿš€ Features
4
+
5
+ - **components,file-list:** name the file in screen reader output and announce upload errors ([37b3d4545b6](https://github.com/migrationsverket/midas/commit/37b3d4545b6))
6
+ - **components,file-list:** animate the upload-complete and upload-failed transitions ([76157f5d350](https://github.com/migrationsverket/midas/commit/76157f5d350))
7
+ - **components,file-list:** auto-restore focus to a sibling row on removal ([c5356b073ef](https://github.com/migrationsverket/midas/commit/c5356b073ef))
8
+ - **components,file-list,progress-bar:** add upload progress states and a circular ProgressBar ([935847ee8ce](https://github.com/migrationsverket/midas/commit/935847ee8ce))
9
+
10
+ ### ๐Ÿฉน Fixes
11
+
12
+ - **components,file-list:** read the upload state first in each row and separate name and size ([4ce25f2de0c](https://github.com/migrationsverket/midas/commit/4ce25f2de0c))
13
+ - **components,file-list:** only render the progress bar and checkmark in their own state ([d7a8371ed70](https://github.com/migrationsverket/midas/commit/d7a8371ed70))
14
+
15
+ ### ๐Ÿงช Tests updated
16
+
17
+ - update visual regression screenshots ([7052703314c](https://github.com/migrationsverket/midas/commit/7052703314c))
18
+ - update visual regression screenshots ([c7c1aeca056](https://github.com/migrationsverket/midas/commit/c7c1aeca056))
19
+
1
20
  ## 17.28.2 (2026-10-08)
2
21
 
3
22
  ### ๐Ÿฉน Fixes
@@ -1 +1 @@
1
- ._fileList_1jd3b_1{gap:var(--midas-space-small);flex-direction:column;margin:0;padding:0;list-style:none;display:flex}._fileListItem_1jd3b_10{background-color:var(--midas-layer-01-base);box-sizing:border-box;font-family:var(--midas-typography-font-family);height:var(--midas-size-control);align-items:center;padding-inline-start:var(--midas-space-medium);display:flex}._fileInfo_1jd3b_20{align-items:baseline;gap:var(--midas-space-small);flex:1;min-width:0;display:flex}._fileName_1jd3b_28{color:var(--midas-text-primary);font-size:var(--midas-typography-font-size-30);font-weight:var(--midas-typography-weight-medium);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}._fileSize_1jd3b_37{color:var(--midas-text-secondary);font-size:var(--midas-typography-font-size-30);flex-shrink:0}._deleteButton_1jd3b_43{color:var(--midas-icon-primary);flex-shrink:0}
1
+ ._fileList_mb5n3_1{gap:var(--midas-space-small);flex-direction:column;margin:0;padding:0;list-style:none;display:flex}._fileListItem_mb5n3_18{--file-list-success-duration:2s;flex-direction:column;display:flex}._row_mb5n3_25{background-color:var(--midas-layer-01-base);box-sizing:border-box;font-family:var(--midas-typography-font-family);height:var(--midas-size-control);transition:box-shadow var(--midas-transition-duration-fast) var(--midas-transition-timing-ease-out);align-items:center;padding-inline-start:var(--midas-space-medium);display:flex}._fileListItem_mb5n3_18[data-status=error] ._row_mb5n3_25{box-shadow:var(--midas-state-invalid)}._iconSlot_mb5n3_46{height:var(--midas-size-icon-sm);opacity:0;transition:margin-inline-end var(--midas-transition-duration-normal) var(--midas-transition-timing-ease-out), opacity var(--midas-transition-duration-normal) var(--midas-transition-timing-ease-out), width var(--midas-transition-duration-normal) var(--midas-transition-timing-ease-out);flex-shrink:0;width:0;margin-inline-end:0;position:relative}._fileListItem_mb5n3_18[data-status=uploading] ._iconSlot_mb5n3_46,._fileListItem_mb5n3_18[data-status=success] ._iconSlot_mb5n3_46{opacity:1;width:var(--midas-size-icon-sm);margin-inline-end:var(--midas-space-small)}._progressIcon_mb5n3_70{position:absolute;inset:0}._ring_mb5n3_82{border:2px solid var(--midas-icon-success);box-sizing:border-box;opacity:0;border-radius:50%;position:absolute;inset:0}._fileListItem_mb5n3_18[data-status=success] ._ring_mb5n3_82{animation:_successRing_mb5n3_1 var(--file-list-success-duration) var(--midas-transition-timing-ease-out) forwards}._checkmark_mb5n3_106{height:var(--midas-size-icon-sm);opacity:0;width:var(--midas-size-icon-sm);margin:auto;position:absolute;inset:0;transform:scale(.4)}._fileListItem_mb5n3_18[data-status=success] ._checkmark_mb5n3_106{animation:_successCheckmark_mb5n3_1 var(--file-list-success-duration) var(--midas-transition-timing-ease-out) forwards}._successIcon_mb5n3_121{color:var(--midas-icon-success)}@keyframes _successRing_mb5n3_1{0%,30%{opacity:1}55%,to{opacity:0}}@keyframes _successCheckmark_mb5n3_1{0%,30%{opacity:0;transform:scale(.4)}55%{opacity:1;transform:scale(.65)}65%,to{opacity:1;transform:scale(1)}}@media (prefers-reduced-motion:reduce){._row_mb5n3_25,._iconSlot_mb5n3_46,._ring_mb5n3_82,._checkmark_mb5n3_106,._errorReveal_mb5n3_163{transition-duration:1ms!important;animation-duration:1ms!important}}._fileInfo_mb5n3_169{align-items:baseline;gap:var(--midas-space-small);flex:1;min-width:0;display:flex}._fileName_mb5n3_177{color:var(--midas-text-primary);font-size:var(--midas-typography-font-size-30);font-weight:var(--midas-typography-weight-medium);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}._fileSize_mb5n3_186{color:var(--midas-text-secondary);font-size:var(--midas-typography-font-size-30);flex-shrink:0}._deleteButton_mb5n3_192{color:var(--midas-icon-primary);flex-shrink:0;margin-inline-start:var(--midas-space-small)}._errorReveal_mb5n3_163{max-height:0;transition:max-height var(--midas-transition-duration-normal) var(--midas-transition-timing-ease-out);overflow:clip}._fileListItem_mb5n3_18[data-status=error] ._errorReveal_mb5n3_163{max-height:6.25rem}
@@ -1 +1 @@
1
- ._progressBar_13dw9_1{grid-template-columns:1fr auto;grid-template-areas:"label value""track track";gap:.5rem;display:grid}._progressBar_13dw9_1 ._label_13dw9_9{grid-area:label;margin:0}._progressBar_13dw9_1 ._value_13dw9_14{grid-area:value;margin:0}._progressBar_13dw9_1 ._track_13dw9_19{background:var(--midas-progress-bar-track-background);grid-area:track;height:.25rem;overflow:hidden}@media (forced-colors:active){._progressBar_13dw9_1 ._track_13dw9_19{border:1px solid}}._progressBar_13dw9_1 ._track_13dw9_19 ._indicator_13dw9_29{background:var(--midas-progress-bar-indicator-background);height:100%}@media (forced-colors:active){._progressBar_13dw9_1 ._track_13dw9_19 ._indicator_13dw9_29{background:highlight}}._progressBar_13dw9_1:not([aria-valuenow]) ._indicator_13dw9_29{will-change:transform;background:var(--midas-progress-bar-indicator-background);height:100%;animation:2s var(--midas-transition-timing-ease-in-out) infinite _indeterminate_13dw9_1}@media (forced-colors:active){._progressBar_13dw9_1:not([aria-valuenow]) ._indicator_13dw9_29{background:highlight}}@keyframes _indeterminate_13dw9_1{0%{transform:translate(-100%)}to{transform:translate(200%)}}@media (prefers-reduced-motion){._progressBar_13dw9_1:not([aria-valuenow]) ._indicator_13dw9_29{animation-duration:6s}}
1
+ ._progressBar_15k4b_1{column-gap:var(--midas-space-small);grid-template-columns:1fr auto;grid-template-areas:"label value""track track";display:grid}._progressBar_15k4b_1 ._label_15k4b_9{margin:0 0 var(--midas-space-small);grid-area:label}._progressBar_15k4b_1 ._value_15k4b_14{margin:0 0 var(--midas-space-small);grid-area:value}._progressBar_15k4b_1 ._track_15k4b_19{background:var(--midas-progress-bar-track-background);grid-area:track;height:.25rem;overflow:hidden}@media (forced-colors:active){._progressBar_15k4b_1 ._track_15k4b_19{border:1px solid}}._progressBar_15k4b_1 ._track_15k4b_19 ._indicator_15k4b_29{background:var(--midas-progress-bar-indicator-background);height:100%}@media (forced-colors:active){._progressBar_15k4b_1 ._track_15k4b_19 ._indicator_15k4b_29{background:highlight}}._progressBar_15k4b_1:not([aria-valuenow]) ._indicator_15k4b_29{will-change:transform;background:var(--midas-progress-bar-indicator-background);height:100%;animation:2s var(--midas-transition-timing-ease-in-out) infinite _indeterminate_15k4b_1}@media (forced-colors:active){._progressBar_15k4b_1:not([aria-valuenow]) ._indicator_15k4b_29{background:highlight}}._progressBar_15k4b_1 ._circular_15k4b_53{height:var(--midas-size-icon);width:var(--midas-size-icon);grid-area:track;transform:rotate(-90deg)}._progressBar_15k4b_1 ._circular_15k4b_53._circularSmall_15k4b_59{height:var(--midas-size-icon-sm);width:var(--midas-size-icon-sm)}._progressBar_15k4b_1 ._circularTrack_15k4b_65{fill:none;stroke:var(--midas-progress-bar-track-background);stroke-width:2px}@media (forced-colors:active){._progressBar_15k4b_1 ._circularTrack_15k4b_65{stroke:canvastext}}._progressBar_15k4b_1 ._circularIndicator_15k4b_75{fill:none;stroke:var(--midas-progress-bar-indicator-background);stroke-linecap:round;stroke-width:2px;transition:stroke-dashoffset var(--midas-transition-duration-normal) var(--midas-transition-timing-ease-out)}@media (forced-colors:active){._progressBar_15k4b_1 ._circularIndicator_15k4b_75{stroke:highlight}}._progressBar_15k4b_1 ._circularIndicator_15k4b_75._circularIndeterminate_15k4b_87{stroke-linecap:square;transform-origin:50%;animation:1s linear infinite _circularRotate_15k4b_1}@media (prefers-reduced-motion:reduce){._progressBar_15k4b_1 ._circularIndicator_15k4b_75._circularIndeterminate_15k4b_87{animation-duration:2s}}@keyframes _indeterminate_15k4b_1{0%{transform:translate(-100%)}to{transform:translate(200%)}}@keyframes _circularRotate_15k4b_1{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){._progressBar_15k4b_1:not([aria-valuenow]) ._indicator_15k4b_29{animation-duration:6s}}
@@ -0,0 +1,161 @@
1
+ 'use client';
2
+ import { t as e } from "./clsx-Di52oYUU.js";
3
+ import { t } from "./createLucideIcon-BgluSHFG.js";
4
+ import { t as n } from "./FeedbackStatusIcon-DRI7WrSU.js";
5
+ import { t as r } from "./x-BJAOO5a5.js";
6
+ import { t as i } from "./useLocalizedStringFormatter-CeyBc0x0.js";
7
+ import { n as a } from "./button-CenXTGXL.js";
8
+ import { t as o } from "./field-error-LtNtEKDp.js";
9
+ import { t as s } from "./progress-bar-CknF4qAm.js";
10
+ import { useEffect as c, useId as l, useRef as u } from "react";
11
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
12
+ import { FocusScope as m, VisuallyHidden as h, useFocusManager as g } from "react-aria";
13
+ import '../assets/file-list.css';var _ = t("trash-2", [
14
+ ["path", {
15
+ d: "M10 11v6",
16
+ key: "nco0om"
17
+ }],
18
+ ["path", {
19
+ d: "M14 11v6",
20
+ key: "outv1u"
21
+ }],
22
+ ["path", {
23
+ d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",
24
+ key: "miytrc"
25
+ }],
26
+ ["path", {
27
+ d: "M3 6h18",
28
+ key: "d0wm0j"
29
+ }],
30
+ ["path", {
31
+ d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",
32
+ key: "e791ji"
33
+ }]
34
+ ]), v = {
35
+ fileList: "_fileList_mb5n3_1",
36
+ fileListItem: "_fileListItem_mb5n3_18",
37
+ row: "_row_mb5n3_25",
38
+ iconSlot: "_iconSlot_mb5n3_46",
39
+ progressIcon: "_progressIcon_mb5n3_70",
40
+ ring: "_ring_mb5n3_82",
41
+ successRing: "_successRing_mb5n3_1",
42
+ checkmark: "_checkmark_mb5n3_106",
43
+ successCheckmark: "_successCheckmark_mb5n3_1",
44
+ successIcon: "_successIcon_mb5n3_121",
45
+ errorReveal: "_errorReveal_mb5n3_163",
46
+ fileInfo: "_fileInfo_mb5n3_169",
47
+ fileName: "_fileName_mb5n3_177",
48
+ fileSize: "_fileSize_mb5n3_186",
49
+ deleteButton: "_deleteButton_mb5n3_192"
50
+ }, y = ({ className: t, children: n, ...r }) => {
51
+ let i = u(null);
52
+ return /* @__PURE__ */ f(m, { children: /* @__PURE__ */ p("ul", {
53
+ ...r,
54
+ ref: i,
55
+ tabIndex: -1,
56
+ className: e(v.fileList, t),
57
+ children: [/* @__PURE__ */ f(b, { containerRef: i }), n]
58
+ }) });
59
+ }, b = ({ containerRef: e }) => {
60
+ let t = g(), n = u(t);
61
+ return c(() => {
62
+ n.current = t;
63
+ }), c(() => {
64
+ let t = e.current;
65
+ if (!t) return;
66
+ let r = new MutationObserver((e) => {
67
+ e.some((e) => e.removedNodes.length > 0) && document.activeElement === document.body && (n.current?.focusFirst({ tabbable: !0 }) || t.focus());
68
+ });
69
+ return r.observe(t, { childList: !0 }), () => r.disconnect();
70
+ }, [e]), null;
71
+ }, x = {
72
+ en: {
73
+ removeFile: "Remove",
74
+ cancelUpload: "Cancel",
75
+ uploading: "Uploading",
76
+ uploadComplete: "Upload complete",
77
+ uploadFailed: "Upload failed"
78
+ },
79
+ sv: {
80
+ removeFile: "Ta bort",
81
+ cancelUpload: "Avbryt",
82
+ uploading: "Laddar upp",
83
+ uploadComplete: "Uppladdning klar",
84
+ uploadFailed: "Uppladdning misslyckades"
85
+ }
86
+ }, S = ({ fileName: t, fileSize: c, status: u = "idle", progress: m, errorMessage: g, onCancel: y, onDelete: b, className: S }) => {
87
+ let C = i(x), w = u === "uploading", T = u === "success", E = u === "error", D = E && !!g, O = l(), k = l(), A = T ? C.format("uploadComplete") : E ? C.format("uploadFailed") : void 0, j = [A && k, D && O].filter(Boolean).join(" ") || void 0, M = w ? y ?? b : b;
88
+ return /* @__PURE__ */ p("li", {
89
+ className: e(v.fileListItem, S),
90
+ "data-status": u,
91
+ children: [
92
+ /* @__PURE__ */ p("div", {
93
+ className: v.row,
94
+ children: [
95
+ /* @__PURE__ */ p("span", {
96
+ className: v.iconSlot,
97
+ children: [
98
+ w && /* @__PURE__ */ f(s, {
99
+ shape: "circular",
100
+ small: !0,
101
+ value: m,
102
+ isIndeterminate: m === void 0,
103
+ "aria-label": `${C.format("uploading")} ${t}`,
104
+ className: v.progressIcon
105
+ }),
106
+ /* @__PURE__ */ f("span", {
107
+ className: v.ring,
108
+ "aria-hidden": !0
109
+ }),
110
+ T && /* @__PURE__ */ f(n, {
111
+ status: "success",
112
+ "aria-hidden": !0,
113
+ size: 16,
114
+ className: e(v.checkmark, v.successIcon)
115
+ })
116
+ ]
117
+ }),
118
+ A && /* @__PURE__ */ f(h, {
119
+ id: k,
120
+ children: A
121
+ }),
122
+ /* @__PURE__ */ p("span", {
123
+ className: v.fileInfo,
124
+ children: [/* @__PURE__ */ f("span", {
125
+ className: v.fileName,
126
+ children: t
127
+ }), c && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(h, { children: ", " }), /* @__PURE__ */ f("span", {
128
+ className: v.fileSize,
129
+ children: c
130
+ })] })]
131
+ }),
132
+ M && /* @__PURE__ */ f(a, {
133
+ variant: "icon",
134
+ onPress: M,
135
+ "aria-label": `${C.format(w ? "cancelUpload" : "removeFile")} ${t}`,
136
+ "aria-describedby": j,
137
+ className: v.deleteButton,
138
+ children: f(w ? r : _, {
139
+ size: 20,
140
+ "aria-hidden": !0
141
+ })
142
+ })
143
+ ]
144
+ }),
145
+ /* @__PURE__ */ f("div", {
146
+ id: O,
147
+ className: v.errorReveal,
148
+ children: g && /* @__PURE__ */ f(o, {
149
+ isInvalid: !0,
150
+ children: g
151
+ })
152
+ }),
153
+ /* @__PURE__ */ p(h, {
154
+ role: "status",
155
+ children: [T && `${C.format("uploadComplete")}: ${t}`, D && `${t}: ${g}`]
156
+ })
157
+ ]
158
+ });
159
+ };
160
+ //#endregion
161
+ export { y as n, S as t };
@@ -0,0 +1,65 @@
1
+ import { t as e } from "./clsx-Di52oYUU.js";
2
+ import { t } from "./label-LWlgvAwz.js";
3
+ import "react";
4
+ import { ProgressBar as n } from "react-aria-components";
5
+ import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
6
+ import '../assets/progress-bar.css';var o = {
7
+ progressBar: "_progressBar_15k4b_1",
8
+ indeterminate: "_indeterminate_15k4b_1",
9
+ circularRotate: "_circularRotate_15k4b_1",
10
+ label: "_label_15k4b_9",
11
+ value: "_value_15k4b_14",
12
+ track: "_track_15k4b_19",
13
+ indicator: "_indicator_15k4b_29",
14
+ circular: "_circular_15k4b_53",
15
+ circularSmall: "_circularSmall_15k4b_59",
16
+ circularTrack: "_circularTrack_15k4b_65",
17
+ circularIndicator: "_circularIndicator_15k4b_75",
18
+ circularIndeterminate: "_circularIndeterminate_15k4b_87"
19
+ }, s = 8, c = 2 * Math.PI * s, l = c * .25, u = ({ label: u, labelProps: d, showValueLabel: f = !1, shape: p = "linear", small: m = !1, ...h }) => /* @__PURE__ */ i(n, {
20
+ ...h,
21
+ className: e(o.progressBar, h.className),
22
+ children: ({ percentage: n, valueText: h, isIndeterminate: g }) => /* @__PURE__ */ a(r, { children: [
23
+ u && /* @__PURE__ */ i(t, {
24
+ elementType: "span",
25
+ ...d,
26
+ className: e(d?.className, o.label),
27
+ children: u
28
+ }),
29
+ f && /* @__PURE__ */ i(t, {
30
+ elementType: "span",
31
+ ...d,
32
+ id: u ? "" : d?.id,
33
+ className: e(d?.className, o.value),
34
+ children: h
35
+ }),
36
+ p === "circular" ? /* @__PURE__ */ a("svg", {
37
+ className: e(o.circular, m && o.circularSmall),
38
+ viewBox: "0 0 20 20",
39
+ "aria-hidden": !0,
40
+ children: [/* @__PURE__ */ i("circle", {
41
+ className: o.circularTrack,
42
+ cx: 10,
43
+ cy: 10,
44
+ r: s
45
+ }), /* @__PURE__ */ i("circle", {
46
+ className: e(o.circularIndicator, g && o.circularIndeterminate),
47
+ cx: 10,
48
+ cy: 10,
49
+ r: s,
50
+ style: g ? { strokeDasharray: `${l} ${c}` } : {
51
+ strokeDasharray: c,
52
+ strokeDashoffset: c * (1 - (n ?? 0) / 100)
53
+ }
54
+ })]
55
+ }) : /* @__PURE__ */ i("div", {
56
+ className: o.track,
57
+ children: /* @__PURE__ */ i("div", {
58
+ className: o.indicator,
59
+ style: { width: `${g ? 50 : n}%` }
60
+ })
61
+ })
62
+ ] })
63
+ });
64
+ //#endregion
65
+ export { u as t };
@@ -1,19 +1,31 @@
1
1
  import { StoryObj } from '@storybook/react-vite';
2
+ import { default as React } from 'react';
2
3
  import { FileList } from './FileList';
3
4
  type Story = StoryObj<typeof FileList>;
4
5
  declare const _default: {
5
- component: ({ className, children, ...props }: import('./FileList').FileListProps) => import('react').JSX.Element;
6
+ component: ({ className, children, ...props }: import('./FileList').FileListProps) => React.JSX.Element;
6
7
  subcomponents: {
7
- FileListItem: ({ fileName, fileSize, onDelete, className, }: import('./FileListItem').FileListItemProps) => import('react').JSX.Element;
8
+ FileListItem: ({ fileName, fileSize, status, progress, errorMessage, onCancel, onDelete, className, }: import('./FileListItem').FileListItemProps) => React.JSX.Element;
8
9
  };
9
10
  title: string;
10
11
  tags: string[];
11
12
  args: {
12
13
  'aria-label': string;
13
14
  };
14
- render: (args: import('./FileList').FileListProps) => import('react').JSX.Element;
15
+ render: (args: import('./FileList').FileListProps) => React.JSX.Element;
15
16
  };
16
17
  export default _default;
17
18
  export declare const Default: Story;
18
19
  export declare const WithoutFileSize: Story;
19
20
  export declare const Empty: Story;
21
+ export declare const Uploading: Story;
22
+ export declare const UploadingDeterminate: Story;
23
+ export declare const Success: Story;
24
+ export declare const Error: Story;
25
+ export declare const MixedStates: Story;
26
+ export declare const AnimatedCompletion: StoryObj;
27
+ export declare const AnimatedFailure: StoryObj;
28
+ interface FocusTestContainerProps {
29
+ initialFiles: string[];
30
+ }
31
+ export declare const FocusManagementTest: StoryObj<FocusTestContainerProps>;
@@ -1,7 +1,27 @@
1
1
  export interface FileListItemProps {
2
2
  fileName: string;
3
3
  fileSize?: string;
4
+ /** @default 'idle' */
5
+ status?: 'idle' | 'uploading' | 'success' | 'error';
6
+ /** 0-100. Only meaningful when `status='uploading'`; omit for indeterminate. */
7
+ progress?: number;
8
+ /** Shown below the row when `status='error'`. */
9
+ errorMessage?: string;
10
+ /**
11
+ * Called when the cancel button is pressed while `status='uploading'` โ€”
12
+ * this is where you'd abort the in-flight request (e.g.
13
+ * `XMLHttpRequest.abort()` or `AbortController.abort()`). Falls back to
14
+ * `onDelete` if omitted, so an in-progress upload isn't silently left
15
+ * running in the background with no way to stop it.
16
+ */
17
+ onCancel?: () => void;
18
+ /**
19
+ * Called when the delete button is pressed for any status other than
20
+ * `uploading` (use `onCancel` for that). `FileList` has no concept of
21
+ * "uploaded" vs "local only" โ€” if the file is already persisted
22
+ * server-side by the time this fires, deleting it there too is your call.
23
+ */
4
24
  onDelete?: () => void;
5
25
  className?: string;
6
26
  }
7
- export declare const FileListItem: ({ fileName, fileSize, onDelete, className, }: FileListItemProps) => import('react').JSX.Element;
27
+ export declare const FileListItem: ({ fileName, fileSize, status, progress, errorMessage, onCancel, onDelete, className, }: FileListItemProps) => import('react').JSX.Element;
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "../chunks/file-list-TmEuO1fJ.js";
1
+ import { n as e, t } from "../chunks/file-list-B4vG_egr.js";
2
2
  export { e as FileList, t as FileListItem };
@@ -1,9 +1,17 @@
1
1
  declare const _default: {
2
2
  "en": {
3
- "removeFile": "Remove"
3
+ "removeFile": "Remove",
4
+ "cancelUpload": "Cancel",
5
+ "uploading": "Uploading",
6
+ "uploadComplete": "Upload complete",
7
+ "uploadFailed": "Upload failed"
4
8
  },
5
9
  "sv": {
6
- "removeFile": "Ta bort"
10
+ "removeFile": "Ta bort",
11
+ "cancelUpload": "Avbryt",
12
+ "uploading": "Laddar upp",
13
+ "uploadComplete": "Uppladdning klar",
14
+ "uploadFailed": "Uppladdning misslyckades"
7
15
  }
8
16
  }
9
17
  ;
package/index.js CHANGED
@@ -12,7 +12,7 @@ import { a as _, i as v, n as y, r as b, t as x } from "./chunks/layout-Db5um0f7
12
12
  import { i as S, n as C, r as w, t as T } from "./chunks/checkbox-Bqd8B58G.js";
13
13
  import { n as E, t as D } from "./chunks/color-scheme-switch-DVZjdwc9.js";
14
14
  import { t as O } from "./chunks/search-field-GNTRFpzf.js";
15
- import { n as k, t as A } from "./chunks/file-list-TmEuO1fJ.js";
15
+ import { n as k, t as A } from "./chunks/file-list-B4vG_egr.js";
16
16
  import { t as j } from "./chunks/useLocalizedStringFormatter-CeyBc0x0.js";
17
17
  import { n as M, t as N } from "./chunks/button-CenXTGXL.js";
18
18
  import { t as P } from "./chunks/heading-BEl_z-5T.js";
@@ -34,12 +34,12 @@ import { a as ve, i as ye, n as be, o as xe, r as Se, t as Ce } from "./chunks/m
34
34
  import { t as we } from "./chunks/combobox-DIou4Z-d.js";
35
35
  import { i as Te, n as Ee, r as De, t as Oe } from "./chunks/date-field-BF2f9bSf.js";
36
36
  import { t as ke } from "./chunks/drop-zone-DH3ZyHsr.js";
37
- import { t as Ae } from "./chunks/file-trigger-Dp5nH8oS.js";
38
- import { n as je, t as Me } from "./chunks/grid-Cn_8RSvj.js";
39
- import { t as Ne } from "./chunks/info-banner-osR4e6nB.js";
40
- import { n as Pe, t as Fe } from "./chunks/tooltip-BkesIUIF.js";
41
- import { n as Ie, t as Le } from "./chunks/logo-DyZ2pXt7.js";
42
- import { t as Re } from "./chunks/progress-bar-7w_kWo2f.js";
37
+ import { t as Ae } from "./chunks/progress-bar-CknF4qAm.js";
38
+ import { t as je } from "./chunks/file-trigger-Dp5nH8oS.js";
39
+ import { n as Me, t as Ne } from "./chunks/grid-Cn_8RSvj.js";
40
+ import { t as Pe } from "./chunks/info-banner-osR4e6nB.js";
41
+ import { n as Fe, t as Ie } from "./chunks/tooltip-BkesIUIF.js";
42
+ import { n as Le, t as Re } from "./chunks/logo-DyZ2pXt7.js";
43
43
  import { i as ze, n as Be, r as Ve, t as He } from "./chunks/radio-BD1EuxSa.js";
44
44
  import { t as Ue } from "./chunks/skeleton-B_BPRPJy.js";
45
45
  import { t as We } from "./chunks/stack-LF3ExhH9.js";
@@ -61,7 +61,7 @@ var ot = {
61
61
  description: "Midas Components",
62
62
  homepage: "https://designsystem.migrationsverket.se/",
63
63
  license: "CC0-1.0",
64
- version: "17.28.2",
64
+ version: "17.29.0",
65
65
  module: "./index.js",
66
66
  type: "module",
67
67
  main: "./index.js",
@@ -93,4 +93,4 @@ var ot = {
93
93
  }
94
94
  }.version;
95
95
  //#endregion
96
- export { e as Accordion, t as AccordionItem, F as Badge, I as BadgeContainer, R as Breadcrumb, L as Breadcrumbs, M as Button, N as ButtonGroup, h as Calendar, de as Card, se as CardActionArea, ae as CardActions, le as CardBody, ue as CardContent, pe as CardHeader, fe as CardImage, oe as CardLink, ce as CardTitle, d as Cell, me as CharacterCounter, C as Checkbox, w as CheckboxButton, S as CheckboxField, T as CheckboxGroup, E as ColorSchemeSwitch, D as ColorSchemeSwitchMenu, c as Column, we as ComboBox, he as ContrastFilled, Te as DateField, Ee as DateInput, Oe as DateInputDivider, p as DatePicker, m as DateRangePicker, De as DateSegment, U as DialogTrigger, ke as DropZone, G as FieldError, k as FileList, A as FileListItem, Ae as FileTrigger, at as GlobalToastRegion, je as Grid, Me as GridItem, b as Header, P as Heading, Ne as InfoBanner, Ze as Input, z as Label, x as Layout, a as Link, f as LinkButton, Y as ListBox, ee as ListBoxButton, te as ListBoxEmptyState, Z as ListBoxHeader, Q as ListBoxItem, $ as ListBoxLoadMoreItem, J as ListBoxPopover, X as ListBoxSection, Le as Logo, Ie as LogoContext, ve as Menu, ye as MenuItem, Se as MenuPopover, be as MenuSection, xe as MenuTrigger, V as Modal, H as ModalOverlay, y as Navbar, B as Popover, Re as ProgressBar, Be as Radio, Ve as RadioButton, ze as RadioField, He as RadioGroup, g as RangeCalendar, i as RouterProvider, u as Row, O as SearchField, q as Select, K as SelectTrigger, Ce as Separator, v as Sidebar, _ as SidebarLink, Ue as Skeleton, r as Spinner, We as Stack, qe as Tab, Je as TabList, Ke as TabPanel, s as Table, o as TableBody, l as TableHeader, Ge as Tabs, re as Tag, ie as TagGroup, ne as TagList, W as Text, Qe as TextArea, Xe as TextField, Ye as TextFieldBase, $e as TimeField, nt as Toast, it as ToastProvider, tt as ToastRegion, ge as ToggleButton, _e as ToggleButtonGroup, Fe as Tooltip, Pe as TooltipTrigger, ot as VERSION, n as clsx, et as toastQueue, j as useLocalizedStringFormatter, rt as useToastState };
96
+ export { e as Accordion, t as AccordionItem, F as Badge, I as BadgeContainer, R as Breadcrumb, L as Breadcrumbs, M as Button, N as ButtonGroup, h as Calendar, de as Card, se as CardActionArea, ae as CardActions, le as CardBody, ue as CardContent, pe as CardHeader, fe as CardImage, oe as CardLink, ce as CardTitle, d as Cell, me as CharacterCounter, C as Checkbox, w as CheckboxButton, S as CheckboxField, T as CheckboxGroup, E as ColorSchemeSwitch, D as ColorSchemeSwitchMenu, c as Column, we as ComboBox, he as ContrastFilled, Te as DateField, Ee as DateInput, Oe as DateInputDivider, p as DatePicker, m as DateRangePicker, De as DateSegment, U as DialogTrigger, ke as DropZone, G as FieldError, k as FileList, A as FileListItem, je as FileTrigger, at as GlobalToastRegion, Me as Grid, Ne as GridItem, b as Header, P as Heading, Pe as InfoBanner, Ze as Input, z as Label, x as Layout, a as Link, f as LinkButton, Y as ListBox, ee as ListBoxButton, te as ListBoxEmptyState, Z as ListBoxHeader, Q as ListBoxItem, $ as ListBoxLoadMoreItem, J as ListBoxPopover, X as ListBoxSection, Re as Logo, Le as LogoContext, ve as Menu, ye as MenuItem, Se as MenuPopover, be as MenuSection, xe as MenuTrigger, V as Modal, H as ModalOverlay, y as Navbar, B as Popover, Ae as ProgressBar, Be as Radio, Ve as RadioButton, ze as RadioField, He as RadioGroup, g as RangeCalendar, i as RouterProvider, u as Row, O as SearchField, q as Select, K as SelectTrigger, Ce as Separator, v as Sidebar, _ as SidebarLink, Ue as Skeleton, r as Spinner, We as Stack, qe as Tab, Je as TabList, Ke as TabPanel, s as Table, o as TableBody, l as TableHeader, Ge as Tabs, re as Tag, ie as TagGroup, ne as TagList, W as Text, Qe as TextArea, Xe as TextField, Ye as TextFieldBase, $e as TimeField, nt as Toast, it as ToastProvider, tt as ToastRegion, ge as ToggleButton, _e as ToggleButtonGroup, Ie as Tooltip, Fe as TooltipTrigger, ot as VERSION, n as clsx, et as toastQueue, j as useLocalizedStringFormatter, rt as useToastState };
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "description": "Midas Components",
15
15
  "homepage": "https://designsystem.migrationsverket.se/",
16
16
  "license": "CC0-1.0",
17
- "version": "17.28.2",
17
+ "version": "17.29.0",
18
18
  "module": "./index.js",
19
19
  "type": "module",
20
20
  "main": "./index.js",
@@ -13,5 +13,16 @@ export interface ProgressBarProps extends AriaProgressBarProps {
13
13
  * Show the value label
14
14
  */
15
15
  showValueLabel?: boolean;
16
+ /**
17
+ * Renders a linear bar or a small circular ring.
18
+ * @default 'linear'
19
+ */
20
+ shape?: 'linear' | 'circular';
21
+ /**
22
+ * Renders a smaller (20px) circular indicator, matching Spinner's `small` size.
23
+ * Only meaningful when `shape='circular'`.
24
+ * @default false
25
+ */
26
+ small?: boolean;
16
27
  }
17
28
  export declare const ProgressBar: React.FC<ProgressBarProps>;
@@ -13,3 +13,6 @@ export default _default;
13
13
  export declare const Primary: Story;
14
14
  export declare const WithoutLabels: Story;
15
15
  export declare const IsIndeterminate: Story;
16
+ export declare const Circular: Story;
17
+ export declare const CircularSmall: Story;
18
+ export declare const CircularIndeterminate: Story;
@@ -1,2 +1,2 @@
1
- import { t as e } from "../chunks/progress-bar-7w_kWo2f.js";
1
+ import { t as e } from "../chunks/progress-bar-CknF4qAm.js";
2
2
  export { e as ProgressBar };
@@ -1,68 +0,0 @@
1
- 'use client';
2
- import { t as e } from "./clsx-Di52oYUU.js";
3
- import { t } from "./createLucideIcon-BgluSHFG.js";
4
- import { t as n } from "./useLocalizedStringFormatter-CeyBc0x0.js";
5
- import { n as r } from "./button-CenXTGXL.js";
6
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
- import '../assets/file-list.css';var o = t("trash-2", [
8
- ["path", {
9
- d: "M10 11v6",
10
- key: "nco0om"
11
- }],
12
- ["path", {
13
- d: "M14 11v6",
14
- key: "outv1u"
15
- }],
16
- ["path", {
17
- d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",
18
- key: "miytrc"
19
- }],
20
- ["path", {
21
- d: "M3 6h18",
22
- key: "d0wm0j"
23
- }],
24
- ["path", {
25
- d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",
26
- key: "e791ji"
27
- }]
28
- ]), s = {
29
- fileList: "_fileList_1jd3b_1",
30
- fileListItem: "_fileListItem_1jd3b_10",
31
- fileInfo: "_fileInfo_1jd3b_20",
32
- fileName: "_fileName_1jd3b_28",
33
- fileSize: "_fileSize_1jd3b_37",
34
- deleteButton: "_deleteButton_1jd3b_43"
35
- }, c = ({ className: t, children: n, ...r }) => /* @__PURE__ */ i("ul", {
36
- ...r,
37
- className: e(s.fileList, t),
38
- children: n
39
- }), l = {
40
- en: { removeFile: "Remove" },
41
- sv: { removeFile: "Ta bort" }
42
- }, u = ({ fileName: t, fileSize: c, onDelete: u, className: d }) => {
43
- let f = n(l);
44
- return /* @__PURE__ */ a("li", {
45
- className: e(s.fileListItem, d),
46
- children: [/* @__PURE__ */ a("span", {
47
- className: s.fileInfo,
48
- children: [/* @__PURE__ */ i("span", {
49
- className: s.fileName,
50
- children: t
51
- }), c && /* @__PURE__ */ i("span", {
52
- className: s.fileSize,
53
- children: c
54
- })]
55
- }), u && /* @__PURE__ */ i(r, {
56
- variant: "icon",
57
- onPress: u,
58
- "aria-label": `${f.format("removeFile")} ${t}`,
59
- className: s.deleteButton,
60
- children: /* @__PURE__ */ i(o, {
61
- size: 20,
62
- "aria-hidden": !0
63
- })
64
- })]
65
- });
66
- };
67
- //#endregion
68
- export { c as n, u as t };
@@ -1,40 +0,0 @@
1
- import { t as e } from "./clsx-Di52oYUU.js";
2
- import { t } from "./label-LWlgvAwz.js";
3
- import "react";
4
- import { ProgressBar as n } from "react-aria-components";
5
- import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
6
- import '../assets/progress-bar.css';var o = {
7
- progressBar: "_progressBar_13dw9_1",
8
- indeterminate: "_indeterminate_13dw9_1",
9
- label: "_label_13dw9_9",
10
- value: "_value_13dw9_14",
11
- track: "_track_13dw9_19",
12
- indicator: "_indicator_13dw9_29"
13
- }, s = ({ label: s, labelProps: c, showValueLabel: l = !1, ...u }) => /* @__PURE__ */ i(n, {
14
- ...u,
15
- className: e(o.progressBar, u.className),
16
- children: ({ percentage: n, valueText: u, isIndeterminate: d }) => /* @__PURE__ */ a(r, { children: [
17
- s && /* @__PURE__ */ i(t, {
18
- elementType: "span",
19
- ...c,
20
- className: e(c?.className, o.label),
21
- children: s
22
- }),
23
- l && /* @__PURE__ */ i(t, {
24
- elementType: "span",
25
- ...c,
26
- id: s ? "" : c?.id,
27
- className: e(c?.className, o.value),
28
- children: u
29
- }),
30
- /* @__PURE__ */ i("div", {
31
- className: o.track,
32
- children: /* @__PURE__ */ i("div", {
33
- className: o.indicator,
34
- style: { width: `${d ? 50 : n}%` }
35
- })
36
- })
37
- ] })
38
- });
39
- //#endregion
40
- export { s as t };