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
|
@@ -274,7 +274,9 @@ function onDateChange(value: DateValue) {
|
|
|
274
274
|
modelValue.value = value.copy();
|
|
275
275
|
}
|
|
276
276
|
} else if (!modelValue.value) {
|
|
277
|
-
modelValue.value = [
|
|
277
|
+
modelValue.value = [
|
|
278
|
+
value.copy(),
|
|
279
|
+
];
|
|
278
280
|
} else if (Array.isArray(modelValue.value)) {
|
|
279
281
|
const index = modelValue.value.findIndex((date) => isSameDay(date, value));
|
|
280
282
|
if (index === -1) {
|
|
@@ -76,7 +76,9 @@ export function useCalendarState(props: UseCalendarStateProps) {
|
|
|
76
76
|
);
|
|
77
77
|
|
|
78
78
|
const hasSelectedDate = computed(() => {
|
|
79
|
-
return Array.isArray(props.date.value)
|
|
79
|
+
return Array.isArray(props.date.value)
|
|
80
|
+
? props.date.value.length > 0
|
|
81
|
+
: !!props.date.value;
|
|
80
82
|
});
|
|
81
83
|
|
|
82
84
|
const isSelectedDateDisabled = computed(() => {
|
|
@@ -230,7 +232,9 @@ export function useCalendar(props: UseCalendarProps) {
|
|
|
230
232
|
const firstDate = grid.value[0].value;
|
|
231
233
|
|
|
232
234
|
if (!nextPageFunc && !props.nextPage.value) {
|
|
233
|
-
const newDate = firstDate.add({
|
|
235
|
+
const newDate = firstDate.add({
|
|
236
|
+
months: props.pagedNavigation.value ? props.numberOfMonths.value : 1,
|
|
237
|
+
});
|
|
234
238
|
|
|
235
239
|
const newGrid = createMonths({
|
|
236
240
|
dateObj: newDate,
|
|
@@ -278,7 +282,9 @@ export function useCalendar(props: UseCalendarProps) {
|
|
|
278
282
|
const firstDate = grid.value[0].value;
|
|
279
283
|
|
|
280
284
|
if (!prevPageFunc && !props.prevPage.value) {
|
|
281
|
-
const newDate = firstDate.subtract({
|
|
285
|
+
const newDate = firstDate.subtract({
|
|
286
|
+
months: props.pagedNavigation.value ? props.numberOfMonths.value : 1,
|
|
287
|
+
});
|
|
282
288
|
|
|
283
289
|
const newGrid = createMonths({
|
|
284
290
|
dateObj: newDate,
|
|
@@ -335,7 +341,12 @@ export function useCalendar(props: UseCalendarProps) {
|
|
|
335
341
|
});
|
|
336
342
|
});
|
|
337
343
|
|
|
338
|
-
watch([
|
|
344
|
+
watch([
|
|
345
|
+
props.locale,
|
|
346
|
+
props.weekStartsOn,
|
|
347
|
+
props.fixedWeeks,
|
|
348
|
+
props.numberOfMonths,
|
|
349
|
+
], () => {
|
|
339
350
|
grid.value = createMonths({
|
|
340
351
|
dateObj: props.placeholder.value,
|
|
341
352
|
weekStartsOn: props.weekStartsOn.value,
|
|
@@ -388,7 +399,9 @@ export function useCalendar(props: UseCalendarProps) {
|
|
|
388
399
|
}
|
|
389
400
|
|
|
390
401
|
const daysInMonth = getDaysInMonth(month.value);
|
|
391
|
-
const startDay = props.minValue.value && isSameMonth(props.minValue.value, month.value)
|
|
402
|
+
const startDay = props.minValue.value && isSameMonth(props.minValue.value, month.value)
|
|
403
|
+
? props.minValue.value.day
|
|
404
|
+
: 1;
|
|
392
405
|
|
|
393
406
|
for (let day = startDay; day <= daysInMonth; day++) {
|
|
394
407
|
const date = month.value.set({ day });
|
|
@@ -61,7 +61,9 @@ const modelValue = useVModel(props, 'modelValue', emits, {
|
|
|
61
61
|
}) as Ref<Array<T>>;
|
|
62
62
|
|
|
63
63
|
const rovingFocusProps = computed(() => {
|
|
64
|
-
return rovingFocus.value
|
|
64
|
+
return rovingFocus.value
|
|
65
|
+
? { loop: props.loop, dir: dir.value, orientation: props.orientation }
|
|
66
|
+
: {};
|
|
65
67
|
});
|
|
66
68
|
|
|
67
69
|
provideCheckboxGroupRootContext({
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compile-time type tests for the generic `CheckboxRoot`, validated by `vue-tsc`
|
|
3
|
+
* (see `shared/useEmitAsProps.test-d.ts`).
|
|
4
|
+
*
|
|
5
|
+
* The component is called the way `vue-tsc` checks a template usage, so the
|
|
6
|
+
* `TrueValue` / `FalseValue` generics are inferred exactly as in
|
|
7
|
+
* `<CheckboxRoot ... />`. They must be inferred from `trueValue` / `falseValue`
|
|
8
|
+
* only (or fall back to `true` / `false`, the runtime defaults), never from
|
|
9
|
+
* `modelValue` / `defaultValue`.
|
|
10
|
+
*/
|
|
11
|
+
import type { CheckboxRootEmits, CheckboxRootProps } from './CheckboxRoot.vue';
|
|
12
|
+
import CheckboxRoot from './CheckboxRoot.vue';
|
|
13
|
+
|
|
14
|
+
// Assertion helpers
|
|
15
|
+
type Expect<T extends true> = T;
|
|
16
|
+
type Equal<A, B>
|
|
17
|
+
= (<T>() => T extends A ? 1 : 2) extends (<T>() => T extends B ? 1 : 2) ? true : false;
|
|
18
|
+
|
|
19
|
+
type Payload<E> = E extends { 'update:modelValue': [value: infer P] } ? P : never;
|
|
20
|
+
|
|
21
|
+
// Public types: `trueValue` and `falseValue` can have different types
|
|
22
|
+
type _propsDefault = Expect<Equal<NonNullable<CheckboxRootProps['modelValue']>, boolean | 'indeterminate'>>;
|
|
23
|
+
// A single type argument keeps its previous meaning: both values share it
|
|
24
|
+
type _propsSingle = Expect<Equal<NonNullable<CheckboxRootProps<string>['modelValue']>, string | 'indeterminate'>>;
|
|
25
|
+
type _propsMixed = Expect<Equal<NonNullable<CheckboxRootProps<'on', 0>['modelValue']>, 'on' | 0 | 'indeterminate'>>;
|
|
26
|
+
type _emitsDefault = Expect<Equal<Payload<CheckboxRootEmits>, boolean | 'indeterminate'>>;
|
|
27
|
+
type _emitsSingle = Expect<Equal<Payload<CheckboxRootEmits<string>>, string | 'indeterminate'>>;
|
|
28
|
+
type _emitsMixed = Expect<Equal<Payload<CheckboxRootEmits<'on', 0>>, 'on' | 0 | 'indeterminate'>>;
|
|
29
|
+
|
|
30
|
+
declare const bool: boolean;
|
|
31
|
+
declare const str: string;
|
|
32
|
+
declare const num: number;
|
|
33
|
+
declare const onOff: 'on' | 'off';
|
|
34
|
+
declare const strOrNum: string | number;
|
|
35
|
+
declare const strOrFalse: string | false;
|
|
36
|
+
|
|
37
|
+
/** Never executed: only type-checked */
|
|
38
|
+
export function _checkboxRootTypeTests() {
|
|
39
|
+
// No `trueValue` / `falseValue`: boolean
|
|
40
|
+
CheckboxRoot({
|
|
41
|
+
'modelValue': bool,
|
|
42
|
+
'onUpdate:modelValue': (v) => {
|
|
43
|
+
type _ = Expect<Equal<typeof v, boolean | 'indeterminate'>>;
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// `trueValue` and `falseValue` of different types
|
|
48
|
+
CheckboxRoot({
|
|
49
|
+
'trueValue': 'on',
|
|
50
|
+
'falseValue': 0,
|
|
51
|
+
'modelValue': strOrNum,
|
|
52
|
+
'onUpdate:modelValue': (v) => {
|
|
53
|
+
type _ = Expect<Equal<typeof v, string | number | 'indeterminate'>>;
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// Only `trueValue`: the emitted value still includes `false`
|
|
58
|
+
CheckboxRoot({
|
|
59
|
+
'trueValue': 'on',
|
|
60
|
+
'modelValue': strOrFalse,
|
|
61
|
+
'onUpdate:modelValue': (v) => {
|
|
62
|
+
type _ = Expect<Equal<typeof v, string | false | 'indeterminate'>>;
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// Widened refs bound with v-model are accepted (e.g. `ref('off')`, `ref(0)`)
|
|
67
|
+
CheckboxRoot({
|
|
68
|
+
'trueValue': 'on',
|
|
69
|
+
'falseValue': 'off',
|
|
70
|
+
'modelValue': str,
|
|
71
|
+
'onUpdate:modelValue': (v) => {
|
|
72
|
+
type _ = Expect<Equal<typeof v, string | 'indeterminate'>>;
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
CheckboxRoot({ trueValue: 1, falseValue: 0, modelValue: num });
|
|
76
|
+
CheckboxRoot({ trueValue: 'on', falseValue: 'off', modelValue: onOff });
|
|
77
|
+
|
|
78
|
+
// `indeterminate` is always accepted
|
|
79
|
+
CheckboxRoot({ trueValue: 'on', falseValue: 'off', modelValue: 'indeterminate' });
|
|
80
|
+
CheckboxRoot({ defaultValue: 'indeterminate' });
|
|
81
|
+
|
|
82
|
+
// `modelValue` must not drive inference (`NoInfer`): the runtime emits `true` / `false` here
|
|
83
|
+
// @ts-expect-error 'on' | 'off' is not assignable to boolean
|
|
84
|
+
CheckboxRoot({ modelValue: onOff });
|
|
85
|
+
|
|
86
|
+
// @ts-expect-error the runtime emits `false`, not a number
|
|
87
|
+
CheckboxRoot({ trueValue: 'on', modelValue: num });
|
|
88
|
+
|
|
89
|
+
// @ts-expect-error `defaultValue` must match the type of `trueValue` or `falseValue`
|
|
90
|
+
CheckboxRoot({ trueValue: 1, falseValue: 0, defaultValue: 'off' });
|
|
91
|
+
}
|
|
@@ -7,11 +7,11 @@ import { useVModel } from '@vueuse/core';
|
|
|
7
7
|
import { createContext, isValueEqualOrExist, useFormControl, useForwardExpose, useForwardScopeId } from '@/shared';
|
|
8
8
|
import { injectCheckboxGroupRootContext } from './CheckboxGroupRoot.vue';
|
|
9
9
|
|
|
10
|
-
export interface CheckboxRootProps<
|
|
10
|
+
export interface CheckboxRootProps<TrueValue = boolean, FalseValue = TrueValue> extends PrimitiveProps, FormFieldProps {
|
|
11
11
|
/** The value of the checkbox when it is initially rendered. Use when you do not need to control its value. */
|
|
12
|
-
defaultValue?:
|
|
12
|
+
defaultValue?: NoInfer<TrueValue | FalseValue> | 'indeterminate';
|
|
13
13
|
/** The controlled value of the checkbox. Can be binded with v-model. */
|
|
14
|
-
modelValue?:
|
|
14
|
+
modelValue?: NoInfer<TrueValue | FalseValue> | 'indeterminate' | null;
|
|
15
15
|
/** When `true`, prevents the user from interacting with the checkbox */
|
|
16
16
|
disabled?: boolean;
|
|
17
17
|
/**
|
|
@@ -24,16 +24,16 @@ export interface CheckboxRootProps<T = boolean> extends PrimitiveProps, FormFiel
|
|
|
24
24
|
/**
|
|
25
25
|
* The value used when the checkbox is checked. Defaults to `true`.
|
|
26
26
|
*/
|
|
27
|
-
trueValue?:
|
|
27
|
+
trueValue?: TrueValue;
|
|
28
28
|
/**
|
|
29
29
|
* The value used when the checkbox is unchecked. Defaults to `false`.
|
|
30
30
|
*/
|
|
31
|
-
falseValue?:
|
|
31
|
+
falseValue?: FalseValue;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export type CheckboxRootEmits<
|
|
34
|
+
export type CheckboxRootEmits<TrueValue = boolean, FalseValue = TrueValue> = {
|
|
35
35
|
/** Event handler called when the value of the checkbox changes. */
|
|
36
|
-
'update:modelValue': [value:
|
|
36
|
+
'update:modelValue': [value: TrueValue | FalseValue | 'indeterminate'];
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
interface CheckboxRootContext {
|
|
@@ -45,7 +45,7 @@ export const [injectCheckboxRootContext, provideCheckboxRootContext]
|
|
|
45
45
|
= createContext<CheckboxRootContext>('CheckboxRoot');
|
|
46
46
|
</script>
|
|
47
47
|
|
|
48
|
-
<script setup lang="ts" generic="
|
|
48
|
+
<script setup lang="ts" generic="TrueValue = true, FalseValue = false">
|
|
49
49
|
import { isDeepEqual, isNullish } from '@vinicunca/perkakas';
|
|
50
50
|
import { computed, onBeforeUnmount, onMounted, useAttrs, watch } from 'vue';
|
|
51
51
|
import { injectFieldRootContext } from '@/Field';
|
|
@@ -58,14 +58,14 @@ defineOptions({
|
|
|
58
58
|
inheritAttrs: false,
|
|
59
59
|
});
|
|
60
60
|
|
|
61
|
-
const props = withDefaults(defineProps<CheckboxRootProps<
|
|
61
|
+
const props = withDefaults(defineProps<CheckboxRootProps<TrueValue, FalseValue>>(), {
|
|
62
62
|
modelValue: undefined,
|
|
63
63
|
value: 'on',
|
|
64
64
|
as: 'button',
|
|
65
65
|
trueValue: (() => true) as unknown as undefined,
|
|
66
66
|
falseValue: (() => false) as unknown as undefined,
|
|
67
67
|
});
|
|
68
|
-
const emits = defineEmits<CheckboxRootEmits<
|
|
68
|
+
const emits = defineEmits<CheckboxRootEmits<TrueValue, FalseValue>>();
|
|
69
69
|
|
|
70
70
|
defineSlots<{
|
|
71
71
|
default?: (props: {
|
|
@@ -88,7 +88,7 @@ const fieldContext = injectFieldRootContext(null);
|
|
|
88
88
|
const modelValue = useVModel(props as any, 'modelValue', emits as any, {
|
|
89
89
|
defaultValue: props.defaultValue ?? props.falseValue,
|
|
90
90
|
passive: (props.modelValue === undefined) as false,
|
|
91
|
-
}) as Ref<
|
|
91
|
+
}) as Ref<TrueValue | FalseValue | 'indeterminate'>;
|
|
92
92
|
|
|
93
93
|
// An unchecked checkbox can't be added once its group has reached `max`.
|
|
94
94
|
const isGroupMaxReached = computed(() => {
|
|
@@ -116,7 +116,9 @@ const resolvedName = computed(() => props.name ?? fieldContext?.name.value);
|
|
|
116
116
|
// never actually be `undefined`. Only fall back to the Field's `required`
|
|
117
117
|
// when a Field is present, so standalone output (where this cast has always
|
|
118
118
|
// applied) is untouched.
|
|
119
|
-
const resolvedRequired = computed(() => (fieldContext
|
|
119
|
+
const resolvedRequired = computed(() => (fieldContext
|
|
120
|
+
? (props.required || fieldContext.required.value)
|
|
121
|
+
: props.required));
|
|
120
122
|
|
|
121
123
|
const isChecked = computed(() => isDeepEqual(modelValue.value, props.trueValue));
|
|
122
124
|
|
|
@@ -143,7 +145,9 @@ function handleClick() {
|
|
|
143
145
|
const nextState = checkboxState.value !== true;
|
|
144
146
|
|
|
145
147
|
if (!isNullish(checkboxGroupContext?.modelValue.value)) {
|
|
146
|
-
const modelValueArray = [
|
|
148
|
+
const modelValueArray = [
|
|
149
|
+
...(checkboxGroupContext.modelValue.value || []),
|
|
150
|
+
];
|
|
147
151
|
if (isValueEqualOrExist(modelValueArray, props.value)) {
|
|
148
152
|
const index = modelValueArray.findIndex((i) => isDeepEqual(i, props.value));
|
|
149
153
|
modelValueArray.splice(index, 1);
|
|
@@ -153,9 +157,9 @@ function handleClick() {
|
|
|
153
157
|
checkboxGroupContext.modelValue.value = modelValueArray;
|
|
154
158
|
} else {
|
|
155
159
|
if (modelValue.value === 'indeterminate') {
|
|
156
|
-
modelValue.value = props.trueValue as
|
|
160
|
+
modelValue.value = props.trueValue as TrueValue;
|
|
157
161
|
} else {
|
|
158
|
-
modelValue.value = isChecked.value ? props.falseValue as
|
|
162
|
+
modelValue.value = isChecked.value ? props.falseValue as FalseValue : props.trueValue as TrueValue;
|
|
159
163
|
}
|
|
160
164
|
}
|
|
161
165
|
|
package/src/Checkbox/utils.ts
CHANGED
|
@@ -6,5 +6,7 @@ export function isIndeterminate(checked?: CheckedState): checked is 'indetermina
|
|
|
6
6
|
|
|
7
7
|
export function getState(checked: CheckedState) {
|
|
8
8
|
// eslint-disable-next-line no-nested-ternary
|
|
9
|
-
return isIndeterminate(checked)
|
|
9
|
+
return isIndeterminate(checked)
|
|
10
|
+
? 'indeterminate'
|
|
11
|
+
: checked ? 'checked' : 'unchecked';
|
|
10
12
|
}
|
|
@@ -33,7 +33,9 @@ export function useCollection<ItemData = {}>(options: { key?: string; isProvider
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
const item = context.itemMap.value.get(element);
|
|
36
|
-
return item && (includeDisabledItem || item.ref.dataset.disabled !== '')
|
|
36
|
+
return item && (includeDisabledItem || item.ref.dataset.disabled !== '')
|
|
37
|
+
? item
|
|
38
|
+
: undefined;
|
|
37
39
|
};
|
|
38
40
|
|
|
39
41
|
const getItems = (includeDisabledItem = false) => {
|
|
@@ -95,5 +97,12 @@ export function useCollection<ItemData = {}>(options: { key?: string; isProvider
|
|
|
95
97
|
const reactiveItems = computed(() => Array.from(context.itemMap.value.values()));
|
|
96
98
|
const itemMapSize = computed(() => context.itemMap.value.size);
|
|
97
99
|
|
|
98
|
-
return {
|
|
100
|
+
return {
|
|
101
|
+
getItems,
|
|
102
|
+
getItem,
|
|
103
|
+
reactiveItems,
|
|
104
|
+
itemMapSize,
|
|
105
|
+
CollectionSlot,
|
|
106
|
+
CollectionItem,
|
|
107
|
+
};
|
|
99
108
|
}
|
|
@@ -131,7 +131,7 @@ function handleKeyDown(event: KeyboardEvent) {
|
|
|
131
131
|
<Primitive
|
|
132
132
|
ref="primitiveElement"
|
|
133
133
|
:as-child="asChild"
|
|
134
|
-
:as="as"
|
|
134
|
+
:as="props.as"
|
|
135
135
|
role="application"
|
|
136
136
|
aria-roledescription="Color picker"
|
|
137
137
|
:aria-disabled="rootContext.disabled.value ? 'true' : undefined"
|
|
@@ -164,9 +164,21 @@ const areaStyles = computed(() => {
|
|
|
164
164
|
let bgColor = color.value;
|
|
165
165
|
if (colorSpace.value === 'hsl' || colorSpace.value === 'hsb') {
|
|
166
166
|
if (colorSpace.value === 'hsl') {
|
|
167
|
-
bgColor = {
|
|
167
|
+
bgColor = {
|
|
168
|
+
space: 'hsl',
|
|
169
|
+
h: hueValue.value,
|
|
170
|
+
s: 100,
|
|
171
|
+
l: 50,
|
|
172
|
+
alpha: 1,
|
|
173
|
+
};
|
|
168
174
|
} else {
|
|
169
|
-
bgColor = {
|
|
175
|
+
bgColor = {
|
|
176
|
+
space: 'hsb',
|
|
177
|
+
h: hueValue.value,
|
|
178
|
+
s: 100,
|
|
179
|
+
b: 100,
|
|
180
|
+
alpha: 1,
|
|
181
|
+
};
|
|
170
182
|
}
|
|
171
183
|
}
|
|
172
184
|
return getAreaBackgroundStyle(bgColor, xChannel.value, yChannel.value, colorSpace.value);
|
package/src/ColorArea/utils.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { clamp } from '@vinicunca/perkakas';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
/** https://github.com/tmcw-up-for-adoption/simple-linear-scale/blob/master/index.js */
|
|
4
4
|
export function linearScale(input: readonly [number, number], output: readonly [number, number]) {
|
|
5
5
|
return (value: number) => {
|
|
6
6
|
if (input[0] === input[1] || output[0] === output[1]) {
|
|
@@ -91,7 +91,9 @@ function toNativeSpace(color: Color, ch: ColorChannelType, space: ColorSpace): C
|
|
|
91
91
|
case 'lightness':
|
|
92
92
|
return convertToHsl(color);
|
|
93
93
|
case 'saturation':
|
|
94
|
-
return space === 'hsb'
|
|
94
|
+
return space === 'hsb'
|
|
95
|
+
? convertToHsb(color)
|
|
96
|
+
: convertToHsl(color);
|
|
95
97
|
case 'brightness':
|
|
96
98
|
return convertToHsb(color);
|
|
97
99
|
case 'red':
|
package/src/ColorSlider/utils.ts
CHANGED
|
@@ -1,18 +1,43 @@
|
|
|
1
1
|
import { clamp, KEY_CODES } from '@vinicunca/perkakas';
|
|
2
2
|
|
|
3
3
|
export const PAGE_KEYS = [KEY_CODES.PAGE_UP, KEY_CODES.PAGE_DOWN];
|
|
4
|
-
export const ARROW_KEYS = [
|
|
4
|
+
export const ARROW_KEYS = [
|
|
5
|
+
KEY_CODES.ARROW_UP,
|
|
6
|
+
KEY_CODES.ARROW_DOWN,
|
|
7
|
+
KEY_CODES.ARROW_LEFT,
|
|
8
|
+
KEY_CODES.ARROW_RIGHT,
|
|
9
|
+
];
|
|
5
10
|
|
|
6
11
|
export type SlideDirection = 'from-left' | 'from-right' | 'from-bottom' | 'from-top';
|
|
7
12
|
|
|
8
13
|
export const BACK_KEYS: Record<SlideDirection, Array<string>> = {
|
|
9
|
-
'from-left': [
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
'from-left': [
|
|
15
|
+
KEY_CODES.HOME,
|
|
16
|
+
KEY_CODES.PAGE_DOWN,
|
|
17
|
+
KEY_CODES.ARROW_DOWN,
|
|
18
|
+
KEY_CODES.ARROW_LEFT,
|
|
19
|
+
],
|
|
20
|
+
'from-right': [
|
|
21
|
+
KEY_CODES.HOME,
|
|
22
|
+
KEY_CODES.PAGE_DOWN,
|
|
23
|
+
KEY_CODES.ARROW_DOWN,
|
|
24
|
+
KEY_CODES.ARROW_RIGHT,
|
|
25
|
+
],
|
|
26
|
+
'from-bottom': [
|
|
27
|
+
KEY_CODES.HOME,
|
|
28
|
+
KEY_CODES.PAGE_DOWN,
|
|
29
|
+
KEY_CODES.ARROW_DOWN,
|
|
30
|
+
KEY_CODES.ARROW_LEFT,
|
|
31
|
+
],
|
|
32
|
+
'from-top': [
|
|
33
|
+
KEY_CODES.HOME,
|
|
34
|
+
KEY_CODES.PAGE_UP,
|
|
35
|
+
KEY_CODES.ARROW_UP,
|
|
36
|
+
KEY_CODES.ARROW_LEFT,
|
|
37
|
+
],
|
|
13
38
|
};
|
|
14
39
|
|
|
15
|
-
|
|
40
|
+
/** https://github.com/tmcw-up-for-adoption/simple-linear-scale/blob/master/index.js */
|
|
16
41
|
export function linearScale(input: readonly [number, number], output: readonly [number, number]) {
|
|
17
42
|
return (value: number) => {
|
|
18
43
|
if (input[0] === input[1] || output[0] === output[1]) {
|
|
@@ -26,7 +26,9 @@ const props = withDefaults(defineProps<ColorSwatchPickerRootProps>(), {
|
|
|
26
26
|
const emits = defineEmits<ColorSwatchPickerRootEmits>();
|
|
27
27
|
|
|
28
28
|
const modelValue = useVModel(props, 'modelValue', emits, {
|
|
29
|
-
defaultValue: props.defaultValue ?? (props.multiple
|
|
29
|
+
defaultValue: props.defaultValue ?? (props.multiple
|
|
30
|
+
? []
|
|
31
|
+
: ''),
|
|
30
32
|
// Cast required for VueUse's passive option type; enables passive sync when modelValue is undefined
|
|
31
33
|
passive: (props.modelValue === undefined) as false,
|
|
32
34
|
});
|
|
@@ -23,7 +23,9 @@ function handleClick() {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
if (rootContext.resetModelValueOnClear?.value) {
|
|
26
|
-
rootContext.modelValue.value = rootContext.multiple.value
|
|
26
|
+
rootContext.modelValue.value = rootContext.multiple.value
|
|
27
|
+
? []
|
|
28
|
+
: null;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
// Reset the search to show all options.
|
|
@@ -61,7 +61,10 @@ const isEmpty = computed(() => rootContext.ignoreFilter.value
|
|
|
61
61
|
|
|
62
62
|
const { forwardRef, currentElement } = useForwardExpose();
|
|
63
63
|
const scrollLocked = useBodyScrollLock(props.present && !!props.bodyLock);
|
|
64
|
-
watch([
|
|
64
|
+
watch([
|
|
65
|
+
() => props.present,
|
|
66
|
+
() => props.bodyLock,
|
|
67
|
+
], ([present, bodyLock]) => {
|
|
65
68
|
scrollLocked.value = present && !!bodyLock;
|
|
66
69
|
});
|
|
67
70
|
useFocusGuards();
|
|
@@ -136,7 +139,9 @@ function isEventTargetWithinCombobox(target: EventTarget | null) {
|
|
|
136
139
|
// click/focus to that control, so interacting with it should not dismiss the content.
|
|
137
140
|
// Without this, clicking such a label while open dismisses on `pointerdown` and the
|
|
138
141
|
// forwarded click/focus immediately re-opens it.
|
|
139
|
-
const label = target instanceof Element
|
|
142
|
+
const label = target instanceof Element
|
|
143
|
+
? target.closest('label')
|
|
144
|
+
: null;
|
|
140
145
|
const control = label?.control;
|
|
141
146
|
return !!control && !!rootContext.parentElement.value?.contains(control);
|
|
142
147
|
}
|
|
@@ -22,7 +22,11 @@ const props = defineProps<ComboboxGroupProps>();
|
|
|
22
22
|
const id = useId(undefined, 'akar-combobox-group');
|
|
23
23
|
const rootContext = injectComboboxRootContext();
|
|
24
24
|
|
|
25
|
-
const isRender = computed(() => rootContext.ignoreFilter.value
|
|
25
|
+
const isRender = computed(() => rootContext.ignoreFilter.value
|
|
26
|
+
? true
|
|
27
|
+
: !rootContext.filterSearch.value
|
|
28
|
+
? true
|
|
29
|
+
: rootContext.filterState.value.groups.has(id));
|
|
26
30
|
|
|
27
31
|
const context = provideComboboxGroupContext({
|
|
28
32
|
id,
|
|
@@ -125,7 +125,9 @@ const { multiple, disabled, ignoreFilter, resetSearchTermOnSelect, openOnFocus,
|
|
|
125
125
|
const dir = useDirection(propDir);
|
|
126
126
|
|
|
127
127
|
const modelValue = useVModel(props as ComboboxRootProps<T>, 'modelValue', emits, {
|
|
128
|
-
defaultValue: props.defaultValue ?? (multiple.value
|
|
128
|
+
defaultValue: props.defaultValue ?? (multiple.value
|
|
129
|
+
? []
|
|
130
|
+
: undefined),
|
|
129
131
|
passive: (props.modelValue === undefined) as false,
|
|
130
132
|
deep: true,
|
|
131
133
|
}) as Ref<T | Array<T>>;
|
|
@@ -132,7 +132,9 @@ const dir = useDirection(propDir);
|
|
|
132
132
|
const fieldContext = injectFieldRootContext(null);
|
|
133
133
|
const disabled = computed(() => Boolean(propDisabled.value || fieldContext?.disabled.value));
|
|
134
134
|
const resolvedName = computed(() => props.name ?? fieldContext?.name.value);
|
|
135
|
-
const resolvedRequired = computed(() => (fieldContext
|
|
135
|
+
const resolvedRequired = computed(() => (fieldContext
|
|
136
|
+
? (props.required || fieldContext.required.value)
|
|
137
|
+
: props.required));
|
|
136
138
|
|
|
137
139
|
const formatter = useDateFormatter(locale.value, {
|
|
138
140
|
hourCycle: normalizeHourCycle(props.hourCycle),
|
|
@@ -168,10 +170,14 @@ const step = computed(() => normalizeDateStep(props));
|
|
|
168
170
|
|
|
169
171
|
const inferredGranularity = computed(() => {
|
|
170
172
|
if (props.granularity) {
|
|
171
|
-
return !hasTime(placeholder.value)
|
|
173
|
+
return !hasTime(placeholder.value)
|
|
174
|
+
? 'day'
|
|
175
|
+
: props.granularity;
|
|
172
176
|
}
|
|
173
177
|
|
|
174
|
-
return hasTime(placeholder.value)
|
|
178
|
+
return hasTime(placeholder.value)
|
|
179
|
+
? 'minute'
|
|
180
|
+
: 'day';
|
|
175
181
|
});
|
|
176
182
|
|
|
177
183
|
const isInvalid = computed(() => {
|
|
@@ -196,7 +202,11 @@ const isInvalid = computed(() => {
|
|
|
196
202
|
|
|
197
203
|
const initialSegments = initializeSegmentValues(inferredGranularity.value);
|
|
198
204
|
|
|
199
|
-
const segmentValues = ref<SegmentValueObj>(modelValue.value
|
|
205
|
+
const segmentValues = ref<SegmentValueObj>(modelValue.value
|
|
206
|
+
? {
|
|
207
|
+
...syncSegmentValues({ value: modelValue.value, formatter }),
|
|
208
|
+
}
|
|
209
|
+
: { ...initialSegments });
|
|
200
210
|
|
|
201
211
|
const allSegmentContent = computed(() => createContent({
|
|
202
212
|
granularity: inferredGranularity.value,
|
|
@@ -238,7 +248,9 @@ watch(modelValue, (value, previous) => {
|
|
|
238
248
|
|
|
239
249
|
watch([modelValue, locale], ([_modelValue]) => {
|
|
240
250
|
if (!isNullish(_modelValue)) {
|
|
241
|
-
segmentValues.value = {
|
|
251
|
+
segmentValues.value = {
|
|
252
|
+
...syncSegmentValues({ value: _modelValue, formatter }),
|
|
253
|
+
};
|
|
242
254
|
} else if (Object.values(segmentValues.value).every((value) => value !== null) && isNullish(_modelValue)) {
|
|
243
255
|
// If segment has null value, means that user modified it, thus do not reset the segmentValues
|
|
244
256
|
segmentValues.value = { ...initialSegments };
|
|
@@ -256,8 +268,12 @@ const { nextFocusableSegment, prevFocusableSegment, focusNext } = useSegmentNavi
|
|
|
256
268
|
|
|
257
269
|
const inputType = computed(() => getInputType(inferredGranularity.value));
|
|
258
270
|
const inputValue = computed(() => normalizeInputValue(modelValue.value, inferredGranularity.value));
|
|
259
|
-
const inputMaxValue = computed(() => props.maxValue
|
|
260
|
-
|
|
271
|
+
const inputMaxValue = computed(() => props.maxValue
|
|
272
|
+
? normalizeInputValue(props.maxValue, inferredGranularity.value)
|
|
273
|
+
: undefined);
|
|
274
|
+
const inputMinValue = computed(() => props.minValue
|
|
275
|
+
? normalizeInputValue(props.minValue, inferredGranularity.value)
|
|
276
|
+
: undefined);
|
|
261
277
|
|
|
262
278
|
function handleKeydown(e: KeyboardEvent) {
|
|
263
279
|
// Don't navigate between segments mid-composition, arrow keys are used for IME candidate navigation
|
|
@@ -408,6 +424,7 @@ defineExpose({
|
|
|
408
424
|
:required="resolvedRequired"
|
|
409
425
|
:max="inputMaxValue"
|
|
410
426
|
:min="inputMinValue"
|
|
427
|
+
:step="inferredGranularity === 'second' ? 1 : undefined"
|
|
411
428
|
@focus="Array.from(segmentElements)?.[0]?.focus()"
|
|
412
429
|
/>
|
|
413
430
|
</Primitive>
|
|
@@ -148,7 +148,12 @@ function resetTime(date: DateValue) {
|
|
|
148
148
|
return date;
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
return date.set({
|
|
151
|
+
return date.set({
|
|
152
|
+
hour: 0,
|
|
153
|
+
minute: 0,
|
|
154
|
+
second: 0,
|
|
155
|
+
millisecond: 0,
|
|
156
|
+
});
|
|
152
157
|
}
|
|
153
158
|
|
|
154
159
|
watch(modelValue, (value, previous) => {
|
|
@@ -42,7 +42,9 @@ const {
|
|
|
42
42
|
disabled: rootContext.disabled,
|
|
43
43
|
readonly: rootContext.readonly,
|
|
44
44
|
focusNext: rootContext.focusNext,
|
|
45
|
-
modelValue: props.type === 'start'
|
|
45
|
+
modelValue: props.type === 'start'
|
|
46
|
+
? rootContext.startValue
|
|
47
|
+
: rootContext.endValue,
|
|
46
48
|
});
|
|
47
49
|
|
|
48
50
|
const disabled = computed(() => rootContext.disabled.value);
|