@ncds/ui-admin 1.1.3 → 1.2.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.
- package/dist/cjs/index.js +11 -0
- package/dist/cjs/src/components/badge/utils.js +2 -2
- package/dist/cjs/src/components/breadcrumb/BreadCrumb.js +2 -2
- package/dist/cjs/src/components/button/Button.js +2 -2
- package/dist/cjs/src/components/button/ButtonCloseX.js +2 -2
- package/dist/cjs/src/components/button/ButtonGroup.js +2 -2
- package/dist/cjs/src/components/carousel/CarouselArrow.js +2 -2
- package/dist/cjs/src/components/dropdown/Dropdown.js +4 -4
- package/dist/cjs/src/components/featured-icon/FeaturedIcon.js +2 -2
- package/dist/cjs/src/components/input/FileInput.js +222 -0
- package/dist/cjs/src/components/input/InputBase.js +6 -6
- package/dist/cjs/src/components/input/PasswordInput.js +17 -25
- package/dist/cjs/src/components/input/index.js +11 -0
- package/dist/cjs/src/components/notification/FullWidthNotification.js +3 -3
- package/dist/cjs/src/components/select/Select.js +2 -2
- package/dist/cjs/src/components/tag/Tag.js +3 -3
- package/dist/cjs/src/hooks/index.js +26 -0
- package/dist/cjs/src/hooks/useCallbackRef.js +49 -0
- package/dist/cjs/src/hooks/useMergeRefs.js +36 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/src/components/badge/utils.js +1 -1
- package/dist/esm/src/components/breadcrumb/BreadCrumb.js +1 -1
- package/dist/esm/src/components/button/Button.js +1 -1
- package/dist/esm/src/components/button/ButtonCloseX.js +1 -1
- package/dist/esm/src/components/button/ButtonGroup.js +1 -1
- package/dist/esm/src/components/carousel/CarouselArrow.js +1 -1
- package/dist/esm/src/components/dropdown/Dropdown.js +1 -1
- package/dist/esm/src/components/featured-icon/FeaturedIcon.js +1 -1
- package/dist/esm/src/components/input/FileInput.js +215 -0
- package/dist/esm/src/components/input/InputBase.js +1 -1
- package/dist/esm/src/components/input/PasswordInput.js +17 -25
- package/dist/esm/src/components/input/index.js +2 -1
- package/dist/esm/src/components/notification/FullWidthNotification.js +1 -1
- package/dist/esm/src/components/select/Select.js +1 -1
- package/dist/esm/src/components/tag/Tag.js +1 -1
- package/dist/esm/src/hooks/index.js +3 -0
- package/dist/esm/src/hooks/useCallbackRef.js +43 -0
- package/dist/esm/src/hooks/useMergeRefs.js +30 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/src/components/dropdown/Dropdown.d.ts +1 -1
- package/dist/types/src/components/featured-icon/FeaturedIcon.d.ts +1 -1
- package/dist/types/src/components/input/FileInput.d.ts +62 -0
- package/dist/types/src/components/input/InputBase.d.ts +1 -1
- package/dist/types/src/components/input/index.d.ts +1 -0
- package/dist/types/src/components/modal/Modal.d.ts +1 -1
- package/dist/types/src/components/notification/Notification.d.ts +1 -1
- package/dist/types/src/components/select/Select.d.ts +1 -1
- package/dist/types/src/hooks/index.d.ts +4 -0
- package/dist/types/src/hooks/useCallbackRef.d.ts +28 -0
- package/dist/types/src/hooks/useMergeRefs.d.ts +21 -0
- package/dist/ui-admin/assets/styles/style.css +54 -0
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IconName } from '@ncds/ui-admin-icon';
|
|
1
|
+
import { type IconName } from '@ncds/ui-admin-icon/dynamic';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { FeaturedIconColor, FeaturedIconTheme } from '../featured-icon';
|
|
4
4
|
export type ModalSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IconName } from '@ncds/ui-admin-icon';
|
|
1
|
+
import { IconName } from '@ncds/ui-admin-icon/dynamic';
|
|
2
2
|
import { COLOR } from '@ncds/ui-admin/constant/color';
|
|
3
3
|
import { Size } from '@ncds/ui/constant/size';
|
|
4
4
|
import { ComponentPropsWithRef, PropsWithChildren } from 'react';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A callback ref hook that supports cleanup functions.
|
|
3
|
+
* This is useful when you need to perform setup/cleanup operations when the ref changes.
|
|
4
|
+
*
|
|
5
|
+
* @param callback - Function that receives the node and optionally returns a cleanup function
|
|
6
|
+
* @returns A callback ref
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* const MyComponent = () => {
|
|
11
|
+
* const ref = useCallbackRef<HTMLInputElement>((node) => {
|
|
12
|
+
* if (node) {
|
|
13
|
+
* const handleInput = () => console.log('input changed');
|
|
14
|
+
* node.addEventListener('input', handleInput);
|
|
15
|
+
*
|
|
16
|
+
* // Return cleanup function
|
|
17
|
+
* return () => {
|
|
18
|
+
* node.removeEventListener('input', handleInput);
|
|
19
|
+
* };
|
|
20
|
+
* }
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
* return <input ref={ref} />;
|
|
24
|
+
* };
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function useCallbackRef<T>(callback: (node: T | null) => (() => void) | void): React.RefCallback<T>;
|
|
28
|
+
//# sourceMappingURL=useCallbackRef.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
type Ref<T> = React.RefCallback<T> | React.MutableRefObject<T | null> | null | undefined;
|
|
2
|
+
/**
|
|
3
|
+
* Merges multiple refs into a single callback ref.
|
|
4
|
+
* This is useful when you need to forward a ref while also keeping an internal ref.
|
|
5
|
+
*
|
|
6
|
+
* @param refs - Array of refs to merge
|
|
7
|
+
* @returns A callback ref that will update all provided refs
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* const MyComponent = forwardRef<HTMLInputElement, Props>((props, ref) => {
|
|
12
|
+
* const internalRef = useRef<HTMLInputElement>(null);
|
|
13
|
+
* const mergedRef = useMergeRefs([ref, internalRef]);
|
|
14
|
+
*
|
|
15
|
+
* return <input ref={mergedRef} />;
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare function useMergeRefs<T>(refs: Array<Ref<T>>): React.RefCallback<T>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=useMergeRefs.d.ts.map
|
|
@@ -1188,6 +1188,60 @@ button {
|
|
|
1188
1188
|
color: var(--primary-red-600);
|
|
1189
1189
|
}
|
|
1190
1190
|
|
|
1191
|
+
.ncua-file-input {
|
|
1192
|
+
display: inline-flex;
|
|
1193
|
+
flex-direction: column;
|
|
1194
|
+
align-items: flex-start;
|
|
1195
|
+
gap: 6px;
|
|
1196
|
+
}
|
|
1197
|
+
.ncua-file-input__input-container {
|
|
1198
|
+
display: flex;
|
|
1199
|
+
flex-direction: column;
|
|
1200
|
+
align-items: flex-start;
|
|
1201
|
+
gap: 4px;
|
|
1202
|
+
}
|
|
1203
|
+
.ncua-file-input__label {
|
|
1204
|
+
display: flex;
|
|
1205
|
+
align-items: center;
|
|
1206
|
+
gap: 4px;
|
|
1207
|
+
}
|
|
1208
|
+
.ncua-file-input__file-tags {
|
|
1209
|
+
display: flex;
|
|
1210
|
+
padding: 12px 8px;
|
|
1211
|
+
flex-direction: column;
|
|
1212
|
+
align-items: flex-start;
|
|
1213
|
+
gap: 6px;
|
|
1214
|
+
align-self: stretch;
|
|
1215
|
+
background: var(--gray-50);
|
|
1216
|
+
}
|
|
1217
|
+
.ncua-file-input__hint-list {
|
|
1218
|
+
margin: 0;
|
|
1219
|
+
list-style: disc;
|
|
1220
|
+
color: var(--gray-400);
|
|
1221
|
+
}
|
|
1222
|
+
.ncua-file-input--xs {
|
|
1223
|
+
font-size: var(--font-size-xxs);
|
|
1224
|
+
line-height: var(--line-heights-xxs);
|
|
1225
|
+
}
|
|
1226
|
+
.ncua-file-input--sm {
|
|
1227
|
+
font-size: var(--font-size-xs);
|
|
1228
|
+
line-height: var(--line-heights-xs);
|
|
1229
|
+
}
|
|
1230
|
+
.ncua-file-input--xs .ncua-file-input__input-container {
|
|
1231
|
+
gap: 4px;
|
|
1232
|
+
}
|
|
1233
|
+
.ncua-file-input--sm .ncua-file-input__input-container {
|
|
1234
|
+
gap: 6px;
|
|
1235
|
+
}
|
|
1236
|
+
.ncua-file-input--xs .ncua-file-input__hint-list {
|
|
1237
|
+
font-size: var(--font-size-xxxs);
|
|
1238
|
+
line-height: var(--line-heights-xxxs);
|
|
1239
|
+
}
|
|
1240
|
+
.ncua-file-input--md .ncua-file-input__hint-list {
|
|
1241
|
+
font-size: inherit;
|
|
1242
|
+
line-height: inherit;
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1191
1245
|
.ncua-input {
|
|
1192
1246
|
display: inline-flex;
|
|
1193
1247
|
flex-direction: column;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ncds/ui-admin",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "nhn-commerce의 어드민 디자인 시스템입니다.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"barrel": "node barrel.js",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@ncds/types-common": "^1.0.0",
|
|
65
65
|
"@ncds/types-layout": "^1.0.0",
|
|
66
|
-
"@ncds/ui-admin-icon": "0.
|
|
66
|
+
"@ncds/ui-admin-icon": "0.1.1",
|
|
67
67
|
"classnames": "^2.3.2",
|
|
68
68
|
"lodash": "^4.17.21",
|
|
69
69
|
"lodash-es": "^4.17.21",
|