@torpor/ui 0.2.0 → 0.3.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 (312) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/Accordion/Accordion.torp +44 -25
  3. package/dist/Accordion/AccordionContent.torp +18 -12
  4. package/dist/Accordion/AccordionHeader.torp +15 -8
  5. package/dist/Accordion/AccordionItem.torp +34 -17
  6. package/dist/Accordion/AccordionTrigger.torp +17 -10
  7. package/dist/Accordion/AccordionTypes.ts +6 -3
  8. package/dist/Accordion/index.d.ts +100 -35
  9. package/dist/Breadcrumb/Breadcrumb.torp +18 -10
  10. package/dist/Breadcrumb/BreadcrumbItem.torp +14 -7
  11. package/dist/Breadcrumb/BreadcrumbSeparator.torp +10 -3
  12. package/dist/Breadcrumb/index.d.ts +50 -21
  13. package/dist/Calendar/Calendar.torp +21 -14
  14. package/dist/Calendar/CalendarDay.torp +12 -4
  15. package/dist/Calendar/index.d.ts +16 -18
  16. package/dist/Contextual/Contextual.torp +125 -0
  17. package/dist/{Popover/PopoverContentContextual.torp → Contextual/ContextualContent.torp} +21 -12
  18. package/dist/Contextual/ContextualTrigger.torp +66 -0
  19. package/dist/Contextual/ContextualTypes.ts +30 -0
  20. package/dist/Contextual/index.d.ts +90 -0
  21. package/dist/Contextual/index.js +14 -0
  22. package/dist/Contextual/index.js.map +1 -0
  23. package/dist/Dialog/Dialog.torp +49 -73
  24. package/dist/Dialog/DialogBody.torp +15 -9
  25. package/dist/Dialog/DialogButton.torp +27 -13
  26. package/dist/Dialog/DialogFooter.torp +11 -3
  27. package/dist/Dialog/DialogHeader.torp +15 -8
  28. package/dist/Dialog/DialogTypes.ts +3 -2
  29. package/dist/Dialog/index.d.ts +83 -35
  30. package/dist/Disclosure/Disclosure.torp +34 -25
  31. package/dist/Disclosure/DisclosureContent.torp +18 -12
  32. package/dist/Disclosure/DisclosureHeader.torp +16 -9
  33. package/dist/Disclosure/DisclosureTrigger.torp +15 -8
  34. package/dist/Disclosure/DisclosureTypes.ts +0 -1
  35. package/dist/Disclosure/index.d.ts +67 -28
  36. package/dist/Drawer/Drawer.torp +109 -68
  37. package/dist/Drawer/DrawerContent.torp +80 -0
  38. package/dist/Drawer/DrawerOverlay.torp +38 -0
  39. package/dist/Drawer/DrawerTrigger.torp +35 -0
  40. package/dist/Drawer/DrawerTypes.ts +24 -0
  41. package/dist/Drawer/index.d.ts +96 -8
  42. package/dist/Drawer/index.js +13 -1
  43. package/dist/Form/Field.torp +91 -0
  44. package/dist/Form/Form.torp +129 -0
  45. package/dist/Form/FormTypes.ts +30 -0
  46. package/dist/Form/Input.torp +97 -0
  47. package/dist/Form/Label.torp +31 -0
  48. package/dist/Form/Message.torp +35 -0
  49. package/dist/Form/StandardSchemaV1.ts +70 -0
  50. package/dist/Form/index.d.ts +131 -0
  51. package/dist/Form/index.js +22 -0
  52. package/dist/Form/index.js.map +1 -0
  53. package/dist/Menu/Menu.torp +25 -15
  54. package/dist/Menu/MenuButton.torp +30 -13
  55. package/dist/Menu/MenuCheck.torp +29 -14
  56. package/dist/Menu/MenuGroup.torp +14 -6
  57. package/dist/Menu/MenuIndicator.torp +14 -7
  58. package/dist/Menu/MenuPopout.torp +23 -15
  59. package/dist/Menu/MenuPopoutContent.torp +17 -10
  60. package/dist/Menu/MenuPopoutTrigger.torp +23 -16
  61. package/dist/Menu/MenuRadio.torp +27 -16
  62. package/dist/Menu/MenuRadioGroup.torp +34 -15
  63. package/dist/Menu/MenuSeparator.torp +11 -3
  64. package/dist/Menu/MenuTypes.ts +7 -5
  65. package/dist/Menu/index.d.ts +176 -77
  66. package/dist/MenuBar/MenuBar.torp +24 -16
  67. package/dist/MenuBar/MenuBarItem.torp +24 -16
  68. package/dist/MenuBar/MenuBarItemContent.torp +18 -11
  69. package/dist/MenuBar/MenuBarItemTrigger.torp +15 -9
  70. package/dist/MenuBar/index.d.ts +79 -28
  71. package/dist/Modal/Modal.torp +118 -0
  72. package/dist/Modal/ModalContent.torp +77 -0
  73. package/dist/Modal/ModalOverlay.torp +38 -0
  74. package/dist/Modal/ModalTrigger.torp +50 -0
  75. package/dist/Modal/ModalTypes.ts +22 -0
  76. package/dist/Modal/index.d.ts +108 -0
  77. package/dist/Modal/index.js +33 -0
  78. package/dist/Modal/index.js.map +1 -0
  79. package/dist/Modal/showModal.ts +19 -0
  80. package/dist/Modal/showPrompt.ts +23 -0
  81. package/dist/NavMenu/NavMenu.torp +18 -10
  82. package/dist/NavMenu/NavMenuButton.torp +15 -10
  83. package/dist/NavMenu/NavMenuElement.torp +19 -11
  84. package/dist/NavMenu/NavMenuGroup.torp +13 -6
  85. package/dist/NavMenu/NavMenuGroupHeader.torp +15 -8
  86. package/dist/NavMenu/NavMenuLink.torp +21 -16
  87. package/dist/NavMenu/NavMenuPopout.torp +34 -18
  88. package/dist/NavMenu/NavMenuPopoutButton.torp +23 -18
  89. package/dist/NavMenu/NavMenuPopoutContent.torp +23 -13
  90. package/dist/NavMenu/NavMenuSeparator.torp +10 -3
  91. package/dist/NavMenu/index.d.ts +153 -70
  92. package/dist/Notification/Notification.torp +35 -16
  93. package/dist/Notification/NotificationClose.torp +10 -3
  94. package/dist/Notification/NotificationContainer.torp +11 -3
  95. package/dist/Notification/NotificationContent.torp +11 -3
  96. package/dist/Notification/index.d.ts +46 -28
  97. package/dist/Popover/Popover.torp +48 -28
  98. package/dist/Popover/PopoverContent.torp +42 -8
  99. package/dist/Popover/PopoverTrigger.torp +32 -3
  100. package/dist/Popover/PopoverTypes.ts +1 -1
  101. package/dist/Popover/index.d.ts +48 -111
  102. package/dist/Popover/index.js +1 -163
  103. package/dist/Popover/index.js.map +1 -1
  104. package/dist/TabGroup/TabContent.torp +20 -11
  105. package/dist/TabGroup/TabGroup.torp +58 -40
  106. package/dist/TabGroup/TabGroupTypes.ts +10 -5
  107. package/dist/TabGroup/TabHeader.torp +26 -10
  108. package/dist/TabGroup/TabList.torp +14 -7
  109. package/dist/TabGroup/TabTrigger.torp +17 -10
  110. package/dist/TabGroup/index.d.ts +101 -35
  111. package/dist/icons/ArrowDown.torp +5 -3
  112. package/dist/icons/ArrowLeft.torp +5 -3
  113. package/dist/icons/ArrowRight.torp +5 -3
  114. package/dist/icons/ArrowUp.torp +5 -3
  115. package/dist/icons/Bars.torp +5 -3
  116. package/dist/icons/Check.torp +5 -3
  117. package/dist/icons/ChevronDown.torp +5 -3
  118. package/dist/icons/ChevronLeft.torp +5 -3
  119. package/dist/icons/ChevronRight.torp +5 -3
  120. package/dist/icons/ChevronUp.torp +5 -3
  121. package/dist/icons/Cross.torp +5 -3
  122. package/dist/icons/IconTypes.ts +6 -0
  123. package/dist/icons/Loading.torp +5 -3
  124. package/dist/icons/Minus.torp +5 -3
  125. package/dist/icons/Plus.torp +5 -3
  126. package/dist/icons/index.d.ts +271 -126
  127. package/dist/index.d.ts +17 -4
  128. package/dist/metafile-esm.json +1 -1
  129. package/dist/motion/fade.ts +15 -6
  130. package/dist/motion/grow.ts +23 -0
  131. package/dist/motion/index.d.ts +19 -2
  132. package/dist/motion/index.js +93 -3
  133. package/dist/motion/index.js.map +1 -1
  134. package/dist/motion/measure.ts +28 -0
  135. package/dist/motion/slide.ts +45 -0
  136. package/dist/mount/clickPopover.ts +51 -0
  137. package/dist/mount/contextPopover.ts +51 -0
  138. package/dist/mount/hoverPopover.ts +58 -0
  139. package/package.json +28 -12
  140. package/scripts/postbuild.ts +11 -1
  141. package/src/Accordion/Accordion.torp +44 -25
  142. package/src/Accordion/AccordionContent.torp +18 -12
  143. package/src/Accordion/AccordionHeader.torp +15 -8
  144. package/src/Accordion/AccordionItem.torp +34 -17
  145. package/src/Accordion/AccordionTrigger.torp +17 -10
  146. package/src/Accordion/AccordionTypes.ts +6 -3
  147. package/src/Breadcrumb/Breadcrumb.torp +18 -10
  148. package/src/Breadcrumb/BreadcrumbItem.torp +14 -7
  149. package/src/Breadcrumb/BreadcrumbSeparator.torp +10 -3
  150. package/src/Calendar/Calendar.torp +21 -14
  151. package/src/Calendar/CalendarDay.torp +12 -4
  152. package/src/Contextual/Contextual.torp +125 -0
  153. package/src/{Popover/PopoverContentContextual.torp → Contextual/ContextualContent.torp} +21 -12
  154. package/src/Contextual/ContextualTrigger.torp +66 -0
  155. package/src/Contextual/ContextualTypes.ts +30 -0
  156. package/src/Contextual/index.ts +5 -0
  157. package/src/Dialog/Dialog.torp +49 -73
  158. package/src/Dialog/DialogBody.torp +15 -9
  159. package/src/Dialog/DialogButton.torp +27 -13
  160. package/src/Dialog/DialogFooter.torp +11 -3
  161. package/src/Dialog/DialogHeader.torp +15 -8
  162. package/src/Dialog/DialogTypes.ts +3 -2
  163. package/src/Disclosure/Disclosure.torp +34 -25
  164. package/src/Disclosure/DisclosureContent.torp +18 -12
  165. package/src/Disclosure/DisclosureHeader.torp +16 -9
  166. package/src/Disclosure/DisclosureTrigger.torp +15 -8
  167. package/src/Disclosure/DisclosureTypes.ts +0 -1
  168. package/src/Drawer/Drawer.torp +109 -68
  169. package/src/Drawer/DrawerContent.torp +80 -0
  170. package/src/Drawer/DrawerOverlay.torp +38 -0
  171. package/src/Drawer/DrawerTrigger.torp +35 -0
  172. package/src/Drawer/DrawerTypes.ts +24 -0
  173. package/src/Drawer/index.ts +4 -1
  174. package/src/Form/Field.torp +91 -0
  175. package/src/Form/Form.torp +129 -0
  176. package/src/Form/FormTypes.ts +30 -0
  177. package/src/Form/Input.torp +97 -0
  178. package/src/Form/Label.torp +31 -0
  179. package/src/Form/Message.torp +35 -0
  180. package/src/Form/StandardSchemaV1.ts +70 -0
  181. package/src/Form/index.ts +7 -0
  182. package/src/Menu/Menu.torp +25 -15
  183. package/src/Menu/MenuButton.torp +30 -13
  184. package/src/Menu/MenuCheck.torp +29 -14
  185. package/src/Menu/MenuGroup.torp +14 -6
  186. package/src/Menu/MenuIndicator.torp +14 -7
  187. package/src/Menu/MenuPopout.torp +23 -15
  188. package/src/Menu/MenuPopoutContent.torp +17 -10
  189. package/src/Menu/MenuPopoutTrigger.torp +23 -16
  190. package/src/Menu/MenuRadio.torp +27 -16
  191. package/src/Menu/MenuRadioGroup.torp +34 -15
  192. package/src/Menu/MenuSeparator.torp +11 -3
  193. package/src/Menu/MenuTypes.ts +7 -5
  194. package/src/MenuBar/MenuBar.torp +24 -16
  195. package/src/MenuBar/MenuBarItem.torp +24 -16
  196. package/src/MenuBar/MenuBarItemContent.torp +18 -11
  197. package/src/MenuBar/MenuBarItemTrigger.torp +15 -9
  198. package/src/Modal/Modal.torp +118 -0
  199. package/src/Modal/ModalContent.torp +77 -0
  200. package/src/Modal/ModalOverlay.torp +38 -0
  201. package/src/Modal/ModalTrigger.torp +50 -0
  202. package/src/Modal/ModalTypes.ts +22 -0
  203. package/src/Modal/index.ts +10 -0
  204. package/src/Modal/showModal.ts +19 -0
  205. package/src/Modal/showPrompt.ts +23 -0
  206. package/src/NavMenu/NavMenu.torp +18 -10
  207. package/src/NavMenu/NavMenuButton.torp +15 -10
  208. package/src/NavMenu/NavMenuElement.torp +19 -11
  209. package/src/NavMenu/NavMenuGroup.torp +13 -6
  210. package/src/NavMenu/NavMenuGroupHeader.torp +15 -8
  211. package/src/NavMenu/NavMenuLink.torp +21 -16
  212. package/src/NavMenu/NavMenuPopout.torp +34 -18
  213. package/src/NavMenu/NavMenuPopoutButton.torp +23 -18
  214. package/src/NavMenu/NavMenuPopoutContent.torp +23 -13
  215. package/src/NavMenu/NavMenuSeparator.torp +10 -3
  216. package/src/Notification/Notification.torp +35 -16
  217. package/src/Notification/NotificationClose.torp +10 -3
  218. package/src/Notification/NotificationContainer.torp +11 -3
  219. package/src/Notification/NotificationContent.torp +11 -3
  220. package/src/Popover/Popover.torp +48 -28
  221. package/src/Popover/PopoverContent.torp +42 -8
  222. package/src/Popover/PopoverTrigger.torp +32 -3
  223. package/src/Popover/PopoverTypes.ts +1 -1
  224. package/src/Popover/index.ts +1 -24
  225. package/src/Slider/Slider.torp +3 -3
  226. package/src/TabGroup/TabContent.torp +20 -11
  227. package/src/TabGroup/TabGroup.torp +58 -40
  228. package/src/TabGroup/TabGroupTypes.ts +10 -5
  229. package/src/TabGroup/TabHeader.torp +26 -10
  230. package/src/TabGroup/TabList.torp +14 -7
  231. package/src/TabGroup/TabTrigger.torp +17 -10
  232. package/src/icons/ArrowDown.torp +5 -3
  233. package/src/icons/ArrowLeft.torp +5 -3
  234. package/src/icons/ArrowRight.torp +5 -3
  235. package/src/icons/ArrowUp.torp +5 -3
  236. package/src/icons/Bars.torp +5 -3
  237. package/src/icons/Check.torp +5 -3
  238. package/src/icons/ChevronDown.torp +5 -3
  239. package/src/icons/ChevronLeft.torp +5 -3
  240. package/src/icons/ChevronRight.torp +5 -3
  241. package/src/icons/ChevronUp.torp +5 -3
  242. package/src/icons/Cross.torp +5 -3
  243. package/src/icons/IconTypes.ts +6 -0
  244. package/src/icons/Loading.torp +5 -3
  245. package/src/icons/Minus.torp +5 -3
  246. package/src/icons/Plus.torp +5 -3
  247. package/src/motion/fade.ts +15 -6
  248. package/src/motion/grow.ts +23 -0
  249. package/src/motion/index.ts +4 -1
  250. package/src/motion/measure.ts +28 -0
  251. package/src/motion/slide.ts +45 -0
  252. package/src/mount/clickPopover.ts +51 -0
  253. package/src/mount/contextPopover.ts +51 -0
  254. package/src/mount/hoverPopover.ts +58 -0
  255. package/test/Accordion/components/AccordionAccessibility.torp +1 -1
  256. package/test/Accordion/components/AccordionKeyboard.torp +1 -1
  257. package/test/Accordion/components/AccordionList.torp +1 -1
  258. package/test/Accordion/components/AccordionMultiple.torp +2 -2
  259. package/test/Accordion/components/AccordionSingle.torp +2 -2
  260. package/test/Dialog/accessibility-modal.test.ts +2 -2
  261. package/test/Dialog/components/DialogAccessibility.torp +8 -14
  262. package/test/Dialog/components/DialogFunction.torp +20 -4
  263. package/test/Dialog/components/DialogModal.torp +30 -0
  264. package/test/Dialog/components/DialogVariable.torp +7 -7
  265. package/test/Disclosure/accessibility.test.ts +3 -2
  266. package/test/Disclosure/components/DisclosureTest.torp +1 -1
  267. package/test/Disclosure/toggle.test.ts +3 -2
  268. package/test/Form/components/FieldTest.torp +25 -0
  269. package/test/Form/components/FormTest.torp +31 -0
  270. package/test/Form/components/InputTest.torp +9 -0
  271. package/test/Form/field.test.ts +34 -0
  272. package/test/Form/form.test.ts +34 -0
  273. package/test/Form/input.test.ts +19 -0
  274. package/test/Menu/accessibility.test.ts +3 -2
  275. package/test/Menu/basic.test.ts +11 -10
  276. package/test/Menu/components/MenuAccessibility.torp +5 -5
  277. package/test/Menu/components/MenuBasic.torp +5 -5
  278. package/test/MenuBar/accessibility.test.ts +3 -2
  279. package/test/MenuBar/basic.test.ts +3 -2
  280. package/test/NavMenu/basic.test.ts +1 -1
  281. package/test/NavMenu/components/{NavMenu.torp → NavMenuBasic.torp} +1 -1
  282. package/test/Notification/components/NotificationFunction.torp +0 -3
  283. package/test/Notification/components/NotificationVariable.torp +1 -1
  284. package/test/Popover/components/PopoverFunction.torp +37 -0
  285. package/test/Popover/components/PopoverTrigger.torp +36 -0
  286. package/test/Popover/components/{PromptVariable.torp → PopoverVariable.torp} +5 -3
  287. package/test/Popover/function.test.ts +2 -7
  288. package/test/Popover/trigger.test.ts +27 -0
  289. package/test/Popover/variable.test.ts +2 -2
  290. package/test/TabGroup/components/TabGroupAccessibility.torp +1 -1
  291. package/test/TabGroup/components/TabGroupKeyboard.torp +1 -1
  292. package/test/TabGroup/components/TabGroupList.torp +1 -1
  293. package/test/TabGroup/components/TabGroupTrigger.torp +1 -1
  294. package/tsup.config.ts +3 -1
  295. package/dist/Popover/PopoverContentAnchored.torp +0 -106
  296. package/dist/Popover/PopoverOverlay.torp +0 -30
  297. package/dist/Popover/PopoverTriggerContextual.torp +0 -37
  298. package/dist/Popover/PopoverTriggerHover.torp +0 -38
  299. package/dist/Popover/mountClickPopover.ts +0 -50
  300. package/dist/Popover/mountContextPopover.ts +0 -50
  301. package/dist/Popover/mountHoverPopover.ts +0 -57
  302. package/dist/Popover/showPopoverPrompt.ts +0 -23
  303. package/src/Popover/PopoverContentAnchored.torp +0 -106
  304. package/src/Popover/PopoverOverlay.torp +0 -30
  305. package/src/Popover/PopoverTriggerContextual.torp +0 -37
  306. package/src/Popover/PopoverTriggerHover.torp +0 -38
  307. package/src/Popover/mountClickPopover.ts +0 -50
  308. package/src/Popover/mountContextPopover.ts +0 -50
  309. package/src/Popover/mountHoverPopover.ts +0 -57
  310. package/src/Popover/showPopoverPrompt.ts +0 -23
  311. package/test/Dialog/components/CustomDialog.torp +0 -20
  312. package/test/Popover/components/PromptFunction.torp +0 -19
