@ncds/ui-admin 0.0.23 → 0.0.25
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 +29 -15
- 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 +29 -15
- 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 +4 -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 +259 -120
- package/package.json +1 -1
|
@@ -42,8 +42,9 @@ export var InputBase = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
42
42
|
destructive = _a.destructive,
|
|
43
43
|
leadingElement = _a.leadingElement,
|
|
44
44
|
trailingElement = _a.trailingElement,
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
showHelpIcon = _a.showHelpIcon,
|
|
46
|
+
props = __rest(_a, ["size", "required", "label", "hintText", "disabled", "validation", "destructive", "leadingElement", "trailingElement", "showHelpIcon"]);
|
|
47
|
+
var renderOutsideSlot = function (slot) {
|
|
47
48
|
if (slot.type === 'custom' && slot.placement !== 'outside') {
|
|
48
49
|
return null;
|
|
49
50
|
}
|
|
@@ -69,6 +70,7 @@ export var InputBase = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
69
70
|
}
|
|
70
71
|
};
|
|
71
72
|
var renderInsideSlot = function (slot, position) {
|
|
73
|
+
var _a, _b;
|
|
72
74
|
switch (slot.type) {
|
|
73
75
|
case 'icon':
|
|
74
76
|
return _jsx("div", __assign({
|
|
@@ -78,8 +80,8 @@ export var InputBase = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
78
80
|
className: classNames("ncua-input__".concat(position, "-icon"), slot.className),
|
|
79
81
|
name: slot.icon,
|
|
80
82
|
color: slot.color ? COLOR[slot.color] : undefined,
|
|
81
|
-
width: generalSvgSize[size],
|
|
82
|
-
height: generalSvgSize[size]
|
|
83
|
+
width: (_a = slot.size) !== null && _a !== void 0 ? _a : generalSvgSize[size],
|
|
84
|
+
height: (_b = slot.size) !== null && _b !== void 0 ? _b : generalSvgSize[size]
|
|
83
85
|
})
|
|
84
86
|
}));
|
|
85
87
|
case 'custom':
|
|
@@ -129,32 +131,44 @@ export var InputBase = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
129
131
|
}
|
|
130
132
|
return null;
|
|
131
133
|
};
|
|
134
|
+
var renderLabel = function () {
|
|
135
|
+
if (!label) return null;
|
|
136
|
+
return _jsxs("div", __assign({
|
|
137
|
+
className: classNames('ncua-input__label', "ncua-input__label--".concat(size))
|
|
138
|
+
}, {
|
|
139
|
+
children: [_jsx(Label, __assign({
|
|
140
|
+
isRequired: required,
|
|
141
|
+
htmlFor: props.id
|
|
142
|
+
}, {
|
|
143
|
+
children: label
|
|
144
|
+
})), showHelpIcon && _jsx(Icon, {
|
|
145
|
+
className: "ncua-input__help-icon",
|
|
146
|
+
name: "help-circle"
|
|
147
|
+
})]
|
|
148
|
+
}));
|
|
149
|
+
};
|
|
132
150
|
return _jsxs("div", __assign({
|
|
133
151
|
className: classNames('ncua-input', "ncua-input--".concat(size), {
|
|
134
152
|
destructive: destructive,
|
|
135
153
|
'is-disabled': disabled,
|
|
136
|
-
'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'
|
|
137
156
|
})
|
|
138
157
|
}, {
|
|
139
|
-
children: [
|
|
140
|
-
isRequired: required,
|
|
141
|
-
htmlFor: props.id,
|
|
142
|
-
className: "ncua-input__label--".concat(size)
|
|
143
|
-
}, {
|
|
144
|
-
children: label
|
|
145
|
-
})), _jsxs("div", __assign({
|
|
158
|
+
children: [renderLabel(), _jsxs("div", __assign({
|
|
146
159
|
className: "ncua-input__content"
|
|
147
160
|
}, {
|
|
148
|
-
children: [leadingElement && renderOutsideSlot(leadingElement
|
|
149
|
-
className: classNames('ncua-input__field', "ncua-
|
|
161
|
+
children: [leadingElement && renderOutsideSlot(leadingElement), _jsxs("div", __assign({
|
|
162
|
+
className: classNames('ncua-input__field', "ncua-input__field--".concat(size))
|
|
150
163
|
}, {
|
|
151
164
|
children: [leadingElement && renderInsideSlot(leadingElement, 'left'), _jsx("input", __assign({
|
|
152
165
|
ref: ref,
|
|
153
166
|
type: "text",
|
|
154
167
|
disabled: disabled
|
|
155
168
|
}, props)), trailingElement && renderInsideSlot(trailingElement, 'right'), renderClearButton(), renderStatusIcon()]
|
|
156
|
-
})), trailingElement && renderOutsideSlot(trailingElement
|
|
169
|
+
})), trailingElement && renderOutsideSlot(trailingElement)]
|
|
157
170
|
})), hintText && _jsx(HintText, __assign({
|
|
171
|
+
className: "ncua-input__hint-text",
|
|
158
172
|
destructive: destructive
|
|
159
173
|
}, {
|
|
160
174
|
children: hintText
|
|
@@ -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
|
+
};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from './size';
|
|
1
|
+
export * from './size';
|
|
2
|
+
export * from './date-picker';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import moment from 'moment';
|
|
2
|
+
export function getDateFormat(date) {
|
|
3
|
+
if (date === void 0) {
|
|
4
|
+
date = getToday();
|
|
5
|
+
}
|
|
6
|
+
return moment(date).format('YYYY-MM-DD');
|
|
7
|
+
}
|
|
8
|
+
export function getToday() {
|
|
9
|
+
return moment().toDate();
|
|
10
|
+
}
|
|
11
|
+
export function getSubtractDate(_a) {
|
|
12
|
+
var _b = _a.date,
|
|
13
|
+
date = _b === void 0 ? getToday() : _b,
|
|
14
|
+
period = _a.period,
|
|
15
|
+
unit = _a.unit;
|
|
16
|
+
return moment(date).subtract(period, unit).toDate();
|
|
17
|
+
}
|
package/dist/types/index.d.ts
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';
|
|
@@ -9,7 +9,7 @@ interface SideCommon {
|
|
|
9
9
|
interface SideIcon {
|
|
10
10
|
type: 'icon';
|
|
11
11
|
icon: IconName;
|
|
12
|
-
size?:
|
|
12
|
+
size?: number;
|
|
13
13
|
color?: ColorKeyType;
|
|
14
14
|
}
|
|
15
15
|
interface SideCustom {
|
|
@@ -19,10 +19,12 @@ interface SideCustom {
|
|
|
19
19
|
type SideSlotType = SideCommon & (SideIcon | SideCustom);
|
|
20
20
|
interface ButtonGroupItemCommonProps {
|
|
21
21
|
label?: string;
|
|
22
|
+
size?: ButtonGroupSize;
|
|
22
23
|
icon?: SideSlotType;
|
|
23
24
|
children?: React.ReactNode;
|
|
24
25
|
onlyIcon?: boolean;
|
|
25
26
|
disabled?: boolean;
|
|
27
|
+
isCurrent?: boolean;
|
|
26
28
|
}
|
|
27
29
|
interface ButtonGroupItemButtonProps extends ButtonGroupItemCommonProps, ComponentProps<'button'> {
|
|
28
30
|
as?: 'button';
|
|
@@ -42,7 +44,7 @@ interface ButtonGroupProps {
|
|
|
42
44
|
}
|
|
43
45
|
export declare const ButtonGroup: {
|
|
44
46
|
({ children, className, hasBorder, size, onlyIcon, disabled, }: ButtonGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
-
Item({ as, label, onlyIcon, icon, disabled, children, ...props }: ButtonGroupItemProps): React.ReactElement<{
|
|
47
|
+
Item({ as, label, size, onlyIcon, icon, disabled, children, isCurrent, ...props }: ButtonGroupItemProps): React.ReactElement<{
|
|
46
48
|
ref?: React.LegacyRef<HTMLButtonElement> | undefined;
|
|
47
49
|
key?: React.Key | null | undefined;
|
|
48
50
|
form?: string | undefined;
|
|
@@ -6,5 +6,8 @@ export interface CheckboxInputProps extends Omit<ComponentPropsWithRef<'input'>,
|
|
|
6
6
|
destructive?: boolean;
|
|
7
7
|
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* 현재 destructive 속성은 현재 디자인 시스템에 존재하지 않으니 사용하지 않는 것을 권장합니다.
|
|
11
|
+
*/
|
|
9
12
|
export declare const CheckboxInput: import("react").ForwardRefExoticComponent<CheckboxInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
10
13
|
//# sourceMappingURL=CheckboxInput.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { RangeDatePickerProps } from './RangeDatePicker';
|
|
3
|
+
import { PERIOD_ITEM } from '../../constant/date-picker';
|
|
4
|
+
export type PeriodKeyType = keyof typeof PERIOD_ITEM;
|
|
5
|
+
type RangeDatePickerWithButtonsProps = {
|
|
6
|
+
currentButtonId: PeriodKeyType;
|
|
7
|
+
setCurrentButtonId: Dispatch<SetStateAction<PeriodKeyType>>;
|
|
8
|
+
periodKeys: PeriodKeyType[];
|
|
9
|
+
} & RangeDatePickerProps;
|
|
10
|
+
export declare const RangeDatePickerWithButtons: ({ currentButtonId, setCurrentButtonId, startDateOptions, endDateOptions, validationOption, periodKeys, onDateValidation, }: RangeDatePickerWithButtonsProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=RangeDatePickerWithButtons.d.ts.map
|
|
@@ -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';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IconName } from '@ncds/ui-admin-icon';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { COLOR } from '../../../constant/color';
|
|
4
|
+
import { Size } from '../../../constant/size';
|
|
4
5
|
interface InputSideButtonSlot {
|
|
5
6
|
type: 'button';
|
|
6
7
|
label: string;
|
|
@@ -14,6 +15,7 @@ interface InputSideTextSlot {
|
|
|
14
15
|
interface InputSideIconSlot {
|
|
15
16
|
type: 'icon';
|
|
16
17
|
icon: IconName;
|
|
18
|
+
size?: number | string;
|
|
17
19
|
color?: keyof typeof COLOR;
|
|
18
20
|
className?: string;
|
|
19
21
|
}
|
|
@@ -28,12 +30,13 @@ interface InputBaseCommonProps extends Omit<React.InputHTMLAttributes<HTMLInputE
|
|
|
28
30
|
required?: boolean;
|
|
29
31
|
label?: string;
|
|
30
32
|
hintText?: string;
|
|
31
|
-
size?: 'xs' | 'md'
|
|
33
|
+
size?: Extract<Size, 'xs' | 'md'>;
|
|
32
34
|
disabled?: boolean;
|
|
33
35
|
validation?: boolean;
|
|
34
36
|
destructive?: boolean;
|
|
35
37
|
leadingElement?: InputLeadingSlotType;
|
|
36
38
|
trailingElement?: InputTrailingSlotType;
|
|
39
|
+
showHelpIcon?: boolean;
|
|
37
40
|
}
|
|
38
41
|
interface NoneClearableInputBaseProps extends InputBaseCommonProps {
|
|
39
42
|
clearText?: never;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ComponentPropsWithRef } from 'react';
|
|
2
|
+
import { Size } from '../../../constant/size';
|
|
2
3
|
interface TextareaProps extends ComponentPropsWithRef<'textarea'> {
|
|
3
4
|
className?: string;
|
|
5
|
+
size?: Extract<Size, 'sm' | 'md'>;
|
|
4
6
|
label?: string;
|
|
5
7
|
hintText?: string;
|
|
6
8
|
required?: boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Icon, { IconName } from '@ncds/ui-admin-icon';
|
|
2
|
+
import { COLOR } from '@ncds/ui-admin/constant/color';
|
|
2
3
|
import { Size } from '@ncds/ui/constant/size';
|
|
3
4
|
import { ComponentPropsWithRef, PropsWithChildren } from 'react';
|
|
4
5
|
import { UseFormRegisterReturn } from 'react-hook-form';
|
|
5
|
-
import { COLOR } from '@ncds/ui-admin/constant/color';
|
|
6
6
|
type BaseSelectProps = Omit<ComponentPropsWithRef<'select'>, 'size'>;
|
|
7
7
|
export type OptionType = {
|
|
8
8
|
id: string | number;
|
|
@@ -24,6 +24,9 @@ export interface SelectProps extends PropsWithChildren<BaseSelectProps> {
|
|
|
24
24
|
register?: UseFormRegisterReturn;
|
|
25
25
|
type?: 'default' | 'simple';
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* 현재 icon과 destructive 속성은 현재 디자인 시스템에 존재하지 않으니 사용하지 않는 것을 권장합니다.
|
|
29
|
+
*/
|
|
27
30
|
export declare const Select: import("react").ForwardRefExoticComponent<Omit<SelectProps, "ref"> & import("react").RefAttributes<HTMLSelectElement>>;
|
|
28
31
|
export {};
|
|
29
32
|
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export declare const PERIOD_ITEM: {
|
|
2
|
+
TODAY: {
|
|
3
|
+
text: string;
|
|
4
|
+
period: number;
|
|
5
|
+
unit: string;
|
|
6
|
+
};
|
|
7
|
+
YESTERDAY: {
|
|
8
|
+
text: string;
|
|
9
|
+
period: number;
|
|
10
|
+
unit: string;
|
|
11
|
+
};
|
|
12
|
+
'3DAYS': {
|
|
13
|
+
text: string;
|
|
14
|
+
period: number;
|
|
15
|
+
unit: string;
|
|
16
|
+
};
|
|
17
|
+
'7DAYS': {
|
|
18
|
+
text: string;
|
|
19
|
+
period: number;
|
|
20
|
+
unit: string;
|
|
21
|
+
};
|
|
22
|
+
'1WEEK': {
|
|
23
|
+
text: string;
|
|
24
|
+
period: number;
|
|
25
|
+
unit: string;
|
|
26
|
+
};
|
|
27
|
+
'15DAYS': {
|
|
28
|
+
text: string;
|
|
29
|
+
period: number;
|
|
30
|
+
unit: string;
|
|
31
|
+
};
|
|
32
|
+
'1MONTHS': {
|
|
33
|
+
text: string;
|
|
34
|
+
period: number;
|
|
35
|
+
unit: string;
|
|
36
|
+
};
|
|
37
|
+
'3MONTHS': {
|
|
38
|
+
text: string;
|
|
39
|
+
period: number;
|
|
40
|
+
unit: string;
|
|
41
|
+
};
|
|
42
|
+
'1YEAR': {
|
|
43
|
+
text: string;
|
|
44
|
+
period: number;
|
|
45
|
+
unit: string;
|
|
46
|
+
};
|
|
47
|
+
ENTIRE: {
|
|
48
|
+
text: string;
|
|
49
|
+
period: number;
|
|
50
|
+
unit: null;
|
|
51
|
+
};
|
|
52
|
+
NONE: {
|
|
53
|
+
text: string;
|
|
54
|
+
period: number;
|
|
55
|
+
unit: null;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=date-picker.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DurationInputArg1, DurationInputArg2 } from 'moment';
|
|
2
|
+
export declare function getDateFormat(date?: Date | string): string;
|
|
3
|
+
export declare function getToday(): Date;
|
|
4
|
+
export declare function getSubtractDate({ date, period, unit, }: {
|
|
5
|
+
date?: string | Date;
|
|
6
|
+
period: DurationInputArg1;
|
|
7
|
+
unit: DurationInputArg2;
|
|
8
|
+
}): Date;
|
|
9
|
+
//# sourceMappingURL=date-picker.d.ts.map
|