@nova-design-system/nova-react 3.12.0 → 3.14.0-beta.0
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/README.md +27 -58
- package/dist/cjs/collapse.animation-6e0b08df-AHWzNGm_.js +217 -0
- package/dist/cjs/{constants-a857c476-Cj2b-su0.js → constants-69bafca2-DpB_ghPF.js} +14 -0
- package/dist/cjs/fade.animation-9b939939-DV--bM4S.js +724 -0
- package/dist/cjs/{index-jBgPO7HC.js → index-CJDePE8Z.js} +2322 -1657
- package/dist/cjs/index.js +14 -1
- package/dist/cjs/{nv-accordion-item.entry-BUb_Apy8.js → nv-accordion-item.entry-Begcz9SZ.js} +75 -40
- package/dist/cjs/nv-accordion.entry-DQAkheHY.js +179 -0
- package/dist/cjs/{nv-alert.entry-nzJu8E5h.js → nv-alert.entry-CEzR0iu0.js} +21 -20
- package/dist/cjs/{nv-avatar.entry-BPp1d-QO.js → nv-avatar.entry-B-u7r30l.js} +8 -7
- package/dist/cjs/{nv-badge_2.entry-Bk56p4jv.js → nv-badge_2.entry-0vhTS5D7.js} +15 -14
- package/dist/cjs/{nv-breadcrumb.entry-DB3zR7FC.js → nv-breadcrumb.entry-BkWs1x-W.js} +2 -1
- package/dist/cjs/{nv-breadcrumbs.entry-CoGgEsro.js → nv-breadcrumbs.entry-DglL-1Ed.js} +2 -1
- package/dist/cjs/{nv-button.entry-psZ3_t6i.js → nv-button.entry-BbT0aeQI.js} +8 -7
- package/dist/cjs/{nv-buttongroup.entry-cNenBx1F.js → nv-buttongroup.entry-wlJma4qm.js} +2 -1
- package/dist/cjs/{nv-calendar.entry-nkrORr_V.js → nv-calendar.entry-wIPDRk0B.js} +21 -16
- package/dist/cjs/{nv-col.entry-D4mInxLU.js → nv-col.entry-Btsenp2c.js} +2 -1
- package/dist/cjs/{nv-datagrid.entry-D50O7eyc.js → nv-datagrid.entry-Dae8YlRu.js} +7 -6
- package/dist/cjs/{nv-datagridcolumn.entry-BuGX-3ev.js → nv-datagridcolumn.entry-D918Vo_U.js} +2 -1
- package/dist/cjs/{nv-dialog.entry-yiZIq-TV.js → nv-dialog.entry--cGTlgDZ.js} +4 -3
- package/dist/cjs/{nv-dialogfooter_2.entry-C9ykJQK6.js → nv-dialogfooter_2.entry-CXYjGHc5.js} +11 -7
- package/dist/cjs/{nv-fieldcheckbox.entry-CCRvvFJ3.js → nv-fieldcheckbox.entry-9b_kDQGz.js} +3 -2
- package/dist/cjs/{nv-fielddate.entry-C4k6k980.js → nv-fielddate.entry-CRRTthds.js} +2 -1
- package/dist/cjs/{nv-fielddaterange.entry-BhfV2KCd.js → nv-fielddaterange.entry-BAVePsLs.js} +2 -1
- package/dist/cjs/{nv-fielddropdown.entry-Xkkvl_gb.js → nv-fielddropdown.entry-Dy8sZyze.js} +2 -1
- package/dist/cjs/{nv-fielddropdownitem.entry-Ckwq6k6r.js → nv-fielddropdownitem.entry-CuPocgsF.js} +2 -1
- package/dist/cjs/{nv-fieldmultiselect.entry-D4PgRSFv.js → nv-fieldmultiselect.entry-HWSDowQH.js} +2 -31
- package/dist/cjs/{nv-fieldnumber.entry-BEnJ81XX.js → nv-fieldnumber.entry-fObgOYJX.js} +3 -2
- package/dist/cjs/{nv-fieldpassword.entry-elzveqP8.js → nv-fieldpassword.entry-BRhKH_Mb.js} +2 -1
- package/dist/cjs/{nv-fieldradio.entry-xJpdsXGo.js → nv-fieldradio.entry-D74Mlgjc.js} +2 -1
- package/dist/cjs/{nv-fieldselect.entry-DVyO7LMD.js → nv-fieldselect.entry-BS81ItZs.js} +2 -1
- package/dist/cjs/{nv-fieldslider.entry-O4TFO-Rl.js → nv-fieldslider.entry-xyqrZxYj.js} +26 -17
- package/dist/cjs/{nv-fieldtext.entry-p-9GEp1g.js → nv-fieldtext.entry-BVUKbv4b.js} +2 -1
- package/dist/cjs/{nv-fieldtextarea.entry-Cvik8cci.js → nv-fieldtextarea.entry-B7hb1so-.js} +2 -1
- package/dist/cjs/{nv-fieldtime.entry-mnsDon9M.js → nv-fieldtime.entry-DvCbKaOO.js} +61 -60
- package/dist/cjs/nv-icon.entry-DP715dyH.js +80 -0
- package/dist/cjs/{nv-iconbutton_2.entry-M5EY3-1s.js → nv-iconbutton_2.entry-FpzwxZe_.js} +2 -1
- package/dist/cjs/{nv-menu.entry-D7bORqXp.js → nv-menu.entry-ryMNpTHW.js} +2 -1
- package/dist/cjs/{nv-menuitem.entry-CaN6qNoB.js → nv-menuitem.entry-SQBrWIYf.js} +2 -1
- package/dist/cjs/nv-notification.entry-DnCew-lG.js +262 -0
- package/dist/cjs/nv-notificationcontainer.entry-Dwlv9s1v.js +41 -0
- package/dist/cjs/{nv-popover.entry-DGeXSyhZ.js → nv-popover.entry-DOu6rhco.js} +10 -9
- package/dist/cjs/{nv-row.entry-B17DsCjM.js → nv-row.entry-Tx_yvWTJ.js} +3 -2
- package/dist/cjs/{nv-stack.entry-Dv3YU4nJ.js → nv-stack.entry-Cn0JrM2N.js} +3 -2
- package/dist/cjs/{nv-table.entry-BILyG-43.js → nv-table.entry-D-uKGKnp.js} +4 -3
- package/dist/cjs/{nv-tablecolumn.entry-II6Z_gdO.js → nv-tablecolumn.entry-BsJzXKCk.js} +2 -1
- package/dist/cjs/{nv-toggle.entry-5Wmww2Cd.js → nv-toggle.entry-DuDRh-Ww.js} +4 -3
- package/dist/cjs/{nv-togglebutton.entry-Dnmfrj0O.js → nv-togglebutton.entry-DAlky3tO.js} +3 -2
- package/dist/cjs/{nv-togglebuttongroup.entry-C9mplQcb.js → nv-togglebuttongroup.entry-DTadjqMQ.js} +3 -2
- package/dist/cjs/{nv-tooltip.entry-CcUQrjAv.js → nv-tooltip.entry-BWzlP6gC.js} +3 -2
- package/dist/cjs/{stylefire.es-74da334a-y0piPjlz.js → style-value-types.es-f5d10b79-D0QCM8OB.js} +50 -694
- package/dist/cjs/{timeline.animation-adf35ecb-CE6Dsdxr.js → timeline.animation-79215cd4-KteJaZPb.js} +19 -0
- package/dist/generated/components.js +16 -0
- package/dist/generated/components.server.js +25 -1
- package/dist/index.js +1 -0
- package/dist/providers/NotificationProvider.js +83 -0
- package/dist/types/generated/components.d.ts +8 -0
- package/dist/types/generated/components.server.d.ts +8 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/providers/NotificationProvider.d.ts +36 -0
- package/package.json +4 -1
- package/dist/cjs/collapse.animation-16e3af45-CChx_tQJ.js +0 -84
- package/dist/cjs/fade.animation-71e8e34c-BAw_TYsB.js +0 -68
- package/dist/cjs/nv-accordion.entry-hi3M0POV.js +0 -164
- package/dist/cjs/nv-icon.entry-CrgnozDL.js +0 -79
package/dist/cjs/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-CJDePE8Z.js');
|
|
4
4
|
require('react');
|
|
5
|
+
require('react-dom');
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
|
|
@@ -43,6 +44,15 @@ Object.defineProperty(exports, "LoaderColors", {
|
|
|
43
44
|
enumerable: true,
|
|
44
45
|
get: function () { return index.LoaderColors; }
|
|
45
46
|
});
|
|
47
|
+
Object.defineProperty(exports, "NotificationEmphasis", {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
get: function () { return index.NotificationEmphasis; }
|
|
50
|
+
});
|
|
51
|
+
Object.defineProperty(exports, "NotificationPosition", {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
get: function () { return index.NotificationPosition; }
|
|
54
|
+
});
|
|
55
|
+
exports.NotificationProvider = index.NotificationProvider;
|
|
46
56
|
exports.NvAccordion = index.NvAccordion;
|
|
47
57
|
exports.NvAccordionItem = index.NvAccordionItem;
|
|
48
58
|
exports.NvAlert = index.NvAlert;
|
|
@@ -79,6 +89,8 @@ exports.NvIconbutton = index.NvIconbutton;
|
|
|
79
89
|
exports.NvLoader = index.NvLoader;
|
|
80
90
|
exports.NvMenu = index.NvMenu;
|
|
81
91
|
exports.NvMenuitem = index.NvMenuitem;
|
|
92
|
+
exports.NvNotification = index.NvNotification;
|
|
93
|
+
exports.NvNotificationcontainer = index.NvNotificationcontainer;
|
|
82
94
|
exports.NvPopover = index.NvPopover;
|
|
83
95
|
exports.NvRow = index.NvRow;
|
|
84
96
|
exports.NvStack = index.NvStack;
|
|
@@ -114,3 +126,4 @@ Object.defineProperty(exports, "ToggleButtonSize", {
|
|
|
114
126
|
});
|
|
115
127
|
exports.WEEK_ABBREVIATIONS = index.WEEK_ABBREVIATIONS;
|
|
116
128
|
exports.defineCustomElements = index.defineCustomElements;
|
|
129
|
+
exports.useNotifications = index.useNotifications;
|
package/dist/cjs/{nv-accordion-item.entry-BUb_Apy8.js → nv-accordion-item.entry-Begcz9SZ.js}
RENAMED
|
@@ -1,27 +1,37 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var
|
|
5
|
-
require('./
|
|
3
|
+
var index = require('./index-CJDePE8Z.js');
|
|
4
|
+
var collapse_animation6e0b08df = require('./collapse.animation-6e0b08df-AHWzNGm_.js');
|
|
5
|
+
require('./style-value-types.es-f5d10b79-D0QCM8OB.js');
|
|
6
6
|
require('react');
|
|
7
|
+
require('react-dom');
|
|
7
8
|
|
|
8
|
-
const nvAccordionItemCss = "nv-accordion-item{display:block;border-bottom:var(--spacing-px) solid var(--color-content-low-border)}nv-accordion-item:last-child{border-bottom:none}nv-accordion-item .nv-accordion-item__header{cursor:pointer;display:flex;align-items:center;justify-content:space-between;padding:var(--spacing-4)}nv-accordion-item .nv-accordion-item__header .nv-accordion-item__chevron{margin-left:var(--spacing-2);flex-shrink:0}nv-accordion-item .nv-accordion-item__header .nv-accordion-item__header-content{display:flex;flex-direction:column;gap:var(--spacing-0-5);flex:1;min-width:0}nv-accordion-item .nv-accordion-item__header .nv-accordion-item__title{color:var(--color-content-high-text);font-size:var(--font-size-lg);font-style:normal;font-weight:var(--font-weight-medium-emphasis);line-height:var(--line-height-lg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}nv-accordion-item .nv-accordion-item__header .nv-accordion-item__subtitle{color:var(--color-content-low-text);font-size:var(--font-size-md);font-style:normal;font-weight:var(--font-weight-medium-emphasis);line-height:var(--line-height-base);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}nv-accordion-item .nv-accordion-item__content{background:var(--color-level-10-background)}nv-accordion-item .nv-accordion-item__content .nv-accordion-item__content-inner{padding:var(--spacing-4);color:var(--color-content-low-text);font-size:var(--font-size-md);font-style:normal;font-weight:500;line-height:var(--line-height-base);}nv-accordion-item.is-disabled{opacity:var(--opacity-disabled);pointer-events:none}nv-accordion-item.is-open .nv-accordion-item__header{border-bottom:var(--spacing-px) solid var(--color-content-low-border)}";
|
|
9
|
+
const nvAccordionItemCss = "nv-accordion-item{display:block;border-bottom:var(--spacing-px) solid var(--color-content-low-border)}nv-accordion-item:last-child{border-bottom:none}nv-accordion-item .nv-accordion-item__header{cursor:pointer;display:flex;align-items:center;justify-content:space-between;padding:var(--spacing-4)}nv-accordion-item .nv-accordion-item__header .nv-accordion-item__chevron{margin-left:var(--spacing-2);flex-shrink:0}nv-accordion-item .nv-accordion-item__header .nv-accordion-item__header-content{display:flex;flex-direction:column;gap:var(--spacing-0-5);flex:1;min-width:0}nv-accordion-item .nv-accordion-item__header .nv-accordion-item__title{color:var(--color-content-high-text);font-size:var(--font-size-lg);font-style:normal;font-weight:var(--font-weight-medium-emphasis);line-height:var(--line-height-lg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}nv-accordion-item .nv-accordion-item__header .nv-accordion-item__subtitle{color:var(--color-content-low-text);font-size:var(--font-size-md);font-style:normal;font-weight:var(--font-weight-medium-emphasis);line-height:var(--line-height-base);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}nv-accordion-item .nv-accordion-item__content{background:var(--color-level-10-background)}nv-accordion-item .nv-accordion-item__content .nv-accordion-item__content-inner{padding:var(--spacing-4);color:var(--color-content-low-text);font-size:var(--font-size-md);font-style:normal;font-weight:500;line-height:var(--line-height-base);}nv-accordion-item.is-disabled{opacity:var(--opacity-disabled);pointer-events:none}nv-accordion-item.is-open .nv-accordion-item__header{border-bottom:var(--spacing-px) solid var(--color-content-low-border)}nv-accordion-item:last-child .nv-accordion-item__content{border-radius:0 0 calc(var(--radius-rounded-lg) - var(--spacing-px)) calc(var(--radius-rounded-lg) - var(--spacing-px))}";
|
|
9
10
|
const NvAccordionItemStyle0 = nvAccordionItemCss;
|
|
10
11
|
|
|
11
12
|
const NvAccordionItem = class {
|
|
12
13
|
constructor(hostRef) {
|
|
13
14
|
index.registerInstance(this, hostRef);
|
|
14
15
|
this.itemToggle = index.createEvent(this, "itemToggle");
|
|
15
|
-
|
|
16
|
+
this.isToggling = false;
|
|
17
|
+
/**
|
|
18
|
+
* Open or closed
|
|
19
|
+
*/
|
|
16
20
|
this.open = false;
|
|
17
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Disables the item
|
|
23
|
+
*/
|
|
18
24
|
this.disabled = false;
|
|
19
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Parent expansion mode (accordion or multi)
|
|
27
|
+
*/
|
|
20
28
|
this.mode = 'accordion';
|
|
21
29
|
//#endregion EVENTS
|
|
22
30
|
/****************************************************************************/
|
|
23
31
|
//#region STATE
|
|
24
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Internal state for open/close rendering
|
|
34
|
+
*/
|
|
25
35
|
this.currentOpenState = false;
|
|
26
36
|
/**
|
|
27
37
|
* Controls if the panel has been initialized for animations
|
|
@@ -42,7 +52,7 @@ const NvAccordionItem = class {
|
|
|
42
52
|
* @param {Event} e - Click event
|
|
43
53
|
*/
|
|
44
54
|
this.handleIconClick = (e) => {
|
|
45
|
-
e.stopPropagation();
|
|
55
|
+
e.stopPropagation();
|
|
46
56
|
this.toggle();
|
|
47
57
|
};
|
|
48
58
|
/**
|
|
@@ -50,8 +60,10 @@ const NvAccordionItem = class {
|
|
|
50
60
|
* @param {KeyboardEvent} e - Keyboard event
|
|
51
61
|
*/
|
|
52
62
|
this.handleHeaderKeyDown = (e) => {
|
|
53
|
-
if (this.disabled)
|
|
63
|
+
if (this.disabled) {
|
|
64
|
+
console.warn('[handleHeaderKeyDown] Ignored (disabled)');
|
|
54
65
|
return;
|
|
66
|
+
}
|
|
55
67
|
switch (e.key) {
|
|
56
68
|
case 'Enter':
|
|
57
69
|
case ' ':
|
|
@@ -61,17 +73,19 @@ const NvAccordionItem = class {
|
|
|
61
73
|
case 'ArrowDown':
|
|
62
74
|
e.preventDefault();
|
|
63
75
|
if (!this.open) {
|
|
76
|
+
this.isToggling = true;
|
|
64
77
|
this.open = true;
|
|
65
|
-
this.itemToggle.emit(
|
|
66
|
-
this.
|
|
78
|
+
this.itemToggle.emit(true);
|
|
79
|
+
this.isToggling = false;
|
|
67
80
|
}
|
|
68
81
|
break;
|
|
69
82
|
case 'ArrowUp':
|
|
70
83
|
e.preventDefault();
|
|
71
84
|
if (this.open) {
|
|
85
|
+
this.isToggling = true;
|
|
72
86
|
this.open = false;
|
|
73
|
-
this.itemToggle.emit(
|
|
74
|
-
this.
|
|
87
|
+
this.itemToggle.emit(false);
|
|
88
|
+
this.isToggling = false;
|
|
75
89
|
}
|
|
76
90
|
break;
|
|
77
91
|
}
|
|
@@ -81,12 +95,23 @@ const NvAccordionItem = class {
|
|
|
81
95
|
/****************************************************************************/
|
|
82
96
|
//#region WATCHERS
|
|
83
97
|
async onOpenChanged(newValue, oldValue) {
|
|
84
|
-
this.
|
|
85
|
-
|
|
86
|
-
|
|
98
|
+
if (this.disabled) {
|
|
99
|
+
console.warn('[onOpenChanged] Item is disabled, forcing closed state');
|
|
100
|
+
this.currentOpenState = false;
|
|
101
|
+
this.open = false;
|
|
87
102
|
return;
|
|
88
103
|
}
|
|
89
|
-
|
|
104
|
+
this.currentOpenState = newValue;
|
|
105
|
+
const isInitialRender = oldValue === undefined;
|
|
106
|
+
if (!isInitialRender) {
|
|
107
|
+
if (newValue === false && !this.isToggling) {
|
|
108
|
+
this.itemToggle.emit(newValue);
|
|
109
|
+
}
|
|
110
|
+
else if (newValue && !this.isToggling) {
|
|
111
|
+
this.itemToggle.emit(newValue);
|
|
112
|
+
}
|
|
113
|
+
await this.updateVisibility(newValue);
|
|
114
|
+
}
|
|
90
115
|
}
|
|
91
116
|
//#endregion WATCHERS
|
|
92
117
|
/****************************************************************************/
|
|
@@ -96,18 +121,18 @@ const NvAccordionItem = class {
|
|
|
96
121
|
* @param {boolean} open - Whether the accordion item should be open
|
|
97
122
|
*/
|
|
98
123
|
async updateVisibility(open) {
|
|
99
|
-
if (!this.contentRef)
|
|
124
|
+
if (!this.contentRef) {
|
|
125
|
+
console.error('[updateVisibility] No contentRef available');
|
|
100
126
|
return;
|
|
127
|
+
}
|
|
101
128
|
this.isAnimating = true;
|
|
102
|
-
const { collapse, expand } =
|
|
129
|
+
const { collapse, expand } = collapse_animation6e0b08df.useCollapse(this.contentRef, {
|
|
103
130
|
duration: 200,
|
|
104
131
|
});
|
|
105
132
|
if (open) {
|
|
106
|
-
// Expand with animation
|
|
107
133
|
await expand();
|
|
108
134
|
}
|
|
109
135
|
else {
|
|
110
|
-
// Collapse with animation
|
|
111
136
|
await collapse();
|
|
112
137
|
}
|
|
113
138
|
this.isAnimating = false;
|
|
@@ -116,19 +141,24 @@ const NvAccordionItem = class {
|
|
|
116
141
|
/****************************************************************************/
|
|
117
142
|
//#region LIFECYCLE
|
|
118
143
|
componentWillLoad() {
|
|
119
|
-
this.currentOpenState = this.open;
|
|
144
|
+
this.currentOpenState = this.open;
|
|
120
145
|
}
|
|
121
146
|
componentDidLoad() {
|
|
122
147
|
if (this.contentRef) {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
148
|
+
setTimeout(() => {
|
|
149
|
+
const { setExpanded, setCollapsed } = collapse_animation6e0b08df.useCollapse(this.contentRef, {
|
|
150
|
+
duration: 200,
|
|
151
|
+
});
|
|
152
|
+
if (this.open) {
|
|
153
|
+
setExpanded();
|
|
154
|
+
this.currentOpenState = true;
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
setCollapsed();
|
|
158
|
+
this.currentOpenState = false;
|
|
159
|
+
}
|
|
160
|
+
this.isInitialized = true;
|
|
161
|
+
}, 0);
|
|
132
162
|
}
|
|
133
163
|
}
|
|
134
164
|
disconnectedCallback() {
|
|
@@ -144,10 +174,14 @@ const NvAccordionItem = class {
|
|
|
144
174
|
*/
|
|
145
175
|
async toggle() {
|
|
146
176
|
if (!this.disabled && !this.isAnimating) {
|
|
147
|
-
this.
|
|
148
|
-
this.
|
|
149
|
-
|
|
150
|
-
|
|
177
|
+
this.isToggling = true;
|
|
178
|
+
const newOpen = !this.open;
|
|
179
|
+
this.open = newOpen;
|
|
180
|
+
this.itemToggle.emit(newOpen);
|
|
181
|
+
this.isToggling = false;
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
console.warn('[toggle] Ignored toggle (disabled or animating)');
|
|
151
185
|
}
|
|
152
186
|
}
|
|
153
187
|
/**
|
|
@@ -155,18 +189,19 @@ const NvAccordionItem = class {
|
|
|
155
189
|
* @returns {string} The icon name to display in the chevron button
|
|
156
190
|
*/
|
|
157
191
|
get chevronIconName() {
|
|
158
|
-
|
|
192
|
+
const name = this.open ? 'chevron-top' : 'chevron-down';
|
|
193
|
+
return name;
|
|
159
194
|
}
|
|
160
195
|
//#endregion METHODS
|
|
161
196
|
/****************************************************************************/
|
|
162
197
|
//#region RENDER
|
|
163
198
|
render() {
|
|
164
|
-
return (index.h(index.Host, { key: '
|
|
199
|
+
return (index.h(index.Host, { key: '4d5ae52ba3e8cac86316d790f95afd39f6c73019', class: {
|
|
165
200
|
'nv-accordion-item': true,
|
|
166
|
-
'is-open': this.
|
|
201
|
+
'is-open': this.currentOpenState,
|
|
167
202
|
'is-disabled': this.disabled,
|
|
168
203
|
'is-animating': this.isAnimating,
|
|
169
|
-
}, role: "listitem", "aria-expanded": this.
|
|
204
|
+
}, role: "listitem", "aria-expanded": this.currentOpenState ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false' }, index.h("div", { key: '866562d2f3033189e6d5df8fa5576d2f1540959e', class: "nv-accordion-item__header", onClick: this.handleHeaderClick, "aria-controls": "content" }, index.h("slot", { key: '36d2b14528c6bd6665ccfc94707d62dc406262d0', name: "header" }, index.h("div", { key: 'c78c1e485d0128708db6fc5fb2b64c6c01e4ed0f', class: "nv-accordion-item__header-content" }, this.itemTitle && (index.h("span", { key: '524cf377a4c89752eeed1933dbb8fd2343cd8830', class: "nv-accordion-item__title" }, this.itemTitle)), this.subtitle && (index.h("span", { key: 'b8ee5edc3c798218348490fc43c458c45934ee83', class: "nv-accordion-item__subtitle" }, this.subtitle)))), index.h("nv-iconbutton", { key: 'aa474788bb5551ca7b94261dca1ccb2e5aced3d3', emphasis: "low", size: "sm", shape: "square", name: this.chevronIconName, tabindex: this.disabled ? -1 : 0, onClick: this.handleIconClick, onKeyDown: this.handleHeaderKeyDown, "aria-controls": "content", "aria-label": this.currentOpenState ? 'Close the section' : 'Open the section' })), index.h("div", { key: '3b49afd97cc797b165a8fa6753f564349735aad1', id: "content", class: "nv-accordion-item__content", ref: el => (this.contentRef = el) }, index.h("div", { key: '955b5c7cef3259a2531ecc14eafb806a9d28c9a6', class: "nv-accordion-item__content-inner" }, index.h("slot", { key: '56ff89e2041d425f520fe6e62975bbb7193653f2', name: "content" })))));
|
|
170
205
|
}
|
|
171
206
|
get el() { return index.getElement(this); }
|
|
172
207
|
static get watchers() { return {
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-CJDePE8Z.js');
|
|
4
|
+
require('react');
|
|
5
|
+
require('react-dom');
|
|
6
|
+
|
|
7
|
+
const nvAccordionCss = "nv-accordion{display:block;border:var(--spacing-px) solid var(--color-content-low-border);border-radius:var(--radius-rounded-lg)}nv-accordion .nv-accordion__footer{padding:var(--spacing-3);background:var(--color-level-05-background);border-radius:0 0 var(--radius-rounded-lg) var(--radius-rounded-lg);margin-top:calc(var(--spacing-px) * -1);border-top:var(--spacing-px) solid var(--color-content-low-border)}nv-accordion .nv-accordion__footer:empty{display:none}";
|
|
8
|
+
const NvAccordionStyle0 = nvAccordionCss;
|
|
9
|
+
|
|
10
|
+
const NvAccordion = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
index.registerInstance(this, hostRef);
|
|
13
|
+
this.openChanged = index.createEvent(this, "openChanged");
|
|
14
|
+
/****************************************************************************/
|
|
15
|
+
//#region PROPERTIES
|
|
16
|
+
/**
|
|
17
|
+
* Data to display as a list of items (title, subtitle, content).
|
|
18
|
+
*/
|
|
19
|
+
this.data = [];
|
|
20
|
+
/**
|
|
21
|
+
* Expansion mode: 'accordion' (single open) or 'multi' (multiple open)
|
|
22
|
+
*/
|
|
23
|
+
this.mode = 'accordion';
|
|
24
|
+
/**
|
|
25
|
+
* Index of open items (external control possible)
|
|
26
|
+
*/
|
|
27
|
+
this.openIndexes = [];
|
|
28
|
+
//#endregion PROPERTIES
|
|
29
|
+
/****************************************************************************/
|
|
30
|
+
//#region STATE
|
|
31
|
+
this.updatingFromInternal = false;
|
|
32
|
+
}
|
|
33
|
+
//#endregion EVENTS
|
|
34
|
+
/****************************************************************************/
|
|
35
|
+
//#region METHODS
|
|
36
|
+
/**
|
|
37
|
+
* Opens an item by its index (Public API)
|
|
38
|
+
* @param {number} index Index of the item to open
|
|
39
|
+
*/
|
|
40
|
+
async open(index) {
|
|
41
|
+
this.toggleItem(index, true);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Closes an item by its index (Public API)
|
|
45
|
+
* @param {number} index Index of the item to close
|
|
46
|
+
*/
|
|
47
|
+
async close(index) {
|
|
48
|
+
this.toggleItem(index, false);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Toggles an item's state (internal)
|
|
52
|
+
* @param {number} index Item index
|
|
53
|
+
* @param {boolean} [forceOpen] Force open (true) or close (false)
|
|
54
|
+
*/
|
|
55
|
+
toggleItem(index, forceOpen) {
|
|
56
|
+
const items = Array.from(this.el.querySelectorAll('nv-accordion-item'));
|
|
57
|
+
const item = items[index];
|
|
58
|
+
if (!item || item.disabled) {
|
|
59
|
+
console.warn('[toggleItem] Item not found or disabled:', index);
|
|
60
|
+
this.openChanged.emit({ openIndexes: [...(this.openIndexes || [])] });
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
let openIndexes = [...(this.openIndexes || [])];
|
|
64
|
+
const isOpen = openIndexes.includes(index);
|
|
65
|
+
if (this.mode === 'accordion') {
|
|
66
|
+
openIndexes =
|
|
67
|
+
forceOpen === false || (forceOpen === undefined && isOpen)
|
|
68
|
+
? []
|
|
69
|
+
: [index];
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
if (forceOpen === false) {
|
|
73
|
+
openIndexes = openIndexes.filter(i => i !== index);
|
|
74
|
+
}
|
|
75
|
+
else if (forceOpen === true && !isOpen) {
|
|
76
|
+
openIndexes.push(index);
|
|
77
|
+
}
|
|
78
|
+
else if (forceOpen === undefined) {
|
|
79
|
+
openIndexes = isOpen
|
|
80
|
+
? openIndexes.filter(i => i !== index)
|
|
81
|
+
: [...openIndexes, index];
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
this.updatingFromInternal = true;
|
|
85
|
+
this.openIndexes = [...openIndexes];
|
|
86
|
+
this.updateChildrenState();
|
|
87
|
+
this.updatingFromInternal = false;
|
|
88
|
+
this.openChanged.emit({ openIndexes: [...openIndexes] });
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Updates the open state of child elements based on openIndexes
|
|
92
|
+
*/
|
|
93
|
+
async updateChildrenState() {
|
|
94
|
+
const items = Array.from(this.el.querySelectorAll('nv-accordion-item'));
|
|
95
|
+
items.forEach((item, i) => {
|
|
96
|
+
const shouldBeOpen = (this.openIndexes || []).includes(i);
|
|
97
|
+
item.open = shouldBeOpen;
|
|
98
|
+
item.mode = this.mode;
|
|
99
|
+
item.setAttribute('aria-expanded', shouldBeOpen ? 'true' : 'false');
|
|
100
|
+
index.forceUpdate(item);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Listens to itemToggle events from nv-accordion-item elements
|
|
105
|
+
* @param {CustomEvent<boolean>} event Event emitted by nv-accordion-item
|
|
106
|
+
*/
|
|
107
|
+
onItemToggle(event) {
|
|
108
|
+
if (this.updatingFromInternal) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const items = Array.from(this.el.querySelectorAll('nv-accordion-item'));
|
|
112
|
+
const targetItem = event.target;
|
|
113
|
+
const index = items.indexOf(targetItem);
|
|
114
|
+
if (index !== -1) {
|
|
115
|
+
this.toggleItem(index, event.detail);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
console.warn('[onItemToggle] Target item not found in items list');
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
//#endregion METHODS
|
|
122
|
+
/****************************************************************************/
|
|
123
|
+
//#region WATCHERS
|
|
124
|
+
onOpenIndexesChange(newValue, oldValue) {
|
|
125
|
+
if (!this.updatingFromInternal &&
|
|
126
|
+
newValue !== undefined &&
|
|
127
|
+
newValue !== oldValue) {
|
|
128
|
+
this.updateChildrenState();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
onModeChange() {
|
|
132
|
+
this.updateChildrenState();
|
|
133
|
+
}
|
|
134
|
+
//#endregion WATCHERS
|
|
135
|
+
/****************************************************************************/
|
|
136
|
+
//#region LIFECYCLE
|
|
137
|
+
componentWillLoad() {
|
|
138
|
+
if (this.openIndexes === undefined) {
|
|
139
|
+
this.openIndexes = [];
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
async componentDidLoad() {
|
|
143
|
+
var _a;
|
|
144
|
+
const items = Array.from(this.el.querySelectorAll('nv-accordion-item'));
|
|
145
|
+
// Only initialize openIndexes from child items if no data is provided and openIndexes is not explicitly set
|
|
146
|
+
if (!((_a = this.data) === null || _a === void 0 ? void 0 : _a.length) &&
|
|
147
|
+
(!this.openIndexes || this.openIndexes.length === 0)) {
|
|
148
|
+
const childOpenIndexes = items
|
|
149
|
+
.map((item, i) => (item.hasAttribute('open') || item.open ? i : -1))
|
|
150
|
+
.filter(i => i !== -1);
|
|
151
|
+
if (childOpenIndexes.length > 0) {
|
|
152
|
+
this.updatingFromInternal = true;
|
|
153
|
+
this.openIndexes = [...childOpenIndexes];
|
|
154
|
+
this.updatingFromInternal = false;
|
|
155
|
+
this.openChanged.emit({ openIndexes: [...this.openIndexes] });
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
// Ensure children are in sync with current openIndexes state
|
|
159
|
+
await this.updateChildrenState();
|
|
160
|
+
}
|
|
161
|
+
//#endregion LIFECYCLE
|
|
162
|
+
/****************************************************************************/
|
|
163
|
+
//#region RENDER
|
|
164
|
+
render() {
|
|
165
|
+
var _a;
|
|
166
|
+
return (index.h(index.Host, { key: 'b5c36f19bcbd0d06e9d924ae6f9630b8b6cae05a', role: "list", class: "nv-accordion" }, ((_a = this.data) === null || _a === void 0 ? void 0 : _a.length) ? (this.data.map((item, i) => {
|
|
167
|
+
var _a;
|
|
168
|
+
return (index.h("nv-accordion-item", { key: (_a = item.id) !== null && _a !== void 0 ? _a : i, itemTitle: item.title, disabled: item.disabled, open: (this.openIndexes || []).includes(i), mode: this.mode }, item.subtitle ? (index.h("div", { slot: "header" }, index.h("div", { class: "nv-accordion-item__header-content" }, index.h("span", { class: "nv-accordion-item__title" }, item.title), index.h("span", { class: "nv-accordion-item__subtitle" }, item.subtitle)))) : null, index.h("div", { slot: "content" }, item.content), item.footer && index.h("div", { slot: "footer" }, item.footer)));
|
|
169
|
+
})) : (index.h("slot", null))));
|
|
170
|
+
}
|
|
171
|
+
get el() { return index.getElement(this); }
|
|
172
|
+
static get watchers() { return {
|
|
173
|
+
"openIndexes": ["onOpenIndexesChange"],
|
|
174
|
+
"mode": ["onModeChange"]
|
|
175
|
+
}; }
|
|
176
|
+
};
|
|
177
|
+
NvAccordion.style = NvAccordionStyle0;
|
|
178
|
+
|
|
179
|
+
exports.nv_accordion = NvAccordion;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-CJDePE8Z.js');
|
|
4
4
|
var clsx297c1ffe = require('./clsx-297c1ffe-BtxeOLZW.js');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
require('./
|
|
9
|
-
var
|
|
5
|
+
var constants69bafca2 = require('./constants-69bafca2-DpB_ghPF.js');
|
|
6
|
+
var collapse_animation6e0b08df = require('./collapse.animation-6e0b08df-AHWzNGm_.js');
|
|
7
|
+
var fade_animation9b939939 = require('./fade.animation-9b939939-DV--bM4S.js');
|
|
8
|
+
require('./style-value-types.es-f5d10b79-D0QCM8OB.js');
|
|
9
|
+
var timeline_animation79215cd4 = require('./timeline.animation-79215cd4-KteJaZPb.js');
|
|
10
10
|
require('react');
|
|
11
|
+
require('react-dom');
|
|
11
12
|
|
|
12
|
-
const nvAlertCss = "nv-alert{display:flex !important;align-items:flex-start;position:relative;gap:var(--alert-gap-x);border-radius:var(--alert-radius);font-family:\"TT Norms Pro\", \"Montserrat\", sans-serif}nv-alert>nv-icon{margin-left:var(--alert-icon-position-x);margin-top:var(--alert-icon-position-y)}nv-alert.hidden{display:none !important}nv-alert.feedback-information{background-color:var(--components-alert-information-background);border:1px solid var(--components-alert-information-border) !important}nv-alert.feedback-information>.close:focus,nv-alert.feedback-information>.close:focus-within{outline:none}nv-alert.feedback-information>.close:focus-visible,nv-alert.feedback-information>.close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-alert-information-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-alert.feedback-warning{background-color:var(--components-alert-warning-background);border:1px solid var(--components-alert-warning-border) !important}nv-alert.feedback-warning>.close:focus,nv-alert.feedback-warning>.close:focus-within{outline:none}nv-alert.feedback-warning>.close:focus-visible,nv-alert.feedback-warning>.close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-alert-warning-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-alert.feedback-error{background-color:var(--components-alert-error-background);border:1px solid var(--components-alert-error-border) !important}nv-alert.feedback-error>.close:focus,nv-alert.feedback-error>.close:focus-within{outline:none}nv-alert.feedback-error>.close:focus-visible,nv-alert.feedback-error>.close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-alert-error-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-alert.feedback-success{background-color:var(--components-alert-success-background);border:1px solid var(--components-alert-success-border) !important}nv-alert.feedback-success>.close:focus,nv-alert.feedback-success>.close:focus-within{outline:none}nv-alert.feedback-success>.close:focus-visible,nv-alert.feedback-success>.close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-alert-success-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-alert.feedback-neutral{background-color:var(--components-alert-neutral-background);border:1px solid var(--components-alert-neutral-border) !important}nv-alert.feedback-neutral>.close:focus,nv-alert.feedback-neutral>.close:focus-within{outline:none}nv-alert.feedback-neutral>.close:focus-visible,nv-alert.feedback-neutral>.close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-alert-neutral-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-alert>nv-icon.icon-information{color:var(--components-alert-information-icon)}nv-alert>nv-icon.icon-warning{color:var(--components-alert-warning-icon)}nv-alert>nv-icon.icon-error{color:var(--components-alert-error-icon)}nv-alert>nv-icon.icon-success{color:var(--components-alert-success-icon)}nv-alert>nv-icon.icon-neutral{color:var(--components-alert-neutral-icon)}nv-alert>.content{display:flex;padding:var(--alert-padding);padding-right:calc(var(--alert-padding) + var(--
|
|
13
|
+
const nvAlertCss = "nv-alert{display:flex !important;align-items:flex-start;position:relative;gap:var(--alert-gap-x);border-radius:var(--alert-radius);font-family:\"TT Norms Pro\", \"Montserrat\", sans-serif}nv-alert>nv-icon{margin-left:var(--alert-icon-position-x);margin-top:var(--alert-icon-position-y)}nv-alert.hidden{display:none !important}nv-alert.feedback-information{background-color:var(--components-alert-information-background);border:1px solid var(--components-alert-information-border) !important}nv-alert.feedback-information>.close:focus,nv-alert.feedback-information>.close:focus-within{outline:none}nv-alert.feedback-information>.close:focus-visible,nv-alert.feedback-information>.close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-alert-information-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-alert.feedback-warning{background-color:var(--components-alert-warning-background);border:1px solid var(--components-alert-warning-border) !important}nv-alert.feedback-warning>.close:focus,nv-alert.feedback-warning>.close:focus-within{outline:none}nv-alert.feedback-warning>.close:focus-visible,nv-alert.feedback-warning>.close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-alert-warning-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-alert.feedback-error{background-color:var(--components-alert-error-background);border:1px solid var(--components-alert-error-border) !important}nv-alert.feedback-error>.close:focus,nv-alert.feedback-error>.close:focus-within{outline:none}nv-alert.feedback-error>.close:focus-visible,nv-alert.feedback-error>.close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-alert-error-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-alert.feedback-success{background-color:var(--components-alert-success-background);border:1px solid var(--components-alert-success-border) !important}nv-alert.feedback-success>.close:focus,nv-alert.feedback-success>.close:focus-within{outline:none}nv-alert.feedback-success>.close:focus-visible,nv-alert.feedback-success>.close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-alert-success-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-alert.feedback-neutral{background-color:var(--components-alert-neutral-background);border:1px solid var(--components-alert-neutral-border) !important}nv-alert.feedback-neutral>.close:focus,nv-alert.feedback-neutral>.close:focus-within{outline:none}nv-alert.feedback-neutral>.close:focus-visible,nv-alert.feedback-neutral>.close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-alert-neutral-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-alert>nv-icon.icon-information{color:var(--components-alert-information-icon)}nv-alert>nv-icon.icon-warning{color:var(--components-alert-warning-icon)}nv-alert>nv-icon.icon-error{color:var(--components-alert-error-icon)}nv-alert>nv-icon.icon-success{color:var(--components-alert-success-icon)}nv-alert>nv-icon.icon-neutral{color:var(--components-alert-neutral-icon)}nv-alert>.content{display:flex;padding:var(--alert-padding);padding-right:calc(var(--alert-padding) + var(--spacing-5) + var(--spacing-1));padding-left:0;flex-direction:column;gap:var(--alert-gap-y)}nv-alert>.content>.heading{color:var(--components-alert-content-title);font-size:var(--alert-heading-font-size);line-height:var(--alert-heading-line-height);font-weight:var(--alert-heading-font-weight)}nv-alert>.content>.message{color:var(--components-alert-content-description);font-size:var(--alert-message-font-size);line-height:var(--alert-message-line-height)}nv-alert>.close{border-radius:var(--alert-radius);position:absolute;display:flex;top:var(--alert-icon-position-y);right:var(--alert-icon-position-x);padding:0;border:none;background:none;cursor:pointer}";
|
|
13
14
|
const NvAlertStyle0 = nvAlertCss;
|
|
14
15
|
|
|
15
16
|
const NvAlert = class {
|
|
@@ -63,15 +64,15 @@ const NvAlert = class {
|
|
|
63
64
|
*/
|
|
64
65
|
this.getDefaultIcon = () => {
|
|
65
66
|
switch (this.feedback) {
|
|
66
|
-
case
|
|
67
|
+
case constants69bafca2.FeedbackColors.Warning:
|
|
67
68
|
return 'alert-circle';
|
|
68
|
-
case
|
|
69
|
+
case constants69bafca2.FeedbackColors.Information:
|
|
69
70
|
return 'info-circle';
|
|
70
|
-
case
|
|
71
|
+
case constants69bafca2.FeedbackColors.Success:
|
|
71
72
|
return 'circle-check';
|
|
72
|
-
case
|
|
73
|
+
case constants69bafca2.FeedbackColors.Error:
|
|
73
74
|
return 'alert-circle';
|
|
74
|
-
case
|
|
75
|
+
case constants69bafca2.FeedbackColors.Neutral:
|
|
75
76
|
return 'help';
|
|
76
77
|
default:
|
|
77
78
|
return 'info-circle';
|
|
@@ -117,15 +118,15 @@ const NvAlert = class {
|
|
|
117
118
|
this.toggleHiddenClass(hidden);
|
|
118
119
|
return;
|
|
119
120
|
}
|
|
120
|
-
const { fadeIn, fadeOut } =
|
|
121
|
-
const { collapse, expand } =
|
|
121
|
+
const { fadeIn, fadeOut } = fade_animation9b939939.useFade(this.el, { duration: 150 });
|
|
122
|
+
const { collapse, expand } = collapse_animation6e0b08df.useCollapse(this.el, { duration: 250 });
|
|
122
123
|
if (hidden) {
|
|
123
|
-
await
|
|
124
|
+
await timeline_animation79215cd4.timeline(fadeOut, collapse).start();
|
|
124
125
|
this.toggleHiddenClass(true);
|
|
125
126
|
}
|
|
126
127
|
else {
|
|
127
128
|
this.toggleHiddenClass(false);
|
|
128
|
-
await
|
|
129
|
+
await timeline_animation79215cd4.timeline(expand, fadeIn).start();
|
|
129
130
|
}
|
|
130
131
|
}
|
|
131
132
|
/**
|
|
@@ -133,7 +134,7 @@ const NvAlert = class {
|
|
|
133
134
|
* @param {boolean} hidden - Whether to add or remove the hidden class
|
|
134
135
|
*/
|
|
135
136
|
toggleHiddenClass(hidden) {
|
|
136
|
-
this.
|
|
137
|
+
this.el.classList.toggle('hidden', hidden);
|
|
137
138
|
}
|
|
138
139
|
//#endregion METHODS
|
|
139
140
|
/****************************************************************************/
|
|
@@ -155,7 +156,7 @@ const NvAlert = class {
|
|
|
155
156
|
}
|
|
156
157
|
}
|
|
157
158
|
if (this.hidden) {
|
|
158
|
-
this.
|
|
159
|
+
this.el.classList.add('hidden');
|
|
159
160
|
}
|
|
160
161
|
}
|
|
161
162
|
//#endregion LIFECYCLE
|
|
@@ -163,9 +164,9 @@ const NvAlert = class {
|
|
|
163
164
|
//#region RENDER
|
|
164
165
|
render() {
|
|
165
166
|
var _a;
|
|
166
|
-
return (index.h(index.Host, { key: '
|
|
167
|
+
return (index.h(index.Host, { key: '08bc48f1d9bba66505e46fb26b8400f185dcc716', role: "alert", class: clsx297c1ffe.clsx('root', `feedback-${this.feedback}`) }, index.h("nv-icon", { key: 'b4846e6aee8cf6cfde913372b11675a3c0301fa3', name: (_a = this.icon) !== null && _a !== void 0 ? _a : this.getDefaultIcon(), class: `icon-${this.feedback}`, size: "md" }), index.h("div", { key: '61edadca039963056bdf27914829286515269a4a', class: "content" }, this.heading && index.h("p", { key: '25c0396ade2573a9f955302cfe52702fe5e4f531', class: "heading" }, this.heading), this.message && index.h("p", { key: 'dbef6eac9028f5431bb9665ca5642af5278c20d7', class: "message" }, this.message), index.h("slot", { key: '5aa607cb7c48783371887fd9126b247647e8b37c' })), this.dismissible && (index.h("button", { key: 'e6be3501788f12fac97c162c0ed64c922acd4b22', class: "close", type: "button", onClick: this.handleDismiss }, index.h("nv-icon", { key: 'f39c94a6cf82226eb77143bce7b4d74aff30c05a', name: "x", size: "sm" })))));
|
|
167
168
|
}
|
|
168
|
-
get
|
|
169
|
+
get el() { return index.getElement(this); }
|
|
169
170
|
static get watchers() { return {
|
|
170
171
|
"hidden": ["handleHiddenChange"]
|
|
171
172
|
}; }
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-CJDePE8Z.js');
|
|
4
4
|
var clsx297c1ffe = require('./clsx-297c1ffe-BtxeOLZW.js');
|
|
5
|
-
var
|
|
5
|
+
var constants69bafca2 = require('./constants-69bafca2-DpB_ghPF.js');
|
|
6
6
|
require('react');
|
|
7
|
+
require('react-dom');
|
|
7
8
|
|
|
8
9
|
const nvAvatarCss = "nv-avatar{align-items:center !important;background-color:var(--components-avatar-background-1);border-radius:var(--radius-rounded-full) !important;display:flex !important;flex-shrink:0 !important;font-family:\"TT Norms Pro\", sans-serif;font-style:normal;font-weight:var(--font-weight-medium-emphasis);justify-content:center !important;leading-trim:both;line-height:1 !important;text-align:center;text-edge:cap;text-transform:uppercase}nv-avatar.avatar-color-1{background-color:var(--components-avatar-background-1);color:var(--components-avatar-content-1)}nv-avatar.avatar-color-2{background-color:var(--components-avatar-background-2);color:var(--components-avatar-content-2)}nv-avatar.avatar-color-3{background-color:var(--components-avatar-background-3);color:var(--components-avatar-content-3)}nv-avatar.avatar-color-4{background-color:var(--components-avatar-background-4);color:var(--components-avatar-content-4)}nv-avatar.avatar-color-5{background-color:var(--components-avatar-background-5);color:var(--components-avatar-content-5)}nv-avatar.avatar-color-6{background-color:var(--components-avatar-background-6);color:var(--components-avatar-content-6)}nv-avatar.avatar-color-7{background-color:var(--components-avatar-background-7);color:var(--components-avatar-content-7)}nv-avatar.avatar-color-8{background-color:var(--components-avatar-background-8);color:var(--components-avatar-content-8)}nv-avatar.avatar-color-9{background-color:var(--components-avatar-background-9);color:var(--components-avatar-content-9)}nv-avatar.avatar-color-10{background-color:var(--components-avatar-background-10);color:var(--components-avatar-content-10)}nv-avatar img{height:100%;width:100%;object-fit:cover;object-position:center;border-radius:50%}nv-avatar.avatar-xs{width:var(--avatar-xs-size);height:var(--avatar-xs-size);font-size:var(--avatar-xs-font-size);line-height:var(--avatar-xs-font-size)}nv-avatar.avatar-xs nv-icon>svg{width:var(--spacing-3);height:var(--spacing-3);stroke-width:1.2px}nv-avatar.avatar-sm{width:var(--avatar-sm-size);height:var(--avatar-sm-size);font-size:var(--avatar-sm-font-size);line-height:var(--avatar-sm-font-size)}nv-avatar.avatar-sm nv-icon>svg{width:var(--spacing-4);height:var(--spacing-4);stroke-width:1.5px}nv-avatar.avatar-md{width:var(--avatar-md-size);height:var(--avatar-md-size);font-size:var(--avatar-md-font-size);line-height:var(--avatar-md-font-size)}nv-avatar.avatar-md nv-icon>svg{width:var(--spacing-5);height:var(--spacing-5);stroke-width:1.6px}nv-avatar.avatar-lg{width:var(--avatar-lg-size);height:var(--avatar-lg-size);font-size:var(--avatar-lg-font-size);line-height:var(--avatar-lg-font-size)}nv-avatar.avatar-lg nv-icon>svg{width:var(--spacing-6);height:var(--spacing-6);stroke-width:1.8px}nv-avatar.avatar-xl{width:var(--avatar-xl-size);height:var(--avatar-xl-size);font-size:var(--avatar-xl-font-size);line-height:var(--avatar-xl-font-size)}nv-avatar.avatar-xl nv-icon>svg{width:var(--spacing-7);height:var(--spacing-7);stroke-width:1.9px}";
|
|
9
10
|
const NvAvatarStyle0 = nvAvatarCss;
|
|
@@ -23,19 +24,19 @@ const NvAvatar = class {
|
|
|
23
24
|
}
|
|
24
25
|
componentWillRender() {
|
|
25
26
|
if (this.xsmall) {
|
|
26
|
-
this.size =
|
|
27
|
+
this.size = constants69bafca2.SemanticSizes.ExtraSmall;
|
|
27
28
|
}
|
|
28
29
|
if (this.small) {
|
|
29
|
-
this.size =
|
|
30
|
+
this.size = constants69bafca2.SemanticSizes.Small;
|
|
30
31
|
}
|
|
31
32
|
if (this.medium) {
|
|
32
|
-
this.size =
|
|
33
|
+
this.size = constants69bafca2.SemanticSizes.Medium;
|
|
33
34
|
}
|
|
34
35
|
if (this.large) {
|
|
35
|
-
this.size =
|
|
36
|
+
this.size = constants69bafca2.SemanticSizes.Large;
|
|
36
37
|
}
|
|
37
38
|
if (this.xlarge) {
|
|
38
|
-
this.size =
|
|
39
|
+
this.size = constants69bafca2.SemanticSizes.ExtraLarge;
|
|
39
40
|
}
|
|
40
41
|
if (this.text) {
|
|
41
42
|
this.initials = this.text;
|