@blockscout/ui-toolkit 0.0.1-alpha.3 → 0.0.1-alpha.4

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,25 +1,93 @@
1
- <!-- TODO @tom2drum rewrite README -->
2
- <!-- TODO @tom2drum add build check to CI workflow -->
3
- <!-- TODO @tom2drum add publish workflow -->
4
- <!-- TODO @tom2drum README: discourage use of IconSvg -->
1
+ # Blockscout UI Toolkit
5
2
 
6
- # Your Organization's UI Toolkit
3
+ A comprehensive collection of reusable Chakra UI components and theme system for Blockscout's projects. This toolkit provides a consistent design system and UI components to maintain visual consistency across Blockscout applications.
7
4
 
8
- A collection of reusable Chakra UI components and theme for your organization's projects.
5
+ ## Features
6
+
7
+ - 🎨 Pre-configured Chakra UI theme with Blockscout's design system
8
+ - 🧩 Reusable UI components built on Chakra UI
9
+ - 🌓 Built-in dark mode support
10
+ - 📱 Responsive and accessible components
11
+ - 🔍 TypeScript support with proper type definitions
9
12
 
10
13
  ## Installation
11
14
 
15
+ ### Package Installation
16
+
17
+ Install the package using your preferred package manager:
18
+
12
19
  ```bash
13
- npm install @your-org/toolkit
14
- # or
15
- yarn add @your-org/toolkit
20
+ # Using npm
21
+ npm install @blockscout/ui-toolkit
22
+
23
+ # Using yarn
24
+ yarn add @blockscout/ui-toolkit
25
+ ```
26
+
27
+ ### Required Dependencies
28
+
29
+ Ensure you have the following peer dependencies installed:
30
+
31
+ ```json
32
+ {
33
+ "dependencies": {
34
+ "@blockscout/ui-toolkit": "latest",
35
+ "@chakra-ui/react": ">=3.15.0",
36
+ "@emotion/react": ">=11.14.0",
37
+ "next": ">=15.2.3",
38
+ "next-themes": ">=0.4.4",
39
+ "react": ">=18.3.1",
40
+ "react-dom": ">=18.3.1",
41
+ "react-hook-form": ">=7.52.1"
42
+ },
43
+ "devDependencies": {
44
+ "@chakra-ui/cli": ">=3.15.0",
45
+ "@types/node": "^20",
46
+ "@types/react": "18.3.12",
47
+ "@types/react-dom": "18.3.1",
48
+ "typescript": "5.4.2"
49
+ }
50
+ }
51
+ ```
52
+
53
+ ## Quick Start
54
+
55
+ ### 1. Theme Setup
56
+
57
+ Create a `theme.ts` file in your project and configure the Blockscout theme:
58
+
59
+ ```tsx
60
+ // Basic setup
61
+ import { theme } from '@blockscout/ui-toolkit';
62
+ export default theme;
63
+ ```
64
+
65
+ Or extend the theme with custom overrides:
66
+
67
+ ```tsx
68
+ import { createSystem } from '@chakra-ui/react';
69
+ import { themeConfig } from '@blockscout/ui-toolkit';
70
+
71
+ const customOverrides = {
72
+ // Add your custom theme overrides here
73
+ colors: {
74
+ brand: {
75
+ primary: '#your-color',
76
+ },
77
+ },
78
+ };
79
+
80
+ export default createSystem(themeConfig, customOverrides);
16
81
  ```
17
82
 
18
- ## Usage
83
+ ### 2. Provider Setup
84
+
85
+ Wrap your application with the ChakraProvider:
19
86
 
20
87
  ```tsx
21
- import { Button, theme } from '@your-org/toolkit';
22
88
  import { ChakraProvider } from '@chakra-ui/react';
89
+ import { Button } from '@blockscout/ui-toolkit';
90
+ import theme from './theme';
23
91
 
24
92
  function App() {
25
93
  return (
@@ -30,75 +98,73 @@ function App() {
30
98
  }
31
99
  ```
32
100
 
101
+ ### 3. TypeScript Support
102
+
103
+ Add the following script to your `package.json` to generate Chakra UI type definitions:
104
+
105
+ ```json
106
+ {
107
+ "scripts": {
108
+ "chakra:typegen": "chakra typegen ./src/theme.ts"
109
+ }
110
+ }
111
+ ```
112
+
33
113
  ## Development
34
114
 
35
- 1. Install dependencies:
115
+ ### Local Development
116
+
117
+ 1. Clone the repository and install dependencies:
36
118
  ```bash
37
- npm install
38
- # or
39
119
  yarn
40
120
  ```
41
121
 
42
- 2. Start development server:
122
+ 2. Start the development server:
43
123
  ```bash
44
- npm run dev
45
- # or
46
124
  yarn dev
47
125
  ```
48
126
 
49
127
  3. Build the package:
50
128
  ```bash
51
- npm run build
52
- # or
53
129
  yarn build
54
130
  ```
55
131
 
56
- ## Publishing
132
+ ### Publishing
133
+
134
+ #### Manual Publishing
135
+
136
+ 1. Update the package version:
137
+ ```bash
138
+ npm version <version-tag>
139
+ ```
57
140
 
58
- 1. Update the version in `package.json`
59
141
  2. Build the package:
60
142
  ```bash
61
143
  npm run build
62
144
  ```
145
+
63
146
  3. Publish to NPM:
64
147
  ```bash
65
- npm publish
148
+ npm publish --access public
66
149
  ```
67
150
 
68
- ## Available Components
69
-
70
- - Accordion
71
- - Alert
72
- - Avatar
73
- - Badge
74
- - Button
75
- - Checkbox
76
- - Close Button
77
- - Collapsible
78
- - Color Mode
79
- - Dialog
80
- - Drawer
81
- - Field
82
- - Heading
83
- - Icon Button
84
- - Image
85
- - Input
86
- - Input Group
87
- - Link
88
- - Menu
89
- - Pin Input
90
- - Popover
91
- - Progress Circle
92
- - Provider
93
- - Radio
94
- - Rating
95
- - Select
96
- - Skeleton
97
- - Slider
98
- - Switch
99
- - Table
100
- - Tabs
101
- - Tag
102
- - Textarea
103
- - Toaster
104
- - Tooltip
151
+ #### Automated Publishing
152
+
153
+ Use the `toolkit-npm-publisher.yml` GitHub Actions workflow for automated publishing.
154
+
155
+ ## Contributing
156
+
157
+ We welcome contributions! Please follow these steps:
158
+
159
+ 1. Fork the repository
160
+ 2. Create a feature branch
161
+ 3. Make your changes
162
+ 4. Submit a pull request
163
+
164
+ ## Support
165
+
166
+ For issues, feature requests, or questions, please open an issue in the repository.
167
+
168
+ ## License
169
+
170
+ This project is licensed under the GNU General Public License v3.