@proyecto-viviana/solidaria-components 0.2.9 → 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.
- package/README.md +39 -272
- package/dist/ActionBar.d.ts +21 -13
- package/dist/ActionBar.d.ts.map +1 -1
- package/dist/ActionGroup.d.ts +8 -8
- package/dist/ActionGroup.d.ts.map +1 -1
- package/dist/Alert.d.ts +5 -5
- package/dist/Alert.d.ts.map +1 -1
- package/dist/Autocomplete.d.ts +5 -5
- package/dist/Autocomplete.d.ts.map +1 -1
- package/dist/Breadcrumbs.d.ts +18 -7
- package/dist/Breadcrumbs.d.ts.map +1 -1
- package/dist/Button.d.ts +24 -5
- package/dist/Button.d.ts.map +1 -1
- package/dist/Calendar.d.ts +38 -7
- package/dist/Calendar.d.ts.map +1 -1
- package/dist/Checkbox.d.ts +32 -7
- package/dist/Checkbox.d.ts.map +1 -1
- package/dist/Collection.d.ts +19 -14
- package/dist/Collection.d.ts.map +1 -1
- package/dist/Color.d.ts +103 -14
- package/dist/Color.d.ts.map +1 -1
- package/dist/ColorEditor.d.ts +6 -6
- package/dist/ColorEditor.d.ts.map +1 -1
- package/dist/ComboBox.d.ts +85 -19
- package/dist/ComboBox.d.ts.map +1 -1
- package/dist/ContextualHelpTrigger.d.ts +2 -2
- package/dist/ContextualHelpTrigger.d.ts.map +1 -1
- package/dist/DateField.d.ts +8 -6
- package/dist/DateField.d.ts.map +1 -1
- package/dist/DatePicker.d.ts +53 -22
- package/dist/DatePicker.d.ts.map +1 -1
- package/dist/DateRangePickerContext.d.ts +30 -0
- package/dist/DateRangePickerContext.d.ts.map +1 -0
- package/dist/Dialog.d.ts +5 -5
- package/dist/Dialog.d.ts.map +1 -1
- package/dist/Disclosure.d.ts +23 -5
- package/dist/Disclosure.d.ts.map +1 -1
- package/dist/DragAndDrop.d.ts +6 -6
- package/dist/DragAndDrop.d.ts.map +1 -1
- package/dist/DragPreview.d.ts +2 -2
- package/dist/DragPreview.d.ts.map +1 -1
- package/dist/DropZone.d.ts +4 -4
- package/dist/DropZone.d.ts.map +1 -1
- package/dist/FieldError.d.ts +9 -5
- package/dist/FieldError.d.ts.map +1 -1
- package/dist/FileTrigger.d.ts +3 -3
- package/dist/FileTrigger.d.ts.map +1 -1
- package/dist/Focusable.d.ts +2 -2
- package/dist/Focusable.d.ts.map +1 -1
- package/dist/Form.d.ts +18 -4
- package/dist/Form.d.ts.map +1 -1
- package/dist/GridList.d.ts +32 -12
- package/dist/GridList.d.ts.map +1 -1
- package/dist/HiddenDateInput.d.ts +26 -0
- package/dist/HiddenDateInput.d.ts.map +1 -0
- package/dist/HiddenTimeInput.d.ts +25 -0
- package/dist/HiddenTimeInput.d.ts.map +1 -0
- package/dist/Icon.d.ts +5 -5
- package/dist/Icon.d.ts.map +1 -1
- package/dist/Keyboard.d.ts +1 -1
- package/dist/Landmark.d.ts +3 -3
- package/dist/Landmark.d.ts.map +1 -1
- package/dist/Link.d.ts +10 -4
- package/dist/Link.d.ts.map +1 -1
- package/dist/ListBox.d.ts +32 -12
- package/dist/ListBox.d.ts.map +1 -1
- package/dist/ListDropTargetDelegate.d.ts +6 -6
- package/dist/ListDropTargetDelegate.d.ts.map +1 -1
- package/dist/Menu.d.ts +65 -14
- package/dist/Menu.d.ts.map +1 -1
- package/dist/Meter.d.ts +3 -3
- package/dist/Meter.d.ts.map +1 -1
- package/dist/Modal.d.ts +5 -5
- package/dist/Modal.d.ts.map +1 -1
- package/dist/NumberField.d.ts +8 -12
- package/dist/NumberField.d.ts.map +1 -1
- package/dist/Popover.d.ts +28 -5
- package/dist/Popover.d.ts.map +1 -1
- package/dist/Pressable.d.ts +2 -2
- package/dist/Pressable.d.ts.map +1 -1
- package/dist/ProgressBar.d.ts +5 -3
- package/dist/ProgressBar.d.ts.map +1 -1
- package/dist/RadioGroup.d.ts +43 -9
- package/dist/RadioGroup.d.ts.map +1 -1
- package/dist/RangeCalendar.d.ts +34 -7
- package/dist/RangeCalendar.d.ts.map +1 -1
- package/dist/RouterProvider.d.ts +2 -2
- package/dist/RouterProvider.d.ts.map +1 -1
- package/dist/SearchField.d.ts +23 -20
- package/dist/SearchField.d.ts.map +1 -1
- package/dist/Select.d.ts +41 -11
- package/dist/Select.d.ts.map +1 -1
- package/dist/SelectionIndicator.d.ts +3 -3
- package/dist/SelectionIndicator.d.ts.map +1 -1
- package/dist/Separator.d.ts +9 -3
- package/dist/Separator.d.ts.map +1 -1
- package/dist/SharedElementTransition.d.ts +6 -4
- package/dist/SharedElementTransition.d.ts.map +1 -1
- package/dist/Slider.d.ts +12 -8
- package/dist/Slider.d.ts.map +1 -1
- package/dist/StepList.d.ts +90 -0
- package/dist/StepList.d.ts.map +1 -0
- package/dist/Switch.d.ts +11 -5
- package/dist/Switch.d.ts.map +1 -1
- package/dist/Table.d.ts +187 -23
- package/dist/Table.d.ts.map +1 -1
- package/dist/Tabs.d.ts +45 -9
- package/dist/Tabs.d.ts.map +1 -1
- package/dist/TagGroup.d.ts +12 -10
- package/dist/TagGroup.d.ts.map +1 -1
- package/dist/Text.d.ts +2 -2
- package/dist/TextField.d.ts +15 -11
- package/dist/TextField.d.ts.map +1 -1
- package/dist/TimeField.d.ts +6 -6
- package/dist/TimeField.d.ts.map +1 -1
- package/dist/Toast.d.ts +29 -14
- package/dist/Toast.d.ts.map +1 -1
- package/dist/ToggleButton.d.ts +11 -5
- package/dist/ToggleButton.d.ts.map +1 -1
- package/dist/ToggleButtonGroup.d.ts +7 -7
- package/dist/ToggleButtonGroup.d.ts.map +1 -1
- package/dist/Toolbar.d.ts +7 -3
- package/dist/Toolbar.d.ts.map +1 -1
- package/dist/Tooltip.d.ts +50 -8
- package/dist/Tooltip.d.ts.map +1 -1
- package/dist/Tree.d.ts +66 -17
- package/dist/Tree.d.ts.map +1 -1
- package/dist/Virtualizer.d.ts +12 -12
- package/dist/Virtualizer.d.ts.map +1 -1
- package/dist/VirtualizerLayouts.d.ts +2 -2
- package/dist/VirtualizerLayouts.d.ts.map +1 -1
- package/dist/VisuallyHidden.d.ts +1 -1
- package/dist/VisuallyHidden.d.ts.map +1 -1
- package/dist/contexts.d.ts +5 -1
- package/dist/contexts.d.ts.map +1 -1
- package/dist/index.d.ts +73 -71
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23247 -18564
- package/dist/index.js.map +1 -1
- package/dist/index.jsx +18110 -0
- package/dist/index.jsx.map +1 -0
- package/dist/useDragAndDrop.d.ts +13 -13
- package/dist/useDragAndDrop.d.ts.map +1 -1
- package/dist/utils.d.ts +2 -2
- package/dist/utils.d.ts.map +1 -1
- package/dist/virtualizer/Layout.d.ts +1 -1
- package/dist/virtualizer/Layout.d.ts.map +1 -1
- package/package.json +31 -32
- package/src/ActionBar.tsx +75 -72
- package/src/ActionGroup.tsx +53 -61
- package/src/Alert.tsx +17 -42
- package/src/Autocomplete.tsx +39 -44
- package/src/Breadcrumbs.tsx +149 -80
- package/src/Button.tsx +267 -70
- package/src/Calendar.tsx +218 -138
- package/src/Checkbox.tsx +413 -121
- package/src/Collection.tsx +67 -58
- package/src/Color.tsx +803 -380
- package/src/ColorEditor.tsx +131 -149
- package/src/ComboBox.tsx +414 -249
- package/src/ContextualHelpTrigger.tsx +86 -74
- package/src/DateField.tsx +185 -91
- package/src/DatePicker.tsx +524 -213
- package/src/DateRangePickerContext.tsx +44 -0
- package/src/Dialog.tsx +156 -118
- package/src/Disclosure.tsx +127 -80
- package/src/DragAndDrop.tsx +60 -54
- package/src/DragPreview.tsx +13 -11
- package/src/DropZone.tsx +42 -22
- package/src/FieldError.tsx +45 -23
- package/src/FileTrigger.tsx +19 -19
- package/src/Focusable.tsx +21 -24
- package/src/Form.tsx +71 -16
- package/src/GridList.tsx +273 -197
- package/src/HiddenDateInput.tsx +153 -0
- package/src/HiddenTimeInput.tsx +133 -0
- package/src/Icon.tsx +22 -43
- package/src/Keyboard.tsx +3 -3
- package/src/Landmark.tsx +37 -63
- package/src/Link.tsx +125 -75
- package/src/ListBox.tsx +332 -233
- package/src/ListDropTargetDelegate.ts +81 -80
- package/src/Menu.tsx +1023 -274
- package/src/Meter.tsx +38 -56
- package/src/Modal.tsx +243 -175
- package/src/NumberField.tsx +139 -143
- package/src/Popover.tsx +386 -233
- package/src/Pressable.tsx +21 -21
- package/src/ProgressBar.tsx +48 -57
- package/src/RadioGroup.tsx +524 -122
- package/src/RangeCalendar.tsx +157 -90
- package/src/RouterProvider.tsx +30 -47
- package/src/SearchField.tsx +362 -143
- package/src/Select.tsx +656 -233
- package/src/SelectionIndicator.tsx +18 -15
- package/src/Separator.tsx +47 -49
- package/src/SharedElementTransition.tsx +103 -97
- package/src/Slider.tsx +138 -98
- package/src/StepList.tsx +272 -0
- package/src/Switch.tsx +93 -46
- package/src/Table.tsx +1308 -342
- package/src/Tabs.tsx +324 -103
- package/src/TagGroup.tsx +139 -126
- package/src/Text.tsx +3 -3
- package/src/TextField.tsx +389 -79
- package/src/TimeField.tsx +136 -76
- package/src/Toast.tsx +209 -157
- package/src/ToggleButton.tsx +47 -37
- package/src/ToggleButtonGroup.tsx +39 -34
- package/src/Toolbar.tsx +54 -69
- package/src/Tooltip.tsx +387 -119
- package/src/Tree.tsx +651 -368
- package/src/Virtualizer.tsx +208 -180
- package/src/VirtualizerLayouts.ts +45 -30
- package/src/VisuallyHidden.tsx +19 -19
- package/src/contexts.ts +29 -37
- package/src/index.ts +110 -195
- package/src/useDragAndDrop.ts +87 -71
- package/src/utils.tsx +40 -55
- package/src/virtualizer/Layout.ts +14 -22
- package/dist/index.ssr.js +0 -16996
- package/dist/index.ssr.js.map +0 -1
package/src/Collection.tsx
CHANGED
|
@@ -5,16 +5,9 @@
|
|
|
5
5
|
* Section / Header / Group.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
createMemo,
|
|
12
|
-
splitProps,
|
|
13
|
-
useContext,
|
|
14
|
-
For,
|
|
15
|
-
} from 'solid-js';
|
|
16
|
-
import type { Key } from '@proyecto-viviana/solid-stately';
|
|
17
|
-
import type { DragTypes, DropOperation, DropTarget } from '@proyecto-viviana/solid-stately';
|
|
8
|
+
import { type JSX, createContext, createMemo, splitProps, useContext, For } from "solid-js";
|
|
9
|
+
import type { Key } from "@proyecto-viviana/solid-stately";
|
|
10
|
+
import type { DragTypes, DropOperation, DropTarget } from "@proyecto-viviana/solid-stately";
|
|
18
11
|
import {
|
|
19
12
|
Collection as AriaCollection,
|
|
20
13
|
CollectionBuilder as AriaCollectionBuilder,
|
|
@@ -22,44 +15,48 @@ import {
|
|
|
22
15
|
createBranchComponent,
|
|
23
16
|
type CollectionProps as AriaCollectionProps,
|
|
24
17
|
type CollectionBuilderProps as AriaCollectionBuilderProps,
|
|
25
|
-
} from
|
|
18
|
+
} from "@proyecto-viviana/solidaria";
|
|
26
19
|
import {
|
|
27
20
|
type ClassNameOrFunction,
|
|
28
21
|
type StyleOrFunction,
|
|
29
22
|
type SlotProps,
|
|
30
23
|
useRenderProps,
|
|
31
24
|
filterDOMProps,
|
|
32
|
-
} from
|
|
33
|
-
|
|
34
|
-
// ============================================
|
|
35
|
-
// TYPES
|
|
36
|
-
// ============================================
|
|
25
|
+
} from "./utils";
|
|
37
26
|
|
|
38
27
|
export interface CollectionPrimitiveRenderProps {
|
|
39
28
|
/** Whether the primitive has visible children content. */
|
|
40
29
|
hasChildren: boolean;
|
|
41
30
|
}
|
|
42
31
|
|
|
32
|
+
type RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;
|
|
33
|
+
|
|
34
|
+
function assignRef<T>(ref: RefLike<T>, el: T): void {
|
|
35
|
+
if (!ref) return;
|
|
36
|
+
if (typeof ref === "function") ref(el);
|
|
37
|
+
else ref.current = el;
|
|
38
|
+
}
|
|
39
|
+
|
|
43
40
|
export interface CollectionDropTargetDelegate {
|
|
44
41
|
getDropTargetFromPoint(
|
|
45
42
|
x: number,
|
|
46
43
|
y: number,
|
|
47
|
-
isValidDropTarget: (target: DropTarget) => boolean
|
|
44
|
+
isValidDropTarget: (target: DropTarget) => boolean,
|
|
48
45
|
): DropTarget | null;
|
|
49
46
|
getDropOperation(
|
|
50
47
|
target: DropTarget,
|
|
51
48
|
types: DragTypes,
|
|
52
|
-
allowedOperations: DropOperation[]
|
|
49
|
+
allowedOperations: DropOperation[],
|
|
53
50
|
): DropOperation;
|
|
54
51
|
getKeyboardNavigationTarget?(
|
|
55
52
|
target: DropTarget | null,
|
|
56
|
-
direction:
|
|
57
|
-
isValidDropTarget: (target: DropTarget) => boolean
|
|
53
|
+
direction: "next" | "previous",
|
|
54
|
+
isValidDropTarget: (target: DropTarget) => boolean,
|
|
58
55
|
): DropTarget | null;
|
|
59
56
|
getKeyboardPageNavigationTarget?(
|
|
60
57
|
target: DropTarget | null,
|
|
61
|
-
direction:
|
|
62
|
-
isValidDropTarget: (target: DropTarget) => boolean
|
|
58
|
+
direction: "next" | "previous",
|
|
59
|
+
isValidDropTarget: (target: DropTarget) => boolean,
|
|
63
60
|
): DropTarget | null;
|
|
64
61
|
}
|
|
65
62
|
|
|
@@ -73,7 +70,10 @@ export interface CollectionRendererContextValue<T> {
|
|
|
73
70
|
/** Optional drop target delegate used by DnD-aware collection paths. */
|
|
74
71
|
dropTargetDelegate?: CollectionDropTargetDelegate;
|
|
75
72
|
/** Optional drop indicator renderer for DnD-aware collection paths. */
|
|
76
|
-
renderDropIndicator?: (
|
|
73
|
+
renderDropIndicator?: (
|
|
74
|
+
index: number,
|
|
75
|
+
position: "before" | "after" | "on",
|
|
76
|
+
) => JSX.Element | undefined;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
export type CollectionEntry<T> = T | CollectionSection<T>;
|
|
@@ -84,7 +84,7 @@ export interface CollectionSection<T> {
|
|
|
84
84
|
/** Optional section header title. */
|
|
85
85
|
title?: JSX.Element;
|
|
86
86
|
/** Optional aria-label for section grouping. */
|
|
87
|
-
|
|
87
|
+
"aria-label"?: string;
|
|
88
88
|
/** Items contained in the section. */
|
|
89
89
|
items: T[];
|
|
90
90
|
}
|
|
@@ -92,6 +92,8 @@ export interface CollectionSection<T> {
|
|
|
92
92
|
export interface SectionProps extends SlotProps {
|
|
93
93
|
/** Section contents, usually Header + Group/items. */
|
|
94
94
|
children?: JSX.Element;
|
|
95
|
+
/** Ref for the section element. */
|
|
96
|
+
ref?: RefLike<HTMLDivElement>;
|
|
95
97
|
/** The CSS className for the element. */
|
|
96
98
|
class?: ClassNameOrFunction<CollectionPrimitiveRenderProps>;
|
|
97
99
|
/** The inline style for the element. */
|
|
@@ -102,7 +104,7 @@ export interface HeaderProps extends SlotProps {
|
|
|
102
104
|
/** Header contents, usually section title text. */
|
|
103
105
|
children?: JSX.Element;
|
|
104
106
|
/** Optional heading level when rendered as a heading role. */
|
|
105
|
-
|
|
107
|
+
"aria-level"?: number;
|
|
106
108
|
/** The CSS className for the element. */
|
|
107
109
|
class?: ClassNameOrFunction<CollectionPrimitiveRenderProps>;
|
|
108
110
|
/** The inline style for the element. */
|
|
@@ -126,13 +128,21 @@ interface SectionContextValue {
|
|
|
126
128
|
export interface CollectionBranchProps<T> {
|
|
127
129
|
collection: Iterable<T>;
|
|
128
130
|
parent?: unknown;
|
|
129
|
-
renderDropIndicator?: (target: {
|
|
131
|
+
renderDropIndicator?: (target: {
|
|
132
|
+
type: "item";
|
|
133
|
+
key: Key;
|
|
134
|
+
dropPosition: "before" | "after" | "on";
|
|
135
|
+
}) => JSX.Element | undefined;
|
|
130
136
|
}
|
|
131
137
|
|
|
132
138
|
export interface CollectionRootProps<T> {
|
|
133
139
|
collection: Iterable<T>;
|
|
134
140
|
persistedKeys?: Set<Key> | null;
|
|
135
|
-
renderDropIndicator?: (target: {
|
|
141
|
+
renderDropIndicator?: (target: {
|
|
142
|
+
type: "item";
|
|
143
|
+
key: Key;
|
|
144
|
+
dropPosition: "before" | "after" | "on";
|
|
145
|
+
}) => JSX.Element | undefined;
|
|
136
146
|
}
|
|
137
147
|
|
|
138
148
|
export interface CollectionRenderer<T = unknown> {
|
|
@@ -143,11 +153,8 @@ export interface CollectionRenderer<T = unknown> {
|
|
|
143
153
|
CollectionBranch: (props: CollectionBranchProps<T>) => JSX.Element;
|
|
144
154
|
}
|
|
145
155
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
// ============================================
|
|
149
|
-
|
|
150
|
-
export const CollectionRendererContext = createContext<CollectionRendererContextValue<unknown> | null>(null);
|
|
156
|
+
export const CollectionRendererContext =
|
|
157
|
+
createContext<CollectionRendererContextValue<unknown> | null>(null);
|
|
151
158
|
export const SelectableCollectionContext = CollectionRendererContext;
|
|
152
159
|
export const SectionContext = createContext<SectionContextValue | null>(null);
|
|
153
160
|
export const GroupContext = createContext<Partial<GroupProps> | null>(null);
|
|
@@ -158,12 +165,12 @@ export function useCollectionRenderer<T>(): CollectionRendererContextValue<T> |
|
|
|
158
165
|
return useContext(CollectionRendererContext) as CollectionRendererContextValue<T> | null;
|
|
159
166
|
}
|
|
160
167
|
|
|
161
|
-
// ============================================
|
|
162
|
-
// HELPERS
|
|
163
|
-
// ============================================
|
|
164
|
-
|
|
165
168
|
export function isCollectionSection<T>(entry: CollectionEntry<T>): entry is CollectionSection<T> {
|
|
166
|
-
return
|
|
169
|
+
return (
|
|
170
|
+
typeof entry === "object" &&
|
|
171
|
+
entry !== null &&
|
|
172
|
+
Array.isArray((entry as CollectionSection<T>).items)
|
|
173
|
+
);
|
|
167
174
|
}
|
|
168
175
|
|
|
169
176
|
export function flattenCollectionEntries<T>(entries: CollectionEntry<T>[]): T[] {
|
|
@@ -177,23 +184,27 @@ export function flattenCollectionEntries<T>(entries: CollectionEntry<T>[]): T[]
|
|
|
177
184
|
|
|
178
185
|
function renderCollectionItems<T>(
|
|
179
186
|
collection: Iterable<T>,
|
|
180
|
-
renderDropIndicator?: (target: {
|
|
187
|
+
renderDropIndicator?: (target: {
|
|
188
|
+
type: "item";
|
|
189
|
+
key: Key;
|
|
190
|
+
dropPosition: "before" | "after" | "on";
|
|
191
|
+
}) => JSX.Element | undefined,
|
|
181
192
|
): JSX.Element {
|
|
182
193
|
const items = Array.from(collection);
|
|
183
194
|
return (
|
|
184
195
|
<For each={items}>
|
|
185
196
|
{(item, index) => {
|
|
186
197
|
const node = item as { type?: unknown; key?: Key };
|
|
187
|
-
if (node.type ===
|
|
198
|
+
if (node.type === "content") {
|
|
188
199
|
// Content rows are rendered by their owning item/section branch.
|
|
189
200
|
return <></>;
|
|
190
201
|
}
|
|
191
202
|
const key = node.key ?? index();
|
|
192
203
|
return (
|
|
193
204
|
<>
|
|
194
|
-
{renderDropIndicator?.({ type:
|
|
195
|
-
{
|
|
196
|
-
{renderDropIndicator?.({ type:
|
|
205
|
+
{renderDropIndicator?.({ type: "item", key, dropPosition: "before" })}
|
|
206
|
+
{item as unknown as JSX.Element}
|
|
207
|
+
{renderDropIndicator?.({ type: "item", key, dropPosition: "after" })}
|
|
197
208
|
</>
|
|
198
209
|
);
|
|
199
210
|
}}
|
|
@@ -220,24 +231,21 @@ export function Collection<T>(props: AriaCollectionProps<T>): unknown {
|
|
|
220
231
|
|
|
221
232
|
export { createLeafComponent, createBranchComponent };
|
|
222
233
|
|
|
223
|
-
// ============================================
|
|
224
|
-
// COMPONENTS
|
|
225
|
-
// ============================================
|
|
226
|
-
|
|
227
234
|
/**
|
|
228
235
|
* A semantic section wrapper for grouped collection content.
|
|
229
236
|
*/
|
|
230
237
|
export function Section(props: SectionProps): JSX.Element {
|
|
231
238
|
const sectionContext = useContext(SectionContext);
|
|
232
239
|
if (sectionContext) {
|
|
233
|
-
const nodeEnv = (globalThis as { process?: { env?: { NODE_ENV?: string } } }).process?.env
|
|
234
|
-
|
|
240
|
+
const nodeEnv = (globalThis as { process?: { env?: { NODE_ENV?: string } } }).process?.env
|
|
241
|
+
?.NODE_ENV;
|
|
242
|
+
if (nodeEnv !== "production") {
|
|
235
243
|
console.warn(`<Section> is deprecated. Please use <${sectionContext.name}> instead.`);
|
|
236
244
|
}
|
|
237
|
-
return sectionContext.render(props,
|
|
245
|
+
return sectionContext.render(props, "solidaria-Section");
|
|
238
246
|
}
|
|
239
247
|
|
|
240
|
-
const [local, domProps] = splitProps(props, [
|
|
248
|
+
const [local, domProps] = splitProps(props, ["children", "class", "style", "slot", "ref"]);
|
|
241
249
|
|
|
242
250
|
const renderValues = createMemo<CollectionPrimitiveRenderProps>(() => ({
|
|
243
251
|
hasChildren: local.children != null,
|
|
@@ -248,15 +256,16 @@ export function Section(props: SectionProps): JSX.Element {
|
|
|
248
256
|
children: local.children,
|
|
249
257
|
class: local.class,
|
|
250
258
|
style: local.style,
|
|
251
|
-
defaultClassName:
|
|
259
|
+
defaultClassName: "solidaria-Section",
|
|
252
260
|
},
|
|
253
|
-
renderValues
|
|
261
|
+
renderValues,
|
|
254
262
|
);
|
|
255
263
|
|
|
256
264
|
const filteredDomProps = createMemo(() => filterDOMProps(domProps, { global: true }));
|
|
257
265
|
|
|
258
266
|
return (
|
|
259
267
|
<div
|
|
268
|
+
ref={(el) => assignRef(local.ref, el)}
|
|
260
269
|
{...filteredDomProps()}
|
|
261
270
|
class={renderProps.class()}
|
|
262
271
|
style={renderProps.style()}
|
|
@@ -272,7 +281,7 @@ export function Section(props: SectionProps): JSX.Element {
|
|
|
272
281
|
* A header/title primitive for collection sections.
|
|
273
282
|
*/
|
|
274
283
|
export function Header(props: HeaderProps): JSX.Element {
|
|
275
|
-
const [local, domProps] = splitProps(props, [
|
|
284
|
+
const [local, domProps] = splitProps(props, ["children", "class", "style", "slot"]);
|
|
276
285
|
|
|
277
286
|
const renderValues = createMemo<CollectionPrimitiveRenderProps>(() => ({
|
|
278
287
|
hasChildren: local.children != null,
|
|
@@ -283,9 +292,9 @@ export function Header(props: HeaderProps): JSX.Element {
|
|
|
283
292
|
children: local.children,
|
|
284
293
|
class: local.class,
|
|
285
294
|
style: local.style,
|
|
286
|
-
defaultClassName:
|
|
295
|
+
defaultClassName: "solidaria-Header",
|
|
287
296
|
},
|
|
288
|
-
renderValues
|
|
297
|
+
renderValues,
|
|
289
298
|
);
|
|
290
299
|
|
|
291
300
|
const filteredDomProps = createMemo(() => filterDOMProps(domProps, { global: true }));
|
|
@@ -308,7 +317,7 @@ export function Header(props: HeaderProps): JSX.Element {
|
|
|
308
317
|
* A grouping primitive for section item containers.
|
|
309
318
|
*/
|
|
310
319
|
export function Group(props: GroupProps): JSX.Element {
|
|
311
|
-
const [local, domProps] = splitProps(props, [
|
|
320
|
+
const [local, domProps] = splitProps(props, ["children", "class", "style", "slot"]);
|
|
312
321
|
|
|
313
322
|
const renderValues = createMemo<CollectionPrimitiveRenderProps>(() => ({
|
|
314
323
|
hasChildren: local.children != null,
|
|
@@ -319,9 +328,9 @@ export function Group(props: GroupProps): JSX.Element {
|
|
|
319
328
|
children: local.children,
|
|
320
329
|
class: local.class,
|
|
321
330
|
style: local.style,
|
|
322
|
-
defaultClassName:
|
|
331
|
+
defaultClassName: "solidaria-Group",
|
|
323
332
|
},
|
|
324
|
-
renderValues
|
|
333
|
+
renderValues,
|
|
325
334
|
);
|
|
326
335
|
|
|
327
336
|
const filteredDomProps = createMemo(() => filterDOMProps(domProps, { global: true }));
|