@proyecto-viviana/solidaria-components 0.3.1 → 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.
- package/dist/ActionBar.js +184 -0
- package/dist/ActionBar.js.map +1 -0
- package/dist/ActionBar.jsx +128 -0
- package/dist/ActionBar.jsx.map +1 -0
- package/dist/ActionGroup.js +179 -0
- package/dist/ActionGroup.js.map +1 -0
- package/dist/ActionGroup.jsx +129 -0
- package/dist/ActionGroup.jsx.map +1 -0
- package/dist/Alert.js +111 -0
- package/dist/Alert.js.map +1 -0
- package/dist/Alert.jsx +82 -0
- package/dist/Alert.jsx.map +1 -0
- package/dist/Autocomplete.js +130 -0
- package/dist/Autocomplete.js.map +1 -0
- package/dist/Autocomplete.jsx +116 -0
- package/dist/Autocomplete.jsx.map +1 -0
- package/dist/Breadcrumbs.d.ts.map +1 -1
- package/dist/Breadcrumbs.js +334 -0
- package/dist/Breadcrumbs.js.map +1 -0
- package/dist/Breadcrumbs.jsx +266 -0
- package/dist/Breadcrumbs.jsx.map +1 -0
- package/dist/Button.d.ts.map +1 -1
- package/dist/Button.js +348 -0
- package/dist/Button.js.map +1 -0
- package/dist/Button.jsx +314 -0
- package/dist/Button.jsx.map +1 -0
- package/dist/Calendar.d.ts +4 -4
- package/dist/Calendar.d.ts.map +1 -1
- package/dist/Calendar.js +538 -0
- package/dist/Calendar.js.map +1 -0
- package/dist/Calendar.jsx +333 -0
- package/dist/Calendar.jsx.map +1 -0
- package/dist/CalendarPicker.d.ts +33 -0
- package/dist/CalendarPicker.d.ts.map +1 -0
- package/dist/CalendarPicker.js +44 -0
- package/dist/CalendarPicker.js.map +1 -0
- package/dist/CalendarPicker.jsx +44 -0
- package/dist/CalendarPicker.jsx.map +1 -0
- package/dist/Checkbox.d.ts +83 -4
- package/dist/Checkbox.d.ts.map +1 -1
- package/dist/Checkbox.js +923 -0
- package/dist/Checkbox.js.map +1 -0
- package/dist/Checkbox.jsx +707 -0
- package/dist/Checkbox.jsx.map +1 -0
- package/dist/Collection.d.ts.map +1 -1
- package/dist/Collection.js +202 -0
- package/dist/Collection.js.map +1 -0
- package/dist/Collection.jsx +152 -0
- package/dist/Collection.jsx.map +1 -0
- package/dist/Color.d.ts.map +1 -1
- package/dist/Color.js +1720 -0
- package/dist/Color.js.map +1 -0
- package/dist/Color.jsx +1344 -0
- package/dist/Color.jsx.map +1 -0
- package/dist/ColorEditor.js +208 -0
- package/dist/ColorEditor.js.map +1 -0
- package/dist/ColorEditor.jsx +120 -0
- package/dist/ColorEditor.jsx.map +1 -0
- package/dist/ComboBox.d.ts +8 -5
- package/dist/ComboBox.d.ts.map +1 -1
- package/dist/ComboBox.js +992 -0
- package/dist/ComboBox.js.map +1 -0
- package/dist/ComboBox.jsx +714 -0
- package/dist/ComboBox.jsx.map +1 -0
- package/dist/ContextualHelpTrigger.js +146 -0
- package/dist/ContextualHelpTrigger.js.map +1 -0
- package/dist/ContextualHelpTrigger.jsx +109 -0
- package/dist/ContextualHelpTrigger.jsx.map +1 -0
- package/dist/DateField.d.ts +3 -3
- package/dist/DateField.d.ts.map +1 -1
- package/dist/DateField.js +4 -0
- package/dist/DateField.jsx +4 -0
- package/dist/DateField2.js +499 -0
- package/dist/DateField2.js.map +1 -0
- package/dist/DateField2.jsx +317 -0
- package/dist/DateField2.jsx.map +1 -0
- package/dist/DatePicker.d.ts +4 -4
- package/dist/DatePicker.d.ts.map +1 -1
- package/dist/DatePicker.js +991 -0
- package/dist/DatePicker.js.map +1 -0
- package/dist/DatePicker.jsx +682 -0
- package/dist/DatePicker.jsx.map +1 -0
- package/dist/Dialog.d.ts.map +1 -1
- package/dist/Dialog.js +337 -0
- package/dist/Dialog.js.map +1 -0
- package/dist/Dialog.jsx +192 -0
- package/dist/Dialog.jsx.map +1 -0
- package/dist/Disclosure.d.ts.map +1 -1
- package/dist/Disclosure.js +328 -0
- package/dist/Disclosure.js.map +1 -0
- package/dist/Disclosure.jsx +230 -0
- package/dist/Disclosure.jsx.map +1 -0
- package/dist/DragAndDrop.d.ts.map +1 -1
- package/dist/DragAndDrop.js +176 -0
- package/dist/DragAndDrop.js.map +1 -0
- package/dist/DragAndDrop.jsx +160 -0
- package/dist/DragAndDrop.jsx.map +1 -0
- package/dist/DropZone.d.ts.map +1 -1
- package/dist/DropZone.js +189 -0
- package/dist/DropZone.js.map +1 -0
- package/dist/DropZone.jsx +144 -0
- package/dist/DropZone.jsx.map +1 -0
- package/dist/FieldError.js +66 -0
- package/dist/FieldError.js.map +1 -0
- package/dist/FieldError.jsx +47 -0
- package/dist/FieldError.jsx.map +1 -0
- package/dist/FileTrigger.js +79 -0
- package/dist/FileTrigger.js.map +1 -0
- package/dist/FileTrigger.jsx +49 -0
- package/dist/FileTrigger.jsx.map +1 -0
- package/dist/Focusable.js +70 -0
- package/dist/Focusable.js.map +1 -0
- package/dist/Focusable.jsx +69 -0
- package/dist/Focusable.jsx.map +1 -0
- package/dist/Form.js +99 -0
- package/dist/Form.js.map +1 -0
- package/dist/Form.jsx +73 -0
- package/dist/Form.jsx.map +1 -0
- package/dist/GridList.d.ts +34 -2
- package/dist/GridList.d.ts.map +1 -1
- package/dist/GridList.js +723 -0
- package/dist/GridList.js.map +1 -0
- package/dist/GridList.jsx +552 -0
- package/dist/GridList.jsx.map +1 -0
- package/dist/HiddenTimeInput.js +104 -0
- package/dist/HiddenTimeInput.js.map +1 -0
- package/dist/HiddenTimeInput.jsx +69 -0
- package/dist/HiddenTimeInput.jsx.map +1 -0
- package/dist/Icon.d.ts.map +1 -1
- package/dist/Icon.js +127 -0
- package/dist/Icon.js.map +1 -0
- package/dist/Icon.jsx +72 -0
- package/dist/Icon.jsx.map +1 -0
- package/dist/Keyboard.js +30 -0
- package/dist/Keyboard.js.map +1 -0
- package/dist/Keyboard.jsx +24 -0
- package/dist/Keyboard.jsx.map +1 -0
- package/dist/Landmark.js +134 -0
- package/dist/Landmark.js.map +1 -0
- package/dist/Landmark.jsx +118 -0
- package/dist/Landmark.jsx.map +1 -0
- package/dist/Link.d.ts.map +1 -1
- package/dist/Link.js +219 -0
- package/dist/Link.js.map +1 -0
- package/dist/Link.jsx +189 -0
- package/dist/Link.jsx.map +1 -0
- package/dist/ListBox.d.ts.map +1 -1
- package/dist/ListBox.js +670 -0
- package/dist/ListBox.js.map +1 -0
- package/dist/ListBox.jsx +508 -0
- package/dist/ListBox.jsx.map +1 -0
- package/dist/Menu.d.ts +27 -9
- package/dist/Menu.d.ts.map +1 -1
- package/dist/Menu.js +1254 -0
- package/dist/Menu.js.map +1 -0
- package/dist/Menu.jsx +1042 -0
- package/dist/Menu.jsx.map +1 -0
- package/dist/Meter.d.ts.map +1 -1
- package/dist/Meter.js +123 -0
- package/dist/Meter.js.map +1 -0
- package/dist/Meter.jsx +107 -0
- package/dist/Meter.jsx.map +1 -0
- package/dist/Modal.d.ts.map +1 -1
- package/dist/Modal.js +380 -0
- package/dist/Modal.js.map +1 -0
- package/dist/Modal.jsx +314 -0
- package/dist/Modal.jsx.map +1 -0
- package/dist/NumberField.d.ts +3 -3
- package/dist/NumberField.d.ts.map +1 -1
- package/dist/NumberField.js +573 -0
- package/dist/NumberField.js.map +1 -0
- package/dist/NumberField.jsx +443 -0
- package/dist/NumberField.jsx.map +1 -0
- package/dist/Popover.d.ts +10 -2
- package/dist/Popover.d.ts.map +1 -1
- package/dist/Popover.js +464 -0
- package/dist/Popover.js.map +1 -0
- package/dist/Popover.jsx +333 -0
- package/dist/Popover.jsx.map +1 -0
- package/dist/Pressable.js +69 -0
- package/dist/Pressable.js.map +1 -0
- package/dist/Pressable.jsx +68 -0
- package/dist/Pressable.jsx.map +1 -0
- package/dist/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar.js +130 -0
- package/dist/ProgressBar.js.map +1 -0
- package/dist/ProgressBar.jsx +114 -0
- package/dist/ProgressBar.jsx.map +1 -0
- package/dist/RadioGroup.d.ts +82 -4
- package/dist/RadioGroup.d.ts.map +1 -1
- package/dist/RadioGroup.js +931 -0
- package/dist/RadioGroup.js.map +1 -0
- package/dist/RadioGroup.jsx +681 -0
- package/dist/RadioGroup.jsx.map +1 -0
- package/dist/RangeCalendar.d.ts.map +1 -1
- package/dist/RangeCalendar.js +410 -0
- package/dist/RangeCalendar.js.map +1 -0
- package/dist/RangeCalendar.jsx +253 -0
- package/dist/RangeCalendar.jsx.map +1 -0
- package/dist/RouterProvider.js +118 -0
- package/dist/RouterProvider.js.map +1 -0
- package/dist/RouterProvider.jsx +112 -0
- package/dist/RouterProvider.jsx.map +1 -0
- package/dist/SearchField.d.ts +2 -2
- package/dist/SearchField.d.ts.map +1 -1
- package/dist/SearchField.js +643 -0
- package/dist/SearchField.js.map +1 -0
- package/dist/SearchField.jsx +526 -0
- package/dist/SearchField.jsx.map +1 -0
- package/dist/Select.d.ts.map +1 -1
- package/dist/Select.js +1031 -0
- package/dist/Select.js.map +1 -0
- package/dist/Select.jsx +744 -0
- package/dist/Select.jsx.map +1 -0
- package/dist/SelectionIndicator.d.ts.map +1 -1
- package/dist/SelectionIndicator.js +86 -0
- package/dist/SelectionIndicator.js.map +1 -0
- package/dist/SelectionIndicator.jsx +50 -0
- package/dist/SelectionIndicator.jsx.map +1 -0
- package/dist/Separator.js +97 -0
- package/dist/Separator.js.map +1 -0
- package/dist/Separator.jsx +85 -0
- package/dist/Separator.jsx.map +1 -0
- package/dist/SharedElementTransition.d.ts.map +1 -1
- package/dist/SharedElementTransition.js +165 -0
- package/dist/SharedElementTransition.js.map +1 -0
- package/dist/SharedElementTransition.jsx +138 -0
- package/dist/SharedElementTransition.jsx.map +1 -0
- package/dist/Slider.d.ts +33 -1
- package/dist/Slider.d.ts.map +1 -1
- package/dist/Slider.js +515 -0
- package/dist/Slider.js.map +1 -0
- package/dist/Slider.jsx +403 -0
- package/dist/Slider.jsx.map +1 -0
- package/dist/StepList.js +198 -0
- package/dist/StepList.js.map +1 -0
- package/dist/StepList.jsx +141 -0
- package/dist/StepList.jsx.map +1 -0
- package/dist/Switch.d.ts +65 -2
- package/dist/Switch.d.ts.map +1 -1
- package/dist/Switch.js +534 -0
- package/dist/Switch.js.map +1 -0
- package/dist/Switch.jsx +393 -0
- package/dist/Switch.jsx.map +1 -0
- package/dist/Table.d.ts +48 -0
- package/dist/Table.d.ts.map +1 -1
- package/dist/Table.js +1759 -0
- package/dist/Table.js.map +1 -0
- package/dist/Table.jsx +1348 -0
- package/dist/Table.jsx.map +1 -0
- package/dist/Tabs.d.ts +0 -4
- package/dist/Tabs.d.ts.map +1 -1
- package/dist/Tabs.js +595 -0
- package/dist/Tabs.js.map +1 -0
- package/dist/Tabs.jsx +367 -0
- package/dist/Tabs.jsx.map +1 -0
- package/dist/TagGroup.d.ts.map +1 -1
- package/dist/TagGroup.js +378 -0
- package/dist/TagGroup.js.map +1 -0
- package/dist/TagGroup.jsx +270 -0
- package/dist/TagGroup.jsx.map +1 -0
- package/dist/Text.d.ts +18 -6
- package/dist/Text.d.ts.map +1 -1
- package/dist/Text.js +42 -0
- package/dist/Text.js.map +1 -0
- package/dist/Text.jsx +35 -0
- package/dist/Text.jsx.map +1 -0
- package/dist/TextField.d.ts +7 -6
- package/dist/TextField.d.ts.map +1 -1
- package/dist/TextField.js +436 -0
- package/dist/TextField.js.map +1 -0
- package/dist/TextField.jsx +403 -0
- package/dist/TextField.jsx.map +1 -0
- package/dist/TimeField.d.ts +3 -3
- package/dist/TimeField.d.ts.map +1 -1
- package/dist/TimeField.js +372 -0
- package/dist/TimeField.js.map +1 -0
- package/dist/TimeField.jsx +224 -0
- package/dist/TimeField.jsx.map +1 -0
- package/dist/Toast.d.ts +14 -0
- package/dist/Toast.d.ts.map +1 -1
- package/dist/Toast.js +551 -0
- package/dist/Toast.js.map +1 -0
- package/dist/Toast.jsx +361 -0
- package/dist/Toast.jsx.map +1 -0
- package/dist/ToggleButton.d.ts.map +1 -1
- package/dist/ToggleButton.js +123 -0
- package/dist/ToggleButton.js.map +1 -0
- package/dist/ToggleButton.jsx +88 -0
- package/dist/ToggleButton.jsx.map +1 -0
- package/dist/ToggleButtonGroup.d.ts.map +1 -1
- package/dist/ToggleButtonGroup.js +114 -0
- package/dist/ToggleButtonGroup.js.map +1 -0
- package/dist/ToggleButtonGroup.jsx +85 -0
- package/dist/ToggleButtonGroup.jsx.map +1 -0
- package/dist/Toolbar.js +112 -0
- package/dist/Toolbar.js.map +1 -0
- package/dist/Toolbar.jsx +92 -0
- package/dist/Toolbar.jsx.map +1 -0
- package/dist/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip.js +539 -0
- package/dist/Tooltip.js.map +1 -0
- package/dist/Tooltip.jsx +465 -0
- package/dist/Tooltip.jsx.map +1 -0
- package/dist/Tree.d.ts +14 -2
- package/dist/Tree.d.ts.map +1 -1
- package/dist/Tree.js +1424 -0
- package/dist/Tree.js.map +1 -0
- package/dist/Tree.jsx +1172 -0
- package/dist/Tree.jsx.map +1 -0
- package/dist/Virtualizer.d.ts +16 -2
- package/dist/Virtualizer.d.ts.map +1 -1
- package/dist/Virtualizer.js +2 -0
- package/dist/Virtualizer.jsx +2 -0
- package/dist/Virtualizer2.js +751 -0
- package/dist/Virtualizer2.js.map +1 -0
- package/dist/Virtualizer2.jsx +730 -0
- package/dist/Virtualizer2.jsx.map +1 -0
- package/dist/VirtualizerLayouts.d.ts +18 -0
- package/dist/VirtualizerLayouts.d.ts.map +1 -1
- package/dist/VisuallyHidden.js +42 -0
- package/dist/VisuallyHidden.js.map +1 -0
- package/dist/VisuallyHidden.jsx +35 -0
- package/dist/VisuallyHidden.jsx.map +1 -0
- package/dist/contexts.js +33 -0
- package/dist/contexts.js.map +1 -0
- package/dist/contexts.jsx +33 -0
- package/dist/contexts.jsx.map +1 -0
- package/dist/index.d.ts +7 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +70 -23711
- package/dist/index.jsx +70 -18116
- package/dist/useDragAndDrop.js +2 -0
- package/dist/useDragAndDrop.jsx +2 -0
- package/dist/useDragAndDrop2.js +395 -0
- package/dist/useDragAndDrop2.js.map +1 -0
- package/dist/useDragAndDrop2.jsx +395 -0
- package/dist/useDragAndDrop2.jsx.map +1 -0
- package/dist/utils.d.ts +83 -11
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +285 -0
- package/dist/utils.js.map +1 -0
- package/dist/utils.jsx +277 -0
- package/dist/utils.jsx.map +1 -0
- package/dist/virtualizer/Layout.js +144 -0
- package/dist/virtualizer/Layout.js.map +1 -0
- package/dist/virtualizer/Layout.jsx +144 -0
- package/dist/virtualizer/Layout.jsx.map +1 -0
- package/package.json +401 -4
- package/src/Breadcrumbs.tsx +3 -1
- package/src/Button.tsx +90 -23
- package/src/Calendar.tsx +27 -10
- package/src/CalendarPicker.tsx +73 -0
- package/src/Checkbox.tsx +539 -3
- package/src/Collection.tsx +9 -3
- package/src/Color.tsx +42 -14
- package/src/ComboBox.tsx +126 -14
- package/src/DateField.tsx +20 -2
- package/src/DatePicker.tsx +117 -10
- package/src/Dialog.tsx +13 -5
- package/src/Disclosure.tsx +3 -1
- package/src/DragAndDrop.tsx +3 -1
- package/src/DropZone.tsx +3 -1
- package/src/GridList.tsx +125 -24
- package/src/Icon.tsx +3 -1
- package/src/Link.tsx +3 -1
- package/src/ListBox.tsx +31 -4
- package/src/Menu.tsx +298 -131
- package/src/Meter.tsx +3 -1
- package/src/Modal.tsx +100 -52
- package/src/NumberField.tsx +73 -10
- package/src/Popover.tsx +49 -11
- package/src/ProgressBar.tsx +3 -1
- package/src/RadioGroup.tsx +468 -4
- package/src/RangeCalendar.tsx +3 -1
- package/src/SearchField.tsx +27 -3
- package/src/Select.tsx +22 -7
- package/src/SelectionIndicator.tsx +3 -1
- package/src/SharedElementTransition.tsx +3 -1
- package/src/Slider.tsx +159 -13
- package/src/Switch.tsx +395 -2
- package/src/Table.tsx +409 -95
- package/src/Tabs.tsx +16 -45
- package/src/TagGroup.tsx +4 -1
- package/src/Text.tsx +31 -10
- package/src/TextField.tsx +73 -10
- package/src/TimeField.tsx +20 -2
- package/src/Toast.tsx +79 -14
- package/src/ToggleButton.tsx +3 -1
- package/src/ToggleButtonGroup.tsx +3 -1
- package/src/Tooltip.tsx +55 -8
- package/src/Tree.tsx +77 -9
- package/src/Virtualizer.tsx +180 -31
- package/src/VirtualizerLayouts.ts +45 -10
- package/src/index.ts +50 -0
- package/src/utils.tsx +243 -27
- package/dist/index.js.map +0 -1
- package/dist/index.jsx.map +0 -1
package/src/DatePicker.tsx
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
9
|
type JSX,
|
|
10
|
+
type Context,
|
|
10
11
|
createContext,
|
|
11
12
|
createEffect,
|
|
12
13
|
createMemo,
|
|
@@ -39,6 +40,7 @@ import {
|
|
|
39
40
|
type CalendarState,
|
|
40
41
|
type RangeCalendarState,
|
|
41
42
|
type DateFieldStateProps,
|
|
43
|
+
type DatePickerStateOptions,
|
|
42
44
|
type CalendarDate,
|
|
43
45
|
type DateValue,
|
|
44
46
|
type RangeCalendarStateProps,
|
|
@@ -52,7 +54,9 @@ import {
|
|
|
52
54
|
useRenderProps,
|
|
53
55
|
dataAttr,
|
|
54
56
|
useIsHydrated,
|
|
57
|
+
Provider,
|
|
55
58
|
} from "./utils";
|
|
59
|
+
import { TextContext } from "./Text";
|
|
56
60
|
import { DateFieldContext } from "./DateField";
|
|
57
61
|
import { CalendarContext } from "./Calendar";
|
|
58
62
|
import { RangeCalendarContext } from "./RangeCalendar";
|
|
@@ -349,11 +353,65 @@ function DatePickerInner<T extends DateValue = CalendarDate>(
|
|
|
349
353
|
const [triggerRef, setTriggerRef] = createSignal<HTMLElement | null>(null);
|
|
350
354
|
const [fieldRef, setFieldRef] = createSignal<HTMLDivElement | null>(null);
|
|
351
355
|
|
|
352
|
-
// Unified state using createDatePickerState as single source of truth
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
356
|
+
// Unified state using createDatePickerState as single source of truth.
|
|
357
|
+
// Use getters here so controlled props keep tracking after splitProps.
|
|
358
|
+
const datePickerStateProps = {
|
|
359
|
+
get value() {
|
|
360
|
+
return stateProps.value;
|
|
361
|
+
},
|
|
362
|
+
get defaultValue() {
|
|
363
|
+
return stateProps.defaultValue;
|
|
364
|
+
},
|
|
365
|
+
get onChange() {
|
|
366
|
+
return stateProps.onChange;
|
|
367
|
+
},
|
|
368
|
+
get minValue() {
|
|
369
|
+
return stateProps.minValue;
|
|
370
|
+
},
|
|
371
|
+
get maxValue() {
|
|
372
|
+
return stateProps.maxValue;
|
|
373
|
+
},
|
|
374
|
+
get isDisabled() {
|
|
375
|
+
return stateProps.isDisabled;
|
|
376
|
+
},
|
|
377
|
+
get isReadOnly() {
|
|
378
|
+
return stateProps.isReadOnly;
|
|
379
|
+
},
|
|
380
|
+
get isRequired() {
|
|
381
|
+
return stateProps.isRequired;
|
|
382
|
+
},
|
|
383
|
+
get granularity() {
|
|
384
|
+
return stateProps.granularity;
|
|
385
|
+
},
|
|
386
|
+
get hourCycle() {
|
|
387
|
+
return stateProps.hourCycle;
|
|
388
|
+
},
|
|
389
|
+
get hideTimeZone() {
|
|
390
|
+
return stateProps.hideTimeZone;
|
|
391
|
+
},
|
|
392
|
+
get placeholderValue() {
|
|
393
|
+
return stateProps.placeholderValue;
|
|
394
|
+
},
|
|
395
|
+
get shouldCloseOnSelect() {
|
|
396
|
+
return local.shouldCloseOnSelect;
|
|
397
|
+
},
|
|
398
|
+
get defaultOpen() {
|
|
399
|
+
return stateProps.defaultOpen;
|
|
400
|
+
},
|
|
401
|
+
get isOpen() {
|
|
402
|
+
return stateProps.isOpen;
|
|
403
|
+
},
|
|
404
|
+
get onOpenChange() {
|
|
405
|
+
return stateProps.onOpenChange;
|
|
406
|
+
},
|
|
407
|
+
get isDateUnavailable() {
|
|
408
|
+
return stateProps.isDateUnavailable;
|
|
409
|
+
},
|
|
410
|
+
get validationState() {
|
|
411
|
+
return stateProps.validationState;
|
|
412
|
+
},
|
|
413
|
+
} satisfies DatePickerStateOptions<T>;
|
|
414
|
+
const datePickerState = createDatePickerState<T>(datePickerStateProps);
|
|
357
415
|
|
|
358
416
|
const overlayState = {
|
|
359
417
|
get isOpen() {
|
|
@@ -480,7 +538,27 @@ function DatePickerInner<T extends DateValue = CalendarDate>(
|
|
|
480
538
|
data-invalid={dataAttr(isInvalid())}
|
|
481
539
|
data-open={dataAttr(overlayState.isOpen)}
|
|
482
540
|
>
|
|
483
|
-
|
|
541
|
+
<Provider
|
|
542
|
+
values={
|
|
543
|
+
[
|
|
544
|
+
[
|
|
545
|
+
TextContext,
|
|
546
|
+
{
|
|
547
|
+
slots: {
|
|
548
|
+
get description() {
|
|
549
|
+
return pickerAria.descriptionProps;
|
|
550
|
+
},
|
|
551
|
+
get errorMessage() {
|
|
552
|
+
return pickerAria.errorMessageProps;
|
|
553
|
+
},
|
|
554
|
+
},
|
|
555
|
+
},
|
|
556
|
+
],
|
|
557
|
+
] as Array<[Context<unknown>, unknown]>
|
|
558
|
+
}
|
|
559
|
+
>
|
|
560
|
+
{props.children}
|
|
561
|
+
</Provider>
|
|
484
562
|
</div>
|
|
485
563
|
<Show when={(rest as Record<string, unknown>).name}>
|
|
486
564
|
<HiddenDateInput
|
|
@@ -661,7 +739,12 @@ function DateRangePickerInner<T extends DateValue = CalendarDate>(
|
|
|
661
739
|
hideTimeZone: stateProps.hideTimeZone,
|
|
662
740
|
placeholderValue: stateProps.placeholderValue,
|
|
663
741
|
validationState: () => (isInvalid() ? "invalid" : access(stateProps.validationState)),
|
|
664
|
-
isDateUnavailable
|
|
742
|
+
// The range picker's isDateUnavailable is anchor-aware (date, anchorDate),
|
|
743
|
+
// but a text field has no range anchor, so adapt it to the field's 1-arg form
|
|
744
|
+
// by always passing a null anchor (checks raw per-date availability).
|
|
745
|
+
isDateUnavailable: stateProps.isDateUnavailable
|
|
746
|
+
? (date: DateValue) => stateProps.isDateUnavailable!(date, null)
|
|
747
|
+
: undefined,
|
|
665
748
|
} satisfies Partial<DateFieldStateProps<T>>;
|
|
666
749
|
|
|
667
750
|
const startFieldState = createDateFieldState<T>({
|
|
@@ -768,7 +851,27 @@ function DateRangePickerInner<T extends DateValue = CalendarDate>(
|
|
|
768
851
|
data-invalid={dataAttr(isInvalid())}
|
|
769
852
|
data-open={dataAttr(overlayState.isOpen)}
|
|
770
853
|
>
|
|
771
|
-
|
|
854
|
+
<Provider
|
|
855
|
+
values={
|
|
856
|
+
[
|
|
857
|
+
[
|
|
858
|
+
TextContext,
|
|
859
|
+
{
|
|
860
|
+
slots: {
|
|
861
|
+
get description() {
|
|
862
|
+
return pickerAria.descriptionProps;
|
|
863
|
+
},
|
|
864
|
+
get errorMessage() {
|
|
865
|
+
return pickerAria.errorMessageProps;
|
|
866
|
+
},
|
|
867
|
+
},
|
|
868
|
+
},
|
|
869
|
+
],
|
|
870
|
+
] as Array<[Context<unknown>, unknown]>
|
|
871
|
+
}
|
|
872
|
+
>
|
|
873
|
+
{props.children}
|
|
874
|
+
</Provider>
|
|
772
875
|
</div>
|
|
773
876
|
<Show when={(rest as Record<string, unknown>).startName}>
|
|
774
877
|
<HiddenDateInput
|
|
@@ -811,7 +914,9 @@ export function DatePickerButton(props: DatePickerButtonProps): JSX.Element {
|
|
|
811
914
|
|
|
812
915
|
const renderProps = useRenderProps(
|
|
813
916
|
{
|
|
814
|
-
children
|
|
917
|
+
get children() {
|
|
918
|
+
return props.children;
|
|
919
|
+
},
|
|
815
920
|
class: props.class,
|
|
816
921
|
style: props.style,
|
|
817
922
|
defaultClassName: "solidaria-DatePickerButton",
|
|
@@ -854,7 +959,9 @@ export function DateRangePickerButton(props: DateRangePickerButtonProps): JSX.El
|
|
|
854
959
|
|
|
855
960
|
const renderProps = useRenderProps(
|
|
856
961
|
{
|
|
857
|
-
children
|
|
962
|
+
get children() {
|
|
963
|
+
return props.children;
|
|
964
|
+
},
|
|
858
965
|
class: props.class,
|
|
859
966
|
style: props.style,
|
|
860
967
|
defaultClassName: "solidaria-DateRangePickerButton",
|
package/src/Dialog.tsx
CHANGED
|
@@ -27,7 +27,9 @@ import {
|
|
|
27
27
|
type OverlayTriggerState,
|
|
28
28
|
} from "@proyecto-viviana/solid-stately";
|
|
29
29
|
import { DialogTriggerContext, useOverlayTriggerState } from "./contexts";
|
|
30
|
+
import { ButtonContext } from "./Button";
|
|
30
31
|
import {
|
|
32
|
+
DEFAULT_SLOT,
|
|
31
33
|
type RenderChildren,
|
|
32
34
|
type ClassNameOrFunction,
|
|
33
35
|
type StyleOrFunction,
|
|
@@ -167,7 +169,7 @@ export function Dialog(props: DialogProps): JSX.Element {
|
|
|
167
169
|
["role", "aria-label", "aria-labelledby", "aria-describedby"],
|
|
168
170
|
);
|
|
169
171
|
|
|
170
|
-
let dialogRef!:
|
|
172
|
+
let dialogRef!: HTMLElement;
|
|
171
173
|
|
|
172
174
|
// Get trigger context for aria-labelledby fallback
|
|
173
175
|
const triggerContext = useContext(DialogTriggerContext);
|
|
@@ -223,7 +225,9 @@ export function Dialog(props: DialogProps): JSX.Element {
|
|
|
223
225
|
|
|
224
226
|
const renderProps = useRenderProps(
|
|
225
227
|
{
|
|
226
|
-
children
|
|
228
|
+
get children() {
|
|
229
|
+
return props.children;
|
|
230
|
+
},
|
|
227
231
|
class: local.class,
|
|
228
232
|
style: local.style,
|
|
229
233
|
defaultClassName: "solidaria-Dialog",
|
|
@@ -237,7 +241,7 @@ export function Dialog(props: DialogProps): JSX.Element {
|
|
|
237
241
|
|
|
238
242
|
return (
|
|
239
243
|
<DialogContext.Provider value={{ close, titleId: titleId() }}>
|
|
240
|
-
<
|
|
244
|
+
<section
|
|
241
245
|
{...dialogProps()}
|
|
242
246
|
{...domProps()}
|
|
243
247
|
ref={dialogRef}
|
|
@@ -245,8 +249,12 @@ export function Dialog(props: DialogProps): JSX.Element {
|
|
|
245
249
|
style={renderProps.style()}
|
|
246
250
|
slot={local.slot}
|
|
247
251
|
>
|
|
248
|
-
|
|
249
|
-
|
|
252
|
+
<ButtonContext.Provider
|
|
253
|
+
value={{ slots: { [DEFAULT_SLOT]: {}, close: { onPress: () => close() } } }}
|
|
254
|
+
>
|
|
255
|
+
{renderProps.renderChildren()}
|
|
256
|
+
</ButtonContext.Provider>
|
|
257
|
+
</section>
|
|
250
258
|
</DialogContext.Provider>
|
|
251
259
|
);
|
|
252
260
|
}
|
package/src/Disclosure.tsx
CHANGED
|
@@ -448,7 +448,9 @@ export function DisclosurePanel(props: DisclosurePanelProps): JSX.Element {
|
|
|
448
448
|
|
|
449
449
|
const renderProps = useRenderProps(
|
|
450
450
|
{
|
|
451
|
-
children
|
|
451
|
+
get children() {
|
|
452
|
+
return props.children;
|
|
453
|
+
},
|
|
452
454
|
class: local.class,
|
|
453
455
|
style: local.style,
|
|
454
456
|
defaultClassName: "solidaria-DisclosurePanel",
|
package/src/DragAndDrop.tsx
CHANGED
|
@@ -58,7 +58,9 @@ function DefaultDropIndicator(props: DropIndicatorProps): JSX.Element {
|
|
|
58
58
|
|
|
59
59
|
const renderProps = useRenderProps(
|
|
60
60
|
{
|
|
61
|
-
children
|
|
61
|
+
get children() {
|
|
62
|
+
return props.children;
|
|
63
|
+
},
|
|
62
64
|
class: props.class,
|
|
63
65
|
style: props.style,
|
|
64
66
|
defaultClassName: "solidaria-DropIndicator",
|
package/src/DropZone.tsx
CHANGED
|
@@ -122,7 +122,9 @@ export function DropZone(props: DropZoneProps): JSX.Element {
|
|
|
122
122
|
|
|
123
123
|
const renderProps = useRenderProps(
|
|
124
124
|
{
|
|
125
|
-
children
|
|
125
|
+
get children() {
|
|
126
|
+
return local.children;
|
|
127
|
+
},
|
|
126
128
|
class: local.class,
|
|
127
129
|
style: local.style,
|
|
128
130
|
defaultClassName: "solidaria-DropZone",
|
package/src/GridList.tsx
CHANGED
|
@@ -24,10 +24,12 @@ import {
|
|
|
24
24
|
createGridList,
|
|
25
25
|
createGridListItem,
|
|
26
26
|
createGridListSelectionCheckbox,
|
|
27
|
+
createGridListSection,
|
|
27
28
|
createFocusRing,
|
|
28
29
|
createHover,
|
|
29
30
|
mergeProps,
|
|
30
31
|
type AriaGridListProps,
|
|
32
|
+
type GridListSectionAria,
|
|
31
33
|
} from "@proyecto-viviana/solidaria";
|
|
32
34
|
import {
|
|
33
35
|
createGridState,
|
|
@@ -50,11 +52,10 @@ import { type DragAndDropHooks } from "./useDragAndDrop";
|
|
|
50
52
|
import {
|
|
51
53
|
CollectionRendererContext,
|
|
52
54
|
type CollectionRendererContextValue,
|
|
53
|
-
Section,
|
|
54
55
|
type SectionProps,
|
|
55
56
|
useCollectionRenderer,
|
|
56
57
|
} from "./Collection";
|
|
57
|
-
import { useVirtualizerContext } from "./Virtualizer";
|
|
58
|
+
import { useVirtualizerContext, type Orientation } from "./Virtualizer";
|
|
58
59
|
import {
|
|
59
60
|
getNormalizedDropTargetKey,
|
|
60
61
|
mergePersistedKeysIntoVirtualRange,
|
|
@@ -82,6 +83,12 @@ export interface GridListRenderProps {
|
|
|
82
83
|
isDisabled: boolean;
|
|
83
84
|
/** Whether the grid list is empty. */
|
|
84
85
|
isEmpty: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* The primary orientation of the items.
|
|
88
|
+
*
|
|
89
|
+
* @selector [data-orientation="vertical | horizontal"]
|
|
90
|
+
*/
|
|
91
|
+
orientation: Orientation;
|
|
85
92
|
}
|
|
86
93
|
|
|
87
94
|
export interface GridListProps<T extends object>
|
|
@@ -100,12 +107,21 @@ export interface GridListProps<T extends object>
|
|
|
100
107
|
selectionBehavior?: "replace" | "toggle";
|
|
101
108
|
/** Keys of disabled items. */
|
|
102
109
|
disabledKeys?: Iterable<Key>;
|
|
110
|
+
/** Whether disabled items can still receive focus. */
|
|
111
|
+
disabledBehavior?: "selection" | "all";
|
|
103
112
|
/** Currently selected keys (controlled). */
|
|
104
113
|
selectedKeys?: "all" | Iterable<Key>;
|
|
105
114
|
/** Default selected keys (uncontrolled). */
|
|
106
115
|
defaultSelectedKeys?: "all" | Iterable<Key>;
|
|
107
116
|
/** Handler called when selection changes. */
|
|
108
117
|
onSelectionChange?: (keys: "all" | Set<Key>) => void;
|
|
118
|
+
/**
|
|
119
|
+
* The primary orientation of the items. Usually this is the direction that the collection
|
|
120
|
+
* scrolls.
|
|
121
|
+
*
|
|
122
|
+
* @default 'vertical'
|
|
123
|
+
*/
|
|
124
|
+
orientation?: Orientation;
|
|
109
125
|
/** The children of the component. A function may be provided to render each item. */
|
|
110
126
|
children: (item: T) => JSX.Element;
|
|
111
127
|
/** The CSS className for the element. */
|
|
@@ -198,7 +214,12 @@ export const GridListContext = createContext<GridListContextValue<object> | null
|
|
|
198
214
|
export const GridListStateContext = createContext<GridState<object, GridCollection<object>> | null>(
|
|
199
215
|
null,
|
|
200
216
|
);
|
|
201
|
-
|
|
217
|
+
/** Carries the section header's outer (row) props to {@link GridListHeader}. */
|
|
218
|
+
export const GridListHeaderContext = createContext<GridListSectionAria["rowProps"] | null>(null);
|
|
219
|
+
/** Carries the section header's inner (rowheader) props to {@link GridListHeader}. */
|
|
220
|
+
export const GridListHeaderInnerContext = createContext<
|
|
221
|
+
GridListSectionAria["rowHeaderProps"] | null
|
|
222
|
+
>(null);
|
|
202
223
|
|
|
203
224
|
function buildGridCollection<T extends object>(
|
|
204
225
|
items: T[],
|
|
@@ -295,6 +316,7 @@ export function GridList<T extends object>(props: GridListProps<T>): JSX.Element
|
|
|
295
316
|
"isLoading",
|
|
296
317
|
"onLoadMore",
|
|
297
318
|
"dragAndDropHooks",
|
|
319
|
+
"orientation",
|
|
298
320
|
],
|
|
299
321
|
[
|
|
300
322
|
"items",
|
|
@@ -302,6 +324,7 @@ export function GridList<T extends object>(props: GridListProps<T>): JSX.Element
|
|
|
302
324
|
"getTextValue",
|
|
303
325
|
"getDisabled",
|
|
304
326
|
"disabledKeys",
|
|
327
|
+
"disabledBehavior",
|
|
305
328
|
"selectionMode",
|
|
306
329
|
"selectedKeys",
|
|
307
330
|
"defaultSelectedKeys",
|
|
@@ -339,11 +362,22 @@ export function GridList<T extends object>(props: GridListProps<T>): JSX.Element
|
|
|
339
362
|
return keys;
|
|
340
363
|
});
|
|
341
364
|
|
|
365
|
+
const orientation = (): Orientation => local.orientation ?? "vertical";
|
|
366
|
+
const resolveDirection = (): "ltr" | "rtl" => {
|
|
367
|
+
const el = ref();
|
|
368
|
+
if (el && typeof window !== "undefined" && typeof window.getComputedStyle === "function") {
|
|
369
|
+
const dir = window.getComputedStyle(el).direction;
|
|
370
|
+
if (dir === "rtl") return "rtl";
|
|
371
|
+
}
|
|
372
|
+
return typeof document !== "undefined" && document.dir === "rtl" ? "rtl" : "ltr";
|
|
373
|
+
};
|
|
374
|
+
|
|
342
375
|
const state = createGridState<T, GridCollection<T>>(() => ({
|
|
343
376
|
collection: collection(),
|
|
344
377
|
disabledKeys: allDisabledKeys(),
|
|
378
|
+
disabledBehavior: stateProps.disabledBehavior,
|
|
345
379
|
selectionMode: stateProps.selectionMode,
|
|
346
|
-
selectionBehavior: stateProps.selectionBehavior,
|
|
380
|
+
selectionBehavior: stateProps.selectionBehavior ?? "replace",
|
|
347
381
|
selectedKeys: stateProps.selectedKeys,
|
|
348
382
|
defaultSelectedKeys: stateProps.defaultSelectedKeys,
|
|
349
383
|
onSelectionChange: stateProps.onSelectionChange,
|
|
@@ -358,19 +392,22 @@ export function GridList<T extends object>(props: GridListProps<T>): JSX.Element
|
|
|
358
392
|
isVirtualized: ariaProps.isVirtualized,
|
|
359
393
|
onAction: ariaProps.onAction,
|
|
360
394
|
isDisabled: ariaProps.isDisabled,
|
|
361
|
-
selectionBehavior:
|
|
395
|
+
selectionBehavior: state.selectionBehavior,
|
|
396
|
+
keyboardNavigationBehavior: ariaProps.keyboardNavigationBehavior,
|
|
397
|
+
orientation: orientation(),
|
|
398
|
+
direction: resolveDirection(),
|
|
362
399
|
}),
|
|
363
400
|
() => state,
|
|
364
401
|
ref,
|
|
365
402
|
);
|
|
366
403
|
|
|
367
404
|
const { isFocused, isFocusVisible, focusProps } = createFocusRing();
|
|
368
|
-
|
|
369
405
|
const renderValues = createMemo<GridListRenderProps>(() => ({
|
|
370
406
|
isFocused: state.isFocused || isFocused(),
|
|
371
407
|
isFocusVisible: isFocusVisible(),
|
|
372
408
|
isDisabled: ariaProps.isDisabled ?? false,
|
|
373
409
|
isEmpty: stateProps.items.length === 0,
|
|
410
|
+
orientation: orientation(),
|
|
374
411
|
}));
|
|
375
412
|
|
|
376
413
|
const renderProps = useRenderProps(
|
|
@@ -446,14 +483,6 @@ export function GridList<T extends object>(props: GridListProps<T>): JSX.Element
|
|
|
446
483
|
const hooks = local.dragAndDropHooks;
|
|
447
484
|
const activeDropState = dropState();
|
|
448
485
|
if (!hooks?.useDroppableCollection || !activeDropState) return undefined;
|
|
449
|
-
const resolveDirection = (): "ltr" | "rtl" => {
|
|
450
|
-
const el = ref();
|
|
451
|
-
if (el && typeof window !== "undefined" && typeof window.getComputedStyle === "function") {
|
|
452
|
-
const dir = window.getComputedStyle(el).direction;
|
|
453
|
-
if (dir === "rtl") return "rtl";
|
|
454
|
-
}
|
|
455
|
-
return typeof document !== "undefined" && document.dir === "rtl" ? "rtl" : "ltr";
|
|
456
|
-
};
|
|
457
486
|
const dropTargetDelegate =
|
|
458
487
|
hooks.dropTargetDelegate ??
|
|
459
488
|
parentCollectionRenderer?.dropTargetDelegate ??
|
|
@@ -461,7 +490,7 @@ export function GridList<T extends object>(props: GridListProps<T>): JSX.Element
|
|
|
461
490
|
? new hooks.ListDropTargetDelegate(
|
|
462
491
|
() => state.collection,
|
|
463
492
|
() => ref(),
|
|
464
|
-
{ layout: "grid", orientation:
|
|
493
|
+
{ layout: "grid", orientation: orientation(), direction: resolveDirection() },
|
|
465
494
|
)
|
|
466
495
|
: undefined);
|
|
467
496
|
if (!dropTargetDelegate) return undefined;
|
|
@@ -564,12 +593,16 @@ export function GridList<T extends object>(props: GridListProps<T>): JSX.Element
|
|
|
564
593
|
if (!range) return stateProps.items;
|
|
565
594
|
return stateProps.items.slice(range.start, range.end);
|
|
566
595
|
});
|
|
596
|
+
// Spacers reserve the windowed-out extent along the virtualizer's primary axis,
|
|
597
|
+
// so a horizontal layout offsets along width rather than height.
|
|
598
|
+
const virtualSpacerStyle = (size: number): JSX.CSSProperties =>
|
|
599
|
+
virtualizer?.orientation === "horizontal" ? { width: `${size}px` } : { height: `${size}px` };
|
|
567
600
|
|
|
568
601
|
const contextValue = createMemo<GridListContextValue<T>>(() => ({
|
|
569
602
|
state,
|
|
570
603
|
collection: collection(),
|
|
571
604
|
isDisabled: ariaProps.isDisabled ?? false,
|
|
572
|
-
selectionBehavior:
|
|
605
|
+
selectionBehavior: state.selectionBehavior,
|
|
573
606
|
dragAndDropHooks: local.dragAndDropHooks,
|
|
574
607
|
dragState: dragState(),
|
|
575
608
|
dropState: dropState(),
|
|
@@ -606,6 +639,7 @@ export function GridList<T extends object>(props: GridListProps<T>): JSX.Element
|
|
|
606
639
|
data-disabled={ariaProps.isDisabled || undefined}
|
|
607
640
|
data-empty={isEmpty() || undefined}
|
|
608
641
|
data-drop-target={isRootDropTarget() || undefined}
|
|
642
|
+
data-orientation={orientation()}
|
|
609
643
|
>
|
|
610
644
|
<SharedElementTransition>
|
|
611
645
|
{isEmpty() && local.renderEmptyState ? (
|
|
@@ -616,7 +650,7 @@ export function GridList<T extends object>(props: GridListProps<T>): JSX.Element
|
|
|
616
650
|
<div
|
|
617
651
|
role="presentation"
|
|
618
652
|
aria-hidden="true"
|
|
619
|
-
style={
|
|
653
|
+
style={virtualSpacerStyle(virtualRange()!.offsetTop)}
|
|
620
654
|
data-virtualizer-spacer="top"
|
|
621
655
|
/>
|
|
622
656
|
) : null}
|
|
@@ -643,7 +677,7 @@ export function GridList<T extends object>(props: GridListProps<T>): JSX.Element
|
|
|
643
677
|
<div
|
|
644
678
|
role="presentation"
|
|
645
679
|
aria-hidden="true"
|
|
646
|
-
style={
|
|
680
|
+
style={virtualSpacerStyle(virtualRange()!.offsetBottom)}
|
|
647
681
|
data-virtualizer-spacer="bottom"
|
|
648
682
|
/>
|
|
649
683
|
) : null}
|
|
@@ -759,7 +793,9 @@ export function GridListItem<T extends object>(props: GridListItemProps<T>): JSX
|
|
|
759
793
|
|
|
760
794
|
const renderProps = useRenderProps(
|
|
761
795
|
{
|
|
762
|
-
children
|
|
796
|
+
get children() {
|
|
797
|
+
return props.children;
|
|
798
|
+
},
|
|
763
799
|
class: local.class,
|
|
764
800
|
style: local.style,
|
|
765
801
|
defaultClassName: "solidaria-GridList-item",
|
|
@@ -796,6 +832,7 @@ export function GridListItem<T extends object>(props: GridListItemProps<T>): JSX
|
|
|
796
832
|
)}
|
|
797
833
|
class={renderProps.class()}
|
|
798
834
|
style={renderProps.style()}
|
|
835
|
+
data-key={local.id}
|
|
799
836
|
data-selected={isSelected() || undefined}
|
|
800
837
|
data-focused={isFocused() || undefined}
|
|
801
838
|
data-focus-visible={(isFocusVisible() && isFocused()) || undefined}
|
|
@@ -876,7 +913,9 @@ export function GridListLoadMoreItem(props: GridListLoadMoreItemProps): JSX.Elem
|
|
|
876
913
|
|
|
877
914
|
const renderProps = useRenderProps(
|
|
878
915
|
{
|
|
879
|
-
|
|
916
|
+
get children() {
|
|
917
|
+
return props.children ?? (() => (isLoading() ? "Loading more..." : "Load more"));
|
|
918
|
+
},
|
|
880
919
|
class: props.class,
|
|
881
920
|
style: props.style,
|
|
882
921
|
defaultClassName: "solidaria-GridList-loadMore",
|
|
@@ -905,19 +944,81 @@ export function GridListLoadMoreItem(props: GridListLoadMoreItemProps): JSX.Elem
|
|
|
905
944
|
);
|
|
906
945
|
}
|
|
907
946
|
|
|
947
|
+
/**
|
|
948
|
+
* The header of a {@link GridListSection}. Renders as `role="row"` wrapping a
|
|
949
|
+
* `role="rowheader"` whose id labels the section (mirrors upstream
|
|
950
|
+
* `GridListHeader`). The row/rowheader props are supplied by the enclosing
|
|
951
|
+
* section through context.
|
|
952
|
+
*/
|
|
908
953
|
export function GridListHeader(props: GridListHeaderProps): JSX.Element {
|
|
954
|
+
const rowProps = useContext(GridListHeaderContext);
|
|
955
|
+
const rowHeaderProps = useContext(GridListHeaderInnerContext);
|
|
909
956
|
return (
|
|
910
|
-
<div
|
|
911
|
-
{props.
|
|
957
|
+
<div
|
|
958
|
+
class={props.class ?? "solidaria-GridListHeader"}
|
|
959
|
+
style={props.style}
|
|
960
|
+
{...(rowProps ?? {})}
|
|
961
|
+
>
|
|
962
|
+
<div {...(rowHeaderProps ?? {})} style={{ display: "contents" }}>
|
|
963
|
+
{props.children}
|
|
964
|
+
</div>
|
|
912
965
|
</div>
|
|
913
966
|
);
|
|
914
967
|
}
|
|
915
968
|
|
|
916
969
|
/**
|
|
917
|
-
*
|
|
970
|
+
* A section within a GridList. Renders as `role="rowgroup"` and supplies its
|
|
971
|
+
* optional {@link GridListHeader} with the row/rowheader props that wire up the
|
|
972
|
+
* section's `aria-labelledby` (mirrors upstream `GridListSection`).
|
|
918
973
|
*/
|
|
919
974
|
export function GridListSection(props: GridListSectionProps): JSX.Element {
|
|
920
|
-
|
|
975
|
+
const [local, domProps] = splitProps(props, ["children", "class", "style", "slot", "ref"]);
|
|
976
|
+
|
|
977
|
+
const section = createGridListSection({
|
|
978
|
+
get "aria-label"() {
|
|
979
|
+
return (domProps as { "aria-label"?: string })["aria-label"];
|
|
980
|
+
},
|
|
981
|
+
});
|
|
982
|
+
|
|
983
|
+
// Mirror upstream: resolve class/style via renderProps but keep children out
|
|
984
|
+
// of it (upstream passes `children: undefined`/`values: undefined`). The real
|
|
985
|
+
// children must only be evaluated inside the header providers below, otherwise
|
|
986
|
+
// a child <GridListHeader> would be instantiated in this component's owner and
|
|
987
|
+
// read the contexts as null.
|
|
988
|
+
// The values callback runs during setup (useRenderProps resolves class/style
|
|
989
|
+
// synchronously), so it must not read `local.children` — doing so would
|
|
990
|
+
// instantiate the header children in this owner, outside the providers below,
|
|
991
|
+
// and break their context wiring. Mirror upstream's `values: undefined` with a
|
|
992
|
+
// constant: a rendered section primitive always wraps its item collection.
|
|
993
|
+
const renderProps = useRenderProps(
|
|
994
|
+
{
|
|
995
|
+
children: undefined,
|
|
996
|
+
class: local.class,
|
|
997
|
+
style: local.style,
|
|
998
|
+
defaultClassName: "solidaria-GridListSection",
|
|
999
|
+
},
|
|
1000
|
+
() => ({ hasChildren: true }),
|
|
1001
|
+
);
|
|
1002
|
+
|
|
1003
|
+
const filteredDomProps = createMemo(() => filterDOMProps(domProps, { global: true }));
|
|
1004
|
+
|
|
1005
|
+
return (
|
|
1006
|
+
<div
|
|
1007
|
+
ref={(el) => assignRef(local.ref, el)}
|
|
1008
|
+
{...filteredDomProps()}
|
|
1009
|
+
{...section.rowGroupProps}
|
|
1010
|
+
class={renderProps.class()}
|
|
1011
|
+
style={renderProps.style()}
|
|
1012
|
+
slot={local.slot}
|
|
1013
|
+
data-section
|
|
1014
|
+
>
|
|
1015
|
+
<GridListHeaderContext.Provider value={section.rowProps}>
|
|
1016
|
+
<GridListHeaderInnerContext.Provider value={section.rowHeaderProps}>
|
|
1017
|
+
{local.children}
|
|
1018
|
+
</GridListHeaderInnerContext.Provider>
|
|
1019
|
+
</GridListHeaderContext.Provider>
|
|
1020
|
+
</div>
|
|
1021
|
+
);
|
|
921
1022
|
}
|
|
922
1023
|
|
|
923
1024
|
GridList.Item = GridListItem;
|
package/src/Icon.tsx
CHANGED
|
@@ -88,7 +88,9 @@ export function Icon(props: IconProps): JSX.Element {
|
|
|
88
88
|
|
|
89
89
|
const renderProps = useRenderProps(
|
|
90
90
|
{
|
|
91
|
-
children
|
|
91
|
+
get children() {
|
|
92
|
+
return local.children;
|
|
93
|
+
},
|
|
92
94
|
class: local.class,
|
|
93
95
|
style: local.style,
|
|
94
96
|
defaultClassName: "solidaria-Icon",
|
package/src/Link.tsx
CHANGED
|
@@ -210,7 +210,9 @@ export function Link(props: ParentProps<LinkProps>): JSX.Element {
|
|
|
210
210
|
|
|
211
211
|
const renderProps = useRenderProps(
|
|
212
212
|
{
|
|
213
|
-
children
|
|
213
|
+
get children() {
|
|
214
|
+
return props.children;
|
|
215
|
+
},
|
|
214
216
|
class: local.class,
|
|
215
217
|
style: local.style,
|
|
216
218
|
defaultClassName: "solidaria-Link",
|