@xsolla/xui-icons 0.150.0 → 0.152.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 +49 -155
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,148 +1,98 @@
|
|
|
1
1
|
# Icons
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A small curated set of icons backed by `lucide-icon-platform` and rendered through the cross-platform `<Icon>` primitive from `@xsolla/xui-primitives`. Each icon scales with its container.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
npm install @xsolla/xui-icons
|
|
9
|
-
# or
|
|
10
|
-
yarn add @xsolla/xui-icons
|
|
11
9
|
```
|
|
12
10
|
|
|
13
|
-
##
|
|
14
|
-
|
|
15
|
-
### Basic Usage
|
|
16
|
-
|
|
17
|
-
Icons are exported as named components. Import and use them directly:
|
|
11
|
+
## Imports
|
|
18
12
|
|
|
19
13
|
```tsx
|
|
20
|
-
import
|
|
21
|
-
import { Home, Settings, User, Search } from '@xsolla/xui-icons';
|
|
22
|
-
|
|
23
|
-
export default function BasicIcons() {
|
|
24
|
-
return (
|
|
25
|
-
<div style={{ display: 'flex', gap: 16 }}>
|
|
26
|
-
<Home />
|
|
27
|
-
<Settings />
|
|
28
|
-
<User />
|
|
29
|
-
<Search />
|
|
30
|
-
</div>
|
|
31
|
-
);
|
|
32
|
-
}
|
|
14
|
+
import { Home, Settings, Search, Check, Bell } from '@xsolla/xui-icons';
|
|
33
15
|
```
|
|
34
16
|
|
|
35
|
-
|
|
17
|
+
## Quick start
|
|
36
18
|
|
|
37
19
|
```tsx
|
|
38
20
|
import * as React from 'react';
|
|
39
|
-
import {
|
|
21
|
+
import { Home } from '@xsolla/xui-icons';
|
|
40
22
|
|
|
41
|
-
export default function
|
|
42
|
-
return
|
|
43
|
-
<div style={{ display: 'flex', gap: 16, alignItems: 'center' }}>
|
|
44
|
-
<Bell size={12} />
|
|
45
|
-
<Bell size={16} />
|
|
46
|
-
<Bell size={20} />
|
|
47
|
-
<Bell size={24} />
|
|
48
|
-
<Bell size={32} />
|
|
49
|
-
</div>
|
|
50
|
-
);
|
|
23
|
+
export default function QuickStart() {
|
|
24
|
+
return <Home aria-hidden />;
|
|
51
25
|
}
|
|
52
26
|
```
|
|
53
27
|
|
|
54
|
-
|
|
28
|
+
For most product surfaces prefer `@xsolla/xui-icons-base` (500+ icons with `solid`/`line` variants). This package exists as a lightweight, primitive-backed alternative for primitives-aligned consumers.
|
|
55
29
|
|
|
56
|
-
|
|
57
|
-
import * as React from 'react';
|
|
58
|
-
import { Check, AlertCircle, X } from '@xsolla/xui-icons';
|
|
59
|
-
|
|
60
|
-
export default function ColoredIcons() {
|
|
61
|
-
return (
|
|
62
|
-
<div style={{ display: 'flex', gap: 16 }}>
|
|
63
|
-
<Check color="#2ecc71" />
|
|
64
|
-
<AlertCircle color="#f39c12" />
|
|
65
|
-
<X color="#e74c3c" />
|
|
66
|
-
</div>
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
```
|
|
30
|
+
## API Reference
|
|
70
31
|
|
|
71
|
-
|
|
32
|
+
### Icon components (`<Home>`, `<Settings>`, `<Check>`, ...)
|
|
72
33
|
|
|
73
|
-
|
|
34
|
+
Each icon is a thin wrapper around `<Icon>` from `@xsolla/xui-primitives` containing a Lucide glyph rendered at `size="100%"`. Props are forwarded to `<Icon>`; refer to the primitives package for the authoritative prop list. Common props:
|
|
74
35
|
|
|
75
|
-
|
|
76
|
-
|
|
36
|
+
| Prop | Type | Default | Description |
|
|
37
|
+
| --- | --- | --- | --- |
|
|
38
|
+
| `size` | `number \| string` | inherited from `<Icon>` | Outer icon size. The inner SVG always fills the container. |
|
|
39
|
+
| `color` | `string` | theme default | Icon colour. |
|
|
40
|
+
| `aria-label` | `string` | — | Accessible label. |
|
|
41
|
+
| `aria-hidden` | `boolean` | — | Mark as decorative. |
|
|
77
42
|
|
|
78
|
-
|
|
79
|
-
size={24} // Size in pixels (default: 24)
|
|
80
|
-
color="#color" // Custom color (uses theme default if not specified)
|
|
81
|
-
/>
|
|
82
|
-
```
|
|
43
|
+
Additional props supported by `<Icon>` (e.g. `className`, `style`, test IDs) are passed through.
|
|
83
44
|
|
|
84
|
-
|
|
45
|
+
This package does not consume `ThemeOverrideProps` directly; theme awareness is handled by the underlying `<Icon>` primitive.
|
|
85
46
|
|
|
86
|
-
|
|
47
|
+
## Available icons
|
|
87
48
|
|
|
88
|
-
|
|
89
|
-
import * as React from 'react';
|
|
90
|
-
import { ArrowLeft, ArrowRight, Menu, X } from '@xsolla/xui-icons';
|
|
49
|
+
`Check`, `X`, `Copy`, `Eye`, `EyeOff`, `ArrowLeft`, `ArrowRight`, `Settings`, `Minus`, `AlertCircle`, `CreditCard`, `Menu`, `Bell`, `User`, `Search`, `Home`, `ShoppingCart`, `Upload`, `File`, `Info`.
|
|
91
50
|
|
|
92
|
-
|
|
93
|
-
return (
|
|
94
|
-
<div style={{ display: 'flex', gap: 16 }}>
|
|
95
|
-
<ArrowLeft />
|
|
96
|
-
<ArrowRight />
|
|
97
|
-
<Menu />
|
|
98
|
-
<X />
|
|
99
|
-
</div>
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
```
|
|
51
|
+
## Examples
|
|
103
52
|
|
|
104
|
-
###
|
|
53
|
+
### Basic usage
|
|
105
54
|
|
|
106
55
|
```tsx
|
|
107
56
|
import * as React from 'react';
|
|
108
|
-
import {
|
|
57
|
+
import { Home, Settings, User, Search } from '@xsolla/xui-icons';
|
|
109
58
|
|
|
110
|
-
export default function
|
|
59
|
+
export default function Basic() {
|
|
111
60
|
return (
|
|
112
61
|
<div style={{ display: 'flex', gap: 16 }}>
|
|
113
|
-
<
|
|
114
|
-
<
|
|
115
|
-
<
|
|
116
|
-
<
|
|
62
|
+
<Home aria-hidden />
|
|
63
|
+
<Settings aria-hidden />
|
|
64
|
+
<User aria-hidden />
|
|
65
|
+
<Search aria-hidden />
|
|
117
66
|
</div>
|
|
118
67
|
);
|
|
119
68
|
}
|
|
120
69
|
```
|
|
121
70
|
|
|
122
|
-
###
|
|
71
|
+
### Coloured icons
|
|
123
72
|
|
|
124
73
|
```tsx
|
|
125
74
|
import * as React from 'react';
|
|
126
|
-
import { Check, AlertCircle } from '@xsolla/xui-icons';
|
|
75
|
+
import { Check, AlertCircle, X } from '@xsolla/xui-icons';
|
|
127
76
|
|
|
128
|
-
export default function
|
|
77
|
+
export default function Coloured() {
|
|
129
78
|
return (
|
|
130
79
|
<div style={{ display: 'flex', gap: 16 }}>
|
|
131
|
-
<Check color="#2ecc71" />
|
|
132
|
-
<AlertCircle color="#f39c12" />
|
|
80
|
+
<Check color="#2ecc71" aria-hidden />
|
|
81
|
+
<AlertCircle color="#f39c12" aria-hidden />
|
|
82
|
+
<X color="#e74c3c" aria-hidden />
|
|
133
83
|
</div>
|
|
134
84
|
);
|
|
135
85
|
}
|
|
136
86
|
```
|
|
137
87
|
|
|
138
|
-
### With
|
|
88
|
+
### With a button
|
|
139
89
|
|
|
140
90
|
```tsx
|
|
141
91
|
import * as React from 'react';
|
|
142
|
-
import {
|
|
92
|
+
import { ArrowLeft, ArrowRight } from '@xsolla/xui-icons';
|
|
143
93
|
import { Button } from '@xsolla/xui-button';
|
|
144
94
|
|
|
145
|
-
export default function
|
|
95
|
+
export default function ButtonsWithIcons() {
|
|
146
96
|
return (
|
|
147
97
|
<div style={{ display: 'flex', gap: 16 }}>
|
|
148
98
|
<Button iconLeft={<ArrowLeft />}>Back</Button>
|
|
@@ -152,75 +102,19 @@ export default function IconWithButton() {
|
|
|
152
102
|
}
|
|
153
103
|
```
|
|
154
104
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
### Icon Components
|
|
158
|
-
|
|
159
|
-
Each icon is exported as a named component with the following props:
|
|
160
|
-
|
|
161
|
-
**Icon Props:**
|
|
162
|
-
|
|
163
|
-
| Prop | Type | Default | Description |
|
|
164
|
-
| :--- | :--- | :------ | :---------- |
|
|
165
|
-
| size | `number` | `24` | Icon size in pixels. |
|
|
166
|
-
| color | `string` | Theme default | Icon color. |
|
|
167
|
-
|
|
168
|
-
## Available Icons
|
|
169
|
-
|
|
170
|
-
The `@xsolla/xui-icons` package exports a curated set of commonly used icons:
|
|
171
|
-
|
|
172
|
-
- `Check` - Checkmark icon
|
|
173
|
-
- `X` - Close/remove icon
|
|
174
|
-
- `Copy` - Copy to clipboard icon
|
|
175
|
-
- `Eye` - Visibility on icon
|
|
176
|
-
- `EyeOff` - Visibility off icon
|
|
177
|
-
- `ArrowLeft` - Left arrow icon
|
|
178
|
-
- `ArrowRight` - Right arrow icon
|
|
179
|
-
- `Settings` - Settings/gear icon
|
|
180
|
-
- `Minus` - Minus/subtract icon
|
|
181
|
-
- `AlertCircle` - Alert/warning circle icon
|
|
182
|
-
- `CreditCard` - Credit card icon
|
|
183
|
-
- `Menu` - Hamburger menu icon
|
|
184
|
-
- `Bell` - Notification bell icon
|
|
185
|
-
- `User` - User profile icon
|
|
186
|
-
- `Search` - Search/magnifying glass icon
|
|
187
|
-
- `Home` - Home icon
|
|
188
|
-
- `ShoppingCart` - Shopping cart icon
|
|
189
|
-
- `Upload` - Upload icon
|
|
190
|
-
- `File` - File icon
|
|
191
|
-
|
|
192
|
-
### Extended Icon Sets
|
|
193
|
-
|
|
194
|
-
For additional icons, use the specialized icon packages:
|
|
195
|
-
|
|
196
|
-
- **`@xsolla/xui-icons-base`** - Comprehensive icon library with 400+ icons organized by category (controls, communication, files, finance, etc.)
|
|
197
|
-
- **`@xsolla/xui-icons-brand`** - Brand and company logos (160+ brands)
|
|
198
|
-
- **`@xsolla/xui-icons-flag`** - Country flag icons
|
|
199
|
-
- **`@xsolla/xui-icons-payment`** - Payment method icons
|
|
200
|
-
- **`@xsolla/xui-icons-currency`** - Currency icons
|
|
201
|
-
- **`@xsolla/xui-icons-product`** - Product-specific icons
|
|
202
|
-
|
|
203
|
-
### Using icons-base
|
|
105
|
+
### Extended icon sets
|
|
204
106
|
|
|
205
|
-
|
|
206
|
-
import { ChevronDown, ChevronUp, Calendar, Clock } from '@xsolla/xui-icons-base';
|
|
207
|
-
|
|
208
|
-
// Use like any other icon
|
|
209
|
-
<ChevronDown size={16} />
|
|
210
|
-
<Calendar color="#333" />
|
|
211
|
-
```
|
|
107
|
+
For a wider palette, use the family-specific packages:
|
|
212
108
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
theme.colors.content.primary // Default icon color
|
|
220
|
-
```
|
|
109
|
+
- `@xsolla/xui-icons-base` — 500+ functional icons (`solid`/`line`).
|
|
110
|
+
- `@xsolla/xui-icons-brand` — brand and platform logos.
|
|
111
|
+
- `@xsolla/xui-icons-flag` — country flags (ISO 3166-1 alpha-2).
|
|
112
|
+
- `@xsolla/xui-icons-payment` — payment-method logos.
|
|
113
|
+
- `@xsolla/xui-icons-currency` — Xsolla virtual-currency icons.
|
|
114
|
+
- `@xsolla/xui-icons-product` — Xsolla product icons.
|
|
221
115
|
|
|
222
116
|
## Accessibility
|
|
223
117
|
|
|
224
|
-
-
|
|
225
|
-
-
|
|
226
|
-
-
|
|
118
|
+
- Mark decorative icons with `aria-hidden`.
|
|
119
|
+
- For meaningful icons, set `aria-label` on the icon or its parent.
|
|
120
|
+
- Use `IconButton` from `@xsolla/xui-button` for interactive icon-only controls.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsolla/xui-icons",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.152.0",
|
|
4
4
|
"main": "./web/index.js",
|
|
5
5
|
"types": "./web/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"build:native": "PLATFORM=native tsup"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@xsolla/xui-primitives-core": "0.
|
|
12
|
+
"@xsolla/xui-primitives-core": "0.152.0",
|
|
13
13
|
"lucide-react": "^0.470.0"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|