@synerise/ds-status 2.0.11 → 2.1.1

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,25 @@
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.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-status@2.1.0...@synerise/ds-status@2.1.1) (2026-11-03)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-status
9
+
10
+
11
+
12
+
13
+
14
+ # [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)
15
+
16
+
17
+ ### Features
18
+
19
+ * integrate Token Studio design tokens across the design system ([aabb447](https://github.com/Synerise/synerise-design/commit/aabb447edfb2d0c85e3de1f07e809ef84083453b))
20
+
21
+
22
+
23
+
24
+
6
25
  ## [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
26
 
8
27
  **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' // 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
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`. 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`.
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 `blue-600`** — they are functionally identical in the current colour mapping.
73
- - **`disabled` and `default` both map to `grey-500`** — functionally identical.
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.
@@ -1,21 +1,35 @@
1
1
  import styled, { css } from "styled-components";
2
2
  import Tag from "@synerise/ds-tag";
3
- const typeColor = (props) => ({
4
- primary: props.theme.palette["blue-600"],
5
- danger: props.theme.palette["red-600"],
6
- warning: props.theme.palette["yellow-700"],
7
- success: props.theme.palette["green-700"],
8
- info: props.theme.palette["blue-600"],
9
- default: props.theme.palette["grey-500"],
10
- disabled: props.theme.palette["grey-500"],
11
- custom: null
12
- })[props.type];
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 color = typeColor(props);
18
- return color && css(["color:", ";border-color:", ";"], color, color);
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.11",
3
+ "version": "2.1.1",
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.11",
46
- "@synerise/ds-utils": "^2.2.2"
45
+ "@synerise/ds-tag": "^2.1.1",
46
+ "@synerise/ds-utils": "^2.3.1"
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": "c356039703d8826bbbdb6dadcb18bb008fea8bc5"
56
+ "gitHead": "2d2a540b35fddf8855da45f0dec2f4612c6d87b6"
57
57
  }