@synerise/ds-broadcast-bar 2.0.7 → 2.1.0

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,28 @@
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.1.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-broadcast-bar@2.0.8...@synerise/ds-broadcast-bar@2.1.0) (2026-10-29)
7
+
8
+
9
+ ### Features
10
+
11
+ * integrate Token Studio design tokens across the design system ([aabb447](https://github.com/Synerise/synerise-design/commit/aabb447edfb2d0c85e3de1f07e809ef84083453b))
12
+
13
+
14
+
15
+
16
+
17
+ ## [2.0.8](https://github.com/Synerise/synerise-design/compare/@synerise/ds-broadcast-bar@2.0.7...@synerise/ds-broadcast-bar@2.0.8) (2026-10-26)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * drop vitest peer dependency and bump vulnerable runtime deps ([2467d36](https://github.com/Synerise/synerise-design/commit/2467d3606aa97141a3a2d80c3ef396e78bee285c))
23
+
24
+
25
+
26
+
27
+
6
28
  ## [2.0.7](https://github.com/Synerise/synerise-design/compare/@synerise/ds-broadcast-bar@2.0.6...@synerise/ds-broadcast-bar@2.0.7) (2026-10-20)
7
29
 
8
30
  **Note:** Version bump only for package @synerise/ds-broadcast-bar
package/CLAUDE.md CHANGED
@@ -56,16 +56,10 @@ import BroadcastBar from '@synerise/ds-broadcast-bar';
56
56
 
57
57
  ## Styling
58
58
 
59
- Styles live in `BroadcastBar.styles.tsx`. Uses `@synerise/ds-core` theme palette tokens exclusively.
59
+ Styles live in `BroadcastBar.styles.tsx`. Uses the `--ds-broadcast-bar-variant-<v>-*` module tokens exclusively.
60
60
 
61
- Background colours per type:
62
- - `success` → `green-600`
63
- - `warning` → `yellow-600`
64
- - `negative` → `red-600`
65
-
66
- Icon / text colour per type:
67
- - `warning` → `grey-800`
68
- - `success` / `negative` → `white`
61
+ Each type maps to a token variant — `success` → `success`, `warning` → `warning`, `negative` → `error` —
62
+ and reads `--ds-broadcast-bar-variant-<v>-bg` (background), `-text` (text) and `-icon` (icon).
69
63
 
70
64
  When `withClose` is `true`, the main content block (`AllContent`) switches to `position: absolute; left: 50%; transform: translateX(-50%)` to keep it visually centred while the close button sits at the far right.
71
65
 
@@ -27,7 +27,7 @@ const BroadcastBar = ({
27
27
  /* @__PURE__ */ jsxs(AllContent, { close: withClose, type, children: [
28
28
  /* @__PURE__ */ jsx(IconWrapper, { type, children: /* @__PURE__ */ jsx(Icon, { component: renderIcon }) }),
29
29
  renderMessage,
30
- /* @__PURE__ */ jsx(ButtonWrapper, { type, children: button })
30
+ /* @__PURE__ */ jsx(ButtonWrapper, { children: button })
31
31
  ] }),
32
32
  withClose && /* @__PURE__ */ jsx(ButtonCloseWrapper, { children: /* @__PURE__ */ jsx(IconCloseWrapper, { onClick: onCloseClick, type, children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(CloseM, {}) }) }) })
33
33
  ] }) });
@@ -11,9 +11,7 @@ export declare const IconWrapper: import('styled-components').StyledComponent<"d
11
11
  export declare const IconCloseWrapper: import('styled-components').StyledComponent<"div", any, {
12
12
  type?: BroadcastBarType;
13
13
  }, never>;
14
- export declare const ButtonWrapper: import('styled-components').StyledComponent<"div", any, {
15
- type?: BroadcastBarType;
16
- }, never>;
14
+ export declare const ButtonWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
17
15
  export declare const ButtonCloseWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
