@proyecto-viviana/solidaria 0.1.3 → 0.2.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/index.d.ts +6135 -50
- package/dist/index.js +485 -1120
- package/dist/{index.ssr.js → index.jsx} +89 -143
- package/package.json +7 -9
- package/dist/autocomplete/createAutocomplete.d.ts +0 -109
- package/dist/autocomplete/createAutocomplete.d.ts.map +0 -1
- package/dist/autocomplete/index.d.ts +0 -2
- package/dist/autocomplete/index.d.ts.map +0 -1
- package/dist/breadcrumbs/createBreadcrumbs.d.ts +0 -43
- package/dist/breadcrumbs/createBreadcrumbs.d.ts.map +0 -1
- package/dist/breadcrumbs/index.d.ts +0 -2
- package/dist/breadcrumbs/index.d.ts.map +0 -1
- package/dist/button/createButton.d.ts +0 -29
- package/dist/button/createButton.d.ts.map +0 -1
- package/dist/button/createToggleButton.d.ts +0 -41
- package/dist/button/createToggleButton.d.ts.map +0 -1
- package/dist/button/index.d.ts +0 -5
- package/dist/button/index.d.ts.map +0 -1
- package/dist/button/types.d.ts +0 -77
- package/dist/button/types.d.ts.map +0 -1
- package/dist/calendar/createCalendar.d.ts +0 -41
- package/dist/calendar/createCalendar.d.ts.map +0 -1
- package/dist/calendar/createCalendarCell.d.ts +0 -41
- package/dist/calendar/createCalendarCell.d.ts.map +0 -1
- package/dist/calendar/createCalendarGrid.d.ts +0 -29
- package/dist/calendar/createCalendarGrid.d.ts.map +0 -1
- package/dist/calendar/createRangeCalendar.d.ts +0 -39
- package/dist/calendar/createRangeCalendar.d.ts.map +0 -1
- package/dist/calendar/createRangeCalendarCell.d.ts +0 -45
- package/dist/calendar/createRangeCalendarCell.d.ts.map +0 -1
- package/dist/calendar/index.d.ts +0 -6
- package/dist/calendar/index.d.ts.map +0 -1
- package/dist/checkbox/createCheckbox.d.ts +0 -56
- package/dist/checkbox/createCheckbox.d.ts.map +0 -1
- package/dist/checkbox/createCheckboxGroup.d.ts +0 -53
- package/dist/checkbox/createCheckboxGroup.d.ts.map +0 -1
- package/dist/checkbox/createCheckboxGroupItem.d.ts +0 -25
- package/dist/checkbox/createCheckboxGroupItem.d.ts.map +0 -1
- package/dist/checkbox/createCheckboxGroupState.d.ts +0 -71
- package/dist/checkbox/createCheckboxGroupState.d.ts.map +0 -1
- package/dist/checkbox/index.d.ts +0 -9
- package/dist/checkbox/index.d.ts.map +0 -1
- package/dist/color/createColorArea.d.ts +0 -13
- package/dist/color/createColorArea.d.ts.map +0 -1
- package/dist/color/createColorField.d.ts +0 -13
- package/dist/color/createColorField.d.ts.map +0 -1
- package/dist/color/createColorSlider.d.ts +0 -13
- package/dist/color/createColorSlider.d.ts.map +0 -1
- package/dist/color/createColorSwatch.d.ts +0 -12
- package/dist/color/createColorSwatch.d.ts.map +0 -1
- package/dist/color/createColorWheel.d.ts +0 -13
- package/dist/color/createColorWheel.d.ts.map +0 -1
- package/dist/color/index.d.ts +0 -10
- package/dist/color/index.d.ts.map +0 -1
- package/dist/color/types.d.ts +0 -106
- package/dist/color/types.d.ts.map +0 -1
- package/dist/combobox/createComboBox.d.ts +0 -77
- package/dist/combobox/createComboBox.d.ts.map +0 -1
- package/dist/combobox/index.d.ts +0 -2
- package/dist/combobox/index.d.ts.map +0 -1
- package/dist/combobox/intl/index.d.ts +0 -14
- package/dist/combobox/intl/index.d.ts.map +0 -1
- package/dist/datepicker/createDateField.d.ts +0 -51
- package/dist/datepicker/createDateField.d.ts.map +0 -1
- package/dist/datepicker/createDatePicker.d.ts +0 -65
- package/dist/datepicker/createDatePicker.d.ts.map +0 -1
- package/dist/datepicker/createDateSegment.d.ts +0 -29
- package/dist/datepicker/createDateSegment.d.ts.map +0 -1
- package/dist/datepicker/createTimeField.d.ts +0 -51
- package/dist/datepicker/createTimeField.d.ts.map +0 -1
- package/dist/datepicker/index.d.ts +0 -5
- package/dist/datepicker/index.d.ts.map +0 -1
- package/dist/dialog/createDialog.d.ts +0 -25
- package/dist/dialog/createDialog.d.ts.map +0 -1
- package/dist/dialog/index.d.ts +0 -3
- package/dist/dialog/index.d.ts.map +0 -1
- package/dist/dialog/types.d.ts +0 -18
- package/dist/dialog/types.d.ts.map +0 -1
- package/dist/disclosure/createDisclosure.d.ts +0 -52
- package/dist/disclosure/createDisclosure.d.ts.map +0 -1
- package/dist/disclosure/createDisclosureGroup.d.ts +0 -39
- package/dist/disclosure/createDisclosureGroup.d.ts.map +0 -1
- package/dist/disclosure/index.d.ts +0 -3
- package/dist/disclosure/index.d.ts.map +0 -1
- package/dist/dnd/createDrag.d.ts +0 -16
- package/dist/dnd/createDrag.d.ts.map +0 -1
- package/dist/dnd/createDraggableCollection.d.ts +0 -27
- package/dist/dnd/createDraggableCollection.d.ts.map +0 -1
- package/dist/dnd/createDraggableItem.d.ts +0 -37
- package/dist/dnd/createDraggableItem.d.ts.map +0 -1
- package/dist/dnd/createDrop.d.ts +0 -16
- package/dist/dnd/createDrop.d.ts.map +0 -1
- package/dist/dnd/createDroppableCollection.d.ts +0 -76
- package/dist/dnd/createDroppableCollection.d.ts.map +0 -1
- package/dist/dnd/createDroppableItem.d.ts +0 -31
- package/dist/dnd/createDroppableItem.d.ts.map +0 -1
- package/dist/dnd/index.d.ts +0 -18
- package/dist/dnd/index.d.ts.map +0 -1
- package/dist/dnd/types.d.ts +0 -66
- package/dist/dnd/types.d.ts.map +0 -1
- package/dist/dnd/utils.d.ts +0 -57
- package/dist/dnd/utils.d.ts.map +0 -1
- package/dist/focus/FocusScope.d.ts +0 -57
- package/dist/focus/FocusScope.d.ts.map +0 -1
- package/dist/focus/createAutoFocus.d.ts +0 -120
- package/dist/focus/createAutoFocus.d.ts.map +0 -1
- package/dist/focus/createFocusRestore.d.ts +0 -116
- package/dist/focus/createFocusRestore.d.ts.map +0 -1
- package/dist/focus/createVirtualFocus.d.ts +0 -170
- package/dist/focus/createVirtualFocus.d.ts.map +0 -1
- package/dist/focus/index.d.ts +0 -5
- package/dist/focus/index.d.ts.map +0 -1
- package/dist/form/createFormReset.d.ts +0 -27
- package/dist/form/createFormReset.d.ts.map +0 -1
- package/dist/form/createFormValidation.d.ts +0 -56
- package/dist/form/createFormValidation.d.ts.map +0 -1
- package/dist/form/index.d.ts +0 -3
- package/dist/form/index.d.ts.map +0 -1
- package/dist/grid/GridKeyboardDelegate.d.ts +0 -79
- package/dist/grid/GridKeyboardDelegate.d.ts.map +0 -1
- package/dist/grid/createGrid.d.ts +0 -24
- package/dist/grid/createGrid.d.ts.map +0 -1
- package/dist/grid/createGridCell.d.ts +0 -12
- package/dist/grid/createGridCell.d.ts.map +0 -1
- package/dist/grid/createGridRow.d.ts +0 -12
- package/dist/grid/createGridRow.d.ts.map +0 -1
- package/dist/grid/index.d.ts +0 -10
- package/dist/grid/index.d.ts.map +0 -1
- package/dist/grid/types.d.ts +0 -126
- package/dist/grid/types.d.ts.map +0 -1
- package/dist/gridlist/createGridList.d.ts +0 -28
- package/dist/gridlist/createGridList.d.ts.map +0 -1
- package/dist/gridlist/createGridListItem.d.ts +0 -12
- package/dist/gridlist/createGridListItem.d.ts.map +0 -1
- package/dist/gridlist/createGridListSelectionCheckbox.d.ts +0 -12
- package/dist/gridlist/createGridListSelectionCheckbox.d.ts.map +0 -1
- package/dist/gridlist/index.d.ts +0 -8
- package/dist/gridlist/index.d.ts.map +0 -1
- package/dist/gridlist/types.d.ts +0 -75
- package/dist/gridlist/types.d.ts.map +0 -1
- package/dist/i18n/NumberFormatter.d.ts +0 -43
- package/dist/i18n/NumberFormatter.d.ts.map +0 -1
- package/dist/i18n/createCollator.d.ts +0 -41
- package/dist/i18n/createCollator.d.ts.map +0 -1
- package/dist/i18n/createDateFormatter.d.ts +0 -45
- package/dist/i18n/createDateFormatter.d.ts.map +0 -1
- package/dist/i18n/createFilter.d.ts +0 -57
- package/dist/i18n/createFilter.d.ts.map +0 -1
- package/dist/i18n/createNumberFormatter.d.ts +0 -43
- package/dist/i18n/createNumberFormatter.d.ts.map +0 -1
- package/dist/i18n/createStringFormatter.d.ts +0 -42
- package/dist/i18n/createStringFormatter.d.ts.map +0 -1
- package/dist/i18n/index.d.ts +0 -9
- package/dist/i18n/index.d.ts.map +0 -1
- package/dist/i18n/locale.d.ts +0 -66
- package/dist/i18n/locale.d.ts.map +0 -1
- package/dist/i18n/utils.d.ts +0 -17
- package/dist/i18n/utils.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -7
- package/dist/index.ssr.js.map +0 -7
- package/dist/interactions/FocusableProvider.d.ts +0 -26
- package/dist/interactions/FocusableProvider.d.ts.map +0 -1
- package/dist/interactions/PressEvent.d.ts +0 -73
- package/dist/interactions/PressEvent.d.ts.map +0 -1
- package/dist/interactions/createFocus.d.ts +0 -31
- package/dist/interactions/createFocus.d.ts.map +0 -1
- package/dist/interactions/createFocusRing.d.ts +0 -37
- package/dist/interactions/createFocusRing.d.ts.map +0 -1
- package/dist/interactions/createFocusWithin.d.ts +0 -27
- package/dist/interactions/createFocusWithin.d.ts.map +0 -1
- package/dist/interactions/createFocusable.d.ts +0 -65
- package/dist/interactions/createFocusable.d.ts.map +0 -1
- package/dist/interactions/createHover.d.ts +0 -43
- package/dist/interactions/createHover.d.ts.map +0 -1
- package/dist/interactions/createInteractionModality.d.ts +0 -73
- package/dist/interactions/createInteractionModality.d.ts.map +0 -1
- package/dist/interactions/createKeyboard.d.ts +0 -35
- package/dist/interactions/createKeyboard.d.ts.map +0 -1
- package/dist/interactions/createLongPress.d.ts +0 -63
- package/dist/interactions/createLongPress.d.ts.map +0 -1
- package/dist/interactions/createMove.d.ts +0 -40
- package/dist/interactions/createMove.d.ts.map +0 -1
- package/dist/interactions/createPress.d.ts +0 -55
- package/dist/interactions/createPress.d.ts.map +0 -1
- package/dist/interactions/index.d.ts +0 -13
- package/dist/interactions/index.d.ts.map +0 -1
- package/dist/label/createField.d.ts +0 -51
- package/dist/label/createField.d.ts.map +0 -1
- package/dist/label/createLabel.d.ts +0 -49
- package/dist/label/createLabel.d.ts.map +0 -1
- package/dist/label/createLabels.d.ts +0 -16
- package/dist/label/createLabels.d.ts.map +0 -1
- package/dist/label/index.d.ts +0 -6
- package/dist/label/index.d.ts.map +0 -1
- package/dist/landmark/createLandmark.d.ts +0 -79
- package/dist/landmark/createLandmark.d.ts.map +0 -1
- package/dist/landmark/index.d.ts +0 -2
- package/dist/landmark/index.d.ts.map +0 -1
- package/dist/link/createLink.d.ts +0 -65
- package/dist/link/createLink.d.ts.map +0 -1
- package/dist/link/index.d.ts +0 -2
- package/dist/link/index.d.ts.map +0 -1
- package/dist/listbox/createListBox.d.ts +0 -58
- package/dist/listbox/createListBox.d.ts.map +0 -1
- package/dist/listbox/createOption.d.ts +0 -42
- package/dist/listbox/createOption.d.ts.map +0 -1
- package/dist/listbox/index.d.ts +0 -3
- package/dist/listbox/index.d.ts.map +0 -1
- package/dist/live-announcer/announce.d.ts +0 -113
- package/dist/live-announcer/announce.d.ts.map +0 -1
- package/dist/live-announcer/index.d.ts +0 -2
- package/dist/live-announcer/index.d.ts.map +0 -1
- package/dist/menu/createMenu.d.ts +0 -57
- package/dist/menu/createMenu.d.ts.map +0 -1
- package/dist/menu/createMenuItem.d.ts +0 -42
- package/dist/menu/createMenuItem.d.ts.map +0 -1
- package/dist/menu/createMenuTrigger.d.ts +0 -29
- package/dist/menu/createMenuTrigger.d.ts.map +0 -1
- package/dist/menu/index.d.ts +0 -4
- package/dist/menu/index.d.ts.map +0 -1
- package/dist/meter/createMeter.d.ts +0 -44
- package/dist/meter/createMeter.d.ts.map +0 -1
- package/dist/meter/index.d.ts +0 -2
- package/dist/meter/index.d.ts.map +0 -1
- package/dist/numberfield/createNumberField.d.ts +0 -56
- package/dist/numberfield/createNumberField.d.ts.map +0 -1
- package/dist/numberfield/index.d.ts +0 -2
- package/dist/numberfield/index.d.ts.map +0 -1
- package/dist/overlays/ariaHideOutside.d.ts +0 -25
- package/dist/overlays/ariaHideOutside.d.ts.map +0 -1
- package/dist/overlays/createInteractOutside.d.ts +0 -20
- package/dist/overlays/createInteractOutside.d.ts.map +0 -1
- package/dist/overlays/createModal.d.ts +0 -70
- package/dist/overlays/createModal.d.ts.map +0 -1
- package/dist/overlays/createOverlay.d.ts +0 -43
- package/dist/overlays/createOverlay.d.ts.map +0 -1
- package/dist/overlays/createOverlayTrigger.d.ts +0 -30
- package/dist/overlays/createOverlayTrigger.d.ts.map +0 -1
- package/dist/overlays/createPreventScroll.d.ts +0 -15
- package/dist/overlays/createPreventScroll.d.ts.map +0 -1
- package/dist/overlays/index.d.ts +0 -7
- package/dist/overlays/index.d.ts.map +0 -1
- package/dist/popover/calculatePosition.d.ts +0 -67
- package/dist/popover/calculatePosition.d.ts.map +0 -1
- package/dist/popover/createOverlayPosition.d.ts +0 -109
- package/dist/popover/createOverlayPosition.d.ts.map +0 -1
- package/dist/popover/createPopover.d.ts +0 -88
- package/dist/popover/createPopover.d.ts.map +0 -1
- package/dist/popover/index.d.ts +0 -4
- package/dist/popover/index.d.ts.map +0 -1
- package/dist/progress/createProgressBar.d.ts +0 -47
- package/dist/progress/createProgressBar.d.ts.map +0 -1
- package/dist/progress/index.d.ts +0 -2
- package/dist/progress/index.d.ts.map +0 -1
- package/dist/radio/createRadio.d.ts +0 -68
- package/dist/radio/createRadio.d.ts.map +0 -1
- package/dist/radio/createRadioGroup.d.ts +0 -85
- package/dist/radio/createRadioGroup.d.ts.map +0 -1
- package/dist/radio/createRadioGroupState.d.ts +0 -77
- package/dist/radio/createRadioGroupState.d.ts.map +0 -1
- package/dist/radio/index.d.ts +0 -4
- package/dist/radio/index.d.ts.map +0 -1
- package/dist/searchfield/createSearchField.d.ts +0 -32
- package/dist/searchfield/createSearchField.d.ts.map +0 -1
- package/dist/searchfield/index.d.ts +0 -3
- package/dist/searchfield/index.d.ts.map +0 -1
- package/dist/select/createHiddenSelect.d.ts +0 -69
- package/dist/select/createHiddenSelect.d.ts.map +0 -1
- package/dist/select/createSelect.d.ts +0 -70
- package/dist/select/createSelect.d.ts.map +0 -1
- package/dist/select/index.d.ts +0 -3
- package/dist/select/index.d.ts.map +0 -1
- package/dist/selection/createTypeSelect.d.ts +0 -43
- package/dist/selection/createTypeSelect.d.ts.map +0 -1
- package/dist/selection/index.d.ts +0 -6
- package/dist/selection/index.d.ts.map +0 -1
- package/dist/separator/createSeparator.d.ts +0 -38
- package/dist/separator/createSeparator.d.ts.map +0 -1
- package/dist/separator/index.d.ts +0 -2
- package/dist/separator/index.d.ts.map +0 -1
- package/dist/slider/createSlider.d.ts +0 -43
- package/dist/slider/createSlider.d.ts.map +0 -1
- package/dist/slider/index.d.ts +0 -3
- package/dist/slider/index.d.ts.map +0 -1
- package/dist/ssr/index.d.ts +0 -221
- package/dist/ssr/index.d.ts.map +0 -1
- package/dist/switch/createSwitch.d.ts +0 -34
- package/dist/switch/createSwitch.d.ts.map +0 -1
- package/dist/switch/index.d.ts +0 -2
- package/dist/switch/index.d.ts.map +0 -1
- package/dist/table/createTable.d.ts +0 -24
- package/dist/table/createTable.d.ts.map +0 -1
- package/dist/table/createTableCell.d.ts +0 -12
- package/dist/table/createTableCell.d.ts.map +0 -1
- package/dist/table/createTableColumnHeader.d.ts +0 -12
- package/dist/table/createTableColumnHeader.d.ts.map +0 -1
- package/dist/table/createTableHeaderRow.d.ts +0 -12
- package/dist/table/createTableHeaderRow.d.ts.map +0 -1
- package/dist/table/createTableRow.d.ts +0 -12
- package/dist/table/createTableRow.d.ts.map +0 -1
- package/dist/table/createTableRowGroup.d.ts +0 -11
- package/dist/table/createTableRowGroup.d.ts.map +0 -1
- package/dist/table/createTableSelectAllCheckbox.d.ts +0 -12
- package/dist/table/createTableSelectAllCheckbox.d.ts.map +0 -1
- package/dist/table/createTableSelectionCheckbox.d.ts +0 -12
- package/dist/table/createTableSelectionCheckbox.d.ts.map +0 -1
- package/dist/table/index.d.ts +0 -14
- package/dist/table/index.d.ts.map +0 -1
- package/dist/table/types.d.ts +0 -150
- package/dist/table/types.d.ts.map +0 -1
- package/dist/tabs/createTabs.d.ts +0 -123
- package/dist/tabs/createTabs.d.ts.map +0 -1
- package/dist/tabs/index.d.ts +0 -2
- package/dist/tabs/index.d.ts.map +0 -1
- package/dist/tag/createTag.d.ts +0 -42
- package/dist/tag/createTag.d.ts.map +0 -1
- package/dist/tag/createTagGroup.d.ts +0 -54
- package/dist/tag/createTagGroup.d.ts.map +0 -1
- package/dist/tag/index.d.ts +0 -3
- package/dist/tag/index.d.ts.map +0 -1
- package/dist/textfield/createTextField.d.ts +0 -73
- package/dist/textfield/createTextField.d.ts.map +0 -1
- package/dist/textfield/index.d.ts +0 -2
- package/dist/textfield/index.d.ts.map +0 -1
- package/dist/toast/createToast.d.ts +0 -58
- package/dist/toast/createToast.d.ts.map +0 -1
- package/dist/toast/createToastRegion.d.ts +0 -49
- package/dist/toast/createToastRegion.d.ts.map +0 -1
- package/dist/toast/index.d.ts +0 -3
- package/dist/toast/index.d.ts.map +0 -1
- package/dist/toggle/createToggle.d.ts +0 -94
- package/dist/toggle/createToggle.d.ts.map +0 -1
- package/dist/toggle/createToggleState.d.ts +0 -34
- package/dist/toggle/createToggleState.d.ts.map +0 -1
- package/dist/toggle/index.d.ts +0 -5
- package/dist/toggle/index.d.ts.map +0 -1
- package/dist/toolbar/createToolbar.d.ts +0 -49
- package/dist/toolbar/createToolbar.d.ts.map +0 -1
- package/dist/toolbar/index.d.ts +0 -2
- package/dist/toolbar/index.d.ts.map +0 -1
- package/dist/tooltip/createTooltip.d.ts +0 -48
- package/dist/tooltip/createTooltip.d.ts.map +0 -1
- package/dist/tooltip/createTooltipTrigger.d.ts +0 -64
- package/dist/tooltip/createTooltipTrigger.d.ts.map +0 -1
- package/dist/tooltip/index.d.ts +0 -3
- package/dist/tooltip/index.d.ts.map +0 -1
- package/dist/tree/createTree.d.ts +0 -28
- package/dist/tree/createTree.d.ts.map +0 -1
- package/dist/tree/createTreeItem.d.ts +0 -12
- package/dist/tree/createTreeItem.d.ts.map +0 -1
- package/dist/tree/createTreeSelectionCheckbox.d.ts +0 -12
- package/dist/tree/createTreeSelectionCheckbox.d.ts.map +0 -1
- package/dist/tree/index.d.ts +0 -8
- package/dist/tree/index.d.ts.map +0 -1
- package/dist/tree/types.d.ts +0 -81
- package/dist/tree/types.d.ts.map +0 -1
- package/dist/utils/createDescription.d.ts +0 -56
- package/dist/utils/createDescription.d.ts.map +0 -1
- package/dist/utils/dom.d.ts +0 -68
- package/dist/utils/dom.d.ts.map +0 -1
- package/dist/utils/env.d.ts +0 -18
- package/dist/utils/env.d.ts.map +0 -1
- package/dist/utils/events.d.ts +0 -29
- package/dist/utils/events.d.ts.map +0 -1
- package/dist/utils/filterDOMProps.d.ts +0 -29
- package/dist/utils/filterDOMProps.d.ts.map +0 -1
- package/dist/utils/focus.d.ts +0 -20
- package/dist/utils/focus.d.ts.map +0 -1
- package/dist/utils/geometry.d.ts +0 -40
- package/dist/utils/geometry.d.ts.map +0 -1
- package/dist/utils/globalListeners.d.ts +0 -36
- package/dist/utils/globalListeners.d.ts.map +0 -1
- package/dist/utils/index.d.ts +0 -13
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/mergeProps.d.ts +0 -11
- package/dist/utils/mergeProps.d.ts.map +0 -1
- package/dist/utils/platform.d.ts +0 -14
- package/dist/utils/platform.d.ts.map +0 -1
- package/dist/utils/reactivity.d.ts +0 -28
- package/dist/utils/reactivity.d.ts.map +0 -1
- package/dist/utils/textSelection.d.ts +0 -19
- package/dist/utils/textSelection.d.ts.map +0 -1
- package/dist/visually-hidden/createVisuallyHidden.d.ts +0 -60
- package/dist/visually-hidden/createVisuallyHidden.d.ts.map +0 -1
- package/dist/visually-hidden/index.d.ts +0 -2
- package/dist/visually-hidden/index.d.ts.map +0 -1
- package/src/autocomplete/createAutocomplete.ts +0 -341
- package/src/autocomplete/index.ts +0 -9
- package/src/breadcrumbs/createBreadcrumbs.ts +0 -196
- package/src/breadcrumbs/index.ts +0 -8
- package/src/button/createButton.ts +0 -142
- package/src/button/createToggleButton.ts +0 -101
- package/src/button/index.ts +0 -4
- package/src/button/types.ts +0 -78
- package/src/calendar/createCalendar.ts +0 -138
- package/src/calendar/createCalendarCell.ts +0 -187
- package/src/calendar/createCalendarGrid.ts +0 -140
- package/src/calendar/createRangeCalendar.ts +0 -136
- package/src/calendar/createRangeCalendarCell.ts +0 -186
- package/src/calendar/index.ts +0 -34
- package/src/checkbox/createCheckbox.ts +0 -135
- package/src/checkbox/createCheckboxGroup.ts +0 -137
- package/src/checkbox/createCheckboxGroupItem.ts +0 -117
- package/src/checkbox/createCheckboxGroupState.ts +0 -193
- package/src/checkbox/index.ts +0 -13
- package/src/color/createColorArea.ts +0 -314
- package/src/color/createColorField.ts +0 -137
- package/src/color/createColorSlider.ts +0 -197
- package/src/color/createColorSwatch.ts +0 -40
- package/src/color/createColorWheel.ts +0 -208
- package/src/color/index.ts +0 -24
- package/src/color/types.ts +0 -116
- package/src/combobox/createComboBox.ts +0 -647
- package/src/combobox/index.ts +0 -6
- package/src/combobox/intl/en-US.json +0 -7
- package/src/combobox/intl/es-ES.json +0 -7
- package/src/combobox/intl/index.ts +0 -23
- package/src/datepicker/createDateField.ts +0 -154
- package/src/datepicker/createDatePicker.ts +0 -206
- package/src/datepicker/createDateSegment.ts +0 -229
- package/src/datepicker/createTimeField.ts +0 -154
- package/src/datepicker/index.ts +0 -28
- package/src/dialog/createDialog.ts +0 -120
- package/src/dialog/index.ts +0 -2
- package/src/dialog/types.ts +0 -19
- package/src/disclosure/createDisclosure.ts +0 -131
- package/src/disclosure/createDisclosureGroup.ts +0 -62
- package/src/disclosure/index.ts +0 -11
- package/src/dnd/createDrag.ts +0 -209
- package/src/dnd/createDraggableCollection.ts +0 -63
- package/src/dnd/createDraggableItem.ts +0 -243
- package/src/dnd/createDrop.ts +0 -321
- package/src/dnd/createDroppableCollection.ts +0 -293
- package/src/dnd/createDroppableItem.ts +0 -213
- package/src/dnd/index.ts +0 -47
- package/src/dnd/types.ts +0 -89
- package/src/dnd/utils.ts +0 -294
- package/src/focus/FocusScope.tsx +0 -408
- package/src/focus/createAutoFocus.ts +0 -321
- package/src/focus/createFocusRestore.ts +0 -313
- package/src/focus/createVirtualFocus.ts +0 -396
- package/src/focus/index.ts +0 -35
- package/src/form/createFormReset.ts +0 -51
- package/src/form/createFormValidation.ts +0 -224
- package/src/form/index.ts +0 -11
- package/src/grid/GridKeyboardDelegate.ts +0 -429
- package/src/grid/createGrid.ts +0 -261
- package/src/grid/createGridCell.ts +0 -182
- package/src/grid/createGridRow.ts +0 -153
- package/src/grid/index.ts +0 -18
- package/src/grid/types.ts +0 -133
- package/src/gridlist/createGridList.ts +0 -185
- package/src/gridlist/createGridListItem.ts +0 -180
- package/src/gridlist/createGridListSelectionCheckbox.ts +0 -59
- package/src/gridlist/index.ts +0 -16
- package/src/gridlist/types.ts +0 -81
- package/src/i18n/NumberFormatter.ts +0 -266
- package/src/i18n/createCollator.ts +0 -79
- package/src/i18n/createDateFormatter.ts +0 -83
- package/src/i18n/createFilter.ts +0 -131
- package/src/i18n/createNumberFormatter.ts +0 -52
- package/src/i18n/createStringFormatter.ts +0 -87
- package/src/i18n/index.ts +0 -40
- package/src/i18n/locale.tsx +0 -188
- package/src/i18n/utils.ts +0 -99
- package/src/index.ts +0 -670
- package/src/interactions/FocusableProvider.tsx +0 -44
- package/src/interactions/PressEvent.ts +0 -124
- package/src/interactions/createFocus.ts +0 -163
- package/src/interactions/createFocusRing.ts +0 -89
- package/src/interactions/createFocusWithin.ts +0 -206
- package/src/interactions/createFocusable.ts +0 -168
- package/src/interactions/createHover.ts +0 -254
- package/src/interactions/createInteractionModality.ts +0 -424
- package/src/interactions/createKeyboard.ts +0 -82
- package/src/interactions/createLongPress.ts +0 -174
- package/src/interactions/createMove.ts +0 -289
- package/src/interactions/createPress.ts +0 -834
- package/src/interactions/index.ts +0 -78
- package/src/label/createField.ts +0 -145
- package/src/label/createLabel.ts +0 -117
- package/src/label/createLabels.ts +0 -50
- package/src/label/index.ts +0 -19
- package/src/landmark/createLandmark.ts +0 -377
- package/src/landmark/index.ts +0 -8
- package/src/link/createLink.ts +0 -182
- package/src/link/index.ts +0 -1
- package/src/listbox/createListBox.ts +0 -269
- package/src/listbox/createOption.ts +0 -151
- package/src/listbox/index.ts +0 -12
- package/src/live-announcer/announce.ts +0 -322
- package/src/live-announcer/index.ts +0 -9
- package/src/menu/createMenu.ts +0 -396
- package/src/menu/createMenuItem.ts +0 -149
- package/src/menu/createMenuTrigger.ts +0 -88
- package/src/menu/index.ts +0 -18
- package/src/meter/createMeter.ts +0 -75
- package/src/meter/index.ts +0 -1
- package/src/numberfield/createNumberField.ts +0 -268
- package/src/numberfield/index.ts +0 -5
- package/src/overlays/ariaHideOutside.ts +0 -219
- package/src/overlays/createInteractOutside.ts +0 -149
- package/src/overlays/createModal.tsx +0 -202
- package/src/overlays/createOverlay.ts +0 -155
- package/src/overlays/createOverlayTrigger.ts +0 -85
- package/src/overlays/createPreventScroll.ts +0 -266
- package/src/overlays/index.ts +0 -44
- package/src/popover/calculatePosition.ts +0 -766
- package/src/popover/createOverlayPosition.ts +0 -356
- package/src/popover/createPopover.ts +0 -170
- package/src/popover/index.ts +0 -24
- package/src/progress/createProgressBar.ts +0 -128
- package/src/progress/index.ts +0 -5
- package/src/radio/createRadio.ts +0 -287
- package/src/radio/createRadioGroup.ts +0 -189
- package/src/radio/createRadioGroupState.ts +0 -201
- package/src/radio/index.ts +0 -23
- package/src/searchfield/createSearchField.ts +0 -186
- package/src/searchfield/index.ts +0 -2
- package/src/select/createHiddenSelect.tsx +0 -236
- package/src/select/createSelect.ts +0 -395
- package/src/select/index.ts +0 -14
- package/src/selection/createTypeSelect.ts +0 -201
- package/src/selection/index.ts +0 -6
- package/src/separator/createSeparator.ts +0 -82
- package/src/separator/index.ts +0 -6
- package/src/slider/createSlider.ts +0 -349
- package/src/slider/index.ts +0 -2
- package/src/ssr/index.tsx +0 -370
- package/src/switch/createSwitch.ts +0 -70
- package/src/switch/index.ts +0 -1
- package/src/table/createTable.ts +0 -526
- package/src/table/createTableCell.ts +0 -147
- package/src/table/createTableColumnHeader.ts +0 -115
- package/src/table/createTableHeaderRow.ts +0 -40
- package/src/table/createTableRow.ts +0 -155
- package/src/table/createTableRowGroup.ts +0 -32
- package/src/table/createTableSelectAllCheckbox.ts +0 -73
- package/src/table/createTableSelectionCheckbox.ts +0 -59
- package/src/table/index.ts +0 -30
- package/src/table/types.ts +0 -165
- package/src/tabs/createTabs.ts +0 -472
- package/src/tabs/index.ts +0 -14
- package/src/tag/createTag.ts +0 -194
- package/src/tag/createTagGroup.ts +0 -154
- package/src/tag/index.ts +0 -12
- package/src/textfield/createTextField.ts +0 -198
- package/src/textfield/index.ts +0 -5
- package/src/toast/createToast.ts +0 -118
- package/src/toast/createToastRegion.ts +0 -100
- package/src/toast/index.ts +0 -11
- package/src/toggle/createToggle.ts +0 -223
- package/src/toggle/createToggleState.ts +0 -94
- package/src/toggle/index.ts +0 -7
- package/src/toolbar/createToolbar.ts +0 -368
- package/src/toolbar/index.ts +0 -6
- package/src/tooltip/createTooltip.ts +0 -79
- package/src/tooltip/createTooltipTrigger.ts +0 -222
- package/src/tooltip/index.ts +0 -6
- package/src/tree/createTree.ts +0 -246
- package/src/tree/createTreeItem.ts +0 -233
- package/src/tree/createTreeSelectionCheckbox.ts +0 -68
- package/src/tree/index.ts +0 -16
- package/src/tree/types.ts +0 -87
- package/src/utils/createDescription.ts +0 -137
- package/src/utils/dom.ts +0 -327
- package/src/utils/env.ts +0 -54
- package/src/utils/events.ts +0 -106
- package/src/utils/filterDOMProps.ts +0 -116
- package/src/utils/focus.ts +0 -151
- package/src/utils/geometry.ts +0 -115
- package/src/utils/globalListeners.ts +0 -142
- package/src/utils/index.ts +0 -80
- package/src/utils/mergeProps.ts +0 -52
- package/src/utils/platform.ts +0 -52
- package/src/utils/reactivity.ts +0 -36
- package/src/utils/textSelection.ts +0 -114
- package/src/visually-hidden/createVisuallyHidden.ts +0 -124
- package/src/visually-hidden/index.ts +0 -6
|
@@ -1,647 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Provides the behavior and accessibility implementation for a combobox component.
|
|
3
|
-
* A combobox combines a text input with a listbox, allowing users to filter a list of options.
|
|
4
|
-
* Based on @react-aria/combobox useComboBox.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { type JSX, type Accessor, createEffect, onCleanup } from 'solid-js';
|
|
8
|
-
import { isServer } from 'solid-js/web';
|
|
9
|
-
import { createPress } from '../interactions/createPress';
|
|
10
|
-
import { createFocusRing } from '../interactions/createFocusRing';
|
|
11
|
-
import { createLabel } from '../label/createLabel';
|
|
12
|
-
import { filterDOMProps } from '../utils/filterDOMProps';
|
|
13
|
-
import { mergeProps } from '../utils/mergeProps';
|
|
14
|
-
import { createId } from '../ssr';
|
|
15
|
-
import { access, type MaybeAccessor } from '../utils/reactivity';
|
|
16
|
-
import { isAppleDevice } from '../utils/platform';
|
|
17
|
-
import { openLink } from '../utils/dom';
|
|
18
|
-
import { ariaHideOutside } from '../overlays/ariaHideOutside';
|
|
19
|
-
import { announce } from '../live-announcer';
|
|
20
|
-
import { createStringFormatter } from '../i18n';
|
|
21
|
-
import { comboBoxIntlStrings } from './intl';
|
|
22
|
-
import { isDevEnv } from '../utils/env';
|
|
23
|
-
import type { ComboBoxState, CollectionNode, Key } from '@proyecto-viviana/solid-stately';
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Helper to count items in a collection
|
|
27
|
-
*/
|
|
28
|
-
function getItemCount<T>(collection: { getKeys(): Iterable<Key> }): number {
|
|
29
|
-
let count = 0;
|
|
30
|
-
for (const _ of collection.getKeys()) {
|
|
31
|
-
count++;
|
|
32
|
-
}
|
|
33
|
-
return count;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface AriaComboBoxProps {
|
|
37
|
-
/** An ID for the combobox. */
|
|
38
|
-
id?: string;
|
|
39
|
-
/** Whether the combobox is disabled. */
|
|
40
|
-
isDisabled?: boolean;
|
|
41
|
-
/** Whether the combobox is required. */
|
|
42
|
-
isRequired?: boolean;
|
|
43
|
-
/** Whether the combobox is read-only. */
|
|
44
|
-
isReadOnly?: boolean;
|
|
45
|
-
/** The label for the combobox. */
|
|
46
|
-
label?: JSX.Element;
|
|
47
|
-
/** An accessible label for the combobox when no visible label is provided. */
|
|
48
|
-
'aria-label'?: string;
|
|
49
|
-
/** The ID of an element that labels the combobox. */
|
|
50
|
-
'aria-labelledby'?: string;
|
|
51
|
-
/** The ID of an element that describes the combobox. */
|
|
52
|
-
'aria-describedby'?: string;
|
|
53
|
-
/** Placeholder text for the input when no value is entered. */
|
|
54
|
-
placeholder?: string;
|
|
55
|
-
/** Whether the combobox should be auto-focused. */
|
|
56
|
-
autoFocus?: boolean;
|
|
57
|
-
/** Handler called when focus moves to the combobox input. */
|
|
58
|
-
onFocus?: (e: FocusEvent) => void;
|
|
59
|
-
/** Handler called when focus moves away from the combobox input. */
|
|
60
|
-
onBlur?: (e: FocusEvent) => void;
|
|
61
|
-
/** Handler called when the focus state changes. */
|
|
62
|
-
onFocusChange?: (isFocused: boolean) => void;
|
|
63
|
-
/** The name of the combobox, used when submitting an HTML form. */
|
|
64
|
-
name?: string;
|
|
65
|
-
/**
|
|
66
|
-
* Describes the type of autocomplete functionality the input should provide.
|
|
67
|
-
* @default 'list'
|
|
68
|
-
*/
|
|
69
|
-
autoComplete?: 'list' | 'none' | 'inline' | 'both';
|
|
70
|
-
/** Whether focus should wrap from the last item to the first. */
|
|
71
|
-
shouldFocusWrap?: boolean;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export interface ComboBoxAria<T> {
|
|
75
|
-
/** Props for the label element. */
|
|
76
|
-
labelProps: JSX.HTMLAttributes<HTMLElement>;
|
|
77
|
-
/** Props for the input element. */
|
|
78
|
-
inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;
|
|
79
|
-
/** Props for the trigger button element. */
|
|
80
|
-
buttonProps: JSX.HTMLAttributes<HTMLElement>;
|
|
81
|
-
/** Props for the listbox popup. */
|
|
82
|
-
listBoxProps: JSX.HTMLAttributes<HTMLElement>;
|
|
83
|
-
/** Props for the description element, if any. */
|
|
84
|
-
descriptionProps: JSX.HTMLAttributes<HTMLElement>;
|
|
85
|
-
/** Props for the error message element, if any. */
|
|
86
|
-
errorMessageProps: JSX.HTMLAttributes<HTMLElement>;
|
|
87
|
-
/** Whether the input is currently focused. */
|
|
88
|
-
isFocused: Accessor<boolean>;
|
|
89
|
-
/** Whether the input has keyboard focus. */
|
|
90
|
-
isFocusVisible: Accessor<boolean>;
|
|
91
|
-
/** Whether the listbox is currently open. */
|
|
92
|
-
isOpen: Accessor<boolean>;
|
|
93
|
-
/** The currently selected item. */
|
|
94
|
-
selectedItem: Accessor<CollectionNode<T> | null>;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// Shared data between combobox and options
|
|
98
|
-
const comboBoxData = new WeakMap<object, ComboBoxData>();
|
|
99
|
-
|
|
100
|
-
interface ComboBoxData {
|
|
101
|
-
id: string;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export function getComboBoxData(state: ComboBoxState<unknown>): ComboBoxData | undefined {
|
|
105
|
-
return comboBoxData.get(state);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Provides the behavior and accessibility implementation for a combobox component.
|
|
110
|
-
*/
|
|
111
|
-
export function createComboBox<T>(
|
|
112
|
-
props: MaybeAccessor<AriaComboBoxProps>,
|
|
113
|
-
state: ComboBoxState<T>,
|
|
114
|
-
inputRef: () => HTMLInputElement | null,
|
|
115
|
-
buttonRef?: () => HTMLElement | null,
|
|
116
|
-
listBoxRef?: () => HTMLElement | null
|
|
117
|
-
): ComboBoxAria<T> {
|
|
118
|
-
const getProps = () => access(props);
|
|
119
|
-
const id = createId(getProps().id);
|
|
120
|
-
|
|
121
|
-
// Development-time warning for missing accessibility labels
|
|
122
|
-
if (isDevEnv()) {
|
|
123
|
-
const p = getProps();
|
|
124
|
-
if (!p.label && !p['aria-label'] && !p['aria-labelledby']) {
|
|
125
|
-
console.warn(
|
|
126
|
-
'[solidaria] A ComboBox requires a label, aria-label, or aria-labelledby attribute for accessibility.'
|
|
127
|
-
);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// Track if a pointerdown happened inside the listbox to prevent blur from closing
|
|
132
|
-
let isPointerDownInsideListBox = false;
|
|
133
|
-
|
|
134
|
-
// Generate IDs for associated elements
|
|
135
|
-
const inputId = `${id}-input`;
|
|
136
|
-
const buttonId = `${id}-button`;
|
|
137
|
-
const listBoxId = `${id}-listbox`;
|
|
138
|
-
const descriptionId = `${id}-description`;
|
|
139
|
-
const errorMessageId = `${id}-error`;
|
|
140
|
-
|
|
141
|
-
// Set up global pointerdown listener to track clicks inside listbox
|
|
142
|
-
// This is needed because the option's createPress stops propagation
|
|
143
|
-
createEffect(() => {
|
|
144
|
-
if (typeof document === 'undefined') return;
|
|
145
|
-
|
|
146
|
-
const handleGlobalPointerDown = (e: PointerEvent) => {
|
|
147
|
-
const target = e.target as HTMLElement;
|
|
148
|
-
// Check if the click is inside the listbox
|
|
149
|
-
if (target.closest(`[id="${listBoxId}"]`)) {
|
|
150
|
-
isPointerDownInsideListBox = true;
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
document.addEventListener('pointerdown', handleGlobalPointerDown, true);
|
|
155
|
-
|
|
156
|
-
onCleanup(() => {
|
|
157
|
-
document.removeEventListener('pointerdown', handleGlobalPointerDown, true);
|
|
158
|
-
});
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
// Filter DOM props
|
|
162
|
-
const domProps = () =>
|
|
163
|
-
filterDOMProps(getProps() as unknown as Record<string, unknown>, { labelable: true });
|
|
164
|
-
|
|
165
|
-
// Share data with child options
|
|
166
|
-
createEffect(() => {
|
|
167
|
-
comboBoxData.set(state, { id });
|
|
168
|
-
|
|
169
|
-
onCleanup(() => {
|
|
170
|
-
comboBoxData.delete(state);
|
|
171
|
-
});
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
// Label handling
|
|
175
|
-
const { labelProps, fieldProps } = createLabel({
|
|
176
|
-
get id() {
|
|
177
|
-
return inputId;
|
|
178
|
-
},
|
|
179
|
-
get label() {
|
|
180
|
-
return getProps().label;
|
|
181
|
-
},
|
|
182
|
-
get 'aria-label'() {
|
|
183
|
-
return getProps()['aria-label'];
|
|
184
|
-
},
|
|
185
|
-
get 'aria-labelledby'() {
|
|
186
|
-
return getProps()['aria-labelledby'];
|
|
187
|
-
},
|
|
188
|
-
labelElementType: 'label',
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
// Focus ring for keyboard focus styling
|
|
192
|
-
const { isFocusVisible, focusProps } = createFocusRing({
|
|
193
|
-
get autoFocus() {
|
|
194
|
-
return getProps().autoFocus;
|
|
195
|
-
},
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
// Track focus state from state
|
|
199
|
-
const isFocused = state.isFocused;
|
|
200
|
-
|
|
201
|
-
// String formatter for VoiceOver announcements
|
|
202
|
-
// Only create on client side
|
|
203
|
-
const stringFormatter = !isServer ? createStringFormatter(comboBoxIntlStrings) : null;
|
|
204
|
-
|
|
205
|
-
// Track previous values for announcements
|
|
206
|
-
let lastFocusedKey: Key | null = null;
|
|
207
|
-
let lastSelectedKey: Key | null = null;
|
|
208
|
-
let lastOptionCount = 0;
|
|
209
|
-
let lastIsOpen = false;
|
|
210
|
-
|
|
211
|
-
// VoiceOver has issues with announcing aria-activedescendant properly on change
|
|
212
|
-
// (especially on iOS). We use a live region announcer to announce focus changes
|
|
213
|
-
// manually. This matches React Aria's behavior.
|
|
214
|
-
createEffect(() => {
|
|
215
|
-
if (isServer || !stringFormatter) return;
|
|
216
|
-
|
|
217
|
-
const focusedKey = state.focusedKey();
|
|
218
|
-
const isOpen = state.isOpen();
|
|
219
|
-
const collection = state.collection();
|
|
220
|
-
|
|
221
|
-
// Get the focused item
|
|
222
|
-
const focusedItem = focusedKey != null && isOpen
|
|
223
|
-
? collection.getItem(focusedKey)
|
|
224
|
-
: null;
|
|
225
|
-
|
|
226
|
-
// Announce focus changes on Apple devices
|
|
227
|
-
if (isAppleDevice() && focusedItem != null && focusedKey !== lastFocusedKey) {
|
|
228
|
-
const isSelected = state.selectedKey() === focusedKey;
|
|
229
|
-
const optionText = focusedItem.textValue || '';
|
|
230
|
-
|
|
231
|
-
// For now, we don't support sections, so isGroupChange is always false
|
|
232
|
-
const announcement = stringFormatter().format('focusAnnouncement', {
|
|
233
|
-
isGroupChange: false,
|
|
234
|
-
groupTitle: '',
|
|
235
|
-
groupCount: 0,
|
|
236
|
-
optionText,
|
|
237
|
-
isSelected,
|
|
238
|
-
});
|
|
239
|
-
|
|
240
|
-
announce(announcement, 'polite');
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
lastFocusedKey = focusedKey;
|
|
244
|
-
});
|
|
245
|
-
|
|
246
|
-
// Announce the number of available suggestions when it changes
|
|
247
|
-
createEffect(() => {
|
|
248
|
-
if (isServer || !stringFormatter) return;
|
|
249
|
-
|
|
250
|
-
const isOpen = state.isOpen();
|
|
251
|
-
const collection = state.collection();
|
|
252
|
-
const optionCount = getItemCount(collection);
|
|
253
|
-
const focusedKey = state.focusedKey();
|
|
254
|
-
|
|
255
|
-
// Only announce the number of options available when the menu opens if there is no
|
|
256
|
-
// focused item, otherwise screen readers will typically read e.g. "1 of 6".
|
|
257
|
-
// The exception is VoiceOver since this isn't included in the message above.
|
|
258
|
-
const didOpenWithoutFocusedItem =
|
|
259
|
-
isOpen !== lastIsOpen &&
|
|
260
|
-
(focusedKey == null || isAppleDevice());
|
|
261
|
-
|
|
262
|
-
if (isOpen && (didOpenWithoutFocusedItem || optionCount !== lastOptionCount)) {
|
|
263
|
-
const announcement = stringFormatter().format('countAnnouncement', { optionCount });
|
|
264
|
-
announce(announcement, 'polite');
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
lastOptionCount = optionCount;
|
|
268
|
-
lastIsOpen = isOpen;
|
|
269
|
-
});
|
|
270
|
-
|
|
271
|
-
// Announce when a selection occurs for VoiceOver. Other screen readers typically do this automatically.
|
|
272
|
-
createEffect(() => {
|
|
273
|
-
if (isServer || !stringFormatter) return;
|
|
274
|
-
|
|
275
|
-
const selectedKey = state.selectedKey();
|
|
276
|
-
const selectedItem = state.selectedItem();
|
|
277
|
-
|
|
278
|
-
if (isAppleDevice() && state.isFocused() && selectedItem && selectedKey !== lastSelectedKey) {
|
|
279
|
-
const optionText = selectedItem.textValue || '';
|
|
280
|
-
const announcement = stringFormatter().format('selectedAnnouncement', { optionText });
|
|
281
|
-
announce(announcement, 'polite');
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
lastSelectedKey = selectedKey;
|
|
285
|
-
});
|
|
286
|
-
|
|
287
|
-
// Hide other page content from screen readers when the listbox is open.
|
|
288
|
-
// This requires both the input and listbox refs to be available.
|
|
289
|
-
// Note: This feature is important for screen reader accessibility but
|
|
290
|
-
// only works when a popoverRef/listBoxRef is provided.
|
|
291
|
-
createEffect(() => {
|
|
292
|
-
if (isServer) return;
|
|
293
|
-
|
|
294
|
-
const isOpen = state.isOpen();
|
|
295
|
-
const inputEl = inputRef();
|
|
296
|
-
const listBoxEl = listBoxRef?.();
|
|
297
|
-
|
|
298
|
-
// Only apply ariaHideOutside if we have both elements available
|
|
299
|
-
// This ensures the listbox won't be accidentally hidden
|
|
300
|
-
if (isOpen && inputEl && listBoxEl) {
|
|
301
|
-
const cleanup = ariaHideOutside([inputEl, listBoxEl]);
|
|
302
|
-
onCleanup(cleanup);
|
|
303
|
-
}
|
|
304
|
-
});
|
|
305
|
-
|
|
306
|
-
// Handle press on button trigger
|
|
307
|
-
const { pressProps } = createPress({
|
|
308
|
-
get isDisabled() {
|
|
309
|
-
return getProps().isDisabled ?? state.isDisabled;
|
|
310
|
-
},
|
|
311
|
-
onPress() {
|
|
312
|
-
state.toggle(null, 'manual');
|
|
313
|
-
// Focus input after toggling
|
|
314
|
-
inputRef()?.focus();
|
|
315
|
-
},
|
|
316
|
-
});
|
|
317
|
-
|
|
318
|
-
// Handle input change
|
|
319
|
-
const onInputChange: JSX.EventHandler<HTMLInputElement, InputEvent> = (e) => {
|
|
320
|
-
const target = e.target as HTMLInputElement;
|
|
321
|
-
state.setInputValue(target.value);
|
|
322
|
-
};
|
|
323
|
-
|
|
324
|
-
// Keyboard navigation for input
|
|
325
|
-
const onInputKeyDown: JSX.EventHandler<HTMLInputElement, KeyboardEvent> = (e) => {
|
|
326
|
-
const p = getProps();
|
|
327
|
-
if (p.isDisabled || p.isReadOnly) return;
|
|
328
|
-
|
|
329
|
-
const collection = state.collection();
|
|
330
|
-
const focusedKey = state.focusedKey();
|
|
331
|
-
const shouldWrap = p.shouldFocusWrap ?? false;
|
|
332
|
-
|
|
333
|
-
switch (e.key) {
|
|
334
|
-
case 'Enter':
|
|
335
|
-
if (state.isOpen() && focusedKey != null) {
|
|
336
|
-
e.preventDefault();
|
|
337
|
-
|
|
338
|
-
// Check if the focused item is a link
|
|
339
|
-
// Link href can be in props (for components) or value (for dynamic items)
|
|
340
|
-
const collectionItem = collection.getItem(focusedKey);
|
|
341
|
-
const itemHref = collectionItem?.props?.href ?? (collectionItem?.value as Record<string, unknown> | null)?.href;
|
|
342
|
-
if (itemHref) {
|
|
343
|
-
// Find the actual anchor element in the DOM and trigger navigation
|
|
344
|
-
const listBox = listBoxRef?.();
|
|
345
|
-
if (listBox) {
|
|
346
|
-
const item = listBox.querySelector(
|
|
347
|
-
`[data-key="${CSS.escape(String(focusedKey))}"]`
|
|
348
|
-
);
|
|
349
|
-
if (item instanceof HTMLAnchorElement) {
|
|
350
|
-
openLink(item, e);
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
state.close();
|
|
354
|
-
} else {
|
|
355
|
-
state.commit();
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
break;
|
|
359
|
-
|
|
360
|
-
case 'Escape':
|
|
361
|
-
if (state.isOpen()) {
|
|
362
|
-
e.preventDefault();
|
|
363
|
-
e.stopPropagation();
|
|
364
|
-
state.revert();
|
|
365
|
-
}
|
|
366
|
-
break;
|
|
367
|
-
|
|
368
|
-
case 'ArrowDown':
|
|
369
|
-
e.preventDefault();
|
|
370
|
-
if (!state.isOpen()) {
|
|
371
|
-
state.open('first', 'manual');
|
|
372
|
-
} else {
|
|
373
|
-
// Move to next item
|
|
374
|
-
if (focusedKey == null) {
|
|
375
|
-
const firstKey = collection.getFirstKey();
|
|
376
|
-
if (firstKey != null) {
|
|
377
|
-
state.setFocusedKey(firstKey);
|
|
378
|
-
}
|
|
379
|
-
} else {
|
|
380
|
-
let nextKey = collection.getKeyAfter(focusedKey);
|
|
381
|
-
// Skip disabled keys
|
|
382
|
-
while (nextKey != null && state.isKeyDisabled(nextKey)) {
|
|
383
|
-
nextKey = collection.getKeyAfter(nextKey);
|
|
384
|
-
}
|
|
385
|
-
if (nextKey != null) {
|
|
386
|
-
state.setFocusedKey(nextKey);
|
|
387
|
-
} else if (shouldWrap) {
|
|
388
|
-
// Wrap to first
|
|
389
|
-
let firstKey = collection.getFirstKey();
|
|
390
|
-
while (firstKey != null && state.isKeyDisabled(firstKey)) {
|
|
391
|
-
firstKey = collection.getKeyAfter(firstKey);
|
|
392
|
-
}
|
|
393
|
-
if (firstKey != null) {
|
|
394
|
-
state.setFocusedKey(firstKey);
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
break;
|
|
400
|
-
|
|
401
|
-
case 'ArrowUp':
|
|
402
|
-
e.preventDefault();
|
|
403
|
-
if (!state.isOpen()) {
|
|
404
|
-
state.open('last', 'manual');
|
|
405
|
-
} else {
|
|
406
|
-
// Move to previous item
|
|
407
|
-
if (focusedKey == null) {
|
|
408
|
-
const lastKey = collection.getLastKey();
|
|
409
|
-
if (lastKey != null) {
|
|
410
|
-
state.setFocusedKey(lastKey);
|
|
411
|
-
}
|
|
412
|
-
} else {
|
|
413
|
-
let prevKey = collection.getKeyBefore(focusedKey);
|
|
414
|
-
// Skip disabled keys
|
|
415
|
-
while (prevKey != null && state.isKeyDisabled(prevKey)) {
|
|
416
|
-
prevKey = collection.getKeyBefore(prevKey);
|
|
417
|
-
}
|
|
418
|
-
if (prevKey != null) {
|
|
419
|
-
state.setFocusedKey(prevKey);
|
|
420
|
-
} else if (shouldWrap) {
|
|
421
|
-
// Wrap to last
|
|
422
|
-
let lastKey = collection.getLastKey();
|
|
423
|
-
while (lastKey != null && state.isKeyDisabled(lastKey)) {
|
|
424
|
-
lastKey = collection.getKeyBefore(lastKey);
|
|
425
|
-
}
|
|
426
|
-
if (lastKey != null) {
|
|
427
|
-
state.setFocusedKey(lastKey);
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
break;
|
|
433
|
-
|
|
434
|
-
case 'Home':
|
|
435
|
-
if (state.isOpen()) {
|
|
436
|
-
e.preventDefault();
|
|
437
|
-
let firstKey = collection.getFirstKey();
|
|
438
|
-
while (firstKey != null && state.isKeyDisabled(firstKey)) {
|
|
439
|
-
firstKey = collection.getKeyAfter(firstKey);
|
|
440
|
-
}
|
|
441
|
-
if (firstKey != null) {
|
|
442
|
-
state.setFocusedKey(firstKey);
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
break;
|
|
446
|
-
|
|
447
|
-
case 'End':
|
|
448
|
-
if (state.isOpen()) {
|
|
449
|
-
e.preventDefault();
|
|
450
|
-
let lastKey = collection.getLastKey();
|
|
451
|
-
while (lastKey != null && state.isKeyDisabled(lastKey)) {
|
|
452
|
-
lastKey = collection.getKeyBefore(lastKey);
|
|
453
|
-
}
|
|
454
|
-
if (lastKey != null) {
|
|
455
|
-
state.setFocusedKey(lastKey);
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
break;
|
|
459
|
-
|
|
460
|
-
case 'Tab':
|
|
461
|
-
// Commit on Tab if menu is open
|
|
462
|
-
if (state.isOpen() && focusedKey != null) {
|
|
463
|
-
state.commit();
|
|
464
|
-
}
|
|
465
|
-
break;
|
|
466
|
-
}
|
|
467
|
-
};
|
|
468
|
-
|
|
469
|
-
// Handle focus events
|
|
470
|
-
const handleFocus = (e: FocusEvent) => {
|
|
471
|
-
state.setFocused(true);
|
|
472
|
-
getProps().onFocus?.(e);
|
|
473
|
-
getProps().onFocusChange?.(true);
|
|
474
|
-
};
|
|
475
|
-
|
|
476
|
-
// Track the last touch event time for iPad VoiceOver double-tap debouncing
|
|
477
|
-
let lastEventTime = 0;
|
|
478
|
-
|
|
479
|
-
const handleBlur = (e: FocusEvent) => {
|
|
480
|
-
// Use synchronous ref checks instead of requestAnimationFrame
|
|
481
|
-
// This matches React Aria's implementation and is more reliable
|
|
482
|
-
const relatedTarget = e.relatedTarget as HTMLElement | null;
|
|
483
|
-
const button = buttonRef?.();
|
|
484
|
-
const listBox = listBoxRef?.();
|
|
485
|
-
|
|
486
|
-
// Don't blur if focus is moving to the button
|
|
487
|
-
const blurFromButton = button && button === relatedTarget;
|
|
488
|
-
|
|
489
|
-
// Don't blur if focus is moving into the listbox/popover
|
|
490
|
-
const blurIntoPopover = listBox?.contains(relatedTarget);
|
|
491
|
-
|
|
492
|
-
if (blurFromButton || blurIntoPopover) {
|
|
493
|
-
return;
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
// If a pointerdown happened inside the listbox, don't close
|
|
497
|
-
// This handles the case when clicking on a non-focusable option
|
|
498
|
-
if (isPointerDownInsideListBox) {
|
|
499
|
-
isPointerDownInsideListBox = false;
|
|
500
|
-
return;
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
// Call user's onBlur handler
|
|
504
|
-
getProps().onBlur?.(e);
|
|
505
|
-
|
|
506
|
-
state.setFocused(false);
|
|
507
|
-
getProps().onFocusChange?.(false);
|
|
508
|
-
};
|
|
509
|
-
|
|
510
|
-
// Handle touch events for iPad VoiceOver
|
|
511
|
-
// VoiceOver on iOS fires a touchend at the center of the element on double-tap.
|
|
512
|
-
// We detect this and toggle the combobox manually to avoid issues with focus management.
|
|
513
|
-
const handleTouchEnd = (e: TouchEvent) => {
|
|
514
|
-
const p = getProps();
|
|
515
|
-
const isDisabled = p.isDisabled ?? state.isDisabled;
|
|
516
|
-
const isReadOnly = p.isReadOnly ?? state.isReadOnly;
|
|
517
|
-
|
|
518
|
-
if (isDisabled || isReadOnly) {
|
|
519
|
-
return;
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
// Debounce rapid consecutive touchend events (< 500ms)
|
|
523
|
-
// This handles VoiceOver's double-tap behavior
|
|
524
|
-
if (e.timeStamp - lastEventTime < 500) {
|
|
525
|
-
e.preventDefault();
|
|
526
|
-
inputRef()?.focus();
|
|
527
|
-
return;
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
// Detect VoiceOver virtual click - it fires at the exact center of the element
|
|
531
|
-
const rect = (e.target as Element).getBoundingClientRect();
|
|
532
|
-
const touch = e.changedTouches[0];
|
|
533
|
-
const centerX = Math.ceil(rect.left + 0.5 * rect.width);
|
|
534
|
-
const centerY = Math.ceil(rect.top + 0.5 * rect.height);
|
|
535
|
-
|
|
536
|
-
if (touch.clientX === centerX && touch.clientY === centerY) {
|
|
537
|
-
e.preventDefault();
|
|
538
|
-
inputRef()?.focus();
|
|
539
|
-
state.toggle(null, 'manual');
|
|
540
|
-
lastEventTime = e.timeStamp;
|
|
541
|
-
}
|
|
542
|
-
};
|
|
543
|
-
|
|
544
|
-
return {
|
|
545
|
-
get labelProps() {
|
|
546
|
-
return labelProps as JSX.HTMLAttributes<HTMLElement>;
|
|
547
|
-
},
|
|
548
|
-
get inputProps() {
|
|
549
|
-
const p = getProps();
|
|
550
|
-
const isOpen = state.isOpen();
|
|
551
|
-
const isDisabled = p.isDisabled ?? state.isDisabled;
|
|
552
|
-
const isReadOnly = p.isReadOnly ?? state.isReadOnly;
|
|
553
|
-
const focusedKey = state.focusedKey();
|
|
554
|
-
|
|
555
|
-
return mergeProps(
|
|
556
|
-
domProps(),
|
|
557
|
-
focusProps as Record<string, unknown>,
|
|
558
|
-
fieldProps as Record<string, unknown>,
|
|
559
|
-
{
|
|
560
|
-
id: inputId,
|
|
561
|
-
type: 'text',
|
|
562
|
-
role: 'combobox',
|
|
563
|
-
get value() {
|
|
564
|
-
return state.inputValue();
|
|
565
|
-
},
|
|
566
|
-
tabIndex: isDisabled ? undefined : 0,
|
|
567
|
-
disabled: isDisabled || undefined,
|
|
568
|
-
readOnly: isReadOnly || undefined,
|
|
569
|
-
placeholder: p.placeholder,
|
|
570
|
-
autoComplete: 'off',
|
|
571
|
-
'aria-autocomplete': p.autoComplete ?? 'list',
|
|
572
|
-
'aria-haspopup': 'listbox',
|
|
573
|
-
'aria-expanded': isOpen,
|
|
574
|
-
'aria-controls': isOpen ? listBoxId : undefined,
|
|
575
|
-
'aria-activedescendant': isOpen && focusedKey != null
|
|
576
|
-
? `${listBoxId}-option-${focusedKey}`
|
|
577
|
-
: undefined,
|
|
578
|
-
'aria-disabled': isDisabled || undefined,
|
|
579
|
-
'aria-required': p.isRequired || undefined,
|
|
580
|
-
'aria-describedby': p['aria-describedby'] || undefined,
|
|
581
|
-
name: p.name,
|
|
582
|
-
onInput: onInputChange,
|
|
583
|
-
onKeyDown: onInputKeyDown,
|
|
584
|
-
onFocus: handleFocus,
|
|
585
|
-
onBlur: handleBlur,
|
|
586
|
-
onTouchEnd: handleTouchEnd,
|
|
587
|
-
'data-open': isOpen || undefined,
|
|
588
|
-
'data-disabled': isDisabled || undefined,
|
|
589
|
-
'data-readonly': isReadOnly || undefined,
|
|
590
|
-
'data-focus-visible': isFocusVisible() || undefined,
|
|
591
|
-
} as Record<string, unknown>
|
|
592
|
-
) as JSX.InputHTMLAttributes<HTMLInputElement>;
|
|
593
|
-
},
|
|
594
|
-
get buttonProps() {
|
|
595
|
-
const p = getProps();
|
|
596
|
-
const isOpen = state.isOpen();
|
|
597
|
-
const isDisabled = p.isDisabled ?? state.isDisabled;
|
|
598
|
-
|
|
599
|
-
return mergeProps(
|
|
600
|
-
pressProps as Record<string, unknown>,
|
|
601
|
-
{
|
|
602
|
-
id: buttonId,
|
|
603
|
-
type: 'button',
|
|
604
|
-
tabIndex: -1,
|
|
605
|
-
'aria-haspopup': 'listbox',
|
|
606
|
-
'aria-expanded': isOpen,
|
|
607
|
-
'aria-controls': isOpen ? listBoxId : undefined,
|
|
608
|
-
'aria-disabled': isDisabled || undefined,
|
|
609
|
-
'aria-label': stringFormatter?.().format('buttonLabel') ?? 'Show suggestions',
|
|
610
|
-
'data-open': isOpen || undefined,
|
|
611
|
-
'data-disabled': isDisabled || undefined,
|
|
612
|
-
} as Record<string, unknown>
|
|
613
|
-
) as JSX.HTMLAttributes<HTMLElement>;
|
|
614
|
-
},
|
|
615
|
-
get listBoxProps() {
|
|
616
|
-
return {
|
|
617
|
-
id: listBoxId,
|
|
618
|
-
role: 'listbox',
|
|
619
|
-
'aria-labelledby': inputId,
|
|
620
|
-
tabIndex: -1,
|
|
621
|
-
// Track pointerdown inside listbox to prevent blur from closing
|
|
622
|
-
// Use capture phase because createPress calls stopPropagation on pointerdown
|
|
623
|
-
onPointerDownCapture: () => {
|
|
624
|
-
isPointerDownInsideListBox = true;
|
|
625
|
-
},
|
|
626
|
-
onMouseDownCapture: () => {
|
|
627
|
-
// Fallback for environments without PointerEvent
|
|
628
|
-
isPointerDownInsideListBox = true;
|
|
629
|
-
},
|
|
630
|
-
} as JSX.HTMLAttributes<HTMLElement>;
|
|
631
|
-
},
|
|
632
|
-
get descriptionProps() {
|
|
633
|
-
return {
|
|
634
|
-
id: descriptionId,
|
|
635
|
-
} as JSX.HTMLAttributes<HTMLElement>;
|
|
636
|
-
},
|
|
637
|
-
get errorMessageProps() {
|
|
638
|
-
return {
|
|
639
|
-
id: errorMessageId,
|
|
640
|
-
} as JSX.HTMLAttributes<HTMLElement>;
|
|
641
|
-
},
|
|
642
|
-
isFocused,
|
|
643
|
-
isFocusVisible: () => isFocused() && isFocusVisible(),
|
|
644
|
-
isOpen: state.isOpen,
|
|
645
|
-
selectedItem: state.selectedItem,
|
|
646
|
-
};
|
|
647
|
-
}
|
package/src/combobox/index.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"focusAnnouncement": "{isGroupChange, select, true {Entered group {groupTitle}, with {groupCount, plural, one {# option} other {# options}}. } other {}}{optionText}{isSelected, select, true {, selected} other {}}",
|
|
3
|
-
"countAnnouncement": "{optionCount, plural, one {# option} other {# options}} available.",
|
|
4
|
-
"selectedAnnouncement": "{optionText}, selected",
|
|
5
|
-
"buttonLabel": "Show suggestions",
|
|
6
|
-
"listboxLabel": "Suggestions"
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"focusAnnouncement": "{isGroupChange, select, true {Grupo {groupTitle} activado, con {groupCount, plural, one {# opción} other {# opciones}}. } other {}}{optionText}{isSelected, select, true {, seleccionado} other {}}",
|
|
3
|
-
"countAnnouncement": "{optionCount, plural, one {# opción disponible} other {# opciones disponibles}}.",
|
|
4
|
-
"selectedAnnouncement": "{optionText}, seleccionado",
|
|
5
|
-
"buttonLabel": "Mostrar sugerencias",
|
|
6
|
-
"listboxLabel": "Sugerencias"
|
|
7
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ComboBox internationalization strings
|
|
3
|
-
* Based on @react-aria/combobox/intl
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import type { LocalizedStrings } from '@internationalized/string';
|
|
7
|
-
|
|
8
|
-
// Import locale files
|
|
9
|
-
import enUS from './en-US.json' with { type: 'json' };
|
|
10
|
-
import esES from './es-ES.json' with { type: 'json' };
|
|
11
|
-
|
|
12
|
-
export type ComboBoxIntlStrings = {
|
|
13
|
-
focusAnnouncement: string;
|
|
14
|
-
countAnnouncement: string;
|
|
15
|
-
selectedAnnouncement: string;
|
|
16
|
-
buttonLabel: string;
|
|
17
|
-
listboxLabel: string;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export const comboBoxIntlStrings: LocalizedStrings<keyof ComboBoxIntlStrings, string> = {
|
|
21
|
-
'en-US': enUS,
|
|
22
|
-
'es-ES': esES,
|
|
23
|
-
};
|