@ncds/ui-admin 1.5.5 → 1.6.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/dist/cjs/src/components/badge/utils.js +2 -4
- package/dist/cjs/src/components/breadcrumb/BreadCrumb.js +2 -3
- package/dist/cjs/src/components/button/Button.js +4 -5
- package/dist/cjs/src/components/button/ButtonCloseX.js +3 -3
- package/dist/cjs/src/components/button/ButtonGroup.js +2 -6
- package/dist/cjs/src/components/carousel/CarouselArrow.js +5 -5
- package/dist/cjs/src/components/combobox/ComboBox.js +3 -2
- package/dist/cjs/src/components/date-picker/CustomInput.js +5 -4
- package/dist/cjs/src/components/dropdown/Dropdown.js +13 -14
- package/dist/cjs/src/components/featured-icon/FeaturedIcon.js +3 -5
- package/dist/cjs/src/components/file-input/FileInput.js +6 -7
- package/dist/cjs/src/components/image-file-input/ImageFileInput.js +4 -5
- package/dist/cjs/src/components/image-file-input/components/ImagePreview.js +2 -1
- package/dist/cjs/src/components/input/InputBase.js +21 -24
- package/dist/cjs/src/components/input/PasswordInput.js +1 -1
- package/dist/cjs/src/components/modal/Modal.js +1 -1
- package/dist/cjs/src/components/notification/FloatingNotification.js +8 -7
- package/dist/cjs/src/components/notification/FullWidthNotification.js +17 -17
- package/dist/cjs/src/components/notification/MessageNotification.js +11 -12
- package/dist/cjs/src/components/pagination/NavButton.js +10 -9
- package/dist/cjs/src/components/select-dropdown/SelectDropdown.js +14 -4
- package/dist/cjs/src/components/selectbox/SelectBox.js +61 -38
- package/dist/cjs/src/components/tab/TabButton.js +2 -3
- package/dist/cjs/src/components/tag/Tag.js +4 -5
- package/dist/esm/src/components/badge/utils.js +1 -2
- package/dist/esm/src/components/breadcrumb/BreadCrumb.js +2 -3
- package/dist/esm/src/components/button/Button.js +3 -4
- package/dist/esm/src/components/button/ButtonCloseX.js +3 -3
- package/dist/esm/src/components/button/ButtonGroup.js +2 -6
- package/dist/esm/src/components/carousel/CarouselArrow.js +5 -5
- package/dist/esm/src/components/combobox/ComboBox.js +3 -2
- package/dist/esm/src/components/date-picker/CustomInput.js +5 -3
- package/dist/esm/src/components/dropdown/Dropdown.js +13 -13
- package/dist/esm/src/components/featured-icon/FeaturedIcon.js +2 -4
- package/dist/esm/src/components/file-input/FileInput.js +6 -7
- package/dist/esm/src/components/image-file-input/ImageFileInput.js +4 -5
- package/dist/esm/src/components/image-file-input/components/ImagePreview.js +2 -1
- package/dist/esm/src/components/input/InputBase.js +21 -24
- package/dist/esm/src/components/input/PasswordInput.js +2 -2
- package/dist/esm/src/components/modal/Modal.js +1 -1
- package/dist/esm/src/components/notification/FloatingNotification.js +8 -7
- package/dist/esm/src/components/notification/FullWidthNotification.js +17 -17
- package/dist/esm/src/components/notification/MessageNotification.js +11 -12
- package/dist/esm/src/components/pagination/NavButton.js +10 -9
- package/dist/esm/src/components/select-dropdown/SelectDropdown.js +14 -4
- package/dist/esm/src/components/selectbox/SelectBox.js +61 -38
- package/dist/esm/src/components/tab/TabButton.js +2 -3
- package/dist/esm/src/components/tag/Tag.js +4 -5
- package/dist/types/src/components/badge/utils.d.ts +2 -2
- package/dist/types/src/components/button/Button.d.ts +17 -19
- package/dist/types/src/components/button/ButtonCloseX.d.ts +1 -1
- package/dist/types/src/components/button/ButtonGroup.d.ts +4 -4
- package/dist/types/src/components/combobox/ComboBox.d.ts +4 -4
- package/dist/types/src/components/date-picker/CustomInput.d.ts +1 -2
- package/dist/types/src/components/dot/Dot.d.ts +1 -1
- package/dist/types/src/components/dropdown/Dropdown.d.ts +3 -3
- package/dist/types/src/components/featured-icon/FeaturedIcon.d.ts +2 -2
- package/dist/types/src/components/file-input/FileInput.d.ts +1 -1
- package/dist/types/src/components/image-file-input/ImageFileInput.d.ts +2 -2
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/input/InputBase.d.ts +4 -4
- package/dist/types/src/components/modal/Modal.d.ts +2 -2
- package/dist/types/src/components/notification/MessageNotification.d.ts +3 -3
- package/dist/types/src/components/notification/Notification.d.ts +3 -3
- package/dist/types/src/components/pagination/NavButton.d.ts +5 -4
- package/dist/types/src/components/select-dropdown/SelectDropdown.d.ts +1 -0
- package/dist/types/src/components/selectbox/SelectBox.d.ts +4 -2
- package/dist/types/src/components/tab/TabButton.d.ts +2 -2
- package/dist/types/src/types/dropdown/option.d.ts +4 -0
- package/dist/types/src/types/index.d.ts +1 -0
- package/dist/ui-admin/assets/styles/style.css +26 -2
- package/package.json +1 -1
|
@@ -26,7 +26,7 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
26
26
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
27
27
|
};
|
|
28
28
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
29
|
-
import
|
|
29
|
+
import { ChevronDown } from '@ncds/ui-admin-icon';
|
|
30
30
|
import { COLOR } from '../../../constant/color';
|
|
31
31
|
import classNames from 'classnames';
|
|
32
32
|
import { forwardRef, useCallback, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
@@ -46,29 +46,33 @@ export var SelectBox = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
46
46
|
size = _d === void 0 ? 'xs' : _d,
|
|
47
47
|
_e = _a.type,
|
|
48
48
|
type = _e === void 0 ? 'default' : _e,
|
|
49
|
-
_f = _a.
|
|
50
|
-
|
|
49
|
+
_f = _a.autoWidth,
|
|
50
|
+
autoWidth = _f === void 0 ? true : _f,
|
|
51
|
+
_g = _a.destructive,
|
|
52
|
+
destructive = _g === void 0 ? false : _g,
|
|
51
53
|
value = _a.value,
|
|
52
|
-
|
|
53
|
-
optionItems =
|
|
54
|
-
|
|
55
|
-
disabled =
|
|
56
|
-
|
|
57
|
-
maxHeight =
|
|
58
|
-
|
|
59
|
-
multiple =
|
|
54
|
+
_h = _a.optionItems,
|
|
55
|
+
optionItems = _h === void 0 ? [] : _h,
|
|
56
|
+
_j = _a.disabled,
|
|
57
|
+
disabled = _j === void 0 ? false : _j,
|
|
58
|
+
_k = _a.maxHeight,
|
|
59
|
+
maxHeight = _k === void 0 ? DEFAULT_MAX_HEIGHT : _k,
|
|
60
|
+
_l = _a.multiple,
|
|
61
|
+
multiple = _l === void 0 ? false : _l,
|
|
62
|
+
_m = _a.align,
|
|
63
|
+
align = _m === void 0 ? 'left' : _m,
|
|
60
64
|
id = _a.id,
|
|
61
65
|
className = _a.className,
|
|
62
66
|
children = _a.children,
|
|
63
67
|
register = _a.register,
|
|
64
68
|
onChange = _a.onChange,
|
|
65
69
|
onEdit = _a.onEdit,
|
|
66
|
-
props = __rest(_a, ["placeholder", "disabledPlaceholder", "hintText", "size", "type", "destructive", "value", "optionItems", "disabled", "maxHeight", "multiple", "id", "className", "children", "register", "onChange", "onEdit"]);
|
|
70
|
+
props = __rest(_a, ["placeholder", "disabledPlaceholder", "hintText", "size", "type", "autoWidth", "destructive", "value", "optionItems", "disabled", "maxHeight", "multiple", "align", "id", "className", "children", "register", "onChange", "onEdit"]);
|
|
67
71
|
var internalRef = useRef(null);
|
|
68
72
|
var dropdownRef = useRef(null);
|
|
69
|
-
var
|
|
70
|
-
selectedTags =
|
|
71
|
-
setSelectedTags =
|
|
73
|
+
var _o = useState([]),
|
|
74
|
+
selectedTags = _o[0],
|
|
75
|
+
setSelectedTags = _o[1];
|
|
72
76
|
var selectedOption = useMemo(function () {
|
|
73
77
|
if (multiple) return null;
|
|
74
78
|
return optionItems.find(function (option) {
|
|
@@ -79,7 +83,7 @@ export var SelectBox = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
79
83
|
if (multiple) {
|
|
80
84
|
return placeholder;
|
|
81
85
|
}
|
|
82
|
-
return selectedOption ? selectedOption
|
|
86
|
+
return selectedOption ? selectedOption : placeholder;
|
|
83
87
|
}, [multiple, selectedOption, placeholder]);
|
|
84
88
|
var handleOptionSelect = function (option) {
|
|
85
89
|
if (disabled) return;
|
|
@@ -107,7 +111,7 @@ export var SelectBox = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
107
111
|
});
|
|
108
112
|
}
|
|
109
113
|
};
|
|
110
|
-
var
|
|
114
|
+
var _p = useDropdown({
|
|
111
115
|
triggerRef: internalRef,
|
|
112
116
|
dropdownRef: dropdownRef,
|
|
113
117
|
maxHeight: maxHeight,
|
|
@@ -117,16 +121,16 @@ export var SelectBox = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
117
121
|
multiple: multiple,
|
|
118
122
|
onSelect: handleOptionSelect
|
|
119
123
|
}),
|
|
120
|
-
isOpen =
|
|
121
|
-
dropdownDirection =
|
|
122
|
-
focusedIndex =
|
|
123
|
-
toggleDropdown =
|
|
124
|
-
closeDropdown =
|
|
125
|
-
handleKeyDown =
|
|
126
|
-
handleDropdownSelect =
|
|
127
|
-
handleMouseMove =
|
|
128
|
-
isKeyboardNavigation =
|
|
129
|
-
setFocusedIndex =
|
|
124
|
+
isOpen = _p.isOpen,
|
|
125
|
+
dropdownDirection = _p.direction,
|
|
126
|
+
focusedIndex = _p.focusedIndex,
|
|
127
|
+
toggleDropdown = _p.toggleDropdown,
|
|
128
|
+
closeDropdown = _p.closeDropdown,
|
|
129
|
+
handleKeyDown = _p.handleKeyDown,
|
|
130
|
+
handleDropdownSelect = _p.handleOptionSelect,
|
|
131
|
+
handleMouseMove = _p.handleMouseMove,
|
|
132
|
+
isKeyboardNavigation = _p.isKeyboardNavigation,
|
|
133
|
+
setFocusedIndex = _p.setFocusedIndex;
|
|
130
134
|
var activeDescendantId = useMemo(function () {
|
|
131
135
|
if (!isOpen || focusedIndex < 0 || focusedIndex >= optionItems.length) {
|
|
132
136
|
return undefined;
|
|
@@ -140,11 +144,11 @@ export var SelectBox = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
140
144
|
}, [handleMouseMove, setFocusedIndex]);
|
|
141
145
|
// Multiple select 관련 로직
|
|
142
146
|
var currentSelectedValues = multiple && Array.isArray(value) ? value : [];
|
|
143
|
-
var
|
|
144
|
-
selectAllButtonText =
|
|
145
|
-
toggleSelectAll =
|
|
146
|
-
getSelectedTagsData =
|
|
147
|
-
removeTag =
|
|
147
|
+
var _q = useMultiSelect(currentSelectedValues, optionItems),
|
|
148
|
+
selectAllButtonText = _q.buttonText,
|
|
149
|
+
toggleSelectAll = _q.toggleSelectAll,
|
|
150
|
+
getSelectedTagsData = _q.getSelectedTagsData,
|
|
151
|
+
removeTag = _q.removeTag;
|
|
148
152
|
var handleSelectAll = function () {
|
|
149
153
|
if (!multiple || !onChange) return;
|
|
150
154
|
var newSelectedValues = toggleSelectAll();
|
|
@@ -174,11 +178,11 @@ export var SelectBox = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
174
178
|
};
|
|
175
179
|
useScrollLock(isOpen, dropdownRef);
|
|
176
180
|
useLayoutEffect(function () {
|
|
177
|
-
if (isOpen && dropdownRef.current && internalRef.current) {
|
|
181
|
+
if (autoWidth && isOpen && dropdownRef.current && internalRef.current) {
|
|
178
182
|
var dropdownWidth = dropdownRef.current.offsetWidth;
|
|
179
183
|
internalRef.current.style.width = "".concat(dropdownWidth, "px");
|
|
180
184
|
}
|
|
181
|
-
}, [isOpen, optionItems]);
|
|
185
|
+
}, [autoWidth, isOpen, optionItems]);
|
|
182
186
|
useImperativeHandle(ref, function () {
|
|
183
187
|
return internalRef.current;
|
|
184
188
|
}, []);
|
|
@@ -209,12 +213,30 @@ export var SelectBox = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
209
213
|
children: [_jsxs("div", __assign({
|
|
210
214
|
className: "ncua-selectbox__content-inner"
|
|
211
215
|
}, {
|
|
212
|
-
children: [_jsx("
|
|
216
|
+
children: [_jsx("div", __assign({
|
|
213
217
|
className: "ncua-selectbox__value"
|
|
214
218
|
}, {
|
|
215
|
-
children: displayValue
|
|
216
|
-
|
|
217
|
-
|
|
219
|
+
children: typeof displayValue === 'string' ? _jsx("span", __assign({
|
|
220
|
+
className: "ncua-selectbox__value-text"
|
|
221
|
+
}, {
|
|
222
|
+
children: displayValue
|
|
223
|
+
})) : _jsxs("div", __assign({
|
|
224
|
+
className: "ncua-selectbox__value-container"
|
|
225
|
+
}, {
|
|
226
|
+
children: [displayValue.icon && _jsx("span", __assign({
|
|
227
|
+
className: "ncua-selectbox__value-icon"
|
|
228
|
+
}, {
|
|
229
|
+
children: _jsx(displayValue.icon, {
|
|
230
|
+
width: 16,
|
|
231
|
+
height: 16
|
|
232
|
+
})
|
|
233
|
+
})), _jsx("span", __assign({
|
|
234
|
+
className: "ncua-selectbox__value-text"
|
|
235
|
+
}, {
|
|
236
|
+
children: displayValue.label
|
|
237
|
+
}))]
|
|
238
|
+
}))
|
|
239
|
+
})), _jsx(ChevronDown, {
|
|
218
240
|
width: size === 'xs' ? 14 : 16,
|
|
219
241
|
height: size === 'xs' ? 14 : 16,
|
|
220
242
|
color: disabled ? COLOR.gray300 : COLOR.gray500,
|
|
@@ -238,6 +260,7 @@ export var SelectBox = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
238
260
|
componentType: "selectbox",
|
|
239
261
|
isKeyboardNavigation: isKeyboardNavigation,
|
|
240
262
|
activeDescendantId: activeDescendantId,
|
|
263
|
+
align: align,
|
|
241
264
|
onOptionSelect: handleDropdownSelect,
|
|
242
265
|
onMouseMove: handleMouseMove,
|
|
243
266
|
onOptionHover: handleOptionHover,
|
|
@@ -17,9 +17,9 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
17
17
|
return t;
|
|
18
18
|
};
|
|
19
19
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
20
|
+
import { XClose } from '@ncds/ui-admin-icon';
|
|
20
21
|
import classNames from 'classnames';
|
|
21
22
|
import { Badge } from '../badge/Badge';
|
|
22
|
-
import Icon from '@ncds/ui-admin-icon/dynamic';
|
|
23
23
|
export var TabButton = function (_a) {
|
|
24
24
|
var id = _a.id,
|
|
25
25
|
label = _a.label,
|
|
@@ -75,8 +75,7 @@ export var TabButton = function (_a) {
|
|
|
75
75
|
return onClose === null || onClose === void 0 ? void 0 : onClose(id !== null && id !== void 0 ? id : '');
|
|
76
76
|
}
|
|
77
77
|
}, {
|
|
78
|
-
children: _jsx(
|
|
79
|
-
name: "x-close",
|
|
78
|
+
children: _jsx(XClose, {
|
|
80
79
|
width: 14,
|
|
81
80
|
height: 14
|
|
82
81
|
})
|
|
@@ -9,7 +9,7 @@ var __assign = this && this.__assign || function () {
|
|
|
9
9
|
return __assign.apply(this, arguments);
|
|
10
10
|
};
|
|
11
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
-
import
|
|
12
|
+
import { XClose } from '@ncds/ui-admin-icon';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
14
|
import { useCallback, useRef, useState } from 'react';
|
|
15
15
|
import { COLOR } from '../../../constant/color';
|
|
@@ -103,8 +103,8 @@ export var Tag = function (_a) {
|
|
|
103
103
|
var sideSlotRender = function (slot) {
|
|
104
104
|
var _a;
|
|
105
105
|
if (slot.type === 'icon') {
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
var SlotIcon = slot.icon;
|
|
107
|
+
return _jsx(SlotIcon, {
|
|
108
108
|
width: iconSize[size],
|
|
109
109
|
height: iconSize[size],
|
|
110
110
|
color: slot.color
|
|
@@ -139,8 +139,7 @@ export var Tag = function (_a) {
|
|
|
139
139
|
className: "ncua-tag__close",
|
|
140
140
|
onClick: onButtonClick
|
|
141
141
|
}, {
|
|
142
|
-
children: _jsx(
|
|
143
|
-
name: "x-close",
|
|
142
|
+
children: _jsx(XClose, {
|
|
144
143
|
color: COLOR.gray300,
|
|
145
144
|
width: iconSize[size],
|
|
146
145
|
height: iconSize[size]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { SideSlotType } from '../../types/side-slot';
|
|
1
|
+
import type { SideSlotType } from '../../types/side-slot';
|
|
2
2
|
export type SideSlotRenderProps = {
|
|
3
3
|
slot: SideSlotType;
|
|
4
4
|
defaultIconSize: number;
|
|
5
5
|
};
|
|
6
|
-
export declare const sideSlotRender: ({ slot, defaultIconSize }: SideSlotRenderProps) =>
|
|
6
|
+
export declare const sideSlotRender: ({ slot, defaultIconSize }: SideSlotRenderProps) => string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
7
7
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
-
import { Size } from '../../../constant/size';
|
|
3
|
-
import { SideSlotType } from '../../types/side-slot';
|
|
4
|
-
import { DotProps } from '../dot';
|
|
5
|
-
export type ButtonTheme = 'primary' | 'secondary' | 'secondary-gray' | 'tertiary-gray' | 'tertiary' | 'text' | 'text-gray' | 'text-red' | 'destructive';
|
|
6
|
-
export type ButtonSize = Extract<Size, 'xxs' | 'xs' | 'sm' | 'md'>;
|
|
1
|
+
import { type ComponentProps, type ReactNode } from 'react';
|
|
2
|
+
import type { Size } from '../../../constant/size';
|
|
3
|
+
import type { SideSlotType } from '../../types/side-slot';
|
|
4
|
+
import { type DotProps } from '../dot';
|
|
7
5
|
type CommonButtonProps<T extends keyof HTMLElementTagNameMap> = Omit<ComponentProps<T>, 'ref'> & {
|
|
8
6
|
label: ReactNode;
|
|
9
7
|
className?: string;
|
|
@@ -16,21 +14,21 @@ type CommonButtonProps<T extends keyof HTMLElementTagNameMap> = Omit<ComponentPr
|
|
|
16
14
|
children?: ReactNode;
|
|
17
15
|
underline?: boolean;
|
|
18
16
|
};
|
|
19
|
-
|
|
17
|
+
type ButtonElementProps = CommonButtonProps<Exclude<keyof HTMLElementTagNameMap, 'a'>> & {
|
|
18
|
+
as?: Exclude<keyof HTMLElementTagNameMap, 'a'>;
|
|
19
|
+
href?: never;
|
|
20
|
+
};
|
|
21
|
+
type AnchorElementProps = CommonButtonProps<'a'> & {
|
|
22
|
+
as: 'a';
|
|
23
|
+
href: string;
|
|
24
|
+
target?: HTMLAnchorElement['target'];
|
|
25
|
+
};
|
|
26
|
+
export type ButtonProps = ButtonElementProps | AnchorElementProps;
|
|
27
|
+
export type ButtonTheme = 'primary' | 'secondary' | 'secondary-gray' | 'tertiary-gray' | 'tertiary' | 'text' | 'text-gray' | 'text-red' | 'destructive';
|
|
28
|
+
export type ButtonSize = Extract<Size, 'xxs' | 'xs' | 'sm' | 'md'>;
|
|
20
29
|
export declare const svgSize: Record<ButtonSize, number>;
|
|
21
30
|
export declare const iconOnlySvgSize: Record<ButtonSize, number>;
|
|
22
31
|
export declare const dotSize: Record<ButtonSize, DotProps['size']>;
|
|
23
|
-
export declare const Button: import("react").ForwardRefExoticComponent<
|
|
24
|
-
label: ReactNode;
|
|
25
|
-
className?: string | undefined;
|
|
26
|
-
hierarchy?: ButtonTheme | undefined;
|
|
27
|
-
disabled?: boolean | undefined;
|
|
28
|
-
leadingIcon?: SideSlotType | undefined;
|
|
29
|
-
trailingIcon?: SideSlotType | undefined;
|
|
30
|
-
onlyIcon?: boolean | undefined;
|
|
31
|
-
size?: ButtonSize | undefined;
|
|
32
|
-
children?: ReactNode;
|
|
33
|
-
underline?: boolean | undefined;
|
|
34
|
-
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
32
|
+
export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
35
33
|
export {};
|
|
36
34
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, { ComponentProps } from 'react';
|
|
2
|
-
import { Size } from '../../../constant/size';
|
|
3
|
-
import { SideSlotType } from '../../types/side-slot';
|
|
1
|
+
import React, { type ComponentProps } from 'react';
|
|
2
|
+
import type { Size } from '../../../constant/size';
|
|
3
|
+
import type { SideSlotType } from '../../types/side-slot';
|
|
4
4
|
export type ButtonGroupSize = Extract<Size, 'xxs' | 'xs' | 'sm' | 'md'>;
|
|
5
5
|
interface SideCommon {
|
|
6
6
|
position?: 'leading' | 'trailing';
|
|
@@ -107,7 +107,7 @@ export declare const ButtonGroup: {
|
|
|
107
107
|
"aria-description"?: string | undefined;
|
|
108
108
|
"aria-details"?: string | undefined;
|
|
109
109
|
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
110
|
-
"aria-dropeffect"?: "none" | "link" | "
|
|
110
|
+
"aria-dropeffect"?: "none" | "link" | "copy" | "execute" | "move" | "popup" | undefined;
|
|
111
111
|
"aria-errormessage"?: string | undefined;
|
|
112
112
|
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
113
113
|
"aria-flowto"?: string | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Size } from '@ncds/ui/constant/size';
|
|
2
|
-
import { ComponentPropsWithRef, PropsWithChildren } from 'react';
|
|
3
|
-
import { UseFormRegisterReturn } from 'react-hook-form';
|
|
4
|
-
import { OptionChangeHandler, OptionType, OptionValue } from '../../types/dropdown';
|
|
1
|
+
import type { Size } from '@ncds/ui/constant/size';
|
|
2
|
+
import { type ComponentPropsWithRef, type PropsWithChildren } from 'react';
|
|
3
|
+
import type { UseFormRegisterReturn } from 'react-hook-form';
|
|
4
|
+
import type { OptionChangeHandler, OptionType, OptionValue } from '../../types/dropdown';
|
|
5
5
|
export declare const defaultMaxHeight = 275;
|
|
6
6
|
type BaseComboBoxProps = Omit<ComponentPropsWithRef<'div'>, 'size' | 'onChange'>;
|
|
7
7
|
export interface ComboBoxProps extends PropsWithChildren<BaseComboBoxProps> {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { type InputHTMLAttributes } from 'react';
|
|
2
|
-
import type { IconName } from '@ncds/ui-admin-icon/dynamic';
|
|
3
2
|
import type { Size } from '../../../constant/size';
|
|
4
3
|
interface CustomInputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
5
4
|
disabled: boolean;
|
|
6
|
-
iconName:
|
|
5
|
+
iconName: 'calendar' | 'clock';
|
|
7
6
|
iconSize: Extract<Size, 'xs' | 'sm'>;
|
|
8
7
|
placeholder?: string;
|
|
9
8
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
import { Size } from '../../../constant/size';
|
|
3
3
|
import { ColorTone } from '../../../constant/color';
|
|
4
|
-
export type DotColor = ColorTone
|
|
4
|
+
export type DotColor = Extract<ColorTone, 'neutral' | 'error' | 'warning' | 'success' | 'blue' | 'pink' | 'disabled'>;
|
|
5
5
|
export type DotSize = Extract<Size, 'sm' | 'md' | 'lg'>;
|
|
6
6
|
export interface DotProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'color'> {
|
|
7
7
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { SlotIconComponent } from '../../types/side-slot';
|
|
2
2
|
export type AvatarTrigger = {
|
|
3
3
|
type: 'avatar';
|
|
4
4
|
avatar: string;
|
|
@@ -13,7 +13,7 @@ export type ButtonTrigger = {
|
|
|
13
13
|
};
|
|
14
14
|
export type IconTrigger = {
|
|
15
15
|
type: 'icon';
|
|
16
|
-
icon?:
|
|
16
|
+
icon?: SlotIconComponent;
|
|
17
17
|
};
|
|
18
18
|
export type CustomTrigger = {
|
|
19
19
|
type: 'custom';
|
|
@@ -22,7 +22,7 @@ export type CustomTrigger = {
|
|
|
22
22
|
export type DropdownItemType = {
|
|
23
23
|
id: string;
|
|
24
24
|
text: string;
|
|
25
|
-
icon?:
|
|
25
|
+
icon?: SlotIconComponent;
|
|
26
26
|
shortcut?: string;
|
|
27
27
|
onClick?: () => void;
|
|
28
28
|
disabled?: boolean;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type IconName } from '@ncds/ui-admin-icon/dynamic';
|
|
2
1
|
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import type { SlotIconComponent } from '../../types/side-slot';
|
|
3
3
|
export type FeaturedIconTheme = 'light-circle' | 'dark-circle' | 'outline-circle' | 'square-outline';
|
|
4
4
|
export type FeaturedIconColor = 'neutral' | 'error' | 'warning' | 'success';
|
|
5
5
|
export type FeaturedIconSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
6
6
|
export interface FeaturedIconProps extends Omit<ComponentPropsWithoutRef<'div'>, 'color'> {
|
|
7
|
-
|
|
7
|
+
icon: SlotIconComponent;
|
|
8
8
|
theme?: FeaturedIconTheme;
|
|
9
9
|
color?: FeaturedIconColor;
|
|
10
10
|
size?: FeaturedIconSize;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { InvalidFile } from '../file-input/FileInput';
|
|
2
|
-
import { InputBaseProps } from '../input/InputBase';
|
|
1
|
+
import { type InvalidFile } from '../file-input/FileInput';
|
|
2
|
+
import type { InputBaseProps } from '../input/InputBase';
|
|
3
3
|
export interface ImageFileInputProps extends Omit<InputBaseProps, 'clearText' | 'onClearText' | 'hintText' | 'value' | 'onChange'> {
|
|
4
4
|
/**
|
|
5
5
|
* Accepted file types
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { type ElementType } from 'react';
|
|
3
3
|
import { COLOR } from '../../../constant/color';
|
|
4
|
-
import { Size } from '../../../constant/size';
|
|
4
|
+
import type { Size } from '../../../constant/size';
|
|
5
5
|
interface InputSideButtonSlot {
|
|
6
6
|
type: 'button';
|
|
7
7
|
label: string;
|
|
@@ -14,7 +14,7 @@ interface InputSideTextSlot {
|
|
|
14
14
|
}
|
|
15
15
|
interface InputSideIconSlot {
|
|
16
16
|
type: 'icon';
|
|
17
|
-
icon:
|
|
17
|
+
icon: ElementType;
|
|
18
18
|
size?: number | string;
|
|
19
19
|
color?: keyof typeof COLOR;
|
|
20
20
|
className?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type IconName } from '@ncds/ui-admin-icon/dynamic';
|
|
2
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import type { SlotIconComponent } from '../../types/side-slot';
|
|
3
3
|
import { FeaturedIconColor, FeaturedIconTheme } from '../featured-icon';
|
|
4
4
|
export type ModalSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
5
5
|
export type ModalHeaderAlign = 'left' | 'center' | 'horizontal';
|
|
@@ -53,7 +53,7 @@ export type ModalHeaderProps = {
|
|
|
53
53
|
children?: ReactNode;
|
|
54
54
|
onClose: () => void;
|
|
55
55
|
featuredIcon?: {
|
|
56
|
-
|
|
56
|
+
icon: SlotIconComponent;
|
|
57
57
|
color: FeaturedIconColor;
|
|
58
58
|
theme: FeaturedIconTheme;
|
|
59
59
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type IconName } from '@ncds/ui-admin-icon/dynamic';
|
|
2
1
|
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
import type { SlotIconComponent } from '../../types/side-slot';
|
|
3
3
|
import { NotificationAction, NotificationColor } from './Notification';
|
|
4
4
|
export interface MessageNotificationProps extends Omit<ComponentPropsWithoutRef<'div'>, 'title'> {
|
|
5
5
|
/**
|
|
@@ -11,9 +11,9 @@ export interface MessageNotificationProps extends Omit<ComponentPropsWithoutRef<
|
|
|
11
11
|
*/
|
|
12
12
|
supportingText?: ReactNode;
|
|
13
13
|
/**
|
|
14
|
-
* 알림 아이콘
|
|
14
|
+
* 알림 아이콘 컴포넌트 (지정하지 않으면 color에 따라 기본 아이콘 사용)
|
|
15
15
|
*/
|
|
16
|
-
icon?:
|
|
16
|
+
icon?: SlotIconComponent;
|
|
17
17
|
/**
|
|
18
18
|
* 알림 색상 스타일
|
|
19
19
|
* @default 'neutral'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IconName } from '@ncds/ui-admin-icon/dynamic';
|
|
2
1
|
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
import type { SlotIconComponent } from '../../types/side-slot';
|
|
3
3
|
import { ColorTone } from '../../../constant/color';
|
|
4
4
|
import { ButtonTheme } from '../button';
|
|
5
5
|
export type NotificationType = 'floating' | 'full-width' | 'message';
|
|
@@ -34,9 +34,9 @@ export interface NotificationProps extends Omit<ComponentPropsWithoutRef<'div'>,
|
|
|
34
34
|
*/
|
|
35
35
|
supportingText?: ReactNode;
|
|
36
36
|
/**
|
|
37
|
-
* 알림 아이콘
|
|
37
|
+
* 알림 아이콘 컴포넌트 (지정하지 않으면 variant에 따라 기본 아이콘 사용)
|
|
38
38
|
*/
|
|
39
|
-
icon?:
|
|
39
|
+
icon?: SlotIconComponent;
|
|
40
40
|
/**
|
|
41
41
|
* 알림 색상 스타일
|
|
42
42
|
* @default 'neutral'
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
+
import type { SlotIconComponent } from '../../types/side-slot';
|
|
1
2
|
declare const NAV_BUTTON_CONFIG: {
|
|
2
3
|
readonly first: {
|
|
3
4
|
readonly label: "처음";
|
|
4
5
|
readonly className: "ncua-pagination__first";
|
|
5
|
-
readonly getIcon: (
|
|
6
|
+
readonly getIcon: (_isPC: boolean) => SlotIconComponent;
|
|
6
7
|
};
|
|
7
8
|
readonly prev: {
|
|
8
9
|
readonly label: "이전";
|
|
9
10
|
readonly className: "ncua-pagination__before";
|
|
10
|
-
readonly getIcon: (isPC: boolean) =>
|
|
11
|
+
readonly getIcon: (isPC: boolean) => SlotIconComponent;
|
|
11
12
|
};
|
|
12
13
|
readonly next: {
|
|
13
14
|
readonly label: "다음";
|
|
14
15
|
readonly className: "ncua-pagination__next";
|
|
15
|
-
readonly getIcon: (isPC: boolean) =>
|
|
16
|
+
readonly getIcon: (isPC: boolean) => SlotIconComponent;
|
|
16
17
|
};
|
|
17
18
|
readonly last: {
|
|
18
19
|
readonly label: "마지막";
|
|
19
20
|
readonly className: "ncua-pagination__last";
|
|
20
|
-
readonly getIcon: (
|
|
21
|
+
readonly getIcon: (_isPC: boolean) => SlotIconComponent;
|
|
21
22
|
};
|
|
22
23
|
};
|
|
23
24
|
export declare const NavButton: ({ type, breakPoint, noPrev, noNext, onClick, }: {
|
|
@@ -23,6 +23,7 @@ export type SelectDropdownProps = ComponentPropsWithRef<'div'> & {
|
|
|
23
23
|
onComplete?: () => void;
|
|
24
24
|
activeDescendantId?: string;
|
|
25
25
|
componentType?: 'selectbox' | 'combobox';
|
|
26
|
+
align?: 'left' | 'right';
|
|
26
27
|
};
|
|
27
28
|
export declare const SelectDropdown: import("react").ForwardRefExoticComponent<Omit<SelectDropdownProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
28
29
|
//# sourceMappingURL=SelectDropdown.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ComponentPropsWithRef, PropsWithChildren } from 'react';
|
|
1
|
+
import { type ComponentPropsWithRef, type PropsWithChildren } from 'react';
|
|
2
2
|
import type { UseFormRegisterReturn } from 'react-hook-form';
|
|
3
3
|
import type { Size } from '../../../constant/size';
|
|
4
|
-
import { OptionChangeHandler, OptionType, OptionValue } from '../../types/dropdown';
|
|
4
|
+
import type { OptionChangeHandler, OptionType, OptionValue } from '../../types/dropdown';
|
|
5
5
|
export declare const DEFAULT_MAX_HEIGHT = 275;
|
|
6
6
|
type BaseSelectBoxProps = Omit<ComponentPropsWithRef<'div'>, 'size' | 'onChange'>;
|
|
7
7
|
export type SelectBoxProps = PropsWithChildren<BaseSelectBoxProps> & {
|
|
@@ -10,6 +10,7 @@ export type SelectBoxProps = PropsWithChildren<BaseSelectBoxProps> & {
|
|
|
10
10
|
hintText?: string;
|
|
11
11
|
destructive?: boolean;
|
|
12
12
|
size?: Extract<Size, 'xs' | 'sm' | 'md'>;
|
|
13
|
+
autoWidth?: boolean;
|
|
13
14
|
type?: 'default' | 'simple';
|
|
14
15
|
optionItems?: OptionType[];
|
|
15
16
|
value?: OptionValue;
|
|
@@ -19,6 +20,7 @@ export type SelectBoxProps = PropsWithChildren<BaseSelectBoxProps> & {
|
|
|
19
20
|
maxHeight?: number;
|
|
20
21
|
multiple?: boolean;
|
|
21
22
|
onEdit?: () => void;
|
|
23
|
+
align?: 'left' | 'right';
|
|
22
24
|
};
|
|
23
25
|
export declare const SelectBox: import("react").ForwardRefExoticComponent<Omit<SelectBoxProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
24
26
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnchorHTMLAttributes, ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { BadgeProps } from '../badge/Badge';
|
|
1
|
+
import type { AnchorHTMLAttributes, ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { type BadgeProps } from '../badge/Badge';
|
|
3
3
|
export type TabSize = 'sm' | 'md' | 'lg';
|
|
4
4
|
export type TabType = 'button-primary' | 'button-white' | 'underline' | 'underline-fill' | 'line-vertical';
|
|
5
5
|
type BaseTabButtonProps = {
|
|
@@ -3161,6 +3161,10 @@ button {
|
|
|
3161
3161
|
.ncua-select-dropdown--up {
|
|
3162
3162
|
bottom: calc(100% + 4px);
|
|
3163
3163
|
}
|
|
3164
|
+
.ncua-select-dropdown--align-right {
|
|
3165
|
+
left: initial;
|
|
3166
|
+
right: 0;
|
|
3167
|
+
}
|
|
3164
3168
|
.ncua-select-dropdown__content {
|
|
3165
3169
|
padding: 8px 6px;
|
|
3166
3170
|
}
|
|
@@ -3194,6 +3198,10 @@ button {
|
|
|
3194
3198
|
transition: background-color 0.15s ease, color 0.15s ease;
|
|
3195
3199
|
position: relative;
|
|
3196
3200
|
border-radius: 6px;
|
|
3201
|
+
display: flex;
|
|
3202
|
+
align-items: center;
|
|
3203
|
+
gap: 8px;
|
|
3204
|
+
color: var(--gray-600);
|
|
3197
3205
|
}
|
|
3198
3206
|
.ncua-select-dropdown__option:hover, .ncua-select-dropdown__option--focused {
|
|
3199
3207
|
background-color: var(--gray-50);
|
|
@@ -3201,10 +3209,15 @@ button {
|
|
|
3201
3209
|
.ncua-select-dropdown__option--selected {
|
|
3202
3210
|
background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 24 24' stroke='none'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M20.707 5.293a1 1 0 0 1 0 1.414l-11 11a1 1 0 0 1-1.414 0l-5-5a1 1 0 1 1 1.414-1.414L9 15.586 19.293 5.293a1 1 0 0 1 1.414 0' clip-rule='evenodd'/%3E%3C/svg%3E") no-repeat right 8px center;
|
|
3203
3211
|
}
|
|
3204
|
-
.ncua-select-
|
|
3212
|
+
.ncua-select-dropdown__option-icon {
|
|
3213
|
+
display: flex;
|
|
3214
|
+
align-items: center;
|
|
3215
|
+
justify-content: center;
|
|
3216
|
+
color: currentColor;
|
|
3217
|
+
}
|
|
3218
|
+
.ncua-select-dropdown__option-text {
|
|
3205
3219
|
display: inline-block;
|
|
3206
3220
|
max-width: 327px;
|
|
3207
|
-
color: var(--gray-600);
|
|
3208
3221
|
white-space: nowrap;
|
|
3209
3222
|
overflow: hidden;
|
|
3210
3223
|
text-overflow: ellipsis;
|
|
@@ -3280,6 +3293,17 @@ button {
|
|
|
3280
3293
|
content: attr(data-placeholder);
|
|
3281
3294
|
color: var(--gray-400);
|
|
3282
3295
|
}
|
|
3296
|
+
.ncua-selectbox__value-container {
|
|
3297
|
+
display: flex;
|
|
3298
|
+
align-items: center;
|
|
3299
|
+
gap: 4px;
|
|
3300
|
+
}
|
|
3301
|
+
.ncua-selectbox__value-icon {
|
|
3302
|
+
display: flex;
|
|
3303
|
+
align-items: center;
|
|
3304
|
+
justify-content: center;
|
|
3305
|
+
color: currentColor;
|
|
3306
|
+
}
|
|
3283
3307
|
.ncua-selectbox__chevron {
|
|
3284
3308
|
position: absolute;
|
|
3285
3309
|
right: 8px;
|