@midas-ds/components 8.3.0 → 10.0.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/label/Label.d.ts CHANGED
@@ -1,9 +1,3 @@
1
- import { LabelProps as AriaLabelProps } from 'react-aria-components';
1
+ import { LabelProps } from 'react-aria-components';
2
2
  import * as React from 'react';
3
- export interface LabelProps extends AriaLabelProps {
4
- /**
5
- * @deprecated since v8.2.0 Please use Label without variant for label-02, and for label-01 use Text component with slot: 'description'
6
- */
7
- variant?: 'label-01' | 'label-02';
8
- }
9
3
  export declare const Label: React.FC<LabelProps>;
@@ -43,9 +43,14 @@ export interface MidasLayout {
43
43
  app: App;
44
44
  /** Provide the layout with your router for client side navigation
45
45
  *
46
- * @see {@link https://designsystem.migrationsverket.se/dev/client-side-routing/}
46
+ * @see {@link https://designsystem.migrationsverket.se/dev/client-side-routing/|Client side routing}
47
47
  */
48
48
  clientSideRouter?: (path: string, routerOptions: undefined) => void;
49
+ /**
50
+ * Converts a router-specific href to a native HTML href, e.g. prepending a base path.
51
+ * Use this if you're using React Router's `basename` option.
52
+ * @see {@link https://reactrouter.com/en/main/hooks/use-href/|useHref}
53
+ */
49
54
  clientSideHref?: (href: Href) => string;
50
55
  variant: 'internal' | 'external';
51
56
  }
package/modal/Dialog.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { AriaDialogProps } from 'react-aria';
2
2
  import { DialogTrigger } from 'react-aria-components';
3
3
  import { AriaModalOverlayProps } from '@react-aria/overlays';
4
- import { OverlayTriggerProps } from '@react-types/overlays';
5
4
  import * as React from 'react';
6
5
  interface DialogProps extends AriaDialogProps {
7
6
  /**
@@ -10,18 +9,5 @@ interface DialogProps extends AriaDialogProps {
10
9
  title?: React.ReactNode;
11
10
  children: React.ReactNode;
12
11
  }
13
- /** @deprecated since v6.0.0 use Modal instead.
14
- * See docs {@link https://designsystem.migrationsverket.se/|Midas}
15
- */
16
- export declare const Dialog: React.FC<DialogProps>;
17
- /** @deprecated since v6.0.0, use DialogTrigger instead.
18
- * See docs {@link https://designsystem.migrationsverket.se/|Midas}
19
- */
20
- export declare const ModalTrigger: React.FC<OverlayTriggerProps & {
21
- isDismissable?: boolean;
22
- } & {
23
- children: (close: () => void) => JSX.Element;
24
- label?: string | undefined;
25
- }>;
26
12
  export { DialogTrigger };
27
13
  export declare const Modal: React.FC<AriaModalOverlayProps & DialogProps>;
package/modal/index.d.ts CHANGED
@@ -1 +1 @@
1
- export { Dialog, ModalTrigger, Modal, DialogTrigger } from './Dialog';
1
+ export { Modal, DialogTrigger } from './Dialog';
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": "8.3.0",
17
+ "version": "10.0.0",
18
18
  "main": "./index.cjs",
19
19
  "module": "./index.js",
20
20
  "types": "./index.d.ts",
@@ -27,7 +27,8 @@
27
27
  ],
28
28
  "repository": {
29
29
  "type": "git",
30
- "url": "https://github.com/migrationsverket/midas"
30
+ "url": "git+https://github.com/migrationsverket/midas.git",
31
+ "directory": "packages/components"
31
32
  },
