@xsolla/xui-cell 0.99.0 → 0.101.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 +196 -21
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -1,44 +1,219 @@
1
- # @xsolla/xui-cell
1
+ # Cell
2
2
 
3
- A composable row layout component with leading/trailing slots and a flexible content area.
3
+ A cross-platform React cell component that provides a consistent layout structure for list items. Features slots for leading/trailing content and a flexible content area.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
+ npm install @xsolla/xui-cell
9
+ # or
8
10
  yarn add @xsolla/xui-cell
9
11
  ```
10
12
 
11
- ## Usage
13
+ ## Demo
14
+
15
+ ### Basic Cell
16
+
17
+ ```tsx
18
+ import * as React from 'react';
19
+ import { Cell } from '@xsolla/xui-cell';
20
+
21
+ export default function BasicCell() {
22
+ return (
23
+ <Cell>
24
+ <Cell.Content>
25
+ Basic cell content
26
+ </Cell.Content>
27
+ </Cell>
28
+ );
29
+ }
30
+ ```
31
+
32
+ ### With Slots
33
+
34
+ ```tsx
35
+ import * as React from 'react';
36
+ import { Cell } from '@xsolla/xui-cell';
37
+ import { Avatar } from '@xsolla/xui-avatar';
38
+ import { ChevronRight } from '@xsolla/xui-icons-base';
39
+
40
+ export default function CellWithSlots() {
41
+ return (
42
+ <Cell>
43
+ <Cell.Slot>
44
+ <Avatar size="md" name="John Doe" />
45
+ </Cell.Slot>
46
+ <Cell.Content>
47
+ <span style={{ fontWeight: 500 }}>John Doe</span>
48
+ <span style={{ color: '#888' }}>john@example.com</span>
49
+ </Cell.Content>
50
+ <Cell.Slot>
51
+ <ChevronRight size={20} />
52
+ </Cell.Slot>
53
+ </Cell>
54
+ );
55
+ }
56
+ ```
57
+
58
+ ### With Board Style
12
59
 
13
60
  ```tsx
14
- import { Cell } from "@xsolla/xui-cell";
61
+ import * as React from 'react';
62
+ import { Cell } from '@xsolla/xui-cell';
63
+
64
+ export default function BoardCell() {
65
+ return (
66
+ <Cell withBoard>
67
+ <Cell.Content>
68
+ Cell with board styling (background, border, rounded corners)
69
+ </Cell.Content>
70
+ </Cell>
71
+ );
72
+ }
73
+ ```
74
+
75
+ ## Anatomy
76
+
77
+ ```jsx
78
+ import { Cell } from '@xsolla/xui-cell';
15
79
 
16
- <Cell withBoard>
17
- <Cell.Slot>
18
- <Avatar size="md" />
80
+ <Cell
81
+ withBoard={false} // Add background, border, and padding
82
+ >
83
+ <Cell.Slot> {/* Leading content (icon, avatar) */}
84
+ <Avatar />
19
85
  </Cell.Slot>
20
- <Cell.Content>
21
- <Typography variant="bodyMdAccent">John Doe</Typography>
22
- <Typography variant="bodySm" color="secondary">john@example.com</Typography>
86
+ <Cell.Content> {/* Main content area (flexes to fill) */}
87
+ <Text>Title</Text>
88
+ <Text>Subtitle</Text>
23
89
  </Cell.Content>
24
- <Cell.Slot>
25
- <ChevronRight size={20} />
90
+ <Cell.Slot> {/* Trailing content (chevron, button) */}
91
+ <Icon />
26
92
  </Cell.Slot>
27
93
  </Cell>
