@synerise/ds-broadcast-bar 1.1.28 → 2.0.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,14 @@
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.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-broadcast-bar@1.1.29...@synerise/ds-broadcast-bar@2.0.0) (2026-08-26)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-broadcast-bar
9
+
10
+ ## [1.1.29](https://github.com/Synerise/synerise-design/compare/@synerise/ds-broadcast-bar@1.1.28...@synerise/ds-broadcast-bar@1.1.29) (2026-07-23)
11
+
12
+ **Note:** Version bump only for package @synerise/ds-broadcast-bar
13
+
6
14
  ## [1.1.28](https://github.com/Synerise/synerise-design/compare/@synerise/ds-broadcast-bar@1.1.27...@synerise/ds-broadcast-bar@1.1.28) (2026-06-17)
7
15
 
8
16
  **Note:** Version bump only for package @synerise/ds-broadcast-bar
package/CLAUDE.md ADDED
@@ -0,0 +1,82 @@
1
+ # BroadcastBar (`@synerise/ds-broadcast-bar`)
2
+
3
+ > A full-width notification banner with a coloured background, a type-based icon, an optional description, an optional action button, and an optional close button.
4
+
5
+ ## Package structure
6
+
7
+ ```
8
+ src/
9
+ BroadcastBar.tsx — main component
10
+ BroadcastBar.types.ts — BroadcastBarProps, BroadcastBarType
11
+ BroadcastBar.styles.tsx — styled-components
12
+ constants.tsx — ICONS map and DEFAULT_ICON
13
+ index.ts — public exports
14
+ ```
15
+
16
+ ## Public exports
17
+
18
+ ### `BroadcastBar` (default)
19
+
20
+ | Prop | Type | Default | Description |
21
+ |------|------|---------|-------------|
22
+ | `type` | `BroadcastBarType` | — | **Required.** Controls background colour and default icon. |
23
+ | `description` | `ReactNode` | `undefined` | Main message text. Capped at `max-width: 800px`. |
24
+ | `button` | `ReactNode` | `undefined` | Action button rendered to the right of the description. Rendered inside a semi-transparent white (`rgba(255,255,255,0.2)`) pill. |
25
+ | `withClose` | `boolean` | `undefined` | Shows a close (`×`) icon on the far right. Also shifts content layout to be absolutely centred. |
26
+ | `onCloseClick` | `() => void` | `undefined` | Callback fired when the close icon is clicked. Only relevant when `withClose` is `true`. |
27
+ | `customIcon` | `ReactNode` | `undefined` | Replaces the default type-based icon. |
28
+
29
+ ### Types
30
+
31
+ | Export | Description |
32
+ |--------|-------------|
33
+ | `BroadcastBarProps` | Full props interface |
34
+ | `BroadcastBarType` | `'success' \| 'warning' \| 'negative'` |
35
+
36
+ ## Usage patterns
37
+
38
+ ```tsx
39
+ import BroadcastBar from '@synerise/ds-broadcast-bar';
40
+
41
+ // Minimal
42
+ <BroadcastBar type="warning" description="Scheduled maintenance tonight." />
43
+
44
+ // With action button and close
45
+ <BroadcastBar
46
+ type="negative"
47
+ description="Your session has expired."
48
+ button={<Button type="ghost">Log in again</Button>}
49
+ withClose
50
+ onCloseClick={handleDismiss}
51
+ />
52
+
53
+ // Custom icon
54
+ <BroadcastBar type="success" description="Changes saved." customIcon={<MyIcon />} />
55
+ ```
56
+
57
+ ## Styling
58
+
59
+ Styles live in `BroadcastBar.styles.tsx`. Uses `@synerise/ds-core` theme palette tokens exclusively.
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`
69
+
70
+ 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
+
72
+ ## Key dependencies
73
+
74
+ - `@synerise/ds-icon` — wraps all icons (`Check3M` for success, `WarningFillM` for warning, `ErrorFillM` for negative, `CloseM` for close)
75
+ - `animate.css` — included as a dependency (not directly used in the component source; likely used via global CSS or a consumer)
76
+
77
+ ## Implementation notes
78
+
79
+ - **`type` is required but has no TypeScript default** — passing no `type` will cause a TS error.
80
+ - **Default icon fallback** — if `type` is not in the `ICONS` map (which shouldn't happen with strict typing), `DEFAULT_ICON` (`<WarningFillM />`) is used.
81
+ - **`withClose` affects layout, not just visibility** — enabling it restructures the bar from a centred flex layout to a relative/absolute layout. Disabling it after first render restores centering.
82
+ - **`button` receives no built-in styling** — the `ButtonWrapper` only provides a semi-transparent pill background. Pass a styled `ds-button` or plain element; size and colour are the caller's responsibility.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-broadcast-bar",
3
- "version": "1.1.28",
3
+ "version": "2.0.0",
4
4
  "description": "BroadcastBar UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -17,6 +17,7 @@
17
17
  "files": [
18
18
  "/dist",
19
19
  "CHANGELOG.md",
20
+ "CLAUDE.md",
20
21
  "README.md",
21
22
  "package.json",
22
23
  "LICENSE.md"
@@ -40,7 +41,7 @@
40
41
  ],
41
42
  "types": "dist/index.d.ts",
42
43
  "dependencies": {
43
- "@synerise/ds-icon": "^1.18.4"
44
+ "@synerise/ds-icon": "^2.0.0"
44
45
  },
45
46
  "peerDependencies": {
46
47
  "@synerise/ds-core": "*",
@@ -48,5 +49,5 @@
48
49
  "styled-components": "^5.3.3",
49
50
  "vitest": "4"
50
51
  },
51
- "gitHead": "d8c64070f58f14e3fb1bfbcbf00d1e3b8fd51eb8"
52
+ "gitHead": "033854a18f038079e9a16b0ff250f8401a2287c2"
52
53
  }