@andespindola/ui-core 0.3.0 → 0.4.0

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 (304) hide show
  1. package/dist/cjs/{index-Cb1tfi_9.js → index-DV8CICae.js} +1 -1
  2. package/dist/cjs/loader.cjs.js +2 -2
  3. package/dist/cjs/ui-accordion-item.cjs.entry.js +2 -2
  4. package/dist/cjs/ui-accordion.cjs.entry.js +2 -2
  5. package/dist/cjs/ui-alert.cjs.entry.js +1 -1
  6. package/dist/cjs/ui-avatar-group.cjs.entry.js +2 -2
  7. package/dist/cjs/ui-avatar.cjs.entry.js +2 -2
  8. package/dist/cjs/ui-badge.cjs.entry.js +1 -1
  9. package/dist/cjs/ui-breadcrumb-item.cjs.entry.js +2 -2
  10. package/dist/cjs/ui-breadcrumb.cjs.entry.js +2 -2
  11. package/dist/cjs/ui-button.cjs.entry.js +1 -1
  12. package/dist/cjs/ui-card.cjs.entry.js +2 -2
  13. package/dist/cjs/ui-carousel.cjs.entry.js +104 -0
  14. package/dist/cjs/ui-checkbox.cjs.entry.js +2 -2
  15. package/dist/cjs/ui-combobox.cjs.entry.js +1 -1
  16. package/dist/cjs/ui-command.cjs.entry.js +137 -0
  17. package/dist/cjs/ui-container.cjs.entry.js +2 -2
  18. package/dist/cjs/ui-date-picker.cjs.entry.js +2 -2
  19. package/dist/cjs/ui-dialog.cjs.entry.js +2 -2
  20. package/dist/cjs/ui-drawer.cjs.entry.js +2 -2
  21. package/dist/cjs/ui-dropdown-item.cjs.entry.js +2 -2
  22. package/dist/cjs/ui-dropdown-menu.cjs.entry.js +2 -2
  23. package/dist/cjs/ui-field.cjs.entry.js +2 -2
  24. package/dist/cjs/ui-file-upload.cjs.entry.js +2 -2
  25. package/dist/cjs/ui-grid.cjs.entry.js +2 -2
  26. package/dist/cjs/ui-input.cjs.entry.js +2 -2
  27. package/dist/cjs/ui-label.cjs.entry.js +2 -2
  28. package/dist/cjs/ui-loading-overlay.cjs.entry.js +1 -1
  29. package/dist/cjs/ui-navbar.cjs.entry.js +2 -2
  30. package/dist/cjs/ui-pagination.cjs.entry.js +3 -3
  31. package/dist/cjs/ui-popover.cjs.entry.js +2 -2
  32. package/dist/cjs/ui-progress-circular.cjs.entry.js +2 -2
  33. package/dist/cjs/ui-progress.cjs.entry.js +2 -2
  34. package/dist/cjs/ui-radio-group.cjs.entry.js +2 -2
  35. package/dist/cjs/ui-rating.cjs.entry.js +2 -2
  36. package/dist/cjs/ui-reveal.cjs.entry.js +2 -2
  37. package/dist/cjs/ui-scroll-progress.cjs.entry.js +2 -2
  38. package/dist/cjs/ui-section.cjs.entry.js +2 -2
  39. package/dist/cjs/ui-segmented.cjs.entry.js +2 -2
  40. package/dist/cjs/ui-select.cjs.entry.js +2 -2
  41. package/dist/cjs/ui-separator.cjs.entry.js +2 -2
  42. package/dist/cjs/ui-skeleton.cjs.entry.js +2 -2
  43. package/dist/cjs/ui-slider.cjs.entry.js +2 -2
  44. package/dist/cjs/ui-spinner.cjs.entry.js +2 -2
  45. package/dist/cjs/ui-stack.cjs.entry.js +2 -2
  46. package/dist/cjs/ui-stat.cjs.entry.js +2 -2
  47. package/dist/cjs/ui-switch.cjs.entry.js +2 -2
  48. package/dist/cjs/ui-table.cjs.entry.js +2 -2
  49. package/dist/cjs/ui-tabs.cjs.entry.js +3 -3
  50. package/dist/cjs/ui-textarea.cjs.entry.js +2 -2
  51. package/dist/cjs/ui-theme-toggle.cjs.entry.js +2 -2
  52. package/dist/cjs/ui-timeline-item.cjs.entry.js +19 -0
  53. package/dist/cjs/ui-timeline.cjs.entry.js +17 -0
  54. package/dist/cjs/ui-toast.cjs.entry.js +2 -2
  55. package/dist/cjs/ui-toaster.cjs.entry.js +2 -2
  56. package/dist/cjs/ui-tooltip.cjs.entry.js +2 -2
  57. package/dist/cjs/uikit.cjs.js +2 -2
  58. package/dist/collection/collection-manifest.json +4 -0
  59. package/dist/collection/components/ui-accordion/ui-accordion.js +1 -1
  60. package/dist/collection/components/ui-accordion-item/ui-accordion-item.js +1 -1
  61. package/dist/collection/components/ui-avatar/ui-avatar.js +1 -1
  62. package/dist/collection/components/ui-avatar-group/ui-avatar-group.js +1 -1
  63. package/dist/collection/components/ui-breadcrumb/ui-breadcrumb.js +1 -1
  64. package/dist/collection/components/ui-breadcrumb-item/ui-breadcrumb-item.js +1 -1
  65. package/dist/collection/components/ui-card/ui-card.js +1 -1
  66. package/dist/collection/components/ui-carousel/ui-carousel.css +103 -0
  67. package/dist/collection/components/ui-carousel/ui-carousel.js +273 -0
  68. package/dist/collection/components/ui-checkbox/ui-checkbox.js +1 -1
  69. package/dist/collection/components/ui-command/ui-command.css +85 -0
  70. package/dist/collection/components/ui-command/ui-command.js +290 -0
  71. package/dist/collection/components/ui-container/ui-container.js +1 -1
  72. package/dist/collection/components/ui-date-picker/ui-date-picker.js +1 -1
  73. package/dist/collection/components/ui-dialog/ui-dialog.js +1 -1
  74. package/dist/collection/components/ui-drawer/ui-drawer.js +1 -1
  75. package/dist/collection/components/ui-dropdown-item/ui-dropdown-item.js +1 -1
  76. package/dist/collection/components/ui-dropdown-menu/ui-dropdown-menu.js +1 -1
  77. package/dist/collection/components/ui-field/ui-field.js +1 -1
  78. package/dist/collection/components/ui-file-upload/ui-file-upload.js +1 -1
  79. package/dist/collection/components/ui-grid/ui-grid.js +1 -1
  80. package/dist/collection/components/ui-input/ui-input.js +1 -1
  81. package/dist/collection/components/ui-label/ui-label.js +1 -1
  82. package/dist/collection/components/ui-navbar/ui-navbar.js +1 -1
  83. package/dist/collection/components/ui-pagination/ui-pagination.js +2 -2
  84. package/dist/collection/components/ui-popover/ui-popover.js +1 -1
  85. package/dist/collection/components/ui-progress/ui-progress.js +1 -1
  86. package/dist/collection/components/ui-progress-circular/ui-progress-circular.js +1 -1
  87. package/dist/collection/components/ui-radio-group/ui-radio-group.js +1 -1
  88. package/dist/collection/components/ui-rating/ui-rating.js +1 -1
  89. package/dist/collection/components/ui-reveal/ui-reveal.js +1 -1
  90. package/dist/collection/components/ui-scroll-progress/ui-scroll-progress.js +1 -1
  91. package/dist/collection/components/ui-section/ui-section.js +1 -1
  92. package/dist/collection/components/ui-segmented/ui-segmented.js +1 -1
  93. package/dist/collection/components/ui-select/ui-select.js +1 -1
  94. package/dist/collection/components/ui-separator/ui-separator.js +1 -1
  95. package/dist/collection/components/ui-skeleton/ui-skeleton.js +1 -1
  96. package/dist/collection/components/ui-slider/ui-slider.js +1 -1
  97. package/dist/collection/components/ui-spinner/ui-spinner.js +1 -1
  98. package/dist/collection/components/ui-stack/ui-stack.js +1 -1
  99. package/dist/collection/components/ui-stat/ui-stat.js +1 -1
  100. package/dist/collection/components/ui-switch/ui-switch.js +1 -1
  101. package/dist/collection/components/ui-table/ui-table.js +1 -1
  102. package/dist/collection/components/ui-tabs/ui-tabs.js +2 -2
  103. package/dist/collection/components/ui-textarea/ui-textarea.js +1 -1
  104. package/dist/collection/components/ui-theme-toggle/ui-theme-toggle.js +1 -1
  105. package/dist/collection/components/ui-timeline/ui-timeline.css +8 -0
  106. package/dist/collection/components/ui-timeline/ui-timeline.js +18 -0
  107. package/dist/collection/components/ui-timeline-item/ui-timeline-item.css +83 -0
  108. package/dist/collection/components/ui-timeline-item/ui-timeline-item.js +90 -0
  109. package/dist/collection/components/ui-toast/ui-toast.js +1 -1
  110. package/dist/collection/components/ui-toaster/ui-toaster.js +1 -1
  111. package/dist/collection/components/ui-tooltip/ui-tooltip.js +1 -1
  112. package/dist/components/index.js +1 -1
  113. package/dist/components/{p-DDJE__UC.js → p-DAnXvxY_.js} +1 -1
  114. package/dist/components/{p-DUT2Q8Df.js → p-yTNEyxh1.js} +1 -1
  115. package/dist/components/ui-accordion-item.js +1 -1
  116. package/dist/components/ui-accordion.js +1 -1
  117. package/dist/components/ui-avatar-group.js +1 -1
  118. package/dist/components/ui-avatar.js +1 -1
  119. package/dist/components/ui-breadcrumb-item.js +1 -1
  120. package/dist/components/ui-breadcrumb.js +1 -1
  121. package/dist/components/ui-card.js +1 -1
  122. package/dist/components/ui-carousel.d.ts +11 -0
  123. package/dist/components/ui-carousel.js +1 -0
  124. package/dist/components/ui-checkbox.js +1 -1
  125. package/dist/components/ui-command.d.ts +11 -0
  126. package/dist/components/ui-command.js +1 -0
  127. package/dist/components/ui-container.js +1 -1
  128. package/dist/components/ui-date-picker.js +1 -1
  129. package/dist/components/ui-dialog.js +1 -1
  130. package/dist/components/ui-drawer.js +1 -1
  131. package/dist/components/ui-dropdown-item.js +1 -1
  132. package/dist/components/ui-dropdown-menu.js +1 -1
  133. package/dist/components/ui-field.js +1 -1
  134. package/dist/components/ui-file-upload.js +1 -1
  135. package/dist/components/ui-grid.js +1 -1
  136. package/dist/components/ui-input.js +1 -1
  137. package/dist/components/ui-label.js +1 -1
  138. package/dist/components/ui-loading-overlay.js +1 -1
  139. package/dist/components/ui-navbar.js +1 -1
  140. package/dist/components/ui-pagination.js +1 -1
  141. package/dist/components/ui-popover.js +1 -1
  142. package/dist/components/ui-progress-circular.js +1 -1
  143. package/dist/components/ui-progress.js +1 -1
  144. package/dist/components/ui-radio-group.js +1 -1
  145. package/dist/components/ui-rating.js +1 -1
  146. package/dist/components/ui-reveal.js +1 -1
  147. package/dist/components/ui-scroll-progress.js +1 -1
  148. package/dist/components/ui-section.js +1 -1
  149. package/dist/components/ui-segmented.js +1 -1
  150. package/dist/components/ui-select.js +1 -1
  151. package/dist/components/ui-separator.js +1 -1
  152. package/dist/components/ui-skeleton.js +1 -1
  153. package/dist/components/ui-slider.js +1 -1
  154. package/dist/components/ui-spinner.js +1 -1
  155. package/dist/components/ui-stack.js +1 -1
  156. package/dist/components/ui-stat.js +1 -1
  157. package/dist/components/ui-switch.js +1 -1
  158. package/dist/components/ui-table.js +1 -1
  159. package/dist/components/ui-tabs.js +1 -1
  160. package/dist/components/ui-textarea.js +1 -1
  161. package/dist/components/ui-theme-toggle.js +1 -1
  162. package/dist/components/ui-timeline-item.d.ts +11 -0
  163. package/dist/components/ui-timeline-item.js +1 -0
  164. package/dist/components/ui-timeline.d.ts +11 -0
  165. package/dist/components/ui-timeline.js +1 -0
  166. package/dist/components/ui-toast.js +1 -1
  167. package/dist/components/ui-toaster.js +1 -1
  168. package/dist/components/ui-tooltip.js +1 -1
  169. package/dist/esm/{index-DYwlrXg_.js → index-COlwaVJP.js} +1 -1
  170. package/dist/esm/loader.js +3 -3
  171. package/dist/esm/ui-accordion-item.entry.js +2 -2
  172. package/dist/esm/ui-accordion.entry.js +2 -2
  173. package/dist/esm/ui-alert.entry.js +1 -1
  174. package/dist/esm/ui-avatar-group.entry.js +2 -2
  175. package/dist/esm/ui-avatar.entry.js +2 -2
  176. package/dist/esm/ui-badge.entry.js +1 -1
  177. package/dist/esm/ui-breadcrumb-item.entry.js +2 -2
  178. package/dist/esm/ui-breadcrumb.entry.js +2 -2
  179. package/dist/esm/ui-button.entry.js +1 -1
  180. package/dist/esm/ui-card.entry.js +2 -2
  181. package/dist/esm/ui-carousel.entry.js +102 -0
  182. package/dist/esm/ui-checkbox.entry.js +2 -2
  183. package/dist/esm/ui-combobox.entry.js +1 -1
  184. package/dist/esm/ui-command.entry.js +135 -0
  185. package/dist/esm/ui-container.entry.js +2 -2
  186. package/dist/esm/ui-date-picker.entry.js +2 -2
  187. package/dist/esm/ui-dialog.entry.js +2 -2
  188. package/dist/esm/ui-drawer.entry.js +2 -2
  189. package/dist/esm/ui-dropdown-item.entry.js +2 -2
  190. package/dist/esm/ui-dropdown-menu.entry.js +2 -2
  191. package/dist/esm/ui-field.entry.js +2 -2
  192. package/dist/esm/ui-file-upload.entry.js +2 -2
  193. package/dist/esm/ui-grid.entry.js +2 -2
  194. package/dist/esm/ui-input.entry.js +2 -2
  195. package/dist/esm/ui-label.entry.js +2 -2
  196. package/dist/esm/ui-loading-overlay.entry.js +1 -1
  197. package/dist/esm/ui-navbar.entry.js +2 -2
  198. package/dist/esm/ui-pagination.entry.js +3 -3
  199. package/dist/esm/ui-popover.entry.js +2 -2
  200. package/dist/esm/ui-progress-circular.entry.js +2 -2
  201. package/dist/esm/ui-progress.entry.js +2 -2
  202. package/dist/esm/ui-radio-group.entry.js +2 -2
  203. package/dist/esm/ui-rating.entry.js +2 -2
  204. package/dist/esm/ui-reveal.entry.js +2 -2
  205. package/dist/esm/ui-scroll-progress.entry.js +2 -2
  206. package/dist/esm/ui-section.entry.js +2 -2
  207. package/dist/esm/ui-segmented.entry.js +2 -2
  208. package/dist/esm/ui-select.entry.js +2 -2
  209. package/dist/esm/ui-separator.entry.js +2 -2
  210. package/dist/esm/ui-skeleton.entry.js +2 -2
  211. package/dist/esm/ui-slider.entry.js +2 -2
  212. package/dist/esm/ui-spinner.entry.js +2 -2
  213. package/dist/esm/ui-stack.entry.js +2 -2
  214. package/dist/esm/ui-stat.entry.js +2 -2
  215. package/dist/esm/ui-switch.entry.js +2 -2
  216. package/dist/esm/ui-table.entry.js +2 -2
  217. package/dist/esm/ui-tabs.entry.js +3 -3
  218. package/dist/esm/ui-textarea.entry.js +2 -2
  219. package/dist/esm/ui-theme-toggle.entry.js +2 -2
  220. package/dist/esm/ui-timeline-item.entry.js +17 -0
  221. package/dist/esm/ui-timeline.entry.js +15 -0
  222. package/dist/esm/ui-toast.entry.js +2 -2
  223. package/dist/esm/ui-toaster.entry.js +2 -2
  224. package/dist/esm/ui-tooltip.entry.js +2 -2
  225. package/dist/esm/uikit.js +3 -3
  226. package/dist/types/components/ui-carousel/ui-carousel.d.ts +35 -0
  227. package/dist/types/components/ui-command/ui-command.d.ts +42 -0
  228. package/dist/types/components/ui-timeline/ui-timeline.d.ts +3 -0
  229. package/dist/types/components/ui-timeline-item/ui-timeline-item.d.ts +10 -0
  230. package/dist/types/components.d.ts +236 -0
  231. package/dist/uikit/{p-5e0bc34a.entry.js → p-02583f33.entry.js} +1 -1
  232. package/dist/uikit/{p-4044ebde.entry.js → p-0b8fb2cc.entry.js} +1 -1
  233. package/dist/uikit/{p-894fc85f.entry.js → p-12777ebf.entry.js} +1 -1
  234. package/dist/uikit/p-186d394f.entry.js +1 -0
  235. package/dist/uikit/{p-fd05c146.entry.js → p-247f7a40.entry.js} +1 -1
  236. package/dist/uikit/{p-8535f5c9.entry.js → p-24c9885b.entry.js} +1 -1
  237. package/dist/uikit/p-26c4b4f9.entry.js +1 -0
  238. package/dist/uikit/{p-3fdfad2e.entry.js → p-2716a9e4.entry.js} +1 -1
  239. package/dist/uikit/{p-1449f229.entry.js → p-27c609c2.entry.js} +1 -1
  240. package/dist/uikit/{p-5951a496.entry.js → p-2a4de93f.entry.js} +1 -1
  241. package/dist/uikit/{p-88238a16.entry.js → p-2ce36223.entry.js} +1 -1
  242. package/dist/uikit/p-30834f9e.entry.js +1 -0
  243. package/dist/uikit/p-333a3598.entry.js +1 -0
  244. package/dist/uikit/{p-60910c03.entry.js → p-33a19160.entry.js} +1 -1
  245. package/dist/uikit/{p-a3d819cd.entry.js → p-400536f7.entry.js} +1 -1
  246. package/dist/uikit/{p-008118af.entry.js → p-411a753f.entry.js} +1 -1
  247. package/dist/uikit/p-41355be1.entry.js +1 -0
  248. package/dist/uikit/p-4281fc69.entry.js +1 -0
  249. package/dist/uikit/p-4c2fb226.entry.js +1 -0
  250. package/dist/uikit/{p-45e80e73.entry.js → p-5562b70d.entry.js} +1 -1
  251. package/dist/uikit/{p-c1a9db7c.entry.js → p-56b1bf3f.entry.js} +1 -1
  252. package/dist/uikit/p-57adf02c.entry.js +1 -0
  253. package/dist/uikit/{p-1685191b.entry.js → p-58035d5a.entry.js} +1 -1
  254. package/dist/uikit/{p-1514ae37.entry.js → p-5ff44eca.entry.js} +1 -1
  255. package/dist/uikit/{p-b7e30398.entry.js → p-66037a7c.entry.js} +1 -1
  256. package/dist/uikit/{p-6d363a02.entry.js → p-6d58ff8d.entry.js} +1 -1
  257. package/dist/uikit/{p-ffcd1faf.entry.js → p-7a04fd11.entry.js} +1 -1
  258. package/dist/uikit/p-7aeed213.entry.js +1 -0
  259. package/dist/uikit/p-80236139.entry.js +1 -0
  260. package/dist/uikit/p-81a37bda.entry.js +1 -0
  261. package/dist/uikit/{p-f4344cce.entry.js → p-849347da.entry.js} +1 -1
  262. package/dist/uikit/p-866a0947.entry.js +1 -0
  263. package/dist/uikit/{p-bdd30484.entry.js → p-86bf22c1.entry.js} +1 -1
  264. package/dist/uikit/p-98234aed.entry.js +1 -0
  265. package/dist/uikit/p-COlwaVJP.js +2 -0
  266. package/dist/uikit/{p-413cfbc6.entry.js → p-a312d278.entry.js} +1 -1
  267. package/dist/uikit/{p-9310b73b.entry.js → p-a4b535ad.entry.js} +1 -1
  268. package/dist/uikit/p-a8f81996.entry.js +1 -0
  269. package/dist/uikit/{p-99b7e461.entry.js → p-aa0ce28c.entry.js} +1 -1
  270. package/dist/uikit/{p-b0f2b1c8.entry.js → p-aa41b084.entry.js} +1 -1
  271. package/dist/uikit/p-acce5342.entry.js +1 -0
  272. package/dist/uikit/p-b232849a.entry.js +1 -0
  273. package/dist/uikit/{p-f2983e94.entry.js → p-bd287e67.entry.js} +1 -1
  274. package/dist/uikit/p-bf66ce1b.entry.js +1 -0
  275. package/dist/uikit/p-c0b3f5a3.entry.js +1 -0
  276. package/dist/uikit/{p-9f09fcec.entry.js → p-c29317aa.entry.js} +1 -1
  277. package/dist/uikit/{p-3995852d.entry.js → p-d73e789a.entry.js} +1 -1
  278. package/dist/uikit/{p-2d92ce04.entry.js → p-dc00c84b.entry.js} +1 -1
  279. package/dist/uikit/{p-fb89d9a4.entry.js → p-de2bb69c.entry.js} +1 -1
  280. package/dist/uikit/{p-ccca2aeb.entry.js → p-e2e35a6b.entry.js} +1 -1
  281. package/dist/uikit/{p-d7ab158f.entry.js → p-e32fa613.entry.js} +1 -1
  282. package/dist/uikit/{p-e2065caa.entry.js → p-e61e7ef1.entry.js} +1 -1
  283. package/dist/uikit/{p-62881327.entry.js → p-e891fec3.entry.js} +1 -1
  284. package/dist/uikit/{p-0715db16.entry.js → p-ef6ec7f7.entry.js} +1 -1
  285. package/dist/uikit/p-faa31e8c.entry.js +1 -0
  286. package/dist/uikit/uikit.css +1 -1
  287. package/dist/uikit/uikit.esm.js +1 -1
  288. package/package.json +1 -1
  289. package/dist/uikit/p-10afa395.entry.js +0 -1
  290. package/dist/uikit/p-1ef7948f.entry.js +0 -1
  291. package/dist/uikit/p-283e7623.entry.js +0 -1
  292. package/dist/uikit/p-3b1f92da.entry.js +0 -1
  293. package/dist/uikit/p-4ba0e4bc.entry.js +0 -1
  294. package/dist/uikit/p-6c51a216.entry.js +0 -1
  295. package/dist/uikit/p-8b882367.entry.js +0 -1
  296. package/dist/uikit/p-9d8d420e.entry.js +0 -1
  297. package/dist/uikit/p-9dbe7e12.entry.js +0 -1
  298. package/dist/uikit/p-DYwlrXg_.js +0 -2
  299. package/dist/uikit/p-bac2c523.entry.js +0 -1
  300. package/dist/uikit/p-bbc718ef.entry.js +0 -1
  301. package/dist/uikit/p-c2138fb9.entry.js +0 -1
  302. package/dist/uikit/p-c94492ff.entry.js +0 -1
  303. package/dist/uikit/p-da807078.entry.js +0 -1
  304. package/dist/uikit/p-fbe7806c.entry.js +0 -1
