@ncds/ui-admin 0.0.31 → 0.0.33

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 (51) hide show
  1. package/dist/cjs/constant/color.js +1 -0
  2. package/dist/cjs/src/components/badge/Badge.js +13 -24
  3. package/dist/cjs/src/components/badge/BadgeGroup.js +62 -0
  4. package/dist/cjs/src/components/badge/index.js +11 -0
  5. package/dist/cjs/src/components/badge/utils.js +33 -0
  6. package/dist/cjs/src/components/button/ButtonCloseX.js +44 -0
  7. package/dist/cjs/src/components/date-picker/DatePicker.js +4 -5
  8. package/dist/cjs/src/components/date-picker/RangeDatePicker.js +13 -7
  9. package/dist/cjs/src/components/dropdown/Dropdown.js +20 -10
  10. package/dist/cjs/src/components/modal/Modal.js +5 -7
  11. package/dist/cjs/src/components/notification/FloatingNotification.js +30 -26
  12. package/dist/cjs/src/components/notification/FullWidthNotification.js +15 -8
  13. package/dist/cjs/src/components/notification/Notification.js +9 -30
  14. package/dist/cjs/src/components/notification/index.js +11 -11
  15. package/dist/cjs/src/constant/breakpoint.js +12 -0
  16. package/dist/cjs/src/hooks/useMediaQuery.js +29 -0
  17. package/dist/esm/constant/color.js +1 -0
  18. package/dist/esm/src/components/badge/Badge.js +13 -24
  19. package/dist/esm/src/components/badge/BadgeGroup.js +54 -0
  20. package/dist/esm/src/components/badge/index.js +2 -1
  21. package/dist/esm/src/components/badge/utils.js +25 -0
  22. package/dist/esm/src/components/button/ButtonCloseX.js +36 -0
  23. package/dist/esm/src/components/date-picker/DatePicker.js +5 -5
  24. package/dist/esm/src/components/date-picker/RangeDatePicker.js +14 -7
  25. package/dist/esm/src/components/dropdown/Dropdown.js +20 -10
  26. package/dist/esm/src/components/modal/Modal.js +5 -7
  27. package/dist/esm/src/components/notification/FloatingNotification.js +31 -27
  28. package/dist/esm/src/components/notification/FullWidthNotification.js +15 -8
  29. package/dist/esm/src/components/notification/Notification.js +10 -30
  30. package/dist/esm/src/components/notification/index.js +2 -2
  31. package/dist/esm/src/constant/breakpoint.js +6 -0
  32. package/dist/esm/src/hooks/useMediaQuery.js +22 -0
  33. package/dist/types/constant/color.d.ts +1 -0
  34. package/dist/types/src/components/badge/BadgeGroup.d.ts +17 -0
  35. package/dist/types/src/components/badge/index.d.ts +1 -0
  36. package/dist/types/src/components/badge/utils.d.ts +7 -0
  37. package/dist/types/src/components/button/Button.d.ts +1 -1
  38. package/dist/types/src/components/button/ButtonCloseX.d.ts +9 -0
  39. package/dist/types/src/components/button/ButtonGroup.d.ts +2 -2
  40. package/dist/types/src/components/date-picker/DatePicker.d.ts +2 -2
  41. package/dist/types/src/components/date-picker/RangeDatePicker.d.ts +1 -1
  42. package/dist/types/src/components/dropdown/Dropdown.d.ts +4 -1
  43. package/dist/types/src/components/modal/Modal.d.ts +1 -1
  44. package/dist/types/src/components/notification/FloatingNotification.d.ts +3 -4
  45. package/dist/types/src/components/notification/FullWidthNotification.d.ts +3 -4
  46. package/dist/types/src/components/notification/Notification.d.ts +5 -4
  47. package/dist/types/src/components/notification/index.d.ts +1 -1
  48. package/dist/types/src/constant/breakpoint.d.ts +7 -0
  49. package/dist/types/src/hooks/useMediaQuery.d.ts +6 -0
  50. package/dist/ui-admin/assets/styles/style.css +171 -136
  51. package/package.json +2 -2
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.COLOR = void 0;
7
7
  var COLOR = exports.COLOR = {
8
+ gray100: '#EAECF0',
8
9
  gray200: '#D0D5DD',
9
10
  gray300: '#98A2B3',
10
11
  gray400: '#667085',
@@ -5,11 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Badge = void 0;
7
7
  var _jsxRuntime = require("react/jsx-runtime");
8
- var _uiAdminIcon = _interopRequireDefault(require("@ncds/ui-admin-icon"));
9
- var _button = require("../button");
10
8
  var _classnames = _interopRequireDefault(require("classnames"));
11
- var _color = require("../../../constant/color");
12
- var _dot = require("../dot");
9
+ var _utils = require("./utils");
13
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
11
  var __assign = void 0 && (void 0).__assign || function () {
15
12
  __assign = Object.assign || function (t) {
@@ -21,6 +18,10 @@ var __assign = void 0 && (void 0).__assign || function () {
21
18
  };
22
19
  return __assign.apply(this, arguments);
23
20
  };
21
+ /**
22
+ * 뱃지 컴포넌트의 아이콘은 디자인 시스템에서 12px 고정으로 정의되어 있습니다.
23
+ */
24
+ var BADGE_ICON_SIZE = 12;
24
25
  var Badge = function (_a) {
25
26
  var label = _a.label,
26
27
  _b = _a.type,
@@ -32,32 +33,20 @@ var Badge = function (_a) {
32
33
  trailingIcon = _a.trailingIcon,
33
34
  _d = _a.size,
34
35
  size = _d === void 0 ? 'sm' : _d;
35
- var sideSlotRender = function (slot) {
36
- var _a, _b, _c, _d;
37
- if (slot.type === 'icon') {
38
- return (0, _jsxRuntime.jsx)(_uiAdminIcon.default, {
39
- name: slot.icon,
40
- height: (_a = slot.size) !== null && _a !== void 0 ? _a : _button.svgSize[size],
41
- width: (_b = slot.size) !== null && _b !== void 0 ? _b : _button.svgSize[size],
42
- color: slot.color ? _color.COLOR[slot.color] : undefined
43
- });
44
- }
45
- if (slot.type === 'dot') {
46
- return (0, _jsxRuntime.jsx)(_dot.Dot, {
47
- color: (_c = slot.color) !== null && _c !== void 0 ? _c : color,
48
- size: (_d = slot.size) !== null && _d !== void 0 ? _d : 'sm'
49
- });
50
- }
51
- return slot.children;
52
- };
53
36
  return (0, _jsxRuntime.jsxs)("span", __assign({
54
37
  className: (0, _classnames.default)('ncua-badge', "ncua-badge--".concat(type), "ncua-badge--".concat(color), "ncua-badge--".concat(size), className)
55
38
  }, {
56
- children: [leadingIcon && sideSlotRender(leadingIcon), (0, _jsxRuntime.jsx)("span", __assign({
39
+ children: [leadingIcon && (0, _utils.sideSlotRender)({
40
+ slot: leadingIcon,
41
+ defaultIconSize: BADGE_ICON_SIZE
42
+ }), (0, _jsxRuntime.jsx)("span", __assign({
57
43
  className: "ncua-badge__label"
58
44
  }, {
59
45
  children: label
60
- })), trailingIcon && sideSlotRender(trailingIcon)]
46
+ })), trailingIcon && (0, _utils.sideSlotRender)({
47
+ slot: trailingIcon,
48
+ defaultIconSize: BADGE_ICON_SIZE
49
+ })]
61
50
  }));
62
51
  };
63
52
  exports.Badge = Badge;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.BadgeGroup = void 0;
7
+ var _jsxRuntime = require("react/jsx-runtime");
8
+ var _classnames = _interopRequireDefault(require("classnames"));
9
+ var _ = require(".");
10
+ var _utils = require("./utils");
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ var __assign = void 0 && (void 0).__assign || function () {
13
+ __assign = Object.assign || function (t) {
14
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
15
+ s = arguments[i];
16
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
17
+ }
18
+ return t;
19
+ };
20
+ return __assign.apply(this, arguments);
21
+ };
22
+ var __rest = void 0 && (void 0).__rest || function (s, e) {
23
+ var t = {};
24
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
25
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
26
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
27
+ }
28
+ return t;
29
+ };
30
+ var DEFAULT_GROUP_ICON_SIZE = 14;
31
+ var BadgeGroup = function (_a) {
32
+ var groupLabel = _a.groupLabel,
33
+ groupIcon = _a.groupIcon,
34
+ groupClassName = _a.groupClassName,
35
+ _b = _a.color,
36
+ color = _b === void 0 ? 'neutral' : _b,
37
+ _c = _a.size,
38
+ size = _c === void 0 ? 'sm' : _c,
39
+ href = _a.href,
40
+ _d = _a.target,
41
+ target = _d === void 0 ? '_blank' : _d,
42
+ props = __rest(_a, ["groupLabel", "groupIcon", "groupClassName", "color", "size", "href", "target"]);
43
+ return (0, _jsxRuntime.jsxs)("a", __assign({
44
+ className: (0, _classnames.default)('ncua-badge-group', "ncua-badge-group--".concat(color), "ncua-badge-group--".concat(size), groupClassName),
45
+ href: href,
46
+ target: target
47
+ }, {
48
+ children: [(0, _jsxRuntime.jsx)(_.Badge, __assign({
49
+ type: "pill-dark-color",
50
+ color: color,
51
+ size: size
52
+ }, props)), (0, _jsxRuntime.jsx)("span", __assign({
53
+ className: "ncua-badge-group__label"
54
+ }, {
55
+ children: groupLabel
56
+ })), groupIcon && (0, _utils.sideSlotRender)({
57
+ slot: groupIcon,
58
+ defaultIconSize: DEFAULT_GROUP_ICON_SIZE
59
+ })]
60
+ }));
61
+ };
62
+ exports.BadgeGroup = BadgeGroup;
@@ -13,4 +13,15 @@ Object.keys(_Badge).forEach(function (key) {
13
13
  return _Badge[key];
14
14
  }
15
15
  });
