@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,145 +1,251 @@
1
- import { css as u, html as c } from "lit";
2
- import { property as o, query as h } from "lit/decorators.js";
3
- import { nanoid as b } from "nanoid";
4
- import { ifDefined as f } from "lit/directives/if-defined.js";
5
- import { Cre8Element as m } from "../cre8-element.js";
6
- const g = u`*,::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:inline-flex}.cre8-c-tooltip{position:relative;display:table}.cre8-c-tooltip__panel{font-family:var(--cre8-typography-body-default-font-family);font-size:var(--cre8-typography-body-default-font-size);font-weight:var(--cre8-typography-body-default-font-weight);line-height:var(--cre8-typography-body-default-line-height);text-decoration:var(--cre8-typography-body-default-text-decoration);text-transform:var(--cre8-typography-body-default-text-transform);opacity:0;visibility:hidden;position:absolute;word-wrap:break-word;inset-block-start:calc(100% + 0.75rem);inset-block-end:auto;inset-inline-start:50%;inset-inline-end:auto;transform:translateX(var(--rtlTranslateX, -50%));display:flex;flex-direction:column;gap:0.5rem;width:max-content;max-width:17.5rem;z-index:400;color:var(--cre8-color-content-knockout);background-color:var(--cre8-color-bg-strong);border:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-radius:var(--cre8-border-radius-default);padding:0.5rem}.cre8-is-active:not(.cre8-is-dynamic) .cre8-c-tooltip__panel,.cre8-is-active.cre8-is-dynamic-active .cre8-c-tooltip__panel{opacity:1;visibility:visible}.cre8-c-tooltip--top .cre8-c-tooltip__panel{inset-block-start:auto;inset-block-end:calc(100% + 0.75rem);inset-inline-start:50%;inset-inline-end:auto;transform:translateX(var(--rtlTranslateX, -50%))}.cre8-c-tooltip--left .cre8-c-tooltip__panel{inset-block-start:50%;inset-block-end:auto;inset-inline-start:auto;inset-inline-end:calc(100% + 0.75rem);transform:translateY(-50%)}.cre8-c-tooltip--right .cre8-c-tooltip__panel{inset-block-start:50%;inset-block-end:auto;inset-inline-start:calc(100% + 0.75rem);inset-inline-end:auto;transform:translateY(-50%)}.cre8-c-tooltip--knockout .cre8-c-tooltip__panel{background-color:var(--cre8-color-bg-default);color:var(--cre8-color-content-default)}.cre8-c-tooltip__panel::before{content:"";display:block;width:0.75rem;height:0.75rem;position:absolute;margin:auto;background-color:var(--cre8-color-bg-strong);border-block-start:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-inline-start:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);inset-block-start:calc((var(--cre8-border-width-default) + 0.375rem)*-1);inset-inline-start:50%;transform:translateX(var(--rtlTranslateX, -50%)) rotate(45deg)}.cre8-c-tooltip--top .cre8-c-tooltip__panel::before{inset-block-start:auto;inset-block-end:calc((var(--cre8-border-width-default) + 0.375rem)*-1);border-block-start:none;border-inline-start:none;border-block-end:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-inline-end:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong)}.cre8-c-tooltip--left .cre8-c-tooltip__panel::before{inset-block-start:50%;inset-block-end:auto;inset-inline-start:auto;inset-inline-end:calc((var(--cre8-border-width-default) + 0.375rem)*-1);border-block-start:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-inline-start:none;border-block-end:none;border-inline-end:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);transform:translateY(-50%) rotate(var(--rtlRotate45Inverse, 45deg))}.cre8-c-tooltip--right .cre8-c-tooltip__panel::before{inset-block-start:50%;inset-block-end:auto;inset-inline-start:calc((var(--cre8-border-width-default) + 0.375rem)*-1);inset-inline-end:auto;border-block-start:none;border-inline-start:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-block-end:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-inline-end:none;transform:translateY(-50%) rotate(var(--rtlRotate45Inverse, 45deg))}.cre8-c-tooltip--knockout .cre8-c-tooltip__panel::before{background-color:var(--cre8-color-bg-default)}.cre8-c-tooltip__footer{display:flex;gap:1rem;justify-content:flex-end;flex-grow:1}.cre8-c-tooltip__trigger{cursor:pointer}.cre8-c-tooltip__trigger:focus-visible{outline:var(--cre8-border-width-focus) solid var(--cre8-color-border-active-outline);outline-offset:0.125rem}svg{display:flex;height:1rem;width:1rem}`;
7
- var v = Object.defineProperty, i = (d, t, e, s) => {
8
- for (var a = void 0, n = d.length - 1, p; n >= 0; n--)
9
- (p = d[n]) && (a = p(t, e, a) || a);
10
- return a && v(t, e, a), a;
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;
11
6
  };
