@zanichelli/albe-web-components 16.4.0-rc-2 → 16.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/cjs/{index-1bcf6013.js → index-22bdf239.js} +2 -2
  3. package/dist/cjs/index-22bdf239.js.map +1 -0
  4. package/dist/cjs/{index-59c3bcbe.js → index-6726b7d2.js} +2 -2
  5. package/dist/cjs/{index-59c3bcbe.js.map → index-6726b7d2.js.map} +1 -1
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/web-components-library.cjs.js +1 -1
  8. package/dist/cjs/z-app-header_12.cjs.entry.js +14 -3
  9. package/dist/cjs/z-app-header_12.cjs.entry.js.map +1 -1
  10. package/dist/cjs/z-menu.cjs.entry.js +1 -1
  11. package/dist/cjs/z-menu.cjs.entry.js.map +1 -1
  12. package/dist/cjs/z-table.cjs.entry.js +2 -2
  13. package/dist/cjs/z-th.cjs.entry.js +1 -1
  14. package/dist/cjs/z-tr.cjs.entry.js +2 -2
  15. package/dist/collection/beans/index.js.map +1 -1
  16. package/dist/collection/components/css-components/z-fab/index.stories.js.map +1 -1
  17. package/dist/collection/components/css-components/z-link/index.stories.js.map +1 -1
  18. package/dist/collection/components/date-picker/utils.js.map +1 -1
  19. package/dist/collection/components/date-picker/z-date-picker/index.js.map +1 -1
  20. package/dist/collection/components/date-picker/z-date-picker/index.stories.js.map +1 -1
  21. package/dist/collection/components/date-picker/z-range-picker/index.js.map +1 -1
  22. package/dist/collection/components/date-picker/z-range-picker/index.stories.js.map +1 -1
  23. package/dist/collection/components/deprecated/z-app-header-deprecated/index.js.map +1 -1
  24. package/dist/collection/components/deprecated/z-app-header-deprecated/index.stories.js.map +1 -1
  25. package/dist/collection/components/deprecated/z-menu-deprecated/index.js.map +1 -1
  26. package/dist/collection/components/deprecated/z-menu-deprecated/index.stories.js.map +1 -1
  27. package/dist/collection/components/deprecated/z-menu-section-deprecated/index.js.map +1 -1
  28. package/dist/collection/components/deprecated/z-menu-section-deprecated/index.stories.js.map +1 -1
  29. package/dist/collection/components/file-upload/z-dragdrop-area/index.js.map +1 -1
  30. package/dist/collection/components/file-upload/z-file/index.js.map +1 -1
  31. package/dist/collection/components/file-upload/z-file/index.stories.js.map +1 -1
  32. package/dist/collection/components/file-upload/z-file-upload/index.js.map +1 -1
  33. package/dist/collection/components/file-upload/z-file-upload/index.stories.js.map +1 -1
  34. package/dist/collection/components/index.js.map +1 -1
  35. package/dist/collection/components/list/z-list/index.js.map +1 -1
  36. package/dist/collection/components/list/z-list/index.stories.js.map +1 -1
  37. package/dist/collection/components/list/z-list-element/index.js.map +1 -1
  38. package/dist/collection/components/list/z-list-element/index.stories.js.map +1 -1
  39. package/dist/collection/components/list/z-list-group/index.js.map +1 -1
  40. package/dist/collection/components/list/z-list-group/index.stories.js.map +1 -1
  41. package/dist/collection/components/table/cells/z-td/index.js.map +1 -1
  42. package/dist/collection/components/table/cells/z-th/index.js.map +1 -1
  43. package/dist/collection/components/table/cells/z-th/styles.css +1 -1
  44. package/dist/collection/components/table/z-table/index.js.map +1 -1
  45. package/dist/collection/components/table/z-table/index.stories.js.map +1 -1
  46. package/dist/collection/components/table/z-tbody/index.js.map +1 -1
  47. package/dist/collection/components/table/z-tfoot/index.js.map +1 -1
  48. package/dist/collection/components/table/z-thead/index.js.map +1 -1
  49. package/dist/collection/components/table/z-tr/index.js.map +1 -1
  50. package/dist/collection/components/z-accordion/index.js.map +1 -1
  51. package/dist/collection/components/z-accordion/index.stories.js.map +1 -1
  52. package/dist/collection/components/z-anchor-navigation/index.js.map +1 -1
  53. package/dist/collection/components/z-anchor-navigation/index.stories.js.map +1 -1
  54. package/dist/collection/components/z-app-header/index.js.map +1 -1
  55. package/dist/collection/components/z-app-header/index.stories.js.map +1 -1
  56. package/dist/collection/components/z-aria-alert/index.js.map +1 -1
  57. package/dist/collection/components/z-aria-alert/index.stories.js.map +1 -1
  58. package/dist/collection/components/z-avatar/index.js.map +1 -1
  59. package/dist/collection/components/z-avatar/index.stories.js.map +1 -1
  60. package/dist/collection/components/z-book-card/index.js.map +1 -1
  61. package/dist/collection/components/z-book-card/index.stories.js.map +1 -1
  62. package/dist/collection/components/z-breadcrumb/index.js.map +1 -1
  63. package/dist/collection/components/z-breadcrumb/index.stories.js.map +1 -1
  64. package/dist/collection/components/z-button/index.js.map +1 -1
  65. package/dist/collection/components/z-button/index.stories.js.map +1 -1
  66. package/dist/collection/components/z-button-sort/index.js.map +1 -1
  67. package/dist/collection/components/z-button-sort/index.stories.js.map +1 -1
  68. package/dist/collection/components/z-card/index.js.map +1 -1
  69. package/dist/collection/components/z-card/index.stories.js.map +1 -1
  70. package/dist/collection/components/z-carousel/index.js.map +1 -1
  71. package/dist/collection/components/z-carousel/index.stories.js.map +1 -1
  72. package/dist/collection/components/z-chip/index.js.map +1 -1
  73. package/dist/collection/components/z-chip/index.stories.js.map +1 -1
  74. package/dist/collection/components/z-combobox/index.js.map +1 -1
  75. package/dist/collection/components/z-combobox/index.stories.js.map +1 -1
  76. package/dist/collection/components/z-cover-hero/index.js.map +1 -1
  77. package/dist/collection/components/z-cover-hero/index.stories.js.map +1 -1
  78. package/dist/collection/components/z-divider/index.js.map +1 -1
  79. package/dist/collection/components/z-divider/index.stories.js.map +1 -1
  80. package/dist/collection/components/z-ghost-loading/index.js.map +1 -1
  81. package/dist/collection/components/z-ghost-loading/index.stories.js.map +1 -1
  82. package/dist/collection/components/z-icon/index.js.map +1 -1
  83. package/dist/collection/components/z-icon/index.stories.js.map +1 -1
  84. package/dist/collection/components/z-info-box/index.js.map +1 -1
  85. package/dist/collection/components/z-info-box/index.stories.js.map +1 -1
  86. package/dist/collection/components/z-info-reveal/index.js.map +1 -1
  87. package/dist/collection/components/z-info-reveal/index.stories.js.map +1 -1
  88. package/dist/collection/components/z-input/index.js.map +1 -1
  89. package/dist/collection/components/z-input/index.stories.js.map +1 -1
  90. package/dist/collection/components/z-input-message/index.js.map +1 -1
  91. package/dist/collection/components/z-input-message/index.stories.js.map +1 -1
  92. package/dist/collection/components/z-logo/index.js.map +1 -1
  93. package/dist/collection/components/z-logo/index.stories.js.map +1 -1
  94. package/dist/collection/components/z-menu/index.js.map +1 -1
  95. package/dist/collection/components/z-menu/index.stories.js.map +1 -1
  96. package/dist/collection/components/z-menu/styles.css +1 -0
  97. package/dist/collection/components/z-menu-section/index.js.map +1 -1
  98. package/dist/collection/components/z-menu-section/index.stories.js.map +1 -1
  99. package/dist/collection/components/z-modal/index.js.map +1 -1
  100. package/dist/collection/components/z-modal/index.stories.js.map +1 -1
  101. package/dist/collection/components/z-navigation-tabs/index.js.map +1 -1
  102. package/dist/collection/components/z-navigation-tabs/index.stories.js.map +1 -1
  103. package/dist/collection/components/z-notification/index.js.map +1 -1
  104. package/dist/collection/components/z-notification/index.stories.js.map +1 -1
  105. package/dist/collection/components/z-offcanvas/index.js +27 -3
  106. package/dist/collection/components/z-offcanvas/index.js.map +1 -1
  107. package/dist/collection/components/z-offcanvas/index.stories.js +12 -46
  108. package/dist/collection/components/z-offcanvas/index.stories.js.map +1 -1
  109. package/dist/collection/components/z-offcanvas/styles.css +10 -15
  110. package/dist/collection/components/z-pagination/index.js.map +1 -1
  111. package/dist/collection/components/z-pagination/index.stories.js.map +1 -1
  112. package/dist/collection/components/z-panel-elem/index.js.map +1 -1
  113. package/dist/collection/components/z-panel-elem/index.stories.js.map +1 -1
  114. package/dist/collection/components/z-popover/index.js.map +1 -1
  115. package/dist/collection/components/z-popover/index.stories.js.map +1 -1
  116. package/dist/collection/components/z-searchbar/index.js.map +1 -1
  117. package/dist/collection/components/z-searchbar/index.stories.js.map +1 -1
  118. package/dist/collection/components/z-section-title/index.js.map +1 -1
  119. package/dist/collection/components/z-section-title/index.stories.js.map +1 -1
  120. package/dist/collection/components/z-select/index.js.map +1 -1
  121. package/dist/collection/components/z-select/index.stories.js.map +1 -1
  122. package/dist/collection/components/z-skip-to-content/index.js.map +1 -1
  123. package/dist/collection/components/z-skip-to-content/index.stories.js.map +1 -1
  124. package/dist/collection/components/z-stepper/index.js.map +1 -1
  125. package/dist/collection/components/z-stepper/index.stories.js.map +1 -1
  126. package/dist/collection/components/z-stepper-item/index.js.map +1 -1
  127. package/dist/collection/components/z-stepper-item/index.stories.js.map +1 -1
  128. package/dist/collection/components/z-tag/index.js.map +1 -1
  129. package/dist/collection/components/z-tag/index.stories.js.map +1 -1
  130. package/dist/collection/components/z-toast-notification/index.js.map +1 -1
  131. package/dist/collection/components/z-toast-notification/index.stories.js.map +1 -1
  132. package/dist/collection/components/z-toast-notification-list/index.js.map +1 -1
  133. package/dist/collection/components/z-toast-notification-list/index.stories.js.map +1 -1
  134. package/dist/collection/components/z-toggle-button/index.js.map +1 -1
  135. package/dist/collection/components/z-toggle-button/index.stories.js.map +1 -1
  136. package/dist/collection/components/z-toggle-switch/index.js.map +1 -1
  137. package/dist/collection/components/z-toggle-switch/index.stories.js.map +1 -1
  138. package/dist/collection/components/z-tooltip/index.js.map +1 -1
  139. package/dist/collection/components/z-tooltip/index.stories.js.map +1 -1
  140. package/dist/collection/components/z-visually-hidden/index.js.map +1 -1
  141. package/dist/collection/components/z-visually-hidden/index.stories.js.map +1 -1
  142. package/dist/collection/constants/breakpoints.js.map +1 -1
  143. package/dist/collection/constants/icons.js.map +1 -1
  144. package/dist/collection/constants/iconset.js +2 -0
  145. package/dist/collection/constants/iconset.js.map +1 -1
  146. package/dist/collection/index.js.map +1 -1
  147. package/dist/collection/snowflakes/myz/card/z-myz-card/index.js.map +1 -1
  148. package/dist/collection/snowflakes/myz/card/z-myz-card-alert/index.js.map +1 -1
  149. package/dist/collection/snowflakes/myz/card/z-myz-card-body/index.js.map +1 -1
  150. package/dist/collection/snowflakes/myz/card/z-myz-card-cover/index.js.map +1 -1
  151. package/dist/collection/snowflakes/myz/card/z-myz-card-dictionary/index.js.map +1 -1
  152. package/dist/collection/snowflakes/myz/card/z-myz-card-footer/index.js.map +1 -1
  153. package/dist/collection/snowflakes/myz/card/z-myz-card-footer-sections/index.js.map +1 -1
  154. package/dist/collection/snowflakes/myz/card/z-myz-card-header/index.js.map +1 -1
  155. package/dist/collection/snowflakes/myz/card/z-myz-card-icon/index.js.map +1 -1
  156. package/dist/collection/snowflakes/myz/card/z-myz-card-info/index.js.map +1 -1
  157. package/dist/collection/snowflakes/myz/card/z-myz-card-list/index.js.map +1 -1
  158. package/dist/collection/snowflakes/myz/list/z-myz-list/index.js.map +1 -1
  159. package/dist/collection/snowflakes/myz/list/z-myz-list-item/index.js.map +1 -1
  160. package/dist/collection/snowflakes/myz/z-alert/index.js.map +1 -1
  161. package/dist/collection/snowflakes/myz/z-otp/index.js.map +1 -1
  162. package/dist/collection/snowflakes/myz/z-slideshow/index.js.map +1 -1
  163. package/dist/collection/utils/storybook-utils.js.map +1 -1
  164. package/dist/collection/utils/utils.js.map +1 -1
  165. package/dist/components/iconset.js +2 -0
  166. package/dist/components/iconset.js.map +1 -1
  167. package/dist/components/index21.js +13 -4
  168. package/dist/components/index21.js.map +1 -1
  169. package/dist/components/z-menu.js +1 -1
  170. package/dist/components/z-menu.js.map +1 -1
  171. package/dist/components/z-th.js +1 -1
  172. package/dist/components/z-th.js.map +1 -1
  173. package/dist/docs/grid/index.stories.js +54 -0
  174. package/dist/docs/grid/index.stories.js.map +1 -0
  175. package/dist/docs/iconset/index.stories.js +32 -0
  176. package/dist/docs/iconset/index.stories.js.map +1 -0
  177. package/dist/docs/themes/index.stories.js +90 -0
  178. package/dist/docs/themes/index.stories.js.map +1 -0
  179. package/dist/docs/typography/index.stories.js +186 -0
  180. package/dist/docs/typography/index.stories.js.map +1 -0
  181. package/dist/esm/{index-fcf764b5.js → index-681cc2b7.js} +2 -2
  182. package/dist/esm/index-681cc2b7.js.map +1 -0
  183. package/dist/esm/{index-2b5c2515.js → index-7b64c875.js} +2 -2
  184. package/dist/esm/{index-2b5c2515.js.map → index-7b64c875.js.map} +1 -1
  185. package/dist/esm/loader.js +1 -1
  186. package/dist/esm/web-components-library.js +1 -1
  187. package/dist/esm/z-app-header_12.entry.js +14 -3
  188. package/dist/esm/z-app-header_12.entry.js.map +1 -1
  189. package/dist/esm/z-menu.entry.js +1 -1
  190. package/dist/esm/z-menu.entry.js.map +1 -1
  191. package/dist/esm/z-table.entry.js +2 -2
  192. package/dist/esm/z-th.entry.js +1 -1
  193. package/dist/esm/z-tr.entry.js +2 -2
  194. package/dist/types/components/z-offcanvas/index.d.ts +5 -0
  195. package/dist/types/components/z-offcanvas/index.stories.d.ts +4 -6
  196. package/dist/types/components.d.ts +2 -2
  197. package/dist/types/constants/iconset.d.ts +4 -0
  198. package/dist/types/home/runner/work/design-system/design-system/.stencil/docs/grid/index.stories.d.ts +9 -0
  199. package/dist/types/home/runner/work/design-system/design-system/.stencil/docs/iconset/index.stories.d.ts +11 -0
  200. package/dist/types/home/runner/work/design-system/design-system/.stencil/docs/themes/index.stories.d.ts +27 -0
  201. package/dist/types/home/runner/work/design-system/design-system/.stencil/docs/typography/index.stories.d.ts +96 -0
  202. package/dist/web-components-library/{p-6531d14a.entry.js → p-0c489c4b.entry.js} +2 -2
  203. package/dist/web-components-library/{p-cce46031.js → p-13366542.js} +2 -2
  204. package/dist/web-components-library/p-456f984f.js +2 -0
  205. package/dist/web-components-library/p-456f984f.js.map +1 -0
  206. package/dist/web-components-library/p-477f4446.entry.js +2 -0
  207. package/dist/web-components-library/p-477f4446.entry.js.map +1 -0
  208. package/dist/web-components-library/p-6b791915.entry.js +2 -0
  209. package/dist/web-components-library/p-8d443cac.entry.js +2 -0
  210. package/dist/web-components-library/p-ceb4403d.entry.js +2 -0
  211. package/dist/web-components-library/p-ceb4403d.entry.js.map +1 -0
  212. package/dist/web-components-library/web-components-library.css +529 -28
  213. package/dist/web-components-library/web-components-library.esm.js +1 -1
  214. package/dist/web-components-library/web-components-library.esm.js.map +1 -1
  215. package/package.json +1 -1
  216. package/www/build/{p-6531d14a.entry.js → p-0c489c4b.entry.js} +2 -2
  217. package/www/build/{p-cce46031.js → p-13366542.js} +2 -2
  218. package/www/build/p-456f984f.js +2 -0
  219. package/www/build/p-456f984f.js.map +1 -0
  220. package/www/build/p-477f4446.entry.js +2 -0
  221. package/www/build/p-477f4446.entry.js.map +1 -0
  222. package/www/build/p-6b791915.entry.js +2 -0
  223. package/www/build/p-8d443cac.entry.js +2 -0
  224. package/www/build/p-bb21356b.js +2 -0
  225. package/www/build/p-ceb4403d.entry.js +2 -0
  226. package/www/build/p-ceb4403d.entry.js.map +1 -0
  227. package/www/build/{p-ae0a33a2.css → p-d9dbe303.css} +529 -28
  228. package/www/build/web-components-library.css +529 -28
  229. package/www/build/web-components-library.esm.js +1 -1
  230. package/www/build/web-components-library.esm.js.map +1 -1
  231. package/www/index.html +1 -1
  232. package/dist/cjs/index-1bcf6013.js.map +0 -1
  233. package/dist/esm/index-fcf764b5.js.map +0 -1
  234. package/dist/web-components-library/p-0c813477.entry.js +0 -2
  235. package/dist/web-components-library/p-0c813477.entry.js.map +0 -1
  236. package/dist/web-components-library/p-47bf778e.js +0 -2
  237. package/dist/web-components-library/p-47bf778e.js.map +0 -1
  238. package/dist/web-components-library/p-67896876.entry.js +0 -2
  239. package/dist/web-components-library/p-822a2097.entry.js +0 -2
  240. package/dist/web-components-library/p-b72a4b5e.entry.js +0 -2
  241. package/dist/web-components-library/p-b72a4b5e.entry.js.map +0 -1
  242. package/www/build/p-0c813477.entry.js +0 -2
  243. package/www/build/p-0c813477.entry.js.map +0 -1
  244. package/www/build/p-47bf778e.js +0 -2
  245. package/www/build/p-47bf778e.js.map +0 -1
  246. package/www/build/p-67896876.entry.js +0 -2
  247. package/www/build/p-822a2097.entry.js +0 -2
  248. package/www/build/p-88640e60.js +0 -2
  249. package/www/build/p-b72a4b5e.entry.js +0 -2
  250. package/www/build/p-b72a4b5e.entry.js.map +0 -1
  251. /package/dist/web-components-library/{p-6531d14a.entry.js.map → p-0c489c4b.entry.js.map} +0 -0
  252. /package/dist/web-components-library/{p-cce46031.js.map → p-13366542.js.map} +0 -0
  253. /package/dist/web-components-library/{p-67896876.entry.js.map → p-6b791915.entry.js.map} +0 -0
  254. /package/dist/web-components-library/{p-822a2097.entry.js.map → p-8d443cac.entry.js.map} +0 -0
  255. /package/www/build/{p-6531d14a.entry.js.map → p-0c489c4b.entry.js.map} +0 -0
  256. /package/www/build/{p-cce46031.js.map → p-13366542.js.map} +0 -0
  257. /package/www/build/{p-67896876.entry.js.map → p-6b791915.entry.js.map} +0 -0
  258. /package/www/build/{p-822a2097.entry.js.map → p-8d443cac.entry.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
2
  import { O as OffCanvasVariant, u as TransitionDirection } from './index2.js';
3
3
 
4
- const stylesCss = ".sc-z-offcanvas-h{font-family:var(--font-family-sans);font-weight:var(--font-rg)}[variant=\"pushcontent\"].sc-z-offcanvas-h:not([transitiondirection=\"up\"]){overflow:hidden;flex:none}.canvas-container.sc-z-offcanvas{display:flex;overflow:hidden;min-width:100%;height:100%;background:var(--color-surface01);transition:transform 0.4s ease-out}.sc-z-offcanvas-h>*.sc-z-offcanvas{position:fixed;top:var(--z-offcanvas--top-space, 0);right:0;bottom:0;left:0}[open].sc-z-offcanvas-h>*.sc-z-offcanvas{height:calc(100% - var(--z-offcanvas--top-space, 0px))}[transitiondirection=\"right\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{transform:translateX(-100%)}[transitiondirection=\"left\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{transform:translateX(100%)}[open][transitiondirection=\"right\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas,[open][transitiondirection=\"left\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{transform:translateX(0)}[transitiondirection=\"up\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{top:auto;bottom:0;height:var(--z-offcanvas--container-height, 90%);transform:translateY(100%)}[transitiondirection=\"up\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas,[variant=\"overlay\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{z-index:1001}[open][transitiondirection=\"up\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{transform:translateY(0)}[variant=\"pushcontent\"].sc-z-offcanvas-h:not([transitiondirection=\"up\"])>.canvas-container.sc-z-offcanvas{position:relative;height:100%}[variant=\"pushcontent\"].sc-z-offcanvas-h:not([open])>.canvas-container.sc-z-offcanvas{width:0;min-width:0;transition:width 0.4s ease-out,\n min-width 0.4s ease-out}[variant=\"pushcontent\"][transitiondirection=\"left\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{float:right}[skip-animation].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{transition:none}.canvas-background.sc-z-offcanvas{z-index:1000;display:none;width:100%;height:100%;background-color:var(--gray900)}[open].sc-z-offcanvas-h>.canvas-background.sc-z-offcanvas{display:block;opacity:0.7}.canvas-container.sc-z-offcanvas>.canvas-content.sc-z-offcanvas{overflow:hidden auto;flex:1 auto;padding:0 calc(var(--space-unit) * 2);margin:calc(var(--space-unit) * 2) calc(var(--space-unit) / 2) calc(var(--space-unit) * 2) 0}.canvas-container.sc-z-offcanvas .canvas-content.sc-z-offcanvas::-webkit-scrollbar{width:6px;background:linear-gradient(to right, transparent 0 1px, var(--gray200) 1px 5px, transparent 5px 6px)}.canvas-container.sc-z-offcanvas .canvas-content.sc-z-offcanvas::-webkit-scrollbar-thumb{background-color:var(--color-primary01)}.canvas-container.sc-z-offcanvas .canvas-content.sc-z-offcanvas::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}@supports not selector(.canvas-content::-webkit-scrollbar-track){.canvas-container.sc-z-offcanvas .canvas-content.sc-z-offcanvas{scrollbar-color:var(--color-primary01) transparent}}@media (min-width: 768px){.canvas-container.sc-z-offcanvas{width:max(var(--z-offcanvas--container-width, 375px), 375px);min-width:375px}[transitiondirection=\"up\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{width:100%}[transitiondirection=\"right\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{right:auto;left:0}[transitiondirection=\"left\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{right:0;left:auto}}";
4
+ const stylesCss = ".sc-z-offcanvas-h{font-family:var(--font-family-sans);font-weight:var(--font-rg)}[variant=\"pushcontent\"].sc-z-offcanvas-h:not([transitiondirection=\"up\"]){overflow:hidden}.canvas-container.sc-z-offcanvas{display:flex;overflow:hidden;min-width:100%;height:100%;background:var(--color-surface01);transition:transform 0.4s ease-out}.sc-z-offcanvas-h>*.sc-z-offcanvas{position:fixed;top:var(--z-offcanvas--top-space, 0);right:0;bottom:0;left:0}[open].sc-z-offcanvas-h>*.sc-z-offcanvas{height:calc(100% - var(--z-offcanvas--top-space, 0px))}[transitiondirection=\"right\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{transform:translateX(-100%)}[transitiondirection=\"left\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{transform:translateX(100%)}[open][transitiondirection=\"right\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas,[open][transitiondirection=\"left\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{transform:translateX(0)}[transitiondirection=\"up\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{top:auto;bottom:0;height:var(--z-offcanvas--container-height, 90%);transform:translateY(100%)}[transitiondirection=\"up\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas,[variant=\"overlay\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{z-index:1001}[open][transitiondirection=\"up\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{transform:translateY(0)}[variant=\"pushcontent\"].sc-z-offcanvas-h:not([transitiondirection=\"up\"])>.canvas-container.sc-z-offcanvas{position:relative;height:100%}[variant=\"pushcontent\"].sc-z-offcanvas-h:not([open]){display:none}[skip-animation].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{transition:none}.canvas-background.sc-z-offcanvas{z-index:1000;width:100%;height:100%;background-color:var(--gray900);opacity:0;pointer-events:none;transition:opacity 0.4s ease-out}[open].sc-z-offcanvas-h>.canvas-background.sc-z-offcanvas{opacity:0.7;pointer-events:unset}.canvas-container.sc-z-offcanvas>.canvas-content.sc-z-offcanvas{overflow:hidden auto;flex:1 auto;padding:0 calc(var(--space-unit) * 2);margin:calc(var(--space-unit) * 2) calc(var(--space-unit) / 2) calc(var(--space-unit) * 2) 0}.canvas-container.sc-z-offcanvas .canvas-content.sc-z-offcanvas::-webkit-scrollbar{width:6px;background:linear-gradient(to right, transparent 0 1px, var(--gray200) 1px 5px, transparent 5px 6px)}.canvas-container.sc-z-offcanvas .canvas-content.sc-z-offcanvas::-webkit-scrollbar-thumb{background-color:var(--color-primary01)}.canvas-container.sc-z-offcanvas .canvas-content.sc-z-offcanvas::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}@supports not selector(.canvas-content::-webkit-scrollbar-track){.canvas-container.sc-z-offcanvas .canvas-content.sc-z-offcanvas{scrollbar-color:var(--color-primary01) transparent}}@media (min-width: 768px){[variant=\"pushcontent\"].sc-z-offcanvas-h:not([transitiondirection=\"up\"]){flex:none}.canvas-container.sc-z-offcanvas{width:max(var(--z-offcanvas--container-width, 375px), 375px);min-width:375px}[transitiondirection=\"up\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{width:100%}[transitiondirection=\"right\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{right:auto;left:0}[transitiondirection=\"left\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{right:0;left:auto}}";
5
5
  const ZOffcanvasStyle0 = stylesCss;
6
6
 
7
7
  const ZOffcanvas = /*@__PURE__*/ proxyCustomElement(class ZOffcanvas extends HTMLElement {
@@ -15,6 +15,16 @@ const ZOffcanvas = /*@__PURE__*/ proxyCustomElement(class ZOffcanvas extends HTM
15
15
  this.skipLoadAnimation = false;
16
16
  this.skipAnimation = false;
17
17
  }
18
+ /**
19
+ * Stop the event default behavior and propagation when the offcanvas is closed.
20
+ */
21
+ stopEvent(event) {
22
+ if (this.open) {
23
+ return;
24
+ }
25
+ event.preventDefault();
26
+ event.stopPropagation();
27
+ }
18
28
  /**
19
29
  * Hide the body overflow when the offcanvas is open.
20
30
  */
@@ -57,8 +67,7 @@ const ZOffcanvas = /*@__PURE__*/ proxyCustomElement(class ZOffcanvas extends HTM
57
67
  this.open = false;
58
68
  }
59
69
  render() {
60
- return (h(Host, { key: '136525b1dbd1537072fdb065403d80297db67da7', "skip-animation": this.skipAnimation, inert: !this.open }, h("div", { key: '49595a37776b677730a25241e3dee2b3070684b1', class: "canvas-container", role: "presentation", ref: (el) => (this.canvasContainer = el) }, h("div", { key: 'd2381a55e6ce4037de2cdd6f040394b100b52143', class: "canvas-content", role: "presentation" }, h("slot", { key: '4c6d50f980edc099d946ddf284eb3c1bb0b757c0', name: "canvasContent" }))), (this.variant == OffCanvasVariant.OVERLAY || this.transitiondirection === TransitionDirection.UP) &&
61
- this.open && (h("div", { key: '766613ee48a99bad3bd2dc98bbff6b4bf2fe34a9', class: "canvas-background", onClick: () => (this.open = false) }))));
70
+ return (h(Host, { key: 'd6d26ab3d262f18a7f7b0d79064d833550d7dc5e', "skip-animation": this.skipAnimation, "aria-hidden": !this.open ? "true" : null }, h("div", { key: '5006a356d94cd614e646f8c6cc22ef9bc82b230c', class: "canvas-container", role: "presentation", ref: (el) => (this.canvasContainer = el) }, h("div", { key: 'cdf6e5c0d1d7b594a75ba49214c7782c09f13fab', class: "canvas-content", role: "presentation" }, h("slot", { key: '9576d80ca8e63ae785fb66e01b696412ab8acad2', name: "canvasContent" }))), (this.variant == OffCanvasVariant.OVERLAY || this.transitiondirection === TransitionDirection.UP) && (h("div", { key: '91e08d2782d1c4ec027ebf452f128d64b96ef01d', class: "canvas-background", onClick: () => (this.open = false) }))));
62
71
  }
63
72
  static get watchers() { return {
64
73
  "variant": ["handlePageOverflow"],
@@ -71,7 +80,7 @@ const ZOffcanvas = /*@__PURE__*/ proxyCustomElement(class ZOffcanvas extends HTM
71
80
  "transitiondirection": [513],
72
81
  "skipLoadAnimation": [4, "skip-load-animation"],
73
82
  "skipAnimation": [32]
74
- }, undefined, {
83
+ }, [[2, "click", "stopEvent"], [2, "focusin", "stopEvent"]], {
75
84
  "variant": ["handlePageOverflow"],
76
85
  "open": ["onOpenChanged"]
77
86
  }]);
@@ -1 +1 @@
1
- {"file":"index21.js","mappings":";;;AAAA,MAAM,SAAS,GAAG,41GAA41G,CAAC;AAC/2G,yBAAe,SAAS;;MCcX,UAAU;;;;;uBAQQ,gBAAgB,CAAC,WAAW;oBAIlD,KAAK;mCAOgC,mBAAmB,CAAC,IAAI;iCAQhD,KAAK;6BAQD,KAAK;;;;;IAQrB,kBAAkB;QACxB,MAAM,QAAQ,GACZ,IAAI,CAAC,OAAO,KAAK,gBAAgB,CAAC,OAAO,IAAI,IAAI,CAAC,mBAAmB,KAAK,mBAAmB,CAAC,EAAE;cAC5F,YAAY;cACZ,YAAY,CAAC;QAEnB,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,QAAQ,GAAG,EAAE,CAAC;KAC3D;IAGD,aAAa;;QACX,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE7C,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;;YAEd,MAAM,gBAAgB,GAAG;gBACvB,IAAI,CAAC,kBAAkB,EAAE,CAAC;gBAC1B,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAC;aAC7E,CAAC;YAEF,MAAA,IAAI,CAAC,eAAe,0CAAE,gBAAgB,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAC;SAC3E;aAAM;YACL,IAAI,CAAC,kBAAkB,EAAE,CAAC;SAC3B;KACF;IAED,iBAAiB;QACf,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;SAC3B;KACF;IAED,gBAAgB;QACd,IAAI,CAAC,kBAAkB,EAAE,CAAC;KAC3B;IAED,kBAAkB;QAChB,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;KAC5B;IAED,iBAAiB;QACf,IAAI,CAAC,kBAAkB,EAAE,CAAC;KAC3B;IAED,oBAAoB;QAClB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;KACnB;IAED,MAAM;QACJ,QACE,EAAC,IAAI,uEACa,IAAI,CAAC,aAAa,EAClC,KAAK,EAAE,CAAC,IAAI,CAAC,IAAI,IAEjB,4DACE,KAAK,EAAC,kBAAkB,EACxB,IAAI,EAAC,cAAc,EACnB,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC,IAExC,4DACE,KAAK,EAAC,gBAAgB,EACtB,IAAI,EAAC,cAAc,IAEnB,6DAAM,IAAI,EAAC,eAAe,GAAQ,CAC9B,CACF,EACL,CAAC,IAAI,CAAC,OAAO,IAAI,gBAAgB,CAAC,OAAO,IAAI,IAAI,CAAC,mBAAmB,KAAK,mBAAmB,CAAC,EAAE;YAC/F,IAAI,CAAC,IAAI,KACP,4DACE,KAAK,EAAC,mBAAmB,EACzB,OAAO,EAAE,OAAO,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,GAC7B,CACR,CACE,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/z-offcanvas/styles.css?tag=z-offcanvas&encapsulation=scoped","src/components/z-offcanvas/index.tsx"],"sourcesContent":[":host {\n --z-offcanvas--container-width: ;\n --z-offcanvas--container-height: ;\n --z-offcanvas--top-space: ;\n\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n}\n\n:host([variant=\"pushcontent\"]:not([transitiondirection=\"up\"])) {\n overflow: hidden;\n flex: none; /* Prevent unwanted width changes in flex containers */\n}\n\n.canvas-container {\n display: flex;\n overflow: hidden;\n min-width: 100%;\n height: 100%;\n background: var(--color-surface01);\n transition: transform 0.4s ease-out;\n}\n\n:host > * {\n position: fixed;\n top: var(--z-offcanvas--top-space, 0);\n right: 0;\n bottom: 0;\n left: 0;\n}\n\n:host([open]) > * {\n height: calc(100% - var(--z-offcanvas--top-space, 0px));\n}\n\n:host([transitiondirection=\"right\"]) > .canvas-container {\n transform: translateX(-100%);\n}\n\n:host([transitiondirection=\"left\"]) > .canvas-container {\n transform: translateX(100%);\n}\n\n:host([open][transitiondirection=\"right\"]) > .canvas-container,\n:host([open][transitiondirection=\"left\"]) > .canvas-container {\n transform: translateX(0);\n}\n\n:host([transitiondirection=\"up\"]) > .canvas-container {\n top: auto;\n bottom: 0;\n height: var(--z-offcanvas--container-height, 90%);\n transform: translateY(100%);\n}\n\n:host([transitiondirection=\"up\"], [variant=\"overlay\"]) > .canvas-container {\n z-index: 1001;\n}\n\n:host([open][transitiondirection=\"up\"]) > .canvas-container {\n transform: translateY(0);\n}\n\n:host([variant=\"pushcontent\"]:not([transitiondirection=\"up\"])) > .canvas-container {\n position: relative;\n height: 100%;\n}\n\n:host([variant=\"pushcontent\"]:not([open])) > .canvas-container {\n width: 0;\n min-width: 0;\n transition:\n width 0.4s ease-out,\n min-width 0.4s ease-out;\n}\n\n:host([variant=\"pushcontent\"][transitiondirection=\"left\"]) > .canvas-container {\n /* the `width` transition is by default from right to left, which is the opposite of what we want it.\n Setting the container to float to the right fixes it. */\n float: right;\n}\n\n:host([skip-animation]) > .canvas-container {\n transition: none;\n}\n\n.canvas-background {\n z-index: 1000;\n display: none;\n width: 100%;\n height: 100%;\n background-color: var(--gray900);\n}\n\n:host([open]) > .canvas-background {\n display: block;\n opacity: 0.7;\n}\n\n.canvas-container > .canvas-content {\n overflow: hidden auto;\n flex: 1 auto;\n padding: 0 calc(var(--space-unit) * 2);\n margin: calc(var(--space-unit) * 2) calc(var(--space-unit) / 2) calc(var(--space-unit) * 2) 0;\n}\n\n/* Webkit Scrollbar */\n.canvas-container .canvas-content::-webkit-scrollbar {\n width: 6px;\n background: linear-gradient(to right, transparent 0 1px, var(--gray200) 1px 5px, transparent 5px 6px);\n}\n\n.canvas-container .canvas-content::-webkit-scrollbar-thumb {\n background-color: var(--color-primary01);\n}\n\n.canvas-container .canvas-content::-webkit-scrollbar-thumb:hover {\n background-color: var(--color-hover-primary);\n}\n\n/* Firefox scrollbar */\n@supports not selector(.canvas-content::-webkit-scrollbar-track) {\n .canvas-container .canvas-content {\n scrollbar-color: var(--color-primary01) transparent;\n }\n}\n\n/* Tablet / Desktop */\n@media (min-width: 768px) {\n .canvas-container {\n width: max(var(--z-offcanvas--container-width, 375px), 375px);\n min-width: 375px;\n }\n\n :host([transitiondirection=\"up\"]) > .canvas-container {\n width: 100%;\n }\n\n :host([transitiondirection=\"right\"]) > .canvas-container {\n right: auto;\n left: 0;\n }\n\n :host([transitiondirection=\"left\"]) > .canvas-container {\n right: 0;\n left: auto;\n }\n}\n","import {Component, Event, EventEmitter, h, Host, Prop, State, Watch} from \"@stencil/core\";\nimport {OffCanvasVariant, TransitionDirection} from \"../../beans\";\n\n/**\n * @slot canvasContent - Slot for the offcanvas content.\n * @cssprop --z-offcanvas--top-space - Top offset of the offcanvas, for `overlay` variant. Useful when there is some fixed element above the offcanvas. Default: `0`.\n * @cssprop --z-offcanvas--container-width - Width of the offcanvas for `left` and `right` direction. Default: `375px`.\n * @cssprop --z-offcanvas--container-height - Height of the offcanvas for `up` direction. Default: `90%`.\n */\n@Component({\n tag: \"z-offcanvas\",\n styleUrl: \"styles.css\",\n shadow: false,\n scoped: true,\n})\nexport class ZOffcanvas {\n /**\n * Offcanvas variant.\n * - `overlay`: The offcanvas covers the page content putting an overlay.\n * - `pushcontent`: The offcanvas isn't absolutely positioned and \"pushes\" the page content.\n * > NB: `pushcontent` variant may need some extra style tuning of the context around the component to work properly.\n */\n @Prop({reflect: true})\n variant?: OffCanvasVariant = OffCanvasVariant.PUSHCONTENT;\n\n /** Whether the offcanvas is open. Default: false */\n @Prop({reflect: true, mutable: true})\n open = false;\n\n /**\n * Open the content transitioning to a specified direction.\n * The `up` direction always show the `overlay`, also when the variant is `pushcontent`.\n */\n @Prop({reflect: true})\n transitiondirection?: TransitionDirection = TransitionDirection.LEFT;\n\n /**\n * Skip the opening transition when the offcanvas is already open at the first render.\n * @deprecated This prop is not needed anymore, the component will automatically skip the transition\n * when it starts with `open` set to `true`. Only exists for Typescript backward compatibility.\n */\n @Prop()\n skipLoadAnimation = false;\n\n /** emitted when `open` prop changes */\n @Event()\n canvasOpenStatusChanged: EventEmitter;\n\n /** Used to skip the opening transition when the offcanvas is already open at the first render. */\n @State()\n private skipAnimation = false;\n\n private canvasContainer: HTMLElement;\n\n /**\n * Hide the body overflow when the offcanvas is open.\n */\n @Watch(\"variant\")\n private handlePageOverflow(): void {\n const overflow =\n this.variant === OffCanvasVariant.OVERLAY || this.transitiondirection === TransitionDirection.UP\n ? \"overflow-y\"\n : \"overflow-x\";\n\n document.body.style[overflow] = this.open ? \"hidden\" : \"\";\n }\n\n @Watch(\"open\")\n onOpenChanged(): void {\n this.canvasOpenStatusChanged.emit(this.open);\n\n if (!this.open) {\n // when the offcanvas is closing, wait for the transitionend event to end before handling the body overflow\n const listenerCallback = (): void => {\n this.handlePageOverflow();\n this.canvasContainer.removeEventListener(\"transitionend\", listenerCallback);\n };\n\n this.canvasContainer?.addEventListener(\"transitionend\", listenerCallback);\n } else {\n this.handlePageOverflow();\n }\n }\n\n componentWillLoad(): void {\n if (this.open) {\n this.skipAnimation = true;\n }\n }\n\n componentDidLoad(): void {\n this.handlePageOverflow();\n }\n\n componentDidRender(): void {\n this.skipAnimation = false;\n }\n\n connectedCallback(): void {\n this.handlePageOverflow();\n }\n\n disconnectedCallback(): void {\n this.open = false;\n }\n\n render(): HTMLZOffcanvasElement {\n return (\n <Host\n skip-animation={this.skipAnimation}\n inert={!this.open}\n >\n <div\n class=\"canvas-container\"\n role=\"presentation\"\n ref={(el) => (this.canvasContainer = el)}\n >\n <div\n class=\"canvas-content\"\n role=\"presentation\"\n >\n <slot name=\"canvasContent\"></slot>\n </div>\n </div>\n {(this.variant == OffCanvasVariant.OVERLAY || this.transitiondirection === TransitionDirection.UP) &&\n this.open && (\n <div\n class=\"canvas-background\"\n onClick={() => (this.open = false)}\n ></div>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"index21.js","mappings":";;;AAAA,MAAM,SAAS,GAAG,uwGAAuwG,CAAC;AAC1xG,yBAAe,SAAS;;MCcX,UAAU;;;;;uBASQ,gBAAgB,CAAC,WAAW;oBAIlD,KAAK;mCAOgC,mBAAmB,CAAC,IAAI;iCAQhD,KAAK;6BAQD,KAAK;;;;;IAS7B,SAAS,CAAC,KAAY;QACpB,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,OAAO;SACR;QAED,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,KAAK,CAAC,eAAe,EAAE,CAAC;KACzB;;;;IAMO,kBAAkB;QACxB,MAAM,QAAQ,GACZ,IAAI,CAAC,OAAO,KAAK,gBAAgB,CAAC,OAAO,IAAI,IAAI,CAAC,mBAAmB,KAAK,mBAAmB,CAAC,EAAE;cAC5F,YAAY;cACZ,YAAY,CAAC;QAEnB,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,QAAQ,GAAG,EAAE,CAAC;KAC3D;IAGD,aAAa;;QACX,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE7C,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;;YAEd,MAAM,gBAAgB,GAAG;gBACvB,IAAI,CAAC,kBAAkB,EAAE,CAAC;gBAC1B,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAC;aAC7E,CAAC;YAEF,MAAA,IAAI,CAAC,eAAe,0CAAE,gBAAgB,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAC;SAC3E;aAAM;YACL,IAAI,CAAC,kBAAkB,EAAE,CAAC;SAC3B;KACF;IAED,iBAAiB;QACf,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;SAC3B;KACF;IAED,gBAAgB;QACd,IAAI,CAAC,kBAAkB,EAAE,CAAC;KAC3B;IAED,kBAAkB;QAChB,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;KAC5B;IAED,iBAAiB;QACf,IAAI,CAAC,kBAAkB,EAAE,CAAC;KAC3B;IAED,oBAAoB;QAClB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;KACnB;IAED,MAAM;QACJ,QACE,EAAC,IAAI,uEACa,IAAI,CAAC,aAAa,iBACrB,CAAC,IAAI,CAAC,IAAI,GAAG,MAAM,GAAG,IAAI,IAEvC,4DACE,KAAK,EAAC,kBAAkB,EACxB,IAAI,EAAC,cAAc,EACnB,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC,IAExC,4DACE,KAAK,EAAC,gBAAgB,EACtB,IAAI,EAAC,cAAc,IAEnB,6DAAM,IAAI,EAAC,eAAe,GAAQ,CAC9B,CACF,EACL,CAAC,IAAI,CAAC,OAAO,IAAI,gBAAgB,CAAC,OAAO,IAAI,IAAI,CAAC,mBAAmB,KAAK,mBAAmB,CAAC,EAAE,MAC/F,4DACE,KAAK,EAAC,mBAAmB,EACzB,OAAO,EAAE,OAAO,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,GAC7B,CACR,CACI,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/z-offcanvas/styles.css?tag=z-offcanvas&encapsulation=scoped","src/components/z-offcanvas/index.tsx"],"sourcesContent":[":host {\n --z-offcanvas--container-width: ;\n --z-offcanvas--container-height: ;\n --z-offcanvas--top-space: ;\n\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n}\n\n:host([variant=\"pushcontent\"]:not([transitiondirection=\"up\"])) {\n overflow: hidden;\n}\n\n.canvas-container {\n display: flex;\n overflow: hidden;\n min-width: 100%;\n height: 100%;\n background: var(--color-surface01);\n transition: transform 0.4s ease-out;\n}\n\n:host > * {\n position: fixed;\n top: var(--z-offcanvas--top-space, 0);\n right: 0;\n bottom: 0;\n left: 0;\n}\n\n:host([open]) > * {\n height: calc(100% - var(--z-offcanvas--top-space, 0px));\n}\n\n:host([transitiondirection=\"right\"]) > .canvas-container {\n transform: translateX(-100%);\n}\n\n:host([transitiondirection=\"left\"]) > .canvas-container {\n transform: translateX(100%);\n}\n\n:host([open][transitiondirection=\"right\"]) > .canvas-container,\n:host([open][transitiondirection=\"left\"]) > .canvas-container {\n transform: translateX(0);\n}\n\n:host([transitiondirection=\"up\"]) > .canvas-container {\n top: auto;\n bottom: 0;\n height: var(--z-offcanvas--container-height, 90%);\n transform: translateY(100%);\n}\n\n:host([transitiondirection=\"up\"], [variant=\"overlay\"]) > .canvas-container {\n z-index: 1001;\n}\n\n:host([open][transitiondirection=\"up\"]) > .canvas-container {\n transform: translateY(0);\n}\n\n:host([variant=\"pushcontent\"]:not([transitiondirection=\"up\"])) > .canvas-container {\n position: relative;\n height: 100%;\n}\n\n:host([variant=\"pushcontent\"]:not([open])) {\n display: none;\n}\n\n:host([skip-animation]) > .canvas-container {\n transition: none;\n}\n\n.canvas-background {\n z-index: 1000;\n width: 100%;\n height: 100%;\n background-color: var(--gray900);\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.4s ease-out;\n}\n\n:host([open]) > .canvas-background {\n opacity: 0.7;\n pointer-events: unset;\n}\n\n.canvas-container > .canvas-content {\n overflow: hidden auto;\n flex: 1 auto;\n padding: 0 calc(var(--space-unit) * 2);\n margin: calc(var(--space-unit) * 2) calc(var(--space-unit) / 2) calc(var(--space-unit) * 2) 0;\n}\n\n/* Webkit Scrollbar */\n.canvas-container .canvas-content::-webkit-scrollbar {\n width: 6px;\n background: linear-gradient(to right, transparent 0 1px, var(--gray200) 1px 5px, transparent 5px 6px);\n}\n\n.canvas-container .canvas-content::-webkit-scrollbar-thumb {\n background-color: var(--color-primary01);\n}\n\n.canvas-container .canvas-content::-webkit-scrollbar-thumb:hover {\n background-color: var(--color-hover-primary);\n}\n\n/* Firefox scrollbar */\n@supports not selector(.canvas-content::-webkit-scrollbar-track) {\n .canvas-container .canvas-content {\n scrollbar-color: var(--color-primary01) transparent;\n }\n}\n\n/* Tablet / Desktop */\n@media (min-width: 768px) {\n :host([variant=\"pushcontent\"]:not([transitiondirection=\"up\"])) {\n flex: none; /* Prevent unwanted width changes in flex containers */\n }\n\n .canvas-container {\n width: max(var(--z-offcanvas--container-width, 375px), 375px);\n min-width: 375px;\n }\n\n :host([transitiondirection=\"up\"]) > .canvas-container {\n width: 100%;\n }\n\n :host([transitiondirection=\"right\"]) > .canvas-container {\n right: auto;\n left: 0;\n }\n\n :host([transitiondirection=\"left\"]) > .canvas-container {\n right: 0;\n left: auto;\n }\n}\n","import {Component, Event, EventEmitter, h, Host, Listen, Prop, State, Watch} from \"@stencil/core\";\nimport {OffCanvasVariant, TransitionDirection} from \"../../beans\";\n\n/**\n * @slot canvasContent - Slot for the offcanvas content.\n * @cssprop --z-offcanvas--top-space - Top offset of the offcanvas, for `overlay` variant. Useful when there is some fixed element above the offcanvas. Default: `0`.\n * @cssprop --z-offcanvas--container-width - Width of the offcanvas for `left` and `right` direction. Default: `375px`.\n * @cssprop --z-offcanvas--container-height - Height of the offcanvas for `up` direction. Default: `90%`.\n */\n@Component({\n tag: \"z-offcanvas\",\n styleUrl: \"styles.css\",\n shadow: false,\n scoped: true,\n})\nexport class ZOffcanvas {\n /**\n * Offcanvas variant.\n * - `overlay`: The offcanvas covers the page content putting an overlay.\n * - `pushcontent`: The offcanvas isn't absolutely positioned and \"pushes\" the page content.\n * > NB: `pushcontent` variant may need some extra style tuning of the context around the component to work properly.\n * Also, the `pushcontent` variant doesn't have the open/close transition.\n */\n @Prop({reflect: true})\n variant?: OffCanvasVariant = OffCanvasVariant.PUSHCONTENT;\n\n /** Whether the offcanvas is open. Default: false */\n @Prop({reflect: true, mutable: true})\n open = false;\n\n /**\n * Open the content transitioning to a specified direction.\n * The `up` direction always show the `overlay`, also when the variant is `pushcontent`.\n */\n @Prop({reflect: true})\n transitiondirection?: TransitionDirection = TransitionDirection.LEFT;\n\n /**\n * Skip the opening transition when the offcanvas is already open at the first render.\n * @deprecated This prop is not needed anymore, the component will automatically skip the transition\n * when it starts with `open` set to `true`. Only exists for Typescript backward compatibility.\n */\n @Prop()\n skipLoadAnimation = false;\n\n /** emitted when `open` prop changes */\n @Event()\n canvasOpenStatusChanged: EventEmitter;\n\n /** Used to skip the opening transition when the offcanvas is already open at the first render. */\n @State()\n private skipAnimation = false;\n\n private canvasContainer: HTMLElement;\n\n /**\n * Stop the event default behavior and propagation when the offcanvas is closed.\n */\n @Listen(\"click\", {capture: true})\n @Listen(\"focusin\", {capture: true})\n stopEvent(event: Event): void {\n if (this.open) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n }\n\n /**\n * Hide the body overflow when the offcanvas is open.\n */\n @Watch(\"variant\")\n private handlePageOverflow(): void {\n const overflow =\n this.variant === OffCanvasVariant.OVERLAY || this.transitiondirection === TransitionDirection.UP\n ? \"overflow-y\"\n : \"overflow-x\";\n\n document.body.style[overflow] = this.open ? \"hidden\" : \"\";\n }\n\n @Watch(\"open\")\n onOpenChanged(): void {\n this.canvasOpenStatusChanged.emit(this.open);\n\n if (!this.open) {\n // when the offcanvas is closing, wait for the transitionend event to end before handling the body overflow\n const listenerCallback = (): void => {\n this.handlePageOverflow();\n this.canvasContainer.removeEventListener(\"transitionend\", listenerCallback);\n };\n\n this.canvasContainer?.addEventListener(\"transitionend\", listenerCallback);\n } else {\n this.handlePageOverflow();\n }\n }\n\n componentWillLoad(): void {\n if (this.open) {\n this.skipAnimation = true;\n }\n }\n\n componentDidLoad(): void {\n this.handlePageOverflow();\n }\n\n componentDidRender(): void {\n this.skipAnimation = false;\n }\n\n connectedCallback(): void {\n this.handlePageOverflow();\n }\n\n disconnectedCallback(): void {\n this.open = false;\n }\n\n render(): HTMLZOffcanvasElement {\n return (\n <Host\n skip-animation={this.skipAnimation}\n aria-hidden={!this.open ? \"true\" : null}\n >\n <div\n class=\"canvas-container\"\n role=\"presentation\"\n ref={(el) => (this.canvasContainer = el)}\n >\n <div\n class=\"canvas-content\"\n role=\"presentation\"\n >\n <slot name=\"canvasContent\"></slot>\n </div>\n </div>\n {(this.variant == OffCanvasVariant.OVERLAY || this.transitiondirection === TransitionDirection.UP) && (\n <div\n class=\"canvas-background\"\n onClick={() => (this.open = false)}\n ></div>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
@@ -3,7 +3,7 @@ import { g as KeyboardCode } from './index2.js';
3
3
  import { a as containsElement } from './utils.js';
4
4
  import { d as defineCustomElement$2 } from './index9.js';
5
5
 
6
- const stylesCss = ":host,::slotted(*),*{box-sizing:border-box;outline:none}:host{position:relative;display:inline-flex;height:fit-content;flex-direction:column}::slotted(a){text-decoration:none}::slotted(*){color:var(--color-default-text);font-family:var(--font-family-sans);font-weight:var(--font-rg)}.menu-label{position:relative;display:flex;width:100%;align-items:center;padding:0;border:0;border-bottom:var(--border-size-large) solid transparent;margin:0;background:transparent;border-radius:0;color:inherit;text-align:left}button.menu-label{cursor:pointer}.menu-label:focus-visible,div.menu-label:focus-within{box-shadow:var(--shadow-focus-primary)}:host(:is([active],[open])) .menu-label ::slotted(*),.menu-label:focus-visible ::slotted(*),div.menu-label:focus-within ::slotted(*){color:var(--color-primary01);font-weight:var(--font-bd)}:host([vertical-context]) .menu-label{padding:var(--space-unit) 0;border-width:var(--border-size-small);border-color:var(--color-surface03)}:host(:is([active],[open])) .menu-label,.menu-label:hover,.menu-label:focus-visible,div.menu-label:focus-within{border-color:var(--color-secondary01)}:host([vertical-context]:is([active],[open])) .menu-label::after,:host([vertical-context]) .menu-label:hover::after,:host([vertical-context]) .menu-label:focus-visible::after,:host([vertical-context]) div.menu-label:focus-within::after{position:absolute;bottom:0;left:0;width:100%;height:var(--border-size-large);background-color:var(--color-secondary01);content:\"\"}:host([vertical-context]) .menu-label ::slotted(*){padding:0}.menu-label ::slotted(*){display:inline-flex;width:100%;min-width:fit-content;padding-bottom:2px;margin:0;appearance:none;color:var(--z-menu-label-color, var(--color-default-text));font-family:var(--font-family-sans);font-size:var(--font-size-3);font-weight:inherit;line-height:1.5}.menu-label z-icon{margin-left:calc(var(--space-unit) * 1.5);fill:var(--color-default-icon)}::slotted([data-text]:not([slot]))::after{height:0;content:attr(data-text);content:attr(data-text) / \"\";font-weight:var(--font-bd);letter-spacing:normal;pointer-events:none;user-select:none;visibility:hidden}@media speech{::slotted([data-text]:not([slot]))::after{display:none}}::slotted([data-text]:not([slot])){display:inline-flex;flex-direction:column}.content{background:var(--color-surface01)}:host(:not([open])) .content{display:none}:host([floating]:not([vertical-context])) .content{position:absolute;top:100%;left:0;width:375px;min-width:100%;max-width:100vw;padding:0 calc(var(--space-unit) * 2);box-shadow:var(--shadow-2)}:host(:not([floating])) .content{width:100%}.header{display:flex;align-items:center;padding:var(--space-unit) 0 calc(var(--space-unit) * 2)}.header ::slotted(img[slot=\"header\"]){width:calc(var(--space-unit) * 11.25);height:auto;object-fit:contain}.header ::slotted([slot=\"header\"]:not(:first-child)){margin:auto 0;margin-left:calc(var(--space-unit) * 2.5);font-size:var(--font-size-3);font-weight:var(--font-sb);line-height:1.5}.items{display:flex;flex-direction:column;align-items:flex-start;background:inherit}.items>::slotted([slot=\"item\"]){width:100%;margin:0;font-size:var(--font-size-3);line-height:1.5}.items>::slotted([slot=\"item\"]:focus:focus-visible){box-shadow:var(--shadow-focus-primary)}.items>::slotted([slot=\"item\"]:not(z-menu-section)){padding:var(--space-unit) 0;border-bottom:var(--border-size-small) solid var(--color-surface03)}:host(:not([vertical-context])) .items>::slotted([slot=\"item\"]:last-child){border-bottom:0}.items>::slotted([slot=\"item\"]:hover),.items>::slotted([slot=\"item\"]:focus:focus-visible),.items>::slotted([slot=\"item\"]:active){border-color:var(--color-secondary01);font-weight:var(--font-bd)}";
6
+ const stylesCss = ":host,::slotted(*),*{box-sizing:border-box;outline:none}:host{position:relative;display:inline-flex;height:fit-content;flex-direction:column}::slotted(a){text-decoration:none}::slotted(*){color:var(--color-default-text);font-family:var(--font-family-sans);font-weight:var(--font-rg)}.menu-label{position:relative;display:flex;width:100%;align-items:center;padding:0;border:0;border-bottom:var(--border-size-large) solid transparent;margin:0;background:transparent;border-radius:0;color:inherit;text-align:left}button.menu-label{cursor:pointer}.menu-label:focus-visible,div.menu-label:focus-within{box-shadow:var(--shadow-focus-primary)}:host(:is([active],[open])) .menu-label ::slotted(*),.menu-label:focus-visible ::slotted(*),div.menu-label:focus-within ::slotted(*){color:var(--color-primary01);font-weight:var(--font-bd)}:host([vertical-context]) .menu-label{padding:var(--space-unit) 0;border-width:var(--border-size-small);border-color:var(--color-surface03)}:host(:is([active],[open])) .menu-label,.menu-label:hover,.menu-label:focus-visible,div.menu-label:focus-within{border-color:var(--color-secondary01)}:host([vertical-context]:is([active],[open])) .menu-label::after,:host([vertical-context]) .menu-label:hover::after,:host([vertical-context]) .menu-label:focus-visible::after,:host([vertical-context]) div.menu-label:focus-within::after{position:absolute;bottom:0;left:0;width:100%;height:var(--border-size-large);background-color:var(--color-secondary01);content:\"\"}:host([vertical-context]) .menu-label ::slotted(*){padding:0}.menu-label ::slotted(*){display:inline-flex;width:100%;min-width:fit-content;padding-bottom:2px;margin:0;appearance:none;color:var(--z-menu-label-color, var(--color-default-text));font-family:var(--font-family-sans);font-size:var(--font-size-3);font-weight:inherit;line-height:1.5;white-space:nowrap}.menu-label z-icon{margin-left:calc(var(--space-unit) * 1.5);fill:var(--color-default-icon)}::slotted([data-text]:not([slot]))::after{height:0;content:attr(data-text);content:attr(data-text) / \"\";font-weight:var(--font-bd);letter-spacing:normal;pointer-events:none;user-select:none;visibility:hidden}@media speech{::slotted([data-text]:not([slot]))::after{display:none}}::slotted([data-text]:not([slot])){display:inline-flex;flex-direction:column}.content{background:var(--color-surface01)}:host(:not([open])) .content{display:none}:host([floating]:not([vertical-context])) .content{position:absolute;top:100%;left:0;width:375px;min-width:100%;max-width:100vw;padding:0 calc(var(--space-unit) * 2);box-shadow:var(--shadow-2)}:host(:not([floating])) .content{width:100%}.header{display:flex;align-items:center;padding:var(--space-unit) 0 calc(var(--space-unit) * 2)}.header ::slotted(img[slot=\"header\"]){width:calc(var(--space-unit) * 11.25);height:auto;object-fit:contain}.header ::slotted([slot=\"header\"]:not(:first-child)){margin:auto 0;margin-left:calc(var(--space-unit) * 2.5);font-size:var(--font-size-3);font-weight:var(--font-sb);line-height:1.5}.items{display:flex;flex-direction:column;align-items:flex-start;background:inherit}.items>::slotted([slot=\"item\"]){width:100%;margin:0;font-size:var(--font-size-3);line-height:1.5}.items>::slotted([slot=\"item\"]:focus:focus-visible){box-shadow:var(--shadow-focus-primary)}.items>::slotted([slot=\"item\"]:not(z-menu-section)){padding:var(--space-unit) 0;border-bottom:var(--border-size-small) solid var(--color-surface03)}:host(:not([vertical-context])) .items>::slotted([slot=\"item\"]:last-child){border-bottom:0}.items>::slotted([slot=\"item\"]:hover),.items>::slotted([slot=\"item\"]:focus:focus-visible),.items>::slotted([slot=\"item\"]:active){border-color:var(--color-secondary01);font-weight:var(--font-bd)}";
7
7
  const ZMenuStyle0 = stylesCss;
8
8
 
9
9
  const isZMenuSection = (el) => (el === null || el === void 0 ? void 0 : el.tagName) === "Z-MENU-SECTION";
@@ -1 +1 @@
1
- {"file":"z-menu.js","mappings":";;;;;AAAA,MAAM,SAAS,GAAG,0nHAA0nH,CAAC;AAC7oH,oBAAe,SAAS;;ACGxB,MAAM,cAAc,GAAG,CAAC,EAAyC,KAC/D,CAAA,EAAE,aAAF,EAAE,uBAAF,EAAE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C,IAAI,QACH,cACE,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC,EACpC,KAAK,EAAC,YAAY,mBACH,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,mBAChB,GAAG,IAAI,CAAC,UAAU,EAAE,gBACvB,IAAI,CAAC,IAAI,GAAG,aAAa,GAAG,WAAW,EACnD,IAAI,EAAC,UAAU,EACf,QAAQ,EAAE,IAAI,CAAC,YAAY,EAC3B,OAAO,EAAE,IAAI,CAAC,YAAY,EAC1B,SAAS,EAAE,IAAI,CAAC,cAAc,IAE9B,YAAM,YAAY,EAAE,IAAI,CAAC,iBAAiB,GAAI,EAC9C,cAAQ,IAAI,EAAE,IAAI,CAAC,IAAI,GAAG,YAAY,GAAG,cAAc,GAAI,CACpD,EAET,WACE,KAAK,EAAC,SAAS,EACf,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,IAE/B,IAAI,CAAC,SAAS,KACb,cAAQ,KAAK,EAAC,QAAQ,IACpB,YACE,IAAI,EAAC,QAAQ,EACb,YAAY,EAAE,IAAI,CAAC,YAAY,GAC/B,CACK,CACV,EAED,WACE,KAAK,EAAC,OAAO,EACb,IAAI,EAAC,MAAM,IAEX,YACE,IAAI,EAAC,MAAM,EACX,YAAY,EAAE,IAAI,CAAC,aAAa,GAChC,CACE,CACF,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["ZMenu"],"sources":["src/components/z-menu/styles.css?tag=z-menu&encapsulation=shadow","src/components/z-menu/index.tsx"],"sourcesContent":[":host,\n::slotted(*),\n* {\n box-sizing: border-box;\n outline: none;\n}\n\n:host {\n --z-menu-label-color: ;\n\n position: relative;\n display: inline-flex;\n height: fit-content;\n flex-direction: column;\n}\n\n::slotted(a) {\n text-decoration: none;\n}\n\n::slotted(*) {\n color: var(--color-default-text);\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n}\n\n.menu-label {\n position: relative;\n display: flex;\n width: 100%;\n align-items: center;\n padding: 0;\n border: 0;\n border-bottom: var(--border-size-large) solid transparent;\n margin: 0;\n background: transparent;\n border-radius: 0;\n color: inherit;\n text-align: left;\n}\n\nbutton.menu-label {\n cursor: pointer;\n}\n\n.menu-label:focus-visible,\ndiv.menu-label:focus-within {\n box-shadow: var(--shadow-focus-primary);\n}\n\n:host(:is([active], [open])) .menu-label ::slotted(*),\n.menu-label:focus-visible ::slotted(*),\ndiv.menu-label:focus-within ::slotted(*) {\n color: var(--color-primary01);\n font-weight: var(--font-bd);\n}\n\n:host([vertical-context]) .menu-label {\n padding: var(--space-unit) 0;\n border-width: var(--border-size-small);\n border-color: var(--color-surface03);\n}\n\n:host(:is([active], [open])) .menu-label,\n.menu-label:hover,\n.menu-label:focus-visible,\ndiv.menu-label:focus-within {\n border-color: var(--color-secondary01);\n}\n\n:host([vertical-context]:is([active], [open])) .menu-label::after,\n:host([vertical-context]) .menu-label:hover::after,\n:host([vertical-context]) .menu-label:focus-visible::after,\n:host([vertical-context]) div.menu-label:focus-within::after {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n height: var(--border-size-large);\n background-color: var(--color-secondary01);\n content: \"\";\n}\n\n:host([vertical-context]) .menu-label ::slotted(*) {\n padding: 0;\n}\n\n.menu-label ::slotted(*) {\n display: inline-flex;\n width: 100%;\n min-width: fit-content;\n padding-bottom: 2px;\n margin: 0;\n appearance: none;\n color: var(--z-menu-label-color, var(--color-default-text));\n font-family: var(--font-family-sans);\n font-size: var(--font-size-3);\n font-weight: inherit;\n line-height: 1.5;\n}\n\n.menu-label z-icon {\n margin-left: calc(var(--space-unit) * 1.5);\n fill: var(--color-default-icon);\n}\n\n/* Prevents layout shifts on font-weight changes.\nThe trick is to put an hidden copy of the text already set to bold,\nso the needed space is correctly calculated before any hover/active state changes the\nfont-weight of the real text.\nThe hidden text has an height of 0px so it can expand the width without changing the height\nwhen placed below the real text using `flex-direction: column`. */\n::slotted([data-text]:not([slot]))::after {\n height: 0;\n content: attr(data-text);\n content: attr(data-text) / \"\";\n font-weight: var(--font-bd);\n letter-spacing: normal;\n pointer-events: none;\n user-select: none;\n visibility: hidden;\n}\n\n@media speech {\n ::slotted([data-text]:not([slot]))::after {\n display: none;\n }\n}\n\n::slotted([data-text]:not([slot])) {\n display: inline-flex;\n flex-direction: column;\n}\n\n.content {\n background: var(--color-surface01);\n}\n\n:host(:not([open])) .content {\n display: none;\n}\n\n:host([floating]:not([vertical-context])) .content {\n position: absolute;\n top: 100%;\n left: 0;\n width: 375px;\n min-width: 100%;\n max-width: 100vw;\n padding: 0 calc(var(--space-unit) * 2);\n box-shadow: var(--shadow-2);\n}\n\n:host(:not([floating])) .content {\n width: 100%;\n}\n\n.header {\n display: flex;\n align-items: center;\n padding: var(--space-unit) 0 calc(var(--space-unit) * 2);\n}\n\n.header ::slotted(img[slot=\"header\"]) {\n width: calc(var(--space-unit) * 11.25);\n height: auto;\n object-fit: contain;\n}\n\n.header ::slotted([slot=\"header\"]:not(:first-child)) {\n margin: auto 0;\n margin-left: calc(var(--space-unit) * 2.5);\n font-size: var(--font-size-3);\n font-weight: var(--font-sb);\n line-height: 1.5;\n}\n\n.items {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n background: inherit;\n}\n\n.items > ::slotted([slot=\"item\"]) {\n width: 100%;\n margin: 0;\n font-size: var(--font-size-3);\n line-height: 1.5;\n}\n\n.items > ::slotted([slot=\"item\"]:focus:focus-visible) {\n box-shadow: var(--shadow-focus-primary);\n}\n\n.items > ::slotted([slot=\"item\"]:not(z-menu-section)) {\n padding: var(--space-unit) 0;\n border-bottom: var(--border-size-small) solid var(--color-surface03);\n}\n\n:host(:not([vertical-context])) .items > ::slotted([slot=\"item\"]:last-child) {\n border-bottom: 0;\n}\n\n.items > ::slotted([slot=\"item\"]:hover),\n.items > ::slotted([slot=\"item\"]:focus:focus-visible),\n.items > ::slotted([slot=\"item\"]:active) {\n border-color: var(--color-secondary01);\n font-weight: var(--font-bd);\n}\n","import {Component, Element, Event, EventEmitter, Host, Listen, Method, Prop, State, Watch, h} from \"@stencil/core\";\nimport {KeyboardCode} from \"../../beans\";\nimport {containsElement} from \"../../utils/utils\";\n\nconst isZMenuSection = (el: HTMLElement | HTMLZMenuSectionElement): el is HTMLZMenuSectionElement =>\n el?.tagName === \"Z-MENU-SECTION\";\n\n/**\n * @slot - Menu label\n * @slot header - Header to display as the first entry of the open menu.\n * @slot item - Single entry of the section. Can be slotted multiple times to insert items onto the menu. Set the `active` HTML attribute on the element to highlight it. Use `z-menu-section` for submenus.\n * @cssprop --z-menu-label-color - Color of the label's text.\n */\n@Component({\n tag: \"z-menu\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZMenu {\n @Element() host: HTMLZMenuElement;\n\n /** Flag to set the active status of the menu. */\n @Prop({reflect: true})\n active?: boolean;\n\n /**\n * Flag to set the display mode of the list.\n * If true, the list will be absolutely positioned under the menu label,\n * stacked beneath it otherwise.\n */\n @Prop({reflect: true})\n floating? = true;\n\n /** The opening state of the menu. */\n @Prop({mutable: true, reflect: true})\n open = false;\n\n /**\n * Tells the component that it's placed in a vertical context with other `ZMenu`s (usually in the ZAppHeader's offcanvas).\n * A small border is placed under it as a separator from other elements.\n */\n @Prop({reflect: true})\n verticalContext = false;\n\n /**\n * Tabindex value to set on the menu label.\n * Useful to manage keyboard navigation focus with roving tabindex handled by this component's parent (usually ZAppHeader).\n */\n @Prop()\n htmlTabindex = -1;\n\n @State()\n hasHeader: boolean;\n\n @State()\n hasContent: boolean;\n\n /** The menu has been opened. */\n @Event()\n opened: EventEmitter;\n\n /** The menu has been closed. */\n @Event()\n closed: EventEmitter;\n\n private labelButton: HTMLButtonElement;\n\n private content: HTMLElement;\n\n private items: (HTMLElement | HTMLZMenuSectionElement)[] = [];\n\n /** Animation frame request id. */\n private raf: number;\n\n private get focusableItem(): HTMLZMenuSectionElement | HTMLElement | null {\n return this.items.find((item) => (isZMenuSection(item) ? item.htmlTabindex === 0 : item.tabIndex === 0));\n }\n\n private toggle(): void {\n if (!this.hasContent) {\n return;\n }\n\n this.open = !this.open;\n }\n\n /**\n * Sets slotted item text as `data-text` attribute value, to let CSS use it through `attr()`.\n * @param ev Slotchange event\n */\n private onLabelSlotChange(ev: Event): void {\n const labelElement = (ev.target as HTMLSlotElement).assignedElements()[0] as HTMLElement;\n labelElement.dataset.text = labelElement?.textContent;\n this.setLabelA11yAttrs();\n }\n\n /**\n * Correctly set position of the floating menu in order to prevent overflow.\n * @param live Should run the method on every refresh frame.\n */\n private reflow(live = false): void {\n if (!this.floating) {\n return;\n }\n\n if (this.content && this.hasContent) {\n const {style} = this.content;\n const {left} = this.host.getBoundingClientRect();\n const widthPx = getComputedStyle(this.content).width;\n const width = widthPx ? parseFloat(widthPx.replace(\"px\", \"\")) : 375;\n const safeScrollbarSpace = 30;\n style.left = `${Math.min(window.innerWidth - left - width - safeScrollbarSpace, 0)}px`;\n }\n if (live) {\n this.raf = requestAnimationFrame(this.reflow.bind(this, live));\n }\n }\n\n /**\n * Check if some content slot is set.\n */\n private checkContent(): void {\n this.hasHeader = !!this.host.querySelectorAll(\"[slot=header]\").length;\n this.hasContent = !!this.host.querySelectorAll(\"[slot=item]\").length || this.hasHeader;\n }\n\n private setItemTabindex(item: HTMLElement | HTMLZMenuSectionElement, tabIndex: number): void {\n if (isZMenuSection(item)) {\n item.htmlTabindex = tabIndex;\n } else {\n item.tabIndex = tabIndex;\n }\n }\n\n /**\n * Set `menuitem` role to all menu items (ZMenuSection items already have it).\n * Set -1 to the tabindex of the items and 0 to the first one.\n */\n private setItemsA11yAttrs(): void {\n this.items.forEach((item, index) => {\n const tabindex = index === 0 ? 0 : -1;\n this.setItemTabindex(item, tabindex);\n if (!isZMenuSection(item)) {\n item.setAttribute(\"role\", \"menuitem\");\n }\n });\n }\n\n private onItemsChange(): void {\n this.checkContent();\n this.items = Array.from(this.host.children).filter(({slot}) => slot === \"item\") as HTMLElement[];\n this.setItemsA11yAttrs();\n this.items.forEach((item) => {\n if (!isZMenuSection(item)) {\n item.dataset.text = item.textContent;\n }\n });\n }\n\n /**\n * Move focus and adjust the tabindex value of `receiver` and `current` elements,\n * setting -1 to the `current` and 0 to the `receiver`, then focus the `receiver` element.\n * If the receiver is a ZMenuSection and it's open, focus its first focusable item.\n */\n private moveFocus(\n receiver: HTMLElement | HTMLZMenuSectionElement,\n current?: HTMLElement | HTMLZMenuSectionElement\n ): void {\n if (isZMenuSection(receiver)) {\n receiver.setFocus();\n } else {\n receiver.tabIndex = 0;\n setTimeout(() => {\n receiver.focus();\n }, 100);\n }\n if (!current) {\n return;\n }\n\n this.setItemTabindex(current, -1);\n }\n\n private onLabelClick(): void {\n this.toggle();\n this.setFocus();\n }\n\n private onLabelKeydown(ev: KeyboardEvent): void {\n if (ev.key === KeyboardCode.ENTER || ev.key === KeyboardCode.SPACE) {\n ev.preventDefault();\n ev.stopPropagation();\n this.toggle();\n if (this.open) {\n this.moveFocus(this.items[0]);\n }\n\n return;\n }\n\n if (!this.verticalContext) {\n return;\n }\n\n if (ev.key === KeyboardCode.ARROW_RIGHT && !this.open) {\n ev.preventDefault();\n ev.stopPropagation();\n this.open = true;\n this.moveFocus(this.items[0]);\n }\n }\n\n /** Set tabindex of the label to 0, then focus it. */\n @Method()\n async setFocus(): Promise<void> {\n this.htmlTabindex = 0;\n const label = this.hasContent ? this.labelButton : (this.host.firstElementChild as HTMLElement);\n label.focus();\n }\n\n /**\n * Focus the last item.\n */\n @Method()\n async focusLastItem(): Promise<void> {\n const lastItem = this.items[this.items.length - 1];\n if (isZMenuSection(lastItem) && lastItem.open) {\n lastItem.focusLastItem();\n\n return;\n }\n\n this.moveFocus(lastItem);\n }\n\n @Watch(\"open\")\n onOpenChanged(): void {\n if (!this.open) {\n cancelAnimationFrame(this.raf);\n this.closed.emit();\n this.items.forEach((item) => {\n if (isZMenuSection(item) && item.open) {\n item.open = false;\n }\n });\n\n return;\n }\n\n this.setItemsA11yAttrs();\n this.opened.emit();\n if (this.floating) {\n this.reflow(true);\n }\n }\n\n @Watch(\"htmlTabindex\")\n setLabelA11yAttrs(): void {\n if (this.hasContent && this.labelButton) {\n this.labelButton.tabIndex = this.htmlTabindex;\n\n return;\n }\n\n const slottedLabel = this.host.firstElementChild as HTMLElement;\n slottedLabel.role = \"menuitem\";\n slottedLabel.tabIndex = this.htmlTabindex;\n }\n\n /**\n * Set tabindex to -1 to all siblings of the clicked item.\n */\n @Listen(\"click\", {target: \"document\"})\n onItemClick(ev: MouseEvent): void {\n const clickedItem = this.items.find((item) => containsElement(item, ev.target as HTMLElement));\n if (clickedItem) {\n this.items.forEach((item) => {\n if (item === clickedItem) {\n return;\n }\n\n if (isZMenuSection(item)) {\n item.htmlTabindex = -1;\n } else {\n item.tabIndex = -1;\n }\n });\n }\n }\n\n @Listen(\"keydown\")\n onKeyDown(ev: KeyboardEvent): void {\n if (!this.hasContent) {\n return;\n }\n\n switch (ev.key) {\n case KeyboardCode.ESC:\n if (!this.open) {\n break;\n }\n ev.stopPropagation();\n ev.preventDefault();\n this.open = false;\n this.setFocus();\n break;\n case KeyboardCode.ARROW_DOWN: {\n if (document.activeElement === this.host) {\n if (this.verticalContext && !this.open) {\n break;\n }\n\n ev.stopPropagation();\n ev.preventDefault();\n if (!this.open) {\n this.open = true;\n }\n this.moveFocus(this.items[0]);\n break;\n }\n\n const currentIndex = this.items.indexOf(this.focusableItem);\n if (this.verticalContext && currentIndex === this.items.length - 1) {\n // navigation is going to leave this menu. restore tabindex to the label and let the parent handle it\n this.setItemTabindex(this.items[currentIndex], -1);\n this.htmlTabindex = 0;\n break;\n }\n\n ev.stopPropagation();\n ev.preventDefault();\n const receiver = this.items[currentIndex + 1];\n // if the last item is already focused, navigate to the first one\n this.moveFocus(receiver ?? this.items[0], this.focusableItem);\n break;\n }\n case KeyboardCode.ARROW_UP: {\n if (document.activeElement === this.host) {\n if (this.verticalContext) {\n break;\n }\n\n ev.stopPropagation();\n ev.preventDefault();\n // open the menu and focus the last item\n if (!this.open) {\n this.open = true;\n }\n this.moveFocus(this.items[this.items.length - 1], this.focusableItem);\n break;\n }\n\n ev.stopPropagation();\n ev.preventDefault();\n const currentIndex = this.items.indexOf(this.focusableItem);\n if (currentIndex === 0 && this.verticalContext) {\n this.setItemTabindex(this.focusableItem, -1);\n this.setFocus();\n break;\n }\n\n const receiver = this.items[currentIndex - 1] ?? this.items[this.items.length - 1];\n // if the receiver is a ZMenuSection and it's open, focus its last item\n if (isZMenuSection(receiver) && receiver.open) {\n this.setItemTabindex(this.focusableItem, -1);\n receiver.focusLastItem();\n break;\n }\n\n this.moveFocus(receiver, this.focusableItem);\n break;\n }\n case KeyboardCode.ARROW_LEFT:\n if (!this.open || !this.verticalContext) {\n break;\n }\n\n // close the menu and focus the label\n ev.preventDefault();\n ev.stopPropagation();\n this.open = false;\n this.setFocus();\n }\n }\n\n constructor() {\n this.toggle = this.toggle.bind(this);\n this.checkContent = this.checkContent.bind(this);\n this.onLabelSlotChange = this.onLabelSlotChange.bind(this);\n this.onLabelClick = this.onLabelClick.bind(this);\n this.onItemsChange = this.onItemsChange.bind(this);\n this.onLabelKeydown = this.onLabelKeydown.bind(this);\n }\n\n componentWillLoad(): void {\n this.setLabelA11yAttrs();\n this.onItemsChange();\n }\n\n render(): HTMLDivElement | HTMLZMenuElement {\n if (!this.hasContent) {\n return (\n <div class=\"menu-label\">\n <slot onSlotchange={this.onLabelSlotChange} />\n </div>\n );\n }\n\n return (\n <Host>\n <button\n ref={(el) => (this.labelButton = el)}\n class=\"menu-label\"\n aria-expanded={`${!!this.open}`}\n aria-haspopup={`${this.hasContent}`}\n aria-label={this.open ? \"Chiudi menù\" : \"Apri menù\"}\n role=\"menuitem\"\n tabIndex={this.htmlTabindex}\n onClick={this.onLabelClick}\n onKeyDown={this.onLabelKeydown}\n >\n <slot onSlotchange={this.onLabelSlotChange} />\n <z-icon name={this.open ? \"chevron-up\" : \"chevron-down\"} />\n </button>\n\n <div\n class=\"content\"\n ref={(el) => (this.content = el)}\n >\n {this.hasHeader && (\n <header class=\"header\">\n <slot\n name=\"header\"\n onSlotchange={this.checkContent}\n />\n </header>\n )}\n\n <div\n class=\"items\"\n role=\"menu\"\n >\n <slot\n name=\"item\"\n onSlotchange={this.onItemsChange}\n />\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"z-menu.js","mappings":";;;;;AAAA,MAAM,SAAS,GAAG,6oHAA6oH,CAAC;AAChqH,oBAAe,SAAS;;ACGxB,MAAM,cAAc,GAAG,CAAC,EAAyC,KAC/D,CAAA,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,OAAO,MAAK,gBAAgB,CAAC;MAatBA,OAAK;IAwDhB,IAAY,aAAa;QACvB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,MAAM,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,YAAY,KAAK,CAAC,GAAG,IAAI,CAAC,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC;KAC1G;IAEO,MAAM;QACZ,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YACpB,OAAO;SACR;QAED,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;KACxB;;;;;IAMO,iBAAiB,CAAC,EAAS;QACjC,MAAM,YAAY,GAAI,EAAE,CAAC,MAA0B,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAgB,CAAC;QACzF,YAAY,CAAC,OAAO,CAAC,IAAI,GAAG,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,WAAW,CAAC;QACtD,IAAI,CAAC,iBAAiB,EAAE,CAAC;KAC1B;;;;;IAMO,MAAM,CAAC,IAAI,GAAG,KAAK;QACzB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,OAAO;SACR;QAED,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,UAAU,EAAE;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I,EAAC,MAAM,EACX,YAAY,EAAE,IAAI,CAAC,aAAa,GAChC,CACE,CACF,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["ZMenu"],"sources":["src/components/z-menu/styles.css?tag=z-menu&encapsulation=shadow","src/components/z-menu/index.tsx"],"sourcesContent":[":host,\n::slotted(*),\n* {\n box-sizing: border-box;\n outline: none;\n}\n\n:host {\n --z-menu-label-color: ;\n\n position: relative;\n display: inline-flex;\n height: fit-content;\n flex-direction: column;\n}\n\n::slotted(a) {\n text-decoration: none;\n}\n\n::slotted(*) {\n color: var(--color-default-text);\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n}\n\n.menu-label {\n position: relative;\n display: flex;\n width: 100%;\n align-items: center;\n padding: 0;\n border: 0;\n border-bottom: var(--border-size-large) solid transparent;\n margin: 0;\n background: transparent;\n border-radius: 0;\n color: inherit;\n text-align: left;\n}\n\nbutton.menu-label {\n cursor: pointer;\n}\n\n.menu-label:focus-visible,\ndiv.menu-label:focus-within {\n box-shadow: var(--shadow-focus-primary);\n}\n\n:host(:is([active], [open])) .menu-label ::slotted(*),\n.menu-label:focus-visible ::slotted(*),\ndiv.menu-label:focus-within ::slotted(*) {\n color: var(--color-primary01);\n font-weight: var(--font-bd);\n}\n\n:host([vertical-context]) .menu-label {\n padding: var(--space-unit) 0;\n border-width: var(--border-size-small);\n border-color: var(--color-surface03);\n}\n\n:host(:is([active], [open])) .menu-label,\n.menu-label:hover,\n.menu-label:focus-visible,\ndiv.menu-label:focus-within {\n border-color: var(--color-secondary01);\n}\n\n:host([vertical-context]:is([active], [open])) .menu-label::after,\n:host([vertical-context]) .menu-label:hover::after,\n:host([vertical-context]) .menu-label:focus-visible::after,\n:host([vertical-context]) div.menu-label:focus-within::after {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n height: var(--border-size-large);\n background-color: var(--color-secondary01);\n content: \"\";\n}\n\n:host([vertical-context]) .menu-label ::slotted(*) {\n padding: 0;\n}\n\n.menu-label ::slotted(*) {\n display: inline-flex;\n width: 100%;\n min-width: fit-content;\n padding-bottom: 2px;\n margin: 0;\n appearance: none;\n color: var(--z-menu-label-color, var(--color-default-text));\n font-family: var(--font-family-sans);\n font-size: var(--font-size-3);\n font-weight: inherit;\n line-height: 1.5;\n white-space: nowrap;\n}\n\n.menu-label z-icon {\n margin-left: calc(var(--space-unit) * 1.5);\n fill: var(--color-default-icon);\n}\n\n/* Prevents layout shifts on font-weight changes.\nThe trick is to put an hidden copy of the text already set to bold,\nso the needed space is correctly calculated before any hover/active state changes the\nfont-weight of the real text.\nThe hidden text has an height of 0px so it can expand the width without changing the height\nwhen placed below the real text using `flex-direction: column`. */\n::slotted([data-text]:not([slot]))::after {\n height: 0;\n content: attr(data-text);\n content: attr(data-text) / \"\";\n font-weight: var(--font-bd);\n letter-spacing: normal;\n pointer-events: none;\n user-select: none;\n visibility: hidden;\n}\n\n@media speech {\n ::slotted([data-text]:not([slot]))::after {\n display: none;\n }\n}\n\n::slotted([data-text]:not([slot])) {\n display: inline-flex;\n flex-direction: column;\n}\n\n.content {\n background: var(--color-surface01);\n}\n\n:host(:not([open])) .content {\n display: none;\n}\n\n:host([floating]:not([vertical-context])) .content {\n position: absolute;\n top: 100%;\n left: 0;\n width: 375px;\n min-width: 100%;\n max-width: 100vw;\n padding: 0 calc(var(--space-unit) * 2);\n box-shadow: var(--shadow-2);\n}\n\n:host(:not([floating])) .content {\n width: 100%;\n}\n\n.header {\n display: flex;\n align-items: center;\n padding: var(--space-unit) 0 calc(var(--space-unit) * 2);\n}\n\n.header ::slotted(img[slot=\"header\"]) {\n width: calc(var(--space-unit) * 11.25);\n height: auto;\n object-fit: contain;\n}\n\n.header ::slotted([slot=\"header\"]:not(:first-child)) {\n margin: auto 0;\n margin-left: calc(var(--space-unit) * 2.5);\n font-size: var(--font-size-3);\n font-weight: var(--font-sb);\n line-height: 1.5;\n}\n\n.items {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n background: inherit;\n}\n\n.items > ::slotted([slot=\"item\"]) {\n width: 100%;\n margin: 0;\n font-size: var(--font-size-3);\n line-height: 1.5;\n}\n\n.items > ::slotted([slot=\"item\"]:focus:focus-visible) {\n box-shadow: var(--shadow-focus-primary);\n}\n\n.items > ::slotted([slot=\"item\"]:not(z-menu-section)) {\n padding: var(--space-unit) 0;\n border-bottom: var(--border-size-small) solid var(--color-surface03);\n}\n\n:host(:not([vertical-context])) .items > ::slotted([slot=\"item\"]:last-child) {\n border-bottom: 0;\n}\n\n.items > ::slotted([slot=\"item\"]:hover),\n.items > ::slotted([slot=\"item\"]:focus:focus-visible),\n.items > ::slotted([slot=\"item\"]:active) {\n border-color: var(--color-secondary01);\n font-weight: var(--font-bd);\n}\n","import {Component, Element, Event, EventEmitter, Host, Listen, Method, Prop, State, Watch, h} from \"@stencil/core\";\nimport {KeyboardCode} from \"../../beans\";\nimport {containsElement} from \"../../utils/utils\";\n\nconst isZMenuSection = (el: HTMLElement | HTMLZMenuSectionElement): el is HTMLZMenuSectionElement =>\n el?.tagName === \"Z-MENU-SECTION\";\n\n/**\n * @slot - Menu label\n * @slot header - Header to display as the first entry of the open menu.\n * @slot item - Single entry of the section. Can be slotted multiple times to insert items onto the menu. Set the `active` HTML attribute on the element to highlight it. Use `z-menu-section` for submenus.\n * @cssprop --z-menu-label-color - Color of the label's text.\n */\n@Component({\n tag: \"z-menu\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZMenu {\n @Element() host: HTMLZMenuElement;\n\n /** Flag to set the active status of the menu. */\n @Prop({reflect: true})\n active?: boolean;\n\n /**\n * Flag to set the display mode of the list.\n * If true, the list will be absolutely positioned under the menu label,\n * stacked beneath it otherwise.\n */\n @Prop({reflect: true})\n floating? = true;\n\n /** The opening state of the menu. */\n @Prop({mutable: true, reflect: true})\n open = false;\n\n /**\n * Tells the component that it's placed in a vertical context with other `ZMenu`s (usually in the ZAppHeader's offcanvas).\n * A small border is placed under it as a separator from other elements.\n */\n @Prop({reflect: true})\n verticalContext = false;\n\n /**\n * Tabindex value to set on the menu label.\n * Useful to manage keyboard navigation focus with roving tabindex handled by this component's parent (usually ZAppHeader).\n */\n @Prop()\n htmlTabindex = -1;\n\n @State()\n hasHeader: boolean;\n\n @State()\n hasContent: boolean;\n\n /** The menu has been opened. */\n @Event()\n opened: EventEmitter;\n\n /** The menu has been closed. */\n @Event()\n closed: EventEmitter;\n\n private labelButton: HTMLButtonElement;\n\n private content: HTMLElement;\n\n private items: (HTMLElement | HTMLZMenuSectionElement)[] = [];\n\n /** Animation frame request id. */\n private raf: number;\n\n private get focusableItem(): HTMLZMenuSectionElement | HTMLElement | null {\n return this.items.find((item) => (isZMenuSection(item) ? item.htmlTabindex === 0 : item.tabIndex === 0));\n }\n\n private toggle(): void {\n if (!this.hasContent) {\n return;\n }\n\n this.open = !this.open;\n }\n\n /**\n * Sets slotted item text as `data-text` attribute value, to let CSS use it through `attr()`.\n * @param ev Slotchange event\n */\n private onLabelSlotChange(ev: Event): void {\n const labelElement = (ev.target as HTMLSlotElement).assignedElements()[0] as HTMLElement;\n labelElement.dataset.text = labelElement?.textContent;\n this.setLabelA11yAttrs();\n }\n\n /**\n * Correctly set position of the floating menu in order to prevent overflow.\n * @param live Should run the method on every refresh frame.\n */\n private reflow(live = false): void {\n if (!this.floating) {\n return;\n }\n\n if (this.content && this.hasContent) {\n const {style} = this.content;\n const {left} = this.host.getBoundingClientRect();\n const widthPx = getComputedStyle(this.content).width;\n const width = widthPx ? parseFloat(widthPx.replace(\"px\", \"\")) : 375;\n const safeScrollbarSpace = 30;\n style.left = `${Math.min(window.innerWidth - left - width - safeScrollbarSpace, 0)}px`;\n }\n if (live) {\n this.raf = requestAnimationFrame(this.reflow.bind(this, live));\n }\n }\n\n /**\n * Check if some content slot is set.\n */\n private checkContent(): void {\n this.hasHeader = !!this.host.querySelectorAll(\"[slot=header]\").length;\n this.hasContent = !!this.host.querySelectorAll(\"[slot=item]\").length || this.hasHeader;\n }\n\n private setItemTabindex(item: HTMLElement | HTMLZMenuSectionElement, tabIndex: number): void {\n if (isZMenuSection(item)) {\n item.htmlTabindex = tabIndex;\n } else {\n item.tabIndex = tabIndex;\n }\n }\n\n /**\n * Set `menuitem` role to all menu items (ZMenuSection items already have it).\n * Set -1 to the tabindex of the items and 0 to the first one.\n */\n private setItemsA11yAttrs(): void {\n this.items.forEach((item, index) => {\n const tabindex = index === 0 ? 0 : -1;\n this.setItemTabindex(item, tabindex);\n if (!isZMenuSection(item)) {\n item.setAttribute(\"role\", \"menuitem\");\n }\n });\n }\n\n private onItemsChange(): void {\n this.checkContent();\n this.items = Array.from(this.host.children).filter(({slot}) => slot === \"item\") as HTMLElement[];\n this.setItemsA11yAttrs();\n this.items.forEach((item) => {\n if (!isZMenuSection(item)) {\n item.dataset.text = item.textContent;\n }\n });\n }\n\n /**\n * Move focus and adjust the tabindex value of `receiver` and `current` elements,\n * setting -1 to the `current` and 0 to the `receiver`, then focus the `receiver` element.\n * If the receiver is a ZMenuSection and it's open, focus its first focusable item.\n */\n private moveFocus(\n receiver: HTMLElement | HTMLZMenuSectionElement,\n current?: HTMLElement | HTMLZMenuSectionElement\n ): void {\n if (isZMenuSection(receiver)) {\n receiver.setFocus();\n } else {\n receiver.tabIndex = 0;\n setTimeout(() => {\n receiver.focus();\n }, 100);\n }\n if (!current) {\n return;\n }\n\n this.setItemTabindex(current, -1);\n }\n\n private onLabelClick(): void {\n this.toggle();\n this.setFocus();\n }\n\n private onLabelKeydown(ev: KeyboardEvent): void {\n if (ev.key === KeyboardCode.ENTER || ev.key === KeyboardCode.SPACE) {\n ev.preventDefault();\n ev.stopPropagation();\n this.toggle();\n if (this.open) {\n this.moveFocus(this.items[0]);\n }\n\n return;\n }\n\n if (!this.verticalContext) {\n return;\n }\n\n if (ev.key === KeyboardCode.ARROW_RIGHT && !this.open) {\n ev.preventDefault();\n ev.stopPropagation();\n this.open = true;\n this.moveFocus(this.items[0]);\n }\n }\n\n /** Set tabindex of the label to 0, then focus it. */\n @Method()\n async setFocus(): Promise<void> {\n this.htmlTabindex = 0;\n const label = this.hasContent ? this.labelButton : (this.host.firstElementChild as HTMLElement);\n label.focus();\n }\n\n /**\n * Focus the last item.\n */\n @Method()\n async focusLastItem(): Promise<void> {\n const lastItem = this.items[this.items.length - 1];\n if (isZMenuSection(lastItem) && lastItem.open) {\n lastItem.focusLastItem();\n\n return;\n }\n\n this.moveFocus(lastItem);\n }\n\n @Watch(\"open\")\n onOpenChanged(): void {\n if (!this.open) {\n cancelAnimationFrame(this.raf);\n this.closed.emit();\n this.items.forEach((item) => {\n if (isZMenuSection(item) && item.open) {\n item.open = false;\n }\n });\n\n return;\n }\n\n this.setItemsA11yAttrs();\n this.opened.emit();\n if (this.floating) {\n this.reflow(true);\n }\n }\n\n @Watch(\"htmlTabindex\")\n setLabelA11yAttrs(): void {\n if (this.hasContent && this.labelButton) {\n this.labelButton.tabIndex = this.htmlTabindex;\n\n return;\n }\n\n const slottedLabel = this.host.firstElementChild as HTMLElement;\n slottedLabel.role = \"menuitem\";\n slottedLabel.tabIndex = this.htmlTabindex;\n }\n\n /**\n * Set tabindex to -1 to all siblings of the clicked item.\n */\n @Listen(\"click\", {target: \"document\"})\n onItemClick(ev: MouseEvent): void {\n const clickedItem = this.items.find((item) => containsElement(item, ev.target as HTMLElement));\n if (clickedItem) {\n this.items.forEach((item) => {\n if (item === clickedItem) {\n return;\n }\n\n if (isZMenuSection(item)) {\n item.htmlTabindex = -1;\n } else {\n item.tabIndex = -1;\n }\n });\n }\n }\n\n @Listen(\"keydown\")\n onKeyDown(ev: KeyboardEvent): void {\n if (!this.hasContent) {\n return;\n }\n\n switch (ev.key) {\n case KeyboardCode.ESC:\n if (!this.open) {\n break;\n }\n ev.stopPropagation();\n ev.preventDefault();\n this.open = false;\n this.setFocus();\n break;\n case KeyboardCode.ARROW_DOWN: {\n if (document.activeElement === this.host) {\n if (this.verticalContext && !this.open) {\n break;\n }\n\n ev.stopPropagation();\n ev.preventDefault();\n if (!this.open) {\n this.open = true;\n }\n this.moveFocus(this.items[0]);\n break;\n }\n\n const currentIndex = this.items.indexOf(this.focusableItem);\n if (this.verticalContext && currentIndex === this.items.length - 1) {\n // navigation is going to leave this menu. restore tabindex to the label and let the parent handle it\n this.setItemTabindex(this.items[currentIndex], -1);\n this.htmlTabindex = 0;\n break;\n }\n\n ev.stopPropagation();\n ev.preventDefault();\n const receiver = this.items[currentIndex + 1];\n // if the last item is already focused, navigate to the first one\n this.moveFocus(receiver ?? this.items[0], this.focusableItem);\n break;\n }\n case KeyboardCode.ARROW_UP: {\n if (document.activeElement === this.host) {\n if (this.verticalContext) {\n break;\n }\n\n ev.stopPropagation();\n ev.preventDefault();\n // open the menu and focus the last item\n if (!this.open) {\n this.open = true;\n }\n this.moveFocus(this.items[this.items.length - 1], this.focusableItem);\n break;\n }\n\n ev.stopPropagation();\n ev.preventDefault();\n const currentIndex = this.items.indexOf(this.focusableItem);\n if (currentIndex === 0 && this.verticalContext) {\n this.setItemTabindex(this.focusableItem, -1);\n this.setFocus();\n break;\n }\n\n const receiver = this.items[currentIndex - 1] ?? this.items[this.items.length - 1];\n // if the receiver is a ZMenuSection and it's open, focus its last item\n if (isZMenuSection(receiver) && receiver.open) {\n this.setItemTabindex(this.focusableItem, -1);\n receiver.focusLastItem();\n break;\n }\n\n this.moveFocus(receiver, this.focusableItem);\n break;\n }\n case KeyboardCode.ARROW_LEFT:\n if (!this.open || !this.verticalContext) {\n break;\n }\n\n // close the menu and focus the label\n ev.preventDefault();\n ev.stopPropagation();\n this.open = false;\n this.setFocus();\n }\n }\n\n constructor() {\n this.toggle = this.toggle.bind(this);\n this.checkContent = this.checkContent.bind(this);\n this.onLabelSlotChange = this.onLabelSlotChange.bind(this);\n this.onLabelClick = this.onLabelClick.bind(this);\n this.onItemsChange = this.onItemsChange.bind(this);\n this.onLabelKeydown = this.onLabelKeydown.bind(this);\n }\n\n componentWillLoad(): void {\n this.setLabelA11yAttrs();\n this.onItemsChange();\n }\n\n render(): HTMLDivElement | HTMLZMenuElement {\n if (!this.hasContent) {\n return (\n <div class=\"menu-label\">\n <slot onSlotchange={this.onLabelSlotChange} />\n </div>\n );\n }\n\n return (\n <Host>\n <button\n ref={(el) => (this.labelButton = el)}\n class=\"menu-label\"\n aria-expanded={`${!!this.open}`}\n aria-haspopup={`${this.hasContent}`}\n aria-label={this.open ? \"Chiudi menù\" : \"Apri menù\"}\n role=\"menuitem\"\n tabIndex={this.htmlTabindex}\n onClick={this.onLabelClick}\n onKeyDown={this.onLabelKeydown}\n >\n <slot onSlotchange={this.onLabelSlotChange} />\n <z-icon name={this.open ? \"chevron-up\" : \"chevron-down\"} />\n </button>\n\n <div\n class=\"content\"\n ref={(el) => (this.content = el)}\n >\n {this.hasHeader && (\n <header class=\"header\">\n <slot\n name=\"header\"\n onSlotchange={this.checkContent}\n />\n </header>\n )}\n\n <div\n class=\"items\"\n role=\"menu\"\n >\n <slot\n name=\"item\"\n onSlotchange={this.onItemsChange}\n />\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -4,7 +4,7 @@ import { d as defineCustomElement$4 } from './index4.js';
4
4
  import { d as defineCustomElement$3 } from './index9.js';
5
5
  import { d as defineCustomElement$2 } from './index22.js';
6
6
 
7
- const stylesCss = ":host{position:relative;display:flex;max-width:100%;align-items:center;padding:var(--z-table--cells-padding, calc(var(--space-unit) * 2));background-color:var(--color-surface01);gap:calc(var(--space-unit) * 2) var(--space-unit)}:host,*{box-sizing:border-box}:host([sticky]){position:sticky;z-index:1;top:0;left:0;box-shadow:8px 0 16px -8px var(--shadow-color-base)}:host([menu-open]){z-index:2}.cell--content{display:flex;width:100%;height:100%;align-items:center}:host([show-menu]) .cell--content{column-gap:var(--space-unit)}.cell--menu-container{margin-left:auto}:host(:not([show-menu])) .cell--menu-container{opacity:0;pointer-events:none}:host(:is([show-menu],[menu-open])) .cell--menu-container,:host([show-menu]) .cell--menu-container:focus-within{z-index:1;opacity:1;pointer-events:all}:host .cell-popover{z-index:100}@media (min-width: 768px) and (hover: hover){:host([show-menu=\"hover\"]) .cell--menu-container{opacity:0;pointer-events:none}:host([show-menu=\"hover\"]:hover) .cell--menu-container{z-index:1;opacity:1;pointer-events:all}}:host{z-index:1;padding:0;background-color:var(--color-surface02);font-weight:var(--font-sb)}.cell--content{padding:calc(var(--space-unit) * 2)}:host([show-sorting]) .cell--content{column-gap:var(--space-unit)}.z-th--sort-button{padding:0;border:none;background-color:transparent;cursor:pointer;outline:none}@media (min-width: 768px) and (hover: hover){:host([show-sorting=\"hover\"]) .z-th--sort-button{opacity:0;pointer-events:none}:host([show-sorting=\"hover\"]:hover) .z-th--sort-button,:host([show-sorting=\"hover\"]) .z-th--sort-button:focus:focus-visible,:host([show-sorting=\"always\"]) .z-th--sort-button,:host([sorted]) .z-th--sort-button{opacity:1;pointer-events:all}}:host([show-sorting=\"hover\"]:hover) .z-th--sort-button::after,:host([show-sorting=\"hover\"]) .z-th--sort-button:focus:focus-visible::after,:host([show-sorting=\"always\"]) .z-th--sort-button::after,:host([sorted]) .z-th--sort-button::after{position:absolute;top:6px;left:6px;width:calc(100% - 12px);height:calc(100% - 10px);background-color:transparent;content:\"\"}:host([sorted]) .z-th--sort-button::after,.z-th--sort-button:focus:focus-visible::after{box-shadow:var(--shadow-focus-primary)}";
7
+ const stylesCss = ":host{position:relative;display:flex;max-width:100%;align-items:center;padding:var(--z-table--cells-padding, calc(var(--space-unit) * 2));background-color:var(--color-surface01);gap:calc(var(--space-unit) * 2) var(--space-unit)}:host,*{box-sizing:border-box}:host([sticky]){position:sticky;z-index:1;top:0;left:0;box-shadow:8px 0 16px -8px var(--shadow-color-base)}:host([menu-open]){z-index:2}.cell--content{display:flex;width:100%;height:100%;align-items:center}:host([show-menu]) .cell--content{column-gap:var(--space-unit)}.cell--menu-container{margin-left:auto}:host(:not([show-menu])) .cell--menu-container{opacity:0;pointer-events:none}:host(:is([show-menu],[menu-open])) .cell--menu-container,:host([show-menu]) .cell--menu-container:focus-within{z-index:1;opacity:1;pointer-events:all}:host .cell-popover{z-index:100}@media (min-width: 768px) and (hover: hover){:host([show-menu=\"hover\"]) .cell--menu-container{opacity:0;pointer-events:none}:host([show-menu=\"hover\"]:hover) .cell--menu-container{z-index:1;opacity:1;pointer-events:all}}:host{z-index:1;padding:0;background-color:var(--color-surface02);font-weight:var(--font-sb)}.cell--content{padding:var(--z-table--cells-padding, calc(var(--space-unit) * 2))}:host([show-sorting]) .cell--content{column-gap:var(--space-unit)}.z-th--sort-button{padding:0;border:none;background-color:transparent;cursor:pointer;outline:none}@media (min-width: 768px) and (hover: hover){:host([show-sorting=\"hover\"]) .z-th--sort-button{opacity:0;pointer-events:none}:host([show-sorting=\"hover\"]:hover) .z-th--sort-button,:host([show-sorting=\"hover\"]) .z-th--sort-button:focus:focus-visible,:host([show-sorting=\"always\"]) .z-th--sort-button,:host([sorted]) .z-th--sort-button{opacity:1;pointer-events:all}}:host([show-sorting=\"hover\"]:hover) .z-th--sort-button::after,:host([show-sorting=\"hover\"]) .z-th--sort-button:focus:focus-visible::after,:host([show-sorting=\"always\"]) .z-th--sort-button::after,:host([sorted]) .z-th--sort-button::after{position:absolute;top:6px;left:6px;width:calc(100% - 12px);height:calc(100% - 10px);background-color:transparent;content:\"\"}:host([sorted]) .z-th--sort-button::after,.z-th--sort-button:focus:focus-visible::after{box-shadow:var(--shadow-focus-primary)}";
8
8
  const ZThStyle0 = stylesCss;
9
9
 
10
10
  const ZTh$1 = /*@__PURE__*/ proxyCustomElement(class ZTh extends HTMLElement {
@@ -1 +1 @@
1
- {"file":"z-th.js","mappings":";;;;;;AAAA,MAAM,SAAS,GAAG,krEAAkrE,CAAC;AACrsE,kBAAe,SAAS;;MCYXA,KAAG;;;;;;;wBAekB,IAAI;2BAQD,IAAI;sBAM9B,KAAK;;sBAYW,KAAK;+BAMZ,eAAe,CAAC,IAAI;0BAMzB,KAAK;;;;;IAiBlB,IAAY,iBAAiB;QAC3B,I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I,GAAG,iBAAiB,GAAG,mBAAmB,EACzF,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,GACV,CACK,CACV,EACA,IAAI,CAAC,QAAQ,KACZ,4DAAK,KAAK,EAAC,sBAAsB,IAC/B,iEACE,OAAO,EAAE,aAAa,CAAC,QAAQ,EAC/B,IAAI,EAAC,iBAAiB,EACtB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,WAAW,GAAG,EAAiB,CAAC,EACnD,OAAO,EAAE,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAC3D,EACF,kEACE,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,SAAS,GAAG,EAAyB,CAAC,EACzD,MAAM,EAAE,IAAI,CAAC,WAAW,EACxB,YAAY,EAAE,CAAC,KAAK,MAAM,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAC9D,QAAQ,EAAE,IAAI,CAAC,eAAe,IAE9B,6DAAM,IAAI,EAAC,iBAAiB,GAAQ,CAC1B,CACR,CACP,CACG,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["ZTh"],"sources":["src/components/table/cells/z-th/styles.css?tag=z-th&encapsulation=shadow","src/components/table/cells/z-th/index.tsx"],"sourcesContent":["@import \"../z-table-cells.css\";\n\n:host {\n z-index: 1;\n padding: 0;\n background-color: var(--color-surface02);\n font-weight: var(--font-sb);\n}\n\n.cell--content {\n padding: calc(var(--space-unit) * 2);\n}\n\n:host([show-sorting]) .cell--content {\n column-gap: var(--space-unit);\n}\n\n.z-th--sort-button {\n padding: 0;\n border: none;\n background-color: transparent;\n cursor: pointer;\n outline: none;\n}\n\n@media (min-width: 768px) and (hover: hover) {\n :host([show-sorting=\"hover\"]) .z-th--sort-button {\n opacity: 0;\n pointer-events: none;\n }\n\n :host([show-sorting=\"hover\"]:hover) .z-th--sort-button,\n :host([show-sorting=\"hover\"]) .z-th--sort-button:focus:focus-visible,\n :host([show-sorting=\"always\"]) .z-th--sort-button,\n :host([sorted]) .z-th--sort-button {\n opacity: 1;\n pointer-events: all;\n }\n}\n\n:host([show-sorting=\"hover\"]:hover) .z-th--sort-button::after,\n:host([show-sorting=\"hover\"]) .z-th--sort-button:focus:focus-visible::after,\n:host([show-sorting=\"always\"]) .z-th--sort-button::after,\n:host([sorted]) .z-th--sort-button::after {\n position: absolute;\n top: 6px;\n left: 6px;\n width: calc(100% - 12px);\n height: calc(100% - 10px);\n background-color: transparent;\n content: \"\";\n}\n\n:host([sorted]) .z-th--sort-button::after,\n.z-th--sort-button:focus:focus-visible::after {\n box-shadow: var(--shadow-focus-primary);\n}\n","import {Component, Element, Event, EventEmitter, Host, Prop, State, Watch, h} from \"@stencil/core\";\nimport {ButtonVariant, ControlSize, PopoverPosition, SortDirection, VisibilityCondition} from \"../../../../beans\";\n\n/**\n * ZTh component.\n * @slot - ZTh content.\n * @slot contextual-menu - Contextual menu content. Only visible when `showMenu` is true.\n */\n@Component({\n tag: \"z-th\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZTh {\n @Element() host: HTMLZThElement;\n\n /**\n * Number of columns that the cell should span.\n */\n @Prop()\n colspan: number;\n\n /**\n * Enables the contextual menu.\n * Can be set to \"hover\" or \"always\" to show the button only on cell hover or always.\n * Set a nullish value to hide the menu button.\n */\n @Prop({reflect: true})\n showMenu: VisibilityCondition = null;\n\n /**\n * Enables the sorting button.\n * Can be set to \"hover\" or \"always\" to show the button only on cell hover or always.\n * Set a nullish value to hide the sort button.\n */\n @Prop({reflect: true})\n showSorting: VisibilityCondition = null;\n\n /**\n * Whether the cell should stick.\n */\n @Prop({reflect: true})\n sticky = false;\n\n /**\n * Current sorting direction.\n */\n @Prop({mutable: true})\n sortDirection?: SortDirection;\n\n /**\n * Sorted state of the column.\n */\n @Prop({reflect: true, mutable: true})\n sorted: boolean | null = false;\n\n /**\n * Set popover position.\n */\n @Prop()\n popoverPosition = PopoverPosition.AUTO;\n\n /**\n * Store the open state of the menu.\n */\n @State()\n isMenuOpen = false;\n\n /**\n * Sort event fired when the user clicks on the sort button.\n * The sorting logic must be implemented by the app.\n * You can set an `id` on the `z-th` to easly identify the column in the event listener.\n */\n @Event()\n private sort: EventEmitter;\n\n private menuTrigger: HTMLElement;\n\n private popoverEl: HTMLZPopoverElement;\n\n /**\n * Get the value to set to the `aria-sort` attribute based on the current sort direction.\n */\n private get ariaSortDirection(): string {\n if (!this.sortDirection) {\n return null;\n }\n\n return this.sortDirection === SortDirection.ASC ? \"ascending\" : \"descending\";\n }\n\n /**\n * Handle the click on the sort button.\n * @fires sort\n */\n private handleSort(): void {\n if (!this.sortDirection) {\n this.sorted = false;\n\n return;\n }\n\n this.sortDirection = this.sortDirection === SortDirection.ASC ? SortDirection.DESC : SortDirection.ASC;\n this.sorted = true;\n\n this.sort.emit({sortDirection: this.sortDirection});\n }\n\n @Watch(\"colspan\")\n protected updateColspan(): void {\n if (this.colspan) {\n this.host.style.gridColumn = `span ${this.colspan}`;\n } else {\n this.host.style.removeProperty(\"grid-column\");\n }\n }\n\n componentWillLoad(): void {\n this.updateColspan();\n }\n\n render(): HTMLZThElement {\n return (\n <Host\n role=\"columnheader\"\n menu-open={this.isMenuOpen}\n aria-sort={this.ariaSortDirection}\n sortable={this.showSorting}\n >\n <div class=\"cell--content\">\n <slot></slot>\n {this.showSorting && (\n <button\n class=\"z-th--sort-button\"\n type=\"button\"\n onClick={this.handleSort.bind(this)}\n >\n <z-icon\n name={this.sortDirection === SortDirection.DESC ? \"arrow-simple-up\" : \"arrow-simple-down\"}\n width={14}\n height={14}\n />\n </button>\n )}\n {this.showMenu && (\n <div class=\"cell--menu-container\">\n <z-button\n variant={ButtonVariant.TERTIARY}\n icon=\"contextual-menu\"\n size={ControlSize.X_SMALL}\n ref={(el) => (this.menuTrigger = el as HTMLElement)}\n onClick={() => (this.popoverEl.open = !this.popoverEl.open)}\n />\n <z-popover\n ref={(el) => (this.popoverEl = el as HTMLZPopoverElement)}\n bindTo={this.menuTrigger}\n onOpenChange={(event) => (this.isMenuOpen = event.detail.open)}\n position={this.popoverPosition}\n >\n <slot name=\"contextual-menu\"></slot>\n </z-popover>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"z-th.js","mappings":";;;;;;AAAA,MAAM,SAAS,GAAG,itEAAitE,CAAC;AACpuE,kBAAe,SAAS;;MCYXA,KAAG;;;;;;;wBAekB,IAAI;2BAQD,IAAI;sBAM9B,KAAK;;sBAYW,KAAK;+BAMZ,eAAe,CAAC,IAAI;0BAMzB,KAAK;;;;;IAiBlB,IAAY,iBAAiB;QAC3B,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;YACvB,OAAO,IAAI,CAAC;SACb;QAED,OAAO,IAAI,CAAC,aAAa,KAAK,aAAa,CAAC,GAAG,GAAG,WAAW,GAAG,YAAY,CAAC;KAC9E;;;;;IAMO,UAAU;QAChB,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;YACvB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;YAEpB,OAAO;SACR;QAED,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,KAAK,aAAa,CAAC,GAAG,GAAG,aAAa,CAAC,IAAI,GAAG,aAAa,CAAC,GAAG,CAAC;QACvG,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QAEnB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAC,aAAa,EAAE,IAAI,CAAC,aAAa,EAAC,CAAC,CAAC;KACrD;IAGS,aAAa;QACrB,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,QAAQ,IAAI,CAAC,OAAO,EAAE,CAAC;SACrD;aAAM;YACL,IAAI,CAAC,I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AC,iBAAiB,GAAQ,CAC1B,CACR,CACP,CACG,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["ZTh"],"sources":["src/components/table/cells/z-th/styles.css?tag=z-th&encapsulation=shadow","src/components/table/cells/z-th/index.tsx"],"sourcesContent":["@import \"../z-table-cells.css\";\n\n:host {\n z-index: 1;\n padding: 0;\n background-color: var(--color-surface02);\n font-weight: var(--font-sb);\n}\n\n.cell--content {\n padding: var(--z-table--cells-padding, calc(var(--space-unit) * 2));\n}\n\n:host([show-sorting]) .cell--content {\n column-gap: var(--space-unit);\n}\n\n.z-th--sort-button {\n padding: 0;\n border: none;\n background-color: transparent;\n cursor: pointer;\n outline: none;\n}\n\n@media (min-width: 768px) and (hover: hover) {\n :host([show-sorting=\"hover\"]) .z-th--sort-button {\n opacity: 0;\n pointer-events: none;\n }\n\n :host([show-sorting=\"hover\"]:hover) .z-th--sort-button,\n :host([show-sorting=\"hover\"]) .z-th--sort-button:focus:focus-visible,\n :host([show-sorting=\"always\"]) .z-th--sort-button,\n :host([sorted]) .z-th--sort-button {\n opacity: 1;\n pointer-events: all;\n }\n}\n\n:host([show-sorting=\"hover\"]:hover) .z-th--sort-button::after,\n:host([show-sorting=\"hover\"]) .z-th--sort-button:focus:focus-visible::after,\n:host([show-sorting=\"always\"]) .z-th--sort-button::after,\n:host([sorted]) .z-th--sort-button::after {\n position: absolute;\n top: 6px;\n left: 6px;\n width: calc(100% - 12px);\n height: calc(100% - 10px);\n background-color: transparent;\n content: \"\";\n}\n\n:host([sorted]) .z-th--sort-button::after,\n.z-th--sort-button:focus:focus-visible::after {\n box-shadow: var(--shadow-focus-primary);\n}\n","import {Component, Element, Event, EventEmitter, Host, Prop, State, Watch, h} from \"@stencil/core\";\nimport {ButtonVariant, ControlSize, PopoverPosition, SortDirection, VisibilityCondition} from \"../../../../beans\";\n\n/**\n * ZTh component.\n * @slot - ZTh content.\n * @slot contextual-menu - Contextual menu content. Only visible when `showMenu` is true.\n */\n@Component({\n tag: \"z-th\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZTh {\n @Element() host: HTMLZThElement;\n\n /**\n * Number of columns that the cell should span.\n */\n @Prop()\n colspan: number;\n\n /**\n * Enables the contextual menu.\n * Can be set to \"hover\" or \"always\" to show the button only on cell hover or always.\n * Set a nullish value to hide the menu button.\n */\n @Prop({reflect: true})\n showMenu: VisibilityCondition = null;\n\n /**\n * Enables the sorting button.\n * Can be set to \"hover\" or \"always\" to show the button only on cell hover or always.\n * Set a nullish value to hide the sort button.\n */\n @Prop({reflect: true})\n showSorting: VisibilityCondition = null;\n\n /**\n * Whether the cell should stick.\n */\n @Prop({reflect: true})\n sticky = false;\n\n /**\n * Current sorting direction.\n */\n @Prop({mutable: true})\n sortDirection?: SortDirection;\n\n /**\n * Sorted state of the column.\n */\n @Prop({reflect: true, mutable: true})\n sorted: boolean | null = false;\n\n /**\n * Set popover position.\n */\n @Prop()\n popoverPosition = PopoverPosition.AUTO;\n\n /**\n * Store the open state of the menu.\n */\n @State()\n isMenuOpen = false;\n\n /**\n * Sort event fired when the user clicks on the sort button.\n * The sorting logic must be implemented by the app.\n * You can set an `id` on the `z-th` to easly identify the column in the event listener.\n */\n @Event()\n private sort: EventEmitter;\n\n private menuTrigger: HTMLElement;\n\n private popoverEl: HTMLZPopoverElement;\n\n /**\n * Get the value to set to the `aria-sort` attribute based on the current sort direction.\n */\n private get ariaSortDirection(): string {\n if (!this.sortDirection) {\n return null;\n }\n\n return this.sortDirection === SortDirection.ASC ? \"ascending\" : \"descending\";\n }\n\n /**\n * Handle the click on the sort button.\n * @fires sort\n */\n private handleSort(): void {\n if (!this.sortDirection) {\n this.sorted = false;\n\n return;\n }\n\n this.sortDirection = this.sortDirection === SortDirection.ASC ? SortDirection.DESC : SortDirection.ASC;\n this.sorted = true;\n\n this.sort.emit({sortDirection: this.sortDirection});\n }\n\n @Watch(\"colspan\")\n protected updateColspan(): void {\n if (this.colspan) {\n this.host.style.gridColumn = `span ${this.colspan}`;\n } else {\n this.host.style.removeProperty(\"grid-column\");\n }\n }\n\n componentWillLoad(): void {\n this.updateColspan();\n }\n\n render(): HTMLZThElement {\n return (\n <Host\n role=\"columnheader\"\n menu-open={this.isMenuOpen}\n aria-sort={this.ariaSortDirection}\n sortable={this.showSorting}\n >\n <div class=\"cell--content\">\n <slot></slot>\n {this.showSorting && (\n <button\n class=\"z-th--sort-button\"\n type=\"button\"\n onClick={this.handleSort.bind(this)}\n >\n <z-icon\n name={this.sortDirection === SortDirection.DESC ? \"arrow-simple-up\" : \"arrow-simple-down\"}\n width={14}\n height={14}\n />\n </button>\n )}\n {this.showMenu && (\n <div class=\"cell--menu-container\">\n <z-button\n variant={ButtonVariant.TERTIARY}\n icon=\"contextual-menu\"\n size={ControlSize.X_SMALL}\n ref={(el) => (this.menuTrigger = el as HTMLElement)}\n onClick={() => (this.popoverEl.open = !this.popoverEl.open)}\n />\n <z-popover\n ref={(el) => (this.popoverEl = el as HTMLZPopoverElement)}\n bindTo={this.menuTrigger}\n onOpenChange={(event) => (this.isMenuOpen = event.detail.open)}\n position={this.popoverPosition}\n >\n <slot name=\"contextual-menu\"></slot>\n </z-popover>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -0,0 +1,54 @@
1
+ import { html } from "lit";
2
+ import "./index.stories.css";
3
+ export default {
4
+ title: "Grid",
5
+ tags: ["!autodocs"],
6
+ };
7
+ export const Grid = {
8
+ render: () => html `
9
+ <div class="grid-story body-1">
10
+ <p><strong>z-grid</strong> column responsive CSS classes.</p>
11
+ <p>Each "col" class can be used with a viewport prefix:
12
+ <ul>
13
+ <li>mobile-col-#</li>
14
+ <li>tablet-col-#</li>
15
+ <li>desktop-col-#</li>
16
+ <li>wide-col-#</li>
17
+ </ul>
18
+ </p>
19
+ <p>The prefix let the class apply its style only on that viewport.</p>
20
+ <div class="container">
21
+ <h3>Responsive columns</h3>
22
+ <div class="z-grid">
23
+ <div class="wide-col-6 desktop-col-4 tablet-col-3 mobile-col-2">
24
+ wide-col-6 desktop-col-4 tablet-col-3 mobile-col-2
25
+ </div>
26
+ <div class="wide-col-6 desktop-col-4 tablet-col-3 mobile-col-2">
27
+ wide-col-6 desktop-col-4 tablet-col-3 mobile-col-2
28
+ </div>
29
+ <div class="wide-col-4 desktop-col-4 tablet-col-3 mobile-col-2">
30
+ wide-col-4 desktop-col-4 tablet-col-3 mobile-col-2
31
+ </div>
32
+ <div class="wide-col-4 desktop-col-4 tablet-col-3 mobile-col-2">
33
+ wide-col-4 desktop-col-4 tablet-col-3 mobile-col-2
34
+ </div>
35
+ <div class="ghost-grid z-grid">
36
+ <div></div>
37
+ <div></div>
38
+ <div></div>
39
+ <div></div>
40
+ <div></div>
41
+ <div></div>
42
+ <div></div>
43
+ <div></div>
44
+ <div></div>
45
+ <div></div>
46
+ <div></div>
47
+ <div></div>
48
+ </div>
49
+ </div>
50
+ </div>
51
+ </div>
52
+ `,
53
+ };
54
+ //# sourceMappingURL=index.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../../docs/grid/index.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAC;AACzB,OAAO,qBAAqB,CAAC;AAE7B,eAAe;IACb,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,CAAC,WAAW,CAAC;CACpB,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CjB;CACF,CAAC","sourcesContent":["import {html} from \"lit\";\nimport \"./index.stories.css\";\n\nexport default {\n title: \"Grid\",\n tags: [\"!autodocs\"],\n};\n\nexport const Grid = {\n render: () => html`\n <div class=\"grid-story body-1\">\n <p><strong>z-grid</strong> column responsive CSS classes.</p>\n <p>Each \"col\" class can be used with a viewport prefix:\n <ul>\n <li>mobile-col-#</li>\n <li>tablet-col-#</li>\n <li>desktop-col-#</li>\n <li>wide-col-#</li>\n </ul>\n </p>\n <p>The prefix let the class apply its style only on that viewport.</p>\n <div class=\"container\">\n <h3>Responsive columns</h3>\n <div class=\"z-grid\">\n <div class=\"wide-col-6 desktop-col-4 tablet-col-3 mobile-col-2\">\n wide-col-6 desktop-col-4 tablet-col-3 mobile-col-2\n </div>\n <div class=\"wide-col-6 desktop-col-4 tablet-col-3 mobile-col-2\">\n wide-col-6 desktop-col-4 tablet-col-3 mobile-col-2\n </div>\n <div class=\"wide-col-4 desktop-col-4 tablet-col-3 mobile-col-2\">\n wide-col-4 desktop-col-4 tablet-col-3 mobile-col-2\n </div>\n <div class=\"wide-col-4 desktop-col-4 tablet-col-3 mobile-col-2\">\n wide-col-4 desktop-col-4 tablet-col-3 mobile-col-2\n </div>\n <div class=\"ghost-grid z-grid\">\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n </div>\n </div>\n </div>\n </div>\n `,\n};\n"]}
@@ -0,0 +1,32 @@
1
+ import { html } from "lit";
2
+ import "../../src/components/z-accordion/index";
3
+ import "../../src/components/z-icon/index";
4
+ import { BUTTON_ICONS, FILLED_ICONS, LEGACY_ICONS, STROKE_ICONS } from "../../src/constants/iconset";
5
+ import "./index.stories.css";
6
+ export default {
7
+ title: "Iconset",
8
+ tags: ["!autodocs"],
9
+ };
10
+ export const Iconset = {
11
+ render: () => html `<div class="icons-list">
12
+ ${[STROKE_ICONS, FILLED_ICONS, BUTTON_ICONS, LEGACY_ICONS].map((iconsGroup, index) => html ` <z-accordion
13
+ open
14
+ shadow
15
+ highlight=${true}
16
+ variant="background"
17
+ label="${["Stroke icons", "Filled icons", "Button icons", "Legacy icon names"][index]} - (${Object.keys(iconsGroup).length})"
18
+ >
19
+ <ol class="icons-container">
20
+ ${Object.keys(iconsGroup)
21
+ .sort()
22
+ .map((iconName) => html `
23
+ <li class="icon-box">
24
+ <z-icon name=${iconName}></z-icon>
25
+ <div class="icon-name">${iconName}</div>
26
+ </li>
27
+ `)}
28
+ </ol>
29
+ </z-accordion>`)}
30
+ </div>`,
31
+ };
32
+ //# sourceMappingURL=index.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../../docs/iconset/index.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAC;AACzB,OAAO,wCAAwC,CAAC;AAChD,OAAO,mCAAmC,CAAC;AAC3C,OAAO,EAAC,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAC,MAAM,6BAA6B,CAAC;AACnG,OAAO,qBAAqB,CAAC;AAE7B,eAAe;IACb,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,CAAC,WAAW,CAAC;CACL,CAAC;AAEjB,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,MAAM,EAAE,GAAG,EAAE,CACX,IAAI,CAAA;QACA,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC,GAAG,CAC5D,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE,CACpB,IAAI,CAAA;;;wBAGU,IAAI;;qBAEP,CAAC,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,mBAAmB,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,IAAI,CACrG,UAAU,CACX,CAAC,MAAM;;;gBAGJ,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;SACtB,IAAI,EAAE;SACN,GAAG,CACF,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAA;;qCAEC,QAAQ;+CACE,QAAQ;;mBAEpC,CACF;;yBAEQ,CAClB;WACI;CACS,CAAC","sourcesContent":["import {Meta, StoryObj} from \"@storybook/web-components\";\nimport {html} from \"lit\";\nimport \"../../src/components/z-accordion/index\";\nimport \"../../src/components/z-icon/index\";\nimport {BUTTON_ICONS, FILLED_ICONS, LEGACY_ICONS, STROKE_ICONS} from \"../../src/constants/iconset\";\nimport \"./index.stories.css\";\n\nexport default {\n title: \"Iconset\",\n tags: [\"!autodocs\"],\n} satisfies Meta;\n\nexport const Iconset = {\n render: () =>\n html`<div class=\"icons-list\">\n ${[STROKE_ICONS, FILLED_ICONS, BUTTON_ICONS, LEGACY_ICONS].map(\n (iconsGroup, index) =>\n html` <z-accordion\n open\n shadow\n highlight=${true}\n variant=\"background\"\n label=\"${[\"Stroke icons\", \"Filled icons\", \"Button icons\", \"Legacy icon names\"][index]} - (${Object.keys(\n iconsGroup\n ).length})\"\n >\n <ol class=\"icons-container\">\n ${Object.keys(iconsGroup)\n .sort()\n .map(\n (iconName) => html`\n <li class=\"icon-box\">\n <z-icon name=${iconName}></z-icon>\n <div class=\"icon-name\">${iconName}</div>\n </li>\n `\n )}\n </ol>\n </z-accordion>`\n )}\n </div>`,\n} satisfies StoryObj;\n"]}
@@ -0,0 +1,90 @@
1
+ import { html } from "lit";
2
+ import "../../src/components/z-section-title/index";
3
+ import { getPalettes, getThemesColorTokens, getThemeTokenValue } from "../../src/utils/storybook-utils";
4
+ import "./index.stories.css";
5
+ export default {
6
+ title: "Colors",
7
+ argTypes: {
8
+ theme: {
9
+ control: {
10
+ type: "inline-radio",
11
+ },
12
+ options: ["theme-default", "theme-black-yellow", "theme-dark"],
13
+ },
14
+ },
15
+ args: {
16
+ theme: "theme-default",
17
+ },
18
+ parameters: {
19
+ layout: "fullscreen",
20
+ },
21
+ tags: ["!autodocs"],
22
+ };
23
+ export const Themes = {
24
+ render: (args) => html `
25
+ <div class="colors-story themes ${args.theme}">
26
+ <p>
27
+ Currently available color themes: <strong>default</strong>, <strong>black-yellow</strong>, <strong>dark</strong>
28
+ </p>
29
+ <p>On this page you can see the value of the color tokens for each theme, by switching it from the controls.</p>
30
+ <div class="tokens-container">
31
+ <z-section-title divider-position="after">
32
+ <div slot="primary-title">Color tokens</div>
33
+ </z-section-title>
34
+ <ul>
35
+ ${getThemesColorTokens()
36
+ .sort()
37
+ .map((token) => {
38
+ var _a;
39
+ return html `
40
+ <li>
41
+ <span class="token-name">${token}</span>
42
+ <div class="color">
43
+ <div
44
+ class="color-box"
45
+ style="background-color: var(${token})"
46
+ ></div>
47
+ <div class="interactive-2">
48
+ ${(_a = getThemeTokenValue(args.theme, token)) !== null && _a !== void 0 ? _a : getComputedStyle(document.documentElement).getPropertyValue(token)}
49
+ </div>
50
+ </div>
51
+ </li>
52
+ `;
53
+ })}
54
+ </ul>
55
+ </div>
56
+ </div>
57
+ `,
58
+ };
59
+ const palettes = getPalettes();
60
+ export const Palettes = {
61
+ render: () => html `
62
+ <div class="colors-story palettes">
63
+ ${Object.keys(palettes).map((paletteName) => html `<div class="tokens-container">
64
+ <z-section-title
65
+ divider-position="after"
66
+ style="--z-section-title--divider-color: var(${palettes[paletteName].find((token) => token.includes("500"))})"
67
+ >
68
+ <div slot="primary-title">${paletteName}</div>
69
+ </z-section-title>
70
+ <ul>
71
+ ${palettes[paletteName].map((token) => html `
72
+ <li>
73
+ <span class="token-name">${token}</span>
74
+ <div class="color">
75
+ <div
76
+ class="color-box"
77
+ style="background-color: var(${token})"
78
+ ></div>
79
+ <div class="interactive-2">
80
+ ${getComputedStyle(document.documentElement).getPropertyValue(token)}
81
+ </div>
82
+ </div>
83
+ </li>
84
+ `)}
85
+ </ul>
86
+ </div>`)}
87
+ </div>
88
+ `,
89
+ };
90
+ //# sourceMappingURL=index.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../../docs/themes/index.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAC;AACzB,OAAO,4CAA4C,CAAC;AACpD,OAAO,EAAC,WAAW,EAAE,oBAAoB,EAAE,kBAAkB,EAAC,MAAM,iCAAiC,C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AW,CAAC,CAAC,GAAG,CACzB,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAA;;+CAEgB,KAAK;;;;uDAIG,KAAK;;;0BAGlC,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC;;;;iBAI3E,CACF;;iBAEE,CACV;;GAEJ;CACiB,CAAC","sourcesContent":["import {StoryObj} from \"@storybook/web-components\";\nimport {html} from \"lit\";\nimport \"../../src/components/z-section-title/index\";\nimport {getPalettes, getThemesColorTokens, getThemeTokenValue} from \"../../src/utils/storybook-utils\";\nimport \"./index.stories.css\";\n\nexport default {\n title: \"Colors\",\n argTypes: {\n theme: {\n control: {\n type: \"inline-radio\",\n },\n options: [\"theme-default\", \"theme-black-yellow\", \"theme-dark\"],\n },\n },\n args: {\n theme: \"theme-default\",\n },\n parameters: {\n layout: \"fullscreen\",\n },\n tags: [\"!autodocs\"],\n};\n\nexport const Themes = {\n render: (args) => html`\n <div class=\"colors-story themes ${args.theme}\">\n <p>\n Currently available color themes: <strong>default</strong>, <strong>black-yellow</strong>, <strong>dark</strong>\n </p>\n <p>On this page you can see the value of the color tokens for each theme, by switching it from the controls.</p>\n <div class=\"tokens-container\">\n <z-section-title divider-position=\"after\">\n <div slot=\"primary-title\">Color tokens</div>\n </z-section-title>\n <ul>\n ${getThemesColorTokens()\n .sort()\n .map(\n (token) => html`\n <li>\n <span class=\"token-name\">${token}</span>\n <div class=\"color\">\n <div\n class=\"color-box\"\n style=\"background-color: var(${token})\"\n ></div>\n <div class=\"interactive-2\">\n ${getThemeTokenValue(args.theme, token) ??\n getComputedStyle(document.documentElement).getPropertyValue(token)}\n </div>\n </div>\n </li>\n `\n )}\n </ul>\n </div>\n </div>\n `,\n} satisfies StoryObj;\n\nconst palettes = getPalettes();\n\nexport const Palettes = {\n render: () => html`\n <div class=\"colors-story palettes\">\n ${Object.keys(palettes).map(\n (paletteName) =>\n html`<div class=\"tokens-container\">\n <z-section-title\n divider-position=\"after\"\n style=\"--z-section-title--divider-color: var(${palettes[paletteName].find((token) =>\n token.includes(\"500\")\n )})\"\n >\n <div slot=\"primary-title\">${paletteName}</div>\n </z-section-title>\n <ul>\n ${palettes[paletteName].map(\n (token) => html`\n <li>\n <span class=\"token-name\">${token}</span>\n <div class=\"color\">\n <div\n class=\"color-box\"\n style=\"background-color: var(${token})\"\n ></div>\n <div class=\"interactive-2\">\n ${getComputedStyle(document.documentElement).getPropertyValue(token)}\n </div>\n </div>\n </li>\n `\n )}\n </ul>\n </div>`\n )}\n </div>\n `,\n} satisfies StoryObj;\n"]}