@torpor/ui 0.3.7 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/Accordion/Accordion.torp +26 -25
  2. package/dist/Accordion/AccordionItem.torp +3 -3
  3. package/dist/Accordion/AccordionTypes.ts +5 -5
  4. package/dist/Accordion/index.d.ts +2 -2
  5. package/dist/Calendar/CalendarTypes.ts +1 -1
  6. package/dist/{Chart → Charts}/GridLines.torp +3 -0
  7. package/dist/{Chart → Charts}/XAxis.torp +7 -1
  8. package/dist/{Chart → Charts}/YAxis.torp +7 -1
  9. package/dist/{Chart → Charts}/index.js +8 -8
  10. package/dist/Contextual/Contextual.torp +8 -3
  11. package/dist/Contextual/ContextualTypes.ts +1 -1
  12. package/dist/Dialog/Dialog.torp +12 -16
  13. package/dist/Dialog/DialogButton.torp +3 -0
  14. package/dist/Dialog/DialogTypes.ts +2 -2
  15. package/dist/Dialog/index.d.ts +2 -0
  16. package/dist/Disclosure/Disclosure.torp +3 -3
  17. package/dist/Disclosure/DisclosureTypes.ts +1 -1
  18. package/dist/Drawer/Drawer.torp +2 -2
  19. package/dist/Drawer/DrawerTypes.ts +1 -1
  20. package/dist/Form/CheckBox.torp +1 -2
  21. package/dist/Form/Input.torp +1 -1
  22. package/dist/Form/MessageSummary.torp +38 -0
  23. package/dist/Form/index.d.ts +23 -1
  24. package/dist/Form/index.js +4 -0
  25. package/dist/ListBox/ListBox.torp +271 -0
  26. package/dist/ListBox/ListBoxItem.torp +107 -0
  27. package/dist/ListBox/ListBoxSeparator.torp +26 -0
  28. package/dist/ListBox/ListBoxTypes.ts +23 -0
  29. package/dist/ListBox/index.d.ts +97 -0
  30. package/dist/ListBox/index.js +14 -0
  31. package/dist/ListBox/index.js.map +1 -0
  32. package/dist/Menu/Menu.torp +19 -14
  33. package/dist/Menu/MenuTypes.ts +5 -4
  34. package/dist/MenuBar/MenuBarItem.torp +5 -8
  35. package/dist/MenuBar/MenuBarTypes.ts +2 -2
  36. package/dist/Modal/Modal.torp +7 -2
  37. package/dist/Modal/ModalTypes.ts +1 -1
  38. package/dist/NavMenu/NavMenu.torp +7 -0
  39. package/dist/NavMenu/NavMenuButton.torp +5 -2
  40. package/dist/NavMenu/NavMenuPopout.torp +1 -1
  41. package/dist/NavMenu/{NavMenuPopoutButton.torp → NavMenuPopoutTrigger.torp} +4 -4
  42. package/dist/NavMenu/NavMenuSeparator.torp +2 -1
  43. package/dist/NavMenu/NavMenuTypes.ts +4 -3
  44. package/dist/NavMenu/index.d.ts +22 -18
  45. package/dist/NavMenu/index.js +4 -4
  46. package/dist/Pagination/Pagination.torp +145 -0
  47. package/dist/Pagination/PaginationItem.torp +100 -0
  48. package/dist/Pagination/PaginationTypes.ts +25 -0
  49. package/dist/Pagination/buildPages.ts +57 -0
  50. package/dist/Pagination/index.d.ts +53 -0
  51. package/dist/Pagination/index.js +40 -0
  52. package/dist/Pagination/index.js.map +1 -0
  53. package/dist/Popover/Popover.torp +8 -3
  54. package/dist/Popover/PopoverTypes.ts +1 -1
  55. package/dist/SelectBox/SelectBox.torp +136 -0
  56. package/dist/SelectBox/SelectBoxContent.torp +81 -0
  57. package/dist/SelectBox/SelectBoxInput.torp +95 -0
  58. package/dist/SelectBox/SelectBoxTrigger.torp +41 -0
  59. package/dist/SelectBox/SelectBoxTypes.ts +18 -0
  60. package/dist/SelectBox/index.d.ts +127 -0
  61. package/dist/SelectBox/index.js +18 -0
  62. package/dist/SelectBox/index.js.map +1 -0
  63. package/dist/TabGroup/TabGroup.torp +3 -3
  64. package/dist/TabGroup/TabGroupTypes.ts +2 -2
  65. package/dist/ToolBar/ToolBar.torp +198 -0
  66. package/dist/ToolBar/ToolBarButton.torp +57 -0
  67. package/dist/ToolBar/ToolBarElement.torp +55 -0
  68. package/dist/ToolBar/ToolBarPopout.torp +97 -0
  69. package/dist/ToolBar/ToolBarPopoutContent.torp +92 -0
  70. package/dist/ToolBar/ToolBarPopoutTrigger.torp +138 -0
  71. package/dist/ToolBar/ToolBarSeparator.torp +25 -0
  72. package/dist/ToolBar/ToolBarTypes.ts +35 -0
  73. package/dist/ToolBar/index.d.ts +212 -0
  74. package/dist/ToolBar/index.js +30 -0
  75. package/dist/ToolBar/index.js.map +1 -0
  76. package/dist/metafile-esm.json +1 -1
  77. package/dist/utils/PopoutTypes.ts +35 -0
  78. package/dist/utils/chartUtils.ts +1 -1
  79. package/package.json +22 -6
  80. /package/dist/{Chart → Charts}/BarChart.torp +0 -0
  81. /package/dist/{Chart → Charts}/DataSeries.ts +0 -0
  82. /package/dist/{Chart → Charts}/LineChart.torp +0 -0
  83. /package/dist/{Chart → Charts}/PieChart.torp +0 -0
  84. /package/dist/{Chart → Charts}/ScatterChart.torp +0 -0
  85. /package/dist/{Chart → Charts}/SparkLine.torp +0 -0
  86. /package/dist/{Chart → Charts}/index.d.ts +0 -0
  87. /package/dist/{Chart → Charts}/index.js.map +0 -0
