@codeswayam/ui 1.0.1 → 1.1.1

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,597 +1,323 @@
1
- # @codeswayam/ui - UI Component Library
2
-
3
- ## Overview
4
-
5
- **@codeswayam/ui** is a comprehensive UI component library built on **Radix UI** and **Tailwind CSS**. It provides reusable, accessible, and well-documented React components used across all CodeSwayam applications. The library ensures consistent design and user experience across the platform.
6
-
7
- ---
8
-
9
- ## 🎯 Features
10
-
11
- - **Accessible Components**: Built with Radix UI for accessibility
12
- - **Tailwind CSS**: Utility-first styling
13
- - **Type-Safe**: Full TypeScript support
14
- - **Themeable**: Customizable colors and styles
15
- - **Responsive**: Mobile-first design
16
- - **Dark Mode**: Built-in dark mode support
17
- - **60+ Components**: Comprehensive component library
18
- - **Well-Documented**: Storybook documentation
19
- - **Composable**: Easy to extend and customize
20
- - **Zero Dependencies**: Uses peer dependencies only
21
-
22
- ---
23
-
24
- ## 📦 Installation
25
-
26
- ```bash
27
- npm install @codeswayam/ui
28
- ```
29
-
30
- ---
31
-
32
- ## 🔧 Setup
33
-
34
- ### 1. Install Peer Dependencies
35
-
36
- ```bash
37
- npm install react react-dom next tailwindcss
38
- ```
39
-
40
- ### 2. Configure Tailwind
41
-
42
- Add to `tailwind.config.ts`:
43
-
44
- ```typescript
45
- import type { Config } from 'tailwindcss'
46
-
47
- const config: Config = {
48
- content: [
49
- './node_modules/@codeswayam/ui/**/*.{js,ts,jsx,tsx}',
50
- './app/**/*.{js,ts,jsx,tsx}',
51
- './components/**/*.{js,ts,jsx,tsx}'
52
- ],
53
- theme: {
54
- extend: {}
55
- },
56
- plugins: []
57
- }
58
-
59
- export default config
60
- ```
61
-
62
- ### 3. Import Styles
63
-
64
- ```typescript
65
- // app/globals.css or your global CSS file
66
- @import '@codeswayam/ui/globals.css'
67
- ```
68
-
69
- ---
70
-
71
- ## 🚀 Basic Usage
72
-
73
- ### Import Components
74
-
75
- ```tsx
76
- import {
77
- Button,
78
- Card,
79
- Input,
80
- Label,
81
- Select,
82
- Dialog,
83
- Tabs,
84
- Toast
85
- } from '@codeswayam/ui'
86
- ```
87
-
88
- ### Using Components
89
-
90
- ```tsx
91
- import { Button } from '@codeswayam/ui'
92
-
93
- export function App() {
94
- return <Button variant="primary">Click me</Button>
95
- }
96
- ```
97
-
98
- ---
99
-
100
- ## 📚 Component Library
101
-
102
- ### Layout Components
103
-
104
- #### Container
105
- Responsive container with max width
106
-
107
- ```tsx
108
- import { Container } from '@codeswayam/ui'
109
-
110
- <Container>
111
- <h1>Your content</h1>
112
- </Container>
113
- ```
114
-
115
- #### Grid
116
- Responsive grid layout
117
-
118
- ```tsx
119
- import { Grid, GridItem } from '@codeswayam/ui'
120
-
121
- <Grid columns={3} gap={4}>
122
- <GridItem>Item 1</GridItem>
123
- <GridItem>Item 2</GridItem>
124
- <GridItem>Item 3</GridItem>
125
- </Grid>
126
- ```
127
-
128
- ### Form Components
129
-
130
- #### Button
131
- Versatile button component
132
-
133
- ```tsx
134
- import { Button } from '@codeswayam/ui'
135
-
136
- // Variants
137
- <Button variant="primary">Primary</Button>
138
- <Button variant="secondary">Secondary</Button>
139
- <Button variant="outline">Outline</Button>
140
- <Button variant="ghost">Ghost</Button>
141
-
142
- // Sizes
143
- <Button size="sm">Small</Button>
144
- <Button size="md">Medium</Button>
145
- <Button size="lg">Large</Button>
146
-
147
- // States
148
- <Button disabled>Disabled</Button>
149
- <Button isLoading>Loading...</Button>
150
- ```
151
-
152
- #### Input
153
- Text input field
154
-
155
- ```tsx
156
- import { Input } from '@codeswayam/ui'
157
-
158
- <Input
159
- type=\"email\"
160
- placeholder=\"Enter email\"
161
- onChange={(e) => setValue(e.target.value)}
162
- />
163
- ```
164
-
165
- #### Label
166
- Form label component
167
-
168
- ```tsx
169
- import { Label } from '@codeswayam/ui'
170
-
171
- <Label htmlFor=\"email\">Email Address</Label>
172
- <Input id=\"email\" />
173
- ```
174
-
175
- #### Select
176
- Dropdown select component
177
-
178
- ```tsx
179
- import { Select, SelectContent, SelectItem, SelectTrigger } from '@codeswayam/ui'
180
-
181
- <Select defaultValue=\"option1\">
182
- <SelectTrigger>
183
- <span>Choose option</span>
184
- </SelectTrigger>
185
- <SelectContent>
186
- <SelectItem value=\"option1\">Option 1</SelectItem>
187
- <SelectItem value=\"option2\">Option 2</SelectItem>
188
- <SelectItem value=\"option3\">Option 3</SelectItem>
189
- </SelectContent>
190
- </Select>
191
- ```
192
-
193
- #### Textarea
194
- Multi-line text input
195
-
196
- ```tsx
197
- import { Textarea } from '@codeswayam/ui'
198
-
199
- <Textarea
200
- placeholder=\"Enter message\"
201
- rows={5}
202
- onChange={(e) => setValue(e.target.value)}
203
- />
204
- ```
205
-
206
- #### Checkbox
207
- Checkbox input
208
-
209
- ```tsx
210
- import { Checkbox } from '@codeswayam/ui'
211
-
212
- <Checkbox
213
- id=\"terms\"
214
- onCheckedChange={setTermsAccepted}
215
- />
216
- <Label htmlFor=\"terms\">I agree to terms</Label>
217
- ```
218
-
219
- #### Radio Group
220
- Radio button group
221
-
222
- ```tsx
223
- import { Radio, RadioGroup } from '@codeswayam/ui'
224
-
225
- <RadioGroup defaultValue=\"option1\">
226
- <div className=\"flex items-center\">
227
- <Radio value=\"option1\" id=\"option1\" />
228
- <Label htmlFor=\"option1\">Option 1</Label>
229
- </div>
230
- <div className=\"flex items-center\">
231
- <Radio value=\"option2\" id=\"option2\" />
232
- <Label htmlFor=\"option2\">Option 2</Label>
233
- </div>
234
- </RadioGroup>
235
- ```
236
-
237
- #### Switch
238
- Toggle switch
239
-
240
- ```tsx
241
- import { Switch } from '@codeswayam/ui'
242
-
243
- <Switch
244
- checked={enabled}
245
- onCheckedChange={setEnabled}
246
- />
247
- ```
248
-
249
- ### Data Display Components
250
-
251
- #### Card
252
- Container component for content
253
-
254
- ```tsx
255
- import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@codeswayam/ui'
256
-
257
- <Card>
258
- <CardHeader>
259
- <CardTitle>Card Title</CardTitle>
260
- <CardDescription>Description</CardDescription>
261
- </CardHeader>
262
- <CardContent>
263
- Card content here
264
- </CardContent>
265
- </Card>
266
- ```
267
-
268
- #### Badge
269
- Status/tag badge
270
-
271
- ```tsx
272
- import { Badge } from '@codeswayam/ui'
273
-
274
- <Badge variant=\"default\">New</Badge>
275
- <Badge variant=\"success\">Active</Badge>
276
- <Badge variant=\"warning\">Pending</Badge>
277
- <Badge variant=\"destructive\">Error</Badge>
278
- ```
279
-
280
- #### Table
281
- Data table component
282
-
283
- ```tsx
284
- import {
285
- Table,
286
- TableBody,
287
- TableCell,
288
- TableHead,
289
- TableHeader,
290
- TableRow
291
- } from '@codeswayam/ui'
292
-
293
- <Table>
294
- <TableHeader>
295
- <TableRow>
296
- <TableHead>Name</TableHead>
297
- <TableHead>Email</TableHead>
298
- </TableRow>
299
- </TableHeader>
300
- <TableBody>
301
- <TableRow>
302
- <TableCell>John</TableCell>
303
- <TableCell>john@example.com</TableCell>
304
- </TableRow>
305
- </TableBody>
306
- </Table>
307
- ```
308
-
309
- ### Overlay Components
310
-
311
- #### Dialog
312
- Modal dialog
313
-
314
- ```tsx
315
- import {
316
- Dialog,
317
- DialogContent,
318
- DialogDescription,
319
- DialogHeader,
320
- DialogTitle,
321
- DialogTrigger
322
- } from '@codeswayam/ui'
323
-
324
- <Dialog>
325
- <DialogTrigger>Open Dialog</DialogTrigger>
326
- <DialogContent>
327
- <DialogHeader>
328
- <DialogTitle>Dialog Title</DialogTitle>
329
- <DialogDescription>Description</DialogDescription>
330
- </DialogHeader>
331
- Dialog content
332
- </DialogContent>
333
- </Dialog>
334
- ```
335
-
336
- #### Alert Dialog
337
- Confirmation dialog
338
-
339
- ```tsx
340
- import {
341
- AlertDialog,
342
- AlertDialogAction,
343
- AlertDialogCancel,
344
- AlertDialogContent,
345
- AlertDialogDescription,
346
- AlertDialogHeader,
347
- AlertDialogTitle,
348
- AlertDialogTrigger
349
- } from '@codeswayam/ui'
350
-
351
- <AlertDialog>
352
- <AlertDialogTrigger>Delete</AlertDialogTrigger>
353
- <AlertDialogContent>
354
- <AlertDialogHeader>
355
- <AlertDialogTitle>Are you sure?</AlertDialogTitle>
356
- <AlertDialogDescription>
357
- This action cannot be undone
358
- </AlertDialogDescription>
359
- </AlertDialogHeader>
360
- <AlertDialogCancel>Cancel</AlertDialogCancel>
361
- <AlertDialogAction>Delete</AlertDialogAction>
362
- </AlertDialogContent>
363
- </AlertDialog>
364
- ```
365
-
366
- #### Popover
367
- Floating content popover
368
-
369
- ```tsx
370
- import {
371
- Popover,
372
- PopoverContent,
373
- PopoverTrigger
374
- } from '@codeswayam/ui'
375
-
376
- <Popover>
377
- <PopoverTrigger>Open</PopoverTrigger>
378
- <PopoverContent>
379
- Popover content
380
- </PopoverContent>
381
- </Popover>
382
- ```
383
-
384
- #### Dropdown Menu
385
- Dropdown menu
386
-
387
- ```tsx
388
- import {
389
- DropdownMenu,
390
- DropdownMenuContent,
391
- DropdownMenuItem,
392
- DropdownMenuSeparator,
393
- DropdownMenuTrigger
394
- } from '@codeswayam/ui'
395
-
396
- <DropdownMenu>
397
- <DropdownMenuTrigger>Menu</DropdownMenuTrigger>
398
- <DropdownMenuContent>
399
- <DropdownMenuItem>Profile</DropdownMenuItem>
400
- <DropdownMenuSeparator />
401
- <DropdownMenuItem>Logout</DropdownMenuItem>
402
- </DropdownMenuContent>
403
- </DropdownMenu>
404
- ```
405
-
406
- ### Navigation Components
407
-
408
- #### Tabs
409
- Tabbed interface
410
-
411
- ```tsx
412
- import { Tabs, TabsContent, TabsList, TabsTrigger } from '@codeswayam/ui'
413
-
414
- <Tabs defaultValue=\"tab1\">
415
- <TabsList>
416
- <TabsTrigger value=\"tab1\">Tab 1</TabsTrigger>
417
- <TabsTrigger value=\"tab2\">Tab 2</TabsTrigger>
418
- </TabsList>
419
- <TabsContent value=\"tab1\">Content 1</TabsContent>
420
- <TabsContent value=\"tab2\">Content 2</TabsContent>
421
- </Tabs>
422
- ```
423
-
424
- ### Feedback Components
425
-
426
- #### Toast
427
- Toast notification
428
-
429
- ```tsx
430
- import { useToast } from '@codeswayam/ui/hooks'
431
-
432
- const { toast } = useToast()
433
-
434
- toast({
435
- title: 'Success',
436
- description: 'Operation completed',
437
- variant: 'default'
438
- })
439
- ```
440
-
441
- #### Progress
442
- Progress bar
443
-
444
- ```tsx
445
- import { Progress } from '@codeswayam/ui'
446
-
447
- <Progress value={65} />
448
- ```
449
-
450
- #### Skeleton
451
- Loading skeleton
452
-
453
- ```tsx
454
- import { Skeleton } from '@codeswayam/ui'
455
-
456
- <Skeleton className=\"h-12 w-12 rounded-full\" />
457
- ```
458
-
459
- ---
460
-
461
- ## 🎨 Styling & Customization
462
-
463
- ### Tailwind CSS Classes
464
-
465
- ```tsx
466
- <Button className=\"custom-class\">
467
- Custom Button
468
- </Button>
469
- ```
470
-
471
- ### Theme Customization
472
-
473
- ```tsx
474
- // Extend tailwind config
475
- const config: Config = {
476
- theme: {
477
- extend: {
478
- colors: {
479
- brand: '#your-color'
480
- }
481
- }
482
- }
483
- }
484
- ```
485
-
486
- ### Dark Mode
487
-
488
- Components automatically support dark mode:
489
-
490
- ```tsx
491
- // Enable dark mode in HTML
492
- <html className=\"dark\">
493
- <body>...</body>
494
- </html>
495
- ```
496
-
497
- ---
498
-
499
- ## 🔗 Component Props
500
-
501
- ### Common Props
502
-
503
- Most components accept:
504
- - `className` - Tailwind CSS classes
505
- - `disabled` - Disable component
506
- - `aria-*` - Accessibility attributes
507
-
508
- ---
509
-
510
- ## 🧪 Testing
511
-
512
- ```tsx
513
- import { render, screen } from '@testing-library/react'
514
- import { Button } from '@codeswayam/ui'
515
-
516
- test('button renders', () => {
517
- render(<Button>Click me</Button>)
518
- expect(screen.getByRole('button')).toBeInTheDocument()
519
- })
520
- ```
521
-
522
- ---
523
-
524
- ## 📖 Storybook
525
-
526
- View all components in Storybook:
527
-
528
- ```bash
529
- npm run storybook
530
- ```
531
-
532
- ---
533
-
534
- ## ♿ Accessibility
535
-
536
- All components are built with accessibility in mind:
537
- - Keyboard navigation
538
- - Screen reader support
539
- - ARIA labels
540
- - Focus management
541
- - Color contrast
542
-
543
- ---
544
-
545
- ## 📋 Component Checklist
546
-
547
- Essential components:
548
- - [x] Button
549
- - [x] Input
550
- - [x] Card
551
- - [x] Dialog
552
- - [x] Select
553
- - [x] Tabs
554
- - [x] Badge
555
- - [x] Table
556
- - [x] Toast
557
- - [x] Checkbox
558
- - [x] Radio
559
- - [x] Switch
560
- - [x] Textarea
561
- - [x] Progress
562
- - [x] Skeleton
563
- - [x] Dropdown Menu
564
- - [x] Popover
565
- - [x] Alert Dialog
566
-
567
- ---
568
-
569
- ## 🤝 Contributing
570
-
571
- ### Adding New Components
572
-
573
- 1. Create component in `src/components/`
574
- 2. Export from `src/index.ts`
575
- 3. Add Storybook story
576
- 4. Document usage
577
- 5. Test accessibility
578
-
579
- ---
580
-
581
- ## 📄 License
582
-
583
- ISC License
584
-
585
- ---
586
-
587
- ## 🔗 Related Packages
588
-
589
- - [@codeswayam/api-client](../api-client/README.md) - API client
590
- - [@codeswayam/auth](../auth-client/README.md) - Auth utilities
591
- - [@shared/database](../database/README.md) - Database utilities
592
-
593
- ---
594
-
595
- **Last Updated**: April 2026
596
-
597
- For more information, see the main [README.md](../../README.md)
1
+ # @codeswayam/ui
2
+
3
+ **Version:** 1.1.0
4
+
5
+ Shared React UI component library for all CodeSwayam SaaS applications. Built on Radix UI primitives with Tailwind CSS. Includes base components, SaaS-specific components, layout components, and design tokens.
6
+
7
+ ---
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ npm install @codeswayam/ui
13
+ ```
14
+
15
+ **Peer dependencies:** `react >= 18`, `react-dom >= 18`, `next >= 13`
16
+
17
+ ---
18
+
19
+ ## Setup
20
+
21
+ Include the package source in your app's Tailwind config so styles are picked up:
22
+
23
+ ```js
24
+ // tailwind.config.js
25
+ module.exports = {
26
+ content: [
27
+ "./src/**/*.{ts,tsx}",
28
+ "./node_modules/@codeswayam/ui/dist/**/*.{js,mjs}",
29
+ ],
30
+ };
31
+ ```
32
+
33
+ Import the global CSS tokens in your root layout:
34
+
35
+ ```tsx
36
+ // app/layout.tsx
37
+ import "@codeswayam/ui/dist/globals.css"; // design tokens + base styles
38
+ ```
39
+
40
+ ---
41
+
42
+ ## Utility
43
+
44
+ ### `cn(...inputs)`
45
+
46
+ Merges Tailwind classes with conflict resolution via `clsx` + `tailwind-merge`.
47
+
48
+ ```typescript
49
+ import { cn } from "@codeswayam/ui";
50
+
51
+ cn("px-4 py-2", isActive && "bg-primary", "px-6");
52
+ // → "py-2 bg-primary px-6"
53
+ ```
54
+
55
+ ---
56
+
57
+ ## Base Components
58
+
59
+ ### `<Button>`
60
+
61
+ Built with `class-variance-authority` and Radix `Slot` for polymorphic rendering.
62
+
63
+ ```tsx
64
+ import { Button } from "@codeswayam/ui";
65
+
66
+ <Button variant="default" size="default">Click me</Button>
67
+ <Button variant="outline" size="sm">Cancel</Button>
68
+ <Button variant="destructive">Delete</Button>
69
+ <Button variant="ghost" size="icon"><TrashIcon /></Button>
70
+
71
+ // Render as a link using asChild
72
+ <Button asChild variant="default">
73
+ <a href="/dashboard">Go to Dashboard</a>
74
+ </Button>
75
+ ```
76
+
77
+ **Variants:** `default`, `destructive`, `outline`, `secondary`, `ghost`, `link`
78
+ **Sizes:** `default`, `sm`, `lg`, `icon`
79
+
80
+ ---
81
+
82
+ ### `<Card>` family
83
+
84
+ ```tsx
85
+ import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from "@codeswayam/ui";
86
+
87
+ <Card>
88
+ <CardHeader>
89
+ <CardTitle>Plan Overview</CardTitle>
90
+ <CardDescription>Your current subscription details</CardDescription>
91
+ </CardHeader>
92
+ <CardContent>
93
+ <p>Pro Plan ₹499/month</p>
94
+ </CardContent>
95
+ <CardFooter>
96
+ <Button>Manage Plan</Button>
97
+ </CardFooter>
98
+ </Card>
99
+ ```
100
+
101
+ ---
102
+
103
+ ### `<Badge>`
104
+
105
+ ```tsx
106
+ import { Badge } from "@codeswayam/ui";
107
+
108
+ <Badge variant="default">Active</Badge>
109
+ <Badge variant="secondary">Beta</Badge>
110
+ <Badge variant="destructive">Expired</Badge>
111
+ <Badge variant="outline">Free</Badge>
112
+ <Badge variant="success">Paid</Badge>
113
+ <Badge variant="warning">Pending</Badge>
114
+ <Badge variant="info">Info</Badge>
115
+ <Badge variant="purple">AI</Badge>
116
+ ```
117
+
118
+ **Variants:** `default`, `secondary`, `destructive`, `outline`, `success`, `warning`, `info`, `purple`
119
+
120
+ ---
121
+
122
+ ### `<Input>`
123
+
124
+ ```tsx
125
+ import { Input } from "@codeswayam/ui";
126
+
127
+ <Input type="email" placeholder="Enter your email" />
128
+ <Input type="password" disabled />
129
+ ```
130
+
131
+ ---
132
+
133
+ ### `<Label>`
134
+
135
+ ```tsx
136
+ import { Label } from "@codeswayam/ui";
137
+
138
+ <Label htmlFor="email">Email Address</Label>
139
+ <Input id="email" type="email" />
140
+ ```
141
+
142
+ ---
143
+
144
+ ### `<Avatar>`, `<AvatarImage>`, `<AvatarFallback>`
145
+
146
+ Built on Radix Avatar with automatic fallback to initials.
147
+
148
+ ```tsx
149
+ import { Avatar, AvatarImage, AvatarFallback } from "@codeswayam/ui";
150
+
151
+ <Avatar className="h-10 w-10 rounded-lg">
152
+ <AvatarImage src={user.image} alt={user.name} />
153
+ <AvatarFallback className="bg-primary/10 text-primary font-bold">
154
+ {initials}
155
+ </AvatarFallback>
156
+ </Avatar>
157
+ ```
158
+
159
+ ---
160
+
161
+ ### `<DropdownMenu>` and sub-components
162
+
163
+ Full Radix DropdownMenu with all primitives exported.
164
+
165
+ ```tsx
166
+ import {
167
+ DropdownMenu,
168
+ DropdownMenuTrigger,
169
+ DropdownMenuContent,
170
+ DropdownMenuItem,
171
+ DropdownMenuLabel,
172
+ DropdownMenuSeparator,
173
+ DropdownMenuGroup,
174
+ DropdownMenuShortcut,
175
+ } from "@codeswayam/ui";
176
+
177
+ <DropdownMenu>
178
+ <DropdownMenuTrigger asChild>
179
+ <Button variant="ghost">Options</Button>
180
+ </DropdownMenuTrigger>
181
+ <DropdownMenuContent align="end">
182
+ <DropdownMenuLabel>My Account</DropdownMenuLabel>
183
+ <DropdownMenuSeparator />
184
+ <DropdownMenuItem onClick={handleProfile}>Profile</DropdownMenuItem>
185
+ <DropdownMenuItem onClick={handleLogout} className="text-destructive">
186
+ Sign Out
187
+ </DropdownMenuItem>
188
+ </DropdownMenuContent>
189
+ </DropdownMenu>
190
+ ```
191
+
192
+ ---
193
+
194
+ ## SaaS Components
195
+
196
+ ### `<UserMenu>`
197
+
198
+ High-end user profile dropdown for SaaS navigation bars. Shows avatar, name, email, and action items (Profile Settings, Security, Sign Out).
199
+
200
+ ```tsx
201
+ import { UserMenu } from "@codeswayam/ui";
202
+
203
+ <UserMenu
204
+ user={{ name: "Niteesh", email: "niteesh@example.com", image: "/avatar.jpg" }}
205
+ onLogout={handleLogout}
206
+ onProfileClick={() => router.push("/settings")}
207
+ onSecurityClick={() => router.push("/settings/security")}
208
+ />
209
+ ```
210
+
211
+ | Prop | Type | Description |
212
+ |------|------|-------------|
213
+ | `user` | `{ name?, email, image? } \| null` | User to display. Renders nothing if null |
214
+ | `onLogout` | `() => void` | Called when "Sign Out" is clicked |
215
+ | `onProfileClick` | `() => void` | Called when "Profile Settings" is clicked |
216
+ | `onSecurityClick` | `() => void` | Called when "Security" is clicked |
217
+ | `className` | `string` | Additional CSS classes |
218
+
219
+ ---
220
+
221
+ ### `<AppLogo>`
222
+
223
+ Standard CodeSwayam app logo for consistency across platforms.
224
+
225
+ ```tsx
226
+ import { AppLogo } from "@codeswayam/ui";
227
+
228
+ <AppLogo /> // Icon + "CodeSwayam" text
229
+ <AppLogo showText={false} /> // Icon only
230
+ <AppLogo className="scale-90" />
231
+ ```
232
+
233
+ | Prop | Type | Default | Description |
234
+ |------|------|---------|-------------|
235
+ | `showText` | `boolean` | `true` | Whether to show the "CodeSwayam" text |
236
+ | `className` | `string` | — | Additional CSS classes |
237
+
238
+ ---
239
+
240
+ ### `<StatusBadge>`
241
+
242
+ Smart subscription status badge with automatic color coding.
243
+
244
+ ```tsx
245
+ import { StatusBadge } from "@codeswayam/ui";
246
+
247
+ <StatusBadge status="active" /> // Green — "Active"
248
+ <StatusBadge status="pending_cancellation" /> // Amber — "Pending Cancel"
249
+ <StatusBadge status="canceled" /> // Red — "Canceled"
250
+ <StatusBadge status="past_due" /> // Red — "Past Due"
251
+ ```
252
+
253
+ | Prop | Type | Description |
254
+ |------|------|-------------|
255
+ | `status` | `"active" \| "past_due" \| "canceled" \| "pending_cancellation" \| string` | Subscription status |
256
+ | `className` | `string` | Additional CSS classes |
257
+
258
+ ---
259
+
260
+ ## Layout Components
261
+
262
+ ### `<GlobalNavbar>`
263
+
264
+ Responsive marketing navbar for public-facing pages. Auto-hides on app routes (`/app/*`, `/dashboard/*`). Includes scroll-aware blur effect, desktop nav links, and mobile slide-in menu.
265
+
266
+ ```tsx
267
+ import { GlobalNavbar } from "@codeswayam/ui";
268
+
269
+ // In your root layout — renders only on public pages
270
+ export default function RootLayout({ children }) {
271
+ return (
272
+ <>
273
+ <GlobalNavbar />
274
+ {children}
275
+ </>
276
+ );
277
+ }
278
+ ```
279
+
280
+ - Transparent on load, blurred dark background on scroll
281
+ - Auth links route to `NEXT_PUBLIC_AUTH_URL` or `localhost:3003` in dev
282
+ - Full-screen mobile menu with slide animation
283
+ - Hidden automatically on `/app` and `/dashboard` routes
284
+
285
+ ---
286
+
287
+ ### `<GlobalFooter>`
288
+
289
+ Standard marketing footer for public pages.
290
+
291
+ ```tsx
292
+ import { GlobalFooter } from "@codeswayam/ui";
293
+
294
+ <GlobalFooter />
295
+ ```
296
+
297
+ ---
298
+
299
+ ## Full Export List
300
+
301
+ ```typescript
302
+ // Base
303
+ Button, buttonVariants
304
+ Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter
305
+ Badge, badgeVariants
306
+ Input
307
+ Label
308
+ Avatar, AvatarImage, AvatarFallback
309
+ DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem,
310
+ DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel,
311
+ DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup,
312
+ DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent,
313
+ DropdownMenuSubTrigger, DropdownMenuRadioGroup
314
+
315
+ // SaaS
316
+ UserMenu, AppLogo, StatusBadge
317
+
318
+ // Layout
319
+ GlobalNavbar, GlobalFooter
320
+
321
+ // Utils
322
+ cn
323
+ ```