@xsolla/xui-store-badge 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 +194 -15
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,35 +1,214 @@
1
- # @xsolla/xui-store-badge
1
+ ---
2
+ title: Store Badge
3
+ subtitle: App store download badges.
4
+ description: A cross-platform React component for displaying app store download badges for Google Play, App Store, and App Gallery.
5
+ ---
2
6
 
3
- App store download badge component for Google Play, App Store, and AppGallery.
7
+ # Store Badge
8
+
9
+ A cross-platform React component for displaying official app store download badges with consistent styling for Google Play, App Store, and App Gallery.
4
10
 
5
11
  ## Installation
6
12
 
7
13
  ```bash
14
+ npm install @xsolla/xui-store-badge
15
+ # or
8
16
  yarn add @xsolla/xui-store-badge
9
17
  ```
10
18
 
11
- ## Usage
19
+ ## Demo
20
+
21
+ ### All Store Types
12
22
 
13
23
  ```tsx
24
+ import * as React from 'react';
14
25
  import { StoreBadge } from '@xsolla/xui-store-badge';
15
26
 
16
- function App() {
27
+ export default function AllStores() {
17
28
  return (
18
- <>
19
- <StoreBadge type="google-play" palette="dark" onPress={() => window.open('...')} />
29
+ <div style={{ display: 'flex', flexDirection: 'column', gap: 16 }}>
30
+ <StoreBadge type="google-play" />
31
+ <StoreBadge type="app-store" />
32
+ <StoreBadge type="app-gallery" />
33
+ </div>
34
+ );
35
+ }
36
+ ```
37
+
38
+ ### Light Palette
39
+
40
+ ```tsx
41
+ import * as React from 'react';
42
+ import { StoreBadge } from '@xsolla/xui-store-badge';
43
+
44
+ export default function LightBadges() {
45
+ return (
46
+ <div style={{ display: 'flex', gap: 16, background: '#f5f5f5', padding: 24 }}>
47
+ <StoreBadge type="google-play" palette="light" />
20
48
  <StoreBadge type="app-store" palette="light" />
21
- <StoreBadge type="app-gallery" palette="dark" />
22
- </>
49
+ </div>
23
50
  );
24
51
  }
25
52
  ```
26
53
 
27
- ## Props
54
+ ### Clickable Badges
55
+
56
+ ```tsx
57
+ import * as React from 'react';
58
+ import { StoreBadge } from '@xsolla/xui-store-badge';
59
+
60
+ export default function ClickableBadges() {
61
+ return (
62
+ <div style={{ display: 'flex', gap: 16 }}>
63
+ <StoreBadge
64
+ type="google-play"
65
+ onPress={() => window.open('https://play.google.com/store/apps/details?id=com.example')}
66
+ />
67
+ <StoreBadge
68
+ type="app-store"
69
+ onPress={() => window.open('https://apps.apple.com/app/example/id123456789')}
70
+ />
71
+ </div>
72
+ );
73
+ }
74
+ ```
75
+
76
+ ## Anatomy
77
+
78
+ ```jsx
79
+ import { StoreBadge } from '@xsolla/xui-store-badge';
80
+
81
+ <StoreBadge
82
+ type="google-play" // google-play, app-store, app-gallery
83
+ palette="dark" // dark or light
84
+ onPress={handlePress} // Click handler
85
+ data-testid="badge" // Test ID
86
+ />
87
+ ```
88
+
89
+ ## Examples
90
+
91
+ ### App Download Section
92
+
93
+ ```tsx
94
+ import * as React from 'react';
95
+ import { StoreBadge } from '@xsolla/xui-store-badge';
96
+
97
+ export default function AppDownload() {
98
+ return (
99
+ <section style={{ textAlign: 'center', padding: 48 }}>
100
+ <h2>Download Our App</h2>
101
+ <p style={{ marginBottom: 24, color: '#666' }}>
102
+ Available on your favorite platforms
103
+ </p>
104
+ <div style={{ display: 'flex', gap: 16, justifyContent: 'center' }}>
105
+ <StoreBadge
106
+ type="google-play"
107
+ onPress={() => window.open('https://play.google.com')}
108
+ />
109
+ <StoreBadge
110
+ type="app-store"
111
+ onPress={() => window.open('https://apps.apple.com')}
112
+ />
113
+ </div>
114
+ </section>
115
+ );
116
+ }
117
+ ```
118
+
119
+ ### Footer Badges
120
+
121
+ ```tsx
122
+ import * as React from 'react';
123
+ import { StoreBadge } from '@xsolla/xui-store-badge';
124
+
125
+ export default function FooterBadges() {
126
+ return (
127
+ <footer style={{ background: '#1a1a1a', padding: '48px 24px' }}>
128
+ <div style={{ maxWidth: 800, margin: '0 auto' }}>
129
+ <h3 style={{ color: '#fff', marginBottom: 16 }}>Get the Mobile App</h3>
130
+ <div style={{ display: 'flex', gap: 12, flexWrap: 'wrap' }}>
131
+ <StoreBadge type="google-play" palette="dark" />
132
+ <StoreBadge type="app-store" palette="dark" />
133
+ <StoreBadge type="app-gallery" palette="dark" />
134
+ </div>
135
+ </div>
136
+ </footer>
137
+ );
138
+ }
139
+ ```
140
+
141
+ ### Responsive Layout
142
+
143
+ ```tsx
144
+ import * as React from 'react';
145
+ import { StoreBadge } from '@xsolla/xui-store-badge';
146
+
147
+ export default function ResponsiveBadges() {
148
+ return (
149
+ <div style={{
150
+ display: 'flex',
151
+ flexDirection: 'column',
152
+ gap: 12,
153
+ alignItems: 'center',
154
+ }}>
155
+ <StoreBadge type="google-play" />
156
+ <StoreBadge type="app-store" />
157
+ </div>
158
+ );
159
+ }
160
+ ```
161
+
162
+ ## API Reference
163
+
164
+ ### StoreBadge
165
+
166
+ **StoreBadgeProps:**
28
167
 
