@ncds/ui-admin 0.0.22 → 0.0.24

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 (97) 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/input/InputBase.js +27 -14
  15. package/dist/cjs/src/components/modal/Modal.js +193 -0
  16. package/dist/cjs/src/components/modal/index.js +12 -0
  17. package/dist/cjs/src/components/notification/FloatingNotification.js +104 -0
  18. package/dist/cjs/src/components/notification/FullWidthNotification.js +112 -0
  19. package/dist/cjs/src/components/notification/Notification.js +66 -0
  20. package/dist/cjs/src/components/notification/index.js +38 -0
  21. package/dist/cjs/src/components/pagination/NavButton.js +6 -4
  22. package/dist/cjs/src/components/pagination/Pagination.js +4 -19
  23. package/dist/cjs/src/components/progress-bar/ProgressBar.js +57 -0
  24. package/dist/cjs/src/components/progress-bar/index.js +16 -0
  25. package/dist/cjs/src/components/progress-circle/ProgressCircle.js +121 -0
  26. package/dist/cjs/src/components/progress-circle/index.js +16 -0
  27. package/dist/cjs/src/components/slider/Slider.js +64 -0
  28. package/dist/cjs/src/components/slider/index.js +16 -0
  29. package/dist/cjs/src/components/tab/HorizontalTab.js +77 -0
  30. package/dist/cjs/src/components/tab/TabButton.js +76 -0
  31. package/dist/cjs/src/components/tab/VerticalTab.js +75 -0
  32. package/dist/cjs/src/components/tab/index.js +38 -0
  33. package/dist/esm/assets/scripts/index.js +2 -1
  34. package/dist/esm/assets/scripts/slider.js +336 -0
  35. package/dist/esm/index.js +0 -3
  36. package/dist/esm/src/components/button/Button.js +14 -6
  37. package/dist/esm/src/components/button/ButtonGroup.js +1 -1
  38. package/dist/esm/src/components/date-picker/index.js +1 -2
  39. package/dist/esm/src/components/divider/Divider.js +36 -0
  40. package/dist/esm/src/components/divider/index.js +1 -0
  41. package/dist/esm/src/components/empty-state/EmptyState.js +51 -0
  42. package/dist/esm/src/components/empty-state/index.js +1 -0
  43. package/dist/esm/src/components/featured-icon/FeaturedIcon.js +72 -0
  44. package/dist/esm/src/components/featured-icon/index.js +1 -0
  45. package/dist/esm/src/components/index.js +8 -1
  46. package/dist/esm/src/components/input/InputBase.js +27 -14
  47. package/dist/esm/src/components/modal/Modal.js +185 -0
  48. package/dist/esm/src/components/modal/index.js +1 -0
  49. package/dist/esm/src/components/notification/FloatingNotification.js +97 -0
  50. package/dist/esm/src/components/notification/FullWidthNotification.js +105 -0
  51. package/dist/esm/src/components/notification/Notification.js +59 -0
  52. package/dist/esm/src/components/notification/index.js +3 -0
  53. package/dist/esm/src/components/pagination/NavButton.js +6 -4
  54. package/dist/esm/src/components/pagination/Pagination.js +4 -19
  55. package/dist/esm/src/components/progress-bar/ProgressBar.js +50 -0
  56. package/dist/esm/src/components/progress-bar/index.js +1 -0
  57. package/dist/esm/src/components/progress-circle/ProgressCircle.js +114 -0
  58. package/dist/esm/src/components/progress-circle/index.js +1 -0
  59. package/dist/esm/src/components/slider/Slider.js +57 -0
  60. package/dist/esm/src/components/slider/index.js +1 -0
  61. package/dist/esm/src/components/tab/HorizontalTab.js +69 -0
  62. package/dist/esm/src/components/tab/TabButton.js +68 -0
  63. package/dist/esm/src/components/tab/VerticalTab.js +67 -0
  64. package/dist/esm/src/components/tab/index.js +3 -0
  65. package/dist/types/assets/scripts/index.d.ts +1 -0
  66. package/dist/types/assets/scripts/slider.d.ts +42 -0
  67. package/dist/types/index.d.ts +0 -3
  68. package/dist/types/src/components/button/Button.d.ts +2 -1
  69. package/dist/types/src/components/button/ButtonGroup.d.ts +6 -5
  70. package/dist/types/src/components/date-picker/index.d.ts +0 -1
  71. package/dist/types/src/components/divider/Divider.d.ts +11 -0
  72. package/dist/types/src/components/divider/index.d.ts +2 -0
  73. package/dist/types/src/components/empty-state/EmptyState.d.ts +14 -0
  74. package/dist/types/src/components/empty-state/index.d.ts +2 -0
  75. package/dist/types/src/components/featured-icon/FeaturedIcon.d.ts +14 -0
  76. package/dist/types/src/components/featured-icon/index.d.ts +2 -0
  77. package/dist/types/src/components/index.d.ts +8 -1
  78. package/dist/types/src/components/input/InputBase.d.ts +2 -0
  79. package/dist/types/src/components/modal/Modal.d.ts +75 -0
  80. package/dist/types/src/components/modal/index.d.ts +3 -0
  81. package/dist/types/src/components/notification/FloatingNotification.d.ts +32 -0
  82. package/dist/types/src/components/notification/FullWidthNotification.d.ts +32 -0
  83. package/dist/types/src/components/notification/Notification.d.ts +59 -0
  84. package/dist/types/src/components/notification/index.d.ts +4 -0
  85. package/dist/types/src/components/pagination/NavButton.d.ts +2 -2
  86. package/dist/types/src/components/progress-bar/ProgressBar.d.ts +7 -0
  87. package/dist/types/src/components/progress-bar/index.d.ts +2 -0
  88. package/dist/types/src/components/progress-circle/ProgressCircle.d.ts +8 -0
  89. package/dist/types/src/components/progress-circle/index.d.ts +2 -0
  90. package/dist/types/src/components/slider/Slider.d.ts +15 -0
  91. package/dist/types/src/components/slider/index.d.ts +2 -0
  92. package/dist/types/src/components/tab/HorizontalTab.d.ts +12 -0
  93. package/dist/types/src/components/tab/TabButton.d.ts +26 -0
  94. package/dist/types/src/components/tab/VerticalTab.d.ts +10 -0
  95. package/dist/types/src/components/tab/index.d.ts +4 -0
  96. package/dist/ui-admin/assets/styles/style.css +1290 -105
  97. package/package.json +1 -1
