@xsolla/xui-notification 0.95.0 → 0.97.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/README.md +40 -0
- package/package.json +4 -4
package/README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# @xsolla/xui-notification
|
|
2
|
+
|
|
3
|
+
Inline and toast-style notification banner with tone variants and optional action.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
yarn add @xsolla/xui-notification
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { Notification } from '@xsolla/xui-notification';
|
|
15
|
+
|
|
16
|
+
const Example = () => (
|
|
17
|
+
<Notification
|
|
18
|
+
tone="success"
|
|
19
|
+
type="inline"
|
|
20
|
+
title="Changes saved"
|
|
21
|
+
message="Your profile has been updated."
|
|
22
|
+
onClose={() => console.log('closed')}
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Props
|
|
28
|
+
|
|
29
|
+
### Notification
|
|
30
|
+
|
|
31
|
+
| Prop | Type | Default | Description |
|
|
32
|
+
|------|------|---------|-------------|
|
|
33
|
+
| `tone` | `"neutral" \| "success" \| "warning" \| "alert"` | `"neutral"` | Colour theme of the notification |
|
|
34
|
+
| `type` | `"toast" \| "inline"` | `"toast"` | Layout style; `inline` is single-row, `toast` is stacked |
|
|
35
|
+
| `title` | `string` | — | Bold heading text |
|
|
36
|
+
| `message` | `string` | — | Secondary body text |
|
|
37
|
+
| `actionLabel` | `string` | — | Label for the inline action link |
|
|
38
|
+
| `onAction` | `() => void` | — | Called when the action link is pressed |
|
|
39
|
+
| `onClose` | `() => void` | — | Called when the close button is pressed |
|
|
40
|
+
| `showClose` | `boolean` | `true` | Whether to render the close button |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsolla/xui-notification",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.97.0",
|
|
4
4
|
"main": "./web/index.js",
|
|
5
5
|
"module": "./web/index.mjs",
|
|
6
6
|
"types": "./web/index.d.ts",
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"build:native": "PLATFORM=native tsup"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xsolla/xui-core": "0.
|
|
14
|
-
"@xsolla/xui-icons": "0.
|
|
15
|
-
"@xsolla/xui-primitives-core": "0.
|
|
13
|
+
"@xsolla/xui-core": "0.97.0",
|
|
14
|
+
"@xsolla/xui-icons": "0.97.0",
|
|
15
|
+
"@xsolla/xui-primitives-core": "0.97.0"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"react": ">=16.8.0",
|