16
+ });
17
+ var _BadgeGroup = require("./BadgeGroup");
18
+ Object.keys(_BadgeGroup).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _BadgeGroup[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _BadgeGroup[key];
25
+ }
26
+ });
16
27
  });
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.sideSlotRender = void 0;
7
+ var _jsxRuntime = require("react/jsx-runtime");
8
+ var _uiAdminIcon = _interopRequireDefault(require("@ncds/ui-admin-icon"));
9
+ var _color = require("../../../constant/color");
10
+ var _Dot = require("../dot/Dot");
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ var DEFAULT_DOT_COLOR = 'neutral';
13
+ var sideSlotRender = function (_a) {
14
+ var _b, _c, _d, _e;
15
+ var slot = _a.slot,
16
+ defaultIconSize = _a.defaultIconSize;
17
+ if (slot.type === 'icon') {
18
+ return (0, _jsxRuntime.jsx)(_uiAdminIcon.default, {
19
+ name: slot.icon,
20
+ height: (_b = slot.size) !== null && _b !== void 0 ? _b : defaultIconSize,
21
+ width: (_c = slot.size) !== null && _c !== void 0 ? _c : defaultIconSize,
22
+ color: slot.color ? _color.COLOR[slot.color] : undefined
23
+ });
24
+ }
25
+ if (slot.type === 'dot') {
26
+ return (0, _jsxRuntime.jsx)(_Dot.Dot, {
27
+ color: (_d = slot.color) !== null && _d !== void 0 ? _d : DEFAULT_DOT_COLOR,
28
+ size: (_e = slot.size) !== null && _e !== void 0 ? _e : 'sm'
29
+ });
30
+ }
31
+ return slot.children;
32
+ };
33
+ exports.sideSlotRender = sideSlotRender;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ButtonCloseX = void 0;
7
+ var _jsxRuntime = require("react/jsx-runtime");
8
+ var _uiAdminIcon = _interopRequireDefault(require("@ncds/ui-admin-icon"));
9
+ var _classnames = _interopRequireDefault(require("classnames"));
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ var __assign = void 0 && (void 0).__assign || function () {
12
+ __assign = Object.assign || function (t) {
13
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
14
+ s = arguments[i];
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
16
+ }
17
+ return t;
18
+ };
19
+ return __assign.apply(this, arguments);
20
+ };
21
+ var svgSize = {
22
+ xs: 16,
23
+ sm: 20,
24
+ md: 20,
25
+ lg: 24
26
+ };
27
+ var ButtonCloseX = function (_a) {
28
+ var size = _a.size,
29
+ _b = _a.theme,
30
+ theme = _b === void 0 ? 'light' : _b,
31
+ className = _a.className,
32
+ onClick = _a.onClick;
33
+ return (0, _jsxRuntime.jsx)("button", __assign({
34
+ className: (0, _classnames.default)('ncua-button-close-x', "ncua-button-close-x--".concat(size), "ncua-button-close-x--".concat(theme), className),
35
+ onClick: onClick
36
+ }, {
37
+ children: (0, _jsxRuntime.jsx)(_uiAdminIcon.default, {
38
+ name: "x-close",
39
+ width: svgSize[size],
40
+ height: svgSize[size]
41
+ })
42
+ }));
43
+ };
44
+ exports.ButtonCloseX = ButtonCloseX;
@@ -30,7 +30,7 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
30
30
  }