@@ -1,252 +1,397 @@
1
1
  import { type SlotRender } from "@torpor/view";
2
2
 
3
3
 
4
- /**
5
- * Mounts or hydrates the component into the supplied parent node.
6
- * @param $parent -- The parent node.
7
- * @param $anchor -- The node to mount the component before.
8
- * @param $props -- The values that have been passed into the component as properties.
9
- * @param $context -- Values that have been passed into the component from its ancestors.
10
- * @param $slots -- Functions for rendering children into slot nodes within the component.
11
- */
4
+ type IconProps } from "./IconTypes";
5
+
6
+ export default function ArrowDown($props: IconProps | undefined) {
7
+ @render {
8
+ <svg
9
+ {$props?.id}
10
+ class={`torp-icon ${$props?.class ?? ""}`.trim()}
11
+ viewBox="0 0 100 100"
12
+ stroke-linejoin="round"
13
+ stroke-width="12"
14
+ >
15
+ <g>
16
+ <polygon points="25,40 50,70 75,40" />
17
+ </g>
18
+ </svg>
19
+ }
20
+ }
21
+
12
22
  declare function ArrowDown(
13
23
  $parent: ParentNode,
14
24
  $anchor: Node | null,
15
- $props?: Record<PropertyKey, any>,
25
+ $props: IconProps | undefined,
16
26
  $context?: Record<PropertyKey, any>,
17
27
  $slots?: Record<string, SlotRender>,
18
28
  ): void;
