@six-group/ui-library 0.0.0-insider.e148618 → 0.0.0-insider.e5360cd

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 (337) hide show
  1. package/README.md +9 -0
  2. package/dist/cjs/{form-control-d369af14.js → form-control-9769b310.js} +10 -7
  3. package/dist/cjs/form-control-9769b310.js.map +1 -0
  4. package/dist/cjs/index-900437fc.js +214 -1
  5. package/dist/cjs/index-900437fc.js.map +1 -1
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/{scroll-03678de1.js → scroll-2c4200dc.js} +1 -2
  8. package/dist/cjs/scroll-2c4200dc.js.map +1 -0
  9. package/dist/cjs/six-button.cjs.entry.js +3 -3
  10. package/dist/cjs/six-button.cjs.entry.js.map +1 -1
  11. package/dist/cjs/six-checkbox.cjs.entry.js +6 -3
  12. package/dist/cjs/six-checkbox.cjs.entry.js.map +1 -1
  13. package/dist/cjs/six-datepicker.cjs.entry.js +2 -7
  14. package/dist/cjs/six-datepicker.cjs.entry.js.map +1 -1
  15. package/dist/cjs/six-details.cjs.entry.js +1 -1
  16. package/dist/cjs/six-details.cjs.entry.js.map +1 -1
  17. package/dist/cjs/six-dialog.cjs.entry.js +1 -1
  18. package/dist/cjs/six-drawer.cjs.entry.js +1 -1
  19. package/dist/cjs/six-dropdown_2.cjs.entry.js +1 -1
  20. package/dist/cjs/six-dropdown_2.cjs.entry.js.map +1 -1
  21. package/dist/cjs/six-error.cjs.entry.js +21 -0
  22. package/dist/cjs/six-error.cjs.entry.js.map +1 -0
  23. package/dist/cjs/six-group-label.cjs.entry.js +2 -2
  24. package/dist/cjs/six-group-label.cjs.entry.js.map +1 -1
  25. package/dist/cjs/six-icon-button.cjs.entry.js +1 -1
  26. package/dist/cjs/six-icon-button.cjs.entry.js.map +1 -1
  27. package/dist/cjs/six-input.cjs.entry.js +6 -3
  28. package/dist/cjs/six-input.cjs.entry.js.map +1 -1
  29. package/dist/cjs/six-range.cjs.entry.js +6 -3
  30. package/dist/cjs/six-range.cjs.entry.js.map +1 -1
  31. package/dist/cjs/six-select.cjs.entry.js +8 -5
  32. package/dist/cjs/six-select.cjs.entry.js.map +1 -1
  33. package/dist/cjs/six-sidebar-item-group.cjs.entry.js +2 -1
  34. package/dist/cjs/six-sidebar-item-group.cjs.entry.js.map +1 -1
  35. package/dist/cjs/six-sidebar.cjs.entry.js +1 -1
  36. package/dist/cjs/six-switch.cjs.entry.js +22 -4
  37. package/dist/cjs/six-switch.cjs.entry.js.map +1 -1
  38. package/dist/cjs/six-tab-group.cjs.entry.js +45 -50
  39. package/dist/cjs/six-tab-group.cjs.entry.js.map +1 -1
  40. package/dist/cjs/six-tab.cjs.entry.js +19 -3
  41. package/dist/cjs/six-tab.cjs.entry.js.map +1 -1
  42. package/dist/cjs/six-tag.cjs.entry.js +24 -2
  43. package/dist/cjs/six-tag.cjs.entry.js.map +1 -1
  44. package/dist/cjs/six-textarea.cjs.entry.js +6 -3
  45. package/dist/cjs/six-textarea.cjs.entry.js.map +1 -1
  46. package/dist/cjs/six-timepicker.cjs.entry.js +4 -9
  47. package/dist/cjs/six-timepicker.cjs.entry.js.map +1 -1
  48. package/dist/cjs/six-tooltip.cjs.entry.js +2 -2
  49. package/dist/cjs/six-tooltip.cjs.entry.js.map +1 -1
  50. package/dist/cjs/ui-library.cjs.js +2 -2
  51. package/dist/cjs/ui-library.cjs.js.map +1 -1
  52. package/dist/collection/collection-manifest.json +2 -1
  53. package/dist/collection/components/six-button/six-button.css +5 -30
  54. package/dist/collection/components/six-button/six-button.js +2 -2
  55. package/dist/collection/components/six-button/six-button.js.map +1 -1
  56. package/dist/collection/components/six-checkbox/six-checkbox.css +1 -1
  57. package/dist/collection/components/six-checkbox/six-checkbox.js +25 -4
  58. package/dist/collection/components/six-checkbox/six-checkbox.js.map +1 -1
  59. package/dist/collection/components/six-checkbox/test/six-checkbox.spec.js +6 -2
  60. package/dist/collection/components/six-checkbox/test/six-checkbox.spec.js.map +1 -1
  61. package/dist/collection/components/six-datepicker/six-datepicker.js +22 -11
  62. package/dist/collection/components/six-datepicker/six-datepicker.js.map +1 -1
  63. package/dist/collection/components/six-datepicker/test/six-datepicker.spec.js +1 -1
  64. package/dist/collection/components/six-datepicker/test/six-datepicker.spec.js.map +1 -1
  65. package/dist/collection/components/six-details/six-details.css +3 -1
  66. package/dist/collection/components/six-dropdown/six-dropdown.css +2 -1
  67. package/dist/collection/components/six-error/six-error.css +5 -0
  68. package/dist/collection/components/six-error/six-error.js +25 -0
  69. package/dist/collection/components/six-error/six-error.js.map +1 -0
  70. package/dist/collection/components/six-group-label/six-group-label.css +1 -1
  71. package/dist/collection/components/six-group-label/test/six-group-label.spec.js +3 -1
  72. package/dist/collection/components/six-group-label/test/six-group-label.spec.js.map +1 -1
  73. package/dist/collection/components/six-icon-button/six-icon-button.css +4 -4
  74. package/dist/collection/components/six-input/six-input.css +2 -2
  75. package/dist/collection/components/six-input/six-input.js +27 -4
  76. package/dist/collection/components/six-input/six-input.js.map +1 -1
  77. package/dist/collection/components/six-input/test/six-input.spec.js +3 -1
  78. package/dist/collection/components/six-input/test/six-input.spec.js.map +1 -1
  79. package/dist/collection/components/six-range/six-range.css +1 -1
  80. package/dist/collection/components/six-range/six-range.js +24 -3
  81. package/dist/collection/components/six-range/six-range.js.map +1 -1
  82. package/dist/collection/components/six-range/test/six-range.spec.js +3 -1
  83. package/dist/collection/components/six-range/test/six-range.spec.js.map +1 -1
  84. package/dist/collection/components/six-select/six-select.css +7 -10
  85. package/dist/collection/components/six-select/six-select.js +26 -5
  86. package/dist/collection/components/six-select/six-select.js.map +1 -1
  87. package/dist/collection/components/six-select/test/six-select.spec.js +8 -4
  88. package/dist/collection/components/six-select/test/six-select.spec.js.map +1 -1
  89. package/dist/collection/components/six-sidebar-item-group/six-sidebar-item-group.css +4 -0
  90. package/dist/collection/components/six-sidebar-item-group/six-sidebar-item-group.js +1 -0
  91. package/dist/collection/components/six-sidebar-item-group/six-sidebar-item-group.js.map +1 -1
  92. package/dist/collection/components/six-sidebar-item-group/test/six-sidebar-item-group.spec.js +2 -2
  93. package/dist/collection/components/six-sidebar-item-group/test/six-sidebar-item-group.spec.js.map +1 -1
  94. package/dist/collection/components/six-switch/six-switch.css +1 -1
  95. package/dist/collection/components/six-switch/six-switch.js +45 -4
  96. package/dist/collection/components/six-switch/six-switch.js.map +1 -1
  97. package/dist/collection/components/six-switch/test/six-switch.spec.js +6 -2
  98. package/dist/collection/components/six-switch/test/six-switch.spec.js.map +1 -1
  99. package/dist/collection/components/six-tab/six-tab.css +54 -5
  100. package/dist/collection/components/six-tab/six-tab.js +18 -2
  101. package/dist/collection/components/six-tab/six-tab.js.map +1 -1
  102. package/dist/collection/components/six-tab-group/six-tab-group.css +0 -31
  103. package/dist/collection/components/six-tab-group/six-tab-group.js +10 -51
  104. package/dist/collection/components/six-tab-group/six-tab-group.js.map +1 -1
  105. package/dist/collection/components/six-tag/six-tag.css +6 -0
  106. package/dist/collection/components/six-tag/six-tag.js +23 -1
  107. package/dist/collection/components/six-tag/six-tag.js.map +1 -1
  108. package/dist/collection/components/six-tag/test/six-tag.spec.js +12 -0
  109. package/dist/collection/components/six-tag/test/six-tag.spec.js.map +1 -1
  110. package/dist/collection/components/six-textarea/six-textarea.css +1 -1
  111. package/dist/collection/components/six-textarea/six-textarea.js +25 -4
  112. package/dist/collection/components/six-textarea/six-textarea.js.map +1 -1
  113. package/dist/collection/components/six-textarea/test/six-textarea.spec.js +3 -1
  114. package/dist/collection/components/six-textarea/test/six-textarea.spec.js.map +1 -1
  115. package/dist/collection/components/six-timepicker/six-timepicker.js +24 -12
  116. package/dist/collection/components/six-timepicker/six-timepicker.js.map +1 -1
  117. package/dist/collection/components/six-timepicker/test/six-timepicker.spec.js +15 -15
  118. package/dist/collection/components/six-timepicker/test/six-timepicker.spec.js.map +1 -1
  119. package/dist/collection/components/six-tooltip/six-tooltip.css +1 -1
  120. package/dist/collection/components/six-tooltip/six-tooltip.js +1 -1
  121. package/dist/collection/components/six-tooltip/six-tooltip.js.map +1 -1
  122. package/dist/collection/functional-components/form-control/form-control.js +8 -6
  123. package/dist/collection/functional-components/form-control/form-control.js.map +1 -1
  124. package/dist/collection/utils/animation.js +34 -0
  125. package/dist/collection/utils/animation.js.map +1 -0
  126. package/dist/components/form-control.js +9 -6
  127. package/dist/components/form-control.js.map +1 -1
  128. package/dist/components/index.js +2 -0
  129. package/dist/components/index.js.map +1 -1
  130. package/dist/components/scroll.js +1 -1
  131. package/dist/components/six-button.js +3 -3
  132. package/dist/components/six-button.js.map +1 -1
  133. package/dist/components/six-checkbox.js +14 -3
  134. package/dist/components/six-checkbox.js.map +1 -1
  135. package/dist/components/six-datepicker.js +10 -8
  136. package/dist/components/six-datepicker.js.map +1 -1
  137. package/dist/components/six-details2.js +1 -1
  138. package/dist/components/six-details2.js.map +1 -1
  139. package/dist/components/six-dropdown2.js +8 -2
  140. package/dist/components/six-dropdown2.js.map +1 -1
  141. package/dist/components/six-error.d.ts +11 -0
  142. package/dist/components/six-error.js +8 -0
  143. package/dist/components/six-error.js.map +1 -0
  144. package/dist/components/six-error2.js +32 -0
  145. package/dist/components/six-error2.js.map +1 -0
  146. package/dist/components/six-group-label.js +8 -2
  147. package/dist/components/six-group-label.js.map +1 -1
  148. package/dist/components/six-header.js +8 -2
  149. package/dist/components/six-header.js.map +1 -1
  150. package/dist/components/six-icon-button2.js +1 -1
  151. package/dist/components/six-icon-button2.js.map +1 -1
  152. package/dist/components/six-input2.js +14 -3
  153. package/dist/components/six-input2.js.map +1 -1
  154. package/dist/components/six-range.js +14 -3
  155. package/dist/components/six-range.js.map +1 -1
  156. package/dist/components/six-search-field.js +7 -1
  157. package/dist/components/six-search-field.js.map +1 -1
  158. package/dist/components/six-select.js +35 -18
  159. package/dist/components/six-select.js.map +1 -1
  160. package/dist/components/six-sidebar-item-group.js +2 -1
  161. package/dist/components/six-sidebar-item-group.js.map +1 -1
  162. package/dist/components/six-switch.js +30 -4
  163. package/dist/components/six-switch.js.map +1 -1
  164. package/dist/components/six-tab-group.js +45 -50
  165. package/dist/components/six-tab-group.js.map +1 -1
  166. package/dist/components/six-tab.js +19 -3
  167. package/dist/components/six-tab.js.map +1 -1
  168. package/dist/components/six-tag2.js +34 -6
  169. package/dist/components/six-tag2.js.map +1 -1
  170. package/dist/components/six-textarea.js +14 -3
  171. package/dist/components/six-textarea.js.map +1 -1
  172. package/dist/components/six-timepicker2.js +12 -10
  173. package/dist/components/six-timepicker2.js.map +1 -1
  174. package/dist/components/six-tooltip2.js +2 -2
  175. package/dist/components/six-tooltip2.js.map +1 -1
  176. package/dist/components.json +426 -56
  177. package/dist/esm/{form-control-32cb533f.js → form-control-b0febe88.js} +10 -7
  178. package/dist/esm/form-control-b0febe88.js.map +1 -0
  179. package/dist/esm/index-8a74f992.js +214 -1
  180. package/dist/esm/index-8a74f992.js.map +1 -1
  181. package/dist/esm/loader.js +1 -1
  182. package/dist/esm/{scroll-3fb087a2.js → scroll-774762d6.js} +2 -2
  183. package/dist/esm/{scroll-3fb087a2.js.map → scroll-774762d6.js.map} +1 -1
  184. package/dist/esm/six-button.entry.js +3 -3
  185. package/dist/esm/six-button.entry.js.map +1 -1
  186. package/dist/esm/six-checkbox.entry.js +6 -3
  187. package/dist/esm/six-checkbox.entry.js.map +1 -1
  188. package/dist/esm/six-datepicker.entry.js +2 -7
  189. package/dist/esm/six-datepicker.entry.js.map +1 -1
  190. package/dist/esm/six-details.entry.js +1 -1
  191. package/dist/esm/six-details.entry.js.map +1 -1
  192. package/dist/esm/six-dialog.entry.js +1 -1
  193. package/dist/esm/six-drawer.entry.js +1 -1
  194. package/dist/esm/six-dropdown_2.entry.js +1 -1
  195. package/dist/esm/six-dropdown_2.entry.js.map +1 -1
  196. package/dist/esm/six-error.entry.js +17 -0
  197. package/dist/esm/six-error.entry.js.map +1 -0
  198. package/dist/esm/six-group-label.entry.js +2 -2
  199. package/dist/esm/six-group-label.entry.js.map +1 -1
  200. package/dist/esm/six-icon-button.entry.js +1 -1
  201. package/dist/esm/six-icon-button.entry.js.map +1 -1
  202. package/dist/esm/six-input.entry.js +6 -3
  203. package/dist/esm/six-input.entry.js.map +1 -1
  204. package/dist/esm/six-range.entry.js +6 -3
  205. package/dist/esm/six-range.entry.js.map +1 -1
  206. package/dist/esm/six-select.entry.js +8 -5
  207. package/dist/esm/six-select.entry.js.map +1 -1
  208. package/dist/esm/six-sidebar-item-group.entry.js +2 -1
  209. package/dist/esm/six-sidebar-item-group.entry.js.map +1 -1
  210. package/dist/esm/six-sidebar.entry.js +1 -1
  211. package/dist/esm/six-switch.entry.js +22 -4
  212. package/dist/esm/six-switch.entry.js.map +1 -1
  213. package/dist/esm/six-tab-group.entry.js +45 -50
  214. package/dist/esm/six-tab-group.entry.js.map +1 -1
  215. package/dist/esm/six-tab.entry.js +19 -3
  216. package/dist/esm/six-tab.entry.js.map +1 -1
  217. package/dist/esm/six-tag.entry.js +24 -2
  218. package/dist/esm/six-tag.entry.js.map +1 -1
  219. package/dist/esm/six-textarea.entry.js +6 -3
  220. package/dist/esm/six-textarea.entry.js.map +1 -1
  221. package/dist/esm/six-timepicker.entry.js +4 -9
  222. package/dist/esm/six-timepicker.entry.js.map +1 -1
  223. package/dist/esm/six-tooltip.entry.js +2 -2
  224. package/dist/esm/six-tooltip.entry.js.map +1 -1
  225. package/dist/esm/ui-library.js +2 -2
  226. package/dist/esm/ui-library.js.map +1 -1
  227. package/dist/types/components/six-checkbox/six-checkbox.d.ts +4 -1
  228. package/dist/types/components/six-datepicker/six-datepicker.d.ts +4 -2
  229. package/dist/types/components/six-error/six-error.d.ts +9 -0
  230. package/dist/types/components/six-input/six-input.d.ts +7 -2
  231. package/dist/types/components/six-range/six-range.d.ts +4 -1
  232. package/dist/types/components/six-select/six-select.d.ts +4 -1
  233. package/dist/types/components/six-switch/six-switch.d.ts +8 -1
  234. package/dist/types/components/six-tab-group/six-tab-group.d.ts +0 -3
  235. package/dist/types/components/six-tag/six-tag.d.ts +8 -0
  236. package/dist/types/components/six-textarea/six-textarea.d.ts +4 -1
  237. package/dist/types/components/six-timepicker/six-timepicker.d.ts +5 -2
  238. package/dist/types/components.d.ts +109 -16
  239. package/dist/types/functional-components/form-control/form-control.d.ts +6 -2
  240. package/dist/types/utils/animation.d.ts +12 -0
  241. package/dist/ui-library/{p-1f18768a.js → p-052aa8d3.js} +2 -2
  242. package/dist/ui-library/{p-ed381ad9.entry.js → p-14c1ec31.entry.js} +2 -2
  243. package/dist/ui-library/p-14c1ec31.entry.js.map +1 -0
  244. package/dist/ui-library/p-22c9b8c3.entry.js +2 -0
  245. package/dist/ui-library/p-22c9b8c3.entry.js.map +1 -0
  246. package/dist/ui-library/p-25bb1752.entry.js +2 -0
  247. package/dist/ui-library/p-25bb1752.entry.js.map +1 -0
  248. package/dist/ui-library/p-3f1a5ecb.entry.js +2 -0
  249. package/dist/ui-library/p-3f1a5ecb.entry.js.map +1 -0
  250. package/dist/ui-library/p-4435ff73.entry.js +2 -0
  251. package/dist/ui-library/p-4435ff73.entry.js.map +1 -0
  252. package/dist/ui-library/p-538f3c50.entry.js +2 -0
  253. package/dist/ui-library/p-538f3c50.entry.js.map +1 -0
  254. package/dist/ui-library/{p-330a4988.entry.js → p-5800663b.entry.js} +2 -2
  255. package/dist/ui-library/p-5ba3a0fe.entry.js +2 -0
  256. package/dist/ui-library/p-5ba3a0fe.entry.js.map +1 -0
  257. package/dist/ui-library/p-6153045b.js.map +1 -1
  258. package/dist/ui-library/p-658d9f79.entry.js +2 -0
  259. package/dist/ui-library/p-658d9f79.entry.js.map +1 -0
  260. package/dist/ui-library/p-66fe54b3.entry.js +2 -0
  261. package/dist/ui-library/p-66fe54b3.entry.js.map +1 -0
  262. package/dist/ui-library/{p-99e24daf.entry.js → p-a2035543.entry.js} +2 -2
  263. package/dist/ui-library/p-a457fee8.entry.js +2 -0
  264. package/dist/ui-library/p-a457fee8.entry.js.map +1 -0
  265. package/dist/ui-library/p-ab91c2a9.entry.js +2 -0
  266. package/dist/ui-library/p-ab91c2a9.entry.js.map +1 -0
  267. package/dist/ui-library/p-b57afbe4.entry.js +2 -0
  268. package/dist/ui-library/p-b57afbe4.entry.js.map +1 -0
  269. package/dist/ui-library/p-b6f47c9d.entry.js +2 -0
  270. package/dist/ui-library/p-b6f47c9d.entry.js.map +1 -0
  271. package/dist/ui-library/p-cba69e9d.entry.js +2 -0
  272. package/dist/ui-library/p-cba69e9d.entry.js.map +1 -0
  273. package/dist/ui-library/{p-19ed7a4c.entry.js → p-d1bda563.entry.js} +2 -2
  274. package/dist/ui-library/p-db34a6cc.entry.js +2 -0
  275. package/dist/ui-library/p-db34a6cc.entry.js.map +1 -0
  276. package/dist/ui-library/p-db936ad7.entry.js +2 -0
  277. package/dist/ui-library/{p-d367f4f9.entry.js.map → p-db936ad7.entry.js.map} +1 -1
  278. package/dist/ui-library/p-dc4f41d8.entry.js +2 -0
  279. package/dist/ui-library/p-dc4f41d8.entry.js.map +1 -0
  280. package/dist/ui-library/p-e5020f0d.js +2 -0
  281. package/dist/ui-library/p-e5020f0d.js.map +1 -0
  282. package/dist/ui-library/p-e775dcb4.entry.js +2 -0
  283. package/dist/ui-library/p-e775dcb4.entry.js.map +1 -0
  284. package/dist/ui-library/p-f1dc3a88.entry.js +2 -0
  285. package/dist/ui-library/p-f1dc3a88.entry.js.map +1 -0
  286. package/dist/ui-library/ui-library.css +2 -2
  287. package/dist/ui-library/ui-library.esm.js +1 -1
  288. package/dist/ui-library/ui-library.esm.js.map +1 -1
  289. package/package.json +6 -3
  290. package/dist/cjs/form-control-d369af14.js.map +0 -1
  291. package/dist/cjs/scroll-03678de1.js.map +0 -1
  292. package/dist/collection/components/six-tab/test/six-tab.spec.js +0 -20
  293. package/dist/collection/components/six-tab/test/six-tab.spec.js.map +0 -1
  294. package/dist/collection/components/six-tab-group/test/six-tab-group.spec.js +0 -45
  295. package/dist/collection/components/six-tab-group/test/six-tab-group.spec.js.map +0 -1
  296. package/dist/esm/form-control-32cb533f.js.map +0 -1
  297. package/dist/ui-library/p-1256cc0a.entry.js +0 -2
  298. package/dist/ui-library/p-1256cc0a.entry.js.map +0 -1
  299. package/dist/ui-library/p-1d0bee53.entry.js +0 -2
  300. package/dist/ui-library/p-1d0bee53.entry.js.map +0 -1
  301. package/dist/ui-library/p-21b3b321.entry.js +0 -2
  302. package/dist/ui-library/p-21b3b321.entry.js.map +0 -1
  303. package/dist/ui-library/p-2451cfdc.entry.js +0 -2
  304. package/dist/ui-library/p-2451cfdc.entry.js.map +0 -1
  305. package/dist/ui-library/p-29ac3d7d.entry.js +0 -2
  306. package/dist/ui-library/p-29ac3d7d.entry.js.map +0 -1
  307. package/dist/ui-library/p-314b2096.entry.js +0 -2
  308. package/dist/ui-library/p-314b2096.entry.js.map +0 -1
  309. package/dist/ui-library/p-3d9de119.entry.js +0 -2
  310. package/dist/ui-library/p-3d9de119.entry.js.map +0 -1
  311. package/dist/ui-library/p-4705a51e.entry.js +0 -2
  312. package/dist/ui-library/p-4705a51e.entry.js.map +0 -1
  313. package/dist/ui-library/p-4abed9df.entry.js +0 -2
  314. package/dist/ui-library/p-4abed9df.entry.js.map +0 -1
  315. package/dist/ui-library/p-5d6b7353.entry.js +0 -2
  316. package/dist/ui-library/p-5d6b7353.entry.js.map +0 -1
  317. package/dist/ui-library/p-6eb24bcb.entry.js +0 -2
  318. package/dist/ui-library/p-6eb24bcb.entry.js.map +0 -1
  319. package/dist/ui-library/p-72254eef.entry.js +0 -2
  320. package/dist/ui-library/p-72254eef.entry.js.map +0 -1
  321. package/dist/ui-library/p-83864cfe.entry.js +0 -2
  322. package/dist/ui-library/p-83864cfe.entry.js.map +0 -1
  323. package/dist/ui-library/p-bf87464b.entry.js +0 -2
  324. package/dist/ui-library/p-bf87464b.entry.js.map +0 -1
  325. package/dist/ui-library/p-d367f4f9.entry.js +0 -2
  326. package/dist/ui-library/p-d42c2025.js +0 -2
  327. package/dist/ui-library/p-d42c2025.js.map +0 -1
  328. package/dist/ui-library/p-ed381ad9.entry.js.map +0 -1
  329. package/dist/ui-library/p-ee8342e1.entry.js +0 -2
  330. package/dist/ui-library/p-ee8342e1.entry.js.map +0 -1
  331. package/dist/ui-library/p-ff90ffd1.entry.js +0 -2
  332. package/dist/ui-library/p-ff90ffd1.entry.js.map +0 -1
  333. package/readme.md +0 -156
  334. /package/dist/ui-library/{p-1f18768a.js.map → p-052aa8d3.js.map} +0 -0
  335. /package/dist/ui-library/{p-330a4988.entry.js.map → p-5800663b.entry.js.map} +0 -0
  336. /package/dist/ui-library/{p-99e24daf.entry.js.map → p-a2035543.entry.js.map} +0 -0
  337. /package/dist/ui-library/{p-19ed7a4c.entry.js.map → p-d1bda563.entry.js.map} +0 -0
