@cleartrip/ct-design-modal 4.0.0-SNAPSHOT-reactnative.14.1 → 4.0.0-SNAPSHOT-native-main.6
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/dist/Backdrop/Backdrop.d.ts +1 -1
- package/dist/Backdrop/Backdrop.d.ts.map +1 -1
- package/dist/Backdrop/style.d.ts +1 -1
- package/dist/Backdrop/style.d.ts.map +1 -1
- package/dist/Backdrop/type.d.ts +1 -1
- package/dist/Backdrop/type.d.ts.map +1 -1
- package/dist/Modal.d.ts.map +1 -1
- package/dist/Modal.native.d.ts.map +1 -1
- package/dist/ModalContainer/ModalContainer.d.ts.map +1 -1
- package/dist/ModalTitle/ModalTitle.d.ts.map +1 -1
- package/dist/constants.d.ts +28 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/ct-design-modal.browser.cjs.js.map +1 -1
- package/dist/ct-design-modal.browser.esm.js.map +1 -1
- package/dist/ct-design-modal.cjs.js.map +1 -1
- package/dist/ct-design-modal.esm.js.map +1 -1
- package/dist/ct-design-modal.umd.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.native.d.ts +2 -1
- package/dist/index.native.d.ts.map +1 -1
- package/dist/style.d.ts.map +1 -1
- package/dist/style.native.d.ts.map +1 -1
- package/dist/type.d.ts +1 -27
- package/dist/type.d.ts.map +1 -1
- package/package.json +15 -15
- package/src/Backdrop/Backdrop.tsx +1 -1
- package/src/Backdrop/style.ts +1 -1
- package/src/Backdrop/type.ts +1 -1
- package/src/Modal.native.tsx +2 -11
- package/src/Modal.tsx +2 -1
- package/src/ModalContainer/ModalContainer.tsx +2 -1
- package/src/ModalTitle/ModalTitle.tsx +2 -1
- package/src/ModalsUsableComponents/ModalWithCloseOverlay.tsx +1 -1
- package/src/constants.ts +31 -0
- package/src/index.native.ts +2 -1
- package/src/index.ts +3 -2
- package/src/style.native.ts +3 -8
- package/src/style.ts +2 -1
- package/src/type.ts +1 -31
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export { default as Modal } from './Modal';
|
|
2
|
-
export * from './type';
|
|
2
|
+
export type * from './type';
|
|
3
|
+
export * from './constants';
|
|
3
4
|
export { default as ModalAction } from './ModalAction';
|
|
4
5
|
export { default as ModalContainer } from './ModalContainer';
|
|
5
6
|
export { default as ModalContent } from './ModalContent';
|
|
6
7
|
export { default as ModalTitle } from './ModalTitle';
|
|
7
8
|
export { default as Backdrop } from './Backdrop';
|
|
8
|
-
export
|
|
9
|
+
export { ModalWithCloseOverlay } from './ModalsUsableComponents';
|
|
9
10
|
export { MODAL_ANIMATION_DURATION } from './modalUtils';
|
|
10
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../packages/components/Modal/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../packages/components/Modal/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,mBAAmB,QAAQ,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.native.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../packages/components/Modal/src/index.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAClD,
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../packages/components/Modal/src/index.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAClD,mBAAmB,QAAQ,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/style.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../packages/components/Modal/src/style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../packages/components/Modal/src/style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAGxC,eAAO,MAAM,kBAAkB,GAAI,MAAM,cAAc;;;;;;;;;;;;;;;CAwCtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.native.d.ts","sourceRoot":"","sources":["../packages/components/Modal/src/style.native.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,
|
|
1
|
+
{"version":3,"file":"style.native.d.ts","sourceRoot":"","sources":["../packages/components/Modal/src/style.native.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAiDxF,eAAO,MAAM,2BAA2B,GAAI,wBAIzC;IACD,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,cAAc,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;CACf;YAnDY,MAAM,GAAG,MAAM;aAAW,MAAM,GAAG,MAAM;WAAS,MAAM;gBA8BvD,MAAM,GAAG,MAAM,GAAG,KAAK;kBACrB,MAAM;mBACL;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;oBAChC,MAAM;mBACP,MAAM;CAoBrB,CAAC;AAEH,eAAO,MAAM,iBAAiB,GAAI,eAAe;IAAE,SAAS,EAAE,mBAAmB,CAAA;CAAE,KAAG,SAEpF,CAAC;AAEH,eAAO,MAAM,wBAAwB,GAAI,4BAEtC;IACD,qBAAqB,EAAE,yBAAyB,CAAC;CAClD;gBAG8C,MAAM;CAMpD,CAAC"}
|
package/dist/type.d.ts
CHANGED
|
@@ -1,39 +1,13 @@
|
|
|
1
1
|
import type { Styles } from '@cleartrip/ct-design-types';
|
|
2
2
|
import { ReactNode, ReactElement } from 'react';
|
|
3
3
|
import type { ContainerRef } from '@cleartrip/ct-design-container';
|
|
4
|
-
|
|
5
|
-
SMALL = "SMALL",
|
|
6
|
-
MEDIUM = "MEDIUM",
|
|
7
|
-
LARGE = "LARGE",
|
|
8
|
-
FULL_SCREEN = "FULL_SCREEN",
|
|
9
|
-
NONE = "NONE",
|
|
10
|
-
REGULAR = "REGULAR",
|
|
11
|
-
BIG = "BIG"
|
|
12
|
-
}
|
|
13
|
-
export declare enum ModalVariant {
|
|
14
|
-
DARK = "dark",
|
|
15
|
-
NEUTRAL = "neutral"
|
|
16
|
-
}
|
|
17
|
-
export declare enum ModalPlacement {
|
|
18
|
-
CENTER = "center",
|
|
19
|
-
BOTTOM = "bottom"
|
|
20
|
-
}
|
|
4
|
+
import { ModalSize, ModalVariant, ModalPlacement, ActionButtonVariant, ActionButtonAlignment } from './constants';
|
|
21
5
|
export type ModalSizeTypes = `${ModalSize}`;
|
|
22
6
|
type OwnModalProps = {
|
|
23
7
|
footerAlignment?: 'start' | 'end' | 'center';
|
|
24
8
|
animationDuration?: number;
|
|
25
9
|
};
|
|
26
10
|
export type ModalProps = IModalProps;
|
|
27
|
-
export declare enum ActionButtonVariant {
|
|
28
|
-
BACK = "back",
|
|
29
|
-
CLOSE = "close",
|
|
30
|
-
NONE = "none"
|
|
31
|
-
}
|
|
32
|
-
export declare enum ActionButtonAlignment {
|
|
33
|
-
CENTER = "center",
|
|
34
|
-
LEFT = "left",
|
|
35
|
-
RIGHT = "right"
|
|
36
|
-
}
|
|
37
11
|
export type ActionButtonVariantsType = `${ActionButtonVariant}`;
|
|
38
12
|
export type ActionButtonAlignmentType = `${ActionButtonAlignment}`;
|
|
39
13
|
export type ModalPlacementTypes = `${ModalPlacement}`;
|
package/dist/type.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../packages/components/Modal/src/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAEnE,
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../packages/components/Modal/src/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAEnE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAElH,MAAM,MAAM,cAAc,GAAG,GAAG,SAAS,EAAE,CAAC;AAE5C,KAAK,aAAa,GAAG;IAInB,eAAe,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC7C,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC;AAErC,MAAM,MAAM,wBAAwB,GAAG,GAAG,mBAAmB,EAAE,CAAC;AAChE,MAAM,MAAM,yBAAyB,GAAG,GAAG,qBAAqB,EAAE,CAAC;AACnE,MAAM,MAAM,mBAAmB,GAAG,GAAG,cAAc,EAAE,CAAC;AACtD,MAAM,MAAM,iBAAiB,GAAG,GAAG,YAAY,EAAE,CAAC;AAElD,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,WAAY,SAAQ,aAAa;IAEhD,qBAAqB,CAAC,EAAE,yBAAyB,CAAC;IAElD,gBAAgB,CAAC,EAAE,wBAAwB,CAAC;IAE5C,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,iBAAiB,CAAC,EAAE,SAAS,CAAC;IAE9B,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,QAAQ,CAAC,EAAE,YAAY,CAAC;QAAE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC,CAAC;IAElD,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAEjE,IAAI,EAAE,OAAO,CAAC;IAEd,SAAS,CAAC,EAAE,mBAAmB,CAAC;IAEhC,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAE9B,IAAI,CAAC,EAAE,cAAc,CAAC;IAEtB,WAAW,CAAC,EAAE;QACZ,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;QAChB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;QAC1B,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;QAC9B,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;KAC/B,CAAC;IAEF,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAI5B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cleartrip/ct-design-modal",
|
|
3
|
-
"version": "4.0.0-SNAPSHOT-
|
|
3
|
+
"version": "4.0.0-SNAPSHOT-native-main.6",
|
|
4
4
|
"description": "Modal Component",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "./dist/ct-design-modal.cjs.js",
|
|
@@ -26,23 +26,23 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@emotion/react": "^11.14.0",
|
|
28
28
|
"@emotion/styled": "^11.14.0",
|
|
29
|
-
"@cleartrip/ct-design-container": "4.0.0-SNAPSHOT-
|
|
30
|
-
"@cleartrip/ct-design-types": "4.0.0-SNAPSHOT-
|
|
31
|
-
"@cleartrip/ct-design-transition": "4.0.0-SNAPSHOT-
|
|
32
|
-
"@cleartrip/ct-design-portal": "4.0.0-SNAPSHOT-
|
|
33
|
-
"@cleartrip/ct-design-overlay": "4.0.0-SNAPSHOT-
|
|
34
|
-
"@cleartrip/ct-design-focus-lock": "4.0.0-SNAPSHOT-
|
|
35
|
-
"@cleartrip/ct-design-use-merge-refs": "4.0.0-SNAPSHOT-
|
|
36
|
-
"@cleartrip/ct-design-icons": "4.0.0-SNAPSHOT-
|
|
37
|
-
"@cleartrip/ct-design-typography": "4.0.0-SNAPSHOT-
|
|
38
|
-
"@cleartrip/ct-design-box": "4.0.0-SNAPSHOT-
|
|
39
|
-
"@cleartrip/ct-design-theme": "4.0.0-SNAPSHOT-
|
|
40
|
-
"@cleartrip/ct-design-button": "4.0.0-SNAPSHOT-
|
|
41
|
-
"@cleartrip/ct-design-style-manager": "4.0.0-SNAPSHOT-
|
|
29
|
+
"@cleartrip/ct-design-container": "4.0.0-SNAPSHOT-native-main.6",
|
|
30
|
+
"@cleartrip/ct-design-types": "4.0.0-SNAPSHOT-native-main.6",
|
|
31
|
+
"@cleartrip/ct-design-transition": "4.0.0-SNAPSHOT-native-main.6",
|
|
32
|
+
"@cleartrip/ct-design-portal": "4.0.0-SNAPSHOT-native-main.6",
|
|
33
|
+
"@cleartrip/ct-design-overlay": "4.0.0-SNAPSHOT-native-main.6",
|
|
34
|
+
"@cleartrip/ct-design-focus-lock": "4.0.0-SNAPSHOT-native-main.6",
|
|
35
|
+
"@cleartrip/ct-design-use-merge-refs": "4.0.0-SNAPSHOT-native-main.6",
|
|
36
|
+
"@cleartrip/ct-design-icons": "4.0.0-SNAPSHOT-native-main.6",
|
|
37
|
+
"@cleartrip/ct-design-typography": "4.0.0-SNAPSHOT-native-main.6",
|
|
38
|
+
"@cleartrip/ct-design-box": "4.0.0-SNAPSHOT-native-main.6",
|
|
39
|
+
"@cleartrip/ct-design-theme": "4.0.0-SNAPSHOT-native-main.6",
|
|
40
|
+
"@cleartrip/ct-design-button": "4.0.0-SNAPSHOT-native-main.6",
|
|
41
|
+
"@cleartrip/ct-design-style-manager": "4.0.0-SNAPSHOT-native-main.6"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@emotion/babel-plugin": "^11.12.0",
|
|
45
|
-
"@cleartrip/ct-design-icons": "4.0.0-SNAPSHOT-
|
|
45
|
+
"@cleartrip/ct-design-icons": "4.0.0-SNAPSHOT-native-main.6"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"react": ">=16.8.0",
|
|
@@ -4,7 +4,7 @@ import { css } from '@emotion/css';
|
|
|
4
4
|
import { Transition } from '@cleartrip/ct-design-transition';
|
|
5
5
|
import { useStyles, useWebMergeStyles } from '@cleartrip/ct-design-style-manager';
|
|
6
6
|
|
|
7
|
-
import { ModalVariant } from '../
|
|
7
|
+
import { ModalVariant } from '../constants';
|
|
8
8
|
import { getBackdropDynamicStyles, staticBackdropStyles } from './style';
|
|
9
9
|
import { BackdropProps } from './type';
|
|
10
10
|
|
package/src/Backdrop/style.ts
CHANGED
package/src/Backdrop/type.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'react';
|
|
2
2
|
import type { Styles } from '@cleartrip/ct-design-types';
|
|
3
3
|
import type { TransitionProps } from '@cleartrip/ct-design-transition';
|
|
4
|
-
import { ModalVariant } from '../
|
|
4
|
+
import { ModalVariant } from '../constants';
|
|
5
5
|
|
|
6
6
|
export interface BackdropStyleConfigProps {
|
|
7
7
|
root?: Styles[];
|
package/src/Modal.native.tsx
CHANGED
|
@@ -8,17 +8,8 @@ import { Portal } from '@cleartrip/ct-design-portal';
|
|
|
8
8
|
import { makeStyles, useStyles } from '@cleartrip/ct-design-style-manager';
|
|
9
9
|
import { Cross, ModalBack } from '@cleartrip/ct-design-icons';
|
|
10
10
|
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
ActionButtonVariant,
|
|
14
|
-
ActionButtonVariantsType,
|
|
15
|
-
IChildProps,
|
|
16
|
-
IModalProps,
|
|
17
|
-
ModalPlacement,
|
|
18
|
-
ModalSize,
|
|
19
|
-
ModalVariant,
|
|
20
|
-
ModalVariantTypes,
|
|
21
|
-
} from './type';
|
|
11
|
+
import { ActionButtonVariantsType, IChildProps, IModalProps, ModalVariantTypes } from './type';
|
|
12
|
+
import { ActionButtonAlignment, ActionButtonVariant, ModalPlacement, ModalSize, ModalVariant } from './constants';
|
|
22
13
|
import { getActionButtonAlignment, getModalChildContainerStyle } from './style.native';
|
|
23
14
|
import { MODAL_ANIMATION_DURATION } from './modalUtils';
|
|
24
15
|
|
package/src/Modal.tsx
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, { forwardRef, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
2
2
|
import { CSSProperties } from 'react';
|
|
3
3
|
import { getModalSizeStyles } from './style';
|
|
4
|
-
import { IModalProps
|
|
4
|
+
import { IModalProps } from './type';
|
|
5
|
+
import { ModalPlacement, ModalSize, ModalVariant } from './constants';
|
|
5
6
|
import { Portal } from '@cleartrip/ct-design-portal';
|
|
6
7
|
import { FocusLock } from '@cleartrip/ct-design-focus-lock';
|
|
7
8
|
import { Transition } from '@cleartrip/ct-design-transition';
|
|
@@ -5,7 +5,8 @@ import { useStyles } from '@cleartrip/ct-design-style-manager';
|
|
|
5
5
|
import type { Styles } from '@cleartrip/ct-design-types';
|
|
6
6
|
|
|
7
7
|
import ModalContext from '../ModalContext';
|
|
8
|
-
import {
|
|
8
|
+
import { ModalSizeTypes } from '../type';
|
|
9
|
+
import { ModalSize } from '../constants';
|
|
9
10
|
|
|
10
11
|
type ModalContainerProps = {
|
|
11
12
|
size?: ModalSizeTypes;
|
|
@@ -8,7 +8,8 @@ import { Typography, TypographyStyleConfigProps } from '@cleartrip/ct-design-typ
|
|
|
8
8
|
import type { Styles } from '@cleartrip/ct-design-types';
|
|
9
9
|
|
|
10
10
|
import ModalContext from '../ModalContext';
|
|
11
|
-
import { ModalProps
|
|
11
|
+
import { ModalProps } from '../type';
|
|
12
|
+
import { ModalSize } from '../constants';
|
|
12
13
|
|
|
13
14
|
type ModalTitleStyleConfig = {
|
|
14
15
|
root?: Styles[];
|
|
@@ -5,7 +5,7 @@ import { makeStyles, useStyles } from '@cleartrip/ct-design-style-manager';
|
|
|
5
5
|
import { Cross, ModalBack } from '@cleartrip/ct-design-icons';
|
|
6
6
|
|
|
7
7
|
import Modal from '../Modal';
|
|
8
|
-
import { ModalVariant } from '../
|
|
8
|
+
import { ModalVariant } from '../constants';
|
|
9
9
|
import { ModalWithCloseOverlayProps } from './type';
|
|
10
10
|
|
|
11
11
|
const staticStyles = makeStyles(() => ({
|
package/src/constants.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export enum ModalSize {
|
|
2
|
+
SMALL = 'SMALL',
|
|
3
|
+
MEDIUM = 'MEDIUM',
|
|
4
|
+
LARGE = 'LARGE',
|
|
5
|
+
FULL_SCREEN = 'FULL_SCREEN',
|
|
6
|
+
NONE = 'NONE',
|
|
7
|
+
REGULAR = 'REGULAR',
|
|
8
|
+
BIG = 'BIG',
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export enum ModalVariant {
|
|
12
|
+
DARK = 'dark',
|
|
13
|
+
NEUTRAL = 'neutral',
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export enum ModalPlacement {
|
|
17
|
+
CENTER = 'center',
|
|
18
|
+
BOTTOM = 'bottom',
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export enum ActionButtonVariant {
|
|
22
|
+
BACK = 'back',
|
|
23
|
+
CLOSE = 'close',
|
|
24
|
+
NONE = 'none',
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export enum ActionButtonAlignment {
|
|
28
|
+
CENTER = 'center',
|
|
29
|
+
LEFT = 'left',
|
|
30
|
+
RIGHT = 'right',
|
|
31
|
+
}
|
package/src/index.native.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export { default as Modal } from './Modal';
|
|
2
|
-
export * from './type';
|
|
2
|
+
export type * from './type';
|
|
3
|
+
export * from './constants';
|
|
3
4
|
export { default as ModalAction } from './ModalAction';
|
|
4
5
|
export { default as ModalContainer } from './ModalContainer';
|
|
5
6
|
export { default as ModalContent } from './ModalContent';
|
|
6
7
|
export { default as ModalTitle } from './ModalTitle';
|
|
7
8
|
export { default as Backdrop } from './Backdrop';
|
|
8
|
-
export
|
|
9
|
+
export { ModalWithCloseOverlay } from './ModalsUsableComponents';
|
|
9
10
|
export { MODAL_ANIMATION_DURATION } from './modalUtils';
|
package/src/style.native.ts
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import type { ViewStyle } from '@cleartrip/ct-design-types';
|
|
2
2
|
import type { Theme } from '@cleartrip/ct-design-theme';
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
ModalPlacementTypes,
|
|
8
|
-
ModalSize,
|
|
9
|
-
ModalSizeTypes,
|
|
10
|
-
ModalVariant,
|
|
11
|
-
} from './type';
|
|
4
|
+
import { ActionButtonAlignmentType, ModalPlacementTypes, ModalSizeTypes } from './type';
|
|
5
|
+
|
|
6
|
+
import { ActionButtonAlignment, ModalSize, ModalVariant } from './constants';
|
|
12
7
|
|
|
13
8
|
const getModalSizeStyles = (
|
|
14
9
|
size: ModalSizeTypes,
|
package/src/style.ts
CHANGED
package/src/type.ts
CHANGED
|
@@ -2,25 +2,7 @@ import type { Styles } from '@cleartrip/ct-design-types';
|
|
|
2
2
|
import { ReactNode, ReactElement } from 'react';
|
|
3
3
|
import type { ContainerRef } from '@cleartrip/ct-design-container';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
SMALL = 'SMALL',
|
|
7
|
-
MEDIUM = 'MEDIUM',
|
|
8
|
-
LARGE = 'LARGE',
|
|
9
|
-
FULL_SCREEN = 'FULL_SCREEN',
|
|
10
|
-
NONE = 'NONE',
|
|
11
|
-
REGULAR = 'REGULAR',
|
|
12
|
-
BIG = 'BIG',
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export enum ModalVariant {
|
|
16
|
-
DARK = 'dark',
|
|
17
|
-
NEUTRAL = 'neutral',
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export enum ModalPlacement {
|
|
21
|
-
CENTER = 'center',
|
|
22
|
-
BOTTOM = 'bottom',
|
|
23
|
-
}
|
|
5
|
+
import { ModalSize, ModalVariant, ModalPlacement, ActionButtonVariant, ActionButtonAlignment } from './constants';
|
|
24
6
|
|
|
25
7
|
export type ModalSizeTypes = `${ModalSize}`;
|
|
26
8
|
|
|
@@ -34,18 +16,6 @@ type OwnModalProps = {
|
|
|
34
16
|
|
|
35
17
|
export type ModalProps = IModalProps;
|
|
36
18
|
|
|
37
|
-
export enum ActionButtonVariant {
|
|
38
|
-
BACK = 'back',
|
|
39
|
-
CLOSE = 'close',
|
|
40
|
-
NONE = 'none',
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export enum ActionButtonAlignment {
|
|
44
|
-
CENTER = 'center',
|
|
45
|
-
LEFT = 'left',
|
|
46
|
-
RIGHT = 'right',
|
|
47
|
-
}
|
|
48
|
-
|
|
49
19
|
export type ActionButtonVariantsType = `${ActionButtonVariant}`;
|
|
50
20
|
export type ActionButtonAlignmentType = `${ActionButtonAlignment}`;
|
|
51
21
|
export type ModalPlacementTypes = `${ModalPlacement}`;
|