@ncds/ui-admin 0.0.22 → 0.0.23

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.
Files changed (94) hide show
  1. package/dist/cjs/assets/scripts/index.js +11 -0
  2. package/dist/cjs/assets/scripts/slider.js +341 -0
  3. package/dist/cjs/index.js +0 -33
  4. package/dist/cjs/src/components/button/Button.js +15 -7
  5. package/dist/cjs/src/components/button/ButtonGroup.js +1 -1
  6. package/dist/cjs/src/components/date-picker/index.js +0 -11
  7. package/dist/cjs/src/components/divider/Divider.js +43 -0
  8. package/dist/cjs/src/components/divider/index.js +16 -0
  9. package/dist/cjs/src/components/empty-state/EmptyState.js +58 -0
  10. package/dist/cjs/src/components/empty-state/index.js +16 -0
  11. package/dist/cjs/src/components/featured-icon/FeaturedIcon.js +79 -0
  12. package/dist/cjs/src/components/featured-icon/index.js +16 -0
  13. package/dist/cjs/src/components/index.js +81 -4
  14. package/dist/cjs/src/components/modal/Modal.js +193 -0
  15. package/dist/cjs/src/components/modal/index.js +12 -0
  16. package/dist/cjs/src/components/notification/FloatingNotification.js +104 -0
  17. package/dist/cjs/src/components/notification/FullWidthNotification.js +112 -0
  18. package/dist/cjs/src/components/notification/Notification.js +66 -0
  19. package/dist/cjs/src/components/notification/index.js +38 -0
  20. package/dist/cjs/src/components/pagination/NavButton.js +6 -4
  21. package/dist/cjs/src/components/pagination/Pagination.js +4 -19
  22. package/dist/cjs/src/components/progress-bar/ProgressBar.js +57 -0
  23. package/dist/cjs/src/components/progress-bar/index.js +16 -0
  24. package/dist/cjs/src/components/progress-circle/ProgressCircle.js +121 -0
  25. package/dist/cjs/src/components/progress-circle/index.js +16 -0
  26. package/dist/cjs/src/components/slider/Slider.js +64 -0
  27. package/dist/cjs/src/components/slider/index.js +16 -0
  28. package/dist/cjs/src/components/tab/HorizontalTab.js +77 -0
  29. package/dist/cjs/src/components/tab/TabButton.js +76 -0
  30. package/dist/cjs/src/components/tab/VerticalTab.js +75 -0
  31. package/dist/cjs/src/components/tab/index.js +38 -0
  32. package/dist/esm/assets/scripts/index.js +2 -1
  33. package/dist/esm/assets/scripts/slider.js +336 -0
  34. package/dist/esm/index.js +0 -3
  35. package/dist/esm/src/components/button/Button.js +14 -6
  36. package/dist/esm/src/components/button/ButtonGroup.js +1 -1
  37. package/dist/esm/src/components/date-picker/index.js +1 -2
  38. package/dist/esm/src/components/divider/Divider.js +36 -0
  39. package/dist/esm/src/components/divider/index.js +1 -0
  40. package/dist/esm/src/components/empty-state/EmptyState.js +51 -0
  41. package/dist/esm/src/components/empty-state/index.js +1 -0
  42. package/dist/esm/src/components/featured-icon/FeaturedIcon.js +72 -0
  43. package/dist/esm/src/components/featured-icon/index.js +1 -0
  44. package/dist/esm/src/components/index.js +8 -1
  45. package/dist/esm/src/components/modal/Modal.js +185 -0
  46. package/dist/esm/src/components/modal/index.js +1 -0
  47. package/dist/esm/src/components/notification/FloatingNotification.js +97 -0
  48. package/dist/esm/src/components/notification/FullWidthNotification.js +105 -0
  49. package/dist/esm/src/components/notification/Notification.js +59 -0
  50. package/dist/esm/src/components/notification/index.js +3 -0
  51. package/dist/esm/src/components/pagination/NavButton.js +6 -4
  52. package/dist/esm/src/components/pagination/Pagination.js +4 -19
  53. package/dist/esm/src/components/progress-bar/ProgressBar.js +50 -0
  54. package/dist/esm/src/components/progress-bar/index.js +1 -0
  55. package/dist/esm/src/components/progress-circle/ProgressCircle.js +114 -0
  56. package/dist/esm/src/components/progress-circle/index.js +1 -0
  57. package/dist/esm/src/components/slider/Slider.js +57 -0
  58. package/dist/esm/src/components/slider/index.js +1 -0
  59. package/dist/esm/src/components/tab/HorizontalTab.js +69 -0
  60. package/dist/esm/src/components/tab/TabButton.js +68 -0
  61. package/dist/esm/src/components/tab/VerticalTab.js +67 -0
  62. package/dist/esm/src/components/tab/index.js +3 -0
  63. package/dist/types/assets/scripts/index.d.ts +1 -0
  64. package/dist/types/assets/scripts/slider.d.ts +42 -0
  65. package/dist/types/index.d.ts +0 -3
  66. package/dist/types/src/components/button/Button.d.ts +2 -1
  67. package/dist/types/src/components/button/ButtonGroup.d.ts +6 -5
  68. package/dist/types/src/components/date-picker/index.d.ts +0 -1
  69. package/dist/types/src/components/divider/Divider.d.ts +11 -0
  70. package/dist/types/src/components/divider/index.d.ts +2 -0
  71. package/dist/types/src/components/empty-state/EmptyState.d.ts +14 -0
  72. package/dist/types/src/components/empty-state/index.d.ts +2 -0
  73. package/dist/types/src/components/featured-icon/FeaturedIcon.d.ts +14 -0
  74. package/dist/types/src/components/featured-icon/index.d.ts +2 -0
  75. package/dist/types/src/components/index.d.ts +8 -1
  76. package/dist/types/src/components/modal/Modal.d.ts +75 -0
  77. package/dist/types/src/components/modal/index.d.ts +3 -0
  78. package/dist/types/src/components/notification/FloatingNotification.d.ts +32 -0
  79. package/dist/types/src/components/notification/FullWidthNotification.d.ts +32 -0
  80. package/dist/types/src/components/notification/Notification.d.ts +59 -0
  81. package/dist/types/src/components/notification/index.d.ts +4 -0
  82. package/dist/types/src/components/pagination/NavButton.d.ts +2 -2
  83. package/dist/types/src/components/progress-bar/ProgressBar.d.ts +7 -0
  84. package/dist/types/src/components/progress-bar/index.d.ts +2 -0
  85. package/dist/types/src/components/progress-circle/ProgressCircle.d.ts +8 -0
  86. package/dist/types/src/components/progress-circle/index.d.ts +2 -0
  87. package/dist/types/src/components/slider/Slider.d.ts +15 -0
  88. package/dist/types/src/components/slider/index.d.ts +2 -0
  89. package/dist/types/src/components/tab/HorizontalTab.d.ts +12 -0
  90. package/dist/types/src/components/tab/TabButton.d.ts +26 -0
  91. package/dist/types/src/components/tab/VerticalTab.d.ts +10 -0
  92. package/dist/types/src/components/tab/index.d.ts +4 -0
  93. package/dist/ui-admin/assets/styles/style.css +1249 -97
  94. package/package.json +1 -1
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.VerticalTab = void 0;
7
+ var _jsxRuntime = require("react/jsx-runtime");
8
+ var _classnames = _interopRequireDefault(require("classnames"));
9
+ var _react = require("react");
10
+ var _Select = require("../select/Select");
11
+ var _TabButton = require("./TabButton");
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ var __assign = void 0 && (void 0).__assign || function () {
14
+ __assign = Object.assign || function (t) {
15
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
16
+ s = arguments[i];
17
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
18
+ }
19
+ return t;
20
+ };
21
+ return __assign.apply(this, arguments);
22
+ };
23
+ var VerticalTab = function (_a) {
24
+ var _b = _a.type,
25
+ type = _b === void 0 ? 'button-primary' : _b,
26
+ _c = _a.breakPoint,
27
+ breakPoint = _c === void 0 ? 'pc' : _c,
28
+ activeTab = _a.activeTab,
29
+ menus = _a.menus,
30
+ onClick = _a.onClick;
31
+ var handleSelectChange = function (e) {
32
+ onClick === null || onClick === void 0 ? void 0 : onClick(e.target.value);
33
+ };
34
+ var optionItems = (menus === null || menus === void 0 ? void 0 : menus.map(function (menu) {
35
+ return {
36
+ id: menu.id || '',
37
+ label: menu.label || ''
38
+ };
39
+ })) || [];
40
+ return (0, _jsxRuntime.jsx)("div", __assign({
41
+ className: (0, _classnames.default)('ncua-vertical-tab', "ncua-vertical-tab--".concat(type))
42
+ }, {
43
+ children: breakPoint === 'mobile' ? (0, _jsxRuntime.jsx)("div", __assign({
44
+ className: "ncua-vertical-tab__select"
45
+ }, {
46
+ children: (0, _jsxRuntime.jsx)(_Select.Select, {
47
+ value: activeTab,
48
+ onChange: handleSelectChange,
49
+ optionItems: optionItems,
50
+ size: "md"
51
+ })
52
+ })) : menus === null || menus === void 0 ? void 0 : menus.map(function (menu) {
53
+ var isActive = menu.href ? menu.href.includes(activeTab) : menu.id === activeTab;
54
+ var commonProps = {
55
+ id: menu.id,
56
+ label: menu.label,
57
+ badgeInfo: menu.badgeInfo,
58
+ isActive: isActive,
59
+ tabButtonType: type,
60
+ size: 'sm',
61
+ onClick: function () {
62
+ var _a;
63
+ return onClick === null || onClick === void 0 ? void 0 : onClick((_a = menu.id) !== null && _a !== void 0 ? _a : '');
64
+ }
65
+ };
66
+ return (0, _jsxRuntime.jsx)(_react.Fragment, {
67
+ children: menu.href ? (0, _jsxRuntime.jsx)(_TabButton.TabButton, __assign({}, commonProps, {
68
+ href: menu.href,
69
+ target: menu.target
70
+ })) : (0, _jsxRuntime.jsx)(_TabButton.TabButton, __assign({}, commonProps))
71
+ }, menu.id);
72
+ })
73
+ }));
74
+ };
75
+ exports.VerticalTab = VerticalTab;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _HorizontalTab = require("./HorizontalTab");
7
+ Object.keys(_HorizontalTab).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _HorizontalTab[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _HorizontalTab[key];
14
+ }
15
+ });
16
+ });
17
+ var _TabButton = require("./TabButton");
18
+ Object.keys(_TabButton).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _TabButton[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _TabButton[key];
25
+ }
26
+ });
27
+ });
28
+ var _VerticalTab = require("./VerticalTab");
29
+ Object.keys(_VerticalTab).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _VerticalTab[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _VerticalTab[key];
36
+ }
37
+ });
38
+ });
@@ -1 +1,2 @@
1
- export * from './test';
1
+ export * from './test';
2
+ export * from './slider';
@@ -0,0 +1,336 @@
1
+ var Slider = /** @class */function () {
2
+ function Slider(element, options) {
3
+ var _this = this;
4
+ this.activeHandle = null;
5
+ this.isDragging = false;
6
+ this.handleElements = [];
7
+ this.progressElement = null;
8
+ this.trackElement = null;
9
+ this.handleMouseDown = function (e) {
10
+ var targetElement = e.target;
11
+ e.preventDefault();
12
+ _this.handleInteractionStart(e.clientX, targetElement);
13
+ if (_this.isDragging) {
14
+ // 드래그 이벤트 추가
15
+ document.addEventListener('mousemove', _this.handleMouseMove);
16
+ document.addEventListener('mouseup', _this.handleMouseUp);
17
+ // 텍스트 선택 방지
18
+ document.body.style.userSelect = 'none';
19
+ }
20
+ };
21
+ this.handleTouchStart = function (e) {
22
+ if (e.touches.length > 0) {
23
+ var targetElement = e.target;
24
+ e.preventDefault();
25
+ _this.handleInteractionStart(e.touches[0].clientX, targetElement);
26
+ if (_this.isDragging) {
27
+ // 드래그 이벤트 추가
28
+ document.addEventListener('touchmove', _this.handleTouchMove, {
29
+ passive: false
30
+ });
31
+ document.addEventListener('touchend', _this.handleTouchEnd);
32
+ }
33
+ }
34
+ };
35
+ this.handleMouseMove = function (e) {
36
+ if (_this.isDragging) {
37
+ _this.updateValueFromClientX(e.clientX);
38
+ }
39
+ };
40
+ this.handleTouchMove = function (e) {
41
+ if (_this.isDragging && e.touches.length > 0) {
42
+ e.preventDefault();
43
+ _this.updateValueFromClientX(e.touches[0].clientX);
44
+ }
45
+ };
46
+ this.handleMouseUp = function () {
47
+ _this.isDragging = false;
48
+ document.body.style.userSelect = '';
49
+ document.removeEventListener('mousemove', _this.handleMouseMove);
50
+ document.removeEventListener('mouseup', _this.handleMouseUp);
51
+ };
52
+ this.handleTouchEnd = function () {
53
+ _this.isDragging = false;
54
+ document.removeEventListener('touchmove', _this.handleTouchMove);
55
+ document.removeEventListener('touchend', _this.handleTouchEnd);
56
+ };
57
+ this.element = element;
58
+ this.options = Object.assign({
59
+ min: 0,
60
+ max: 100,
61
+ step: 1,
62
+ value: 0,
63
+ disabled: false
64
+ }, options);
65
+ this.value = this.options.value;
66
+ this.options.min = Number(this.options.min);
67
+ this.options.max = Number(this.options.max);
68
+ this.options.step = Number(this.options.step);
69
+ this.init();
70
+ }
71
+ Slider.prototype.init = function () {
72
+ if (this.options.disabled) {
73
+ this.element.style.opacity = '0.5';
74
+ }
75
+ // 기존 내용 제거
76
+ this.element.innerHTML = '';
77
+ // Track 생성
78
+ this.trackElement = document.createElement('div');
79
+ this.trackElement.className = 'ncua-slider__track';
80
+ this.element.appendChild(this.trackElement);
81
+ // Progress 생성
82
+ this.progressElement = document.createElement('div');
83
+ this.progressElement.className = 'ncua-slider__progress';
84
+ this.element.appendChild(this.progressElement);
85
+ // Handle(s) 생성
86
+ if (Array.isArray(this.value)) {
87
+ // Range slider (2 handles)
88
+ var _a = this.value,
89
+ leftValue = _a[0],
90
+ rightValue = _a[1];
91
+ this.createHandle(0, leftValue);
92
+ this.createHandle(1, rightValue);
93
+ } else {
94
+ // Single slider (1 handle)
95
+ this.createHandle(0, this.value);
96
+ }
97
+ // 이벤트 리스너 추가
98
+ if (!this.options.disabled) {
99
+ this.element.addEventListener('mousedown', this.handleMouseDown);
100
+ this.element.addEventListener('touchstart', this.handleTouchStart, {
101
+ passive: false
102
+ });
103
+ }
104
+ // 초기 위치 설정
105
+ this.updateHandlePositions();
106
+ };
107
+ Slider.prototype.createHandle = function (index, value) {
108
+ var _this = this;
109
+ var handle = document.createElement('div');
110
+ handle.className = 'ncua-slider__handle';
111
+ handle.setAttribute('role', 'slider');
112
+ handle.setAttribute('tabindex', this.options.disabled ? '-1' : '0');
113
+ handle.setAttribute('aria-valuemin', Array.isArray(this.value) && index === 1 ? String(this.value[0]) : String(this.options.min));
114
+ handle.setAttribute('aria-valuemax', Array.isArray(this.value) && index === 0 ? String(this.value[1]) : String(this.options.max));
115
+ handle.setAttribute('aria-valuenow', String(value));
116
+ handle.setAttribute('aria-disabled', String(this.options.disabled));
117
+ handle.dataset.index = String(index);
118
+ handle.addEventListener('focus', function () {
119
+ _this.activeHandle = index;
120
+ _this.updateHandleClasses();
121
+ });
122
+ handle.addEventListener('blur', function () {
123
+ _this.activeHandle = null;
124
+ _this.updateHandleClasses();
125
+ });
126
+ if (this.options.labelPosition === 'bottom') {
127
+ var label = document.createElement('div');
128
+ label.className = "ncua-slider__label";
129
+ label.textContent = "".concat(value, "%");
130
+ handle.appendChild(label);
131
+ }
132
+ if (this.options.labelPosition === 'top-floating') {
133
+ var label = document.createElement('div');
134
+ label.className = "ncua-slider__label ncua-slider__label--tooltip";
135
+ label.textContent = "".concat(value, "%");
136
+ handle.appendChild(label);
137
+ }
138
+ this.element.appendChild(handle);
139
+ this.handleElements[index] = handle;
140
+ };
141
+ Slider.prototype.updateHandlePositions = function () {
142
+ if (Array.isArray(this.value)) {
143
+ // Range slider
144
+ var _a = this.value,
145
+ leftValue = _a[0],
146
+ rightValue = _a[1];
147
+ var leftPosition = this.getPositionFromValue(leftValue);
148
+ var rightPosition = this.getPositionFromValue(rightValue);
149
+ this.handleElements[0].style.left = "".concat(leftPosition, "%");
150
+ this.handleElements[1].style.left = "".concat(rightPosition, "%");
151
+ if (this.options.labelPosition) {
152
+ var leftLabel = this.handleElements[0].querySelector('.ncua-slider__label');
153
+ var rightLabel = this.handleElements[1].querySelector('.ncua-slider__label');
154
+ if (leftLabel) leftLabel.textContent = "".concat(leftValue, "%");
155
+ if (rightLabel) rightLabel.textContent = "".concat(rightValue, "%");
156
+ }
157
+ if (this.progressElement) {
158
+ this.progressElement.style.left = "".concat(leftPosition, "%");
159
+ this.progressElement.style.width = "".concat(rightPosition - leftPosition, "%");
160
+ }
161
+ } else {
162
+ // Single slider
163
+ var position = this.getPositionFromValue(this.value);
164
+ this.handleElements[0].style.left = "".concat(position, "%");
165
+ if (this.options.labelPosition) {
166
+ var label = this.handleElements[0].querySelector('.ncua-slider__label');
167
+ if (label) label.textContent = "".concat(this.value, "%");
168
+ }
169
+ if (this.progressElement) {
170
+ this.progressElement.style.left = '0';
171
+ this.progressElement.style.width = "".concat(position, "%");
172
+ }
173
+ }
174
+ // ARIA 속성 업데이트
175
+ this.updateAriaAttributes();
176
+ };
177
+ Slider.prototype.updateHandleClasses = function () {
178
+ var _this = this;
179
+ this.handleElements.forEach(function (handle, index) {
180
+ if (index === _this.activeHandle) {
181
+ handle.classList.add('is-active');
182
+ } else {
183
+ handle.classList.remove('is-active');
184
+ }
185
+ });
186
+ };
187
+ Slider.prototype.updateAriaAttributes = function () {
188
+ if (Array.isArray(this.value)) {
189
+ // Range slider
190
+ var _a = this.value,
191
+ leftValue = _a[0],
192
+ rightValue = _a[1];
193
+ this.handleElements[0].setAttribute('aria-valuenow', String(leftValue));
194
+ this.handleElements[0].setAttribute('aria-valuemax', String(rightValue));
195
+ this.handleElements[1].setAttribute('aria-valuenow', String(rightValue));
196
+ this.handleElements[1].setAttribute('aria-valuemin', String(leftValue));
197
+ } else {
198
+ // Single slider
199
+ this.handleElements[0].setAttribute('aria-valuenow', String(this.value));
200
+ }
201
+ };
202
+ Slider.prototype.getPositionFromValue = function (value) {
203
+ return (value - this.options.min) / (this.options.max - this.options.min) * 100;
204
+ };
205
+ Slider.prototype.getValueFromPosition = function (position) {
206
+ var percentage = Math.min(Math.max(position, 0), 100);
207
+ var exactValue = this.options.min + percentage / 100 * (this.options.max - this.options.min);
208
+ var steppedValue = Math.round(exactValue / this.options.step) * this.options.step;
209
+ return Math.min(Math.max(steppedValue, this.options.min), this.options.max);
210
+ };
211
+ Slider.prototype.handleInteractionStart = function (clientX, target) {
212
+ // 슬라이더 영역 내부를 클릭/터치한 경우
213
+ if (target.closest('.ncua-slider')) {
214
+ // 핸들을 직접 클릭/터치했는지 확인
215
+ var handleElement = target.closest('.ncua-slider__handle');
216
+ if (handleElement) {
217
+ if (Array.isArray(this.value) && this.value[0] === this.value[1] && this.value[0] === this.options.max) {
218
+ this.activeHandle = 0;
219
+ } else if (Array.isArray(this.value) && this.value[0] === this.value[1] && this.value[0] === this.options.min) {
220
+ this.activeHandle = 1;
221
+ } else {
222
+ this.activeHandle = parseInt(handleElement.dataset.index || '0', 10);
223
+ }
224
+ } else {
225
+ // 슬라이더 트랙을 클릭/터치한 경우, 가장 가까운 핸들을 결정
226
+ var rect = this.element.getBoundingClientRect();
227
+ var position = (clientX - rect.left) / rect.width * 100;
228
+ if (Array.isArray(this.value)) {
229
+ var _a = this.value,
230
+ leftValue = _a[0],
231
+ rightValue = _a[1];
232
+ var leftPosition = this.getPositionFromValue(leftValue);
233
+ var rightPosition = this.getPositionFromValue(rightValue);
234
+ if (position < leftPosition) {
235
+ this.activeHandle = 0;
236
+ } else if (position > rightPosition) {
237
+ this.activeHandle = 1;
238
+ } else {
239
+ this.activeHandle = Math.abs(position - leftPosition) < Math.abs(position - rightPosition) ? 0 : 1;
240
+ }
241
+ } else {
242
+ this.activeHandle = 0;
243
+ }
244
+ }
245
+ this.updateHandleClasses();
246
+ this.isDragging = true;
247
+ // 클릭/터치 위치로 값 업데이트
248
+ this.updateValueFromClientX(clientX);
249
+ }
250
+ };
251
+ Slider.prototype.updateValueFromClientX = function (clientX) {
252
+ if (!this.element || this.activeHandle === null) return;
253
+ var rect = this.element.getBoundingClientRect();
254
+ var position = (clientX - rect.left) / rect.width * 100;
255
+ var newValue = this.getValueFromPosition(position);
256
+ var prevValue = this.value;
257
+ if (Array.isArray(this.value)) {
258
+ // Range slider
259
+ var _a = this.value,
260
+ leftValue = _a[0],
261
+ rightValue = _a[1];
262
+ if (this.activeHandle === 0) {
263
+ // 왼쪽 핸들
264
+ this.value = [Math.min(newValue, rightValue), rightValue];
265
+ } else if (this.activeHandle === 1) {
266
+ // 오른쪽 핸들
267
+ this.value = [leftValue, Math.max(newValue, leftValue)];
268
+ }
269
+ } else {
270
+ // Single slider
271
+ this.value = newValue;
272
+ }
273
+ this.notifyChange(prevValue);
274
+ this.updateHandlePositions();
275
+ };
276
+ Slider.prototype.notifyChange = function (prevValue) {
277
+ var _this = this;
278
+ var isSingle = !Array.isArray(prevValue);
279
+ var checkChangedSingle = function () {
280
+ return prevValue !== _this.value;
281
+ };
282
+ var checkChangedRange = function () {
283
+ return Array.isArray(prevValue) && Array.isArray(_this.value) && (prevValue[0] !== _this.value[0] || prevValue[1] !== _this.value[1]);
284
+ };
285
+ var isChanged = isSingle ? checkChangedSingle() : checkChangedRange();
286
+ if (this.options.onChange && isChanged) {
287
+ this.options.onChange(this.value);
288
+ }
289
+ };
290
+ Slider.prototype.setValue = function (value) {
291
+ this.value = value;
292
+ this.updateHandlePositions();
293
+ };
294
+ Slider.prototype.getValue = function () {
295
+ return this.value;
296
+ };
297
+ Slider.prototype.disable = function () {
298
+ this.options.disabled = true;
299
+ this.element.style.opacity = '0.5';
300
+ this.handleElements.forEach(function (handle) {
301
+ handle.setAttribute('tabindex', '-1');
302
+ handle.setAttribute('aria-disabled', 'true');
303
+ });
304
+ this.element.removeEventListener('mousedown', this.handleMouseDown);
305
+ this.element.removeEventListener('touchstart', this.handleTouchStart);
306
+ };
307
+ Slider.prototype.enable = function () {
308
+ this.options.disabled = false;
309
+ this.element.style.opacity = '1';
310
+ this.handleElements.forEach(function (handle) {
311
+ handle.setAttribute('tabindex', '0');
312
+ handle.setAttribute('aria-disabled', 'false');
313
+ });
314
+ this.element.addEventListener('mousedown', this.handleMouseDown);
315
+ this.element.addEventListener('touchstart', this.handleTouchStart, {
316
+ passive: false
317
+ });
318
+ };
319
+ Slider.prototype.destroy = function () {
320
+ // 모든 이벤트 리스너 제거
321
+ this.element.removeEventListener('mousedown', this.handleMouseDown);
322
+ this.element.removeEventListener('touchstart', this.handleTouchStart);
323
+ document.removeEventListener('mousemove', this.handleMouseMove);
324
+ document.removeEventListener('mouseup', this.handleMouseUp);
325
+ document.removeEventListener('touchmove', this.handleTouchMove);
326
+ document.removeEventListener('touchend', this.handleTouchEnd);
327
+ // 모든 내용 제거
328
+ this.element.innerHTML = '';
329
+ // 참조 정리
330
+ this.handleElements = [];
331
+ this.progressElement = null;
332
+ this.trackElement = null;
333
+ };
334
+ return Slider;
335
+ }();
336
+ export { Slider };
package/dist/esm/index.js CHANGED
@@ -1,10 +1,8 @@
1
1
  export * from './src/components/badge';
