@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,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';
@@ -0,0 +1,72 @@
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, jsxs as _jsxs } from "react/jsx-runtime";
20
+ import Icon from '@ncds/ui-admin-icon';
21
+ import classNames from 'classnames';
22
+ import { forwardRef } from 'react';
23
+ import { COLOR } from '../../../constant/color';
24
+ var iconSizeMap = {
25
+ sm: 16,
26
+ md: 20,
27
+ lg: 24,
28
+ xl: 28
29
+ };
30
+ var iconStrokeColorMap = {
31
+ neutral: 'gray700',
32
+ error: 'red500',
33
+ warning: 'orange500',
34
+ success: 'green600'
35
+ };
36
+ export var FeaturedIcon = /*#__PURE__*/forwardRef(function (_a, ref) {
37
+ var name = _a.name,
38
+ _b = _a.theme,
39
+ theme = _b === void 0 ? 'light-circle' : _b,
40
+ _c = _a.color,
41
+ color = _c === void 0 ? 'neutral' : _c,
42
+ _d = _a.size,
43
+ size = _d === void 0 ? 'md' : _d,
44
+ className = _a.className,
45
+ rest = __rest(_a, ["name", "theme", "color", "size", "className"]);
46
+ var getIconColor = function () {
47
+ if (theme === 'dark-circle') {
48
+ return 'white';
49
+ }
50
+ if (theme === 'square-outline') {
51
+ return 'gray700';
52
+ }
53
+ return iconStrokeColorMap[color];
54
+ };
55
+ return _jsxs("div", __assign({
56
+ ref: ref,
57
+ className: classNames('ncua-featured-icon', "ncua-featured-icon--".concat(theme), "ncua-featured-icon--".concat(color), "ncua-featured-icon--".concat(size), className)
58
+ }, rest, {
59
+ children: [theme === 'outline-circle' && _jsxs(_Fragment, {
60
+ children: [_jsx("div", {
61
+ className: "ncua-featured-icon__outline ncua-featured-icon__outline--inner"
62
+ }), _jsx("div", {
63
+ className: "ncua-featured-icon__outline ncua-featured-icon__outline--outer"
64
+ })]
65
+ }), _jsx(Icon, {
66
+ name: name,
67
+ width: iconSizeMap[size],
68
+ height: iconSizeMap[size],
69
+ color: COLOR[getIconColor()]
70
+ })]
71
+ }));
72
+ });
@@ -0,0 +1 @@
1
+ export * from './FeaturedIcon';
@@ -4,13 +4,20 @@ export * from './button';
4
4
  export * from './carousel';
5
5
  export * from './checkbox';
6
6
  export * from './date-picker';
7
- export * from './dropdown';
7
+ export * from './featured-icon';
8
+ export * from './divider';
9
+ export * from './empty-state';
8
10
  export * from './input';
11
+ export * from './modal';
12
+ export * from './notification';
9
13
  export * from './pagination';
14
+ export * from './progress-bar';
15
+ export * from './progress-circle';
10
16
  export * from './radio';
11
17
  export * from './select';
12
18
  export * from './shared';
13
19
  export * from './spinner';
20
+ export * from './tab';
14
21
  export * from './tag';
15
22
  export * from './toggle';
16
23
  export * from './tooltip';
