@coinswap-app/uikit 1.0.21 → 1.0.24
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 +107 -19
- package/dist/components/Svg/index.d.ts +2 -0
- package/dist/index.cjs.js +879 -3439
- package/dist/index.d.ts +0 -5
- package/dist/index.esm.js +761 -3307
- package/dist/util/index.d.ts +0 -2
- package/dist/wallet.d.ts +2 -0
- package/package.json +1 -1
- package/dist/util/moveUsercomWidget.d.ts +0 -2
package/README.md
CHANGED
|
@@ -1,15 +1,85 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @coinswap-app/uikit
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
8
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
-
|
|
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
|
-
|
|
179
|
+
See `documentation/uikit-audit-and-refactoring-plan.md` for detailed audit and refactoring plan.
|
|
96
180
|
|
|
97
|
-
|
|
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
|
|
@@ -47,6 +47,8 @@ export { default as UserCheckIcon } from "./Icons/UserCheck";
|
|
|
47
47
|
export { default as UserUncheckIcon } from "./Icons/UserUncheck";
|
|
48
48
|
export { default as CSSRoundIconLight } from "./Icons/CoinswapRoundLight";
|
|
49
49
|
export { default as PlusBackgroundIcon } from "./Icons/PlusBackground";
|
|
50
|
+
export { default as Plus } from "./Icons/Plus";
|
|
51
|
+
export { default as TierCheckmarkCircle } from "./Icons/TierCheckmarkCircle";
|
|
50
52
|
export { default as MinusBackgroundIcon } from "./Icons/MinusBackground";
|
|
51
53
|
export { default as NoProfileAvatarIcon } from "./Icons/NoProfileAvatar";
|
|
52
54
|
export { default as InfoFull } from "./Icons/InfoFull";
|