@majoo-ui/react 1.47.0-rc.1 → 1.48.1
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/README.md +7 -7
- package/components/datePicker/components/DateNumber.d.ts +1 -0
- package/components/datePicker/state/reducer.d.ts +1 -0
- package/components/form/components/InputOTP/InputOTP.d.ts +108 -0
- package/components/form/components/InputOTP/index.d.ts +2 -0
- package/components/form/components/index.d.ts +1 -0
- package/components/index.d.ts +1 -0
- package/components/mapPicker/InputMapPicker.d.ts +15 -0
- package/components/mapPicker/MapPicker.d.ts +15 -0
- package/components/mapPicker/index.d.ts +2 -0
- package/components/mapPicker/types/index.d.ts +87 -0
- package/components/modalDialog/ModalDialog.d.ts +23 -19
- package/components/pageDialog/PageDialog.d.ts +17 -17
- package/index.esm.css +248 -244
- package/index.esm.js +1651 -900
- package/index.umd.css +248 -244
- package/index.umd.js +1671 -902
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
React
|
|
2
|
-
|
|
3
|
-
This library was generated with [Nx](https://nx.dev).
|
|
4
|
-
|
|
5
|
-
Running unit tests
|
|
6
|
-
|
|
7
|
-
Run `nx test react` to execute the unit tests via [Jest](https://jestjs.io).
|
|
1
|
+
React
|
|
2
|
+
|
|
3
|
+
This library was generated with [Nx](https://nx.dev).
|
|
4
|
+
|
|
5
|
+
Running unit tests
|
|
6
|
+
|
|
7
|
+
Run `nx test react` to execute the unit tests via [Jest](https://jestjs.io).
|
|
@@ -2,6 +2,7 @@ import type * as Stitches from '@stitches/react';
|
|
|
2
2
|
declare const DateNumber: import("@stitches/react/types/styled-component").StyledComponent<"div", {
|
|
3
3
|
variant?: "end" | "start" | "default" | "neutral" | "disabled" | "selected" | "road" | undefined;
|
|
4
4
|
size?: "large" | "small" | undefined;
|
|
5
|
+
isSunday?: boolean | "true" | undefined;
|
|
5
6
|
}, {
|
|
6
7
|
sm: "(min-width: 359px)";
|
|
7
8
|
md: "(min-width: 767px)";
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface InputOTPProps {
|
|
3
|
+
/**
|
|
4
|
+
* Number of input boxes.
|
|
5
|
+
*/
|
|
6
|
+
OTPLength?: number;
|
|
7
|
+
/**
|
|
8
|
+
* Returns OTP code typed in inputs.
|
|
9
|
+
*/
|
|
10
|
+
onChange: (value: string | number) => void;
|
|
11
|
+
/**
|
|
12
|
+
* The value of the otp passed into the component.
|
|
13
|
+
*/
|
|
14
|
+
value: string | number;
|
|
15
|
+
/**
|
|
16
|
+
* Disables all the inputs.
|
|
17
|
+
*/
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Auto focuses input on initial page load.
|
|
21
|
+
*/
|
|
22
|
+
autoFocus?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* any - allows any value. number - allow only numbers. alpha - allows only a-zA-Z. alphanumeric - allows 0-9a-zA-z.
|
|
25
|
+
*/
|
|
26
|
+
otpType?: 'any' | 'number' | 'alpha' | 'alphanumeric';
|
|
27
|
+
/**
|
|
28
|
+
* Change input type to password.
|
|
29
|
+
*/
|
|
30
|
+
secure?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Class for input element.
|
|
33
|
+
*/
|
|
34
|
+
inputClassName?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Class for root element.
|
|
37
|
+
*/
|
|
38
|
+
className?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Styles for input element.
|
|
41
|
+
*/
|
|
42
|
+
inputStyles?: object;
|
|
43
|
+
/**
|
|
44
|
+
* Styles for root element.
|
|
45
|
+
*/
|
|
46
|
+
style?: object;
|
|
47
|
+
/**
|
|
48
|
+
* Placeholder value of each input.
|
|
49
|
+
*/
|
|
50
|
+
placeholder?: string[];
|
|
51
|
+
/**
|
|
52
|
+
* Error state input OTP.
|
|
53
|
+
*/
|
|
54
|
+
isError?: boolean;
|
|
55
|
+
}
|
|
56
|
+
declare function InputOTP(props: InputOTPProps): JSX.Element;
|
|
57
|
+
declare namespace InputOTP {
|
|
58
|
+
var defaultProps: {
|
|
59
|
+
OTPLength: number;
|
|
60
|
+
value: string;
|
|
61
|
+
disabled: boolean;
|
|
62
|
+
autoFocus: boolean;
|
|
63
|
+
otpType: string;
|
|
64
|
+
secure: boolean;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export default InputOTP;
|
|
68
|
+
interface ResendOTPProps {
|
|
69
|
+
/**
|
|
70
|
+
* Timer that user has to wait before resend otp gets active.
|
|
71
|
+
*/
|
|
72
|
+
maxTime?: number;
|
|
73
|
+
/**
|
|
74
|
+
* Function get triggers when user click on resend otp button. But when button is disabled(i.e. time is not completed) it won't get trigger.
|
|
75
|
+
*/
|
|
76
|
+
onResendClick: () => void;
|
|
77
|
+
/**
|
|
78
|
+
* An optional callback when timer completes.
|
|
79
|
+
*/
|
|
80
|
+
onTimerComplete?: () => void;
|
|
81
|
+
/**
|
|
82
|
+
* You can change time interval.
|
|
83
|
+
*/
|
|
84
|
+
timeInterval?: number;
|
|
85
|
+
/**
|
|
86
|
+
* You can use your own component for seconds. Function will get remainingTime as props you can use it to show timer.
|
|
87
|
+
*/
|
|
88
|
+
renderTime?: (remainingTime: number) => React.ReactElement;
|
|
89
|
+
/**
|
|
90
|
+
* You can use your own component for resend button. Function will get disabled and onClick function and remainingTime as props you can pass it to your component.
|
|
91
|
+
*/
|
|
92
|
+
renderButton?: (buttonProps: object) => void;
|
|
93
|
+
/**
|
|
94
|
+
* For changing root component inline styles.
|
|
95
|
+
*/
|
|
96
|
+
style?: object;
|
|
97
|
+
/**
|
|
98
|
+
* For adding class to root component.
|
|
99
|
+
*/
|
|
100
|
+
className?: string;
|
|
101
|
+
}
|
|
102
|
+
export declare function ResendOTP(props: ResendOTPProps): JSX.Element;
|
|
103
|
+
export declare namespace ResendOTP {
|
|
104
|
+
var defaultProps: {
|
|
105
|
+
maxTime: number;
|
|
106
|
+
timeInterval: number;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
@@ -20,3 +20,4 @@ export { default as InputSelectTag } from './InputSelectTag/InputSelectTag';
|
|
|
20
20
|
export { default as InputCreatable } from './InputCreatable/InputCreatable';
|
|
21
21
|
export { default as InputResourceList } from './InputResourceList/InputResourceList';
|
|
22
22
|
export * from './InputCombobox';
|
|
23
|
+
export * from './InputOTP';
|
package/components/index.d.ts
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { InputMapPickerProps } from './types';
|
|
3
|
+
declare function InputMapPicker(props: InputMapPickerProps): JSX.Element;
|
|
4
|
+
declare namespace InputMapPicker {
|
|
5
|
+
var defaultProps: {
|
|
6
|
+
modalTitle: string;
|
|
7
|
+
buttonLabel: string;
|
|
8
|
+
placeholder: string;
|
|
9
|
+
value: {
|
|
10
|
+
lat: number;
|
|
11
|
+
lng: number;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export default InputMapPicker;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import './styles.css';
|
|
3
|
+
import { MapPickerProps } from './types';
|
|
4
|
+
declare function MapPicker(props: MapPickerProps): JSX.Element;
|
|
5
|
+
declare namespace MapPicker {
|
|
6
|
+
var defaultProps: {
|
|
7
|
+
showBanner: boolean;
|
|
8
|
+
bannerDescription: string;
|
|
9
|
+
value: {
|
|
10
|
+
lat: number;
|
|
11
|
+
lng: number;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export default MapPicker;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { CSS } from '../../../config/stitches.config';
|
|
2
|
+
export interface AddressComponents {
|
|
3
|
+
long_name: string;
|
|
4
|
+
short_name: string;
|
|
5
|
+
types: string[];
|
|
6
|
+
}
|
|
7
|
+
export interface MapObject {
|
|
8
|
+
place_id?: string;
|
|
9
|
+
lat: number;
|
|
10
|
+
lng: number;
|
|
11
|
+
formatted_address?: string;
|
|
12
|
+
address_components?: AddressComponents[];
|
|
13
|
+
}
|
|
14
|
+
export interface LatLng {
|
|
15
|
+
lat: number;
|
|
16
|
+
lng: number;
|
|
17
|
+
}
|
|
18
|
+
export interface MapPickerProps {
|
|
19
|
+
/**
|
|
20
|
+
* Google MAP API Key.
|
|
21
|
+
*/
|
|
22
|
+
mapsApiKey?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Additional css styles.
|
|
25
|
+
*/
|
|
26
|
+
css?: CSS;
|
|
27
|
+
/**
|
|
28
|
+
* State to show or hide the banner.
|
|
29
|
+
*/
|
|
30
|
+
showBanner?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Custom banner description.
|
|
33
|
+
*/
|
|
34
|
+
bannerDescription?: string;
|
|
35
|
+
/**
|
|
36
|
+
* To binding current address.
|
|
37
|
+
* `{ lat: number, lng: number }`
|
|
38
|
+
*/
|
|
39
|
+
value?: LatLng;
|
|
40
|
+
/**
|
|
41
|
+
* Change event handler.
|
|
42
|
+
*/
|
|
43
|
+
onChange: (MapObject: any) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Marker Click event handler.
|
|
46
|
+
*/
|
|
47
|
+
onMarkerClick?: () => void;
|
|
48
|
+
}
|
|
49
|
+
export interface InputMapPickerProps {
|
|
50
|
+
/**
|
|
51
|
+
* Google MAP API Key.
|
|
52
|
+
*/
|
|
53
|
+
mapsApiKey?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Additional css styles.
|
|
56
|
+
*/
|
|
57
|
+
css?: CSS;
|
|
58
|
+
/**
|
|
59
|
+
* Custom title of the modal.
|
|
60
|
+
*/
|
|
61
|
+
modalTitle?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Custom label of the button.
|
|
64
|
+
*/
|
|
65
|
+
buttonLabel?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Custom InputMap placeholder.
|
|
68
|
+
*/
|
|
69
|
+
placeholder?: string;
|
|
70
|
+
/**
|
|
71
|
+
* State to show or hide the banner.
|
|
72
|
+
*/
|
|
73
|
+
showBanner?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Custom banner description.
|
|
76
|
+
*/
|
|
77
|
+
bannerDescription?: string;
|
|
78
|
+
/**
|
|
79
|
+
* To binding current address.
|
|
80
|
+
* `{ lat: number, lng: number }`
|
|
81
|
+
*/
|
|
82
|
+
value?: LatLng;
|
|
83
|
+
/**
|
|
84
|
+
* Change event handler.
|
|
85
|
+
*/
|
|
86
|
+
onChange: (MapObject: any) => void;
|
|
87
|
+
}
|
|
@@ -392,30 +392,34 @@ interface ModalDialogProps extends IDialog, DialogContentProps {
|
|
|
392
392
|
/** Force to mobile view or desktop view, if undefined ModalDialog will be responsive according to current screen size */
|
|
393
393
|
isMobile?: boolean | undefined;
|
|
394
394
|
/**
|
|
395
|
-
|
|
396
|
-
|
|
395
|
+
* @deprecated Use size or css props css={{width: width css property}} instead. This will be deleted in the future to limit unnecessary props.
|
|
396
|
+
*/
|
|
397
397
|
width?: string | number;
|
|
398
398
|
/** Set default behavior when opening dialog with form. Usually used with prevent default*/
|
|
399
399
|
onOpenAutoFocus?(): void;
|
|
400
|
+
/**
|
|
401
|
+
* If true, the close icon button is hidden
|
|
402
|
+
*/
|
|
403
|
+
hideCloseButton?: boolean;
|
|
400
404
|
}
|
|
401
405
|
/**
|
|
402
|
-
* ModalDialog are used to focus and display content that contains one specific task that requires interaction from the user and is separate from the main page.
|
|
403
|
-
* https://react-majoo-ui.mangkujagat.com/?path=/story/core-components-pagedialog--default
|
|
404
|
-
* @param size - default fullsize
|
|
405
|
-
* @param layer - z-index default 1400
|
|
406
|
-
* @param isMobile - force mobile/desktop view, default is responsive
|
|
407
|
-
* @param onOpenAutoFocus - set default open behaviour
|
|
408
|
-
*
|
|
409
|
-
* @example
|
|
410
|
-
* // Uncontrolled Example
|
|
411
|
-
* <ModalDialog>
|
|
412
|
-
* <ModalDialogTrigger>Button Trigger</ModalDialogTrigger>
|
|
413
|
-
* <ModalDialogTitle>Title</ModalDialogTitle>
|
|
414
|
-
* <ModalDialogContent>Content</ModalDialogContent>
|
|
415
|
-
* <ModalDialogFooter>Footer</ModalDialogFooter>
|
|
416
|
-
* </ModalDialog>
|
|
417
|
-
* @component
|
|
418
|
-
*/
|
|
406
|
+
* ModalDialog are used to focus and display content that contains one specific task that requires interaction from the user and is separate from the main page.
|
|
407
|
+
* https://react-majoo-ui.mangkujagat.com/?path=/story/core-components-pagedialog--default
|
|
408
|
+
* @param size - default fullsize
|
|
409
|
+
* @param layer - z-index default 1400
|
|
410
|
+
* @param isMobile - force mobile/desktop view, default is responsive
|
|
411
|
+
* @param onOpenAutoFocus - set default open behaviour
|
|
412
|
+
*
|
|
413
|
+
* @example
|
|
414
|
+
* // Uncontrolled Example
|
|
415
|
+
* <ModalDialog>
|
|
416
|
+
* <ModalDialogTrigger>Button Trigger</ModalDialogTrigger>
|
|
417
|
+
* <ModalDialogTitle>Title</ModalDialogTitle>
|
|
418
|
+
* <ModalDialogContent>Content</ModalDialogContent>
|
|
419
|
+
* <ModalDialogFooter>Footer</ModalDialogFooter>
|
|
420
|
+
* </ModalDialog>
|
|
421
|
+
* @component
|
|
422
|
+
*/
|
|
419
423
|
declare const ModalDialog: {
|
|
420
424
|
(props: ModalDialogProps): JSX.Element;
|
|
421
425
|
Trigger: import("@stitches/react/types/styled-component").StyledComponent<"div", {}, {
|
|
@@ -395,23 +395,23 @@ interface PageDialogProps extends IDialog, DialogContentProps {
|
|
|
395
395
|
onOpenAutoFocus?(): void;
|
|
396
396
|
}
|
|
397
397
|
/**
|
|
398
|
-
* PageDialog are used to focus and display content that contains one specific task that requires interaction from the user and is separate from the main page.
|
|
399
|
-
* https://react-majoo-ui.mangkujagat.com/?path=/story/core-components-pagedialog--default
|
|
400
|
-
* @param size - default fullsize
|
|
401
|
-
* @param layer - z-index default 1400
|
|
402
|
-
* @param isMobile - force mobile/desktop view, default is responsive
|
|
403
|
-
* @param onOpenAutoFocus - set default open behaviour
|
|
404
|
-
*
|
|
405
|
-
* @example
|
|
406
|
-
* // Uncontrolled Example
|
|
407
|
-
* <PageDialog>
|
|
408
|
-
* <PageDialogTrigger>Button Trigger</PageDialogTrigger>
|
|
409
|
-
* <PageDialogTitle>Title</PageDialogTitle>
|
|
410
|
-
* <PageDialogContent>Content</PageDialogContent>
|
|
411
|
-
* <PageDialogFooter>Footer</PageDialogFooter>
|
|
412
|
-
* </PageDialog>
|
|
413
|
-
* @component
|
|
414
|
-
*/
|
|
398
|
+
* PageDialog are used to focus and display content that contains one specific task that requires interaction from the user and is separate from the main page.
|
|
399
|
+
* https://react-majoo-ui.mangkujagat.com/?path=/story/core-components-pagedialog--default
|
|
400
|
+
* @param size - default fullsize
|
|
401
|
+
* @param layer - z-index default 1400
|
|
402
|
+
* @param isMobile - force mobile/desktop view, default is responsive
|
|
403
|
+
* @param onOpenAutoFocus - set default open behaviour
|
|
404
|
+
*
|
|
405
|
+
* @example
|
|
406
|
+
* // Uncontrolled Example
|
|
407
|
+
* <PageDialog>
|
|
408
|
+
* <PageDialogTrigger>Button Trigger</PageDialogTrigger>
|
|
409
|
+
* <PageDialogTitle>Title</PageDialogTitle>
|
|
410
|
+
* <PageDialogContent>Content</PageDialogContent>
|
|
411
|
+
* <PageDialogFooter>Footer</PageDialogFooter>
|
|
412
|
+
* </PageDialog>
|
|
413
|
+
* @component
|
|
414
|
+
*/
|
|
415
415
|
export declare const PageDialog: {
|
|
416
416
|
(props: PageDialogProps): JSX.Element;
|
|
417
417
|
Trigger: import("@stitches/react/types/styled-component").StyledComponent<"div", {}, {
|