@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,58 +1,59 @@
1
- import l from "classnames";
2
- import { LitElement as m, html as i } from "lit";
3
- class c extends m {
4
- /**
5
- * Abstraction of `classnames` that automatically includes any style modifier
6
- * as well as any set variants.
7
- *
8
- * It is expected that `variant` would be overridden in a subclass with more
9
- * specific types, `@property() variant?: 'foo' | 'bar'`
10
- *
11
- * @param baseClassName
1
+ import classnames from 'classnames';
2
+ import { html, LitElement } from 'lit';
3
+ /**
4
+ * A base element.
5
+ */
6
+ export class Cre8Element extends LitElement {
7
+ /**
8
+ * Abstraction of `classnames` that automatically includes any style modifier
9
+ * as well as any set variants.
10
+ *
11
+ * It is expected that `variant` would be overridden in a subclass with more
12
+ * specific types, `@property() variant?: 'foo' | 'bar'`
13
+ *
14
+ * @param baseClassName
15
+ */
16
+ componentClassNames(baseClassName, additionalClassNames = {}) {
17
+ return classnames(baseClassName, additionalClassNames);
18
+ }
19
+ /**
20
+ * Check if a slot is empty
21
+ *
22
+ * @param slotName
23
+ */
24
+ slotEmpty(slotName) {
25
+ return !this.querySelector(`[slot="${slotName}"]`);
26
+ }
27
+ /**
28
+ * Check if a slot is not empty
29
+ *
30
+ * @param slotName
31
+ */
32
+ slotNotEmpty(slotName) {
33
+ if (!this.slotEmpty(slotName) !== false) {
34
+ return !this.slotEmpty(slotName);
35
+ }
36
+ return null;
37
+ }
38
+ /**
39
+ * Dispatch a custom event.
12
40
  */
13
- componentClassNames(t, e = {}) {
14
- return l(t, e);
15
- }
16
- /**
17
- * Check if a slot is empty
18
- *
19
- * @param slotName
20
- */
21
- slotEmpty(t) {
22
- return !this.querySelector(`[slot="${t}"]`);
23
- }
24
- /**
25
- * Check if a slot is not empty
26
- *
27
- * @param slotName
28
- */
29
- slotNotEmpty(t) {
30
- return this.slotEmpty(t) ? null : !this.slotEmpty(t);
31
- }
32
- /**
33
- * Dispatch a custom event.
34
- */
35
- dispatch({
36
- e: t,
37
- eventName: e,
38
- detailObj: r = {},
39
- optionsObj: n = {}
40
- }) {
41
- const o = {
42
- bubbles: !0,
43
- composed: !0,
44
- ...n,
45
- detail: { ...t && { originalEvent: t }, ...r }
46
- }, s = new CustomEvent(e, o);
47
- return this.dispatchEvent(s), s;
48
- }
49
- /**
50
- * Example render, should not be used
51
- */
52
- render() {
53
- return i`<slot></slot>`;
54
- }
41
+ dispatch({ e, eventName, detailObj = {}, optionsObj = {}, }) {
42
+ const options = {
43
+ bubbles: true,
44
+ composed: true,
45
+ ...optionsObj,
46
+ detail: { ...(e && { originalEvent: e }), ...detailObj },
47
+ };
48
+ const event = new CustomEvent(eventName, options);
49
+ this.dispatchEvent(event);
50
+ return event;
51
+ }
52
+ /**
53
+ * Example render, should not be used
54
+ */
55
+ render() {
56
+ return html `<slot></slot>`;
57
+ }
55
58
  }
56
- export {
57
- c as Cre8Element
58
- };
59
+ //# sourceMappingURL=cre8-element.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cre8-element.js","sourceRoot":"","sources":["../../components/cre8-element.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAoBvC;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,UAAU;IACzC;;;;;;;;OAQG;IACD,mBAAmB,CAAC,aAAqB,EAAE,oBAAoB,GAAG,EAAE;QAChE,OAAO,UAAU,CAAC,aAAa,EAAE,oBAAoB,CAAC,CAAC;IAC3D,CAAC;IAEH;;;;OAIG;IACD,SAAS,CAAC,QAAgB;QACtB,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,QAAQ,IAAI,CAAC,CAAC;IACvD,CAAC;IAEH;;;;OAIG;IACD,YAAY,CAAC,QAAgB;QACzB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,KAAK,EAAE,CAAC;YACtC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QACrC,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;KAEC;IACD,QAAQ,CAAC,EACL,CAAC,EAAE,SAAS,EAAE,SAAS,GAAG,EAAE,EAAE,UAAU,GAAG,EAAE,GAC7B;QAChB,MAAM,OAAO,GAAG;YACZ,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,GAAG,UAAU;YACb,MAAM,EAAE,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,SAAS,EAAE;SAC3D,CAAC;QACF,MAAM,KAAK,GAAG,IAAI,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAClD,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC1B,OAAO,KAAK,CAAC;IACjB,CAAC;IAEH;;OAEG;IACD,MAAM;QACF,OAAO,IAAI,CAAA,eAAe,CAAC;IAC/B,CAAC;CACJ","sourcesContent":["import classnames from 'classnames';\nimport { html, LitElement } from 'lit';\n\nexport interface DetailObj {\n [key: string]: unknown;\n}\n\nexport interface Cre8DispatchProps {\n e?: Event;\n eventName: string;\n detailObj?: DetailObj;\n optionsObj?: { [key: string]: unknown };\n}\n\nexport interface Cre8Event extends Event {\n detail: {\n originalEvent: Event;\n detailObj: DetailObj;\n };\n}\n\n/**\n * A base element.\n */\nexport class Cre8Element extends LitElement {\n /**\n * Abstraction of `classnames` that automatically includes any style modifier\n * as well as any set variants.\n *\n * It is expected that `variant` would be overridden in a subclass with more\n * specific types, `@property() variant?: 'foo' | 'bar'`\n *\n * @param baseClassName\n */\n componentClassNames(baseClassName: string, additionalClassNames = {}) {\n return classnames(baseClassName, additionalClassNames);\n }\n\n /**\n * Check if a slot is empty\n *\n * @param slotName\n */\n slotEmpty(slotName: string) {\n return !this.querySelector(`[slot=\"${slotName}\"]`);\n }\n\n /**\n * Check if a slot is not empty\n *\n * @param slotName\n */\n slotNotEmpty(slotName: string) {\n if (!this.slotEmpty(slotName) !== false) {\n return !this.slotEmpty(slotName);\n }\n return null;\n }\n\n /**\n * Dispatch a custom event.\n */\n dispatch({\n e, eventName, detailObj = {}, optionsObj = {},\n }: Cre8DispatchProps): CustomEvent {\n const options = {\n bubbles: true,\n composed: true,\n ...optionsObj,\n detail: { ...(e && { originalEvent: e }), ...detailObj },\n };\n const event = new CustomEvent(eventName, options);\n this.dispatchEvent(event);\n return event;\n }\n\n /**\n * Example render, should not be used\n */\n render() {\n return html`<slot></slot>`;\n }\n}\n"]}
@@ -1,246 +1,214 @@
1
- import { property as h } from "lit/decorators.js";
2
- import { Cre8Element as f } from "./cre8-element.js";
3
- let b = class extends Event {
4
- constructor(t, s, i, e) {
5
- super("context-request", { bubbles: !0, composed: !0 }), this.context = t, this.contextTarget = s, this.callback = i, this.subscribe = e ?? !1;
6
- }
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;
7
6
  };
8
- class v {
9
- get value() {
10
- return this.o;
11
- }
12
- set value(t) {
13
- this.setValue(t);
14
- }
15
- setValue(t, s = !1) {
16
- const i = s || !Object.is(t, this.o);
17
- this.o = t, i && this.updateObservers();
18
- }
19
- constructor(t) {
20
- this.subscriptions = /* @__PURE__ */ new Map(), this.updateObservers = () => {
21
- for (const [s, { disposer: i }] of this.subscriptions) s(this.o, i);
22
- }, t !== void 0 && (this.value = t);
23
- }
24
- addCallback(t, s, i) {
25
- if (!i) return void t(this.value);
26
- this.subscriptions.has(t) || this.subscriptions.set(t, { disposer: () => {
27
- this.subscriptions.delete(t);
28
- }, consumerHost: s });
29
- const { disposer: e } = this.subscriptions.get(t);
30
- t(this.value, e);
31
- }
32
- clearCallbacks() {
33
- this.subscriptions.clear();
34
- }
35
- }
36
- let x = class extends Event {
37
- constructor(t, s) {
38
- super("context-provider", { bubbles: !0, composed: !0 }), this.context = t, this.contextTarget = s;
39
- }
40
- };
41
- class d extends v {
42
- constructor(t, s, i) {
43
- super(s.context !== void 0 ? s.initialValue : i), this.onContextRequest = (e) => {
44
- if (e.context !== this.context) return;
45
- const a = e.contextTarget ?? e.composedPath()[0];
46
- a !== this.host && (e.stopPropagation(), this.addCallback(e.callback, a, e.subscribe));
47
- }, this.onProviderRequest = (e) => {
48
- if (e.context !== this.context || (e.contextTarget ?? e.composedPath()[0]) === this.host) return;
49
- const a = /* @__PURE__ */ new Set();
50
- for (const [r, { consumerHost: l }] of this.subscriptions) a.has(r) || (a.add(r), l.dispatchEvent(new b(this.context, l, r, !0)));
51
- e.stopPropagation();
52
- }, this.host = t, s.context !== void 0 ? this.context = s.context : this.context = s, this.attachListeners(), this.host.addController?.(this);
53
- }
54
- attachListeners() {
55
- this.host.addEventListener("context-request", this.onContextRequest), this.host.addEventListener("context-provider", this.onProviderRequest);
56
- }
57
- hostConnected() {
58
- this.host.dispatchEvent(new x(this.context, this.host));
59
- }
60
- }
61
- function p({ context: n }) {
62
- return (t, s) => {
63
- const i = /* @__PURE__ */ new WeakMap();
64
- if (typeof s == "object") return { get() {
65
- return t.get.call(this);
66
- }, set(e) {
67
- return i.get(this).setValue(e), t.set.call(this, e);
68
- }, init(e) {
69
- return i.set(this, new d(this, { context: n, initialValue: e })), e;
70
- } };
71
- {
72
- t.constructor.addInitializer(((r) => {
73
- i.set(r, new d(r, { context: n }));
74
- }));
75
- const e = Object.getOwnPropertyDescriptor(t, s);
76
- let a;
77
- if (e === void 0) {
78
- const r = /* @__PURE__ */ new WeakMap();
79
- a = { get() {
80
- return r.get(this);
81
- }, set(l) {
82
- i.get(this).setValue(l), r.set(this, l);
83
- }, configurable: !0, enumerable: !0 };
84
- } else {
85
- const r = e.set;
86
- a = { ...e, set(l) {
87
- i.get(this).setValue(l), r?.call(this, l);
88
- } };
89
- }
90
- return void Object.defineProperty(t, s, a);
91
- }
92
- };
7
+ import { property } from 'lit/decorators.js';
8
+ import { provide } from '@lit/context';
9
+ import { Cre8Element } from './cre8-element';
10
+ import { formInternalsContext, formStateContext } from './contexts/form-internals-context';
11
+ /**
12
+ * Base class for form-associated custom elements.
13
+ * Provides ElementInternals context to descendant components.
14
+ */
15
+ export class Cre8FormElement extends Cre8Element {
16
+ /**
17
+ * The value of the form field.
18
+ */
19
+ get value() {
20
+ return this.internalValue;
21
+ }
22
+ /**
23
+ * Sets the value of the form field.
24
+ * 1. Stores the new value so it can be retrieved by the getter.
25
+ * 2. Sets the current value of the control via ElementInternals.
26
+ * 3. Updates the actual field element.
27
+ * 4. Updates the form state context.
28
+ * 5. Triggers a re-render.
29
+ */
30
+ set value(newValue) {
31
+ const oldValue = this.value;
32
+ this.internalValue = newValue;
33
+ // Update form value for non-checkbox/radio types
34
+ if (this.type !== 'checkbox' && this.type !== 'radio') {
35
+ this._internals?.setFormValue(newValue);
36
+ }
37
+ this.updateField();
38
+ this.updateFormState();
39
+ this.requestUpdate('value', oldValue);
40
+ }
41
+ /**
42
+ * Updates the form state context for descendant consumption
43
+ */
44
+ updateFormState() {
45
+ this._formState = {
46
+ value: this.internalValue,
47
+ disabled: this.disabled ?? false,
48
+ required: this.required ?? false,
49
+ isError: this.isError ?? false,
50
+ isSuccess: this.isSuccess ?? false,
51
+ name: this.name,
52
+ };
53
+ }
54
+ /**
55
+ * Updates the actual field element's value
56
+ */
57
+ updateField() {
58
+ if (this.field && this.internalValue !== undefined) {
59
+ this.field.value = this.internalValue ?? '';
60
+ }
61
+ }
62
+ /**
63
+ * Lifecycle hook called after first render
64
+ */
65
+ firstUpdated() {
66
+ if (this.type !== 'checkbox' && this.type !== 'radio') {
67
+ this.defaultValue = this.value || this.getAttribute('value') || '';
68
+ }
69
+ this.updateField();
70
+ this.updateFormState();
71
+ }
72
+ /**
73
+ * Called when properties change
74
+ */
75
+ updated(changedProperties) {
76
+ super.updated(changedProperties);
77
+ // Update form state context when relevant properties change
78
+ if (changedProperties.has('disabled') ||
79
+ changedProperties.has('required') ||
80
+ changedProperties.has('isError') ||
81
+ changedProperties.has('isSuccess') ||
82
+ changedProperties.has('name')) {
83
+ this.updateFormState();
84
+ }
85
+ }
86
+ /**
87
+ * Form lifecycle callback - called when the form is reset
88
+ */
89
+ formResetCallback() {
90
+ this.value = this.defaultValue;
91
+ this.updateField();
92
+ }
93
+ /**
94
+ * Form lifecycle callback - called when the element is disabled via fieldset
95
+ */
96
+ formDisabledCallback(disabled) {
97
+ this.disabled = disabled;
98
+ }
99
+ /**
100
+ * Form lifecycle callback - called when form state is restored
101
+ */
102
+ formStateRestoreCallback(state, _mode) {
103
+ if (typeof state === 'string') {
104
+ this.value = state;
105
+ }
106
+ }
107
+ /**
108
+ * Gets the form associated with this element
109
+ */
110
+ get form() {
111
+ return this._internals?.form ?? null;
112
+ }
113
+ /**
114
+ * Gets the validation message
115
+ */
116
+ get validationMessage() {
117
+ return this._internals?.validationMessage ?? '';
118
+ }
119
+ /**
120
+ * Gets the validity state
121
+ */
122
+ get validity() {
123
+ return this._internals?.validity;
124
+ }
125
+ /**
126
+ * Gets whether the element will be validated
127
+ */
128
+ get willValidate() {
129
+ return this._internals?.willValidate ?? false;
130
+ }
131
+ /**
132
+ * Checks validity and reports to the user
133
+ */
134
+ reportValidity() {
135
+ return this._internals?.reportValidity() ?? true;
136
+ }
137
+ /**
138
+ * Checks validity without reporting
139
+ */
140
+ checkValidity() {
141
+ return this._internals?.checkValidity() ?? true;
142
+ }
143
+ /**
144
+ * Sets a custom validity message
145
+ */
146
+ setCustomValidity(message) {
147
+ if (this._internals && this.field) {
148
+ if (message) {
149
+ this._internals.setValidity({ customError: true }, message, this.field);
150
+ }
151
+ else {
152
+ this._internals.setValidity({});
153
+ }
154
+ }
155
+ }
156
+ constructor() {
157
+ super();
158
+ /**
159
+ * @protected
160
+ * @internal
161
+ * Stores the value for the `value` getter and setter.
162
+ */
163
+ this.internalValue = '';
164
+ /**
165
+ * @internal
166
+ * Stores the initial value for form reset functionality
167
+ */
168
+ this.defaultValue = '';
169
+ /**
170
+ * Provides form element state to descendants via context.
171
+ * Useful for nested components that need to react to form state.
172
+ */
173
+ this._formState = {
174
+ value: '',
175
+ disabled: false,
176
+ required: false,
177
+ isError: false,
178
+ isSuccess: false,
179
+ };
180
+ this._internals = this.attachInternals();
181
+ }
93
182
  }
94
- const m = Symbol("cre8-form-internals"), y = Symbol("cre8-form-state");
95
- var V = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, u = (n, t, s, i) => {
96
- for (var e = i > 1 ? void 0 : i ? _(t, s) : t, a = n.length - 1, r; a >= 0; a--)
97
- (r = n[a]) && (e = (i ? r(t, s, e) : r(e)) || e);
98
- return i && e && V(t, s, e), e;
99
- };
100
- const c = class c extends f {
101
- constructor() {
102
- super(), this.internalValue = "", this.defaultValue = "", this._formState = {
103
- value: "",
104
- disabled: !1,
105
- required: !1,
106
- isError: !1,
107
- isSuccess: !1
108
- }, this._internals = this.attachInternals();
109
- }
110
- get value() {
111
- return this.internalValue;
112
- }
113
- /**
114
- * Sets the value of the form field.
115
- * 1. Stores the new value so it can be retrieved by the getter.
116
- * 2. Sets the current value of the control via ElementInternals.
117
- * 3. Updates the actual field element.
118
- * 4. Updates the form state context.
119
- * 5. Triggers a re-render.
120
- */
121
- set value(t) {
122
- const s = this.value;
123
- this.internalValue = t, this.type !== "checkbox" && this.type !== "radio" && this._internals?.setFormValue(t), this.updateField(), this.updateFormState(), this.requestUpdate("value", s);
124
- }
125
- /**
126
- * Updates the form state context for descendant consumption
127
- */
128
- updateFormState() {
129
- this._formState = {
130
- value: this.internalValue,
131
- disabled: this.disabled ?? !1,
132
- required: this.required ?? !1,
133
- isError: this.isError ?? !1,
134
- isSuccess: this.isSuccess ?? !1,
135
- name: this.name
136
- };
137
- }
138
- /**
139
- * Updates the actual field element's value
140
- */
141
- updateField() {
142
- this.field && this.internalValue !== void 0 && (this.field.value = this.internalValue ?? "");
143
- }
144
- /**
145
- * Lifecycle hook called after first render
146
- */
147
- firstUpdated() {
148
- this.type !== "checkbox" && this.type !== "radio" && (this.defaultValue = this.value || this.getAttribute("value") || ""), this.updateField(), this.updateFormState();
149
- }
150
- /**
151
- * Called when properties change
152
- */
153
- updated(t) {
154
- super.updated(t), (t.has("disabled") || t.has("required") || t.has("isError") || t.has("isSuccess") || t.has("name")) && this.updateFormState();
155
- }
156
- /**
157
- * Form lifecycle callback - called when the form is reset
158
- */
159
- formResetCallback() {
160
- this.value = this.defaultValue, this.updateField();
161
- }
162
- /**
163
- * Form lifecycle callback - called when the element is disabled via fieldset
164
- */
165
- formDisabledCallback(t) {
166
- this.disabled = t;
167
- }
168
- /**
169
- * Form lifecycle callback - called when form state is restored
170
- */
171
- formStateRestoreCallback(t, s) {
172
- typeof t == "string" && (this.value = t);
173
- }
174
- /**
175
- * Gets the form associated with this element
176
- */
177
- get form() {
178
- return this._internals?.form ?? null;
179
- }
180
- /**
181
- * Gets the validation message
182
- */
183
- get validationMessage() {
184
- return this._internals?.validationMessage ?? "";
185
- }
186
- /**
187
- * Gets the validity state
188
- */
189
- get validity() {
190
- return this._internals?.validity;
191
- }
192
- /**
193
- * Gets whether the element will be validated
194
- */
195
- get willValidate() {
196
- return this._internals?.willValidate ?? !1;
197
- }
198
- /**
199
- * Checks validity and reports to the user
200
- */
201
- reportValidity() {
202
- return this._internals?.reportValidity() ?? !0;
203
- }
204
- /**
205
- * Checks validity without reporting
206
- */
207
- checkValidity() {
208
- return this._internals?.checkValidity() ?? !0;
209
- }
210
- /**
211
- * Sets a custom validity message
212
- */
213
- setCustomValidity(t) {
214
- this._internals && this.field && (t ? this._internals.setValidity({ customError: !0 }, t, this.field) : this._internals.setValidity({}));
215
- }
216
- };
217
- c.formAssociated = !0;
218
- let o = c;
219
- u([
220
- p({ context: m })
221
- ], o.prototype, "_internals", 2);
222
- u([
223
- p({ context: y })
224
- ], o.prototype, "_formState", 2);
225
- u([
226
- h()
227
- ], o.prototype, "name", 2);
228
- u([
229
- h({ type: Boolean, reflect: !0 })
230
- ], o.prototype, "disabled", 2);
231
- u([
232
- h({ type: Boolean, reflect: !0 })
233
- ], o.prototype, "required", 2);
234
- u([
235
- h({ type: Boolean, reflect: !0 })
236
- ], o.prototype, "isError", 2);
237
- u([
238
- h({ type: Boolean, reflect: !0 })
239
- ], o.prototype, "isSuccess", 2);
240
- u([
241
- h()
242
- ], o.prototype, "value", 1);
243
- export {
244
- o as Cre8FormElement,
245
- o as default
246
- };
183
+ /**
184
+ * @internal
185
+ * Tells the browser to treat the element like a form field.
186
+ * Ties the element to the HTML form it is in.
187
+ */
188
+ Cre8FormElement.formAssociated = true;
189
+ __decorate([
190
+ provide({ context: formInternalsContext })
191
+ ], Cre8FormElement.prototype, "_internals", void 0);
192
+ __decorate([
193
+ provide({ context: formStateContext })
194
+ ], Cre8FormElement.prototype, "_formState", void 0);
195
+ __decorate([
196
+ property()
197
+ ], Cre8FormElement.prototype, "name", void 0);
198
+ __decorate([
199
+ property({ type: Boolean, reflect: true })
200
+ ], Cre8FormElement.prototype, "disabled", void 0);
201
+ __decorate([
202
+ property({ type: Boolean, reflect: true })
203
+ ], Cre8FormElement.prototype, "required", void 0);
204
+ __decorate([
205
+ property({ type: Boolean, reflect: true })
206
+ ], Cre8FormElement.prototype, "isError", void 0);
207
+ __decorate([
208
+ property({ type: Boolean, reflect: true })
209
+ ], Cre8FormElement.prototype, "isSuccess", void 0);
210
+ __decorate([
211
+ property()
212
+ ], Cre8FormElement.prototype, "value", null);
213
+ export default Cre8FormElement;
214
+ //# sourceMappingURL=cre8-form-element.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cre8-form-element.js","sourceRoot":"","sources":["../../components/cre8-form-element.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACH,oBAAoB,EACpB,gBAAgB,EAG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AO,CAAC,EAAE,OAAO,EAAE,oBAAoB,EAAE,CAAC;mDACV;AAOjC;IADC,OAAO,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;mDAOrC;AAMF;IADC,QAAQ,EAAE;6CACG;AAMd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDACxB;AAMnB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDACxB;AAMnB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDACzB;AAMlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDACvB;AAMpB;IADC,QAAQ,EAAE;4CAGV;AAiKL,eAAe,eAAe,CAAC","sourcesContent":["import { property } from 'lit/decorators.js';\nimport { provide } from '@lit/context';\nimport { Cre8Element } from './cre8-element';\nimport {\n formInternalsContext,\n formStateContext,\n type Cre8ElementInternals,\n type FormElementState\n} from './contexts/form-internals-context';\n\nexport { type Cre8ElementInternals, type FormElementState } from './contexts/form-internals-context';\n\n/**\n * Base class for form-associated custom elements.\n * Provides ElementInternals context to descendant components.\n */\nexport abstract class Cre8FormElement extends Cre8Element {\n /**\n * @internal\n * Tells the browser to treat the element like a form field.\n * Ties the element to the HTML form it is in.\n */\n static formAssociated = true;\n\n /**\n * The type of form control (text, checkbox, radio, etc.)\n */\n abstract type: string;\n\n /**\n * @protected\n * @internal\n * Stores the value for the `value` getter and setter.\n */\n protected internalValue: string = '';\n\n /**\n * The underlying HTML form field element.\n * Should be implemented with `@query` in extending classes.\n */\n protected field?: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | HTMLButtonElement;\n\n /**\n * @internal\n * Stores the initial value for form reset functionality\n */\n protected defaultValue: string | boolean = '';\n\n /**\n * Provides ElementInternals to descendant components via context.\n * Descendants can consume this to access form participation APIs.\n */\n @provide({ context: formInternalsContext })\n _internals: Cre8ElementInternals;\n\n /**\n * Provides form element state to descendants via context.\n * Useful for nested components that need to react to form state.\n */\n @provide({ context: formStateContext })\n _formState: FormElementState = {\n value: '',\n disabled: false,\n required: false,\n isError: false,\n isSuccess: false,\n };\n\n /**\n * The name of the form field\n */\n @property()\n name?: string;\n\n /**\n * Whether the field is disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled?: boolean;\n\n /**\n * Whether the field is required\n */\n @property({ type: Boolean, reflect: true })\n required?: boolean;\n\n /**\n * Whether the field is in an error state\n */\n @property({ type: Boolean, reflect: true })\n isError?: boolean;\n\n /**\n * Whether the field is in a success state\n */\n @property({ type: Boolean, reflect: true })\n isSuccess?: boolean;\n\n /**\n * The value of the form field.\n */\n @property()\n get value(): string {\n return this.internalValue;\n }\n\n /**\n * Sets the value of the form field.\n * 1. Stores the new value so it can be retrieved by the getter.\n * 2. Sets the current value of the control via ElementInternals.\n * 3. Updates the actual field element.\n * 4. Updates the form state context.\n * 5. Triggers a re-render.\n */\n set value(newValue: string) {\n const oldValue = this.value;\n this.internalValue = newValue;\n\n // Update form value for non-checkbox/radio types\n if (this.type !== 'checkbox' && this.type !== 'radio') {\n this._internals?.setFormValue(newValue);\n }\n\n this.updateField();\n this.updateFormState();\n this.requestUpdate('value', oldValue);\n }\n\n /**\n * Updates the form state context for descendant consumption\n */\n protected updateFormState(): void {\n this._formState = {\n value: this.internalValue,\n disabled: this.disabled ?? false,\n required: this.required ?? false,\n isError: this.isError ?? false,\n isSuccess: this.isSuccess ?? false,\n name: this.name,\n };\n }\n\n /**\n * Updates the actual field element's value\n */\n protected updateField(): void {\n if (this.field && this.internalValue !== undefined) {\n this.field.value = this.internalValue ?? '';\n }\n }\n\n /**\n * Lifecycle hook called after first render\n */\n protected firstUpdated(): void {\n if (this.type !== 'checkbox' && this.type !== 'radio') {\n this.defaultValue = this.value || this.getAttribute('value') || '';\n }\n this.updateField();\n this.updateFormState();\n }\n\n /**\n * Called when properties change\n */\n protected updated(changedProperties: Map<PropertyKey, unknown>): void {\n super.updated(changedProperties);\n\n // Update form state context when relevant properties change\n if (\n changedProperties.has('disabled') ||\n changedProperties.has('required') ||\n changedProperties.has('isError') ||\n changedProperties.has('isSuccess') ||\n changedProperties.has('name')\n ) {\n this.updateFormState();\n }\n }\n\n /**\n * Form lifecycle callback - called when the form is reset\n */\n formResetCallback(): void {\n this.value = this.defaultValue as string;\n this.updateField();\n }\n\n /**\n * Form lifecycle callback - called when the element is disabled via fieldset\n */\n formDisabledCallback(disabled: boolean): void {\n this.disabled = disabled;\n }\n\n /**\n * Form lifecycle callback - called when form state is restored\n */\n formStateRestoreCallback(state: string | FormData | null, _mode: 'restore' | 'autocomplete'): void {\n if (typeof state === 'string') {\n this.value = state;\n }\n }\n\n /**\n * Gets the form associated with this element\n */\n get form(): HTMLFormElement | null {\n return this._internals?.form ?? null;\n }\n\n /**\n * Gets the validation message\n */\n get validationMessage(): string {\n return this._internals?.validationMessage ?? '';\n }\n\n /**\n * Gets the validity state\n */\n get validity(): ValidityState | undefined {\n return this._internals?.validity;\n }\n\n /**\n * Gets whether the element will be validated\n */\n get willValidate(): boolean {\n return this._internals?.willValidate ?? false;\n }\n\n /**\n * Checks validity and reports to the user\n */\n reportValidity(): boolean {\n return this._internals?.reportValidity() ?? true;\n }\n\n /**\n * Checks validity without reporting\n */\n checkValidity(): boolean {\n return this._internals?.checkValidity() ?? true;\n }\n\n /**\n * Sets a custom validity message\n */\n setCustomValidity(message: string): void {\n if (this._internals && this.field) {\n if (message) {\n this._internals.setValidity({ customError: true }, message, this.field);\n } else {\n this._internals.setValidity({});\n }\n }\n }\n\n constructor() {\n super();\n this._internals = this.attachInternals() as Cre8ElementInternals;\n }\n}\n\nexport default Cre8FormElement;\n"]}