@uniai-fe/uds-templates 0.4.33 → 0.5.1

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 (34) hide show
  1. package/README.md +12 -0
  2. package/dist/styles.css +142 -19
  3. package/package.json +4 -4
  4. package/src/auth/signup/hooks/index.ts +3 -0
  5. package/src/auth/signup/hooks/useSignupAgreementForm.ts +48 -0
  6. package/src/auth/signup/hooks/useSignupFarmCodeForm.ts +87 -0
  7. package/src/auth/signup/hooks/useSignupTypeSelectForm.ts +56 -0
  8. package/src/auth/signup/img/select-user-type-default.svg +15 -0
  9. package/src/auth/signup/img/select-user-type-selected.svg +3 -0
  10. package/src/auth/signup/index.ts +10 -0
  11. package/src/auth/signup/markup/AccountForm.tsx +1 -0
  12. package/src/auth/signup/markup/AgreementForm.tsx +229 -0
  13. package/src/auth/signup/markup/FarmCodeForm.tsx +122 -0
  14. package/src/auth/signup/markup/Template.tsx +58 -2
  15. package/src/auth/signup/markup/TypeSelectForm.tsx +102 -0
  16. package/src/auth/signup/markup/UserInfoForm.tsx +9 -0
  17. package/src/auth/signup/markup/VerificationForm.tsx +36 -26
  18. package/src/auth/signup/markup/index.ts +3 -0
  19. package/src/auth/signup/styles/signup.scss +95 -20
  20. package/src/auth/signup/types/hooks.ts +132 -0
  21. package/src/auth/signup/types/props.ts +210 -4
  22. package/src/edge-case/EdgeCase.tsx +16 -0
  23. package/src/edge-case/components/Empty.tsx +42 -0
  24. package/src/edge-case/components/Loading.tsx +42 -0
  25. package/src/edge-case/components/NotFound.tsx +74 -0
  26. package/src/edge-case/components/index.tsx +3 -0
  27. package/src/edge-case/img/404.svg +3 -0
  28. package/src/edge-case/index.scss +1 -0
  29. package/src/edge-case/index.tsx +11 -0
  30. package/src/edge-case/styles/edge-case.scss +56 -0
  31. package/src/edge-case/styles/index.scss +1 -0
  32. package/src/edge-case/types/index.ts +94 -0
  33. package/src/index.scss +1 -0
  34. package/src/index.tsx +1 -0
