@zanichelli/zanichelli-it-frontend-kit 1.4.1 → 1.4.2

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 (94) hide show
  1. package/dist/cjs/{index-BLzQAHAI.js → index-BKkNg6ed.js} +498 -358
  2. package/dist/cjs/index.cjs.js +0 -3
  3. package/dist/cjs/loader.cjs.js +2 -5
  4. package/dist/cjs/zanichelli-it-frontend-kit.cjs.js +3 -6
  5. package/dist/cjs/zanit-back-to-top_4.cjs.entry.js +75 -62
  6. package/dist/collection/collection-manifest.json +3 -2
  7. package/dist/collection/components/back-to-top/back-to-top.js +3 -4
  8. package/dist/collection/components/menubar/menu/menu.js +0 -1
  9. package/dist/collection/components/menubar/menubar.js +12 -11
  10. package/dist/collection/components/menubar/mobile-menubar/mobile-menubar.js +12 -13
  11. package/dist/collection/components/menubar/search-form/search-form.js +14 -12
  12. package/dist/collection/components/menubar/search-form/suggestions.js +0 -1
  13. package/dist/collection/index.js +0 -1
  14. package/dist/collection/utils/index.js +0 -1
  15. package/dist/collection/utils/subjects.api.js +0 -1
  16. package/dist/collection/utils/utils.js +0 -1
  17. package/dist/components/index.d.ts +2 -0
  18. package/dist/components/index.js +1 -1335
  19. package/dist/components/p-BMtMaJq9.js +1 -0
  20. package/dist/components/p-BXeRLfHX.js +1 -0
  21. package/dist/components/zanit-back-to-top.js +1 -88
  22. package/dist/components/zanit-menubar.js +1 -455
  23. package/dist/components/zanit-mobile-menubar.js +1 -9
  24. package/dist/components/zanit-search-form.js +1 -9
  25. package/dist/esm/{index-DSdvvVFj.js → index-CFgcJxsy.js} +498 -358
  26. package/dist/esm/index.js +0 -3
  27. package/dist/esm/loader.js +3 -6
  28. package/dist/esm/zanichelli-it-frontend-kit.js +4 -7
  29. package/dist/esm/zanit-back-to-top_4.entry.js +75 -62
  30. package/dist/types/components/back-to-top/back-to-top.d.ts +2 -1
  31. package/dist/types/components/menubar/menubar.d.ts +2 -1
  32. package/dist/types/components/menubar/mobile-menubar/mobile-menubar.d.ts +2 -1
  33. package/dist/types/components/menubar/search-form/search-form.d.ts +3 -2
  34. package/dist/types/components.d.ts +35 -8
  35. package/dist/types/stencil-public-runtime.d.ts +169 -11
  36. package/dist/zanichelli-it-frontend-kit/index.esm.js +0 -2
  37. package/dist/zanichelli-it-frontend-kit/p-93d8b277.entry.js +1 -0
  38. package/dist/zanichelli-it-frontend-kit/p-CFgcJxsy.js +2 -0
  39. package/dist/zanichelli-it-frontend-kit/zanichelli-it-frontend-kit.esm.js +1 -2
  40. package/package.json +17 -15
  41. package/www/build/index.esm.js +0 -2
  42. package/www/build/p-93d8b277.entry.js +1 -0
  43. package/www/build/p-CFgcJxsy.js +2 -0
  44. package/www/build/p-ec9829f4.js +1 -0
  45. package/www/build/zanichelli-it-frontend-kit.esm.js +1 -2
  46. package/www/index.html +2 -1
  47. package/dist/cjs/index-BLzQAHAI.js.map +0 -1
  48. package/dist/cjs/index.cjs.js.map +0 -1
  49. package/dist/cjs/loader.cjs.js.map +0 -1
  50. package/dist/cjs/zanichelli-it-frontend-kit.cjs.js.map +0 -1
  51. package/dist/cjs/zanit-back-to-top.zanit-menubar.zanit-mobile-menubar.zanit-search-form.entry.cjs.js.map +0 -1
  52. package/dist/cjs/zanit-back-to-top_4.cjs.entry.js.map +0 -1
  53. package/dist/collection/components/back-to-top/back-to-top.js.map +0 -1
  54. package/dist/collection/components/menubar/menu/menu.js.map +0 -1
  55. package/dist/collection/components/menubar/menubar.js.map +0 -1
  56. package/dist/collection/components/menubar/mobile-menubar/mobile-menubar.js.map +0 -1
  57. package/dist/collection/components/menubar/search-form/search-form.js.map +0 -1
  58. package/dist/collection/components/menubar/search-form/suggestions.js.map +0 -1
  59. package/dist/collection/index.js.map +0 -1
  60. package/dist/collection/utils/index.js.map +0 -1
  61. package/dist/collection/utils/subjects.api.js.map +0 -1
  62. package/dist/collection/utils/utils.js.map +0 -1
  63. package/dist/components/index.js.map +0 -1
  64. package/dist/components/p-BlgoYKK3.js +0 -246
  65. package/dist/components/p-BlgoYKK3.js.map +0 -1
  66. package/dist/components/p-DqMqkNnl.js +0 -386
  67. package/dist/components/p-DqMqkNnl.js.map +0 -1
  68. package/dist/components/zanit-back-to-top.js.map +0 -1
  69. package/dist/components/zanit-menubar.js.map +0 -1
  70. package/dist/components/zanit-mobile-menubar.js.map +0 -1
  71. package/dist/components/zanit-search-form.js.map +0 -1
  72. package/dist/esm/index-DSdvvVFj.js.map +0 -1
  73. package/dist/esm/index.js.map +0 -1
  74. package/dist/esm/loader.js.map +0 -1
  75. package/dist/esm/zanichelli-it-frontend-kit.js.map +0 -1
  76. package/dist/esm/zanit-back-to-top.zanit-menubar.zanit-mobile-menubar.zanit-search-form.entry.js.map +0 -1
  77. package/dist/esm/zanit-back-to-top_4.entry.js.map +0 -1
  78. package/dist/zanichelli-it-frontend-kit/index.esm.js.map +0 -1
  79. package/dist/zanichelli-it-frontend-kit/loader.esm.js.map +0 -1
  80. package/dist/zanichelli-it-frontend-kit/p-62cc02c2.entry.js +0 -2
  81. package/dist/zanichelli-it-frontend-kit/p-62cc02c2.entry.js.map +0 -1
  82. package/dist/zanichelli-it-frontend-kit/p-DSdvvVFj.js +0 -3
  83. package/dist/zanichelli-it-frontend-kit/p-DSdvvVFj.js.map +0 -1
  84. package/dist/zanichelli-it-frontend-kit/zanichelli-it-frontend-kit.esm.js.map +0 -1
  85. package/dist/zanichelli-it-frontend-kit/zanit-back-to-top.zanit-menubar.zanit-mobile-menubar.zanit-search-form.entry.esm.js.map +0 -1
  86. package/www/build/index.esm.js.map +0 -1
  87. package/www/build/loader.esm.js.map +0 -1
  88. package/www/build/p-62cc02c2.entry.js +0 -2
  89. package/www/build/p-62cc02c2.entry.js.map +0 -1
  90. package/www/build/p-DSdvvVFj.js +0 -3
  91. package/www/build/p-DSdvvVFj.js.map +0 -1
  92. package/www/build/p-fe3aec03.js +0 -2
  93. package/www/build/zanichelli-it-frontend-kit.esm.js.map +0 -1
  94. package/www/build/zanit-back-to-top.zanit-menubar.zanit-mobile-menubar.zanit-search-form.entry.esm.js.map +0 -1
