akar 2.0.23 → 2.0.24
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/README.md +8 -6
- package/dist/Avatar/utils.cjs.map +1 -1
- package/dist/Avatar/utils.js.map +1 -1
- package/dist/Calendar/CalendarCellTrigger.cjs.map +1 -1
- package/dist/Calendar/CalendarCellTrigger.js.map +1 -1
- package/dist/Calendar/CalendarRoot.cjs.map +1 -1
- package/dist/Calendar/CalendarRoot.js.map +1 -1
- package/dist/Calendar/useCalendar.cjs.map +1 -1
- package/dist/Calendar/useCalendar.js.map +1 -1
- package/dist/Checkbox/CheckboxGroupRoot.cjs.map +1 -1
- package/dist/Checkbox/CheckboxGroupRoot.js.map +1 -1
- package/dist/Checkbox/CheckboxRoot.cjs.map +1 -1
- package/dist/Checkbox/CheckboxRoot.js.map +1 -1
- package/dist/Checkbox/utils.cjs.map +1 -1
- package/dist/Checkbox/utils.js.map +1 -1
- package/dist/Collection/Collection.cjs.map +1 -1
- package/dist/Collection/Collection.js.map +1 -1
- package/dist/ColorArea/ColorAreaArea.cjs +1 -1
- package/dist/ColorArea/ColorAreaArea.cjs.map +1 -1
- package/dist/ColorArea/ColorAreaArea.js +1 -1
- package/dist/ColorArea/ColorAreaArea.js.map +1 -1
- package/dist/ColorArea/ColorAreaRoot.cjs.map +1 -1
- package/dist/ColorArea/ColorAreaRoot.js.map +1 -1
- package/dist/ColorArea/utils.cjs +1 -0
- package/dist/ColorArea/utils.cjs.map +1 -1
- package/dist/ColorArea/utils.js +1 -0
- package/dist/ColorArea/utils.js.map +1 -1
- package/dist/ColorSlider/ColorSliderRoot.cjs.map +1 -1
- package/dist/ColorSlider/ColorSliderRoot.js.map +1 -1
- package/dist/ColorSwatchPicker/ColorSwatchPickerRoot.cjs.map +1 -1
- package/dist/ColorSwatchPicker/ColorSwatchPickerRoot.js.map +1 -1
- package/dist/Combobox/ComboboxCancel.cjs.map +1 -1
- package/dist/Combobox/ComboboxCancel.js.map +1 -1
- package/dist/Combobox/ComboboxContentImpl.cjs.map +1 -1
- package/dist/Combobox/ComboboxContentImpl.js.map +1 -1
- package/dist/Combobox/ComboboxGroup.cjs.map +1 -1
- package/dist/Combobox/ComboboxGroup.js.map +1 -1
- package/dist/Combobox/ComboboxRoot.cjs.map +1 -1
- package/dist/Combobox/ComboboxRoot.js.map +1 -1
- package/dist/DateField/DateFieldRoot.cjs +3 -1
- package/dist/DateField/DateFieldRoot.cjs.map +1 -1
- package/dist/DateField/DateFieldRoot.js +3 -1
- package/dist/DateField/DateFieldRoot.js.map +1 -1
- package/dist/DatePicker/DatePickerRoot.cjs.map +1 -1
- package/dist/DatePicker/DatePickerRoot.js.map +1 -1
- package/dist/DateRangeField/DateRangeFieldInput.cjs.map +1 -1
- package/dist/DateRangeField/DateRangeFieldInput.js.map +1 -1
- package/dist/DateRangeField/DateRangeFieldRoot.cjs.map +1 -1
- package/dist/DateRangeField/DateRangeFieldRoot.js.map +1 -1
- package/dist/DateRangePicker/DateRangePickerRoot.cjs.map +1 -1
- package/dist/DateRangePicker/DateRangePickerRoot.js.map +1 -1
- package/dist/Dialog/DialogContent.cjs.map +1 -1
- package/dist/Dialog/DialogContent.js.map +1 -1
- package/dist/Dialog/utils.cjs +1 -1
- package/dist/Dialog/utils.cjs.map +1 -1
- package/dist/Dialog/utils.js +1 -1
- package/dist/Dialog/utils.js.map +1 -1
- package/dist/DismissableLayer/DismissableLayer.cjs.map +1 -1
- package/dist/DismissableLayer/DismissableLayer.js.map +1 -1
- package/dist/DismissableLayer/context.cjs +1 -0
- package/dist/DismissableLayer/context.cjs.map +1 -1
- package/dist/DismissableLayer/context.js +1 -0
- package/dist/DismissableLayer/context.js.map +1 -1
- package/dist/DismissableLayer/utils.cjs.map +1 -1
- package/dist/DismissableLayer/utils.js.map +1 -1
- package/dist/Drawer/DrawerContent.cjs.map +1 -1
- package/dist/Drawer/DrawerContent.js.map +1 -1
- package/dist/Drawer/DrawerContentImpl.cjs.map +1 -1
- package/dist/Drawer/DrawerContentImpl.js.map +1 -1
- package/dist/Drawer/DrawerIndent.cjs.map +1 -1
- package/dist/Drawer/DrawerIndent.js.map +1 -1
- package/dist/Drawer/DrawerProvider.cjs.map +1 -1
- package/dist/Drawer/DrawerProvider.js.map +1 -1
- package/dist/Drawer/utils.cjs.map +1 -1
- package/dist/Drawer/utils.js.map +1 -1
- package/dist/Editable/EditableRoot.cjs.map +1 -1
- package/dist/Editable/EditableRoot.js.map +1 -1
- package/dist/Field/FieldControl.cjs.map +1 -1
- package/dist/Field/FieldControl.js.map +1 -1
- package/dist/Field/FieldRoot.cjs.map +1 -1
- package/dist/Field/FieldRoot.js.map +1 -1
- package/dist/Field/useFieldValidation.cjs.map +1 -1
- package/dist/Field/useFieldValidation.js.map +1 -1
- package/dist/FocusScope/FocusScope.cjs.map +1 -1
- package/dist/FocusScope/FocusScope.js.map +1 -1
- package/dist/HoverCard/HoverCardContentImpl.cjs +3 -1
- package/dist/HoverCard/HoverCardContentImpl.cjs.map +1 -1
- package/dist/HoverCard/HoverCardContentImpl.js +3 -1
- package/dist/HoverCard/HoverCardContentImpl.js.map +1 -1
- package/dist/HoverCard/utils.cjs.map +1 -1
- package/dist/HoverCard/utils.js.map +1 -1
- package/dist/Listbox/ListboxRoot.cjs.map +1 -1
- package/dist/Listbox/ListboxRoot.js.map +1 -1
- package/dist/Listbox/ListboxVirtualizer.cjs.map +1 -1
- package/dist/Listbox/ListboxVirtualizer.js.map +1 -1
- package/dist/Menu/MenuContentImpl.cjs +1 -1
- package/dist/Menu/MenuContentImpl.cjs.map +1 -1
- package/dist/Menu/MenuContentImpl.js +2 -2
- package/dist/Menu/MenuContentImpl.js.map +1 -1
- package/dist/Menu/MenuSub.cjs +3 -1
- package/dist/Menu/MenuSub.cjs.map +1 -1
- package/dist/Menu/MenuSub.js +3 -1
- package/dist/Menu/MenuSub.js.map +1 -1
- package/dist/Menu/MenuSubTrigger.cjs.map +1 -1
- package/dist/Menu/MenuSubTrigger.js.map +1 -1
- package/dist/Menu/utils.cjs +4 -0
- package/dist/Menu/utils.cjs.map +1 -1
- package/dist/Menu/utils.js +4 -0
- package/dist/Menu/utils.js.map +1 -1
- package/dist/Menubar/MenubarContent.cjs.map +1 -1
- package/dist/Menubar/MenubarContent.js.map +1 -1
- package/dist/MonthPicker/MonthPickerCellTrigger.cjs.map +1 -1
- package/dist/MonthPicker/MonthPickerCellTrigger.js.map +1 -1
- package/dist/MonthPicker/MonthPickerRoot.cjs.map +1 -1
- package/dist/MonthPicker/MonthPickerRoot.js.map +1 -1
- package/dist/MonthPicker/useMonthPicker.cjs.map +1 -1
- package/dist/MonthPicker/useMonthPicker.js.map +1 -1
- package/dist/MonthRangePicker/MonthRangePickerCellTrigger.cjs.map +1 -1
- package/dist/MonthRangePicker/MonthRangePickerCellTrigger.js.map +1 -1
- package/dist/MonthRangePicker/MonthRangePickerRoot.cjs.map +1 -1
- package/dist/MonthRangePicker/MonthRangePickerRoot.js.map +1 -1
- package/dist/MonthRangePicker/useRangeMonthPicker.cjs.map +1 -1
- package/dist/MonthRangePicker/useRangeMonthPicker.js.map +1 -1
- package/dist/NavigationMenu/NavigationMenuContentImpl.cjs.map +1 -1
- package/dist/NavigationMenu/NavigationMenuContentImpl.js.map +1 -1
- package/dist/NavigationMenu/NavigationMenuItem.cjs +17 -10
- package/dist/NavigationMenu/NavigationMenuItem.cjs.map +1 -1
- package/dist/NavigationMenu/NavigationMenuItem.js +17 -10
- package/dist/NavigationMenu/NavigationMenuItem.js.map +1 -1
- package/dist/NavigationMenu/NavigationMenuTrigger.cjs +1 -1
- package/dist/NavigationMenu/NavigationMenuTrigger.cjs.map +1 -1
- package/dist/NavigationMenu/NavigationMenuTrigger.js +1 -1
- package/dist/NavigationMenu/NavigationMenuTrigger.js.map +1 -1
- package/dist/NavigationMenu/utils.cjs.map +1 -1
- package/dist/NavigationMenu/utils.js.map +1 -1
- package/dist/NumberField/NumberFieldInput.cjs.map +1 -1
- package/dist/NumberField/NumberFieldInput.js.map +1 -1
- package/dist/NumberField/NumberFieldRoot.cjs.map +1 -1
- package/dist/NumberField/NumberFieldRoot.js.map +1 -1
- package/dist/NumberField/utils.cjs.map +1 -1
- package/dist/NumberField/utils.js.map +1 -1
- package/dist/Pagination/utils.cjs.map +1 -1
- package/dist/Pagination/utils.js.map +1 -1
- package/dist/PinInput/PinInputInput.cjs.map +1 -1
- package/dist/PinInput/PinInputInput.js.map +1 -1
- package/dist/PinInput/PinInputRoot.cjs.map +1 -1
- package/dist/PinInput/PinInputRoot.js.map +1 -1
- package/dist/Popper/PopperContent.cjs.map +1 -1
- package/dist/Popper/PopperContent.js.map +1 -1
- package/dist/Popper/PopperRoot.cjs +3 -1
- package/dist/Popper/PopperRoot.cjs.map +1 -1
- package/dist/Popper/PopperRoot.js +3 -1
- package/dist/Popper/PopperRoot.js.map +1 -1
- package/dist/Popper/utils.cjs.map +1 -1
- package/dist/Popper/utils.js.map +1 -1
- package/dist/Presence/usePresence.cjs.map +1 -1
- package/dist/Presence/usePresence.js.map +1 -1
- package/dist/Primitive/usePrimitiveElement.cjs.map +1 -1
- package/dist/Primitive/usePrimitiveElement.js.map +1 -1
- package/dist/Progress/ProgressRoot.cjs.map +1 -1
- package/dist/Progress/ProgressRoot.js.map +1 -1
- package/dist/RadioGroup/Radio.cjs.map +1 -1
- package/dist/RadioGroup/Radio.js.map +1 -1
- package/dist/RadioGroup/RadioGroupItem.cjs.map +1 -1
- package/dist/RadioGroup/RadioGroupItem.js.map +1 -1
- package/dist/RangeCalendar/RangeCalendarCellTrigger.cjs.map +1 -1
- package/dist/RangeCalendar/RangeCalendarCellTrigger.js.map +1 -1
- package/dist/RangeCalendar/RangeCalendarRoot.cjs.map +1 -1
- package/dist/RangeCalendar/RangeCalendarRoot.js.map +1 -1
- package/dist/RangeCalendar/useRangeCalendar.cjs.map +1 -1
- package/dist/RangeCalendar/useRangeCalendar.js.map +1 -1
- package/dist/RovingFocus/RovingFocusGroup.cjs.map +1 -1
- package/dist/RovingFocus/RovingFocusGroup.js.map +1 -1
- package/dist/RovingFocus/RovingFocusItem.cjs.map +1 -1
- package/dist/RovingFocus/RovingFocusItem.js.map +1 -1
- package/dist/RovingFocus/utils.cjs.map +1 -1
- package/dist/RovingFocus/utils.js.map +1 -1
- package/dist/ScrollArea/ScrollAreaThumb.cjs +1 -1
- package/dist/ScrollArea/ScrollAreaThumb.cjs.map +1 -1
- package/dist/ScrollArea/ScrollAreaThumb.js +1 -1
- package/dist/ScrollArea/ScrollAreaThumb.js.map +1 -1
- package/dist/ScrollArea/utils.cjs +4 -0
- package/dist/ScrollArea/utils.cjs.map +1 -1
- package/dist/ScrollArea/utils.js +4 -0
- package/dist/ScrollArea/utils.js.map +1 -1
- package/dist/Select/SelectItemAlignedPosition.cjs.map +1 -1
- package/dist/Select/SelectItemAlignedPosition.js.map +1 -1
- package/dist/Select/SelectRoot.cjs.map +1 -1
- package/dist/Select/SelectRoot.js.map +1 -1
- package/dist/Select/SelectValue.cjs.map +1 -1
- package/dist/Select/SelectValue.js.map +1 -1
- package/dist/Select/SelectViewport.cjs.map +1 -1
- package/dist/Select/SelectViewport.js.map +1 -1
- package/dist/Slider/SliderHorizontal.cjs.map +1 -1
- package/dist/Slider/SliderHorizontal.js.map +1 -1
- package/dist/Slider/SliderRange.cjs.map +1 -1
- package/dist/Slider/SliderRange.js.map +1 -1
- package/dist/Slider/SliderRoot.cjs.map +1 -1
- package/dist/Slider/SliderRoot.js.map +1 -1
- package/dist/Slider/SliderThumb.cjs.map +1 -1
- package/dist/Slider/SliderThumb.js.map +1 -1
- package/dist/Slider/SliderThumbImpl.cjs.map +1 -1
- package/dist/Slider/SliderThumbImpl.js.map +1 -1
- package/dist/Slider/SliderVertical.cjs.map +1 -1
- package/dist/Slider/SliderVertical.js.map +1 -1
- package/dist/Slider/utils.cjs +1 -0
- package/dist/Slider/utils.cjs.map +1 -1
- package/dist/Slider/utils.js +1 -0
- package/dist/Slider/utils.js.map +1 -1
- package/dist/Splitter/SplitterGroup.cjs.map +1 -1
- package/dist/Splitter/SplitterGroup.js.map +1 -1
- package/dist/Stepper/StepperRoot.cjs.map +1 -1
- package/dist/Stepper/StepperRoot.js.map +1 -1
- package/dist/Stepper/StepperTrigger.cjs.map +1 -1
- package/dist/Stepper/StepperTrigger.js.map +1 -1
- package/dist/Switch/SwitchRoot.cjs.map +1 -1
- package/dist/Switch/SwitchRoot.js.map +1 -1
- package/dist/Tabs/TabsTrigger.cjs.map +1 -1
- package/dist/Tabs/TabsTrigger.js.map +1 -1
- package/dist/TagGroup/TagGroupItemDelete.cjs.map +1 -1
- package/dist/TagGroup/TagGroupItemDelete.js.map +1 -1
- package/dist/TagGroup/TagGroupRoot.cjs.map +1 -1
- package/dist/TagGroup/TagGroupRoot.js.map +1 -1
- package/dist/TagsInput/TagsInputRoot.cjs.map +1 -1
- package/dist/TagsInput/TagsInputRoot.js.map +1 -1
- package/dist/TimeField/TimeFieldRoot.cjs.map +1 -1
- package/dist/TimeField/TimeFieldRoot.js.map +1 -1
- package/dist/TimeRangeField/TimeRangeFieldInput.cjs.map +1 -1
- package/dist/TimeRangeField/TimeRangeFieldInput.js.map +1 -1
- package/dist/TimeRangeField/TimeRangeFieldRoot.cjs.map +1 -1
- package/dist/TimeRangeField/TimeRangeFieldRoot.js.map +1 -1
- package/dist/Toast/ToastRoot.cjs.map +1 -1
- package/dist/Toast/ToastRoot.js.map +1 -1
- package/dist/Toast/ToastRootImpl.cjs.map +1 -1
- package/dist/Toast/ToastRootImpl.js.map +1 -1
- package/dist/Toast/ToastViewport.cjs.map +1 -1
- package/dist/Toast/ToastViewport.js.map +1 -1
- package/dist/Toast/createToastManager.cjs.map +1 -1
- package/dist/Toast/createToastManager.js.map +1 -1
- package/dist/Toast/useToastStore.cjs +3 -1
- package/dist/Toast/useToastStore.cjs.map +1 -1
- package/dist/Toast/useToastStore.js +3 -1
- package/dist/Toast/useToastStore.js.map +1 -1
- package/dist/Tree/TreeItem.cjs.map +1 -1
- package/dist/Tree/TreeItem.js.map +1 -1
- package/dist/Tree/TreeRoot.cjs.map +1 -1
- package/dist/Tree/TreeRoot.js.map +1 -1
- package/dist/Tree/TreeVirtualizer.cjs.map +1 -1
- package/dist/Tree/TreeVirtualizer.js.map +1 -1
- package/dist/VisuallyHidden/VisuallyHiddenInput.cjs.map +1 -1
- package/dist/VisuallyHidden/VisuallyHiddenInput.js.map +1 -1
- package/dist/YearPicker/YearPickerCellTrigger.cjs.map +1 -1
- package/dist/YearPicker/YearPickerCellTrigger.js.map +1 -1
- package/dist/YearPicker/YearPickerRoot.cjs.map +1 -1
- package/dist/YearPicker/YearPickerRoot.js.map +1 -1
- package/dist/YearPicker/useYearPicker.cjs.map +1 -1
- package/dist/YearPicker/useYearPicker.js.map +1 -1
- package/dist/YearRangePicker/YearRangePickerCellTrigger.cjs.map +1 -1
- package/dist/YearRangePicker/YearRangePickerCellTrigger.js.map +1 -1
- package/dist/YearRangePicker/YearRangePickerRoot.cjs.map +1 -1
- package/dist/YearRangePicker/YearRangePickerRoot.js.map +1 -1
- package/dist/YearRangePicker/useRangeYearPicker.cjs.map +1 -1
- package/dist/YearRangePicker/useRangeYearPicker.js.map +1 -1
- package/dist/color/channel.cjs.map +1 -1
- package/dist/color/channel.js.map +1 -1
- package/dist/color/convert.cjs.map +1 -1
- package/dist/color/convert.js.map +1 -1
- package/dist/color/gradient.cjs +2 -2
- package/dist/color/gradient.cjs.map +1 -1
- package/dist/color/gradient.js +2 -2
- package/dist/color/gradient.js.map +1 -1
- package/dist/color/parse.cjs.map +1 -1
- package/dist/color/parse.js.map +1 -1
- package/dist/color/utils.cjs.map +1 -1
- package/dist/color/utils.js.map +1 -1
- package/dist/component/BaseSeparator.cjs.map +1 -1
- package/dist/component/BaseSeparator.js.map +1 -1
- package/dist/composables/useDrawerSnapPoints.cjs.map +1 -1
- package/dist/composables/useDrawerSnapPoints.js.map +1 -1
- package/dist/composables/useDrawerVirtualKeyboard.cjs.map +1 -1
- package/dist/composables/useDrawerVirtualKeyboard.js.map +1 -1
- package/dist/composables/useSwipeDismiss.cjs.map +1 -1
- package/dist/composables/useSwipeDismiss.js.map +1 -1
- package/dist/composables/useWindowSplitterBehavior.cjs +1 -0
- package/dist/composables/useWindowSplitterBehavior.cjs.map +1 -1
- package/dist/composables/useWindowSplitterBehavior.js +1 -0
- package/dist/composables/useWindowSplitterBehavior.js.map +1 -1
- package/dist/composables/useWindowSplitterPanelGroupBehavior.cjs +7 -4
- package/dist/composables/useWindowSplitterPanelGroupBehavior.cjs.map +1 -1
- package/dist/composables/useWindowSplitterPanelGroupBehavior.js +7 -4
- package/dist/composables/useWindowSplitterPanelGroupBehavior.js.map +1 -1
- package/dist/constant.d.ts.map +1 -1
- package/dist/date/calendar.cjs.map +1 -1
- package/dist/date/calendar.js.map +1 -1
- package/dist/date/comparators.cjs.map +1 -1
- package/dist/date/comparators.js.map +1 -1
- package/dist/date/parser.cjs.map +1 -1
- package/dist/date/parser.js.map +1 -1
- package/dist/date/parts.cjs.map +1 -1
- package/dist/date/parts.js.map +1 -1
- package/dist/date/useDateField.cjs.map +1 -1
- package/dist/date/useDateField.js.map +1 -1
- package/dist/date/useSegmentNavigation.cjs.map +1 -1
- package/dist/date/useSegmentNavigation.js.map +1 -1
- package/dist/date/utils.cjs.map +1 -1
- package/dist/date/utils.js.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index2.d.cts +2 -0
- package/dist/index2.d.cts.map +1 -1
- package/dist/index2.d.ts +2 -0
- package/dist/index2.d.ts.map +1 -1
- package/dist/index3.d.cts +721 -719
- package/dist/index3.d.cts.map +1 -1
- package/dist/index3.d.ts +711 -709
- package/dist/index3.d.ts.map +1 -1
- package/dist/internal.d.cts +2 -2
- package/dist/internal.d.cts.map +1 -1
- package/dist/internal.d.ts +2 -2
- package/dist/shared/bodyPointerEvents.cjs.map +1 -1
- package/dist/shared/bodyPointerEvents.js.map +1 -1
- package/dist/shared/clamp.cjs.map +1 -1
- package/dist/shared/clamp.js.map +1 -1
- package/dist/shared/useArrowNavigation.cjs.map +1 -1
- package/dist/shared/useArrowNavigation.js.map +1 -1
- package/dist/shared/useBodyScrollLock.cjs.map +1 -1
- package/dist/shared/useBodyScrollLock.js.map +1 -1
- package/dist/shared/useCalendarKeyboardNavigation.cjs.map +1 -1
- package/dist/shared/useCalendarKeyboardNavigation.js.map +1 -1
- package/dist/shared/useComposing.cjs.map +1 -1
- package/dist/shared/useComposing.js.map +1 -1
- package/dist/shared/useDateFormatter.cjs.map +1 -1
- package/dist/shared/useDateFormatter.js.map +1 -1
- package/dist/shared/useFocusGuards.cjs +3 -1
- package/dist/shared/useFocusGuards.cjs.map +1 -1
- package/dist/shared/useFocusGuards.js +3 -1
- package/dist/shared/useFocusGuards.js.map +1 -1
- package/dist/shared/useFormControl.cjs.map +1 -1
- package/dist/shared/useFormControl.js.map +1 -1
- package/dist/shared/useForwardExpose.cjs.map +1 -1
- package/dist/shared/useForwardExpose.js.map +1 -1
- package/dist/shared/useForwardProps.cjs.map +1 -1
- package/dist/shared/useForwardProps.js.map +1 -1
- package/dist/shared/useForwardPropsEmits.cjs.map +1 -1
- package/dist/shared/useForwardPropsEmits.js.map +1 -1
- package/dist/shared/useForwardScopeId.cjs.map +1 -1
- package/dist/shared/useForwardScopeId.js.map +1 -1
- package/dist/shared/useGraceArea.cjs.map +1 -1
- package/dist/shared/useGraceArea.js.map +1 -1
- package/dist/shared/useId.cjs.map +1 -1
- package/dist/shared/useId.js.map +1 -1
- package/dist/shared/useSelectionBehavior.cjs.map +1 -1
- package/dist/shared/useSelectionBehavior.js.map +1 -1
- package/dist/shared/useSingleOrMultipleValue.cjs.map +1 -1
- package/dist/shared/useSingleOrMultipleValue.js.map +1 -1
- package/dist/shared/useTypeahead.cjs.map +1 -1
- package/dist/shared/useTypeahead.js.map +1 -1
- package/dist/shared/withDefault.cjs.map +1 -1
- package/dist/shared/withDefault.js.map +1 -1
- package/dist/utils/calculate.cjs +1 -0
- package/dist/utils/calculate.cjs.map +1 -1
- package/dist/utils/calculate.js +1 -0
- package/dist/utils/calculate.js.map +1 -1
- package/dist/utils/callPanelCallbacks.cjs +1 -0
- package/dist/utils/callPanelCallbacks.cjs.map +1 -1
- package/dist/utils/callPanelCallbacks.js +1 -0
- package/dist/utils/callPanelCallbacks.js.map +1 -1
- package/dist/utils/compare.cjs.map +1 -1
- package/dist/utils/compare.js.map +1 -1
- package/dist/utils/dom.cjs.map +1 -1
- package/dist/utils/dom.js.map +1 -1
- package/dist/utils/layout.cjs +1 -0
- package/dist/utils/layout.cjs.map +1 -1
- package/dist/utils/layout.js +1 -0
- package/dist/utils/layout.js.map +1 -1
- package/dist/utils/pivot.cjs.map +1 -1
- package/dist/utils/pivot.js.map +1 -1
- package/dist/utils/registry.cjs.map +1 -1
- package/dist/utils/registry.js.map +1 -1
- package/dist/utils/resizePanel.cjs +1 -0
- package/dist/utils/resizePanel.cjs.map +1 -1
- package/dist/utils/resizePanel.js +1 -0
- package/dist/utils/resizePanel.js.map +1 -1
- package/dist/utils/stackingOrder.cjs +10 -10
- package/dist/utils/stackingOrder.cjs.map +1 -1
- package/dist/utils/stackingOrder.js +10 -10
- package/dist/utils/stackingOrder.js.map +1 -1
- package/dist/utils/storage.cjs +7 -1
- package/dist/utils/storage.cjs.map +1 -1
- package/dist/utils/storage.js +7 -1
- package/dist/utils/storage.js.map +1 -1
- package/dist/utils/style.cjs +1 -0
- package/dist/utils/style.cjs.map +1 -1
- package/dist/utils/style.js +1 -0
- package/dist/utils/style.js.map +1 -1
- package/dist/utils/units.cjs +0 -1
- package/dist/utils/units.cjs.map +1 -1
- package/dist/utils/units.js +0 -1
- package/dist/utils/units.js.map +1 -1
- package/dist/utils/validation.cjs +1 -0
- package/dist/utils/validation.cjs.map +1 -1
- package/dist/utils/validation.js +1 -0
- package/dist/utils/validation.js.map +1 -1
- package/package.json +10 -10
- package/src/Avatar/utils.ts +3 -1
- package/src/Calendar/CalendarCellTrigger.vue +3 -1
- package/src/Calendar/CalendarRoot.vue +3 -1
- package/src/Calendar/useCalendar.ts +18 -5
- package/src/Checkbox/CheckboxGroupRoot.vue +3 -1
- package/src/Checkbox/CheckboxRoot.test-d.ts +91 -0
- package/src/Checkbox/CheckboxRoot.vue +19 -15
- package/src/Checkbox/utils.ts +3 -1
- package/src/Collection/Collection.ts +11 -2
- package/src/ColorArea/ColorAreaArea.vue +1 -1
- package/src/ColorArea/ColorAreaRoot.vue +14 -2
- package/src/ColorArea/utils.ts +1 -1
- package/src/ColorSlider/ColorSliderRoot.vue +3 -1
- package/src/ColorSlider/utils.ts +31 -6
- package/src/ColorSwatchPicker/ColorSwatchPickerRoot.vue +3 -1
- package/src/Combobox/ComboboxCancel.vue +3 -1
- package/src/Combobox/ComboboxContentImpl.vue +7 -2
- package/src/Combobox/ComboboxGroup.vue +5 -1
- package/src/Combobox/ComboboxRoot.vue +3 -1
- package/src/DateField/DateFieldRoot.vue +24 -7
- package/src/DatePicker/DatePickerRoot.vue +6 -1
- package/src/DateRangeField/DateRangeFieldInput.vue +3 -1
- package/src/DateRangeField/DateRangeFieldRoot.vue +30 -8
- package/src/DateRangePicker/DateRangePickerRoot.vue +4 -1
- package/src/Dialog/utils.ts +1 -1
- package/src/DismissableLayer/DismissableLayer.vue +9 -2
- package/src/DismissableLayer/context.ts +1 -1
- package/src/DismissableLayer/utils.ts +1 -0
- package/src/Drawer/DrawerContentImpl.vue +18 -5
- package/src/Drawer/DrawerIndent.vue +3 -1
- package/src/Drawer/DrawerProvider.vue +6 -2
- package/src/Drawer/composables/useDrawerSnapPoints.ts +23 -7
- package/src/Drawer/composables/useDrawerVirtualKeyboard.ts +37 -12
- package/src/Drawer/composables/useSwipeDismiss.ts +30 -10
- package/src/Drawer/utils.ts +18 -4
- package/src/Editable/EditableRoot.vue +3 -1
- package/src/Field/FieldControl.vue +3 -1
- package/src/Field/FieldRoot.vue +23 -7
- package/src/Field/useFieldValidation.ts +31 -9
- package/src/FocusScope/FocusScope.vue +3 -1
- package/src/HoverCard/HoverCardContentImpl.vue +3 -1
- package/src/HoverCard/index.ts +1 -0
- package/src/HoverCard/utils.ts +6 -2
- package/src/Listbox/ListboxRoot.vue +24 -8
- package/src/Listbox/ListboxVirtualizer.vue +9 -3
- package/src/Menu/MenuContentImpl.vue +9 -3
- package/src/Menu/MenuSub.vue +3 -1
- package/src/Menu/MenuSubTrigger.vue +3 -1
- package/src/Menu/utils.ts +8 -3
- package/src/Menubar/MenubarContent.vue +3 -1
- package/src/MonthPicker/MonthPickerCellTrigger.vue +3 -1
- package/src/MonthPicker/MonthPickerRoot.vue +7 -2
- package/src/MonthPicker/useMonthPicker.ts +3 -1
- package/src/MonthRangePicker/MonthRangePickerCellTrigger.vue +6 -2
- package/src/MonthRangePicker/MonthRangePickerRoot.vue +20 -5
- package/src/MonthRangePicker/useRangeMonthPicker.ts +12 -4
- package/src/NavigationMenu/NavigationMenuContentImpl.vue +6 -2
- package/src/NavigationMenu/NavigationMenuItem.vue +15 -4
- package/src/NavigationMenu/NavigationMenuTrigger.vue +4 -2
- package/src/NavigationMenu/utils.ts +3 -1
- package/src/NumberField/NumberFieldInput.vue +6 -2
- package/src/NumberField/NumberFieldRoot.vue +15 -5
- package/src/NumberField/utils.ts +6 -2
- package/src/Pagination/utils.ts +7 -1
- package/src/PinInput/PinInputInput.vue +3 -1
- package/src/PinInput/PinInputRoot.vue +3 -1
- package/src/Popper/PopperContent.vue +13 -3
- package/src/Popper/PopperRoot.vue +3 -1
- package/src/Popper/utils.ts +21 -7
- package/src/Presence/usePresence.ts +9 -3
- package/src/Primitive/Primitive.ts +1 -1
- package/src/Primitive/usePrimitiveElement.ts +3 -1
- package/src/Progress/ProgressRoot.vue +3 -1
- package/src/RadioGroup/Radio.vue +3 -1
- package/src/RadioGroup/RadioGroupItem.vue +6 -1
- package/src/RangeCalendar/RangeCalendarCellTrigger.vue +3 -1
- package/src/RangeCalendar/RangeCalendarRoot.vue +20 -5
- package/src/RangeCalendar/useRangeCalendar.ts +11 -3
- package/src/RovingFocus/RovingFocusGroup.vue +6 -1
- package/src/RovingFocus/RovingFocusItem.vue +3 -1
- package/src/RovingFocus/utils.ts +1 -0
- package/src/ScrollArea/ScrollAreaThumb.vue +1 -1
- package/src/ScrollArea/utils.ts +16 -6
- package/src/Select/SelectItemAlignedPosition.vue +8 -2
- package/src/Select/SelectRoot.vue +12 -4
- package/src/Select/SelectValue.vue +3 -1
- package/src/Select/SelectViewport.vue +3 -1
- package/src/Slider/SliderHorizontal.vue +9 -3
- package/src/Slider/SliderRange.vue +3 -1
- package/src/Slider/SliderRoot.vue +3 -1
- package/src/Slider/SliderThumb.vue +3 -1
- package/src/Slider/SliderThumbImpl.vue +3 -1
- package/src/Slider/SliderVertical.vue +9 -3
- package/src/Slider/utils.ts +31 -6
- package/src/Splitter/SplitterGroup.vue +18 -6
- package/src/Splitter/utils/calculate.ts +7 -3
- package/src/Splitter/utils/callPanelCallbacks.ts +1 -1
- package/src/Splitter/utils/compare.ts +3 -1
- package/src/Splitter/utils/composables/useWindowSplitterBehavior.ts +2 -2
- package/src/Splitter/utils/composables/useWindowSplitterPanelGroupBehavior.ts +7 -5
- package/src/Splitter/utils/dom.ts +3 -1
- package/src/Splitter/utils/layout.ts +32 -11
- package/src/Splitter/utils/pivot.ts +3 -1
- package/src/Splitter/utils/registry.ts +3 -1
- package/src/Splitter/utils/resizePanel.ts +1 -1
- package/src/Splitter/utils/stackingOrder.ts +10 -10
- package/src/Splitter/utils/storage.ts +7 -5
- package/src/Splitter/utils/style.ts +7 -3
- package/src/Splitter/utils/units.ts +0 -2
- package/src/Splitter/utils/validation.ts +4 -2
- package/src/Stepper/StepperRoot.vue +18 -6
- package/src/Stepper/StepperTrigger.vue +6 -1
- package/src/Switch/SwitchRoot.test-d.ts +87 -0
- package/src/Switch/SwitchRoot.vue +15 -13
- package/src/Tabs/TabsTrigger.vue +3 -1
- package/src/TagGroup/TagGroupItemDelete.vue +3 -1
- package/src/TagGroup/TagGroupRoot.vue +25 -7
- package/src/TagsInput/TagsInputRoot.vue +12 -4
- package/src/TimeField/TimeFieldRoot.vue +29 -8
- package/src/TimeRangeField/TimeRangeFieldInput.vue +3 -1
- package/src/TimeRangeField/TimeRangeFieldRoot.vue +39 -11
- package/src/Toast/ToastRoot.vue +4 -1
- package/src/Toast/ToastRootImpl.vue +19 -5
- package/src/Toast/ToastViewport.vue +7 -2
- package/src/Toast/createToastManager.ts +21 -6
- package/src/Toast/useToastStore.ts +36 -8
- package/src/Tree/TreeItem.vue +12 -2
- package/src/Tree/TreeRoot.vue +16 -5
- package/src/Tree/TreeVirtualizer.vue +15 -5
- package/src/VisuallyHidden/VisuallyHiddenInput.vue +3 -1
- package/src/YearPicker/YearPickerCellTrigger.vue +6 -2
- package/src/YearPicker/YearPickerRoot.vue +7 -2
- package/src/YearPicker/useYearPicker.ts +3 -1
- package/src/YearRangePicker/YearRangePickerCellTrigger.vue +6 -2
- package/src/YearRangePicker/YearRangePickerRoot.vue +20 -5
- package/src/YearRangePicker/useRangeYearPicker.ts +12 -4
- package/src/date/calendar.ts +13 -3
- package/src/date/comparators.ts +6 -2
- package/src/shared/bodyPointerEvents.ts +4 -1
- package/src/shared/clamp.ts +6 -2
- package/src/shared/color/channel.ts +57 -16
- package/src/shared/color/convert.ts +27 -9
- package/src/shared/color/gradient.ts +166 -33
- package/src/shared/color/parse.ts +10 -4
- package/src/shared/color/utils.ts +9 -3
- package/src/shared/component/BaseSeparator.vue +6 -2
- package/src/shared/date/parser.ts +15 -4
- package/src/shared/date/parts.ts +10 -2
- package/src/shared/date/segment.ts +1 -1
- package/src/shared/date/types.ts +2 -2
- package/src/shared/date/useDateField.ts +113 -28
- package/src/shared/date/useSegmentNavigation.ts +12 -4
- package/src/shared/date/utils.ts +12 -4
- package/src/shared/useArrowNavigation.ts +15 -4
- package/src/shared/useBodyScrollLock.ts +12 -4
- package/src/shared/useCalendarKeyboardNavigation.ts +30 -8
- package/src/shared/useComposing.ts +7 -1
- package/src/shared/useDateFormatter.ts +38 -9
- package/src/shared/useEmitAsProps.test-d.ts +0 -1
- package/src/shared/useFocusGuards.ts +3 -1
- package/src/shared/useFormControl.ts +3 -1
- package/src/shared/useForwardExpose.ts +4 -1
- package/src/shared/useForwardProps.ts +4 -1
- package/src/shared/useForwardPropsEmits.ts +3 -1
- package/src/shared/useForwardScopeId.ts +3 -1
- package/src/shared/useGraceArea.ts +4 -1
- package/src/shared/useId.ts +3 -1
- package/src/shared/useSelectionBehavior.ts +2 -3
- package/src/shared/useSingleOrMultipleValue.ts +14 -4
- package/src/shared/useTypeahead.ts +6 -2
- package/src/shared/withDefault.ts +5 -3
|
@@ -39,8 +39,14 @@ export const DEFAULT_VALIDITY_STATE: FieldValidityState = {
|
|
|
39
39
|
* `ValidityState` of their own, and to snapshot a native element's live one.
|
|
40
40
|
*/
|
|
41
41
|
export function createValidityState(flags: Partial<Record<ValidityKey, boolean>> = {}): ValidityState {
|
|
42
|
-
const state = Object.fromEntries(VALIDITY_KEYS.map((key) => [
|
|
43
|
-
|
|
42
|
+
const state = Object.fromEntries(VALIDITY_KEYS.map((key) => [
|
|
43
|
+
key,
|
|
44
|
+
Boolean(flags[key]),
|
|
45
|
+
])) as Record<ValidityKey, boolean>;
|
|
46
|
+
return {
|
|
47
|
+
...state,
|
|
48
|
+
valid: VALIDITY_KEYS.every((key) => !state[key]),
|
|
49
|
+
};
|
|
44
50
|
}
|
|
45
51
|
|
|
46
52
|
type NativeControl = HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement;
|
|
@@ -72,7 +78,9 @@ function normalizeErrors(result: FieldValidateResult): Array<string> {
|
|
|
72
78
|
if (!result) {
|
|
73
79
|
return [];
|
|
74
80
|
}
|
|
75
|
-
return (Array.isArray(result)
|
|
81
|
+
return (Array.isArray(result)
|
|
82
|
+
? result
|
|
83
|
+
: [result]).filter(Boolean);
|
|
76
84
|
}
|
|
77
85
|
|
|
78
86
|
function isPromiseLike<T>(value: unknown): value is PromiseLike<T> {
|
|
@@ -80,7 +88,9 @@ function isPromiseLike<T>(value: unknown): value is PromiseLike<T> {
|
|
|
80
88
|
}
|
|
81
89
|
|
|
82
90
|
function getNativeErrors(element: NativeControl | undefined) {
|
|
83
|
-
return element?.validationMessage
|
|
91
|
+
return element?.validationMessage
|
|
92
|
+
? [element.validationMessage]
|
|
93
|
+
: [];
|
|
84
94
|
}
|
|
85
95
|
|
|
86
96
|
/**
|
|
@@ -138,10 +148,15 @@ export function useFieldValidation(options: UseFieldValidationOptions) {
|
|
|
138
148
|
|
|
139
149
|
// Barred controls (disabled, `type="button"`, …) have no usable state.
|
|
140
150
|
if (!live) {
|
|
141
|
-
return {
|
|
151
|
+
return {
|
|
152
|
+
...createValidityState(),
|
|
153
|
+
};
|
|
142
154
|
}
|
|
143
155
|
|
|
144
|
-
const state: FieldValidityState = {
|
|
156
|
+
const state: FieldValidityState = {
|
|
157
|
+
...createValidityState(live),
|
|
158
|
+
valid: live.valid,
|
|
159
|
+
};
|
|
145
160
|
|
|
146
161
|
// Only let `valueMissing` mark the field invalid once the value has been
|
|
147
162
|
// changed (or validation was forced), to reduce error noise.
|
|
@@ -156,7 +171,9 @@ export function useFieldValidation(options: UseFieldValidationOptions) {
|
|
|
156
171
|
|
|
157
172
|
function publish(state: FieldValidityState, messages: Array<string>, committedValue: unknown) {
|
|
158
173
|
validity.value = state;
|
|
159
|
-
errors.value = state.valid === false
|
|
174
|
+
errors.value = state.valid === false
|
|
175
|
+
? messages
|
|
176
|
+
: [];
|
|
160
177
|
value.value = committedValue;
|
|
161
178
|
}
|
|
162
179
|
|
|
@@ -173,7 +190,9 @@ export function useFieldValidation(options: UseFieldValidationOptions) {
|
|
|
173
190
|
clearCustomValidity();
|
|
174
191
|
|
|
175
192
|
let state = readState(source, currentValue);
|
|
176
|
-
const nativeErrors = state.valid === false
|
|
193
|
+
const nativeErrors = state.valid === false
|
|
194
|
+
? getNativeErrors(source.element)
|
|
195
|
+
: [];
|
|
177
196
|
const validateFn = options.validate.value;
|
|
178
197
|
|
|
179
198
|
if (!validateFn || (state.valid === false && !options.shouldValidateOnChange())) {
|
|
@@ -255,7 +274,10 @@ export function useFieldValidation(options: UseFieldValidationOptions) {
|
|
|
255
274
|
return;
|
|
256
275
|
}
|
|
257
276
|
|
|
258
|
-
publish({
|
|
277
|
+
publish({
|
|
278
|
+
...createValidityState(),
|
|
279
|
+
valid: true,
|
|
280
|
+
}, [], currentValue);
|
|
259
281
|
}
|
|
260
282
|
|
|
261
283
|
/** Runs on a value change: validates (debounced) when on-change validation applies. */
|
|
@@ -100,7 +100,9 @@ watchEffect((cleanupFn) => {
|
|
|
100
100
|
// originating inside a shadow root are retargeted to the host, so
|
|
101
101
|
// `container.contains(target)` never matches and focus escapes the trap.
|
|
102
102
|
const ownerDocument = container?.ownerDocument ?? document;
|
|
103
|
-
const root = container
|
|
103
|
+
const root = container
|
|
104
|
+
? (container.getRootNode() as Document | ShadowRoot)
|
|
105
|
+
: ownerDocument;
|
|
104
106
|
|
|
105
107
|
function handleFocusIn(event: FocusEvent) {
|
|
106
108
|
if (focusScope.paused || !container) {
|
|
@@ -68,7 +68,9 @@ onMounted(() => {
|
|
|
68
68
|
document.addEventListener('pointerup', handlePointerUp);
|
|
69
69
|
|
|
70
70
|
const tabbables = getTabbableNodes(contentElement.value);
|
|
71
|
-
tabbables.forEach((tabbable) =>
|
|
71
|
+
tabbables.forEach((tabbable) => {
|
|
72
|
+
tabbable.setAttribute('tabindex', '-1');
|
|
73
|
+
});
|
|
72
74
|
}
|
|
73
75
|
|
|
74
76
|
useEventListener(window, 'scroll', (event: Event) => {
|
package/src/HoverCard/index.ts
CHANGED
package/src/HoverCard/utils.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export function excludeTouch(eventHandler: () => void) {
|
|
2
|
-
return (event: PointerEvent) => event.pointerType === 'touch'
|
|
2
|
+
return (event: PointerEvent) => event.pointerType === 'touch'
|
|
3
|
+
? undefined
|
|
4
|
+
: eventHandler();
|
|
3
5
|
}
|
|
4
6
|
|
|
5
7
|
/**
|
|
@@ -13,7 +15,9 @@ export function getTabbableNodes(container: HTMLElement) {
|
|
|
13
15
|
// `.tabIndex` is not the same as the `tabindex` attribute. It works on the
|
|
14
16
|
// runtime's understanding of tabbability, so this automatically accounts
|
|
15
17
|
// for any kind of element that could be tabbed to.
|
|
16
|
-
return node.tabIndex >= 0
|
|
18
|
+
return node.tabIndex >= 0
|
|
19
|
+
? NodeFilter.FILTER_ACCEPT
|
|
20
|
+
: NodeFilter.FILTER_SKIP;
|
|
17
21
|
},
|
|
18
22
|
});
|
|
19
23
|
while (walker.nextNode()) {
|
|
@@ -131,7 +131,9 @@ const firstValue = ref<T>();
|
|
|
131
131
|
const isUserAction = ref(false);
|
|
132
132
|
const focusable = ref(true);
|
|
133
133
|
const modelValue = useVModel(props, 'modelValue', emits, {
|
|
134
|
-
defaultValue: props.defaultValue ?? (multiple.value
|
|
134
|
+
defaultValue: props.defaultValue ?? (multiple.value
|
|
135
|
+
? []
|
|
136
|
+
: undefined),
|
|
135
137
|
passive: (props.modelValue === undefined) as false,
|
|
136
138
|
deep: true,
|
|
137
139
|
}) as Ref<T | Array<T> | undefined>;
|
|
@@ -139,10 +141,14 @@ const modelValue = useVModel(props, 'modelValue', emits, {
|
|
|
139
141
|
function onValueChange(val: T) {
|
|
140
142
|
isUserAction.value = true;
|
|
141
143
|
if (props.multiple) {
|
|
142
|
-
const modelArray = Array.isArray(modelValue.value)
|
|
144
|
+
const modelArray = Array.isArray(modelValue.value)
|
|
145
|
+
? [...modelValue.value]
|
|
146
|
+
: [];
|
|
143
147
|
const index = modelArray.findIndex((i) => compare(i, val, props.by));
|
|
144
148
|
if (props.selectionBehavior === 'toggle') {
|
|
145
|
-
index === -1
|
|
149
|
+
index === -1
|
|
150
|
+
? modelArray.push(val)
|
|
151
|
+
: modelArray.splice(index, 1);
|
|
146
152
|
modelValue.value = modelArray;
|
|
147
153
|
} else {
|
|
148
154
|
modelValue.value = [val];
|
|
@@ -318,13 +324,17 @@ function isAtVirtualBoundary(intent: 'prev' | 'next') {
|
|
|
318
324
|
// window reaches the end of the full options list; any rendered items past
|
|
319
325
|
// the highlighted one are disabled.
|
|
320
326
|
const rendered = getItems(true).map((i) => i.ref);
|
|
321
|
-
const edge = intent === 'next'
|
|
327
|
+
const edge = intent === 'next'
|
|
328
|
+
? rendered.at(-1)
|
|
329
|
+
: rendered[0];
|
|
322
330
|
if (!edge) {
|
|
323
331
|
return false;
|
|
324
332
|
}
|
|
325
333
|
const position = Number(edge.getAttribute('aria-posinset'));
|
|
326
334
|
const size = Number(edge.getAttribute('aria-setsize'));
|
|
327
|
-
return intent === 'next'
|
|
335
|
+
return intent === 'next'
|
|
336
|
+
? position === size
|
|
337
|
+
: position === 1;
|
|
328
338
|
}
|
|
329
339
|
|
|
330
340
|
function onKeydownNavigation(event: KeyboardEvent) {
|
|
@@ -347,19 +357,25 @@ function onKeydownNavigation(event: KeyboardEvent) {
|
|
|
347
357
|
if (shouldLoop && isVirtual.value) {
|
|
348
358
|
if (isAtVirtualBoundary(intent)) {
|
|
349
359
|
// Let the virtualizer scroll to and highlight the opposite end.
|
|
350
|
-
const key = intent === 'next'
|
|
360
|
+
const key = intent === 'next'
|
|
361
|
+
? KEY_CODES.HOME
|
|
362
|
+
: KEY_CODES.END;
|
|
351
363
|
return virtualKeydownHook.trigger(new KeyboardEvent('keydown', { key, shiftKey: event.shiftKey }));
|
|
352
364
|
}
|
|
353
365
|
collection = [];
|
|
354
366
|
} else {
|
|
355
|
-
collection = shouldLoop
|
|
367
|
+
collection = shouldLoop
|
|
368
|
+
? collection.slice(0, 1)
|
|
369
|
+
: collection.slice(currentIndex + 1);
|
|
356
370
|
}
|
|
357
371
|
}
|
|
358
372
|
handleMultipleReplace(event, collection[0]);
|
|
359
373
|
}
|
|
360
374
|
|
|
361
375
|
if (collection.length) {
|
|
362
|
-
const index = !highlightedElement.value && intent === 'prev'
|
|
376
|
+
const index = !highlightedElement.value && intent === 'prev'
|
|
377
|
+
? collection.length - 1
|
|
378
|
+
: 0;
|
|
363
379
|
changeHighlight(collection[index]);
|
|
364
380
|
}
|
|
365
381
|
|
|
@@ -137,7 +137,9 @@ rootContext.virtualFocusHook.on(({ event, scroll }) => {
|
|
|
137
137
|
const item = queryCheckedElement(parentEl.value);
|
|
138
138
|
if (item) {
|
|
139
139
|
// eslint-disable-next-line no-nested-ternary
|
|
140
|
-
const focus = event
|
|
140
|
+
const focus = event
|
|
141
|
+
? true
|
|
142
|
+
: scroll ? undefined : false;
|
|
141
143
|
rootContext.changeHighlight(item, scroll, focus);
|
|
142
144
|
}
|
|
143
145
|
});
|
|
@@ -238,11 +240,15 @@ rootContext.virtualKeydownHook.on((event) => {
|
|
|
238
240
|
if (['first', 'last'].includes(intent)) {
|
|
239
241
|
event.preventDefault();
|
|
240
242
|
|
|
241
|
-
const index = intent === 'first'
|
|
243
|
+
const index = intent === 'first'
|
|
244
|
+
? 0
|
|
245
|
+
: props.options.length - 1;
|
|
242
246
|
virtualizer.value.scrollToIndex(index);
|
|
243
247
|
requestAnimationFrame(() => {
|
|
244
248
|
const items = getItems();
|
|
245
|
-
const item = intent === 'first'
|
|
249
|
+
const item = intent === 'first'
|
|
250
|
+
? items[0]
|
|
251
|
+
: items.at(-1);
|
|
246
252
|
if (item) {
|
|
247
253
|
rootContext.changeHighlight(item.ref);
|
|
248
254
|
}
|
|
@@ -94,6 +94,7 @@ export interface MenuRootContentTypeProps
|
|
|
94
94
|
import {
|
|
95
95
|
onUnmounted,
|
|
96
96
|
ref,
|
|
97
|
+
shallowRef,
|
|
97
98
|
toRefs,
|
|
98
99
|
watch,
|
|
99
100
|
} from 'vue';
|
|
@@ -166,7 +167,8 @@ function onKeydownEnter() {
|
|
|
166
167
|
}
|
|
167
168
|
|
|
168
169
|
const filterElement = ref<HTMLElement>();
|
|
169
|
-
|
|
170
|
+
// A deep `ref` would unwrap `trigger` to the element, so `trigger.value` would always be `undefined`.
|
|
171
|
+
const activeSubmenuContext = shallowRef<{ onOpenChange: (open: boolean) => void; trigger: Ref<HTMLElement | undefined> }>();
|
|
170
172
|
|
|
171
173
|
watch(highlightedElement, (el) => {
|
|
172
174
|
if (activeSubmenuContext.value && (el === undefined || el !== activeSubmenuContext.value.trigger.value)) {
|
|
@@ -266,7 +268,9 @@ function handleKeyDown(event: KeyboardEvent) {
|
|
|
266
268
|
return;
|
|
267
269
|
}
|
|
268
270
|
event.preventDefault();
|
|
269
|
-
const candidateNodes = [
|
|
271
|
+
const candidateNodes = [
|
|
272
|
+
...collectionItems.map((item) => item.ref),
|
|
273
|
+
];
|
|
270
274
|
if (LAST_KEYS.includes(event.key)) {
|
|
271
275
|
candidateNodes.reverse();
|
|
272
276
|
}
|
|
@@ -295,7 +299,9 @@ function handlePointerMove(event: PointerEvent) {
|
|
|
295
299
|
(event?.currentTarget as HTMLElement)?.contains(target)
|
|
296
300
|
&& pointerXHasChanged
|
|
297
301
|
) {
|
|
298
|
-
const newDir = event.clientX > lastPointerXRef.value
|
|
302
|
+
const newDir = event.clientX > lastPointerXRef.value
|
|
303
|
+
? 'right'
|
|
304
|
+
: 'left';
|
|
299
305
|
pointerDirRef.value = newDir;
|
|
300
306
|
lastPointerXRef.value = event.clientX;
|
|
301
307
|
}
|
package/src/Menu/MenuSub.vue
CHANGED
|
@@ -93,7 +93,9 @@ async function handlePointerLeave(event: PointerEvent) {
|
|
|
93
93
|
const side = menuContext.content.value?.dataset.side as Side;
|
|
94
94
|
|
|
95
95
|
const rightSide = side === 'right';
|
|
96
|
-
const bleed = rightSide
|
|
96
|
+
const bleed = rightSide
|
|
97
|
+
? -5
|
|
98
|
+
: +5;
|
|
97
99
|
const contentNearEdge = contentRect[rightSide ? 'left' : 'right'];
|
|
98
100
|
const contentFarEdge = contentRect[rightSide ? 'right' : 'left'];
|
|
99
101
|
|
package/src/Menu/utils.ts
CHANGED
|
@@ -8,7 +8,10 @@ export const ITEM_SELECT = 'menu.itemSelect';
|
|
|
8
8
|
export const SELECTION_KEYS = ['Enter', ' '];
|
|
9
9
|
export const FIRST_KEYS = ['ArrowDown', 'PageUp', 'Home'];
|
|
10
10
|
export const LAST_KEYS = ['ArrowUp', 'PageDown', 'End'];
|
|
11
|
-
export const FIRST_LAST_KEYS = [
|
|
11
|
+
export const FIRST_LAST_KEYS = [
|
|
12
|
+
...FIRST_KEYS,
|
|
13
|
+
...LAST_KEYS,
|
|
14
|
+
];
|
|
12
15
|
export const SUB_OPEN_KEYS: Record<Direction, Array<string>> = {
|
|
13
16
|
ltr: [...SELECTION_KEYS, 'ArrowRight'],
|
|
14
17
|
rtl: [...SELECTION_KEYS, 'ArrowLeft'],
|
|
@@ -71,8 +74,10 @@ export interface GraceIntent {
|
|
|
71
74
|
side: Side;
|
|
72
75
|
}
|
|
73
76
|
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Determine if a point is inside of a polygon.
|
|
79
|
+
* Based on https://github.com/substack/point-in-polygon
|
|
80
|
+
*/
|
|
76
81
|
export function isPointInPolygon(point: Point, polygon: Polygon) {
|
|
77
82
|
const { x, y } = point;
|
|
78
83
|
let inside = false;
|
|
@@ -42,7 +42,9 @@ function handleArrowNavigation(event: KeyboardEvent) {
|
|
|
42
42
|
'data-akar-menubar-subtrigger',
|
|
43
43
|
);
|
|
44
44
|
|
|
45
|
-
const prevMenuKey = rootContext.dir.value === 'rtl'
|
|
45
|
+
const prevMenuKey = rootContext.dir.value === 'rtl'
|
|
46
|
+
? 'ArrowRight'
|
|
47
|
+
: 'ArrowLeft';
|
|
46
48
|
const isPrevKey = prevMenuKey === event.key;
|
|
47
49
|
const isNextKey = !isPrevKey;
|
|
48
50
|
|
|
@@ -97,7 +97,9 @@ function handleArrowKey(e: KeyboardEvent) {
|
|
|
97
97
|
e.preventDefault();
|
|
98
98
|
e.stopPropagation();
|
|
99
99
|
const parentElement = rootContext.parentElement.value!;
|
|
100
|
-
const sign = rootContext.dir.value === 'rtl'
|
|
100
|
+
const sign = rootContext.dir.value === 'rtl'
|
|
101
|
+
? -1
|
|
102
|
+
: 1;
|
|
101
103
|
|
|
102
104
|
switch (e.code) {
|
|
103
105
|
case KEY_CODES.ARROW_RIGHT:
|
|
@@ -226,7 +226,9 @@ function onMonthChange(value: DateValue) {
|
|
|
226
226
|
modelValue.value = resolveMonthValue(value, modelValue.value as DateValue);
|
|
227
227
|
}
|
|
228
228
|
} else if (!modelValue.value) {
|
|
229
|
-
modelValue.value = [
|
|
229
|
+
modelValue.value = [
|
|
230
|
+
resolveMonthValue(value, placeholder.value),
|
|
231
|
+
];
|
|
230
232
|
} else {
|
|
231
233
|
const modelValueArray = Array.isArray(modelValue.value)
|
|
232
234
|
? modelValue.value
|
|
@@ -234,7 +236,10 @@ function onMonthChange(value: DateValue) {
|
|
|
234
236
|
|
|
235
237
|
const index = modelValueArray.findIndex((date) => isSameYearMonth(date, value));
|
|
236
238
|
if (index === -1) {
|
|
237
|
-
modelValue.value = [
|
|
239
|
+
modelValue.value = [
|
|
240
|
+
...modelValueArray,
|
|
241
|
+
resolveMonthValue(value, placeholder.value),
|
|
242
|
+
];
|
|
238
243
|
} else if (!preventDeselect.value) {
|
|
239
244
|
const next = modelValueArray.filter((date) => !isSameYearMonth(date, value));
|
|
240
245
|
if (!next.length) {
|
|
@@ -72,7 +72,9 @@ export function useMonthPicker(props: UseMonthPickerProps) {
|
|
|
72
72
|
const formatter = useDateFormatter(props.locale.value);
|
|
73
73
|
|
|
74
74
|
const resolveMatcher = (matcher?: Matcher | Ref<Matcher | undefined>) =>
|
|
75
|
-
isFunction(matcher)
|
|
75
|
+
isFunction(matcher)
|
|
76
|
+
? matcher
|
|
77
|
+
: matcher?.value;
|
|
76
78
|
|
|
77
79
|
const headingFormatOptions = computed(() => {
|
|
78
80
|
const options: DateFormatterOptions = {
|
|
@@ -172,7 +172,9 @@ function handleArrowKey(e: KeyboardEvent) {
|
|
|
172
172
|
e.preventDefault();
|
|
173
173
|
e.stopPropagation();
|
|
174
174
|
const parentElement = rootContext.parentElement.value!;
|
|
175
|
-
const sign = rootContext.dir.value === 'rtl'
|
|
175
|
+
const sign = rootContext.dir.value === 'rtl'
|
|
176
|
+
? -1
|
|
177
|
+
: 1;
|
|
176
178
|
|
|
177
179
|
switch (e.code) {
|
|
178
180
|
case KEY_CODES.ARROW_RIGHT:
|
|
@@ -265,7 +267,9 @@ function handleArrowKey(e: KeyboardEvent) {
|
|
|
265
267
|
return;
|
|
266
268
|
}
|
|
267
269
|
|
|
268
|
-
shiftFocus(candidateMonthValue, years > 0
|
|
270
|
+
shiftFocus(candidateMonthValue, years > 0
|
|
271
|
+
? 1
|
|
272
|
+
: -1, 1);
|
|
269
273
|
});
|
|
270
274
|
}
|
|
271
275
|
}
|
|
@@ -293,16 +293,31 @@ watch([startValue, endValue], ([_startValue, _endValue]) => {
|
|
|
293
293
|
isEditing.value = true;
|
|
294
294
|
if (_endValue && _startValue) {
|
|
295
295
|
const nextValue = compareYearMonth(_endValue, _startValue) < 0
|
|
296
|
-
? {
|
|
297
|
-
|
|
296
|
+
? {
|
|
297
|
+
start: _endValue.copy(),
|
|
298
|
+
end: _startValue.copy(),
|
|
299
|
+
}
|
|
300
|
+
: {
|
|
301
|
+
start: _startValue.copy(),
|
|
302
|
+
end: _endValue.copy(),
|
|
303
|
+
};
|
|
298
304
|
|
|
299
305
|
modelValue.value = { start: nextValue.start, end: nextValue.end };
|
|
300
306
|
isEditing.value = false;
|
|
301
|
-
validModelValue.value = {
|
|
307
|
+
validModelValue.value = {
|
|
308
|
+
start: nextValue.start.copy(),
|
|
309
|
+
end: nextValue.end.copy(),
|
|
310
|
+
};
|
|
302
311
|
} else {
|
|
303
312
|
modelValue.value = _startValue
|
|
304
|
-
? {
|
|
305
|
-
|
|
313
|
+
? {
|
|
314
|
+
start: _startValue.copy(),
|
|
315
|
+
end: undefined,
|
|
316
|
+
}
|
|
317
|
+
: {
|
|
318
|
+
start: _endValue?.copy(),
|
|
319
|
+
end: undefined,
|
|
320
|
+
};
|
|
306
321
|
}
|
|
307
322
|
});
|
|
308
323
|
|
|
@@ -91,7 +91,9 @@ export function useRangeMonthPickerState(props: UseRangeMonthPickerProps) {
|
|
|
91
91
|
return compareYearMonth(date, startLimit) < 0 || compareYearMonth(date, endLimit) > 0;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
const fixedValue = props.fixedDate.value === 'start'
|
|
94
|
+
const fixedValue = props.fixedDate.value === 'start'
|
|
95
|
+
? props.start.value
|
|
96
|
+
: props.end.value;
|
|
95
97
|
const maxDate = fixedValue.add({ months: maximumMonths - 1 });
|
|
96
98
|
const minDate = fixedValue.subtract({ months: maximumMonths - 1 });
|
|
97
99
|
return compareYearMonth(date, minDate) < 0 || compareYearMonth(date, maxDate) > 0;
|
|
@@ -131,11 +133,15 @@ export function useRangeMonthPickerState(props: UseRangeMonthPickerProps) {
|
|
|
131
133
|
|
|
132
134
|
if (compareYearMonth(focused, anchor) >= 0) {
|
|
133
135
|
const maxEnd = anchor.add({ months: maximumMonths - 1 });
|
|
134
|
-
const cappedEnd = compareYearMonth(focused, maxEnd) > 0
|
|
136
|
+
const cappedEnd = compareYearMonth(focused, maxEnd) > 0
|
|
137
|
+
? maxEnd
|
|
138
|
+
: focused;
|
|
135
139
|
return { start: anchor, end: cappedEnd };
|
|
136
140
|
} else {
|
|
137
141
|
const minStart = anchor.subtract({ months: maximumMonths - 1 });
|
|
138
|
-
const cappedStart = compareYearMonth(focused, minStart) < 0
|
|
142
|
+
const cappedStart = compareYearMonth(focused, minStart) < 0
|
|
143
|
+
? minStart
|
|
144
|
+
: focused;
|
|
139
145
|
return { start: cappedStart, end: anchor };
|
|
140
146
|
}
|
|
141
147
|
}
|
|
@@ -143,7 +149,9 @@ export function useRangeMonthPickerState(props: UseRangeMonthPickerProps) {
|
|
|
143
149
|
const isValid = areAllMonthsBetweenValid(
|
|
144
150
|
start,
|
|
145
151
|
end,
|
|
146
|
-
props.allowNonContiguousRanges.value
|
|
152
|
+
props.allowNonContiguousRanges.value
|
|
153
|
+
? () => false
|
|
154
|
+
: props.isMonthUnavailable,
|
|
147
155
|
rangeIsMonthDisabled,
|
|
148
156
|
);
|
|
149
157
|
if (isValid) {
|
|
@@ -63,11 +63,15 @@ const motionAttribute = computed(() => {
|
|
|
63
63
|
if (index !== prevIndex) {
|
|
64
64
|
// If we're moving to this item from another
|
|
65
65
|
if (isSelected && prevIndex !== -1) {
|
|
66
|
-
return index > prevIndex
|
|
66
|
+
return index > prevIndex
|
|
67
|
+
? 'from-end'
|
|
68
|
+
: 'from-start';
|
|
67
69
|
}
|
|
68
70
|
// If we're leaving this item for another
|
|
69
71
|
if (wasSelected && index !== -1) {
|
|
70
|
-
return index > prevIndex
|
|
72
|
+
return index > prevIndex
|
|
73
|
+
? 'to-start'
|
|
74
|
+
: 'to-end';
|
|
71
75
|
}
|
|
72
76
|
}
|
|
73
77
|
// Otherwise we're entering from closed or leaving the list
|
|
@@ -64,7 +64,9 @@ async function handleContentEntry(side = 'start') {
|
|
|
64
64
|
restoreContentTabOrderRef();
|
|
65
65
|
const candidates = getTabbableCandidates(el);
|
|
66
66
|
if (candidates.length) {
|
|
67
|
-
focusFirst(side === 'start'
|
|
67
|
+
focusFirst(side === 'start'
|
|
68
|
+
? candidates
|
|
69
|
+
: candidates.reverse());
|
|
68
70
|
}
|
|
69
71
|
}
|
|
70
72
|
}
|
|
@@ -79,7 +81,7 @@ function handleContentExit() {
|
|
|
79
81
|
}
|
|
80
82
|
}
|
|
81
83
|
|
|
82
|
-
provideNavigationMenuItemContext({
|
|
84
|
+
const itemContext = provideNavigationMenuItemContext({
|
|
83
85
|
value,
|
|
84
86
|
contentId,
|
|
85
87
|
triggerRef,
|
|
@@ -93,12 +95,21 @@ provideNavigationMenuItemContext({
|
|
|
93
95
|
|
|
94
96
|
function handleClose() {
|
|
95
97
|
context.onItemDismiss();
|
|
96
|
-
triggerRef.value?.focus();
|
|
98
|
+
itemContext.triggerRef.value?.focus();
|
|
97
99
|
}
|
|
98
100
|
|
|
99
101
|
function handleKeydown(ev: KeyboardEvent) {
|
|
100
102
|
const currentFocus = getActiveElement() as HTMLElement;
|
|
101
|
-
if (ev.keyCode === 32
|
|
103
|
+
if (ev.keyCode === 32) {
|
|
104
|
+
// Only the trigger of this item toggles; links and nested items keep their own behavior.
|
|
105
|
+
// `NavigationMenuTrigger` replaces `itemContext.triggerRef` with its element ref on mount.
|
|
106
|
+
if (ev.target !== itemContext.triggerRef.value) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if (ev.repeat) {
|
|
110
|
+
ev.preventDefault();
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
102
113
|
if (context.modelValue.value === value) {
|
|
103
114
|
handleClose();
|
|
104
115
|
ev.preventDefault();
|
|
@@ -120,7 +120,9 @@ function handleKeydown(ev: KeyboardEvent) {
|
|
|
120
120
|
if (ev.defaultPrevented) {
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
123
|
-
const verticalEntryKey = menuContext.dir.value === 'rtl'
|
|
123
|
+
const verticalEntryKey = menuContext.dir.value === 'rtl'
|
|
124
|
+
? 'ArrowLeft'
|
|
125
|
+
: 'ArrowRight';
|
|
124
126
|
const entryKey = { horizontal: 'ArrowDown', vertical: verticalEntryKey }[
|
|
125
127
|
menuContext.orientation
|
|
126
128
|
];
|
|
@@ -185,7 +187,7 @@ function handleVisuallyHiddenFocus(ev: FocusEvent) {
|
|
|
185
187
|
@focus="handleVisuallyHiddenFocus"
|
|
186
188
|
/>
|
|
187
189
|
<span
|
|
188
|
-
v-if="menuContext.viewport"
|
|
190
|
+
v-if="menuContext.viewport.value"
|
|
189
191
|
:aria-owns="contentId"
|
|
190
192
|
/>
|
|
191
193
|
</template>
|
|
@@ -78,5 +78,7 @@ export function removeFromTabOrder(candidates: Array<HTMLElement>) {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
export function whenMouse<E extends PointerEvent>(handler: (event?: E) => void) {
|
|
81
|
-
return (event: E) => (event.pointerType === 'mouse'
|
|
81
|
+
return (event: E) => (event.pointerType === 'mouse'
|
|
82
|
+
? handler(event)
|
|
83
|
+
: undefined);
|
|
82
84
|
}
|
|
@@ -79,9 +79,13 @@ function handleWheelEvent(event: WheelEvent) {
|
|
|
79
79
|
|
|
80
80
|
event.preventDefault();
|
|
81
81
|
if (event.deltaY > 0) {
|
|
82
|
-
rootContext.invertWheelChange.value
|
|
82
|
+
rootContext.invertWheelChange.value
|
|
83
|
+
? rootContext.handleDecrease()
|
|
84
|
+
: rootContext.handleIncrease();
|
|
83
85
|
} else if (event.deltaY < 0) {
|
|
84
|
-
rootContext.invertWheelChange.value
|
|
86
|
+
rootContext.invertWheelChange.value
|
|
87
|
+
? rootContext.handleIncrease()
|
|
88
|
+
: rootContext.handleDecrease();
|
|
85
89
|
}
|
|
86
90
|
}
|
|
87
91
|
|
|
@@ -123,7 +123,9 @@ const isIncreaseDisabled = computed(() => {
|
|
|
123
123
|
// step and rounding to nearest — which overshoots (e.g. 18.98 + step 1 -> 19.98 -> 20 not 19).
|
|
124
124
|
function getNextValue(type: 'increase' | 'decrease', from: number, multiplier = 1): number {
|
|
125
125
|
const stepValue = step.value ?? 1;
|
|
126
|
-
const operator = type === 'increase'
|
|
126
|
+
const operator = type === 'increase'
|
|
127
|
+
? '+'
|
|
128
|
+
: '-';
|
|
127
129
|
let nextValue: number;
|
|
128
130
|
|
|
129
131
|
if (stepSnapping.value && !isNaN(stepValue)) {
|
|
@@ -134,8 +136,12 @@ function getNextValue(type: 'increase' | 'decrease', from: number, multiplier =
|
|
|
134
136
|
// Align to the grid line in the requested direction first…
|
|
135
137
|
// eslint-disable-next-line no-nested-ternary
|
|
136
138
|
const aligned = type === 'increase'
|
|
137
|
-
? (snapped > from
|
|
138
|
-
|
|
139
|
+
? (snapped > from
|
|
140
|
+
? snapped
|
|
141
|
+
: handleDecimalOperation('+', snapped, stepValue))
|
|
142
|
+
: (snapped < from
|
|
143
|
+
? snapped
|
|
144
|
+
: handleDecimalOperation('-', snapped, stepValue));
|
|
139
145
|
// …then apply any remaining steps for multi-step keys (PageUp/PageDown).
|
|
140
146
|
nextValue = multiplier > 1
|
|
141
147
|
? handleDecimalOperation(operator, aligned, stepValue * (multiplier - 1))
|
|
@@ -173,7 +179,9 @@ function handleChangingValue(type: 'increase' | 'decrease', multiplier = 1) {
|
|
|
173
179
|
const nextValue = getNextValue(type, currentInputValue, multiplier);
|
|
174
180
|
// An out-of-range value (e.g. typed with `allowInvalid`) would be clamped against the requested
|
|
175
181
|
// direction — ArrowUp above `max` would lower it. Do nothing instead, like HTML stepUp/stepDown.
|
|
176
|
-
if (type === 'increase'
|
|
182
|
+
if (type === 'increase'
|
|
183
|
+
? nextValue < currentInputValue
|
|
184
|
+
: nextValue > currentInputValue) {
|
|
177
185
|
return;
|
|
178
186
|
}
|
|
179
187
|
modelValue.value = nextValue;
|
|
@@ -210,7 +218,9 @@ const inputMode = computed<HTMLAttributes['inputmode']>(() => {
|
|
|
210
218
|
// Replace negative textValue formatted using currencySign: 'accounting'
|
|
211
219
|
// with a textValue that can be announced using a minus sign.
|
|
212
220
|
const textValueFormatter = useNumberFormatter(locale, formatOptions);
|
|
213
|
-
const textValue = computed(() => isNullish(modelValue.value) || isNaN(modelValue.value)
|
|
221
|
+
const textValue = computed(() => isNullish(modelValue.value) || isNaN(modelValue.value)
|
|
222
|
+
? ''
|
|
223
|
+
: textValueFormatter.format(modelValue.value));
|
|
214
224
|
|
|
215
225
|
function validate(val: string) {
|
|
216
226
|
// `allowInvalid` lets out-of-range values be typed, so the bounds are skipped here — they
|