wcs-core 7.2.2 → 7.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 (302) hide show
  1. package/README.md +11 -9
  2. package/design-tokens/dist/sncf-groupe-root-scoped.css +227 -227
  3. package/design-tokens/dist/sncf-groupe.css +227 -227
  4. package/design-tokens/dist/sncf-holding-root-scoped.css +227 -227
  5. package/design-tokens/dist/sncf-holding.css +227 -227
  6. package/design-tokens/dist/sncf-reseau-root-scoped.css +227 -227
  7. package/design-tokens/dist/sncf-reseau.css +227 -227
  8. package/design-tokens/dist/sncf-voyageurs-root-scoped.css +242 -242
  9. package/design-tokens/dist/sncf-voyageurs.css +242 -242
  10. package/dist/cjs/accessibility-5f681a74.js.map +1 -1
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/cjs/{popper-8d6e7fca.js → popper-1b61df21.js} +10 -17
  13. package/dist/cjs/popper-1b61df21.js.map +1 -0
  14. package/dist/cjs/wcs-accordion-panel.cjs.entry.js +1 -1
  15. package/dist/cjs/wcs-accordion-panel.cjs.entry.js.map +1 -1
  16. package/dist/cjs/wcs-accordion.cjs.entry.js +2 -1
  17. package/dist/cjs/wcs-accordion.cjs.entry.js.map +1 -1
  18. package/dist/cjs/wcs-breadcrumb.cjs.entry.js +1 -1
  19. package/dist/cjs/wcs-breadcrumb.cjs.entry.js.map +1 -1
  20. package/dist/cjs/wcs-checkbox.cjs.entry.js +3 -2
  21. package/dist/cjs/wcs-checkbox.cjs.entry.js.map +1 -1
  22. package/dist/cjs/wcs-chip.cjs.entry.js +102 -0
  23. package/dist/cjs/wcs-chip.cjs.entry.js.map +1 -0
  24. package/dist/cjs/wcs-com-nav-item.cjs.entry.js +1 -1
  25. package/dist/cjs/wcs-com-nav-item.cjs.entry.js.map +1 -1
  26. package/dist/cjs/wcs-com-nav.cjs.entry.js +3 -3
  27. package/dist/cjs/wcs-com-nav.cjs.entry.js.map +1 -1
  28. package/dist/cjs/wcs-dropdown.cjs.entry.js +1 -1
  29. package/dist/cjs/wcs-error_3.cjs.entry.js +1 -1
  30. package/dist/cjs/wcs-error_3.cjs.entry.js.map +1 -1
  31. package/dist/cjs/wcs-galactic-menu.cjs.entry.js +1 -1
  32. package/dist/cjs/wcs-grid.cjs.entry.js +5 -4
  33. package/dist/cjs/wcs-grid.cjs.entry.js.map +1 -1
  34. package/dist/cjs/wcs-horizontal-stepper.cjs.entry.js +3 -2
  35. package/dist/cjs/wcs-horizontal-stepper.cjs.entry.js.map +1 -1
  36. package/dist/cjs/wcs-modal.cjs.entry.js +2 -2
  37. package/dist/cjs/wcs-modal.cjs.entry.js.map +1 -1
  38. package/dist/cjs/wcs-select_2.cjs.entry.js +59 -24
  39. package/dist/cjs/wcs-select_2.cjs.entry.js.map +1 -1
  40. package/dist/cjs/wcs-tabs.cjs.entry.js +1 -1
  41. package/dist/cjs/wcs-tooltip.cjs.entry.js +1 -1
  42. package/dist/cjs/wcs.cjs.js +1 -1
  43. package/dist/collection/collection-manifest.json +1 -0
  44. package/dist/collection/components/accordion/accordion.e2e.playwright.js +183 -0
  45. package/dist/collection/components/accordion/accordion.e2e.playwright.js.map +1 -0
  46. package/dist/collection/components/accordion/accordion.js +2 -1
  47. package/dist/collection/components/accordion/accordion.js.map +1 -1
  48. package/dist/collection/components/accordion-panel/accordion-panel.js +3 -3
  49. package/dist/collection/components/accordion-panel/accordion-panel.js.map +1 -1
  50. package/dist/collection/components/alert/alert.e2e.playwright.js +125 -0
  51. package/dist/collection/components/alert/alert.e2e.playwright.js.map +1 -0
  52. package/dist/collection/components/alert-drawer/alert-drawer.e2e.playwright.js +107 -0
  53. package/dist/collection/components/alert-drawer/alert-drawer.e2e.playwright.js.map +1 -0
  54. package/dist/collection/components/breadcrumb/breadcrumb.e2e.playwright.js +188 -0
  55. package/dist/collection/components/breadcrumb/breadcrumb.e2e.playwright.js.map +1 -0
  56. package/dist/collection/components/breadcrumb/breadcrumb.js +2 -2
  57. package/dist/collection/components/breadcrumb/breadcrumb.js.map +1 -1
  58. package/dist/collection/components/button/button.e2e.playwright.js +26 -0
  59. package/dist/collection/components/button/button.e2e.playwright.js.map +1 -0
  60. package/dist/collection/components/button/button.js +1 -1
  61. package/dist/collection/components/checkbox/checkbox.css +3 -0
  62. package/dist/collection/components/checkbox/checkbox.e2e.playwright.js +39 -0
  63. package/dist/collection/components/checkbox/checkbox.e2e.playwright.js.map +1 -0
  64. package/dist/collection/components/checkbox/checkbox.js +21 -2
  65. package/dist/collection/components/checkbox/checkbox.js.map +1 -1
  66. package/dist/collection/components/chip/chip-interface.js +2 -0
  67. package/dist/collection/components/chip/chip-interface.js.map +1 -0
  68. package/dist/collection/components/chip/chip.css +220 -0
  69. package/dist/collection/components/chip/chip.e2e.playwright.js +190 -0
  70. package/dist/collection/components/chip/chip.e2e.playwright.js.map +1 -0
  71. package/dist/collection/components/chip/chip.js +341 -0
  72. package/dist/collection/components/chip/chip.js.map +1 -0
  73. package/dist/collection/components/com-nav/com-nav.css +15 -0
  74. package/dist/collection/components/com-nav/{com-nav.e2e.js → com-nav.e2e.playwright.js} +60 -44
  75. package/dist/collection/components/com-nav/com-nav.e2e.playwright.js.map +1 -0
  76. package/dist/collection/components/com-nav/com-nav.js +3 -3
  77. package/dist/collection/components/com-nav/com-nav.js.map +1 -1
  78. package/dist/collection/components/com-nav-category/com-nav-category.js +1 -1
  79. package/dist/collection/components/com-nav-item/com-nav-item.css +2 -2
  80. package/dist/collection/components/com-nav-submenu/com-nav-submenu.js +1 -1
  81. package/dist/collection/components/counter/counter.e2e.playwright.js +187 -0
  82. package/dist/collection/components/counter/counter.e2e.playwright.js.map +1 -0
  83. package/dist/collection/components/counter/counter.js +1 -1
  84. package/dist/collection/components/dropdown/dropdown.e2e.playwright.js +320 -0
  85. package/dist/collection/components/dropdown/dropdown.e2e.playwright.js.map +1 -0
  86. package/dist/collection/components/dropdown/dropdown.js +1 -1
  87. package/dist/collection/components/editable-field/editable-field.e2e.playwright.js +156 -0
  88. package/dist/collection/components/editable-field/editable-field.e2e.playwright.js.map +1 -0
  89. package/dist/collection/components/form-field/form-field.e2e.playwright.js +104 -0
  90. package/dist/collection/components/form-field/form-field.e2e.playwright.js.map +1 -0
  91. package/dist/collection/components/galactic-menu/galactic-menu.js +1 -1
  92. package/dist/collection/components/grid/grid.e2e.playwright.js +153 -0
  93. package/dist/collection/components/grid/grid.e2e.playwright.js.map +1 -0
  94. package/dist/collection/components/grid/grid.js +6 -5
  95. package/dist/collection/components/grid/grid.js.map +1 -1
  96. package/dist/collection/components/grid-column/grid-column.js +1 -1
  97. package/dist/collection/components/grid-pagination/grid-pagination.js +1 -1
  98. package/dist/collection/components/header/header.js +1 -1
  99. package/dist/collection/components/horizontal-stepper/horizontal-step.js +2 -1
  100. package/dist/collection/components/horizontal-stepper/horizontal-step.js.map +1 -1
  101. package/dist/collection/components/horizontal-stepper/horizontal-stepper-interface.js.map +1 -1
  102. package/dist/collection/components/horizontal-stepper/horizontal-stepper.js +5 -1
  103. package/dist/collection/components/horizontal-stepper/horizontal-stepper.js.map +1 -1
  104. package/dist/collection/components/icon/icon.js +1 -1
  105. package/dist/collection/components/input/input.e2e.playwright.js +157 -0
  106. package/dist/collection/components/input/input.e2e.playwright.js.map +1 -0
  107. package/dist/collection/components/input/input.js +2 -2
  108. package/dist/collection/components/label/label.css +4 -6
  109. package/dist/collection/components/label/label.js +1 -1
  110. package/dist/collection/components/mat-icon/mat-icon.js +1 -1
  111. package/dist/collection/components/modal/modal.css +4 -0
  112. package/dist/collection/components/modal/modal.e2e.playwright.js +35 -0
  113. package/dist/collection/components/modal/modal.e2e.playwright.js.map +1 -0
  114. package/dist/collection/components/modal/modal.js +2 -2
  115. package/dist/collection/components/modal/modal.js.map +1 -1
  116. package/dist/collection/components/native-select/native-select.js +1 -1
  117. package/dist/collection/components/nav/nav.js +1 -1
  118. package/dist/collection/components/progress-bar/progress-bar.js +1 -1
  119. package/dist/collection/components/progress-radial/progress-radial.js +1 -1
  120. package/dist/collection/components/radio/radio.js +1 -1
  121. package/dist/collection/components/radio-group/radio-group.e2e.playwright.js +231 -0
  122. package/dist/collection/components/radio-group/radio-group.e2e.playwright.js.map +1 -0
  123. package/dist/collection/components/radio-group/radio-group.js +1 -1
  124. package/dist/collection/components/select/select.e2e.playwright.js +1702 -0
  125. package/dist/collection/components/select/select.e2e.playwright.js.map +1 -0
  126. package/dist/collection/components/select/select.js +49 -20
  127. package/dist/collection/components/select/select.js.map +1 -1
  128. package/dist/collection/components/select-option/select-option.js +3 -3
  129. package/dist/collection/components/select-option/select-option.js.map +1 -1
  130. package/dist/collection/components/switch/switch.e2e.playwright.js +40 -0
  131. package/dist/collection/components/switch/switch.e2e.playwright.js.map +1 -0
  132. package/dist/collection/components/switch/switch.js +1 -1
  133. package/dist/collection/components/tabs/tabs.e2e.playwright.js +205 -0
  134. package/dist/collection/components/tabs/tabs.e2e.playwright.js.map +1 -0
  135. package/dist/collection/components/tabs/tabs.js +1 -1
  136. package/dist/collection/components/textarea/textarea.e2e.playwright.js +133 -0
  137. package/dist/collection/components/textarea/textarea.e2e.playwright.js.map +1 -0
  138. package/dist/collection/components/textarea/textarea.js +1 -1
  139. package/dist/collection/utils/accessibility.js +16 -0
  140. package/dist/collection/utils/accessibility.js.map +1 -1
  141. package/dist/collection/utils/playwright/test-expect.js +2 -0
  142. package/dist/collection/utils/playwright/test-expect.js.map +1 -0
  143. package/dist/collection/utils/playwright/test.js +16 -0
  144. package/dist/collection/utils/playwright/test.js.map +1 -0
  145. package/dist/esm/accessibility-069640cf.js.map +1 -1
  146. package/dist/esm/loader.js +1 -1
  147. package/dist/esm/{popper-e491c314.js → popper-ac238961.js} +10 -17
  148. package/dist/esm/popper-ac238961.js.map +1 -0
  149. package/dist/esm/wcs-accordion-panel.entry.js +1 -1
  150. package/dist/esm/wcs-accordion-panel.entry.js.map +1 -1
  151. package/dist/esm/wcs-accordion.entry.js +2 -1
  152. package/dist/esm/wcs-accordion.entry.js.map +1 -1
  153. package/dist/esm/wcs-breadcrumb.entry.js +1 -1
  154. package/dist/esm/wcs-breadcrumb.entry.js.map +1 -1
  155. package/dist/esm/wcs-checkbox.entry.js +3 -2
  156. package/dist/esm/wcs-checkbox.entry.js.map +1 -1
  157. package/dist/esm/wcs-chip.entry.js +98 -0
  158. package/dist/esm/wcs-chip.entry.js.map +1 -0
  159. package/dist/esm/wcs-com-nav-item.entry.js +1 -1
  160. package/dist/esm/wcs-com-nav-item.entry.js.map +1 -1
  161. package/dist/esm/wcs-com-nav.entry.js +3 -3
  162. package/dist/esm/wcs-com-nav.entry.js.map +1 -1
  163. package/dist/esm/wcs-dropdown.entry.js +1 -1
  164. package/dist/esm/wcs-error_3.entry.js +1 -1
  165. package/dist/esm/wcs-error_3.entry.js.map +1 -1
  166. package/dist/esm/wcs-galactic-menu.entry.js +1 -1
  167. package/dist/esm/wcs-grid.entry.js +5 -4
  168. package/dist/esm/wcs-grid.entry.js.map +1 -1
  169. package/dist/esm/wcs-horizontal-stepper.entry.js +3 -2
  170. package/dist/esm/wcs-horizontal-stepper.entry.js.map +1 -1
  171. package/dist/esm/wcs-modal.entry.js +2 -2
  172. package/dist/esm/wcs-modal.entry.js.map +1 -1
  173. package/dist/esm/wcs-select_2.entry.js +59 -24
  174. package/dist/esm/wcs-select_2.entry.js.map +1 -1
  175. package/dist/esm/wcs-tabs.entry.js +1 -1
  176. package/dist/esm/wcs-tooltip.entry.js +1 -1
  177. package/dist/esm/wcs.js +1 -1
  178. package/dist/types/components/accordion/accordion.e2e.playwright.d.ts +1 -0
  179. package/dist/types/components/accordion-panel/accordion-panel.d.ts +5 -0
  180. package/dist/types/components/alert/alert.e2e.playwright.d.ts +1 -0
  181. package/dist/types/components/alert-drawer/alert-drawer.e2e.playwright.d.ts +1 -0
  182. package/dist/types/components/breadcrumb/breadcrumb.e2e.playwright.d.ts +1 -0
  183. package/dist/types/components/button/button.e2e.playwright.d.ts +1 -0
  184. package/dist/types/components/checkbox/checkbox.d.ts +4 -0
  185. package/dist/types/components/checkbox/checkbox.e2e.playwright.d.ts +1 -0
  186. package/dist/types/components/chip/chip-interface.d.ts +4 -0
  187. package/dist/types/components/chip/chip.d.ts +132 -0
  188. package/dist/types/components/chip/chip.e2e.playwright.d.ts +1 -0
  189. package/dist/types/components/com-nav/com-nav.e2e.playwright.d.ts +1 -0
  190. package/dist/types/components/counter/counter.e2e.playwright.d.ts +1 -0
  191. package/dist/types/components/dropdown/dropdown.e2e.playwright.d.ts +1 -0
  192. package/dist/types/components/editable-field/editable-field.e2e.playwright.d.ts +1 -0
  193. package/dist/types/components/form-field/form-field.e2e.playwright.d.ts +1 -0
  194. package/dist/types/components/grid/grid.e2e.playwright.d.ts +1 -0
  195. package/dist/types/components/horizontal-stepper/horizontal-stepper-interface.d.ts +2 -0
  196. package/dist/types/components/horizontal-stepper/horizontal-stepper.d.ts +4 -0
  197. package/dist/types/components/input/input.e2e.playwright.d.ts +1 -0
  198. package/dist/types/components/modal/modal.e2e.playwright.d.ts +1 -0
  199. package/dist/types/components/radio-group/radio-group.e2e.playwright.d.ts +1 -0
  200. package/dist/types/components/select/select.d.ts +7 -1
  201. package/dist/types/components/select/select.e2e.playwright.d.ts +1 -0
  202. package/dist/types/components/switch/switch.e2e.playwright.d.ts +1 -0
  203. package/dist/types/components/tabs/tabs.e2e.playwright.d.ts +1 -0
  204. package/dist/types/components/textarea/textarea.e2e.playwright.d.ts +1 -0
  205. package/dist/types/components.d.ts +354 -0
  206. package/dist/types/utils/accessibility.d.ts +7 -0
  207. package/dist/types/utils/playwright/test-expect.d.ts +33 -0
  208. package/dist/types/utils/playwright/test.d.ts +7 -0
  209. package/dist/wcs/{p-8e9bd0f1.entry.js → p-0326f834.entry.js} +2 -2
  210. package/dist/wcs/{p-8e9bd0f1.entry.js.map → p-0326f834.entry.js.map} +1 -1
  211. package/dist/wcs/p-2221bf0c.entry.js +16 -0
  212. package/dist/wcs/p-2221bf0c.entry.js.map +1 -0
  213. package/dist/wcs/p-4ae08567.entry.js +2 -0
  214. package/dist/wcs/p-4ae08567.entry.js.map +1 -0
  215. package/dist/wcs/p-4e2d6227.entry.js +2 -0
  216. package/dist/wcs/p-4e2d6227.entry.js.map +1 -0
  217. package/dist/wcs/p-828b45b4.entry.js +2 -0
  218. package/dist/wcs/p-828b45b4.entry.js.map +1 -0
  219. package/dist/wcs/p-8332a7e3.entry.js +2 -0
  220. package/dist/wcs/p-8332a7e3.entry.js.map +1 -0
  221. package/dist/wcs/p-990698a7.entry.js +2 -0
  222. package/dist/wcs/p-990698a7.entry.js.map +1 -0
  223. package/dist/wcs/{p-ec383729.entry.js → p-9b76b8e6.entry.js} +2 -2
  224. package/dist/wcs/{p-ec383729.entry.js.map → p-9b76b8e6.entry.js.map} +1 -1
  225. package/dist/wcs/{p-1f593d06.entry.js → p-abd8d5a0.entry.js} +2 -2
  226. package/dist/wcs/{p-622f7403.entry.js → p-c6f8c45c.entry.js} +2 -2
  227. package/dist/wcs/{p-a94e685c.entry.js → p-db7ba599.entry.js} +2 -2
  228. package/dist/wcs/p-e1fb3625.js +2 -0
  229. package/dist/wcs/p-e1fb3625.js.map +1 -0
  230. package/dist/wcs/p-ed3b0709.entry.js +2 -0
  231. package/dist/wcs/p-ed3b0709.entry.js.map +1 -0
  232. package/dist/wcs/{p-6c6079ee.entry.js → p-f2eeb249.entry.js} +2 -2
  233. package/dist/wcs/{p-6c6079ee.entry.js.map → p-f2eeb249.entry.js.map} +1 -1
  234. package/dist/wcs/{p-a956dc84.entry.js → p-f2f7595e.entry.js} +2 -2
  235. package/dist/wcs/{p-a956dc84.entry.js.map → p-f2f7595e.entry.js.map} +1 -1
  236. package/dist/wcs/p-fb2751c2.js.map +1 -1
  237. package/dist/wcs/p-fbd68522.entry.js +2 -0
  238. package/dist/wcs/p-fbd68522.entry.js.map +1 -0
  239. package/dist/wcs/{p-8c2605fd.entry.js → p-fe303f58.entry.js} +2 -2
  240. package/dist/wcs/wcs.esm.js +1 -1
  241. package/dist/wcs/wcs.esm.js.map +1 -1
  242. package/package.json +18 -24
  243. package/dist/cjs/popper-8d6e7fca.js.map +0 -1
  244. package/dist/collection/components/alert/alert.e2e.js +0 -142
  245. package/dist/collection/components/alert/alert.e2e.js.map +0 -1
  246. package/dist/collection/components/alert-drawer/alert-drawer.e2e.js +0 -111
  247. package/dist/collection/components/alert-drawer/alert-drawer.e2e.js.map +0 -1
  248. package/dist/collection/components/breadcrumb/breadcrumb.e2e.js +0 -223
  249. package/dist/collection/components/breadcrumb/breadcrumb.e2e.js.map +0 -1
  250. package/dist/collection/components/button/button.e2e.js +0 -25
  251. package/dist/collection/components/button/button.e2e.js.map +0 -1
  252. package/dist/collection/components/checkbox/checkbox.e2e.js +0 -45
  253. package/dist/collection/components/checkbox/checkbox.e2e.js.map +0 -1
  254. package/dist/collection/components/com-nav/com-nav.e2e.js.map +0 -1
  255. package/dist/collection/components/counter/counter.e2e.js +0 -206
  256. package/dist/collection/components/counter/counter.e2e.js.map +0 -1
  257. package/dist/collection/components/dropdown/dropdown.e2e.js +0 -156
  258. package/dist/collection/components/dropdown/dropdown.e2e.js.map +0 -1
  259. package/dist/collection/components/editable-field/editable-field.e2e.js +0 -176
  260. package/dist/collection/components/editable-field/editable-field.e2e.js.map +0 -1
  261. package/dist/collection/components/form-field/form-field.e2e.js +0 -122
  262. package/dist/collection/components/form-field/form-field.e2e.js.map +0 -1
  263. package/dist/collection/components/grid/grid.e2e.js +0 -147
  264. package/dist/collection/components/grid/grid.e2e.js.map +0 -1
  265. package/dist/collection/components/input/input.e2e.js +0 -152
  266. package/dist/collection/components/input/input.e2e.js.map +0 -1
  267. package/dist/collection/components/modal/modal.e2e.js +0 -36
  268. package/dist/collection/components/modal/modal.e2e.js.map +0 -1
  269. package/dist/collection/components/radio-group/radio-group.e2e.js +0 -239
  270. package/dist/collection/components/radio-group/radio-group.e2e.js.map +0 -1
  271. package/dist/collection/components/select/select.e2e.js +0 -1081
  272. package/dist/collection/components/select/select.e2e.js.map +0 -1
  273. package/dist/collection/components/switch/switch.e2e.js +0 -45
  274. package/dist/collection/components/switch/switch.e2e.js.map +0 -1
  275. package/dist/collection/components/tabs/tabs.e2e.js +0 -207
  276. package/dist/collection/components/tabs/tabs.e2e.js.map +0 -1
  277. package/dist/collection/components/textarea/textarea.e2e.js +0 -132
  278. package/dist/collection/components/textarea/textarea.e2e.js.map +0 -1
  279. package/dist/collection/utils/tests.js +0 -23
  280. package/dist/collection/utils/tests.js.map +0 -1
  281. package/dist/esm/popper-e491c314.js.map +0 -1
  282. package/dist/types/utils/tests.d.ts +0 -4
  283. package/dist/wcs/p-02f31010.entry.js +0 -2
  284. package/dist/wcs/p-02f31010.entry.js.map +0 -1
  285. package/dist/wcs/p-0dd07842.entry.js +0 -2
  286. package/dist/wcs/p-0dd07842.entry.js.map +0 -1
  287. package/dist/wcs/p-0f864e86.js +0 -2
  288. package/dist/wcs/p-0f864e86.js.map +0 -1
  289. package/dist/wcs/p-1244daa0.entry.js +0 -2
  290. package/dist/wcs/p-1244daa0.entry.js.map +0 -1
  291. package/dist/wcs/p-1fbe0328.entry.js +0 -2
  292. package/dist/wcs/p-1fbe0328.entry.js.map +0 -1
  293. package/dist/wcs/p-4fb2d985.entry.js +0 -2
  294. package/dist/wcs/p-4fb2d985.entry.js.map +0 -1
  295. package/dist/wcs/p-b94a09b6.entry.js +0 -16
  296. package/dist/wcs/p-b94a09b6.entry.js.map +0 -1
  297. package/dist/wcs/p-fd187bce.entry.js +0 -2
  298. package/dist/wcs/p-fd187bce.entry.js.map +0 -1
  299. /package/dist/wcs/{p-1f593d06.entry.js.map → p-abd8d5a0.entry.js.map} +0 -0
  300. /package/dist/wcs/{p-622f7403.entry.js.map → p-c6f8c45c.entry.js.map} +0 -0
  301. /package/dist/wcs/{p-a94e685c.entry.js.map → p-db7ba599.entry.js.map} +0 -0
  302. /package/dist/wcs/{p-8c2605fd.entry.js.map → p-fe303f58.entry.js.map} +0 -0