31
31
  return t;
32
32
  };
33
- var DatePicker = function (_a) {
33
+ var DatePicker = exports.DatePicker = /*#__PURE__*/(0, _react.forwardRef)(function (_a, ref) {
34
34
  var _b = _a.shouldFocus,
35
35
  shouldFocus = _b === void 0 ? true : _b,
36
36
  currentDate = _a.currentDate,
@@ -39,7 +39,6 @@ var DatePicker = function (_a) {
39
39
  onChangeDate = _a.onChangeDate,
40
40
  datePickerOptions = _a.datePickerOptions,
41
41
  attrs = __rest(_a, ["shouldFocus", "currentDate", "size", "onChangeDate", "datePickerOptions"]);
42
- var ref = (0, _react.useRef)(null);
43
42
  var onChangeDateHandler = function (dateTimeStamp, dateStr) {
44
43
  return onChangeDate(dateStr);
45
44
  };
@@ -59,7 +58,7 @@ var DatePicker = function (_a) {
59
58
  })
60
59
  }, {
61
60
  children: [(0, _jsxRuntime.jsx)(_reactFlatpickr.default, __assign({}, attrs, {
62
- ref: ref,
61
+ ref: ref || undefined,
63
62
  className: (0, _classnames.default)('ncua-date-picker__input'),
64
63
  options: options,
65
64
  value: currentDate
@@ -83,5 +82,5 @@ var DatePicker = function (_a) {
83
82
  }))
84
83
  }))]
85
84
  }));
