@coinswap-app/uikit 1.0.21 → 1.0.22

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 CHANGED
@@ -1,15 +1,85 @@
1
- # streda-web-components
1
+ # @coinswap-app/uikit
2
2
 
3
- ###### This repo can be found on [Web components repository](https://github.com/CoinSwap-Space/coinswap-uikit).
3
+ UI component library for CoinSwap projects.
4
+
5
+ > **⚠️ Important**: This package contains both generic UI components and some legacy application-specific components. See the "What Should Be in UIKit" section below for guidance.
4
6
 
5
7
  ## Installation
6
8
 
7
- 1. Clone/download repo
8
- 2. `yarn install`
9
+ ```bash
10
+ npm install @coinswap-app/uikit
11
+ ```
12
+
13
+ For wallet functionality (Menu widget, WalletModal, etc.):
14
+ ```bash
15
+ npm install @coinswap-app/uikit @web3-react/core ethers
16
+ ```
17
+
18
+ ## What Should Be in UIKit?
19
+
20
+ **✅ Generic, reusable UI components:**
21
+ - Buttons, Inputs, Cards, Modals
22
+ - Typography (Text, Heading)
23
+ - Form controls (Checkbox, Radio, Switch, Toggle)
24
+ - Layout primitives (Box, Flex, Grid)
25
+ - Icons (SVG components)
26
+ - Theme system (colors, breakpoints, etc.)
27
+ - Generic utilities (color helpers, theme values, etc.)
28
+
29
+ **❌ Application-specific components that should NOT be in uikit:**
30
+ - **Menu/Navigation** - Each app has its own menu structure
31
+ - **Page layouts** - Specific to each application
32
+ - **Feature-specific components** - SpacePad, Farming, IDO components
33
+ - **Business logic** - Wallet verification, user management, etc.
34
+
35
+ > **Note**: The current uikit contains legacy application-specific components for backwards compatibility. See `documentation/uikit-audit-and-refactoring-plan.md` for migration plan.
9
36
 
10
37
  ## Usage
11
38
 
12
- **Development with Storybook**
39
+ ### Basic Components (Recommended)
40
+
41
+ ```typescript
42
+ import { Button, Card, Text, Heading, Input } from '@coinswap-app/uikit'
43
+
44
+ function MyComponent() {
45
+ return (
46
+ <Card>
47
+ <Heading>Welcome</Heading>
48
+ <Text>Hello world</Text>
49
+ <Input placeholder="Enter value" />
50
+ <Button>Submit</Button>
51
+ </Card>
52
+ )
53
+ }
54
+ ```
55
+
56
+ ### Wallet Components (Optional)
57
+
58
+ For applications that need wallet functionality:
59
+
60
+ ```typescript
61
+ // Import from /wallet instead of main package
62
+ import { Menu, WalletModal, ConnectVerifyPanel } from '@coinswap-app/uikit/wallet'
63
+ ```
64
+
65
+ > **⚠️ Important**: Menu widget is application-specific and should ideally be implemented in each app independently. The Menu in uikit is kept for backwards compatibility only.
66
+
67
+ ### Theme
68
+
69
+ ```typescript
70
+ import { ThemeProvider } from 'styled-components'
71
+ import { light, dark } from '@coinswap-app/uikit'
72
+
73
+ function App() {
74
+ return (
75
+ <ThemeProvider theme={light}>
76
+ {/* Your app */}
77
+ </ThemeProvider>
78
+ )
79
+ }
80
+ ```
81
+
82
+ ## Development with Storybook
13
83
 
14
84
  **_Create new component_**
15
85
  1. Create component in tsx extension
@@ -77,21 +147,39 @@
77
147
 
78
148
  More info about styled-components liblary [StyledComponents Lib](https://styled-components.com/docs).
79
149
 
80
- ## Making changes
81
- 1. Versioning:
82
- * MajorVer -> Changes that break backward compatibility
83
- * MinorVer -> Backward compatible new features
84
- * PatchVer -> Backward compatible bug fixes
85
- * BetaVer -> Aren't considered major releases, so the package version number doesn't change
150
+ ## Publishing
151
+
152
+ **⚠️ ALWAYS bump version before publishing!**
153
+
154
+ 1. Update version in `package.json`:
155
+ ```bash
156
+ # Edit version in package.json
157
+ # Format: "X.Y.Z" (e.g., "1.0.21", "1.0.22", "1.1.0")
158
+ ```
159
+
160
+ 2. Build and publish:
161
+ ```bash
162
+ npm run build
163
+ npm publish --access public
164
+ ```
165
+
166
+ Or use the combined command:
167
+ ```bash
168
+ npm run release
169
+ ```
170
+
171
+ ### Versioning
86
172
 
87
- 2. After every change we need to increase package version
88
- * For beta version we type {MajorVer}.{MinorVer}.{PatchVer}-{TaskNumber}.{BetaVer}
89
- * For stable version we use {MajorVer}.{MinorVer}.{PatchVer}
173
+ - **Major** (X.0.0) - Breaking changes
174
+ - **Minor** (0.X.0) - New features, backwards compatible
175
+ - **Patch** (0.0.X) - Bug fixes, backwards compatible
90
176
 
91
- 3. Once we made some changes in the projects we do have two options
92
- * Pubish package with beta tag `npm run build` && `npm publish --tag beta`
93
- * Pubish package with stable version `npm run build` && `npm publish`
177
+ ## Architecture Notes
94
178
 
95
- 4. Once the version is tested on the FE project we need to make PR with stable version of the package
179
+ See `documentation/uikit-audit-and-refactoring-plan.md` for detailed audit and refactoring plan.
96
180
 
97
- - After PR is approved we can change the package version in our FE projects
181
+ **Key principles:**
182
+ - UIKit should contain only generic, reusable components
183
+ - Application-specific features (Menu, SpacePad, Wallet) should be in application code
184
+ - Current uikit contains legacy app-specific components for backwards compatibility
185
+ - New applications should implement their own Menu and navigation