@synerise/ds-toast 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 +3 -2
- package/dist/Toast.styles.js +12 -37
- package/package.json +5 -5
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-toast@2.0.11...@synerise/ds-toast@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-toast@2.0.10...@synerise/ds-toast@2.0.11) (2026-10-28)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @synerise/ds-toast
|
package/CLAUDE.md
CHANGED
|
@@ -113,8 +113,9 @@ import Toast from '@synerise/ds-toast';
|
|
|
113
113
|
```
|
|
114
114
|
|
|
115
115
|
## Styling
|
|
116
|
-
- `Container` renders a
|
|
117
|
-
-
|
|
116
|
+
- `Container` renders a card (`border-radius: 4px`, `box-shadow: var(--ds-toast-shadow)`, `max-width: 500px`) with the type's `-bg` background and a 2px top border in its `-border` colour.
|
|
117
|
+
- Background, border and icon colours come from `var(--ds-toast-variant-<variant>-{bg,border,icon})`; `type` maps to the variant (`negative` → `error`, others by name).
|
|
118
|
+
- `AlertMessage` and `AlertDescription` use the shared `message` module for every type: `var(--ds-message-text-title)` and `var(--ds-message-text-description)`.
|
|
118
119
|
- `AnimationContainer` plays `openingAnimation` (slide up + fade in from `translateY(60px)`) when `$show=true` and `closingAnimation` (fade out + slight scale-down + `translateY(-8px)`) when `$show=false`. Duration is `0.6s cubic-bezier(0.4,0,0.2,1)`.
|
|
119
120
|
- `AlertMessage` right-padding is computed dynamically: 24px (no icons), 48px (close or expander), 72px (both).
|
|
120
121
|
- `expandedContent` is shown/hidden via `visibility + height: auto/0` (not `display: none`), preserving layout flow.
|
package/dist/Toast.styles.js
CHANGED
|
@@ -1,37 +1,12 @@
|
|
|
1
1
|
import styled, { keyframes } from "styled-components";
|
|
2
2
|
import { UnorderedList } from "@synerise/ds-unordered-list/dist/Unordered-list.styles";
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
case "informative":
|
|
9
|
-
return theme.palette["grey-600"];
|
|
10
|
-
case "negative":
|
|
11
|
-
return theme.palette["red-500"];
|
|
12
|
-
case "warning":
|
|
13
|
-
return theme.palette["yellow-600"];
|
|
14
|
-
case "success":
|
|
15
|
-
default:
|
|
16
|
-
return theme.palette["green-600"];
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
const getBackgroundColorForType = ({
|
|
20
|
-
toastType,
|
|
21
|
-
theme
|
|
22
|
-
}) => {
|
|
23
|
-
switch (toastType) {
|
|
24
|
-
case "informative":
|
|
25
|
-
return theme.palette["grey-600"];
|
|
26
|
-
case "negative":
|
|
27
|
-
return theme.palette["red-500"];
|
|
28
|
-
case "warning":
|
|
29
|
-
return theme.palette["yellow-600"];
|
|
30
|
-
case "success":
|
|
31
|
-
default:
|
|
32
|
-
return theme.palette["green-600"];
|
|
33
|
-
}
|
|
3
|
+
const TYPE_TO_TOKEN_VARIANT = {
|
|
4
|
+
success: "success",
|
|
5
|
+
warning: "warning",
|
|
6
|
+
negative: "error",
|
|
7
|
+
informative: "informative"
|
|
34
8
|
};
|
|
9
|
+
const toastToken = (type, property) => `var(--ds-toast-variant-${TYPE_TO_TOKEN_VARIANT[type]}-${property})`;
|
|
35
10
|
const getWidth = (hasClose, hasExpander) => {
|
|
36
11
|
if (hasClose && hasExpander) {
|
|
37
12
|
return "72px";
|
|
@@ -78,7 +53,7 @@ const FirstButtonWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
|
78
53
|
const NumberWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
79
54
|
displayName: "Toaststyles__NumberWrapper",
|
|
80
55
|
componentId: "sc-wwaizr-8"
|
|
81
|
-
})(["margin-left:4px;color:inherit;opacity:0.6;cursor:pointer;&:hover{background-image:linear-gradient( to right,
|
|
56
|
+
})(["margin-left:4px;color:inherit;opacity:0.6;cursor:pointer;&:hover{background-image:linear-gradient( to right,var(--ds-color-text-base-disabled) 20%,transparent 10% );background-color:transparent;background-position:bottom left;background-size:5px 1px;background-repeat:repeat-x;opacity:1;}"]);
|
|
82
57
|
const ListWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
83
58
|
displayName: "Toaststyles__ListWrapper",
|
|
84
59
|
componentId: "sc-wwaizr-9"
|
|
@@ -86,7 +61,7 @@ const ListWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
|
86
61
|
const IconOrderWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
87
62
|
displayName: "Toaststyles__IconOrderWrapper",
|
|
88
63
|
componentId: "sc-wwaizr-10"
|
|
89
|
-
})(["visibility:hidden;margin:-4px 0;&:hover{
|
|
64
|
+
})(["visibility:hidden;margin:-4px 0;&:hover{cursor:pointer;}"]);
|
|
90
65
|
const OrderWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
91
66
|
displayName: "Toaststyles__OrderWrapper",
|
|
92
67
|
componentId: "sc-wwaizr-11"
|
|
@@ -94,7 +69,7 @@ const OrderWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
|
94
69
|
const Wrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
95
70
|
displayName: "Toaststyles__Wrapper",
|
|
96
71
|
componentId: "sc-wwaizr-12"
|
|
97
|
-
})(["color:
|
|
72
|
+
})(["color:var(--ds-color-text-base-muted);"]);
|
|
98
73
|
const WrapperSectionMessage = /* @__PURE__ */ styled.div.withConfig({
|
|
99
74
|
displayName: "Toaststyles__WrapperSectionMessage",
|
|
100
75
|
componentId: "sc-wwaizr-13"
|
|
@@ -102,15 +77,15 @@ const WrapperSectionMessage = /* @__PURE__ */ styled.div.withConfig({
|
|
|
102
77
|
const AlertMessage = /* @__PURE__ */ styled.div.withConfig({
|
|
103
78
|
displayName: "Toaststyles__AlertMessage",
|
|
104
79
|
componentId: "sc-wwaizr-14"
|
|
105
|
-
})(["font-size:14px;line-height:20px;padding-top:14px;", ";font-weight:500;overflow:hidden;overflow-wrap:break-word;text-overflow:ellipsis;padding-right:", ";"], (props) => props.noToastContent && "padding-bottom: 14px;", (props) => getWidth(props.hasClose, props.hasExpander));
|
|
80
|
+
})(["font-size:14px;line-height:20px;padding-top:14px;", ";font-weight:500;overflow:hidden;overflow-wrap:break-word;text-overflow:ellipsis;padding-right:", ";color:var(--ds-message-text-title);"], (props) => props.noToastContent && "padding-bottom: 14px;", (props) => getWidth(props.hasClose, props.hasExpander));
|
|
106
81
|
const AlertDescription = /* @__PURE__ */ styled.div.withConfig({
|
|
107
82
|
displayName: "Toaststyles__AlertDescription",
|
|
108
83
|
componentId: "sc-wwaizr-15"
|
|
109
|
-
})(["font-size:13px;line-height:1.39;font-weight:normal;overflow:hidden;overflow-wrap:anywhere;text-overflow:ellipsis;padding-bottom:", ";margin-top:2px;"], (props) => props.button || props.expandedContent ? "16px" : "0");
|
|
84
|
+
})(["font-size:13px;line-height:1.39;font-weight:normal;overflow:hidden;overflow-wrap:anywhere;text-overflow:ellipsis;padding-bottom:", ";margin-top:2px;color:var(--ds-message-text-description);"], (props) => props.button || props.expandedContent ? "16px" : "0");
|
|
110
85
|
const Container = /* @__PURE__ */ styled.div.withConfig({
|
|
111
86
|
displayName: "Toaststyles__Container",
|
|
112
87
|
componentId: "sc-wwaizr-16"
|
|
113
|
-
})(["display:flex;flex-direction:row;max-width:500px;align-items:flex-start;justify-content:center;border-top:solid 2px ", ";background-color:", ";border-radius:4px;box-shadow:
|
|
88
|
+
})(["display:flex;flex-direction:row;max-width:500px;align-items:flex-start;justify-content:center;border-top:solid 2px ", ";background-color:", ";border-radius:4px;box-shadow:var(--ds-toast-shadow);", ",", "{color:var(--ds-color-icon-base-default);}", ",", ",", ":hover{color:var(--ds-color-text-base-muted);}", ":hover{", "{background-image:linear-gradient( to right,var(--ds-color-text-base-muted) 20%,transparent 10% );color:var(--ds-color-text-base-muted);}}", "{color:", ";}"], (props) => toastToken(props.toastType, "border"), (props) => toastToken(props.toastType, "bg"), IconExpanderWrapper, IconCloseWrapper, OrderWrapper, ListWrapper, NumberWrapper, OrderWrapper, NumberWrapper, IconWrapper, (props) => toastToken(props.toastType, "icon"));
|
|
114
89
|
export {
|
|
115
90
|
AlertContent,
|
|
116
91
|
AlertDescription,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-toast",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Toast UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
],
|
|
43
43
|
"types": "dist/index.d.ts",
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@synerise/ds-icon": "^2.
|
|
46
|
-
"@synerise/ds-unordered-list": "^2.0
|
|
47
|
-
"@synerise/ds-utils": "^2.
|
|
45
|
+
"@synerise/ds-icon": "^2.3.0",
|
|
46
|
+
"@synerise/ds-unordered-list": "^2.1.0",
|
|
47
|
+
"@synerise/ds-utils": "^2.3.0",
|
|
48
48
|
"react-hot-toast": "^2.6.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"react": ">=16.9.0 <= 18.3.1",
|
|
56
56
|
"styled-components": "^5.3.3"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "5c3d61e30289486d14c7d6becb682e2d4a08ce41"
|
|
59
59
|
}
|