@winkintel/bootstrap-svelte 0.0.1

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 (471) hide show
  1. package/LICENSE.md +202 -0
  2. package/README.md +221 -0
  3. package/dist/Accordion/accordion-body.svelte +8 -0
  4. package/dist/Accordion/accordion-body.svelte.d.ts +4 -0
  5. package/dist/Accordion/accordion-button.svelte +25 -0
  6. package/dist/Accordion/accordion-button.svelte.d.ts +4 -0
  7. package/dist/Accordion/accordion-collapse.svelte +18 -0
  8. package/dist/Accordion/accordion-collapse.svelte.d.ts +4 -0
  9. package/dist/Accordion/accordion-header.svelte +8 -0
  10. package/dist/Accordion/accordion-header.svelte.d.ts +4 -0
  11. package/dist/Accordion/accordion-item.svelte +33 -0
  12. package/dist/Accordion/accordion-item.svelte.d.ts +4 -0
  13. package/dist/Accordion/accordion.svelte +65 -0
  14. package/dist/Accordion/accordion.svelte.d.ts +51 -0
  15. package/dist/Accordion/accordion.svelte.js +139 -0
  16. package/dist/Accordion/composition.d.ts +7 -0
  17. package/dist/Accordion/composition.js +6 -0
  18. package/dist/Accordion/index.d.ts +1 -0
  19. package/dist/Accordion/index.js +1 -0
  20. package/dist/Accordion/types.d.ts +15 -0
  21. package/dist/Accordion/types.js +1 -0
  22. package/dist/Alert/alert.svelte +73 -0
  23. package/dist/Alert/alert.svelte.d.ts +46 -0
  24. package/dist/Alert/index.d.ts +2 -0
  25. package/dist/Alert/index.js +2 -0
  26. package/dist/Alert/types.d.ts +11 -0
  27. package/dist/Alert/types.js +1 -0
  28. package/dist/Badge/badge.svelte +42 -0
  29. package/dist/Badge/badge.svelte.d.ts +36 -0
  30. package/dist/Badge/index.d.ts +2 -0
  31. package/dist/Badge/index.js +2 -0
  32. package/dist/Badge/types.d.ts +28 -0
  33. package/dist/Badge/types.js +24 -0
  34. package/dist/Breadcrumb/breadcrumb-item.svelte +66 -0
  35. package/dist/Breadcrumb/breadcrumb-item.svelte.d.ts +30 -0
  36. package/dist/Breadcrumb/breadcrumb.svelte +57 -0
  37. package/dist/Breadcrumb/breadcrumb.svelte.d.ts +34 -0
  38. package/dist/Breadcrumb/breadcrumb.svelte.js +41 -0
  39. package/dist/Breadcrumb/composition.d.ts +3 -0
  40. package/dist/Breadcrumb/composition.js +2 -0
  41. package/dist/Breadcrumb/index.d.ts +1 -0
  42. package/dist/Breadcrumb/index.js +1 -0
  43. package/dist/Breadcrumb/types.d.ts +9 -0
  44. package/dist/Breadcrumb/types.js +1 -0
  45. package/dist/BreakpointListener/breakpoint-listener.svelte +54 -0
  46. package/dist/BreakpointListener/breakpoint-listener.svelte.d.ts +4 -0
  47. package/dist/BreakpointListener/index.d.ts +2 -0
  48. package/dist/BreakpointListener/index.js +2 -0
  49. package/dist/BreakpointListener/types.d.ts +30 -0
  50. package/dist/BreakpointListener/types.js +20 -0
  51. package/dist/Button/button.svelte +87 -0
  52. package/dist/Button/button.svelte.d.ts +59 -0
  53. package/dist/Button/index.d.ts +2 -0
  54. package/dist/Button/index.js +2 -0
  55. package/dist/Button/types.d.ts +26 -0
  56. package/dist/Button/types.js +1 -0
  57. package/dist/ButtonGroup/button-check.svelte +70 -0
  58. package/dist/ButtonGroup/button-check.svelte.d.ts +35 -0
  59. package/dist/ButtonGroup/button-group.svelte +51 -0
  60. package/dist/ButtonGroup/button-group.svelte.d.ts +43 -0
  61. package/dist/ButtonGroup/button-toolbar.svelte +36 -0
  62. package/dist/ButtonGroup/button-toolbar.svelte.d.ts +28 -0
  63. package/dist/ButtonGroup/index.d.ts +4 -0
  64. package/dist/ButtonGroup/index.js +4 -0
  65. package/dist/ButtonGroup/types.d.ts +21 -0
  66. package/dist/ButtonGroup/types.js +1 -0
  67. package/dist/Card/card-body.svelte +10 -0
  68. package/dist/Card/card-body.svelte.d.ts +3 -0
  69. package/dist/Card/card-footer.svelte +10 -0
  70. package/dist/Card/card-footer.svelte.d.ts +3 -0
  71. package/dist/Card/card-group.svelte +10 -0
  72. package/dist/Card/card-group.svelte.d.ts +3 -0
  73. package/dist/Card/card-header.svelte +10 -0
  74. package/dist/Card/card-header.svelte.d.ts +3 -0
  75. package/dist/Card/card-img-overlay.svelte +10 -0
  76. package/dist/Card/card-img-overlay.svelte.d.ts +3 -0
  77. package/dist/Card/card-img.svelte +12 -0
  78. package/dist/Card/card-img.svelte.d.ts +4 -0
  79. package/dist/Card/card-link.svelte +10 -0
  80. package/dist/Card/card-link.svelte.d.ts +4 -0
  81. package/dist/Card/card-subtitle.svelte +11 -0
  82. package/dist/Card/card-subtitle.svelte.d.ts +4 -0
  83. package/dist/Card/card-text.svelte +10 -0
  84. package/dist/Card/card-text.svelte.d.ts +3 -0
  85. package/dist/Card/card-title.svelte +11 -0
  86. package/dist/Card/card-title.svelte.d.ts +4 -0
  87. package/dist/Card/card.svelte +45 -0
  88. package/dist/Card/card.svelte.d.ts +38 -0
  89. package/dist/Card/composition.d.ts +12 -0
  90. package/dist/Card/composition.js +11 -0
  91. package/dist/Card/index.d.ts +1 -0
  92. package/dist/Card/index.js +1 -0
  93. package/dist/Card/types.d.ts +22 -0
  94. package/dist/Card/types.js +1 -0
  95. package/dist/Carousel/carousel-caption.svelte +30 -0
  96. package/dist/Carousel/carousel-caption.svelte.d.ts +22 -0
  97. package/dist/Carousel/carousel-control-next.svelte +35 -0
  98. package/dist/Carousel/carousel-control-next.svelte.d.ts +21 -0
  99. package/dist/Carousel/carousel-control-prev.svelte +35 -0
  100. package/dist/Carousel/carousel-control-prev.svelte.d.ts +21 -0
  101. package/dist/Carousel/carousel-indicator-button.svelte +41 -0
  102. package/dist/Carousel/carousel-indicator-button.svelte.d.ts +21 -0
  103. package/dist/Carousel/carousel-indicators.svelte +33 -0
  104. package/dist/Carousel/carousel-indicators.svelte.d.ts +25 -0
  105. package/dist/Carousel/carousel-inner.svelte +30 -0
  106. package/dist/Carousel/carousel-inner.svelte.d.ts +22 -0
  107. package/dist/Carousel/carousel-item.svelte +138 -0
  108. package/dist/Carousel/carousel-item.svelte.d.ts +28 -0
  109. package/dist/Carousel/carousel.svelte +140 -0
  110. package/dist/Carousel/carousel.svelte.d.ts +46 -0
  111. package/dist/Carousel/carousel.svelte.js +551 -0
  112. package/dist/Carousel/composition.d.ts +9 -0
  113. package/dist/Carousel/composition.js +8 -0
  114. package/dist/Carousel/index.d.ts +1 -0
  115. package/dist/Carousel/index.js +1 -0
  116. package/dist/Carousel/types.d.ts +74 -0
  117. package/dist/Carousel/types.js +1 -0
  118. package/dist/CloseButton/close-button.svelte +32 -0
  119. package/dist/CloseButton/close-button.svelte.d.ts +29 -0
  120. package/dist/CloseButton/index.d.ts +2 -0
  121. package/dist/CloseButton/index.js +2 -0
  122. package/dist/CloseButton/types.d.ts +6 -0
  123. package/dist/CloseButton/types.js +1 -0
  124. package/dist/Col/col.svelte +133 -0
  125. package/dist/Col/col.svelte.d.ts +60 -0
  126. package/dist/Col/index.d.ts +2 -0
  127. package/dist/Col/index.js +2 -0
  128. package/dist/Col/types.d.ts +30 -0
  129. package/dist/Col/types.js +1 -0
  130. package/dist/Collapse/collapse-aria-attachment.svelte.d.ts +3 -0
  131. package/dist/Collapse/collapse-aria-attachment.svelte.js +32 -0
  132. package/dist/Collapse/collapse.svelte +63 -0
  133. package/dist/Collapse/collapse.svelte.d.ts +45 -0
  134. package/dist/Collapse/index.d.ts +3 -0
  135. package/dist/Collapse/index.js +3 -0
  136. package/dist/Collapse/transition.d.ts +5 -0
  137. package/dist/Collapse/transition.js +75 -0
  138. package/dist/Collapse/types.d.ts +18 -0
  139. package/dist/Collapse/types.js +1 -0
  140. package/dist/Container/container.svelte +46 -0
  141. package/dist/Container/container.svelte.d.ts +36 -0
  142. package/dist/Container/index.d.ts +2 -0
  143. package/dist/Container/index.js +2 -0
  144. package/dist/Container/types.d.ts +8 -0
  145. package/dist/Container/types.js +1 -0
  146. package/dist/Dropdown/composition.d.ts +8 -0
  147. package/dist/Dropdown/composition.js +7 -0
  148. package/dist/Dropdown/dropdown-divider.svelte +23 -0
  149. package/dist/Dropdown/dropdown-divider.svelte.d.ts +18 -0
  150. package/dist/Dropdown/dropdown-header.svelte +27 -0
  151. package/dist/Dropdown/dropdown-header.svelte.d.ts +19 -0
  152. package/dist/Dropdown/dropdown-item-text.svelte +26 -0
  153. package/dist/Dropdown/dropdown-item-text.svelte.d.ts +18 -0
  154. package/dist/Dropdown/dropdown-item.svelte +86 -0
  155. package/dist/Dropdown/dropdown-item.svelte.d.ts +24 -0
  156. package/dist/Dropdown/dropdown-menu.svelte +82 -0
  157. package/dist/Dropdown/dropdown-menu.svelte.d.ts +27 -0
  158. package/dist/Dropdown/dropdown-toggle.svelte +67 -0
  159. package/dist/Dropdown/dropdown-toggle.svelte.d.ts +24 -0
  160. package/dist/Dropdown/dropdown.svelte +106 -0
  161. package/dist/Dropdown/dropdown.svelte.d.ts +34 -0
  162. package/dist/Dropdown/dropdown.svelte.js +435 -0
  163. package/dist/Dropdown/index.d.ts +1 -0
  164. package/dist/Dropdown/index.js +1 -0
  165. package/dist/Dropdown/types.d.ts +47 -0
  166. package/dist/Dropdown/types.js +1 -0
  167. package/dist/Form/composition.d.ts +34 -0
  168. package/dist/Form/composition.js +33 -0
  169. package/dist/Form/form-check-input.svelte +92 -0
  170. package/dist/Form/form-check-input.svelte.d.ts +48 -0
  171. package/dist/Form/form-check-label.svelte +26 -0
  172. package/dist/Form/form-check-label.svelte.d.ts +21 -0
  173. package/dist/Form/form-check.svelte +55 -0
  174. package/dist/Form/form-check.svelte.d.ts +50 -0
  175. package/dist/Form/form-color-input.svelte +54 -0
  176. package/dist/Form/form-color-input.svelte.d.ts +30 -0
  177. package/dist/Form/form-date-input.svelte +64 -0
  178. package/dist/Form/form-date-input.svelte.d.ts +46 -0
  179. package/dist/Form/form-datetime-local-input.svelte +60 -0
  180. package/dist/Form/form-datetime-local-input.svelte.d.ts +45 -0
  181. package/dist/Form/form-email-input.svelte +64 -0
  182. package/dist/Form/form-email-input.svelte.d.ts +46 -0
  183. package/dist/Form/form-feedback.svelte +36 -0
  184. package/dist/Form/form-feedback.svelte.d.ts +26 -0
  185. package/dist/Form/form-file-input.svelte +43 -0
  186. package/dist/Form/form-file-input.svelte.d.ts +30 -0
  187. package/dist/Form/form-floating.svelte +44 -0
  188. package/dist/Form/form-floating.svelte.d.ts +38 -0
  189. package/dist/Form/form-helper-text.svelte +35 -0
  190. package/dist/Form/form-helper-text.svelte.d.ts +29 -0
  191. package/dist/Form/form-hidden-input.svelte +18 -0
  192. package/dist/Form/form-hidden-input.svelte.d.ts +16 -0
  193. package/dist/Form/form-image-input.svelte +30 -0
  194. package/dist/Form/form-image-input.svelte.d.ts +26 -0
  195. package/dist/Form/form-input-group-text.svelte +47 -0
  196. package/dist/Form/form-input-group-text.svelte.d.ts +42 -0
  197. package/dist/Form/form-input-group.svelte +52 -0
  198. package/dist/Form/form-input-group.svelte.d.ts +43 -0
  199. package/dist/Form/form-input-label.svelte +33 -0
  200. package/dist/Form/form-input-label.svelte.d.ts +28 -0
  201. package/dist/Form/form-month-input.svelte +63 -0
  202. package/dist/Form/form-month-input.svelte.d.ts +48 -0
  203. package/dist/Form/form-number-input.svelte +62 -0
  204. package/dist/Form/form-number-input.svelte.d.ts +47 -0
  205. package/dist/Form/form-password-input.svelte +60 -0
  206. package/dist/Form/form-password-input.svelte.d.ts +41 -0
  207. package/dist/Form/form-radio-input.svelte +47 -0
  208. package/dist/Form/form-radio-input.svelte.d.ts +41 -0
  209. package/dist/Form/form-radio-label.svelte +41 -0
  210. package/dist/Form/form-radio-label.svelte.d.ts +35 -0
  211. package/dist/Form/form-range-input.svelte +43 -0
  212. package/dist/Form/form-range-input.svelte.d.ts +39 -0
  213. package/dist/Form/form-search-input.svelte +63 -0
  214. package/dist/Form/form-search-input.svelte.d.ts +45 -0
  215. package/dist/Form/form-select.svelte +85 -0
  216. package/dist/Form/form-select.svelte.d.ts +59 -0
  217. package/dist/Form/form-switch-input.svelte +54 -0
  218. package/dist/Form/form-switch-input.svelte.d.ts +41 -0
  219. package/dist/Form/form-switch-label.svelte +25 -0
  220. package/dist/Form/form-switch-label.svelte.d.ts +19 -0
  221. package/dist/Form/form-telephone-input.svelte +129 -0
  222. package/dist/Form/form-telephone-input.svelte.d.ts +55 -0
  223. package/dist/Form/form-text-area.svelte +57 -0
  224. package/dist/Form/form-text-area.svelte.d.ts +38 -0
  225. package/dist/Form/form-text-input.svelte +55 -0
  226. package/dist/Form/form-text-input.svelte.d.ts +37 -0
  227. package/dist/Form/form-time-input.svelte +62 -0
  228. package/dist/Form/form-time-input.svelte.d.ts +47 -0
  229. package/dist/Form/form-url-input.svelte +60 -0
  230. package/dist/Form/form-url-input.svelte.d.ts +45 -0
  231. package/dist/Form/form-week-Input.svelte +62 -0
  232. package/dist/Form/form-week-Input.svelte.d.ts +47 -0
  233. package/dist/Form/form.svelte +37 -0
  234. package/dist/Form/form.svelte.d.ts +23 -0
  235. package/dist/Form/index.d.ts +1 -0
  236. package/dist/Form/index.js +1 -0
  237. package/dist/Form/types.d.ts +168 -0
  238. package/dist/Form/types.js +1 -0
  239. package/dist/ListGroup/composition.d.ts +4 -0
  240. package/dist/ListGroup/composition.js +3 -0
  241. package/dist/ListGroup/index.d.ts +1 -0
  242. package/dist/ListGroup/index.js +1 -0
  243. package/dist/ListGroup/list-group-item-action.svelte +50 -0
  244. package/dist/ListGroup/list-group-item-action.svelte.d.ts +23 -0
  245. package/dist/ListGroup/list-group-item.svelte +58 -0
  246. package/dist/ListGroup/list-group-item.svelte.d.ts +51 -0
  247. package/dist/ListGroup/list-group.svelte +83 -0
  248. package/dist/ListGroup/list-group.svelte.d.ts +68 -0
  249. package/dist/ListGroup/types.d.ts +20 -0
  250. package/dist/ListGroup/types.js +1 -0
  251. package/dist/Modal/composition.d.ts +8 -0
  252. package/dist/Modal/composition.js +7 -0
  253. package/dist/Modal/index.d.ts +1 -0
  254. package/dist/Modal/index.js +1 -0
  255. package/dist/Modal/modal-body.svelte +27 -0
  256. package/dist/Modal/modal-body.svelte.d.ts +19 -0
  257. package/dist/Modal/modal-content.svelte +35 -0
  258. package/dist/Modal/modal-content.svelte.d.ts +27 -0
  259. package/dist/Modal/modal-dialog.svelte +65 -0
  260. package/dist/Modal/modal-dialog.svelte.d.ts +52 -0
  261. package/dist/Modal/modal-footer.svelte +28 -0
  262. package/dist/Modal/modal-footer.svelte.d.ts +20 -0
  263. package/dist/Modal/modal-header.svelte +50 -0
  264. package/dist/Modal/modal-header.svelte.d.ts +29 -0
  265. package/dist/Modal/modal-title.svelte +45 -0
  266. package/dist/Modal/modal-title.svelte.d.ts +26 -0
  267. package/dist/Modal/modal.svelte +233 -0
  268. package/dist/Modal/modal.svelte.d.ts +52 -0
  269. package/dist/Modal/modal.svelte.js +86 -0
  270. package/dist/Modal/types.d.ts +31 -0
  271. package/dist/Modal/types.js +1 -0
  272. package/dist/Nav/composition.d.ts +4 -0
  273. package/dist/Nav/composition.js +3 -0
  274. package/dist/Nav/index.d.ts +1 -0
  275. package/dist/Nav/index.js +1 -0
  276. package/dist/Nav/nav-item.svelte +25 -0
  277. package/dist/Nav/nav-item.svelte.d.ts +18 -0
  278. package/dist/Nav/nav-link.svelte +77 -0
  279. package/dist/Nav/nav-link.svelte.d.ts +22 -0
  280. package/dist/Nav/nav.svelte +93 -0
  281. package/dist/Nav/nav.svelte.d.ts +56 -0
  282. package/dist/Nav/types.d.ts +26 -0
  283. package/dist/Nav/types.js +1 -0
  284. package/dist/Navbar/composition.d.ts +8 -0
  285. package/dist/Navbar/composition.js +7 -0
  286. package/dist/Navbar/index.d.ts +1 -0
  287. package/dist/Navbar/index.js +1 -0
  288. package/dist/Navbar/navbar-brand.svelte +55 -0
  289. package/dist/Navbar/navbar-brand.svelte.d.ts +48 -0
  290. package/dist/Navbar/navbar-collapse.svelte +76 -0
  291. package/dist/Navbar/navbar-collapse.svelte.d.ts +55 -0
  292. package/dist/Navbar/navbar-nav.svelte +66 -0
  293. package/dist/Navbar/navbar-nav.svelte.d.ts +53 -0
  294. package/dist/Navbar/navbar-text.svelte +36 -0
  295. package/dist/Navbar/navbar-text.svelte.d.ts +28 -0
  296. package/dist/Navbar/navbar-toggler-icon.svelte +34 -0
  297. package/dist/Navbar/navbar-toggler-icon.svelte.d.ts +28 -0
  298. package/dist/Navbar/navbar-toggler.svelte +75 -0
  299. package/dist/Navbar/navbar-toggler.svelte.d.ts +48 -0
  300. package/dist/Navbar/navbar.svelte +116 -0
  301. package/dist/Navbar/navbar.svelte.d.ts +88 -0
  302. package/dist/Navbar/types.d.ts +23 -0
  303. package/dist/Navbar/types.js +1 -0
  304. package/dist/Offcanvas/composition.d.ts +5 -0
  305. package/dist/Offcanvas/composition.js +4 -0
  306. package/dist/Offcanvas/index.d.ts +1 -0
  307. package/dist/Offcanvas/index.js +1 -0
  308. package/dist/Offcanvas/offcanvas-body.svelte +25 -0
  309. package/dist/Offcanvas/offcanvas-body.svelte.d.ts +19 -0
  310. package/dist/Offcanvas/offcanvas-header.svelte +39 -0
  311. package/dist/Offcanvas/offcanvas-header.svelte.d.ts +20 -0
  312. package/dist/Offcanvas/offcanvas-title.svelte +31 -0
  313. package/dist/Offcanvas/offcanvas-title.svelte.d.ts +25 -0
  314. package/dist/Offcanvas/offcanvas.svelte +220 -0
  315. package/dist/Offcanvas/offcanvas.svelte.d.ts +61 -0
  316. package/dist/Offcanvas/types.d.ts +25 -0
  317. package/dist/Offcanvas/types.js +1 -0
  318. package/dist/Pagination/composition.d.ts +4 -0
  319. package/dist/Pagination/composition.js +3 -0
  320. package/dist/Pagination/index.d.ts +1 -0
  321. package/dist/Pagination/index.js +1 -0
  322. package/dist/Pagination/pagination-item.svelte +81 -0
  323. package/dist/Pagination/pagination-item.svelte.d.ts +35 -0
  324. package/dist/Pagination/pagination-link.svelte +45 -0
  325. package/dist/Pagination/pagination-link.svelte.d.ts +25 -0
  326. package/dist/Pagination/pagination.svelte +60 -0
  327. package/dist/Pagination/pagination.svelte.d.ts +37 -0
  328. package/dist/Pagination/pagination.svelte.js +117 -0
  329. package/dist/Pagination/types.d.ts +19 -0
  330. package/dist/Pagination/types.js +1 -0
  331. package/dist/Placeholder/composition.d.ts +3 -0
  332. package/dist/Placeholder/composition.js +2 -0
  333. package/dist/Placeholder/index.d.ts +1 -0
  334. package/dist/Placeholder/index.js +1 -0
  335. package/dist/Placeholder/placeholder-item.svelte +53 -0
  336. package/dist/Placeholder/placeholder-item.svelte.d.ts +48 -0
  337. package/dist/Placeholder/placeholder.svelte +37 -0
  338. package/dist/Placeholder/placeholder.svelte.d.ts +32 -0
  339. package/dist/Placeholder/types.d.ts +12 -0
  340. package/dist/Placeholder/types.js +1 -0
  341. package/dist/Popover/composition.d.ts +4 -0
  342. package/dist/Popover/composition.js +3 -0
  343. package/dist/Popover/index.d.ts +1 -0
  344. package/dist/Popover/index.js +1 -0
  345. package/dist/Popover/popover-body.svelte +10 -0
  346. package/dist/Popover/popover-body.svelte.d.ts +3 -0
  347. package/dist/Popover/popover-header.svelte +11 -0
  348. package/dist/Popover/popover-header.svelte.d.ts +4 -0
  349. package/dist/Popover/popover.svelte +74 -0
  350. package/dist/Popover/popover.svelte.d.ts +53 -0
  351. package/dist/Popover/types.d.ts +20 -0
  352. package/dist/Popover/types.js +1 -0
  353. package/dist/Portal/index.d.ts +2 -0
  354. package/dist/Portal/index.js +2 -0
  355. package/dist/Portal/portal-host.svelte +5 -0
  356. package/dist/Portal/portal-host.svelte.d.ts +7 -0
  357. package/dist/Portal/portal.svelte +69 -0
  358. package/dist/Portal/portal.svelte.d.ts +32 -0
  359. package/dist/Portal/types.d.ts +6 -0
  360. package/dist/Portal/types.js +1 -0
  361. package/dist/Progress/index.d.ts +3 -0
  362. package/dist/Progress/index.js +3 -0
  363. package/dist/Progress/progress-bar.svelte +101 -0
  364. package/dist/Progress/progress-bar.svelte.d.ts +39 -0
  365. package/dist/Progress/progress-stacked.svelte +34 -0
  366. package/dist/Progress/progress-stacked.svelte.d.ts +24 -0
  367. package/dist/Progress/progress.svelte.d.ts +31 -0
  368. package/dist/Progress/progress.svelte.js +52 -0
  369. package/dist/Progress/types.d.ts +40 -0
  370. package/dist/Progress/types.js +1 -0
  371. package/dist/Row/index.d.ts +2 -0
  372. package/dist/Row/index.js +2 -0
  373. package/dist/Row/row.svelte +75 -0
  374. package/dist/Row/row.svelte.d.ts +46 -0
  375. package/dist/Row/types.d.ts +12 -0
  376. package/dist/Row/types.js +1 -0
  377. package/dist/Scrollspy/index.d.ts +2 -0
  378. package/dist/Scrollspy/index.js +2 -0
  379. package/dist/Scrollspy/scrollspy-attachment.svelte.d.ts +10 -0
  380. package/dist/Scrollspy/scrollspy-attachment.svelte.js +122 -0
  381. package/dist/Scrollspy/types.d.ts +9 -0
  382. package/dist/Scrollspy/types.js +1 -0
  383. package/dist/Spinner/index.d.ts +2 -0
  384. package/dist/Spinner/index.js +2 -0
  385. package/dist/Spinner/spinner.svelte +77 -0
  386. package/dist/Spinner/spinner.svelte.d.ts +70 -0
  387. package/dist/Spinner/types.d.ts +9 -0
  388. package/dist/Spinner/types.js +1 -0
  389. package/dist/Tab/composition.d.ts +5 -0
  390. package/dist/Tab/composition.js +4 -0
  391. package/dist/Tab/index.d.ts +1 -0
  392. package/dist/Tab/index.js +1 -0
  393. package/dist/Tab/tab-content.svelte +29 -0
  394. package/dist/Tab/tab-content.svelte.d.ts +23 -0
  395. package/dist/Tab/tab-nav-link.svelte +69 -0
  396. package/dist/Tab/tab-nav-link.svelte.d.ts +22 -0
  397. package/dist/Tab/tab-pane.svelte +72 -0
  398. package/dist/Tab/tab-pane.svelte.d.ts +26 -0
  399. package/dist/Tab/tab.svelte +63 -0
  400. package/dist/Tab/tab.svelte.d.ts +50 -0
  401. package/dist/Tab/types.d.ts +18 -0
  402. package/dist/Tab/types.js +1 -0
  403. package/dist/Table/composition.d.ts +9 -0
  404. package/dist/Table/composition.js +8 -0
  405. package/dist/Table/index.d.ts +1 -0
  406. package/dist/Table/index.js +1 -0
  407. package/dist/Table/table-body.svelte +30 -0
  408. package/dist/Table/table-body.svelte.d.ts +23 -0
  409. package/dist/Table/table-caption.svelte +20 -0
  410. package/dist/Table/table-caption.svelte.d.ts +15 -0
  411. package/dist/Table/table-data.svelte +30 -0
  412. package/dist/Table/table-data.svelte.d.ts +19 -0
  413. package/dist/Table/table-foot.svelte +31 -0
  414. package/dist/Table/table-foot.svelte.d.ts +24 -0
  415. package/dist/Table/table-head.svelte +31 -0
  416. package/dist/Table/table-head.svelte.d.ts +24 -0
  417. package/dist/Table/table-header.svelte +38 -0
  418. package/dist/Table/table-header.svelte.d.ts +17 -0
  419. package/dist/Table/table-row.svelte +34 -0
  420. package/dist/Table/table-row.svelte.d.ts +23 -0
  421. package/dist/Table/table.svelte +154 -0
  422. package/dist/Table/table.svelte.d.ts +98 -0
  423. package/dist/Table/table.svelte.js +92 -0
  424. package/dist/Table/types.d.ts +43 -0
  425. package/dist/Table/types.js +1 -0
  426. package/dist/Toast/composition.d.ts +5 -0
  427. package/dist/Toast/composition.js +4 -0
  428. package/dist/Toast/index.d.ts +1 -0
  429. package/dist/Toast/index.js +1 -0
  430. package/dist/Toast/toast-body.svelte +26 -0
  431. package/dist/Toast/toast-body.svelte.d.ts +18 -0
  432. package/dist/Toast/toast-container.svelte +44 -0
  433. package/dist/Toast/toast-container.svelte.d.ts +36 -0
  434. package/dist/Toast/toast-header.svelte +56 -0
  435. package/dist/Toast/toast-header.svelte.d.ts +36 -0
  436. package/dist/Toast/toast.svelte +112 -0
  437. package/dist/Toast/toast.svelte.d.ts +54 -0
  438. package/dist/Toast/toast.svelte.js +83 -0
  439. package/dist/Toast/types.d.ts +53 -0
  440. package/dist/Toast/types.js +19 -0
  441. package/dist/Tooltip/composition.d.ts +3 -0
  442. package/dist/Tooltip/composition.js +2 -0
  443. package/dist/Tooltip/index.d.ts +1 -0
  444. package/dist/Tooltip/index.js +1 -0
  445. package/dist/Tooltip/tooltip-inner.svelte +10 -0
  446. package/dist/Tooltip/tooltip-inner.svelte.d.ts +4 -0
  447. package/dist/Tooltip/tooltip.svelte +213 -0
  448. package/dist/Tooltip/tooltip.svelte.d.ts +54 -0
  449. package/dist/Tooltip/types.d.ts +43 -0
  450. package/dist/Tooltip/types.js +1 -0
  451. package/dist/common/context.d.ts +47 -0
  452. package/dist/common/context.js +70 -0
  453. package/dist/common/css.d.ts +71 -0
  454. package/dist/common/css.js +133 -0
  455. package/dist/common/dom.d.ts +51 -0
  456. package/dist/common/dom.js +98 -0
  457. package/dist/common/index.d.ts +6 -0
  458. package/dist/common/index.js +5 -0
  459. package/dist/common/nav-tab.svelte.d.ts +88 -0
  460. package/dist/common/nav-tab.svelte.js +188 -0
  461. package/dist/common/navbar-offcanvas.svelte.d.ts +101 -0
  462. package/dist/common/navbar-offcanvas.svelte.js +228 -0
  463. package/dist/common/noop.d.ts +4 -0
  464. package/dist/common/noop.js +4 -0
  465. package/dist/common/scrollbar.d.ts +20 -0
  466. package/dist/common/scrollbar.js +53 -0
  467. package/dist/common/types.d.ts +143 -0
  468. package/dist/common/types.js +40 -0
  469. package/dist/index.d.ts +33 -0
  470. package/dist/index.js +33 -0
  471. package/package.json +105 -0