@@ -20,7 +20,7 @@ describe('six-select', () => {
20
20
  <div class="form-control__input">
21
21
  <six-dropdown class="select select--empty select--medium select--placeholder-visible" closeonselect="" filterdebounce="300" part="base">
22
22
  <div aria-describedby="select-help-text-1" aria-expanded="false" aria-haspopup="true" aria-labelledby="select-label-1" class="select__box" id="select-1" role="combobox" slot="trigger" tabindex="0">
23
- <span class="select__label"></span>
23
+ <span class="select__label select__label--single"></span>
24
24
  <span class="select__icon" part="icon">
25
25
  <six-icon size="medium">expand_more</six-icon>
26
26
  </span>
@@ -31,7 +31,9 @@ describe('six-select', () => {
31
31
  </six-menu>
32
32
  </six-dropdown>
33
33
  </div>
34
- <div aria-hidden="true" class="form-control__error-text" id="select-error-text-1" part="error-text"></div>
34
+ <div aria-hidden="true" class="form-control__error-text" id="select-error-text-1" part="error-text">
35
+ <slot name="error-text"></slot>
36
+ </div>
35
37
  <div aria-hidden="true" class="form-control__help-text" id="select-help-text-1" part="help-text">
36
38
  <slot name="help-text"></slot>
37
39
  </div>
@@ -61,7 +63,7 @@ describe('six-select', () => {
61
63
  <div class="form-control__input">
62
64
  <six-dropdown class="select select--empty select--medium select--placeholder-visible" closeonselect="" disablehideonenterandspace="" filterdebounce="300" part="base">
63
65
  <div aria-describedby="select-help-text-2" aria-expanded="false" aria-haspopup="true" aria-labelledby="select-label-2" class="select__box select__box--autocomplete" id="select-2" role="combobox" slot="trigger" tabindex="0">
64
- <span class="select__label"></span>
66
+ <span class="select__label select__label--single"></span>
65
67
  <six-input aria-hidden="true" class="select__input" placeholder="" size="medium" tabindex="-1"></six-input>
66
68
  </div>
67
69
  <six-menu class="select__menu select__menu--hidden" part="menu" remove-box-shadow>
@@ -69,7 +71,9 @@ describe('six-select', () => {
69
71
  </six-menu>
70
72
  </six-dropdown>
71
73
  </div>
72
- <div aria-hidden="true" class="form-control__error-text" id="select-error-text-2" part="error-text"></div>
74
+ <div aria-hidden="true" class="form-control__error-text" id="select-error-text-2" part="error-text">
75
+ <slot name="error-text"></slot>
76
+ </div>
73
77
  <div aria-hidden="true" class="form-control__help-text" id="select-help-text-2" part="help-text">
74
78
  <slot name="help-text"></slot>
75
79
  </div>
@@ -1 +1 @@
1
- {"version":3,"file":"six-select.spec.js","sourceRoot":"","sources":["../../../../src/components/six-select/test/six-select.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,2BAA2B,EAAE,KAAK,IAAI,EAAE;IACzC,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAElC,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,SAAS,CAAC;MACvB,IAAI,EAAE;;;sBAGU;KACjB,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+B7B,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;EAEH,EAAE,CAAC,wCAAwC,EAAE,KAAK,IAAI,EAAE;IACtD,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAElC,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,SAAS,CAAC;MACvB,IAAI,EAAE;;sBAEU;KACjB,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 { SixSelect } from '../six-select';\n\ndescribe('six-select', () => {\n it('renders normal six-select', async () => {\n global.ResizeObserver = jest.fn();\n\n const page = await newSpecPage({\n components: [SixSelect],\n html: `\n <six-select>\n <six-menu-item value=\"option-1\">Option 1</six-menu-item>\n </six-select>`,\n });\n expect(page.root).toEqualHtml(`\n <six-select>\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=\"select-1\" id=\"select-label-1\" part=\"label\">\n <slot name=\"label\"></slot>\n </label>\n <div class=\"form-control__input\">\n <six-dropdown class=\"select select--empty select--medium select--placeholder-visible\" closeonselect=\"\" filterdebounce=\"300\" part=\"base\">\n <div aria-describedby=\"select-help-text-1\" aria-expanded=\"false\" aria-haspopup=\"true\" aria-labelledby=\"select-label-1\" class=\"select__box\" id=\"select-1\" role=\"combobox\" slot=\"trigger\" tabindex=\"0\">\n <span class=\"select__label\"></span>\n <span class=\"select__icon\" part=\"icon\">\n <six-icon size=\"medium\">expand_more</six-icon>\n </span>\n <six-input aria-hidden=\"true\" class=\"select__hidden-select select__input\" placeholder=\"\" size=\"medium\" tabindex=\"-1\"></six-input>\n </div>\n <six-menu class=\"select__menu\" part=\"menu\" remove-box-shadow>\n <slot></slot>\n </six-menu>\n </six-dropdown>\n </div>\n <div aria-hidden=\"true\" class=\"form-control__error-text\" id=\"select-error-text-1\" part=\"error-text\"></div>\n <div aria-hidden=\"true\" class=\"form-control__help-text\" id=\"select-help-text-1\" part=\"help-text\">\n <slot name=\"help-text\"></slot>\n </div>\n </div>\n </mock:shadow-root>\n <six-menu-item value=\"option-1\">\n Option 1\n </six-menu-item>\n </six-select>\n `);\n });\n\n it('renders normal autocomplete six-select', async () => {\n global.ResizeObserver = jest.fn();\n\n const page = await newSpecPage({\n components: [SixSelect],\n html: `\n <six-select autocomplete>\n </six-select>`,\n });\n expect(page.root).toEqualHtml(`\n <six-select autocomplete=\"\">\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=\"select-2\" id=\"select-label-2\" part=\"label\">\n <slot name=\"label\"></slot>\n </label>\n <div class=\"form-control__input\">\n <six-dropdown class=\"select select--empty select--medium select--placeholder-visible\" closeonselect=\"\" disablehideonenterandspace=\"\" filterdebounce=\"300\" part=\"base\">\n <div aria-describedby=\"select-help-text-2\" aria-expanded=\"false\" aria-haspopup=\"true\" aria-labelledby=\"select-label-2\" class=\"select__box select__box--autocomplete\" id=\"select-2\" role=\"combobox\" slot=\"trigger\" tabindex=\"0\">\n <span class=\"select__label\"></span>\n <six-input aria-hidden=\"true\" class=\"select__input\" placeholder=\"\" size=\"medium\" tabindex=\"-1\"></six-input>\n </div>\n <six-menu class=\"select__menu select__menu--hidden\" part=\"menu\" remove-box-shadow>\n <slot></slot>\n </six-menu>\n </six-dropdown>\n </div>\n <div aria-hidden=\"true\" class=\"form-control__error-text\" id=\"select-error-text-2\" part=\"error-text\"></div>\n <div aria-hidden=\"true\" class=\"form-control__help-text\" id=\"select-help-text-2\" part=\"help-text\">\n <slot name=\"help-text\"></slot>\n </div>\n </div>\n </mock:shadow-root>\n </six-select>\n `);\n });\n});\n"]}
1
+ {"version":3,"file":"six-select.spec.js","sourceRoot":"","sources":["../../../../src/components/six-select/test/six-select.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,2BAA2B,EAAE,KAAK,IAAI,EAAE;IACzC,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAElC,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,SAAS,CAAC;MACvB,IAAI,EAAE;;;sBAGU;KACjB,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiC7B,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;EAEH,EAAE,CAAC,wCAAwC,EAAE,KAAK,IAAI,EAAE;IACtD,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAElC,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,SAAS,CAAC;MACvB,IAAI,EAAE;;sBAEU;KACjB,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 { SixSelect } from '../six-select';\n\ndescribe('six-select', () => {\n it('renders normal six-select', async () => {\n global.ResizeObserver = jest.fn();\n\n const page = await newSpecPage({\n components: [SixSelect],\n html: `\n <six-select>\n <six-menu-item value=\"option-1\">Option 1</six-menu-item>\n </six-select>`,\n });\n expect(page.root).toEqualHtml(`\n <six-select>\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=\"select-1\" id=\"select-label-1\" part=\"label\">\n <slot name=\"label\"></slot>\n </label>\n <div class=\"form-control__input\">\n <six-dropdown class=\"select select--empty select--medium select--placeholder-visible\" closeonselect=\"\" filterdebounce=\"300\" part=\"base\">\n <div aria-describedby=\"select-help-text-1\" aria-expanded=\"false\" aria-haspopup=\"true\" aria-labelledby=\"select-label-1\" class=\"select__box\" id=\"select-1\" role=\"combobox\" slot=\"trigger\" tabindex=\"0\">\n <span class=\"select__label select__label--single\"></span>\n <span class=\"select__icon\" part=\"icon\">\n <six-icon size=\"medium\">expand_more</six-icon>\n </span>\n <six-input aria-hidden=\"true\" class=\"select__hidden-select select__input\" placeholder=\"\" size=\"medium\" tabindex=\"-1\"></six-input>\n </div>\n <six-menu class=\"select__menu\" part=\"menu\" remove-box-shadow>\n <slot></slot>\n </six-menu>\n </six-dropdown>\n </div>\n <div aria-hidden=\"true\" class=\"form-control__error-text\" id=\"select-error-text-1\" part=\"error-text\">\n <slot name=\"error-text\"></slot>\n </div>\n <div aria-hidden=\"true\" class=\"form-control__help-text\" id=\"select-help-text-1\" part=\"help-text\">\n <slot name=\"help-text\"></slot>\n </div>\n </div>\n </mock:shadow-root>\n <six-menu-item value=\"option-1\">\n Option 1\n </six-menu-item>\n </six-select>\n `);\n });\n\n it('renders normal autocomplete six-select', async () => {\n global.ResizeObserver = jest.fn();\n\n const page = await newSpecPage({\n components: [SixSelect],\n html: `\n <six-select autocomplete>\n </six-select>`,\n });\n expect(page.root).toEqualHtml(`\n <six-select autocomplete=\"\">\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=\"select-2\" id=\"select-label-2\" part=\"label\">\n <slot name=\"label\"></slot>\n </label>\n <div class=\"form-control__input\">\n <six-dropdown class=\"select select--empty select--medium select--placeholder-visible\" closeonselect=\"\" disablehideonenterandspace=\"\" filterdebounce=\"300\" part=\"base\">\n <div aria-describedby=\"select-help-text-2\" aria-expanded=\"false\" aria-haspopup=\"true\" aria-labelledby=\"select-label-2\" class=\"select__box select__box--autocomplete\" id=\"select-2\" role=\"combobox\" slot=\"trigger\" tabindex=\"0\">\n <span class=\"select__label select__label--single\"></span>\n <six-input aria-hidden=\"true\" class=\"select__input\" placeholder=\"\" size=\"medium\" tabindex=\"-1\"></six-input>\n </div>\n <six-menu class=\"select__menu select__menu--hidden\" part=\"menu\" remove-box-shadow>\n <slot></slot>\n </six-menu>\n </six-dropdown>\n </div>\n <div aria-hidden=\"true\" class=\"form-control__error-text\" id=\"select-error-text-2\" part=\"error-text\">\n <slot name=\"error-text\"></slot>\n </div>\n <div aria-hidden=\"true\" class=\"form-control__help-text\" id=\"select-help-text-2\" part=\"help-text\">\n <slot name=\"help-text\"></slot>\n </div>\n </div>\n </mock:shadow-root>\n </six-select>\n `);\n });\n});\n"]}
@@ -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
  }
@@ -43,6 +43,7 @@ export class SixSidebarItemGroup {
43
43
  }
44
44
  render() {
45
45
  return (h("six-details", { class: {
46
+ 'six-sidebar-item-group': true,
46
47
  'six-sidebar-item-group--childless': !this.hasItems,
47
48
  'six-sidebar-item-group--subgroup': this.isSubgroup(),
48
49
  }, 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)));
@@ -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,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AAI,CAAC,QAAQ;QACnD,kCAAkC,EAAE,IAAI,CAAC,UAAU,EAAE;OACtD,EACD,MAAM,EAAE,IAAI,EACZ,IAAI,EAAE,IAAI,CAAC,IAAI,kBACD,IAAI,CAAC,WAAW,EAC9B,UAAU,EAAE,IAAI,CAAC,QAAQ;MAEzB,WAAK,IAAI,EAAC,SAAS;QACjB,WAAK,KAAK,EAAC,6BAA6B;UACrC,IAAI,CAAC,IAAI,IAAI,gBAAU,KAAK,EAAC,kCAAkC,IAAE,IAAI,CAAC,IAAI,CAAY;UACtF,IAAI,CAAC,IAAI,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;;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,GAAG,EAAE;;UACjB,MAAM,IAAI,GAAG,MAAA,IAAI,CAAC,IAAI,C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AAW,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': 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}\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 {
@@ -56,7 +57,6 @@
56
57
 
57
58
  .form-control--has-error-text .form-control__error-text {
58
59
  display: block;
59
- color: var(--six-color-danger-800);
60
60
  margin-top: var(--six-spacing-xxx-small);
61
61
  }
62
62
  .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,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEvG,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,WAAW,MAAM,uDAAuD,CAAC;AAEhF,IAAI,EAAE,GAAG,CAAC,CAAC;AAEX;;;;;;;;;;;;GAYG;AAOH,MAAM,OAAO,SAAS;;IACZ,aAAQ,GAAG,UAAU,EAAE,EAAE,EAAE,CAAC;IAC5B,YAAO,GAAG,gBAAgB,EAAE,EAAE,CAAC;IAC/B,gBAAW,GAAG,oBAAoB,EAAE,EAAE,CAAC;IAGvC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D,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,6BAA6B,CAAC;AAC7D,OAAO,WAAW,MAAM,uDAAuD,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,IAAI,EAAE,GAAG,CAAC,CAAC;AAEX;;;;;;;;;;;;;GAaG;AAOH,MAAM,OAAO,SAAS;;IACZ,aAAQ,GAAG,UAAU,EAAE,EAAE,EAAE,CAAC;IAC5B,YAAO,GAAG,gBAAgB,EAAE,EAAE,CAAC;IAC/B,gBAAW,GAAG,oBAAoB,EAAE,EAAE,CAAC;IAGvC,mBAAc,GAAG,IAAI,cAAc,EAAE,CAAC;IAyEtC,qBAAgB,GAAG,GAAG,EAAE;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AE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,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';\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,g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;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,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,C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C,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"]}