svelora 2.1.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 (484) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +145 -0
  3. package/dist/Accordion/Accordion.svelte +207 -0
  4. package/dist/Accordion/Accordion.svelte.d.ts +6 -0
  5. package/dist/Accordion/accordion.types.d.ts +225 -0
  6. package/dist/Accordion/accordion.types.js +1 -0
  7. package/dist/Accordion/accordion.variants.d.ts +88 -0
  8. package/dist/Accordion/accordion.variants.js +28 -0
  9. package/dist/Accordion/index.d.ts +2 -0
  10. package/dist/Accordion/index.js +1 -0
  11. package/dist/Alert/Alert.svelte +131 -0
  12. package/dist/Alert/Alert.svelte.d.ts +5 -0
  13. package/dist/Alert/alert.types.d.ts +103 -0
  14. package/dist/Alert/alert.types.js +1 -0
  15. package/dist/Alert/alert.variants.d.ts +213 -0
  16. package/dist/Alert/alert.variants.js +293 -0
  17. package/dist/Alert/index.d.ts +2 -0
  18. package/dist/Alert/index.js +1 -0
  19. package/dist/Avatar/Avatar.svelte +114 -0
  20. package/dist/Avatar/Avatar.svelte.d.ts +6 -0
  21. package/dist/Avatar/avatar.types.d.ts +73 -0
  22. package/dist/Avatar/avatar.types.js +1 -0
  23. package/dist/Avatar/avatar.variants.d.ts +316 -0
  24. package/dist/Avatar/avatar.variants.js +39 -0
  25. package/dist/Avatar/index.d.ts +2 -0
  26. package/dist/Avatar/index.js +1 -0
  27. package/dist/AvatarGroup/AvatarGroup.svelte +71 -0
  28. package/dist/AvatarGroup/AvatarGroup.svelte.d.ts +5 -0
  29. package/dist/AvatarGroup/avatar-group.types.d.ts +49 -0
  30. package/dist/AvatarGroup/avatar-group.types.js +1 -0
  31. package/dist/AvatarGroup/avatar-group.variants.d.ts +258 -0
  32. package/dist/AvatarGroup/avatar-group.variants.js +35 -0
  33. package/dist/AvatarGroup/index.d.ts +2 -0
  34. package/dist/AvatarGroup/index.js +1 -0
  35. package/dist/Badge/Badge.svelte +79 -0
  36. package/dist/Badge/Badge.svelte.d.ts +5 -0
  37. package/dist/Badge/badge.types.d.ts +83 -0
  38. package/dist/Badge/badge.types.js +1 -0
  39. package/dist/Badge/badge.variants.d.ts +303 -0
  40. package/dist/Badge/badge.variants.js +259 -0
  41. package/dist/Badge/index.d.ts +2 -0
  42. package/dist/Badge/index.js +1 -0
  43. package/dist/Banner/Banner.svelte +130 -0
  44. package/dist/Banner/Banner.svelte.d.ts +5 -0
  45. package/dist/Banner/banner.types.d.ts +148 -0
  46. package/dist/Banner/banner.types.js +1 -0
  47. package/dist/Banner/banner.variants.d.ts +293 -0
  48. package/dist/Banner/banner.variants.js +86 -0
  49. package/dist/Banner/index.d.ts +2 -0
  50. package/dist/Banner/index.js +1 -0
  51. package/dist/Breadcrumb/Breadcrumb.svelte +79 -0
  52. package/dist/Breadcrumb/Breadcrumb.svelte.d.ts +5 -0
  53. package/dist/Breadcrumb/breadcrumb.types.d.ts +66 -0
  54. package/dist/Breadcrumb/breadcrumb.types.js +1 -0
  55. package/dist/Breadcrumb/breadcrumb.variants.d.ts +138 -0
  56. package/dist/Breadcrumb/breadcrumb.variants.js +53 -0
  57. package/dist/Breadcrumb/index.d.ts +2 -0
  58. package/dist/Breadcrumb/index.js +1 -0
  59. package/dist/Button/Button.svelte +177 -0
  60. package/dist/Button/Button.svelte.d.ts +5 -0
  61. package/dist/Button/button.types.d.ts +151 -0
  62. package/dist/Button/button.types.js +1 -0
  63. package/dist/Button/button.variants.d.ts +388 -0
  64. package/dist/Button/button.variants.js +461 -0
  65. package/dist/Button/index.d.ts +2 -0
  66. package/dist/Button/index.js +1 -0
  67. package/dist/Calendar/Calendar.svelte +344 -0
  68. package/dist/Calendar/Calendar.svelte.d.ts +6 -0
  69. package/dist/Calendar/calendar.types.d.ts +122 -0
  70. package/dist/Calendar/calendar.types.js +1 -0
  71. package/dist/Calendar/calendar.variants.d.ts +553 -0
  72. package/dist/Calendar/calendar.variants.js +368 -0
  73. package/dist/Calendar/index.d.ts +2 -0
  74. package/dist/Calendar/index.js +1 -0
  75. package/dist/Card/Card.svelte +54 -0
  76. package/dist/Card/Card.svelte.d.ts +5 -0
  77. package/dist/Card/card.types.d.ts +36 -0
  78. package/dist/Card/card.types.js +1 -0
  79. package/dist/Card/card.variants.d.ts +108 -0
  80. package/dist/Card/card.variants.js +32 -0
  81. package/dist/Card/index.d.ts +2 -0
  82. package/dist/Card/index.js +1 -0
  83. package/dist/Carousel/Carousel.svelte +277 -0
  84. package/dist/Carousel/Carousel.svelte.d.ts +26 -0
  85. package/dist/Carousel/carousel.types.d.ts +251 -0
  86. package/dist/Carousel/carousel.types.js +1 -0
  87. package/dist/Carousel/carousel.variants.d.ts +408 -0
  88. package/dist/Carousel/carousel.variants.js +88 -0
  89. package/dist/Carousel/index.d.ts +2 -0
  90. package/dist/Carousel/index.js +1 -0
  91. package/dist/Checkbox/Checkbox.svelte +161 -0
  92. package/dist/Checkbox/Checkbox.svelte.d.ts +6 -0
  93. package/dist/Checkbox/checkbox.types.d.ts +101 -0
  94. package/dist/Checkbox/checkbox.types.js +1 -0
  95. package/dist/Checkbox/checkbox.variants.d.ts +448 -0
  96. package/dist/Checkbox/checkbox.variants.js +209 -0
  97. package/dist/Checkbox/index.d.ts +2 -0
  98. package/dist/Checkbox/index.js +1 -0
  99. package/dist/CheckboxGroup/CheckboxGroup.svelte +219 -0
  100. package/dist/CheckboxGroup/CheckboxGroup.svelte.d.ts +5 -0
  101. package/dist/CheckboxGroup/checkbox-group.types.d.ts +130 -0
  102. package/dist/CheckboxGroup/checkbox-group.types.js +1 -0
  103. package/dist/CheckboxGroup/checkbox-group.variants.d.ts +553 -0
  104. package/dist/CheckboxGroup/checkbox-group.variants.js +231 -0
  105. package/dist/CheckboxGroup/index.d.ts +2 -0
  106. package/dist/CheckboxGroup/index.js +1 -0
  107. package/dist/Chip/Chip.svelte +51 -0
  108. package/dist/Chip/Chip.svelte.d.ts +5 -0
  109. package/dist/Chip/chip.types.d.ts +66 -0
  110. package/dist/Chip/chip.types.js +1 -0
  111. package/dist/Chip/chip.variants.d.ts +418 -0
  112. package/dist/Chip/chip.variants.js +74 -0
  113. package/dist/Chip/index.d.ts +2 -0
  114. package/dist/Chip/index.js +1 -0
  115. package/dist/Collapsible/Collapsible.svelte +69 -0
  116. package/dist/Collapsible/Collapsible.svelte.d.ts +6 -0
  117. package/dist/Collapsible/CollapsibleTestWrapper.svelte +17 -0
  118. package/dist/Collapsible/CollapsibleTestWrapper.svelte.d.ts +4 -0
  119. package/dist/Collapsible/collapsible.types.d.ts +77 -0
  120. package/dist/Collapsible/collapsible.types.js +1 -0
  121. package/dist/Collapsible/collapsible.variants.d.ts +53 -0
  122. package/dist/Collapsible/collapsible.variants.js +21 -0
  123. package/dist/Collapsible/index.d.ts +2 -0
  124. package/dist/Collapsible/index.js +1 -0
  125. package/dist/Command/Command.svelte +183 -0
  126. package/dist/Command/Command.svelte.d.ts +6 -0
  127. package/dist/Command/CommandTestWrapper.svelte +13 -0
  128. package/dist/Command/CommandTestWrapper.svelte.d.ts +4 -0
  129. package/dist/Command/command.types.d.ts +100 -0
  130. package/dist/Command/command.types.js +1 -0
  131. package/dist/Command/command.variants.d.ts +226 -0
  132. package/dist/Command/command.variants.js +86 -0
  133. package/dist/Command/index.d.ts +2 -0
  134. package/dist/Command/index.js +1 -0
  135. package/dist/Container/Container.svelte +21 -0
  136. package/dist/Container/Container.svelte.d.ts +5 -0
  137. package/dist/Container/container.types.d.ts +19 -0
  138. package/dist/Container/container.types.js +1 -0
  139. package/dist/Container/container.variants.d.ts +29 -0
  140. package/dist/Container/container.variants.js +9 -0
  141. package/dist/Container/index.d.ts +2 -0
  142. package/dist/Container/index.js +1 -0
  143. package/dist/ContextMenu/ContextMenu.svelte +344 -0
  144. package/dist/ContextMenu/ContextMenu.svelte.d.ts +6 -0
  145. package/dist/ContextMenu/context-menu.types.d.ts +265 -0
  146. package/dist/ContextMenu/context-menu.types.js +1 -0
  147. package/dist/ContextMenu/context-menu.variants.d.ts +307 -0
  148. package/dist/ContextMenu/context-menu.variants.js +144 -0
  149. package/dist/ContextMenu/index.d.ts +2 -0
  150. package/dist/ContextMenu/index.js +1 -0
  151. package/dist/Drawer/Drawer.svelte +207 -0
  152. package/dist/Drawer/Drawer.svelte.d.ts +6 -0
  153. package/dist/Drawer/DrawerTriggerTestWrapper.svelte +10 -0
  154. package/dist/Drawer/DrawerTriggerTestWrapper.svelte.d.ts +18 -0
  155. package/dist/Drawer/drawer.types.d.ts +116 -0
  156. package/dist/Drawer/drawer.types.js +1 -0
  157. package/dist/Drawer/drawer.variants.d.ts +193 -0
  158. package/dist/Drawer/drawer.variants.js +139 -0
  159. package/dist/Drawer/index.d.ts +2 -0
  160. package/dist/Drawer/index.js +1 -0
  161. package/dist/DropdownMenu/DropdownMenu.svelte +363 -0
  162. package/dist/DropdownMenu/DropdownMenu.svelte.d.ts +6 -0
  163. package/dist/DropdownMenu/DropdownMenuTriggerTestWrapper.svelte +12 -0
  164. package/dist/DropdownMenu/DropdownMenuTriggerTestWrapper.svelte.d.ts +7 -0
  165. package/dist/DropdownMenu/dropdown-menu.types.d.ts +279 -0
  166. package/dist/DropdownMenu/dropdown-menu.types.js +1 -0
  167. package/dist/DropdownMenu/dropdown-menu.variants.d.ts +312 -0
  168. package/dist/DropdownMenu/dropdown-menu.variants.js +149 -0
  169. package/dist/DropdownMenu/index.d.ts +2 -0
  170. package/dist/DropdownMenu/index.js +1 -0
  171. package/dist/Editor/Editor.svelte +756 -0
  172. package/dist/Editor/Editor.svelte.d.ts +6 -0
  173. package/dist/Editor/EditorUrlPrompt.svelte +94 -0
  174. package/dist/Editor/EditorUrlPrompt.svelte.d.ts +15 -0
  175. package/dist/Editor/SlashPopup.svelte +74 -0
  176. package/dist/Editor/SlashPopup.svelte.d.ts +11 -0
  177. package/dist/Editor/editor.extensions.d.ts +23 -0
  178. package/dist/Editor/editor.extensions.js +132 -0
  179. package/dist/Editor/editor.schemas.d.ts +5 -0
  180. package/dist/Editor/editor.schemas.js +27 -0
  181. package/dist/Editor/editor.slash.svelte.d.ts +25 -0
  182. package/dist/Editor/editor.slash.svelte.js +299 -0
  183. package/dist/Editor/editor.suggestion.d.ts +7 -0
  184. package/dist/Editor/editor.suggestion.js +165 -0
  185. package/dist/Editor/editor.toolbar.d.ts +11 -0
  186. package/dist/Editor/editor.toolbar.js +204 -0
  187. package/dist/Editor/editor.types.d.ts +367 -0
  188. package/dist/Editor/editor.types.js +1 -0
  189. package/dist/Editor/editor.variants.d.ts +303 -0
  190. package/dist/Editor/editor.variants.js +135 -0
  191. package/dist/Editor/index.d.ts +55 -0
  192. package/dist/Editor/index.js +54 -0
  193. package/dist/Empty/Empty.svelte +118 -0
  194. package/dist/Empty/Empty.svelte.d.ts +5 -0
  195. package/dist/Empty/empty.types.d.ts +91 -0
  196. package/dist/Empty/empty.types.js +1 -0
  197. package/dist/Empty/empty.variants.d.ts +308 -0
  198. package/dist/Empty/empty.variants.js +73 -0
  199. package/dist/Empty/index.d.ts +2 -0
  200. package/dist/Empty/index.js +1 -0
  201. package/dist/FieldGroup/FieldGroup.svelte +53 -0
  202. package/dist/FieldGroup/FieldGroup.svelte.d.ts +5 -0
  203. package/dist/FieldGroup/field-group.types.d.ts +37 -0
  204. package/dist/FieldGroup/field-group.types.js +1 -0
  205. package/dist/FieldGroup/field-group.variants.d.ts +116 -0
  206. package/dist/FieldGroup/field-group.variants.js +49 -0
  207. package/dist/FieldGroup/index.d.ts +2 -0
  208. package/dist/FieldGroup/index.js +1 -0
  209. package/dist/FileUpload/FileUpload.svelte +639 -0
  210. package/dist/FileUpload/FileUpload.svelte.d.ts +8 -0
  211. package/dist/FileUpload/file-upload.types.d.ts +203 -0
  212. package/dist/FileUpload/file-upload.types.js +1 -0
  213. package/dist/FileUpload/file-upload.variants.d.ts +397 -0
  214. package/dist/FileUpload/file-upload.variants.js +224 -0
  215. package/dist/FileUpload/index.d.ts +2 -0
  216. package/dist/FileUpload/index.js +1 -0
  217. package/dist/Form/Form.svelte +197 -0
  218. package/dist/Form/Form.svelte.d.ts +26 -0
  219. package/dist/Form/form.context.svelte.d.ts +64 -0
  220. package/dist/Form/form.context.svelte.js +478 -0
  221. package/dist/Form/form.types.d.ts +164 -0
  222. package/dist/Form/form.types.js +12 -0
  223. package/dist/Form/form.variants.d.ts +39 -0
  224. package/dist/Form/form.variants.js +17 -0
  225. package/dist/Form/index.d.ts +4 -0
  226. package/dist/Form/index.js +6 -0
  227. package/dist/Form/validate-schema.d.ts +13 -0
  228. package/dist/Form/validate-schema.js +113 -0
  229. package/dist/FormField/FormField.svelte +186 -0
  230. package/dist/FormField/FormField.svelte.d.ts +5 -0
  231. package/dist/FormField/form-field.types.d.ts +109 -0
  232. package/dist/FormField/form-field.types.js +1 -0
  233. package/dist/FormField/form-field.variants.d.ts +313 -0
  234. package/dist/FormField/form-field.variants.js +74 -0
  235. package/dist/FormField/index.d.ts +2 -0
  236. package/dist/FormField/index.js +1 -0
  237. package/dist/Icon/Icon.svelte +46 -0
  238. package/dist/Icon/Icon.svelte.d.ts +6 -0
  239. package/dist/Icon/icon.types.d.ts +49 -0
  240. package/dist/Icon/icon.types.js +1 -0
  241. package/dist/Icon/index.d.ts +2 -0
  242. package/dist/Icon/index.js +1 -0
  243. package/dist/Input/Input.svelte +199 -0
  244. package/dist/Input/Input.svelte.d.ts +26 -0
  245. package/dist/Input/index.d.ts +2 -0
  246. package/dist/Input/index.js +1 -0
  247. package/dist/Input/input.types.d.ts +113 -0
  248. package/dist/Input/input.types.js +1 -0
  249. package/dist/Input/input.variants.d.ts +398 -0
  250. package/dist/Input/input.variants.js +387 -0
  251. package/dist/Kbd/Kbd.svelte +45 -0
  252. package/dist/Kbd/Kbd.svelte.d.ts +5 -0
  253. package/dist/Kbd/index.d.ts +3 -0
  254. package/dist/Kbd/index.js +2 -0
  255. package/dist/Kbd/kbd.types.d.ts +91 -0
  256. package/dist/Kbd/kbd.types.js +1 -0
  257. package/dist/Kbd/kbd.variants.d.ts +180 -0
  258. package/dist/Kbd/kbd.variants.js +168 -0
  259. package/dist/Kbd/useKbd.svelte.d.ts +29 -0
  260. package/dist/Kbd/useKbd.svelte.js +248 -0
  261. package/dist/Link/Link.svelte +168 -0
  262. package/dist/Link/Link.svelte.d.ts +5 -0
  263. package/dist/Link/index.d.ts +2 -0
  264. package/dist/Link/index.js +1 -0
  265. package/dist/Link/link.types.d.ts +86 -0
  266. package/dist/Link/link.types.js +1 -0
  267. package/dist/Link/link.variants.d.ts +113 -0
  268. package/dist/Link/link.variants.js +43 -0
  269. package/dist/Modal/Modal.svelte +218 -0
  270. package/dist/Modal/Modal.svelte.d.ts +5 -0
  271. package/dist/Modal/ModalTriggerTestWrapper.svelte +10 -0
  272. package/dist/Modal/ModalTriggerTestWrapper.svelte.d.ts +18 -0
  273. package/dist/Modal/index.d.ts +2 -0
  274. package/dist/Modal/index.js +1 -0
  275. package/dist/Modal/modal.types.d.ts +155 -0
  276. package/dist/Modal/modal.types.js +1 -0
  277. package/dist/Modal/modal.variants.d.ts +303 -0
  278. package/dist/Modal/modal.variants.js +90 -0
  279. package/dist/Pagination/Pagination.svelte +253 -0
  280. package/dist/Pagination/Pagination.svelte.d.ts +6 -0
  281. package/dist/Pagination/index.d.ts +2 -0
  282. package/dist/Pagination/index.js +1 -0
  283. package/dist/Pagination/pagination.types.d.ts +191 -0
  284. package/dist/Pagination/pagination.types.js +1 -0
  285. package/dist/Pagination/pagination.variants.d.ts +160 -0
  286. package/dist/Pagination/pagination.variants.js +125 -0
  287. package/dist/PinInput/PinInput.svelte +162 -0
  288. package/dist/PinInput/PinInput.svelte.d.ts +6 -0
  289. package/dist/PinInput/index.d.ts +2 -0
  290. package/dist/PinInput/index.js +1 -0
  291. package/dist/PinInput/pin-input.types.d.ts +110 -0
  292. package/dist/PinInput/pin-input.types.js +1 -0
  293. package/dist/PinInput/pin-input.variants.d.ts +303 -0
  294. package/dist/PinInput/pin-input.variants.js +196 -0
  295. package/dist/Popover/Popover.svelte +122 -0
  296. package/dist/Popover/Popover.svelte.d.ts +6 -0
  297. package/dist/Popover/index.d.ts +2 -0
  298. package/dist/Popover/index.js +1 -0
  299. package/dist/Popover/popover.types.d.ts +58 -0
  300. package/dist/Popover/popover.types.js +1 -0
  301. package/dist/Popover/popover.variants.d.ts +53 -0
  302. package/dist/Popover/popover.variants.js +31 -0
  303. package/dist/Progress/Progress.svelte +135 -0
  304. package/dist/Progress/Progress.svelte.d.ts +6 -0
  305. package/dist/Progress/index.d.ts +2 -0
  306. package/dist/Progress/index.js +1 -0
  307. package/dist/Progress/progress.types.d.ts +71 -0
  308. package/dist/Progress/progress.types.js +1 -0
  309. package/dist/Progress/progress.variants.d.ts +513 -0
  310. package/dist/Progress/progress.variants.js +204 -0
  311. package/dist/RadioGroup/RadioGroup.svelte +226 -0
  312. package/dist/RadioGroup/RadioGroup.svelte.d.ts +6 -0
  313. package/dist/RadioGroup/index.d.ts +2 -0
  314. package/dist/RadioGroup/index.js +1 -0
  315. package/dist/RadioGroup/radio-group.types.d.ts +111 -0
  316. package/dist/RadioGroup/radio-group.types.js +1 -0
  317. package/dist/RadioGroup/radio-group.variants.d.ts +543 -0
  318. package/dist/RadioGroup/radio-group.variants.js +232 -0
  319. package/dist/Select/Select.svelte +461 -0
  320. package/dist/Select/Select.svelte.d.ts +6 -0
  321. package/dist/Select/index.d.ts +2 -0
  322. package/dist/Select/index.js +1 -0
  323. package/dist/Select/select.types.d.ts +263 -0
  324. package/dist/Select/select.types.js +1 -0
  325. package/dist/Select/select.variants.d.ts +713 -0
  326. package/dist/Select/select.variants.js +482 -0
  327. package/dist/SelectMenu/SelectMenu.svelte +637 -0
  328. package/dist/SelectMenu/SelectMenu.svelte.d.ts +5 -0
  329. package/dist/SelectMenu/SelectMenuFormFieldTestWrapper.svelte +11 -0
  330. package/dist/SelectMenu/SelectMenuFormFieldTestWrapper.svelte.d.ts +7 -0
  331. package/dist/SelectMenu/index.d.ts +2 -0
  332. package/dist/SelectMenu/index.js +1 -0
  333. package/dist/SelectMenu/select-menu.types.d.ts +326 -0
  334. package/dist/SelectMenu/select-menu.types.js +1 -0
  335. package/dist/SelectMenu/select-menu.variants.d.ts +795 -0
  336. package/dist/SelectMenu/select-menu.variants.js +70 -0
  337. package/dist/Separator/Separator.svelte +77 -0
  338. package/dist/Separator/Separator.svelte.d.ts +6 -0
  339. package/dist/Separator/index.d.ts +2 -0
  340. package/dist/Separator/index.js +1 -0
  341. package/dist/Separator/separator.types.d.ts +53 -0
  342. package/dist/Separator/separator.types.js +1 -0
  343. package/dist/Separator/separator.variants.d.ts +509 -0
  344. package/dist/Separator/separator.variants.js +110 -0
  345. package/dist/Skeleton/Skeleton.svelte +39 -0
  346. package/dist/Skeleton/Skeleton.svelte.d.ts +5 -0
  347. package/dist/Skeleton/index.d.ts +2 -0
  348. package/dist/Skeleton/index.js +1 -0
  349. package/dist/Skeleton/skeleton.types.d.ts +27 -0
  350. package/dist/Skeleton/skeleton.types.js +1 -0
  351. package/dist/Skeleton/skeleton.variants.d.ts +18 -0
  352. package/dist/Skeleton/skeleton.variants.js +12 -0
  353. package/dist/Slideover/Slideover.svelte +212 -0
  354. package/dist/Slideover/Slideover.svelte.d.ts +5 -0
  355. package/dist/Slideover/SlideoverTriggerTestWrapper.svelte +10 -0
  356. package/dist/Slideover/SlideoverTriggerTestWrapper.svelte.d.ts +18 -0
  357. package/dist/Slideover/index.d.ts +2 -0
  358. package/dist/Slideover/index.js +1 -0
  359. package/dist/Slideover/slideover.types.d.ts +154 -0
  360. package/dist/Slideover/slideover.types.js +1 -0
  361. package/dist/Slideover/slideover.variants.d.ts +298 -0
  362. package/dist/Slideover/slideover.variants.js +145 -0
  363. package/dist/Slider/Slider.svelte +129 -0
  364. package/dist/Slider/Slider.svelte.d.ts +6 -0
  365. package/dist/Slider/index.d.ts +2 -0
  366. package/dist/Slider/index.js +1 -0
  367. package/dist/Slider/slider.types.d.ts +55 -0
  368. package/dist/Slider/slider.types.js +1 -0
  369. package/dist/Slider/slider.variants.d.ts +383 -0
  370. package/dist/Slider/slider.variants.js +102 -0
  371. package/dist/Stepper/Stepper.svelte +254 -0
  372. package/dist/Stepper/Stepper.svelte.d.ts +5 -0
  373. package/dist/Stepper/index.d.ts +2 -0
  374. package/dist/Stepper/index.js +1 -0
  375. package/dist/Stepper/stepper.types.d.ts +223 -0
  376. package/dist/Stepper/stepper.types.js +1 -0
  377. package/dist/Stepper/stepper.variants.d.ts +428 -0
  378. package/dist/Stepper/stepper.variants.js +204 -0
  379. package/dist/Switch/Switch.svelte +150 -0
  380. package/dist/Switch/Switch.svelte.d.ts +6 -0
  381. package/dist/Switch/index.d.ts +2 -0
  382. package/dist/Switch/index.js +1 -0
  383. package/dist/Switch/switch.types.d.ts +80 -0
  384. package/dist/Switch/switch.types.js +1 -0
  385. package/dist/Switch/switch.variants.d.ts +433 -0
  386. package/dist/Switch/switch.variants.js +171 -0
  387. package/dist/Table/Table.svelte +667 -0
  388. package/dist/Table/Table.svelte.d.ts +26 -0
  389. package/dist/Table/index.d.ts +2 -0
  390. package/dist/Table/index.js +1 -0
  391. package/dist/Table/table.types.d.ts +202 -0
  392. package/dist/Table/table.types.js +1 -0
  393. package/dist/Table/table.utils.d.ts +54 -0
  394. package/dist/Table/table.utils.js +167 -0
  395. package/dist/Table/table.variants.d.ts +205 -0
  396. package/dist/Table/table.variants.js +126 -0
  397. package/dist/Tabs/Tabs.svelte +188 -0
  398. package/dist/Tabs/Tabs.svelte.d.ts +6 -0
  399. package/dist/Tabs/index.d.ts +2 -0
  400. package/dist/Tabs/index.js +1 -0
  401. package/dist/Tabs/tabs.types.d.ts +207 -0
  402. package/dist/Tabs/tabs.types.js +1 -0
  403. package/dist/Tabs/tabs.variants.d.ts +298 -0
  404. package/dist/Tabs/tabs.variants.js +251 -0
  405. package/dist/Textarea/Textarea.svelte +215 -0
  406. package/dist/Textarea/Textarea.svelte.d.ts +5 -0
  407. package/dist/Textarea/index.d.ts +2 -0
  408. package/dist/Textarea/index.js +1 -0
  409. package/dist/Textarea/textarea.types.d.ts +103 -0
  410. package/dist/Textarea/textarea.types.js +1 -0
  411. package/dist/Textarea/textarea.variants.d.ts +403 -0
  412. package/dist/Textarea/textarea.variants.js +404 -0
  413. package/dist/ThemeModeButton/ThemeModeButton.svelte +74 -0
  414. package/dist/ThemeModeButton/ThemeModeButton.svelte.d.ts +5 -0
  415. package/dist/ThemeModeButton/index.d.ts +2 -0
  416. package/dist/ThemeModeButton/index.js +1 -0
  417. package/dist/ThemeModeButton/theme-mode-button.types.d.ts +69 -0
  418. package/dist/ThemeModeButton/theme-mode-button.types.js +1 -0
  419. package/dist/ThemeModeButton/theme-mode-button.variants.d.ts +21 -0
  420. package/dist/ThemeModeButton/theme-mode-button.variants.js +17 -0
  421. package/dist/Timeline/Timeline.svelte +116 -0
  422. package/dist/Timeline/Timeline.svelte.d.ts +5 -0
  423. package/dist/Timeline/index.d.ts +2 -0
  424. package/dist/Timeline/index.js +1 -0
  425. package/dist/Timeline/timeline.types.d.ts +138 -0
  426. package/dist/Timeline/timeline.types.js +1 -0
  427. package/dist/Timeline/timeline.variants.d.ts +413 -0
  428. package/dist/Timeline/timeline.variants.js +201 -0
  429. package/dist/Toast/Toaster.svelte +619 -0
  430. package/dist/Toast/Toaster.svelte.d.ts +5 -0
  431. package/dist/Toast/index.d.ts +4 -0
  432. package/dist/Toast/index.js +2 -0
  433. package/dist/Toast/toast.d.ts +38 -0
  434. package/dist/Toast/toast.js +73 -0
  435. package/dist/Toast/toast.types.d.ts +19 -0
  436. package/dist/Toast/toast.types.js +1 -0
  437. package/dist/Toast/toast.variants.d.ts +7 -0
  438. package/dist/Toast/toast.variants.js +5 -0
  439. package/dist/Tooltip/Tooltip.svelte +151 -0
  440. package/dist/Tooltip/Tooltip.svelte.d.ts +6 -0
  441. package/dist/Tooltip/TooltipTestWrapper.svelte +8 -0
  442. package/dist/Tooltip/TooltipTestWrapper.svelte.d.ts +4 -0
  443. package/dist/Tooltip/index.d.ts +2 -0
  444. package/dist/Tooltip/index.js +1 -0
  445. package/dist/Tooltip/tooltip.types.d.ts +62 -0
  446. package/dist/Tooltip/tooltip.types.js +1 -0
  447. package/dist/Tooltip/tooltip.variants.d.ts +68 -0
  448. package/dist/Tooltip/tooltip.variants.js +35 -0
  449. package/dist/User/User.svelte +98 -0
  450. package/dist/User/User.svelte.d.ts +5 -0
  451. package/dist/User/index.d.ts +2 -0
  452. package/dist/User/index.js +1 -0
  453. package/dist/User/user.types.d.ts +78 -0
  454. package/dist/User/user.types.js +1 -0
  455. package/dist/User/user.variants.d.ts +368 -0
  456. package/dist/User/user.variants.js +85 -0
  457. package/dist/config.d.ts +73 -0
  458. package/dist/config.js +108 -0
  459. package/dist/hooks/HookContextProbe.svelte +7 -0
  460. package/dist/hooks/HookContextProbe.svelte.d.ts +18 -0
  461. package/dist/hooks/HookContextProvider.svelte +9 -0
  462. package/dist/hooks/HookContextProvider.svelte.d.ts +18 -0
  463. package/dist/hooks/HookEmitProbe.svelte +14 -0
  464. package/dist/hooks/HookEmitProbe.svelte.d.ts +18 -0
  465. package/dist/hooks/index.d.ts +14 -0
  466. package/dist/hooks/index.js +7 -0
  467. package/dist/hooks/useClickOutside.svelte.d.ts +31 -0
  468. package/dist/hooks/useClickOutside.svelte.js +37 -0
  469. package/dist/hooks/useClipboard.svelte.d.ts +30 -0
  470. package/dist/hooks/useClipboard.svelte.js +45 -0
  471. package/dist/hooks/useDebounce.svelte.d.ts +36 -0
  472. package/dist/hooks/useDebounce.svelte.js +56 -0
  473. package/dist/hooks/useEscapeKeydown.svelte.d.ts +31 -0
  474. package/dist/hooks/useEscapeKeydown.svelte.js +37 -0
  475. package/dist/hooks/useFormField.svelte.d.ts +54 -0
  476. package/dist/hooks/useFormField.svelte.js +65 -0
  477. package/dist/hooks/useInfiniteScroll.svelte.d.ts +57 -0
  478. package/dist/hooks/useInfiniteScroll.svelte.js +69 -0
  479. package/dist/hooks/useMediaQuery.svelte.d.ts +31 -0
  480. package/dist/hooks/useMediaQuery.svelte.js +38 -0
  481. package/dist/index.d.ts +56 -0
  482. package/dist/index.js +57 -0
  483. package/dist/theme.css +680 -0
  484. package/package.json +237 -0
