@ncds/ui-admin 1.5.4 → 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/date-picker/DatePicker.js +3 -2
- package/dist/cjs/src/components/dropdown/Dropdown.js +14 -15
- 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 +24 -24
- package/dist/cjs/src/components/input/PasswordInput.js +1 -1
- package/dist/cjs/src/components/modal/Modal.js +7 -5
- 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 +12 -11
- package/dist/cjs/src/components/select-dropdown/SelectDropdown.js +14 -4
- package/dist/cjs/src/components/selectbox/SelectBox.js +62 -39
- 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/date-picker/DatePicker.js +3 -2
- package/dist/esm/src/components/dropdown/Dropdown.js +14 -14
- 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 +24 -24
- package/dist/esm/src/components/input/PasswordInput.js +2 -2
- package/dist/esm/src/components/modal/Modal.js +7 -5
- 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 +11 -10
- package/dist/esm/src/components/select-dropdown/SelectDropdown.js +14 -4
- package/dist/esm/src/components/selectbox/SelectBox.js +62 -39
- package/dist/esm/src/components/tab/TabButton.js +2 -3
- package/dist/esm/src/components/tag/Tag.js +5 -6
- package/dist/types/src/components/badge/BadgeGroup.d.ts +4 -4
- package/dist/types/src/components/badge/utils.d.ts +2 -2
- package/dist/types/src/components/button/Button.d.ts +18 -20
- package/dist/types/src/components/button/ButtonCloseX.d.ts +1 -1
- package/dist/types/src/components/button/ButtonGroup.d.ts +6 -6
- 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/date-picker/DatePicker.d.ts +1 -0
- package/dist/types/src/components/dot/Dot.d.ts +1 -1
- package/dist/types/src/components/dropdown/Dropdown.d.ts +4 -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 +6 -4
- 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 +6 -4
- package/dist/types/src/components/tab/TabButton.d.ts +3 -3
- package/dist/types/src/components/tag/Tag.d.ts +3 -3
- 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 +35 -5
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.MessageNotification = void 0;
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
-
var
|
|
8
|
+
var _uiAdminIcon = require("@ncds/ui-admin-icon");
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
var _color = require("../../../constant/color");
|
|
@@ -30,11 +30,11 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
30
30
|
}
|
|
31
31
|
return t;
|
|
32
32
|
};
|
|
33
|
-
var
|
|
34
|
-
neutral:
|
|
35
|
-
error:
|
|
36
|
-
warning:
|
|
37
|
-
success:
|
|
33
|
+
var iconMap = {
|
|
34
|
+
neutral: _uiAdminIcon.Pin02,
|
|
35
|
+
error: _uiAdminIcon.AlertTriangle,
|
|
36
|
+
warning: _uiAdminIcon.AlertCircle,
|
|
37
|
+
success: _uiAdminIcon.CheckCircle
|
|
38
38
|
};
|
|
39
39
|
var iconColorMap = {
|
|
40
40
|
neutral: 'gray700',
|
|
@@ -45,7 +45,7 @@ var iconColorMap = {
|
|
|
45
45
|
var MessageNotification = exports.MessageNotification = /*#__PURE__*/(0, _react.forwardRef)(function (_a, ref) {
|
|
46
46
|
var title = _a.title,
|
|
47
47
|
supportingText = _a.supportingText,
|
|
48
|
-
|
|
48
|
+
Icon = _a.icon,
|
|
49
49
|
_b = _a.color,
|
|
50
50
|
color = _b === void 0 ? 'neutral' : _b,
|
|
51
51
|
onClose = _a.onClose,
|
|
@@ -57,7 +57,7 @@ var MessageNotification = exports.MessageNotification = /*#__PURE__*/(0, _react.
|
|
|
57
57
|
var validColor = color === 'info' ? 'neutral' : color;
|
|
58
58
|
var iconColor = validColor;
|
|
59
59
|
var featuredIconProps = {
|
|
60
|
-
|
|
60
|
+
icon: Icon || iconMap[validColor] || _uiAdminIcon.Pin02,
|
|
61
61
|
size: 'lg',
|
|
62
62
|
color: iconColor,
|
|
63
63
|
theme: 'light-circle'
|
|
@@ -77,7 +77,7 @@ var MessageNotification = exports.MessageNotification = /*#__PURE__*/(0, _react.
|
|
|
77
77
|
children: [(0, _jsxRuntime.jsxs)("div", __assign({
|
|
78
78
|
className: "ncua-message-notification__content-wrapper"
|
|
79
79
|
}, {
|
|
80
|
-
children: [
|
|
80
|
+
children: [iconMap[validColor] && (0, _jsxRuntime.jsx)(_FeaturedIcon.FeaturedIcon, __assign({}, featuredIconProps, {
|
|
81
81
|
className: "ncua-message-notification__icon"
|
|
82
82
|
})), (0, _jsxRuntime.jsxs)("div", __assign({
|
|
83
83
|
className: "ncua-message-notification__text-container"
|
|
@@ -112,7 +112,7 @@ var MessageNotification = exports.MessageNotification = /*#__PURE__*/(0, _react.
|
|
|
112
112
|
}, {
|
|
113
113
|
children: [onHidePermanently && (0, _jsxRuntime.jsx)("button", __assign({
|
|
114
114
|
type: "button",
|
|
115
|
-
className: (0, _classnames.default)('ncua-notification__action-button', 'ncua-notification__action-button--
|
|
115
|
+
className: (0, _classnames.default)('ncua-notification__action-button', 'ncua-notification__action-button--link', 'ncua-message-notification__hide-link'),
|
|
116
116
|
onClick: onHidePermanently
|
|
117
117
|
}, {
|
|
118
118
|
children: "\uB2E4\uC2DC \uBCF4\uC9C0 \uC54A\uAE30"
|
|
@@ -122,8 +122,7 @@ var MessageNotification = exports.MessageNotification = /*#__PURE__*/(0, _react.
|
|
|
122
122
|
onClick: onClose,
|
|
123
123
|
"aria-label": "\uC54C\uB9BC \uB2EB\uAE30"
|
|
124
124
|
}, {
|
|
125
|
-
children: (0, _jsxRuntime.jsx)(
|
|
126
|
-
name: "x-close",
|
|
125
|
+
children: (0, _jsxRuntime.jsx)(_uiAdminIcon.XClose, {
|
|
127
126
|
width: 20,
|
|
128
127
|
height: 20,
|
|
129
128
|
color: closeIconColor
|
|
@@ -5,7 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.NavButton = void 0;
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
-
var
|
|
8
|
+
var _uiAdminIcon = require("@ncds/ui-admin-icon");
|
|
9
|
+
var _button = require("../button");
|
|
9
10
|
var __assign = void 0 && (void 0).__assign || function () {
|
|
10
11
|
__assign = Object.assign || function (t) {
|
|
11
12
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -20,29 +21,29 @@ var NAV_BUTTON_CONFIG = {
|
|
|
20
21
|
first: {
|
|
21
22
|
label: '처음',
|
|
22
23
|
className: 'ncua-pagination__first',
|
|
23
|
-
getIcon: function (
|
|
24
|
-
return
|
|
24
|
+
getIcon: function (_isPC) {
|
|
25
|
+
return _uiAdminIcon.ChevronLeftDouble;
|
|
25
26
|
}
|
|
26
27
|
},
|
|
27
28
|
prev: {
|
|
28
29
|
label: '이전',
|
|
29
30
|
className: 'ncua-pagination__before',
|
|
30
31
|
getIcon: function (isPC) {
|
|
31
|
-
return isPC ?
|
|
32
|
+
return isPC ? _uiAdminIcon.ChevronLeft : _uiAdminIcon.ArrowLeft;
|
|
32
33
|
}
|
|
33
34
|
},
|
|
34
35
|
next: {
|
|
35
36
|
label: '다음',
|
|
36
37
|
className: 'ncua-pagination__next',
|
|
37
38
|
getIcon: function (isPC) {
|
|
38
|
-
return isPC ?
|
|
39
|
+
return isPC ? _uiAdminIcon.ChevronRight : _uiAdminIcon.ArrowRight;
|
|
39
40
|
}
|
|
40
41
|
},
|
|
41
42
|
last: {
|
|
42
43
|
label: '마지막',
|
|
43
44
|
className: 'ncua-pagination__last',
|
|
44
|
-
getIcon: function (
|
|
45
|
-
return
|
|
45
|
+
getIcon: function (_isPC) {
|
|
46
|
+
return _uiAdminIcon.ChevronRightDouble;
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
};
|
|
@@ -56,7 +57,7 @@ var NavButton = function (_a) {
|
|
|
56
57
|
var isNavigationButton = type === 'first' || type === 'prev' || type === 'next' || type === 'last';
|
|
57
58
|
var isFirstOrPrev = type === 'first' || type === 'prev';
|
|
58
59
|
var isNextOrLast = type === 'next' || type === 'last';
|
|
59
|
-
var disabled = isFirstOrPrev ? noPrev : isNextOrLast ? noNext : false;
|
|
60
|
+
var disabled = (isFirstOrPrev ? noPrev : false) || (isNextOrLast ? noNext : false);
|
|
60
61
|
var isPC = breakPoint === 'pc';
|
|
61
62
|
// key를 제외한 공통 props
|
|
62
63
|
var buttonProps = {
|
|
@@ -66,8 +67,8 @@ var NavButton = function (_a) {
|
|
|
66
67
|
leadingIcon: {
|
|
67
68
|
type: 'icon',
|
|
68
69
|
icon: config.getIcon(isPC),
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
size: isPC ? 16 : 20,
|
|
71
|
+
color: disabled ? 'gray200' : 'gray700'
|
|
71
72
|
},
|
|
72
73
|
hierarchy: 'secondary-gray',
|
|
73
74
|
size: isPC ? 'xs' : 'sm',
|
|
@@ -76,6 +77,6 @@ var NavButton = function (_a) {
|
|
|
76
77
|
};
|
|
77
78
|
// key 값 별도 계산
|
|
78
79
|
var buttonKey = isNavigationButton ? "".concat(breakPoint, "-").concat(type) : undefined;
|
|
79
|
-
return (0, _jsxRuntime.jsx)(
|
|
80
|
+
return (0, _jsxRuntime.jsx)(_button.Button, __assign({}, buttonProps), buttonKey);
|
|
80
81
|
};
|
|
81
82
|
exports.NavButton = NavButton;
|
|
@@ -56,12 +56,15 @@ var SelectDropdown = exports.SelectDropdown = /*#__PURE__*/(0, _react.forwardRef
|
|
|
56
56
|
className = _a.className,
|
|
57
57
|
activeDescendantId = _a.activeDescendantId,
|
|
58
58
|
componentType = _a.componentType,
|
|
59
|
-
|
|
59
|
+
_h = _a.align,
|
|
60
|
+
align = _h === void 0 ? 'left' : _h,
|
|
61
|
+
props = __rest(_a, ["isOpen", "direction", "size", "options", "value", "focusedIndex", "maxHeight", "listboxId", "onOptionSelect", "onMouseMove", "isKeyboardNavigation", "onOptionHover", "children", "multiple", "showFooterButtons", "selectAllButtonText", "onSelectAll", "onEdit", "onComplete", "className", "activeDescendantId", "componentType", "align"]);
|
|
60
62
|
if (!isOpen) return null;
|
|
61
63
|
return (0, _jsxRuntime.jsxs)("div", __assign({
|
|
62
64
|
ref: ref,
|
|
63
65
|
className: (0, _classnames.default)('ncua-select-dropdown', "ncua-select-dropdown--".concat(direction), "ncua-select-dropdown--".concat(size), {
|
|
64
66
|
'ncua-select-dropdown--multiple': multiple,
|
|
67
|
+
'ncua-select-dropdown--align-right': align === 'right',
|
|
65
68
|
'ncua-select-dropdown--selectbox-single': componentType === 'selectbox' && !multiple
|
|
66
69
|
}, className),
|
|
67
70
|
onMouseMove: onMouseMove,
|
|
@@ -87,7 +90,7 @@ var SelectDropdown = exports.SelectDropdown = /*#__PURE__*/(0, _react.forwardRef
|
|
|
87
90
|
var handleMouseEnter = function () {
|
|
88
91
|
onOptionHover === null || onOptionHover === void 0 ? void 0 : onOptionHover(index);
|
|
89
92
|
};
|
|
90
|
-
return (0, _jsxRuntime.
|
|
93
|
+
return (0, _jsxRuntime.jsxs)("li", __assign({
|
|
91
94
|
id: optionId,
|
|
92
95
|
className: (0, _classnames.default)('ncua-select-dropdown__option', {
|
|
93
96
|
'ncua-select-dropdown__option--selected': isSelected,
|
|
@@ -100,11 +103,18 @@ var SelectDropdown = exports.SelectDropdown = /*#__PURE__*/(0, _react.forwardRef
|
|
|
100
103
|
role: "option",
|
|
101
104
|
"aria-selected": isSelected
|
|
102
105
|
}, {
|
|
103
|
-
children: (0, _jsxRuntime.jsx)("span", __assign({
|
|
106
|
+
children: [option.icon && (0, _jsxRuntime.jsx)("span", __assign({
|
|
107
|
+
className: "ncua-select-dropdown__option-icon"
|
|
108
|
+
}, {
|
|
109
|
+
children: (0, _jsxRuntime.jsx)(option.icon, {
|
|
110
|
+
width: 16,
|
|
111
|
+
height: 16
|
|
112
|
+
})
|
|
113
|
+
})), (0, _jsxRuntime.jsx)("span", __assign({
|
|
104
114
|
className: "ncua-select-dropdown__option-text"
|
|
105
115
|
}, {
|
|
106
116
|
children: option.label
|
|
107
|
-
}))
|
|
117
|
+
}))]
|
|
108
118
|
}), option.id);
|
|
109
119
|
}), children]
|
|
110
120
|
}))
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.SelectBox = exports.DEFAULT_MAX_HEIGHT = void 0;
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
-
var
|
|
9
|
-
var _color = require("
|
|
8
|
+
var _uiAdminIcon = require("@ncds/ui-admin-icon");
|
|
9
|
+
var _color = require("../../../constant/color");
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
var _react = require("react");
|
|
12
12
|
var _dropdown = require("../../hooks/dropdown");
|
|
@@ -53,29 +53,33 @@ var SelectBox = exports.SelectBox = /*#__PURE__*/(0, _react.forwardRef)(function
|
|
|
53
53
|
size = _d === void 0 ? 'xs' : _d,
|
|
54
54
|
_e = _a.type,
|
|
55
55
|
type = _e === void 0 ? 'default' : _e,
|
|
56
|
-
_f = _a.
|
|
57
|
-
|
|
56
|
+
_f = _a.autoWidth,
|
|
57
|
+
autoWidth = _f === void 0 ? true : _f,
|
|
58
|
+
_g = _a.destructive,
|
|
59
|
+
destructive = _g === void 0 ? false : _g,
|
|
58
60
|
value = _a.value,
|
|
59
|
-
|
|
60
|
-
optionItems =
|
|
61
|
-
|
|
62
|
-
disabled =
|
|
63
|
-
|
|
64
|
-
maxHeight =
|
|
65
|
-
|
|
66
|
-
multiple =
|
|
61
|
+
_h = _a.optionItems,
|
|
62
|
+
optionItems = _h === void 0 ? [] : _h,
|
|
63
|
+
_j = _a.disabled,
|
|
64
|
+
disabled = _j === void 0 ? false : _j,
|
|
65
|
+
_k = _a.maxHeight,
|
|
66
|
+
maxHeight = _k === void 0 ? DEFAULT_MAX_HEIGHT : _k,
|
|
67
|
+
_l = _a.multiple,
|
|
68
|
+
multiple = _l === void 0 ? false : _l,
|
|
69
|
+
_m = _a.align,
|
|
70
|
+
align = _m === void 0 ? 'left' : _m,
|
|
67
71
|
id = _a.id,
|
|
68
72
|
className = _a.className,
|
|
69
73
|
children = _a.children,
|
|
70
74
|
register = _a.register,
|
|
71
75
|
onChange = _a.onChange,
|
|
72
76
|
onEdit = _a.onEdit,
|
|
73
|
-
props = __rest(_a, ["placeholder", "disabledPlaceholder", "hintText", "size", "type", "destructive", "value", "optionItems", "disabled", "maxHeight", "multiple", "id", "className", "children", "register", "onChange", "onEdit"]);
|
|
77
|
+
props = __rest(_a, ["placeholder", "disabledPlaceholder", "hintText", "size", "type", "autoWidth", "destructive", "value", "optionItems", "disabled", "maxHeight", "multiple", "align", "id", "className", "children", "register", "onChange", "onEdit"]);
|
|
74
78
|
var internalRef = (0, _react.useRef)(null);
|
|
75
79
|
var dropdownRef = (0, _react.useRef)(null);
|
|
76
|
-
var
|
|
77
|
-
selectedTags =
|
|
78
|
-
setSelectedTags =
|
|
80
|
+
var _o = (0, _react.useState)([]),
|
|
81
|
+
selectedTags = _o[0],
|
|
82
|
+
setSelectedTags = _o[1];
|
|
79
83
|
var selectedOption = (0, _react.useMemo)(function () {
|
|
80
84
|
if (multiple) return null;
|
|
81
85
|
return optionItems.find(function (option) {
|
|
@@ -86,7 +90,7 @@ var SelectBox = exports.SelectBox = /*#__PURE__*/(0, _react.forwardRef)(function
|
|
|
86
90
|
if (multiple) {
|
|
87
91
|
return placeholder;
|
|
88
92
|
}
|
|
89
|
-
return selectedOption ? selectedOption
|
|
93
|
+
return selectedOption ? selectedOption : placeholder;
|
|
90
94
|
}, [multiple, selectedOption, placeholder]);
|
|
91
95
|
var handleOptionSelect = function (option) {
|
|
92
96
|
if (disabled) return;
|
|
@@ -114,7 +118,7 @@ var SelectBox = exports.SelectBox = /*#__PURE__*/(0, _react.forwardRef)(function
|
|
|
114
118
|
});
|
|
115
119
|
}
|
|
116
120
|
};
|
|
117
|
-
var
|
|
121
|
+
var _p = (0, _dropdown.useDropdown)({
|
|
118
122
|
triggerRef: internalRef,
|
|
119
123
|
dropdownRef: dropdownRef,
|
|
120
124
|
maxHeight: maxHeight,
|
|
@@ -124,16 +128,16 @@ var SelectBox = exports.SelectBox = /*#__PURE__*/(0, _react.forwardRef)(function
|
|
|
124
128
|
multiple: multiple,
|
|
125
129
|
onSelect: handleOptionSelect
|
|
126
130
|
}),
|
|
127
|
-
isOpen =
|
|
128
|
-
dropdownDirection =
|
|
129
|
-
focusedIndex =
|
|
130
|
-
toggleDropdown =
|
|
131
|
-
closeDropdown =
|
|
132
|
-
handleKeyDown =
|
|
133
|
-
handleDropdownSelect =
|
|
134
|
-
handleMouseMove =
|
|
135
|
-
isKeyboardNavigation =
|
|
136
|
-
setFocusedIndex =
|
|
131
|
+
isOpen = _p.isOpen,
|
|
132
|
+
dropdownDirection = _p.direction,
|
|
133
|
+
focusedIndex = _p.focusedIndex,
|
|
134
|
+
toggleDropdown = _p.toggleDropdown,
|
|
135
|
+
closeDropdown = _p.closeDropdown,
|
|
136
|
+
handleKeyDown = _p.handleKeyDown,
|
|
137
|
+
handleDropdownSelect = _p.handleOptionSelect,
|
|
138
|
+
handleMouseMove = _p.handleMouseMove,
|
|
139
|
+
isKeyboardNavigation = _p.isKeyboardNavigation,
|
|
140
|
+
setFocusedIndex = _p.setFocusedIndex;
|
|
137
141
|
var activeDescendantId = (0, _react.useMemo)(function () {
|
|
138
142
|
if (!isOpen || focusedIndex < 0 || focusedIndex >= optionItems.length) {
|
|
139
143
|
return undefined;
|
|
@@ -147,11 +151,11 @@ var SelectBox = exports.SelectBox = /*#__PURE__*/(0, _react.forwardRef)(function
|
|
|
147
151
|
}, [handleMouseMove, setFocusedIndex]);
|
|
148
152
|
// Multiple select 관련 로직
|
|
149
153
|
var currentSelectedValues = multiple && Array.isArray(value) ? value : [];
|
|
150
|
-
var
|
|
151
|
-
selectAllButtonText =
|
|
152
|
-
toggleSelectAll =
|
|
153
|
-
getSelectedTagsData =
|
|
154
|
-
removeTag =
|
|
154
|
+
var _q = (0, _multiSelect.useMultiSelect)(currentSelectedValues, optionItems),
|
|
155
|
+
selectAllButtonText = _q.buttonText,
|
|
156
|
+
toggleSelectAll = _q.toggleSelectAll,
|
|
157
|
+
getSelectedTagsData = _q.getSelectedTagsData,
|
|
158
|
+
removeTag = _q.removeTag;
|
|
155
159
|
var handleSelectAll = function () {
|
|
156
160
|
if (!multiple || !onChange) return;
|
|
157
161
|
var newSelectedValues = toggleSelectAll();
|
|
@@ -181,11 +185,11 @@ var SelectBox = exports.SelectBox = /*#__PURE__*/(0, _react.forwardRef)(function
|
|
|
181
185
|
};
|
|
182
186
|
(0, _dropdown.useScrollLock)(isOpen, dropdownRef);
|
|
183
187
|
(0, _react.useLayoutEffect)(function () {
|
|
184
|
-
if (isOpen && dropdownRef.current && internalRef.current) {
|
|
188
|
+
if (autoWidth && isOpen && dropdownRef.current && internalRef.current) {
|
|
185
189
|
var dropdownWidth = dropdownRef.current.offsetWidth;
|
|
186
190
|
internalRef.current.style.width = "".concat(dropdownWidth, "px");
|
|
187
191
|
}
|
|
188
|
-
}, [isOpen, optionItems]);
|
|
192
|
+
}, [autoWidth, isOpen, optionItems]);
|
|
189
193
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
190
194
|
return internalRef.current;
|
|
191
195
|
}, []);
|
|
@@ -216,12 +220,30 @@ var SelectBox = exports.SelectBox = /*#__PURE__*/(0, _react.forwardRef)(function
|
|
|
216
220
|
children: [(0, _jsxRuntime.jsxs)("div", __assign({
|
|
217
221
|
className: "ncua-selectbox__content-inner"
|
|
218
222
|
}, {
|
|
219
|
-
children: [(0, _jsxRuntime.jsx)("
|
|
223
|
+
children: [(0, _jsxRuntime.jsx)("div", __assign({
|
|
220
224
|
className: "ncua-selectbox__value"
|
|
221
225
|
}, {
|
|
222
|
-
children: displayValue
|
|
223
|
-
|
|
224
|
-
|
|
226
|
+
children: typeof displayValue === 'string' ? (0, _jsxRuntime.jsx)("span", __assign({
|
|
227
|
+
className: "ncua-selectbox__value-text"
|
|
228
|
+
}, {
|
|
229
|
+
children: displayValue
|
|
230
|
+
})) : (0, _jsxRuntime.jsxs)("div", __assign({
|
|
231
|
+
className: "ncua-selectbox__value-container"
|
|
232
|
+
}, {
|
|
233
|
+
children: [displayValue.icon && (0, _jsxRuntime.jsx)("span", __assign({
|
|
234
|
+
className: "ncua-selectbox__value-icon"
|
|
235
|
+
}, {
|
|
236
|
+
children: (0, _jsxRuntime.jsx)(displayValue.icon, {
|
|
237
|
+
width: 16,
|
|
238
|
+
height: 16
|
|
239
|
+
})
|
|
240
|
+
})), (0, _jsxRuntime.jsx)("span", __assign({
|
|
241
|
+
className: "ncua-selectbox__value-text"
|
|
242
|
+
}, {
|
|
243
|
+
children: displayValue.label
|
|
244
|
+
}))]
|
|
245
|
+
}))
|
|
246
|
+
})), (0, _jsxRuntime.jsx)(_uiAdminIcon.ChevronDown, {
|
|
225
247
|
width: size === 'xs' ? 14 : 16,
|
|
226
248
|
height: size === 'xs' ? 14 : 16,
|
|
227
249
|
color: disabled ? _color.COLOR.gray300 : _color.COLOR.gray500,
|
|
@@ -245,6 +267,7 @@ var SelectBox = exports.SelectBox = /*#__PURE__*/(0, _react.forwardRef)(function
|
|
|
245
267
|
componentType: "selectbox",
|
|
246
268
|
isKeyboardNavigation: isKeyboardNavigation,
|
|
247
269
|
activeDescendantId: activeDescendantId,
|
|
270
|
+
align: align,
|
|
248
271
|
onOptionSelect: handleDropdownSelect,
|
|
249
272
|
onMouseMove: handleMouseMove,
|
|
250
273
|
onOptionHover: handleOptionHover,
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.TabButton = void 0;
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
+
var _uiAdminIcon = require("@ncds/ui-admin-icon");
|
|
8
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
10
|
var _Badge = require("../badge/Badge");
|
|
10
|
-
var _dynamic = _interopRequireDefault(require("@ncds/ui-admin-icon/dynamic"));
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
12
|
var __assign = void 0 && (void 0).__assign || function () {
|
|
13
13
|
__assign = Object.assign || function (t) {
|
|
@@ -82,8 +82,7 @@ var TabButton = function (_a) {
|
|
|
82
82
|
return onClose === null || onClose === void 0 ? void 0 : onClose(id !== null && id !== void 0 ? id : '');
|
|
83
83
|
}
|
|
84
84
|
}, {
|
|
85
|
-
children: (0, _jsxRuntime.jsx)(
|
|
86
|
-
name: "x-close",
|
|
85
|
+
children: (0, _jsxRuntime.jsx)(_uiAdminIcon.XClose, {
|
|
87
86
|
width: 14,
|
|
88
87
|
height: 14
|
|
89
88
|
})
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Tag = void 0;
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
-
var
|
|
8
|
+
var _uiAdminIcon = require("@ncds/ui-admin-icon");
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
var _color = require("../../../constant/color");
|
|
@@ -110,8 +110,8 @@ var Tag = function (_a) {
|
|
|
110
110
|
var sideSlotRender = function (slot) {
|
|
111
111
|
var _a;
|
|
112
112
|
if (slot.type === 'icon') {
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
var SlotIcon = slot.icon;
|
|
114
|
+
return (0, _jsxRuntime.jsx)(SlotIcon, {
|
|
115
115
|
width: iconSize[size],
|
|
116
116
|
height: iconSize[size],
|
|
117
117
|
color: slot.color
|
|
@@ -146,8 +146,7 @@ var Tag = function (_a) {
|
|
|
146
146
|
className: "ncua-tag__close",
|
|
147
147
|
onClick: onButtonClick
|
|
148
148
|
}, {
|
|
149
|
-
children: (0, _jsxRuntime.jsx)(
|
|
150
|
-
name: "x-close",
|
|
149
|
+
children: (0, _jsxRuntime.jsx)(_uiAdminIcon.XClose, {
|
|
151
150
|
color: _color.COLOR.gray300,
|
|
152
151
|
width: iconSize[size],
|
|
153
152
|
height: iconSize[size]
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import Icon from '@ncds/ui-admin-icon/dynamic';
|
|
3
2
|
import { COLOR } from '../../../constant/color';
|
|
4
3
|
import { Dot } from '../dot/Dot';
|
|
5
4
|
var DEFAULT_DOT_COLOR = 'neutral';
|
|
@@ -8,8 +7,8 @@ export var sideSlotRender = function (_a) {
|
|
|
8
7
|
var slot = _a.slot,
|
|
9
8
|
defaultIconSize = _a.defaultIconSize;
|
|
10
9
|
if (slot.type === 'icon') {
|
|
10
|
+
var Icon = slot.icon;
|
|
11
11
|
return _jsx(Icon, {
|
|
12
|
-
name: slot.icon,
|
|
13
12
|
height: (_b = slot.size) !== null && _b !== void 0 ? _b : defaultIconSize,
|
|
14
13
|
width: (_c = slot.size) !== null && _c !== void 0 ? _c : defaultIconSize,
|
|
15
14
|
color: slot.color ? COLOR[slot.color] : undefined
|
|
@@ -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 } from "react/jsx-runtime";
|
|
12
|
-
import
|
|
12
|
+
import { Home01 } from '@ncds/ui-admin-icon';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
14
|
var BreadcrumbItem = function (_a) {
|
|
15
15
|
var href = _a.href,
|
|
@@ -28,8 +28,7 @@ export var BreadCrumb = function (_a) {
|
|
|
28
28
|
if (!items || items.length === 0) return null;
|
|
29
29
|
var renderItem = function (item, index) {
|
|
30
30
|
var isLast = index === items.length - 1;
|
|
31
|
-
var content = index === 0 ? _jsx(
|
|
32
|
-
name: "home-01",
|
|
31
|
+
var content = index === 0 ? _jsx(Home01, {
|
|
33
32
|
width: 16,
|
|
34
33
|
height: 16,
|
|
35
34
|
color: "gray500"
|
|
@@ -17,9 +17,8 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
17
17
|
return t;
|
|
18
18
|
};
|
|
19
19
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
-
import { createElement, forwardRef } from 'react';
|
|
21
|
-
import Icon from '@ncds/ui-admin-icon/dynamic';
|
|
22
20
|
import classnames from 'classnames';
|
|
21
|
+
import { createElement, forwardRef } from 'react';
|
|
23
22
|
import { COLOR } from '../../../constant/color';
|
|
24
23
|
import { Dot } from '../dot';
|
|
25
24
|
export var svgSize = {
|
|
@@ -58,10 +57,10 @@ export var Button = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
58
57
|
restProps = __rest(props, ["size", "children", "onlyIcon", "disabled", "className", "hierarchy", "label", "leadingIcon", "trailingIcon", "underline"]);
|
|
59
58
|
var sideSlotRender = function (slot) {
|
|
60
59
|
var _a, _b, _c;
|
|
60
|
+
var iconSize = onlyIcon ? iconOnlySvgSize[size] : svgSize[size];
|
|
61
61
|
if (slot.type === 'icon') {
|
|
62
|
-
var
|
|
62
|
+
var Icon = slot.icon;
|
|
63
63
|
return _jsx(Icon, {
|
|
64
|
-
name: slot.icon,
|
|
65
64
|
height: (_a = slot.size) !== null && _a !== void 0 ? _a : iconSize,
|
|
66
65
|
width: (_b = slot.size) !== null && _b !== void 0 ? _b : iconSize,
|
|
67
66
|
color: slot.color ? COLOR[slot.color] : undefined
|
|
@@ -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 } from "react/jsx-runtime";
|
|
12
|
-
import
|
|
12
|
+
import { XClose } from '@ncds/ui-admin-icon';
|
|
13
13
|
import classnames from 'classnames';
|
|
14
14
|
var svgSize = {
|
|
15
15
|
xs: 16,
|
|
@@ -24,11 +24,11 @@ export var ButtonCloseX = function (_a) {
|
|
|
24
24
|
className = _a.className,
|
|
25
25
|
onClick = _a.onClick;
|
|
26
26
|
return _jsx("button", __assign({
|
|
27
|
+
type: "button",
|
|
27
28
|
className: classnames('ncua-button-close-x', "ncua-button-close-x--".concat(size), "ncua-button-close-x--".concat(theme), className),
|
|
28
29
|
onClick: onClick
|
|
29
30
|
}, {
|
|
30
|
-
children: _jsx(
|
|
31
|
-
name: "x-close",
|
|
31
|
+
children: _jsx(XClose, {
|
|
32
32
|
width: svgSize[size],
|
|
33
33
|
height: svgSize[size]
|
|
34
34
|
})
|
|
@@ -17,7 +17,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
17
17
|
return t;
|
|
18
18
|
};
|
|
19
19
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
-
import Icon from '@ncds/ui-admin-icon/dynamic';
|
|
21
20
|
import classNames from 'classnames';
|
|
22
21
|
import React, { createElement } from 'react';
|
|
23
22
|
import { COLOR } from '../../../constant/color';
|
|
@@ -77,11 +76,8 @@ ButtonGroup.Item = function (_a) {
|
|
|
77
76
|
var _a, _b, _c;
|
|
78
77
|
if (!icon) return null;
|
|
79
78
|
if (icon.type === 'icon') {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
'--icon-color': COLOR[icon.color]
|
|
83
|
-
} : undefined,
|
|
84
|
-
name: icon.icon,
|
|
79
|
+
var IconComponent = icon.icon;
|
|
80
|
+
return _jsx(IconComponent, {
|
|
85
81
|
width: (_a = icon.size) !== null && _a !== void 0 ? _a : svgSize[size],
|
|
86
82
|
height: (_b = icon.size) !== null && _b !== void 0 ? _b : svgSize[size],
|
|
87
83
|
color: icon.color ? COLOR[icon.color] : 'currentColor'
|
|
@@ -9,8 +9,8 @@ var __assign = this && this.__assign || function () {
|
|
|
9
9
|
return __assign.apply(this, arguments);
|
|
10
10
|
};
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { ChevronLeft, ChevronRight } from '@ncds/ui-admin-icon';
|
|
12
13
|
import classNames from 'classnames';
|
|
13
|
-
import Icon from '@ncds/ui-admin-icon/dynamic';
|
|
14
14
|
export var CarouselArrow = function (_a) {
|
|
15
15
|
var _b;
|
|
16
16
|
var _c = _a.type,
|
|
@@ -24,10 +24,10 @@ export var CarouselArrow = function (_a) {
|
|
|
24
24
|
className: classNames('ncua-carousel-arrow', (_b = {}, _b["ncua-carousel-arrow--".concat(type)] = type, _b["ncua-carousel-arrow--".concat(size)] = size, _b["ncua-carousel-arrow--".concat(chevron)] = chevron, _b), className),
|
|
25
25
|
onClick: onClick
|
|
26
26
|
}, {
|
|
27
|
-
children: _jsx(
|
|
28
|
-
className: "ncua-carousel-arrow__icon"
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
children: chevron === 'left' ? _jsx(ChevronLeft, {
|
|
28
|
+
className: "ncua-carousel-arrow__icon"
|
|
29
|
+
}) : _jsx(ChevronRight, {
|
|
30
|
+
className: "ncua-carousel-arrow__icon"
|
|
31
31
|
})
|
|
32
32
|
}));
|
|
33
33
|
};
|
|
@@ -26,6 +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 { ChevronSelectorVertical, SearchLg } from '@ncds/ui-admin-icon';
|
|
29
30
|
import classNames from 'classnames';
|
|
30
31
|
import { forwardRef, useImperativeHandle, useRef, useState } from 'react';
|
|
31
32
|
import { useDropdown } from '../../hooks/dropdown';
|
|
@@ -191,14 +192,14 @@ export var ComboBox = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
191
192
|
size: "xxs",
|
|
192
193
|
leadingIcon: {
|
|
193
194
|
type: 'icon',
|
|
194
|
-
icon:
|
|
195
|
+
icon: ChevronSelectorVertical
|
|
195
196
|
}
|
|
196
197
|
})
|
|
197
198
|
}))
|
|
198
199
|
};
|
|
199
200
|
var leadingElement = {
|
|
200
201
|
type: 'icon',
|
|
201
|
-
icon:
|
|
202
|
+
icon: SearchLg,
|
|
202
203
|
size: 14,
|
|
203
204
|
color: 'gray300'
|
|
204
205
|
};
|
|
@@ -17,8 +17,8 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
17
17
|
return t;
|
|
18
18
|
};
|
|
19
19
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
+
import { Calendar, Clock } from '@ncds/ui-admin-icon';
|
|
20
21
|
import { forwardRef } from 'react';
|
|
21
|
-
import Icon from '@ncds/ui-admin-icon/dynamic';
|
|
22
22
|
export var CustomInput = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
23
23
|
var disabled = _a.disabled,
|
|
24
24
|
iconSize = _a.iconSize,
|
|
@@ -34,8 +34,10 @@ export var CustomInput = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
34
34
|
className: "ncua-date-picker__ico",
|
|
35
35
|
htmlFor: props.id
|
|
36
36
|
}, {
|
|
37
|
-
children: _jsx(
|
|
38
|
-
|
|
37
|
+
children: iconName === 'calendar' ? _jsx(Calendar, {
|
|
38
|
+
width: svgSize,
|
|
39
|
+
height: svgSize
|
|
40
|
+
}) : _jsx(Clock, {
|
|
39
41
|
width: svgSize,
|
|
40
42
|
height: svgSize
|
|
41
43
|
})
|
|
@@ -40,7 +40,8 @@ export var DatePicker = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
40
40
|
_d = _a.isEndDate,
|
|
41
41
|
isEndDate = _d === void 0 ? false : _d,
|
|
42
42
|
onValidationError = _a.onValidationError,
|
|
43
|
-
|
|
43
|
+
className = _a.className,
|
|
44
|
+
attrs = __rest(_a, ["shouldFocus", "currentDate", "size", "onChangeDate", "datePickerOptions", "isEndDate", "onValidationError", "className"]);
|
|
44
45
|
var flatpickrInstanceRef = useRef(null);
|
|
45
46
|
var dateFormatRef = useRef('Y-m-d');
|
|
46
47
|
var minMaxDateRef = useRef({});
|
|
@@ -293,7 +294,7 @@ export var DatePicker = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
293
294
|
'ncua-date-picker--disabled': attrs.disabled,
|
|
294
295
|
'ncua-date-picker--has-time': hasTimeOption,
|
|
295
296
|
'ncua-date-picker--destructive': attrs.destructive
|
|
296
|
-
})
|
|
297
|
+
}, className)
|
|
297
298
|
}, {
|
|
298
299
|
children: [_jsx(Flatpickr, __assign({}, attrs, {
|
|
299
300
|
ref: ref || undefined,
|