@nextelco/common-ui 1.7.51 → 1.7.53

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.
@@ -8,9 +8,12 @@ type Props = PropsWithChildren<{
8
8
  backgroundColor: string;
9
9
  image: string;
10
10
  isVideo: boolean;
11
+ isYoutubeVideo: boolean;
12
+ fontStyle?: string;
11
13
  videoUrl?: string;
12
14
  showVideo?: boolean;
15
+ disabled?: boolean;
13
16
  onClick: () => void;
14
17
  }>;
15
- declare const Card1: ({ text1, text2, textFontColor, backgroundColor, image, videoUrl, showVideo, isVideo, onClick }: Props) => React.JSX.Element;
18
+ declare const Card1: ({ text1, text2, textFontColor, backgroundColor, image, fontStyle, videoUrl, showVideo, isVideo, isYoutubeVideo, disabled, onClick }: Props) => React.JSX.Element;
16
19
  export default Card1;
@@ -11,7 +11,8 @@ type Props = PropsWithChildren<{
11
11
  videoUrl?: string;
12
12
  showVideo?: boolean;
13
13
  isVideo: boolean;
14
+ disabled?: boolean;
14
15
  onClick: () => void;
15
16
  }>;
16
- declare const Card2: ({ text1, text2, textFontColor, backgroundColor, image, image2, isVideo, videoUrl, showVideo, onClick }: Props) => React.JSX.Element;
17
+ declare const Card2: ({ text1, text2, textFontColor, backgroundColor, image, image2, isVideo, videoUrl, showVideo, disabled, onClick }: Props) => React.JSX.Element;
17
18
  export default Card2;
@@ -10,7 +10,9 @@ type Props = PropsWithChildren<{
10
10
  textButtonFontColor: string;
11
11
  buttonBackgroundColor: string;
12
12
  image: string;
13
+ disabled?: boolean;
13
14
  onClick: () => void;
15
+ onClickFull?: () => void;
14
16
  }>;
15
- declare const Card3: ({ text1, text2, textFontColor, backgroundColor, textButton, textButtonFontColor, buttonBackgroundColor, image, onClick, }: Props) => React.JSX.Element;
17
+ declare const Card3: (props: Props) => React.JSX.Element;
16
18
  export default Card3;
@@ -6,9 +6,11 @@ type Props = PropsWithChildren<{
6
6
  text2: string;
7
7
  textFontColor: string;
8
8
  backgroundColor: string;
9
- hoveredBackgroundColor?: string;
10
- icon: string;
9
+ hoveredBackgroundColor: string;
10
+ icon1: string;
11
+ icon2?: string;
12
+ disabled?: boolean;
11
13
  onClick: () => void;
12
14
  }>;
13
- declare const Card4: ({ text1, text2, textFontColor, backgroundColor, hoveredBackgroundColor, icon, onClick }: Props) => React.JSX.Element;
15
+ declare const Card4: ({ text1, text2, textFontColor, backgroundColor, hoveredBackgroundColor, icon1, icon2, disabled, onClick }: Props) => React.JSX.Element;
14
16
  export default Card4;
@@ -8,7 +8,8 @@ type Props = PropsWithChildren<{
8
8
  textFontColor: string;
9
9
  backgroundColor: string;
10
10
  image: string;
11
+ disabled?: boolean;
11
12
  onClick: () => void;
12
13
  }>;
13
- declare const Card5: ({ text1, text2, text3, textFontColor, backgroundColor, image, onClick }: Props) => React.JSX.Element;
14
+ declare const Card5: ({ text1, text2, text3, textFontColor, backgroundColor, image, disabled, onClick }: Props) => React.JSX.Element;
14
15
  export default Card5;
@@ -12,7 +12,8 @@ type Props = PropsWithChildren<{
12
12
  textButtonFontColor: string;
13
13
  buttonBackgroundColor: string;
14
14
  image: string;
15
+ disabled?: boolean;
15
16
  onClick: () => void;
16
17
  }>;
17
- declare const Card6: ({ text1, text2, text3, text4, textFontColor, backgroundColor, textButton, textButtonFontColor, buttonBackgroundColor, image, onClick, }: Props) => React.JSX.Element;
18
+ declare const Card6: (props: Props) => React.JSX.Element;
18
19
  export default Card6;
@@ -10,7 +10,8 @@ type Props = PropsWithChildren<{
10
10
  isVideo: boolean;
11
11
  videoUrl?: string;
12
12
  showVideo?: boolean;
13
+ disabled?: boolean;
13
14
  onClick: () => void;
14
15
  }>;
