@tmorrow/cre8-wc 1.1.2 → 1.1.3

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 (435) hide show
  1. package/cdn/cre8-wc.esm.js +1 -1
  2. package/cdn/cre8-wc.esm.js.map +1 -1
  3. package/cdn/cre8-wc.min.js +1 -1
  4. package/cdn/cre8-wc.min.js.map +1 -1
  5. package/lib/cdn-entry.js +129 -0
  6. package/lib/cdn-entry.js.map +1 -0
  7. package/lib/components/accordion/accordion.js +58 -40
  8. package/lib/components/accordion/accordion.js.map +1 -0
  9. package/lib/components/accordion/accordion.styles.js +4 -0
  10. package/lib/components/accordion/accordion.styles.js.map +1 -0
  11. package/lib/components/accordion-item/accordion-item.js +187 -98
  12. package/lib/components/accordion-item/accordion-item.js.map +1 -0
  13. package/lib/components/accordion-item/accordion-item.styles.js +4 -0
  14. package/lib/components/accordion-item/accordion-item.styles.js.map +1 -0
  15. package/lib/components/alert/alert.js +146 -107
  16. package/lib/components/alert/alert.js.map +1 -0
  17. package/lib/components/alert/alert.styles.js +4 -0
  18. package/lib/components/alert/alert.styles.js.map +1 -0
  19. package/lib/components/badge/badge.js +73 -50
  20. package/lib/components/badge/badge.js.map +1 -0
  21. package/lib/components/badge/badge.styles.js +4 -0
  22. package/lib/components/badge/badge.styles.js.map +1 -0
  23. package/lib/components/band/band.js +34 -31
  24. package/lib/components/band/band.js.map +1 -0
  25. package/lib/components/band/band.styles.js +4 -0
  26. package/lib/components/band/band.styles.js.map +1 -0
  27. package/lib/components/breadcrumbs/breadcrumbs.js +52 -28
  28. package/lib/components/breadcrumbs/breadcrumbs.js.map +1 -0
  29. package/lib/components/breadcrumbs/breadcrumbs.styles.js +4 -0
  30. package/lib/components/breadcrumbs/breadcrumbs.styles.js.map +1 -0
  31. package/lib/components/breadcrumbs-item/breadcrumbs-item.js +28 -27
  32. package/lib/components/breadcrumbs-item/breadcrumbs-item.js.map +1 -0
  33. package/lib/components/breadcrumbs-item/breadcrumbs-item.styles.js +4 -0
  34. package/lib/components/breadcrumbs-item/breadcrumbs-item.styles.js.map +1 -0
  35. package/lib/components/button/button.js +297 -1040
  36. package/lib/components/button/button.js.map +1 -0
  37. package/lib/components/button/button.styles.js +885 -0
  38. package/lib/components/button/button.styles.js.map +1 -0
  39. package/lib/components/button-group/button-group.js +30 -27
  40. package/lib/components/button-group/button-group.js.map +1 -0
  41. package/lib/components/button-group/button-group.styles.js +4 -0
  42. package/lib/components/button-group/button-group.styles.js.map +1 -0
  43. package/lib/components/card/card.js +57 -35
  44. package/lib/components/card/card.js.map +1 -0
  45. package/lib/components/card/card.styles.js +4 -0
  46. package/lib/components/card/card.styles.js.map +1 -0
  47. package/lib/components/chart/chart.js +528 -354
  48. package/lib/components/chart/chart.js.map +1 -0
  49. package/lib/components/chart/chart.styles.js +4 -0
  50. package/lib/components/chart/chart.styles.js.map +1 -0
  51. package/lib/components/checkbox-field/checkbox-field.js +66 -53
  52. package/lib/components/checkbox-field/checkbox-field.js.map +1 -0
  53. package/lib/components/checkbox-field/checkbox-field.styles.js +4 -0
  54. package/lib/components/checkbox-field/checkbox-field.styles.js.map +1 -0
  55. package/lib/components/checkbox-field-item/checkbox-field-item.js +252 -183
  56. package/lib/components/checkbox-field-item/checkbox-field-item.js.map +1 -0
  57. package/lib/components/checkbox-field-item/checkbox-field-item.styles.js +4 -0
  58. package/lib/components/checkbox-field-item/checkbox-field-item.styles.js.map +1 -0
  59. package/lib/components/contexts/form-internals-context.js +9 -0
  60. package/lib/components/contexts/form-internals-context.js.map +1 -0
  61. package/lib/components/cre8-element.js +57 -56
  62. package/lib/components/cre8-element.js.map +1 -0
  63. package/lib/components/cre8-form-element.js +212 -244
  64. package/lib/components/cre8-form-element.js.map +1 -0
  65. package/lib/components/danger-button/danger-button.js +274 -147
  66. package/lib/components/danger-button/danger-button.js.map +1 -0
  67. package/lib/components/danger-button/danger-button.styles.js +4 -0
  68. package/lib/components/danger-button/danger-button.styles.js.map +1 -0
  69. package/lib/components/date-picker/calendar/calendar.js +465 -0
  70. package/lib/components/date-picker/calendar/calendar.js.map +1 -0
  71. package/lib/components/date-picker/calendar/calendar.styles.js +4 -0
  72. package/lib/components/date-picker/calendar/calendar.styles.js.map +1 -0
  73. package/lib/components/date-picker/calendar-month-modal/calendar-month-modal.js +76 -0
  74. package/lib/components/date-picker/calendar-month-modal/calendar-month-modal.js.map +1 -0
  75. package/lib/components/date-picker/calendar-month-modal/calendar-month-modal.styles.js +4 -0
  76. package/lib/components/date-picker/calendar-month-modal/calendar-month-modal.styles.js.map +1 -0
  77. package/lib/components/date-picker/calendar-navigation/calendar-navigation.js +110 -0
  78. package/lib/components/date-picker/calendar-navigation/calendar-navigation.js.map +1 -0
  79. package/lib/components/date-picker/calendar-navigation/calendar-navigation.styles.js +4 -0
  80. package/lib/components/date-picker/calendar-navigation/calendar-navigation.styles.js.map +1 -0
  81. package/lib/components/date-picker/calendar-year-modal/calendar-year-modal.js +116 -0
  82. package/lib/components/date-picker/calendar-year-modal/calendar-year-modal.js.map +1 -0
  83. package/lib/components/date-picker/calendar-year-modal/calendar-year-modal.styles.js +4 -0
  84. package/lib/components/date-picker/calendar-year-modal/calendar-year-modal.styles.js.map +1 -0
  85. package/lib/components/date-picker/date-picker.js +91 -784
  86. package/lib/components/date-picker/date-picker.js.map +1 -0
  87. package/lib/components/date-picker/date-picker.styles.js +4 -0
  88. package/lib/components/date-picker/date-picker.styles.js.map +1 -0
  89. package/lib/components/divider/divider.js +45 -35
  90. package/lib/components/divider/divider.js.map +1 -0
  91. package/lib/components/divider/divider.styles.js +4 -0
  92. package/lib/components/divider/divider.styles.js.map +1 -0
  93. package/lib/components/dropdown/dropdown.js +97 -63
  94. package/lib/components/dropdown/dropdown.js.map +1 -0
  95. package/lib/components/dropdown/dropdown.styles.js +4 -0
  96. package/lib/components/dropdown/dropdown.styles.js.map +1 -0
  97. package/lib/components/dropdown-item/dropdown-item.js +38 -31
  98. package/lib/components/dropdown-item/dropdown-item.js.map +1 -0
  99. package/lib/components/dropdown-item/dropdown-item.styles.js +4 -0
  100. package/lib/components/dropdown-item/dropdown-item.styles.js.map +1 -0
  101. package/lib/components/feature/feature.js +40 -35
  102. package/lib/components/feature/feature.js.map +1 -0
  103. package/lib/components/feature/feature.styles.js +4 -0
  104. package/lib/components/feature/feature.styles.js.map +1 -0
  105. package/lib/components/field/field.js +218 -153
  106. package/lib/components/field/field.js.map +1 -0
  107. package/lib/components/field/field.styles.js +4 -0
  108. package/lib/components/field/field.styles.js.map +1 -0
  109. package/lib/components/field-note/field-note.js +58 -45
  110. package/lib/components/field-note/field-note.js.map +1 -0
  111. package/lib/components/field-note/field-note.styles.js +4 -0
  112. package/lib/components/field-note/field-note.styles.js.map +1 -0
  113. package/lib/components/footer/footer.js +25 -18
  114. package/lib/components/footer/footer.js.map +1 -0
  115. package/lib/components/footer/footer.styles.js +4 -0
  116. package/lib/components/footer/footer.styles.js.map +1 -0
  117. package/lib/components/global-nav/global-nav.js +44 -37
  118. package/lib/components/global-nav/global-nav.js.map +1 -0
  119. package/lib/components/global-nav/global-nav.styles.js +4 -0
  120. package/lib/components/global-nav/global-nav.styles.js.map +1 -0
  121. package/lib/components/global-nav-item/global-nav-item.js +149 -112
  122. package/lib/components/global-nav-item/global-nav-item.js.map +1 -0
  123. package/lib/components/global-nav-item/global-nav-item.styles.js +4 -0
  124. package/lib/components/global-nav-item/global-nav-item.styles.js.map +1 -0
  125. package/lib/components/grid/grid.js +48 -45
  126. package/lib/components/grid/grid.js.map +1 -0
  127. package/lib/components/grid/grid.styles.js +4 -0
  128. package/lib/components/grid/grid.styles.js.map +1 -0
  129. package/lib/components/grid-item/grid-item.js +19 -16
  130. package/lib/components/grid-item/grid-item.js.map +1 -0
  131. package/lib/components/grid-item/grid-item.styles.js +4 -0
  132. package/lib/components/grid-item/grid-item.styles.js.map +1 -0
  133. package/lib/components/header/header.js +34 -29
  134. package/lib/components/header/header.js.map +1 -0
  135. package/lib/components/header/header.styles.js +4 -0
  136. package/lib/components/header/header.styles.js.map +1 -0
  137. package/lib/components/heading/heading.js +113 -76
  138. package/lib/components/heading/heading.js.map +1 -0
  139. package/lib/components/heading/heading.styles.js +4 -0
  140. package/lib/components/heading/heading.styles.js.map +1 -0
  141. package/lib/components/hero/hero.js +43 -40
  142. package/lib/components/hero/hero.js.map +1 -0
  143. package/lib/components/hero/hero.styles.js +4 -0
  144. package/lib/components/hero/hero.styles.js.map +1 -0
  145. package/lib/components/icon/icon.js +232 -9
  146. package/lib/components/icon/icon.js.map +1 -0
  147. package/lib/components/icon/icon.styles.js +4 -0
  148. package/lib/components/icon/icon.styles.js.map +1 -0
  149. package/lib/components/inline-alert/inline-alert.js +114 -87
  150. package/lib/components/inline-alert/inline-alert.js.map +1 -0
  151. package/lib/components/inline-alert/inline-alert.styles.js +4 -0
  152. package/lib/components/inline-alert/inline-alert.styles.js.map +1 -0
  153. package/lib/components/layout/layout.js +30 -27
  154. package/lib/components/layout/layout.js.map +1 -0
  155. package/lib/components/layout/layout.styles.js +4 -0
  156. package/lib/components/layout/layout.styles.js.map +1 -0
  157. package/lib/components/layout-container/layout-container.js +30 -27
  158. package/lib/components/layout-container/layout-container.js.map +1 -0
  159. package/lib/components/layout-container/layout-container.styles.js +4 -0
  160. package/lib/components/layout-container/layout-container.styles.js.map +1 -0
  161. package/lib/components/layout-section/layout-section.js +41 -33
  162. package/lib/components/layout-section/layout-section.js.map +1 -0
  163. package/lib/components/layout-section/layout-section.styles.js +4 -0
  164. package/lib/components/layout-section/layout-section.styles.js.map +1 -0
  165. package/lib/components/linelength-container/linelength-container.js +19 -16
  166. package/lib/components/linelength-container/linelength-container.js.map +1 -0
  167. package/lib/components/linelength-container/linelength-container.styles.js +4 -0
  168. package/lib/components/linelength-container/linelength-container.styles.js.map +1 -0
  169. package/lib/components/link/link.js +125 -87
  170. package/lib/components/link/link.js.map +1 -0
  171. package/lib/components/link/link.styles.js +4 -0
  172. package/lib/components/link/link.styles.js.map +1 -0
  173. package/lib/components/link-list/link-list.js +48 -45
  174. package/lib/components/link-list/link-list.js.map +1 -0
  175. package/lib/components/link-list/link-list.styles.js +4 -0
  176. package/lib/components/link-list/link-list.styles.js.map +1 -0
  177. package/lib/components/link-list-item/link-list-item.js +40 -37
  178. package/lib/components/link-list-item/link-list-item.js.map +1 -0
  179. package/lib/components/link-list-item/link-list-item.styles.js +4 -0
  180. package/lib/components/link-list-item/link-list-item.styles.js.map +1 -0
  181. package/lib/components/list/list.js +35 -32
  182. package/lib/components/list/list.js.map +1 -0
  183. package/lib/components/list/list.styles.js +4 -0
  184. package/lib/components/list/list.styles.js.map +1 -0
  185. package/lib/components/list-item/list-item.js +25 -21
  186. package/lib/components/list-item/list-item.js.map +1 -0
  187. package/lib/components/list-item/list-item.styles.js +4 -0
  188. package/lib/components/list-item/list-item.styles.js.map +1 -0
  189. package/lib/components/loading-spinner/loading-spinner.js +126 -71
  190. package/lib/components/loading-spinner/loading-spinner.js.map +1 -0
  191. package/lib/components/loading-spinner/loading-spinner.styles.js +4 -0
  192. package/lib/components/loading-spinner/loading-spinner.styles.js.map +1 -0
  193. package/lib/components/logo/logo.js +28 -25
  194. package/lib/components/logo/logo.js.map +1 -0
  195. package/lib/components/logo/logo.styles.js +4 -0
  196. package/lib/components/logo/logo.styles.js.map +1 -0
  197. package/lib/components/main/main.js +29 -26
  198. package/lib/components/main/main.js.map +1 -0
  199. package/lib/components/main/main.styles.js +4 -0
  200. package/lib/components/main/main.styles.js.map +1 -0
  201. package/lib/components/modal/modal.js +174 -125
  202. package/lib/components/modal/modal.js.map +1 -0
  203. package/lib/components/modal/modal.styles.js +4 -0
  204. package/lib/components/modal/modal.styles.js.map +1 -0
  205. package/lib/components/multi-select/multi-select.js +300 -211
  206. package/lib/components/multi-select/multi-select.js.map +1 -0
  207. package/lib/components/multi-select/multi-select.styles.js +4 -0
  208. package/lib/components/multi-select/multi-select.styles.js.map +1 -0
  209. package/lib/components/nav-container/nav-container.js +19 -16
  210. package/lib/components/nav-container/nav-container.js.map +1 -0
  211. package/lib/components/nav-container/nav-container.styles.js +4 -0
  212. package/lib/components/nav-container/nav-container.styles.js.map +1 -0
  213. package/lib/components/page-header/page-header.js +36 -29
  214. package/lib/components/page-header/page-header.js.map +1 -0
  215. package/lib/components/page-header/page-header.styles.js +4 -0
  216. package/lib/components/page-header/page-header.styles.js.map +1 -0
  217. package/lib/components/pagination/page-counter/page-counter.js +67 -0
  218. package/lib/components/pagination/page-counter/page-counter.js.map +1 -0
  219. package/lib/components/pagination/page-counter/page-counter.styles.js +4 -0
  220. package/lib/components/pagination/page-counter/page-counter.styles.js.map +1 -0
  221. package/lib/components/pagination/pagination.js +282 -237
  222. package/lib/components/pagination/pagination.js.map +1 -0
  223. package/lib/components/pagination/pagination.styles.js +4 -0
  224. package/lib/components/pagination/pagination.styles.js.map +1 -0
  225. package/lib/components/percent-bar/percent-bar.js +56 -48
  226. package/lib/components/percent-bar/percent-bar.js.map +1 -0
  227. package/lib/components/percent-bar/percent-bar.styles.js +4 -0
  228. package/lib/components/percent-bar/percent-bar.styles.js.map +1 -0
  229. package/lib/components/popover/popover.js +304 -179
  230. package/lib/components/popover/popover.js.map +1 -0
  231. package/lib/components/popover/popover.styles.js +4 -0
  232. package/lib/components/popover/popover.styles.js.map +1 -0
  233. package/lib/components/primary-nav/primary-nav.js +44 -37
  234. package/lib/components/primary-nav/primary-nav.js.map +1 -0
  235. package/lib/components/primary-nav/primary-nav.styles.js +4 -0
  236. package/lib/components/primary-nav/primary-nav.styles.js.map +1 -0
  237. package/lib/components/primary-nav-item/primary-nav-item.js +151 -113
  238. package/lib/components/primary-nav-item/primary-nav-item.js.map +1 -0
  239. package/lib/components/primary-nav-item/primary-nav-item.styles.js +4 -0
  240. package/lib/components/primary-nav-item/primary-nav-item.styles.js.map +1 -0
  241. package/lib/components/progress-meter/progress-meter.js +74 -57
  242. package/lib/components/progress-meter/progress-meter.js.map +1 -0
  243. package/lib/components/progress-meter/progress-meter.styles.js +4 -0
  244. package/lib/components/progress-meter/progress-meter.styles.js.map +1 -0
  245. package/lib/components/progress-steps/progress-steps.js +19 -0
  246. package/lib/components/progress-steps/progress-steps.js.map +1 -0
  247. package/lib/components/progress-steps/progress-steps.styles.js +4 -0
  248. package/lib/components/progress-steps/progress-steps.styles.js.map +1 -0
  249. package/lib/components/progress-steps-item/progress-steps-item.js +52 -40
  250. package/lib/components/progress-steps-item/progress-steps-item.js.map +1 -0
  251. package/lib/components/progress-steps-item/progress-steps-item.styles.js +4 -0
  252. package/lib/components/progress-steps-item/progress-steps-item.styles.js.map +1 -0
  253. package/lib/components/radio-field/radio-field.js +59 -49
  254. package/lib/components/radio-field/radio-field.js.map +1 -0
  255. package/lib/components/radio-field/radio-field.styles.js +4 -0
  256. package/lib/components/radio-field/radio-field.styles.js.map +1 -0
  257. package/lib/components/radio-field-item/radio-field-item.js +222 -179
  258. package/lib/components/radio-field-item/radio-field-item.js.map +1 -0
  259. package/lib/components/radio-field-item/radio-field-item.styles.js +4 -0
  260. package/lib/components/radio-field-item/radio-field-item.styles.js.map +1 -0
  261. package/lib/components/remove-tag/remove-tag.js +89 -60
  262. package/lib/components/remove-tag/remove-tag.js.map +1 -0
  263. package/lib/components/remove-tag/remove-tag.styles.js +4 -0
  264. package/lib/components/remove-tag/remove-tag.styles.js.map +1 -0
  265. package/lib/components/section/section.js +46 -27
  266. package/lib/components/section/section.js.map +1 -0
  267. package/lib/components/section/section.styles.js +4 -0
  268. package/lib/components/section/section.styles.js.map +1 -0
  269. package/lib/components/select/select.js +243 -158
  270. package/lib/components/select/select.js.map +1 -0
  271. package/lib/components/select/select.styles.js +4 -0
  272. package/lib/components/select/select.styles.js.map +1 -0
  273. package/lib/components/select-tile/select-tile-checkbox-controller.js +60 -0
  274. package/lib/components/select-tile/select-tile-checkbox-controller.js.map +1 -0
  275. package/lib/components/select-tile/select-tile-radio-controller.js +167 -0
  276. package/lib/components/select-tile/select-tile-radio-controller.js.map +1 -0
  277. package/lib/components/select-tile/select-tile.js +228 -223
  278. package/lib/components/select-tile/select-tile.js.map +1 -0
  279. package/lib/components/select-tile/select-tile.styles.js +4 -0
  280. package/lib/components/select-tile/select-tile.styles.js.map +1 -0
  281. package/lib/components/select-tile-list/select-tile-list.js +76 -62
  282. package/lib/components/select-tile-list/select-tile-list.js.map +1 -0
  283. package/lib/components/select-tile-list/select-tile-list.styles.js +4 -0
  284. package/lib/components/select-tile-list/select-tile-list.styles.js.map +1 -0
  285. package/lib/components/skeleton-loader/skeleton-loader.js +68 -39
  286. package/lib/components/skeleton-loader/skeleton-loader.js.map +1 -0
  287. package/lib/components/skeleton-loader/skeleton-loader.styles.js +4 -0
  288. package/lib/components/skeleton-loader/skeleton-loader.styles.js.map +1 -0
  289. package/lib/components/split-button/split-button.js +51 -46
  290. package/lib/components/split-button/split-button.js.map +1 -0
  291. package/lib/components/split-button/split-button.styles.js +4 -0
  292. package/lib/components/split-button/split-button.styles.js.map +1 -0
  293. package/lib/components/submenu/submenu.js +19 -16
  294. package/lib/components/submenu/submenu.js.map +1 -0
  295. package/lib/components/submenu/submenu.styles.js +4 -0
  296. package/lib/components/submenu/submenu.styles.js.map +1 -0
  297. package/lib/components/submenu-item/submenu-item.js +32 -26
  298. package/lib/components/submenu-item/submenu-item.js.map +1 -0
  299. package/lib/components/submenu-item/submenu-item.styles.js +4 -0
  300. package/lib/components/submenu-item/submenu-item.styles.js.map +1 -0
  301. package/lib/components/tab/tab.js +74 -63
  302. package/lib/components/tab/tab.js.map +1 -0
  303. package/lib/components/tab/tab.styles.js +4 -0
  304. package/lib/components/tab/tab.styles.js.map +1 -0
  305. package/lib/components/tab-panel/tab-panel.js +49 -43
  306. package/lib/components/tab-panel/tab-panel.js.map +1 -0
  307. package/lib/components/tab-panel/tab-panel.styles.js +4 -0
  308. package/lib/components/tab-panel/tab-panel.styles.js.map +1 -0
  309. package/lib/components/table/table.js +46 -41
  310. package/lib/components/table/table.js.map +1 -0
  311. package/lib/components/table/table.styles.js +4 -0
  312. package/lib/components/table/table.styles.js.map +1 -0
  313. package/lib/components/table-body/table-body.js +20 -17
  314. package/lib/components/table-body/table-body.js.map +1 -0
  315. package/lib/components/table-body/table-body.styles.js +4 -0
  316. package/lib/components/table-body/table-body.styles.js.map +1 -0
  317. package/lib/components/table-cell/table-cell.js +39 -36
  318. package/lib/components/table-cell/table-cell.js.map +1 -0
  319. package/lib/components/table-cell/table-cell.styles.js +4 -0
  320. package/lib/components/table-cell/table-cell.styles.js.map +1 -0
  321. package/lib/components/table-header/table-header.js +20 -17
  322. package/lib/components/table-header/table-header.js.map +1 -0
  323. package/lib/components/table-header/table-header.styles.js +4 -0
  324. package/lib/components/table-header/table-header.styles.js.map +1 -0
  325. package/lib/components/table-header-cell/table-header-cell.js +35 -32
  326. package/lib/components/table-header-cell/table-header-cell.js.map +1 -0
  327. package/lib/components/table-header-cell/table-header-cell.styles.js +4 -0
  328. package/lib/components/table-header-cell/table-header-cell.styles.js.map +1 -0
  329. package/lib/components/table-object/table-object.js +21 -18
  330. package/lib/components/table-object/table-object.js.map +1 -0
  331. package/lib/components/table-object/table-object.styles.js +4 -0
  332. package/lib/components/table-object/table-object.styles.js.map +1 -0
  333. package/lib/components/table-row/table-row.js +76 -55
  334. package/lib/components/table-row/table-row.js.map +1 -0
  335. package/lib/components/table-row/table-row.styles.js +4 -0
  336. package/lib/components/table-row/table-row.styles.js.map +1 -0
  337. package/lib/components/tabs/tabs.js +452 -303
  338. package/lib/components/tabs/tabs.js.map +1 -0
  339. package/lib/components/tabs/tabs.styles.js +4 -0
  340. package/lib/components/tabs/tabs.styles.js.map +1 -0
  341. package/lib/components/tag/tag.js +236 -167
  342. package/lib/components/tag/tag.js.map +1 -0
  343. package/lib/components/tag/tag.styles.js +4 -0
  344. package/lib/components/tag/tag.styles.js.map +1 -0
  345. package/lib/components/tag-list/tag-list.js +40 -35
  346. package/lib/components/tag-list/tag-list.js.map +1 -0
  347. package/lib/components/tag-list/tag-list.styles.js +4 -0
  348. package/lib/components/tag-list/tag-list.styles.js.map +1 -0
  349. package/lib/components/tertiary-nav/tertiary-nav.js +40 -33
  350. package/lib/components/tertiary-nav/tertiary-nav.js.map +1 -0
  351. package/lib/components/tertiary-nav/tertiary-nav.styles.js +4 -0
  352. package/lib/components/tertiary-nav/tertiary-nav.styles.js.map +1 -0
  353. package/lib/components/tertiary-nav-item/tertiary-nav-item.js +52 -43
  354. package/lib/components/tertiary-nav-item/tertiary-nav-item.js.map +1 -0
  355. package/lib/components/tertiary-nav-item/tertiary-nav-item.styles.js +4 -0
  356. package/lib/components/tertiary-nav-item/tertiary-nav-item.styles.js.map +1 -0
  357. package/lib/components/text-link/text-link.js +45 -41
  358. package/lib/components/text-link/text-link.js.map +1 -0
  359. package/lib/components/text-link/text-link.styles.js +4 -0
  360. package/lib/components/text-link/text-link.styles.js.map +1 -0
  361. package/lib/components/text-passage/text-passage-light-dom.js +145 -0
  362. package/lib/components/text-passage/text-passage-light-dom.js.map +1 -0
  363. package/lib/components/text-passage/text-passage-light-dom.styles.js +4 -0
  364. package/lib/components/text-passage/text-passage-light-dom.styles.js.map +1 -0
  365. package/lib/components/text-passage/text-passage.js +72 -44
  366. package/lib/components/text-passage/text-passage.js.map +1 -0
  367. package/lib/components/text-passage/text-passage.styles.js +4 -0
  368. package/lib/components/text-passage/text-passage.styles.js.map +1 -0
  369. package/lib/components/tooltip/tooltip.js +278 -173
  370. package/lib/components/tooltip/tooltip.js.map +1 -0
  371. package/lib/components/tooltip/tooltip.styles.js +4 -0
  372. package/lib/components/tooltip/tooltip.styles.js.map +1 -0
  373. package/lib/components/utility-nav/utility-nav.js +40 -33
  374. package/lib/components/utility-nav/utility-nav.js.map +1 -0
  375. package/lib/components/utility-nav/utility-nav.styles.js +4 -0
  376. package/lib/components/utility-nav/utility-nav.styles.js.map +1 -0
  377. package/lib/components/utility-nav-item/utility-nav-item.js +70 -49
  378. package/lib/components/utility-nav-item/utility-nav-item.js.map +1 -0
  379. package/lib/components/utility-nav-item/utility-nav-item.styles.js +4 -0
  380. package/lib/components/utility-nav-item/utility-nav-item.styles.js.map +1 -0
  381. package/lib/design-tokens/brands/blue/css/tokens_blue.module.js +737 -0
  382. package/lib/design-tokens/brands/blue/css/tokens_blue.module.js.map +1 -0
  383. package/lib/design-tokens/brands/bolt/tokens_bolt.theme.js +756 -0
  384. package/lib/design-tokens/brands/bolt/tokens_bolt.theme.js.map +1 -0
  385. package/lib/design-tokens/brands/cre8/css/tokens_cre8.module.js +771 -0
  386. package/lib/design-tokens/brands/cre8/css/tokens_cre8.module.js.map +1 -0
  387. package/lib/design-tokens/brands/cre8-a2ui/css/tokens_cre8-a2ui.module.js +772 -0
  388. package/lib/design-tokens/brands/cre8-a2ui/css/tokens_cre8-a2ui.module.js.map +1 -0
  389. package/lib/design-tokens/brands/cre8-legacy/css/tokens_cre8-legacy.module.js +737 -0
  390. package/lib/design-tokens/brands/cre8-legacy/css/tokens_cre8-legacy.module.js.map +1 -0
  391. package/lib/design-tokens/brands/femmecubator/css/tokens_femmecubator2.module.js +983 -0
  392. package/lib/design-tokens/brands/femmecubator/css/tokens_femmecubator2.module.js.map +1 -0
  393. package/lib/design-tokens/brands/legacy/css/tokens_legacy.module.js +737 -0
  394. package/lib/design-tokens/brands/legacy/css/tokens_legacy.module.js.map +1 -0
  395. package/lib/design-tokens/brands/marketing/css/tokens_marketing.module.js +736 -0
  396. package/lib/design-tokens/brands/marketing/css/tokens_marketing.module.js.map +1 -0
  397. package/lib/design-tokens/brands/minimalist/css/tokens_minimalist.module.js +737 -0
  398. package/lib/design-tokens/brands/minimalist/css/tokens_minimalist.module.js.map +1 -0
  399. package/lib/design-tokens/brands/prisma/tokens_prisma.module.js +771 -0
  400. package/lib/design-tokens/brands/prisma/tokens_prisma.module.js.map +1 -0
  401. package/lib/design-tokens/brands/starbucks/tokens.module.js +552 -0
  402. package/lib/design-tokens/brands/starbucks/tokens.module.js.map +1 -0
  403. package/lib/design-tokens/brands/starbucks/tokens_starbucks.module.js +776 -0
  404. package/lib/design-tokens/brands/starbucks/tokens_starbucks.module.js.map +1 -0
  405. package/lib/design-tokens/brands copy/blue/css/tokens_blue.module.js +253 -0
  406. package/lib/design-tokens/brands copy/blue/css/tokens_blue.module.js.map +1 -0
  407. package/lib/design-tokens/core/scss/theming/head.module.js +6 -0
  408. package/lib/design-tokens/core/scss/theming/head.module.js.map +1 -0
  409. package/lib/design-tokens/tokens_netflix.theme.js +806 -0
  410. package/lib/design-tokens/tokens_netflix.theme.js.map +1 -0
  411. package/lib/directives/if-truthy.js +24 -0
  412. package/lib/directives/if-truthy.js.map +1 -0
  413. package/lib/directives/spread.js +29 -0
  414. package/lib/directives/spread.js.map +1 -0
  415. package/lib/index.js +84 -168
  416. package/lib/index.js.map +1 -0
  417. package/lib/scripts/convert-scss-to-ts.js +25 -0
  418. package/lib/scripts/convert-scss-to-ts.js.map +1 -0
  419. package/lib/scripts/extract-tokens.js +120 -0
  420. package/lib/scripts/extract-tokens.js.map +1 -0
  421. package/lib/scripts/generate-react-wrappers.js +229 -0
  422. package/lib/scripts/generate-react-wrappers.js.map +1 -0
  423. package/lib/scripts/generateWesparkleThemes.js +52 -0
  424. package/lib/scripts/generateWesparkleThemes.js.map +1 -0
  425. package/lib/toBeAccessible.js +18 -0
  426. package/lib/toBeAccessible.js.map +1 -0
  427. package/lib/utilities/is-mobile.js +10 -0
  428. package/lib/utilities/is-mobile.js.map +1 -0
  429. package/lib/utilities/story-helpers.js +14 -0
  430. package/lib/utilities/story-helpers.js.map +1 -0
  431. package/lib/vite.config.cdn.js +85 -0
  432. package/lib/vite.config.cdn.js.map +1 -0
  433. package/lib/vite.config.js +156 -0
  434. package/lib/vite.config.js.map +1 -0
  435. package/package.json +8 -9
