-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* mousewheel support * improve docs * improve example * changesert
- Loading branch information
1 parent
0736b84
commit 664b3f1
Showing
8 changed files
with
138 additions
and
17 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@qwik-ui/headless': patch | ||
--- | ||
|
||
feat: carousel now supports mousewheel navigation in vertical mode |
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
1 change: 1 addition & 0 deletions
1
apps/website/src/routes/docs/headless/carousel/examples/carousel.css
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,5 +1,6 @@ | ||
.carousel-root { | ||
width: 100%; | ||
position: relative; | ||
} | ||
|
||
.carousel-slide { | ||
|
60 changes: 60 additions & 0 deletions
60
apps/website/src/routes/docs/headless/carousel/examples/mousewheel.tsx
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,60 @@ | ||
import { component$, useStyles$ } from '@builder.io/qwik'; | ||
import { Carousel } from '@qwik-ui/headless'; | ||
|
||
export default component$(() => { | ||
useStyles$(styles); | ||
|
||
const colors = ['red', 'green', 'blue', 'yellow', 'purple', 'orange', 'pink']; | ||
|
||
useStyles$(` | ||
.mousewheel-bullet { | ||
width: 10px; | ||
height: 10px; | ||
background: hsl(var(--muted)); | ||
} | ||
.mousewheel-bullet[data-active] { | ||
background-color: hsl(var(--primary)); | ||
} | ||
.mousewheel-pagination { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 4px; | ||
position: absolute; | ||
top: 33%; | ||
right: 8px; | ||
} | ||
`); | ||
|
||
return ( | ||
<Carousel.Root | ||
class="carousel-root" | ||
gap={30} | ||
orientation="vertical" | ||
maxSlideHeight={160} | ||
mousewheel | ||
> | ||
<div class="carousel-buttons"> | ||
<Carousel.Previous>Prev</Carousel.Previous> | ||
<Carousel.Next>Next</Carousel.Next> | ||
</div> | ||
<Carousel.Scroller class="carousel-scroller"> | ||
{colors.map((color) => ( | ||
<Carousel.Slide key={color} class="carousel-slide"> | ||
{color} | ||
</Carousel.Slide> | ||
))} | ||
</Carousel.Scroller> | ||
<Carousel.Pagination class="mousewheel-pagination"> | ||
{colors.map((color) => ( | ||
<Carousel.Bullet class="mousewheel-bullet" key={color} /> | ||
))} | ||
</Carousel.Pagination> | ||
</Carousel.Root> | ||
); | ||
}); | ||
|
||
// internal | ||
import styles from './carousel.css?inline'; |
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