@proyecto-viviana/solidaria-components 0.2.4 → 0.2.9

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 (194) hide show
  1. package/LICENSE +21 -0
  2. package/dist/ActionBar.d.ts +71 -0
  3. package/dist/ActionBar.d.ts.map +1 -0
  4. package/dist/ActionGroup.d.ts +74 -0
  5. package/dist/ActionGroup.d.ts.map +1 -0
  6. package/dist/Alert.d.ts +70 -0
  7. package/dist/Alert.d.ts.map +1 -0
  8. package/dist/Breadcrumbs.d.ts +10 -2
  9. package/dist/Breadcrumbs.d.ts.map +1 -1
  10. package/dist/Button.d.ts +4 -0
  11. package/dist/Button.d.ts.map +1 -1
  12. package/dist/Calendar.d.ts +13 -0
  13. package/dist/Calendar.d.ts.map +1 -1
  14. package/dist/Checkbox.d.ts +2 -2
  15. package/dist/Checkbox.d.ts.map +1 -1
  16. package/dist/Collection.d.ts +125 -0
  17. package/dist/Collection.d.ts.map +1 -0
  18. package/dist/Color.d.ts +114 -2
  19. package/dist/Color.d.ts.map +1 -1
  20. package/dist/ColorEditor.d.ts +42 -0
  21. package/dist/ColorEditor.d.ts.map +1 -0
  22. package/dist/ComboBox.d.ts +64 -0
  23. package/dist/ComboBox.d.ts.map +1 -1
  24. package/dist/ContextualHelpTrigger.d.ts +40 -0
  25. package/dist/ContextualHelpTrigger.d.ts.map +1 -0
  26. package/dist/DateField.d.ts +27 -2
  27. package/dist/DateField.d.ts.map +1 -1
  28. package/dist/DatePicker.d.ts +67 -2
  29. package/dist/DatePicker.d.ts.map +1 -1
  30. package/dist/Dialog.d.ts.map +1 -1
  31. package/dist/Disclosure.d.ts +2 -0
  32. package/dist/Disclosure.d.ts.map +1 -1
  33. package/dist/DragAndDrop.d.ts +80 -0
  34. package/dist/DragAndDrop.d.ts.map +1 -0
  35. package/dist/DragPreview.d.ts +14 -0
  36. package/dist/DragPreview.d.ts.map +1 -0
  37. package/dist/DropZone.d.ts +27 -0
  38. package/dist/DropZone.d.ts.map +1 -0
  39. package/dist/FieldError.d.ts +23 -0
  40. package/dist/FieldError.d.ts.map +1 -0
  41. package/dist/FileTrigger.d.ts +26 -0
  42. package/dist/FileTrigger.d.ts.map +1 -0
  43. package/dist/Focusable.d.ts +27 -0
  44. package/dist/Focusable.d.ts.map +1 -0
  45. package/dist/Form.d.ts +27 -0
  46. package/dist/Form.d.ts.map +1 -0
  47. package/dist/GridList.d.ts +40 -1
  48. package/dist/GridList.d.ts.map +1 -1
  49. package/dist/Icon.d.ts +57 -0
  50. package/dist/Icon.d.ts.map +1 -0
  51. package/dist/Keyboard.d.ts +13 -0
  52. package/dist/Keyboard.d.ts.map +1 -0
  53. package/dist/Link.d.ts.map +1 -1
  54. package/dist/ListBox.d.ts +43 -1
  55. package/dist/ListBox.d.ts.map +1 -1
  56. package/dist/ListDropTargetDelegate.d.ts +38 -0
  57. package/dist/ListDropTargetDelegate.d.ts.map +1 -0
  58. package/dist/Menu.d.ts +20 -2
  59. package/dist/Menu.d.ts.map +1 -1
  60. package/dist/Meter.d.ts +2 -2
  61. package/dist/Meter.d.ts.map +1 -1
  62. package/dist/Modal.d.ts +2 -0
  63. package/dist/Modal.d.ts.map +1 -1
  64. package/dist/NumberField.d.ts +2 -0
  65. package/dist/NumberField.d.ts.map +1 -1
  66. package/dist/Popover.d.ts +4 -2
  67. package/dist/Popover.d.ts.map +1 -1
  68. package/dist/Pressable.d.ts +27 -0
  69. package/dist/Pressable.d.ts.map +1 -0
  70. package/dist/ProgressBar.d.ts +2 -2
  71. package/dist/ProgressBar.d.ts.map +1 -1
  72. package/dist/RadioGroup.d.ts.map +1 -1
  73. package/dist/RangeCalendar.d.ts +5 -0
  74. package/dist/RangeCalendar.d.ts.map +1 -1
  75. package/dist/RouterProvider.d.ts +75 -0
  76. package/dist/RouterProvider.d.ts.map +1 -0
  77. package/dist/SearchField.d.ts +2 -3
  78. package/dist/SearchField.d.ts.map +1 -1
  79. package/dist/Select.d.ts +11 -0
  80. package/dist/Select.d.ts.map +1 -1
  81. package/dist/SelectionIndicator.d.ts +30 -0
  82. package/dist/SelectionIndicator.d.ts.map +1 -0
  83. package/dist/SharedElementTransition.d.ts +39 -0
  84. package/dist/SharedElementTransition.d.ts.map +1 -0
  85. package/dist/Slider.d.ts +6 -3
  86. package/dist/Slider.d.ts.map +1 -1
  87. package/dist/Table.d.ts +39 -0
  88. package/dist/Table.d.ts.map +1 -1
  89. package/dist/Tabs.d.ts +4 -3
  90. package/dist/Tabs.d.ts.map +1 -1
  91. package/dist/TagGroup.d.ts +12 -2
  92. package/dist/TagGroup.d.ts.map +1 -1
  93. package/dist/Text.d.ts +10 -0
  94. package/dist/Text.d.ts.map +1 -0
  95. package/dist/TextField.d.ts +4 -0
  96. package/dist/TextField.d.ts.map +1 -1
  97. package/dist/TimeField.d.ts +26 -1
  98. package/dist/TimeField.d.ts.map +1 -1
  99. package/dist/Toast.d.ts.map +1 -1
  100. package/dist/ToggleButton.d.ts +30 -0
  101. package/dist/ToggleButton.d.ts.map +1 -0
  102. package/dist/ToggleButtonGroup.d.ts +33 -0
  103. package/dist/ToggleButtonGroup.d.ts.map +1 -0
  104. package/dist/Toolbar.d.ts.map +1 -1
  105. package/dist/Tooltip.d.ts +9 -0
  106. package/dist/Tooltip.d.ts.map +1 -1
  107. package/dist/Tree.d.ts +44 -2
  108. package/dist/Tree.d.ts.map +1 -1
  109. package/dist/Virtualizer.d.ts +61 -0
  110. package/dist/Virtualizer.d.ts.map +1 -0
  111. package/dist/VirtualizerLayouts.d.ts +82 -0
  112. package/dist/VirtualizerLayouts.d.ts.map +1 -0
  113. package/dist/VisuallyHidden.d.ts +3 -1
  114. package/dist/VisuallyHidden.d.ts.map +1 -1
  115. package/dist/contexts.d.ts +1 -0
  116. package/dist/contexts.d.ts.map +1 -1
  117. package/dist/index.d.ts +57 -25
  118. package/dist/index.d.ts.map +1 -1
  119. package/dist/index.js +13961 -5946
  120. package/dist/index.js.map +1 -7
  121. package/dist/index.ssr.js +9612 -2401
  122. package/dist/index.ssr.js.map +1 -7
  123. package/dist/useDragAndDrop.d.ts +93 -0
  124. package/dist/useDragAndDrop.d.ts.map +1 -0
  125. package/dist/utils.d.ts +7 -1
  126. package/dist/utils.d.ts.map +1 -1
  127. package/dist/virtualizer/Layout.d.ts +79 -0
  128. package/dist/virtualizer/Layout.d.ts.map +1 -0
  129. package/package.json +8 -6
  130. package/src/ActionBar.tsx +248 -0
  131. package/src/ActionGroup.tsx +285 -0
  132. package/src/Alert.tsx +177 -0
  133. package/src/Autocomplete.tsx +1 -1
  134. package/src/Breadcrumbs.tsx +103 -17
  135. package/src/Button.tsx +65 -21
  136. package/src/Calendar.tsx +179 -53
  137. package/src/Checkbox.tsx +1 -2
  138. package/src/Collection.tsx +341 -0
  139. package/src/Color.tsx +652 -34
  140. package/src/ColorEditor.tsx +231 -0
  141. package/src/ComboBox.tsx +315 -81
  142. package/src/ContextualHelpTrigger.tsx +183 -0
  143. package/src/DateField.tsx +93 -19
  144. package/src/DatePicker.tsx +495 -25
  145. package/src/Dialog.tsx +40 -9
  146. package/src/Disclosure.tsx +33 -27
  147. package/src/DragAndDrop.tsx +334 -0
  148. package/src/DragPreview.tsx +45 -0
  149. package/src/DropZone.tsx +213 -0
  150. package/src/FieldError.tsx +67 -0
  151. package/src/FileTrigger.tsx +83 -0
  152. package/src/Focusable.tsx +106 -0
  153. package/src/Form.tsx +85 -0
  154. package/src/GridList.tsx +379 -41
  155. package/src/Icon.tsx +154 -0
  156. package/src/Keyboard.tsx +26 -0
  157. package/src/Link.tsx +14 -1
  158. package/src/ListBox.tsx +484 -33
  159. package/src/ListDropTargetDelegate.ts +282 -0
  160. package/src/Menu.tsx +388 -35
  161. package/src/Meter.tsx +7 -3
  162. package/src/Modal.tsx +32 -4
  163. package/src/NumberField.tsx +163 -43
  164. package/src/Popover.tsx +136 -180
  165. package/src/Pressable.tsx +108 -0
  166. package/src/ProgressBar.tsx +7 -3
  167. package/src/RadioGroup.tsx +35 -25
  168. package/src/RangeCalendar.tsx +100 -68
  169. package/src/RouterProvider.tsx +240 -0
  170. package/src/SearchField.tsx +142 -34
  171. package/src/Select.tsx +221 -73
  172. package/src/SelectionIndicator.tsx +105 -0
  173. package/src/SharedElementTransition.tsx +258 -0
  174. package/src/Slider.tsx +16 -6
  175. package/src/Table.tsx +417 -57
  176. package/src/Tabs.tsx +68 -35
  177. package/src/TagGroup.tsx +121 -36
  178. package/src/Text.tsx +18 -0
  179. package/src/TextField.tsx +25 -8
  180. package/src/TimeField.tsx +101 -151
  181. package/src/Toast.tsx +108 -14
  182. package/src/ToggleButton.tsx +159 -0
  183. package/src/ToggleButtonGroup.tsx +136 -0
  184. package/src/Toolbar.tsx +14 -8
  185. package/src/Tooltip.tsx +108 -19
  186. package/src/Tree.tsx +1143 -87
  187. package/src/Virtualizer.tsx +702 -0
  188. package/src/VirtualizerLayouts.ts +265 -0
  189. package/src/VisuallyHidden.tsx +15 -21
  190. package/src/contexts.ts +1 -0
  191. package/src/index.ts +1057 -620
  192. package/src/useDragAndDrop.ts +351 -0
  193. package/src/utils.tsx +37 -3
  194. package/src/virtualizer/Layout.ts +200 -0
