-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(deps): update react monorepo to v19 (major) (#699)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Phil Parsons <[email protected]>
- Loading branch information
1 parent
93c6a9e
commit 287628c
Showing
18 changed files
with
425 additions
and
303 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 @@ | ||
--- | ||
'@boxslider/react': major | ||
--- | ||
|
||
Update components for use with React 19 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
title: Product Card | ||
--- | ||
|
||
import { ProductCard } from '@site/src/components/ProductCard' | ||
|
||
<ProductCard /> |
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,4 @@ | ||
{ | ||
"label": "Examples", | ||
"position": 4 | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import { FadeSlider } from '@boxslider/react' | ||
import { createRef } from 'react' | ||
import type { BoxSlider } from '@boxslider/slider' | ||
|
||
import styles from './styles.module.css' | ||
|
||
export function ProductCard() { | ||
const sliderRef = createRef<BoxSlider>() | ||
const buttonBar = createRef<HTMLDivElement>() | ||
|
||
const handleActiveButton = (button: HTMLButtonElement) => { | ||
const buttons = buttonBar.current?.querySelectorAll('button') | ||
const index = Array.from(buttons).indexOf(button) | ||
|
||
buttons?.forEach((btn) => (btn.tabIndex = -1)) | ||
button.tabIndex = 0 | ||
sliderRef.current?.skipTo(index) | ||
} | ||
|
||
return ( | ||
<article className={styles.card}> | ||
<section className={styles.details}> | ||
<h2>Tartan paint</h2> | ||
<p> | ||
Our tartan paint is made from the finest Scottish tartans, and is | ||
perfect for painting your walls, ceilings, and floors. | ||
</p> | ||
</section> | ||
<section className={styles.images}> | ||
<FadeSlider | ||
className={styles.slider} | ||
autoScroll={false} | ||
sliderRef={sliderRef}> | ||
<div className={styles.slide}>Image one</div> | ||
<div className={styles.slide}>Image two</div> | ||
<div className={styles.slide}>Image three</div> | ||
<div className={styles.slide}>Image four</div> | ||
<div className={styles.slide}>Image five</div> | ||
</FadeSlider> | ||
<div | ||
ref={buttonBar} | ||
className={styles.thumbnails} | ||
onClick={(ev) => { | ||
if (ev.target instanceof HTMLButtonElement) { | ||
handleActiveButton(ev.target) | ||
} | ||
}} | ||
onKeyDown={(ev) => { | ||
const current = ev.target as HTMLButtonElement | ||
const prev = current.previousElementSibling as HTMLButtonElement | ||
const next = current.nextElementSibling as HTMLButtonElement | ||
|
||
if (ev.code === 'ArrowRight' && next) { | ||
handleActiveButton(next) | ||
next.focus() | ||
} | ||
|
||
if (ev.code === 'ArrowLeft' && prev) { | ||
handleActiveButton(prev) | ||
prev.focus() | ||
} | ||
}}> | ||
<button tabIndex={0} className={styles.thumbnail}> | ||
Thumbnail | ||
</button> | ||
<button tabIndex={-1} className={styles.thumbnail}> | ||
Thumbnail | ||
</button> | ||
<button tabIndex={-1} className={styles.thumbnail}> | ||
Thumbnail | ||
</button> | ||
<button tabIndex={-1} className={styles.thumbnail}> | ||
Thumbnail | ||
</button> | ||
<button tabIndex={-1} className={styles.thumbnail}> | ||
Thumbnail | ||
</button> | ||
</div> | ||
</section> | ||
</article> | ||
) | ||
} |
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 @@ | ||
export * from './ProductCard' |
23 changes: 23 additions & 0 deletions
23
packages/docs/src/components/ProductCard/styles.module.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.card { | ||
display: flex; | ||
flex-flow: row-reverse; | ||
} | ||
|
||
.details { | ||
width: 40%; | ||
} | ||
|
||
.images { | ||
width: 60%; | ||
} | ||
|
||
.slider { | ||
display: block; | ||
height: 300px; | ||
width: 100%; | ||
} | ||
|
||
.slide { | ||
width: 100%; | ||
height: 100%; | ||
} |
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
Oops, something went wrong.