@@ -0,0 +1,341 @@
1
+ import { Host, h } from "@stencil/core";
2
+ /**
3
+ * The chip component is a small, interactive element that can be used to represent an input, filter, or tag.
4
+ * It can be in one of two modes: 'selectable' or 'dismissible'.
5
+ * - In 'selectable' mode, the chip can be selected or deselected, and emits an event when clicked.
6
+ * - In 'dismissible' mode, the chip can be dismissed (removed) by clicking a dismiss icon, and emits an event when the dismiss icon is clicked.
7
+ *
8
+ * @cssprop --wcs-chip-height - Height of the chip
9
+ * @cssprop --wcs-chip-font-size - Font size of the chip text
10
+ * @cssprop --wcs-chip-font-weight - Font weight of the chip text
11
+ *
12
+ * @cssprop --wcs-chip-focus-outline-border-width - Border width of the chip focus outline
13
+ *
14
+ * @cssprop --wcs-chip-padding-vertical - Vertical padding (top - bottom) of the chip
15
+ * @cssprop --wcs-chip-padding-horizontal - Horizontal padding (left - right) of the chip
16
+ * @cssprop --wcs-chip-padding-horizontal-dismissible - Horizontal padding (left - right) of the chip with 'dismissible' mode
17
+ *
18
+ * @cssprop --wcs-chip-selectable-background-color - Background color of the chip with 'selectable' mode in default state
19
+ * @cssprop --wcs-chip-selectable-background-color-pressed - Background color of the chip with 'selectable' mode when pressed
20
+ * @cssprop --wcs-chip-selectable-background-color-hover - Background color of the chip with 'selectable' mode when hovered
21
+ * @cssprop --wcs-chip-selectable-background-color-selected - Background color of the chip with 'selectable' mode when selected
22
+ * @cssprop --wcs-chip-selectable-background-color-selected-hover - Background color of the chip with 'selectable' mode when selected and hovered
23
+ * @cssprop --wcs-chip-selectable-background-color-selected-pressed - Background color of the chip with 'selectable' mode when selected and pressed
24
+ * @cssprop --wcs-chip-selectable-background-color-selected-disabled - Background color of the chip with 'selectable' mode when selected and disabled
25
+ *
26
+ * @cssprop --wcs-chip-selectable-color - Text color of the chip with 'selectable' mode in default state
27
+ * @cssprop --wcs-chip-selectable-color-hover - Text color of the chip with 'selectable' mode when hovered
28
+ * @cssprop --wcs-chip-selectable-color-pressed - Text color of the chip with 'selectable' mode when pressed
29
+ * @cssprop --wcs-chip-selectable-color-disabled - Text color of the chip with 'selectable' mode when disabled
30
+ * @cssprop --wcs-chip-selectable-color-selected - Text color of the chip with 'selectable' mode when selected
31
+ * @cssprop --wcs-chip-selectable-color-selected-hover - Text color of the chip with 'selectable' mode when selected and hovered
32
+ * @cssprop --wcs-chip-selectable-color-selected-pressed - Text color of the chip with 'selectable' mode when selected and pressed
33
+ *
34
+ * @cssprop --wcs-chip-border-radius - Border radius of the chip
35
+ * @cssprop --wcs-chip-border-line-width - Border line width of the chip
36
+ * @cssprop --wcs-chip-selectable-border-color - Border color of the chip with 'selectable' mode in default state
37
+ * @cssprop --wcs-chip-selectable-border-color-hover - Border color of the chip with 'selectable' mode when hovered
38
+ * @cssprop --wcs-chip-selectable-border-color-pressed - Border color of the chip with 'selectable' mode when pressed
39
+ * @cssprop --wcs-chip-selectable-border-color-disabled - Border color of the chip with 'selectable' mode when disabled
40
+ *
41
+ * @cssprop --wcs-chip-selectable-content-gap - Gap between content elements in chip with 'selectable' mode
42
+ * @cssprop --wcs-chip-selectable-focus-outline-color - Focus outline color of the chip with 'selectable' mode
43
+ *
44
+ * @cssprop --wcs-chip-dismissible-content-gap - Gap between content elements in chip with 'dismissible' mode
45
+ * @cssprop --wcs-chip-dismissible-padding-right - Right padding of the chip with 'dismissible' mode
46
+ * @cssprop --wcs-chip-dismissible-button-outline-radius - Outline radius of the button for the chip with 'dismissible' mode
47
+ *
48
+ * @cssprop --wcs-chip-dismissible-primary-focus-outline-color - Focus outline color of the chip with 'dismissible' mode and 'primary' variant
49
+ * @cssprop --wcs-chip-dismissible-primary-border-color - Border color of the chip with 'dismissible' mode and 'primary' variant
50
+ * @cssprop --wcs-chip-dismissible-primary-border-color-disabled - Border color of the chip with 'dismissible' mode and 'primary' variant when disabled
51
+ * @cssprop --wcs-chip-dismissible-primary-color - Text color of the chip with 'dismissible' mode and 'primary' variant
52
+ * @cssprop --wcs-chip-dismissible-primary-color-hover - Text color of the chip with 'dismissible' mode and 'primary' variant when hovered
53
+ * @cssprop --wcs-chip-dismissible-primary-color-pressed - Text color of the chip with 'dismissible' mode and 'primary' variant when pressed
54
+ * @cssprop --wcs-chip-dismissible-primary-color-disabled - Text color of the chip with 'dismissible' mode and 'primary' variant when disabled
55
+ * @cssprop --wcs-chip-dismissible-primary-background-color - Background color of the chip with 'dismissible' mode and 'primary' variant
56
+ * @cssprop --wcs-chip-dismissible-primary-background-color-hover - Background color of the chip with 'dismissible' mode and 'primary' variant when hovered
57
+ * @cssprop --wcs-chip-dismissible-primary-background-color-pressed - Background color of the chip with 'dismissible' mode and 'primary' variant when pressed
58
+ * @cssprop --wcs-chip-dismissible-primary-background-color-disabled - Background color of the chip with 'dismissible' mode and 'primary' variant when disabled
59
+ *
60
+ * @cssprop --wcs-chip-dismissible-secondary-button-focus-outline-color - Button focus outline color of the chip with 'dismissible' mode and 'secondary' variant
61
+ * @cssprop --wcs-chip-dismissible-secondary-border-color - Border color of the chip with 'dismissible' mode and 'secondary' variant
62
+ * @cssprop --wcs-chip-dismissible-secondary-border-color-disabled - Border color of the chip with 'dismissible' mode and 'secondary' variant when disabled
63
+ * @cssprop --wcs-chip-dismissible-secondary-color - Text color of the chip with 'dismissible' mode and 'secondary' variant
64
+ * @cssprop --wcs-chip-dismissible-secondary-color-disabled - Text color of the chip with 'dismissible' mode and 'secondary' variant when disabled
65
+ * @cssprop --wcs-chip-dismissible-secondary-background-color - Background color of the chip with 'dismissible' mode and 'secondary' variant
66
+ * @cssprop --wcs-chip-dismissible-secondary-button-background-color - Button background color of the chip with 'dismissible' mode and 'secondary' variant
67
+ * @cssprop --wcs-chip-dismissible-secondary-button-background-color-hover - Button background color of the chip with 'dismissible' mode and 'secondary' variant when hovered
68
+ * @cssprop --wcs-chip-dismissible-secondary-button-background-color-pressed - Button background color of the chip with 'dismissible' mode and 'secondary' variant when pressed
69
+ * @cssprop --wcs-chip-dismissible-secondary-button-background-color-disabled - Button background color of the chip with 'dismissible' mode and 'secondary' variant when disabled
70
+ */
71
+ export class Chip {
72
+ constructor() {
73
+ this.handleDismiss = (event) => {
74
+ if (this.disabled || this.mode !== 'dismissible') {
75
+ return;
76
+ }
77
+ event.stopPropagation(); // Prevent the click event from bubbling up to the chip click handler
78
+ this.dismiss();
79
+ };
80
+ this.value = undefined;
81
+ this.label = undefined;
82
+ this.selected = false;
83
+ this.open = true;
84
+ this.disabled = false;
85
+ this.variant = 'primary';
86
+ this.mode = 'selectable';
87
+ }
88
+ select() {
89
+ this.selected = !this.selected; // Toggle the selected state
90
+ this.wcsChipSelectChange.emit({ value: this.value, selected: this.selected });
91
+ }
92
+ dismiss() {
93
+ this.open = false;
94
+ this.wcsChipDismiss.emit({ value: this.value });
95
+ this.focusNextChip();
96
+ }
97
+ focusNextChip() {
98
+ let currentElement = this.el.nextElementSibling;
99
+ while (currentElement) {
100
+ if (this.isActionableChip(currentElement)) {
101
+ this.focusChip(currentElement);
102
+ return;
103
+ }
104
+ currentElement = currentElement.nextElementSibling;
105
+ }
106
+ }
107
+ isActionableChip(element) {
108
+ return element instanceof HTMLElement
109
+ && element.tagName === 'WCS-CHIP'
110
+ && !element.disabled;
111
+ }
112
+ focusChip(chip) {
113
+ var _a, _b;
114
+ if (chip.mode === 'selectable') {
115
+ chip.focus();
116
+ }
117
+ else if (chip.mode === 'dismissible') {
118
+ (_b = (_a = chip.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('button')) === null || _b === void 0 ? void 0 : _b.focus();
119
+ }
120
+ }
121
+ handleClick() {
122
+ if (this.disabled || this.mode !== 'selectable') {
123
+ return;
124
+ }
125
+ this.select();
126
+ }
127
+ ;
128
+ handleKeydown(ev) {
129
+ if (this.disabled) {
130
+ return;
131
+ }
132
+ if (this.mode === 'selectable') {
133
+ if (ev.key === 'Enter' || ev.key === ' ') {
134
+ this.select();
135
+ }
136
+ }
137
+ else if (this.mode === 'dismissible') {
138
+ if (ev.key === 'Delete' || ev.key === 'Backspace') {
139
+ this.dismiss();
140
+ }
141
+ }
142
+ }
143
+ render() {
144
+ const commonProps = {
145
+ 'aria-disabled': this.disabled ? 'true' : null
146
+ };
147
+ if (this.mode === 'selectable') {
148
+ return (h(Host, Object.assign({}, commonProps, { role: "checkbox", "aria-checked": this.selected ? 'true' : 'false', tabindex: this.disabled ? -1 : 0, onClick: this.handleClick.bind(this), onKeyDown: this.handleKeydown.bind(this) }), this.selected && (h("svg", { class: "check-icon", "aria-hidden": "true", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M23.712 8.3011L8.0292 23.7157C7.6356 24.095 6.9984 24.095 6.6264 23.7157L0.288 17.4955C-0.096 17.1226 -0.096 16.496 0.288 16.1192L2.1552 14.2739C2.5536 13.9036 3.1776 13.9036 3.5532 14.2739L6.6264 17.2764C6.9984 17.6583 7.6356 17.6583 8.0292 17.2764L20.4384 5.08081C20.8236 4.70662 21.4536 4.70662 21.8364 5.08081L23.712 6.91841C24.096 7.29516 24.096 7.91923 23.712 8.3011Z", fill: "white" }))), h("span", null, this.label)));
149
+ }
150
+ else {
151
+ return (h(Host, Object.assign({}, commonProps), h("span", null, this.label), h("button", { "aria-label": `Supprimer ${this.label}`, disabled: this.disabled, onClick: this.handleDismiss.bind(this), onKeyDown: this.handleKeydown.bind(this) }, h("svg", { class: "dismiss-icon", "aria-hidden": "true", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M14.2656 12.0298L19.588 6.72176C20.1908 6.12119 20.1061 5.05213 19.5034 4.45043C18.9006 3.84986 17.914 3.84986 17.3112 4.45043L11.9887 9.7596L6.66743 4.45043C6.06351 3.84986 5.07691 3.84986 4.47412 4.45043C3.87132 5.05213 3.82843 6.07942 4.43122 6.68112L9.75365 11.9892L4.43122 17.2983C3.82843 17.8989 3.87132 18.9262 4.47412 19.5279C5.07691 20.1296 6.10527 20.1702 6.70807 19.5685L12.0305 14.2605L17.3112 19.5279C17.914 20.1296 18.9006 20.1296 19.5034 19.5279C20.1061 18.9262 20.149 17.8989 19.5462 17.2983L14.2656 12.0298Z", fill: "currentColor" })))));
152
+ }
153
+ }
154
+ static get is() { return "wcs-chip"; }
155
+ static get encapsulation() { return "shadow"; }
156
+ static get originalStyleUrls() {
157
+ return {
158
+ "$": ["chip.scss"]
159
+ };
160
+ }
161
+ static get styleUrls() {
162
+ return {
163
+ "$": ["chip.css"]
164
+ };
165
+ }
166
+ static get properties() {
167
+ return {
168
+ "value": {
169
+ "type": "string",
170
+ "mutable": false,
171
+ "complexType": {
172
+ "original": "string",
173
+ "resolved": "string",
174
+ "references": {}
175
+ },
176
+ "required": false,
177
+ "optional": false,
178
+ "docs": {
179
+ "tags": [],
180
+ "text": "Unique value representing the chip identifier in events."
181
+ },
182
+ "attribute": "value",
183
+ "reflect": false
184
+ },
185
+ "label": {
186
+ "type": "string",
187
+ "mutable": false,
188
+ "complexType": {
189
+ "original": "string",
190
+ "resolved": "string",
191
+ "references": {}
192
+ },
193
+ "required": false,
194
+ "optional": false,
195
+ "docs": {
196
+ "tags": [],
197
+ "text": "Text label displayed on the chip."
198
+ },
199
+ "attribute": "label",
200
+ "reflect": false
201
+ },
202
+ "selected": {
203
+ "type": "boolean",
204
+ "mutable": false,
205
+ "complexType": {
206
+ "original": "boolean",
207
+ "resolved": "boolean",
208
+ "references": {}
209
+ },
210
+ "required": false,
211
+ "optional": false,
212
+ "docs": {
213
+ "tags": [],
214
+ "text": "If `true`, the chip is selected.\nThis property is only used in 'selectable' mode."
215
+ },
216
+ "attribute": "selected",
217
+ "reflect": true,
218
+ "defaultValue": "false"
219
+ },
220
+ "open": {
221
+ "type": "boolean",
222
+ "mutable": false,
223
+ "complexType": {
224
+ "original": "boolean",
225
+ "resolved": "boolean",
226
+ "references": {}
227
+ },
228
+ "required": false,
229
+ "optional": false,
230
+ "docs": {
231
+ "tags": [],
232
+ "text": "If `true`, the chip is open.\nThis property is used to control the visibility of the chip in the dismissible mode.\nWhen the user clicks the dismiss icon, this property automatically becomes `false`, hiding the chip."
233
+ },
234
+ "attribute": "open",
235
+ "reflect": true,
236
+ "defaultValue": "true"
237
+ },
238
+ "disabled": {
239
+ "type": "boolean",
240
+ "mutable": false,
241
+ "complexType": {
242
+ "original": "boolean",
243
+ "resolved": "boolean",
244
+ "references": {}
245
+ },
246
+ "required": false,
247
+ "optional": false,
248
+ "docs": {
249
+ "tags": [],
250
+ "text": "If `true`, the chip is disabled.\nThe chip will not respond to click events and will not emit any events.\nThis property is used in both 'selectable' and 'dismissible' modes."
251
+ },
252
+ "attribute": "disabled",
253
+ "reflect": true,
254
+ "defaultValue": "false"
255
+ },
256
+ "variant": {
257
+ "type": "string",
258
+ "mutable": false,
259
+ "complexType": {
260
+ "original": "WcsChipVariant",
261
+ "resolved": "\"primary\" | \"secondary\"",
262
+ "references": {
263
+ "WcsChipVariant": {
264
+ "location": "import",
265
+ "path": "./chip-interface",
266
+ "id": "src/components/chip/chip-interface.ts::WcsChipVariant"
267
+ }
268
+ }
269
+ },
270
+ "required": false,
271
+ "optional": false,
272
+ "docs": {
273
+ "tags": [],
274
+ "text": "Defines the visual style of the chip for the dismissible mode."
275
+ },
276
+ "attribute": "variant",
277
+ "reflect": true,
278
+ "defaultValue": "'primary'"
279
+ },
280
+ "mode": {
281
+ "type": "string",
282
+ "mutable": false,
283
+ "complexType": {
284
+ "original": "WcsChipMode",
285
+ "resolved": "\"dismissible\" | \"selectable\"",
286
+ "references": {
287
+ "WcsChipMode": {
288
+ "location": "import",
289
+ "path": "./chip-interface",
290
+ "id": "src/components/chip/chip-interface.ts::WcsChipMode"
291
+ }
292
+ }
293
+ },
294
+ "required": false,
295
+ "optional": false,
296
+ "docs": {
297
+ "tags": [],
298
+ "text": "Defines the mode of the chip.\nCan be 'selectable' or 'dismissible'.\n- 'selectable': The chip can be selected and emits an event when clicked.\n- 'dismissible': The chip can be dismissed (removed) and emits an event when the dismiss icon is clicked."
299
+ },
300
+ "attribute": "mode",
301
+ "reflect": true,
302
+ "defaultValue": "'selectable'"
303
+ }
304
+ };
305
+ }
306
+ static get events() {
307
+ return [{
308
+ "method": "wcsChipSelectChange",
309
+ "name": "wcsChipSelectChange",
310
+ "bubbles": true,
311
+ "cancelable": true,
312
+ "composed": true,
313
+ "docs": {
314
+ "tags": [],
315
+ "text": "Emitted when the chip is clicked in 'selectable' mode."
316
+ },
317
+ "complexType": {
318
+ "original": "{ value: string; selected: boolean }",
319
+ "resolved": "{ value: string; selected: boolean; }",
320
+ "references": {}
321
+ }
322
+ }, {
323
+ "method": "wcsChipDismiss",
324
+ "name": "wcsChipDismiss",
325
+ "bubbles": true,
326
+ "cancelable": true,
327
+ "composed": true,
328
+ "docs": {
329
+ "tags": [],
330
+ "text": "Emitted when the dismiss icon is clicked in 'dismissible' mode."
331
+ },
332
+ "complexType": {
333
+ "original": "{ value: string }",
334
+ "resolved": "{ value: string; }",
335
+ "references": {}
336
+ }
337
+ }];
338
+ }
339
+ static get elementRef() { return "el"; }
340
+ }
341
+ //# sourceMappingURL=chip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chip.js","sourceRoot":"","sources":["../../../src/components/chip/chip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAG3G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AAMH,MAAM,OAAO,IAAI;;QAoGL,kBAAa,GAAG,CAAC,KAAY,EAAE,EAAE;YACrC,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;gBAC/C,OAAO;YACX,CAAC;YACD,KAAK,CAAC,eAAe,EAAE,CAAC,CAAC,qEAAqE;YAC9F,IAAI,CAAC,OAAO,EAAE,CAAC;QACnB,CAAC,CAAC;;;wBA1FkC,KAAK;oBAOT,IAAI;wBAOA,KAAK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,IAAI,CAAC,QAAQ,IAAI,CACd,WAAK,KAAK,EAAC,YAAY,iBAAa,MAAM,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAChF,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,4BAA4B;oBAC/C,YACI,CAAC,EAAC,uXAAuX,EACzX,IAAI,EAAC,OAAO,GAAG,CACjB,CACT;gBACD,gBAAO,IAAI,CAAC,KAAK,CAAQ,CACtB,CACV,CAAC;QACN,CAAC;aAAM,CAAC;YACJ,OAAO,CACH,EAAC,IAAI,oBACG,WAAW;gBAEf,gBAAO,IAAI,CAAC,KAAK,CAAQ;gBACzB,4BACgB,aAAa,IAAI,CAAC,KAAK,EAAE,EACrC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EACtC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;oBAExC,WAAK,KAAK,EAAC,cAAc,iBAAa,MAAM,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAClF,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,4BAA4B;wBAC/C,YACI,CAAC,EAAC,8gBAA8gB,EAChhB,IAAI,EAAC,cAAc,GAAG,CACxB,CACD,CACN,CACV,CAAC;QACN,CAAC;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, ComponentInterface, EventEmitter, Prop, Event, Element, Host, h } from '@stencil/core';\nimport { WcsChipMode, WcsChipVariant } from './chip-interface';\n\n/**\n * The chip component is a small, interactive element that can be used to represent an input, filter, or tag.\n * It can be in one of two modes: 'selectable' or 'dismissible'.\n * - In 'selectable' mode, the chip can be selected or deselected, and emits an event when clicked.\n * - In 'dismissible' mode, the chip can be dismissed (removed) by clicking a dismiss icon, and emits an event when the dismiss icon is clicked.\n *\n * @cssprop --wcs-chip-height - Height of the chip\n * @cssprop --wcs-chip-font-size - Font size of the chip text\n * @cssprop --wcs-chip-font-weight - Font weight of the chip text\n *\n * @cssprop --wcs-chip-focus-outline-border-width - Border width of the chip focus outline\n *\n * @cssprop --wcs-chip-padding-vertical - Vertical padding (top - bottom) of the chip\n * @cssprop --wcs-chip-padding-horizontal - Horizontal padding (left - right) of the chip\n * @cssprop --wcs-chip-padding-horizontal-dismissible - Horizontal padding (left - right) of the chip with 'dismissible' mode\n *\n * @cssprop --wcs-chip-selectable-background-color - Background color of the chip with 'selectable' mode in default state\n * @cssprop --wcs-chip-selectable-background-color-pressed - Background color of the chip with 'selectable' mode when pressed\n * @cssprop --wcs-chip-selectable-background-color-hover - Background color of the chip with 'selectable' mode when hovered\n * @cssprop --wcs-chip-selectable-background-color-selected - Background color of the chip with 'selectable' mode when selected\n * @cssprop --wcs-chip-selectable-background-color-selected-hover - Background color of the chip with 'selectable' mode when selected and hovered\n * @cssprop --wcs-chip-selectable-background-color-selected-pressed - Background color of the chip with 'selectable' mode when selected and pressed\n * @cssprop --wcs-chip-selectable-background-color-selected-disabled - Background color of the chip with 'selectable' mode when selected and disabled\n *\n * @cssprop --wcs-chip-selectable-color - Text color of the chip with 'selectable' mode in default state\n * @cssprop --wcs-chip-selectable-color-hover - Text color of the chip with 'selectable' mode when hovered\n * @cssprop --wcs-chip-selectable-color-pressed - Text color of the chip with 'selectable' mode when pressed\n * @cssprop --wcs-chip-selectable-color-disabled - Text color of the chip with 'selectable' mode when disabled\n * @cssprop --wcs-chip-selectable-color-selected - Text color of the chip with 'selectable' mode when selected\n * @cssprop --wcs-chip-selectable-color-selected-hover - Text color of the chip with 'selectable' mode when selected and hovered\n * @cssprop --wcs-chip-selectable-color-selected-pressed - Text color of the chip with 'selectable' mode when selected and pressed\n *\n * @cssprop --wcs-chip-border-radius - Border radius of the chip\n * @cssprop --wcs-chip-border-line-width - Border line width of the chip\n * @cssprop --wcs-chip-selectable-border-color - Border color of the chip with 'selectable' mode in default state\n * @cssprop --wcs-chip-selectable-border-color-hover - Border color of the chip with 'selectable' mode when hovered\n * @cssprop --wcs-chip-selectable-border-color-pressed - Border color of the chip with 'selectable' mode when pressed\n * @cssprop --wcs-chip-selectable-border-color-disabled - Border color of the chip with 'selectable' mode when disabled\n *\n * @cssprop --wcs-chip-selectable-content-gap - Gap between content elements in chip with 'selectable' mode\n * @cssprop --wcs-chip-selectable-focus-outline-color - Focus outline color of the chip with 'selectable' mode\n *\n * @cssprop --wcs-chip-dismissible-content-gap - Gap between content elements in chip with 'dismissible' mode\n * @cssprop --wcs-chip-dismissible-padding-right - Right padding of the chip with 'dismissible' mode\n * @cssprop --wcs-chip-dismissible-button-outline-radius - Outline radius of the button for the chip with 'dismissible' mode\n *\n * @cssprop --wcs-chip-dismissible-primary-focus-outline-color - Focus outline color of the chip with 'dismissible' mode and 'primary' variant\n * @cssprop --wcs-chip-dismissible-primary-border-color - Border color of the chip with 'dismissible' mode and 'primary' variant\n * @cssprop --wcs-chip-dismissible-primary-border-color-disabled - Border color of the chip with 'dismissible' mode and 'primary' variant when disabled\n * @cssprop --wcs-chip-dismissible-primary-color - Text color of the chip with 'dismissible' mode and 'primary' variant\n * @cssprop --wcs-chip-dismissible-primary-color-hover - Text color of the chip with 'dismissible' mode and 'primary' variant when hovered\n * @cssprop --wcs-chip-dismissible-primary-color-pressed - Text color of the chip with 'dismissible' mode and 'primary' variant when pressed\n * @cssprop --wcs-chip-dismissible-primary-color-disabled - Text color of the chip with 'dismissible' mode and 'primary' variant when disabled\n * @cssprop --wcs-chip-dismissible-primary-background-color - Background color of the chip with 'dismissible' mode and 'primary' variant\n * @cssprop --wcs-chip-dismissible-primary-background-color-hover - Background color of the chip with 'dismissible' mode and 'primary' variant when hovered\n * @cssprop --wcs-chip-dismissible-primary-background-color-pressed - Background color of the chip with 'dismissible' mode and 'primary' variant when pressed\n * @cssprop --wcs-chip-dismissible-primary-background-color-disabled - Background color of the chip with 'dismissible' mode and 'primary' variant when disabled\n *\n * @cssprop --wcs-chip-dismissible-secondary-button-focus-outline-color - Button focus outline color of the chip with 'dismissible' mode and 'secondary' variant\n * @cssprop --wcs-chip-dismissible-secondary-border-color - Border color of the chip with 'dismissible' mode and 'secondary' variant\n * @cssprop --wcs-chip-dismissible-secondary-border-color-disabled - Border color of the chip with 'dismissible' mode and 'secondary' variant when disabled\n * @cssprop --wcs-chip-dismissible-secondary-color - Text color of the chip with 'dismissible' mode and 'secondary' variant\n * @cssprop --wcs-chip-dismissible-secondary-color-disabled - Text color of the chip with 'dismissible' mode and 'secondary' variant when disabled\n * @cssprop --wcs-chip-dismissible-secondary-background-color - Background color of the chip with 'dismissible' mode and 'secondary' variant\n * @cssprop --wcs-chip-dismissible-secondary-button-background-color - Button background color of the chip with 'dismissible' mode and 'secondary' variant\n * @cssprop --wcs-chip-dismissible-secondary-button-background-color-hover - Button background color of the chip with 'dismissible' mode and 'secondary' variant when hovered\n * @cssprop --wcs-chip-dismissible-secondary-button-background-color-pressed - Button background color of the chip with 'dismissible' mode and 'secondary' variant when pressed\n * @cssprop --wcs-chip-dismissible-secondary-button-background-color-disabled - Button background color of the chip with 'dismissible' mode and 'secondary' variant when disabled\n */\n@Component({\n tag: 'wcs-chip',\n styleUrl: 'chip.scss',\n shadow: true\n})\nexport class Chip implements ComponentInterface {\n @Element() el!: HTMLWcsChipElement;\n /**\n * Unique value representing the chip identifier in events.\n */\n @Prop() value: string;\n\n /**\n * Text label displayed on the chip.\n */\n @Prop() label: string;\n\n /**\n * If `true`, the chip is selected.\n * This property is only used in 'selectable' mode.\n */\n @Prop({ reflect: true }) selected = false;\n\n /**\n * If `true`, the chip is open.\n * This property is used to control the visibility of the chip in the dismissible mode.\n * When the user clicks the dismiss icon, this property automatically becomes `false`, hiding the chip.\n */\n @Prop({ reflect: true }) open = true;\n\n /**\n * If `true`, the chip is disabled.\n * The chip will not respond to click events and will not emit any events.\n * This property is used in both 'selectable' and 'dismissible' modes.\n */\n @Prop({ reflect: true }) disabled = false;\n\n /**\n * Defines the visual style of the chip for the dismissible mode.\n */\n @Prop({ reflect: true }) variant: WcsChipVariant = 'primary';\n\n /**\n * Defines the mode of the chip.\n * Can be 'selectable' or 'dismissible'.\n * - 'selectable': The chip can be selected and emits an event when clicked.\n * - 'dismissible': The chip can be dismissed (removed) and emits an event when the dismiss icon is clicked.\n */\n @Prop({ reflect: true }) mode: WcsChipMode = 'selectable';\n\n /**\n * Emitted when the chip is clicked in 'selectable' mode.\n */\n @Event() wcsChipSelectChange: EventEmitter<{ value: string; selected: boolean }>;\n\n /**\n * Emitted when the dismiss icon is clicked in 'dismissible' mode.\n */\n @Event() wcsChipDismiss: EventEmitter<{ value: string }>;\n\n\n private select() {\n this.selected = !this.selected; // Toggle the selected state\n this.wcsChipSelectChange.emit({ value: this.value, selected: this.selected });\n }\n\n private dismiss() {\n this.open = false;\n this.wcsChipDismiss.emit({ value: this.value });\n this.focusNextChip();\n }\n\n private focusNextChip(): void {\n let currentElement = this.el.nextElementSibling;\n\n while (currentElement) {\n if (this.isActionableChip(currentElement)) {\n this.focusChip(currentElement as HTMLWcsChipElement);\n return;\n }\n currentElement = currentElement.nextElementSibling;\n }\n }\n\n private isActionableChip(element: Element | null): element is HTMLWcsChipElement {\n return element instanceof HTMLElement\n && element.tagName === 'WCS-CHIP'\n && !(element as HTMLWcsChipElement).disabled;\n }\n\n private focusChip(chip: HTMLWcsChipElement): void {\n if (chip.mode === 'selectable') {\n chip.focus();\n } else if (chip.mode === 'dismissible') {\n chip.shadowRoot?.querySelector('button')?.focus();\n }\n }\n\n private handleClick() {\n if (this.disabled || this.mode !== 'selectable') {\n return;\n }\n this.select();\n };\n\n private handleDismiss = (event: Event) => {\n if (this.disabled || this.mode !== 'dismissible') {\n return;\n }\n event.stopPropagation(); // Prevent the click event from bubbling up to the chip click handler\n this.dismiss();\n };\n\n private handleKeydown(ev) {\n if (this.disabled) {\n return;\n }\n if (this.mode === 'selectable') {\n if (ev.key === 'Enter' || ev.key === ' ') {\n this.select();\n }\n } else if (this.mode === 'dismissible') {\n if (ev.key === 'Delete' || ev.key === 'Backspace') {\n this.dismiss();\n }\n }\n }\n\n render() {\n const commonProps = {\n 'aria-disabled': this.disabled ? 'true' : null\n };\n\n if (this.mode === 'selectable') {\n return (\n <Host\n {...commonProps}\n role=\"checkbox\"\n aria-checked={this.selected ? 'true' : 'false'}\n tabindex={this.disabled ? -1 : 0}\n onClick={this.handleClick.bind(this)}\n onKeyDown={this.handleKeydown.bind(this)}\n >\n {this.selected && (\n <svg class=\"check-icon\" aria-hidden=\"true\" width=\"12\" height=\"12\" viewBox=\"0 0 24 24\"\n fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M23.712 8.3011L8.0292 23.7157C7.6356 24.095 6.9984 24.095 6.6264 23.7157L0.288 17.4955C-0.096 17.1226 -0.096 16.496 0.288 16.1192L2.1552 14.2739C2.5536 13.9036 3.1776 13.9036 3.5532 14.2739L6.6264 17.2764C6.9984 17.6583 7.6356 17.6583 8.0292 17.2764L20.4384 5.08081C20.8236 4.70662 21.4536 4.70662 21.8364 5.08081L23.712 6.91841C24.096 7.29516 24.096 7.91923 23.712 8.3011Z\"\n fill=\"white\" />\n </svg>\n )}\n <span>{this.label}</span>\n </Host>\n );\n } else {\n return (\n <Host\n {...commonProps}\n >\n <span>{this.label}</span>\n <button\n aria-label={`Supprimer ${this.label}`}\n disabled={this.disabled}\n onClick={this.handleDismiss.bind(this)}\n onKeyDown={this.handleKeydown.bind(this)}\n >\n <svg class=\"dismiss-icon\" aria-hidden=\"true\" width=\"12\" height=\"12\" viewBox=\"0 0 24 24\"\n fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M14.2656 12.0298L19.588 6.72176C20.1908 6.12119 20.1061 5.05213 19.5034 4.45043C18.9006 3.84986 17.914 3.84986 17.3112 4.45043L11.9887 9.7596L6.66743 4.45043C6.06351 3.84986 5.07691 3.84986 4.47412 4.45043C3.87132 5.05213 3.82843 6.07942 4.43122 6.68112L9.75365 11.9892L4.43122 17.2983C3.82843 17.8989 3.87132 18.9262 4.47412 19.5279C5.07691 20.1296 6.10527 20.1702 6.70807 19.5685L12.0305 14.2605L17.3112 19.5279C17.914 20.1296 18.9006 20.1296 19.5034 19.5279C20.1061 18.9262 20.149 17.8989 19.5462 17.2983L14.2656 12.0298Z\"\n fill=\"currentColor\" />\n </svg>\n </button>\n </Host>\n );\n }\n }\n}\n\n"]}
@@ -61,6 +61,21 @@
61
61
  line-height: var(--wcs-com-nav-app-name-line-height);
62
62
  color: var(--wcs-com-nav-app-name-color);
63
63
  }
64
+ :host .app-name ::slotted(a) {
65
+ user-select: none;
66
+ cursor: pointer;
67
+ text-decoration: none;
68
+ color: inherit;
69
+ font-weight: inherit;
70
+ }
71
+ :host .app-name ::slotted(a:focus-visible) {
72
+ outline: none;
73
+ }
74
+ :host .app-name:focus-within {
75
+ outline: var(--wcs-semantic-border-width-large) dashed var(--wcs-com-nav-focus-outline-color);
76
+ outline-offset: var(--wcs-semantic-spacing-small);
77
+ border-radius: 0.1rem;
78
+ }
64
79
  :host .menu-bar {
65
80
  display: none;
66
81
  }
@@ -1,13 +1,12 @@
1
- import { newE2EPage } from "@stencil/core/testing";
2
- import { setWcsContent } from "../../utils/tests";
3
- describe('Com nav', () => {
4
- describe('Keyboard navigation', () => {
5
- describe('Mobile menu', () => {
6
- let page;
7
- beforeEach(async () => {
1
+ import { setWcsContent } from "../../utils/playwright/test";
2
+ import { test } from "@stencil/playwright";
3
+ import { expect } from "@playwright/test";
4
+ test.describe('Com nav', () => {
5
+ test.describe('Keyboard navigation', () => {
6
+ test.describe('Mobile menu', () => {
7
+ test.beforeEach(async ({ page }) => {
8
8
  // Given
9
- page = await newE2EPage();
10
- await page.setViewport({
9
+ await page.setViewportSize({
11
10
  width: 320,
12
11
  height: 480,
13
12
  });
@@ -65,49 +64,67 @@ describe('Com nav', () => {
65
64
  </wcs-com-nav>
66
65
  `);
67
66
  });
68
- it.each(['Enter', 'Space'])('should open menu when press %s key on mobile menu icon', async (key) => {
69
- // Given the content is set in beforeEach method
67
+ test('should open menu when press Enter key on mobile menu icon', async ({ page }) => {
70
68
  // When
71
- const menuIcon = await page.find('wcs-com-nav >>> #mobile-menu-icon');
69
+ const menuIcon = page.locator('wcs-com-nav #mobile-menu-icon');
72
70
  await menuIcon.focus();
73
- await page.keyboard.press(key);
71
+ await page.keyboard.press('Enter');
74
72
  await page.waitForChanges();
75
73
  // Then
76
- const menu = await page.find('wcs-com-nav >>> .mobile-overlay');
77
- expect(menu).toBeDefined();
78
- expect(menu).toHaveAttribute('data-mobile-open');
74
+ const menu = page.locator('wcs-com-nav .mobile-overlay');
75
+ await expect(menu).toHaveAttribute('data-mobile-open');
79
76
  });
80
- it.each(['Enter', 'Space'])('should close menu when it opens and press %s key on mobile menu icon', async (key) => {
77
+ test('should open menu when press Space key on mobile menu icon', async ({ page }) => {
78
+ // When
79
+ const menuIcon = page.locator('wcs-com-nav #mobile-menu-icon');
80
+ await menuIcon.focus();
81
+ await page.keyboard.press('Space');
82
+ await page.waitForChanges();
83
+ // Then
84
+ const menu = page.locator('wcs-com-nav .mobile-overlay');
85
+ await expect(menu).toHaveAttribute('data-mobile-open');
86
+ });
87
+ test('should close menu when it opens and press Enter key on mobile menu icon', async ({ page }) => {
81
88
  // Given
82
- // the content is set in beforeEach method
83
- const menuIcon = await page.find('wcs-com-nav >>> #mobile-menu-icon');
89
+ const menuIcon = page.locator('wcs-com-nav #mobile-menu-icon');
84
90
  await menuIcon.focus();
85
- await page.keyboard.press(key);
86
- // Wait for menu to open
91
+ await page.keyboard.press('Enter');
87
92
  await page.waitForChanges();
88
93
  // Close the menu
89
- await page.keyboard.press(key);
94
+ await page.keyboard.press('Enter');
90
95
  await page.waitForChanges();
91
96
  // Then
92
- const menu = await page.find('wcs-com-nav >>> .mobile-overlay');
93
- expect(menu).not.toHaveAttribute('data-mobile-open');
97
+ const menu = page.locator('wcs-com-nav .mobile-overlay');
98
+ await expect(menu).not.toHaveAttribute('data-mobile-open');
94
99
  });
95
- it('should be touchable on mobile and open the menu', async () => {
100
+ test('should close menu when it opens and press Space key on mobile menu icon', async ({ page }) => {
96
101
  // Given
97
- // the content is set in beforeEach method
98
- const menuIcon = await page.find('wcs-com-nav >>> #mobile-menu-icon');
99
- await menuIcon.tap();
102
+ const menuIcon = page.locator('wcs-com-nav #mobile-menu-icon');
103
+ await menuIcon.focus();
104
+ await page.keyboard.press('Space');
105
+ await page.waitForChanges();
106
+ // Close the menu
107
+ await page.keyboard.press('Space');
108
+ await page.waitForChanges();
109
+ // Then
110
+ const menu = page.locator('wcs-com-nav .mobile-overlay');
111
+ await expect(menu).not.toHaveAttribute('data-mobile-open');
112
+ });
113
+ test('should be touchable on mobile and open the menu', async ({ page }) => {
114
+ // Given
115
+ const menuIcon = page.locator('wcs-com-nav #mobile-menu-icon');
116
+ await menuIcon.click();
117
+ await page.waitForChanges();
100
118
  // Then
101
- const menu = await page.find('wcs-com-nav >>> .mobile-overlay');
102
- expect(menu).toBeDefined();
103
- expect(menu).toHaveAttribute('data-mobile-open');
119
+ const menu = page.locator('wcs-com-nav .mobile-overlay');
120
+ await expect(menu).toHaveAttribute('data-mobile-open');
104
121
  });
105
- it('should close menu when it opens and press escape key anywhere', async () => {
122
+ test('should close menu when it opens and press escape key anywhere', async ({ page }) => {
106
123
  // Given
107
- // the content is set in beforeEach method
108
- const menuIcon = await page.find('wcs-com-nav >>> #mobile-menu-icon');
124
+ const menuIcon = page.locator('wcs-com-nav #mobile-menu-icon');
109
125
  await menuIcon.focus();
110
126
  await page.keyboard.press('Enter');
127
+ await page.waitForChanges();
111
128
  // When
112
129
  // Navigate on menu
113
130
  await page.keyboard.press('Tab');
@@ -116,24 +133,23 @@ describe('Com nav', () => {
116
133
  await page.keyboard.press('Escape');
117
134
  await page.waitForChanges();
118
135
  // Then
119
- const menu = await page.find('wcs-com-nav >>> .mobile-overlay');
120
- expect(menu).not.toHaveAttribute('data-mobile-open');
136
+ const menu = page.locator('wcs-com-nav .mobile-overlay');
137
+ await expect(menu).not.toHaveAttribute('data-mobile-open');
121
138
  });
122
- it('should close the mobile menu when clicking on a wcs-com-nav-item', async () => {
139
+ test('should close the mobile menu when clicking on a wcs-com-nav-item', async ({ page }) => {
123
140
  // Given
124
- const menuIcon = await page.find('wcs-com-nav >>> #mobile-menu-icon');
125
- await menuIcon.tap();
126
- // Wait for menu to open
141
+ const menuIcon = page.locator('wcs-com-nav #mobile-menu-icon');
142
+ await menuIcon.click();
127
143
  await page.waitForChanges();
128
144
  // When
129
- const navItem = await page.find('#com-nav-item-last-item');
145
+ const navItem = page.locator('#com-nav-item-last-item');
130
146
  await navItem.click();
131
147
  await page.waitForChanges();
132
148
  // Then
133
- const menu = await page.find('wcs-com-nav >>> .mobile-overlay');
134
- expect(menu).not.toHaveAttribute('data-mobile-open');
149
+ const menu = page.locator('wcs-com-nav .mobile-overlay');
150
+ await expect(menu).not.toHaveAttribute('data-mobile-open');
135
151
  });
136
152
  });
137
153
  });
138
154
  });
139
- //# sourceMappingURL=com-nav.e2e.js.map
155
+ //# sourceMappingURL=com-nav.e2e.playwright.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"com-nav.e2e.playwright.js","sourceRoot":"","sources":["../../../src/components/com-nav/com-nav.e2e.playwright.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAW,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,IAAI,CAAC,QAAQ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M,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBACjC,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;gBACpC,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;gBAE5B,OAAO;gBACP,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,6BAA6B,CAAC,CAAC;gBACzD,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;YAC/D,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,kEAAkE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAqB,EAAE,EAAE;gBAC3G,QAAQ;gBACR,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,+BAA+B,CAAC,CAAC;gBAC/D,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAC;gBACvB,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;gBAE5B,OAAO;gBACP,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;gBACxD,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;gBACtB,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;gBAE5B,OAAO;gBACP,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,6BAA6B,CAAC,CAAC;gBACzD,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;YAC/D,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import { setWcsContent } from '../../utils/playwright/test';\nimport { test, E2EPage } from \"@stencil/playwright\";\n\nimport { expect } from \"@playwright/test\";\n\ntest.describe('Com nav', () => {\n test.describe('Keyboard navigation', () => {\n test.describe('Mobile menu', () => {\n test.beforeEach(async ({ page }: { page: E2EPage }) => {\n // Given\n await page.setViewportSize({\n width: 320,\n height: 480,\n });\n\n await setWcsContent(page, `\n <wcs-com-nav app-name=\"App Test\">\n <wcs-com-nav-submenu label=\"Sous menu\" panel-title=\"Sous Menu\"\n panel-description=\"Nullam id dolor id nibh ultricies vehicula ut id elit. Cras mattis consectetur purus sit amet fermentum. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.\">\n <wcs-com-nav-item>\n <a href=\"#\">Loisirs & Tourisme</a>\n </wcs-com-nav-item>\n <wcs-com-nav-item>\n <a href=\"#\">Toutes les lignes</a>\n </wcs-com-nav-item>\n <wcs-com-nav-item>\n <a href=\"#\">Services mobiles</a>\n </wcs-com-nav-item>\n <wcs-com-nav-item>\n <a href=\"#\">Au quotidien</a>\n </wcs-com-nav-item>\n <wcs-com-nav-item>\n <a href=\"#\">Le réseau</a>\n </wcs-com-nav-item>\n </wcs-com-nav-submenu>\n <wcs-com-nav-submenu label=\"Autre sous menu\" panel-title=\"Autre Sous Menu\"\n panel-description=\"Un autre sous menu avec des catégories. Cras mattis consectetur purus sit amet fermentum. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.\">\n <wcs-com-nav-item>\n <a href=\"#\">Le réseau</a>\n </wcs-com-nav-item>\n <wcs-com-nav-category label=\"Une catégorie\">\n <wcs-com-nav-item>\n <a href=\"#\">Services mobiles text plus long</a>\n </wcs-com-nav-item>\n <wcs-com-nav-item>\n <a href=\"#\">Au quotidien</a>\n </wcs-com-nav-item>\n <wcs-com-nav-item>\n <a href=\"#\">Le réseau</a>\n </wcs-com-nav-item>\n </wcs-com-nav-category>\n <wcs-com-nav-category label=\"Une catégorie\">\n <wcs-com-nav-item>\n <a href=\"#\">1</a>\n </wcs-com-nav-item>\n <wcs-com-nav-item>\n <a href=\"#\">2</a>\n </wcs-com-nav-item>\n </wcs-com-nav-category>\n </wcs-com-nav-submenu>\n <wcs-com-nav-item id=\"com-nav-item-last-item\">\n <a href=\"https://sncf.com\" target=\"_blank\">Ressource externe</a>\n </wcs-com-nav-item>\n <div slot=\"actions\">\n <wcs-button mode=\"clear\" class=\"wcs-dark\">Connexion</wcs-button>\n </div>\n </wcs-com-nav>\n `);\n });\n\n test('should open menu when press Enter key on mobile menu icon', async ({ page }: { page: E2EPage }) => {\n // When\n const menuIcon = page.locator('wcs-com-nav #mobile-menu-icon');\n await menuIcon.focus();\n await page.keyboard.press('Enter');\n await page.waitForChanges();\n\n // Then\n const menu = page.locator('wcs-com-nav .mobile-overlay');\n await expect(menu).toHaveAttribute('data-mobile-open');\n });\n\n test('should open menu when press Space key on mobile menu icon', async ({ page }: { page: E2EPage }) => {\n // When\n const menuIcon = page.locator('wcs-com-nav #mobile-menu-icon');\n await menuIcon.focus();\n await page.keyboard.press('Space');\n await page.waitForChanges();\n\n // Then\n const menu = page.locator('wcs-com-nav .mobile-overlay');\n await expect(menu).toHaveAttribute('data-mobile-open');\n });\n\n test('should close menu when it opens and press Enter key on mobile menu icon', async ({ page }: { page: E2EPage }) => {\n // Given\n const menuIcon = page.locator('wcs-com-nav #mobile-menu-icon');\n await menuIcon.focus();\n await page.keyboard.press('Enter');\n await page.waitForChanges();\n\n // Close the menu\n await page.keyboard.press('Enter');\n await page.waitForChanges();\n\n // Then\n const menu = page.locator('wcs-com-nav .mobile-overlay');\n await expect(menu).not.toHaveAttribute('data-mobile-open');\n });\n\n test('should close menu when it opens and press Space key on mobile menu icon', async ({ page }: { page: E2EPage }) => {\n // Given\n const menuIcon = page.locator('wcs-com-nav #mobile-menu-icon');\n await menuIcon.focus();\n await page.keyboard.press('Space');\n await page.waitForChanges();\n\n // Close the menu\n await page.keyboard.press('Space');\n await page.waitForChanges();\n\n // Then\n const menu = page.locator('wcs-com-nav .mobile-overlay');\n await expect(menu).not.toHaveAttribute('data-mobile-open');\n });\n\n test('should be touchable on mobile and open the menu', async ({ page }: { page: E2EPage }) => {\n // Given\n const menuIcon = page.locator('wcs-com-nav #mobile-menu-icon');\n await menuIcon.click();\n await page.waitForChanges();\n\n // Then\n const menu = page.locator('wcs-com-nav .mobile-overlay');\n await expect(menu).toHaveAttribute('data-mobile-open');\n });\n\n test('should close menu when it opens and press escape key anywhere', async ({ page }: { page: E2EPage }) => {\n // Given\n const menuIcon = page.locator('wcs-com-nav #mobile-menu-icon');\n await menuIcon.focus();\n await page.keyboard.press('Enter');\n await page.waitForChanges();\n\n // When\n // Navigate on menu\n await page.keyboard.press('Tab');\n await page.keyboard.press('Tab');\n await page.keyboard.press('Tab');\n await page.keyboard.press('Escape');\n await page.waitForChanges();\n\n // Then\n const menu = page.locator('wcs-com-nav .mobile-overlay');\n await expect(menu).not.toHaveAttribute('data-mobile-open');\n });\n\n test('should close the mobile menu when clicking on a wcs-com-nav-item', async ({ page }: { page: E2EPage }) => {\n // Given\n const menuIcon = page.locator('wcs-com-nav #mobile-menu-icon');\n await menuIcon.click();\n await page.waitForChanges();\n\n // When\n const navItem = page.locator('#com-nav-item-last-item');\n await navItem.click();\n await page.waitForChanges();\n\n // Then\n const menu = page.locator('wcs-com-nav .mobile-overlay');\n await expect(menu).not.toHaveAttribute('data-mobile-open');\n });\n });\n });\n});\n"]}
@@ -78,11 +78,11 @@ export class ComNav {
78
78
  }
79
79
  render() {
80
80
  const menuAriaLabel = this.inheritedAttributes['aria-label'] || undefined;
81
- return (h(Host, { key: 'b39ff3dbd6d304ad0252e0fcfd2e0c5716b666db' }, h("div", { key: 'f84b73c9cee6295a7776576afeb61b65b71ea34e', class: "container" }, h("div", { key: 'a39b867e9d102abb4e4c13503a544681cd9b7fd8', class: "container-left" }, h("div", { key: '49db5dd80f097a9b2ccaf39fc64be9f6100108be', class: "app-name" }, this.appName, h("slot", { key: '2936888d5a805c67a3be4079a7eea62d460d42fe', name: "app-name" })), this.currentActiveSizing === 'desktop' ?
81
+ return (h(Host, { key: 'b39ff3dbd6d304ad0252e0fcfd2e0c5716b666db' }, h("div", { key: 'f84b73c9cee6295a7776576afeb61b65b71ea34e', class: "container" }, h("div", { key: 'a39b867e9d102abb4e4c13503a544681cd9b7fd8', class: "container-left" }, h("div", { key: '49db5dd80f097a9b2ccaf39fc64be9f6100108be', class: "app-name" }, this.appName, h("slot", { key: '3cfe05e6e510826ffd2168e6edc3380bc92ad459', name: "app-name" })), this.currentActiveSizing === 'desktop' ?
82
82
  h("nav", Object.assign({ role: "navigation" }, this.inheritedAttributes), h("div", { class: "menu-bar", role: "list" }, this.currentActiveSizing === 'desktop'
83
83
  ? h("slot", null)
84
84
  : null))
85
- : null), h("div", { key: 'c2c97d21d21d542a18fb141f90ce7ce91d0b12c0', class: "container-right" }, h("slot", { key: '51912b232ac4d51baf1d2c164e90ab59a787924e', name: "actions" }), this.currentActiveSizing === 'mobile' ?
85
+ : null), h("div", { key: '83496cccd32eec07f5a508dbf36b591442e668e2', class: "container-right" }, h("slot", { key: 'cf68946afcefa0b77fb57019f9734e5ff1e763aa', name: "actions" }), this.currentActiveSizing === 'mobile' ?
86
86
  h("nav", Object.assign({ id: "wcs-com-nav-mobile-menu", role: "navigation" }, this.inheritedAttributes), h("button", { id: "mobile-menu-icon", "aria-label": menuAriaLabel, "aria-expanded": this.mobileMenuOpen ? "true" : "false", "aria-controls": "wcs-com-nav-mobile-menu", onClick: () => this.mobileMenuIconClick() }), this.currentActiveSizing === 'mobile'
87
87
  ? h("div", { class: "mobile-overlay", "data-mobile-open": this.mobileMenuOpen, role: "list" }, h("slot", null))
88
88
  : null)
@@ -143,7 +143,7 @@ export class ComNav {
143
143
  "signature": "(attr: AriaAttributeName, value: string | null | undefined) => Promise<void>",
144
144
  "parameters": [{
145
145
  "name": "attr",
146
- "type": "\"role\" | `aria-${string}`",
146
+ "type": "`aria-${string}` | \"role\"",
147
147
  "docs": ""
148
148
  }, {
149
149
  "name": "value",