@nova-design-system/nova-react 3.23.0 → 3.25.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.
Files changed (103) hide show
  1. package/README.md +1 -0
  2. package/dist/cjs/dom.utils-CuXVGECR-8VY5SfMZ.js +177 -0
  3. package/dist/cjs/events.utils-B6GgGra--01N__3wY.js +23 -0
  4. package/dist/cjs/generated/components.server.js +124 -58
  5. package/dist/cjs/{grow.animation-CvHGHBL4-DDIEYBK-.js → grow.animation-D7ep_aVl-BuXEDSK-.js} +0 -21
  6. package/dist/cjs/{i18n.utils-DOZbXX2L-BizoXo6c.js → i18n.utils-IlwlcG9l-ku0bScip.js} +14 -18
  7. package/dist/cjs/index-DUlunl9a.js +9696 -0
  8. package/dist/cjs/{nv-dialog.entry-O47Eol_7.js → index.esm-D3eWMME9-CG1TVKfu.js} +1 -296
  9. package/dist/cjs/index.js +5 -1
  10. package/dist/cjs/{nv-accordion-item.entry-B_l0-ux0.js → nv-accordion-item.entry-CqnjIt4R.js} +8 -7
  11. package/dist/cjs/{nv-accordion.entry-BX8_YuZF.js → nv-accordion.entry-Dx7FmGg_.js} +11 -14
  12. package/dist/cjs/{nv-alert.entry-DCWYR0OK.js → nv-alert.entry-BL3Pdcxd.js} +7 -6
  13. package/dist/cjs/nv-avatar.entry-2dFR4I9_.js +68 -0
  14. package/dist/cjs/nv-badge_2.entry-5FShR2Ax.js +218 -0
  15. package/dist/cjs/nv-breadcrumb.entry-Cfi32bBT.js +49 -0
  16. package/dist/cjs/nv-breadcrumbs.entry-BSgn3KUO.js +21 -0
  17. package/dist/cjs/nv-button.entry-BdQQ_LE7.js +166 -0
  18. package/dist/cjs/{nv-buttongroup.entry-BZaTKN_n.js → nv-buttongroup.entry-BM8CwXFK.js} +13 -7
  19. package/dist/cjs/{nv-calendar.entry-D9ESuu7C.js → nv-calendar.entry-CeKsMGOa.js} +39 -32
  20. package/dist/cjs/nv-col.entry-D-h2PGcz.js +38 -0
  21. package/dist/cjs/{nv-datagrid.entry-DcB5q2oC.js → nv-datagrid.entry-nOBIfqOS.js} +113 -255
  22. package/dist/cjs/{nv-datagridcolumn.entry-BhKOzXA6.js → nv-datagridcolumn.entry-BAzTU_KM.js} +2 -2
  23. package/dist/cjs/nv-dialog.entry-Bi2ZVSe2.js +299 -0
  24. package/dist/cjs/{nv-dialogfooter_2.entry-Dn16bI8a.js → nv-dialogfooter_2.entry-D6lzC-3S.js} +11 -29
  25. package/dist/cjs/nv-drawer.entry-Dp4AfBiF.js +445 -0
  26. package/dist/cjs/nv-drawerfooter_2.entry-DpWSsq6d.js +128 -0
  27. package/dist/cjs/nv-fieldcheckbox.entry-COA3LXnX.js +179 -0
  28. package/dist/cjs/{nv-fielddate.entry-B4P0U8QG.js → nv-fielddate.entry-B8r5RFXd.js} +20 -21
  29. package/dist/cjs/{nv-fielddaterange.entry-BORwYJ-k.js → nv-fielddaterange.entry-C6_Kq93P.js} +20 -19
  30. package/dist/cjs/{nv-fielddropdown.entry-DzBAIynY.js → nv-fielddropdown.entry-B2Dr5zHd.js} +51 -58
  31. package/dist/cjs/nv-fielddropdownitem.entry-DapivVnR.js +69 -0
  32. package/dist/cjs/{nv-fieldmultiselect.entry-DiqRreWh.js → nv-fieldmultiselect.entry-DSpQeiPx.js} +45 -49
  33. package/dist/cjs/nv-fieldnumber.entry-BwxR9sRr.js +189 -0
  34. package/dist/cjs/nv-fieldpassword.entry-BOSU-Skh.js +167 -0
  35. package/dist/cjs/nv-fieldradio.entry-ZFafNY5_.js +105 -0
  36. package/dist/cjs/nv-fieldselect.entry-CfWjQAd9.js +405 -0
  37. package/dist/cjs/{nv-fieldslider.entry-CozmnUfN.js → nv-fieldslider.entry-dDPcWUxs.js} +34 -16
  38. package/dist/cjs/nv-fieldtext.entry-Yaa-mkjJ.js +163 -0
  39. package/dist/cjs/{nv-fieldtextarea.entry-7UrKWDHg.js → nv-fieldtextarea.entry-Dp_l2pKZ.js} +18 -13
  40. package/dist/cjs/{nv-fieldtime.entry-DakOlLiO.js → nv-fieldtime.entry-CWxi4Uel.js} +38 -40
  41. package/dist/cjs/{nv-icon.entry-Db00kB2u.js → nv-icon.entry-Dci11W9S.js} +5 -5
  42. package/dist/cjs/nv-iconbutton_2.entry-A6FKFJT_.js +171 -0
  43. package/dist/cjs/{nv-menu.entry-CK2HdmBt.js → nv-menu.entry-BHaYP-9M.js} +11 -16
  44. package/dist/cjs/nv-menuitem.entry-Cm1vvN25.js +59 -0
  45. package/dist/cjs/nv-notification-bullet.entry-DRlS3Ybc.js +76 -0
  46. package/dist/cjs/nv-notification.entry-BeDmR-XC.js +176 -0
  47. package/dist/cjs/nv-notificationcontainer.entry-C3p_87Dg.js +41 -0
  48. package/dist/cjs/nv-paginationtable.entry-BzEqQOBa.js +231 -0
  49. package/dist/cjs/{nv-popover.entry-mLdLSp6n.js → nv-popover.entry-D2oFn9vL.js} +118 -46
  50. package/dist/cjs/nv-row.entry-hV1kxmrr.js +22 -0
  51. package/dist/cjs/{nv-sidebar.entry-inDVNJ4s.js → nv-sidebar.entry-BJrqJ8K7.js} +12 -8
  52. package/dist/cjs/nv-sidebarcontent.entry-CPfGF7nx.js +22 -0
  53. package/dist/cjs/{nv-sidebardivider.entry-D_yern0R.js → nv-sidebardivider.entry-D2wmzHCO.js} +4 -4
  54. package/dist/cjs/{nv-sidebarfooter.entry-Rkkn9TB_.js → nv-sidebarfooter.entry-C7fqCzjH.js} +4 -4
  55. package/dist/cjs/nv-sidebargroup.entry-qkXnxhs_.js +23 -0
  56. package/dist/cjs/{nv-sidebarheader.entry-CYpD_4pI.js → nv-sidebarheader.entry-DBsOmyQ0.js} +4 -4
  57. package/dist/cjs/{nv-sidebarlogo.entry-BgK03M1v.js → nv-sidebarlogo.entry-902Ht3UR.js} +4 -4
  58. package/dist/cjs/{nv-sidebarnavitem.entry-DglvcCOD.js → nv-sidebarnavitem.entry-CICrllp8.js} +11 -10
  59. package/dist/cjs/nv-sidebarnavsubitem.entry-Q9jjU_7D.js +35 -0
  60. package/dist/cjs/{nv-split.entry-mzg2F66T.js → nv-split.entry-BYIsE2wp.js} +51 -45
  61. package/dist/cjs/nv-stack.entry-DgE5ASGH.js +31 -0
  62. package/dist/cjs/{nv-table.entry-DkbNgxtI.js → nv-table.entry-DHXBu2n1.js} +9 -11
  63. package/dist/cjs/{nv-tableheader.entry-CRVFTQA-.js → nv-tableheader.entry-BijgOxcO.js} +5 -5
  64. package/dist/cjs/nv-toggle.entry-CMI1WdvV.js +82 -0
  65. package/dist/cjs/nv-togglebutton.entry-DAPETEmF.js +66 -0
  66. package/dist/cjs/{nv-togglebuttongroup.entry-BYXX5ejg.js → nv-togglebuttongroup.entry-CzDI1XCr.js} +14 -11
  67. package/dist/cjs/nv-tooltip.entry-DPoUP9iL.js +56 -0
  68. package/dist/cjs/slide.animation-CmH5d1of-BZuw607U.js +90 -0
  69. package/dist/components/NvDatatable/NvDatatable.js +69 -32
  70. package/dist/generated/components.js +38 -0
  71. package/dist/generated/components.server.js +120 -58
  72. package/dist/types/components/NvDatatable/NvDatatable.d.ts +1 -1
  73. package/dist/types/components/NvDatatable/types.d.ts +13 -3
  74. package/dist/types/generated/components.d.ts +63 -43
  75. package/dist/types/generated/components.server.d.ts +63 -43
  76. package/package.json +2 -2
  77. package/dist/cjs/index-CtjeeUI-.js +0 -39617
  78. package/dist/cjs/nv-avatar.entry-C_xZD3Lp.js +0 -68
  79. package/dist/cjs/nv-badge_2.entry-JjqANStV.js +0 -213
  80. package/dist/cjs/nv-breadcrumb.entry-DQZDn6cm.js +0 -46
  81. package/dist/cjs/nv-breadcrumbs.entry-Bz0GjhY_.js +0 -21
  82. package/dist/cjs/nv-button.entry-Br1DH9Vj.js +0 -164
  83. package/dist/cjs/nv-col.entry-CfgPMMxS.js +0 -38
  84. package/dist/cjs/nv-fieldcheckbox.entry-Bx6ArV_b.js +0 -177
  85. package/dist/cjs/nv-fielddropdownitem.entry-C_17isWd.js +0 -73
  86. package/dist/cjs/nv-fieldnumber.entry-C9O4UPp3.js +0 -187
  87. package/dist/cjs/nv-fieldpassword.entry-BfVJNT0A.js +0 -165
  88. package/dist/cjs/nv-fieldradio.entry-CG22oETM.js +0 -103
  89. package/dist/cjs/nv-fieldselect.entry-BPQEtrv2.js +0 -397
  90. package/dist/cjs/nv-fieldtext.entry-BD-z01ru.js +0 -163
  91. package/dist/cjs/nv-iconbutton_2.entry-CaKCa8NT.js +0 -168
  92. package/dist/cjs/nv-menuitem.entry-mKMqCAdz.js +0 -60
  93. package/dist/cjs/nv-notification-bullet.entry-DtbjtFxs.js +0 -77
  94. package/dist/cjs/nv-notification.entry-CLb0gNu3.js +0 -262
  95. package/dist/cjs/nv-notificationcontainer.entry-Cijivlm6.js +0 -41
  96. package/dist/cjs/nv-row.entry-C2C94fcv.js +0 -22
  97. package/dist/cjs/nv-sidebarcontent.entry-DxoljE15.js +0 -22
  98. package/dist/cjs/nv-sidebargroup.entry-C1p9qqxr.js +0 -23
  99. package/dist/cjs/nv-sidebarnavsubitem.entry-Dt1jKmC-.js +0 -35
  100. package/dist/cjs/nv-stack.entry-nnvjTrBy.js +0 -31
  101. package/dist/cjs/nv-toggle.entry-oC9TVkr1.js +0 -80
  102. package/dist/cjs/nv-togglebutton.entry-BTWCzbS9.js +0 -67
  103. package/dist/cjs/nv-tooltip.entry-OJGxfJEh.js +0 -55
