@zanichelli/zanichelli-it-frontend-kit 1.3.0-RC3 → 1.3.0-RC5

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 (90) hide show
  1. package/dist/cjs/{index-CRwLFnL1.js → index-BLzQAHAI.js} +46 -4
  2. package/dist/cjs/index-BLzQAHAI.js.map +1 -0
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/zanichelli-it-frontend-kit.cjs.js +2 -2
  5. package/dist/cjs/zanit-back-to-top.zanit-menubar.zanit-mobile-menubar.zanit-search-form.entry.cjs.js.map +1 -0
  6. package/dist/cjs/{zanit-menubar_3.cjs.entry.js → zanit-back-to-top_4.cjs.entry.js} +78 -267
  7. package/dist/cjs/zanit-back-to-top_4.cjs.entry.js.map +1 -0
  8. package/dist/collection/collection-manifest.json +1 -0
  9. package/dist/collection/components/back-to-top/back-to-top.css +15 -0
  10. package/dist/collection/components/back-to-top/back-to-top.js +124 -0
  11. package/dist/collection/components/back-to-top/back-to-top.js.map +1 -0
  12. package/dist/collection/components/menubar/menubar.css +0 -2
  13. package/dist/collection/components/menubar/menubar.js +2 -52
  14. package/dist/collection/components/menubar/menubar.js.map +1 -1
  15. package/dist/collection/components/menubar/mobile-menubar/mobile-menubar.css +0 -1
  16. package/dist/collection/components/menubar/mobile-menubar/mobile-menubar.js +1 -51
  17. package/dist/collection/components/menubar/mobile-menubar/mobile-menubar.js.map +1 -1
  18. package/dist/collection/components/menubar/search-form/search-form.css +0 -52
  19. package/dist/collection/components/menubar/search-form/search-form.js +22 -207
  20. package/dist/collection/components/menubar/search-form/search-form.js.map +1 -1
  21. package/dist/collection/utils/utils.js +0 -8
  22. package/dist/collection/utils/utils.js.map +1 -1
  23. package/dist/components/index.js +42 -0
  24. package/dist/components/index.js.map +1 -1
  25. package/dist/components/{p-mjHId4_R.js → p-BJzEFXY7.js} +5 -11
  26. package/dist/components/p-BJzEFXY7.js.map +1 -0
  27. package/dist/components/p-Cfa-BVne.js +133 -0
  28. package/dist/components/p-Cfa-BVne.js.map +1 -0
  29. package/dist/components/zanit-back-to-top.d.ts +11 -0
  30. package/dist/components/zanit-back-to-top.js +82 -0
  31. package/dist/components/zanit-back-to-top.js.map +1 -0
  32. package/dist/components/zanit-menubar.js +5 -11
  33. package/dist/components/zanit-menubar.js.map +1 -1
  34. package/dist/components/zanit-mobile-menubar.js +1 -1
  35. package/dist/components/zanit-search-form.js +1 -1
  36. package/dist/esm/{index-B82IapZZ.js → index-DSdvvVFj.js} +46 -4
  37. package/dist/esm/index-DSdvvVFj.js.map +1 -0
  38. package/dist/esm/loader.js +3 -3
  39. package/dist/esm/zanichelli-it-frontend-kit.js +3 -3
  40. package/dist/esm/zanit-back-to-top.zanit-menubar.zanit-mobile-menubar.zanit-search-form.entry.js.map +1 -0
  41. package/dist/esm/{zanit-menubar_3.entry.js → zanit-back-to-top_4.entry.js} +78 -268
  42. package/dist/esm/zanit-back-to-top_4.entry.js.map +1 -0
  43. package/dist/types/components/back-to-top/back-to-top.d.ts +25 -0
  44. package/dist/types/components/menubar/menubar.d.ts +0 -5
  45. package/dist/types/components/menubar/mobile-menubar/mobile-menubar.d.ts +0 -5
  46. package/dist/types/components/menubar/search-form/search-form.d.ts +5 -28
  47. package/dist/types/components.d.ts +53 -60
  48. package/dist/types/utils/types.d.ts +0 -7
  49. package/dist/types/utils/utils.d.ts +0 -8
  50. package/dist/zanichelli-it-frontend-kit/p-22226d84.entry.js +2 -0
  51. package/dist/zanichelli-it-frontend-kit/p-22226d84.entry.js.map +1 -0
  52. package/dist/zanichelli-it-frontend-kit/p-DSdvvVFj.js +3 -0
  53. package/dist/zanichelli-it-frontend-kit/p-DSdvvVFj.js.map +1 -0
  54. package/dist/zanichelli-it-frontend-kit/zanichelli-it-frontend-kit.esm.js +1 -1
  55. package/dist/zanichelli-it-frontend-kit/zanit-back-to-top.zanit-menubar.zanit-mobile-menubar.zanit-search-form.entry.esm.js.map +1 -0
  56. package/package.json +1 -1
  57. package/www/build/p-22226d84.entry.js +2 -0
  58. package/www/build/p-22226d84.entry.js.map +1 -0
  59. package/www/build/p-4eac6a5c.js +2 -0
  60. package/www/build/p-DSdvvVFj.js +3 -0
  61. package/www/build/p-DSdvvVFj.js.map +1 -0
  62. package/www/build/zanichelli-it-frontend-kit.esm.js +1 -1
  63. package/www/build/zanit-back-to-top.zanit-menubar.zanit-mobile-menubar.zanit-search-form.entry.esm.js.map +1 -0
  64. package/www/index.html +2 -2
  65. package/dist/cjs/index-CRwLFnL1.js.map +0 -1
  66. package/dist/cjs/zanit-menubar.zanit-mobile-menubar.zanit-search-form.entry.cjs.js.map +0 -1
  67. package/dist/cjs/zanit-menubar_3.cjs.entry.js.map +0 -1
  68. package/dist/collection/components/menubar/search-form/suggestions.js +0 -84
  69. package/dist/collection/components/menubar/search-form/suggestions.js.map +0 -1
  70. package/dist/collection/utils/subjects.api.js +0 -25
  71. package/dist/collection/utils/subjects.api.js.map +0 -1
  72. package/dist/components/p-ZtXP-Url.js +0 -375
  73. package/dist/components/p-ZtXP-Url.js.map +0 -1
  74. package/dist/components/p-mjHId4_R.js.map +0 -1
  75. package/dist/esm/index-B82IapZZ.js.map +0 -1
  76. package/dist/esm/zanit-menubar.zanit-mobile-menubar.zanit-search-form.entry.js.map +0 -1
  77. package/dist/esm/zanit-menubar_3.entry.js.map +0 -1
  78. package/dist/types/components/menubar/search-form/suggestions.d.ts +0 -11
  79. package/dist/types/utils/subjects.api.d.ts +0 -6
  80. package/dist/zanichelli-it-frontend-kit/p-B82IapZZ.js +0 -3
  81. package/dist/zanichelli-it-frontend-kit/p-B82IapZZ.js.map +0 -1
  82. package/dist/zanichelli-it-frontend-kit/p-d53e0a87.entry.js +0 -2
  83. package/dist/zanichelli-it-frontend-kit/p-d53e0a87.entry.js.map +0 -1
  84. package/dist/zanichelli-it-frontend-kit/zanit-menubar.zanit-mobile-menubar.zanit-search-form.entry.esm.js.map +0 -1
  85. package/www/build/p-82a399e5.js +0 -2
  86. package/www/build/p-B82IapZZ.js +0 -3
  87. package/www/build/p-B82IapZZ.js.map +0 -1
  88. package/www/build/p-d53e0a87.entry.js +0 -2
  89. package/www/build/p-d53e0a87.entry.js.map +0 -1
  90. package/www/build/zanit-menubar.zanit-mobile-menubar.zanit-search-form.entry.esm.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { h, p as proxyCustomElement, H } from './index.js';
2
- import { d as defineCustomElement$1, S as SearchEnv, m as moveFocus, c as containsTarget } from './p-ZtXP-Url.js';
2
+ import { d as defineCustomElement$1, m as moveFocus, c as containsTarget } from './p-Cfa-BVne.js';
3
3
 
4
4
  const DEFAULT_GROUP_KEY = 'default';
5
5
  const DEFAULT_GROUP = {
@@ -41,7 +41,7 @@ const Menu = ({ controlledBy, items, currentPath = [], onItemKeyDown }) => {
41
41
  }, href: item.href, role: "menuitem", tabIndex: -1, "aria-current": isActive(item) ? 'page' : 'false', onKeyDown: (event) => onItemKeyDown(event), target: item.target }, item.label))))))))))));
42
42
  };
43
43
 
