-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: updated whats new for 1.30.0 release
- Loading branch information
Showing
16 changed files
with
433 additions
and
43 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<script setup lang="ts"> | ||
import { useProvideCarousel } from "./useCarousel"; | ||
import type { | ||
CarouselEmits, | ||
CarouselProps, | ||
WithClassAsProps, | ||
} from "./interface"; | ||
import { cn } from "@/lib/utils"; | ||
const props = withDefaults(defineProps<CarouselProps & WithClassAsProps>(), { | ||
orientation: "horizontal", | ||
}); | ||
const emits = defineEmits<CarouselEmits>(); | ||
const { | ||
canScrollNext, | ||
canScrollPrev, | ||
carouselApi, | ||
carouselRef, | ||
orientation, | ||
scrollNext, | ||
scrollPrev, | ||
} = useProvideCarousel(props, emits); | ||
defineExpose({ | ||
canScrollNext, | ||
canScrollPrev, | ||
carouselApi, | ||
carouselRef, | ||
orientation, | ||
scrollNext, | ||
scrollPrev, | ||
}); | ||
function onKeyDown(event: KeyboardEvent) { | ||
const prevKey = props.orientation === "vertical" ? "ArrowUp" : "ArrowLeft"; | ||
const nextKey = props.orientation === "vertical" ? "ArrowDown" : "ArrowRight"; | ||
if (event.key === prevKey) { | ||
event.preventDefault(); | ||
scrollPrev(); | ||
return; | ||
} | ||
if (event.key === nextKey) { | ||
event.preventDefault(); | ||
scrollNext(); | ||
} | ||
} | ||
</script> | ||
|
||
<template> | ||
<div | ||
:class="cn('relative px-2', props.class)" | ||
role="region" | ||
aria-roledescription="carousel" | ||
tabindex="0" | ||
@keydown="onKeyDown" | ||
> | ||
<slot | ||
:can-scroll-next | ||
:can-scroll-prev | ||
:carousel-api | ||
:carousel-ref | ||
:orientation | ||
:scroll-next | ||
:scroll-prev | ||
/> | ||
</div> | ||
</template> |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<script setup lang="ts"> | ||
import { useCarousel } from './useCarousel' | ||
import type { WithClassAsProps } from './interface' | ||
import { cn } from '@/lib/utils' | ||
defineOptions({ | ||
inheritAttrs: false, | ||
}) | ||
const props = defineProps<WithClassAsProps>() | ||
const { carouselRef, orientation } = useCarousel() | ||
</script> | ||
|
||
<template> | ||
<div ref="carouselRef" class="overflow-hidden"> | ||
<div | ||
:class=" | ||
cn( | ||
'flex', | ||
orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', | ||
props.class, | ||
)" | ||
v-bind="$attrs" | ||
> | ||
<slot /> | ||
</div> | ||
</div> | ||
</template> |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<script setup lang="ts"> | ||
import { useCarousel } from './useCarousel' | ||
import type { WithClassAsProps } from './interface' | ||
import { cn } from '@/lib/utils' | ||
const props = defineProps<WithClassAsProps>() | ||
const { orientation } = useCarousel() | ||
</script> | ||
|
||
<template> | ||
<div | ||
role="group" | ||
aria-roledescription="slide" | ||
:class="cn( | ||
'min-w-0 shrink-0 grow-0 basis-full', | ||
orientation === 'horizontal' ? 'pl-4' : 'pt-4', | ||
props.class, | ||
)" | ||
> | ||
<slot /> | ||
</div> | ||
</template> |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<script setup lang="ts"> | ||
import { ArrowRightIcon } from "@radix-icons/vue"; | ||
import { useCarousel } from "./useCarousel"; | ||
import type { WithClassAsProps } from "./interface"; | ||
import { cn } from "@/lib/utils"; | ||
import { Button } from "@/components/ui/button"; | ||
const props = defineProps<WithClassAsProps>(); | ||
const { orientation, canScrollNext, scrollNext } = useCarousel(); | ||
</script> | ||
|
||
<template> | ||
<Button | ||
:disabled="!canScrollNext" | ||
:class=" | ||
cn( | ||
'touch-manipulation absolute h-8 w-8 p-0', | ||
orientation === 'horizontal' | ||
? '-right-12 top-1/2 -translate-y-1/2 mr-2' | ||
: '-bottom-12 left-1/2 -translate-x-1/2 rotate-90', | ||
props.class | ||
) | ||
" | ||
variant="default" | ||
@click="scrollNext" | ||
> | ||
<slot> | ||
<ArrowRightIcon class="h-4 w-4 text-current" /> | ||
<span class="sr-only">Next Slide</span> | ||
</slot> | ||
</Button> | ||
</template> |
Oops, something went wrong.