@@ -0,0 +1,551 @@
1
+ import { Context } from '../common/index.js';
2
+ import { tick } from 'svelte';
3
+ /**
4
+ * Manages the state for the Carousel root component.
5
+ * Handles the tracking of active slide, autoplay behavior, and transition control.
6
+ */
7
+ export class CarouselRootState {
8
+ props;
9
+ // Public static constants...
10
+ static ANIMATION_DEFAULT = 'none';
11
+ static INTERNAL_DEFAULT = 5000;
12
+ static PAUSE_DEFAULT = 'hover';
13
+ static RIDE_DEFAULT = false;
14
+ static TRANSITION_DURATION_DEFAULT = 600;
15
+ // Private state properties...
16
+ #activeItemIndex = $state(0); // Zero-based index for active item
17
+ #animation = $state(CarouselRootState.ANIMATION_DEFAULT);
18
+ #hasUserInteraction = $state(false); // Used to delay autoplay until user interacts when ride=true
19
+ #indicators = [];
20
+ #interval = $state(0);
21
+ #timeoutId = $state(null);
22
+ #isAnimating = $state(false);
23
+ #isHovered = $state(false);
24
+ #isPaused = $state(true);
25
+ #isPointerDown = $state(false);
26
+ #items = [];
27
+ #nextActiveItemIndex = $state(-1); // Tracks the index of the slide that will become active (-1 when no transition is pending)
28
+ #pauseInteraction = $state(CarouselRootState.PAUSE_DEFAULT);
29
+ #pointerStartX = $state(0);
30
+ #ride = $state(false);
31
+ #transitionDuration = $state(CarouselRootState.TRANSITION_DURATION_DEFAULT);
32
+ #visibilityListener = null;
33
+ // Public readonly properties...
34
+ isSlideAnimation = $derived.by(() => this.animation === 'slide');
35
+ isFadeAnimation = $derived.by(() => this.animation === 'fade');
36
+ isCrossfadeAnimation = $derived.by(() => this.animation === 'crossfade');
37
+ isNoneAnimation = $derived.by(() => this.animation === 'none');
38
+ constructor(props) {
39
+ this.props = props;
40
+ this.#animation = this.props.animation || CarouselRootState.ANIMATION_DEFAULT;
41
+ this.#interval = this.props.interval || CarouselRootState.INTERNAL_DEFAULT;
42
+ this.#pauseInteraction = this.props.pause !== undefined ? this.props.pause : CarouselRootState.PAUSE_DEFAULT;
43
+ this.#ride = this.props.ride || CarouselRootState.RIDE_DEFAULT;
44
+ this.#transitionDuration = this.props.transitionDuration || CarouselRootState.TRANSITION_DURATION_DEFAULT;
45
+ this.registerItem = this.registerItem.bind(this);
46
+ this.isItemActive = this.isItemActive.bind(this);
47
+ this.next = this.next.bind(this);
48
+ this.prev = this.prev.bind(this);
49
+ this.pause = this.pause.bind(this);
50
+ this.cycle = this.cycle.bind(this);
51
+ this.to = this.to.bind(this);
52
+ this.handleMouseEnter = this.handleMouseEnter.bind(this);
53
+ this.handleMouseLeave = this.handleMouseLeave.bind(this);
54
+ this.handlePointerDown = this.handlePointerDown.bind(this);
55
+ this.handlePointerMove = this.handlePointerMove.bind(this);
56
+ this.handlePointerUp = this.handlePointerUp.bind(this);
57
+ // Setup Page Visibility API listener
58
+ if (typeof document !== 'undefined' && 'hidden' in document) {
59
+ this.#visibilityListener = () => {
60
+ if (document.hidden) {
61
+ this.pause();
62
+ }
63
+ else if (this.shouldCycle() && !this.#isHovered) {
64
+ this.cycle();
65
+ }
66
+ };
67
+ document.addEventListener('visibilitychange', this.#visibilityListener);
68
+ }
69
+ // Start autoplay immediately if ride='carousel', otherwise wait for user interaction
70
+ if (this.#ride === 'carousel' && !this.#timeoutId) {
71
+ this.cycle();
72
+ }
73
+ }
74
+ // Determines the appropriate interval duration, prioritizing the active item's specific interval
75
+ getCurrentItemInterval() {
76
+ if (this.#items.length === 0) {
77
+ return this.#interval;
78
+ }
79
+ const activeItem = this.#items[this.#activeItemIndex];
80
+ if (activeItem && activeItem.interval) {
81
+ return activeItem.interval;
82
+ }
83
+ return this.#interval;
84
+ }
85
+ // Determines if the carousel should auto-cycle based on configuration and user interaction state
86
+ shouldCycle() {
87
+ return this.#ride === 'carousel' || (this.#ride === true && this.#hasUserInteraction);
88
+ }
89
+ get animation() {
90
+ return this.#animation;
91
+ }
92
+ set animation(animation) {
93
+ this.#animation = animation;
94
+ }
95
+ get pauseInteraction() {
96
+ return this.#pauseInteraction;
97
+ }
98
+ set pauseInteraction(value) {
99
+ this.#pauseInteraction = value;
100
+ }
101
+ get interval() {
102
+ return this.#interval;
103
+ }
104
+ set interval(interval) {
105
+ this.#interval = interval;
106
+ if (this.shouldCycle()) {
107
+ this.cycle();
108
+ }
109
+ }
110
+ get ride() {
111
+ return this.#ride;
112
+ }
113
+ set ride(ride) {
114
+ this.#ride = ride;
115
+ if (this.shouldCycle()) {
116
+ this.cycle();
117
+ }
118
+ else {
119
+ this.pause();
120
+ }
121
+ }
122
+ get transitionDuration() {
123
+ return this.#transitionDuration;
124
+ }
125
+ set transitionDuration(duration) {
126
+ this.#transitionDuration = duration;
127
+ }
128
+ get isAnimating() {
129
+ return this.#isAnimating;
130
+ }
131
+ registerItem(item) {
132
+ this.#items.push(item);
133
+ // Activate the first item by default if none is active
134
+ if (item.props.isActive && !this.#isAnimating) {
135
+ this.#activeItemIndex = item.index;
136
+ }
137
+ }
138
+ registerIndicator(indicator) {
139
+ this.#indicators.push(indicator);
140
+ }
141
+ isItemActive(index) {
142
+ return this.#activeItemIndex === index;
143
+ }
144
+ getActiveIndex() {
145
+ return this.#activeItemIndex;
146
+ }
147
+ isNextItemActive(index) {
148
+ return this.#nextActiveItemIndex === index;
149
+ }
150
+ getNextActiveIndex() {
151
+ return this.#nextActiveItemIndex;
152
+ }
153
+ getItemCount() {
154
+ return this.#items.length;
155
+ }
156
+ getIndicatorCount() {
157
+ return this.#indicators.length;
158
+ }
159
+ next() {
160
+ if (this.#isAnimating) {
161
+ return;
162
+ }
163
+ const nextIndex = (this.#activeItemIndex + 1) % this.#items.length;
164
+ this.to(nextIndex, 'next');
165
+ // Mark that user interaction has occurred
166
+ this.#hasUserInteraction = true;
167
+ // Start cycling if ride is true and this is first interaction
168
+ if (this.#ride === true && !this.#timeoutId) {
169
+ this.cycle();
170
+ }
171
+ }
172
+ prev() {
173
+ if (this.#isAnimating) {
174
+ return;
175
+ }
176
+ const prevIndex = (this.#activeItemIndex - 1 + this.#items.length) % this.#items.length;
177
+ this.to(prevIndex, 'prev');
178
+ // Mark that user interaction has occurred
179
+ this.#hasUserInteraction = true;
180
+ // Start cycling if ride is true and this is first interaction
181
+ if (this.#ride === true && !this.#timeoutId) {
182
+ this.cycle();
183
+ }
184
+ }
185
+ /**
186
+ * Navigates to the slide at the specified index with the given transition direction.
187
+ * Handles animation states and timing for different animation types.
188
+ */
189
+ to(index, transitionDirection) {
190
+ if (index === this.#activeItemIndex || this.#isAnimating) {
191
+ console.warn(`[Carousel] Already on item ${this.#activeItemIndex}, ignoring to(${index})`);
192
+ return;
193
+ }
194
+ if (this.#animation !== 'slide' && this.#animation !== 'fade' && this.#animation !== 'crossfade' && this.#animation !== 'none') {
195
+ console.warn(`[Carousel] Unsupported animation type: ${this.#animation}`);
196
+ return;
197
+ }
198
+ const isNext = transitionDirection === 'next';
199
+ const isPrev = transitionDirection === 'prev';
200
+ const toItem = this.#items[index];
201
+ const fromItem = this.#items[this.#activeItemIndex];
202
+ if (toItem === fromItem) {
203
+ console.warn(`[Carousel] Attempting to transition to the same item ${index}, ignoring.`);
204
+ return;
205
+ }
206
+ if (!toItem) {
207
+ console.warn(`[Carousel] Item ${index} does not exist, ignoring transition.`);
208
+ return;
209
+ }
210
+ if (!fromItem) {
211
+ console.warn(`[Carousel] Active item ${this.#activeItemIndex} does not exist, ignoring transition.`);
212
+ return;
213
+ }
214
+ this.#isAnimating = true;
215
+ this.#nextActiveItemIndex = index;
216
+ // For slide and crossfade animations, we set directional classes and clean up after transition
217
+ if (this.#animation === 'slide' || this.#animation === 'crossfade') {
218
+ if (isNext) {
219
+ fromItem.direction = 'start';
220
+ toItem.direction = 'start';
221
+ toItem.order = 'next';
222
+ }
223
+ if (isPrev) {
224
+ fromItem.direction = 'end';
225
+ toItem.direction = 'end';
226
+ toItem.order = 'prev';
227
+ }
228
+ setTimeout(() => {
229
+ fromItem.order = undefined;
230
+ fromItem.direction = undefined;
231
+ toItem.order = undefined;
232
+ toItem.direction = undefined;
233
+ this.#activeItemIndex = index;
234
+ this.#nextActiveItemIndex = -1;
235
+ this.#isAnimating = false;
236
+ // Restart cycle with new slide's interval if cycling
237
+ if (this.shouldCycle() && !this.#isPaused) {
238
+ this.cycle();
239
+ }
240
+ }, this.#transitionDuration);
241
+ }
242
+ // For fade animation, we immediately change the active index but clean up classes after transition
243
+ if (this.#animation === 'fade') {
244
+ if (isNext) {
245
+ toItem.order = 'next';
246
+ }
247
+ if (isPrev) {
248
+ toItem.order = 'prev';
249
+ }
250
+ setTimeout(() => {
251
+ toItem.order = undefined;
252
+ this.#isAnimating = false;
253
+ }, this.#transitionDuration / 2);
254
+ this.#activeItemIndex = index;
255
+ this.#nextActiveItemIndex = -1;
256
+ // Restart cycle with new slide's interval if cycling
257
+ if (this.shouldCycle() && !this.#isPaused) {
258
+ this.cycle();
259
+ }
260
+ }
261
+ // For no animation, we simply update the active index on the next tick
262
+ if (this.#animation === 'none') {
263
+ tick().then(() => {
264
+ this.#activeItemIndex = index;
265
+ this.#nextActiveItemIndex = -1;
266
+ this.#isAnimating = false;
267
+ // Restart cycle with new slide's interval if cycling
268
+ if (this.shouldCycle() && !this.#isPaused) {
269
+ this.cycle();
270
+ }
271
+ });
272
+ }
273
+ }
274
+ /**
275
+ * Starts or restarts the autoplay cycle with the appropriate interval.
276
+ * Uses the active slide's specific interval if available.
277
+ */
278
+ cycle() {
279
+ if (typeof window === 'undefined') {
280
+ console.warn('[Carousel] Cycle called in non-browser environment, ignoring.');
281
+ return;
282
+ }
283
+ // Don't start cycling if we're hovered and pause='hover'
284
+ if (this.#pauseInteraction === 'hover' && this.#isHovered) {
285
+ return;
286
+ }
287
+ // Don't start cycling if the document is hidden
288
+ if (typeof document !== 'undefined' && 'hidden' in document && document.hidden) {
289
+ return;
290
+ }
291
+ // Clear any existing timeout
292
+ this.pause();
293
+ this.#isPaused = false;
294
+ // Use the current active slide's interval or the default
295
+ const currentInterval = this.getCurrentItemInterval();
296
+ // Schedule the next slide using setTimeout
297
+ this.#timeoutId = window.setTimeout(() => {
298
+ if (!this.#isPaused && !this.#isAnimating) {
299
+ this.next();
300
+ }
301
+ else if (!this.#isPaused) {
302
+ // If we're animating, try again after a short delay
303
+ this.cycle();
304
+ }
305
+ }, currentInterval);
306
+ }
307
+ pause() {
308
+ if (typeof window === 'undefined') {
309
+ console.warn('[Carousel] Pause called in non-browser environment, ignoring.');
310
+ return;
311
+ }
312
+ if (this.#timeoutId) {
313
+ window.clearTimeout(this.#timeoutId);
314
+ this.#timeoutId = null;
315
+ }
316
+ this.#isPaused = true;
317
+ }
318
+ handleMouseEnter() {
319
+ this.#isHovered = true;
320
+ if (this.#pauseInteraction === 'hover' && this.shouldCycle()) {
321
+ this.pause();
322
+ }
323
+ }
324
+ handleMouseLeave() {
325
+ this.#isHovered = false;
326
+ if (this.shouldCycle() && this.#pauseInteraction === 'hover') {
327
+ this.cycle();
328
+ }
329
+ }
330
+ handlePointerDown(pointerEvent) {
331
+ // Only track primary touch pointer
332
+ if (pointerEvent.pointerType === 'touch' && pointerEvent.isPrimary) {
333
+ this.#isPointerDown = true;
334
+ this.#pointerStartX = pointerEvent.clientX;
335
+ // Pause autoplay during touch interaction
336
+ if (this.shouldCycle()) {
337
+ this.pause();
338
+ }
339
+ // Mark that user interaction has occurred
340
+ this.#hasUserInteraction = true;
341
+ }
342
+ }
343
+ handlePointerMove(pointerEvent) {
344
+ // Skip if not tracking a touch
345
+ if (!this.#isPointerDown || pointerEvent.pointerType !== 'touch' || !pointerEvent.isPrimary) {
346
+ return;
347
+ }
348
+ // No need to do anything here, just track in pointerup
349
+ }
350
+ /**
351
+ * Handles touch swipe gestures for mobile carousel navigation.
352
+ * Determines swipe direction based on horizontal movement distance.
353
+ */
354
+ handlePointerUp(pointerEvent) {
355
+ if (!this.#isPointerDown || pointerEvent.pointerType !== 'touch' || !pointerEvent.isPrimary) {
356
+ return;
357
+ }
358
+ const deltaX = pointerEvent.clientX - this.#pointerStartX;
359
+ // Consider it a swipe if movement exceeds threshold (50px)
360
+ if (Math.abs(deltaX) > 50) {
361
+ if (deltaX > 0) {
362
+ this.prev(); // Swipe right means go to previous
363
+ }
364
+ else {
365
+ this.next(); // Swipe left means go to next
366
+ }
367
+ }
368
+ this.#isPointerDown = false;
369
+ // Resume cycling after touch with a delay to prevent immediate transition
370
+ if (this.shouldCycle()) {
371
+ setTimeout(() => {
372
+ this.cycle();
373
+ }, 1000);
374
+ }
375
+ }
376
+ dispose() {
377
+ if (this.#timeoutId) {
378
+ window.clearTimeout(this.#timeoutId);
379
+ this.#timeoutId = null;
380
+ }
381
+ // Remove visibility change listener
382
+ if (typeof document !== 'undefined' && this.#visibilityListener) {
383
+ document.removeEventListener('visibilitychange', this.#visibilityListener);
384
+ this.#visibilityListener = null;
385
+ }
386
+ }
387
+ }
388
+ /**
389
+ * Manages the state for an individual Carousel item.
390
+ * Tracks active state and provides methods to handle transitions.
391
+ */
392
+ export class CarouselItemState {
393
+ props;
394
+ root;
395
+ #order = $state(undefined);
396
+ #direction = $state(undefined);
397
+ index;
398
+ interval;
399
+ isActive = $derived.by(() => this.root.isItemActive(this.index));
400
+ isNext = $derived(this.#order === 'next');
401
+ isPrev = $derived(this.#order === 'prev');
402
+ // Used to determine whether this item should be in the DOM (active or transitioning)
403
+ isActiveOrWillBeActive = $derived.by(() => this.isActive || this.isNext || this.isPrev);
404
+ isEnd = $derived(this.#direction === 'end');
405
+ isStart = $derived(this.#direction === 'start');
406
+ isSlideAnimation = $derived.by(() => this.root.animation === 'slide');
407
+ isFadeAnimation = $derived.by(() => this.root.animation === 'fade');
408
+ isCrossfadeAnimation = $derived.by(() => this.root.animation === 'crossfade');
409
+ isNoneAnimation = $derived.by(() => this.root.animation === 'none');
410
+ // These derived values determine which animation classes/behavior to apply
411
+ doSlideItem = $derived.by(() => this.isSlideAnimation && this.isActiveOrWillBeActive);
412
+ doFadeItem = $derived.by(() => this.isFadeAnimation && this.isActiveOrWillBeActive);
413
+ doCrossfadeItem = $derived.by(() => this.isCrossfadeAnimation && this.isActiveOrWillBeActive);
414
+ doShowImmediatelyItem = $derived.by(() => this.isNoneAnimation && this.isActiveOrWillBeActive);
415
+ constructor(props, root) {
416
+ this.props = props;
417
+ this.root = root;
418
+ this.index = this.root.getItemCount();
419
+ this.interval = this.props.interval || 5000;
420
+ }
421
+ get order() {
422
+ return this.#order;
423
+ }
424
+ set order(order) {
425
+ this.#order = order;
426
+ }
427
+ get direction() {
428
+ return this.#direction;
429
+ }
430
+ set direction(direction) {
431
+ this.#direction = direction;
432
+ }
433
+ }
434
+ /**
435
+ * Manages the state for Carousel controls.
436
+ * Handles previous actions and target identification.
437
+ */
438
+ export class CarouselControlPrevState {
439
+ props;
440
+ root;
441
+ constructor(props, root) {
442
+ this.props = props;
443
+ this.root = root;
444
+ this.onclick = this.onclick.bind(this);
445
+ }
446
+ onclick(event) {
447
+ event.preventDefault();
448
+ this.root.prev();
449
+ }
450
+ }
451
+ /**
452
+ * Manages the state for Carousel controls.
453
+ * Handles next actions and target identification.
454
+ */
455
+ export class CarouselControlNextState {
456
+ props;
457
+ root;
458
+ constructor(props, root) {
459
+ this.props = props;
460
+ this.root = root;
461
+ this.onclick = this.onclick.bind(this);
462
+ }
463
+ onclick(event) {
464
+ event.preventDefault();
465
+ this.root.next();
466
+ }
467
+ }
468
+ /**
469
+ * Manages the state for Carousel indicator buttons.
470
+ * Tracks active state and provides methods to handle clicks.
471
+ */
472
+ export class CarouselIndicatorButtonState {
473
+ props;
474
+ root;
475
+ isActive = $derived.by(() => this.root.isItemActive(this.index) && !this.root.isAnimating);
476
+ isNextActive = $derived.by(() => this.root.isNextItemActive(this.index));
477
+ index;
478
+ constructor(props, root) {
479
+ this.props = props;
480
+ this.root = root;
481
+ this.index = this.root.getIndicatorCount();
482
+ this.onclick = this.onclick.bind(this);
483
+ }
484
+ onclick(event) {
485
+ event.preventDefault();
486
+ const order = this.index > this.root.getActiveIndex() ? 'next' : 'prev';
487
+ this.root.to(this.index, order);
488
+ }
489
+ }
490
+ const CarouselRootContext = new Context('carousel-root');
491
+ /**
492
+ * Creates and initializes the Carousel root state.
493
+ * This function is used to set up the context for the Carousel component.
494
+ * @param props - The props for the Carousel root component.
495
+ * @returns The created CarouselRootState instance.
496
+ */
497
+ export function initCarouselRootState(props) {
498
+ const rootState = new CarouselRootState(props);
499
+ return CarouselRootContext.set(rootState);
500
+ }
501
+ /**
502
+ * Creates and initializes the Carousel item state.
503
+ * This function is used to set up the state for a Carousel item.
504
+ * @param props - The props for the Carousel item.
505
+ * @param index - The index of the item in the carousel.
506
+ * @returns The created CarouselItemState instance.
507
+ */
508
+ export function initCarouselItemState(props) {
509
+ if (!CarouselRootContext.exists()) {
510
+ throw new Error('Carousel.Item requires Carousel.Root context. Please ensure Carousel.Root is initialized before Carousel.Item.');
511
+ }
512
+ const rootState = CarouselRootContext.get();
513
+ const itemState = new CarouselItemState(props, rootState);
514
+ rootState.registerItem(itemState);
515
+ return itemState;
516
+ }
517
+ /**
518
+ * Creates and initializes the Carousel control state.
519
+ * This function is used to set up the state for a Carousel control button.
520
+ * @param props - The props for the Carousel control.
521
+ * @returns The created CarouselControlState instance.
522
+ */
523
+ export function initCarouselControlPrevState(props) {
524
+ if (!CarouselRootContext.exists()) {
525
+ throw new Error('Carousel.Control requires Carousel.Root context. Please ensure Carousel.Root is initialized before Carousel.Control.');
526
+ }
527
+ const rootState = CarouselRootContext.get();
528
+ return new CarouselControlPrevState(props, rootState);
529
+ }
530
+ export function initCarouselControlNextState(props) {
531
+ if (!CarouselRootContext.exists()) {
532
+ throw new Error('Carousel.Control requires Carousel.Root context. Please ensure Carousel.Root is initialized before Carousel.Control.');
533
+ }
534
+ const rootState = CarouselRootContext.get();
535
+ return new CarouselControlNextState(props, rootState);
536
+ }
537
+ /**
538
+ * Creates and initializes the Carousel indicator button state.
539
+ * This function is used to set up the state for a Carousel indicator button.
540
+ * @param props - The props for the Carousel indicator button.
541
+ * @returns The created CarouselIndicatorButtonState instance.
542
+ */
543
+ export function initCarouselIndicatorButtonState(props) {
544
+ if (!CarouselRootContext.exists()) {
545
+ throw new Error('Carousel.IndicatorButton requires Carousel.Root context. Please ensure Carousel.Root is initialized before Carousel.IndicatorButton.');
546
+ }
547
+ const rootState = CarouselRootContext.get();
548
+ const indicatorState = new CarouselIndicatorButtonState(props, rootState);
549
+ rootState.registerIndicator(indicatorState);
550
+ return indicatorState;
551
+ }
@@ -0,0 +1,9 @@
1
+ export { default as Caption } from './carousel-caption.svelte';
2
+ export { default as ControlNext } from './carousel-control-next.svelte';
3
+ export { default as ControlPrev } from './carousel-control-prev.svelte';
4
+ export { default as IndicatorButton } from './carousel-indicator-button.svelte';
5
+ export { default as Indicators } from './carousel-indicators.svelte';
6
+ export { default as Inner } from './carousel-inner.svelte';
7
+ export { default as Item } from './carousel-item.svelte';
8
+ export { default as Root } from './carousel.svelte';
9
+ export type { CarouselCaptionProps as CaptionProps, CarouselControlProps as ControlProps, CarouselIndicatorButtonProps as IndicatorButtonProps, CarouselIndicatorsProps as IndicatorsProps, CarouselInnerProps as InnerProps, CarouselItemProps as ItemProps, CarouselRootProps as RootProps } from './types.js';
@@ -0,0 +1,8 @@
1
+ export { default as Caption } from './carousel-caption.svelte';
2
+ export { default as ControlNext } from './carousel-control-next.svelte';
3
+ export { default as ControlPrev } from './carousel-control-prev.svelte';
4
+ export { default as IndicatorButton } from './carousel-indicator-button.svelte';
5
+ export { default as Indicators } from './carousel-indicators.svelte';
6
+ export { default as Inner } from './carousel-inner.svelte';
7
+ export { default as Item } from './carousel-item.svelte';
8
+ export { default as Root } from './carousel.svelte';
@@ -0,0 +1 @@
1
+ export * as Carousel from './composition.js';
@@ -0,0 +1 @@
1
+ export * as Carousel from './composition.js';
@@ -0,0 +1,74 @@
1
+ import type { ButtonElement, DivElement } from '../common/types.js';
2
+ /**
3
+ * Controls the transition effect between carousel items
4
+ * - 'none': No animation (immediate change)
5
+ * - 'slide': Standard horizontal sliding transition
6
+ * - 'fade': Opacity transition without horizontal movement
7
+ * - 'crossfade': Cross-dissolve between slides
8
+ */
9
+ export type CarouselAnimation = 'none' | 'slide' | 'fade' | 'crossfade';
10
+ /**
11
+ * Denotes the relative position of a carousel item during transitions
12
+ */
13
+ export type CarouselItemOrder = 'next' | 'prev';
14
+ /**
15
+ * Specifies the direction of movement for carousel transitions
16
+ * - 'start': Move toward the start (right-to-left in LTR, left-to-right in RTL)
17
+ * - 'end': Move toward the end (left-to-right in LTR, right-to-left in RTL)
18
+ */
19
+ export type CarouselItemDirection = 'start' | 'end';
20
+ /**
21
+ * Controls auto-cycling behavior
22
+ * - true: Enable auto-cycling with default settings
23
+ * - false: Disable auto-cycling
24
+ * - 'carousel': Enable auto-cycling with Bootstrap's standard behavior
25
+ */
26
+ export type CarouselRide = boolean | 'carousel';
27
+ /**
28
+ * Determines what pauses the carousel's cycling
29
+ * - 'hover': Pause when mouse hovers over carousel
30
+ * - false: Don't pause on hover
31
+ */
32
+ export type CarouselPause = 'hover' | false;
33
+ /**
34
+ * Root carousel container properties
35
+ * Controls overall carousel behavior including animation type and timing
36
+ */
37
+ export type CarouselRootProps = DivElement & {
38
+ animation?: CarouselAnimation;
39
+ interval?: number;
40
+ pause?: CarouselPause;
41
+ ride?: CarouselRide;
42
+ transitionDuration?: number;
43
+ };
44
+ /**
45
+ * Container for carousel items that manages the sliding surface
46
+ */
47
+ export type CarouselInnerProps = DivElement;
48
+ /**
49
+ * Individual carousel slide properties
50
+ */
51
+ export type CarouselItemProps = DivElement & {
52
+ isActive?: boolean;
53
+ interval?: number;
54
+ onSlide?: EventListener;
55
+ onSlid?: EventListener;
56
+ };
57
+ /**
58
+ * Container for optional caption text within carousel items
59
+ */
60
+ export type CarouselCaptionProps = DivElement;
61
+ /**
62
+ * Container for the indicator dots/buttons showing current position
63
+ */
64
+ export type CarouselIndicatorsProps = DivElement;
65
+ /**
66
+ * Individual indicator button properties
67
+ */
68
+ export type CarouselIndicatorButtonProps = ButtonElement & {
69
+ ariaLabel?: string;
70
+ };
71
+ /**
72
+ * Properties for previous/next navigation controls
73
+ */
74
+ export type CarouselControlProps = ButtonElement;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,32 @@
1
+ <!--
2
+ @component
3
+ ## CloseButton
4
+ A button component that provides a standardized close button functionality.
5
+ Typically used in alerts, modals, and other dismissible components.
6
+
7
+ @example
8
+ ```svelte
9
+ <CloseButton />
10
+ ```
11
+
12
+ #### Basic close button
13
+ ```svelte
14
+ <CloseButton />
15
+ ```
16
+
17
+ #### Disabled state
18
+ ```svelte
19
+ <CloseButton disabled={true} />
20
+ ```
21
+ ### Props
22
+ - `ariaLabel` (string): Optional. Customizes the aria-label attribute for accessibility (defaults to "Close")
23
+ - `class` (string): Optional. Additional CSS classes to apply to the close button
24
+ - `disabled` (boolean): Optional. Disables the close button when set to true
25
+ - `elementRef` (HTMLElement): Optional. Reference to the button DOM element
26
+ -->
27
+ <script lang="ts">import { uniqueClsx } from '../common/css.js';
28
+ let { ariaLabel = 'Close', class: classValues, disabled = false, elementRef = $bindable(null), ...restOfProps } = $props();
29
+ let classes = $derived(uniqueClsx('btn-close', classValues));
30
+ </script>
31
+
32
+ <button aria-label={ariaLabel} bind:this={elementRef} class={classes} {disabled} type="button" {...restOfProps}></button>