@neut/ui 0.0.11 → 0.0.13
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/label/index.d.ts +1 -0
- 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 -0
- package/dist/components/select/Select/Select.context.js +12 -0
- package/dist/components/select/Select/Select.context.js.map +1 -0
- package/dist/components/select/Select/Select.d.ts +22 -0
- package/dist/components/select/Select/Select.js +48 -0
- package/dist/components/select/Select/Select.js.map +1 -0
- package/dist/components/select/Select/Select.types.d.ts +45 -0
- package/dist/components/select/Select/index.d.ts +3 -0
- package/dist/components/select/SelectContent/SelectContent.d.ts +2 -0
- package/dist/components/select/SelectContent/SelectContent.js +80 -0
- package/dist/components/select/SelectContent/SelectContent.js.map +1 -0
- package/dist/components/select/SelectContent/SelectContent.types.d.ts +22 -0
- package/dist/components/select/SelectContent/SelectContent.utils.d.ts +36 -0
- package/dist/components/select/SelectContent/SelectContent.utils.js +66 -0
- package/dist/components/select/SelectContent/SelectContent.utils.js.map +1 -0
- package/dist/components/select/SelectContent/index.d.ts +6 -0
- package/dist/components/select/SelectContent/useSelectContent.d.ts +28 -0
- package/dist/components/select/SelectContent/useSelectContent.js +50 -0
- package/dist/components/select/SelectContent/useSelectContent.js.map +1 -0
- package/dist/components/select/SelectGroup/SelectGroup.d.ts +2 -0
- package/dist/components/select/SelectGroup/SelectGroup.js +13 -0
- package/dist/components/select/SelectGroup/SelectGroup.js.map +1 -0
- package/dist/components/select/SelectGroup/index.d.ts +1 -0
- package/dist/components/select/SelectItem/SelectItem.d.ts +2 -0
- package/dist/components/select/SelectItem/SelectItem.js +52 -0
- package/dist/components/select/SelectItem/SelectItem.js.map +1 -0
- package/dist/components/select/SelectItem/SelectItem.types.d.ts +10 -0
- package/dist/components/select/SelectItem/index.d.ts +4 -0
- package/dist/components/select/SelectItem/useSelectItem.d.ts +12 -0
- package/dist/components/select/SelectItem/useSelectItem.js +32 -0
- package/dist/components/select/SelectItem/useSelectItem.js.map +1 -0
- package/dist/components/select/SelectLabel/SelectLabel.d.ts +2 -0
- package/dist/components/select/SelectLabel/SelectLabel.js +13 -0
- package/dist/components/select/SelectLabel/SelectLabel.js.map +1 -0
- package/dist/components/select/SelectLabel/index.d.ts +1 -0
- package/dist/components/select/SelectSeparator/SelectSeparator.d.ts +2 -0
- package/dist/components/select/SelectSeparator/SelectSeparator.js +13 -0
- package/dist/components/select/SelectSeparator/SelectSeparator.js.map +1 -0
- package/dist/components/select/SelectSeparator/index.d.ts +1 -0
- package/dist/components/select/SelectTrigger/SelectTrigger.d.ts +4 -0
- package/dist/components/select/SelectTrigger/SelectTrigger.js +50 -0
- package/dist/components/select/SelectTrigger/SelectTrigger.js.map +1 -0
- package/dist/components/select/SelectTrigger/SelectTrigger.types.d.ts +3 -0
- package/dist/components/select/SelectTrigger/index.d.ts +4 -0
- package/dist/components/select/SelectTrigger/useSelectTrigger.d.ts +15 -0
- package/dist/components/select/SelectTrigger/useSelectTrigger.js +37 -0
- package/dist/components/select/SelectTrigger/useSelectTrigger.js.map +1 -0
- package/dist/components/select/SelectValue/SelectValue.d.ts +2 -0
- package/dist/components/select/SelectValue/SelectValue.js +20 -0
- package/dist/components/select/SelectValue/SelectValue.js.map +1 -0
- package/dist/components/select/SelectValue/SelectValue.types.d.ts +4 -0
- package/dist/components/select/SelectValue/index.d.ts +2 -0
- package/dist/components/select/index.d.ts +13 -0
- package/dist/components/select/index.js +9 -0
- 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 +3 -0
- package/dist/components/toggle-group/ToggleGroup/ToggleGroup.context.js +12 -0
- package/dist/components/toggle-group/ToggleGroup/ToggleGroup.context.js.map +1 -0
- package/dist/components/toggle-group/ToggleGroup/ToggleGroup.d.ts +3 -0
- package/dist/components/toggle-group/ToggleGroup/ToggleGroup.js +68 -0
- package/dist/components/toggle-group/ToggleGroup/ToggleGroup.js.map +1 -0
- package/dist/components/toggle-group/ToggleGroup/ToggleGroup.types.d.ts +28 -0
- package/dist/components/toggle-group/ToggleGroup/index.d.ts +3 -0
- package/dist/components/toggle-group/ToggleGroupItem/ToggleGroupItem.d.ts +3 -0
- package/dist/components/toggle-group/ToggleGroupItem/ToggleGroupItem.js +72 -0
- package/dist/components/toggle-group/ToggleGroupItem/ToggleGroupItem.js.map +1 -0
- package/dist/components/toggle-group/ToggleGroupItem/ToggleGroupItem.types.d.ts +10 -0
- package/dist/components/toggle-group/ToggleGroupItem/index.d.ts +2 -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 +26 -27
- 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 +23 -22
- 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/TooltipTrigger/TooltipTrigger.js +11 -15
- package/dist/components/tooltip/TooltipTrigger/TooltipTrigger.js.map +1 -1
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/index.js +7 -6
- package/dist/index.d.ts +9 -0
- package/dist/index.js +205 -158
- package/dist/lib/positioner/middleware/size.js +21 -0
- package/dist/lib/positioner/middleware/size.js.map +1 -0
- package/dist/ui.css +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +3 -2
- package/dist/utils/ref.d.ts +11 -0
- package/dist/utils/ref.js +10 -0
- package/dist/utils/ref.js.map +1 -0
- package/package.json +8 -7
- 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,13 @@
|
|
|
1
|
+
import { clsx as e } from "../../../utils/clsx.js";
|
|
2
|
+
import { Separator as t } from "../../separator/Separator.js";
|
|
3
|
+
import { createComponent as n, mergeProps as r } from "solid-js/web";
|
|
4
|
+
//#region src/components/select/SelectSeparator/SelectSeparator.tsx
|
|
5
|
+
function i(i) {
|
|
6
|
+
return n(t, r(i, { get class() {
|
|
7
|
+
return e("my-1", i.class);
|
|
8
|
+
} }));
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { i as SelectSeparator };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=SelectSeparator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectSeparator.js","names":["Separator","SeparatorProps","clsx","SelectSeparator","props","_$createComponent","_$mergeProps","class"],"sources":["../../../../src/components/select/SelectSeparator/SelectSeparator.tsx"],"sourcesContent":["import { Separator, type SeparatorProps } from \"~/components/separator\";\nimport { clsx } from \"~/utils\";\n\nexport function SelectSeparator(props: SeparatorProps) {\n return <Separator {...props} class={clsx(\"my-1\", props.class)} />;\n}\n"],"mappings":";;;;AAGA,SAAgBG,EAAgBC,GAAuB;CACrD,OAAAC,EAAQL,GAASM,EAAKF,GAAK,EAAA,IAAA,QAAA;EAAA,OAASF,EAAK,QAAQE,EAAMG,KAAK;CAAC,EAAA,CAAA,CAAA;AAC/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SelectSeparator } from './SelectSeparator';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ValidComponent } from 'solid-js';
|
|
2
|
+
import { SelectTriggerProps } from './SelectTrigger.types';
|
|
3
|
+
import { Button } from '../../button';
|
|
4
|
+
export declare const SelectTrigger: <T extends ValidComponent = typeof Button<"button">>(props: SelectTriggerProps<T>) => import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { clsx as e } from "../../../utils/clsx.js";
|
|
2
|
+
import { mergeRefs as t } from "../../../utils/ref.js";
|
|
3
|
+
import { Button as n } from "../../button/Button.js";
|
|
4
|
+
import { useSelectTrigger as r } from "./useSelectTrigger.js";
|
|
5
|
+
import { Dynamic as i, createComponent as a, memo as o, mergeProps as s } from "solid-js/web";
|
|
6
|
+
import { ChevronDown as c } from "lucide-solid";
|
|
7
|
+
//#region src/components/select/SelectTrigger/SelectTrigger.tsx
|
|
8
|
+
var l = (l) => {
|
|
9
|
+
let { ctx: u, isDisabled: d, attachListeners: f } = r(() => l);
|
|
10
|
+
return a(i, s(l, {
|
|
11
|
+
get disabled() {
|
|
12
|
+
return d();
|
|
13
|
+
},
|
|
14
|
+
get icon() {
|
|
15
|
+
return a(c, {});
|
|
16
|
+
},
|
|
17
|
+
iconPosition: "right",
|
|
18
|
+
get component() {
|
|
19
|
+
return l.component ?? n;
|
|
20
|
+
},
|
|
21
|
+
get variant() {
|
|
22
|
+
return l.variant ?? "outline";
|
|
23
|
+
},
|
|
24
|
+
ref(e) {
|
|
25
|
+
var n = t(u.setReference, l.ref, f);
|
|
26
|
+
typeof n == "function" && n(e);
|
|
27
|
+
},
|
|
28
|
+
role: "combobox",
|
|
29
|
+
"aria-haspopup": "listbox",
|
|
30
|
+
get "aria-expanded"() {
|
|
31
|
+
return u.open();
|
|
32
|
+
},
|
|
33
|
+
get "aria-controls"() {
|
|
34
|
+
return o(() => !!u.open())() ? u.contentId : void 0;
|
|
35
|
+
},
|
|
36
|
+
get "data-state"() {
|
|
37
|
+
return u.open() ? "open" : "closed";
|
|
38
|
+
},
|
|
39
|
+
get "data-disabled"() {
|
|
40
|
+
return d() ? "" : void 0;
|
|
41
|
+
},
|
|
42
|
+
get class() {
|
|
43
|
+
return e("justify-between", l.class);
|
|
44
|
+
}
|
|
45
|
+
}));
|
|
46
|
+
};
|
|
47
|
+
//#endregion
|
|
48
|
+
export { l as SelectTrigger };
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=SelectTrigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectTrigger.js","names":["ValidComponent","Dynamic","useSelectTrigger","SelectTriggerProps","clsx","mergeRefs","Button","ChevronDown","SelectTrigger","props","T","ctx","isDisabled","attachListeners","_$createComponent","_$mergeProps","disabled","icon","iconPosition","component","variant","ref","r$","_ref$","setReference","role","aria-expanded","open","aria-controls","_$memo","contentId","undefined","data-state","data-disabled","class"],"sources":["../../../../src/components/select/SelectTrigger/SelectTrigger.tsx"],"sourcesContent":["import type { ValidComponent } from \"solid-js\";\nimport { Dynamic } from \"solid-js/web\";\nimport { useSelectTrigger } from \"./useSelectTrigger\";\nimport type { SelectTriggerProps } from \"./SelectTrigger.types\";\nimport { clsx, mergeRefs } from \"~/utils\";\nimport { Button } from \"~/components/button\";\nimport { ChevronDown } from \"lucide-solid\";\n\nexport const SelectTrigger = <\n T extends ValidComponent = typeof Button<\"button\">,\n>(\n props: SelectTriggerProps<T>,\n) => {\n const { ctx, isDisabled, attachListeners } = useSelectTrigger(() => props);\n\n return (\n <Dynamic\n {...props}\n disabled={isDisabled()}\n icon={<ChevronDown />}\n iconPosition=\"right\"\n component={(props.component as ValidComponent) ?? Button<\"button\">}\n variant={props.variant ?? \"outline\"}\n ref={mergeRefs(ctx.setReference, props.ref, attachListeners)}\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n aria-expanded={ctx.open()}\n aria-controls={ctx.open() ? ctx.contentId : undefined}\n data-state={ctx.open() ? \"open\" : \"closed\"}\n data-disabled={isDisabled() ? \"\" : undefined}\n class={clsx(\"justify-between\", props.class)}\n />\n );\n};\n"],"mappings":";;;;;;;AAQA,IAAaQ,KAGXC,MACG;CACH,IAAM,EAAEE,QAAKC,eAAYC,uBAAoBX,QAAuBO,CAAK;CAEzE,OAAAK,EACGb,GAAOc,EACFN,GAAK;EAAA,IACTO,WAAQ;GAAA,OAAEJ,EAAW;EAAC;EAAA,IACtBK,OAAI;GAAA,OAAAH,EAAGP,GAAW,CAAA,CAAA;EAAA;EAClBW,cAAY;EAAA,IACZC,YAAS;GAAA,OAAGV,EAAMU,aAAgCb;EAAgB;EAAA,IAClEc,UAAO;GAAA,OAAEX,EAAMW,WAAW;EAAS;EAAAC,IAAAC,GAAA;GAAA,IAAAC,IAC9BlB,EAAUM,EAAIa,cAAcf,EAAMY,KAAKR,CAAe;GAAC,OAAAU,KAAA,cAAAA,EAAAD,CAAA;EAAA;EAC5DG,MAAI;EAAA,iBAAA;EAAA,IAAA,kBAAA;GAAA,OAEWd,EAAIgB,KAAK;EAAC;EAAA,IAAA,kBAAA;GAAA,OACVE,QAAA,CAAA,CAAAlB,EAAIgB,KAAK,CAAC,CAAA,CAAA,IAAGhB,EAAImB,YAAYC,KAAAA;EAAS;EAAA,IAAA,eAAA;GAAA,OACzCpB,EAAIgB,KAAK,IAAI,SAAS;EAAQ;EAAA,IAAA,kBAAA;GAAA,OAC3Bf,EAAW,IAAI,KAAKmB,KAAAA;EAAS;EAAA,IAAA,QAAA;GAAA,OACrC3B,EAAK,mBAAmBK,EAAMyB,KAAK;EAAC;CAAA,CAAA,CAAA;AAGjD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ValidComponent } from 'solid-js';
|
|
2
|
+
import { useSelectContext } from '../Select/Select.context';
|
|
3
|
+
import { SelectTriggerProps } from './SelectTrigger.types';
|
|
4
|
+
export interface UseSelectTriggerResult {
|
|
5
|
+
ctx: ReturnType<typeof useSelectContext>;
|
|
6
|
+
isDisabled: () => boolean;
|
|
7
|
+
/**
|
|
8
|
+
* 把开关下拉相关的原生事件监听器绑定到真正的 DOM 元素上(通过 ref 调用)。
|
|
9
|
+
* 用 addEventListener 而不是 JSX 的 onXxx prop,是为了不占用这些 prop 名——
|
|
10
|
+
* 调用方可以在 <SelectTrigger onClick={...}> 上自由传自己的原生事件处理,
|
|
11
|
+
* 两者是完全独立的两套机制,互不覆盖。
|
|
12
|
+
*/
|
|
13
|
+
attachListeners: (el: Element) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function useSelectTrigger<T extends ValidComponent>(props: () => SelectTriggerProps<T>): UseSelectTriggerResult;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { useSelectContext as e } from "../Select/Select.context.js";
|
|
2
|
+
import { onCleanup as t } from "solid-js";
|
|
3
|
+
//#region src/components/select/SelectTrigger/useSelectTrigger.ts
|
|
4
|
+
function n(n) {
|
|
5
|
+
let r = e("SelectTrigger"), i = () => r.disabled() || !!n().disabled, a = () => {
|
|
6
|
+
i() || (r.setActiveValue(r.value() ?? r.items.find((e) => !e.disabled)?.value), r.setOpen(!0));
|
|
7
|
+
};
|
|
8
|
+
return {
|
|
9
|
+
ctx: r,
|
|
10
|
+
isDisabled: i,
|
|
11
|
+
attachListeners: (e) => {
|
|
12
|
+
let n = () => {
|
|
13
|
+
i() || (r.open() ? r.setOpen(!1) : a());
|
|
14
|
+
}, o = (e) => {
|
|
15
|
+
if (i()) return;
|
|
16
|
+
let t = e;
|
|
17
|
+
if (!r.open()) {
|
|
18
|
+
[
|
|
19
|
+
"ArrowDown",
|
|
20
|
+
"ArrowUp",
|
|
21
|
+
"Enter",
|
|
22
|
+
" "
|
|
23
|
+
].includes(t.key) && (t.preventDefault(), a());
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
t.key === "Escape" && (t.stopPropagation(), r.close());
|
|
27
|
+
};
|
|
28
|
+
e.addEventListener("click", n), e.addEventListener("keydown", o), t(() => {
|
|
29
|
+
e.removeEventListener("click", n), e.removeEventListener("keydown", o);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { n as useSelectTrigger };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=useSelectTrigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSelectTrigger.js","names":[],"sources":["../../../../src/components/select/SelectTrigger/useSelectTrigger.ts"],"sourcesContent":["import { onCleanup, type ValidComponent } from \"solid-js\";\nimport { useSelectContext } from \"../Select/Select.context\";\nimport type { SelectTriggerProps } from \"./SelectTrigger.types\";\n\nexport interface UseSelectTriggerResult {\n ctx: ReturnType<typeof useSelectContext>;\n isDisabled: () => boolean;\n /**\n * 把开关下拉相关的原生事件监听器绑定到真正的 DOM 元素上(通过 ref 调用)。\n * 用 addEventListener 而不是 JSX 的 onXxx prop,是为了不占用这些 prop 名——\n * 调用方可以在 <SelectTrigger onClick={...}> 上自由传自己的原生事件处理,\n * 两者是完全独立的两套机制,互不覆盖。\n */\n attachListeners: (el: Element) => void;\n}\n\nexport function useSelectTrigger<T extends ValidComponent>(\n props: () => SelectTriggerProps<T>,\n): UseSelectTriggerResult {\n const ctx = useSelectContext(\"SelectTrigger\");\n\n const isDisabled = () => ctx.disabled() || !!props().disabled;\n\n const openAndHighlightSelected = () => {\n if (isDisabled()) return;\n ctx.setActiveValue(\n ctx.value() ?? ctx.items.find((it) => !it.disabled)?.value,\n );\n ctx.setOpen(true);\n };\n\n const attachListeners = (el: Element) => {\n const onClick = () => {\n if (isDisabled()) return;\n if (ctx.open()) ctx.setOpen(false);\n else openAndHighlightSelected();\n };\n\n const onKeyDown = (e: Event) => {\n if (isDisabled()) return;\n const keyboardEvent = e as KeyboardEvent;\n\n if (!ctx.open()) {\n if (\n [\"ArrowDown\", \"ArrowUp\", \"Enter\", \" \"].includes(keyboardEvent.key)\n ) {\n keyboardEvent.preventDefault();\n openAndHighlightSelected();\n }\n return;\n }\n\n if (keyboardEvent.key === \"Escape\") {\n keyboardEvent.stopPropagation();\n ctx.close();\n }\n };\n\n el.addEventListener(\"click\", onClick);\n el.addEventListener(\"keydown\", onKeyDown);\n\n onCleanup(() => {\n el.removeEventListener(\"click\", onClick);\n el.removeEventListener(\"keydown\", onKeyDown);\n });\n };\n\n return { ctx, isDisabled, attachListeners };\n}\n"],"mappings":";;;AAgBA,SAAgB,EACd,GACwB;CACxB,IAAM,IAAM,EAAiB,eAAe,GAEtC,UAAmB,EAAI,SAAS,KAAK,CAAC,CAAC,EAAM,CAAC,CAAC,UAE/C,UAAiC;EACjC,EAAW,MACf,EAAI,eACF,EAAI,MAAM,KAAK,EAAI,MAAM,MAAM,MAAO,CAAC,EAAG,QAAQ,CAAC,EAAE,KACvD,GACA,EAAI,QAAQ,EAAI;CAClB;CAsCA,OAAO;EAAE;EAAK;EAAY,kBApCD,MAAgB;GACvC,IAAM,UAAgB;IAChB,EAAW,MACX,EAAI,KAAK,IAAG,EAAI,QAAQ,EAAK,IAC5B,EAAyB;GAChC,GAEM,KAAa,MAAa;IAC9B,IAAI,EAAW,GAAG;IAClB,IAAM,IAAgB;IAEtB,IAAI,CAAC,EAAI,KAAK,GAAG;KACf,AACE;MAAC;MAAa;MAAW;MAAS;KAAG,CAAC,CAAC,SAAS,EAAc,GAAG,MAEjE,EAAc,eAAe,GAC7B,EAAyB;KAE3B;IACF;IAEA,AAAI,EAAc,QAAQ,aACxB,EAAc,gBAAgB,GAC9B,EAAI,MAAM;GAEd;GAKA,AAHA,EAAG,iBAAiB,SAAS,CAAO,GACpC,EAAG,iBAAiB,WAAW,CAAS,GAExC,QAAgB;IAEd,AADA,EAAG,oBAAoB,SAAS,CAAO,GACvC,EAAG,oBAAoB,WAAW,CAAS;GAC7C,CAAC;EACH;CAE0C;AAC5C"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { clsx as e } from "../../../utils/clsx.js";
|
|
2
|
+
import { useSelectContext as t } from "../Select/Select.context.js";
|
|
3
|
+
import { className as n, effect as r, insert as i, template as a } from "solid-js/web";
|
|
4
|
+
import { createMemo as o } from "solid-js";
|
|
5
|
+
//#region src/components/select/SelectValue/SelectValue.tsx
|
|
6
|
+
var s = /*#__PURE__*/ a("<span>");
|
|
7
|
+
function c(a) {
|
|
8
|
+
let c = t("SelectValue"), l = o(() => {
|
|
9
|
+
let e = c.value();
|
|
10
|
+
if (e != null) return c.items.find((t) => t.value === e)?.label ?? e;
|
|
11
|
+
});
|
|
12
|
+
return (() => {
|
|
13
|
+
var t = s();
|
|
14
|
+
return i(t, () => l() ?? a.placeholder ?? ""), r(() => n(t, e(!l() && "text-neutral-500", a.class))), t;
|
|
15
|
+
})();
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { c as SelectValue };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=SelectValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectValue.js","names":["createMemo","useSelectContext","SelectValueProps","clsx","SelectValue","props","ctx","label","v","value","undefined","items","find","it","_el$","_tmpl$","_$insert","placeholder","_$effect","_$className","class"],"sources":["../../../../src/components/select/SelectValue/SelectValue.tsx"],"sourcesContent":["import { createMemo } from \"solid-js\";\nimport { useSelectContext } from \"../Select/Select.context\";\nimport type { SelectValueProps } from \"./SelectValue.types\";\nimport { clsx } from \"~/utils\";\n\nexport function SelectValue(props: SelectValueProps) {\n const ctx = useSelectContext(\"SelectValue\");\n\n const label = createMemo(() => {\n const v = ctx.value();\n if (v === undefined || v === null) return undefined;\n return ctx.items.find((it) => it.value === v)?.label ?? v;\n });\n\n return (\n <span class={clsx(!label() && \"text-neutral-500\", props.class)}>\n {label() ?? props.placeholder ?? \"\"}\n </span>\n );\n}\n"],"mappings":";;;;;;AAKA,SAAgBI,EAAYC,GAAyB;CACnD,IAAMC,IAAML,EAAiB,aAAa,GAEpCM,IAAQP,QAAiB;EAC7B,IAAMQ,IAAIF,EAAIG,MAAM;EAChBD,SAAyB,MAC7B,OAAOF,EAAIK,MAAMC,MAAMC,MAAOA,EAAGJ,UAAUD,CAAC,CAAC,EAAED,SAASC;CAC1D,CAAC;CAED,cAAA;EAAA,IAAAM,IAAAC,EAAA;EACgE,OADhEC,EAAAF,SAEKP,EAAM,KAAKF,EAAMY,eAAe,EAAE,GAAAC,QAAAC,EAAAL,GADxBX,EAAK,CAACI,EAAM,KAAK,oBAAoBF,EAAMe,KAAK,CAAC,CAAA,GAAAN;CAAA,EAAA,CAAA;AAIlE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { Select } from './Select';
|
|
2
|
+
export type { SelectProps, SelectContextValue, SelectItemMeta } from './Select';
|
|
3
|
+
export { SelectTrigger } from './SelectTrigger';
|
|
4
|
+
export type { SelectTriggerProps } from './SelectTrigger';
|
|
5
|
+
export { SelectValue } from './SelectValue';
|
|
6
|
+
export type { SelectValueProps } from './SelectValue';
|
|
7
|
+
export { SelectContent } from './SelectContent';
|
|
8
|
+
export type { SelectContentProps } from './SelectContent';
|
|
9
|
+
export { SelectItem } from './SelectItem';
|
|
10
|
+
export type { SelectItemProps } from './SelectItem';
|
|
11
|
+
export { SelectGroup } from './SelectGroup';
|
|
12
|
+
export { SelectLabel } from './SelectLabel';
|
|
13
|
+
export { SelectSeparator } from './SelectSeparator';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Select as e } from "./Select/Select.js";
|
|
2
|
+
import { SelectTrigger as t } from "./SelectTrigger/SelectTrigger.js";
|
|
3
|
+
import { SelectValue as n } from "./SelectValue/SelectValue.js";
|
|
4
|
+
import { SelectContent as r } from "./SelectContent/SelectContent.js";
|
|
5
|
+
import { SelectItem as i } from "./SelectItem/SelectItem.js";
|
|
6
|
+
import { SelectGroup as a } from "./SelectGroup/SelectGroup.js";
|
|
7
|
+
import { SelectLabel as o } from "./SelectLabel/SelectLabel.js";
|
|
8
|
+
import { SelectSeparator as s } from "./SelectSeparator/SelectSeparator.js";
|
|
9
|
+
export { e as Select, r as SelectContent, a as SelectGroup, i as SelectItem, o as SelectLabel, s as SelectSeparator, t as SelectTrigger, n as SelectValue };
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { clsx as e } from "../../../utils/clsx.js";
|
|
2
|
+
import { toastIconVariants as t, toastVariants as n } from "./Toast.styles.js";
|
|
3
|
+
import { isAction as r } from "./Toast.types.js";
|
|
4
|
+
import { className as i, createComponent as a, delegateEvents as o, effect as s, insert as c, memo as l, setAttribute as u, style as d, template as f } from "solid-js/web";
|
|
5
|
+
import { Show as p, createEffect as m, createMemo as h, createSignal as g, onCleanup as _, onMount as v, splitProps as y } from "solid-js";
|
|
6
|
+
import { CircleCheck as b, CircleX as x, Info as S, LoaderCircle as C, TriangleAlert as w, X as T } from "lucide-solid";
|
|
7
|
+
//#region src/components/toast/Toast/Toast.tsx
|
|
8
|
+
var E = /*#__PURE__*/ f("<li data-slot=toast>"), D = /*#__PURE__*/ f("<div data-slot=toast-icon>"), O = /*#__PURE__*/ f("<div data-slot=toast-description>"), k = /*#__PURE__*/ f("<div data-slot=toast-content><div data-slot=toast-title>"), A = /*#__PURE__*/ f("<button type=button data-slot=toast-action>"), j = /*#__PURE__*/ f("<button type=button data-slot=toast-cancel>"), M = /*#__PURE__*/ f("<button type=button data-slot=toast-close>"), N = 4e3, P = 200;
|
|
9
|
+
function F(e) {
|
|
10
|
+
switch (e) {
|
|
11
|
+
case "success": return a(b, {});
|
|
12
|
+
case "info": return a(S, {});
|
|
13
|
+
case "warning": return a(w, {});
|
|
14
|
+
case "error": return a(x, {});
|
|
15
|
+
case "loading": return a(C, { class: "animate-spin" });
|
|
16
|
+
default: return;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function I(e) {
|
|
20
|
+
return typeof e == "function" ? e() : e;
|
|
21
|
+
}
|
|
22
|
+
function L(o) {
|
|
23
|
+
let [f] = y(o, [
|
|
24
|
+
"toast",
|
|
25
|
+
"closeButton",
|
|
26
|
+
"duration",
|
|
27
|
+
"class",
|
|
28
|
+
"icons",
|
|
29
|
+
"closeButtonAriaLabel",
|
|
30
|
+
"defaultRichColors",
|
|
31
|
+
"onRemove",
|
|
32
|
+
"index",
|
|
33
|
+
"total",
|
|
34
|
+
"expanded",
|
|
35
|
+
"position",
|
|
36
|
+
"gap"
|
|
37
|
+
]), [b, x] = g("closed"), S = () => f.toast, C = h(() => S().type ?? "default"), w = h(() => S().richColors ?? f.defaultRichColors ?? !1), L = h(() => S().dismissible !== !1), R = h(() => C() === "loading");
|
|
38
|
+
v(() => {
|
|
39
|
+
let e = requestAnimationFrame(() => x("open"));
|
|
40
|
+
_(() => cancelAnimationFrame(e));
|
|
41
|
+
});
|
|
42
|
+
let z = () => {
|
|
43
|
+
b() === "open" && (x("closed"), S().onDismiss?.(S()), setTimeout(() => f.onRemove(S().id), P));
|
|
44
|
+
};
|
|
45
|
+
m(() => {
|
|
46
|
+
S().delete && b() === "open" && z();
|
|
47
|
+
}), m(() => {
|
|
48
|
+
let e = S();
|
|
49
|
+
if (e.delete || e.type === "loading" || e.duration === Infinity || e.duration === 0) return;
|
|
50
|
+
let t = e.duration ?? f.duration ?? N, n = setTimeout(() => {
|
|
51
|
+
e.onAutoClose?.(e), z();
|
|
52
|
+
}, t);
|
|
53
|
+
_(() => clearTimeout(n));
|
|
54
|
+
});
|
|
55
|
+
let B = () => S().icon === void 0 ? f.icons?.[C()] ?? F(C()) : S().icon, V = () => f.index === 0, H = () => f.position.startsWith("top") ? "top" : "bottom", U = () => {
|
|
56
|
+
if (V()) return;
|
|
57
|
+
let e = H() === "bottom" ? -1 : 1, t = Math.max(.8, 1 - f.index * .05);
|
|
58
|
+
return `translateY(calc(${e * f.gap * f.index}px)) scale(${t})`;
|
|
59
|
+
}, W = () => ({
|
|
60
|
+
...S().style,
|
|
61
|
+
"z-index": f.total - f.index,
|
|
62
|
+
...f.expanded ? {} : {
|
|
63
|
+
"grid-area": "1 / 1",
|
|
64
|
+
"align-self": H() === "bottom" ? "end" : "start",
|
|
65
|
+
transform: U(),
|
|
66
|
+
"pointer-events": V() ? "auto" : "none"
|
|
67
|
+
}
|
|
68
|
+
}), G = () => H() === "bottom" ? "data-[state=open]:slide-in-from-bottom-2" : "data-[state=open]:slide-in-from-top-2", K = () => H() === "bottom" ? "data-[state=closed]:slide-out-to-bottom" : "data-[state=closed]:slide-out-to-top", q = () => V() || f.expanded ? `${G()} ${K()} data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:fill-mode-both data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:fill-mode-both` : "";
|
|
69
|
+
return (() => {
|
|
70
|
+
var o = E();
|
|
71
|
+
return c(o, a(p, {
|
|
72
|
+
get when() {
|
|
73
|
+
return S().jsx;
|
|
74
|
+
},
|
|
75
|
+
get fallback() {
|
|
76
|
+
return [
|
|
77
|
+
a(p, {
|
|
78
|
+
get when() {
|
|
79
|
+
return B();
|
|
80
|
+
},
|
|
81
|
+
get children() {
|
|
82
|
+
var n = D();
|
|
83
|
+
return c(n, B), s(() => i(n, e(t({ type: C() }), S().classes?.icon))), n;
|
|
84
|
+
}
|
|
85
|
+
}),
|
|
86
|
+
(() => {
|
|
87
|
+
var t = k(), n = t.firstChild;
|
|
88
|
+
return c(n, () => I(S().title)), c(t, a(p, {
|
|
89
|
+
get when() {
|
|
90
|
+
return S().description;
|
|
91
|
+
},
|
|
92
|
+
get children() {
|
|
93
|
+
var t = O();
|
|
94
|
+
return c(t, () => I(S().description)), s(() => i(t, e("text-sm leading-relaxed text-muted-foreground", S().descriptionClass, S().classes?.description))), t;
|
|
95
|
+
}
|
|
96
|
+
}), null), s((r) => {
|
|
97
|
+
var a = e("flex min-w-0 flex-1 flex-col gap-0.5", S().classes?.content), o = e("text-sm font-medium leading-snug", S().classes?.title);
|
|
98
|
+
return a !== r.e && i(t, r.e = a), o !== r.t && i(n, r.t = o), r;
|
|
99
|
+
}, {
|
|
100
|
+
e: void 0,
|
|
101
|
+
t: void 0
|
|
102
|
+
}), t;
|
|
103
|
+
})(),
|
|
104
|
+
a(p, {
|
|
105
|
+
get when() {
|
|
106
|
+
return l(() => !!S().action)() && r(S().action);
|
|
107
|
+
},
|
|
108
|
+
get children() {
|
|
109
|
+
var t = A();
|
|
110
|
+
return t.$$click = (e) => {
|
|
111
|
+
let t = S().action;
|
|
112
|
+
r(t) && (t.onClick?.(e), e.defaultPrevented || z());
|
|
113
|
+
}, c(t, () => S().action.label), s(() => i(t, e("shrink-0 rounded-md bg-foreground px-2.5 py-1 text-xs font-medium text-background outline-none transition-colors hover:bg-foreground/80", S().classes?.actionButton))), t;
|
|
114
|
+
}
|
|
115
|
+
}),
|
|
116
|
+
a(p, {
|
|
117
|
+
get when() {
|
|
118
|
+
return l(() => !!S().cancel)() && r(S().cancel);
|
|
119
|
+
},
|
|
120
|
+
get children() {
|
|
121
|
+
var t = j();
|
|
122
|
+
return t.$$click = (e) => {
|
|
123
|
+
let t = S().cancel;
|
|
124
|
+
r(t) && (t.onClick?.(e), e.defaultPrevented || z());
|
|
125
|
+
}, c(t, () => S().cancel.label), s(() => i(t, e("shrink-0 rounded-md bg-foreground/10 px-2.5 py-1 text-xs font-medium text-foreground outline-none transition-colors hover:bg-foreground/15", S().classes?.cancelButton))), t;
|
|
126
|
+
}
|
|
127
|
+
}),
|
|
128
|
+
a(p, {
|
|
129
|
+
get when() {
|
|
130
|
+
return l(() => !!S().action)() && !r(S().action);
|
|
131
|
+
},
|
|
132
|
+
get children() {
|
|
133
|
+
return S().action;
|
|
134
|
+
}
|
|
135
|
+
}),
|
|
136
|
+
a(p, {
|
|
137
|
+
get when() {
|
|
138
|
+
return l(() => !!S().cancel)() && !r(S().cancel);
|
|
139
|
+
},
|
|
140
|
+
get children() {
|
|
141
|
+
return S().cancel;
|
|
142
|
+
}
|
|
143
|
+
}),
|
|
144
|
+
a(p, {
|
|
145
|
+
get when() {
|
|
146
|
+
return l(() => !!(f.closeButton && L()))() && !R();
|
|
147
|
+
},
|
|
148
|
+
get children() {
|
|
149
|
+
var t = M();
|
|
150
|
+
return t.$$click = z, c(t, a(T, { class: "size-3.5" })), s((n) => {
|
|
151
|
+
var r = f.closeButtonAriaLabel ?? "Close toast", a = e("absolute top-2.5 right-2.5 flex size-5 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:text-foreground", S().classes?.closeButton);
|
|
152
|
+
return r !== n.e && u(t, "aria-label", n.e = r), a !== n.t && i(t, n.t = a), n;
|
|
153
|
+
}, {
|
|
154
|
+
e: void 0,
|
|
155
|
+
t: void 0
|
|
156
|
+
}), t;
|
|
157
|
+
}
|
|
158
|
+
})
|
|
159
|
+
];
|
|
160
|
+
},
|
|
161
|
+
get children() {
|
|
162
|
+
return S().jsx;
|
|
163
|
+
}
|
|
164
|
+
})), s((t) => {
|
|
165
|
+
var r = C(), a = b(), s = w(), c = S().testId, l = e(n({ type: C() }), f.closeButton && "pr-8", q(), f.class, S().class, S().classes?.toast, S().classes?.[C()]), p = W();
|
|
166
|
+
return r !== t.e && u(o, "data-type", t.e = r), a !== t.t && u(o, "data-state", t.t = a), s !== t.a && u(o, "data-rich-colors", t.a = s), c !== t.o && u(o, "data-testid", t.o = c), l !== t.i && i(o, t.i = l), t.n = d(o, p, t.n), t;
|
|
167
|
+
}, {
|
|
168
|
+
e: void 0,
|
|
169
|
+
t: void 0,
|
|
170
|
+
a: void 0,
|
|
171
|
+
o: void 0,
|
|
172
|
+
i: void 0,
|
|
173
|
+
n: void 0
|
|
174
|
+
}), o;
|
|
175
|
+
})();
|
|
176
|
+
}
|
|
177
|
+
o(["click"]);
|
|
178
|
+
//#endregion
|
|
179
|
+
export { L as Toast };
|
|
180
|
+
|
|
181
|
+
//# sourceMappingURL=Toast.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Toast.js","names":["Show","JSX","createEffect","createMemo","createSignal","onCleanup","onMount","splitProps","CircleCheck","CircleX","Info","LoaderCircle","TriangleAlert","X","clsx","toastIconVariants","toastVariants","isAction","ToastIcons","ToastProps","ToastT","ToastTypes","TOAST_LIFETIME","EXIT_ANIMATION_MS","getDefaultIcon","type","_$createComponent","undefined","resolveContent","value","Toast","props","local","animationState","setAnimationState","toast","toastType","richColors","defaultRichColors","dismissible","isBusy","raf","requestAnimationFrame","cancelAnimationFrame","close","onDismiss","setTimeout","onRemove","id","delete","current","duration","Infinity","delay","timer","onAutoClose","clearTimeout","icon","icons","isFront","index","yPosition","position","startsWith","collapsedTransform","lift","scale","Math","max","gap","toastStyle","style","total","expanded","transform","CSSProperties","slideInClass","slideOutClass","animationClasses","_el$","_tmpl$","_$insert","when","jsx","fallback","children","_el$2","_tmpl$2","_$effect","_$className","classes","_el$3","_tmpl$4","_el$4","firstChild","title","description","_el$5","_tmpl$3","descriptionClass","_p$","_v$7","content","_v$8","e","t","_$memo","action","_el$6","_tmpl$5","$$click","onClick","defaultPrevented","Extract","label","actionButton","cancel","_el$7","_tmpl$6","cancelButton","Element","closeButton","_el$8","_tmpl$7","_v$9","closeButtonAriaLabel","_v$0","_$setAttribute","_v$","_v$2","_v$3","_v$4","testId","_v$5","class","_v$6","a","o","i","n","_$style","_$delegateEvents"],"sources":["../../../../src/components/toast/Toast/Toast.tsx"],"sourcesContent":["import {\n Show,\n type JSX,\n createEffect,\n createMemo,\n createSignal,\n onCleanup,\n onMount,\n splitProps,\n} from \"solid-js\";\nimport {\n CircleCheck,\n CircleX,\n Info,\n LoaderCircle,\n TriangleAlert,\n X,\n} from \"lucide-solid\";\nimport { clsx } from \"~/utils\";\nimport { toastIconVariants, toastVariants } from \"./Toast.styles\";\nimport {\n isAction,\n type ToastIcons,\n type ToastProps,\n type ToastT,\n type ToastTypes,\n} from \"./Toast.types\";\n\nconst TOAST_LIFETIME = 4000;\nconst EXIT_ANIMATION_MS = 200;\n\nfunction getDefaultIcon(type: ToastTypes) {\n switch (type) {\n case \"success\":\n return <CircleCheck />;\n case \"info\":\n return <Info />;\n case \"warning\":\n return <TriangleAlert />;\n case \"error\":\n return <CircleX />;\n case \"loading\":\n return <LoaderCircle class=\"animate-spin\" />;\n default:\n return undefined;\n }\n}\n\nfunction resolveContent(value: ToastT[\"title\"]) {\n return typeof value === \"function\" ? value() : value;\n}\n\nexport function Toast(props: ToastProps) {\n const [local] = splitProps(props, [\n \"toast\",\n \"closeButton\",\n \"duration\",\n \"class\",\n \"icons\",\n \"closeButtonAriaLabel\",\n \"defaultRichColors\",\n \"onRemove\",\n \"index\",\n \"total\",\n \"expanded\",\n \"position\",\n \"gap\",\n ]);\n\n const [animationState, setAnimationState] = createSignal<\"open\" | \"closed\">(\n \"closed\",\n );\n\n const toast = () => local.toast;\n const toastType = createMemo(() => toast().type ?? \"default\");\n const richColors = createMemo(\n () => toast().richColors ?? local.defaultRichColors ?? false,\n );\n const dismissible = createMemo(() => toast().dismissible !== false);\n const isBusy = createMemo(() => toastType() === \"loading\");\n\n onMount(() => {\n const raf = requestAnimationFrame(() => setAnimationState(\"open\"));\n onCleanup(() => cancelAnimationFrame(raf));\n });\n\n const close = () => {\n if (animationState() !== \"open\") return;\n setAnimationState(\"closed\");\n toast().onDismiss?.(toast());\n setTimeout(() => local.onRemove(toast().id), EXIT_ANIMATION_MS);\n };\n\n // 外部 dismiss:把 delete 标记转换成退场动画\n createEffect(() => {\n if (toast().delete && animationState() === \"open\") {\n close();\n }\n });\n\n // 自动关闭计时器\n createEffect(() => {\n const current = toast();\n if (\n current.delete ||\n current.type === \"loading\" ||\n current.duration === Infinity ||\n current.duration === 0\n ) {\n return;\n }\n\n const delay = current.duration ?? local.duration ?? TOAST_LIFETIME;\n const timer = setTimeout(() => {\n current.onAutoClose?.(current);\n close();\n }, delay);\n\n onCleanup(() => clearTimeout(timer));\n });\n\n const icon = () => {\n if (toast().icon !== undefined) return toast().icon;\n return (\n local.icons?.[toastType() as keyof ToastIcons] ??\n getDefaultIcon(toastType())\n );\n };\n\n const isFront = () => local.index === 0;\n const yPosition = () => (local.position.startsWith(\"top\") ? \"top\" : \"bottom\");\n\n const collapsedTransform = () => {\n if (isFront()) return undefined;\n const lift = yPosition() === \"bottom\" ? -1 : 1;\n const scale = Math.max(0.8, 1 - local.index * 0.05);\n return `translateY(calc(${lift * local.gap * local.index}px)) scale(${scale})`;\n };\n\n const toastStyle = () =>\n ({\n ...toast().style,\n \"z-index\": local.total - local.index,\n ...(local.expanded\n ? {}\n : {\n \"grid-area\": \"1 / 1\",\n \"align-self\": yPosition() === \"bottom\" ? \"end\" : \"start\",\n transform: collapsedTransform(),\n \"pointer-events\": isFront() ? \"auto\" : \"none\",\n }),\n }) as JSX.CSSProperties;\n\n const slideInClass = () =>\n yPosition() === \"bottom\"\n ? \"data-[state=open]:slide-in-from-bottom-2\"\n : \"data-[state=open]:slide-in-from-top-2\";\n\n const slideOutClass = () =>\n yPosition() === \"bottom\"\n ? \"data-[state=closed]:slide-out-to-bottom\"\n : \"data-[state=closed]:slide-out-to-top\";\n\n const animationClasses = () =>\n isFront() || local.expanded\n ? `${slideInClass()} ${slideOutClass()} data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:fill-mode-both data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:fill-mode-both`\n : \"\";\n\n return (\n <li\n data-slot=\"toast\"\n data-type={toastType()}\n data-state={animationState()}\n data-rich-colors={richColors()}\n data-testid={toast().testId}\n class={clsx(\n toastVariants({ type: toastType() }),\n local.closeButton && \"pr-8\",\n animationClasses(),\n local.class,\n toast().class,\n toast().classes?.toast,\n toast().classes?.[toastType()],\n )}\n style={toastStyle()}\n >\n <Show\n when={toast().jsx}\n fallback={\n <>\n <Show when={icon()}>\n <div\n data-slot=\"toast-icon\"\n class={clsx(\n toastIconVariants({ type: toastType() }),\n toast().classes?.icon,\n )}\n >\n {icon()}\n </div>\n </Show>\n\n <div\n data-slot=\"toast-content\"\n class={clsx(\n \"flex min-w-0 flex-1 flex-col gap-0.5\",\n toast().classes?.content,\n )}\n >\n <div\n data-slot=\"toast-title\"\n class={clsx(\n \"text-sm font-medium leading-snug\",\n toast().classes?.title,\n )}\n >\n {resolveContent(toast().title)}\n </div>\n <Show when={toast().description}>\n <div\n data-slot=\"toast-description\"\n class={clsx(\n \"text-sm leading-relaxed text-muted-foreground\",\n toast().descriptionClass,\n toast().classes?.description,\n )}\n >\n {resolveContent(toast().description)}\n </div>\n </Show>\n </div>\n\n <Show when={toast().action && isAction(toast().action)}>\n <button\n type=\"button\"\n data-slot=\"toast-action\"\n class={clsx(\n \"shrink-0 rounded-md bg-foreground px-2.5 py-1 text-xs font-medium text-background outline-none transition-colors hover:bg-foreground/80\",\n toast().classes?.actionButton,\n )}\n onClick={(e) => {\n const action = toast().action;\n if (!isAction(action)) return;\n action.onClick?.(e);\n if (!e.defaultPrevented) close();\n }}\n >\n {\n (\n toast().action as Extract<\n ToastT[\"action\"],\n { label: unknown }\n >\n ).label\n }\n </button>\n </Show>\n\n <Show when={toast().cancel && isAction(toast().cancel)}>\n <button\n type=\"button\"\n data-slot=\"toast-cancel\"\n class={clsx(\n \"shrink-0 rounded-md bg-foreground/10 px-2.5 py-1 text-xs font-medium text-foreground outline-none transition-colors hover:bg-foreground/15\",\n toast().classes?.cancelButton,\n )}\n onClick={(e) => {\n const cancel = toast().cancel;\n if (!isAction(cancel)) return;\n cancel.onClick?.(e);\n if (!e.defaultPrevented) close();\n }}\n >\n {\n (\n toast().cancel as Extract<\n ToastT[\"action\"],\n { label: unknown }\n >\n ).label\n }\n </button>\n </Show>\n\n <Show when={toast().action && !isAction(toast().action)}>\n {toast().action as JSX.Element}\n </Show>\n <Show when={toast().cancel && !isAction(toast().cancel)}>\n {toast().cancel as JSX.Element}\n </Show>\n\n <Show when={local.closeButton && dismissible() && !isBusy()}>\n <button\n type=\"button\"\n data-slot=\"toast-close\"\n aria-label={local.closeButtonAriaLabel ?? \"Close toast\"}\n class={clsx(\n \"absolute top-2.5 right-2.5 flex size-5 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:text-foreground\",\n toast().classes?.closeButton,\n )}\n onClick={close}\n >\n <X class=\"size-3.5\" />\n </button>\n </Show>\n </>\n }\n >\n {toast().jsx}\n </Show>\n </li>\n );\n}\n"],"mappings":";;;;;;;0bA4BMsB,IAAiB,KACjBC,IAAoB;AAE1B,SAASC,EAAeC,GAAkB;CACxC,QAAQA,GAAR;EACE,KAAK,WACH,OAAAC,EAAQlB,GAAW,CAAA,CAAA;EACrB,KAAK,QACH,OAAAkB,EAAQhB,GAAI,CAAA,CAAA;EACd,KAAK,WACH,OAAAgB,EAAQd,GAAa,CAAA,CAAA;EACvB,KAAK,SACH,OAAAc,EAAQjB,GAAO,CAAA,CAAA;EACjB,KAAK,WACH,OAAAiB,EAAQf,GAAY,EAAA,OAAA,eAAA,CAAA;EACtB,SACE;CACJ;AACF;AAEA,SAASiB,EAAeC,GAAwB;CAC9C,OAAO,OAAOA,KAAU,aAAaA,EAAM,IAAIA;AACjD;AAEA,SAAgBC,EAAMC,GAAmB;CACvC,IAAM,CAACC,KAASzB,EAAWwB,GAAO;EAChC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAK,CACN,GAEK,CAACE,GAAgBC,KAAqB9B,EAC1C,QACF,GAEM+B,UAAcH,EAAMG,OACpBC,IAAYjC,QAAiBgC,EAAM,CAAC,CAACV,QAAQ,SAAS,GACtDY,IAAal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AsC,KAAAjD,EAAAV,GAAAqB,EAAAsC,IAAAL,CAAA,GAAAjC,EAAAuC,IAAAC,EAAA7D,GAAAwD,GAAAnC,EAAAuC,CAAA,GAAAvC;EAAA,GAAA;GAAAI,GAAA7E,KAAAA;GAAA8E,GAAA9E,KAAAA;GAAA6G,GAAA7G,KAAAA;GAAA8G,GAAA9G,KAAAA;GAAA+G,GAAA/G,KAAAA;GAAAgH,GAAAhH,KAAAA;EAAA,CAAA,GAAAoD;CAAA,EAAA,CAAA;AAgIzB;AAAC8D,EAAA,CAAA,OAAA,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const toastVariants: (props?: ({
|
|
2
|
+
type?: "info" | "error" | "default" | "loading" | "success" | "warning" | null | undefined;
|
|
3
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
4
|
+
export declare const toastIconVariants: (props?: ({
|
|
5
|
+
type?: "info" | "error" | "default" | "loading" | "success" | "warning" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { cva as e } from "class-variance-authority";
|
|
2
|
+
//#region src/components/toast/Toast/Toast.styles.ts
|
|
3
|
+
var t = e("pointer-events-auto relative flex w-full items-center gap-2.5 rounded-lg border bg-popover p-4 text-sm text-popover-foreground shadow-md outline-none", {
|
|
4
|
+
variants: { type: {
|
|
5
|
+
default: "border-border",
|
|
6
|
+
success: "border-emerald-500/60",
|
|
7
|
+
info: "border-blue-500/60",
|
|
8
|
+
warning: "border-amber-500/60",
|
|
9
|
+
error: "border-red-500/60",
|
|
10
|
+
loading: "border-border"
|
|
11
|
+
} },
|
|
12
|
+
defaultVariants: { type: "default" }
|
|
13
|
+
}), n = e("flex size-5 shrink-0 items-center justify-center", {
|
|
14
|
+
variants: { type: {
|
|
15
|
+
default: "text-muted-foreground",
|
|
16
|
+
success: "text-emerald-500",
|
|
17
|
+
info: "text-blue-500",
|
|
18
|
+
warning: "text-amber-500",
|
|
19
|
+
error: "text-red-500",
|
|
20
|
+
loading: "text-muted-foreground"
|
|
21
|
+
} },
|
|
22
|
+
defaultVariants: { type: "default" }
|
|
23
|
+
});
|
|
24
|
+
//#endregion
|
|
25
|
+
export { n as toastIconVariants, t as toastVariants };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=Toast.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Toast.styles.js","names":[],"sources":["../../../../src/components/toast/Toast/Toast.styles.ts"],"sourcesContent":["import { cva } from \"class-variance-authority\";\n\nexport const toastVariants = cva(\n \"pointer-events-auto relative flex w-full items-center gap-2.5 rounded-lg border bg-popover p-4 text-sm text-popover-foreground shadow-md outline-none\",\n {\n variants: {\n type: {\n default: \"border-border\",\n success: \"border-emerald-500/60\",\n info: \"border-blue-500/60\",\n warning: \"border-amber-500/60\",\n error: \"border-red-500/60\",\n loading: \"border-border\",\n },\n },\n defaultVariants: {\n type: \"default\",\n },\n },\n);\n\nexport const toastIconVariants = cva(\n \"flex size-5 shrink-0 items-center justify-center\",\n {\n variants: {\n type: {\n default: \"text-muted-foreground\",\n success: \"text-emerald-500\",\n info: \"text-blue-500\",\n warning: \"text-amber-500\",\n error: \"text-red-500\",\n loading: \"text-muted-foreground\",\n },\n },\n defaultVariants: {\n type: \"default\",\n },\n },\n);\n"],"mappings":";;AAEA,IAAa,IAAgB,EAC3B,yJACA;CACE,UAAU,EACR,MAAM;EACJ,SAAS;EACT,SAAS;EACT,MAAM;EACN,SAAS;EACT,OAAO;EACP,SAAS;CACX,EACF;CACA,iBAAiB,EACf,MAAM,UACR;AACF,CACF,GAEa,IAAoB,EAC/B,oDACA;CACE,UAAU,EACR,MAAM;EACJ,SAAS;EACT,SAAS;EACT,MAAM;EACN,SAAS;EACT,OAAO;EACP,SAAS;CACX,EACF;CACA,iBAAiB,EACf,MAAM,UACR;AACF,CACF"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { JSX, JSXElement } from 'solid-js';
|
|
2
|
+
export type ToastTypes = "success" | "info" | "warning" | "error" | "loading" | "default";
|
|
3
|
+
export type Position = "top-left" | "top-right" | "bottom-left" | "bottom-right" | "top-center" | "bottom-center";
|
|
4
|
+
export type Theme = "light" | "dark";
|
|
5
|
+
export type SwipeDirection = "top" | "right" | "bottom" | "left";
|
|
6
|
+
export interface Action {
|
|
7
|
+
label: JSXElement;
|
|
8
|
+
onClick: JSX.EventHandler<HTMLButtonElement, MouseEvent>;
|
|
9
|
+
actionButtonStyle?: JSX.CSSProperties;
|
|
10
|
+
}
|
|
11
|
+
export interface ToastIcons {
|
|
12
|
+
success?: JSXElement;
|
|
13
|
+
info?: JSXElement;
|
|
14
|
+
warning?: JSXElement;
|
|
15
|
+
error?: JSXElement;
|
|
16
|
+
loading?: JSXElement;
|
|
17
|
+
close?: JSXElement;
|
|
18
|
+
}
|
|
19
|
+
export interface ToastClassnames {
|
|
20
|
+
toast?: string;
|
|
21
|
+
title?: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
loader?: string;
|
|
24
|
+
cancelButton?: string;
|
|
25
|
+
actionButton?: string;
|
|
26
|
+
closeButton?: string;
|
|
27
|
+
success?: string;
|
|
28
|
+
error?: string;
|
|
29
|
+
info?: string;
|
|
30
|
+
warning?: string;
|
|
31
|
+
loading?: string;
|
|
32
|
+
default?: string;
|
|
33
|
+
content?: string;
|
|
34
|
+
icon?: string;
|
|
35
|
+
}
|
|
36
|
+
export type PromiseT<Data = any> = Promise<Data> | (() => Promise<Data>);
|
|
37
|
+
export type PromiseTResult<Data = any> = string | JSXElement | ((data: Data) => JSXElement | string | Promise<JSXElement | string>);
|
|
38
|
+
export interface PromiseData<ToastData = any> {
|
|
39
|
+
loading?: string | JSXElement;
|
|
40
|
+
success?: PromiseTResult<ToastData>;
|
|
41
|
+
error?: PromiseTResult;
|
|
42
|
+
description?: PromiseTResult;
|
|
43
|
+
finally?: () => void | Promise<void>;
|
|
44
|
+
}
|
|
45
|
+
export interface ToastT {
|
|
46
|
+
id: string;
|
|
47
|
+
toasterId?: string;
|
|
48
|
+
title?: JSXElement | (() => JSXElement);
|
|
49
|
+
description?: JSXElement | (() => JSXElement);
|
|
50
|
+
type?: ToastTypes;
|
|
51
|
+
icon?: JSXElement;
|
|
52
|
+
jsx?: JSXElement;
|
|
53
|
+
richColors?: boolean;
|
|
54
|
+
invert?: boolean;
|
|
55
|
+
closeButton?: boolean;
|
|
56
|
+
dismissible?: boolean;
|
|
57
|
+
duration?: number;
|
|
58
|
+
delete?: boolean;
|
|
59
|
+
action?: Action | JSXElement;
|
|
60
|
+
cancel?: Action | JSXElement;
|
|
61
|
+
onDismiss?: (toast: ToastT) => void;
|
|
62
|
+
onAutoClose?: (toast: ToastT) => void;
|
|
63
|
+
promise?: PromiseT;
|
|
64
|
+
style?: JSX.CSSProperties;
|
|
65
|
+
class?: string;
|
|
66
|
+
classes?: ToastClassnames;
|
|
67
|
+
descriptionClass?: string;
|
|
68
|
+
position?: Position;
|
|
69
|
+
testId?: string;
|
|
70
|
+
}
|
|
71
|
+
export type ExternalToast = Omit<ToastT, "id" | "type" | "title" | "jsx" | "delete" | "promise"> & {
|
|
72
|
+
id?: string;
|
|
73
|
+
toasterId?: string;
|
|
74
|
+
};
|
|
75
|
+
export interface ToastProps {
|
|
76
|
+
toast: ToastT;
|
|
77
|
+
closeButton: boolean;
|
|
78
|
+
duration?: number;
|
|
79
|
+
class?: string;
|
|
80
|
+
icons?: ToastIcons;
|
|
81
|
+
closeButtonAriaLabel?: string;
|
|
82
|
+
defaultRichColors?: boolean;
|
|
83
|
+
onRemove: (id: string) => void;
|
|
84
|
+
index: number;
|
|
85
|
+
total: number;
|
|
86
|
+
expanded: boolean;
|
|
87
|
+
position: Position;
|
|
88
|
+
gap: number;
|
|
89
|
+
}
|
|
90
|
+
export declare const isAction: (action: Action | JSXElement) => action is Action;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Toast.types.js","names":[],"sources":["../../../../src/components/toast/Toast/Toast.types.ts"],"sourcesContent":["import type { JSX, JSXElement } from \"solid-js\";\n\nexport type ToastTypes =\n | \"success\"\n | \"info\"\n | \"warning\"\n | \"error\"\n | \"loading\"\n | \"default\";\n\nexport type Position =\n | \"top-left\"\n | \"top-right\"\n | \"bottom-left\"\n | \"bottom-right\"\n | \"top-center\"\n | \"bottom-center\";\n\nexport type Theme = \"light\" | \"dark\";\nexport type SwipeDirection = \"top\" | \"right\" | \"bottom\" | \"left\";\n\nexport interface Action {\n label: JSXElement;\n onClick: JSX.EventHandler<HTMLButtonElement, MouseEvent>;\n actionButtonStyle?: JSX.CSSProperties;\n}\n\nexport interface ToastIcons {\n success?: JSXElement;\n info?: JSXElement;\n warning?: JSXElement;\n error?: JSXElement;\n loading?: JSXElement;\n close?: JSXElement;\n}\n\nexport interface ToastClassnames {\n toast?: string;\n title?: string;\n description?: string;\n loader?: string;\n cancelButton?: string;\n actionButton?: string;\n closeButton?: string;\n success?: string;\n error?: string;\n info?: string;\n warning?: string;\n loading?: string;\n default?: string;\n content?: string;\n icon?: string;\n}\n\nexport type PromiseT<Data = any> = Promise<Data> | (() => Promise<Data>);\n\nexport type PromiseTResult<Data = any> =\n | string\n | JSXElement\n | ((data: Data) => JSXElement | string | Promise<JSXElement | string>);\n\nexport interface PromiseData<ToastData = any> {\n loading?: string | JSXElement;\n success?: PromiseTResult<ToastData>;\n error?: PromiseTResult;\n description?: PromiseTResult;\n finally?: () => void | Promise<void>;\n}\n\nexport interface ToastT {\n id: string;\n toasterId?: string;\n title?: JSXElement | (() => JSXElement);\n description?: JSXElement | (() => JSXElement);\n type?: ToastTypes;\n icon?: JSXElement;\n jsx?: JSXElement;\n richColors?: boolean;\n invert?: boolean;\n closeButton?: boolean;\n dismissible?: boolean;\n duration?: number;\n delete?: boolean;\n action?: Action | JSXElement;\n cancel?: Action | JSXElement;\n onDismiss?: (toast: ToastT) => void;\n onAutoClose?: (toast: ToastT) => void;\n promise?: PromiseT;\n style?: JSX.CSSProperties;\n class?: string;\n classes?: ToastClassnames;\n descriptionClass?: string;\n position?: Position;\n testId?: string;\n}\n\nexport type ExternalToast = Omit<\n ToastT,\n \"id\" | \"type\" | \"title\" | \"jsx\" | \"delete\" | \"promise\"\n> & {\n id?: string;\n toasterId?: string;\n};\n\nexport interface ToastProps {\n toast: ToastT;\n closeButton: boolean;\n duration?: number;\n class?: string;\n icons?: ToastIcons;\n closeButtonAriaLabel?: string;\n defaultRichColors?: boolean;\n onRemove: (id: string) => void;\n index: number;\n total: number;\n expanded: boolean;\n position: Position;\n gap: number;\n}\n\nexport const isAction = (action: Action | JSXElement): action is Action => {\n return (action as Action)?.label !== undefined;\n};\n"],"mappings":";AAwHA,IAAa,KAAY,MACf,GAAmB,UAAU,KAAA"}
|