@synerise/ds-tray 1.1.9 → 1.1.11
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 +6 -35
- package/README.md +20 -13
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -3,81 +3,52 @@
|
|
|
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.
|
|
6
|
+
## [1.1.11](https://github.com/Synerise/synerise-design/compare/@synerise/ds-tray@1.1.10...@synerise/ds-tray@1.1.11) (2026-01-07)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @synerise/ds-tray
|
|
9
9
|
|
|
10
|
+
## [1.1.10](https://github.com/Synerise/synerise-design/compare/@synerise/ds-tray@1.1.9...@synerise/ds-tray@1.1.10) (2025-12-15)
|
|
10
11
|
|
|
12
|
+
**Note:** Version bump only for package @synerise/ds-tray
|
|
11
13
|
|
|
14
|
+
## [1.1.9](https://github.com/Synerise/synerise-design/compare/@synerise/ds-tray@1.1.8...@synerise/ds-tray@1.1.9) (2025-11-28)
|
|
12
15
|
|
|
16
|
+
**Note:** Version bump only for package @synerise/ds-tray
|
|
13
17
|
|
|
14
18
|
## [1.1.8](https://github.com/Synerise/synerise-design/compare/@synerise/ds-tray@1.1.7...@synerise/ds-tray@1.1.8) (2025-11-06)
|
|
15
19
|
|
|
16
20
|
**Note:** Version bump only for package @synerise/ds-tray
|
|
17
21
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
22
|
## [1.1.7](https://github.com/Synerise/synerise-design/compare/@synerise/ds-tray@1.1.6...@synerise/ds-tray@1.1.7) (2025-10-22)
|
|
23
23
|
|
|
24
24
|
**Note:** Version bump only for package @synerise/ds-tray
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
26
|
## [1.1.6](https://github.com/Synerise/synerise-design/compare/@synerise/ds-tray@1.1.5...@synerise/ds-tray@1.1.6) (2025-10-16)
|
|
31
27
|
|
|
32
28
|
**Note:** Version bump only for package @synerise/ds-tray
|
|
33
29
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
30
|
## [1.1.5](https://github.com/Synerise/synerise-design/compare/@synerise/ds-tray@1.1.4...@synerise/ds-tray@1.1.5) (2025-10-10)
|
|
39
31
|
|
|
40
32
|
**Note:** Version bump only for package @synerise/ds-tray
|
|
41
33
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
34
|
## [1.1.4](https://github.com/Synerise/synerise-design/compare/@synerise/ds-tray@1.1.3...@synerise/ds-tray@1.1.4) (2025-10-08)
|
|
47
35
|
|
|
48
36
|
**Note:** Version bump only for package @synerise/ds-tray
|
|
49
37
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
38
|
## [1.1.3](https://github.com/Synerise/synerise-design/compare/@synerise/ds-tray@1.1.2...@synerise/ds-tray@1.1.3) (2025-09-25)
|
|
55
39
|
|
|
56
40
|
**Note:** Version bump only for package @synerise/ds-tray
|
|
57
41
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
42
|
## [1.1.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-tray@1.1.1...@synerise/ds-tray@1.1.2) (2025-09-19)
|
|
63
43
|
|
|
64
44
|
**Note:** Version bump only for package @synerise/ds-tray
|
|
65
45
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
46
|
## [1.1.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-tray@1.1.0...@synerise/ds-tray@1.1.1) (2025-09-16)
|
|
71
47
|
|
|
72
48
|
**Note:** Version bump only for package @synerise/ds-tray
|
|
73
49
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
50
|
# 1.1.0 (2025-09-05)
|
|
79
51
|
|
|
80
|
-
|
|
81
52
|
### Features
|
|
82
53
|
|
|
83
|
-
|
|
54
|
+
- **tray:** new component ([4f747b8](https://github.com/Synerise/synerise-design/commit/4f747b8ed29591ec8358d8b7c54d2d7d40374524))
|
package/README.md
CHANGED
|
@@ -21,6 +21,7 @@ yarn add @synerise/ds-tray
|
|
|
21
21
|
- Open/close trays via the `useTray` hook which calls `openTray(id, TrayData)` / `closeTray(id)`.
|
|
22
22
|
|
|
23
23
|
Key source files:
|
|
24
|
+
|
|
24
25
|
- Component: [`Tray`](packages/components/tray/src/Tray.tsx)
|
|
25
26
|
- Props type: [`TrayProps`](packages/components/tray/src/Tray.types.ts)
|
|
26
27
|
- Provider & data shape: [`TrayProvider` / `TrayData`](packages/components/tray/src/components/TrayProvider.tsx)
|
|
@@ -29,10 +30,11 @@ Key source files:
|
|
|
29
30
|
|
|
30
31
|
## Basic usage
|
|
31
32
|
|
|
32
|
-
1
|
|
33
|
+
1. Wrap your app with the provider and mount a `Tray` with a stable id:
|
|
33
34
|
|
|
34
35
|
```tsx
|
|
35
36
|
import React from 'react';
|
|
37
|
+
|
|
36
38
|
import { TrayProvider } from '@synerise/ds-tray';
|
|
37
39
|
import Tray from '@synerise/ds-tray';
|
|
38
40
|
|
|
@@ -45,10 +47,11 @@ const App = () => (
|
|
|
45
47
|
);
|
|
46
48
|
```
|
|
47
49
|
|
|
48
|
-
2
|
|
50
|
+
2. Open the tray from anywhere inside the provider using the hook:
|
|
49
51
|
|
|
50
52
|
```tsx
|
|
51
53
|
import React from 'react';
|
|
54
|
+
|
|
52
55
|
import { useTray } from '@synerise/ds-tray';
|
|
53
56
|
|
|
54
57
|
const Demo = () => {
|
|
@@ -59,7 +62,11 @@ const Demo = () => {
|
|
|
59
62
|
title: 'Details',
|
|
60
63
|
content: <div>Tray content</div>,
|
|
61
64
|
headerRightSide: <span>Extra</span>,
|
|
62
|
-
footer:
|
|
65
|
+
footer: (
|
|
66
|
+
<div>
|
|
67
|
+
<button onClick={() => close('my-tray')}>Close</button>
|
|
68
|
+
</div>
|
|
69
|
+
),
|
|
63
70
|
onClose: (id) => console.log('closed', id),
|
|
64
71
|
});
|
|
65
72
|
};
|
|
@@ -71,22 +78,22 @@ const Demo = () => {
|
|
|
71
78
|
## API
|
|
72
79
|
|
|
73
80
|
Tray component props
|
|
74
|
-
| Property
|
|
81
|
+
| Property | Description | Type | Required | |
|
|
75
82
|
|-------------------------------|----------------------------------------------------|-----------------------------|----------|-----|
|
|
76
|
-
| `id`
|
|
77
|
-
| any other HTML div attributes | `className`, `style`, `data-*`, etc.
|
|
78
|
-
|
|
83
|
+
| `id` | Identifier used to bind the tray to provider state | `string | number` | yes |
|
|
84
|
+
| any other HTML div attributes | `className`, `style`, `data-*`, etc. | `HTMLDivElement` attributes | no | |
|
|
79
85
|
|
|
80
86
|
Tray data (passed to `open(id, data)`) — [`TrayData`](packages/components/tray/src/components/TrayProvider.tsx)
|
|
81
|
-
| Property
|
|
87
|
+
| Property | Description | Type | |
|
|
82
88
|
|-------------------|------------------------------------------------|--------------|------------------|
|
|
83
|
-
| `content`
|
|
84
|
-
| `title`
|
|
85
|
-
| `headerRightSide` | Node rendered in header to the right of title
|
|
86
|
-
| `footer`
|
|
87
|
-
| `onClose`
|
|
89
|
+
| `content` | Main content to render inside the tray | `ReactNode` | |
|
|
90
|
+
| `title` | Header title (node) | `ReactNode` | |
|
|
91
|
+
| `headerRightSide` | Node rendered in header to the right of title | `ReactNode` | |
|
|
92
|
+
| `footer` | Footer node rendered at bottom of tray | `ReactNode` | |
|
|
93
|
+
| `onClose` | Callback invoked when tray close action occurs | `(id: string | number) => void` |
|
|
88
94
|
|
|
89
95
|
Notes
|
|
96
|
+
|
|
90
97
|
- The `Tray` component reads its state from context (`getTrayState(id)`) and returns `null` if not open. See [`Tray.tsx`](packages/components/tray/src/Tray.tsx).
|
|
91
98
|
- The provider stores tray entries keyed by id; you can open different trays by using different ids.
|
|
92
99
|
- The close button in the header calls `closeTray(id)` and triggers `TrayData.onClose` if provided.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-tray",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.11",
|
|
4
4
|
"description": "Tray UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"defs": "tsc --declaration --outDir dist/ --emitDeclarationOnly",
|
|
24
24
|
"prepublish": "npm run build",
|
|
25
25
|
"types": "tsc --noEmit",
|
|
26
|
-
"pack:ci": "
|
|
26
|
+
"pack:ci": "pnpm pack --pack-destination ../../storybook/storybook-static/static",
|
|
27
27
|
"test": "jest",
|
|
28
28
|
"test:watch": "npm run test -- --watchAll",
|
|
29
29
|
"upgrade:ds": "ncu -f \"@synerise/ds-*\" -u"
|
|
@@ -34,16 +34,16 @@
|
|
|
34
34
|
],
|
|
35
35
|
"types": "dist/index.d.ts",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@synerise/ds-button": "^1.5.
|
|
38
|
-
"@synerise/ds-icon": "^1.9.
|
|
39
|
-
"@synerise/ds-scrollbar": "^1.2.
|
|
40
|
-
"@synerise/ds-typography": "^1.0.
|
|
41
|
-
"@synerise/ds-utils": "^1.5.
|
|
37
|
+
"@synerise/ds-button": "^1.5.3",
|
|
38
|
+
"@synerise/ds-icon": "^1.9.2",
|
|
39
|
+
"@synerise/ds-scrollbar": "^1.2.3",
|
|
40
|
+
"@synerise/ds-typography": "^1.0.26",
|
|
41
|
+
"@synerise/ds-utils": "^1.5.2"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@synerise/ds-core": "*",
|
|
45
45
|
"react": ">=16.9.0 <= 18.3.1",
|
|
46
46
|
"styled-components": "^5.3.3"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "f38e4b2dca1d43c39af0b189c93808de62c11e9b"
|
|
49
49
|
}
|