sea-react-components 1.0.2
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 +21 -0
- package/README.md +1 -0
- package/dist/HOC/can-access-application/index.d.ts +9 -0
- package/dist/HOC/can-access-application/index.d.ts.map +1 -0
- package/dist/HOC/can-access-application/index.js +11 -0
- package/dist/HOC/with-authorization/index.d.ts +12 -0
- package/dist/HOC/with-authorization/index.d.ts.map +1 -0
- package/dist/HOC/with-authorization/index.js +23 -0
- package/dist/components/alert/index.d.ts +12 -0
- package/dist/components/alert/index.d.ts.map +1 -0
- package/dist/components/alert/index.js +51 -0
- package/dist/components/avatar/index.d.ts +10 -0
- package/dist/components/avatar/index.d.ts.map +1 -0
- package/dist/components/avatar/index.js +26 -0
- package/dist/components/badge/index.d.ts +8 -0
- package/dist/components/badge/index.d.ts.map +1 -0
- package/dist/components/badge/index.js +33 -0
- package/dist/components/breadcrumb/index.d.ts +7 -0
- package/dist/components/breadcrumb/index.d.ts.map +1 -0
- package/dist/components/breadcrumb/index.js +8 -0
- package/dist/components/button/index.d.ts +6 -0
- package/dist/components/button/index.d.ts.map +1 -0
- package/dist/components/button/index.js +18 -0
- package/dist/components/carousel/index.d.ts +17 -0
- package/dist/components/carousel/index.d.ts.map +1 -0
- package/dist/components/carousel/index.js +89 -0
- package/dist/components/checkbox/index.d.ts +11 -0
- package/dist/components/checkbox/index.d.ts.map +1 -0
- package/dist/components/checkbox/index.js +15 -0
- package/dist/components/color-picker/index.d.ts +8 -0
- package/dist/components/color-picker/index.d.ts.map +1 -0
- package/dist/components/color-picker/index.js +21 -0
- package/dist/components/count-down/index.d.ts +6 -0
- package/dist/components/count-down/index.d.ts.map +1 -0
- package/dist/components/count-down/index.js +32 -0
- package/dist/components/drawer/index.d.ts +12 -0
- package/dist/components/drawer/index.d.ts.map +1 -0
- package/dist/components/drawer/index.js +15 -0
- package/dist/components/file-input/components/file-item/index.d.ts +9 -0
- package/dist/components/file-input/components/file-item/index.d.ts.map +1 -0
- package/dist/components/file-input/components/file-item/index.js +10 -0
- package/dist/components/file-input/index.d.ts +44 -0
- package/dist/components/file-input/index.d.ts.map +1 -0
- package/dist/components/file-input/index.js +85 -0
- package/dist/components/icon/index.d.ts +7 -0
- package/dist/components/icon/index.d.ts.map +1 -0
- package/dist/components/icon/index.js +5 -0
- package/dist/components/input/index.d.ts +9 -0
- package/dist/components/input/index.d.ts.map +1 -0
- package/dist/components/input/index.js +33 -0
- package/dist/components/list-item/components/page-button/index.d.ts +8 -0
- package/dist/components/list-item/components/page-button/index.d.ts.map +1 -0
- package/dist/components/list-item/components/page-button/index.js +8 -0
- package/dist/components/list-item/components/pagination/index.d.ts +9 -0
- package/dist/components/list-item/components/pagination/index.d.ts.map +1 -0
- package/dist/components/list-item/components/pagination/index.js +49 -0
- package/dist/components/list-item/components/search-input/index.d.ts +7 -0
- package/dist/components/list-item/components/search-input/index.d.ts.map +1 -0
- package/dist/components/list-item/components/search-input/index.js +38 -0
- package/dist/components/list-item/index.d.ts +26 -0
- package/dist/components/list-item/index.d.ts.map +1 -0
- package/dist/components/list-item/index.js +23 -0
- package/dist/components/loader/index.d.ts +6 -0
- package/dist/components/loader/index.d.ts.map +1 -0
- package/dist/components/loader/index.js +5 -0
- package/dist/components/menu/index.d.ts +9 -0
- package/dist/components/menu/index.d.ts.map +1 -0
- package/dist/components/menu/index.js +19 -0
- package/dist/components/menu/menu-item/index.d.ts +10 -0
- package/dist/components/menu/menu-item/index.d.ts.map +1 -0
- package/dist/components/menu/menu-item/index.js +19 -0
- package/dist/components/modal/index.d.ts +12 -0
- package/dist/components/modal/index.d.ts.map +1 -0
- package/dist/components/modal/index.js +41 -0
- package/dist/components/not-authorized/index.d.ts +2 -0
- package/dist/components/not-authorized/index.d.ts.map +1 -0
- package/dist/components/not-authorized/index.js +5 -0
- package/dist/components/otp-input/index.d.ts +7 -0
- package/dist/components/otp-input/index.d.ts.map +1 -0
- package/dist/components/otp-input/index.js +35 -0
- package/dist/components/paper/index.d.ts +4 -0
- package/dist/components/paper/index.d.ts.map +1 -0
- package/dist/components/paper/index.js +17 -0
- package/dist/components/progress-bar/index.d.ts +11 -0
- package/dist/components/progress-bar/index.d.ts.map +1 -0
- package/dist/components/progress-bar/index.js +32 -0
- package/dist/components/radio-button/index.d.ts +10 -0
- package/dist/components/radio-button/index.d.ts.map +1 -0
- package/dist/components/radio-button/index.js +17 -0
- package/dist/components/select/index.d.ts +16 -0
- package/dist/components/select/index.d.ts.map +1 -0
- package/dist/components/select/index.js +36 -0
- package/dist/components/skeleton/index.d.ts +4 -0
- package/dist/components/skeleton/index.d.ts.map +1 -0
- package/dist/components/skeleton/index.js +5 -0
- package/dist/components/stacked-avatars/index.d.ts +10 -0
- package/dist/components/stacked-avatars/index.d.ts.map +1 -0
- package/dist/components/stacked-avatars/index.js +23 -0
- package/dist/components/tab/index.d.ts +16 -0
- package/dist/components/tab/index.d.ts.map +1 -0
- package/dist/components/tab/index.js +23 -0
- package/dist/components/table/index.d.ts +22 -0
- package/dist/components/table/index.d.ts.map +1 -0
- package/dist/components/table/index.js +67 -0
- package/dist/components/text-editor/components/toolbar/index.d.ts +9 -0
- package/dist/components/text-editor/components/toolbar/index.d.ts.map +1 -0
- package/dist/components/text-editor/components/toolbar/index.js +280 -0
- package/dist/components/text-editor/index.d.ts +12 -0
- package/dist/components/text-editor/index.d.ts.map +1 -0
- package/dist/components/text-editor/index.js +152 -0
- package/dist/components/text-editor/style.css +132 -0
- package/dist/components/text-editor/utils/index.d.ts +14 -0
- package/dist/components/text-editor/utils/index.d.ts.map +1 -0
- package/dist/components/text-editor/utils/index.js +82 -0
- package/dist/components/textarea/index.d.ts +7 -0
- package/dist/components/textarea/index.d.ts.map +1 -0
- package/dist/components/textarea/index.js +24 -0
- package/dist/components/toggle/index.d.ts +8 -0
- package/dist/components/toggle/index.d.ts.map +1 -0
- package/dist/components/toggle/index.js +12 -0
- package/dist/components/tooltip/index.d.ts +10 -0
- package/dist/components/tooltip/index.d.ts.map +1 -0
- package/dist/components/tooltip/index.js +15 -0
- package/dist/components/tree-checkbox/components/tree-checkbox-item/index.d.ts +10 -0
- package/dist/components/tree-checkbox/components/tree-checkbox-item/index.d.ts.map +1 -0
- package/dist/components/tree-checkbox/components/tree-checkbox-item/index.js +10 -0
- package/dist/components/tree-checkbox/index.d.ts +26 -0
- package/dist/components/tree-checkbox/index.d.ts.map +1 -0
- package/dist/components/tree-checkbox/index.js +62 -0
- package/dist/components/tree-checkbox/utils/index.d.ts +9 -0
- package/dist/components/tree-checkbox/utils/index.d.ts.map +1 -0
- package/dist/components/tree-checkbox/utils/index.js +14 -0
- package/dist/constants/index.d.ts +2 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/index.js +1 -0
- package/dist/hooks/list-items-hook/types.d.ts +18 -0
- package/dist/hooks/list-items-hook/types.d.ts.map +1 -0
- package/dist/hooks/list-items-hook/types.js +1 -0
- package/dist/hooks/list-items-hook/useBulkActions.d.ts +3 -0
- package/dist/hooks/list-items-hook/useBulkActions.d.ts.map +1 -0
- package/dist/hooks/list-items-hook/useBulkActions.js +8 -0
- package/dist/hooks/list-items-hook/useFilters.d.ts +3 -0
- package/dist/hooks/list-items-hook/useFilters.d.ts.map +1 -0
- package/dist/hooks/list-items-hook/useFilters.js +27 -0
- package/dist/hooks/list-items-hook/usePagination.d.ts +2 -0
- package/dist/hooks/list-items-hook/usePagination.d.ts.map +1 -0
- package/dist/hooks/list-items-hook/usePagination.js +21 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +42 -0
- package/dist/styles.css +7 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/utils/axios/index.d.ts +7 -0
- package/dist/utils/axios/index.d.ts.map +1 -0
- package/dist/utils/axios/index.js +23 -0
- package/dist/utils/color/index.d.ts +7 -0
- package/dist/utils/color/index.d.ts.map +1 -0
- package/dist/utils/color/index.js +22 -0
- package/dist/utils/file/index.d.ts +2 -0
- package/dist/utils/file/index.d.ts.map +1 -0
- package/dist/utils/file/index.js +8 -0
- package/dist/utils/jwt/index.d.ts +2 -0
- package/dist/utils/jwt/index.d.ts.map +1 -0
- package/dist/utils/jwt/index.js +1 -0
- package/dist/utils/validation/index.d.ts +10 -0
- package/dist/utils/validation/index.d.ts.map +1 -0
- package/dist/utils/validation/index.js +20 -0
- package/package.json +66 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePagination.d.ts","sourceRoot":"","sources":["../../../src/hooks/list-items-hook/usePagination.ts"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EAC/B,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,EACrC,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,EACxD,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS,QAqBvD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
export function usePagination(name, page, setPage, rowsPerPage, setRowsPerPage, updateParams, getParam) {
|
|
3
|
+
const pageParam = `${name}-page`;
|
|
4
|
+
const rowsParam = `${name}-rows`;
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
if (updateParams)
|
|
7
|
+
updateParams({ [pageParam]: String(page) });
|
|
8
|
+
}, [page]);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (updateParams)
|
|
11
|
+
updateParams({ [rowsParam]: String(rowsPerPage) });
|
|
12
|
+
}, [rowsPerPage]);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (getParam) {
|
|
15
|
+
const defaultPage = Number(getParam(pageParam)) || 1;
|
|
16
|
+
const defaultRows = Number(getParam(rowsParam)) || 5;
|
|
17
|
+
setPage(defaultPage);
|
|
18
|
+
setRowsPerPage(defaultRows);
|
|
19
|
+
}
|
|
20
|
+
}, []);
|
|
21
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export * as ValidationUtils from "./utils/validation";
|
|
2
|
+
export * as JWTUtils from "./utils/jwt";
|
|
3
|
+
export * as ColorUtils from "./utils/color";
|
|
4
|
+
export * as AxiosUtils from "./utils/axios";
|
|
5
|
+
export * as FileUtils from "./utils/file";
|
|
6
|
+
export { default as Icon, Props as IconProps } from "./components/icon";
|
|
7
|
+
export { default as Button, Props as ButtonProps } from "./components/button";
|
|
8
|
+
export { default as Alert, Props as AlertProps, Types as AlertTypes, Themes as AlertThemes, } from "./components/alert";
|
|
9
|
+
export { default as Badge, Props as BadgeProps, Types as BudgeTypes, } from "./components/badge";
|
|
10
|
+
export { default as Modal, ModalPosition, ModalSize, Props as ModalProps, } from "./components/modal";
|
|
11
|
+
export { default as Menu, Props as MenuProps } from "./components/menu";
|
|
12
|
+
export { default as MenuItem, Props as MenuItemProps, } from "./components/menu/menu-item";
|
|
13
|
+
export { default as Select, Props as SelectProps, SelectOption, } from "./components/select";
|
|
14
|
+
export { default as Paper, Props as PaperProps } from "./components/paper";
|
|
15
|
+
export { default as Input, Props as InputProps } from "./components/input";
|
|
16
|
+
export { default as Textarea, Props as TextareaProps, } from "./components/textarea";
|
|
17
|
+
export { default as Toggle, Props as ToggleProps } from "./components/toggle";
|
|
18
|
+
export { default as Skeleton, Props as SkeletonProps, } from "./components/skeleton";
|
|
19
|
+
export { default as OTPInput, Props as OTPInputProps, } from "./components/otp-input";
|
|
20
|
+
export { default as Tooltip, Props as TooltipProps, } from "./components/tooltip";
|
|
21
|
+
export { default as CountDown, Props as CountDownProps, } from "./components/count-down";
|
|
22
|
+
export * as ListItemsOptions from "./hooks/list-items-hook/types";
|
|
23
|
+
export { default as ListItem, Props as ListItemProps, } from "./components/list-item";
|
|
24
|
+
export { default as Table, Props as TableProps, TableColumn, DEFAULT_TABLE_ROWS_PER_PAGE_OPTIONS, } from "./components/table";
|
|
25
|
+
export { default as Tab, Props as TabProps } from "./components/tab";
|
|
26
|
+
export { default as ProgressBar, Props as ProgressBarProps, } from "./components/progress-bar";
|
|
27
|
+
export { default as Breadcrumb, Props as BreadcrumbProps, } from "./components/breadcrumb";
|
|
28
|
+
export { default as Drawer, Props as DrawerProps, Placement as DrawerPlacement, } from "./components/drawer";
|
|
29
|
+
export { default as Carousel, Props as CarouselProps, } from "./components/carousel";
|
|
30
|
+
export { default as Avatar, Props as AvatarProps } from "./components/avatar";
|
|
31
|
+
export { default as StackedAvatars, Props as StackedAvatarsProps, } from "./components/stacked-avatars";
|
|
32
|
+
export { default as Checkbox, Props as CheckboxProps, } from "./components/checkbox";
|
|
33
|
+
export { default as RadioButton, Props as RadioButtonProps, } from "./components/radio-button";
|
|
34
|
+
export { default as TreeCheckbox, Props as TreeCheckboxProps, TreeNode as TreeCheckboxNode, CheckedValues as TreeCheckboxCheckedValues, Utils as TreeCheckboxUtils, } from "./components/tree-checkbox";
|
|
35
|
+
export { default as ColorPicker, Props as ColorPickerProps, } from "./components/color-picker";
|
|
36
|
+
export { default as FileInput, Props as FileInputProps, AcceptedTypes as FileInputAcceptedTypes, FileState as FileInputFileState, UploadStatuses as FileInputUploadStatuses, } from "./components/file-input";
|
|
37
|
+
export { default as TextEditor, Props as TextEditorProps, } from "./components/text-editor";
|
|
38
|
+
export { default as WithAuthorization, Props as WithAuthorizationProps, } from "./HOC/with-authorization";
|
|
39
|
+
export { default as CanAccessApplication, Props as CanAccessApplicationProps, } from "./HOC/can-access-application";
|
|
40
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,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IAAI,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EACL,OAAO,IAAI,cAAc,EACzB,KAAK,IAAI,mBAAmB,GAC7B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,OAAO,IAAI,QAAQ,EACnB,KAAK,IAAI,aAAa,GACvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,OAAO,IAAI,WAAW,EACtB,KAAK,IAAI,gBAAgB,GAC1B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,OAAO,IAAI,YAAY,EACvB,KAAK,IAAI,iBAAiB,EAC1B,QAAQ,IAAI,gBAAgB,EAC5B,aAAa,IAAI,yBAAyB,EAC1C,KAAK,IAAI,iBAAiB,GAC3B,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,OAAO,IAAI,WAAW,EACtB,KAAK,IAAI,gBAAgB,GAC1B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,OAAO,IAAI,SAAS,EACpB,KAAK,IAAI,cAAc,EACvB,aAAa,IAAI,sBAAsB,EACvC,SAAS,IAAI,kBAAkB,EAC/B,cAAc,IAAI,uBAAuB,GAC1C,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,OAAO,IAAI,UAAU,EACrB,KAAK,IAAI,eAAe,GACzB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,OAAO,IAAI,iBAAiB,EAC5B,KAAK,IAAI,sBAAsB,GAChC,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,OAAO,IAAI,oBAAoB,EAC/B,KAAK,IAAI,yBAAyB,GACnC,MAAM,8BAA8B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// import "./styles.css";
|
|
2
|
+
// utils
|
|
3
|
+
export * as ValidationUtils from "./utils/validation";
|
|
4
|
+
export * as JWTUtils from "./utils/jwt";
|
|
5
|
+
export * as ColorUtils from "./utils/color";
|
|
6
|
+
export * as AxiosUtils from "./utils/axios";
|
|
7
|
+
export * as FileUtils from "./utils/file";
|
|
8
|
+
// components
|
|
9
|
+
export { default as Icon } from "./components/icon";
|
|
10
|
+
export { default as Button } from "./components/button";
|
|
11
|
+
export { default as Alert, } from "./components/alert";
|
|
12
|
+
export { default as Badge, } from "./components/badge";
|
|
13
|
+
export { default as Modal, } from "./components/modal";
|
|
14
|
+
export { default as Menu } from "./components/menu";
|
|
15
|
+
export { default as MenuItem, } from "./components/menu/menu-item";
|
|
16
|
+
export { default as Select, } from "./components/select";
|
|
17
|
+
export { default as Paper } from "./components/paper";
|
|
18
|
+
export { default as Input } from "./components/input";
|
|
19
|
+
export { default as Textarea, } from "./components/textarea";
|
|
20
|
+
export { default as Toggle } from "./components/toggle";
|
|
21
|
+
export { default as Skeleton, } from "./components/skeleton";
|
|
22
|
+
export { default as OTPInput, } from "./components/otp-input";
|
|
23
|
+
export { default as Tooltip, } from "./components/tooltip";
|
|
24
|
+
export { default as CountDown, } from "./components/count-down";
|
|
25
|
+
export * as ListItemsOptions from "./hooks/list-items-hook/types";
|
|
26
|
+
export { default as ListItem, } from "./components/list-item";
|
|
27
|
+
export { default as Table, DEFAULT_TABLE_ROWS_PER_PAGE_OPTIONS, } from "./components/table";
|
|
28
|
+
export { default as Tab } from "./components/tab";
|
|
29
|
+
export { default as ProgressBar, } from "./components/progress-bar";
|
|
30
|
+
export { default as Breadcrumb, } from "./components/breadcrumb";
|
|
31
|
+
export { default as Drawer, } from "./components/drawer";
|
|
32
|
+
export { default as Carousel, } from "./components/carousel";
|
|
33
|
+
export { default as Avatar } from "./components/avatar";
|
|
34
|
+
export { default as StackedAvatars, } from "./components/stacked-avatars";
|
|
35
|
+
export { default as Checkbox, } from "./components/checkbox";
|
|
36
|
+
export { default as RadioButton, } from "./components/radio-button";
|
|
37
|
+
export { default as TreeCheckbox, Utils as TreeCheckboxUtils, } from "./components/tree-checkbox";
|
|
38
|
+
export { default as ColorPicker, } from "./components/color-picker";
|
|
39
|
+
export { default as FileInput, AcceptedTypes as FileInputAcceptedTypes, UploadStatuses as FileInputUploadStatuses, } from "./components/file-input";
|
|
40
|
+
export { default as TextEditor, } from "./components/text-editor";
|
|
41
|
+
export { default as WithAuthorization, } from "./HOC/with-authorization";
|
|
42
|
+
export { default as CanAccessApplication, } from "./HOC/can-access-application";
|
package/dist/styles.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["../src/index.ts","../src/hoc/can-access-application/index.tsx","../src/hoc/with-authorization/index.tsx","../src/components/alert/index.tsx","../src/components/avatar/index.tsx","../src/components/badge/index.tsx","../src/components/breadcrumb/index.tsx","../src/components/button/index.tsx","../src/components/carousel/index.tsx","../src/components/checkbox/index.tsx","../src/components/color-picker/index.tsx","../src/components/count-down/index.tsx","../src/components/drawer/index.tsx","../src/components/file-input/index.tsx","../src/components/file-input/components/file-item/index.tsx","../src/components/icon/index.tsx","../src/components/input/index.tsx","../src/components/list-item/index.tsx","../src/components/list-item/components/page-button/index.tsx","../src/components/list-item/components/pagination/index.tsx","../src/components/list-item/components/search-input/index.tsx","../src/components/loader/index.tsx","../src/components/menu/index.tsx","../src/components/menu/menu-item/index.tsx","../src/components/modal/index.tsx","../src/components/not-authorized/index.tsx","../src/components/otp-input/index.tsx","../src/components/paper/index.tsx","../src/components/progress-bar/index.tsx","../src/components/radio-button/index.tsx","../src/components/select/index.tsx","../src/components/skeleton/index.tsx","../src/components/stacked-avatars/index.tsx","../src/components/tab/index.tsx","../src/components/table/index.tsx","../src/components/text-editor/index.tsx","../src/components/text-editor/components/toolbar/index.tsx","../src/components/text-editor/utils/index.ts","../src/components/textarea/index.tsx","../src/components/toggle/index.tsx","../src/components/tooltip/index.tsx","../src/components/tree-checkbox/index.tsx","../src/components/tree-checkbox/components/tree-checkbox-item/index.tsx","../src/components/tree-checkbox/utils/index.ts","../src/constants/index.ts","../src/hooks/list-items-hook/types.ts","../src/hooks/list-items-hook/usebulkactions.ts","../src/hooks/list-items-hook/usefilters.ts","../src/hooks/list-items-hook/usepagination.ts","../src/utils/axios/index.ts","../src/utils/color/index.ts","../src/utils/file/index.ts","../src/utils/jwt/index.ts","../src/utils/validation/index.ts"],"version":"5.6.3"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/axios/index.ts"],"names":[],"mappings":"AAEA,KAAK,YAAY,GAAG;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,cAAc,YAChB,MAAM,YACN,YAAY,kCAgCtB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
export const createInstance = (baseURL, options = { withCredentials: true, JWTTokenKey: "JWTToken" }) => {
|
|
3
|
+
const axiosInstance = axios.create({
|
|
4
|
+
baseURL,
|
|
5
|
+
});
|
|
6
|
+
axiosInstance.defaults.withCredentials = options.withCredentials;
|
|
7
|
+
axiosInstance.interceptors.request.use((config) => {
|
|
8
|
+
const token = localStorage.getItem(options.JWTTokenKey);
|
|
9
|
+
config.headers["Authorization"] = `Bearer ${token}`;
|
|
10
|
+
return config;
|
|
11
|
+
}, (error) => {
|
|
12
|
+
// Handle request error
|
|
13
|
+
return Promise.reject(error);
|
|
14
|
+
});
|
|
15
|
+
axiosInstance.interceptors.response.use((response) => {
|
|
16
|
+
return response.data;
|
|
17
|
+
}, (error) => {
|
|
18
|
+
var _a;
|
|
19
|
+
console.log(`Error: ${error.message}`);
|
|
20
|
+
return Promise.reject((_a = error.response) === null || _a === void 0 ? void 0 : _a.data);
|
|
21
|
+
});
|
|
22
|
+
return axiosInstance;
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/color/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,QAAS,MAAM;;;;CAoBvC,CAAC;AAEF,eAAO,MAAM,YAAY,QAAS,MAAM,YAMvC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const convertToRGP = (hex) => {
|
|
2
|
+
hex = hex.replace(/^#/, "");
|
|
3
|
+
let R = parseInt(hex.substring(0, 2), 16);
|
|
4
|
+
let G = parseInt(hex.substring(2, 4), 16);
|
|
5
|
+
let B = parseInt(hex.substring(4, 6), 16);
|
|
6
|
+
// Convert to sRGB
|
|
7
|
+
const normalize = (value) => {
|
|
8
|
+
const channel = value / 255;
|
|
9
|
+
return channel <= 0.03928
|
|
10
|
+
? channel / 12.92
|
|
11
|
+
: Math.pow((channel + 0.055) / 1.055, 2.4);
|
|
12
|
+
};
|
|
13
|
+
R = normalize(R);
|
|
14
|
+
G = normalize(G);
|
|
15
|
+
B = normalize(B);
|
|
16
|
+
return { R, G, B };
|
|
17
|
+
};
|
|
18
|
+
export const isColorLight = (hex) => {
|
|
19
|
+
const { R, G, B } = convertToRGP(hex);
|
|
20
|
+
const luminance = 0.2126 * R + 0.7152 * G + 0.0722 * B;
|
|
21
|
+
return luminance > 0.5;
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/file/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,SAAU,IAAI,KAAG,OAAO,CAAC,MAAM,CAO1D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/jwt/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { jwtDecode } from "jwt-decode";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as Yup from "yup";
|
|
2
|
+
export declare const name: Yup.StringSchema<string, Yup.AnyObject, undefined, "">;
|
|
3
|
+
export declare const birthDate: Yup.StringSchema<string, Yup.AnyObject, undefined, "">;
|
|
4
|
+
export declare const email: Yup.StringSchema<string, Yup.AnyObject, undefined, "">;
|
|
5
|
+
export declare const phoneNumber: Yup.StringSchema<string, Yup.AnyObject, undefined, "">;
|
|
6
|
+
export declare const password: Yup.StringSchema<string, Yup.AnyObject, undefined, "">;
|
|
7
|
+
export declare const confirmPassword: Yup.StringSchema<string, Yup.AnyObject, undefined, "">;
|
|
8
|
+
export declare const identifier: Yup.StringSchema<string, Yup.AnyObject, undefined, "">;
|
|
9
|
+
export declare const otpCode: (length: number) => Yup.StringSchema<string, Yup.AnyObject, undefined, "">;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/validation/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAG3B,eAAO,MAAM,IAAI,wDAAmD,CAAC;AACrE,eAAO,MAAM,SAAS,wDAAoC,CAAC;AAC3D,eAAO,MAAM,KAAK,wDAA4C,CAAC;AAC/D,eAAO,MAAM,WAAW,wDAED,CAAC;AACxB,eAAO,MAAM,QAAQ,wDAA2C,CAAC;AACjE,eAAO,MAAM,eAAe,wDAEe,CAAC;AAE5C,eAAO,MAAM,UAAU,wDASpB,CAAC;AAEJ,eAAO,MAAM,OAAO,WAAY,MAAM,2DAGb,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as Yup from "yup";
|
|
2
|
+
import { Utils } from "sea-platform-helpers";
|
|
3
|
+
export const name = Yup.string().min(3).max(50).required("Required");
|
|
4
|
+
export const birthDate = Yup.string().required("Required");
|
|
5
|
+
export const email = Yup.string().email().required("Required");
|
|
6
|
+
export const phoneNumber = Yup.string()
|
|
7
|
+
.matches(Utils.String.phoneRegExp, "Phone number is not valid")
|
|
8
|
+
.required("Required");
|
|
9
|
+
export const password = Yup.string().min(8).required("Required");
|
|
10
|
+
export const confirmPassword = Yup.string()
|
|
11
|
+
.oneOf([Yup.ref("password"), undefined], "Passwords must match")
|
|
12
|
+
.required("Confirm password is required");
|
|
13
|
+
export const identifier = Yup.string()
|
|
14
|
+
.required("Identifier is required")
|
|
15
|
+
.test("is-email-or-phone", "Identifier must be a valid email or phone number", (value) => !!value &&
|
|
16
|
+
(Utils.String.emailRegex.test(value) ||
|
|
17
|
+
Utils.String.phoneRegExp.test(value)));
|
|
18
|
+
export const otpCode = (length) => Yup.string()
|
|
19
|
+
.length(length, `OTP length must be ${length}`)
|
|
20
|
+
.required("Required");
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sea-react-components",
|
|
3
|
+
"description": "SEA react components library",
|
|
4
|
+
"version": "1.0.2",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "tsc --build && npx postcss src/styles.css -o dist/styles.css && npx postcss src/components/text-editor/style.css -o dist/components/text-editor/style.css",
|
|
8
|
+
"watch": "concurrently \"tsc --watch\" \"npx postcss src/styles.css -o dist/styles.css --watch\" \"npx postcss src/components/text-editor/style.css -o dist/components/text-editor/style.css --watch\""
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist/**/*"
|
|
12
|
+
],
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"default": "./dist/index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"keywords": [],
|
|
20
|
+
"author": "",
|
|
21
|
+
"license": "ISC",
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@iconify/react": "^5.0.2",
|
|
24
|
+
"@szhsin/react-menu": "^4.2.2",
|
|
25
|
+
"@tiptap/extension-code-block-lowlight": "^2.11.3",
|
|
26
|
+
"@tiptap/extension-dropcursor": "^2.11.2",
|
|
27
|
+
"@tiptap/extension-font-family": "^2.11.2",
|
|
28
|
+
"@tiptap/extension-highlight": "^2.11.2",
|
|
29
|
+
"@tiptap/extension-image": "^2.11.2",
|
|
30
|
+
"@tiptap/extension-link": "^2.11.2",
|
|
31
|
+
"@tiptap/extension-placeholder": "^2.11.2",
|
|
32
|
+
"@tiptap/extension-table": "^2.11.3",
|
|
33
|
+
"@tiptap/extension-table-cell": "^2.11.3",
|
|
34
|
+
"@tiptap/extension-table-header": "^2.11.3",
|
|
35
|
+
"@tiptap/extension-table-row": "^2.11.3",
|
|
36
|
+
"@tiptap/extension-text-align": "^2.11.2",
|
|
37
|
+
"@tiptap/extension-text-style": "^2.11.2",
|
|
38
|
+
"@tiptap/extension-typography": "^2.11.2",
|
|
39
|
+
"@tiptap/extension-underline": "^2.11.2",
|
|
40
|
+
"@tiptap/pm": "^2.11.2",
|
|
41
|
+
"@tiptap/react": "^2.11.2",
|
|
42
|
+
"@tiptap/starter-kit": "^2.11.2",
|
|
43
|
+
"axios": "^1.7.9",
|
|
44
|
+
"clsx": "^2.1.1",
|
|
45
|
+
"jwt-decode": "^4.0.0",
|
|
46
|
+
"lowlight": "^3.3.0",
|
|
47
|
+
"react-dom": "^18.3.1",
|
|
48
|
+
"sea-backend-helpers": "^1.0.0",
|
|
49
|
+
"sea-platform-helpers": "^1.0.0",
|
|
50
|
+
"sea-react-components": "file:",
|
|
51
|
+
"yup": "^1.5.0"
|
|
52
|
+
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"react": "^18.3.1",
|
|
55
|
+
"tailwindcss": "^3.4.15"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@types/numeral": "^2.0.5",
|
|
59
|
+
"@types/react": "^18.3.12",
|
|
60
|
+
"autoprefixer": "^10.4.20",
|
|
61
|
+
"concurrently": "^9.1.0",
|
|
62
|
+
"postcss": "^8.4.49",
|
|
63
|
+
"postcss-cli": "^11.0.0",
|
|
64
|
+
"typescript": "^5.6.3"
|
|
65
|
+
}
|
|
66
|
+
}
|