86
- };
87
- exports.DatePicker = DatePicker;
85
+ });
86
+ DatePicker.displayName = 'DatePicker';
@@ -21,7 +21,7 @@ var __assign = void 0 && (void 0).__assign || function () {
21
21
  };
22
22
  return __assign.apply(this, arguments);
23
23
  };
24
- var RangeDatePicker = function (_a) {
24
+ var RangeDatePicker = exports.RangeDatePicker = /*#__PURE__*/(0, _react.forwardRef)(function (_a, ref) {
25
25
  var startDateOptions = _a.startDateOptions,
26
26
  endDateOptions = _a.endDateOptions,
27
27
  validationOption = _a.validationOption,
@@ -45,6 +45,7 @@ var RangeDatePicker = function (_a) {
45
45
  if (isOverPeriod === void 0) {
46
46
  isOverPeriod = false;
47
47
  }
48
+ if (!(validationOption === null || validationOption === void 0 ? void 0 : validationOption.setting)) return;
48
49
  var _a = validationOption.setting,
49
50
  unit = _a.unit,
50
51
  period = _a.period;
@@ -85,7 +86,7 @@ var RangeDatePicker = function (_a) {
85
86
  if (!isValidPeriod) {
86
87
  changeSettingDateAndAlert('start', !isValidPeriod);
87
88
  }
88
- }, [startDateOptions.currentDate]);
89
+ }, [startDateOptions.currentDate, endDateOptions.currentDate, validationOption, resetDateAndAlert, changeSettingDateAndAlert]);
89
90
  (0, _react.useEffect)(function () {
90
91
  var _a;
91
92
  var needResetDate = validateDateType(endDateOptions.currentDate) && !(0, _lodash.isNil)((_a = validationOption === null || validationOption === void 0 ? void 0 : validationOption.initDate) === null || _a === void 0 ? void 0 : _a.endDate) && (0, _moment.default)(endDateOptions.currentDate).isBefore(startDateOptions.currentDate);
@@ -108,11 +109,16 @@ var RangeDatePicker = function (_a) {
108
109
  if (!isValidPeriod) {
109
110
  changeSettingDateAndAlert('end', !isValidPeriod);
110
111
  }
111
- }, [endDateOptions.currentDate]);
112
+ }, [endDateOptions.currentDate, startDateOptions.currentDate, validationOption, resetDateAndAlert, changeSettingDateAndAlert]);
112
113
  return (0, _jsxRuntime.jsxs)("div", __assign({
113
- className: "ncua-range-date-picker"
114
+ className: "ncua-range-date-picker",
115
+ ref: ref || undefined
114
116
  }, {
115
- children: [(0, _jsxRuntime.jsx)(_DatePicker.DatePicker, __assign({}, startDateOptions)), "-", (0, _jsxRuntime.jsx)(_DatePicker.DatePicker, __assign({}, endDateOptions))]
117
+ children: [(0, _jsxRuntime.jsx)(_DatePicker.DatePicker, __assign({}, startDateOptions, {
118
+ ref: undefined
119
+ })), "-", (0, _jsxRuntime.jsx)(_DatePicker.DatePicker, __assign({}, endDateOptions, {
120
+ ref: undefined
121
+ }))]
116
122
  }));
