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 CHANGED
@@ -1,7 +1,23 @@
1
1
  # 🎨 stp-ui-kit
2
2
 
3
- A custom UI Kit developed for the Smartestprep platform.
4
- It provides a set of reusable, styled, and tested UI components to ensure consistent design and faster development across projects.
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
+ [![npm version](https://img.shields.io/npm/v/stp-ui-kit.svg)](https://www.npmjs.com/package/stp-ui-kit)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](./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
- bun add stp-ui-kit
31
+ pnpm add stp-ui-kit
16
32
  ```
17
33
 
18
34
  ---
19
35
 
20
- ## 🚀 Usage
21
-
22
- Import styles and components directly into your React project:
36
+ ## 🚀 Quick Start
23
37
 
24
38
  ```tsx
25
- import { Button } from "stp-ui-kit";
26
- import "stp-ui-kit/dist/styles/index.css";
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 <Button variant='primary'>Click Me</Button>;
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
- - When developing locally with other projects, use `npm link`
133
- ```bash
134
- # inside stp-ui-kit
135
- npm link
136
- # inside your project
137
- npm link stp-ui-kit
138
- ```
139
- - After testing locally, publish the updated package if required
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 { Table as ShadcnTable, TableBody as ShadcnTableBody, TableCaption as ShadcnTableCaption, TableCell as ShadcnTableCell, TableHead as ShadcnTableHead, TableHeader as ShadcnTableHeader, TableRow as ShadcnTableRow } from '../../ui/table';
3
- export declare const Table: React.FC<React.ComponentProps<typeof ShadcnTable>>;
4
- export declare const TableBody: React.FC<React.ComponentProps<typeof ShadcnTableBody>>;
5
- export declare const TableCaption: React.FC<React.ComponentProps<typeof ShadcnTableCaption>>;
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 CustomTableCellProps extends ComponentProps<typeof ShadcnTableCell> {
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
- export declare const TableRow: React.FC<React.ComponentProps<typeof ShadcnTableRow>>;
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: string;
4
+ label: ReactNode;
5
5
  icon?: ReactNode;
6
6
  color?: ChipColor;
7
7
  className?: string;
@@ -0,0 +1,6 @@
1
+ import { default as React, ReactNode } from 'react';
2
+ export interface InputChipProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ label: ReactNode;
4
+ icon?: ReactNode;
5
+ }
6
+ export declare const InputChip: React.FC<InputChipProps>;
@@ -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: string;
12
+ label: React.ReactNode;
4
13
  icon?: React.ReactNode;
5
14
  onClick?: () => void;
6
15
  disabled?: boolean;
@@ -0,0 +1,2 @@
1
+ export { OptionList, Option } from './OptionList';
2
+ export type { OptionListProps, OptionListItem, OptionProps, ShadowLevel, } from './OptionList';
@@ -9,3 +9,4 @@ export * from './Icon/Icon';
9
9
  export * from './OptionList/OptionList';
10
10
  export * from './Illustration/Illustration';
11
11
  export * from './Chip/Chip';
12
+ export * from './InputChip/InputChip';
@@ -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;
@@ -4,7 +4,7 @@ export interface ModalProps {
4
4
  activator?: ReactNode;
5
5
  open: boolean;
6
6
  onClose?: () => void;
7
- title: string;
7
+ title: ReactNode;
8
8
  primaryButtonProps?: ButtonProps;
9
9
  secondaryButtonProps?: ButtonProps[];
10
10
  tone?: "default" | "critical" | "warning";
@@ -7,7 +7,6 @@ export interface WindowProps {
7
7
  title: string;
8
8
  primaryButtonProps?: ButtonProps;
9
9
  secondaryButtonProps?: ButtonProps[];
10
- tone?: "default" | "critical" | "warning";
11
10
  children: ReactNode;
12
11
  fullHeight?: boolean;
13
12
  size?: "sm" | "lg" | "md";
@@ -1,11 +1,11 @@
1
1
  import { default as React } from 'react';
2
2
  interface SelectOption {
3
- label: string;
3
+ label: React.ReactNode;
4
4
  value: string | number;
5
5
  disabled?: boolean;
6
6
  }
7
7
  interface SelectProps {
8
- label?: string;
8
+ label?: React.ReactNode;
9
9
  error?: string;
10
10
  helperText?: string;
11
11
  disabled?: boolean;
@@ -0,0 +1,2 @@
1
+ export { default as Plus } from '../../../public/icons/Plus.svg?react';
2
+ export { default as X } from '../../../public/icons/X.svg?react';
@@ -4,3 +4,4 @@ export * from './navigation';
4
4
  export * from './feedback';
5
5
  export * from './display';
6
6
  export * from './data';
7
+ export * from './icons';
@@ -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>
@@ -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>