15
- declare const Card7: ({ text1, textFontColor, backgroundColor, icon, image, isVideo, showVideo, videoUrl, onClick }: Props) => React.JSX.Element;
16
+ declare const Card7: ({ text1, textFontColor, backgroundColor, icon, image, isVideo, showVideo, videoUrl, disabled, onClick }: Props) => React.JSX.Element;
16
17
  export default Card7;
@@ -0,0 +1,18 @@
1
+ import React, { ReactNode } from 'react';
2
+ interface LazyLoaderProps<T> {
3
+ endpoint: string;
4
+ params?: Record<string, unknown>;
5
+ children: (items: T[], loading: boolean, error: ReactNode | null) => ReactNode;
6
+ scrollableTarget?: string;
7
+ className?: string;
8
+ style?: React.CSSProperties;
9
+ height?: number | string;
10
+ scrollThreshold?: number | string;
11
+ pageSize?: number;
12
+ initialPage?: number;
13
+ responseType?: 'blob';
14
+ }
15
+ export declare const LazyLoader: <T extends {
16
+ id: string | number;
17
+ }>({ endpoint, params, children, scrollableTarget, className, style, height, scrollThreshold, pageSize, initialPage, responseType, }: LazyLoaderProps<T>) => React.JSX.Element;
18
+ export {};
@@ -6,5 +6,5 @@ type Props = {
6
6
  handleLogout: () => void;
7
7
  notifications?: ReactNode;
8
8
  };
9
- declare const Profile: ({ user, handleLogout, notifications }: Props) => React.JSX.Element;
10
- export default Profile;
9
+ export declare const Profile: ({ user, handleLogout, notifications }: Props) => React.JSX.Element;
10
+ export {};
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ type Props = {};
3
+ declare const Selector: (props: Props) => React.JSX.Element;
4
+ export default Selector;
@@ -1 +1,2 @@
1
- export { default as Profile } from '../components/organisms/Profile/Profile';
1
+ export { Profile } from '../components/organisms/Profile/Profile';
2
+ export { LazyLoader } from '../components/organisms/LazyLoader/LazyLoader';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextelco/common-ui",
3
- "version": "1.7.51",
3
+ "version": "1.7.53",
4
4
  "description": "",
5
5
  "main": "dist/bundle.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -1,77 +0,0 @@
1
- /**
2
- import React, { useEffect } from 'react'
3
- import InfiniteScroll from 'react-infinite-scroll-component'
4
- import { useApi } from '../../../hooks/useApi'
5
-
6
- interface LazyLoadListProps {
7
- items: any[]
8
- setItems: (items: any[]) => void
9
- page: number
10
- limit: number
11
- setPage: (page: number) => void
12
- hasMore: boolean
13
- setHasMore: (hasMore: boolean) => void
14
- filters: { [key: string]: string }
15
- }
16
-
17
- const LazyLoadList: React.FC<LazyLoadListProps> = ({
18
- items,
19
- setItems,
20
- page,
21
- limit,
22
- setPage,
23
- hasMore,
24
- setHasMore,
25
- filters,
26
- }) => {
27
- const { request, errors, loading } = useApi()
28
-
29
- const fetchData = async (pageNum: number) => {
30
- const response = await request({
31
- method: 'get',
32
- url: `/api/items`,
33
- params: { page: pageNum, limit, ...filters },
34
- })
35
-
36
- if (response) {
37
- if (response.length === 0) {
38
- setHasMore(false)
39
- return
40
- }
41
- setItems([...items, ...response])
42
- }
43
- }
44
-
45
- useEffect(() => {
46
- fetchData(page)
47
- }, [page, filters])
48
-
49
- const loadMore = () => {
50
- setPage(page + 1)
51
- }
52
-
53
- return (
54
- <div>
55
- {errors && errors}
56
- <InfiniteScroll
57
- dataLength={items.length}
58
- next={loadMore}
59
- hasMore={hasMore}
60
- loader={<h4>Loading...</h4>}
61
- endMessage={<p>No more items to load</p>}
62
- >
63
- {items.map((item, index) => (
64
- <div
65
- key={index}
66
- style={{ padding: '20px', borderBottom: '1px solid #ccc' }}
67
- >
68
- {item.name || `Item ${index}`}{' '}
69
- </div>
70
- ))}
71
- </InfiniteScroll>
72
- </div>
73
- )
74
- }
75
-
76
- export default LazyLoadList
77
- */