Skip to content

Commit

Permalink
chore: update to newest components
Browse files Browse the repository at this point in the history
  • Loading branch information
BayBreezy committed Aug 18, 2024
1 parent ff944c4 commit 563a1d3
Show file tree
Hide file tree
Showing 131 changed files with 498 additions and 329 deletions.
9 changes: 5 additions & 4 deletions app/components/Ui/Accordion/Content.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<template>
<AccordionContent
v-bind="reactiveOmit(props, 'content', 'class')"
:class="styles({ class: props.class })"
>
<AccordionContent v-bind="forwarded" :class="styles({ class: props.class })">
<div class="pb-4 pt-0">
<slot>{{ content }}</slot>
</div>
Expand All @@ -15,11 +12,15 @@
const props = defineProps<
AccordionContentProps & {
/** Custom class(es) to add to the parent */
class?: any;
/** The content of the accordion */
content?: any;
}
>();
const forwarded = reactiveOmit(props, "class", "content");
const styles = tv({
base: "overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
});
Expand Down
4 changes: 3 additions & 1 deletion app/components/Ui/Accordion/Header.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<AccordionHeader v-bind="reactiveOmit(props, 'class')" :class="styles({ class: props.class })">
<AccordionHeader v-bind="forwarded" :class="styles({ class: props.class })">
<slot />
</AccordionHeader>
</template>
Expand All @@ -14,6 +14,8 @@
}
>();
const forwarded = reactiveOmit(props, "class");
const styles = tv({
base: "flex",
});
Expand Down
9 changes: 4 additions & 5 deletions app/components/Ui/Accordion/Item.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<template>
<AccordionItem
v-slot="slotProps"
v-bind="reactiveOmit(props, 'class')"
:class="styles({ class: props.class })"
>
<AccordionItem v-slot="slotProps" v-bind="forwarded" :class="styles({ class: props.class })">
<slot v-bind="slotProps" />
</AccordionItem>
</template>
Expand All @@ -14,10 +10,13 @@
const props = defineProps<
AccordionItemProps & {
/** Custom class(es) to add to the parent */
class?: any;
}
>();
const forwarded = reactiveOmit(props, "class");
const styles = tv({
base: "border-b",
});
Expand Down
10 changes: 6 additions & 4 deletions app/components/Ui/Accordion/Trigger.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<template>
<AccordionTrigger
v-bind="reactiveOmit(props, 'class', 'icon', 'title')"
:class="styles({ class: props.class })"
>
<AccordionTrigger v-bind="forwarded" :class="styles({ class: props.class })">
<slot :props="props">
{{ title }}
</slot>
Expand All @@ -19,8 +16,11 @@
const props = withDefaults(
defineProps<
AccordionTriggerProps & {
/** Custom class(es) to add to the parent */
class?: any;
/** The title of the accordion trigger */
title?: string;
/** The icon to show next to the title */
icon?: string;
}
>(),
Expand All @@ -31,6 +31,8 @@
}
);
const forwarded = reactiveOmit(props, "class", "icon", "title");
const styles = tv({
base: "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline focus-visible:rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background [&[data-state=open]>svg]:rotate-180",
});
Expand Down
7 changes: 3 additions & 4 deletions app/components/Ui/Alert/Description.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<template>
<Primitive
v-bind="reactiveOmit(props, 'description', 'class')"
:class="styles({ class: props.class })"
>
<Primitive v-bind="forwarded" :class="styles({ class: props.class })">
<slot>{{ description }}</slot>
</Primitive>
</template>
Expand All @@ -23,6 +20,8 @@
{ as: "div", class: undefined, description: undefined }
);
const forwarded = reactiveOmit(props, "class", "description");
const styles = tv({
base: "text-sm [&_p]:leading-relaxed",
});
Expand Down
4 changes: 3 additions & 1 deletion app/components/Ui/Alert/Title.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<Primitive v-bind="reactiveOmit(props, 'class', 'title')" :class="styles({ class: props.class })">
<Primitive v-bind="forwarded" :class="styles({ class: props.class })">
<slot>{{ title }}</slot>
</Primitive>
</template>
Expand All @@ -20,6 +20,8 @@
{ as: "h5", class: undefined, title: undefined }
);
const forwarded = reactiveOmit(props, "class", "title");
const styles = tv({
base: "mb-1 font-medium leading-none tracking-tight",
});
Expand Down
4 changes: 3 additions & 1 deletion app/components/Ui/AlertDialog/Action.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<AlertDialogAction
v-bind="reactiveOmit(props, 'class', 'text', 'variant', 'size')"
v-bind="forwarded"
:class="buttonStyles({ variant, size, disabled, class: props.class })"
>
<slot>{{ text }} </slot>
Expand Down Expand Up @@ -36,4 +36,6 @@
onClick: undefined,
}
);
const forwarded = reactiveOmit(props, "class", "text", "variant", "size");
</script>
4 changes: 3 additions & 1 deletion app/components/Ui/AlertDialog/Cancel.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<AlertDialogCancel
v-bind="reactiveOmit(props, 'class', 'text', 'variant', 'size')"
v-bind="forwarded"
:class="buttonStyles({ variant, size, disabled, class: props.class })"
>
<slot>{{ text }}</slot>
Expand Down Expand Up @@ -36,4 +36,6 @@
onClick: undefined,
}
);
const forwarded = reactiveOmit(props, "class", "text", "variant", "size");
</script>
7 changes: 3 additions & 4 deletions app/components/Ui/AlertDialog/Description.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<template>
<AlertDialogDescription
v-bind="reactiveOmit(props, 'class', 'description')"
:class="styles({ class: props.class })"
>
<AlertDialogDescription v-bind="forwarded" :class="styles({ class: props.class })">
<slot>{{ description }}</slot>
</AlertDialogDescription>
</template>
Expand All @@ -20,6 +17,8 @@
}
>();
const forwarded = reactiveOmit(props, "class", "description");
const styles = tv({
base: "text-sm text-muted-foreground",
});
Expand Down
4 changes: 3 additions & 1 deletion app/components/Ui/AlertDialog/Footer.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<Primitive :class="styles({ class: props.class })" v-bind="reactiveOmit(props, 'class')">
<Primitive :class="styles({ class: props.class })" v-bind="forwarded">
<slot />
</Primitive>
</template>
Expand All @@ -20,6 +20,8 @@
class: undefined,
}
);
const forwarded = reactiveOmit(props, "class");
const styles = tv({
base: "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
});
Expand Down
4 changes: 2 additions & 2 deletions app/components/Ui/AlertDialog/Header.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<Primitive :class="styles({ class: props.class })" v-bind="reactiveOmit(props, 'class')">
<Primitive :class="styles({ class: props.class })" v-bind="forwarded">
<slot />
</Primitive>
</template>
Expand All @@ -20,7 +20,7 @@
class: undefined,
}
);
const forwarded = reactiveOmit(props, "class");
const styles = tv({
base: "flex flex-col gap-2 text-center sm:text-left",
});
Expand Down
7 changes: 2 additions & 5 deletions app/components/Ui/AlertDialog/Overlay.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<template>
<AlertDialogOverlay
v-bind="reactiveOmit(props, 'class')"
:class="styles({ class: props.class })"
/>
<AlertDialogOverlay v-bind="forwarded" :class="styles({ class: props.class })" />
</template>

