diff --git a/apps/www/.vitepress/config.mts b/apps/www/.vitepress/config.mts index 48579d2bb..b6cf67bdf 100644 --- a/apps/www/.vitepress/config.mts +++ b/apps/www/.vitepress/config.mts @@ -3,9 +3,9 @@ import { defineConfig } from 'vitepress' import Icons from 'unplugin-icons/vite' import tailwind from 'tailwindcss' import autoprefixer from 'autoprefixer' -import { createCssVariablesTheme } from 'shikiji' +import { createCssVariablesTheme } from 'shiki' -// import { transformerMetaWordHighlight } from 'shikiji-transformers' +// import { transformerMetaWordHighlight, transformerNotationWordHighlight } from '@shikijs/transformers' import { siteConfig } from './theme/config/site' import ComponentPreviewPlugin from './theme/plugins/previewer' @@ -61,6 +61,7 @@ export default defineConfig({ theme: cssVariables, codeTransformers: [ // transformerMetaWordHighlight(), + // transformerNotationWordHighlight(), ], config(md) { md.use(ComponentPreviewPlugin) @@ -86,8 +87,5 @@ export default defineConfig({ '@': path.resolve(__dirname, '../src'), }, }, - ssr: { - noExternal: ['vue-sonner'], - }, }, }) diff --git a/apps/www/.vitepress/theme/layout/DocsLayout.vue b/apps/www/.vitepress/theme/layout/DocsLayout.vue index 388301e0d..1ab121425 100644 --- a/apps/www/.vitepress/theme/layout/DocsLayout.vue +++ b/apps/www/.vitepress/theme/layout/DocsLayout.vue @@ -46,9 +46,9 @@ const sourceLink = 'https://github.com/radix-vue/shadcn-vue/tree/dev/' > {{ doc.title }} - + {{ doc.label }} - + diff --git a/apps/www/.vitepress/theme/layout/MainLayout.vue b/apps/www/.vitepress/theme/layout/MainLayout.vue index 3caf425db..946f26bb4 100644 --- a/apps/www/.vitepress/theme/layout/MainLayout.vue +++ b/apps/www/.vitepress/theme/layout/MainLayout.vue @@ -288,7 +288,9 @@ watch(() => $route.path, (n) => { - + + + diff --git a/apps/www/.vitepress/theme/styles/shiki.css b/apps/www/.vitepress/theme/styles/shiki.css index 9c0d7eda5..db0028290 100644 --- a/apps/www/.vitepress/theme/styles/shiki.css +++ b/apps/www/.vitepress/theme/styles/shiki.css @@ -10,4 +10,11 @@ --shiki-token-string-expression: #ebebeb; --shiki-token-punctuation: #ffffff; --shiki-token-link: #EE0000; +} + +.shiki .highlighted-word { + border-radius: calc(var(--radius) - 2px); + border-color: rgba(63,63,70,.7); + background-color: rgba(63,63,70,.5); + padding: 0.25rem; } \ No newline at end of file diff --git a/apps/www/package.json b/apps/www/package.json index 186171f7e..b4cbca680 100644 --- a/apps/www/package.json +++ b/apps/www/package.json @@ -19,25 +19,25 @@ "@morev/vue-transitions": "^2.3.6", "@radix-icons/vue": "^1.0.0", "@stackblitz/sdk": "^1.9.0", - "@tanstack/vue-table": "^8.11.7", - "@unovis/ts": "^1.3.1", - "@unovis/vue": "^1.3.1", - "@vee-validate/zod": "^4.12.4", + "@tanstack/vue-table": "^8.11.8", + "@unovis/ts": "^1.3.3", + "@unovis/vue": "^1.3.3", + "@vee-validate/zod": "^4.12.5", "@vueuse/core": "^10.7.2", "class-variance-authority": "^0.7.0", "clsx": "^2.1.0", "codesandbox": "^2.2.3", "date-fns": "^2.30.0", - "embla-carousel": "8.0.0-rc19", - "embla-carousel-autoplay": "8.0.0-rc19", - "embla-carousel-vue": "8.0.0-rc19", + "embla-carousel": "^8.0.0-rc22", + "embla-carousel-autoplay": "^8.0.0-rc22", + "embla-carousel-vue": "^8.0.0-rc22", "lucide-vue-next": "^0.276.0", - "radix-vue": "^1.3.2", + "radix-vue": "^1.4.0", "tailwindcss-animate": "^1.0.7", "v-calendar": "^3.1.2", - "vee-validate": "4.12.4", + "vee-validate": "4.12.5", "vue": "^3.4.15", - "vue-sonner": "^1.0.2", + "vue-sonner": "^1.0.3", "vue-wrap-balancer": "^1.1.3", "zod": "^3.22.4" }, @@ -46,26 +46,26 @@ "@iconify-json/tabler": "^1.1.89", "@iconify/json": "^2.2.108", "@iconify/vue": "^4.1.1", + "@shikijs/transformers": "^1.0.0-beta.3", "@types/lodash.template": "^4.5.2", "@types/node": "^20.8.10", "@vitejs/plugin-vue": "^5.0.3", "@vitejs/plugin-vue-jsx": "^3.1.0", - "@vue/compiler-core": "^3.4.14", - "@vue/compiler-dom": "^3.4.14", + "@vue/compiler-core": "^3.4.15", + "@vue/compiler-dom": "^3.4.15", "@vue/tsconfig": "^0.5.1", - "autoprefixer": "^10.4.16", + "autoprefixer": "^10.4.17", "lodash.template": "^4.5.0", "pathe": "^1.1.2", "rimraf": "^5.0.5", - "shikiji": "^0.10.0-beta.9", - "shikiji-transformers": "^0.10.0-beta.9", - "tailwind-merge": "^2.2.0", + "shiki": "^1.0.0-beta.3", + "tailwind-merge": "^2.2.1", "tailwindcss": "^3.4.1", "tsx": "^4.7.0", "typescript": "^5.3.3", - "unplugin-icons": "^0.17.1", + "unplugin-icons": "^0.18.3", "vite": "^5.0.12", - "vitepress": "^1.0.0-rc.39", + "vitepress": "^1.0.0-rc.41", "vue-tsc": "^1.8.27" } } diff --git a/apps/www/src/content/docs/components/data-table.md b/apps/www/src/content/docs/components/data-table.md index e479e4de3..1e8c7b3ce 100644 --- a/apps/www/src/content/docs/components/data-table.md +++ b/apps/www/src/content/docs/components/data-table.md @@ -25,7 +25,7 @@ We'll start with the basic `` component and build a complex data table ## Table of Contents -This guide will show you how to use [TanStack Table](https://tanstack.com/table/v8) and the
component to build your own custom data table. We'll cover the following topics: +This guide will show you how to use [TanStack Table](https://tanstack.com/table/v8) and the `
` component to build your own custom data table. We'll cover the following topics: - [Basic Table](#basic-table) - [Row Actions](#row-actions) @@ -109,31 +109,23 @@ Let's start by building a basic table. First, we'll define our columns in the `columns.ts` file. -```ts:line-numbers title="components/payments/columns.ts" {1,12-27} -import type { ColumnDef } from '@tanstack/vue-table' - -// This type is used to define the shape of our data. -// You can use a Zod schema here if you want. -export interface Payment { - id: string - amount: number - status: 'pending' | 'processing' | 'success' | 'failed' - email: string -} +```ts:line-numbers {1,12-27} +import { h } from 'vue' export const columns: ColumnDef[] = [ - { - accessorKey: 'status', - header: 'Status', - }, - { - accessorKey: 'email', - header: 'Email', - }, { accessorKey: 'amount', - header: 'Amount', - }, + header: () => h('div', { class: 'text-right' }, 'Amount'), + cell: ({ row }) => { + const amount = Number.parseFloat(row.getValue('amount')) + const formatted = new Intl.NumberFormat('en-US', { + style: 'currency', + currency: 'USD', + }).format(amount) + + return h('div', { class: 'text-right font-medium' }, formatted) + }, + } ] ``` @@ -149,7 +141,7 @@ formatted, sorted and filtered. Next, we'll create a `` component to render our table. -```ts:line-numbers +```vue:line-numbers diff --git a/apps/www/src/lib/registry/default/ui/accordion/AccordionContent.vue b/apps/www/src/lib/registry/default/ui/accordion/AccordionContent.vue index 740f4e666..d8ec98895 100644 --- a/apps/www/src/lib/registry/default/ui/accordion/AccordionContent.vue +++ b/apps/www/src/lib/registry/default/ui/accordion/AccordionContent.vue @@ -1,21 +1,23 @@