Skip to content

Commit 0feca1c

Browse files
chore: update versions (#1345)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 0b84a39 commit 0feca1c

File tree

3 files changed

+49
-48
lines changed

3 files changed

+49
-48
lines changed

.changeset/happy-hornets-yell.md

Lines changed: 0 additions & 47 deletions
This file was deleted.

packages/react/CHANGELOG.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,53 @@
11
# @obosbbl/grunnmuren-react
22

3+
## 2.3.3
4+
5+
### Patch Changes
6+
7+
- 0b84a39: Adding an `onChange` prop to the `<Carousel>` component. This prop can be used to track navigation within the `<Carousel>`.
8+
The `onChange` callback is triggered when a user navigates to a new item in the Carousel. The argument to the callback is an object containing `index` of the new item scrolled into view and the `id` of that item (if set on the `<CarouselItem>`). It also provides `prevIndex` which is the index of the previous item that was in view. And `prevId`, which is the id of the previous item that was in view (if set on the `<CarouselItem>`)
9+
10+
Usage:
11+
12+
```tsx
13+
<Carousel
14+
onChange={({ id, index, prevId, prevIndex }) => {
15+
console.log(`
16+
Carousel changed to item with id: "${id}" and index: ${index}.
17+
The previous item id was: "${prevId}" and index: ${prevIndex}.
18+
This indicates that the user navigated to the ${prevIndex < index ? "next" : "previous"} item.
19+
`);
20+
}}
21+
>
22+
<CarouselItems>
23+
<CarouselItem id="first">
24+
<Media>
25+
<img
26+
src="https://res.cloudinary.com/obosit-prd-ch-clry/image/upload/f_auto,c_limit,w_2048,q_auto/v1582122753/Boligprosjekter/Oslo/Ulven/Ulven-N%C3%A6romr%C3%A5de-Oslo-OBOS-Construction-city.jpg"
27+
alt=""
28+
/>
29+
</Media>
30+
</CarouselItem>
31+
<CarouselItem id="second">
32+
<Media>
33+
<img
34+
src="https://res.cloudinary.com/obosit-prd-ch-clry/image/upload/v1587988823/Boligprosjekter/Oslo/Frysjaparken/Frysjalia/Frysjaparken_interi%C3%B8r_30.jpg"
35+
alt=""
36+
/>
37+
</Media>
38+
</CarouselItem>
39+
<CarouselItem id="third">
40+
<Media fit="contain">
41+
<img
42+
src="https://res.cloudinary.com/obosit-prd-ch-clry/image/upload/f_auto,c_limit,w_1080,q_auto:best/t_2_3/v1747985572/Temasider/Folk/Hans%20Petter%20%20-%20Trang%20f%C3%B8dsel/Obos-Hans-Petter-Aaserud-Photo-Einar-Aslaksen-03093_web.jpg"
43+
alt=""
44+
/>
45+
</Media>
46+
</CarouselItem>
47+
</CarouselItems>
48+
</Carousel>
49+
```
50+
351
## 2.3.2
452

553
### Patch Changes

packages/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@obosbbl/grunnmuren-react",
3-
"version": "2.3.2",
3+
"version": "2.3.3",
44
"description": "Grunnmuren components in React",
55
"repository": {
66
"url": "https://github.com/code-obos/grunnmuren"

0 commit comments

Comments
 (0)