Merge remote-tracking branch 'origin/dev' into autoform

This commit is contained in:
zernonia 2024-05-01 09:35:40 +08:00
commit dffef69bb9
17 changed files with 38 additions and 58 deletions

View File

@ -24,7 +24,7 @@ jobs:
- name: Setup Node.js environment - name: Setup Node.js environment
uses: actions/setup-node@v2 uses: actions/setup-node@v2
with: with:
node-version: 16 node-version: 18
- uses: pnpm/action-setup@v2 - uses: pnpm/action-setup@v2
name: Install pnpm name: Install pnpm

View File

@ -123,7 +123,7 @@ function constructFiles(componentName: string, style: Style, sources: Record<str
} }
}) })
// @ts-expect-error componentName migth not exist in Index // @ts-expect-error componentName might not exist in Index
const registryDependencies = demoIndex[style][componentName as any]?.registryDependencies?.filter(i => i !== 'utils') const registryDependencies = demoIndex[style][componentName as any]?.registryDependencies?.filter(i => i !== 'utils')
const files = { const files = {

View File

@ -1,7 +1,7 @@
{ {
"name": "www", "name": "www",
"type": "module", "type": "module",
"version": "0.10.3", "version": "0.10.4",
"files": [ "files": [
"dist" "dist"
], ],
@ -52,7 +52,7 @@
"@iconify/vue": "^4.1.2", "@iconify/vue": "^4.1.2",
"@oxc-parser/wasm": "^0.1.0", "@oxc-parser/wasm": "^0.1.0",
"@shikijs/transformers": "^1.3.0", "@shikijs/transformers": "^1.3.0",
"@types/lodash.template": "^4.5.3", "@types/lodash-es": "^4.17.12",
"@types/node": "^20.12.7", "@types/node": "^20.12.7",
"@vitejs/plugin-vue": "^5.0.4", "@vitejs/plugin-vue": "^5.0.4",
"@vitejs/plugin-vue-jsx": "^3.1.0", "@vitejs/plugin-vue-jsx": "^3.1.0",
@ -60,7 +60,7 @@
"@vue/compiler-dom": "^3.4.24", "@vue/compiler-dom": "^3.4.24",
"@vue/tsconfig": "^0.5.1", "@vue/tsconfig": "^0.5.1",
"autoprefixer": "^10.4.19", "autoprefixer": "^10.4.19",
"lodash.template": "^4.5.0", "lodash-es": "^4.17.21",
"pathe": "^1.1.2", "pathe": "^1.1.2",
"rimraf": "^5.0.5", "rimraf": "^5.0.5",
"shiki": "^1.3.0", "shiki": "^1.3.0",

View File

@ -1,6 +1,6 @@
import fs from 'node:fs' import fs from 'node:fs'
import path, { basename } from 'node:path' import path, { basename } from 'node:path'
import template from 'lodash.template' import { template } from 'lodash-es'
import { rimraf } from 'rimraf' import { rimraf } from 'rimraf'
import { colorMapping, colors } from '../src/lib/registry/colors' import { colorMapping, colors } from '../src/lib/registry/colors'
@ -40,7 +40,7 @@ for (const style of styles) {
file => `../src/lib/registry/${style.name}/${file}`, file => `../src/lib/registry/${style.name}/${file}`,
) )
const type = item.type.split(':')[1] // const type = item.type.split(':')[1]
index += ` index += `
"${item.name}": { "${item.name}": {
name: "${item.name}", name: "${item.name}",
@ -396,4 +396,4 @@ fs.writeFileSync(
'utf8', 'utf8',
) )
console.log('✅ Done!') console.log('✅ Done!!')

View File

@ -23,7 +23,7 @@ The `<Form />` component is a wrapper around the `vee-validate` library. It prov
- Composable components for building forms. - Composable components for building forms.
- A `<FormField />` component for building controlled form fields. - A `<FormField />` component for building controlled form fields.
- Form validation using `zod`. - Form validation using `zod`.
- Applies the correct `aria` attributes to form fields based on states, handle unqiue IDs - Applies the correct `aria` attributes to form fields based on states, handle unique IDs
- Built to work with all Radix Vue components. - Built to work with all Radix Vue components.
- Bring your own schema library. We use `zod` but you can use any other supported schema validation you want, like [`yup`](https://github.com/jquense/yup) or [`valibot`](https://valibot.dev/). - Bring your own schema library. We use `zod` but you can use any other supported schema validation you want, like [`yup`](https://github.com/jquense/yup) or [`valibot`](https://valibot.dev/).
- **You have full control over the markup and styling.** - **You have full control over the markup and styling.**
@ -249,7 +249,7 @@ function onSubmit(values) {
### Build your form ### Build your form
Based on last step we can either use `<Form />` component or `useForm` composable Based on last step we can either use `<Form />` component or `useForm` composable
`useForm` is recommended cause values are typed automatically `useForm` is recommended because values are typed automatically
```vue:line-numbers {2} ```vue:line-numbers {2}
<script setup lang="ts"> <script setup lang="ts">

View File

@ -176,7 +176,7 @@ To do so, we have a helper function named [`useForwardPropsEmits`](https://www.r
To be more clear, the function `useForwardPropsEmits` takes in props and an optional emit function, and returns a To be more clear, the function `useForwardPropsEmits` takes in props and an optional emit function, and returns a
computed object that combines the parsed props and emits as props. computed object that combines the parsed props and emits as props.
Here's an example from `Accordian` root component. Here's an example from `Accordion` root component.
```vue ```vue
<script setup lang="ts"> <script setup lang="ts">
@ -200,7 +200,7 @@ const forwarded = useForwardPropsEmits(props, emits)
</template> </template>
``` ```
As you can see, `AccordionRootEmits` and `AccordionRootProps` types are imported from radix, combined with `useForwardPropsEmits` and then are binded using `v-bind` syntaxt. As you can see, `AccordionRootEmits` and `AccordionRootProps` types are imported from radix, combined with `useForwardPropsEmits` and then are binded using `v-bind` syntax.
### CSS Classes ### CSS Classes
There are cases when we want to accept `class` as a prop in our `shadcn/vue` component and then combine it with a default tailwind class on our `radix-vue` component via `cn` utility function. There are cases when we want to accept `class` as a prop in our `shadcn/vue` component and then combine it with a default tailwind class on our `radix-vue` component via `cn` utility function.

View File

@ -41,7 +41,7 @@ const onSubmit = handleSubmit((values) => {
<template> <template>
<div> <div>
<h3 class="text-lg font-medium"> <h3 class="text-lg font-medium">
Appearence Appearance
</h3> </h3>
<p class="text-sm text-muted-foreground"> <p class="text-sm text-muted-foreground">
Customize the appearance of the app. Automatically switch between day and night themes. Customize the appearance of the app. Automatically switch between day and night themes.

View File

@ -218,7 +218,7 @@ import {
</MenubarRadioGroup> </MenubarRadioGroup>
<MenubarSeparator /> <MenubarSeparator />
<MenubarItem inset> <MenubarItem inset>
Manage Famliy... Manage Family...
</MenubarItem> </MenubarItem>
<MenubarSeparator /> <MenubarSeparator />
<MenubarItem inset> <MenubarItem inset>

View File

@ -59,7 +59,7 @@ function computeLineOpacity(val: any, index: number) {
<CardHeader> <CardHeader>
<CardTitle>Exercise Minutes</CardTitle> <CardTitle>Exercise Minutes</CardTitle>
<CardDescription> <CardDescription>
Your excercise minutes are ahead of where you normally are. Your exercise minutes are ahead of where you normally are.
</CardDescription> </CardDescription>
</CardHeader> </CardHeader>
<CardContent class="pb-4"> <CardContent class="pb-4">

View File

@ -15,7 +15,7 @@ const plugin = Autoplay({
class="relative w-full max-w-xs" class="relative w-full max-w-xs"
:plugins="[plugin]" :plugins="[plugin]"
@mouseenter="plugin.stop" @mouseenter="plugin.stop"
@mouseleave="[plugin.reset(), plugin.play(), console.log('Runing')];" @mouseleave="[plugin.reset(), plugin.play(), console.log('Running')];"
> >
<CarouselContent> <CarouselContent>
<CarouselItem v-for="(_, index) in 5" :key="index"> <CarouselItem v-for="(_, index) in 5" :key="index">

View File

@ -59,7 +59,7 @@ function computeLineOpacity(val: any, index: number) {
<CardHeader> <CardHeader>
<CardTitle>Exercise Minutes</CardTitle> <CardTitle>Exercise Minutes</CardTitle>
<CardDescription> <CardDescription>
Your excercise minutes are ahead of where you normally are. Your exercise minutes are ahead of where you normally are.
</CardDescription> </CardDescription>
</CardHeader> </CardHeader>
<CardContent class="pb-4"> <CardContent class="pb-4">

View File

@ -15,7 +15,7 @@ const plugin = Autoplay({
class="relative w-full max-w-xs" class="relative w-full max-w-xs"
:plugins="[plugin]" :plugins="[plugin]"
@mouseenter="plugin.stop" @mouseenter="plugin.stop"
@mouseleave="[plugin.reset(), plugin.play(), console.log('Runing')];" @mouseleave="[plugin.reset(), plugin.play(), console.log('Running')];"
> >
<CarouselContent> <CarouselContent>
<CarouselItem v-for="(_, index) in 5" :key="index"> <CarouselItem v-for="(_, index) in 5" :key="index">

View File

@ -1,7 +1,7 @@
{ {
"name": "shadcn-vue", "name": "shadcn-vue",
"type": "module", "type": "module",
"version": "0.10.3", "version": "0.10.4",
"private": true, "private": true,
"packageManager": "pnpm@9.0.5", "packageManager": "pnpm@9.0.5",
"license": "MIT", "license": "MIT",

View File

@ -1,7 +1,7 @@
{ {
"name": "shadcn-vue", "name": "shadcn-vue",
"type": "module", "type": "module",
"version": "0.10.3", "version": "0.10.4",
"description": "Add components to your apps.", "description": "Add components to your apps.",
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"
@ -55,7 +55,7 @@
"diff": "^5.2.0", "diff": "^5.2.0",
"fs-extra": "^11.2.0", "fs-extra": "^11.2.0",
"https-proxy-agent": "^7.0.4", "https-proxy-agent": "^7.0.4",
"lodash.template": "^4.5.0", "lodash-es": "^4.17.21",
"magic-string": "^0.30.10", "magic-string": "^0.30.10",
"nypm": "^0.3.8", "nypm": "^0.3.8",
"ofetch": "^1.3.4", "ofetch": "^1.3.4",
@ -71,7 +71,7 @@
"@types/babel__core": "^7.20.5", "@types/babel__core": "^7.20.5",
"@types/diff": "^5.2.0", "@types/diff": "^5.2.0",
"@types/fs-extra": "^11.0.4", "@types/fs-extra": "^11.0.4",
"@types/lodash.template": "^4.5.3", "@types/lodash-es": "^4.5.3",
"@types/node": "^20.11.30", "@types/node": "^20.11.30",
"@types/prompts": "^2.4.9", "@types/prompts": "^2.4.9",
"@vitest/ui": "^0.34.4", "@vitest/ui": "^0.34.4",

View File

@ -2,7 +2,7 @@ import { existsSync, promises as fs } from 'node:fs'
import process from 'node:process' import process from 'node:process'
import path from 'pathe' import path from 'pathe'
import { Command } from 'commander' import { Command } from 'commander'
import template from 'lodash.template' import { template } from 'lodash-es'
import ora from 'ora' import ora from 'ora'
import prompts from 'prompts' import prompts from 'prompts'
import { z } from 'zod' import { z } from 'zod'

View File

@ -1,7 +1,7 @@
{ {
"name": "shadcn-nuxt", "name": "shadcn-nuxt",
"type": "module", "type": "module",
"version": "0.10.3", "version": "0.10.4",
"description": "Add shadcn-vue module to Nuxt", "description": "Add shadcn-vue module to Nuxt",
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"

View File

@ -147,9 +147,9 @@ importers:
'@shikijs/transformers': '@shikijs/transformers':
specifier: ^1.3.0 specifier: ^1.3.0
version: 1.3.0 version: 1.3.0
'@types/lodash.template': '@types/lodash-es':
specifier: ^4.5.3 specifier: ^4.17.12
version: 4.5.3 version: 4.17.12
'@types/node': '@types/node':
specifier: ^20.12.7 specifier: ^20.12.7
version: 20.12.7 version: 20.12.7
@ -171,9 +171,9 @@ importers:
autoprefixer: autoprefixer:
specifier: ^10.4.19 specifier: ^10.4.19
version: 10.4.19(postcss@8.4.38) version: 10.4.19(postcss@8.4.38)
lodash.template: lodash-es:
specifier: ^4.5.0 specifier: ^4.17.21
version: 4.5.0 version: 4.17.21
pathe: pathe:
specifier: ^1.1.2 specifier: ^1.1.2
version: 1.1.2 version: 1.1.2
@ -237,9 +237,9 @@ importers:
https-proxy-agent: https-proxy-agent:
specifier: ^7.0.4 specifier: ^7.0.4
version: 7.0.4 version: 7.0.4
lodash.template: lodash-es:
specifier: ^4.5.0 specifier: ^4.17.21
version: 4.5.0 version: 4.17.21
magic-string: magic-string:
specifier: ^0.30.10 specifier: ^0.30.10
version: 0.30.10 version: 0.30.10
@ -280,9 +280,9 @@ importers:
'@types/fs-extra': '@types/fs-extra':
specifier: ^11.0.4 specifier: ^11.0.4
version: 11.0.4 version: 11.0.4
'@types/lodash.template': '@types/lodash-es':
specifier: ^4.5.3 specifier: ^4.5.3
version: 4.5.3 version: 4.17.12
'@types/node': '@types/node':
specifier: ^20.11.30 specifier: ^20.11.30
version: 20.12.7 version: 20.12.7
@ -2052,8 +2052,8 @@ packages:
'@types/linkify-it@3.0.5': '@types/linkify-it@3.0.5':
resolution: {integrity: sha512-yg6E+u0/+Zjva+buc3EIb+29XEg4wltq7cSmd4Uc2EE/1nUVmxyzpX6gUXD0V8jIrG0r7YeOGVIbYRkxeooCtw==} resolution: {integrity: sha512-yg6E+u0/+Zjva+buc3EIb+29XEg4wltq7cSmd4Uc2EE/1nUVmxyzpX6gUXD0V8jIrG0r7YeOGVIbYRkxeooCtw==}
'@types/lodash.template@4.5.3': '@types/lodash-es@4.17.12':
resolution: {integrity: sha512-Mo0UYKLu1oXgkV9TVoXZLlXXjyIXlW7ZQRxi/4gQJmzJr63dmicE8gG0OkPjYTKBrBic852q0JzqrtNUWLBIyA==} resolution: {integrity: sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==}
'@types/lodash@4.17.0': '@types/lodash@4.17.0':
resolution: {integrity: sha512-t7dhREVv6dbNj0q17X12j7yDG4bD/DHYX7o5/DbDxobP0HnGPgpRz2Ej77aL7TZT3DSw13fqUTj8J4mMnqa7WA==} resolution: {integrity: sha512-t7dhREVv6dbNj0q17X12j7yDG4bD/DHYX7o5/DbDxobP0HnGPgpRz2Ej77aL7TZT3DSw13fqUTj8J4mMnqa7WA==}
@ -4880,9 +4880,6 @@ packages:
lodash-es@4.17.21: lodash-es@4.17.21:
resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==}
lodash._reinterpolate@3.0.0:
resolution: {integrity: sha512-xYHt68QRoYGjeeM/XOE1uJtvXQAgvszfBhjV4yvsQH0u2i9I6cI6c6/eG4Hh3UAOVn0y/xAXwmTzEay49Q//HA==}
lodash.camelcase@4.3.0: lodash.camelcase@4.3.0:
resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==} resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==}
@ -4916,12 +4913,6 @@ packages:
lodash.startcase@4.4.0: lodash.startcase@4.4.0:
resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==}
lodash.template@4.5.0:
resolution: {integrity: sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==}
lodash.templatesettings@4.2.0:
resolution: {integrity: sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==}
lodash.uniq@4.5.0: lodash.uniq@4.5.0:
resolution: {integrity: sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==} resolution: {integrity: sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==}
@ -9422,7 +9413,7 @@ snapshots:
'@types/linkify-it@3.0.5': {} '@types/linkify-it@3.0.5': {}
'@types/lodash.template@4.5.3': '@types/lodash-es@4.17.12':
dependencies: dependencies:
'@types/lodash': 4.17.0 '@types/lodash': 4.17.0
@ -12785,8 +12776,6 @@ snapshots:
lodash-es@4.17.21: {} lodash-es@4.17.21: {}
lodash._reinterpolate@3.0.0: {}
lodash.camelcase@4.3.0: {} lodash.camelcase@4.3.0: {}
lodash.defaults@4.2.0: {} lodash.defaults@4.2.0: {}
@ -12809,15 +12798,6 @@ snapshots:
lodash.startcase@4.4.0: {} lodash.startcase@4.4.0: {}
lodash.template@4.5.0:
dependencies:
lodash._reinterpolate: 3.0.0
lodash.templatesettings: 4.2.0
lodash.templatesettings@4.2.0:
dependencies:
lodash._reinterpolate: 3.0.0
lodash.uniq@4.5.0: {} lodash.uniq@4.5.0: {}
lodash.upperfirst@4.3.1: {} lodash.upperfirst@4.3.1: {}