@@ -0,0 +1,212 @@
1
+ import { type SlotRender } from "@torpor/view";
2
+
3
+
4
+ interface ToolBarProps {
5
+ /** An ID for the root element */
6
+ id?: string;
7
+ /** Classes for the root element */
8
+ class?: ClassValue,
9
+ /** Styles for the root element */
10
+ style?: StyleValue,
11
+ /** An ARIA label for describing the menu to screen readers */
12
+ ariaLabel?: string | undefined,
13
+ /** The orientation of the menu, which affects keyboard navigation */
14
+ orientation?: "horizontal" | "vertical",
15
+ }
16
+
17
+ /**
18
+ * A toolbar is a container for grouping a set of controls, such as buttons, menubuttons, or checkboxes.
19
+ *
20
+ * See [the WAI ARIA guidelines for ToolBars](https://www.w3.org/WAI/ARIA/apg/patterns/toolbar/).
21
+ *
22
+ * The structure of a ToolBar is:
23
+ *
24
+ * ```
25
+ * <ToolBar>
26
+ * <ToolBarButton />
27
+ * <ToolBarSeparator /> (optional)
28
+ * <ToolBarPopout /> (optional)
29
+ * ...
30
+ * </ToolBar>
31
+ * ```
32
+ */
33
+ declare function ToolBar(
34
+ $parent: ParentNode,
35
+ $anchor: Node | null,
36
+ $props: ToolBarProps | undefined,
37
+ $context?: Record<PropertyKey, any>,
38
+ $slots?: Record<string, SlotRender>,
39
+ ): void;
40
+
41
+
42
+
43
+ interface ToolBarButtonProps {
44
+ /** An ID for the root element */
45
+ id?: string;
46
+ /** Classes for the root element */
47
+ class?: ClassValue,
48
+ /** Styles for the root element */
49
+ style?: StyleValue,
50
+ /** Whether this button is disabled */
51
+ disabled?: boolean,
52
+ /** Raised when the button is clicked */
53
+ onclick?: (e: MouseEvent) => void,
54
+ /** Raised when a key is pressed down */
55
+ onkeydown?: (e: KeyboardEvent) => void,
56
+ }
57
+
58
+ /**
59
+ * A button that is placed in a ToolBar.
60
+ *
61
+ */
62
+ declare function ToolBarButton(
63
+ $parent: ParentNode,
64
+ $anchor: Node | null,
65
+ $props: ToolBarButtonProps | undefined,
66
+ $context?: Record<PropertyKey, any>,
67
+ $slots?: Record<string, SlotRender>,
68
+ ): void;
69
+
70
+
71
+
72
+ interface ToolBarElementProps {
73
+ /** An ID for the root element */
74
+ id?: string;
75
+ /** Classes for the root element */
76
+ class?: ClassValue,
77
+ /** Styles for the root element */
78
+ style?: StyleValue,
79
+ /** Whether this button is disabled */
80
+ disabled?: boolean,
81
+ /** An element that can be focused via keyboard navigation */
82
+ element?: HTMLElement,
83
+ }
84
+
85
+ /**
86
+ * An element of any type that can be placed in a ToolBar.
87
+ *
88
+ */
89
+ declare function ToolBarElement(
90
+ $parent: ParentNode,
91
+ $anchor: Node | null,
92
+ $props: ToolBarElementProps | undefined,
93
+ $context?: Record<PropertyKey, any>,
94
+ $slots?: Record<string, SlotRender>,
95
+ ): void;
96
+
97
+
98
+
99
+ interface ToolBarPopoutProps {
100
+ /** An ID for the root element */
101
+ id?: string;
102
+ /** Classes for the root element */
103
+ class?: ClassValue,
104
+ /** Styles for the root element */
105
+ style?: StyleValue,
106
+ /** Whether the popout is visible */
107
+ visible?: boolean,
108
+ /** Raised when the popout is opened or closed */
109
+ ontoggle?: (open: boolean) => void,
110
+ /** Raised when the popout has opened */
111
+ onopen?: () => void,
112
+ /** Raised when the popout has closed */
113
+ onclose?: (result: any) => void,
114
+ }
115
+
116
+ /**
117
+ * A popout that is attached to a menu button and can be used to show a submenu.
118
+ *
119
+ * The structure of a ToolBarPopout is:
120
+ *
121
+ * ```
122
+ * <ToolBarPopout>
123
+ * <ToolBarPopoutTrigger />
124
+ * <ToolBarPopoutContent />
125
+ * </ToolBarPopout>
126
+ * ```
127
+ */
128
+ declare function ToolBarPopout(
129
+ $parent: ParentNode,
130
+ $anchor: Node | null,
131
+ $props: ToolBarPopoutProps | undefined,
132
+ $context?: Record<PropertyKey, any>,
133
+ $slots?: Record<string, SlotRender>,
134
+ ): void;
135
+
136
+
137
+
138
+ interface ToolBarPopoutContentProps {
139
+ /** An ID for the root element */
140
+ id?: string;
141
+ /** Classes for the root element */
142
+ class?: ClassValue,
143
+ /** Styles for the root element */
144
+ style?: StyleValue,
145
+ /** Where the popout will be shown, relative to the popout button */
146
+ side?: "top" | "right" | "bottom" | "left",
147
+ /** How the popout will be aligned, relative to the popout button */
148
+ alignment?: "start" | "center" | "end",
149
+ }
150
+
151
+ /**
152
+ * The content that is displayed for a ToolBarPopout when it is open.
153
+ *
154
+ */
155
+ declare function ToolBarPopoutContent(
156
+ $parent: ParentNode,
157
+ $anchor: Node | null,
158
+ $props: ToolBarPopoutContentProps | undefined,
159
+ $context?: Record<PropertyKey, any>,
160
+ $slots?: Record<string, SlotRender>,
161
+ ): void;
162
+
163
+
164
+
165
+ interface ToolBarPopoutTriggerProps {
166
+ /** An ID for the root element */
167
+ id?: string;
168
+ /** Classes for the root element */
169
+ class?: ClassValue,
170
+ /** Styles for the root element */
171
+ style?: StyleValue,
172
+ /** The delay before showing the popout, in milliseconds */
173
+ hoverDelay?: number,
174
+ /** Whether this button is disabled */
175
+ disabled?: boolean,
176
+ }
177
+
178
+ /**
179
+ * A button that is placed in a ToolBar and signals a response by a user.
180
+ *
181
+ */
182
+ declare function ToolBarPopoutTrigger(
183
+ $parent: ParentNode,
184
+ $anchor: Node | null,
185
+ $props: ToolBarPopoutTriggerProps | undefined,
186
+ $context?: Record<PropertyKey, any>,
187
+ $slots?: Record<string, SlotRender>,
188
+ ): void;
189
+
190
+
191
+
192
+ interface ToolBarSeparatorProps {
193
+ /** An ID for the root element */
194
+ id?: string;
195
+ /** Classes for the root element */
196
+ class?: ClassValue,
197
+ /** Styles for the root element */
198
+ style?: StyleValue,
199
+ }
200
+
201
+ /**
202
+ * An element in a menu that separates logical sets of menu items.
203
+ */
204
+ declare function ToolBarSeparator(
205
+ $parent: ParentNode,
206
+ $anchor: Node | null,
207
+ $props: ToolBarSeparatorProps | undefined,
208
+ $context?: Record<PropertyKey, any>,
209
+ $slots?: Record<string, SlotRender>,
210
+ ): void;
211
+
212
+ export { ToolBar, ToolBarButton, ToolBarElement, ToolBarPopout, ToolBarPopoutContent, ToolBarPopoutTrigger, ToolBarSeparator };
@@ -0,0 +1,30 @@
1
+ // src/ToolBar/ToolBar.torp
2
+ import ToolBar_default from "./ToolBar.torp";
3
+
4
+ // src/ToolBar/ToolBarButton.torp
5
+ import ToolBarButton_default from "./ToolBarButton.torp";
6
+
7
+ // src/ToolBar/ToolBarElement.torp
8
+ import ToolBarElement_default from "./ToolBarElement.torp";
9
+
10
+ // src/ToolBar/ToolBarPopout.torp
11
+ import ToolBarPopout_default from "./ToolBarPopout.torp";
12
+
13
+ // src/ToolBar/ToolBarPopoutContent.torp
14
+ import ToolBarPopoutContent_default from "./ToolBarPopoutContent.torp";
15
+
16
+ // src/ToolBar/ToolBarPopoutTrigger.torp
17
+ import ToolBarPopoutTrigger_default from "./ToolBarPopoutTrigger.torp";
18
+
19
+ // src/ToolBar/ToolBarSeparator.torp
20
+ import ToolBarSeparator_default from "./ToolBarSeparator.torp";
21
+ export {
22
+ ToolBar_default as ToolBar,
23
+ ToolBarButton_default as ToolBarButton,
24
+ ToolBarElement_default as ToolBarElement,
25
+ ToolBarPopout_default as ToolBarPopout,
26
+ ToolBarPopoutContent_default as ToolBarPopoutContent,
27
+ ToolBarPopoutTrigger_default as ToolBarPopoutTrigger,
28
+ ToolBarSeparator_default as ToolBarSeparator
29
+ };
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}