@uniai-fe/uds-primitives 0.8.0 → 0.9.0
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/THIRD_PARTY_NOTICES.md +18 -18
- package/dist/styles.css +1649 -773
- package/package.json +36 -33
- package/src/components/dropdown/markup/foundation/Container.tsx +31 -28
- package/src/components/dropdown/types/base.ts +2 -10
- package/src/components/input/markup/foundation/Input.tsx +1 -2
- package/src/components/input/types/file.ts +1 -2
- package/src/components/pop-over/types/pop-over.ts +1 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniai-fe/uds-primitives",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "UNIAI Design System; Primitives Components Package",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -16,10 +16,9 @@
|
|
|
16
16
|
"publishConfig": {
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
19
|
-
"packageManager": "pnpm@10.33.3",
|
|
20
19
|
"engines": {
|
|
21
20
|
"node": ">=24",
|
|
22
|
-
"pnpm": ">=
|
|
21
|
+
"pnpm": ">=11"
|
|
23
22
|
},
|
|
24
23
|
"author": {
|
|
25
24
|
"name": "GraffitoRyu",
|
|
@@ -43,31 +42,16 @@
|
|
|
43
42
|
"./mantine-style": "./src/init/mantine.css",
|
|
44
43
|
"./*": "./src/*"
|
|
45
44
|
},
|
|
46
|
-
"scripts": {
|
|
47
|
-
"format": "prettier --write .",
|
|
48
|
-
"format:check": "prettier --check .",
|
|
49
|
-
"lint": "eslint . --max-warnings=0",
|
|
50
|
-
"typecheck": "tsc --project tsconfig.build.json --noEmit",
|
|
51
|
-
"build": "pnpm format && pnpm typecheck && pnpm css:build",
|
|
52
|
-
"css:build": "sass --load-path=node_modules src/index.scss dist/styles.css --style=expanded --no-source-map && node ./scripts/merge-theme-root.mjs dist/styles.css --selector=:root",
|
|
53
|
-
"dev": "tsc --project tsconfig.build.json --watch --noEmit",
|
|
54
|
-
"module:lint": "pnpm lint",
|
|
55
|
-
"module:typecheck": "pnpm typecheck",
|
|
56
|
-
"module:build": "pnpm build",
|
|
57
|
-
"design-primitives:build": "pnpm run build",
|
|
58
|
-
"design-primitives:dev": "pnpm run dev",
|
|
59
|
-
"publish:public": "bash ../../../scripts/npm-publish.sh"
|
|
60
|
-
},
|
|
61
45
|
"peerDependencies": {
|
|
62
|
-
"@mantine/core": "
|
|
63
|
-
"@mantine/dates": "
|
|
64
|
-
"@mantine/hooks": "
|
|
65
|
-
"@uniai-fe/uds-foundation": "^0.4.
|
|
66
|
-
"@uniai-fe/util-functions": "^0.
|
|
67
|
-
"react": "
|
|
46
|
+
"@mantine/core": ">=8 <9",
|
|
47
|
+
"@mantine/dates": ">=8 <9",
|
|
48
|
+
"@mantine/hooks": ">=8 <9",
|
|
49
|
+
"@uniai-fe/uds-foundation": "^0.4.8",
|
|
50
|
+
"@uniai-fe/util-functions": "^0.3.0",
|
|
51
|
+
"react": ">=19 <20",
|
|
68
52
|
"react-daum-postcode": "^4.0.0",
|
|
69
|
-
"react-dom": "
|
|
70
|
-
"react-hook-form": "
|
|
53
|
+
"react-dom": ">=19 <20",
|
|
54
|
+
"react-hook-form": ">=7 <8",
|
|
71
55
|
"@radix-ui/react-checkbox": "^1.3.3",
|
|
72
56
|
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
73
57
|
"@radix-ui/react-popover": "^1.1.15",
|
|
@@ -98,15 +82,34 @@
|
|
|
98
82
|
"@types/node": "^24.12.3",
|
|
99
83
|
"@types/react": "^19.2.17",
|
|
100
84
|
"@types/react-dom": "^19.2.3",
|
|
101
|
-
"@uniai-fe/eslint-config": "workspace:*",
|
|
102
|
-
"@uniai-fe/next-devkit": "workspace:*",
|
|
103
|
-
"@uniai-fe/tsconfig": "workspace:*",
|
|
104
|
-
"@uniai-fe/uds-foundation": "workspace:*",
|
|
105
|
-
"@uniai-fe/util-functions": "workspace:*",
|
|
106
85
|
"eslint": "^9.39.2",
|
|
107
86
|
"prettier": "^3.8.4",
|
|
108
87
|
"react-hook-form": "^7.80.0",
|
|
109
88
|
"sass": "^1.101.0",
|
|
110
|
-
"typescript": "
|
|
89
|
+
"typescript": "6.0.3",
|
|
90
|
+
"@uniai-fe/eslint-config": "0.2.0",
|
|
91
|
+
"@uniai-fe/util-functions": "0.4.0",
|
|
92
|
+
"@uniai-fe/tsconfig": "0.2.0",
|
|
93
|
+
"@uniai-fe/next-devkit": "0.3.0",
|
|
94
|
+
"@uniai-fe/uds-foundation": "0.5.0"
|
|
95
|
+
},
|
|
96
|
+
"scripts": {
|
|
97
|
+
"check:pre-commit": "pnpm --dir ../../.. run check:pre-commit",
|
|
98
|
+
"check:pre-push": "pnpm --dir ../../.. run check:pre-push",
|
|
99
|
+
"check:pre-push:dry-run": "pnpm --dir ../../.. run check:pre-push:dry-run",
|
|
100
|
+
"format": "prettier --write .",
|
|
101
|
+
"format:fix": "pnpm format",
|
|
102
|
+
"format:check": "prettier --check .",
|
|
103
|
+
"lint": "eslint . --max-warnings=0",
|
|
104
|
+
"typecheck": "tsc --project tsconfig.build.json --noEmit",
|
|
105
|
+
"build": "pnpm format && pnpm typecheck && pnpm css:build && pnpm format",
|
|
106
|
+
"css:build": "sass --load-path=node_modules src/index.scss dist/styles.css --style=expanded --no-source-map && node ./scripts/merge-theme-root.mjs dist/styles.css --selector=:root",
|
|
107
|
+
"dev": "tsc --project tsconfig.build.json --watch --noEmit",
|
|
108
|
+
"module:lint": "pnpm lint",
|
|
109
|
+
"module:typecheck": "pnpm typecheck",
|
|
110
|
+
"module:build": "pnpm build",
|
|
111
|
+
"design-primitives:build": "pnpm run build",
|
|
112
|
+
"design-primitives:dev": "pnpm run dev",
|
|
113
|
+
"publish:public": "bash ../../../scripts/npm-publish.sh"
|
|
111
114
|
}
|
|
112
|
-
}
|
|
115
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
|
|
4
4
|
import clsx from "clsx";
|
|
5
|
-
import { forwardRef, useEffect, useMemo, useState } from "react";
|
|
5
|
+
import { forwardRef, useCallback, useEffect, useMemo, useState } from "react";
|
|
6
6
|
|
|
7
7
|
import type { DropdownContainerProps } from "../../types/props";
|
|
8
8
|
import { useDropdownContext } from "./Provider";
|
|
@@ -49,46 +49,49 @@ const DropdownContainer = forwardRef<HTMLDivElement, DropdownContainerProps>(
|
|
|
49
49
|
const [panelWidth, setPanelWidth] = useState<number>();
|
|
50
50
|
const shouldMatchTriggerWidth = width === "match";
|
|
51
51
|
|
|
52
|
-
const resolvePanelSizeValue = (
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
if (typeof value === "number") {
|
|
61
|
-
return `${value}px`;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if (typeof value === "string") {
|
|
65
|
-
if (value === "fit-content") {
|
|
66
|
-
return "fit-content";
|
|
67
|
-
}
|
|
68
|
-
if (value === "max-content") {
|
|
69
|
-
return "max-content";
|
|
52
|
+
const resolvePanelSizeValue = useCallback(
|
|
53
|
+
(
|
|
54
|
+
value?: string | number,
|
|
55
|
+
fallbackToMatch?: boolean,
|
|
56
|
+
): string | undefined => {
|
|
57
|
+
if (value === undefined) {
|
|
58
|
+
return undefined;
|
|
70
59
|
}
|
|
71
|
-
|
|
72
|
-
|
|
60
|
+
|
|
61
|
+
if (typeof value === "number") {
|
|
62
|
+
return `${value}px`;
|
|
73
63
|
}
|
|
74
|
-
|
|
75
|
-
|
|
64
|
+
|
|
65
|
+
if (typeof value === "string") {
|
|
66
|
+
if (value === "fit-content") {
|
|
67
|
+
return "fit-content";
|
|
68
|
+
}
|
|
69
|
+
if (value === "max-content") {
|
|
70
|
+
return "max-content";
|
|
71
|
+
}
|
|
72
|
+
if (fallbackToMatch && value === "match" && panelWidth) {
|
|
73
|
+
return `${panelWidth}px`;
|
|
74
|
+
}
|
|
75
|
+
if (value.trim().length > 0 && value !== "match") {
|
|
76
|
+
return value;
|
|
77
|
+
}
|
|
76
78
|
}
|
|
77
|
-
}
|
|
78
79
|
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
return undefined;
|
|
81
|
+
},
|
|
82
|
+
[panelWidth],
|
|
83
|
+
);
|
|
81
84
|
const resolvedWidth = useMemo(() => {
|
|
82
85
|
if (shouldMatchTriggerWidth) {
|
|
83
86
|
return panelWidth ? `${panelWidth}px` : undefined;
|
|
84
87
|
}
|
|
85
88
|
|
|
86
89
|
return resolvePanelSizeValue(width);
|
|
87
|
-
}, [panelWidth, shouldMatchTriggerWidth, width]);
|
|
90
|
+
}, [panelWidth, resolvePanelSizeValue, shouldMatchTriggerWidth, width]);
|
|
88
91
|
const resolvedMinWidth = useMemo(() => {
|
|
89
92
|
// 변경 설명: width 계약은 기준 폭, minWidth 계약은 최소 보장 폭으로 분리한다.
|
|
90
93
|
return resolvePanelSizeValue(minWidth, true);
|
|
91
|
-
}, [minWidth,
|
|
94
|
+
}, [minWidth, resolvePanelSizeValue]);
|
|
92
95
|
|
|
93
96
|
useEffect(() => {
|
|
94
97
|
if (!shouldMatchTriggerWidth) {
|
|
@@ -11,11 +11,7 @@ export type DropdownSize = "xsmall" | "small" | "medium" | "large";
|
|
|
11
11
|
* - string/number: min-width 커스텀 값
|
|
12
12
|
*/
|
|
13
13
|
export type DropdownPanelWidth =
|
|
14
|
-
| "
|
|
15
|
-
| "fit-content"
|
|
16
|
-
| "max-content"
|
|
17
|
-
| string
|
|
18
|
-
| number;
|
|
14
|
+
"match" | "fit-content" | "max-content" | string | number;
|
|
19
15
|
|
|
20
16
|
/**
|
|
21
17
|
* Dropdown panel min-width 옵션
|
|
@@ -24,8 +20,4 @@ export type DropdownPanelWidth =
|
|
|
24
20
|
* - string/number: 커스텀 최소 폭
|
|
25
21
|
*/
|
|
26
22
|
export type DropdownPanelMinWidth =
|
|
27
|
-
| "
|
|
28
|
-
| "fit-content"
|
|
29
|
-
| "max-content"
|
|
30
|
-
| string
|
|
31
|
-
| number;
|
|
23
|
+
"match" | "fit-content" | "max-content" | string | number;
|
|
@@ -179,8 +179,7 @@ const InputBase = forwardRef<HTMLInputElement, InputProps>(
|
|
|
179
179
|
|
|
180
180
|
const handleClear = (
|
|
181
181
|
event:
|
|
182
|
-
|
|
|
183
|
-
| ReactPointerEvent<HTMLButtonElement>,
|
|
182
|
+
MouseEvent<HTMLButtonElement> | ReactPointerEvent<HTMLButtonElement>,
|
|
184
183
|
) => {
|
|
185
184
|
event.preventDefault();
|
|
186
185
|
dispatchNativeInputEvent();
|
|
@@ -21,8 +21,7 @@ export type InputFileSource = "input" | "drop";
|
|
|
21
21
|
* Input Types; File Upload 이벤트 타입
|
|
22
22
|
*/
|
|
23
23
|
export type InputFileEvent =
|
|
24
|
-
|
|
25
|
-
| DragEvent<HTMLElement>;
|
|
24
|
+
ChangeEvent<HTMLInputElement> | DragEvent<HTMLElement>;
|
|
26
25
|
|
|
27
26
|
/**
|
|
28
27
|
* Input Types; File Upload 변경 핸들러
|
|
@@ -14,11 +14,7 @@ import type { ReactNode } from "react";
|
|
|
14
14
|
* @property {string} width CSS width 문자열
|
|
15
15
|
*/
|
|
16
16
|
export type PopOverContentWidth =
|
|
17
|
-
| "
|
|
18
|
-
| "fit-content"
|
|
19
|
-
| "max-content"
|
|
20
|
-
| number
|
|
21
|
-
| string;
|
|
17
|
+
"match" | "fit-content" | "max-content" | number | string;
|
|
22
18
|
|
|
23
19
|
/**
|
|
24
20
|
* PopOver Root props.
|