@@ -0,0 +1,265 @@
1
+ /**
2
+ * Layout primitives for solidaria-components Virtualizer.
3
+ *
4
+ * These are lightweight parity contracts inspired by RAC virtualizer layout APIs.
5
+ */
6
+
7
+ export interface Point {
8
+ x: number;
9
+ y: number;
10
+ }
11
+
12
+ export interface Rect {
13
+ x: number;
14
+ y: number;
15
+ width: number;
16
+ height: number;
17
+ }
18
+
19
+ export interface Size {
20
+ width: number;
21
+ height: number;
22
+ }
23
+
24
+ export interface LayoutInfo {
25
+ key: string | number;
26
+ index: number;
27
+ rect: Rect;
28
+ }
29
+
30
+ export interface VirtualizerVisibleRange {
31
+ start: number;
32
+ end: number;
33
+ offsetTop: number;
34
+ offsetBottom: number;
35
+ }
36
+
37
+ export interface VirtualizerRangeContext {
38
+ itemCount: number;
39
+ scrollOffset: number;
40
+ viewportSize: number;
41
+ overscan: number;
42
+ viewportWidth?: number;
43
+ }
44
+
45
+ export interface DefaultVirtualizerLayoutOptions {
46
+ itemSize?: number;
47
+ overscan?: number;
48
+ viewportSize?: number;
49
+ }
50
+
51
+ export interface GridLayoutOptions extends DefaultVirtualizerLayoutOptions {
52
+ rowHeight?: number;
53
+ columnCount?: number;
54
+ viewportWidth?: number;
55
+ }
56
+
57
+ export interface WaterfallLayoutOptions extends GridLayoutOptions {
58
+ minColumnWidth?: number;
59
+ viewportWidth?: number;
60
+ gap?: number;
61
+ }
62
+
63
+ export interface VirtualizerLayoutInfoContext {
64
+ viewportWidth: number;
65
+ }
66
+
67
+ export interface VirtualizerDropTarget {
68
+ type: 'item' | 'root';
69
+ index: number;
70
+ position: 'before' | 'on' | 'after';
71
+ key?: string | number;
72
+ parentKey?: string | number | null;
73
+ level?: number;
74
+ }
75
+
76
+ function clampRange(itemCount: number, start: number, end: number, itemSize: number): VirtualizerVisibleRange {
77
+ const safeStart = Math.max(0, Math.min(start, itemCount));
78
+ const safeEnd = Math.max(safeStart, Math.min(end, itemCount));
79
+ return {
80
+ start: safeStart,
81
+ end: safeEnd,
82
+ offsetTop: safeStart * itemSize,
83
+ offsetBottom: Math.max(0, (itemCount - safeEnd) * itemSize),
84
+ };
85
+ }
86
+
87
+ export function calculateLinearVisibleRange(
88
+ itemCount: number,
89
+ scrollOffset: number,
90
+ viewportSize: number,
91
+ itemSize: number,
92
+ overscan: number
93
+ ): VirtualizerVisibleRange {
94
+ if (itemCount <= 0) return { start: 0, end: 0, offsetTop: 0, offsetBottom: 0 };
95
+ const safeItemSize = Math.max(1, itemSize);
96
+ const safeViewport = Math.max(1, viewportSize);
97
+ const safeOverscan = Math.max(0, overscan);
98
+ const start = Math.floor(scrollOffset / safeItemSize) - safeOverscan;
99
+ const visibleCount = Math.ceil(safeViewport / safeItemSize) + safeOverscan * 2;
100
+ return clampRange(itemCount, start, start + visibleCount, safeItemSize);
101
+ }
102
+
103
+ export class ListLayout {
104
+ getVisibleRange(
105
+ ctx: VirtualizerRangeContext,
106
+ options?: DefaultVirtualizerLayoutOptions
107
+ ): VirtualizerVisibleRange {
108
+ return calculateLinearVisibleRange(
109
+ ctx.itemCount,
110
+ ctx.scrollOffset,
111
+ ctx.viewportSize,
112
+ options?.itemSize ?? 40,
113
+ options?.overscan ?? ctx.overscan
114
+ );
115
+ }
116
+
117
+ getLayoutInfo(
118
+ index: number,
119
+ context: VirtualizerLayoutInfoContext,
120
+ options?: DefaultVirtualizerLayoutOptions
121
+ ): LayoutInfo {
122
+ const itemHeight = Math.max(1, options?.itemSize ?? 40);
123
+ return {
124
+ key: String(index),
125
+ index,
126
+ rect: {
127
+ x: 0,
128
+ y: index * itemHeight,
129
+ width: Math.max(0, context.viewportWidth),
130
+ height: itemHeight,
131
+ },
132
+ };
133
+ }
134
+
135
+ getDropTargetFromPoint(
136
+ point: Point,
137
+ itemCount: number,
138
+ options?: DefaultVirtualizerLayoutOptions
139
+ ): VirtualizerDropTarget | null {
140
+ if (itemCount <= 0) return { type: 'root', index: -1, position: 'on' };
141
+ const itemHeight = Math.max(1, options?.itemSize ?? 40);
142
+ if (point.y < 0) {
143
+ return { type: 'item', index: 0, position: 'before' };
144
+ }
145
+ const totalHeight = itemCount * itemHeight;
146
+ if (point.y >= totalHeight) {
147
+ return { type: 'item', index: itemCount - 1, position: 'after' };
148
+ }
149
+ const rawIndex = Math.floor(point.y / itemHeight);
150
+ const index = Math.max(0, Math.min(rawIndex, itemCount - 1));
151
+ const offsetWithinItem = Math.max(0, point.y - index * itemHeight);
152
+ const threshold = itemHeight / 3;
153
+ const position: VirtualizerDropTarget['position'] =
154
+ offsetWithinItem < threshold
155
+ ? 'before'
156
+ : offsetWithinItem > threshold * 2
157
+ ? 'after'
158
+ : 'on';
159
+ return { type: 'item', index, position };
160
+ }
161
+ }
162
+
163
+ export class TableLayout extends ListLayout {}
164
+
165
+ export class GridLayout {
166
+ getVisibleRange(ctx: VirtualizerRangeContext, options?: GridLayoutOptions): VirtualizerVisibleRange {
167
+ if (ctx.itemCount <= 0) return { start: 0, end: 0, offsetTop: 0, offsetBottom: 0 };
168
+ const rowHeight = Math.max(1, options?.rowHeight ?? options?.itemSize ?? 40);
169
+ const columns = Math.max(1, options?.columnCount ?? 1);
170
+ const safeViewport = Math.max(1, ctx.viewportSize);
171
+ const safeOverscan = Math.max(0, options?.overscan ?? ctx.overscan);
172
+
173
+ const startRow = Math.max(0, Math.floor(ctx.scrollOffset / rowHeight) - safeOverscan);
174
+ const visibleRows = Math.ceil(safeViewport / rowHeight) + safeOverscan * 2;
175
+ const endRow = startRow + visibleRows;
176
+
177
+ const start = startRow * columns;
178
+ const end = Math.min(ctx.itemCount, endRow * columns);
179
+
180
+ const totalRows = Math.ceil(ctx.itemCount / columns);
181
+ const clampedStartRow = Math.floor(start / columns);
182
+ const renderedRows = Math.ceil((end - start) / columns);
183
+ const offsetTop = clampedStartRow * rowHeight;
184
+ const offsetBottom = Math.max(0, (totalRows - clampedStartRow - renderedRows) * rowHeight);
185
+
186
+ return { start, end, offsetTop, offsetBottom };
187
+ }
188
+
189
+ getLayoutInfo(index: number, context: VirtualizerLayoutInfoContext, options?: GridLayoutOptions): LayoutInfo {
190
+ const rowHeight = Math.max(1, options?.rowHeight ?? options?.itemSize ?? 40);
191
+ const columns = Math.max(1, options?.columnCount ?? 1);
192
+ const row = Math.floor(index / columns);
193
+ const col = index % columns;
194
+ const width = Math.max(1, context.viewportWidth);
195
+ const cellWidth = Math.floor(width / columns);
196
+ return {
197
+ key: String(index),
198
+ index,
199
+ rect: {
200
+ x: col * cellWidth,
201
+ y: row * rowHeight,
202
+ width: cellWidth,
203
+ height: rowHeight,
204
+ },
205
+ };
206
+ }
207
+
208
+ getDropTargetFromPoint(
209
+ point: Point,
210
+ itemCount: number,
211
+ options?: GridLayoutOptions
212
+ ): VirtualizerDropTarget | null {
213
+ if (itemCount <= 0) return { type: 'root', index: -1, position: 'on' };
214
+ const rowHeight = Math.max(1, options?.rowHeight ?? options?.itemSize ?? 40);
215
+ const columns = Math.max(1, options?.columnCount ?? 1);
216
+ const totalRows = Math.ceil(itemCount / columns);
217
+ const totalHeight = totalRows * rowHeight;
218
+ if (point.y < 0) {
219
+ return { type: 'item', index: 0, position: 'before' };
220
+ }
221
+ if (point.y >= totalHeight) {
222
+ return { type: 'item', index: itemCount - 1, position: 'after' };
223
+ }
224
+ const width = Math.max(1, options?.viewportWidth ?? 320);
225
+ const cellWidth = width / columns;
226
+ const row = Math.max(0, Math.floor(point.y / rowHeight));
227
+ const col = Math.max(0, Math.min(columns - 1, Math.floor(Math.max(0, point.x) / cellWidth)));
228
+ const index = Math.max(0, Math.min(itemCount - 1, row * columns + col));
229
+ const withinRow = Math.max(0, point.y - row * rowHeight);
230
+ const threshold = rowHeight / 3;
231
+ const position: VirtualizerDropTarget['position'] =
232
+ withinRow < threshold ? 'before' : withinRow > threshold * 2 ? 'after' : 'on';
233
+ return { type: 'item', index, position };
234
+ }
235
+ }
236
+
237
+ export class WaterfallLayout extends GridLayout {
238
+ override getVisibleRange(ctx: VirtualizerRangeContext, options?: WaterfallLayoutOptions): VirtualizerVisibleRange {
239
+ const width = Math.max(1, options?.viewportWidth ?? 320);
240
+ const minColumnWidth = Math.max(1, options?.minColumnWidth ?? 200);
241
+ const gap = Math.max(0, options?.gap ?? 0);
242
+ const columnCount = Math.max(1, Math.floor((width + gap) / (minColumnWidth + gap)));
243
+ return super.getVisibleRange(ctx, { ...options, columnCount });
244
+ }
245
+
246
+ override getLayoutInfo(index: number, context: VirtualizerLayoutInfoContext, options?: WaterfallLayoutOptions): LayoutInfo {
247
+ const width = Math.max(1, options?.viewportWidth ?? context.viewportWidth);
248
+ const minColumnWidth = Math.max(1, options?.minColumnWidth ?? 200);
249
+ const gap = Math.max(0, options?.gap ?? 0);
250
+ const columnCount = Math.max(1, Math.floor((width + gap) / (minColumnWidth + gap)));
251
+ return super.getLayoutInfo(index, context, { ...options, columnCount });
252
+ }
253
+
254
+ override getDropTargetFromPoint(
255
+ point: Point,
256
+ itemCount: number,
257
+ options?: WaterfallLayoutOptions
258
+ ): VirtualizerDropTarget | null {
259
+ const width = Math.max(1, options?.viewportWidth ?? 320);
260
+ const minColumnWidth = Math.max(1, options?.minColumnWidth ?? 200);
261
+ const gap = Math.max(0, options?.gap ?? 0);
262
+ const columnCount = Math.max(1, Math.floor((width + gap) / (minColumnWidth + gap)));
263
+ return super.getDropTargetFromPoint(point, itemCount, { ...options, columnCount });
264
+ }
265
+ }
@@ -7,35 +7,21 @@
7
7
 
