@xsolla/xui-b2c-toast 0.172.2 → 0.173.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.
Files changed (2) hide show
  1. package/README.md +43 -8
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -127,22 +127,55 @@ Hook that returns toast helpers. Throws if called outside a `ToastProvider`.
127
127
 
128
128
  ```tsx
129
129
  import * as React from "react";
130
+ import { FlexButton } from "@xsolla/xui-button";
130
131
  import { useToast } from "@xsolla/xui-b2c-toast";
131
132
 
132
133
  export default function Types() {
133
134
  const toast = useToast();
134
135
  return (
135
136
  <div style={{ display: "flex", gap: 8 }}>
136
- <button onClick={() => toast.neutral({ title: "Reward claimed" })}>
137
- Neutral
137
+ <button
138
+ onClick={() =>
139
+ toast.neutral({
140
+ title: "Info toast",
141
+ description: "New update available",
142
+ action: <FlexButton>View</FlexButton>,
143
+ })
144
+ }
145
+ >
146
+ Info
138
147
  </button>
139
- <button onClick={() => toast.success({ title: "Quest activated" })}>
148
+ <button
149
+ onClick={() =>
150
+ toast.success({
151
+ title: "Success toast",
152
+ description: "Agreement successfully signed",
153
+ action: <FlexButton>Undo</FlexButton>,
154
+ })
155
+ }
156
+ >
140
157
  Success
141
158
  </button>
142
- <button onClick={() => toast.warning({ title: "Session expires soon" })}>
159
+ <button
160
+ onClick={() =>
161
+ toast.warning({
162
+ title: "Warning toast",
163
+ description: "Connection unstable, changes may not save",
164
+ action: <FlexButton>Retry</FlexButton>,
165
+ })
166
+ }
167
+ >
143
168
  Warning
144
169
  </button>
145
- <button onClick={() => toast.alert({ title: "Connection lost" })}>
170
+ <button
171
+ onClick={() =>
172
+ toast.alert({
173
+ title: "Alert toast",
174
+ description: 'Project "Project Name" deleted',
175
+ action: <FlexButton>Undo</FlexButton>,
176
+ })
177
+ }
178
+ >
146
179
  Alert
147
180
  </button>
148
181
  </div>
@@ -154,6 +187,7 @@ export default function Types() {
154
187
 
155
188
  ```tsx
156
189
  import * as React from "react";
190
+ import { Avatar } from "@xsolla/xui-avatar";
157
191
  import { FlexButton } from "@xsolla/xui-button";
158
192
  import { Toast } from "@xsolla/xui-b2c-toast";
159
193
 
@@ -162,9 +196,10 @@ export default function Standalone() {
162
196
  <Toast
163
197
  id="retry"
164
198
  type="alert"
165
- title="Connection lost"
166
- description="Check your network and try again"
167
- action={<FlexButton>Retry</FlexButton>}
199
+ title="Alert toast"
200
+ description='Project "Project Name" deleted'
201
+ icon={<Avatar size="xxs" text="PN" aria-label="Project avatar" />}
202
+ action={<FlexButton>Undo</FlexButton>}
168
203
  onClose={() => {}}
169
204
  />
170
205
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/xui-b2c-toast",
3
- "version": "0.172.2",
3
+ "version": "0.173.0",
4
4
  "main": "./web/index.js",
5
5
  "module": "./web/index.mjs",
6
6
  "types": "./web/index.d.ts",
@@ -14,9 +14,9 @@
14
14
  "test:coverage": "vitest run --coverage"
15
15
  },
16
16
  "dependencies": {
17
- "@xsolla/xui-core": "0.172.2",
18
- "@xsolla/xui-primitives-core": "0.172.2",
19
- "@xsolla/xui-toast": "0.172.2"
17
+ "@xsolla/xui-core": "0.173.0",
18
+ "@xsolla/xui-primitives-core": "0.173.0",
19
+ "@xsolla/xui-toast": "0.173.0"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "react": ">=16.8.0",