stp-ui-kit 0.1.0 → 2.0.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.
- package/README.md +40 -200
- package/dist/src/components/form/index.d.ts +0 -1
- package/dist/src/components/layout/index.d.ts +0 -1
- package/dist/src/components/navigation/index.d.ts +0 -1
- package/dist/src/global.d.ts +4 -0
- package/dist/stp-ui-kit.es.js +1966 -2223
- package/dist/stp-ui-kit.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/docs/components/README.md +0 -3
- package/docs/components/form/Calendar.md +0 -1
- package/docs/components/form/Checkbox.md +0 -1
- package/docs/components/form/InlineError.md +0 -1
- package/docs/components/form/Input.md +0 -1
- package/docs/components/form/RadioButton.md +0 -1
- package/docs/components/form/Select.md +0 -1
- package/docs/components/form/TextArea.md +0 -1
- package/docs/components/navigation/Collapse.md +0 -1
- package/docs/components/navigation/NavigationItem.md +1 -2
- package/package.json +7 -2
- package/src/global.d.ts +4 -0
- package/dist/src/components/form/FormItem/FormItem.d.ts +0 -21
- package/dist/src/components/form/FormItem/FormItemContext.d.ts +0 -6
- package/dist/src/components/layout/Banner/Banner.d.ts +0 -11
- package/dist/src/components/layout/Banner/Banner.stories.d.ts +0 -6
- package/dist/src/components/layout/Banner/utils/utils.d.ts +0 -1
- package/dist/src/components/navigation/CourseCollapse/CourseCollapse.d.ts +0 -14
- package/docs/components/form/FormItem.md +0 -216
- package/docs/components/navigation/CourseCollapse.md +0 -103
package/README.md
CHANGED
|
@@ -1,231 +1,71 @@
|
|
|
1
|
-
#
|
|
1
|
+
# stp-ui-kit
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
Built with TypeScript, Tailwind CSS, and SCSS for consistent design and rapid development.
|
|
3
|
+
> Smartestprep UI Kit for React apps
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
[](./LICENSE)
|
|
5
|
+
A modern React component library with 50+ production-ready components, design tokens, and comprehensive documentation.
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
## Quick Start
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
- 🎨 **50+ Components** - Display, Form, Feedback, Layout, Navigation, Data
|
|
14
|
-
- 🎯 **Design System** - Comprehensive design tokens (spacing, colors, typography)
|
|
15
|
-
- 📱 **Responsive** - Mobile-first with built-in breakpoints
|
|
16
|
-
- 🔧 **TypeScript** - Full type safety with strict mode
|
|
17
|
-
- 🎭 **Theming** - CSS custom properties for easy theming
|
|
18
|
-
- 🚀 **Tree-shakeable** - ES modules for optimal bundle size
|
|
19
|
-
- 📚 **Storybook** - Interactive component documentation
|
|
20
|
-
- 🔥 **Hot Reload** - Watch mode for seamless development with npm link
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## 📦 Installation
|
|
9
|
+
### Installation
|
|
25
10
|
|
|
26
11
|
```bash
|
|
27
12
|
npm install stp-ui-kit
|
|
28
|
-
# or
|
|
29
|
-
yarn add stp-ui-kit
|
|
30
|
-
# or
|
|
31
|
-
pnpm add stp-ui-kit
|
|
32
13
|
```
|
|
33
14
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
## 🚀 Quick Start
|
|
15
|
+
### Basic Usage
|
|
37
16
|
|
|
38
17
|
```tsx
|
|
39
|
-
|
|
40
|
-
// Import and use components
|
|
41
|
-
import { Button, Input, Modal, Typography } from "stp-ui-kit";
|
|
18
|
+
import { Button, Input, Page } from "stp-ui-kit";
|
|
42
19
|
import "stp-ui-kit/styles";
|
|
43
20
|
|
|
44
|
-
|
|
21
|
+
function App() {
|
|
45
22
|
return (
|
|
46
|
-
<
|
|
47
|
-
<
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
placeholder='Enter your email'
|
|
51
|
-
/>
|
|
52
|
-
<Button variant='primary'>Get Started</Button>
|
|
53
|
-
</div>
|
|
23
|
+
<Page title="Dashboard">
|
|
24
|
+
<Input label="Email" placeholder="Enter your email" />
|
|
25
|
+
<Button>Submit</Button>
|
|
26
|
+
</Page>
|
|
54
27
|
);
|
|
55
28
|
}
|
|
56
29
|
```
|
|
57
30
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
**In SCSS files:**
|
|
61
|
-
|
|
62
|
-
```scss
|
|
63
|
-
@use "stp-ui-kit/styles/variables" as stp;
|
|
64
|
-
|
|
65
|
-
.my-component {
|
|
66
|
-
padding: stp.$space-400; // 16px
|
|
67
|
-
border-radius: stp.$border-radius-100; // 4px
|
|
68
|
-
color: var(--color-neutral-800);
|
|
69
|
-
}
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
**In JavaScript/TypeScript:**
|
|
31
|
+
## Documentation
|
|
73
32
|
|
|
74
|
-
|
|
75
|
-
|
|
33
|
+
| Document | Description |
|
|
34
|
+
|----------|-------------|
|
|
35
|
+
| [Getting Started](./documentation/GETTING_STARTED.md) | Installation, setup, connecting to projects |
|
|
36
|
+
| [Architecture](./documentation/ARCHITECTURE.md) | Project structure, patterns, organization |
|
|
37
|
+
| [Design System](./documentation/DESIGN_SYSTEM.md) | Tokens, spacing, typography, theming |
|
|
38
|
+
| [Components](./documentation/COMPONENTS.md) | Full component index by category |
|
|
39
|
+
| [Development](./documentation/DEVELOPMENT.md) | Contributing, local dev, code style |
|
|
40
|
+
| [Migration](./documentation/MIGRATION.md) | Version upgrades, breaking changes |
|
|
41
|
+
| [Best Practices](./documentation/BEST_PRACTICES.md) | Patterns, anti-patterns, accessibility |
|
|
76
42
|
|
|
77
|
-
|
|
78
|
-
padding: spacing["space-400"], // '16px'
|
|
79
|
-
};
|
|
80
|
-
```
|
|
43
|
+
## Component Categories
|
|
81
44
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
- **[PAGE_CHEAT_SHEET.md](./docs/PAGE_CHEAT_SHEET.md)** - Quick reference cheat sheet
|
|
91
|
-
- **[SPACING_GUIDE.md](./docs/SPACING_GUIDE.md)** - Visual spacing & layout guide
|
|
92
|
-
- **[SCROLL_OVERFLOW_GUIDE.md](./docs/SCROLL_OVERFLOW_GUIDE.md)** - Scroll behavior & overflow handling
|
|
93
|
-
- **[MIGRATION_GUIDE.md](./docs/MIGRATION_GUIDE.md)** - ⚠️ Migration guide from old API to v0.0.117+
|
|
94
|
-
- **[page-building-schema.json](./docs/page-building-schema.json)** - JSON schema for AI tools
|
|
95
|
-
- **[CLAUDE.md](./CLAUDE.md)** - Instructions for AI assistants (Claude Code)
|
|
96
|
-
- **Storybook** - Interactive demos (run `npm run storybook`)
|
|
97
|
-
|
|
98
|
-
---
|
|
99
|
-
|
|
100
|
-
## 📂 Project Structure
|
|
101
|
-
|
|
102
|
-
```plaintext
|
|
103
|
-
src/
|
|
104
|
-
├─ assets/ # custom icons and static assets
|
|
105
|
-
├─ components/ # UI components
|
|
106
|
-
│ ├─ data/
|
|
107
|
-
│ ├─ display/
|
|
108
|
-
│ ├─ feedback/
|
|
109
|
-
│ ├─ form/
|
|
110
|
-
│ ├─ layout/
|
|
111
|
-
│ ├─ navigation/
|
|
112
|
-
│ └─ ui/
|
|
113
|
-
├─ lib/ # helpers, utils
|
|
114
|
-
├─ styles/ # global styles, tokens, variables
|
|
115
|
-
│ ├─ _variables.scss
|
|
116
|
-
│ ├─ main.scss
|
|
117
|
-
│ └─ tokens.ts
|
|
118
|
-
├─ App.tsx # playground / dev entry
|
|
119
|
-
└─ index.ts # main export file
|
|
120
|
-
```
|
|
45
|
+
| Category | Components | Description |
|
|
46
|
+
|----------|------------|-------------|
|
|
47
|
+
| **Data** | ProgressLine, ProgressBarAlternative, Table | Data display and visualization |
|
|
48
|
+
| **Display** | Button, Avatar, Typography, Chip, Icon, Dropdown | Visual and interactive elements |
|
|
49
|
+
| **Feedback** | Modal, Spinner, Tooltip, Message, AppLoader | Notifications and loading states |
|
|
50
|
+
| **Form** | Input, Select, Checkbox, RadioButton, Calendar, TextArea | Form inputs and controls |
|
|
51
|
+
| **Layout** | Page, Section, Drawer, BottomBar, TopBar | Page structure and organization |
|
|
52
|
+
| **Navigation** | Link, Collapse, NavigationItem | Navigation elements |
|
|
121
53
|
|
|
122
|
-
|
|
54
|
+
## Storybook
|
|
123
55
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
- React 18+ / 19+ – core UI framework
|
|
127
|
-
- TypeScript – strongly typed components
|
|
128
|
-
- TailwindCSS 4 + SCSS – styling and design tokens
|
|
129
|
-
- React Hook Form – form handling integration
|
|
130
|
-
- Storybook 8 – interactive component documentation
|
|
131
|
-
- Vite – development & build tooling
|
|
132
|
-
|
|
133
|
-
---
|
|
134
|
-
|
|
135
|
-
## 📖 Documentation
|
|
136
|
-
|
|
137
|
-
Run Storybook to explore and test components interactively:
|
|
56
|
+
Interactive component documentation:
|
|
138
57
|
|
|
139
58
|
```bash
|
|
140
59
|
npm run storybook
|
|
141
60
|
```
|
|
142
61
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
```bash
|
|
146
|
-
npm run build-storybook
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
---
|
|
150
|
-
|
|
151
|
-
## 🧑💻 Development
|
|
152
|
-
|
|
153
|
-
- Start in dev mode
|
|
154
|
-
|
|
155
|
-
```bash
|
|
156
|
-
npm run dev
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
- Build library
|
|
160
|
-
|
|
161
|
-
```bash
|
|
162
|
-
npm run build
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
- Lint & format
|
|
166
|
-
|
|
167
|
-
```bash
|
|
168
|
-
npm run lint
|
|
169
|
-
npm run format
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
- Generate tokens
|
|
173
|
-
```bash
|
|
174
|
-
npm run generate-tokens
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
|
-
# 🔑 Principles
|
|
180
|
-
|
|
181
|
-
- Fully typed components (.ts / .tsx only)
|
|
182
|
-
- Consistent design system powered by tokens according to Figma designs
|
|
183
|
-
- Use named exports only (`export const`)
|
|
184
|
-
- Remove unused/deprecated components over time
|
|
185
|
-
- Do not add new dependencies unless absolutely necessary (to avoid making the project heavy)
|
|
186
|
-
|
|
187
|
-
### 📦 Project Releases
|
|
188
|
-
|
|
189
|
-
- Always upgrade the version in `package.json` before publishing
|
|
190
|
-
- Do **not** run `npm publish` for every minor change
|
|
191
|
-
- Always run `npm run build` before publishing
|
|
192
|
-
- All changes must be commited into repository
|
|
193
|
-
|
|
194
|
-
### 🛠 Local Development with Hot Reload
|
|
195
|
-
|
|
196
|
-
When developing stp-ui-kit and testing in another project:
|
|
197
|
-
|
|
198
|
-
```bash
|
|
199
|
-
# 1. In stp-ui-kit directory
|
|
200
|
-
npm link
|
|
201
|
-
npm run build:watch # Keep this running - auto-rebuilds on changes!
|
|
202
|
-
|
|
203
|
-
# 2. In your project directory
|
|
204
|
-
npm link stp-ui-kit
|
|
205
|
-
npm start
|
|
206
|
-
|
|
207
|
-
# Changes in stp-ui-kit will now auto-reflect in your project! 🔥
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
**No need to unlink/relink** - `build:watch` provides hot reload for linked packages.
|
|
211
|
-
|
|
212
|
-
### 📤 Publishing
|
|
213
|
-
|
|
214
|
-
- Always run `npm run build` before publishing
|
|
215
|
-
- Update version in `package.json` before `npm publish`
|
|
216
|
-
- Commit all changes to repository
|
|
217
|
-
- Run `npm run format` and `npm run lint` before committing
|
|
218
|
-
|
|
219
|
-
## 🤝 Contributing
|
|
220
|
-
|
|
221
|
-
1. Clone the repo
|
|
222
|
-
2. Install dependencies with `npm install`
|
|
223
|
-
3. Run Storybook (`npm run storybook`)
|
|
224
|
-
4. Add or update a component inside `src/components`
|
|
225
|
-
5. Submit a pull request 🎉
|
|
62
|
+
## Tech Stack
|
|
226
63
|
|
|
227
|
-
|
|
64
|
+
- React 18/19
|
|
65
|
+
- TypeScript
|
|
66
|
+
- SCSS with design tokens
|
|
67
|
+
- Vite build system
|
|
228
68
|
|
|
229
|
-
##
|
|
69
|
+
## License
|
|
230
70
|
|
|
231
|
-
MIT
|
|
71
|
+
MIT
|