@six-group/ui-library 0.0.0-insider.b8b84f6 → 0.0.0-insider.c3b5116

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 (507) hide show
  1. package/README.md +9 -0
  2. package/dist/cjs/{form-control-d369af14.js → form-control-19303ed2.js} +11 -8
  3. package/dist/cjs/form-control-19303ed2.js.map +1 -0
  4. package/dist/cjs/{index-900437fc.js → index-7d73cbd6.js} +495 -122
  5. package/dist/cjs/index-7d73cbd6.js.map +1 -0
  6. package/dist/cjs/index.cjs.js +15 -0
  7. package/dist/cjs/index.cjs.js.map +1 -1
  8. package/dist/cjs/loader.cjs.js +2 -2
  9. package/dist/cjs/{scroll-03678de1.js → scroll-2c4200dc.js} +1 -2
  10. package/dist/cjs/scroll-2c4200dc.js.map +1 -0
  11. package/dist/cjs/set-attributes_2.cjs.entry.js +1 -1
  12. package/dist/cjs/six-alert.cjs.entry.js +1 -1
  13. package/dist/cjs/six-avatar.cjs.entry.js +1 -1
  14. package/dist/cjs/six-badge.cjs.entry.js +1 -1
  15. package/dist/cjs/six-button.cjs.entry.js +4 -4
  16. package/dist/cjs/six-button.cjs.entry.js.map +1 -1
  17. package/dist/cjs/six-card.cjs.entry.js +1 -1
  18. package/dist/cjs/six-checkbox.cjs.entry.js +7 -4
  19. package/dist/cjs/six-checkbox.cjs.entry.js.map +1 -1
  20. package/dist/cjs/six-datepicker.cjs.entry.js +3 -8
  21. package/dist/cjs/six-datepicker.cjs.entry.js.map +1 -1
  22. package/dist/cjs/six-details.cjs.entry.js +2 -2
  23. package/dist/cjs/six-details.cjs.entry.js.map +1 -1
  24. package/dist/cjs/six-dialog.cjs.entry.js +2 -2
  25. package/dist/cjs/six-drawer.cjs.entry.js +3 -3
  26. package/dist/cjs/six-drawer.cjs.entry.js.map +1 -1
  27. package/dist/cjs/six-dropdown_2.cjs.entry.js +2 -2
  28. package/dist/cjs/six-dropdown_2.cjs.entry.js.map +1 -1
  29. package/dist/cjs/six-error-page.cjs.entry.js +1 -1
  30. package/dist/cjs/six-error.cjs.entry.js +21 -0
  31. package/dist/cjs/six-error.cjs.entry.js.map +1 -0
  32. package/dist/cjs/six-file-list-item.cjs.entry.js +1 -1
  33. package/dist/cjs/six-file-list.cjs.entry.js +1 -1
  34. package/dist/cjs/six-file-upload.cjs.entry.js +1 -1
  35. package/dist/cjs/six-footer.cjs.entry.js +1 -1
  36. package/dist/cjs/six-group-label.cjs.entry.js +3 -3
  37. package/dist/cjs/six-group-label.cjs.entry.js.map +1 -1
  38. package/dist/cjs/six-header.cjs.entry.js +1 -1
  39. package/dist/cjs/six-icon-button.cjs.entry.js +2 -2
  40. package/dist/cjs/six-icon-button.cjs.entry.js.map +1 -1
  41. package/dist/cjs/six-icon.cjs.entry.js +1 -1
  42. package/dist/cjs/six-input.cjs.entry.js +7 -4
  43. package/dist/cjs/six-input.cjs.entry.js.map +1 -1
  44. package/dist/cjs/six-item-picker.cjs.entry.js +1 -1
  45. package/dist/cjs/six-language-switcher.cjs.entry.js +1 -1
  46. package/dist/cjs/six-layout-grid.cjs.entry.js +1 -1
  47. package/dist/cjs/six-main-container.cjs.entry.js +1 -1
  48. package/dist/cjs/six-menu-divider.cjs.entry.js +1 -1
  49. package/dist/cjs/six-menu-item.cjs.entry.js +1 -1
  50. package/dist/cjs/six-menu-label.cjs.entry.js +1 -1
  51. package/dist/cjs/six-picto.cjs.entry.js +1 -1
  52. package/dist/cjs/six-progress-bar.cjs.entry.js +1 -1
  53. package/dist/cjs/six-progress-ring.cjs.entry.js +1 -1
  54. package/dist/cjs/six-radio.cjs.entry.js +1 -1
  55. package/dist/cjs/six-range.cjs.entry.js +7 -4
  56. package/dist/cjs/six-range.cjs.entry.js.map +1 -1
  57. package/dist/cjs/six-root.cjs.entry.js +1 -1
  58. package/dist/cjs/six-search-field.cjs.entry.js +1 -1
  59. package/dist/cjs/six-select.cjs.entry.js +7 -4
  60. package/dist/cjs/six-select.cjs.entry.js.map +1 -1
  61. package/dist/cjs/six-sidebar-item-group.cjs.entry.js +14 -3
  62. package/dist/cjs/six-sidebar-item-group.cjs.entry.js.map +1 -1
  63. package/dist/cjs/six-sidebar-item.cjs.entry.js +6 -4
  64. package/dist/cjs/six-sidebar-item.cjs.entry.js.map +1 -1
  65. package/dist/cjs/six-sidebar.cjs.entry.js +2 -2
  66. package/dist/cjs/six-spinner.cjs.entry.js +1 -1
  67. package/dist/cjs/six-switch.cjs.entry.js +23 -5
  68. package/dist/cjs/six-switch.cjs.entry.js.map +1 -1
  69. package/dist/cjs/six-tab-group.cjs.entry.js +46 -51
  70. package/dist/cjs/six-tab-group.cjs.entry.js.map +1 -1
  71. package/dist/cjs/six-tab-panel.cjs.entry.js +1 -1
  72. package/dist/cjs/six-tab.cjs.entry.js +20 -4
  73. package/dist/cjs/six-tab.cjs.entry.js.map +1 -1
  74. package/dist/cjs/six-tag.cjs.entry.js +24 -2
  75. package/dist/cjs/six-tag.cjs.entry.js.map +1 -1
  76. package/dist/cjs/six-textarea.cjs.entry.js +7 -4
  77. package/dist/cjs/six-textarea.cjs.entry.js.map +1 -1
  78. package/dist/cjs/six-tile.cjs.entry.js +1 -1
  79. package/dist/cjs/six-timepicker.cjs.entry.js +5 -10
  80. package/dist/cjs/six-timepicker.cjs.entry.js.map +1 -1
  81. package/dist/cjs/six-tooltip.cjs.entry.js +3 -3
  82. package/dist/cjs/six-tooltip.cjs.entry.js.map +1 -1
  83. package/dist/cjs/ui-library.cjs.js +3 -3
  84. package/dist/cjs/ui-library.cjs.js.map +1 -1
  85. package/dist/collection/collection-manifest.json +3 -2
  86. package/dist/collection/components/six-button/six-button.css +5 -30
  87. package/dist/collection/components/six-button/six-button.js +2 -2
  88. package/dist/collection/components/six-button/six-button.js.map +1 -1
  89. package/dist/collection/components/six-checkbox/six-checkbox.css +4 -1
  90. package/dist/collection/components/six-checkbox/six-checkbox.js +25 -4
  91. package/dist/collection/components/six-checkbox/six-checkbox.js.map +1 -1
  92. package/dist/collection/components/six-checkbox/test/six-checkbox.spec.js +6 -2
  93. package/dist/collection/components/six-checkbox/test/six-checkbox.spec.js.map +1 -1
  94. package/dist/collection/components/six-datepicker/six-datepicker.js +22 -11
  95. package/dist/collection/components/six-datepicker/six-datepicker.js.map +1 -1
  96. package/dist/collection/components/six-datepicker/test/six-datepicker.spec.js +1 -1
  97. package/dist/collection/components/six-datepicker/test/six-datepicker.spec.js.map +1 -1
  98. package/dist/collection/components/six-details/six-details.css +3 -1
  99. package/dist/collection/components/six-drawer/six-drawer.js +1 -1
  100. package/dist/collection/components/six-drawer/six-drawer.js.map +1 -1
  101. package/dist/collection/components/six-drawer/test/six-drawer.spec.js +1 -1
  102. package/dist/collection/components/six-drawer/test/six-drawer.spec.js.map +1 -1
  103. package/dist/collection/components/six-dropdown/six-dropdown.css +2 -1
  104. package/dist/collection/components/six-error/six-error.css +5 -0
  105. package/dist/collection/components/six-error/six-error.js +25 -0
  106. package/dist/collection/components/six-error/six-error.js.map +1 -0
  107. package/dist/collection/components/six-group-label/six-group-label.css +4 -1
  108. package/dist/collection/components/six-group-label/test/six-group-label.spec.js +3 -1
  109. package/dist/collection/components/six-group-label/test/six-group-label.spec.js.map +1 -1
  110. package/dist/collection/components/six-icon-button/six-icon-button.css +4 -4
  111. package/dist/collection/components/six-input/six-input.css +4 -1
  112. package/dist/collection/components/six-input/six-input.js +27 -4
  113. package/dist/collection/components/six-input/six-input.js.map +1 -1
  114. package/dist/collection/components/six-input/test/six-input.spec.js +3 -1
  115. package/dist/collection/components/six-input/test/six-input.spec.js.map +1 -1
  116. package/dist/collection/components/six-range/six-range.css +4 -1
  117. package/dist/collection/components/six-range/six-range.js +24 -3
  118. package/dist/collection/components/six-range/six-range.js.map +1 -1
  119. package/dist/collection/components/six-range/test/six-range.spec.js +3 -1
  120. package/dist/collection/components/six-range/test/six-range.spec.js.map +1 -1
  121. package/dist/collection/components/six-select/six-select.css +4 -1
  122. package/dist/collection/components/six-select/six-select.js +24 -3
  123. package/dist/collection/components/six-select/six-select.js.map +1 -1
  124. package/dist/collection/components/six-select/test/six-select.spec.js +6 -2
  125. package/dist/collection/components/six-select/test/six-select.spec.js.map +1 -1
  126. package/dist/collection/components/six-sidebar-item/six-sidebar-item.css +6 -1
  127. package/dist/collection/components/six-sidebar-item/six-sidebar-item.js +21 -2
  128. package/dist/collection/components/six-sidebar-item/six-sidebar-item.js.map +1 -1
  129. package/dist/collection/components/six-sidebar-item-group/six-sidebar-item-group.css +11 -0
  130. package/dist/collection/components/six-sidebar-item-group/six-sidebar-item-group.js +29 -1
  131. package/dist/collection/components/six-sidebar-item-group/six-sidebar-item-group.js.map +1 -1
  132. package/dist/collection/components/six-sidebar-item-group/test/six-sidebar-item-group.spec.js +2 -2
  133. package/dist/collection/components/six-sidebar-item-group/test/six-sidebar-item-group.spec.js.map +1 -1
  134. package/dist/collection/components/six-switch/six-switch.css +4 -1
  135. package/dist/collection/components/six-switch/six-switch.js +45 -4
  136. package/dist/collection/components/six-switch/six-switch.js.map +1 -1
  137. package/dist/collection/components/six-switch/test/six-switch.spec.js +6 -2
  138. package/dist/collection/components/six-switch/test/six-switch.spec.js.map +1 -1
  139. package/dist/collection/components/six-tab/six-tab.css +54 -5
  140. package/dist/collection/components/six-tab/six-tab.js +18 -2
  141. package/dist/collection/components/six-tab/six-tab.js.map +1 -1
  142. package/dist/collection/components/six-tab-group/six-tab-group.css +0 -31
  143. package/dist/collection/components/six-tab-group/six-tab-group.js +10 -51
  144. package/dist/collection/components/six-tab-group/six-tab-group.js.map +1 -1
  145. package/dist/collection/components/six-tag/six-tag.js +23 -1
  146. package/dist/collection/components/six-tag/six-tag.js.map +1 -1
  147. package/dist/collection/components/six-tag/test/six-tag.spec.js +12 -0
  148. package/dist/collection/components/six-tag/test/six-tag.spec.js.map +1 -1
  149. package/dist/collection/components/six-textarea/six-textarea.css +4 -1
  150. package/dist/collection/components/six-textarea/six-textarea.js +25 -4
  151. package/dist/collection/components/six-textarea/six-textarea.js.map +1 -1
  152. package/dist/collection/components/six-textarea/test/six-textarea.spec.js +3 -1
  153. package/dist/collection/components/six-textarea/test/six-textarea.spec.js.map +1 -1
  154. package/dist/collection/components/six-timepicker/six-timepicker.js +24 -12
  155. package/dist/collection/components/six-timepicker/six-timepicker.js.map +1 -1
  156. package/dist/collection/components/six-timepicker/test/six-timepicker.spec.js +15 -15
  157. package/dist/collection/components/six-timepicker/test/six-timepicker.spec.js.map +1 -1
  158. package/dist/collection/components/six-tooltip/six-tooltip.css +1 -1
  159. package/dist/collection/components/six-tooltip/six-tooltip.js +1 -1
  160. package/dist/collection/components/six-tooltip/six-tooltip.js.map +1 -1
  161. package/dist/collection/functional-components/form-control/form-control.js +8 -6
  162. package/dist/collection/functional-components/form-control/form-control.js.map +1 -1
  163. package/dist/collection/utils/animation.js +34 -0
  164. package/dist/collection/utils/animation.js.map +1 -0
  165. package/dist/collection/utils/error-messages.js +14 -0
  166. package/dist/collection/utils/error-messages.js.map +1 -1
  167. package/dist/components/form-control.js +9 -6
  168. package/dist/components/form-control.js.map +1 -1
  169. package/dist/components/index.d.ts +6 -0
  170. package/dist/components/index.js +18 -2
  171. package/dist/components/index.js.map +1 -1
  172. package/dist/components/scroll.js +1 -1
  173. package/dist/components/set-attributes2.js +2 -0
  174. package/dist/components/set-attributes2.js.map +1 -1
  175. package/dist/components/six-alert.js +3 -0
  176. package/dist/components/six-alert.js.map +1 -1
  177. package/dist/components/six-button.js +3 -3
  178. package/dist/components/six-button.js.map +1 -1
  179. package/dist/components/six-checkbox.js +19 -3
  180. package/dist/components/six-checkbox.js.map +1 -1
  181. package/dist/components/six-datepicker.js +14 -9
  182. package/dist/components/six-datepicker.js.map +1 -1
  183. package/dist/components/six-details2.js +3 -1
  184. package/dist/components/six-details2.js.map +1 -1
  185. package/dist/components/six-dialog.js +2 -0
  186. package/dist/components/six-dialog.js.map +1 -1
  187. package/dist/components/six-drawer.js +3 -1
  188. package/dist/components/six-drawer.js.map +1 -1
  189. package/dist/components/six-dropdown2.js +15 -2
  190. package/dist/components/six-dropdown2.js.map +1 -1
  191. package/dist/components/six-error.d.ts +11 -0
  192. package/dist/components/six-error.js +8 -0
  193. package/dist/components/six-error.js.map +1 -0
  194. package/dist/components/six-error2.js +32 -0
  195. package/dist/components/six-error2.js.map +1 -0
  196. package/dist/components/six-group-label.js +11 -2
  197. package/dist/components/six-group-label.js.map +1 -1
  198. package/dist/components/six-header.js +10 -2
  199. package/dist/components/six-header.js.map +1 -1
  200. package/dist/components/six-icon-button2.js +1 -1
  201. package/dist/components/six-icon-button2.js.map +1 -1
  202. package/dist/components/six-input2.js +19 -3
  203. package/dist/components/six-input2.js.map +1 -1
  204. package/dist/components/six-item-picker2.js +4 -0
  205. package/dist/components/six-item-picker2.js.map +1 -1
  206. package/dist/components/six-language-switcher.js +2 -0
  207. package/dist/components/six-language-switcher.js.map +1 -1
  208. package/dist/components/six-layout-grid.js +2 -0
  209. package/dist/components/six-layout-grid.js.map +1 -1
  210. package/dist/components/six-progress-ring.js +2 -0
  211. package/dist/components/six-progress-ring.js.map +1 -1
  212. package/dist/components/six-radio.js +3 -0
  213. package/dist/components/six-radio.js.map +1 -1
  214. package/dist/components/six-range.js +21 -3
  215. package/dist/components/six-range.js.map +1 -1
  216. package/dist/components/six-root.js +2 -0
  217. package/dist/components/six-root.js.map +1 -1
  218. package/dist/components/six-search-field.js +9 -1
  219. package/dist/components/six-search-field.js.map +1 -1
  220. package/dist/components/six-select.js +40 -16
  221. package/dist/components/six-select.js.map +1 -1
  222. package/dist/components/six-sidebar-item-group.js +14 -2
  223. package/dist/components/six-sidebar-item-group.js.map +1 -1
  224. package/dist/components/six-sidebar-item.js +7 -4
  225. package/dist/components/six-sidebar-item.js.map +1 -1
  226. package/dist/components/six-sidebar.js +2 -0
  227. package/dist/components/six-sidebar.js.map +1 -1
  228. package/dist/components/six-switch.js +34 -4
  229. package/dist/components/six-switch.js.map +1 -1
  230. package/dist/components/six-tab-group.js +47 -50
  231. package/dist/components/six-tab-group.js.map +1 -1
  232. package/dist/components/six-tab.js +19 -3
  233. package/dist/components/six-tab.js.map +1 -1
  234. package/dist/components/six-tag2.js +33 -5
  235. package/dist/components/six-tag2.js.map +1 -1
  236. package/dist/components/six-textarea.js +20 -3
  237. package/dist/components/six-textarea.js.map +1 -1
  238. package/dist/components/six-timepicker2.js +15 -11
  239. package/dist/components/six-timepicker2.js.map +1 -1
  240. package/dist/components/six-tooltip2.js +4 -2
  241. package/dist/components/six-tooltip2.js.map +1 -1
  242. package/dist/components.json +475 -57
  243. package/dist/esm/{form-control-32cb533f.js → form-control-079f7fb6.js} +11 -8
  244. package/dist/esm/form-control-079f7fb6.js.map +1 -0
  245. package/dist/esm/{index-8a74f992.js → index-4ee8b33e.js} +495 -122
  246. package/dist/esm/index-4ee8b33e.js.map +1 -0
  247. package/dist/esm/index.js +15 -1
  248. package/dist/esm/index.js.map +1 -1
  249. package/dist/esm/loader.js +3 -3
  250. package/dist/esm/{scroll-3fb087a2.js → scroll-774762d6.js} +2 -2
  251. package/dist/esm/{scroll-3fb087a2.js.map → scroll-774762d6.js.map} +1 -1
  252. package/dist/esm/set-attributes_2.entry.js +1 -1
  253. package/dist/esm/six-alert.entry.js +1 -1
  254. package/dist/esm/six-avatar.entry.js +1 -1
  255. package/dist/esm/six-badge.entry.js +1 -1
  256. package/dist/esm/six-button.entry.js +4 -4
  257. package/dist/esm/six-button.entry.js.map +1 -1
  258. package/dist/esm/six-card.entry.js +1 -1
  259. package/dist/esm/six-checkbox.entry.js +7 -4
  260. package/dist/esm/six-checkbox.entry.js.map +1 -1
  261. package/dist/esm/six-datepicker.entry.js +3 -8
  262. package/dist/esm/six-datepicker.entry.js.map +1 -1
  263. package/dist/esm/six-details.entry.js +2 -2
  264. package/dist/esm/six-details.entry.js.map +1 -1
  265. package/dist/esm/six-dialog.entry.js +2 -2
  266. package/dist/esm/six-drawer.entry.js +3 -3
  267. package/dist/esm/six-drawer.entry.js.map +1 -1
  268. package/dist/esm/six-dropdown_2.entry.js +2 -2
  269. package/dist/esm/six-dropdown_2.entry.js.map +1 -1
  270. package/dist/esm/six-error-page.entry.js +1 -1
  271. package/dist/esm/six-error.entry.js +17 -0
  272. package/dist/esm/six-error.entry.js.map +1 -0
  273. package/dist/esm/six-file-list-item.entry.js +1 -1
  274. package/dist/esm/six-file-list.entry.js +1 -1
  275. package/dist/esm/six-file-upload.entry.js +1 -1
  276. package/dist/esm/six-footer.entry.js +1 -1
  277. package/dist/esm/six-group-label.entry.js +3 -3
  278. package/dist/esm/six-group-label.entry.js.map +1 -1
  279. package/dist/esm/six-header.entry.js +1 -1
  280. package/dist/esm/six-icon-button.entry.js +2 -2
  281. package/dist/esm/six-icon-button.entry.js.map +1 -1
  282. package/dist/esm/six-icon.entry.js +1 -1
  283. package/dist/esm/six-input.entry.js +7 -4
  284. package/dist/esm/six-input.entry.js.map +1 -1
  285. package/dist/esm/six-item-picker.entry.js +1 -1
  286. package/dist/esm/six-language-switcher.entry.js +1 -1
  287. package/dist/esm/six-layout-grid.entry.js +1 -1
  288. package/dist/esm/six-main-container.entry.js +1 -1
  289. package/dist/esm/six-menu-divider.entry.js +1 -1
  290. package/dist/esm/six-menu-item.entry.js +1 -1
  291. package/dist/esm/six-menu-label.entry.js +1 -1
  292. package/dist/esm/six-picto.entry.js +1 -1
  293. package/dist/esm/six-progress-bar.entry.js +1 -1
  294. package/dist/esm/six-progress-ring.entry.js +1 -1
  295. package/dist/esm/six-radio.entry.js +1 -1
  296. package/dist/esm/six-range.entry.js +7 -4
  297. package/dist/esm/six-range.entry.js.map +1 -1
  298. package/dist/esm/six-root.entry.js +1 -1
  299. package/dist/esm/six-search-field.entry.js +1 -1
  300. package/dist/esm/six-select.entry.js +7 -4
  301. package/dist/esm/six-select.entry.js.map +1 -1
  302. package/dist/esm/six-sidebar-item-group.entry.js +14 -3
  303. package/dist/esm/six-sidebar-item-group.entry.js.map +1 -1
  304. package/dist/esm/six-sidebar-item.entry.js +6 -4
  305. package/dist/esm/six-sidebar-item.entry.js.map +1 -1
  306. package/dist/esm/six-sidebar.entry.js +2 -2
  307. package/dist/esm/six-spinner.entry.js +1 -1
  308. package/dist/esm/six-switch.entry.js +23 -5
  309. package/dist/esm/six-switch.entry.js.map +1 -1
  310. package/dist/esm/six-tab-group.entry.js +46 -51
  311. package/dist/esm/six-tab-group.entry.js.map +1 -1
  312. package/dist/esm/six-tab-panel.entry.js +1 -1
  313. package/dist/esm/six-tab.entry.js +20 -4
  314. package/dist/esm/six-tab.entry.js.map +1 -1
  315. package/dist/esm/six-tag.entry.js +24 -2
  316. package/dist/esm/six-tag.entry.js.map +1 -1
  317. package/dist/esm/six-textarea.entry.js +7 -4
  318. package/dist/esm/six-textarea.entry.js.map +1 -1
  319. package/dist/esm/six-tile.entry.js +1 -1
  320. package/dist/esm/six-timepicker.entry.js +5 -10
  321. package/dist/esm/six-timepicker.entry.js.map +1 -1
  322. package/dist/esm/six-tooltip.entry.js +3 -3
  323. package/dist/esm/six-tooltip.entry.js.map +1 -1
  324. package/dist/esm/ui-library.js +4 -4
  325. package/dist/esm/ui-library.js.map +1 -1
  326. package/dist/types/components/six-checkbox/six-checkbox.d.ts +4 -1
  327. package/dist/types/components/six-datepicker/six-datepicker.d.ts +4 -2
  328. package/dist/types/components/six-error/six-error.d.ts +9 -0
  329. package/dist/types/components/six-input/six-input.d.ts +7 -2
  330. package/dist/types/components/six-range/six-range.d.ts +4 -1
  331. package/dist/types/components/six-select/six-select.d.ts +4 -1
  332. package/dist/types/components/six-sidebar-item/six-sidebar-item.d.ts +5 -0
  333. package/dist/types/components/six-sidebar-item-group/six-sidebar-item-group.d.ts +6 -0
  334. package/dist/types/components/six-switch/six-switch.d.ts +8 -1
  335. package/dist/types/components/six-tab-group/six-tab-group.d.ts +0 -3
  336. package/dist/types/components/six-tag/six-tag.d.ts +8 -0
  337. package/dist/types/components/six-textarea/six-textarea.d.ts +4 -1
  338. package/dist/types/components/six-timepicker/six-timepicker.d.ts +5 -2
  339. package/dist/types/components.d.ts +505 -16
  340. package/dist/types/functional-components/form-control/form-control.d.ts +6 -2
  341. package/dist/types/stencil-public-runtime.d.ts +26 -3
  342. package/dist/types/utils/animation.d.ts +12 -0
  343. package/dist/types/utils/error-messages.d.ts +2 -1
  344. package/dist/ui-library/index.esm.js +1 -1
  345. package/dist/ui-library/index.esm.js.map +1 -1
  346. package/dist/ui-library/{p-330a4988.entry.js → p-0416ec85.entry.js} +2 -2
  347. package/dist/ui-library/{p-1f18768a.js → p-052aa8d3.js} +2 -2
  348. package/dist/ui-library/{p-ae601a0f.entry.js → p-0d8154b1.entry.js} +2 -2
  349. package/dist/ui-library/p-120a1b66.entry.js +2 -0
  350. package/dist/ui-library/p-120a1b66.entry.js.map +1 -0
  351. package/dist/ui-library/{p-9c1be3fb.entry.js → p-16eb37cd.entry.js} +2 -2
  352. package/dist/ui-library/{p-878226a0.entry.js → p-1f7dac36.entry.js} +2 -2
  353. package/dist/ui-library/{p-a6a9ee96.entry.js → p-20cb60c9.entry.js} +2 -2
  354. package/dist/ui-library/{p-613283a7.entry.js → p-21606e14.entry.js} +2 -2
  355. package/dist/ui-library/{p-411ed539.entry.js → p-2280038f.entry.js} +2 -2
  356. package/dist/ui-library/p-24e80289.entry.js +2 -0
  357. package/dist/ui-library/p-24e80289.entry.js.map +1 -0
  358. package/dist/ui-library/{p-264d4ea8.entry.js → p-27987d45.entry.js} +2 -2
  359. package/dist/ui-library/{p-cd67da3d.entry.js → p-2945a132.entry.js} +2 -2
  360. package/dist/ui-library/{p-3cc5addb.entry.js → p-2e99f389.entry.js} +2 -2
  361. package/dist/ui-library/p-3d7678a8.entry.js +2 -0
  362. package/dist/ui-library/p-3d7678a8.entry.js.map +1 -0
  363. package/dist/ui-library/p-4196a75a.entry.js +2 -0
  364. package/dist/ui-library/p-4196a75a.entry.js.map +1 -0
  365. package/dist/ui-library/p-48b7c199.entry.js +2 -0
  366. package/dist/ui-library/p-48b7c199.entry.js.map +1 -0
  367. package/dist/ui-library/{p-37557787.entry.js → p-51630491.entry.js} +2 -2
  368. package/dist/ui-library/{p-ed381ad9.entry.js → p-5218986b.entry.js} +2 -2
  369. package/dist/ui-library/p-5218986b.entry.js.map +1 -0
  370. package/dist/ui-library/p-5904d3c3.entry.js +2 -0
  371. package/dist/ui-library/p-5904d3c3.entry.js.map +1 -0
  372. package/dist/ui-library/p-66a48dc4.entry.js +2 -0
  373. package/dist/ui-library/{p-d367f4f9.entry.js.map → p-66a48dc4.entry.js.map} +1 -1
  374. package/dist/ui-library/{p-91b51800.entry.js → p-66d1d93d.entry.js} +2 -2
  375. package/dist/ui-library/p-6aced322.entry.js +2 -0
  376. package/dist/ui-library/p-6aced322.entry.js.map +1 -0
  377. package/dist/ui-library/p-6e87aeea.entry.js +2 -0
  378. package/dist/ui-library/p-6e87aeea.entry.js.map +1 -0
  379. package/dist/ui-library/p-74179b03.entry.js +2 -0
  380. package/dist/ui-library/p-74179b03.entry.js.map +1 -0
  381. package/dist/ui-library/{p-1d5ee1a0.entry.js → p-77424c6b.entry.js} +2 -2
  382. package/dist/ui-library/{p-13b43e04.entry.js → p-7d00de3a.entry.js} +2 -2
  383. package/dist/ui-library/{p-cdaed936.entry.js → p-7e9257f3.entry.js} +2 -2
  384. package/dist/ui-library/p-8226e363.entry.js +2 -0
  385. package/dist/ui-library/p-8226e363.entry.js.map +1 -0
  386. package/dist/ui-library/{p-99e24daf.entry.js → p-8296e24c.entry.js} +2 -2
  387. package/dist/ui-library/{p-99e24daf.entry.js.map → p-8296e24c.entry.js.map} +1 -1
  388. package/dist/ui-library/{p-7e3ad38a.entry.js → p-93a9b693.entry.js} +2 -2
  389. package/dist/ui-library/{p-5af44076.entry.js → p-94bd8347.entry.js} +2 -2
  390. package/dist/ui-library/{p-ee950ce2.entry.js → p-9bec3e14.entry.js} +2 -2
  391. package/dist/ui-library/{p-9b354f5d.entry.js → p-a15928c4.entry.js} +2 -2
  392. package/dist/ui-library/p-a4348ad4.entry.js +2 -0
  393. package/dist/ui-library/p-a4348ad4.entry.js.map +1 -0
  394. package/dist/ui-library/{p-7afafb9d.entry.js → p-acd3ecfd.entry.js} +2 -2
  395. package/dist/ui-library/p-ae383f66.entry.js +2 -0
  396. package/dist/ui-library/p-ae383f66.entry.js.map +1 -0
  397. package/dist/ui-library/p-af0e163e.entry.js +2 -0
  398. package/dist/ui-library/p-af0e163e.entry.js.map +1 -0
  399. package/dist/ui-library/p-b3a14438.entry.js +2 -0
  400. package/dist/ui-library/p-b3a14438.entry.js.map +1 -0
  401. package/dist/ui-library/{p-dfed33c5.entry.js → p-b42fd9c3.entry.js} +2 -2
  402. package/dist/ui-library/p-b5fdfa6a.js +3 -0
  403. package/dist/ui-library/p-b5fdfa6a.js.map +1 -0
  404. package/dist/ui-library/p-b7597736.entry.js +2 -0
  405. package/dist/ui-library/p-b7597736.entry.js.map +1 -0
  406. package/dist/ui-library/{p-c03ebf7d.entry.js → p-b906a605.entry.js} +2 -2
  407. package/dist/ui-library/{p-ac099e6b.entry.js → p-b97764a1.entry.js} +2 -2
  408. package/dist/ui-library/p-bbefcec9.entry.js +2 -0
  409. package/dist/ui-library/p-bbefcec9.entry.js.map +1 -0
  410. package/dist/ui-library/{p-b351f889.entry.js → p-c75694df.entry.js} +2 -2
  411. package/dist/ui-library/p-cb32f8d2.entry.js +2 -0
  412. package/dist/ui-library/p-cb32f8d2.entry.js.map +1 -0
  413. package/dist/ui-library/{p-a0f290d0.entry.js → p-cd3281fb.entry.js} +2 -2
  414. package/dist/ui-library/{p-19ed7a4c.entry.js → p-cec8c149.entry.js} +2 -2
  415. package/dist/ui-library/{p-724875b0.entry.js → p-d1ba2ad5.entry.js} +2 -2
  416. package/dist/ui-library/{p-346f9557.entry.js → p-d2196113.entry.js} +2 -2
  417. package/dist/ui-library/p-de7a9448.entry.js +2 -0
  418. package/dist/ui-library/p-de7a9448.entry.js.map +1 -0
  419. package/dist/ui-library/{p-a55c7258.entry.js → p-df1c4a1f.entry.js} +2 -2
  420. package/dist/ui-library/{p-95fbdd0b.entry.js → p-e740215a.entry.js} +2 -2
  421. package/dist/ui-library/p-f3fdc121.js +2 -0
  422. package/dist/ui-library/p-f3fdc121.js.map +1 -0
  423. package/dist/ui-library/ui-library.css +2 -2
  424. package/dist/ui-library/ui-library.esm.js +1 -1
  425. package/dist/ui-library/ui-library.esm.js.map +1 -1
  426. package/package.json +14 -11
  427. package/dist/cjs/form-control-d369af14.js.map +0 -1
  428. package/dist/cjs/index-900437fc.js.map +0 -1
  429. package/dist/cjs/scroll-03678de1.js.map +0 -1
  430. package/dist/collection/components/six-tab/test/six-tab.spec.js +0 -20
  431. package/dist/collection/components/six-tab/test/six-tab.spec.js.map +0 -1
  432. package/dist/collection/components/six-tab-group/test/six-tab-group.spec.js +0 -45
  433. package/dist/collection/components/six-tab-group/test/six-tab-group.spec.js.map +0 -1
  434. package/dist/esm/form-control-32cb533f.js.map +0 -1
  435. package/dist/esm/index-8a74f992.js.map +0 -1
  436. package/dist/ui-library/p-02981b91.entry.js +0 -2
  437. package/dist/ui-library/p-02981b91.entry.js.map +0 -1
  438. package/dist/ui-library/p-1256cc0a.entry.js +0 -2
  439. package/dist/ui-library/p-1256cc0a.entry.js.map +0 -1
  440. package/dist/ui-library/p-21b3b321.entry.js +0 -2
  441. package/dist/ui-library/p-21b3b321.entry.js.map +0 -1
  442. package/dist/ui-library/p-29ac3d7d.entry.js +0 -2
  443. package/dist/ui-library/p-29ac3d7d.entry.js.map +0 -1
  444. package/dist/ui-library/p-314b2096.entry.js +0 -2
  445. package/dist/ui-library/p-314b2096.entry.js.map +0 -1
  446. package/dist/ui-library/p-3d9de119.entry.js +0 -2
  447. package/dist/ui-library/p-3d9de119.entry.js.map +0 -1
  448. package/dist/ui-library/p-4705a51e.entry.js +0 -2
  449. package/dist/ui-library/p-4705a51e.entry.js.map +0 -1
  450. package/dist/ui-library/p-4abed9df.entry.js +0 -2
  451. package/dist/ui-library/p-4abed9df.entry.js.map +0 -1
  452. package/dist/ui-library/p-5d6b7353.entry.js +0 -2
  453. package/dist/ui-library/p-5d6b7353.entry.js.map +0 -1
  454. package/dist/ui-library/p-6153045b.js +0 -3
  455. package/dist/ui-library/p-6153045b.js.map +0 -1
  456. package/dist/ui-library/p-6197fe2f.entry.js +0 -2
  457. package/dist/ui-library/p-6197fe2f.entry.js.map +0 -1
  458. package/dist/ui-library/p-72254eef.entry.js +0 -2
  459. package/dist/ui-library/p-72254eef.entry.js.map +0 -1
  460. package/dist/ui-library/p-83864cfe.entry.js +0 -2
  461. package/dist/ui-library/p-83864cfe.entry.js.map +0 -1
  462. package/dist/ui-library/p-9f0b43f9.entry.js +0 -2
  463. package/dist/ui-library/p-9f0b43f9.entry.js.map +0 -1
  464. package/dist/ui-library/p-b550a258.entry.js +0 -2
  465. package/dist/ui-library/p-b550a258.entry.js.map +0 -1
  466. package/dist/ui-library/p-bf87464b.entry.js +0 -2
  467. package/dist/ui-library/p-bf87464b.entry.js.map +0 -1
  468. package/dist/ui-library/p-d367f4f9.entry.js +0 -2
  469. package/dist/ui-library/p-d42c2025.js +0 -2
  470. package/dist/ui-library/p-d42c2025.js.map +0 -1
  471. package/dist/ui-library/p-ed381ad9.entry.js.map +0 -1
  472. package/dist/ui-library/p-ee8342e1.entry.js +0 -2
  473. package/dist/ui-library/p-ee8342e1.entry.js.map +0 -1
  474. package/dist/ui-library/p-ff90ffd1.entry.js +0 -2
  475. package/dist/ui-library/p-ff90ffd1.entry.js.map +0 -1
  476. package/readme.md +0 -156
  477. /package/dist/ui-library/{p-330a4988.entry.js.map → p-0416ec85.entry.js.map} +0 -0
  478. /package/dist/ui-library/{p-1f18768a.js.map → p-052aa8d3.js.map} +0 -0
  479. /package/dist/ui-library/{p-ae601a0f.entry.js.map → p-0d8154b1.entry.js.map} +0 -0
  480. /package/dist/ui-library/{p-9c1be3fb.entry.js.map → p-16eb37cd.entry.js.map} +0 -0
  481. /package/dist/ui-library/{p-878226a0.entry.js.map → p-1f7dac36.entry.js.map} +0 -0
  482. /package/dist/ui-library/{p-a6a9ee96.entry.js.map → p-20cb60c9.entry.js.map} +0 -0
  483. /package/dist/ui-library/{p-613283a7.entry.js.map → p-21606e14.entry.js.map} +0 -0
  484. /package/dist/ui-library/{p-411ed539.entry.js.map → p-2280038f.entry.js.map} +0 -0
  485. /package/dist/ui-library/{p-264d4ea8.entry.js.map → p-27987d45.entry.js.map} +0 -0
  486. /package/dist/ui-library/{p-cd67da3d.entry.js.map → p-2945a132.entry.js.map} +0 -0
  487. /package/dist/ui-library/{p-3cc5addb.entry.js.map → p-2e99f389.entry.js.map} +0 -0
  488. /package/dist/ui-library/{p-37557787.entry.js.map → p-51630491.entry.js.map} +0 -0
  489. /package/dist/ui-library/{p-91b51800.entry.js.map → p-66d1d93d.entry.js.map} +0 -0
  490. /package/dist/ui-library/{p-1d5ee1a0.entry.js.map → p-77424c6b.entry.js.map} +0 -0
  491. /package/dist/ui-library/{p-13b43e04.entry.js.map → p-7d00de3a.entry.js.map} +0 -0
  492. /package/dist/ui-library/{p-cdaed936.entry.js.map → p-7e9257f3.entry.js.map} +0 -0
  493. /package/dist/ui-library/{p-7e3ad38a.entry.js.map → p-93a9b693.entry.js.map} +0 -0
  494. /package/dist/ui-library/{p-5af44076.entry.js.map → p-94bd8347.entry.js.map} +0 -0
  495. /package/dist/ui-library/{p-ee950ce2.entry.js.map → p-9bec3e14.entry.js.map} +0 -0
  496. /package/dist/ui-library/{p-9b354f5d.entry.js.map → p-a15928c4.entry.js.map} +0 -0
  497. /package/dist/ui-library/{p-7afafb9d.entry.js.map → p-acd3ecfd.entry.js.map} +0 -0
  498. /package/dist/ui-library/{p-dfed33c5.entry.js.map → p-b42fd9c3.entry.js.map} +0 -0
  499. /package/dist/ui-library/{p-c03ebf7d.entry.js.map → p-b906a605.entry.js.map} +0 -0
  500. /package/dist/ui-library/{p-ac099e6b.entry.js.map → p-b97764a1.entry.js.map} +0 -0
  501. /package/dist/ui-library/{p-b351f889.entry.js.map → p-c75694df.entry.js.map} +0 -0
  502. /package/dist/ui-library/{p-a0f290d0.entry.js.map → p-cd3281fb.entry.js.map} +0 -0
  503. /package/dist/ui-library/{p-19ed7a4c.entry.js.map → p-cec8c149.entry.js.map} +0 -0
  504. /package/dist/ui-library/{p-724875b0.entry.js.map → p-d1ba2ad5.entry.js.map} +0 -0
  505. /package/dist/ui-library/{p-346f9557.entry.js.map → p-d2196113.entry.js.map} +0 -0
  506. /package/dist/ui-library/{p-a55c7258.entry.js.map → p-df1c4a1f.entry.js.map} +0 -0
  507. /package/dist/ui-library/{p-95fbdd0b.entry.js.map → p-e740215a.entry.js.map} +0 -0