@@ -0,0 +1,273 @@
1
+ import { h, Host, } from "@stencil/core";
2
+ export class UiCarousel {
3
+ constructor() {
4
+ /** Permite navegação circular (wrap) entre o primeiro e o último slide. */
5
+ this.loop = false;
6
+ /** Intervalo de autoplay em ms. 0 desliga o autoplay. */
7
+ this.autoplay = 0;
8
+ /** Exibe as setas de navegação. */
9
+ this.showArrows = true;
10
+ /** Exibe os indicadores (dots). */
11
+ this.showDots = true;
12
+ /** Índice do slide atual. */
13
+ this.index = 0;
14
+ /** Quantidade de slides. */
15
+ this.count = 0;
16
+ this.syncCount = () => {
17
+ const slot = this.host.shadowRoot?.querySelector("slot");
18
+ if (!slot)
19
+ return;
20
+ this.count = slot.assignedElements().length;
21
+ if (this.index > this.count - 1) {
22
+ this.index = Math.max(0, this.count - 1);
23
+ }
24
+ };
25
+ this.handleMouseEnter = () => {
26
+ if (this.autoplay > 0)
27
+ this.stopAutoplay();
28
+ };
29
+ this.handleMouseLeave = () => {
30
+ if (this.autoplay > 0)
31
+ this.startAutoplay();
32
+ };
33
+ }
34
+ componentDidLoad() {
35
+ this.syncCount();
36
+ this.startAutoplay();
37
+ }
38
+ disconnectedCallback() {
39
+ this.stopAutoplay();
40
+ }
41
+ startAutoplay() {
42
+ if (this.autoplay > 0) {
43
+ this.stopAutoplay();
44
+ this.timer = setInterval(() => {
45
+ this.advance();
46
+ }, this.autoplay);
47
+ }
48
+ }
49
+ stopAutoplay() {
50
+ if (this.timer) {
51
+ clearInterval(this.timer);
52
+ this.timer = undefined;
53
+ }
54
+ }
55
+ advance() {
56
+ if (this.count < 1)
57
+ return;
58
+ this.goTo((this.index + 1) % this.count);
59
+ }
60
+ setIndex(i) {
61
+ if (this.count < 1)
62
+ return;
63
+ let target = i;
64
+ if (this.loop) {
65
+ target = ((i % this.count) + this.count) % this.count;
66
+ }
67
+ else {
68
+ target = Math.max(0, Math.min(i, this.count - 1));
69
+ }
70
+ if (target === this.index)
71
+ return;
72
+ this.index = target;
73
+ this.uiChange.emit(this.index);
74
+ }
75
+ /** Avança para o próximo slide. */
76
+ async next() {
77
+ this.setIndex(this.index + 1);
78
+ }
79
+ /** Volta para o slide anterior. */
80
+ async prev() {
81
+ this.setIndex(this.index - 1);
82
+ }
83
+ /** Vai para um slide específico pelo índice. */
84
+ async goTo(i) {
85
+ this.setIndex(i);
86
+ }
87
+ render() {
88
+ const hasNav = this.count > 1;
89
+ const atStart = this.index <= 0;
90
+ const atEnd = this.index >= this.count - 1;
91
+ return (h(Host, { key: '8674262ced2aef3587cb5b5148628776c3a438df' }, h("div", { key: 'f75c9ec8e3d6aa8635e3001a108795f2b0ac8075', class: "viewport", onMouseEnter: this.handleMouseEnter, onMouseLeave: this.handleMouseLeave }, h("div", { key: 'eb654e625366fbeef0b91dd9d86fabe82bada130', class: "track", style: { transform: `translateX(${-this.index * 100}%)` } }, h("slot", { key: '23be2c8067e38b9092bbe6d3ef7b59efb91176c2', onSlotchange: this.syncCount })), this.showArrows && hasNav && (h("button", { key: 'a079b10d78e03a780cccd34a18cb677890c79b8d', type: "button", class: "arrow arrow-prev", "aria-label": "Slide anterior", disabled: !this.loop && atStart, onClick: () => this.prev() }, "\u2039")), this.showArrows && hasNav && (h("button", { key: 'baa6cdc3055631a766afeffc2dadf3d565afaf71', type: "button", class: "arrow arrow-next", "aria-label": "Pr\u00F3ximo slide", disabled: !this.loop && atEnd, onClick: () => this.next() }, "\u203A")), this.showDots && hasNav && (h("div", { key: '3b381517e47193aece7e50c7f134f3e70ea2eda6', class: "dots" }, Array.from({ length: this.count }).map((_, i) => (h("button", { key: i, type: "button", class: { dot: true, active: i === this.index }, "aria-label": `Ir para slide ${i + 1}`, "aria-current": i === this.index ? "true" : "false", onClick: () => this.goTo(i) }))))))));
92
+ }
93
+ static get is() { return "ui-carousel"; }
94
+ static get encapsulation() { return "shadow"; }
95
+ static get originalStyleUrls() {
96
+ return {
97
+ "$": ["ui-carousel.css"]
98
+ };
99
+ }
100
+ static get styleUrls() {
101
+ return {
102
+ "$": ["ui-carousel.css"]
103
+ };
104
+ }
105
+ static get properties() {
106
+ return {
107
+ "loop": {
108
+ "type": "boolean",
109
+ "mutable": false,
110
+ "complexType": {
111
+ "original": "boolean",
112
+ "resolved": "boolean",
113
+ "references": {}
114
+ },
115
+ "required": false,
116
+ "optional": false,
117
+ "docs": {
118
+ "tags": [],
119
+ "text": "Permite navega\u00E7\u00E3o circular (wrap) entre o primeiro e o \u00FAltimo slide."
120
+ },
121
+ "getter": false,
122
+ "setter": false,
123
+ "reflect": false,
124
+ "attribute": "loop",
125
+ "defaultValue": "false"
126
+ },
127
+ "autoplay": {
128
+ "type": "number",
129
+ "mutable": false,
130
+ "complexType": {
131
+ "original": "number",
132
+ "resolved": "number",
133
+ "references": {}
134
+ },
135
+ "required": false,
136
+ "optional": false,
137
+ "docs": {
138
+ "tags": [],
139
+ "text": "Intervalo de autoplay em ms. 0 desliga o autoplay."
140
+ },
141
+ "getter": false,
142
+ "setter": false,
143
+ "reflect": false,
144
+ "attribute": "autoplay",
145
+ "defaultValue": "0"
146
+ },
147
+ "showArrows": {
148
+ "type": "boolean",
149
+ "mutable": false,
150
+ "complexType": {
151
+ "original": "boolean",
152
+ "resolved": "boolean",
153
+ "references": {}
154
+ },
155
+ "required": false,
156
+ "optional": false,
157
+ "docs": {
158
+ "tags": [],
159
+ "text": "Exibe as setas de navega\u00E7\u00E3o."
160
+ },
161
+ "getter": false,
162
+ "setter": false,
163
+ "reflect": false,
164
+ "attribute": "show-arrows",
165
+ "defaultValue": "true"
166
+ },
167
+ "showDots": {
168
+ "type": "boolean",
169
+ "mutable": false,
170
+ "complexType": {
171
+ "original": "boolean",
172
+ "resolved": "boolean",
173
+ "references": {}
174
+ },
175
+ "required": false,
176
+ "optional": false,
177
+ "docs": {
178
+ "tags": [],
179
+ "text": "Exibe os indicadores (dots)."
180
+ },
181
+ "getter": false,
182
+ "setter": false,
183
+ "reflect": false,
184
+ "attribute": "show-dots",
185
+ "defaultValue": "true"
186
+ }
187
+ };
188
+ }
189
+ static get states() {
190
+ return {
191
+ "index": {},
192
+ "count": {}
193
+ };
194
+ }
195
+ static get events() {
196
+ return [{
197
+ "method": "uiChange",
198
+ "name": "uiChange",
199
+ "bubbles": true,
200
+ "cancelable": true,
201
+ "composed": true,
202
+ "docs": {
203
+ "tags": [],
204
+ "text": "Emitido quando o slide atual muda, com o \u00EDndice novo."
205
+ },
206
+ "complexType": {
207
+ "original": "number",
208
+ "resolved": "number",
209
+ "references": {}
210
+ }
211
+ }];
212
+ }
213
+ static get methods() {
214
+ return {
215
+ "next": {
216
+ "complexType": {
217
+ "signature": "() => Promise<void>",
218
+ "parameters": [],
219
+ "references": {
220
+ "Promise": {
221
+ "location": "global",
222
+ "id": "global::Promise"
223
+ }
224
+ },
225
+ "return": "Promise<void>"
226
+ },
227
+ "docs": {
228
+ "text": "Avan\u00E7a para o pr\u00F3ximo slide.",
229
+ "tags": []
230
+ }
231
+ },
232
+ "prev": {
233
+ "complexType": {
234
+ "signature": "() => Promise<void>",
235
+ "parameters": [],
236
+ "references": {
237
+ "Promise": {
238
+ "location": "global",
239
+ "id": "global::Promise"
240
+ }
241
+ },
242
+ "return": "Promise<void>"
243
+ },
244
+ "docs": {
245
+ "text": "Volta para o slide anterior.",
246
+ "tags": []
247
+ }
248
+ },
249
+ "goTo": {
250
+ "complexType": {
251
+ "signature": "(i: number) => Promise<void>",
252
+ "parameters": [{
253
+ "name": "i",
254
+ "type": "number",
255
+ "docs": ""
256
+ }],
257
+ "references": {
258
+ "Promise": {
259
+ "location": "global",
260
+ "id": "global::Promise"
261
+ }
262
+ },
263
+ "return": "Promise<void>"
264
+ },
265
+ "docs": {
266
+ "text": "Vai para um slide espec\u00EDfico pelo \u00EDndice.",
267
+ "tags": []
268
+ }
269
+ }
270
+ };
271
+ }
272
+ static get elementRef() { return "host"; }
273
+ }
@@ -19,7 +19,7 @@ export class UiCheckbox {
19
19
  };
