Skip to content

Commit

Permalink
chore(playground): update playground deps
Browse files Browse the repository at this point in the history
  • Loading branch information
BayBreezy committed Mar 17, 2024
1 parent 2771259 commit de573b8
Show file tree
Hide file tree
Showing 14 changed files with 4,777 additions and 4,366 deletions.
2,116 changes: 1,369 additions & 747 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,21 @@
"test:watch": "vitest watch"
},
"dependencies": {
"@nuxt/kit": "^3.10.3",
"pdfmake": "^0.2.9"
"@nuxt/kit": "^3.11.0",
"pdfmake": "^0.2.10"
},
"devDependencies": {
"@nuxt/devtools": "^1.0.8",
"@nuxt/eslint-config": "^0.2.0",
"@nuxt/module-builder": "^0.5.5",
"@nuxt/schema": "^3.10.3",
"@nuxt/test-utils": "^3.11.0",
"@types/node": "^20.11.20",
"@nuxt/schema": "^3.11.0",
"@nuxt/test-utils": "^3.12.0",
"@types/node": "^20.11.28",
"@types/pdfmake": "^0.2.9",
"changelogen": "^0.5.5",
"eslint": "^8.57.0",
"nuxt": "^3.10.3",
"postcss-custom-properties": "^13.3.5",
"vitest": "^1.3.1"
"nuxt": "^3.11.0",
"postcss-custom-properties": "^13.3.6",
"vitest": "^1.4.0"
}
}
}
37 changes: 7 additions & 30 deletions playground/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,27 @@
<div>
<UiNavbar sticky>
<UiContainer class="flex h-14 items-center justify-between">
<p class="font-semibold">
Nuxt PDFMake
</p>
<UiButton
size="icon-sm"
variant="ghost"
@click="toggleMode"
>
<icon
class="size-5"
name="lucide:sun-medium"
/>
<p class="font-semibold">Nuxt PDFMake</p>
<UiButton size="icon-sm" variant="ghost" @click="toggleMode">
<icon class="size-5" name="lucide:sun-medium" />
</UiButton>
</UiContainer>
</UiNavbar>
<UiContainer class="py-5">
<div>
<p class="text-lg font-medium">
Open in new window
</p>
<p class="text-lg font-medium">Open in new window</p>
<p class="mb-4 mt-1 text-muted-foreground">
Click the button below to open the pdf table in a new window
</p>
<UiButton
size="sm"
variant="outline"
label="Print table"
@click="exportData"
/>
<UiButton size="sm" variant="outline" label="Print table" @click="exportData" />
<UiDivider class="my-6" />
</div>
<div>
<p class="text-lg font-medium">
Column example
</p>
<p class="text-lg font-medium">Column example</p>
<p class="mb-4 mt-1 text-muted-foreground">
Here we use the composable to export a column example. The font was also updated
</p>
<UiButton
size="sm"
variant="outline"
label="Print article"
@click="exportComposable"
/>
<UiButton size="sm" variant="outline" label="Print article" @click="exportComposable" />
</div>
</UiContainer>
</div>
Expand Down
94 changes: 43 additions & 51 deletions playground/components/Ui/Avatar/Avatar.vue
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>
54 changes: 27 additions & 27 deletions playground/components/Ui/Avatar/Fallback.vue
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>
47 changes: 22 additions & 25 deletions playground/components/Ui/Avatar/Image.vue
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>
100 changes: 50 additions & 50 deletions playground/components/Ui/Button.vue
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>

0 comments on commit de573b8

Please sign in to comment.