@@ -1,168 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-CtjeeUI-.js');
4
- var clsxChV9xqsO = require('./clsx-ChV9xqsO-BtxeOLZW.js');
5
- require('@stencil/react-output-target/runtime');
6
- require('react');
7
- require('react-dom');
8
-
9
- const nvIconbuttonCss = "nv-iconbutton.root{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;height:fit-content;width:fit-content}nv-iconbutton.size-xs{padding:var(--button-xs-icon-button-padding);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-iconbutton.size-sm{padding:var(--button-sm-icon-button-padding);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-iconbutton.size-md{padding:var(--button-md-icon-button-padding);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-iconbutton.size-lg{padding:var(--button-lg-icon-button-padding);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-iconbutton.emphasis-high{background:var(--components-button-high-background);border:1px solid var(--components-button-high-border);color:var(--components-button-high-text)}nv-iconbutton.emphasis-high:hover{background:var(--components-button-high-background-hover);color:var(--components-button-high-text-hover)}nv-iconbutton.emphasis-high:focus,nv-iconbutton.emphasis-high:focus-within{outline:none}nv-iconbutton.emphasis-high:focus-visible,nv-iconbutton.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-iconbutton.emphasis-high:disabled{background:var(--components-button-high-background);color:var(--components-button-high-text);opacity:0.5;cursor:not-allowed;box-shadow:none}nv-iconbutton.emphasis-high nv-icon>svg{color:var(--components-button-high-icon)}nv-iconbutton.emphasis-medium{background:var(--components-button-medium-background);border:1px solid var(--components-button-medium-border);color:var(--components-button-medium-text)}nv-iconbutton.emphasis-medium:hover{background:var(--components-button-medium-background-hover);color:var(--components-button-medium-text-hover)}nv-iconbutton.emphasis-medium:focus,nv-iconbutton.emphasis-medium:focus-within{outline:none}nv-iconbutton.emphasis-medium:focus-visible,nv-iconbutton.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-iconbutton.emphasis-medium:disabled{background:var(--components-button-medium-background);color:var(--components-button-medium-text);opacity:0.5;cursor:not-allowed;box-shadow:none}nv-iconbutton.emphasis-medium nv-icon>svg{color:var(--components-button-medium-icon)}nv-iconbutton.emphasis-low{background:var(--components-button-low-background);border:1px solid var(--components-button-low-border);color:var(--components-button-low-text)}nv-iconbutton.emphasis-low:hover{background:var(--components-button-low-background-hover);color:var(--components-button-low-text-hover)}nv-iconbutton.emphasis-low:focus,nv-iconbutton.emphasis-low:focus-within{outline:none}nv-iconbutton.emphasis-low:focus-visible,nv-iconbutton.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-iconbutton.emphasis-low:disabled{background:var(--components-button-low-background);color:var(--components-button-low-text);opacity:0.5;cursor:not-allowed;box-shadow:none}nv-iconbutton.emphasis-low nv-icon>svg{color:var(--components-button-low-icon)}nv-iconbutton.emphasis-lower{background:var(--components-button-lower-background);border:1px solid var(--components-button-lower-border);color:var(--components-button-lower-text)}nv-iconbutton.emphasis-lower:hover{background:var(--components-button-lower-background-hover);color:var(--components-button-lower-text-hover)}nv-iconbutton.emphasis-lower:focus,nv-iconbutton.emphasis-lower:focus-within{outline:none}nv-iconbutton.emphasis-lower:focus-visible,nv-iconbutton.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-iconbutton.emphasis-lower:disabled{background:var(--components-button-lower-background);color:var(--components-button-lower-text);opacity:0.5;cursor:not-allowed;box-shadow:none}nv-iconbutton.emphasis-lower nv-icon>svg{color:var(--components-button-lower-icon)}nv-iconbutton.loading [slot=leading-icon]{display:none}nv-iconbutton.shape-rounded{border-radius:var(--radius-rounded-full)}";
10
-
11
- const NvIconbutton = 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
- * Set this to true to show a spinner on the button, letting users know that
37
- * their action is being processed. It helps improve user experience by
38
- * indicating ongoing activities. The icon is not displayed when the button
39
- * is loading. Also, the button is disabled. If you want to disable the
40
- * button, it is not possible. It is automatically disabled when loading.
41
- */
42
- this.loading = false;
43
- /**
44
- * Disables the button, preventing user interaction.
45
- */
46
- this.disabled = false;
47
- /**
48
- * Makes the button look active when it’s within a compatible component
49
- * like a button group.
50
- */
51
- this.active = false;
52
- /**
53
- * Sets the button type to control its function in forms. Use 'submit' to send
54
- * form data, 'reset' to clear the form, or 'button' for a standard button
55
- * that doesn’t interact with form submission by default.
56
- */
57
- this.type = 'button';
58
- /**
59
- * Sets the shape of the button. Choose between square and rounded.
60
- */
61
- this.shape = 'square';
62
- /**
63
- * Use this to make the button skip-able when users navigate with the keyboard.
64
- * The button remains clickable but won’t be reached via the Tab key.
65
- */
66
- this.disableTabindex = false;
67
- //#endregion PROPERTIES
68
- /****************************************************************************/
69
- //#region METHODS
70
- /**
71
- * Handles form-related actions when the button is clicked.
72
- * - Submits the form if the button type is 'submit'.
73
- * - Resets the form if the button type is 'reset'.
74
- * @param {Event} event - The click event.
75
- */
76
- this.handleClick = (event) => {
77
- var _a, _b, _c, _d;
78
- if (this.disabled) {
79
- event.preventDefault();
80
- return;
81
- }
82
- if (this.type === 'submit') {
83
- (_b = (_a = this.internals) === null || _a === void 0 ? void 0 : _a.form) === null || _b === void 0 ? void 0 : _b.requestSubmit();
84
- }
85
- if (this.type === 'reset') {
86
- (_d = (_c = this.internals) === null || _c === void 0 ? void 0 : _c.form) === null || _d === void 0 ? void 0 : _d.reset();
87
- }
88
- };
89
- }
90
- //#endregion METHODS
91
- /****************************************************************************/
92
- //#region WATCHERS
93
- handleLoadingChange(loading) {
94
- this.loading = loading;
95
- this.disabled = loading;
96
- }
97
- handleDisabledChange(disabled) {
98
- if (this.loading) {
99
- this.disabled = this.loading;
100
- }
101
- else {
102
- this.disabled = disabled;
103
- }
104
- }
105
- //#endregion WATCHERS
106
- /****************************************************************************/
107
- //#region EVENTS
108
- handleKeyDown(event) {
109
- if (event.key === 'Enter' || event.key === ' ') {
110
- event.preventDefault();
111
- this.el.click();
112
- }
113
- }
114
- handleTouchStart(event) {
115
- if (event.touches.length > 1)
116
- return;
117
- event.preventDefault();
118
- this.el.click();
119
- }
120
- //#endregion EVENTS
121
- /****************************************************************************/
122
- //#region LIFECYCLE
123
- componentWillLoad() {
124
- if (this.loading) {
125
- this.disabled = this.loading;
126
- }
127
- }
128
- //#endregion LIFECYCLE
129
- /****************************************************************************/
130
- //#region RENDER
131
- render() {
132
- return (index.h(index.Host, { key: '81d7f0bfd1e64ecbb640c2f02b7e73cd7b2d3aa4', role: "button", type: this.type, tabindex: this.disableTabindex ? -1 : 0, disabled: this.disabled ? true : undefined, class: clsxChV9xqsO.clsx('root', `size-${this.size}`, `emphasis-${this.emphasis}`, this.loading && 'loading', `shape-${this.shape}`), onClick: this.handleClick }, this.loading && index.h("nv-loader", { key: 'cec3ee02a7fb0882557c8742c8f9d785835e79d0', size: this.size }), !this.loading && index.h("nv-icon", { key: '4892b3b78b291b159403a63ced6a150dd7def1c0', name: this.name, size: this.size }), index.h("slot", { key: 'b1204bf2dd026c1232b5e8209fd29f21a8aa704f' })));
133
- }
134
- static get formAssociated() { return true; }
135
- get el() { return index.getElement(this); }
136
- static get watchers() { return {
137
- "loading": ["handleLoadingChange"],
138
- "disabled": ["handleDisabledChange"]
139
- }; }
140
- };
141
- NvIconbutton.style = nvIconbuttonCss;
142
-
143
- const nvLoaderCss = "@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}nv-loader{display:inline-block;position:relative;aspect-ratio:1/1;border-radius:9999px;color:inherit}nv-loader.size-xs{width:var(--loader-size-xs);height:var(--loader-size-xs)}nv-loader.size-xs::before,nv-loader.size-xs::after{content:\" \";position:absolute;top:0;left:0;border-radius:inherit;width:100%;height:100%}nv-loader.size-xs::before{content:\" \";border:calc(var(--loader-size-xs) / 10) solid;opacity:0.3}nv-loader.size-xs::after{content:\" \";border-top:calc(var(--loader-size-xs) / 10) solid transparent;border-left:calc(var(--loader-size-xs) / 10) solid transparent;border-right:calc(var(--loader-size-xs) / 10) solid transparent;border-bottom:calc(var(--loader-size-xs) / 10) solid;animation:rotation 1s linear infinite}nv-loader.size-sm{width:var(--loader-size-sm);height:var(--loader-size-sm)}nv-loader.size-sm::before,nv-loader.size-sm::after{content:\" \";position:absolute;top:0;left:0;border-radius:inherit;width:100%;height:100%}nv-loader.size-sm::before{content:\" \";border:calc(var(--loader-size-sm) / 10) solid;opacity:0.3}nv-loader.size-sm::after{content:\" \";border-top:calc(var(--loader-size-sm) / 10) solid transparent;border-left:calc(var(--loader-size-sm) / 10) solid transparent;border-right:calc(var(--loader-size-sm) / 10) solid transparent;border-bottom:calc(var(--loader-size-sm) / 10) solid;animation:rotation 1s linear infinite}nv-loader.size-md{width:var(--loader-size-md);height:var(--loader-size-md)}nv-loader.size-md::before,nv-loader.size-md::after{content:\" \";position:absolute;top:0;left:0;border-radius:inherit;width:100%;height:100%}nv-loader.size-md::before{content:\" \";border:calc(var(--loader-size-md) / 10) solid;opacity:0.3}nv-loader.size-md::after{content:\" \";border-top:calc(var(--loader-size-md) / 10) solid transparent;border-left:calc(var(--loader-size-md) / 10) solid transparent;border-right:calc(var(--loader-size-md) / 10) solid transparent;border-bottom:calc(var(--loader-size-md) / 10) solid;animation:rotation 1s linear infinite}nv-loader.size-lg{width:var(--loader-size-lg);height:var(--loader-size-lg)}nv-loader.size-lg::before,nv-loader.size-lg::after{content:\" \";position:absolute;top:0;left:0;border-radius:inherit;width:100%;height:100%}nv-loader.size-lg::before{content:\" \";border:calc(var(--loader-size-lg) / 10) solid;opacity:0.3}nv-loader.size-lg::after{content:\" \";border-top:calc(var(--loader-size-lg) / 10) solid transparent;border-left:calc(var(--loader-size-lg) / 10) solid transparent;border-right:calc(var(--loader-size-lg) / 10) solid transparent;border-bottom:calc(var(--loader-size-lg) / 10) solid;animation:rotation 1s linear infinite}nv-loader.size-xl{width:var(--loader-size-xl);height:var(--loader-size-xl)}nv-loader.size-xl::before,nv-loader.size-xl::after{content:\" \";position:absolute;top:0;left:0;border-radius:inherit;width:100%;height:100%}nv-loader.size-xl::before{content:\" \";border:calc(var(--loader-size-xl) / 10) solid;opacity:0.3}nv-loader.size-xl::after{content:\" \";border-top:calc(var(--loader-size-xl) / 10) solid transparent;border-left:calc(var(--loader-size-xl) / 10) solid transparent;border-right:calc(var(--loader-size-xl) / 10) solid transparent;border-bottom:calc(var(--loader-size-xl) / 10) solid;animation:rotation 1s linear infinite}nv-loader.color-brand::before{border-color:var(--components-loader-brand-background);opacity:1}nv-loader.color-brand::after{border-bottom-color:var(--components-loader-brand-foreground)}nv-loader.color-white::before{border-color:var(--components-loader-white-background);opacity:1}nv-loader.color-white::after{border-bottom-color:var(--components-loader-white-foreground)}";
144
-
145
- const NvLoader = class {
146
- constructor(hostRef) {
147
- index.registerInstance(this, hostRef);
148
- /****************************************************************************/
149
- //#region PROPERTIES
150
- /**
151
- * Choose the size of the loader to best fit your application’s needs, whether
152
- * it’s a small spinner for subtle loading indicators or a large one for more
153
- * prominent displays.
154
- */
155
- this.size = 'md';
156
- }
157
- //#endregion PROPERTIES
158
- /****************************************************************************/
159
- //#region RENDER
160
- /* <slot> empty to force rendering change */
161
- render() {
162
- return (index.h(index.Host, { key: '049afa243c1ce99643408d86afa99e69c5468b8b', class: clsxChV9xqsO.clsx(this.size && `size-${this.size}`, this.color && `color-${this.color}`) }));
163
- }
164
- };
165
- NvLoader.style = nvLoaderCss;
166
-
167
- exports.nv_iconbutton = NvIconbutton;
168
- exports.nv_loader = NvLoader;
@@ -1,60 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-CtjeeUI-.js');
4
- require('@stencil/react-output-target/runtime');
5
- require('react');
6
- require('react-dom');
7
-
8
- 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)}";
9
-
10
- const NvMenuitem = class {
11
- constructor(hostRef) {
12
- index.registerInstance(this, hostRef);
13
- this.menuitemSelected = index.createEvent(this, "menuitemSelected", 7);
14
- /**
15
- * Disables the item, preventing user interaction.
16
- */
17
- this.disabled = false;
18
- /**
19
- * If the menu item has a submenu, the a caret icon will be displayed.
20
- */
21
- this.hasSubmenu = false;
22
- }
23
- /* eslint-enable nova/event-bubbling */
24
- handleMenuItemSelect(event) {
25
- // If the element is disabled, stop propagation
26
- if (this.disabled) {
27
- event.stopPropagation();
28
- return;
29
- }
30
- this.menuitemSelected.emit({
31
- id: this.el.id,
32
- name: this.name,
33
- hasSubmenu: this.hasSubmenu,
34
- });
35
- }
36
- handleClick(event) {
37
- this.handleMenuItemSelect(event);
38
- }
39
- handleKeyDown(event) {
40
- if (event.key === 'Enter' || event.key === ' ') {
41
- const activeElement = document.activeElement;
42
- if (activeElement &&
43
- activeElement.tagName === 'NV-MENUITEM' &&
44
- !activeElement.hasAttribute('has-submenu')) {
45
- event.preventDefault();
46
- this.el.click();
47
- }
48
- }
49
- }
50
- //#endregion EVENTS
51
- /****************************************************************************/
52
- //#region RENDER
53
- render() {
54
- return (index.h(index.Host, { key: '3c9a394f8af5ab7b57061ddfdd3e07b9fce17847', role: "menuitem", tabindex: this.disabled ? '-1' : '0' }, this.icon && index.h("nv-icon", { key: '3f36901afb278a608f8eaeb423e8aca08c055187', name: this.icon }), index.h("slot", { key: 'a54ca41926c4f9374af669125529befc6ab454e2' }), this.label && index.h("span", { key: 'c83199ffd4e5559b22d06392edf5ad6c8e83cf96', "data-scope": "text" }, this.label), this.shortcut && !this.hasSubmenu && index.h("kbd", { key: 'c7a052d69c1d8cd33238f9f88405596a46649e3c' }, this.shortcut), this.hasSubmenu && index.h("nv-icon", { key: '57de548ca08d6fb045223f242dee568a29b6270f', name: "chevron-right" })));
55
- }
56
- get el() { return index.getElement(this); }
57
- };
58
- NvMenuitem.style = nvMenuitemCss;
59
-
60
- exports.nv_menuitem = NvMenuitem;
@@ -1,77 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-CtjeeUI-.js');
4
- require('@stencil/react-output-target/runtime');
5
- require('react');
6
- require('react-dom');
7
-
8
- const nvNotificationBulletCss = "nv-notification-bullet{display:inline-flex;align-items:center;justify-content:center;min-width:var(--sidebar-notification-bullet-size);max-width:var(--sidebar-notification-bullet-size);height:var(--sidebar-notification-bullet-size);padding:0 var(--spacing-1);border-radius:var(--radius-rounded-full);font-size:var(--sidebar-notification-bullet-font-size);font-weight:var(--sidebar-notification-bullet-font-weight);white-space:nowrap;flex-shrink:0;position:relative;}nv-notification-bullet.nv-notification-bullet-brand .nv-notification-bullet{display:inline-flex;align-items:center;justify-content:center;min-width:var(--sidebar-notification-bullet-size);max-width:var(--sidebar-notification-bullet-size);height:var(--sidebar-notification-bullet-size);padding:0 var(--spacing-1);border-radius:var(--radius-rounded-full);font-size:var(--sidebar-notification-bullet-font-size);font-weight:var(--sidebar-notification-bullet-font-weight);white-space:nowrap;flex-shrink:0}nv-notification-bullet.nv-notification-bullet-brand .nv-notification-bullet.nv-notification-bullet-high{background-color:var(--color-brand-500);color:var(--color-feedback-neutral-high-contrast-title)}nv-notification-bullet.nv-notification-bullet-brand .nv-notification-bullet.nv-notification-bullet-low{background-color:var(--color-brand-50);color:var(--color-brand-600);border:1px solid var(--color-brand-600)}nv-notification-bullet{}nv-notification-bullet.nv-notification-bullet-neutral{display:inline-flex;align-items:center;justify-content:center;min-width:var(--sidebar-notification-bullet-size);max-width:var(--sidebar-notification-bullet-size);height:var(--sidebar-notification-bullet-size);padding:0 var(--spacing-1);border-radius:var(--radius-rounded-full);font-size:var(--sidebar-notification-bullet-font-size);font-weight:var(--sidebar-notification-bullet-font-weight);white-space:nowrap;flex-shrink:0}nv-notification-bullet.nv-notification-bullet-neutral .nv-notification-bullet.nv-notification-bullet-high{background-color:var(--color-feedback-neutral-high-contrast-background);color:var(--color-feedback-neutral-high-contrast-title)}nv-notification-bullet.nv-notification-bullet-neutral .nv-notification-bullet.nv-notification-bullet-low{background-color:var(--color-feedback-neutral-low-background);color:var(--color-feedback-neutral-low-text);border-radius:var(--radius-rounded-full)}nv-notification-bullet{}nv-notification-bullet.nv-notification-bullet-with-cross-border::before{content:\"\";position:absolute;top:55%;left:45%;transform:translate(-50%, -50%);width:calc(var(--sidebar-notification-bullet-size) + 1.5px);height:calc(var(--sidebar-notification-bullet-size) * 1.5);border-radius:var(--radius-rounded-full);background-color:var(--nv-component-background, var(--nv-sidebarnavitem-background, var(--color-interaction-container-neutral-background)));z-index:-1;pointer-events:none}nv-notification-bullet{}nv-sidebar[collapsed] nv-notification-bullet.nv-notification-bullet-with-cross-border::before{width:calc(var(--sidebar-notification-bullet-size-reduced) * 1.5);height:calc(var(--sidebar-notification-bullet-size-reduced) * 1.5)}nv-notification-bullet{}nv-notification-bullet .nv-notification-bullet.nv-notification-bullet-reduced,nv-sidebar[collapsed] nv-notification-bullet .nv-notification-bullet{width:var(--sidebar-notification-bullet-size-reduced);height:var(--sidebar-notification-bullet-size-reduced);min-width:var(--sidebar-notification-bullet-size-reduced);max-width:var(--sidebar-notification-bullet-size-reduced);min-height:var(--sidebar-notification-bullet-size-reduced);max-height:var(--sidebar-notification-bullet-size-reduced);padding:0;font-size:0}";
9
-
10
- const NvNotificationBullet = class {
11
- constructor(hostRef) {
12
- index.registerInstance(this, hostRef);
13
- /**
14
- * Determines the size of the notification bullet.
15
- * - default: Normal size with text visible
16
- * - reduced: Smaller size, text hidden (just a dot)
17
- */
18
- this.size = 'default';
19
- /**
20
- * Allows to add a border to add contrast on background.
21
- */
22
- this.contrastingBorder = false;
23
- }
24
- //#endregion PROPERTIES
25
- /****************************************************************************/
26
- //#region METHODS
27
- getIntention() {
28
- if (this.intention) {
29
- return this.intention;
30
- }
31
- // Inherit from parent nv-sidebar
32
- const sidebar = this.el.closest('nv-sidebar');
33
- if (sidebar) {
34
- const sidebarIntention = sidebar.getAttribute('notification-intention');
35
- if (sidebarIntention === 'neutral' || sidebarIntention === 'brand') {
36
- return sidebarIntention;
37
- }
38
- }
39
- return 'brand'; // Default fallback
40
- }
41
- getEmphasis() {
42
- if (this.emphasis) {
43
- return this.emphasis;
44
- }
45
- // Inherit from parent nv-sidebar
46
- const sidebar = this.el.closest('nv-sidebar');
47
- if (sidebar) {
48
- const sidebarEmphasis = sidebar.getAttribute('notification-emphasis');
49
- if (sidebarEmphasis === 'high' || sidebarEmphasis === 'low') {
50
- return sidebarEmphasis;
51
- }
52
- }
53
- return 'high'; // Default fallback
54
- }
55
- //#region RENDER
56
- render() {
57
- var _a;
58
- const displayCount = (_a = this.count) !== null && _a !== void 0 ? _a : 0;
59
- const displayText = displayCount > 99 ? '99+' : String(displayCount);
60
- if (displayCount <= 0) {
61
- return index.h(index.Host, { style: { display: 'none' } });
62
- }
63
- const sizeClass = this.size === 'reduced' ? 'nv-notification-bullet-reduced' : '';
64
- const intention = this.getIntention();
65
- const emphasis = this.getEmphasis();
66
- const intentionClass = `nv-notification-bullet-${intention}`;
67
- const emphasisClass = `nv-notification-bullet-${emphasis}`;
68
- const borderClass = this.contrastingBorder
69
- ? 'nv-notification-bullet-with-border'
70
- : '';
71
- return (index.h(index.Host, { class: `${intentionClass} ${borderClass ? 'nv-notification-bullet-with-cross-border' : ''}` }, index.h("span", { class: `nv-notification-bullet ${emphasisClass} ${sizeClass} ${borderClass}`, "aria-label": `${displayCount} notifications` }, displayText)));
72
- }
73
- get el() { return index.getElement(this); }
74
- };
75
- NvNotificationBullet.style = nvNotificationBulletCss;
76
-
77
- exports.nv_notification_bullet = NvNotificationBullet;
@@ -1,262 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-CtjeeUI-.js');
4
- var constantsBReL3Lsa = require('./constants-BReL3Lsa-DpB_ghPF.js');
5
- var collapse_animationDZDm0vSK = require('./collapse.animation-DZDm0vSK-C2TOIhIK.js');
6
- var fade_animationDcRL9lcm = require('./fade.animation-DcRL9lcm-DAZeHoKN.js');
7
- var styleValueTypes_esXlgmw4x8 = require('./style-value-types.es-xlgmw4x8-B1vLqX9m.js');
8
- var timeline_animationCgHCo_Ho = require('./timeline.animation-CgHCo_Ho-KteJaZPb.js');
9
- var v4BdYh22OP = require('./v4-BdYh22OP-C1vaJ4yP.js');
10
- require('@stencil/react-output-target/runtime');
11
- require('react');
12
- require('react-dom');
13
-
14
- const useSlide = (node, { duration } = { duration: 200 }) => {
15
- const nodeStyler = fade_animationDcRL9lcm.index(node);
16
- /**
17
- * Will animate the translateX property.
18
- *
19
- * @param {object} options - The options for the animation.
20
- * @param {number} options.from - The starting value for the translateX property.
21
- * @param {number} options.to - The ending value for the translateX property.
22
- * @returns {Promise<void>} - A promise that resolves when the animation is
23
- * complete.
24
- */
25
- const slideX = (options = { from: 0, to: 100 }) => () => {
26
- return new Promise(resolve => {
27
- styleValueTypes_esXlgmw4x8.animate({
28
- from: { x: options.from },
29
- to: { x: options.to },
30
- ease: styleValueTypes_esXlgmw4x8.easeOut,
31
- duration,
32
- onUpdate(latest) {
33
- nodeStyler.set({ transform: `translateX(${latest.x}%)` });
34
- },
35
- onComplete() {
36
- resolve();
37
- },
38
- });
39
- });
40
- };
41
- /**
42
- * Will animate the translateY property.
43
- *
44
- * @param {object} options - The options for the animation.
45
- * @param {number} options.from - The starting value for the translateY property.
46
- * @param {number} options.to - The ending value for the translateY property.
47
- * @returns {Promise<void>} - A promise that resolves when the animation is
48
- * complete.
49
- */
50
- const slideY = (options = { from: 0, to: 100 }) => () => {
51
- return new Promise(resolve => {
52
- styleValueTypes_esXlgmw4x8.animate({
53
- from: { y: options.from },
54
- to: { y: options.to },
55
- ease: styleValueTypes_esXlgmw4x8.easeOut,
56
- duration,
57
- onUpdate(latest) {
58
- nodeStyler.set({ transform: `translateY(${latest.y}%)` });
59
- },
60
- onComplete() {
61
- resolve();
62
- },
63
- });
64
- });
65
- };
66
- /**
67
- * Applies the slideX styles without animating, useful when initial state
68
- * is slid out.
69
- *
70
- * @param {number} amount - The amount to translate the element by.
71
- * @returns {function} - A function that applies the slideX styles.
72
- */
73
- const setSlideX = (amount = 100) => nodeStyler.set({ transform: `translateX(${amount}%)` });
74
- /**
75
- * Applies the slideY styles without animating, useful when initial state
76
- * is slid out.
77
- *
78
- * @param {number} amount - The amount to translate the element by.
79
- * @returns {function} - A function that applies the slideY styles.
80
- */
81
- const setSlideY = (amount = 100) => nodeStyler.set({ transform: `translateY(${amount}%)` });
82
- /**
83
- * Applies the slideIn styles without animating, useful when initial state
84
- * is slid in.
85
- */
86
- function setSlideReset() {
87
- nodeStyler.set({ transform: `translateX(${0}%) translateY(${0}%)` });
88
- }
89
- return {
90
- slideX,
91
- slideY,
92
- setSlideX,
93
- setSlideY,
94
- setSlideReset,
95
- };
96
- };
97
-
98
- 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] [data-scope=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:var(--font-weight-medium-emphasis);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:var(--font-weight-low-emphasis);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] [data-scope=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] [data-scope=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] [data-scope=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] [data-scope=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] [data-scope=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)}";
99
-
100
- const NvNotification = class {
101
- constructor(hostRef) {
102
- index.registerInstance(this, hostRef);
103
- this.hiddenChanged = index.createEvent(this, "hiddenChanged", 3);
104
- /****************************************************************************/
105
- //#region PROPERTIES
106
- /**
107
- * Set a unique ID for the notification. Used for aria attributes and managing
108
- * multiple notifications.
109
- */
110
- this.uid = v4BdYh22OP.v4();
111
- /**
112
- * Specifies the notification type which determines the color and default icon.
113
- */
114
- this.feedback = 'information';
115
- /**
116
- * Adjusts the emphasis to make the notification more or less visually
117
- * prominent to users. Use this to draw attention to important actions or
118
- * reduce focus on less critical ones
119
- */
120
- this.emphasis = 'medium';
121
- /**
122
- * Allows the notification to be dismissed via a close button (x). The
123
- * notification is not dismissible unless explicitly enabled.
124
- */
125
- this.dismissible = false;
126
- /**
127
- * Controls the visibility of the notification.
128
- */
129
- this.hidden = false; // eslint-disable-line @stencil-community/reserved-member-names
130
- /**
131
- * When true, the notification will be hidden initially, but internal changes
132
- * will not be in a controlled state. Good for animating the notification in.
133
- */
134
- this.initiallyHidden = false;
135
- //#endregion EVENTS
136
- /****************************************************************************/
137
- //#region INTERNAL
138
- this.iconByFeedback = {
139
- [constantsBReL3Lsa.FeedbackColors.Warning]: 'alert-circle',
140
- [constantsBReL3Lsa.FeedbackColors.Information]: 'info-circle',
141
- [constantsBReL3Lsa.FeedbackColors.Success]: 'circle-check',
142
- [constantsBReL3Lsa.FeedbackColors.Error]: 'alert-triangle',
143
- [constantsBReL3Lsa.FeedbackColors.Neutral]: 'help',
144
- };
145
- this.roleByFeedback = {
146
- [constantsBReL3Lsa.FeedbackColors.Error]: 'alert',
147
- [constantsBReL3Lsa.FeedbackColors.Warning]: 'alert',
148
- [constantsBReL3Lsa.FeedbackColors.Information]: 'status',
149
- [constantsBReL3Lsa.FeedbackColors.Success]: 'status',
150
- [constantsBReL3Lsa.FeedbackColors.Neutral]: 'status',
151
- };
152
- }
153
- //#endregion PROPERTIES
154
- /****************************************************************************/
155
- //#region METHODS
156
- /**
157
- * Dismisses the notification with an animation, after the animation is
158
- * complete, the hiddenChanged event will be emitted with the value of true,
159
- * and the hidden prop will be set to true.
160
- */
161
- async dismiss() {
162
- await this.dismissAnimation();
163
- }
164
- /**
165
- * Sets the hidden prop to false, and shows the notification with an
166
- * animation, after the animation is complete, the hiddenChanged event will be
167
- * emitted with the value of false.
168
- */
169
- async show() {
170
- await this.showAnimation();
171
- }
172
- getDefaultIcon() {
173
- var _a;
174
- return (_a = this.iconByFeedback[this.feedback]) !== null && _a !== void 0 ? _a : 'info-circle';
175
- }
176
- getAriaRole() {
177
- var _a;
178
- return (_a = this.roleByFeedback[this.feedback]) !== null && _a !== void 0 ? _a : 'status';
179
- }
180
- getAriaLive() {
181
- return this.getAriaRole() === 'alert' ? 'assertive' : 'polite';
182
- }
183
- getHeadingId() {
184
- return this.heading ? `nv-notification-${this.uid}-heading` : null;
185
- }
186
- getMessageId() {
187
- return this.message ? `nv-notification-${this.uid}-message` : null;
188
- }
189
- async showAnimation() {
190
- this.hidden = false;
191
- const { setFadeIn } = fade_animationDcRL9lcm.useFade(this.container);
192
- const { expand } = collapse_animationDZDm0vSK.useCollapse(this.el, {
193
- duration: 300,
194
- overflow: 'visible',
195
- });
196
- const { slideY, setSlideY } = useSlide(this.container, {
197
- duration: 300,
198
- });
199
- setSlideY(-100);
200
- setFadeIn();
201
- await timeline_animationCgHCo_Ho.parallel(slideY({ from: -100, to: 0 }), expand).start();
202
- this.hiddenChanged.emit(false);
203
- }
204
- getSlideDestination(pos) {
205
- switch (pos) {
206
- case constantsBReL3Lsa.NotificationPosition.TopRight:
207
- case constantsBReL3Lsa.NotificationPosition.BottomRight:
208
- return { axis: 'x', to: 100 }; // right
209
- case constantsBReL3Lsa.NotificationPosition.TopLeft:
210
- case constantsBReL3Lsa.NotificationPosition.BottomLeft:
211
- return { axis: 'x', to: -100 }; // left
212
- case constantsBReL3Lsa.NotificationPosition.TopCenter:
213
- return { axis: 'y', to: -100 }; // up
214
- case constantsBReL3Lsa.NotificationPosition.BottomCenter:
215
- return { axis: 'y', to: 100 }; // down
216
- default:
217
- return { axis: 'x', to: 100 }; // fallback
218
- }
219
- }
220
- async dismissAnimation() {
221
- var _a;
222
- const position = (_a = this.el
223
- .closest('nv-notificationcontainer')) === null || _a === void 0 ? void 0 : _a.getAttribute('position');
224
- const destination = this.getSlideDestination(position);
225
- const { fadeOut } = fade_animationDcRL9lcm.useFade(this.container, { duration: 300 });
226
- const { slideX, slideY, setSlideReset } = useSlide(this.container, {
227
- duration: 500,
228
- });
229
- const { collapse } = collapse_animationDZDm0vSK.useCollapse(this.el, {
230
- duration: 500,
231
- overflow: 'visible',
232
- });
233
- const slide = destination.axis === 'x'
234
- ? slideX({ from: 0, to: destination.to })
235
- : slideY({ from: 0, to: destination.to });
236
- setSlideReset();
237
- await timeline_animationCgHCo_Ho.parallel(fadeOut, slide, collapse).start();
238
- this.hidden = true;
239
- this.hiddenChanged.emit(true);
240
- }
241
- //#endregion INTERNAL
242
- /****************************************************************************/
243
- //#region LIFECYCLE
244
- componentWillLoad() {
245
- this.headingSlot = this.el.querySelector('[slot="heading"]');
246
- this.messageSlot = this.el.querySelector('[slot="content"]');
247
- this.actionsSlot = this.el.querySelector('[slot="actions"]');
248
- if (this.initiallyHidden)
249
- this.hidden = true;
250
- }
251
- //#endregion LIFECYCLE
252
- /****************************************************************************/
253
- //#region RENDER
254
- render() {
255
- var _a, _b, _c;
256
- return (index.h(index.Host, { key: 'cf0f39e0565a264b676e0ca569ec79169771d269', 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: 'ed2a5e50f0a6975c652f658e62a271c0b476f7d2', "data-scope": "container", ref: el => (this.container = el) }, this.dismissible && (index.h("button", { key: '9eccf1b9f29f581bf77255b9e2bebebfdc233302', "data-scope": "dismiss", type: "button", onClick: this.dismiss.bind(this) }, index.h("nv-icon", { key: '73890097ad80af4d86646bb83f2ae99878164db4', name: "x", size: "sm" }))), index.h("nv-icon", { key: 'c852478c25ae05d5219453234db95a420b5c5a1e', name: (_c = this.icon) !== null && _c !== void 0 ? _c : this.getDefaultIcon(), size: "md", "data-scope": "icon" }), index.h("div", { key: 'b06042bf55e8bedc07a60f23a27b07160776c0e0', "data-scope": "content" }, (this.heading || this.headingSlot) && (index.h("p", { key: '7666dfb18169cdfea8eb8c603b20a5ba7075824c', id: this.getHeadingId(), "data-scope": "heading" }, index.h("slot", { key: 'f6e651737cf630bb89d40b7664329596355a8ea0', name: "heading" }, this.heading))), (this.message || this.messageSlot) && (index.h("p", { key: 'ae5d89db2b36c4c81c7b46aada5f50bd6eb4aa90', id: this.getMessageId(), "data-scope": "message" }, index.h("slot", { key: '24d01abd694f7f9a316345f9d88716d1c0a47234', name: "content" }, this.message))), this.actionsSlot && (index.h("div", { key: 'a1aa0bcc33a42d7b36bcd364a155d41f527cc96a', "data-scope": "actions" }, index.h("slot", { key: 'b09c21bed0fd559bf2f694f861385444c2ddbbf0', name: "actions" })))))));
257
- }
258
- get el() { return index.getElement(this); }
259
- };
260
- NvNotification.style = nvNotificationCss;
261
-
262
- exports.nv_notification = NvNotification;
@@ -1,41 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-CtjeeUI-.js');
4
- require('@stencil/react-output-target/runtime');
5
- require('react');
6
- require('react-dom');
7
-
8
- const nvNotificationcontainerCss = "nv-notificationcontainer{position:fixed;display:flex;flex-direction:column;padding:var(--spacing-2);padding-top:0;z-index:9999;pointer-events:none;width:100%;max-width:512px}nv-notificationcontainer.position-top-right{top:0;right:0}nv-notificationcontainer.position-top-right nv-notification{margin-top:var(--spacing-2)}nv-notificationcontainer.position-top-left{top:0;left:0}nv-notificationcontainer.position-top-left nv-notification{margin-bottom:var(--spacing-2)}nv-notificationcontainer.position-top-center{top:0;left:50%;transform:translateX(-50%)}nv-notificationcontainer.position-top-center nv-notification{margin-bottom:var(--spacing-2)}nv-notificationcontainer.position-bottom-right{bottom:0;right:0;flex-direction:column-reverse}nv-notificationcontainer.position-bottom-right nv-notification{margin-top:var(--spacing-2)}nv-notificationcontainer.position-bottom-left{bottom:0;left:0;flex-direction:column-reverse}nv-notificationcontainer.position-bottom-left nv-notification{margin-top:var(--spacing-2)}nv-notificationcontainer.position-bottom-center{bottom:0;left:50%;transform:translateX(-50%);flex-direction:column-reverse}nv-notificationcontainer.position-bottom-center nv-notification{margin-top:var(--spacing-2)}nv-notificationcontainer>*{pointer-events:auto}";
9
-
10
- const NvNotificationContainer = class {
11
- constructor(hostRef) {
12
- index.registerInstance(this, hostRef);
13
- /****************************************************************************/
14
- //#region PROPERTIES
15
- /**
16
- * Position of the notification container on the screen.
17
- */
18
- this.position = 'top-right';
19
- }
20
- //#endregion PROPERTIES
21
- /****************************************************************************/
22
- //#region METHODS
23
- //#endregion METHODS
24
- /****************************************************************************/
25
- //#region WATCHERS
26
- //#endregion WATCHERS
27
- /****************************************************************************/
28
- //#region LIFECYCLE
29
- //#endregion LIFECYCLE
30
- /****************************************************************************/
31
- //#region EVENTS
32
- //#endregion EVENTS
33
- /****************************************************************************/
34
- //#region RENDER
35
- render() {
36
- return (index.h(index.Host, { key: 'bf0b7cd02e0d214516f352eb7016d6060d6959c5', class: `position-${this.position}` }, index.h("slot", { key: 'f042e3f11b4d2af4b47aadeba04a332c57889616' })));
37
- }
38
- };
39
- NvNotificationContainer.style = nvNotificationcontainerCss;
40
-
41
- exports.nv_notificationcontainer = NvNotificationContainer;