package/dist/esm/index.js CHANGED
@@ -1,4 +1 @@
1
1
 
2
- //# sourceMappingURL=index.js.map
3
-
4
- //# sourceMappingURL=index.js.map
@@ -1,13 +1,10 @@
1
- import { g as globalScripts, b as bootstrapLazy } from './index-DSdvvVFj.js';
2
- export { s as setNonce } from './index-DSdvvVFj.js';
1
+ import { g as globalScripts, b as bootstrapLazy } from './index-CFgcJxsy.js';
2
+ export { s as setNonce } from './index-CFgcJxsy.js';
3
3
 
4
4
  const defineCustomElements = async (win, options) => {
5
5
  if (typeof window === 'undefined') return undefined;
6
6
  await globalScripts();
7
- return bootstrapLazy([["zanit-back-to-top_4",[[17,"zanit-menubar",{"data":[1],"current":[1],"searchQuery":[1025,"search-query"],"searchEnv":[1,"search-env"],"searchArea":[1,"search-area"],"items":[32],"openMenu":[32],"openNavbar":[32],"currentPath":[32],"isMobile":[32],"loading":[32]},[[5,"click","handleOutsideClick"],[5,"keydown","handleKeydown"],[1,"mouseover","handleMouseover"],[1,"mouseout","handleMouseout"],[1,"focusout","handleFocusout"]],{"data":["parseData"],"items":["onItemsChange"],"current":["onCurrentChange"]}],[2,"zanit-back-to-top",{"pageMinHeight":[2,"page-min-height"],"scrollMinHeight":[2,"scroll-min-height"],"showFab":[32],"currentPageHeight":[32],"isMobile":[32]},[[9,"scroll","handleScroll"]]],[17,"zanit-mobile-menubar",{"currentPath":[16,"current-path"],"items":[16],"searchQuery":[1025,"search-query"],"loading":[4],"searchEnv":[1,"search-env"],"searchArea":[1,"search-area"],"lastCurrent":[32],"parentItem":[32],"menuItems":[32],"menuType":[32],"open":[32]},[[5,"click","handleOutsideClick"],[1,"keydown","handleKeydown"],[5,"focusin","handleFocusout"]],{"items":["onItemsChange"],"currentPath":["onItemsChange"]}],[1,"zanit-search-form",{"searchQuery":[1025,"search-query"],"searchEnv":[1,"search-env"],"searchArea":[1,"search-area"],"showSearchbar":[32],"_searchQuery":[32],"suggestions":[32],"activeSuggestion":[32],"showSuggestions":[32]},[[5,"click","handleOutsideClick"],[1,"keydown","handleEsc"],[5,"keyup","handleTab"]],{"searchQuery":["onSearchQueryChange"],"searchArea":["onSearchAreaChange"],"showSearchbar":["onShowSearchbarChange"],"showSuggestions":["onShowSuggestionsChange"]}]]]], options);
7
+ return bootstrapLazy([["zanit-back-to-top_4",[[529,"zanit-menubar",{"data":[1],"current":[1],"searchQuery":[1025,"search-query"],"searchEnv":[1,"search-env"],"searchArea":[1,"search-area"],"items":[32],"openMenu":[32],"openNavbar":[32],"currentPath":[32],"isMobile":[32],"loading":[32]},[[5,"click","handleOutsideClick"],[5,"keydown","handleKeydown"],[1,"mouseover","handleMouseover"],[1,"mouseout","handleMouseout"],[1,"focusout","handleFocusout"]],{"data":[{"parseData":0}],"items":[{"onItemsChange":0}],"current":[{"onCurrentChange":0}]}],[514,"zanit-back-to-top",{"pageMinHeight":[2,"page-min-height"],"scrollMinHeight":[2,"scroll-min-height"],"showFab":[32],"currentPageHeight":[32],"isMobile":[32]},[[9,"scroll","handleScroll"]]],[529,"zanit-mobile-menubar",{"currentPath":[16],"items":[16],"searchQuery":[1025,"search-query"],"loading":[4],"searchEnv":[1,"search-env"],"searchArea":[1,"search-area"],"lastCurrent":[32],"parentItem":[32],"menuItems":[32],"menuType":[32],"open":[32]},[[5,"click","handleOutsideClick"],[1,"keydown","handleKeydown"],[5,"focusin","handleFocusout"]],{"items":[{"onItemsChange":0}],"currentPath":[{"onItemsChange":0}]}],[513,"zanit-search-form",{"searchQuery":[1025,"search-query"],"searchEnv":[1,"search-env"],"searchArea":[1,"search-area"],"showSearchbar":[32],"_searchQuery":[32],"suggestions":[32],"activeSuggestion":[32],"showSuggestions":[32]},[[5,"mousedown","handleOutsideClick"],[1,"keydown","handleEsc"],[5,"keyup","handleTab"]],{"searchQuery":[{"onSearchQueryChange":0}],"searchArea":[{"onSearchAreaChange":0}],"showSearchbar":[{"onShowSearchbarChange":0}],"showSuggestions":[{"onShowSuggestionsChange":0}]}]]]], options);
8
8
  };
