@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,194 +1,319 @@
1
- import { css as g, nothing as f, html as o } from "lit";
2
- import { property as a, query as h, queryAssignedElements as v } from "lit/decorators.js";
3
- import { Cre8Element as m } from "../cre8-element.js";
4
- import "../heading/heading.js";
5
- const b = g`*,::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-popover{position:relative;display:table}.cre8-c-popover__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;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:16rem;z-index:400;background-color:var(--cre8-color-bg-default);border:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-radius:var(--cre8-border-radius-default);box-shadow:var(--cre8-shadow-default);padding:1rem}.cre8-c-popover__panel:focus-visible{outline:var(--cre8-border-width-focus) solid var(--cre8-color-border-active-outline);outline-offset:0.125rem}.cre8-c-popover__panel .cre8-c-popover__heading{font-family:var(--cre8-typography-label-small-font-family);font-size:var(--cre8-typography-label-small-font-size);font-weight:var(--cre8-typography-label-small-font-weight);line-height:var(--cre8-typography-label-small-line-height);text-decoration:var(--cre8-typography-label-small-text-decoration);text-transform:var(--cre8-typography-label-small-text-transform)}.cre8-is-active:not(.cre8-is-dynamic) .cre8-c-popover__panel,.cre8-is-active.cre8-is-dynamic-active .cre8-c-popover__panel{opacity:1;visibility:visible}.cre8-c-popover--top .cre8-c-popover__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-popover--left .cre8-c-popover__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-popover--right .cre8-c-popover__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-popover__panel::before{content:"";display:block;width:0.75rem;height:0.75rem;position:absolute;margin:auto;background-color:var(--cre8-color-bg-default);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-popover--top .cre8-c-popover__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-popover--left .cre8-c-popover__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-popover--right .cre8-c-popover__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-popover__footer{display:flex;gap:1rem}`;
6
- var u = Object.defineProperty, i = (d, e, t, n) => {
7
- for (var s = void 0, l = d.length - 1, p; l >= 0; l--)
8
- (p = d[l]) && (s = p(e, t, s) || s);
9
- return s && u(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
- const c = class c extends m {
12
- constructor() {
13
- super(...arguments), this.handleOnClickOutside = (e) => {
14
- if (!this.isActive)
15
- return;
16
- if (!this.shadowRoot?.host)
17
- throw Error("Could not determine panel context during click handler");
18
- const t = e.composedPath().includes(this.shadowRoot.host);
19
- e.target === document.querySelector("html") && e.clientX >= document.documentElement.offsetWidth || this.isActive && !t && this._toggleActive();
20
- }, this.removeActiveOnScroll = () => {
21
- if (this.isActive && !this.isVisibleOnScroll) {
22
- const e = this._Cre8PopoverPanel.getBoundingClientRect();
23
- this._Cre8Popover.clientHeight + e.height + e.top < window.innerHeight && this._toggleActive();
24
- }
25
- }, this.removeActive = () => {
26
- this.isActive && this._toggleActive();
27
- };
28
- }
29
- /**
30
- * Query the document direction value
31
- * <br/><br/> _*This property is dynamically set_
32
- */
33
- get isRTL() {
34
- return document.dir === "rtl";
35
- }
36
- /**
37
- * Connected Callback Lifecycle
38
- * 1. Add window resize event listener
39
- * 2. Add window scroll event listener
40
- * 3. Add window orientation change event listener
41
- * 4. Add mousedown event listener
42
- */
43
- connectedCallback() {
44
- super.connectedCallback(), globalThis.window.addEventListener("resize", this.removeActive), globalThis.window.addEventListener("scroll", this.removeActiveOnScroll), globalThis.window.addEventListener("orientationchange", this.removeActive), globalThis.document.addEventListener("mousedown", this.handleOnClickOutside, !1);
45
- }
46
- /**
47
- * Disconnected Callback Lifecycle
48
- * 1. Remove window resize event listener
49
- * 2. Remove window scroll event listener
50
- * 3. Remove window orientation change event listener
51
- * 4. Remove mousedown event listener
52
- */
53
- disconnectedCallback() {
54
- super.disconnectedCallback(), globalThis.window.removeEventListener("resize", this.removeActive), globalThis.window.removeEventListener("scroll", this.removeActiveOnScroll), globalThis.window.removeEventListener("orientationchange", this.removeActive), globalThis.document.removeEventListener("mousedown", this.handleOnClickOutside, !1);
55
- }
56
- /**
57
- * First Updated Lifecycle
58
- * 1. Set attribute since aria expanded can't be passed down through the slot
59
- */
60
- firstUpdated() {
61
- this.addAria();
62
- }
63
- /**
64
- * Add aria attributes on the trigger button
65
- * 1. Select the element within the trigger slot
66
- * 2. Set aria-expanded on the popover trigger to the active state if provided. Otherwise, set to false.
67
- * 3 Set the type to button.
68
- */
69
- addAria() {
70
- let e;
71
- this._Cre8PopoverTrigger[0].tagName === "cre8-BUTTON" ? (e = this._Cre8PopoverTrigger[0], e.buttonAriaExpanded = this.isActive ? this.isActive : !1) : (e = this._Cre8PopoverTrigger[0], e.setAttribute("aria-expanded", `${this.isActive ? this.isActive : !1}`), e.setAttribute("type", "button"));
72
- }
73
- /**
74
- * Handle all dynamic placement
75
- */
76
- dynamicPosition() {
77
- if (this.isDynamic && this._Cre8PopoverPanel) {
78
- const e = document.querySelector("body").getBoundingClientRect(), t = this._Cre8PopoverPanel.getBoundingClientRect();
79
- t.left < 0 && (this.position = this.isRTL ? "left" : "right"), t.right >= e.width && (this.position = this.isRTL ? "right" : "left"), t.top < 0 && t.left > 0 && t.right < e.width && (this.position = null), t.bottom >= window.innerHeight && t.left >= 0 && t.right <= e.width && (this.position = "top");
7
+ import { html, nothing, } from 'lit';
8
+ import { property, query, queryAssignedElements } from 'lit/decorators.js';
9
+ import { Cre8Element } from '../cre8-element';
10
+ import '../heading/heading';
11
+ import styles from './popover.styles.js';
12
+ /**
13
+ * The Popover is for progressive disclosure of relevant content often hidden behind a help or info icon.
14
+ * Its content should be no longer than 3-4 lines in addition to a line of heading text and an optional button.
15
+ * @slot - The component content
16
+ */
17
+ export class Cre8Popover extends Cre8Element {
18
+ constructor() {
19
+ super(...arguments);
20
+ /**
21
+ * Handle click outside the component
22
+ * 1. Close the show/hide popover panel on click outside
23
+ * 2. If the popover panel is already closed then we don't care about outside clicks and we can bail early
24
+ * 3. By the time a user clicks on the page the shadowRoot will almost certainly be
25
+ * defined, but TypeScript isn't that trusting and sees this.shadowRoot as possibly
26
+ * undefined. To work around that we'll check that we have a shadowRoot (and a
27
+ * rendered .host) element here to appease the TypeScript compiler. This should never
28
+ * actually be shown or run for a human end user.
29
+ * 4. Check to see if we clicked inside the active panel
30
+ * 5. If the panel is active and we've clicked outside of the panel then it should be closed.
31
+ */
32
+ this.handleOnClickOutside = (e) => {
33
+ /* 2 */
34
+ if (!this.isActive) {
35
+ return;
36
+ }
37
+ /* 3 */
38
+ if (!this.shadowRoot?.host) {
39
+ throw Error('Could not determine panel context during click handler');
40
+ }
41
+ /* 4 */
42
+ const didClickInside = e.composedPath().includes(this.shadowRoot.host);
43
+ /* 5 */
44
+ if (!(e.target === document.querySelector('html') && e.clientX >= document.documentElement.offsetWidth)) {
45
+ if (this.isActive && !didClickInside) {
46
+ this._toggleActive();
47
+ }
48
+ }
49
+ };
50
+ /**
51
+ * Remove Active State on Scroll
52
+ * 1. If a scroll event is fired and visibileOnScroll is not true, remove the active state
53
+ * 2. If the popover height is less than the window height, then allow the active to remove on scroll
54
+ */
55
+ this.removeActiveOnScroll = () => {
56
+ /* 1 */
57
+ if (this.isActive && !this.isVisibleOnScroll) {
58
+ /* 2 */
59
+ const popoverPanel = this._Cre8PopoverPanel.getBoundingClientRect();
60
+ const popoverTrigger = this._Cre8Popover;
61
+ const popoverHeight = popoverTrigger.clientHeight + popoverPanel.height + popoverPanel.top;
62
+ if (popoverHeight < window.innerHeight) {
63
+ this._toggleActive();
64
+ }
65
+ }
66
+ };
67
+ /**
68
+ * Remove Active State
69
+ * 1. If a specific event is fired, remove the active state.
70
+ */
71
+ this.removeActive = () => {
72
+ if (this.isActive) {
73
+ this._toggleActive();
74
+ }
75
+ };
80
76
  }
81
- }
82
- /**
83
- * Set Popover Active State
84
- * 1. Toggle the active state between true and false
85
- * 2. Set attribute since aria expanded can't be passed down through the slot
86
- * 3. If the active state is toggled to false, close the panel and return focus to the dropdown trigger.
87
- * This accounts for both design system buttons and native HTML buttons
88
- */
89
- _toggleActive() {
90
- this.isActive = !this.isActive, this.addAria(), this.isActive ? (requestAnimationFrame(() => {
91
- this.dynamicPosition();
92
- }), this.dispatchEvent(
93
- new CustomEvent("open", { detail: { isActive: this.isActive }, bubbles: !0, composed: !0 })
94
- )) : this.dispatchEvent(
95
- new CustomEvent("close", { detail: { isActive: this.isActive }, bubbles: !0, composed: !0 })
96
- ), setTimeout(() => {
97
- this.isActive ? this.isActiveDynamic = !0 : this.isActiveDynamic = !1;
98
- }, 2);
99
- }
100
- /**
101
- * Handle Keydown
102
- * 1. If the panel is open and escape is keyed, close the popover panel and return focus to the trigger button
103
- * 2. If the panel is opened, tab away closes the popover panel
104
- * 3. The panel can be opened and closed by Enter or Space keys.
105
- */
106
- _handleKeydown(e) {
107
- e.key === "Escape" && this.isActive === !0 ? this._toggleActive() : e.key === "Tab" && this._handleTabNavigation(e);
108
- }
109
- _handleTabNavigation(e) {
110
- this.isActive && this._navigateInsidePopover(e);
111
- }
112
- _navigateInsidePopover(e) {
113
- const t = this._getFocusableElements();
114
- if (t.length === 0) {
115
- this._closePopoverAndFocusTrigger(e);
116
- return;
77
+ /**
78
+ * Query the document direction value
79
+ * <br/><br/> _*This property is dynamically set_
80
+ */
81
+ get isRTL() {
82
+ return document.dir === 'rtl';
117
83
  }
118
- const n = t[t.length - 1];
119
- document.activeElement === n && (this._closePopoverAndFocusTrigger(e), e.preventDefault());
120
- }
121
- _getFocusableElements() {
122
- return [...Array.from(this._Cre8PopoverFooter)];
123
- }
124
- _closePopoverAndFocusTrigger(e) {
125
- this._toggleActive(), e.preventDefault();
126
- }
127
- render() {
128
- const e = this.componentClassNames("cre8-c-popover", {
129
- "cre8-c-popover--top": this.position === "top",
130
- "cre8-c-popover--left": this.position === "left",
131
- "cre8-c-popover--right": this.position === "right",
132
- "cre8-is-active": this.isActive,
133
- "cre8-is-dynamic": this.isDynamic,
134
- "cre8-is-dynamic-active": this.isActiveDynamic
135
- });
136
- return o`
137
- <div class="${e}">
138
- ${this.slotNotEmpty("trigger") && o` <slot name="trigger" @keydown=${this._handleKeydown} @click=${this._toggleActive}></slot> `}
139
- ${this.isActive ? o`
84
+ /**
85
+ * Connected Callback Lifecycle
86
+ * 1. Add window resize event listener
87
+ * 2. Add window scroll event listener
88
+ * 3. Add window orientation change event listener
89
+ * 4. Add mousedown event listener
90
+ */
91
+ connectedCallback() {
92
+ super.connectedCallback();
93
+ globalThis.window.addEventListener('resize', this.removeActive); /* 1 */
94
+ globalThis.window.addEventListener('scroll', this.removeActiveOnScroll); /* 2 */
95
+ globalThis.window.addEventListener('orientationchange', this.removeActive); /* 3 */
96
+ globalThis.document.addEventListener('mousedown', this.handleOnClickOutside, false); /* 4 */
97
+ }
98
+ /**
99
+ * Disconnected Callback Lifecycle
100
+ * 1. Remove window resize event listener
101
+ * 2. Remove window scroll event listener
102
+ * 3. Remove window orientation change event listener
103
+ * 4. Remove mousedown event listener
104
+ */
105
+ disconnectedCallback() {
106
+ super.disconnectedCallback();
107
+ globalThis.window.removeEventListener('resize', this.removeActive); /* 1 */
108
+ globalThis.window.removeEventListener('scroll', this.removeActiveOnScroll); /* 2 */
109
+ globalThis.window.removeEventListener('orientationchange', this.removeActive); /* 3 */
110
+ globalThis.document.removeEventListener('mousedown', this.handleOnClickOutside, false); /* 4 */
111
+ }
112
+ /**
113
+ * First Updated Lifecycle
114
+ * 1. Set attribute since aria expanded can't be passed down through the slot
115
+ */
116
+ firstUpdated() {
117
+ this.addAria(); /* 1 */
118
+ }
119
+ /**
120
+ * Add aria attributes on the trigger button
121
+ * 1. Select the element within the trigger slot
122
+ * 2. Set aria-expanded on the popover trigger to the active state if provided. Otherwise, set to false.
123
+ * 3 Set the type to button.
124
+ */
125
+ addAria() {
126
+ /* 1 */
127
+ let popoverTrigger;
128
+ if (this._Cre8PopoverTrigger[0].tagName === 'cre8-BUTTON') {
129
+ popoverTrigger = this._Cre8PopoverTrigger[0];
130
+ popoverTrigger.buttonAriaExpanded = this.isActive ? this.isActive : false;
131
+ }
132
+ else {
133
+ popoverTrigger = this._Cre8PopoverTrigger[0];
134
+ popoverTrigger.setAttribute('aria-expanded', `${this.isActive ? this.isActive : false}`); /* 2 */
135
+ popoverTrigger.setAttribute('type', 'button'); /* 3 */
136
+ }
137
+ }
138
+ /**
139
+ * Handle all dynamic placement
140
+ */
141
+ dynamicPosition() {
142
+ // TODO: Temporarily keep eslint complexity as warning. Update during specific story for this rule.
143
+ /* eslint complexity: ["warn", 10] */
144
+ if (this.isDynamic && this._Cre8PopoverPanel) {
145
+ const body = document.querySelector('body').getBoundingClientRect();
146
+ const popoverPanel = this._Cre8PopoverPanel.getBoundingClientRect();
147
+ /**
148
+ * If popover panel breaks out the left side of the window, position it to the right
149
+ */
150
+ if (popoverPanel.left < 0) {
151
+ this.position = this.isRTL ? 'left' : 'right';
152
+ }
153
+ /**
154
+ * If popover panel breaks out the right side of the window, position it to the left
155
+ */
156
+ if (popoverPanel.right >= body.width) {
157
+ this.position = this.isRTL ? 'right' : 'left';
158
+ }
159
+ /**
160
+ * If popover panel breaks out the top side of the window only, position it to the bottom
161
+ */
162
+ if (popoverPanel.top < 0 && popoverPanel.left > 0 && popoverPanel.right < body.width) {
163
+ this.position = null;
164
+ }
165
+ /**
166
+ * If popover panel breaks out the bottom side of the window only, position it to the top
167
+ */
168
+ if (popoverPanel.bottom >= window.innerHeight
169
+ && popoverPanel.left >= 0
170
+ && popoverPanel.right <= body.width) {
171
+ this.position = 'top';
172
+ }
173
+ }
174
+ }
175
+ /**
176
+ * Set Popover Active State
177
+ * 1. Toggle the active state between true and false
178
+ * 2. Set attribute since aria expanded can't be passed down through the slot
179
+ * 3. If the active state is toggled to false, close the panel and return focus to the dropdown trigger.
180
+ * This accounts for both design system buttons and native HTML buttons
181
+ */
182
+ _toggleActive() {
183
+ this.isActive = !this.isActive; /* 1 */
184
+ this.addAria(); /* 2 */
185
+ if (this.isActive) {
186
+ requestAnimationFrame(() => {
187
+ this.dynamicPosition();
188
+ });
189
+ this.dispatchEvent(new CustomEvent('open', { detail: { isActive: this.isActive }, bubbles: true, composed: true }));
190
+ }
191
+ else {
192
+ /* 3 */
193
+ this.dispatchEvent(new CustomEvent('close', { detail: { isActive: this.isActive }, bubbles: true, composed: true }));
194
+ }
195
+ /**
196
+ * Toggle the active state for dynamic. This prevents a flash of the popover in the orginal position
197
+ */
198
+ setTimeout(() => {
199
+ if (this.isActive) {
200
+ this.isActiveDynamic = true;
201
+ }
202
+ else {
203
+ this.isActiveDynamic = false;
204
+ }
205
+ }, 2);
206
+ }
207
+ /**
208
+ * Handle Keydown
209
+ * 1. If the panel is open and escape is keyed, close the popover panel and return focus to the trigger button
210
+ * 2. If the panel is opened, tab away closes the popover panel
211
+ * 3. The panel can be opened and closed by Enter or Space keys.
212
+ */
213
+ _handleKeydown(e) {
214
+ if (e.key === 'Escape' && this.isActive === true) {
215
+ this._toggleActive();
216
+ }
217
+ else if (e.key === 'Tab') {
218
+ this._handleTabNavigation(e);
219
+ }
220
+ }
221
+ _handleTabNavigation(e) {
222
+ if (this.isActive) {
223
+ this._navigateInsidePopover(e);
224
+ }
225
+ }
226
+ _navigateInsidePopover(e) {
227
+ const focusableElements = this._getFocusableElements();
228
+ if (focusableElements.length === 0) {
229
+ this._closePopoverAndFocusTrigger(e);
230
+ return;
231
+ }
232
+ const lastFocusableElement = focusableElements[focusableElements.length - 1];
233
+ if (document.activeElement === lastFocusableElement) {
234
+ this._closePopoverAndFocusTrigger(e);
235
+ e.preventDefault();
236
+ }
237
+ }
238
+ _getFocusableElements() {
239
+ const panelFocusableElements = Array.from(this._Cre8PopoverFooter);
240
+ return [...panelFocusableElements];
241
+ }
242
+ _closePopoverAndFocusTrigger(e) {
243
+ this._toggleActive();
244
+ e.preventDefault();
245
+ }
246
+ render() {
247
+ const componentClassNames = this.componentClassNames('cre8-c-popover', {
248
+ 'cre8-c-popover--top': this.position === 'top',
249
+ 'cre8-c-popover--left': this.position === 'left',
250
+ 'cre8-c-popover--right': this.position === 'right',
251
+ 'cre8-is-active': this.isActive,
252
+ 'cre8-is-dynamic': this.isDynamic,
253
+ 'cre8-is-dynamic-active': this.isActiveDynamic,
254
+ });
255
+ return html `
256
+ <div class="${componentClassNames}">
257
+ ${this.slotNotEmpty('trigger')
258
+ && html ` <slot name="trigger" @keydown=${this._handleKeydown} @click=${this._toggleActive}></slot> `}
259
+ ${this.isActive
260
+ ? html `
140
261
  <div tabindex="0" class="cre8-c-popover__panel" @keydown=${this._handleKeydown}>
141
- ${(this.slotNotEmpty("header") || this.heading) && o`
262
+ ${(this.slotNotEmpty('header') || this.heading)
263
+ && html `
142
264
  <div class="cre8-c-popover__header">
143
- ${this.heading ? o`<div class="cre8-c-popover__heading">${this.heading}</div>` : o`<slot name="header"></slot>`}
265
+ ${this.heading
266
+ ? html `<div class="cre8-c-popover__heading">${this.heading}</div>`
267
+ : html `<slot name="header"></slot>`}
144
268
  </div>
145
269
  `}
146
270
  <slot></slot>
147
- ${this.slotNotEmpty("footer") && o`
271
+ ${this.slotNotEmpty('footer')
272
+ && html `
148
273
  <div class="cre8-c-popover__footer">
149
274
  <slot name="footer"></slot>
150
275
  </div>
151
276
  `}
152
277
  </div>
153
- ` : f}
278
+ `
279
+ : nothing}
154
280
  </div>
155
281
  `;
156
- }
157
- };
158
- c.styles = [b];
159
- let r = c;
160
- i([
161
- a()
162
- ], r.prototype, "heading");
163
- i([
164
- a()
165
- ], r.prototype, "position");
166
- i([
167
- a({ type: Boolean, reflect: !0 })
168
- ], r.prototype, "isVisibleOnScroll");
169
- i([
170
- a({ type: Boolean, reflect: !0 })
171
- ], r.prototype, "isDynamic");
172
- i([
173
- a({ type: Boolean, reflect: !0 })
174
- ], r.prototype, "isActiveDynamic");
175
- i([
176
- a({ type: Boolean, reflect: !0 })
177
- ], r.prototype, "isActive");
178
- i([
179
- h(".cre8-c-popover")
180
- ], r.prototype, "_Cre8Popover");
181
- i([
182
- h(".cre8-c-popover__panel")
183
- ], r.prototype, "_Cre8PopoverPanel");
184
- i([
185
- v({ slot: "trigger" })
186
- ], r.prototype, "_Cre8PopoverTrigger");
187
- i([
188
- v({ slot: "footer" })
189
- ], r.prototype, "_Cre8PopoverFooter");
190
- customElements.get("cre8-popover") === void 0 && customElements.define("cre8-popover", r);
191
- export {
192
- r as Cre8Popover,
193
- r as default
194
- };
282
+ }
283
+ }
284
+ Cre8Popover.styles = [styles];
285
+ __decorate([
286
+ property()
287
+ ], Cre8Popover.prototype, "heading", void 0);
288
+ __decorate([
289
+ property()
290
+ ], Cre8Popover.prototype, "position", void 0);
291
+ __decorate([
292
+ property({ type: Boolean, reflect: true })
293
+ ], Cre8Popover.prototype, "isVisibleOnScroll", void 0);
294
+ __decorate([
295
+ property({ type: Boolean, reflect: true })
296
+ ], Cre8Popover.prototype, "isDynamic", void 0);
297
+ __decorate([
298
+ property({ type: Boolean, reflect: true })
299
+ ], Cre8Popover.prototype, "isActiveDynamic", void 0);
300
+ __decorate([
301
+ property({ type: Boolean, reflect: true })
302
+ ], Cre8Popover.prototype, "isActive", void 0);
303
+ __decorate([
304
+ query('.cre8-c-popover')
305
+ ], Cre8Popover.prototype, "_Cre8Popover", void 0);
306
+ __decorate([
307
+ query('.cre8-c-popover__panel')
308
+ ], Cre8Popover.prototype, "_Cre8PopoverPanel", void 0);
309
+ __decorate([
310
+ queryAssignedElements({ slot: 'trigger' })
311
+ ], Cre8Popover.prototype, "_Cre8PopoverTrigger", void 0);
312
+ __decorate([
313
+ queryAssignedElements({ slot: 'footer' })
314
+ ], Cre8Popover.prototype, "_Cre8PopoverFooter", void 0);
315
+ if (customElements.get('cre8-popover') === undefined) {
316
+ customElements.define('cre8-popover', Cre8Popover);
317
+ }
318
+ export default Cre8Popover;
319
+ //# sourceMappingURL=popover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"popover.js","sourceRoot":"","sources":["../../../components/popover/popover.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IA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c,EAAE,WAAW,CAAC,CAAC;AACvD,CAAC;AAQD,eAAe,WAAW,CAAC","sourcesContent":["import { html, nothing, } from 'lit';\nimport { property, query, queryAssignedElements } from 'lit/decorators.js';\nimport { Cre8Element } from '../cre8-element';\nimport '../heading/heading';\nimport styles from './popover.styles.js';\nimport { Cre8Button } from '../button/button';\n\n/**\n * The Popover is for progressive disclosure of relevant content often hidden behind a help or info icon.\n * Its content should be no longer than 3-4 lines in addition to a line of heading text and an optional button.\n * @slot - The component content\n */\n\nexport class Cre8Popover extends Cre8Element {\n static styles = [styles];\n\n /**\n * The heading text that appears at the top of the popover panel. Should only be 2-3 lines max.\n * @attr {string | undefined}\n */\n @property()\n heading?: string;\n\n /**\n * Positions the popover panel absolutely to the trigger\n * - **default** positions the popover panel below the trigger\n * - **top** positions the popover panel below the trigger\n * - **left** positions the popover panel below the trigger\n * - **right** positions the popover panel below the trigger\n * @attr {string | undefined}\n */\n @property()\n position?: 'top' | 'left' | 'right';\n\n /**\n * Set to prevent the popover panel from hiding on scroll\n * @attr {boolean | undefined}\n */\n @property({ type: Boolean, reflect: true })\n isVisibleOnScroll?: boolean;\n\n /**\n * The dynamic state for the popover\n * - If true, the popover panel placement is determined by its position in the viewport\n * - If false, the popover panel placement will be placed according to the position value\n * @attr {boolean | undefined}\n */\n @property({ type: Boolean, reflect: true })\n isDynamic?: boolean;\n\n /**\n * The dynamic active state\n * _This property is dynamically set_\n * @attr {boolean | undefined}\n */\n @property({ type: Boolean, reflect: true })\n isActiveDynamic?: boolean;\n\n /**\n * The active state for the popover\n * - If true, the popover panel is visible\n * - If false, the popover panel is hidden\n *\n * _This property is dynamically set_\n * @attr {boolean | undefined}\n */\n @property({ type: Boolean, reflect: true })\n isActive?: boolean;\n\n\n /**\n * Query the popover panel element\n */\n @query('.cre8-c-popover')\n _Cre8Popover: HTMLElement;\n\n /**\n * Query the popover panel element\n */\n @query('.cre8-c-popover__panel')\n _Cre8PopoverPanel: HTMLElement;\n\n /**\n * Query the assigned elements in the trigger slot\n */\n @queryAssignedElements({ slot: 'trigger' })\n _Cre8PopoverTrigger: Array<HTMLElement>;\n\n /**\n * Query the assigned elements in the footer slot\n */\n @queryAssignedElements({ slot: 'footer' })\n _Cre8PopoverFooter: Array<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 * Connected Callback Lifecycle\n * 1. Add window resize event listener\n * 2. Add window scroll event listener\n * 3. Add window orientation change event listener\n * 4. Add mousedown event listener\n */\n connectedCallback() {\n super.connectedCallback();\n globalThis.window.addEventListener('resize', this.removeActive); /* 1 */\n globalThis.window.addEventListener('scroll', this.removeActiveOnScroll); /* 2 */\n globalThis.window.addEventListener('orientationchange', this.removeActive); /* 3 */\n globalThis.document.addEventListener('mousedown', this.handleOnClickOutside, false); /* 4 */\n }\n\n /**\n * Disconnected Callback Lifecycle\n * 1. Remove window resize event listener\n * 2. Remove window scroll event listener\n * 3. Remove window orientation change event listener\n * 4. Remove mousedown event listener\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n globalThis.window.removeEventListener('resize', this.removeActive); /* 1 */\n globalThis.window.removeEventListener('scroll', this.removeActiveOnScroll); /* 2 */\n globalThis.window.removeEventListener('orientationchange', this.removeActive); /* 3 */\n globalThis.document.removeEventListener('mousedown', this.handleOnClickOutside, false); /* 4 */\n }\n\n /**\n * First Updated Lifecycle\n * 1. Set attribute since aria expanded can't be passed down through the slot\n */\n firstUpdated() {\n this.addAria(); /* 1 */\n }\n\n /**\n * Add aria attributes on the trigger button\n * 1. Select the element within the trigger slot\n * 2. Set aria-expanded on the popover trigger to the active state if provided. Otherwise, set to false.\n * 3 Set the type to button.\n */\n addAria() {\n /* 1 */\n let popoverTrigger;\n if (this._Cre8PopoverTrigger[0].tagName === 'cre8-BUTTON') {\n popoverTrigger = this._Cre8PopoverTrigger[0] as Cre8Button;\n popoverTrigger.buttonAriaExpanded = this.isActive ? this.isActive : false;\n } else {\n popoverTrigger = this._Cre8PopoverTrigger[0];\n popoverTrigger.setAttribute('aria-expanded', `${this.isActive ? this.isActive : false}`); /* 2 */\n popoverTrigger.setAttribute('type', 'button'); /* 3 */\n }\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._Cre8PopoverPanel) {\n const body = document.querySelector('body').getBoundingClientRect();\n const popoverPanel = this._Cre8PopoverPanel.getBoundingClientRect();\n\n /**\n * If popover panel breaks out the left side of the window, position it to the right\n */\n if (popoverPanel.left < 0) {\n this.position = this.isRTL ? 'left' : 'right';\n }\n\n /**\n * If popover panel breaks out the right side of the window, position it to the left\n */\n if (popoverPanel.right >= body.width) {\n this.position = this.isRTL ? 'right' : 'left';\n }\n\n /**\n * If popover panel breaks out the top side of the window only, position it to the bottom\n */\n if (popoverPanel.top < 0 && popoverPanel.left > 0 && popoverPanel.right < body.width) {\n this.position = null;\n }\n\n /**\n * If popover panel breaks out the bottom side of the window only, position it to the top\n */\n if (\n popoverPanel.bottom >= window.innerHeight\n && popoverPanel.left >= 0\n && popoverPanel.right <= body.width\n ) {\n this.position = 'top';\n }\n }\n }\n\n /**\n * Set Popover Active State\n * 1. Toggle the active state between true and false\n * 2. Set attribute since aria expanded can't be passed down through the slot\n * 3. If the active state is toggled to false, close the panel and return focus to the dropdown trigger.\n * This accounts for both design system buttons and native HTML buttons\n */\n private _toggleActive() {\n this.isActive = !this.isActive; /* 1 */\n this.addAria(); /* 2 */\n\n if (this.isActive) {\n requestAnimationFrame(() => {\n this.dynamicPosition();\n });\n this.dispatchEvent(\n new CustomEvent('open', { detail: { isActive: this.isActive }, bubbles: true, composed: true })\n );\n } else {\n /* 3 */\n this.dispatchEvent(\n new CustomEvent('close', { detail: { isActive: this.isActive }, bubbles: true, composed: true })\n );\n }\n\n /**\n * Toggle the active state for dynamic. This prevents a flash of the popover in the orginal position\n */\n setTimeout(() => {\n if (this.isActive) {\n this.isActiveDynamic = true;\n } else {\n this.isActiveDynamic = false;\n }\n }, 2);\n }\n\n /**\n * Handle Keydown\n * 1. If the panel is open and escape is keyed, close the popover panel and return focus to the trigger button\n * 2. If the panel is opened, tab away closes the popover panel\n * 3. The panel can be opened and closed by Enter or Space keys.\n */\n private _handleKeydown(e: KeyboardEvent) {\n if (e.key === 'Escape' && this.isActive === true) {\n this._toggleActive();\n } else if (e.key === 'Tab') {\n this._handleTabNavigation(e);\n }\n }\n\n private _handleTabNavigation(e: KeyboardEvent) {\n if (this.isActive) {\n this._navigateInsidePopover(e);\n }\n }\n\n private _navigateInsidePopover(e: KeyboardEvent) {\n const focusableElements = this._getFocusableElements();\n if (focusableElements.length === 0) {\n this._closePopoverAndFocusTrigger(e);\n return;\n }\n\n const lastFocusableElement = focusableElements[focusableElements.length - 1] as HTMLElement;\n\n if (document.activeElement === lastFocusableElement) {\n this._closePopoverAndFocusTrigger(e);\n e.preventDefault();\n }\n }\n\n private _getFocusableElements(): HTMLElement[] {\n const panelFocusableElements = Array.from(this._Cre8PopoverFooter);\n return [...panelFocusableElements];\n }\n\n private _closePopoverAndFocusTrigger(e: KeyboardEvent) {\n this._toggleActive();\n e.preventDefault();\n }\n\n /**\n * Handle click outside the component\n * 1. Close the show/hide popover panel on click outside\n * 2. If the popover panel is already closed then we don't care about outside clicks and we can bail early\n * 3. By the time a user clicks on the page the shadowRoot will almost certainly be\n * defined, but TypeScript isn't that trusting and sees this.shadowRoot as possibly\n * undefined. To work around that we'll check that we have a shadowRoot (and a\n * rendered .host) element here to appease the TypeScript compiler. This should never\n * actually be shown or run for a human end user.\n * 4. Check to see if we clicked inside the active panel\n * 5. If the panel is active and we've clicked outside of the panel then it should be closed.\n */\n handleOnClickOutside = (e: MouseEvent) => {\n /* 2 */\n if (!this.isActive) {\n return;\n }\n\n /* 3 */\n if (!this.shadowRoot?.host) {\n throw Error('Could not determine panel context during click handler');\n }\n\n /* 4 */\n const didClickInside = e.composedPath().includes(this.shadowRoot.host);\n\n /* 5 */\n if (!(e.target === document.querySelector('html') && e.clientX >= document.documentElement.offsetWidth)) {\n if (this.isActive && !didClickInside) {\n this._toggleActive();\n }\n }\n };\n\n /**\n * Remove Active State on Scroll\n * 1. If a scroll event is fired and visibileOnScroll is not true, remove the active state\n * 2. If the popover height is less than the window height, then allow the active to remove on scroll\n */\n removeActiveOnScroll = () => {\n /* 1 */\n if (this.isActive && !this.isVisibleOnScroll) {\n /* 2 */\n const popoverPanel = this._Cre8PopoverPanel.getBoundingClientRect();\n const popoverTrigger = this._Cre8Popover;\n const popoverHeight = popoverTrigger.clientHeight + popoverPanel.height + popoverPanel.top;\n\n if (popoverHeight < window.innerHeight) {\n this._toggleActive();\n }\n }\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-popover', {\n 'cre8-c-popover--top': this.position === 'top',\n 'cre8-c-popover--left': this.position === 'left',\n 'cre8-c-popover--right': this.position === 'right',\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 ${this.slotNotEmpty('trigger')\n && html` <slot name=\"trigger\" @keydown=${this._handleKeydown} @click=${this._toggleActive}></slot> `}\n ${this.isActive\n ? html`\n <div tabindex=\"0\" class=\"cre8-c-popover__panel\" @keydown=${this._handleKeydown}>\n ${(this.slotNotEmpty('header') || this.heading)\n && html`\n <div class=\"cre8-c-popover__header\">\n ${this.heading\n ? html`<div class=\"cre8-c-popover__heading\">${this.heading}</div>`\n : html`<slot name=\"header\"></slot>`}\n </div>\n `}\n <slot></slot>\n ${this.slotNotEmpty('footer')\n && html`\n <div class=\"cre8-c-popover__footer\">\n <slot name=\"footer\"></slot>\n </div>\n `}\n </div>\n `\n : nothing}\n </div>\n `;\n }\n}\n\nif (customElements.get('cre8-popover') === undefined) {\n customElements.define('cre8-popover', Cre8Popover);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'cre8-popover': Cre8Popover;\n }\n}\n\nexport default Cre8Popover;\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-popover{position:relative;display:table}.cre8-c-popover__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;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:16rem;z-index:400;background-color:var(--cre8-color-bg-default);border:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-radius:var(--cre8-border-radius-default);box-shadow:var(--cre8-shadow-default);padding:1rem}.cre8-c-popover__panel:focus-visible{outline:var(--cre8-border-width-focus) solid var(--cre8-color-border-active-outline);outline-offset:0.125rem}.cre8-c-popover__panel .cre8-c-popover__heading{font-family:var(--cre8-typography-label-small-font-family);font-size:var(--cre8-typography-label-small-font-size);font-weight:var(--cre8-typography-label-small-font-weight);line-height:var(--cre8-typography-label-small-line-height);text-decoration:var(--cre8-typography-label-small-text-decoration);text-transform:var(--cre8-typography-label-small-text-transform)}.cre8-is-active:not(.cre8-is-dynamic) .cre8-c-popover__panel,.cre8-is-active.cre8-is-dynamic-active .cre8-c-popover__panel{opacity:1;visibility:visible}.cre8-c-popover--top .cre8-c-popover__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-popover--left .cre8-c-popover__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-popover--right .cre8-c-popover__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-popover__panel::before{content:"";display:block;width:0.75rem;height:0.75rem;position:absolute;margin:auto;background-color:var(--cre8-color-bg-default);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-popover--top .cre8-c-popover__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-popover--left .cre8-c-popover__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-popover--right .cre8-c-popover__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-popover__footer{display:flex;gap:1rem}`;
3
+ export default styles;
4
+ //# sourceMappingURL=popover.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"popover.styles.js","sourceRoot":"","sources":["../../../components/popover/popover.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,MAAM,GAAG,GAAG,CAAA,ghMAAghM,CAAC;AACniM,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-popover{position:relative;display:table}.cre8-c-popover__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;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:16rem;z-index:400;background-color:var(--cre8-color-bg-default);border:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-radius:var(--cre8-border-radius-default);box-shadow:var(--cre8-shadow-default);padding:1rem}.cre8-c-popover__panel:focus-visible{outline:var(--cre8-border-width-focus) solid var(--cre8-color-border-active-outline);outline-offset:0.125rem}.cre8-c-popover__panel .cre8-c-popover__heading{font-family:var(--cre8-typography-label-small-font-family);font-size:var(--cre8-typography-label-small-font-size);font-weight:var(--cre8-typography-label-small-font-weight);line-height:var(--cre8-typography-label-small-line-height);text-decoration:var(--cre8-typography-label-small-text-decoration);text-transform:var(--cre8-typography-label-small-text-transform)}.cre8-is-active:not(.cre8-is-dynamic) .cre8-c-popover__panel,.cre8-is-active.cre8-is-dynamic-active .cre8-c-popover__panel{opacity:1;visibility:visible}.cre8-c-popover--top .cre8-c-popover__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-popover--left .cre8-c-popover__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-popover--right .cre8-c-popover__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-popover__panel::before{content:\"\";display:block;width:0.75rem;height:0.75rem;position:absolute;margin:auto;background-color:var(--cre8-color-bg-default);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-popover--top .cre8-c-popover__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-popover--left .cre8-c-popover__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-popover--right .cre8-c-popover__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-popover__footer{display:flex;gap:1rem}`;\nexport default styles;\n"]}