-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: use class
as prop to prevent class duplication with cn
function
#241
Merged
sadeghbarati
merged 28 commits into
unovue:dev
from
sadeghbarati:refactor/use-class-prop
Feb 2, 2024
Merged
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
66254fa
refactor: use `class` as prop to prevent class duplication
sadeghbarati a10731b
refactor: update
sadeghbarati 470ed45
refactor: default style finish
sadeghbarati f387165
Merge branch 'dev' into refactor/use-class-prop
sadeghbarati 71e6b9c
refactor: update
sadeghbarati 039ede6
refactor: update
sadeghbarati 8f3f52b
Merge branch 'refactor/use-class-prop' into refactor/use-class-prop
sadeghbarati e994656
refactor: update default
sadeghbarati 3889d63
refactor: update
sadeghbarati d2bd2ce
refactor: update
sadeghbarati ec233cb
Merge branch 'dev' of into refactor/use-class-prop
sadeghbarati 2a7c911
fix: separator background color (#295)
d9cbf36
refactor: update new-york classes
sadeghbarati ae7144f
Merge branch 'dev' into refactor/use-class-prop
sadeghbarati 30abfe2
refactor: update
sadeghbarati 5d85fff
Merge branch 'refactor/use-class-prop' of https://github.com/sadeghba…
sadeghbarati 5567b06
chore: build registry
sadeghbarati b15f602
Merge branch 'dev' into refactor/use-class-prop
sadeghbarati 57306c2
Merge branch 'dev' into refactor/use-class-prop
sadeghbarati 9ae8641
chore: fix can't resolved component in md and demo files
sadeghbarati 51a858d
refactor: update
sadeghbarati 62c4109
refactor: remove unnecessary avoid-collisions
sadeghbarati 010a3bd
Merge branch 'dev' into refactor/use-class-prop
sadeghbarati d7fdeb1
chore: build registry
sadeghbarati ad759e3
chore: fix the icons in registry demos
sadeghbarati c3d99cd
chore: change docs nav label background-color
sadeghbarati c15299a
chore: update deps
sadeghbarati a97b406
chore: make `sonner` ClientOnly for now
sadeghbarati File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
20 changes: 11 additions & 9 deletions
20
apps/www/src/lib/registry/default/ui/accordion/AccordionContent.vue
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
17 changes: 13 additions & 4 deletions
17
apps/www/src/lib/registry/default/ui/accordion/AccordionItem.vue
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
11 changes: 9 additions & 2 deletions
11
apps/www/src/lib/registry/default/ui/alert-dialog/AlertDialogAction.vue
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,13 +1,20 @@ | ||
<script setup lang="ts"> | ||
import { type HTMLAttributes, computed } from 'vue' | ||
import { AlertDialogAction, type AlertDialogActionProps } from 'radix-vue' | ||
import { cn } from '@/lib/utils' | ||
import { buttonVariants } from '@/lib/registry/default/ui/button' | ||
|
||
const props = defineProps<AlertDialogActionProps>() | ||
const props = defineProps<AlertDialogActionProps & { class?: HTMLAttributes['class'] }>() | ||
|
||
const delegatedProps = computed(() => { | ||
const { class: _, ...delegated } = props | ||
|
||
return delegated | ||
}) | ||
</script> | ||
|
||
<template> | ||
<AlertDialogAction v-bind="props" :class="cn(buttonVariants(), $attrs.class ?? '')"> | ||
<AlertDialogAction v-bind="delegatedProps" :class="cn(buttonVariants(), props.class)"> | ||
<slot /> | ||
</AlertDialogAction> | ||
</template> |
11 changes: 9 additions & 2 deletions
11
apps/www/src/lib/registry/default/ui/alert-dialog/AlertDialogCancel.vue
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,13 +1,20 @@ | ||
<script setup lang="ts"> | ||
import { type HTMLAttributes, computed } from 'vue' | ||
import { AlertDialogCancel, type AlertDialogCancelProps } from 'radix-vue' | ||
import { cn } from '@/lib/utils' | ||
import { buttonVariants } from '@/lib/registry/default/ui/button' | ||
|
||
const props = defineProps<AlertDialogCancelProps>() | ||
const props = defineProps<AlertDialogCancelProps & { class?: HTMLAttributes['class'] }>() | ||
|
||
const delegatedProps = computed(() => { | ||
const { class: _, ...delegated } = props | ||
|
||
return delegated | ||
}) | ||
</script> | ||
|
||
<template> | ||
<AlertDialogCancel v-bind="props" :class="cn(buttonVariants({ variant: 'outline' }), 'mt-2 sm:mt-0', $attrs.class ?? '')"> | ||
<AlertDialogCancel v-bind="delegatedProps" :class="cn(buttonVariants({ variant: 'outline' }), 'mt-2 sm:mt-0', props.class)"> | ||
<slot /> | ||
</AlertDialogCancel> | ||
</template> |
19 changes: 13 additions & 6 deletions
19
apps/www/src/lib/registry/default/ui/alert-dialog/AlertDialogContent.vue
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
13 changes: 10 additions & 3 deletions
13
apps/www/src/lib/registry/default/ui/alert-dialog/AlertDialogDescription.vue
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I worry this
HTMLAttributes
would cause some issue fordetypes
😂