9
9
 
10
10
  export { defineCustomElements };
11
- //# sourceMappingURL=loader.js.map
12
-
13
- //# sourceMappingURL=loader.js.map
@@ -1,8 +1,8 @@
1
- import { p as promiseResolve, g as globalScripts, b as bootstrapLazy } from './index-DSdvvVFj.js';
2
- export { s as setNonce } from './index-DSdvvVFj.js';
1
+ import { p as promiseResolve, g as globalScripts, b as bootstrapLazy } from './index-CFgcJxsy.js';
2
+ export { s as setNonce } from './index-CFgcJxsy.js';
3
3
 
4
4
  /*
5
- Stencil Client Patch Browser v4.33.1 | MIT Licensed | https://stenciljs.com
5
+ Stencil Client Patch Browser v4.43.4 | MIT Licensed | https://stenciljs.com
6
6
  */
7
7
 
8
8
  var patchBrowser = () => {
@@ -16,8 +16,5 @@ var patchBrowser = () => {
16
16
 
17
17
  patchBrowser().then(async (options) => {
18
18
  await globalScripts();
19
- return bootstrapLazy([["zanit-back-to-top_4",[[17,"zanit-menubar",{"data":[1],"current":[1],"searchQuery":[1025,"search-query"],"searchEnv":[1,"search-env"],"searchArea":[1,"search-area"],"items":[32],"openMenu":[32],"openNavbar":[32],"currentPath":[32],"isMobile":[32],"loading":[32]},[[5,"click","handleOutsideClick"],[5,"keydown","handleKeydown"],[1,"mouseover","handleMouseover"],[1,"mouseout","handleMouseout"],[1,"focusout","handleFocusout"]],{"data":["parseData"],"items":["onItemsChange"],"current":["onCurrentChange"]}],[2,"zanit-back-to-top",{"pageMinHeight":[2,"page-min-height"],"scrollMinHeight":[2,"scroll-min-height"],"showFab":[32],"currentPageHeight":[32],"isMobile":[32]},[[9,"scroll","handleScroll"]]],[17,"zanit-mobile-menubar",{"currentPath":[16,"current-path"],"items":[16],"searchQuery":[1025,"search-query"],"loading":[4],"searchEnv":[1,"search-env"],"searchArea":[1,"search-area"],"lastCurrent":[32],"parentItem":[32],"menuItems":[32],"menuType":[32],"open":[32]},[[5,"click","handleOutsideClick"],[1,"keydown","handleKeydown"],[5,"focusin","handleFocusout"]],{"items":["onItemsChange"],"currentPath":["onItemsChange"]}],[1,"zanit-search-form",{"searchQuery":[1025,"search-query"],"searchEnv":[1,"search-env"],"searchArea":[1,"search-area"],"showSearchbar":[32],"_searchQuery":[32],"suggestions":[32],"activeSuggestion":[32],"showSuggestions":[32]},[[5,"click","handleOutsideClick"],[1,"keydown","handleEsc"],[5,"keyup","handleTab"]],{"searchQuery":["onSearchQueryChange"],"searchArea":["onSearchAreaChange"],"showSearchbar":["onShowSearchbarChange"],"showSuggestions":["onShowSuggestionsChange"]}]]]], options);
19
+ return bootstrapLazy([["zanit-back-to-top_4",[[529,"zanit-menubar",{"data":[1],"current":[1],"searchQuery":[1025,"search-query"],"searchEnv":[1,"search-env"],"searchArea":[1,"search-area"],"items":[32],"openMenu":[32],"openNavbar":[32],"currentPath":[32],"isMobile":[32],"loading":[32]},[[5,"click","handleOutsideClick"],[5,"keydown","handleKeydown"],[1,"mouseover","handleMouseover"],[1,"mouseout","handleMouseout"],[1,"focusout","handleFocusout"]],{"data":[{"parseData":0}],"items":[{"onItemsChange":0}],"current":[{"onCurrentChange":0}]}],[514,"zanit-back-to-top",{"pageMinHeight":[2,"page-min-height"],"scrollMinHeight":[2,"scroll-min-height"],"showFab":[32],"currentPageHeight":[32],"isMobile":[32]},[[9,"scroll","handleScroll"]]],[529,"zanit-mobile-menubar",{"currentPath":[16],"items":[16],"searchQuery":[1025,"search-query"],"loading":[4],"searchEnv":[1,"search-env"],"searchArea":[1,"search-area"],"lastCurrent":[32],"parentItem":[32],"menuItems":[32],"menuType":[32],"open":[32]},[[5,"click","handleOutsideClick"],[1,"keydown","handleKeydown"],[5,"focusin","handleFocusout"]],{"items":[{"onItemsChange":0}],"currentPath":[{"onItemsChange":0}]}],[513,"zanit-search-form",{"searchQuery":[1025,"search-query"],"searchEnv":[1,"search-env"],"searchArea":[1,"search-area"],"showSearchbar":[32],"_searchQuery":[32],"suggestions":[32],"activeSuggestion":[32],"showSuggestions":[32]},[[5,"mousedown","handleOutsideClick"],[1,"keydown","handleEsc"],[5,"keyup","handleTab"]],{"searchQuery":[{"onSearchQueryChange":0}],"searchArea":[{"onSearchAreaChange":0}],"showSearchbar":[{"onShowSearchbarChange":0}],"showSuggestions":[{"onShowSuggestionsChange":0}]}]]]], options);
20
20
  });
21
- //# sourceMappingURL=zanichelli-it-frontend-kit.js.map
22
-
23
- //# sourceMappingURL=zanichelli-it-frontend-kit.js.map
@@ -1,6 +1,6 @@
1
- import { r as registerInstance, a as getElement, h, H as Host, F as Fragment, c as createEvent } from './index-DSdvvVFj.js';
1
+ import { r as registerInstance, a as getElement, h, H as Host, F as Fragment, c as createEvent } from './index-CFgcJxsy.js';
2
2
 
3
- const backToTopCss = ".sc-zanit-back-to-top-h{opacity:1;transition:all 0.2s linear;visibility:visible}.hidden.sc-zanit-back-to-top-h{opacity:0;visibility:hidden}.sc-zanit-back-to-top-h .z-fab.sc-zanit-back-to-top{--color-primary01:var(--gray950);outline:1px solid var(--color-white)}";
3
+ const backToTopCss = () => `.sc-zanit-back-to-top-h{opacity:1;transition:all 0.2s linear;visibility:visible}.hidden.sc-zanit-back-to-top-h{opacity:0;visibility:hidden}.sc-zanit-back-to-top-h .z-fab.sc-zanit-back-to-top{--color-primary01:var(--gray950);outline:1px solid var(--color-white)}`;
4
4
 
5
5
  const ZanitBackTop = class {
6
6
  constructor(hostRef) {
@@ -53,10 +53,10 @@ const ZanitBackTop = class {
53
53
  window.scrollTo({ top: 0, behavior: 'smooth' });
54
54
  }
55
55
  render() {
56
- return (h(Host, { key: '3abd8ab70075d8042285d8ed6fab0729c4b5ec42', class: { hidden: !this.showFab }, "aria-hidden": this.showFab ? 'false' : 'true' }, h("button", { key: '11b149d5f1d75720d4bdd329e9897da782092ed1', class: { 'z-fab': true, 'z-fab-extended': !this.isMobile }, onClick: () => this.scroll() }, h("z-icon", { key: 'fbdff1419da6d20ab594ffd11c58d7bf25fb7aa6', name: "back-top" }), h("span", { key: '0292f761b5459c372f003ed514abbd3403570c75' }, "Torna su"))));
56
+ return (h(Host, { key: '8db557141277e71d6d2fdaad2e525df03fb78461', class: { hidden: !this.showFab }, "aria-hidden": this.showFab ? 'false' : 'true' }, h("button", { key: 'e9a1cfcc75c39e6a5d657712306e331bbfabbcf9', class: { 'z-fab': true, 'z-fab-extended': !this.isMobile }, onClick: () => this.scroll() }, h("z-icon", { key: 'c83accba15ee2efbbef5f17cdbb92c57f7aee0a0', name: "back-top" }), h("span", { key: '59167788a06ac2b45b4e91c944c0fefd1dc79780' }, "Torna su"))));
57
57
  }
58
58
  };
59
- ZanitBackTop.style = backToTopCss;
59
+ ZanitBackTop.style = backToTopCss();
60
60
 
61
61
  /**
62
62
  * Check if an element contains an event target by checking its composedPath.
@@ -83,6 +83,31 @@ const isTabKey = (event) => event.key === 'Tab';
83
83
  /** Check if event key is Escape */
84
84
  const isEscKey = (event) => event.key === 'Escape';
85
85
 
86
+ var SearchEnv;
87
+ (function (SearchEnv) {
88
+ SearchEnv["DEV"] = "dev";
89
+ SearchEnv["TEST"] = "test";
90
+ SearchEnv["PROD"] = "prod";
91
+ })(SearchEnv || (SearchEnv = {}));
92
+ const S3_SHOP_URL = {
93
+ dev: 'https://zanichelli-shop-dev.s3.eu-west-1.amazonaws.com',
94
+ test: 'https://zanichelli-shop-test.s3.eu-west-1.amazonaws.com',
95
+ prod: 'https://zanichelli-shop.s3.eu-west-1.amazonaws.com',
96
+ };
97
+ async function getSubjectsByArea(searchEnv) {
98
+ try {
99
+ const response = await fetch(`${S3_SHOP_URL[searchEnv]}/categories.json`);
100
+ if (!response.ok) {
101
+ throw new Error(`HTTP ${response.status}`);
102
+ }
103
+ return await response.json();
104
+ }
105
+ catch (err) {
106
+ console.error('Error fetching subjects:', err);
107
+ return {};
108
+ }
109
+ }
110
+
86
111
  const DEFAULT_GROUP_KEY = 'default';
87
112
  const DEFAULT_GROUP = {
88
113
  id: DEFAULT_GROUP_KEY,
@@ -112,45 +137,17 @@ const Menu = ({ controlledBy, items, currentPath = [], onItemKeyDown }) => {
112
137
  }
113
138
  const groups = getGroupedItems(items);
114
139
  const isActive = (item) => currentPath.includes(controlledBy) && currentPath.includes(item.id);
115
- return (h("div", { class: "menu-wrapper", role: "none" },
116
- h("div", { class: "menu", "aria-labelledby": controlledBy ?? undefined, role: "menu" }, groups.map(({ group, items }) => (h("div", { class: { group: true, highlight: items.some((item) => item.highlight) } },
117
- group.id !== DEFAULT_GROUP_KEY ? (h("div", { class: "group-name", id: group.id }, group.label)) : groups.length > 1 ? (
118
- // empty div to keep the same height as the other groups
119
- h("div", { class: "group-name" })) : null,
120
- h("ul", { class: "menu-list", role: "group", "aria-labelledby": group.id !== DEFAULT_GROUP_KEY ? group.id : undefined }, items.map((item) => (h("li", { role: "none" }, item.href && (h("a", { class: {
121
- 'menu-item': true,
122
- 'active': isActive(item),
123
- }, href: item.href, role: "menuitem", tabIndex: -1, "aria-current": isActive(item) ? 'page' : 'false', onKeyDown: (event) => onItemKeyDown(event), target: item.target }, item.label))))))))))));
140
+ return (h("div", { class: "menu-wrapper", role: "none" }, h("div", { class: "menu", "aria-labelledby": controlledBy ?? undefined, role: "menu" }, groups.map(({ group, items }) => (h("div", { class: { group: true, highlight: items.some((item) => item.highlight) } }, group.id !== DEFAULT_GROUP_KEY ? (h("div", { class: "group-name", id: group.id }, group.label)) : groups.length > 1 ? (
141
+ // empty div to keep the same height as the other groups
142
+ h("div", { class: "group-name" })) : null, h("ul", { class: "menu-list", role: "group", "aria-labelledby": group.id !== DEFAULT_GROUP_KEY ? group.id : undefined }, items.map((item) => (h("li", { role: "none" }, item.href && (h("a", { class: {
143
+ 'menu-item': true,
144
+ 'active': isActive(item),
145
+ }, href: item.href, role: "menuitem", tabIndex: -1, "aria-current": isActive(item) ? 'page' : 'false', onKeyDown: (event) => onItemKeyDown(event), target: item.target }, item.label))))))))))));
124
146
  };
125
147
 
126
- var SearchEnv;
127
- (function (SearchEnv) {
128
- SearchEnv["DEV"] = "dev";
129
- SearchEnv["TEST"] = "test";
130
- SearchEnv["PROD"] = "prod";
131
- })(SearchEnv || (SearchEnv = {}));
132
- const S3_SHOP_URL = {
133
- dev: 'https://zanichelli-shop-dev.s3.eu-west-1.amazonaws.com',
134
- test: 'https://zanichelli-shop-test.s3.eu-west-1.amazonaws.com',
135
- prod: 'https://zanichelli-shop.s3.eu-west-1.amazonaws.com',
136
- };
137
- async function getSubjectsByArea(searchEnv) {
138
- try {
139
- const response = await fetch(`${S3_SHOP_URL[searchEnv]}/categories.json`);
140
- if (!response.ok) {
141
- throw new Error(`HTTP ${response.status}`);
142
- }
143
- return await response.json();
144
- }
145
- catch (err) {
146
- console.error('Error fetching subjects:', err);
147
- return {};
148
- }
149
- }
150
-
151
- 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{height:3rem;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}";
148
+ 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{height:3rem;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}`;
152
149
 
153
- const menuCss$1 = ".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}}";
150
+ const menuCss$1 = () => `.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}}`;
154
151
 
155
152
  const ZanitMenubar = class {
156
153
  constructor(hostRef) {
@@ -543,16 +540,22 @@ const ZanitMenubar = class {
543
540
  }
544
541
  static get delegatesFocus() { return true; }
545
542
  static get watchers() { return {
546
- "data": ["parseData"],
547
- "items": ["onItemsChange"],
548
- "current": ["onCurrentChange"]
543
+ "data": [{
544
+ "parseData": 0
545
+ }],
546
+ "items": [{
547
+ "onItemsChange": 0
548
+ }],
549
+ "current": [{
550
+ "onCurrentChange": 0
551
+ }]
549
552
  }; }
550
553
  };
551
- ZanitMenubar.style = menubarCss + menuCss$1;
554
+ ZanitMenubar.style = menubarCss() + menuCss$1();
552
555
 
553
- 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}";
556
+ 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}`;
554
557
 
555
- 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}}";
558
+ 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}}`;
556
559
 
557
560
  const ZanitMobileMenubar = class {
558
561
  constructor(hostRef) {
@@ -577,7 +580,7 @@ const ZanitMobileMenubar = class {
577
580
  menuItems = undefined;
578
581
  /** Whether the items to render come from a menubar or a menu. */
579
582
  menuType = undefined;
580
- open;
583
+ open = false;
581
584
  onItemsChange() {
582
585
  this.lastCurrent = this.currentPath?.length ? this.currentPath[this.currentPath.length - 1] : undefined;
583
586
  this.setupData(this.items);
@@ -700,18 +703,22 @@ const ZanitMobileMenubar = class {
700
703
  this.open = false;
701
704
  }
702
705
  render() {
703
- return (h("nav", { key: '76079ce1e66f1b568f6e7eac1f67b91af0f2f48a', "aria-label": "Zanichelli.it" }, h("button", { key: '630b16be60aba3d7027fbe4b9e19e440cb454267', 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: '4c86d84d421ab93fb1c815c5a667dd55ce8254ac', name: this.open ? 'multiply' : 'burger-menu', width: "1.5rem", height: "1.5rem" })), h("z-logo", { key: '03c7b8613698098cf3a1ff4b1b8d649cb7d5b92a', imageAlt: "Logo Zanichelli", link: "/", height: 32, width: 126 }), h("zanit-search-form", { key: '5a1385991eebcf17ac8c275c8c69f6662f75e3b7', searchQuery: this.searchQuery, onResetSearch: () => (this.searchQuery = undefined), searchArea: this.searchArea, searchEnv: this.searchEnv }), this.open && (h("ul", { key: 'bc627e55f902beaac658f02d90ed78836fde193b', class: "mobile-menu", role: "menubar" }, !this.loading && this.currentPath && this.currentPath.length > 0 && (h("li", { key: '4708f9ee160d62a6cbf6333e11c1b9d02ae3d34c', role: "none" }, h("a", { key: '9fd59125f8cb87f6c86108eea7ba79a04bc4d68c', 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: '615bc59a1f058a745bdadd90c6f51f9abc757df1', name: "arrow-left", width: "0.5rem", height: "0.5rem" }), h("span", { key: '66a80691639e97b2d7d7d61cc45f8b47dcdabafe' }, 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: {
706
+ return (h("nav", { key: 'e3c4f8212d54b84206c2d40c9670263dd0f2460a', "aria-label": "Zanichelli.it" }, h("button", { key: '8f4600dbb2c530e5901127d556eee94dcd60947a', 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: 'aa3d06cca2f2c7e92cb4afb37a5085ea37ec8283', name: this.open ? 'multiply' : 'burger-menu', width: "1.5rem", height: "1.5rem" })), h("z-logo", { key: 'af3724fc7f330c7b2f7d826bd0dd2edc2dbb5742', imageAlt: "Logo Zanichelli", link: "/", height: 32, width: 126 }), h("zanit-search-form", { key: 'cc3c8e2ece6ac0428864d8affcd567c9a1272824', searchQuery: this.searchQuery, onResetSearch: () => (this.searchQuery = undefined), searchArea: this.searchArea, searchEnv: this.searchEnv }), this.open && (h("ul", { key: '0c35b0f4869ae076a1c02f07f1b19e787f4c3780', class: "mobile-menu", role: "menubar" }, !this.loading && this.currentPath && this.currentPath.length > 0 && (h("li", { key: 'ff8e9d8871ebea21ba178d1ba9d295d26b018be2', role: "none" }, h("a", { key: '4afb5ccda0e206f640f429ecfe7ac1e3491a475d', 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: '2db8da21ad88b937d591eac551a3599704e13147', name: "arrow-left", width: "0.5rem", height: "0.5rem" }), h("span", { key: 'd285244285ccee5e76db049cb4fba1dd591d7ce1' }, 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: {
704
707
  'menu-item': this.menuType === 'menu',
705
708
  'menubar-item': this.menuType === 'menubar',
706
709
  }, 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))))))))))));
707
710
  }
708
711
  static get delegatesFocus() { return true; }
709
712
  static get watchers() { return {
710
- "items": ["onItemsChange"],
711
- "currentPath": ["onItemsChange"]
713
+ "items": [{
714
+ "onItemsChange": 0
715
+ }],
716
+ "currentPath": [{
717
+ "onItemsChange": 0
718
+ }]
712
719
  }; }
713
720
  };
714
- ZanitMobileMenubar.style = mobileMenubarCss + menuCss;
721
+ ZanitMobileMenubar.style = mobileMenubarCss() + menuCss();
715
722
 
716
723
  var AREA_LABELS;
717
724
  (function (AREA_LABELS) {
@@ -798,7 +805,7 @@ const getAreaOrder = (area) => {
798
805
  return index >= 0 ? index : 100;
799
806
  };
800
807
 
801
- 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;z-index:5;top:0;right:0;display:flex;width:var(--closed-searchbar-width);height:3rem;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)}.suggestions-wrapper{position:absolute;z-index:4;top:3rem;left:50%;width:100vw;border-top:1px solid var(--gray200);margin-left:-50vw;background:#fff;box-shadow:var(--shadow-1)}.suggestions-wrapper.hidden{display:none}.suggestions{display:flex;width:100%;flex-direction:column;align-items:stretch;padding:var(--space-unit);margin:0 auto}.suggestion-head{padding:calc(var(--space-unit) * 0.75) var(--space-unit);color:var(--gray700);font-size:0.875rem;font-weight:var(--font-md);line-height:1.125rem}.suggestion{display:flex;padding:calc(var(--space-unit) * 0.75) var(--space-unit);color:var(--gray900);cursor:pointer;font-size:1rem;gap:var(--space-unit);line-height:1.5rem}.suggestion:hover,.suggestion[aria-selected='true']{background:var(--gray100)}.suggestion strong{font-weight:var(--font-bd)}.suggestion mark{background-color:var(--red50)}.suggestion z-icon{--z-icon-height:1.125rem;margin-top:0.125rem}.suggestions z-divider{margin:var(--space-unit) 0}@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)}.suggestions{padding:var(--space-unit) calc(var(--space-unit) * 2)}}@media (width >= 1152px){.searchbar{--closed-searchbar-width:190px}}@media (width >= 1366px){.searchbar .searchbar-button{border-right:1px solid #000}.suggestions{max-width:1366px;padding:var(--space-unit) calc(var(--space-unit) * 3)}}";
808
+ 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;z-index:5;top:0;right:0;display:flex;width:var(--closed-searchbar-width);height:3rem;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)}.suggestions-wrapper{position:absolute;z-index:4;top:3rem;left:50%;width:100vw;border-top:1px solid var(--gray200);margin-left:-50vw;background:#fff;box-shadow:var(--shadow-1)}.suggestions-wrapper.hidden{display:none}.suggestions{display:flex;width:100%;flex-direction:column;align-items:stretch;padding:var(--space-unit);margin:0 auto}.suggestion-head{padding:calc(var(--space-unit) * 0.75) var(--space-unit);color:var(--gray700);font-size:0.875rem;font-weight:var(--font-md);line-height:1.125rem}.suggestion{display:flex;padding:calc(var(--space-unit) * 0.75) var(--space-unit);color:var(--gray900);cursor:pointer;font-size:1rem;gap:var(--space-unit);line-height:1.5rem}.suggestion:hover,.suggestion[aria-selected='true']{background:var(--gray100)}.suggestion strong{font-weight:var(--font-bd)}.suggestion mark{background-color:var(--red50)}.suggestion z-icon{--z-icon-height:1.125rem;margin-top:0.125rem}.suggestions z-divider{margin:var(--space-unit) 0}@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)}.suggestions{padding:var(--space-unit) calc(var(--space-unit) * 2)}}@media (width >= 1152px){.searchbar{--closed-searchbar-width:190px}}@media (width >= 1366px){.searchbar .searchbar-button{border-right:1px solid #000}.suggestions{max-width:1366px;padding:var(--space-unit) calc(var(--space-unit) * 3)}}`;
802
809
 
