@midas-ds/components 17.25.2 โ†’ 17.26.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.26.0 (2026-09-23)
2
+
3
+ ### ๐Ÿš€ Features
4
+
5
+ - **components,dropzone:** add Dropzone as its own component with error/focus/drop-target states ([3b92846fd0c](https://github.com/migrationsverket/midas/commit/3b92846fd0c))
6
+
7
+ ### ๐Ÿฉน Fixes
8
+
9
+ - **components,drop-zone:** fix padding token, remove hardcoded height, and disabled border regression ([0bb4fb196ff](https://github.com/migrationsverket/midas/commit/0bb4fb196ff))
10
+
11
+ ### ๐Ÿ”ง Maintenance
12
+
13
+ - **components,drop-zone:** rename dropzone folder and class, type WithFileTrigger story ([396d9c77381](https://github.com/migrationsverket/midas/commit/396d9c77381))
14
+ - **components,file-trigger:** rename file-upload folder, drop React.FC typing ([4e1d4638f93](https://github.com/migrationsverket/midas/commit/4e1d4638f93))
15
+
16
+ ### ๐Ÿงช Tests updated
17
+
18
+ - **components,layout,table-styles,test-utils:** add translation coverage checks ([270662927ee](https://github.com/migrationsverket/midas/commit/270662927ee))
19
+
1
20
  ## 17.25.2 (2026-09-18)
2
21
 
3
22
  ### ๐Ÿงฑ Updated Dependencies
@@ -0,0 +1 @@
1
+ ._dropZone_1g3sx_1{--dropzone-border-color:var(--midas-border-color-primary);--dropzone-border-width:1px;--dropzone-border-style:dashed;--dropzone-background-color:var(--midas-background-base);font-family:var(--midas-typography-font-family);color:var(--midas-text-primary);background-color:var(--dropzone-background-color);box-sizing:border-box;border:var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);padding:calc(var(--midas-space-medium) - var(--dropzone-border-width));align-items:center;gap:var(--midas-space-medium);text-align:center;flex-direction:column;display:flex}._dropZone_1g3sx_1 [slot=label]{flex-direction:column;justify-content:center;align-items:center;width:100%;display:flex}._dropZone_1g3sx_1 [slot=errorMessage]:before{margin:0}._dropZone_1g3sx_1[data-drop-target]{--dropzone-border-width:2px;--dropzone-border-color:var(--midas-border-color-tertiary);--dropzone-background-color:var(--midas-support-background-info)}._dropZone_1g3sx_1[data-focus-visible]{box-shadow:var(--midas-state-focus);outline:none}@media (forced-colors:active){._dropZone_1g3sx_1[data-focus-visible]{outline-offset:2px;outline:3px solid highlight}}._dropZone_1g3sx_1[data-invalid]{--dropzone-border-width:2px;--dropzone-border-style:solid;--dropzone-border-color:var(--midas-support-border-warning)}._dropZone_1g3sx_1[data-disabled]{color:var(--midas-text-disabled);--dropzone-border-color:var(--midas-border-color-disabled);cursor:not-allowed}._dropZone_1g3sx_1[data-disabled] [slot=label]{color:var(--midas-text-disabled)}
@@ -0,0 +1,25 @@
1
+ 'use client';
2
+ import { t as e } from "./clsx-B1NYyfch.js";
3
+ import { forwardRef as t } from "react";
4
+ import { DropZone as n, FieldErrorContext as r, composeRenderProps as i } from "react-aria-components";
5
+ import { jsx as a } from "react/jsx-runtime";
6
+ import '../assets/drop-zone.css';var o = { dropZone: "_dropZone_1g3sx_1" }, s = t(({ className: t, isInvalid: s, children: c, ...l }, u) => {
7
+ let d = s ? {
8
+ isInvalid: !0,
9
+ validationErrors: [],
10
+ validationDetails: {}
11
+ } : null;
12
+ return /* @__PURE__ */ a(n, {
13
+ ...l,
14
+ ref: u,
15
+ "data-invalid": s || void 0,
16
+ className: e(o.dropZone, t),
17
+ children: i(c, (e) => /* @__PURE__ */ a(r.Provider, {
18
+ value: d,
19
+ children: e
20
+ }))
21
+ });
22
+ });
23
+ s.displayName = "DropZone";
24
+ //#endregion
25
+ export { s as t };
@@ -0,0 +1,7 @@
1
+ 'use client';
2
+ import { FileTrigger as e } from "react-aria-components";
3
+ import { jsx as t } from "react/jsx-runtime";
4
+ //#region src/file-trigger/FileTrigger.tsx
5
+ var n = (n) => /* @__PURE__ */ t(e, { ...n });
6
+ //#endregion
7
+ export { n as t };
@@ -0,0 +1,21 @@
1
+ import { DropZoneProps as AriaDropZoneProps } from 'react-aria-components';
2
+ export interface DropZoneProps extends AriaDropZoneProps {
3
+ /**
4
+ * Marks the dropzone as invalid, e.g. after a failed validation. Pair with
5
+ * `FieldError` to render the error message, either inside or below the
6
+ * dropzone depending on where it's composed.
7
+ *
8
+ * @default false
9
+ */
10
+ isInvalid?: boolean;
11
+ }
12
+ /**
13
+ * A drop zone is an area into which one or multiple objects can be dragged
14
+ * and dropped. Content is fully composable โ€” pair it with `FileTrigger` for
15
+ * file uploads, or use it for any other drag-and-drop interaction.
16
+ *
17
+ * @interface DropZoneProps
18
+ *
19
+ * @see {@link https://react-spectrum.adobe.com/react-aria/DropZone.html|React Aria DropZone}
20
+ */
21
+ export declare const DropZone: import('react').ForwardRefExoticComponent<DropZoneProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,16 @@
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { DropZone } from './DropZone';
3
+ declare const meta: Meta<typeof DropZone>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof meta>;
6
+ export declare const Default: Story;
7
+ export declare const WithUploadButton: Story;
8
+ export declare const WithFieldLabel: Story;
9
+ export declare const Invalid: Story;
10
+ export declare const RejectsWrongFileType: Story;
11
+ export declare const RejectsTypeBeforeDrop: Story;
12
+ export declare const Disabled: Story;
13
+ interface DropZoneTestContainerProps {
14
+ onSelect: (files: File[]) => void;
15
+ }
16
+ export declare const WithFileTrigger: StoryObj<DropZoneTestContainerProps>;
@@ -0,0 +1 @@
1
+ export * from './DropZone';
@@ -0,0 +1,2 @@
1
+ import { t as e } from "../chunks/drop-zone-DvQLpgq6.js";
2
+ export { e as DropZone };
@@ -0,0 +1,2 @@
1
+ import { FileTriggerProps } from 'react-aria-components';
2
+ export declare const FileTrigger: (props: FileTriggerProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { FileTrigger } from './FileTrigger';
@@ -0,0 +1,2 @@
1
+ import { t as e } from "../chunks/file-trigger-Dp5nH8oS.js";
2
+ export { e as FileTrigger };
package/index.d.ts CHANGED
@@ -11,9 +11,10 @@ export * from './combobox';
11
11
  export * from './common/types';
12
12
  export * from './date-field';
13
13
  export * from './date-picker';
14
+ export * from './drop-zone';
14
15
  export * from './field-error';
15
16
  export * from './file-list';
16
- export * from './file-upload';
17
+ export * from './file-trigger';
17
18
  export * from './grid';
18
19
  export * from './heading';
19
20
  export * from './info-banner';
package/index.js CHANGED
@@ -31,7 +31,8 @@ import { a as ae, i as oe, n as se, o as ce, r as le, t as ue } from "./chunks/m
31
31
  import { t as de } from "./chunks/combobox-DDO4fEtI.js";
32
32
  import { a as fe, c as pe, i as me, n as he, o as ge, r as _e, s as ve, t as ye } from "./chunks/list-box-VdBVTwZK.js";
33
33
  import { i as be, n as xe, r as Se, t as Ce } from "./chunks/date-field-DG5TYsTF.js";
34
- import { n as we, t as Te } from "./chunks/file-upload-DInuSFCB.js";
34
+ import { t as we } from "./chunks/drop-zone-DvQLpgq6.js";
35
+ import { t as Te } from "./chunks/file-trigger-Dp5nH8oS.js";
35
36
  import { n as Ee, t as De } from "./chunks/grid-DZB3GGDg.js";
36
37
  import { t as Oe } from "./chunks/info-banner-DnFNZ1_o.js";
37
38
  import { n as ke, t as Ae } from "./chunks/tooltip-D7LYQwj0.js";
@@ -59,7 +60,7 @@ var it = {
59
60
  description: "Midas Components",
60
61
  homepage: "https://designsystem.migrationsverket.se/",
61
62
  license: "CC0-1.0",
62
- version: "17.25.2",
63
+ version: "17.26.0",
63
64
  module: "./index.js",
64
65
  type: "module",
65
66
  main: "./index.js",
@@ -91,4 +92,4 @@ var it = {
91
92
  }
92
93
  }.version;
93
94
  //#endregion
94
- 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, b as Calendar, q as Card, U as CardActionArea, V as CardActions, G as CardBody, K as CardContent, Y as CardHeader, J as CardImage, H as CardLink, W as CardTitle, g as Cell, X as CharacterCounter, C as Checkbox, w as CheckboxButton, S as CheckboxField, T as CheckboxGroup, E as ColorSchemeSwitch, D as ColorSchemeSwitchMenu, p as Column, de as ComboBox, ne as ContrastFilled, be as DateField, xe as DateInput, Ce as DateInputDivider, v as DatePicker, y as DateRangePicker, Se as DateSegment, te as DialogTrigger, Te as DropZone, B as FieldError, k as FileList, A as FileListItem, we as FileTrigger, rt as GlobalToastRegion, Ee as Grid, De as GridItem, s as Header, P as Heading, Oe as InfoBanner, Ye as Input, Z as Label, c as Layout, u as Link, _ as LinkButton, pe as ListBox, ve as ListBoxButton, ye as ListBoxEmptyState, he as ListBoxHeader, ge as ListBoxItem, _e as ListBoxLoadMoreItem, fe as ListBoxPopover, me as ListBoxSection, Me as Logo, je as LogoContext, ae as Menu, oe as MenuItem, le as MenuPopover, se as MenuSection, ce as MenuTrigger, $ as Modal, ee as ModalOverlay, o as Navbar, Q as Popover, Ne as ProgressBar, Fe as Radio, Ie as RadioButton, Pe as RadioField, Le as RadioGroup, x as RangeCalendar, l as RouterProvider, h as Row, O as SearchField, Re as Select, ue as Separator, a as Sidebar, i as SidebarLink, He as Skeleton, r as Spinner, Ge as Tab, Ke as TabList, We as TabPanel, f as Table, d as TableBody, m as TableHeader, Ue as Tabs, Be as Tag, Ve as TagGroup, ze as TagList, z as Text, Xe as TextArea, Je as TextField, qe as TextFieldBase, Ze as TimeField, et as Toast, nt as ToastProvider, $e as ToastRegion, re as ToggleButton, ie as ToggleButtonGroup, Ae as Tooltip, ke as TooltipTrigger, it as VERSION, n as clsx, Qe as toastQueue, j as useLocalizedStringFormatter, tt as useToastState };
95
+ 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, b as Calendar, q as Card, U as CardActionArea, V as CardActions, G as CardBody, K as CardContent, Y as CardHeader, J as CardImage, H as CardLink, W as CardTitle, g as Cell, X as CharacterCounter, C as Checkbox, w as CheckboxButton, S as CheckboxField, T as CheckboxGroup, E as ColorSchemeSwitch, D as ColorSchemeSwitchMenu, p as Column, de as ComboBox, ne as ContrastFilled, be as DateField, xe as DateInput, Ce as DateInputDivider, v as DatePicker, y as DateRangePicker, Se as DateSegment, te as DialogTrigger, we as DropZone, B as FieldError, k as FileList, A as FileListItem, Te as FileTrigger, rt as GlobalToastRegion, Ee as Grid, De as GridItem, s as Header, P as Heading, Oe as InfoBanner, Ye as Input, Z as Label, c as Layout, u as Link, _ as LinkButton, pe as ListBox, ve as ListBoxButton, ye as ListBoxEmptyState, he as ListBoxHeader, ge as ListBoxItem, _e as ListBoxLoadMoreItem, fe as ListBoxPopover, me as ListBoxSection, Me as Logo, je as LogoContext, ae as Menu, oe as MenuItem, le as MenuPopover, se as MenuSection, ce as MenuTrigger, $ as Modal, ee as ModalOverlay, o as Navbar, Q as Popover, Ne as ProgressBar, Fe as Radio, Ie as RadioButton, Pe as RadioField, Le as RadioGroup, x as RangeCalendar, l as RouterProvider, h as Row, O as SearchField, Re as Select, ue as Separator, a as Sidebar, i as SidebarLink, He as Skeleton, r as Spinner, Ge as Tab, Ke as TabList, We as TabPanel, f as Table, d as TableBody, m as TableHeader, Ue as Tabs, Be as Tag, Ve as TagGroup, ze as TagList, z as Text, Xe as TextArea, Je as TextField, qe as TextFieldBase, Ze as TimeField, et as Toast, nt as ToastProvider, $e as ToastRegion, re as ToggleButton, ie as ToggleButtonGroup, Ae as Tooltip, ke as TooltipTrigger, it as VERSION, n as clsx, Qe as toastQueue, j as useLocalizedStringFormatter, tt 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.25.2",
17
+ "version": "17.26.0",
18
18
  "module": "./index.js",
19
19
  "type": "module",
20
20
  "main": "./index.js",
@@ -1 +0,0 @@
1
- ._dropzone_pm0xi_1{font-family:var(--midas-typography-font-family);color:var(--midas-text-primary);border:1px dashed var(--midas-border-color-subtle);text-align:center;background-color:var(--midas-background-base);padding:1.5rem}._dropzone_pm0xi_1 [slot=label]{margin-top:1rem;display:block}._dropzone_pm0xi_1[data-drop-target]{background:var(--midas-background-hover);border:1px solid var(--midas-border-color-primary)}
@@ -1,11 +0,0 @@
1
- 'use client';
2
- import { t as e } from "./clsx-B1NYyfch.js";
3
- import "react";
4
- import { DropZone as t, FileTrigger as n } from "react-aria-components";
5
- import { jsx as r } from "react/jsx-runtime";
6
- import '../assets/file-upload.css';var i = { dropzone: "_dropzone_pm0xi_1" }, a = ({ className: n, ...a }) => /* @__PURE__ */ r(t, {
7
- ...a,
8
- className: e(i.dropzone, n)
9
- }), o = (e) => /* @__PURE__ */ r(n, { ...e });
10
- //#endregion
11
- export { o as n, a as t };
@@ -1,6 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react-vite';
2
- import { DropZone } from './FileUpload';
3
- declare const meta: Meta<typeof DropZone>;
4
- export default meta;
5
- type Story = StoryObj<typeof meta>;
6
- export declare const Default: Story;
@@ -1,4 +0,0 @@
1
- import { DropZoneProps, FileTriggerProps } from 'react-aria-components';
2
- import * as React from 'react';
3
- export declare const DropZone: React.FC<DropZoneProps>;
4
- export declare const FileTrigger: React.FC<FileTriggerProps>;
@@ -1,11 +0,0 @@
1
- import { StoryObj } from '@storybook/react-vite';
2
- import { DropZone } from './FileUpload';
3
- type Story = StoryObj<typeof DropZone>;
4
- declare const _default: {
5
- component: import('react').FC<import('react-aria-components').DropZoneProps>;
6
- title: string;
7
- tags: string[];
8
- args: {};
9
- };
10
- export default _default;
11
- export declare const DropIt: Story;
@@ -1 +0,0 @@
1
- export { FileTrigger, DropZone } from './FileUpload';
@@ -1,2 +0,0 @@
1
- import { n as e, t } from "../chunks/file-upload-DInuSFCB.js";
2
- export { t as DropZone, e as FileTrigger };