<script lang="ts" setup>
Expand All @@ -15,7 +12,7 @@
class?: any;
}
>();
const forwarded = reactiveOmit(props, "class");
const styles = tv({
base: "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=closed]:animate-fadeOut data-[state=open]:animate-fadeIn",
});
Expand Down
4 changes: 2 additions & 2 deletions app/components/Ui/AlertDialog/Title.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<AlertDialogTitle v-bind="reactiveOmit(props, 'class')" :class="styles({ class: props.class })">
<AlertDialogTitle v-bind="forwarded" :class="styles({ class: props.class })">
<slot>{{ title }}</slot>
</AlertDialogTitle>
</template>
Expand All @@ -16,7 +16,7 @@
class?: any;
}
>();
const forwarded = reactiveOmit(props, "class", "title");
const styles = tv({
base: "text-lg font-semibold",
});
Expand Down
4 changes: 2 additions & 2 deletions app/components/Ui/Autocomplete/Trigger.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<ComboboxTrigger v-bind="reactiveOmit(props, 'class')" :class="styles({ class: props.class })">
<ComboboxTrigger v-bind="forwarded" :class="styles({ class: props.class })">
<slot />
</ComboboxTrigger>
</template>
Expand All @@ -13,7 +13,7 @@
class?: any;
}
>();
const forwarded = reactiveOmit(props, "class");
const styles = tv({
base: "inline-flex shrink-0 cursor-pointer items-center justify-center",
});
Expand Down
6 changes: 2 additions & 4 deletions app/components/Ui/Avatar/Fallback.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<template>
<AvatarFallback
:class="styles({ class: props.class })"
v-bind="reactiveOmit(props, 'class', 'fallback')"
>
<AvatarFallback :class="styles({ class: props.class })" v-bind="forwarded">
<slot>
{{ fallback }}
</slot>
Expand All @@ -21,6 +18,7 @@
class?: any;
}
>();
const forwarded = reactiveOmit(props, "class", "fallback");
const styles = tv({
base: "flex h-full w-full items-center justify-center rounded-full bg-muted font-medium",
});
Expand Down
2 changes: 1 addition & 1 deletion app/components/Ui/Breadcrumbs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
icon?: string;
link?: string;
disabled?: boolean;
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
click?: Function;
}
const props = withDefaults(
Expand Down
7 changes: 2 additions & 5 deletions app/components/Ui/Checkbox/Indicator.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<template>
<CheckboxIndicator
:class="styles({ class: props.class })"
v-bind="reactiveOmit(props, 'class', 'icon')"
>
<CheckboxIndicator :class="styles({ class: props.class })" v-bind="forwarded">
<slot>
<Icon :name="checked == 'indeterminate' ? 'lucide:minus' : icon" class="h-4 w-4" />
</slot>
Expand Down Expand Up @@ -31,7 +28,7 @@
icon: "lucide:check",
}
);
const forwarded = reactiveOmit(props, "class", "icon");
const styles = tv({
base: "flex items-center justify-center text-current",
});
Expand Down
4 changes: 2 additions & 2 deletions app/components/Ui/Collapsible/Content.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<CollapsibleContent :class="styles({ class: props.class })" v-bind="reactiveOmit(props, 'class')">
<CollapsibleContent :class="styles({ class: props.class })" v-bind="forwarded">
<slot />
</CollapsibleContent>
</template>
Expand All @@ -14,7 +14,7 @@
class?: any;
}
>();
const forwarded = reactiveOmit(props, "class");
const styles = tv({
base: "overflow-hidden transition will-change-auto data-[state=closed]:animate-collapse-up data-[state=open]:animate-collapse-down",
});
Expand Down
4 changes: 2 additions & 2 deletions app/components/Ui/Command/Cancel.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<ComboboxCancel v-bind="reactiveOmit(props, 'class')" :class="styles({ class: props.class })">
<ComboboxCancel v-bind="forwarded" :class="styles({ class: props.class })">
<slot>
<Icon name="lucide:x" class="h-4 w-4 text-muted-foreground/70" />
</slot>
Expand All @@ -11,7 +11,7 @@
import type { ComboboxCancelProps } from "radix-vue";
const props = defineProps<ComboboxCancelProps & { class?: any }>();
const forwarded = reactiveOmit(props, "class");
const styles = tv({
base: "flex items-center justify-center",
});
Expand Down
4 changes: 2 additions & 2 deletions app/components/Ui/Command/Empty.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<ComboboxEmpty :class="styles({ class: props.class })" v-bind="reactiveOmit(props, 'class')">
<ComboboxEmpty :class="styles({ class: props.class })" v-bind="forwarded">
<slot />
</ComboboxEmpty>
</template>
Expand All @@ -14,7 +14,7 @@
class?: any;
}
>();
const forwarded = reactiveOmit(props, "class");
const styles = tv({
base: "py-6 text-center text-sm",
});
Expand Down
7 changes: 2 additions & 5 deletions app/components/Ui/Command/Group.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<template>
<ComboboxGroup
:class="styles({ class: props.class })"
v-bind="reactiveOmit(props, 'class', 'heading')"
>
<ComboboxGroup :class="styles({ class: props.class })" v-bind="forwarded">
<slot name="heading">
<UiCommandLabel v-if="heading" :label="heading" />
</slot>
Expand All @@ -22,7 +19,7 @@
class?: any;
}
>();
const forwarded = reactiveOmit(props, "class", "heading");
const styles = tv({
base: "overflow-hidden p-1 text-foreground",
});
Expand Down
2 changes: 1 addition & 1 deletion app/components/Ui/Command/Input.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="flex items-center border-b px-3" cmdk-input-wrapper="">
<div class="flex items-center border-b px-3">
<Icon :name="icon || 'lucide:search'" class="mr-2 h-4 w-4 shrink-0 opacity-50" />
<ComboboxInput
v-bind="$attrs"
Expand Down
Loading

0 comments on commit 563a1d3

Please sign in to comment.