@@ -10,6 +10,10 @@
10
10
  display: block;
11
11
  }
12
12
 
13
+ .six-sidebar-item-group {
14
+ --horizontal-padding: var(--six-spacing-x-large);
15
+ }
16
+
13
17
  .six-sidebar-item-group--childless::part(content) {
14
18
  padding: 0 !important;
15
19
  }
@@ -29,4 +33,11 @@
29
33
 
30
34
  .six-sidebar-details__header-icon {
31
35
  margin-right: 1em;
36
+ }
37
+
38
+ .six-sidebar-details__link {
39
+ text-decoration: none;
40
+ display: block;
41
+ color: inherit;
42
+ width: 100%;
32
43
  }
@@ -27,6 +27,7 @@ export class SixSidebarItemGroup {
27
27
  this.open = false;
28
28
  this.summaryIcon = undefined;
29
29
  this.summaryIconHasContent = false;
30
+ this.href = undefined;
30
31
  }
31
32
  connectedCallback() {
32
33
  this.handleSlotChange = this.handleSlotChange.bind(this);
@@ -41,11 +42,21 @@ export class SixSidebarItemGroup {
41
42
  var _a;
42
43
  return ((_a = this.host.parentElement) === null || _a === void 0 ? void 0 : _a.closest('six-sidebar-item-group')) != null;
43
44
  }
45
+ renderAsHref() {
46
+ return this.href != null && !this.hasItems;
47
+ }
44
48
  render() {
45
- return (h("six-details", { class: {
49
+ const element = (h("six-details", { class: {
50
+ 'six-sidebar-item-group': true,
46
51
  'six-sidebar-item-group--childless': !this.hasItems,
47
52
  'six-sidebar-item-group--subgroup': this.isSubgroup(),
48
53
  }, inline: true, open: this.open, "summary-icon": this.summaryIcon, hasContent: this.hasItems }, h("div", { slot: "summary" }, h("div", { class: "six-sidebar-details__header" }, this.icon && h("six-icon", { class: "six-sidebar-details__header-icon" }, this.icon), this.name)), this.provideSlot('summary-icon'), h("slot", null)));
54
+ if (this.renderAsHref()) {
55
+ return (h("a", { class: "six-sidebar-details__link", href: this.href }, element));
56
+ }
57
+ else {
58
+ return element;
59
+ }
49
60
  }
50
61
  static get is() { return "six-sidebar-item-group"; }
51
62
  static get encapsulation() { return "shadow"; }
@@ -149,6 +160,23 @@ export class SixSidebarItemGroup {
149
160
  },
150
161
  "attribute": "summary-icon",
151
162
  "reflect": false
163
+ },
164
+ "href": {
165
+ "type": "string",
166
+ "mutable": false,
167
+ "complexType": {
168
+ "original": "string | undefined",
169
+ "resolved": "string | undefined",
170
+ "references": {}
171
+ },
172
+ "required": false,
173
+ "optional": false,
174
+ "docs": {
175
+ "tags": [],
176
+ "text": "Provide if the item should be rendered as anchor tag.\nNote, that the href is added automatically when using routerLink in Angular."
177
+ },
178
+ "attribute": "href",
179
+ "reflect": true
152
180
  }
153
181
  };
154
182
  }
@@ -1 +1 @@
1
- {"version":3,"file":"six-sidebar-item-group.js","sourceRoot":"","sources":["../../../src/components/six-sidebar-item-group/six-sidebar-item-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C;;;;;GAKG;AAOH,MAAM,OAAO,mBAAmB;;IAsCtB,gBAAW,GAAG,CAAC,IAAY,EAAE,EAAE;MACrC,IAAI,IAAI,CAAC,qBAAqB,EAAE;QAC9B,OAAO,CACL,WAAK,IAAI,EAAE,IAAI;UACb,YAAM,IAAI,EAAE,IAAI,GAAS,CACrB,CACP,CAAC;OACH;MAED,OAAO,CACL,YACE,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,GAA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AI,CACN,CACF;MACL,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC;MACjC,eAAQ,CACI,CACf,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Prop, State } from '@stencil/core';\nimport { hasSlot } from '../../utils/slot';\n\n/**\n * @since 1.0\n * @status stable\n *\n * @slot - Used to define the nested sidebar [group] items.\n */\n\n@Component({\n tag: 'six-sidebar-item-group',\n styleUrl: 'six-sidebar-item-group.scss',\n shadow: true,\n})\nexport class SixSidebarItemGroup {\n @Element() readonly host!: HTMLSixSidebarItemGroupElement;\n\n @State() hasItems = false;\n\n /** Title of item group */\n @Prop() name = '';\n\n /** Icon of the group */\n @Prop() icon = '';\n\n /** A unique value to store in the sidebar item of the group label. This can be used as a way to identify sidebar items when selected. */\n @Prop({ reflect: true }) value = '';\n\n /** Indicates whether the sidebar is shown */\n @Prop({ reflect: true }) open = false;\n\n /** Custom summary icon name. */\n @Prop() summaryIcon?: string;\n\n @State() summaryIconHasContent = false;\n\n connectedCallback() {\n this.handleSlotChange = this.handleSlotChange.bind(this);\n }\n\n componentWillLoad() {\n this.handleSlotChange();\n }\n\n private handleSlotChange() {\n this.hasItems = hasSlot(this.host);\n }\n\n private isSubgroup() {\n return this.host.parentElement?.closest('six-sidebar-item-group') != null;\n }\n\n private provideSlot = (name: string) => {\n if (this.summaryIconHasContent) {\n return (\n <div slot={name}>\n <slot name={name}></slot>\n </div>\n );\n }\n\n return (\n <slot\n name={name}\n onSlotchange={() => {\n const slot = this.host.shadowRoot?.querySelector<HTMLSlotElement>(`slot[name=\"${name}\"]`);\n if (slot != null) {\n this.summaryIconHasContent = slot.assignedNodes().length > 0;\n }\n }}\n ></slot>\n );\n };\n\n render() {\n return (\n <six-details\n class={{\n 'six-sidebar-item-group--childless': !this.hasItems,\n 'six-sidebar-item-group--subgroup': this.isSubgroup(),\n }}\n inline={true}\n open={this.open}\n summary-icon={this.summaryIcon}\n hasContent={this.hasItems}\n >\n <div slot=\"summary\">\n <div class=\"six-sidebar-details__header\">\n {this.icon && <six-icon class=\"six-sidebar-details__header-icon\">{this.icon}</six-icon>}\n {this.name}\n </div>\n </div>\n {this.provideSlot('summary-icon')}\n <slot />\n </six-details>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"six-sidebar-item-group.js","sourceRoot":"","sources":["../../../src/components/six-sidebar-item-group/six-sidebar-item-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C;;;;;GAKG;AAOH,MAAM,OAAO,mBAAmB;;IAgDtB,gBAAW,GAAG,CAAC,IAAY,EAAE,EAAE;MACrC,IAAI,IAAI,CAAC,qBAAqB,EAAE;QAC9B,OAAO,CACL,WAAK,IAAI,EAAE,IAAI;UACb,YAAM,IAAI,EAAE,IAAI,GAAS,CACrB,CACP,CAAC;OACH;MAED,OAAO,CACL,YACE,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,GAAG,EAAE;;UACjB,MAAM,IAAI,GAAG,MAAA,IAAI,CAAC,IAAI,CAAC,UAAU,0CAAE,aAAa,CAAkB,cAAc,IAAI,IAAI,CAAC,CAAC;UAC1F,IAAI,IAAI,IAAI,IAAI,EAAE;YAChB,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;WAC9D;QACH,CAAC,GACK,CACT,CAAC;IACJ,CAAC,CAAC;oBAjEkB,KAAK;gBAGV,EAAE;gBAGF,EAAE;iBAGgB,EAAE;gBAGH,KAAK;;iCAKJ,KAAK;;;EAQtC,iBAAiB;IACf,IAAI,CAAC,gBAA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,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Prop, State } from '@stencil/core';\nimport { hasSlot } from '../../utils/slot';\n\n/**\n * @since 1.0\n * @status stable\n *\n * @slot - Used to define the nested sidebar [group] items.\n */\n\n@Component({\n tag: 'six-sidebar-item-group',\n styleUrl: 'six-sidebar-item-group.scss',\n shadow: true,\n})\nexport class SixSidebarItemGroup {\n @Element() readonly host!: HTMLSixSidebarItemGroupElement;\n\n @State() hasItems = false;\n\n /** Title of item group */\n @Prop() name = '';\n\n /** Icon of the group */\n @Prop() icon = '';\n\n /** A unique value to store in the sidebar item of the group label. This can be used as a way to identify sidebar items when selected. */\n @Prop({ reflect: true }) value = '';\n\n /** Indicates whether the sidebar is shown */\n @Prop({ reflect: true }) open = false;\n\n /** Custom summary icon name. */\n @Prop() summaryIcon?: string;\n\n @State() summaryIconHasContent = false;\n\n /**\n * Provide if the item should be rendered as anchor tag.\n * Note, that the href is added automatically when using routerLink in Angular.\n */\n @Prop({ reflect: true }) href: string | undefined;\n\n connectedCallback() {\n this.handleSlotChange = this.handleSlotChange.bind(this);\n }\n\n componentWillLoad() {\n this.handleSlotChange();\n }\n\n private handleSlotChange() {\n this.hasItems = hasSlot(this.host);\n }\n\n private isSubgroup() {\n return this.host.parentElement?.closest('six-sidebar-item-group') != null;\n }\n\n private renderAsHref(): boolean {\n return this.href != null && !this.hasItems;\n }\n\n private provideSlot = (name: string) => {\n if (this.summaryIconHasContent) {\n return (\n <div slot={name}>\n <slot name={name}></slot>\n </div>\n );\n }\n\n return (\n <slot\n name={name}\n onSlotchange={() => {\n const slot = this.host.shadowRoot?.querySelector<HTMLSlotElement>(`slot[name=\"${name}\"]`);\n if (slot != null) {\n this.summaryIconHasContent = slot.assignedNodes().length > 0;\n }\n }}\n ></slot>\n );\n };\n\n render() {\n const element = (\n <six-details\n class={{\n 'six-sidebar-item-group': true,\n 'six-sidebar-item-group--childless': !this.hasItems,\n 'six-sidebar-item-group--subgroup': this.isSubgroup(),\n }}\n inline={true}\n open={this.open}\n summary-icon={this.summaryIcon}\n hasContent={this.hasItems}\n >\n <div slot=\"summary\">\n <div class=\"six-sidebar-details__header\">\n {this.icon && <six-icon class=\"six-sidebar-details__header-icon\">{this.icon}</six-icon>}\n {this.name}\n </div>\n </div>\n {this.provideSlot('summary-icon')}\n <slot />\n </six-details>\n );\n\n if (this.renderAsHref()) {\n return (\n <a class=\"six-sidebar-details__link\" href={this.href}>\n {element}\n </a>\n );\n } else {\n return element;\n }\n }\n}\n"]}
@@ -10,7 +10,7 @@ describe('six-sidebar-item-group', () => {
10
10
  expect(page.root).toEqualHtml(`
11
11
  <six-sidebar-item-group value="">
12
12
  <mock:shadow-root>
13
- <six-details class="six-sidebar-item-group--childless" inline="">
13
+ <six-details class="six-sidebar-item-group six-sidebar-item-group--childless" inline="">
14
14
  <div slot="summary">
15
15
  <div class="six-sidebar-details__header"></div>
16
16
  </div>
@@ -30,7 +30,7 @@ describe('six-sidebar-item-group', () => {
30
30
  expect(page.root).toEqualHtml(`
31
31
  <six-sidebar-item-group value="">
32
32
  <mock:shadow-root>
33
- <six-details class="six-sidebar-item-group--childless" inline="">
33
+ <six-details class="six-sidebar-item-group six-sidebar-item-group--childless" inline="">
34
34
  <div slot="summary">
35
35
  <div class="six-sidebar-details__header"></div>
36
36
  </div>
@@ -1 +1 @@
1
- {"version":3,"file":"six-sidebar-item-group.spec.js","sourceRoot":"","sources":["../../../../src/components/six-sidebar-item-group/test/six-sidebar-item-group.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAEzE,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;EACtC,EAAE,CAAC,qBAAqB,EAAE,KAAK,IAAI,EAAE;IACnC,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,mBAAmB,CAAC;MACjC,IAAI,EAAE,mDAAmD;KAC1D,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;KAY7B,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;EAEH,EAAE,CAAC,yBAAyB,EAAE,KAAK,IAAI,EAAE;IACvC,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,mBAAmB,EAAE,cAAc,CAAC;MACjD,IAAI,EAAE,yGAAyG;KAChH,CAAC,CAAC;IAEH,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;IAE5B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;KAoB7B,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { SixSidebarItemGroup } from '../six-sidebar-item-group';\nimport { SixSidebarItem } from '../../six-sidebar-item/six-sidebar-item';\n\ndescribe('six-sidebar-item-group', () => {\n it('renders empty group', async () => {\n const page = await newSpecPage({\n components: [SixSidebarItemGroup],\n html: `<six-sidebar-item-group></six-sidebar-item-group>`,\n });\n expect(page.root).toEqualHtml(`\n <six-sidebar-item-group value=\"\">\n <mock:shadow-root>\n <six-details class=\"six-sidebar-item-group--childless\" inline=\"\">\n <div slot=\"summary\">\n <div class=\"six-sidebar-details__header\"></div>\n </div>\n <slot name=\"summary-icon\"></slot>\n <slot></slot>\n </six-details>\n </mock:shadow-root>\n </six-sidebar-item-group>\n `);\n });\n\n it('renders group with item', async () => {\n const page = await newSpecPage({\n components: [SixSidebarItemGroup, SixSidebarItem],\n html: `<six-sidebar-item-group><six-sidebar-item value=\"data\">Data</six-sidebar-item></six-sidebar-item-group>`,\n });\n\n await page.waitForChanges();\n\n expect(page.root).toEqualHtml(`\n <six-sidebar-item-group value=\"\">\n <mock:shadow-root>\n <six-details class=\"six-sidebar-item-group--childless\" inline=\"\">\n <div slot=\"summary\">\n <div class=\"six-sidebar-details__header\"></div>\n </div>\n <slot name=\"summary-icon\"></slot>\n <slot></slot>\n </six-details>\n </mock:shadow-root>\n <six-sidebar-item value=\"data\">\n <mock:shadow-root>\n <div aria-disabled=\"false\" aria-selected=\"false\" class=\"sidebar-item\" role=\"menuitem\">\n <slot></slot>\n </div>\n </mock:shadow-root>\n Data\n </six-sidebar-item>\n </six-sidebar-item-group>\n `);\n });\n});\n"]}
1
+ {"version":3,"file":"six-sidebar-item-group.spec.js","sourceRoot":"","sources":["../../../../src/components/six-sidebar-item-group/test/six-sidebar-item-group.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAEzE,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;EACtC,EAAE,CAAC,qBAAqB,EAAE,KAAK,IAAI,EAAE;IACnC,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,mBAAmB,CAAC;MACjC,IAAI,EAAE,mDAAmD;KAC1D,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;KAY7B,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;EAEH,EAAE,CAAC,yBAAyB,EAAE,KAAK,IAAI,EAAE;IACvC,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,mBAAmB,EAAE,cAAc,CAAC;MACjD,IAAI,EAAE,yGAAyG;KAChH,CAAC,CAAC;IAEH,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;IAE5B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;KAoB7B,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { SixSidebarItemGroup } from '../six-sidebar-item-group';\nimport { SixSidebarItem } from '../../six-sidebar-item/six-sidebar-item';\n\ndescribe('six-sidebar-item-group', () => {\n it('renders empty group', async () => {\n const page = await newSpecPage({\n components: [SixSidebarItemGroup],\n html: `<six-sidebar-item-group></six-sidebar-item-group>`,\n });\n expect(page.root).toEqualHtml(`\n <six-sidebar-item-group value=\"\">\n <mock:shadow-root>\n <six-details class=\"six-sidebar-item-group six-sidebar-item-group--childless\" inline=\"\">\n <div slot=\"summary\">\n <div class=\"six-sidebar-details__header\"></div>\n </div>\n <slot name=\"summary-icon\"></slot>\n <slot></slot>\n </six-details>\n </mock:shadow-root>\n </six-sidebar-item-group>\n `);\n });\n\n it('renders group with item', async () => {\n const page = await newSpecPage({\n components: [SixSidebarItemGroup, SixSidebarItem],\n html: `<six-sidebar-item-group><six-sidebar-item value=\"data\">Data</six-sidebar-item></six-sidebar-item-group>`,\n });\n\n await page.waitForChanges();\n\n expect(page.root).toEqualHtml(`\n <six-sidebar-item-group value=\"\">\n <mock:shadow-root>\n <six-details class=\"six-sidebar-item-group six-sidebar-item-group--childless\" inline=\"\">\n <div slot=\"summary\">\n <div class=\"six-sidebar-details__header\"></div>\n </div>\n <slot name=\"summary-icon\"></slot>\n <slot></slot>\n </six-details>\n </mock:shadow-root>\n <six-sidebar-item value=\"data\">\n <mock:shadow-root>\n <div aria-disabled=\"false\" aria-selected=\"false\" class=\"sidebar-item\" role=\"menuitem\">\n <slot></slot>\n </div>\n </mock:shadow-root>\n Data\n </six-sidebar-item>\n </six-sidebar-item-group>\n `);\n });\n});\n"]}
@@ -14,6 +14,7 @@
14
14
  }
15
15
  .form-control .form-control__error-text {
16
16
  display: none;
17
+ text-align: left;
17
18
  }
18
19
 
19
20
  .form-control--has-label .form-control__label {
@@ -25,6 +26,9 @@
25
26
  .form-control--has-label .form-control__label__required::after {
26
27
  color: var(--six-color-danger-800);
27
28
  content: "*";
29
+ transform: scale(1.1);
30
+ margin-left: var(--six-spacing-xxx-small);
31
+ position: absolute;
28
32
  }
29
33
  .form-control--has-label.form-control--small .form-control__label {
30
34
  font-size: var(--six-input-label-font-size-small);
@@ -56,7 +60,6 @@
56
60
 
57
61
  .form-control--has-error-text .form-control__error-text {
58
62
  display: block;
59
- color: var(--six-color-danger-800);
60
63
  margin-top: var(--six-spacing-xxx-small);
61
64
  }
62
65
  .form-control--has-error-text .form-control__error-text ::slotted(*) {
@@ -1,6 +1,7 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { EventListeners } from "../../utils/event-listeners";
3
3
  import FormControl from "../../functional-components/form-control/form-control";
4
+ import { hasSlot } from "../../utils/slot";
4
5
  let id = 0;
5
6
  /**
6
7
  * @since 1.0
@@ -9,6 +10,7 @@ let id = 0;
9
10
  * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.
10
11
  *
11
12
  * @slot - The switch's label.
13
+ * @slot error-text - Error text that is shown for validation errors. Alternatively, you can use the error-text prop.
12
14
  *
13
15
  * @part base - The component's base wrapper.
14
16
  * @part control - The switch control.
@@ -21,6 +23,9 @@ export class SixSwitch {
21
23
  this.labelId = `switch-label-${id}`;
22
24
  this.errorTextId = `input-error-text-${id}`;
23
25
  this.eventListeners = new EventListeners();
26
+ this.handleSlotChange = () => {
27
+ this.hasErrorTextSlot = hasSlot(this.host, 'error-text');
28
+ };
24
29
  this.handleClick = () => {
25
30
  if (this.inputElement != null) {
26
31
  this.checked = this.inputElement.checked;
@@ -54,6 +59,7 @@ export class SixSwitch {
54
59
  (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.focus();
55
60
  };
56
61
  this.hasFocus = false;
62
+ this.hasErrorTextSlot = false;
57
63
  this.name = '';
58
64
  this.value = 'on';
59
65
  this.disabled = false;
@@ -61,8 +67,12 @@ export class SixSwitch {
61
67
  this.checked = false;
62
68
  this.label = '';
63
69
  this.errorText = '';
70
+ this.errorTextCount = undefined;
64
71
  this.invalid = false;
65
72
  }
73
+ componentWillLoad() {
74
+ this.handleSlotChange();
75
+ }
66
76
  handleCheckedChange() {
67
77
  if (this.inputElement != null) {
68
78
  this.inputElement.checked = this.checked;
@@ -70,13 +80,20 @@ export class SixSwitch {
70
80
  }
71
81
  }
72
82
  connectedCallback() {
83
+ var _a;
84
+ (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.addEventListener('slotchange', this.handleSlotChange);
73
85
  this.eventListeners.forward('six-switch-change', 'change', this.host);
74
86
  this.eventListeners.forward('six-switch-blur', 'blur', this.host);
75
87
  this.eventListeners.forward('six-switch-focus', 'focus', this.host);
76
88
  }
77
89
  disconnectedCallback() {
90
+ var _a;
91
+ (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeEventListener('slotchange', this.handleSlotChange);
78
92
  this.eventListeners.removeAll();
79
93
  }
94
+ handleLabelChange() {
95
+ this.handleSlotChange();
96
+ }
80
97
  /** Sets focus on the switch. */
81
98
  async setFocus(options) {
82
99
  var _a;
@@ -88,7 +105,7 @@ export class SixSwitch {
88
105
  (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.blur();
89
106
  }
90
107
  render() {
91
- return (h(FormControl, { inputId: this.switchId, label: this.label, labelId: this.labelId, hasLabelSlot: false, errorTextId: this.errorTextId, errorText: this.errorText, size: "medium", disabled: this.disabled, required: this.required, displayError: this.invalid }, h("label", { part: "base", htmlFor: this.switchId, class: {
108
+ return (h(FormControl, { inputId: this.switchId, label: this.label, labelId: this.labelId, hasLabelSlot: false, errorTextId: this.errorTextId, errorText: this.errorText, errorTextCount: this.errorTextCount, hasErrorTextSlot: this.hasErrorTextSlot, size: "medium", disabled: this.disabled, required: this.required, displayError: this.invalid }, h("label", { part: "base", htmlFor: this.switchId, class: {
92
109
  switch: true,
93
110
  'switch--checked': this.checked,
94
111
  'switch--disabled': this.disabled,
@@ -221,8 +238,8 @@ export class SixSwitch {
221
238
  "type": "string",
222
239
  "mutable": false,
223
240
  "complexType": {
224
- "original": "string",
225
- "resolved": "string",
241
+ "original": "string | string[]",
242
+ "resolved": "string | string[]",
226
243
  "references": {}
227
244
  },
228
245
  "required": false,
@@ -235,6 +252,23 @@ export class SixSwitch {
235
252
  "reflect": false,
236
253
  "defaultValue": "''"
237
254
  },
255
+ "errorTextCount": {
256
+ "type": "number",
257
+ "mutable": false,
258
+ "complexType": {
259
+ "original": "number",
260
+ "resolved": "number | undefined",
261
+ "references": {}
262
+ },
263
+ "required": false,
264
+ "optional": true,
265
+ "docs": {
266
+ "tags": [],
267
+ "text": "The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1"
268
+ },
269
+ "attribute": "error-text-count",
270
+ "reflect": false
271
+ },
238
272
  "invalid": {
239
273
  "type": "boolean",
240
274
  "mutable": false,
@@ -257,7 +291,8 @@ export class SixSwitch {
257
291
  }
258
292
  static get states() {
259
293
  return {
260
- "hasFocus": {}
294
+ "hasFocus": {},
295
+ "hasErrorTextSlot": {}
261
296
  };
262
297
  }
263
298
  static get events() {
@@ -364,6 +399,12 @@ export class SixSwitch {
364
399
  return [{
365
400
  "propName": "checked",
366
401
  "methodName": "handleCheckedChange"
402
+ }, {
403
+ "propName": "errorText",
404
+ "methodName": "handleLabelChange"
405
+ }, {
406
+ "propName": "label",
407
+ "methodName": "handleLabelChange"
367
408
  }];
368
409
  }
369
410
  }
@@ -1 +1 @@
1
- {"version":3,"file":"six-switch.js","sourceRoot":"","sources":["../../../src/components/six-switch/six-switch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,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ACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAC,QAAQ,kBACC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,qBAC5B,IAAI,CAAC,OAAO,EAC7B,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,MAAM,EAAE,IAAI,CAAC,UAAU,EACvB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,SAAS,EAAE,IAAI,CAAC,aAAa,GAC7B,CACG;QAEP,YAAM,IAAI,EAAC,OAAO,EAAC,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,EAAC,eAAe;UACxD,eAAQ,CACH,CACD,CACI,CACf,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport { EmptyPayload } from '../../utils/types';\nimport { EventListeners } from '../../utils/event-listeners';\nimport FormControl from '../../functional-components/form-control/form-control';\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot - The switch's label.\n *\n * @part base - The component's base wrapper.\n * @part control - The switch control.\n * @part thumb - The switch position indicator.\n * @part label - The switch label.\n */\n\n@Component({\n tag: 'six-switch',\n styleUrl: 'six-switch.scss',\n shadow: true,\n})\nexport class SixSwitch {\n private switchId = `switch-${++id}`;\n private labelId = `switch-label-${id}`;\n private errorTextId = `input-error-text-${id}`;\n\n private inputElement?: HTMLInputElement;\n private eventListeners = new EventListeners();\n\n @Element() host!: HTMLSixSwitchElement;\n\n @State() hasFocus = false;\n\n /** The switch's name attribute. */\n @Prop() name = '';\n\n /** The switch's value attribute. */\n @Prop() value = 'on';\n\n /** Set to true to disable the switch. */\n @Prop() disabled = false;\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /** Set to true to draw the switch in a checked state. */\n @Prop({ mutable: true, reflect: true }) checked = false;\n\n /** The label text. */\n @Prop() label = '';\n\n /** The error message shown, if `invalid` is set to true. */\n @Prop() errorText = '';\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n @Watch('checked')\n handleCheckedChange() {\n if (this.inputElement != null) {\n this.inputElement.checked = this.checked;\n this.checked = this.inputElement.checked;\n }\n }\n\n /** Emitted when the control loses focus. */\n @Event({ eventName: 'six-switch-blur' }) sixBlur!: EventEmitter<boolean>;\n\n /** Emitted when the control's checked state changes. */\n @Event({ eventName: 'six-switch-change' }) sixChange!: EventEmitter<boolean>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-switch-focus' }) sixFocus!: EventEmitter<EmptyPayload>;\n\n connectedCallback() {\n this.eventListeners.forward('six-switch-change', 'change', this.host);\n this.eventListeners.forward('six-switch-blur', 'blur', this.host);\n this.eventListeners.forward('six-switch-focus', 'focus', this.host);\n }\n\n disconnectedCallback() {\n this.eventListeners.removeAll();\n }\n\n /** Sets focus on the switch. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.inputElement?.focus(options);\n }\n\n /** Removes focus from the switch. */\n @Method()\n async removeFocus() {\n this.inputElement?.blur();\n }\n\n private handleClick = () => {\n if (this.inputElement != null) {\n this.checked = this.inputElement.checked;\n this.sixChange.emit(this.checked);\n }\n };\n\n private handleBlur = () => {\n this.hasFocus = false;\n this.sixBlur.emit(this.checked);\n };\n\n private handleFocus = () => {\n this.hasFocus = true;\n this.sixFocus.emit();\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n this.checked = false;\n this.sixChange.emit(this.checked);\n }\n\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n this.checked = true;\n this.sixChange.emit(this.checked);\n }\n };\n\n private handleMouseDown = (event: MouseEvent) => {\n // Prevent clicks on the label from briefly blurring the input\n event.preventDefault();\n this.inputElement?.focus();\n };\n\n render() {\n return (\n <FormControl\n inputId={this.switchId}\n label={this.label}\n labelId={this.labelId}\n hasLabelSlot={false}\n errorTextId={this.errorTextId}\n errorText={this.errorText}\n size=\"medium\"\n disabled={this.disabled}\n required={this.required}\n displayError={this.invalid}\n >\n <label\n part=\"base\"\n htmlFor={this.switchId}\n class={{\n switch: true,\n 'switch--checked': this.checked,\n 'switch--disabled': this.disabled,\n 'switch--focused': this.hasFocus,\n }}\n onMouseDown={this.handleMouseDown}\n >\n <span part=\"control\" class=\"switch__control\">\n <span part=\"thumb\" class=\"switch__thumb\" />\n\n <input\n ref={(el) => (this.inputElement = el)}\n id={this.switchId}\n type=\"checkbox\"\n name={this.name}\n value={this.value}\n checked={this.checked}\n disabled={this.disabled}\n required={this.required}\n role=\"switch\"\n aria-checked={this.checked ? 'true' : 'false'}\n aria-labelledby={this.labelId}\n onClick={this.handleClick}\n onBlur={this.handleBlur}\n onFocus={this.handleFocus}\n onKeyDown={this.handleKeyDown}\n />\n </span>\n\n <span part=\"label\" id={this.labelId} class=\"switch__label\">\n <slot />\n </span>\n </label>\n </FormControl>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"six-switch.js","sourceRoot":"","sources":["../../../src/components/six-switch/six-switch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEvG,OAAO,EAAE,cAAc,EAAE,MAAM,6B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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport { EmptyPayload } from '../../utils/types';\nimport { EventListeners } from '../../utils/event-listeners';\nimport FormControl from '../../functional-components/form-control/form-control';\nimport { hasSlot } from '../../utils/slot';\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot - The switch's label.\n * @slot error-text - Error text that is shown for validation errors. Alternatively, you can use the error-text prop.\n *\n * @part base - The component's base wrapper.\n * @part control - The switch control.\n * @part thumb - The switch position indicator.\n * @part label - The switch label.\n */\n\n@Component({\n tag: 'six-switch',\n styleUrl: 'six-switch.scss',\n shadow: true,\n})\nexport class SixSwitch {\n private switchId = `switch-${++id}`;\n private labelId = `switch-label-${id}`;\n private errorTextId = `input-error-text-${id}`;\n\n private inputElement?: HTMLInputElement;\n private eventListeners = new EventListeners();\n\n @Element() host!: HTMLSixSwitchElement;\n\n @State() hasFocus = false;\n @State() hasErrorTextSlot = false;\n\n /** The switch's name attribute. */\n @Prop() name = '';\n\n /** The switch's value attribute. */\n @Prop() value = 'on';\n\n /** Set to true to disable the switch. */\n @Prop() disabled = false;\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /** Set to true to draw the switch in a checked state. */\n @Prop({ mutable: true, reflect: true }) checked = false;\n\n /** The label text. */\n @Prop() label = '';\n\n /** The error message shown, if `invalid` is set to true. */\n @Prop() errorText: string | string[] = '';\n\n /** The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1 */\n @Prop() errorTextCount?: number;\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n componentWillLoad() {\n this.handleSlotChange();\n }\n\n @Watch('checked')\n handleCheckedChange() {\n if (this.inputElement != null) {\n this.inputElement.checked = this.checked;\n this.checked = this.inputElement.checked;\n }\n }\n\n /** Emitted when the control loses focus. */\n @Event({ eventName: 'six-switch-blur' }) sixBlur!: EventEmitter<boolean>;\n\n /** Emitted when the control's checked state changes. */\n @Event({ eventName: 'six-switch-change' }) sixChange!: EventEmitter<boolean>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-switch-focus' }) sixFocus!: EventEmitter<EmptyPayload>;\n\n connectedCallback() {\n this.host.shadowRoot?.addEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.forward('six-switch-change', 'change', this.host);\n this.eventListeners.forward('six-switch-blur', 'blur', this.host);\n this.eventListeners.forward('six-switch-focus', 'focus', this.host);\n }\n\n disconnectedCallback() {\n this.host.shadowRoot?.removeEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.removeAll();\n }\n\n @Watch('errorText')\n @Watch('label')\n handleLabelChange() {\n this.handleSlotChange();\n }\n\n private handleSlotChange = () => {\n this.hasErrorTextSlot = hasSlot(this.host, 'error-text');\n };\n\n /** Sets focus on the switch. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.inputElement?.focus(options);\n }\n\n /** Removes focus from the switch. */\n @Method()\n async removeFocus() {\n this.inputElement?.blur();\n }\n\n private handleClick = () => {\n if (this.inputElement != null) {\n this.checked = this.inputElement.checked;\n this.sixChange.emit(this.checked);\n }\n };\n\n private handleBlur = () => {\n this.hasFocus = false;\n this.sixBlur.emit(this.checked);\n };\n\n private handleFocus = () => {\n this.hasFocus = true;\n this.sixFocus.emit();\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n this.checked = false;\n this.sixChange.emit(this.checked);\n }\n\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n this.checked = true;\n this.sixChange.emit(this.checked);\n }\n };\n\n private handleMouseDown = (event: MouseEvent) => {\n // Prevent clicks on the label from briefly blurring the input\n event.preventDefault();\n this.inputElement?.focus();\n };\n\n render() {\n return (\n <FormControl\n inputId={this.switchId}\n label={this.label}\n labelId={this.labelId}\n hasLabelSlot={false}\n errorTextId={this.errorTextId}\n errorText={this.errorText}\n errorTextCount={this.errorTextCount}\n hasErrorTextSlot={this.hasErrorTextSlot}\n size=\"medium\"\n disabled={this.disabled}\n required={this.required}\n displayError={this.invalid}\n >\n <label\n part=\"base\"\n htmlFor={this.switchId}\n class={{\n switch: true,\n 'switch--checked': this.checked,\n 'switch--disabled': this.disabled,\n 'switch--focused': this.hasFocus,\n }}\n onMouseDown={this.handleMouseDown}\n >\n <span part=\"control\" class=\"switch__control\">\n <span part=\"thumb\" class=\"switch__thumb\" />\n\n <input\n ref={(el) => (this.inputElement = el)}\n id={this.switchId}\n type=\"checkbox\"\n name={this.name}\n value={this.value}\n checked={this.checked}\n disabled={this.disabled}\n required={this.required}\n role=\"switch\"\n aria-checked={this.checked ? 'true' : 'false'}\n aria-labelledby={this.labelId}\n onClick={this.handleClick}\n onBlur={this.handleBlur}\n onFocus={this.handleFocus}\n onKeyDown={this.handleKeyDown}\n />\n </span>\n\n <span part=\"label\" id={this.labelId} class=\"switch__label\">\n <slot />\n </span>\n </label>\n </FormControl>\n );\n }\n}\n"]}
@@ -24,7 +24,9 @@ describe('six-switch', () => {
24
24
  </span>
25
25
  </label>
26
26
  </div>
27
- <div aria-hidden="true" class="form-control__error-text" id="input-error-text-1" part="error-text"></div>
27
+ <div aria-hidden="true" class="form-control__error-text" id="input-error-text-1" part="error-text">
28
+ <slot name="error-text"></slot>
29
+ </div>
28
30
  <div aria-hidden="true" class="form-control__help-text" part="help-text">
29
31
  <slot name="help-text"></slot>
30
32
  </div>
@@ -56,7 +58,9 @@ describe('six-switch', () => {
56
58
  </span>
57
59
  </label>
58
60
  </div>
59
- <div aria-hidden="true" class="form-control__error-text" id="input-error-text-2" part="error-text"></div>
61
+ <div aria-hidden="true" class="form-control__error-text" id="input-error-text-2" part="error-text">
62
+ <slot name="error-text"></slot>
63
+ </div>
60
64
  <div aria-hidden="true" class="form-control__help-text" part="help-text">
61
65
  <slot name="help-text"></slot>
62
66
  </div>
@@ -1 +1 @@
1
- {"version":3,"file":"six-switch.spec.js","sourceRoot":"","sources":["../../../../src/components/six-switch/test/six-switch.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;EAC1B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,SAAS,CAAC;MACvB,IAAI,EAAE,2BAA2B;KAClC,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;KAyB7B,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;EAEH,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,SAAS,CAAC;MACvB,IAAI,EAAE,mCAAmC;KAC1C,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;KAyB7B,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { SixSwitch } from '../six-switch';\n\ndescribe('six-switch', () => {\n it('default', async () => {\n const page = await newSpecPage({\n components: [SixSwitch],\n html: `<six-switch></six-switch>`,\n });\n expect(page.root).toEqualHtml(`\n <six-switch>\n <mock:shadow-root>\n <div class=\"form-control form-control--medium\" part=\"form-control\">\n <label aria-hidden=\"true\" class=\"form-control__label\" htmlfor=\"switch-1\" id=\"switch-label-1\" part=\"label\">\n <slot name=\"label\"></slot>\n </label>\n <div class=\"form-control__input\">\n <label class=\"switch\" htmlfor=\"switch-1\" part=\"base\">\n <span class=\"switch__control\" part=\"control\">\n <span class=\"switch__thumb\" part=\"thumb\"></span>\n <input aria-checked=\"false\" aria-labelledby=\"switch-label-1\" id=\"switch-1\" role=\"switch\" type=\"checkbox\" value=\"on\">\n </span>\n <span class=\"switch__label\" id=\"switch-label-1\" part=\"label\">\n <slot></slot>\n </span>\n </label>\n </div>\n <div aria-hidden=\"true\" class=\"form-control__error-text\" id=\"input-error-text-1\" part=\"error-text\"></div>\n <div aria-hidden=\"true\" class=\"form-control__help-text\" part=\"help-text\">\n <slot name=\"help-text\"></slot>\n </div>\n </div>\n </mock:shadow-root>\n </six-switch>\n `);\n });\n\n it('checked', async () => {\n const page = await newSpecPage({\n components: [SixSwitch],\n html: `<six-switch checked></six-switch>`,\n });\n expect(page.root).toEqualHtml(`\n <six-switch checked=\"\">\n <mock:shadow-root>\n <div class=\"form-control form-control--medium\" part=\"form-control\">\n <label aria-hidden=\"true\" class=\"form-control__label\" htmlfor=\"switch-2\" id=\"switch-label-2\" part=\"label\">\n <slot name=\"label\"></slot>\n </label>\n <div class=\"form-control__input\">\n <label class=\"switch switch--checked\" htmlfor=\"switch-2\" part=\"base\">\n <span class=\"switch__control\" part=\"control\">\n <span class=\"switch__thumb\" part=\"thumb\"></span>\n <input aria-checked=\"true\" aria-labelledby=\"switch-label-2\" checked=\"\" id=\"switch-2\" role=\"switch\" type=\"checkbox\" value=\"on\">\n </span>\n <span class=\"switch__label\" id=\"switch-label-2\" part=\"label\">\n <slot></slot>\n </span>\n </label>\n </div>\n <div aria-hidden=\"true\" class=\"form-control__error-text\" id=\"input-error-text-2\" part=\"error-text\"></div>\n <div aria-hidden=\"true\" class=\"form-control__help-text\" part=\"help-text\">\n <slot name=\"help-text\"></slot>\n </div>\n </div>\n </mock:shadow-root>\n </six-switch>\n `);\n });\n});\n"]}
1
+ {"version":3,"file":"six-switch.spec.js","sourceRoot":"","sources":["../../../../src/components/six-switch/test/six-switch.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;EAC1B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,SAAS,CAAC;MACvB,IAAI,EAAE,2BAA2B;KAClC,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2B7B,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;EAEH,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,SAAS,CAAC;MACvB,IAAI,EAAE,mCAAmC;KAC1C,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2B7B,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { SixSwitch } from '../six-switch';\n\ndescribe('six-switch', () => {\n it('default', async () => {\n const page = await newSpecPage({\n components: [SixSwitch],\n html: `<six-switch></six-switch>`,\n });\n expect(page.root).toEqualHtml(`\n <six-switch>\n <mock:shadow-root>\n <div class=\"form-control form-control--medium\" part=\"form-control\">\n <label aria-hidden=\"true\" class=\"form-control__label\" htmlfor=\"switch-1\" id=\"switch-label-1\" part=\"label\">\n <slot name=\"label\"></slot>\n </label>\n <div class=\"form-control__input\">\n <label class=\"switch\" htmlfor=\"switch-1\" part=\"base\">\n <span class=\"switch__control\" part=\"control\">\n <span class=\"switch__thumb\" part=\"thumb\"></span>\n <input aria-checked=\"false\" aria-labelledby=\"switch-label-1\" id=\"switch-1\" role=\"switch\" type=\"checkbox\" value=\"on\">\n </span>\n <span class=\"switch__label\" id=\"switch-label-1\" part=\"label\">\n <slot></slot>\n </span>\n </label>\n </div>\n <div aria-hidden=\"true\" class=\"form-control__error-text\" id=\"input-error-text-1\" part=\"error-text\">\n <slot name=\"error-text\"></slot>\n </div>\n <div aria-hidden=\"true\" class=\"form-control__help-text\" part=\"help-text\">\n <slot name=\"help-text\"></slot>\n </div>\n </div>\n </mock:shadow-root>\n </six-switch>\n `);\n });\n\n it('checked', async () => {\n const page = await newSpecPage({\n components: [SixSwitch],\n html: `<six-switch checked></six-switch>`,\n });\n expect(page.root).toEqualHtml(`\n <six-switch checked=\"\">\n <mock:shadow-root>\n <div class=\"form-control form-control--medium\" part=\"form-control\">\n <label aria-hidden=\"true\" class=\"form-control__label\" htmlfor=\"switch-2\" id=\"switch-label-2\" part=\"label\">\n <slot name=\"label\"></slot>\n </label>\n <div class=\"form-control__input\">\n <label class=\"switch switch--checked\" htmlfor=\"switch-2\" part=\"base\">\n <span class=\"switch__control\" part=\"control\">\n <span class=\"switch__thumb\" part=\"thumb\"></span>\n <input aria-checked=\"true\" aria-labelledby=\"switch-label-2\" checked=\"\" id=\"switch-2\" role=\"switch\" type=\"checkbox\" value=\"on\">\n </span>\n <span class=\"switch__label\" id=\"switch-label-2\" part=\"label\">\n <slot></slot>\n </span>\n </label>\n </div>\n <div aria-hidden=\"true\" class=\"form-control__error-text\" id=\"input-error-text-2\" part=\"error-text\">\n <slot name=\"error-text\"></slot>\n </div>\n <div aria-hidden=\"true\" class=\"form-control__help-text\" part=\"help-text\">\n <slot name=\"help-text\"></slot>\n </div>\n </div>\n </mock:shadow-root>\n </six-switch>\n `);\n });\n});\n"]}
@@ -7,7 +7,7 @@
7
7
  }
8
8
 
9
9
  :host {
10
- display: inline-block;
10
+ display: flex;
11
11
  }
12
12
 
13
13
  .tab {
@@ -16,19 +16,19 @@
16
16
  font-family: var(--six-font-family);
17
17
  font-size: var(--six-font-size-small);
18
18
  font-weight: var(--six-font-weight-semibold);
19
- border-radius: 4px;
20
19
  color: var(--six-tab-color);
21
20
  padding: var(--six-spacing-medium) var(--six-spacing-large);
22
21
  white-space: nowrap;
23
22
  user-select: none;
24
23
  cursor: pointer;
25
- transition: var(--six-transition-fast) box-shadow, var(--six-transition-fast) color;
24
+ width: 100%;
26
25
  }
27
26
  .tab:focus {
28
27
  outline: none;
29
28
  }
30
- .tab:focus:not(.tab--disabled) {
31
- color: var(--six-tab-color-active);
29
+ .tab:focus-visible {
30
+ outline: var(--six-focus-ring);
31
+ outline-offset: calc(-1 * var(--six-focus-ring-width) - var(--six-focus-ring-offset));
32
32
  }
33
33
  .tab.tab--active:not(.tab--disabled) {
34
34
  color: var(--six-tab-color-active);
@@ -51,4 +51,53 @@
51
51
  }
52
52
  .tab__close-button::part(base) {
53
53
  padding: var(--six-spacing-xxx-small);
54
+ }
55
+
56
+ .tab__indicator {
57
+ position: absolute;
58
+ }
59
+ .tab__indicator.tab__indicator--active {
60
+ background-color: var(--six-tab-border-color-active);
61
+ }
62
+
63
+ .tab--top {
64
+ margin-bottom: var(--six-spacing-xxx-small);
65
+ }
66
+
67
+ .tab__indicator--top {
68
+ width: 100%;
69
+ bottom: 0;
70
+ height: var(--six-tab-border-width);
71
+ }
72
+
73
+ .tab--bottom {
74
+ margin-top: var(--six-spacing-xxx-small);
75
+ }
76
+
77
+ .tab__indicator--bottom {
78
+ width: 100%;
79
+ top: 0;
80
+ height: var(--six-tab-border-width);
81
+ }
82
+
83
+ .tab--left {
84
+ margin-right: var(--six-spacing-xxx-small);
85
+ }
86
+
87
+ .tab__indicator--left {
88
+ height: 100%;
89
+ right: 0;
90
+ top: 0;
91
+ width: var(--six-tab-border-width);
92
+ }
93
+
94
+ .tab--right {
95
+ margin-left: var(--six-spacing-xxx-small);
96
+ }
97
+
98
+ .tab__indicator--right {
99
+ height: 100%;
100
+ left: 0;
101
+ top: 0;
102
+ width: var(--six-tab-border-width);
54
103
  }
@@ -36,15 +36,31 @@ export class SixTab {
36
36
  this.sixClose.emit();
37
37
  }
38
38
  render() {
39
+ var _a;
40
+ const tabGroup = this.host.closest('six-tab-group');
41
+ const placement = (_a = tabGroup === null || tabGroup === void 0 ? void 0 : tabGroup.placement) !== null && _a !== void 0 ? _a : 'top';
39
42
  return (
40
- // If the user didn't provide an ID, we'll set one so we can link tabs and tab panels with aria labels
43
+ // If the user didn't provide an ID, we'll set one, so we can link tabs and tab panels with aria labels
41
44
  h(Host, { id: this.host.id || this.componentId }, h("div", { part: "base", ref: (el) => (this.tab = el), class: {
42
45
  tab: true,
46
+ // Placements
47
+ 'tab--top': placement === 'top',
48
+ 'tab--bottom': placement === 'bottom',
49
+ 'tab--left': placement === 'left',
50
+ 'tab--right': placement === 'right',
43
51
  // States
44
52
  'tab--active': this.active,
45
53
  'tab--closable': this.closable,
46
54
  'tab--disabled': this.disabled,
47
- }, role: "tab", "aria-disabled": this.disabled ? 'true' : 'false', "aria-selected": this.active ? 'true' : 'false', tabindex: this.disabled || !this.active ? '-1' : '0' }, h("slot", null), this.closable && (h("six-icon-button", { name: "close", size: "xSmall", exportparts: "base:close-button", class: "tab__close-button", onClick: this.handleCloseClick, tabIndex: -1, "aria-hidden": "true" })))));
55
+ }, role: "tab", "aria-disabled": this.disabled ? 'true' : 'false', "aria-selected": this.active ? 'true' : 'false', tabindex: this.disabled || !this.active ? '-1' : '0' }, h("slot", null), this.closable && (h("six-icon-button", { name: "close", size: "xSmall", exportparts: "base:close-button", class: "tab__close-button", onClick: this.handleCloseClick, tabIndex: -1, "aria-hidden": "true" }))), h("div", { class: {
56
+ tab__indicator: true,
57
+ 'tab__indicator--active': this.active,
58
+ // Placements
59
+ 'tab__indicator--top': placement === 'top',
60
+ 'tab__indicator--bottom': placement === 'bottom',
61
+ 'tab__indicator--left': placement === 'left',
62
+ 'tab__indicator--right': placement === 'right',
63
+ } })));
48
64
  }
49
65
  static get is() { return "six-tab"; }
50
66
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- {"version":3,"file":"six-tab.js","sourceRoot":"","sources":["../../../src/components/six-tab/six-tab.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAG/F,IAAI,EAAE,GAAG,CAAC,CAAC;AAEX;;;;;;;;;;GAUG;AAOH,MAAM,OAAO,MAAM;;IACT,gBAAW,GAAG,OAAO,EAAE,EAAE,EAAE,CAAC;iBAMH,EAAE;kBAGD,KAAK;oBAGpB,KAAK;oBAGY,KAAK;;EAKzC,iBAAiB;IACf,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;EAC3D,CAAC;EAED,6BAA6B;EAE7B,KAAK,CAAC,QAAQ,CAAC,OAAsB;;IACnC,MAAA,IAAI,CAAC,GAAG,0CAAE,KAAK,CAAC,OAAO,CAAC,CAAC;EAC3B,CAAC;EAED,kCAAkC;EAElC,KAAK,CAAC,WAAW;;IACf,MAAA,IAAI,CAAC,GAAG,0CAAE,IAAI,EAAE,CAAC;EACnB,CAAC;EAEO,gBAAgB;IACtB,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;EACvB,CAAC;EAED,MAAM;IACJ,OAAO;IACL,sGAAsG;IACtG,EAAC,IAAI,IAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,WAAW;MACxC,WACE,IAAI,EAAC,MAAM,EACX,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,EAC5B,KAAK,EAAE;UACL,GAAG,EAAE,IAAI;UAET,SAAS;UACT,aAAa,EAAE,IAAI,CAAC,MAAM;UAC1B,eAAe,EAAE,IAAI,CAAC,QAAQ;UAC9B,eAAe,EAAE,IAAI,CAAC,QAAQ;SAC/B,EACD,IAAI,EAAC,KAAK,mBACK,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,mBAChC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAC7C,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG;QAEpD,eAAQ;QACP,IAAI,CAAC,QAAQ,IAAI,CAChB,uBACE,IAAI,EAAC,OAAO,EACZ,IAAI,EAAC,QAAQ,EACb,WAAW,EAAC,mBAAmB,EAC/B,KAAK,EAAC,mBAAmB,EACzB,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAC9B,QAAQ,EAAE,CAAC,CAAC,iBACA,MAAM,GAClB,CACH,CACG,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop } from '@stencil/core';\nimport { EmptyPayload } from '../../utils/types';\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot - The tab's label.\n *\n * @part base - The component's base wrapper.\n * @part close-button - The close button, which is the icon button's base wrapper.\n */\n\n@Component({\n tag: 'six-tab',\n styleUrl: 'six-tab.scss',\n shadow: true,\n})\nexport class SixTab {\n private componentId = `tab-${++id}`;\n private tab?: HTMLElement;\n\n @Element() host!: HTMLSixTabElement;\n\n /** The name of the tab panel the tab will control. The panel must be located in the same tab group. */\n @Prop({ reflect: true }) panel = '';\n\n /** Set to true to draw the tab in an active state. */\n @Prop({ reflect: true }) active = false;\n\n /** When true, the tab will be rendered with a close icon. */\n @Prop() closable = false;\n\n /** Set to true to draw the tab in a disabled state. */\n @Prop({ reflect: true }) disabled = false;\n\n /** Emitted when the tab is closable and the close button is activated. */\n @Event({ eventName: 'six-tab-close' }) sixClose!: EventEmitter<EmptyPayload>;\n\n connectedCallback() {\n this.handleCloseClick = this.handleCloseClick.bind(this);\n }\n\n /** Sets focus to the tab. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.tab?.focus(options);\n }\n\n /** Removes focus from the tab. */\n @Method()\n async removeFocus() {\n this.tab?.blur();\n }\n\n private handleCloseClick() {\n this.sixClose.emit();\n }\n\n render() {\n return (\n // If the user didn't provide an ID, we'll set one so we can link tabs and tab panels with aria labels\n <Host id={this.host.id || this.componentId}>\n <div\n part=\"base\"\n ref={(el) => (this.tab = el)}\n class={{\n tab: true,\n\n // States\n 'tab--active': this.active,\n 'tab--closable': this.closable,\n 'tab--disabled': this.disabled,\n }}\n role=\"tab\"\n aria-disabled={this.disabled ? 'true' : 'false'}\n aria-selected={this.active ? 'true' : 'false'}\n tabindex={this.disabled || !this.active ? '-1' : '0'}\n >\n <slot />\n {this.closable && (\n <six-icon-button\n name=\"close\"\n size=\"xSmall\"\n exportparts=\"base:close-button\"\n class=\"tab__close-button\"\n onClick={this.handleCloseClick}\n tabIndex={-1}\n aria-hidden=\"true\"\n />\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"six-tab.js","sourceRoot":"","sources":["../../../src/components/six-tab/six-tab.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAG/F,IA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;UAEnC,SAAS;UACT,aAAa,EAAE,IAAI,CAAC,MAAM;UAC1B,eAAe,EAAE,IAAI,CAAC,QAAQ;UAC9B,eAAe,EAAE,IAAI,CAAC,QAAQ;SAC/B,EACD,IAAI,EAAC,KAAK,mBACK,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,mBAChC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAC7C,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG;QAEpD,eAAQ;QACP,IAAI,CAAC,QAAQ,IAAI,CAChB,uBACE,IAAI,EAAC,OAAO,EACZ,IAAI,EAAC,QAAQ,EACb,WAAW,EAAC,mBAAmB,EAC/B,KAAK,EAAC,mBAAmB,EACzB,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAC9B,QAAQ,EAAE,CAAC,CAAC,iBACA,MAAM,GAClB,CACH,CACG;MACN,WACE,KAAK,EAAE;UACL,cAAc,EAAE,IAAI;UACpB,wBAAwB,EAAE,IAAI,CAAC,MAAM;UAErC,aAAa;UACb,qBAAqB,EAAE,SAAS,KAAK,KAAK;UAC1C,wBAAwB,EAAE,SAAS,KAAK,QAAQ;UAChD,sBAAsB,EAAE,SAAS,KAAK,MAAM;UAC5C,uBAAuB,EAAE,SAAS,KAAK,OAAO;SAC/C,GACI,CACF,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop } from '@stencil/core';\nimport { EmptyPayload } from '../../utils/types';\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot - The tab's label.\n *\n * @part base - The component's base wrapper.\n * @part close-button - The close button, which is the icon button's base wrapper.\n */\n\n@Component({\n tag: 'six-tab',\n styleUrl: 'six-tab.scss',\n shadow: true,\n})\nexport class SixTab {\n private componentId = `tab-${++id}`;\n private tab?: HTMLElement;\n\n @Element() host!: HTMLSixTabElement;\n\n /** The name of the tab panel the tab will control. The panel must be located in the same tab group. */\n @Prop({ reflect: true }) panel = '';\n\n /** Set to true to draw the tab in an active state. */\n @Prop({ reflect: true }) active = false;\n\n /** When true, the tab will be rendered with a close icon. */\n @Prop() closable = false;\n\n /** Set to true to draw the tab in a disabled state. */\n @Prop({ reflect: true }) disabled = false;\n\n /** Emitted when the tab is closable and the close button is activated. */\n @Event({ eventName: 'six-tab-close' }) sixClose!: EventEmitter<EmptyPayload>;\n\n connectedCallback() {\n this.handleCloseClick = this.handleCloseClick.bind(this);\n }\n\n /** Sets focus to the tab. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.tab?.focus(options);\n }\n\n /** Removes focus from the tab. */\n @Method()\n async removeFocus() {\n this.tab?.blur();\n }\n\n private handleCloseClick() {\n this.sixClose.emit();\n }\n\n render() {\n const tabGroup: HTMLSixTabGroupElement | null = this.host.closest('six-tab-group');\n const placement = tabGroup?.placement ?? 'top';\n return (\n // If the user didn't provide an ID, we'll set one, so we can link tabs and tab panels with aria labels\n <Host id={this.host.id || this.componentId}>\n <div\n part=\"base\"\n ref={(el) => (this.tab = el)}\n class={{\n tab: true,\n\n // Placements\n 'tab--top': placement === 'top',\n 'tab--bottom': placement === 'bottom',\n 'tab--left': placement === 'left',\n 'tab--right': placement === 'right',\n\n // States\n 'tab--active': this.active,\n 'tab--closable': this.closable,\n 'tab--disabled': this.disabled,\n }}\n role=\"tab\"\n aria-disabled={this.disabled ? 'true' : 'false'}\n aria-selected={this.active ? 'true' : 'false'}\n tabindex={this.disabled || !this.active ? '-1' : '0'}\n >\n <slot />\n {this.closable && (\n <six-icon-button\n name=\"close\"\n size=\"xSmall\"\n exportparts=\"base:close-button\"\n class=\"tab__close-button\"\n onClick={this.handleCloseClick}\n tabIndex={-1}\n aria-hidden=\"true\"\n />\n )}\n </div>\n <div\n class={{\n tab__indicator: true,\n 'tab__indicator--active': this.active,\n\n // Placements\n 'tab__indicator--top': placement === 'top',\n 'tab__indicator--bottom': placement === 'bottom',\n 'tab__indicator--left': placement === 'left',\n 'tab__indicator--right': placement === 'right',\n }}\n ></div>\n </Host>\n );\n }\n}\n"]}
@@ -6,11 +6,7 @@
6
6
  box-sizing: inherit;
7
7
  }
8
8
 
9
- /**
10
- * @prop --tabs-border-color: The color of the border that separates tabs.
11
- */
12
9
  :host {
13
- --tabs-border-color: var(--six-tab-border-color);
14
10
  display: block;
15
11
  }
16
12
 
@@ -23,13 +19,6 @@
23
19
  display: flex;
24
20
  position: relative;
25
21
  }
26
- .tab-group .tab-group__active-tab-indicator {
27
- position: absolute;
28
- transition: var(--six-transition-fast) transform ease, var(--six-transition-fast) width ease;
29
- }
30
- .tab-group:not(.focus-visible) ::slotted(six-tab) {
31
- --focus-ring: none;
32
- }
33
22
 
34
23
  .tab-group--has-scroll-controls .tab-group__nav-container {
35
24
  position: relative;
@@ -74,11 +63,6 @@
74
63
  flex: 1 1 auto;
75
64
  position: relative;
76
65
  flex-direction: row;
77
- border-bottom: solid var(--six-tab-border-width) var(--tabs-border-color);
78
- }
79
- .tab-group--top .tab-group__active-tab-indicator {
80
- bottom: -2px;
81
- border-bottom: solid var(--six-tab-border-width-active) var(--six-tab-border-color-active);
82
66
  }
83
67
  .tab-group--top .tab-group__body {
84
68
  order: 2;
@@ -104,11 +88,6 @@
104
88
  flex: 1 1 auto;
105
89
  position: relative;
106
90
  flex-direction: row;
107
- border-top: solid var(--six-tab-border-width) var(--tabs-border-color);
108
- }
109
- .tab-group--bottom .tab-group__active-tab-indicator {
110
- top: -2px;
111
- border-top: solid var(--six-tab-border-width-active) var(--six-tab-border-color-active);
112
91
  }
113
92
  .tab-group--bottom .tab-group__body {
114
93
  order: 1;
@@ -123,11 +102,6 @@
123
102
  .tab-group--left .tab-group__tabs {
124
103
  flex: 0 0 auto;
125
104
  flex-direction: column;
126
- border-right: solid var(--six-tab-border-width) var(--tabs-border-color);
127
- }
128
- .tab-group--left .tab-group__active-tab-indicator {
129
- right: -2px;
130
- border-right: solid var(--six-tab-border-width-active) var(--six-tab-border-color-active);
131
105
  }
132
106
  .tab-group--left .tab-group__body {
133
107
  flex: 1 1 auto;
@@ -143,11 +117,6 @@
143
117
  .tab-group--right .tab-group__tabs {
144
118
  flex: 0 0 auto;
145
119
  flex-direction: column;
146
- border-left: solid var(--six-tab-border-width) var(--tabs-border-color);
147
- }
148
- .tab-group--right .tab-group__active-tab-indicator {
149
- left: -2px;
150
- border-left: solid var(--six-tab-border-width-active) var(--six-tab-border-color-active);
151
120
  }
152
121
  .tab-group--right .tab-group__body {
153
122
  flex: 1 1 auto;