44
- const mobileMenubarCss = ":host{position:relative;z-index:2;display:block;width:100%;max-width:100%;height:3rem;background-color:#fff;color:var(--gray900);fill:var(--gray900);font-family:var(--font-family-sans)}:host,*,::before,::after{box-sizing:border-box}*:focus:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}ul{padding:0;margin:0;list-style:none}a{color:var(--gray900);cursor:pointer;text-decoration:none}button{all:unset;cursor:pointer}nav{display:flex;width:100%;align-items:center;padding-left:var(--grid-margin);gap:8px}nav::after{position:absolute;top:0;right:0;width:100%;height:100%;background:transparent;box-shadow:var(--shadow-1);content:'';pointer-events:none}z-logo{margin:8px 0}.mobile-menu{position:absolute;top:100%;left:0;display:flex;overflow:auto;width:100%;max-height:calc(100vh - 48px - var(--zanit-menubar-top-offset, 0px));flex-direction:column;padding:16px var(--grid-margin) 32px;background-color:#fff;box-shadow:var(--shadow-2);gap:8px}.mobile-menu li{width:100%}.mobile-menu .items-container{display:flex;min-height:256px;flex-direction:column;gap:8px}.mobile-menu .items-container z-ghost-loading{width:40%;height:1.2rem}.mobile-menu .items-container .menubar-item{display:block;width:100%;padding:8px 0;font-size:1rem;text-align:left}.mobile-menu .items-container li:not(:last-child) .menubar-item{border-bottom:1px solid #000}[role='menuitem'].parent{display:flex;width:fit-content;align-items:center;padding:0;border:none;font-size:0.875rem;gap:8px}zanit-search-form{margin-left:auto}";
44
+ const mobileMenubarCss = ":host{position:relative;z-index:2;display:block;width:100%;max-width:100%;background-color:#fff;color:var(--gray900);fill:var(--gray900);font-family:var(--font-family-sans)}:host,*,::before,::after{box-sizing:border-box}*:focus:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}ul{padding:0;margin:0;list-style:none}a{color:var(--gray900);cursor:pointer;text-decoration:none}button{all:unset;cursor:pointer}nav{display:flex;width:100%;align-items:center;padding-left:var(--grid-margin);gap:8px}nav::after{position:absolute;top:0;right:0;width:100%;height:100%;background:transparent;box-shadow:var(--shadow-1);content:'';pointer-events:none}z-logo{margin:8px 0}.mobile-menu{position:absolute;top:100%;left:0;display:flex;overflow:auto;width:100%;max-height:calc(100vh - 48px - var(--zanit-menubar-top-offset, 0px));flex-direction:column;padding:16px var(--grid-margin) 32px;background-color:#fff;box-shadow:var(--shadow-2);gap:8px}.mobile-menu li{width:100%}.mobile-menu .items-container{display:flex;min-height:256px;flex-direction:column;gap:8px}.mobile-menu .items-container z-ghost-loading{width:40%;height:1.2rem}.mobile-menu .items-container .menubar-item{display:block;width:100%;padding:8px 0;font-size:1rem;text-align:left}.mobile-menu .items-container li:not(:last-child) .menubar-item{border-bottom:1px solid #000}[role='menuitem'].parent{display:flex;width:fit-content;align-items:center;padding:0;border:none;font-size:0.875rem;gap:8px}zanit-search-form{margin-left:auto}";
45
45
 
46
46
  const menuCss = ".menu-wrapper{width:100%;background-color:#fff}.menu{position:relative;display:flex;width:100%;flex-direction:column;gap:32px 0}.menu .group{display:flex;flex-direction:column}.menu .group .group-name{border-bottom:1px solid currentcolor;margin-bottom:4px;color:var(--red500);font-size:0.875rem;font-weight:var(--font-md)}.menu .group .menu-list{display:flex;flex-direction:column;gap:8px}.menu .group .menu-list .menu-item{display:block;border-bottom:2px solid transparent;font-size:0.875rem;font-weight:var(--font-md)}.menu .menu-list .menu-item.active,.menu .menu-list .menu-item:hover{border-bottom-color:var(--red500)}.menu .group.highlight .menu-list .menu-item{font-size:1rem}@media (width >= 768px){.menu-wrapper{position:absolute;top:100%;left:0;display:flex;justify-content:center;box-shadow:var(--shadow-1)}.menu{display:grid;width:100%;max-width:var(--zanit-menubar-max-width, 1366px);padding:16px var(--grid-margin);gap:0 24px;grid-auto-columns:minmax(0, max-content);grid-auto-flow:column;grid-template-rows:minmax(0, max-content) max-content}.menu .group{display:grid;grid-row:1 / -1;grid-template-columns:1fr;grid-template-rows:subgrid}@supports not (grid-template-rows: subgrid){.menu .group{grid-template-rows:repeat(auto-fit, minmax(0, max-content))}}.menu .group .group-name{border:none;margin-bottom:16px}.menu .group .menu-list .menu-item{font-size:1rem}.menu .group.highlight .menu-list .menu-item{font-size:1.5rem}}";
47
47
 