18
16
  export declare const Wrapper: import('styled-components').StyledComponent<"div", any, {
19
17
  type?: BroadcastBarType;
@@ -1,19 +1,13 @@
1
1
  import styled, { css } from "styled-components";
2
- const getColorBackground = (props) => {
3
- if (props.type === "warning") {
4
- return props.theme.palette["yellow-600"];
5
- }
6
- if (props.type === "negative") {
7
- return props.theme.palette["red-600"];
8
- }
9
- return props.theme.palette[`green-600`];
10
- };
11
- const getColorIcon = (props) => {
12
- if (props.type === "warning") {
13
- return props.theme.palette["grey-800"];
14
- }
15
- return props.theme.palette.white;
2
+ const TYPE_TO_TOKEN_VARIANT = {
3
+ success: "success",
4
+ warning: "warning",
5
+ negative: "error"
16
6
  };
7
+ const variantOf = (type) => TYPE_TO_TOKEN_VARIANT[type ?? "success"] ?? "success";
8
+ const getColorBackground = (type) => `var(--ds-broadcast-bar-variant-${variantOf(type)}-bg)`;
9
+ const getColorText = (type) => `var(--ds-broadcast-bar-variant-${variantOf(type)}-text)`;
10
+ const getColorIcon = (type) => `var(--ds-broadcast-bar-variant-${variantOf(type)}-icon)`;
17
11
  const AlertContent = /* @__PURE__ */ styled.div.withConfig({
18
12
  displayName: "BroadcastBarstyles__AlertContent",
19
13
  componentId: "sc-1wlkvzq-0"
@@ -21,19 +15,19 @@ const AlertContent = /* @__PURE__ */ styled.div.withConfig({
21
15
  const AllContent = /* @__PURE__ */ styled.div.withConfig({
22
16
  displayName: "BroadcastBarstyles__AllContent",
23
17
  componentId: "sc-1wlkvzq-1"
24
- })(["display:flex;", ";color:", ";"], (props) => props.close && css(["position:absolute;left:50%;transform:translateX(-50%);"]), (props) => getColorIcon(props));
18
+ })(["display:flex;", ";color:", ";"], (props) => props.close && css(["position:absolute;left:50%;transform:translateX(-50%);"]), (props) => getColorText(props.type));
25
19
  const IconWrapper = /* @__PURE__ */ styled.div.withConfig({
26
20
  displayName: "BroadcastBarstyles__IconWrapper",
27
21
  componentId: "sc-1wlkvzq-2"
28
- })(["margin:8px 12px;color:", ";"], (props) => getColorIcon(props));
22
+ })(["margin:8px 12px;color:", ";"], (props) => getColorIcon(props.type));
29
23
  const IconCloseWrapper = /* @__PURE__ */ styled.div.withConfig({
30
24
  displayName: "BroadcastBarstyles__IconCloseWrapper",
31
25
  componentId: "sc-1wlkvzq-3"
32
- })(["margin:3px 5px 2px;cursor:pointer;color:", ";"], (props) => getColorIcon(props));
26
+ })(["margin:3px 5px 2px;cursor:pointer;color:", ";"], (props) => getColorIcon(props.type));
33
27
  const ButtonWrapper = /* @__PURE__ */ styled.div.withConfig({
34
28
  displayName: "BroadcastBarstyles__ButtonWrapper",
35
29
  componentId: "sc-1wlkvzq-4"
36
- })(["margin:6px 8px;border-radius:3px;display:flex;background-color:rgba(255,255,255,0.2);"]);
30
+ })(["margin:6px 8px;display:flex;"]);
37
31
  const ButtonCloseWrapper = /* @__PURE__ */ styled.div.withConfig({
38
32
  displayName: "BroadcastBarstyles__ButtonCloseWrapper",
39
33
  componentId: "sc-1wlkvzq-5"
@@ -41,15 +35,15 @@ const ButtonCloseWrapper = /* @__PURE__ */ styled.div.withConfig({
41
35
  const Wrapper = /* @__PURE__ */ styled.div.withConfig({
42
36
  displayName: "BroadcastBarstyles__Wrapper",
43
37
  componentId: "sc-1wlkvzq-6"
44
- })(["margin-top:10px;color:", ";"], (props) => getColorIcon(props));
38
+ })(["margin-top:10px;color:", ";"], (props) => getColorText(props.type));
45
39
  const Container = /* @__PURE__ */ styled.div.withConfig({
46
40
  displayName: "BroadcastBarstyles__Container",
47
41
  componentId: "sc-1wlkvzq-7"
48
- })(["width:100%;display:flex;justify-content:", ";position:relative;background-color:", ";"], (props) => props.close ? "space-between" : "center", (props) => getColorBackground(props));
42
+ })(["width:100%;display:flex;justify-content:", ";position:relative;background-color:", ";"], (props) => props.close ? "space-between" : "center", (props) => getColorBackground(props.type));
49
43
  const WrapperBroadcastBar = /* @__PURE__ */ styled.div.withConfig({
50
44
  displayName: "BroadcastBarstyles__WrapperBroadcastBar",
51
45
  componentId: "sc-1wlkvzq-8"
52
- })(["font-size:13px;", ";color:", ";"], (props) => props.close && css(["margin-left:auto;"]), (props) => getColorIcon(props));
46
+ })(["font-size:13px;", ";color:", ";"], (props) => props.close && css(["margin-left:auto;"]), (props) => getColorText(props.type));
53
47
  const AlertDescription = /* @__PURE__ */ styled.span.withConfig({
54
48
  displayName: "BroadcastBarstyles__AlertDescription",
55
49
  componentId: "sc-1wlkvzq-9"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-broadcast-bar",
3
- "version": "2.0.7",
3
+ "version": "2.1.0",
4
4
  "description": "BroadcastBar UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -41,13 +41,15 @@
41
41
  ],
42
42
  "types": "dist/index.d.ts",
43
43
  "dependencies": {
44
- "@synerise/ds-icon": "^2.2.2"
44
+ "@synerise/ds-icon": "^2.3.0"
45
+ },
46
+ "devDependencies": {
47
+ "vitest": "4"
45
48
  },
46
49
  "peerDependencies": {
47
50
  "@synerise/ds-core": "*",
48
51
  "react": ">=16.9.0 <= 18.3.1",
49
- "styled-components": "^5.3.3",
50
- "vitest": "4"
52
+ "styled-components": "^5.3.3"
51
53
  },
52
- "gitHead": "ac1a96b3cd66d2836b0639b3d9920fc0ebd7f8f3"
54
+ "gitHead": "5c3d61e30289486d14c7d6becb682e2d4a08ce41"
53
55
  }