803
810
  const ZanitSearchForm = class {
804
811
  constructor(hostRef) {
@@ -846,6 +853,7 @@ const ZanitSearchForm = class {
846
853
  }
847
854
  /** Emitted on search form submission. */
848
855
  search;
856
+ /** Emitted when the search query is reset by the user (e.g. by clicking the reset button). */
849
857
  resetSearch;
850
858
  async connectedCallback() {
851
859
  this.subjectsByArea = await getSubjectsByArea(this.searchEnv);
@@ -996,24 +1004,29 @@ const ZanitSearchForm = class {
996
1004
  }))));
997
1005
  }
998
1006
  render() {
999
- return (h(Host, { key: '9535c68b8cd3e76a55785cb993bed5026f84a589' }, h("form", { key: '26271b8f9034b3ea64bbea6ff413e75d0e857612', 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() }, !!this.searchArea && (h("input", { key: '90e9dc4252a02a00db5160d374bd4ea42c4dce17', type: "hidden", name: "area", value: this.searchArea })), h("div", { key: '6189f91f8cbf9086c1dcddac5a1b649065d4319c', class: "input-wrapper", role: "none" }, this.searchQuery && (h("button", { key: '6292dc5e90576b49993ed15d908c675b501568d9', 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: '67f07f13b459afad718d2687f5feea4271d6ec6a', name: "multiply-circled" }))), h("input", { key: 'ee4f88993f3bf1ba768eaf1b6ff63cd346bd552e', id: "searchbar-input", name: "q", type: "search", disabled: !this.showSearchbar, placeholder: "Cerca per parola chiave o ISBN", value: this.searchQuery, required: true, autocomplete: "off", role: "combobox", "aria-autocomplete": "list", "aria-expanded": this.showSuggestions ? 'true' : 'false', "aria-controls": "search-suggestions", "aria-activedescendant": this.activeSuggestion, "aria-label": "Cerca per parola chiave o ISBN", "aria-hidden": !this.showSearchbar ? 'true' : undefined, tabIndex: !this.showSearchbar ? -1 : 0, onInput: (event) => this.handleInputChange(event), onKeyDown: (e) => {
1007
+ return (h(Host, { key: 'c87ecbcbff0205ddb35fb96bbfbcca6bb7ac8802' }, h("form", { key: '77f2951f88ae0361897161688f3a9875d555b20c', 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() }, !!this.searchArea && (h("input", { key: '3cf0dceef1acc58c3c0e637f974db6c7587be081', type: "hidden", name: "area", value: this.searchArea })), h("div", { key: 'd797f9832f29b723010ca486298f0c4a4aabe3ee', class: "input-wrapper", role: "none" }, this.searchQuery && (h("button", { key: '2d5971957d84e83120fc96f49e359635e3792104', 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: '7027abe8c6a2211433048041a4ef2a5e273ca226', name: "multiply-circled" }))), h("input", { key: '2184d3fa615d94bf3615606a4624abdbb81cb2ae', id: "searchbar-input", name: "q", type: "search", disabled: !this.showSearchbar, placeholder: "Cerca per parola chiave o ISBN", value: this.searchQuery, required: true, autocomplete: "off", role: "combobox", "aria-autocomplete": "list", "aria-expanded": this.showSuggestions ? 'true' : 'false', "aria-controls": "search-suggestions", "aria-activedescendant": this.activeSuggestion, "aria-label": "Cerca per parola chiave o ISBN", "aria-hidden": !this.showSearchbar ? 'true' : undefined, tabIndex: !this.showSearchbar ? -1 : 0, onInput: (event) => this.handleInputChange(event), onKeyDown: (e) => {
1000
1008
  // INFO: prevent ESC from clearing input
1001
1009
  if (isEscKey(e)) {
1002
1010
  e.preventDefault();
1003
1011
  }
1004
1012
  this.handleSuggestionsNav(e);
1005
- } })), h("button", { key: '4e0feaeaff7bcecaf6a29409a6accac895810fdf', 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: '49eec7e6f04c34df57fcf99f405d1c3ada1fcdfb', name: "search" }))), this.renderSuggestions()));
1013
+ } })), h("button", { key: '06a7ad6e3e4c74f2dd3bd56fb6f2da006c8d59c0', 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: '72e66f0280f0b835e760c1631076b71fa5dc03fa', name: "search" }))), this.renderSuggestions()));
1006
1014
  }
