@torpor/ui 0.3.2 → 0.3.4

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 (206) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/Accordion/Accordion.torp +7 -3
  3. package/dist/Accordion/AccordionContent.torp +7 -3
  4. package/dist/Accordion/AccordionHeader.torp +7 -3
  5. package/dist/Accordion/AccordionItem.torp +7 -3
  6. package/dist/Accordion/AccordionTrigger.torp +7 -3
  7. package/dist/Accordion/index.d.ts +20 -10
  8. package/dist/Breadcrumb/Breadcrumb.torp +7 -3
  9. package/dist/Breadcrumb/BreadcrumbItem.torp +7 -3
  10. package/dist/Breadcrumb/BreadcrumbSeparator.torp +7 -3
  11. package/dist/Breadcrumb/index.d.ts +12 -6
  12. package/dist/Calendar/Calendar.torp +9 -4
  13. package/dist/Calendar/CalendarDay.torp +5 -2
  14. package/dist/Calendar/index.d.ts +8 -4
  15. package/dist/Contextual/Contextual.torp +7 -3
  16. package/dist/Contextual/ContextualContent.torp +7 -4
  17. package/dist/Contextual/ContextualTrigger.torp +7 -3
  18. package/dist/Contextual/index.d.ts +12 -6
  19. package/dist/Dialog/Dialog.torp +7 -3
  20. package/dist/Dialog/DialogBody.torp +7 -3
  21. package/dist/Dialog/DialogButton.torp +7 -3
  22. package/dist/Dialog/DialogFooter.torp +7 -3
  23. package/dist/Dialog/DialogHeader.torp +7 -3
  24. package/dist/Dialog/index.d.ts +20 -10
  25. package/dist/Disclosure/Disclosure.torp +7 -3
  26. package/dist/Disclosure/DisclosureContent.torp +7 -3
  27. package/dist/Disclosure/DisclosureHeader.torp +7 -3
  28. package/dist/Disclosure/DisclosureTrigger.torp +7 -3
  29. package/dist/Disclosure/index.d.ts +16 -8
  30. package/dist/Drawer/Drawer.torp +7 -3
  31. package/dist/Drawer/DrawerContent.torp +7 -4
  32. package/dist/Drawer/DrawerOverlay.torp +7 -3
  33. package/dist/Drawer/DrawerTrigger.torp +7 -3
  34. package/dist/Drawer/index.d.ts +16 -8
  35. package/dist/Form/CheckBox.torp +5 -2
  36. package/dist/Form/Field.torp +7 -3
  37. package/dist/Form/File.torp +11 -15
  38. package/dist/Form/Form.torp +7 -3
  39. package/dist/Form/Hidden.torp +1 -1
  40. package/dist/Form/Input.torp +7 -3
  41. package/dist/Form/Label.torp +7 -3
  42. package/dist/Form/Message.torp +7 -3
  43. package/dist/Form/Option.torp +8 -4
  44. package/dist/Form/Select.torp +7 -3
  45. package/dist/Form/TextArea.torp +7 -3
  46. package/dist/Form/index.d.ts +43 -25
  47. package/dist/Menu/Menu.torp +7 -3
  48. package/dist/Menu/MenuButton.torp +7 -3
  49. package/dist/Menu/MenuCheck.torp +7 -3
  50. package/dist/Menu/MenuGroup.torp +7 -3
  51. package/dist/Menu/MenuIndicator.torp +7 -3
  52. package/dist/Menu/MenuPopout.torp +7 -3
  53. package/dist/Menu/MenuPopoutContent.torp +7 -4
  54. package/dist/Menu/MenuPopoutTrigger.torp +7 -3
  55. package/dist/Menu/MenuRadio.torp +7 -3
  56. package/dist/Menu/MenuRadioGroup.torp +7 -3
  57. package/dist/Menu/MenuSeparator.torp +7 -3
  58. package/dist/Menu/index.d.ts +44 -22
  59. package/dist/MenuBar/MenuBar.torp +7 -3
  60. package/dist/MenuBar/MenuBarItem.torp +7 -3
  61. package/dist/MenuBar/MenuBarItemContent.torp +7 -3
  62. package/dist/MenuBar/MenuBarItemTrigger.torp +7 -3
  63. package/dist/MenuBar/index.d.ts +16 -8
  64. package/dist/Modal/Modal.torp +7 -3
  65. package/dist/Modal/ModalContent.torp +7 -3
  66. package/dist/Modal/ModalOverlay.torp +7 -3
  67. package/dist/Modal/ModalTrigger.torp +7 -3
  68. package/dist/Modal/index.d.ts +16 -8
  69. package/dist/NavMenu/NavMenu.torp +7 -3
  70. package/dist/NavMenu/NavMenuButton.torp +7 -3
  71. package/dist/NavMenu/NavMenuElement.torp +7 -3
  72. package/dist/NavMenu/NavMenuGroup.torp +7 -3
  73. package/dist/NavMenu/NavMenuGroupHeader.torp +7 -3
  74. package/dist/NavMenu/NavMenuLink.torp +7 -4
  75. package/dist/NavMenu/NavMenuPopout.torp +7 -3
  76. package/dist/NavMenu/NavMenuPopoutButton.torp +7 -3
  77. package/dist/NavMenu/NavMenuPopoutContent.torp +7 -4
  78. package/dist/NavMenu/NavMenuSeparator.torp +5 -2
  79. package/dist/NavMenu/index.d.ts +40 -20
  80. package/dist/Notification/Notification.torp +7 -3
  81. package/dist/Notification/NotificationClose.torp +7 -3
  82. package/dist/Notification/NotificationContainer.torp +7 -3
  83. package/dist/Notification/NotificationContent.torp +7 -3
  84. package/dist/Notification/index.d.ts +16 -8
  85. package/dist/Popover/Popover.torp +7 -3
  86. package/dist/Popover/PopoverContent.torp +7 -3
  87. package/dist/Popover/PopoverTrigger.torp +7 -3
  88. package/dist/Popover/index.d.ts +8 -4
  89. package/dist/TabGroup/TabContent.torp +7 -3
  90. package/dist/TabGroup/TabGroup.torp +7 -3
  91. package/dist/TabGroup/TabHeader.torp +5 -2
  92. package/dist/TabGroup/TabList.torp +7 -3
  93. package/dist/TabGroup/TabTrigger.torp +7 -3
  94. package/dist/TabGroup/index.d.ts +20 -10
  95. package/dist/icons/ArrowDown.torp +2 -1
  96. package/dist/icons/ArrowLeft.torp +2 -1
  97. package/dist/icons/ArrowRight.torp +2 -1
  98. package/dist/icons/ArrowUp.torp +2 -1
  99. package/dist/icons/Bars.torp +2 -1
  100. package/dist/icons/Check.torp +2 -1
  101. package/dist/icons/ChevronDown.torp +2 -1
  102. package/dist/icons/ChevronLeft.torp +2 -1
  103. package/dist/icons/ChevronRight.torp +2 -1
  104. package/dist/icons/ChevronUp.torp +2 -1
  105. package/dist/icons/Cross.torp +2 -1
  106. package/dist/icons/IconTypes.ts +6 -2
  107. package/dist/icons/Loading.torp +2 -1
  108. package/dist/icons/Minus.torp +2 -1
  109. package/dist/icons/Plus.torp +2 -1
  110. package/dist/icons/index.d.ts +28 -14
  111. package/dist/metafile-esm.json +1 -1
  112. package/package.json +2 -2
  113. package/src/Accordion/Accordion.torp +7 -3
  114. package/src/Accordion/AccordionContent.torp +7 -3
  115. package/src/Accordion/AccordionHeader.torp +7 -3
  116. package/src/Accordion/AccordionItem.torp +7 -3
  117. package/src/Accordion/AccordionTrigger.torp +7 -3
  118. package/src/Breadcrumb/Breadcrumb.torp +7 -3
  119. package/src/Breadcrumb/BreadcrumbItem.torp +7 -3
  120. package/src/Breadcrumb/BreadcrumbSeparator.torp +7 -3
  121. package/src/Calendar/Calendar.torp +9 -4
  122. package/src/Calendar/CalendarDay.torp +5 -2
  123. package/src/Contextual/Contextual.torp +7 -3
  124. package/src/Contextual/ContextualContent.torp +7 -4
  125. package/src/Contextual/ContextualTrigger.torp +7 -3
  126. package/src/Dialog/Dialog.torp +7 -3
  127. package/src/Dialog/DialogBody.torp +7 -3
  128. package/src/Dialog/DialogButton.torp +7 -3
  129. package/src/Dialog/DialogFooter.torp +7 -3
  130. package/src/Dialog/DialogHeader.torp +7 -3
  131. package/src/Disclosure/Disclosure.torp +7 -3
  132. package/src/Disclosure/DisclosureContent.torp +7 -3
  133. package/src/Disclosure/DisclosureHeader.torp +7 -3
  134. package/src/Disclosure/DisclosureTrigger.torp +7 -3
  135. package/src/Drawer/Drawer.torp +7 -3
  136. package/src/Drawer/DrawerContent.torp +7 -4
  137. package/src/Drawer/DrawerOverlay.torp +7 -3
  138. package/src/Drawer/DrawerTrigger.torp +7 -3
  139. package/src/Form/CheckBox.torp +5 -2
  140. package/src/Form/Field.torp +7 -3
  141. package/src/Form/File.torp +11 -15
  142. package/src/Form/Form.torp +7 -3
  143. package/src/Form/Hidden.torp +1 -1
  144. package/src/Form/Input.torp +7 -3
  145. package/src/Form/Label.torp +7 -3
  146. package/src/Form/Message.torp +7 -3
  147. package/src/Form/Option.torp +8 -4
  148. package/src/Form/Select.torp +7 -3
  149. package/src/Form/TextArea.torp +7 -3
  150. package/src/Menu/Menu.torp +7 -3
  151. package/src/Menu/MenuButton.torp +7 -3
  152. package/src/Menu/MenuCheck.torp +7 -3
  153. package/src/Menu/MenuGroup.torp +7 -3
  154. package/src/Menu/MenuIndicator.torp +7 -3
  155. package/src/Menu/MenuPopout.torp +7 -3
  156. package/src/Menu/MenuPopoutContent.torp +7 -4
  157. package/src/Menu/MenuPopoutTrigger.torp +7 -3
  158. package/src/Menu/MenuRadio.torp +7 -3
  159. package/src/Menu/MenuRadioGroup.torp +7 -3
  160. package/src/Menu/MenuSeparator.torp +7 -3
  161. package/src/MenuBar/MenuBar.torp +7 -3
  162. package/src/MenuBar/MenuBarItem.torp +7 -3
  163. package/src/MenuBar/MenuBarItemContent.torp +7 -3
  164. package/src/MenuBar/MenuBarItemTrigger.torp +7 -3
  165. package/src/Modal/Modal.torp +7 -3
  166. package/src/Modal/ModalContent.torp +7 -3
  167. package/src/Modal/ModalOverlay.torp +7 -3
  168. package/src/Modal/ModalTrigger.torp +7 -3
  169. package/src/NavMenu/NavMenu.torp +7 -3
  170. package/src/NavMenu/NavMenuButton.torp +7 -3
  171. package/src/NavMenu/NavMenuElement.torp +7 -3
  172. package/src/NavMenu/NavMenuGroup.torp +7 -3
  173. package/src/NavMenu/NavMenuGroupHeader.torp +7 -3
  174. package/src/NavMenu/NavMenuLink.torp +7 -4
  175. package/src/NavMenu/NavMenuPopout.torp +7 -3
  176. package/src/NavMenu/NavMenuPopoutButton.torp +7 -3
  177. package/src/NavMenu/NavMenuPopoutContent.torp +7 -4
  178. package/src/NavMenu/NavMenuSeparator.torp +5 -2
  179. package/src/Notification/Notification.torp +7 -3
  180. package/src/Notification/NotificationClose.torp +7 -3
  181. package/src/Notification/NotificationContainer.torp +7 -3
  182. package/src/Notification/NotificationContent.torp +7 -3
  183. package/src/Popover/Popover.torp +7 -3
  184. package/src/Popover/PopoverContent.torp +7 -3
  185. package/src/Popover/PopoverTrigger.torp +7 -3
  186. package/src/Slider/Slider.torp +2 -1
  187. package/src/TabGroup/TabContent.torp +7 -3
  188. package/src/TabGroup/TabGroup.torp +7 -3
  189. package/src/TabGroup/TabHeader.torp +5 -2
  190. package/src/TabGroup/TabList.torp +7 -3
  191. package/src/TabGroup/TabTrigger.torp +7 -3
  192. package/src/icons/ArrowDown.torp +2 -1
  193. package/src/icons/ArrowLeft.torp +2 -1
  194. package/src/icons/ArrowRight.torp +2 -1
  195. package/src/icons/ArrowUp.torp +2 -1
  196. package/src/icons/Bars.torp +2 -1
  197. package/src/icons/Check.torp +2 -1
  198. package/src/icons/ChevronDown.torp +2 -1
  199. package/src/icons/ChevronLeft.torp +2 -1
  200. package/src/icons/ChevronRight.torp +2 -1
  201. package/src/icons/ChevronUp.torp +2 -1
  202. package/src/icons/Cross.torp +2 -1
  203. package/src/icons/IconTypes.ts +6 -2
  204. package/src/icons/Loading.torp +2 -1
  205. package/src/icons/Minus.torp +2 -1
  206. package/src/icons/Plus.torp +2 -1
