@xsolla/xui-modal 0.74.0 → 0.75.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.
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Flowtype definitions for index
3
+ * Generated by Flowgen from a Typescript Definition
4
+ * Flowgen v1.21.0
5
+ * @flow
6
+ */
7
+
8
+ import * as react from "react";
9
+ import { Node, CSSProperties, RefObject } from "react";
10
+ import * as react_jsx_runtime from "react/jsx-runtime";
11
+ declare export { useModalId } from "@xsolla/xui-core";
12
+ declare type ModalSize = "sm" | "md" | "lg";
13
+ declare interface ModalProps {
14
+ children: Node;
15
+ size?: ModalSize;
16
+ openContent?: boolean;
17
+ closeOutside?: boolean;
18
+ onClose?: () => void;
19
+ styled?: CSSProperties;
20
+ maxWidth?: string | number;
21
+ minHeight?: string | number;
22
+
23
+ /**
24
+ * Accessible title for the modal - creates aria-labelledby
25
+ */
26
+ title?: string;
27
+
28
+ /**
29
+ * Alternative to title prop for accessible name
30
+ */
31
+ "aria-label"?: string;
32
+
33
+ /**
34
+ * ID of element describing the modal content
35
+ */
36
+ "aria-describedby"?: string;
37
+
38
+ /**
39
+ * Ref to element that should receive focus when modal opens
40
+ */
41
+ initialFocusRef?: RefObject<HTMLElement>;
42
+ }
43
+ declare type ModalType = (props: any) => Node;
44
+ declare interface ModalContextType {
45
+ onOpenModal: (key: string, modal: ModalType) => void;
46
+ onCloseModal: (key: string) => void;
47
+ }
48
+ declare interface ModalProviderProps {
49
+ children: Node;
50
+ }
51
+ declare interface ModalRootProps {
52
+ modals: { [key: string]: ModalType, ... };
53
+ }
54
+ declare type WorkAreaSize = "sm" | "md" | "lg";
55
+ declare interface WorkAreaProps {
56
+ children: Node;
57
+ indent?: WorkAreaSize;
58
+ openContent?: boolean;
59
+ stretched?: boolean;
60
+ fetching?: boolean;
61
+ }
62
+ declare var Modal: react.ForwardRefExoticComponent<{
63
+ ...ModalProps,
64
+ ...react.RefAttributes<any>,
65
+ }>;
66
+ declare var ModalProvider: (
67
+ x: ModalProviderProps
68
+ ) => react_jsx_runtime.JSX.Element;
69
+ declare var useModal: (
70
+ modal: ModalType,
71
+ deps?: any[]
72
+ ) => [() => void, () => void];
73
+ declare var WorkArea: react.ForwardRefExoticComponent<{
74
+ ...WorkAreaProps,
75
+ ...react.RefAttributes<any>,
76
+ }>;
77
+ export type {
78
+ ModalContextType,
79
+ ModalProps,
80
+ ModalProviderProps,
81
+ ModalRootProps,
82
+ ModalSize,
83
+ ModalType,
84
+ WorkAreaProps,
85
+ WorkAreaSize,
86
+ };
87
+ declare export { Modal, ModalProvider, WorkArea, useModal };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/xui-modal",
3
- "version": "0.74.0",
3
+ "version": "0.75.0",
4
4
  "main": "./web/index.js",
5
5
  "module": "./web/index.mjs",
6
6
  "types": "./web/index.d.ts",
@@ -10,9 +10,9 @@
10
10
  "build:native": "PLATFORM=native tsup"
11
11
  },
12
12
  "dependencies": {
13
- "@xsolla/xui-button": "0.74.0",
14
- "@xsolla/xui-core": "0.74.0",
15
- "@xsolla/xui-primitives-core": "0.74.0"
13
+ "@xsolla/xui-button": "0.75.0",
14
+ "@xsolla/xui-core": "0.75.0",
15
+ "@xsolla/xui-primitives-core": "0.75.0"
16
16
  },
17
17
  "peerDependencies": {
18
18
  "react": ">=16.8.0",
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Flowtype definitions for index
3
+ * Generated by Flowgen from a Typescript Definition
4
+ * Flowgen v1.21.0
5
+ * @flow
6
+ */
7
+
8
+ import * as react from "react";
9
+ import { Node, CSSProperties, RefObject } from "react";
10
+ import * as react_jsx_runtime from "react/jsx-runtime";
11
+ declare export { useModalId } from "@xsolla/xui-core";
12
+ declare type ModalSize = "sm" | "md" | "lg";
13
+ declare interface ModalProps {
14
+ children: Node;
15
+ size?: ModalSize;
16
+ openContent?: boolean;
17
+ closeOutside?: boolean;
18
+ onClose?: () => void;
19
+ styled?: CSSProperties;
20
+ maxWidth?: string | number;
21
+ minHeight?: string | number;
22
+
23
+ /**
24
+ * Accessible title for the modal - creates aria-labelledby
25
+ */
26
+ title?: string;
27
+
28
+ /**
29
+ * Alternative to title prop for accessible name
30
+ */
31
+ "aria-label"?: string;
32
+
33
+ /**
34
+ * ID of element describing the modal content
35
+ */
36
+ "aria-describedby"?: string;
37
+
38
+ /**
39
+ * Ref to element that should receive focus when modal opens
40
+ */
41
+ initialFocusRef?: RefObject<HTMLElement>;
42
+ }
43
+ declare type ModalType = (props: any) => Node;
44
+ declare interface ModalContextType {
45
+ onOpenModal: (key: string, modal: ModalType) => void;
46
+ onCloseModal: (key: string) => void;
47
+ }
48
+ declare interface ModalProviderProps {
49
+ children: Node;
50
+ }
51
+ declare interface ModalRootProps {
52
+ modals: { [key: string]: ModalType, ... };
53
+ }
54
+ declare type WorkAreaSize = "sm" | "md" | "lg";
55
+ declare interface WorkAreaProps {
56
+ children: Node;
57
+ indent?: WorkAreaSize;
58
+ openContent?: boolean;
59
+ stretched?: boolean;
60
+ fetching?: boolean;
61
+ }
62
+ declare var Modal: react.ForwardRefExoticComponent<{
63
+ ...ModalProps,
64
+ ...react.RefAttributes<any>,
65
+ }>;
66
+ declare var ModalProvider: (
67
+ x: ModalProviderProps
68
+ ) => react_jsx_runtime.JSX.Element;
69
+ declare var useModal: (
70
+ modal: ModalType,
71
+ deps?: any[]
72
+ ) => [() => void, () => void];
73
+ declare var WorkArea: react.ForwardRefExoticComponent<{
74
+ ...WorkAreaProps,
75
+ ...react.RefAttributes<any>,
76
+ }>;
77
+ export type {
78
+ ModalContextType,
79
+ ModalProps,
80
+ ModalProviderProps,
81
+ ModalRootProps,
82
+ ModalSize,
83
+ ModalType,
84
+ WorkAreaProps,
85
+ WorkAreaSize,
86
+ };
87
+ declare export { Modal, ModalProvider, WorkArea, useModal };