2
- export * from './src/components/breadcrumb';
3
2
  export * from './src/components/button';
4
3
  export * from './src/components/carousel';
5
4
  export * from './src/components/checkbox';
6
5
  export * from './src/components/date-picker';
7
- export * from './src/components/dropdown';
8
6
  export * from './src/components/input';
9
7
  export * from './src/components/pagination';
10
8
  export * from './src/components/radio';
@@ -13,7 +11,6 @@ export * from './src/components/shared/hintText';
13
11
  export * from './src/components/shared/label';
14
12
  export * from './src/components/shared';
15
13
  export * from './src/components/spinner';
16
- export * from './src/components/tag';
17
14
  export * from './src/components/toggle';
18
15
  export * from './src/components/tooltip';
19
16
  export * from './src/components';
@@ -22,10 +22,16 @@ import { createElement, forwardRef, useEffect, useState } from 'react';
22
22
  import { COLOR } from '../../../constant/color';
23
23
  import Icon from '@ncds/ui-admin-icon';
24
24
  export var svgSize = {
25
- xs: 12,
26
- sm: 14,
27
- md: 16,
28
- lg: 20
25
+ xxs: 12,
26
+ xs: 14,
27
+ sm: 16,
28
+ md: 20
29
+ };
30
+ export var iconOnlySvgSize = {
31
+ xxs: 14,
32
+ xs: 16,
33
+ sm: 20,
34
+ md: 20
29
35
  };
