@ncds/ui-admin 1.8.4 → 1.8.6
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.
- package/dist/cjs/assets/scripts/featuredIcon.js +87 -0
- package/dist/cjs/assets/scripts/notification/FloatingNotification.js +178 -0
- package/dist/cjs/assets/scripts/notification/FullWidthNotification.js +133 -0
- package/dist/cjs/assets/scripts/notification/MessageNotification.js +159 -0
- package/dist/cjs/assets/scripts/notification/Notification.js +120 -0
- package/dist/cjs/assets/scripts/notification/const/classNames.js +50 -0
- package/dist/cjs/assets/scripts/notification/const/icons.js +31 -0
- package/dist/cjs/assets/scripts/notification/const/index.js +87 -0
- package/dist/cjs/assets/scripts/notification/const/sizes.js +46 -0
- package/dist/cjs/assets/scripts/notification/const/types.js +14 -0
- package/dist/cjs/assets/scripts/notification/index.js +116 -0
- package/dist/cjs/assets/scripts/notification/positionSync.js +180 -0
- package/dist/cjs/assets/scripts/notification/utils.js +122 -0
- package/dist/cjs/assets/scripts/shared/ButtonCloseX.js +45 -0
- package/dist/cjs/assets/scripts/utils/sanitize.js +39 -0
- package/dist/cjs/src/components/data-display/data-grid/DataGrid.js +5 -1
- package/dist/cjs/src/components/data-display/table/Table.js +118 -96
- package/dist/cjs/src/components/data-display/table/useTableScrollbars.js +187 -0
- package/dist/cjs/src/components/forms-and-input/combo-box/ComboBox.js +11 -10
- package/dist/cjs/src/components/forms-and-input/image-file-input/ImageFileInput.js +5 -2
- package/dist/cjs/src/components/forms-and-input/select-box/SelectBox.js +67 -29
- package/dist/cjs/src/components/forms-and-input/slider/Slider.js +2 -3
- package/dist/cjs/src/components/overlays/dropdown/Dropdown.js +47 -19
- package/dist/cjs/src/components/overlays/notification/CalloutNotification.js +25 -0
- package/dist/cjs/src/components/overlays/notification/FloatingNotification.js +86 -13
- package/dist/cjs/src/components/overlays/notification/Notification.js +7 -0
- package/dist/cjs/src/components/overlays/notification/host.js +12 -0
- package/dist/cjs/src/components/overlays/tooltip/Tooltip.js +57 -44
- package/dist/cjs/src/components/select-dropdown/SelectDropdown.js +2 -1
- package/dist/cjs/src/contexts/FloatingContext.js +11 -0
- package/dist/cjs/src/contexts/index.js +16 -0
- package/dist/cjs/src/hooks/index.js +11 -0
- package/dist/cjs/src/hooks/useFloatingPosition.js +78 -0
- package/dist/cjs/src/hooks/usePortalState.js +17 -0
- package/dist/cjs/src/types/component-meta.js +8 -1
- package/dist/cjs/src/utils/dropdown/maxSelection.js +35 -0
- package/dist/cjs/src/utils/dropdown/multiSelect.js +72 -15
- package/dist/esm/assets/scripts/featuredIcon.js +80 -0
- package/dist/esm/assets/scripts/notification/FloatingNotification.js +171 -0
- package/dist/esm/assets/scripts/notification/FullWidthNotification.js +126 -0
- package/dist/esm/assets/scripts/notification/MessageNotification.js +152 -0
- package/dist/esm/assets/scripts/notification/Notification.js +113 -0
- package/dist/esm/assets/scripts/notification/const/classNames.js +44 -0
- package/dist/esm/assets/scripts/notification/const/icons.js +25 -0
- package/dist/esm/assets/scripts/notification/const/index.js +4 -0
- package/dist/esm/assets/scripts/notification/const/sizes.js +40 -0
- package/dist/esm/assets/scripts/notification/const/types.js +8 -0
- package/dist/esm/assets/scripts/notification/index.js +10 -0
- package/dist/esm/assets/scripts/notification/positionSync.js +171 -0
- package/dist/esm/assets/scripts/notification/utils.js +109 -0
- package/dist/esm/assets/scripts/shared/ButtonCloseX.js +37 -0
- package/dist/esm/assets/scripts/utils/sanitize.js +31 -0
- package/dist/esm/src/components/data-display/data-grid/DataGrid.js +5 -1
- package/dist/esm/src/components/data-display/table/Table.js +118 -96
- package/dist/esm/src/components/data-display/table/useTableScrollbars.js +179 -0
- package/dist/esm/src/components/forms-and-input/combo-box/ComboBox.js +11 -10
- package/dist/esm/src/components/forms-and-input/image-file-input/ImageFileInput.js +5 -2
- package/dist/esm/src/components/forms-and-input/select-box/SelectBox.js +67 -29
- package/dist/esm/src/components/forms-and-input/slider/Slider.js +1 -2
- package/dist/esm/src/components/overlays/dropdown/Dropdown.js +47 -19
- package/dist/esm/src/components/overlays/notification/CalloutNotification.js +19 -0
- package/dist/esm/src/components/overlays/notification/FloatingNotification.js +86 -14
- package/dist/esm/src/components/overlays/notification/Notification.js +7 -0
- package/dist/esm/src/components/overlays/notification/host.js +9 -0
- package/dist/esm/src/components/overlays/tooltip/Tooltip.js +58 -45
- package/dist/esm/src/components/select-dropdown/SelectDropdown.js +2 -1
- package/dist/esm/src/contexts/FloatingContext.js +4 -0
- package/dist/esm/src/contexts/index.js +1 -0
- package/dist/esm/src/hooks/index.js +1 -0
- package/dist/esm/src/hooks/useFloatingPosition.js +71 -0
- package/dist/esm/src/hooks/usePortalState.js +10 -0
- package/dist/esm/src/types/component-meta.js +5 -1
- package/dist/esm/src/utils/dropdown/maxSelection.js +27 -0
- package/dist/esm/src/utils/dropdown/multiSelect.js +70 -14
- package/dist/temp/assets/scripts/featuredIcon.d.ts +22 -0
- package/dist/temp/assets/scripts/featuredIcon.js +79 -0
- package/dist/temp/assets/scripts/notification/FloatingNotification.d.ts +24 -0
- package/dist/temp/assets/scripts/notification/FloatingNotification.js +156 -0
- package/dist/temp/assets/scripts/notification/FullWidthNotification.d.ts +21 -0
- package/dist/temp/assets/scripts/notification/FullWidthNotification.js +111 -0
- package/dist/temp/assets/scripts/notification/MessageNotification.d.ts +22 -0
- package/dist/temp/assets/scripts/notification/MessageNotification.js +140 -0
- package/dist/temp/assets/scripts/notification/Notification.d.ts +22 -0
- package/dist/temp/assets/scripts/notification/Notification.js +112 -0
- package/dist/temp/assets/scripts/notification/const/classNames.d.ts +43 -0
- package/dist/temp/assets/scripts/notification/const/classNames.js +44 -0
- package/dist/temp/assets/scripts/notification/const/icons.d.ts +25 -0
- package/dist/temp/assets/scripts/notification/const/icons.js +25 -0
- package/dist/temp/assets/scripts/notification/const/index.d.ts +5 -0
- package/dist/temp/assets/scripts/notification/const/index.js +4 -0
- package/dist/temp/assets/scripts/notification/const/sizes.d.ts +32 -0
- package/dist/temp/assets/scripts/notification/const/sizes.js +40 -0
- package/dist/temp/assets/scripts/notification/const/types.d.ts +19 -0
- package/dist/temp/assets/scripts/notification/const/types.js +8 -0
- package/dist/temp/assets/scripts/notification/index.d.ts +8 -0
- package/dist/temp/assets/scripts/notification/index.js +10 -0
- package/dist/temp/assets/scripts/notification/positionSync.d.ts +50 -0
- package/dist/temp/assets/scripts/notification/positionSync.js +170 -0
- package/dist/temp/assets/scripts/notification/utils.d.ts +8 -0
- package/dist/temp/assets/scripts/notification/utils.js +115 -0
- package/dist/temp/assets/scripts/shared/ButtonCloseX.d.ts +5 -0
- package/dist/temp/assets/scripts/shared/ButtonCloseX.js +33 -0
- package/dist/temp/assets/scripts/utils/sanitize.d.ts +22 -0
- package/dist/temp/assets/scripts/utils/sanitize.js +31 -0
- package/dist/temp/src/components/data-display/data-grid/DataGrid.js +1 -1
- package/dist/temp/src/components/data-display/data-grid/DataGrid.types.d.ts +7 -0
- package/dist/temp/src/components/data-display/table/Table.d.ts +4 -1
- package/dist/temp/src/components/data-display/table/Table.js +53 -68
- package/dist/temp/src/components/data-display/table/types.d.ts +18 -0
- package/dist/temp/src/components/data-display/table/useTableScrollbars.d.ts +25 -0
- package/dist/temp/src/components/data-display/table/useTableScrollbars.js +136 -0
- package/dist/temp/src/components/forms-and-input/combo-box/ComboBox.d.ts +8 -0
- package/dist/temp/src/components/forms-and-input/combo-box/ComboBox.js +7 -11
- package/dist/temp/src/components/forms-and-input/image-file-input/ImageFileInput.js +1 -1
- package/dist/temp/src/components/forms-and-input/select-box/SelectBox.d.ts +13 -0
- package/dist/temp/src/components/forms-and-input/select-box/SelectBox.js +30 -3
- package/dist/temp/src/components/forms-and-input/slider/Slider.d.ts +0 -1
- package/dist/temp/src/components/forms-and-input/slider/Slider.js +0 -1
- package/dist/temp/src/components/overlays/dropdown/Dropdown.d.ts +5 -0
- package/dist/temp/src/components/overlays/dropdown/Dropdown.js +35 -11
- package/dist/temp/src/components/overlays/notification/CalloutNotification.d.ts +9 -0
- package/dist/temp/src/components/overlays/notification/CalloutNotification.js +6 -0
- package/dist/temp/src/components/overlays/notification/FloatingNotification.d.ts +15 -0
- package/dist/temp/src/components/overlays/notification/FloatingNotification.js +81 -13
- package/dist/temp/src/components/overlays/notification/Notification.d.ts +18 -3
- package/dist/temp/src/components/overlays/notification/Notification.js +4 -0
- package/dist/temp/src/components/overlays/notification/host.d.ts +9 -0
- package/dist/temp/src/components/overlays/notification/host.js +9 -0
- package/dist/temp/src/components/overlays/tooltip/Tooltip.d.ts +5 -1
- package/dist/temp/src/components/overlays/tooltip/Tooltip.js +25 -22
- package/dist/temp/src/components/select-dropdown/SelectDropdown.d.ts +6 -0
- package/dist/temp/src/components/select-dropdown/SelectDropdown.js +2 -2
- package/dist/temp/src/contexts/FloatingContext.d.ts +6 -0
- package/dist/temp/src/contexts/FloatingContext.js +4 -0
- package/dist/temp/src/contexts/index.d.ts +1 -0
- package/dist/temp/src/contexts/index.js +1 -0
- package/dist/temp/src/hooks/index.d.ts +1 -0
- package/dist/temp/src/hooks/index.js +1 -0
- package/dist/temp/src/hooks/useFloatingPosition.d.ts +19 -0
- package/dist/temp/src/hooks/useFloatingPosition.js +55 -0
- package/dist/temp/src/hooks/usePortalState.d.ts +6 -0
- package/dist/temp/src/hooks/usePortalState.js +7 -0
- package/dist/temp/src/types/component-meta.d.ts +6 -2
- package/dist/temp/src/types/component-meta.js +14 -1
- package/dist/temp/src/utils/dropdown/maxSelection.d.ts +24 -0
- package/dist/temp/src/utils/dropdown/maxSelection.js +28 -0
- package/dist/temp/src/utils/dropdown/multiSelect.d.ts +42 -2
- package/dist/temp/src/utils/dropdown/multiSelect.js +66 -13
- package/dist/types/assets/scripts/featuredIcon.d.ts +22 -0
- package/dist/types/assets/scripts/notification/FloatingNotification.d.ts +24 -0
- package/dist/types/assets/scripts/notification/FullWidthNotification.d.ts +21 -0
- package/dist/types/assets/scripts/notification/MessageNotification.d.ts +22 -0
- package/dist/types/assets/scripts/notification/Notification.d.ts +22 -0
- package/dist/types/assets/scripts/notification/const/classNames.d.ts +43 -0
- package/dist/types/assets/scripts/notification/const/icons.d.ts +25 -0
- package/dist/types/assets/scripts/notification/const/index.d.ts +5 -0
- package/dist/types/assets/scripts/notification/const/sizes.d.ts +32 -0
- package/dist/types/assets/scripts/notification/const/types.d.ts +19 -0
- package/dist/types/assets/scripts/notification/index.d.ts +8 -0
- package/dist/types/assets/scripts/notification/positionSync.d.ts +50 -0
- package/dist/types/assets/scripts/notification/utils.d.ts +8 -0
- package/dist/types/assets/scripts/shared/ButtonCloseX.d.ts +5 -0
- package/dist/types/assets/scripts/utils/sanitize.d.ts +22 -0
- package/dist/types/src/components/data-display/data-grid/DataGrid.types.d.ts +7 -0
- package/dist/types/src/components/data-display/table/Table.d.ts +4 -1
- package/dist/types/src/components/data-display/table/types.d.ts +18 -0
- package/dist/types/src/components/data-display/table/useTableScrollbars.d.ts +25 -0
- package/dist/types/src/components/forms-and-input/combo-box/ComboBox.d.ts +8 -0
- package/dist/types/src/components/forms-and-input/select-box/SelectBox.d.ts +13 -0
- package/dist/types/src/components/forms-and-input/slider/Slider.d.ts +0 -1
- package/dist/types/src/components/overlays/dropdown/Dropdown.d.ts +5 -0
- package/dist/types/src/components/overlays/notification/CalloutNotification.d.ts +9 -0
- package/dist/types/src/components/overlays/notification/FloatingNotification.d.ts +15 -0
- package/dist/types/src/components/overlays/notification/Notification.d.ts +18 -3
- package/dist/types/src/components/overlays/notification/host.d.ts +9 -0
- package/dist/types/src/components/overlays/tooltip/Tooltip.d.ts +5 -1
- package/dist/types/src/components/select-dropdown/SelectDropdown.d.ts +6 -0
- package/dist/types/src/contexts/FloatingContext.d.ts +6 -0
- package/dist/types/src/contexts/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/useFloatingPosition.d.ts +19 -0
- package/dist/types/src/hooks/usePortalState.d.ts +6 -0
- package/dist/types/src/types/component-meta.d.ts +6 -2
- package/dist/types/src/utils/dropdown/maxSelection.d.ts +24 -0
- package/dist/types/src/utils/dropdown/multiSelect.d.ts +42 -2
- package/dist/ui-admin/assets/styles/style.css +312 -64
- package/package.json +1 -1
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { MEDIA_QUERY } from '../../../src/constant/breakpoint';
|
|
2
|
+
import { FeaturedIcon } from '../featuredIcon';
|
|
3
|
+
import { ButtonCloseX } from '../shared/ButtonCloseX';
|
|
4
|
+
import { sanitizeHtml } from '../utils/sanitize';
|
|
5
|
+
import { CLASS_NAMES, FLOATING_ICON_MAP, getSizes } from './const';
|
|
6
|
+
import { bindNotificationEvents, createWrapperElement, isMobile, renderActions, renderSupportingText, setupAutoClose, } from './utils';
|
|
7
|
+
export class FloatingNotification {
|
|
8
|
+
constructor(options) {
|
|
9
|
+
this.options = {
|
|
10
|
+
color: 'neutral',
|
|
11
|
+
className: '',
|
|
12
|
+
actions: [],
|
|
13
|
+
autoClose: 0,
|
|
14
|
+
supportingText: undefined,
|
|
15
|
+
...options,
|
|
16
|
+
};
|
|
17
|
+
this.element = this.createElement();
|
|
18
|
+
this.bindEvents();
|
|
19
|
+
this.setupAutoClose();
|
|
20
|
+
this.setupMobileListener();
|
|
21
|
+
}
|
|
22
|
+
createElement() {
|
|
23
|
+
const { title, supportingText, color, className, actions, onClose } = this.options;
|
|
24
|
+
// 플로팅 알림에서 info 색상 사용 시 neutral로 대체
|
|
25
|
+
let actualColor = color;
|
|
26
|
+
if (color === 'info') {
|
|
27
|
+
actualColor = 'neutral';
|
|
28
|
+
}
|
|
29
|
+
const wrapper = createWrapperElement(CLASS_NAMES.FLOATING.BASE, actualColor, className);
|
|
30
|
+
const iconFunction = FLOATING_ICON_MAP[actualColor];
|
|
31
|
+
const mobile = isMobile();
|
|
32
|
+
// FeaturedIcon 생성
|
|
33
|
+
let featuredIconElement = null;
|
|
34
|
+
if (iconFunction) {
|
|
35
|
+
const size = getSizes.featuredIcon(mobile);
|
|
36
|
+
const iconSize = getSizes.iconPixel(mobile);
|
|
37
|
+
const iconSvg = iconFunction(iconSize);
|
|
38
|
+
this.featuredIcon = FeaturedIcon.create({
|
|
39
|
+
svgString: iconSvg,
|
|
40
|
+
theme: 'dark-circle',
|
|
41
|
+
color: actualColor,
|
|
42
|
+
size: size,
|
|
43
|
+
});
|
|
44
|
+
featuredIconElement = this.featuredIcon.getElement();
|
|
45
|
+
}
|
|
46
|
+
wrapper.innerHTML = sanitizeHtml(this.buildTemplate({
|
|
47
|
+
title,
|
|
48
|
+
supportingText,
|
|
49
|
+
actions,
|
|
50
|
+
onClose,
|
|
51
|
+
isMobile: mobile,
|
|
52
|
+
}));
|
|
53
|
+
// FeaturedIcon을 container에 추가
|
|
54
|
+
if (featuredIconElement) {
|
|
55
|
+
const container = wrapper.querySelector(`.${CLASS_NAMES.FLOATING.CONTAINER}`);
|
|
56
|
+
if (container) {
|
|
57
|
+
container.insertBefore(featuredIconElement, container.firstChild);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return wrapper;
|
|
61
|
+
}
|
|
62
|
+
buildTemplate(params) {
|
|
63
|
+
const { title, supportingText, actions, onClose, isMobile } = params;
|
|
64
|
+
return `
|
|
65
|
+
<div class="${CLASS_NAMES.FLOATING.CONTENT}">
|
|
66
|
+
<div class="${CLASS_NAMES.FLOATING.CONTAINER}">
|
|
67
|
+
<div class="${CLASS_NAMES.FLOATING.TEXT_CONTAINER}">
|
|
68
|
+
<div class="${CLASS_NAMES.FLOATING.TITLE_WRAPPER}">
|
|
69
|
+
<span class="${CLASS_NAMES.FLOATING.TITLE}">${title}</span>
|
|
70
|
+
</div>
|
|
71
|
+
${renderSupportingText(supportingText, CLASS_NAMES.FLOATING.SUPPORTING_TEXT)}
|
|
72
|
+
${actions && actions.length > 0 ? renderActions(actions, CLASS_NAMES.FLOATING.ACTIONS) : ''}
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
${this.renderCloseButton(onClose, isMobile)}
|
|
77
|
+
`;
|
|
78
|
+
}
|
|
79
|
+
renderCloseButton(onClose, isMobile = false) {
|
|
80
|
+
if (!onClose)
|
|
81
|
+
return '';
|
|
82
|
+
const size = getSizes.closeButton(isMobile);
|
|
83
|
+
return ButtonCloseX(size, 'light', CLASS_NAMES.FLOATING.CLOSE_BUTTON, '알림 닫기', onClose);
|
|
84
|
+
}
|
|
85
|
+
setupMobileListener() {
|
|
86
|
+
const mediaQuery = window.matchMedia(MEDIA_QUERY.mobile);
|
|
87
|
+
const handleChange = (e) => {
|
|
88
|
+
this.updateMobileStyles(e.matches);
|
|
89
|
+
if (e.matches && this.options.onClose) {
|
|
90
|
+
this.options.onClose();
|
|
91
|
+
this.remove();
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
handleChange({ matches: mediaQuery.matches });
|
|
95
|
+
mediaQuery.addEventListener('change', handleChange);
|
|
96
|
+
this.mobileCleanup = () => {
|
|
97
|
+
mediaQuery.removeEventListener('change', handleChange);
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
updateMobileStyles(mobile) {
|
|
101
|
+
if (this.featuredIcon) {
|
|
102
|
+
const newSize = getSizes.featuredIcon(mobile);
|
|
103
|
+
this.featuredIcon.updateSize(newSize);
|
|
104
|
+
}
|
|
105
|
+
const closeButton = this.element.querySelector('.ncua-button-close-x');
|
|
106
|
+
if (closeButton) {
|
|
107
|
+
const newSize = getSizes.closeButton(mobile);
|
|
108
|
+
const newSvgSize = getSizes.closeButtonSvg(newSize);
|
|
109
|
+
closeButton.className = closeButton.className.replace(/ncua-button-close-x--(xs|sm)/, `ncua-button-close-x--${newSize}`);
|
|
110
|
+
const svg = closeButton.querySelector('svg');
|
|
111
|
+
if (svg) {
|
|
112
|
+
svg.setAttribute('width', newSvgSize.toString());
|
|
113
|
+
svg.setAttribute('height', newSvgSize.toString());
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
bindEvents() {
|
|
118
|
+
bindNotificationEvents(this.element, this.options.actions, this.options.onClose, () => this.remove());
|
|
119
|
+
}
|
|
120
|
+
setupAutoClose() {
|
|
121
|
+
this.autoCloseTimer = setupAutoClose(this.options.autoClose, this.options.onClose, () => this.remove());
|
|
122
|
+
}
|
|
123
|
+
// Public methods
|
|
124
|
+
getElement() {
|
|
125
|
+
return this.element;
|
|
126
|
+
}
|
|
127
|
+
appendTo(parent) {
|
|
128
|
+
parent.appendChild(this.element);
|
|
129
|
+
}
|
|
130
|
+
remove() {
|
|
131
|
+
if (this.autoCloseTimer) {
|
|
132
|
+
clearTimeout(this.autoCloseTimer);
|
|
133
|
+
this.autoCloseTimer = undefined;
|
|
134
|
+
}
|
|
135
|
+
if (this.element?.parentNode) {
|
|
136
|
+
this.element.parentNode.removeChild(this.element);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
destroy() {
|
|
140
|
+
// FeaturedIcon 정리
|
|
141
|
+
if (this.featuredIcon) {
|
|
142
|
+
this.featuredIcon.destroy();
|
|
143
|
+
this.featuredIcon = undefined;
|
|
144
|
+
}
|
|
145
|
+
// 모바일 리스너 정리
|
|
146
|
+
if (this.mobileCleanup) {
|
|
147
|
+
this.mobileCleanup();
|
|
148
|
+
this.mobileCleanup = undefined;
|
|
149
|
+
}
|
|
150
|
+
this.remove();
|
|
151
|
+
}
|
|
152
|
+
// Static factory methods
|
|
153
|
+
static create(options) {
|
|
154
|
+
return new FloatingNotification(options);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BaseNotificationOptions } from './const';
|
|
2
|
+
export interface FullWidthNotificationOptions extends BaseNotificationOptions {
|
|
3
|
+
type?: 'full-width';
|
|
4
|
+
}
|
|
5
|
+
export declare class FullWidthNotification {
|
|
6
|
+
private element;
|
|
7
|
+
private options;
|
|
8
|
+
private autoCloseTimer?;
|
|
9
|
+
constructor(options: FullWidthNotificationOptions);
|
|
10
|
+
private createElement;
|
|
11
|
+
private buildTemplate;
|
|
12
|
+
private renderHidePermanentlyButton;
|
|
13
|
+
private renderCloseButton;
|
|
14
|
+
private bindEvents;
|
|
15
|
+
private setupAutoClose;
|
|
16
|
+
getElement(): HTMLElement;
|
|
17
|
+
appendTo(parent: HTMLElement): void;
|
|
18
|
+
remove(): void;
|
|
19
|
+
destroy(): void;
|
|
20
|
+
static create(options: FullWidthNotificationOptions): FullWidthNotification;
|
|
21
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { sanitizeHtml } from '../utils/sanitize';
|
|
2
|
+
import { CLASS_NAMES, FULL_WIDTH_ICON_MAP, FULL_WIDTH_SIZES, SVG_ICONS } from './const';
|
|
3
|
+
import { bindNotificationEvents, createWrapperElement, renderActions, renderSupportingText, setupAutoClose, } from './utils';
|
|
4
|
+
export class FullWidthNotification {
|
|
5
|
+
constructor(options) {
|
|
6
|
+
this.options = {
|
|
7
|
+
color: 'neutral',
|
|
8
|
+
className: '',
|
|
9
|
+
actions: [],
|
|
10
|
+
autoClose: 0,
|
|
11
|
+
supportingText: undefined,
|
|
12
|
+
...options,
|
|
13
|
+
};
|
|
14
|
+
this.element = this.createElement();
|
|
15
|
+
this.bindEvents();
|
|
16
|
+
this.setupAutoClose();
|
|
17
|
+
}
|
|
18
|
+
createElement() {
|
|
19
|
+
const { title, supportingText, color, className, actions, onClose, supportTextLink, onHidePermanently } = this.options;
|
|
20
|
+
const wrapper = createWrapperElement(CLASS_NAMES.FULL_WIDTH.BASE, color, className);
|
|
21
|
+
const iconHtml = FULL_WIDTH_ICON_MAP[color](FULL_WIDTH_SIZES.ICON);
|
|
22
|
+
wrapper.innerHTML = sanitizeHtml(this.buildTemplate({
|
|
23
|
+
iconHtml,
|
|
24
|
+
title,
|
|
25
|
+
supportingText,
|
|
26
|
+
actions,
|
|
27
|
+
onClose,
|
|
28
|
+
supportTextLink,
|
|
29
|
+
onHidePermanently,
|
|
30
|
+
}));
|
|
31
|
+
return wrapper;
|
|
32
|
+
}
|
|
33
|
+
buildTemplate(params) {
|
|
34
|
+
const { iconHtml, title, supportingText, actions, onClose, supportTextLink, onHidePermanently } = params;
|
|
35
|
+
return `
|
|
36
|
+
<div class="${CLASS_NAMES.FULL_WIDTH.CONTAINER}">
|
|
37
|
+
<div class="${CLASS_NAMES.FULL_WIDTH.CONTENT}">
|
|
38
|
+
<div class="${CLASS_NAMES.FULL_WIDTH.CONTENT_WRAPPER}">
|
|
39
|
+
<div class="${CLASS_NAMES.FULL_WIDTH.ICON}">${iconHtml}</div>
|
|
40
|
+
<div class="${CLASS_NAMES.FULL_WIDTH.TEXT_CONTAINER}">
|
|
41
|
+
<span class="${CLASS_NAMES.FULL_WIDTH.TITLE}">${title}</span>
|
|
42
|
+
${renderSupportingText(supportingText, CLASS_NAMES.FULL_WIDTH.SUPPORTING_TEXT, supportTextLink)}
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
<div class="${CLASS_NAMES.FULL_WIDTH.ACTIONS_CONTAINER}">
|
|
46
|
+
${actions && actions.length > 0 ? renderActions(actions, CLASS_NAMES.FULL_WIDTH.ACTIONS) : ''}
|
|
47
|
+
${this.renderHidePermanentlyButton(onHidePermanently)}
|
|
48
|
+
${this.renderCloseButton(onClose)}
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
`;
|
|
53
|
+
}
|
|
54
|
+
renderHidePermanentlyButton(onHidePermanently) {
|
|
55
|
+
if (!onHidePermanently)
|
|
56
|
+
return '';
|
|
57
|
+
return `
|
|
58
|
+
<button type="button" class="ncua-notification__action-button ncua-notification__action-button--text ncua-full-width-notification__link" data-hide-permanently="true">
|
|
59
|
+
다시보지 않기
|
|
60
|
+
</button>
|
|
61
|
+
`;
|
|
62
|
+
}
|
|
63
|
+
renderCloseButton(onClose) {
|
|
64
|
+
if (!onClose)
|
|
65
|
+
return '';
|
|
66
|
+
return `
|
|
67
|
+
<button type="button" class="${CLASS_NAMES.FULL_WIDTH.CLOSE_BUTTON}" aria-label="알림 닫기">
|
|
68
|
+
${SVG_ICONS['x-close'](FULL_WIDTH_SIZES.CLOSE_BUTTON)}
|
|
69
|
+
</button>
|
|
70
|
+
`;
|
|
71
|
+
}
|
|
72
|
+
bindEvents() {
|
|
73
|
+
bindNotificationEvents(this.element, this.options.actions, this.options.onClose, () => this.remove());
|
|
74
|
+
// 다시보지 않기 버튼 이벤트 바인딩
|
|
75
|
+
if (this.options.onHidePermanently) {
|
|
76
|
+
const hidePermanentlyButton = this.element.querySelector('[data-hide-permanently="true"]');
|
|
77
|
+
if (hidePermanentlyButton) {
|
|
78
|
+
hidePermanentlyButton.addEventListener('click', () => {
|
|
79
|
+
this.options.onHidePermanently?.();
|
|
80
|
+
this.remove();
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
setupAutoClose() {
|
|
86
|
+
this.autoCloseTimer = setupAutoClose(this.options.autoClose, this.options.onClose, () => this.remove());
|
|
87
|
+
}
|
|
88
|
+
// Public methods
|
|
89
|
+
getElement() {
|
|
90
|
+
return this.element;
|
|
91
|
+
}
|
|
92
|
+
appendTo(parent) {
|
|
93
|
+
parent.appendChild(this.element);
|
|
94
|
+
}
|
|
95
|
+
remove() {
|
|
96
|
+
if (this.autoCloseTimer) {
|
|
97
|
+
clearTimeout(this.autoCloseTimer);
|
|
98
|
+
this.autoCloseTimer = undefined;
|
|
99
|
+
}
|
|
100
|
+
if (this.element?.parentNode) {
|
|
101
|
+
this.element.parentNode.removeChild(this.element);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
destroy() {
|
|
105
|
+
this.remove();
|
|
106
|
+
}
|
|
107
|
+
// Static factory methods
|
|
108
|
+
static create(options) {
|
|
109
|
+
return new FullWidthNotification(options);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { BaseNotificationOptions } from './const';
|
|
2
|
+
export interface MessageNotificationOptions extends BaseNotificationOptions {
|
|
3
|
+
type?: 'message';
|
|
4
|
+
}
|
|
5
|
+
export declare class MessageNotification {
|
|
6
|
+
private element;
|
|
7
|
+
private options;
|
|
8
|
+
private autoCloseTimer?;
|
|
9
|
+
private featuredIcon?;
|
|
10
|
+
constructor(options: MessageNotificationOptions);
|
|
11
|
+
private createElement;
|
|
12
|
+
private buildTemplate;
|
|
13
|
+
private renderHidePermanentlyButton;
|
|
14
|
+
private renderCloseButton;
|
|
15
|
+
private bindEvents;
|
|
16
|
+
private setupAutoClose;
|
|
17
|
+
getElement(): HTMLElement;
|
|
18
|
+
appendTo(parent: HTMLElement): void;
|
|
19
|
+
remove(): void;
|
|
20
|
+
destroy(): void;
|
|
21
|
+
static create(options: MessageNotificationOptions): MessageNotification;
|
|
22
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { FeaturedIcon } from '../featuredIcon';
|
|
2
|
+
import { sanitizeHtml } from '../utils/sanitize';
|
|
3
|
+
import { CLASS_NAMES, FLOATING_ICON_MAP, MESSAGE_SIZES, SVG_ICONS } from './const';
|
|
4
|
+
import { bindNotificationEvents, createWrapperElement, renderActions, renderSupportingText, setupAutoClose, } from './utils';
|
|
5
|
+
export class MessageNotification {
|
|
6
|
+
constructor(options) {
|
|
7
|
+
this.options = {
|
|
8
|
+
color: 'neutral',
|
|
9
|
+
className: '',
|
|
10
|
+
actions: [],
|
|
11
|
+
autoClose: 0,
|
|
12
|
+
supportingText: undefined,
|
|
13
|
+
...options,
|
|
14
|
+
};
|
|
15
|
+
this.element = this.createElement();
|
|
16
|
+
this.bindEvents();
|
|
17
|
+
this.setupAutoClose();
|
|
18
|
+
}
|
|
19
|
+
createElement() {
|
|
20
|
+
const { title, supportingText, color, className, actions, onClose, onHidePermanently } = this.options;
|
|
21
|
+
// message 타입은 neutral, error, warning, success 4가지 색상만 지원
|
|
22
|
+
let actualColor = color;
|
|
23
|
+
if (color === 'info') {
|
|
24
|
+
actualColor = 'neutral';
|
|
25
|
+
}
|
|
26
|
+
const wrapper = createWrapperElement(CLASS_NAMES.MESSAGE.BASE, actualColor, className);
|
|
27
|
+
const iconFunction = FLOATING_ICON_MAP[actualColor];
|
|
28
|
+
// FeaturedIcon 생성
|
|
29
|
+
let featuredIconElement = null;
|
|
30
|
+
if (iconFunction) {
|
|
31
|
+
const iconSvg = iconFunction(MESSAGE_SIZES.ICON_PIXEL);
|
|
32
|
+
this.featuredIcon = FeaturedIcon.create({
|
|
33
|
+
svgString: iconSvg,
|
|
34
|
+
theme: 'light-circle',
|
|
35
|
+
color: actualColor,
|
|
36
|
+
size: MESSAGE_SIZES.FEATURED_ICON,
|
|
37
|
+
});
|
|
38
|
+
featuredIconElement = this.featuredIcon.getElement();
|
|
39
|
+
}
|
|
40
|
+
wrapper.innerHTML = sanitizeHtml(this.buildTemplate({
|
|
41
|
+
title,
|
|
42
|
+
supportingText,
|
|
43
|
+
actions,
|
|
44
|
+
onClose,
|
|
45
|
+
onHidePermanently,
|
|
46
|
+
}));
|
|
47
|
+
// FeaturedIcon을 content-wrapper에 추가
|
|
48
|
+
if (featuredIconElement) {
|
|
49
|
+
const contentWrapper = wrapper.querySelector(`.${CLASS_NAMES.MESSAGE.CONTENT_WRAPPER}`);
|
|
50
|
+
if (contentWrapper) {
|
|
51
|
+
contentWrapper.insertBefore(featuredIconElement, contentWrapper.firstChild);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return wrapper;
|
|
55
|
+
}
|
|
56
|
+
buildTemplate(params) {
|
|
57
|
+
const { title, supportingText, actions, onClose, onHidePermanently } = params;
|
|
58
|
+
return `
|
|
59
|
+
<div class="${CLASS_NAMES.MESSAGE.CONTAINER}">
|
|
60
|
+
<div class="${CLASS_NAMES.MESSAGE.CONTENT}">
|
|
61
|
+
<div class="${CLASS_NAMES.MESSAGE.CONTENT_WRAPPER}">
|
|
62
|
+
<div class="${CLASS_NAMES.MESSAGE.TEXT_CONTAINER}">
|
|
63
|
+
<span class="${CLASS_NAMES.MESSAGE.TITLE}">${title}</span>
|
|
64
|
+
${renderSupportingText(supportingText, CLASS_NAMES.MESSAGE.SUPPORTING_TEXT)}
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
<div class="${CLASS_NAMES.MESSAGE.ACTIONS_CONTAINER}">
|
|
68
|
+
${actions && actions.length > 0 ? renderActions(actions, CLASS_NAMES.MESSAGE.ACTIONS) : ''}
|
|
69
|
+
</div>
|
|
70
|
+
<div class="${CLASS_NAMES.MESSAGE.ACTIONS_CONTAINER}">
|
|
71
|
+
${this.renderHidePermanentlyButton(onHidePermanently)}
|
|
72
|
+
${this.renderCloseButton(onClose)}
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
`;
|
|
77
|
+
}
|
|
78
|
+
renderHidePermanentlyButton(onHidePermanently) {
|
|
79
|
+
if (!onHidePermanently)
|
|
80
|
+
return '';
|
|
81
|
+
return `
|
|
82
|
+
<button type="button" class="${CLASS_NAMES.COMMON.ACTION_BUTTON} ${CLASS_NAMES.COMMON.ACTION_BUTTON}--text ${CLASS_NAMES.MESSAGE.HIDE_LINK}" data-hide-permanently="true">
|
|
83
|
+
다시 보지 않기
|
|
84
|
+
</button>
|
|
85
|
+
`;
|
|
86
|
+
}
|
|
87
|
+
renderCloseButton(onClose) {
|
|
88
|
+
if (!onClose)
|
|
89
|
+
return '';
|
|
90
|
+
return `
|
|
91
|
+
<button type="button" class="${CLASS_NAMES.MESSAGE.CLOSE_BUTTON}" aria-label="알림 닫기">
|
|
92
|
+
${SVG_ICONS['x-close'](MESSAGE_SIZES.CLOSE_BUTTON).replace('stroke="currentColor"', `stroke="#2F2F30"`)}
|
|
93
|
+
</button>
|
|
94
|
+
`;
|
|
95
|
+
}
|
|
96
|
+
bindEvents() {
|
|
97
|
+
bindNotificationEvents(this.element, this.options.actions, this.options.onClose, () => this.remove());
|
|
98
|
+
// 다시보지 않기 버튼 이벤트 바인딩
|
|
99
|
+
if (this.options.onHidePermanently) {
|
|
100
|
+
const hidePermanentlyButton = this.element.querySelector('[data-hide-permanently="true"]');
|
|
101
|
+
if (hidePermanentlyButton) {
|
|
102
|
+
hidePermanentlyButton.addEventListener('click', () => {
|
|
103
|
+
this.options.onHidePermanently?.();
|
|
104
|
+
this.remove();
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
setupAutoClose() {
|
|
110
|
+
this.autoCloseTimer = setupAutoClose(this.options.autoClose, this.options.onClose, () => this.remove());
|
|
111
|
+
}
|
|
112
|
+
// Public methods
|
|
113
|
+
getElement() {
|
|
114
|
+
return this.element;
|
|
115
|
+
}
|
|
116
|
+
appendTo(parent) {
|
|
117
|
+
parent.appendChild(this.element);
|
|
118
|
+
}
|
|
119
|
+
remove() {
|
|
120
|
+
if (this.autoCloseTimer) {
|
|
121
|
+
clearTimeout(this.autoCloseTimer);
|
|
122
|
+
this.autoCloseTimer = undefined;
|
|
123
|
+
}
|
|
124
|
+
if (this.element?.parentNode) {
|
|
125
|
+
this.element.parentNode.removeChild(this.element);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
destroy() {
|
|
129
|
+
// FeaturedIcon 정리
|
|
130
|
+
if (this.featuredIcon) {
|
|
131
|
+
this.featuredIcon.destroy();
|
|
132
|
+
this.featuredIcon = undefined;
|
|
133
|
+
}
|
|
134
|
+
this.remove();
|
|
135
|
+
}
|
|
136
|
+
// Static factory methods
|
|
137
|
+
static create(options) {
|
|
138
|
+
return new MessageNotification(options);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { BaseNotificationOptions, NotificationColor } from './const';
|
|
2
|
+
export interface NotificationOptions extends BaseNotificationOptions {
|
|
3
|
+
type?: 'full-width' | 'floating' | 'message';
|
|
4
|
+
}
|
|
5
|
+
export declare class NcuaNotification {
|
|
6
|
+
private instance;
|
|
7
|
+
private resolvedType;
|
|
8
|
+
constructor(options: NotificationOptions);
|
|
9
|
+
getElement(): HTMLElement;
|
|
10
|
+
appendTo(parent: HTMLElement): void;
|
|
11
|
+
remove(): void;
|
|
12
|
+
destroy(): void;
|
|
13
|
+
show(parent?: HTMLElement): void;
|
|
14
|
+
static create(options: NotificationOptions): NcuaNotification;
|
|
15
|
+
static createWithColor(color: NotificationColor, title: string, supportingText?: string, options?: Partial<NotificationOptions>): NcuaNotification;
|
|
16
|
+
static success(title: string, supportingText?: string, options?: Partial<NotificationOptions>): NcuaNotification;
|
|
17
|
+
static error(title: string, supportingText?: string, options?: Partial<NotificationOptions>): NcuaNotification;
|
|
18
|
+
static warning(title: string, supportingText?: string, options?: Partial<NotificationOptions>): NcuaNotification;
|
|
19
|
+
static info(title: string, supportingText?: string, options?: Partial<NotificationOptions>): NcuaNotification;
|
|
20
|
+
static neutral(title: string, supportingText?: string, options?: Partial<NotificationOptions>): NcuaNotification;
|
|
21
|
+
static showFullWidth(options: Omit<NotificationOptions, 'type'>): NcuaNotification;
|
|
22
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { FloatingNotification } from './FloatingNotification';
|
|
2
|
+
import { FullWidthNotification } from './FullWidthNotification';
|
|
3
|
+
import { MessageNotification } from './MessageNotification';
|
|
4
|
+
import { mountFloatingNotificationHost } from './positionSync';
|
|
5
|
+
// 통합 Notification 클래스 (글로벌 Web Notifications API와의 식별자 충돌을 피하기 위해 NcuaNotification 으로 명명)
|
|
6
|
+
export class NcuaNotification {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
const { type = 'floating', ...baseOptions } = options;
|
|
9
|
+
this.resolvedType = type;
|
|
10
|
+
if (type === 'message') {
|
|
11
|
+
this.instance = new MessageNotification(baseOptions);
|
|
12
|
+
}
|
|
13
|
+
else if (type === 'full-width') {
|
|
14
|
+
this.instance = new FullWidthNotification(baseOptions);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
this.instance = new FloatingNotification(baseOptions);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
// 모든 메서드를 instance에 위임
|
|
21
|
+
getElement() {
|
|
22
|
+
return this.instance.getElement();
|
|
23
|
+
}
|
|
24
|
+
appendTo(parent) {
|
|
25
|
+
return this.instance.appendTo(parent);
|
|
26
|
+
}
|
|
27
|
+
remove() {
|
|
28
|
+
return this.instance.remove();
|
|
29
|
+
}
|
|
30
|
+
destroy() {
|
|
31
|
+
return this.instance.destroy();
|
|
32
|
+
}
|
|
33
|
+
show(parent) {
|
|
34
|
+
// 사용자가 부모를 명시한 경우 기존 동작 유지 (legacy 호환).
|
|
35
|
+
if (parent) {
|
|
36
|
+
this.instance.appendTo(parent);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
// §5.1 — floating 은 자동으로 우측 상단 호스트에 append.
|
|
40
|
+
// 시각적으로는 최신 토스트가 상단에 노출되고, 이전 토스트들은 그 아래로 12px 씩 겹쳐 쌓인다
|
|
41
|
+
// (LIFO, §5.4 "최신 상단" 준수. godomall5 등 기존 admin wrapper 와 동일 정책.
|
|
42
|
+
// 겹침 너비는 --ncua-floating-notification-stack-overlap CSS 변수로 오버라이드 가능).
|
|
43
|
+
//
|
|
44
|
+
// SSR 가드는 mountFloatingNotificationHost 내부의 isBrowserEnv() 로 위임 — null 이면
|
|
45
|
+
// 토스트가 표시될 환경이 아니라는 의미이므로 silently return 한다 (document.body 에 append
|
|
46
|
+
// 시도하는 fallthrough 는 SSR 에서 ReferenceError 를 일으키므로 금지).
|
|
47
|
+
if (this.resolvedType === 'floating') {
|
|
48
|
+
const host = mountFloatingNotificationHost();
|
|
49
|
+
if (host) {
|
|
50
|
+
this.instance.appendTo(host);
|
|
51
|
+
}
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
// full-width / message는 기존대로 body에 append.
|
|
55
|
+
this.instance.appendTo(document.body);
|
|
56
|
+
}
|
|
57
|
+
// Static factory methods
|
|
58
|
+
static create(options) {
|
|
59
|
+
return new NcuaNotification(options);
|
|
60
|
+
}
|
|
61
|
+
// Convenience method for creating notifications with specific color
|
|
62
|
+
static createWithColor(color, title, supportingText, options) {
|
|
63
|
+
const autoCloseMap = {
|
|
64
|
+
success: 3000,
|
|
65
|
+
error: 5000,
|
|
66
|
+
warning: 3000,
|
|
67
|
+
info: 3000,
|
|
68
|
+
neutral: 0,
|
|
69
|
+
};
|
|
70
|
+
return new NcuaNotification({
|
|
71
|
+
title,
|
|
72
|
+
supportingText,
|
|
73
|
+
color,
|
|
74
|
+
type: 'floating',
|
|
75
|
+
autoClose: autoCloseMap[color],
|
|
76
|
+
...options,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
// 클래스를 생성하지 않고도 기본 floating 알림 생성을 하기 위한 함수들
|
|
80
|
+
static success(title, supportingText, options) {
|
|
81
|
+
const notification = NcuaNotification.createWithColor('success', title, supportingText, options);
|
|
82
|
+
notification.show();
|
|
83
|
+
return notification;
|
|
84
|
+
}
|
|
85
|
+
static error(title, supportingText, options) {
|
|
86
|
+
const notification = NcuaNotification.createWithColor('error', title, supportingText, options);
|
|
87
|
+
notification.show();
|
|
88
|
+
return notification;
|
|
89
|
+
}
|
|
90
|
+
static warning(title, supportingText, options) {
|
|
91
|
+
const notification = NcuaNotification.createWithColor('warning', title, supportingText, options);
|
|
92
|
+
notification.show();
|
|
93
|
+
return notification;
|
|
94
|
+
}
|
|
95
|
+
static info(title, supportingText, options) {
|
|
96
|
+
const notification = NcuaNotification.createWithColor('info', title, supportingText, options);
|
|
97
|
+
notification.show();
|
|
98
|
+
return notification;
|
|
99
|
+
}
|
|
100
|
+
static neutral(title, supportingText, options) {
|
|
101
|
+
const notification = NcuaNotification.createWithColor('neutral', title, supportingText, options);
|
|
102
|
+
notification.show();
|
|
103
|
+
return notification;
|
|
104
|
+
}
|
|
105
|
+
// showFullWidth method for backward compatibility
|
|
106
|
+
static showFullWidth(options) {
|
|
107
|
+
return new NcuaNotification({
|
|
108
|
+
...options,
|
|
109
|
+
type: 'full-width',
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare const CLASS_NAMES: {
|
|
2
|
+
readonly FULL_WIDTH: {
|
|
3
|
+
readonly BASE: "ncua-full-width-notification";
|
|
4
|
+
readonly CONTAINER: "ncua-full-width-notification__container";
|
|
5
|
+
readonly CONTENT: "ncua-full-width-notification__content";
|
|
6
|
+
readonly CONTENT_WRAPPER: "ncua-full-width-notification__content-wrapper";
|
|
7
|
+
readonly ICON: "ncua-full-width-notification__icon";
|
|
8
|
+
readonly TEXT_CONTAINER: "ncua-full-width-notification__text-container";
|
|
9
|
+
readonly TITLE: "ncua-full-width-notification__title";
|
|
10
|
+
readonly SUPPORTING_TEXT: "ncua-full-width-notification__supporting-text";
|
|
11
|
+
readonly ACTIONS_CONTAINER: "ncua-full-width-notification__actions-container";
|
|
12
|
+
readonly ACTIONS: "ncua-full-width-notification__actions";
|
|
13
|
+
readonly CLOSE_BUTTON: "ncua-full-width-notification__close-button";
|
|
14
|
+
};
|
|
15
|
+
readonly FLOATING: {
|
|
16
|
+
readonly BASE: "ncua-floating-notification";
|
|
17
|
+
readonly CONTAINER: "ncua-floating-notification__container";
|
|
18
|
+
readonly CONTENT: "ncua-floating-notification__content";
|
|
19
|
+
readonly TEXT_CONTAINER: "ncua-floating-notification__text-container";
|
|
20
|
+
readonly TITLE_WRAPPER: "ncua-floating-notification__title-wrapper";
|
|
21
|
+
readonly TITLE: "ncua-floating-notification__title";
|
|
22
|
+
readonly SUPPORTING_TEXT: "ncua-floating-notification__supporting-text";
|
|
23
|
+
readonly ACTIONS: "ncua-floating-notification__actions";
|
|
24
|
+
readonly CLOSE_BUTTON: "ncua-floating-notification__close-button";
|
|
25
|
+
};
|
|
26
|
+
readonly MESSAGE: {
|
|
27
|
+
readonly BASE: "ncua-message-notification";
|
|
28
|
+
readonly CONTAINER: "ncua-message-notification__container";
|
|
29
|
+
readonly CONTENT: "ncua-message-notification__content";
|
|
30
|
+
readonly CONTENT_WRAPPER: "ncua-message-notification__content-wrapper";
|
|
31
|
+
readonly ICON: "ncua-message-notification__icon";
|
|
32
|
+
readonly TEXT_CONTAINER: "ncua-message-notification__text-container";
|
|
33
|
+
readonly TITLE: "ncua-message-notification__title";
|
|
34
|
+
readonly SUPPORTING_TEXT: "ncua-message-notification__supporting-text";
|
|
35
|
+
readonly ACTIONS_CONTAINER: "ncua-message-notification__actions-container";
|
|
36
|
+
readonly ACTIONS: "ncua-message-notification__actions";
|
|
37
|
+
readonly HIDE_LINK: "ncua-message-notification__hide-link";
|
|
38
|
+
readonly CLOSE_BUTTON: "ncua-message-notification__close-button";
|
|
39
|
+
};
|
|
40
|
+
readonly COMMON: {
|
|
41
|
+
readonly ACTION_BUTTON: "ncua-notification__action-button";
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// CSS class names
|
|
2
|
+
export const CLASS_NAMES = {
|
|
3
|
+
FULL_WIDTH: {
|
|
4
|
+
BASE: 'ncua-full-width-notification',
|
|
5
|
+
CONTAINER: 'ncua-full-width-notification__container',
|
|
6
|
+
CONTENT: 'ncua-full-width-notification__content',
|
|
7
|
+
CONTENT_WRAPPER: 'ncua-full-width-notification__content-wrapper',
|
|
8
|
+
ICON: 'ncua-full-width-notification__icon',
|
|
9
|
+
TEXT_CONTAINER: 'ncua-full-width-notification__text-container',
|
|
10
|
+
TITLE: 'ncua-full-width-notification__title',
|
|
11
|
+
SUPPORTING_TEXT: 'ncua-full-width-notification__supporting-text',
|
|
12
|
+
ACTIONS_CONTAINER: 'ncua-full-width-notification__actions-container',
|
|
13
|
+
ACTIONS: 'ncua-full-width-notification__actions',
|
|
14
|
+
CLOSE_BUTTON: 'ncua-full-width-notification__close-button',
|
|
15
|
+
},
|
|
16
|
+
FLOATING: {
|
|
17
|
+
BASE: 'ncua-floating-notification',
|
|
18
|
+
CONTAINER: 'ncua-floating-notification__container',
|
|
19
|
+
CONTENT: 'ncua-floating-notification__content',
|
|
20
|
+
TEXT_CONTAINER: 'ncua-floating-notification__text-container',
|
|
21
|
+
TITLE_WRAPPER: 'ncua-floating-notification__title-wrapper',
|
|
22
|
+
TITLE: 'ncua-floating-notification__title',
|
|
23
|
+
SUPPORTING_TEXT: 'ncua-floating-notification__supporting-text',
|
|
24
|
+
ACTIONS: 'ncua-floating-notification__actions',
|
|
25
|
+
CLOSE_BUTTON: 'ncua-floating-notification__close-button',
|
|
26
|
+
},
|
|
27
|
+
MESSAGE: {
|
|
28
|
+
BASE: 'ncua-message-notification',
|
|
29
|
+
CONTAINER: 'ncua-message-notification__container',
|
|
30
|
+
CONTENT: 'ncua-message-notification__content',
|
|
31
|
+
CONTENT_WRAPPER: 'ncua-message-notification__content-wrapper',
|
|
32
|
+
ICON: 'ncua-message-notification__icon',
|
|
33
|
+
TEXT_CONTAINER: 'ncua-message-notification__text-container',
|
|
34
|
+
TITLE: 'ncua-message-notification__title',
|
|
35
|
+
SUPPORTING_TEXT: 'ncua-message-notification__supporting-text',
|
|
36
|
+
ACTIONS_CONTAINER: 'ncua-message-notification__actions-container',
|
|
37
|
+
ACTIONS: 'ncua-message-notification__actions',
|
|
38
|
+
HIDE_LINK: 'ncua-message-notification__hide-link',
|
|
39
|
+
CLOSE_BUTTON: 'ncua-message-notification__close-button',
|
|
40
|
+
},
|
|
41
|
+
COMMON: {
|
|
42
|
+
ACTION_BUTTON: 'ncua-notification__action-button',
|
|
43
|
+
},
|
|
44
|
+
};
|