19
29
 
20
30
 
21
31
 
22
- /**
23
- * Mounts or hydrates the component into the supplied parent node.
24
- * @param $parent -- The parent node.
25
- * @param $anchor -- The node to mount the component before.
26
- * @param $props -- The values that have been passed into the component as properties.
27
- * @param $context -- Values that have been passed into the component from its ancestors.
28
- * @param $slots -- Functions for rendering children into slot nodes within the component.
29
- */
32
+ type IconProps } from "./IconTypes";
33
+
34
+ export default function ArrowLeft($props: IconProps | undefined) {
35
+ @render {
36
+ <svg
37
+ {$props?.id}
38
+ class={`torp-icon ${$props?.class ?? ""}`.trim()}
39
+ viewBox="0 0 100 100"
40
+ stroke-linejoin="round"
41
+ stroke-width="12"
42
+ >
43
+ <g>
44
+ <polygon points="60,25 30,50 60,75" />
45
+ </g>
46
+ </svg>
47
+ }
48
+ }
49
+
30
50
  declare function ArrowLeft(
31
51
  $parent: ParentNode,
32
52
  $anchor: Node | null,
33
- $props?: Record<PropertyKey, any>,
53
+ $props: IconProps | undefined,
34
54
  $context?: Record<PropertyKey, any>,
35
55
  $slots?: Record<string, SlotRender>,
36
56
  ): void;
