@synerise/ds-banner 2.0.9 → 2.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.0.10](https://github.com/Synerise/synerise-design/compare/@synerise/ds-banner@2.0.9...@synerise/ds-banner@2.0.10) (2026-10-26)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * drop vitest peer dependency and bump vulnerable runtime deps ([2467d36](https://github.com/Synerise/synerise-design/commit/2467d3606aa97141a3a2d80c3ef396e78bee285c))
12
+ * remove per-render random keys and guard against them with a Biome plugin ([fcea7c5](https://github.com/Synerise/synerise-design/commit/fcea7c5d60b80c28cbbd191bfa2792379782a0e8))
13
+
14
+
15
+
16
+
17
+
6
18
  ## [2.0.9](https://github.com/Synerise/synerise-design/compare/@synerise/ds-banner@2.0.8...@synerise/ds-banner@2.0.9) (2026-10-22)
7
19
 
8
20
  **Note:** Version bump only for package @synerise/ds-banner
package/CLAUDE.md CHANGED
@@ -129,7 +129,6 @@ import Banner from '@synerise/ds-banner';
129
129
 
130
130
  - `@synerise/ds-carousel` (`Carousel`) — the underlying carousel/slideshow engine; `BannerSlides` is a styled `Carousel`; navigation is driven via `CarouselRef` (`.goTo`, `.next`, `.prev`)
131
131
  - `react-intl` — **required peer dependency** used in `useTexts` for default i18n strings; app must be wrapped in `IntlProvider`
132
- - `uuid` — generates a stable `id` per slide on each `slides` prop change (via `useMemo`) to use as React keys
133
132
  - `@synerise/ds-tag` — renders `titleStatus` pill with `asPill` + `TagShape.SMALL_SQUARE`
134
133
  - `@synerise/ds-typography` (`Title`, `Text`) — used for slide title and header bar text
135
134
 
@@ -148,7 +147,7 @@ Merges react-intl formatted defaults (`DS.BANNER.EXPAND`, `DS.BANNER.COLLAPSE`,
148
147
  - **Slide counter** only renders when `slides.length > 1`.
149
148
  - **Close button vs expandable header**: if `expandable` is set, the close button is rendered *inside* the `BannerHeader`; otherwise it floats absolutely in the top-right corner (`position: absolute; right: 8px; top: 8px; z-index: 10`).
150
149
  - **Expand/collapse state** is local — `isExpanded` in `expandable` is only the *initial* value. After mount the state is owned by `Banner`.
151
- - **`slides` are re-keyed** on every render via `uuid()` inside a `useMemo([slides])`, so mutating slide objects in place (without replacing the array) will not re-key them.
150
+ - **Slide keys** — slides and counter dots are keyed by `slide.id`, falling back to the slide's index. Pass an `id` per slide if slides can be reordered.
152
151
  - **Carousel CSS**: `ds-carousel` ships its own styling; `Banner.styles.ts` adds the layout tweaks via ds-carousel's `.ds-carousel` / `.ds-carousel-track` class hooks (no LESS side-effect import anymore).
153
152
  - `BannerSlide` memoizes each content area (`useMemo`) keyed to the content prop; position (`left | right | main`) and `hasMainContent` flag control flex-basis (240px fixed) vs flex-grow (1).
154
153
  - `titleStatus` defaults for colour (`yellow-600` / `white`) come from `Banner.const.ts` and are spread before the caller's overrides, so callers can override individual colour props.
package/dist/Banner.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { useState, useMemo, createElement } from "react";
3
- import { v4 } from "uuid";
2
+ import { useState, createElement } from "react";
4
3
  import Button from "@synerise/ds-button";
5
4
  import Icon, { CloseM } from "@synerise/ds-icon";
6
5
  import Tooltip from "@synerise/ds-tooltip";
@@ -33,12 +32,6 @@ const Banner = ({
33
32
  handlePrevClick
34
33
  } = useCarousel();
35
34
  const allTexts = useTexts(texts);
36
- const slidesWithUUID = useMemo(() => {
37
- return slides.map((slide) => ({
38
- ...slide,
39
- id: v4()
40
- }));
41
- }, [slides]);
42
35
  const handleBeforeChange = (from, to) => {
43
36
  setCurrentIndex(to);
44
37
  onBeforeChange?.(from, to);
@@ -48,8 +41,8 @@ const Banner = ({
48
41
  return /* @__PURE__ */ jsxs(BannerWrapper, { ...htmlAttributes, count: slides.length, children: [
49
42
  expandableHeader || closeButton,
50
43
  isExpanded && /* @__PURE__ */ jsxs(Fragment, { children: [
51
- /* @__PURE__ */ jsx(BannerSlides, { ref: bannerRef, afterChange: onAfterChange, beforeChange: handleBeforeChange, autoplay: autoPlay, autoplaySpeed: autoPlaySpeed, effect: transitionEffect, dots: false, children: slidesWithUUID.map((slide) => /* @__PURE__ */ createElement(BannerSlide, { ...slide, key: slide.id })) }),
52
- slides.length > 1 && /* @__PURE__ */ jsx(BannerCounter, { onPrevClick: handlePrevClick, onNextClick: handleNextClick, onDotClick: handleDotClick, currentIndex, slides: slidesWithUUID })
44
+ /* @__PURE__ */ jsx(BannerSlides, { ref: bannerRef, afterChange: onAfterChange, beforeChange: handleBeforeChange, autoplay: autoPlay, autoplaySpeed: autoPlaySpeed, effect: transitionEffect, dots: false, children: slides.map((slide, index) => /* @__PURE__ */ createElement(BannerSlide, { ...slide, key: slide.id ?? index })) }),
45
+ slides.length > 1 && /* @__PURE__ */ jsx(BannerCounter, { onPrevClick: handlePrevClick, onNextClick: handleNextClick, onDotClick: handleDotClick, currentIndex, slides })
53
46
  ] })
54
47
  ] });
55
48
  };
@@ -44,9 +44,7 @@ export type BannerSlideMediaContentProps = {
44
44
  media?: ReactNode;
45
45
  };
46
46
  export type BannerCounterProps = {
47
- slides: Array<BannerSlideProps & {
48
- id: string;
49
- }>;
47
+ slides: BannerSlideProps[];
50
48
  currentIndex: number;
51
49
  onDotClick: (index: number) => void;
52
50
  onNextClick: () => void;
@@ -11,7 +11,7 @@ const BannerCounter = ({
11
11
  }) => {
12
12
  return /* @__PURE__ */ jsxs(BannerCounterWrapper, { "data-testid": "banner-counter", children: [
13
13
  /* @__PURE__ */ jsx(Button, { type: "ghost", onClick: onPrevClick, mode: "single-icon", children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(AngleLeftS, {}) }) }),
14
- slides.map((slide, index) => /* @__PURE__ */ jsx(BannerCounterDot, { active: index === currentIndex, onClick: () => onDotClick(index) }, slide.id)),
14
+ slides.map((slide, index) => /* @__PURE__ */ jsx(BannerCounterDot, { active: index === currentIndex, onClick: () => onDotClick(index) }, slide.id ?? index)),
15
15
  /* @__PURE__ */ jsx(Button, { type: "ghost", onClick: onNextClick, mode: "single-icon", children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(AngleRightS, {}) }) })
16
16
  ] });
17
17
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-banner",
3
- "version": "2.0.9",
3
+ "version": "2.0.10",
4
4
  "description": "Banner UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -42,21 +42,22 @@
42
42
  ],
43
43
  "types": "dist/index.d.ts",
44
44
  "dependencies": {
45
- "@synerise/ds-button": "^2.1.4",
45
+ "@synerise/ds-button": "^2.1.5",
46
46
  "@synerise/ds-carousel": "^2.0.2",
47
- "@synerise/ds-icon": "^2.2.2",
48
- "@synerise/ds-tag": "^2.0.9",
49
- "@synerise/ds-tooltip": "^2.0.9",
50
- "@synerise/ds-typography": "^2.0.9",
51
- "@synerise/ds-utils": "^2.2.1",
52
- "uuid": "^8.3.2"
47
+ "@synerise/ds-icon": "^2.2.3",
48
+ "@synerise/ds-tag": "^2.0.10",
49
+ "@synerise/ds-tooltip": "^2.0.10",
50
+ "@synerise/ds-typography": "^2.0.10",
51
+ "@synerise/ds-utils": "^2.2.2"
52
+ },
53
+ "devDependencies": {
54
+ "vitest": "4"
53
55
  },
54
56
  "peerDependencies": {
55
57
  "@synerise/ds-core": "*",
56
58
  "react": ">=16.9.0 <= 18.3.1",
57
59
  "react-intl": ">= 3.12.0 <= 6.8",
58
- "styled-components": "^5.3.3",
59
- "vitest": "4"
60
+ "styled-components": "^5.3.3"
60
61
  },
61
- "gitHead": "953d50843fbcbec956b6252a6185def119652282"
62
+ "gitHead": "5ac0f7dcb7c3995b402c86c087d8f32770f80a1d"
62
63
  }