@xsolla/xui-icons 0.99.0 → 0.100.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 +214 -29
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,47 +1,232 @@
1
- # @xsolla/xui-icons
1
+ ---
2
+ title: Icons
3
+ subtitle: Theme-aware Lucide-based icons.
4
+ description: A cross-platform React icon component library based on Lucide icons with theme integration.
5
+ ---
2
6
 
3
- General-purpose UI icons built on Lucide, wrapped in the XUI Icon primitive.
7
+ # Icons
8
+
9
+ A cross-platform React icon component library based on Lucide icons. Provides theme-aware icons that automatically adapt to the current theme colors.
4
10
 
5
11
  ## Installation
6
12
 
7
13
  ```bash
14
+ npm install @xsolla/xui-icons
15
+ # or
8
16
  yarn add @xsolla/xui-icons
9
17
  ```
10
18
 
11
- ## Usage
19
+ ## Demo
20
+
21
+ ### Basic Usage
22
+
23
+ Icons are exported as named components. Import and use them directly:
24
+
25
+ ```tsx
26
+ import * as React from 'react';
27
+ import { Home, Settings, User, Search } from '@xsolla/xui-icons';
28
+
29
+ export default function BasicIcons() {
30
+ return (
31
+ <div style={{ display: 'flex', gap: 16 }}>
32
+ <Home />
33
+ <Settings />
34
+ <User />
35
+ <Search />
36
+ </div>
37
+ );
38
+ }
39
+ ```
40
+
41
+ ### Icon Sizes
42
+
43
+ ```tsx
44
+ import * as React from 'react';
45
+ import { Bell } from '@xsolla/xui-icons';
46
+
47
+ export default function IconSizes() {
48
+ return (
49
+ <div style={{ display: 'flex', gap: 16, alignItems: 'center' }}>
50
+ <Bell size={12} />
51
+ <Bell size={16} />
52
+ <Bell size={20} />
53
+ <Bell size={24} />
54
+ <Bell size={32} />
55
+ </div>
56
+ );
57
+ }
58
+ ```
59
+
60
+ ### Custom Colors
12
61
 
13
62
  ```tsx
14
- import { Check, Search, ShoppingCart } from '@xsolla/xui-icons';
63
+ import * as React from 'react';
64
+ import { Check, AlertCircle, X } from '@xsolla/xui-icons';
15
65
 
16
- function App() {
66
+ export default function ColoredIcons() {
17
67
  return (
18
- <>
19
- <Check size={24} color="green" />
20
- <Search size={20} />
21
- <ShoppingCart size={24} color="blue" />
22
- </>
68
+ <div style={{ display: 'flex', gap: 16 }}>
69
+ <Check color="#2ecc71" />
70
+ <AlertCircle color="#f39c12" />
71
+ <X color="#e74c3c" />
72
+ </div>
23
73
  );
24
74
  }
25
75
  ```
26
76
 
77
+ ## Anatomy
78
+
79
+ Import icons as named exports and use them as components:
80
+
81
+ ```jsx
82
+ import { Home, Settings, Check } from '@xsolla/xui-icons';
83
+
84
+ <Home
85
+ size={24} // Size in pixels (default: 24)
86
+ color="#color" // Custom color (uses theme default if not specified)
87
+ />
88
+ ```
89
+
90
+ ## Examples
91
+
92
+ ### Navigation Icons
93
+
94
+ ```tsx
95
+ import * as React from 'react';
96
+ import { ArrowLeft, ArrowRight, Menu, X } from '@xsolla/xui-icons';
97
+
98
+ export default function NavigationIcons() {
99
+ return (
100
+ <div style={{ display: 'flex', gap: 16 }}>
101
+ <ArrowLeft />
102
+ <ArrowRight />
103
+ <Menu />
104
+ <X />
105
+ </div>
106
+ );
107
+ }
108
+ ```
109
+
110
+ ### Action Icons
111
+
112
+ ```tsx
113
+ import * as React from 'react';
114
+ import { Check, X, Minus, Copy } from '@xsolla/xui-icons';
115
+
116
+ export default function ActionIcons() {
117
+ return (
118
+ <div style={{ display: 'flex', gap: 16 }}>
119
+ <Check />
120
+ <X />
121
+ <Minus />
122
+ <Copy />
123
+ </div>
124
+ );
125
+ }
126
+ ```
127
+
128
+ ### Status Icons
129
+
130
+ ```tsx
131
+ import * as React from 'react';
132
+ import { Check, AlertCircle } from '@xsolla/xui-icons';
133
+
134
+ export default function StatusIcons() {
135
+ return (
136
+ <div style={{ display: 'flex', gap: 16 }}>
137
+ <Check color="#2ecc71" />
138
+ <AlertCircle color="#f39c12" />
139
+ </div>
140
+ );
141
+ }
142
+ ```
143
+
144
+ ### With Button
145
+
146
+ ```tsx
147
+ import * as React from 'react';
148
+ import { ArrowRight, ArrowLeft } from '@xsolla/xui-icons';
149
+ import { Button } from '@xsolla/xui-button';
150
+
151
+ export default function IconWithButton() {
152
+ return (
153
+ <div style={{ display: 'flex', gap: 16 }}>
154
+ <Button iconLeft={<ArrowLeft />}>Back</Button>
155
+ <Button iconRight={<ArrowRight />}>Continue</Button>
156
+ </div>
157
+ );
158
+ }
159
+ ```
160
+
161
+ ## API Reference
162
+
163
+ ### Icon Components
164
+
165
+ Each icon is exported as a named component with the following props:
166
+
167
+ **Icon Props:**
168
+
169
+ | Prop | Type | Default | Description |
170
+ | :--- | :--- | :------ | :---------- |
171
+ | size | `number` | `24` | Icon size in pixels. |
172
+ | color | `string` | Theme default | Icon color. |
173
+
27
174
  ## Available Icons