117
- };
118
- exports.RangeDatePicker = RangeDatePicker;
123
+ });
124
+ RangeDatePicker.displayName = 'RangeDatePicker';
@@ -24,10 +24,16 @@ var Dropdown = function (_a) {
24
24
  align = _b === void 0 ? 'left' : _b,
25
25
  header = _a.header,
26
26
  groups = _a.groups,
27
- className = _a.className;
28
- var _c = (0, _react.useState)(false),
29
- isOpen = _c[0],
30
- setIsOpen = _c[1];
27
+ className = _a.className,
28
+ _c = _a.opened,
29
+ opened = _c === void 0 ? false : _c,
30
+ _d = _a.closeOnClickItem,
31
+ closeOnClickItem = _d === void 0 ? true : _d,
32
+ _e = _a.closeOnClickOutside,
33
+ closeOnClickOutside = _e === void 0 ? true : _e;
34
+ var _f = (0, _react.useState)(opened),
35
+ isOpen = _f[0],
36
+ setIsOpen = _f[1];
31
37
  var dropdownRef = (0, _react.useRef)(null);
32
38
  var toggleDropdown = function () {
33
39
  setIsOpen(!isOpen);
@@ -40,15 +46,19 @@ var Dropdown = function (_a) {
40
46
  var handleClickItem = function (item) {
41
47
  if (!item.disabled && item.onClick) {
42
48
  item.onClick();
43
- setIsOpen(false);
49
+ if (closeOnClickItem) {
50
+ setIsOpen(false);
51
+ }
44
52
  }
45
53
  };
46
54
  (0, _react.useEffect)(function () {
47
- document.addEventListener('mousedown', handleClickOutside);
48
- return function () {
49
- document.removeEventListener('mousedown', handleClickOutside);
50
- };
51
- }, []);
55
+ if (closeOnClickOutside) {
56
+ document.addEventListener('mousedown', handleClickOutside);
57
+ return function () {
58
+ document.removeEventListener('mousedown', handleClickOutside);
59
+ };
60
+ }
61
+ }, [closeOnClickOutside]);
52
62
  var renderTrigger = function () {
53
63
  switch (trigger.type) {
54
64
  case 'custom':
@@ -8,8 +8,8 @@ var _jsxRuntime = require("react/jsx-runtime");
8
8
  var _classnames = _interopRequireDefault(require("classnames"));
9
9
  var _react = require("react");
10
10
  var _reactDom = _interopRequireDefault(require("react-dom"));
11
+ var _ButtonCloseX = require("../button/ButtonCloseX");
11
12
  var _featuredIcon = require("../featured-icon");
12
- var _uiAdminIcon = _interopRequireDefault(require("@ncds/ui-admin-icon"));
13
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
14
  var __assign = void 0 && (void 0).__assign || function () {
15
15
  __assign = Object.assign || function (t) {
@@ -112,14 +112,12 @@ Modal.Header = function (_a) {
112
112
  }, {
113
113
  children: subtitle
114
114
  }))]
115
- })), children, !hideCloseButton && (0, _jsxRuntime.jsx)("button", __assign({
115
+ })), children, !hideCloseButton && (0, _jsxRuntime.jsx)(_ButtonCloseX.ButtonCloseX, {
116
116
  className: "ncua-modal__close-button",
117
+ size: "sm",
118
+ theme: "light",
117
119
  onClick: onClose
118
- }, {
119
- children: (0, _jsxRuntime.jsx)(_uiAdminIcon.default, {
120
- name: "x"
121
- })
122
- }))]
120
+ })]
123
121
  })), showDivider && (0, _jsxRuntime.jsx)("div", {
124
122
  className: "ncua-modal__header-divider"
125
123
  })]