37
57
 
38
58
 
39
59
 
40
- /**
41
- * Mounts or hydrates the component into the supplied parent node.
42
- * @param $parent -- The parent node.
43
- * @param $anchor -- The node to mount the component before.
44
- * @param $props -- The values that have been passed into the component as properties.
45
- * @param $context -- Values that have been passed into the component from its ancestors.
46
- * @param $slots -- Functions for rendering children into slot nodes within the component.
47
- */
60
+ type IconProps } from "./IconTypes";
61
+
62
+ export default function ArrowRight($props: IconProps | any) {
63
+ @render {
64
+ <svg
65
+ {$props?.id}
66
+ class={`torp-icon ${$props?.class ?? ""}`.trim()}
67
+ viewBox="0 0 100 100"
68
+ stroke-linejoin="round"
69
+ stroke-width="12"
70
+ >
71
+ <g>
72
+ <polygon points="40,25 70,50 40,75" />
73
+ </g>
74
+ </svg>
75
+ }
76
+ }
77
+
48
78
  declare function ArrowRight(
49
79
  $parent: ParentNode,
50
80
  $anchor: Node | null,
51
- $props?: Record<PropertyKey, any>,
81
+ $props: IconProps | any,
52
82
  $context?: Record<PropertyKey, any>,
53
83
  $slots?: Record<string, SlotRender>,
54
84
  ): void;
