@nova-design-system/nova-react 3.11.0 → 3.13.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-acda1bf5-BuORVmQv.js +214 -0
- package/dist/cjs/{constants-23aaef7b-Cj2b-su0.js → constants-d0f19e7b-s0SCO_vi.js} +5 -0
- package/dist/cjs/fade.animation-eb454088-Bma0SpTf.js +724 -0
- package/dist/cjs/{index-9kW3hkgy.js → index-Jgn7NELT.js} +2422 -1713
- package/dist/cjs/index.js +69 -1
- package/dist/cjs/{nv-accordion-item.entry-77CmzSqs.js → nv-accordion-item.entry-C7vVmDCg.js} +74 -40
- package/dist/cjs/nv-accordion.entry-CFynyAOo.js +178 -0
- package/dist/cjs/{nv-alert.entry-4ATJ67O4.js → nv-alert.entry-C_FMs0Yi.js} +20 -20
- package/dist/cjs/{nv-avatar.entry-DOI0QFTW.js → nv-avatar.entry-BvjSzIHn.js} +7 -7
- package/dist/cjs/nv-badge_2.entry-CLNvgVtj.js +212 -0
- package/dist/cjs/{nv-breadcrumb.entry-C6TteX7v.js → nv-breadcrumb.entry-Ch2Cvr_a.js} +2 -2
- package/dist/cjs/{nv-breadcrumbs.entry-CpYRzd4I.js → nv-breadcrumbs.entry-DmH8AGIm.js} +1 -1
- package/dist/cjs/{nv-button.entry-DUU-LHJM.js → nv-button.entry-B0lusQ2w.js} +8 -8
- package/dist/cjs/{nv-buttongroup.entry-BDdi1Z66.js → nv-buttongroup.entry-DLVCcdh9.js} +1 -1
- package/dist/cjs/{nv-calendar.entry-DMpLDXJG.js → nv-calendar.entry-BmX0f_Or.js} +20 -16
- package/dist/cjs/{nv-col.entry-WTuI3NnF.js → nv-col.entry-lysICYEC.js} +1 -1
- package/dist/cjs/{nv-datagrid.entry-BXqZFjrC.js → nv-datagrid.entry-vG3h5dj3.js} +7 -7
- package/dist/cjs/{nv-datagridcolumn.entry-B-M6q2Tk.js → nv-datagridcolumn.entry-9NynF9K-.js} +1 -1
- package/dist/cjs/{nv-dialog.entry-DEM7iOao.js → nv-dialog.entry-Ctsz1K-O.js} +3 -3
- package/dist/cjs/{nv-dialogfooter_2.entry-B09v2yKV.js → nv-dialogfooter_2.entry-B17HEgyc.js} +10 -7
- package/dist/cjs/{nv-fieldcheckbox.entry-Z5tjeUuU.js → nv-fieldcheckbox.entry-DMiADwqV.js} +2 -2
- package/dist/cjs/{nv-fielddate.entry-5lSIc9Ek.js → nv-fielddate.entry-D3X6Jl3u.js} +2 -2
- package/dist/cjs/{nv-fielddaterange.entry-CuhBqqML.js → nv-fielddaterange.entry-C8_SFFXW.js} +2 -2
- package/dist/cjs/{nv-fielddropdown.entry-BFFr0ATC.js → nv-fielddropdown.entry-BiBR8Qgs.js} +2 -2
- package/dist/cjs/{nv-fielddropdownitem.entry-BugR9GTU.js → nv-fielddropdownitem.entry-DQ8QK4AS.js} +1 -1
- package/dist/cjs/{nv-fieldmultiselect.entry-S7ur1tcN.js → nv-fieldmultiselect.entry-J5VTOPum.js} +2 -32
- package/dist/cjs/{nv-fieldnumber.entry-BMpv7Xab.js → nv-fieldnumber.entry-Djpg1HMq.js} +3 -3
- package/dist/cjs/{nv-fieldpassword.entry-B5WsGvF8.js → nv-fieldpassword.entry-DKT9Xn5H.js} +2 -2
- package/dist/cjs/{nv-fieldradio.entry-BhojWkU4.js → nv-fieldradio.entry-CPYf3K2o.js} +2 -2
- package/dist/cjs/{nv-fieldselect.entry-CCM3U7mj.js → nv-fieldselect.entry-DnbL7aZB.js} +2 -2
- package/dist/cjs/{nv-fieldslider.entry-XQRuw_C-.js → nv-fieldslider.entry-CNRJuo7v.js} +25 -17
- package/dist/cjs/{nv-fieldtext.entry-DtgMcL9y.js → nv-fieldtext.entry-B9lIHck7.js} +1 -1
- package/dist/cjs/{nv-fieldtextarea.entry-BF4luAgA.js → nv-fieldtextarea.entry-B2EDj8cm.js} +1 -1
- package/dist/cjs/{nv-fieldtime.entry-DyP6QWzm.js → nv-fieldtime.entry-CpoXpAPx.js} +61 -61
- package/dist/cjs/nv-icon.entry-DbOeEd4f.js +79 -0
- package/dist/cjs/{nv-iconbutton_2.entry-DlLquYC0.js → nv-iconbutton_2.entry-DR_wR73O.js} +2 -2
- package/dist/cjs/{nv-menu.entry-Dj2paHp_.js → nv-menu.entry-DB_G8hS_.js} +1 -1
- package/dist/cjs/{nv-menuitem.entry-DbV-21bC.js → nv-menuitem.entry-PBCNIzPI.js} +1 -1
- package/dist/cjs/nv-notification.entry-CyumbQS_.js +178 -0
- package/dist/cjs/{nv-popover.entry-mefWRuFR.js → nv-popover.entry-ttESQMgj.js} +29 -12
- package/dist/cjs/{nv-row.entry-Ds7BSvjO.js → nv-row.entry-DPEGaFeS.js} +2 -2
- package/dist/cjs/{nv-stack.entry-vlegAAKj.js → nv-stack.entry-CTPwlz23.js} +2 -2
- package/dist/cjs/{nv-table.entry-CiZvYc93.js → nv-table.entry-Dv1mZKcu.js} +3 -3
- package/dist/cjs/{nv-tablecolumn.entry-ChUzCWVu.js → nv-tablecolumn.entry-DrAaeHm-.js} +1 -1
- package/dist/cjs/{nv-toggle.entry-CLY7TxJv.js → nv-toggle.entry-D2TRd371.js} +4 -4
- package/dist/cjs/nv-togglebutton.entry-D95qOQ1K.js +55 -0
- package/dist/cjs/{nv-togglebuttongroup.entry-JZNZk6j2.js → nv-togglebuttongroup.entry-BNvyZgbh.js} +2 -2
- package/dist/cjs/{nv-tooltip.entry-BhwdNKUk.js → nv-tooltip.entry-oOw6EmyL.js} +12 -3
- 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 +8 -0
- package/dist/generated/components.server.js +21 -2
- package/dist/index.js +1 -0
- package/dist/types/generated/components.d.ts +5 -0
- package/dist/types/generated/components.server.d.ts +5 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +4 -2
- 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-DCspxUr-.js +0 -164
- package/dist/cjs/nv-badge_2.entry-h081ah26.js +0 -212
- package/dist/cjs/nv-icon.entry-DlnsNiSG.js +0 -79
- package/dist/cjs/nv-togglebutton.entry-C6dUap1P.js +0 -55
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-Jgn7NELT.js');
|
|
4
4
|
require('react');
|
|
5
5
|
|
|
6
6
|
const nvMenuCss = "nv-menuitem{display:flex;align-items:center;max-width:300px;width:100vw;font-size:var(--menu-contextual-item-font-size);font-weight:var(--menu-contextual-item-font-weight);color:var(--components-menu-contextual-item-content);border-radius:var(--menu-contextual-item-radius);gap:var(--menu-contextual-item-gap-x);padding:var(--menu-contextual-item-padding-y) var(--menu-contextual-item-padding-x);transition:background-color 150ms ease-out;cursor:pointer}nv-menuitem:hover,nv-menuitem:focus,nv-menuitem:focus-within{background-color:var(--components-menu-contextual-item-background-hover);color:var(--components-menu-contextual-item-content-hover)}nv-menuitem *{pointer-events:none}nv-menuitem kbd{color:var(--components-menu-contextual-item-shortcut)}nv-menuitem [data-scope=text]{margin-right:auto}nv-menuitem[disabled]:not([disabled=false]){cursor:unset;background-color:unset;color:var(--components-menu-contextual-item-content-disabled)}nv-menu{display:inline-block;position:relative}nv-menu:has([fluid]:not([fluid=false])){display:block}nv-menu nv-popover{display:unset}nv-menu nv-popover [data-scope=popover]{background-color:transparent !important;padding:0 !important}nv-menu [slot=content]{padding:var(--menu-contextual-padding-y) var(--menu-contextual-padding-x);border-radius:var(--menu-contextual-radius);gap:var(--menu-contextual-gap-y);background-color:var(--components-menu-contextual-background);border-color:var(--components-menu-contextual-border);display:flex;flex-direction:column}nv-menu nv-menu[open]:not([open=false])>nv-menuitem{background-color:var(--components-menu-contextual-item-background-hover);color:var(--components-menu-contextual-item-content-hover)}nv-menu hr{display:block;margin:var(--menu-contextual-divider-padding-top) var(--menu-contextual-divider-padding-x) var(--menu-contextual-divider-padding-bottom) var(--menu-contextual-divider-padding-x)}";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-Jgn7NELT.js');
|
|
4
4
|
require('react');
|
|
5
5
|
|
|
6
6
|
const nvMenuitemCss = "nv-menuitem{display:flex;align-items:center;max-width:300px;width:100vw;font-size:var(--menu-contextual-item-font-size);font-weight:var(--menu-contextual-item-font-weight);color:var(--components-menu-contextual-item-content);border-radius:var(--menu-contextual-item-radius);gap:var(--menu-contextual-item-gap-x);padding:var(--menu-contextual-item-padding-y) var(--menu-contextual-item-padding-x);transition:background-color 150ms ease-out;cursor:pointer}nv-menuitem:hover,nv-menuitem:focus,nv-menuitem:focus-within{background-color:var(--components-menu-contextual-item-background-hover);color:var(--components-menu-contextual-item-content-hover)}nv-menuitem *{pointer-events:none}nv-menuitem kbd{color:var(--components-menu-contextual-item-shortcut)}nv-menuitem [data-scope=text]{margin-right:auto}nv-menuitem[disabled]:not([disabled=false]){cursor:unset;background-color:unset;color:var(--components-menu-contextual-item-content-disabled)}";
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-Jgn7NELT.js');
|
|
4
|
+
var constantsD0f19e7b = require('./constants-d0f19e7b-s0SCO_vi.js');
|
|
5
|
+
var collapse_animationAcda1bf5 = require('./collapse.animation-acda1bf5-BuORVmQv.js');
|
|
6
|
+
var fade_animationEb454088 = require('./fade.animation-eb454088-Bma0SpTf.js');
|
|
7
|
+
var styleValueTypes_esF5d10b79 = require('./style-value-types.es-f5d10b79-D0QCM8OB.js');
|
|
8
|
+
var timeline_animation79215cd4 = require('./timeline.animation-79215cd4-KteJaZPb.js');
|
|
9
|
+
var v4A79185f4 = require('./v4-a79185f4-2n0dOd_Y.js');
|
|
10
|
+
require('react');
|
|
11
|
+
|
|
12
|
+
const useSlide = (node, { duration } = { duration: 200 }) => {
|
|
13
|
+
const nodeStyler = fade_animationEb454088.index(node);
|
|
14
|
+
/**
|
|
15
|
+
* Will animate the translateX to 100%, sliding the element to the right.
|
|
16
|
+
*/
|
|
17
|
+
function slideOut() {
|
|
18
|
+
return new Promise(resolve => {
|
|
19
|
+
styleValueTypes_esF5d10b79.animate({
|
|
20
|
+
from: { x: 0 },
|
|
21
|
+
to: { x: 100 },
|
|
22
|
+
ease: styleValueTypes_esF5d10b79.easeOut,
|
|
23
|
+
duration,
|
|
24
|
+
onUpdate(latest) {
|
|
25
|
+
nodeStyler.set({ transform: `translateX(${latest.x}%)` });
|
|
26
|
+
},
|
|
27
|
+
onComplete() {
|
|
28
|
+
resolve();
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Applies the slideOut styles without animating, useful when initial state
|
|
35
|
+
* is slid out.
|
|
36
|
+
*/
|
|
37
|
+
function setSlideOut() {
|
|
38
|
+
node.style.transform = 'translateX(100%)';
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Applies the slideIn styles without animating, useful when initial state
|
|
42
|
+
* is slid in.
|
|
43
|
+
*/
|
|
44
|
+
function setSlideIn() {
|
|
45
|
+
node.style.transform = '';
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Will animate the translateX from 100% to 0%, sliding the element in from the right.
|
|
49
|
+
*/
|
|
50
|
+
function slideIn() {
|
|
51
|
+
return new Promise(resolve => {
|
|
52
|
+
styleValueTypes_esF5d10b79.animate({
|
|
53
|
+
from: { x: 100 },
|
|
54
|
+
to: { x: 0 },
|
|
55
|
+
duration,
|
|
56
|
+
onUpdate(latest) {
|
|
57
|
+
nodeStyler.set({ transform: `translateX(${latest.x}%)` });
|
|
58
|
+
},
|
|
59
|
+
onComplete() {
|
|
60
|
+
resolve();
|
|
61
|
+
node.style.removeProperty('transform');
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
slideIn,
|
|
68
|
+
slideOut,
|
|
69
|
+
setSlideOut,
|
|
70
|
+
setSlideIn,
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const nvNotificationCss = "nv-notification{display:block}nv-notification [data-scope=container]{display:flex;position:relative;max-width:512px;width:100%;padding:var(--notification-padding);align-items:flex-start;gap:var(--notification-gap-x);border-radius:var(--notification-radius);border-style:solid;box-shadow:0 var(--shadow-y-axis-lg-1, 4px) var(--shadow-blur-lg-1, 6px) var(--shadow-spread-lg-1, -2px) var(--shadow-color-opacity-1, rgba(14, 14, 14, 0.06)), 0 var(--shadow-y-axis-lg-2, 10px) var(--shadow-blur-lg-2, 15px) var(--shadow-spread-lg-2, -3px) var(--shadow-color-opacity-2, rgba(14, 14, 14, 0.1))}nv-notification [data-scope=container]>nv-icon{flex-shrink:0}nv-notification [data-scope=container] [data-scope=dismiss]{padding:var(--button-sm-icon-button-padding, 8px);justify-content:center;align-items:center;gap:var(--button-sm-gap, 6px);display:flex;position:absolute;right:8px;top:8px;border-radius:var(--button-sm-border-radius, 4px);background:var(--components-button-lower-background, rgba(255, 255, 255, 0));color:var(--components-button-lower-icon)}nv-notification [data-scope=container] [data-scope=content]{display:flex;padding-right:var(--notification-padding-right);flex-direction:column;align-items:flex-start;gap:var(--notification-gap-y);flex:1 0 0}nv-notification [data-scope=container] [data-scope=content] [data-scope=heading]{display:flex;align-items:flex-start;gap:var(--notification-gap-x);align-self:stretch;color:var(--components-notification-content-title);font-size:var(--notification-title-font-size);font-style:normal;font-weight:500;line-height:20px;}nv-notification [data-scope=container] [data-scope=content] [data-scope=message]{display:flex;flex-direction:column;align-items:flex-start;gap:var(--notification-gap-y);align-self:stretch;color:var(--components-notification-content-description);font-variant-numeric:lining-nums tabular-nums slashed-zero;font-size:var(--font-size-sm, 14px);font-style:normal;font-weight:400;line-height:var(--line-height-sm, 20px)}nv-notification [data-scope=container] [data-scope=content] [data-scope=actions]{display:flex;padding:var(--spacing-2, 8px) 0;padding-bottom:0px;align-items:flex-start;gap:var(--notification-gap-x);align-self:stretch;margin-left:calc(-1 * var(--button-sm-padding-x))}nv-notification[feedback=information] [data-scope=container]{background-color:var(--components-notification-information-background);border-color:var(--components-notification-information-border)}nv-notification[feedback=information] [data-scope=container]>nv-icon{color:var(--components-notification-information-icon)}nv-notification[feedback=information]>[data-scope=close]:focus,nv-notification[feedback=information]>[data-scope=close]:focus-within{outline:none}nv-notification[feedback=information]>[data-scope=close]:focus-visible,nv-notification[feedback=information]>[data-scope=close]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-notification-information-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-notification[feedback=warning] [data-scope=container]{background-color:var(--components-notification-warning-background);border-color:var(--components-notification-warning-border)}nv-notification[feedback=warning] [data-scope=container]>nv-icon{color:var(--components-notification-warning-icon)}nv-notification[feedback=warning]>[data-scope=close]:focus,nv-notification[feedback=warning]>[data-scope=close]:focus-within{outline:none}nv-notification[feedback=warning]>[data-scope=close]:focus-visible,nv-notification[feedback=warning]>[data-scope=close]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-notification-warning-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-notification[feedback=error] [data-scope=container]{background-color:var(--components-notification-error-background);border-color:var(--components-notification-error-border)}nv-notification[feedback=error] [data-scope=container]>nv-icon{color:var(--components-notification-error-icon)}nv-notification[feedback=error]>[data-scope=close]:focus,nv-notification[feedback=error]>[data-scope=close]:focus-within{outline:none}nv-notification[feedback=error]>[data-scope=close]:focus-visible,nv-notification[feedback=error]>[data-scope=close]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-notification-error-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-notification[feedback=success] [data-scope=container]{background-color:var(--components-notification-success-background);border-color:var(--components-notification-success-border)}nv-notification[feedback=success] [data-scope=container]>nv-icon{color:var(--components-notification-success-icon)}nv-notification[feedback=success]>[data-scope=close]:focus,nv-notification[feedback=success]>[data-scope=close]:focus-within{outline:none}nv-notification[feedback=success]>[data-scope=close]:focus-visible,nv-notification[feedback=success]>[data-scope=close]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-notification-success-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-notification[feedback=neutral] [data-scope=container]{background-color:var(--components-notification-neutral-background);border-color:var(--components-notification-neutral-border)}nv-notification[feedback=neutral] [data-scope=container]>nv-icon{color:var(--components-notification-neutral-icon)}nv-notification[feedback=neutral]>[data-scope=close]:focus,nv-notification[feedback=neutral]>[data-scope=close]:focus-within{outline:none}nv-notification[feedback=neutral]>[data-scope=close]:focus-visible,nv-notification[feedback=neutral]>[data-scope=close]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-notification-neutral-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-notification[emphasis=high] [data-scope=container]{border-width:1px;border-left-width:var(--notification-border-width-high-emphasis);padding-left:calc(var(--notification-padding) - var(--notification-border-width-high-emphasis) + 1px)}nv-notification[emphasis=medium] [data-scope=container]{border-width:var(--notification-border-width-low-emphasis);border-color:var(--color-content-low-border, #E3E3E3)}";
|
|
75
|
+
const NvNotificationStyle0 = nvNotificationCss;
|
|
76
|
+
|
|
77
|
+
const NvNotification = class {
|
|
78
|
+
constructor(hostRef) {
|
|
79
|
+
index.registerInstance(this, hostRef);
|
|
80
|
+
this.hiddenChanged = index.createEvent(this, "hiddenChanged");
|
|
81
|
+
/****************************************************************************/
|
|
82
|
+
//#region PROPERTIES
|
|
83
|
+
/**
|
|
84
|
+
* Set a unique ID for the notification. Used for aria attributes and managing
|
|
85
|
+
* multiple notifications.
|
|
86
|
+
*/
|
|
87
|
+
this.uid = v4A79185f4.v4();
|
|
88
|
+
/**
|
|
89
|
+
* Specifies the notification type which determines the color and default icon.
|
|
90
|
+
*/
|
|
91
|
+
this.feedback = 'information';
|
|
92
|
+
/**
|
|
93
|
+
* Adjusts the emphasis to make the notification more or less visually
|
|
94
|
+
* prominent to users. Use this to draw attention to important actions or
|
|
95
|
+
* reduce focus on less critical ones
|
|
96
|
+
*/
|
|
97
|
+
this.emphasis = 'medium';
|
|
98
|
+
/**
|
|
99
|
+
* Allows the notification to be dismissed via a close button (x). The
|
|
100
|
+
* notification is not dismissible unless explicitly enabled.
|
|
101
|
+
*/
|
|
102
|
+
this.dismissible = false;
|
|
103
|
+
/**
|
|
104
|
+
* Controls the visibility of the notification.
|
|
105
|
+
*/
|
|
106
|
+
this.hidden = false; // eslint-disable-line @stencil-community/reserved-member-names
|
|
107
|
+
//#endregion EVENTS
|
|
108
|
+
/****************************************************************************/
|
|
109
|
+
//#region INTERNAL
|
|
110
|
+
this.iconByFeedback = {
|
|
111
|
+
[constantsD0f19e7b.FeedbackColors.Warning]: 'alert-circle',
|
|
112
|
+
[constantsD0f19e7b.FeedbackColors.Information]: 'info-circle',
|
|
113
|
+
[constantsD0f19e7b.FeedbackColors.Success]: 'circle-check',
|
|
114
|
+
[constantsD0f19e7b.FeedbackColors.Error]: 'alert-triangle',
|
|
115
|
+
[constantsD0f19e7b.FeedbackColors.Neutral]: 'help',
|
|
116
|
+
};
|
|
117
|
+
this.roleByFeedback = {
|
|
118
|
+
[constantsD0f19e7b.FeedbackColors.Error]: 'alert',
|
|
119
|
+
[constantsD0f19e7b.FeedbackColors.Warning]: 'alert',
|
|
120
|
+
[constantsD0f19e7b.FeedbackColors.Information]: 'status',
|
|
121
|
+
[constantsD0f19e7b.FeedbackColors.Success]: 'status',
|
|
122
|
+
[constantsD0f19e7b.FeedbackColors.Neutral]: 'status',
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
//#endregion PROPERTIES
|
|
126
|
+
/****************************************************************************/
|
|
127
|
+
//#region METHODS
|
|
128
|
+
async dismiss() {
|
|
129
|
+
await this.dismissAnimation();
|
|
130
|
+
}
|
|
131
|
+
getDefaultIcon() {
|
|
132
|
+
var _a;
|
|
133
|
+
return (_a = this.iconByFeedback[this.feedback]) !== null && _a !== void 0 ? _a : 'info-circle';
|
|
134
|
+
}
|
|
135
|
+
getAriaRole() {
|
|
136
|
+
var _a;
|
|
137
|
+
return (_a = this.roleByFeedback[this.feedback]) !== null && _a !== void 0 ? _a : 'status';
|
|
138
|
+
}
|
|
139
|
+
getAriaLive() {
|
|
140
|
+
return this.getAriaRole() === 'alert' ? 'assertive' : 'polite';
|
|
141
|
+
}
|
|
142
|
+
getHeadingId() {
|
|
143
|
+
return this.heading ? `nv-notification-${this.uid}-heading` : null;
|
|
144
|
+
}
|
|
145
|
+
getMessageId() {
|
|
146
|
+
return this.message ? `nv-notification-${this.uid}-message` : null;
|
|
147
|
+
}
|
|
148
|
+
async dismissAnimation() {
|
|
149
|
+
const { fadeOut } = fade_animationEb454088.useFade(this.container, { duration: 300 });
|
|
150
|
+
const { slideOut } = useSlide(this.container, { duration: 800 });
|
|
151
|
+
const { collapse } = collapse_animationAcda1bf5.useCollapse(this.el, {
|
|
152
|
+
duration: 800,
|
|
153
|
+
overflow: 'visible',
|
|
154
|
+
});
|
|
155
|
+
await timeline_animation79215cd4.parallel(fadeOut, slideOut, collapse).start();
|
|
156
|
+
this.hidden = true;
|
|
157
|
+
this.hiddenChanged.emit(true);
|
|
158
|
+
}
|
|
159
|
+
//#endregion INTERNAL
|
|
160
|
+
/****************************************************************************/
|
|
161
|
+
//#region LIFECYCLE
|
|
162
|
+
componentWillLoad() {
|
|
163
|
+
this.headingSlot = this.el.querySelector('[slot="heading"]');
|
|
164
|
+
this.messageSlot = this.el.querySelector('[slot="content"]');
|
|
165
|
+
this.actionsSlot = this.el.querySelector('[slot="actions"]');
|
|
166
|
+
}
|
|
167
|
+
//#endregion LIFECYCLE
|
|
168
|
+
/****************************************************************************/
|
|
169
|
+
//#region RENDER
|
|
170
|
+
render() {
|
|
171
|
+
var _a, _b, _c;
|
|
172
|
+
return (index.h(index.Host, { key: '9146cea4ed72801aadf2fb4b7e44895038c98437', role: this.getAriaRole(), "aria-live": this.getAriaLive(), "aria-atomic": true, "aria-labelledby": (_a = this.getHeadingId()) !== null && _a !== void 0 ? _a : null, "aria-describedby": (_b = this.getMessageId()) !== null && _b !== void 0 ? _b : null, tabindex: "-1" }, index.h("div", { key: 'beed9ae5f6fac1b0c6d103dd75a41e0aede84041', "data-scope": "container", ref: el => (this.container = el) }, this.dismissible && (index.h("button", { key: '8e17f33867c2563de719dc1b0f0e2d4ae39ad1a6', "data-scope": "dismiss", type: "button", onClick: this.dismiss.bind(this) }, index.h("nv-icon", { key: 'cb8850135bb2383e33a16671569547611b55e434', name: "x", size: "sm" }))), index.h("nv-icon", { key: 'f5f58e1c3a94d854841271eb12af047322b2f0b4', name: (_c = this.icon) !== null && _c !== void 0 ? _c : this.getDefaultIcon(), size: "md" }), index.h("div", { key: '9c6f6bb0315cd25260d483472a24832031ce45da', "data-scope": "content" }, (this.heading || this.headingSlot) && (index.h("p", { key: '1013d6b6790f75682a1db0e43293b61e614f1c07', id: this.getHeadingId(), "data-scope": "heading" }, index.h("slot", { key: '844a7bccf6f365d4e59dfdec9b3c9096cbeda798', name: "heading" }, this.heading))), (this.message || this.messageSlot) && (index.h("p", { key: '6688e9dc927f6164ce60f27b84fdbeb257296504', id: this.getMessageId(), "data-scope": "message" }, index.h("slot", { key: 'f0c0790faa40411970575240a081f0f0bf0e9aff', name: "content" }, this.message))), this.actionsSlot && (index.h("div", { key: '0ba946edf5b3a8410da3b375e589613a2674fd15', "data-scope": "actions" }, index.h("slot", { key: '0360ab92db66957f0290569c39307ced2be5922d', name: "actions" })))))));
|
|
173
|
+
}
|
|
174
|
+
get el() { return index.getElement(this); }
|
|
175
|
+
};
|
|
176
|
+
NvNotification.style = NvNotificationStyle0;
|
|
177
|
+
|
|
178
|
+
exports.nv_notification = NvNotification;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var index = require('./index-Jgn7NELT.js');
|
|
4
|
+
var fade_animationEb454088 = require('./fade.animation-eb454088-Bma0SpTf.js');
|
|
5
|
+
var styleValueTypes_esF5d10b79 = require('./style-value-types.es-f5d10b79-D0QCM8OB.js');
|
|
6
6
|
var events_utilsFe1d907f = require('./events.utils-fe1d907f-01N__3wY.js');
|
|
7
7
|
require('react');
|
|
8
8
|
|
|
9
9
|
const useGrow = (node, { duration = 200, amount = 0.8, hasFade = true } = {}) => {
|
|
10
|
-
const nodeStyler =
|
|
10
|
+
const nodeStyler = fade_animationEb454088.index(node);
|
|
11
11
|
/**
|
|
12
12
|
* Will animate the scale and optionally the opacity to make the element grow and fade in,
|
|
13
13
|
* and removes the scale and opacity style attributes once complete.
|
|
14
14
|
*/
|
|
15
15
|
function growIn() {
|
|
16
16
|
return new Promise(resolve => {
|
|
17
|
-
|
|
17
|
+
styleValueTypes_esF5d10b79.animate({
|
|
18
18
|
from: { opacity: hasFade ? 0 : 1, scale: amount },
|
|
19
19
|
to: { opacity: 1, scale: 1 },
|
|
20
20
|
duration,
|
|
@@ -63,7 +63,7 @@ const useGrow = (node, { duration = 200, amount = 0.8, hasFade = true } = {}) =>
|
|
|
63
63
|
*/
|
|
64
64
|
function growOut() {
|
|
65
65
|
return new Promise(resolve => {
|
|
66
|
-
|
|
66
|
+
styleValueTypes_esF5d10b79.animate({
|
|
67
67
|
from: { opacity: 1, scale: 1 },
|
|
68
68
|
to: { opacity: hasFade ? 0 : 1, scale: amount },
|
|
69
69
|
duration,
|
|
@@ -1647,7 +1647,7 @@ const createStore = (defaultState, shouldUpdate) => {
|
|
|
1647
1647
|
return map;
|
|
1648
1648
|
};
|
|
1649
1649
|
|
|
1650
|
-
const nvPopoverCss = "nv-popover{display:inline-block;position:relative}nv-popover:has([fluid]:not([fluid=false])){display:block}nv-popover>[data-scope=popover]{width:max-content;background-color:var(--components-popover-background);border-color:var(--components-popover-border);font-weight:var(--font-weight-medium-emphasis);border-width:1px;border-style:solid;border-radius:var(--popover-radius);padding:var(--popover-padding-y) var(--popover-padding-x);position:absolute;top:0;left:0;z-index:1;box-shadow:var(--popover-shadow-1-x) var(--popover-shadow-1-y) var(--popover-shadow-1-blur) -2px var(--popover-shadow-1-opacity), var(--popover-shadow-2-x) var(--popover-shadow-2-y) var(--popover-shadow-2-blur) var(--shadow-spread-lg-2) var(--popover-shadow-2-opacity)}nv-popover>[data-scope=popover][hidden]:not([hidden=false]){display:none}nv-popover>[data-scope=popover]>[data-scope=arrow]{background-color:var(--components-popover-background);position:absolute;border-color:var(--components-popover-border);border-width:1px;border-style:solid;border-bottom-color:transparent;border-right-color:transparent;width:8px;height:8px;transform:rotate(45deg);border-radius:1px}nv-popover>[data-scope=popover]>[slot=content]{position:relative;z-index:1}nv-popover>slot-fb{display:none}";
|
|
1650
|
+
const nvPopoverCss = "nv-popover{display:inline-block;position:relative}nv-popover:has([fluid]:not([fluid=false])){display:block}nv-popover[strategy=fixed]{position:static}nv-popover>[data-scope=popover]{width:max-content;background-color:var(--components-popover-background);border-color:var(--components-popover-border);font-weight:var(--font-weight-medium-emphasis);border-width:1px;border-style:solid;border-radius:var(--popover-radius);padding:var(--popover-padding-y) var(--popover-padding-x);position:absolute;top:0;left:0;z-index:1;box-shadow:var(--popover-shadow-1-x) var(--popover-shadow-1-y) var(--popover-shadow-1-blur) -2px var(--popover-shadow-1-opacity), var(--popover-shadow-2-x) var(--popover-shadow-2-y) var(--popover-shadow-2-blur) var(--shadow-spread-lg-2) var(--popover-shadow-2-opacity)}nv-popover>[data-scope=popover][hidden]:not([hidden=false]){display:none}nv-popover>[data-scope=popover][data-strategy=fixed]{position:fixed;z-index:9999}nv-popover>[data-scope=popover]>[data-scope=arrow]{background-color:var(--components-popover-background);position:absolute;border-color:var(--components-popover-border);border-width:1px;border-style:solid;border-bottom-color:transparent;border-right-color:transparent;width:8px;height:8px;transform:rotate(45deg);border-radius:1px}nv-popover>[data-scope=popover]>[slot=content]{position:relative;z-index:1}nv-popover>slot-fb{display:none}";
|
|
1651
1651
|
const NvPopoverStyle0 = nvPopoverCss;
|
|
1652
1652
|
|
|
1653
1653
|
const { state } = createStore({
|
|
@@ -1675,6 +1675,15 @@ const NvPopover = class {
|
|
|
1675
1675
|
* Defines where the popover appears relative to the trigger.
|
|
1676
1676
|
*/
|
|
1677
1677
|
this.placement = 'bottom';
|
|
1678
|
+
/**
|
|
1679
|
+
* Sets the positioning strategy for the popover. Options include:
|
|
1680
|
+
* - `absolute`: Positions the popover relative to the trigger element
|
|
1681
|
+
* (default).
|
|
1682
|
+
* - `fixed`: Positions the popover relative to the viewport, useful when you
|
|
1683
|
+
* need the popover to break out of overflow hidden containers, it will not
|
|
1684
|
+
* scroll inside a scroll container due to the fixed positioning.
|
|
1685
|
+
*/
|
|
1686
|
+
this.strategy = 'absolute';
|
|
1678
1687
|
/**
|
|
1679
1688
|
* Adjust the gap between the popover and its trigger element by setting how
|
|
1680
1689
|
* many pixels they should be apart.
|
|
@@ -1819,6 +1828,7 @@ const NvPopover = class {
|
|
|
1819
1828
|
return;
|
|
1820
1829
|
computePosition(this.triggerElement, this.popoverElement, {
|
|
1821
1830
|
placement: this.placement,
|
|
1831
|
+
strategy: this.strategy,
|
|
1822
1832
|
middleware: [
|
|
1823
1833
|
offset(this.offset),
|
|
1824
1834
|
!this.disableFlip &&
|
|
@@ -1830,10 +1840,11 @@ const NvPopover = class {
|
|
|
1830
1840
|
shift({ padding: this.shiftPadding }),
|
|
1831
1841
|
this.hasArrow && arrow({ element: this.arrowElement }),
|
|
1832
1842
|
],
|
|
1833
|
-
}).then(({ x, y, placement, middlewareData }) => {
|
|
1843
|
+
}).then(({ x, y, placement, middlewareData, strategy }) => {
|
|
1834
1844
|
Object.assign(this.popoverElement.style, {
|
|
1835
1845
|
left: `${x}px`,
|
|
1836
1846
|
top: `${y}px`,
|
|
1847
|
+
position: strategy,
|
|
1837
1848
|
});
|
|
1838
1849
|
if (this.hasArrow) {
|
|
1839
1850
|
const staticSide = {
|
|
@@ -1891,7 +1902,7 @@ const NvPopover = class {
|
|
|
1891
1902
|
duration: isOtherMemberOpen ? 0 : 100,
|
|
1892
1903
|
amount: 0.85,
|
|
1893
1904
|
});
|
|
1894
|
-
const { fadeOut } =
|
|
1905
|
+
const { fadeOut } = fade_animationEb454088.useFade(this.popoverElement, {
|
|
1895
1906
|
duration: isOtherMemberOpen ? 0 : 100,
|
|
1896
1907
|
});
|
|
1897
1908
|
if (open === true) {
|
|
@@ -1906,6 +1917,11 @@ const NvPopover = class {
|
|
|
1906
1917
|
this.isAnimating = false;
|
|
1907
1918
|
this.openChanged.emit(open);
|
|
1908
1919
|
}
|
|
1920
|
+
handleStrategyChange() {
|
|
1921
|
+
if (this.open) {
|
|
1922
|
+
this.positionPopover();
|
|
1923
|
+
}
|
|
1924
|
+
}
|
|
1909
1925
|
//#endregion WATCHERS
|
|
1910
1926
|
/****************************************************************************/
|
|
1911
1927
|
//#region LIFECYCLE
|
|
@@ -1923,7 +1939,7 @@ const NvPopover = class {
|
|
|
1923
1939
|
setGrowOut();
|
|
1924
1940
|
}
|
|
1925
1941
|
else {
|
|
1926
|
-
const { setFadeIn } =
|
|
1942
|
+
const { setFadeIn } = fade_animationEb454088.useFade(this.popoverElement);
|
|
1927
1943
|
setFadeIn();
|
|
1928
1944
|
this.popoverElement.removeAttribute('hidden');
|
|
1929
1945
|
}
|
|
@@ -1951,11 +1967,12 @@ const NvPopover = class {
|
|
|
1951
1967
|
/****************************************************************************/
|
|
1952
1968
|
//#region RENDER
|
|
1953
1969
|
render() {
|
|
1954
|
-
return (index.h(index.Host, { key: '
|
|
1970
|
+
return (index.h(index.Host, { key: 'dc7ef1862f1a1da4b32e02bee827f81545df73d1' }, index.h("slot", { key: '7535c2ba2b1f600c237602c68a04c85fd9d6d98b', name: "trigger" }), index.h("div", { key: '8e7907e2fda20d35b00642eca0507aa20e56f7cb', "data-scope": "popover", "data-strategy": this.strategy, hidden: true, ref: el => (this.popoverElement = el) }, this.hasArrow && (index.h("div", { key: '4e081e84e9597b69351253d1c1b89c115cdcfd9a', "data-scope": "arrow", ref: el => (this.arrowElement = el) })), index.h("slot", { key: '5bcd80588e9746db974cee69c5963b698665d105', name: "content" }))));
|
|
1955
1971
|
}
|
|
1956
1972
|
get el() { return index.getElement(this); }
|
|
1957
1973
|
static get watchers() { return {
|
|
1958
|
-
"open": ["handleOpenChange"]
|
|
1974
|
+
"open": ["handleOpenChange"],
|
|
1975
|
+
"strategy": ["handleStrategyChange"]
|
|
1959
1976
|
}; }
|
|
1960
1977
|
};
|
|
1961
1978
|
NvPopover.style = NvPopoverStyle0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-Jgn7NELT.js');
|
|
4
4
|
require('react');
|
|
5
5
|
|
|
6
6
|
const nvRowCss = "nv-row{display:flex;flex-wrap:wrap;margin-right:calc(var(--spacing-4) * -1);margin-left:calc(var(--spacing-4) * -1);row-gap:var(--spacing-4)}";
|
|
@@ -13,7 +13,7 @@ const NvRow = class {
|
|
|
13
13
|
/****************************************************************************/
|
|
14
14
|
//#region RENDER
|
|
15
15
|
render() {
|
|
16
|
-
return (index.h(index.Host, { key: '
|
|
16
|
+
return (index.h(index.Host, { key: '8415bdad0106bd3d836996c617a749294e0c19e2' }, index.h("slot", { key: '77c069ced0dc25c4169945877c388f30d27fdc4f' })));
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
NvRow.style = NvRowStyle0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-Jgn7NELT.js');
|
|
4
4
|
var clsx297c1ffe = require('./clsx-297c1ffe-BtxeOLZW.js');
|
|
5
5
|
require('react');
|
|
6
6
|
|
|
@@ -22,7 +22,7 @@ const NvStack = class {
|
|
|
22
22
|
/****************************************************************************/
|
|
23
23
|
//#region RENDER
|
|
24
24
|
render() {
|
|
25
|
-
return (index.h(index.Host, { key: '
|
|
25
|
+
return (index.h(index.Host, { key: '66123f22ad4a6ebefe8663c795274eb900d2c178', class: clsx297c1ffe.clsx(this.fill && 'nv-stack-fill', this.flex && 'nv-stack-flex', this.full && 'w-full', this.gutter && !this.vertical && `gap-x-${this.gutter}`, this.gutter && this.vertical && `gap-y-${this.gutter}`, this.vertical && 'nv-stack-vertical') }, index.h("slot", { key: '7b3d395c3490664f0e2f337a04f69cc717ed6c0e' })));
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
NvStack.style = NvStackStyle0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-Jgn7NELT.js');
|
|
4
4
|
var dom_utilsAc71e0ef = require('./dom.utils-ac71e0ef-CmIwRr6O.js');
|
|
5
5
|
require('react');
|
|
6
6
|
|
|
@@ -314,14 +314,14 @@ const NvTable = class {
|
|
|
314
314
|
const rows = !this.table || this.table === undefined || this.parsedData.length === 0
|
|
315
315
|
? []
|
|
316
316
|
: this.table.data;
|
|
317
|
-
return (index.h(index.Host, { key: '
|
|
317
|
+
return (index.h(index.Host, { key: 'ea0b3237145fbc199d356010f1e001797afc52d6' }, index.h("div", { key: 'd3bf41bad48e549d1799b2c8e55a308a7d767973', class: "hidden" }, index.h("slot", { key: '8263220ebd266240b16228b67f8d215d7d56afd7' })), index.h("slot", { key: '36d43d6870cf9a6021521579c0507afd1fe85081', name: "before" }), this.parsedColumns.length === 0 && this.parsedData.length === 0 ? (index.h("div", { class: "no-data" }, this.noColumnsNoDataMessage)) : (index.h("table", { class: "table" }, this.parsedColumns.length > 0 && headerGroups.length > 0 && (index.h("thead", { class: "table-header" }, index.h("tr", null, headerGroups &&
|
|
318
318
|
headerGroups.map(col => {
|
|
319
319
|
return (index.h("th", { key: col.name }, this.renderTemplate(this.headerTemplateCache.get(col.name), {}) || col.header));
|
|
320
320
|
})))), index.h("tbody", { class: "table-body" }, !rows || rows.length === 0 ? (index.h("tr", null, index.h("td", { colSpan: headerGroups.length || 12, class: "no-data" }, this.noDataMessage))) : (rows.map(row => (index.h("tr", { key: JSON.stringify(row) }, headerGroups.map(col => {
|
|
321
321
|
var _a;
|
|
322
322
|
return (index.h("td", null, this.renderTemplate(this.templateCache.get(col.name), row) ||
|
|
323
323
|
((_a = row[col.name]) !== null && _a !== void 0 ? _a : this.fallbackValue)));
|
|
324
|
-
})))))))), index.h("slot", { key: '
|
|
324
|
+
})))))))), index.h("slot", { key: '233b61e9099f58ca0eeeb7d0f7fdc7bd71bc9065', name: "after" })));
|
|
325
325
|
}
|
|
326
326
|
get el() { return index.getElement(this); }
|
|
327
327
|
static get watchers() { return {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-Jgn7NELT.js');
|
|
4
4
|
var clsx297c1ffe = require('./clsx-297c1ffe-BtxeOLZW.js');
|
|
5
5
|
var v4A79185f4 = require('./v4-a79185f4-2n0dOd_Y.js');
|
|
6
6
|
require('react');
|
|
7
7
|
|
|
8
|
-
const nvToggleCss = "nv-toggle{display:inline-flex;align-items:flex-start;gap:var(--form-gap-x);position:relative}nv-toggle:not([disabled],[readonly]) input,nv-toggle:not([disabled],[readonly]) label{cursor:pointer}nv-toggle.label-placement-before{flex-direction:row-reverse}nv-toggle[disabled]{opacity:0.5}nv-toggle label{align-self:stretch;color:var(--components-form-text-label-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-label-font-size);font-style:normal;font-weight:500;line-height:var(--form-label-line-height)}nv-toggle label.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-toggle .input-container{position:relative;color:var(--components-form-shape-foreground-default)}nv-toggle .input-container:has(input[type=checkbox]:disabled:not([readonly])){color:var(--components-form-shape-foreground-disabled)}nv-toggle .input-container input[type=checkbox]{appearance:none;position:relative;display:flex;width:var(--form-toggle-width);height:var(--form-toggle-height);flex-direction:column;align-items:flex-start;border-radius:var(--form-toggle-radius);border-width:var(--form-toggle-border-width);border-style:solid;border-color:var(--components-form-field-border-default);background:var(--components-form-field-background-default)}nv-toggle .input-container input[type=checkbox]::after{content:\"\";display:block;width:var(--form-toggle-switch-dot-default);height:var(--form-toggle-switch-dot-default);background-color:var(--components-form-shape-foreground-switch-dot);border-radius:var(--radius-rounded-full);position:absolute;top:50%;left:25%;transform:translate(-50%, -50%)}nv-toggle .input-container input[type=checkbox]:hover{border-color:var(--components-form-field-border-hover)}nv-toggle .input-container input[type=checkbox]:focus{border-color:var(--components-form-field-border-default)}nv-toggle .input-container input[type=checkbox]:focus,nv-toggle .input-container input[type=checkbox]:focus-within{outline:none}nv-toggle .input-container input[type=checkbox]:focus-visible,nv-toggle .input-container input[type=checkbox]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)
|
|
8
|
+
const nvToggleCss = "nv-toggle{display:inline-flex;align-items:flex-start;gap:var(--form-gap-x);position:relative}nv-toggle:not([disabled],[readonly]) input,nv-toggle:not([disabled],[readonly]) label{cursor:pointer}nv-toggle.label-placement-before{flex-direction:row-reverse}nv-toggle[disabled]{opacity:0.5}nv-toggle label{align-self:stretch;color:var(--components-form-text-label-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-label-font-size);font-style:normal;font-weight:500;line-height:var(--form-label-line-height)}nv-toggle label.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-toggle .input-container{position:relative;color:var(--components-form-shape-foreground-default)}nv-toggle .input-container:has(input[type=checkbox]:disabled:not([readonly])){color:var(--components-form-shape-foreground-disabled)}nv-toggle .input-container input[type=checkbox]{appearance:none;position:relative;display:flex;width:var(--form-toggle-width);height:var(--form-toggle-height);flex-direction:column;align-items:flex-start;border-radius:var(--form-toggle-radius);border-width:var(--form-toggle-border-width);border-style:solid;border-color:var(--components-form-field-border-default);background:var(--components-form-field-background-default)}nv-toggle .input-container input[type=checkbox]::after{content:\"\";display:block;width:var(--form-toggle-switch-dot-default);height:var(--form-toggle-switch-dot-default);background-color:var(--components-form-shape-foreground-switch-dot);border-radius:var(--radius-rounded-full);position:absolute;top:50%;left:25%;transform:translate(-50%, -50%)}nv-toggle .input-container input[type=checkbox]:hover{border-color:var(--components-form-field-border-hover)}nv-toggle .input-container input[type=checkbox]:focus{border-color:var(--components-form-field-border-default)}nv-toggle .input-container input[type=checkbox]:focus,nv-toggle .input-container input[type=checkbox]:focus-within{outline:none}nv-toggle .input-container input[type=checkbox]:focus-visible,nv-toggle .input-container input[type=checkbox]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-toggle .input-container input[type=checkbox]:checked{background:var(--components-form-field-background-checked);border-color:var(--components-form-field-background-checked)}nv-toggle .input-container input[type=checkbox]:checked::after{content:\"\";display:block;width:var(--form-toggle-switch-dot-default);height:var(--form-toggle-switch-dot-default);background-color:var(--components-form-shape-foreground-default);border-radius:var(--radius-rounded-full);position:absolute;top:50%;left:75%;transform:translate(-50%, -50%)}nv-toggle .input-container input[type=checkbox]:checked:focus{background:var(--components-form-field-background-checked);border-color:var(--components-form-field-border-focus)}nv-toggle .input-container input[type=checkbox]:disabled:not([readonly]){box-shadow:unset;background:var(--components-form-field-background-disabled);border-color:var(--components-form-field-border-default)}nv-toggle .input-container input[type=checkbox]:disabled:not([readonly]):checked::after{background-color:var(--components-form-shape-foreground-disabled)}nv-toggle .description{align-self:stretch;color:var(--components-form-text-description-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-description-font-size);font-style:normal;font-weight:450;line-height:var(--form-description-line-height)}nv-toggle .text-container{display:flex;flex-direction:column;align-items:flex-start;flex:1 0 0}";
|
|
9
9
|
const NvToggleStyle0 = nvToggleCss;
|
|
10
10
|
|
|
11
11
|
const NvToggle = class {
|
|
@@ -65,8 +65,8 @@ const NvToggle = class {
|
|
|
65
65
|
/****************************************************************************/
|
|
66
66
|
//#region RENDER
|
|
67
67
|
render() {
|
|
68
|
-
return (index.h(index.Host, { key: '
|
|
69
|
-
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '
|
|
68
|
+
return (index.h(index.Host, { key: 'db161d2edfcf7f83381b6431c8bc70a22c04fbf3', class: clsx297c1ffe.clsx(this.labelPlacement === 'before' && 'label-placement-before') }, index.h("div", { key: '086d6c429b4b7bcaa23093b13d30cf6ba21912f8', class: "input-container" }, index.h("input", { key: 'e83f407f2c3643c245198131a7991545b73dde78', type: "checkbox", id: this.inputId, name: this.name, autocomplete: "off", value: this.value, checked: Boolean(this.checked), disabled: this.disabled || this.readonly, readonly: this.readonly })), index.h("div", { key: 'eb5af410d1c643c70a4364948bf8fad9d54e74df', class: "text-container" }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: '54793fd81258bee7676801f23da4f5fb554242bf', htmlFor: this.inputId, class: clsx297c1ffe.clsx(this.hideLabel && 'visually-hidden') }, index.h("slot", { key: '6af650d9677d1eb0f8cfa77cbcd6318f2d6f8aaf', name: "label" }, this.label))), (this.description ||
|
|
69
|
+
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '2c157429288779ad6cc18d4e318e64830a657c54', class: "description" }, index.h("slot", { key: 'fcfae2a0d7cdcc76d4b23c4b376c8e2496e11bb5', name: "description" }, this.description))))));
|
|
70
70
|
}
|
|
71
71
|
static get formAssociated() { return true; }
|
|
72
72
|
get el() { return index.getElement(this); }
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-Jgn7NELT.js');
|
|
4
|
+
require('react');
|
|
5
|
+
|
|
6
|
+
const nvTogglebuttonCss = "nv-togglebutton{display:inline-flex;justify-content:center;align-items:center}nv-togglebutton:focus-visible,nv-togglebutton:has(:focus-visible){z-index:1}nv-togglebutton[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);padding-top:calc(var(--togglegroup-xs-button-padding-y) - 1px);padding-bottom:calc(var(--togglegroup-xs-button-padding-y) - 1px);border-radius:calc(var(--togglegroup-xs-button-radius));border-width:0}nv-togglebutton[size=xs] nv-icon>svg{width:var(--spacing-3);height:var(--spacing-3);stroke-width:1.2px}nv-togglebutton[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);padding-top:calc(var(--togglegroup-sm-button-padding-y) - 1px);padding-bottom:calc(var(--togglegroup-sm-button-padding-y) - 1px);border-radius:calc(var(--togglegroup-sm-button-radius));border-width:0}nv-togglebutton[size=sm] nv-icon>svg{width:var(--spacing-4);height:var(--spacing-4);stroke-width:1.5px}nv-togglebutton[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);padding-top:calc(var(--togglegroup-md-button-padding-y) - 1px);padding-bottom:calc(var(--togglegroup-md-button-padding-y) - 1px);border-radius:calc(var(--togglegroup-md-button-radius));border-width:0}nv-togglebutton[size=md] nv-icon>svg{width:var(--spacing-5);height:var(--spacing-5);stroke-width:1.6px}nv-togglebutton[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);padding-top:calc(var(--togglegroup-lg-button-padding-y) - 1px);padding-bottom:calc(var(--togglegroup-lg-button-padding-y) - 1px);border-radius:calc(var(--togglegroup-lg-button-radius));border-width:0}nv-togglebutton[size=lg] nv-icon>svg{width:var(--spacing-6);height:var(--spacing-6);stroke-width:1.8px}nv-togglebutton[emphasis=high]{background:var(--components-button-low-background);border:1px solid var(--components-button-low-border);color:var(--components-button-low-text)}nv-togglebutton[emphasis=high]:hover{background:var(--components-button-low-background-hover);border:1px solid var(--components-button-low-border);color:var(--components-button-low-text-hover)}nv-togglebutton[emphasis=high]: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-togglebutton[emphasis=high]:focus,nv-togglebutton[emphasis=high]:focus-within{outline:none}nv-togglebutton[emphasis=high]:focus-visible,nv-togglebutton[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-togglebutton[emphasis=high]:disabled:not([disabled=false]){opacity:0.5;cursor:not-allowed;box-shadow:none}nv-togglebutton[emphasis=high][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-togglebutton[emphasis=low]{background:var(--components-button-lower-background);border:1px solid var(--components-button-lower-border);color:var(--components-button-lower-text)}nv-togglebutton[emphasis=low]:hover{background:var(--components-button-lower-background-hover);border:1px solid var(--components-button-lower-border);color:var(--components-button-lower-text-hover)}nv-togglebutton[emphasis=low]: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-togglebutton[emphasis=low]:focus,nv-togglebutton[emphasis=low]:focus-within{outline:none}nv-togglebutton[emphasis=low]:focus-visible,nv-togglebutton[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-togglebutton[emphasis=low]:disabled:not([disabled=false]){opacity:0.5;cursor:not-allowed;box-shadow:none}nv-togglebutton[emphasis=low][active]:not([active=false]),nv-togglebutton[emphasis=low]:active{background:var(--components-button-lower-background-hover);border:1px solid var(--components-button-lower-border);color:var(--components-button-lower-text-hover)}";
|
|
7
|
+
const NvTogglebuttonStyle0 = nvTogglebuttonCss;
|
|
8
|
+
|
|
9
|
+
const NvTogglebutton = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.toggled = index.createEvent(this, "toggled");
|
|
13
|
+
/****************************************************************************/
|
|
14
|
+
//#region PROPERTIES
|
|
15
|
+
/**
|
|
16
|
+
* Determines how large or small the togglebutton appears, allowing for
|
|
17
|
+
* customization of the togglebutton's dimensions to fit different design
|
|
18
|
+
* specifications and user needs.
|
|
19
|
+
*/
|
|
20
|
+
this.size = 'md';
|
|
21
|
+
/**
|
|
22
|
+
* Prevents all interaction, rendering the toggle in a non-interactive state.
|
|
23
|
+
*/
|
|
24
|
+
this.disabled = false;
|
|
25
|
+
/**
|
|
26
|
+
* Whether the button is active or not. Will not toggle automatically but
|
|
27
|
+
* needs to be controlled externally.
|
|
28
|
+
*/
|
|
29
|
+
this.active = false;
|
|
30
|
+
/**
|
|
31
|
+
* Make it more or less visually prominent to users.
|
|
32
|
+
*/
|
|
33
|
+
this.emphasis = 'high';
|
|
34
|
+
//#endregion PROPERTIES
|
|
35
|
+
/****************************************************************************/
|
|
36
|
+
//#region METHODS
|
|
37
|
+
this.handleClick = () => {
|
|
38
|
+
if (this.disabled)
|
|
39
|
+
return;
|
|
40
|
+
this.toggled.emit({
|
|
41
|
+
value: this.value,
|
|
42
|
+
active: this.active,
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
//#endregion EVENTS
|
|
47
|
+
/****************************************************************************/
|
|
48
|
+
//#region RENDER
|
|
49
|
+
render() {
|
|
50
|
+
return (index.h(index.Host, { key: 'cb15a84c7e7cc27a80773613f31b98168eee8475', role: "button", tabindex: "0", "aria-pressed": String(this.active), onClick: this.handleClick }, index.h("slot", { key: '32d6b9394088d88c4671fb7809ad6aa85b240fff' })));
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
NvTogglebutton.style = NvTogglebuttonStyle0;
|
|
54
|
+
|
|
55
|
+
exports.nv_togglebutton = NvTogglebutton;
|
package/dist/cjs/{nv-togglebuttongroup.entry-JZNZk6j2.js → nv-togglebuttongroup.entry-BNvyZgbh.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-Jgn7NELT.js');
|
|
4
4
|
require('react');
|
|
5
5
|
|
|
6
6
|
const nvTogglebuttongroupCss = "nv-togglebuttongroup{display:flex;gap:var(--togglegroup-lg-gap);border-radius:var(--togglegroup-lg-radius);width:fit-content;padding:var(--togglegroup-lg-gap)}nv-togglebuttongroup[emphasis=high]{border:1px solid var(--components-togglegroup-high-border)}nv-togglebuttongroup[emphasis=low]{border:1px solid var(--components-togglegroup-low-border)}nv-togglebuttongroup[size=xs]{padding:calc(var(--togglegroup-xs-padding) - 1px);gap:var(--togglegroup-xs-gap);border-radius:var(--togglegroup-xs-radius)}nv-togglebuttongroup[size=sm]{padding:calc(var(--togglegroup-sm-padding) - 1px);gap:var(--togglegroup-sm-gap);border-radius:var(--togglegroup-sm-radius)}nv-togglebuttongroup[size=md]{padding:calc(var(--togglegroup-md-padding) - 1px);gap:var(--togglegroup-md-gap);border-radius:var(--togglegroup-md-radius)}nv-togglebuttongroup[size=lg]{padding:calc(var(--togglegroup-lg-padding) - 1px);gap:var(--togglegroup-lg-gap);border-radius:var(--togglegroup-lg-radius)}";
|
|
@@ -155,7 +155,7 @@ const NvTogglebuttongroup = class {
|
|
|
155
155
|
/****************************************************************************/
|
|
156
156
|
//#region RENDER
|
|
157
157
|
render() {
|
|
158
|
-
return (index.h(index.Host, { key: '
|
|
158
|
+
return (index.h(index.Host, { key: 'ce185699fabd71bb5c22e5a0d73df88067acb9d6' }, index.h("slot", { key: 'a1e375fb1e8660f3fdb75d96f18db20735a3a64d' })));
|
|
159
159
|
}
|
|
160
160
|
get el() { return index.getElement(this); }
|
|
161
161
|
static get watchers() { return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-Jgn7NELT.js');
|
|
4
4
|
require('react');
|
|
5
5
|
|
|
6
6
|
const nvTooltipCss = "nv-tooltip{display:inline-block;position:relative;user-select:none}nv-tooltip:has([fluid]:not([fluid=false])){display:block}nv-tooltip nv-popover>[data-scope=popover]{background:var(--components-tooltip-background);color:var(--components-tooltip-text);font-weight:var(--font-weight-medium-emphasis);padding:var(--tooltip-padding-y) var(--tooltip-padding-x);font-size:var(--tooltip-font-size);border-radius:var(--tooltip-radius);border:none;box-shadow:0px var(--shadow-y-axis-lg-1) var(--shadow-blur-lg-1) var(--shadow-spread-lg-1) var(--shadow-color-opacity-1), 0px var(--shadow-y-axis-lg-2) var(--shadow-blur-lg-2) var(--shadow-spread-lg-2) var(--shadow-color-opacity-2)}nv-tooltip nv-popover>[data-scope=popover] [data-scope=arrow]{background:var(--components-tooltip-background);box-shadow:none;border:none}";
|
|
@@ -19,9 +19,18 @@ const NvTooltip = class {
|
|
|
19
19
|
/**
|
|
20
20
|
* Controls how long (in milliseconds) the tooltip waits to show after you
|
|
21
21
|
* hover over or focus on an element. If you move away before the delay is up,
|
|
22
|
-
* the tooltip won
|
|
22
|
+
* the tooltip won't appear.
|
|
23
23
|
*/
|
|
24
24
|
this.enterDelay = 0;
|
|
25
|
+
/**
|
|
26
|
+
* Sets the positioning strategy for the tooltip. Options include:
|
|
27
|
+
* - `absolute`: Positions the tooltip relative to the trigger element
|
|
28
|
+
* (default).
|
|
29
|
+
* - `fixed`: Positions the tooltip relative to the viewport, useful when you
|
|
30
|
+
* need the tooltip to break out of overflow hidden containers, it will not
|
|
31
|
+
* scroll inside a scroll container due to the fixed positioning.
|
|
32
|
+
*/
|
|
33
|
+
this.strategy = 'absolute';
|
|
25
34
|
}
|
|
26
35
|
//#endregion EVENTS
|
|
27
36
|
/****************************************************************************/
|
|
@@ -36,7 +45,7 @@ const NvTooltip = class {
|
|
|
36
45
|
/****************************************************************************/
|
|
37
46
|
//#region RENDER
|
|
38
47
|
render() {
|
|
39
|
-
return (index.h(index.Host, { key: '
|
|
48
|
+
return (index.h(index.Host, { key: 'e0b68e5ade824e2b0f9c5e5cac140349412c919d' }, index.h("slot", { key: 'd61a58d034818fdba87b4ab17ce903bbb13a47ff' }), index.h("nv-popover", { key: '408df675045f95adf270025f83285b2e125873c5', triggerMode: "hover", hasArrow: true, placement: this.placement, strategy: this.strategy, triggerElement: this.triggerElement, groupName: 'tooltip', enterDelay: this.enterDelay }, index.h("p", { key: 'e4f860f09f5e5ef83b5e704c271781f41a643e59', slot: "content" }, this.message), index.h("slot", { key: '2e2e4dcae68651d734696e718c59389f712562df', name: "content" }))));
|
|
40
49
|
}
|
|
41
50
|
get el() { return index.getElement(this); }
|
|
42
51
|
};
|