@@ -0,0 +1,59 @@
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, Fragment as _Fragment } from "react/jsx-runtime";
20
+ import { forwardRef } from 'react';
21
+ import classNames from 'classnames';
22
+ import { FloatingNotification } from './FloatingNotification';
23
+ import { FullWidthNotification } from './FullWidthNotification';
24
+ export var Notification = /*#__PURE__*/forwardRef(function (_a, ref) {
25
+ var _b = _a.type,
26
+ type = _b === void 0 ? 'floating' : _b,
27
+ title = _a.title,
28
+ supportingText = _a.supportingText,
29
+ _c = _a.variant,
30
+ variant = _c === void 0 ? 'neutral' : _c,
31
+ onClose = _a.onClose,
32
+ className = _a.className,
33
+ actions = _a.actions,
34
+ rest = __rest(_a, ["type", "title", "supportingText", "variant", "onClose", "className", "actions"]);
35
+ var actionsContent = actions && actions.length > 0 ? _jsx(_Fragment, {
36
+ children: actions.map(function (action, index) {
37
+ return _jsx("button", __assign({
38
+ onClick: action.onClick,
39
+ className: classNames('ncua-notification__action-button', "ncua-notification__action-button--".concat(action.hierarchy || 'link-gray'))
40
+ }, {
41
+ children: action.label
42
+ }), index);
43
+ })
44
+ }) : null;
45
+ var sharedProps = __assign({
46
+ title: title,
47
+ supportingText: supportingText,
48
+ variant: variant,
49
+ onClose: onClose,
50
+ className: className,
51
+ actions: actionsContent
52
+ }, rest);
53
+ return type === 'floating' ? _jsx(FloatingNotification, __assign({}, sharedProps, {
54
+ ref: ref
55
+ })) : _jsx(FullWidthNotification, __assign({}, sharedProps, {
56
+ ref: ref
57
+ }));
58
+ });
59
+ Notification.displayName = 'Notification';
@@ -0,0 +1,3 @@
1
+ export * from './Notification';
2
+ export * from './FloatingNotification';
3
+ export * from './FullWidthNotification';
@@ -43,7 +43,7 @@ var NAV_BUTTON_CONFIG = {
43
43
  export var NavButton = function (_a) {
44
44
  var type = _a.type,
45
45
  as = _a.as,
46
- isPC = _a.isPC,
46
+ breakPoint = _a.breakPoint,
47
47
  noPrev = _a.noPrev,
48
48
  noNext = _a.noNext,
49
49
  href = _a.href,
@@ -54,6 +54,7 @@ export var NavButton = function (_a) {
54
54
  var isFirstOrPrev = type === 'first' || type === 'prev';
55
55
  var isNextOrLast = type === 'next' || type === 'last';
56
56
  var disabled = isFirstOrPrev ? noPrev : isNextOrLast ? noNext : false;
57
+ var isPC = breakPoint === 'pc';
57
58
  // key를 제외한 공통 props
58
59
  var buttonProps = {
59
60
  label: config.label,
@@ -62,15 +63,16 @@ export var NavButton = function (_a) {
62
63
  leadingIcon: {
63
64
  type: 'icon',
64
65
  icon: config.getIcon(isPC),
65
- color: disabled ? 'gray200' : 'gray700'
66
+ color: disabled ? 'gray200' : 'gray700',
67
+ size: isPC ? 16 : 20
66
68
  },
67
69
  hierarchy: 'secondary-gray',
68
- size: 'xs',
70
+ size: isPC ? 'xs' : 'sm',
69
71
  disabled: disabled,
70
72
  onClick: onClick
71
73
  };
72
74
  // key 값 별도 계산
73
- var buttonKey = isNavigationButton ? "".concat(isPC ? 'pc' : 'mobile', "-").concat(type) : undefined;
75
+ var buttonKey = isNavigationButton ? "".concat(breakPoint, "-").concat(type) : undefined;
74
76
  if (as === 'a') {
75
77
  return _jsx(Button, __assign({
76
78
  as: "a",
@@ -20,7 +20,6 @@ import { Fragment as _Fragment, jsxs as _jsxs, jsx as _jsx } from "react/jsx-run
20
20
  import classNames from 'classnames';
21
21
  import { isFunction, range, uniqueId } from 'lodash-es';
22
22
  import { useEffect, useState } from 'react';
23
- import { MINIMUM_PC_SIZE } from '../../constant';
24
23
  import { NavButton } from './NavButton';
25
24
  // 네비게이션 버튼 설정
26
25
  export var Pagination = function (_a) {
@@ -42,9 +41,6 @@ export var Pagination = function (_a) {
42
41
  var _g = useState(1),
43
42
  start = _g[0],
44
43
  setStart = _g[1];
45
- var _h = useState(globalThis.innerWidth > MINIMUM_PC_SIZE),
46
- isPC = _h[0],
47
- setIsPC = _h[1];
48
44
  var noPrev = start === 1;
49
45
  var noNext = start + pageCount - 1 >= totalPage;
50
46
  var showJumpPageButton = totalPage > pageCount;
@@ -72,17 +68,6 @@ export var Pagination = function (_a) {
72
68
  setStart(lastGroupStart);
73
69
  }
74
70
  }, [currentPage]);
75
- useEffect(function () {
76
- var mql = globalThis.matchMedia("(min-width: ".concat(MINIMUM_PC_SIZE, "px)"));
77
- setIsPC(mql.matches);
78
- var handleResize = function (e) {
79
- setIsPC(e.matches);
80
- };
81
- mql.addEventListener('change', handleResize);
82
- return function () {
83
- return mql.removeEventListener('change', handleResize);
84
- };
85
- }, []);
86
71
  return _jsx(_Fragment, {
87
72
  children: _jsxs("div", __assign({
88
73
  className: classNames('ncua-pagination', "ncua-pagination--".concat(breakPoint), className)
@@ -91,7 +76,7 @@ export var Pagination = function (_a) {
91
76
  children: [NavButton({
92
77
  type: 'first',
93
78
  as: as,
94
- isPC: isPC,
79
+ breakPoint: breakPoint,
95
80
  noPrev: noPrev,
96
81
  noNext: noNext,
97
82
  href: restProps.href || '',
@@ -102,7 +87,7 @@ export var Pagination = function (_a) {
102
87
  }), NavButton({
103
88
  type: 'prev',
104
89
  as: as,
105
- isPC: isPC,
90
+ breakPoint: breakPoint,
106
91
  noPrev: noPrev,
107
92
  noNext: noNext,
108
93
  href: restProps.href || '',
@@ -142,7 +127,7 @@ export var Pagination = function (_a) {
142
127
  children: [NavButton({
143
128
  type: 'next',
144
129
  as: as,
145
- isPC: isPC,
130
+ breakPoint: breakPoint,
146
131
  noPrev: noPrev,
147
132
  noNext: noNext,
148
133
  href: restProps.href || '',
@@ -153,7 +138,7 @@ export var Pagination = function (_a) {
153
138
  }), NavButton({
154
139
  type: 'last',
155
140
  as: as,
156
- isPC: isPC,
141
+ breakPoint: breakPoint,
157
142
  noPrev: noPrev,
158
143
  noNext: noNext,
159
144
  href: restProps.href || '',
@@ -0,0 +1,50 @@
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
+ export var ProgressBar = function (_a) {
13
+ var label = _a.label,
14
+ value = _a.value;
15
+ var limitedValue = Math.min(Math.max(0, value), 100);
16
+ var displayValue = "".concat(limitedValue.toFixed(0), "%");
17
+ var progressValueStyle = label === 'top-float' || label === 'bottom-float' ? {
18
+ '--progress-value': "".concat(limitedValue, "%")
19
+ } : undefined;
20
+ var renderLabel = function (labelType) {
21
+ return _jsx("span", __assign({
22
+ className: "ncua-progress-bar__label ncua-progress-bar__label-".concat(labelType)
23
+ }, {
24
+ children: displayValue
25
+ }));
26
+ };
27
+ var isFloatingLabel = label === 'top-float' || label === 'bottom-float';
28
+ return _jsxs("div", __assign({
29
+ className: "ncua-progress-bar ncua-progress-bar-".concat(label),
30
+ style: progressValueStyle
31
+ }, {
32
+ children: [isFloatingLabel && renderLabel(label), _jsxs("div", __assign({
33
+ className: "ncua-progress-bar__content"
34
+ }, {
35
+ children: [_jsx("div", __assign({
36
+ className: "ncua-progress-bar__bar"
37
+ }, {
38
+ children: _jsx("div", {
39
+ className: "ncua-progress-bar__fill",
40
+ style: {
41
+ width: "".concat(limitedValue, "%")
42
+ },
43
+ "aria-valuenow": limitedValue,
44
+ "aria-valuemin": 0,
45
+ "aria-valuemax": 100
46
+ })
47
+ })), label === 'right' && renderLabel('right')]
48
+ })), label === 'bottom' && renderLabel('bottom')]
49
+ }));
50
+ };
@@ -0,0 +1 @@
1
+ export * from './ProgressBar';
@@ -0,0 +1,114 @@
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
+ export var ProgressCircle = function (_a) {
13
+ var size = _a.size,
14
+ label = _a.label,
15
+ value = _a.value,
16
+ _b = _a.theme,
17
+ theme = _b === void 0 ? 'circle' : _b;
18
+ var limitedValue = Math.min(Math.max(0, value), 100);
19
+ if (theme === 'circle') {
20
+ return _jsxs("div", __assign({
21
+ className: "ncua-progress-circle ncua-progress-circle-".concat(size, " ncua-progress-circle-").concat(theme)
22
+ }, {
23
+ children: [_jsxs("div", __assign({
24
+ className: "ncua-progress-circle__content"
25
+ }, {
26
+ children: [_jsxs("svg", __assign({
27
+ className: "ncua-progress-circle__svg",
28
+ viewBox: "0 0 100 100"
29
+ }, {
30
+ children: [_jsx("circle", {
31
+ className: "ncua-progress-circle__background",
32
+ cx: "50",
33
+ cy: "50",
34
+ r: "45",
35
+ strokeWidth: "10",
36
+ fill: "none"
37
+ }), _jsx("circle", {
38
+ className: "ncua-progress-circle__progress",
39
+ cx: "50",
40
+ cy: "50",
41
+ r: "45",
42
+ strokeWidth: "10",
43
+ fill: "none",
44
+ strokeDasharray: "var(--circle-circumference)",
45
+ strokeDashoffset: "calc(var(--circle-circumference) * (1 - ".concat(limitedValue, " / 100))"),
46
+ transform: "rotate(-90 50 50)",
47
+ strokeLinecap: "round"
48
+ })]
49
+ })), _jsxs("div", __assign({
50
+ className: "ncua-progress-circle__label-container"
51
+ }, {
52
+ children: [size !== 'xxs' && label && _jsx("div", __assign({
53
+ className: "ncua-progress-circle__label-text"
54
+ }, {
55
+ children: label
56
+ })), _jsx("div", __assign({
57
+ className: "ncua-progress-circle__label"
58
+ }, {
59
+ children: "".concat(limitedValue, "%")
60
+ }))]
61
+ }))]
62
+ })), size === 'xxs' && label && _jsx("div", __assign({
63
+ className: "ncua-progress-circle__outside-label"
64
+ }, {
65
+ children: label
66
+ }))]
67
+ }));
68
+ } else {
69
+ return _jsxs("div", __assign({
70
+ className: "ncua-progress-circle ncua-progress-circle-".concat(size, " ncua-progress-circle-").concat(theme)
71
+ }, {
72
+ children: [_jsxs("div", __assign({
73
+ className: "ncua-progress-circle__content"
74
+ }, {
75
+ children: [_jsxs("svg", __assign({
76
+ className: "ncua-progress-circle__svg",
77
+ viewBox: "0 0 100 50"
78
+ }, {
79
+ children: [_jsx("path", {
80
+ className: "ncua-progress-circle__background",
81
+ d: "M 5 50 A 45 45 0 0 1 95 50",
82
+ strokeWidth: "10",
83
+ fill: "none",
84
+ strokeLinecap: "round"
85
+ }), _jsx("path", {
86
+ className: "ncua-progress-circle__progress",
87
+ d: "M 5 50 A 45 45 0 0 1 95 50",
88
+ strokeWidth: "10",
89
+ fill: "none",
90
+ strokeDasharray: "var(--half-circle-circumference)",
91
+ strokeDashoffset: "calc(var(--half-circle-circumference) * (1 - ".concat(limitedValue, " / 100))"),
92
+ strokeLinecap: "round"
93
+ })]
94
+ })), _jsxs("div", __assign({
95
+ className: "ncua-progress-circle__label-container"
96
+ }, {
97
+ children: [size !== 'xxs' && label && _jsx("div", __assign({
98
+ className: "ncua-progress-circle__label-text"
99
+ }, {
100
+ children: label
101
+ })), _jsx("div", __assign({
102
+ className: "ncua-progress-circle__label"
103
+ }, {
104
+ children: "".concat(limitedValue, "%")
105
+ }))]
106
+ }))]
107
+ })), size === 'xxs' && label && _jsx("div", __assign({
108
+ className: "ncua-progress-circle__outside-label"
109
+ }, {
110
+ children: label
111
+ }))]
112
+ }));
113
+ }
114
+ };
@@ -0,0 +1 @@
1
+ export * from './ProgressCircle';
@@ -0,0 +1,57 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect, useRef } from 'react';
3
+ import { Slider as NcuaSlider } from '../../../assets/scripts/slider';
4
+ export var Slider = function (_a) {
5
+ var _b = _a.min,
6
+ min = _b === void 0 ? 0 : _b,
7
+ _c = _a.max,
8
+ max = _c === void 0 ? 100 : _c,
9
+ _d = _a.step,
10
+ step = _d === void 0 ? 1 : _d,
11
+ _e = _a.value,
12
+ value = _e === void 0 ? 0 : _e,
13
+ onChange = _a.onChange,
14
+ labelPosition = _a.labelPosition,
15
+ _f = _a.disabled,
16
+ disabled = _f === void 0 ? false : _f,
17
+ className = _a.className;
18
+ var containerRef = useRef(null);
19
+ var sliderInstanceRef = useRef(null);
20
+ useEffect(function () {
21
+ if (!containerRef.current) return;
22
+ sliderInstanceRef.current = new NcuaSlider(containerRef.current, {
23
+ min: min,
24
+ max: max,
25
+ step: step,
26
+ value: value,
27
+ onChange: onChange,
28
+ labelPosition: labelPosition,
29
+ disabled: disabled
30
+ });
31
+ return function () {
32
+ if (sliderInstanceRef.current) {
33
+ sliderInstanceRef.current.destroy();
34
+ sliderInstanceRef.current = null;
35
+ }
36
+ };
37
+ }, [typeof value, onChange, min, max, step, labelPosition]);
38
+ useEffect(function () {
39
+ if (sliderInstanceRef.current) {
40
+ sliderInstanceRef.current.setValue(value);
41
+ }
42
+ }, [sliderInstanceRef, value]);
43
+ useEffect(function () {
44
+ if (sliderInstanceRef.current) {
45
+ if (disabled) {
46
+ sliderInstanceRef.current.disable();
47
+ } else {
48
+ sliderInstanceRef.current.enable();
49
+ }
50
+ }
51
+ }, [disabled]);
52
+ return _jsx("div", {
53
+ ref: containerRef,
54
+ className: "ncua-slider ".concat(className || '')
55
+ });
56
+ };
57
+ export default Slider;
@@ -0,0 +1 @@
1
+ export * from './Slider';
@@ -0,0 +1,69 @@
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 { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
12
+ import classNames from 'classnames';
13
+ import { uniqueId } from 'lodash';
14
+ import 'swiper/css';
15
+ import { Swiper, SwiperSlide } from 'swiper/react';
16
+ import { TabButton } from './TabButton';
17
+ export var HorizontalTab = function (_a) {
18
+ var _b = _a.type,
19
+ type = _b === void 0 ? 'button-primary' : _b,
20
+ size = _a.size,
21
+ activeTab = _a.activeTab,
22
+ onClick = _a.onClick,
23
+ _c = _a.fullWidth,
24
+ fullWidth = _c === void 0 ? false : _c,
25
+ _d = _a.menus,
26
+ menus = _d === void 0 ? [] : _d;
27
+ var getTabGap = function (type) {
28
+ var _a;
29
+ var gap = {
30
+ underline: 16
31
+ };
32
+ return (_a = gap[type]) !== null && _a !== void 0 ? _a : 8;
33
+ };
34
+ if (!menus.length) return _jsx(_Fragment, {});
35
+ return _jsx("div", __assign({
36
+ className: classNames('ncua-horizontal-tab', "ncua-horizontal-tab--".concat(type), {
37
+ 'ncua-horizontal-tab--fullWidth': fullWidth
38
+ })
39
+ }, {
40
+ children: _jsx(Swiper, __assign({
41
+ slidesPerView: "auto",
42
+ spaceBetween: getTabGap(type)
43
+ }, {
44
+ children: menus.map(function (menu) {
45
+ var isActive = menu.href ? menu.href.includes(activeTab) : menu.id === activeTab;
46
+ var commonProps = {
47
+ id: menu.id,
48
+ label: menu.label,
49
+ badgeInfo: menu.badgeInfo,
50
+ isActive: isActive,
51
+ tabButtonType: type,
52
+ size: size,
53
+ onClick: function () {
54
+ var _a;
55
+ return onClick === null || onClick === void 0 ? void 0 : onClick((_a = menu.id) !== null && _a !== void 0 ? _a : '');
56
+ }
57
+ };
58
+ return _jsx(SwiperSlide, __assign({
59
+ className: "ncua-horizontal-tab__item"
60
+ }, {
61
+ children: menu.href ? _jsx(TabButton, __assign({}, commonProps, {
62
+ href: menu.href,
63
+ target: menu.target
64
+ })) : _jsx(TabButton, __assign({}, commonProps))
65
+ }), uniqueId('horizontal-tab'));
66
+ })
67
+ }))
68
+ }));
69
+ };
@@ -0,0 +1,68 @@
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 classNames from 'classnames';
21
+ import { Badge } from '../badge/Badge';
22
+ export var TabButton = function (_a) {
23
+ var label = _a.label,
24
+ _b = _a.size,
25
+ size = _b === void 0 ? 'md' : _b,
26
+ tabButtonType = _a.tabButtonType,
27
+ type = _a.type,
28
+ _c = _a.isActive,
29
+ isActive = _c === void 0 ? false : _c,
30
+ badgeInfo = _a.badgeInfo,
31
+ className = _a.className,
32
+ children = _a.children,
33
+ props = __rest(_a, ["label", "size", "tabButtonType", "type", "isActive", "badgeInfo", "className", "children"]);
34
+ var tabType = tabButtonType || type;
35
+ var componentClassName = classNames('ncua-tab-button', "ncua-tab-button--".concat(size), "ncua-tab-button--".concat(tabType || 'button-primary'), {
36
+ 'is-active': isActive
37
+ }, className);
38
+ if ('href' in props && props.href) {
39
+ var _d = props,
40
+ href = _d.href,
41
+ _e = _d.target,
42
+ target = _e === void 0 ? '_self' : _e,
43
+ onClick_1 = _d.onClick,
44
+ anchorProps = __rest(_d, ["href", "target", "onClick"]);
45
+ return _jsxs("a", __assign({
46
+ className: componentClassName,
47
+ href: href,
48
+ target: target,
49
+ onClick: onClick_1
50
+ }, anchorProps, {
51
+ children: [label, badgeInfo && _jsx(Badge, __assign({}, badgeInfo, {
52
+ size: "sm"
53
+ })), children]
54
+ }));
55
+ }
56
+ var _f = props,
57
+ onClick = _f.onClick,
58
+ buttonProps = __rest(_f, ["onClick"]);
59
+ return _jsxs("button", __assign({
60
+ type: "button",
61
+ className: componentClassName,
62
+ onClick: onClick
63
+ }, buttonProps, {
64
+ children: [label, badgeInfo && _jsx(Badge, __assign({}, badgeInfo, {
65
+ size: "xs"
66
+ })), children]
67
+ }));
68
+ };
@@ -0,0 +1,67 @@
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 } from "react/jsx-runtime";
12
+ import classNames from 'classnames';
13
+ import { Fragment } from 'react';
14
+ import { Select } from '../select/Select';
15
+ import { TabButton } from './TabButton';
16
+ export var VerticalTab = function (_a) {
17
+ var _b = _a.type,
18
+ type = _b === void 0 ? 'button-primary' : _b,
19
+ _c = _a.breakPoint,
20
+ breakPoint = _c === void 0 ? 'pc' : _c,
21
+ activeTab = _a.activeTab,
22
+ menus = _a.menus,
23
+ onClick = _a.onClick;
24
+ var handleSelectChange = function (e) {
25
+ onClick === null || onClick === void 0 ? void 0 : onClick(e.target.value);
26
+ };
27
+ var optionItems = (menus === null || menus === void 0 ? void 0 : menus.map(function (menu) {
28
+ return {
29
+ id: menu.id || '',
30
+ label: menu.label || ''
31
+ };
32
+ })) || [];
33
+ return _jsx("div", __assign({
34
+ className: classNames('ncua-vertical-tab', "ncua-vertical-tab--".concat(type))
35
+ }, {
36
+ children: breakPoint === 'mobile' ? _jsx("div", __assign({
37
+ className: "ncua-vertical-tab__select"
38
+ }, {
39
+ children: _jsx(Select, {
40
+ value: activeTab,
41
+ onChange: handleSelectChange,
42
+ optionItems: optionItems,
43
+ size: "md"
44
+ })
45
+ })) : menus === null || menus === void 0 ? void 0 : menus.map(function (menu) {
46
+ var isActive = menu.href ? menu.href.includes(activeTab) : menu.id === activeTab;
47
+ var commonProps = {
48
+ id: menu.id,
49
+ label: menu.label,
50
+ badgeInfo: menu.badgeInfo,
51
+ isActive: isActive,
52
+ tabButtonType: type,
53
+ size: 'sm',
54
+ onClick: function () {
55
+ var _a;
56
+ return onClick === null || onClick === void 0 ? void 0 : onClick((_a = menu.id) !== null && _a !== void 0 ? _a : '');
57
+ }
58
+ };
59
+ return _jsx(Fragment, {
60
+ children: menu.href ? _jsx(TabButton, __assign({}, commonProps, {
61
+ href: menu.href,
62
+ target: menu.target
63
+ })) : _jsx(TabButton, __assign({}, commonProps))
64
+ }, menu.id);
65
+ })
66
+ }));
67
+ };
@@ -0,0 +1,3 @@
1
+ export * from './HorizontalTab';
2
+ export * from './TabButton';
3
+ export * from './VerticalTab';
@@ -1,2 +1,3 @@
1
1
  export * from './test';
2
+ export * from './slider';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,42 @@
1
+ export interface SliderOptions {
2
+ min: number;
3
+ max: number;
4
+ step: number;
5
+ value: number | [number, number];
6
+ onChange?: (value: number | [number, number]) => void;
7
+ labelPosition?: 'bottom' | 'top-floating';
8
+ disabled?: boolean;
9
+ }
10
+ export declare class Slider {
11
+ private element;
12
+ private options;
13
+ private activeHandle;
14
+ private isDragging;
15
+ private value;
16
+ private handleElements;
17
+ private progressElement;
18
+ private trackElement;
19
+ constructor(element: HTMLElement, options: SliderOptions);
20
+ private init;
21
+ private createHandle;
22
+ private updateHandlePositions;
23
+ private updateHandleClasses;
24
+ private updateAriaAttributes;
25
+ private getPositionFromValue;
26
+ private getValueFromPosition;
27
+ private handleInteractionStart;
28
+ private handleMouseDown;
29
+ private handleTouchStart;
30
+ private handleMouseMove;
31
+ private handleTouchMove;
32
+ private handleMouseUp;
33
+ private handleTouchEnd;
34
+ private updateValueFromClientX;
35
+ private notifyChange;
36
+ setValue(value: number | [number, number]): void;
37
+ getValue(): number | [number, number];
38
+ disable(): void;
39
+ enable(): void;
40
+ destroy(): void;
41
+ }
42
+ //# sourceMappingURL=slider.d.ts.map