-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(playground): update playground deps
- Loading branch information
Showing
14 changed files
with
4,777 additions
and
4,366 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,43 @@ | ||
<template> | ||
<AvatarRoot | ||
:as="as" | ||
:as-child="asChild" | ||
:class="styles({ class: props.class })" | ||
> | ||
<slot> | ||
<slot name="image"> | ||
<UiAvatarImage | ||
v-if="src" | ||
:src="src" | ||
:alt="alt" | ||
:class="imageClass" | ||
@loading-status-change="emits('loadingStatusChange', $event)" | ||
/> | ||
</slot> | ||
<slot name="fallback"> | ||
<UiAvatarFallback | ||
:delay-ms="delayMs" | ||
:class="fallbackClass" | ||
:fallback="fallback" | ||
/> | ||
</slot> | ||
</slot> | ||
</AvatarRoot> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { AvatarRoot } from "radix-vue"; | ||
import type { AvatarImageEmits, AvatarImageProps, AvatarRootProps } from "radix-vue"; | ||
const props = withDefaults( | ||
defineProps< | ||
AvatarRootProps & | ||
Partial<AvatarImageProps> & { | ||
class?: any; | ||
imageClass?: any; | ||
fallbackClass?: any; | ||
alt?: string; | ||
fallback?: string; | ||
delayMs?: number; | ||
} | ||
>(), | ||
{} | ||
); | ||
const emits = defineEmits<AvatarImageEmits>(); | ||
const styles = tv({ | ||
base: "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", | ||
}); | ||
</script> | ||
<template> | ||
<AvatarRoot :as="as" :as-child="asChild" :class="styles({ class: props.class })"> | ||
<slot> | ||
<slot name="image"> | ||
<UiAvatarImage | ||
v-if="src" | ||
:src="src" | ||
:alt="alt" | ||
:class="imageClass" | ||
@loading-status-change="emits('loadingStatusChange', $event)" | ||
/> | ||
</slot> | ||
<slot name="fallback"> | ||
<UiAvatarFallback :delay-ms="delayMs" :class="fallbackClass" :fallback="fallback" /> | ||
</slot> | ||
</slot> | ||
</AvatarRoot> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { AvatarRoot } from "radix-vue"; | ||
import type { AvatarImageEmits, AvatarImageProps, AvatarRootProps } from "radix-vue"; | ||
const props = withDefaults( | ||
defineProps< | ||
AvatarRootProps & | ||
Partial<AvatarImageProps> & { | ||
class?: any; | ||
imageClass?: any; | ||
fallbackClass?: any; | ||
alt?: string; | ||
fallback?: string; | ||
delayMs?: number; | ||
} | ||
>(), | ||
{} | ||
); | ||
const emits = defineEmits<AvatarImageEmits>(); | ||
const styles = tv({ | ||
base: "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
<template> | ||
<AvatarFallback | ||
:class="styles({ class: props.class })" | ||
v-bind="reactiveOmit(props, 'class', 'fallback')" | ||
> | ||
<slot> | ||
{{ fallback }} | ||
</slot> | ||
</AvatarFallback> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { AvatarFallback } from "radix-vue"; | ||
import type { AvatarFallbackProps } from "radix-vue"; | ||
const props = defineProps< | ||
AvatarFallbackProps & { | ||
/** The text to display inside th eavatar */ | ||
fallback?: string; | ||
/** Custom class(es) to add to the element */ | ||
class?: any; | ||
} | ||
>(); | ||
const styles = tv({ | ||
base: "flex h-full w-full items-center justify-center rounded-full bg-muted font-medium", | ||
}); | ||
</script> | ||
<template> | ||
<AvatarFallback | ||
:class="styles({ class: props.class })" | ||
v-bind="reactiveOmit(props, 'class', 'fallback')" | ||
> | ||
<slot> | ||
{{ fallback }} | ||
</slot> | ||
</AvatarFallback> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { AvatarFallback } from "radix-vue"; | ||
import type { AvatarFallbackProps } from "radix-vue"; | ||
const props = defineProps< | ||
AvatarFallbackProps & { | ||
/** The text to display inside th eavatar */ | ||
fallback?: string; | ||
/** Custom class(es) to add to the element */ | ||
class?: any; | ||
} | ||
>(); | ||
const styles = tv({ | ||
base: "flex h-full w-full items-center justify-center rounded-full bg-muted font-medium", | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,22 @@ | ||
<template> | ||
<AvatarImage | ||
v-bind="reactiveOmit(props, 'class')" | ||
:class="styles({ class: props.class })" | ||
/> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { AvatarImage } from "radix-vue"; | ||
import type { AvatarImageEmits, AvatarImageProps } from "radix-vue"; | ||
const props = defineProps< | ||
AvatarImageProps & { | ||
/** The alt text for the image */ | ||
alt?: string; | ||
/** Custom class(es) to add to the element */ | ||
class?: any; | ||
} | ||
>(); | ||
const emits = defineEmits<AvatarImageEmits>(); | ||
const styles = tv({ | ||
base: "aspect-square h-full w-full object-cover", | ||
}); | ||
</script> | ||
<template> | ||
<AvatarImage v-bind="reactiveOmit(props, 'class')" :class="styles({ class: props.class })" /> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { AvatarImage } from "radix-vue"; | ||
import type { AvatarImageEmits, AvatarImageProps } from "radix-vue"; | ||
const props = defineProps< | ||
AvatarImageProps & { | ||
/** The alt text for the image */ | ||
alt?: string; | ||
/** Custom class(es) to add to the element */ | ||
class?: any; | ||
} | ||
>(); | ||
const emits = defineEmits<AvatarImageEmits>(); | ||
const styles = tv({ | ||
base: "aspect-square h-full w-full object-cover", | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,50 @@ | ||
<template> | ||
<component | ||
:is="elementType" | ||
:class=" | ||
buttonStyles({ | ||
disabled: disabled || loading, | ||
variant: variant, | ||
size: size, | ||
class: props.class, | ||
}) | ||
" | ||
:disabled="disabled || loading" | ||
:to="to" | ||
:href="href" | ||
:type="type" | ||
@click="onClick" | ||
> | ||
<slot>{{ label }}</slot> | ||
</component> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import type { RouteLocationRaw } from "vue-router"; | ||
type ButtonProps = VariantProps<typeof buttonStyles>; | ||
const props = withDefaults( | ||
defineProps<{ | ||
type?: "button" | "submit" | "reset"; | ||
disabled?: boolean; | ||
loading?: boolean; | ||
onClick?: any; | ||
to?: string | RouteLocationRaw; | ||
href?: string; | ||
as?: string; | ||
class?: any; | ||
variant?: ButtonProps["variant"]; | ||
size?: ButtonProps["size"]; | ||
label?: string; | ||
}>(), | ||
{ | ||
type: "button", | ||
} | ||
); | ||
const elementType = computed(() => { | ||
if (props.as) return props.as; | ||
if (props.href || props.to) return resolveComponent("NuxtLink"); | ||
return "button"; | ||
}); | ||
</script> | ||
<template> | ||
<component | ||
:is="elementType" | ||
:class=" | ||
buttonStyles({ | ||
disabled: disabled || loading, | ||
variant: variant, | ||
size: size, | ||
class: props.class, | ||
}) | ||
" | ||
:disabled="disabled || loading" | ||
:to="to" | ||
:href="href" | ||
:type="type" | ||
@click="onClick" | ||
> | ||
<slot>{{ label }}</slot> | ||
</component> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import type { RouteLocationRaw } from "vue-router"; | ||
type ButtonProps = VariantProps<typeof buttonStyles>; | ||
const props = withDefaults( | ||
defineProps<{ | ||
type?: "button" | "submit" | "reset"; | ||
disabled?: boolean; | ||
loading?: boolean; | ||
onClick?: any; | ||
to?: string | RouteLocationRaw; | ||
href?: string; | ||
as?: string; | ||
class?: any; | ||
variant?: ButtonProps["variant"]; | ||
size?: ButtonProps["size"]; | ||
label?: string; | ||
}>(), | ||
{ | ||
type: "button", | ||
} | ||
); | ||
const elementType = computed(() => { | ||
if (props.as) return props.as; | ||
if (props.href || props.to) return resolveComponent("NuxtLink"); | ||
return "button"; | ||
}); | ||
</script> |
Oops, something went wrong.