@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/Color.tsx
CHANGED
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
createFocusRing,
|
|
29
29
|
createHover,
|
|
30
30
|
mergeProps,
|
|
31
|
+
useLocale,
|
|
31
32
|
type AriaColorSliderOptions,
|
|
32
33
|
type AriaColorAreaOptions,
|
|
33
34
|
type AriaColorWheelOptions,
|
|
@@ -233,7 +234,11 @@ export function ColorSlider(props: ColorSliderProps): JSX.Element {
|
|
|
233
234
|
],
|
|
234
235
|
);
|
|
235
236
|
|
|
236
|
-
|
|
237
|
+
const locale = useLocale();
|
|
238
|
+
|
|
239
|
+
// Create color slider state. The locale drives the thumb value label's
|
|
240
|
+
// channel-value formatting (e.g. hue "50°" vs ar-AE "50 درجة"), mirroring
|
|
241
|
+
// RAC ColorSlider passing `useLocale().locale` into useColorSliderState.
|
|
237
242
|
const state = createColorSliderState(() => ({
|
|
238
243
|
value: stateProps.value ?? pickerContext?.value,
|
|
239
244
|
defaultValue: stateProps.defaultValue,
|
|
@@ -243,6 +248,7 @@ export function ColorSlider(props: ColorSliderProps): JSX.Element {
|
|
|
243
248
|
colorSpace: stateProps.colorSpace,
|
|
244
249
|
orientation: ariaProps.orientation,
|
|
245
250
|
isDisabled: ariaProps.isDisabled,
|
|
251
|
+
locale: locale().locale,
|
|
246
252
|
}));
|
|
247
253
|
|
|
248
254
|
let trackRef: HTMLDivElement | undefined;
|
|
@@ -288,7 +294,9 @@ export function ColorSlider(props: ColorSliderProps): JSX.Element {
|
|
|
288
294
|
|
|
289
295
|
const renderProps = useRenderProps(
|
|
290
296
|
{
|
|
291
|
-
children
|
|
297
|
+
get children() {
|
|
298
|
+
return props.children;
|
|
299
|
+
},
|
|
292
300
|
class: local.class,
|
|
293
301
|
style: local.style,
|
|
294
302
|
defaultClassName: "solidaria-ColorSlider",
|
|
@@ -422,7 +430,9 @@ export function ColorSliderTrack(props: ColorSliderTrackProps): JSX.Element {
|
|
|
422
430
|
|
|
423
431
|
const renderProps = useRenderProps(
|
|
424
432
|
{
|
|
425
|
-
children
|
|
433
|
+
get children() {
|
|
434
|
+
return props.children;
|
|
435
|
+
},
|
|
426
436
|
class: local.class,
|
|
427
437
|
style: local.style,
|
|
428
438
|
defaultClassName: "solidaria-ColorSlider-track",
|
|
@@ -494,7 +504,9 @@ export function ColorSliderThumb(props: ColorSliderThumbProps): JSX.Element {
|
|
|
494
504
|
|
|
495
505
|
const renderProps = useRenderProps(
|
|
496
506
|
{
|
|
497
|
-
children
|
|
507
|
+
get children() {
|
|
508
|
+
return props.children;
|
|
509
|
+
},
|
|
498
510
|
class: local.class,
|
|
499
511
|
style: local.style,
|
|
500
512
|
defaultClassName: "solidaria-ColorSlider-thumb",
|
|
@@ -739,7 +751,9 @@ export function ColorArea(props: ColorAreaProps): JSX.Element {
|
|
|
739
751
|
|
|
740
752
|
const renderProps = useRenderProps(
|
|
741
753
|
{
|
|
742
|
-
children
|
|
754
|
+
get children() {
|
|
755
|
+
return props.children;
|
|
756
|
+
},
|
|
743
757
|
class: local.class,
|
|
744
758
|
style: local.style,
|
|
745
759
|
defaultClassName: "solidaria-ColorArea",
|
|
@@ -825,7 +839,9 @@ export function ColorAreaGradient(props: ColorAreaGradientProps): JSX.Element {
|
|
|
825
839
|
|
|
826
840
|
const renderProps = useRenderProps(
|
|
827
841
|
{
|
|
828
|
-
children
|
|
842
|
+
get children() {
|
|
843
|
+
return props.children;
|
|
844
|
+
},
|
|
829
845
|
class: local.class,
|
|
830
846
|
style: local.style,
|
|
831
847
|
defaultClassName: "solidaria-ColorArea-gradient",
|
|
@@ -895,7 +911,9 @@ export function ColorAreaThumb(props: ColorAreaThumbProps): JSX.Element {
|
|
|
895
911
|
|
|
896
912
|
const renderProps = useRenderProps(
|
|
897
913
|
{
|
|
898
|
-
children
|
|
914
|
+
get children() {
|
|
915
|
+
return props.children;
|
|
916
|
+
},
|
|
899
917
|
class: local.class,
|
|
900
918
|
style: local.style,
|
|
901
919
|
defaultClassName: "solidaria-ColorArea-thumb",
|
|
@@ -1144,7 +1162,9 @@ export function ColorWheel(props: ColorWheelProps): JSX.Element {
|
|
|
1144
1162
|
|
|
1145
1163
|
const renderProps = useRenderProps(
|
|
1146
1164
|
{
|
|
1147
|
-
children
|
|
1165
|
+
get children() {
|
|
1166
|
+
return props.children;
|
|
1167
|
+
},
|
|
1148
1168
|
class: local.class,
|
|
1149
1169
|
style: local.style,
|
|
1150
1170
|
defaultClassName: "solidaria-ColorWheel",
|
|
@@ -1211,7 +1231,9 @@ export function ColorWheelTrack(props: ColorWheelTrackProps): JSX.Element {
|
|
|
1211
1231
|
|
|
1212
1232
|
const renderProps = useRenderProps(
|
|
1213
1233
|
{
|
|
1214
|
-
children
|
|
1234
|
+
get children() {
|
|
1235
|
+
return props.children;
|
|
1236
|
+
},
|
|
1215
1237
|
class: local.class,
|
|
1216
1238
|
style: local.style,
|
|
1217
1239
|
defaultClassName: "solidaria-ColorWheel-track",
|
|
@@ -1281,7 +1303,9 @@ export function ColorWheelThumb(props: ColorWheelThumbProps): JSX.Element {
|
|
|
1281
1303
|
|
|
1282
1304
|
const renderProps = useRenderProps(
|
|
1283
1305
|
{
|
|
1284
|
-
children
|
|
1306
|
+
get children() {
|
|
1307
|
+
return props.children;
|
|
1308
|
+
},
|
|
1285
1309
|
class: local.class,
|
|
1286
1310
|
style: local.style,
|
|
1287
1311
|
defaultClassName: "solidaria-ColorWheel-thumb",
|
|
@@ -1548,7 +1572,9 @@ export function ColorField(props: ColorFieldProps): JSX.Element {
|
|
|
1548
1572
|
|
|
1549
1573
|
const renderProps = useRenderProps(
|
|
1550
1574
|
{
|
|
1551
|
-
children
|
|
1575
|
+
get children() {
|
|
1576
|
+
return props.children;
|
|
1577
|
+
},
|
|
1552
1578
|
class: local.class,
|
|
1553
1579
|
style: local.style,
|
|
1554
1580
|
defaultClassName: "solidaria-ColorField",
|
|
@@ -1677,7 +1703,9 @@ export function ColorFieldInput(props: ColorFieldInputProps): JSX.Element {
|
|
|
1677
1703
|
|
|
1678
1704
|
const renderProps = useRenderProps(
|
|
1679
1705
|
{
|
|
1680
|
-
children
|
|
1706
|
+
get children() {
|
|
1707
|
+
return props.children;
|
|
1708
|
+
},
|
|
1681
1709
|
class: local.class,
|
|
1682
1710
|
style: local.style,
|
|
1683
1711
|
defaultClassName: "solidaria-ColorField-input",
|
|
@@ -1790,7 +1818,9 @@ export function ColorSwatch(props: ColorSwatchProps): JSX.Element {
|
|
|
1790
1818
|
|
|
1791
1819
|
const renderProps = useRenderProps(
|
|
1792
1820
|
{
|
|
1793
|
-
children
|
|
1821
|
+
get children() {
|
|
1822
|
+
return props.children;
|
|
1823
|
+
},
|
|
1794
1824
|
class: local.class,
|
|
1795
1825
|
style: local.style,
|
|
1796
1826
|
defaultClassName: "solidaria-ColorSwatch",
|
|
@@ -1958,7 +1988,9 @@ export function ColorPicker(props: ColorPickerProps): JSX.Element {
|
|
|
1958
1988
|
|
|
1959
1989
|
const renderProps = useRenderProps(
|
|
1960
1990
|
{
|
|
1961
|
-
children
|
|
1991
|
+
get children() {
|
|
1992
|
+
return local.children;
|
|
1993
|
+
},
|
|
1962
1994
|
class: local.class,
|
|
1963
1995
|
style: local.style,
|
|
1964
1996
|
defaultClassName: "solidaria-ColorPicker",
|
|
@@ -2089,11 +2121,10 @@ export function ColorSwatchPicker(props: ColorSwatchPickerProps): JSX.Element {
|
|
|
2089
2121
|
() => ({
|
|
2090
2122
|
id: local.id,
|
|
2091
2123
|
"aria-label":
|
|
2092
|
-
local["aria-label"] ?? (!local["aria-labelledby"] ? "Color
|
|
2124
|
+
local["aria-label"] ?? (!local["aria-labelledby"] ? "Color swatches" : undefined),
|
|
2093
2125
|
"aria-labelledby": local["aria-labelledby"],
|
|
2094
2126
|
"aria-describedby": local["aria-describedby"],
|
|
2095
2127
|
"aria-details": local["aria-details"],
|
|
2096
|
-
shouldFocusWrap: true,
|
|
2097
2128
|
}),
|
|
2098
2129
|
state,
|
|
2099
2130
|
);
|
|
@@ -2221,32 +2252,28 @@ export function ColorSwatchPicker(props: ColorSwatchPickerProps): JSX.Element {
|
|
|
2221
2252
|
let nextKey: Key | null = null;
|
|
2222
2253
|
switch (e.key) {
|
|
2223
2254
|
case "ArrowDown":
|
|
2224
|
-
nextKey = getGridKeyBelow(listbox, initialKey)
|
|
2255
|
+
nextKey = getGridKeyBelow(listbox, initialKey);
|
|
2225
2256
|
break;
|
|
2226
2257
|
case "ArrowUp":
|
|
2227
|
-
nextKey = getGridKeyAbove(listbox, initialKey)
|
|
2258
|
+
nextKey = getGridKeyAbove(listbox, initialKey);
|
|
2228
2259
|
break;
|
|
2229
2260
|
case "ArrowRight":
|
|
2230
|
-
nextKey =
|
|
2231
|
-
getGridKeyRightOf(initialKey) ??
|
|
2232
|
-
(resolveDirection() === "rtl"
|
|
2233
|
-
? getBoundaryEnabledKey("prev")
|
|
2234
|
-
: getBoundaryEnabledKey("next"));
|
|
2261
|
+
nextKey = getGridKeyRightOf(initialKey);
|
|
2235
2262
|
break;
|
|
2236
2263
|
case "ArrowLeft":
|
|
2237
|
-
nextKey =
|
|
2238
|
-
getGridKeyLeftOf(initialKey) ??
|
|
2239
|
-
(resolveDirection() === "rtl"
|
|
2240
|
-
? getBoundaryEnabledKey("next")
|
|
2241
|
-
: getBoundaryEnabledKey("prev"));
|
|
2264
|
+
nextKey = getGridKeyLeftOf(initialKey);
|
|
2242
2265
|
break;
|
|
2243
2266
|
}
|
|
2244
2267
|
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2268
|
+
// Mirror react-aria's grid keyboard delegate: an arrow in grid layout is
|
|
2269
|
+
// always consumed (blocking the linear ListBox handler and page scroll),
|
|
2270
|
+
// but focus only moves when the delegate yields a next key. With
|
|
2271
|
+
// shouldFocusWrap unset (upstream default false) there is no wrap, so arrows
|
|
2272
|
+
// stop dead at the grid's edges. Selection is not mutated on arrow — under
|
|
2273
|
+
// the default 'toggle' selection behavior focus moves without selecting, and
|
|
2274
|
+
// Enter/Space commits (handled by createSelectableItem).
|
|
2275
|
+
if (nextKey != null) {
|
|
2276
|
+
state.setFocusedKey(nextKey);
|
|
2250
2277
|
}
|
|
2251
2278
|
|
|
2252
2279
|
e.preventDefault();
|
|
@@ -2266,12 +2293,18 @@ export function ColorSwatchPicker(props: ColorSwatchPickerProps): JSX.Element {
|
|
|
2266
2293
|
getListBoxKeyDown()?.(e);
|
|
2267
2294
|
};
|
|
2268
2295
|
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2296
|
+
// NB: we deliberately do NOT seed `state.setFocusedKey(selectedKey())` at rest.
|
|
2297
|
+
// Upstream's RAC `<ListBox>` (which `AriaColorSwatchPicker` is) keeps
|
|
2298
|
+
// `focusedKey == null` until the collection is focused — the listbox CONTAINER
|
|
2299
|
+
// is the roving tabstop (`tabIndex 0`), and `useSelectableCollection`'s onFocus
|
|
2300
|
+
// navigates to `firstSelectedKey` on entry (mirrored by `createListBox`'s
|
|
2301
|
+
// `onListBoxFocus`). Pre-seeding focusedKey to the selected swatch made the
|
|
2302
|
+
// selected option the rest tabstop instead (container `tabIndex -1`) — a
|
|
2303
|
+
// self-inflicted divergence — and, because our `createFocusWithin` only flips
|
|
2304
|
+
// `manager.setFocused(true)` on CONTAINER focus (Solid's `onFocus` is
|
|
2305
|
+
// non-bubbling), it also routed entry through a direct option focus that never
|
|
2306
|
+
// set `isFocused`, so arrow keys could not pull real DOM focus. Letting the
|
|
2307
|
+
// container be the tabstop restores both.
|
|
2275
2308
|
|
|
2276
2309
|
const { isFocused, isFocusVisible, focusProps } = createFocusRing({ within: true });
|
|
2277
2310
|
const domProps = createMemo(() =>
|
|
@@ -2361,13 +2394,20 @@ export function ColorSwatchPickerItem(props: ColorSwatchPickerItemProps): JSX.El
|
|
|
2361
2394
|
onCleanup(() => context.unregisterItem(itemKey));
|
|
2362
2395
|
});
|
|
2363
2396
|
|
|
2397
|
+
const [optionRef, setOptionRef] = createSignal<HTMLElement | null>(null);
|
|
2398
|
+
|
|
2364
2399
|
const optionAria = createOption(
|
|
2365
2400
|
() => ({
|
|
2366
2401
|
key: key(),
|
|
2367
2402
|
isDisabled: ariaProps.isDisabled,
|
|
2368
|
-
|
|
2403
|
+
// No aria-label: the option is named by its content (the child swatch's
|
|
2404
|
+
// role="img" aria-label), mirroring upstream ColorSwatchPickerItem which
|
|
2405
|
+
// sets only textValue (typeahead, threaded via registerItem above) and
|
|
2406
|
+
// never an aria-label.
|
|
2407
|
+
"aria-label": ariaProps["aria-label"],
|
|
2369
2408
|
}),
|
|
2370
2409
|
context.state,
|
|
2410
|
+
optionRef,
|
|
2371
2411
|
);
|
|
2372
2412
|
|
|
2373
2413
|
const renderValues = createMemo<ColorSwatchPickerItemRenderProps>(() => ({
|
|
@@ -2381,7 +2421,9 @@ export function ColorSwatchPickerItem(props: ColorSwatchPickerItemProps): JSX.El
|
|
|
2381
2421
|
|
|
2382
2422
|
const renderProps = useRenderProps(
|
|
2383
2423
|
{
|
|
2384
|
-
children
|
|
2424
|
+
get children() {
|
|
2425
|
+
return local.children;
|
|
2426
|
+
},
|
|
2385
2427
|
class: local.class,
|
|
2386
2428
|
style: local.style,
|
|
2387
2429
|
defaultClassName: "solidaria-ColorSwatchPickerItem",
|
|
@@ -2399,6 +2441,7 @@ export function ColorSwatchPickerItem(props: ColorSwatchPickerItemProps): JSX.El
|
|
|
2399
2441
|
|
|
2400
2442
|
return (
|
|
2401
2443
|
<div
|
|
2444
|
+
ref={setOptionRef}
|
|
2402
2445
|
{...mergeProps(domProps(), cleanOptionProps())}
|
|
2403
2446
|
class={renderProps.class()}
|
|
2404
2447
|
style={renderProps.style()}
|
package/src/ComboBox.tsx
CHANGED
|
@@ -8,9 +8,11 @@
|
|
|
8
8
|
import {
|
|
9
9
|
type JSX,
|
|
10
10
|
type Accessor,
|
|
11
|
+
type Context,
|
|
11
12
|
createContext,
|
|
12
13
|
createEffect,
|
|
13
14
|
createMemo,
|
|
15
|
+
createSignal,
|
|
14
16
|
onCleanup,
|
|
15
17
|
splitProps,
|
|
16
18
|
useContext,
|
|
@@ -24,7 +26,9 @@ import {
|
|
|
24
26
|
getComboBoxData,
|
|
25
27
|
createHover,
|
|
26
28
|
createInteractOutside,
|
|
29
|
+
createScrollIntoViewOnFocus,
|
|
27
30
|
mergeProps,
|
|
31
|
+
isFocusVisible as isGlobalFocusVisible,
|
|
28
32
|
type AriaComboBoxProps,
|
|
29
33
|
type AriaListBoxProps,
|
|
30
34
|
type AriaOptionProps,
|
|
@@ -45,7 +49,9 @@ import {
|
|
|
45
49
|
type SlotProps,
|
|
46
50
|
useRenderProps,
|
|
47
51
|
filterDOMProps,
|
|
52
|
+
Provider,
|
|
48
53
|
} from "./utils";
|
|
54
|
+
import { TextContext } from "./Text";
|
|
49
55
|
import {
|
|
50
56
|
SelectionIndicatorContext,
|
|
51
57
|
type SelectionIndicatorContextValue,
|
|
@@ -234,6 +240,8 @@ export interface ComboBoxValueProps extends SlotProps {
|
|
|
234
240
|
}
|
|
235
241
|
|
|
236
242
|
export interface ComboBoxButtonProps extends SlotProps {
|
|
243
|
+
/** A ref to the underlying button element. */
|
|
244
|
+
ref?: RefLike<HTMLButtonElement>;
|
|
237
245
|
/** The children of the button. */
|
|
238
246
|
children?: RenderChildren<ComboBoxButtonRenderProps>;
|
|
239
247
|
/** The CSS className for the element. */
|
|
@@ -273,6 +281,8 @@ export interface ComboBoxOptionRenderProps {
|
|
|
273
281
|
|
|
274
282
|
export interface ComboBoxOptionProps<T>
|
|
275
283
|
extends Omit<AriaOptionProps, "children" | "key">, SlotProps {
|
|
284
|
+
/** A ref to the underlying option element. */
|
|
285
|
+
ref?: RefLike<HTMLElement>;
|
|
276
286
|
/** The unique key for the option. */
|
|
277
287
|
id: Key;
|
|
278
288
|
/** The item value. */
|
|
@@ -561,6 +571,17 @@ export function ComboBox<T>(props: ComboBoxProps<T>): JSX.Element {
|
|
|
561
571
|
? (local.children as (values: ComboBoxRenderProps) => JSX.Element)(renderValues())
|
|
562
572
|
: local.children;
|
|
563
573
|
|
|
574
|
+
const textSlots = {
|
|
575
|
+
slots: {
|
|
576
|
+
get description() {
|
|
577
|
+
return comboBoxAria.descriptionProps;
|
|
578
|
+
},
|
|
579
|
+
get errorMessage() {
|
|
580
|
+
return comboBoxAria.errorMessageProps;
|
|
581
|
+
},
|
|
582
|
+
},
|
|
583
|
+
};
|
|
584
|
+
|
|
564
585
|
return (
|
|
565
586
|
<ComboBoxContext.Provider
|
|
566
587
|
value={
|
|
@@ -571,7 +592,12 @@ export function ComboBox<T>(props: ComboBoxProps<T>): JSX.Element {
|
|
|
571
592
|
buttonProps: () => comboBoxAria.buttonProps,
|
|
572
593
|
listBoxProps: () => ({
|
|
573
594
|
...comboBoxAria.listBoxProps,
|
|
574
|
-
onAction:
|
|
595
|
+
onAction: undefined,
|
|
596
|
+
shouldUseVirtualFocus: true,
|
|
597
|
+
shouldSelectOnPressUp: true,
|
|
598
|
+
shouldFocusOnHover: true,
|
|
599
|
+
linkBehavior: "selection",
|
|
600
|
+
UNSTABLE_itemBehavior: "action",
|
|
575
601
|
}),
|
|
576
602
|
labelProps: () => comboBoxAria.labelProps,
|
|
577
603
|
descriptionProps: () => comboBoxAria.descriptionProps,
|
|
@@ -637,7 +663,9 @@ export function ComboBox<T>(props: ComboBoxProps<T>): JSX.Element {
|
|
|
637
663
|
value={state.selectedKey()?.toString() ?? ""}
|
|
638
664
|
/>
|
|
639
665
|
</Show>
|
|
640
|
-
<
|
|
666
|
+
<Provider values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}>
|
|
667
|
+
<ComboBoxChildren />
|
|
668
|
+
</Provider>
|
|
641
669
|
</div>
|
|
642
670
|
</ComboBoxStateContext.Provider>
|
|
643
671
|
</ComboBoxContext.Provider>
|
|
@@ -683,10 +711,13 @@ export function ComboBoxDescription(props: ComboBoxDescriptionProps): JSX.Elemen
|
|
|
683
711
|
return rest;
|
|
684
712
|
};
|
|
685
713
|
|
|
714
|
+
// Upstream renders the description via `<Text slot="description">`, and RAC's
|
|
715
|
+
// `Text` defaults to `elementType="span"` (Text.tsx:24) — so the help text is a
|
|
716
|
+
// `<span>`, not a `<div>`. Match it (mirrors the TextField port's same revert).
|
|
686
717
|
return (
|
|
687
|
-
<
|
|
718
|
+
<span {...domProps} {...cleanDescriptionProps()} class={local.class} style={local.style}>
|
|
688
719
|
{local.children}
|
|
689
|
-
</
|
|
720
|
+
</span>
|
|
690
721
|
);
|
|
691
722
|
}
|
|
692
723
|
|
|
@@ -706,10 +737,12 @@ export function ComboBoxErrorMessage(props: ComboBoxErrorMessageProps): JSX.Elem
|
|
|
706
737
|
return rest;
|
|
707
738
|
};
|
|
708
739
|
|
|
740
|
+
// Same as the description: upstream's error is `<Text slot="errorMessage">`,
|
|
741
|
+
// a `<span>` (RAC Text default elementType). Match it.
|
|
709
742
|
return (
|
|
710
|
-
<
|
|
743
|
+
<span {...domProps} {...cleanErrorMessageProps()} class={local.class} style={local.style}>
|
|
711
744
|
{local.children}
|
|
712
|
-
</
|
|
745
|
+
</span>
|
|
713
746
|
);
|
|
714
747
|
}
|
|
715
748
|
|
|
@@ -742,7 +775,9 @@ export function ComboBoxInput(props: ComboBoxInputProps): JSX.Element {
|
|
|
742
775
|
|
|
743
776
|
const renderProps = useRenderProps(
|
|
744
777
|
{
|
|
745
|
-
children
|
|
778
|
+
get children() {
|
|
779
|
+
return local.children;
|
|
780
|
+
},
|
|
746
781
|
class: local.class,
|
|
747
782
|
style: local.style,
|
|
748
783
|
defaultClassName: "solidaria-ComboBox-input",
|
|
@@ -805,7 +840,9 @@ export function ComboBoxValue(props: ComboBoxValueProps): JSX.Element {
|
|
|
805
840
|
|
|
806
841
|
const renderProps = useRenderProps(
|
|
807
842
|
{
|
|
808
|
-
children
|
|
843
|
+
get children() {
|
|
844
|
+
return props.children;
|
|
845
|
+
},
|
|
809
846
|
class: props.class,
|
|
810
847
|
style: props.style,
|
|
811
848
|
defaultClassName: "solidaria-ComboBox-value",
|
|
@@ -838,7 +875,7 @@ export function ComboBoxValue(props: ComboBoxValueProps): JSX.Element {
|
|
|
838
875
|
* The trigger button for a combobox.
|
|
839
876
|
*/
|
|
840
877
|
export function ComboBoxButton(props: ComboBoxButtonProps): JSX.Element {
|
|
841
|
-
const [local, domProps] = splitProps(props, ["class", "style", "slot", "children"]);
|
|
878
|
+
const [local, domProps] = splitProps(props, ["class", "style", "slot", "children", "ref"]);
|
|
842
879
|
|
|
843
880
|
const context = useContext(ComboBoxContext);
|
|
844
881
|
if (!context) {
|
|
@@ -862,7 +899,9 @@ export function ComboBoxButton(props: ComboBoxButtonProps): JSX.Element {
|
|
|
862
899
|
|
|
863
900
|
const renderProps = useRenderProps(
|
|
864
901
|
{
|
|
865
|
-
children
|
|
902
|
+
get children() {
|
|
903
|
+
return local.children;
|
|
904
|
+
},
|
|
866
905
|
class: local.class,
|
|
867
906
|
style: local.style,
|
|
868
907
|
defaultClassName: "solidaria-ComboBox-button",
|
|
@@ -882,7 +921,10 @@ export function ComboBoxButton(props: ComboBoxButtonProps): JSX.Element {
|
|
|
882
921
|
return (
|
|
883
922
|
<button
|
|
884
923
|
{...domProps}
|
|
885
|
-
ref={(el) =>
|
|
924
|
+
ref={(el) => {
|
|
925
|
+
setButtonRef(el);
|
|
926
|
+
assignRef(local.ref, el);
|
|
927
|
+
}}
|
|
886
928
|
{...cleanButtonProps()}
|
|
887
929
|
{...cleanHoverProps()}
|
|
888
930
|
class={renderProps.class()}
|
|
@@ -912,7 +954,16 @@ export function ComboBoxListBox<T>(props: ComboBoxListBoxProps<T>): JSX.Element
|
|
|
912
954
|
const { state: comboBoxState, listState, isOpen, inputRef, buttonRef, setListBoxRef } = context;
|
|
913
955
|
const state = comboBoxState;
|
|
914
956
|
|
|
915
|
-
let listBoxRef:
|
|
957
|
+
let listBoxRef: HTMLElement | undefined;
|
|
958
|
+
|
|
959
|
+
// Reveal the activedescendant-focused option on keyboard navigation while the
|
|
960
|
+
// listbox is open. Real DOM focus stays on the input, so the browser won't
|
|
961
|
+
// natively scroll an off-screen focused option into view.
|
|
962
|
+
createScrollIntoViewOnFocus({
|
|
963
|
+
focusedKey: () => state.focusedKey(),
|
|
964
|
+
isActive: () => isOpen(),
|
|
965
|
+
ref: () => listBoxRef ?? null,
|
|
966
|
+
});
|
|
916
967
|
|
|
917
968
|
createInteractOutside({
|
|
918
969
|
ref: () => listBoxRef ?? null,
|
|
@@ -979,7 +1030,7 @@ export function ComboBoxListBox<T>(props: ComboBoxListBoxProps<T>): JSX.Element
|
|
|
979
1030
|
);
|
|
980
1031
|
};
|
|
981
1032
|
|
|
982
|
-
const setListBoxElement = (el:
|
|
1033
|
+
const setListBoxElement = (el: HTMLElement) => {
|
|
983
1034
|
listBoxRef = el;
|
|
984
1035
|
setListBoxRef(el);
|
|
985
1036
|
};
|
|
@@ -990,7 +1041,10 @@ export function ComboBoxListBox<T>(props: ComboBoxListBoxProps<T>): JSX.Element
|
|
|
990
1041
|
|
|
991
1042
|
return (
|
|
992
1043
|
<Show when={isOpen()}>
|
|
993
|
-
|
|
1044
|
+
{/* `<div role="listbox">`, not `<ul>` — upstream RAC ListBox (and our own
|
|
1045
|
+
Select/ListBox) render div-over-div rows; the `role` comes from the
|
|
1046
|
+
spread listbox aria props (createListBox), not the element tag. */}
|
|
1047
|
+
<div
|
|
994
1048
|
{...domProps}
|
|
995
1049
|
ref={setListBoxElement}
|
|
996
1050
|
{...cleanContextProps()}
|
|
@@ -1014,7 +1068,7 @@ export function ComboBoxListBox<T>(props: ComboBoxListBoxProps<T>): JSX.Element
|
|
|
1014
1068
|
}}
|
|
1015
1069
|
</For>
|
|
1016
1070
|
</Show>
|
|
1017
|
-
</
|
|
1071
|
+
</div>
|
|
1018
1072
|
</Show>
|
|
1019
1073
|
);
|
|
1020
1074
|
}
|
|
@@ -1031,6 +1085,7 @@ export function ComboBoxOption<T>(props: ComboBoxOptionProps<T>): JSX.Element {
|
|
|
1031
1085
|
"item",
|
|
1032
1086
|
"textValue",
|
|
1033
1087
|
"onAction",
|
|
1088
|
+
"ref",
|
|
1034
1089
|
]);
|
|
1035
1090
|
|
|
1036
1091
|
const stateContext = useContext(ComboBoxStateContext);
|
|
@@ -1040,6 +1095,7 @@ export function ComboBoxOption<T>(props: ComboBoxOptionProps<T>): JSX.Element {
|
|
|
1040
1095
|
}
|
|
1041
1096
|
const state = stateContext as ComboBoxState<T>;
|
|
1042
1097
|
const listState = (comboBoxContext as ComboBoxContextValue<T>).listState;
|
|
1098
|
+
const [ref, setRef] = createSignal<HTMLElement | null>(null);
|
|
1043
1099
|
const optionId = () => {
|
|
1044
1100
|
const listBoxId = getComboBoxData(state as ComboBoxState<unknown>)?.listBoxId;
|
|
1045
1101
|
return listBoxId ? `${listBoxId}-option-${local.id}` : String(local.id);
|
|
@@ -1084,11 +1140,22 @@ export function ComboBoxOption<T>(props: ComboBoxOptionProps<T>): JSX.Element {
|
|
|
1084
1140
|
},
|
|
1085
1141
|
},
|
|
1086
1142
|
listState,
|
|
1143
|
+
() => ref(),
|
|
1087
1144
|
);
|
|
1088
1145
|
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1146
|
+
// Mirror upstream `useOption` exactly (useOption.ts:172):
|
|
1147
|
+
// isFocusVisible = isFocused && selectionManager.isFocused && isFocusVisible()
|
|
1148
|
+
// where `isFocusVisible()` is the GLOBAL interaction-modality singleton read as
|
|
1149
|
+
// a render-time snapshot (NOT the input's focus ring, and NOT the option's own
|
|
1150
|
+
// createFocusRing — the option div never receives real DOM focus under virtual
|
|
1151
|
+
// focus, so its ring never lights). `optionAria.isFocused()` already folds in
|
|
1152
|
+
// `selectionManager.isFocused()` (createSelectableItem.ts:239), so the upstream
|
|
1153
|
+
// three-term product collapses to these two. Reading the global singleton off
|
|
1154
|
+
// the `isFocused` dependency gives the same non-reactive snapshot semantics as
|
|
1155
|
+
// React (mouse/hover focus → pointer modality → no ring; keyboard nav → keyboard
|
|
1156
|
+
// modality → ring), which the earlier input-ring OR-branch got wrong (it lit the
|
|
1157
|
+
// option ring whenever the input ring was on).
|
|
1158
|
+
const isOptionFocusVisible = () => optionAria.isFocused() && isGlobalFocusVisible();
|
|
1092
1159
|
|
|
1093
1160
|
const renderValues = createMemo<ComboBoxOptionRenderProps>(() => ({
|
|
1094
1161
|
isSelected: optionAria.isSelected(),
|
|
@@ -1101,7 +1168,9 @@ export function ComboBoxOption<T>(props: ComboBoxOptionProps<T>): JSX.Element {
|
|
|
1101
1168
|
|
|
1102
1169
|
const renderProps = useRenderProps(
|
|
1103
1170
|
{
|
|
1104
|
-
children
|
|
1171
|
+
get children() {
|
|
1172
|
+
return props.children;
|
|
1173
|
+
},
|
|
1105
1174
|
class: local.class,
|
|
1106
1175
|
style: local.style,
|
|
1107
1176
|
defaultClassName: "solidaria-ComboBox-option",
|
|
@@ -1120,7 +1189,13 @@ export function ComboBoxOption<T>(props: ComboBoxOptionProps<T>): JSX.Element {
|
|
|
1120
1189
|
|
|
1121
1190
|
return (
|
|
1122
1191
|
<SelectionIndicatorContext.Provider value={selectionIndicatorContext()}>
|
|
1123
|
-
|
|
1192
|
+
{/* `<div role="option">`, not `<li>` — see the ComboBoxListBox note; the
|
|
1193
|
+
`role` comes from the spread option aria props (createOption). */}
|
|
1194
|
+
<div
|
|
1195
|
+
ref={(el) => {
|
|
1196
|
+
setRef(el);
|
|
1197
|
+
assignRef(local.ref, el);
|
|
1198
|
+
}}
|
|
1124
1199
|
{...cleanOptionProps()}
|
|
1125
1200
|
class={renderProps.class()}
|
|
1126
1201
|
style={renderProps.style()}
|
|
@@ -1132,7 +1207,7 @@ export function ComboBoxOption<T>(props: ComboBoxOptionProps<T>): JSX.Element {
|
|
|
1132
1207
|
data-disabled={optionAria.isDisabled() || undefined}
|
|
1133
1208
|
>
|
|
1134
1209
|
{renderProps.renderChildren()}
|
|
1135
|
-
</
|
|
1210
|
+
</div>
|
|
1136
1211
|
</SelectionIndicatorContext.Provider>
|
|
1137
1212
|
);
|
|
1138
1213
|
}
|
|
@@ -1260,6 +1335,7 @@ function createComboBoxListStateAdapter<T>(state: ComboBoxState<T>): ListState<T
|
|
|
1260
1335
|
|
|
1261
1336
|
return {
|
|
1262
1337
|
collection: state.collection,
|
|
1338
|
+
selectionManager: state.selectionManager,
|
|
1263
1339
|
isFocused: state.isFocused,
|
|
1264
1340
|
setFocused: state.setFocused,
|
|
1265
1341
|
focusedKey: state.focusedKey,
|