55
85
 
56
86
 
57
87
 
58
- /**
59
- * Mounts or hydrates the component into the supplied parent node.
60
- * @param $parent -- The parent node.
61
- * @param $anchor -- The node to mount the component before.
62
- * @param $props -- The values that have been passed into the component as properties.
63
- * @param $context -- Values that have been passed into the component from its ancestors.
64
- * @param $slots -- Functions for rendering children into slot nodes within the component.
65
- */
88
+ type IconProps } from "./IconTypes";
89
+
90
+ export default function ArrowUp($props: IconProps | undefined) {
91
+ @render {
92
+ <svg
93
+ {$props?.id}
94
+ class={`torp-icon ${$props?.class ?? ""}`.trim()}
95
+ viewBox="0 0 100 100"
96
+ stroke-linejoin="round"
97
+ stroke-width="12"
98
+ >
99
+ <g>
100
+ <polygon points="25,60 50,30 75,60" />
101
+ </g>
102
+ </svg>
103
+ }
104
+ }
105
+
66
106
  declare function ArrowUp(
67
107
  $parent: ParentNode,
68
108
  $anchor: Node | null,
69
- $props?: Record<PropertyKey, any>,
109
+ $props: IconProps | undefined,
70
110
  $context?: Record<PropertyKey, any>,
71
111
  $slots?: Record<string, SlotRender>,
72
112
  ): void;
