stp-ui-kit 0.0.104 → 0.0.107
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 +90 -19
- package/dist/components/data/Table/Table.d.ts +12 -11
- package/dist/components/display/Chip/Chip.d.ts +2 -2
- package/dist/components/display/InputChip/InputChip.d.ts +6 -0
- package/dist/components/display/OptionList/OptionList.d.ts +10 -1
- package/dist/components/display/OptionList/index.d.ts +2 -0
- package/dist/components/display/index.d.ts +1 -0
- package/dist/components/feedback/Info/Info.d.ts +2 -2
- package/dist/components/feedback/Modal/Modal.d.ts +1 -1
- package/dist/components/feedback/Window/Window.d.ts +0 -1
- package/dist/components/form/Select/Select.d.ts +2 -2
- package/dist/components/icons/index.d.ts +2 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/icons/Plus.svg +3 -0
- package/dist/icons/X.svg +3 -0
- package/dist/stp-ui-kit.es.js +12678 -5060
- package/dist/stp-ui-kit.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/styles/tokens.d.ts +112 -0
- package/dist/vite-env.d.ts +6 -6
- package/package.json +20 -9
- package/src/styles/_variables.scss +907 -282
- package/src/styles/tokens.d.ts +112 -0
- package/src/styles/tokens.js +94 -0
- package/dist/components/ui/table.d.ts +0 -10
- package/dist/lib/exam/constants/index.d.ts +0 -6
- package/dist/lib/exam/types/question.types.d.ts +0 -49
package/README.md
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
# 🎨 stp-ui-kit
|
|
2
2
|
|
|
3
|
-
A
|
|
4
|
-
|
|
3
|
+
A comprehensive React UI Kit with 50+ production-ready components for the Smartestprep platform.
|
|
4
|
+
Built with TypeScript, Tailwind CSS, and SCSS for consistent design and rapid development.
|
|
5
|
+
|
|
6
|
+
[](https://www.npmjs.com/package/stp-ui-kit)
|
|
7
|
+
[](./LICENSE)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## ✨ Features
|
|
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
|
|
5
21
|
|
|
6
22
|
---
|
|
7
23
|
|
|
@@ -12,24 +28,66 @@ npm install stp-ui-kit
|
|
|
12
28
|
# or
|
|
13
29
|
yarn add stp-ui-kit
|
|
14
30
|
# or
|
|
15
|
-
|
|
31
|
+
pnpm add stp-ui-kit
|
|
16
32
|
```
|
|
17
33
|
|
|
18
34
|
---
|
|
19
35
|
|
|
20
|
-
## 🚀
|
|
21
|
-
|
|
22
|
-
Import styles and components directly into your React project:
|
|
36
|
+
## 🚀 Quick Start
|
|
23
37
|
|
|
24
38
|
```tsx
|
|
25
|
-
|
|
26
|
-
|
|
39
|
+
// Import styles once in your app entry (main.tsx or App.tsx)
|
|
40
|
+
// Import and use components
|
|
41
|
+
import { Button, Input, Modal, Typography } from "stp-ui-kit";
|
|
42
|
+
import "stp-ui-kit/styles";
|
|
27
43
|
|
|
28
44
|
export default function App() {
|
|
29
|
-
return
|
|
45
|
+
return (
|
|
46
|
+
<div>
|
|
47
|
+
<Typography variant='h1'>Welcome</Typography>
|
|
48
|
+
<Input
|
|
49
|
+
label='Email'
|
|
50
|
+
placeholder='Enter your email'
|
|
51
|
+
/>
|
|
52
|
+
<Button variant='primary'>Get Started</Button>
|
|
53
|
+
</div>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Using Design Tokens
|
|
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);
|
|
30
69
|
}
|
|
31
70
|
```
|
|
32
71
|
|
|
72
|
+
**In JavaScript/TypeScript:**
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
import { breakpoints, spacing, typography } from "stp-ui-kit/tokens";
|
|
76
|
+
|
|
77
|
+
const styles = {
|
|
78
|
+
padding: spacing["space-400"], // '16px'
|
|
79
|
+
};
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## 📚 Documentation
|
|
85
|
+
|
|
86
|
+
- **[COMPONENTS.md](./COMPONENTS.md)** - Complete component reference with all 50+ components
|
|
87
|
+
- **[USAGE_GUIDE.md](./USAGE_GUIDE.md)** - Comprehensive usage guide with examples
|
|
88
|
+
- **[CLAUDE.md](./CLAUDE.md)** - Instructions for AI assistants (Claude Code)
|
|
89
|
+
- **Storybook** - Interactive demos (run `npm run storybook`)
|
|
90
|
+
|
|
33
91
|
---
|
|
34
92
|
|
|
35
93
|
## 📂 Project Structure
|
|
@@ -61,7 +119,6 @@ src/
|
|
|
61
119
|
- React 18+ / 19+ – core UI framework
|
|
62
120
|
- TypeScript – strongly typed components
|
|
63
121
|
- TailwindCSS 4 + SCSS – styling and design tokens
|
|
64
|
-
- Lucide-react – icon library
|
|
65
122
|
- React Hook Form – form handling integration
|
|
66
123
|
- Storybook 8 – interactive component documentation
|
|
67
124
|
- Vite – development & build tooling
|
|
@@ -127,16 +184,30 @@ npm run build-storybook
|
|
|
127
184
|
- Always run `npm run build` before publishing
|
|
128
185
|
- All changes must be commited into repository
|
|
129
186
|
|
|
130
|
-
### 🛠 Local Development
|
|
187
|
+
### 🛠 Local Development with Hot Reload
|
|
131
188
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
189
|
+
When developing stp-ui-kit and testing in another project:
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
# 1. In stp-ui-kit directory
|
|
193
|
+
npm link
|
|
194
|
+
npm run build:watch # Keep this running - auto-rebuilds on changes!
|
|
195
|
+
|
|
196
|
+
# 2. In your project directory
|
|
197
|
+
npm link stp-ui-kit
|
|
198
|
+
npm start
|
|
199
|
+
|
|
200
|
+
# Changes in stp-ui-kit will now auto-reflect in your project! 🔥
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
**No need to unlink/relink** - `build:watch` provides hot reload for linked packages.
|
|
204
|
+
|
|
205
|
+
### 📤 Publishing
|
|
206
|
+
|
|
207
|
+
- Always run `npm run build` before publishing
|
|
208
|
+
- Update version in `package.json` before `npm publish`
|
|
209
|
+
- Commit all changes to repository
|
|
210
|
+
- Run `npm run format` and `npm run lint` before committing
|
|
140
211
|
|
|
141
212
|
## 🤝 Contributing
|
|
142
213
|
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
|
-
import
|
|
3
|
-
export declare
|
|
4
|
-
export declare
|
|
5
|
-
export declare
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export declare function Table({ className, ...props }: React.ComponentProps<"table">): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function TableHeader({ className, ...props }: React.ComponentProps<"thead">): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function TableBody({ className, ...props }: React.ComponentProps<"tbody">): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function TableRow({ className, ...props }: React.ComponentProps<"tr">): import("react/jsx-runtime").JSX.Element;
|
|
6
8
|
type VerticalAlign = "top" | "middle" | "bottom";
|
|
7
|
-
interface
|
|
8
|
-
vAlign?: VerticalAlign;
|
|
9
|
-
}
|
|
10
|
-
export declare const TableCell: React.FC<CustomTableCellProps>;
|
|
11
|
-
export declare const TableHeader: React.FC<React.ComponentProps<typeof ShadcnTableHeader>>;
|
|
12
|
-
interface CustomTableHeadProps extends React.ComponentProps<typeof ShadcnTableHead> {
|
|
9
|
+
interface CustomTableHeadProps extends React.ComponentProps<"th"> {
|
|
13
10
|
variant?: "primary" | "secondary";
|
|
14
11
|
}
|
|
15
12
|
export declare const TableHead: React.FC<CustomTableHeadProps>;
|
|
16
|
-
|
|
13
|
+
interface CustomTableCellProps extends ComponentProps<"td"> {
|
|
14
|
+
vAlign?: VerticalAlign;
|
|
15
|
+
}
|
|
16
|
+
export declare const TableCell: React.FC<CustomTableCellProps>;
|
|
17
|
+
export declare function TableCaption({ className, ...props }: React.ComponentProps<"caption">): import("react/jsx-runtime").JSX.Element;
|
|
17
18
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
|
2
|
-
export type ChipColor = "blue" | "violet" | "fuchsia" | "lime" | "teal" | "indigo" | "red" | "amber" | "green";
|
|
2
|
+
export type ChipColor = "blue" | "violet" | "fuchsia" | "lime" | "teal" | "indigo" | "red" | "amber" | "green" | "neutral";
|
|
3
3
|
export interface ChipProps {
|
|
4
|
-
label:
|
|
4
|
+
label: ReactNode;
|
|
5
5
|
icon?: ReactNode;
|
|
6
6
|
color?: ChipColor;
|
|
7
7
|
className?: string;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
1
2
|
export type ShadowLevel = "lower" | "higher";
|
|
3
|
+
export interface OptionProps {
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const Option: ({ label, icon, onClick, disabled, className, }: OptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
11
|
export interface OptionListItem {
|
|
3
|
-
label:
|
|
12
|
+
label: React.ReactNode;
|
|
4
13
|
icon?: React.ReactNode;
|
|
5
14
|
onClick?: () => void;
|
|
6
15
|
disabled?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
export interface InfoProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
3
|
text: ReactNode;
|
|
4
|
-
tone?: "warning" | "information";
|
|
4
|
+
tone?: "warning" | "information" | "success";
|
|
5
5
|
}
|
|
6
|
-
export declare const InfoIcons: Record<"warning" | "information", ReactNode>;
|
|
6
|
+
export declare const InfoIcons: Record<"warning" | "information" | "success", ReactNode>;
|
|
7
7
|
export declare const Info: ({ text, tone, className, ...rest }: InfoProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
interface SelectOption {
|
|
3
|
-
label:
|
|
3
|
+
label: React.ReactNode;
|
|
4
4
|
value: string | number;
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
}
|
|
7
7
|
interface SelectProps {
|
|
8
|
-
label?:
|
|
8
|
+
label?: React.ReactNode;
|
|
9
9
|
error?: string;
|
|
10
10
|
helperText?: string;
|
|
11
11
|
disabled?: boolean;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
|
|
2
|
+
<path d="M9.99968 3.41663C10.4139 3.41663 10.7497 3.75241 10.7497 4.16663V9.24963H15.8337C16.2476 9.24981 16.5835 9.5857 16.5837 9.99963C16.5837 10.4137 16.2477 10.7495 15.8337 10.7496H10.7497V15.8336C10.7495 16.2477 10.4138 16.5836 9.99968 16.5836C9.58572 16.5834 9.24986 16.2476 9.24968 15.8336V10.7496H4.16667C3.75246 10.7496 3.41667 10.4138 3.41667 9.99963C3.41687 9.58559 3.75258 9.24963 4.16667 9.24963H9.24968V4.16663C9.24968 3.75252 9.58562 3.4168 9.99968 3.41663Z" fill="currentColor"/>
|
|
3
|
+
</svg>
|
package/dist/icons/X.svg
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none">
|
|
2
|
+
<path d="M10.2197 0.21967C10.5126 -0.0732232 10.9873 -0.0732232 11.2802 0.21967C11.5731 0.512568 11.5731 0.987342 11.2802 1.28022L6.81049 5.74994L11.2802 10.2197C11.5731 10.5126 11.5731 10.9873 11.2802 11.2802C10.9873 11.5731 10.5126 11.5731 10.2197 11.2802L5.74994 6.81049L1.28022 11.2802C0.987342 11.5731 0.512568 11.5731 0.21967 11.2802C-0.0732232 10.9873 -0.0732232 10.5126 0.21967 10.2197L4.6894 5.74994L0.21967 1.28022C-0.0732233 0.987324 -0.0732233 0.512563 0.21967 0.21967C0.512563 -0.0732233 0.987324 -0.0732233 1.28022 0.21967L5.74994 4.6894L10.2197 0.21967Z" fill="currentColor"/>
|
|
3
|
+
</svg>
|