@neut/ui 0.0.12 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/calendar/Calendar/Calendar.d.ts +10 -0
- package/dist/components/calendar/Calendar/Calendar.js +306 -0
- package/dist/components/calendar/Calendar/Calendar.js.map +1 -0
- package/dist/components/calendar/Calendar/Calendar.types.d.ts +62 -0
- package/dist/components/calendar/Calendar/Calendar.utils.d.ts +21 -0
- package/dist/components/calendar/Calendar/Calendar.utils.js +68 -0
- package/dist/components/calendar/Calendar/Calendar.utils.js.map +1 -0
- package/dist/components/calendar/Calendar/index.d.ts +2 -0
- package/dist/components/calendar/index.d.ts +2 -0
- package/dist/components/calendar/index.js +2 -0
- package/dist/components/combobox/Combobox/Combobox.context.d.ts +3 -0
- package/dist/components/combobox/Combobox/Combobox.context.js +12 -0
- package/dist/components/combobox/Combobox/Combobox.context.js.map +1 -0
- package/dist/components/combobox/Combobox/Combobox.d.ts +3 -0
- package/dist/components/combobox/Combobox/Combobox.js +60 -0
- package/dist/components/combobox/Combobox/Combobox.js.map +1 -0
- package/dist/components/combobox/Combobox/Combobox.types.d.ts +40 -0
- package/dist/components/combobox/Combobox/index.d.ts +2 -0
- package/dist/components/combobox/ComboboxChip/ComboboxChip.d.ts +7 -0
- package/dist/components/combobox/ComboboxChip/ComboboxChip.js +35 -0
- package/dist/components/combobox/ComboboxChip/ComboboxChip.js.map +1 -0
- package/dist/components/combobox/ComboboxChip/index.d.ts +1 -0
- package/dist/components/combobox/ComboboxChips/ComboboxChips.d.ts +5 -0
- package/dist/components/combobox/ComboboxChips/ComboboxChips.js +16 -0
- package/dist/components/combobox/ComboboxChips/ComboboxChips.js.map +1 -0
- package/dist/components/combobox/ComboboxChips/index.d.ts +1 -0
- package/dist/components/combobox/ComboboxChipsInput/ComboboxChipsInput.d.ts +4 -0
- package/dist/components/combobox/ComboboxChipsInput/ComboboxChipsInput.js +27 -0
- package/dist/components/combobox/ComboboxChipsInput/ComboboxChipsInput.js.map +1 -0
- package/dist/components/combobox/ComboboxChipsInput/index.d.ts +1 -0
- package/dist/components/combobox/ComboboxClear/ComboboxClear.d.ts +4 -0
- package/dist/components/combobox/ComboboxClear/ComboboxClear.js +30 -0
- package/dist/components/combobox/ComboboxClear/ComboboxClear.js.map +1 -0
- package/dist/components/combobox/ComboboxClear/index.d.ts +1 -0
- package/dist/components/combobox/ComboboxCollection/ComboboxCollection.d.ts +5 -0
- package/dist/components/combobox/ComboboxCollection/ComboboxCollection.js +20 -0
- package/dist/components/combobox/ComboboxCollection/ComboboxCollection.js.map +1 -0
- package/dist/components/combobox/ComboboxCollection/index.d.ts +1 -0
- package/dist/components/combobox/ComboboxContent/ComboboxContent.d.ts +2 -0
- package/dist/components/combobox/ComboboxContent/ComboboxContent.js +49 -0
- package/dist/components/combobox/ComboboxContent/ComboboxContent.js.map +1 -0
- package/dist/components/combobox/ComboboxContent/ComboboxContent.types.d.ts +12 -0
- package/dist/components/combobox/ComboboxContent/ComboboxContent.utils.d.ts +2 -0
- package/dist/components/combobox/ComboboxContent/ComboboxContent.utils.js +6 -0
- package/dist/components/combobox/ComboboxContent/ComboboxContent.utils.js.map +1 -0
- package/dist/components/combobox/ComboboxContent/index.d.ts +1 -0
- package/dist/components/combobox/ComboboxContent/useComboboxContent.d.ts +13 -0
- package/dist/components/combobox/ComboboxContent/useComboboxContent.js +48 -0
- package/dist/components/combobox/ComboboxContent/useComboboxContent.js.map +1 -0
- package/dist/components/combobox/ComboboxEmpty/ComboboxEmpty.d.ts +5 -0
- package/dist/components/combobox/ComboboxEmpty/ComboboxEmpty.js +14 -0
- package/dist/components/combobox/ComboboxEmpty/ComboboxEmpty.js.map +1 -0
- package/dist/components/combobox/ComboboxEmpty/index.d.ts +1 -0
- package/dist/components/combobox/ComboboxGroup/ComboboxGroup.d.ts +5 -0
- package/dist/components/combobox/ComboboxGroup/ComboboxGroup.js +13 -0
- package/dist/components/combobox/ComboboxGroup/ComboboxGroup.js.map +1 -0
- package/dist/components/combobox/ComboboxGroup/index.d.ts +1 -0
- package/dist/components/combobox/ComboboxInput/ComboboxInput.d.ts +9 -0
- package/dist/components/combobox/ComboboxInput/ComboboxInput.js +85 -0
- package/dist/components/combobox/ComboboxInput/ComboboxInput.js.map +1 -0
- package/dist/components/combobox/ComboboxInput/index.d.ts +1 -0
- package/dist/components/combobox/ComboboxItem/ComboboxItem.d.ts +7 -0
- package/dist/components/combobox/ComboboxItem/ComboboxItem.js +40 -0
- package/dist/components/combobox/ComboboxItem/ComboboxItem.js.map +1 -0
- package/dist/components/combobox/ComboboxItem/index.d.ts +1 -0
- package/dist/components/combobox/ComboboxLabel/ComboboxLabel.d.ts +5 -0
- package/dist/components/combobox/ComboboxLabel/ComboboxLabel.js +14 -0
- package/dist/components/combobox/ComboboxLabel/ComboboxLabel.js.map +1 -0
- package/dist/components/combobox/ComboboxLabel/index.d.ts +1 -0
- package/dist/components/combobox/ComboboxList/ComboboxList.d.ts +5 -0
- package/dist/components/combobox/ComboboxList/ComboboxList.js +22 -0
- package/dist/components/combobox/ComboboxList/ComboboxList.js.map +1 -0
- package/dist/components/combobox/ComboboxList/index.d.ts +1 -0
- package/dist/components/combobox/ComboboxSeparator/ComboboxSeparator.d.ts +3 -0
- package/dist/components/combobox/ComboboxSeparator/ComboboxSeparator.js +14 -0
- package/dist/components/combobox/ComboboxSeparator/ComboboxSeparator.js.map +1 -0
- package/dist/components/combobox/ComboboxSeparator/index.d.ts +1 -0
- package/dist/components/combobox/ComboboxTrigger/ComboboxTrigger.d.ts +6 -0
- package/dist/components/combobox/ComboboxTrigger/ComboboxTrigger.js +34 -0
- package/dist/components/combobox/ComboboxTrigger/ComboboxTrigger.js.map +1 -0
- package/dist/components/combobox/ComboboxTrigger/index.d.ts +1 -0
- package/dist/components/combobox/ComboboxValue/ComboboxValue.d.ts +5 -0
- package/dist/components/combobox/ComboboxValue/ComboboxValue.js +15 -0
- package/dist/components/combobox/ComboboxValue/ComboboxValue.js.map +1 -0
- package/dist/components/combobox/ComboboxValue/index.d.ts +1 -0
- package/dist/components/combobox/index.d.ts +18 -0
- package/dist/components/combobox/index.js +18 -0
- package/dist/components/combobox/useComboboxAnchor/index.d.ts +1 -0
- package/dist/components/combobox/useComboboxAnchor/useComboboxAnchor.d.ts +1 -0
- package/dist/components/combobox/useComboboxAnchor/useComboboxAnchor.js +9 -0
- package/dist/components/combobox/useComboboxAnchor/useComboboxAnchor.js.map +1 -0
- package/dist/components/date-picker/DatePicker/DatePicker.d.ts +11 -0
- package/dist/components/date-picker/DatePicker/DatePicker.js +136 -0
- package/dist/components/date-picker/DatePicker/DatePicker.js.map +1 -0
- package/dist/components/date-picker/DatePicker/DatePicker.types.d.ts +32 -0
- package/dist/components/date-picker/DatePicker/index.d.ts +2 -0
- package/dist/components/date-picker/index.d.ts +2 -0
- package/dist/components/date-picker/index.js +2 -0
- package/dist/components/dialog/Dialog/Dialog.context.d.ts +2 -1
- package/dist/components/dialog/Dialog/Dialog.context.js.map +1 -1
- package/dist/components/dialog/Dialog/Dialog.js +21 -12
- package/dist/components/dialog/Dialog/Dialog.js.map +1 -1
- package/dist/components/dialog/Dialog/Dialog.types.d.ts +13 -1
- package/dist/components/dialog/Dialog/index.d.ts +1 -0
- package/dist/components/dialog/DialogTrigger/DialogTrigger.d.ts +4 -2
- package/dist/components/dialog/DialogTrigger/DialogTrigger.js +27 -6
- package/dist/components/dialog/DialogTrigger/DialogTrigger.js.map +1 -1
- package/dist/components/dialog/DialogTrigger/DialogTrigger.types.d.ts +3 -0
- package/dist/components/dialog/DialogTrigger/index.d.ts +3 -0
- package/dist/components/dialog/DialogTrigger/useDialogTrigger.d.ts +13 -2
- package/dist/components/dialog/DialogTrigger/useDialogTrigger.js +15 -19
- package/dist/components/dialog/DialogTrigger/useDialogTrigger.js.map +1 -1
- package/dist/components/dialog/index.js +3 -2
- package/dist/components/empty/Empty/Empty.d.ts +2 -0
- package/dist/components/empty/Empty/Empty.js +18 -0
- package/dist/components/empty/Empty/Empty.js.map +1 -0
- package/dist/components/empty/Empty/index.d.ts +1 -0
- package/dist/components/empty/EmptyContent/EmptyContent.d.ts +2 -0
- package/dist/components/empty/EmptyContent/EmptyContent.js +18 -0
- package/dist/components/empty/EmptyContent/EmptyContent.js.map +1 -0
- package/dist/components/empty/EmptyContent/index.d.ts +1 -0
- package/dist/components/empty/EmptyDescription/EmptyDescription.d.ts +2 -0
- package/dist/components/empty/EmptyDescription/EmptyDescription.js +18 -0
- package/dist/components/empty/EmptyDescription/EmptyDescription.js.map +1 -0
- package/dist/components/empty/EmptyDescription/index.d.ts +1 -0
- package/dist/components/empty/EmptyHeader/EmptyHeader.d.ts +2 -0
- package/dist/components/empty/EmptyHeader/EmptyHeader.js +18 -0
- package/dist/components/empty/EmptyHeader/EmptyHeader.js.map +1 -0
- package/dist/components/empty/EmptyHeader/index.d.ts +1 -0
- package/dist/components/empty/EmptyMedia/EmptyMedia.d.ts +4 -0
- package/dist/components/empty/EmptyMedia/EmptyMedia.js +27 -0
- package/dist/components/empty/EmptyMedia/EmptyMedia.js.map +1 -0
- package/dist/components/empty/EmptyMedia/EmptyMedia.styles.d.ts +3 -0
- package/dist/components/empty/EmptyMedia/EmptyMedia.styles.js +13 -0
- package/dist/components/empty/EmptyMedia/EmptyMedia.styles.js.map +1 -0
- package/dist/components/empty/EmptyMedia/EmptyMedia.types.d.ts +3 -0
- package/dist/components/empty/EmptyMedia/index.d.ts +2 -0
- package/dist/components/empty/EmptyTitle/EmptyTitle.d.ts +2 -0
- package/dist/components/empty/EmptyTitle/EmptyTitle.js +18 -0
- package/dist/components/empty/EmptyTitle/EmptyTitle.js.map +1 -0
- package/dist/components/empty/EmptyTitle/index.d.ts +1 -0
- package/dist/components/empty/index.d.ts +7 -0
- package/dist/components/empty/index.js +7 -0
- package/dist/components/image/Image.utils.js.map +1 -1
- package/dist/components/popover/Popover/Popover.context.d.ts +3 -0
- package/dist/components/popover/Popover/Popover.context.js +12 -0
- package/dist/components/popover/Popover/Popover.context.js.map +1 -0
- package/dist/components/popover/Popover/Popover.d.ts +18 -0
- package/dist/components/popover/Popover/Popover.js +37 -0
- package/dist/components/popover/Popover/Popover.js.map +1 -0
- package/dist/components/popover/Popover/Popover.types.d.ts +24 -0
- package/dist/components/popover/Popover/index.d.ts +3 -0
- package/dist/components/popover/PopoverContent/PopoverContent.d.ts +6 -0
- package/dist/components/popover/PopoverContent/PopoverContent.js +72 -0
- package/dist/components/popover/PopoverContent/PopoverContent.js.map +1 -0
- package/dist/components/popover/PopoverContent/PopoverContent.types.d.ts +16 -0
- package/dist/components/popover/PopoverContent/PopoverContent.utils.d.ts +20 -0
- package/dist/components/popover/PopoverContent/PopoverContent.utils.js +36 -0
- package/dist/components/popover/PopoverContent/PopoverContent.utils.js.map +1 -0
- package/dist/components/popover/PopoverContent/index.d.ts +6 -0
- package/dist/components/popover/PopoverContent/usePopoverContent.d.ts +11 -0
- package/dist/components/popover/PopoverContent/usePopoverContent.js +42 -0
- package/dist/components/popover/PopoverContent/usePopoverContent.js.map +1 -0
- package/dist/components/popover/PopoverDescription/PopoverDescription.d.ts +2 -0
- package/dist/components/popover/PopoverDescription/PopoverDescription.js +18 -0
- package/dist/components/popover/PopoverDescription/PopoverDescription.js.map +1 -0
- package/dist/components/popover/PopoverDescription/index.d.ts +1 -0
- package/dist/components/popover/PopoverHeader/PopoverHeader.d.ts +2 -0
- package/dist/components/popover/PopoverHeader/PopoverHeader.js +18 -0
- package/dist/components/popover/PopoverHeader/PopoverHeader.js.map +1 -0
- package/dist/components/popover/PopoverHeader/index.d.ts +1 -0
- package/dist/components/popover/PopoverTitle/PopoverTitle.d.ts +2 -0
- package/dist/components/popover/PopoverTitle/PopoverTitle.js +18 -0
- package/dist/components/popover/PopoverTitle/PopoverTitle.js.map +1 -0
- package/dist/components/popover/PopoverTitle/index.d.ts +1 -0
- package/dist/components/popover/PopoverTrigger/PopoverTrigger.d.ts +4 -0
- package/dist/components/popover/PopoverTrigger/PopoverTrigger.js +35 -0
- package/dist/components/popover/PopoverTrigger/PopoverTrigger.js.map +1 -0
- package/dist/components/popover/PopoverTrigger/PopoverTrigger.types.d.ts +3 -0
- package/dist/components/popover/PopoverTrigger/index.d.ts +4 -0
- package/dist/components/popover/PopoverTrigger/usePopoverTrigger.d.ts +14 -0
- package/dist/components/popover/PopoverTrigger/usePopoverTrigger.js +35 -0
- package/dist/components/popover/PopoverTrigger/usePopoverTrigger.js.map +1 -0
- package/dist/components/popover/index.d.ts +9 -0
- package/dist/components/popover/index.js +7 -0
- package/dist/components/radio-group/RadioGroup/RadioGroup.context.d.ts +3 -0
- package/dist/components/radio-group/RadioGroup/RadioGroup.context.js +12 -0
- package/dist/components/radio-group/RadioGroup/RadioGroup.context.js.map +1 -0
- package/dist/components/radio-group/RadioGroup/RadioGroup.d.ts +15 -0
- package/dist/components/radio-group/RadioGroup/RadioGroup.js +56 -0
- package/dist/components/radio-group/RadioGroup/RadioGroup.js.map +1 -0
- package/dist/components/radio-group/RadioGroup/RadioGroup.types.d.ts +22 -0
- package/dist/components/radio-group/RadioGroup/index.d.ts +3 -0
- package/dist/components/radio-group/RadioGroupItem/RadioGroupItem.d.ts +6 -0
- package/dist/components/radio-group/RadioGroupItem/RadioGroupItem.js +80 -0
- package/dist/components/radio-group/RadioGroupItem/RadioGroupItem.js.map +1 -0
- package/dist/components/radio-group/RadioGroupItem/RadioGroupItem.types.d.ts +9 -0
- package/dist/components/radio-group/RadioGroupItem/index.d.ts +2 -0
- package/dist/components/radio-group/index.d.ts +4 -0
- package/dist/components/radio-group/index.js +3 -0
- package/dist/components/select/Select/Select.context.d.ts +3 -3
- package/dist/components/select/Select/Select.context.js.map +1 -1
- package/dist/components/select/Select/Select.d.ts +5 -2
- package/dist/components/select/Select/Select.js +1 -1
- package/dist/components/select/Select/Select.js.map +1 -1
- package/dist/components/select/Select/Select.types.d.ts +19 -15
- package/dist/components/select/Select/index.d.ts +1 -1
- package/dist/components/select/SelectContent/SelectContent.js +2 -2
- package/dist/components/select/SelectContent/SelectContent.js.map +1 -1
- package/dist/components/select/SelectContent/SelectContent.utils.d.ts +2 -1
- package/dist/components/select/SelectContent/SelectContent.utils.js +2 -2
- package/dist/components/select/SelectContent/SelectContent.utils.js.map +1 -1
- package/dist/components/select/SelectContent/useSelectContent.js +6 -2
- package/dist/components/select/SelectContent/useSelectContent.js.map +1 -1
- package/dist/components/select/SelectItem/SelectItem.js +1 -1
- package/dist/components/select/SelectItem/SelectItem.js.map +1 -1
- package/dist/components/select/SelectItem/SelectItem.types.d.ts +3 -2
- package/dist/components/select/SelectItem/useSelectItem.d.ts +2 -1
- package/dist/components/select/SelectItem/useSelectItem.js +1 -1
- package/dist/components/select/SelectItem/useSelectItem.js.map +1 -1
- package/dist/components/select/SelectValue/SelectValue.js +1 -1
- package/dist/components/select/SelectValue/SelectValue.js.map +1 -1
- package/dist/components/toast/Toast/Toast.d.ts +3 -0
- package/dist/components/toast/Toast/Toast.js +181 -0
- package/dist/components/toast/Toast/Toast.js.map +1 -0
- package/dist/components/toast/Toast/Toast.styles.d.ts +6 -0
- package/dist/components/toast/Toast/Toast.styles.js +27 -0
- package/dist/components/toast/Toast/Toast.styles.js.map +1 -0
- package/dist/components/toast/Toast/Toast.types.d.ts +90 -0
- package/dist/components/toast/Toast/Toast.types.js +6 -0
- package/dist/components/toast/Toast/Toast.types.js.map +1 -0
- package/dist/components/toast/Toast/index.d.ts +2 -0
- package/dist/components/toast/{components → Toaster}/Toaster.d.ts +1 -1
- package/dist/components/toast/Toaster/Toaster.js +102 -0
- package/dist/components/toast/Toaster/Toaster.js.map +1 -0
- package/dist/components/toast/Toaster/Toaster.styles.d.ts +1 -0
- package/dist/components/toast/Toaster/Toaster.styles.js +6 -0
- package/dist/components/toast/Toaster/Toaster.styles.js.map +1 -0
- package/dist/components/toast/Toaster/Toaster.types.d.ts +44 -0
- package/dist/components/toast/Toaster/Toaster.utils.d.ts +7 -0
- package/dist/components/toast/Toaster/Toaster.utils.js +33 -0
- package/dist/components/toast/Toaster/Toaster.utils.js.map +1 -0
- package/dist/components/toast/Toaster/index.d.ts +3 -0
- package/dist/components/toast/index.d.ts +5 -10
- package/dist/components/toast/index.js +4 -5
- package/dist/components/toast/state/index.d.ts +1 -0
- package/dist/components/toast/state/toast.d.ts +24 -0
- package/dist/components/toast/state/toast.js +116 -0
- package/dist/components/toast/state/toast.js.map +1 -0
- package/dist/components/toggle/Toggle/Toggle.d.ts +3 -0
- package/dist/components/toggle/Toggle/Toggle.js +49 -0
- package/dist/components/toggle/Toggle/Toggle.js.map +1 -0
- package/dist/components/toggle/Toggle/Toggle.styles.d.ts +4 -0
- package/dist/components/toggle/Toggle/Toggle.styles.js +23 -0
- package/dist/components/toggle/Toggle/Toggle.styles.js.map +1 -0
- package/dist/components/toggle/Toggle/Toggle.types.d.ts +12 -0
- package/dist/components/toggle/Toggle/index.d.ts +3 -0
- package/dist/components/toggle/index.d.ts +2 -0
- package/dist/components/toggle/index.js +3 -0
- package/dist/components/toggle-group/ToggleGroup/ToggleGroup.context.d.ts +36 -0
- package/dist/components/toggle-group/ToggleGroup/ToggleGroup.context.js +40 -0
- package/dist/components/toggle-group/ToggleGroup/ToggleGroup.context.js.map +1 -0
- package/dist/components/toggle-group/ToggleGroup/ToggleGroup.d.ts +18 -0
- package/dist/components/toggle-group/ToggleGroup/ToggleGroup.js +94 -0
- package/dist/components/toggle-group/ToggleGroup/ToggleGroup.js.map +1 -0
- package/dist/components/toggle-group/ToggleGroup/ToggleGroup.styles.d.ts +8 -0
- package/dist/components/toggle-group/ToggleGroup/ToggleGroup.styles.js +7 -0
- package/dist/components/toggle-group/ToggleGroup/ToggleGroup.styles.js.map +1 -0
- package/dist/components/toggle-group/ToggleGroup/ToggleGroup.types.d.ts +104 -0
- package/dist/components/toggle-group/ToggleGroup/create-change-event-details.d.ts +8 -0
- package/dist/components/toggle-group/ToggleGroup/create-change-event-details.js +25 -0
- package/dist/components/toggle-group/ToggleGroup/create-change-event-details.js.map +1 -0
- package/dist/components/toggle-group/ToggleGroup/index.d.ts +3 -0
- package/dist/components/toggle-group/ToggleGroup/useToggleGroupKeyboard.d.ts +17 -0
- package/dist/components/toggle-group/ToggleGroup/useToggleGroupKeyboard.js +47 -0
- package/dist/components/toggle-group/ToggleGroup/useToggleGroupKeyboard.js.map +1 -0
- package/dist/components/toggle-group/ToggleGroupItem/ToggleGroupItem.d.ts +11 -0
- package/dist/components/toggle-group/ToggleGroupItem/ToggleGroupItem.js +88 -0
- package/dist/components/toggle-group/ToggleGroupItem/ToggleGroupItem.js.map +1 -0
- package/dist/components/toggle-group/ToggleGroupItem/ToggleGroupItem.styles.d.ts +12 -0
- package/dist/components/toggle-group/ToggleGroupItem/ToggleGroupItem.styles.js +7 -0
- package/dist/components/toggle-group/ToggleGroupItem/ToggleGroupItem.styles.js.map +1 -0
- package/dist/components/toggle-group/ToggleGroupItem/ToggleGroupItem.types.d.ts +20 -0
- package/dist/components/toggle-group/ToggleGroupItem/index.d.ts +2 -0
- package/dist/components/toggle-group/call-event-handler.d.ts +5 -0
- package/dist/components/toggle-group/call-event-handler.js +9 -0
- package/dist/components/toggle-group/call-event-handler.js.map +1 -0
- package/dist/components/toggle-group/index.d.ts +4 -0
- package/dist/components/toggle-group/index.js +3 -0
- package/dist/components/tooltip/Tooltip/Tooltip.js +51 -50
- package/dist/components/tooltip/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/tooltip/TooltipArrow/TooltipArrow.d.ts +3 -28
- package/dist/components/tooltip/TooltipArrow/TooltipArrow.js +13 -45
- package/dist/components/tooltip/TooltipArrow/TooltipArrow.js.map +1 -1
- package/dist/components/tooltip/TooltipContent/TooltipContent.context.d.ts +2 -0
- package/dist/components/tooltip/TooltipContent/TooltipContent.context.js.map +1 -1
- package/dist/components/tooltip/TooltipContent/TooltipContent.js +2 -1
- package/dist/components/tooltip/TooltipContent/TooltipContent.js.map +1 -1
- package/dist/components/tooltip/TooltipContent/TooltipContent.types.d.ts +3 -2
- package/dist/components/tooltip/TooltipContent/TooltipContent.utils.d.ts +2 -1
- package/dist/components/tooltip/TooltipContent/TooltipContent.utils.js +8 -4
- package/dist/components/tooltip/TooltipContent/TooltipContent.utils.js.map +1 -1
- package/dist/components/tooltip/TooltipContent/useTooltipContent.js +20 -19
- package/dist/components/tooltip/TooltipContent/useTooltipContent.js.map +1 -1
- package/dist/components/tooltip/TooltipProvider/TooltipProvider.context.d.ts +3 -0
- package/dist/components/tooltip/TooltipProvider/TooltipProvider.context.js +10 -0
- package/dist/components/tooltip/TooltipProvider/TooltipProvider.context.js.map +1 -0
- package/dist/components/tooltip/TooltipProvider/TooltipProvider.d.ts +3 -0
- package/dist/components/tooltip/TooltipProvider/TooltipProvider.js +20 -0
- package/dist/components/tooltip/TooltipProvider/TooltipProvider.js.map +1 -0
- package/dist/components/tooltip/TooltipProvider/TooltipProvider.types.d.ts +11 -0
- package/dist/components/tooltip/TooltipProvider/index.d.ts +3 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/index.js +7 -6
- package/dist/index.d.ts +8 -0
- package/dist/index.js +153 -115
- package/dist/ui.css +1 -1
- package/package.json +7 -6
- package/dist/components/toast/components/Assets.d.ts +0 -9
- package/dist/components/toast/components/Assets.js +0 -32
- package/dist/components/toast/components/Assets.js.map +0 -1
- package/dist/components/toast/components/Toast.d.ts +0 -3
- package/dist/components/toast/components/Toast.js +0 -152
- package/dist/components/toast/components/Toast.js.map +0 -1
- package/dist/components/toast/components/ToastActions.d.ts +0 -12
- package/dist/components/toast/components/ToastActions.js +0 -62
- package/dist/components/toast/components/ToastActions.js.map +0 -1
- package/dist/components/toast/components/ToastContent.d.ts +0 -9
- package/dist/components/toast/components/ToastContent.js +0 -36
- package/dist/components/toast/components/ToastContent.js.map +0 -1
- package/dist/components/toast/components/ToastIcon.d.ts +0 -9
- package/dist/components/toast/components/ToastIcon.js +0 -59
- package/dist/components/toast/components/ToastIcon.js.map +0 -1
- package/dist/components/toast/components/Toaster.js +0 -163
- package/dist/components/toast/components/Toaster.js.map +0 -1
- package/dist/components/toast/constants.d.ts +0 -16
- package/dist/components/toast/constants.js +0 -6
- package/dist/components/toast/constants.js.map +0 -1
- package/dist/components/toast/hooks/useSwipe.d.ts +0 -23
- package/dist/components/toast/hooks/useSwipe.js +0 -59
- package/dist/components/toast/hooks/useSwipe.js.map +0 -1
- package/dist/components/toast/hooks/useTheme.d.ts +0 -2
- package/dist/components/toast/hooks/useTheme.js +0 -22
- package/dist/components/toast/hooks/useTheme.js.map +0 -1
- package/dist/components/toast/hooks/useToastHeight.d.ts +0 -11
- package/dist/components/toast/hooks/useToastHeight.js +0 -35
- package/dist/components/toast/hooks/useToastHeight.js.map +0 -1
- package/dist/components/toast/hooks/useToastSubscription.d.ts +0 -5
- package/dist/components/toast/hooks/useToastSubscription.js +0 -38
- package/dist/components/toast/hooks/useToastSubscription.js.map +0 -1
- package/dist/components/toast/hooks/useToastTimer.d.ts +0 -11
- package/dist/components/toast/hooks/useToastTimer.js +0 -22
- package/dist/components/toast/hooks/useToastTimer.js.map +0 -1
- package/dist/components/toast/hooks/useToasterKeyboard.d.ts +0 -7
- package/dist/components/toast/hooks/useToasterKeyboard.js +0 -14
- package/dist/components/toast/hooks/useToasterKeyboard.js.map +0 -1
- package/dist/components/toast/hooks.d.ts +0 -13
- package/dist/components/toast/hooks.js +0 -37
- package/dist/components/toast/hooks.js.map +0 -1
- package/dist/components/toast/state.d.ts +0 -52
- package/dist/components/toast/state.js +0 -170
- package/dist/components/toast/state.js.map +0 -1
- package/dist/components/toast/types.d.ts +0 -168
- package/dist/components/toast/types.js +0 -6
- package/dist/components/toast/types.js.map +0 -1
- package/dist/components/toast/utils.d.ts +0 -10
- package/dist/components/toast/utils.js +0 -39
- package/dist/components/toast/utils.js.map +0 -1
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { clsx as e } from "../../../utils/clsx.js";
|
|
2
|
+
import { useComboboxContext as t } from "../Combobox/Combobox.context.js";
|
|
3
|
+
import { InputGroup as n } from "../../input-group/InputGroup/InputGroup.js";
|
|
4
|
+
import { InputGroupAddon as r } from "../../input-group/InputGroupAddon/InputGroupAddon.js";
|
|
5
|
+
import { InputGroupInput as i } from "../../input-group/InputGroupInput/InputGroupInput.js";
|
|
6
|
+
import { ComboboxClear as a } from "../ComboboxClear/ComboboxClear.js";
|
|
7
|
+
import { createComponent as o, memo as s } from "solid-js/web";
|
|
8
|
+
import { Show as c, createEffect as l, mergeProps as u, onCleanup as d } from "solid-js";
|
|
9
|
+
//#region src/components/combobox/ComboboxInput/ComboboxInput.tsx
|
|
10
|
+
function f(f) {
|
|
11
|
+
let p = t("ComboboxInput"), m = u({ showClear: !1 }, f), h = () => p.disabled() || !!m.disabled, g = p.reference() !== void 0, _;
|
|
12
|
+
l(() => {
|
|
13
|
+
p.open() && g && _ && _.focus();
|
|
14
|
+
});
|
|
15
|
+
let v = () => {
|
|
16
|
+
let e = p.value();
|
|
17
|
+
return e == null ? !1 : Array.isArray(e) ? e.length > 0 : e !== "";
|
|
18
|
+
}, y = (e) => {
|
|
19
|
+
if (h()) return;
|
|
20
|
+
let t = p.filteredItems();
|
|
21
|
+
if (e.key === "ArrowDown") e.preventDefault(), p.setOpen(!0), p.setActiveIndex(t.length === 0 ? -1 : (p.activeIndex() + 1) % t.length);
|
|
22
|
+
else if (e.key === "ArrowUp") e.preventDefault(), p.setOpen(!0), p.setActiveIndex(t.length === 0 ? -1 : (p.activeIndex() - 1 + t.length) % t.length);
|
|
23
|
+
else if (e.key === "Enter" && p.open()) {
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
let t = p.filteredItems()[p.activeIndex()];
|
|
26
|
+
t !== void 0 && p.selectItem(t);
|
|
27
|
+
} else e.key === "Escape" && p.open() && (e.preventDefault(), p.close());
|
|
28
|
+
};
|
|
29
|
+
return o(n, {
|
|
30
|
+
ref: (e) => {
|
|
31
|
+
p.reference() || p.setReference(e), d(() => {
|
|
32
|
+
p.reference() === e && p.setReference(void 0);
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
get class() {
|
|
36
|
+
return e("w-auto", m.class);
|
|
37
|
+
},
|
|
38
|
+
get children() {
|
|
39
|
+
return [
|
|
40
|
+
o(i, {
|
|
41
|
+
ref: (e) => {
|
|
42
|
+
_ = e;
|
|
43
|
+
},
|
|
44
|
+
get placeholder() {
|
|
45
|
+
return m.placeholder;
|
|
46
|
+
},
|
|
47
|
+
get disabled() {
|
|
48
|
+
return h();
|
|
49
|
+
},
|
|
50
|
+
get "aria-invalid"() {
|
|
51
|
+
return m["aria-invalid"];
|
|
52
|
+
},
|
|
53
|
+
get value() {
|
|
54
|
+
return p.inputValue();
|
|
55
|
+
},
|
|
56
|
+
onInput: (e) => {
|
|
57
|
+
let t = String(e);
|
|
58
|
+
p.setInputValue(t), p.setFilterValue(t), p.setOpen(!0), !p.multiple() && t.trim() === "" && (p.setValue(null), p.setFilterValue(""));
|
|
59
|
+
},
|
|
60
|
+
onFocus: () => p.setOpen(!0),
|
|
61
|
+
onClick: () => p.setOpen(!0),
|
|
62
|
+
onKeyDown: y
|
|
63
|
+
}),
|
|
64
|
+
o(r, {
|
|
65
|
+
align: "inline-end",
|
|
66
|
+
get children() {
|
|
67
|
+
return o(c, {
|
|
68
|
+
get when() {
|
|
69
|
+
return s(() => !!(m.showClear && v()))() && !h();
|
|
70
|
+
},
|
|
71
|
+
get children() {
|
|
72
|
+
return o(a, {});
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}),
|
|
77
|
+
s(() => m.children)
|
|
78
|
+
];
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
export { f as ComboboxInput };
|
|
84
|
+
|
|
85
|
+
//# sourceMappingURL=ComboboxInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComboboxInput.js","names":["Show","createEffect","mergeProps","onCleanup","JSX","InputGroup","InputGroupAddon","InputGroupInput","clsx","useComboboxContext","ComboboxClear","ComboboxInput","props","placeholder","disabled","showClear","class","children","Element","ctx","local","mountedWithExternalReference","reference","undefined","inputEl","HTMLInputElement","open","focus","hasValue","current","value","Array","isArray","length","onKeyDown","e","KeyboardEvent","list","filteredItems","key","preventDefault","setOpen","setActiveIndex","activeIndex","item","selectItem","close","_$createComponent","ref","el","setReference","aria-invalid","inputValue","onInput","next","String","setInputValue","setFilterValue","multiple","trim","setValue","onFocus","onClick","align","when","_$memo"],"sources":["../../../../src/components/combobox/ComboboxInput/ComboboxInput.tsx"],"sourcesContent":["import { Show, createEffect, mergeProps, onCleanup, type JSX } from \"solid-js\";\nimport {\n InputGroup,\n InputGroupAddon,\n InputGroupInput,\n} from \"~/components/input-group\";\nimport { clsx } from \"~/utils\";\nimport { useComboboxContext } from \"../Combobox/Combobox.context\";\nimport { ComboboxClear } from \"../ComboboxClear\";\n\nexport function ComboboxInput(props: {\n placeholder?: string;\n disabled?: boolean;\n showClear?: boolean;\n class?: string;\n \"aria-invalid\"?: string | boolean;\n children?: JSX.Element;\n}) {\n const ctx = useComboboxContext(\"ComboboxInput\");\n const local = mergeProps({ showClear: false }, props);\n const disabled = () => ctx.disabled() || !!local.disabled;\n // 当 ComboboxInput 作为 ComboboxContent 子组件时(Popup 模式),\n // 此时 reference 已经由 ComboboxTrigger 设置。打开弹层后自动聚焦输入框。\n const mountedWithExternalReference = ctx.reference() !== undefined;\n let inputEl: HTMLInputElement | undefined;\n\n createEffect(() => {\n if (ctx.open() && mountedWithExternalReference && inputEl) {\n inputEl.focus();\n }\n });\n\n const hasValue = () => {\n const current = ctx.value();\n if (current == null) return false;\n if (Array.isArray(current)) return current.length > 0;\n return current !== \"\";\n };\n\n const onKeyDown = (e: KeyboardEvent) => {\n if (disabled()) return;\n const list = ctx.filteredItems();\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n ctx.setOpen(true);\n ctx.setActiveIndex(\n list.length === 0 ? -1 : (ctx.activeIndex() + 1) % list.length,\n );\n } else if (e.key === \"ArrowUp\") {\n e.preventDefault();\n ctx.setOpen(true);\n ctx.setActiveIndex(\n list.length === 0\n ? -1\n : (ctx.activeIndex() - 1 + list.length) % list.length,\n );\n } else if (e.key === \"Enter\" && ctx.open()) {\n e.preventDefault();\n const item = ctx.filteredItems()[ctx.activeIndex()];\n if (item !== undefined) ctx.selectItem(item);\n } else if (e.key === \"Escape\" && ctx.open()) {\n e.preventDefault();\n ctx.close();\n }\n };\n\n return (\n <InputGroup\n ref={(el) => {\n if (!ctx.reference()) ctx.setReference(el);\n onCleanup(() => {\n if (ctx.reference() === el) ctx.setReference(undefined);\n });\n }}\n class={clsx(\"w-auto\", local.class)}\n >\n <InputGroupInput\n ref={(el) => {\n inputEl = el;\n }}\n placeholder={local.placeholder}\n disabled={disabled()}\n aria-invalid={local[\"aria-invalid\"] as any}\n value={ctx.inputValue()}\n onInput={(value) => {\n const next = String(value);\n ctx.setInputValue(next);\n ctx.setFilterValue(next);\n ctx.setOpen(true);\n if (!ctx.multiple() && next.trim() === \"\") {\n ctx.setValue(null);\n ctx.setFilterValue(\"\");\n }\n }}\n onFocus={() => ctx.setOpen(true)}\n onClick={() => ctx.setOpen(true)}\n onKeyDown={onKeyDown}\n />\n <InputGroupAddon align=\"inline-end\">\n <Show when={local.showClear && hasValue() && !disabled()}>\n <ComboboxClear />\n </Show>\n </InputGroupAddon>\n {local.children}\n </InputGroup>\n );\n}\n"],"mappings":";;;;;;;;;AAUA,SAAgBW,EAAcC,GAO3B;CACD,IAAMO,IAAMV,EAAmB,eAAe,GACxCW,IAAQlB,EAAW,EAAEa,WAAW,GAAM,GAAGH,CAAK,GAC9CE,UAAiBK,EAAIL,SAAS,KAAK,CAAC,CAACM,EAAMN,UAG3CO,IAA+BF,EAAIG,UAAU,MAAMC,KAAAA,GACrDC;CAEJvB,QAAmB;EACjB,AAAIkB,EAAIO,KAAK,KAAKL,KAAgCG,KAChDA,EAAQG,MAAM;CAElB,CAAC;CAED,IAAMC,UAAiB;EACrB,IAAMC,IAAUV,EAAIW,MAAM;EAG1B,OAFID,KAAW,OAAa,KACxBE,MAAMC,QAAQH,CAAO,IAAUA,EAAQI,SAAS,IAC7CJ,MAAY;CACrB,GAEMK,KAAaC,MAAqB;EACtC,IAAIrB,EAAS,GAAG;EAChB,IAAMuB,IAAOlB,EAAImB,cAAc;EAC/B,IAAIH,EAAEI,QAAQ,aAGZpB,AAFAgB,EAAEK,eAAe,GACjBrB,EAAIsB,QAAQ,EAAI,GAChBtB,EAAIuB,eACFL,EAAKJ,WAAW,IAAI,MAAMd,EAAIwB,YAAY,IAAI,KAAKN,EAAKJ,MAC1D;OACK,IAAIE,EAAEI,QAAQ,WAGnBpB,AAFAgB,EAAEK,eAAe,GACjBrB,EAAIsB,QAAQ,EAAI,GAChBtB,EAAIuB,eACFL,EAAKJ,WAAW,IACZ,MACCd,EAAIwB,YAAY,IAAI,IAAIN,EAAKJ,UAAUI,EAAKJ,MACnD;OACK,IAAIE,EAAEI,QAAQ,WAAWpB,EAAIO,KAAK,GAAG;GAC1CS,EAAEK,eAAe;GACjB,IAAMI,IAAOzB,EAAImB,cAAc,CAAC,CAACnB,EAAIwB,YAAY;GACjD,AAAIC,MAASrB,KAAAA,KAAWJ,EAAI0B,WAAWD,CAAI;EAC7C,OAAO,AAAIT,EAAEI,QAAQ,YAAYpB,EAAIO,KAAK,MACxCS,EAAEK,eAAe,GACjBrB,EAAI2B,MAAM;CAEd;CAEA,OAAAC,EACG1C,GAAU;EAAA2C,MACHC,MAAO;GAEX9C,AADKgB,EAAIG,UAAU,KAAGH,EAAI+B,aAAaD,CAAE,GACzC9C,QAAgB;IACd,AAAIgB,EAAIG,UAAU,MAAM2B,KAAI9B,EAAI+B,aAAa3B,KAAAA,CAAS;GACxD,CAAC;EACH;EAAC,IAAA,QAAA;GAAA,OACMf,EAAK,UAAUY,EAAMJ,KAAK;EAAC;EAAA,IAAAC,WAAA;GAAA,OAAA;IAAA8B,EAEjCxC,GAAe;KAAAyC,MACRC,MAAO;MACXzB,IAAUyB;KACZ;KAAC,IACDpC,cAAW;MAAA,OAAEO,EAAMP;KAAW;KAAA,IAC9BC,WAAQ;MAAA,OAAEA,EAAS;KAAC;KAAA,IAAA,iBAAA;MAAA,OACNM,EAAM;KAAsB;KAAA,IAC1CU,QAAK;MAAA,OAAEX,EAAIiC,WAAW;KAAC;KACvBC,UAAUvB,MAAU;MAClB,IAAMwB,IAAOC,OAAOzB,CAAK;MAIzB,AAHAX,EAAIqC,cAAcF,CAAI,GACtBnC,EAAIsC,eAAeH,CAAI,GACvBnC,EAAIsB,QAAQ,EAAI,GACZ,CAACtB,EAAIuC,SAAS,KAAKJ,EAAKK,KAAK,MAAM,OACrCxC,EAAIyC,SAAS,IAAI,GACjBzC,EAAIsC,eAAe,EAAE;KAEzB;KACAI,eAAe1C,EAAIsB,QAAQ,EAAI;KAC/BqB,eAAe3C,EAAIsB,QAAQ,EAAI;KACpBP;IAAS,CAAA;IAAAa,EAErBzC,GAAe;KAACyD,OAAK;KAAA,IAAA9C,WAAA;MAAA,OAAA8B,EACnB/C,GAAI;OAAA,IAACgE,OAAI;QAAA,OAAEC,QAAA,CAAA,EAAA7C,EAAML,aAAaa,EAAS,EAAC,CAAA,CAAA,KAAI,CAACd,EAAS;OAAC;OAAA,IAAAG,WAAA;QAAA,OAAA8B,EACrDrC,GAAa,CAAA,CAAA;OAAA;MAAA,CAAA;KAAA;IAAA,CAAA;IAAAuD,QAGjB7C,EAAMH,QAAQ;GAAA;EAAA;CAAA,CAAA;AAGrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ComboboxInput } from './ComboboxInput';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { clsx as e } from "../../../utils/clsx.js";
|
|
2
|
+
import { useComboboxContext as t } from "../Combobox/Combobox.context.js";
|
|
3
|
+
import { className as n, createComponent as r, delegateEvents as i, effect as a, insert as o, setAttribute as s, template as c } from "solid-js/web";
|
|
4
|
+
import { Show as l, createMemo as u, createSignal as d } from "solid-js";
|
|
5
|
+
import { Check as f } from "lucide-solid";
|
|
6
|
+
//#region src/components/combobox/ComboboxItem/ComboboxItem.tsx
|
|
7
|
+
var p = /*#__PURE__*/ c("<div data-slot=combobox-item role=option>");
|
|
8
|
+
function m(i) {
|
|
9
|
+
let c = t("ComboboxItem"), m = u(() => c.isSelected(i.value)), h = u(() => c.filteredItems()[c.activeIndex()] === i.value), [g, _] = d(!1);
|
|
10
|
+
return (() => {
|
|
11
|
+
var t = p();
|
|
12
|
+
return t.$$click = () => {
|
|
13
|
+
i.disabled || c.selectItem(i.value);
|
|
14
|
+
}, t.addEventListener("mouseleave", () => _(!1)), t.addEventListener("mouseenter", () => {
|
|
15
|
+
_(!0);
|
|
16
|
+
let e = c.filteredItems().indexOf(i.value);
|
|
17
|
+
e !== -1 && c.setActiveIndex(e);
|
|
18
|
+
}), o(t, () => i.children, null), o(t, r(l, {
|
|
19
|
+
get when() {
|
|
20
|
+
return m();
|
|
21
|
+
},
|
|
22
|
+
get children() {
|
|
23
|
+
return r(f, { class: "pointer-events-none absolute right-2 size-4" });
|
|
24
|
+
}
|
|
25
|
+
}), null), a((r) => {
|
|
26
|
+
var a = i.disabled ? -1 : 0, o = m(), c = h() || g() ? "" : void 0, l = e("relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm outline-none select-none", "data-highlighted:bg-accent data-highlighted:text-accent-foreground", i.disabled && "pointer-events-none opacity-50", i.class);
|
|
27
|
+
return a !== r.e && s(t, "tabindex", r.e = a), o !== r.t && s(t, "aria-selected", r.t = o), c !== r.a && s(t, "data-highlighted", r.a = c), l !== r.o && n(t, r.o = l), r;
|
|
28
|
+
}, {
|
|
29
|
+
e: void 0,
|
|
30
|
+
t: void 0,
|
|
31
|
+
a: void 0,
|
|
32
|
+
o: void 0
|
|
33
|
+
}), t;
|
|
34
|
+
})();
|
|
35
|
+
}
|
|
36
|
+
i(["click"]);
|
|
37
|
+
//#endregion
|
|
38
|
+
export { m as ComboboxItem };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=ComboboxItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComboboxItem.js","names":["Show","createMemo","createSignal","JSX","Check","clsx","useComboboxContext","ComboboxItem","props","value","children","Element","class","disabled","ctx","selected","isSelected","active","filteredItems","activeIndex","hovered","setHovered","_el$","_tmpl$","$$click","selectItem","addEventListener","index","indexOf","setActiveIndex","_$insert","_$createComponent","when","_$effect","_p$","_v$","_v$2","_v$3","undefined","_v$4","e","_$setAttribute","t","a","o","_$className","_$delegateEvents"],"sources":["../../../../src/components/combobox/ComboboxItem/ComboboxItem.tsx"],"sourcesContent":["import { Show, createMemo, createSignal, type JSX } from \"solid-js\";\nimport { Check } from \"lucide-solid\";\nimport { clsx } from \"~/utils\";\nimport { useComboboxContext } from \"../Combobox/Combobox.context\";\n\nexport function ComboboxItem(props: {\n value: any;\n children?: JSX.Element;\n class?: string;\n disabled?: boolean;\n}) {\n const ctx = useComboboxContext(\"ComboboxItem\");\n const selected = createMemo(() => ctx.isSelected(props.value));\n const active = createMemo(\n () => ctx.filteredItems()[ctx.activeIndex()] === props.value,\n );\n const [hovered, setHovered] = createSignal(false);\n\n return (\n <div\n data-slot=\"combobox-item\"\n role=\"option\"\n tabIndex={props.disabled ? -1 : 0}\n aria-selected={selected()}\n data-highlighted={active() || hovered() ? \"\" : undefined}\n class={clsx(\n \"relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm outline-none select-none\",\n \"data-highlighted:bg-accent data-highlighted:text-accent-foreground\",\n props.disabled && \"pointer-events-none opacity-50\",\n props.class,\n )}\n onMouseEnter={() => {\n setHovered(true);\n const index = ctx.filteredItems().indexOf(props.value);\n if (index !== -1) ctx.setActiveIndex(index);\n }}\n onMouseLeave={() => setHovered(false)}\n onClick={() => {\n if (!props.disabled) ctx.selectItem(props.value);\n }}\n >\n {props.children}\n <Show when={selected()}>\n <Check class=\"pointer-events-none absolute right-2 size-4\" />\n </Show>\n </div>\n );\n}\n"],"mappings":";;;;;;;AAKA,SAAgBO,EAAaC,GAK1B;CACD,IAAMM,IAAMR,EAAmB,cAAc,GACvCS,IAAWd,QAAiBa,EAAIE,WAAWR,EAAMC,KAAK,CAAC,GACvDQ,IAAShB,QACPa,EAAII,cAAc,CAAC,CAACJ,EAAIK,YAAY,OAAOX,EAAMC,KACzD,GACM,CAACW,GAASC,KAAcnB,EAAa,EAAK;CAEhD,cAAA;EAAA,IAAAoB,IAAAC,EAAA;EAYK,OAZLD,EAAAE,gBAmBmB;GACb,AAAKhB,EAAMK,YAAUC,EAAIW,WAAWjB,EAAMC,KAAK;EACjD,GAACa,EAAAI,iBAAA,oBAHmBL,EAAW,EAAK,CAAC,GAAAC,EAAAI,iBAAA,oBALjB;GAClBL,EAAW,EAAI;GACf,IAAMM,IAAQb,EAAII,cAAc,CAAC,CAACU,QAAQpB,EAAMC,KAAK;GACrD,AAAIkB,MAAU,MAAIb,EAAIe,eAAeF,CAAK;EAC5C,CAAC,GAAAG,EAAAR,SAMAd,EAAME,UAAQ,IAAA,GAAAoB,EAAAR,GAAAS,EACd/B,GAAI;GAAA,IAACgC,OAAI;IAAA,OAAEjB,EAAS;GAAC;GAAA,IAAAL,WAAA;IAAA,OAAAqB,EACnB3B,GAAK,EAAA,OAAA,8CAAA,CAAA;GAAA;EAAA,CAAA,GAAA,IAAA,GAAA6B,GAAAC,MAAA;GAAA,IAAAC,IArBE3B,EAAMK,WAAW,KAAK,GAACuB,IAClBrB,EAAS,GAACsB,IACPpB,EAAO,KAAKG,EAAQ,IAAI,KAAKkB,KAAAA,GAASC,IACjDlC,EACL,uHACA,sEACAG,EAAMK,YAAY,kCAClBL,EAAMI,KACR;GAAC,OAAAuB,MAAAD,EAAAM,KAAAC,EAAAnB,GAAA,YAAAY,EAAAM,IAAAL,CAAA,GAAAC,MAAAF,EAAAQ,KAAAD,EAAAnB,GAAA,iBAAAY,EAAAQ,IAAAN,CAAA,GAAAC,MAAAH,EAAAS,KAAAF,EAAAnB,GAAA,oBAAAY,EAAAS,IAAAN,CAAA,GAAAE,MAAAL,EAAAU,KAAAC,EAAAvB,GAAAY,EAAAU,IAAAL,CAAA,GAAAL;EAAA,GAAA;GAAAM,GAAAF,KAAAA;GAAAI,GAAAJ,KAAAA;GAAAK,GAAAL,KAAAA;GAAAM,GAAAN,KAAAA;EAAA,CAAA,GAAAhB;CAAA,EAAA,CAAA;AAiBP;AAACwB,EAAA,CAAA,OAAA,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ComboboxItem } from './ComboboxItem';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { clsx as e } from "../../../utils/clsx.js";
|
|
2
|
+
import { className as t, effect as n, insert as r, template as i } from "solid-js/web";
|
|
3
|
+
//#region src/components/combobox/ComboboxLabel/ComboboxLabel.tsx
|
|
4
|
+
var a = /*#__PURE__*/ i("<div data-slot=combobox-label>");
|
|
5
|
+
function o(i) {
|
|
6
|
+
return (() => {
|
|
7
|
+
var o = a();
|
|
8
|
+
return r(o, () => i.children), n(() => t(o, e("px-2 py-1.5 text-xs text-muted-foreground", i.class))), o;
|
|
9
|
+
})();
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { o as ComboboxLabel };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=ComboboxLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComboboxLabel.js","names":["JSX","clsx","ComboboxLabel","props","children","Element","class","_el$","_tmpl$","_$insert","_$effect","_$className"],"sources":["../../../../src/components/combobox/ComboboxLabel/ComboboxLabel.tsx"],"sourcesContent":["import type { JSX } from \"solid-js\";\nimport { clsx } from \"~/utils\";\n\nexport function ComboboxLabel(props: {\n children?: JSX.Element;\n class?: string;\n}) {\n return (\n <div\n data-slot=\"combobox-label\"\n class={clsx(\"px-2 py-1.5 text-xs text-muted-foreground\", props.class)}\n >\n {props.children}\n </div>\n );\n}\n"],"mappings":";;;;AAGA,SAAgBE,EAAcC,GAG3B;CACD,cAAA;EAAA,IAAAI,IAAAC,EAAA;EAGyE,OAHzEC,EAAAF,SAKKJ,EAAMC,QAAQ,GAAAM,QAAAC,EAAAJ,GAFRN,EAAK,6CAA6CE,EAAMG,KAAK,CAAC,CAAA,GAAAC;CAAA,EAAA,CAAA;AAK3E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ComboboxLabel } from './ComboboxLabel';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { clsx as e } from "../../../utils/clsx.js";
|
|
2
|
+
import { useComboboxContext as t } from "../Combobox/Combobox.context.js";
|
|
3
|
+
import { className as n, createComponent as r, effect as i, insert as a, template as o } from "solid-js/web";
|
|
4
|
+
import { For as s } from "solid-js";
|
|
5
|
+
//#region src/components/combobox/ComboboxList/ComboboxList.tsx
|
|
6
|
+
var c = /*#__PURE__*/ o("<div data-slot=combobox-list role=listbox>");
|
|
7
|
+
function l(o) {
|
|
8
|
+
let l = t("ComboboxList"), u = () => l.isGrouped() ? l.items() : l.filteredItems();
|
|
9
|
+
return (() => {
|
|
10
|
+
var t = c();
|
|
11
|
+
return a(t, r(s, {
|
|
12
|
+
get each() {
|
|
13
|
+
return u();
|
|
14
|
+
},
|
|
15
|
+
children: (e, t) => typeof o.children == "function" ? o.children(e, t()) : o.children
|
|
16
|
+
})), i(() => n(t, e("max-h-72 overflow-y-auto overscroll-contain p-1", o.class))), t;
|
|
17
|
+
})();
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { l as ComboboxList };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=ComboboxList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComboboxList.js","names":["For","JSX","clsx","useComboboxContext","ComboboxList","props","children","Element","item","index","class","ctx","listItems","isGrouped","items","filteredItems","_el$","_tmpl$","_$insert","_$createComponent","each","_$effect","_$className"],"sources":["../../../../src/components/combobox/ComboboxList/ComboboxList.tsx"],"sourcesContent":["import { For, type JSX } from \"solid-js\";\nimport { clsx } from \"~/utils\";\nimport { useComboboxContext } from \"../Combobox/Combobox.context\";\n\nexport function ComboboxList(props: {\n children?: JSX.Element | ((item: any, index: number) => JSX.Element);\n class?: string;\n}) {\n const ctx = useComboboxContext(\"ComboboxList\");\n const listItems = () => (ctx.isGrouped() ? ctx.items() : ctx.filteredItems());\n\n return (\n <div\n data-slot=\"combobox-list\"\n class={clsx(\n \"max-h-72 overflow-y-auto overscroll-contain p-1\",\n props.class,\n )}\n role=\"listbox\"\n >\n <For each={listItems()}>\n {(item, index) =>\n typeof props.children === \"function\"\n ? props.children(item, index())\n : props.children\n }\n </For>\n </div>\n );\n}\n"],"mappings":";;;;;;AAIA,SAAgBI,EAAaC,GAG1B;CACD,IAAMM,IAAMR,EAAmB,cAAc,GACvCS,UAAmBD,EAAIE,UAAU,IAAIF,EAAIG,MAAM,IAAIH,EAAII,cAAc;CAE3E,cAAA;EAAA,IAAAC,IAAAC,EAAA;EAMK,OANLC,EAAAF,GAAAG,EASKnB,GAAG;GAAA,IAACoB,OAAI;IAAA,OAAER,EAAU;GAAC;GAAAN,WAClBE,GAAMC,MACN,OAAOJ,EAAMC,YAAa,aACtBD,EAAMC,SAASE,GAAMC,EAAM,CAAC,IAC5BJ,EAAMC;EAAQ,CAAA,CAAA,GAAAe,QAAAC,EAAAN,GAVfd,EACL,mDACAG,EAAMK,KACR,CAAC,CAAA,GAAAM;CAAA,EAAA,CAAA;AAYP"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ComboboxList } from './ComboboxList';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { clsx as e } from "../../../utils/clsx.js";
|
|
2
|
+
import { className as t, effect as n, template as r } from "solid-js/web";
|
|
3
|
+
//#region src/components/combobox/ComboboxSeparator/ComboboxSeparator.tsx
|
|
4
|
+
var i = /*#__PURE__*/ r("<div data-slot=combobox-separator>");
|
|
5
|
+
function a(r) {
|
|
6
|
+
return (() => {
|
|
7
|
+
var a = i();
|
|
8
|
+
return n(() => t(a, e("-mx-1 my-1 h-px bg-border", r.class))), a;
|
|
9
|
+
})();
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { a as ComboboxSeparator };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=ComboboxSeparator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComboboxSeparator.js","names":["clsx","ComboboxSeparator","props","class","_el$","_tmpl$","_$effect","_$className"],"sources":["../../../../src/components/combobox/ComboboxSeparator/ComboboxSeparator.tsx"],"sourcesContent":["import { clsx } from \"~/utils\";\n\nexport function ComboboxSeparator(props: { class?: string }) {\n return (\n <div\n data-slot=\"combobox-separator\"\n class={clsx(\"-mx-1 my-1 h-px bg-border\", props.class)}\n />\n );\n}\n"],"mappings":";;;;AAEA,SAAgBC,EAAkBC,GAA2B;CAC3D,cAAA;EAAA,IAAAE,IAAAC,EAAA;EAGyD,OAHzDC,QAAAC,EAAAH,GAGWJ,EAAK,6BAA6BE,EAAMC,KAAK,CAAC,CAAA,GAAAC;CAAA,EAAA,CAAA;AAG3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ComboboxSeparator } from './ComboboxSeparator';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { clsx as e } from "../../../utils/clsx.js";
|
|
2
|
+
import { useComboboxContext as t } from "../Combobox/Combobox.context.js";
|
|
3
|
+
import { InputGroupButton as n } from "../../input-group/InputGroupButton/InputGroupButton.js";
|
|
4
|
+
import { createComponent as r, memo as i } from "solid-js/web";
|
|
5
|
+
import { ChevronDown as a } from "lucide-solid";
|
|
6
|
+
//#region src/components/combobox/ComboboxTrigger/ComboboxTrigger.tsx
|
|
7
|
+
function o(o) {
|
|
8
|
+
let s = t("ComboboxTrigger");
|
|
9
|
+
return r(n, {
|
|
10
|
+
ref(e) {
|
|
11
|
+
var t = s.setReference;
|
|
12
|
+
typeof t == "function" ? t(e) : s.setReference = e;
|
|
13
|
+
},
|
|
14
|
+
variant: "outline",
|
|
15
|
+
"data-slot": "combobox-trigger",
|
|
16
|
+
get class() {
|
|
17
|
+
return e("h-8 [&_svg:not([class*='size-'])]:size-4 active:not-aria-[haspopup]:translate-y-0", o.class);
|
|
18
|
+
},
|
|
19
|
+
get disabled() {
|
|
20
|
+
return s.disabled() || o.disabled;
|
|
21
|
+
},
|
|
22
|
+
onClick: () => s.setOpen(!s.open()),
|
|
23
|
+
get children() {
|
|
24
|
+
return [i(() => o.children), r(a, {
|
|
25
|
+
"data-slot": "combobox-trigger-icon",
|
|
26
|
+
class: "pointer-events-none size-4 text-muted-foreground"
|
|
27
|
+
})];
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { o as ComboboxTrigger };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=ComboboxTrigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComboboxTrigger.js","names":["JSX","ChevronDown","clsx","useComboboxContext","InputGroupButton","ComboboxTrigger","props","children","Element","class","disabled","ctx","_$createComponent","ref","r$","_ref$","setReference","variant","onClick","setOpen","open","_$memo"],"sources":["../../../../src/components/combobox/ComboboxTrigger/ComboboxTrigger.tsx"],"sourcesContent":["import type { JSX } from \"solid-js\";\nimport { ChevronDown } from \"lucide-solid\";\nimport { clsx } from \"~/utils\";\nimport { useComboboxContext } from \"../Combobox/Combobox.context\";\nimport { InputGroupButton } from \"~/components/input-group\";\n\nexport function ComboboxTrigger(props: {\n children?: JSX.Element;\n class?: string;\n disabled?: boolean;\n}) {\n const ctx = useComboboxContext(\"ComboboxTrigger\");\n return (\n <InputGroupButton\n ref={ctx.setReference}\n variant=\"outline\"\n data-slot=\"combobox-trigger\"\n class={clsx(\n \"h-8 [&_svg:not([class*='size-'])]:size-4 active:not-aria-[haspopup]:translate-y-0\",\n props.class,\n )}\n disabled={ctx.disabled() || props.disabled}\n onClick={() => ctx.setOpen(!ctx.open())}\n >\n {props.children}\n <ChevronDown\n data-slot=\"combobox-trigger-icon\"\n class=\"pointer-events-none size-4 text-muted-foreground\"\n />\n </InputGroupButton>\n );\n}\n"],"mappings":";;;;;;AAMA,SAAgBK,EAAgBC,GAI7B;CACD,IAAMK,IAAMR,EAAmB,iBAAiB;CAChD,OAAAS,EACGR,GAAgB;EAAAS,IAAAC,GAAA;GAAA,IAAAC,IACVJ,EAAIK;GAAY,OAAAD,KAAA,aAAAA,EAAAD,CAAA,IAAhBH,EAAIK,eAAYF;EAAA;EACrBG,SAAO;EAAA,aAAA;EAAA,IAAA,QAAA;GAAA,OAEAf,EACL,qFACAI,EAAMG,KACR;EAAC;EAAA,IACDC,WAAQ;GAAA,OAAEC,EAAID,SAAS,KAAKJ,EAAMI;EAAQ;EAC1CQ,eAAeP,EAAIQ,QAAQ,CAACR,EAAIS,KAAK,CAAC;EAAC,IAAAb,WAAA;GAAA,OAAA,CAAAc,QAEtCf,EAAMC,QAAQ,GAAAK,EACdX,GAAW;IAAA,aAAA;IAAA,OAAA;GAAA,CAAA,CAAA;EAAA;CAAA,CAAA;AAMlB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ComboboxTrigger } from './ComboboxTrigger';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useComboboxContext as e } from "../Combobox/Combobox.context.js";
|
|
2
|
+
import { memo as t } from "solid-js/web";
|
|
3
|
+
import { children as n, createMemo as r } from "solid-js";
|
|
4
|
+
//#region src/components/combobox/ComboboxValue/ComboboxValue.tsx
|
|
5
|
+
function i(i) {
|
|
6
|
+
let a = e("ComboboxValue"), o = r(() => {
|
|
7
|
+
let e = a.value();
|
|
8
|
+
return e == null ? [] : Array.isArray(e) ? e : [e];
|
|
9
|
+
}), s = n(() => typeof i.children == "function" ? i.children(o()) : o().length > 0 ? o().map((e) => a.itemToStringValue(e)).join(", ") : i.placeholder ?? "");
|
|
10
|
+
return t(s);
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { i as ComboboxValue };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=ComboboxValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComboboxValue.js","names":["children","createMemo","JSX","useComboboxContext","ComboboxValue","props","placeholder","Element","values","ctx","selected","current","value","Array","isArray","render","length","map","item","itemToStringValue","join","_$memo"],"sources":["../../../../src/components/combobox/ComboboxValue/ComboboxValue.tsx"],"sourcesContent":["import { children, createMemo, type JSX } from \"solid-js\";\nimport { useComboboxContext } from \"../Combobox/Combobox.context\";\n\nexport function ComboboxValue(props: {\n placeholder?: string;\n children?: JSX.Element | ((values: any[]) => JSX.Element);\n}): JSX.Element {\n const ctx = useComboboxContext(\"ComboboxValue\");\n const selected = createMemo(() => {\n const current = ctx.value();\n if (current == null) return [] as any[];\n return Array.isArray(current) ? current : [current];\n });\n\n const render = children(() => {\n if (typeof props.children === \"function\") return props.children(selected());\n if (selected().length > 0) {\n return selected()\n .map((item) => ctx.itemToStringValue(item))\n .join(\", \") as unknown as JSX.Element;\n }\n return (props.placeholder ?? \"\") as unknown as JSX.Element;\n });\n\n return <>{render()}</>;\n}\n"],"mappings":";;;;AAGA,SAAgBI,EAAcC,GAGd;CACd,IAAMI,IAAMN,EAAmB,eAAe,GACxCO,IAAWT,QAAiB;EAChC,IAAMU,IAAUF,EAAIG,MAAM;EAE1B,OADID,KAAW,OAAa,CAAA,IACrBE,MAAMC,QAAQH,CAAO,IAAIA,IAAU,CAACA,CAAO;CACpD,CAAC,GAEKI,IAASf,QACT,OAAOK,EAAML,YAAa,aAAmBK,EAAML,SAASU,EAAS,CAAC,IACtEA,EAAS,CAAC,CAACM,SAAS,IACfN,EAAS,CAAC,CACdO,KAAKC,MAAST,EAAIU,kBAAkBD,CAAI,CAAC,CAAC,CAC1CE,KAAK,IAAI,IAENf,EAAMC,eAAe,EAC9B;CAED,OAAAe,EAAUN,CAAM;AAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ComboboxValue } from './ComboboxValue';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { Combobox } from './Combobox';
|
|
2
|
+
export type { ComboboxProps, ComboboxContextValue } from './Combobox';
|
|
3
|
+
export { ComboboxClear } from './ComboboxClear';
|
|
4
|
+
export { ComboboxInput } from './ComboboxInput';
|
|
5
|
+
export { ComboboxTrigger } from './ComboboxTrigger';
|
|
6
|
+
export { ComboboxValue } from './ComboboxValue';
|
|
7
|
+
export { ComboboxContent } from './ComboboxContent';
|
|
8
|
+
export { ComboboxList } from './ComboboxList';
|
|
9
|
+
export { ComboboxItem } from './ComboboxItem';
|
|
10
|
+
export { ComboboxEmpty } from './ComboboxEmpty';
|
|
11
|
+
export { ComboboxGroup } from './ComboboxGroup';
|
|
12
|
+
export { ComboboxLabel } from './ComboboxLabel';
|
|
13
|
+
export { ComboboxCollection } from './ComboboxCollection';
|
|
14
|
+
export { ComboboxSeparator } from './ComboboxSeparator';
|
|
15
|
+
export { ComboboxChips } from './ComboboxChips';
|
|
16
|
+
export { ComboboxChip } from './ComboboxChip';
|
|
17
|
+
export { ComboboxChipsInput } from './ComboboxChipsInput';
|
|
18
|
+
export { useComboboxAnchor } from './useComboboxAnchor';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Combobox as e } from "./Combobox/Combobox.js";
|
|
2
|
+
import { ComboboxClear as t } from "./ComboboxClear/ComboboxClear.js";
|
|
3
|
+
import { ComboboxInput as n } from "./ComboboxInput/ComboboxInput.js";
|
|
4
|
+
import { ComboboxTrigger as r } from "./ComboboxTrigger/ComboboxTrigger.js";
|
|
5
|
+
import { ComboboxValue as i } from "./ComboboxValue/ComboboxValue.js";
|
|
6
|
+
import { ComboboxContent as a } from "./ComboboxContent/ComboboxContent.js";
|
|
7
|
+
import { ComboboxList as o } from "./ComboboxList/ComboboxList.js";
|
|
8
|
+
import { ComboboxItem as s } from "./ComboboxItem/ComboboxItem.js";
|
|
9
|
+
import { ComboboxEmpty as c } from "./ComboboxEmpty/ComboboxEmpty.js";
|
|
10
|
+
import { ComboboxGroup as l } from "./ComboboxGroup/ComboboxGroup.js";
|
|
11
|
+
import { ComboboxLabel as u } from "./ComboboxLabel/ComboboxLabel.js";
|
|
12
|
+
import { ComboboxCollection as d } from "./ComboboxCollection/ComboboxCollection.js";
|
|
13
|
+
import { ComboboxSeparator as f } from "./ComboboxSeparator/ComboboxSeparator.js";
|
|
14
|
+
import { ComboboxChips as p } from "./ComboboxChips/ComboboxChips.js";
|
|
15
|
+
import { ComboboxChip as m } from "./ComboboxChip/ComboboxChip.js";
|
|
16
|
+
import { ComboboxChipsInput as h } from "./ComboboxChipsInput/ComboboxChipsInput.js";
|
|
17
|
+
import { useComboboxAnchor as g } from "./useComboboxAnchor/useComboboxAnchor.js";
|
|
18
|
+
export { e as Combobox, m as ComboboxChip, p as ComboboxChips, h as ComboboxChipsInput, t as ComboboxClear, d as ComboboxCollection, a as ComboboxContent, c as ComboboxEmpty, l as ComboboxGroup, n as ComboboxInput, s as ComboboxItem, u as ComboboxLabel, o as ComboboxList, f as ComboboxSeparator, r as ComboboxTrigger, i as ComboboxValue, g as useComboboxAnchor };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useComboboxAnchor } from './useComboboxAnchor';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useComboboxAnchor(): import('solid-js').Signal<HTMLElement | undefined>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useComboboxAnchor.js","names":["createSignal","useComboboxAnchor","HTMLElement"],"sources":["../../../../src/components/combobox/useComboboxAnchor/useComboboxAnchor.tsx"],"sourcesContent":["import { createSignal } from \"solid-js\";\n\nexport function useComboboxAnchor() {\n return createSignal<HTMLElement | undefined>();\n}\n"],"mappings":";;AAEA,SAAgBC,IAAoB;CAClC,OAAOD,EAAsC;AAC/C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { DatePickerProps } from './DatePicker.types';
|
|
3
|
+
/**
|
|
4
|
+
* Date Picker:shadcn Base UI 版本 Date Picker 的 SolidJS 移植。
|
|
5
|
+
*
|
|
6
|
+
* shadcn 的 Base UI Date Picker 本身不是单个 Root 组件,而是由 Popover + Calendar
|
|
7
|
+
* 组合而成。这里把它封装成一个开箱即用的 <DatePicker>,底层仍使用本仓库的
|
|
8
|
+
* <Popover> 和 <Calendar>;如果你想完全复刻 shadcn 的「组合式」用法,也可以直接
|
|
9
|
+
* 绕过这个封装,自己写 Popover + Calendar。
|
|
10
|
+
*/
|
|
11
|
+
export declare function DatePicker(props: DatePickerProps): JSX.Element;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { clsx as e } from "../../../utils/clsx.js";
|
|
2
|
+
import { Calendar as t } from "../../calendar/Calendar/Calendar.js";
|
|
3
|
+
import { Popover as n } from "../../popover/Popover/Popover.js";
|
|
4
|
+
import { PopoverTrigger as r } from "../../popover/PopoverTrigger/PopoverTrigger.js";
|
|
5
|
+
import { PopoverContent as i } from "../../popover/PopoverContent/PopoverContent.js";
|
|
6
|
+
import { createComponent as a, insert as o, mergeProps as s, template as c } from "solid-js/web";
|
|
7
|
+
import { createMemo as l, createSignal as u, mergeProps as d, splitProps as f } from "solid-js";
|
|
8
|
+
import { ChevronDown as p } from "lucide-solid";
|
|
9
|
+
//#region src/components/date-picker/DatePicker/DatePicker.tsx
|
|
10
|
+
var m = /*#__PURE__*/ c("<span class=truncate>");
|
|
11
|
+
function h(e, t) {
|
|
12
|
+
return new Intl.DateTimeFormat(t, {
|
|
13
|
+
year: "numeric",
|
|
14
|
+
month: "long",
|
|
15
|
+
day: "numeric"
|
|
16
|
+
}).format(e);
|
|
17
|
+
}
|
|
18
|
+
function g(c) {
|
|
19
|
+
let g = d({
|
|
20
|
+
placeholder: "Pick a date",
|
|
21
|
+
align: "start",
|
|
22
|
+
side: "bottom"
|
|
23
|
+
}, c), [_, v] = f(g, [
|
|
24
|
+
"value",
|
|
25
|
+
"defaultValue",
|
|
26
|
+
"onValueChange",
|
|
27
|
+
"placeholder",
|
|
28
|
+
"disabled",
|
|
29
|
+
"min",
|
|
30
|
+
"max",
|
|
31
|
+
"locale",
|
|
32
|
+
"formatDate",
|
|
33
|
+
"showOutsideDays",
|
|
34
|
+
"weekStartsOn",
|
|
35
|
+
"captionLayout",
|
|
36
|
+
"buttonVariant",
|
|
37
|
+
"classNames",
|
|
38
|
+
"side",
|
|
39
|
+
"align",
|
|
40
|
+
"sideOffset",
|
|
41
|
+
"contentClass",
|
|
42
|
+
"calendarClass",
|
|
43
|
+
"class",
|
|
44
|
+
"classList",
|
|
45
|
+
"style"
|
|
46
|
+
]), [y, b] = u(_.defaultValue), [x, S] = u(!1), C = l(() => _.value === void 0 ? y() : _.value), w = (e) => {
|
|
47
|
+
_.value === void 0 && b(e), _.onValueChange?.(e);
|
|
48
|
+
}, T = l(() => typeof _.locale == "string" ? _.locale : _.locale?.code), E = l(() => {
|
|
49
|
+
let e = C();
|
|
50
|
+
return e ? (_.formatDate ?? h)(e, T()) : _.placeholder;
|
|
51
|
+
});
|
|
52
|
+
return a(n, {
|
|
53
|
+
get open() {
|
|
54
|
+
return x();
|
|
55
|
+
},
|
|
56
|
+
onOpenChange: S,
|
|
57
|
+
get children() {
|
|
58
|
+
return [a(r, {
|
|
59
|
+
variant: "outline",
|
|
60
|
+
get disabled() {
|
|
61
|
+
return _.disabled;
|
|
62
|
+
},
|
|
63
|
+
get "data-empty"() {
|
|
64
|
+
return C() === void 0 ? "true" : void 0;
|
|
65
|
+
},
|
|
66
|
+
get class() {
|
|
67
|
+
return e("w-53 justify-between text-left font-normal", "data-[empty=true]:text-muted-foreground", _.class);
|
|
68
|
+
},
|
|
69
|
+
get children() {
|
|
70
|
+
return [(() => {
|
|
71
|
+
var e = m();
|
|
72
|
+
return o(e, E), e;
|
|
73
|
+
})(), a(p, { "data-icon": "inline-end" })];
|
|
74
|
+
}
|
|
75
|
+
}), a(i, {
|
|
76
|
+
get side() {
|
|
77
|
+
return _.side;
|
|
78
|
+
},
|
|
79
|
+
get align() {
|
|
80
|
+
return _.align;
|
|
81
|
+
},
|
|
82
|
+
get sideOffset() {
|
|
83
|
+
return _.sideOffset;
|
|
84
|
+
},
|
|
85
|
+
get class() {
|
|
86
|
+
return e("w-auto p-0", _.contentClass);
|
|
87
|
+
},
|
|
88
|
+
get children() {
|
|
89
|
+
return a(t, s({
|
|
90
|
+
mode: "single",
|
|
91
|
+
get selected() {
|
|
92
|
+
return C();
|
|
93
|
+
},
|
|
94
|
+
onSelect: (e) => {
|
|
95
|
+
w(e), S(!1);
|
|
96
|
+
},
|
|
97
|
+
get defaultMonth() {
|
|
98
|
+
return C();
|
|
99
|
+
},
|
|
100
|
+
get min() {
|
|
101
|
+
return _.min;
|
|
102
|
+
},
|
|
103
|
+
get max() {
|
|
104
|
+
return _.max;
|
|
105
|
+
},
|
|
106
|
+
get showOutsideDays() {
|
|
107
|
+
return _.showOutsideDays;
|
|
108
|
+
},
|
|
109
|
+
get weekStartsOn() {
|
|
110
|
+
return _.weekStartsOn;
|
|
111
|
+
},
|
|
112
|
+
get captionLayout() {
|
|
113
|
+
return _.captionLayout;
|
|
114
|
+
},
|
|
115
|
+
get buttonVariant() {
|
|
116
|
+
return _.buttonVariant;
|
|
117
|
+
},
|
|
118
|
+
get locale() {
|
|
119
|
+
return _.locale;
|
|
120
|
+
},
|
|
121
|
+
get classNames() {
|
|
122
|
+
return _.classNames;
|
|
123
|
+
},
|
|
124
|
+
get class() {
|
|
125
|
+
return _.calendarClass;
|
|
126
|
+
}
|
|
127
|
+
}, v));
|
|
128
|
+
}
|
|
129
|
+
})];
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
//#endregion
|
|
134
|
+
export { g as DatePicker };
|
|
135
|
+
|
|
136
|
+
//# sourceMappingURL=DatePicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatePicker.js","names":["createMemo","createSignal","mergeProps","splitProps","JSX","ChevronDown","Calendar","Popover","PopoverContent","PopoverTrigger","clsx","DatePickerProps","defaultFormatDate","date","Date","locale","Intl","DateTimeFormat","year","month","day","format","DatePicker","props","Element","merged","placeholder","align","const","side","local","rest","internalValue","setInternalValue","defaultValue","open","setOpen","value","undefined","setValue","onValueChange","localeCode","code","displayText","formatDate","_$createComponent","onOpenChange","children","variant","disabled","data-empty","class","_el$","_tmpl$","_$insert","sideOffset","contentClass","_$mergeProps","mode","selected","onSelect","defaultMonth","min","max","showOutsideDays","weekStartsOn","captionLayout","buttonVariant","classNames","calendarClass"],"sources":["../../../../src/components/date-picker/DatePicker/DatePicker.tsx"],"sourcesContent":["import {\n createMemo,\n createSignal,\n mergeProps,\n splitProps,\n type JSX,\n} from \"solid-js\";\nimport { ChevronDown } from \"lucide-solid\";\nimport { Calendar } from \"~/components/calendar\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"~/components/popover\";\nimport { clsx } from \"~/utils\";\nimport type { DatePickerProps } from \"./DatePicker.types\";\n\nfunction defaultFormatDate(date: Date, locale?: string): string {\n return new Intl.DateTimeFormat(locale, {\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n }).format(date);\n}\n\n/**\n * Date Picker:shadcn Base UI 版本 Date Picker 的 SolidJS 移植。\n *\n * shadcn 的 Base UI Date Picker 本身不是单个 Root 组件,而是由 Popover + Calendar\n * 组合而成。这里把它封装成一个开箱即用的 <DatePicker>,底层仍使用本仓库的\n * <Popover> 和 <Calendar>;如果你想完全复刻 shadcn 的「组合式」用法,也可以直接\n * 绕过这个封装,自己写 Popover + Calendar。\n */\nexport function DatePicker(props: DatePickerProps): JSX.Element {\n const merged = mergeProps(\n {\n placeholder: \"Pick a date\",\n align: \"start\" as const,\n side: \"bottom\" as const,\n },\n props,\n );\n\n const [local, rest] = splitProps(merged, [\n \"value\",\n \"defaultValue\",\n \"onValueChange\",\n \"placeholder\",\n \"disabled\",\n \"min\",\n \"max\",\n \"locale\",\n \"formatDate\",\n \"showOutsideDays\",\n \"weekStartsOn\",\n \"captionLayout\",\n \"buttonVariant\",\n \"classNames\",\n \"side\",\n \"align\",\n \"sideOffset\",\n \"contentClass\",\n \"calendarClass\",\n \"class\",\n \"classList\",\n \"style\",\n ]);\n\n const [internalValue, setInternalValue] = createSignal<Date | undefined>(\n local.defaultValue,\n );\n const [open, setOpen] = createSignal(false);\n const value = createMemo(() =>\n local.value !== undefined ? local.value : internalValue(),\n );\n\n const setValue = (date: Date | undefined) => {\n if (local.value === undefined) setInternalValue(date);\n local.onValueChange?.(date);\n };\n\n const localeCode = createMemo(() =>\n typeof local.locale === \"string\" ? local.locale : local.locale?.code,\n );\n\n const displayText = createMemo(() => {\n const date = value();\n if (!date) return local.placeholder;\n return (local.formatDate ?? defaultFormatDate)(date, localeCode());\n });\n\n return (\n <Popover open={open()} onOpenChange={setOpen}>\n <PopoverTrigger\n variant=\"outline\"\n disabled={local.disabled}\n data-empty={value() === undefined ? \"true\" : undefined}\n class={clsx(\n \"w-53 justify-between text-left font-normal\",\n \"data-[empty=true]:text-muted-foreground\",\n local.class,\n )}\n >\n <span class=\"truncate\">{displayText()}</span>\n <ChevronDown data-icon=\"inline-end\" />\n </PopoverTrigger>\n <PopoverContent\n side={local.side}\n align={local.align}\n sideOffset={local.sideOffset}\n class={clsx(\"w-auto p-0\", local.contentClass)}\n >\n <Calendar\n mode=\"single\"\n selected={value()}\n onSelect={(date) => {\n setValue(date as Date | undefined);\n // 选完日期后关闭浮层,交互上和常见 DatePicker 一致。\n // shadcn 原始示例由 Popover 自己保持打开,用户可按需改写。\n setOpen(false);\n }}\n defaultMonth={value()}\n min={local.min}\n max={local.max}\n showOutsideDays={local.showOutsideDays}\n weekStartsOn={local.weekStartsOn}\n captionLayout={local.captionLayout}\n buttonVariant={local.buttonVariant}\n locale={local.locale}\n classNames={local.classNames}\n class={local.calendarClass}\n {...rest}\n />\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { BaseProps } from '../../../types';
|
|
2
|
+
import { CalendarClassNames, CalendarProps } from '../../calendar';
|
|
3
|
+
import { PopoverSide } from '../../popover';
|
|
4
|
+
export interface DatePickerProps extends BaseProps {
|
|
5
|
+
/** 受控选中日期;不传则内部自管理(非受控模式) */
|
|
6
|
+
value?: Date | undefined;
|
|
7
|
+
/** 非受控模式下的初始选中日期 */
|
|
8
|
+
defaultValue?: Date | undefined;
|
|
9
|
+
onValueChange?: (date: Date | undefined) => void;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
min?: Date;
|
|
13
|
+
max?: Date;
|
|
14
|
+
/** 传给 Calendar 的 locale */
|
|
15
|
+
locale?: CalendarProps["locale"];
|
|
16
|
+
/** 自定义格式化函数;默认用 Intl 输出「2025年4月29日」这类长日期 */
|
|
17
|
+
formatDate?: (date: Date) => string;
|
|
18
|
+
showOutsideDays?: boolean;
|
|
19
|
+
weekStartsOn?: CalendarProps["weekStartsOn"];
|
|
20
|
+
captionLayout?: CalendarProps["captionLayout"];
|
|
21
|
+
buttonVariant?: CalendarProps["buttonVariant"];
|
|
22
|
+
classNames?: Partial<CalendarClassNames>;
|
|
23
|
+
/** PopoverContent 相对 trigger 的位置,默认 'bottom' */
|
|
24
|
+
side?: PopoverSide;
|
|
25
|
+
/** PopoverContent 水平对齐方式,默认 'start' */
|
|
26
|
+
align?: "start" | "center" | "end";
|
|
27
|
+
sideOffset?: number;
|
|
28
|
+
/** PopoverContent 的 class */
|
|
29
|
+
contentClass?: string;
|
|
30
|
+
/** Calendar 根节点的 class */
|
|
31
|
+
calendarClass?: string;
|
|
32
|
+
}
|