73
113
 
74
114
 
75
115
 
76
- /**
77
- * Mounts or hydrates the component into the supplied parent node.
78
- * @param $parent -- The parent node.
79
- * @param $anchor -- The node to mount the component before.
80
- * @param $props -- The values that have been passed into the component as properties.
81
- * @param $context -- Values that have been passed into the component from its ancestors.
82
- * @param $slots -- Functions for rendering children into slot nodes within the component.
83
- */
116
+ type IconProps } from "./IconTypes";
117
+
118
+ export default function Bars($props: IconProps | undefined) {
119
+ @render {
120
+ <svg
121
+ {$props?.id}
122
+ class={`torp-icon ${$props?.class ?? ""}`.trim()}
123
+ viewBox="0 0 100 100"
124
+ stroke-linejoin="round"
125
+ stroke-width="12"
126
+ >
127
+ <g>
128
+ <path d="M10,25 L90,25" />
129
+ <path d="M10,50 L90,50" />
130
+ <path d="M10,75 L90,75" />
131
+ </g>
132
+ </svg>
133
+ }
134
+ }
135
+
84
136
  declare function Bars(
85
137
  $parent: ParentNode,
86
138
  $anchor: Node | null,
87
- $props?: Record<PropertyKey, any>,
139
+ $props: IconProps | undefined,
88
140
  $context?: Record<PropertyKey, any>,
89
141
  $slots?: Record<string, SlotRender>,
90
142
  ): void;
91
143
 
92
144
 
93
145
 
94
- /**
95
- * Mounts or hydrates the component into the supplied parent node.
96
- * @param $parent -- The parent node.
97
- * @param $anchor -- The node to mount the component before.
98
- * @param $props -- The values that have been passed into the component as properties.
99
- * @param $context -- Values that have been passed into the component from its ancestors.
100
- * @param $slots -- Functions for rendering children into slot nodes within the component.
101
- */
146
+ type IconProps } from "./IconTypes";
147
+
148
+ export default function Check($props: IconProps | undefined) {
149
+ @render {
150
+ <svg
151
+ {$props?.id}
152
+ class={`torp-icon ${$props?.class ?? ""}`.trim()}
153
+ viewBox="0 0 100 100"
154
+ stroke-linejoin="round"
155
+ stroke-width="12"
156
+ >
157
+ <g>
158
+ <path d="M10,55 L35,80 L90,25" fill="none" />
159
+ </g>
160
+ </svg>
161
+ }
162
+ }
163
+
102
164
  declare function Check(
103
165
  $parent: ParentNode,
104
166
  $anchor: Node | null,
105
- $props?: Record<PropertyKey, any>,
167
+ $props: IconProps | undefined,
106
168
  $context?: Record<PropertyKey, any>,
107
169
  $slots?: Record<string, SlotRender>,
108
170
  ): void;
109
171
 
110
172
 
111
173
 
112
- /**
113
- * Mounts or hydrates the component into the supplied parent node.
114
- * @param $parent -- The parent node.
115
- * @param $anchor -- The node to mount the component before.
116
- * @param $props -- The values that have been passed into the component as properties.
117
- * @param $context -- Values that have been passed into the component from its ancestors.
118
- * @param $slots -- Functions for rendering children into slot nodes within the component.
119
- */
174
+ type IconProps } from "./IconTypes";
175
+
176
+ export default function ChevronDown($props: IconProps | undefined) {
177
+ @render {
178
+ <svg
179
+ {$props?.id}
180
+ class={`torp-icon ${$props?.class ?? ""}`.trim()}
181
+ viewBox="0 0 100 100"
182
+ stroke-linejoin="round"
183
+ stroke-width="12"
184
+ >
185
+ <g>
186
+ <path d="M10,30 L50,70 L90,30" fill="none" />
187
+ </g>
188
+ </svg>
189
+ }
190
+ }
191
+
120
192
  declare function ChevronDown(
121
193
  $parent: ParentNode,
122
194
  $anchor: Node | null,
123
- $props?: Record<PropertyKey, any>,
195
+ $props: IconProps | undefined,
124
196
  $context?: Record<PropertyKey, any>,
125
197
  $slots?: Record<string, SlotRender>,
126
198
  ): void;
127
199
 
128
200
 
129
201
 