@@ -0,0 +1,18 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const HookEmitProbe: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, string>;
17
+ type HookEmitProbe = InstanceType<typeof HookEmitProbe>;
18
+ export default HookEmitProbe;
@@ -0,0 +1,14 @@
1
+ export type { UseClickOutsideOptions } from './useClickOutside.svelte.js';
2
+ export { useClickOutside } from './useClickOutside.svelte.js';
3
+ export type { UseClipboardOptions } from './useClipboard.svelte.js';
4
+ export { useClipboard } from './useClipboard.svelte.js';
5
+ export type { UseDebounceOptions } from './useDebounce.svelte.js';
6
+ export { useDebounce } from './useDebounce.svelte.js';
7
+ export type { UseEscapeKeydownOptions } from './useEscapeKeydown.svelte.js';
8
+ export { useEscapeKeydown } from './useEscapeKeydown.svelte.js';
9
+ export type { FormFieldContext } from './useFormField.svelte.js';
10
+ export { FORM_FIELD_CONTEXT_KEY, useFormField, useFormFieldEmit } from './useFormField.svelte.js';
11
+ export type { UseInfiniteScrollOptions } from './useInfiniteScroll.svelte.js';
12
+ export { useInfiniteScroll } from './useInfiniteScroll.svelte.js';
13
+ export type { UseMediaQueryOptions } from './useMediaQuery.svelte.js';
14
+ export { useMediaQuery } from './useMediaQuery.svelte.js';
@@ -0,0 +1,7 @@
1
+ export { useClickOutside } from './useClickOutside.svelte.js';
2
+ export { useClipboard } from './useClipboard.svelte.js';
3
+ export { useDebounce } from './useDebounce.svelte.js';
4
+ export { useEscapeKeydown } from './useEscapeKeydown.svelte.js';
5
+ export { FORM_FIELD_CONTEXT_KEY, useFormField, useFormFieldEmit } from './useFormField.svelte.js';
6
+ export { useInfiniteScroll } from './useInfiniteScroll.svelte.js';
7
+ export { useMediaQuery } from './useMediaQuery.svelte.js';
@@ -0,0 +1,31 @@
1
+ import type { Action } from 'svelte/action';
2
+ export interface UseClickOutsideOptions {
3
+ /**
4
+ * Callback fired when a click occurs outside the element.
5
+ */
6
+ handler: (event: PointerEvent) => void;
7
+ /**
8
+ * Whether the listener is active.
9
+ * @default true
10
+ */
11
+ enabled?: boolean;
12
+ }
13
+ /**
14
+ * Svelte action that detects clicks outside an element.
15
+ *
16
+ * @example
17
+ * ```svelte
18
+ * <script>
19
+ * import { useClickOutside } from 'svelora'
20
+ *
21
+ * let open = $state(false)
22
+ * </script>
23
+ *
24
+ * {#if open}
25
+ * <div use:useClickOutside={{ handler: () => (open = false) }}>
26
+ * Dropdown content
27
+ * </div>
28
+ * {/if}
29
+ * ```
30
+ */
31
+ export declare const useClickOutside: Action<HTMLElement, UseClickOutsideOptions>;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Svelte action that detects clicks outside an element.
3
+ *
4
+ * @example
5
+ * ```svelte
6
+ * <script>
7
+ * import { useClickOutside } from 'svelora'
8
+ *
9
+ * let open = $state(false)
10
+ * </script>
11
+ *
12
+ * {#if open}
13
+ * <div use:useClickOutside={{ handler: () => (open = false) }}>
14
+ * Dropdown content
15
+ * </div>
16
+ * {/if}
17
+ * ```
18
+ */
19
+ export const useClickOutside = (node, initialOptions) => {
20
+ let currentOptions = initialOptions;
21
+ function handlePointerDown(event) {
22
+ if (currentOptions.enabled === false)
23
+ return;
24
+ if (!node.contains(event.target)) {
25
+ currentOptions.handler(event);
26
+ }
27
+ }
28
+ document.addEventListener('pointerdown', handlePointerDown, true);
29
+ return {
30
+ update(newOptions) {
31
+ currentOptions = newOptions;
32
+ },
33
+ destroy() {
34
+ document.removeEventListener('pointerdown', handlePointerDown, true);
35
+ }
36
+ };
37
+ };
@@ -0,0 +1,30 @@
1
+ export interface UseClipboardOptions {
2
+ /**
3
+ * Duration in milliseconds before `copied` resets to `false`.
4
+ * @default 2000
5
+ */
6
+ timeout?: number;
7
+ }
8
+ export interface UseClipboardReturn {
9
+ /** Whether text was recently copied (resets after timeout) */
10
+ readonly copied: boolean;
11
+ /** Copy text to clipboard */
12
+ copy: (text: string) => Promise<void>;
13
+ }
14
+ /**
15
+ * Reactive clipboard hook. Copies text and tracks copied state.
16
+ *
17
+ * @example
18
+ * ```svelte
19
+ * <script>
20
+ * import { useClipboard } from 'svelora'
21
+ *
22
+ * const clipboard = useClipboard()
23
+ * </script>
24
+ *
25
+ * <Button onclick={() => clipboard.copy('Hello!')}>
26
+ * {clipboard.copied ? 'Copied!' : 'Copy'}
27
+ * </Button>
28
+ * ```
29
+ */
30
+ export declare function useClipboard(options?: UseClipboardOptions): UseClipboardReturn;
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Reactive clipboard hook. Copies text and tracks copied state.
3
+ *
4
+ * @example
5
+ * ```svelte
6
+ * <script>
7
+ * import { useClipboard } from 'svelora'
8
+ *
9
+ * const clipboard = useClipboard()
10
+ * </script>
11
+ *
12
+ * <Button onclick={() => clipboard.copy('Hello!')}>
13
+ * {clipboard.copied ? 'Copied!' : 'Copy'}
14
+ * </Button>
15
+ * ```
16
+ */
17
+ export function useClipboard(options = {}) {
18
+ const { timeout = 2000 } = options;
19
+ let copied = $state(false);
20
+ let timeoutId;
21
+ async function copy(text) {
22
+ if (typeof navigator === 'undefined' || !navigator.clipboard)
23
+ return;
24
+ try {
25
+ await navigator.clipboard.writeText(text);
26
+ copied = true;
27
+ clearTimeout(timeoutId);
28
+ timeoutId = setTimeout(() => {
29
+ copied = false;
30
+ }, timeout);
31
+ }
32
+ catch {
33
+ copied = false;
34
+ }
35
+ }
36
+ $effect(() => {
37
+ return () => clearTimeout(timeoutId);
38
+ });
39
+ return {
40
+ get copied() {
41
+ return copied;
42
+ },
43
+ copy
44
+ };
45
+ }
@@ -0,0 +1,36 @@
1
+ export interface UseDebounceOptions {
2
+ /**
3
+ * Delay in milliseconds before the callback is executed.
4
+ * @default 300
5
+ */
6
+ delay?: number;
7
+ }
8
+ /**
9
+ * Reactive debounce hook. Delays execution until a pause in calls.
10
+ *
11
+ * @example
12
+ * ```svelte
13
+ * <script>
14
+ * import { useDebounce } from 'svelora'
15
+ *
16
+ * const debounce = useDebounce({ delay: 500 })
17
+ * let query = $state('')
18
+ *
19
+ * function handleInput(e: Event) {
20
+ * query = e.currentTarget.value
21
+ * debounce.run(() => fetchResults(query))
22
+ * }
23
+ * </script>
24
+ *
25
+ * <input oninput={handleInput} />
26
+ * {#if debounce.pending}
27
+ * <Spinner />
28
+ * {/if}
29
+ * ```
30
+ */
31
+ export declare function useDebounce(options?: UseDebounceOptions): {
32
+ readonly pending: boolean;
33
+ run: (callback: () => void) => void;
34
+ cancel: () => void;
35
+ flush: (callback: () => void) => void;
36
+ };
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Reactive debounce hook. Delays execution until a pause in calls.
3
+ *
4
+ * @example
5
+ * ```svelte
6
+ * <script>
7
+ * import { useDebounce } from 'svelora'
8
+ *
9
+ * const debounce = useDebounce({ delay: 500 })
10
+ * let query = $state('')
11
+ *
12
+ * function handleInput(e: Event) {
13
+ * query = e.currentTarget.value
14
+ * debounce.run(() => fetchResults(query))
15
+ * }
16
+ * </script>
17
+ *
18
+ * <input oninput={handleInput} />
19
+ * {#if debounce.pending}
20
+ * <Spinner />
21
+ * {/if}
22
+ * ```
23
+ */
24
+ export function useDebounce(options = {}) {
25
+ const { delay = 300 } = options;
26
+ let pending = $state(false);
27
+ let timeoutId;
28
+ function run(callback) {
29
+ pending = true;
30
+ clearTimeout(timeoutId);
31
+ timeoutId = setTimeout(() => {
32
+ pending = false;
33
+ callback();
34
+ }, delay);
35
+ }
36
+ function cancel() {
37
+ clearTimeout(timeoutId);
38
+ pending = false;
39
+ }
40
+ function flush(callback) {
41
+ clearTimeout(timeoutId);
42
+ pending = false;
43
+ callback();
44
+ }
45
+ $effect(() => {
46
+ return () => clearTimeout(timeoutId);
47
+ });
48
+ return {
49
+ get pending() {
50
+ return pending;
51
+ },
52
+ run,
53
+ cancel,
54
+ flush
55
+ };
56
+ }
@@ -0,0 +1,31 @@
1
+ import type { Action } from 'svelte/action';
2
+ export interface UseEscapeKeydownOptions {
3
+ /**
4
+ * Callback fired when Escape is pressed.
5
+ */
6
+ handler: (event: KeyboardEvent) => void;
7
+ /**
8
+ * Whether the listener is active.
9
+ * @default true
10
+ */
11
+ enabled?: boolean;
12
+ }
13
+ /**
14
+ * Svelte action that listens for Escape keydown on an element or the document.
15
+ *
16
+ * @example
17
+ * ```svelte
18
+ * <script>
19
+ * import { useEscapeKeydown } from 'svelora'
20
+ *
21
+ * let open = $state(true)
22
+ * </script>
23
+ *
24
+ * {#if open}
25
+ * <div use:useEscapeKeydown={{ handler: () => (open = false) }}>
26
+ * Press Escape to close
27
+ * </div>
28
+ * {/if}
29
+ * ```
30
+ */
31
+ export declare const useEscapeKeydown: Action<HTMLElement, UseEscapeKeydownOptions>;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Svelte action that listens for Escape keydown on an element or the document.
3
+ *
4
+ * @example
5
+ * ```svelte
6
+ * <script>
7
+ * import { useEscapeKeydown } from 'svelora'
8
+ *
9
+ * let open = $state(true)
10
+ * </script>
11
+ *
12
+ * {#if open}
13
+ * <div use:useEscapeKeydown={{ handler: () => (open = false) }}>
14
+ * Press Escape to close
15
+ * </div>
16
+ * {/if}
17
+ * ```
18
+ */
19
+ export const useEscapeKeydown = (_node, initialOptions) => {
20
+ let currentOptions = initialOptions;
21
+ function handleKeydown(event) {
22
+ if (currentOptions.enabled === false)
23
+ return;
24
+ if (event.key === 'Escape') {
25
+ currentOptions.handler(event);
26
+ }
27
+ }
28
+ document.addEventListener('keydown', handleKeydown);
29
+ return {
30
+ update(newOptions) {
31
+ currentOptions = newOptions;
32
+ },
33
+ destroy() {
34
+ document.removeEventListener('keydown', handleKeydown);
35
+ }
36
+ };
37
+ };
@@ -0,0 +1,54 @@
1
+ import type { FormFieldProps } from '../FormField/form-field.types.js';
2
+ /**
3
+ * Symbol key for the FormField context. Using a Symbol instead of a string
4
+ * prevents collisions with unrelated `getContext('formField')` calls from
5
+ * user code or other libraries.
6
+ */
7
+ export declare const FORM_FIELD_CONTEXT_KEY: unique symbol;
8
+ export interface FormFieldContext {
9
+ name?: string;
10
+ size: NonNullable<FormFieldProps['size']>;
11
+ error?: string | boolean;
12
+ ariaId: string;
13
+ /** Whether input events should validate this field before first blur. */
14
+ eagerValidation?: boolean;
15
+ /** Per-field override for the input debounce delay. */
16
+ validateOnInputDelay?: number;
17
+ /** Regex pattern used to match form errors for this field (in addition to exact name). */
18
+ errorPattern?: RegExp;
19
+ }
20
+ /**
21
+ * Access the nearest FormField context. Returns `undefined` when used outside a FormField.
22
+ *
23
+ * @example
24
+ * ```svelte
25
+ * <script>
26
+ * import { useFormField } from 'svelora'
27
+ *
28
+ * const formField = useFormField()
29
+ * const hasError = $derived(formField?.error !== undefined && formField?.error !== false)
30
+ * </script>
31
+ * ```
32
+ */
33
+ export declare function useFormField(): FormFieldContext | undefined;
34
+ /**
35
+ * Event emitter helpers for inputs nested inside a `<FormField>` within a `<Form>`.
36
+ * Each returned function is a safe no-op when used outside a Form, so inputs can
37
+ * unconditionally wire them to their native events.
38
+ *
39
+ * @example
40
+ * ```svelte
41
+ * <script>
42
+ * import { useFormFieldEmit } from 'svelora'
43
+ * const emit = useFormFieldEmit()
44
+ * </script>
45
+ *
46
+ * <input onblur={emit.onBlur} oninput={emit.onInput} onchange={emit.onChange} onfocus={emit.onFocus} />
47
+ * ```
48
+ */
49
+ export declare function useFormFieldEmit(): {
50
+ onBlur(): void;
51
+ onFocus(): void;
52
+ onChange(): void;
53
+ onInput(): void;
54
+ };
@@ -0,0 +1,65 @@
1
+ import { getContext } from 'svelte';
2
+ import { getFormContext } from '../Form/form.context.svelte.js';
3
+ /**
4
+ * Symbol key for the FormField context. Using a Symbol instead of a string
5
+ * prevents collisions with unrelated `getContext('formField')` calls from
6
+ * user code or other libraries.
7
+ */
8
+ export const FORM_FIELD_CONTEXT_KEY = Symbol('svelora:form-field');
9
+ /**
10
+ * Access the nearest FormField context. Returns `undefined` when used outside a FormField.
11
+ *
12
+ * @example
13
+ * ```svelte
14
+ * <script>
15
+ * import { useFormField } from 'svelora'
16
+ *
17
+ * const formField = useFormField()
18
+ * const hasError = $derived(formField?.error !== undefined && formField?.error !== false)
19
+ * </script>
20
+ * ```
21
+ */
22
+ export function useFormField() {
23
+ return getContext(FORM_FIELD_CONTEXT_KEY);
24
+ }
25
+ /**
26
+ * Event emitter helpers for inputs nested inside a `<FormField>` within a `<Form>`.
27
+ * Each returned function is a safe no-op when used outside a Form, so inputs can
28
+ * unconditionally wire them to their native events.
29
+ *
30
+ * @example
31
+ * ```svelte
32
+ * <script>
33
+ * import { useFormFieldEmit } from 'svelora'
34
+ * const emit = useFormFieldEmit()
35
+ * </script>
36
+ *
37
+ * <input onblur={emit.onBlur} oninput={emit.onInput} onchange={emit.onChange} onfocus={emit.onFocus} />
38
+ * ```
39
+ */
40
+ export function useFormFieldEmit() {
41
+ const fieldCtx = getContext(FORM_FIELD_CONTEXT_KEY);
42
+ const formCtx = getFormContext();
43
+ return {
44
+ onBlur() {
45
+ const n = fieldCtx?.name;
46
+ if (n)
47
+ formCtx?.onBlur(n);
48
+ },
49
+ onFocus() {
50
+ const n = fieldCtx?.name;
51
+ if (n)
52
+ formCtx?.onFocus(n);
53
+ },
54
+ onChange() {
55
+ const n = fieldCtx?.name;
56
+ if (n)
57
+ formCtx?.onChange(n);
58
+ },
59
+ onInput() {
60
+ const n = fieldCtx?.name;
61
+ if (n)
62
+ formCtx?.onInput(n, fieldCtx?.eagerValidation);
63
+ }
64
+ };
65
+ }
@@ -0,0 +1,57 @@
1
+ import type { Action } from 'svelte/action';
2
+ export interface UseInfiniteScrollOptions {
3
+ /**
4
+ * Callback fired when the user scrolls near the bottom.
5
+ * Return a promise to automatically manage the loading state.
6
+ */
7
+ onLoad: () => void | Promise<void>;
8
+ /**
9
+ * Distance in pixels from the bottom to trigger loading.
10
+ * @default 100
11
+ */
12
+ threshold?: number;
13
+ /**
14
+ * Whether the hook is active. Set to `false` when all data is loaded.
15
+ * Supports getter function for reactive control.
16
+ * @default true
17
+ */
18
+ enabled?: boolean | (() => boolean);
19
+ }
20
+ export interface UseInfiniteScrollReturn {
21
+ /** Whether an async onLoad is currently in progress */
22
+ readonly loading: boolean;
23
+ }
24
+ /**
25
+ * Reactive infinite scroll hook with Svelte action.
26
+ *
27
+ * @example
28
+ * ```svelte
29
+ * <script>
30
+ * import { useInfiniteScroll } from 'svelora'
31
+ *
32
+ * let items = $state([...])
33
+ * let hasMore = $state(true)
34
+ *
35
+ * const scroll = useInfiniteScroll({
36
+ * onLoad: async () => {
37
+ * const next = await fetchMore()
38
+ * items.push(...next)
39
+ * if (next.length === 0) hasMore = false
40
+ * },
41
+ * enabled: () => hasMore
42
+ * })
43
+ * </script>
44
+ *
45
+ * <div use:scroll.action>
46
+ * {#each items as item (item.id)}
47
+ * <div>{item.name}</div>
48
+ * {/each}
49
+ * {#if scroll.loading}
50
+ * <Spinner />
51
+ * {/if}
52
+ * </div>
53
+ * ```
54
+ */
55
+ export declare function useInfiniteScroll(options: UseInfiniteScrollOptions): UseInfiniteScrollReturn & {
56
+ action: Action<HTMLElement>;
57
+ };
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Reactive infinite scroll hook with Svelte action.
3
+ *
4
+ * @example
5
+ * ```svelte
6
+ * <script>
7
+ * import { useInfiniteScroll } from 'svelora'
8
+ *
9
+ * let items = $state([...])
10
+ * let hasMore = $state(true)
11
+ *
12
+ * const scroll = useInfiniteScroll({
13
+ * onLoad: async () => {
14
+ * const next = await fetchMore()
15
+ * items.push(...next)
16
+ * if (next.length === 0) hasMore = false
17
+ * },
18
+ * enabled: () => hasMore
19
+ * })
20
+ * </script>
21
+ *
22
+ * <div use:scroll.action>
23
+ * {#each items as item (item.id)}
24
+ * <div>{item.name}</div>
25
+ * {/each}
26
+ * {#if scroll.loading}
27
+ * <Spinner />
28
+ * {/if}
29
+ * </div>
30
+ * ```
31
+ */
32
+ export function useInfiniteScroll(options) {
33
+ const { onLoad, threshold = 100 } = options;
34
+ let loading = $state(false);
35
+ function getEnabled() {
36
+ return typeof options.enabled === 'function' ? options.enabled() : (options.enabled ?? true);
37
+ }
38
+ async function check(el) {
39
+ if (loading || !getEnabled())
40
+ return;
41
+ const { scrollTop, scrollHeight, clientHeight } = el;
42
+ if (scrollHeight - scrollTop - clientHeight > threshold)
43
+ return;
44
+ loading = true;
45
+ try {
46
+ await onLoad();
47
+ }
48
+ finally {
49
+ loading = false;
50
+ }
51
+ }
52
+ const action = (node) => {
53
+ function handleScroll() {
54
+ check(node);
55
+ }
56
+ node.addEventListener('scroll', handleScroll, { passive: true });
57
+ return {
58
+ destroy() {
59
+ node.removeEventListener('scroll', handleScroll);
60
+ }
61
+ };
62
+ };
63
+ return {
64
+ get loading() {
65
+ return loading;
66
+ },
67
+ action
68
+ };
69
+ }
@@ -0,0 +1,31 @@
1
+ export interface UseMediaQueryOptions {
2
+ /**
3
+ * Initial value before the media query is evaluated (SSR-safe).
4
+ * @default false
5
+ */
6
+ initialValue?: boolean;
7
+ }
8
+ export interface UseMediaQueryReturn {
9
+ /** Whether the media query currently matches */
10
+ readonly matches: boolean;
11
+ }
12
+ /**
13
+ * Reactive media query hook. Tracks whether a CSS media query matches.
14
+ *
15
+ * @example
16
+ * ```svelte
17
+ * <script>
18
+ * import { useMediaQuery } from 'svelora'
19
+ *
20
+ * const isMobile = useMediaQuery('(max-width: 640px)')
21
+ * const prefersDark = useMediaQuery('(prefers-color-scheme: dark)')
22
+ * </script>
23
+ *
24
+ * {#if isMobile.matches}
25
+ * <MobileLayout />
26
+ * {:else}
27
+ * <DesktopLayout />
28
+ * {/if}
29
+ * ```
30
+ */
31
+ export declare function useMediaQuery(query: string | (() => string), options?: UseMediaQueryOptions): UseMediaQueryReturn;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Reactive media query hook. Tracks whether a CSS media query matches.
3
+ *
4
+ * @example
5
+ * ```svelte
6
+ * <script>
7
+ * import { useMediaQuery } from 'svelora'
8
+ *
9
+ * const isMobile = useMediaQuery('(max-width: 640px)')
10
+ * const prefersDark = useMediaQuery('(prefers-color-scheme: dark)')
11
+ * </script>
12
+ *
13
+ * {#if isMobile.matches}
14
+ * <MobileLayout />
15
+ * {:else}
16
+ * <DesktopLayout />
17
+ * {/if}
18
+ * ```
19
+ */
20
+ export function useMediaQuery(query, options = {}) {
21
+ const { initialValue = false } = options;
22
+ const resolveQuery = typeof query === 'function' ? query : () => query;
23
+ let matches = $state(initialValue);
24
+ $effect(() => {
25
+ const mediaQuery = window.matchMedia(resolveQuery());
26
+ matches = mediaQuery.matches;
27
+ function handler(event) {
28
+ matches = event.matches;
29
+ }
30
+ mediaQuery.addEventListener('change', handler);
31
+ return () => mediaQuery.removeEventListener('change', handler);
32
+ });
33
+ return {
34
+ get matches() {
35
+ return matches;
36
+ }
37
+ };
38
+ }