1007
1015
  static get watchers() { return {
1008
- "searchQuery": ["onSearchQueryChange"],
1009
- "searchArea": ["onSearchAreaChange"],
1010
- "showSearchbar": ["onShowSearchbarChange"],
1011
- "showSuggestions": ["onShowSuggestionsChange"]
1016
+ "searchQuery": [{
1017
+ "onSearchQueryChange": 0
1018
+ }],
1019
+ "searchArea": [{
1020
+ "onSearchAreaChange": 0
1021
+ }],
1022
+ "showSearchbar": [{
1023
+ "onShowSearchbarChange": 0
1024
+ }],
1025
+ "showSuggestions": [{
1026
+ "onShowSuggestionsChange": 0
1027
+ }]
1012
1028
  }; }
1013
1029
  };
1014
- ZanitSearchForm.style = searchFormCss;
1030
+ ZanitSearchForm.style = searchFormCss();
1015
1031
 
1016
1032
  export { ZanitBackTop as zanit_back_to_top, ZanitMenubar as zanit_menubar, ZanitMobileMenubar as zanit_mobile_menubar, ZanitSearchForm as zanit_search_form };
1017
- //# sourceMappingURL=zanit-back-to-top.zanit-menubar.zanit-mobile-menubar.zanit-search-form.entry.js.map
1018
-
1019
- //# sourceMappingURL=zanit-back-to-top_4.entry.js.map
@@ -1,8 +1,9 @@
1
+ import { ComponentInterface } from '../../stencil-public-runtime';
1
2
  /**
2
3
  * Back to top floating action button component.
3
4
  * Appears on scroll, given a min height for both scroll height and page height.
4
5
  */
