@ncds/ui-admin 0.0.26 → 0.0.28
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/Badge.js +8 -1
- package/dist/cjs/src/components/button/Button.js +17 -4
- package/dist/cjs/src/components/button/ButtonGroup.js +20 -5
- package/dist/cjs/src/components/date-picker/RangeDatePickerWithButtons.js +4 -2
- package/dist/cjs/src/components/divider/Divider.js +6 -2
- package/dist/cjs/src/components/dot/Dot.js +41 -0
- package/dist/cjs/src/components/dot/index.js +16 -0
- package/dist/cjs/src/components/index.js +11 -0
- package/dist/cjs/src/components/modal/Modal.js +11 -8
- package/dist/cjs/src/components/select/Select.js +1 -9
- package/dist/cjs/src/components/tag/Tag.js +21 -9
- package/dist/esm/src/components/badge/Badge.js +8 -1
- package/dist/esm/src/components/button/Button.js +16 -3
- package/dist/esm/src/components/button/ButtonGroup.js +20 -5
- package/dist/esm/src/components/date-picker/RangeDatePickerWithButtons.js +4 -2
- package/dist/esm/src/components/divider/Divider.js +6 -2
- package/dist/esm/src/components/dot/Dot.js +34 -0
- package/dist/esm/src/components/dot/index.js +1 -0
- package/dist/esm/src/components/index.js +1 -0
- package/dist/esm/src/components/modal/Modal.js +11 -8
- package/dist/esm/src/components/select/Select.js +1 -9
- package/dist/esm/src/components/tag/Tag.js +21 -9
- package/dist/types/constant/color.d.ts +1 -0
- package/dist/types/src/components/badge/Badge.d.ts +3 -2
- package/dist/types/src/components/button/Button.d.ts +3 -13
- package/dist/types/src/components/button/ButtonGroup.d.ts +18 -29
- package/dist/types/src/components/date-picker/RangeDatePickerWithButtons.d.ts +3 -1
- package/dist/types/src/components/divider/Divider.d.ts +5 -0
- package/dist/types/src/components/dot/Dot.d.ts +23 -0
- package/dist/types/src/components/dot/index.d.ts +2 -0
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/modal/Modal.d.ts +6 -6
- package/dist/types/src/components/select/Select.d.ts +1 -1
- package/dist/types/src/components/tag/Tag.d.ts +5 -9
- package/dist/ui-admin/assets/styles/style.css +93 -52
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ var _uiAdminIcon = _interopRequireDefault(require("@ncds/ui-admin-icon"));
|
|
|
9
9
|
var _button = require("../button");
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
var _color = require("../../../constant/color");
|
|
12
|
+
var _dot = require("../dot");
|
|
12
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
14
|
var __assign = void 0 && (void 0).__assign || function () {
|
|
14
15
|
__assign = Object.assign || function (t) {
|
|
@@ -32,7 +33,7 @@ var Badge = function (_a) {
|
|
|
32
33
|
_d = _a.size,
|
|
33
34
|
size = _d === void 0 ? 'sm' : _d;
|
|
34
35
|
var sideSlotRender = function (slot) {
|
|
35
|
-
var _a, _b;
|
|
36
|
+
var _a, _b, _c, _d;
|
|
36
37
|
if (slot.type === 'icon') {
|
|
37
38
|
return (0, _jsxRuntime.jsx)(_uiAdminIcon.default, {
|
|
38
39
|
name: slot.icon,
|
|
@@ -41,6 +42,12 @@ var Badge = function (_a) {
|
|
|
41
42
|
color: slot.color ? _color.COLOR[slot.color] : undefined
|
|
42
43
|
});
|
|
43
44
|
}
|
|
45
|
+
if (slot.type === 'dot') {
|
|
46
|
+
return (0, _jsxRuntime.jsx)(_dot.Dot, {
|
|
47
|
+
color: (_c = slot.color) !== null && _c !== void 0 ? _c : color,
|
|
48
|
+
size: (_d = slot.size) !== null && _d !== void 0 ? _d : 'sm'
|
|
49
|
+
});
|
|
50
|
+
}
|
|
44
51
|
return slot.children;
|
|
45
52
|
};
|
|
46
53
|
return (0, _jsxRuntime.jsxs)("span", __assign({
|
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.svgSize = exports.iconOnlySvgSize = exports.Button = void 0;
|
|
6
|
+
exports.svgSize = exports.iconOnlySvgSize = exports.dotSize = exports.Button = void 0;
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
8
|
var _react = require("react");
|
|
10
|
-
var
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
10
|
var _uiAdminIcon = _interopRequireDefault(require("@ncds/ui-admin-icon"));
|
|
11
|
+
var _color = require("../../../constant/color");
|
|
12
|
+
var _dot = require("../dot");
|
|
12
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
14
|
var __assign = void 0 && (void 0).__assign || function () {
|
|
14
15
|
__assign = Object.assign || function (t) {
|
|
@@ -40,6 +41,12 @@ var iconOnlySvgSize = exports.iconOnlySvgSize = {
|
|
|
40
41
|
sm: 20,
|
|
41
42
|
md: 20
|
|
42
43
|
};
|
|
44
|
+
var dotSize = exports.dotSize = {
|
|
45
|
+
xxs: 'sm',
|
|
46
|
+
xs: 'sm',
|
|
47
|
+
sm: 'md',
|
|
48
|
+
md: 'md'
|
|
49
|
+
};
|
|
43
50
|
var Button = exports.Button = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
44
51
|
// NOTE: 엘리먼트 종류에 따라 props의 타입이 달라지므로 분리
|
|
45
52
|
var _a = props.as,
|
|
@@ -78,7 +85,7 @@ var Button = exports.Button = /*#__PURE__*/(0, _react.forwardRef)(function (prop
|
|
|
78
85
|
}
|
|
79
86
|
};
|
|
80
87
|
var sideSlotRender = function (slot) {
|
|
81
|
-
var _a, _b;
|
|
88
|
+
var _a, _b, _c;
|
|
82
89
|
if (slot.type === 'icon') {
|
|
83
90
|
var iconSize = onlyIcon ? iconOnlySvgSize[size] : svgSize[size];
|
|
84
91
|
return (0, _jsxRuntime.jsx)(_uiAdminIcon.default, {
|
|
@@ -88,6 +95,12 @@ var Button = exports.Button = /*#__PURE__*/(0, _react.forwardRef)(function (prop
|
|
|
88
95
|
color: slot.color ? _color.COLOR[slot.color] : undefined
|
|
89
96
|
});
|
|
90
97
|
}
|
|
98
|
+
if (slot.type === 'dot') {
|
|
99
|
+
return (0, _jsxRuntime.jsx)(_dot.Dot, {
|
|
100
|
+
color: slot.color,
|
|
101
|
+
size: (_c = slot.size) !== null && _c !== void 0 ? _c : dotSize[size]
|
|
102
|
+
});
|
|
103
|
+
}
|
|
91
104
|
return slot.children;
|
|
92
105
|
};
|
|
93
106
|
(0, _react.useEffect)(function () {
|
|
@@ -9,6 +9,7 @@ var _uiAdminIcon = _interopRequireDefault(require("@ncds/ui-admin-icon"));
|
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _color = require("../../../constant/color");
|
|
12
|
+
var _dot = require("../dot");
|
|
12
13
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
14
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -36,6 +37,12 @@ var svgSize = {
|
|
|
36
37
|
md: 16,
|
|
37
38
|
lg: 20
|
|
38
39
|
};
|
|
40
|
+
var dotSize = {
|
|
41
|
+
xs: 'sm',
|
|
42
|
+
sm: 'sm',
|
|
43
|
+
md: 'md',
|
|
44
|
+
lg: 'md'
|
|
45
|
+
};
|
|
39
46
|
var ButtonGroup = function (_a) {
|
|
40
47
|
var children = _a.children,
|
|
41
48
|
className = _a.className,
|
|
@@ -70,7 +77,8 @@ ButtonGroup.Item = function (_a) {
|
|
|
70
77
|
var _c = _a.as,
|
|
71
78
|
as = _c === void 0 ? 'button' : _c,
|
|
72
79
|
label = _a.label,
|
|
73
|
-
|
|
80
|
+
_d = _a.size,
|
|
81
|
+
size = _d === void 0 ? 'md' : _d,
|
|
74
82
|
onlyIcon = _a.onlyIcon,
|
|
75
83
|
icon = _a.icon,
|
|
76
84
|
disabled = _a.disabled,
|
|
@@ -78,16 +86,22 @@ ButtonGroup.Item = function (_a) {
|
|
|
78
86
|
isCurrent = _a.isCurrent,
|
|
79
87
|
props = __rest(_a, ["as", "label", "size", "onlyIcon", "icon", "disabled", "children", "isCurrent"]);
|
|
80
88
|
var renderIcon = function () {
|
|
81
|
-
var _a, _b;
|
|
89
|
+
var _a, _b, _c;
|
|
82
90
|
if (!icon) return null;
|
|
83
91
|
if (icon.type === 'icon') {
|
|
84
92
|
return (0, _jsxRuntime.jsx)(_uiAdminIcon.default, {
|
|
85
93
|
name: icon.icon,
|
|
86
|
-
width: (_a = icon.size) !== null && _a !== void 0 ? _a : svgSize[size
|
|
87
|
-
height: (_b = icon.size) !== null && _b !== void 0 ? _b : svgSize[size
|
|
94
|
+
width: (_a = icon.size) !== null && _a !== void 0 ? _a : svgSize[size],
|
|
95
|
+
height: (_b = icon.size) !== null && _b !== void 0 ? _b : svgSize[size],
|
|
88
96
|
color: icon.color ? _color.COLOR[icon.color] : 'currentColor'
|
|
89
97
|
});
|
|
90
98
|
}
|
|
99
|
+
if (icon.type === 'dot') {
|
|
100
|
+
return (0, _jsxRuntime.jsx)(_dot.Dot, {
|
|
101
|
+
color: icon.color,
|
|
102
|
+
size: (_c = icon.size) !== null && _c !== void 0 ? _c : dotSize[size]
|
|
103
|
+
});
|
|
104
|
+
}
|
|
91
105
|
return icon.children;
|
|
92
106
|
};
|
|
93
107
|
var position = (_b = icon === null || icon === void 0 ? void 0 : icon.position) !== null && _b !== void 0 ? _b : 'leading';
|
|
@@ -99,7 +113,8 @@ ButtonGroup.Item = function (_a) {
|
|
|
99
113
|
}, {
|
|
100
114
|
'is-current': isCurrent
|
|
101
115
|
}),
|
|
102
|
-
disabled: disabled
|
|
116
|
+
disabled: disabled,
|
|
117
|
+
type: as === 'button' ? 'button' : undefined
|
|
103
118
|
}, props), (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
104
119
|
children: [position === 'leading' && renderIcon(), !onlyIcon && label, children, position === 'trailing' && renderIcon()]
|
|
105
120
|
}));
|
|
@@ -21,7 +21,9 @@ var __assign = void 0 && (void 0).__assign || function () {
|
|
|
21
21
|
return __assign.apply(this, arguments);
|
|
22
22
|
};
|
|
23
23
|
var RangeDatePickerWithButtons = function (_a) {
|
|
24
|
-
var
|
|
24
|
+
var _b = _a.buttonGroupSize,
|
|
25
|
+
buttonGroupSize = _b === void 0 ? 'sm' : _b,
|
|
26
|
+
currentButtonId = _a.currentButtonId,
|
|
25
27
|
setCurrentButtonId = _a.setCurrentButtonId,
|
|
26
28
|
startDateOptions = _a.startDateOptions,
|
|
27
29
|
endDateOptions = _a.endDateOptions,
|
|
@@ -60,7 +62,7 @@ var RangeDatePickerWithButtons = function (_a) {
|
|
|
60
62
|
className: "ncua-range-date-picker-with-buttons"
|
|
61
63
|
}, {
|
|
62
64
|
children: [(0, _jsxRuntime.jsx)(_button.ButtonGroup, __assign({
|
|
63
|
-
size:
|
|
65
|
+
size: buttonGroupSize
|
|
64
66
|
}, {
|
|
65
67
|
children: periodKeys.map(function (key) {
|
|
66
68
|
return (0, _jsxRuntime.jsx)(_button.ButtonGroup.Item, {
|
|
@@ -18,15 +18,19 @@ var __assign = void 0 && (void 0).__assign || function () {
|
|
|
18
18
|
};
|
|
19
19
|
return __assign.apply(this, arguments);
|
|
20
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* @param {DividerProps} props
|
|
23
|
+
* @param {ReactNode} props.children Button 컴포넌트는 xs로 ButtonGroup은 sm 사이즈로 추가하는 것이 권장됩니다.
|
|
24
|
+
* @returns {ReactNode}
|
|
25
|
+
*/
|
|
21
26
|
var Divider = exports.Divider = /*#__PURE__*/(0, _react.forwardRef)(function (_a, ref) {
|
|
22
27
|
var className = _a.className,
|
|
23
28
|
type = _a.type,
|
|
24
29
|
_b = _a.style,
|
|
25
30
|
style = _b === void 0 ? 'single-line' : _b,
|
|
26
31
|
children = _a.children;
|
|
27
|
-
var componentClassName = (0, _classnames.default)('ncua-divider', "ncua-divider--".concat(type), "ncua-divider--".concat(style), className);
|
|
28
32
|
return (0, _jsxRuntime.jsxs)("div", __assign({
|
|
29
|
-
className:
|
|
33
|
+
className: (0, _classnames.default)('ncua-divider', "ncua-divider--".concat(type), "ncua-divider--".concat(style), className),
|
|
30
34
|
ref: ref
|
|
31
35
|
}, {
|
|
32
36
|
children: [style === 'single-line' && (0, _jsxRuntime.jsx)("div", {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Dot = void 0;
|
|
7
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
12
|
+
__assign = Object.assign || function (t) {
|
|
13
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
14
|
+
s = arguments[i];
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
16
|
+
}
|
|
17
|
+
return t;
|
|
18
|
+
};
|
|
19
|
+
return __assign.apply(this, arguments);
|
|
20
|
+
};
|
|
21
|
+
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
22
|
+
var t = {};
|
|
23
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
24
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
25
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
26
|
+
}
|
|
27
|
+
return t;
|
|
28
|
+
};
|
|
29
|
+
var Dot = exports.Dot = /*#__PURE__*/(0, _react.forwardRef)(function (_a, ref) {
|
|
30
|
+
var _b = _a.color,
|
|
31
|
+
color = _b === void 0 ? 'success' : _b,
|
|
32
|
+
_c = _a.size,
|
|
33
|
+
size = _c === void 0 ? 'md' : _c,
|
|
34
|
+
className = _a.className,
|
|
35
|
+
props = __rest(_a, ["color", "size", "className"]);
|
|
36
|
+
return (0, _jsxRuntime.jsx)("span", __assign({
|
|
37
|
+
ref: ref,
|
|
38
|
+
className: (0, _classnames.default)('ncua-dot', "ncua-dot--".concat(color), "ncua-dot--".concat(size), className)
|
|
39
|
+
}, props));
|
|
40
|
+
});
|
|
41
|
+
Dot.displayName = 'Dot';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _Dot = require("./Dot");
|
|
7
|
+
Object.keys(_Dot).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _Dot[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _Dot[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -80,6 +80,17 @@ Object.keys(_divider).forEach(function (key) {
|
|
|
80
80
|
}
|
|
81
81
|
});
|
|
82
82
|
});
|
|
83
|
+
var _dot = require("./dot");
|
|
84
|
+
Object.keys(_dot).forEach(function (key) {
|
|
85
|
+
if (key === "default" || key === "__esModule") return;
|
|
86
|
+
if (key in exports && exports[key] === _dot[key]) return;
|
|
87
|
+
Object.defineProperty(exports, key, {
|
|
88
|
+
enumerable: true,
|
|
89
|
+
get: function () {
|
|
90
|
+
return _dot[key];
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
});
|
|
83
94
|
var _dropdown = require("./dropdown");
|
|
84
95
|
Object.keys(_dropdown).forEach(function (key) {
|
|
85
96
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -91,12 +91,15 @@ Modal.Header = function (_a) {
|
|
|
91
91
|
hideCloseButton = _d === void 0 ? false : _d;
|
|
92
92
|
return (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
93
93
|
children: [(0, _jsxRuntime.jsxs)("header", __assign({
|
|
94
|
-
className: (0, _classnames.default)('ncua-modal__header', "ncua-modal__header--".concat(align)
|
|
94
|
+
className: (0, _classnames.default)('ncua-modal__header', "ncua-modal__header--".concat(align), {
|
|
95
|
+
'ncua-modal__header--close-button': !hideCloseButton
|
|
96
|
+
})
|
|
95
97
|
}, {
|
|
96
98
|
children: [featuredIcon && (0, _jsxRuntime.jsx)(_featuredIcon.FeaturedIcon, {
|
|
97
99
|
name: featuredIcon.name,
|
|
98
100
|
color: featuredIcon.color,
|
|
99
|
-
theme: featuredIcon.theme
|
|
101
|
+
theme: featuredIcon.theme,
|
|
102
|
+
size: "sm"
|
|
100
103
|
}), (0, _jsxRuntime.jsxs)("div", __assign({
|
|
101
104
|
className: "ncua-modal__title"
|
|
102
105
|
}, {
|
|
@@ -137,14 +140,14 @@ Modal.Content = function (_a) {
|
|
|
137
140
|
*
|
|
138
141
|
* 1. Vertical layout (buttons stacked):
|
|
139
142
|
* <Modal.Actions layout="vertical" align="stretch">
|
|
140
|
-
* <Button label="Confirm" onClick={handleConfirm} hierarchy="primary" />
|
|
141
|
-
* <Button label="Cancel" onClick={handleCancel} hierarchy="secondary-gray" />
|
|
143
|
+
* <Button size="sm" label="Confirm" onClick={handleConfirm} hierarchy="primary" />
|
|
144
|
+
* <Button size="sm" label="Cancel" onClick={handleCancel} hierarchy="secondary-gray" />
|
|
142
145
|
* </Modal.Actions>
|
|
143
146
|
*
|
|
144
147
|
* 2. Horizontal layout (buttons side by side):
|
|
145
148
|
* <Modal.Actions layout="horizontal" align="stretch">
|
|
146
|
-
* <Button label="Confirm" onClick={handleConfirm} hierarchy="primary" />
|
|
147
|
-
* <Button label="Cancel" onClick={handleCancel} hierarchy="secondary-gray" />
|
|
149
|
+
* <Button size="sm" label="Confirm" onClick={handleConfirm} hierarchy="primary" />
|
|
150
|
+
* <Button size="sm" label="Cancel" onClick={handleCancel} hierarchy="secondary-gray" />
|
|
148
151
|
* </Modal.Actions>
|
|
149
152
|
*
|
|
150
153
|
* 3. Checkbox layout (checkbox on left, buttons on right):
|
|
@@ -154,8 +157,8 @@ Modal.Content = function (_a) {
|
|
|
154
157
|
* <a href="#">Settings</a>
|
|
155
158
|
* </>
|
|
156
159
|
* }>
|
|
157
|
-
* <Button label="Cancel" onClick={handleCancel} hierarchy="secondary-gray" />
|
|
158
|
-
* <Button label="Confirm" onClick={handleConfirm} hierarchy="primary" />
|
|
160
|
+
* <Button size="sm" label="Cancel" onClick={handleCancel} hierarchy="secondary-gray" />
|
|
161
|
+
* <Button size="sm" label="Confirm" onClick={handleConfirm} hierarchy="primary" />
|
|
159
162
|
* </Modal.Actions>
|
|
160
163
|
*/
|
|
161
164
|
Modal.Actions = function (_a) {
|
|
@@ -29,7 +29,7 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
29
29
|
return t;
|
|
30
30
|
};
|
|
31
31
|
/**
|
|
32
|
-
* 현재 icon
|
|
32
|
+
* 현재 icon 속성은 현재 디자인 시스템에 존재하지 않으니 사용하지 않는 것을 권장합니다.
|
|
33
33
|
*/
|
|
34
34
|
var Select = exports.Select = /*#__PURE__*/(0, _react.forwardRef)(function (_a, ref) {
|
|
35
35
|
var icon = _a.icon,
|
|
@@ -87,14 +87,6 @@ var Select = exports.Select = /*#__PURE__*/(0, _react.forwardRef)(function (_a,
|
|
|
87
87
|
children: item.label
|
|
88
88
|
}), "option-".concat(index));
|
|
89
89
|
}), children]
|
|
90
|
-
})), destructive && (0, _jsxRuntime.jsx)("div", __assign({
|
|
91
|
-
className: "ncua-select__destructive-icon"
|
|
92
|
-
}, {
|
|
93
|
-
children: (0, _jsxRuntime.jsx)(_uiAdminIcon.default, {
|
|
94
|
-
name: "info-circle",
|
|
95
|
-
width: 14,
|
|
96
|
-
height: 14
|
|
97
|
-
})
|
|
98
90
|
}))]
|
|
99
91
|
})), hintText && (0, _jsxRuntime.jsx)(_HintText.HintText, __assign({
|
|
100
92
|
destructive: destructive,
|
|
@@ -8,6 +8,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
8
8
|
var _uiAdminIcon = _interopRequireDefault(require("@ncds/ui-admin-icon"));
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _color = require("../../../constant/color");
|
|
11
|
+
var _dot = require("../dot");
|
|
11
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
13
|
var __assign = void 0 && (void 0).__assign || function () {
|
|
13
14
|
__assign = Object.assign || function (t) {
|
|
@@ -31,17 +32,28 @@ var Tag = function (_a) {
|
|
|
31
32
|
sm: 14,
|
|
32
33
|
md: 16
|
|
33
34
|
};
|
|
35
|
+
var sideSlotRender = function (slot) {
|
|
36
|
+
var _a;
|
|
37
|
+
if (slot.type === 'icon') {
|
|
38
|
+
return (0, _jsxRuntime.jsx)(_uiAdminIcon.default, {
|
|
39
|
+
name: slot.icon,
|
|
40
|
+
width: iconSize[size],
|
|
41
|
+
height: iconSize[size],
|
|
42
|
+
color: slot.color
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
if (slot.type === 'dot') {
|
|
46
|
+
return (0, _jsxRuntime.jsx)(_dot.Dot, {
|
|
47
|
+
color: slot.color,
|
|
48
|
+
size: (_a = slot.size) !== null && _a !== void 0 ? _a : 'sm'
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return slot.children;
|
|
52
|
+
};
|
|
34
53
|
return (0, _jsxRuntime.jsxs)("span", __assign({
|
|
35
|
-
className: (0, _classnames.default)('ncua-tag', "ncua-tag--".concat(size)
|
|
36
|
-
'ncua-tag--dot': (icon === null || icon === void 0 ? void 0 : icon.name) === 'dot'
|
|
37
|
-
})
|
|
54
|
+
className: (0, _classnames.default)('ncua-tag', "ncua-tag--".concat(size))
|
|
38
55
|
}, {
|
|
39
|
-
children: [icon && icon
|
|
40
|
-
name: icon.name,
|
|
41
|
-
width: iconSize[size],
|
|
42
|
-
height: iconSize[size],
|
|
43
|
-
color: icon.color
|
|
44
|
-
}), (0, _jsxRuntime.jsx)("span", __assign({
|
|
56
|
+
children: [icon && sideSlotRender(icon), (0, _jsxRuntime.jsx)("span", __assign({
|
|
45
57
|
className: "ncua-tag__text"
|
|
46
58
|
}, {
|
|
47
59
|
children: text
|
|
@@ -13,6 +13,7 @@ import Icon from '@ncds/ui-admin-icon';
|
|
|
13
13
|
import { svgSize } from '../button';
|
|
14
14
|
import classNames from 'classnames';
|
|
15
15
|
import { COLOR } from '../../../constant/color';
|
|
16
|
+
import { Dot } from '../dot';
|
|
16
17
|
export var Badge = function (_a) {
|
|
17
18
|
var label = _a.label,
|
|
18
19
|
_b = _a.type,
|
|
@@ -25,7 +26,7 @@ export var Badge = function (_a) {
|
|
|
25
26
|
_d = _a.size,
|
|
26
27
|
size = _d === void 0 ? 'sm' : _d;
|
|
27
28
|
var sideSlotRender = function (slot) {
|
|
28
|
-
var _a, _b;
|
|
29
|
+
var _a, _b, _c, _d;
|
|
29
30
|
if (slot.type === 'icon') {
|
|
30
31
|
return _jsx(Icon, {
|
|
31
32
|
name: slot.icon,
|
|
@@ -34,6 +35,12 @@ export var Badge = function (_a) {
|
|
|
34
35
|
color: slot.color ? COLOR[slot.color] : undefined
|
|
35
36
|
});
|
|
36
37
|
}
|
|
38
|
+
if (slot.type === 'dot') {
|
|
39
|
+
return _jsx(Dot, {
|
|
40
|
+
color: (_c = slot.color) !== null && _c !== void 0 ? _c : color,
|
|
41
|
+
size: (_d = slot.size) !== null && _d !== void 0 ? _d : 'sm'
|
|
42
|
+
});
|
|
43
|
+
}
|
|
37
44
|
return slot.children;
|
|
38
45
|
};
|
|
39
46
|
return _jsxs("span", __assign({
|
|
@@ -17,10 +17,11 @@ 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 classnames from 'classnames';
|
|
21
20
|
import { createElement, forwardRef, useEffect, useState } from 'react';
|
|
22
|
-
import
|
|
21
|
+
import classnames from 'classnames';
|
|
23
22
|
import Icon from '@ncds/ui-admin-icon';
|
|
23
|
+
import { COLOR } from '../../../constant/color';
|
|
24
|
+
import { Dot } from '../dot';
|
|
24
25
|
export var svgSize = {
|
|
25
26
|
xxs: 12,
|
|
26
27
|
xs: 14,
|
|
@@ -33,6 +34,12 @@ export var iconOnlySvgSize = {
|
|
|
33
34
|
sm: 20,
|
|
34
35
|
md: 20
|
|
35
36
|
};
|
|
37
|
+
export var dotSize = {
|
|
38
|
+
xxs: 'sm',
|
|
39
|
+
xs: 'sm',
|
|
40
|
+
sm: 'md',
|
|
41
|
+
md: 'md'
|
|
42
|
+
};
|
|
36
43
|
export var Button = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
37
44
|
// NOTE: 엘리먼트 종류에 따라 props의 타입이 달라지므로 분리
|
|
38
45
|
var _a = props.as,
|
|
@@ -71,7 +78,7 @@ export var Button = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
71
78
|
}
|
|
72
79
|
};
|
|
73
80
|
var sideSlotRender = function (slot) {
|
|
74
|
-
var _a, _b;
|
|
81
|
+
var _a, _b, _c;
|
|
75
82
|
if (slot.type === 'icon') {
|
|
76
83
|
var iconSize = onlyIcon ? iconOnlySvgSize[size] : svgSize[size];
|
|
77
84
|
return _jsx(Icon, {
|
|
@@ -81,6 +88,12 @@ export var Button = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
81
88
|
color: slot.color ? COLOR[slot.color] : undefined
|
|
82
89
|
});
|
|
83
90
|
}
|
|
91
|
+
if (slot.type === 'dot') {
|
|
92
|
+
return _jsx(Dot, {
|
|
93
|
+
color: slot.color,
|
|
94
|
+
size: (_c = slot.size) !== null && _c !== void 0 ? _c : dotSize[size]
|
|
95
|
+
});
|
|
96
|
+
}
|
|
84
97
|
return slot.children;
|
|
85
98
|
};
|
|
86
99
|
useEffect(function () {
|
|
@@ -21,12 +21,19 @@ import Icon from '@ncds/ui-admin-icon';
|
|
|
21
21
|
import classNames from 'classnames';
|
|
22
22
|
import React, { createElement } from 'react';
|
|
23
23
|
import { COLOR } from '../../../constant/color';
|
|
24
|
+
import { Dot } from '../dot';
|
|
24
25
|
var svgSize = {
|
|
25
26
|
xs: 12,
|
|
26
27
|
sm: 16,
|
|
27
28
|
md: 16,
|
|
28
29
|
lg: 20
|
|
29
30
|
};
|
|
31
|
+
var dotSize = {
|
|
32
|
+
xs: 'sm',
|
|
33
|
+
sm: 'sm',
|
|
34
|
+
md: 'md',
|
|
35
|
+
lg: 'md'
|
|
36
|
+
};
|
|
30
37
|
export var ButtonGroup = function (_a) {
|
|
31
38
|
var children = _a.children,
|
|
32
39
|
className = _a.className,
|
|
@@ -60,7 +67,8 @@ ButtonGroup.Item = function (_a) {
|
|
|
60
67
|
var _c = _a.as,
|
|
61
68
|
as = _c === void 0 ? 'button' : _c,
|
|
62
69
|
label = _a.label,
|
|
63
|
-
|
|
70
|
+
_d = _a.size,
|
|
71
|
+
size = _d === void 0 ? 'md' : _d,
|
|
64
72
|
onlyIcon = _a.onlyIcon,
|
|
65
73
|
icon = _a.icon,
|
|
66
74
|
disabled = _a.disabled,
|
|
@@ -68,16 +76,22 @@ ButtonGroup.Item = function (_a) {
|
|
|
68
76
|
isCurrent = _a.isCurrent,
|
|
69
77
|
props = __rest(_a, ["as", "label", "size", "onlyIcon", "icon", "disabled", "children", "isCurrent"]);
|
|
70
78
|
var renderIcon = function () {
|
|
71
|
-
var _a, _b;
|
|
79
|
+
var _a, _b, _c;
|
|
72
80
|
if (!icon) return null;
|
|
73
81
|
if (icon.type === 'icon') {
|
|
74
82
|
return _jsx(Icon, {
|
|
75
83
|
name: icon.icon,
|
|
76
|
-
width: (_a = icon.size) !== null && _a !== void 0 ? _a : svgSize[size
|
|
77
|
-
height: (_b = icon.size) !== null && _b !== void 0 ? _b : svgSize[size
|
|
84
|
+
width: (_a = icon.size) !== null && _a !== void 0 ? _a : svgSize[size],
|
|
85
|
+
height: (_b = icon.size) !== null && _b !== void 0 ? _b : svgSize[size],
|
|
78
86
|
color: icon.color ? COLOR[icon.color] : 'currentColor'
|
|
79
87
|
});
|
|
80
88
|
}
|
|
89
|
+
if (icon.type === 'dot') {
|
|
90
|
+
return _jsx(Dot, {
|
|
91
|
+
color: icon.color,
|
|
92
|
+
size: (_c = icon.size) !== null && _c !== void 0 ? _c : dotSize[size]
|
|
93
|
+
});
|
|
94
|
+
}
|
|
81
95
|
return icon.children;
|
|
82
96
|
};
|
|
83
97
|
var position = (_b = icon === null || icon === void 0 ? void 0 : icon.position) !== null && _b !== void 0 ? _b : 'leading';
|
|
@@ -89,7 +103,8 @@ ButtonGroup.Item = function (_a) {
|
|
|
89
103
|
}, {
|
|
90
104
|
'is-current': isCurrent
|
|
91
105
|
}),
|
|
92
|
-
disabled: disabled
|
|
106
|
+
disabled: disabled,
|
|
107
|
+
type: as === 'button' ? 'button' : undefined
|
|
93
108
|
}, props), _jsxs(_Fragment, {
|
|
94
109
|
children: [position === 'leading' && renderIcon(), !onlyIcon && label, children, position === 'trailing' && renderIcon()]
|
|
95
110
|
}));
|
|
@@ -15,7 +15,9 @@ import { ButtonGroup } from '../button';
|
|
|
15
15
|
import { getDateFormat, getSubtractDate } from '../../utils/date-picker';
|
|
16
16
|
import { PERIOD_ITEM } from '../../constant/date-picker';
|
|
17
17
|
export var RangeDatePickerWithButtons = function (_a) {
|
|
18
|
-
var
|
|
18
|
+
var _b = _a.buttonGroupSize,
|
|
19
|
+
buttonGroupSize = _b === void 0 ? 'sm' : _b,
|
|
20
|
+
currentButtonId = _a.currentButtonId,
|
|
19
21
|
setCurrentButtonId = _a.setCurrentButtonId,
|
|
20
22
|
startDateOptions = _a.startDateOptions,
|
|
21
23
|
endDateOptions = _a.endDateOptions,
|
|
@@ -54,7 +56,7 @@ export var RangeDatePickerWithButtons = function (_a) {
|
|
|
54
56
|
className: "ncua-range-date-picker-with-buttons"
|
|
55
57
|
}, {
|
|
56
58
|
children: [_jsx(ButtonGroup, __assign({
|
|
57
|
-
size:
|
|
59
|
+
size: buttonGroupSize
|
|
58
60
|
}, {
|
|
59
61
|
children: periodKeys.map(function (key) {
|
|
60
62
|
return _jsx(ButtonGroup.Item, {
|
|
@@ -11,15 +11,19 @@ var __assign = this && this.__assign || function () {
|
|
|
11
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
12
|
import { forwardRef } from 'react';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
|
+
/**
|
|
15
|
+
* @param {DividerProps} props
|
|
16
|
+
* @param {ReactNode} props.children Button 컴포넌트는 xs로 ButtonGroup은 sm 사이즈로 추가하는 것이 권장됩니다.
|
|
17
|
+
* @returns {ReactNode}
|
|
18
|
+
*/
|
|
14
19
|
export var Divider = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
15
20
|
var className = _a.className,
|
|
16
21
|
type = _a.type,
|
|
17
22
|
_b = _a.style,
|
|
18
23
|
style = _b === void 0 ? 'single-line' : _b,
|
|
19
24
|
children = _a.children;
|
|
20
|
-
var componentClassName = classNames('ncua-divider', "ncua-divider--".concat(type), "ncua-divider--".concat(style), className);
|
|
21
25
|
return _jsxs("div", __assign({
|
|
22
|
-
className:
|
|
26
|
+
className: classNames('ncua-divider', "ncua-divider--".concat(type), "ncua-divider--".concat(style), className),
|
|
23
27
|
ref: ref
|
|
24
28
|
}, {
|
|
25
29
|
children: [style === 'single-line' && _jsx("div", {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __assign = this && this.__assign || function () {
|
|
2
|
+
__assign = Object.assign || function (t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
6
|
+
}
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
9
|
+
return __assign.apply(this, arguments);
|
|
10
|
+
};
|
|
11
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
14
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
15
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
16
|
+
}
|
|
17
|
+
return t;
|
|
18
|
+
};
|
|
19
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
+
import { forwardRef } from 'react';
|
|
21
|
+
import classNames from 'classnames';
|
|
22
|
+
export var Dot = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
23
|
+
var _b = _a.color,
|
|
24
|
+
color = _b === void 0 ? 'success' : _b,
|
|
25
|
+
_c = _a.size,
|
|
26
|
+
size = _c === void 0 ? 'md' : _c,
|
|
27
|
+
className = _a.className,
|
|
28
|
+
props = __rest(_a, ["color", "size", "className"]);
|
|
29
|
+
return _jsx("span", __assign({
|
|
30
|
+
ref: ref,
|
|
31
|
+
className: classNames('ncua-dot', "ncua-dot--".concat(color), "ncua-dot--".concat(size), className)
|
|
32
|
+
}, props));
|
|
33
|
+
});
|
|
34
|
+
Dot.displayName = 'Dot';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Dot';
|