@@ -1,274 +1,424 @@
1
- import { css as p, html as f } from "lit";
2
- import { property as d, state as c, queryAssignedElements as v, query as m } from "lit/decorators.js";
3
- import { nanoid as u } from "nanoid";
4
- import { Cre8Element as T } from "../cre8-element.js";
5
- const x = p`*,::slotted(*),*:before,*:after{box-sizing:border-box}:root{--size-base-unit: 0.5rem}[dir=rtl]{--rtlTranslateX: 50%;--rtlGradientToRight: 270deg;--rtlRotate45Inverse: -45deg}:host{--cre8-z-index-1: 1;--cre8-z-index-50: 50;--cre8-z-index-100: 100;--cre8-z-index-200: 200;--cre8-z-index-1030: 1030;--cre8-anim-fade-quick: 0.35s;--cre8-anim-ease: ease}@keyframes fadeIn{100%{opacity:1}}@keyframes slideIn{100%{transform:translateX(0)}}@keyframes slideInFwd{100%{width:272px;height:272px}}@keyframes slideOutRight{100%{width:272px;height:272px}}@keyframes slideUp{100%{transform:translateY(0)}}@media(width >= 481px){@keyframes slideInFwd{100%{width:417px;height:417px}}@keyframes slideOutRight{100%{width:417px;height:417px}}}@media(width >= 48rem){@keyframes slideInFwd{100%{width:330px;height:330px}}@keyframes slideOutRight{100%{width:330px;height:330px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 60rem){@keyframes slideInFwd{100%{width:460px;height:460px}}@keyframes slideOutRight{100%{width:460px;height:460px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 75rem){@keyframes slideInFwd{100%{width:592px;height:591px}}@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 87.5rem){@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 120px))}}}@media(width >= 2200px){@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 592px))}}}span.ripple{position:absolute;border-radius:50%;transform:scale(0);animation:ripple 600ms linear;background-color:var(--ripple-bg-color)}@keyframes ripple{to{transform:scale(4);opacity:1}}:root{--size-base-unit: 0.5rem}[dir=rtl]{--rtlTranslateX: 50%;--rtlGradientToRight: 270deg;--rtlRotate45Inverse: -45deg}:host{display:block}.cre8-c-tabs__header{position:relative;display:flex;flex-direction:column;align-items:baseline;overflow:hidden}.cre8-c-tabs:not(.cre8-is-start) .cre8-c-tabs__header::before{content:"";display:block;position:absolute;pointer-events:none;background:linear-gradient(var(--rtlGradientToRight, 90deg), var(--cre8-color-bg-default), rgba(255, 255, 255, 0.001) 30%);height:100%;inset-block-start:0;inset-inline-start:0;width:3rem;z-index:1}.cre8-c-tabs:not(.cre8-is-end) .cre8-c-tabs__header::after{content:"";display:block !important;position:absolute;pointer-events:none;background:linear-gradient(var(--rtlGradientToRight, 90deg), rgba(255, 255, 255, 0.001) 30%, var(--cre8-color-bg-default));height:100%;inset-block-start:0;inset-inline-end:0;width:3rem;z-index:1}.cre8-c-tabs__list{display:flex;overflow:auto;width:100%;margin:0;position:relative;padding:var(--cre8-border-width-focus);scrollbar-width:none;-ms-overflow-style:none}.cre8-c-tabs__list::-webkit-scrollbar{display:none}.cre8-c-tabs__body{padding-block-start:1rem}.cre8-c-tabs--full-width .cre8-c-tabs__body{border-top:var(--cre8-border-width-tab-selected) var(--cre8-border-style-default) var(--cre8-color-border-default);margin-top:calc(var(--cre8-border-width-tab-selected)*-2)}`;
6
- var g = Object.defineProperty, r = (l, e, t, i) => {
7
- for (var s = void 0, n = l.length - 1, h; n >= 0; n--)
8
- (h = l[n]) && (s = h(e, t, s) || s);
9
- return s && g(e, t, s), s;
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
10
6
  };
