@ncds/ui-admin 1.5.3 → 1.5.4

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.
@@ -3,12 +3,13 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.ImageFileInputErrorType = exports.ImageFileInput = void 0;
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: ImageFileInputErrorType.ALREADY_UPLOADED
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: ImageFileInputErrorType.EXCEED_MAX_FILE_SIZE
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: ImageFileInputErrorType.EXCEED_MAX_FILE_COUNT
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
  });
@@ -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';
@@ -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
@@ -5326,7 +5326,7 @@ button {
5326
5326
  .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
5327
  border: 1px dashed var(--gray-200);
5328
5328
  }
5329
- .ncua-image-file-input__preview-container.destructive {
5329
+ .ncua-image-file-input.destructive .ncua-image-file-input__preview-container {
5330
5330
  background-color: var(--primary-red-100);
5331
5331
  border: 1px solid var(--primary-red-600);
5332
5332
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ncds/ui-admin",
3
- "version": "1.5.3",
3
+ "version": "1.5.4",
4
4
  "description": "nhn-commerce의 어드민 디자인 시스템입니다.",
5
5
  "scripts": {
6
6
  "barrel": "node barrel.js",