@@ -0,0 +1,74 @@
1
+ "use client";
2
+
3
+ import { clsx } from "clsx";
4
+ import { Alternate } from "@uniai-fe/uds-primitives";
5
+ import NotFoundIcon from "../img/404.svg";
6
+ import type { EdgeCaseNotFoundProps } from "../types";
7
+
8
+ /**
9
+ * Edge Case Not Found; not-found 상태 화면 템플릿
10
+ * @component
11
+ * @param {EdgeCaseNotFoundProps} props
12
+ * @param {string} [props.className] 최상위 edge-case container className override다.
13
+ * @param {string} [props.inquiryHref] 문의 text action을 link로 렌더링할 href다.
14
+ * @param {() => void} [props.onInquiry] 문의 text action을 button으로 렌더링할 콜백이다.
15
+ * @param {string} [props.fallbackHref] onPrev가 없을 때 사용할 fallback href다.
16
+ * @param {() => void} [props.onPrev] 이전 페이지 이동을 소비 앱에서 실행하는 콜백이다.
17
+ * @example
18
+ * <EdgeCase.NotFound onPrev={() => router.back()} />
19
+ */
20
+ export default function EdgeCaseNotFound({
21
+ className,
22
+ inquiryHref,
23
+ onInquiry,
24
+ fallbackHref = "/",
25
+ onPrev,
26
+ }: EdgeCaseNotFoundProps) {
27
+ return (
28
+ <Alternate.Layout.Container
29
+ className={clsx("edge-case", className)}
30
+ data-edge-case="not-found"
31
+ >
32
+ <Alternate.Layout.Figure>
33
+ <NotFoundIcon
34
+ width={128}
35
+ height={128}
36
+ viewBox="0 0 128 128"
37
+ aria-hidden="true"
38
+ />
39
+ </Alternate.Layout.Figure>
40
+ <Alternate.Layout.Title as="h1">
41
+ 이 페이지를 찾을 수 없습니다.
42
+ </Alternate.Layout.Title>
43
+ <Alternate.Layout.Contents>
44
+ <p>
45
+ 페이지가 이동되었거나 삭제되었을 수 있습니다.
46
+ <br />
47
+ 페이지 주소를 다시 확인해 주세요.
48
+ </p>
49
+ {/* 변경: NotFound 본문 줄바꿈은 폭 제한이 아니라 Figma fixed copy의 br로 고정한다. */}
50
+ {onInquiry || inquiryHref ? (
51
+ <p>
52
+ 관련된 문의사항은{" "}
53
+ <Alternate.Layout.TextButton href={inquiryHref} onClick={onInquiry}>
54
+ 문의하기
55
+ </Alternate.Layout.TextButton>
56
+ 를 통해
57
+ <br />
58
+ 접수해 주시길 바랍니다.
59
+ </p>
60
+ ) : null}
61
+ </Alternate.Layout.Contents>
62
+ {/* 변경: router/history 판정은 내부에서 실행하지 않고 onPrev 또는 fallback href만 연결한다. */}
63
+ {onPrev ? (
64
+ <Alternate.Layout.Button onClick={onPrev}>
65
+ 이전 페이지로
66
+ </Alternate.Layout.Button>
67
+ ) : (
68
+ <Alternate.Layout.Button as="a" href={fallbackHref}>
69
+ 이전 페이지로
70
+ </Alternate.Layout.Button>
71
+ )}
72
+ </Alternate.Layout.Container>
73
+ );
74
+ }
@@ -0,0 +1,3 @@
1
+ export { default as EdgeCaseEmpty } from "./Empty";
2
+ export { default as EdgeCaseLoading } from "./Loading";
3
+ export { default as EdgeCaseNotFound } from "./NotFound";
@@ -0,0 +1,3 @@
1
+ <svg width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M60.6598 32.877C62.1862 30.3743 65.8137 30.3743 67.3401 32.877L103.419 92.0324C105.013 94.6459 103.137 97.9999 100.08 98H27.9197C24.8631 97.9996 22.9866 94.6458 24.5805 92.0324L60.6598 32.877ZM64.5227 81.3305C63.1717 81.3306 62.0762 82.4281 62.0762 83.7819C62.0762 85.1357 63.1716 86.2331 64.5227 86.2333C65.8736 86.2329 66.9693 85.1355 66.9693 83.7819C66.9692 82.4283 65.8735 81.3309 64.5227 81.3305ZM64.5227 49.5599C63.2257 49.5601 62.1737 50.6141 62.1736 51.9137V75.4471C62.1736 76.7467 63.2257 77.8007 64.5227 77.8008C65.8195 77.8004 66.8718 76.7466 66.8718 75.4471V51.9137C66.8717 50.6143 65.8195 49.5603 64.5227 49.5599Z" fill="#F43625"/>
3
+ </svg>
@@ -0,0 +1 @@
1
+ @use "./styles/index.scss" as edgeCaseStyles;
@@ -0,0 +1,11 @@
1
+ import "./index.scss";
2
+
3
+ /**
4
+ * Edge Case; 화면 단위 예외 상태 템플릿 엔트리
5
+ * @desc
6
+ * - `EdgeCase.Empty`: 빈 상태 화면 조합이다.
7
+ * - `EdgeCase.Loading`: 로딩 상태 화면 조합이다.
8
+ * - `EdgeCase.NotFound`: not-found 상태 화면 조합이다.
9
+ */
10
+ export { default as EdgeCase } from "./EdgeCase";
11
+ export type * from "./types";
@@ -0,0 +1,56 @@
1
+ .edge-case {
2
+ width: 100%;
3
+ }
4
+
5
+ .edge-case:where([data-edge-case="not-found"]) {
6
+ --alternate-layout-gap: var(--spacing-gap-3);
7
+ --alternate-layout-figure-size: 128px;
8
+ --alternate-layout-title-color: var(--color-label-standard);
9
+ --alternate-layout-title-font-size: var(--font-heading-xsmall-size);
10
+ --alternate-layout-title-line-height: var(--font-heading-xsmall-line-height);
11
+ --alternate-layout-title-letter-spacing: var(
12
+ --font-heading-xsmall-letter-spacing
13
+ );
14
+ --alternate-layout-title-font-weight: var(--font-heading-xsmall-weight);
15
+ --alternate-layout-contents-font-size: var(--font-body-xsmall-size);
16
+ --alternate-layout-contents-line-height: var(--font-body-xsmall-line-height);
17
+ --alternate-layout-contents-letter-spacing: var(
18
+ --font-body-xsmall-letter-spacing
19
+ );
20
+ --alternate-layout-contents-font-weight: var(--font-body-xsmall-weight);
21
+ --button-default-font-label-medium-size: var(--font-label-small-size);
22
+ --button-default-font-label-medium-line-height: var(
23
+ --font-label-small-line-height
24
+ );
25
+ --button-default-font-label-medium-letter-spacing: var(
26
+ --font-label-small-letter-spacing
27
+ );
28
+ --button-default-font-label-medium-weight: var(--font-label-small-weight);
29
+ --button-default-font-weight: var(--font-label-small-weight);
30
+
31
+ min-height: 0;
32
+ padding: calc(var(--spacing-padding-11) + var(--spacing-padding-7))
33
+ var(--spacing-padding-8);
34
+ border: 1px solid var(--color-border-assistive);
35
+ border-radius: var(--theme-radius-large-1);
36
+ background: var(--color-common-100);
37
+ justify-content: flex-start;
38
+
39
+ :where(.alternate-layout-figure) {
40
+ // 변경: not-found preset은 Alternate.Layout gap을 유지하되 Figma root gap 12px만 figure/button 쪽 margin으로 보정한다.
41
+ margin-bottom: var(--spacing-gap-3);
42
+ }
43
+
44
+ :where(.alternate-layout-contents) {
45
+ white-space: nowrap;
46
+
47
+ :where(p + p) {
48
+ // 변경: inquiry variant의 문의 문단은 Figma Text frame의 두 번째 content group gap 6px을 따른다.
49
+ margin-top: var(--spacing-gap-3);
50
+ }
51
+ }
52
+
53
+ :where(.alternate-layout-button) {
54
+ margin-top: var(--spacing-gap-3);
55
+ }
56
+ }
@@ -0,0 +1 @@
1
+ @use "./edge-case.scss";
@@ -0,0 +1,94 @@
1
+ import type { ReactNode } from "react";
2
+
3
+ /**
4
+ * Edge Case Empty Props; 빈 상태 화면 템플릿 props
5
+ * @property {string} [className] 최상위 edge-case container className override다.
6
+ * @property {ReactNode} [figure] 빈 상태를 보조하는 visual 콘텐츠다.
7
+ * @property {ReactNode} title 빈 상태 제목 콘텐츠다.
8
+ * @property {ReactNode} [description] 빈 상태 설명 콘텐츠다.
9
+ * @property {ReactNode} [children] 하단에 주입할 custom action 또는 보조 콘텐츠다.
10
+ */
11
+ export interface EdgeCaseEmptyProps {
12
+ /**
13
+ * 최상위 edge-case container className override다.
14
+ */
15
+ className?: string;
16
+ /**
17
+ * 빈 상태를 보조하는 visual 콘텐츠다.
18
+ */
19
+ figure?: ReactNode;
20
+ /**
21
+ * 빈 상태 제목 콘텐츠다.
22
+ */
23
+ title: ReactNode;
24
+ /**
25
+ * 빈 상태 설명 콘텐츠다.
26
+ */
27
+ description?: ReactNode;
28
+ /**
29
+ * 하단에 주입할 custom action 또는 보조 콘텐츠다.
30
+ */
31
+ children?: ReactNode;
32
+ }
33
+
34
+ /**
35
+ * Edge Case Loading Props; 로딩 상태 화면 템플릿 props
36
+ * @property {string} [className] 최상위 edge-case container className override다.
37
+ * @property {ReactNode} [figure] 로딩 상태 visual 콘텐츠다. 없으면 Alternate.LoadingIcon을 사용한다.
38
+ * @property {ReactNode} [title] 로딩 상태 제목 콘텐츠다.
39
+ * @property {ReactNode} [description] 로딩 상태 설명 콘텐츠다.
40
+ * @property {ReactNode} [children] 하단에 주입할 custom action 또는 보조 콘텐츠다.
41
+ */
42
+ export interface EdgeCaseLoadingProps {
43
+ /**
44
+ * 최상위 edge-case container className override다.
45
+ */
46
+ className?: string;
47
+ /**
48
+ * 로딩 상태 visual 콘텐츠다. 없으면 Alternate.LoadingIcon을 사용한다.
49
+ */
50
+ figure?: ReactNode;
51
+ /**
52
+ * 로딩 상태 제목 콘텐츠다.
53
+ */
54
+ title?: ReactNode;
55
+ /**
56
+ * 로딩 상태 설명 콘텐츠다.
57
+ */
58
+ description?: ReactNode;
59
+ /**
60
+ * 하단에 주입할 custom action 또는 보조 콘텐츠다.
61
+ */
62
+ children?: ReactNode;
63
+ }
64
+
65
+ /**
66
+ * Edge Case Not Found Props; not-found 상태 화면 템플릿 props
67
+ * @property {string} [className] 최상위 edge-case container className override다.
68
+ * @property {string} [inquiryHref] 문의 text action을 link로 렌더링할 href다.
69
+ * @property {() => void} [onInquiry] 문의 text action을 button으로 렌더링할 콜백이다.
70
+ * @property {string} [fallbackHref] onPrev가 없을 때 사용할 fallback href다.
71
+ * @property {() => void} [onPrev] 이전 페이지 이동을 소비 앱에서 실행하는 콜백이다.
72
+ */
73
+ export interface EdgeCaseNotFoundProps {
74
+ /**
75
+ * 최상위 edge-case container className override다.
76
+ */
77
+ className?: string;
78
+ /**
79
+ * 문의 text action을 link로 렌더링할 href다.
80
+ */
81
+ inquiryHref?: string;
82
+ /**
83
+ * 문의 text action을 button으로 렌더링할 콜백이다.
84
+ */
85
+ onInquiry?: () => void;
86
+ /**
87
+ * onPrev가 없을 때 사용할 fallback href다.
88
+ */
89
+ fallbackHref?: string;
90
+ /**
91
+ * 이전 페이지 이동을 소비 앱에서 실행하는 콜백이다.
92
+ */
93
+ onPrev?: () => void;
94
+ }
package/src/index.scss CHANGED
@@ -10,3 +10,4 @@
10
10
  @use "./weather/index.scss" as weatherStyles;
11
11
  @use "./cctv/index.scss" as cctvStyles;
12
12
  @use "./service-inquiry/index.scss" as serviceInquiryStyles;
13
+ @use "./edge-case/index.scss" as edgeCaseStyles;
package/src/index.tsx CHANGED
@@ -7,5 +7,6 @@ export * from "./modal";
7
7
  export * from "./weather";
8
8
  export * from "./cctv";
9
9
  export * from "./service-inquiry";
10
+ export * from "./edge-case";
10
11
 
11
12
  export type * from "./types";