@synerise/ds-description 1.3.14 → 1.3.16
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 +116 -0
- package/package.json +7 -6
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.3.16](https://github.com/Synerise/synerise-design/compare/@synerise/ds-description@1.3.15...@synerise/ds-description@1.3.16) (2026-07-23)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-description
|
|
9
|
+
|
|
10
|
+
## [1.3.15](https://github.com/Synerise/synerise-design/compare/@synerise/ds-description@1.3.14...@synerise/ds-description@1.3.15) (2026-06-17)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @synerise/ds-description
|
|
13
|
+
|
|
6
14
|
## [1.3.14](https://github.com/Synerise/synerise-design/compare/@synerise/ds-description@1.3.13...@synerise/ds-description@1.3.14) (2026-06-11)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @synerise/ds-description
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Description (`@synerise/ds-description`)
|
|
2
|
+
|
|
3
|
+
> Displays labelled key-value pairs in one of several layout modes (table, inline, corner, numbered-list).
|
|
4
|
+
|
|
5
|
+
## Package structure
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
src/
|
|
9
|
+
Description.tsx — root container component
|
|
10
|
+
Description.types.ts — DescriptionProps, DescriptionType, DescriptionRatio
|
|
11
|
+
Description.styles.tsx — styled wrapper; applies layout CSS per type/ratio
|
|
12
|
+
index.ts — public exports
|
|
13
|
+
Row/
|
|
14
|
+
DescriptionRow.tsx — single label+value row
|
|
15
|
+
DescriptionRow.types.ts — DescriptionRowProps, RowTexts
|
|
16
|
+
DescriptionRow.styles.ts — all row-level styled-components
|
|
17
|
+
Copy.tsx — standalone copyable icon (deprecated)
|
|
18
|
+
Copy.types.ts — CopyProps
|
|
19
|
+
Star.tsx — internal active/inactive star indicator
|
|
20
|
+
Star.types.ts — StarProps (internal)
|
|
21
|
+
__specs__/
|
|
22
|
+
Description.spec.tsx — Vitest + React Testing Library tests
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Public exports
|
|
26
|
+
|
|
27
|
+
### `Description` (default export)
|
|
28
|
+
|
|
29
|
+
Root container. Wraps one or more `DescriptionRow` children and controls layout.
|
|
30
|
+
|
|
31
|
+
| Prop | Type | Default | Description |
|
|
32
|
+
|------|------|---------|-------------|
|
|
33
|
+
| `type` | `'table' \| 'inline' \| 'corner' \| 'numbered-list'` | `'table'` | Layout mode |
|
|
34
|
+
| `ratio` | `'50-50' \| '25-75'` | `'50-50'` | Column width split — only effective when `type='table'` |
|
|
35
|
+
| `children` | `JSX.Element \| JSX.Element[]` | — | One or more `DescriptionRow` elements |
|
|
36
|
+
|
|
37
|
+
> When a single child is passed, vertical padding on inner cells is removed (`singleRow` flag).
|
|
38
|
+
|
|
39
|
+
### `DescriptionRow`
|
|
40
|
+
|
|
41
|
+
Renders one label+value row. Used as direct children of `Description`.
|
|
42
|
+
|
|
43
|
+
| Prop | Type | Default | Description |
|
|
44
|
+
|------|------|---------|-------------|
|
|
45
|
+
| `value` | `React.ReactNode` | — | **Required.** Primary content |
|
|
46
|
+
| `label` | `string \| React.ReactNode` | `undefined` | Left-side label; truncated with ellipsis when too long |
|
|
47
|
+
| `labelIcon` | `React.ReactNode` | `undefined` | Icon rendered before the label text |
|
|
48
|
+
| `prefixEl` | `string \| React.ReactNode` | `undefined` | Element before the value |
|
|
49
|
+
| `suffixEl` | `string \| React.ReactNode` | `undefined` | Element after the value |
|
|
50
|
+
| `copyValue` | `string` | `undefined` | Renders a copy-to-clipboard icon; the string is what gets copied |
|
|
51
|
+
| `starType` | `'active' \| 'inactive'` | `undefined` | Renders a star icon before the value (`active` = yellow, `inactive` = grey) |
|
|
52
|
+
| `texts` | `RowTexts` | `undefined` | Override tooltip strings for the copy icon (see below) |
|
|
53
|
+
|
|
54
|
+
`RowTexts` shape:
|
|
55
|
+
```ts
|
|
56
|
+
{ copyTooltip?: string; copiedTooltip?: string; }
|
|
57
|
+
```
|
|
58
|
+
When `texts` is omitted, copy-icon tooltips fall back to `react-intl` message IDs `DS.DESCRIPTION.COPY-VALUE` and `DS.DESCRIPTION.COPIED`.
|
|
59
|
+
|
|
60
|
+
### `DescriptionCopyable` ⚠️ deprecated
|
|
61
|
+
|
|
62
|
+
Stand-alone copy-icon component. Exported for legacy use only — **will be removed in a future version**. New code should use `copyValue` on `DescriptionRow` instead.
|
|
63
|
+
|
|
64
|
+
| Prop | Type | Description |
|
|
65
|
+
|------|------|-------------|
|
|
66
|
+
| `copyValue` | `string` | String to copy to clipboard |
|
|
67
|
+
| `texts` | `RowTexts` | Tooltip text overrides |
|
|
68
|
+
| + HTML div attrs | — | Spreads onto the wrapper `<div>` |
|
|
69
|
+
|
|
70
|
+
## Usage patterns
|
|
71
|
+
|
|
72
|
+
```tsx
|
|
73
|
+
import Description, { DescriptionRow } from '@synerise/ds-description';
|
|
74
|
+
|
|
75
|
+
// Table layout (default)
|
|
76
|
+
<Description type="table" ratio="25-75">
|
|
77
|
+
<DescriptionRow label="Name" value="John Kowalski" />
|
|
78
|
+
<DescriptionRow label="Email" value="j.kowalski@example.com" copyValue="j.kowalski@example.com" />
|
|
79
|
+
</Description>
|
|
80
|
+
|
|
81
|
+
// Inline layout with star and prefix
|
|
82
|
+
<Description type="inline">
|
|
83
|
+
<DescriptionRow
|
|
84
|
+
label="Rating"
|
|
85
|
+
value="5 stars"
|
|
86
|
+
starType="active"
|
|
87
|
+
prefixEl={<Avatar>JK</Avatar>}
|
|
88
|
+
suffixEl={<Button>Edit</Button>}
|
|
89
|
+
/>
|
|
90
|
+
</Description>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Styling
|
|
94
|
+
|
|
95
|
+
- Container styles in `Description.styles.tsx`; row styles in `Row/DescriptionRow.styles.ts`.
|
|
96
|
+
- Uses `props.theme.palette` tokens from `@synerise/ds-core` (e.g. `grey-600`, `grey-800`, `blue-600`, `yellow-600`) — no hardcoded hex values.
|
|
97
|
+
- Copy icon and `Copyable` wrapper are hidden (`visibility: hidden; opacity: 0`) and revealed via CSS `:hover` on `RowWrapper` — no JS toggle needed.
|
|
98
|
+
- `numbered-list` is a valid `DescriptionType` value but has **no dedicated CSS branch** in `Description.styles.tsx`; it falls through to `inlineStyles`.
|
|
99
|
+
|
|
100
|
+
## Key dependencies
|
|
101
|
+
|
|
102
|
+
- `@synerise/ds-copy-icon` — copy-to-clipboard icon used inside `DescriptionRow` via `StyledCopyIcon`
|
|
103
|
+
- `@synerise/ds-icon` — `Icon`, `CopyClipboardM`, `StarFillM`, `StarM`
|
|
104
|
+
- `@synerise/ds-tooltip` — tooltip wrapper on `DescriptionCopyable`
|
|
105
|
+
- `copy-to-clipboard` — clipboard write in `DescriptionCopyable`
|
|
106
|
+
- `react-intl` — default copy-icon tooltip strings (peer dependency)
|
|
107
|
+
- `classnames` — adds `single-row` CSS class on single-child containers
|
|
108
|
+
|
|
109
|
+
## Implementation notes
|
|
110
|
+
|
|
111
|
+
- `Star` is an **internal component** — not exported from `index.ts`. Do not import it directly.
|
|
112
|
+
- `ratio` is silently ignored for `inline` and `corner` types; the styled-component only applies `getColumnsWidth` in the `table` branch.
|
|
113
|
+
- `value` is **required** on `DescriptionRow`; `label` is optional.
|
|
114
|
+
- String `value` and string `label` automatically receive a `title` attribute for native browser tooltip on truncation.
|
|
115
|
+
- Links (`a`, `[href]`) inside a row inherit the row text colour and get a blue hover state via the `RowWrapper` CSS — no extra props needed.
|
|
116
|
+
- `DescriptionCopyable` (Copy) uses `event.stopPropagation()` on mouse enter/leave to prevent bubbling conflicts.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-description",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.16",
|
|
4
4
|
"description": "Description 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,10 +42,10 @@
|
|
|
41
42
|
],
|
|
42
43
|
"types": "dist/index.d.ts",
|
|
43
44
|
"dependencies": {
|
|
44
|
-
"@synerise/ds-copy-icon": "^1.2.
|
|
45
|
-
"@synerise/ds-icon": "^1.18.
|
|
46
|
-
"@synerise/ds-tooltip": "^1.5.
|
|
47
|
-
"@synerise/ds-utils": "^1.10.
|
|
45
|
+
"@synerise/ds-copy-icon": "^1.2.16",
|
|
46
|
+
"@synerise/ds-icon": "^1.18.5",
|
|
47
|
+
"@synerise/ds-tooltip": "^1.5.4",
|
|
48
|
+
"@synerise/ds-utils": "^1.10.2",
|
|
48
49
|
"classnames": "^2.5.1"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
@@ -57,5 +58,5 @@
|
|
|
57
58
|
"react-intl": ">=3.12.0 <= 6.8",
|
|
58
59
|
"styled-components": "^5.3.3"
|
|
59
60
|
},
|
|
60
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "d0a43cc43d8528a36f105aceea52ab470edb71d9"
|
|
61
62
|
}
|