@zanichelli/albe-web-components 6.5.0-offcanvasTest3 → 6.5.1

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 (138) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/index-e3299e0a.js +20 -36
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/web-components-library.cjs.js +1 -1
  5. package/dist/cjs/z-app-header_2.cjs.entry.js +153 -0
  6. package/dist/cjs/z-app-switcher.cjs.entry.js +29 -0
  7. package/dist/cjs/{z-modal.cjs.entry.js → z-dragdrop-area_3.cjs.entry.js} +43 -0
  8. package/dist/cjs/z-input_2.cjs.entry.js +1 -1
  9. package/dist/cjs/{z-app-switcher_2.cjs.entry.js → z-logo.cjs.entry.js} +0 -23
  10. package/dist/cjs/{z-icon_2.cjs.entry.js → z-offcanvas.cjs.entry.js} +0 -20
  11. package/dist/cjs/z-table-row.cjs.entry.js +2 -2
  12. package/dist/collection/collection-manifest.json +0 -4
  13. package/dist/collection/components/inputs/z-input/styles.css +3 -0
  14. package/dist/collection/components/z-table/z-table-row/index.js +2 -2
  15. package/dist/esm/index-a2ca4b97.js +20 -36
  16. package/dist/esm/index.js +1 -1
  17. package/dist/esm/loader.js +1 -1
  18. package/dist/esm/{utils-ccb4d66f.js → utils-6cf7efe2.js} +1 -1
  19. package/dist/esm/web-components-library.js +1 -1
  20. package/dist/esm/z-app-header_2.entry.js +148 -0
  21. package/dist/esm/z-app-switcher.entry.js +25 -0
  22. package/dist/esm/z-chip.entry.js +1 -1
  23. package/dist/esm/z-combobox.entry.js +1 -1
  24. package/dist/esm/{z-modal.entry.js → z-dragdrop-area_3.entry.js} +42 -1
  25. package/dist/esm/z-file-upload.entry.js +1 -1
  26. package/dist/esm/z-input_2.entry.js +2 -2
  27. package/dist/esm/{z-app-switcher_2.entry.js → z-logo.entry.js} +2 -24
  28. package/dist/esm/z-myz-card-info.entry.js +1 -1
  29. package/dist/esm/z-myz-list-item.entry.js +1 -1
  30. package/dist/esm/{z-icon_2.entry.js → z-offcanvas.entry.js} +2 -21
  31. package/dist/esm/z-pocket_3.entry.js +1 -1
  32. package/dist/esm/z-popover.entry.js +1 -1
  33. package/dist/esm/z-select.entry.js +1 -1
  34. package/dist/esm/z-skip-to-content.entry.js +1 -1
  35. package/dist/esm/z-slideshow.entry.js +1 -1
  36. package/dist/esm/z-table-header.entry.js +1 -1
  37. package/dist/esm/z-table-row.entry.js +2 -2
  38. package/dist/esm/z-toggle-switch.entry.js +1 -1
  39. package/dist/types/components.d.ts +2 -230
  40. package/dist/web-components-library/index.esm.js +1 -1
  41. package/dist/web-components-library/p-1cb23bbb.entry.js +1 -0
  42. package/dist/web-components-library/p-1d66b265.entry.js +1 -0
  43. package/{www/build/p-9965827d.entry.js → dist/web-components-library/p-26033729.entry.js} +1 -1
  44. package/dist/web-components-library/{p-8bf0844b.entry.js → p-53065788.entry.js} +1 -1
  45. package/dist/web-components-library/{p-1b6279a6.entry.js → p-5c62387a.entry.js} +1 -1
  46. package/dist/web-components-library/{p-20a3247c.entry.js → p-6c163539.entry.js} +1 -1
  47. package/dist/web-components-library/{p-279655eb.entry.js → p-7b3b99ee.entry.js} +1 -1
  48. package/{www/build/p-3d9ecc23.entry.js → dist/web-components-library/p-7ea553e9.entry.js} +1 -1
  49. package/dist/web-components-library/{p-547d3b1f.entry.js → p-8305bbcc.entry.js} +1 -1
  50. package/dist/web-components-library/{p-cd43f80d.js → p-8ebe4adf.js} +1 -1
  51. package/dist/web-components-library/{p-98c94e81.entry.js → p-91a74348.entry.js} +1 -1
  52. package/dist/web-components-library/{p-c25b0b2a.entry.js → p-93142fac.entry.js} +1 -1
  53. package/dist/web-components-library/p-9a613586.entry.js +1 -0
  54. package/{www/build/p-411cbcd6.entry.js → dist/web-components-library/p-a05ce0a6.entry.js} +1 -1
  55. package/{www/build/p-bdc6f2e5.entry.js → dist/web-components-library/p-a6c0f149.entry.js} +1 -1
  56. package/dist/web-components-library/p-ae79573a.entry.js +1 -0
  57. package/dist/web-components-library/p-bdefe224.entry.js +1 -0
  58. package/dist/web-components-library/{p-8980398c.entry.js → p-d2127d84.entry.js} +1 -1
  59. package/{www/build/p-8b960526.entry.js → dist/web-components-library/p-dd000757.entry.js} +1 -1
  60. package/dist/web-components-library/p-de55c171.entry.js +1 -0
  61. package/dist/web-components-library/web-components-library.esm.js +1 -1
  62. package/package.json +1 -1
  63. package/react/components.d.ts +0 -4
  64. package/react/components.js +2 -6
  65. package/react/components.js.map +1 -1
  66. package/www/build/index.esm.js +1 -1
  67. package/www/build/p-1cb23bbb.entry.js +1 -0
  68. package/www/build/p-1d66b265.entry.js +1 -0
  69. package/{dist/web-components-library/p-9965827d.entry.js → www/build/p-26033729.entry.js} +1 -1
  70. package/www/build/p-4b159cbd.css +1 -0
  71. package/www/build/{p-8bf0844b.entry.js → p-53065788.entry.js} +1 -1
  72. package/www/build/{p-1b6279a6.entry.js → p-5c62387a.entry.js} +1 -1
  73. package/www/build/{p-20a3247c.entry.js → p-6c163539.entry.js} +1 -1
  74. package/www/build/{p-279655eb.entry.js → p-7b3b99ee.entry.js} +1 -1
  75. package/{dist/web-components-library/p-3d9ecc23.entry.js → www/build/p-7ea553e9.entry.js} +1 -1
  76. package/www/build/{p-547d3b1f.entry.js → p-8305bbcc.entry.js} +1 -1
  77. package/www/build/{p-cd43f80d.js → p-8ebe4adf.js} +1 -1
  78. package/www/build/{p-98c94e81.entry.js → p-91a74348.entry.js} +1 -1
  79. package/www/build/{p-c25b0b2a.entry.js → p-93142fac.entry.js} +1 -1
  80. package/www/build/p-9a613586.entry.js +1 -0
  81. package/{dist/web-components-library/p-411cbcd6.entry.js → www/build/p-a05ce0a6.entry.js} +1 -1
  82. package/{dist/web-components-library/p-bdc6f2e5.entry.js → www/build/p-a6c0f149.entry.js} +1 -1
  83. package/www/build/p-ae79573a.entry.js +1 -0
  84. package/www/build/p-bdefe224.entry.js +1 -0
  85. package/www/build/{p-8980398c.entry.js → p-d2127d84.entry.js} +1 -1
  86. package/www/build/p-dbb8bcb2.js +1 -0
  87. package/{dist/web-components-library/p-8b960526.entry.js → www/build/p-dd000757.entry.js} +1 -1
  88. package/www/build/p-de55c171.entry.js +1 -0
  89. package/www/build/web-components-library.esm.js +1 -1
  90. package/www/index.html +1 -8
  91. package/www/pages/file-upload.html +0 -33
  92. package/www/pages/notification.html +0 -33
  93. package/dist/cjs/z-app-header.cjs.entry.js +0 -133
  94. package/dist/cjs/z-app-topbar.cjs.entry.js +0 -41
  95. package/dist/cjs/z-dragdrop-area_2.cjs.entry.js +0 -49
  96. package/dist/cjs/z-menu-dropdown.cjs.entry.js +0 -59
  97. package/dist/cjs/z-modal-login.cjs.entry.js +0 -84
  98. package/dist/cjs/z-user-dropdown.cjs.entry.js +0 -93
  99. package/dist/collection/components/modal/z-modal-login/index.js +0 -251
  100. package/dist/collection/components/modal/z-modal-login/styles.css +0 -150
  101. package/dist/collection/components/navigation/z-app-topbar/index.js +0 -156
  102. package/dist/collection/components/navigation/z-app-topbar/styles.css +0 -65
  103. package/dist/collection/components/navigation/z-menu-dropdown/index.js +0 -124
  104. package/dist/collection/components/navigation/z-menu-dropdown/styles.css +0 -146
  105. package/dist/collection/components/navigation/z-user-dropdown/index.js +0 -247
  106. package/dist/collection/components/navigation/z-user-dropdown/styles.css +0 -306
  107. package/dist/esm/z-app-header.entry.js +0 -129
  108. package/dist/esm/z-app-topbar.entry.js +0 -37
  109. package/dist/esm/z-dragdrop-area_2.entry.js +0 -44
  110. package/dist/esm/z-menu-dropdown.entry.js +0 -55
  111. package/dist/esm/z-modal-login.entry.js +0 -80
  112. package/dist/esm/z-user-dropdown.entry.js +0 -89
  113. package/dist/types/components/modal/z-modal-login/index.d.ts +0 -41
  114. package/dist/types/components/navigation/z-app-topbar/index.d.ts +0 -20
  115. package/dist/types/components/navigation/z-menu-dropdown/index.d.ts +0 -19
  116. package/dist/types/components/navigation/z-user-dropdown/index.d.ts +0 -39
  117. package/dist/web-components-library/p-1ba8d432.entry.js +0 -1
  118. package/dist/web-components-library/p-3c2d438b.entry.js +0 -1
  119. package/dist/web-components-library/p-4cd6c6f4.entry.js +0 -1
  120. package/dist/web-components-library/p-682528b2.entry.js +0 -1
  121. package/dist/web-components-library/p-9ed27651.entry.js +0 -1
  122. package/dist/web-components-library/p-a2b67e2d.entry.js +0 -1
  123. package/dist/web-components-library/p-b17981a4.entry.js +0 -1
  124. package/dist/web-components-library/p-d3c72572.entry.js +0 -1
  125. package/dist/web-components-library/p-edf0195b.entry.js +0 -1
  126. package/dist/web-components-library/p-f20d1242.entry.js +0 -1
  127. package/www/build/p-1ba8d432.entry.js +0 -1
  128. package/www/build/p-3c2d438b.entry.js +0 -1
  129. package/www/build/p-4cd6c6f4.entry.js +0 -1
  130. package/www/build/p-682528b2.entry.js +0 -1
  131. package/www/build/p-99d3834c.js +0 -129
  132. package/www/build/p-9ed27651.entry.js +0 -1
  133. package/www/build/p-a2b67e2d.entry.js +0 -1
  134. package/www/build/p-b17981a4.entry.js +0 -1
  135. package/www/build/p-d3c72572.entry.js +0 -1
  136. package/www/build/p-e680285b.css +0 -1636
  137. package/www/build/p-edf0195b.entry.js +0 -1
  138. package/www/build/p-f20d1242.entry.js +0 -1