@@ -5,10 +5,13 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.FloatingNotification = void 0;
7
7
  var _jsxRuntime = require("react/jsx-runtime");
8
- var _FeaturedIcon = require("../featured-icon/FeaturedIcon");
9
- var _uiAdminIcon = _interopRequireDefault(require("@ncds/ui-admin-icon"));
10
8
  var _classnames = _interopRequireDefault(require("classnames"));
11
9
  var _react = require("react");
10
+ var _breakpoint = require("../../constant/breakpoint");
11
+ var _useMediaQuery = require("../../hooks/useMediaQuery");
12
+ var _button = require("../button");
13
+ var _ButtonCloseX = require("../button/ButtonCloseX");
14
+ var _FeaturedIcon = require("../featured-icon/FeaturedIcon");
12
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
16
  var __assign = void 0 && (void 0).__assign || function () {
14
17
  __assign = Object.assign || function (t) {
@@ -37,22 +40,25 @@ var iconNameMap = {
37
40
  var FloatingNotification = exports.FloatingNotification = /*#__PURE__*/(0, _react.forwardRef)(function (_a, ref) {
38
41
  var title = _a.title,
39
42
  supportingText = _a.supportingText,
40
- _b = _a.variant,
41
- variant = _b === void 0 ? 'neutral' : _b,
43
+ _b = _a.color,
44
+ color = _b === void 0 ? 'neutral' : _b,
42
45
  onClose = _a.onClose,
43
46
  className = _a.className,
44
47
  actions = _a.actions,
45
- rest = __rest(_a, ["title", "supportingText", "variant", "onClose", "className", "actions"]);
46
- var iconColor = variant;
48
+ rest = __rest(_a, ["title", "supportingText", "color", "onClose", "className", "actions"]);
49
+ var iconColor = color;
47
50
  var featuredIconProps = {
48
- name: iconNameMap[variant],
51
+ name: iconNameMap[color],
49
52
  size: 'sm',
50
53
  color: iconColor,
51
54
  theme: 'dark-circle'
52
55
  };
56
+ var isMobile = (0, _useMediaQuery.useMediaQuery)(_breakpoint.MEDIA_QUERY.mobile, {
57
+ onMatched: onClose
58
+ });
53
59
  return (0, _jsxRuntime.jsxs)("div", __assign({
54
60
  ref: ref,
55
- className: (0, _classnames.default)('ncua-floating-notification', "ncua-floating-notification--".concat(variant), className),
61
+ className: (0, _classnames.default)('ncua-floating-notification', "ncua-floating-notification--".concat(color), className),
56
62
  role: "alert"
57
63
  }, rest, {
58
64
  children: [(0, _jsxRuntime.jsx)("div", __assign({
@@ -61,14 +67,9 @@ var FloatingNotification = exports.FloatingNotification = /*#__PURE__*/(0, _reac
61
67
  children: (0, _jsxRuntime.jsxs)("div", __assign({
62
68
  className: "ncua-floating-notification__container"
63
69
  }, {
64
- children: [iconNameMap[variant] && (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
65
- children: [(0, _jsxRuntime.jsx)(_FeaturedIcon.FeaturedIcon, __assign({}, featuredIconProps, {
66
- className: "ncua-floating-notification__pc-icon"
67
- })), (0, _jsxRuntime.jsx)(_FeaturedIcon.FeaturedIcon, __assign({}, featuredIconProps, {
68
- size: "md",
69
- className: "ncua-floating-notification__mobile-icon"
70
- }))]
71
- }), (0, _jsxRuntime.jsxs)("div", __assign({
70
+ children: [iconNameMap[color] && (0, _jsxRuntime.jsx)(_FeaturedIcon.FeaturedIcon, __assign({}, featuredIconProps, {
71
+ size: isMobile ? 'md' : 'sm'
72
+ })), (0, _jsxRuntime.jsxs)("div", __assign({
72
73
  className: "ncua-floating-notification__text-container"
73
74
  }, {
74
75
  children: [(0, _jsxRuntime.jsx)("div", __assign({
@@ -86,19 +87,22 @@ var FloatingNotification = exports.FloatingNotification = /*#__PURE__*/(0, _reac
86
87
  })), actions && (0, _jsxRuntime.jsx)("div", __assign({
87
88
  className: "ncua-floating-notification__actions"
88
89
  }, {
89
- children: actions
90
+ children: actions.map(function (action) {
91
+ return (0, _jsxRuntime.jsx)(_button.Button, {
92
+ size: "xs",
93
+ hierarchy: action.hierarchy || 'link',
94
+ label: action.label,
95
+ onClick: action === null || action === void 0 ? void 0 : action.onClick
96
+ }, "".concat(action.label, "-").concat(action.hierarchy));
97
+ })
90
98
  }))]
91
99
  }))]
92
100
  }))
93
- })), onClose && (0, _jsxRuntime.jsx)("button", __assign({
94
- type: "button",
101
+ })), onClose && (0, _jsxRuntime.jsx)(_ButtonCloseX.ButtonCloseX, {
102
+ theme: "light",
95
103
  className: "ncua-floating-notification__close-button",
96
- onClick: onClose,
97
- "aria-label": "\uC54C\uB9BC \uB2EB\uAE30"
98
- }, {
99
- children: (0, _jsxRuntime.jsx)(_uiAdminIcon.default, {
100
- name: "x"
101
- })
102
- }))]
104
+ size: isMobile ? 'sm' : 'xs',
105
+ onClick: onClose
106
+ })]
103
107
  }));
104
108
  });
@@ -43,19 +43,19 @@ var iconColorMap = {
43
43
  var FullWidthNotification = exports.FullWidthNotification = /*#__PURE__*/(0, _react.forwardRef)(function (_a, ref) {
44
44
  var title = _a.title,
45
45
  supportingText = _a.supportingText,
46
- _b = _a.variant,
47
- variant = _b === void 0 ? 'neutral' : _b,
46
+ _b = _a.color,
47
+ color = _b === void 0 ? 'neutral' : _b,
48
48
  onClose = _a.onClose,
49
49
  className = _a.className,
50
50
  actions = _a.actions,
51
- rest = __rest(_a, ["title", "supportingText", "variant", "onClose", "className", "actions"]);
51
+ rest = __rest(_a, ["title", "supportingText", "color", "onClose", "className", "actions"]);
52
52
  var closeIconSize = {
53
53
  width: 20,
54
54
  height: 20
55
55
  };
56
56
  return (0, _jsxRuntime.jsx)("div", __assign({
57
57
  ref: ref,
58
- className: (0, _classnames.default)('ncua-full-width-notification', "ncua-full-width-notification--".concat(variant), className),
58
+ className: (0, _classnames.default)('ncua-full-width-notification', "ncua-full-width-notification--".concat(color), className),
59
59
  role: "alert"
60
60
  }, rest, {
61
61
  children: (0, _jsxRuntime.jsx)("div", __assign({
@@ -68,10 +68,10 @@ var FullWidthNotification = exports.FullWidthNotification = /*#__PURE__*/(0, _re
68
68
  className: "ncua-full-width-notification__content-wrapper"
69
69
  }, {
70
70
  children: [(0, _jsxRuntime.jsx)(_uiAdminIcon.default, {
71
- name: iconNameMap[variant],
71
+ name: iconNameMap[color],
72
72
  width: 16,
73
73
  height: 16,
74
- color: _color.COLOR[iconColorMap[variant]],
74
+ color: _color.COLOR[iconColorMap[color]],
75
75
  className: "ncua-full-width-notification__icon"
76
76
  }), (0, _jsxRuntime.jsxs)("div", __assign({
77
77
  className: "ncua-full-width-notification__text-container"
@@ -92,7 +92,14 @@ var FullWidthNotification = exports.FullWidthNotification = /*#__PURE__*/(0, _re
92
92
  children: [actions && (0, _jsxRuntime.jsx)("div", __assign({
93
93
  className: "ncua-full-width-notification__actions"
94
94
  }, {
95
- children: actions
95
+ children: actions.map(function (action) {
96
+ return (0, _jsxRuntime.jsx)("button", __assign({
97
+ onClick: action.onClick,
98
+ className: (0, _classnames.default)('ncua-notification__action-button', "ncua-notification__action-button--".concat(action.hierarchy || 'link'))
99
+ }, {
100
+ children: action.label
101
+ }), "".concat(action.label, "-").concat(action.hierarchy));
102
+ })
96
103
  })), onClose && (0, _jsxRuntime.jsx)("button", __assign({
97
104
  type: "button",
98
105
  className: "ncua-full-width-notification__close-button",
@@ -102,7 +109,7 @@ var FullWidthNotification = exports.FullWidthNotification = /*#__PURE__*/(0, _re
102
109
  children: (0, _jsxRuntime.jsx)(_uiAdminIcon.default, __assign({
103
110
  name: "x-close"
104
111
  }, closeIconSize, {
105
- color: _color.COLOR[iconColorMap[variant]]
112
+ color: _color.COLOR[iconColorMap[color]]
106
113
  }))
107
114
  }))]
108
115
  }))]
@@ -6,10 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.Notification = void 0;
7
7
  var _jsxRuntime = require("react/jsx-runtime");
8
8
  var _react = require("react");
9
- var _classnames = _interopRequireDefault(require("classnames"));
10
9
  var _FloatingNotification = require("./FloatingNotification");
11
10
  var _FullWidthNotification = require("./FullWidthNotification");
12
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
11
  var __assign = void 0 && (void 0).__assign || function () {
14
12
  __assign = Object.assign || function (t) {
15
13
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -31,35 +29,16 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
31
29
  var Notification = exports.Notification = /*#__PURE__*/(0, _react.forwardRef)(function (_a, ref) {
32
30
  var _b = _a.type,
33
31
  type = _b === void 0 ? 'floating' : _b,
34
- title = _a.title,
35
- supportingText = _a.supportingText,
36
- _c = _a.variant,
37
- variant = _c === void 0 ? 'neutral' : _c,
38
- onClose = _a.onClose,
39
- className = _a.className,
40
- actions = _a.actions,
41
- rest = __rest(_a, ["type", "title", "supportingText", "variant", "onClose", "className", "actions"]);
42
- var actionsContent = actions && actions.length > 0 ? (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
43
- children: actions.map(function (action, index) {
44
- return (0, _jsxRuntime.jsx)("button", __assign({
45
- onClick: action.onClick,
46
- className: (0, _classnames.default)('ncua-notification__action-button', "ncua-notification__action-button--".concat(action.hierarchy || 'link-gray'))
47
- }, {
48
- children: action.label
49
- }), index);
50
- })
51
- }) : null;
52
- var sharedProps = __assign({
53
- title: title,
54
- supportingText: supportingText,
55
- variant: variant,
56
- onClose: onClose,
57
- className: className,
58
- actions: actionsContent
59
- }, rest);
60
- return type === 'floating' ? (0, _jsxRuntime.jsx)(_FloatingNotification.FloatingNotification, __assign({}, sharedProps, {
32
+ _c = _a.color,
33
+ color = _c === void 0 ? 'neutral' : _c,
34
+ rest = __rest(_a, ["type", "color"]);
35
+ return type === 'floating' ? (0, _jsxRuntime.jsx)(_FloatingNotification.FloatingNotification, __assign({
36
+ color: color
37
+ }, rest, {
61
38
  ref: ref
62
- })) : (0, _jsxRuntime.jsx)(_FullWidthNotification.FullWidthNotification, __assign({}, sharedProps, {
39
+ })) : (0, _jsxRuntime.jsx)(_FullWidthNotification.FullWidthNotification, __assign({
40
+ color: color
41
+ }, rest, {
63
42
  ref: ref
64
43
  }));
65
44
  });
@@ -3,6 +3,17 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ var _Notification = require("./Notification");
7
+ Object.keys(_Notification).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _Notification[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _Notification[key];
14
+ }
15
+ });
16
+ });
6
17
  var _FloatingNotification = require("./FloatingNotification");
7
18
  Object.keys(_FloatingNotification).forEach(function (key) {
8
19
  if (key === "default" || key === "__esModule") return;
@@ -24,15 +35,4 @@ Object.keys(_FullWidthNotification).forEach(function (key) {
24
35
  return _FullWidthNotification[key];
25
36
  }
26
37
  });
27
- });
28
- var _Notification = require("./Notification");
29
- Object.keys(_Notification).forEach(function (key) {
30
- if (key === "default" || key === "__esModule") return;
31
- if (key in exports && exports[key] === _Notification[key]) return;
32
- Object.defineProperty(exports, key, {
33
- enumerable: true,
34
- get: function () {
35
- return _Notification[key];
36
- }
37
- });
38
38
  });
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.MEDIA_QUERY = exports.BREAKPOINT = void 0;
7
+ var BREAKPOINT = exports.BREAKPOINT = {
8
+ mobile: '768px'
9
+ };
10
+ var MEDIA_QUERY = exports.MEDIA_QUERY = {
11
+ mobile: "(max-width: ".concat(BREAKPOINT.mobile, ")")
12
+ };