@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,984 +1,237 @@
1
- import { css as v, html as n, nothing as i } from "lit";
2
- import { ifDefined as c } from "lit-html/directives/if-defined.js";
3
- import { property as e, query as y } from "lit/decorators.js";
4
- import { Cre8FormElement as h } from "../cre8-form-element.js";
5
- import "../../icon-D22g8aWB.js";
6
- import "../loading-spinner/loading-spinner.js";
7
- const g = v`
8
- @import '../../design-tokens/core/scss/theming/component';
9
-
10
- :host {
11
- display: inline-flex;
12
- }
13
- :host([fullWidth]) {
14
- display: flex;
15
-
16
- }
17
- /**
18
- * 1) Button or link that has functionality to it
19
- */
20
-
21
- /**
22
- * Primary button
23
- */
24
- .cre8-c-button {
25
- @include cre8-typography-label-default();
26
- width: var(--cre8-button-width, auto);
27
- height: var(--cre8-button-height, auto);
28
- min-width: var(--cre8-button-min-width, auto);
29
- min-height: var(--cre8-button-min-height, auto);
30
- justify-content: center;
31
- text-align: center;
32
- margin-top: var( --cre8-button-margin-top, 0);
33
- margin-bottom: var( --cre8-button-margin-bottom, 0);
34
- margin-left: var( --cre8-button-margin-left, 0);
35
- margin-right: var( --cre8-button-margin-right, 0);
36
- display: inline-flex;
37
- align-items: center;
38
- border-width: var(--cre8-border-width-button-default);
39
- box-shadow: var(--cre8-shadow-button);
40
- padding-top: var(--cre8-button-padding-vertical-medium);
41
- padding-right: var(--cre8-button-padding-horizontal-medium);
42
- padding-bottom: var(--cre8-button-padding-vertical-medium);
43
- padding-left: var(--cre8-button-padding-horizontal-medium);
44
- margin: 0;
45
- cursor: pointer;
46
- border-style: var(--cre8-border-style-default);
47
- transition: revert;
48
- transform: revert;
49
- white-space: nowrap;
50
- &:hover,
51
- &:focus,
52
- &:active,
53
- &:focus-visible {
54
- border-style: var(--cre8-border-style-default);
55
- box-shadow: none;
56
- transform: revert;
57
- transition: revert;
58
- }
59
- &.cre8-c-button--primary {
60
- background: var(--cre8-color-button-primary-bg);
61
- border-width: var(--cre8-border-width-button-default);
62
- border-color: var(--cre8-color-button-primary-border);
63
- border-radius: var(--cre8-border-radius-button);
64
- box-shadow: var(--cre8-shadow-button);
65
- color: var(--cre8-color-button-primary-content);
66
- --cre8-icon-fill: var(--cre8-color-button-primary-content);
67
- &:hover,
68
- &:focus {
69
- box-shadow: none;
70
- --cre8-icon-fill: var(--cre8-color-button-primary-content-hover);
71
- color: var(--cre8-color-button-primary-content-hover);
72
- border-color: var(--cre8-color-button-primary-border-hover);
73
- background: var(--cre8-color-button-primary-bg-hover);
74
- text-decoration: none;
75
- &:focus {
76
- @includefocus();
77
- }
78
- }
79
- &:focus-visible,
80
- &:active,
81
- &.cre8-c-button--loading {
82
- box-shadow: none;
83
- color: var(--cre8-color-button-primary-content-active);
84
- --cre8-icon-fill: var(--cre8-color-button-primary-content-active);
85
- border-color: var(--cre8-color-button-primary-border-active);
86
- background-color: var(--cre8-color-button-primary-bg-active);
87
- }
88
- &:focus-visible{
89
- @includefocus();
90
- }
91
- &.cre8-c-button--loading{
92
- cursor: not-allowed;
93
- }
94
- /**
95
- * Disabled primary and secondary button
96
- */
97
- &:disabled {
98
- box-shadow: none;
99
- background-color: var(--cre8-color-button-primary-bg-disabled);
100
- border-color: var(--cre8-color-button-primary-border-disabled);
101
- color: var(--cre8-color-button-primary-content-disabled);
102
- --cre8-icon-fill: var(--cre8-color-button-primary-content-disabled);
103
- cursor: not-allowed;
104
- outline: none;
105
- &:hover,
106
- &:focus,
107
- &:active,
108
- &:focus-visible {
109
- outline: none;
110
- background-color: var(--cre8-color-button-primary-bg-disabled);
111
- border-color: var(--cre8-color-button-primary-border-disabled);
112
- color: var(--cre8-color-button-primary-content-disabled);
113
- --cre8-icon-fill: var(--cre8-color-button-primary-content-disabled);
114
- }
115
- }
116
- }
117
-
118
- /**
119
- * Primary button inverse
120
- */
121
- &.cre8-c-button--primary.cre8-c-button--inverse {
122
- background: var(--cre8-color-button-primary-inverse-bg);
123
- border-width: var(--cre8-border-width-button-default);
124
- border-color: var(--cre8-color-button-primary-inverse-border);
125
- border-radius: var(--cre8-border-radius-button);
126
- box-shadow: var(--cre8-shadow-button);
127
- color: var(--cre8-color-button-primary-inverse-content);
128
- --cre8-icon-fill: var(--cre8-color-button-primary-inverse-content);
129
- &:hover,
130
- &:focus {
131
- box-shadow: none;
132
- --cre8-icon-fill: var(--cre8-color-button-primary-inverse-content-hover);
133
- color: var(--cre8-color-button-primary-inverse-content-hover);
134
- border-color: var(--cre8-color-button-primary-inverse-border-hover);
135
- background: var(--cre8-color-button-primary-inverse-bg-hover);
136
- text-decoration: none;
137
- &:focus {
138
- @includefocus();
139
- }
140
- }
141
- &:focus-visible,
142
- &:active,
143
- &.cre8-c-button--loading {
144
- box-shadow: none;
145
- color: var(--cre8-color-button-primary-inverse-content-active);
146
- --cre8-icon-fill: var(--cre8-color-button-primary-inverse-content-active);
147
- border-color: var(--cre8-color-button-primary-inverse-border-active);
148
- background-color: var(--cre8-color-button-primary-inverse-bg-active);
149
- }
150
- &:focus-visible{
151
- @includefocus();
152
- }
153
- &.cre8-c-button--loading{
154
- cursor: not-allowed;
155
- }
156
-
157
- &:disabled {
158
- box-shadow: none;
159
- background-color: var(--cre8-color-button-primary-inverse-bg-disabled);
160
- border-color: var(--cre8-color-button-primary-inverse-border-disabled);
161
- color: var(--cre8-color-button-primary-inverse-content-disabled);
162
- --cre8-icon-fill: var(--cre8-color-button-primary-inverse-content-disabled);
163
- cursor: not-allowed;
164
- outline: none;
165
- &:hover,
166
- &:focus,
167
- &:active,
168
- &:focus-visible {
169
- outline: none;
170
- background-color: var(--cre8-color-button-primary-inverse-bg-disabled);
171
- border-color: var(--cre8-color-button-primary-inverse-border-disabled);
172
- color: var(--cre8-color-button-primary-inverse-content-disabled);
173
- --cre8-icon-fill: var(--cre8-color-button-primary-inverse-content-disabled);
174
- }
175
- }
176
- }
177
-
178
- /**
179
- * Secondary button
180
- * The icon button shares the styles of the standard secondary button
181
- */
182
- &.cre8-c-button--secondary {
183
- background-color: var(--cre8-color-button-secondary-bg);
184
- border-color: var(--cre8-color-button-secondary-border);
185
- color: var(--cre8-color-button-secondary-content);
186
- --cre8-icon-fill: var(--cre8-color-button-secondary-content);
187
- border-radius: var(--cre8-border-radius-button);
188
- border-width: var(--cre8-border-width-button-default);
189
-
190
- &:hover,
191
- &:focus {
192
- background-color: var(--cre8-color-button-secondary-bg-hover);
193
- border-color: var(--cre8-color-button-secondary-border-hover);
194
- color: var(--cre8-color-button-secondary-content-hover);
195
- --cre8-icon-fill: var(--cre8-color-button-secondary-content-hover);
196
- &:focus {
197
- @includefocus();
198
- }
199
- }
200
- &:focus-visible,
201
- &:active,
202
- &.cre8-c-button--loading {
203
- transition: none;
204
- transform: none;
205
- background-color: var(--cre8-color-button-secondary-bg-active);
206
- border-color: var(--cre8-color-button-secondary-border-active);
207
- color: var(--cre8-color-button-secondary-content-active);
208
- --cre8-icon-fill: var(--cre8-color-button-secondary-content-active);
209
- }
210
- &:focus-visible {
211
- @includefocus();
212
- }
213
- &.cre8-c-button--loading {
214
- cursor: not-allowed;
215
- }
216
-
217
- &:disabled {
218
- box-shadow: none;
219
- background-color: var(--cre8-color-button-secondary-bg-disabled);
220
- border-color: var(--cre8-color-button-secondary-border-disabled);
221
- color: var(--cre8-color-button-secondary-content-disabled);
222
- --cre8-icon-fill: var(--cre8-color-button-secondary-content-disabled);
223
- outline: none;
224
- border-radius: var(--cre8-border-radius-button);
225
- border-width: var(--cre8-border-width-button-default);
226
- cursor: not-allowed;
227
- &:hover,
228
- &:focus,
229
- &:active,
230
- &:focus-visible {
231
- outline: none;
232
- background-color: var(--cre8-color-button-secondary-bg-disabled);
233
- border-color: var(--cre8-color-button-secondary-border-disabled);
234
- color: var(--cre8-color-button-secondary-content-disabled);
235
- --cre8-icon-fill: var(--cre8-color-button-secondary-content-disabled);
236
- }
237
- }
238
- }
239
-
240
- /**
241
- * Secondary button neutral
242
- */
243
- &.cre8-c-button--secondary.cre8-c-button--neutral {
244
- background-color: var(--cre8-color-button-secondary-neutral-bg);
245
- border-color: var(--cre8-color-button-secondary-neutral-border);
246
- color: var(--cre8-color-button-secondary-neutral-content);
247
- --cre8-icon-fill: var(--cre8-color-button-secondary-neutral-content);
248
- border-radius: var(--cre8-border-radius-button);
249
- border-width: var(--cre8-border-width-button-default);
250
-
251
- &:hover,
252
- &:focus {
253
- background-color: var(--cre8-color-button-secondary-neutral-bg-hover);
254
- border-color: var(--cre8-color-button-secondary-neutral-border-hover);
255
- color: var(--cre8-color-button-secondary-neutral-content-hover);
256
- --cre8-icon-fill: var(--cre8-color-button-secondary-neutral-content-hover);
257
- &:focus {
258
- @includefocus();
259
- }
260
- }
261
- &:focus-visible,
262
- &:active,
263
- &.cre8-c-button--loading {
264
- transition: none;
265
- transform: none;
266
- background-color: var(--cre8-color-button-secondary-neutral-bg-active);
267
- border-color: var(--cre8-color-button-secondary-neutral-border-active);
268
- color: var(--cre8-color-button-secondary-neutral-content-active);
269
- --cre8-icon-fill: var(--cre8-color-button-secondary-neutral-content-active);
270
- }
271
- &:focus-visible {
272
- @includefocus();
273
- }
274
-
275
- &:disabled {
276
- box-shadow: none;
277
- background-color: var(--cre8-color-button-secondary-neutral-bg-disabled);
278
- border-color: var(--cre8-color-button-secondary-neutral-border-disabled);
279
- color: var(--cre8-color-button-secondary-neutral-content-disabled);
280
- --cre8-icon-fill: var(--cre8-color-button-secondary-neutral-content-disabled);
281
- outline: none;
282
- border-radius: var(--cre8-border-radius-button);
283
- border-width: var(--cre8-border-width-button-default);
284
- cursor: not-allowed;
285
- &:hover,
286
- &:focus,
287
- &:active,
288
- &:focus-visible {
289
- outline: none;
290
- background-color: var(--cre8-color-button-secondary-neutral-bg-disabled);
291
- border-color: var(--cre8-color-button-secondary-neutral-border-disabled);
292
- color: var(--cre8-color-button-secondary-neutral-content-disabled);
293
- --cre8-icon-fill: var(--cre8-color-button-secondary-neutral-content-disabled);
294
- }
295
- }
296
- }
297
-
298
- /**
299
- * Secondary button inverse
300
- */
301
- &.cre8-c-button--secondary.cre8-c-button--inverse {
302
- background-color: var(--cre8-color-button-secondary-inverse-bg);
303
- border-color: var(--cre8-color-button-secondary-inverse-border);
304
- color: var(--cre8-color-button-secondary-inverse-content);
305
- --cre8-icon-fill: var(--cre8-color-button-secondary-inverse-content);
306
- border-radius: var(--cre8-border-radius-button);
307
- border-width: var(--cre8-border-width-button-default);
308
-
309
- &:hover,
310
- &:focus {
311
- background-color: var(--cre8-color-button-secondary-inverse-bg-hover);
312
- border-color: var(--cre8-color-button-secondary-inverse-border-hover);
313
- color: var(--cre8-color-button-secondary-inverse-content-hover);
314
- --cre8-icon-fill: var(--cre8-color-button-secondary-inverse-content-hover);
315
- &:focus {
316
- @includefocus();
317
- }
318
- }
319
- &:focus-visible,
320
- &:active,
321
- &.cre8-c-button--loading {
322
- transition: none;
323
- transform: none;
324
- background-color: var(--cre8-color-button-secondary-inverse-bg-active);
325
- border-color: var(--cre8-color-button-secondary-inverse-border-active);
326
- color: var(--cre8-color-button-secondary-inverse-content-active);
327
- --cre8-icon-fill: var(--cre8-color-button-secondary-inverse-content-active);
328
- }
329
- &:focus-visible {
330
- @includefocus();
331
- }
332
-
333
- &:disabled {
334
- box-shadow: none;
335
- background-color: var(--cre8-color-button-secondary-inverse-bg-disabled);
336
- border-color: var(--cre8-color-button-secondary-inverse-border-disabled);
337
- color: var(--cre8-color-button-secondary-inverse-content-disabled);
338
- --cre8-icon-fill: var(--cre8-color-button-secondary-inverse-content-disabled);
339
- outline: none;
340
- border-radius: var(--cre8-border-radius-button);
341
- border-width: var(--cre8-border-width-button-default);
342
- cursor: not-allowed;
343
- &:hover,
344
- &:focus,
345
- &:active,
346
- &:focus-visible {
347
- outline: none;
348
- background-color: var(--cre8-color-button-secondary-inverse-bg-disabled);
349
- border-color: var(--cre8-color-button-secondary-inverse-border-disabled);
350
- color: var(--cre8-color-button-secondary-inverse-content-disabled);
351
- --cre8-icon-fill: var(--cre8-color-button-secondary-inverse-content-disabled);
352
- }
353
- }
354
- }
355
-
356
- /**
357
- * Secondary button neutral inverse
358
- */
359
- &.cre8-c-button--secondary.cre8-c-button--neutral.cre8-c-button--inverse {
360
- background-color: var(--cre8-color-button-secondary-neutral-inverse-bg);
361
- border-color: var(--cre8-color-button-secondary-neutral-inverse-border);
362
- color: var(--cre8-color-button-secondary-neutral-inverse-content);
363
- --cre8-icon-fill: var(--cre8-color-button-secondary-neutral-inverse-content);
364
- border-radius: var(--cre8-border-radius-button);
365
- border-width: var(--cre8-border-width-button-default);
366
-
367
- &:hover,
368
- &:focus {
369
- @includefocus();
370
- background-color: var(--cre8-color-button-secondary-neutral-bg-active);
371
- border-color: var(--cre8-color-button-secondary-neutral-inverse-border-active);
372
- outline-color: var(--cre8-color-button-secondary-neutral-inverse-outline);
373
- color: var(--cre8-color-button-secondary-neutral-inverse-content-active);
374
- --cre8-icon-fill: var(--cre8-color-button-secondary-neutral-inverse-content-active);
375
- }
376
-
377
- &:focus-visible,
378
- &:active,
379
- &.cre8-c-button--loading {
380
- transition: none;
381
- transform: none;
382
- background-color: var(--cre8-color-button-secondary-neutral-inverse-bg-active);
383
- border-color: var(--cre8-color-button-secondary-neutral-inverse-border-active);
384
- color: var(--cre8-color-button-secondary-neutral-inverse-content-active);
385
- --cre8-icon-fill: var(--cre8-color-button-secondary-neutral-inverse-content-active);
386
- }
387
- &:focus-visible {
388
- @includefocus();
389
- }
390
-
391
- &:disabled {
392
- box-shadow: none;
393
- background-color: var(--cre8-color-button-secondary-neutral-inverse-bg-disabled);
394
- border-color: var(--cre8-color-button-secondary-neutral-inverse-border-disabled);
395
- color: var(--cre8-color-button-secondary-neutral-inverse-content-disabled);
396
- --cre8-icon-fill: var(--cre8-color-button-secondary-neutral-inverse-content-disabled);
397
- outline: none;
398
- border-radius: var(--cre8-border-radius-button);
399
- border-width: var(--cre8-border-width-button-default);
400
- cursor: not-allowed;
401
- &:hover,
402
- &:focus,
403
- &:active,
404
- &:focus-visible {
405
- outline: none;
406
- background-color: var(--cre8-color-button-secondary-neutral-inverse-bg-disabled);
407
- border-color: var(--cre8-color-button-secondary-neutral-inverse-border-disabled);
408
- color: var(--cre8-color-button-secondary-neutral-inverse-content-disabled);
409
- --cre8-icon-fill: var(--cre8-color-button-secondary-neutral-inverse-content-disabled);
410
- }
411
- }
412
- }
413
-
414
- /**
415
- * Tertiary button
416
- */
417
- &.cre8-c-button--tertiary {
418
- border-radius: var(--cre8-border-radius-button);
419
- background-color: var(--cre8-color-button-tertiary-bg);
420
- border-width: var(--cre8-border-width-button-default);
421
- border-color: var(--cre8-color-button-tertiary-border);
422
- color: var(--cre8-color-button-tertiary-content);
423
- --cre8-icon-fill: var(--cre8-color-button-tertiary-content);
424
- box-shadow: none;
425
- &:hover,
426
- &:focus {
427
- border-radius: var(--cre8-border-radius-button);
428
- background-color: var(--cre8-color-button-tertiary-bg-hover);
429
- border-width: var(--cre8-border-width-button-default, --cre8-border-width-none);
430
- border-color: var(--cre8-color-button-tertiary-border-hover);
431
- color: var(--cre8-color-button-tertiary-content-hover);
432
- --cre8-icon-fill: var(--cre8-color-button-tertiary-content-hover);
433
- &:focus {
434
- @includefocusTertiary();
435
- }
436
- }
437
-
438
- &:focus-visible,
439
- &:active,
440
- &.cre8-c-button--loading {
441
- border-radius: var(--cre8-border-radius-button);
442
- background-color: var(--cre8-color-button-tertiary-bg-active);
443
- border-color: var(--cre8-color-button-tertiary-border-active);
444
- border-width: var(--cre8-border-width-button-default);
445
- color: var(--cre8-color-button-tertiary-content-active);
446
- --cre8-icon-fill: var(--cre8-color-button-tertiary-content-active);
447
- }
448
- &:focus-visible {
449
- @includefocusTertiary();
450
- }
451
- &.cre8-c-button--loading {
452
- cursor: not-allowed;
453
- }
454
- &:disabled {
455
- background-color: var(--cre8-color-button-tertiary-bg-disabled);
456
- border-color: transparent;
457
- color: var(--cre8-color-button-tertiary-content-disabled);
458
- --cre8-icon-fill: var(--cre8-color-button-tertiary-content-disabled);
459
- outline: none;
460
- box-shadow: none;
461
- cursor: not-allowed;
462
-
463
- &:hover,
464
- &:focus {
465
- outline: none;
466
- box-shadow: none;
467
- background-color: var(--cre8-color-button-tertiary-bg-disabled);
468
- color: var(--cre8-color-button-tertiary-content-disabled);
469
- --cre8-icon-fill: var(--cre8-color-button-tertiary-content-disabled);
470
- }
471
- &:active,
472
- &:focus-visible {
473
- outline: none;
474
- box-shadow: none;
475
- background-color: var(--cre8-color-button-tertiary-bg-disabled);
476
- color: var(--cre8-color-button-tertiary-content-disabled);
477
- --cre8-icon-fill: var(--cre8-color-button-tertiary-content-disabled);
478
- }
479
- }
480
- }
481
-
482
- /**
483
- * Tertiary button neutral
484
- */
485
- &.cre8-c-button--tertiary.cre8-c-button--neutral {
486
- background-color: var(--cre8-color-button-tertiary-neutral-bg);
487
- border-color: var(--cre8-color-button-tertiary-border);
488
- color: var(--cre8-color-button-tertiary-neutral-content);
489
- --cre8-icon-fill: var(--cre8-color-button-tertiary-neutral-content);
490
- border-radius: var(--cre8-border-radius-button);
491
- border-width: var(--cre8-border-width-button-default);
492
-
493
- &:hover,
494
- &:focus {
495
- background-color: var(--cre8-color-button-tertiary-neutral-bg-hover);
496
- border-color: var(--cre8-color-button-tertiary-neutral-border-hover);
497
- color: var(--cre8-color-button-tertiary-neutral-content-hover);
498
- --cre8-icon-fill: var(--cre8-color-button-tertiary-neutral-content-hover);
499
- outline-color: var(--cre8-color-button-tertiary-neutral-outline);
500
- }
501
-
502
- &:focus-visible,
503
- &:active,
504
- &.cre8-c-button--loading {
505
- transition: none;
506
- transform: none;
507
- background-color: var(--cre8-color-button-tertiary-neutral-bg-active);
508
- border-color: var(--cre8-color-button-tertiary-neutral-border-active);
509
- color: var(--cre8-color-button-tertiary-neutral-content-active);
510
- --cre8-icon-fill: var(--cre8-color-button-tertiary-neutral-content-active);
511
- }
512
-
513
- &:focus-visible {
514
- @includefocus();
515
- }
516
-
517
- &:disabled {
518
- box-shadow: none;
519
- background-color: var(--cre8-color-button-tertiary-neutral-bg-disabled);
520
- border-color: var(--cre8-color-button-tertiary-neutral-border-disabled);
521
- color: var(--cre8-color-button-tertiary-neutral-content-disabled);
522
- --cre8-icon-fill: var(--cre8-color-button-tertiary-neutral-content-disabled);
523
- outline: none;
524
- border-radius: var(--cre8-border-radius-button);
525
- border-width: var(--cre8-border-width-button-default);
526
-
527
- cursor: not-allowed;
528
- }
529
- }
530
-
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;
6
+ };
7
+ import { html, nothing, } from 'lit';
8
+ import { ifDefined } from 'lit-html/directives/if-defined.js';
9
+ import { property, query } from 'lit/decorators.js';
10
+ import { Cre8FormElement } from '../cre8-form-element';
11
+ import '../icon/icon';
12
+ import '../loading-spinner/loading-spinner';
13
+ import styles from './button.styles.js';
531
14
  /**
532
- * Tertiary button inverse
15
+ * The size and state of buttons on the screen serve as visual cues for the user
16
+ * about what they can do and what they should do next.
17
+ * They indicate the availability and priority of the action on the page.
18
+ *
19
+ * - Buttons are a single call-to-action where a single click performs that action
20
+ * - Use buttons when you are performing an action which is almost always on the same page
21
+ * - Use a link instead of a button when you're navigating to another place
22
+ *
23
+ * ## How to Use
24
+ *
25
+ * Buttons are distinguished by three key properties:
26
+ *
27
+ * - **Visual Priority**: Style and size: Primary, Secondary, or Tertiary styles;
28
+ * each with large and small variations
29
+ * - **State**: Interaction state: hover/click (press), focus, disabled,
30
+ * and submitting/loading (only for large buttons)
31
+ * - **Brand**: Styles determined by the site or component theme
32
+ *
33
+ * ### Usage Guidelines
34
+ *
35
+ * Primary, Secondary and Tertiary styles emphasize or de-emphasize an action. They also define
36
+ * background, font style, and border colors. Large and small sizing assists with visual priority by defining button
37
+ * heights, left and right internal padding, and font-size.
38
+ *
39
+ * #### System Feedback
40
+ * Each button has a default and hover/click (press) state that give the user feedback
41
+ * that they have successfully interacted with a button.
42
+ * Button presses should always be combined with other types of timely system feedback.
43
+ * Examples of system feedback may be a page refresh, exposing additional controls or content,
44
+ * dialogs, alerts and notifications.
45
+ * If there is perceived a delay in system response, generally due to technical constraints,
46
+ * provide a progress or loading indicator.
47
+ *
48
+ * #### Button Text
49
+ *
50
+ * - Button text should be as short and simple as possible, ideally a maximum of 3 words.
51
+ * - Use Title Case for readability.
52
+ * - They should not include punctuation (exception: "Loading...").
53
+ * - They should not be used as an indicator of what happens on the next page, or as a substitute
54
+ * for a progress meter.
55
+ *
56
+ * #### Button With Icon
57
+ *
58
+ * For button with icon:
59
+ * - **iconRotateDegree** & **iconFlipDirection** props are optional.
60
+ * - They are used to set up the correct direction for icons, for example,
61
+ * arrows, caret up or caret down.
62
+ *
63
+ * #### Button Styling
64
+ *
65
+ * - DO use only the styles of the brand you are working on.
66
+ * - DO NOT combine styles, even if the page is co-branded.
67
+ *
68
+ * #### Button Sizes
69
+ * - DO always pair like sizes together and maintain the hierarchy of Primary and Secondary/Tertiary.
70
+ * - DO NOT mix sizes of buttons when they are used together as a group.
71
+ *
72
+ * #### Input Pairing
73
+ *
74
+ * Primary and Secondary buttons may be paired with input fields.
75
+ * Only one Primary button may appear on each screen.
76
+ * Use the Secondary button when there are multiple in-context buttons
77
+ * and/or when there is an emphasized page level button.
78
+ * When used in a form context, the button's `type` needs to be `submit` to pass along form data.
79
+ *
80
+ * - DO use only large buttons with input fields.
81
+ * - DO NOT use small buttons with input fields.
82
+ *
533
83
  */
534
- &.cre8-c-button--tertiary.cre8-c-button--inverse {
535
- border-radius: var(--cre8-border-radius-button);
536
- background-color: var(--cre8-color-button-tertiary-inverse-bg);
537
- border-width: var(--cre8-border-width-button-default);
538
- border-color: var(--cre8-color-button-tertiary-inverse-border);
539
- color: var(--cre8-color-button-tertiary-inverse-content);
540
- --cre8-icon-fill: var(--cre8-color-button-tertiary-inverse-content);
541
- box-shadow: none;
542
-
543
- &:hover,
544
- &:focus {
545
- border-radius: var(--cre8-border-radius-button);
546
- background-color: var(--cre8-color-button-tertiary-inverse-bg-hover);
547
- border-width: var(--cre8-border-width-button-default, --cre8-border-width-none);
548
- border-color: var(--cre8-color-button-tertiary-inverse-border-hover);
549
- color: var(--cre8-color-button-tertiary-inverse-content-hover);
550
- --cre8-icon-fill: var(--cre8-color-button-tertiary-inverse-content-hover);
551
- outline-color: var(--cre8-color-button-tertiary-inverse-outline);
552
- }
553
-
554
- &:focus-visible,
555
- &:active,
556
- &.cre8-c-button--loading {
557
- border-radius: var(--cre8-border-radius-button);
558
- background-color: var(--cre8-color-button-tertiary-inverse-bg-active);
559
- border-color: var(--cre8-color-button-tertiary-inverse-border-active);
560
- border-width: var(--cre8-border-width-button-default);
561
- color: var(--cre8-color-button-tertiary-inverse-content-active);
562
- --cre8-icon-fill: var(--cre8-color-button-tertiary-inverse-content-active);
563
- outline-color: var(--cre8-color-button-tertiary-inverse-outline);
564
- }
565
-
566
- &.cre8-c-button--loading {
567
- cursor: not-allowed;
568
- }
569
- &:disabled {
570
- background-color: var(--cre8-color-button-tertiary-inverse-bg-disabled);
571
- border-color: transparent;
572
- color: var(--cre8-color-button-tertiary-inverse-content-disabled);
573
- --cre8-icon-fill: var(--cre8-color-button-tertiary-inverse-content-disabled);
574
- outline: none;
575
- box-shadow: none;
576
- cursor: not-allowed;
577
-
578
- &:hover,
579
- &:focus {
580
- outline: none;
581
- box-shadow: none;
582
- background-color: var(--cre8-color-button-tertiary-inverse-bg-disabled);
583
- color: var(--cre8-color-button-tertiary-inverse-content-disabled);
584
- --cre8-icon-fill: var(--cre8-color-button-tertiary-inverse-content-disabled);
585
- }
586
- &:active,
587
- &:focus-visible {
588
- outline: none;
589
- box-shadow: none;
590
- background-color: var(--cre8-color-button-tertiary-inverse-bg-disabled);
591
- color: var(--cre8-color-button-tertiary-inverse-content-disabled);
592
- --cre8-icon-fill: var(--cre8-color-button-tertiary-inverse-content-disabled);
593
- }
594
- }
595
- }
596
-
597
- /**
598
- * Tertiary Neutral button inverse
599
- */
600
- &.cre8-c-button--tertiary.cre8-c-button--neutral.cre8-c-button--inverse {
601
- border-radius: var(--cre8-border-radius-button);
602
- background-color: var(--cre8-color-button-tertiary-neutral-inverse-bg);
603
- border-width: var(--cre8-border-width-button-default);
604
- color: var(--cre8-color-button-tertiary-neutral-inverse-content);
605
- --cre8-icon-fill: var(--cre8-color-button-tertiary-neutral-inverse-content);
606
- box-shadow: none;
607
-
608
- &:hover,
609
- &:focus {
610
- border-radius: var(--cre8-border-radius-button);
611
- background-color: var(--cre8-color-button-tertiary-neutral-inverse-bg-hover);
612
- border-width: var(--cre8-border-width-button-default, --cre8-border-width-none);
613
- border-color: var(--cre8-color-button-tertiary-neutral-inverse-border-hover);
614
- color: var(--cre8-color-button-tertiary-neutral-inverse-content-hover);
615
- --cre8-icon-fill: var(--cre8-color-button-tertiary-neutral-inverse-content-hover);
616
- outline-color: var(--cre8-color-button-tertiary-neutral-inverse-outline);
617
- }
618
-
619
- &:focus-visible,
620
- &:active,
621
- &.cre8-c-button--loading {
622
- border-radius: var(--cre8-border-radius-button);
623
- background-color: var(--cre8-color-button-tertiary-neutral-inverse-bg-active);
624
- border-color: var(--cre8-color-button-tertiary-neutral-inverse-border-active);
625
- border-width: var(--cre8-border-width-button-default);
626
- color: var(--cre8-color-button-tertiary-neutral-inverse-content-active);
627
- --cre8-icon-fill: var(--cre8-color-button-tertiary-neutral-inverse-content-active);
628
- outline-color: var(--cre8-color-button-tertiary-neutral-inverse-outline);
629
- }
630
-
631
- &.cre8-c-button--loading {
632
- cursor: not-allowed;
633
- }
634
-
635
- &:disabled {
636
- background-color: var(--cre8-color-button-tertiary-neutral-inverse-bg-disabled);
637
- border-color: transparent;
638
- color: var(--cre8-color-button-tertiary-neutral-inverse-content-disabled);
639
- --cre8-icon-fill: var(--cre8-color-button-tertiary-neutral-inverse-content-disabled);
640
- outline: none;
641
- box-shadow: none;
642
- cursor: not-allowed;
643
- }
644
- }
645
-
646
- &.cre8-c-button.cre8-c-button--secondary.cre8-c-button--split-button-text {
647
- border-radius: var(--cre8-border-radius-button) var(--cre8-border-radius-none) var(--cre8-border-radius-none) var(--cre8-border-radius-button);
648
- border-color: var(--cre8-color-button-secondary-border);
649
- border-width: var(--cre8-border-width-button-default);
650
- color: var(--cre8-color-button-secondary-content);
651
- &:active,
652
- &:focus-visible {
653
- outline: none;
654
- }
655
- &.cre8-c-button--lg {
656
- padding: var(--cre8-button-padding-vertical-large) var(--cre8-button-padding-horizontal-large);
84
+ export class Cre8Button extends Cre8FormElement {
85
+ constructor() {
86
+ super(...arguments);
87
+ /**
88
+ * The button text. Should be as short and simple as possible, ideally a maximum of 3 words.
89
+ * - Use Title Case for readability.
90
+ * - Should not include punctuation (exception: "Loading...").
91
+ * - Should not be used as an indicator of what happens on the next page, or as a substitute for a progress meter.
92
+ */
93
+ this.text = 'Button';
94
+ /**
95
+ * Style variant
96
+ * - **primary** renders the button used for primary actions. Presents highest visual priority.
97
+ * When grouped with other buttons, only one primary is allowed
98
+ * - **secondary** renders a secondary button. Presents a lower visual priority
99
+ * - **tertiary** renders a tertiary button. Presents the lowest visual priority.
100
+ * Should be used in limited amounts - consider if a link (`<a>`) would be more appropriate
101
+ */
102
+ this.variant = 'primary';
103
+ /**
104
+ * Type of button.
105
+ * - **button** (default) button has no default behavior and does nothing unless provided some sort
106
+ * of client-side trigger
107
+ * - **submit** button for submitting form data to a server
108
+ */
109
+ this.type = 'button';
110
+ /**
111
+ * iconRotateDegree is used for <cre8-icon> to set the arrow in the correct direction
112
+ */
113
+ this.iconRotateDegree = 0;
114
+ /**
115
+ * Icon position. Must include the name of the icon with `iconName`
116
+ *
117
+ * - **before** places the icon before the button text
118
+ * - **after** places the icon after the button text
119
+ */
120
+ this.iconPosition = undefined;
121
+ /**
122
+ * Size variants add another way to increase or decrease visual priority of a button.
123
+ * - **sm** Shrinks the button typography and overall size from the default. Use when vertical space is constrained.
124
+ * - **md** This is the default value for the size.
125
+ * - **lg** Increases the button typography and overall size from the default.
126
+ */
127
+ this.size = 'md';
128
+ /**
129
+ * Controls whether your loading status update to voiceover users will occur
130
+ * immediately (used for more urgently needed updates) using `assertive` or at the next convenient
131
+ * pause in their navigation using `polite`.
132
+ */
133
+ this.ariaLive = 'assertive';
657
134
  }
658
- &.cre8-c-button--sm {
659
- padding: var(--cre8-button-padding-vertical-small) var(--cre8-button-padding-horizontal-small);
135
+ formSubmit() {
136
+ const form = this._internals.form;
137
+ if (form) {
138
+ form.requestSubmit();
139
+ }
660
140
  }
661
- }
662
-
663
- &.cre8-c-button.cre8-c-button--icon-only.cre8-c-button--split-button-caret {
664
- padding: var(--cre8-button-padding-vertical-medium);
665
- border-radius: var(--cre8-border-radius-none) var(--cre8-border-radius-button) var(--cre8-border-radius-button) var(--cre8-border-radius-none);
666
- height: 100%;
667
- border-left: none !important ;
668
- border-collapse: collapse;
669
- background: var(--cre8-color-button-secondary-bg);
670
- border-color: var(--cre8-color-button-secondary-border);
671
- border-width: var(--cre8-border-width-button-default);
672
- color: var(--cre8-color-button-secondary-content);
673
- --cre8-icon-fill: var(--cre8-color-button-secondary-content);
674
-
675
- &:hover,
676
- &:focus {
677
- background: var(--cre8-color-button-secondary-bg-hover);
678
- border-color: var(--cre8-color-button-secondary-border-hover);
679
- --cre8-icon-fill: var(--cre8-color-button-secondary-content-hover);
680
- outline: none;
681
- border-left: none;
682
- border-collapse: collapse;
141
+ formReset() {
142
+ const form = this._internals.form;
143
+ if (form) {
144
+ form.reset();
145
+ }
683
146
  }
684
- &:active,
685
- &:focus-visible {
686
- background: var(--cre8-color-button-secondary-bg-active);
687
- border-color: var(--cre8-color-button-secondary-border-active);
688
- --cre8-icon-fill: var(--cre8-color-button-secondary-content-active);
689
- outline: none;
690
- border-left: none;
691
- border-collapse: collapse;
692
- }
693
- }
694
- }
695
-
696
- .cre8-c-button--lg {
697
- padding: var(--cre8-button-padding-vertical-large);
698
- }
699
- .cre8-c-button--sm {
700
- padding: var(--cre8-button-padding-vertical-small);
701
- }
702
-
703
- .cre8-c-button--icon-only {
704
- padding: var(--cre8-button-padding-vertical-small);
705
- color: var(--cre8-icon-fill, currentColor);
706
- }
707
-
708
- /**
709
-  * Full-width button
710
-  */
711
- .cre8-c-button--full-width {
712
- width: 100%;
713
- display: flex;
714
- }
715
-
716
- /**
717
- * Small button
718
- */
719
- .cre8-c-button--sm {
720
- @include cre8-typography-label-small();
721
- padding-top: var(--cre8-button-padding-vertical-small);
722
- padding-right: var(--cre8-button-padding-horizontal-small);
723
- padding-bottom: var(--cre8-button-padding-vertical-small);
724
- padding-left: var(--cre8-button-padding-horizontal-small);
725
- }
726
-
727
- /**
728
- * Small button sized for icon only
729
- */
730
- .cre8-c-button--sm.cre8-c-button--icon-only {
731
- @include cre8-typography-label-small();
732
- padding-top: var(--cre8-button-padding-vertical-small-icon-only);
733
- padding-right: var(--cre8-button-padding-horizontal-small-icon-only);
734
- padding-bottom: var(--cre8-button-padding-vertical-small-icon-only);
735
- padding-left: var(--cre8-button-padding-horizontal-small-icon-only);
736
- }
737
-
738
- /**
739
- * Large button
740
- */
741
- .cre8-c-button--lg {
742
- @include cre8-typography-label-large();
743
- padding-top: var(--cre8-button-padding-vertical-large);
744
- padding-right: var(--cre8-button-padding-horizontal-large);
745
- padding-bottom: var(--cre8-button-padding-vertical-large);
746
- padding-left: var(--cre8-button-padding-horizontal-large);
747
- }
748
-
749
- /**
750
- * Large button sized for icon only
751
- */
752
- .cre8-c-button--lg.cre8-c-button--icon-only {
753
- @include cre8-typography-label-large();
754
- padding-top: var(--cre8-button-padding-vertical-large-icon-only);
755
- padding-right: var(--cre8-button-padding-horizontal-large-icon-only);
756
- padding-bottom: var(--cre8-button-padding-vertical-large-icon-only);
757
- padding-left: var(--cre8-button-padding-horizontal-large-icon-only);
758
- }
759
-
760
- /**
761
- * Icon within small button
762
- */
763
- .cre8-c-button--sm cre8-icon-legacy {
764
- --cre8-icon-height: var(--cre8-icon-size-small);
765
- --cre8-icon-width: var(--cre8-icon-size-small);
766
- }
767
-
768
- .cre8-c-button--sm cre8-icon {
769
- svg {
770
- height: size(1.75);
771
- width: size(1.75);
772
- }
773
- }
774
-
775
- /**
776
- * Icon within large button
777
- */
778
- .cre8-c-button--lg cre8-icon-legacy {
779
- --cre8-icon-height: var(--cre8-icon-size-large);
780
- --cre8-icon-width: var(--cre8-icon-size-large);
781
- }
782
-
783
- .cre8-c-button--lg cre8-icon {
784
- svg {
785
- height: size(2.25);
786
- width: size(2.25);
787
- }
788
- }
789
-
790
- ::slotted(*) {
791
- margin-right: 0;
792
- }
793
- /**
794
- * Button icon directly before button text
795
- */
796
-
797
- cre8-icon-legacy + .cre8-c-button__text:not(.cre8-u-is-vishidden) {
798
- margin-left: size(1);
799
- }
800
-
801
- cre8-icon + .cre8-c-button__text:not(.cre8-u-is-vishidden) {
802
- margin-left: size(1);
803
- }
804
-
805
- /**
806
- * Button icon directly after button text
807
- */
808
- .cre8-c-button__text:not(.cre8-u-is-vishidden) + cre8-icon-legacy {
809
- margin-left: size(1);
810
- }
811
-
812
- .cre8-c-button__text:not(.cre8-u-is-vishidden) + cre8-icon {
813
- margin-left: size(1);
814
- }
815
- /**
816
- * Button icon only
817
- */
818
- .cre8-c-button:has(.cre8-c-button__text.cre8-u-is-vishidden) + cre8-icon-legacy {
819
- border-radius: var(--cre8-border-radius-button);
820
- }
821
-
822
- .cre8-c-button:has(.cre8-c-button__text.cre8-u-is-vishidden) + cre8-icon {
823
- border-radius: var(--cre8-border-radius-button);
824
- }
825
-
826
- .cre8-c-button__text.cre8-u-is-vishidden + cre8-icon-legacy {
827
- margin-left: 0px;
828
- margin-right: 0px;
829
- }
830
-
831
- .cre8-c-button__text.cre8-u-is-vishidden + cre8-icon {
832
- margin-left: 0px;
833
- margin-right: 0px;
834
- }
835
-
836
- .cre8-c-button__text.cre8-u-is-vishidden {
837
- @include visuallyHidden();
838
- }
839
-
840
- .cre8-c-button--primary.cre8-c-button--loading {
841
- --cre8-icon-fill: var(--cre8-color-content-knockout);
842
- }
843
- .cre8-c-button--secondary.cre8-c-button--loading,
844
- .cre8-c-button--tertiary.cre8-c-button--loading {
845
- --cre8-icon-fill: var(--cre8-color-button-secondary-content-active);
846
- }
847
-
848
- /**
849
- * Aria live span
850
- */
851
- .cre8-u-is-vishidden {
852
- --cre8-icon-height: 0px;
853
- --cre8-icon-width: 0px;
854
- max-width: fit-content;
855
- min-width: 0px;
856
- width: auto;
857
- height: auto;
858
- max-height: fit-content;
859
- min-width: 0px;
860
-
861
- @include visuallyHidden();
862
- }
863
-
864
- cre8-icon-legacy.cre8-u-is-vishidden {
865
- @include visuallyHidden();
866
- }
867
-
868
- span.cre8-c-button__icon {
869
- margin-left: size(1);
870
- max-width: fit-content;
871
- min-width: 0px;
872
- width: auto;
873
- height: auto;
874
- max-height: fit-content;
875
- min-width: 0px;
876
- }
877
-
878
- cre8-icon {
879
- display: flex;
880
- align-items: center;
881
- justify-content: center;
882
-
883
- svg {
884
- height: size(2);
885
- width: size(2);
886
- }
887
- }
888
- `;
889
- var f = Object.defineProperty, o = (b, t, u, p) => {
890
- for (var a = void 0, l = b.length - 1, s; l >= 0; l--)
891
- (s = b[l]) && (a = s(t, u, a) || a);
892
- return a && f(t, u, a), a;
893
- };
894
- const d = class d extends h {
895
- constructor() {
896
- super(...arguments), this.text = "Button", this.variant = "primary", this.type = "button", this.iconRotateDegree = 0, this.iconPosition = void 0, this.size = "md", this.ariaLive = "assertive";
897
- }
898
- formSubmit() {
899
- const t = this._internals.form;
900
- t && t.requestSubmit();
901
- }
902
- formReset() {
903
- const t = this._internals.form;
904
- t && t.reset();
905
- }
906
- generateIconBefore() {
907
- if (this.iconPosition === "before") {
908
- if (this.iconName)
909
- return n`<cre8-icon-legacy slot="before" aria-hidden="true" name="${c(this.iconName)}">
147
+ generateIconBefore() {
148
+ if (this.iconPosition === 'before') {
149
+ if (this.iconName) {
150
+ return html `<cre8-icon-legacy slot="before" aria-hidden="true" name="${ifDefined(this.iconName)}">
910
151
  </cre8-icon-legacy>`;
911
- if (this.svg)
912
- return n`<cre8-icon slot="before" aria-hidden="true"
152
+ }
153
+ if (this.svg) {
154
+ return html `<cre8-icon slot="before" aria-hidden="true"
913
155
  svg='${this.svg}' rotate="${Number(this.iconRotateDegree)}" flip="${this.iconFlipDirection}">
914
156
  </cre8-icon>`;
157
+ }
158
+ }
159
+ return nothing;
915
160
  }