32
33
  "peerDependencies": {
33
34
  "react": "^18.3.1 || ^19.0.0",
@@ -1,5 +1,4 @@
1
- import { ProgressBarProps as AriaProgressBarProps } from 'react-aria-components';
2
- import { LabelProps } from '../label';
1
+ import { LabelProps, ProgressBarProps as AriaProgressBarProps } from 'react-aria-components';
3
2
  import * as React from 'react';
4
3
  interface ProgressBarProps extends AriaProgressBarProps {
5
4
  /**
@@ -1,4 +1,5 @@
1
1
  import { SearchFieldProps as AriaSearchFieldProps } from 'react-aria-components';
2
+ import { Size } from '../common/types';
2
3
  import * as React from 'react';
3
4
  export interface SearchFieldProps extends Omit<AriaSearchFieldProps, 'isRequired'> {
4
5
  /** Placeholder text */
@@ -14,5 +15,9 @@ export interface SearchFieldProps extends Omit<AriaSearchFieldProps, 'isRequired
14
15
  */
15
16
  errorMessage?: string;
16
17
  errorPosition?: 'top' | 'bottom';
18
+ /** Component size (large: height 48px, medium: height 40px)
19
+ * @default 'large'
20
+ * */
21
+ size?: Size;
17
22
  }
18
23
  export declare const SearchField: React.FC<SearchFieldProps>;
@@ -1,5 +1,6 @@
1
1
  import { CollectionChildren } from '@react-types/shared';
2
2
  import { useMultiSelectState } from './useMultiSelectState';
3
+ import { Size } from '../common/types';
3
4
  import * as React from 'react';
4
5
  export type OptionItem = {
5
6
  children?: never;
@@ -66,6 +67,10 @@ export type SelectProps = {
66
67
  /** Name of the field, for uncontrolled use */
67
68
  name?: string;
68
69
  errorPosition?: 'top' | 'bottom';
70
+ /** Component size (large: height 48px, medium: height 40px)
71
+ * @default 'large'
72
+ * */
73
+ size?: Size;
69
74
  };
70
75
  export declare const SelectComponent: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLButtonElement>>;
71
76
  export declare const Select: React.ForwardRefExoticComponent<Omit<SelectProps, "children" | "items"> & {
@@ -1,9 +1,21 @@
1
1
  import * as React from 'react';
2
- type SkeletonProps = {
3
- width?: string | number;
4
- height?: string | number;
5
- variant?: 'circle' | 'rectangular';
6
- animation?: 'wave' | false;
7
- };
2
+ export interface SkeletonProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
3
+ /**
4
+ * Use valid CSS [length](https://developer.mozilla.org/en-US/docs/Web/CSS/length) units
5
+ */
6
+ width?: React.CSSProperties['width'];
7
+ /**
8
+ * Use valid CSS [length](https://developer.mozilla.org/en-US/docs/Web/CSS/length) units
9
+ */
10
+ height?: React.CSSProperties['height'];
11
+ /**
12
+ * Circular or rectangular Skeleton component. When using circle, only `width` is allowed to control size.
13
+ */
14
+ variant?: 'circle' | 'rectangle';
15
+ /**
16
+ * Displays the skeleton component with a wave animation
17
+ * @default true
18
+ */
19
+ isAnimated?: boolean;
20
+ }
8
21
  export declare const Skeleton: React.FC<SkeletonProps>;
9
- export {};
@@ -7,10 +7,5 @@ export interface SpinnerProps {
7
7
  * @default false
8
8
  */
9
9
  isOnColor?: boolean;
10
- /** For use on dark background
11
- * @default false
12
- * @deprecated since v8.0.0 please use `isOnColor` instead
13
- */
14
- dark?: boolean;
15
10
  }
16
11
  export declare const Spinner: React.FC<SpinnerProps>;
package/table/Table.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { RowProps, TableHeaderProps, ColumnProps, TableProps as AriaTableProps, CellProps, TableBody } from 'react-aria-components';
2
2
  export interface TableProps extends AriaTableProps {
3
3
  /**
4
- * @deprecated since v8.0.0 This variant will be replaced with a new scaling api accross all components.
4
+ * A more compact version of the table
5
5
  */
6
6
  narrow?: boolean;
7
7
  /**
package/tabs/Tabs.d.ts CHANGED
@@ -13,10 +13,5 @@ export interface TabsProps extends Omit<AriaTabsProps, 'orientation'> {
13
13
  * Amount of children must match the amount of tabs
14
14
  */
15
15
  children: React.ReactNode;
16
- /**
17
- * @deprecated since v8.0.0
18
- * Please use `defaultSelectedKey` instead
19
- */
20
- defaultSelected?: string;
21
16
  }
22
17
  export declare const Tabs: React.FC<TabsProps>;
@@ -1,7 +1,10 @@
1
1
  import { TextFieldBaseProps } from './TextFieldBase';
2
2
  import { TextAreaProps as AriaTextAreaProps } from 'react-aria-components';
3
3
  import * as React from 'react';
4
- export interface TextAreaProps extends Omit<TextFieldBaseProps, 'children' | 'type'> {
4
+ export interface TextAreaProps extends Omit<TextFieldBaseProps, 'children' | 'type' | 'pattern'> {
5
5
  className?: AriaTextAreaProps['className'];
6
+ form?: string;
7
+ rows?: number;
8
+ wrap?: string;
6
9
  }
7
10
  export declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<HTMLTextAreaElement>>;
@@ -3,5 +3,7 @@ import { InputProps } from './Input';
3
3
  import * as React from 'react';
4
4
  export interface TextFieldProps extends Omit<TextFieldBaseProps, 'children'> {
5
5
  className?: InputProps['className'];
6
+ form?: string;
7
+ list?: string;
6
8
  }
7
9
  export declare const TextField: React.ForwardRefExoticComponent<TextFieldProps & React.RefAttributes<HTMLInputElement>>;
@@ -1,6 +1,6 @@
1
1
  import { TextFieldProps, ValidationResult } from 'react-aria-components';
2
+ import { Size } from '../common/types';
2
3
  import * as React from 'react';
3
- export type Size = 'medium' | 'large';
4
4
  export interface TextFieldBaseProps extends Omit<TextFieldProps, 'className'> {
5
5
  children?: React.ReactNode;
6
6
  /** Specify label displayed above the TextField*/
package/theme/index.d.ts CHANGED
@@ -28,14 +28,18 @@ export declare const theme: {
28
28
  blue10: string;
29
29
  blue20: string;
30
30
  blue40: string;
31
+ blue50: string;
31
32
  blue60: string;
33
+ blue70: string;
32
34
  blue80: string;
33
35
  blue90: string;
34
36
  blue100: string;
35
- blue140: string;
36
- blue170: string;
37
+ blue110: string;
38
+ blue120: string;
39
+ blue130: string;
40
+ blue150: string;
37
41
  purple80: string;
38
- purple140: string;
42
+ purple110: string;
39
43
  red100: string;
40
44
  signalBlue10: string;
41
45
  signalBlue100: string;
@@ -44,34 +48,49 @@ export declare const theme: {
44
48
  signalGreen100: string;
45
49
  signalYellow10: string;
46
50
  signalYellow100: string;
51
+ signalRed10: string;
47
52
  signalRed20: string;
48
53
  signalRed30: string;
54
+ signalRed40: string;
55
+ signalRed50: string;
56
+ signalRed60: string;
57
+ signalRed70: string;
49
58
  signalRed80: string;
59
+ signalRed90: string;
50
60
  signalRed100: string;
61
+ signalRed110: string;
62
+ signalRed120: string;
63
+ signalRed130: string;
64
+ signalRed140: string;
65
+ signalRed150: string;
51
66
  signalRed160: string;
67
+ signalRed170: string;
52
68
  signalRed180: string;
69
+ signalRed190: string;
70
+ signalRed200: string;
53
71
  };
54
72
  typography: {
55
73
  fontFamily: string;
56
- lineHeight01: number;
57
- lineHeight02: number;
58
- lineHeight03: number;
59
- lineHeight04: number;
60
- lineHeight05: number;
61
- lineHeight06: number;
62
- lineHeight07: number;
63
- lineHeight08: number;
64
- lineHeight09: number;
65
- size01: string;
66
- size02: string;
67
- size03: string;
68
- size04: string;
69
- size05: string;
70
- size06: string;
71
- size07: string;
72
- size08: string;
73
- size09: string;
74
- size10: string;
74
+ lineHeight10: number;
75
+ lineHeight20: number;
76
+ lineHeight30: number;
77
+ lineHeight40: number;
78
+ lineHeight50: number;
79
+ lineHeight60: number;
80
+ lineHeight70: number;
81
+ lineHeight80: number;
82
+ lineHeight90: number;
83
+ lineHeight100: number;
84
+ fontSize10: string;
85
+ fontSize20: string;
86
+ fontSize30: string;
87
+ fontSize40: string;
88
+ fontSize50: string;
89
+ fontSize60: string;
90
+ fontSize70: string;
91
+ fontSize80: string;
92
+ fontSize90: string;
93
+ fontSize100: string;
75
94
  weightThin: number;
76
95
  weightExtraLight: number;
77
96
  weightLight: number;
@@ -83,18 +102,18 @@ export declare const theme: {
83
102
  weightBlack: number;
84
103
  };
85
104
  spacing: {
86
- '01': string;
87
- '02': string;
88
- '03': string;
89
- '04': string;
90
- '05': string;
91
- '06': string;
92
- '07': string;
93
- '08': string;
94
- '09': string;
95
105
  '10': string;
96
- '11': string;
97
- '12': string;
106
+ '20': string;
107
+ '30': string;
108
+ '40': string;
109
+ '50': string;
110
+ '60': string;
111
+ '70': string;
112
+ '80': string;
113
+ '90': string;
114
+ '100': string;
115
+ '110': string;
116
+ '120': string;
98
117
  };
99
118
  states: {
100
119
  focus: string;
@@ -141,7 +160,6 @@ export declare const theme: {
141
160
  borderSecondary: string;
142
161
  borderSubtle: string;
143
162
  borderTertiary: string;
144
- borderInvalid: string;
145
163
  borderDisabled: string;
146
164
  field01: string;
147
165
  fieldHover01: string;
@@ -181,7 +199,7 @@ export declare const theme: {
181
199
  textOnColor: string;
182
200
  textInverse: string;
183
201
  textDisabled: string;
184
- textInvalid: string;
202
+ textWarning: string;
185
203
  textPlaceholder: string;
186
204
  buttonBackgroundPrimary: string;
187
205
  buttonBackgroundPrimaryHover: string;
package/theme/tokens.d.ts CHANGED
@@ -26,14 +26,18 @@ export declare const baseColors: {
26
26
  blue10: string;
27
27
  blue20: string;
28
28
  blue40: string;
29
+ blue50: string;
29
30
  blue60: string;
31
+ blue70: string;
30
32
  blue80: string;
31
33
  blue90: string;
32
34
  blue100: string;
33
- blue140: string;
34
- blue170: string;
35
+ blue110: string;
36
+ blue120: string;
37
+ blue130: string;
38
+ blue150: string;
35
39
  purple80: string;
36
- purple140: string;
40
+ purple110: string;
37
41
  red100: string;
38
42
  signalBlue10: string;
39
43
  signalBlue100: string;
@@ -42,34 +46,49 @@ export declare const baseColors: {
42
46
  signalGreen100: string;
43
47
  signalYellow10: string;
44
48
  signalYellow100: string;
49
+ signalRed10: string;
45
50
  signalRed20: string;
46
51
  signalRed30: string;
52
+ signalRed40: string;
53
+ signalRed50: string;
54
+ signalRed60: string;
55
+ signalRed70: string;
47
56
  signalRed80: string;
57
+ signalRed90: string;
48
58
  signalRed100: string;
59
+ signalRed110: string;
60
+ signalRed120: string;
61
+ signalRed130: string;
62
+ signalRed140: string;
63
+ signalRed150: string;
49
64
  signalRed160: string;
65
+ signalRed170: string;
50
66
  signalRed180: string;
67
+ signalRed190: string;
68
+ signalRed200: string;
51
69
  };
52
70
  export declare const typography: {
53
71
  fontFamily: string;
54
- lineHeight01: number;
55
- lineHeight02: number;
56
- lineHeight03: number;
57
- lineHeight04: number;
58
- lineHeight05: number;
59
- lineHeight06: number;
60
- lineHeight07: number;
61
- lineHeight08: number;
62
- lineHeight09: number;
63
- size01: string;
64
- size02: string;
65
- size03: string;
66
- size04: string;
67
- size05: string;
68
- size06: string;
69
- size07: string;
70
- size08: string;
71
- size09: string;
72
- size10: string;
72
+ lineHeight10: number;
73
+ lineHeight20: number;
74
+ lineHeight30: number;
75
+ lineHeight40: number;
76
+ lineHeight50: number;
77
+ lineHeight60: number;
78
+ lineHeight70: number;
79
+ lineHeight80: number;
80
+ lineHeight90: number;
81
+ lineHeight100: number;
82
+ fontSize10: string;
83
+ fontSize20: string;
84
+ fontSize30: string;
85
+ fontSize40: string;
86
+ fontSize50: string;
87
+ fontSize60: string;
88
+ fontSize70: string;
89
+ fontSize80: string;
90
+ fontSize90: string;
91
+ fontSize100: string;
73
92
  weightThin: number;
74
93
  weightExtraLight: number;
75
94
  weightLight: number;
@@ -81,18 +100,18 @@ export declare const typography: {
81
100
  weightBlack: number;
82
101
  };
83
102
  export declare const spacing: {
84
- '01': string;
85
- '02': string;
86
- '03': string;
87
- '04': string;
88
- '05': string;
89
- '06': string;
90
- '07': string;
91
- '08': string;
92
- '09': string;
93
103
  '10': string;
94
- '11': string;
95
- '12': string;
104
+ '20': string;
105
+ '30': string;
106
+ '40': string;
107
+ '50': string;
108
+ '60': string;
109
+ '70': string;
110
+ '80': string;
111
+ '90': string;
112
+ '100': string;
113
+ '110': string;
114
+ '120': string;
96
115
  };
97
116
  export declare const states: {
98
117
  focus: string;
@@ -139,7 +158,6 @@ export declare const semantic: {
139
158
  borderSecondary: string;
140
159
  borderSubtle: string;
141
160
  borderTertiary: string;
142
- borderInvalid: string;
143
161
  borderDisabled: string;
144
162
  field01: string;
145
163
  fieldHover01: string;
@@ -179,7 +197,7 @@ export declare const semantic: {
179
197
  textOnColor: string;
180
198
  textInverse: string;
181
199
  textDisabled: string;
182
- textInvalid: string;
200
+ textWarning: string;
183
201
  textPlaceholder: string;
184
202
  buttonBackgroundPrimary: string;
185
203
  buttonBackgroundPrimaryHover: string;
package/theme.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./tokens-B6mMZ0T6.cjs"),s={...e.tokens};exports.baseColors=e.baseColors;exports.breakpoints=e.breakpoints;exports.semantic=e.semantic;exports.spacing=e.spacing;exports.states=e.states;exports.transitions=e.transitions;exports.typography=e.typography;exports.windowSizes=e.windowSizes;exports.zIndex=e.zIndex;exports.theme=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./tokens-COoF1t17.cjs"),s={...e.tokens};exports.baseColors=e.baseColors;exports.breakpoints=e.breakpoints;exports.semantic=e.semantic;exports.spacing=e.spacing;exports.states=e.states;exports.transitions=e.transitions;exports.typography=e.typography;exports.windowSizes=e.windowSizes;exports.zIndex=e.zIndex;exports.theme=s;
package/theme.js CHANGED
@@ -1,5 +1,5 @@
1
- import { t as s } from "./tokens-CEzXihhV.js";
2
- import { b as n, f as r, s as i, c as p, d as m, e as c, a as b, w as d, z as f } from "./tokens-CEzXihhV.js";
1
+ import { t as s } from "./tokens-C0U7hdoO.js";
2
+ import { b as n, f as r, s as i, c as p, d as m, e as c, a as b, w as d, z as f } from "./tokens-C0U7hdoO.js";
3
3
  const t = { ...s };
4
4
  export {
5
5
  n as baseColors,