@@ -60,10 +60,6 @@ const ZanitMobileMenubar = /*@__PURE__*/ proxyCustomElement(class ZanitMobileMen
60
60
  searchQuery = undefined;
61
61
  /** Whether the menubar is loading the data. */
62
62
  loading = false;
63
- /** Environment for search suggestions */
64
- searchEnv = SearchEnv.PROD;
65
- /** Search area (e.g. "SCUOLA", "UNIVERSITÀ", "DIZIONARI"). */
66
- searchArea;
67
63
  /** Last active item ID. */
68
64
  lastCurrent = undefined;
69
65
  parentItem = undefined;
@@ -193,7 +189,7 @@ const ZanitMobileMenubar = /*@__PURE__*/ proxyCustomElement(class ZanitMobileMen
193
189
  this.open = false;
194
190
  }
195
191
  render() {
196
- return (h("nav", { key: 'f21d484bf0c81aa8e4583f71bf8a8523c57b791f', "aria-label": "Zanichelli.it" }, h("button", { key: '5331948d9f25ebf2812b9538ba2654ccd98a376a', class: "burger-button", type: "button", "aria-expanded": this.open ? 'true' : 'false', "aria-controls": "mobile-menu", "aria-label": this.open ? 'Chiudi menù' : 'Apri menù', onClick: () => this.toggleMenu() }, h("z-icon", { key: '14b6264bd1aa3383a90d0f38924cc73b407af7fb', name: this.open ? 'multiply' : 'burger-menu', width: "1.5rem", height: "1.5rem" })), h("z-logo", { key: 'ad25511bb218bdfae227a6f84c2f84790da5495a', imageAlt: "Logo Zanichelli", link: "/", height: 32, width: 126 }), h("zanit-search-form", { key: 'a76767d008e17c8c22baef76eb5ef6237764a665', searchQuery: this.searchQuery, onResetSearch: () => (this.searchQuery = undefined), searchArea: this.searchArea, searchEnv: this.searchEnv }), this.open && (h("ul", { key: 'dc7159a8a0342825a7828323204dd10e32ea30ee', class: "mobile-menu", role: "menubar" }, !this.loading && this.currentPath && this.currentPath.length > 0 && (h("li", { key: '60f03b21375d3cdc89242a67b89c42a6d2aad5ca', role: "none" }, h("a", { key: '143c13385480d4860d95cc073af0d53aa8f622f2', class: "parent", href: this.parentItem?.href ?? '/', id: this.parentItem?.id ?? undefined, role: "menuitem", tabIndex: -1, onKeyDown: (event) => this.handleItemKeydown(event), target: this.parentItem?.target }, h("z-icon", { key: 'a433613bd001bcbd44ba98305291d8d585349f21', name: "arrow-left", width: "0.5rem", height: "0.5rem" }), h("span", { key: '237cc68a00c57e71ef564444ab872a4d47bf7071' }, this.parentItem?.label || 'Home')))), this.loading ? (h("div", { class: "items-container", role: "none" }, [...new Array(4)].map(() => (h("li", { role: "none" }, h("div", { class: "menubar-item", role: "none" }, h("z-ghost-loading", null))))))) : this.menuType === 'menu' ? (h(Menu, { items: this.menuItems, controlledBy: this.parentItem?.id, currentPath: this.currentPath, onItemKeyDown: (event) => this.handleItemKeydown(event) })) : (this.menuItems?.length > 0 && (h("div", { class: "items-container", role: "none" }, this.menuItems.map((item) => (h("li", { role: "none" }, h("a", { class: {
192
+ return (h("nav", { key: '3c60ac4ac98ee3defb91d07ed2b877031f0a35df', "aria-label": "Zanichelli.it" }, h("button", { key: 'bebe58a827addf39e62deb9c3ef44296f14da700', class: "burger-button", type: "button", "aria-expanded": this.open ? 'true' : 'false', "aria-controls": "mobile-menu", "aria-label": this.open ? 'Chiudi menù' : 'Apri menù', onClick: () => this.toggleMenu() }, h("z-icon", { key: '0b3e97a6bcb3f54c1b0669f9fe012ac3ff5b5632', name: this.open ? 'multiply' : 'burger-menu', width: "1.5rem", height: "1.5rem" })), h("z-logo", { key: 'a7216fc628ab13b243ace77a89d5dc16bde1f6da', imageAlt: "Logo Zanichelli", link: "/", height: 32, width: 126 }), h("zanit-search-form", { key: 'bdfd612ecc8cf6fb7d4d1941474a8b6cc0b8ff2d', searchQuery: this.searchQuery, onResetSearch: () => (this.searchQuery = undefined) }), this.open && (h("ul", { key: 'bf3f32326a98ff6a47a3734ac98f8afda74f0d12', class: "mobile-menu", role: "menubar" }, !this.loading && this.currentPath && this.currentPath.length > 0 && (h("li", { key: 'a157937b4358cba0a1bc990576051f4a703cedd4', role: "none" }, h("a", { key: '9f36e81c276da144abf96e9e1dd7cf2a84bdc4b7', class: "parent", href: this.parentItem?.href ?? '/', id: this.parentItem?.id ?? undefined, role: "menuitem", tabIndex: -1, onKeyDown: (event) => this.handleItemKeydown(event), target: this.parentItem?.target }, h("z-icon", { key: 'ba4c4e1c0b1132cbcd4be7a4088bf1fb6618f062', name: "arrow-left", width: "0.5rem", height: "0.5rem" }), h("span", { key: 'cc30b285857d7cb7908e35dadf424e0940342949' }, this.parentItem?.label || 'Home')))), this.loading ? (h("div", { class: "items-container", role: "none" }, [...new Array(4)].map(() => (h("li", { role: "none" }, h("div", { class: "menubar-item", role: "none" }, h("z-ghost-loading", null))))))) : this.menuType === 'menu' ? (h(Menu, { items: this.menuItems, controlledBy: this.parentItem?.id, currentPath: this.currentPath, onItemKeyDown: (event) => this.handleItemKeydown(event) })) : (this.menuItems?.length > 0 && (h("div", { class: "items-container", role: "none" }, this.menuItems.map((item) => (h("li", { role: "none" }, h("a", { class: {
197
193
  'menu-item': this.menuType === 'menu',
198
194
  'menubar-item': this.menuType === 'menubar',
199
195
  }, href: item.href, id: item.id, role: "menuitem", "aria-current": this.lastCurrent === item.id ? 'page' : 'false', tabIndex: -1, onKeyDown: (event) => this.handleItemKeydown(event), target: item.target }, h("span", { "data-text": item.label }, item.label))))))))))));
@@ -209,8 +205,6 @@ const ZanitMobileMenubar = /*@__PURE__*/ proxyCustomElement(class ZanitMobileMen
209
205
  "items": [16],
210
206
  "searchQuery": [1025, "search-query"],
211
207
  "loading": [4],
212
- "searchEnv": [1, "search-env"],
213
- "searchArea": [1, "search-area"],
214
208
  "lastCurrent": [32],
215
209
  "parentItem": [32],
216
210
  "menuItems": [32],
@@ -241,6 +235,6 @@ function defineCustomElement() {
241
235
  defineCustomElement();
242
236
 
243
237
  export { Menu as M, ZanitMobileMenubar as Z, defineCustomElement as d };
244
- //# sourceMappingURL=p-mjHId4_R.js.map
238
+ //# sourceMappingURL=p-BJzEFXY7.js.map
245
239
 
246
- //# sourceMappingURL=p-mjHId4_R.js.map
240
+ //# sourceMappingURL=p-BJzEFXY7.js.map
@@ -0,0 +1 @@
1
+ {"file":"p-BJzEFXY7.js","mappings":";;;AAiBA,MAAM,iBAAiB,GAAG,SAAS;AACnC,MAAM,aAAa,GAAG;AACpB,IAAA,EAAE,EAAE,iBAAiB;AACrB,IAAA,KAAK,EAAE,iBAAiB;CACzB;AAED;AACA,MAAM,eAAe,GAAG,CAAC,KAAiB,KAAI;IAC5C,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAsE,CAAC,OAAO,EAAE,IAAI,KAAI;AACjH,QAAA,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,aAAa,CAAC,EAAE,CAAC,CAAC;QAChG,IAAI,CAAC,SAAS,EAAE;AACd,YAAA,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,E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AAC,UAAU,EACD,cAAA,EAAA,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,EAAE,GAAG,MAAM,GAAG,OAAO,EAC7D,QAAQ,EAAE,EAAE,EACZ,SAAS,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,EACnD,MAAM,EAAE,IAAI,CAAC,MAAM,EAAA,EAEnB,CAAA,CAAA,MAAA,EAAA,EAAA,WAAA,EAAiB,IAAI,CAAC,KAAK,IAAG,IAAI,CAAC,KAAK,CAAQ,CAC9C,CACD,CACN,CAAC,CACE,CACP,CACF,CACE,CACN,CACG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/menubar/menu/menu.tsx","src/components/menubar/mobile-menubar/mobile-menubar.css?tag=zanit-mobile-menubar&encapsulation=shadow","src/components/menubar/menu/menu.css?tag=zanit-mobile-menubar&encapsulation=shadow","src/components/menubar/mobile-menubar/mobile-menubar.tsx"],"sourcesContent":["import { FunctionalComponent, h } from '@stencil/core';\nimport { MenuItem } from '../../../utils';\n\n/**\n * Menu of items that can be grouped.\n * @member {string} controlledBy - The HTML id of the element that controls the menu.\n * @member {MenuItem[]} items - The items to show in the menu.\n * @member {string[]} currentPath - Path of current item.\n * @member {function} onItemKeyDown - The function to call when a key is pressed from a menuitem.\n */\nexport interface MenuProps {\n controlledBy?: string;\n items?: MenuItem[];\n currentPath?: string[];\n onItemKeyDown?: (event: KeyboardEvent) => void;\n}\n\nconst DEFAULT_GROUP_KEY = 'default';\nconst DEFAULT_GROUP = {\n id: DEFAULT_GROUP_KEY,\n label: DEFAULT_GROUP_KEY,\n};\n\n/** Get the items grouped by their group. */\nconst getGroupedItems = (items: MenuItem[]) => {\n const groups = items.reduce<{ group: MenuProps['items'][number]['group']; items: MenuItem[] }[]>((grouped, item) => {\n const itemGroup = grouped.find(({ group }) => group.id === (item.group?.id || DEFAULT_GROUP.id));\n if (!itemGroup) {\n grouped.push({ group: item.group ?? DEFAULT_GROUP, items: [item] });\n } else {\n itemGroup.items.push(item);\n }\n\n return grouped;\n }, []);\n\n // Sort to keep default group at the end\n return groups.sort((a, b) => (a.group.id === DEFAULT_GROUP_KEY ? 1 : b.group.id === DEFAULT_GROUP_KEY ? -1 : 0));\n};\n\n/**\n * Floating menu component. It shows a list of items that can be grouped.\n */\nexport const Menu: FunctionalComponent<MenuProps> = ({ controlledBy, items, currentPath = [], onItemKeyDown }) => {\n if (!items?.length) {\n return null;\n }\n\n const groups = getGroupedItems(items);\n\n const isActive = (item: MenuItem) => currentPath.includes(controlledBy) && currentPath.includes(item.id);\n\n return (\n <div\n class=\"menu-wrapper\"\n role=\"none\"\n >\n <div\n class=\"menu\"\n aria-labelledby={controlledBy ?? undefined}\n role=\"menu\"\n >\n {groups.map(({ group, items }) => (\n <div class={{ group: true, highlight: items.some((item) => item.highlight) }}>\n {group.id !== DEFAULT_GROUP_KEY ? (\n <div\n class=\"group-name\"\n id={group.id}\n >\n {group.label}\n </div>\n ) : groups.length > 1 ? (\n // empty div to keep the same height as the other groups\n <div class=\"group-name\" />\n ) : null}\n <ul\n class=\"menu-list\"\n role=\"group\"\n aria-labelledby={group.id !== DEFAULT_GROUP_KEY ? group.id : undefined}\n >\n {items.map((item) => (\n <li role=\"none\">\n {item.href && (\n <a\n class={{\n 'menu-item': true,\n 'active': isActive(item),\n }}\n href={item.href}\n role=\"menuitem\"\n tabIndex={-1}\n aria-current={isActive(item) ? 'page' : 'false'}\n onKeyDown={(event) => onItemKeyDown(event)}\n target={item.target}\n >\n {item.label}\n </a>\n )}\n </li>\n ))}\n </ul>\n </div>\n ))}\n </div>\n </div>\n );\n};\n",":host {\n position: relative;\n z-index: 2;\n display: block;\n width: 100%;\n max-width: 100%;\n background-color: #fff;\n color: var(--gray900);\n fill: var(--gray900);\n font-family: var(--font-family-sans);\n}\n\n:host,\n*,\n::before,\n::after {\n box-sizing: border-box;\n}\n\n*:focus:focus-visible {\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\nul {\n padding: 0;\n margin: 0;\n list-style: none;\n}\n\na {\n color: var(--gray900);\n cursor: pointer;\n text-decoration: none;\n}\n\nbutton {\n all: unset;\n cursor: pointer;\n}\n\nnav {\n display: flex;\n width: 100%;\n align-items: center;\n padding-left: var(--grid-margin);\n gap: 8px;\n}\n\nnav::after {\n position: absolute;\n top: 0;\n right: 0;\n width: 100%;\n height: 100%;\n background: transparent;\n box-shadow: var(--shadow-1);\n content: '';\n pointer-events: none;\n}\n\nz-logo {\n margin: 8px 0;\n}\n\n.mobile-menu {\n position: absolute;\n top: 100%;\n left: 0;\n display: flex;\n overflow: auto;\n width: 100%;\n max-height: calc(100vh - 48px - var(--zanit-menubar-top-offset, 0px));\n flex-direction: column;\n padding: 16px var(--grid-margin) 32px;\n background-color: #fff;\n box-shadow: var(--shadow-2);\n gap: 8px;\n}\n\n.mobile-menu li {\n width: 100%;\n}\n\n.mobile-menu .items-container {\n display: flex;\n min-height: 256px;\n flex-direction: column;\n gap: 8px;\n}\n\n.mobile-menu .items-container z-ghost-loading {\n width: 40%;\n height: 1.2rem;\n}\n\n.mobile-menu .items-container .menubar-item {\n display: block;\n width: 100%;\n padding: 8px 0;\n font-size: 1rem;\n text-align: left;\n}\n\n.mobile-menu .items-container li:not(:last-child) .menubar-item {\n border-bottom: 1px solid #000;\n}\n\n[role='menuitem'].parent {\n display: flex;\n width: fit-content;\n align-items: center;\n padding: 0;\n border: none;\n font-size: 0.875rem;\n gap: 8px;\n}\n\nzanit-search-form {\n margin-left: auto;\n}\n",".menu-wrapper {\n width: 100%;\n background-color: #fff;\n}\n\n.menu {\n position: relative;\n display: flex;\n width: 100%;\n flex-direction: column;\n gap: 32px 0;\n}\n\n.menu .group {\n display: flex;\n flex-direction: column;\n}\n\n.menu .group .group-name {\n border-bottom: 1px solid currentcolor;\n margin-bottom: 4px;\n color: var(--red500);\n font-size: 0.875rem;\n font-weight: var(--font-md);\n}\n\n.menu .group .menu-list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.menu .group .menu-list .menu-item {\n display: block;\n border-bottom: 2px solid transparent;\n font-size: 0.875rem;\n font-weight: var(--font-md);\n}\n\n.menu .menu-list .menu-item.active,\n.menu .menu-list .menu-item:hover {\n border-bottom-color: var(--red500);\n}\n\n.menu .group.highlight .menu-list .menu-item {\n font-size: 1rem;\n}\n\n@media (width >= 768px) {\n .menu-wrapper {\n position: absolute;\n top: 100%;\n left: 0;\n display: flex;\n justify-content: center;\n box-shadow: var(--shadow-1);\n }\n\n .menu {\n display: grid;\n width: 100%;\n max-width: var(--zanit-menubar-max-width, 1366px);\n padding: 16px var(--grid-margin);\n gap: 0 24px;\n grid-auto-columns: minmax(0, max-content);\n grid-auto-flow: column;\n grid-template-rows: minmax(0, max-content) max-content;\n }\n\n .menu .group {\n display: grid;\n grid-row: 1 / -1;\n grid-template-columns: 1fr;\n grid-template-rows: subgrid;\n }\n\n @supports not (grid-template-rows: subgrid) {\n .menu .group {\n grid-template-rows: repeat(auto-fit, minmax(0, max-content));\n }\n }\n\n .menu .group .group-name {\n border: none;\n margin-bottom: 16px;\n }\n\n .menu .group .menu-list .menu-item {\n font-size: 1rem;\n }\n\n .menu .group.highlight .menu-list .menu-item {\n font-size: 1.5rem;\n }\n}\n","import { Component, Element, h, Listen, Prop, State, Watch } from '@stencil/core';\nimport { MenubarItem, MenuItem } from '../../../utils';\nimport { Menu } from '../menu/menu';\nimport { containsTarget, moveFocus } from '../../../utils';\n\n/** Mobile menubar component. */\n@Component({\n tag: 'zanit-mobile-menubar',\n styleUrls: ['mobile-menubar.css', '../menu/menu.css'],\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class ZanitMobileMenubar {\n @Element() host: HTMLZanitMobileMenubarElement;\n\n /** IDs path of the current item. */\n @Prop() currentPath: string[] = [];\n\n /** Menubar items. */\n @Prop() items: MenubarItem[] = [];\n\n /** Initial search query. */\n @Prop({ mutable: true }) searchQuery: string | undefined = undefined;\n\n /** Whether the menubar is loading the data. */\n @Prop() loading: boolean = false;\n\n /** Last active item ID. */\n @State() lastCurrent: string | undefined = undefined;\n @State() parentItem: MenubarItem | undefined = undefined;\n @State() menuItems: MenubarItem[] | MenuItem[] | undefined = undefined;\n /** Whether the items to render come from a menubar or a menu. */\n @State() menuType: 'menubar' | 'menu' | undefined = undefined;\n @State() open: boolean;\n\n @Watch('items')\n @Watch('currentPath')\n onItemsChange() {\n this.lastCurrent = this.currentPath?.length ? this.currentPath[this.currentPath.length - 1] : undefined;\n this.setupData(this.items);\n }\n\n /**\n * Find the current item and take its parent, `menuItems` or the `navbarItems`.\n */\n private setupData(items: MenubarItem[], parent?: MenubarItem) {\n // If no current item is defined, we show all items\n if (this.lastCurrent === undefined) {\n this.parentItem = undefined;\n this.menuType = 'menubar';\n this.menuItems = items;\n return;\n }\n\n for (const item of items) {\n if (item.id === this.lastCurrent) {\n this.parentItem = parent;\n this.menuType = item.menuItems?.length ? 'menu' : 'menubar';\n this.menuItems = item.menuItems || item.navbarItems;\n return;\n }\n\n if (\n this.currentPath.length > 1 &&\n item.id === this.currentPath[this.currentPath.length - 2] &&\n item.menuItems?.some(({ id }) => id === this.lastCurrent)\n ) {\n this.parentItem = item;\n this.menuType = item.menuItems?.length ? 'menu' : 'menubar';\n this.menuItems = item.menuItems || item.navbarItems;\n return;\n }\n\n if (item.navbarItems?.length) {\n this.setupData(item.navbarItems, item);\n }\n }\n }\n\n private get menuItemsElement() {\n return Array.from(this.host.shadowRoot.querySelectorAll('[role=\"menuitem\"]')) as HTMLElement[];\n }\n\n /** Initialize tabindex on menuitems, setting -1 to all but the first one. */\n private initTabindex() {\n this.menuItemsElement.forEach((item, index) => item.setAttribute('tabindex', index === 0 ? '0' : '-1'));\n }\n\n private toggleMenu() {\n if (this.open) {\n this.open = false;\n } else {\n this.open = true;\n setTimeout(() => {\n this.initTabindex();\n this.menuItemsElement[0]?.focus({ preventScroll: true });\n }, 200);\n }\n }\n\n /** Handles keyboard navigation on mobile menu. */\n private handleItemKeydown(event: KeyboardEvent) {\n switch (event.key) {\n case 'ArrowUp': {\n event.preventDefault();\n event.stopPropagation();\n const items = this.menuItemsElement;\n const currentIndex = items.indexOf(event.target as HTMLElement);\n const prevItem = items[(currentIndex - 1 + items.length) % items.length];\n moveFocus(items[currentIndex], prevItem);\n break;\n }\n case 'ArrowDown': {\n event.preventDefault();\n event.stopPropagation();\n const items = this.menuItemsElement;\n const currentIndex = items.indexOf(event.target as HTMLElement);\n const nextItem = items[(currentIndex + 1) % items.length];\n moveFocus(items[currentIndex], nextItem);\n break;\n }\n case 'Home': {\n event.preventDefault();\n event.stopPropagation();\n moveFocus(event.target as HTMLElement, this.menuItemsElement[0]);\n break;\n }\n case 'End': {\n event.preventDefault();\n event.stopPropagation();\n moveFocus(event.target as HTMLElement, this.menuItemsElement.pop());\n break;\n }\n }\n }\n\n connectedCallback() {\n this.lastCurrent = this.currentPath?.length ? this.currentPath[this.currentPath.length - 1] : undefined;\n this.setupData(this.items);\n }\n\n /** Close the menu when clicking outside. */\n @Listen('click', { target: 'document', passive: true })\n handleOutsideClick(event: MouseEvent) {\n if (containsTarget(this.host, event)) {\n return;\n }\n\n this.open = false;\n }\n\n /** Close the menu when pressing Escape or Tab. */\n @Listen('keydown', { passive: true })\n handleKeydown(event: KeyboardEvent) {\n switch (event.key) {\n case 'Escape':\n this.open = false;\n break;\n case 'Tab':\n if (containsTarget(this.host, event)) {\n break;\n }\n\n this.open = false;\n break;\n }\n }\n\n /** Close the menu when the focus goes out. */\n @Listen('focusin', { target: 'document', passive: true })\n handleFocusout(event: FocusEvent) {\n if (containsTarget(this.host, event)) {\n return;\n }\n\n this.open = false;\n }\n\n render() {\n return (\n <nav aria-label=\"Zanichelli.it\">\n <button\n class=\"burger-button\"\n type=\"button\"\n aria-expanded={this.open ? 'true' : 'false'}\n aria-controls=\"mobile-menu\"\n aria-label={this.open ? 'Chiudi menù' : 'Apri menù'}\n onClick={() => this.toggleMenu()}\n >\n <z-icon\n name={this.open ? 'multiply' : 'burger-menu'}\n width=\"1.5rem\"\n height=\"1.5rem\"\n ></z-icon>\n </button>\n\n <z-logo\n imageAlt=\"Logo Zanichelli\"\n link=\"/\"\n height={32}\n width={126}\n ></z-logo>\n\n <zanit-search-form\n searchQuery={this.searchQuery}\n onResetSearch={() => (this.searchQuery = undefined)}\n />\n\n {this.open && (\n <ul\n class=\"mobile-menu\"\n role=\"menubar\"\n >\n {!this.loading && this.currentPath && this.currentPath.length > 0 && (\n <li role=\"none\">\n <a\n class=\"parent\"\n href={this.parentItem?.href ?? '/'}\n id={this.parentItem?.id ?? undefined}\n role=\"menuitem\"\n tabIndex={-1}\n onKeyDown={(event) => this.handleItemKeydown(event)}\n target={this.parentItem?.target}\n >\n <z-icon\n name=\"arrow-left\"\n width=\"0.5rem\"\n height=\"0.5rem\"\n ></z-icon>\n <span>\n {/* Show the 'Home' label if the current item is a root child. */}\n {this.parentItem?.label || 'Home'}\n </span>\n </a>\n </li>\n )}\n\n {this.loading ? (\n <div\n class=\"items-container\"\n role=\"none\"\n >\n {[...new Array(4)].map(() => (\n <li role=\"none\">\n <div\n class=\"menubar-item\"\n role=\"none\"\n >\n <z-ghost-loading></z-ghost-loading>\n </div>\n </li>\n ))}\n </div>\n ) : this.menuType === 'menu' ? (\n <Menu\n items={this.menuItems}\n controlledBy={this.parentItem?.id}\n currentPath={this.currentPath}\n onItemKeyDown={(event) => this.handleItemKeydown(event)}\n />\n ) : (\n this.menuItems?.length > 0 && (\n <div\n class=\"items-container\"\n role=\"none\"\n >\n {this.menuItems.map((item) => (\n <li role=\"none\">\n <a\n class={{\n 'menu-item': this.menuType === 'menu',\n 'menubar-item': this.menuType === 'menubar',\n }}\n href={item.href}\n id={item.id}\n role=\"menuitem\"\n aria-current={this.lastCurrent === item.id ? 'page' : 'false'}\n tabIndex={-1}\n onKeyDown={(event) => this.handleItemKeydown(event)}\n target={item.target}\n >\n <span data-text={item.label}>{item.label}</span>\n </a>\n </li>\n ))}\n </div>\n )\n )}\n </ul>\n )}\n </nav>\n );\n }\n}\n"],"version":3}
@@ -0,0 +1,133 @@
1
+ import { p as proxyCustomElement, H, c as createEvent, h } from './index.js';
2
+
3
+ /**
4
+ * Check if an element contains an event target by checking its composedPath.
5
+ * Useful when an event target may come from a component's shadow DOM.
6
+ */
7
+ const containsTarget = (ancestor, event) => {
8
+ return event
9
+ .composedPath()
10
+ .filter((el) => el !== document && el !== window.window)
11
+ .some((el) => ancestor.contains(el));
12
+ };
13
+ /** Move the focus to `next` element, set tabindex to 0 for `next` and -1 to `current`. */
14
+ const moveFocus = (current, next) => {
15
+ current.tabIndex = -1;
16
+ next.tabIndex = 0;
17
+ next.focus({ preventScroll: true });
18
+ };
19
+
20
+ const searchFormCss = ":host,*,::before,::after{box-sizing:border-box}*:focus:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}button{all:unset;cursor:pointer}.searchbar{--searchbar-button-x-padding:14px;--searchbar-button-icon-width:1.75rem;--closed-searchbar-width:calc((var(--searchbar-button-x-padding) * 2) + var(--searchbar-button-icon-width) + 1px);position:absolute;top:0;right:0;display:flex;width:var(--closed-searchbar-width);justify-content:flex-end;transition:width 0.4s ease-in-out}.searchbar.searchbar-open{width:100%}.searchbar .input-wrapper{display:flex;overflow:hidden;width:100%;align-items:center;padding:8px;padding-left:var(--grid-margin);background-color:#fff;gap:8px;transition-duration:0.4s;transition-property:padding-right, padding-left, width;transition-timing-function:ease-in-out}.searchbar:not(.searchbar-open) .input-wrapper{overflow:hidden;width:0;padding:0}.searchbar button[type='reset']{--z-icon-width:1rem;--z-icon-height:1rem;display:flex;align-items:center;cursor:pointer}.searchbar input{z-index:1;width:100%;height:100%;padding:0;border:none;background-color:#fff;font-family:var(--font-family-sans);font-size:1rem}.searchbar.searchbar-open input:first-child{padding-left:4px;margin-left:-4px;}.searchbar input[type='search']::-webkit-search-cancel-button,.searchbar input[type='search']::-webkit-search-decoration{appearance:none}.searchbar input::placeholder{color:var(--gray500)}.searchbar .searchbar-button{display:flex;align-items:center;justify-content:center;padding:10px var(--searchbar-button-x-padding);border-left:1px solid #000;background:var(--zanit-accent-color);font-family:inherit;font-size:inherit;gap:64px;line-height:1}.searchbar .searchbar-button:focus-visible{z-index:1}.searchbar-button z-icon{--z-icon-width:var(--searchbar-button-icon-width);--z-icon-height:var(--searchbar-button-icon-width)}@media (width < 1152px){.searchbar .searchbar-button>.searchbar-button-label{display:none}}@media (width >= 768px){.searchbar{--searchbar-button-x-padding:16px;--searchbar-button-icon-width:2rem}.searchbar .input-wrapper{gap:14px}.searchbar button[type='reset']{--z-icon-width:1.5rem;--z-icon-height:1.5rem}.searchbar input,.searchbar .searchbar-button{font-size:1.5rem}.searchbar .searchbar-button{padding:8px var(--searchbar-button-x-padding)}}@media (width >= 1152px){.searchbar{--closed-searchbar-width:190px}}@media (width >= 1366px){.searchbar .searchbar-button{border-right:1px solid #000}}";
21
+
22
+ const ZanitSearchForm = /*@__PURE__*/ proxyCustomElement(class ZanitSearchForm extends H {
23
+ constructor() {
24
+ super();
25
+ this.__registerHost();
26
+ this.__attachShadow();
27
+ this.search = createEvent(this, "search");
28
+ this.resetSearch = createEvent(this, "resetSearch");
29
+ }
30
+ formElement;
31
+ get host() { return this; }
32
+ /** Indicates whether the searchbar is visible and usable. */
33
+ showSearchbar = false;
34
+ /** Search query to apply. */
35
+ _searchQuery = undefined;
36
+ /** Initial search query */
37
+ searchQuery = undefined;
38
+ onSearchQueryChange() {
39
+ this._searchQuery = this.searchQuery;
40
+ if (this.searchQuery) {
41
+ this.openSearchbar();
42
+ }
43
+ }
44
+ /** Emitted on search form submission. */
45
+ search;
46
+ resetSearch;
47
+ async connectedCallback() {
48
+ this.showSearchbar = !!this.searchQuery;
49
+ this._searchQuery = this.searchQuery;
50
+ }
51
+ /** Close open searchbar when clicking outside. */
52
+ handleOutsideClick(event) {
53
+ if (this.showSearchbar && this.formElement && !containsTarget(this.formElement, event)) {
54
+ this.showSearchbar = false;
55
+ }
56
+ }
57
+ /** Close the menu when pressing Escape or Tab. */
58
+ handleKeydown(event) {
59
+ switch (event.key) {
60
+ case 'Escape':
61
+ this.showSearchbar = false;
62
+ break;
63
+ case 'Tab':
64
+ if (containsTarget(this.host, event)) {
65
+ break;
66
+ }
67
+ this.showSearchbar = false;
68
+ break;
69
+ }
70
+ }
71
+ openSearchbar() {
72
+ this.showSearchbar = true;
73
+ setTimeout(() => {
74
+ const searchbarInput = this.host.shadowRoot.querySelector('#searchbar-input');
75
+ searchbarInput.focus({ preventScroll: true });
76
+ }, 500);
77
+ }
78
+ resetSearchQuery() {
79
+ this.searchQuery = undefined;
80
+ this.resetSearch.emit();
81
+ }
82
+ handleInputChange(event) {
83
+ this._searchQuery = event.target.value;
84
+ if (!this._searchQuery) {
85
+ this.searchQuery = undefined;
86
+ }
87
+ }
88
+ onSearchSubmit(event) {
89
+ event.preventDefault();
90
+ if (!this._searchQuery) {
91
+ return;
92
+ }
93
+ this.showSearchbar = false;
94
+ const searchEv = this.search.emit({ query: this._searchQuery });
95
+ // do not submit the form if the event default behavior was prevented
96
+ if (searchEv.defaultPrevented) {
97
+ return;
98
+ }
99
+ this.formElement.submit();
100
+ }
101
+ render() {
102
+ return (h("form", { key: 'e1d177efbec2aea39cd30cfc8f02fe4e9f5e82d9', class: { 'searchbar': true, 'searchbar-open': this.showSearchbar }, ref: (el) => (this.formElement = el), role: "search", "aria-label": "Cerca nel sito", method: "get", action: "/ricerca", onSubmit: (event) => this.onSearchSubmit(event), onReset: () => this.resetSearchQuery() }, h("div", { key: '49aeaa97516d5782e1fcf866a5526ff19f8b0c14', class: "input-wrapper", role: "none" }, this.searchQuery && (h("button", { key: '61ec6636b5efd875bcf879b28894ffd1cf8ac802', type: "reset", "aria-label": "Svuota campo di ricerca", disabled: !this.showSearchbar, "aria-hidden": !this.showSearchbar ? 'true' : undefined, tabIndex: !this.showSearchbar ? -1 : 0 }, h("z-icon", { key: 'a896ac0e6ae2762e9d5dbb0351634505b519a684', name: "multiply-circled" }))), h("input", { key: '3ab6655ef669a6c30b5bbe547884c680284d7f14', id: "searchbar-input", name: "q", type: "search", disabled: !this.showSearchbar, placeholder: "Cerca per parola chiave o ISBN", onInput: (event) => this.handleInputChange(event), value: this.searchQuery, required: true, "aria-label": "Cerca per parola chiave o ISBN", "aria-hidden": !this.showSearchbar ? 'true' : undefined, tabIndex: !this.showSearchbar ? -1 : 0 })), h("button", { key: '3df725da35664493fe70a15ea39184ab00b37e32', class: "searchbar-button", "aria-label": this.showSearchbar ? 'Esegui ricerca' : 'Apri il campo di ricerca', "aria-controls": "searchbar-input", type: this.showSearchbar ? 'submit' : 'button', onClick: () => this.openSearchbar() }, this.showSearchbar ? null : h("span", { class: "searchbar-button-label" }, "Cerca"), h("z-icon", { key: '8f6cfd25fbacbc04b7bc060470667eb9b2a45179', name: "search" }))));
103
+ }
104
+ static get watchers() { return {
105
+ "searchQuery": ["onSearchQueryChange"]
106
+ }; }
107
+ static get style() { return searchFormCss; }
108
+ }, [1, "zanit-search-form", {
109
+ "searchQuery": [1025, "search-query"],
110
+ "showSearchbar": [32],
111
+ "_searchQuery": [32]
112
+ }, [[5, "click", "handleOutsideClick"], [1, "keydown", "handleKeydown"]], {
113
+ "searchQuery": ["onSearchQueryChange"]
114
+ }]);
115
+ function defineCustomElement() {
116
+ if (typeof customElements === "undefined") {
117
+ return;
118
+ }
119
+ const components = ["zanit-search-form"];
120
+ components.forEach(tagName => { switch (tagName) {
121
+ case "zanit-search-form":
122
+ if (!customElements.get(tagName)) {
123
+ customElements.define(tagName, ZanitSearchForm);
124
+ }
125
+ break;
126
+ } });
127
+ }
128
+ defineCustomElement();
129
+
130
+ export { ZanitSearchForm as Z, containsTarget as c, defineCustomElement as d, moveFocus as m };
131
+ //# sourceMappingURL=p-Cfa-BVne.js.map
132
+
133
+ //# sourceMappingURL=p-Cfa-BVne.js.map
@@ -0,0 +1 @@
1
+ {"file":"p-Cfa-BVne.js","mappings":";;AAAA;;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AE,CAAC,KAAK,KAAK,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,EACjD,KAAK,EAAE,IAAI,CAAC,WAAW,EACvB,QAAQ,EAAA,IAAA,EAAA,YAAA,EACG,gCAAgC,EAC9B,aAAA,EAAA,CAAC,IAAI,CAAC,aAAa,GAAG,MAAM,GAAG,SAAS,EACrD,QAAQ,EAAE,CAAC,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,CAAC,GAC/B,CACL,EAEN,CAAA,CAAA,QAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACE,KAAK,EAAC,kBAAkB,gBACZ,IAAI,CAAC,aAAa,GAAG,gBAAgB,GAAG,0BAA0B,EAChE,eAAA,EAAA,iBAAiB,EAC/B,IAAI,EAAE,IAAI,CAAC,aAAa,GAAG,QAAQ,GAAG,QAAQ,EAC9C,OAAO,EAAE,MAAM,IAAI,CAAC,aAAa,EAAE,EAAA,EAElC,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,CAAA,CAAA,MAAA,EAAA,EAAM,KAAK,EAAC,wBAAwB,EAAa,EAAA,OAAA,CAAA,EAC9E,CAAA,CAAA,QAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAQ,IAAI,EAAC,QAAQ,GAAU,CACxB,CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/utils/utils.ts","src/components/menubar/search-form/search-form.css?tag=zanit-search-form&encapsulation=shadow","src/components/menubar/search-form/search-form.tsx"],"sourcesContent":["/**\n * Check if an element contains an event target by checking its composedPath.\n * Useful when an event target may come from a component's shadow DOM.\n */\nexport const containsTarget = (ancestor: HTMLElement, event: Event) => {\n return event\n .composedPath()\n .filter((el) => el !== document && el !== window.window)\n .some((el) => ancestor.contains(el as HTMLElement));\n};\n\n/** Move the focus to `next` element, set tabindex to 0 for `next` and -1 to `current`. */\nexport const moveFocus = (current: HTMLElement, next: HTMLElement) => {\n current.tabIndex = -1;\n next.tabIndex = 0;\n next.focus({ preventScroll: true });\n};\n",":host,\n*,\n::before,\n::after {\n box-sizing: border-box;\n}\n\n*:focus:focus-visible {\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\nbutton {\n all: unset;\n cursor: pointer;\n}\n\n.searchbar {\n --searchbar-button-x-padding: 14px;\n --searchbar-button-icon-width: 1.75rem;\n\n /* button horizontal padding + icon size + left border */\n --closed-searchbar-width: calc((var(--searchbar-button-x-padding) * 2) + var(--searchbar-button-icon-width) + 1px);\n\n position: absolute;\n top: 0;\n right: 0;\n display: flex;\n width: var(--closed-searchbar-width);\n justify-content: flex-end;\n transition: width 0.4s ease-in-out;\n}\n\n.searchbar.searchbar-open {\n width: 100%;\n}\n\n.searchbar .input-wrapper {\n display: flex;\n overflow: hidden;\n width: 100%;\n align-items: center;\n padding: 8px;\n padding-left: var(--grid-margin);\n background-color: #fff;\n gap: 8px;\n transition-duration: 0.4s;\n transition-property: padding-right, padding-left, width;\n transition-timing-function: ease-in-out;\n}\n\n.searchbar:not(.searchbar-open) .input-wrapper {\n overflow: hidden;\n width: 0;\n padding: 0;\n}\n\n.searchbar button[type='reset'] {\n --z-icon-width: 1rem;\n --z-icon-height: 1rem;\n\n display: flex;\n align-items: center;\n cursor: pointer;\n}\n\n.searchbar input {\n z-index: 1;\n width: 100%;\n height: 100%;\n padding: 0;\n border: none;\n background-color: #fff;\n font-family: var(--font-family-sans);\n font-size: 1rem;\n}\n\n.searchbar.searchbar-open input:first-child {\n padding-left: 4px;\n margin-left: -4px; /* per evitare che la focus shadow vada fuori dallo schermo */\n}\n\n.searchbar input[type='search']::-webkit-search-cancel-button,\n.searchbar input[type='search']::-webkit-search-decoration {\n appearance: none;\n}\n\n.searchbar input::placeholder {\n color: var(--gray500);\n}\n\n.searchbar .searchbar-button {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 10px var(--searchbar-button-x-padding);\n border-left: 1px solid #000;\n background: var(--zanit-accent-color);\n font-family: inherit;\n font-size: inherit;\n gap: 64px;\n line-height: 1;\n}\n\n.searchbar .searchbar-button:focus-visible {\n z-index: 1;\n}\n\n.searchbar-button z-icon {\n --z-icon-width: var(--searchbar-button-icon-width);\n --z-icon-height: var(--searchbar-button-icon-width);\n}\n\n@media (width < 1152px) {\n .searchbar .searchbar-button > .searchbar-button-label {\n display: none;\n }\n}\n\n@media (width >= 768px) {\n .searchbar {\n --searchbar-button-x-padding: 16px;\n --searchbar-button-icon-width: 2rem;\n }\n\n .searchbar .input-wrapper {\n gap: 14px;\n }\n\n .searchbar button[type='reset'] {\n --z-icon-width: 1.5rem;\n --z-icon-height: 1.5rem;\n }\n\n .searchbar input,\n .searchbar .searchbar-button {\n font-size: 1.5rem;\n }\n\n .searchbar .searchbar-button {\n padding: 8px var(--searchbar-button-x-padding);\n }\n}\n\n@media (width >= 1152px) {\n .searchbar {\n --closed-searchbar-width: 190px;\n }\n}\n\n@media (width >= 1366px) {\n .searchbar .searchbar-button {\n border-right: 1px solid #000;\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Listen, Prop, State, Watch } from '@stencil/core';\nimport { containsTarget } from '../../../utils';\n\n@Component({\n tag: 'zanit-search-form',\n styleUrl: 'search-form.css',\n shadow: true,\n})\nexport class ZanitSearchForm {\n private formElement: HTMLFormElement;\n\n @Element() host: HTMLZanitSearchFormElement;\n\n /** Indicates whether the searchbar is visible and usable. */\n @State()\n showSearchbar: boolean = false;\n\n /** Search query to apply. */\n @State()\n _searchQuery: string | undefined = undefined;\n\n /** Initial search query */\n @Prop({ mutable: true })\n searchQuery: string | undefined = undefined;\n\n @Watch('searchQuery')\n onSearchQueryChange() {\n this._searchQuery = this.searchQuery;\n if (this.searchQuery) {\n this.openSearchbar();\n }\n }\n\n /** Emitted on search form submission. */\n @Event({ cancelable: true }) search: EventEmitter<{ query: string }>;\n\n @Event() resetSearch: EventEmitter<void>;\n\n async connectedCallback() {\n this.showSearchbar = !!this.searchQuery;\n this._searchQuery = this.searchQuery;\n }\n\n /** Close open searchbar when clicking outside. */\n @Listen('click', { target: 'document', passive: true })\n handleOutsideClick(event: MouseEvent) {\n if (this.showSearchbar && this.formElement && !containsTarget(this.formElement, event)) {\n this.showSearchbar = false;\n }\n }\n\n /** Close the menu when pressing Escape or Tab. */\n @Listen('keydown', { passive: true })\n handleKeydown(event: KeyboardEvent) {\n switch (event.key) {\n case 'Escape':\n this.showSearchbar = false;\n break;\n case 'Tab':\n if (containsTarget(this.host, event)) {\n break;\n }\n\n this.showSearchbar = false;\n break;\n }\n }\n\n private openSearchbar() {\n this.showSearchbar = true;\n setTimeout(() => {\n const searchbarInput = this.host.shadowRoot.querySelector('#searchbar-input') as HTMLInputElement;\n searchbarInput.focus({ preventScroll: true });\n }, 500);\n }\n\n private resetSearchQuery() {\n this.searchQuery = undefined;\n this.resetSearch.emit();\n }\n\n private handleInputChange(event: Event) {\n this._searchQuery = (event.target as HTMLInputElement).value;\n if (!this._searchQuery) {\n this.searchQuery = undefined;\n }\n }\n\n private onSearchSubmit(event: Event) {\n event.preventDefault();\n if (!this._searchQuery) {\n return;\n }\n\n this.showSearchbar = false;\n const searchEv = this.search.emit({ query: this._searchQuery });\n // do not submit the form if the event default behavior was prevented\n if (searchEv.defaultPrevented) {\n return;\n }\n\n this.formElement.submit();\n }\n\n render() {\n return (\n <form\n class={{ 'searchbar': true, 'searchbar-open': this.showSearchbar }}\n ref={(el) => (this.formElement = el)}\n role=\"search\"\n aria-label=\"Cerca nel sito\"\n method=\"get\"\n action=\"/ricerca\"\n onSubmit={(event) => this.onSearchSubmit(event)}\n onReset={() => this.resetSearchQuery()}\n >\n <div\n class=\"input-wrapper\"\n role=\"none\"\n >\n {this.searchQuery && (\n <button\n type=\"reset\"\n aria-label=\"Svuota campo di ricerca\"\n disabled={!this.showSearchbar}\n aria-hidden={!this.showSearchbar ? 'true' : undefined}\n tabIndex={!this.showSearchbar ? -1 : 0}\n >\n <z-icon name=\"multiply-circled\" />\n </button>\n )}\n <input\n id=\"searchbar-input\"\n name=\"q\"\n type=\"search\"\n disabled={!this.showSearchbar}\n placeholder=\"Cerca per parola chiave o ISBN\"\n onInput={(event) => this.handleInputChange(event)}\n value={this.searchQuery}\n required\n aria-label=\"Cerca per parola chiave o ISBN\"\n aria-hidden={!this.showSearchbar ? 'true' : undefined}\n tabIndex={!this.showSearchbar ? -1 : 0}\n ></input>\n </div>\n\n <button\n class=\"searchbar-button\"\n aria-label={this.showSearchbar ? 'Esegui ricerca' : 'Apri il campo di ricerca'}\n aria-controls=\"searchbar-input\"\n type={this.showSearchbar ? 'submit' : 'button'}\n onClick={() => this.openSearchbar()}\n >\n {this.showSearchbar ? null : <span class=\"searchbar-button-label\">Cerca</span>}\n <z-icon name=\"search\"></z-icon>\n </button>\n </form>\n );\n }\n}\n"],"version":3}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface ZanitBackToTop extends Components.ZanitBackToTop, HTMLElement {}
4
+ export const ZanitBackToTop: {
5
+ prototype: ZanitBackToTop;
6
+ new (): ZanitBackToTop;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,82 @@
1
+ import { p as proxyCustomElement, H, h, a as Host } from './index.js';
2
+
3
+ const backToTopCss = ".sc-zanit-back-to-top-h{visibility:visible;opacity:1;transition:all 0.2s linear}.hidden.sc-zanit-back-to-top-h{visibility:hidden;opacity:0}.sc-zanit-back-to-top-h .z-fab.sc-zanit-back-to-top{--color-primary01:var(--gray950);outline:1px solid var(--color-white)}";
4
+
5
+ const ZanitBackTop = /*@__PURE__*/ proxyCustomElement(class ZanitBackTop extends H {
6
+ constructor() {
7
+ super();
8
+ this.__registerHost();
9
+ }
10
+ resizeObserver;
11
+ get host() { return this; }
12
+ /** Indicates whether the back-to-top button is visible and usable. */
13
+ showFab = false;
14
+ /** Indicates the current height of the page. */
15
+ currentPageHeight;
16
+ /** Indicates if the viewport is mobile. */
17
+ isMobile = false;
18
+ /** Min page height from which the back-to-top button must appear. */
19
+ pageMinHeight = 1600;
20
+ /** Min scroll height from which the back-to-top button must appear. */
21
+ scrollMinHeight = 800;
22
+ handleScroll() {
23
+ this.updateFabVisibility();
24
+ }
25
+ handleResize = () => {
26
+ const newHeight = document.documentElement.scrollHeight;
27
+ if (newHeight !== this.currentPageHeight)
28
+ this.currentPageHeight = newHeight;
29
+ };
30
+ connectedCallback() {
31
+ this.currentPageHeight = document.body.scrollHeight;
32
+ this.resizeObserver = new ResizeObserver(this.handleResize);
33
+ this.resizeObserver.observe(document.documentElement);
34
+ this.updateFabVisibility();
35
+ const mobileMediaQuery = window.matchMedia('(width < 768px)');
36
+ this.isMobile = mobileMediaQuery.matches;
37
+ mobileMediaQuery.onchange = (mql) => {
38
+ this.isMobile = mql.matches;
39
+ };
40
+ }
41
+ disconnectedCallback() {
42
+ this.resizeObserver.disconnect();
43
+ }
44
+ updateFabVisibility() {
45
+ this.showFab = this.currentPageHeight > this.pageMinHeight && window.scrollY > this.scrollMinHeight;
46
+ }
47
+ scroll() {
48
+ window.scrollTo({ top: 0, behavior: 'smooth' });
49
+ }
50
+ render() {
51
+ return (h(Host, { key: 'e2585492b2d991aed8c99c02b68fbc5b68c800da', class: { hidden: !this.showFab }, "aria-hidden": this.showFab ? 'false' : 'true' }, h("button", { key: '15ae24d829c4e88e7eefce2f5e9c9a8bee255124', class: { 'z-fab': true, 'z-fab-extended': !this.isMobile }, onClick: () => this.scroll() }, h("z-icon", { key: 'a5f937a661696ea0a68c558f0232f77de70d156e', name: "back-top" }), h("span", { key: '628786873ddc4db46d6fa73211b0c1e1d576a794' }, "Torna su"))));
52
+ }
53
+ static get style() { return backToTopCss; }
54
+ }, [2, "zanit-back-to-top", {
55
+ "pageMinHeight": [2, "page-min-height"],
56
+ "scrollMinHeight": [2, "scroll-min-height"],
57
+ "showFab": [32],
58
+ "currentPageHeight": [32],
59
+ "isMobile": [32]
60
+ }, [[9, "scroll", "handleScroll"]]]);
61
+ function defineCustomElement$1() {
62
+ if (typeof customElements === "undefined") {
63
+ return;
64
+ }
65
+ const components = ["zanit-back-to-top"];
66
+ components.forEach(tagName => { switch (tagName) {
67
+ case "zanit-back-to-top":
68
+ if (!customElements.get(tagName)) {
69
+ customElements.define(tagName, ZanitBackTop);
70
+ }
71
+ break;
72
+ } });
73
+ }
74
+ defineCustomElement$1();
75
+
76
+ const ZanitBackToTop = ZanitBackTop;
77
+ const defineCustomElement = defineCustomElement$1;
78
+
79
+ export { ZanitBackToTop, defineCustomElement };
80
+ //# sourceMappingURL=zanit-back-to-top.js.map
81
+
82
+ //# sourceMappingURL=zanit-back-to-top.js.map
@@ -0,0 +1 @@
1
+ {"file":"zanit-back-to-top.js","mappings":";;AAAA,MAAM,YAAY,GAAG,uQAAuQ;;MCY/Q,YAAY,iBAAAA,kBAAA,CAAA,MAAA,YAAA,SAAAC,CAAA,CAAA;;;;;AACf,IAAA,cAAc;;;IAMtB,OAAO,GAAY,KAAK;;AAIxB,IAAA,iBAAiB;;IAIjB,QAAQ,GAAY,KAAK;;IAIzB,aAAa,GAAW,IAAI;;IAI5B,eAAe,GAAW,GAAG;IAG7B,YAAY,GAAA;QACV,IAAI,CAAC,mBAAmB,EAAE;;IAGpB,YAAY,GAAG,MAAK;AAC1B,QAAA,MAAM,SAAS,GAAG,QAAQ,CAAC,eAAe,CAAC,YAAY;AACvD,QAAA,IAAI,SAAS,KAAK,IAAI,CAAC,iBAAiB;AAAE,YAAA,IAAI,CAAC,iBAAiB,GAAG,SAAS;AAC9E,KAAC;IAED,iBAAiB,GAAA;QACf,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAC,IAAI,CAAC,YAAY;QACnD,IAAI,CAAC,cAAc,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,YAAY,CAAC;QAC3D,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC;QAErD,IAAI,CAAC,mBAAmB,EAAE;QAE1B,MAAM,gBA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Element","HTMLElement"],"sources":["src/components/back-to-top/back-to-top.css?tag=zanit-back-to-top&encapsulation=scoped","src/components/back-to-top/back-to-top.tsx"],"sourcesContent":[":host {\n visibility: visible;\n opacity: 1;\n transition: all 0.2s linear;\n}\n\n:host.hidden {\n visibility: hidden;\n opacity: 0;\n}\n\n:host .z-fab {\n --color-primary01: var(--gray950);\n outline: 1px solid var(--color-white);\n}\n","import { Component, Element, Host, Listen, Prop, State, h } from '@stencil/core';\n\n/**\n * Back to top floating action button component.\n * Appears on scroll, given a min height for both scroll height and page height.\n */\n@Component({\n tag: 'zanit-back-to-top',\n styleUrls: ['back-to-top.css'],\n shadow: false,\n scoped: true,\n})\nexport class ZanitBackTop {\n private resizeObserver: ResizeObserver;\n\n @Element() host: HTMLZanitBackToTopElement;\n\n /** Indicates whether the back-to-top button is visible and usable. */\n @State()\n showFab: boolean = false;\n\n /** Indicates the current height of the page. */\n @State()\n currentPageHeight: number;\n\n /** Indicates if the viewport is mobile. */\n @State()\n isMobile: boolean = false;\n\n /** Min page height from which the back-to-top button must appear. */\n @Prop()\n pageMinHeight: number = 1600;\n\n /** Min scroll height from which the back-to-top button must appear. */\n @Prop()\n scrollMinHeight: number = 800;\n\n @Listen('scroll', { target: 'window', passive: true })\n handleScroll() {\n this.updateFabVisibility();\n }\n\n private handleResize = () => {\n const newHeight = document.documentElement.scrollHeight;\n if (newHeight !== this.currentPageHeight) this.currentPageHeight = newHeight;\n };\n\n connectedCallback() {\n this.currentPageHeight = document.body.scrollHeight;\n this.resizeObserver = new ResizeObserver(this.handleResize);\n this.resizeObserver.observe(document.documentElement);\n\n this.updateFabVisibility();\n\n const mobileMediaQuery = window.matchMedia('(width < 768px)');\n this.isMobile = mobileMediaQuery.matches;\n mobileMediaQuery.onchange = (mql) => {\n this.isMobile = mql.matches;\n };\n }\n\n disconnectedCallback() {\n this.resizeObserver.disconnect();\n }\n\n private updateFabVisibility() {\n this.showFab = this.currentPageHeight > this.pageMinHeight && window.scrollY > this.scrollMinHeight;\n }\n\n private scroll() {\n window.scrollTo({ top: 0, behavior: 'smooth' });\n }\n\n render() {\n return (\n <Host\n class={{ hidden: !this.showFab }}\n aria-hidden={this.showFab ? 'false' : 'true'}\n >\n <button\n class={{ 'z-fab': true, 'z-fab-extended': !this.isMobile }}\n onClick={() => this.scroll()}\n >\n <z-icon name=\"back-top\" />\n <span>Torna su</span>\n </button>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1,8 +1,8 @@
1
1
  import { p as proxyCustomElement, H, h, F as Fragment } from './index.js';
2
- import { d as defineCustomElement$2, S as SearchEnv, c as containsTarget, m as moveFocus } from './p-ZtXP-Url.js';
3
- import { d as defineCustomElement$3, M as Menu } from './p-mjHId4_R.js';
2
+ import { d as defineCustomElement$2, c as containsTarget, m as moveFocus } from './p-Cfa-BVne.js';
3
+ import { d as defineCustomElement$3, M as Menu } from './p-BJzEFXY7.js';
4
4
 
5
- const menubarCss = ":host{position:relative;z-index:2;display:flex;width:100%;background-color:#fff;color:var(--gray900);font-family:var(--font-family-sans)}:host,*,::before,::after{box-sizing:border-box}*:focus:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}ul{padding:0;margin:0;list-style:none}a{color:var(--gray900);cursor:pointer;text-decoration:none}button{all:unset;cursor:pointer}:host nav{width:100%}.shadow-wrapper{position:relative;z-index:1;display:flex;width:100%}.shadow-wrapper::after{position:absolute;top:0;right:0;width:100%;height:100%;background:transparent;box-shadow:var(--shadow-1);content:'';pointer-events:none}.width-limiter{position:relative;display:flex;width:100%;max-width:var(--zanit-menubar-max-width, 1366px);margin:0 auto}.shadow-wrapper+.shadow-wrapper{z-index:0}.sub-menubar>ul{gap:28px}.width-limiter>ul,.sub-menubar>ul{position:relative;z-index:3;display:flex;width:100%;align-items:center;padding:0 var(--grid-margin);margin-right:auto;margin-left:auto;gap:20px}.shadow-wrapper>.width-limiter,.shadow-wrapper>ul{width:100%;max-width:var(--zanit-menubar-max-width, 1366px)}ul.menubar{padding-right:0;height:3rem}.menubar z-ghost-loading{display:block;width:120px;height:1.25rem}.menubar>li[role='separator']{width:1px;height:1.25rem;background-color:#000}.menubar-item{position:relative;display:flex;align-items:center;padding:14px 0;font-size:1rem;gap:8px;line-height:1.25rem}.menubar .menubar-item{text-transform:uppercase}.menubar-item [data-text]{display:flex;flex-direction:column}.menubar-item.active>[data-text],.menubar-item:hover>[data-text],.menubar-item:focus:focus-visible>[data-text]{font-weight:var(--font-bd)}.menubar-item>[data-text]::after{height:0;content:attr(data-text) / '';font-weight:var(--font-bd);letter-spacing:normal;pointer-events:none;user-select:none;visibility:hidden}.sub-menubar .menubar-item.active::after{position:absolute;z-index:-1;bottom:0;left:-4px;width:calc(100% + 8px);height:4px;background-color:var(--red500);content:''}zanit-search-form{margin-left:auto}";
5
+ const menubarCss = ":host{position:relative;z-index:2;display:flex;width:100%;background-color:#fff;color:var(--gray900);font-family:var(--font-family-sans)}:host,*,::before,::after{box-sizing:border-box}*:focus:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}ul{padding:0;margin:0;list-style:none}a{color:var(--gray900);cursor:pointer;text-decoration:none}button{all:unset;cursor:pointer}:host nav{width:100%}.shadow-wrapper{position:relative;z-index:1;display:flex;width:100%}.shadow-wrapper::after{position:absolute;top:0;right:0;width:100%;height:100%;background:transparent;box-shadow:var(--shadow-1);content:'';pointer-events:none}.width-limiter{position:relative;display:flex;width:100%;max-width:var(--zanit-menubar-max-width, 1366px);margin:0 auto}.shadow-wrapper+.shadow-wrapper{z-index:0}.sub-menubar>ul{gap:28px}.width-limiter>ul,.sub-menubar>ul{position:relative;display:flex;width:100%;align-items:center;padding:0 var(--grid-margin);margin-right:auto;margin-left:auto;gap:20px}.shadow-wrapper>.width-limiter,.shadow-wrapper>ul{width:100%;max-width:var(--zanit-menubar-max-width, 1366px)}ul.menubar{padding-right:0}.menubar z-ghost-loading{display:block;width:120px;height:1.25rem}.menubar>li[role='separator']{width:1px;height:1.25rem;background-color:#000}.menubar-item{position:relative;display:flex;align-items:center;padding:14px 0;font-size:1rem;gap:8px;line-height:1.25rem}.menubar .menubar-item{text-transform:uppercase}.menubar-item [data-text]{display:flex;flex-direction:column}.menubar-item.active>[data-text],.menubar-item:hover>[data-text],.menubar-item:focus:focus-visible>[data-text]{font-weight:var(--font-bd)}.menubar-item>[data-text]::after{height:0;content:attr(data-text) / '';font-weight:var(--font-bd);letter-spacing:normal;pointer-events:none;user-select:none;visibility:hidden}.sub-menubar .menubar-item.active::after{position:absolute;z-index:-1;bottom:0;left:-4px;width:calc(100% + 8px);height:4px;background-color:var(--red500);content:''}zanit-search-form{margin-left:auto}";
6
6
 
7
7
  const menuCss = ".menu-wrapper{width:100%;background-color:#fff}.menu{position:relative;display:flex;width:100%;flex-direction:column;gap:32px 0}.menu .group{display:flex;flex-direction:column}.menu .group .group-name{border-bottom:1px solid currentcolor;margin-bottom:4px;color:var(--red500);font-size:0.875rem;font-weight:var(--font-md)}.menu .group .menu-list{display:flex;flex-direction:column;gap:8px}.menu .group .menu-list .menu-item{display:block;border-bottom:2px solid transparent;font-size:0.875rem;font-weight:var(--font-md)}.menu .menu-list .menu-item.active,.menu .menu-list .menu-item:hover{border-bottom-color:var(--red500)}.menu .group.highlight .menu-list .menu-item{font-size:1rem}@media (width >= 768px){.menu-wrapper{position:absolute;top:100%;left:0;display:flex;justify-content:center;box-shadow:var(--shadow-1)}.menu{display:grid;width:100%;max-width:var(--zanit-menubar-max-width, 1366px);padding:16px var(--grid-margin);gap:0 24px;grid-auto-columns:minmax(0, max-content);grid-auto-flow:column;grid-template-rows:minmax(0, max-content) max-content}.menu .group{display:grid;grid-row:1 / -1;grid-template-columns:1fr;grid-template-rows:subgrid}@supports not (grid-template-rows: subgrid){.menu .group{grid-template-rows:repeat(auto-fit, minmax(0, max-content))}}.menu .group .group-name{border:none;margin-bottom:16px}.menu .group .menu-list .menu-item{font-size:1rem}.menu .group.highlight .menu-list .menu-item{font-size:1.5rem}}";
8
8
 
@@ -29,10 +29,6 @@ const ZanitMenubar$1 = /*@__PURE__*/ proxyCustomElement(class ZanitMenubar exten
29
29
  current = undefined;
30
30
  /** Initial search query. */
31
31
  searchQuery = undefined;
32
- /** Environment for search suggestions */
33
- searchEnv = SearchEnv.PROD;
34
- /** Search area (e.g. "SCUOLA", "UNIVERSITÀ", "DIZIONARI"). */
35
- searchArea;
36
32
  timerId;
37
33
  /** Setup the list of items. */
38
34
  async parseData(data) {
@@ -384,13 +380,13 @@ const ZanitMenubar$1 = /*@__PURE__*/ proxyCustomElement(class ZanitMenubar exten
384
380
  }
385
381
  render() {
386
382
  if (this.isMobile) {
387
- return (h("zanit-mobile-menubar", { items: this.items, currentPath: this.currentPath, searchQuery: this.searchQuery, loading: this.loading, searchArea: this.searchArea, searchEnv: this.searchEnv }));
383
+ return (h("zanit-mobile-menubar", { items: this.items, currentPath: this.currentPath, searchQuery: this.searchQuery, loading: this.loading }));
388
384
  }
389
385
  return (h("nav", { "aria-label": "Zanichelli.it" }, h("div", { class: "shadow-wrapper" }, h("div", { class: "width-limiter" }, h("ul", { class: "menubar", role: "menubar", "aria-label": "Zanichelli.it" }, this.loading &&
390
386
  [...new Array(4)].map((_, index) => (h(Fragment, null, h("li", { role: "none" }, h("div", { class: "menubar-item" }, h("z-ghost-loading", null))), index < 3 && h("li", { role: "separator" })))), this.items?.map((item, index) => (h(Fragment, null, h("li", { role: "none" }, h("a", { class: {
391
387
  'menubar-item': true,
392
388
  'active': this.isActive(item),
393
- }, href: item.href, id: item.id, role: "menuitem", tabIndex: -1, "aria-expanded": item.menuItems?.length ? (this.openMenu === item.id ? 'true' : 'false') : undefined, "aria-haspopup": item.menuItems?.length ? 'true' : 'false', "aria-current": this.current.includes(item.id) ? 'page' : 'false', onPointerOver: () => this.showMenu(item), onKeyDown: (event) => this.handleItemKeydown(event, item), target: item.target }, h("span", { "data-text": item.label }, item.label), item.menuItems?.length > 0 && (h("z-icon", { name: this.openMenu === item.id ? 'chevron-up' : 'chevron-down', width: "0.875rem", height: "0.875rem" })))), index < this.items?.length - 1 && h("li", { role: "separator" }))))), h("zanit-search-form", { searchQuery: this.searchQuery, searchArea: this.searchArea, searchEnv: this.searchEnv, onResetSearch: () => (this.searchQuery = undefined) })), this.items.map((item) => this.openMenu === item.id && (h(Menu, { controlledBy: item.id, items: item.menuItems, currentPath: this.currentPath, onItemKeyDown: (event) => this.handleMenuKeydown(event) })))), this.items
389
+ }, href: item.href, id: item.id, role: "menuitem", tabIndex: -1, "aria-expanded": item.menuItems?.length ? (this.openMenu === item.id ? 'true' : 'false') : undefined, "aria-haspopup": item.menuItems?.length ? 'true' : 'false', "aria-current": this.current.includes(item.id) ? 'page' : 'false', onPointerOver: () => this.showMenu(item), onKeyDown: (event) => this.handleItemKeydown(event, item), target: item.target }, h("span", { "data-text": item.label }, item.label), item.menuItems?.length > 0 && (h("z-icon", { name: this.openMenu === item.id ? 'chevron-up' : 'chevron-down', width: "0.875rem", height: "0.875rem" })))), index < this.items?.length - 1 && h("li", { role: "separator" }))))), h("zanit-search-form", { searchQuery: this.searchQuery, onResetSearch: () => (this.searchQuery = undefined) })), this.items.map((item) => this.openMenu === item.id && (h(Menu, { controlledBy: item.id, items: item.menuItems, currentPath: this.currentPath, onItemKeyDown: (event) => this.handleMenuKeydown(event) })))), this.items
394
390
  ?.filter((item) => this.isActive(item))
395
391
  .map((item) => item.navbarItems?.length && (h("nav", { class: { 'sub-menubar': true, 'shadow-wrapper': true }, "aria-label": `Sezioni: ${item.label}` }, h("ul", { role: "menubar" }, item.navbarItems.map((subitem) => (h(Fragment, null, h("li", { role: "none" }, h("a", { class: {
396
392
  'menubar-item': true,
@@ -408,8 +404,6 @@ const ZanitMenubar$1 = /*@__PURE__*/ proxyCustomElement(class ZanitMenubar exten
408
404
  "data": [1],
409
405
  "current": [1],
410
406
  "searchQuery": [1025, "search-query"],
411
- "searchEnv": [1, "search-env"],
412
- "searchArea": [1, "search-area"],
413
407
  "items": [32],
414
408
  "openMenu": [32],
415
409
  "openNavbar": [32],