916
- return i;
917
- }
918
- generateIconAfter() {
919
- if (this.iconPosition === "after") {
920
- if (this.iconName)
921
- return n`<cre8-icon-legacy slot="after" aria-hidden="true" name="${c(this.iconName)}">
161
+ generateIconAfter() {
162
+ if (this.iconPosition === 'after') {
163
+ if (this.iconName) {
164
+ return html `<cre8-icon-legacy slot="after" aria-hidden="true" name="${ifDefined(this.iconName)}">
922
165
  </cre8-icon-legacy>`;
923
- if (this.svg)
924
- return n`<cre8-icon slot="after" aria-hidden="true"
166
+ }
167
+ if (this.svg) {
168
+ return html `<cre8-icon slot="after" aria-hidden="true"
925
169
  svg='${this.svg}' rotate="${Number(this.iconRotateDegree)}" flip="${this.iconFlipDirection}">
926
170
  </cre8-icon>`;
171
+ }
172
+ }
173
+ return nothing;
927
174
  }
928
- return i;
929
- }
930
- // TODO: Temporarily keep eslint complexity as warning. Update during specific story for this rule.
931
- /* eslint complexity: ["warn", 10] */
932
- render() {
933
- const t = this.componentClassNames("cre8-c-button", {
934
- "cre8-c-button--primary": this.variant === "primary",
935
- "cre8-c-button--secondary": this.variant === "secondary",
936
- "cre8-c-button--tertiary": this.variant === "tertiary",
937
- "cre8-c-button--full-width": this.fullWidth === !0,
938
- "cre8-c-button--sm": this.size === "sm",
939
- "cre8-c-button--lg": this.size === "lg",
940
- "cre8-c-button--icon-only": this.hideText,
941
- "cre8-c-button--split-button-text": this.splitButtonType === "text",
942
- "cre8-c-button--split-button-caret": this.splitButtonType === "caret",
943
- "cre8-c-button--neutral": this.neutral,
944
- "cre8-c-button--inverse": this.inverse,
945
- "cre8-c-button--loading": this.loading
946
- });
947
- return this.hideText && (this.iconPosition = "after"), this.href ? n`
175
+ // TODO: Temporarily keep eslint complexity as warning. Update during specific story for this rule.
176
+ /* eslint complexity: ["warn", 10] */
177
+ render() {
178
+ const componentClassName = this.componentClassNames('cre8-c-button', {
179
+ 'cre8-c-button--primary': this.variant === 'primary',
180
+ 'cre8-c-button--secondary': this.variant === 'secondary',
181
+ 'cre8-c-button--tertiary': this.variant === 'tertiary',
182
+ 'cre8-c-button--full-width': this.fullWidth === true,
183
+ 'cre8-c-button--sm': this.size === 'sm',
184
+ 'cre8-c-button--lg': this.size === 'lg',
185
+ 'cre8-c-button--icon-only': this.hideText,
186
+ 'cre8-c-button--split-button-text': this.splitButtonType === 'text',
187
+ 'cre8-c-button--split-button-caret': this.splitButtonType === 'caret',
188
+ 'cre8-c-button--neutral': this.neutral,
189
+ 'cre8-c-button--inverse': this.inverse,
190
+ 'cre8-c-button--loading': this.loading,
191
+ });
192
+ if (this.hideText) {
193
+ this.iconPosition = 'after';
194
+ }
195
+ if (this.href) {
196
+ return html `
948
197
  <a
949
- href="${c(this.href)}"
950
- class="${t}"
951
- rel="${c(this.rel)}"
952
- target="${c(this.target)}"
198
+ href="${ifDefined(this.href)}"
199
+ class="${componentClassName}"
200
+ rel="${ifDefined(this.rel)}"
201
+ target="${ifDefined(this.target)}"
953
202
  >
954
203
  ${this.generateIconBefore()}
955
204
  <span
956
- class="${this.hideText ? "cre8-u-is-vishidden cre8-c-button__text" : "cre8-c-button__text"}"
205
+ class="${this.hideText ? 'cre8-u-is-vishidden cre8-c-button__text' : 'cre8-c-button__text'}"
957
206
  >
958
207
  ${this.text}
959
208
  </span>
960
209
  ${this.generateIconAfter()}
961
210
  </a>
962
- ` : n` <button
963
- class="${t}"
211
+ `;
212
+ }
213
+ return html ` <button
214
+ class="${componentClassName}"
964
215
  part="button"
965
- aria-disabled="${c(this.loading)}"
216
+ aria-disabled="${ifDefined(this.loading)}"
966
217
  ?disabled=${this.disabled}
967
218
  @click="${this._buttonClick}"
968
- aria-expanded="${c(this.buttonAriaExpanded)}"
219
+ aria-expanded="${ifDefined(this.buttonAriaExpanded)}"
969
220
  >
970
221
  <slot name="before"></slot>
971
222
  ${this.generateIconBefore()}
972
223
  <span
973
- class="${this.hideText ? "cre8-u-is-vishidden cre8-c-button__text" : "cre8-c-button__text"}"
224
+ class="${this.hideText ? 'cre8-u-is-vishidden cre8-c-button__text' : 'cre8-c-button__text'}"
974
225
  >
975
226
  ${this.text}
976
227
  </span>
977
228
  ${this.generateIconAfter()}
978
229
  <slot name="after"></slot>
979
- ${this.loading || this.loadingComplete ? n`<span class="cre8-c-button__icon" aria-live="${this.ariaLive}" role="alert">
980
- <span class="cre8-u-is-vishidden">${this.loadingComplete ? "Loading Complete" : "Loading"}</span>
981
- ${this.loadingComplete ? i : n`
230
+ ${this.loading || this.loadingComplete
231
+ ? html `<span class="cre8-c-button__icon" aria-live="${this.ariaLive}" role="alert">
232
+ <span class="cre8-u-is-vishidden">${this.loadingComplete ? 'Loading Complete' : 'Loading'}</span>
233
+ ${!this.loadingComplete
234
+ ? html `
982
235
  <cre8-loading-spinner
983
236
  class="cre8-c-button__loading-icon"
984
237
  size="small"
@@ -986,97 +239,101 @@ const d = class d extends h {
986
239
  ?inverse=${this.inverse}
987
240
  buttonVariant=${this.variant}
988
241
  aria-hidden="true"
989
- ></cre8-loading-spinner>`}
990
- </span>` : i}
242
+ ></cre8-loading-spinner>`
243
+ : nothing}
244
+ </span>`
245
+ : nothing}
991
246
  </button>`;
992
- }
993
- _buttonClick(t) {
994
- if (this.loading)
995
- t.stopPropagation();
996
- else
997
- switch (this.type) {
998
- case "submit":
999
- this.formSubmit();
1000
- break;
1001
- case "reset":
1002
- this.formReset();
1003
- break;
1004
- }
1005
- }
1006
- };
1007
- d.styles = [g];
1008
- let r = d;
1009
- o([
1010
- e()
1011
- ], r.prototype, "text");
1012
- o([
1013
- e({ type: String })
1014
- ], r.prototype, "variant");
1015
- o([
1016
- e({ type: Boolean, reflect: !0 })
1017
- ], r.prototype, "disabled");
1018
- o([
1019
- e({ type: Boolean, reflect: !0 })
1020
- ], r.prototype, "neutral");
1021
- o([
1022
- e({ type: Boolean, reflect: !0 })
1023
- ], r.prototype, "inverse");
1024
- o([
1025
- e()
1026
- ], r.prototype, "href");
1027
- o([
1028
- e()
1029
- ], r.prototype, "target");
1030
- o([
1031
- e()
1032
- ], r.prototype, "type");
1033
- o([
1034
- e()
1035
- ], r.prototype, "rel");
1036
- o([
1037
- e()
1038
- ], r.prototype, "iconName");
1039
- o([
1040
- e()
1041
- ], r.prototype, "svg");
1042
- o([
1043
- e({ type: Number })
1044
- ], r.prototype, "iconRotateDegree");
1045
- o([
1046
- e()
1047
- ], r.prototype, "iconFlipDirection");
1048
- o([
1049
- e()
1050
- ], r.prototype, "iconPosition");
1051
- o([
1052
- e()
1053
- ], r.prototype, "size");
1054
- o([
1055
- e({ type: Boolean, reflect: !0 })
1056
- ], r.prototype, "hideText");
1057
- o([
1058
- e({ type: Boolean, reflect: !0 })
1059
- ], r.prototype, "fullWidth");
1060
- o([
1061
- e({ type: Boolean, reflect: !0 })
1062
- ], r.prototype, "loading");
1063
- o([
1064
- e({ type: Boolean, reflect: !0 })
1065
- ], r.prototype, "loadingComplete");
1066
- o([
1067
- e()
1068
- ], r.prototype, "ariaLive");
1069
- o([
1070
- e()
1071
- ], r.prototype, "splitButtonType");
1072
- o([
1073
- e({ type: Boolean, reflect: !0 })
1074
- ], r.prototype, "buttonAriaExpanded");
1075
- o([
1076
- y("button")
1077
- ], r.prototype, "field");
1078
- customElements.get("cre8-button") === void 0 && customElements.define("cre8-button", r);
1079
- export {
1080
- r as Cre8Button,
1081
- r as default
1082
- };
247
+ }
248
+ _buttonClick(e) {
249
+ if (this.loading) {
250
+ e.stopPropagation();
251
+ }
252
+ else {
253
+ switch (this.type) {
254
+ case 'submit':
255
+ this.formSubmit();
256
+ break;
257
+ case 'reset':
258
+ this.formReset();
259
+ break;
260
+ // no default
261
+ }
262
+ }
263
+ }
264
+ }
265
+ Cre8Button.styles = [styles];
266
+ __decorate([
267
+ property()
268
+ ], Cre8Button.prototype, "text", void 0);
269
+ __decorate([
270
+ property({ type: String })
271
+ ], Cre8Button.prototype, "variant", void 0);
272
+ __decorate([
273
+ property({ type: Boolean, reflect: true })
274
+ ], Cre8Button.prototype, "disabled", void 0);
275
+ __decorate([
276
+ property({ type: Boolean, reflect: true })
277
+ ], Cre8Button.prototype, "neutral", void 0);
278
+ __decorate([
279
+ property({ type: Boolean, reflect: true })
280
+ ], Cre8Button.prototype, "inverse", void 0);
281
+ __decorate([
282
+ property()
283
+ ], Cre8Button.prototype, "href", void 0);
284
+ __decorate([
285
+ property()
286
+ ], Cre8Button.prototype, "target", void 0);
287
+ __decorate([
288
+ property()
289
+ ], Cre8Button.prototype, "type", void 0);
290
+ __decorate([
291
+ property()
292
+ ], Cre8Button.prototype, "rel", void 0);
293
+ __decorate([
294
+ property()
295
+ ], Cre8Button.prototype, "iconName", void 0);
296
+ __decorate([
297
+ property()
298
+ ], Cre8Button.prototype, "svg", void 0);
299
+ __decorate([
300
+ property({ type: Number })
301
+ ], Cre8Button.prototype, "iconRotateDegree", void 0);
302
+ __decorate([
303
+ property()
304
+ ], Cre8Button.prototype, "iconFlipDirection", void 0);
305
+ __decorate([
306
+ property()
307
+ ], Cre8Button.prototype, "iconPosition", void 0);
308
+ __decorate([
309
+ property()
310
+ ], Cre8Button.prototype, "size", void 0);
311
+ __decorate([
312
+ property({ type: Boolean, reflect: true })
313
+ ], Cre8Button.prototype, "hideText", void 0);
314
+ __decorate([
315
+ property({ type: Boolean, reflect: true })
316
+ ], Cre8Button.prototype, "fullWidth", void 0);
317
+ __decorate([
318
+ property({ type: Boolean, reflect: true })
319
+ ], Cre8Button.prototype, "loading", void 0);
320
+ __decorate([
321
+ property({ type: Boolean, reflect: true })
322
+ ], Cre8Button.prototype, "loadingComplete", void 0);
323
+ __decorate([
324
+ property()
325
+ ], Cre8Button.prototype, "ariaLive", void 0);
326
+ __decorate([
327
+ property()
328
+ ], Cre8Button.prototype, "splitButtonType", void 0);
329
+ __decorate([
330
+ property({ type: Boolean, reflect: true })
331
+ ], Cre8Button.prototype, "buttonAriaExpanded", void 0);
332
+ __decorate([
333
+ query('button')
334
+ ], Cre8Button.prototype, "field", void 0);
335
+ if (customElements.get('cre8-button') === undefined) {
336
+ customElements.define('cre8-button', Cre8Button);
337
+ }
338
+ export default Cre8Button;
339
+ //# sourceMappingURL=button.js.map