28
94
  ```
29
95
 
30
- ## Components
96
+ ## Examples
97
+
98
+ ### Settings List
99
+
100
+ ```tsx
101
+ import * as React from 'react';
102
+ import { Cell } from '@xsolla/xui-cell';
103
+ import { User, Bell } from '@xsolla/xui-icons';
104
+ import { ChevronRight, Shield } from '@xsolla/xui-icons-base';
105
+
106
+ export default function SettingsList() {
107
+ return (
108
+ <div>
109
+ <Cell>
110
+ <Cell.Slot>
111
+ <User size={20} />
112
+ </Cell.Slot>
113
+ <Cell.Content>
114
+ <span>Profile</span>
115
+ </Cell.Content>
116
+ <Cell.Slot>
117
+ <ChevronRight size={16} />
118
+ </Cell.Slot>
119
+ </Cell>
120
+ <Cell>
121
+ <Cell.Slot>
122
+ <Bell size={20} />
123
+ </Cell.Slot>
124
+ <Cell.Content>
125
+ <span>Notifications</span>
126
+ </Cell.Content>
127
+ <Cell.Slot>
128
+ <ChevronRight size={16} />
129
+ </Cell.Slot>
130
+ </Cell>
131
+ <Cell>
132
+ <Cell.Slot>
133
+ <Shield size={20} />
134
+ </Cell.Slot>
135
+ <Cell.Content>
136
+ <span>Security</span>
137
+ </Cell.Content>
138
+ <Cell.Slot>
139
+ <ChevronRight size={16} />
140
+ </Cell.Slot>
141
+ </Cell>
142
+ </div>
143
+ );
144
+ }
145
+ ```
146
+
147
+ ### Contact Card
31
148
 
32
- | Component | Description |
33
- |-----------|-------------|
34
- | `Cell` | Root row container |
35
- | `Cell.Slot` | Non-growing slot for icons or small elements at either end |
36
- | `Cell.Content` | Flex-grow content area, typically used for text |
149
+ ```tsx
150
+ import * as React from 'react';
151
+ import { Cell } from '@xsolla/xui-cell';
152
+ import { Avatar } from '@xsolla/xui-avatar';
153
+ import { Button } from '@xsolla/xui-button';
37
154
 
38
- ## Props
155
+ export default function ContactCard() {
156
+ return (
157
+ <Cell withBoard>
158
+ <Cell.Slot>
159
+ <Avatar
160
+ size="lg"
161
+ src="https://example.com/avatar.jpg"
162
+ name="Jane Smith"
163
+ />
164
+ </Cell.Slot>
165
+ <Cell.Content>
166
+ <span style={{ fontWeight: 600 }}>Jane Smith</span>
167
+ <span style={{ fontSize: 14, color: '#666' }}>Product Manager</span>
168
+ </Cell.Content>
169
+ <Cell.Slot>
170
+ <Button size="sm" variant="secondary">Message</Button>
171
+ </Cell.Slot>
172
+ </Cell>
173
+ );
174
+ }
175
+ ```
176
+
177
+ ## API Reference
39
178
 
40
179
  ### Cell
41
180
 
181
+ Container component for cell layout.
182
+
183
+ **Cell Props:**
184
+
185
+ | Prop | Type | Default | Description |
186
+ | :--- | :--- | :------ | :---------- |
187
+ | children | `ReactNode` | - | Cell content (Slot and Content components). |
188
+ | withBoard | `boolean` | `false` | Add background, border, and rounded corners. |
189
+
190
+ ---
191
+
192
+ ### Cell.Slot
193
+
194
+ Container for leading or trailing content.
195
+
196
+ **Cell.Slot Props:**
197
+
198
+ | Prop | Type | Default | Description |
199
+ | :--- | :--- | :------ | :---------- |
200
+ | children | `ReactNode` | - | Slot content (icons, avatars, buttons). |
201
+
202
+ ---
203
+
204
+ ### Cell.Content
205
+
206
+ Main content area that expands to fill available space.
207
+
208
+ **Cell.Content Props:**
209
+
42
210
  | Prop | Type | Default | Description |
43
- |------|------|---------|-------------|
44
- | `withBoard` | `boolean` | `false` | Applies a bordered, rounded container style consistent with list-board patterns |
211
+ | :--- | :--- | :------ | :---------- |
212
+ | children | `ReactNode` | - | Content elements. |
213
+
214
+ ## Layout
215
+
216
+ - Cell uses horizontal flexbox layout with 12px gap
217
+ - Minimum height of 56px
218
+ - Horizontal padding of 16px
219
+ - `withBoard` adds: secondary background, border, 8px border radius, and 12px vertical padding
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/xui-cell",
3
- "version": "0.99.0",
3
+ "version": "0.101.0",
4
4
  "main": "./web/index.js",
5
5
  "module": "./web/index.mjs",
6
6
  "types": "./web/index.d.ts",
@@ -10,10 +10,10 @@
10
10
  "build:native": "PLATFORM=native tsup"
11
11
  },
12
12
  "dependencies": {
13
- "@xsolla/xui-avatar": "0.99.0",
14
- "@xsolla/xui-button": "0.99.0",
15
- "@xsolla/xui-core": "0.99.0",
16
- "@xsolla/xui-primitives-core": "0.99.0"
13
+ "@xsolla/xui-avatar": "0.101.0",
14
+ "@xsolla/xui-button": "0.101.0",
15
+ "@xsolla/xui-core": "0.101.0",
16
+ "@xsolla/xui-primitives-core": "0.101.0"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "react": ">=16.8.0",