@mycause/ui 0.18.4 → 0.18.5
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/CHANGELOG.md +9 -0
- package/dist/components/date-picker/date-picker.stories.d.ts +6 -0
- package/dist/components/date-picker/index.d.ts +1 -0
- package/dist/components/date-picker/single-date-picker-custom-header.d.ts +32 -0
- package/dist/components/field-helpers/field-label.d.ts +2 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/components/input/InputDefault.d.ts +13 -0
- package/dist/components/input/index.d.ts +1 -0
- package/dist/components/input/input.stories.d.ts +24 -0
- package/dist/components/modal/modal.stories.d.ts +2 -2
- package/dist/components/phone-number-input/index.d.ts +2 -0
- package/dist/components/phone-number-input/phone-number-input-v1.d.ts +25 -0
- package/dist/components/phone-number-input/phone-number-input-v2.d.ts +19 -0
- package/dist/components/phone-number-input/phone-number-input.stories.d.ts +18 -0
- package/dist/components/select/SelectV2.d.ts +24 -0
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/select-enhanced.d.ts +23 -0
- package/dist/components/select/select-v2.d.ts +26 -0
- package/dist/components/select/select.d.ts +4 -2
- package/dist/components/select/select.stories.d.ts +12 -0
- package/dist/components/toast/Icons.d.ts +7 -0
- package/dist/components/toast/index.d.ts +1 -0
- package/dist/components/toast/toast.d.ts +8 -0
- package/dist/components/toast/toast.stories.d.ts +12 -0
- package/dist/components/transaction-card/Dot.d.ts +6 -0
- package/dist/components/transaction-card/index.d.ts +1 -0
- package/dist/components/transaction-card/transaction-card.d.ts +14 -0
- package/dist/components/transaction-card/transaction-card.stories.d.ts +14 -0
- package/dist/index.esm.js +25335 -24380
- package/dist/index.js +25338 -24375
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import moment from "moment";
|
|
3
|
+
export interface DatePickerProps {
|
|
4
|
+
id: string;
|
|
5
|
+
date: moment.Moment | null;
|
|
6
|
+
onDateChange: (date: moment.Moment | null) => void;
|
|
7
|
+
onFocusChange: (arg: boolean | null) => void;
|
|
8
|
+
focused: boolean | null;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
color?: string;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
numberOfMonths?: number;
|
|
14
|
+
inputIconPosition?: "before" | "after";
|
|
15
|
+
orientation?: "horizontal" | "vertical";
|
|
16
|
+
customInputIcon?: React.ReactElement<React.HTMLProps<HTMLOrSVGElement>>;
|
|
17
|
+
customCloseIcon?: React.ReactElement<React.HTMLProps<HTMLOrSVGElement>>;
|
|
18
|
+
displayFormat?: string;
|
|
19
|
+
error?: boolean;
|
|
20
|
+
label?: string;
|
|
21
|
+
width?: string;
|
|
22
|
+
isOutsideRange?: () => boolean;
|
|
23
|
+
renderCalendarInfo?: () => string | JSX.Element;
|
|
24
|
+
calendarInfoPosition?: "before" | "after" | "top" | "bottom";
|
|
25
|
+
navPrev?: string | JSX.Element;
|
|
26
|
+
navNext?: string | JSX.Element;
|
|
27
|
+
showDefaultInputIcon?: boolean;
|
|
28
|
+
startYear?: number;
|
|
29
|
+
endYear?: number;
|
|
30
|
+
}
|
|
31
|
+
declare const CustomHeaderSingleDatePicker: ({ width, color, onDateChange, onFocusChange, numberOfMonths, error, label, focused, startYear, endYear, ...rest }: DatePickerProps) => JSX.Element;
|
|
32
|
+
export default CustomHeaderSingleDatePicker;
|
|
@@ -3,6 +3,7 @@ interface FieldLabelProps extends React.HTMLProps<HTMLLabelElement> {
|
|
|
3
3
|
large?: boolean;
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
required?: boolean;
|
|
6
|
+
asteriskColor?: string;
|
|
6
7
|
}
|
|
7
|
-
declare function FieldLabel({ large, className, children, required, ...rest }: FieldLabelProps): JSX.Element;
|
|
8
|
+
declare function FieldLabel({ large, className, children, required, asteriskColor, ...rest }: FieldLabelProps): JSX.Element;
|
|
8
9
|
export default FieldLabel;
|
|
@@ -54,4 +54,7 @@ export * from "./my-account-sidebar";
|
|
|
54
54
|
export * from "./my-account-frp-preview";
|
|
55
55
|
export * from "./my-account-stats-donated";
|
|
56
56
|
export * from "./my-account-stats-raised";
|
|
57
|
+
export * from "./input";
|
|
57
58
|
export * from "./my-account-frp-closed";
|
|
59
|
+
export * from "./transaction-card";
|
|
60
|
+
export * from "./toast";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface InputDefaltProps {
|
|
3
|
+
label?: string | React.ReactNode;
|
|
4
|
+
required?: boolean;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
onChange?: (value: string) => void;
|
|
7
|
+
value?: string | Array<string> | number;
|
|
8
|
+
error?: string | null | boolean;
|
|
9
|
+
disable?: boolean;
|
|
10
|
+
name?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const Input: ({ label, required, placeholder, value, onChange, error, disable, name, }: InputDefaltProps) => JSX.Element;
|
|
13
|
+
export default Input;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Input } from "./InputDefault";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
decorators: ((...args: any) => any)[];
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
7
|
+
export declare const InputExample: {
|
|
8
|
+
(): JSX.Element;
|
|
9
|
+
story: {
|
|
10
|
+
name: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export declare const InputV2: {
|
|
14
|
+
(): JSX.Element;
|
|
15
|
+
story: {
|
|
16
|
+
name: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare const InputV3: {
|
|
20
|
+
(): JSX.Element;
|
|
21
|
+
story: {
|
|
22
|
+
name: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -29,13 +29,13 @@ export declare const ModalStoriesMinimal: {
|
|
|
29
29
|
name: string;
|
|
30
30
|
};
|
|
31
31
|
};
|
|
32
|
-
export declare const
|
|
32
|
+
export declare const ModalStoriesImage: {
|
|
33
33
|
(): JSX.Element;
|
|
34
34
|
story: {
|
|
35
35
|
name: string;
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
|
-
export declare const
|
|
38
|
+
export declare const ModalConfirmation: {
|
|
39
39
|
(): JSX.Element;
|
|
40
40
|
story: {
|
|
41
41
|
name: string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CountryCode } from "libphonenumber-js";
|
|
3
|
+
declare type PhoneNumberInputProps = {
|
|
4
|
+
values: {
|
|
5
|
+
number: string;
|
|
6
|
+
countryCallingCode: string;
|
|
7
|
+
country: string;
|
|
8
|
+
};
|
|
9
|
+
names?: {
|
|
10
|
+
number: string;
|
|
11
|
+
countryCallingCode: string;
|
|
12
|
+
country: string;
|
|
13
|
+
};
|
|
14
|
+
onChange: (value: string, name: string) => void;
|
|
15
|
+
label?: React.ReactNode;
|
|
16
|
+
error?: string | null;
|
|
17
|
+
onBlur?: (e: React.FocusEvent) => void;
|
|
18
|
+
helperText?: React.ReactNode;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
defaultCountry?: CountryCode;
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
color?: string;
|
|
23
|
+
};
|
|
24
|
+
declare function PhoneNumberInputV1({ onChange, values, names, error, onBlur, helperText, label, required, defaultCountry, placeholder, color, }: PhoneNumberInputProps): JSX.Element;
|
|
25
|
+
export default PhoneNumberInputV1;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CountryCode } from "libphonenumber-js";
|
|
3
|
+
declare type PhoneInputProps = {
|
|
4
|
+
values: {
|
|
5
|
+
number: string;
|
|
6
|
+
countryCallingCode: string;
|
|
7
|
+
country: string;
|
|
8
|
+
};
|
|
9
|
+
onChange: (value: string, name: string) => void;
|
|
10
|
+
label?: React.ReactNode;
|
|
11
|
+
error?: string | null;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
defaultCountry?: CountryCode;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
color?: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
};
|
|
18
|
+
declare function PhoneInput({ values, onChange, defaultCountry, label, required, placeholder, error, name, }: PhoneInputProps): JSX.Element;
|
|
19
|
+
export default PhoneInput;
|
|
@@ -11,3 +11,21 @@ export declare const PhoneNumberInputStory: {
|
|
|
11
11
|
name: string;
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
|
+
export declare const PhoneInputStory: {
|
|
15
|
+
(): JSX.Element;
|
|
16
|
+
story: {
|
|
17
|
+
name: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare const PhoneNumberInputV2: {
|
|
21
|
+
(): JSX.Element;
|
|
22
|
+
story: {
|
|
23
|
+
name: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export declare const PhoneNumberInputStoryV1: {
|
|
27
|
+
(): JSX.Element;
|
|
28
|
+
story: {
|
|
29
|
+
name: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare type SelectOption = {
|
|
3
|
+
value: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export interface SelectProps {
|
|
8
|
+
label?: string;
|
|
9
|
+
value: string;
|
|
10
|
+
onChange: (e: React.FormEvent) => void;
|
|
11
|
+
externalLabel?: boolean;
|
|
12
|
+
large?: boolean;
|
|
13
|
+
options: Array<SelectOption>;
|
|
14
|
+
leadingIcon?: React.ReactElement;
|
|
15
|
+
helperText?: string | null;
|
|
16
|
+
isHelperTextPersistent?: boolean;
|
|
17
|
+
noArrow?: boolean;
|
|
18
|
+
color?: string;
|
|
19
|
+
asteriskColor?: string;
|
|
20
|
+
itemHoverColor?: string;
|
|
21
|
+
error?: boolean | string;
|
|
22
|
+
}
|
|
23
|
+
declare const SelectV2: ({ options, value, onChange, color, itemHoverColor, noArrow, }: SelectProps) => JSX.Element;
|
|
24
|
+
export default SelectV2;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SelectProps as MDCSelectProps, SelectHelperTextProps } from "@material/react-select";
|
|
3
|
+
export declare type SelectOption = {
|
|
4
|
+
value: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export interface SelectProps extends Omit<MDCSelectProps, "onEnhancedChange" | "ref" | "children" | "options" | "outlined" | "helperText" | "dense"> {
|
|
9
|
+
label?: string;
|
|
10
|
+
value: string;
|
|
11
|
+
onChange: (value: any) => void;
|
|
12
|
+
externalLabel?: boolean;
|
|
13
|
+
large?: boolean;
|
|
14
|
+
options: Array<string> | Array<SelectOption>;
|
|
15
|
+
leadingIcon?: React.ReactElement;
|
|
16
|
+
helperText?: string | React.ReactElement<SelectHelperTextProps> | null;
|
|
17
|
+
isHelperTextPersistent?: boolean;
|
|
18
|
+
noArrow?: boolean;
|
|
19
|
+
color?: string;
|
|
20
|
+
error?: boolean | string;
|
|
21
|
+
}
|
|
22
|
+
declare const SelectV2: ({ label, value, onChange, helperText, isHelperTextPersistent, externalLabel, id, className, options, large, required, leadingIcon, noArrow, error, color, ...rest }: SelectProps) => JSX.Element;
|
|
23
|
+
export default SelectV2;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare type SelectOption = {
|
|
3
|
+
value: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export interface SelectProps {
|
|
8
|
+
label?: string;
|
|
9
|
+
value: string | number;
|
|
10
|
+
onChange: (value: string) => void;
|
|
11
|
+
externalLabel?: boolean;
|
|
12
|
+
large?: boolean;
|
|
13
|
+
options: Array<SelectOption>;
|
|
14
|
+
leadingIcon?: React.ReactElement;
|
|
15
|
+
helperText?: string | null;
|
|
16
|
+
isHelperTextPersistent?: boolean;
|
|
17
|
+
noArrow?: boolean;
|
|
18
|
+
color?: string;
|
|
19
|
+
asteriskColor?: string;
|
|
20
|
+
itemHoverColor?: string;
|
|
21
|
+
error?: boolean | string;
|
|
22
|
+
trailingIcon?: React.ReactElement;
|
|
23
|
+
bgColor?: string;
|
|
24
|
+
}
|
|
25
|
+
declare const SelectV2: ({ options, value, onChange, color, itemHoverColor, noArrow, trailingIcon, bgColor, }: SelectProps) => JSX.Element;
|
|
26
|
+
export default SelectV2;
|
|
@@ -5,7 +5,7 @@ export declare type SelectOption = {
|
|
|
5
5
|
label?: string;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
};
|
|
8
|
-
export interface SelectProps extends Omit<MDCSelectProps, "
|
|
8
|
+
export interface SelectProps extends Omit<MDCSelectProps, "ref" | "children" | "options" | "outlined" | "helperText" | "dense"> {
|
|
9
9
|
label?: string;
|
|
10
10
|
value: string;
|
|
11
11
|
onChange: (e: React.FormEvent) => void;
|
|
@@ -17,7 +17,9 @@ export interface SelectProps extends Omit<MDCSelectProps, "onEnhancedChange" | "
|
|
|
17
17
|
isHelperTextPersistent?: boolean;
|
|
18
18
|
noArrow?: boolean;
|
|
19
19
|
color?: string;
|
|
20
|
+
asteriskColor?: string;
|
|
20
21
|
error?: boolean | string;
|
|
22
|
+
customTrailingIcon?: boolean;
|
|
21
23
|
}
|
|
22
|
-
declare const Select: ({ label, value, onChange, helperText, isHelperTextPersistent, externalLabel, id, className, options, large, required, leadingIcon, noArrow, error, color, ...rest }: SelectProps) => JSX.Element;
|
|
24
|
+
declare const Select: ({ label, value, onChange, helperText, isHelperTextPersistent, externalLabel, id, className, options, large, required, leadingIcon, noArrow, error, color, asteriskColor, customTrailingIcon, ...rest }: SelectProps) => JSX.Element;
|
|
23
25
|
export default Select;
|
|
@@ -10,3 +10,15 @@ export declare const SelectStory: {
|
|
|
10
10
|
name: string;
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
|
+
export declare const SelectEnhancedStory: {
|
|
14
|
+
(): JSX.Element;
|
|
15
|
+
story: {
|
|
16
|
+
name: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare const SelectStoryV2: {
|
|
20
|
+
(): JSX.Element;
|
|
21
|
+
story: {
|
|
22
|
+
name: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Toast } from "./toast";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ToastContainerProps } from "react-toastify";
|
|
3
|
+
import "react-toastify/dist/ReactToastify.css";
|
|
4
|
+
export interface ToastProps extends ToastContainerProps {
|
|
5
|
+
color?: string;
|
|
6
|
+
}
|
|
7
|
+
declare function Toast({ ...props }: ToastProps): JSX.Element;
|
|
8
|
+
export default Toast;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as TransactionCard } from "./transaction-card";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface TransactionCardProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
amount?: string;
|
|
5
|
+
recipient?: string;
|
|
6
|
+
receiptNo?: string;
|
|
7
|
+
details?: string;
|
|
8
|
+
tax?: string;
|
|
9
|
+
date?: string;
|
|
10
|
+
action?: React.ReactNode;
|
|
11
|
+
onClick?: () => void;
|
|
12
|
+
}
|
|
13
|
+
declare const TransactionCard: ({ className, amount, recipient, receiptNo, details, tax, date, action, onClick, }: TransactionCardProps) => JSX.Element;
|
|
14
|
+
export default TransactionCard;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import CenterDecorator from "../../utils/center-decorator";
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
decorators: (typeof CenterDecorator)[];
|
|
6
|
+
component: ({ className, amount, recipient, receiptNo, details, tax, date, action, onClick, }: import("./transaction-card").TransactionCardProps) => JSX.Element;
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
9
|
+
export declare const TransactionCardStory: {
|
|
10
|
+
(): JSX.Element;
|
|
11
|
+
story: {
|
|
12
|
+
name: string;
|
|
13
|
+
};
|
|
14
|
+
};
|