@synerise/ds-status 1.3.31 → 1.3.32
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 +4 -0
- package/CLAUDE.md +75 -0
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
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.3.32](https://github.com/Synerise/synerise-design/compare/@synerise/ds-status@1.3.31...@synerise/ds-status@1.3.32) (2026-07-23)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-status
|
|
9
|
+
|
|
6
10
|
## [1.3.31](https://github.com/Synerise/synerise-design/compare/@synerise/ds-status@1.3.30...@synerise/ds-status@1.3.31) (2026-06-17)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @synerise/ds-status
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Status (`@synerise/ds-status`)
|
|
2
|
+
|
|
3
|
+
> A pill-shaped status badge component that wraps `@synerise/ds-tag` with a `STATUS_NEUTRAL` shape, supporting predefined semantic types and a `custom` type with arbitrary colour.
|
|
4
|
+
|
|
5
|
+
## Package structure
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
src/
|
|
9
|
+
Status.tsx — main component; forwardRef wrapper around Tag
|
|
10
|
+
Status.types.ts — StatusProps, StatusType
|
|
11
|
+
Status.styles.ts — StatusTag styled Tag with type-to-colour mapping
|
|
12
|
+
index.ts — public exports
|
|
13
|
+
__specs__/
|
|
14
|
+
Status.spec.tsx — Vitest tests
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Public exports
|
|
18
|
+
|
|
19
|
+
### `Status` (default export)
|
|
20
|
+
|
|
21
|
+
`forwardRef<HTMLDivElement, StatusProps>` — ref targets the root `<div>`.
|
|
22
|
+
|
|
23
|
+
| Prop | Type | Default | Description |
|
|
24
|
+
|------|------|---------|-------------|
|
|
25
|
+
| `type` | `StatusType` | `'primary'` | Semantic type; controls border/text colour |
|
|
26
|
+
| `label` | `string` | — | **Required.** Text inside the badge |
|
|
27
|
+
| `color` | `string` | — | Custom colour (only effective when `type='custom'`) |
|
|
28
|
+
| `dashed` | `boolean` | — | Renders a dashed border instead of solid |
|
|
29
|
+
| `onClick` | `() => void` | — | Click handler |
|
|
30
|
+
|
|
31
|
+
`StatusProps` extends `WithHTMLAttributes<HTMLDivElement, ..>` — all standard HTML div attributes are forwarded to the root element.
|
|
32
|
+
|
|
33
|
+
### `StatusType`
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
type StatusType =
|
|
37
|
+
| 'primary' // blue-600
|
|
38
|
+
| 'success' // green-700
|
|
39
|
+
| 'warning' // yellow-700
|
|
40
|
+
| 'danger' // red-600
|
|
41
|
+
| 'info' // blue-600 (same as primary)
|
|
42
|
+
| 'disabled' // grey-500
|
|
43
|
+
| 'default' // grey-500
|
|
44
|
+
| 'custom'; // uses color prop
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### `StatusProps`
|
|
48
|
+
|
|
49
|
+
Full props type, re-exported as a named type.
|
|
50
|
+
|
|
51
|
+
## Usage patterns
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
import Status from '@synerise/ds-status';
|
|
55
|
+
|
|
56
|
+
<Status type="success" label="Active" />
|
|
57
|
+
<Status type="danger" label="Failed" onClick={handleClick} />
|
|
58
|
+
<Status type="custom" color="#FF5733" label="Custom" dashed />
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Styling
|
|
62
|
+
|
|
63
|
+
`StatusTag` in `Status.styles.ts` extends `@synerise/ds-tag`. The `typeColor` helper maps `type` to a `theme.palette` token. For `type='custom'`, `typeColor` returns `null` and no colour style is applied — the `color` prop is passed directly to `Tag`. Root element always receives `ds-status` class plus any passed `className`.
|
|
64
|
+
|
|
65
|
+
## Key dependencies
|
|
66
|
+
|
|
67
|
+
- `@synerise/ds-tag` — base `Tag` component rendered with `shape={TagShape.STATUS_NEUTRAL}` and `asPill`
|
|
68
|
+
- `@synerise/ds-utils` — `WithHTMLAttributes` type helper
|
|
69
|
+
|
|
70
|
+
## Implementation notes
|
|
71
|
+
|
|
72
|
+
- **`info` and `primary` both map to `blue-600`** — they are functionally identical in the current colour mapping.
|
|
73
|
+
- **`disabled` and `default` both map to `grey-500`** — functionally identical.
|
|
74
|
+
- **`custom` type**: pass `color` prop for the badge colour; without it the badge renders unstyled (no colour CSS applied).
|
|
75
|
+
- **Uses Vitest** for testing.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-status",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.32",
|
|
4
4
|
"description": "Status 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"
|
|
@@ -41,8 +42,8 @@
|
|
|
41
42
|
],
|
|
42
43
|
"types": "dist/index.d.ts",
|
|
43
44
|
"dependencies": {
|
|
44
|
-
"@synerise/ds-tag": "^1.4.
|
|
45
|
-
"@synerise/ds-utils": "^1.10.
|
|
45
|
+
"@synerise/ds-tag": "^1.4.32",
|
|
46
|
+
"@synerise/ds-utils": "^1.10.2"
|
|
46
47
|
},
|
|
47
48
|
"peerDependencies": {
|
|
48
49
|
"@synerise/ds-core": "*",
|
|
@@ -50,5 +51,5 @@
|
|
|
50
51
|
"styled-components": "^5.3.3",
|
|
51
52
|
"vitest": "4"
|
|
52
53
|
},
|
|
53
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "d0a43cc43d8528a36f105aceea52ab470edb71d9"
|
|
54
55
|
}
|