@proyecto-viviana/solidaria-components 0.3.2 → 0.4.1
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.d.ts.map +1 -1
- package/dist/ActionBar.js +175 -0
- package/dist/ActionBar.js.map +1 -0
- package/dist/ActionBar.jsx +119 -0
- package/dist/ActionBar.jsx.map +1 -0
- package/dist/ActionGroup.d.ts.map +1 -1
- 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.d.ts +2 -2
- package/dist/Autocomplete.d.ts.map +1 -1
- 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 +333 -0
- package/dist/Breadcrumbs.js.map +1 -0
- package/dist/Breadcrumbs.jsx +261 -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 +573 -0
- package/dist/Calendar.js.map +1 -0
- package/dist/Calendar.jsx +342 -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 +1717 -0
- package/dist/Color.js.map +1 -0
- package/dist/Color.jsx +1340 -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 -4
- package/dist/ComboBox.d.ts.map +1 -1
- package/dist/ComboBox.js +1000 -0
- package/dist/ComboBox.js.map +1 -0
- package/dist/ComboBox.jsx +724 -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 +14 -5
- package/dist/DateField.d.ts.map +1 -1
- package/dist/DateField.js +4 -0
- package/dist/DateField.jsx +4 -0
- package/dist/DateField2.js +502 -0
- package/dist/DateField2.js.map +1 -0
- package/dist/DateField2.jsx +354 -0
- package/dist/DateField2.jsx.map +1 -0
- package/dist/DatePicker.d.ts +46 -7
- package/dist/DatePicker.d.ts.map +1 -1
- package/dist/DatePicker.js +7 -0
- package/dist/DatePicker.jsx +7 -0
- package/dist/DatePicker2.js +1171 -0
- package/dist/DatePicker2.js.map +1 -0
- package/dist/DatePicker2.jsx +820 -0
- package/dist/DatePicker2.jsx.map +1 -0
- package/dist/DateRangePickerContext.d.ts +2 -0
- package/dist/DateRangePickerContext.d.ts.map +1 -1
- 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 +331 -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/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 +2 -2
- package/dist/ListBox.d.ts.map +1 -1
- package/dist/ListBox.js +831 -0
- package/dist/ListBox.js.map +1 -0
- package/dist/ListBox.jsx +644 -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 +382 -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 +471 -0
- package/dist/Popover.js.map +1 -0
- package/dist/Popover.jsx +354 -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 +546 -0
- package/dist/RangeCalendar.js.map +1 -0
- package/dist/RangeCalendar.jsx +323 -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 +667 -0
- package/dist/SearchField.js.map +1 -0
- package/dist/SearchField.jsx +550 -0
- package/dist/SearchField.jsx.map +1 -0
- package/dist/Select.d.ts +7 -0
- package/dist/Select.d.ts.map +1 -1
- package/dist/Select.js +1044 -0
- package/dist/Select.js.map +1 -0
- package/dist/Select.jsx +759 -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 +167 -0
- package/dist/SharedElementTransition.js.map +1 -0
- package/dist/SharedElementTransition.jsx +140 -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.d.ts.map +1 -1
- package/dist/StepList.js +191 -0
- package/dist/StepList.js.map +1 -0
- package/dist/StepList.jsx +136 -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 +50 -0
- package/dist/Table.d.ts.map +1 -1
- package/dist/Table.js +1766 -0
- package/dist/Table.js.map +1 -0
- package/dist/Table.jsx +1355 -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 +598 -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 +3 -1
- package/dist/TagGroup.d.ts.map +1 -1
- package/dist/TagGroup.js +382 -0
- package/dist/TagGroup.js.map +1 -0
- package/dist/TagGroup.jsx +273 -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 +6 -6
- package/dist/TextField.d.ts.map +1 -1
- package/dist/TextField.js +439 -0
- package/dist/TextField.js.map +1 -0
- package/dist/TextField.jsx +406 -0
- package/dist/TextField.jsx.map +1 -0
- package/dist/TimeField.d.ts +17 -53
- package/dist/TimeField.d.ts.map +1 -1
- package/dist/TimeField.js +278 -0
- package/dist/TimeField.js.map +1 -0
- package/dist/TimeField.jsx +218 -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 +9 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +69 -23932
- package/dist/index.jsx +69 -18337
- package/dist/useDragAndDrop.d.ts +0 -8
- package/dist/useDragAndDrop.d.ts.map +1 -1
- package/dist/useDragAndDrop.js +2 -0
- package/dist/useDragAndDrop.jsx +2 -0
- package/dist/useDragAndDrop2.js +399 -0
- package/dist/useDragAndDrop2.js.map +1 -0
- package/dist/useDragAndDrop2.jsx +399 -0
- package/dist/useDragAndDrop2.jsx.map +1 -0
- package/dist/utils.d.ts +84 -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 +395 -4
- package/src/ActionBar.tsx +10 -12
- package/src/ActionGroup.tsx +5 -3
- package/src/Autocomplete.tsx +14 -9
- package/src/Breadcrumbs.tsx +58 -39
- package/src/Button.tsx +22 -2
- package/src/Calendar.tsx +57 -11
- package/src/CalendarPicker.tsx +73 -0
- package/src/Checkbox.tsx +539 -3
- package/src/Collection.tsx +9 -3
- package/src/Color.tsx +84 -41
- package/src/ComboBox.tsx +97 -21
- package/src/DateField.tsx +304 -53
- package/src/DatePicker.tsx +402 -62
- package/src/DateRangePickerContext.tsx +2 -0
- package/src/Dialog.tsx +13 -5
- package/src/Disclosure.tsx +7 -1
- package/src/DragAndDrop.tsx +3 -1
- package/src/DropZone.tsx +3 -1
- package/src/GridList.tsx +133 -26
- package/src/Icon.tsx +3 -1
- package/src/Link.tsx +3 -1
- package/src/ListBox.tsx +354 -25
- package/src/Menu.tsx +252 -128
- package/src/Meter.tsx +3 -1
- package/src/Modal.tsx +120 -56
- package/src/NumberField.tsx +51 -8
- package/src/Popover.tsx +68 -17
- package/src/ProgressBar.tsx +3 -1
- package/src/RadioGroup.tsx +468 -4
- package/src/RangeCalendar.tsx +123 -2
- package/src/SearchField.tsx +80 -4
- package/src/Select.tsx +122 -26
- package/src/SelectionIndicator.tsx +3 -1
- package/src/SharedElementTransition.tsx +95 -37
- package/src/Slider.tsx +159 -13
- package/src/StepList.tsx +0 -7
- package/src/Switch.tsx +395 -2
- package/src/Table.tsx +428 -99
- package/src/Tabs.tsx +17 -45
- package/src/TagGroup.tsx +29 -7
- package/src/Text.tsx +31 -10
- package/src/TextField.tsx +44 -6
- package/src/TimeField.tsx +127 -192
- package/src/Toast.tsx +79 -14
- package/src/ToggleButton.tsx +3 -1
- package/src/ToggleButtonGroup.tsx +3 -1
- package/src/Tooltip.tsx +3 -1
- package/src/Tree.tsx +91 -13
- package/src/Virtualizer.tsx +180 -31
- package/src/VirtualizerLayouts.ts +45 -10
- package/src/index.ts +51 -8
- package/src/useDragAndDrop.ts +8 -10
- package/src/utils.tsx +246 -30
- package/dist/HiddenTimeInput.d.ts +0 -25
- package/dist/HiddenTimeInput.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.jsx.map +0 -1
- package/src/HiddenTimeInput.tsx +0 -133
package/src/SearchField.tsx
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
9
|
type JSX,
|
|
10
|
+
type Context,
|
|
10
11
|
createContext,
|
|
11
12
|
createMemo,
|
|
12
13
|
onCleanup,
|
|
@@ -38,7 +39,10 @@ import {
|
|
|
38
39
|
type SlotProps,
|
|
39
40
|
useRenderProps,
|
|
40
41
|
filterDOMProps,
|
|
42
|
+
Provider,
|
|
41
43
|
} from "./utils";
|
|
44
|
+
import { TextContext } from "./Text";
|
|
45
|
+
import { useAutocompleteInput } from "./Autocomplete";
|
|
42
46
|
|
|
43
47
|
export interface SearchFieldRenderProps {
|
|
44
48
|
/** Whether the search field is empty. */
|
|
@@ -244,7 +248,35 @@ export function SearchField(props: SearchFieldProps): JSX.Element {
|
|
|
244
248
|
const baseProps = (
|
|
245
249
|
contextProps ? mergeProps(contextBaseProps(), contextSlotProps ?? {}, props) : props
|
|
246
250
|
) as SearchFieldProps;
|
|
247
|
-
|
|
251
|
+
|
|
252
|
+
// When rendered inside an <Autocomplete>, the FieldInputContext (AutocompleteContext)
|
|
253
|
+
// controls the input's value and keyboard handling: value + onChange make the field's
|
|
254
|
+
// state controlled by the shared autocomplete state (which drives the collection
|
|
255
|
+
// filter), and onKeyDown/onFocus/onBlur chain the autocomplete's virtual-focus
|
|
256
|
+
// navigation into the input. This mirrors RAC's
|
|
257
|
+
// useContextProps(props, inputRef, FieldInputContext). The remaining passthroughs
|
|
258
|
+
// (aria-activedescendant/aria-controls/aria-autocomplete) and the input-ref
|
|
259
|
+
// registration are applied at the <input> in SearchFieldInput.
|
|
260
|
+
const autocompleteInput = useAutocompleteInput();
|
|
261
|
+
const autocompleteProps = autocompleteInput
|
|
262
|
+
? ({
|
|
263
|
+
get value() {
|
|
264
|
+
return autocompleteInput.inputProps.value();
|
|
265
|
+
},
|
|
266
|
+
onChange: autocompleteInput.inputProps.onChange,
|
|
267
|
+
onKeyDown: autocompleteInput.inputProps
|
|
268
|
+
.onKeyDown as unknown as SearchFieldProps["onKeyDown"],
|
|
269
|
+
onFocus: autocompleteInput.inputProps.onFocus as unknown as SearchFieldProps["onFocus"],
|
|
270
|
+
onBlur: autocompleteInput.inputProps.onBlur as unknown as SearchFieldProps["onBlur"],
|
|
271
|
+
} as Partial<SearchFieldProps>)
|
|
272
|
+
: undefined;
|
|
273
|
+
|
|
274
|
+
const mergedProps = withFormValidationBehavior(
|
|
275
|
+
autocompleteProps
|
|
276
|
+
? (mergeProps(baseProps, autocompleteProps) as SearchFieldProps)
|
|
277
|
+
: baseProps,
|
|
278
|
+
formContext,
|
|
279
|
+
);
|
|
248
280
|
|
|
249
281
|
const [local, stateProps, ariaProps, rest] = splitProps(
|
|
250
282
|
mergedProps,
|
|
@@ -456,7 +488,9 @@ export function SearchField(props: SearchFieldProps): JSX.Element {
|
|
|
456
488
|
|
|
457
489
|
const renderProps = useRenderProps(
|
|
458
490
|
{
|
|
459
|
-
children
|
|
491
|
+
get children() {
|
|
492
|
+
return local.children;
|
|
493
|
+
},
|
|
460
494
|
class: local.class,
|
|
461
495
|
style: local.style,
|
|
462
496
|
defaultClassName: "solidaria-SearchField",
|
|
@@ -544,6 +578,21 @@ export function SearchField(props: SearchFieldProps): JSX.Element {
|
|
|
544
578
|
const children = local.children;
|
|
545
579
|
return typeof children === "function" ? children(childRenderValues) : children;
|
|
546
580
|
};
|
|
581
|
+
// Provide the description / errorMessage props as `TextContext` slots (mirrors
|
|
582
|
+
// react-aria-components' SearchField), so a `<Text slot="description">` /
|
|
583
|
+
// `<Text slot="errorMessage">` child picks up the `id` its `aria-describedby`
|
|
584
|
+
// references. Additive: existing consumers reading these off
|
|
585
|
+
// `SearchFieldContext` are unaffected.
|
|
586
|
+
const textSlots = {
|
|
587
|
+
slots: {
|
|
588
|
+
get description() {
|
|
589
|
+
return searchFieldAria.descriptionProps;
|
|
590
|
+
},
|
|
591
|
+
get errorMessage() {
|
|
592
|
+
return searchFieldAria.errorMessageProps;
|
|
593
|
+
},
|
|
594
|
+
},
|
|
595
|
+
};
|
|
547
596
|
|
|
548
597
|
return (
|
|
549
598
|
<FieldErrorContext.Provider value={fieldErrorContext}>
|
|
@@ -559,7 +608,9 @@ export function SearchField(props: SearchFieldProps): JSX.Element {
|
|
|
559
608
|
data-required={ariaProps.isRequired || undefined}
|
|
560
609
|
data-readonly={ariaProps.isReadOnly || undefined}
|
|
561
610
|
>
|
|
562
|
-
{
|
|
611
|
+
<Provider values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}>
|
|
612
|
+
{fieldChildren()}
|
|
613
|
+
</Provider>
|
|
563
614
|
</div>
|
|
564
615
|
</SearchFieldContext.Provider>
|
|
565
616
|
</FieldErrorContext.Provider>
|
|
@@ -607,6 +658,15 @@ export function SearchFieldInput(props: SearchFieldInputProps): JSX.Element {
|
|
|
607
658
|
throw new Error("SearchFieldInput must be used within a SearchField");
|
|
608
659
|
}
|
|
609
660
|
|
|
661
|
+
// Inside an <Autocomplete>, expose the ARIA attributes that identify the
|
|
662
|
+
// controlled collection and its virtually-focused option. value/onChange and the
|
|
663
|
+
// keyboard handlers are already merged upstream in SearchField(); here we only add
|
|
664
|
+
// the passthrough attributes that createTextField doesn't forward, and register the
|
|
665
|
+
// input element as the autocomplete inputRef so the beforeinput + reverse-path
|
|
666
|
+
// (aria-activedescendant mirror) listeners bind. Mirrors RAC's
|
|
667
|
+
// [InputContext, {...inputProps, ref: inputRef}].
|
|
668
|
+
const autocompleteInput = useAutocompleteInput();
|
|
669
|
+
|
|
610
670
|
const { isFocused, isFocusVisible, focusProps } = createFocusRing();
|
|
611
671
|
|
|
612
672
|
const { isHovered, hoverProps } = createHover({
|
|
@@ -645,12 +705,25 @@ export function SearchFieldInput(props: SearchFieldInputProps): JSX.Element {
|
|
|
645
705
|
return rest;
|
|
646
706
|
};
|
|
647
707
|
|
|
708
|
+
const autocompleteInputAttrs = (): Record<string, unknown> => {
|
|
709
|
+
if (!autocompleteInput) {
|
|
710
|
+
return {};
|
|
711
|
+
}
|
|
712
|
+
const inputProps = autocompleteInput.inputProps;
|
|
713
|
+
return {
|
|
714
|
+
"aria-controls": inputProps["aria-controls"],
|
|
715
|
+
"aria-autocomplete": inputProps["aria-autocomplete"],
|
|
716
|
+
"aria-activedescendant": inputProps["aria-activedescendant"](),
|
|
717
|
+
};
|
|
718
|
+
};
|
|
719
|
+
|
|
648
720
|
const mergedInputProps = () =>
|
|
649
721
|
({
|
|
650
722
|
...domProps,
|
|
651
723
|
...cleanInputProps(),
|
|
652
724
|
...cleanFocusProps(),
|
|
653
725
|
...cleanHoverProps(),
|
|
726
|
+
...autocompleteInputAttrs(),
|
|
654
727
|
}) as Record<string, unknown>;
|
|
655
728
|
|
|
656
729
|
onMount(() => {
|
|
@@ -701,6 +774,7 @@ export function SearchFieldInput(props: SearchFieldInputProps): JSX.Element {
|
|
|
701
774
|
ref={(element) => {
|
|
702
775
|
inputElement = element;
|
|
703
776
|
context.setInputRef?.(element);
|
|
777
|
+
autocompleteInput?.inputRef(element);
|
|
704
778
|
const ref = (domProps as { ref?: unknown }).ref;
|
|
705
779
|
if (typeof ref === "function") {
|
|
706
780
|
ref(element);
|
|
@@ -758,7 +832,9 @@ export function SearchFieldClearButton(props: SearchFieldClearButtonProps): JSX.
|
|
|
758
832
|
|
|
759
833
|
const renderProps = useRenderProps(
|
|
760
834
|
{
|
|
761
|
-
children
|
|
835
|
+
get children() {
|
|
836
|
+
return props.children;
|
|
837
|
+
},
|
|
762
838
|
class: local.class,
|
|
763
839
|
style: local.style,
|
|
764
840
|
defaultClassName: "solidaria-SearchField-clear",
|
package/src/Select.tsx
CHANGED
|
@@ -186,11 +186,15 @@ export interface SelectTriggerRenderProps {
|
|
|
186
186
|
isFocusVisible: boolean;
|
|
187
187
|
/** Whether the trigger is hovered. */
|
|
188
188
|
isHovered: boolean;
|
|
189
|
+
/** Whether the trigger is pressed. */
|
|
190
|
+
isPressed: boolean;
|
|
189
191
|
/** Whether the trigger is disabled. */
|
|
190
192
|
isDisabled: boolean;
|
|
191
193
|
}
|
|
192
194
|
|
|
193
195
|
export interface SelectTriggerProps extends SlotProps {
|
|
196
|
+
/** A ref callback/object for the underlying trigger button element. */
|
|
197
|
+
ref?: RefLike<HTMLButtonElement>;
|
|
194
198
|
/** The children of the trigger. A function may be provided to receive render props. */
|
|
195
199
|
children?: RenderChildren<SelectTriggerRenderProps>;
|
|
196
200
|
/** The CSS className for the element. */
|
|
@@ -241,6 +245,8 @@ export interface SelectOptionRenderProps {
|
|
|
241
245
|
}
|
|
242
246
|
|
|
243
247
|
export interface SelectOptionProps<T> extends Omit<AriaOptionProps, "children" | "key">, SlotProps {
|
|
248
|
+
/** A ref callback/object for the underlying option element. */
|
|
249
|
+
ref?: RefLike<HTMLDivElement>;
|
|
244
250
|
/** The unique key for the option. */
|
|
245
251
|
id: Key;
|
|
246
252
|
/** The item value. */
|
|
@@ -269,6 +275,7 @@ interface SelectContextValue<T> {
|
|
|
269
275
|
isOpen: Accessor<boolean>;
|
|
270
276
|
isFocused: Accessor<boolean>;
|
|
271
277
|
isFocusVisible: Accessor<boolean>;
|
|
278
|
+
isPressed: Accessor<boolean>;
|
|
272
279
|
isDisabled: Accessor<boolean>;
|
|
273
280
|
placeholder?: string;
|
|
274
281
|
items: T[];
|
|
@@ -398,8 +405,16 @@ export function Select<T>(props: SelectProps<T>): JSX.Element {
|
|
|
398
405
|
return clean as typeof ariaProps;
|
|
399
406
|
});
|
|
400
407
|
|
|
401
|
-
const {
|
|
402
|
-
|
|
408
|
+
const {
|
|
409
|
+
labelProps,
|
|
410
|
+
triggerProps,
|
|
411
|
+
valueProps,
|
|
412
|
+
menuProps,
|
|
413
|
+
isFocused,
|
|
414
|
+
isFocusVisible,
|
|
415
|
+
isOpen,
|
|
416
|
+
isPressed,
|
|
417
|
+
} = createSelect<T>(selectAriaProps, state);
|
|
403
418
|
|
|
404
419
|
const { isHovered, hoverProps } = createHover({
|
|
405
420
|
get isDisabled() {
|
|
@@ -579,6 +594,17 @@ export function Select<T>(props: SelectProps<T>): JSX.Element {
|
|
|
579
594
|
|
|
580
595
|
return (
|
|
581
596
|
<>
|
|
597
|
+
<Show when={ariaProps.label}>
|
|
598
|
+
<span {...cleanLabelProps()}>{ariaProps.label as JSX.Element}</span>
|
|
599
|
+
</Show>
|
|
600
|
+
{selectChildren}
|
|
601
|
+
{/*
|
|
602
|
+
The HiddenSelect (native `<select>` for form autofill/submission) renders
|
|
603
|
+
AFTER the trigger button, mirroring upstream RAC `Select` which emits
|
|
604
|
+
`{renderProps.children}` then `<HiddenSelect>` (Select.tsx:288-289). Order
|
|
605
|
+
matters for the DOM tab/focus trail: the visible button must precede the
|
|
606
|
+
form-only hidden control.
|
|
607
|
+
*/}
|
|
582
608
|
<div {...containerProps}>
|
|
583
609
|
<select
|
|
584
610
|
{...hiddenSelectProps}
|
|
@@ -652,10 +678,6 @@ export function Select<T>(props: SelectProps<T>): JSX.Element {
|
|
|
652
678
|
/>
|
|
653
679
|
</Show>
|
|
654
680
|
</div>
|
|
655
|
-
<Show when={ariaProps.label}>
|
|
656
|
-
<span {...cleanLabelProps()}>{ariaProps.label as JSX.Element}</span>
|
|
657
|
-
</Show>
|
|
658
|
-
{selectChildren}
|
|
659
681
|
</>
|
|
660
682
|
);
|
|
661
683
|
};
|
|
@@ -711,6 +733,7 @@ export function Select<T>(props: SelectProps<T>): JSX.Element {
|
|
|
711
733
|
isOpen,
|
|
712
734
|
isFocused,
|
|
713
735
|
isFocusVisible,
|
|
736
|
+
isPressed,
|
|
714
737
|
isDisabled: resolveDisabled,
|
|
715
738
|
placeholder: ariaProps.placeholder,
|
|
716
739
|
items: stateProps.items,
|
|
@@ -731,17 +754,18 @@ export function Select<T>(props: SelectProps<T>): JSX.Element {
|
|
|
731
754
|
* The trigger button for a select.
|
|
732
755
|
*/
|
|
733
756
|
export function SelectTrigger(props: SelectTriggerProps): JSX.Element {
|
|
734
|
-
const [local, domProps] = splitProps(props, ["class", "style", "slot", "children"]);
|
|
757
|
+
const [local, domProps] = splitProps(props, ["class", "style", "slot", "children", "ref"]);
|
|
735
758
|
|
|
736
759
|
const context = useContext(SelectContext);
|
|
737
760
|
if (!context) {
|
|
738
761
|
throw new Error("SelectTrigger must be used within a Select");
|
|
739
762
|
}
|
|
740
|
-
const { isOpen, isFocused, isFocusVisible, state } = context;
|
|
763
|
+
const { isOpen, isFocused, isFocusVisible, isPressed, state } = context;
|
|
741
764
|
let triggerRef: HTMLButtonElement | undefined;
|
|
742
765
|
const setTriggerRef = (el: HTMLButtonElement) => {
|
|
743
766
|
triggerRef = el;
|
|
744
767
|
context.setTriggerRef(el);
|
|
768
|
+
assignRef(local.ref, el);
|
|
745
769
|
};
|
|
746
770
|
|
|
747
771
|
createEffect(() => {
|
|
@@ -761,12 +785,15 @@ export function SelectTrigger(props: SelectTriggerProps): JSX.Element {
|
|
|
761
785
|
isFocused: isFocused(),
|
|
762
786
|
isFocusVisible: isFocusVisible(),
|
|
763
787
|
isHovered: isHovered(),
|
|
788
|
+
isPressed: isPressed(),
|
|
764
789
|
isDisabled: state.isDisabled,
|
|
765
790
|
}));
|
|
766
791
|
|
|
767
792
|
const renderProps = useRenderProps(
|
|
768
793
|
{
|
|
769
|
-
children
|
|
794
|
+
get children() {
|
|
795
|
+
return props.children;
|
|
796
|
+
},
|
|
770
797
|
class: local.class,
|
|
771
798
|
style: local.style,
|
|
772
799
|
defaultClassName: "solidaria-Select-trigger",
|
|
@@ -871,7 +898,9 @@ export function SelectValue<T>(props: SelectValueProps<T>): JSX.Element {
|
|
|
871
898
|
|
|
872
899
|
const renderProps = useRenderProps(
|
|
873
900
|
{
|
|
874
|
-
|
|
901
|
+
get children() {
|
|
902
|
+
return props.children ?? defaultSelectValueChildren;
|
|
903
|
+
},
|
|
875
904
|
class: local.class,
|
|
876
905
|
style: local.style,
|
|
877
906
|
defaultClassName: "solidaria-Select-value",
|
|
@@ -922,6 +951,14 @@ export function SelectListBox<T>(props: SelectListBoxProps<T>): JSX.Element {
|
|
|
922
951
|
if (!isOpen()) {
|
|
923
952
|
return;
|
|
924
953
|
}
|
|
954
|
+
// On open the listbox takes collection focus. Upstream `useSelect` sets
|
|
955
|
+
// `menuProps.autoFocus = state.focusStrategy || true`, so the ListBox's
|
|
956
|
+
// `useSelectableCollection` auto-focuses on mount — setting the selection
|
|
957
|
+
// manager's `isFocused` true and focusing the selected option. Our
|
|
958
|
+
// `createListBox` reimplements keyboard nav inline (no `autoFocus` effect),
|
|
959
|
+
// so we set the manager focus here to match. Without it the selected option
|
|
960
|
+
// never paints its focus-visible background (`data-focused` stays unset).
|
|
961
|
+
state.selectionManager.setFocused(true);
|
|
925
962
|
if (state.focusedKey() != null) {
|
|
926
963
|
return;
|
|
927
964
|
}
|
|
@@ -931,7 +968,7 @@ export function SelectListBox<T>(props: SelectListBoxProps<T>): JSX.Element {
|
|
|
931
968
|
}
|
|
932
969
|
});
|
|
933
970
|
|
|
934
|
-
let listBoxRef:
|
|
971
|
+
let listBoxRef: HTMLDivElement | undefined;
|
|
935
972
|
|
|
936
973
|
createInteractOutside({
|
|
937
974
|
ref: () => rootRef() ?? listBoxRef ?? null,
|
|
@@ -945,7 +982,14 @@ export function SelectListBox<T>(props: SelectListBoxProps<T>): JSX.Element {
|
|
|
945
982
|
},
|
|
946
983
|
});
|
|
947
984
|
|
|
948
|
-
|
|
985
|
+
// Keep the hook result intact — destructuring `{ listBoxProps }` invokes the
|
|
986
|
+
// `get listBoxProps()` getter ONCE and freezes it (the Solid "destructuring a
|
|
987
|
+
// get-prop freezes reactivity" gotcha). The listbox `tabIndex` is computed from
|
|
988
|
+
// `focusedKey` (`focusedKey != null ? -1 : 0`); on open the effect above sets a
|
|
989
|
+
// focused key, so a frozen snapshot would leave the listbox tabbable (`0`) when
|
|
990
|
+
// upstream flips it to `-1`. Reading `listBoxHook.listBoxProps` per access keeps
|
|
991
|
+
// it reactive.
|
|
992
|
+
const listBoxHook = createListBox(
|
|
949
993
|
{
|
|
950
994
|
...(menuProps as unknown as AriaListBoxProps),
|
|
951
995
|
shouldSelectOnPressUp: true,
|
|
@@ -959,7 +1003,9 @@ export function SelectListBox<T>(props: SelectListBoxProps<T>): JSX.Element {
|
|
|
959
1003
|
);
|
|
960
1004
|
|
|
961
1005
|
const renderValues = createMemo<SelectListBoxRenderProps>(() => ({
|
|
962
|
-
|
|
1006
|
+
// Focus within the listbox itself (the selection manager's focus state),
|
|
1007
|
+
// not the select-level trigger focus.
|
|
1008
|
+
isFocused: state.selectionManager.isFocused,
|
|
963
1009
|
}));
|
|
964
1010
|
|
|
965
1011
|
const renderProps = useRenderProps(
|
|
@@ -976,8 +1022,37 @@ export function SelectListBox<T>(props: SelectListBoxProps<T>): JSX.Element {
|
|
|
976
1022
|
return rest;
|
|
977
1023
|
};
|
|
978
1024
|
const cleanListBoxProps = () => {
|
|
979
|
-
const {
|
|
980
|
-
|
|
1025
|
+
const {
|
|
1026
|
+
ref: _ref2,
|
|
1027
|
+
"aria-activedescendant": _activeDescendant,
|
|
1028
|
+
onFocus: _onFocus,
|
|
1029
|
+
...rest
|
|
1030
|
+
} = listBoxHook.listBoxProps as Record<string, unknown>;
|
|
1031
|
+
// Faithful Select listbox focus model: the focused option receives REAL DOM
|
|
1032
|
+
// focus (the open effect above + `createSelectableItem`'s self-focus move
|
|
1033
|
+
// `document.activeElement` onto it), mirroring upstream `useSelect`. So the
|
|
1034
|
+
// listbox must (a) leave the tab sequence once an option is focused —
|
|
1035
|
+
// `useSelectableCollection` uses `tabIndex = focusedKey == null ? 0 : -1`
|
|
1036
|
+
// (useSelectableCollection.ts:687-690) — and (b) NOT expose
|
|
1037
|
+
// `aria-activedescendant`, which is the virtual-focus channel upstream Select
|
|
1038
|
+
// never uses. These are overridden here, not in the shared `createListBox`,
|
|
1039
|
+
// because the standalone `ListBox` keeps its container-focus model (focus
|
|
1040
|
+
// stays on the listbox, `aria-activedescendant` is its AT channel).
|
|
1041
|
+
//
|
|
1042
|
+
// We also drop `createListBox`'s container-focus TRAMPOLINE (`onFocus`): it
|
|
1043
|
+
// marshals the first key when the container is focused with `focusedKey ==
|
|
1044
|
+
// null`, which is exactly Select's deliberate click-open state (the open
|
|
1045
|
+
// effect sets `isFocused` true but leaves `focusedKey` null when nothing is
|
|
1046
|
+
// selected, so the first arrow enters the first item). Upstream's own
|
|
1047
|
+
// trampoline no-ops in this case because it guards on `manager.isFocused`
|
|
1048
|
+
// (already true); our shared guard uses `focusedKey == null` for the
|
|
1049
|
+
// standalone ListBox, so we strip it here to preserve Select's faithful
|
|
1050
|
+
// model. (Auto-selecting on focus under replace behavior would also toggle
|
|
1051
|
+
// the first item selected on open — the bug this override prevents.)
|
|
1052
|
+
return {
|
|
1053
|
+
...rest,
|
|
1054
|
+
tabIndex: state.isDisabled ? undefined : state.focusedKey() != null ? -1 : 0,
|
|
1055
|
+
};
|
|
981
1056
|
};
|
|
982
1057
|
|
|
983
1058
|
const items = () => Array.from(state.collection());
|
|
@@ -997,20 +1072,25 @@ export function SelectListBox<T>(props: SelectListBoxProps<T>): JSX.Element {
|
|
|
997
1072
|
});
|
|
998
1073
|
|
|
999
1074
|
const listBox = () => (
|
|
1000
|
-
|
|
1075
|
+
// Upstream RAC ListBox (and our own Menu.tsx) render a `<div role="listbox">`
|
|
1076
|
+
// over `<div role="option">` rows, NOT `<ul>`/`<li>` — the collection is
|
|
1077
|
+
// div-based for virtualization parity. `<ul>`/`<li>` here was a self-inflicted
|
|
1078
|
+
// structural divergence surfaced by the Picker recertification (D5/D6/D8 saw
|
|
1079
|
+
// `li[option]`/`ul[listbox]` where the React oracle sees `div`).
|
|
1080
|
+
<div
|
|
1001
1081
|
ref={(el) => (listBoxRef = el)}
|
|
1002
1082
|
{...domProps}
|
|
1003
1083
|
{...cleanMenuProps()}
|
|
1004
1084
|
{...cleanListBoxProps()}
|
|
1005
1085
|
class={renderProps.class()}
|
|
1006
1086
|
style={renderProps.style()}
|
|
1007
|
-
data-focused={state.isFocused
|
|
1087
|
+
data-focused={state.selectionManager.isFocused || undefined}
|
|
1008
1088
|
data-empty={state.collection().size === 0 || undefined}
|
|
1009
1089
|
>
|
|
1010
1090
|
{state.collection().size === 0 && local.renderEmptyState ? (
|
|
1011
|
-
<
|
|
1091
|
+
<div role="option" style={{ display: "contents" }} data-empty-state>
|
|
1012
1092
|
{local.renderEmptyState()}
|
|
1013
|
-
</
|
|
1093
|
+
</div>
|
|
1014
1094
|
) : (
|
|
1015
1095
|
<Show
|
|
1016
1096
|
when={local.children}
|
|
@@ -1034,7 +1114,7 @@ export function SelectListBox<T>(props: SelectListBoxProps<T>): JSX.Element {
|
|
|
1034
1114
|
{local.renderLoadMore?.()}
|
|
1035
1115
|
</ListBoxLoadMoreItem>
|
|
1036
1116
|
</Show>
|
|
1037
|
-
</
|
|
1117
|
+
</div>
|
|
1038
1118
|
);
|
|
1039
1119
|
|
|
1040
1120
|
return (
|
|
@@ -1064,6 +1144,7 @@ export function SelectOption<T>(props: SelectOptionProps<T>): JSX.Element {
|
|
|
1064
1144
|
"id",
|
|
1065
1145
|
"item",
|
|
1066
1146
|
"textValue",
|
|
1147
|
+
"ref",
|
|
1067
1148
|
]);
|
|
1068
1149
|
|
|
1069
1150
|
const context = useContext(SelectStateContext);
|
|
@@ -1072,6 +1153,11 @@ export function SelectOption<T>(props: SelectOptionProps<T>): JSX.Element {
|
|
|
1072
1153
|
}
|
|
1073
1154
|
const state = context as SelectState<T>;
|
|
1074
1155
|
const selectContext = useContext(SelectContext) as SelectContextValue<T> | null;
|
|
1156
|
+
const [ref, setRefSignal] = createSignal<HTMLDivElement | null>(null);
|
|
1157
|
+
const setRef = (el: HTMLDivElement | null) => {
|
|
1158
|
+
setRefSignal(el);
|
|
1159
|
+
assignRef(local.ref, el as HTMLDivElement);
|
|
1160
|
+
};
|
|
1075
1161
|
|
|
1076
1162
|
const optionAria = createOption<T>(
|
|
1077
1163
|
{
|
|
@@ -1126,6 +1212,7 @@ export function SelectOption<T>(props: SelectOptionProps<T>): JSX.Element {
|
|
|
1126
1212
|
}
|
|
1127
1213
|
},
|
|
1128
1214
|
},
|
|
1215
|
+
() => ref(),
|
|
1129
1216
|
);
|
|
1130
1217
|
const isOptionFocusVisible = () =>
|
|
1131
1218
|
optionAria.isFocused() && (selectContext?.isFocusVisible() ?? optionAria.isFocusVisible());
|
|
@@ -1141,7 +1228,9 @@ export function SelectOption<T>(props: SelectOptionProps<T>): JSX.Element {
|
|
|
1141
1228
|
|
|
1142
1229
|
const renderProps = useRenderProps(
|
|
1143
1230
|
{
|
|
1144
|
-
children
|
|
1231
|
+
get children() {
|
|
1232
|
+
return props.children;
|
|
1233
|
+
},
|
|
1145
1234
|
class: local.class,
|
|
1146
1235
|
style: local.style,
|
|
1147
1236
|
defaultClassName: "solidaria-Select-option",
|
|
@@ -1177,7 +1266,7 @@ export function SelectOption<T>(props: SelectOptionProps<T>): JSX.Element {
|
|
|
1177
1266
|
selectOption();
|
|
1178
1267
|
}
|
|
1179
1268
|
});
|
|
1180
|
-
}) as JSX.EventHandler<
|
|
1269
|
+
}) as JSX.EventHandler<HTMLDivElement, MouseEvent>;
|
|
1181
1270
|
return rest;
|
|
1182
1271
|
};
|
|
1183
1272
|
const selectOption = () => {
|
|
@@ -1199,7 +1288,10 @@ export function SelectOption<T>(props: SelectOptionProps<T>): JSX.Element {
|
|
|
1199
1288
|
|
|
1200
1289
|
return (
|
|
1201
1290
|
<SelectionIndicatorContext.Provider value={selectionIndicatorContext()}>
|
|
1202
|
-
|
|
1291
|
+
{/* `<div role="option">`, not `<li>` — see the SelectListBox note; upstream
|
|
1292
|
+
RAC options are div-based. */}
|
|
1293
|
+
<div
|
|
1294
|
+
ref={setRef}
|
|
1203
1295
|
{...cleanOptionProps()}
|
|
1204
1296
|
class={renderProps.class()}
|
|
1205
1297
|
style={renderProps.style()}
|
|
@@ -1215,7 +1307,7 @@ export function SelectOption<T>(props: SelectOptionProps<T>): JSX.Element {
|
|
|
1215
1307
|
) : (
|
|
1216
1308
|
renderProps.renderChildren()
|
|
1217
1309
|
)}
|
|
1218
|
-
</
|
|
1310
|
+
</div>
|
|
1219
1311
|
</SelectionIndicatorContext.Provider>
|
|
1220
1312
|
);
|
|
1221
1313
|
}
|
|
@@ -1254,8 +1346,12 @@ function createSelectListStateAdapter<T>(state: SelectState<T>): ListState<T> {
|
|
|
1254
1346
|
|
|
1255
1347
|
return {
|
|
1256
1348
|
collection: state.collection,
|
|
1257
|
-
|
|
1258
|
-
|
|
1349
|
+
selectionManager: state.selectionManager,
|
|
1350
|
+
// Collection-level focus (the selection manager's), not the select-level
|
|
1351
|
+
// trigger focus — upstream listbox internals only ever read
|
|
1352
|
+
// state.selectionManager.isFocused.
|
|
1353
|
+
isFocused: () => state.selectionManager.isFocused,
|
|
1354
|
+
setFocused: (isFocused) => state.selectionManager.setFocused(isFocused),
|
|
1259
1355
|
focusedKey: state.focusedKey,
|
|
1260
1356
|
setFocusedKey: (key) => state.setFocusedKey(key ?? null),
|
|
1261
1357
|
childFocusStrategy: () => null,
|
|
@@ -61,7 +61,9 @@ export function SelectionIndicator(props: SelectionIndicatorProps): JSX.Element
|
|
|
61
61
|
|
|
62
62
|
const renderProps = useRenderProps(
|
|
63
63
|
{
|
|
64
|
-
children
|
|
64
|
+
get children() {
|
|
65
|
+
return local.children;
|
|
66
|
+
},
|
|
65
67
|
class: local.class,
|
|
66
68
|
style: local.style,
|
|
67
69
|
defaultClassName: "solidaria-SelectionIndicator",
|