injast-core 1.0.78
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/LICENSE +15 -0
- package/README.md +127 -0
- package/dist/components/index.js +3187 -0
- package/dist/constants/index.js +138 -0
- package/dist/context/index.js +308 -0
- package/dist/fonts/IranYekan/Woff/IRANYekanXFaNum-Black.woff +0 -0
- package/dist/fonts/IranYekan/Woff/IRANYekanXFaNum-Bold.woff +0 -0
- package/dist/fonts/IranYekan/Woff/IRANYekanXFaNum-DemiBold.woff +0 -0
- package/dist/fonts/IranYekan/Woff/IRANYekanXFaNum-ExtraBlack.woff +0 -0
- package/dist/fonts/IranYekan/Woff/IRANYekanXFaNum-ExtraBold.woff +0 -0
- package/dist/fonts/IranYekan/Woff/IRANYekanXFaNum-Heavy.woff +0 -0
- package/dist/fonts/IranYekan/Woff/IRANYekanXFaNum-Light.woff +0 -0
- package/dist/fonts/IranYekan/Woff/IRANYekanXFaNum-Medium.woff +0 -0
- package/dist/fonts/IranYekan/Woff/IRANYekanXFaNum-Regular.woff +0 -0
- package/dist/fonts/IranYekan/Woff/IRANYekanXFaNum-Thin.woff +0 -0
- package/dist/fonts/IranYekan/Woff/IRANYekanXFaNum-UltraLight.woff +0 -0
- package/dist/fonts/IranYekan/Woff2/IRANYekanXFaNum-Black.woff2 +0 -0
- package/dist/fonts/IranYekan/Woff2/IRANYekanXFaNum-Bold.woff2 +0 -0
- package/dist/fonts/IranYekan/Woff2/IRANYekanXFaNum-DemiBold.woff2 +0 -0
- package/dist/fonts/IranYekan/Woff2/IRANYekanXFaNum-ExtraBlack.woff2 +0 -0
- package/dist/fonts/IranYekan/Woff2/IRANYekanXFaNum-ExtraBold.woff2 +0 -0
- package/dist/fonts/IranYekan/Woff2/IRANYekanXFaNum-Heavy.woff2 +0 -0
- package/dist/fonts/IranYekan/Woff2/IRANYekanXFaNum-Light.woff2 +0 -0
- package/dist/fonts/IranYekan/Woff2/IRANYekanXFaNum-Medium.woff2 +0 -0
- package/dist/fonts/IranYekan/Woff2/IRANYekanXFaNum-Regular.woff2 +0 -0
- package/dist/fonts/IranYekan/Woff2/IRANYekanXFaNum-Thin.woff2 +0 -0
- package/dist/fonts/IranYekan/Woff2/IRANYekanXFaNum-UltraLight.woff2 +0 -0
- package/dist/fonts/fonts.css +245 -0
- package/dist/hooks/index.js +107 -0
- package/dist/index.js +3831 -0
- package/dist/libs/index.js +142 -0
- package/dist/providers/index.js +305 -0
- package/dist/types/components/Accordion.d.ts +4 -0
- package/dist/types/components/AccordionDetails.d.ts +4 -0
- package/dist/types/components/AccordionSummary.d.ts +4 -0
- package/dist/types/components/Autocomplete.d.ts +3 -0
- package/dist/types/components/Box.d.ts +4 -0
- package/dist/types/components/Button.d.ts +9 -0
- package/dist/types/components/CardNumberInput.d.ts +13 -0
- package/dist/types/components/Checkbox.d.ts +11 -0
- package/dist/types/components/CircularProgress.d.ts +4 -0
- package/dist/types/components/Container.d.ts +4 -0
- package/dist/types/components/CounterBoxInput.d.ts +23 -0
- package/dist/types/components/DataGrid.d.ts +57 -0
- package/dist/types/components/Dialog.d.ts +4 -0
- package/dist/types/components/Divider.d.ts +4 -0
- package/dist/types/components/Drawer.d.ts +9 -0
- package/dist/types/components/Fab.d.ts +4 -0
- package/dist/types/components/FormControl.d.ts +4 -0
- package/dist/types/components/FormControlLabel.d.ts +4 -0
- package/dist/types/components/Grid.d.ts +4 -0
- package/dist/types/components/IconButton.d.ts +4 -0
- package/dist/types/components/Image.d.ts +12 -0
- package/dist/types/components/InputLabel.d.ts +4 -0
- package/dist/types/components/InputPhoneNumber.d.ts +15 -0
- package/dist/types/components/IosHiddenOtpInput.d.ts +6 -0
- package/dist/types/components/List.d.ts +4 -0
- package/dist/types/components/ListItem.d.ts +4 -0
- package/dist/types/components/Loading.d.ts +7 -0
- package/dist/types/components/LoadingModal.d.ts +6 -0
- package/dist/types/components/MenuItem.d.ts +4 -0
- package/dist/types/components/MobileDatePicker.d.ts +19 -0
- package/dist/types/components/Modal.d.ts +9 -0
- package/dist/types/components/MultiSelect.d.ts +14 -0
- package/dist/types/components/NumberInput.d.ts +19 -0
- package/dist/types/components/OtpInput.d.ts +16 -0
- package/dist/types/components/Pagination.d.ts +4 -0
- package/dist/types/components/ProgressBar.d.ts +10 -0
- package/dist/types/components/Radio.d.ts +4 -0
- package/dist/types/components/RadioGroup.d.ts +4 -0
- package/dist/types/components/Select.d.ts +4 -0
- package/dist/types/components/Skeleton.d.ts +4 -0
- package/dist/types/components/Slider.d.ts +4 -0
- package/dist/types/components/Step.d.ts +4 -0
- package/dist/types/components/StepConnector.d.ts +4 -0
- package/dist/types/components/StepContent.d.ts +4 -0
- package/dist/types/components/StepLabel.d.ts +4 -0
- package/dist/types/components/Stepper.d.ts +4 -0
- package/dist/types/components/SvgIcon.d.ts +8 -0
- package/dist/types/components/Tab.d.ts +12 -0
- package/dist/types/components/TextField.d.ts +9 -0
- package/dist/types/components/Toast.d.ts +20 -0
- package/dist/types/components/Toggle.d.ts +10 -0
- package/dist/types/components/Typography.d.ts +8 -0
- package/dist/types/components/WheelDatePicker.d.ts +37 -0
- package/dist/types/components/index.d.ts +53 -0
- package/dist/types/constants/colors.d.ts +2 -0
- package/dist/types/constants/index.d.ts +2 -0
- package/dist/types/constants/stepConnectorClasses.d.ts +2 -0
- package/dist/types/constants/typography.d.ts +82 -0
- package/dist/types/context/MessageHandler.d.ts +15 -0
- package/dist/types/context/index.d.ts +1 -0
- package/dist/types/hooks/index.d.ts +8 -0
- package/dist/types/hooks/useErrorHandler.d.ts +10 -0
- package/dist/types/hooks/useMessage.d.ts +2 -0
- package/dist/types/hooks/useWebOtpListener.d.ts +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.js +19 -0
- package/dist/types/libs/create-api-request.d.ts +10 -0
- package/dist/types/libs/create-logger.d.ts +9 -0
- package/dist/types/libs/create-sentry-instrument.d.ts +9 -0
- package/dist/types/libs/index.d.ts +10 -0
- package/dist/types/providers/SPAThemeProvider.d.ts +11 -0
- package/dist/types/providers/ThemeProvider.d.ts +9 -0
- package/dist/types/providers/index.d.ts +2 -0
- package/dist/types/stories/persian.d.ts +81 -0
- package/dist/types/types/axios.d.ts +8 -0
- package/dist/types/types/color.d.ts +38 -0
- package/dist/types/types/index.d.ts +7 -0
- package/dist/types/types/material-react-table-types.d.ts +2 -0
- package/dist/types/types/mui-types.d.ts +2 -0
- package/dist/types/types/services.d.ts +26 -0
- package/dist/types/types/typography.d.ts +62 -0
- package/dist/types/types/window.d.ts +135 -0
- package/dist/types/utils/checkUser.d.ts +1 -0
- package/dist/types/utils/convertRialToToman.d.ts +7 -0
- package/dist/types/utils/createQueryParams.d.ts +3 -0
- package/dist/types/utils/dateHelpers.d.ts +19 -0
- package/dist/types/utils/delay.d.ts +1 -0
- package/dist/types/utils/formatPersianNumber.d.ts +1 -0
- package/dist/types/utils/getClaims.d.ts +11 -0
- package/dist/types/utils/index.d.ts +17 -0
- package/dist/types/utils/injastStyled.d.ts +2 -0
- package/dist/types/utils/postToParent.d.ts +2 -0
- package/dist/types/utils/toLatinDigit.d.ts +1 -0
- package/dist/utils/index.js +256 -0
- package/package.json +159 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ComponentProps, type RefObject, FC } from "react";
|
|
2
|
+
import TextField from "./TextField";
|
|
3
|
+
/** Strips to ASCII digits only (supports Persian/Arabic numerals). */
|
|
4
|
+
export declare const asciiDigitsOnly: (s: string) => string;
|
|
5
|
+
export declare const normalizeIranPhone: (s: string, maxDigitLength?: number) => string;
|
|
6
|
+
export type InputPhoneNumberProps = Omit<ComponentProps<typeof TextField>, "value" | "onChange" | "onBlur"> & {
|
|
7
|
+
value: string;
|
|
8
|
+
onChange: (_value: string) => void;
|
|
9
|
+
dir?: "rtl" | "ltr";
|
|
10
|
+
onBlur?: () => void;
|
|
11
|
+
maxDigitLength?: number;
|
|
12
|
+
inputRef?: RefObject<HTMLInputElement | null>;
|
|
13
|
+
};
|
|
14
|
+
declare const InputPhoneNumber: FC<InputPhoneNumberProps>;
|
|
15
|
+
export default InputPhoneNumber;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import "react-multi-date-picker/styles/layouts/mobile.css";
|
|
3
|
+
import { SxProps } from "@mui/material";
|
|
4
|
+
interface MobileDatePickerProps {
|
|
5
|
+
onChange: (value: string) => void;
|
|
6
|
+
width?: string | number;
|
|
7
|
+
height?: number;
|
|
8
|
+
value?: string;
|
|
9
|
+
label?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
error?: boolean;
|
|
12
|
+
helperText?: ReactNode;
|
|
13
|
+
textFieldSxProps?: SxProps;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
minDate?: string;
|
|
16
|
+
maxDate?: string;
|
|
17
|
+
}
|
|
18
|
+
declare const MobileDatePicker: React.FC<MobileDatePickerProps>;
|
|
19
|
+
export default MobileDatePicker;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
type MultiSelectOption = {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
};
|
|
6
|
+
type MultiSelectProps = {
|
|
7
|
+
value: string[];
|
|
8
|
+
onChange: (_value: string[]) => void;
|
|
9
|
+
options: MultiSelectOption[];
|
|
10
|
+
minWidth?: string | number;
|
|
11
|
+
label?: string;
|
|
12
|
+
};
|
|
13
|
+
declare const MultiSelect: FC<MultiSelectProps>;
|
|
14
|
+
export default MultiSelect;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface NumberInputProps {
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
error?: boolean;
|
|
6
|
+
helperText?: string;
|
|
7
|
+
hasClearButton?: boolean;
|
|
8
|
+
onReset?: () => void;
|
|
9
|
+
label?: string;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
fungible?: boolean;
|
|
12
|
+
maxLength?: number;
|
|
13
|
+
minLength?: number;
|
|
14
|
+
unit?: string;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare const getCleanNumber: (value: string, fungible?: boolean) => string;
|
|
18
|
+
declare const NumberInput: React.FC<NumberInputProps>;
|
|
19
|
+
export default NumberInput;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface InputProps {
|
|
3
|
+
backgroundColor?: string;
|
|
4
|
+
width?: number | string;
|
|
5
|
+
height?: number | string;
|
|
6
|
+
focusedBorderColor?: string;
|
|
7
|
+
error?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export default function OtpInput({ separator, length, value, onChange, inputProps, }: {
|
|
10
|
+
separator?: React.ReactNode;
|
|
11
|
+
length: number;
|
|
12
|
+
value: string;
|
|
13
|
+
onChange: React.Dispatch<React.SetStateAction<string>>;
|
|
14
|
+
inputProps?: InputProps;
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { FC } from "react";
|
|
2
|
+
import { TextFieldProps as MuiTextFieldProps } from "@mui/material";
|
|
3
|
+
interface TextFieldProps {
|
|
4
|
+
startAdornment?: React.ReactNode;
|
|
5
|
+
endAdornment?: React.ReactNode;
|
|
6
|
+
height?: number;
|
|
7
|
+
}
|
|
8
|
+
declare const TextField: FC<TextFieldProps & MuiTextFieldProps>;
|
|
9
|
+
export default TextField;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type Severity = "success" | "info" | "warning" | "error";
|
|
3
|
+
type Message = {
|
|
4
|
+
text: string;
|
|
5
|
+
severity: Severity;
|
|
6
|
+
};
|
|
7
|
+
interface ToastProps {
|
|
8
|
+
message: Message;
|
|
9
|
+
open: boolean;
|
|
10
|
+
duration: number;
|
|
11
|
+
width?: string | number;
|
|
12
|
+
handleClose: () => void;
|
|
13
|
+
anchorOrigin?: {
|
|
14
|
+
vertical: "top" | "bottom";
|
|
15
|
+
horizontal: "left" | "right" | "center";
|
|
16
|
+
};
|
|
17
|
+
isWide?: boolean;
|
|
18
|
+
}
|
|
19
|
+
declare const Toast: React.FC<ToastProps>;
|
|
20
|
+
export default Toast;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { FC } from "react";
|
|
2
|
+
interface ToggleProps {
|
|
3
|
+
size?: "medium" | "small";
|
|
4
|
+
color?: string;
|
|
5
|
+
checked?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const Toggle: FC<ToggleProps>;
|
|
10
|
+
export default Toggle;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { TypographyProps as MuiTypographyProps } from "@mui/material";
|
|
3
|
+
type ExtendedVariant = MuiTypographyProps["variant"] | "display1" | "display2" | "display3" | "title1" | "title2" | "title3" | "title4" | "input1" | "input2" | "input3" | "button1" | "button2" | "button3" | "label1" | "label2";
|
|
4
|
+
interface TypographyProps extends MuiTypographyProps {
|
|
5
|
+
variant?: ExtendedVariant;
|
|
6
|
+
}
|
|
7
|
+
declare const Typography: FC<TypographyProps>;
|
|
8
|
+
export default Typography;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
/** Jalali leap year: 31 leap years per 128 years (cycle). Exported for building min/max date from year. */
|
|
3
|
+
export declare function isJalaliLeapYear(jy: number): boolean;
|
|
4
|
+
/** Format of the first argument passed to onChange. */
|
|
5
|
+
export type WheelDatePickerOnChangeFormat = "unix" | "jalali" | "gregorian";
|
|
6
|
+
export interface WheelDatePickerProps {
|
|
7
|
+
/** Controlled value. Format is specified by valueFormat (or dateFormat). */
|
|
8
|
+
value?: number | string | null;
|
|
9
|
+
/**
|
|
10
|
+
* Shortcut: sets both valueFormat and onChangeDateFormat.
|
|
11
|
+
* Use this when value and onChange use the same format (e.g. dateFormat="jalali").
|
|
12
|
+
*/
|
|
13
|
+
dateFormat?: WheelDatePickerOnChangeFormat;
|
|
14
|
+
/** Format of the value prop. Defaults to dateFormat or `unix`. */
|
|
15
|
+
valueFormat?: WheelDatePickerOnChangeFormat;
|
|
16
|
+
/** First argument is the date in the format specified by onChangeDateFormat (or dateFormat). */
|
|
17
|
+
onChange?: (_value: number | string | null) => void;
|
|
18
|
+
/** Format passed to onChange. Defaults to dateFormat or `unix`. */
|
|
19
|
+
onChangeDateFormat?: WheelDatePickerOnChangeFormat;
|
|
20
|
+
/** Default date when value is null/undefined (unix seconds). Falls back to today if not set. */
|
|
21
|
+
defaultDate?: number | null;
|
|
22
|
+
/** Minimum selectable date (unix seconds). */
|
|
23
|
+
minDate?: number | null;
|
|
24
|
+
/** Maximum selectable date (unix seconds). */
|
|
25
|
+
maxDate?: number | null;
|
|
26
|
+
/** Label above the input field. */
|
|
27
|
+
label?: string;
|
|
28
|
+
/** Placeholder when no date is selected. */
|
|
29
|
+
placeholder?: string;
|
|
30
|
+
/** Title shown in the drawer header. */
|
|
31
|
+
title?: string;
|
|
32
|
+
error?: boolean;
|
|
33
|
+
helperText?: string;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
}
|
|
36
|
+
declare const WheelDatePicker: FC<WheelDatePickerProps>;
|
|
37
|
+
export default WheelDatePicker;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export { default as Accordion } from "./Accordion";
|
|
2
|
+
export { default as AccordionDetails } from "./AccordionDetails";
|
|
3
|
+
export { default as AccordionSummary } from "./AccordionSummary";
|
|
4
|
+
export { default as Autocomplete } from "./Autocomplete";
|
|
5
|
+
export { default as Box } from "./Box";
|
|
6
|
+
export { default as Button } from "./Button";
|
|
7
|
+
export { default as Checkbox } from "./Checkbox";
|
|
8
|
+
export { default as Container } from "./Container";
|
|
9
|
+
export { default as Drawer } from "./Drawer";
|
|
10
|
+
export { default as FormControl } from "./FormControl";
|
|
11
|
+
export { default as Grid } from "./Grid";
|
|
12
|
+
export { default as IconButton } from "./IconButton";
|
|
13
|
+
export { default as InputLabel } from "./InputLabel";
|
|
14
|
+
export { default as Loading } from "./Loading";
|
|
15
|
+
export { default as MenuItem } from "./MenuItem";
|
|
16
|
+
export { default as Modal } from "./Modal";
|
|
17
|
+
export { default as ProgressBar } from "./ProgressBar";
|
|
18
|
+
export { default as Radio } from "./Radio";
|
|
19
|
+
export { default as Select } from "./Select";
|
|
20
|
+
export { default as Skeleton } from "./Skeleton";
|
|
21
|
+
export { default as Step } from "./Step";
|
|
22
|
+
export { default as StepConnector } from "./StepConnector";
|
|
23
|
+
export { default as StepContent } from "./StepContent";
|
|
24
|
+
export { default as StepLabel } from "./StepLabel";
|
|
25
|
+
export { default as Stepper } from "./Stepper";
|
|
26
|
+
export { default as TextField } from "./TextField";
|
|
27
|
+
export { default as Toast } from "./Toast";
|
|
28
|
+
export { default as Toggle } from "./Toggle";
|
|
29
|
+
export { default as Typography } from "./Typography";
|
|
30
|
+
export { default as OtpInput } from "./OtpInput";
|
|
31
|
+
export { default as Divider } from "./Divider";
|
|
32
|
+
export { default as FormControlLabel } from "./FormControlLabel";
|
|
33
|
+
export { default as RadioGroup } from "./RadioGroup";
|
|
34
|
+
export { default as Slider } from "./Slider";
|
|
35
|
+
export { default as List } from "./List";
|
|
36
|
+
export { default as ListItem } from "./ListItem";
|
|
37
|
+
export { default as MobileDatePicker } from "./MobileDatePicker";
|
|
38
|
+
export { default as Fab } from "./Fab";
|
|
39
|
+
export { default as Tab } from "./Tab";
|
|
40
|
+
export { default as CounterBoxInput } from "./CounterBoxInput";
|
|
41
|
+
export { default as SvgIcon } from "./SvgIcon";
|
|
42
|
+
export { default as Dialog } from "./Dialog";
|
|
43
|
+
export { default as LoadingModal } from "./LoadingModal";
|
|
44
|
+
export { default as Image } from "./Image";
|
|
45
|
+
export { default as Pagination } from "./Pagination";
|
|
46
|
+
export { default as CircularProgress } from "./CircularProgress";
|
|
47
|
+
export { default as IosHiddenOtpInput } from "./IosHiddenOtpInput";
|
|
48
|
+
export { default as CardNumberInput } from "./CardNumberInput";
|
|
49
|
+
export { default as NumberInput } from "./NumberInput";
|
|
50
|
+
export { default as InputPhoneNumber } from "./InputPhoneNumber";
|
|
51
|
+
export { default as WheelDatePicker } from "./WheelDatePicker";
|
|
52
|
+
export { default as DataGrid } from "./DataGrid";
|
|
53
|
+
export { default as MultiSelect } from "./MultiSelect";
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export declare const uiTypography: {
|
|
2
|
+
display1: {
|
|
3
|
+
fontSize: string;
|
|
4
|
+
fontWeight: number;
|
|
5
|
+
};
|
|
6
|
+
display2: {
|
|
7
|
+
fontSize: string;
|
|
8
|
+
fontWeight: number;
|
|
9
|
+
};
|
|
10
|
+
display3: {
|
|
11
|
+
fontSize: string;
|
|
12
|
+
fontWeight: number;
|
|
13
|
+
};
|
|
14
|
+
h1: {
|
|
15
|
+
fontSize: string;
|
|
16
|
+
fontWeight: number;
|
|
17
|
+
};
|
|
18
|
+
h2: {
|
|
19
|
+
fontSize: string;
|
|
20
|
+
fontWeight: number;
|
|
21
|
+
};
|
|
22
|
+
h3: {
|
|
23
|
+
fontSize: string;
|
|
24
|
+
fontWeight: number;
|
|
25
|
+
};
|
|
26
|
+
title1: {
|
|
27
|
+
fontSize: string;
|
|
28
|
+
fontWeight: number;
|
|
29
|
+
};
|
|
30
|
+
title2: {
|
|
31
|
+
fontSize: string;
|
|
32
|
+
fontWeight: number;
|
|
33
|
+
};
|
|
34
|
+
title3: {
|
|
35
|
+
fontSize: string;
|
|
36
|
+
fontWeight: number;
|
|
37
|
+
};
|
|
38
|
+
title4: {
|
|
39
|
+
fontSize: string;
|
|
40
|
+
fontWeight: number;
|
|
41
|
+
};
|
|
42
|
+
input1: {
|
|
43
|
+
fontSize: string;
|
|
44
|
+
fontWeight: number;
|
|
45
|
+
};
|
|
46
|
+
input2: {
|
|
47
|
+
fontSize: string;
|
|
48
|
+
fontWeight: number;
|
|
49
|
+
};
|
|
50
|
+
input3: {
|
|
51
|
+
fontSize: string;
|
|
52
|
+
fontWeight: number;
|
|
53
|
+
};
|
|
54
|
+
button1: {
|
|
55
|
+
fontSize: string;
|
|
56
|
+
fontWeight: number;
|
|
57
|
+
};
|
|
58
|
+
button2: {
|
|
59
|
+
fontSize: string;
|
|
60
|
+
fontWeight: number;
|
|
61
|
+
};
|
|
62
|
+
button3: {
|
|
63
|
+
fontSize: string;
|
|
64
|
+
fontWeight: number;
|
|
65
|
+
};
|
|
66
|
+
body1: {
|
|
67
|
+
fontSize: string;
|
|
68
|
+
fontWeight: number;
|
|
69
|
+
};
|
|
70
|
+
body2: {
|
|
71
|
+
fontSize: string;
|
|
72
|
+
fontWeight: number;
|
|
73
|
+
};
|
|
74
|
+
label1: {
|
|
75
|
+
fontSize: string;
|
|
76
|
+
fontWeight: number;
|
|
77
|
+
};
|
|
78
|
+
label2: {
|
|
79
|
+
fontSize: string;
|
|
80
|
+
fontWeight: number;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
type Severity = "success" | "info" | "warning" | "error";
|
|
3
|
+
export type MessageContextProps = {
|
|
4
|
+
showMessage: (message: string, severity: Severity, showUndo?: boolean, isWide?: boolean) => void;
|
|
5
|
+
};
|
|
6
|
+
export declare const MessageContext: React.Context<MessageContextProps | undefined>;
|
|
7
|
+
export declare const MessageProvider: React.FC<{
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
toastPosition?: {
|
|
10
|
+
vertical: "top" | "bottom";
|
|
11
|
+
horizontal: "left" | "right" | "center";
|
|
12
|
+
};
|
|
13
|
+
width?: string | number;
|
|
14
|
+
}>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MessageProvider } from "./MessageHandler";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { useLocalStorage } from "@wojtekmaj/react-hooks";
|
|
2
|
+
export { useWindowHeight } from "@wojtekmaj/react-hooks";
|
|
3
|
+
export { useWindowWidth } from "@wojtekmaj/react-hooks";
|
|
4
|
+
export { useColorScheme } from "@mui/material/styles";
|
|
5
|
+
export { useTheme } from "@mui/material/styles";
|
|
6
|
+
export { useErrorHandler } from "./useErrorHandler";
|
|
7
|
+
export { useMessage } from "./useMessage";
|
|
8
|
+
export { useWebOtpListener } from "./useWebOtpListener";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ErrorFields } from "../types";
|
|
2
|
+
type ErrorFieldMessage<T> = (errorField: keyof T | "root" | `root.${string}`, errorMessage: {
|
|
3
|
+
message: string;
|
|
4
|
+
}) => void;
|
|
5
|
+
export declare const useErrorHandler: <T>() => {
|
|
6
|
+
handleError: (error: unknown, fieldHandler?: ErrorFieldMessage<T>, isWide?: boolean) => void;
|
|
7
|
+
errFields: ErrorFields | undefined;
|
|
8
|
+
errorMessage: string | undefined;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useWebOtpListener(setOtp: (code: string) => void): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/types/axios.ts
|
|
4
|
+
import "axios";
|
|
5
|
+
|
|
6
|
+
// src/types/typography.ts
|
|
7
|
+
import "@mui/material/styles";
|
|
8
|
+
|
|
9
|
+
// src/types/window.ts
|
|
10
|
+
var Permissions = /* @__PURE__ */ ((Permissions2) => {
|
|
11
|
+
Permissions2[Permissions2["Camera"] = 2e3] = "Camera";
|
|
12
|
+
Permissions2[Permissions2["Contact"] = 2010] = "Contact";
|
|
13
|
+
Permissions2[Permissions2["Audio"] = 2020] = "Audio";
|
|
14
|
+
Permissions2[Permissions2["Location"] = 2030] = "Location";
|
|
15
|
+
return Permissions2;
|
|
16
|
+
})(Permissions || {});
|
|
17
|
+
export {
|
|
18
|
+
Permissions
|
|
19
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AxiosInstance, InternalAxiosRequestConfig, CreateAxiosDefaults, AxiosResponse } from "axios";
|
|
2
|
+
type BaseConfig = CreateAxiosDefaults & {
|
|
3
|
+
redirect?: string;
|
|
4
|
+
};
|
|
5
|
+
type OnRequestFulfilled = (config: InternalAxiosRequestConfig) => InternalAxiosRequestConfig;
|
|
6
|
+
type OnResponseFulfilled<T> = ((value: T) => T | Promise<T>) | null;
|
|
7
|
+
type OnResponseRejected = (error: any) => any;
|
|
8
|
+
declare const createApiRequest: (baseConfig?: BaseConfig, onRequestFulfilled?: OnRequestFulfilled, onRequestRejected?: any, onResponseFulfilled?: OnResponseFulfilled<AxiosResponse<any, any>>, onResponseRejected?: OnResponseRejected, disableAuthHeader?: boolean) => AxiosInstance;
|
|
9
|
+
export { createApiRequest };
|
|
10
|
+
export { BaseConfig, OnRequestFulfilled, OnResponseFulfilled, OnResponseRejected, };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type LogParam = unknown;
|
|
2
|
+
type LoggerOptions = {
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
prefix?: string;
|
|
5
|
+
timestamp?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare function createLogger(options: LoggerOptions, message?: LogParam, ...optionalParams: LogParam[]): void;
|
|
8
|
+
export { createLogger };
|
|
9
|
+
export { LogParam, LoggerOptions };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as Sentry from "@sentry/react";
|
|
2
|
+
type InitOptions = {
|
|
3
|
+
dsn: string;
|
|
4
|
+
appName: string;
|
|
5
|
+
release?: string;
|
|
6
|
+
environment?: string;
|
|
7
|
+
};
|
|
8
|
+
declare function initSentry({ dsn, appName, release, environment }: InitOptions): void;
|
|
9
|
+
export { initSentry, Sentry };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { createApiRequest, BaseConfig as ApiRequestBaseConfig, OnRequestFulfilled as ApiRequestOnRequestFulfilled, OnResponseFulfilled as ApiRequestOnResponseFulfilled, OnResponseRejected as ApiRequestOnResponseRejected, } from "./create-api-request";
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated
|
|
4
|
+
* Use `createApiRequest` instead – this will be removed in v1.1.0.
|
|
5
|
+
*/
|
|
6
|
+
export { createApiRequest as createApiRequestV2 } from "./create-api-request";
|
|
7
|
+
export { initSentry } from "./create-sentry-instrument";
|
|
8
|
+
export { Sentry } from "./create-sentry-instrument";
|
|
9
|
+
export { createLogger } from "./create-logger";
|
|
10
|
+
export { type LoggerOptions, type LogParam } from "./create-logger";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { AppColors, DefaultColors } from "../types/color";
|
|
3
|
+
type ThemeProviderProps = Readonly<{
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
appColors: AppColors;
|
|
6
|
+
dir: "rtl" | "ltr";
|
|
7
|
+
defaultColors?: DefaultColors;
|
|
8
|
+
themeOptions?: any;
|
|
9
|
+
}>;
|
|
10
|
+
declare const SPAThemeProvider: FC<ThemeProviderProps>;
|
|
11
|
+
export default SPAThemeProvider;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { AppColors } from "../types/color";
|
|
3
|
+
type ThemeProviderProps = Readonly<{
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
appColors: AppColors;
|
|
6
|
+
dir: "rtl" | "ltr";
|
|
7
|
+
}>;
|
|
8
|
+
declare const ThemeProvider: FC<ThemeProviderProps>;
|
|
9
|
+
export default ThemeProvider;
|