@synerise/ds-status 2.0.11 → 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 +11 -0
- package/CLAUDE.md +11 -11
- package/dist/Status.styles.js +26 -12
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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-status@2.0.11...@synerise/ds-status@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
|
+
|
|
6
17
|
## [2.0.11](https://github.com/Synerise/synerise-design/compare/@synerise/ds-status@2.0.10...@synerise/ds-status@2.0.11) (2026-10-28)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @synerise/ds-status
|
package/CLAUDE.md
CHANGED
|
@@ -22,7 +22,7 @@ src/
|
|
|
22
22
|
|
|
23
23
|
| Prop | Type | Default | Description |
|
|
24
24
|
|------|------|---------|-------------|
|
|
25
|
-
| `type` | `StatusType` | `'primary'` | Semantic type; controls border/text colour |
|
|
25
|
+
| `type` | `StatusType` | `'primary'` | Semantic type; controls border/text colour. An unknown value renders as `neutral` |
|
|
26
26
|
| `label` | `string` | — | **Required.** Text inside the badge |
|
|
27
27
|
| `color` | `string` | — | Custom colour (only effective when `type='custom'`) |
|
|
28
28
|
| `dashed` | `boolean` | — | Renders a dashed border instead of solid |
|
|
@@ -34,13 +34,13 @@ src/
|
|
|
34
34
|
|
|
35
35
|
```ts
|
|
36
36
|
type StatusType =
|
|
37
|
-
| 'primary' //
|
|
38
|
-
| 'success' //
|
|
39
|
-
| 'warning' //
|
|
40
|
-
| 'danger' //
|
|
41
|
-
| 'info' //
|
|
42
|
-
| 'disabled' //
|
|
43
|
-
| 'default' //
|
|
37
|
+
| 'primary' // info variant
|
|
38
|
+
| 'success' // success variant
|
|
39
|
+
| 'warning' // warning variant
|
|
40
|
+
| 'danger' // error variant
|
|
41
|
+
| 'info' // info variant (same as primary)
|
|
42
|
+
| 'disabled' // neutral variant
|
|
43
|
+
| 'default' // neutral variant
|
|
44
44
|
| 'custom'; // uses color prop
|
|
45
45
|
```
|
|
46
46
|
|
|
@@ -60,7 +60,7 @@ import Status from '@synerise/ds-status';
|
|
|
60
60
|
|
|
61
61
|
## Styling
|
|
62
62
|
|
|
63
|
-
`StatusTag` in `Status.styles.ts` extends `@synerise/ds-tag`.
|
|
63
|
+
`StatusTag` in `Status.styles.ts` extends `@synerise/ds-tag`. `TYPE_TO_TOKEN_VARIANT` maps `type` to a status-pill variant (`primary`/`info` → `info`, `danger` → `error`, `default`/`disabled` → `neutral`, …), and the text and border use `--ds-status-pill-variant-<variant>-text` / `-border-solid|dashed`. An unknown `type` falls back to `neutral`. For `type='custom'` 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
64
|
|
|
65
65
|
## Key dependencies
|
|
66
66
|
|
|
@@ -69,7 +69,7 @@ import Status from '@synerise/ds-status';
|
|
|
69
69
|
|
|
70
70
|
## Implementation notes
|
|
71
71
|
|
|
72
|
-
- **`info` and `primary` both map to `
|
|
73
|
-
- **`disabled` and `default` both map to `
|
|
72
|
+
- **`info` and `primary` both map to the `info` status-pill variant** — they are functionally identical in the current colour mapping.
|
|
73
|
+
- **`disabled` and `default` both map to the `neutral` status-pill variant** — functionally identical.
|
|
74
74
|
- **`custom` type**: pass `color` prop for the badge colour; without it the badge renders unstyled (no colour CSS applied).
|
|
75
75
|
- **Uses Vitest** for testing.
|
package/dist/Status.styles.js
CHANGED
|
@@ -1,21 +1,35 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
2
|
import Tag from "@synerise/ds-tag";
|
|
3
|
-
const
|
|
4
|
-
primary:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
default:
|
|
10
|
-
disabled:
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
const TYPE_TO_TOKEN_VARIANT = {
|
|
4
|
+
primary: "info",
|
|
5
|
+
info: "info",
|
|
6
|
+
danger: "error",
|
|
7
|
+
warning: "warning",
|
|
8
|
+
success: "success",
|
|
9
|
+
default: "neutral",
|
|
10
|
+
disabled: "neutral"
|
|
11
|
+
};
|
|
12
|
+
const tokenVariant = (type) => TYPE_TO_TOKEN_VARIANT[type] ?? "neutral";
|
|
13
|
+
const variantText = (type) => {
|
|
14
|
+
if (type === "custom") {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
return `var(--ds-status-pill-variant-${tokenVariant(type)}-text)`;
|
|
18
|
+
};
|
|
19
|
+
const variantBorder = (type, dashed) => {
|
|
20
|
+
if (type === "custom") {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const style = dashed ? "dashed" : "solid";
|
|
24
|
+
return `var(--ds-status-pill-variant-${tokenVariant(type)}-border-${style})`;
|
|
25
|
+
};
|
|
13
26
|
const StatusTag = /* @__PURE__ */ styled(Tag).withConfig({
|
|
14
27
|
displayName: "Statusstyles__StatusTag",
|
|
15
28
|
componentId: "sc-1yv28da-0"
|
|
16
29
|
})(["&&{transition:opacity 0.25s;border:", ";", "}"], (props) => props.dashed ? "1px dashed" : "1px solid", (props) => {
|
|
17
|
-
const
|
|
18
|
-
|
|
30
|
+
const text = variantText(props.type);
|
|
31
|
+
const border = variantBorder(props.type, props.dashed);
|
|
32
|
+
return text && border && css(["color:", ";border-color:", ";"], text, border);
|
|
19
33
|
});
|
|
20
34
|
export {
|
|
21
35
|
StatusTag
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-status",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Status UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
],
|
|
43
43
|
"types": "dist/index.d.ts",
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@synerise/ds-tag": "^2.0
|
|
46
|
-
"@synerise/ds-utils": "^2.
|
|
45
|
+
"@synerise/ds-tag": "^2.1.0",
|
|
46
|
+
"@synerise/ds-utils": "^2.3.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"vitest": "4"
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"react": ">=16.9.0 <= 18.3.1",
|
|
54
54
|
"styled-components": "^5.3.3"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "5c3d61e30289486d14c7d6becb682e2d4a08ce41"
|
|
57
57
|
}
|