@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,43 +1,50 @@
1
- import { css as p, html as m } from "lit";
2
- import { property as a } from "lit/decorators.js";
3
- import { Cre8Element as c } from "../cre8-element.js";
4
- const h = p`*,::slotted(*),*:before,*:after{box-sizing:border-box}:root{--size-base-unit: 0.5rem}[dir=rtl]{--rtlTranslateX: 50%;--rtlGradientToRight: 270deg;--rtlRotate45Inverse: -45deg}:host{--cre8-z-index-1: 1;--cre8-z-index-50: 50;--cre8-z-index-100: 100;--cre8-z-index-200: 200;--cre8-z-index-1030: 1030;--cre8-anim-fade-quick: 0.35s;--cre8-anim-ease: ease}@keyframes fadeIn{100%{opacity:1}}@keyframes slideIn{100%{transform:translateX(0)}}@keyframes slideInFwd{100%{width:272px;height:272px}}@keyframes slideOutRight{100%{width:272px;height:272px}}@keyframes slideUp{100%{transform:translateY(0)}}@media(width >= 481px){@keyframes slideInFwd{100%{width:417px;height:417px}}@keyframes slideOutRight{100%{width:417px;height:417px}}}@media(width >= 48rem){@keyframes slideInFwd{100%{width:330px;height:330px}}@keyframes slideOutRight{100%{width:330px;height:330px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 60rem){@keyframes slideInFwd{100%{width:460px;height:460px}}@keyframes slideOutRight{100%{width:460px;height:460px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 75rem){@keyframes slideInFwd{100%{width:592px;height:591px}}@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 87.5rem){@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 120px))}}}@media(width >= 2200px){@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 592px))}}}span.ripple{position:absolute;border-radius:50%;transform:scale(0);animation:ripple 600ms linear;background-color:var(--ripple-bg-color)}@keyframes ripple{to{transform:scale(4);opacity:1}}:root{--size-base-unit: 0.5rem}[dir=rtl]{--rtlTranslateX: 50%;--rtlGradientToRight: 270deg;--rtlRotate45Inverse: -45deg}.cre8-c-primary-nav--inverted{--cre8-primary-nav-link-color: var(--cre8-color-content-knockout)}.cre8-c-primary-nav__list{display:flex;flex-direction:column;margin:0;padding:0;list-style:none}.cre8-c-primary-nav--side-by-side .cre8-c-primary-nav__list{flex-direction:row}@media all and (min-width: 960px){.cre8-c-primary-nav__list{flex-direction:row}}`;
5
- var f = Object.defineProperty, s = (d, t, l, x) => {
6
- for (var e = void 0, i = d.length - 1, o; i >= 0; i--)
7
- (o = d[i]) && (e = o(t, l, e) || e);
8
- return e && f(t, l, e), e;
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;
9
6
  };
