From 809e1c7bd34269c41b78499befd029e14a997942 Mon Sep 17 00:00:00 2001 From: Artem Melnyk Date: Sun, 15 Oct 2023 13:29:10 +0200 Subject: [PATCH] refactor: use createContext composable in many other components --- .../src/Accordion/AccordionContent.vue | 23 +++--- .../src/Accordion/AccordionHeader.vue | 15 ++-- .../radix-vue/src/Accordion/AccordionItem.vue | 40 +++++----- .../radix-vue/src/Accordion/AccordionRoot.vue | 15 ++-- .../src/Accordion/AccordionTrigger.vue | 31 ++++---- .../src/AlertDialog/AlertDialogCancel.vue | 8 +- .../src/AlertDialog/AlertDialogContent.vue | 13 ++-- .../radix-vue/src/Avatar/AvatarFallback.vue | 10 +-- packages/radix-vue/src/Avatar/AvatarImage.vue | 8 +- packages/radix-vue/src/Avatar/AvatarRoot.vue | 19 +++-- .../src/Checkbox/CheckboxIndicator.vue | 13 ++-- .../radix-vue/src/Checkbox/CheckboxRoot.vue | 25 +++++-- .../src/Collapsible/CollapsibleContent.vue | 16 ++-- .../src/Collapsible/CollapsibleRoot.vue | 13 ++-- .../src/Collapsible/CollapsibleTrigger.vue | 17 ++--- .../src/ContextMenu/ContextMenuContent.vue | 8 +- .../src/ContextMenu/ContextMenuRoot.vue | 13 ++-- .../src/ContextMenu/ContextMenuTrigger.vue | 10 +-- packages/radix-vue/src/ContextMenu/utils.ts | 9 --- packages/radix-vue/src/Dialog/DialogClose.vue | 7 +- .../radix-vue/src/Dialog/DialogContent.vue | 9 +-- .../src/Dialog/DialogContentImpl.vue | 15 ++-- .../src/Dialog/DialogContentModal.vue | 9 +-- .../src/Dialog/DialogContentNonModal.vue | 10 +-- .../src/Dialog/DialogDescription.vue | 7 +- .../radix-vue/src/Dialog/DialogOverlay.vue | 14 ++-- packages/radix-vue/src/Dialog/DialogRoot.vue | 17 +++-- packages/radix-vue/src/Dialog/DialogTitle.vue | 7 +- .../radix-vue/src/Dialog/DialogTrigger.vue | 16 ++-- .../src/HoverCard/HoverCardContent.vue | 11 ++- .../src/HoverCard/HoverCardContentImpl.vue | 22 +++--- .../radix-vue/src/HoverCard/HoverCardRoot.vue | 15 ++-- .../src/HoverCard/HoverCardTrigger.vue | 15 ++-- .../radix-vue/src/Menu/MenuCheckboxItem.vue | 7 +- packages/radix-vue/src/Menu/MenuContent.vue | 11 ++- .../radix-vue/src/Menu/MenuContentImpl.vue | 51 +++++++------ packages/radix-vue/src/Menu/MenuItem.vue | 14 ++-- packages/radix-vue/src/Menu/MenuItemImpl.vue | 12 +-- .../radix-vue/src/Menu/MenuItemIndicator.vue | 20 +++-- .../radix-vue/src/Menu/MenuRadioGroup.vue | 16 ++-- packages/radix-vue/src/Menu/MenuRadioItem.vue | 16 ++-- packages/radix-vue/src/Menu/MenuRoot.vue | 20 ++--- .../src/Menu/MenuRootContentModal.vue | 11 ++- .../src/Menu/MenuRootContentNonModal.vue | 7 +- packages/radix-vue/src/Menu/MenuSub.vue | 22 +++--- .../radix-vue/src/Menu/MenuSubContent.vue | 33 ++++---- .../radix-vue/src/Menu/MenuSubTrigger.vue | 58 +++++++------- .../radix-vue/src/Menubar/MenubarContent.vue | 30 ++++---- .../radix-vue/src/Menubar/MenubarMenu.vue | 26 +++---- .../radix-vue/src/Menubar/MenubarRoot.vue | 16 ++-- .../src/Menubar/MenubarSubContent.vue | 15 ++-- .../radix-vue/src/Menubar/MenubarTrigger.vue | 34 ++++----- .../src/Pagination/PaginationFirst.vue | 9 +-- .../src/Pagination/PaginationLast.vue | 9 +-- .../src/Pagination/PaginationList.vue | 8 +- .../src/Pagination/PaginationListItem.vue | 12 +-- .../src/Pagination/PaginationNext.vue | 9 +-- .../src/Pagination/PaginationPrev.vue | 9 +-- .../src/Pagination/PaginationRoot.vue | 11 ++- .../radix-vue/src/Popover/PopoverAnchor.vue | 10 +-- .../radix-vue/src/Popover/PopoverClose.vue | 8 +- .../radix-vue/src/Popover/PopoverContent.vue | 9 +-- .../src/Popover/PopoverContentImpl.vue | 11 ++- .../src/Popover/PopoverContentModal.vue | 10 +-- .../src/Popover/PopoverContentNonModal.vue | 10 +-- .../radix-vue/src/Popover/PopoverRoot.vue | 16 ++-- .../radix-vue/src/Popover/PopoverTrigger.vue | 18 ++--- .../radix-vue/src/Popper/PopperAnchor.vue | 8 +- packages/radix-vue/src/Popper/PopperArrow.vue | 32 ++++---- .../radix-vue/src/Popper/PopperContent.vue | 38 +++++----- packages/radix-vue/src/Popper/PopperRoot.vue | 16 ++-- .../src/Progress/ProgressIndicator.vue | 11 ++- .../radix-vue/src/Progress/ProgressRoot.vue | 15 ++-- packages/radix-vue/src/RadioGroup/Radio.vue | 9 +-- .../src/RadioGroup/RadioGroupIndicator.vue | 11 ++- .../src/RadioGroup/RadioGroupItem.vue | 23 +++--- .../src/RadioGroup/RadioGroupRoot.vue | 15 ++-- .../src/RovingFocus/RovingFocusGroup.vue | 13 ++-- .../src/RovingFocus/RovingFocusItem.vue | 28 ++++--- .../src/ScrollArea/ScrollAreaCorner.vue | 10 +-- .../src/ScrollArea/ScrollAreaCornerImpl.vue | 26 +++---- .../src/ScrollArea/ScrollAreaRoot.vue | 75 ++++++++----------- .../src/ScrollArea/ScrollAreaScrollbar.vue | 32 ++++---- .../ScrollArea/ScrollAreaScrollbarAuto.vue | 26 +++---- .../ScrollArea/ScrollAreaScrollbarHover.vue | 12 +-- .../ScrollArea/ScrollAreaScrollbarImpl.vue | 47 ++++++------ .../ScrollArea/ScrollAreaScrollbarScroll.vue | 16 ++-- .../ScrollArea/ScrollAreaScrollbarVisible.vue | 70 ++++++++--------- .../src/ScrollArea/ScrollAreaScrollbarX.vue | 23 +++--- .../src/ScrollArea/ScrollAreaScrollbarY.vue | 23 +++--- .../src/ScrollArea/ScrollAreaThumb.vue | 33 ++++---- .../src/ScrollArea/ScrollAreaViewport.vue | 14 ++-- packages/radix-vue/src/Select/SelectArrow.vue | 11 ++- .../radix-vue/src/Select/SelectContent.vue | 10 +-- .../src/Select/SelectContentImpl.vue | 55 +++++++------- packages/radix-vue/src/Select/SelectGroup.vue | 15 ++-- packages/radix-vue/src/Select/SelectItem.vue | 36 +++++---- .../src/Select/SelectItemAlignedPosition.vue | 48 +++++++----- .../src/Select/SelectItemIndicator.vue | 7 +- .../radix-vue/src/Select/SelectItemText.vue | 37 +++++---- packages/radix-vue/src/Select/SelectLabel.vue | 7 +- .../radix-vue/src/Select/SelectProvider.vue | 8 +- packages/radix-vue/src/Select/SelectRoot.vue | 34 ++++----- .../src/Select/SelectScrollButtonImpl.vue | 8 +- .../src/Select/SelectScrollDownButton.vue | 22 +++--- .../src/Select/SelectScrollUpButton.vue | 22 +++--- .../radix-vue/src/Select/SelectTrigger.vue | 27 ++++--- packages/radix-vue/src/Select/SelectValue.vue | 12 +-- .../radix-vue/src/Select/SelectViewport.vue | 24 ++---- .../radix-vue/src/Slider/SliderHorizontal.vue | 6 +- packages/radix-vue/src/Slider/SliderImpl.vue | 7 +- packages/radix-vue/src/Slider/SliderRange.vue | 20 ++--- packages/radix-vue/src/Slider/SliderRoot.vue | 22 +++--- .../radix-vue/src/Slider/SliderThumbImpl.vue | 36 ++++----- packages/radix-vue/src/Slider/SliderTrack.vue | 9 +-- .../radix-vue/src/Slider/SliderVertical.vue | 6 +- packages/radix-vue/src/Slider/utils.ts | 5 +- packages/radix-vue/src/Switch/SwitchRoot.vue | 15 ++-- packages/radix-vue/src/Switch/SwitchThumb.vue | 10 +-- packages/radix-vue/src/Tabs/TabsContent.vue | 14 ++-- packages/radix-vue/src/Tabs/TabsList.vue | 10 +-- packages/radix-vue/src/Tabs/TabsRoot.vue | 29 +++---- packages/radix-vue/src/Tabs/TabsTrigger.vue | 22 +++--- packages/radix-vue/src/Toggle/ToggleRoot.vue | 10 +-- .../src/ToggleGroup/ToggleGroupItem.vue | 20 ++--- .../src/ToggleGroup/ToggleGroupRoot.vue | 15 ++-- .../radix-vue/src/Toolbar/ToolbarRoot.vue | 15 ++-- .../src/Toolbar/ToolbarSeparator.vue | 7 +- .../src/Toolbar/ToolbarToggleGroup.vue | 9 +-- .../radix-vue/src/Tooltip/TooltipContent.vue | 8 +- .../src/Tooltip/TooltipContentHoverable.vue | 4 +- .../src/Tooltip/TooltipContentImpl.vue | 16 ++-- .../radix-vue/src/Tooltip/TooltipProvider.vue | 4 +- .../radix-vue/src/Tooltip/TooltipRoot.vue | 6 +- .../radix-vue/src/Tooltip/TooltipTrigger.vue | 20 ++--- .../radix-vue/src/shared/createContext.ts | 45 ++++++++--- pnpm-lock.yaml | 1 - 137 files changed, 1202 insertions(+), 1256 deletions(-) diff --git a/packages/radix-vue/src/Accordion/AccordionContent.vue b/packages/radix-vue/src/Accordion/AccordionContent.vue index 467d3e142..556ed4e12 100644 --- a/packages/radix-vue/src/Accordion/AccordionContent.vue +++ b/packages/radix-vue/src/Accordion/AccordionContent.vue @@ -1,29 +1,28 @@