11
- let b = 1;
12
- const o = class o extends T {
13
- /**
14
- * Initialize Functions
15
- */
16
- constructor() {
17
- super(), this.activeIndex = 0, this.isStart = !0, this.isEnd = !1, this.handleScroll = this.handleScroll.bind(this), this.handleResize = this.handleResize.bind(this), this.setIsStart = this.setIsStart.bind(this), this.setIsEnd = this.setIsEnd.bind(this), this.emitEvent = this.emitEvent.bind(this), this.tabId = `cre8-tabpanel-${b}`, b += 1;
18
- }
19
- /**
20
- * Query the document direction value
21
- *
22
- * _*This property is dynamically set_
23
- */
24
- get isRTL() {
25
- return document.dir === "rtl";
26
- }
27
- /**
28
- * Connected Callback Lifecycle
29
- * 1. Fires each time a custom element is appended into a document-connected element.
30
- */
31
- connectedCallback() {
32
- super.connectedCallback(), window.addEventListener("resize", this.handleResize);
33
- }
34
- /**
35
- * Disconnected Callback Lifecycle
36
- * 1. Removes the event listeners to ensure that any memory allocated by your component
37
- * will be cleaned up when your component is destroyed or disconnected from the page.
38
- */
39
- disconnectedCallback() {
40
- super.disconnectedCallback(), window.removeEventListener("resize", this.handleResize);
41
- }
42
- /**
43
- * First Updated Lifecycle Hook
44
- * 1. Sets the `aria-labelledby` prop for accessible tabs if user doesn't define the `ariaLabelledBy` prop.
45
- * 2. Sets the active tab if activeIndex is defined. Otherwise, set the first tab as active by default.
46
- * 3. Initialize isStart and isEnd.
47
- * 4. Set the varaint on the cre8-tab according to the cre8-tabs variant.
48
- */
49
- async firstUpdated() {
50
- this.setTabAttributes(), await this.updateComplete, this.activeTab = this._Cre8TabItems[this.activeIndex] || this._Cre8TabItems[0], this.setActiveTab(), this.setIsStart(), this.setIsEnd(), this.setTabVariant();
51
- }
52
- /**
53
- * Updated Lifecycle Hook
54
- * 1. remove selected state from previously selected tab
55
- * 2. Checks to see if the old `activeIndex` property has been updated.
56
- * If the new value doesn't equal the old value, activate the proper tab
57
- */
58
- async updated(e) {
59
- e.forEach(async (t, i) => {
60
- i === "activeIndex" && this.activeIndex !== t && (await this.updateComplete, this.activeTab && this.removePreviousActiveTab(), this.activeTab = this._Cre8TabItems[this.activeIndex], this.setActiveTab());
61
- });
62
- }
63
- /**
64
- * Handle Resize
65
- * 1. On resize, if position from left is greater than 0, set isStart to false. Otherwise set isStart to true.
66
- * 2. On resize, If last child is fully in the viewport, set isEnd to true. Otherwise, set isEnd to false.
67
- * @fires resize
68
- */
69
- handleResize() {
70
- this.setIsStart(), this.setIsEnd();
71
- }
72
- /**
73
- * Handle Scroll
74
- * 1. On scroll, if position from left is greater than 0, set isStart to false. Otherwise set isStart to true.
75
- * 2. On scroll, If last child is fully in the viewport, set isEnd to true. Otherwise, set isEnd to false.
76
- * @fires scroll
77
- */
78
- handleScroll() {
79
- this.setIsStart(), this.setIsEnd();
80
- }
81
- /**
82
- * Set isStart State
83
- * 1. If position from left is greater than 0, set isStart to false. Otherwise set isStart to true.
84
- */
85
- setIsStart() {
86
- this.isRTL ? this._Cre8TabsHeaderList.scrollLeft > 0 ? this.isStart = !0 : this.isStart = !1 : this._Cre8TabsHeaderList.scrollLeft > 0 ? this.isStart = !1 : this.isStart = !0;
87
- }
88
- /**
89
- * Set isEnd State
90
- * 1. If last child is fully in the viewport, set isEnd to true. Otherwise, set isEnd to false.
91
- */
92
- setIsEnd() {
93
- this.isInViewport() === !0 ? this.isEnd = !0 : this.isEnd = !1;
94
- }
95
- /**
96
- * Check if last overflow list item is in the viewport
97
- * 1. Get children of the overflow list inner container and get bounding client rectangle of last child
98
- * 2. Return true if the left property is greater than or equal to 0 and if the right property is less
99
- * than or equal to the window inner width or document client width
100
- */
101
- isInViewport() {
102
- const t = this._Cre8TabItems[this._Cre8TabItems.length - 1].shadowRoot?.querySelector(".cre8-c-tab");
103
- if (!t)
104
- return !1;
105
- const i = t.getBoundingClientRect(), s = window.innerWidth || document.documentElement.clientWidth;
106
- return i.left >= 0 && i.right <= s;
107
- }
108
- /**
109
- * Set Tab Variant
110
- * 1. Loop through all the cre8-tab Components and set the size to 'sm' if the parent has size 'sm'.
111
- */
112
- setTabVariant() {
113
- this.size === "sm" && this._Cre8TabItems.forEach((e) => {
114
- e.size = "sm";
115
- });
116
- }
117
- /**
118
- * Set the attributes on tab and tab panel
119
- * 1. Sets the index value on the tab items.
120
- * 2. Sets the `aria-labelledby` on the tab items.
121
- * 3. Set the index and id on the tab-panel to match the tab.
122
- */
123
- setTabAttributes() {
124
- this._Cre8TabItems.forEach((e, t) => {
125
- e.index = t;
126
- const s = e.ariaLabelledBy || u();
127
- e.ariaLabelledBy = s;
128
- const n = this._Cre8TabPanels[t];
129
- n.index = t;
130
- });
131
- }
132
- /**
133
- * Set Active Tab
134
- * 1. Sets the active state for the selected tab.
135
- * 2. Sets the active state for the tab panel with the same index value as the selected tab.
136
- */
137
- setActiveTab() {
138
- this.activeTab.isActive = !0;
139
- const e = this._Cre8TabPanels.find((t) => t.index === this.activeTab.index);
140
- e && (e.isActive = !0);
141
- }
142
- /**
143
- * Set Active Tab Focus
144
- */
145
- setActiveTabFocus() {
146
- this.activeTab.shadowRoot?.querySelector(".cre8-c-tab").focus();
147
- }
148
- /**
149
- * Handle Tab Selected
150
- * 1. Only continue if event target is a tab
151
- * 2. If tab is active, make the previous selected tab inactive.
152
- * 3. Set the clicked tab active.
153
- * 4. Emit the custom event.
154
- * @fires tabSelected
155
- */
156
- handleTabSelected(e) {
157
- const { target: t } = e;
158
- if (this._Cre8TabItems.includes(t)) {
159
- this.activeTab && this.removePreviousActiveTab(), this.activeTab = t;
160
- const i = this._Cre8TabItems.findIndex((s) => s === this.activeTab);
161
- this.activeIndex = i, this.setActiveTab(), this.emitEvent();
7
+ import { html, } from 'lit';
8
+ import { property, query, queryAssignedElements, state, } from 'lit/decorators.js';
9
+ import { nanoid } from 'nanoid';
10
+ import { Cre8Element } from '../cre8-element';
11
+ import styles from './tabs.styles.js';
12
+ let tabId = 1;
13
+ /**
14
+ * Tabs are used to quickly navigate back and forth between views.
15
+ * The Tab design and interaction varies depending on the requirements for your organization and project.
16
+ * Standardizing on the best individual controls will improve usability and reduce development and QA time.
17
+ *
18
+ * Create a standard set of Tab controls:
19
+ * Primary Tabs (for system navigation), Secondary Tabs (for sub navigation within a screen).
20
+ *
21
+ * ## Usability Guidelines
22
+ * - The selected Tab should be visually differentiated from the other Tabs.
23
+ * The deselected Tabs should still look enabled.
24
+ * Dimming the other Tabs decreases the legibility of items that are actually active and clickable.
25
+ * - There must be a minimum of 2 Tabs.
26
+ * - Showing status in a Tab is non-standard (such as 0%, 10%).
27
+ * - Tab labels and content should be parallel, with the exception of a Summary or Overview Tab
28
+ * which can be a rollup of content across other Tabs.
29
+ * - Keep the font size of the Tabs the same.
30
+ * If the Tabs are a fixed width and one of the labels is too long,
31
+ * don't resize the text to fit and consider wrapping text to a second line.
32
+ * - If possible, don't truncate text because it makes it harder to understand what's in the Tab.
33
+ * - Try not to use more than six Tabs to keep the UI uncluttered.
34
+ * - Do not stack Tabs on top of each other, and do not nest Tabs within Tabs.
35
+ * Find alternate ways of navigating page hierarchy.
36
+ *
37
+ * @slot default - Default, unnamed slot container for each `cre8-tab` button
38
+ * @slot panel - Container for each `cre8-tab-panel` content item
39
+ */
40
+ export class Cre8Tabs extends Cre8Element {
41
+ /**
42
+ * Query the document direction value
43
+ *
44
+ * _*This property is dynamically set_
45
+ */
46
+ get isRTL() {
47
+ return document.dir === 'rtl';
162
48
  }
163
- }
164
- /**
165
- * Handle Keydown
166
- * 1. If the active tab is not focused then handle the keydown events.
167
- * 2. On keydown of the right arrow, make the next tab active.
168
- * 3. On keydown of the left arrow, make the previous tab active.
169
- * 4. On keydown of the home key, make the first tab active.
170
- * 5. On keydown of the end key, make the last tab active.
171
- * 6. On keydown of the escape key, remove the focus.
172
- * @fires keydown
173
- */
174
- handleKeydown(e) {
175
- const { target: t } = e;
176
- if (document.activeElement.matches("cre8-tab"))
177
- switch (e.key) {
49
+ /**
50
+ * Initialize Functions
51
+ */
52
+ constructor() {
53
+ super();
54
+ /**
55
+ * Sets the initial active tab (e.g. 0 sets the first tab, 1 sets the second tab, etc.)
56
+ * @attr {number}
57
+ */
58
+ this.activeIndex = 0;
59
+ /**
60
+ * If position from left is greater than 0, set isStart to false. Otherwise set isStart to true.
61
+ *
62
+ * _*This property is dynamically set_
63
+ * @attr {boolean}
64
+ */
65
+ this.isStart = true;
66
+ /**
67
+ * If last child is fully in the viewport, set isEnd to true. Otherwise, set isEnd to false.
68
+ *
69
+ * _*This property is dynamically set_
70
+ * @attr {boolean}
71
+ */
72
+ this.isEnd = false;
73
+ this.handleScroll = this.handleScroll.bind(this);
74
+ this.handleResize = this.handleResize.bind(this);
75
+ this.setIsStart = this.setIsStart.bind(this);
76
+ this.setIsEnd = this.setIsEnd.bind(this);
77
+ this.emitEvent = this.emitEvent.bind(this);
78
+ /**
79
+ * Set the tab id.
80
+ */
81
+ this.tabId = `cre8-tabpanel-${tabId}`;
82
+ tabId += 1;
83
+ }
84
+ /**
85
+ * Connected Callback Lifecycle
86
+ * 1. Fires each time a custom element is appended into a document-connected element.
87
+ */
88
+ connectedCallback() {
89
+ super.connectedCallback();
90
+ window.addEventListener('resize', this.handleResize);
91
+ }
92
+ /**
93
+ * Disconnected Callback Lifecycle
94
+ * 1. Removes the event listeners to ensure that any memory allocated by your component
95
+ * will be cleaned up when your component is destroyed or disconnected from the page.
96
+ */
97
+ disconnectedCallback() {
98
+ super.disconnectedCallback();
99
+ window.removeEventListener('resize', this.handleResize);
100
+ }
101
+ /**
102
+ * First Updated Lifecycle Hook
103
+ * 1. Sets the `aria-labelledby` prop for accessible tabs if user doesn't define the `ariaLabelledBy` prop.
104
+ * 2. Sets the active tab if activeIndex is defined. Otherwise, set the first tab as active by default.
105
+ * 3. Initialize isStart and isEnd.
106
+ * 4. Set the varaint on the cre8-tab according to the cre8-tabs variant.
107
+ */
108
+ async firstUpdated() {
109
+ /* 1 */
110
+ this.setTabAttributes();
111
+ await this.updateComplete;
178
112
  /* 2 */
179
- case "ArrowRight":
180
- e.preventDefault(), this.setSelectedToNextTab(t);
181
- break;
113
+ this.activeTab = this._Cre8TabItems[this.activeIndex] || this._Cre8TabItems[0];
114
+ this.setActiveTab();
182
115
  /* 3 */
183
- case "ArrowLeft":
184
- e.preventDefault(), this.setSelectedToPreviousTab(t);
185
- break;
116
+ this.setIsStart();
117
+ this.setIsEnd();
186
118
  /* 4 */
187
- case "Home":
188
- e.preventDefault(), this.setSelectedToNextTab(this._Cre8TabItems[this._Cre8TabItems.length - 1]);
189
- break;
190
- /* 5 */
191
- case "End":
192
- e.preventDefault(), this.setSelectedToPreviousTab(this._Cre8TabItems[0]);
193
- break;
194
- /* 6 */
195
- case "Escape":
196
- this.activeTab.blur();
197
- break;
198
- }
199
- }
200
- /**
201
- * Set Selected To Previous Tab
202
- * 1. Get current selected Tab index then deactivate previously selected tab.
203
- * 2. If current activeIndex is in first position then move the tab focus to last tab.
204
- * 3. Set the active tab and focus.
205
- * 4. Emit custom event.
206
- * @fires tabChange
207
- */
208
- setSelectedToPreviousTab(e) {
209
- const t = e.index;
210
- this.removePreviousActiveTab();
211
- const i = this._Cre8TabItems.length - 1;
212
- if (t === 0)
213
- this.activeIndex = i, this.activeTab = this._Cre8TabItems[i];
214
- else {
215
- const s = t - 1;
216
- this.activeIndex = s, this.activeTab = this._Cre8TabItems[s];
119
+ this.setTabVariant();
120
+ }
121
+ /**
122
+ * Updated Lifecycle Hook
123
+ * 1. remove selected state from previously selected tab
124
+ * 2. Checks to see if the old `activeIndex` property has been updated.
125
+ * If the new value doesn't equal the old value, activate the proper tab
126
+ */
127
+ async updated(changedProperties) {
128
+ changedProperties.forEach(async (oldValue, propName) => {
129
+ if (propName === 'activeIndex' && this.activeIndex !== oldValue) {
130
+ await this.updateComplete;
131
+ if (this.activeTab) {
132
+ this.removePreviousActiveTab(); /* 1 */
133
+ }
134
+ this.activeTab = this._Cre8TabItems[this.activeIndex];
135
+ this.setActiveTab(); /* 2 */
136
+ }
137
+ });
138
+ }
139
+ /**
140
+ * Handle Resize
141
+ * 1. On resize, if position from left is greater than 0, set isStart to false. Otherwise set isStart to true.
142
+ * 2. On resize, If last child is fully in the viewport, set isEnd to true. Otherwise, set isEnd to false.
143
+ * @fires resize
144
+ */
145
+ handleResize() {
146
+ this.setIsStart(); /* 1 */
147
+ this.setIsEnd(); /* 2 */
148
+ }
149
+ /**
150
+ * Handle Scroll
151
+ * 1. On scroll, if position from left is greater than 0, set isStart to false. Otherwise set isStart to true.
152
+ * 2. On scroll, If last child is fully in the viewport, set isEnd to true. Otherwise, set isEnd to false.
153
+ * @fires scroll
154
+ */
155
+ handleScroll() {
156
+ this.setIsStart(); /* 1 */
157
+ this.setIsEnd(); /* 2 */
158
+ }
159
+ /**
160
+ * Set isStart State
161
+ * 1. If position from left is greater than 0, set isStart to false. Otherwise set isStart to true.
162
+ */
163
+ setIsStart() {
164
+ if (this.isRTL) {
165
+ if (this._Cre8TabsHeaderList.scrollLeft > 0) {
166
+ this.isStart = true;
167
+ }
168
+ else {
169
+ this.isStart = false;
170
+ }
171
+ }
172
+ else if (this._Cre8TabsHeaderList.scrollLeft > 0) {
173
+ this.isStart = false;
174
+ }
175
+ else {
176
+ this.isStart = true;
177
+ }
178
+ }
179
+ /**
180
+ * Set isEnd State
181
+ * 1. If last child is fully in the viewport, set isEnd to true. Otherwise, set isEnd to false.
182
+ */
183
+ setIsEnd() {
184
+ if (this.isInViewport() === true) {
185
+ this.isEnd = true;
186
+ }
187
+ else {
188
+ this.isEnd = false;
189
+ }
190
+ }
191
+ /**
192
+ * Check if last overflow list item is in the viewport
193
+ * 1. Get children of the overflow list inner container and get bounding client rectangle of last child
194
+ * 2. Return true if the left property is greater than or equal to 0 and if the right property is less
195
+ * than or equal to the window inner width or document client width
196
+ */
197
+ isInViewport() {
198
+ const lastChild = this._Cre8TabItems[this._Cre8TabItems.length - 1];
199
+ const tabElement = lastChild.shadowRoot?.querySelector('.cre8-c-tab');
200
+ if (!tabElement) {
201
+ return false; // Return false if the tab element is not found
202
+ }
203
+ const rect = tabElement.getBoundingClientRect(); /* 1 */
204
+ const windowWidth = window.innerWidth || document.documentElement.clientWidth;
205
+ return rect.left >= 0 && rect.right <= windowWidth; /* 2 */
206
+ }
207
+ /**
208
+ * Set Tab Variant
209
+ * 1. Loop through all the cre8-tab Components and set the size to 'sm' if the parent has size 'sm'.
210
+ */
211
+ setTabVariant() {
212
+ if (this.size === 'sm') {
213
+ this._Cre8TabItems.forEach((tab) => {
214
+ tab.size = 'sm';
215
+ });
216
+ }
217
+ }
218
+ /**
219
+ * Set the attributes on tab and tab panel
220
+ * 1. Sets the index value on the tab items.
221
+ * 2. Sets the `aria-labelledby` on the tab items.
222
+ * 3. Set the index and id on the tab-panel to match the tab.
223
+ */
224
+ setTabAttributes() {
225
+ this._Cre8TabItems.forEach((tab, index) => {
226
+ /* 1 */
227
+ tab.index = index;
228
+ /* 2 */
229
+ const ariaLabelledBy = tab.ariaLabelledBy;
230
+ const id = ariaLabelledBy || nanoid();
231
+ tab.ariaLabelledBy = id;
232
+ /* 3 */
233
+ const tabPanel = this._Cre8TabPanels[index];
234
+ tabPanel.index = index;
235
+ });
236
+ }
237
+ /**
238
+ * Set Active Tab
239
+ * 1. Sets the active state for the selected tab.
240
+ * 2. Sets the active state for the tab panel with the same index value as the selected tab.
241
+ */
242
+ setActiveTab() {
243
+ /* 1 */
244
+ this.activeTab.isActive = true;
245
+ /* 2 */
246
+ const activeTabPanel = this._Cre8TabPanels.find((tabPanel) => tabPanel.index === this.activeTab.index);
247
+ if (activeTabPanel) {
248
+ activeTabPanel.isActive = true;
249
+ }
250
+ }
251
+ /**
252
+ * Set Active Tab Focus
253
+ */
254
+ setActiveTabFocus() {
255
+ this.activeTab.shadowRoot?.querySelector('.cre8-c-tab').focus();
256
+ }
257
+ /**
258
+ * Handle Tab Selected
259
+ * 1. Only continue if event target is a tab
260
+ * 2. If tab is active, make the previous selected tab inactive.
261
+ * 3. Set the clicked tab active.
262
+ * 4. Emit the custom event.
263
+ * @fires tabSelected
264
+ */
265
+ handleTabSelected(event) {
266
+ const { target } = event;
267
+ /* 1 */
268
+ if (this._Cre8TabItems.includes(target)) {
269
+ /* 2 */
270
+ if (this.activeTab) {
271
+ this.removePreviousActiveTab();
272
+ }
273
+ /* 3 */
274
+ this.activeTab = target;
275
+ const activeIndex = this._Cre8TabItems.findIndex((tab) => tab === this.activeTab);
276
+ this.activeIndex = activeIndex;
277
+ this.setActiveTab();
278
+ /* 4 */
279
+ this.emitEvent();
280
+ }
217
281
  }
218
- this.setActiveTab(), this.setActiveTabFocus(), this.emitEvent();
219
- }
220
- /**
221
- * Set Selected To Next Tab
222
- * 1. Get current selected Tab index then deactivate previously selected tab.
223
- * 2. If current activeIndex is in last position then move the tab focus to first tab.
224
- * 3. Set the active tab and focus.
225
- * 4. Emit custom event.
226
- * @fires tabChange
227
- */
228
- setSelectedToNextTab(e) {
229
- const t = e.index;
230
- this.removePreviousActiveTab();
231
- const i = this._Cre8TabItems.length - 1;
232
- if (t === i)
233
- this.activeIndex = 0, this.activeTab = this._Cre8TabItems[0];
234
- else {
235
- const s = t + 1;
236
- this.activeIndex = s, this.activeTab = this._Cre8TabItems[s];
282
+ /**
283
+ * Handle Keydown
284
+ * 1. If the active tab is not focused then handle the keydown events.
285
+ * 2. On keydown of the right arrow, make the next tab active.
286
+ * 3. On keydown of the left arrow, make the previous tab active.
287
+ * 4. On keydown of the home key, make the first tab active.
288
+ * 5. On keydown of the end key, make the last tab active.
289
+ * 6. On keydown of the escape key, remove the focus.
290
+ * @fires keydown
291
+ */
292
+ handleKeydown(event) {
293
+ /* 1 */
294
+ const { target } = event;
295
+ const focused = document.activeElement;
296
+ if (!focused.matches('cre8-tab')) {
297
+ return;
298
+ }
299
+ switch (event.key) {
300
+ /* 2 */
301
+ case 'ArrowRight':
302
+ event.preventDefault();
303
+ this.setSelectedToNextTab(target);
304
+ break;
305
+ /* 3 */
306
+ case 'ArrowLeft':
307
+ event.preventDefault();
308
+ this.setSelectedToPreviousTab(target);
309
+ break;
310
+ /* 4 */
311
+ case 'Home':
312
+ event.preventDefault();
313
+ this.setSelectedToNextTab(this._Cre8TabItems[this._Cre8TabItems.length - 1]);
314
+ break;
315
+ /* 5 */
316
+ case 'End':
317
+ event.preventDefault();
318
+ this.setSelectedToPreviousTab(this._Cre8TabItems[0]);
319
+ break;
320
+ /* 6 */
321
+ case 'Escape':
322
+ this.activeTab.blur();
323
+ break;
324
+ default:
325
+ // no default
326
+ }
237
327
  }
238
- this.setActiveTab(), this.setActiveTabFocus(), this.emitEvent();
239
- }
240
- /**
241
- * Remove Active from Previous Tab
242
- * 1. Get current selected Tab index then deactivate previously selected tab
243
- * 2. If current activeIndex is in first position then move the tab focus to last tab
244
- */
245
- removePreviousActiveTab() {
246
- this.activeTab.isActive = !1;
247
- const e = this._Cre8TabPanels.find((t) => t.index === this.activeTab.index);
248
- e && (e.isActive = !1);
249
- }
250
- /**
251
- * Emit custom event
252
- */
253
- emitEvent() {
254
- const e = new CustomEvent("tabChange", {
255
- detail: {
256
- value: this.activeTab,
257
- activeTabIndex: this.activeIndex
258
- },
259
- bubbles: !0,
260
- composed: !0
261
- });
262
- this.dispatchEvent(e);
263
- }
264
- render() {
265
- const e = this.componentClassNames("cre8-c-tabs", {
266
- "cre8-is-start": this.isStart === !0,
267
- "cre8-is-end": this.isEnd === !0,
268
- "cre8-c-tabs--full-width": this.fullWidth
269
- });
270
- return f`
271
- <div class="${e}">
328
+ /**
329
+ * Set Selected To Previous Tab
330
+ * 1. Get current selected Tab index then deactivate previously selected tab.
331
+ * 2. If current activeIndex is in first position then move the tab focus to last tab.
332
+ * 3. Set the active tab and focus.
333
+ * 4. Emit custom event.
334
+ * @fires tabChange
335
+ */
336
+ setSelectedToPreviousTab(currentTab) {
337
+ /* 1 */
338
+ const activeIndex = currentTab.index;
339
+ this.removePreviousActiveTab();
340
+ /* 2 */
341
+ const tabListLength = this._Cre8TabItems.length - 1;
342
+ if (activeIndex === 0) {
343
+ this.activeIndex = tabListLength;
344
+ this.activeTab = this._Cre8TabItems[tabListLength];
345
+ }
346
+ else {
347
+ const previousIndex = activeIndex - 1;
348
+ this.activeIndex = previousIndex;
349
+ this.activeTab = this._Cre8TabItems[previousIndex];
350
+ }
351
+ /* 3 */
352
+ this.setActiveTab();
353
+ this.setActiveTabFocus();
354
+ /* 4 */
355
+ this.emitEvent();
356
+ }
357
+ /**
358
+ * Set Selected To Next Tab
359
+ * 1. Get current selected Tab index then deactivate previously selected tab.
360
+ * 2. If current activeIndex is in last position then move the tab focus to first tab.
361
+ * 3. Set the active tab and focus.
362
+ * 4. Emit custom event.
363
+ * @fires tabChange
364
+ */
365
+ setSelectedToNextTab(currentTab) {
366
+ /* 1 */
367
+ const activeIndex = currentTab.index;
368
+ this.removePreviousActiveTab();
369
+ /* 2 */
370
+ const tabListLength = this._Cre8TabItems.length - 1;
371
+ if (activeIndex === tabListLength) {
372
+ this.activeIndex = 0;
373
+ this.activeTab = this._Cre8TabItems[0];
374
+ }
375
+ else {
376
+ const nextIndex = activeIndex + 1;
377
+ this.activeIndex = nextIndex;
378
+ this.activeTab = this._Cre8TabItems[nextIndex];
379
+ }
380
+ /* 3 */
381
+ this.setActiveTab();
382
+ this.setActiveTabFocus();
383
+ /* 4 */
384
+ this.emitEvent();
385
+ }
386
+ /**
387
+ * Remove Active from Previous Tab
388
+ * 1. Get current selected Tab index then deactivate previously selected tab
389
+ * 2. If current activeIndex is in first position then move the tab focus to last tab
390
+ */
391
+ removePreviousActiveTab() {
392
+ /* 1 */
393
+ this.activeTab.isActive = false;
394
+ /* 2 */
395
+ const activeTabPanel = this._Cre8TabPanels.find((tabPanel) => tabPanel.index === this.activeTab.index);
396
+ if (activeTabPanel) {
397
+ activeTabPanel.isActive = false;
398
+ }
399
+ }
400
+ /**
401
+ * Emit custom event
402
+ */
403
+ emitEvent() {
404
+ const customEvent = new CustomEvent('tabChange', {
405
+ detail: {
406
+ value: this.activeTab,
407
+ activeTabIndex: this.activeIndex,
408
+ },
409
+ bubbles: true,
410
+ composed: true,
411
+ });
412
+ this.dispatchEvent(customEvent);
413
+ }
414
+ render() {
415
+ const componentClassNames = this.componentClassNames('cre8-c-tabs', {
416
+ 'cre8-is-start': this.isStart === true,
417
+ 'cre8-is-end': this.isEnd === true,
418
+ 'cre8-c-tabs--full-width': this.fullWidth,
419
+ });
420
+ return html `
421
+ <div class="${componentClassNames}">
272
422
  <div class="cre8-c-tabs__header">
273
423
  <div
274
424
  class="cre8-c-tabs__list"
@@ -286,42 +436,41 @@ const o = class o extends T {
286
436
  </div>
287
437
  </div>
288
438
  `;
289
- }
290
- };
291
- o.styles = [x];
292
- let a = o;
293
- r([
294
- d()
295
- ], a.prototype, "size");
296
- r([
297
- d({ type: Boolean, reflect: !0 })
298
- ], a.prototype, "fullWidth");
299
- r([
300
- d({ type: Number })
301
- ], a.prototype, "activeIndex");
302
- r([
303
- c()
304
- ], a.prototype, "activeTab");
305
- r([
306
- c()
307
- ], a.prototype, "isStart");
308
- r([
309
- c()
310
- ], a.prototype, "isEnd");
311
- r([
312
- v()
313
- ], a.prototype, "_Cre8TabItems");
314
- r([
315
- v({ slot: "panel" })
316
- ], a.prototype, "_Cre8TabPanels");
317
- r([
318
- m(".cre8-c-tabs__header")
319
- ], a.prototype, "_Cre8TabsHeader");
320
- r([
321
- m(".cre8-c-tabs__list")
322
- ], a.prototype, "_Cre8TabsHeaderList");
323
- customElements.get("cre8-tabs") === void 0 && customElements.define("cre8-tabs", a);
324
- export {
325
- a as Cre8Tabs,
326
- a as default
327
- };
439
+ }
440
+ }
441
+ Cre8Tabs.styles = [styles];
442
+ __decorate([
443
+ property()
444
+ ], Cre8Tabs.prototype, "size", void 0);
445
+ __decorate([
446
+ property({ type: Boolean, reflect: true })
447
+ ], Cre8Tabs.prototype, "fullWidth", void 0);
448
+ __decorate([
449
+ property({ type: Number })
450
+ ], Cre8Tabs.prototype, "activeIndex", void 0);
451
+ __decorate([
452
+ state()
453
+ ], Cre8Tabs.prototype, "activeTab", void 0);
454
+ __decorate([
455
+ state()
456
+ ], Cre8Tabs.prototype, "isStart", void 0);
457
+ __decorate([
458
+ state()
459
+ ], Cre8Tabs.prototype, "isEnd", void 0);
460
+ __decorate([
461
+ queryAssignedElements()
462
+ ], Cre8Tabs.prototype, "_Cre8TabItems", void 0);
463
+ __decorate([
464
+ queryAssignedElements({ slot: 'panel' })
465
+ ], Cre8Tabs.prototype, "_Cre8TabPanels", void 0);
466
+ __decorate([
467
+ query('.cre8-c-tabs__header')
468
+ ], Cre8Tabs.prototype, "_Cre8TabsHeader", void 0);
469
+ __decorate([
470
+ query('.cre8-c-tabs__list')
471
+ ], Cre8Tabs.prototype, "_Cre8TabsHeaderList", void 0);
472
+ if (customElements.get('cre8-tabs') === undefined) {
473
+ customElements.define('cre8-tabs', Cre8Tabs);
474
+ }
475
+ export default Cre8Tabs;
476
+ //# sourceMappingURL=tabs.js.map