29
168
  | Prop | Type | Default | Description |
30
- |------|------|---------|-------------|
31
- | `type` | `"google-play" \| "app-store" \| "app-gallery"` | | Store to display |
32
- | `palette` | `"dark" \| "light"` | `"dark"` | Dark (black bg) or light (white bg) |
33
- | `onPress` | `() => void` | | Click handler |
34
- | `className` | `string` | | Additional CSS class |
35
- | `data-testid` | `string` | | Test ID |
169
+ | :--- | :--- | :------ | :---------- |
170
+ | type | `"google-play" \| "app-store" \| "app-gallery"` | - | Store type to display. |
171
+ | palette | `"dark" \| "light"` | `"dark"` | Color scheme. |
172
+ | onPress | `() => void` | - | Click handler for the badge. |
173
+ | data-testid | `string` | - | Test identifier. |
174
+ | className | `string` | - | CSS class name. |
175
+
176
+ ## Badge Specifications
177
+
178
+ | Dimension | Value |
179
+ | :-------- | :---- |
180
+ | Height | 87px |
181
+ | Min Width | 253px |
182
+ | Border Radius | 11px |
183
+ | Border Width | 2px |
184
+ | Padding | 20px horizontal |
185
+
186
+ ## Palette Styles
187
+
188
+ | Palette | Background | Border |
189
+ | :------ | :--------- | :----- |
190
+ | `dark` | #100f0d | #a6a6a6 |
191
+ | `light` | #ffffff | #000000 |
192
+
193
+ ## Store Types
194
+
195
+ | Type | Description |
196
+ | :--- | :---------- |
197
+ | `google-play` | Google Play Store badge |
198
+ | `app-store` | Apple App Store badge |
199
+ | `app-gallery` | Huawei App Gallery badge |
200
+
201
+ ## Use Cases
202
+
203
+ - Mobile app landing pages
204
+ - Website footers
205
+ - Marketing materials
206
+ - App download prompts
207
+ - Multi-platform app promotion
208
+
209
+ ## Accessibility
210
+
211
+ - Badges have appropriate alt text for screen readers
212
+ - Clickable badges show cursor pointer
213
+ - Focus states are visible for keyboard navigation
214
+ - Link behavior when `onPress` is provided
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/xui-store-badge",
3
- "version": "0.99.0",
3
+ "version": "0.100.0",
4
4
  "main": "./web/index.js",
5
5
  "module": "./web/index.mjs",
6
6
  "types": "./web/index.d.ts",
@@ -10,8 +10,8 @@
10
10
  "build:native": "PLATFORM=native tsup"
11
11
  },
12
12
  "dependencies": {
13
- "@xsolla/xui-core": "0.99.0",
14
- "@xsolla/xui-primitives-core": "0.99.0"
13
+ "@xsolla/xui-core": "0.100.0",
14
+ "@xsolla/xui-primitives-core": "0.100.0"
15
15
  },
16
16
  "peerDependencies": {
17
17
  "react": ">=16.8.0",