Skip to content

Commit

Permalink
chore: update styles on dialog components
Browse files Browse the repository at this point in the history
  • Loading branch information
BayBreezy committed Dec 13, 2024
1 parent e11329a commit 38f199a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/comps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -833,13 +833,13 @@ export default [
fileName: "Dialog/Content.vue",
dirPath: "components/UI",
fileContent:
'<template>\n <UiDialogPortal :to="to">\n <UiDialogOverlay />\n <DialogContent :class="styles({ class: props.class })" v-bind="{ ...forwarded, ...$attrs }">\n <slot>\n <slot name="header">\n <UiDialogHeader>\n <slot name="title">\n <UiDialogTitle v-if="title" :title="title" />\n </slot>\n <slot name="description">\n <UiDialogDescription v-if="description" :description="description" />\n </slot>\n </UiDialogHeader>\n </slot>\n <slot name="content" />\n <slot name="footer" />\n </slot>\n <slot name="close" />\n <UiDialogClose\n v-if="!hideClose"\n class="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"\n >\n <Icon name="lucide:x" class="h-4 w-4" mode="svg" />\n <span class="sr-only">Close</span>\n </UiDialogClose>\n </DialogContent>\n </UiDialogPortal>\n</template>\n\n<script lang="ts" setup>\n import { DialogContent, useForwardPropsEmits } from "radix-vue";\n import type { DialogContentEmits, DialogContentProps } from "radix-vue";\n\n defineOptions({ inheritAttrs: false });\n const props = defineProps<\n DialogContentProps & {\n /** Icon to display in the close button */\n icon?: string;\n /** Title text */\n title?: string;\n /** Description text */\n description?: string;\n /** Custom class(es) to add to the parent */\n class?: any;\n /** Whether to hide the close button */\n hideClose?: boolean;\n /** Where to render the dialog */\n to?: string | HTMLElement;\n }\n >();\n const emits = defineEmits<DialogContentEmits>();\n const forwarded = useForwardPropsEmits(\n reactiveOmit(props, "icon", "title", "description", "class", "hideClose", "to"),\n emits\n );\n\n const styles = tv({\n base: "fixed left-[50%] top-[50%] z-50 grid max-h-[calc(100%-4rem)] w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",\n });\n</script>\n',
'<template>\n <UiDialogPortal :to="to">\n <UiDialogOverlay />\n <DialogContent :class="styles({ class: props.class })" v-bind="{ ...forwarded, ...$attrs }">\n <slot>\n <slot name="header">\n <UiDialogHeader>\n <slot name="title">\n <UiDialogTitle v-if="title" :title="title" />\n </slot>\n <slot name="description">\n <UiDialogDescription v-if="description" :description="description" />\n </slot>\n </UiDialogHeader>\n </slot>\n <slot name="content" />\n <slot name="footer" />\n </slot>\n <slot name="close" />\n <UiDialogClose\n v-if="!hideClose"\n class="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"\n >\n <Icon name="lucide:x" class="h-4 w-4" mode="svg" />\n <span class="sr-only">Close</span>\n </UiDialogClose>\n </DialogContent>\n </UiDialogPortal>\n</template>\n\n<script lang="ts" setup>\n import { DialogContent, useForwardPropsEmits } from "radix-vue";\n import type { DialogContentEmits, DialogContentProps } from "radix-vue";\n\n defineOptions({ inheritAttrs: false });\n const props = defineProps<\n DialogContentProps & {\n /** Icon to display in the close button */\n icon?: string;\n /** Title text */\n title?: string;\n /** Description text */\n description?: string;\n /** Custom class(es) to add to the parent */\n class?: any;\n /** Whether to hide the close button */\n hideClose?: boolean;\n /** Where to render the dialog */\n to?: string | HTMLElement;\n }\n >();\n const emits = defineEmits<DialogContentEmits>();\n const forwarded = useForwardPropsEmits(\n reactiveOmit(props, "icon", "title", "description", "class", "hideClose", "to"),\n emits\n );\n\n const styles = tv({\n base: "fixed left-[50%] top-[50%] z-50 grid max-h-[calc(100%-4rem)] w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 overflow-y-auto border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",\n });\n</script>\n',
},
{
fileName: "Dialog/Description.vue",
dirPath: "components/UI",
fileContent:
'<template>\n <DialogDescription :class="styles({ class: props.class })" v-bind="forwarded">\n <slot>{{ description }}</slot>\n </DialogDescription>\n</template>\n\n<script lang="ts" setup>\n import { DialogDescription } from "radix-vue";\n import type { DialogDescriptionProps } from "radix-vue";\n\n const props = defineProps<\n DialogDescriptionProps & {\n /** Custom class(es) to add to the parent */\n class?: any;\n /** The description text */\n description?: string;\n }\n >();\n const forwarded = reactiveOmit(props, "class", "description");\n const styles = tv({\n base: "text-sm text-muted-foreground",\n });\n</script>\n',
'<template>\n <DialogDescription :class="styles({ class: props.class })" v-bind="forwarded">\n <slot>{{ description }}</slot>\n </DialogDescription>\n</template>\n\n<script lang="ts" setup>\n import { DialogDescription } from "radix-vue";\n import type { DialogDescriptionProps } from "radix-vue";\n\n const props = defineProps<\n DialogDescriptionProps & {\n /** Custom class(es) to add to the parent */\n class?: any;\n /** The description text */\n description?: string;\n }\n >();\n const forwarded = reactiveOmit(props, "class", "description");\n const styles = tv({\n base: "text-base text-muted-foreground md:text-sm",\n });\n</script>\n',
},
{
fileName: "Dialog/Dialog.vue",
Expand Down Expand Up @@ -875,7 +875,7 @@ export default [
fileName: "Dialog/Title.vue",
dirPath: "components/UI",
fileContent:
'<template>\n <DialogTitle :class="styles({ class: props.class })" v-bind="forwarded">\n <slot>{{ title }}</slot>\n </DialogTitle>\n</template>\n\n<script lang="ts" setup>\n import { DialogTitle } from "radix-vue";\n import type { DialogTitleProps } from "radix-vue";\n\n const props = defineProps<\n DialogTitleProps & {\n /** Custom class(es) to add to the parent */\n class?: any;\n /** The title text */\n title?: string;\n }\n >();\n const forwarded = reactiveOmit(props, "class", "title");\n const styles = tv({\n base: "text-lg font-semibold leading-none tracking-tight",\n });\n</script>\n',
'<template>\n <DialogTitle :class="styles({ class: props.class })" v-bind="forwarded">\n <slot>{{ title }}</slot>\n </DialogTitle>\n</template>\n\n<script lang="ts" setup>\n import { DialogTitle } from "radix-vue";\n import type { DialogTitleProps } from "radix-vue";\n\n const props = defineProps<\n DialogTitleProps & {\n /** Custom class(es) to add to the parent */\n class?: any;\n /** The title text */\n title?: string;\n }\n >();\n const forwarded = reactiveOmit(props, "class", "title");\n const styles = tv({\n base: "text-xl font-semibold leading-none tracking-tight md:text-lg",\n });\n</script>\n',
},
{
fileName: "Dialog/Trigger.vue",
Expand Down

0 comments on commit 38f199a

Please sign in to comment.