@inntechcorp/it-design 2.0.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.
Files changed (174) hide show
  1. package/README.md +37 -0
  2. package/dist/accordion/index.d.ts +14 -0
  3. package/dist/accordion/item/Item.d.ts +3 -0
  4. package/dist/accordion/item/styled.components.d.ts +7 -0
  5. package/dist/accordion/submenu/SubMenu.d.ts +2 -0
  6. package/dist/accordion/submenu/styled.components.d.ts +11 -0
  7. package/dist/alert/alert.style.error.d.ts +4 -0
  8. package/dist/alert/alert.style.info.d.ts +4 -0
  9. package/dist/alert/alert.style.success.d.ts +4 -0
  10. package/dist/alert/alert.style.warning.d.ts +4 -0
  11. package/dist/alert/index.d.ts +6 -0
  12. package/dist/alert/styled.d.ts +9 -0
  13. package/dist/alink/index.d.ts +2 -0
  14. package/dist/alink/styled.d.ts +5 -0
  15. package/dist/back-top/index.d.ts +1 -0
  16. package/dist/back-top/styled.components.d.ts +6 -0
  17. package/dist/button/button.style.SVG.d.ts +4 -0
  18. package/dist/button/button.style.circle.d.ts +4 -0
  19. package/dist/button/button.style.default.d.ts +4 -0
  20. package/dist/button/button.style.filled.d.ts +4 -0
  21. package/dist/button/button.style.ghost.d.ts +4 -0
  22. package/dist/button/button.style.icon.d.ts +5 -0
  23. package/dist/button/button.style.link.d.ts +4 -0
  24. package/dist/button/button.style.outline.d.ts +4 -0
  25. package/dist/button/button.style.size.d.ts +4 -0
  26. package/dist/button/button.style.solid.d.ts +4 -0
  27. package/dist/button/button.style.strecth.d.ts +4 -0
  28. package/dist/button/index.d.ts +3 -0
  29. package/dist/button/styled.components.d.ts +15 -0
  30. package/dist/checkbox/group/index.d.ts +4 -0
  31. package/dist/checkbox/group/styled.d.ts +3 -0
  32. package/dist/checkbox/index.d.ts +10 -0
  33. package/dist/checkbox/styled.d.ts +9 -0
  34. package/dist/context/ITDContext.d.ts +23 -0
  35. package/dist/enums/enum.d.ts +41 -0
  36. package/dist/form/context/FormContext.d.ts +32 -0
  37. package/dist/form/context/FormStore.d.ts +11 -0
  38. package/dist/form/control/Control.d.ts +6 -0
  39. package/dist/form/control/styled.d.ts +3 -0
  40. package/dist/form/group/Group.d.ts +16 -0
  41. package/dist/form/group/styled.components.d.ts +5 -0
  42. package/dist/form/index.d.ts +20 -0
  43. package/dist/form/item/Item.d.ts +18 -0
  44. package/dist/form/validation/TCIdentity.d.ts +1 -0
  45. package/dist/form/validation/Validator.d.ts +14 -0
  46. package/dist/form/wrapper/FormWrapper.d.ts +15 -0
  47. package/dist/helpers/array/ChunkArray.d.ts +7 -0
  48. package/dist/helpers/aspectratio/DetermineNewHeight.d.ts +1 -0
  49. package/dist/helpers/aspectratio/DetermineNewWidth.d.ts +1 -0
  50. package/dist/helpers/binary/FormatBytes.d.ts +1 -0
  51. package/dist/helpers/binary/GetTypeByFileType.d.ts +2 -0
  52. package/dist/helpers/checker/CheckFileURL.d.ts +1 -0
  53. package/dist/helpers/checker/FileChecker.d.ts +7 -0
  54. package/dist/helpers/country/GetCountryCodeByCurrencyCode.d.ts +1 -0
  55. package/dist/helpers/country/GetCountryCodeByLanguage.d.ts +1 -0
  56. package/dist/helpers/css/FindSelector.d.ts +1 -0
  57. package/dist/helpers/currency/ConvertCurrency.d.ts +1 -0
  58. package/dist/helpers/currency/GetByCurrency.d.ts +1 -0
  59. package/dist/helpers/currency/GetCurrencyFormat.d.ts +1 -0
  60. package/dist/helpers/currency/GetCurrencySymbol.d.ts +1 -0
  61. package/dist/helpers/currency/GetDecimalByCurrency.d.ts +1 -0
  62. package/dist/helpers/index.d.ts +22 -0
  63. package/dist/helpers/json/IsValidJSON.d.ts +1 -0
  64. package/dist/helpers/math/AddZero.d.ts +1 -0
  65. package/dist/helpers/promise/Wait.d.ts +1 -0
  66. package/dist/helpers/remover/RemoveUnits.d.ts +1 -0
  67. package/dist/helpers/string/UniUpperCase.d.ts +6 -0
  68. package/dist/helpers/theme/AddDefaultThemeStyle.d.ts +4 -0
  69. package/dist/helpers/theme/UpdateThemeStyle.d.ts +5 -0
  70. package/dist/helpers/url/ValidURL.d.ts +1 -0
  71. package/dist/hooks/index.d.ts +13 -0
  72. package/dist/hooks/useAddExternalCSS.d.ts +14 -0
  73. package/dist/hooks/useComponentSize.d.ts +6 -0
  74. package/dist/hooks/useConnectionStatus.d.ts +10 -0
  75. package/dist/hooks/useConstructor.d.ts +11 -0
  76. package/dist/hooks/useCoreFetch.d.ts +37 -0
  77. package/dist/hooks/useCreateDynamicStyle.d.ts +10 -0
  78. package/dist/hooks/useCreateStyledStyle.d.ts +13 -0
  79. package/dist/hooks/useMultiQuery.d.ts +7 -0
  80. package/dist/hooks/useOnClickOutside.d.ts +12 -0
  81. package/dist/hooks/useOnESCKeyDown.d.ts +10 -0
  82. package/dist/hooks/useOnResize.d.ts +10 -0
  83. package/dist/hooks/useReCaptcha.d.ts +7 -0
  84. package/dist/hooks/useSingleQuery.d.ts +3 -0
  85. package/dist/icons/Arrow.d.ts +6 -0
  86. package/dist/icons/BackToTop.d.ts +6 -0
  87. package/dist/icons/Checkmark.d.ts +6 -0
  88. package/dist/icons/InlineSelectArrow.d.ts +6 -0
  89. package/dist/icons/Lock.d.ts +6 -0
  90. package/dist/icons/Picture.d.ts +6 -0
  91. package/dist/icons/Trash.d.ts +6 -0
  92. package/dist/icons/Upload.d.ts +6 -0
  93. package/dist/icons/ZoomIn.d.ts +6 -0
  94. package/dist/icons/ZoomOut.d.ts +6 -0
  95. package/dist/icons/index.d.ts +10 -0
  96. package/dist/index.cjs.js +971 -0
  97. package/dist/index.d.mts +73 -0
  98. package/dist/index.d.ts +1120 -0
  99. package/dist/index.esm.js +971 -0
  100. package/dist/input/index.d.ts +9 -0
  101. package/dist/input/styled.components.d.ts +36 -0
  102. package/dist/modal/container/ModalContainer.d.ts +12 -0
  103. package/dist/modal/container/styled.components.d.ts +6 -0
  104. package/dist/modal/context/ModalContext.d.ts +64 -0
  105. package/dist/modal/index.d.ts +14 -0
  106. package/dist/modal/modal/Modal.d.ts +9 -0
  107. package/dist/modal/modal/styled.components.d.ts +24 -0
  108. package/dist/notification/context/NotificationsContext.d.ts +8 -0
  109. package/dist/notification/index.d.ts +14 -0
  110. package/dist/result/index.d.ts +15 -0
  111. package/dist/result/styled.components.d.ts +17 -0
  112. package/dist/select/index.d.ts +10 -0
  113. package/dist/select/menu/Menu.d.ts +13 -0
  114. package/dist/select/menu/styled.components.d.ts +12 -0
  115. package/dist/select/option/Option.d.ts +16 -0
  116. package/dist/select/option/styled.components.d.ts +6 -0
  117. package/dist/select/style.settings.d.ts +17 -0
  118. package/dist/select/styled.components.d.ts +5 -0
  119. package/dist/select/toggle/Toggle.d.ts +17 -0
  120. package/dist/select/toggle/label/floating/FloatingLabel.d.ts +9 -0
  121. package/dist/select/toggle/label/floating/styled.components.d.ts +9 -0
  122. package/dist/select/toggle/label/single/SingleLabel.d.ts +8 -0
  123. package/dist/select/toggle/label/single/styled.components.d.ts +7 -0
  124. package/dist/select/toggle/styled.components.d.ts +29 -0
  125. package/dist/spin/index.d.ts +8 -0
  126. package/dist/spin/styled.components.d.ts +10 -0
  127. package/dist/stories/Accordion.d.ts +6 -0
  128. package/dist/stories/Accordion.stories.d.ts +20 -0
  129. package/dist/stories/Alert.d.ts +2 -0
  130. package/dist/stories/Alert.stories.d.ts +21 -0
  131. package/dist/stories/Button.d.ts +3 -0
  132. package/dist/stories/Button.stories.d.ts +27 -0
  133. package/dist/stories/ButtonIcon.d.ts +2 -0
  134. package/dist/stories/Checkbox.d.ts +2 -0
  135. package/dist/stories/Checkbox.stories.d.ts +21 -0
  136. package/dist/stories/CheckboxGroup.d.ts +2 -0
  137. package/dist/stories/CheckboxGroup.stories.d.ts +21 -0
  138. package/dist/stories/Form.d.ts +2 -0
  139. package/dist/stories/Form.stories.d.ts +20 -0
  140. package/dist/stories/Header.d.ts +3 -0
  141. package/dist/stories/Header.stories.d.ts +19 -0
  142. package/dist/stories/Input.d.ts +3 -0
  143. package/dist/stories/Input.stories.d.ts +22 -0
  144. package/dist/stories/ModalManager.d.ts +3 -0
  145. package/dist/stories/ModalManager.stories.d.ts +21 -0
  146. package/dist/stories/Page.d.ts +3 -0
  147. package/dist/stories/Page.stories.d.ts +13 -0
  148. package/dist/stories/Upload.d.ts +2 -0
  149. package/dist/stories/Upload.stories.d.ts +20 -0
  150. package/dist/stories/root/index.d.ts +6 -0
  151. package/dist/switch/index.d.ts +4 -0
  152. package/dist/switch/styled.d.ts +6 -0
  153. package/dist/tinyscrollbar/index.d.ts +7 -0
  154. package/dist/tinyscrollbar/scroll.styled.d.ts +3 -0
  155. package/dist/tinyscrollbar/styled.components.d.ts +7 -0
  156. package/dist/types/AccordionItemProps.d.ts +8 -0
  157. package/dist/types/AccordionProps.d.ts +12 -0
  158. package/dist/types/AccordionSubMenuProps.d.ts +17 -0
  159. package/dist/types/AlertProps.d.ts +11 -0
  160. package/dist/types/ButtonProps.d.ts +41 -0
  161. package/dist/types/CheckboxProps.d.ts +38 -0
  162. package/dist/types/ChildrenProps.d.ts +1 -0
  163. package/dist/types/FormProps.d.ts +50 -0
  164. package/dist/types/ITDImperativeFuncProps.d.ts +10 -0
  165. package/dist/types/InputProps.d.ts +33 -0
  166. package/dist/types/ModalProps.d.ts +190 -0
  167. package/dist/types/NotificationsProps.d.ts +9 -0
  168. package/dist/types/SelectProps.d.ts +25 -0
  169. package/dist/types/SingleQueryProps.d.ts +6 -0
  170. package/dist/types/SwitchProps.d.ts +10 -0
  171. package/dist/types/UploadProps.d.ts +41 -0
  172. package/dist/upload/index.d.ts +14 -0
  173. package/dist/upload/styled.d.ts +40 -0
  174. package/package.json +183 -0