130
- /**
131
- * Mounts or hydrates the component into the supplied parent node.
132
- * @param $parent -- The parent node.
133
- * @param $anchor -- The node to mount the component before.
134
- * @param $props -- The values that have been passed into the component as properties.
135
- * @param $context -- Values that have been passed into the component from its ancestors.
136
- * @param $slots -- Functions for rendering children into slot nodes within the component.
137
- */
202
+ type IconProps } from "./IconTypes";
203
+
204
+ export default function ChevronLeft($props: IconProps | undefined) {
205
+ @render {
206
+ <svg
207
+ {$props?.id}
208
+ class={`torp-icon ${$props?.class ?? ""}`.trim()}
209
+ viewBox="0 0 100 100"
210
+ stroke-linejoin="round"
211
+ stroke-width="12"
212
+ >
213
+ <g>
214
+ <path d="M70,10 L30,50 L70,90" fill="none" />
215
+ </g>
216
+ </svg>
217
+ }
218
+ }
219
+
138
220
  declare function ChevronLeft(
139
221
  $parent: ParentNode,
140
222
  $anchor: Node | null,
141
- $props?: Record<PropertyKey, any>,
223
+ $props: IconProps | undefined,
142
224
  $context?: Record<PropertyKey, any>,
143
225
  $slots?: Record<string, SlotRender>,
144
226
  ): void;
145
227
 
146
228
 
147
229
 
148
- /**
149
- * Mounts or hydrates the component into the supplied parent node.
150
- * @param $parent -- The parent node.
151
- * @param $anchor -- The node to mount the component before.
152
- * @param $props -- The values that have been passed into the component as properties.
153
- * @param $context -- Values that have been passed into the component from its ancestors.
154
- * @param $slots -- Functions for rendering children into slot nodes within the component.
155
- */
230
+ type IconProps } from "./IconTypes";
231
+
232
+ export default function ChevronRight($props: IconProps | undefined) {
233
+ @render {
234
+ <svg
235
+ {$props?.id}
236
+ class={`torp-icon ${$props?.class ?? ""}`.trim()}
237
+ viewBox="0 0 100 100"
238
+ stroke-linejoin="round"
239
+ stroke-width="12"
240
+ >
241
+ <g>
242
+ <path d="M30,10 L70,50 L30,90" fill="none" />
243
+ </g>
244
+ </svg>
245
+ }
246
+ }
247
+
156
248
  declare function ChevronRight(
157
249
  $parent: ParentNode,
158
250
  $anchor: Node | null,
159
- $props?: Record<PropertyKey, any>,
251
+ $props: IconProps | undefined,
160
252
  $context?: Record<PropertyKey, any>,
161
253
  $slots?: Record<string, SlotRender>,
162
254
  ): void;
163
255
 
164
256
 
165
257
 
166
- /**
167
- * Mounts or hydrates the component into the supplied parent node.
168
- * @param $parent -- The parent node.
169
- * @param $anchor -- The node to mount the component before.
170
- * @param $props -- The values that have been passed into the component as properties.
171
- * @param $context -- Values that have been passed into the component from its ancestors.
172
- * @param $slots -- Functions for rendering children into slot nodes within the component.
173
- */
258
+ type IconProps } from "./IconTypes";
259
+
260
+ export default function ChevronUp($props: IconProps | undefined) {
261
+ @render {
262
+ <svg
263
+ {$props?.id}
264
+ class={`torp-icon ${$props?.class ?? ""}`.trim()}
265
+ viewBox="0 0 100 100"
266
+ stroke-linejoin="round"
267
+ stroke-width="12"
268
+ >
269
+ <g>
270
+ <path d="M10,70 L50,30 L90,70" fill="none" />
271
+ </g>
272
+ </svg>
273
+ }
274
+ }
275
+
174
276
  declare function ChevronUp(
175
277
  $parent: ParentNode,
176
278
  $anchor: Node | null,
177
- $props?: Record<PropertyKey, any>,
279
+ $props: IconProps | undefined,
178
280
  $context?: Record<PropertyKey, any>,
179
281
  $slots?: Record<string, SlotRender>,
180
282
  ): void;
181
283
 
182
284
 
183
285
 
184
- /**
185
- * Mounts or hydrates the component into the supplied parent node.
186
- * @param $parent -- The parent node.
187
- * @param $anchor -- The node to mount the component before.
188
- * @param $props -- The values that have been passed into the component as properties.
189
- * @param $context -- Values that have been passed into the component from its ancestors.
190
- * @param $slots -- Functions for rendering children into slot nodes within the component.
191
- */
286
+ type IconProps } from "./IconTypes";
287
+
288
+ export default function Cross($props: IconProps | undefined) {
289
+ @render {
290
+ <svg
291
+ {$props?.id}
292
+ class={`torp-icon ${$props?.class ?? ""}`.trim()}
293
+ viewBox="0 0 100 100"
294
+ stroke-linejoin="round"
295
+ stroke-width="12"
296
+ >
297
+ <g>
298
+ <path d="M15,15 L85,85" />
299
+ <path d="M15,85 L85,15" />
300
+ </g>
301
+ </svg>
302
+ }
303
+ }
304
+
192
305
  declare function Cross(
193
306
  $parent: ParentNode,
194
307
  $anchor: Node | null,
195
- $props?: Record<PropertyKey, any>,
308
+ $props: IconProps | undefined,
196
309
  $context?: Record<PropertyKey, any>,
197
310
  $slots?: Record<string, SlotRender>,
198
311
  ): void;
199
312
 
200
313
 
201
314
 