30
36
  export var Button = /*#__PURE__*/forwardRef(function (props, ref) {
31
37
  // NOTE: 엘리먼트 종류에 따라 props의 타입이 달라지므로 분리
@@ -65,11 +71,13 @@ export var Button = /*#__PURE__*/forwardRef(function (props, ref) {
65
71
  }
66
72
  };
67
73
  var sideSlotRender = function (slot) {
74
+ var _a, _b;
68
75
  if (slot.type === 'icon') {
76
+ var iconSize = onlyIcon ? iconOnlySvgSize[size] : svgSize[size];
69
77
  return _jsx(Icon, {
70
78
  name: slot.icon,
71
- height: svgSize[size],
72
- width: svgSize[size],
79
+ height: (_a = slot.size) !== null && _a !== void 0 ? _a : iconSize,
80
+ width: (_b = slot.size) !== null && _b !== void 0 ? _b : iconSize,
73
81
  color: slot.color ? COLOR[slot.color] : undefined
74
82
  });
75
83
  }
@@ -69,7 +69,7 @@ ButtonGroup.Item = function (_a) {
69
69
  if (!icon) return null;
70
70
  if (icon.type === 'icon') {
71
71
  return _jsx(Icon, {
72
- name: icon.name,
72
+ name: icon.icon,
73
73
  width: svgSize[(_a = icon.size) !== null && _a !== void 0 ? _a : 'md'],
74
74
  height: svgSize[(_b = icon.size) !== null && _b !== void 0 ? _b : 'md'],
75
75
  color: COLOR[(_c = icon.color) !== null && _c !== void 0 ? _c : 'gray500']
@@ -1,3 +1,2 @@
1
1
  export * from './DatePicker';
2
- export * from './RangeDatePicker';
3
- export * from './utils';
2
+ export * from './RangeDatePicker';
@@ -0,0 +1,36 @@
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 { forwardRef } from 'react';
13
+ import classNames from 'classnames';
14
+ export var Divider = /*#__PURE__*/forwardRef(function (_a, ref) {
15
+ var className = _a.className,
16
+ type = _a.type,
17
+ _b = _a.style,
18
+ style = _b === void 0 ? 'single-line' : _b,
19
+ children = _a.children;
20
+ var componentClassName = classNames('ncua-divider', "ncua-divider--".concat(type), "ncua-divider--".concat(style), className);
21
+ return _jsxs("div", __assign({
22
+ className: componentClassName,
23
+ ref: ref
24
+ }, {
25
+ children: [style === 'single-line' && _jsx("div", {
26
+ className: "ncua-divider__line"
27
+ }), _jsx("div", __assign({
28
+ className: "ncua-divider__content"
29
+ }, {
30
+ children: children
31
+ })), style === 'single-line' && _jsx("div", {
32
+ className: "ncua-divider__line"
33
+ })]
34
+ }));
35
+ });
36
+ Divider.displayName = 'Divider';
@@ -0,0 +1 @@
1
+ export * from './Divider';
@@ -0,0 +1,51 @@
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, jsxs as _jsxs } from "react/jsx-runtime";
20
+ import { Button } from '../button/Button';
21
+ export var EmptyState = function (_a) {
22
+ var title = _a.title,
23
+ description = _a.description,
24
+ buttons = _a.buttons;
25
+ var emptyStateButtons = buttons ? Array.isArray(buttons) ? buttons : [buttons] : [];
26
+ return _jsxs("div", __assign({
27
+ className: "ncua-empty-state"
28
+ }, {
29
+ children: [_jsx("p", __assign({
30
+ className: "ncua-empty-state__title"
31
+ }, {
32
+ children: title
33
+ })), _jsx("span", __assign({
34
+ className: "ncua-empty-state__description"
35
+ }, {
36
+ children: description
37
+ })), emptyStateButtons.length > 0 && _jsx("div", __assign({
38
+ className: "ncua-empty-state__button-group"
39
+ }, {
40
+ children: emptyStateButtons.map(function (_a) {
41
+ var size = _a.size,
42
+ label = _a.label,
43
+ rest = __rest(_a, ["size", "label"]);
44
+ return _jsx(Button, __assign({
45
+ size: size !== null && size !== void 0 ? size : 'xs',
46
+ label: label
47
+ }, rest), label);
48
+ })
49
+ }))]
50
+ }));
51
+ };
@@ -0,0 +1 @@
1
+ export * from './EmptyState';