@ncds/ui-admin 0.0.24 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +132 -0
- package/dist/cjs/src/components/button/ButtonGroup.js +12 -5
- package/dist/cjs/src/components/checkbox/Checkbox.js +2 -2
- package/dist/cjs/src/components/checkbox/CheckboxInput.js +41 -12
- package/dist/cjs/src/components/date-picker/RangeDatePickerWithButtons.js +90 -0
- package/dist/cjs/src/components/date-picker/index.js +22 -0
- package/dist/cjs/src/components/featured-icon/FeaturedIcon.js +1 -18
- package/dist/cjs/src/components/index.js +30 -8
- package/dist/cjs/src/components/input/InputBase.js +2 -1
- package/dist/cjs/src/components/input/PasswordInput.js +1 -0
- package/dist/cjs/src/components/input/Textarea.js +12 -6
- package/dist/cjs/src/components/modal/index.js +11 -7
- package/dist/cjs/src/components/notification/index.js +11 -11
- package/dist/cjs/src/components/select/Select.js +3 -0
- package/dist/cjs/src/components/tab/TabButton.js +1 -1
- package/dist/cjs/src/components/tag/Tag.js +5 -5
- package/dist/cjs/src/constant/date-picker.js +63 -0
- package/dist/cjs/src/constant/index.js +11 -0
- package/dist/cjs/src/utils/date-picker.js +26 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/src/components/button/ButtonGroup.js +12 -5
- package/dist/esm/src/components/checkbox/Checkbox.js +2 -2
- package/dist/esm/src/components/checkbox/CheckboxInput.js +42 -13
- package/dist/esm/src/components/date-picker/RangeDatePickerWithButtons.js +83 -0
- package/dist/esm/src/components/date-picker/index.js +3 -1
- package/dist/esm/src/components/featured-icon/FeaturedIcon.js +1 -18
- package/dist/esm/src/components/index.js +3 -1
- package/dist/esm/src/components/input/InputBase.js +2 -1
- package/dist/esm/src/components/input/PasswordInput.js +1 -0
- package/dist/esm/src/components/input/Textarea.js +12 -6
- package/dist/esm/src/components/modal/index.js +1 -1
- package/dist/esm/src/components/notification/index.js +2 -2
- package/dist/esm/src/components/select/Select.js +3 -0
- package/dist/esm/src/components/tab/TabButton.js +1 -1
- package/dist/esm/src/components/tag/Tag.js +5 -5
- package/dist/esm/src/constant/date-picker.js +57 -0
- package/dist/esm/src/constant/index.js +2 -1
- package/dist/esm/src/utils/date-picker.js +17 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/src/components/button/ButtonGroup.d.ts +4 -2
- package/dist/types/src/components/checkbox/CheckboxInput.d.ts +3 -0
- package/dist/types/src/components/date-picker/RangeDatePickerWithButtons.d.ts +12 -0
- package/dist/types/src/components/date-picker/index.d.ts +2 -0
- package/dist/types/src/components/index.d.ts +3 -1
- package/dist/types/src/components/input/InputBase.d.ts +2 -1
- package/dist/types/src/components/input/Textarea.d.ts +2 -0
- package/dist/types/src/components/modal/index.d.ts +1 -2
- package/dist/types/src/components/notification/index.d.ts +1 -1
- package/dist/types/src/components/select/Select.d.ts +4 -1
- package/dist/types/src/constant/date-picker.d.ts +58 -0
- package/dist/types/src/constant/index.d.ts +1 -0
- package/dist/types/src/utils/date-picker.d.ts +9 -0
- package/dist/ui-admin/assets/styles/style.css +187 -84
- package/package.json +1 -1
|
@@ -28,6 +28,9 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
28
28
|
}
|
|
29
29
|
return t;
|
|
30
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* 현재 icon과 destructive 속성은 현재 디자인 시스템에 존재하지 않으니 사용하지 않는 것을 권장합니다.
|
|
33
|
+
*/
|
|
31
34
|
var Select = exports.Select = /*#__PURE__*/(0, _react.forwardRef)(function (_a, ref) {
|
|
32
35
|
var icon = _a.icon,
|
|
33
36
|
placeholder = _a.placeholder,
|
|
@@ -27,7 +27,7 @@ var Tag = function (_a) {
|
|
|
27
27
|
count = _a.count,
|
|
28
28
|
close = _a.close,
|
|
29
29
|
onButtonClick = _a.onButtonClick;
|
|
30
|
-
var
|
|
30
|
+
var iconSize = {
|
|
31
31
|
sm: 14,
|
|
32
32
|
md: 16
|
|
33
33
|
};
|
|
@@ -38,8 +38,8 @@ var Tag = function (_a) {
|
|
|
38
38
|
}, {
|
|
39
39
|
children: [icon && icon.name !== 'dot' && (0, _jsxRuntime.jsx)(_uiAdminIcon.default, {
|
|
40
40
|
name: icon.name,
|
|
41
|
-
width:
|
|
42
|
-
height:
|
|
41
|
+
width: iconSize[size],
|
|
42
|
+
height: iconSize[size],
|
|
43
43
|
color: icon.color
|
|
44
44
|
}), (0, _jsxRuntime.jsx)("span", __assign({
|
|
45
45
|
className: "ncua-tag__text"
|
|
@@ -57,8 +57,8 @@ var Tag = function (_a) {
|
|
|
57
57
|
children: (0, _jsxRuntime.jsx)(_uiAdminIcon.default, {
|
|
58
58
|
name: "x-close",
|
|
59
59
|
color: _color.COLOR.gray300,
|
|
60
|
-
width:
|
|
61
|
-
height:
|
|
60
|
+
width: iconSize[size],
|
|
61
|
+
height: iconSize[size]
|
|
62
62
|
})
|
|
63
63
|
}))]
|
|
64
64
|
}));
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.PERIOD_ITEM = void 0;
|
|
7
|
+
var PERIOD_ITEM = exports.PERIOD_ITEM = {
|
|
8
|
+
TODAY: {
|
|
9
|
+
text: '오늘',
|
|
10
|
+
period: 0,
|
|
11
|
+
unit: 'days'
|
|
12
|
+
},
|
|
13
|
+
YESTERDAY: {
|
|
14
|
+
text: '어제',
|
|
15
|
+
period: 1,
|
|
16
|
+
unit: 'days'
|
|
17
|
+
},
|
|
18
|
+
'3DAYS': {
|
|
19
|
+
text: '3일',
|
|
20
|
+
period: 3,
|
|
21
|
+
unit: 'days'
|
|
22
|
+
},
|
|
23
|
+
'7DAYS': {
|
|
24
|
+
text: '7일',
|
|
25
|
+
period: 7,
|
|
26
|
+
unit: 'days'
|
|
27
|
+
},
|
|
28
|
+
'1WEEK': {
|
|
29
|
+
text: '1주일',
|
|
30
|
+
period: 1,
|
|
31
|
+
unit: 'week'
|
|
32
|
+
},
|
|
33
|
+
'15DAYS': {
|
|
34
|
+
text: '15일',
|
|
35
|
+
period: 15,
|
|
36
|
+
unit: 'days'
|
|
37
|
+
},
|
|
38
|
+
'1MONTHS': {
|
|
39
|
+
text: '1개월',
|
|
40
|
+
period: 1,
|
|
41
|
+
unit: 'months'
|
|
42
|
+
},
|
|
43
|
+
'3MONTHS': {
|
|
44
|
+
text: '3개월',
|
|
45
|
+
period: 3,
|
|
46
|
+
unit: 'months'
|
|
47
|
+
},
|
|
48
|
+
'1YEAR': {
|
|
49
|
+
text: '1년',
|
|
50
|
+
period: 1,
|
|
51
|
+
unit: 'years'
|
|
52
|
+
},
|
|
53
|
+
ENTIRE: {
|
|
54
|
+
text: '전체',
|
|
55
|
+
period: 0,
|
|
56
|
+
unit: null
|
|
57
|
+
},
|
|
58
|
+
NONE: {
|
|
59
|
+
text: '',
|
|
60
|
+
period: 0,
|
|
61
|
+
unit: null
|
|
62
|
+
}
|
|
63
|
+
};
|
|
@@ -13,4 +13,15 @@ Object.keys(_size).forEach(function (key) {
|
|
|
13
13
|
return _size[key];
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
+
});
|
|
17
|
+
var _datePicker = require("./date-picker");
|
|
18
|
+
Object.keys(_datePicker).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _datePicker[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _datePicker[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
16
27
|
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getDateFormat = getDateFormat;
|
|
7
|
+
exports.getSubtractDate = getSubtractDate;
|
|
8
|
+
exports.getToday = getToday;
|
|
9
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
function getDateFormat(date) {
|
|
12
|
+
if (date === void 0) {
|
|
13
|
+
date = getToday();
|
|
14
|
+
}
|
|
15
|
+
return (0, _moment.default)(date).format('YYYY-MM-DD');
|
|
16
|
+
}
|
|
17
|
+
function getToday() {
|
|
18
|
+
return (0, _moment.default)().toDate();
|
|
19
|
+
}
|
|
20
|
+
function getSubtractDate(_a) {
|
|
21
|
+
var _b = _a.date,
|
|
22
|
+
date = _b === void 0 ? getToday() : _b,
|
|
23
|
+
period = _a.period,
|
|
24
|
+
unit = _a.unit;
|
|
25
|
+
return (0, _moment.default)(date).subtract(period, unit).toDate();
|
|
26
|
+
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
export * from './src/components/badge';
|
|
2
|
+
export * from './src/components/breadcrumb';
|
|
2
3
|
export * from './src/components/button';
|
|
3
4
|
export * from './src/components/carousel';
|
|
4
5
|
export * from './src/components/checkbox';
|
|
5
6
|
export * from './src/components/date-picker';
|
|
7
|
+
export * from './src/components/divider';
|
|
8
|
+
export * from './src/components/dropdown';
|
|
9
|
+
export * from './src/components/empty-state';
|
|
10
|
+
export * from './src/components/featured-icon';
|
|
6
11
|
export * from './src/components/input';
|
|
12
|
+
export * from './src/components/modal';
|
|
13
|
+
export * from './src/components/notification';
|
|
7
14
|
export * from './src/components/pagination';
|
|
15
|
+
export * from './src/components/progress-bar';
|
|
16
|
+
export * from './src/components/progress-circle';
|
|
8
17
|
export * from './src/components/radio';
|
|
9
18
|
export * from './src/components/select';
|
|
10
19
|
export * from './src/components/shared/hintText';
|
|
11
20
|
export * from './src/components/shared/label';
|
|
12
21
|
export * from './src/components/shared';
|
|
22
|
+
export * from './src/components/slider';
|
|
13
23
|
export * from './src/components/spinner';
|
|
24
|
+
export * from './src/components/tab';
|
|
25
|
+
export * from './src/components/tag';
|
|
14
26
|
export * from './src/components/toggle';
|
|
15
27
|
export * from './src/components/tooltip';
|
|
16
28
|
export * from './src/components';
|
|
@@ -49,6 +49,7 @@ export var ButtonGroup = function (_a) {
|
|
|
49
49
|
}
|
|
50
50
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
51
51
|
onlyIcon: onlyIcon,
|
|
52
|
+
size: size,
|
|
52
53
|
disabled: disabled || child.props.disabled
|
|
53
54
|
});
|
|
54
55
|
})
|
|
@@ -59,20 +60,22 @@ ButtonGroup.Item = function (_a) {
|
|
|
59
60
|
var _c = _a.as,
|
|
60
61
|
as = _c === void 0 ? 'button' : _c,
|
|
61
62
|
label = _a.label,
|
|
63
|
+
size = _a.size,
|
|
62
64
|
onlyIcon = _a.onlyIcon,
|
|
63
65
|
icon = _a.icon,
|
|
64
66
|
disabled = _a.disabled,
|
|
65
67
|
children = _a.children,
|
|
66
|
-
|
|
68
|
+
isCurrent = _a.isCurrent,
|
|
69
|
+
props = __rest(_a, ["as", "label", "size", "onlyIcon", "icon", "disabled", "children", "isCurrent"]);
|
|
67
70
|
var renderIcon = function () {
|
|
68
|
-
var _a, _b
|
|
71
|
+
var _a, _b;
|
|
69
72
|
if (!icon) return null;
|
|
70
73
|
if (icon.type === 'icon') {
|
|
71
74
|
return _jsx(Icon, {
|
|
72
75
|
name: icon.icon,
|
|
73
|
-
width:
|
|
74
|
-
height:
|
|
75
|
-
color:
|
|
76
|
+
width: (_a = icon.size) !== null && _a !== void 0 ? _a : svgSize[size !== null && size !== void 0 ? size : 'md'],
|
|
77
|
+
height: (_b = icon.size) !== null && _b !== void 0 ? _b : svgSize[size !== null && size !== void 0 ? size : 'md'],
|
|
78
|
+
color: icon.color ? COLOR[icon.color] : 'currentColor'
|
|
76
79
|
});
|
|
77
80
|
}
|
|
78
81
|
return icon.children;
|
|
@@ -81,6 +84,10 @@ ButtonGroup.Item = function (_a) {
|
|
|
81
84
|
return /*#__PURE__*/createElement(as, __assign({
|
|
82
85
|
className: classNames('ncua-button-group__item', {
|
|
83
86
|
'is-disabled': disabled
|
|
87
|
+
}, {
|
|
88
|
+
'is-only-icon': onlyIcon
|
|
89
|
+
}, {
|
|
90
|
+
'is-current': isCurrent
|
|
84
91
|
}),
|
|
85
92
|
disabled: disabled
|
|
86
93
|
}, props), _jsxs(_Fragment, {
|
|
@@ -48,11 +48,11 @@ export var Checkbox = function (_a) {
|
|
|
48
48
|
}, props)), _jsx("span", {
|
|
49
49
|
children: text && _jsxs(_Fragment, {
|
|
50
50
|
children: [_jsx("span", __assign({
|
|
51
|
-
className: "ncua-
|
|
51
|
+
className: "ncua-checkbox-field__text"
|
|
52
52
|
}, {
|
|
53
53
|
children: text
|
|
54
54
|
})), supportText && _jsx("span", __assign({
|
|
55
|
-
className: "ncua-
|
|
55
|
+
className: "ncua-checkbox-field__support-text"
|
|
56
56
|
}, {
|
|
57
57
|
children: supportText
|
|
58
58
|
}))]
|
|
@@ -16,11 +16,12 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
16
16
|
}
|
|
17
17
|
return t;
|
|
18
18
|
};
|
|
19
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
-
import { Check, Minus } from '@ncds/ui-admin-icon';
|
|
19
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
20
|
import classNames from 'classnames';
|
|
22
21
|
import { forwardRef } from 'react';
|
|
23
|
-
|
|
22
|
+
/**
|
|
23
|
+
* 현재 destructive 속성은 현재 디자인 시스템에 존재하지 않으니 사용하지 않는 것을 권장합니다.
|
|
24
|
+
*/
|
|
24
25
|
export var CheckboxInput = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
25
26
|
var _b = _a.size,
|
|
26
27
|
size = _b === void 0 ? 'sm' : _b,
|
|
@@ -32,7 +33,43 @@ export var CheckboxInput = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
32
33
|
destructive = _d === void 0 ? false : _d,
|
|
33
34
|
onChange = _a.onChange,
|
|
34
35
|
props = __rest(_a, ["size", "indeterminate", "disabled", "className", "destructive", "onChange"]);
|
|
35
|
-
|
|
36
|
+
/**
|
|
37
|
+
* 체크박스 체크시 나오는 아이콘은 아이콘 컴포넌트와 굵기가 달라 별도로 정의하였습니다.
|
|
38
|
+
*/
|
|
39
|
+
var checkIcon = _jsx(_Fragment, {
|
|
40
|
+
children: _jsx("svg", __assign({
|
|
41
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
42
|
+
width: "12",
|
|
43
|
+
height: "12",
|
|
44
|
+
viewBox: "0 0 12 12",
|
|
45
|
+
fill: "none"
|
|
46
|
+
}, {
|
|
47
|
+
children: _jsx("path", {
|
|
48
|
+
d: "M10 3L4.5 8.5L2 6",
|
|
49
|
+
stroke: disabled ? '#D3D4D8' : '#171818',
|
|
50
|
+
"stroke-width": "1.6666",
|
|
51
|
+
"stroke-linecap": "round",
|
|
52
|
+
"stroke-linejoin": "round"
|
|
53
|
+
})
|
|
54
|
+
}))
|
|
55
|
+
});
|
|
56
|
+
var indeterminateIcon = _jsx(_Fragment, {
|
|
57
|
+
children: _jsx("svg", __assign({
|
|
58
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
59
|
+
width: "12",
|
|
60
|
+
height: "12",
|
|
61
|
+
viewBox: "0 0 12 12",
|
|
62
|
+
fill: "none"
|
|
63
|
+
}, {
|
|
64
|
+
children: _jsx("path", {
|
|
65
|
+
d: "M2.5 6H9.5",
|
|
66
|
+
stroke: disabled ? '#D3D4D8' : '#2F2F30',
|
|
67
|
+
"stroke-width": "1.66666",
|
|
68
|
+
"stroke-linecap": "round",
|
|
69
|
+
"stroke-linejoin": "round"
|
|
70
|
+
})
|
|
71
|
+
}))
|
|
72
|
+
});
|
|
36
73
|
return _jsxs("span", __assign({
|
|
37
74
|
className: classNames('ncua-checkbox-input', "ncua-checkbox-input--".concat(size), {
|
|
38
75
|
destructive: destructive
|
|
@@ -46,15 +83,7 @@ export var CheckboxInput = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
46
83
|
}, props)), _jsx("span", __assign({
|
|
47
84
|
className: "ncua-checkbox-input__ico"
|
|
48
85
|
}, {
|
|
49
|
-
children: !indeterminate ?
|
|
50
|
-
width: 12,
|
|
51
|
-
height: 12,
|
|
52
|
-
color: COLOR[svgColor]
|
|
53
|
-
}) : _jsx(Minus, {
|
|
54
|
-
width: 12,
|
|
55
|
-
height: 12,
|
|
56
|
-
color: COLOR[svgColor]
|
|
57
|
-
})
|
|
86
|
+
children: !indeterminate ? checkIcon : indeterminateIcon
|
|
58
87
|
}))]
|
|
59
88
|
}));
|
|
60
89
|
});
|
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { useEffect } from 'react';
|
|
13
|
+
import { RangeDatePicker } from './RangeDatePicker';
|
|
14
|
+
import { ButtonGroup } from '../button';
|
|
15
|
+
import { getDateFormat, getSubtractDate } from '../../utils/date-picker';
|
|
16
|
+
import { PERIOD_ITEM } from '../../constant/date-picker';
|
|
17
|
+
export var RangeDatePickerWithButtons = function (_a) {
|
|
18
|
+
var currentButtonId = _a.currentButtonId,
|
|
19
|
+
setCurrentButtonId = _a.setCurrentButtonId,
|
|
20
|
+
startDateOptions = _a.startDateOptions,
|
|
21
|
+
endDateOptions = _a.endDateOptions,
|
|
22
|
+
validationOption = _a.validationOption,
|
|
23
|
+
periodKeys = _a.periodKeys,
|
|
24
|
+
onDateValidation = _a.onDateValidation;
|
|
25
|
+
var setCalculatedDate = function () {
|
|
26
|
+
var currentPeriodItem = PERIOD_ITEM[currentButtonId];
|
|
27
|
+
if (!currentPeriodItem) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (currentButtonId === 'ENTIRE') {
|
|
31
|
+
startDateOptions.onChangeDate('');
|
|
32
|
+
endDateOptions.onChangeDate('');
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
var startDate = getDateFormat(getSubtractDate({
|
|
36
|
+
period: currentPeriodItem.period,
|
|
37
|
+
unit: currentPeriodItem.unit
|
|
38
|
+
}));
|
|
39
|
+
startDateOptions.onChangeDate(startDate);
|
|
40
|
+
if (endDateOptions.currentDate !== getDateFormat()) {
|
|
41
|
+
endDateOptions.onChangeDate(getDateFormat());
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
var handleOnChangeDate = function (date, type) {
|
|
45
|
+
type === 'START' ? startDateOptions.onChangeDate(date) : endDateOptions.onChangeDate(date);
|
|
46
|
+
currentButtonId && setCurrentButtonId('NONE');
|
|
47
|
+
};
|
|
48
|
+
useEffect(function () {
|
|
49
|
+
if (currentButtonId !== 'NONE') {
|
|
50
|
+
setCalculatedDate();
|
|
51
|
+
}
|
|
52
|
+
}, [currentButtonId]);
|
|
53
|
+
return _jsxs("div", __assign({
|
|
54
|
+
className: "ncua-range-date-picker-with-buttons"
|
|
55
|
+
}, {
|
|
56
|
+
children: [_jsx(ButtonGroup, __assign({
|
|
57
|
+
size: "sm"
|
|
58
|
+
}, {
|
|
59
|
+
children: periodKeys.map(function (key) {
|
|
60
|
+
return _jsx(ButtonGroup.Item, {
|
|
61
|
+
isCurrent: currentButtonId === key,
|
|
62
|
+
label: PERIOD_ITEM[key].text,
|
|
63
|
+
onClick: function () {
|
|
64
|
+
return setCurrentButtonId(key);
|
|
65
|
+
}
|
|
66
|
+
}, key);
|
|
67
|
+
})
|
|
68
|
+
})), _jsx(RangeDatePicker, {
|
|
69
|
+
startDateOptions: __assign(__assign({}, startDateOptions), {
|
|
70
|
+
onChangeDate: function (date) {
|
|
71
|
+
return handleOnChangeDate(date, 'START');
|
|
72
|
+
}
|
|
73
|
+
}),
|
|
74
|
+
endDateOptions: __assign(__assign({}, endDateOptions), {
|
|
75
|
+
onChangeDate: function (date) {
|
|
76
|
+
return handleOnChangeDate(date, 'END');
|
|
77
|
+
}
|
|
78
|
+
}),
|
|
79
|
+
validationOption: validationOption,
|
|
80
|
+
onDateValidation: onDateValidation
|
|
81
|
+
})]
|
|
82
|
+
}));
|
|
83
|
+
};
|
|
@@ -20,19 +20,12 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
20
20
|
import Icon from '@ncds/ui-admin-icon';
|
|
21
21
|
import classNames from 'classnames';
|
|
22
22
|
import { forwardRef } from 'react';
|
|
23
|
-
import { COLOR } from '../../../constant/color';
|
|
24
23
|
var iconSizeMap = {
|
|
25
24
|
sm: 16,
|
|
26
25
|
md: 20,
|
|
27
26
|
lg: 24,
|
|
28
27
|
xl: 28
|
|
29
28
|
};
|
|
30
|
-
var iconStrokeColorMap = {
|
|
31
|
-
neutral: 'gray700',
|
|
32
|
-
error: 'red500',
|
|
33
|
-
warning: 'orange500',
|
|
34
|
-
success: 'green600'
|
|
35
|
-
};
|
|
36
29
|
export var FeaturedIcon = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
37
30
|
var name = _a.name,
|
|
38
31
|
_b = _a.theme,
|
|
@@ -43,15 +36,6 @@ export var FeaturedIcon = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
43
36
|
size = _d === void 0 ? 'md' : _d,
|
|
44
37
|
className = _a.className,
|
|
45
38
|
rest = __rest(_a, ["name", "theme", "color", "size", "className"]);
|
|
46
|
-
var getIconColor = function () {
|
|
47
|
-
if (theme === 'dark-circle') {
|
|
48
|
-
return 'white';
|
|
49
|
-
}
|
|
50
|
-
if (theme === 'square-outline') {
|
|
51
|
-
return 'gray700';
|
|
52
|
-
}
|
|
53
|
-
return iconStrokeColorMap[color];
|
|
54
|
-
};
|
|
55
39
|
return _jsxs("div", __assign({
|
|
56
40
|
ref: ref,
|
|
57
41
|
className: classNames('ncua-featured-icon', "ncua-featured-icon--".concat(theme), "ncua-featured-icon--".concat(color), "ncua-featured-icon--".concat(size), className)
|
|
@@ -65,8 +49,7 @@ export var FeaturedIcon = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
65
49
|
}), _jsx(Icon, {
|
|
66
50
|
name: name,
|
|
67
51
|
width: iconSizeMap[size],
|
|
68
|
-
height: iconSizeMap[size]
|
|
69
|
-
color: COLOR[getIconColor()]
|
|
52
|
+
height: iconSizeMap[size]
|
|
70
53
|
})]
|
|
71
54
|
}));
|
|
72
55
|
});
|
|
@@ -4,9 +4,10 @@ export * from './button';
|
|
|
4
4
|
export * from './carousel';
|
|
5
5
|
export * from './checkbox';
|
|
6
6
|
export * from './date-picker';
|
|
7
|
-
export * from './featured-icon';
|
|
8
7
|
export * from './divider';
|
|
8
|
+
export * from './dropdown';
|
|
9
9
|
export * from './empty-state';
|
|
10
|
+
export * from './featured-icon';
|
|
10
11
|
export * from './input';
|
|
11
12
|
export * from './modal';
|
|
12
13
|
export * from './notification';
|
|
@@ -16,6 +17,7 @@ export * from './progress-circle';
|
|
|
16
17
|
export * from './radio';
|
|
17
18
|
export * from './select';
|
|
18
19
|
export * from './shared';
|
|
20
|
+
export * from './slider';
|
|
19
21
|
export * from './spinner';
|
|
20
22
|
export * from './tab';
|
|
21
23
|
export * from './tag';
|
|
@@ -151,7 +151,8 @@ export var InputBase = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
151
151
|
className: classNames('ncua-input', "ncua-input--".concat(size), {
|
|
152
152
|
destructive: destructive,
|
|
153
153
|
'is-disabled': disabled,
|
|
154
|
-
'ncua-input__trailing-button': (trailingElement === null || trailingElement === void 0 ? void 0 : trailingElement.type) === 'button'
|
|
154
|
+
'ncua-input__trailing-button': (trailingElement === null || trailingElement === void 0 ? void 0 : trailingElement.type) === 'button',
|
|
155
|
+
'ncua-input__leading-text-wrap': (leadingElement === null || leadingElement === void 0 ? void 0 : leadingElement.type) === 'text'
|
|
155
156
|
})
|
|
156
157
|
}, {
|
|
157
158
|
children: [renderLabel(), _jsxs("div", __assign({
|
|
@@ -24,17 +24,19 @@ import { HintText } from '../shared/hintText/HintText';
|
|
|
24
24
|
export var Textarea = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
25
25
|
var _b;
|
|
26
26
|
var className = _a.className,
|
|
27
|
+
_c = _a.size,
|
|
28
|
+
size = _c === void 0 ? 'md' : _c,
|
|
27
29
|
label = _a.label,
|
|
28
30
|
required = _a.required,
|
|
29
31
|
disabled = _a.disabled,
|
|
30
32
|
hintText = _a.hintText,
|
|
31
33
|
characterCount = _a.characterCount,
|
|
32
34
|
destructive = _a.destructive,
|
|
33
|
-
props = __rest(_a, ["className", "label", "required", "disabled", "hintText", "characterCount", "destructive"]);
|
|
35
|
+
props = __rest(_a, ["className", "size", "label", "required", "disabled", "hintText", "characterCount", "destructive"]);
|
|
34
36
|
var textareaRef = useRef(null);
|
|
35
|
-
var
|
|
36
|
-
textCount =
|
|
37
|
-
setTextCount =
|
|
37
|
+
var _d = useState(0),
|
|
38
|
+
textCount = _d[0],
|
|
39
|
+
setTextCount = _d[1];
|
|
38
40
|
var shouldShowHintArea = hintText || characterCount;
|
|
39
41
|
useEffect(function () {
|
|
40
42
|
if (textareaRef.current && characterCount) {
|
|
@@ -51,7 +53,7 @@ export var Textarea = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
51
53
|
}
|
|
52
54
|
}, [characterCount]);
|
|
53
55
|
return _jsxs("div", __assign({
|
|
54
|
-
className: classNames('ncua-input', 'ncua-input--textarea', {
|
|
56
|
+
className: classNames('ncua-input', 'ncua-input--textarea', "ncua-input--textarea--".concat(size), {
|
|
55
57
|
destructive: destructive,
|
|
56
58
|
'is-disabled': disabled
|
|
57
59
|
}, className)
|
|
@@ -94,7 +96,11 @@ export var Textarea = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
94
96
|
children: _jsxs("span", __assign({
|
|
95
97
|
className: "ncua-input__text-count-text"
|
|
96
98
|
}, {
|
|
97
|
-
children: [
|
|
99
|
+
children: [_jsx("span", __assign({
|
|
100
|
+
className: "ncua-input__text-count-text-count"
|
|
101
|
+
}, {
|
|
102
|
+
children: textCount
|
|
103
|
+
})), "/", (_b = props.maxLength) !== null && _b !== void 0 ? _b : 0]
|
|
98
104
|
}))
|
|
99
105
|
}))]
|
|
100
106
|
}))]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './Modal';
|
|
@@ -21,6 +21,9 @@ import Icon from '@ncds/ui-admin-icon';
|
|
|
21
21
|
import classNames from 'classnames';
|
|
22
22
|
import { forwardRef } from 'react';
|
|
23
23
|
import { HintText } from '../shared/hintText/HintText';
|
|
24
|
+
/**
|
|
25
|
+
* 현재 icon과 destructive 속성은 현재 디자인 시스템에 존재하지 않으니 사용하지 않는 것을 권장합니다.
|
|
26
|
+
*/
|
|
24
27
|
export var Select = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
25
28
|
var icon = _a.icon,
|
|
26
29
|
placeholder = _a.placeholder,
|
|
@@ -20,7 +20,7 @@ export var Tag = function (_a) {
|
|
|
20
20
|
count = _a.count,
|
|
21
21
|
close = _a.close,
|
|
22
22
|
onButtonClick = _a.onButtonClick;
|
|
23
|
-
var
|
|
23
|
+
var iconSize = {
|
|
24
24
|
sm: 14,
|
|
25
25
|
md: 16
|
|
26
26
|
};
|
|
@@ -31,8 +31,8 @@ export var Tag = function (_a) {
|
|
|
31
31
|
}, {
|
|
32
32
|
children: [icon && icon.name !== 'dot' && _jsx(Icon, {
|
|
33
33
|
name: icon.name,
|
|
34
|
-
width:
|
|
35
|
-
height:
|
|
34
|
+
width: iconSize[size],
|
|
35
|
+
height: iconSize[size],
|
|
36
36
|
color: icon.color
|
|
37
37
|
}), _jsx("span", __assign({
|
|
38
38
|
className: "ncua-tag__text"
|
|
@@ -50,8 +50,8 @@ export var Tag = function (_a) {
|
|
|
50
50
|
children: _jsx(Icon, {
|
|
51
51
|
name: "x-close",
|
|
52
52
|
color: COLOR.gray300,
|
|
53
|
-
width:
|
|
54
|
-
height:
|
|
53
|
+
width: iconSize[size],
|
|
54
|
+
height: iconSize[size]
|
|
55
55
|
})
|
|
56
56
|
}))]
|
|
57
57
|
}));
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export var PERIOD_ITEM = {
|
|
2
|
+
TODAY: {
|
|
3
|
+
text: '오늘',
|
|
4
|
+
period: 0,
|
|
5
|
+
unit: 'days'
|
|
6
|
+
},
|
|
7
|
+
YESTERDAY: {
|
|
8
|
+
text: '어제',
|
|
9
|
+
period: 1,
|
|
10
|
+
unit: 'days'
|
|
11
|
+
},
|
|
12
|
+
'3DAYS': {
|
|
13
|
+
text: '3일',
|
|
14
|
+
period: 3,
|
|
15
|
+
unit: 'days'
|
|
16
|
+
},
|
|
17
|
+
'7DAYS': {
|
|
18
|
+
text: '7일',
|
|
19
|
+
period: 7,
|
|
20
|
+
unit: 'days'
|
|
21
|
+
},
|
|
22
|
+
'1WEEK': {
|
|
23
|
+
text: '1주일',
|
|
24
|
+
period: 1,
|
|
25
|
+
unit: 'week'
|
|
26
|
+
},
|
|
27
|
+
'15DAYS': {
|
|
28
|
+
text: '15일',
|
|
29
|
+
period: 15,
|
|
30
|
+
unit: 'days'
|
|
31
|
+
},
|
|
32
|
+
'1MONTHS': {
|
|
33
|
+
text: '1개월',
|
|
34
|
+
period: 1,
|
|
35
|
+
unit: 'months'
|
|
36
|
+
},
|
|
37
|
+
'3MONTHS': {
|
|
38
|
+
text: '3개월',
|
|
39
|
+
period: 3,
|
|
40
|
+
unit: 'months'
|
|
41
|
+
},
|
|
42
|
+
'1YEAR': {
|
|
43
|
+
text: '1년',
|
|
44
|
+
period: 1,
|
|
45
|
+
unit: 'years'
|
|
46
|
+
},
|
|
47
|
+
ENTIRE: {
|
|
48
|
+
text: '전체',
|
|
49
|
+
period: 0,
|
|
50
|
+
unit: null
|
|
51
|
+
},
|
|
52
|
+
NONE: {
|
|
53
|
+
text: '',
|
|
54
|
+
period: 0,
|
|
55
|
+
unit: null
|
|
56
|
+
}
|
|
57
|
+
};
|