8
8
  import { type JSX, type ParentProps, splitProps } from 'solid-js';
9
9
  import { Dynamic } from 'solid-js/web';
10
+ import { createVisuallyHidden, mergeProps } from '@proyecto-viviana/solidaria';
10
11
 
11
12
  // ============================================
12
13
  // TYPES
13
14
  // ============================================
14
15
 
15
- export interface VisuallyHiddenProps extends ParentProps {
16
+ export interface VisuallyHiddenProps extends ParentProps, JSX.HTMLAttributes<HTMLElement> {
16
17
  /** The element type to render. @default 'span' */
17
18
  elementType?: keyof JSX.IntrinsicElements;
18
19
  /** Whether the element should be focusable when focused. */
19
20
  isFocusable?: boolean;
21
+ /** Inline style object merged with visually hidden styles. */
22
+ style?: JSX.CSSProperties;
20
23
  }
21
24
 
22
- // ============================================
23
- // STYLES
24
- // ============================================
25
-
26
- const visuallyHiddenStyles: JSX.CSSProperties = {
27
- border: '0',
28
- clip: 'rect(0 0 0 0)',
29
- 'clip-path': 'inset(50%)',
30
- height: '1px',
31
- margin: '-1px',
32
- overflow: 'hidden',
33
- padding: '0',
34
- position: 'absolute',
35
- width: '1px',
36
- 'white-space': 'nowrap',
37
- };
38
-
39
25
  // ============================================
40
26
  // COMPONENT
41
27
  // ============================================
@@ -44,15 +30,23 @@ const visuallyHiddenStyles: JSX.CSSProperties = {
44
30
  * VisuallyHidden hides its children visually, while keeping content visible to screen readers.
45
31
  */
46
32
  export function VisuallyHidden(props: VisuallyHiddenProps): JSX.Element {
47
- const [local, others] = splitProps(props, ['elementType', 'isFocusable']);
33
+ const [local, others] = splitProps(props, ['elementType', 'isFocusable', 'style']);
34
+ const { visuallyHiddenProps } = createVisuallyHidden(() => ({
35
+ style: local.style,
36
+ isFocusable: local.isFocusable,
37
+ }));
48
38
 
49
39
  const elementType = () => local.elementType ?? 'span';
40
+ const mergedProps = () =>
41
+ mergeProps<Record<string, unknown>>(
42
+ others as unknown as Record<string, unknown>,
43
+ visuallyHiddenProps() as unknown as Record<string, unknown>
44
+ );
50
45
 
51
46
  return (
52
47
  <Dynamic
53
48
  component={elementType()}
54
- style={visuallyHiddenStyles}
55
- {...others}
49
+ {...mergedProps()}
56
50
  >
57
51
  {props.children}
58
52
  </Dynamic>
package/src/contexts.ts CHANGED
@@ -35,6 +35,7 @@ export function useOverlayTriggerState(): OverlayTriggerState | null {
35
35
  export interface DialogTriggerContextValue {
36
36
  state: StatelyOverlayTriggerState
37
37
  triggerRef: () => HTMLElement | null
38
+ setTriggerRef: (el: HTMLElement | null) => void
38
39
  triggerId: string
39
40
  }
40
41