20
20
  }
21
21
  render() {
22
- return (h(Host, { key: 'ec07dd3898dfb9eeac1a07d41895be145a8f03f0' }, h("button", { key: '7d1e72daf042994ba140703e5f8ce2bb5558932d', class: "checkbox", type: "button", role: "checkbox", "aria-checked": this.checked ? "true" : "false", disabled: this.disabled, onClick: this.toggle, onKeyDown: this.onKeyDown }, h("svg", { key: 'f1a59bc59f90e6bce5b289a4a05da51778788c19', class: "check", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "3", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("polyline", { key: '6ea7bc0406e6e8befd6ceea7193423bd433d9a63', points: "20 6 9 17 4 12" })))));
22
+ return (h(Host, { key: '341aeea485e623d978d0e738481dd5e0865b1ff3' }, h("button", { key: 'a3a5fa4569152d3811d0b575dd3dba099aa7b782', class: "checkbox", type: "button", role: "checkbox", "aria-checked": this.checked ? "true" : "false", disabled: this.disabled, onClick: this.toggle, onKeyDown: this.onKeyDown }, h("svg", { key: '2653b2db08fc200cc9de850bf3b5e7aec7bb96a0', class: "check", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "3", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("polyline", { key: '009b16f0efcd6f4d59255262e95542e5362832ed', points: "20 6 9 17 4 12" })))));
23
23
  }
24
24
  static get is() { return "ui-checkbox"; }
25
25
  static get encapsulation() { return "shadow"; }
@@ -0,0 +1,85 @@
1
+ .command {
2
+ padding: 0;
3
+ border: none;
4
+ background: transparent;
5
+ max-width: none;
6
+ max-height: none;
7
+ color: var(--ui-foreground);
8
+ }
9
+
10
+ .command::backdrop {
11
+ background: var(--ui-overlay);
12
+ backdrop-filter: blur(4px);
13
+ }
14
+
15
+ .panel {
16
+ margin: 12vh auto 0;
17
+ width: min(40rem, 92vw);
18
+ border: 1px solid var(--ui-border);
19
+ background: var(--ui-panel-strong);
20
+ box-shadow: var(--ui-shadow-lg);
21
+ backdrop-filter: blur(22px) saturate(140%);
22
+ border-radius: var(--ui-radius-xl);
23
+ overflow: hidden;
24
+ font-family: var(--ui-font-sans);
25
+ }
26
+
27
+ .search {
28
+ width: 100%;
29
+ box-sizing: border-box;
30
+ border: none;
31
+ border-bottom: 1px solid var(--ui-border);
32
+ background: transparent;
33
+ color: var(--ui-foreground);
34
+ font-family: var(--ui-font-sans);
35
+ font-size: 1rem;
36
+ padding: 1rem;
37
+ outline: none;
38
+ }
39
+
40
+ .search::placeholder {
41
+ color: var(--ui-text-faint);
42
+ }
43
+
44
+ .list {
45
+ max-height: 50vh;
46
+ overflow: auto;
47
+ padding: 0.5rem;
48
+ }
49
+
50
+ .group {
51
+ text-transform: uppercase;
52
+ font-size: 0.7rem;
53
+ letter-spacing: 0.04em;
54
+ color: var(--ui-text-faint);
55
+ padding: 0.5rem 0.75rem 0.25rem;
56
+ }
57
+
58
+ .item {
59
+ display: flex;
60
+ align-items: center;
61
+ justify-content: space-between;
62
+ gap: 0.75rem;
63
+ padding: 0.5rem 0.75rem;
64
+ border-radius: var(--ui-radius-sm);
65
+ cursor: pointer;
66
+ }
67
+
68
+ .item.active {
69
+ background: var(--ui-chip);
70
+ }
71
+
72
+ .label {
73
+ color: var(--ui-foreground);
74
+ }
75
+
76
+ .hint {
77
+ color: var(--ui-text-faint);
78
+ font-size: 0.8rem;
79
+ }
80
+
81
+ .empty {
82
+ text-align: center;
83
+ color: var(--ui-text-faint);
84
+ padding: 1.5rem 1rem;
85
+ }
@@ -0,0 +1,290 @@
1
+ import { h, Host, } from "@stencil/core";
2
+ export class UiCommand {
3
+ constructor() {
4
+ /** Controla a abertura da paleta de comandos. */
5
+ this.open = false;
6
+ /** Itens disponíveis na paleta. */
7
+ this.items = [];
8
+ /** Placeholder do campo de busca. */
9
+ this.placeholder = "Buscar comando…";
10
+ /** Abre/fecha com Cmd/Ctrl+K quando habilitado. */
11
+ this.hotkey = true;
12
+ /** Texto digitado na busca. */
13
+ this.query = "";
14
+ /** Índice do item destacado na lista filtrada. */
15
+ this.activeIndex = 0;
16
+ this.onHotkey = (event) => {
17
+ if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "k") {
18
+ event.preventDefault();
19
+ this.open = !this.open;
20
+ }
21
+ };
22
+ this.onClose = () => {
23
+ if (this.open)
24
+ this.open = false;
25
+ this.query = "";
26
+ this.activeIndex = 0;
27
+ };
28
+ this.onInput = (event) => {
29
+ this.query = event.target.value;
30
+ this.activeIndex = 0;
31
+ };
32
+ this.onKeydown = (event) => {
33
+ const items = this.filtered;
34
+ switch (event.key) {
35
+ case "ArrowDown":
36
+ event.preventDefault();
37
+ if (items.length === 0)
38
+ return;
39
+ this.activeIndex = (this.activeIndex + 1) % items.length;
40
+ break;
41
+ case "ArrowUp":
42
+ event.preventDefault();
43
+ if (items.length === 0)
44
+ return;
45
+ this.activeIndex =
46
+ (this.activeIndex - 1 + items.length) % items.length;
47
+ break;
48
+ case "Enter":
49
+ if (items[this.activeIndex]) {
50
+ event.preventDefault();
51
+ this.select(items[this.activeIndex]);
52
+ }
53
+ break;
54
+ }
55
+ };
56
+ }
57
+ onOpenChange(value) {
58
+ this.sync(value);
59
+ if (value) {
60
+ requestAnimationFrame(() => this.inputEl?.focus());
61
+ }
62
+ }
63
+ componentDidLoad() {
64
+ this.sync(this.open);
65
+ }
66
+ connectedCallback() {
67
+ if (this.hotkey && typeof document !== "undefined") {
68
+ document.addEventListener("keydown", this.onHotkey);
69
+ }
70
+ }
71
+ disconnectedCallback() {
72
+ if (typeof document !== "undefined") {
73
+ document.removeEventListener("keydown", this.onHotkey);
74
+ }
75
+ }
76
+ sync(value) {
77
+ if (!this.dialogEl)
78
+ return;
79
+ if (value && !this.dialogEl.open)
80
+ this.dialogEl.showModal();
81
+ else if (!value && this.dialogEl.open)
82
+ this.dialogEl.close();
83
+ }
84
+ /** Abre a paleta imperativamente. */
85
+ async show() {
86
+ this.open = true;
87
+ }
88
+ /** Fecha a paleta imperativamente. */
89
+ async close() {
90
+ this.open = false;
91
+ }
92
+ get filtered() {
93
+ const term = this.query.toLowerCase();
94
+ return this.items.filter((item) => item.label.toLowerCase().includes(term));
95
+ }
96
+ select(item) {
97
+ this.uiSelect.emit(item.value);
98
+ this.open = false;
99
+ this.query = "";
100
+ this.activeIndex = 0;
101
+ }
102
+ render() {
103
+ const items = this.filtered;
104
+ let flatIndex = -1;
105
+ const seenGroups = new Set();
106
+ return (h(Host, { key: '2c99a55d42f0fa90a2b2ec4cae3d0952429fe861' }, h("dialog", { key: '514c6b029111f2fbba14ce430f515c3528b6666f', class: "command", ref: (el) => (this.dialogEl = el), onClose: this.onClose, onCancel: this.onClose }, h("div", { key: '430a2fd81e35ff4f2478a45d1398df7a575ce92d', class: "panel" }, h("input", { key: '2eb475315a08d49f5716fd3aac87e1ce9d3d937b', class: "search", type: "text", role: "combobox", "aria-expanded": "true", "aria-autocomplete": "list", autocomplete: "off", value: this.query, placeholder: this.placeholder, ref: (el) => (this.inputEl = el), onInput: this.onInput, onKeyDown: this.onKeydown }), h("div", { key: '031e45085143e13aa360b0f2641a1fc80c4f75ab', class: "list", role: "listbox" }, items.length === 0 ? (h("div", { class: "empty" }, "Nenhum comando")) : (items.map((item) => {
107
+ flatIndex += 1;
108
+ const index = flatIndex;
109
+ const showGroup = item.group !== undefined && !seenGroups.has(item.group);
110
+ if (item.group !== undefined)
111
+ seenGroups.add(item.group);
112
+ return [
113
+ showGroup ? (h("div", { class: "group" }, item.group)) : null,
114
+ h("div", { class: { item: true, active: index === this.activeIndex }, role: "option", "aria-selected": index === this.activeIndex ? "true" : "false", onMouseEnter: () => (this.activeIndex = index), onMouseDown: (event) => {
115
+ event.preventDefault();
116
+ this.select(item);
117
+ } }, h("span", { class: "label" }, item.label), item.hint ? (h("span", { class: "hint" }, item.hint)) : null),
118
+ ];
119
+ })))))));
120
+ }
121
+ static get is() { return "ui-command"; }
122
+ static get encapsulation() { return "shadow"; }
123
+ static get originalStyleUrls() {
124
+ return {
125
+ "$": ["ui-command.css"]
126
+ };
127
+ }
128
+ static get styleUrls() {
129
+ return {
130
+ "$": ["ui-command.css"]
131
+ };
132
+ }
133
+ static get properties() {
134
+ return {
135
+ "open": {
136
+ "type": "boolean",
137
+ "mutable": true,
138
+ "complexType": {
139
+ "original": "boolean",
140
+ "resolved": "boolean",
141
+ "references": {}
142
+ },
143
+ "required": false,
144
+ "optional": false,
145
+ "docs": {
146
+ "tags": [],
147
+ "text": "Controla a abertura da paleta de comandos."
148
+ },
149
+ "getter": false,
150
+ "setter": false,
151
+ "reflect": true,
152
+ "attribute": "open",
153
+ "defaultValue": "false"
154
+ },
155
+ "items": {
156
+ "type": "unknown",
157
+ "mutable": false,
158
+ "complexType": {
159
+ "original": "UiCommandItem[]",
160
+ "resolved": "UiCommandItem[]",
161
+ "references": {
162
+ "UiCommandItem": {
163
+ "location": "local",
164
+ "path": "/Users/andersonespindola/.ghq/github.com/andersonflima/ui/packages/core/src/components/ui-command/ui-command.tsx",
165
+ "id": "src/components/ui-command/ui-command.tsx::UiCommandItem"
166
+ }
167
+ }
168
+ },
169
+ "required": false,
170
+ "optional": false,
171
+ "docs": {
172
+ "tags": [],
173
+ "text": "Itens dispon\u00EDveis na paleta."
174
+ },
175
+ "getter": false,
176
+ "setter": false,
177
+ "defaultValue": "[]"
178
+ },
179
+ "placeholder": {
180
+ "type": "string",
181
+ "mutable": false,
182
+ "complexType": {
183
+ "original": "string",
184
+ "resolved": "string",
185
+ "references": {}
186
+ },
187
+ "required": false,
188
+ "optional": false,
189
+ "docs": {
190
+ "tags": [],
191
+ "text": "Placeholder do campo de busca."
192
+ },
193
+ "getter": false,
194
+ "setter": false,
195
+ "reflect": false,
196
+ "attribute": "placeholder",
197
+ "defaultValue": "\"Buscar comando\u2026\""
198
+ },
199
+ "hotkey": {
200
+ "type": "boolean",
201
+ "mutable": false,
202
+ "complexType": {
203
+ "original": "boolean",
204
+ "resolved": "boolean",
205
+ "references": {}
206
+ },
207
+ "required": false,
208
+ "optional": false,
209
+ "docs": {
210
+ "tags": [],
211
+ "text": "Abre/fecha com Cmd/Ctrl+K quando habilitado."
212
+ },
213
+ "getter": false,
214
+ "setter": false,
215
+ "reflect": false,
216
+ "attribute": "hotkey",
217
+ "defaultValue": "true"
218
+ }
219
+ };
220
+ }
221
+ static get states() {
222
+ return {
223
+ "query": {},
224
+ "activeIndex": {}
225
+ };
226
+ }
227
+ static get events() {
228
+ return [{
229
+ "method": "uiSelect",
230
+ "name": "uiSelect",
231
+ "bubbles": true,
232
+ "cancelable": true,
233
+ "composed": true,
234
+ "docs": {
235
+ "tags": [],
236
+ "text": "Emitido ao selecionar um comando."
237
+ },
238
+ "complexType": {
239
+ "original": "string",
240
+ "resolved": "string",
241
+ "references": {}
242
+ }
243
+ }];
244
+ }
245
+ static get methods() {
246
+ return {
247
+ "show": {
248
+ "complexType": {
249
+ "signature": "() => Promise<void>",
250
+ "parameters": [],
251
+ "references": {
252
+ "Promise": {
253
+ "location": "global",
254
+ "id": "global::Promise"
255
+ }
256
+ },
257
+ "return": "Promise<void>"
258
+ },
259
+ "docs": {
260
+ "text": "Abre a paleta imperativamente.",
261
+ "tags": []
262
+ }
263
+ },
264
+ "close": {
265
+ "complexType": {
266
+ "signature": "() => Promise<void>",
267
+ "parameters": [],
268
+ "references": {
269
+ "Promise": {
270
+ "location": "global",
271
+ "id": "global::Promise"
272
+ }
273
+ },
274
+ "return": "Promise<void>"
275
+ },
276
+ "docs": {
277
+ "text": "Fecha a paleta imperativamente.",
278
+ "tags": []
279
+ }
280
+ }
281
+ };
282
+ }
283
+ static get elementRef() { return "host"; }
284
+ static get watchers() {
285
+ return [{
286
+ "propName": "open",
287
+ "methodName": "onOpenChange"
288
+ }];
289
+ }
290
+ }
@@ -12,7 +12,7 @@ export class UiContainer {
12
12
  [`size-${this.size}`]: true,
13
13
  padded: this.padded,
14
14
  };
15
- return (h(Host, { key: 'd9f407cdd15aa38d7e21898f4088d58846e38f22' }, h("div", { key: '7c7596a79dedc3daf94ac5440447c4608e037854', class: classes }, h("slot", { key: '5005378ea1514e2d96fa0cdba219055161ee6688' }))));
15
+ return (h(Host, { key: '474a0aeda3c1caad66af3108381f325dbec41566' }, h("div", { key: 'df5fdea525ac34873923b65408f971957fb53186', class: classes }, h("slot", { key: 'e83ff090d3634368b7425db0d4c94f860934c951' }))));
16
16
  }
17
17
  static get is() { return "ui-container"; }
18
18
  static get encapsulation() { return "shadow"; }