12
- const l = class l extends m {
13
- constructor() {
14
- super(...arguments), this.iconRotateDegree = 0, this.removeActive = () => {
15
- this.isActive && this.toggleActive();
16
- };
17
- }
18
- /**
19
- * Query the document direction value
20
- * <br/><br/> _*This property is dynamically set_
21
- */
22
- get isRTL() {
23
- return document.dir === "rtl";
24
- }
25
- /**
26
- * updated Callback Lifecycle
27
- * 1. Find the second slot
28
- * 2. Create a string from joining the textContent of the textnodes
29
- * 3. Set the textContent of the tip generated in the firstUpdated lifecycle callback
30
- * */
31
- updated() {
32
- const t = this.shadowRoot.querySelectorAll("slot")[1].assignedNodes().reduce(
33
- ((e, s) => `${e}${s.textContent.replace(/\n/g, "").trim()}`),
34
- ""
35
- );
36
- document.getElementById(this._uniqueId) && (document.getElementById(this._uniqueId).textContent = t);
37
- }
38
- /**
39
- * firstUpdated Callback Lifecycle
40
- * 1. If ariaDescribes is set
41
- * a. create an ID and assign it to the property _uniqueId
42
- * b. Generate an empty div, assign it the _uniqueId and the tooltip role
43
- * 2. Set the aria-describedby on the ariaDescribes target
44
- */
45
- firstUpdated() {
46
- if (this.ariaDescribes) {
47
- this._uniqueId = this._uniqueId || b();
48
- const t = new RegExp(`\\b${this._uniqueId}\\b`), e = document.createElement("div");
49
- e.setAttribute("role", "tooltip"), e.setAttribute("style", "position:fixed; left: -1000px; top: -1000px;"), e.id = this._uniqueId;
50
- const s = document.getElementById(this.ariaDescribes);
51
- s.parentNode.insertBefore(e, s);
52
- const a = s?.getAttribute("aria-describedBy");
53
- s?.setAttribute(
54
- "aria-describedby",
55
- `${a ? `${a.replace(t, "")} ` : ""}${this._uniqueId}`.trim()
56
- );
7
+ import { html, } from 'lit';
8
+ import { property, query } from 'lit/decorators.js';
9
+ import { nanoid } from 'nanoid';
10
+ import { ifDefined } from 'lit/directives/if-defined.js';
11
+ import { Cre8Element } from '../cre8-element';
12
+ import styles from './tooltip.styles.js';
13
+ /**
14
+ * The purpose of tooltips is to provide a tip or hint about what a tool, icon, link, or other interaction does.
15
+ * If you need to present a call to action with perhaps a button for the user to click, then use
16
+ * [Popover](/docs/cre8-components-popover--docs) instead.
17
+ *
18
+ * ##Tooltip Styles
19
+ * There are 4 alignment options for Tooltips: Top, Bottom, Right, and Left. Default placement is Bottom, below the
20
+ * element it is describing. Top or Bottom alignment are the the preferred placement, particularly on screens that
21
+ * have a more narrow viewport. Tooltips utilize Global styles and are not affected by brand themes.
22
+ *
23
+ * **With icon**
24
+ * - **iconRotateDegree** & **iconFlipDirection** props are optional.
25
+ * - They are used to set up the correct dirrection for icons, for example,
26
+ * arrows, caret up or caret down.
27
+ *
28
+ * ##Usability Considerations
29
+ * With the exception of icons - which should always have alt text at a minimum - the UI should never rely on
30
+ * Tooltips for clarity, especially because they are not always discovered by the user. If the user cannot
31
+ * intuitively understand the interface without Tooltips, the interface should be redesigned.
32
+ *
33
+ * ##How to use
34
+ * - Use Tooltips to clarify the UI element the user is interacting with, not to add additional content on the page.
35
+ * Also, do not simply restate content on the page, for example, the title of the field.
36
+ * - Tooltips should be short and to the point. Example: "Click X to do X" or "Icon Description." If a succinct
37
+ * description is not possible, the interaction element should be redesigned.
38
+ * - In a mouse-driven UI, Tooltips are triggered on hover (mouseover) and dismissed (disappear)
39
+ * when the user mouses away from the element. In touch UIs, a Tooltip is triggered by tapping
40
+ * and holding an item. The Tooltip is displayed as long as the user continues to hold the element.
41
+ * Tap and hold is a more advanced user behavior, and further reason for not relying on Tooltips.
42
+ * A novice user may never discover tap and hold for Tooltips.
43
+ *
44
+ * @slot default - Default, unnamed slot container for Tooltip text
45
+ * @slot trigger - Named slot container for Tooltip element to trigger showing/hiding the Tooltip text
46
+ */
47
+ export class Cre8Tooltip extends Cre8Element {
48
+ constructor() {
49
+ super(...arguments);
50
+ /**
51
+ * iconRotateDegree is used for <cre8-icon> to set the arrow in the correct direction
52
+ */
53
+ this.iconRotateDegree = 0;
54
+ /**
55
+ * Remove Active State
56
+ * 1. If a specific event is fired, remove the active state.
57
+ */
58
+ this.removeActive = () => {
59
+ if (this.isActive) {
60
+ this.toggleActive();
61
+ }
62
+ };
57
63
  }
58
- }
59
- /**
60
- * Connected Callback Lifecycle
61
- * 1. Add window mouseover event listener
62
- * 2. Add window mouseout event listener
63
- * 3. Add mousedown event listener
64
- * 4. Set the id and aria-describedby
65
- */
66
- connectedCallback() {
67
- super.connectedCallback(), this.addEventListener("mouseover", this.toggleActive), this.addEventListener("mouseout", this.removeActive);
68
- }
69
- /**
70
- * Disconnected Callback Lifecycle
71
- * 1. Remove window mouseover event listener
72
- * 2. Remove window mouseout event listener
73
- */
74
- disconnectedCallback() {
75
- super.disconnectedCallback(), this.removeEventListener("mouseover", this.toggleActive), this.removeEventListener("mouseout", this.removeActive);
76
- }
77
- /**
78
- * Handle all dynamic placement
79
- */
80
- dynamicPosition() {
81
- if (this.isDynamic && this._Cre8TooltipPanel) {
82
- const t = document.querySelector("body").getBoundingClientRect(), e = this._Cre8TooltipPanel.getBoundingClientRect(), s = this._Cre8Tooltip.clientHeight + e.height + e.top;
83
- e.left < 0 && (this.position = this.isRTL ? "left" : "right"), e.right >= t.width && (this.position = this.isRTL ? "right" : "left"), e.top < 0 && e.left > 0 && e.right < t.width && (this.position = null), s >= window.innerHeight && e.bottom >= window.innerHeight && e.left >= 0 && e.right <= t.width && (this.position = "top");
64
+ /**
65
+ * Query the document direction value
66
+ * <br/><br/> _*This property is dynamically set_
67
+ */
68
+ get isRTL() {
69
+ return document.dir === 'rtl';
84
70
  }
85
- }
86
- /**
87
- * Handle Keydown
88
- * 1. If escape or tab key is struck when the tooltip is active, close it
89
- * 2. If enter or escape is keyed, toggle the tooltip open or close.
90
- * We need these since the click event is on a div so that accessibility reads this aloud to a user
91
- */
92
- _handleKeydown(t) {
93
- this.isActive && (t.code === "Escape" || t.code === "Tab") && this.toggleActive(), (t.code === "Enter" || t.code === "Space") && this.toggleActive();
94
- }
95
- /**
96
- * Set Tooltip Active State
97
- * 1. Toggle the active state between true and false
98
- * 2. If is active, set the dynamic position and custom event.
99
- * 3. If is not active, remove fire the close custom event.
100
- * 4. Toggle the active state for dynamic. This prevents a flash of the tooltip in the orginal position.
101
- */
102
- toggleActive() {
103
- this.isActive = !this.isActive, this.isActive ? (setTimeout(() => {
104
- this.dynamicPosition();
105
- }, 1), this.dispatchEvent(new CustomEvent("open", {
106
- detail: { isActive: this.isActive },
107
- bubbles: !0,
108
- composed: !0
109
- }))) : this.dispatchEvent(new CustomEvent("close", {
110
- detail: { isActive: this.isActive },
111
- bubbles: !0,
112
- composed: !0
113
- })), setTimeout(() => {
114
- this.isActive && this.isDynamic ? this.isActiveDynamic = !0 : this.isActiveDynamic = !1;
115
- }, 2);
116
- }
117
- render() {
118
- const t = this.componentClassNames("cre8-c-tooltip", {
119
- "cre8-c-tooltip--top": this.position === "top",
120
- "cre8-c-tooltip--left": this.position === "left",
121
- "cre8-c-tooltip--right": this.position === "right",
122
- "cre8-c-tooltip--knockout": this.knockout,
123
- "cre8-is-active": this.isActive,
124
- "cre8-is-dynamic": this.isDynamic,
125
- "cre8-is-dynamic-active": this.isActiveDynamic
126
- });
127
- return c`
128
- <div class="${t}">
71
+ /**
72
+ * updated Callback Lifecycle
73
+ * 1. Find the second slot
74
+ * 2. Create a string from joining the textContent of the textnodes
75
+ * 3. Set the textContent of the tip generated in the firstUpdated lifecycle callback
76
+ * */
77
+ updated() {
78
+ /* 1 & 2 */
79
+ const tipContent = this.shadowRoot.querySelectorAll('slot')[1]
80
+ .assignedNodes()
81
+ .reduce(((str, item) => `${str}${item.textContent.replace(/\n/g, '').trim()}`), '');
82
+ /* 3 */
83
+ if (document.getElementById(this._uniqueId)) {
84
+ document.getElementById(this._uniqueId).textContent = tipContent;
85
+ }
86
+ }
87
+ /**
88
+ * firstUpdated Callback Lifecycle
89
+ * 1. If ariaDescribes is set
90
+ * a. create an ID and assign it to the property _uniqueId
91
+ * b. Generate an empty div, assign it the _uniqueId and the tooltip role
92
+ * 2. Set the aria-describedby on the ariaDescribes target
93
+ */
94
+ firstUpdated() {
95
+ if (this.ariaDescribes) { /* 1 */
96
+ this._uniqueId = this._uniqueId || nanoid(); /* 1.a */
97
+ const idMatcher = new RegExp(`\\b${this._uniqueId}\\b`); // prevents dupes from reconnects below
98
+ /* 1.b */
99
+ const a11yProxy = document.createElement('div');
100
+ a11yProxy.setAttribute('role', 'tooltip');
101
+ a11yProxy.setAttribute('style', 'position:fixed; left: -1000px; top: -1000px;');
102
+ a11yProxy.id = this._uniqueId;
103
+ const describedEl = document.getElementById(this.ariaDescribes);
104
+ describedEl.parentNode.insertBefore(a11yProxy, describedEl);
105
+ const idList = describedEl?.getAttribute('aria-describedBy');
106
+ /* 2 */
107
+ describedEl?.setAttribute('aria-describedby', `${idList ? `${idList.replace(idMatcher, '')} ` : ''}${this._uniqueId}`.trim());
108
+ }
109
+ }
110
+ /**
111
+ * Connected Callback Lifecycle
112
+ * 1. Add window mouseover event listener
113
+ * 2. Add window mouseout event listener
114
+ * 3. Add mousedown event listener
115
+ * 4. Set the id and aria-describedby
116
+ */
117
+ connectedCallback() {
118
+ super.connectedCallback();
119
+ this.addEventListener('mouseover', this.toggleActive); /* 1 */
120
+ this.addEventListener('mouseout', this.removeActive); /* 2 */
121
+ }
122
+ /**
123
+ * Disconnected Callback Lifecycle
124
+ * 1. Remove window mouseover event listener
125
+ * 2. Remove window mouseout event listener
126
+ */
127
+ disconnectedCallback() {
128
+ super.disconnectedCallback();
129
+ this.removeEventListener('mouseover', this.toggleActive); /* 1 */
130
+ this.removeEventListener('mouseout', this.removeActive); /* 2 */
131
+ }
132
+ /**
133
+ * Handle all dynamic placement
134
+ */
135
+ dynamicPosition() {
136
+ // TODO: Temporarily keep eslint complexity as warning. Update during specific story for this rule.
137
+ /* eslint complexity: ["warn", 10] */
138
+ if (this.isDynamic && this._Cre8TooltipPanel) {
139
+ const body = document.querySelector('body').getBoundingClientRect();
140
+ const tooltipPanel = this._Cre8TooltipPanel.getBoundingClientRect();
141
+ const tooltipHeight = this._Cre8Tooltip.clientHeight + tooltipPanel.height + tooltipPanel.top;
142
+ /**
143
+ * If tooltip panel breaks out the left side of the window, position it to the right
144
+ */
145
+ if (tooltipPanel.left < 0) {
146
+ this.position = this.isRTL ? 'left' : 'right';
147
+ }
148
+ /**
149
+ * If tooltip panel breaks out the right side of the window, position it to the left
150
+ */
151
+ if (tooltipPanel.right >= body.width) {
152
+ this.position = this.isRTL ? 'right' : 'left';
153
+ }
154
+ /**
155
+ * If tooltip panel breaks out the top side of the window only, position it to the bottom center
156
+ */
157
+ if (tooltipPanel.top < 0 && tooltipPanel.left > 0 && tooltipPanel.right < body.width) {
158
+ this.position = null;
159
+ }
160
+ /**
161
+ * If tooltip panel breaks out the bottom side of the window only, position it to the top center
162
+ */
163
+ if (tooltipHeight >= window.innerHeight
164
+ && tooltipPanel.bottom >= window.innerHeight
165
+ && tooltipPanel.left >= 0
166
+ && tooltipPanel.right <= body.width) {
167
+ this.position = 'top';
168
+ }
169
+ }
170
+ }
171
+ /**
172
+ * Handle Keydown
173
+ * 1. If escape or tab key is struck when the tooltip is active, close it
174
+ * 2. If enter or escape is keyed, toggle the tooltip open or close.
175
+ * We need these since the click event is on a div so that accessibility reads this aloud to a user
176
+ */
177
+ _handleKeydown(e) {
178
+ if (this.isActive) {
179
+ if (e.code === 'Escape' || e.code === 'Tab') {
180
+ this.toggleActive(); /* 1 */
181
+ }
182
+ }
183
+ if (e.code === 'Enter' || e.code === 'Space') {
184
+ this.toggleActive(); /* 2 */
185
+ }
186
+ }
187
+ /**
188
+ * Set Tooltip Active State
189
+ * 1. Toggle the active state between true and false
190
+ * 2. If is active, set the dynamic position and custom event.
191
+ * 3. If is not active, remove fire the close custom event.
192
+ * 4. Toggle the active state for dynamic. This prevents a flash of the tooltip in the orginal position.
193
+ */
194
+ toggleActive() {
195
+ this.isActive = !this.isActive; /* 1 */
196
+ if (this.isActive) {
197
+ /* 2 */
198
+ setTimeout(() => {
199
+ this.dynamicPosition();
200
+ }, 1);
201
+ this.dispatchEvent(new CustomEvent('open', {
202
+ detail: { isActive: this.isActive }, bubbles: true, composed: true,
203
+ }));
204
+ }
205
+ else {
206
+ /* 3 */
207
+ this.dispatchEvent(new CustomEvent('close', {
208
+ detail: { isActive: this.isActive }, bubbles: true, composed: true,
209
+ }));
210
+ }
211
+ /* 4 */
212
+ setTimeout(() => {
213
+ if (this.isActive && this.isDynamic) {
214
+ this.isActiveDynamic = true;
215
+ }
216
+ else {
217
+ this.isActiveDynamic = false;
218
+ }
219
+ }, 2);
220
+ }
221
+ render() {
222
+ const componentClassNames = this.componentClassNames('cre8-c-tooltip', {
223
+ 'cre8-c-tooltip--top': this.position === 'top',
224
+ 'cre8-c-tooltip--left': this.position === 'left',
225
+ 'cre8-c-tooltip--right': this.position === 'right',
226
+ 'cre8-c-tooltip--knockout': this.knockout,
227
+ 'cre8-is-active': this.isActive,
228
+ 'cre8-is-dynamic': this.isDynamic,
229
+ 'cre8-is-dynamic-active': this.isActiveDynamic,
230
+ });
231
+ return html `
232
+ <div class="${componentClassNames}">
129
233
  <div
130
234
  class="cre8-c-tooltip__trigger"
131
235
  tabindex="0"
132
236
  @focus=${this.toggleActive}
133
237
  @keydown=${this._handleKeydown}
134
238
  >
135
- ${this.svg ? c`
239
+ ${this.svg
240
+ ? html `
136
241
  <slot name="trigger">
137
242
  <cre8-icon svg='${this.svg}' rotate="${Number(this.iconRotateDegree)}"
138
243
  flip="${this.iconFlipDirection}" aria-hidden="true"></cre8-icon>
139
- </slot>` : c`<slot name="trigger"></slot>`}
244
+ </slot>`
245
+ : html `<slot name="trigger"></slot>`}
140
246
  </div>
141
247
  <dialog
142
- id=${f(this._uniqueId)}
248
+ id=${ifDefined(this._uniqueId)}
143
249
  aria-labelledby=${this.ariaDescribes}
144
250
  class="cre8-c-tooltip__panel"
145
251
  role="tooltip">
@@ -147,48 +253,47 @@ const l = class l extends m {
147
253
  </dialog>
148
254
  </div>
149
255
  `;
150
- }
151
- };
152
- l.styles = [g];
153
- let r = l;
154
- i([
155
- o()
156
- ], r.prototype, "position");
157
- i([
158
- o({ type: Boolean, reflect: !0 })
159
- ], r.prototype, "knockout");
160
- i([
161
- o({ type: Boolean, reflect: !0 })
162
- ], r.prototype, "isDynamic");
163
- i([
164
- o({ type: Boolean })
165
- ], r.prototype, "isActiveDynamic");
166
- i([
167
- o({ type: Boolean, reflect: !0 })
168
- ], r.prototype, "isActive");
169
- i([
170
- o({ type: String })
171
- ], r.prototype, "ariaDescribes");
172
- i([
173
- o({ type: String })
174
- ], r.prototype, "_uniqueId");
175
- i([
176
- o()
177
- ], r.prototype, "svg");
178
- i([
179
- o({ type: Number })
180
- ], r.prototype, "iconRotateDegree");
181
- i([
182
- o()
183
- ], r.prototype, "iconFlipDirection");
184
- i([
185
- h(".cre8-c-tooltip")
186
- ], r.prototype, "_Cre8Tooltip");
187
- i([
188
- h(".cre8-c-tooltip__panel")
189
- ], r.prototype, "_Cre8TooltipPanel");
190
- customElements.get("cre8-tooltip") === void 0 && customElements.define("cre8-tooltip", r);
191
- export {
192
- r as Cre8Tooltip,
193
- r as default
194
- };
256
+ }
257
+ }
258
+ Cre8Tooltip.styles = [styles];
259
+ __decorate([
260
+ property()
261
+ ], Cre8Tooltip.prototype, "position", void 0);
262
+ __decorate([
263
+ property({ type: Boolean, reflect: true })
264
+ ], Cre8Tooltip.prototype, "knockout", void 0);
265
+ __decorate([
266
+ property({ type: Boolean, reflect: true })
267
+ ], Cre8Tooltip.prototype, "isDynamic", void 0);
268
+ __decorate([
269
+ property({ type: Boolean })
270
+ ], Cre8Tooltip.prototype, "isActiveDynamic", void 0);
271
+ __decorate([
272
+ property({ type: Boolean, reflect: true })
273
+ ], Cre8Tooltip.prototype, "isActive", void 0);
274
+ __decorate([
275
+ property({ type: String })
276
+ ], Cre8Tooltip.prototype, "ariaDescribes", void 0);
277
+ __decorate([
278
+ property({ type: String })
279
+ ], Cre8Tooltip.prototype, "_uniqueId", void 0);
280
+ __decorate([
281
+ property()
282
+ ], Cre8Tooltip.prototype, "svg", void 0);
283
+ __decorate([
284
+ property({ type: Number })
285
+ ], Cre8Tooltip.prototype, "iconRotateDegree", void 0);
286
+ __decorate([
287
+ property()
288
+ ], Cre8Tooltip.prototype, "iconFlipDirection", void 0);
289
+ __decorate([
290
+ query('.cre8-c-tooltip')
291
+ ], Cre8Tooltip.prototype, "_Cre8Tooltip", void 0);
292
+ __decorate([
293
+ query('.cre8-c-tooltip__panel')
294
+ ], Cre8Tooltip.prototype, "_Cre8TooltipPanel", void 0);
295
+ if (customElements.get('cre8-tooltip') === undefined) {
296
+ customElements.define('cre8-tooltip', Cre8Tooltip);
297
+ }
298
+ export default Cre8Tooltip;
299
+ //# sourceMappingURL=tooltip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../../components/tooltip/tooltip.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,GAAI,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,MAAM,OAAO,WAAY,SAAQ,WAAW;IAA5C;;QAsEE;;WAEG;QAEC,qB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,OAAO,EAAE,IAAI,EAAE,CAAC;6CACpB;AAQnB;IADH,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDACA;AAGvB;IADH,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CACJ;AAQnB;IADH,QAAQ,EAAE;wCACM;AAMb;IADH,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDACO;AAM9B;IADH,QAAQ,EAAE;sDACoB;AAM3B;IADH,KAAK,CAAC,iBAAiB,CAAC;iDACK;AAM1B;IADH,KAAK,CAAC,wBAAwB,CAAC;sDACG;AAqOrC,IAAI,cAAc,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,SAAS,EAAE,CAAC;IACnD,cAAc,CAAC,MAAM,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;AACvD,CAAC;AAQD,eAAe,WAAW,CAAC","sourcesContent":["import { html, } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { nanoid } from 'nanoid';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { Cre8Element } from '../cre8-element';\nimport styles from './tooltip.styles.js';\n\n/**\n * The purpose of tooltips is to provide a tip or hint about what a tool, icon, link, or other interaction does.\n * If you need to present a call to action with perhaps a button for the user to click, then use\n * [Popover](/docs/cre8-components-popover--docs) instead.\n *\n * ##Tooltip Styles\n * There are 4 alignment options for Tooltips: Top, Bottom, Right, and Left. Default placement is Bottom, below the\n * element it is describing. Top or Bottom alignment are the the preferred placement, particularly on screens that\n * have a more narrow viewport. Tooltips utilize Global styles and are not affected by brand themes.\n *\n * **With icon**\n * - **iconRotateDegree** & **iconFlipDirection** props are optional.\n * - They are used to set up the correct dirrection for icons, for example,\n * arrows, caret up or caret down.\n *\n * ##Usability Considerations\n * With the exception of icons - which should always have alt text at a minimum - the UI should never rely on\n * Tooltips for clarity, especially because they are not always discovered by the user. If the user cannot\n * intuitively understand the interface without Tooltips, the interface should be redesigned.\n *\n * ##How to use\n * - Use Tooltips to clarify the UI element the user is interacting with, not to add additional content on the page.\n * Also, do not simply restate content on the page, for example, the title of the field.\n * - Tooltips should be short and to the point. Example: \"Click X to do X\" or \"Icon Description.\" If a succinct\n * description is not possible, the interaction element should be redesigned.\n * - In a mouse-driven UI, Tooltips are triggered on hover (mouseover) and dismissed (disappear)\n * when the user mouses away from the element. In touch UIs, a Tooltip is triggered by tapping\n * and holding an item. The Tooltip is displayed as long as the user continues to hold the element.\n * Tap and hold is a more advanced user behavior, and further reason for not relying on Tooltips.\n * A novice user may never discover tap and hold for Tooltips.\n *\n * @slot default - Default, unnamed slot container for Tooltip text\n * @slot trigger - Named slot container for Tooltip element to trigger showing/hiding the Tooltip text\n */\n\nexport class Cre8Tooltip extends Cre8Element {\n static styles = [styles];\n\n /**\n * Positions the tooltip panel absolutely to the icon. Position overrides `isDynamic`.\n * @type {\"default\"|\"top\"|\"left\"|\"right\"}\n * @attr {string}\n * - **default** positions the tooltip panel below the trigger element\n * - **top** positions the tooltip panel above the trigger element\n * - **left** positions the tooltip panel left of the trigger element\n * - **right** positions the tooltip panel right of the trigger element\n */\n @property()\n position?: 'top' | 'left' | 'right';\n\n /**\n * The knockout variant for the tooltip\n * @attr {boolean}\n * 1. If is true, the tooltip background is white\n * 2. If is false, the tooltip background is gray\n */\n @property({ type: Boolean, reflect: true })\n knockout?: boolean;\n\n /**\n * The dynamic state for the tooltip. Position overrides isDynamic.\n * @attr {boolean}\n * - If true, the tooltip panel placement is determined by its position in the viewport\n * - If false, the tooltip panel placement will be placed according to the position value\n */\n @property({ type: Boolean, reflect: true })\n isDynamic?: boolean;\n\n /**\n * The dynamic active state\n * @attr {boolean}\n * <br/><br/> _*This property is dynamically set_\n */\n @property({ type: Boolean })\n isActiveDynamic?: boolean;\n\n /**\n * The active state for the tooltip\n * @attr {boolean}\n * - If true, the tooltip panel is visible\n * - If false, the tooltip panel is hidden\n * <br/><br/> _*This property is dynamically set_\n */\n @property({ type: Boolean, reflect: true })\n isActive?: boolean;\n\n /**\n * Accepts the ID string of the item the tooltip is referencing\n * @attr {string}\n * Dynmically appends its own ID to the aria-describedby attribute on the referenced element\n */\n @property({ type: String })\n ariaDescribes?: string;\n\n @property({ type: String })\n _uniqueId?: string;\n\n /**\n * svg as a raw string\n * - The icon is defined by this prop.\n * - Pass in a raw svg as a String for using <cre8-icon>\n */\n @property()\n svg?: string;\n\n /**\n * iconRotateDegree is used for <cre8-icon> to set the arrow in the correct direction\n */\n @property({ type: Number })\n iconRotateDegree?: number = 0;\n\n /**\n * iconFlipDirection is used for <cre8-icon> to set the icon in the correct direction\n */\n @property()\n iconFlipDirection?: string;\n\n /**\n * Query the tooltip panel element\n */\n @query('.cre8-c-tooltip')\n _Cre8Tooltip: HTMLElement;\n\n /**\n * Query the tooltip panel element\n */\n @query('.cre8-c-tooltip__panel')\n _Cre8TooltipPanel: HTMLElement;\n\n /**\n * Query the document direction value\n * <br/><br/> _*This property is dynamically set_\n */\n get isRTL() {\n return document.dir === 'rtl';\n }\n\n /**\n * updated Callback Lifecycle\n * 1. Find the second slot\n * 2. Create a string from joining the textContent of the textnodes\n * 3. Set the textContent of the tip generated in the firstUpdated lifecycle callback\n * */\n updated() {\n /* 1 & 2 */\n const tipContent = this.shadowRoot.querySelectorAll('slot')[1]\n .assignedNodes()\n .reduce(\n ((str, item) => `${str}${item.textContent.replace(/\\n/g, '').trim()}`),\n ''\n );\n /* 3 */\n if (document.getElementById(this._uniqueId)) {\n document.getElementById(this._uniqueId).textContent = tipContent;\n }\n }\n\n /**\n * firstUpdated Callback Lifecycle\n * 1. If ariaDescribes is set\n * a. create an ID and assign it to the property _uniqueId\n * b. Generate an empty div, assign it the _uniqueId and the tooltip role\n * 2. Set the aria-describedby on the ariaDescribes target\n */\n firstUpdated() {\n if (this.ariaDescribes) { /* 1 */\n this._uniqueId = this._uniqueId || nanoid(); /* 1.a */\n const idMatcher = new RegExp(`\\\\b${this._uniqueId}\\\\b`); // prevents dupes from reconnects below\n /* 1.b */\n const a11yProxy = document.createElement('div');\n a11yProxy.setAttribute('role', 'tooltip');\n a11yProxy.setAttribute('style', 'position:fixed; left: -1000px; top: -1000px;');\n a11yProxy.id = this._uniqueId;\n const describedEl = document.getElementById(this.ariaDescribes);\n describedEl.parentNode.insertBefore(a11yProxy, describedEl);\n const idList = describedEl?.getAttribute('aria-describedBy');\n /* 2 */\n describedEl?.setAttribute(\n 'aria-describedby',\n `${idList ? `${idList.replace(idMatcher, '')} ` : ''}${this._uniqueId}`.trim()\n );\n }\n }\n\n /**\n * Connected Callback Lifecycle\n * 1. Add window mouseover event listener\n * 2. Add window mouseout event listener\n * 3. Add mousedown event listener\n * 4. Set the id and aria-describedby\n */\n connectedCallback() {\n super.connectedCallback();\n this.addEventListener('mouseover', this.toggleActive); /* 1 */\n this.addEventListener('mouseout', this.removeActive); /* 2 */\n }\n\n /**\n * Disconnected Callback Lifecycle\n * 1. Remove window mouseover event listener\n * 2. Remove window mouseout event listener\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('mouseover', this.toggleActive); /* 1 */\n this.removeEventListener('mouseout', this.removeActive); /* 2 */\n }\n\n /**\n * Handle all dynamic placement\n */\n dynamicPosition() {\n // TODO: Temporarily keep eslint complexity as warning. Update during specific story for this rule.\n /* eslint complexity: [\"warn\", 10] */\n if (this.isDynamic && this._Cre8TooltipPanel) {\n const body = document.querySelector('body').getBoundingClientRect();\n const tooltipPanel = this._Cre8TooltipPanel.getBoundingClientRect();\n const tooltipHeight = this._Cre8Tooltip.clientHeight + tooltipPanel.height + tooltipPanel.top;\n\n /**\n * If tooltip panel breaks out the left side of the window, position it to the right\n */\n if (tooltipPanel.left < 0) {\n this.position = this.isRTL ? 'left' : 'right';\n }\n\n /**\n * If tooltip panel breaks out the right side of the window, position it to the left\n */\n if (tooltipPanel.right >= body.width) {\n this.position = this.isRTL ? 'right' : 'left';\n }\n\n /**\n * If tooltip panel breaks out the top side of the window only, position it to the bottom center\n */\n if (tooltipPanel.top < 0 && tooltipPanel.left > 0 && tooltipPanel.right < body.width) {\n this.position = null;\n }\n\n /**\n * If tooltip panel breaks out the bottom side of the window only, position it to the top center\n */\n if (\n tooltipHeight >= window.innerHeight\n && tooltipPanel.bottom >= window.innerHeight\n && tooltipPanel.left >= 0\n && tooltipPanel.right <= body.width\n ) {\n this.position = 'top';\n }\n }\n }\n\n /**\n * Handle Keydown\n * 1. If escape or tab key is struck when the tooltip is active, close it\n * 2. If enter or escape is keyed, toggle the tooltip open or close.\n * We need these since the click event is on a div so that accessibility reads this aloud to a user\n */\n private _handleKeydown(e: KeyboardEvent) {\n if (this.isActive) {\n if (e.code === 'Escape' || e.code === 'Tab') {\n this.toggleActive(); /* 1 */\n }\n }\n if (e.code === 'Enter' || e.code === 'Space') {\n this.toggleActive(); /* 2 */\n }\n }\n\n /**\n * Set Tooltip Active State\n * 1. Toggle the active state between true and false\n * 2. If is active, set the dynamic position and custom event.\n * 3. If is not active, remove fire the close custom event.\n * 4. Toggle the active state for dynamic. This prevents a flash of the tooltip in the orginal position.\n */\n toggleActive() {\n this.isActive = !this.isActive; /* 1 */\n\n if (this.isActive) {\n /* 2 */\n setTimeout(() => {\n this.dynamicPosition();\n }, 1);\n this.dispatchEvent(new CustomEvent('open', {\n detail: { isActive: this.isActive }, bubbles: true, composed: true,\n }));\n } else {\n /* 3 */\n this.dispatchEvent(new CustomEvent('close', {\n detail: { isActive: this.isActive }, bubbles: true, composed: true,\n }));\n }\n\n /* 4 */\n setTimeout(() => {\n if (this.isActive && this.isDynamic) {\n this.isActiveDynamic = true;\n } else {\n this.isActiveDynamic = false;\n }\n }, 2);\n }\n\n /**\n * Remove Active State\n * 1. If a specific event is fired, remove the active state.\n */\n removeActive = () => {\n if (this.isActive) {\n this.toggleActive();\n }\n };\n\n render() {\n const componentClassNames = this.componentClassNames('cre8-c-tooltip', {\n 'cre8-c-tooltip--top': this.position === 'top',\n 'cre8-c-tooltip--left': this.position === 'left',\n 'cre8-c-tooltip--right': this.position === 'right',\n 'cre8-c-tooltip--knockout': this.knockout,\n 'cre8-is-active': this.isActive,\n 'cre8-is-dynamic': this.isDynamic,\n 'cre8-is-dynamic-active': this.isActiveDynamic,\n });\n\n return html`\n <div class=\"${componentClassNames}\">\n <div \n class=\"cre8-c-tooltip__trigger\"\n tabindex=\"0\"\n @focus=${this.toggleActive}\n @keydown=${this._handleKeydown}\n >\n ${this.svg\n ? html`\n <slot name=\"trigger\">\n <cre8-icon svg='${this.svg}' rotate=\"${Number(this.iconRotateDegree)}\" \n flip=\"${this.iconFlipDirection}\" aria-hidden=\"true\"></cre8-icon>\n </slot>`\n : html`<slot name=\"trigger\"></slot>`\n}\n </div>\n <dialog\n id=${ifDefined(this._uniqueId)}\n aria-labelledby=${this.ariaDescribes}\n class=\"cre8-c-tooltip__panel\"\n role=\"tooltip\">\n <slot></slot>\n </dialog>\n </div>\n `;\n }\n}\n\nif (customElements.get('cre8-tooltip') === undefined) {\n customElements.define('cre8-tooltip', Cre8Tooltip);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'cre8-tooltip': Cre8Tooltip;\n }\n}\n\nexport default Cre8Tooltip;\n"]}
@@ -0,0 +1,4 @@
1
+ import { css } from 'lit';
2
+ const styles = css `*,::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:inline-flex}.cre8-c-tooltip{position:relative;display:table}.cre8-c-tooltip__panel{font-family:var(--cre8-typography-body-default-font-family);font-size:var(--cre8-typography-body-default-font-size);font-weight:var(--cre8-typography-body-default-font-weight);line-height:var(--cre8-typography-body-default-line-height);text-decoration:var(--cre8-typography-body-default-text-decoration);text-transform:var(--cre8-typography-body-default-text-transform);opacity:0;visibility:hidden;position:absolute;word-wrap:break-word;inset-block-start:calc(100% + 0.75rem);inset-block-end:auto;inset-inline-start:50%;inset-inline-end:auto;transform:translateX(var(--rtlTranslateX, -50%));display:flex;flex-direction:column;gap:0.5rem;width:max-content;max-width:17.5rem;z-index:400;color:var(--cre8-color-content-knockout);background-color:var(--cre8-color-bg-strong);border:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-radius:var(--cre8-border-radius-default);padding:0.5rem}.cre8-is-active:not(.cre8-is-dynamic) .cre8-c-tooltip__panel,.cre8-is-active.cre8-is-dynamic-active .cre8-c-tooltip__panel{opacity:1;visibility:visible}.cre8-c-tooltip--top .cre8-c-tooltip__panel{inset-block-start:auto;inset-block-end:calc(100% + 0.75rem);inset-inline-start:50%;inset-inline-end:auto;transform:translateX(var(--rtlTranslateX, -50%))}.cre8-c-tooltip--left .cre8-c-tooltip__panel{inset-block-start:50%;inset-block-end:auto;inset-inline-start:auto;inset-inline-end:calc(100% + 0.75rem);transform:translateY(-50%)}.cre8-c-tooltip--right .cre8-c-tooltip__panel{inset-block-start:50%;inset-block-end:auto;inset-inline-start:calc(100% + 0.75rem);inset-inline-end:auto;transform:translateY(-50%)}.cre8-c-tooltip--knockout .cre8-c-tooltip__panel{background-color:var(--cre8-color-bg-default);color:var(--cre8-color-content-default)}.cre8-c-tooltip__panel::before{content:"";display:block;width:0.75rem;height:0.75rem;position:absolute;margin:auto;background-color:var(--cre8-color-bg-strong);border-block-start:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-inline-start:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);inset-block-start:calc((var(--cre8-border-width-default) + 0.375rem)*-1);inset-inline-start:50%;transform:translateX(var(--rtlTranslateX, -50%)) rotate(45deg)}.cre8-c-tooltip--top .cre8-c-tooltip__panel::before{inset-block-start:auto;inset-block-end:calc((var(--cre8-border-width-default) + 0.375rem)*-1);border-block-start:none;border-inline-start:none;border-block-end:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-inline-end:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong)}.cre8-c-tooltip--left .cre8-c-tooltip__panel::before{inset-block-start:50%;inset-block-end:auto;inset-inline-start:auto;inset-inline-end:calc((var(--cre8-border-width-default) + 0.375rem)*-1);border-block-start:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-inline-start:none;border-block-end:none;border-inline-end:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);transform:translateY(-50%) rotate(var(--rtlRotate45Inverse, 45deg))}.cre8-c-tooltip--right .cre8-c-tooltip__panel::before{inset-block-start:50%;inset-block-end:auto;inset-inline-start:calc((var(--cre8-border-width-default) + 0.375rem)*-1);inset-inline-end:auto;border-block-start:none;border-inline-start:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-block-end:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-inline-end:none;transform:translateY(-50%) rotate(var(--rtlRotate45Inverse, 45deg))}.cre8-c-tooltip--knockout .cre8-c-tooltip__panel::before{background-color:var(--cre8-color-bg-default)}.cre8-c-tooltip__footer{display:flex;gap:1rem;justify-content:flex-end;flex-grow:1}.cre8-c-tooltip__trigger{cursor:pointer}.cre8-c-tooltip__trigger:focus-visible{outline:var(--cre8-border-width-focus) solid var(--cre8-color-border-active-outline);outline-offset:0.125rem}svg{display:flex;height:1rem;width:1rem}`;
3
+ export default styles;
4
+ //# sourceMappingURL=tooltip.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tooltip.styles.js","sourceRoot":"","sources":["../../../components/tooltip/tooltip.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,MAAM,GAAG,GAAG,CAAA,ygMAAygM,CAAC;AAC5hM,eAAe,MAAM,CAAC","sourcesContent":["import { css } from 'lit';\nconst styles = css`*,::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:inline-flex}.cre8-c-tooltip{position:relative;display:table}.cre8-c-tooltip__panel{font-family:var(--cre8-typography-body-default-font-family);font-size:var(--cre8-typography-body-default-font-size);font-weight:var(--cre8-typography-body-default-font-weight);line-height:var(--cre8-typography-body-default-line-height);text-decoration:var(--cre8-typography-body-default-text-decoration);text-transform:var(--cre8-typography-body-default-text-transform);opacity:0;visibility:hidden;position:absolute;word-wrap:break-word;inset-block-start:calc(100% + 0.75rem);inset-block-end:auto;inset-inline-start:50%;inset-inline-end:auto;transform:translateX(var(--rtlTranslateX, -50%));display:flex;flex-direction:column;gap:0.5rem;width:max-content;max-width:17.5rem;z-index:400;color:var(--cre8-color-content-knockout);background-color:var(--cre8-color-bg-strong);border:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-radius:var(--cre8-border-radius-default);padding:0.5rem}.cre8-is-active:not(.cre8-is-dynamic) .cre8-c-tooltip__panel,.cre8-is-active.cre8-is-dynamic-active .cre8-c-tooltip__panel{opacity:1;visibility:visible}.cre8-c-tooltip--top .cre8-c-tooltip__panel{inset-block-start:auto;inset-block-end:calc(100% + 0.75rem);inset-inline-start:50%;inset-inline-end:auto;transform:translateX(var(--rtlTranslateX, -50%))}.cre8-c-tooltip--left .cre8-c-tooltip__panel{inset-block-start:50%;inset-block-end:auto;inset-inline-start:auto;inset-inline-end:calc(100% + 0.75rem);transform:translateY(-50%)}.cre8-c-tooltip--right .cre8-c-tooltip__panel{inset-block-start:50%;inset-block-end:auto;inset-inline-start:calc(100% + 0.75rem);inset-inline-end:auto;transform:translateY(-50%)}.cre8-c-tooltip--knockout .cre8-c-tooltip__panel{background-color:var(--cre8-color-bg-default);color:var(--cre8-color-content-default)}.cre8-c-tooltip__panel::before{content:\"\";display:block;width:0.75rem;height:0.75rem;position:absolute;margin:auto;background-color:var(--cre8-color-bg-strong);border-block-start:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-inline-start:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);inset-block-start:calc((var(--cre8-border-width-default) + 0.375rem)*-1);inset-inline-start:50%;transform:translateX(var(--rtlTranslateX, -50%)) rotate(45deg)}.cre8-c-tooltip--top .cre8-c-tooltip__panel::before{inset-block-start:auto;inset-block-end:calc((var(--cre8-border-width-default) + 0.375rem)*-1);border-block-start:none;border-inline-start:none;border-block-end:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-inline-end:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong)}.cre8-c-tooltip--left .cre8-c-tooltip__panel::before{inset-block-start:50%;inset-block-end:auto;inset-inline-start:auto;inset-inline-end:calc((var(--cre8-border-width-default) + 0.375rem)*-1);border-block-start:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-inline-start:none;border-block-end:none;border-inline-end:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);transform:translateY(-50%) rotate(var(--rtlRotate45Inverse, 45deg))}.cre8-c-tooltip--right .cre8-c-tooltip__panel::before{inset-block-start:50%;inset-block-end:auto;inset-inline-start:calc((var(--cre8-border-width-default) + 0.375rem)*-1);inset-inline-end:auto;border-block-start:none;border-inline-start:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-block-end:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-inline-end:none;transform:translateY(-50%) rotate(var(--rtlRotate45Inverse, 45deg))}.cre8-c-tooltip--knockout .cre8-c-tooltip__panel::before{background-color:var(--cre8-color-bg-default)}.cre8-c-tooltip__footer{display:flex;gap:1rem;justify-content:flex-end;flex-grow:1}.cre8-c-tooltip__trigger{cursor:pointer}.cre8-c-tooltip__trigger:focus-visible{outline:var(--cre8-border-width-focus) solid var(--cre8-color-border-active-outline);outline-offset:0.125rem}svg{display:flex;height:1rem;width:1rem}`;\nexport default styles;\n"]}