@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,781 +1,85 @@
1
- import { css as v, html as s, nothing as y } from "lit";
2
- import { ifDefined as u } from "lit-html/directives/if-defined.js";
3
- import { state as l, property as p, query as C } from "lit/decorators.js";
4
- import { Cre8Field as R } from "../field/field.js";
5
- import { Cre8Element as w } from "../cre8-element.js";
6
- import "../../icon-D22g8aWB.js";
7
- import "../button/button.js";
8
- const I = v`*,::slotted(*),*:before,*:after{box-sizing:border-box}:root{--size-base-unit: 0.5rem}[dir=rtl]{--rtlTranslateX: 50%;--rtlGradientToRight: 270deg;--rtlRotate45Inverse: -45deg}:host{--cre8-z-index-1: 1;--cre8-z-index-50: 50;--cre8-z-index-100: 100;--cre8-z-index-200: 200;--cre8-z-index-1030: 1030;--cre8-anim-fade-quick: 0.35s;--cre8-anim-ease: ease}@keyframes fadeIn{100%{opacity:1}}@keyframes slideIn{100%{transform:translateX(0)}}@keyframes slideInFwd{100%{width:272px;height:272px}}@keyframes slideOutRight{100%{width:272px;height:272px}}@keyframes slideUp{100%{transform:translateY(0)}}@media(width >= 481px){@keyframes slideInFwd{100%{width:417px;height:417px}}@keyframes slideOutRight{100%{width:417px;height:417px}}}@media(width >= 48rem){@keyframes slideInFwd{100%{width:330px;height:330px}}@keyframes slideOutRight{100%{width:330px;height:330px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 60rem){@keyframes slideInFwd{100%{width:460px;height:460px}}@keyframes slideOutRight{100%{width:460px;height:460px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 75rem){@keyframes slideInFwd{100%{width:592px;height:591px}}@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 87.5rem){@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 120px))}}}@media(width >= 2200px){@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 592px))}}}span.ripple{position:absolute;border-radius:50%;transform:scale(0);animation:ripple 600ms linear;background-color:var(--ripple-bg-color)}@keyframes ripple{to{transform:scale(4);opacity:1}}:root{--size-base-unit: 0.5rem}[dir=rtl]{--rtlTranslateX: 50%;--rtlGradientToRight: 270deg;--rtlRotate45Inverse: -45deg}:host{display:block}.cre8-c-date-picker__label{font-family:var(--cre8-typography-label-small-font-family);font-size:var(--cre8-typography-label-small-font-size);font-weight:var(--cre8-typography-label-small-font-weight);line-height:var(--cre8-typography-label-small-line-height);text-decoration:var(--cre8-typography-label-small-text-decoration);text-transform:var(--cre8-typography-label-small-text-transform);display:block;margin-bottom:0.5rem}.cre8-c-date-picker__body{position:relative;display:flex;align-items:center}input::-webkit-calendar-picker-indicator{display:none}input[type=date]::-webkit-input-placeholder{visibility:hidden !important}.cre8-c-date-picker__calendar-icon-button{position:absolute;right:0.5rem;background:var(--cre8-color-bg-default);border:none;border-radius:0;--cre8-icon-height: size(3);--cre8-icon-width: size(3)}.cre8-c-date-picker--disabled .cre8-c-date-picker__calendar-icon-button,.cre8-c-date-picker--read-only .cre8-c-date-picker__calendar-icon-button{background:var(--cre8-color-bg-disabled)}.cre8-c-date-picker__input{font-family:var(--cre8-typography-body-default-font-family);font-size:var(--cre8-typography-body-default-font-size);font-weight:var(--cre8-typography-body-default-font-weight);line-height:var(--cre8-typography-body-default-line-height);text-decoration:var(--cre8-typography-body-default-text-decoration);text-transform:var(--cre8-typography-body-default-text-transform);outline:var(--cre8-border-width-focus) solid rgba(0,0,0,0);outline-offset:0.125rem;-webkit-appearance:none;width:100%;border-width:var(--cre8-border-width-default);border-style:solid;border-color:var(--cre8-color-border-strong);border-radius:var(--cre8-border-radius-default);padding:0.75rem 0.5rem;color:var(--cre8-color-content-default);background-color:var(--cre8-color-bg-default);transition:outline-color var(--cre8-anim-fade-quick) var(--cre8-anim-ease),border-color var(--cre8-anim-fade-quick) var(--cre8-anim-ease),background-color var(--cre8-anim-fade-quick) var(--cre8-anim-ease),color var(--cre8-anim-fade-quick) var(--cre8-anim-ease)}.cre8-c-date-picker__input:hover:not(:disabled),.cre8-c-date-picker__input:focus:not(:disabled),.cre8-c-date-picker__input:active:not(:disabled),.cre8-c-date-picker__input:focus-visible{outline:var(--cre8-border-width-focus) solid var(--cre8-color-border-active-outline);outline-offset:0.125rem}.cre8-is-error .cre8-c-date-picker__input:hover:not(:disabled),.cre8-is-error .cre8-c-date-picker__input:focus:not(:disabled),.cre8-is-error .cre8-c-date-picker__input:active:not(:disabled),.cre8-is-error .cre8-c-date-picker__input:focus-visible{outline-color:var(--cre8-color-border-error)}.cre8-is-success .cre8-c-date-picker__input:hover:not(:disabled),.cre8-is-success .cre8-c-date-picker__input:focus:not(:disabled),.cre8-is-success .cre8-c-date-picker__input:active:not(:disabled),.cre8-is-success .cre8-c-date-picker__input:focus-visible{outline-color:var(--cre8-color-border-success)}.cre8-c-date-picker__input:disabled{background-color:var(--cre8-color-bg-disabled);border-color:var(--cre8-color-border-disabled);color:var(--cre8-color-content-disabled);cursor:not-allowed}.cre8-c-date-picker__input:disabled::placeholder{color:var(--cre8-color-content-disabled)}.cre8-c-date-picker__input::placeholder{color:var(--cre8-color-content-subtle)}.cre8-is-error .cre8-c-date-picker__input{border-color:var(--cre8-color-border-error)}.cre8-is-success .cre8-c-date-picker__input{border-color:var(--cre8-color-border-success)}.cre8-c-date-picker__input:read-only{background-color:var(--cre8-color-bg-disabled);border-color:var(--cre8-color-border-disabled);cursor:default}`, z = v`*,::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-calendar{min-width:340px;border:var(--cre8-color-border-strong);border-radius:var(--cre8-border-radius-default);border-width:var(--cre8-border-width-default);border-style:var(--cre8-border-style-default);margin-top:0.25rem;background-color:var(--cre8-color-bg-default);position:absolute}.cre8-c-calendar__header-shortcuts{display:inline-flex;justify-content:center;width:100%;padding-top:1rem;padding-bottom:0.5rem}.cre8-c-calendar__header-shortcuts cre8-button+cre8-button{padding-left:0.5rem}.cre8-c-calendar__header-shortcuts cre8-button{max-height:32px}table{width:100%}tr{font-family:var(--cre8-typography-body-default-font-family);font-size:var(--cre8-typography-body-default-font-size);font-weight:var(--cre8-typography-body-default-font-weight);line-height:var(--cre8-typography-body-default-line-height);text-decoration:var(--cre8-typography-body-default-text-decoration);text-transform:var(--cre8-typography-body-default-text-transform);display:grid;grid-row-gap:.33em;grid-template-columns:repeat(7, 1fr);list-style:none;margin:unset;padding:unset;position:relative}td{align-items:center;display:flex;height:48px;justify-content:center;width:48px}.cre8-c-calendar :is(thead,tbody) :is(span,button){font-family:var(--cre8-typography-body-default-font-family);font-size:var(--cre8-typography-body-default-font-size);font-weight:var(--cre8-typography-body-default-font-weight);line-height:var(--cre8-typography-body-default-line-height);text-decoration:var(--cre8-typography-body-default-text-decoration);text-transform:var(--cre8-typography-body-default-text-transform);align-items:center;block-size:2em;border-radius:var(--cre8-border-radius-brand);display:flex;inline-size:2em;justify-content:center;margin-block:var(0, 0 0.33em);user-select:none}.cre8-c-calendar__day-button{border:none;background:none;margin:0;padding:0}.cre8-c-calendar__day-button:hover,.cre8-c-calendar__day-button:focus{background:var(--cre8-color-bg-default-hover)}.cre8-c-calendar__day-button.cre8-c-calendar__different-month{color:var(--cre8-color-content-subtle)}.cre8-c-calendar__day-button.cre8-c-calendar__different-month:hover,.cre8-c-calendar__day-button.cre8-c-calendar__different-month:focus{background:var(--cre8-color-bg-subtle)}.cre8-c-calendar__day-button[data-today]{color:var(--cre8-color-content-brand);border-color:var(--cre8-color-border-brand);border-width:var(--cre8-border-width-default);border-style:var(--cre8-border-style-default)}.cre8-c-calendar__day-button[data-selected]{background:var(--cre8-color-bg-brand-strong);color:var(--cre8-color-content-knockout)}.cre8-c-calendar__day-button[data-selected]:hover,.cre8-c-calendar__day-button[data-selected]:focus{background:var(--cre8-color-bg-brand-strong-hover)}`, F = v`*,::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-calendar-month-modal{padding:0.5rem}ol{font-family:var(--cre8-typography-body-default-font-family);font-size:var(--cre8-typography-body-default-font-size);font-weight:var(--cre8-typography-body-default-font-weight);line-height:var(--cre8-typography-body-default-line-height);text-decoration:var(--cre8-typography-body-default-text-decoration);text-transform:var(--cre8-typography-body-default-text-transform);display:grid;grid-row-gap:.33em;grid-template-columns:repeat(3, 1fr);list-style:none;margin:unset;padding:unset}li{display:inline-flex;justify-content:center}`;
9
- var S = Object.defineProperty, O = (d, e, t, a) => {
10
- for (var r = void 0, i = d.length - 1, n; i >= 0; i--)
11
- (n = d[i]) && (r = n(e, t, r) || r);
12
- return r && S(e, t, r), r;
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;
13
6
  };
