@cmdniels/uikit 1.0.0
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/LICENSE +21 -0
- package/README.md +149 -0
- package/out/cn.d.ts +2 -0
- package/out/cn.js +5 -0
- package/out/components/accordion/Accordion.d.ts +2 -0
- package/out/components/accordion/Accordion.js +19 -0
- package/out/components/accordion/AccordionContent.d.ts +2 -0
- package/out/components/accordion/AccordionContent.js +19 -0
- package/out/components/accordion/AccordionItem.d.ts +2 -0
- package/out/components/accordion/AccordionItem.js +19 -0
- package/out/components/accordion/AccordionTrigger.d.ts +2 -0
- package/out/components/accordion/AccordionTrigger.js +20 -0
- package/out/components/alert/Alert.d.ts +4 -0
- package/out/components/alert/Alert.js +18 -0
- package/out/components/alert/AlertAction.d.ts +2 -0
- package/out/components/alert/AlertAction.js +17 -0
- package/out/components/alert/AlertDescription.d.ts +2 -0
- package/out/components/alert/AlertDescription.js +17 -0
- package/out/components/alert/AlertTitle.d.ts +2 -0
- package/out/components/alert/AlertTitle.js +17 -0
- package/out/components/alert/alertVariants.d.ts +3 -0
- package/out/components/alert/alertVariants.js +12 -0
- package/out/components/alert-dialog/AlertDialog.d.ts +2 -0
- package/out/components/alert-dialog/AlertDialog.js +18 -0
- package/out/components/alert-dialog/AlertDialogAction.d.ts +3 -0
- package/out/components/alert-dialog/AlertDialogAction.js +18 -0
- package/out/components/alert-dialog/AlertDialogCancel.d.ts +4 -0
- package/out/components/alert-dialog/AlertDialogCancel.js +20 -0
- package/out/components/alert-dialog/AlertDialogContent.d.ts +4 -0
- package/out/components/alert-dialog/AlertDialogContent.js +21 -0
- package/out/components/alert-dialog/AlertDialogDescription.d.ts +3 -0
- package/out/components/alert-dialog/AlertDialogDescription.js +19 -0
- package/out/components/alert-dialog/AlertDialogFooter.d.ts +2 -0
- package/out/components/alert-dialog/AlertDialogFooter.js +17 -0
- package/out/components/alert-dialog/AlertDialogHeader.d.ts +2 -0
- package/out/components/alert-dialog/AlertDialogHeader.js +17 -0
- package/out/components/alert-dialog/AlertDialogMedia.d.ts +2 -0
- package/out/components/alert-dialog/AlertDialogMedia.js +17 -0
- package/out/components/alert-dialog/AlertDialogOverlay.d.ts +2 -0
- package/out/components/alert-dialog/AlertDialogOverlay.js +19 -0
- package/out/components/alert-dialog/AlertDialogPortal.d.ts +2 -0
- package/out/components/alert-dialog/AlertDialogPortal.js +18 -0
- package/out/components/alert-dialog/AlertDialogTitle.d.ts +3 -0
- package/out/components/alert-dialog/AlertDialogTitle.js +19 -0
- package/out/components/alert-dialog/AlertDialogTrigger.d.ts +2 -0
- package/out/components/alert-dialog/AlertDialogTrigger.js +18 -0
- package/out/components/aspect-ratio/AspectRatio.d.ts +4 -0
- package/out/components/aspect-ratio/AspectRatio.js +19 -0
- package/out/components/badge/Badge.d.ts +4 -0
- package/out/components/badge/Badge.js +29 -0
- package/out/components/badge/badgeVariants.d.ts +3 -0
- package/out/components/badge/badgeVariants.js +16 -0
- package/out/components/button/Button.d.ts +4 -0
- package/out/components/button/Button.js +19 -0
- package/out/components/button/buttonVariants.d.ts +4 -0
- package/out/components/button/buttonVariants.js +28 -0
- package/out/components/button-group/ButtonGroup.d.ts +4 -0
- package/out/components/button-group/ButtonGroup.js +18 -0
- package/out/components/button-group/ButtonGroupSeparator.d.ts +3 -0
- package/out/components/button-group/ButtonGroupSeparator.js +18 -0
- package/out/components/button-group/ButtonGroupText.d.ts +2 -0
- package/out/components/button-group/ButtonGroupText.js +27 -0
- package/out/components/button-group/buttonGroupVariants.d.ts +4 -0
- package/out/components/button-group/buttonGroupVariants.js +13 -0
- package/out/components/calendar/Calendar.d.ts +6 -0
- package/out/components/calendar/Calendar.js +43 -0
- package/out/components/calendar/CalendarDayButton.d.ts +3 -0
- package/out/components/calendar/CalendarDayButton.js +29 -0
- package/out/components/card/Card.d.ts +4 -0
- package/out/components/card/Card.js +17 -0
- package/out/components/card/CardAction.d.ts +2 -0
- package/out/components/card/CardAction.js +17 -0
- package/out/components/card/CardContent.d.ts +2 -0
- package/out/components/card/CardContent.js +17 -0
- package/out/components/card/CardDescription.d.ts +2 -0
- package/out/components/card/CardDescription.js +17 -0
- package/out/components/card/CardFooter.d.ts +2 -0
- package/out/components/card/CardFooter.js +17 -0
- package/out/components/card/CardHeader.d.ts +2 -0
- package/out/components/card/CardHeader.js +17 -0
- package/out/components/card/CardTitle.d.ts +2 -0
- package/out/components/card/CardTitle.js +17 -0
- package/out/components/checkbox/Checkbox.d.ts +2 -0
- package/out/components/checkbox/Checkbox.js +20 -0
- package/out/components/combobox/Combobox.d.ts +3 -0
- package/out/components/combobox/Combobox.js +4 -0
- package/out/components/combobox/ComboboxChip.d.ts +4 -0
- package/out/components/combobox/ComboboxChip.js +21 -0
- package/out/components/combobox/ComboboxChips.d.ts +3 -0
- package/out/components/combobox/ComboboxChips.js +19 -0
- package/out/components/combobox/ComboboxChipsInput.d.ts +2 -0
- package/out/components/combobox/ComboboxChipsInput.js +19 -0
- package/out/components/combobox/ComboboxClear.d.ts +2 -0
- package/out/components/combobox/ComboboxClear.js +21 -0
- package/out/components/combobox/ComboboxCollection.d.ts +2 -0
- package/out/components/combobox/ComboboxCollection.js +18 -0
- package/out/components/combobox/ComboboxContent.d.ts +2 -0
- package/out/components/combobox/ComboboxContent.js +19 -0
- package/out/components/combobox/ComboboxEmpty.d.ts +2 -0
- package/out/components/combobox/ComboboxEmpty.js +19 -0
- package/out/components/combobox/ComboboxGroup.d.ts +2 -0
- package/out/components/combobox/ComboboxGroup.js +19 -0
- package/out/components/combobox/ComboboxInput.d.ts +5 -0
- package/out/components/combobox/ComboboxInput.js +25 -0
- package/out/components/combobox/ComboboxItem.d.ts +2 -0
- package/out/components/combobox/ComboboxItem.js +20 -0
- package/out/components/combobox/ComboboxLabel.d.ts +2 -0
- package/out/components/combobox/ComboboxLabel.js +19 -0
- package/out/components/combobox/ComboboxList.d.ts +2 -0
- package/out/components/combobox/ComboboxList.js +19 -0
- package/out/components/combobox/ComboboxSeparator.d.ts +2 -0
- package/out/components/combobox/ComboboxSeparator.js +19 -0
- package/out/components/combobox/ComboboxTrigger.d.ts +2 -0
- package/out/components/combobox/ComboboxTrigger.js +20 -0
- package/out/components/combobox/ComboboxValue.d.ts +2 -0
- package/out/components/combobox/ComboboxValue.js +18 -0
- package/out/components/combobox/useComboboxAnchor.d.ts +1 -0
- package/out/components/combobox/useComboboxAnchor.js +4 -0
- package/out/components/context-menu/ContextMenu.d.ts +2 -0
- package/out/components/context-menu/ContextMenu.js +18 -0
- package/out/components/context-menu/ContextMenuCheckboxItem.d.ts +2 -0
- package/out/components/context-menu/ContextMenuCheckboxItem.js +20 -0
- package/out/components/context-menu/ContextMenuContent.d.ts +2 -0
- package/out/components/context-menu/ContextMenuContent.js +19 -0
- package/out/components/context-menu/ContextMenuGroup.d.ts +2 -0
- package/out/components/context-menu/ContextMenuGroup.js +18 -0
- package/out/components/context-menu/ContextMenuItem.d.ts +5 -0
- package/out/components/context-menu/ContextMenuItem.js +19 -0
- package/out/components/context-menu/ContextMenuLabel.d.ts +4 -0
- package/out/components/context-menu/ContextMenuLabel.js +19 -0
- package/out/components/context-menu/ContextMenuPortal.d.ts +2 -0
- package/out/components/context-menu/ContextMenuPortal.js +18 -0
- package/out/components/context-menu/ContextMenuRadioGroup.d.ts +2 -0
- package/out/components/context-menu/ContextMenuRadioGroup.js +18 -0
- package/out/components/context-menu/ContextMenuRadioItem.d.ts +2 -0
- package/out/components/context-menu/ContextMenuRadioItem.js +20 -0
- package/out/components/context-menu/ContextMenuSeparator.d.ts +2 -0
- package/out/components/context-menu/ContextMenuSeparator.js +19 -0
- package/out/components/context-menu/ContextMenuShortcut.d.ts +2 -0
- package/out/components/context-menu/ContextMenuShortcut.js +18 -0
- package/out/components/context-menu/ContextMenuSub.d.ts +2 -0
- package/out/components/context-menu/ContextMenuSub.js +18 -0
- package/out/components/context-menu/ContextMenuSubContent.d.ts +3 -0
- package/out/components/context-menu/ContextMenuSubContent.js +18 -0
- package/out/components/context-menu/ContextMenuSubTrigger.d.ts +4 -0
- package/out/components/context-menu/ContextMenuSubTrigger.js +20 -0
- package/out/components/context-menu/ContextMenuTrigger.d.ts +2 -0
- package/out/components/context-menu/ContextMenuTrigger.js +19 -0
- package/out/components/copy-input/CopyInput.d.ts +3 -0
- package/out/components/copy-input/CopyInput.js +32 -0
- package/out/components/date-picker/DatePicker.d.ts +5 -0
- package/out/components/date-picker/DatePicker.js +57 -0
- package/out/components/dropdown-menu/DropdownMenu.d.ts +2 -0
- package/out/components/dropdown-menu/DropdownMenu.js +18 -0
- package/out/components/dropdown-menu/DropdownMenuCheckboxItem.d.ts +2 -0
- package/out/components/dropdown-menu/DropdownMenuCheckboxItem.js +20 -0
- package/out/components/dropdown-menu/DropdownMenuContent.d.ts +2 -0
- package/out/components/dropdown-menu/DropdownMenuContent.js +19 -0
- package/out/components/dropdown-menu/DropdownMenuGroup.d.ts +2 -0
- package/out/components/dropdown-menu/DropdownMenuGroup.js +18 -0
- package/out/components/dropdown-menu/DropdownMenuItem.d.ts +5 -0
- package/out/components/dropdown-menu/DropdownMenuItem.js +19 -0
- package/out/components/dropdown-menu/DropdownMenuLabel.d.ts +4 -0
- package/out/components/dropdown-menu/DropdownMenuLabel.js +19 -0
- package/out/components/dropdown-menu/DropdownMenuPortal.d.ts +2 -0
- package/out/components/dropdown-menu/DropdownMenuPortal.js +18 -0
- package/out/components/dropdown-menu/DropdownMenuRadioGroup.d.ts +2 -0
- package/out/components/dropdown-menu/DropdownMenuRadioGroup.js +18 -0
- package/out/components/dropdown-menu/DropdownMenuRadioItem.d.ts +2 -0
- package/out/components/dropdown-menu/DropdownMenuRadioItem.js +20 -0
- package/out/components/dropdown-menu/DropdownMenuSeparator.d.ts +2 -0
- package/out/components/dropdown-menu/DropdownMenuSeparator.js +19 -0
- package/out/components/dropdown-menu/DropdownMenuShortcut.d.ts +2 -0
- package/out/components/dropdown-menu/DropdownMenuShortcut.js +18 -0
- package/out/components/dropdown-menu/DropdownMenuSub.d.ts +2 -0
- package/out/components/dropdown-menu/DropdownMenuSub.js +18 -0
- package/out/components/dropdown-menu/DropdownMenuSubContent.d.ts +3 -0
- package/out/components/dropdown-menu/DropdownMenuSubContent.js +19 -0
- package/out/components/dropdown-menu/DropdownMenuSubTrigger.d.ts +4 -0
- package/out/components/dropdown-menu/DropdownMenuSubTrigger.js +20 -0
- package/out/components/dropdown-menu/DropdownMenuTrigger.d.ts +2 -0
- package/out/components/dropdown-menu/DropdownMenuTrigger.js +18 -0
- package/out/components/error/Error.d.ts +4 -0
- package/out/components/error/Error.js +15 -0
- package/out/components/field/Field.d.ts +4 -0
- package/out/components/field/Field.js +19 -0
- package/out/components/field/FieldContent.d.ts +2 -0
- package/out/components/field/FieldContent.js +18 -0
- package/out/components/field/FieldDescription.d.ts +2 -0
- package/out/components/field/FieldDescription.js +18 -0
- package/out/components/field/FieldError.d.ts +6 -0
- package/out/components/field/FieldError.js +36 -0
- package/out/components/field/FieldGroup.d.ts +2 -0
- package/out/components/field/FieldGroup.js +18 -0
- package/out/components/field/FieldLabel.d.ts +3 -0
- package/out/components/field/FieldLabel.js +19 -0
- package/out/components/field/FieldLegend.d.ts +4 -0
- package/out/components/field/FieldLegend.js +18 -0
- package/out/components/field/FieldSeparator.d.ts +4 -0
- package/out/components/field/FieldSeparator.js +19 -0
- package/out/components/field/FieldSet.d.ts +2 -0
- package/out/components/field/FieldSet.js +18 -0
- package/out/components/field/FieldTitle.d.ts +2 -0
- package/out/components/field/FieldTitle.js +18 -0
- package/out/components/field/fieldVariants.d.ts +4 -0
- package/out/components/field/fieldVariants.js +14 -0
- package/out/components/file-dropzone/FileDropzone.d.ts +7 -0
- package/out/components/file-dropzone/FileDropzone.js +40 -0
- package/out/components/input/Input.d.ts +2 -0
- package/out/components/input/Input.js +18 -0
- package/out/components/input-group/InputGroup.d.ts +2 -0
- package/out/components/input-group/InputGroup.js +18 -0
- package/out/components/input-group/InputGroupAddon.d.ts +4 -0
- package/out/components/input-group/InputGroupAddon.js +25 -0
- package/out/components/input-group/InputGroupButton.d.ts +7 -0
- package/out/components/input-group/InputGroupButton.js +20 -0
- package/out/components/input-group/InputGroupInput.d.ts +2 -0
- package/out/components/input-group/InputGroupInput.js +19 -0
- package/out/components/input-group/InputGroupText.d.ts +2 -0
- package/out/components/input-group/InputGroupText.js +18 -0
- package/out/components/input-group/InputGroupTextarea.d.ts +2 -0
- package/out/components/input-group/InputGroupTextarea.js +19 -0
- package/out/components/input-group/inputGroupAddonVariants.d.ts +4 -0
- package/out/components/input-group/inputGroupAddonVariants.js +15 -0
- package/out/components/input-group/inputGroupButtonVariants.d.ts +4 -0
- package/out/components/input-group/inputGroupButtonVariants.js +15 -0
- package/out/components/item/Item.d.ts +5 -0
- package/out/components/item/Item.js +31 -0
- package/out/components/item/ItemActions.d.ts +3 -0
- package/out/components/item/ItemActions.js +18 -0
- package/out/components/item/ItemContent.d.ts +3 -0
- package/out/components/item/ItemContent.js +18 -0
- package/out/components/item/ItemDescription.d.ts +3 -0
- package/out/components/item/ItemDescription.js +18 -0
- package/out/components/item/ItemFooter.d.ts +3 -0
- package/out/components/item/ItemFooter.js +18 -0
- package/out/components/item/ItemGroup.d.ts +3 -0
- package/out/components/item/ItemGroup.js +18 -0
- package/out/components/item/ItemHeader.d.ts +3 -0
- package/out/components/item/ItemHeader.js +18 -0
- package/out/components/item/ItemMedia.d.ts +5 -0
- package/out/components/item/ItemMedia.js +19 -0
- package/out/components/item/ItemSeparator.d.ts +4 -0
- package/out/components/item/ItemSeparator.js +19 -0
- package/out/components/item/ItemTitle.d.ts +3 -0
- package/out/components/item/ItemTitle.js +18 -0
- package/out/components/item/itemMediaVariants.d.ts +4 -0
- package/out/components/item/itemMediaVariants.js +14 -0
- package/out/components/item/itemVariants.d.ts +5 -0
- package/out/components/item/itemVariants.js +20 -0
- package/out/components/label/Label.d.ts +2 -0
- package/out/components/label/Label.js +18 -0
- package/out/components/link-input/LinkInput.d.ts +3 -0
- package/out/components/link-input/LinkInput.js +41 -0
- package/out/components/popover/Popover.d.ts +2 -0
- package/out/components/popover/Popover.js +18 -0
- package/out/components/popover/PopoverContent.d.ts +2 -0
- package/out/components/popover/PopoverContent.js +19 -0
- package/out/components/popover/PopoverDescription.d.ts +2 -0
- package/out/components/popover/PopoverDescription.js +19 -0
- package/out/components/popover/PopoverHeader.d.ts +2 -0
- package/out/components/popover/PopoverHeader.js +17 -0
- package/out/components/popover/PopoverTitle.d.ts +2 -0
- package/out/components/popover/PopoverTitle.js +19 -0
- package/out/components/popover/PopoverTrigger.d.ts +2 -0
- package/out/components/popover/PopoverTrigger.js +18 -0
- package/out/components/select/Select.d.ts +3 -0
- package/out/components/select/Select.js +4 -0
- package/out/components/select/SelectContent.d.ts +2 -0
- package/out/components/select/SelectContent.js +21 -0
- package/out/components/select/SelectGroup.d.ts +2 -0
- package/out/components/select/SelectGroup.js +19 -0
- package/out/components/select/SelectItem.d.ts +2 -0
- package/out/components/select/SelectItem.js +20 -0
- package/out/components/select/SelectLabel.d.ts +2 -0
- package/out/components/select/SelectLabel.js +19 -0
- package/out/components/select/SelectScrollDownButton.d.ts +3 -0
- package/out/components/select/SelectScrollDownButton.js +20 -0
- package/out/components/select/SelectScrollUpButton.d.ts +3 -0
- package/out/components/select/SelectScrollUpButton.js +20 -0
- package/out/components/select/SelectSeparator.d.ts +2 -0
- package/out/components/select/SelectSeparator.js +19 -0
- package/out/components/select/SelectTrigger.d.ts +4 -0
- package/out/components/select/SelectTrigger.js +20 -0
- package/out/components/select/SelectValue.d.ts +2 -0
- package/out/components/select/SelectValue.js +19 -0
- package/out/components/separator/Separator.d.ts +2 -0
- package/out/components/separator/Separator.js +19 -0
- package/out/components/skeleton/Skeleton.d.ts +2 -0
- package/out/components/skeleton/Skeleton.js +17 -0
- package/out/components/sonner/Toaster.d.ts +2 -0
- package/out/components/sonner/Toaster.js +37 -0
- package/out/components/sortable/Sortable.d.ts +48 -0
- package/out/components/sortable/Sortable.js +263 -0
- package/out/components/switch/Switch.d.ts +4 -0
- package/out/components/switch/Switch.js +19 -0
- package/out/components/table/Table.d.ts +2 -0
- package/out/components/table/Table.js +18 -0
- package/out/components/table/TableBody.d.ts +2 -0
- package/out/components/table/TableBody.js +18 -0
- package/out/components/table/TableCaption.d.ts +2 -0
- package/out/components/table/TableCaption.js +18 -0
- package/out/components/table/TableCell.d.ts +2 -0
- package/out/components/table/TableCell.js +18 -0
- package/out/components/table/TableFooter.d.ts +2 -0
- package/out/components/table/TableFooter.js +18 -0
- package/out/components/table/TableHead.d.ts +2 -0
- package/out/components/table/TableHead.js +18 -0
- package/out/components/table/TableHeader.d.ts +2 -0
- package/out/components/table/TableHeader.js +18 -0
- package/out/components/table/TableRow.d.ts +2 -0
- package/out/components/table/TableRow.js +18 -0
- package/out/components/textarea/Textarea.d.ts +2 -0
- package/out/components/textarea/Textarea.js +17 -0
- package/out/components/toggle/Toggle.d.ts +4 -0
- package/out/components/toggle/Toggle.js +20 -0
- package/out/components/toggle/toggleVariants.d.ts +4 -0
- package/out/components/toggle/toggleVariants.js +18 -0
- package/out/components/tooltip/Tooltip.d.ts +3 -0
- package/out/components/tooltip/Tooltip.js +20 -0
- package/out/components/tooltip/TooltipContent.d.ts +3 -0
- package/out/components/tooltip/TooltipContent.js +20 -0
- package/out/components/tooltip/TooltipProvider.d.ts +3 -0
- package/out/components/tooltip/TooltipProvider.js +19 -0
- package/out/components/tooltip/TooltipTrigger.d.ts +3 -0
- package/out/components/tooltip/TooltipTrigger.js +19 -0
- package/out/components/typography/TypographyA.d.ts +2 -0
- package/out/components/typography/TypographyA.js +20 -0
- package/out/components/typography/TypographyBlockquote.d.ts +2 -0
- package/out/components/typography/TypographyBlockquote.js +20 -0
- package/out/components/typography/TypographyFigure.d.ts +2 -0
- package/out/components/typography/TypographyFigure.js +20 -0
- package/out/components/typography/TypographyFigureCaption.d.ts +2 -0
- package/out/components/typography/TypographyFigureCaption.js +20 -0
- package/out/components/typography/TypographyH1.d.ts +2 -0
- package/out/components/typography/TypographyH1.js +20 -0
- package/out/components/typography/TypographyH2.d.ts +2 -0
- package/out/components/typography/TypographyH2.js +20 -0
- package/out/components/typography/TypographyH3.d.ts +2 -0
- package/out/components/typography/TypographyH3.js +20 -0
- package/out/components/typography/TypographyH4.d.ts +2 -0
- package/out/components/typography/TypographyH4.js +20 -0
- package/out/components/typography/TypographyH5.d.ts +2 -0
- package/out/components/typography/TypographyH5.js +20 -0
- package/out/components/typography/TypographyH6.d.ts +2 -0
- package/out/components/typography/TypographyH6.js +20 -0
- package/out/components/typography/TypographyHr.d.ts +2 -0
- package/out/components/typography/TypographyHr.js +19 -0
- package/out/components/typography/TypographyImage.d.ts +2 -0
- package/out/components/typography/TypographyImage.js +21 -0
- package/out/components/typography/TypographyImg.d.ts +23 -0
- package/out/components/typography/TypographyImg.js +21 -0
- package/out/components/typography/TypographyInlineCode.d.ts +2 -0
- package/out/components/typography/TypographyInlineCode.js +25 -0
- package/out/components/typography/TypographyLi.d.ts +2 -0
- package/out/components/typography/TypographyLi.js +20 -0
- package/out/components/typography/TypographyLink.d.ts +4 -0
- package/out/components/typography/TypographyLink.js +21 -0
- package/out/components/typography/TypographyList.d.ts +2 -0
- package/out/components/typography/TypographyList.js +20 -0
- package/out/components/typography/TypographyOl.d.ts +2 -0
- package/out/components/typography/TypographyOl.js +20 -0
- package/out/components/typography/TypographyP.d.ts +2 -0
- package/out/components/typography/TypographyP.js +20 -0
- package/out/components/typography/TypographyPre.d.ts +2 -0
- package/out/components/typography/TypographyPre.js +20 -0
- package/out/components/typography/TypographyStrong.d.ts +3 -0
- package/out/components/typography/TypographyStrong.js +20 -0
- package/out/components/typography/TypographyTable.d.ts +2 -0
- package/out/components/typography/TypographyTable.js +20 -0
- package/out/components/typography/TypographyTd.d.ts +2 -0
- package/out/components/typography/TypographyTd.js +20 -0
- package/out/components/typography/TypographyTh.d.ts +2 -0
- package/out/components/typography/TypographyTh.js +20 -0
- package/out/components/typography/TypographyTr.d.ts +2 -0
- package/out/components/typography/TypographyTr.js +20 -0
- package/out/index.d.ts +176 -0
- package/out/index.js +211 -0
- package/package.json +77 -0
- package/tailwind.css +144 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { Select as SelectPrimitive } from "@base-ui/react/select";
|
|
15
|
+
import cn from "../../cn";
|
|
16
|
+
import SelectScrollDownButton from "./SelectScrollDownButton";
|
|
17
|
+
import SelectScrollUpButton from "./SelectScrollUpButton";
|
|
18
|
+
export default function SelectContent(_a) {
|
|
19
|
+
var { className, children, side = "bottom", sideOffset = 4, align = "center", alignOffset = 0, alignItemWithTrigger = true } = _a, props = __rest(_a, ["className", "children", "side", "sideOffset", "align", "alignOffset", "alignItemWithTrigger"]);
|
|
20
|
+
return (_jsx(SelectPrimitive.Portal, { children: _jsx(SelectPrimitive.Positioner, { side: side, sideOffset: sideOffset, align: align, alignOffset: alignOffset, alignItemWithTrigger: alignItemWithTrigger, className: "isolate z-50", children: _jsxs(SelectPrimitive.Popup, Object.assign({ "data-slot": "select-content", className: cn("relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className) }, props, { children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.List, { children: children }), _jsx(SelectScrollDownButton, {})] })) }) }));
|
|
21
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { Select as SelectPrimitive } from "@base-ui/react/select";
|
|
15
|
+
import cn from "../../cn";
|
|
16
|
+
export default function SelectGroup(_a) {
|
|
17
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
18
|
+
return _jsx(SelectPrimitive.Group, Object.assign({ "data-slot": "select-group", className: cn("scroll-my-1 p-1", className) }, props));
|
|
19
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { Select as SelectPrimitive } from "@base-ui/react/select";
|
|
15
|
+
import { IconCheck } from "@tabler/icons-react";
|
|
16
|
+
import cn from "../../cn";
|
|
17
|
+
export default function SelectItem(_a) {
|
|
18
|
+
var { className, children } = _a, props = __rest(_a, ["className", "children"]);
|
|
19
|
+
return (_jsxs(SelectPrimitive.Item, Object.assign({ "data-slot": "select-item", className: cn("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className) }, props, { children: [_jsx(SelectPrimitive.ItemText, { className: "flex flex-1 shrink-0 gap-2 whitespace-nowrap", children: children }), _jsx(SelectPrimitive.ItemIndicator, { render: _jsx("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center" }), children: _jsx(IconCheck, { className: "pointer-events-none" }) })] })));
|
|
20
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { Select as SelectPrimitive } from "@base-ui/react/select";
|
|
15
|
+
import cn from "../../cn";
|
|
16
|
+
export default function SelectLabel(_a) {
|
|
17
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
18
|
+
return (_jsx(SelectPrimitive.GroupLabel, Object.assign({ "data-slot": "select-label", className: cn("px-2 py-1.5 text-xs text-muted-foreground", className) }, props)));
|
|
19
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Select as SelectPrimitive } from "@base-ui/react/select";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
export default function SelectScrollDownButton({ className, ...props }: ComponentProps<typeof SelectPrimitive.ScrollDownArrow>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { Select as SelectPrimitive } from "@base-ui/react/select";
|
|
15
|
+
import { IconChevronDown } from "@tabler/icons-react";
|
|
16
|
+
import cn from "../../cn";
|
|
17
|
+
export default function SelectScrollDownButton(_a) {
|
|
18
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
19
|
+
return (_jsx(SelectPrimitive.ScrollDownArrow, Object.assign({ "data-slot": "select-scroll-down-button", className: cn("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", className) }, props, { children: _jsx(IconChevronDown, {}) })));
|
|
20
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Select as SelectPrimitive } from "@base-ui/react/select";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
export default function SelectScrollUpButton({ className, ...props }: ComponentProps<typeof SelectPrimitive.ScrollUpArrow>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { Select as SelectPrimitive } from "@base-ui/react/select";
|
|
15
|
+
import { IconChevronUp } from "@tabler/icons-react";
|
|
16
|
+
import cn from "../../cn";
|
|
17
|
+
export default function SelectScrollUpButton(_a) {
|
|
18
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
19
|
+
return (_jsx(SelectPrimitive.ScrollUpArrow, Object.assign({ "data-slot": "select-scroll-up-button", className: cn("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", className) }, props, { children: _jsx(IconChevronUp, {}) })));
|
|
20
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { Select as SelectPrimitive } from "@base-ui/react/select";
|
|
15
|
+
import cn from "../../cn";
|
|
16
|
+
export default function SelectSeparator(_a) {
|
|
17
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
18
|
+
return (_jsx(SelectPrimitive.Separator, Object.assign({ "data-slot": "select-separator", className: cn("pointer-events-none -mx-1 my-1 h-px bg-border", className) }, props)));
|
|
19
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { Select as SelectPrimitive } from "@base-ui/react/select";
|
|
15
|
+
import { IconSelector } from "@tabler/icons-react";
|
|
16
|
+
import cn from "../../cn";
|
|
17
|
+
export default function SelectTrigger(_a) {
|
|
18
|
+
var { className, size = "default", children } = _a, props = __rest(_a, ["className", "size", "children"]);
|
|
19
|
+
return (_jsxs(SelectPrimitive.Trigger, Object.assign({ "data-slot": "select-trigger", "data-size": size, className: cn("flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-[3px] aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className) }, props, { children: [children, _jsx(SelectPrimitive.Icon, { render: _jsx(IconSelector, { className: "pointer-events-none size-4 text-muted-foreground" }) })] })));
|
|
20
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { Select as SelectPrimitive } from "@base-ui/react/select";
|
|
15
|
+
import cn from "../../cn";
|
|
16
|
+
export default function SelectValue(_a) {
|
|
17
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
18
|
+
return (_jsx(SelectPrimitive.Value, Object.assign({ "data-slot": "select-value", className: cn("flex flex-1 text-left ", className) }, props)));
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";
|
|
15
|
+
import cn from "../../cn";
|
|
16
|
+
export default function Separator(_a) {
|
|
17
|
+
var { className, orientation = "horizontal" } = _a, props = __rest(_a, ["className", "orientation"]);
|
|
18
|
+
return (_jsx(SeparatorPrimitive, Object.assign({ "data-slot": "separator", orientation: orientation, className: cn("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch", className) }, props)));
|
|
19
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import cn from "../../cn";
|
|
14
|
+
export default function Skeleton(_a) {
|
|
15
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
16
|
+
return _jsx("div", Object.assign({ "data-slot": "skeleton", className: cn("animate-pulse rounded-md bg-muted", className) }, props));
|
|
17
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* eslint-disable better-tailwindcss/no-unregistered-classes */
|
|
2
|
+
"use client";
|
|
3
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
4
|
+
var t = {};
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
8
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
9
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
10
|
+
t[p[i]] = s[p[i]];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
import { IconCircleCheck, IconInfoCircle, IconAlertTriangle, IconAlertOctagon, IconLoader } from "@tabler/icons-react";
|
|
16
|
+
import { useTheme } from "next-themes";
|
|
17
|
+
import { Toaster as Sonner } from "sonner";
|
|
18
|
+
export default function Toaster(_a) {
|
|
19
|
+
var props = __rest(_a, []);
|
|
20
|
+
const { theme = "system" } = useTheme();
|
|
21
|
+
return (_jsx(Sonner, Object.assign({ theme: theme, className: "toaster group", icons: {
|
|
22
|
+
success: _jsx(IconCircleCheck, { className: "size-4" }),
|
|
23
|
+
info: _jsx(IconInfoCircle, { className: "size-4" }),
|
|
24
|
+
warning: _jsx(IconAlertTriangle, { className: "size-4" }),
|
|
25
|
+
error: _jsx(IconAlertOctagon, { className: "size-4" }),
|
|
26
|
+
loading: _jsx(IconLoader, { className: "size-4 animate-spin" }),
|
|
27
|
+
}, style: {
|
|
28
|
+
"--normal-bg": "var(--popover)",
|
|
29
|
+
"--normal-text": "var(--popover-foreground)",
|
|
30
|
+
"--normal-border": "var(--border)",
|
|
31
|
+
"--border-radius": "var(--radius)",
|
|
32
|
+
}, toastOptions: {
|
|
33
|
+
classNames: {
|
|
34
|
+
toast: "cn-toast",
|
|
35
|
+
},
|
|
36
|
+
} }, props)));
|
|
37
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type DndContextProps, type DragEndEvent, DragOverlay, type UniqueIdentifier } from "@dnd-kit/core";
|
|
2
|
+
import { type SortableContextProps } from "@dnd-kit/sortable";
|
|
3
|
+
import { type ComponentProps, type ComponentPropsWithRef, type ElementType, type ReactElement, type ReactNode } from "react";
|
|
4
|
+
interface GetItemValue<T> {
|
|
5
|
+
/**
|
|
6
|
+
* Callback that returns a unique identifier for each sortable item. Required for array of objects.
|
|
7
|
+
* @example getItemValue={(item) => item.id}
|
|
8
|
+
*/
|
|
9
|
+
getItemValue: (item: T) => UniqueIdentifier;
|
|
10
|
+
}
|
|
11
|
+
type SortableProps<T> = DndContextProps & (T extends object ? GetItemValue<T> : Partial<GetItemValue<T>>) & {
|
|
12
|
+
value: T[];
|
|
13
|
+
onValueChange?: (items: T[]) => void;
|
|
14
|
+
onMove?: (event: DragEndEvent & {
|
|
15
|
+
activeIndex: number;
|
|
16
|
+
overIndex: number;
|
|
17
|
+
}) => void;
|
|
18
|
+
strategy?: SortableContextProps["strategy"];
|
|
19
|
+
orientation?: "vertical" | "horizontal" | "mixed";
|
|
20
|
+
flatCursor?: boolean;
|
|
21
|
+
};
|
|
22
|
+
declare function Sortable<T>(props: SortableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
interface SortableContentProps<T extends ElementType = "div"> {
|
|
24
|
+
strategy?: SortableContextProps["strategy"];
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
render?: ReactElement<T>;
|
|
27
|
+
withoutSlot?: boolean;
|
|
28
|
+
}
|
|
29
|
+
declare function SortableContent<T extends ElementType = "div">(props: SortableContentProps<T> & ComponentPropsWithRef<T>): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
interface SortableItemProps<T extends ElementType = "div"> {
|
|
31
|
+
value: UniqueIdentifier;
|
|
32
|
+
asHandle?: boolean;
|
|
33
|
+
render?: ReactElement<T>;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
}
|
|
36
|
+
declare function SortableItem<T extends ElementType = "div">(props: SortableItemProps<T> & ComponentPropsWithRef<T>): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
interface SortableItemHandleProps<T extends ElementType = "button"> {
|
|
38
|
+
render?: ReactElement<T>;
|
|
39
|
+
}
|
|
40
|
+
declare function SortableItemHandle<T extends ElementType = "button">(props: SortableItemHandleProps<T> & ComponentPropsWithRef<T>): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
interface SortableOverlayProps extends Omit<ComponentProps<typeof DragOverlay>, "children"> {
|
|
42
|
+
container?: Element | DocumentFragment | null;
|
|
43
|
+
children?: ((params: {
|
|
44
|
+
value: UniqueIdentifier;
|
|
45
|
+
}) => ReactNode) | ReactNode;
|
|
46
|
+
}
|
|
47
|
+
declare function SortableOverlay(props: SortableOverlayProps): import("react").ReactPortal | null;
|
|
48
|
+
export { Sortable, SortableContent, SortableItem, SortableItemHandle, SortableOverlay, type SortableProps, };
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { closestCenter, closestCorners, defaultDropAnimationSideEffects, DndContext, DragOverlay, KeyboardSensor, MouseSensor, TouchSensor, useSensor, useSensors, } from "@dnd-kit/core";
|
|
15
|
+
import { restrictToHorizontalAxis, restrictToParentElement, restrictToVerticalAxis } from "@dnd-kit/modifiers";
|
|
16
|
+
import { arrayMove, horizontalListSortingStrategy, SortableContext, sortableKeyboardCoordinates, useSortable, verticalListSortingStrategy, } from "@dnd-kit/sortable";
|
|
17
|
+
import { CSS } from "@dnd-kit/utilities";
|
|
18
|
+
import { useComposedRefs } from "motion/react";
|
|
19
|
+
import { createContext, useCallback, cloneElement, useContext, useId, useLayoutEffect, useMemo, useState, } from "react";
|
|
20
|
+
import * as ReactDOM from "react-dom";
|
|
21
|
+
import cn from "../../cn";
|
|
22
|
+
const orientationConfig = {
|
|
23
|
+
vertical: {
|
|
24
|
+
modifiers: [restrictToVerticalAxis, restrictToParentElement],
|
|
25
|
+
strategy: verticalListSortingStrategy,
|
|
26
|
+
collisionDetection: closestCenter,
|
|
27
|
+
},
|
|
28
|
+
horizontal: {
|
|
29
|
+
modifiers: [restrictToHorizontalAxis, restrictToParentElement],
|
|
30
|
+
strategy: horizontalListSortingStrategy,
|
|
31
|
+
collisionDetection: closestCenter,
|
|
32
|
+
},
|
|
33
|
+
mixed: {
|
|
34
|
+
modifiers: [restrictToParentElement],
|
|
35
|
+
strategy: undefined,
|
|
36
|
+
collisionDetection: closestCorners,
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
const ROOT_NAME = "Sortable";
|
|
40
|
+
const CONTENT_NAME = "SortableContent";
|
|
41
|
+
const ITEM_NAME = "SortableItem";
|
|
42
|
+
const ITEM_HANDLE_NAME = "SortableItemHandle";
|
|
43
|
+
const OVERLAY_NAME = "SortableOverlay";
|
|
44
|
+
const SortableRootContext = createContext(null);
|
|
45
|
+
function useSortableContext(consumerName) {
|
|
46
|
+
const context = useContext(SortableRootContext);
|
|
47
|
+
if (!context) {
|
|
48
|
+
throw new Error(`\`${consumerName}\` must be used within \`${ROOT_NAME}\``);
|
|
49
|
+
}
|
|
50
|
+
return context;
|
|
51
|
+
}
|
|
52
|
+
function Sortable(props) {
|
|
53
|
+
const { value, onValueChange, collisionDetection, modifiers, strategy, onMove, orientation = "vertical", flatCursor = false, getItemValue: getItemValueProp, accessibility, onDragStart: onDragStartProp, onDragEnd: onDragEndProp, onDragCancel: onDragCancelProp } = props, sortableProps = __rest(props, ["value", "onValueChange", "collisionDetection", "modifiers", "strategy", "onMove", "orientation", "flatCursor", "getItemValue", "accessibility", "onDragStart", "onDragEnd", "onDragCancel"]);
|
|
54
|
+
const id = useId();
|
|
55
|
+
const [activeId, setActiveId] = useState(null);
|
|
56
|
+
const sensors = useSensors(useSensor(MouseSensor), useSensor(TouchSensor), useSensor(KeyboardSensor, {
|
|
57
|
+
coordinateGetter: sortableKeyboardCoordinates,
|
|
58
|
+
}));
|
|
59
|
+
const config = useMemo(() => orientationConfig[orientation], [orientation]);
|
|
60
|
+
const getItemValue = useCallback((item) => {
|
|
61
|
+
if (typeof item === "object" && !getItemValueProp) {
|
|
62
|
+
throw new Error("`getItemValue` is required when using array of objects");
|
|
63
|
+
}
|
|
64
|
+
return getItemValueProp ? getItemValueProp(item) : item;
|
|
65
|
+
}, [getItemValueProp]);
|
|
66
|
+
const items = useMemo(() => value.map((item) => getItemValue(item)), [value, getItemValue]);
|
|
67
|
+
const onDragStart = useCallback((event) => {
|
|
68
|
+
onDragStartProp === null || onDragStartProp === void 0 ? void 0 : onDragStartProp(event);
|
|
69
|
+
if (event.activatorEvent.defaultPrevented) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
setActiveId(event.active.id);
|
|
73
|
+
}, [onDragStartProp]);
|
|
74
|
+
const onDragEnd = useCallback((event) => {
|
|
75
|
+
onDragEndProp === null || onDragEndProp === void 0 ? void 0 : onDragEndProp(event);
|
|
76
|
+
if (event.activatorEvent.defaultPrevented) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const { active, over } = event;
|
|
80
|
+
if (over && active.id !== (over === null || over === void 0 ? void 0 : over.id)) {
|
|
81
|
+
const activeIndex = value.findIndex((item) => getItemValue(item) === active.id);
|
|
82
|
+
const overIndex = value.findIndex((item) => getItemValue(item) === over.id);
|
|
83
|
+
if (onMove) {
|
|
84
|
+
onMove(Object.assign(Object.assign({}, event), { activeIndex, overIndex }));
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(arrayMove(value, activeIndex, overIndex));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
setActiveId(null);
|
|
91
|
+
}, [value, onValueChange, onMove, getItemValue, onDragEndProp]);
|
|
92
|
+
const onDragCancel = useCallback((event) => {
|
|
93
|
+
onDragCancelProp === null || onDragCancelProp === void 0 ? void 0 : onDragCancelProp(event);
|
|
94
|
+
if (event.activatorEvent.defaultPrevented) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
setActiveId(null);
|
|
98
|
+
}, [onDragCancelProp]);
|
|
99
|
+
const announcements = useMemo(() => ({
|
|
100
|
+
onDragStart({ active }) {
|
|
101
|
+
var _a;
|
|
102
|
+
const activeValue = active.id.toString();
|
|
103
|
+
return `Grabbed sortable item "${activeValue}". Current position is ${((_a = active.data.current) === null || _a === void 0 ? void 0 : _a.sortable.index) + 1} of ${value.length}. Use arrow keys to move, space to drop.`;
|
|
104
|
+
},
|
|
105
|
+
onDragOver({ active, over }) {
|
|
106
|
+
var _a, _b, _c, _d;
|
|
107
|
+
if (over) {
|
|
108
|
+
const overIndex = (_b = (_a = over.data.current) === null || _a === void 0 ? void 0 : _a.sortable.index) !== null && _b !== void 0 ? _b : 0;
|
|
109
|
+
const activeIndex = (_d = (_c = active.data.current) === null || _c === void 0 ? void 0 : _c.sortable.index) !== null && _d !== void 0 ? _d : 0;
|
|
110
|
+
const moveDirection = overIndex > activeIndex ? "down" : "up";
|
|
111
|
+
const activeValue = active.id.toString();
|
|
112
|
+
return `Sortable item "${activeValue}" moved ${moveDirection} to position ${overIndex + 1} of ${value.length}.`;
|
|
113
|
+
}
|
|
114
|
+
return "Sortable item is no longer over a droppable area. Press escape to cancel.";
|
|
115
|
+
},
|
|
116
|
+
onDragEnd({ active, over }) {
|
|
117
|
+
var _a, _b;
|
|
118
|
+
const activeValue = active.id.toString();
|
|
119
|
+
if (over) {
|
|
120
|
+
const overIndex = (_b = (_a = over.data.current) === null || _a === void 0 ? void 0 : _a.sortable.index) !== null && _b !== void 0 ? _b : 0;
|
|
121
|
+
return `Sortable item "${activeValue}" dropped at position ${overIndex + 1} of ${value.length}.`;
|
|
122
|
+
}
|
|
123
|
+
return `Sortable item "${activeValue}" dropped. No changes were made.`;
|
|
124
|
+
},
|
|
125
|
+
onDragCancel({ active }) {
|
|
126
|
+
var _a, _b;
|
|
127
|
+
const activeIndex = (_b = (_a = active.data.current) === null || _a === void 0 ? void 0 : _a.sortable.index) !== null && _b !== void 0 ? _b : 0;
|
|
128
|
+
const activeValue = active.id.toString();
|
|
129
|
+
return `Sorting cancelled. Sortable item "${activeValue}" returned to position ${activeIndex + 1} of ${value.length}.`;
|
|
130
|
+
},
|
|
131
|
+
onDragMove({ active, over }) {
|
|
132
|
+
var _a, _b, _c, _d;
|
|
133
|
+
if (over) {
|
|
134
|
+
const overIndex = (_b = (_a = over.data.current) === null || _a === void 0 ? void 0 : _a.sortable.index) !== null && _b !== void 0 ? _b : 0;
|
|
135
|
+
const activeIndex = (_d = (_c = active.data.current) === null || _c === void 0 ? void 0 : _c.sortable.index) !== null && _d !== void 0 ? _d : 0;
|
|
136
|
+
const moveDirection = overIndex > activeIndex ? "down" : "up";
|
|
137
|
+
const activeValue = active.id.toString();
|
|
138
|
+
return `Sortable item "${activeValue}" is moving ${moveDirection} to position ${overIndex + 1} of ${value.length}.`;
|
|
139
|
+
}
|
|
140
|
+
return "Sortable item is no longer over a droppable area. Press escape to cancel.";
|
|
141
|
+
},
|
|
142
|
+
}), [value]);
|
|
143
|
+
const screenReaderInstructions = useMemo(() => ({
|
|
144
|
+
draggable: `
|
|
145
|
+
To pick up a sortable item, press space or enter.
|
|
146
|
+
While dragging, use the ${orientation === "vertical" ? "up and down" : orientation === "horizontal" ? "left and right" : "arrow"} keys to move the item.
|
|
147
|
+
Press space or enter again to drop the item in its new position, or press escape to cancel.
|
|
148
|
+
`,
|
|
149
|
+
}), [orientation]);
|
|
150
|
+
const contextValue = useMemo(() => ({
|
|
151
|
+
id,
|
|
152
|
+
items,
|
|
153
|
+
modifiers: modifiers !== null && modifiers !== void 0 ? modifiers : config.modifiers,
|
|
154
|
+
strategy: strategy !== null && strategy !== void 0 ? strategy : config.strategy,
|
|
155
|
+
activeId,
|
|
156
|
+
setActiveId,
|
|
157
|
+
getItemValue,
|
|
158
|
+
flatCursor,
|
|
159
|
+
}), [id, items, modifiers, strategy, config.modifiers, config.strategy, activeId, getItemValue, flatCursor]);
|
|
160
|
+
return (_jsx(SortableRootContext.Provider, { value: contextValue, children: _jsx(DndContext, Object.assign({ collisionDetection: collisionDetection !== null && collisionDetection !== void 0 ? collisionDetection : config.collisionDetection, modifiers: modifiers !== null && modifiers !== void 0 ? modifiers : config.modifiers, sensors: sensors }, sortableProps, { id: id, onDragStart: onDragStart, onDragEnd: onDragEnd, onDragCancel: onDragCancel, accessibility: Object.assign({ announcements,
|
|
161
|
+
screenReaderInstructions }, accessibility) })) }));
|
|
162
|
+
}
|
|
163
|
+
const SortableContentContext = createContext(false);
|
|
164
|
+
function SortableContent(props) {
|
|
165
|
+
const { strategy: strategyProp, render, withoutSlot, children } = props, contentProps = __rest(props, ["strategy", "render", "withoutSlot", "children"]);
|
|
166
|
+
const context = useSortableContext(CONTENT_NAME);
|
|
167
|
+
const element = render ? (cloneElement(render, Object.assign(Object.assign(Object.assign({}, contentProps), render.props), { children, "data-slot": "sortable-content" }))) : (_jsx("div", Object.assign({ "data-slot": "sortable-content" }, contentProps, { children: children })));
|
|
168
|
+
return (_jsx(SortableContentContext.Provider, { value: true, children: _jsx(SortableContext, { items: context.items, strategy: strategyProp !== null && strategyProp !== void 0 ? strategyProp : context.strategy, children: withoutSlot ? children : element }) }));
|
|
169
|
+
}
|
|
170
|
+
const SortableItemContext = createContext(null);
|
|
171
|
+
function useSortableItemContext(consumerName) {
|
|
172
|
+
const context = useContext(SortableItemContext);
|
|
173
|
+
if (!context) {
|
|
174
|
+
throw new Error(`\`${consumerName}\` must be used within \`${ITEM_NAME}\``);
|
|
175
|
+
}
|
|
176
|
+
return context;
|
|
177
|
+
}
|
|
178
|
+
function SortableItem(props) {
|
|
179
|
+
const { value, style, asHandle, render, disabled, className, ref } = props, itemProps = __rest(props, ["value", "style", "asHandle", "render", "disabled", "className", "ref"]);
|
|
180
|
+
const inSortableContent = useContext(SortableContentContext);
|
|
181
|
+
const inSortableOverlay = useContext(SortableOverlayContext);
|
|
182
|
+
if (!inSortableContent && !inSortableOverlay) {
|
|
183
|
+
throw new Error(`\`${ITEM_NAME}\` must be used within \`${CONTENT_NAME}\` or \`${OVERLAY_NAME}\``);
|
|
184
|
+
}
|
|
185
|
+
if (value === "") {
|
|
186
|
+
throw new Error(`\`${ITEM_NAME}\` value cannot be an empty string`);
|
|
187
|
+
}
|
|
188
|
+
const context = useSortableContext(ITEM_NAME);
|
|
189
|
+
const id = useId();
|
|
190
|
+
const { attributes, listeners, setNodeRef, setActivatorNodeRef, transform, transition, isDragging } = useSortable({
|
|
191
|
+
id: value,
|
|
192
|
+
disabled,
|
|
193
|
+
});
|
|
194
|
+
const composedRef = useComposedRefs(ref, (node) => {
|
|
195
|
+
if (disabled) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
setNodeRef(node);
|
|
199
|
+
if (asHandle) {
|
|
200
|
+
setActivatorNodeRef(node);
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
const composedStyle = useMemo(() => (Object.assign({ transform: CSS.Translate.toString(transform), transition }, style)), [transform, transition, style]);
|
|
204
|
+
const itemContext = useMemo(() => ({
|
|
205
|
+
id,
|
|
206
|
+
attributes,
|
|
207
|
+
listeners,
|
|
208
|
+
setActivatorNodeRef,
|
|
209
|
+
isDragging,
|
|
210
|
+
disabled,
|
|
211
|
+
}), [id, attributes, listeners, setActivatorNodeRef, isDragging, disabled]);
|
|
212
|
+
const mergedProps = Object.assign(Object.assign(Object.assign(Object.assign({ id, "data-disabled": disabled, "data-dragging": isDragging ? "" : undefined, "data-slot": "sortable-item" }, itemProps), (asHandle && !disabled ? attributes : {})), (asHandle && !disabled ? listeners : {})), { ref: composedRef, style: composedStyle, className: cn("focus-visible:ring-1 focus-visible:ring-neutral-950 focus-visible:ring-offset-1 focus-visible:outline-hidden dark:focus-visible:ring-neutral-300", {
|
|
213
|
+
"touch-none select-none": asHandle,
|
|
214
|
+
"cursor-default": context.flatCursor,
|
|
215
|
+
"data-dragging:cursor-grabbing": !context.flatCursor,
|
|
216
|
+
"cursor-grab": !isDragging && asHandle && !context.flatCursor,
|
|
217
|
+
"opacity-50": isDragging,
|
|
218
|
+
"pointer-events-none opacity-50": disabled,
|
|
219
|
+
}, className) });
|
|
220
|
+
const element = render ? cloneElement(render, mergedProps) : _jsx("div", Object.assign({}, mergedProps));
|
|
221
|
+
return _jsx(SortableItemContext.Provider, { value: itemContext, children: element });
|
|
222
|
+
}
|
|
223
|
+
function SortableItemHandle(props) {
|
|
224
|
+
const { render, disabled, className } = props, itemHandleProps = __rest(props, ["render", "disabled", "className"]);
|
|
225
|
+
const context = useSortableContext(ITEM_HANDLE_NAME);
|
|
226
|
+
const itemContext = useSortableItemContext(ITEM_HANDLE_NAME);
|
|
227
|
+
const isDisabled = disabled !== null && disabled !== void 0 ? disabled : itemContext.disabled;
|
|
228
|
+
const composedRef = useComposedRefs(itemHandleProps.ref, (node) => {
|
|
229
|
+
if (!isDisabled) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
itemContext.setActivatorNodeRef(node);
|
|
233
|
+
});
|
|
234
|
+
const mergedProps = Object.assign(Object.assign(Object.assign(Object.assign({ type: "button", "aria-controls": itemContext.id, "data-disabled": isDisabled, "data-dragging": itemContext.isDragging ? "" : undefined, "data-slot": "sortable-item-handle" }, itemHandleProps), (isDisabled ? {} : itemContext.attributes)), (isDisabled ? {} : itemContext.listeners)), { ref: composedRef, className: cn("select-none disabled:pointer-events-none disabled:opacity-50", context.flatCursor ? "cursor-default" : "cursor-grab data-dragging:cursor-grabbing", className), disabled: isDisabled });
|
|
235
|
+
return render ? cloneElement(render, mergedProps) : _jsx("button", Object.assign({}, mergedProps));
|
|
236
|
+
}
|
|
237
|
+
const SortableOverlayContext = createContext(false);
|
|
238
|
+
const dropAnimation = {
|
|
239
|
+
sideEffects: defaultDropAnimationSideEffects({
|
|
240
|
+
styles: {
|
|
241
|
+
active: {
|
|
242
|
+
opacity: "0.4",
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
}),
|
|
246
|
+
};
|
|
247
|
+
function SortableOverlay(props) {
|
|
248
|
+
var _a;
|
|
249
|
+
const { container: containerProp, children } = props, overlayProps = __rest(props, ["container", "children"]);
|
|
250
|
+
const context = useSortableContext(OVERLAY_NAME);
|
|
251
|
+
const [mounted, setMounted] = useState(false);
|
|
252
|
+
useLayoutEffect(() => setMounted(true), []);
|
|
253
|
+
const container = containerProp !== null && containerProp !== void 0 ? containerProp : (mounted ? (_a = globalThis.document) === null || _a === void 0 ? void 0 : _a.body : null);
|
|
254
|
+
if (!container) {
|
|
255
|
+
return null;
|
|
256
|
+
}
|
|
257
|
+
return ReactDOM.createPortal(_jsx(DragOverlay, Object.assign({ dropAnimation: dropAnimation, modifiers: context.modifiers, className: cn(!context.flatCursor && "cursor-grabbing") }, overlayProps, { children: _jsx(SortableOverlayContext.Provider, { value: true, children: context.activeId
|
|
258
|
+
? typeof children === "function"
|
|
259
|
+
? children({ value: context.activeId })
|
|
260
|
+
: children
|
|
261
|
+
: null }) })), container);
|
|
262
|
+
}
|
|
263
|
+
export { Sortable, SortableContent, SortableItem, SortableItemHandle, SortableOverlay, };
|