@uniai-fe/uds-primitives 0.1.7 → 0.1.8

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/README.md CHANGED
@@ -102,6 +102,11 @@ function Templates() {
102
102
  - 템플릿별 클래스를 추가로 노출한다: `.button-template-text`, `.button-template-text-size-*`, `.button-template-round`, `.button-template-round-size-*`.
103
103
  - 스토리북 `primitives/Button` Story에서 solid/outlined/텍스트/라운드 4가지 카테고리를 한 번에 확인할 수 있다.
104
104
 
105
+ ### 최근 업데이트
106
+
107
+ - TextInput Base 컴포넌트의 `clear` 버튼 로직을 pointer 이벤트 기반으로 재작성해 모바일 터치 환경에서도 안정적으로 입력값이 초기화되도록 했다.
108
+ - react-hook-form `register`와 연계된 값도 동일하게 초기화되며, focus가 빠지면 clear 버튼이 자동으로 숨겨진다.
109
+
105
110
  ## 스타일 내보내기
106
111
 
107
112
  foundation CSS는 앱 루트에서 한 번만 직접 import해야 한다. primitives `styles/css` 엔트리는 **컴포넌트 SCSS만** 포함하며 foundation 토큰을 다시 로드하지 않는다.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniai-fe/uds-primitives",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "UNIAI Design System; Primitives Components Package",
5
5
  "type": "module",
6
6
  "private": false,
@@ -53,12 +53,12 @@
53
53
  "design-primitives:dev": "pnpm run dev"
54
54
  },
55
55
  "peerDependencies": {
56
- "@uniai-fe/uds-foundation": "^0.0.1",
56
+ "@uniai-fe/uds-foundation": "^0.1.0",
57
57
  "@uniai-fe/util-functions": "^0.2.3",
58
58
  "@radix-ui/react-visually-hidden": "^1.2.4",
59
- "react": ">= 19",
60
- "react-dom": ">= 19",
61
- "react-hook-form": ">= 7"
59
+ "react": "^19",
60
+ "react-dom": "^19",
61
+ "react-hook-form": "^7"
62
62
  },
63
63
  "dependencies": {
64
64
  "@mantine/core": "^8.3.11",
@@ -0,0 +1,37 @@
1
+ "use client";
2
+
3
+ import { useEffect } from "react";
4
+ // import { useEffect } from "react";
5
+ import {
6
+ FormProvider as ReactHookFormProvider,
7
+ useForm,
8
+ type FieldValues,
9
+ type UseFormProps,
10
+ type UseFormReturn,
11
+ } from "react-hook-form";
12
+
13
+ /**
14
+ * react-hook-form; context provider
15
+ */
16
+ export default function FormProvider<FormDataType extends FieldValues>({
17
+ children,
18
+ options,
19
+ callback,
20
+ }: {
21
+ children: React.ReactNode;
22
+ } & Partial<{
23
+ options: UseFormProps<FormDataType>;
24
+ callback: (params: UseFormReturn<FormDataType>) => void | undefined;
25
+ }>) {
26
+ const formMethods = useForm<FormDataType>({ mode: "all", ...options });
27
+
28
+ useEffect(() => {
29
+ if (typeof callback === "undefined") return;
30
+ // if (typeof callback !== "undefined")
31
+ callback(formMethods);
32
+ }, [callback, formMethods]);
33
+
34
+ return (
35
+ <ReactHookFormProvider {...formMethods}>{children}</ReactHookFormProvider>
36
+ );
37
+ }
@@ -0,0 +1,3 @@
1
+ import FormProvider from "./Provider";
2
+
3
+ export const Form = { Provider: FormProvider };
package/src/index.tsx CHANGED
@@ -24,3 +24,6 @@ export * from "./components/alternate";
24
24
  export * from "./components/segmented-control";
25
25
  export * from "./components/divider";
26
26
  export * from "./types";
27
+
28
+ // 기타 도구
29
+ export * from "./components/form";