5
- export declare class ZanitBackTop {
6
+ export declare class ZanitBackTop implements ComponentInterface {
6
7
  private resizeObserver;
7
8
  private mutationObserver;
8
9
  host: HTMLZanitBackToTopElement;
@@ -1,3 +1,4 @@
1
+ import { ComponentInterface } from '../../stencil-public-runtime';
1
2
  import { MenubarItem } from '../../utils';
2
3
  import { SearchEnv } from '../../utils/subjects.api';
3
4
  /**
@@ -5,7 +6,7 @@ import { SearchEnv } from '../../utils/subjects.api';
5
6
  * When a main menubar item is the current active one, a sub-menubar is shown and each subitem can have a menu with subitems.
6
7
  * @cssprop {--zanit-menubar-max-width} Maximum width of the menubar.
7
8
  */
8
- export declare class ZanitMenubar {
9
+ export declare class ZanitMenubar implements ComponentInterface {
9
10
  host: HTMLZanitMenubarElement;
10
11
  /** Menubar items extracted from `data`. */
11
12
  items: MenubarItem[];
@@ -1,7 +1,8 @@
1
+ import { ComponentInterface } from '../../../stencil-public-runtime';
1
2
  import { MenubarItem, MenuItem } from '../../../utils';
2
3
  import { SearchEnv } from '../../../utils/subjects.api';
3
4
  /** Mobile menubar component. */
4
- export declare class ZanitMobileMenubar {
5
+ export declare class ZanitMobileMenubar implements ComponentInterface {
5
6
  host: HTMLZanitMobileMenubarElement;
6
7
  /** IDs path of the current item. */
7
8
  currentPath: string[];
@@ -1,8 +1,8 @@
1
- import { EventEmitter } from '../../../stencil-public-runtime';
1
+ import { ComponentInterface, EventEmitter } from '../../../stencil-public-runtime';
2
2
  import { SearchEvent } from '../../../utils';
3
3
  import { SearchEnv } from '../../../utils/subjects.api';
4
4
  import { SearchSuggestion } from './suggestions';
5
- export declare class ZanitSearchForm {
5
+ export declare class ZanitSearchForm implements ComponentInterface {
6
6
  private formElement;
7
7
  private subjectsByArea;
8
8
  private timer;
@@ -29,6 +29,7 @@ export declare class ZanitSearchForm {
29
29
  onShowSuggestionsChange(): void;
30
30
  /** Emitted on search form submission. */
31
31
  search: EventEmitter<SearchEvent>;
32
+ /** Emitted when the search query is reset by the user (e.g. by clicking the reset button). */
32
33
  resetSearch: EventEmitter<void>;
33
34
  connectedCallback(): Promise<void>;
34
35
  /** Close open searchbar when clicking outside. */
@@ -249,6 +249,9 @@ declare namespace LocalJSX {
249
249
  "searchQuery"?: string | undefined;
250
250
  }
251
251
  interface ZanitSearchForm {
252
+ /**
253
+ * Emitted when the search query is reset by the user (e.g. by clicking the reset button).
254
+ */
252
255
  "onResetSearch"?: (event: ZanitSearchFormCustomEvent<void>) => void;
253
256
  /**
254
257
  * Emitted on search form submission.
@@ -269,11 +272,35 @@ declare namespace LocalJSX {
269
272
  */
270
273
  "searchQuery"?: string | undefined;
271
274
  }
275
+
276
+ interface ZanitBackToTopAttributes {
277
+ "pageMinHeight": number;
278
+ "scrollMinHeight": number;
279
+ }
280
+ interface ZanitMenubarAttributes {
281
+ "data": Promise<MenubarItem[]> | MenubarItem[] | URL | string;
282
+ "current": string | undefined;
283
+ "searchQuery": string | undefined;
284
+ "searchEnv": SearchEnv;
285
+ "searchArea": string | undefined;
286
+ }
287
+ interface ZanitMobileMenubarAttributes {
288
+ "searchQuery": string | undefined;
289
+ "loading": boolean;
290
+ "searchEnv": SearchEnv;
291
+ "searchArea": string | undefined;
292
+ }
293
+ interface ZanitSearchFormAttributes {
294
+ "searchQuery": string | undefined;
295
+ "searchEnv": SearchEnv;
296
+ "searchArea": string | undefined;
297
+ }
298
+
272
299
  interface IntrinsicElements {
273
- "zanit-back-to-top": ZanitBackToTop;
274
- "zanit-menubar": ZanitMenubar;
275
- "zanit-mobile-menubar": ZanitMobileMenubar;
276
- "zanit-search-form": ZanitSearchForm;
300
+ "zanit-back-to-top": Omit<ZanitBackToTop, keyof ZanitBackToTopAttributes> & { [K in keyof ZanitBackToTop & keyof ZanitBackToTopAttributes]?: ZanitBackToTop[K] } & { [K in keyof ZanitBackToTop & keyof ZanitBackToTopAttributes as `attr:${K}`]?: ZanitBackToTopAttributes[K] } & { [K in keyof ZanitBackToTop & keyof ZanitBackToTopAttributes as `prop:${K}`]?: ZanitBackToTop[K] };
301
+ "zanit-menubar": Omit<ZanitMenubar, keyof ZanitMenubarAttributes> & { [K in keyof ZanitMenubar & keyof ZanitMenubarAttributes]?: ZanitMenubar[K] } & { [K in keyof ZanitMenubar & keyof ZanitMenubarAttributes as `attr:${K}`]?: ZanitMenubarAttributes[K] } & { [K in keyof ZanitMenubar & keyof ZanitMenubarAttributes as `prop:${K}`]?: ZanitMenubar[K] };
302
+ "zanit-mobile-menubar": Omit<ZanitMobileMenubar, keyof ZanitMobileMenubarAttributes> & { [K in keyof ZanitMobileMenubar & keyof ZanitMobileMenubarAttributes]?: ZanitMobileMenubar[K] } & { [K in keyof ZanitMobileMenubar & keyof ZanitMobileMenubarAttributes as `attr:${K}`]?: ZanitMobileMenubarAttributes[K] } & { [K in keyof ZanitMobileMenubar & keyof ZanitMobileMenubarAttributes as `prop:${K}`]?: ZanitMobileMenubar[K] };
303
+ "zanit-search-form": Omit<ZanitSearchForm, keyof ZanitSearchFormAttributes> & { [K in keyof ZanitSearchForm & keyof ZanitSearchFormAttributes]?: ZanitSearchForm[K] } & { [K in keyof ZanitSearchForm & keyof ZanitSearchFormAttributes as `attr:${K}`]?: ZanitSearchFormAttributes[K] } & { [K in keyof ZanitSearchForm & keyof ZanitSearchFormAttributes as `prop:${K}`]?: ZanitSearchForm[K] };
277
304
  }
278
305
  }
279
306
  export { LocalJSX as JSX };
@@ -284,18 +311,18 @@ declare module "@stencil/core" {
284
311
  * Back to top floating action button component.
285
312
  * Appears on scroll, given a min height for both scroll height and page height.
286
313
  */
287
- "zanit-back-to-top": LocalJSX.ZanitBackToTop & JSXBase.HTMLAttributes<HTMLZanitBackToTopElement>;
314
+ "zanit-back-to-top": LocalJSX.IntrinsicElements["zanit-back-to-top"] & JSXBase.HTMLAttributes<HTMLZanitBackToTopElement>;
288
315
  /**
289
316
  * Main menubar component. Each item can have a menu with subitems
290
317
  * When a main menubar item is the current active one, a sub-menubar is shown and each subitem can have a menu with subitems.
291
318
  * @cssprop {--zanit-menubar-max-width} Maximum width of the menubar.
292
319
  */
293
- "zanit-menubar": LocalJSX.ZanitMenubar & JSXBase.HTMLAttributes<HTMLZanitMenubarElement>;
320
+ "zanit-menubar": LocalJSX.IntrinsicElements["zanit-menubar"] & JSXBase.HTMLAttributes<HTMLZanitMenubarElement>;
294
321
  /**
295
322
  * Mobile menubar component.
296
323
  */
297
- "zanit-mobile-menubar": LocalJSX.ZanitMobileMenubar & JSXBase.HTMLAttributes<HTMLZanitMobileMenubarElement>;
298
- "zanit-search-form": LocalJSX.ZanitSearchForm & JSXBase.HTMLAttributes<HTMLZanitSearchFormElement>;
324
+ "zanit-mobile-menubar": LocalJSX.IntrinsicElements["zanit-mobile-menubar"] & JSXBase.HTMLAttributes<HTMLZanitMobileMenubarElement>;
325
+ "zanit-search-form": LocalJSX.IntrinsicElements["zanit-search-form"] & JSXBase.HTMLAttributes<HTMLZanitSearchFormElement>;
299
326
  }
300
327
  }
301
328
  }