14
- const _ = class _ extends w {
15
- constructor() {
16
- super(), this.monthNames = [
17
- "January",
18
- "February",
19
- "March",
20
- "April",
21
- "May",
22
- "June",
23
- "July",
24
- "August",
25
- "September",
26
- "October",
27
- "November",
28
- "December"
29
- ];
30
- }
31
- firstUpdated() {
32
- this.focusOnCurrentMonth();
33
- }
34
- async focusOnCurrentMonth() {
35
- await this.updateComplete, (this.shadowRoot?.querySelector(
36
- "li[data-current-month]"
37
- ).children[0].shadowRoot?.querySelector("button")).focus();
38
- }
39
- emitMonth(e) {
40
- const t = new CustomEvent("changeMonth", {
41
- detail: {
42
- month: e
43
- }
44
- });
45
- this.dispatchEvent(t);
46
- }
47
- getMonthListItems() {
48
- return this.monthNames.map(
49
- (e, t) => s` <li ?data-current-month="${t === this.currentMonth}" >
50
- <cre8-button text="${e}" variant="tertiary" size="sm"
51
- @click="${() => this.emitMonth(t)}"></cre8-button>
52
- </li>`
53
- );
54
- }
55
- render() {
56
- const e = this.componentClassNames("cre8-c-calendar-month-modal", {});
57
- return s` <div class="${e}">
58
- <ol aria-label="choose a month">
59
- ${this.getMonthListItems()}
60
- </ol>
61
- </div> `;
62
- }
63
- };
64
- _.styles = [F];
65
- let f = _;
66
- O([
67
- l()
68
- ], f.prototype, "monthNames");
69
- O([
70
- p({ reflect: !0, type: Number })
71
- ], f.prototype, "currentMonth");
72
- customElements.get("cre8-calendar-month-modal") === void 0 && customElements.define("cre8-calendar-month-modal", f);
73
- const N = v`*,::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-calendar-year-modal{display:flex;justify-content:space-around;align-items:center;padding:0.5rem}ol{font-family:var(--cre8-typography-body-default-font-family);font-size:var(--cre8-typography-body-default-font-size);font-weight:var(--cre8-typography-body-default-font-weight);line-height:var(--cre8-typography-body-default-line-height);text-decoration:var(--cre8-typography-body-default-text-decoration);text-transform:var(--cre8-typography-body-default-text-transform);display:grid;grid-row-gap:.33em;grid-template-columns:repeat(3, 1fr);list-style:none;margin:unset;padding:unset}li{display:inline-flex;justify-content:center}cre8-button{height:fit-content}`;
74
- var X = Object.defineProperty, E = Object.getOwnPropertyDescriptor, x = (d, e, t, a) => {
75
- for (var r = a > 1 ? void 0 : a ? E(e, t) : e, i = d.length - 1, n; i >= 0; i--)
76
- (n = d[i]) && (r = (a ? n(e, t, r) : n(r)) || r);
77
- return a && r && X(e, t, r), r;
78
- };
79
- const D = class D extends w {
80
- get currentYear() {
81
- return this._currentYear;
82
- }
83
- set currentYear(e) {
84
- const t = this._currentYear;
85
- this._currentYear = e, this.modalAnchorYear = e, this.requestUpdate("currentDate", t), this.createYearArray(this.currentYear);
86
- }
87
- constructor() {
88
- super(), this.yearNumbers = [];
89
- }
90
- emitYear(e) {
91
- const t = new CustomEvent("changeYear", {
92
- detail: {
93
- year: e
94
- }
95
- });
96
- this.dispatchEvent(t);
97
- }
98
- createYearArray(e) {
99
- const t = Array.from(Array(12).keys());
100
- this.yearNumbers = t.map((a) => a + (e - 7));
101
- }
102
- getYearListItems() {
103
- return this.yearNumbers.map(
104
- ((e) => s` <li
105
- ?data-current-year="${e === this.currentYear}"
106
- >
107
- <cre8-button
108
- text="${e}"
109
- variant="tertiary"
110
- size="sm"
111
- @click="${() => this.emitYear(e)}"
112
- ></cre8-button>
113
- </li>`)
114
- );
115
- }
116
- firstUpdated() {
117
- this.focusOnCurrentYear();
118
- }
119
- async focusOnCurrentYear() {
120
- await this.updateComplete, (this.shadowRoot?.querySelector(
121
- "li[data-current-year]"
122
- ).children[0].shadowRoot?.querySelector("button")).focus();
123
- }
124
- previousYearArray() {
125
- this.modalAnchorYear -= 12, this.createYearArray(this.modalAnchorYear);
126
- }
127
- nextYearArray() {
128
- this.modalAnchorYear += 12, this.createYearArray(this.modalAnchorYear);
129
- }
130
- render() {
131
- const e = this.componentClassNames(
132
- "cre8-c-calendar-year-modal",
133
- {}
134
- );
135
- return s`
136
- <div class="${e}">
137
- <cre8-button
138
- class="cre8-c-calendar-year-modal__nav-button"
139
- @click="${this.previousYearArray}"
140
- variant="tertiary"
141
- text="Previous 12 years"
142
- ?hideText=${!0}
143
- iconName="keyboard-arrow-left"
144
- ></cre8-button>
145
- <ol aria-label="choose a year">
146
- ${this.getYearListItems()}
147
- </ol>
148
- <cre8-button
149
- class="cre8-c-calendar-year-modal__nav-button"
150
- @click="${this.nextYearArray}"
151
- variant="tertiary"
152
- text="Next 12 years"
153
- ?hideText=${!0}
154
- iconName="keyboard-arrow-right"
155
- ></cre8-button>
156
- </div>
157
- `;
158
- }
159
- };
160
- D.styles = [N];
161
- let m = D;
162
- x([
163
- l()
164
- ], m.prototype, "yearNumbers", 2);
165
- x([
166
- l()
167
- ], m.prototype, "_currentYear", 2);
168
- x([
169
- l()
170
- ], m.prototype, "modalAnchorYear", 2);
171
- x([
172
- p({ reflect: !0, type: Number })
173
- ], m.prototype, "currentYear", 1);
174
- customElements.get("cre8-calendar-year-modal") === void 0 && customElements.define("cre8-calendar-year-modal", m);
175
- const A = v`*,::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-calendar-navigation{align-items:center;display:flex;height:60px;justify-content:center}.cre8-c-calendar-navigation__inner-buttons{display:flex;min-width:188px;justify-content:space-around}`;
176
- var q = Object.defineProperty, T = (d, e, t, a) => {
177
- for (var r = void 0, i = d.length - 1, n; i >= 0; i--)
178
- (n = d[i]) && (r = n(e, t, r) || r);
179
- return r && q(e, t, r), r;
180
- };
181
- const $ = class $ extends w {
182
- activateModal(e) {
183
- const t = new CustomEvent("activateModal", {
184
- detail: {
185
- modal: e
186
- }
187
- });
188
- this.dispatchEvent(t);
189
- }
190
- changeMonth(e) {
191
- const t = new CustomEvent("changeMonth", {
192
- detail: {
193
- addend: e
194
- }
195
- });
196
- this.dispatchEvent(t);
197
- }
198
- changeYear(e) {
199
- const t = new CustomEvent("changeYear", {
200
- detail: {
201
- addend: e
202
- }
203
- });
204
- this.dispatchEvent(t);
205
- }
206
- render() {
207
- const e = this.componentClassNames(
208
- "cre8-c-calendar-navigation",
209
- {}
210
- );
211
- return s`
212
- <div class="${e}">
213
- <cre8-button
214
- variant="tertiary"
215
- text="Previous year"
216
- ?hideText=${!0}
217
- iconName="caret-double-left"
218
- @click="${() => this.changeYear(-1)}"
219
- ></cre8-button>
220
-
221
- <cre8-button
222
- variant="tertiary"
223
- text="Previous month"
224
- ?hideText=${!0}
225
- iconName="keyboard-arrow-left"
226
- @click="${() => this.changeMonth(-1)}"
227
- ></cre8-button>
228
-
229
- <div class="cre8-c-calendar-navigation__inner-buttons">
230
- <cre8-button
231
- class="cre8-c-calendar-navigation__month-modal-button"
232
- variant="tertiary"
233
- text="${this.monthName}"
234
- aria-label="${this.monthName}, month picker modal"
235
- size="sm"
236
- @click="${() => this.activateModal("month")}"
237
- ></cre8-button>
238
-
239
- <cre8-button
240
- class="cre8-c-calendar-navigation__year-modal-button"
241
- variant="tertiary"
242
- text="${this.year}"
243
- aria-label="${this.year}, year picker modal"
244
- size="sm"
245
- @click="${() => this.activateModal("year")}"
246
- ></cre8-button>
247
- </div>
248
-
249
- <cre8-button
250
- variant="tertiary"
251
- text="Next month"
252
- ?hideText=${!0}
253
- iconName="keyboard-arrow-right"
254
- @click="${() => this.changeMonth(1)}"
255
- ></cre8-button>
256
-
257
- <cre8-button
258
- variant="tertiary"
259
- text="Next year"
260
- ?hideText=${!0}
261
- iconName="caret-double-right"
262
- @click="${() => this.changeYear(1)}"
263
- ></cre8-button>
264
- </div>
265
- `;
266
- }
267
- };
268
- $.styles = [A];
269
- let b = $;
270
- T([
271
- p({ type: String, reflect: !0 })
272
- ], b.prototype, "monthName");
273
- T([
274
- p({ type: String, reflect: !0 })
275
- ], b.prototype, "year");
276
- customElements.get("cre8-calendar-navigation") === void 0 && customElements.define("cre8-calendar-navigation", b);
277
- var P = Object.defineProperty, j = Object.getOwnPropertyDescriptor, h = (d, e, t, a) => {
278
- for (var r = a > 1 ? void 0 : a ? j(e, t) : e, i = d.length - 1, n; i >= 0; i--)
279
- (n = d[i]) && (r = (a ? n(e, t, r) : n(r)) || r);
280
- return a && r && P(e, t, r), r;
281
- }, o;
282
- const c = (o = class extends w {
283
- constructor() {
284
- super(), this._activeModal = "none", this._handleOnClickOutside = this._handleOnClickOutside.bind(this), this.currentDate = (this.fieldDate && /* @__PURE__ */ new Date(`${this.fieldDate}T00:00`)) ?? /* @__PURE__ */ new Date(), this.locale = document.documentElement.getAttribute("lang") || "en-US", this.dateConfig = {
285
- locale: this.locale,
286
- today: /* @__PURE__ */ new Date(),
287
- weekInfo: {
288
- firstDay: 7,
289
- weekend: [6, 7]
290
- }
291
- }, this.weekDays = [
292
- "Sunday",
293
- "Monday",
294
- "Tuesday",
295
- "Wednesday",
296
- "Thursday",
297
- "Friday",
298
- "Saturday"
299
- ], this.dateFormatOptions = {
300
- weekday: "long",
301
- year: "numeric",
302
- month: "long",
303
- day: "numeric"
304
- };
305
- }
306
- get activeModal() {
307
- return this._activeModal;
308
- }
309
- set activeModal(e) {
310
- this._activeModal = e;
311
- }
312
- get fieldDate() {
313
- return this._fieldDate;
314
- }
315
- set fieldDate(e) {
316
- const t = this._fieldDate;
317
- this.requestUpdate("fieldDate", t);
318
- const a = !!(e && (/* @__PURE__ */ new Date(`${e}T00:00`)).getTime());
319
- this.currentDate = a ? /* @__PURE__ */ new Date(`${e}T00:00`) : /* @__PURE__ */ new Date(), this._fieldDate = a ? e : "";
320
- }
321
- get currentDate() {
322
- return this._currentDate;
323
- }
324
- set currentDate(e) {
325
- const t = this._currentDate;
326
- this._currentDate = e, this.requestUpdate("currentDate", t);
327
- }
328
- connectedCallback() {
329
- super.connectedCallback(), window.addEventListener("click", this._handleOnClickOutside, !1);
330
- }
331
- disconnectedCallback() {
332
- super.disconnectedCallback(), window.removeEventListener("click", this._handleOnClickOutside, !1);
333
- }
334
- /* Click Event Functions */
335
- _handleOnClickOutside(e) {
336
- if (!this.shadowRoot?.host)
337
- throw Error(
338
- "Could not determine navigation context during click handler"
339
- );
340
- if (!e.composedPath().includes(this.shadowRoot.host)) {
341
- const a = new CustomEvent("outsideClick", {
342
- detail: {
343
- composedPath: e.composedPath()
344
- }
345
- });
346
- this.dispatchEvent(a);
7
+ import { html, nothing } from 'lit';
8
+ import { ifDefined } from 'lit-html/directives/if-defined.js';
9
+ import { property, query, state } from 'lit/decorators.js';
10
+ import styles from './date-picker.styles';
11
+ import { Cre8Field } from '../field/field';
12
+ import './calendar/calendar';
13
+ /**
14
+ * The Date Picker component renders a form group with label, control, help text and validation styling much
15
+ * like the Field component but exclusively for type=date.
16
+ * Cre8DatePicker inherits the Cre8Field component.
17
+ */
18
+ export class Cre8DatePicker extends Cre8Field {
19
+ constructor() {
20
+ super(...arguments);
21
+ /**
22
+ * The type of the form field.
23
+ * For Date Picker, this is always 'date'.
24
+ */
25
+ this.type = 'date';
26
+ this.showCalendar = false;
347
27
  }
348
- }
349
- emitSelectedDate(e) {
350
- const t = new CustomEvent("dateSelect", {
351
- detail: {
352
- date: e
353
- }
354
- });
355
- this.currentDate = /* @__PURE__ */ new Date(`${e}T00:00`), this.dispatchEvent(t);
356
- }
357
- changeYear(e) {
358
- const t = this.currentDate, a = new Date(t.setFullYear(e));
359
- this.currentDate = a, this.activeModal = "none";
360
- }
361
- changeMonth(e) {
362
- const t = this.currentDate, a = new Date(t.setMonth(e));
363
- this.currentDate = a, this.activeModal = "none";
364
- }
365
- activateModal(e) {
366
- this.activeModal = e;
367
- }
368
- /* Helper/Get Functions */
369
- static formatMonthOrDayIndex(e) {
370
- return (e + 1).toString().padStart(2, "0");
371
- }
372
- static formatDate(e) {
373
- return e.toString().padStart(2, "0");
374
- }
375
- numberOfDaysinMonth() {
376
- return new Date(this.getYear(), this.getMonth() + 1, 0).getDate();
377
- }
378
- getMonth() {
379
- return this.currentDate.getMonth();
380
- }
381
- getMonthName() {
382
- return new Intl.DateTimeFormat(this.locale, {
383
- month: "long"
384
- }).format(this.currentDate);
385
- }
386
- getYear() {
387
- return this.currentDate.getFullYear();
388
- }
389
- static dateToString(e) {
390
- return `${e.getFullYear()}-${o.formatMonthOrDayIndex(
391
- e.getMonth()
392
- )}-${o.formatDate(e.getDate())}`;
393
- }
394
- async updateFocusForKeydown(e) {
395
- this.currentDate = e, await this.updateComplete;
396
- const t = this.shadowRoot?.querySelector(
397
- `button[datetime="${o.dateToString(e)}"]`
398
- );
399
- t.setAttribute("tabindex", "0"), t.focus();
400
- }
401
- _handleCalendarKeyDown(e) {
402
- const t = this.shadowRoot?.querySelector(
403
- `button[datetime="${o.dateToString(this.currentDate)}"]`
404
- );
405
- if (e.key === "ArrowUp") {
406
- const a = new Date(
407
- this.getYear(),
408
- this.getMonth(),
409
- this.currentDate.getDate() - 7
410
- );
411
- this.updateFocusForKeydown(a), t.setAttribute("tabindex", "-1");
28
+ /**
29
+ * Handle Date On Input
30
+ * 1) Set the input's value equal to the event.target.value when the input is changed.
31
+ * 2) Set the internal form value of the input to the updated value
32
+ */
33
+ handleDateOnInput(e) {
34
+ /* 1 */
35
+ this.value = e.target.value;
36
+ /* 2 */
37
+ this._internals.setFormValue(this.value);
412
38
  }
413
- if (e.key === "ArrowDown") {
414
- const a = new Date(
415
- this.getYear(),
416
- this.getMonth(),
417
- this.currentDate.getDate() + 7
418
- );
419
- this.updateFocusForKeydown(a), t.setAttribute("tabindex", "-1");
39
+ handleCalendarSelect(e) {
40
+ this.value = e.detail.date;
41
+ this._internals.setFormValue(this.value);
42
+ this.showCalendar = false;
420
43
  }
421
- if (e.key === "ArrowLeft") {
422
- const a = new Date(
423
- this.getYear(),
424
- this.getMonth(),
425
- this.currentDate.getDate() - 1
426
- );
427
- this.updateFocusForKeydown(a), t.setAttribute("tabindex", "-1");
428
- }
429
- if (e.key === "ArrowRight") {
430
- const a = new Date(
431
- this.getYear(),
432
- this.getMonth(),
433
- this.currentDate.getDate() + 1
434
- );
435
- this.updateFocusForKeydown(a), t.setAttribute("tabindex", "-1");
44
+ handleOutsideClick(e) {
45
+ const calendarIcon = this.renderRoot.querySelector('.cre8-c-date-picker');
46
+ if (this.showCalendar && !e.detail.composedPath.includes(calendarIcon)) {
47
+ this.showCalendar = false;
48
+ }
436
49
  }
437
- if (e.key === "Tab" && !e.shiftKey) {
438
- const a = new CustomEvent("outsideClick", {
439
- detail: {
440
- composedPath: []
50
+ toggleCalendar() {
51
+ if (!this.disabled && !this.readonly) {
52
+ this.showCalendar = !this.showCalendar;
441
53
  }
442
- });
443
- setTimeout(() => {
444
- this.dispatchEvent(a);
445
- }, 20);
446
54
  }
447
- }
448
- async changeMonthFromNav(e) {
449
- this.changeMonth(e), await this.updateComplete;
450
- const a = (this.shadowRoot?.querySelector(
451
- "cre8-calendar-navigation"
452
- )).shadowRoot?.querySelector(
453
- ".cre8-c-calendar-navigation__month-modal-button"
454
- );
455
- await this.updateComplete, a.shadowRoot.querySelector("button").focus();
456
- }
457
- async changeYearFromNav(e) {
458
- this.changeYear(e), await this.updateComplete;
459
- const a = (this.shadowRoot?.querySelector(
460
- "cre8-calendar-navigation"
461
- )).shadowRoot?.querySelector(
462
- ".cre8-c-calendar-navigation__year-modal-button"
463
- );
464
- await this.updateComplete, a.shadowRoot.querySelector("button").focus();
465
- }
466
- /* Template Map Functions */
467
- getDaysOfWeekAbbreviations() {
468
- return this.weekDays.map(
469
- (e) => s` <td>
470
- <span aria-label="${e}">${e[0]}</span>
471
- </td>`
472
- );
473
- }
474
- /**
475
- * Create array of Day Buttons to fill in excess calendar space at the beginning of the month.
476
- *
477
- * 1. Map from empty array of length equal to the amount of access calendar "slots" in the beginning of the month.
478
- * (i.e. if the month starts on Wednesday (getDay = 3), there are 3 days prior that week from last month.)
479
- *
480
- * 2. Based on the indice of array, get the given day button's date, where the date is
481
- * the last day of last month minus the max of the array plus the indice plus one -> x = lastday - (max - (i + 1))
482
- * (Note: (max - (i + 1) equals the keys of the array in reverse order:
483
- * [max - i + 1] -> [3-1, 3-2, 3-3] -> [2,1,0] for an array of [3])
484
- * (i.e. if the calendar is starting on Wednesday June 1st, the access days on the calendar will be
485
- * Sunday May 29th (31 - (2)), Monday May 30th (31 - (1)), Tuesday May 31st (31 - (0)))
486
- *
487
- * 3. Build out day button with necessary props
488
- * */
489
- getPreviousMonthDayButtons() {
490
- return [
491
- ...Array(new Date(this.getYear(), this.getMonth(), 1).getDay()).keys()
492
- ].map((e) => {
493
- const t = new Date(
494
- this.getYear(),
495
- this.getMonth(),
496
- 1
497
- ).getDay(), a = new Date(this.getYear(), this.getMonth(), 0), r = a.getDate(), i = new Date(
498
- a.getFullYear(),
499
- a.getMonth(),
500
- r - t + (e + 1)
501
- ), n = this.dateConfig.today.getDate() === i.getDate() && this.dateConfig.today.getMonth() === i.getMonth() && this.dateConfig.today.getFullYear() === i.getFullYear(), Y = (/* @__PURE__ */ new Date(`${this.fieldDate}T00:00`)).getTime() === i.getTime();
502
- return s` <td>
503
- <button
504
- class="cre8-c-calendar__day-button cre8-c-calendar__different-month"
505
- datetime="${o.dateToString(i)}"
506
- ?data-today="${n}"
507
- ?data-selected="${Y}"
508
- tabindex="-1"
509
- aria-label="${new Intl.DateTimeFormat(this.locale, {
510
- weekday: "long",
511
- year: "numeric",
512
- month: "long",
513
- day: "numeric"
514
- }).format(
515
- /* @__PURE__ */ new Date(`${o.dateToString(i)}T00:00`)
516
- )}"
517
- @click="${() => this.emitSelectedDate(o.dateToString(i))}"
518
- >
519
- ${new Intl.NumberFormat(this.locale).format(i.getDate())}
520
- </button>
521
- </td>`;
522
- });
523
- }
524
- /**
525
- * Create array of Day Buttons to fill out current month
526
- *
527
- * 1. Map from empty array of length equal to the amount days in this month
528
- *
529
- * 2. Get the date of the current month based on indice of array (i.e. 0 -> 1st, 1 -> 2nd ...)
530
- *
531
- * 3. Build out day button with necessary props
532
- * */
533
- getCurrentMonthDayButtons() {
534
- return [...Array(this.numberOfDaysinMonth()).keys()].map((e) => {
535
- const t = e + 1, a = new Date(this.getYear(), this.getMonth(), t), r = this.dateConfig.today.getDate() === t && this.dateConfig.today.getMonth() === this.getMonth() && this.dateConfig.today.getFullYear() === this.getYear(), i = (/* @__PURE__ */ new Date(`${this.fieldDate}T00:00`)).getTime() === a.getTime();
536
- return s` <td>
537
- <button
538
- class="cre8-c-calendar__day-button"
539
- datetime="${o.dateToString(a)}"
540
- ?data-today="${r}"
541
- ?data-selected="${i}"
542
- tabindex="${t === this.currentDate.getDate() ? "0" : "-1"}"
543
- aria-label="${new Intl.DateTimeFormat(this.locale, {
544
- weekday: "long",
545
- year: "numeric",
546
- month: "long",
547
- day: "numeric"
548
- }).format(/* @__PURE__ */ new Date(`${o.dateToString(a)}T00:00`))}"
549
- @click="${() => this.emitSelectedDate(o.dateToString(a))}"
550
- >
551
- ${new Intl.NumberFormat(this.locale).format(e + 1)}
552
- </button>
553
- </td>`;
554
- });
555
- }
556
- /**
557
- * Create array of Day Buttons to fill in excess calendar space at the end of the month.
558
- *
559
- * 1. Map from empty array of length equal to the amount of access calendar "slots" at the end of the month.
560
- * The array have an amount of slots equal to the number of days in a week minus how many days have already past
561
- * and since getDay returns the index of the day of the week (Sunday = 0, Monday = 1 ...) our equations is
562
- * x = 7 - (getDay() + 1)
563
- * Note: (we need to add 1 because indexing starts at 0)
564
- * so if the month ends on Monday (getDay() = 1), 5 = 7 - (1 + 1), there are 5 days that week from the new month
565
- *
566
- * 2. Get the date from the next month based on indice of array (i.e. 0 -> 1st, 1 -> 2nd ...)
567
- *
568
- * 3. Build out day button with necessary props
569
- * */
570
- getNextMonthDayButtons() {
571
- return [
572
- ...Array(
573
- 6 - new Date(
574
- this.getYear(),
575
- this.getMonth(),
576
- this.numberOfDaysinMonth()
577
- ).getDay()
578
- ).keys()
579
- ].map((e) => {
580
- const t = new Date(
581
- this.getYear(),
582
- this.getMonth(),
583
- this.numberOfDaysinMonth()
584
- ), a = new Date(
585
- t.setDate(t.getDate() + 1)
586
- ), r = new Date(
587
- a.getFullYear(),
588
- a.getMonth(),
589
- e + 1
590
- ), i = this.dateConfig.today.getDate() === r.getDate() && this.dateConfig.today.getMonth() === r.getMonth() && this.dateConfig.today.getFullYear() === r.getFullYear(), n = (/* @__PURE__ */ new Date(`${this.fieldDate}T00:00`)).getTime() === r.getTime();
591
- return s` <td>
592
- <button
593
- class="cre8-c-calendar__day-button cre8-c-calendar__different-month"
594
- datetime="${o.dateToString(r)}"
595
- ?data-today="${i}"
596
- ?data-selected="${n}"
597
- tabindex="-1"
598
- aria-label="${new Intl.DateTimeFormat(this.locale, {
599
- weekday: "long",
600
- year: "numeric",
601
- month: "long",
602
- day: "numeric"
603
- }).format(
604
- /* @__PURE__ */ new Date(`${o.dateToString(r)}T00:00`)
605
- )}"
606
- @click="${() => this.emitSelectedDate(o.dateToString(r))}"
607
- >
608
- ${new Intl.NumberFormat(this.locale).format(r.getDate())}
609
- </button>
610
- </td>`;
611
- });
612
- }
613
- render() {
614
- const e = this.componentClassNames("cre8-c-calendar", {});
615
- return s` <div class="${e}">
616
- ${this._activeModal === "month" ? s`<cre8-calendar-month-modal
617
- currentMonth="${this.getMonth()}"
618
- @changeMonth="${(t) => this.changeMonthFromNav(t.detail.month)}"
619
- ></cre8-calendar-month-modal>` : y}
620
- ${this._activeModal === "year" ? s`<cre8-calendar-year-modal
621
- currentYear="${this.getYear()}"
622
- @changeYear="${(t) => this.changeYearFromNav(t.detail.year)}"
623
- ></cre8-calendar-year-modal>` : y}
624
- ${this._activeModal === "none" ? s` ${this.hasShortcuts ? s`<div class="cre8-c-calendar__header-shortcuts">
625
- <cre8-button
626
- text="Today"
627
- variant="secondary"
628
- size="sm"
629
- @click="${() => this.emitSelectedDate(
630
- o.dateToString(this.dateConfig.today)
631
- )}"
632
- ></cre8-button>
633
- <cre8-button
634
- text="Tomorrow"
635
- variant="secondary"
636
- size="sm"
637
- @click="${() => this.emitSelectedDate(
638
- o.dateToString(
639
- new Date(
640
- this.dateConfig.today.setDate(
641
- this.dateConfig.today.getDate() + 1
642
- )
643
- )
644
- )
645
- )}"
646
- ></cre8-button>
647
- <cre8-button
648
- text="In 2 days"
649
- variant="secondary"
650
- size="sm"
651
- @click="${() => this.emitSelectedDate(
652
- o.dateToString(
653
- new Date(
654
- this.dateConfig.today.setDate(
655
- this.dateConfig.today.getDate() + 2
656
- )
657
- )
658
- )
659
- )}"
660
- ></cre8-button>
661
- </div>` : y}
662
- <cre8-calendar-navigation
663
- monthName="${this.getMonthName()}"
664
- year="${this.getYear()}"
665
- @activateModal="${(t) => this.activateModal(t.detail.modal)}"
666
- @changeMonth="${(t) => this.changeMonth(this.getMonth() + t.detail.addend)}"
667
- @changeYear="${(t) => this.changeYear(this.getYear() + t.detail.addend)}"
668
- >
669
- </cre8-calendar-navigation>
670
- <table>
671
- <thead>
672
- <tr>
673
- ${this.getDaysOfWeekAbbreviations()}
674
- </tr>
675
- </thead>
676
- <tbody>
677
- <tr @keydown=${this._handleCalendarKeyDown}>
678
- ${this.getPreviousMonthDayButtons()}
679
- ${this.getCurrentMonthDayButtons()}
680
- ${this.getNextMonthDayButtons()}
681
- </tr>
682
- </tbody>
683
- </table>` : y}
684
- </div>`;
685
- }
686
- }, o.styles = [z], o);
687
- h([
688
- C(".cre8-c-calendar__navigation-wrapper")
689
- ], c.prototype, "_navWrapper", 2);
690
- h([
691
- p({ type: Boolean, reflect: !0 })
692
- ], c.prototype, "hasShortcuts", 2);
693
- h([
694
- l()
695
- ], c.prototype, "_activeModal", 2);
696
- h([
697
- p({ reflect: !0, type: String })
698
- ], c.prototype, "activeModal", 1);
699
- h([
700
- l()
701
- ], c.prototype, "_fieldDate", 2);
702
- h([
703
- p({ reflect: !0, type: Date })
704
- ], c.prototype, "fieldDate", 1);
705
- h([
706
- l()
707
- ], c.prototype, "_currentDate", 2);
708
- h([
709
- p({ reflect: !0, type: Date })
710
- ], c.prototype, "currentDate", 1);
711
- h([
712
- l()
713
- ], c.prototype, "locale", 2);
714
- h([
715
- l()
716
- ], c.prototype, "weekDays", 2);
717
- h([
718
- l()
719
- ], c.prototype, "dateConfig", 2);
720
- h([
721
- l()
722
- ], c.prototype, "dateFormatOptions", 2);
723
- let B = c;
724
- customElements.get("cre8-calendar") === void 0 && customElements.define("cre8-calendar", B);
725
- var U = Object.defineProperty, k = (d, e, t, a) => {
726
- for (var r = void 0, i = d.length - 1, n; i >= 0; i--)
727
- (n = d[i]) && (r = n(e, t, r) || r);
728
- return r && U(e, t, r), r;
729
- };
730
- const M = class M extends R {
731
- constructor() {
732
- super(...arguments), this.type = "date", this.showCalendar = !1;
733
- }
734
- /**
735
- * Handle Date On Input
736
- * 1) Set the input's value equal to the event.target.value when the input is changed.
737
- * 2) Set the internal form value of the input to the updated value
738
- */
739
- handleDateOnInput(e) {
740
- this.value = e.target.value, this._internals.setFormValue(this.value);
741
- }
742
- handleCalendarSelect(e) {
743
- this.value = e.detail.date, this._internals.setFormValue(this.value), this.showCalendar = !1;
744
- }
745
- handleOutsideClick(e) {
746
- const t = this.renderRoot.querySelector(".cre8-c-date-picker");
747
- this.showCalendar && !e.detail.composedPath.includes(t) && (this.showCalendar = !1);
748
- }
749
- toggleCalendar() {
750
- !this.disabled && !this.readonly && (this.showCalendar = !this.showCalendar);
751
- }
752
- render() {
753
- const e = this.componentClassNames("cre8-c-date-picker", {
754
- "cre8-is-error": this.isError,
755
- "cre8-is-success": this.isSuccess,
756
- "cre8-c-date-picker--disabled": this.disabled,
757
- "cre8-c-date-picker--read-only": this.readonly
758
- });
759
- return this.type = "date", s`
760
- <div class="${e}">
55
+ render() {
56
+ const componentClassNames = this.componentClassNames('cre8-c-date-picker', {
57
+ 'cre8-is-error': this.isError,
58
+ 'cre8-is-success': this.isSuccess,
59
+ 'cre8-c-date-picker--disabled': this.disabled,
60
+ 'cre8-c-date-picker--read-only': this.readonly,
61
+ });
62
+ this.type = 'date';
63
+ return html `
64
+ <div class="${componentClassNames}">
761
65
  <label class="cre8-c-date-picker__label" for="${this.fieldId}"
762
66
  >${this.label}</label
763
67
  >
764
68
  <div class="cre8-c-date-picker__body">
765
69
  <input
766
70
  class="cre8-c-date-picker__input"
767
- autocomplete=${u(this.autocomplete)}
71
+ autocomplete=${ifDefined(this.autocomplete)}
768
72
  type="${this.type}"
769
73
  id="${this.fieldId}"
770
- name="${u(this.name)}"
771
- max=${u(this.max)}
772
- min=${u(this.min)}
773
- value="${u(this.value)}"
74
+ name="${ifDefined(this.name)}"
75
+ max=${ifDefined(this.max)}
76
+ min=${ifDefined(this.min)}
77
+ value="${ifDefined(this.value)}"
774
78
  ?readonly=${this.readonly}
775
79
  ?required=${this.required}
776
80
  ?disabled="${this.disabled}"
777
- aria-describedby="${u(this.fieldNoteAria())}"
778
- placeholder="${u(this.placeholder)}"
81
+ aria-describedby="${ifDefined(this.fieldNoteAria())}"
82
+ placeholder="${ifDefined(this.placeholder)}"
779
83
  @input=${this.handleDateOnInput}
780
84
  @click=${this.toggleCalendar}
781
85
  />
@@ -784,41 +88,44 @@ const M = class M extends R {
784
88
  aria-expanded="${this.showCalendar}"
785
89
  aria-label="Show Calendar"
786
90
  ?disabled="${this.disabled || this.readonly}"
787
- ?hideText=${!0}
91
+ ?hideText=${true}
788
92
  iconName="calendar-datepicker"
789
93
  variant="tertiary"
790
94
  @click="${this.toggleCalendar}"
791
95
  ></cre8-button>
792
96
  </div>
793
- ${this.showCalendar ? s`<cre8-calendar
794
- fieldDate="${u(this.value)}"
97
+ ${this.showCalendar
98
+ ? html `<cre8-calendar
99
+ fieldDate="${ifDefined(this.value)}"
795
100
  ?hasShortcuts=${this.hasShortcuts}
796
101
  @dateSelect="${this.handleCalendarSelect}"
797
102
  @outsideClick="${this.handleOutsideClick}"
798
- ></cre8-calendar>` : y}
799
- ${this.fieldNote || this.slotNotEmpty("fieldNote") ? s`<cre8-field-note
103
+ ></cre8-calendar>`
104
+ : nothing}
105
+ ${this.fieldNote || this.slotNotEmpty('fieldNote')
106
+ ? html `<cre8-field-note
800
107
  id=${this.ariaDescribedBy}
801
108
  class="cre8-c-date-picker__field-note"
802
109
  ><slot name="fieldNote">${this.fieldNote}</slot></cre8-field-note
803
- >` : y}
110
+ >`
111
+ : nothing}
804
112
  ${this.renderSuccessErrorFieldNote()}
805
113
  </div>
806
114
  `;
807
- }
808
- };
809
- M.styles = [I];
810
- let g = M;
811
- k([
812
- C('input[type="date"]')
813
- ], g.prototype, "field");
814
- k([
815
- l()
816
- ], g.prototype, "showCalendar");
817
- k([
818
- p({ type: Boolean, reflect: !0 })
819
- ], g.prototype, "hasShortcuts");
820
- customElements.get("cre8-date-picker") === void 0 && customElements.define("cre8-date-picker", g);
821
- export {
822
- g as Cre8DatePicker,
823
- g as default
824
- };
115
+ }
116
+ }
117
+ Cre8DatePicker.styles = [styles];
118
+ __decorate([
119
+ query('input[type="date"]')
120
+ ], Cre8DatePicker.prototype, "field", void 0);
121
+ __decorate([
122
+ state()
123
+ ], Cre8DatePicker.prototype, "showCalendar", void 0);
124
+ __decorate([
125
+ property({ type: Boolean, reflect: true })
126
+ ], Cre8DatePicker.prototype, "hasShortcuts", void 0);
127
+ if (customElements.get('cre8-date-picker') === undefined) {
128
+ customElements.define('cre8-date-picker', Cre8DatePicker);
129
+ }
130
+ export default Cre8DatePicker;
131
+ //# sourceMappingURL=date-picker.js.map