@@ -0,0 +1,20 @@
1
+ /// <reference types="react" />
2
+ import type { StoryObj } from "@storybook/react";
3
+ declare const meta: {
4
+ title: string;
5
+ component: import("react").FC<any>;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ tags: string[];
10
+ argTypes: {};
11
+ args: {
12
+ name: string;
13
+ initialValues: {};
14
+ useQueryString: boolean;
15
+ };
16
+ };
17
+ export default meta;
18
+ type Story = StoryObj<typeof meta>;
19
+ export declare const Simple: Story;
20
+ export declare const PreDefined: Story;
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import './header.css';
3
+ export declare const Header: FC<any>;
@@ -0,0 +1,19 @@
1
+ /// <reference types="react" />
2
+ import type { StoryObj } from "@storybook/react";
3
+ declare const meta: {
4
+ title: string;
5
+ component: import("react").FC<any>;
6
+ tags: string[];
7
+ parameters: {
8
+ layout: string;
9
+ };
10
+ args: {
11
+ onLogin: import("@vitest/spy").Mock<any, any>;
12
+ onLogout: import("@vitest/spy").Mock<any, any>;
13
+ onCreateAccount: import("@vitest/spy").Mock<any, any>;
14
+ };
15
+ };
16
+ export default meta;
17
+ type Story = StoryObj<typeof meta>;
18
+ export declare const LoggedIn: Story;
19
+ export declare const LoggedOut: Story;
@@ -0,0 +1,3 @@
1
+ import './button.css';
2
+ import { FC } from 'react';
3
+ export declare const Input: FC<any>;
@@ -0,0 +1,22 @@
1
+ /// <reference types="react" />
2
+ import type { StoryObj } from "@storybook/react";
3
+ declare const meta: {
4
+ title: string;
5
+ component: import("react").FC<any>;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ tags: string[];
10
+ argTypes: {};
11
+ args: {
12
+ onClick: import("@vitest/spy").Mock<any, any>;
13
+ };
14
+ };
15
+ export default meta;
16
+ type Story = StoryObj<typeof meta>;
17
+ export declare const Default: Story;
18
+ export declare const MaskFormat: Story;
19
+ export declare const Outline: Story;
20
+ export declare const Ghost: Story;
21
+ export declare const Link: Story;
22
+ export declare const Small: Story;
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import './button.css';
3
+ export declare const ModalManager: FC<any>;
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ import type { StoryObj } from "@storybook/react";
3
+ declare const meta: {
4
+ title: string;
5
+ component: import("react").FC<any>;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ tags: string[];
10
+ argTypes: {};
11
+ args: {};
12
+ };
13
+ export default meta;
14
+ type Story = StoryObj<typeof meta>;
15
+ export declare const FullFeatured: Story;
16
+ export declare const Title: Story;
17
+ export declare const CustomButtonTexts: Story;
18
+ export declare const CustomWidth: Story;
19
+ export declare const CustomButtonHandlers: Story;
20
+ export declare const OnlyCloseWithEvent: Story;
21
+ export declare const AddContentBeforeAndAfter: Story;
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import './page.css';
3
+ export declare const Page: FC;
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import type { StoryObj } from "@storybook/react";
3
+ declare const meta: {
4
+ title: string;
5
+ component: import("react").FC;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ };
10
+ export default meta;
11
+ type Story = StoryObj<typeof meta>;
12
+ export declare const LoggedOut: Story;
13
+ export declare const LoggedIn: Story;
@@ -0,0 +1,2 @@
1
+ import { FC } from 'react';
2
+ export declare const Upload: FC<any>;
@@ -0,0 +1,20 @@
1
+ /// <reference types="react" />
2
+ import type { StoryObj } from "@storybook/react";
3
+ declare const meta: {
4
+ title: string;
5
+ component: import("react").FC<any>;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ tags: string[];
10
+ argTypes: {};
11
+ args: {
12
+ onClick: import("@vitest/spy").Mock<any, any>;
13
+ };
14
+ };
15
+ export default meta;
16
+ type Story = StoryObj<typeof meta>;
17
+ export declare const PreDefined: Story;
18
+ export declare const Disabled: Story;
19
+ export declare const NoDefinedFile: Story;
20
+ export declare const Error: Story;
@@ -0,0 +1,6 @@
1
+ import { ChildrenProps } from "types/ChildrenProps";
2
+ import "./index.scss";
3
+ declare const StoryRoot: ({ children }: {
4
+ children: ChildrenProps;
5
+ }) => import("react/jsx-runtime").JSX.Element;
6
+ export default StoryRoot;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { ITDImperativeFuncProps, SwitchProps } from '../index';
3
+ declare const Switch: import("react").ForwardRefExoticComponent<SwitchProps & import("react").RefAttributes<ITDImperativeFuncProps>>;
4
+ export default Switch;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare const Thumb: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
3
+ declare const Body: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
4
+ declare const Wrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
5
+ declare const ErrorTooltip: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
6
+ export { Wrapper, ErrorTooltip, Body, Thumb };
@@ -0,0 +1,7 @@
1
+ import { ChildrenProps } from 'types/ChildrenProps.js';
2
+ type TinyScrollbarProps = {
3
+ className: string;
4
+ children: ChildrenProps;
5
+ };
6
+ export default function TinyScrollbar({ className, children }: TinyScrollbarProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const ScrollWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
+ export { ScrollWrapper };
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ declare const Wrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
3
+ $scrollbar?: string | undefined;
4
+ $track?: string | undefined;
5
+ $vertical?: string | undefined;
6
+ }>> & string;
7
+ export { Wrapper };
@@ -0,0 +1,8 @@
1
+ import { ChildrenProps } from "./ChildrenProps";
2
+ export type AccordionItemProps = {
3
+ link?: string;
4
+ itemHeight?: number;
5
+ arrowSize?: number;
6
+ active?: boolean;
7
+ children?: null | ChildrenProps;
8
+ };
@@ -0,0 +1,12 @@
1
+ import { ChildrenProps } from "./ChildrenProps";
2
+ export type AccordionProps = {
3
+ useLink?: boolean;
4
+ onlyOne?: boolean;
5
+ subMenuLinkArrow?: boolean;
6
+ subMenuHeight?: number;
7
+ itemHeight?: number;
8
+ iconSize?: number;
9
+ arrowSize?: number;
10
+ onChange?: null | ((id: string) => void);
11
+ children: ChildrenProps;
12
+ };
@@ -0,0 +1,17 @@
1
+ import { ChildrenProps } from "./ChildrenProps";
2
+ export type AccordionSubMenuProps = {
3
+ id: string;
4
+ link: string;
5
+ title: string;
6
+ icon?: string | JSX.Element;
7
+ isSelected?: boolean;
8
+ useLink?: boolean;
9
+ onlyOne?: boolean;
10
+ subMenuLinkArrow?: boolean;
11
+ subMenuHeight?: number;
12
+ itemHeight?: number;
13
+ iconSize?: number;
14
+ arrowSize?: number;
15
+ onChange?: (id: string) => void;
16
+ children?: ChildrenProps;
17
+ };
@@ -0,0 +1,11 @@
1
+ import { ChildrenProps } from "./ChildrenProps";
2
+ export type AlertProps = {
3
+ type?: AlertType;
4
+ size?: AlertSize;
5
+ icon?: string | ChildrenProps | SVGElement;
6
+ title?: string;
7
+ className?: string;
8
+ children?: ChildrenProps;
9
+ };
10
+ export type AlertType = "success" | "info" | "warning" | "error";
11
+ export type AlertSize = "x-small" | "small" | "medium" | "default" | "large" | "x-large";
@@ -0,0 +1,41 @@
1
+ import { DetailedHTMLProps, HTMLAttributes, MouseEvent } from "react";
2
+ import { ChildrenProps } from "./ChildrenProps";
3
+ import { IStyledComponent } from "styled-components";
4
+ import { Substitute } from "styled-components/dist/types";
5
+ export type ButtonProps = {
6
+ id?: string;
7
+ disabled?: boolean;
8
+ loading?: boolean;
9
+ selected?: boolean;
10
+ strecth?: boolean;
11
+ circle?: boolean;
12
+ justify?: string;
13
+ contentPosition?: ButtonContentPosition;
14
+ type?: ButtonType;
15
+ variant?: ButtonVariant;
16
+ state?: ButtonState;
17
+ size?: ButtonSize;
18
+ icon?: string | ChildrenProps | SVGElement;
19
+ href?: string;
20
+ target?: string;
21
+ className?: string;
22
+ children?: ChildrenProps;
23
+ onClick?: null | ((event: MouseEvent<any>) => void);
24
+ };
25
+ export type ButtonType = "button" | "submit" | "reset";
26
+ export type ButtonVariant = "default" | "solid" | "filled" | "outline" | "ghost" | "link" | "statable" | "custom";
27
+ export type ButtonState = "primary" | "secondary" | "request" | "approve" | "reject" | "pending" | "requested" | string | null;
28
+ export type ButtonSize = "x-small" | "small" | "medium" | "default" | "large" | "x-large";
29
+ export type ButtonContentPosition = "left" | "right";
30
+ export type StyledElementProps = IStyledComponent<"web", Substitute<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any>>;
31
+ export interface IIcon {
32
+ $useIconPadding?: boolean;
33
+ $contentPosition?: string;
34
+ $justify?: string;
35
+ children?: ChildrenProps;
36
+ }
37
+ export interface ISVG {
38
+ $singleIcon: boolean;
39
+ $contentPosition: string | undefined;
40
+ $justify: string | undefined;
41
+ }
@@ -0,0 +1,38 @@
1
+ import { ReactElement, RefObject } from "react";
2
+ import { ChildrenProps } from "./ChildrenProps";
3
+ export type CheckboxProps = {
4
+ id?: string;
5
+ value?: string | number | boolean;
6
+ checked?: boolean;
7
+ disabled?: boolean;
8
+ indeterminate?: boolean;
9
+ className?: string;
10
+ children?: ChildrenProps;
11
+ onChange?: ((event: CheckboxEvent) => void);
12
+ onUpdate?: ((value: any, update: any, validation: boolean) => void);
13
+ };
14
+ export type CheckboxGroupProps = {
15
+ value?: (string | number | boolean)[];
16
+ defaultValue?: (string | number)[];
17
+ options?: GroupCheckboxOptionType[];
18
+ disabled?: boolean;
19
+ className?: string;
20
+ children?: ChildrenProps | ReactElement<CheckboxProps> | Array<ReactElement<CheckboxProps>>;
21
+ selectAll?: (value: boolean) => void;
22
+ onChange?: ((values: (string | number | boolean)[]) => void);
23
+ onUpdate?: ((value: (string | number | boolean)[], update: any, validation: boolean) => void);
24
+ };
25
+ export type GroupCheckboxOptionType = {
26
+ label: string;
27
+ value: string | number | boolean;
28
+ disabled?: boolean;
29
+ };
30
+ export type CheckboxEvent = {
31
+ checked: boolean;
32
+ value?: string | number | boolean;
33
+ className: string;
34
+ disabled: boolean;
35
+ target: RefObject<HTMLInputElement>;
36
+ stopPropagation: () => void;
37
+ preventDefault: () => void;
38
+ };
@@ -0,0 +1 @@
1
+ export type ChildrenProps = string | JSX.Element | JSX.Element[] | null;
@@ -0,0 +1,50 @@
1
+ import { FormValidationTypes } from "enums/enum";
2
+ import { RefObject } from "react";
3
+ import { ChildrenProps } from "types/ChildrenProps";
4
+ import { ITDImperativeFuncProps } from "../index";
5
+ import { FormStoreProps } from "../form/context/FormStore";
6
+ import { FormContextType } from "../form/context/FormContext";
7
+ import { Item, Group, Control } from "../form";
8
+ export type FormProps = {
9
+ initialValues?: {};
10
+ children: ChildrenProps;
11
+ onReset?: () => void;
12
+ onUpdate?: (values: {}) => void;
13
+ onFinish?: (values: {}) => void;
14
+ onFinishFailed?: (values: {}) => void;
15
+ onValidated?: (validate: boolean) => void;
16
+ onFieldUpdate?: (update: FieldUpdateProps) => void;
17
+ useQueryString?: boolean;
18
+ className?: string;
19
+ ref: RefObject<FormContextType>;
20
+ name: string;
21
+ };
22
+ export type FormValueProps = string | number | object | boolean;
23
+ export type FieldUpdateProps = {
24
+ name: string;
25
+ value: FormValueProps;
26
+ valid: boolean;
27
+ };
28
+ export type FormRuleProps = {
29
+ required?: boolean;
30
+ type?: FormValidationTypes;
31
+ field?: string;
32
+ value?: string | number;
33
+ message?: string;
34
+ };
35
+ export type FormItemProps = {
36
+ name: string;
37
+ field: RefObject<ITDImperativeFuncProps>;
38
+ valid: boolean;
39
+ value?: FormValueProps;
40
+ query: string;
41
+ reset: any[];
42
+ error: string;
43
+ };
44
+ export type FormSubComponentProps = {
45
+ Item: typeof Item;
46
+ Group: typeof Group;
47
+ Control: typeof Control;
48
+ useForm: FormContextType;
49
+ useFormAPI: FormStoreProps;
50
+ };
@@ -0,0 +1,10 @@
1
+ export type ITDImperativeFuncProps = {
2
+ reset: (update?: boolean, validation?: boolean) => void;
3
+ setValue: (value: any, update?: boolean, validation?: boolean) => void;
4
+ getValue: () => any;
5
+ setError: (message: string) => void;
6
+ setFocus?: () => void;
7
+ setDisabled?: (value: boolean) => void;
8
+ forceUpdate?: () => void;
9
+ clear: () => void;
10
+ };
@@ -0,0 +1,33 @@
1
+ import { FocusEventHandler, KeyboardEvent, MutableRefObject } from "react";
2
+ import { ChildrenProps } from "./ChildrenProps";
3
+ export type InputProps = {
4
+ id?: string;
5
+ placeholder?: string;
6
+ value?: string;
7
+ defaultValue?: string;
8
+ type?: string;
9
+ className?: string;
10
+ size?: string;
11
+ variant?: string;
12
+ prefix?: ChildrenProps;
13
+ suffix?: ChildrenProps;
14
+ addonBefore?: ChildrenProps;
15
+ addonAfter?: ChildrenProps;
16
+ locked?: ChildrenProps | boolean;
17
+ status?: ChildrenProps;
18
+ maxLength?: number;
19
+ disabled?: boolean;
20
+ floating?: boolean;
21
+ autoComplete?: boolean;
22
+ keepFocus?: boolean;
23
+ focusRef?: null | MutableRefObject<HTMLDivElement>;
24
+ mask?: null | string;
25
+ allowEmptyFormatting?: null | boolean;
26
+ onChange?: ((value: any) => void) | null;
27
+ onUpdate?: ((value: any, update: any, validation: boolean) => void) | null;
28
+ onFocus?: ((event: any) => void) | null;
29
+ onBlur?: ((event: FocusEventHandler<HTMLInputElement>) => void) | null;
30
+ onPressEnter?: ((event: KeyboardEvent) => void) | null;
31
+ onKeyDown?: ((event: KeyboardEvent) => void) | null;
32
+ children?: ChildrenProps;
33
+ };
@@ -0,0 +1,190 @@
1
+ import { ButtonProps } from "./ButtonProps";
2
+ import { ChildrenProps } from "./ChildrenProps";
3
+ /**
4
+ * #### ModalProps
5
+ *
6
+ * The properties passed when opening a new modal. The `showModal`
7
+ * function requires certain properties to open a new modal.
8
+ */
9
+ export type ModalProps = {
10
+ /**
11
+ * Modal ID. Used for listening to modal events.
12
+ */
13
+ id?: string;
14
+ /**
15
+ * Modal Title.
16
+ */
17
+ title?: string;
18
+ /**
19
+ * Modal Width.
20
+ */
21
+ width?: string | number;
22
+ /**
23
+ * Close modal when overlay is clicked.
24
+ */
25
+ closeOnClickOutside?: boolean;
26
+ /**
27
+ * Prevents modal from closing when ESC key is pressed.
28
+ */
29
+ preventESC?: boolean;
30
+ /**
31
+ * Show/hide OK button.
32
+ */
33
+ showOkButton?: boolean;
34
+ /**
35
+ * Show/hide Cancel button.
36
+ */
37
+ showCancelButton?: boolean;
38
+ /**
39
+ * Show/hide close button on the top right corner of the modal.
40
+ */
41
+ showCloseButton?: boolean;
42
+ /**
43
+ * Text for the OK button.
44
+ */
45
+ okButtonText?: string;
46
+ /**
47
+ * The cancel button props.
48
+ */
49
+ cancelButtonText?: string;
50
+ /**
51
+ * The ok button props.
52
+ */
53
+ okButtonProps?: ButtonProps | null;
54
+ /**
55
+ * ModalProps for the Cancel button.
56
+ */
57
+ cancelButtonProps?: ButtonProps | null;
58
+ /**
59
+ * Custom properties to be passed to the modal.
60
+ */
61
+ customProps?: {} | any;
62
+ /**
63
+ * Custom context to be passed to the modal.
64
+ */
65
+ context?: {} | any;
66
+ /**
67
+ * Called when the OK button is clicked. If this
68
+ * function is defined, a ModalEvent is triggered,
69
+ * but the modal does not automatically close.
70
+ * @returns
71
+ */
72
+ onOk?: (() => boolean | null) | null;
73
+ /**
74
+ * Called when the Cancel button is clicked. If this
75
+ * function is defined, a ModalEvent is triggered,
76
+ * but the modal does not automatically close.
77
+ * @returns
78
+ */
79
+ onCancel?: (() => boolean | null) | null;
80
+ /**
81
+ * ModalManager can find its own ref, but some libraries
82
+ * (@loadable, React.lazy, etc.) may have their own ref values,
83
+ * which can prevent ModalManager from passing parameters and
84
+ * accessing the actual ref. In such cases, if you want the modal
85
+ * to use a ref, meaning you'll use forwardRef with ModalRefProps
86
+ * inside the modal, you should pass "true".
87
+ */
88
+ useRef?: boolean;
89
+ /**
90
+ * ModalManager can find its own ref, but some libraries
91
+ * (@loadable, React.lazy, etc.) may have their own ref
92
+ * values, which can prevent ModalManager from passing
93
+ * parameters and accessing the actual ref. In such cases,
94
+ * this value should remain false. You can only set it to
95
+ * "true" in projects where you are sure that all modals
96
+ * are passed as Function Components.
97
+ */
98
+ checkAutoRef?: boolean;
99
+ /**
100
+ * Content of the modal. Any content you want to display in the modal.
101
+ */
102
+ content: ChildrenProps;
103
+ /**
104
+ * Adds content before the modal's content data.
105
+ */
106
+ addContentBefore?: ChildrenProps;
107
+ /**
108
+ * Adds content after the modal's content data.
109
+ */
110
+ addContentAfter?: ChildrenProps;
111
+ /**
112
+ * The padding of the modal content. The default value is "30px 20px".
113
+ */
114
+ contentPadding?: string;
115
+ /**
116
+ * The padding before the modal content. The default value is "30px 20px 0".
117
+ */
118
+ beforeContentPadding?: string;
119
+ /**
120
+ * The padding after the modal content. The default value is "0 20px 30px".
121
+ */
122
+ afterContentPadding?: string;
123
+ };
124
+ /**
125
+ * #### Modal Content Props
126
+ *
127
+ * These properties can only be accessed from the content data defined within the modal.
128
+ * When the content data is defined as an external class, these properties become accessible.
129
+ */
130
+ export type ModalContentProps = {
131
+ /**
132
+ * Allows another modal to be opened from within the modal content.
133
+ * @param data Values for the new modal to be opened.
134
+ * @returns
135
+ */
136
+ showAnotherModal?: (data?: ModalProps) => void;
137
+ /**
138
+ * Closes itself from within the modal content.
139
+ * @returns
140
+ */
141
+ hideCurrentModal?: () => void;
142
+ /**
143
+ * Changes the buttons disabling state.
144
+ * @param value `true` for regular, `false` for disabled.
145
+ * @returns
146
+ */
147
+ changeButtonsState?: (value: boolean) => void;
148
+ /**
149
+ * Changes the loading screen state that covers the entire modal.
150
+ * @param value `true` indicates loading, `false` indicates stable state.
151
+ * @returns
152
+ */
153
+ changeLoadingState?: (value: boolean) => void;
154
+ /**
155
+ * Changes the state that shows only the modal content is loading.
156
+ * @param value `true` indicates loading, `false` indicates stable state.
157
+ * @returns
158
+ */
159
+ changeInnerLoadingState?: (value: boolean) => void;
160
+ /**
161
+ * Extra parameters passed when the modal is opened.
162
+ */
163
+ modalProps?: any;
164
+ /**
165
+ * Context data to be used for access within the modal, functioning like `modalProps`.
166
+ */
167
+ context?: any;
168
+ };
169
+ /**
170
+ * #### Modal Ref Props
171
+ *
172
+ * It can only be used within the modal content data that utilizes `forwardRef`
173
+ * along with `useImperativeHandle`.
174
+ */
175
+ export type ModalRefProps = {
176
+ /**
177
+ * If defined, it is triggered when the **OK** button inside the modal is clicked.
178
+ * If you return `false`, it prevents the modal from closing. If you return `true`,
179
+ * the process continues and the modal closes.
180
+ * @returns
181
+ */
182
+ onClickOK?: () => void;
183
+ /**
184
+ * If defined, it is triggered when the **Cancel** button inside the modal is clicked.
185
+ * If you return `false`, it prevents the modal from closing. If you return `true`,
186
+ * the process continues and the modal closes.
187
+ * @returns
188
+ */
189
+ onClickCancel?: () => void;
190
+ };
@@ -0,0 +1,9 @@
1
+ export type NotificationsProps = {
2
+ id?: string;
3
+ title: string;
4
+ description: string;
5
+ placement?: string;
6
+ autoHide?: boolean;
7
+ delay?: number;
8
+ type: string;
9
+ };
@@ -0,0 +1,25 @@
1
+ import { ReactElement } from "react";
2
+ export type SelectProps = {
3
+ defaultValue?: string | number;
4
+ value?: string | number;
5
+ label?: string | number;
6
+ position?: string;
7
+ direction?: string;
8
+ mode?: string;
9
+ size?: string;
10
+ variant?: string;
11
+ className?: string;
12
+ placeholder?: string;
13
+ icon?: string;
14
+ image?: string;
15
+ disabled?: boolean;
16
+ locked?: boolean;
17
+ floating?: boolean;
18
+ children?: ReactElement<SelectOptionProps> | Array<ReactElement<SelectOptionProps>>;
19
+ onChange?: ((value: any) => void) | null;
20
+ onUpdate?: ((value: any, update: any, validation: boolean) => void) | null;
21
+ };
22
+ export type SelectOptionProps = {
23
+ value: string;
24
+ text: string;
25
+ };
@@ -0,0 +1,6 @@
1
+ export type SingleQueryProps = {
2
+ set: (type: string, value: string | string[] | null) => void;
3
+ get: (type: string, _default?: string, _minLength?: number) => string | string[] | null;
4
+ remove: (type: string) => void;
5
+ isEmpty: () => boolean;
6
+ };