@midas-ds/components 5.0.0 → 6.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/modal/Dialog.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  import { AriaDialogProps } from 'react-aria';
2
+ import { DialogTrigger } from 'react-aria-components';
3
+ import { AriaModalOverlayProps } from '@react-aria/overlays';
2
4
  import { OverlayTriggerProps } from '@react-types/overlays';
3
5
  import * as React from 'react';
4
6
  interface DialogProps extends AriaDialogProps {
@@ -8,11 +10,18 @@ interface DialogProps extends AriaDialogProps {
8
10
  title?: React.ReactNode;
9
11
  children: React.ReactNode;
10
12
  }
13
+ /** @deprecated since 6.0.0 use Modal instead.
14
+ * See docs {@link https://designsystem.migrationsverket.se/|Midas}
15
+ */
11
16
  export declare const Dialog: React.FC<DialogProps>;
17
+ /** @deprecated since version 6.0.0, use DialogTrigger instead.
18
+ * See docs {@link https://designsystem.migrationsverket.se/|Midas}
19
+ */
12
20
  export declare const ModalTrigger: React.FC<OverlayTriggerProps & {
13
21
  isDismissable?: boolean;
14
22
  } & {
15
23
  children: (close: () => void) => JSX.Element;
16
24
  label?: string | undefined;
17
25
  }>;
18
- export {};
26
+ export { DialogTrigger };
27
+ export declare const Modal: React.FC<AriaModalOverlayProps & DialogProps>;
package/modal/index.d.ts CHANGED
@@ -1 +1 @@
1
- export { Dialog, ModalTrigger } from './Dialog';
1
+ export { Dialog, ModalTrigger, 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": "5.0.0",
17
+ "version": "6.0.0",
18
18
  "main": "./index.cjs",
19
19
  "module": "./index.js",
20
20
  "types": "./index.d.ts",
@@ -48,9 +48,8 @@
48
48
  }
49
49
  },
50
50
  "dependencies": {
51
- "@react-stately/toast": "3.0.0-beta.7",
52
- "react-aria": "3.37.0",
53
- "react-aria-components": "^1.6.0",
54
- "react-stately": "3.35.0"
51
+ "react-aria": "^3.38.1",
52
+ "react-aria-components": "^1.7.1",
53
+ "react-stately": "^3.36.1"
55
54
  }
56
55
  }
package/toast/Toast.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { AriaToastProps, AriaToastRegionProps } from '@react-aria/toast';
2
- import { QueuedToast, ToastQueue, ToastState } from '@react-stately/toast';
1
+ import { AriaToastProps, AriaToastRegionProps } from 'react-aria';
2
+ import { QueuedToast, ToastQueue, ToastState, ToastStateProps } from 'react-stately';
3
3
  import { default as React } from 'react';
4
4
  export interface MidasToast {
5
5
  message: string;
@@ -17,6 +17,11 @@ export interface ToastProps<T> extends AriaToastProps<T> {
17
17
  interface ToastProviderProps extends AriaToastRegionProps {
18
18
  children?: ((state: ToastState<MidasToast>) => React.ReactNode) | React.ReactNode;
19
19
  }
20
+ /**
21
+ * Temporary implementation of https://github.com/adobe/react-spectrum/blob/main/packages/%40react-stately/toast/src/useToastState.ts#L59
22
+ * TODO: Erase this as soon as react-stately is released
23
+ */
24
+ export declare function useToastState<T>(props?: ToastStateProps): ToastState<T>;
20
25
  export declare const toastQueue: ToastQueue<MidasToast>;
21
26
  export declare const GlobalToastRegion: (props: ToastProviderProps) => React.ReactPortal | null;
22
27
  export declare const ToastProvider: ({ children, ...props }: ToastProviderProps) => import("react/jsx-runtime").JSX.Element;