@proyecto-viviana/solidaria 0.1.0 → 0.1.2
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/autocomplete/createAutocomplete.d.ts +109 -0
- package/dist/autocomplete/createAutocomplete.d.ts.map +1 -0
- package/dist/autocomplete/index.d.ts +2 -0
- package/dist/autocomplete/index.d.ts.map +1 -0
- package/dist/breadcrumbs/createBreadcrumbs.d.ts +43 -0
- package/dist/breadcrumbs/createBreadcrumbs.d.ts.map +1 -0
- package/dist/breadcrumbs/index.d.ts +2 -0
- package/dist/breadcrumbs/index.d.ts.map +1 -0
- package/dist/button/createButton.d.ts +29 -0
- package/dist/button/createButton.d.ts.map +1 -0
- package/dist/button/createToggleButton.d.ts +41 -0
- package/dist/button/createToggleButton.d.ts.map +1 -0
- package/dist/button/index.d.ts +5 -0
- package/dist/button/index.d.ts.map +1 -0
- package/dist/button/types.d.ts +77 -0
- package/dist/button/types.d.ts.map +1 -0
- package/dist/calendar/createCalendar.d.ts +41 -0
- package/dist/calendar/createCalendar.d.ts.map +1 -0
- package/dist/calendar/createCalendarCell.d.ts +41 -0
- package/dist/calendar/createCalendarCell.d.ts.map +1 -0
- package/dist/calendar/createCalendarGrid.d.ts +29 -0
- package/dist/calendar/createCalendarGrid.d.ts.map +1 -0
- package/dist/calendar/createRangeCalendar.d.ts +39 -0
- package/dist/calendar/createRangeCalendar.d.ts.map +1 -0
- package/dist/calendar/createRangeCalendarCell.d.ts +45 -0
- package/dist/calendar/createRangeCalendarCell.d.ts.map +1 -0
- package/dist/calendar/index.d.ts +6 -0
- package/dist/calendar/index.d.ts.map +1 -0
- package/dist/checkbox/createCheckbox.d.ts +56 -0
- package/dist/checkbox/createCheckbox.d.ts.map +1 -0
- package/dist/checkbox/createCheckboxGroup.d.ts +53 -0
- package/dist/checkbox/createCheckboxGroup.d.ts.map +1 -0
- package/dist/checkbox/createCheckboxGroupItem.d.ts +25 -0
- package/dist/checkbox/createCheckboxGroupItem.d.ts.map +1 -0
- package/dist/checkbox/createCheckboxGroupState.d.ts +71 -0
- package/dist/checkbox/createCheckboxGroupState.d.ts.map +1 -0
- package/dist/checkbox/index.d.ts +9 -0
- package/dist/checkbox/index.d.ts.map +1 -0
- package/dist/color/createColorArea.d.ts +13 -0
- package/dist/color/createColorArea.d.ts.map +1 -0
- package/dist/color/createColorField.d.ts +13 -0
- package/dist/color/createColorField.d.ts.map +1 -0
- package/dist/color/createColorSlider.d.ts +13 -0
- package/dist/color/createColorSlider.d.ts.map +1 -0
- package/dist/color/createColorSwatch.d.ts +12 -0
- package/dist/color/createColorSwatch.d.ts.map +1 -0
- package/dist/color/createColorWheel.d.ts +13 -0
- package/dist/color/createColorWheel.d.ts.map +1 -0
- package/dist/color/index.d.ts +10 -0
- package/dist/color/index.d.ts.map +1 -0
- package/dist/color/types.d.ts +106 -0
- package/dist/color/types.d.ts.map +1 -0
- package/dist/combobox/createComboBox.d.ts +77 -0
- package/dist/combobox/createComboBox.d.ts.map +1 -0
- package/dist/combobox/index.d.ts +2 -0
- package/dist/combobox/index.d.ts.map +1 -0
- package/dist/combobox/intl/index.d.ts +14 -0
- package/dist/combobox/intl/index.d.ts.map +1 -0
- package/dist/datepicker/createDateField.d.ts +51 -0
- package/dist/datepicker/createDateField.d.ts.map +1 -0
- package/dist/datepicker/createDatePicker.d.ts +65 -0
- package/dist/datepicker/createDatePicker.d.ts.map +1 -0
- package/dist/datepicker/createDateSegment.d.ts +29 -0
- package/dist/datepicker/createDateSegment.d.ts.map +1 -0
- package/dist/datepicker/createTimeField.d.ts +51 -0
- package/dist/datepicker/createTimeField.d.ts.map +1 -0
- package/dist/datepicker/index.d.ts +5 -0
- package/dist/datepicker/index.d.ts.map +1 -0
- package/dist/dialog/createDialog.d.ts +25 -0
- package/dist/dialog/createDialog.d.ts.map +1 -0
- package/dist/dialog/index.d.ts +3 -0
- package/dist/dialog/index.d.ts.map +1 -0
- package/dist/dialog/types.d.ts +18 -0
- package/dist/dialog/types.d.ts.map +1 -0
- package/dist/disclosure/createDisclosure.d.ts +52 -0
- package/dist/disclosure/createDisclosure.d.ts.map +1 -0
- package/dist/disclosure/createDisclosureGroup.d.ts +39 -0
- package/dist/disclosure/createDisclosureGroup.d.ts.map +1 -0
- package/dist/disclosure/index.d.ts +3 -0
- package/dist/disclosure/index.d.ts.map +1 -0
- package/dist/dnd/createDrag.d.ts +16 -0
- package/dist/dnd/createDrag.d.ts.map +1 -0
- package/dist/dnd/createDraggableCollection.d.ts +27 -0
- package/dist/dnd/createDraggableCollection.d.ts.map +1 -0
- package/dist/dnd/createDraggableItem.d.ts +37 -0
- package/dist/dnd/createDraggableItem.d.ts.map +1 -0
- package/dist/dnd/createDrop.d.ts +16 -0
- package/dist/dnd/createDrop.d.ts.map +1 -0
- package/dist/dnd/createDroppableCollection.d.ts +76 -0
- package/dist/dnd/createDroppableCollection.d.ts.map +1 -0
- package/dist/dnd/createDroppableItem.d.ts +31 -0
- package/dist/dnd/createDroppableItem.d.ts.map +1 -0
- package/dist/dnd/index.d.ts +18 -0
- package/dist/dnd/index.d.ts.map +1 -0
- package/dist/dnd/types.d.ts +66 -0
- package/dist/dnd/types.d.ts.map +1 -0
- package/dist/dnd/utils.d.ts +57 -0
- package/dist/dnd/utils.d.ts.map +1 -0
- package/dist/focus/FocusScope.d.ts +57 -0
- package/dist/focus/FocusScope.d.ts.map +1 -0
- package/dist/focus/createAutoFocus.d.ts +120 -0
- package/dist/focus/createAutoFocus.d.ts.map +1 -0
- package/dist/focus/createFocusRestore.d.ts +116 -0
- package/dist/focus/createFocusRestore.d.ts.map +1 -0
- package/dist/focus/createVirtualFocus.d.ts +170 -0
- package/dist/focus/createVirtualFocus.d.ts.map +1 -0
- package/dist/focus/index.d.ts +5 -0
- package/dist/focus/index.d.ts.map +1 -0
- package/dist/form/createFormReset.d.ts +27 -0
- package/dist/form/createFormReset.d.ts.map +1 -0
- package/dist/form/createFormValidation.d.ts +56 -0
- package/dist/form/createFormValidation.d.ts.map +1 -0
- package/dist/form/index.d.ts +3 -0
- package/dist/form/index.d.ts.map +1 -0
- package/dist/grid/GridKeyboardDelegate.d.ts +79 -0
- package/dist/grid/GridKeyboardDelegate.d.ts.map +1 -0
- package/dist/grid/createGrid.d.ts +24 -0
- package/dist/grid/createGrid.d.ts.map +1 -0
- package/dist/grid/createGridCell.d.ts +12 -0
- package/dist/grid/createGridCell.d.ts.map +1 -0
- package/dist/grid/createGridRow.d.ts +12 -0
- package/dist/grid/createGridRow.d.ts.map +1 -0
- package/dist/grid/index.d.ts +10 -0
- package/dist/grid/index.d.ts.map +1 -0
- package/dist/grid/types.d.ts +126 -0
- package/dist/grid/types.d.ts.map +1 -0
- package/dist/gridlist/createGridList.d.ts +28 -0
- package/dist/gridlist/createGridList.d.ts.map +1 -0
- package/dist/gridlist/createGridListItem.d.ts +12 -0
- package/dist/gridlist/createGridListItem.d.ts.map +1 -0
- package/dist/gridlist/createGridListSelectionCheckbox.d.ts +12 -0
- package/dist/gridlist/createGridListSelectionCheckbox.d.ts.map +1 -0
- package/dist/gridlist/index.d.ts +8 -0
- package/dist/gridlist/index.d.ts.map +1 -0
- package/dist/gridlist/types.d.ts +75 -0
- package/dist/gridlist/types.d.ts.map +1 -0
- package/dist/i18n/NumberFormatter.d.ts +43 -0
- package/dist/i18n/NumberFormatter.d.ts.map +1 -0
- package/dist/i18n/createCollator.d.ts +41 -0
- package/dist/i18n/createCollator.d.ts.map +1 -0
- package/dist/i18n/createDateFormatter.d.ts +45 -0
- package/dist/i18n/createDateFormatter.d.ts.map +1 -0
- package/dist/i18n/createFilter.d.ts +57 -0
- package/dist/i18n/createFilter.d.ts.map +1 -0
- package/dist/i18n/createNumberFormatter.d.ts +43 -0
- package/dist/i18n/createNumberFormatter.d.ts.map +1 -0
- package/dist/i18n/createStringFormatter.d.ts +42 -0
- package/dist/i18n/createStringFormatter.d.ts.map +1 -0
- package/dist/i18n/index.d.ts +9 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/locale.d.ts +66 -0
- package/dist/i18n/locale.d.ts.map +1 -0
- package/dist/i18n/utils.d.ts +17 -0
- package/dist/i18n/utils.d.ts.map +1 -0
- package/dist/index.d.ts +50 -6135
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -5
- package/dist/index.js.map +7 -1
- package/dist/index.ssr.js +5 -5
- package/dist/index.ssr.js.map +7 -1
- package/dist/interactions/FocusableProvider.d.ts +26 -0
- package/dist/interactions/FocusableProvider.d.ts.map +1 -0
- package/dist/interactions/PressEvent.d.ts +73 -0
- package/dist/interactions/PressEvent.d.ts.map +1 -0
- package/dist/interactions/createFocus.d.ts +31 -0
- package/dist/interactions/createFocus.d.ts.map +1 -0
- package/dist/interactions/createFocusRing.d.ts +37 -0
- package/dist/interactions/createFocusRing.d.ts.map +1 -0
- package/dist/interactions/createFocusWithin.d.ts +27 -0
- package/dist/interactions/createFocusWithin.d.ts.map +1 -0
- package/dist/interactions/createFocusable.d.ts +65 -0
- package/dist/interactions/createFocusable.d.ts.map +1 -0
- package/dist/interactions/createHover.d.ts +43 -0
- package/dist/interactions/createHover.d.ts.map +1 -0
- package/dist/interactions/createInteractionModality.d.ts +73 -0
- package/dist/interactions/createInteractionModality.d.ts.map +1 -0
- package/dist/interactions/createKeyboard.d.ts +35 -0
- package/dist/interactions/createKeyboard.d.ts.map +1 -0
- package/dist/interactions/createLongPress.d.ts +63 -0
- package/dist/interactions/createLongPress.d.ts.map +1 -0
- package/dist/interactions/createMove.d.ts +40 -0
- package/dist/interactions/createMove.d.ts.map +1 -0
- package/dist/interactions/createPress.d.ts +55 -0
- package/dist/interactions/createPress.d.ts.map +1 -0
- package/dist/interactions/index.d.ts +13 -0
- package/dist/interactions/index.d.ts.map +1 -0
- package/dist/label/createField.d.ts +51 -0
- package/dist/label/createField.d.ts.map +1 -0
- package/dist/label/createLabel.d.ts +49 -0
- package/dist/label/createLabel.d.ts.map +1 -0
- package/dist/label/createLabels.d.ts +16 -0
- package/dist/label/createLabels.d.ts.map +1 -0
- package/dist/label/index.d.ts +6 -0
- package/dist/label/index.d.ts.map +1 -0
- package/dist/landmark/createLandmark.d.ts +79 -0
- package/dist/landmark/createLandmark.d.ts.map +1 -0
- package/dist/landmark/index.d.ts +2 -0
- package/dist/landmark/index.d.ts.map +1 -0
- package/dist/link/createLink.d.ts +65 -0
- package/dist/link/createLink.d.ts.map +1 -0
- package/dist/link/index.d.ts +2 -0
- package/dist/link/index.d.ts.map +1 -0
- package/dist/listbox/createListBox.d.ts +58 -0
- package/dist/listbox/createListBox.d.ts.map +1 -0
- package/dist/listbox/createOption.d.ts +42 -0
- package/dist/listbox/createOption.d.ts.map +1 -0
- package/dist/listbox/index.d.ts +3 -0
- package/dist/listbox/index.d.ts.map +1 -0
- package/dist/live-announcer/announce.d.ts +113 -0
- package/dist/live-announcer/announce.d.ts.map +1 -0
- package/dist/live-announcer/index.d.ts +2 -0
- package/dist/live-announcer/index.d.ts.map +1 -0
- package/dist/menu/createMenu.d.ts +57 -0
- package/dist/menu/createMenu.d.ts.map +1 -0
- package/dist/menu/createMenuItem.d.ts +42 -0
- package/dist/menu/createMenuItem.d.ts.map +1 -0
- package/dist/menu/createMenuTrigger.d.ts +29 -0
- package/dist/menu/createMenuTrigger.d.ts.map +1 -0
- package/dist/menu/index.d.ts +4 -0
- package/dist/menu/index.d.ts.map +1 -0
- package/dist/meter/createMeter.d.ts +44 -0
- package/dist/meter/createMeter.d.ts.map +1 -0
- package/dist/meter/index.d.ts +2 -0
- package/dist/meter/index.d.ts.map +1 -0
- package/dist/numberfield/createNumberField.d.ts +56 -0
- package/dist/numberfield/createNumberField.d.ts.map +1 -0
- package/dist/numberfield/index.d.ts +2 -0
- package/dist/numberfield/index.d.ts.map +1 -0
- package/dist/overlays/ariaHideOutside.d.ts +25 -0
- package/dist/overlays/ariaHideOutside.d.ts.map +1 -0
- package/dist/overlays/createInteractOutside.d.ts +20 -0
- package/dist/overlays/createInteractOutside.d.ts.map +1 -0
- package/dist/overlays/createModal.d.ts +70 -0
- package/dist/overlays/createModal.d.ts.map +1 -0
- package/dist/overlays/createOverlay.d.ts +43 -0
- package/dist/overlays/createOverlay.d.ts.map +1 -0
- package/dist/overlays/createOverlayTrigger.d.ts +30 -0
- package/dist/overlays/createOverlayTrigger.d.ts.map +1 -0
- package/dist/overlays/createPreventScroll.d.ts +15 -0
- package/dist/overlays/createPreventScroll.d.ts.map +1 -0
- package/dist/overlays/index.d.ts +7 -0
- package/dist/overlays/index.d.ts.map +1 -0
- package/dist/popover/calculatePosition.d.ts +67 -0
- package/dist/popover/calculatePosition.d.ts.map +1 -0
- package/dist/popover/createOverlayPosition.d.ts +109 -0
- package/dist/popover/createOverlayPosition.d.ts.map +1 -0
- package/dist/popover/createPopover.d.ts +88 -0
- package/dist/popover/createPopover.d.ts.map +1 -0
- package/dist/popover/index.d.ts +4 -0
- package/dist/popover/index.d.ts.map +1 -0
- package/dist/progress/createProgressBar.d.ts +47 -0
- package/dist/progress/createProgressBar.d.ts.map +1 -0
- package/dist/progress/index.d.ts +2 -0
- package/dist/progress/index.d.ts.map +1 -0
- package/dist/radio/createRadio.d.ts +68 -0
- package/dist/radio/createRadio.d.ts.map +1 -0
- package/dist/radio/createRadioGroup.d.ts +85 -0
- package/dist/radio/createRadioGroup.d.ts.map +1 -0
- package/dist/radio/createRadioGroupState.d.ts +77 -0
- package/dist/radio/createRadioGroupState.d.ts.map +1 -0
- package/dist/radio/index.d.ts +4 -0
- package/dist/radio/index.d.ts.map +1 -0
- package/dist/searchfield/createSearchField.d.ts +32 -0
- package/dist/searchfield/createSearchField.d.ts.map +1 -0
- package/dist/searchfield/index.d.ts +3 -0
- package/dist/searchfield/index.d.ts.map +1 -0
- package/dist/select/createHiddenSelect.d.ts +69 -0
- package/dist/select/createHiddenSelect.d.ts.map +1 -0
- package/dist/select/createSelect.d.ts +70 -0
- package/dist/select/createSelect.d.ts.map +1 -0
- package/dist/select/index.d.ts +3 -0
- package/dist/select/index.d.ts.map +1 -0
- package/dist/selection/createTypeSelect.d.ts +43 -0
- package/dist/selection/createTypeSelect.d.ts.map +1 -0
- package/dist/selection/index.d.ts +6 -0
- package/dist/selection/index.d.ts.map +1 -0
- package/dist/separator/createSeparator.d.ts +38 -0
- package/dist/separator/createSeparator.d.ts.map +1 -0
- package/dist/separator/index.d.ts +2 -0
- package/dist/separator/index.d.ts.map +1 -0
- package/dist/slider/createSlider.d.ts +43 -0
- package/dist/slider/createSlider.d.ts.map +1 -0
- package/dist/slider/index.d.ts +3 -0
- package/dist/slider/index.d.ts.map +1 -0
- package/dist/ssr/index.d.ts +221 -0
- package/dist/ssr/index.d.ts.map +1 -0
- package/dist/switch/createSwitch.d.ts +34 -0
- package/dist/switch/createSwitch.d.ts.map +1 -0
- package/dist/switch/index.d.ts +2 -0
- package/dist/switch/index.d.ts.map +1 -0
- package/dist/table/createTable.d.ts +24 -0
- package/dist/table/createTable.d.ts.map +1 -0
- package/dist/table/createTableCell.d.ts +12 -0
- package/dist/table/createTableCell.d.ts.map +1 -0
- package/dist/table/createTableColumnHeader.d.ts +12 -0
- package/dist/table/createTableColumnHeader.d.ts.map +1 -0
- package/dist/table/createTableHeaderRow.d.ts +12 -0
- package/dist/table/createTableHeaderRow.d.ts.map +1 -0
- package/dist/table/createTableRow.d.ts +12 -0
- package/dist/table/createTableRow.d.ts.map +1 -0
- package/dist/table/createTableRowGroup.d.ts +11 -0
- package/dist/table/createTableRowGroup.d.ts.map +1 -0
- package/dist/table/createTableSelectAllCheckbox.d.ts +12 -0
- package/dist/table/createTableSelectAllCheckbox.d.ts.map +1 -0
- package/dist/table/createTableSelectionCheckbox.d.ts +12 -0
- package/dist/table/createTableSelectionCheckbox.d.ts.map +1 -0
- package/dist/table/index.d.ts +14 -0
- package/dist/table/index.d.ts.map +1 -0
- package/dist/table/types.d.ts +150 -0
- package/dist/table/types.d.ts.map +1 -0
- package/dist/tabs/createTabs.d.ts +123 -0
- package/dist/tabs/createTabs.d.ts.map +1 -0
- package/dist/tabs/index.d.ts +2 -0
- package/dist/tabs/index.d.ts.map +1 -0
- package/dist/tag/createTag.d.ts +42 -0
- package/dist/tag/createTag.d.ts.map +1 -0
- package/dist/tag/createTagGroup.d.ts +54 -0
- package/dist/tag/createTagGroup.d.ts.map +1 -0
- package/dist/tag/index.d.ts +3 -0
- package/dist/tag/index.d.ts.map +1 -0
- package/dist/textfield/createTextField.d.ts +73 -0
- package/dist/textfield/createTextField.d.ts.map +1 -0
- package/dist/textfield/index.d.ts +2 -0
- package/dist/textfield/index.d.ts.map +1 -0
- package/dist/toast/createToast.d.ts +58 -0
- package/dist/toast/createToast.d.ts.map +1 -0
- package/dist/toast/createToastRegion.d.ts +49 -0
- package/dist/toast/createToastRegion.d.ts.map +1 -0
- package/dist/toast/index.d.ts +3 -0
- package/dist/toast/index.d.ts.map +1 -0
- package/dist/toggle/createToggle.d.ts +94 -0
- package/dist/toggle/createToggle.d.ts.map +1 -0
- package/dist/toggle/createToggleState.d.ts +34 -0
- package/dist/toggle/createToggleState.d.ts.map +1 -0
- package/dist/toggle/index.d.ts +5 -0
- package/dist/toggle/index.d.ts.map +1 -0
- package/dist/toolbar/createToolbar.d.ts +49 -0
- package/dist/toolbar/createToolbar.d.ts.map +1 -0
- package/dist/toolbar/index.d.ts +2 -0
- package/dist/toolbar/index.d.ts.map +1 -0
- package/dist/tooltip/createTooltip.d.ts +48 -0
- package/dist/tooltip/createTooltip.d.ts.map +1 -0
- package/dist/tooltip/createTooltipTrigger.d.ts +64 -0
- package/dist/tooltip/createTooltipTrigger.d.ts.map +1 -0
- package/dist/tooltip/index.d.ts +3 -0
- package/dist/tooltip/index.d.ts.map +1 -0
- package/dist/tree/createTree.d.ts +28 -0
- package/dist/tree/createTree.d.ts.map +1 -0
- package/dist/tree/createTreeItem.d.ts +12 -0
- package/dist/tree/createTreeItem.d.ts.map +1 -0
- package/dist/tree/createTreeSelectionCheckbox.d.ts +12 -0
- package/dist/tree/createTreeSelectionCheckbox.d.ts.map +1 -0
- package/dist/tree/index.d.ts +8 -0
- package/dist/tree/index.d.ts.map +1 -0
- package/dist/tree/types.d.ts +81 -0
- package/dist/tree/types.d.ts.map +1 -0
- package/dist/utils/createDescription.d.ts +56 -0
- package/dist/utils/createDescription.d.ts.map +1 -0
- package/dist/utils/dom.d.ts +68 -0
- package/dist/utils/dom.d.ts.map +1 -0
- package/dist/utils/env.d.ts +18 -0
- package/dist/utils/env.d.ts.map +1 -0
- package/dist/utils/events.d.ts +29 -0
- package/dist/utils/events.d.ts.map +1 -0
- package/dist/utils/filterDOMProps.d.ts +29 -0
- package/dist/utils/filterDOMProps.d.ts.map +1 -0
- package/dist/utils/focus.d.ts +20 -0
- package/dist/utils/focus.d.ts.map +1 -0
- package/dist/utils/geometry.d.ts +40 -0
- package/dist/utils/geometry.d.ts.map +1 -0
- package/dist/utils/globalListeners.d.ts +36 -0
- package/dist/utils/globalListeners.d.ts.map +1 -0
- package/dist/utils/index.d.ts +13 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/mergeProps.d.ts +11 -0
- package/dist/utils/mergeProps.d.ts.map +1 -0
- package/dist/utils/platform.d.ts +14 -0
- package/dist/utils/platform.d.ts.map +1 -0
- package/dist/utils/reactivity.d.ts +28 -0
- package/dist/utils/reactivity.d.ts.map +1 -0
- package/dist/utils/textSelection.d.ts +19 -0
- package/dist/utils/textSelection.d.ts.map +1 -0
- package/dist/visually-hidden/createVisuallyHidden.d.ts +60 -0
- package/dist/visually-hidden/createVisuallyHidden.d.ts.map +1 -0
- package/dist/visually-hidden/index.d.ts +2 -0
- package/dist/visually-hidden/index.d.ts.map +1 -0
- package/package.json +4 -5
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FocusableProvider - Provides DOM props to the nearest focusable child.
|
|
3
|
+
*
|
|
4
|
+
* This is a 1-1 port of React-Aria's FocusableProvider adapted for SolidJS.
|
|
5
|
+
*/
|
|
6
|
+
import { JSX, ParentComponent } from 'solid-js';
|
|
7
|
+
import { FocusableProviderProps } from './createFocusable';
|
|
8
|
+
/**
|
|
9
|
+
* Provides DOM props to the nearest focusable child.
|
|
10
|
+
* Used to pass focus-related props through component boundaries.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* import { FocusableProvider } from 'solidaria';
|
|
15
|
+
*
|
|
16
|
+
* function MyComponent() {
|
|
17
|
+
* return (
|
|
18
|
+
* <FocusableProvider onFocus={() => console.log('focused!')}>
|
|
19
|
+
* <NestedFocusableComponent />
|
|
20
|
+
* </FocusableProvider>
|
|
21
|
+
* );
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare const FocusableProvider: ParentComponent<FocusableProviderProps & JSX.HTMLAttributes<HTMLElement>>;
|
|
26
|
+
//# sourceMappingURL=FocusableProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FocusableProvider.d.ts","sourceRoot":"","sources":["../../src/interactions/FocusableProvider.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAA2C,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAEpG;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iBAAiB,EAAE,eAAe,CAC7C,sBAAsB,GAAG,GAAG,CAAC,cAAc,CAAC,WAAW,CAAC,CAgBzD,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PressEvent class that matches React-Aria's PressEvent interface.
|
|
3
|
+
* Wraps native events with press-specific data.
|
|
4
|
+
*/
|
|
5
|
+
export type PointerType = 'mouse' | 'pen' | 'touch' | 'keyboard' | 'virtual';
|
|
6
|
+
export type PressEventType = 'pressstart' | 'pressend' | 'pressup' | 'press';
|
|
7
|
+
/** Base event properties needed for press event creation */
|
|
8
|
+
export interface BaseEventForPress {
|
|
9
|
+
currentTarget: EventTarget | null;
|
|
10
|
+
shiftKey: boolean;
|
|
11
|
+
ctrlKey: boolean;
|
|
12
|
+
metaKey: boolean;
|
|
13
|
+
altKey: boolean;
|
|
14
|
+
clientX?: number;
|
|
15
|
+
clientY?: number;
|
|
16
|
+
}
|
|
17
|
+
export interface IPressEvent {
|
|
18
|
+
/** The type of press event being fired. */
|
|
19
|
+
type: PressEventType;
|
|
20
|
+
/** The pointer type that triggered the press event. */
|
|
21
|
+
pointerType: PointerType;
|
|
22
|
+
/** The target element of the press event. */
|
|
23
|
+
target: Element;
|
|
24
|
+
/** Whether the shift keyboard modifier was held during the press event. */
|
|
25
|
+
shiftKey: boolean;
|
|
26
|
+
/** Whether the ctrl keyboard modifier was held during the press event. */
|
|
27
|
+
ctrlKey: boolean;
|
|
28
|
+
/** Whether the meta keyboard modifier was held during the press event. */
|
|
29
|
+
metaKey: boolean;
|
|
30
|
+
/** Whether the alt keyboard modifier was held during the press event. */
|
|
31
|
+
altKey: boolean;
|
|
32
|
+
/** X position of the press relative to the target element. */
|
|
33
|
+
x: number;
|
|
34
|
+
/** Y position of the press relative to the target element. */
|
|
35
|
+
y: number;
|
|
36
|
+
/**
|
|
37
|
+
* By default, press events stop propagation to parent elements.
|
|
38
|
+
* Call continuePropagation() to allow the event to bubble up.
|
|
39
|
+
*/
|
|
40
|
+
continuePropagation(): void;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* PressEvent class that provides all press event data.
|
|
44
|
+
* Based on React-Aria's PressEvent implementation.
|
|
45
|
+
*/
|
|
46
|
+
export declare class PressEvent implements IPressEvent {
|
|
47
|
+
#private;
|
|
48
|
+
type: PressEventType;
|
|
49
|
+
pointerType: PointerType;
|
|
50
|
+
target: Element;
|
|
51
|
+
shiftKey: boolean;
|
|
52
|
+
ctrlKey: boolean;
|
|
53
|
+
metaKey: boolean;
|
|
54
|
+
altKey: boolean;
|
|
55
|
+
x: number;
|
|
56
|
+
y: number;
|
|
57
|
+
constructor(type: PressEventType, pointerType: PointerType, originalEvent: Event | null, target: Element | null);
|
|
58
|
+
/**
|
|
59
|
+
* Call this to allow the press event to propagate to parent elements.
|
|
60
|
+
* By default, press events stop propagation.
|
|
61
|
+
*/
|
|
62
|
+
continuePropagation(): void;
|
|
63
|
+
/**
|
|
64
|
+
* Whether the event should stop propagation.
|
|
65
|
+
* Used internally by the press handler.
|
|
66
|
+
*/
|
|
67
|
+
get shouldStopPropagation(): boolean;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Creates a PressEvent from a native event.
|
|
71
|
+
*/
|
|
72
|
+
export declare function createPressEvent(type: PressEventType, pointerType: PointerType, originalEvent: BaseEventForPress | Event | null, target: Element | null): PressEvent;
|
|
73
|
+
//# sourceMappingURL=PressEvent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PressEvent.d.ts","sourceRoot":"","sources":["../../src/interactions/PressEvent.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,KAAK,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAC;AAC7E,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC;AAE7E,4DAA4D;AAC5D,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,WAAW,GAAG,IAAI,CAAC;IAClC,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,2CAA2C;IAC3C,IAAI,EAAE,cAAc,CAAC;IACrB,uDAAuD;IACvD,WAAW,EAAE,WAAW,CAAC;IACzB,6CAA6C;IAC7C,MAAM,EAAE,OAAO,CAAC;IAChB,2EAA2E;IAC3E,QAAQ,EAAE,OAAO,CAAC;IAClB,0EAA0E;IAC1E,OAAO,EAAE,OAAO,CAAC;IACjB,0EAA0E;IAC1E,OAAO,EAAE,OAAO,CAAC;IACjB,yEAAyE;IACzE,MAAM,EAAE,OAAO,CAAC;IAChB,8DAA8D;IAC9D,CAAC,EAAE,MAAM,CAAC;IACV,8DAA8D;IAC9D,CAAC,EAAE,MAAM,CAAC;IACV;;;OAGG;IACH,mBAAmB,IAAI,IAAI,CAAC;CAC7B;AAED;;;GAGG;AACH,qBAAa,UAAW,YAAW,WAAW;;IAC5C,IAAI,EAAE,cAAc,CAAC;IACrB,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;gBAKR,IAAI,EAAE,cAAc,EACpB,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,KAAK,GAAG,IAAI,EAC3B,MAAM,EAAE,OAAO,GAAG,IAAI;IA8BxB;;;OAGG;IACH,mBAAmB,IAAI,IAAI;IAI3B;;;OAGG;IACH,IAAI,qBAAqB,IAAI,OAAO,CAEnC;CACF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,cAAc,EACpB,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,iBAAiB,GAAG,KAAK,GAAG,IAAI,EAC/C,MAAM,EAAE,OAAO,GAAG,IAAI,GACrB,UAAU,CAEZ"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createFocus - Handles focus events for the immediate target.
|
|
3
|
+
*
|
|
4
|
+
* This is a 1-1 port of React-Aria's useFocus hook adapted for SolidJS.
|
|
5
|
+
* Focus events on child elements will be ignored.
|
|
6
|
+
*/
|
|
7
|
+
import { JSX } from 'solid-js';
|
|
8
|
+
export interface FocusEvents {
|
|
9
|
+
/** Handler that is called when the element receives focus. */
|
|
10
|
+
onFocus?: (e: FocusEvent) => void;
|
|
11
|
+
/** Handler that is called when the element loses focus. */
|
|
12
|
+
onBlur?: (e: FocusEvent) => void;
|
|
13
|
+
/** Handler that is called when the element's focus status changes. */
|
|
14
|
+
onFocusChange?: (isFocused: boolean) => void;
|
|
15
|
+
}
|
|
16
|
+
export interface CreateFocusProps extends FocusEvents {
|
|
17
|
+
/** Whether the focus events should be disabled. */
|
|
18
|
+
isDisabled?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface FocusResult {
|
|
21
|
+
/** Props to spread onto the target element. */
|
|
22
|
+
focusProps: JSX.HTMLAttributes<HTMLElement>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Handles focus events for the immediate target.
|
|
26
|
+
* Focus events on child elements will be ignored.
|
|
27
|
+
*
|
|
28
|
+
* Based on react-aria's useFocus but adapted for SolidJS.
|
|
29
|
+
*/
|
|
30
|
+
export declare function createFocus(props?: CreateFocusProps): FocusResult;
|
|
31
|
+
//# sourceMappingURL=createFocus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createFocus.d.ts","sourceRoot":"","sources":["../../src/interactions/createFocus.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAa,MAAM,UAAU,CAAC;AAU1C,MAAM,WAAW,WAAW;IAC1B,8DAA8D;IAC9D,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IAClC,2DAA2D;IAC3D,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACjC,sEAAsE;IACtE,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9C;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,mDAAmD;IACnD,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B,+CAA+C;IAC/C,UAAU,EAAE,GAAG,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;CAC7C;AA0DD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,GAAE,gBAAqB,GAAG,WAAW,CAgErE"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createFocusRing hook for Solidaria
|
|
3
|
+
*
|
|
4
|
+
* Determines whether a focus ring should be visible for a given element.
|
|
5
|
+
* Focus rings are visible when the user navigates with keyboard, but hidden
|
|
6
|
+
* when using mouse/touch.
|
|
7
|
+
*
|
|
8
|
+
* Port of @react-aria/focus useFocusRing.
|
|
9
|
+
*/
|
|
10
|
+
import { type JSX, type Accessor } from 'solid-js';
|
|
11
|
+
export interface FocusRingProps {
|
|
12
|
+
/** Whether the element is a text input. */
|
|
13
|
+
isTextInput?: boolean;
|
|
14
|
+
/** Whether the element will be auto focused. */
|
|
15
|
+
autoFocus?: boolean;
|
|
16
|
+
/** Whether focus should be tracked within the element. */
|
|
17
|
+
within?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface FocusRingResult {
|
|
20
|
+
/** Whether the element is currently focused. */
|
|
21
|
+
isFocused: Accessor<boolean>;
|
|
22
|
+
/** Whether the focus ring should be visible. */
|
|
23
|
+
isFocusVisible: Accessor<boolean>;
|
|
24
|
+
/** Props to spread on the element to track focus. */
|
|
25
|
+
focusProps: JSX.HTMLAttributes<HTMLElement>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Determines whether a focus ring should be visible for a given element.
|
|
29
|
+
*
|
|
30
|
+
* Focus rings are visible when:
|
|
31
|
+
* - The element is focused AND
|
|
32
|
+
* - The user is navigating with keyboard (not mouse/touch)
|
|
33
|
+
*
|
|
34
|
+
* For text inputs, focus rings are always visible when focused.
|
|
35
|
+
*/
|
|
36
|
+
export declare function createFocusRing(props?: FocusRingProps): FocusRingResult;
|
|
37
|
+
//# sourceMappingURL=createFocusRing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createFocusRing.d.ts","sourceRoot":"","sources":["../../src/interactions/createFocusRing.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,QAAQ,EAAqD,MAAM,UAAU,CAAC;AAYtG,MAAM,WAAW,cAAc;IAC7B,2CAA2C;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gDAAgD;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0DAA0D;IAC1D,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,gDAAgD;IAChD,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC7B,gDAAgD;IAChD,cAAc,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IAClC,qDAAqD;IACrD,UAAU,EAAE,GAAG,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;CAC7C;AAMD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,KAAK,GAAE,cAAmB,GAAG,eAAe,CAmC3E"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createFocusWithin - Handles focus events for the target and its descendants.
|
|
3
|
+
*
|
|
4
|
+
* This is a 1-1 port of React-Aria's useFocusWithin hook adapted for SolidJS.
|
|
5
|
+
*/
|
|
6
|
+
import { JSX } from 'solid-js';
|
|
7
|
+
export interface FocusWithinProps {
|
|
8
|
+
/** Whether the focus within events should be disabled. */
|
|
9
|
+
isDisabled?: boolean;
|
|
10
|
+
/** Handler that is called when the target element or a descendant receives focus. */
|
|
11
|
+
onFocusWithin?: (e: FocusEvent) => void;
|
|
12
|
+
/** Handler that is called when the target element and all descendants lose focus. */
|
|
13
|
+
onBlurWithin?: (e: FocusEvent) => void;
|
|
14
|
+
/** Handler that is called when the focus within state changes. */
|
|
15
|
+
onFocusWithinChange?: (isFocusWithin: boolean) => void;
|
|
16
|
+
}
|
|
17
|
+
export interface FocusWithinResult {
|
|
18
|
+
/** Props to spread onto the target element. */
|
|
19
|
+
focusWithinProps: JSX.HTMLAttributes<HTMLElement>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Handles focus events for the target and its descendants.
|
|
23
|
+
*
|
|
24
|
+
* Based on react-aria's useFocusWithin but adapted for SolidJS.
|
|
25
|
+
*/
|
|
26
|
+
export declare function createFocusWithin(props?: FocusWithinProps): FocusWithinResult;
|
|
27
|
+
//# sourceMappingURL=createFocusWithin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createFocusWithin.d.ts","sourceRoot":"","sources":["../../src/interactions/createFocusWithin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,GAAG,EAAa,MAAM,UAAU,CAAC;AAI1C,MAAM,WAAW,gBAAgB;IAC/B,0DAA0D;IAC1D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qFAAqF;IACrF,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACxC,qFAAqF;IACrF,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACvC,kEAAkE;IAClE,mBAAmB,CAAC,EAAE,CAAC,aAAa,EAAE,OAAO,KAAK,IAAI,CAAC;CACxD;AAED,MAAM,WAAW,iBAAiB;IAChC,+CAA+C;IAC/C,gBAAgB,EAAE,GAAG,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;CACnD;AA2DD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,GAAE,gBAAqB,GAAG,iBAAiB,CAqHjF"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createFocusable - Makes an element focusable and capable of auto focus.
|
|
3
|
+
*
|
|
4
|
+
* This is a 1-1 port of React-Aria's useFocusable hook adapted for SolidJS.
|
|
5
|
+
*/
|
|
6
|
+
import { JSX, Accessor } from 'solid-js';
|
|
7
|
+
import { type FocusEvents } from './createFocus';
|
|
8
|
+
import { type KeyboardEvents } from './createKeyboard';
|
|
9
|
+
export interface FocusableDOMProps {
|
|
10
|
+
/** Whether to exclude the element from the sequential tab order. */
|
|
11
|
+
excludeFromTabOrder?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface FocusableProps extends FocusEvents, KeyboardEvents {
|
|
14
|
+
/** Whether the element should receive focus on mount. */
|
|
15
|
+
autoFocus?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface CreateFocusableProps extends FocusableProps, FocusableDOMProps {
|
|
18
|
+
/** Whether focus should be disabled. */
|
|
19
|
+
isDisabled?: Accessor<boolean> | boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface FocusableResult {
|
|
22
|
+
/** Props to spread on the focusable element. */
|
|
23
|
+
focusableProps: JSX.HTMLAttributes<HTMLElement>;
|
|
24
|
+
}
|
|
25
|
+
export interface FocusableContextValue {
|
|
26
|
+
ref?: (el: HTMLElement) => void;
|
|
27
|
+
[key: string]: unknown;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Context for passing focusable props to nested focusable children.
|
|
31
|
+
* Used by FocusableProvider to pass DOM props to the nearest focusable child.
|
|
32
|
+
*/
|
|
33
|
+
export declare const FocusableContext: import("solid-js").Context<FocusableContextValue | null>;
|
|
34
|
+
export interface FocusableProviderProps {
|
|
35
|
+
/** The child element to provide DOM props to. */
|
|
36
|
+
children?: JSX.Element;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Makes an element focusable, handling disabled state and tab order.
|
|
40
|
+
* Provides focus state tracking and autoFocus support.
|
|
41
|
+
*
|
|
42
|
+
* Based on react-aria's useFocusable but adapted for SolidJS.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* import { createFocusable } from 'solidaria';
|
|
47
|
+
*
|
|
48
|
+
* function FocusableInput(props) {
|
|
49
|
+
* let ref;
|
|
50
|
+
* const { focusableProps } = createFocusable({
|
|
51
|
+
* autoFocus: props.autoFocus,
|
|
52
|
+
* onFocusChange: (focused) => console.log('Focus:', focused),
|
|
53
|
+
* });
|
|
54
|
+
*
|
|
55
|
+
* return (
|
|
56
|
+
* <input
|
|
57
|
+
* {...focusableProps}
|
|
58
|
+
* ref={(el) => { ref = el; focusableProps.ref?.(el); }}
|
|
59
|
+
* />
|
|
60
|
+
* );
|
|
61
|
+
* }
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export declare function createFocusable(props?: CreateFocusableProps, ref?: (el: HTMLElement) => void): FocusableResult;
|
|
65
|
+
//# sourceMappingURL=createFocusable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createFocusable.d.ts","sourceRoot":"","sources":["../../src/interactions/createFocusable.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAsC,MAAM,UAAU,CAAC;AAC7E,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvE,MAAM,WAAW,iBAAiB;IAChC,oEAAoE;IACpE,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,cAAe,SAAQ,WAAW,EAAE,cAAc;IACjE,yDAAyD;IACzD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,oBAAqB,SAAQ,cAAc,EAAE,iBAAiB;IAC7E,wCAAwC;IACxC,UAAU,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;CAC1C;AAED,MAAM,WAAW,eAAe;IAC9B,gDAAgD;IAChD,cAAc,EAAE,GAAG,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;CACjD;AAID,MAAM,WAAW,qBAAqB;IACpC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,CAAC;IAChC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,0DAAoD,CAAC;AA0BlF,MAAM,WAAW,sBAAsB;IACrC,iDAAiD;IACjD,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;CACxB;AASD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,eAAe,CAC7B,KAAK,GAAE,oBAAyB,EAChC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,GAC9B,eAAe,CA0DjB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createHover hook for Solidaria
|
|
3
|
+
*
|
|
4
|
+
* Handles pointer hover interactions for an element. Normalizes behavior
|
|
5
|
+
* across browsers and platforms, and ignores emulated mouse events on touch devices.
|
|
6
|
+
*
|
|
7
|
+
* Port of @react-aria/interactions useHover.
|
|
8
|
+
*/
|
|
9
|
+
import { type JSX, type Accessor } from 'solid-js';
|
|
10
|
+
import { type MaybeAccessor } from '../utils/reactivity';
|
|
11
|
+
export interface HoverEvent {
|
|
12
|
+
/** The type of hover event being fired. */
|
|
13
|
+
type: 'hoverstart' | 'hoverend';
|
|
14
|
+
/** The pointer type that triggered the hover event. */
|
|
15
|
+
pointerType: 'mouse' | 'pen';
|
|
16
|
+
/** The target element of the hover event. */
|
|
17
|
+
target: Element;
|
|
18
|
+
}
|
|
19
|
+
export interface HoverEvents {
|
|
20
|
+
/** Handler called when the hover starts. */
|
|
21
|
+
onHoverStart?: (e: HoverEvent) => void;
|
|
22
|
+
/** Handler called when the hover ends. */
|
|
23
|
+
onHoverEnd?: (e: HoverEvent) => void;
|
|
24
|
+
/** Handler called when the hover state changes. */
|
|
25
|
+
onHoverChange?: (isHovering: boolean) => void;
|
|
26
|
+
}
|
|
27
|
+
export interface CreateHoverProps extends HoverEvents {
|
|
28
|
+
/** Whether the hover events should be disabled. */
|
|
29
|
+
isDisabled?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/** Event handler props returned by createHover - safe to spread on any element */
|
|
32
|
+
export type HoverProps = Pick<JSX.HTMLAttributes<HTMLElement>, 'onPointerEnter' | 'onPointerLeave' | 'onPointerOver' | 'onPointerOut' | 'onMouseEnter' | 'onMouseLeave'>;
|
|
33
|
+
export interface HoverResult {
|
|
34
|
+
/** Props to spread on the target element. */
|
|
35
|
+
hoverProps: HoverProps;
|
|
36
|
+
/** Whether the element is currently hovered. */
|
|
37
|
+
isHovered: Accessor<boolean>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Handles pointer hover interactions for an element.
|
|
41
|
+
*/
|
|
42
|
+
export declare function createHover(props?: MaybeAccessor<CreateHoverProps>): HoverResult;
|
|
43
|
+
//# sourceMappingURL=createHover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createHover.d.ts","sourceRoot":"","sources":["../../src/interactions/createHover.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,QAAQ,EAAqD,MAAM,UAAU,CAAC;AACtG,OAAO,EAAE,KAAK,aAAa,EAAU,MAAM,qBAAqB,CAAC;AAQjE,MAAM,WAAW,UAAU;IACzB,2CAA2C;IAC3C,IAAI,EAAE,YAAY,GAAG,UAAU,CAAC;IAChC,uDAAuD;IACvD,WAAW,EAAE,OAAO,GAAG,KAAK,CAAC;IAC7B,6CAA6C;IAC7C,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,4CAA4C;IAC5C,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACvC,0CAA0C;IAC1C,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACrC,mDAAmD;IACnD,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/C;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,mDAAmD;IACnD,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,kFAAkF;AAClF,MAAM,MAAM,UAAU,GAAG,IAAI,CAC3B,GAAG,CAAC,cAAc,CAAC,WAAW,CAAC,EAC7B,gBAAgB,GAChB,gBAAgB,GAChB,eAAe,GACf,cAAc,GACd,cAAc,GACd,cAAc,CACjB,CAAC;AAEF,MAAM,WAAW,WAAW;IAC1B,6CAA6C;IAC7C,UAAU,EAAE,UAAU,CAAC;IACvB,gDAAgD;IAChD,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;CAC9B;AAwDD;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,GAAE,aAAa,CAAC,gBAAgB,CAAM,GAAG,WAAW,CAyIpF"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createInteractionModality + focus-visible tracking for solidaria
|
|
3
|
+
*
|
|
4
|
+
* Port of @react-aria/interactions useFocusVisible/useInteractionModality.
|
|
5
|
+
* Tracks the current interaction modality (keyboard, pointer, or virtual) and
|
|
6
|
+
* provides focus-visible state and listeners.
|
|
7
|
+
*/
|
|
8
|
+
import { type Accessor } from 'solid-js';
|
|
9
|
+
export type Modality = 'keyboard' | 'pointer' | 'virtual';
|
|
10
|
+
export type PointerType = 'mouse' | 'pen' | 'touch' | 'keyboard' | 'virtual';
|
|
11
|
+
export type FocusVisibleHandler = (isFocusVisible: boolean) => void;
|
|
12
|
+
export interface FocusVisibleProps {
|
|
13
|
+
/** Whether the element is a text input. */
|
|
14
|
+
isTextInput?: boolean;
|
|
15
|
+
/** Whether the element will be auto focused. */
|
|
16
|
+
autoFocus?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface FocusVisibleResult {
|
|
19
|
+
/** Whether keyboard focus is visible globally. */
|
|
20
|
+
isFocusVisible: Accessor<boolean>;
|
|
21
|
+
}
|
|
22
|
+
export interface InteractionModalityResult {
|
|
23
|
+
/** The current interaction modality. */
|
|
24
|
+
modality: Accessor<Modality | null>;
|
|
25
|
+
}
|
|
26
|
+
export declare let hasSetupGlobalListeners: Map<Window, {
|
|
27
|
+
focus: typeof window.HTMLElement.prototype.focus;
|
|
28
|
+
canOverride: boolean;
|
|
29
|
+
}>;
|
|
30
|
+
/**
|
|
31
|
+
* Adds a window (i.e. iframe) to the list of windows that are being tracked for focus visible.
|
|
32
|
+
*/
|
|
33
|
+
export declare function addWindowFocusTracking(element?: HTMLElement | null): () => void;
|
|
34
|
+
export declare function setupGlobalFocusListeners(): void;
|
|
35
|
+
/**
|
|
36
|
+
* If true, keyboard focus is visible.
|
|
37
|
+
*/
|
|
38
|
+
export declare function isFocusVisible(): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Gets the current interaction modality.
|
|
41
|
+
*/
|
|
42
|
+
export declare function getInteractionModality(): Modality | null;
|
|
43
|
+
/**
|
|
44
|
+
* Sets the current interaction modality.
|
|
45
|
+
*/
|
|
46
|
+
export declare function setInteractionModality(modality: Modality): void;
|
|
47
|
+
/**
|
|
48
|
+
* Gets the current pointer type.
|
|
49
|
+
*/
|
|
50
|
+
export declare function getPointerType(): PointerType;
|
|
51
|
+
/**
|
|
52
|
+
* Listens for trigger change and reports if focus is visible.
|
|
53
|
+
*/
|
|
54
|
+
export declare function createFocusVisibleListener(handler: FocusVisibleHandler, opts?: {
|
|
55
|
+
isTextInput?: boolean;
|
|
56
|
+
}): () => void;
|
|
57
|
+
/**
|
|
58
|
+
* Manages focus visible state for the page.
|
|
59
|
+
*/
|
|
60
|
+
export declare function createFocusVisible(props?: FocusVisibleProps): FocusVisibleResult;
|
|
61
|
+
/**
|
|
62
|
+
* Tracks the current interaction modality.
|
|
63
|
+
*/
|
|
64
|
+
export declare function createInteractionModality(): InteractionModalityResult;
|
|
65
|
+
/**
|
|
66
|
+
* Adds a listener for modality changes.
|
|
67
|
+
*/
|
|
68
|
+
export declare function addModalityListener(handler: (modality: Modality) => void): () => void;
|
|
69
|
+
/**
|
|
70
|
+
* Hook to track whether the user is currently interacting with the keyboard.
|
|
71
|
+
*/
|
|
72
|
+
export declare function useIsKeyboardFocused(): Accessor<boolean>;
|
|
73
|
+
//# sourceMappingURL=createInteractionModality.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createInteractionModality.d.ts","sourceRoot":"","sources":["../../src/interactions/createInteractionModality.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,KAAK,QAAQ,EAAyC,MAAM,UAAU,CAAC;AAQhF,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;AAC1D,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,KAAK,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAC;AAI7E,MAAM,MAAM,mBAAmB,GAAG,CAAC,cAAc,EAAE,OAAO,KAAK,IAAI,CAAC;AAEpE,MAAM,WAAW,iBAAiB;IAChC,2CAA2C;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gDAAgD;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,kDAAkD;IAClD,cAAc,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,yBAAyB;IACxC,wCAAwC;IACxC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;CACrC;AAUD,eAAO,IAAI,uBAAuB,EAAE,GAAG,CACrC,MAAM,EACN;IAAE,KAAK,EAAE,OAAO,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,KAAK,CAAC;IAAC,WAAW,EAAE,OAAO,CAAA;CAAE,CAC/D,CAAC;AAoLd;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI,GAAG,MAAM,IAAI,CAc/E;AAED,wBAAgB,yBAAyB,IAAI,IAAI,CAEhD;AAMD;;GAEG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,QAAQ,GAAG,IAAI,CAExD;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAI/D;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAE5C;AA+CD;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,mBAAmB,EAC5B,IAAI,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,GAC/B,MAAM,IAAI,CAYZ;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,GAAE,iBAAsB,GAAG,kBAAkB,CAcpF;AAED;;GAEG;AACH,wBAAgB,yBAAyB,IAAI,yBAAyB,CAuBrE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,GAAG,MAAM,IAAI,CAQrF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,QAAQ,CAAC,OAAO,CAAC,CAOxD"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createKeyboard - Handles keyboard interactions for a focusable element.
|
|
3
|
+
*
|
|
4
|
+
* This is a 1-1 port of React-Aria's useKeyboard hook adapted for SolidJS.
|
|
5
|
+
*/
|
|
6
|
+
import { JSX } from 'solid-js';
|
|
7
|
+
/**
|
|
8
|
+
* Keyboard event with continuePropagation support.
|
|
9
|
+
* By default, keyboard events stop propagation.
|
|
10
|
+
*/
|
|
11
|
+
export interface KeyboardEvent extends globalThis.KeyboardEvent {
|
|
12
|
+
/** Call this to allow the event to propagate to parent elements. */
|
|
13
|
+
continuePropagation(): void;
|
|
14
|
+
}
|
|
15
|
+
export interface KeyboardEvents {
|
|
16
|
+
/** Handler that is called when a key is pressed. */
|
|
17
|
+
onKeyDown?: (e: KeyboardEvent) => void;
|
|
18
|
+
/** Handler that is called when a key is released. */
|
|
19
|
+
onKeyUp?: (e: KeyboardEvent) => void;
|
|
20
|
+
}
|
|
21
|
+
export interface CreateKeyboardProps extends KeyboardEvents {
|
|
22
|
+
/** Whether the keyboard events should be disabled. */
|
|
23
|
+
isDisabled?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface KeyboardResult {
|
|
26
|
+
/** Props to spread onto the target element. */
|
|
27
|
+
keyboardProps: JSX.HTMLAttributes<HTMLElement>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Handles keyboard interactions for a focusable element.
|
|
31
|
+
*
|
|
32
|
+
* Based on react-aria's useKeyboard but adapted for SolidJS.
|
|
33
|
+
*/
|
|
34
|
+
export declare function createKeyboard(props?: CreateKeyboardProps): KeyboardResult;
|
|
35
|
+
//# sourceMappingURL=createKeyboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createKeyboard.d.ts","sourceRoot":"","sources":["../../src/interactions/createKeyboard.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,UAAU,CAAC,aAAa;IAC7D,oEAAoE;IACpE,mBAAmB,IAAI,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,cAAc;IAC7B,oDAAoD;IACpD,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,aAAa,KAAK,IAAI,CAAC;IACvC,qDAAqD;IACrD,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,aAAa,KAAK,IAAI,CAAC;CACtC;AAED,MAAM,WAAW,mBAAoB,SAAQ,cAAc;IACzD,sDAAsD;IACtD,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,+CAA+C;IAC/C,aAAa,EAAE,GAAG,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;CAChD;AA+BD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,GAAE,mBAAwB,GAAG,cAAc,CAa9E"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createLongPress - Handles long press interactions across mouse and touch.
|
|
3
|
+
*
|
|
4
|
+
* Port of @react-aria/interactions useLongPress, adapted for SolidJS.
|
|
5
|
+
*/
|
|
6
|
+
import { JSX } from 'solid-js';
|
|
7
|
+
import { type PressEvent } from './createPress';
|
|
8
|
+
import { type MaybeAccessor } from '../utils/reactivity';
|
|
9
|
+
export interface LongPressEvent {
|
|
10
|
+
/** The type of long press event being fired. */
|
|
11
|
+
type: 'longpressstart' | 'longpressend' | 'longpress';
|
|
12
|
+
/** The pointer type that triggered the long press. */
|
|
13
|
+
pointerType: PressEvent['pointerType'];
|
|
14
|
+
/** The target element of the long press event. */
|
|
15
|
+
target: Element;
|
|
16
|
+
/** Whether the shift keyboard modifier was held during the long press event. */
|
|
17
|
+
shiftKey: boolean;
|
|
18
|
+
/** Whether the ctrl keyboard modifier was held during the long press event. */
|
|
19
|
+
ctrlKey: boolean;
|
|
20
|
+
/** Whether the meta keyboard modifier was held during the long press event. */
|
|
21
|
+
metaKey: boolean;
|
|
22
|
+
/** Whether the alt keyboard modifier was held during the long press event. */
|
|
23
|
+
altKey: boolean;
|
|
24
|
+
/** X position relative to the target. */
|
|
25
|
+
x: number;
|
|
26
|
+
/** Y position relative to the target. */
|
|
27
|
+
y: number;
|
|
28
|
+
}
|
|
29
|
+
export interface LongPressProps {
|
|
30
|
+
/** Whether long press events should be disabled. */
|
|
31
|
+
isDisabled?: MaybeAccessor<boolean>;
|
|
32
|
+
/** Handler that is called when a long press interaction starts. */
|
|
33
|
+
onLongPressStart?: (e: LongPressEvent) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Handler that is called when a long press interaction ends, either
|
|
36
|
+
* over the target or when the pointer leaves the target.
|
|
37
|
+
*/
|
|
38
|
+
onLongPressEnd?: (e: LongPressEvent) => void;
|
|
39
|
+
/**
|
|
40
|
+
* Handler that is called when the threshold time is met while
|
|
41
|
+
* the press is over the target.
|
|
42
|
+
*/
|
|
43
|
+
onLongPress?: (e: LongPressEvent) => void;
|
|
44
|
+
/**
|
|
45
|
+
* The amount of time in milliseconds to wait before triggering a long press.
|
|
46
|
+
* @default 500ms
|
|
47
|
+
*/
|
|
48
|
+
threshold?: number;
|
|
49
|
+
/**
|
|
50
|
+
* A description for assistive technology users indicating that a long press
|
|
51
|
+
* action is available, e.g. "Long press to open menu".
|
|
52
|
+
*/
|
|
53
|
+
accessibilityDescription?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface LongPressResult {
|
|
56
|
+
/** Props to spread on the target element. */
|
|
57
|
+
longPressProps: JSX.HTMLAttributes<HTMLElement>;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Handles long press interactions across mouse and touch devices.
|
|
61
|
+
*/
|
|
62
|
+
export declare function createLongPress(props?: LongPressProps): LongPressResult;
|
|
63
|
+
//# sourceMappingURL=createLongPress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createLongPress.d.ts","sourceRoot":"","sources":["../../src/interactions/createLongPress.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,GAAG,EAAa,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAG7D,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,WAAW,cAAc;IAC7B,gDAAgD;IAChD,IAAI,EAAE,gBAAgB,GAAG,cAAc,GAAG,WAAW,CAAC;IACtD,sDAAsD;IACtD,WAAW,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC;IACvC,kDAAkD;IAClD,MAAM,EAAE,OAAO,CAAC;IAChB,gFAAgF;IAChF,QAAQ,EAAE,OAAO,CAAC;IAClB,+EAA+E;IAC/E,OAAO,EAAE,OAAO,CAAC;IACjB,+EAA+E;IAC/E,OAAO,EAAE,OAAO,CAAC;IACjB,8EAA8E;IAC9E,MAAM,EAAE,OAAO,CAAC;IAChB,yCAAyC;IACzC,CAAC,EAAE,MAAM,CAAC;IACV,yCAAyC;IACzC,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,cAAc;IAC7B,oDAAoD;IACpD,UAAU,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IACpC,mEAAmE;IACnE,gBAAgB,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAC/C;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7C;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAC1C;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED,MAAM,WAAW,eAAe;IAC9B,6CAA6C;IAC7C,cAAc,EAAE,GAAG,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;CACjD;AAsBD;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,GAAE,cAAmB,GAAG,eAAe,CAqF3E"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createMove - Handles move interactions across mouse, touch, pointer, and keyboard.
|
|
3
|
+
*
|
|
4
|
+
* Port of @react-aria/interactions useMove, adapted for SolidJS.
|
|
5
|
+
*/
|
|
6
|
+
import { JSX } from 'solid-js';
|
|
7
|
+
export type PointerType = 'mouse' | 'pen' | 'touch' | 'keyboard';
|
|
8
|
+
interface BaseMoveEvent {
|
|
9
|
+
pointerType: PointerType;
|
|
10
|
+
shiftKey: boolean;
|
|
11
|
+
ctrlKey: boolean;
|
|
12
|
+
metaKey: boolean;
|
|
13
|
+
altKey: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface MoveStartEvent extends BaseMoveEvent {
|
|
16
|
+
type: 'movestart';
|
|
17
|
+
}
|
|
18
|
+
export interface MoveMoveEvent extends BaseMoveEvent {
|
|
19
|
+
type: 'move';
|
|
20
|
+
deltaX: number;
|
|
21
|
+
deltaY: number;
|
|
22
|
+
}
|
|
23
|
+
export interface MoveEndEvent extends BaseMoveEvent {
|
|
24
|
+
type: 'moveend';
|
|
25
|
+
}
|
|
26
|
+
export interface MoveEvents {
|
|
27
|
+
onMoveStart?: (e: MoveStartEvent) => void;
|
|
28
|
+
onMove?: (e: MoveMoveEvent) => void;
|
|
29
|
+
onMoveEnd?: (e: MoveEndEvent) => void;
|
|
30
|
+
}
|
|
31
|
+
export interface MoveResult {
|
|
32
|
+
/** Props to spread on the target element. */
|
|
33
|
+
moveProps: JSX.HTMLAttributes<HTMLElement>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Handles move interactions across mouse, touch, pointer, and keyboard.
|
|
37
|
+
*/
|
|
38
|
+
export declare function createMove(props?: MoveEvents): MoveResult;
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=createMove.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createMove.d.ts","sourceRoot":"","sources":["../../src/interactions/createMove.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,GAAG,EAAyC,MAAM,UAAU,CAAC;AAGtE,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,KAAK,GAAG,OAAO,GAAG,UAAU,CAAC;AAEjE,UAAU,aAAa;IACrB,WAAW,EAAE,WAAW,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,cAAe,SAAQ,aAAa;IACnD,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,MAAM,WAAW,aAAc,SAAQ,aAAa;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAa,SAAQ,aAAa;IACjD,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAC1C,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,aAAa,KAAK,IAAI,CAAC;IACpC,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,YAAY,KAAK,IAAI,CAAC;CACvC;AAED,MAAM,WAAW,UAAU;IACzB,6CAA6C;IAC7C,SAAS,EAAE,GAAG,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;CAC5C;AAqBD;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,GAAE,UAAe,GAAG,UAAU,CA8N7D"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createPress - Handles press interactions across mouse, touch, keyboard, and virtual clicks.
|
|
3
|
+
*
|
|
4
|
+
* This is a 1-1 port of React-Aria's usePress hook adapted for SolidJS.
|
|
5
|
+
* All behaviors, edge cases, and platform-specific handling are preserved.
|
|
6
|
+
*/
|
|
7
|
+
import { JSX, Accessor } from 'solid-js';
|
|
8
|
+
import { PressEvent } from './PressEvent';
|
|
9
|
+
export { PressEvent, type PointerType } from './PressEvent';
|
|
10
|
+
export type { IPressEvent, PressEventType } from './PressEvent';
|
|
11
|
+
export interface CreatePressProps {
|
|
12
|
+
/** Whether the target is currently disabled. */
|
|
13
|
+
isDisabled?: Accessor<boolean> | boolean;
|
|
14
|
+
/** Handler called when the press is released over the target. */
|
|
15
|
+
onPress?: (e: PressEvent) => void;
|
|
16
|
+
/** Handler called when a press interaction starts. */
|
|
17
|
+
onPressStart?: (e: PressEvent) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Handler called when a press interaction ends, either
|
|
20
|
+
* over the target or when the pointer leaves the target.
|
|
21
|
+
*/
|
|
22
|
+
onPressEnd?: (e: PressEvent) => void;
|
|
23
|
+
/** Handler called when a press is released over the target, regardless of whether it started on the target. */
|
|
24
|
+
onPressUp?: (e: PressEvent) => void;
|
|
25
|
+
/** Handler called when the press state changes. */
|
|
26
|
+
onPressChange?: (isPressed: boolean) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Handler called on native click event.
|
|
29
|
+
* Some third-party libraries pass onClick instead of onPress.
|
|
30
|
+
* This matches the browser's native activation behavior for certain elements.
|
|
31
|
+
*/
|
|
32
|
+
onClick?: (e: MouseEvent) => void;
|
|
33
|
+
/** Whether the press should be visual only, not triggering onPress. */
|
|
34
|
+
isPressed?: Accessor<boolean> | boolean;
|
|
35
|
+
/** Whether to prevent focus when pressing. */
|
|
36
|
+
preventFocusOnPress?: boolean;
|
|
37
|
+
/** Whether long press should cancel when pointer moves out of target. */
|
|
38
|
+
shouldCancelOnPointerExit?: boolean;
|
|
39
|
+
/** Whether text selection should be allowed during press. */
|
|
40
|
+
allowTextSelectionOnPress?: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface PressResult {
|
|
43
|
+
/** Whether the target is currently pressed. */
|
|
44
|
+
isPressed: Accessor<boolean>;
|
|
45
|
+
/** Props to spread on the target element. */
|
|
46
|
+
pressProps: JSX.HTMLAttributes<HTMLElement>;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Handles press interactions across mouse, touch, keyboard, and screen readers.
|
|
50
|
+
* Provides consistent press behavior regardless of input method.
|
|
51
|
+
*
|
|
52
|
+
* Based on react-aria's usePress but adapted for SolidJS.
|
|
53
|
+
*/
|
|
54
|
+
export declare function createPress(props?: CreatePressProps): PressResult;
|
|
55
|
+
//# sourceMappingURL=createPress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createPress.d.ts","sourceRoot":"","sources":["../../src/interactions/createPress.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAgB,GAAG,EAAE,QAAQ,EAAa,MAAM,UAAU,CAAC;AAClE,OAAO,EAAE,UAAU,EAAoD,MAAM,cAAc,CAAC;AAsB5F,OAAO,EAAE,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAC5D,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEhE,MAAM,WAAW,gBAAgB;IAC/B,gDAAgD;IAChD,UAAU,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACzC,iEAAiE;IACjE,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IAClC,sDAAsD;IACtD,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACvC;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACrC,+GAA+G;IAC/G,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACpC,mDAAmD;IACnD,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IAClC,uEAAuE;IACvE,SAAS,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACxC,8CAA8C;IAC9C,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,yEAAyE;IACzE,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,6DAA6D;IAC7D,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,MAAM,WAAW,WAAW;IAC1B,+CAA+C;IAC/C,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC7B,6CAA6C;IAC7C,UAAU,EAAE,GAAG,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;CAC7C;AAmCD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,GAAE,gBAAqB,GAAG,WAAW,CAktBrE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { createPress, type CreatePressProps, type PressResult } from './createPress';
|
|
2
|
+
export { PressEvent, type IPressEvent, type PointerType as PressPointerType, type PressEventType, type BaseEventForPress } from './PressEvent';
|
|
3
|
+
export { createLongPress, type LongPressProps, type LongPressResult, type LongPressEvent, } from './createLongPress';
|
|
4
|
+
export { createMove, type MoveEvents, type MoveResult, type MoveStartEvent, type MoveMoveEvent, type MoveEndEvent } from './createMove';
|
|
5
|
+
export { createFocus, type CreateFocusProps, type FocusResult, type FocusEvents } from './createFocus';
|
|
6
|
+
export { createFocusWithin, type FocusWithinProps, type FocusWithinResult, } from './createFocusWithin';
|
|
7
|
+
export { createFocusable, FocusableContext, type CreateFocusableProps, type FocusableResult, type FocusableContextValue, type FocusableProviderProps, type FocusableProps, type FocusableDOMProps, } from './createFocusable';
|
|
8
|
+
export { FocusableProvider } from './FocusableProvider';
|
|
9
|
+
export { createFocusRing, type FocusRingProps, type FocusRingResult, } from './createFocusRing';
|
|
10
|
+
export { createInteractionModality, createFocusVisible, createFocusVisibleListener, addWindowFocusTracking, isFocusVisible, getInteractionModality, setInteractionModality, getPointerType, setupGlobalFocusListeners, addModalityListener, useIsKeyboardFocused, type Modality, type PointerType, type FocusVisibleProps, type FocusVisibleResult, type FocusVisibleHandler, type InteractionModalityResult, } from './createInteractionModality';
|
|
11
|
+
export { createHover, type CreateHoverProps, type HoverProps, type HoverResult, type HoverEvent, type HoverEvents, } from './createHover';
|
|
12
|
+
export { createKeyboard, type CreateKeyboardProps, type KeyboardResult, type KeyboardEvents, type KeyboardEvent, } from './createKeyboard';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|