@@ -4,8 +4,10 @@ import { type SlotRender } from "@torpor/view";
4
4
  interface NavMenuProps {
5
5
  /** An ID for the root element */
6
6
  id?: string;
7
- /** Class name(s) for the root element */
8
- class?: string,
7
+ /** Classes for the root element */
8
+ class?: ClassValue,
9
+ /** Styles for the root element */
10
+ style?: StyleValue,
9
11
  /** An ARIA label for describing the menu to screen readers */
10
12
  ariaLabel?: string | undefined,
11
13
  /** The orientation of the menu, which affects keyboard navigation */
@@ -41,8 +43,10 @@ declare function NavMenu(
41
43
  interface NavMenuButtonProps {
42
44
  /** An ID for the root element */
43
45
  id?: string;
44
- /** Class name(s) for the root element */
45
- class?: string,
46
+ /** Classes for the root element */
47
+ class?: ClassValue,
48
+ /** Styles for the root element */
49
+ style?: StyleValue,
46
50
  /** Whether this button is disabled */
47
51
  disabled?: boolean,
48
52
  }
@@ -64,8 +68,10 @@ declare function NavMenuButton(
64
68
  interface NavMenuElementProps {
65
69
  /** An ID for the root element */
66
70
  id?: string;
67
- /** Class name(s) for the root element */
68
- class?: string,
71
+ /** Classes for the root element */
72
+ class?: ClassValue,
73
+ /** Styles for the root element */
74
+ style?: StyleValue,
69
75
  /** Whether this button is disabled */
70
76
  disabled?: boolean,
71
77
  /** An element that can be focused via keyboard navigation */
@@ -89,8 +95,10 @@ declare function NavMenuElement(
89
95
  interface NavMenuGroupProps {
90
96
  /** An ID for the root element */
91
97
  id?: string;
92
- /** Class name(s) for the root element */
93
- class?: string,
98
+ /** Classes for the root element */
99
+ class?: ClassValue,
100
+ /** Styles for the root element */
101
+ style?: StyleValue,
94
102
  /** An ARIA label for describing the group to screen readers */
95
103
  ariaLabel?: string,
96
104
  }
@@ -111,8 +119,10 @@ declare function NavMenuGroup(
111
119
  interface NavMenuGroupHeaderProps {
112
120
  /** An ID for the root element */
113
121
  id?: string;
114
- /** Class name(s) for the root element */
115
- class?: string,
122
+ /** Classes for the root element */
123
+ class?: ClassValue,
124
+ /** Styles for the root element */
125
+ style?: StyleValue,
116
126
  /** The type of HTML header to use */
117
127
  as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6",
118
128
  }
@@ -133,8 +143,10 @@ declare function NavMenuGroupHeader(
133
143
  interface NavMenuLinkProps {
134
144
  /** An ID for the root element */
135
145
  id?: string;
136
- /** Class name(s) for the root element */
137
- class?: string,
146
+ /** Classes for the root element */
147
+ class?: ClassValue,
148
+ /** Styles for the root element */
149
+ style?: StyleValue,
138
150
  /** The URL for the menu link */
139
151
  href: string,
140
152
  /** Whether the menu link should open in a new tab/window */
@@ -160,8 +172,10 @@ declare function NavMenuLink(
160
172
  interface NavMenuPopoutProps {
161
173
  /** An ID for the root element */
162
174
  id?: string;
163
- /** Class name(s) for the root element */
164
- class?: string,
175
+ /** Classes for the root element */
176
+ class?: ClassValue,
177
+ /** Styles for the root element */
178
+ style?: StyleValue,
165
179
  /** Whether the popout is visible */
166
180
  visible?: boolean,
167
181
  /** Raised when the popout is opened or closed */
@@ -197,8 +211,10 @@ declare function NavMenuPopout(
197
211
  interface NavMenuPopoutButtonProps {
198
212
  /** An ID for the root element */
199
213
  id?: string;
200
- /** Class name(s) for the root element */
201
- class?: string,
214
+ /** Classes for the root element */
215
+ class?: ClassValue,
216
+ /** Styles for the root element */
217
+ style?: StyleValue,
202
218
  /** The delay before showing the popout, in milliseconds */
203
219
  hoverDelay?: number,
204
220
  /** Whether this button is disabled */
@@ -222,8 +238,10 @@ declare function NavMenuPopoutButton(
222
238
  interface NavMenuPopoutContentProps {
223
239
  /** An ID for the root element */
224
240
  id?: string;
225
- /** Class name(s) for the root element */
226
- class?: string,
241
+ /** Classes for the root element */
242
+ class?: ClassValue,
243
+ /** Styles for the root element */
244
+ style?: StyleValue,
227
245
  /** Where the popout will be shown, relative to the popout button */
228
246
  side?: "top" | "right" | "bottom" | "left",
229
247
  /** How the popout will be aligned, relative to the popout button */
@@ -247,8 +265,10 @@ declare function NavMenuPopoutContent(
247
265
  interface NavMenuSeparatorProps {
248
266
  /** An ID for the root element */
249
267
  id?: string;
250
- /** Class name(s) for the root element */
251
- class?: string,
268
+ /** Classes for the root element */
269
+ class?: ClassValue,
270
+ /** Styles for the root element */
271
+ style?: StyleValue,
252
272
  }
253
273
 
254
274
  /**
@@ -1,10 +1,13 @@
1
+ import type { ClassValue, StyleValue } from "@torpor/view";
1
2
  import { NotificationContextName, type NotificationContext } from "./NotificationTypes";
2
3
 
3
4
  interface NotificationProps {
4
5
  /** An ID for the root element */
5
6
  id?: string;
6
- /** Class name(s) for the root element */
7
- class?: string,
7
+ /** Classes for the root element */
8
+ class?: ClassValue,
9
+ /** Styles for the root element */
10
+ style?: StyleValue,
8
11
  /** Whether the notification is visible */
9
12
  visible?: boolean,
10
13
  /** The duration, in milliseconds, to keep the notification visible */
@@ -57,7 +60,8 @@ export default function Notification($props: NotificationProps | undefined) {
57
60
  @if ($state.visible) {
58
61
  <div
59
62
  {$props?.id}
60
- class={`torp-notification ${$props?.class ?? ""}`.trim()}
63
+ class={["torp-notification", $props?.class]}
64
+ {$props?.style}
61
65
  role="alert"
62
66
  >
63
67
  <slot />
@@ -1,10 +1,13 @@
1
+ import type { ClassValue, StyleValue } from "@torpor/view";
1
2
  import { NotificationContextName, type NotificationContext } from "./NotificationTypes";
2
3
 
3
4
  interface NotificationCloseProps {
4
5
  /** An ID for the root element */
5
6
  id?: string;
6
- /** Class name(s) for the root element */
7
- class?: string,
7
+ /** Classes for the root element */
8
+ class?: ClassValue,
9
+ /** Styles for the root element */
10
+ style?: StyleValue,
8
11
  }
9
12
 
10
13
  /**
@@ -25,7 +28,8 @@ export default function NotificationClose($props: NotificationCloseProps | undef
25
28
  @render {
26
29
  <button
27
30
  {$props?.id}
28
- class={`torp-notification-close ${$props?.class ?? ""}`.trim()}
31
+ class={["torp-notification-close", $props?.class]}
32
+ {$props?.style}
29
33
  type="button"
30
34
  onclick={handleClick}
31
35
  >
@@ -1,9 +1,12 @@
1
+ import type { ClassValue, StyleValue } from "@torpor/view";
1
2
 
2
3
  interface NotificationContainerProps {
3
4
  /** An ID for the root element */
4
5
  id?: string;
5
- /** Class name(s) for the root element */
6
- class?: string,
6
+ /** Classes for the root element */
7
+ class?: ClassValue,
8
+ /** Styles for the root element */
9
+ style?: StyleValue,
7
10
  }
8
11
 
9
12
  /**
@@ -14,7 +17,8 @@ export default function NotificationContainer($props: NotificationContainerProps
14
17
  @render {
15
18
  <div
16
19
  {$props?.id}
17
- class={`torp-notification-container ${$props?.class ?? ""}`.trim()}
20
+ class={["torp-notification-container", $props?.class]}
21
+ {$props?.style}
18
22
  >
19
23
  <slot />
20
24
  </div>
@@ -1,9 +1,12 @@
1
+ import type { ClassValue, StyleValue } from "@torpor/view";
1
2
 
2
3
  interface NotificationContentProps {
3
4
  /** An ID for the root element */
4
5
  id?: string;
5
- /** Class name(s) for the root element */
6
- class?: string,
6
+ /** Classes for the root element */
7
+ class?: ClassValue,
8
+ /** Styles for the root element */
9
+ style?: StyleValue,
7
10
  }
8
11
 
9
12
  /**
@@ -13,7 +16,8 @@ export default function NotificationContent($props: NotificationContentProps | u
13
16
  @render {
14
17
  <div
15
18
  {$props?.id}
16
- class={`torp-notification-content ${$props?.class ?? ""}`.trim()}
19
+ class={["torp-notification-content", $props?.class]}
20
+ {$props?.style}
17
21
  >
18
22
  <slot />
19
23
  </div>
@@ -4,8 +4,10 @@ import { type SlotRender } from "@torpor/view";
4
4
  interface NotificationProps {
5
5
  /** An ID for the root element */
6
6
  id?: string;
7
- /** Class name(s) for the root element */
8
- class?: string,
7
+ /** Classes for the root element */
8
+ class?: ClassValue,
9
+ /** Styles for the root element */
10
+ style?: StyleValue,
9
11
  /** Whether the notification is visible */
10
12
  visible?: boolean,
11
13
  /** The duration, in milliseconds, to keep the notification visible */
@@ -33,8 +35,10 @@ declare function Notification(
33
35
  interface NotificationCloseProps {
34
36
  /** An ID for the root element */
35
37
  id?: string;
36
- /** Class name(s) for the root element */
37
- class?: string,
38
+ /** Classes for the root element */
39
+ class?: ClassValue,
40
+ /** Styles for the root element */
41
+ style?: StyleValue,
38
42
  }
39
43
 
40
44
  /**
@@ -53,8 +57,10 @@ declare function NotificationClose(
53
57
  interface NotificationContainerProps {
54
58
  /** An ID for the root element */
55
59
  id?: string;
56
- /** Class name(s) for the root element */
57
- class?: string,
60
+ /** Classes for the root element */
61
+ class?: ClassValue,
62
+ /** Styles for the root element */
63
+ style?: StyleValue,
58
64
  }
59
65
 
60
66
  /**
@@ -74,8 +80,10 @@ declare function NotificationContainer(
74
80
  interface NotificationContentProps {
75
81
  /** An ID for the root element */
76
82
  id?: string;
77
- /** Class name(s) for the root element */
78
- class?: string,
83
+ /** Classes for the root element */
84
+ class?: ClassValue,
85
+ /** Styles for the root element */
86
+ style?: StyleValue,
79
87
  }
80
88
 
81
89
  /**
@@ -1,10 +1,13 @@
1
+ import type { ClassValue, StyleValue } from "@torpor/view";
1
2
  import { PopoverContextName, type Point, type PopoverContext, type PopoverState } from "./PopoverTypes";
2
3
 
3
4
  interface PopoverProps {
4
5
  /** An ID for the root element */
5
6
  id?: string;
6
- /** Class name(s) for the root element */
7
- class?: string,
7
+ /** Classes for the root element */
8
+ class?: ClassValue,
9
+ /** Styles for the root element */
10
+ style?: StyleValue,
8
11
  /** Whether the popover is modal. If true, an overlay should be supplied to obscure outside content, and only the popover content will be visible to screen readers */
9
12
  modal?: boolean,
10
13
  /** Whether the popover is visible */
@@ -117,7 +120,8 @@ export default function Popover($props: PopoverProps | undefined) {
117
120
  @render {
118
121
  <div
119
122
  {$props?.id}
120
- class={`torp-popover ${$props?.class ?? ""}`.trim()}
123
+ class={["torp-popover", $props?.class]}
124
+ {$props?.style}
121
125
  >
122
126
  <slot />
123
127
  </div>
@@ -1,3 +1,4 @@
1
+ import type { ClassValue, StyleValue } from "@torpor/view";
1
2
  import { addDocumentEvent, removeDocumentEvent } from "../utils/documentEvents";
2
3
  import getScrollParent from "../utils/getScrollParent";
3
4
  import setPopoverPosition from "../utils/setPopoverPosition";
@@ -6,8 +7,10 @@ import { PopoverContextName, type PopoverContext } from "./PopoverTypes";
6
7
  interface PopoverContentProps {
7
8
  /** An ID for the root element */
8
9
  id?: string;
9
- /** Class name(s) for the root element */
10
- class?: string,
10
+ /** Classes for the root element */
11
+ class?: ClassValue,
12
+ /** Styles for the root element */
13
+ style?: StyleValue,
11
14
  /** Where the popover will be shown, relative to the popover trigger */
12
15
  side?: "top" | "right" | "bottom" | "left",
13
16
  /** How the popover will be aligned, relative to the popover trigger */
@@ -102,7 +105,8 @@ export default function PopoverContent($props?: PopoverContentProps | undefined)
102
105
  @if ($state.visible) {
103
106
  <div
104
107
  {$props?.id}
105
- class={`torp-popover-content ${$props?.class ?? ""}`.trim()}
108
+ class={["torp-popover-content", $props?.class]}
109
+ {$props?.style}
106
110
  &ref={div}
107
111
  onmount={show}
108
112
  >
@@ -1,11 +1,14 @@
1
+ import type { ClassValue, StyleValue } from "@torpor/view";
1
2
  import { PopoverContextName, type PopoverContext } from "./PopoverTypes";
2
3
  import hoverTrigger from "../mount/hoverTrigger";
3
4
 
4
5
  interface PopoverTriggerProps {
5
6
  /** An ID for the root element */
6
7
  id?: string;
7
- /** Class name(s) for the root element */
8
- class?: string,
8
+ /** Classes for the root element */
9
+ class?: ClassValue,
10
+ /** Styles for the root element */
11
+ style?: StyleValue,
9
12
  /** Whether the popover is activated by click/press or by hover **/
10
13
  activation?: "press" | "hover"
11
14
  }
@@ -47,7 +50,8 @@ export default function PopoverTrigger($props: PopoverTriggerProps | undefined)
47
50
  <button
48
51
  type="button"
49
52
  {$props?.id}
50
- class={`torp-popover-trigger ${$props?.class ?? ""}`.trim()}
53
+ class={["torp-popover-trigger", $props?.class]}
54
+ {$props?.style}
51
55
  onclick={handleClick}
52
56
  onmount={(el) => hoverTrigger(el, { onHover: handleHover, onExit: handleHover })}
53
57
  &ref={context.anchorElement}
@@ -4,8 +4,10 @@ import { type SlotRender } from "@torpor/view";
4
4
  interface PopoverProps {
5
5
  /** An ID for the root element */
6
6
  id?: string;
7
- /** Class name(s) for the root element */
8
- class?: string,
7
+ /** Classes for the root element */
8
+ class?: ClassValue,
9
+ /** Styles for the root element */
10
+ style?: StyleValue,
9
11
  /** Whether the popover is modal. If true, an overlay should be supplied to obscure outside content, and only the popover content will be visible to screen readers */
10
12
  modal?: boolean,
11
13
  /** Whether the popover is visible */
@@ -63,8 +65,10 @@ declare function PopoverContent(
63
65
  interface PopoverTriggerProps {
64
66
  /** An ID for the root element */
65
67
  id?: string;
66
- /** Class name(s) for the root element */
67
- class?: string,
68
+ /** Classes for the root element */
69
+ class?: ClassValue,
70
+ /** Styles for the root element */
71
+ style?: StyleValue,
68
72
  /** Whether the popover is activated by click/press or by hover **/
69
73
  activation?: "press" | "hover"
70
74
  }
@@ -1,11 +1,14 @@
1
+ import type { ClassValue, StyleValue } from "@torpor/view";
1
2
  import getId from "../utils/getId";
2
3
  import { TabGroupContextName, type TabGroupContext } from "./TabGroupTypes";
3
4
 
4
5
  interface TabContentProps {
5
6
  /** An ID for the root element */
6
7
  id?: string;
7
- /** Class name(s) for the root element */
8
- class?: string,
8
+ /** Classes for the root element */
9
+ class?: ClassValue,
10
+ /** Styles for the root element */
11
+ style?: StyleValue,
9
12
  /** The index of this item */
10
13
  index?: number,
11
14
  /** The value for this item */
@@ -30,7 +33,8 @@ export default function TabContent($props: TabContentProps | undefined) {
30
33
  @render {
31
34
  <div
32
35
  id={$props?.id ?? defaultId}
33
- class={`torp-tab-content ${$props?.class ?? ""}`.trim()}
36
+ class={["torp-tab-content", $props?.class]}
37
+ {$props?.style}
34
38
  role="tabpanel"
35
39
  aria-labelledby={$state.headerId}
36
40
  data-orientation={context.orientation}
@@ -1,10 +1,13 @@
1
+ import type { ClassValue, StyleValue } from "@torpor/view";
1
2
  import { TabGroupContextName, type TabGroupContext, type ItemState } from "./TabGroupTypes";
2
3
 
3
4
  interface TabGroupProps {
4
5
  /** An ID for the root element */
5
6
  id?: string;
6
- /** Class name(s) for the root element */
7
- class?: string,
7
+ /** Classes for the root element */
8
+ class?: ClassValue,
9
+ /** Styles for the root element */
10
+ style?: StyleValue,
8
11
  /** The orientation of the tab buttons, which affects keyboard navigation */
9
12
  orientation?: "horizontal" | "vertical",
10
13
  /** How tabs are activated; if automatic they are shown on focus, if manual they must be clicked */
@@ -237,7 +240,8 @@ export default function TabGroup($props: TabGroupProps | undefined) {
237
240
  @render {
238
241
  <div
239
242
  {$props?.id}
240
- class={`torp-tab-group ${$props?.class ?? ""}`.trim()}
243
+ class={["torp-tab-group", $props?.class]}
244
+ {$props?.style}
241
245
  data-orientation={$props?.orientation}
242
246
  >
243
247
  <slot />
@@ -1,10 +1,13 @@
1
+ import type { ClassValue, StyleValue } from "@torpor/view";
1
2
  import { TabGroupContextName, TabItemContextName, type TabGroupContext, type TabItemContext } from "./TabGroupTypes";
2
3
 
3
4
  interface TabHeaderProps {
4
5
  /** An ID for the root element */
5
6
  id?: string;
6
- /** Class name(s) for the root element */
7
- class?: string,
7
+ /** Classes for the root element */
8
+ class?: ClassValue,
9
+ /** Styles for the root element */
10
+ style?: StyleValue,
8
11
  /** The type of HTML header to use */
9
12
  as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6"
10
13
  /** The index of this header's item */
@@ -1,10 +1,13 @@
1
+ import type { ClassValue, StyleValue } from "@torpor/view";
1
2
  import { TabGroupContextName, type TabGroupContext } from "./TabGroupTypes";
2
3
 
3
4
  interface TabListProps {
4
5
  /** An ID for the root element */
5
6
  id?: string;
6
- /** Class name(s) for the root element */
7
- class?: string,
7
+ /** Classes for the root element */
8
+ class?: ClassValue,
9
+ /** Styles for the root element */
10
+ style?: StyleValue,
8
11
  /** An ARIA label for describing the tab list to screen readers */
9
12
  ariaLabel?: string,
10
13
  }
@@ -43,7 +46,8 @@ export default function TabList($props: TabListProps | undefined) {
43
46
  @render {
44
47
  <div
45
48
  {$props?.id}
46
- class={`torp-tab-list ${$props?.class ?? ""}`.trim()}
49
+ class={["torp-tab-list", $props?.class]}
50
+ {$props?.style}
47
51
  role="tablist"
48
52
  aria-label={$props?.ariaLabel}
49
53
  aria-orientation={orientation}
@@ -1,11 +1,14 @@
1
+ import type { ClassValue, StyleValue } from "@torpor/view";
1
2
  import getId from "../utils/getId";
2
3
  import { TabItemContextName, type TabItemContext } from "./TabGroupTypes";
3
4
 
4
5
  interface TabTriggerProps {
5
6
  /** An ID for the root element */
6
7
  id?: string;
7
- /** Class name(s) for the root element */
8
- class?: string,
8
+ /** Classes for the root element */
9
+ class?: ClassValue,
10
+ /** Styles for the root element */
11
+ style?: StyleValue,
9
12
  }
10
13
 
11
14
  /**
@@ -52,7 +55,8 @@ export default function TabTrigger($props: TabTriggerProps | undefined) {
52
55
  <button
53
56
  type="button"
54
57
  id={$props?.id ?? defaultId}
55
- class={`torp-tab-trigger ${$props?.class ?? ""}`.trim()}
58
+ class={["torp-tab-trigger", $props?.class]}
59
+ {$props?.style}
56
60
  role="tab"
57
61
  tabindex="-1"
58
62
  disabled={$state.disabled || $state.parentDisabled}
@@ -4,8 +4,10 @@ import { type SlotRender } from "@torpor/view";
4
4
  interface TabContentProps {
5
5
  /** An ID for the root element */
6
6
  id?: string;
7
- /** Class name(s) for the root element */
8
- class?: string,
7
+ /** Classes for the root element */
8
+ class?: ClassValue,
9
+ /** Styles for the root element */
10
+ style?: StyleValue,
9
11
  /** The index of this item */
10
12
  index?: number,
11
13
  /** The value for this item */
@@ -28,8 +30,10 @@ declare function TabContent(
28
30
  interface TabGroupProps {
29
31
  /** An ID for the root element */
30
32
  id?: string;
31
- /** Class name(s) for the root element */
32
- class?: string,
33
+ /** Classes for the root element */
34
+ class?: ClassValue,
35
+ /** Styles for the root element */
36
+ style?: StyleValue,
33
37
  /** The orientation of the tab buttons, which affects keyboard navigation */
34
38
  orientation?: "horizontal" | "vertical",
35
39
  /** How tabs are activated; if automatic they are shown on focus, if manual they must be clicked */
@@ -74,8 +78,10 @@ declare function TabGroup(
74
78
  interface TabHeaderProps {
75
79
  /** An ID for the root element */
76
80
  id?: string;
77
- /** Class name(s) for the root element */
78
- class?: string,
81
+ /** Classes for the root element */
82
+ class?: ClassValue,
83
+ /** Styles for the root element */
84
+ style?: StyleValue,
79
85
  /** The type of HTML header to use */
80
86
  as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6"
81
87
  /** The index of this header's item */
@@ -108,8 +114,10 @@ declare function TabHeader(
108
114
  interface TabListProps {
109
115
  /** An ID for the root element */
110
116
  id?: string;
111
- /** Class name(s) for the root element */
112
- class?: string,
117
+ /** Classes for the root element */
118
+ class?: ClassValue,
119
+ /** Styles for the root element */
120
+ style?: StyleValue,
113
121
  /** An ARIA label for describing the tab list to screen readers */
114
122
  ariaLabel?: string,
115
123
  }
@@ -140,8 +148,10 @@ declare function TabList(
140
148
  interface TabTriggerProps {
141
149
  /** An ID for the root element */
142
150
  id?: string;
143
- /** Class name(s) for the root element */
144
- class?: string,
151
+ /** Classes for the root element */
152
+ class?: ClassValue,
153
+ /** Styles for the root element */
154
+ style?: StyleValue,
145
155
  }
146
156
 
147
157
  /**
@@ -4,7 +4,8 @@ export default function ArrowDown($props: IconProps | undefined) {
4
4
  @render {
5
5
  <svg
6
6
  {$props?.id}
7
- class={`torp-icon ${$props?.class ?? ""}`.trim()}
7
+ class={["torp-icon", $props?.class]}
8
+ {$props?.style}
8
9
  viewBox="0 0 100 100"
9
10
  stroke-linejoin="round"
10
11
  stroke-width="12"
@@ -4,7 +4,8 @@ export default function ArrowLeft($props: IconProps | undefined) {
4
4
  @render {
5
5
  <svg
6
6
  {$props?.id}
7
- class={`torp-icon ${$props?.class ?? ""}`.trim()}
7
+ class={["torp-icon", $props?.class]}
8
+ {$props?.style}
8
9
  viewBox="0 0 100 100"
9
10
  stroke-linejoin="round"
10
11
  stroke-width="12"
@@ -4,7 +4,8 @@ export default function ArrowRight($props: IconProps | any) {
4
4
  @render {
5
5
  <svg
6
6
  {$props?.id}
7
- class={`torp-icon ${$props?.class ?? ""}`.trim()}
7
+ class={["torp-icon", $props?.class]}
8
+ {$props?.style}
8
9
  viewBox="0 0 100 100"
9
10
  stroke-linejoin="round"
10
11
  stroke-width="12"
@@ -4,7 +4,8 @@ export default function ArrowUp($props: IconProps | undefined) {
4
4
  @render {
5
5
  <svg
6
6
  {$props?.id}
7
- class={`torp-icon ${$props?.class ?? ""}`.trim()}
7
+ class={["torp-icon", $props?.class]}
8
+ {$props?.style}
8
9
  viewBox="0 0 100 100"
9
10
  stroke-linejoin="round"
10
11
  stroke-width="12"
@@ -4,7 +4,8 @@ export default function Bars($props: IconProps | undefined) {
4
4
  @render {
5
5
  <svg
6
6
  {$props?.id}
7
- class={`torp-icon ${$props?.class ?? ""}`.trim()}
7
+ class={["torp-icon", $props?.class]}
8
+ {$props?.style}
8
9
  viewBox="0 0 100 100"
9
10
  stroke-linejoin="round"
10
11
  stroke-width="12"
@@ -4,7 +4,8 @@ export default function Check($props: IconProps | undefined) {
4
4
  @render {
5
5
  <svg
6
6
  {$props?.id}
7
- class={`torp-icon ${$props?.class ?? ""}`.trim()}
7
+ class={["torp-icon", $props?.class]}
8
+ {$props?.style}
8
9
  viewBox="0 0 100 100"
9
10
  stroke-linejoin="round"
10
11
  stroke-width="12"
@@ -4,7 +4,8 @@ export default function ChevronDown($props: IconProps | undefined) {
4
4
  @render {
5
5
  <svg
6
6
  {$props?.id}
7
- class={`torp-icon ${$props?.class ?? ""}`.trim()}
7
+ class={["torp-icon", $props?.class]}
8
+ {$props?.style}
8
9
  viewBox="0 0 100 100"
9
10
  stroke-linejoin="round"
10
11
  stroke-width="12"