@ncds/ui-admin 1.5.3 → 1.5.5
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/date-picker/DatePicker.js +3 -2
- package/dist/cjs/src/components/dropdown/Dropdown.js +1 -1
- package/dist/cjs/src/components/image-file-input/ImageFileInput.js +9 -14
- package/dist/cjs/src/components/index.js +22 -11
- package/dist/cjs/src/components/input/InputBase.js +3 -0
- package/dist/cjs/src/components/modal/Modal.js +6 -4
- package/dist/cjs/src/components/pagination/NavButton.js +2 -2
- package/dist/cjs/src/components/selectbox/SelectBox.js +1 -1
- package/dist/esm/src/components/date-picker/DatePicker.js +3 -2
- package/dist/esm/src/components/dropdown/Dropdown.js +1 -1
- package/dist/esm/src/components/image-file-input/ImageFileInput.js +5 -10
- package/dist/esm/src/components/index.js +3 -2
- package/dist/esm/src/components/input/InputBase.js +3 -0
- package/dist/esm/src/components/modal/Modal.js +6 -4
- package/dist/esm/src/components/pagination/NavButton.js +1 -1
- package/dist/esm/src/components/selectbox/SelectBox.js +1 -1
- package/dist/esm/src/components/tag/Tag.js +1 -1
- package/dist/types/src/components/badge/BadgeGroup.d.ts +4 -4
- package/dist/types/src/components/button/Button.d.ts +2 -2
- package/dist/types/src/components/button/ButtonGroup.d.ts +2 -2
- package/dist/types/src/components/date-picker/DatePicker.d.ts +1 -0
- package/dist/types/src/components/dropdown/Dropdown.d.ts +1 -0
- package/dist/types/src/components/image-file-input/ImageFileInput.d.ts +1 -8
- package/dist/types/src/components/index.d.ts +2 -1
- package/dist/types/src/components/modal/Modal.d.ts +4 -2
- package/dist/types/src/components/selectbox/SelectBox.d.ts +2 -2
- package/dist/types/src/components/tab/TabButton.d.ts +1 -1
- package/dist/types/src/components/tag/Tag.d.ts +3 -3
- package/dist/ui-admin/assets/styles/style.css +10 -4
- package/package.json +1 -1
- /package/dist/cjs/src/components/{file-upload → file-input}/FileInput.js +0 -0
- /package/dist/cjs/src/components/{file-upload → file-input}/index.js +0 -0
- /package/dist/esm/src/components/{file-upload → file-input}/FileInput.js +0 -0
- /package/dist/esm/src/components/{file-upload → file-input}/index.js +0 -0
- /package/dist/types/src/components/{file-upload → file-input}/FileInput.d.ts +0 -0
- /package/dist/types/src/components/{file-upload → file-input}/index.d.ts +0 -0
|
@@ -49,7 +49,8 @@ var DatePicker = exports.DatePicker = /*#__PURE__*/(0, _react.forwardRef)(functi
|
|
|
49
49
|
_d = _a.isEndDate,
|
|
50
50
|
isEndDate = _d === void 0 ? false : _d,
|
|
51
51
|
onValidationError = _a.onValidationError,
|
|
52
|
-
|
|
52
|
+
className = _a.className,
|
|
53
|
+
attrs = __rest(_a, ["shouldFocus", "currentDate", "size", "onChangeDate", "datePickerOptions", "isEndDate", "onValidationError", "className"]);
|
|
53
54
|
var flatpickrInstanceRef = (0, _react.useRef)(null);
|
|
54
55
|
var dateFormatRef = (0, _react.useRef)('Y-m-d');
|
|
55
56
|
var minMaxDateRef = (0, _react.useRef)({});
|
|
@@ -302,7 +303,7 @@ var DatePicker = exports.DatePicker = /*#__PURE__*/(0, _react.forwardRef)(functi
|
|
|
302
303
|
'ncua-date-picker--disabled': attrs.disabled,
|
|
303
304
|
'ncua-date-picker--has-time': hasTimeOption,
|
|
304
305
|
'ncua-date-picker--destructive': attrs.destructive
|
|
305
|
-
})
|
|
306
|
+
}, className)
|
|
306
307
|
}, {
|
|
307
308
|
children: [(0, _jsxRuntime.jsx)(_reactFlatpickr.default, __assign({}, attrs, {
|
|
308
309
|
ref: ref || undefined,
|
|
@@ -150,7 +150,7 @@ var Dropdown = function (_a) {
|
|
|
150
150
|
return null;
|
|
151
151
|
};
|
|
152
152
|
var renderItem = function (item) {
|
|
153
|
-
var itemClasses = ['ncua-dropdown__item', item.disabled ? 'is-disabled' : '', item.type === 'danger' ? 'is-danger' : ''].filter(Boolean).join(' ');
|
|
153
|
+
var itemClasses = ['ncua-dropdown__item', item.disabled ? 'is-disabled' : '', item.type === 'danger' ? 'is-danger' : '', item.className].filter(Boolean).join(' ');
|
|
154
154
|
return (0, _jsxRuntime.jsxs)("div", __assign({
|
|
155
155
|
className: itemClasses
|
|
156
156
|
}, {
|
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.ImageFileInput = void 0;
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _dynamic = _interopRequireDefault(require("@ncds/ui-admin-icon/dynamic"));
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
var _button = require("../button");
|
|
12
|
+
var _FileInput = require("../file-input/FileInput");
|
|
12
13
|
var _shared = require("../shared");
|
|
13
14
|
var _tooltip = require("../tooltip");
|
|
14
15
|
var _ImagePreview = require("./components/ImagePreview");
|
|
@@ -40,12 +41,6 @@ var __spreadArray = void 0 && (void 0).__spreadArray || function (to, from, pack
|
|
|
40
41
|
}
|
|
41
42
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
42
43
|
};
|
|
43
|
-
var ImageFileInputErrorType;
|
|
44
|
-
(function (ImageFileInputErrorType) {
|
|
45
|
-
ImageFileInputErrorType["ALREADY_UPLOADED"] = "ALREADY_UPLOADED";
|
|
46
|
-
ImageFileInputErrorType["EXCEED_MAX_FILE_SIZE"] = "EXCEED_MAX_FILE_SIZE";
|
|
47
|
-
ImageFileInputErrorType["EXCEED_MAX_FILE_COUNT"] = "EXCEED_MAX_FILE_COUNT";
|
|
48
|
-
})(ImageFileInputErrorType || (exports.ImageFileInputErrorType = ImageFileInputErrorType = {}));
|
|
49
44
|
var ImageFileInput = exports.ImageFileInput = /*#__PURE__*/(0, _react.forwardRef)(function (_a, ref) {
|
|
50
45
|
var _b = _a.size,
|
|
51
46
|
size = _b === void 0 ? 'sm' : _b,
|
|
@@ -123,20 +118,20 @@ var ImageFileInput = exports.ImageFileInput = /*#__PURE__*/(0, _react.forwardRef
|
|
|
123
118
|
return f.name === file.name && f.size === file.size;
|
|
124
119
|
})) {
|
|
125
120
|
invalidFiles.push(__assign(__assign({}, file), {
|
|
126
|
-
errorType:
|
|
121
|
+
errorType: _FileInput.FileInputErrorType.ALREADY_UPLOADED
|
|
127
122
|
}));
|
|
128
123
|
return "continue";
|
|
129
124
|
}
|
|
130
125
|
if (!!maxFileSize && file.size > maxFileSize) {
|
|
131
126
|
invalidFiles.push(__assign(__assign({}, file), {
|
|
132
|
-
errorType:
|
|
127
|
+
errorType: _FileInput.FileInputErrorType.EXCEED_MAX_FILE_SIZE
|
|
133
128
|
}));
|
|
134
129
|
return "continue";
|
|
135
130
|
}
|
|
136
131
|
// Skip max count check if maxFileCount is 1 (allow replacement)
|
|
137
132
|
if (!!maxFileCount && maxFileCount !== 1 && files.length + validFiles.length >= maxFileCount) {
|
|
138
133
|
invalidFiles.push(__assign(__assign({}, file), {
|
|
139
|
-
errorType:
|
|
134
|
+
errorType: _FileInput.FileInputErrorType.EXCEED_MAX_FILE_COUNT
|
|
140
135
|
}));
|
|
141
136
|
return "continue";
|
|
142
137
|
}
|
|
@@ -189,9 +184,7 @@ var ImageFileInput = exports.ImageFileInput = /*#__PURE__*/(0, _react.forwardRef
|
|
|
189
184
|
children: [(0, _jsxRuntime.jsx)(_button.Button, {
|
|
190
185
|
onlyIcon: true,
|
|
191
186
|
size: size,
|
|
192
|
-
className: (0, _classnames.default)('ncua-image-file-input__preview-container',
|
|
193
|
-
destructive: destructive
|
|
194
|
-
}),
|
|
187
|
+
className: (0, _classnames.default)('ncua-image-file-input__preview-container'),
|
|
195
188
|
onClick: handleBrowseClick,
|
|
196
189
|
disabled: disabled,
|
|
197
190
|
label: imagePreviewTooltipLabel
|
|
@@ -217,7 +210,9 @@ var ImageFileInput = exports.ImageFileInput = /*#__PURE__*/(0, _react.forwardRef
|
|
|
217
210
|
}));
|
|
218
211
|
};
|
|
219
212
|
return (0, _jsxRuntime.jsxs)("div", __assign({
|
|
220
|
-
className: (0, _classnames.default)('ncua-image-file-input', "ncua-image-file-input--".concat(size)
|
|
213
|
+
className: (0, _classnames.default)('ncua-image-file-input', "ncua-image-file-input--".concat(size), {
|
|
214
|
+
destructive: destructive
|
|
215
|
+
})
|
|
221
216
|
}, {
|
|
222
217
|
children: [renderImagePreview(files), showFileInput && (0, _jsxRuntime.jsxs)("div", __assign({
|
|
223
218
|
className: (0, _classnames.default)('ncua-file-input', "ncua-file-input--".concat(size))
|
|
@@ -135,6 +135,28 @@ Object.keys(_featuredIcon).forEach(function (key) {
|
|
|
135
135
|
}
|
|
136
136
|
});
|
|
137
137
|
});
|
|
138
|
+
var _fileInput = require("./file-input");
|
|
139
|
+
Object.keys(_fileInput).forEach(function (key) {
|
|
140
|
+
if (key === "default" || key === "__esModule") return;
|
|
141
|
+
if (key in exports && exports[key] === _fileInput[key]) return;
|
|
142
|
+
Object.defineProperty(exports, key, {
|
|
143
|
+
enumerable: true,
|
|
144
|
+
get: function () {
|
|
145
|
+
return _fileInput[key];
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
var _imageFileInput = require("./image-file-input");
|
|
150
|
+
Object.keys(_imageFileInput).forEach(function (key) {
|
|
151
|
+
if (key === "default" || key === "__esModule") return;
|
|
152
|
+
if (key in exports && exports[key] === _imageFileInput[key]) return;
|
|
153
|
+
Object.defineProperty(exports, key, {
|
|
154
|
+
enumerable: true,
|
|
155
|
+
get: function () {
|
|
156
|
+
return _imageFileInput[key];
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
});
|
|
138
160
|
var _input = require("./input");
|
|
139
161
|
Object.keys(_input).forEach(function (key) {
|
|
140
162
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -332,15 +354,4 @@ Object.keys(_tooltip).forEach(function (key) {
|
|
|
332
354
|
return _tooltip[key];
|
|
333
355
|
}
|
|
334
356
|
});
|
|
335
|
-
});
|
|
336
|
-
var _imageFileInput = require("./image-file-input");
|
|
337
|
-
Object.keys(_imageFileInput).forEach(function (key) {
|
|
338
|
-
if (key === "default" || key === "__esModule") return;
|
|
339
|
-
if (key in exports && exports[key] === _imageFileInput[key]) return;
|
|
340
|
-
Object.defineProperty(exports, key, {
|
|
341
|
-
enumerable: true,
|
|
342
|
-
get: function () {
|
|
343
|
-
return _imageFileInput[key];
|
|
344
|
-
}
|
|
345
|
-
});
|
|
346
357
|
});
|
|
@@ -128,9 +128,10 @@ Modal.Header = function (_a) {
|
|
|
128
128
|
});
|
|
129
129
|
};
|
|
130
130
|
Modal.Content = function (_a) {
|
|
131
|
-
var children = _a.children
|
|
131
|
+
var children = _a.children,
|
|
132
|
+
className = _a.className;
|
|
132
133
|
return (0, _jsxRuntime.jsx)("div", __assign({
|
|
133
|
-
className:
|
|
134
|
+
className: (0, _classnames.default)('ncua-modal__content', className)
|
|
134
135
|
}, {
|
|
135
136
|
children: children
|
|
136
137
|
}));
|
|
@@ -171,12 +172,13 @@ Modal.Actions = function (_a) {
|
|
|
171
172
|
showDivider = _c === void 0 ? false : _c,
|
|
172
173
|
_d = _a.align,
|
|
173
174
|
align = _d === void 0 ? 'stretch' : _d,
|
|
174
|
-
checkboxContent = _a.checkboxContent
|
|
175
|
+
checkboxContent = _a.checkboxContent,
|
|
176
|
+
className = _a.className;
|
|
175
177
|
return (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
176
178
|
children: [showDivider && (0, _jsxRuntime.jsx)("div", {
|
|
177
179
|
className: "ncua-modal__actions-divider"
|
|
178
180
|
}), (0, _jsxRuntime.jsxs)("div", __assign({
|
|
179
|
-
className: (0, _classnames.default)('ncua-modal__actions-wrapper', {
|
|
181
|
+
className: (0, _classnames.default)('ncua-modal__actions-wrapper', className, {
|
|
180
182
|
'ncua-modal__actions-wrapper--checkbox': layout === 'checkbox'
|
|
181
183
|
})
|
|
182
184
|
}, {
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.NavButton = void 0;
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
-
var
|
|
8
|
+
var _button = require("../button");
|
|
9
9
|
var __assign = void 0 && (void 0).__assign || function () {
|
|
10
10
|
__assign = Object.assign || function (t) {
|
|
11
11
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -76,6 +76,6 @@ var NavButton = function (_a) {
|
|
|
76
76
|
};
|
|
77
77
|
// key 값 별도 계산
|
|
78
78
|
var buttonKey = isNavigationButton ? "".concat(breakPoint, "-").concat(type) : undefined;
|
|
79
|
-
return (0, _jsxRuntime.jsx)(
|
|
79
|
+
return (0, _jsxRuntime.jsx)(_button.Button, __assign({}, buttonProps), buttonKey);
|
|
80
80
|
};
|
|
81
81
|
exports.NavButton = NavButton;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.SelectBox = exports.DEFAULT_MAX_HEIGHT = void 0;
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _dynamic = _interopRequireDefault(require("@ncds/ui-admin-icon/dynamic"));
|
|
9
|
-
var _color = require("
|
|
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");
|
|
@@ -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,
|
|
@@ -143,7 +143,7 @@ export var Dropdown = function (_a) {
|
|
|
143
143
|
return null;
|
|
144
144
|
};
|
|
145
145
|
var renderItem = function (item) {
|
|
146
|
-
var itemClasses = ['ncua-dropdown__item', item.disabled ? 'is-disabled' : '', item.type === 'danger' ? 'is-danger' : ''].filter(Boolean).join(' ');
|
|
146
|
+
var itemClasses = ['ncua-dropdown__item', item.disabled ? 'is-disabled' : '', item.type === 'danger' ? 'is-danger' : '', item.className].filter(Boolean).join(' ');
|
|
147
147
|
return _jsxs("div", __assign({
|
|
148
148
|
className: itemClasses
|
|
149
149
|
}, {
|
|
@@ -30,15 +30,10 @@ import Icon from '@ncds/ui-admin-icon/dynamic';
|
|
|
30
30
|
import classNames from 'classnames';
|
|
31
31
|
import { forwardRef, useEffect, useRef, useState } from 'react';
|
|
32
32
|
import { Button } from '../button';
|
|
33
|
+
import { FileInputErrorType as ImageFileInputErrorType } from '../file-input/FileInput';
|
|
33
34
|
import { HintText, Label } from '../shared';
|
|
34
35
|
import { Tooltip } from '../tooltip';
|
|
35
36
|
import { ImagePreview } from './components/ImagePreview';
|
|
36
|
-
export var ImageFileInputErrorType;
|
|
37
|
-
(function (ImageFileInputErrorType) {
|
|
38
|
-
ImageFileInputErrorType["ALREADY_UPLOADED"] = "ALREADY_UPLOADED";
|
|
39
|
-
ImageFileInputErrorType["EXCEED_MAX_FILE_SIZE"] = "EXCEED_MAX_FILE_SIZE";
|
|
40
|
-
ImageFileInputErrorType["EXCEED_MAX_FILE_COUNT"] = "EXCEED_MAX_FILE_COUNT";
|
|
41
|
-
})(ImageFileInputErrorType || (ImageFileInputErrorType = {}));
|
|
42
37
|
export var ImageFileInput = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
43
38
|
var _b = _a.size,
|
|
44
39
|
size = _b === void 0 ? 'sm' : _b,
|
|
@@ -182,9 +177,7 @@ export var ImageFileInput = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
182
177
|
children: [_jsx(Button, {
|
|
183
178
|
onlyIcon: true,
|
|
184
179
|
size: size,
|
|
185
|
-
className: classNames('ncua-image-file-input__preview-container',
|
|
186
|
-
destructive: destructive
|
|
187
|
-
}),
|
|
180
|
+
className: classNames('ncua-image-file-input__preview-container'),
|
|
188
181
|
onClick: handleBrowseClick,
|
|
189
182
|
disabled: disabled,
|
|
190
183
|
label: imagePreviewTooltipLabel
|
|
@@ -210,7 +203,9 @@ export var ImageFileInput = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
210
203
|
}));
|
|
211
204
|
};
|
|
212
205
|
return _jsxs("div", __assign({
|
|
213
|
-
className: classNames('ncua-image-file-input', "ncua-image-file-input--".concat(size)
|
|
206
|
+
className: classNames('ncua-image-file-input', "ncua-image-file-input--".concat(size), {
|
|
207
|
+
destructive: destructive
|
|
208
|
+
})
|
|
214
209
|
}, {
|
|
215
210
|
children: [renderImagePreview(files), showFileInput && _jsxs("div", __assign({
|
|
216
211
|
className: classNames('ncua-file-input', "ncua-file-input--".concat(size))
|
|
@@ -10,6 +10,8 @@ export * from './dot';
|
|
|
10
10
|
export * from './dropdown';
|
|
11
11
|
export * from './empty-state';
|
|
12
12
|
export * from './featured-icon';
|
|
13
|
+
export * from './file-input';
|
|
14
|
+
export * from './image-file-input';
|
|
13
15
|
export * from './input';
|
|
14
16
|
export * from './modal';
|
|
15
17
|
export * from './notification';
|
|
@@ -27,5 +29,4 @@ export * from './switch';
|
|
|
27
29
|
export * from './tab';
|
|
28
30
|
export * from './tag';
|
|
29
31
|
export * from './toggle';
|
|
30
|
-
export * from './tooltip';
|
|
31
|
-
export * from './image-file-input';
|
|
32
|
+
export * from './tooltip';
|
|
@@ -120,9 +120,10 @@ Modal.Header = function (_a) {
|
|
|
120
120
|
});
|
|
121
121
|
};
|
|
122
122
|
Modal.Content = function (_a) {
|
|
123
|
-
var children = _a.children
|
|
123
|
+
var children = _a.children,
|
|
124
|
+
className = _a.className;
|
|
124
125
|
return _jsx("div", __assign({
|
|
125
|
-
className:
|
|
126
|
+
className: classnames('ncua-modal__content', className)
|
|
126
127
|
}, {
|
|
127
128
|
children: children
|
|
128
129
|
}));
|
|
@@ -163,12 +164,13 @@ Modal.Actions = function (_a) {
|
|
|
163
164
|
showDivider = _c === void 0 ? false : _c,
|
|
164
165
|
_d = _a.align,
|
|
165
166
|
align = _d === void 0 ? 'stretch' : _d,
|
|
166
|
-
checkboxContent = _a.checkboxContent
|
|
167
|
+
checkboxContent = _a.checkboxContent,
|
|
168
|
+
className = _a.className;
|
|
167
169
|
return _jsxs(_Fragment, {
|
|
168
170
|
children: [showDivider && _jsx("div", {
|
|
169
171
|
className: "ncua-modal__actions-divider"
|
|
170
172
|
}), _jsxs("div", __assign({
|
|
171
|
-
className: classnames('ncua-modal__actions-wrapper', {
|
|
173
|
+
className: classnames('ncua-modal__actions-wrapper', className, {
|
|
172
174
|
'ncua-modal__actions-wrapper--checkbox': layout === 'checkbox'
|
|
173
175
|
})
|
|
174
176
|
}, {
|
|
@@ -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 { Button } from '../button
|
|
12
|
+
import { Button } from '../button';
|
|
13
13
|
var NAV_BUTTON_CONFIG = {
|
|
14
14
|
first: {
|
|
15
15
|
label: '처음',
|
|
@@ -27,7 +27,7 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
27
27
|
};
|
|
28
28
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
29
29
|
import Icon from '@ncds/ui-admin-icon/dynamic';
|
|
30
|
-
import { COLOR } from '
|
|
30
|
+
import { COLOR } from '../../../constant/color';
|
|
31
31
|
import classNames from 'classnames';
|
|
32
32
|
import { forwardRef, useCallback, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
33
33
|
import { useDropdown, useScrollLock } from '../../hooks/dropdown';
|
|
@@ -11,7 +11,7 @@ var __assign = this && this.__assign || function () {
|
|
|
11
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
12
|
import Icon from '@ncds/ui-admin-icon/dynamic';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
|
-
import {
|
|
14
|
+
import { useCallback, useRef, useState } from 'react';
|
|
15
15
|
import { COLOR } from '../../../constant/color';
|
|
16
16
|
import { Dot } from '../dot';
|
|
17
17
|
var MARGIN = 10;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ColorTone } from '
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import type { ColorTone } from '../../../constant/color';
|
|
2
|
+
import type { Size } from '../../../constant/size';
|
|
3
|
+
import type { SideSlotType } from '../../types/side-slot';
|
|
4
|
+
import { type BadgeProps } from '.';
|
|
5
5
|
export type BadgeGroupSize = Extract<Size, 'xs' | 'sm'>;
|
|
6
6
|
export type BadgeGroupColor = Extract<ColorTone, 'neutral' | 'error' | 'warning' | 'success'>;
|
|
7
7
|
export type BadgeGroupProps = Omit<BadgeProps, 'type' | 'size' | 'color'> & {
|
|
@@ -5,7 +5,7 @@ import { DotProps } from '../dot';
|
|
|
5
5
|
export type ButtonTheme = 'primary' | 'secondary' | 'secondary-gray' | 'tertiary-gray' | 'tertiary' | 'text' | 'text-gray' | 'text-red' | 'destructive';
|
|
6
6
|
export type ButtonSize = Extract<Size, 'xxs' | 'xs' | 'sm' | 'md'>;
|
|
7
7
|
type CommonButtonProps<T extends keyof HTMLElementTagNameMap> = Omit<ComponentProps<T>, 'ref'> & {
|
|
8
|
-
label:
|
|
8
|
+
label: ReactNode;
|
|
9
9
|
className?: string;
|
|
10
10
|
hierarchy?: ButtonTheme;
|
|
11
11
|
disabled?: boolean;
|
|
@@ -21,7 +21,7 @@ export declare const svgSize: Record<ButtonSize, number>;
|
|
|
21
21
|
export declare const iconOnlySvgSize: Record<ButtonSize, number>;
|
|
22
22
|
export declare const dotSize: Record<ButtonSize, DotProps['size']>;
|
|
23
23
|
export declare const Button: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
24
|
-
label:
|
|
24
|
+
label: ReactNode;
|
|
25
25
|
className?: string | undefined;
|
|
26
26
|
hierarchy?: ButtonTheme | undefined;
|
|
27
27
|
disabled?: boolean | undefined;
|
|
@@ -15,9 +15,9 @@ interface ButtonGroupItemCommonProps {
|
|
|
15
15
|
disabled?: boolean;
|
|
16
16
|
isCurrent?: boolean;
|
|
17
17
|
}
|
|
18
|
-
interface ButtonGroupItemProps extends ButtonGroupItemCommonProps, ComponentProps<'button'> {
|
|
18
|
+
export interface ButtonGroupItemProps extends ButtonGroupItemCommonProps, ComponentProps<'button'> {
|
|
19
19
|
}
|
|
20
|
-
interface ButtonGroupProps {
|
|
20
|
+
export interface ButtonGroupProps {
|
|
21
21
|
className?: string;
|
|
22
22
|
size?: ButtonGroupSize;
|
|
23
23
|
children: React.ReactNode;
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
+
import { InvalidFile } from '../file-input/FileInput';
|
|
1
2
|
import { InputBaseProps } from '../input/InputBase';
|
|
2
|
-
export declare enum ImageFileInputErrorType {
|
|
3
|
-
ALREADY_UPLOADED = "ALREADY_UPLOADED",
|
|
4
|
-
EXCEED_MAX_FILE_SIZE = "EXCEED_MAX_FILE_SIZE",
|
|
5
|
-
EXCEED_MAX_FILE_COUNT = "EXCEED_MAX_FILE_COUNT"
|
|
6
|
-
}
|
|
7
|
-
export interface InvalidFile extends Omit<File, 'constructor'> {
|
|
8
|
-
errorType: ImageFileInputErrorType;
|
|
9
|
-
}
|
|
10
3
|
export interface ImageFileInputProps extends Omit<InputBaseProps, 'clearText' | 'onClearText' | 'hintText' | 'value' | 'onChange'> {
|
|
11
4
|
/**
|
|
12
5
|
* Accepted file types
|
|
@@ -10,6 +10,8 @@ export * from './dot';
|
|
|
10
10
|
export * from './dropdown';
|
|
11
11
|
export * from './empty-state';
|
|
12
12
|
export * from './featured-icon';
|
|
13
|
+
export * from './file-input';
|
|
14
|
+
export * from './image-file-input';
|
|
13
15
|
export * from './input';
|
|
14
16
|
export * from './modal';
|
|
15
17
|
export * from './notification';
|
|
@@ -28,5 +30,4 @@ export * from './tab';
|
|
|
28
30
|
export * from './tag';
|
|
29
31
|
export * from './toggle';
|
|
30
32
|
export * from './tooltip';
|
|
31
|
-
export * from './image-file-input';
|
|
32
33
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -18,7 +18,7 @@ export type ModalProps = {
|
|
|
18
18
|
export declare const Modal: {
|
|
19
19
|
({ isOpen, onClose, children, size, closeOnBackdropClick, closeOnEsc, className, zIndex, ...restProps }: ModalProps): import("react").ReactPortal | null;
|
|
20
20
|
Header({ children, onClose, featuredIcon, title, subtitle, align, showDivider, hideCloseButton, }: ModalHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
Content({ children }: ModalContentProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
Content({ children, className }: ModalContentProps): import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
/**
|
|
23
23
|
* Modal.Actions - The actions area of the modal
|
|
24
24
|
*
|
|
@@ -47,7 +47,7 @@ export declare const Modal: {
|
|
|
47
47
|
* <Button size="sm" label="Confirm" onClick={handleConfirm} hierarchy="primary" />
|
|
48
48
|
* </Modal.Actions>
|
|
49
49
|
*/
|
|
50
|
-
Actions({ children, layout, showDivider, align, checkboxContent, }: ModalActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
Actions({ children, layout, showDivider, align, checkboxContent, className, }: ModalActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
51
51
|
};
|
|
52
52
|
export type ModalHeaderProps = {
|
|
53
53
|
children?: ReactNode;
|
|
@@ -65,8 +65,10 @@ export type ModalHeaderProps = {
|
|
|
65
65
|
};
|
|
66
66
|
export type ModalContentProps = {
|
|
67
67
|
children: ReactNode;
|
|
68
|
+
className?: string;
|
|
68
69
|
};
|
|
69
70
|
export type ModalActionsProps = {
|
|
71
|
+
className?: string;
|
|
70
72
|
children: ReactNode;
|
|
71
73
|
layout?: ModalActionsLayout;
|
|
72
74
|
showDivider?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentPropsWithRef, PropsWithChildren } from 'react';
|
|
2
|
-
import { UseFormRegisterReturn } from 'react-hook-form';
|
|
3
|
-
import { Size } from '../../../constant/size';
|
|
2
|
+
import type { UseFormRegisterReturn } from 'react-hook-form';
|
|
3
|
+
import type { Size } from '../../../constant/size';
|
|
4
4
|
import { OptionChangeHandler, OptionType, OptionValue } from '../../types/dropdown';
|
|
5
5
|
export declare const DEFAULT_MAX_HEIGHT = 275;
|
|
6
6
|
type BaseSelectBoxProps = Omit<ComponentPropsWithRef<'div'>, 'size' | 'onChange'>;
|
|
@@ -4,7 +4,7 @@ export type TabSize = 'sm' | 'md' | 'lg';
|
|
|
4
4
|
export type TabType = 'button-primary' | 'button-white' | 'underline' | 'underline-fill' | 'line-vertical';
|
|
5
5
|
type BaseTabButtonProps = {
|
|
6
6
|
id?: string;
|
|
7
|
-
label
|
|
7
|
+
label?: string;
|
|
8
8
|
size?: TabSize;
|
|
9
9
|
tabButtonType?: TabType;
|
|
10
10
|
isActive?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MouseEventHandler } from 'react';
|
|
2
|
-
import { Size } from '../../../constant/size';
|
|
3
|
-
import { SideSlotType } from '../../types/side-slot';
|
|
1
|
+
import { type MouseEventHandler } from 'react';
|
|
2
|
+
import type { Size } from '../../../constant/size';
|
|
3
|
+
import type { SideSlotType } from '../../types/side-slot';
|
|
4
4
|
interface TagProps {
|
|
5
5
|
size?: Extract<Size, 'sm' | 'md'>;
|
|
6
6
|
icon?: SideSlotType;
|
|
@@ -1368,9 +1368,11 @@ button {
|
|
|
1368
1368
|
padding: 4px 10px;
|
|
1369
1369
|
}
|
|
1370
1370
|
.ncua-input__field--xs {
|
|
1371
|
+
line-height: var(--line-heights-xs);
|
|
1371
1372
|
padding: 4px 10px;
|
|
1372
1373
|
}
|
|
1373
1374
|
.ncua-input__field--sm {
|
|
1375
|
+
line-height: var(--line-heights-sm);
|
|
1374
1376
|
padding: 6px 12px;
|
|
1375
1377
|
}
|
|
1376
1378
|
.ncua-input__field:has(.ncua-input__stepper-button-group ~ .ncua-input__number) {
|
|
@@ -1563,9 +1565,11 @@ button {
|
|
|
1563
1565
|
padding: 4px 10px;
|
|
1564
1566
|
}
|
|
1565
1567
|
.ncua-input__leading-text-wrap .ncua-input__leading-text--xs {
|
|
1568
|
+
line-height: var(--line-heights-xs);
|
|
1566
1569
|
padding: 4px 10px;
|
|
1567
1570
|
}
|
|
1568
1571
|
.ncua-input__leading-text-wrap .ncua-input__leading-text--sm {
|
|
1572
|
+
line-height: var(--line-heights-sm);
|
|
1569
1573
|
padding: 6px 12px;
|
|
1570
1574
|
}
|
|
1571
1575
|
.ncua-input__leading-text-wrap .ncua-input__leading-text {
|
|
@@ -1588,9 +1592,11 @@ button {
|
|
|
1588
1592
|
padding: 4px 10px;
|
|
1589
1593
|
}
|
|
1590
1594
|
.ncua-input__trailing-button .ncua-input__button--xs {
|
|
1595
|
+
line-height: var(--line-heights-xs);
|
|
1591
1596
|
padding: 4px 10px;
|
|
1592
1597
|
}
|
|
1593
1598
|
.ncua-input__trailing-button .ncua-input__button--sm {
|
|
1599
|
+
line-height: var(--line-heights-sm);
|
|
1594
1600
|
padding: 6px 12px;
|
|
1595
1601
|
}
|
|
1596
1602
|
.ncua-input__trailing-button .ncua-input__button {
|
|
@@ -1603,19 +1609,19 @@ button {
|
|
|
1603
1609
|
cursor: pointer;
|
|
1604
1610
|
}
|
|
1605
1611
|
.ncua-input__trailing-button .ncua-input__button {
|
|
1606
|
-
padding:
|
|
1612
|
+
padding: 4px 10px;
|
|
1607
1613
|
font-size: var(--font-size-xs);
|
|
1608
1614
|
line-height: var(--line-heights-xs);
|
|
1609
1615
|
font-weight: var(--font-weights-commerce-sans-1);
|
|
1610
1616
|
}
|
|
1611
1617
|
.ncua-input__trailing-button .ncua-input__button--xs {
|
|
1612
|
-
padding:
|
|
1618
|
+
padding: 4px 10px;
|
|
1613
1619
|
font-size: var(--font-size-xs);
|
|
1614
1620
|
line-height: var(--line-heights-xs);
|
|
1615
1621
|
font-weight: var(--font-weights-commerce-sans-1);
|
|
1616
1622
|
}
|
|
1617
1623
|
.ncua-input__trailing-button .ncua-input__button--sm {
|
|
1618
|
-
padding:
|
|
1624
|
+
padding: 6px 12px;
|
|
1619
1625
|
font-size: var(--font-size-sm);
|
|
1620
1626
|
line-height: var(--line-heights-sm);
|
|
1621
1627
|
font-weight: var(--font-weights-commerce-sans-2);
|
|
@@ -5326,7 +5332,7 @@ button {
|
|
|
5326
5332
|
.ncua-image-file-input__preview-container[disabled], .ncua-image-file-input__preview-container.is-disable, .ncua-image-file-input__preview-container.ncua-btn:hover {
|
|
5327
5333
|
border: 1px dashed var(--gray-200);
|
|
5328
5334
|
}
|
|
5329
|
-
.ncua-image-file-input__preview-container
|
|
5335
|
+
.ncua-image-file-input.destructive .ncua-image-file-input__preview-container {
|
|
5330
5336
|
background-color: var(--primary-red-100);
|
|
5331
5337
|
border: 1px solid var(--primary-red-600);
|
|
5332
5338
|
}
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|