202
- /**
203
- * Mounts or hydrates the component into the supplied parent node.
204
- * @param $parent -- The parent node.
205
- * @param $anchor -- The node to mount the component before.
206
- * @param $props -- The values that have been passed into the component as properties.
207
- * @param $context -- Values that have been passed into the component from its ancestors.
208
- * @param $slots -- Functions for rendering children into slot nodes within the component.
209
- */
315
+ type IconProps } from "./IconTypes";
316
+
317
+ export default function Loading($props: IconProps | undefined) {
318
+ @render {
319
+ <svg
320
+ {$props?.id}
321
+ class={`torp-icon ${$props?.class ?? ""}`.trim()}
322
+ viewBox="0 0 100 100"
323
+ stroke-linejoin="round"
324
+ stroke-width="20"
325
+ >
326
+ <g>
327
+ <circle cx="50" cy="50" r="40" fill="none" opacity="0.3" />
328
+ <path d="M 22 22 A 40 40 0 0 1 78 22" fill="none" />
329
+ </g>
330
+ </svg>
331
+ }
332
+ }
333
+
210
334
  declare function Loading(
211
335
  $parent: ParentNode,
212
336
  $anchor: Node | null,
213
- $props?: Record<PropertyKey, any>,
337
+ $props: IconProps | undefined,
214
338
  $context?: Record<PropertyKey, any>,
215
339
  $slots?: Record<string, SlotRender>,
216
340
  ): void;
217
341
 
218
342
 
219
343
 
220
- /**
221
- * Mounts or hydrates the component into the supplied parent node.
222
- * @param $parent -- The parent node.
223
- * @param $anchor -- The node to mount the component before.
224
- * @param $props -- The values that have been passed into the component as properties.
225
- * @param $context -- Values that have been passed into the component from its ancestors.
226
- * @param $slots -- Functions for rendering children into slot nodes within the component.
227
- */
344
+ type IconProps } from "./IconTypes";
345
+
346
+ export default function Minus($props: IconProps | undefined) {
347
+ @render {
348
+ <svg
349
+ {$props?.id}
350
+ class={`torp-icon ${$props?.class ?? ""}`.trim()}
351
+ viewBox="0 0 100 100"
352
+ stroke-linejoin="round"
353
+ stroke-width="12"
354
+ >
355
+ <g>
356
+ <path d="M10,50 L90,50" />
357
+ </g>
358
+ </svg>
359
+ }
360
+ }
361
+
228
362
  declare function Minus(
229
363
  $parent: ParentNode,
230
364
  $anchor: Node | null,
231
- $props?: Record<PropertyKey, any>,
365
+ $props: IconProps | undefined,
232
366
  $context?: Record<PropertyKey, any>,
233
367
  $slots?: Record<string, SlotRender>,
234
368
  ): void;
235
369
 
236
370
 
237
371
 
238
- /**
239
- * Mounts or hydrates the component into the supplied parent node.
240
- * @param $parent -- The parent node.
241
- * @param $anchor -- The node to mount the component before.
242
- * @param $props -- The values that have been passed into the component as properties.
243
- * @param $context -- Values that have been passed into the component from its ancestors.
244
- * @param $slots -- Functions for rendering children into slot nodes within the component.
245
- */
372
+ type IconProps } from "./IconTypes";
373
+
374
+ export default function Plus($props: IconProps | undefined) {
375
+ @render {
376
+ <svg
377
+ {$props?.id}
378
+ class={`torp-icon ${$props?.class ?? ""}`.trim()}
379
+ viewBox="0 0 100 100"
380
+ stroke-linejoin="round"
381
+ stroke-width="12"
382
+ >
383
+ <g>
384
+ <path d="M50,10 L50,90" />
385
+ <path d="M10,50 L90,50" />
386
+ </g>
387
+ </svg>
388
+ }
389
+ }
390
+
246
391
  declare function Plus(
247
392
  $parent: ParentNode,
248
393
  $anchor: Node | null,
249
- $props?: Record<PropertyKey, any>,
394
+ $props: IconProps | undefined,
250
395
  $context?: Record<PropertyKey, any>,
251
396
  $slots?: Record<string, SlotRender>,
252
397
  ): void;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,19 @@
1
- interface AnimationFrame {
2
- opacity: number;
1
+ import { Animation } from '@torpor/view';
2
+
3
+ declare function fade(_el: HTMLElement, options?: number | KeyframeAnimationOptions): Animation;
4
+
5
+ declare function grow(el: HTMLElement, options?: number | KeyframeAnimationOptions): Animation;
6
+
7
+ /**
8
+ * Measures an element before it is added to the DOM
9
+ * @param el The element to measure
10
+ * @param fn The function to use to get the desired measurement (e.g. el.offsetHeight)
11
+ */
12
+ declare function measure(el: HTMLElement, fn: (_: HTMLElement) => number): number;
13
+
14
+ interface Options extends KeyframeAnimationOptions {
15
+ side: "left" | "right" | "top" | "bottom";
3
16
  }
4
- declare const animationFrames: AnimationFrame[];
17
+ declare function slide(el: HTMLElement, options?: Options): Animation;
5
18
 
6
- export { animationFrames as fade };
19
+ export { fade, grow, measure, slide };