@@ -1,247 +0,0 @@
1
- import { h, Host } from "@stencil/core";
2
- import { mobileBreakpoint } from "../../../constants/breakpoints";
3
- export class ZUserDropdown {
4
- constructor() {
5
- /** if inner components colors are inverted, or not, default false */
6
- this.useInverseColors = false;
7
- this.isMenuOpen = false;
8
- this.handleLoggedButtonClick = this.handleLoggedButtonClick.bind(this);
9
- this.emitDropdownMenuLinkClick = this.emitDropdownMenuLinkClick.bind(this);
10
- }
11
- componentDidLoad() {
12
- this.setMobileAndDivToResizeWidth();
13
- }
14
- componentWillUpdate() {
15
- this.setMobileAndDivToResizeWidth();
16
- }
17
- componentWillRender() {
18
- if (this.menuContent) {
19
- this.linkArray = typeof this.menuContent === "string" ? JSON.parse(this.menuContent) : this.menuContent;
20
- }
21
- }
22
- setMobileAndDivToResizeWidth() {
23
- var _a;
24
- if (this.divToResize) {
25
- this.isMobile = window.screen.width <= mobileBreakpoint || window.innerWidth <= mobileBreakpoint;
26
- if (this.logged && !this.isMobile && this.isMenuOpen) {
27
- this.divToResize.style.width = `${(_a = this.userButton) === null || _a === void 0 ? void 0 : _a.offsetWidth}px`;
28
- }
29
- else {
30
- this.divToResize.removeAttribute("style");
31
- }
32
- }
33
- }
34
- emitUserButtonClick() {
35
- this.userButtonClick.emit(this.isMenuOpen);
36
- }
37
- emitDropdownMenuLinkClick(e) {
38
- this.isMenuOpen = false;
39
- this.dropdownMenuLinkClick.emit({ e, linkId: e.detail.linkId });
40
- }
41
- handleResize() {
42
- this.isMobile = window.innerWidth <= mobileBreakpoint;
43
- }
44
- handleOrientationChange() {
45
- this.isMobile = screen.width <= mobileBreakpoint;
46
- }
47
- handleClickOutside(e) {
48
- if (e.target.nodeName !== "Z-USER-DROPDOWN") {
49
- this.isMenuOpen = false;
50
- }
51
- }
52
- handleLoggedButtonClick() {
53
- this.isMenuOpen = !this.isMenuOpen;
54
- this.emitUserButtonClick();
55
- }
56
- renderGuestButton() {
57
- return (h("button", { id: "guestbutton", class: this.useInverseColors ? "inverse" : "", onClick: () => this.emitUserButtonClick() }, "ENTRA"));
58
- }
59
- renderLoggedButton() {
60
- const direction = this.isMenuOpen ? "up" : "down";
61
- const colorClass = this.useInverseColors ? "inverse" : "";
62
- return (h("button", { ref: (el) => (this.userButton = el), title: this.userFullName, class: `${colorClass} ${this.isMenuOpen ? "open" : ""}`, onClick: this.handleLoggedButtonClick }, h("div", null, h("div", { class: "firstline" }, h("z-icon", { class: colorClass, name: "user-avatar-filled", height: 16, width: 16 }), !this.isMobile && h("div", { class: `userfullname ${colorClass}` }, this.userFullName), h("z-icon", { class: colorClass, name: `caret-${direction}-filled`, height: 16, width: 16 })), !this.isMobile && this.isMenuOpen && h("div", { class: `useremail ${colorClass}` }, this.userEmail))));
63
- }
64
- getZLinkTextcolor() {
65
- if (this.isMobile) {
66
- return this.useInverseColors ? "black" : "white";
67
- }
68
- return this.useInverseColors ? "white" : "black";
69
- }
70
- renderDropdownMenu() {
71
- const colorClass = this.useInverseColors ? "inverse" : "";
72
- return (this.isMenuOpen && (h("ul", { class: colorClass }, this.isMobile && (h("li", { class: colorClass }, h("div", { class: `userfullname ${colorClass}` }, this.userFullName), h("div", { class: `useremail ${colorClass}` }, this.userEmail))), this.linkArray &&
73
- this.linkArray.map((link) => (h("li", { id: link.id, class: colorClass }, h("z-link", { textcolor: this.getZLinkTextcolor(), href: link.link, htmlid: link.id, target: link.target, icon: link.icon, onZLinkClick: this.emitDropdownMenuLinkClick }, link.label)))))));
74
- }
75
- render() {
76
- const openClass = `${this.logged && this.isMenuOpen ? "open" : ""}`;
77
- const colorClass = this.useInverseColors ? "inverse" : "";
78
- return (h(Host, { class: colorClass }, h("div", { ref: (el) => (this.divToResize = el), class: openClass }, h("div", { class: `${colorClass} ${openClass}` }, this.logged ? this.renderLoggedButton() : this.renderGuestButton(), this.logged && this.renderDropdownMenu()))));
79
- }
80
- static get is() { return "z-user-dropdown"; }
81
- static get encapsulation() { return "shadow"; }
82
- static get originalStyleUrls() {
83
- return {
84
- "$": ["styles.css"]
85
- };
86
- }
87
- static get styleUrls() {
88
- return {
89
- "$": ["styles.css"]
90
- };
91
- }
92
- static get properties() {
93
- return {
94
- "logged": {
95
- "type": "boolean",
96
- "mutable": false,
97
- "complexType": {
98
- "original": "boolean",
99
- "resolved": "boolean",
100
- "references": {}
101
- },
102
- "required": false,
103
- "optional": true,
104
- "docs": {
105
- "tags": [],
106
- "text": "logged status flag"
107
- },
108
- "attribute": "logged",
109
- "reflect": false
110
- },
111
- "userFullName": {
112
- "type": "string",
113
- "mutable": false,
114
- "complexType": {
115
- "original": "string",
116
- "resolved": "string",
117
- "references": {}
118
- },
119
- "required": false,
120
- "optional": true,
121
- "docs": {
122
- "tags": [],
123
- "text": "user full name"
124
- },
125
- "attribute": "user-full-name",
126
- "reflect": false
127
- },
128
- "userEmail": {
129
- "type": "string",
130
- "mutable": false,
131
- "complexType": {
132
- "original": "string",
133
- "resolved": "string",
134
- "references": {}
135
- },
136
- "required": false,
137
- "optional": true,
138
- "docs": {
139
- "tags": [],
140
- "text": "user email"
141
- },
142
- "attribute": "user-email",
143
- "reflect": false
144
- },
145
- "menuContent": {
146
- "type": "string",
147
- "mutable": false,
148
- "complexType": {
149
- "original": "string | MenuItem[]",
150
- "resolved": "MenuItem[] | string",
151
- "references": {
152
- "MenuItem": {
153
- "location": "import",
154
- "path": "../../../beans"
155
- }
156
- }
157
- },
158
- "required": false,
159
- "optional": true,
160
- "docs": {
161
- "tags": [],
162
- "text": "Json stringified or array to fill menu dropdown"
163
- },
164
- "attribute": "menu-content",
165
- "reflect": false
166
- },
167
- "useInverseColors": {
168
- "type": "boolean",
169
- "mutable": false,
170
- "complexType": {
171
- "original": "boolean",
172
- "resolved": "boolean",
173
- "references": {}
174
- },
175
- "required": false,
176
- "optional": true,
177
- "docs": {
178
- "tags": [],
179
- "text": "if inner components colors are inverted, or not, default false"
180
- },
181
- "attribute": "use-inverse-colors",
182
- "reflect": false,
183
- "defaultValue": "false"
184
- }
185
- };
186
- }
187
- static get states() {
188
- return {
189
- "isMenuOpen": {},
190
- "isMobile": {}
191
- };
192
- }
193
- static get events() {
194
- return [{
195
- "method": "userButtonClick",
196
- "name": "userButtonClick",
197
- "bubbles": true,
198
- "cancelable": true,
199
- "composed": true,
200
- "docs": {
201
- "tags": [],
202
- "text": "Emitted on enter or user Button click, returns isMenuOpen (bool)"
203
- },
204
- "complexType": {
205
- "original": "any",
206
- "resolved": "any",
207
- "references": {}
208
- }
209
- }, {
210
- "method": "dropdownMenuLinkClick",
211
- "name": "dropdownMenuLinkClick",
212
- "bubbles": true,
213
- "cancelable": true,
214
- "composed": true,
215
- "docs": {
216
- "tags": [],
217
- "text": "Emitted on dropdown menu zlink click, returns event"
218
- },
219
- "complexType": {
220
- "original": "any",
221
- "resolved": "any",
222
- "references": {}
223
- }
224
- }];
225
- }
226
- static get listeners() {
227
- return [{
228
- "name": "resize",
229
- "method": "handleResize",
230
- "target": "window",
231
- "capture": false,
232
- "passive": true
233
- }, {
234
- "name": "orientationchange",
235
- "method": "handleOrientationChange",
236
- "target": "window",
237
- "capture": false,
238
- "passive": false
239
- }, {
240
- "name": "click",
241
- "method": "handleClickOutside",
242
- "target": "window",
243
- "capture": false,
244
- "passive": false
245
- }];
246
- }
247
- }
@@ -1,306 +0,0 @@
1
- :host {
2
- background-color: var(--gray900);
3
- }
4
-
5
- :host(.inverse) {
6
- background-color: var(--color-white);
7
- }
8
-
9
- button {
10
- display: flex;
11
- width: 100%;
12
- flex-direction: column;
13
- padding: 0;
14
- border: none;
15
- margin: 0;
16
- background-color: var(--gray900);
17
- cursor: pointer;
18
- letter-spacing: 0.16px;
19
- white-space: nowrap;
20
- }
21
-
22
- button.inverse {
23
- background-color: var(--color-white);
24
- }
25
-
26
- button div.firstline {
27
- display: flex;
28
- max-width: 200px;
29
- align-items: center;
30
- justify-content: flex-end;
31
- }
32
-
33
- button.open div.firstline {
34
- max-width: none;
35
- }
36
-
37
- z-icon {
38
- padding: 0 2px;
39
- fill: var(--color-white);
40
- }
41
-
42
- z-icon.inverse {
43
- fill: var(--gray900);
44
- }
45
-
46
- ul {
47
- position: absolute;
48
- left: 0;
49
- width: 100%;
50
- box-sizing: border-box;
51
- padding: calc(var(--space-unit) / 2) calc(var(--space-unit) * 2) 0 calc(var(--space-unit) * 2);
52
- margin: calc(var(--space-unit) * 1.5) 0 0 0;
53
- background-color: var(--gray900);
54
- font-family: var(--font-family-sans);
55
- font-size: 14px;
56
- font-weight: var(--font-sb);
57
- letter-spacing: 0.3px;
58
- line-height: 20px;
59
- }
60
-
61
- ul.inverse {
62
- background-color: var(--color-white);
63
- }
64
-
65
- ul > li {
66
- display: flex;
67
- justify-content: flex-end;
68
- padding: calc(var(--space-unit) * 1.5 - 1px) 0;
69
- border-bottom: var(--border-base) solid var(--gray700);
70
- margin: 0;
71
- white-space: nowrap;
72
- }
73
-
74
- ul > li.inverse {
75
- border-bottom-color: var(--gray400);
76
- }
77
-
78
- ul > li:first-child {
79
- flex-direction: column;
80
- align-items: end;
81
- padding-top: 0;
82
- padding-bottom: calc(var(--space-unit) + 6px);
83
- border-top: none;
84
- }
85
-
86
- ul > li:last-child {
87
- border-bottom: none;
88
- margin-bottom: 0;
89
- }
90
-
91
- #guestbutton {
92
- display: inline-flex;
93
- width: 100%;
94
- min-width: 32px;
95
- height: 32px;
96
- box-sizing: border-box;
97
- flex-direction: row;
98
- align-items: center;
99
- justify-content: center;
100
- padding: 0 calc(var(--space-unit) * 2);
101
- border-width: var(--border-size-medium);
102
- border-style: solid;
103
- border-color: var(--color-white);
104
- background-color: var(--color-white);
105
- border-radius: var(--border-radius);
106
- color: var(--gray800);
107
- cursor: pointer;
108
- fill: currentcolor;
109
- font-family: var(--font-family-sans);
110
- font-size: 14px;
111
- font-weight: var(--font-sb);
112
- letter-spacing: 0.3px;
113
- line-height: 1;
114
- outline: none;
115
- text-decoration: none;
116
- text-transform: uppercase;
117
- vertical-align: middle;
118
- }
119
-
120
- #guestbutton.inverse {
121
- border-color: var(--gray800);
122
- background-color: var(--gray800);
123
- color: var(--color-white);
124
- }
125
-
126
- .userfullname {
127
- overflow: hidden;
128
- width: 100%;
129
- max-width: 250px;
130
- padding: 0;
131
- color: var(--color-white);
132
- font-family: var(--font-family-sans);
133
- font-size: 16px;
134
- font-weight: var(--font-sb);
135
- letter-spacing: 0;
136
- line-height: 24px;
137
- text-align: right;
138
- text-overflow: ellipsis;
139
- }
140
-
141
- .userfullname.inverse {
142
- color: var(--gray800);
143
- }
144
-
145
- .useremail {
146
- overflow: hidden;
147
- width: 100%;
148
- color: var(--color-white);
149
- font-family: var(--font-family-sans);
150
- font-size: 12px;
151
- font-weight: var(--font-rg);
152
- letter-spacing: 0.32px;
153
- line-height: 16px;
154
- text-align: right;
155
- text-overflow: ellipsis;
156
- }
157
-
158
- .useremail.inverse {
159
- color: var(--gray800);
160
- }
161
-
162
- /* Tablet breakpoint */
163
- @media only screen and (min-width: 768px) {
164
- :host {
165
- height: calc(var(--space-unit) * 4);
166
- background-color: var(--gray900);
167
- }
168
-
169
- :host(.inverse) {
170
- background-color: var(--color-white);
171
- }
172
-
173
- :host > div {
174
- position: relative;
175
- top: 50%;
176
- transform: translateY(-50%);
177
- }
178
-
179
- :host > div.open {
180
- top: auto;
181
- transform: none;
182
- }
183
-
184
- :host > div > div {
185
- padding: 0;
186
- }
187
-
188
- :host > div > div.open {
189
- position: absolute;
190
- right: calc(var(--space-unit) * -1);
191
- padding: calc(var(--space-unit) / 2 + 1px) var(--space-unit) 0 var(--space-unit);
192
- margin-top: calc(var(--space-unit) / 2);
193
- background-color: var(--color-white);
194
- box-shadow: 0 2px calc(var(--space-unit) * 0.5) 0 rgb(0 0 0 / 50%);
195
- transform: translate(0, -4px);
196
- }
197
-
198
- :host > div > div.inverse.open {
199
- background-color: var(--gray800);
200
- }
201
-
202
- button {
203
- display: flex;
204
- flex-flow: row nowrap;
205
- align-content: center;
206
- align-items: end;
207
- justify-content: flex-end;
208
- }
209
-
210
- button.open {
211
- max-width: initial;
212
- padding-right: var(--space-unit);
213
- border-top: var(--border-size-small) solid var(--color-white);
214
- margin-left: var(--space-unit);
215
- background-color: var(--color-white);
216
- border-top-left-radius: calc(var(--space-unit) * 0.5);
217
- border-top-right-radius: calc(var(--space-unit) * 0.5);
218
- }
219
-
220
- button.open.inverse {
221
- border-top-color: var(--gray800);
222
- background-color: var(--gray800);
223
- }
224
-
225
- button:not(.open) z-icon {
226
- fill: var(--color-white);
227
- }
228
-
229
- button:not(.open) z-icon.inverse {
230
- fill: var(--gray800);
231
- }
232
-
233
- button.open z-icon {
234
- fill: var(--gray800);
235
- }
236
-
237
- button.open z-icon.inverse {
238
- fill: var(--color-white);
239
- }
240
-
241
- .userfullname {
242
- width: auto;
243
- padding: 0 calc(var(--space-unit) - 6px) 0 calc(var(--space-unit) - 2px);
244
- font-family: var(--font-family-sans);
245
- font-size: 14px;
246
- font-weight: var(--font-sb);
247
- letter-spacing: 0.16px;
248
- line-height: 20px;
249
- }
250
-
251
- .userfullname.inverse {
252
- color: var(--gray800);
253
- }
254
-
255
- button.open div.userfullname {
256
- max-width: none;
257
- color: var(--gray800);
258
- text-overflow: clip;
259
- }
260
-
261
- button.open div.userfullname.inverse {
262
- color: var(--color-white);
263
- }
264
-
265
- .useremail {
266
- box-sizing: border-box;
267
- padding-right: calc(var(--space-unit) * 3 - 2px);
268
- }
269
-
270
- button.open div.useremail {
271
- color: var(--gray800);
272
- }
273
-
274
- button.open div.useremail.inverse {
275
- color: var(--color-white);
276
- }
277
-
278
- ul {
279
- position: initial;
280
- left: initial;
281
- width: 100%;
282
- padding: 0;
283
- background-color: var(--color-white);
284
- }
285
-
286
- ul.inverse {
287
- border-bottom-color: var(--gray800);
288
- background-color: var(--gray800);
289
- }
290
-
291
- ul > li {
292
- border-bottom: var(--border-base) solid var(--gray400);
293
- margin: 0 var(--space-unit);
294
- color: var(--gray800);
295
- }
296
-
297
- ul > li.inverse {
298
- color: var(--color-white);
299
- }
300
-
301
- ul > li:first-child {
302
- padding-top: calc(var(--space-unit) + 3px);
303
- padding-bottom: calc(var(--space-unit) + 5px);
304
- border-top: var(--border-base) solid var(--gray400);
305
- }
306
- }
@@ -1,129 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a2ca4b97.js';
2
-
3
- const stylesCss = ":host{--app-header-height:auto;--app-header-typography-1-size:24px;--app-header-typography-2-size:28px;--app-header-typography-3-size:32px;--app-header-typography-4-size:36px;--app-header-typography-5-size:42px;--app-header-typography-6-size:48px;--app-header-typography-7-size:54px;--app-header-typography-8-size:60px;--app-header-typography-9-size:68px;--app-header-typography-10-size:76px;--app-header-typography-11-size:84px;--app-header-typography-12-size:92px;--app-header-typography-1-lineheight:1.33;--app-header-typography-2-lineheight:1.29;--app-header-typography-3-lineheight:1.25;--app-header-typography-4-lineheight:1.24;--app-header-typography-5-lineheight:1.24;--app-header-typography-6-lineheight:1.25;--app-header-typography-7-lineheight:1.2;--app-header-typography-8-lineheight:1.26;--app-header-typography-9-lineheight:1.24;--app-header-typography-10-lineheight:1.26;--app-header-typography-11-lineheight:1.2;--app-header-typography-12-lineheight:1.2;--app-header-typography-1-tracking:calc(-0.2 / 1em);--app-header-typography-2-tracking:calc(-0.4 / 1em);--app-header-typography-3-tracking:calc(-0.6 / 1em);--app-header-typography-4-tracking:calc(-0.8 / 1em);--app-header-typography-5-tracking:calc(-1 / 1em);--app-header-typography-6-tracking:calc(-1.2 / 1em);--app-header-typography-7-tracking:calc(-1.4 / 1em);--app-header-typography-8-tracking:calc(-1.6 / 1em);--app-header-typography-9-tracking:calc(-1.8 / 1em);--app-header-typography-10-tracking:calc(-2 / 1em);--app-header-typography-11-tracking:calc(-2.2 / 1em);--app-header-typography-12-tracking:calc(-2.4 / 1em);--app-header-top-offset:48px;--app-header-drawer-trigger-size:calc(var(--space-unit) * 4);--app-header-bg:var(--color-white);--app-header-stucked-bg:var(--color-white);--app-header-text-color:var(--gray800);--app-header-stucked-text-color:var(--gray800);display:block;color:var(--app-header-text-color)}:host,*{box-sizing:border-box}.heading-panel{position:relative;display:flex;width:100%;height:var(--app-header-height);flex-direction:column;flex-grow:0;flex-shrink:0;align-items:baseline;justify-content:flex-start;padding:calc(var(--space-unit) * 2) var(--grid-mobile-margin);background:var(--app-header-bg)}:host(:empty) .heading-panel{padding:0}.heading-title{display:flex;max-width:100%;flex-direction:row;align-items:center}:host(:not([menu-length=\"0\"])) .heading-subtitle{padding-left:calc(var(--app-header-drawer-trigger-size) + (var(--space-unit) * 1.5))}.heading-stucked{position:fixed;z-index:20;top:var(--app-header-top-offset);left:0;display:flex;width:100%;max-width:100%;flex-direction:row;padding:var(--space-unit) var(--grid-mobile-margin);animation:slide-stucked-heading-in 250ms ease-out;background:var(--app-header-stucked-bg);box-shadow:var(--shadow-2);color:var(--app-header-stucked-text-color)}.heading-stucked .heading-title,.heading-stucked .heading-title>*,.heading-stucked .heading-title ::slotted([slot=\"stucked-title\"]){display:block;overflow:hidden;line-height:1.2;text-overflow:ellipsis;white-space:nowrap}.heading-stucked .heading-title>*,::slotted([slot=\"title\"]),::slotted([slot=\"stucked-title\"]){margin:0;font-family:\"IBM Plex Serif\", serif;font-size:var(--app-header-typography-3-size);font-weight:700;letter-spacing:var(--app-header-typography-3-tracking)}::slotted([slot=\"title\"]){line-height:1}::slotted([slot=\"subtitle\"]){margin:var(--space-unit) 0 0;font-family:var(--font-family-sans);font-size:20px;font-style:italic;font-weight:500;line-height:1.2}.heading-container{position:relative;z-index:1;display:flex;max-width:100%;flex-direction:column;align-items:flex-start;justify-content:flex-start;margin-right:auto}.menu-container{display:none;flex-flow:row wrap;align-items:baseline}.menu-container ::slotted([open]){position:relative;z-index:3}.menu-container ::slotted(*:not(:last-of-type)){margin-right:calc(var(--space-unit) * 4.5)}.drawer-trigger{padding:0;border:0;margin:0 calc(var(--space-unit) * 1.5) 0 0;appearance:none;background:none;border-radius:0;color:inherit;cursor:pointer}.drawer-trigger z-icon{--z-icon-width:var(--app-header-drawer-trigger-size);--z-icon-height:var(--app-header-drawer-trigger-size);fill:currentcolor}.drawer-container{position:fixed;z-index:100;top:var(--app-header-top-offset);left:0;width:100%;height:100%;pointer-events:none}.drawer-container .drawer-overlay{position:absolute;z-index:1;top:0;left:0;display:block;width:100%;height:100%;background:var(--gray900);opacity:0;pointer-events:none;transition:opacity 400ms ease-out}.drawer-panel{position:absolute;z-index:2;top:0;left:0;display:flex;width:375px;max-width:100%;height:100%;flex-direction:column;align-items:flex-start;padding:calc(var(--space-unit) * 2) var(--space-unit);background:var(--color-white);color:var(--gray800);pointer-events:none;transform:translate3d(-100%, 0, 0);transition:transform 400ms ease-out}.drawer-content{display:flex;overflow:auto;width:100%;flex:1 auto;flex-direction:column;padding:calc(var(--space-unit) * 0.5) var(--space-unit)}.drawer-content::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}.drawer-content::-webkit-scrollbar-track{background-color:transparent}.drawer-content::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}.drawer-content::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}.drawer-content ::slotted(z-menu){width:100%}.drawer-content ::slotted(z-menu:not(:last-of-type)){margin-bottom:calc(var(--space-unit) * 2.5)}.drawer-close{--z-icon-width:var(--app-header-drawer-trigger-size);--z-icon-height:var(--app-header-drawer-trigger-size);padding:0;border:0;margin:0 0 calc(var(--space-unit) * 2.5) var(--space-unit);appearance:none;background:transparent;border-radius:0;color:inherit;cursor:pointer;fill:currentcolor;font-size:inherit;outline:none}.drawer-close:focus-visible{box-shadow:var(--shadow-focus-primary)}:host([drawer-open]) .drawer-container .drawer-overlay{opacity:0.7;pointer-events:all}:host([drawer-open]) .drawer-container .drawer-panel{pointer-events:all;transform:none}.hero-container{position:absolute;z-index:0;top:0;left:0;width:100%;height:100%}:host([overlay]) .heading-panel .drawer-trigger z-icon,:host([overlay]) .heading-panel .heading-container,:host([overlay]) .heading-panel .menu-container{color:var(--color-white);fill:var(--color-white)}:host([overlay]) .heading-panel .menu-container ::slotted(z-menu:not([open])){--color-surface05:var(--color-white)}:host([overlay]) .hero-container::after{position:absolute;z-index:0;top:0;left:0;width:100%;height:100%;background:var(--color-black);content:\"\";opacity:0.5}.hero-container img,.hero-container ::slotted(*){position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;object-position:top center;-webkit-user-drag:none}@media only screen and (min-width: 768px){.heading-panel{padding:calc(var(--space-unit) * 3) var(--grid-tablet-margin)}.heading-stucked{padding-right:var(--grid-tablet-margin);padding-left:var(--grid-tablet-margin)}:host(:not([flow=\"offcanvas\"])) .heading-subtitle{padding-left:0}:host(:not([flow=\"offcanvas\"])) .menu-container{display:flex}:host(:not([flow=\"offcanvas\"])) .heading-container .drawer-trigger{display:none}:host(:not([flow=\"offcanvas\"],[menu-length=\"0\"])) .heading-container:not(:last-child){margin-bottom:calc(var(--space-unit) * 3)}::slotted([slot=\"title\"]){font-size:var(--app-header-typography-6-size);letter-spacing:var(--app-header-typography-6-tracking)}::slotted([slot=\"subtitle\"]){margin-top:calc(var(--space-unit) * 1.5)}}@media only screen and (min-width: 1152px){.heading-panel,.heading-stucked{padding-right:var(--grid-desktop-margin);padding-left:var(--grid-desktop-margin)}:host(:not([flow=\"stack\"])) .heading-panel{flex-flow:row wrap}::slotted([slot=\"title\"]){margin-right:var(--grid-desktop-gutter);font-size:var(--app-header-typography-7-size);letter-spacing:var(--app-header-typography-7-tracking)}:host(:not([flow=\"offcanvas\"],[menu-length=\"0\"])) .heading-container:not(:last-child){margin-bottom:calc(var(--space-unit) * 2)}.menu-container{margin-top:var(--space-unit)}}@media only screen and (min-width: 1366px){.heading-panel,.heading-stucked{padding-right:var(--grid-wide-margin);padding-left:var(--grid-wide-margin)}::slotted([slot=\"title\"]){margin-right:var(--grid-wide-gutter);font-size:var(--app-header-typography-9-size);letter-spacing:var(--app-header-typography-9-tracking)}:host(:not([flow=\"offcanvas\"],[menu-length=\"0\"])) .heading-container:not(:last-child){margin-bottom:0}}@keyframes slide-stucked-heading-in{0%{transform:translate3d(0, -100%, 0)}100%{transform:none}}";
4
-
5
- const SUPPORT_INTERSECTION_OBSERVER = typeof IntersectionObserver !== "undefined";
6
- const ZAppHeader = class {
7
- constructor(hostRef) {
8
- registerInstance(this, hostRef);
9
- this.sticking = createEvent(this, "sticking", 7);
10
- /**
11
- * Stuck mode for the header.
12
- * You can programmatically set it using an IntersectionObserver.
13
- * **Optional**
14
- */
15
- this.stuck = false;
16
- /**
17
- * Should place an overlay over the hero image.
18
- * Useful for legibility purpose.
19
- * **Optional**
20
- */
21
- this.overlay = false;
22
- /**
23
- * Control menu bar position in the header.
24
- * - auto: the menu bar is positioned near the title
25
- * - stack: the menu bar is positioned below the title
26
- * - offcanvas: the menu bar is not displayed and a burger icon appears to open the offcanvas menu
27
- *
28
- * **Optional**
29
- */
30
- this.flow = "auto";
31
- /**
32
- * The opening state of the drawer.
33
- */
34
- this.drawerOpen = false;
35
- /**
36
- * The stucked state of the bar.
37
- */
38
- this.stucked = false;
39
- this.observer = SUPPORT_INTERSECTION_OBSERVER &&
40
- new IntersectionObserver(([entry]) => {
41
- this.stucked = !entry.isIntersecting;
42
- }, {
43
- threshold: 0.5,
44
- });
45
- this.openDrawer = this.openDrawer.bind(this);
46
- this.closeDrawer = this.closeDrawer.bind(this);
47
- this.collectMenuElements.bind(this);
48
- }
49
- emitStickingEvent() {
50
- this.sticking.emit(this.stucked);
51
- }
52
- componentDidLoad() {
53
- this.collectMenuElements();
54
- this.onStuckMode();
55
- }
56
- get title() {
57
- const titleElement = this.hostElement.querySelector('[slot="title"]');
58
- if (titleElement === null) {
59
- return "";
60
- }
61
- return titleElement.textContent.trim();
62
- }
63
- get scrollParent() {
64
- const parent = this.hostElement.offsetParent;
65
- if (parent === document.body || parent === document.documentElement) {
66
- return window;
67
- }
68
- return parent;
69
- }
70
- collectMenuElements() {
71
- const menuElements = (this.menuElements = this.hostElement.querySelectorAll('[slot="menu"]'));
72
- this.menuLength = menuElements.length;
73
- this.setMenuFloatingMode();
74
- }
75
- onStuckMode() {
76
- if (this.stuck) {
77
- this.enableStuckObserver();
78
- }
79
- else {
80
- this.disableStuckMode();
81
- }
82
- }
83
- enableStuckObserver() {
84
- if (this.observer) {
85
- this.observer.observe(this.container);
86
- }
87
- }
88
- disableStuckMode() {
89
- this.stucked = false;
90
- if (this.observer) {
91
- this.observer.unobserve(this.container);
92
- }
93
- }
94
- onStucked() {
95
- const scrollParent = this.scrollParent;
96
- if (!scrollParent) {
97
- return;
98
- }
99
- this.emitStickingEvent();
100
- }
101
- setMenuFloatingMode() {
102
- if (this.menuElements.length === 0) {
103
- return;
104
- }
105
- const elements = this.menuElements;
106
- for (let i = 0, len = elements.length; i < len; i++) {
107
- elements[i].open = false;
108
- elements[i].floating = !this.drawerOpen;
109
- }
110
- }
111
- render() {
112
- return (h(Host, { "menu-length": this.menuLength }, h("div", { class: "heading-panel", ref: (el) => (this.container = el) }, h("div", { class: "hero-container" }, h("slot", { name: "hero" }, this.hero && (h("img", { alt: "", src: this.hero })))), h("div", { class: "heading-container" }, h("div", { class: "heading-title" }, this.menuLength > 0 && (h("button", { class: "drawer-trigger", "aria-label": "Apri menu", onClick: this.openDrawer }, h("z-icon", { name: "burger-menu" }))), h("slot", { name: "title" })), h("div", { class: "heading-subtitle" }, h("slot", { name: "subtitle" }))), h("div", { class: "menu-container" }, !this.drawerOpen && this.flow !== "offcanvas" && (h("slot", { name: "menu", onSlotchange: () => this.collectMenuElements() })))), h("div", { class: "drawer-container" }, h("div", { class: "drawer-overlay", onClick: this.closeDrawer }), h("div", { class: "drawer-panel" }, h("button", { class: "drawer-close", "aria-label": "Chiudi menu", onClick: this.closeDrawer }, h("z-icon", { name: "close" })), h("div", { class: "drawer-content" }, this.drawerOpen && (h("slot", { name: "menu", onSlotchange: () => this.collectMenuElements() }))))), this.stucked && (h("div", { class: "heading-stucked" }, this.menuLength > 0 && (h("button", { class: "drawer-trigger", "aria-label": "Apri menu", onClick: this.openDrawer }, h("z-icon", { name: "burger-menu" }))), h("div", { class: "heading-title" }, h("slot", { name: "stucked-title" }, this.title))))));
113
- }
114
- openDrawer() {
115
- this.drawerOpen = true;
116
- }
117
- closeDrawer() {
118
- this.drawerOpen = false;
119
- }
120
- get hostElement() { return getElement(this); }
121
- static get watchers() { return {
122
- "stuck": ["onStuckMode"],
123
- "stucked": ["onStucked"],
124
- "drawerOpen": ["setMenuFloatingMode"]
125
- }; }
126
- };
127
- ZAppHeader.style = stylesCss;
128
-
129
- export { ZAppHeader as z_app_header };