@synerise/ds-inline-alert 1.1.26 → 1.1.28
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 +8 -0
- package/CLAUDE.md +96 -0
- package/package.json +5 -4
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
|
+
## [1.1.28](https://github.com/Synerise/synerise-design/compare/@synerise/ds-inline-alert@1.1.27...@synerise/ds-inline-alert@1.1.28) (2026-07-23)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-inline-alert
|
|
9
|
+
|
|
10
|
+
## [1.1.27](https://github.com/Synerise/synerise-design/compare/@synerise/ds-inline-alert@1.1.26...@synerise/ds-inline-alert@1.1.27) (2026-06-17)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @synerise/ds-inline-alert
|
|
13
|
+
|
|
6
14
|
## [1.1.26](https://github.com/Synerise/synerise-design/compare/@synerise/ds-inline-alert@1.1.25...@synerise/ds-inline-alert@1.1.26) (2026-06-11)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @synerise/ds-inline-alert
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# InlineAlert (`@synerise/ds-inline-alert`)
|
|
2
|
+
|
|
3
|
+
> A compact inline status indicator — an icon (colour-coded by type) followed by an optional message, emphasis text, or link.
|
|
4
|
+
|
|
5
|
+
## Package structure
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
src/
|
|
9
|
+
InlineAlert.tsx — main component
|
|
10
|
+
InlineAlert.types.ts — InlineAlertProps, InlineAlertType
|
|
11
|
+
InlineAlert.styles.tsx — styled wrapper + message/emphasis/link subcomponents
|
|
12
|
+
InlineAlert.const.tsx — ICONS map (type → icon element)
|
|
13
|
+
index.ts — public exports (default + all types)
|
|
14
|
+
__specs__/
|
|
15
|
+
InlineAlert.spec.tsx — Vitest tests (message render, withLink render)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Public exports
|
|
19
|
+
|
|
20
|
+
`index.ts` does `export * from './InlineAlert.types'` — all types are public.
|
|
21
|
+
|
|
22
|
+
### `InlineAlert` (default export)
|
|
23
|
+
|
|
24
|
+
`InlineAlertProps = WithHTMLAttributes<HTMLDivElement, { … }>`
|
|
25
|
+
|
|
26
|
+
| Prop | Type | Default | Description |
|
|
27
|
+
|------|------|---------|-------------|
|
|
28
|
+
| `type` | `InlineAlertType` | `'warning'` | Visual style variant; drives icon and colour |
|
|
29
|
+
| `message` | `ReactNode` | — | Main message text; nothing renders if absent |
|
|
30
|
+
| `withLink` | `ReactNode` | — | Appended to the message with underline + pointer cursor |
|
|
31
|
+
| `withEmphasis` | `ReactNode` | — | Appended to the message in bold; **ignored when `withLink` is also set** |
|
|
32
|
+
| `hoverButton` | `boolean` | — | Adds `cursor: pointer` and darker hover colour |
|
|
33
|
+
| `disabled` | `boolean` | — | Sets `pointer-events: none; opacity: 0.4` |
|
|
34
|
+
| `customIcon` | `ReactNode` | — | Replaces the default type icon entirely |
|
|
35
|
+
| `iconAlert` | `boolean` | — | **`@deprecated`** — no effect in current implementation |
|
|
36
|
+
| `className` | `string` | — | Appended after `ds-inline-alert` |
|
|
37
|
+
|
|
38
|
+
No `forwardRef`.
|
|
39
|
+
|
|
40
|
+
### `InlineAlertType`
|
|
41
|
+
|
|
42
|
+
`'success' | 'alert' | 'warning' | 'info'`
|
|
43
|
+
|
|
44
|
+
### `InlineAlertProps`
|
|
45
|
+
|
|
46
|
+
Full props type re-export.
|
|
47
|
+
|
|
48
|
+
## Usage patterns
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
import InlineAlert from '@synerise/ds-inline-alert';
|
|
52
|
+
|
|
53
|
+
// Basic
|
|
54
|
+
<InlineAlert type="success" message="Changes saved." />
|
|
55
|
+
|
|
56
|
+
// With a link appended
|
|
57
|
+
<InlineAlert type="warning" message="Session expiring." withLink={<a href="#">Renew</a>} />
|
|
58
|
+
|
|
59
|
+
// With bold emphasis (ignored if withLink is also set)
|
|
60
|
+
<InlineAlert type="alert" message="Failed." withEmphasis="Please retry." />
|
|
61
|
+
|
|
62
|
+
// Custom icon
|
|
63
|
+
<InlineAlert type="info" message="Note" customIcon={<MyIcon />} />
|
|
64
|
+
|
|
65
|
+
// Disabled
|
|
66
|
+
<InlineAlert type="info" message="Loading.." disabled />
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Styling
|
|
70
|
+
|
|
71
|
+
All styles in `InlineAlert.styles.tsx`. Key colour mapping (from `theme.palette`):
|
|
72
|
+
|
|
73
|
+
| Type | Normal | Hover (`hoverButton`) |
|
|
74
|
+
|------|--------|-----------------------|
|
|
75
|
+
| `success` | `green-600` | `green-700` |
|
|
76
|
+
| `warning` | `yellow-600` | `yellow-700` |
|
|
77
|
+
| `alert` | `red-600` | `red-700` |
|
|
78
|
+
| `info` | `grey-600` | `grey-700` |
|
|
79
|
+
|
|
80
|
+
The **icon** inherits the type colour; the **message text** is always `grey-600` regardless of type.
|
|
81
|
+
|
|
82
|
+
`withLink` content is underlined and inherits the icon colour. `withEmphasis` content is `font-weight: 500` and also inherits the icon colour.
|
|
83
|
+
|
|
84
|
+
The root element is a `<span>` (`display: flex`), not a `<div>`, so it can be used inline.
|
|
85
|
+
|
|
86
|
+
## Key dependencies
|
|
87
|
+
|
|
88
|
+
- `@synerise/ds-icon` — renders the type icon (`Check3M`, `WarningFillM`, `InfoFillM`)
|
|
89
|
+
- `@synerise/ds-utils` — `WithHTMLAttributes` utility type
|
|
90
|
+
|
|
91
|
+
## Implementation notes
|
|
92
|
+
|
|
93
|
+
- **`withLink` takes priority over `withEmphasis`** — they are rendered in a mutually exclusive `if/else` branch; passing both will silently suppress `withEmphasis`.
|
|
94
|
+
- **`alert` and `warning` use the same icon** (`WarningFillM`) — only the colour differs.
|
|
95
|
+
- **`iconAlert` is deprecated** and does nothing in the current code; the prop is accepted (no TS error) but never read in the render path.
|
|
96
|
+
- **Uses Vitest**.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-inline-alert",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.28",
|
|
4
4
|
"description": "InlineAlert 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,8 +41,8 @@
|
|
|
40
41
|
],
|
|
41
42
|
"types": "dist/index.d.ts",
|
|
42
43
|
"dependencies": {
|
|
43
|
-
"@synerise/ds-icon": "^1.18.
|
|
44
|
-
"@synerise/ds-utils": "^1.10.
|
|
44
|
+
"@synerise/ds-icon": "^1.18.5",
|
|
45
|
+
"@synerise/ds-utils": "^1.10.2"
|
|
45
46
|
},
|
|
46
47
|
"peerDependencies": {
|
|
47
48
|
"@synerise/ds-core": "*",
|
|
@@ -49,5 +50,5 @@
|
|
|
49
50
|
"styled-components": "^5.3.3",
|
|
50
51
|
"vitest": "4"
|
|
51
52
|
},
|
|
52
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "d0a43cc43d8528a36f105aceea52ab470edb71d9"
|
|
53
54
|
}
|