@synerise/ds-toolbar 1.1.63 → 1.1.64
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 +148 -0
- package/package.json +7 -6
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.1.64](https://github.com/Synerise/synerise-design/compare/@synerise/ds-toolbar@1.1.63...@synerise/ds-toolbar@1.1.64) (2026-07-23)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-toolbar
|
|
9
|
+
|
|
6
10
|
## [1.1.63](https://github.com/Synerise/synerise-design/compare/@synerise/ds-toolbar@1.1.62...@synerise/ds-toolbar@1.1.63) (2026-07-16)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @synerise/ds-toolbar
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# Toolbar (`@synerise/ds-toolbar`)
|
|
2
|
+
|
|
3
|
+
> A horizontal container for grouping action buttons, labels, and dividers into visually separated groups — typically used as a floating or fixed canvas/editor toolbar.
|
|
4
|
+
|
|
5
|
+
## Package structure
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
src/
|
|
9
|
+
Toolbar.tsx — root container (flex row, 8px gap)
|
|
10
|
+
Toolbar.types.ts — all prop types for Toolbar, ToolbarGroup, ToolbarButton, ToolbarLabel, ToolbarDivider
|
|
11
|
+
Toolbar.styles.ts — styled-components for all sub-components
|
|
12
|
+
components/
|
|
13
|
+
index.ts — re-exports all sub-components
|
|
14
|
+
ToolbarButton/
|
|
15
|
+
ToolbarButton.tsx — button with optional Badge and Tooltip wrapping
|
|
16
|
+
ToolbarDivider/
|
|
17
|
+
ToolbarDivider.tsx — vertical separator line
|
|
18
|
+
ToolbarGroup/
|
|
19
|
+
ToolbarGroup.tsx — card-like group with white background and shadow
|
|
20
|
+
ToolbarLabel/
|
|
21
|
+
ToolbarLabel.tsx — centred text label (e.g. zoom percentage)
|
|
22
|
+
__specs__/
|
|
23
|
+
Toolbar.spec.tsx
|
|
24
|
+
ToolbarButton.spec.tsx
|
|
25
|
+
ToolbarGroup.spec.tsx
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Public exports
|
|
29
|
+
|
|
30
|
+
`index.ts` exports:
|
|
31
|
+
|
|
32
|
+
- `default` — `Toolbar` (default export)
|
|
33
|
+
- `ToolbarGroup`
|
|
34
|
+
- `ToolbarButton`
|
|
35
|
+
- `ToolbarLabel`
|
|
36
|
+
- `ToolbarDivider`
|
|
37
|
+
- `ToolbarProps` (type)
|
|
38
|
+
|
|
39
|
+
### `Toolbar`
|
|
40
|
+
|
|
41
|
+
| Prop | Type | Default | Description |
|
|
42
|
+
|------|------|---------|-------------|
|
|
43
|
+
| children | `ReactNode` | — | Content rendered inside the toolbar |
|
|
44
|
+
| ..htmlAttributes | `HTMLAttributes<HTMLDivElement>` | — | Spread onto the root `<div>` |
|
|
45
|
+
|
|
46
|
+
### `ToolbarGroup`
|
|
47
|
+
|
|
48
|
+
| Prop | Type | Default | Description |
|
|
49
|
+
|------|------|---------|-------------|
|
|
50
|
+
| children | `ReactNode` | — | Buttons, labels, and dividers inside this group |
|
|
51
|
+
| isCompact | `boolean` | `false` | Removes the 4px gap between children when `true` |
|
|
52
|
+
| ..htmlAttributes | `HTMLAttributes<HTMLDivElement>` | — | Spread onto the root `<div>` |
|
|
53
|
+
|
|
54
|
+
### `ToolbarButton`
|
|
55
|
+
|
|
56
|
+
Extends `ButtonProps` from `@synerise/ds-button` with `type` overridden.
|
|
57
|
+
|
|
58
|
+
| Prop | Type | Default | Description |
|
|
59
|
+
|------|------|---------|-------------|
|
|
60
|
+
| type | `'ghost-primary' \| 'ghost' \| 'custom-color-ghost'` | `'ghost'` | Button variant; defaults to `'ghost'` when not set |
|
|
61
|
+
| tooltipProps | `TooltipProps` | — | When provided, wraps the button in `@synerise/ds-tooltip` |
|
|
62
|
+
| badgeProps | `BadgeProps` | — | When provided, wraps the button in `@synerise/ds-badge` |
|
|
63
|
+
| mode | `ButtonProps['mode']` | — | Inherited from `ds-button` — use `'single-icon'` or `'icon-label'` |
|
|
64
|
+
| tagProps | `ButtonProps['tagProps']` | — | Inherited from `ds-button` — renders a coloured tag on the button |
|
|
65
|
+
|
|
66
|
+
> Note: `type` is omitted from `ButtonProps` and re-declared with the three ghost variants only.
|
|
67
|
+
|
|
68
|
+
### `ToolbarLabel`
|
|
69
|
+
|
|
70
|
+
| Prop | Type | Default | Description |
|
|
71
|
+
|------|------|---------|-------------|
|
|
72
|
+
| children | `ReactNode` | — | Label text (e.g. `"100%"`) |
|
|
73
|
+
| ..htmlAttributes | `HTMLAttributes<HTMLDivElement>` | — | Spread onto the root `<div>` |
|
|
74
|
+
|
|
75
|
+
### `ToolbarDivider`
|
|
76
|
+
|
|
77
|
+
| Prop | Type | Default | Description |
|
|
78
|
+
|------|------|---------|-------------|
|
|
79
|
+
| ..htmlAttributes | `HTMLAttributes<HTMLDivElement>` | — | Spread onto the root `<div>` |
|
|
80
|
+
|
|
81
|
+
> Renders a 1px vertical line that extends 4px above and below its container to fill the `ToolbarGroup` padding.
|
|
82
|
+
|
|
83
|
+
## Usage patterns
|
|
84
|
+
|
|
85
|
+
```tsx
|
|
86
|
+
import Toolbar, { ToolbarGroup, ToolbarButton, ToolbarLabel, ToolbarDivider } from '@synerise/ds-toolbar';
|
|
87
|
+
import Icon, { StepBackM, StepForwardM, AddM, RemoveM } from '@synerise/ds-icon';
|
|
88
|
+
|
|
89
|
+
// Basic toolbar with compact zoom group
|
|
90
|
+
<Toolbar>
|
|
91
|
+
<ToolbarGroup>
|
|
92
|
+
<ToolbarButton mode="single-icon">
|
|
93
|
+
<Icon component={<StepBackM />} />
|
|
94
|
+
</ToolbarButton>
|
|
95
|
+
<ToolbarButton mode="single-icon">
|
|
96
|
+
<Icon component={<StepForwardM />} />
|
|
97
|
+
</ToolbarButton>
|
|
98
|
+
</ToolbarGroup>
|
|
99
|
+
|
|
100
|
+
<ToolbarGroup isCompact>
|
|
101
|
+
<ToolbarButton mode="single-icon">
|
|
102
|
+
<Icon component={<AddM />} />
|
|
103
|
+
</ToolbarButton>
|
|
104
|
+
<ToolbarLabel>100%</ToolbarLabel>
|
|
105
|
+
<ToolbarButton mode="single-icon">
|
|
106
|
+
<Icon component={<RemoveM />} />
|
|
107
|
+
</ToolbarButton>
|
|
108
|
+
</ToolbarGroup>
|
|
109
|
+
</Toolbar>
|
|
110
|
+
|
|
111
|
+
// Button with badge and tooltip
|
|
112
|
+
<ToolbarButton
|
|
113
|
+
mode="icon-label"
|
|
114
|
+
badgeProps={{ count: '5', outlined: true }}
|
|
115
|
+
tooltipProps={{ title: 'Issues' }}
|
|
116
|
+
>
|
|
117
|
+
<Icon component={<WarningM />} />
|
|
118
|
+
Issues
|
|
119
|
+
</ToolbarButton>
|
|
120
|
+
|
|
121
|
+
// Divider inside a group (SchedulerToolbar pattern)
|
|
122
|
+
<ToolbarGroup>
|
|
123
|
+
<ToolbarButton type="ghost" mode="icon-label">..</ToolbarButton>
|
|
124
|
+
<ToolbarDivider />
|
|
125
|
+
<ToolbarButton type="ghost" mode="single-icon">..</ToolbarButton>
|
|
126
|
+
</ToolbarGroup>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Styling
|
|
130
|
+
|
|
131
|
+
- `Toolbar` — `display: flex; gap: 8px` — a flat flex row of groups.
|
|
132
|
+
- `ToolbarGroup` — white background, `padding: 4px`, `border-radius: 3px`, drop-shadow using `grey-900` at 4% opacity. Default inner gap is `4px`; `isCompact` removes it.
|
|
133
|
+
- `ToolbarLabel` — centred flex container, `padding: 0 12px`, medium weight, `grey-600` text colour.
|
|
134
|
+
- `ToolbarDivider` — 1px wide, `height: calc(100% + 8px)`, `margin: -4px 0` to bleed through the group's 4px padding; colour `grey-200`.
|
|
135
|
+
- All colour values come from the styled-components theme (`props.theme.palette`).
|
|
136
|
+
|
|
137
|
+
## Key dependencies
|
|
138
|
+
|
|
139
|
+
- `@synerise/ds-button` — `ToolbarButton` renders a `<Button>` with `type="ghost"` as the base.
|
|
140
|
+
- `@synerise/ds-badge` — conditionally wraps `ToolbarButton` when `badgeProps` is provided.
|
|
141
|
+
- `@synerise/ds-tooltip` — conditionally wraps `ToolbarButton` (or the Badge-wrapped button) when `tooltipProps` is provided.
|
|
142
|
+
- `@synerise/ds-utils` — provides `WithHTMLAttributes` helper type.
|
|
143
|
+
|
|
144
|
+
## Implementation notes
|
|
145
|
+
|
|
146
|
+
- `ToolbarButton` internally always passes `type="ghost"` to the underlying `<Button>`. The `type` prop on `ToolbarButtonProps` is typed as the three ghost variants but the component does not forward it to `<Button>` — the actual `type` prop passed to `Button` is hardcoded to `"ghost"`. If a different ghost variant is needed, the caller must handle it via another mechanism.
|
|
147
|
+
- Wrapping order when both `badgeProps` and `tooltipProps` are set: `Tooltip > Badge > Button`.
|
|
148
|
+
- Tests use Jest (not Vitest) — `jest.config.js` is present at the package root.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-toolbar",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.64",
|
|
4
4
|
"description": "Toolbar 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-badge": "^1.0.
|
|
45
|
-
"@synerise/ds-button": "^1.5.
|
|
46
|
-
"@synerise/ds-tooltip": "^1.5.
|
|
47
|
-
"@synerise/ds-utils": "^1.10.
|
|
45
|
+
"@synerise/ds-badge": "^1.0.58",
|
|
46
|
+
"@synerise/ds-button": "^1.5.35",
|
|
47
|
+
"@synerise/ds-tooltip": "^1.5.4",
|
|
48
|
+
"@synerise/ds-utils": "^1.10.2"
|
|
48
49
|
},
|
|
49
50
|
"peerDependencies": {
|
|
50
51
|
"@synerise/ds-core": "*",
|
|
@@ -53,5 +54,5 @@
|
|
|
53
54
|
"styled-components": "^5.3.3",
|
|
54
55
|
"vitest": "4"
|
|
55
56
|
},
|
|
56
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "d0a43cc43d8528a36f105aceea52ab470edb71d9"
|
|
57
58
|
}
|