@nova-design-system/nova-react 3.14.0 → 3.16.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/dist/cjs/{collapse.animation-acda1bf5-BuORVmQv.js → collapse.animation-6e0b08df-AHWzNGm_.js} +4 -1
- package/dist/cjs/{constants-d0f19e7b-s0SCO_vi.js → constants-69bafca2-DpB_ghPF.js} +9 -0
- package/dist/cjs/{fade.animation-eb454088-Bma0SpTf.js → fade.animation-9b939939-DV--bM4S.js} +2 -2
- package/dist/cjs/{index-CKAZvszR.js → index-7K7BV1CP.js} +4676 -1345
- package/dist/cjs/index.js +10 -2
- package/dist/cjs/{nv-accordion-item.entry-CjBcmF8t.js → nv-accordion-item.entry-C-9tYw-c.js} +6 -5
- package/dist/cjs/{nv-accordion.entry-CRk2Wvt3.js → nv-accordion.entry-BA3mTIdj.js} +7 -6
- package/dist/cjs/{nv-alert.entry-D5qB5xZg.js → nv-alert.entry-Bic-YGW1.js} +13 -12
- package/dist/cjs/nv-avatar.entry-C-yd0YlD.js +68 -0
- package/dist/cjs/{nv-badge_2.entry-BDuX1qOQ.js → nv-badge_2.entry-B_8yvNXL.js} +11 -10
- package/dist/cjs/{nv-breadcrumb.entry-BE9U6AF_.js → nv-breadcrumb.entry-BCTbG942.js} +3 -2
- package/dist/cjs/{nv-breadcrumbs.entry-DJXqtmMR.js → nv-breadcrumbs.entry-C9B5Baf7.js} +2 -1
- package/dist/cjs/nv-button.entry-DgX8Bwmq.js +165 -0
- package/dist/cjs/{nv-buttongroup.entry-C0Zc2lOi.js → nv-buttongroup.entry-CKhZN_Yf.js} +2 -1
- package/dist/cjs/{nv-calendar.entry-NbVLStMN.js → nv-calendar.entry-E6Pk83WA.js} +8 -7
- package/dist/cjs/{nv-col.entry-ahFf8a1Z.js → nv-col.entry-CkZpukX9.js} +2 -1
- package/dist/cjs/{nv-datagrid.entry-C-MJXEdi.js → nv-datagrid.entry-RsfP7vbC.js} +183 -15
- package/dist/cjs/{nv-datagridcolumn.entry-CxU7soW7.js → nv-datagridcolumn.entry-D4VrDWo9.js} +2 -1
- package/dist/cjs/{nv-dialog.entry-WlnaC-w2.js → nv-dialog.entry-BhtWpYHl.js} +34 -30
- package/dist/cjs/{nv-dialogfooter_2.entry-CEWmTnJc.js → nv-dialogfooter_2.entry-BXLYmzYl.js} +6 -5
- package/dist/cjs/{nv-fieldcheckbox.entry-BYhFVrYb.js → nv-fieldcheckbox.entry-D96Nm6DZ.js} +3 -2
- package/dist/cjs/{nv-fielddate.entry-DVVnRiOT.js → nv-fielddate.entry-ty37R9jF.js} +52 -26
- package/dist/cjs/{nv-fielddaterange.entry-Cb4X5Q-C.js → nv-fielddaterange.entry-BSIRu_mq.js} +69 -42
- package/dist/cjs/{nv-fielddropdown.entry-D2PKGkpx.js → nv-fielddropdown.entry-CUzvIoZZ.js} +34 -7
- package/dist/cjs/{nv-fielddropdownitem.entry-BqgMRnIc.js → nv-fielddropdownitem.entry-D-GTxLNk.js} +2 -1
- package/dist/cjs/{nv-fieldmultiselect.entry-Dzw4c9wO.js → nv-fieldmultiselect.entry-DFY2bf6s.js} +188 -156
- package/dist/cjs/{nv-fieldnumber.entry-Cm5g6tw7.js → nv-fieldnumber.entry-CILclJ7Q.js} +3 -2
- package/dist/cjs/{nv-fieldpassword.entry-BMI5M4RR.js → nv-fieldpassword.entry-CdR-NM8e.js} +3 -2
- package/dist/cjs/{nv-fieldradio.entry-BrCJvkMR.js → nv-fieldradio.entry-lC4scIvU.js} +3 -2
- package/dist/cjs/{nv-fieldselect.entry-Cz76Y4Fb.js → nv-fieldselect.entry-CYu6870F.js} +3 -2
- package/dist/cjs/{nv-fieldslider.entry-C2ynnMK8.js → nv-fieldslider.entry-DOuJAR6P.js} +3 -2
- package/dist/cjs/{nv-fieldtext.entry-B6ciu2fU.js → nv-fieldtext.entry-BFLUiPa4.js} +3 -2
- package/dist/cjs/{nv-fieldtextarea.entry-BL_gMvTp.js → nv-fieldtextarea.entry-BeI0k97G.js} +3 -2
- package/dist/cjs/{nv-fieldtime.entry-Be5fujXA.js → nv-fieldtime.entry-C28EAKki.js} +82 -68
- package/dist/cjs/nv-icon.entry-BXgjUpe_.js +80 -0
- package/dist/cjs/{nv-iconbutton_2.entry-Dlk96yHi.js → nv-iconbutton_2.entry-CpIkxrp9.js} +3 -2
- package/dist/cjs/{nv-menu.entry-CDn1Tk9J.js → nv-menu.entry-as-NOsF-.js} +25 -9
- package/dist/cjs/{nv-menuitem.entry-DIkQnha9.js → nv-menuitem.entry-D8KAh6nr.js} +2 -1
- package/dist/cjs/nv-notification.entry-C-_jV-DL.js +262 -0
- package/dist/cjs/nv-notificationcontainer.entry-CMn42loT.js +41 -0
- package/dist/cjs/{nv-popover.entry-Bz9ZWGlN.js → nv-popover.entry--BhEBSir.js} +72 -65
- package/dist/cjs/{nv-row.entry-iJGXINmZ.js → nv-row.entry-BxhcK9aY.js} +3 -2
- package/dist/cjs/{nv-stack.entry-CifEjR2g.js → nv-stack.entry-C3DF9jJZ.js} +3 -2
- package/dist/cjs/nv-table.entry-pfEGt2KH.js +245 -0
- package/dist/cjs/nv-toggle.entry-ChpqtQtn.js +80 -0
- package/dist/cjs/{nv-togglebutton.entry-X4eLeP-C.js → nv-togglebutton.entry-DE7CKmeN.js} +3 -2
- package/dist/cjs/{nv-togglebuttongroup.entry-BYO58vql.js → nv-togglebuttongroup.entry-BJPjdmHD.js} +3 -2
- package/dist/cjs/{nv-tooltip.entry-DaxjQSt1.js → nv-tooltip.entry-D9-Fga6C.js} +3 -2
- package/dist/components/NvDatatable.js +45 -0
- package/dist/generated/components.js +10 -10
- package/dist/generated/components.server.js +9 -17
- package/dist/index.js +2 -0
- package/dist/providers/NotificationProvider.js +83 -0
- package/dist/types/components/NvDatatable.d.ts +25 -0
- package/dist/types/generated/components.d.ts +5 -12
- package/dist/types/generated/components.server.d.ts +5 -12
- package/dist/types/index.d.ts +2 -0
- package/dist/types/providers/NotificationProvider.d.ts +36 -0
- package/package.json +7 -3
- package/dist/cjs/dom.utils-ac71e0ef-CmIwRr6O.js +0 -168
- package/dist/cjs/nv-avatar.entry-CuNYdZl_.js +0 -67
- package/dist/cjs/nv-button.entry-CF5IDcG3.js +0 -164
- package/dist/cjs/nv-icon.entry-C-wbfOy3.js +0 -79
- package/dist/cjs/nv-notification.entry-BiwnZCkF.js +0 -178
- package/dist/cjs/nv-table.entry-Dxg0j3fe.js +0 -338
- package/dist/cjs/nv-tablecolumn.entry--29MFEe9.js +0 -18
- package/dist/cjs/nv-toggle.entry-D0eQoEqf.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-7K7BV1CP.js');
|
|
4
4
|
require('react');
|
|
5
|
+
require('react-dom');
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
|
|
@@ -47,6 +48,11 @@ Object.defineProperty(exports, "NotificationEmphasis", {
|
|
|
47
48
|
enumerable: true,
|
|
48
49
|
get: function () { return index.NotificationEmphasis; }
|
|
49
50
|
});
|
|
51
|
+
Object.defineProperty(exports, "NotificationPosition", {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
get: function () { return index.NotificationPosition; }
|
|
54
|
+
});
|
|
55
|
+
exports.NotificationProvider = index.NotificationProvider;
|
|
50
56
|
exports.NvAccordion = index.NvAccordion;
|
|
51
57
|
exports.NvAccordionItem = index.NvAccordionItem;
|
|
52
58
|
exports.NvAlert = index.NvAlert;
|
|
@@ -60,6 +66,7 @@ exports.NvCalendar = index.NvCalendar;
|
|
|
60
66
|
exports.NvCol = index.NvCol;
|
|
61
67
|
exports.NvDatagrid = index.NvDatagrid;
|
|
62
68
|
exports.NvDatagridcolumn = index.NvDatagridcolumn;
|
|
69
|
+
exports.NvDatatable = index.NvDatatable;
|
|
63
70
|
exports.NvDialog = index.NvDialog;
|
|
64
71
|
exports.NvDialogfooter = index.NvDialogfooter;
|
|
65
72
|
exports.NvDialogheader = index.NvDialogheader;
|
|
@@ -84,11 +91,11 @@ exports.NvLoader = index.NvLoader;
|
|
|
84
91
|
exports.NvMenu = index.NvMenu;
|
|
85
92
|
exports.NvMenuitem = index.NvMenuitem;
|
|
86
93
|
exports.NvNotification = index.NvNotification;
|
|
94
|
+
exports.NvNotificationcontainer = index.NvNotificationcontainer;
|
|
87
95
|
exports.NvPopover = index.NvPopover;
|
|
88
96
|
exports.NvRow = index.NvRow;
|
|
89
97
|
exports.NvStack = index.NvStack;
|
|
90
98
|
exports.NvTable = index.NvTable;
|
|
91
|
-
exports.NvTablecolumn = index.NvTablecolumn;
|
|
92
99
|
exports.NvToggle = index.NvToggle;
|
|
93
100
|
exports.NvTogglebutton = index.NvTogglebutton;
|
|
94
101
|
exports.NvTogglebuttongroup = index.NvTogglebuttongroup;
|
|
@@ -119,3 +126,4 @@ Object.defineProperty(exports, "ToggleButtonSize", {
|
|
|
119
126
|
});
|
|
120
127
|
exports.WEEK_ABBREVIATIONS = index.WEEK_ABBREVIATIONS;
|
|
121
128
|
exports.defineCustomElements = index.defineCustomElements;
|
|
129
|
+
exports.useNotifications = index.useNotifications;
|
package/dist/cjs/{nv-accordion-item.entry-CjBcmF8t.js → nv-accordion-item.entry-C-9tYw-c.js}
RENAMED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var
|
|
3
|
+
var index = require('./index-7K7BV1CP.js');
|
|
4
|
+
var collapse_animation6e0b08df = require('./collapse.animation-6e0b08df-AHWzNGm_.js');
|
|
5
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:
|
|
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:var(--font-weight-medium-emphasis);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 {
|
|
@@ -125,7 +126,7 @@ const NvAccordionItem = class {
|
|
|
125
126
|
return;
|
|
126
127
|
}
|
|
127
128
|
this.isAnimating = true;
|
|
128
|
-
const { collapse, expand } =
|
|
129
|
+
const { collapse, expand } = collapse_animation6e0b08df.useCollapse(this.contentRef, {
|
|
129
130
|
duration: 200,
|
|
130
131
|
});
|
|
131
132
|
if (open) {
|
|
@@ -145,7 +146,7 @@ const NvAccordionItem = class {
|
|
|
145
146
|
componentDidLoad() {
|
|
146
147
|
if (this.contentRef) {
|
|
147
148
|
setTimeout(() => {
|
|
148
|
-
const { setExpanded, setCollapsed } =
|
|
149
|
+
const { setExpanded, setCollapsed } = collapse_animation6e0b08df.useCollapse(this.contentRef, {
|
|
149
150
|
duration: 200,
|
|
150
151
|
});
|
|
151
152
|
if (this.open) {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-7K7BV1CP.js');
|
|
4
4
|
require('react');
|
|
5
|
+
require('react-dom');
|
|
5
6
|
|
|
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}";
|
|
7
8
|
const NvAccordionStyle0 = nvAccordionCss;
|
|
@@ -9,7 +10,7 @@ const NvAccordionStyle0 = nvAccordionCss;
|
|
|
9
10
|
const NvAccordion = class {
|
|
10
11
|
constructor(hostRef) {
|
|
11
12
|
index.registerInstance(this, hostRef);
|
|
12
|
-
this.
|
|
13
|
+
this.openIndexesChanged = index.createEvent(this, "openIndexesChanged");
|
|
13
14
|
/****************************************************************************/
|
|
14
15
|
//#region PROPERTIES
|
|
15
16
|
/**
|
|
@@ -56,7 +57,7 @@ const NvAccordion = class {
|
|
|
56
57
|
const item = items[index];
|
|
57
58
|
if (!item || item.disabled) {
|
|
58
59
|
console.warn('[toggleItem] Item not found or disabled:', index);
|
|
59
|
-
this.
|
|
60
|
+
this.openIndexesChanged.emit([...(this.openIndexes || [])]);
|
|
60
61
|
return;
|
|
61
62
|
}
|
|
62
63
|
let openIndexes = [...(this.openIndexes || [])];
|
|
@@ -84,7 +85,7 @@ const NvAccordion = class {
|
|
|
84
85
|
this.openIndexes = [...openIndexes];
|
|
85
86
|
this.updateChildrenState();
|
|
86
87
|
this.updatingFromInternal = false;
|
|
87
|
-
this.
|
|
88
|
+
this.openIndexesChanged.emit([...openIndexes]);
|
|
88
89
|
}
|
|
89
90
|
/**
|
|
90
91
|
* Updates the open state of child elements based on openIndexes
|
|
@@ -151,7 +152,7 @@ const NvAccordion = class {
|
|
|
151
152
|
this.updatingFromInternal = true;
|
|
152
153
|
this.openIndexes = [...childOpenIndexes];
|
|
153
154
|
this.updatingFromInternal = false;
|
|
154
|
-
this.
|
|
155
|
+
this.openIndexesChanged.emit([...this.openIndexes]);
|
|
155
156
|
}
|
|
156
157
|
}
|
|
157
158
|
// Ensure children are in sync with current openIndexes state
|
|
@@ -162,7 +163,7 @@ const NvAccordion = class {
|
|
|
162
163
|
//#region RENDER
|
|
163
164
|
render() {
|
|
164
165
|
var _a;
|
|
165
|
-
return (index.h(index.Host, { key: '
|
|
166
|
+
return (index.h(index.Host, { key: 'b7fa476c7830d6c5715ce53e42ad37253942e0e1', role: "list", class: "nv-accordion" }, ((_a = this.data) === null || _a === void 0 ? void 0 : _a.length) ? (this.data.map((item, i) => {
|
|
166
167
|
var _a;
|
|
167
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)));
|
|
168
169
|
})) : (index.h("slot", null))));
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-7K7BV1CP.js');
|
|
4
4
|
var clsx297c1ffe = require('./clsx-297c1ffe-BtxeOLZW.js');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
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
8
|
require('./style-value-types.es-f5d10b79-D0QCM8OB.js');
|
|
9
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
|
|
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:var(--font-family-default), var(--font-family-fallback), 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,8 +118,8 @@ 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
124
|
await timeline_animation79215cd4.timeline(fadeOut, collapse).start();
|
|
124
125
|
this.toggleHiddenClass(true);
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-7K7BV1CP.js');
|
|
4
|
+
var clsx297c1ffe = require('./clsx-297c1ffe-BtxeOLZW.js');
|
|
5
|
+
var constants69bafca2 = require('./constants-69bafca2-DpB_ghPF.js');
|
|
6
|
+
require('react');
|
|
7
|
+
require('react-dom');
|
|
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:var(--font-family-default), var(--font-family-fallback), 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}";
|
|
10
|
+
const NvAvatarStyle0 = nvAvatarCss;
|
|
11
|
+
|
|
12
|
+
const NvAvatar = class {
|
|
13
|
+
constructor(hostRef) {
|
|
14
|
+
index.registerInstance(this, hostRef);
|
|
15
|
+
/**
|
|
16
|
+
* Define the size of the avatar. You can use t-shirt sizes.
|
|
17
|
+
*/
|
|
18
|
+
this.size = 'md';
|
|
19
|
+
/**
|
|
20
|
+
* You can apply different colors on the Avatar.
|
|
21
|
+
* Use a string number between 1 and 10.
|
|
22
|
+
*/
|
|
23
|
+
this.color = '1';
|
|
24
|
+
}
|
|
25
|
+
componentWillRender() {
|
|
26
|
+
if (this.xsmall) {
|
|
27
|
+
this.size = constants69bafca2.SemanticSizes.ExtraSmall;
|
|
28
|
+
}
|
|
29
|
+
if (this.small) {
|
|
30
|
+
this.size = constants69bafca2.SemanticSizes.Small;
|
|
31
|
+
}
|
|
32
|
+
if (this.medium) {
|
|
33
|
+
this.size = constants69bafca2.SemanticSizes.Medium;
|
|
34
|
+
}
|
|
35
|
+
if (this.large) {
|
|
36
|
+
this.size = constants69bafca2.SemanticSizes.Large;
|
|
37
|
+
}
|
|
38
|
+
if (this.xlarge) {
|
|
39
|
+
this.size = constants69bafca2.SemanticSizes.ExtraLarge;
|
|
40
|
+
}
|
|
41
|
+
if (this.text) {
|
|
42
|
+
this.initials = this.text;
|
|
43
|
+
}
|
|
44
|
+
if (this.url) {
|
|
45
|
+
this.src = this.url;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//#endregion PROPERTIES
|
|
49
|
+
/****************************************************************************/
|
|
50
|
+
//#region METHODS
|
|
51
|
+
/**
|
|
52
|
+
* Makes sure the initials are trimmed to 2 letters.
|
|
53
|
+
* @param {string} initials - The initials to be trimmed.
|
|
54
|
+
* @returns {string} The trimmed initials.
|
|
55
|
+
*/
|
|
56
|
+
trimInitials(initials) {
|
|
57
|
+
return initials.trim().substring(0, 2);
|
|
58
|
+
}
|
|
59
|
+
//#endregion METHODS
|
|
60
|
+
/****************************************************************************/
|
|
61
|
+
//#region RENDER
|
|
62
|
+
render() {
|
|
63
|
+
return (index.h(index.Host, { key: '127d470eb9121f611f9e18f029ab9ef15a4a49df', class: clsx297c1ffe.clsx(`avatar-${this.size}`, `avatar-color-${this.color}`), "aria-label": this.alt }, this.src ? (index.h("img", { src: this.src, alt: this.alt })) : this.initials ? (this.trimInitials(this.initials)) : (index.h("slot", { name: "icon" }, index.h("nv-icon", { name: "user" })))));
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
NvAvatar.style = NvAvatarStyle0;
|
|
67
|
+
|
|
68
|
+
exports.nv_avatar = NvAvatar;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-7K7BV1CP.js');
|
|
4
4
|
var clsx297c1ffe = require('./clsx-297c1ffe-BtxeOLZW.js');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var collapse_animation6e0b08df = require('./collapse.animation-6e0b08df-AHWzNGm_.js');
|
|
6
|
+
var fade_animation9b939939 = require('./fade.animation-9b939939-DV--bM4S.js');
|
|
7
7
|
require('./style-value-types.es-f5d10b79-D0QCM8OB.js');
|
|
8
8
|
var timeline_animation79215cd4 = require('./timeline.animation-79215cd4-KteJaZPb.js');
|
|
9
9
|
require('react');
|
|
10
|
+
require('react-dom');
|
|
10
11
|
|
|
11
12
|
const nvBadgeCss = "nv-badge{padding:var(--badge-padding-y) var(--badge-padding-x);display:inline-flex !important;gap:var(--badge-gap-x);vertical-align:middle;align-items:center;border-radius:var(--radius-rounded-full);border-style:solid;border-width:0.5px;height:fit-content;width:fit-content}nv-badge.is-icon-only{padding:var(--badge-padding-y) var(--badge-padding-icon-only-x);gap:var(--badge-gap-icon-only-x)}nv-badge.with-gap{padding:var(--badge-padding-y) var(--badge-padding-x);display:inline-flex !important;gap:var(--badge-gap-x);vertical-align:middle;align-items:center;border-radius:var(--radius-rounded-full);border-style:solid;border-width:0.5px;height:fit-content;width:fit-content}nv-badge.with-gap.is-icon-only{padding:var(--badge-padding-y) var(--badge-padding-icon-only-x);gap:var(--badge-gap-icon-only-x)}nv-badge.visually-hidden{position:absolute;padding:0;border:0;overflow:hidden;white-space:nowrap;width:1px;height:1px;margin:-1px;clip:rect(0, 0, 0, 0)}nv-badge:not(.with-gap){padding:var(--badge-padding-y) var(--badge-padding-x);display:inline-flex !important;gap:var(--badge-gap-x);vertical-align:middle;align-items:center;border-radius:var(--radius-rounded-full);border-style:solid;border-width:0.5px;height:fit-content;width:fit-content}nv-badge:not(.with-gap).is-icon-only{padding:var(--badge-padding-y) var(--badge-padding-icon-only-x);gap:var(--badge-gap-icon-only-x)}nv-badge.badge-1{color:var(--color-rainbow-1-text);background-color:var(--color-rainbow-1-background);border-color:var(--color-rainbow-1-border)}nv-badge.badge-1 .close:focus,nv-badge.badge-1 .close:focus-within{outline:none}nv-badge.badge-1 .close:focus-visible,nv-badge.badge-1 .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-rainbow-1-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-1 nv-icon{color:var(--color-rainbow-1-icon)}nv-badge.badge-2{color:var(--color-rainbow-2-text);background-color:var(--color-rainbow-2-background);border-color:var(--color-rainbow-2-border)}nv-badge.badge-2 .close:focus,nv-badge.badge-2 .close:focus-within{outline:none}nv-badge.badge-2 .close:focus-visible,nv-badge.badge-2 .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-rainbow-2-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-2 nv-icon{color:var(--color-rainbow-2-icon)}nv-badge.badge-3{color:var(--color-rainbow-3-text);background-color:var(--color-rainbow-3-background);border-color:var(--color-rainbow-3-border)}nv-badge.badge-3 .close:focus,nv-badge.badge-3 .close:focus-within{outline:none}nv-badge.badge-3 .close:focus-visible,nv-badge.badge-3 .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-rainbow-3-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-3 nv-icon{color:var(--color-rainbow-3-icon)}nv-badge.badge-4{color:var(--color-rainbow-4-text);background-color:var(--color-rainbow-4-background);border-color:var(--color-rainbow-4-border)}nv-badge.badge-4 .close:focus,nv-badge.badge-4 .close:focus-within{outline:none}nv-badge.badge-4 .close:focus-visible,nv-badge.badge-4 .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-rainbow-4-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-4 nv-icon{color:var(--color-rainbow-4-icon)}nv-badge.badge-5{color:var(--color-rainbow-5-text);background-color:var(--color-rainbow-5-background);border-color:var(--color-rainbow-5-border)}nv-badge.badge-5 .close:focus,nv-badge.badge-5 .close:focus-within{outline:none}nv-badge.badge-5 .close:focus-visible,nv-badge.badge-5 .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-rainbow-5-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-5 nv-icon{color:var(--color-rainbow-5-icon)}nv-badge.badge-6{color:var(--color-rainbow-6-text);background-color:var(--color-rainbow-6-background);border-color:var(--color-rainbow-6-border)}nv-badge.badge-6 .close:focus,nv-badge.badge-6 .close:focus-within{outline:none}nv-badge.badge-6 .close:focus-visible,nv-badge.badge-6 .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-rainbow-6-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-6 nv-icon{color:var(--color-rainbow-6-icon)}nv-badge.badge-7{color:var(--color-rainbow-7-text);background-color:var(--color-rainbow-7-background);border-color:var(--color-rainbow-7-border)}nv-badge.badge-7 .close:focus,nv-badge.badge-7 .close:focus-within{outline:none}nv-badge.badge-7 .close:focus-visible,nv-badge.badge-7 .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-rainbow-7-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-7 nv-icon{color:var(--color-rainbow-7-icon)}nv-badge.badge-8{color:var(--color-rainbow-8-text);background-color:var(--color-rainbow-8-background);border-color:var(--color-rainbow-8-border)}nv-badge.badge-8 .close:focus,nv-badge.badge-8 .close:focus-within{outline:none}nv-badge.badge-8 .close:focus-visible,nv-badge.badge-8 .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-rainbow-8-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-8 nv-icon{color:var(--color-rainbow-8-icon)}nv-badge.badge-9{color:var(--color-rainbow-9-text);background-color:var(--color-rainbow-9-background);border-color:var(--color-rainbow-9-border)}nv-badge.badge-9 .close:focus,nv-badge.badge-9 .close:focus-within{outline:none}nv-badge.badge-9 .close:focus-visible,nv-badge.badge-9 .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-rainbow-9-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-9 nv-icon{color:var(--color-rainbow-9-icon)}nv-badge.badge-10{color:var(--color-rainbow-10-text);background-color:var(--color-rainbow-10-background);border-color:var(--color-rainbow-10-border)}nv-badge.badge-10 .close:focus,nv-badge.badge-10 .close:focus-within{outline:none}nv-badge.badge-10 .close:focus-visible,nv-badge.badge-10 .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-rainbow-10-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-10 nv-icon{color:var(--color-rainbow-10-icon)}nv-badge.badge-error{color:var(--color-feedback-error-low-text);background-color:var(--color-feedback-error-low-background);border-color:var(--color-feedback-error-low-border)}nv-badge.badge-error .close:focus,nv-badge.badge-error .close:focus-within{outline:none}nv-badge.badge-error .close:focus-visible,nv-badge.badge-error .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-feedback-error-low-content, var(--color-feedback-error-low-text));outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-error nv-icon{color:var(--color-feedback-error-low-icon)}nv-badge.badge-information{color:var(--color-feedback-information-low-text);background-color:var(--color-feedback-information-low-background);border-color:var(--color-feedback-information-low-border)}nv-badge.badge-information .close:focus,nv-badge.badge-information .close:focus-within{outline:none}nv-badge.badge-information .close:focus-visible,nv-badge.badge-information .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-feedback-information-low-content, var(--color-feedback-information-low-text));outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-information nv-icon{color:var(--color-feedback-information-low-icon)}nv-badge.badge-neutral{color:var(--color-feedback-neutral-low-text);background-color:var(--color-feedback-neutral-low-background);border-color:var(--color-feedback-neutral-low-border)}nv-badge.badge-neutral .close:focus,nv-badge.badge-neutral .close:focus-within{outline:none}nv-badge.badge-neutral .close:focus-visible,nv-badge.badge-neutral .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-feedback-neutral-low-content, var(--color-feedback-neutral-low-text));outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-neutral nv-icon{color:var(--color-feedback-neutral-low-icon)}nv-badge.badge-success{color:var(--color-feedback-success-low-text);background-color:var(--color-feedback-success-low-background);border-color:var(--color-feedback-success-low-border)}nv-badge.badge-success .close:focus,nv-badge.badge-success .close:focus-within{outline:none}nv-badge.badge-success .close:focus-visible,nv-badge.badge-success .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-feedback-success-low-content, var(--color-feedback-success-low-text));outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-success nv-icon{color:var(--color-feedback-success-low-icon)}nv-badge.badge-warning{color:var(--color-feedback-warning-low-text);background-color:var(--color-feedback-warning-low-background);border-color:var(--color-feedback-warning-low-border)}nv-badge.badge-warning .close:focus,nv-badge.badge-warning .close:focus-within{outline:none}nv-badge.badge-warning .close:focus-visible,nv-badge.badge-warning .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-feedback-warning-low-content, var(--color-feedback-warning-low-text));outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-warning nv-icon{color:var(--color-feedback-warning-low-icon)}nv-badge.badge-amber{color:var(--color-rainbow-1-text);background-color:var(--color-rainbow-1-background);border-color:var(--color-rainbow-1-border)}nv-badge.badge-amber .close:focus,nv-badge.badge-amber .close:focus-within{outline:none}nv-badge.badge-amber .close:focus-visible,nv-badge.badge-amber .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-amber-content, var(--color-rainbow-1-text));outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-amber nv-icon{color:var(--color-rainbow-1-icon)}nv-badge.badge-orange{color:var(--color-rainbow-2-text);background-color:var(--color-rainbow-2-background);border-color:var(--color-rainbow-2-border)}nv-badge.badge-orange .close:focus,nv-badge.badge-orange .close:focus-within{outline:none}nv-badge.badge-orange .close:focus-visible,nv-badge.badge-orange .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-orange-content, var(--color-rainbow-2-text));outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-orange nv-icon{color:var(--color-rainbow-2-icon)}nv-badge.badge-turquoise{color:var(--color-rainbow-5-text);background-color:var(--color-rainbow-5-background);border-color:var(--color-rainbow-5-border)}nv-badge.badge-turquoise .close:focus,nv-badge.badge-turquoise .close:focus-within{outline:none}nv-badge.badge-turquoise .close:focus-visible,nv-badge.badge-turquoise .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-turquoise-content, var(--color-rainbow-5-text));outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-turquoise nv-icon{color:var(--color-rainbow-5-icon)}nv-badge.badge-crimson{color:var(--color-rainbow-6-text);background-color:var(--color-rainbow-6-background);border-color:var(--color-rainbow-6-border)}nv-badge.badge-crimson .close:focus,nv-badge.badge-crimson .close:focus-within{outline:none}nv-badge.badge-crimson .close:focus-visible,nv-badge.badge-crimson .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-crimson-content, var(--color-rainbow-6-text));outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-crimson nv-icon{color:var(--color-rainbow-6-icon)}nv-badge.badge-lime{color:var(--color-rainbow-9-text);background-color:var(--color-rainbow-9-background);border-color:var(--color-rainbow-9-border)}nv-badge.badge-lime .close:focus,nv-badge.badge-lime .close:focus-within{outline:none}nv-badge.badge-lime .close:focus-visible,nv-badge.badge-lime .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-lime-content, var(--color-rainbow-9-text));outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-lime nv-icon{color:var(--color-rainbow-9-icon)}nv-badge.badge-petrol{color:var(--color-rainbow-8-text);background-color:var(--color-rainbow-8-background);border-color:var(--color-rainbow-8-border)}nv-badge.badge-petrol .close:focus,nv-badge.badge-petrol .close:focus-within{outline:none}nv-badge.badge-petrol .close:focus-visible,nv-badge.badge-petrol .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-petrol-content, var(--color-rainbow-8-text));outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-petrol nv-icon{color:var(--color-rainbow-8-icon)}nv-badge span{font-size:var(--font-size-xs);line-height:var(--line-height-xs) !important;text-align:center}nv-badge nv-icon>svg.icon-xs{width:var(--spacing-3);height:var(--spacing-3);stroke-width:1.2px}nv-badge nv-icon>svg.icon-sm{width:var(--spacing-3);height:var(--spacing-3);stroke-width:1.2px}nv-badge nv-icon>svg.icon-md{width:var(--spacing-3);height:var(--spacing-3);stroke-width:1.2px}nv-badge nv-icon>svg.icon-lg{width:var(--spacing-3);height:var(--spacing-3);stroke-width:1.2px}nv-badge nv-icon>svg.icon-xl{width:var(--spacing-3);height:var(--spacing-3);stroke-width:1.2px}nv-badge .close{padding:0;line-height:0;border:none;background:none;cursor:pointer;color:inherit;display:inline-flex;align-items:center;aspect-ratio:1/1;border-radius:var(--radius-rounded-full)}";
|
|
12
13
|
const NvBadgeStyle0 = nvBadgeCss;
|
|
@@ -99,8 +100,8 @@ const NvBadge = class {
|
|
|
99
100
|
this.hiddenChanged.emit(hidden);
|
|
100
101
|
if (this._isHidden === true)
|
|
101
102
|
this._isHidden = hidden;
|
|
102
|
-
const { fadeIn, fadeOut } =
|
|
103
|
-
const { collapse, expand } =
|
|
103
|
+
const { fadeIn, fadeOut } = fade_animation9b939939.useFade(this.el, { duration: 150 });
|
|
104
|
+
const { collapse, expand } = collapse_animation6e0b08df.useCollapse(this.el, { duration: 150 });
|
|
104
105
|
if (hidden === true)
|
|
105
106
|
await timeline_animation79215cd4.timeline(fadeOut, collapse).start();
|
|
106
107
|
if (hidden === false)
|
|
@@ -124,8 +125,8 @@ const NvBadge = class {
|
|
|
124
125
|
}
|
|
125
126
|
if (this.hidden) {
|
|
126
127
|
this._isHidden = true;
|
|
127
|
-
const { setCollapsed } =
|
|
128
|
-
const { setFadeOut } =
|
|
128
|
+
const { setCollapsed } = collapse_animation6e0b08df.useCollapse(this.el);
|
|
129
|
+
const { setFadeOut } = fade_animation9b939939.useFade(this.el);
|
|
129
130
|
setCollapsed();
|
|
130
131
|
setFadeOut();
|
|
131
132
|
}
|
|
@@ -134,14 +135,14 @@ const NvBadge = class {
|
|
|
134
135
|
/****************************************************************************/
|
|
135
136
|
//#region RENDER
|
|
136
137
|
render() {
|
|
137
|
-
return (index.h(index.Host, { key: '
|
|
138
|
+
return (index.h(index.Host, { key: '0e8a142c25a7cb078e8b953794f199135c11b616', class: clsx297c1ffe.clsx(`badge-${this.color}`, {
|
|
138
139
|
'has-close': this.dismissible,
|
|
139
140
|
'with-gap': this.dismissible || this.label,
|
|
140
141
|
'visually-hidden': this._isHidden,
|
|
141
142
|
'is-icon-only': this.isIconOnly,
|
|
142
|
-
}) }, index.h("slot", { key: '
|
|
143
|
+
}) }, index.h("slot", { key: 'a3862245400e63270443b78f21dad3571eb08e5b', name: "leading-icon" }, this.leadIcon && index.h("nv-icon", { key: '46b69a8544e01ff2f738a050cb2502528fa42b04', name: this.leadIcon, size: "sm" })), index.h("span", { key: '8b17eeb60dee162baa98c14ccd4d5aa52c01fffc', class: clsx297c1ffe.clsx({ 'visually-hidden': this.isIconOnly }) }, this.label, index.h("slot", { key: 'e7bad18f496e001acbdae89b93b8e614f4fcc914' })), this.dismissible && (index.h("button", { key: '66cdb2c94b7832ea8cd4612326e6399a9ea77bb7', onClick: this.handleClose, class: "close", type: "button" }, index.h("nv-icon", { key: '399de04fb2fc7d5391c9ebf39e953b12e21fb219', name: "x", size: "sm" })))));
|
|
143
144
|
}
|
|
144
|
-
get
|
|
145
|
+
get el() { return index.getElement(this); }
|
|
145
146
|
static get watchers() { return {
|
|
146
147
|
"dismissal": ["handleDismissalChange"],
|
|
147
148
|
"icon": ["handleIconChange"],
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-7K7BV1CP.js');
|
|
4
4
|
var clsx297c1ffe = require('./clsx-297c1ffe-BtxeOLZW.js');
|
|
5
5
|
require('react');
|
|
6
|
+
require('react-dom');
|
|
6
7
|
|
|
7
|
-
const nvBreadcrumbCss = "nv-breadcrumb{display:flex;align-items:center;color:var(--components-breadcrumb-text);font-size:var(--font-size-sm);font-style:normal;font-weight:
|
|
8
|
+
const nvBreadcrumbCss = "nv-breadcrumb{display:flex;align-items:center;color:var(--components-breadcrumb-text);font-size:var(--font-size-sm);font-style:normal;font-weight:var(--font-weight-medium-emphasis);line-height:var(--line-height-sm)}nv-breadcrumb.visually-hidden{position:absolute;padding:0;border:0;overflow:hidden;white-space:nowrap;width:1px;height:1px;margin:-1px;clip:rect(0, 0, 0, 0)}nv-breadcrumb ul{display:flex;flex-direction:column;gap:var(--spacing-1-5);padding:var(--spacing-1)}nv-breadcrumb ul a,nv-breadcrumb ul button{display:inline-flex;align-self:center;color:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;line-height:inherit;text-decoration:none}nv-breadcrumb ul a:focus,nv-breadcrumb ul a:focus-within,nv-breadcrumb ul button:focus,nv-breadcrumb ul button:focus-within{outline:none}nv-breadcrumb ul a:focus-visible,nv-breadcrumb ul a:has(:focus-visible),nv-breadcrumb ul button:focus-visible,nv-breadcrumb ul button:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 0.5) solid var(--components-breadcrumb-text-hover);outline-offset:calc(var(--focus-outline-offset) * 0.3)}nv-breadcrumb ul a:hover,nv-breadcrumb ul button:hover{text-decoration:underline;color:var(--components-breadcrumb-text-hover)}nv-breadcrumb>a,nv-breadcrumb>button{display:inline-flex;align-self:center;color:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;line-height:inherit;text-decoration:none}nv-breadcrumb>a:focus,nv-breadcrumb>a:focus-within,nv-breadcrumb>button:focus,nv-breadcrumb>button:focus-within{outline:none}nv-breadcrumb>a:focus-visible,nv-breadcrumb>a:has(:focus-visible),nv-breadcrumb>button:focus-visible,nv-breadcrumb>button:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 0.5) solid var(--components-breadcrumb-text-hover);outline-offset:calc(var(--focus-outline-offset) * 0.3)}nv-breadcrumb>a:hover,nv-breadcrumb>button:hover{text-decoration:underline;color:var(--components-breadcrumb-text-hover)}nv-breadcrumb span[data-scope=separator]{display:inline-flex;padding-left:var(--breadcrumb-padding-y)}";
|
|
8
9
|
const NvBreadcrumbStyle0 = nvBreadcrumbCss;
|
|
9
10
|
|
|
10
11
|
const NvBreadcrumb = class {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-7K7BV1CP.js');
|
|
4
4
|
require('react');
|
|
5
|
+
require('react-dom');
|
|
5
6
|
|
|
6
7
|
const nvBreadcrumbsCss = "nv-breadcrumbs{display:block}nv-breadcrumbs>ol{display:flex;flex-wrap:wrap;align-items:center;gap:var(--breadcrumb-padding-y)}nv-breadcrumbs nv-breadcrumb:last-child [data-scope=separator],nv-breadcrumbs nv-breadcrumb:last-child [slot=separator]{display:none}";
|
|
7
8
|
const NvBreadcrumbsStyle0 = nvBreadcrumbsCss;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-7K7BV1CP.js');
|
|
4
|
+
var constants69bafca2 = require('./constants-69bafca2-DpB_ghPF.js');
|
|
5
|
+
require('react');
|
|
6
|
+
require('react-dom');
|
|
7
|
+
|
|
8
|
+
const nvButtonCss = "nv-button{text-decoration:none;display:inline-flex;justify-content:center;align-items:center;font-style:normal;font-weight:var(--font-weight-medium-emphasis);font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;transition:background-color 150ms ease-out;user-select:none;cursor:pointer;height:fit-content;width:fit-content}nv-button[size=xs]{padding:var(--button-xs-padding-y) var(--button-xs-padding-x);gap:var(--button-xs-gap);border-radius:var(--button-xs-border-radius);line-height:var(--button-xs-line-height);font-size:var(--button-xs-font-size)}nv-button[size=xs] nv-icon>svg{width:var(--spacing-3);height:var(--spacing-3);stroke-width:1.2px}nv-button[size=sm]{padding:var(--button-sm-padding-y) var(--button-sm-padding-x);gap:var(--button-sm-gap);border-radius:var(--button-sm-border-radius);line-height:var(--button-sm-line-height);font-size:var(--button-sm-font-size)}nv-button[size=sm] nv-icon>svg{width:var(--spacing-4);height:var(--spacing-4);stroke-width:1.5px}nv-button[size=md]{padding:var(--button-md-padding-y) var(--button-md-padding-x);gap:var(--button-md-gap);border-radius:var(--button-md-border-radius);line-height:var(--button-md-line-height);font-size:var(--button-md-font-size)}nv-button[size=md] nv-icon>svg{width:var(--spacing-5);height:var(--spacing-5);stroke-width:1.6px}nv-button[size=lg]{padding:var(--button-lg-padding-y) var(--button-lg-padding-x);gap:var(--button-lg-gap);border-radius:var(--button-lg-border-radius);line-height:var(--button-lg-line-height);font-size:var(--button-lg-font-size)}nv-button[size=lg] nv-icon>svg{width:var(--spacing-6);height:var(--spacing-6);stroke-width:1.8px}nv-button[emphasis=high]{background:var(--components-button-high-background);border:1px solid var(--components-button-high-border);color:var(--components-button-high-text)}nv-button[emphasis=high]:hover{background:var(--components-button-high-background-hover);border:1px solid var(--components-button-high-border);color:var(--components-button-high-text-hover)}nv-button[emphasis=high]:active{background:var(--components-button-high-background-active);border:1px solid var(--components-button-high-border-active);color:var(--components-button-high-text-active)}nv-button[emphasis=high]:focus,nv-button[emphasis=high]:focus-within{outline:none}nv-button[emphasis=high]:focus-visible,nv-button[emphasis=high]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-button[emphasis=high]:disabled:not([disabled=false]){opacity:0.5;cursor:not-allowed;box-shadow:none}nv-button[emphasis=high][active]:not([active=false]){background:var(--components-button-high-background-active);border:1px solid var(--components-button-high-border-active);color:var(--components-button-high-text-active)}nv-button[emphasis=high][danger]:not([danger=false]){background:var(--components-button-destructive-high-background);border:1px solid transparent;color:var(--components-button-destructive-high-text)}nv-button[emphasis=high][danger]:not([danger=false]):hover{background:var(--components-button-destructive-high-background-hover);border:1px solid transparent;color:var(--components-button-destructive-high-text-hover)}nv-button[emphasis=high][danger]:not([danger=false]):focus,nv-button[emphasis=high][danger]:not([danger=false]):focus-within{outline:none}nv-button[emphasis=high][danger]:not([danger=false]):focus-visible,nv-button[emphasis=high][danger]:not([danger=false]):has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-destructive);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-button[emphasis=medium]{background:var(--components-button-medium-background);border:1px solid var(--components-button-medium-border);color:var(--components-button-medium-text)}nv-button[emphasis=medium]:hover{background:var(--components-button-medium-background-hover);border:1px solid var(--components-button-medium-border);color:var(--components-button-medium-text-hover)}nv-button[emphasis=medium]:active{background:var(--components-button-medium-background-active);border:1px solid var(--components-button-medium-border-active);color:var(--components-button-medium-text-active)}nv-button[emphasis=medium]:focus,nv-button[emphasis=medium]:focus-within{outline:none}nv-button[emphasis=medium]:focus-visible,nv-button[emphasis=medium]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-button[emphasis=medium]:disabled:not([disabled=false]){opacity:0.5;cursor:not-allowed;box-shadow:none}nv-button[emphasis=medium][active]:not([active=false]){background:var(--components-button-medium-background-active);border:1px solid var(--components-button-medium-border-active);color:var(--components-button-medium-text-active)}nv-button[emphasis=medium][danger]:not([danger=false]){background:var(--components-button-destructive-medium-background);border:1px solid var(--components-button-destructive-medium-border);color:var(--components-button-destructive-medium-text)}nv-button[emphasis=medium][danger]:not([danger=false]):hover{background:var(--components-button-destructive-medium-background-hover);border:1px solid var(--components-button-destructive-medium-border);color:var(--components-button-destructive-medium-text-hover)}nv-button[emphasis=medium][danger]:not([danger=false]):focus,nv-button[emphasis=medium][danger]:not([danger=false]):focus-within{outline:none}nv-button[emphasis=medium][danger]:not([danger=false]):focus-visible,nv-button[emphasis=medium][danger]:not([danger=false]):has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-destructive);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-button[emphasis=low]{background:var(--components-button-low-background);border:1px solid var(--components-button-low-border);color:var(--components-button-low-text)}nv-button[emphasis=low]:hover{background:var(--components-button-low-background-hover);border:1px solid var(--components-button-low-border);color:var(--components-button-low-text-hover)}nv-button[emphasis=low]:active{background:var(--components-button-low-background-active);border:1px solid var(--components-button-low-border-active);color:var(--components-button-low-text-active)}nv-button[emphasis=low]:focus,nv-button[emphasis=low]:focus-within{outline:none}nv-button[emphasis=low]:focus-visible,nv-button[emphasis=low]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-button[emphasis=low]:disabled:not([disabled=false]){opacity:0.5;cursor:not-allowed;box-shadow:none}nv-button[emphasis=low][active]:not([active=false]){background:var(--components-button-low-background-active);border:1px solid var(--components-button-low-border-active);color:var(--components-button-low-text-active)}nv-button[emphasis=low][danger]:not([danger=false]){background:var(--components-button-destructive-low-background);border:1px solid var(--components-button-destructive-low-border);color:var(--components-button-destructive-low-text)}nv-button[emphasis=low][danger]:not([danger=false]):hover{background:var(--components-button-destructive-low-background-hover);border:1px solid var(--components-button-destructive-low-border);color:var(--components-button-destructive-low-text-hover)}nv-button[emphasis=low][danger]:not([danger=false]):focus,nv-button[emphasis=low][danger]:not([danger=false]):focus-within{outline:none}nv-button[emphasis=low][danger]:not([danger=false]):focus-visible,nv-button[emphasis=low][danger]:not([danger=false]):has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-destructive);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-button[emphasis=lower]{background:var(--components-button-lower-background);border:1px solid var(--components-button-lower-border);color:var(--components-button-lower-text)}nv-button[emphasis=lower]:hover{background:var(--components-button-lower-background-hover);border:1px solid var(--components-button-lower-border);color:var(--components-button-lower-text-hover)}nv-button[emphasis=lower]:active{background:var(--components-button-lower-background-active);border:1px solid var(--components-button-lower-border-active);color:var(--components-button-lower-text-active)}nv-button[emphasis=lower]:focus,nv-button[emphasis=lower]:focus-within{outline:none}nv-button[emphasis=lower]:focus-visible,nv-button[emphasis=lower]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-button[emphasis=lower]:disabled:not([disabled=false]){opacity:0.5;cursor:not-allowed;box-shadow:none}nv-button[emphasis=lower][active]:not([active=false]){background:var(--components-button-lower-background-active);border:1px solid var(--components-button-lower-border-active);color:var(--components-button-lower-text-active)}nv-button[emphasis=lower][danger]:not([danger=false]){background:var(--components-button-destructive-lower-background);border:1px solid var(--components-button-destructive-lower-border);color:var(--components-button-destructive-lower-text)}nv-button[emphasis=lower][danger]:not([danger=false]):hover{background:var(--components-button-destructive-lower-background-hover);border:1px solid var(--components-button-destructive-lower-border);color:var(--components-button-destructive-lower-text-hover)}nv-button[emphasis=lower][danger]:not([danger=false]):focus,nv-button[emphasis=lower][danger]:not([danger=false]):focus-within{outline:none}nv-button[emphasis=lower][danger]:not([danger=false]):focus-visible,nv-button[emphasis=lower][danger]:not([danger=false]):has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-destructive);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-button[fluid]:not([fluid=false]){width:100%}nv-button[loading]:not([loading=false]) [slot=leading-icon]{display:none}";
|
|
9
|
+
const NvButtonStyle0 = nvButtonCss;
|
|
10
|
+
|
|
11
|
+
const NvButton = class {
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
index.registerInstance(this, hostRef);
|
|
14
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
15
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
19
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
20
|
+
}
|
|
21
|
+
/****************************************************************************/
|
|
22
|
+
//#region PROPERTIES
|
|
23
|
+
/**
|
|
24
|
+
* Determines how large or small the button appears, allowing for
|
|
25
|
+
* customization of the button's dimensions to fit different design
|
|
26
|
+
* specifications and user needs.
|
|
27
|
+
*/
|
|
28
|
+
this.size = 'md';
|
|
29
|
+
/**
|
|
30
|
+
* Adjusts the button's emphasis to make it more or less visually prominent
|
|
31
|
+
* to users. Use this to draw attention to important actions or reduce focus
|
|
32
|
+
* on less critical ones
|
|
33
|
+
*/
|
|
34
|
+
this.emphasis = 'high';
|
|
35
|
+
/**
|
|
36
|
+
* Use this prop to highlight the button when it represents the current page
|
|
37
|
+
* or active selection. This helps users understand their navigation context.
|
|
38
|
+
*/
|
|
39
|
+
this.active = false;
|
|
40
|
+
/**
|
|
41
|
+
* Applies styling that visually indicates the button represents a dangerous
|
|
42
|
+
* action.
|
|
43
|
+
*/
|
|
44
|
+
this.danger = false;
|
|
45
|
+
/**
|
|
46
|
+
* Set this to true to show a spinner on the button, letting users know that
|
|
47
|
+
* their action is being processed. It helps improve user experience by
|
|
48
|
+
* indicating ongoing activities.
|
|
49
|
+
*/
|
|
50
|
+
this.loading = false;
|
|
51
|
+
/**
|
|
52
|
+
* Disables the button, preventing user interaction.
|
|
53
|
+
*/
|
|
54
|
+
this.disabled = false;
|
|
55
|
+
/**
|
|
56
|
+
* Allows the button to stretch and fill the entire width of its container.
|
|
57
|
+
*/
|
|
58
|
+
this.fluid = false;
|
|
59
|
+
/**
|
|
60
|
+
* Sets the button type to control its function in forms. Use 'submit' to send
|
|
61
|
+
* form data, 'reset' to clear the form, or 'button' for a standard button
|
|
62
|
+
* that doesn't interact with form submission by default.
|
|
63
|
+
*/
|
|
64
|
+
this.type = 'button';
|
|
65
|
+
//#endregion PROPERTIES
|
|
66
|
+
/****************************************************************************/
|
|
67
|
+
//#region METHODS
|
|
68
|
+
/**
|
|
69
|
+
* Handles button click events, managing form actions and disabled states.
|
|
70
|
+
* Prevents default behavior when button is disabled or loading, and
|
|
71
|
+
* processes form submissions/resets when appropriate.
|
|
72
|
+
* @param {Event} event - The click event.
|
|
73
|
+
*/
|
|
74
|
+
this.handleButtonClick = (event) => {
|
|
75
|
+
var _a;
|
|
76
|
+
if (this.loading || this.disabled) {
|
|
77
|
+
event.preventDefault();
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (this.type !== constants69bafca2.ButtonType.Button &&
|
|
81
|
+
(this.form || ((_a = this.internals) === null || _a === void 0 ? void 0 : _a.form))) {
|
|
82
|
+
this.processFormAction();
|
|
83
|
+
}
|
|
84
|
+
else if (this.form && this.type === constants69bafca2.ButtonType.Button) {
|
|
85
|
+
console.warn('Button has a form id but is not of type submit or reset so no form action will be processed.', `Button:`, this.el);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Processes form-related actions by finding the associated form element
|
|
90
|
+
* and triggering the appropriate action (submit/reset) based on button type.
|
|
91
|
+
* Falls back to ElementInternals form if no explicit form ID is provided.
|
|
92
|
+
*/
|
|
93
|
+
this.processFormAction = () => {
|
|
94
|
+
var _a, _b;
|
|
95
|
+
const formElement = this.form
|
|
96
|
+
? document.getElementById(this.form)
|
|
97
|
+
: (_a = this.internals) === null || _a === void 0 ? void 0 : _a.form;
|
|
98
|
+
if (!formElement) {
|
|
99
|
+
console.warn('No form element found.', `Form ID: ${this.form || 'Not provided'}`, `Internals form:`, (_b = this.internals) === null || _b === void 0 ? void 0 : _b.form);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
switch (this.type) {
|
|
103
|
+
case constants69bafca2.ButtonType.Submit:
|
|
104
|
+
formElement.requestSubmit();
|
|
105
|
+
break;
|
|
106
|
+
case constants69bafca2.ButtonType.Reset:
|
|
107
|
+
formElement.reset();
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
//#endregion METHODS
|
|
113
|
+
/****************************************************************************/
|
|
114
|
+
//#region EVENTS
|
|
115
|
+
handleKeyDown(event) {
|
|
116
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
117
|
+
event.preventDefault();
|
|
118
|
+
this.el.click();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
handleTouchStart(event) {
|
|
122
|
+
if (event.touches.length > 1)
|
|
123
|
+
return;
|
|
124
|
+
event.preventDefault();
|
|
125
|
+
this.el.click();
|
|
126
|
+
}
|
|
127
|
+
//#endregion EVENTS
|
|
128
|
+
/****************************************************************************/
|
|
129
|
+
//#region WATCHERS
|
|
130
|
+
handleLoadingChange(loading) {
|
|
131
|
+
this.loading = loading;
|
|
132
|
+
this.disabled = loading;
|
|
133
|
+
}
|
|
134
|
+
handleDisabledChange(disabled) {
|
|
135
|
+
if (this.loading) {
|
|
136
|
+
this.disabled = this.loading;
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
this.disabled = disabled;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
//#endregion WATCHERS
|
|
143
|
+
/****************************************************************************/
|
|
144
|
+
//#region LIFECYCLE
|
|
145
|
+
componentWillLoad() {
|
|
146
|
+
if (this.loading) {
|
|
147
|
+
this.disabled = this.loading;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
//#endregion LIFECYCLE
|
|
151
|
+
/****************************************************************************/
|
|
152
|
+
//#region RENDER
|
|
153
|
+
render() {
|
|
154
|
+
return (index.h(index.Host, { key: '54c0b3351f4d8a180058a03e61a562882fb98498', role: "button", tabindex: "0", onClick: this.handleButtonClick }, this.loading && (index.h("nv-loader", { key: '21315e4af4111bcf47c67e65a9a58a1d7121a43e', size: this.size === constants69bafca2.ButtonSize.Large ? 'sm' : 'xs' })), index.h("slot", { key: 'f37683ddaa2c11c5b7accfc99429c930f5a3dcf6', name: "leading-icon" }), index.h("slot", { key: 'd17ebe7505d9027c6c58f930a8ea9b097561cead' }), index.h("slot", { key: '2cd6c9756cc7540417041adf5830b734291b2ab5', name: "trailing-icon" })));
|
|
155
|
+
}
|
|
156
|
+
static get formAssociated() { return true; }
|
|
157
|
+
get el() { return index.getElement(this); }
|
|
158
|
+
static get watchers() { return {
|
|
159
|
+
"loading": ["handleLoadingChange"],
|
|
160
|
+
"disabled": ["handleDisabledChange"]
|
|
161
|
+
}; }
|
|
162
|
+
};
|
|
163
|
+
NvButton.style = NvButtonStyle0;
|
|
164
|
+
|
|
165
|
+
exports.nv_button = NvButton;
|