10
- const n = class n extends c {
11
- constructor() {
12
- super(...arguments), this.navAriaLabel = "main";
13
- }
14
- render() {
15
- const t = this.componentClassNames("cre8-c-primary-nav", {
16
- "cre8-c-primary-nav--side-by-side": this.behavior === "side-by-side",
17
- "cre8-c-primary-nav--inverted": this.inverted === !0
18
- });
19
- return m`
20
- <nav aria-label="${this.navAriaLabel}" class="${t}">
7
+ import { html, } from 'lit';
8
+ import { property } from 'lit/decorators.js';
9
+ import { Cre8Element } from '../cre8-element';
10
+ import styles from './primary-nav.styles.js';
11
+ /**
12
+ * @slot - The primary navigation items
13
+ */
14
+ export class Cre8PrimaryNav extends Cre8Element {
15
+ constructor() {
16
+ super(...arguments);
17
+ /**
18
+ * aria-label attribute to designate at name for the nav. Can be override by user
19
+ */
20
+ this.navAriaLabel = 'main';
21
+ }
22
+ render() {
23
+ const componentClassNames = this.componentClassNames('cre8-c-primary-nav', {
24
+ 'cre8-c-primary-nav--side-by-side': this.behavior === 'side-by-side',
25
+ 'cre8-c-primary-nav--inverted': this.inverted === true,
26
+ });
27
+ return html `
28
+ <nav aria-label="${this.navAriaLabel}" class="${componentClassNames}">
21
29
  <ul class="cre8-c-primary-nav__list">
22
30
  <slot></slot>
23
31
  </ul>
24
32
  </nav>
25
33
  `;
26
- }
27
- };
28
- n.styles = [h];
29
- let r = n;
30
- s([
31
- a({ type: Boolean, reflect: !0 })
32
- ], r.prototype, "inverted");
33
- s([
34
- a()
35
- ], r.prototype, "behavior");
36
- s([
37
- a()
38
- ], r.prototype, "navAriaLabel");
39
- customElements.get("cre8-primary-nav") === void 0 && customElements.define("cre8-primary-nav", r);
40
- export {
41
- r as Cre8PrimaryNav,
42
- r as default
43
- };
34
+ }
35
+ }
36
+ Cre8PrimaryNav.styles = [styles];
37
+ __decorate([
38
+ property({ type: Boolean, reflect: true })
39
+ ], Cre8PrimaryNav.prototype, "inverted", void 0);
40
+ __decorate([
41
+ property()
42
+ ], Cre8PrimaryNav.prototype, "behavior", void 0);
43
+ __decorate([
44
+ property()
45
+ ], Cre8PrimaryNav.prototype, "navAriaLabel", void 0);
46
+ if (customElements.get('cre8-primary-nav') === undefined) {
47
+ customElements.define('cre8-primary-nav', Cre8PrimaryNav);
48
+ }
49
+ export default Cre8PrimaryNav;
50
+ //# sourceMappingURL=primary-nav.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primary-nav.js","sourceRoot":"","sources":["../../../components/primary-nav/primary-nav.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,GAAI,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAE7C;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,WAAW;IAA/C;;QAqBE;;WAEG;QAEC,iBAAY,GAAW,MAAM,CAAC;IAgBpC,CAAC;IAdC,MAAM;QACF,MAAM,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,CAAC,oBAAoB,EAAE;YACvE,kCAAkC,EAAE,IAAI,CAAC,QAAQ,KAAK,cAAc;YACpE,8BAA8B,EAAE,IAAI,CAAC,QAAQ,KAAK,IAAI;SACzD,CAAC,CAAC;QAEH,OAAO,IAAI,CAAA;yBACQ,IAAI,CAAC,YAAY,YAAY,mBAAmB;;;;;KAKpE,CAAC;IACJ,CAAC;;AAvCQ,qBAAM,GAAG,CAAC,MAAM,CAAC,AAAX,CAAY;AAOvB;IADH,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDACpB;AAWnB;IADH,QAAQ,EAAE;gDACmB;AAM1B;IADH,QAAQ,EAAE;oDACuB;AAkBpC,IAAI,cAAc,CAAC,GAAG,CAAC,kBAAkB,CAAC,KAAK,SAAS,EAAE,CAAC;IACvD,cAAc,CAAC,MAAM,CAAC,kBAAkB,EAAE,cAAc,CAAC,CAAC;AAC9D,CAAC;AAQD,eAAe,cAAc,CAAC","sourcesContent":["import { html, } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { Cre8Element } from '../cre8-element';\nimport styles from './primary-nav.styles.js';\n\n/**\n * @slot - The primary navigation items\n */\nexport class Cre8PrimaryNav extends Cre8Element {\n static styles = [styles];\n\n /**\n * Inverted variant\n * 1) Used for dark backgrounds\n */\n @property({ type: Boolean, reflect: true })\n inverted?: boolean;\n\n /**\n * Behavior variant\n * <cre8-text-passage size=\"sm\">\n * <ul>\n * <li>**side-by-side** keeps the primary nav item always in a horizontal pattern</li>\n * </ul>\n * </cre8-text-passage>\n */\n @property()\n behavior?: 'side-by-side';\n\n /**\n * aria-label attribute to designate at name for the nav. Can be override by user\n */\n @property()\n navAriaLabel: string = 'main';\n\n render() {\n const componentClassNames = this.componentClassNames('cre8-c-primary-nav', {\n 'cre8-c-primary-nav--side-by-side': this.behavior === 'side-by-side',\n 'cre8-c-primary-nav--inverted': this.inverted === true,\n });\n\n return html`\n <nav aria-label=\"${this.navAriaLabel}\" class=\"${componentClassNames}\">\n <ul class=\"cre8-c-primary-nav__list\">\n <slot></slot>\n </ul>\n </nav>\n `;\n }\n}\n\nif (customElements.get('cre8-primary-nav') === undefined) {\n customElements.define('cre8-primary-nav', Cre8PrimaryNav);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'cre8-primary-nav': Cre8PrimaryNav;\n }\n}\n\nexport default Cre8PrimaryNav;\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}.cre8-c-primary-nav--inverted{--cre8-primary-nav-link-color: var(--cre8-color-content-knockout)}.cre8-c-primary-nav__list{display:flex;flex-direction:column;margin:0;padding:0;list-style:none}.cre8-c-primary-nav--side-by-side .cre8-c-primary-nav__list{flex-direction:row}@media all and (min-width: 960px){.cre8-c-primary-nav__list{flex-direction:row}}`;
3
+ export default styles;
4
+ //# sourceMappingURL=primary-nav.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primary-nav.styles.js","sourceRoot":"","sources":["../../../components/primary-nav/primary-nav.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,MAAM,GAAG,GAAG,CAAA,ymEAAymE,CAAC;AAC5nE,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}.cre8-c-primary-nav--inverted{--cre8-primary-nav-link-color: var(--cre8-color-content-knockout)}.cre8-c-primary-nav__list{display:flex;flex-direction:column;margin:0;padding:0;list-style:none}.cre8-c-primary-nav--side-by-side .cre8-c-primary-nav__list{flex-direction:row}@media all and (min-width: 960px){.cre8-c-primary-nav__list{flex-direction:row}}`;\nexport default styles;\n"]}
@@ -1,104 +1,141 @@
1
- import { css as h, html as a } from "lit";
2
- import { ifDefined as p } from "lit-html/directives/if-defined.js";
3
- import { property as o, state as v } from "lit/decorators.js";
4
- import { Cre8Element as f } from "../cre8-element.js";
5
- const y = h`*,::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}.cre8-c-primary-nav__item{border-bottom-width:var(--cre8-border-width-default);border-bottom-style:var(--cre8-border-style-default);border-bottom-color:var(--cre8-color-border-subtle)}@media all and (min-width: 960px){.cre8-c-primary-nav__item{border-bottom:none}}.cre8-c-primary-nav__item-content{display:flex;align-items:baseline}.cre8-c-primary-nav__link{font-family:var(--cre8-typography-label-default-font-family);font-size:var(--cre8-typography-label-default-font-size);font-weight:var(--cre8-typography-label-default-font-weight);line-height:var(--cre8-typography-label-default-line-height);text-decoration:var(--cre8-typography-label-default-text-decoration);text-transform:var(--cre8-typography-label-default-text-transform);display:flex;align-items:center;appearance:none;background:rgba(0,0,0,0);border:none;white-space:nowrap;width:100%;margin:0;padding:1rem 2rem;color:var(--cre8-primary-nav-link-color, var(--cre8-color-header-menu-content-default));text-decoration:none;transition:all var(--cre8-anim-fade-quick) var(--cre8-anim-ease);cursor:pointer}.cre8-c-primary-nav__link:hover,.cre8-c-primary-nav__link:focus-visible{background:var(--cre8-color-header-menu-bg-hover);color:var(--cre8-color-header-menu-content-hover)}.cre8-c-primary-nav__link:active{border-color:var(--cre8-color-header-menu-border-pressed);background:var(--cre8-color-header-menu-bg-pressed);color:var(--cre8-color-header-menu-content-pressed)}.cre8-c-primary-nav__item.cre8-is-active .cre8-c-primary-nav__link{background:var(--cre8-color-bg-brand);color:var(--cre8-color-header-menu-content-hover)}@media all and (min-width: 960px){.cre8-c-primary-nav__link{padding:1rem 0.5rem}}@media all and (min-width: 960px){.cre8-c-primary-nav__link{padding:1rem;border-bottom:none}}cre8-icon-legacy{--cre8-icon-height: 0.75rem;--cre8-icon-width: 0.75rem;margin-left:auto;transition:transform var(--cre8-anim-fade-quick) var(--cre8-anim-ease)}.cre8-c-primary-nav__item.cre8-is-active cre8-icon-legacy{transform:rotate(-180deg)}@media all and (min-width: 960px){cre8-icon-legacy{margin-left:0.5rem}}.cre8-c-primary-nav__item-panel{visibility:hidden;width:100%;height:0;overflow:hidden;background:rgba(0,0,0,0);opacity:0;transition:all 0s var(--cre8-anim-ease);z-index:-1}@media all and (min-width: 960px){.cre8-c-primary-nav__item-panel{position:absolute;top:100%;left:0;height:auto;box-shadow:var(--cre8-theme-box-shadow-md)}}.cre8-c-primary-nav__item.cre8-is-active .cre8-c-primary-nav__item-panel{display:block;visibility:visible;height:auto;padding-top:2rem;padding-bottom:2rem;background:var(--cre8-color-bg-default);opacity:1;z-index:1;transition:opacity var(--cre8-anim-fade-quick) var(--cre8-anim-ease)}.cre8-c-primary-nav__item--megamenu .cre8-c-primary-nav__item-panel-inner{max-width:70rem;padding-right:2rem;padding-left:2rem;margin:0 auto}.cre8-c-primary-nav__item-before{margin-right:0.5rem}.cre8-c-primary-nav__item-after{margin-left:0.5rem}`;
6
- var u = Object.defineProperty, n = (d, e, r, c) => {
7
- for (var i = void 0, s = d.length - 1, m; s >= 0; s--)
8
- (m = d[s]) && (i = m(e, r, i) || i);
9
- return i && u(e, r, i), i;
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 l = class l extends f {
12
- /**
13
- * Initialize functions
14
- */
15
- constructor() {
16
- super(), this.text = "Nav item", this.href = "#", this.iconName = "caret-down", this._handleOnClickOutside = this._handleOnClickOutside.bind(this), this._clickHandler = this._clickHandler.bind(this);
17
- }
18
- /**
19
- * Connected Callback lifecycle
20
- */
21
- connectedCallback() {
22
- this.setAttribute("role", "listitem"), super.connectedCallback(), document.addEventListener("mousedown", this._handleOnClickOutside, !1);
23
- }
24
- /**
25
- * Disconnected callback lifecycle
26
- * 1) Remove window resize event listener
27
- */
28
- disconnectedCallback() {
29
- document.removeEventListener("mousedown", this._handleOnClickOutside, !1), super.disconnectedCallback();
30
- }
31
- /**
32
- * Handle click outside the component
33
- * 1) Close the show hide panel on click outside
34
- * 2) If the nav is already closed then we don't care about outside clicks and we
35
- * can bail early
36
- * 3) By the time a user clicks on the page the shadowRoot will almost certainly be
37
- * defined, but TypeScript isn't that trusting and sees this.shadowRoot as possibly
38
- * undefined. To work around that we'll check that we have a shadowRoot (and a
39
- * rendered .host) element here to appease the TypeScript compiler. This should never
40
- * actually be shown or run for a human end user.
41
- * 4) Check to see if we clicked inside the active navigation item
42
- * 5) If the navigation is active and we've clicked outside of the nav then it should
43
- * be closed.
44
- */
45
- _handleOnClickOutside(e) {
46
- if (!this.isActive)
47
- return;
48
- if (!this.shadowRoot?.host)
49
- throw Error("Could not determine navigation context during click handler");
50
- const r = e.composedPath().includes(this.shadowRoot.host);
51
- this.isActive && !r && (this.isActive = !1);
52
- }
53
- /**
54
- * Toggle active state of primary nav item
55
- * 1) Remove isActive state from all sibling elements
56
- * 2) Toggle active state of element selected
57
- */
58
- _clickHandler(e) {
59
- e.preventDefault(), this.parentNode && this.parentNode.querySelectorAll("cre8-primary-nav-item").forEach((c) => {
60
- c !== this && (c.isActive = !1);
61
- }), this.isActive = !this.isActive;
62
- }
63
- _closePanel() {
64
- this.isActive = !1;
65
- }
66
- _handleOnKeyDown(e) {
67
- if (e.key === "Escape" && this.isActive === !0) {
68
- this._closePanel();
69
- const r = this.shadowRoot?.querySelector(
70
- ".cre8-c-primary-nav__link"
71
- );
72
- r && setTimeout(() => {
73
- r.focus();
74
- }, 1);
7
+ import { html, } from 'lit';
8
+ import { ifDefined } from 'lit-html/directives/if-defined.js';
9
+ import { property, state } from 'lit/decorators.js';
10
+ import { Cre8Element } from '../cre8-element';
11
+ import styles from './primary-nav-item.styles.js';
12
+ /**
13
+ * @slot - The label for the navigation item
14
+ */
15
+ export class Cre8PrimaryNavItem extends Cre8Element {
16
+ /**
17
+ * Initialize functions
18
+ */
19
+ constructor() {
20
+ super();
21
+ /**
22
+ * Primary nav item text
23
+ */
24
+ this.text = 'Nav item';
25
+ /**
26
+ * Primary nav item href
27
+ */
28
+ this.href = '#';
29
+ /**
30
+ * Icon name
31
+ */
32
+ this.iconName = 'caret-down';
33
+ this._handleOnClickOutside = this._handleOnClickOutside.bind(this);
34
+ this._clickHandler = this._clickHandler.bind(this);
75
35
  }
76
- }
77
- render() {
78
- const e = this.componentClassNames("cre8-c-primary-nav__item", {
79
- "cre8-is-active": this.isActive === !0,
80
- "cre8-c-primary-nav__item--megamenu": this.megaMenu === !0
81
- });
82
- return this.megaMenu ? a`
83
- <div class="${e}" @keydown=${this._handleOnKeyDown}>
36
+ /**
37
+ * Connected Callback lifecycle
38
+ */
39
+ connectedCallback() {
40
+ this.setAttribute('role', 'listitem');
41
+ super.connectedCallback();
42
+ document.addEventListener('mousedown', this._handleOnClickOutside, false);
43
+ }
44
+ /**
45
+ * Disconnected callback lifecycle
46
+ * 1) Remove window resize event listener
47
+ */
48
+ disconnectedCallback() {
49
+ document.removeEventListener('mousedown', this._handleOnClickOutside, false);
50
+ super.disconnectedCallback();
51
+ }
52
+ /**
53
+ * Handle click outside the component
54
+ * 1) Close the show hide panel on click outside
55
+ * 2) If the nav is already closed then we don't care about outside clicks and we
56
+ * can bail early
57
+ * 3) By the time a user clicks on the page the shadowRoot will almost certainly be
58
+ * defined, but TypeScript isn't that trusting and sees this.shadowRoot as possibly
59
+ * undefined. To work around that we'll check that we have a shadowRoot (and a
60
+ * rendered .host) element here to appease the TypeScript compiler. This should never
61
+ * actually be shown or run for a human end user.
62
+ * 4) Check to see if we clicked inside the active navigation item
63
+ * 5) If the navigation is active and we've clicked outside of the nav then it should
64
+ * be closed.
65
+ */
66
+ _handleOnClickOutside(event) {
67
+ /* 2 */
68
+ if (!this.isActive) {
69
+ return;
70
+ }
71
+ /* 3 */
72
+ if (!this.shadowRoot?.host) {
73
+ throw Error('Could not determine navigation context during click handler');
74
+ }
75
+ /* 4 */
76
+ const didClickInside = event.composedPath().includes(this.shadowRoot.host);
77
+ /* 5 */
78
+ if (this.isActive && !didClickInside) {
79
+ this.isActive = false;
80
+ }
81
+ }
82
+ /**
83
+ * Toggle active state of primary nav item
84
+ * 1) Remove isActive state from all sibling elements
85
+ * 2) Toggle active state of element selected
86
+ */
87
+ _clickHandler(e) {
88
+ e.preventDefault();
89
+ if (this.parentNode) {
90
+ const navItems = this.parentNode.querySelectorAll('cre8-primary-nav-item');
91
+ navItems.forEach((element) => {
92
+ if (element !== this) {
93
+ element.isActive = false; /* 1 */
94
+ }
95
+ });
96
+ }
97
+ this.isActive = !this.isActive; /* 2 */
98
+ }
99
+ _closePanel() {
100
+ this.isActive = false;
101
+ }
102
+ _handleOnKeyDown(e) {
103
+ if (e.key === 'Escape' && this.isActive === true) {
104
+ this._closePanel();
105
+ const navLink = this.shadowRoot?.querySelector('.cre8-c-primary-nav__link');
106
+ if (navLink) {
107
+ setTimeout(() => {
108
+ navLink.focus();
109
+ }, 1);
110
+ }
111
+ }
112
+ }
113
+ render() {
114
+ const componentClassName = this.componentClassNames('cre8-c-primary-nav__item', {
115
+ 'cre8-is-active': this.isActive === true,
116
+ 'cre8-c-primary-nav__item--megamenu': this.megaMenu === true,
117
+ });
118
+ if (this.megaMenu) {
119
+ return html `
120
+ <div class="${componentClassName}" @keydown=${this._handleOnKeyDown}>
84
121
  <div class="cre8-c-primary-nav__item-content">
85
122
  <button
86
123
  class="cre8-c-primary-nav__link"
87
124
  @click=${this._clickHandler}
88
- aria-expanded=${this.isActive === !0}
125
+ aria-expanded=${this.isActive === true}
89
126
  >
90
- ${this.slotNotEmpty("itemBefore") && a`
127
+ ${this.slotNotEmpty('itemBefore') && html `
91
128
  <div class="cre8-c-primary-nav__item-before">
92
129
  <slot name="itemBefore"></slot>
93
130
  </div>
94
131
  `}
95
132
  ${this.text}
96
- ${this.slotNotEmpty("itemAfter") && a`
133
+ ${this.slotNotEmpty('itemAfter') && html `
97
134
  <div class="cre8-c-primary-nav__item-after">
98
135
  <slot name="itemAfter"></slot>
99
136
  </div>
100
137
  `}
101
- <cre8-icon-legacy aria-hidden="true" name="${p(this.iconName)}"></cre8-icon-legacy>
138
+ <cre8-icon-legacy aria-hidden="true" name="${ifDefined(this.iconName)}"></cre8-icon-legacy>
102
139
  </button>
103
140
  </div>
104
141
  <div class="cre8-c-primary-nav__item-panel">
@@ -107,17 +144,19 @@ const l = class l extends f {
107
144
  </div>
108
145
  </div>
109
146
  </div>
110
- ` : a`
111
- <div class="${e}">
147
+ `;
148
+ }
149
+ return html `
150
+ <div class="${componentClassName}">
112
151
  <div class="cre8-c-primary-nav__item-content">
113
152
  <a class="cre8-c-primary-nav__link" href="${this.href}">
114
- ${this.slotNotEmpty("itemBefore") && a`
153
+ ${this.slotNotEmpty('itemBefore') && html `
115
154
  <div class="cre8-c-primary-nav__item-before">
116
155
  <slot name="itemBefore"></slot>
117
156
  </div>
118
157
  `}
119
158
  ${this.text}
120
- ${this.slotNotEmpty("itemAfter") && a`
159
+ ${this.slotNotEmpty('itemAfter') && html `
121
160
  <div class="cre8-c-primary-nav__item-after">
122
161
  <slot name="itemAfter"></slot>
123
162
  </div>
@@ -126,27 +165,26 @@ const l = class l extends f {
126
165
  </div>
127
166
  </div>
128
167
  `;
129
- }
130
- };
131
- l.styles = [y];
132
- let t = l;
133
- n([
134
- o()
135
- ], t.prototype, "text");
136
- n([
137
- o()
138
- ], t.prototype, "href");
139
- n([
140
- o()
141
- ], t.prototype, "iconName");
142
- n([
143
- o({ type: Boolean, reflect: !0 })
144
- ], t.prototype, "megaMenu");
145
- n([
146
- v()
147
- ], t.prototype, "isActive");
148
- customElements.get("cre8-primary-nav-item") === void 0 && customElements.define("cre8-primary-nav-item", t);
149
- export {
150
- t as Cre8PrimaryNavItem,
151
- t as default
152
- };
168
+ }
169
+ }
170
+ Cre8PrimaryNavItem.styles = [styles];
171
+ __decorate([
172
+ property()
173
+ ], Cre8PrimaryNavItem.prototype, "text", void 0);
174
+ __decorate([
175
+ property()
176
+ ], Cre8PrimaryNavItem.prototype, "href", void 0);
177
+ __decorate([
178
+ property()
179
+ ], Cre8PrimaryNavItem.prototype, "iconName", void 0);
180
+ __decorate([
181
+ property({ type: Boolean, reflect: true })
182
+ ], Cre8PrimaryNavItem.prototype, "megaMenu", void 0);
183
+ __decorate([
184
+ state()
185
+ ], Cre8PrimaryNavItem.prototype, "isActive", void 0);
186
+ if (customElements.get('cre8-primary-nav-item') === undefined) {
187
+ customElements.define('cre8-primary-nav-item', Cre8PrimaryNavItem);
188
+ }
189
+ export default Cre8PrimaryNavItem;
190
+ //# sourceMappingURL=primary-nav-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primary-nav-item.js","sourceRoot":"","sources":["../../../components/primary-nav-item/primary-nav-item.ts"],"names":[],"mappings":"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","sourcesContent":["import { html, } from 'lit';\nimport { ifDefined } from 'lit-html/directives/if-defined.js';\nimport { property, state } from 'lit/decorators.js';\nimport { Cre8Element } from '../cre8-element';\nimport styles from './primary-nav-item.styles.js';\n\n /**\n * @slot - The label for the navigation item\n */\nexport class Cre8PrimaryNavItem extends Cre8Element {\n /**\n * Primary nav item text\n */\n @property()\n text = 'Nav item';\n\n /**\n * Primary nav item href\n */\n @property()\n href = '#';\n\n /**\n * Icon name\n */\n @property()\n iconName?: string = 'caret-down';\n\n /**\n * Append to the class name. Used for passing in utility classes\n */\n @property({ type: Boolean, reflect: true })\n megaMenu?: boolean;\n\n /**\n * Append to the class name. Used for passing in utility classes\n */\n @state()\n isActive?: boolean;\n\n static styles = [styles];\n\n /**\n * Initialize functions\n */\n constructor() {\n super();\n this._handleOnClickOutside = this._handleOnClickOutside.bind(this);\n this._clickHandler = this._clickHandler.bind(this);\n }\n\n /**\n * Connected Callback lifecycle\n */\n connectedCallback() {\n this.setAttribute('role', 'listitem');\n super.connectedCallback();\n\n document.addEventListener('mousedown', this._handleOnClickOutside, false);\n }\n\n /**\n * Disconnected callback lifecycle\n * 1) Remove window resize event listener\n */\n disconnectedCallback() {\n document.removeEventListener('mousedown', this._handleOnClickOutside, false);\n super.disconnectedCallback();\n }\n\n /**\n * Handle click outside the component\n * 1) Close the show hide panel on click outside\n * 2) If the nav is already closed then we don't care about outside clicks and we\n * 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 navigation item\n * 5) If the navigation is active and we've clicked outside of the nav then it should\n * be closed.\n */\n private _handleOnClickOutside(event: MouseEvent) {\n /* 2 */\n if (!this.isActive) {\n return;\n }\n\n /* 3 */\n if (!this.shadowRoot?.host) {\n throw Error('Could not determine navigation context during click handler');\n }\n\n /* 4 */\n const didClickInside = event.composedPath().includes(this.shadowRoot.host);\n\n /* 5 */\n if (this.isActive && !didClickInside) {\n this.isActive = false;\n }\n }\n\n /**\n * Toggle active state of primary nav item\n * 1) Remove isActive state from all sibling elements\n * 2) Toggle active state of element selected\n */\n private _clickHandler(e: MouseEvent) {\n e.preventDefault();\n if (this.parentNode) {\n const navItems = this.parentNode.querySelectorAll('cre8-primary-nav-item');\n navItems.forEach((element: Cre8PrimaryNavItem) => {\n if (element !== this) {\n element.isActive = false; /* 1 */\n }\n });\n }\n this.isActive = !this.isActive; /* 2 */\n }\n\n private _closePanel() {\n this.isActive = false;\n }\n\n private _handleOnKeyDown(e: KeyboardEvent) {\n if (e.key === 'Escape' && this.isActive === true) {\n this._closePanel();\n const navLink = this.shadowRoot?.querySelector<HTMLButtonElement | HTMLAnchorElement>(\n '.cre8-c-primary-nav__link'\n );\n if (navLink) {\n setTimeout(() => {\n navLink.focus();\n }, 1);\n }\n }\n }\n\n render() {\n const componentClassName = this.componentClassNames('cre8-c-primary-nav__item', {\n 'cre8-is-active': this.isActive === true,\n 'cre8-c-primary-nav__item--megamenu': this.megaMenu === true,\n });\n\n if (this.megaMenu) {\n return html`\n <div class=\"${componentClassName}\" @keydown=${this._handleOnKeyDown}>\n <div class=\"cre8-c-primary-nav__item-content\">\n <button\n class=\"cre8-c-primary-nav__link\"\n @click=${this._clickHandler}\n aria-expanded=${this.isActive === true}\n >\n ${this.slotNotEmpty('itemBefore') && html`\n <div class=\"cre8-c-primary-nav__item-before\">\n <slot name=\"itemBefore\"></slot>\n </div>\n `}\n ${this.text}\n ${this.slotNotEmpty('itemAfter') && html`\n <div class=\"cre8-c-primary-nav__item-after\">\n <slot name=\"itemAfter\"></slot>\n </div>\n `}\n <cre8-icon-legacy aria-hidden=\"true\" name=\"${ifDefined(this.iconName)}\"></cre8-icon-legacy>\n </button>\n </div>\n <div class=\"cre8-c-primary-nav__item-panel\">\n <div class=\"cre8-c-primary-nav__item-panel-inner\">\n <slot></slot>\n </div>\n </div>\n </div>\n `;\n }\n return html`\n <div class=\"${componentClassName}\">\n <div class=\"cre8-c-primary-nav__item-content\">\n <a class=\"cre8-c-primary-nav__link\" href=\"${this.href}\">\n ${this.slotNotEmpty('itemBefore') && html`\n <div class=\"cre8-c-primary-nav__item-before\">\n <slot name=\"itemBefore\"></slot>\n </div>\n `}\n ${this.text}\n ${this.slotNotEmpty('itemAfter') && html`\n <div class=\"cre8-c-primary-nav__item-after\">\n <slot name=\"itemAfter\"></slot>\n </div>\n `}\n </a>\n </div>\n </div>\n `;\n }\n}\n\nif (customElements.get('cre8-primary-nav-item') === undefined) {\n customElements.define('cre8-primary-nav-item', Cre8PrimaryNavItem);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'cre8-primary-nav-item': Cre8PrimaryNavItem;\n }\n}\n\nexport default Cre8PrimaryNavItem;\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}.cre8-c-primary-nav__item{border-bottom-width:var(--cre8-border-width-default);border-bottom-style:var(--cre8-border-style-default);border-bottom-color:var(--cre8-color-border-subtle)}@media all and (min-width: 960px){.cre8-c-primary-nav__item{border-bottom:none}}.cre8-c-primary-nav__item-content{display:flex;align-items:baseline}.cre8-c-primary-nav__link{font-family:var(--cre8-typography-label-default-font-family);font-size:var(--cre8-typography-label-default-font-size);font-weight:var(--cre8-typography-label-default-font-weight);line-height:var(--cre8-typography-label-default-line-height);text-decoration:var(--cre8-typography-label-default-text-decoration);text-transform:var(--cre8-typography-label-default-text-transform);display:flex;align-items:center;appearance:none;background:rgba(0,0,0,0);border:none;white-space:nowrap;width:100%;margin:0;padding:1rem 2rem;color:var(--cre8-primary-nav-link-color, var(--cre8-color-header-menu-content-default));text-decoration:none;transition:all var(--cre8-anim-fade-quick) var(--cre8-anim-ease);cursor:pointer}.cre8-c-primary-nav__link:hover,.cre8-c-primary-nav__link:focus-visible{background:var(--cre8-color-header-menu-bg-hover);color:var(--cre8-color-header-menu-content-hover)}.cre8-c-primary-nav__link:active{border-color:var(--cre8-color-header-menu-border-pressed);background:var(--cre8-color-header-menu-bg-pressed);color:var(--cre8-color-header-menu-content-pressed)}.cre8-c-primary-nav__item.cre8-is-active .cre8-c-primary-nav__link{background:var(--cre8-color-bg-brand);color:var(--cre8-color-header-menu-content-hover)}@media all and (min-width: 960px){.cre8-c-primary-nav__link{padding:1rem 0.5rem}}@media all and (min-width: 960px){.cre8-c-primary-nav__link{padding:1rem;border-bottom:none}}cre8-icon-legacy{--cre8-icon-height: 0.75rem;--cre8-icon-width: 0.75rem;margin-left:auto;transition:transform var(--cre8-anim-fade-quick) var(--cre8-anim-ease)}.cre8-c-primary-nav__item.cre8-is-active cre8-icon-legacy{transform:rotate(-180deg)}@media all and (min-width: 960px){cre8-icon-legacy{margin-left:0.5rem}}.cre8-c-primary-nav__item-panel{visibility:hidden;width:100%;height:0;overflow:hidden;background:rgba(0,0,0,0);opacity:0;transition:all 0s var(--cre8-anim-ease);z-index:-1}@media all and (min-width: 960px){.cre8-c-primary-nav__item-panel{position:absolute;top:100%;left:0;height:auto;box-shadow:var(--cre8-theme-box-shadow-md)}}.cre8-c-primary-nav__item.cre8-is-active .cre8-c-primary-nav__item-panel{display:block;visibility:visible;height:auto;padding-top:2rem;padding-bottom:2rem;background:var(--cre8-color-bg-default);opacity:1;z-index:1;transition:opacity var(--cre8-anim-fade-quick) var(--cre8-anim-ease)}.cre8-c-primary-nav__item--megamenu .cre8-c-primary-nav__item-panel-inner{max-width:70rem;padding-right:2rem;padding-left:2rem;margin:0 auto}.cre8-c-primary-nav__item-before{margin-right:0.5rem}.cre8-c-primary-nav__item-after{margin-left:0.5rem}`;
3
+ export default styles;
4
+ //# sourceMappingURL=primary-nav-item.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primary-nav-item.styles.js","sourceRoot":"","sources":["../../../components/primary-nav-item/primary-nav-item.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,MAAM,GAAG,GAAG,CAAA,+nJAA+nJ,CAAC;AAClpJ,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}.cre8-c-primary-nav__item{border-bottom-width:var(--cre8-border-width-default);border-bottom-style:var(--cre8-border-style-default);border-bottom-color:var(--cre8-color-border-subtle)}@media all and (min-width: 960px){.cre8-c-primary-nav__item{border-bottom:none}}.cre8-c-primary-nav__item-content{display:flex;align-items:baseline}.cre8-c-primary-nav__link{font-family:var(--cre8-typography-label-default-font-family);font-size:var(--cre8-typography-label-default-font-size);font-weight:var(--cre8-typography-label-default-font-weight);line-height:var(--cre8-typography-label-default-line-height);text-decoration:var(--cre8-typography-label-default-text-decoration);text-transform:var(--cre8-typography-label-default-text-transform);display:flex;align-items:center;appearance:none;background:rgba(0,0,0,0);border:none;white-space:nowrap;width:100%;margin:0;padding:1rem 2rem;color:var(--cre8-primary-nav-link-color, var(--cre8-color-header-menu-content-default));text-decoration:none;transition:all var(--cre8-anim-fade-quick) var(--cre8-anim-ease);cursor:pointer}.cre8-c-primary-nav__link:hover,.cre8-c-primary-nav__link:focus-visible{background:var(--cre8-color-header-menu-bg-hover);color:var(--cre8-color-header-menu-content-hover)}.cre8-c-primary-nav__link:active{border-color:var(--cre8-color-header-menu-border-pressed);background:var(--cre8-color-header-menu-bg-pressed);color:var(--cre8-color-header-menu-content-pressed)}.cre8-c-primary-nav__item.cre8-is-active .cre8-c-primary-nav__link{background:var(--cre8-color-bg-brand);color:var(--cre8-color-header-menu-content-hover)}@media all and (min-width: 960px){.cre8-c-primary-nav__link{padding:1rem 0.5rem}}@media all and (min-width: 960px){.cre8-c-primary-nav__link{padding:1rem;border-bottom:none}}cre8-icon-legacy{--cre8-icon-height: 0.75rem;--cre8-icon-width: 0.75rem;margin-left:auto;transition:transform var(--cre8-anim-fade-quick) var(--cre8-anim-ease)}.cre8-c-primary-nav__item.cre8-is-active cre8-icon-legacy{transform:rotate(-180deg)}@media all and (min-width: 960px){cre8-icon-legacy{margin-left:0.5rem}}.cre8-c-primary-nav__item-panel{visibility:hidden;width:100%;height:0;overflow:hidden;background:rgba(0,0,0,0);opacity:0;transition:all 0s var(--cre8-anim-ease);z-index:-1}@media all and (min-width: 960px){.cre8-c-primary-nav__item-panel{position:absolute;top:100%;left:0;height:auto;box-shadow:var(--cre8-theme-box-shadow-md)}}.cre8-c-primary-nav__item.cre8-is-active .cre8-c-primary-nav__item-panel{display:block;visibility:visible;height:auto;padding-top:2rem;padding-bottom:2rem;background:var(--cre8-color-bg-default);opacity:1;z-index:1;transition:opacity var(--cre8-anim-fade-quick) var(--cre8-anim-ease)}.cre8-c-primary-nav__item--megamenu .cre8-c-primary-nav__item-panel-inner{max-width:70rem;padding-right:2rem;padding-left:2rem;margin:0 auto}.cre8-c-primary-nav__item-before{margin-right:0.5rem}.cre8-c-primary-nav__item-after{margin-left:0.5rem}`;\nexport default styles;\n"]}