@possibly6400/ui-kit 1.0.12 → 1.0.13
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 +198 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,30 +9,35 @@ A reusable, themeable component library built with React, TypeScript, and Tailwi
|
|
|
9
9
|
- 🎯 **Accessible**: Built with accessibility best practices
|
|
10
10
|
- 📦 **Packaged**: Ready for npm distribution
|
|
11
11
|
- 🧩 **Composable**: Primitive components with semantic wrappers
|
|
12
|
-
- ⚡ **Lightweight**:
|
|
12
|
+
- ⚡ **Lightweight**: Minimal dependencies (only clsx and tailwind-merge)
|
|
13
|
+
- 🎭 **Dynamic Sizing**: Components adapt to content with minimum size constraints
|
|
13
14
|
|
|
14
15
|
## Components
|
|
15
16
|
|
|
16
17
|
### Primitive Components
|
|
17
18
|
|
|
18
19
|
- **Button**: Generic visual button with variants, sizes, and states
|
|
19
|
-
- **Input**: Form input field with error states
|
|
20
|
+
- **Input**: Form input field with error states and dynamic sizing
|
|
20
21
|
- **Checkbox**: Animated SVG checkbox with smooth checkmark animation and label support
|
|
21
22
|
- **RadioButton**: Windows-style radio button with RadioGroup support for form selections
|
|
22
|
-
- **Toggle**: Switch/toggle component
|
|
23
|
+
- **Toggle**: Switch/toggle component with celestial sparkle effects
|
|
23
24
|
- **Loader**: Animated loading spinner with rotating faces and glowing effects
|
|
24
25
|
- **ThemeSwitch**: Animated dark/light mode toggle with sun/moon and stars/clouds visual effects
|
|
25
|
-
- **SearchBar**: Gradient search bar input with integrated search icon
|
|
26
|
+
- **SearchBar**: Gradient search bar input with integrated search icon and dynamic placeholder sizing
|
|
27
|
+
- **Card**: Flexible card container with header, content, and footer sections
|
|
28
|
+
- **Tooltip**: Accessible tooltip component with position control and delay support
|
|
29
|
+
- **SocialLinks**: Social media links component with platform icons and tooltips
|
|
30
|
+
- **ContextMenu**: Context menu component with grouped items, icons, and variants
|
|
26
31
|
|
|
27
32
|
### Semantic Wrappers
|
|
28
33
|
|
|
29
|
-
- **Form**:
|
|
34
|
+
- **Form**: Form container with backdrop blur and composable form components (dynamically sized)
|
|
30
35
|
- **SubmitButton**: Button wrapper for form submissions with loading/success states
|
|
31
36
|
|
|
32
37
|
## Requirements
|
|
33
38
|
|
|
34
|
-
- React
|
|
35
|
-
- React DOM
|
|
39
|
+
- React 19.2.3 or higher
|
|
40
|
+
- React DOM 19.2.3 or higher
|
|
36
41
|
- Node.js 16.0.0 or higher (for development)
|
|
37
42
|
|
|
38
43
|
**Note:** Tailwind CSS is compiled at build time. Consumers do not need Tailwind installed or configured.
|
|
@@ -105,6 +110,12 @@ Start the preview environment to see all components:
|
|
|
105
110
|
npm run dev
|
|
106
111
|
```
|
|
107
112
|
|
|
113
|
+
The preview includes:
|
|
114
|
+
- **Component Showcase**: Full demonstration of all component variants and states
|
|
115
|
+
- **Landing Page**: Beautiful landing page preview showcasing all components in a cohesive design
|
|
116
|
+
|
|
117
|
+
Toggle between the showcase and landing page using the button in the bottom-right corner.
|
|
118
|
+
|
|
108
119
|
### Build
|
|
109
120
|
|
|
110
121
|
Build the library for distribution:
|
|
@@ -145,6 +156,7 @@ npm run lint
|
|
|
145
156
|
|
|
146
157
|
```tsx
|
|
147
158
|
<SubmitButton
|
|
159
|
+
variant="primary" | "secondary" | "danger"
|
|
148
160
|
size="sm" | "md" | "lg"
|
|
149
161
|
disabled={boolean}
|
|
150
162
|
onSubmit={async () => { /* submit logic */ }}
|
|
@@ -173,14 +185,23 @@ npm run lint
|
|
|
173
185
|
|
|
174
186
|
### SearchBar
|
|
175
187
|
|
|
188
|
+
Search bar component with dynamic sizing based on placeholder text. Automatically adjusts width to fit placeholder content while maintaining minimum size constraints.
|
|
189
|
+
|
|
176
190
|
```tsx
|
|
177
191
|
<SearchBar
|
|
178
|
-
|
|
192
|
+
size="sm" | "md" | "lg"
|
|
193
|
+
placeholder="Search for components..."
|
|
179
194
|
value={string}
|
|
180
195
|
onChange={function}
|
|
181
196
|
/>
|
|
182
197
|
```
|
|
183
198
|
|
|
199
|
+
**Features:**
|
|
200
|
+
- Dynamic width calculation based on placeholder text
|
|
201
|
+
- Minimum width constraints per size (sm: 200px, md: 260px, lg: 320px)
|
|
202
|
+
- Integrated search icon with hover effects
|
|
203
|
+
- Gradient background with neumorphic design
|
|
204
|
+
|
|
184
205
|
### Checkbox
|
|
185
206
|
|
|
186
207
|
Animated checkbox with smooth SVG checkmark animation. The checkmark animates when checked/unchecked using stroke-dasharray transitions.
|
|
@@ -334,9 +355,173 @@ import { Loader, Spinner } from '@possibly6400/ui-kit';
|
|
|
334
355
|
- Inline and full container display modes
|
|
335
356
|
- Optional loading text label
|
|
336
357
|
|
|
358
|
+
### Card
|
|
359
|
+
|
|
360
|
+
Flexible card component for displaying content with header, content, and footer sections.
|
|
361
|
+
|
|
362
|
+
```tsx
|
|
363
|
+
import { Card, CardHeader, CardContent, CardFooter } from '@possibly6400/ui-kit';
|
|
364
|
+
|
|
365
|
+
<Card>
|
|
366
|
+
<CardHeader>
|
|
367
|
+
<h3>Card Title</h3>
|
|
368
|
+
</CardHeader>
|
|
369
|
+
<CardContent>
|
|
370
|
+
<p>Card content goes here</p>
|
|
371
|
+
</CardContent>
|
|
372
|
+
<CardFooter>
|
|
373
|
+
<Button variant="ghost" size="sm">Action</Button>
|
|
374
|
+
</CardFooter>
|
|
375
|
+
</Card>
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
**Components:**
|
|
379
|
+
- **Card**: Main card container
|
|
380
|
+
- **CardHeader**: Header section with bottom border
|
|
381
|
+
- **CardContent**: Main content area
|
|
382
|
+
- **CardFooter**: Footer section with top border
|
|
383
|
+
|
|
384
|
+
**Features:**
|
|
385
|
+
- Theme-aware styling with CSS variables
|
|
386
|
+
- Flexible layout with composable sections
|
|
387
|
+
- Border separators between sections
|
|
388
|
+
- Full TypeScript support
|
|
389
|
+
|
|
390
|
+
### Tooltip
|
|
391
|
+
|
|
392
|
+
Accessible tooltip component that displays contextual information on hover or focus.
|
|
393
|
+
|
|
394
|
+
```tsx
|
|
395
|
+
import { Tooltip } from '@possibly6400/ui-kit';
|
|
396
|
+
|
|
397
|
+
const [tooltipOpen, setTooltipOpen] = useState(false);
|
|
398
|
+
|
|
399
|
+
<Tooltip
|
|
400
|
+
open={tooltipOpen}
|
|
401
|
+
onOpenChange={setTooltipOpen}
|
|
402
|
+
content="This is a tooltip"
|
|
403
|
+
position="top" | "bottom" | "left" | "right"
|
|
404
|
+
delay={number}
|
|
405
|
+
disabled={boolean}
|
|
406
|
+
>
|
|
407
|
+
<Button>Hover me</Button>
|
|
408
|
+
</Tooltip>
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
**Props:**
|
|
412
|
+
- `open: boolean` - Controlled open state
|
|
413
|
+
- `onOpenChange?: (open: boolean) => void` - Callback when open state changes
|
|
414
|
+
- `content: React.ReactNode` - Tooltip content
|
|
415
|
+
- `position?: "top" | "bottom" | "left" | "right"` - Tooltip position (default: `"top"`)
|
|
416
|
+
- `delay?: number` - Delay before showing tooltip in milliseconds (default: `0`)
|
|
417
|
+
- `disabled?: boolean` - Disable tooltip functionality
|
|
418
|
+
- `children: React.ReactElement` - Child element to attach tooltip to
|
|
419
|
+
|
|
420
|
+
**Features:**
|
|
421
|
+
- Accessible with ARIA attributes
|
|
422
|
+
- Keyboard support (focus/blur events)
|
|
423
|
+
- Position control (top, bottom, left, right)
|
|
424
|
+
- Configurable delay
|
|
425
|
+
- Arrow indicator pointing to trigger element
|
|
426
|
+
- Theme-aware styling
|
|
427
|
+
|
|
428
|
+
### SocialLinks
|
|
429
|
+
|
|
430
|
+
Social media links component with platform-specific icons and tooltips.
|
|
431
|
+
|
|
432
|
+
```tsx
|
|
433
|
+
import { SocialLinks } from '@possibly6400/ui-kit';
|
|
434
|
+
|
|
435
|
+
const links = [
|
|
436
|
+
{ platform: 'github', url: 'https://github.com', label: 'GitHub' },
|
|
437
|
+
{ platform: 'linkedin', url: 'https://linkedin.com' },
|
|
438
|
+
{ platform: 'x', url: 'https://x.com' },
|
|
439
|
+
];
|
|
440
|
+
|
|
441
|
+
<SocialLinks
|
|
442
|
+
links={links}
|
|
443
|
+
orientation="vertical" | "horizontal"
|
|
444
|
+
/>
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
**Props:**
|
|
448
|
+
- `links: SocialLink[]` - Array of social link objects
|
|
449
|
+
- `orientation?: "vertical" | "horizontal"` - Layout orientation (default: `"vertical"`)
|
|
450
|
+
- `className?: string` - Additional CSS classes
|
|
451
|
+
|
|
452
|
+
**Supported Platforms:**
|
|
453
|
+
- LinkedIn, GitHub, Instagram, YouTube, Facebook, Spotify, Telegram, Pinterest, X (Twitter)
|
|
454
|
+
|
|
455
|
+
**Features:**
|
|
456
|
+
- Platform-specific SVG icons
|
|
457
|
+
- Hover tooltips with platform names
|
|
458
|
+
- Vertical and horizontal layouts
|
|
459
|
+
- Smooth animations and transitions
|
|
460
|
+
- Accessible with proper ARIA labels
|
|
461
|
+
|
|
462
|
+
### ContextMenu
|
|
463
|
+
|
|
464
|
+
Context menu component with grouped items, icons, and variant support.
|
|
465
|
+
|
|
466
|
+
```tsx
|
|
467
|
+
import { ContextMenu } from '@possibly6400/ui-kit';
|
|
468
|
+
|
|
469
|
+
<ContextMenu
|
|
470
|
+
groups={[
|
|
471
|
+
{
|
|
472
|
+
id: 'actions',
|
|
473
|
+
items: [
|
|
474
|
+
{
|
|
475
|
+
id: 'edit',
|
|
476
|
+
label: 'Edit',
|
|
477
|
+
icon: <EditIcon />,
|
|
478
|
+
onClick: () => console.log('Edit'),
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
id: 'copy',
|
|
482
|
+
label: 'Copy',
|
|
483
|
+
icon: <CopyIcon />,
|
|
484
|
+
onClick: () => console.log('Copy'),
|
|
485
|
+
},
|
|
486
|
+
],
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
id: 'danger',
|
|
490
|
+
items: [
|
|
491
|
+
{
|
|
492
|
+
id: 'delete',
|
|
493
|
+
label: 'Delete',
|
|
494
|
+
variant: 'danger',
|
|
495
|
+
icon: <DeleteIcon />,
|
|
496
|
+
onClick: () => console.log('Delete'),
|
|
497
|
+
},
|
|
498
|
+
],
|
|
499
|
+
},
|
|
500
|
+
]}
|
|
501
|
+
showSeparators={true}
|
|
502
|
+
/>
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
**Props:**
|
|
506
|
+
- `groups: ContextMenuGroupData[]` - Array of menu groups
|
|
507
|
+
- `showSeparators?: boolean` - Show separators between groups (default: `true`)
|
|
508
|
+
- `className?: string` - Additional CSS classes
|
|
509
|
+
|
|
510
|
+
**Item Variants:**
|
|
511
|
+
- `default` - Standard menu item
|
|
512
|
+
- `danger` - Destructive action (red styling)
|
|
513
|
+
- `accent` - Accented item (highlighted)
|
|
514
|
+
|
|
515
|
+
**Features:**
|
|
516
|
+
- Grouped menu items with separators
|
|
517
|
+
- Icon support for each item
|
|
518
|
+
- Variant styling (default, danger, accent)
|
|
519
|
+
- Disabled state support
|
|
520
|
+
- Theme-aware styling
|
|
521
|
+
|
|
337
522
|
### Form
|
|
338
523
|
|
|
339
|
-
|
|
524
|
+
Form container component with backdrop blur and composable form elements. Dynamically sizes based on content.
|
|
340
525
|
|
|
341
526
|
```tsx
|
|
342
527
|
import { Form, FormField, FormButton, FormFooter, FormFooterLink } from '@possibly6400/ui-kit';
|
|
@@ -372,7 +557,7 @@ import { Form, FormField, FormButton, FormFooter, FormFooterLink } from '@possib
|
|
|
372
557
|
```
|
|
373
558
|
|
|
374
559
|
**Components:**
|
|
375
|
-
- **Form**: Main form container with
|
|
560
|
+
- **Form**: Main form container with backdrop blur
|
|
376
561
|
- **FormField**: Input field wrapper with optional label and error state
|
|
377
562
|
- **FormButton**: Button component with primary and Google sign-in variants
|
|
378
563
|
- **FormFooter**: Footer container for form links and text
|
|
@@ -386,13 +571,13 @@ import { Form, FormField, FormButton, FormFooter, FormFooterLink } from '@possib
|
|
|
386
571
|
- `FormFooterLink`: Standard anchor HTML attributes
|
|
387
572
|
|
|
388
573
|
**Features:**
|
|
389
|
-
- Beautiful animated rotating border effect using conic gradient
|
|
390
574
|
- Backdrop blur effect for modern glassmorphism look
|
|
391
575
|
- Optional user/logo icon with animated design
|
|
392
576
|
- Theme-aware colors using CSS variables
|
|
393
577
|
- Composable structure - works with Checkbox, RadioButton, and other components
|
|
394
578
|
- Animated footer links with hover effects
|
|
395
579
|
- Customizable width and aspect ratio
|
|
580
|
+
- Dynamic sizing based on content
|
|
396
581
|
- Full TypeScript support
|
|
397
582
|
|
|
398
583
|
## Architecture Principles
|
|
@@ -402,10 +587,11 @@ import { Form, FormField, FormButton, FormFooter, FormFooterLink } from '@possib
|
|
|
402
587
|
3. **No hardcoded colors**: All colors derive from CSS variables
|
|
403
588
|
4. **Theme agnostic**: No OS theme detection, explicit theme control
|
|
404
589
|
5. **Composable**: Components can be combined and extended
|
|
590
|
+
6. **Dynamic sizing**: Components adapt to content while maintaining minimum constraints
|
|
405
591
|
|
|
406
592
|
## Quality Assurance
|
|
407
593
|
|
|
408
|
-
A comprehensive professional audit has been conducted on all components. See [`AUDIT_REPORT.md`](./AUDIT_REPORT.md) for detailed findings, including:
|
|
594
|
+
A comprehensive professional audit has been conducted on all components. See [`docs/AUDIT_REPORT.md`](./docs/AUDIT_REPORT.md) for detailed findings, including:
|
|
409
595
|
|
|
410
596
|
- Architecture and design system integrity analysis
|
|
411
597
|
- Component API quality assessment
|