@uniai-fe/uds-templates 0.4.16 → 0.4.18

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniai-fe/uds-templates",
3
- "version": "0.4.16",
3
+ "version": "0.4.18",
4
4
  "description": "UNIAI Design System; UI Templates Package",
5
5
  "type": "module",
6
6
  "private": false,
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { useCallback, useEffect, useMemo } from "react";
3
+ import { useCallback, useEffect, useMemo, useRef } from "react";
4
4
  import type { CSSProperties } from "react";
5
5
 
6
6
  import clsx from "clsx";
@@ -31,6 +31,7 @@ export function ModalRoot({
31
31
  className,
32
32
  }: ModalRootProps) {
33
33
  const { updateModal, closeModal } = useModal();
34
+ const surfaceRef = useRef<HTMLDivElement | null>(null);
34
35
 
35
36
  useEffect(() => {
36
37
  if (modalProps.show === "init") {
@@ -38,6 +39,15 @@ export function ModalRoot({
38
39
  }
39
40
  }, [modalProps.show, stackKey, updateModal]);
40
41
 
42
+ useEffect(() => {
43
+ if (modalProps.show !== true) {
44
+ return;
45
+ }
46
+
47
+ // modal open 시 background form focus를 surface로 우회해 Enter 재전파를 막는다.
48
+ surfaceRef.current?.focus({ preventScroll: true });
49
+ }, [modalProps.show]);
50
+
41
51
  const handleClose = useCallback(() => {
42
52
  if (modalProps.closeOnOutsideClick === false) {
43
53
  return;
@@ -94,6 +104,8 @@ export function ModalRoot({
94
104
  aria-modal="true"
95
105
  onClick={stopPropagation}
96
106
  style={surfaceStyle}
107
+ tabIndex={-1}
108
+ ref={surfaceRef}
97
109
  >
98
110
  <ModalContainer stackKey={stackKey} {...modalProps} />
99
111
  </div>
@@ -46,7 +46,7 @@ const ServiceInquiryForm = ({
46
46
  useEffect(() => {
47
47
  form.register("inquiry_type");
48
48
  if (!form.getValues("inquiry_type")) {
49
- // 변경 설명: 문의 유형은 화면 label과 submit payload를 동일하게 유지하기 위해 한글 원문값을 그대로 기본값으로 사용한다.
49
+ // 변경 설명: 문의 유형은 선택형 form 상태로 유지하고, 서비스 앱이 필요하면 submit 경계에서 user_context로 접어 보낸다.
50
50
  form.setValue("inquiry_type", "접속이 안 돼요");
51
51
  }
52
52
  }, [form]);
@@ -158,7 +158,7 @@ const ServiceInquiryForm = ({
158
158
  chipStyle="filter"
159
159
  fill="solid"
160
160
  selected={selectedInquiryType === inquiryType}
161
- // 변경 설명: inquiry_type은 영문 key 변환 없이 선택된 한글 label 원문을 그대로 submit payload로 유지한다.
161
+ // 변경 설명: inquiry_type은 영문 key 변환 없이 선택된 한글 label 원문을 form 값으로 유지한다.
162
162
  onClick={() =>
163
163
  form.setValue("inquiry_type", inquiryType, {
164
164
  shouldDirty: true,
@@ -1,13 +1,9 @@
1
- import type {
2
- ServiceInquiryType,
3
- ServiceInquiryUserContext,
4
- } from "./form-context";
1
+ import type { ServiceInquiryUserContext } from "./form-context";
5
2
 
6
3
  /**
7
4
  * Service Inquiry API; 문의 등록 요청
8
5
  * @property {string} text 문의 본문
9
6
  * @property {string} farm_name 문의 대상 농장명 또는 빈 문자열
10
- * @property {ServiceInquiryType} inquiry_type 문의 유형 label 원문
11
7
  * @property {string[]} labels JIRA label 목록
12
8
  * @property {string} contact 문의자 연락처(email 또는 phone number)
13
9
  * @property {string} page_path 문의하기를 연 현재 페이지 URL
@@ -22,10 +18,6 @@ export interface API_Req_ServiceInquiry {
22
18
  * 문의 대상 농장명 또는 빈 문자열
23
19
  */
24
20
  farm_name: string;
25
- /**
26
- * 문의 유형 label 원문
27
- */
28
- inquiry_type: ServiceInquiryType;
29
21
  /**
30
22
  * JIRA label 목록
31
23
  */
@@ -57,6 +57,8 @@ export interface ServiceInquiryNetworkErrorHeaders {
57
57
  * @property {string} [state] 서비스 레이어 상태 문자열
58
58
  * @property {string} [message] 사용자/운영 확인용 오류 메시지
59
59
  * @property {ServiceInquiryNetworkErrorHeaders} [headers] 선택 수집된 request/response 헤더 정보
60
+ * @property {unknown} [request_body] 보안 필드를 제거한 request payload
61
+ * @property {unknown} [response_body] 보안 필드를 제거한 response payload
60
62
  * @property {string} [timestamp] 오류 기록 시각
61
63
  */
62
64
  export interface ServiceInquiryNetworkError {
@@ -80,6 +82,14 @@ export interface ServiceInquiryNetworkError {
80
82
  * 선택 수집된 request/response 헤더 정보
81
83
  */
82
84
  headers?: ServiceInquiryNetworkErrorHeaders;
85
+ /**
86
+ * 보안 필드를 제거한 request payload
87
+ */
88
+ request_body?: unknown;
89
+ /**
90
+ * 보안 필드를 제거한 response payload
91
+ */
92
+ response_body?: unknown;
83
93
  /**
84
94
  * 오류 기록 시각
85
95
  */