@raxrai/stylelab-ui 0.1.0 → 0.3.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 CHANGED
@@ -1,51 +1,39 @@
1
1
  # StyleLab UI
2
2
 
3
- A themeable, accessible React UI library with **8 themes**: Minimal, Night, Glass, Neubrutal, Clay, Cyberpunk, Retro, and Motion. Built with Tailwind CSS v4, CVA, and Lucide icons. NPM-ready with CJS/ESM build and zero heavy dependencies (peer: React).
3
+ A themeable, accessible React UI library with **8 themes**: Minimal, Night, Glass, Neubrutal, Clay, Cyberpunk, Retro, and Motion. Built with Tailwind CSS v4, CVA, and Lucide icons. Zero extra dependencies at install time — only **React** and **React DOM** as peers; everything else is bundled.
4
4
 
5
- ## Run locally
5
+ **Live site (demo, gallery, docs):** [https://stylelab.rajarai.com](https://stylelab.rajarai.com)
6
6
 
7
- ```bash
8
- npm install
9
- npm run dev
10
- ```
7
+ ---
11
8
 
12
- Open [http://localhost:3000/gallery](http://localhost:3000/gallery) to see all components and the sticky theme switcher.
9
+ ## Installation
13
10
 
14
- ## Build library for distribution
11
+ **Next.js or any existing React app** (you already have React):
15
12
 
16
13
  ```bash
17
- npm run build:lib
14
+ npm install @raxrai/stylelab-ui
18
15
  ```
19
16
 
20
- Output: `dist/` (CJS, ESM, and `.d.ts`). The package is already configured for npm (`main`, `module`, `types`, `exports`, `files`). To publish, see **[docs/PUBLISHING-TO-NPM.md](docs/PUBLISHING-TO-NPM.md)** for detailed steps.
21
-
22
- ---
23
-
24
- ## Documentation
25
-
26
- - **[docs/COMPONENTS.md](docs/COMPONENTS.md)** — Full component API: every prop, type, hook, and global (themes, `getThemeClass`, `cn`, etc.).
27
- - **[docs/PUBLISHING-TO-NPM.md](docs/PUBLISHING-TO-NPM.md)** — How to publish this package to npm (maintainers).
28
-
29
- ---
30
-
31
- ## Installation
17
+ **New project without React** (e.g. empty folder):
32
18
 
33
19
  ```bash
34
20
  npm install @raxrai/stylelab-ui react react-dom
35
21
  ```
36
22
 
37
- Peer dependencies: `react` and `react-dom` (>=18). Other runtime deps (e.g. `class-variance-authority`, `clsx`, `tailwind-merge`, `lucide-react`, `framer-motion`) are bundled, so no extra install is required.
23
+ The package lists **react** and **react-dom** as peer dependencies (>=18). Next.js and Create React App already include them, so you don’t install them again. Other runtime deps (cva, clsx, tailwind-merge, lucide-react, framer-motion) are bundled, so no extra install is required.
38
24
 
39
- ### Tailwind + styles
25
+ ### 1. Tailwind + styles
40
26
 
41
- Your app must use **Tailwind CSS v4**. Import StyleLab design tokens in your global CSS after Tailwind:
27
+ Your app must use **Tailwind CSS v4**. Import StyleLab design tokens in your global CSS **after** Tailwind:
42
28
 
43
29
  ```css
44
30
  @import "tailwindcss";
45
31
  @import "@raxrai/stylelab-ui/styles";
46
32
  ```
47
33
 
48
- ### ThemeProvider
34
+ ### 2. ThemeProvider
35
+
36
+ Wrap your app so components receive the active theme:
49
37
 
50
38
  ```tsx
51
39
  import { ThemeProvider } from "@raxrai/stylelab-ui";
@@ -61,7 +49,7 @@ export default function RootLayout({ children }) {
61
49
  }
62
50
  ```
63
51
 
64
- ### Use components
52
+ ### 3. Use components
65
53
 
66
54
  ```tsx
67
55
  import { Button, Card, useTheme } from "@raxrai/stylelab-ui";
@@ -79,17 +67,20 @@ export function MyPage() {
79
67
 
80
68
  **Themes:** `minimal` | `night` | `glass` | `neubrutal` | `clay` | `cyberpunk` | `retro` | `motion`
81
69
 
82
- ### Exports
70
+ ---
71
+
72
+ ## What’s in the package
83
73
 
84
74
  **Components:** Accordion, Alert, Avatar, AvatarGroup, Badge, BentoGrid, Breadcrumbs, Button, Calendar, Card, CommandPalette, DashboardShell, DataTable, DocumentAccordion, Dropdown, Flashcard, GraphicCard, Input, Modal, Navbar, PricingCard, ProgressBar, SectionHeader, Sidebar, Skeleton, Slider, StatsCard, Tabs, Terminal, Timeline, Toast, Toggle, Tooltip.
85
75
 
86
76
  **Global:** ThemeProvider, useTheme, getThemeClass, THEMES, StyleLabTheme, cn, getNextListIndex, useFocusTrap, useClickOutside, useKeyboardNavigation.
87
77
 
88
- Full API (props, types, usage): see [docs/COMPONENTS.md](docs/COMPONENTS.md).
78
+ - **See all components and try themes:** [stylelab.rajarai.com](https://stylelab.rajarai.com)
79
+ - **Full API (props, types, hooks):** [docs/COMPONENTS.md](docs/COMPONENTS.md) in this repo.
89
80
 
90
81
  ---
91
82
 
92
- ## Component Prop API (overview)
83
+ ## Component API (overview)
93
84
 
94
85
  ### Button
95
86
 
@@ -196,8 +187,8 @@ Implements focus trap and scroll lock when open.
196
187
 
197
188
  | Prop | Type | Default | Description |
198
189
  |----------------|-------------------------|---------|--------------------------|
199
- | `trigger` | `ReactNode` | — | Button / element to open |
200
- | `items` | `{ value, label, disabled? }[]` | — | Options |
190
+ | `trigger` | `ReactNode` | — | Button / element to open |
191
+ | `items` | `{ value, label, disabled? }[]` | — | Options |
201
192
  | `value` / `defaultValue` | `string` | — | Controlled / initial |
202
193
  | `onValueChange`| `(value: string) => void` | — | Selection callback |
203
194
 
@@ -211,10 +202,32 @@ Keyboard: Enter/Space to open, Arrows to move, Enter to select, Escape to close.
211
202
  import { cn, useFocusTrap, useClickOutside, useKeyboardNavigation, getNextListIndex } from "@raxrai/stylelab-ui";
212
203
  ```
213
204
 
214
- - **cn(...)** – `clsx` + `tailwind-merge` for class names.
205
+ - **cn(...)** – clsx + tailwind-merge for class names.
215
206
  - **useFocusTrap(active, options?)** – Traps focus in a container ref (e.g. Modal).
216
207
  - **useClickOutside(ref(s), handler, options?)** – Fires when click is outside ref(s).
217
208
  - **useKeyboardNavigation({ onEscape, onArrowLeft, onArrowRight, ... })** – Document-level key handlers.
218
209
  - **getNextListIndex(current, direction, length)** – Index for arrow-key list/tab navigation.
219
210
 
220
211
  ---
212
+
213
+ ## Changelog
214
+
215
+ ### [0.2.0]
216
+
217
+ - **Navbar** — Optional responsive API: pass `logo`, `items` (`{ href, label }[]`), and `right` (e.g. theme switcher). On small screens nav links become a hamburger menu that opens as an overlay (no layout shift), with the theme’s navbar background; glass and clay use an opaque panel so content doesn’t show through. Desktop shows full nav row. Menu closes on link click or outside click. You can still pass `children` for a custom layout. Exported types: `NavbarItem`, `NavbarProps`.
218
+ - **ThemeProvider** — Restores theme from `localStorage` on mount; `setTheme` persists the new theme. Optional `storageKey` prop (default `"stylelab-theme"`).
219
+ - **Dropdown** — Popover is portaled to `document.body` and positioned with open-up/down logic. Optional `trigger` and `placeholder` (default trigger shows selected/placeholder label). `classNames` for trigger, popover, and item. Theme-aware hover/focus styles. Exported types: `DropdownItem`, `DropdownProps`, `DropdownClassNames`.
220
+ - **Card** — `classNames` for root, header, body, footer. Cyberpunk no longer uses the clip-path “glitch cut” (avoids weird look on different backgrounds); neon border and glow remain. Exported types: `CardProps`, `CardClassNames`.
221
+ - **Badge** — `bgOverride` and `textOverride` (e.g. hex) when you need specific colors.
222
+ - **ProgressBar** — `trackColor` and `activeColor` overrides (e.g. hex).
223
+ - **DashboardShell** — Header, nav links, and mobile panel use theme-based styling (no `dark:`; works with StyleLab themes).
224
+ - **GraphicCard** — In night and cyberpunk themes, content text inherits the card’s text color so children with hardcoded dark text still display correctly.
225
+ - **Docs** — Installation: Next.js/existing React apps install the package only; add `react`/`react-dom` only for new projects without React.
226
+ - **Types** — `StyleLabTheme`, `ComponentName`, `ThemeRecommendation` from `lib/types`; component prop types `NavbarItem`, `NavbarProps`, `CardProps`, `CardClassNames`, `DropdownItem`, `DropdownProps`, `DropdownClassNames` re-exported from the package.
227
+
228
+ ---
229
+
230
+ ## Links
231
+
232
+ - **Live demo & docs:** [https://stylelab.rajarai.com](https://stylelab.rajarai.com)
233
+ - **Full component API (this repo):** [docs/COMPONENTS.md](docs/COMPONENTS.md)