@mkbabb/glass-ui 0.2.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/README.md +172 -0
- package/dist/glass-ui.css +1 -0
- package/dist/glass-ui.js +10019 -0
- package/dist/index.d.ts +6619 -0
- package/package.json +65 -0
- package/src/components/custom/aurora/Aurora.vue +34 -0
- package/src/components/custom/aurora/composables/color.ts +122 -0
- package/src/components/custom/aurora/composables/useAurora.ts +355 -0
- package/src/components/custom/aurora/index.ts +8 -0
- package/src/components/custom/confirm-dialog/ConfirmDialog.vue +88 -0
- package/src/components/custom/confirm-dialog/index.ts +1 -0
- package/src/components/custom/controls/DarkModeToggle.vue +96 -0
- package/src/components/custom/controls/index.ts +1 -0
- package/src/components/custom/dock/DockLayerGroup.vue +21 -0
- package/src/components/custom/dock/DockPopover.vue +263 -0
- package/src/components/custom/dock/GlassDock.vue +276 -0
- package/src/components/custom/dock/composables/index.ts +16 -0
- package/src/components/custom/dock/composables/isTeleportedTarget.ts +19 -0
- package/src/components/custom/dock/composables/useDockActionBar.ts +33 -0
- package/src/components/custom/dock/composables/useDockState.ts +301 -0
- package/src/components/custom/dock/composables/useDockTransition.ts +146 -0
- package/src/components/custom/dock/composables/useLayerTransition.ts +135 -0
- package/src/components/custom/dock/composables/usePopupMutex.ts +83 -0
- package/src/components/custom/dock/index.ts +9 -0
- package/src/components/custom/expandable-container/ExpandableContainer.vue +64 -0
- package/src/components/custom/expandable-container/index.ts +1 -0
- package/src/components/custom/glass-panel/GlassPanel.vue +98 -0
- package/src/components/custom/glass-panel/index.ts +2 -0
- package/src/components/custom/icon-tooltip/IconTooltip.vue +20 -0
- package/src/components/custom/icon-tooltip/index.ts +1 -0
- package/src/components/custom/index.ts +15 -0
- package/src/components/custom/infinite-scroll/InfiniteScroll.vue +55 -0
- package/src/components/custom/infinite-scroll/composables/index.ts +2 -0
- package/src/components/custom/infinite-scroll/composables/types.ts +23 -0
- package/src/components/custom/infinite-scroll/composables/useInfiniteScroll.ts +73 -0
- package/src/components/custom/infinite-scroll/index.ts +1 -0
- package/src/components/custom/labeled-field/LabeledInput.vue +29 -0
- package/src/components/custom/labeled-field/LabeledSelect.vue +59 -0
- package/src/components/custom/labeled-field/LabeledSlider.vue +32 -0
- package/src/components/custom/labeled-field/LabeledSwitch.vue +27 -0
- package/src/components/custom/labeled-field/index.ts +4 -0
- package/src/components/custom/metaballs/MetaballCanvas.vue +23 -0
- package/src/components/custom/metaballs/index.ts +4 -0
- package/src/components/custom/metaballs/shaders.ts +63 -0
- package/src/components/custom/metaballs/types.ts +29 -0
- package/src/components/custom/metaballs/useMetaballs.ts +252 -0
- package/src/components/custom/search/FuzzySearch.vue +589 -0
- package/src/components/custom/search/SearchBar.vue +44 -0
- package/src/components/custom/search/composables/fuzzySearchIndex.ts +224 -0
- package/src/components/custom/search/composables/index.ts +5 -0
- package/src/components/custom/search/composables/types.ts +34 -0
- package/src/components/custom/search/composables/useFuzzySearch.ts +115 -0
- package/src/components/custom/search/index.ts +7 -0
- package/src/components/custom/sidebar/ProgressiveSidebar.vue +256 -0
- package/src/components/custom/sidebar/composables/index.ts +6 -0
- package/src/components/custom/sidebar/composables/useScrollTracker.ts +242 -0
- package/src/components/custom/sidebar/composables/useSidebarFollow.ts +247 -0
- package/src/components/custom/sidebar/composables/useSidebarState.ts +72 -0
- package/src/components/custom/sidebar/composables/useTreeIndex.ts +152 -0
- package/src/components/custom/sidebar/index.ts +15 -0
- package/src/components/custom/sidebar/types.ts +50 -0
- package/src/components/custom/tabs/BouncyTabs.vue +39 -0
- package/src/components/custom/tabs/BouncyToggle.vue +352 -0
- package/src/components/custom/tabs/UnderlineTabs.vue +115 -0
- package/src/components/custom/tabs/index.ts +5 -0
- package/src/components/custom/timeline/GlassTimeline.vue +174 -0
- package/src/components/custom/timeline/index.ts +1 -0
- package/src/components/custom/typewriter/TypewriterText.vue +239 -0
- package/src/components/custom/typewriter/composables/index.ts +1 -0
- package/src/components/custom/typewriter/composables/useTypewriter.ts +413 -0
- package/src/components/custom/typewriter/index.ts +7 -0
- package/src/components/custom/typewriter/types.ts +159 -0
- package/src/components/custom/typewriter/utils/keyboard.ts +213 -0
- package/src/components/custom/typewriter/utils/pausePatterns.ts +55 -0
- package/src/components/custom/typewriter/utils/timing.ts +104 -0
- package/src/components/custom/typewriter/utils/typoStateMachine.ts +197 -0
- package/src/components/index.ts +2 -0
- package/src/components/ui/accordion/Accordion.vue +19 -0
- package/src/components/ui/accordion/AccordionContent.vue +24 -0
- package/src/components/ui/accordion/AccordionItem.vue +24 -0
- package/src/components/ui/accordion/AccordionTrigger.vue +39 -0
- package/src/components/ui/accordion/index.ts +4 -0
- package/src/components/ui/alert/Alert.vue +20 -0
- package/src/components/ui/alert/AlertDescription.vue +17 -0
- package/src/components/ui/alert/AlertTitle.vue +17 -0
- package/src/components/ui/alert/index.ts +23 -0
- package/src/components/ui/avatar/Avatar.vue +21 -0
- package/src/components/ui/avatar/AvatarFallback.vue +11 -0
- package/src/components/ui/avatar/AvatarImage.vue +9 -0
- package/src/components/ui/avatar/index.ts +24 -0
- package/src/components/ui/badge/Badge.vue +16 -0
- package/src/components/ui/badge/index.ts +25 -0
- package/src/components/ui/button/Button.vue +26 -0
- package/src/components/ui/button/index.ts +43 -0
- package/src/components/ui/card/Card.vue +28 -0
- package/src/components/ui/card/CardContent.vue +14 -0
- package/src/components/ui/card/CardDescription.vue +14 -0
- package/src/components/ui/card/CardFooter.vue +14 -0
- package/src/components/ui/card/CardHeader.vue +14 -0
- package/src/components/ui/card/CardTitle.vue +21 -0
- package/src/components/ui/card/index.ts +6 -0
- package/src/components/ui/carousel/Carousel.vue +53 -0
- package/src/components/ui/carousel/CarouselContent.vue +35 -0
- package/src/components/ui/carousel/CarouselItem.vue +24 -0
- package/src/components/ui/carousel/CarouselNext.vue +40 -0
- package/src/components/ui/carousel/CarouselPrevious.vue +40 -0
- package/src/components/ui/carousel/index.ts +10 -0
- package/src/components/ui/carousel/interface.ts +26 -0
- package/src/components/ui/carousel/useCarousel.ts +56 -0
- package/src/components/ui/checkbox/Checkbox.vue +33 -0
- package/src/components/ui/checkbox/index.ts +1 -0
- package/src/components/ui/collapsible/Collapsible.vue +15 -0
- package/src/components/ui/collapsible/CollapsibleContent.vue +11 -0
- package/src/components/ui/collapsible/CollapsibleTrigger.vue +11 -0
- package/src/components/ui/collapsible/index.ts +3 -0
- package/src/components/ui/combobox/Combobox.vue +17 -0
- package/src/components/ui/combobox/ComboboxAnchor.vue +23 -0
- package/src/components/ui/combobox/ComboboxEmpty.vue +21 -0
- package/src/components/ui/combobox/ComboboxGroup.vue +27 -0
- package/src/components/ui/combobox/ComboboxInput.vue +41 -0
- package/src/components/ui/combobox/ComboboxItem.vue +24 -0
- package/src/components/ui/combobox/ComboboxItemIndicator.vue +23 -0
- package/src/components/ui/combobox/ComboboxList.vue +29 -0
- package/src/components/ui/combobox/ComboboxSeparator.vue +21 -0
- package/src/components/ui/combobox/ComboboxViewport.vue +23 -0
- package/src/components/ui/combobox/index.ts +12 -0
- package/src/components/ui/command/Command.vue +30 -0
- package/src/components/ui/command/CommandDialog.vue +21 -0
- package/src/components/ui/command/CommandEmpty.vue +20 -0
- package/src/components/ui/command/CommandGroup.vue +29 -0
- package/src/components/ui/command/CommandInput.vue +33 -0
- package/src/components/ui/command/CommandItem.vue +26 -0
- package/src/components/ui/command/CommandList.vue +27 -0
- package/src/components/ui/command/CommandSeparator.vue +23 -0
- package/src/components/ui/command/CommandShortcut.vue +14 -0
- package/src/components/ui/command/index.ts +9 -0
- package/src/components/ui/context-menu/ContextMenu.vue +15 -0
- package/src/components/ui/context-menu/ContextMenuCheckboxItem.vue +40 -0
- package/src/components/ui/context-menu/ContextMenuContent.vue +36 -0
- package/src/components/ui/context-menu/ContextMenuGroup.vue +11 -0
- package/src/components/ui/context-menu/ContextMenuItem.vue +34 -0
- package/src/components/ui/context-menu/ContextMenuLabel.vue +25 -0
- package/src/components/ui/context-menu/ContextMenuPortal.vue +11 -0
- package/src/components/ui/context-menu/ContextMenuRadioGroup.vue +19 -0
- package/src/components/ui/context-menu/ContextMenuRadioItem.vue +40 -0
- package/src/components/ui/context-menu/ContextMenuSeparator.vue +20 -0
- package/src/components/ui/context-menu/ContextMenuShortcut.vue +14 -0
- package/src/components/ui/context-menu/ContextMenuSub.vue +19 -0
- package/src/components/ui/context-menu/ContextMenuSubContent.vue +35 -0
- package/src/components/ui/context-menu/ContextMenuSubTrigger.vue +34 -0
- package/src/components/ui/context-menu/ContextMenuTrigger.vue +13 -0
- package/src/components/ui/context-menu/index.ts +14 -0
- package/src/components/ui/data-table/DataTable.vue +167 -0
- package/src/components/ui/data-table/DataTablePagination.vue +112 -0
- package/src/components/ui/data-table/index.ts +3 -0
- package/src/components/ui/data-table/types.ts +48 -0
- package/src/components/ui/dialog/Dialog.vue +14 -0
- package/src/components/ui/dialog/DialogClose.vue +11 -0
- package/src/components/ui/dialog/DialogContent.vue +61 -0
- package/src/components/ui/dialog/DialogDescription.vue +24 -0
- package/src/components/ui/dialog/DialogFooter.vue +19 -0
- package/src/components/ui/dialog/DialogHeader.vue +16 -0
- package/src/components/ui/dialog/DialogScrollContent.vue +65 -0
- package/src/components/ui/dialog/DialogTitle.vue +29 -0
- package/src/components/ui/dialog/DialogTrigger.vue +11 -0
- package/src/components/ui/dialog/index.ts +9 -0
- package/src/components/ui/drawer/Drawer.vue +19 -0
- package/src/components/ui/drawer/DrawerContent.vue +28 -0
- package/src/components/ui/drawer/DrawerDescription.vue +20 -0
- package/src/components/ui/drawer/DrawerFooter.vue +14 -0
- package/src/components/ui/drawer/DrawerHeader.vue +14 -0
- package/src/components/ui/drawer/DrawerOverlay.vue +18 -0
- package/src/components/ui/drawer/DrawerTitle.vue +20 -0
- package/src/components/ui/drawer/index.ts +8 -0
- package/src/components/ui/dropdown-menu/DropdownMenu.vue +14 -0
- package/src/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +40 -0
- package/src/components/ui/dropdown-menu/DropdownMenuContent.vue +44 -0
- package/src/components/ui/dropdown-menu/DropdownMenuGroup.vue +11 -0
- package/src/components/ui/dropdown-menu/DropdownMenuItem.vue +28 -0
- package/src/components/ui/dropdown-menu/DropdownMenuLabel.vue +24 -0
- package/src/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +19 -0
- package/src/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +40 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSeparator.vue +22 -0
- package/src/components/ui/dropdown-menu/DropdownMenuShortcut.vue +14 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSub.vue +19 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSubContent.vue +36 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +33 -0
- package/src/components/ui/dropdown-menu/DropdownMenuTrigger.vue +13 -0
- package/src/components/ui/dropdown-menu/index.ts +16 -0
- package/src/components/ui/hover-card/HoverCard.vue +14 -0
- package/src/components/ui/hover-card/HoverCardContent.vue +41 -0
- package/src/components/ui/hover-card/HoverCardTrigger.vue +11 -0
- package/src/components/ui/hover-card/index.ts +3 -0
- package/src/components/ui/index.ts +41 -0
- package/src/components/ui/input/Input.vue +24 -0
- package/src/components/ui/input/index.ts +1 -0
- package/src/components/ui/label/Label.vue +27 -0
- package/src/components/ui/label/index.ts +1 -0
- package/src/components/ui/multi-select/MultiSelect.vue +141 -0
- package/src/components/ui/multi-select/index.ts +7 -0
- package/src/components/ui/notification/Notification.vue +85 -0
- package/src/components/ui/notification/index.ts +1 -0
- package/src/components/ui/number-field/NumberField.vue +23 -0
- package/src/components/ui/number-field/NumberFieldContent.vue +14 -0
- package/src/components/ui/number-field/NumberFieldDecrement.vue +25 -0
- package/src/components/ui/number-field/NumberFieldIncrement.vue +25 -0
- package/src/components/ui/number-field/NumberFieldInput.vue +8 -0
- package/src/components/ui/number-field/index.ts +5 -0
- package/src/components/ui/popover/Popover.vue +15 -0
- package/src/components/ui/popover/PopoverContent.vue +61 -0
- package/src/components/ui/popover/PopoverTrigger.vue +11 -0
- package/src/components/ui/popover/index.ts +3 -0
- package/src/components/ui/progress/Progress.vue +39 -0
- package/src/components/ui/progress/index.ts +1 -0
- package/src/components/ui/radio-group/RadioGroup.vue +25 -0
- package/src/components/ui/radio-group/RadioGroupItem.vue +39 -0
- package/src/components/ui/radio-group/index.ts +2 -0
- package/src/components/ui/scroll-area/ScrollArea.vue +29 -0
- package/src/components/ui/scroll-area/ScrollBar.vue +30 -0
- package/src/components/ui/scroll-area/index.ts +2 -0
- package/src/components/ui/scroll-pane/ScrollPane.vue +25 -0
- package/src/components/ui/scroll-pane/ScrollPaneHeader.vue +75 -0
- package/src/components/ui/scroll-pane/index.ts +2 -0
- package/src/components/ui/select/Select.vue +15 -0
- package/src/components/ui/select/SelectContent.vue +57 -0
- package/src/components/ui/select/SelectGroup.vue +19 -0
- package/src/components/ui/select/SelectItem.vue +47 -0
- package/src/components/ui/select/SelectItemText.vue +11 -0
- package/src/components/ui/select/SelectLabel.vue +13 -0
- package/src/components/ui/select/SelectScrollDownButton.vue +24 -0
- package/src/components/ui/select/SelectScrollUpButton.vue +24 -0
- package/src/components/ui/select/SelectSeparator.vue +17 -0
- package/src/components/ui/select/SelectTrigger.vue +45 -0
- package/src/components/ui/select/SelectValue.vue +11 -0
- package/src/components/ui/select/index.ts +11 -0
- package/src/components/ui/separator/Separator.vue +35 -0
- package/src/components/ui/separator/index.ts +1 -0
- package/src/components/ui/sheet/Sheet.vue +14 -0
- package/src/components/ui/sheet/SheetClose.vue +11 -0
- package/src/components/ui/sheet/SheetContent.vue +56 -0
- package/src/components/ui/sheet/SheetDescription.vue +22 -0
- package/src/components/ui/sheet/SheetFooter.vue +19 -0
- package/src/components/ui/sheet/SheetHeader.vue +16 -0
- package/src/components/ui/sheet/SheetTitle.vue +22 -0
- package/src/components/ui/sheet/SheetTrigger.vue +11 -0
- package/src/components/ui/sheet/index.ts +31 -0
- package/src/components/ui/skeleton/Skeleton.vue +14 -0
- package/src/components/ui/skeleton/index.ts +1 -0
- package/src/components/ui/slider/Slider.vue +66 -0
- package/src/components/ui/slider/index.ts +1 -0
- package/src/components/ui/switch/Switch.vue +37 -0
- package/src/components/ui/switch/index.ts +1 -0
- package/src/components/ui/table/Table.vue +16 -0
- package/src/components/ui/table/TableBody.vue +14 -0
- package/src/components/ui/table/TableCaption.vue +14 -0
- package/src/components/ui/table/TableCell.vue +14 -0
- package/src/components/ui/table/TableEmpty.vue +39 -0
- package/src/components/ui/table/TableFooter.vue +16 -0
- package/src/components/ui/table/TableHead.vue +21 -0
- package/src/components/ui/table/TableHeader.vue +14 -0
- package/src/components/ui/table/TableRow.vue +21 -0
- package/src/components/ui/table/index.ts +9 -0
- package/src/components/ui/tabs/Tabs.vue +15 -0
- package/src/components/ui/tabs/TabsContent.vue +22 -0
- package/src/components/ui/tabs/TabsIndicator.vue +22 -0
- package/src/components/ui/tabs/TabsList.vue +25 -0
- package/src/components/ui/tabs/TabsTrigger.vue +29 -0
- package/src/components/ui/tabs/index.ts +5 -0
- package/src/components/ui/tags-input/TagsInput.vue +22 -0
- package/src/components/ui/tags-input/TagsInputInput.vue +19 -0
- package/src/components/ui/tags-input/TagsInputItem.vue +22 -0
- package/src/components/ui/tags-input/TagsInputItemDelete.vue +24 -0
- package/src/components/ui/tags-input/TagsInputItemText.vue +19 -0
- package/src/components/ui/tags-input/index.ts +5 -0
- package/src/components/ui/textarea/Textarea.vue +24 -0
- package/src/components/ui/textarea/index.ts +1 -0
- package/src/components/ui/toast/Toast.vue +57 -0
- package/src/components/ui/toast/ToastAction.vue +30 -0
- package/src/components/ui/toast/ToastClose.vue +31 -0
- package/src/components/ui/toast/ToastDescription.vue +25 -0
- package/src/components/ui/toast/ToastTitle.vue +25 -0
- package/src/components/ui/toast/Toaster.vue +31 -0
- package/src/components/ui/toast/index.ts +8 -0
- package/src/components/ui/toast/use-toast.ts +136 -0
- package/src/components/ui/toggle/Toggle.vue +35 -0
- package/src/components/ui/toggle/index.ts +27 -0
- package/src/components/ui/toggle-group/ToggleGroup.vue +34 -0
- package/src/components/ui/toggle-group/ToggleGroupItem.vue +35 -0
- package/src/components/ui/toggle-group/index.ts +2 -0
- package/src/components/ui/tooltip/Tooltip.vue +14 -0
- package/src/components/ui/tooltip/TooltipContent.vue +31 -0
- package/src/components/ui/tooltip/TooltipProvider.vue +11 -0
- package/src/components/ui/tooltip/TooltipTrigger.vue +11 -0
- package/src/components/ui/tooltip/index.ts +4 -0
- package/src/composables/glass/index.ts +8 -0
- package/src/composables/glass/useGlassRenderer.ts +252 -0
- package/src/composables/glass/webgl/frostShader.ts +221 -0
- package/src/composables/glass/webgpu/glassShader.wgsl +173 -0
- package/src/composables/index.ts +32 -0
- package/src/composables/infinite-scroll/index.ts +2 -0
- package/src/composables/infinite-scroll/types.ts +25 -0
- package/src/composables/infinite-scroll/useInfiniteScroll.ts +101 -0
- package/src/composables/interaction/index.ts +5 -0
- package/src/composables/interaction/useHeightTransition.ts +82 -0
- package/src/composables/interaction/useHoverPopover.ts +64 -0
- package/src/composables/interaction/useHoverToggle.ts +103 -0
- package/src/composables/interaction/useLeaveTimer.ts +17 -0
- package/src/composables/interaction/useTouchGate.ts +207 -0
- package/src/composables/pagination/index.ts +2 -0
- package/src/composables/pagination/useOffsetPagination.ts +70 -0
- package/src/composables/prng.ts +32 -0
- package/src/composables/useCharSplit.ts +31 -0
- package/src/composables/useClipboard.ts +46 -0
- package/src/composables/useGlobalDark.ts +61 -0
- package/src/composables/useKeyboardShortcuts.ts +205 -0
- package/src/composables/useWatercolorBlob.ts +136 -0
- package/src/composables/virtual/index.ts +22 -0
- package/src/composables/virtual/useVirtualSectionWindow.ts +338 -0
- package/src/composables/virtual/useWindowedStore.ts +86 -0
- package/src/composables/virtual/virtualSectionLayout.ts +212 -0
- package/src/index.ts +9 -0
- package/src/styles/animations.css +233 -0
- package/src/styles/cards.css +66 -0
- package/src/styles/dock.css +221 -0
- package/src/styles/floating-panel.css +49 -0
- package/src/styles/glass.css +266 -0
- package/src/styles/index.css +26 -0
- package/src/styles/scroll-pane.css +10 -0
- package/src/styles/theme.css +138 -0
- package/src/styles/tokens.css +333 -0
- package/src/styles/transitions.css +226 -0
- package/src/styles/typography.css +277 -0
- package/src/styles/utilities.css +697 -0
- package/src/utils/cn.ts +6 -0
- package/src/utils/index.ts +1 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import {
|
|
4
|
+
DropdownMenuItemIndicator,
|
|
5
|
+
DropdownMenuRadioItem,
|
|
6
|
+
type DropdownMenuRadioItemEmits,
|
|
7
|
+
type DropdownMenuRadioItemProps,
|
|
8
|
+
useForwardPropsEmits,
|
|
9
|
+
} from 'reka-ui'
|
|
10
|
+
import { cn } from '../../../utils'
|
|
11
|
+
|
|
12
|
+
const props = defineProps<DropdownMenuRadioItemProps & { class?: HTMLAttributes['class'] }>()
|
|
13
|
+
|
|
14
|
+
const emits = defineEmits<DropdownMenuRadioItemEmits>()
|
|
15
|
+
|
|
16
|
+
const delegatedProps = computed(() => {
|
|
17
|
+
const { class: _, ...delegated } = props
|
|
18
|
+
|
|
19
|
+
return delegated
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<DropdownMenuRadioItem
|
|
27
|
+
v-bind="forwarded"
|
|
28
|
+
:class="cn(
|
|
29
|
+
'relative flex cursor-default select-none items-center rounded-lg py-1.5 pl-7 pr-2 text-sm outline-none transition-colors focus:bg-foreground/[0.06] focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
|
30
|
+
props.class,
|
|
31
|
+
)"
|
|
32
|
+
>
|
|
33
|
+
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
34
|
+
<DropdownMenuItemIndicator>
|
|
35
|
+
<span class="inline-block w-2 h-2 rounded-full bg-current"></span>
|
|
36
|
+
</DropdownMenuItemIndicator>
|
|
37
|
+
</span>
|
|
38
|
+
<slot />
|
|
39
|
+
</DropdownMenuRadioItem>
|
|
40
|
+
</template>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import {
|
|
4
|
+
DropdownMenuSeparator,
|
|
5
|
+
type DropdownMenuSeparatorProps,
|
|
6
|
+
} from 'reka-ui'
|
|
7
|
+
import { cn } from '../../../utils'
|
|
8
|
+
|
|
9
|
+
const props = defineProps<DropdownMenuSeparatorProps & {
|
|
10
|
+
class?: HTMLAttributes['class']
|
|
11
|
+
}>()
|
|
12
|
+
|
|
13
|
+
const delegatedProps = computed(() => {
|
|
14
|
+
const { class: _, ...delegated } = props
|
|
15
|
+
|
|
16
|
+
return delegated
|
|
17
|
+
})
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<DropdownMenuSeparator v-bind="delegatedProps" :class="cn('-mx-1 my-1 h-px bg-border/70', props.class)" />
|
|
22
|
+
</template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { cn } from '../../../utils'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes['class']
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<span :class="cn('ml-auto text-xs tracking-widest opacity-60', props.class)">
|
|
12
|
+
<slot />
|
|
13
|
+
</span>
|
|
14
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
DropdownMenuSub,
|
|
4
|
+
type DropdownMenuSubEmits,
|
|
5
|
+
type DropdownMenuSubProps,
|
|
6
|
+
useForwardPropsEmits,
|
|
7
|
+
} from 'reka-ui'
|
|
8
|
+
|
|
9
|
+
const props = defineProps<DropdownMenuSubProps>()
|
|
10
|
+
const emits = defineEmits<DropdownMenuSubEmits>()
|
|
11
|
+
|
|
12
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<DropdownMenuSub v-bind="forwarded">
|
|
17
|
+
<slot />
|
|
18
|
+
</DropdownMenuSub>
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import {
|
|
4
|
+
DropdownMenuSubContent,
|
|
5
|
+
type DropdownMenuSubContentEmits,
|
|
6
|
+
type DropdownMenuSubContentProps,
|
|
7
|
+
useForwardPropsEmits,
|
|
8
|
+
} from 'reka-ui'
|
|
9
|
+
import { cn } from '../../../utils'
|
|
10
|
+
|
|
11
|
+
const props = defineProps<DropdownMenuSubContentProps & { class?: HTMLAttributes['class'] }>()
|
|
12
|
+
const emits = defineEmits<DropdownMenuSubContentEmits>()
|
|
13
|
+
|
|
14
|
+
const delegatedProps = computed(() => {
|
|
15
|
+
const { class: _, ...delegated } = props
|
|
16
|
+
|
|
17
|
+
return delegated
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<DropdownMenuSubContent
|
|
25
|
+
v-bind="forwarded"
|
|
26
|
+
:class="cn('dropdown-sub-content z-popover min-w-32 overflow-hidden rounded-xl border bg-popover glass-elevated [backdrop-filter:var(--glass-blur-elevated)] p-1 text-popover-foreground shadow-xl data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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', props.class)"
|
|
27
|
+
>
|
|
28
|
+
<slot />
|
|
29
|
+
</DropdownMenuSubContent>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<style scoped>
|
|
33
|
+
.dropdown-sub-content {
|
|
34
|
+
font-family: var(--dropdown-menu-font, inherit);
|
|
35
|
+
}
|
|
36
|
+
</style>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import {
|
|
4
|
+
DropdownMenuSubTrigger,
|
|
5
|
+
type DropdownMenuSubTriggerProps,
|
|
6
|
+
useForwardProps,
|
|
7
|
+
} from 'reka-ui'
|
|
8
|
+
import { ChevronRight } from 'lucide-vue-next'
|
|
9
|
+
import { cn } from '../../../utils'
|
|
10
|
+
|
|
11
|
+
const props = defineProps<DropdownMenuSubTriggerProps & { class?: HTMLAttributes['class'] }>()
|
|
12
|
+
|
|
13
|
+
const delegatedProps = computed(() => {
|
|
14
|
+
const { class: _, ...delegated } = props
|
|
15
|
+
|
|
16
|
+
return delegated
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<DropdownMenuSubTrigger
|
|
24
|
+
v-bind="forwardedProps"
|
|
25
|
+
:class="cn(
|
|
26
|
+
'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent',
|
|
27
|
+
props.class,
|
|
28
|
+
)"
|
|
29
|
+
>
|
|
30
|
+
<slot />
|
|
31
|
+
<ChevronRight class="ml-auto h-4 w-4" />
|
|
32
|
+
</DropdownMenuSubTrigger>
|
|
33
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { DropdownMenuTrigger, type DropdownMenuTriggerProps, useForwardProps } from 'reka-ui'
|
|
3
|
+
|
|
4
|
+
const props = defineProps<DropdownMenuTriggerProps>()
|
|
5
|
+
|
|
6
|
+
const forwardedProps = useForwardProps(props)
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<DropdownMenuTrigger class="outline-none" v-bind="forwardedProps">
|
|
11
|
+
<slot />
|
|
12
|
+
</DropdownMenuTrigger>
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { DropdownMenuPortal } from 'reka-ui'
|
|
2
|
+
|
|
3
|
+
export { default as DropdownMenu } from './DropdownMenu.vue'
|
|
4
|
+
export { default as DropdownMenuTrigger } from './DropdownMenuTrigger.vue'
|
|
5
|
+
export { default as DropdownMenuContent } from './DropdownMenuContent.vue'
|
|
6
|
+
export { default as DropdownMenuGroup } from './DropdownMenuGroup.vue'
|
|
7
|
+
export { default as DropdownMenuRadioGroup } from './DropdownMenuRadioGroup.vue'
|
|
8
|
+
export { default as DropdownMenuItem } from './DropdownMenuItem.vue'
|
|
9
|
+
export { default as DropdownMenuCheckboxItem } from './DropdownMenuCheckboxItem.vue'
|
|
10
|
+
export { default as DropdownMenuRadioItem } from './DropdownMenuRadioItem.vue'
|
|
11
|
+
export { default as DropdownMenuShortcut } from './DropdownMenuShortcut.vue'
|
|
12
|
+
export { default as DropdownMenuSeparator } from './DropdownMenuSeparator.vue'
|
|
13
|
+
export { default as DropdownMenuLabel } from './DropdownMenuLabel.vue'
|
|
14
|
+
export { default as DropdownMenuSub } from './DropdownMenuSub.vue'
|
|
15
|
+
export { default as DropdownMenuSubTrigger } from './DropdownMenuSubTrigger.vue'
|
|
16
|
+
export { default as DropdownMenuSubContent } from './DropdownMenuSubContent.vue'
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { HoverCardRoot, type HoverCardRootEmits, type HoverCardRootProps, useForwardPropsEmits } from 'reka-ui'
|
|
3
|
+
|
|
4
|
+
const props = defineProps<HoverCardRootProps>()
|
|
5
|
+
const emits = defineEmits<HoverCardRootEmits>()
|
|
6
|
+
|
|
7
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<HoverCardRoot v-bind="forwarded">
|
|
12
|
+
<slot />
|
|
13
|
+
</HoverCardRoot>
|
|
14
|
+
</template>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import {
|
|
4
|
+
HoverCardContent,
|
|
5
|
+
type HoverCardContentProps,
|
|
6
|
+
HoverCardPortal,
|
|
7
|
+
useForwardProps,
|
|
8
|
+
} from 'reka-ui'
|
|
9
|
+
import { cn } from '../../../utils'
|
|
10
|
+
|
|
11
|
+
const props = withDefaults(
|
|
12
|
+
defineProps<HoverCardContentProps & { class?: HTMLAttributes['class'] }>(),
|
|
13
|
+
{
|
|
14
|
+
sideOffset: 4,
|
|
15
|
+
},
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
const delegatedProps = computed(() => {
|
|
19
|
+
const { class: _, ...delegated } = props
|
|
20
|
+
|
|
21
|
+
return delegated
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<HoverCardPortal>
|
|
29
|
+
<HoverCardContent
|
|
30
|
+
v-bind="forwardedProps"
|
|
31
|
+
:class="
|
|
32
|
+
cn(
|
|
33
|
+
'z-popover w-64 rounded-xl border bg-popover glass-elevated [backdrop-filter:var(--glass-blur-elevated)] p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 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',
|
|
34
|
+
props.class,
|
|
35
|
+
)
|
|
36
|
+
"
|
|
37
|
+
>
|
|
38
|
+
<slot />
|
|
39
|
+
</HoverCardContent>
|
|
40
|
+
</HoverCardPortal>
|
|
41
|
+
</template>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { HoverCardTrigger, type HoverCardTriggerProps } from 'reka-ui'
|
|
3
|
+
|
|
4
|
+
const props = defineProps<HoverCardTriggerProps>()
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<HoverCardTrigger v-bind="props">
|
|
9
|
+
<slot />
|
|
10
|
+
</HoverCardTrigger>
|
|
11
|
+
</template>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export * from "./accordion";
|
|
2
|
+
export * from "./alert";
|
|
3
|
+
export * from "./avatar";
|
|
4
|
+
export * from "./badge";
|
|
5
|
+
export * from "./button";
|
|
6
|
+
export * from "./card";
|
|
7
|
+
export * from "./carousel";
|
|
8
|
+
export * from "./checkbox";
|
|
9
|
+
export * from "./collapsible";
|
|
10
|
+
export * from "./combobox";
|
|
11
|
+
export * from "./command";
|
|
12
|
+
export * from "./context-menu";
|
|
13
|
+
export * from "./data-table";
|
|
14
|
+
export * from "./dialog";
|
|
15
|
+
export * from "./drawer";
|
|
16
|
+
export * from "./dropdown-menu";
|
|
17
|
+
export * from "./hover-card";
|
|
18
|
+
export * from "./input";
|
|
19
|
+
export * from "./label";
|
|
20
|
+
export * from "./multi-select";
|
|
21
|
+
export * from "./notification";
|
|
22
|
+
export * from "./number-field";
|
|
23
|
+
export * from "./popover";
|
|
24
|
+
export * from "./progress";
|
|
25
|
+
export * from "./radio-group";
|
|
26
|
+
export * from "./scroll-area";
|
|
27
|
+
export * from "./scroll-pane";
|
|
28
|
+
export * from "./select";
|
|
29
|
+
export * from "./separator";
|
|
30
|
+
export * from "./sheet";
|
|
31
|
+
export * from "./skeleton";
|
|
32
|
+
export * from "./slider";
|
|
33
|
+
export * from "./switch";
|
|
34
|
+
export * from "./table";
|
|
35
|
+
export * from "./tabs";
|
|
36
|
+
export * from "./tags-input";
|
|
37
|
+
export * from "./textarea";
|
|
38
|
+
export * from "./toast";
|
|
39
|
+
export * from "./toggle";
|
|
40
|
+
export * from "./toggle-group";
|
|
41
|
+
export * from "./tooltip";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { useVModel } from '@vueuse/core'
|
|
4
|
+
import { cn } from '../../../utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<{
|
|
7
|
+
defaultValue?: string | number
|
|
8
|
+
modelValue?: string | number
|
|
9
|
+
class?: HTMLAttributes['class']
|
|
10
|
+
}>()
|
|
11
|
+
|
|
12
|
+
const emits = defineEmits<{
|
|
13
|
+
(e: 'update:modelValue', payload: string | number): void
|
|
14
|
+
}>()
|
|
15
|
+
|
|
16
|
+
const modelValue = useVModel(props, 'modelValue', emits, {
|
|
17
|
+
passive: true,
|
|
18
|
+
defaultValue: props.defaultValue,
|
|
19
|
+
})
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<input v-model="modelValue" :class="cn('input-pill text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium', props.class)">
|
|
24
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Input } from './Input.vue'
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { Label, type LabelProps } from 'reka-ui'
|
|
4
|
+
import { cn } from '../../../utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<LabelProps & { class?: HTMLAttributes['class'] }>()
|
|
7
|
+
|
|
8
|
+
const delegatedProps = computed(() => {
|
|
9
|
+
const { class: _, ...delegated } = props
|
|
10
|
+
|
|
11
|
+
return delegated
|
|
12
|
+
})
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<Label
|
|
17
|
+
v-bind="delegatedProps"
|
|
18
|
+
:class="
|
|
19
|
+
cn(
|
|
20
|
+
'text-md font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70',
|
|
21
|
+
props.class,
|
|
22
|
+
)
|
|
23
|
+
"
|
|
24
|
+
>
|
|
25
|
+
<slot />
|
|
26
|
+
</Label>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Label } from './Label.vue'
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, ref } from 'vue'
|
|
3
|
+
import {
|
|
4
|
+
Command,
|
|
5
|
+
CommandEmpty,
|
|
6
|
+
CommandGroup,
|
|
7
|
+
CommandInput,
|
|
8
|
+
CommandItem,
|
|
9
|
+
CommandList,
|
|
10
|
+
} from '../command'
|
|
11
|
+
import {
|
|
12
|
+
Popover,
|
|
13
|
+
PopoverContent,
|
|
14
|
+
PopoverTrigger,
|
|
15
|
+
} from '../popover'
|
|
16
|
+
import { Button } from '../button'
|
|
17
|
+
import { Badge } from '../badge'
|
|
18
|
+
import { Check, ChevronDown, X } from 'lucide-vue-next'
|
|
19
|
+
import { cn } from '../../../utils'
|
|
20
|
+
|
|
21
|
+
export interface MultiSelectOption {
|
|
22
|
+
value: string
|
|
23
|
+
label: string
|
|
24
|
+
icon?: string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface Props {
|
|
28
|
+
options: MultiSelectOption[]
|
|
29
|
+
modelValue: string[]
|
|
30
|
+
placeholder?: string
|
|
31
|
+
disabled?: boolean
|
|
32
|
+
maxDisplay?: number
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface Emits {
|
|
36
|
+
(e: 'update:modelValue', value: string[]): void
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
40
|
+
placeholder: 'Select items...',
|
|
41
|
+
disabled: false,
|
|
42
|
+
maxDisplay: 3,
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
const emit = defineEmits<Emits>()
|
|
46
|
+
|
|
47
|
+
const open = ref(false)
|
|
48
|
+
|
|
49
|
+
const selectedOptions = computed(() =>
|
|
50
|
+
props.options.filter(option => props.modelValue.includes(option.value))
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
const displayText = computed(() => {
|
|
54
|
+
if (selectedOptions.value.length === 0) {
|
|
55
|
+
return props.placeholder
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (selectedOptions.value.length <= props.maxDisplay) {
|
|
59
|
+
return selectedOptions.value.map(option => option.label).join(', ')
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return `${selectedOptions.value.slice(0, props.maxDisplay).map(option => option.label).join(', ')}... (+${selectedOptions.value.length - props.maxDisplay})`
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
function toggleOption(value: string) {
|
|
66
|
+
const newValue = props.modelValue.includes(value)
|
|
67
|
+
? props.modelValue.filter(v => v !== value)
|
|
68
|
+
: [...props.modelValue, value]
|
|
69
|
+
|
|
70
|
+
emit('update:modelValue', newValue)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function removeOption(value: string) {
|
|
74
|
+
const newValue = props.modelValue.filter(v => v !== value)
|
|
75
|
+
emit('update:modelValue', newValue)
|
|
76
|
+
}
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<template>
|
|
80
|
+
<Popover v-model:open="open">
|
|
81
|
+
<PopoverTrigger as-child>
|
|
82
|
+
<Button
|
|
83
|
+
variant="outline"
|
|
84
|
+
role="combobox"
|
|
85
|
+
:aria-expanded="open"
|
|
86
|
+
:disabled="disabled"
|
|
87
|
+
class="w-full justify-between text-left font-normal"
|
|
88
|
+
>
|
|
89
|
+
<span class="truncate">{{ displayText }}</span>
|
|
90
|
+
<ChevronDown class="ml-2 h-4 w-4 shrink-0 opacity-50" />
|
|
91
|
+
</Button>
|
|
92
|
+
</PopoverTrigger>
|
|
93
|
+
<PopoverContent class="w-full p-0" align="start">
|
|
94
|
+
<Command>
|
|
95
|
+
<CommandInput placeholder="Search..." />
|
|
96
|
+
<CommandEmpty>No options found.</CommandEmpty>
|
|
97
|
+
<CommandList>
|
|
98
|
+
<CommandGroup>
|
|
99
|
+
<CommandItem
|
|
100
|
+
v-for="option in options"
|
|
101
|
+
:key="option.value"
|
|
102
|
+
:value="option.value"
|
|
103
|
+
@select="toggleOption(option.value)"
|
|
104
|
+
class="cursor-pointer"
|
|
105
|
+
>
|
|
106
|
+
<Check
|
|
107
|
+
:class="cn(
|
|
108
|
+
'mr-2 h-4 w-4',
|
|
109
|
+
modelValue.includes(option.value) ? 'opacity-100' : 'opacity-0'
|
|
110
|
+
)"
|
|
111
|
+
/>
|
|
112
|
+
<span v-if="option.icon" class="mr-2" v-html="option.icon" />
|
|
113
|
+
{{ option.label }}
|
|
114
|
+
</CommandItem>
|
|
115
|
+
</CommandGroup>
|
|
116
|
+
</CommandList>
|
|
117
|
+
</Command>
|
|
118
|
+
</PopoverContent>
|
|
119
|
+
</Popover>
|
|
120
|
+
|
|
121
|
+
<!-- Selected items display (compact badges) -->
|
|
122
|
+
<div v-if="selectedOptions.length > 0" class="flex flex-wrap gap-1 mt-2">
|
|
123
|
+
<Badge
|
|
124
|
+
v-for="option in selectedOptions"
|
|
125
|
+
:key="option.value"
|
|
126
|
+
variant="secondary"
|
|
127
|
+
class="text-xs px-2 py-1"
|
|
128
|
+
>
|
|
129
|
+
<span v-if="option.icon" class="mr-1" v-html="option.icon" />
|
|
130
|
+
{{ option.label }}
|
|
131
|
+
<Button
|
|
132
|
+
variant="ghost"
|
|
133
|
+
size="sm"
|
|
134
|
+
class="ml-1 h-3 w-3 p-0 hover:bg-destructive hover:text-destructive-foreground"
|
|
135
|
+
@click.stop="removeOption(option.value)"
|
|
136
|
+
>
|
|
137
|
+
<X class="h-2 w-2" />
|
|
138
|
+
</Button>
|
|
139
|
+
</Badge>
|
|
140
|
+
</div>
|
|
141
|
+
</template>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<TransitionGroup
|
|
3
|
+
name="notification"
|
|
4
|
+
tag="div"
|
|
5
|
+
class="fixed bottom-4 right-4 z-50 flex flex-col gap-2"
|
|
6
|
+
>
|
|
7
|
+
<div
|
|
8
|
+
v-for="notification in notifications"
|
|
9
|
+
:key="notification.id"
|
|
10
|
+
class="flex items-center gap-3 rounded-lg px-4 py-3 shadow-lg [backdrop-filter:var(--glass-blur-subtle)]"
|
|
11
|
+
:class="[
|
|
12
|
+
notificationClasses[notification.type],
|
|
13
|
+
'min-w-[300px] max-w-[500px]'
|
|
14
|
+
]"
|
|
15
|
+
>
|
|
16
|
+
<component
|
|
17
|
+
:is="notificationIcons[notification.type]"
|
|
18
|
+
class="h-5 w-5 flex-shrink-0"
|
|
19
|
+
/>
|
|
20
|
+
<p class="flex-1 text-sm font-medium">
|
|
21
|
+
{{ notification.message }}
|
|
22
|
+
</p>
|
|
23
|
+
<button
|
|
24
|
+
@click="$emit('remove', notification.id)"
|
|
25
|
+
class="rounded-md p-1 transition-colors hover:bg-white/10"
|
|
26
|
+
>
|
|
27
|
+
<X class="h-4 w-4" />
|
|
28
|
+
</button>
|
|
29
|
+
</div>
|
|
30
|
+
</TransitionGroup>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<script setup lang="ts">
|
|
34
|
+
import { CheckCircle, XCircle, AlertCircle, Info, X } from 'lucide-vue-next'
|
|
35
|
+
|
|
36
|
+
interface Notification {
|
|
37
|
+
id: string
|
|
38
|
+
type: 'success' | 'error' | 'info' | 'warning'
|
|
39
|
+
message: string
|
|
40
|
+
duration?: number
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
defineProps<{
|
|
44
|
+
notifications: Notification[]
|
|
45
|
+
}>()
|
|
46
|
+
|
|
47
|
+
defineEmits<{
|
|
48
|
+
remove: [id: string]
|
|
49
|
+
}>()
|
|
50
|
+
|
|
51
|
+
const notificationClasses = {
|
|
52
|
+
success: 'bg-green-500/90 text-white',
|
|
53
|
+
error: 'bg-red-500/90 text-white',
|
|
54
|
+
warning: 'bg-amber-500/90 text-white',
|
|
55
|
+
info: 'bg-blue-500/90 text-white',
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const notificationIcons = {
|
|
59
|
+
success: CheckCircle,
|
|
60
|
+
error: XCircle,
|
|
61
|
+
warning: AlertCircle,
|
|
62
|
+
info: Info,
|
|
63
|
+
}
|
|
64
|
+
</script>
|
|
65
|
+
|
|
66
|
+
<style scoped>
|
|
67
|
+
.notification-enter-active,
|
|
68
|
+
.notification-leave-active {
|
|
69
|
+
transition: all 0.3s ease;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.notification-enter-from {
|
|
73
|
+
transform: translateX(100%);
|
|
74
|
+
opacity: 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.notification-leave-to {
|
|
78
|
+
transform: translateX(100%);
|
|
79
|
+
opacity: 0;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.notification-move {
|
|
83
|
+
transition: transform 0.3s ease;
|
|
84
|
+
}
|
|
85
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Notification } from './Notification.vue'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { NumberFieldRootEmits, NumberFieldRootProps } from 'reka-ui'
|
|
3
|
+
import { NumberFieldRoot, useForwardPropsEmits } from 'reka-ui'
|
|
4
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
5
|
+
import { cn } from '../../../utils'
|
|
6
|
+
|
|
7
|
+
const props = defineProps<NumberFieldRootProps & { class?: HTMLAttributes['class'] }>()
|
|
8
|
+
const emits = defineEmits<NumberFieldRootEmits>()
|
|
9
|
+
|
|
10
|
+
const delegatedProps = computed(() => {
|
|
11
|
+
const { class: _, ...delegated } = props
|
|
12
|
+
|
|
13
|
+
return delegated
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<NumberFieldRoot v-bind="forwarded" :class="cn('grid gap-1.5', props.class)">
|
|
21
|
+
<slot />
|
|
22
|
+
</NumberFieldRoot>
|
|
23
|
+
</template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { cn } from '../../../utils'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes['class']
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div :class="cn('relative [&>[data-slot=input]]:has-[[data-slot=increment]]:pr-5 [&>[data-slot=input]]:has-[[data-slot=decrement]]:pl-5', props.class)">
|
|
12
|
+
<slot />
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|