@uniai-fe/uds-templates 0.1.19 → 0.1.21

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 (104) hide show
  1. package/dist/styles.css +58 -9
  2. package/package.json +7 -3
  3. package/src/auth/common/container/header/StageHeader.tsx +2 -2
  4. package/src/auth/login/jotai/user.ts +13 -0
  5. package/src/auth/login/types/api.ts +229 -0
  6. package/src/auth/login/types/form.ts +1 -0
  7. package/src/auth/login/types/index.ts +4 -0
  8. package/src/auth/signup/markup/VerificationForm.tsx +3 -2
  9. package/src/cctv/apis/client.ts +61 -0
  10. package/src/cctv/apis/index.ts +2 -0
  11. package/src/cctv/apis/server.ts +188 -0
  12. package/src/cctv/components/Provider.tsx +47 -0
  13. package/src/cctv/components/__viewer.tsx +99 -0
  14. package/src/cctv/components/cam-list/Container.tsx +36 -0
  15. package/src/cctv/components/cam-list/Item.tsx +71 -0
  16. package/src/cctv/components/cam-list/index.tsx +7 -0
  17. package/src/cctv/components/index.tsx +13 -0
  18. package/src/cctv/components/pagination/Container.tsx +26 -0
  19. package/src/cctv/components/pagination/Control.tsx +29 -0
  20. package/src/cctv/components/pagination/Provider.tsx +204 -0
  21. package/src/cctv/components/pagination/buttons/Base.tsx +56 -0
  22. package/src/cctv/components/pagination/buttons/Next.tsx +34 -0
  23. package/src/cctv/components/pagination/buttons/Prev.tsx +34 -0
  24. package/src/cctv/components/pagination/index.tsx +25 -0
  25. package/src/cctv/components/pagination/list/Carousel.tsx +26 -0
  26. package/src/cctv/components/pagination/list/Container.tsx +30 -0
  27. package/src/cctv/components/pagination/list/Item.tsx +81 -0
  28. package/src/cctv/components/video/Container.tsx +13 -0
  29. package/src/cctv/components/video/Video.tsx +34 -0
  30. package/src/cctv/components/video/index.tsx +9 -0
  31. package/src/cctv/components/video/overlay/Container.tsx +15 -0
  32. package/src/cctv/components/video/overlay/Title.tsx +28 -0
  33. package/src/cctv/components/video/overlay/body/Container.tsx +13 -0
  34. package/src/cctv/components/video/overlay/body/Error.tsx +16 -0
  35. package/src/cctv/components/video/overlay/footer/Container.tsx +30 -0
  36. package/src/cctv/components/video/overlay/footer/OpenButton.tsx +19 -0
  37. package/src/cctv/components/video/overlay/header/CloseButton.tsx +14 -0
  38. package/src/cctv/components/video/overlay/header/Container.tsx +50 -0
  39. package/src/cctv/components/video/overlay/header/LiveState.tsx +21 -0
  40. package/src/cctv/components/video/overlay/index.tsx +24 -0
  41. package/src/cctv/components/viewer/Container.tsx +13 -0
  42. package/src/cctv/components/viewer/desktop/Container.tsx +38 -0
  43. package/src/cctv/components/viewer/desktop/Pagination.tsx +20 -0
  44. package/src/cctv/components/viewer/desktop/Placeholder.tsx +18 -0
  45. package/src/cctv/components/viewer/desktop/Video.tsx +83 -0
  46. package/src/cctv/components/viewer/index.tsx +12 -0
  47. package/src/cctv/components/viewer/mobile/Container.tsx +13 -0
  48. package/src/cctv/data/context.ts +22 -0
  49. package/src/cctv/data/index.ts +1 -0
  50. package/src/cctv/hooks/index.tsx +5 -0
  51. package/src/cctv/hooks/useCompanyData.tsx +39 -0
  52. package/src/cctv/hooks/useContext.ts +150 -0
  53. package/src/cctv/hooks/useRtcStream.ts +94 -0
  54. package/src/cctv/img/chevron-left.svg +3 -0
  55. package/src/cctv/img/chevron-right.svg +3 -0
  56. package/src/cctv/img/error.svg +4 -0
  57. package/src/cctv/img/viewer-close.svg +3 -0
  58. package/src/cctv/img/viewer-open.svg +6 -0
  59. package/src/cctv/index.scss +1 -0
  60. package/src/cctv/index.tsx +9 -0
  61. package/src/cctv/jotai/context.ts +9 -0
  62. package/src/cctv/jotai/index.ts +1 -0
  63. package/src/cctv/styles/cam-list.scss +32 -0
  64. package/src/cctv/styles/index.scss +5 -0
  65. package/src/cctv/styles/pagination.scss +77 -0
  66. package/src/cctv/styles/variables.scss +38 -0
  67. package/src/cctv/styles/video.scss +142 -0
  68. package/src/cctv/styles/viewer.scss +7 -0
  69. package/src/cctv/types/api.ts +166 -0
  70. package/src/cctv/types/carousel.ts +24 -0
  71. package/src/cctv/types/context.ts +68 -0
  72. package/src/cctv/types/index.ts +4 -0
  73. package/src/cctv/types/list.ts +94 -0
  74. package/src/cctv/utils/data.ts +40 -0
  75. package/src/cctv/utils/select.ts +62 -0
  76. package/src/index.scss +0 -2
  77. package/src/index.tsx +3 -0
  78. package/src/modal/styles/base.scss +2 -2
  79. package/src/page-frame/desktop/index.tsx +4 -1
  80. package/src/page-frame/index.tsx +8 -2
  81. package/src/page-frame/mobile/{header/PageFrameMobileHeader.tsx → components/header/Header.tsx} +6 -6
  82. package/src/page-frame/mobile/components/header/index.ts +9 -0
  83. package/src/page-frame/mobile/components/index.tsx +14 -0
  84. package/src/page-frame/{navigation/PageFrameNavigation.tsx → mobile/components/navigation/Navigation.tsx} +3 -3
  85. package/src/page-frame/mobile/components/navigation/index.tsx +8 -0
  86. package/src/page-frame/mobile/components/page/Container.tsx +29 -0
  87. package/src/page-frame/mobile/{PageFrameMobile.tsx → components/page/Frame.tsx} +12 -9
  88. package/src/page-frame/mobile/components/page/index.tsx +11 -0
  89. package/src/page-frame/mobile/index.scss +3 -17
  90. package/src/page-frame/mobile/index.tsx +5 -2
  91. package/src/page-frame/{container/index.scss → mobile/styles/mobile.scss} +25 -7
  92. package/src/page-frame/mobile/types/index.ts +1 -0
  93. package/src/page-frame/mobile/types/page.ts +16 -0
  94. package/src/types/api.ts +43 -0
  95. package/src/types/index.ts +1 -0
  96. package/src/auth/login/types.ts +0 -2
  97. package/src/page-frame/container/PageFrameContainer.tsx +0 -24
  98. package/src/page-frame/container/index.tsx +0 -4
  99. package/src/page-frame/container/types.ts +0 -11
  100. package/src/page-frame/mobile/header/index.ts +0 -4
  101. package/src/page-frame/mobile/types.ts +0 -6
  102. package/src/page-frame/navigation/index.tsx +0 -4
  103. /package/src/page-frame/mobile/{header/page-frame-mobile-header.scss → styles/header.scss} +0 -0
  104. /package/src/page-frame/{navigation/index.scss → mobile/styles/navigation.scss} +0 -0