@@ -42,8 +42,9 @@ export var InputBase = /*#__PURE__*/forwardRef(function (_a, ref) {
42
42
  destructive = _a.destructive,
43
43
  leadingElement = _a.leadingElement,
44
44
  trailingElement = _a.trailingElement,
45
- props = __rest(_a, ["size", "required", "label", "hintText", "disabled", "validation", "destructive", "leadingElement", "trailingElement"]);
46
- var renderOutsideSlot = function (slot, position) {
45
+ showHelpIcon = _a.showHelpIcon,
46
+ props = __rest(_a, ["size", "required", "label", "hintText", "disabled", "validation", "destructive", "leadingElement", "trailingElement", "showHelpIcon"]);
47
+ var renderOutsideSlot = function (slot) {
47
48
  if (slot.type === 'custom' && slot.placement !== 'outside') {
48
49
  return null;
49
50
  }
@@ -69,6 +70,7 @@ export var InputBase = /*#__PURE__*/forwardRef(function (_a, ref) {
69
70
  }
70
71
  };
71
72
  var renderInsideSlot = function (slot, position) {
73
+ var _a, _b;
72
74
  switch (slot.type) {
73
75
  case 'icon':
74
76
  return _jsx("div", __assign({
@@ -78,8 +80,8 @@ export var InputBase = /*#__PURE__*/forwardRef(function (_a, ref) {
78
80
  className: classNames("ncua-input__".concat(position, "-icon"), slot.className),
79
81
  name: slot.icon,
80
82
  color: slot.color ? COLOR[slot.color] : undefined,
81
- width: generalSvgSize[size],
82
- height: generalSvgSize[size]
83
+ width: (_a = slot.size) !== null && _a !== void 0 ? _a : generalSvgSize[size],
84
+ height: (_b = slot.size) !== null && _b !== void 0 ? _b : generalSvgSize[size]
83
85
  })
84
86
  }));
85
87
  case 'custom':
@@ -129,6 +131,22 @@ export var InputBase = /*#__PURE__*/forwardRef(function (_a, ref) {
129
131
  }
130
132
  return null;
131
133
  };
134
+ var renderLabel = function () {
135
+ if (!label) return null;
136
+ return _jsxs("div", __assign({
137
+ className: classNames('ncua-input__label', "ncua-input__label--".concat(size))
138
+ }, {
139
+ children: [_jsx(Label, __assign({
140
+ isRequired: required,
141
+ htmlFor: props.id
142
+ }, {
143
+ children: label
144
+ })), showHelpIcon && _jsx(Icon, {
145
+ className: "ncua-input__help-icon",
146
+ name: "help-circle"
147
+ })]
148
+ }));
149
+ };
132
150
  return _jsxs("div", __assign({
133
151
  className: classNames('ncua-input', "ncua-input--".concat(size), {
134
152
  destructive: destructive,
@@ -136,25 +154,20 @@ export var InputBase = /*#__PURE__*/forwardRef(function (_a, ref) {
136
154
  'ncua-input__trailing-button': (trailingElement === null || trailingElement === void 0 ? void 0 : trailingElement.type) === 'button'
137
155
  })
138
156
  }, {
139
- children: [label && _jsx(Label, __assign({
140
- isRequired: required,
141
- htmlFor: props.id,
142
- className: "ncua-input__label--".concat(size)
143
- }, {
144
- children: label
145
- })), _jsxs("div", __assign({
157
+ children: [renderLabel(), _jsxs("div", __assign({
146
158
  className: "ncua-input__content"
147
159
  }, {
148
- children: [leadingElement && renderOutsideSlot(leadingElement, 'left'), _jsxs("div", __assign({
149
- className: classNames('ncua-input__field', "ncua-input--".concat(size))
160
+ children: [leadingElement && renderOutsideSlot(leadingElement), _jsxs("div", __assign({
161
+ className: classNames('ncua-input__field', "ncua-input__field--".concat(size))
150
162
  }, {
151
163
  children: [leadingElement && renderInsideSlot(leadingElement, 'left'), _jsx("input", __assign({
152
164
  ref: ref,
153
165
  type: "text",
154
166
  disabled: disabled
155
167
  }, props)), trailingElement && renderInsideSlot(trailingElement, 'right'), renderClearButton(), renderStatusIcon()]
156
- })), trailingElement && renderOutsideSlot(trailingElement, 'right')]
168
+ })), trailingElement && renderOutsideSlot(trailingElement)]
157
169
  })), hintText && _jsx(HintText, __assign({
170
+ className: "ncua-input__hint-text",
158
171
  destructive: destructive
159
172
  }, {
160
173
  children: hintText
@@ -0,0 +1,185 @@
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, Fragment as _Fragment } from "react/jsx-runtime";
20
+ import classnames from 'classnames';
21
+ import { useEffect, useRef } from 'react';
22
+ import ReactDOM from 'react-dom';
23
+ import { FeaturedIcon } from '../featured-icon';
24
+ import Icon from '@ncds/ui-admin-icon';
25
+ export var Modal = function (_a) {
26
+ var isOpen = _a.isOpen,
27
+ onClose = _a.onClose,
28
+ children = _a.children,
29
+ _b = _a.size,
30
+ size = _b === void 0 ? 'md' : _b,
31
+ _c = _a.closeOnBackdropClick,
32
+ closeOnBackdropClick = _c === void 0 ? true : _c,
33
+ _d = _a.closeOnEsc,
34
+ closeOnEsc = _d === void 0 ? true : _d,
35
+ className = _a.className,
36
+ restProps = __rest(_a, ["isOpen", "onClose", "children", "size", "closeOnBackdropClick", "closeOnEsc", "className"]);
37
+ var modalRef = useRef(null);
38
+ var handleBackdropClick = function (e) {
39
+ if (closeOnBackdropClick && e.target === e.currentTarget) {
40
+ onClose();
41
+ }
42
+ };
43
+ useEffect(function () {
44
+ var handleKeyDown = function (e) {
45
+ if (isOpen && closeOnEsc && e.key === 'Escape') {
46
+ onClose();
47
+ }
48
+ };
49
+ if (isOpen) {
50
+ document.addEventListener('keydown', handleKeyDown);
51
+ document.body.style.overflow = 'hidden';
52
+ }
53
+ return function () {
54
+ document.removeEventListener('keydown', handleKeyDown);
55
+ document.body.style.overflow = '';
56
+ };
57
+ }, [isOpen, closeOnEsc, onClose]);
58
+ if (!isOpen) return null;
59
+ var modalContent = _jsx("div", __assign({
60
+ className: classnames('ncua-modal-backdrop', className),
61
+ onClick: handleBackdropClick,
62
+ ref: modalRef
63
+ }, restProps, {
64
+ children: _jsx("div", __assign({
65
+ className: classnames('ncua-modal', "ncua-modal--".concat(size))
66
+ }, {
67
+ children: children
68
+ }))
69
+ }));
70
+ return /*#__PURE__*/ReactDOM.createPortal(modalContent, document.body);
71
+ };
72
+ Modal.Header = function (_a) {
73
+ var children = _a.children,
74
+ onClose = _a.onClose,
75
+ featuredIcon = _a.featuredIcon,
76
+ title = _a.title,
77
+ subtitle = _a.subtitle,
78
+ _b = _a.align,
79
+ align = _b === void 0 ? 'left' : _b,
80
+ _c = _a.showDivider,
81
+ showDivider = _c === void 0 ? false : _c,
82
+ _d = _a.hideCloseButton,
83
+ hideCloseButton = _d === void 0 ? false : _d;
84
+ return _jsxs(_Fragment, {
85
+ children: [_jsxs("header", __assign({
86
+ className: classnames('ncua-modal__header', "ncua-modal__header--".concat(align))
87
+ }, {
88
+ children: [featuredIcon && _jsx(FeaturedIcon, {
89
+ name: featuredIcon.name,
90
+ color: featuredIcon.color,
91
+ theme: featuredIcon.theme
92
+ }), _jsxs("div", __assign({
93
+ className: "ncua-modal__title"
94
+ }, {
95
+ children: [_jsx("div", __assign({
96
+ className: "ncua-modal__title-text"
97
+ }, {
98
+ children: title
99
+ })), subtitle && _jsx("div", __assign({
100
+ className: "ncua-modal__title-subtitle"
101
+ }, {
102
+ children: subtitle
103
+ }))]
104
+ })), children, !hideCloseButton && _jsx("button", __assign({
105
+ className: "ncua-modal__close-button",
106
+ onClick: onClose
107
+ }, {
108
+ children: _jsx(Icon, {
109
+ name: "x"
110
+ })
111
+ }))]
112
+ })), showDivider && _jsx("div", {
113
+ className: "ncua-modal__header-divider"
114
+ })]
115
+ });
116
+ };
117
+ Modal.Content = function (_a) {
118
+ var children = _a.children;
119
+ return _jsx("div", __assign({
120
+ className: "ncua-modal__content"
121
+ }, {
122
+ children: children
123
+ }));
124
+ };
125
+ /**
126
+ * Modal.Actions - The actions area of the modal
127
+ *
128
+ * Examples:
129
+ *
130
+ * 1. Vertical layout (buttons stacked):
131
+ * <Modal.Actions layout="vertical" align="stretch">
132
+ * <Button label="Confirm" onClick={handleConfirm} hierarchy="primary" />
133
+ * <Button label="Cancel" onClick={handleCancel} hierarchy="secondary-gray" />
134
+ * </Modal.Actions>
135
+ *
136
+ * 2. Horizontal layout (buttons side by side):
137
+ * <Modal.Actions layout="horizontal" align="stretch">
138
+ * <Button label="Confirm" onClick={handleConfirm} hierarchy="primary" />
139
+ * <Button label="Cancel" onClick={handleCancel} hierarchy="secondary-gray" />
140
+ * </Modal.Actions>
141
+ *
142
+ * 3. Checkbox layout (checkbox on left, buttons on right):
143
+ * <Modal.Actions layout="checkbox" align="stretch" checkboxContent={
144
+ * <>
145
+ * <Checkbox text="Never show again" />
146
+ * <a href="#">Settings</a>
147
+ * </>
148
+ * }>
149
+ * <Button label="Cancel" onClick={handleCancel} hierarchy="secondary-gray" />
150
+ * <Button label="Confirm" onClick={handleConfirm} hierarchy="primary" />
151
+ * </Modal.Actions>
152
+ */
153
+ Modal.Actions = function (_a) {
154
+ var children = _a.children,
155
+ _b = _a.layout,
156
+ layout = _b === void 0 ? 'vertical' : _b,
157
+ _c = _a.showDivider,
158
+ showDivider = _c === void 0 ? false : _c,
159
+ _d = _a.align,
160
+ align = _d === void 0 ? 'stretch' : _d,
161
+ checkboxContent = _a.checkboxContent;
162
+ return _jsxs(_Fragment, {
163
+ children: [showDivider && _jsx("div", {
164
+ className: "ncua-modal__actions-divider"
165
+ }), _jsxs("div", __assign({
166
+ className: classnames('ncua-modal__actions-wrapper', {
167
+ 'ncua-modal__actions-wrapper--checkbox': layout === 'checkbox'
168
+ })
169
+ }, {
170
+ children: [layout === 'checkbox' && _jsx("div", __assign({
171
+ className: "ncua-modal__actions-checkbox"
172
+ }, {
173
+ children: _jsx("div", __assign({
174
+ className: "ncua-modal__actions-checkbox-content"
175
+ }, {
176
+ children: checkboxContent
177
+ }))
178
+ })), _jsx("div", __assign({
179
+ className: classnames('ncua-modal__actions', "ncua-modal__actions--".concat(layout), "ncua-modal__actions--".concat(align))
180
+ }, {
181
+ children: children
182
+ }))]
183
+ }))]
184
+ });
185
+ };
@@ -0,0 +1 @@
1
+ export { Modal } from './Modal';
@@ -0,0 +1,97 @@
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, jsxs as _jsxs } from "react/jsx-runtime";
20
+ import { FeaturedIcon } from '../featured-icon/FeaturedIcon';
21
+ import Icon from '@ncds/ui-admin-icon';
22
+ import classNames from 'classnames';
23
+ import { forwardRef } from 'react';
24
+ var iconNameMap = {
25
+ neutral: 'pin-02',
26
+ error: 'alert-triangle',
27
+ warning: 'alert-circle',
28
+ success: 'check-circle'
29
+ };
30
+ export var FloatingNotification = /*#__PURE__*/forwardRef(function (_a, ref) {
31
+ var title = _a.title,
32
+ supportingText = _a.supportingText,
33
+ _b = _a.variant,
34
+ variant = _b === void 0 ? 'neutral' : _b,
35
+ onClose = _a.onClose,
36
+ className = _a.className,
37
+ actions = _a.actions,
38
+ rest = __rest(_a, ["title", "supportingText", "variant", "onClose", "className", "actions"]);
39
+ var iconColor = variant;
40
+ var featuredIconProps = {
41
+ name: iconNameMap[variant],
42
+ size: 'sm',
43
+ color: iconColor,
44
+ theme: 'dark-circle'
45
+ };
46
+ return _jsxs("div", __assign({
47
+ ref: ref,
48
+ className: classNames('ncua-floating-notification', "ncua-floating-notification--".concat(variant), className),
49
+ role: "alert"
50
+ }, rest, {
51
+ children: [_jsx("div", __assign({
52
+ className: "ncua-floating-notification__content"
53
+ }, {
54
+ children: _jsxs("div", __assign({
55
+ className: "ncua-floating-notification__container"
56
+ }, {
57
+ children: [iconNameMap[variant] && _jsxs(_Fragment, {
58
+ children: [_jsx(FeaturedIcon, __assign({}, featuredIconProps, {
59
+ className: "ncua-floating-notification__pc-icon"
60
+ })), _jsx(FeaturedIcon, __assign({}, featuredIconProps, {
61
+ size: "md",
62
+ className: "ncua-floating-notification__mobile-icon"
63
+ }))]
64
+ }), _jsxs("div", __assign({
65
+ className: "ncua-floating-notification__text-container"
66
+ }, {
67
+ children: [_jsx("div", __assign({
68
+ className: "ncua-floating-notification__title-wrapper"
69
+ }, {
70
+ children: _jsx("span", __assign({
71
+ className: "ncua-floating-notification__title"
72
+ }, {
73
+ children: title
74
+ }))
75
+ })), supportingText && _jsx("span", __assign({
76
+ className: "ncua-floating-notification__supporting-text"
77
+ }, {
78
+ children: supportingText
79
+ })), actions && _jsx("div", __assign({
80
+ className: "ncua-floating-notification__actions"
81
+ }, {
82
+ children: actions
83
+ }))]
84
+ }))]
85
+ }))
86
+ })), onClose && _jsx("button", __assign({
87
+ type: "button",
88
+ className: "ncua-floating-notification__close-button",
89
+ onClick: onClose,
90
+ "aria-label": "\uC54C\uB9BC \uB2EB\uAE30"
91
+ }, {
92
+ children: _jsx(Icon, {
93
+ name: "x"
94
+ })
95
+ }))]
96
+ }));
97
+ });
@@ -0,0 +1,105 @@
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 Icon from '@ncds/ui-admin-icon';
21
+ import classNames from 'classnames';
22
+ import { forwardRef } from 'react';
23
+ import { COLOR } from '../../../constant/color';
24
+ var iconNameMap = {
25
+ neutral: 'message-chat-square',
26
+ error: 'alert-triangle',
27
+ warning: 'alert-triangle',
28
+ success: 'check-circle'
29
+ };
30
+ var iconColorMap = {
31
+ neutral: 'gray700',
32
+ error: 'red500',
33
+ warning: 'orange500',
34
+ success: 'green600'
35
+ };
36
+ export var FullWidthNotification = /*#__PURE__*/forwardRef(function (_a, ref) {
37
+ var title = _a.title,
38
+ supportingText = _a.supportingText,
39
+ _b = _a.variant,
40
+ variant = _b === void 0 ? 'neutral' : _b,
41
+ onClose = _a.onClose,
42
+ className = _a.className,
43
+ actions = _a.actions,
44
+ rest = __rest(_a, ["title", "supportingText", "variant", "onClose", "className", "actions"]);
45
+ var closeIconSize = {
46
+ width: 20,
47
+ height: 20
48
+ };
49
+ return _jsx("div", __assign({
50
+ ref: ref,
51
+ className: classNames('ncua-full-width-notification', "ncua-full-width-notification--".concat(variant), className),
52
+ role: "alert"
53
+ }, rest, {
54
+ children: _jsx("div", __assign({
55
+ className: "ncua-full-width-notification__container"
56
+ }, {
57
+ children: _jsxs("div", __assign({
58
+ className: "ncua-full-width-notification__content"
59
+ }, {
60
+ children: [_jsxs("div", __assign({
61
+ className: "ncua-full-width-notification__content-wrapper"
62
+ }, {
63
+ children: [_jsx(Icon, {
64
+ name: iconNameMap[variant],
65
+ width: 16,
66
+ height: 16,
67
+ color: COLOR[iconColorMap[variant]],
68
+ className: "ncua-full-width-notification__icon"
69
+ }), _jsxs("div", __assign({
70
+ className: "ncua-full-width-notification__text-container"
71
+ }, {
72
+ children: [_jsx("span", __assign({
73
+ className: "ncua-full-width-notification__title"
74
+ }, {
75
+ children: title
76
+ })), supportingText && _jsx("span", __assign({
77
+ className: "ncua-full-width-notification__supporting-text"
78
+ }, {
79
+ children: supportingText
80
+ }))]
81
+ }))]
82
+ })), _jsxs("div", __assign({
83
+ className: "ncua-full-width-notification__actions-container"
84
+ }, {
85
+ children: [actions && _jsx("div", __assign({
86
+ className: "ncua-full-width-notification__actions"
87
+ }, {
88
+ children: actions
89
+ })), onClose && _jsx("button", __assign({
90
+ type: "button",
91
+ className: "ncua-full-width-notification__close-button",
92
+ onClick: onClose,
93
+ "aria-label": "\uC54C\uB9BC \uB2EB\uAE30"
94
+ }, {
95
+ children: _jsx(Icon, __assign({
96
+ name: "x-close"
97
+ }, closeIconSize, {
98
+ color: COLOR[iconColorMap[variant]]
99
+ }))
100
+ }))]
101
+ }))]
102
+ }))
103
+ }))
104
+ }));
105
+ });