28
175
 
29
- - `Check`
30
- - `X`
31
- - `Copy`
32
- - `Eye`
33
- - `EyeOff`
34
- - `ArrowLeft`
35
- - `ArrowRight`
36
- - `Settings`
37
- - `Minus`
38
- - `AlertCircle`
39
- - `CreditCard`
40
- - `Menu`
41
- - `Bell`
42
- - `User`
43
- - `Search`
44
- - `Home`
45
- - `ShoppingCart`
46
- - `Upload`
47
- - `File`
176
+ The `@xsolla/xui-icons` package exports a curated set of commonly used icons:
177
+
178
+ - `Check` - Checkmark icon
179
+ - `X` - Close/remove icon
180
+ - `Copy` - Copy to clipboard icon
181
+ - `Eye` - Visibility on icon
182
+ - `EyeOff` - Visibility off icon
183
+ - `ArrowLeft` - Left arrow icon
184
+ - `ArrowRight` - Right arrow icon
185
+ - `Settings` - Settings/gear icon
186
+ - `Minus` - Minus/subtract icon
187
+ - `AlertCircle` - Alert/warning circle icon
188
+ - `CreditCard` - Credit card icon
189
+ - `Menu` - Hamburger menu icon
190
+ - `Bell` - Notification bell icon
191
+ - `User` - User profile icon
192
+ - `Search` - Search/magnifying glass icon
193
+ - `Home` - Home icon
194
+ - `ShoppingCart` - Shopping cart icon
195
+ - `Upload` - Upload icon
196
+ - `File` - File icon
197
+
198
+ ### Extended Icon Sets
199
+
200
+ For additional icons, use the specialized icon packages:
201
+
202
+ - **`@xsolla/xui-icons-base`** - Comprehensive icon library with 400+ icons organized by category (controls, communication, files, finance, etc.)
203
+ - **`@xsolla/xui-icons-brand`** - Brand and company logos (160+ brands)
204
+ - **`@xsolla/xui-icons-flag`** - Country flag icons
205
+ - **`@xsolla/xui-icons-payment`** - Payment method icons
206
+ - **`@xsolla/xui-icons-currency`** - Currency icons
207
+ - **`@xsolla/xui-icons-product`** - Product-specific icons
208
+
209
+ ### Using icons-base
210
+
211
+ ```tsx
212
+ import { ChevronDown, ChevronUp, Calendar, Clock } from '@xsolla/xui-icons-base';
213
+
214
+ // Use like any other icon
215
+ <ChevronDown size={16} />
216
+ <Calendar color="#333" />
217
+ ```
218
+
219
+ ## Theming
220
+
221
+ Icons use the design system theme for default color:
222
+
223
+ ```typescript
224
+ // Default color from theme
225
+ theme.colors.content.primary // Default icon color
226
+ ```
227
+
228
+ ## Accessibility
229
+
230
+ - Icons are decorative by default (`aria-hidden="true"`)
231
+ - When using icons alone without text, provide an `aria-label` on the parent element
232
+ - For icon buttons, use the `IconButton` component which requires `aria-label`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/xui-icons",
3
- "version": "0.99.0",
3
+ "version": "0.100.0",
4
4
  "main": "./web/index.js",
5
5
  "types": "./web/index.d.ts",
6
6
  "scripts": {
@@ -8,7 +8,7 @@
8
8
  "build:native": "PLATFORM=native tsup"
9
9
  },
10
10
  "dependencies": {
11
- "@xsolla/xui-primitives-core": "0.99.0",
11
+ "@xsolla/xui-primitives-core": "0.100.0",
12
12
  "lucide-react": "^0.470.0"
13
13
  },
14
14
  "peerDependencies": {