@@ -1,17 +1,17 @@
1
1
  "use client";
2
2
 
3
3
  import clsx from "clsx";
4
- import { PageFrameContainer } from "../container";
5
- import { PageFrameNavigation } from "../navigation";
6
- import type { PageFrameMobileProps } from "./types";
4
+ import { MobileFrameContainer } from "./Container";
5
+ import { MobileFrameNavigation } from "../navigation";
6
+ import type { MobileFrameProps } from "../../types";
7
7
  import React, { useCallback } from "react";
8
8
 
9
9
  /**
10
10
  * 모바일 전용 Page Frame 래퍼; 공통 컨테이너 위에 모바일 클래스/스타일을 덧입힌다.
11
11
  * @component
12
- * @param {PageFrameMobileProps} props
12
+ * @param {MobileFrameProps} props
13
13
  */
14
- export function PageFrameMobile({
14
+ export function MobileFrame({
15
15
  className,
16
16
  header,
17
17
  headerClassName,
@@ -19,17 +19,18 @@ export function PageFrameMobile({
19
19
  footer,
20
20
  footerClassName,
21
21
  navigationProps,
22
+ children,
22
23
  ...rest
23
- }: PageFrameMobileProps) {
24
+ }: MobileFrameProps) {
24
25
  const Footer = useCallback(
25
26
  (): React.ReactNode =>
26
27
  footer ??
27
- (navigationProps ? <PageFrameNavigation {...navigationProps} /> : null),
28
+ (navigationProps ? <MobileFrameNavigation {...navigationProps} /> : null),
28
29
  [footer, navigationProps],
29
30
  );
30
31
 
31
32
  return (
32
- <PageFrameContainer
33
+ <MobileFrameContainer
33
34
  {...rest}
34
35
  className={clsx("page-frame-mobile", className)}
35
36
  header={header}
@@ -37,6 +38,8 @@ export function PageFrameMobile({
37
38
  bodyClassName={clsx("page-frame-mobile-body", bodyClassName)}
38
39
  footer={<Footer />}
39
40
  footerClassName={clsx("page-frame-mobile-footer", footerClassName)}
40
- />
41
+ >
42
+ {children}
43
+ </MobileFrameContainer>
41
44
  );
42
45
  }
@@ -0,0 +1,11 @@
1
+ import { MobileFrameContainer } from "./Container";
2
+ import { MobileFrame } from "./Frame";
3
+
4
+ const Page = {
5
+ Frame: MobileFrame,
6
+ Container: MobileFrameContainer,
7
+ Shell: MobileFrameContainer,
8
+ };
9
+
10
+ export default Page;
11
+ export { MobileFrameContainer, MobileFrame };
@@ -1,17 +1,3 @@
1
- .page-frame-mobile {
2
- width: 100%;
3
- height: 100%;
4
- min-height: var(--uds-page-frame-height, var(--frame-device-height, 812px));
5
- max-height: 100dvh;
6
- background-color: var(--color-common-100, #ffffff);
7
- }
8
-
9
- .page-frame-mobile-header,
10
- .page-frame-mobile-body,
11
- .page-frame-mobile-footer {
12
- width: 100%;
13
- }
14
-
15
- .page-frame-mobile-body {
16
- background-color: inherit;
17
- }
1
+ @use "./styles/mobile.scss";
2
+ @use "./styles/header.scss";
3
+ @use "./styles/navigation.scss";
@@ -1,4 +1,7 @@
1
1
  import "./index.scss";
2
2
 
3
- export { PageFrameMobile } from "./PageFrameMobile";
4
- export type { PageFrameMobileProps } from "./types";
3
+ import { MobileFrame } from "./components/page/Frame";
4
+
5
+ export type { MobileFrameProps } from "./types";
6
+ export * from "./components";
7
+ export { MobileFrame };
@@ -16,7 +16,7 @@
16
16
  ); // PC에선 지정 폭으로 중앙 정렬하고, 모바일에선 100%를 유지
17
17
  }
18
18
 
19
- .page-frame-container {
19
+ .page-frame-mobile-shell {
20
20
  display: grid;
21
21
  grid-template-rows: auto 1fr auto;
22
22
  width: min(100%, var(--uds-page-frame-max-width));
@@ -28,21 +28,39 @@
28
28
  color: inherit;
29
29
  }
30
30
 
31
- .page-frame-header,
32
- .page-frame-body,
33
- .page-frame-footer {
31
+ .page-frame-mobile-shell-header,
32
+ .page-frame-mobile-shell-body,
33
+ .page-frame-mobile-shell-footer {
34
34
  width: 100%;
35
35
  }
36
36
 
37
- .page-frame-header {
37
+ .page-frame-mobile-shell-header {
38
38
  padding-top: var(--uds-page-frame-header-padding-top);
39
39
  }
40
40
 
41
- .page-frame-body {
41
+ .page-frame-mobile-shell-body {
42
42
  min-height: 0;
43
43
  overflow-y: auto;
44
44
  }
45
45
 
46
- .page-frame-footer {
46
+ .page-frame-mobile-shell-footer {
47
47
  padding-bottom: var(--uds-page-frame-footer-safe-area);
48
48
  }
49
+
50
+ .page-frame-mobile {
51
+ width: 100%;
52
+ height: 100%;
53
+ min-height: var(--uds-page-frame-height, var(--frame-device-height, 812px));
54
+ max-height: 100dvh;
55
+ background-color: var(--color-common-100, #ffffff);
56
+ }
57
+
58
+ .page-frame-mobile-header,
59
+ .page-frame-mobile-body,
60
+ .page-frame-mobile-footer {
61
+ width: 100%;
62
+ }
63
+
64
+ .page-frame-mobile-body {
65
+ background-color: inherit;
66
+ }
@@ -0,0 +1 @@
1
+ export * from "./page";
@@ -0,0 +1,16 @@
1
+ import type { ReactNode } from "react";
2
+ import type { MobileFrameNavigationProps } from "../components/navigation";
3
+
4
+ export type MobileFrameContainerProps = {
5
+ className?: string;
6
+ header?: ReactNode;
7
+ headerClassName?: string;
8
+ bodyClassName?: string;
9
+ footer?: ReactNode;
10
+ footerClassName?: string;
11
+ children: ReactNode;
12
+ };
13
+
14
+ export interface MobileFrameProps extends MobileFrameContainerProps {
15
+ navigationProps?: MobileFrameNavigationProps;
16
+ }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * API 응답; 에러 정보
3
+ * @property {string} field_name - 에러 필드 이름
4
+ * @property {string} message - 에러 메세지
5
+ */
6
+ export interface API_Res_Error {
7
+ /**
8
+ * 에러 필드 이름
9
+ */
10
+ field_name: string;
11
+ /**
12
+ * 에러 메세지
13
+ */
14
+ message: string;
15
+ }
16
+
17
+ /**
18
+ * API 응답; 기본 구조
19
+ * - GET, POST, PUT, DELETE 등 모든 API 응답에 공통적으로 사용
20
+ * @property {string} status - 통신 상태
21
+ * - "success": 정상 응답
22
+ * - "fail": 비정상 응답
23
+ * - "timeout": 타임아웃 응답
24
+ * @property {ResultDataType} data - 요청 응답 데이터
25
+ * @property {API_Res_Error[]} errors - 에러 정보
26
+ */
27
+ export interface API_Res_Base<ResultDataType> {
28
+ /**
29
+ * 통신 상태
30
+ * - "success": 정상 응답
31
+ * - "fail": 비정상 응답
32
+ * - "timeout": 타임아웃 응답
33
+ */
34
+ status: string;
35
+ /**
36
+ * 요청 응답 데이터
37
+ */
38
+ data: ResultDataType;
39
+ /**
40
+ * 에러 정보
41
+ */
42
+ errors: API_Res_Error[];
43
+ }
@@ -0,0 +1 @@
1
+ export type * from "./api";
@@ -1,2 +0,0 @@
1
- export type * from "./types/props";
2
- export type * from "./types/hooks";
@@ -1,24 +0,0 @@
1
- import clsx from "clsx";
2
- import type { PageFrameContainerProps } from "./types";
3
-
4
- /**
5
- * 페이지 공통 컨테이너; header/body/footer 영역을 순서대로 배치한다.
6
- * @component
7
- */
8
- export function PageFrameContainer({
9
- className,
10
- header,
11
- headerClassName,
12
- bodyClassName,
13
- footer,
14
- footerClassName,
15
- children,
16
- }: PageFrameContainerProps) {
17
- return (
18
- <div className={clsx("page-frame-container", className)}>
19
- <div className={clsx("page-frame-header", headerClassName)}>{header}</div>
20
- <div className={clsx("page-frame-body", bodyClassName)}>{children}</div>
21
- <div className={clsx("page-frame-footer", footerClassName)}>{footer}</div>
22
- </div>
23
- );
24
- }
@@ -1,4 +0,0 @@
1
- import "./index.scss";
2
-
3
- export { PageFrameContainer } from "./PageFrameContainer";
4
- export type { PageFrameContainerProps } from "./types";
@@ -1,11 +0,0 @@
1
- import type { ReactNode } from "react";
2
-
3
- export type PageFrameContainerProps = {
4
- className?: string;
5
- header?: ReactNode;
6
- headerClassName?: string;
7
- bodyClassName?: string;
8
- footer?: ReactNode;
9
- footerClassName?: string;
10
- children: ReactNode;
11
- };
@@ -1,4 +0,0 @@
1
- export {
2
- PageFrameMobileHeader as PageFrameMobileHeader,
3
- type PageFrameMobileHeaderProps,
4
- } from "./PageFrameMobileHeader";
@@ -1,6 +0,0 @@
1
- import type { PageFrameContainerProps } from "../container";
2
- import type { PageFrameNavigationProps } from "../navigation";
3
-
4
- export interface PageFrameMobileProps extends PageFrameContainerProps {
5
- navigationProps?: PageFrameNavigationProps;
6
- }
@@ -1,4 +0,0 @@
1
- import "./index.scss";
2
-
3
- export { PageFrameNavigation } from "./PageFrameNavigation";
4
- export type { PageFrameNavigationProps } from "./PageFrameNavigation";