@possibly6400/ui-kit 1.0.12 → 1.0.14
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 +263 -25
- package/dist/index.js +1 -1
- package/dist/index.mjs +811 -532
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,30 +9,36 @@ 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
|
|
31
|
+
- **CookieConsent**: Configurable cookie consent card component with localStorage persistence
|
|
26
32
|
|
|
27
33
|
### Semantic Wrappers
|
|
28
34
|
|
|
29
|
-
- **Form**:
|
|
35
|
+
- **Form**: Form container with backdrop blur and composable form components (dynamically sized)
|
|
30
36
|
- **SubmitButton**: Button wrapper for form submissions with loading/success states
|
|
31
37
|
|
|
32
38
|
## Requirements
|
|
33
39
|
|
|
34
|
-
- React
|
|
35
|
-
- React DOM
|
|
40
|
+
- React 19.2.3 or higher
|
|
41
|
+
- React DOM 19.2.3 or higher
|
|
36
42
|
- Node.js 16.0.0 or higher (for development)
|
|
37
43
|
|
|
38
44
|
**Note:** Tailwind CSS is compiled at build time. Consumers do not need Tailwind installed or configured.
|
|
@@ -105,6 +111,12 @@ Start the preview environment to see all components:
|
|
|
105
111
|
npm run dev
|
|
106
112
|
```
|
|
107
113
|
|
|
114
|
+
The preview includes:
|
|
115
|
+
- **Component Showcase**: Full demonstration of all component variants and states
|
|
116
|
+
- **Landing Page**: Beautiful landing page preview showcasing all components in a cohesive design
|
|
117
|
+
|
|
118
|
+
Toggle between the showcase and landing page using the button in the bottom-right corner.
|
|
119
|
+
|
|
108
120
|
### Build
|
|
109
121
|
|
|
110
122
|
Build the library for distribution:
|
|
@@ -145,6 +157,7 @@ npm run lint
|
|
|
145
157
|
|
|
146
158
|
```tsx
|
|
147
159
|
<SubmitButton
|
|
160
|
+
variant="primary" | "secondary" | "danger"
|
|
148
161
|
size="sm" | "md" | "lg"
|
|
149
162
|
disabled={boolean}
|
|
150
163
|
onSubmit={async () => { /* submit logic */ }}
|
|
@@ -173,14 +186,23 @@ npm run lint
|
|
|
173
186
|
|
|
174
187
|
### SearchBar
|
|
175
188
|
|
|
189
|
+
Search bar component with dynamic sizing based on placeholder text. Automatically adjusts width to fit placeholder content while maintaining minimum size constraints.
|
|
190
|
+
|
|
176
191
|
```tsx
|
|
177
192
|
<SearchBar
|
|
178
|
-
|
|
193
|
+
size="sm" | "md" | "lg"
|
|
194
|
+
placeholder="Search for components..."
|
|
179
195
|
value={string}
|
|
180
196
|
onChange={function}
|
|
181
197
|
/>
|
|
182
198
|
```
|
|
183
199
|
|
|
200
|
+
**Features:**
|
|
201
|
+
- Dynamic width calculation based on placeholder text
|
|
202
|
+
- Minimum width constraints per size (sm: 200px, md: 260px, lg: 320px)
|
|
203
|
+
- Integrated search icon with hover effects
|
|
204
|
+
- Gradient background with neumorphic design
|
|
205
|
+
|
|
184
206
|
### Checkbox
|
|
185
207
|
|
|
186
208
|
Animated checkbox with smooth SVG checkmark animation. The checkmark animates when checked/unchecked using stroke-dasharray transitions.
|
|
@@ -334,9 +356,238 @@ import { Loader, Spinner } from '@possibly6400/ui-kit';
|
|
|
334
356
|
- Inline and full container display modes
|
|
335
357
|
- Optional loading text label
|
|
336
358
|
|
|
359
|
+
### Card
|
|
360
|
+
|
|
361
|
+
Flexible card component for displaying content with header, content, and footer sections.
|
|
362
|
+
|
|
363
|
+
```tsx
|
|
364
|
+
import { Card, CardHeader, CardContent, CardFooter } from '@possibly6400/ui-kit';
|
|
365
|
+
|
|
366
|
+
<Card>
|
|
367
|
+
<CardHeader>
|
|
368
|
+
<h3>Card Title</h3>
|
|
369
|
+
</CardHeader>
|
|
370
|
+
<CardContent>
|
|
371
|
+
<p>Card content goes here</p>
|
|
372
|
+
</CardContent>
|
|
373
|
+
<CardFooter>
|
|
374
|
+
<Button variant="ghost" size="sm">Action</Button>
|
|
375
|
+
</CardFooter>
|
|
376
|
+
</Card>
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
**Components:**
|
|
380
|
+
- **Card**: Main card container
|
|
381
|
+
- **CardHeader**: Header section with bottom border
|
|
382
|
+
- **CardContent**: Main content area
|
|
383
|
+
- **CardFooter**: Footer section with top border
|
|
384
|
+
|
|
385
|
+
**Features:**
|
|
386
|
+
- Theme-aware styling with CSS variables
|
|
387
|
+
- Flexible layout with composable sections
|
|
388
|
+
- Border separators between sections
|
|
389
|
+
- Full TypeScript support
|
|
390
|
+
|
|
391
|
+
### Tooltip
|
|
392
|
+
|
|
393
|
+
Accessible tooltip component that displays contextual information on hover or focus.
|
|
394
|
+
|
|
395
|
+
```tsx
|
|
396
|
+
import { Tooltip } from '@possibly6400/ui-kit';
|
|
397
|
+
|
|
398
|
+
const [tooltipOpen, setTooltipOpen] = useState(false);
|
|
399
|
+
|
|
400
|
+
<Tooltip
|
|
401
|
+
open={tooltipOpen}
|
|
402
|
+
onOpenChange={setTooltipOpen}
|
|
403
|
+
content="This is a tooltip"
|
|
404
|
+
position="top" | "bottom" | "left" | "right"
|
|
405
|
+
delay={number}
|
|
406
|
+
disabled={boolean}
|
|
407
|
+
>
|
|
408
|
+
<Button>Hover me</Button>
|
|
409
|
+
</Tooltip>
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
**Props:**
|
|
413
|
+
- `open: boolean` - Controlled open state
|
|
414
|
+
- `onOpenChange?: (open: boolean) => void` - Callback when open state changes
|
|
415
|
+
- `content: React.ReactNode` - Tooltip content
|
|
416
|
+
- `position?: "top" | "bottom" | "left" | "right"` - Tooltip position (default: `"top"`)
|
|
417
|
+
- `delay?: number` - Delay before showing tooltip in milliseconds (default: `0`)
|
|
418
|
+
- `disabled?: boolean` - Disable tooltip functionality
|
|
419
|
+
- `children: React.ReactElement` - Child element to attach tooltip to
|
|
420
|
+
|
|
421
|
+
**Features:**
|
|
422
|
+
- Accessible with ARIA attributes
|
|
423
|
+
- Keyboard support (focus/blur events)
|
|
424
|
+
- Position control (top, bottom, left, right)
|
|
425
|
+
- Configurable delay
|
|
426
|
+
- Arrow indicator pointing to trigger element
|
|
427
|
+
- Theme-aware styling
|
|
428
|
+
|
|
429
|
+
### SocialLinks
|
|
430
|
+
|
|
431
|
+
Social media links component with platform-specific icons and tooltips.
|
|
432
|
+
|
|
433
|
+
```tsx
|
|
434
|
+
import { SocialLinks } from '@possibly6400/ui-kit';
|
|
435
|
+
|
|
436
|
+
const links = [
|
|
437
|
+
{ platform: 'github', url: 'https://github.com', label: 'GitHub' },
|
|
438
|
+
{ platform: 'linkedin', url: 'https://linkedin.com' },
|
|
439
|
+
{ platform: 'x', url: 'https://x.com' },
|
|
440
|
+
];
|
|
441
|
+
|
|
442
|
+
<SocialLinks
|
|
443
|
+
links={links}
|
|
444
|
+
orientation="vertical" | "horizontal"
|
|
445
|
+
/>
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
**Props:**
|
|
449
|
+
- `links: SocialLink[]` - Array of social link objects
|
|
450
|
+
- `orientation?: "vertical" | "horizontal"` - Layout orientation (default: `"vertical"`)
|
|
451
|
+
- `className?: string` - Additional CSS classes
|
|
452
|
+
|
|
453
|
+
**Supported Platforms:**
|
|
454
|
+
- LinkedIn, GitHub, Instagram, YouTube, Facebook, Spotify, Telegram, Pinterest, X (Twitter)
|
|
455
|
+
|
|
456
|
+
**Features:**
|
|
457
|
+
- Platform-specific SVG icons
|
|
458
|
+
- Hover tooltips with platform names
|
|
459
|
+
- Vertical and horizontal layouts
|
|
460
|
+
- Smooth animations and transitions
|
|
461
|
+
- Accessible with proper ARIA labels
|
|
462
|
+
|
|
463
|
+
### ContextMenu
|
|
464
|
+
|
|
465
|
+
Context menu component with grouped items, icons, and variant support.
|
|
466
|
+
|
|
467
|
+
```tsx
|
|
468
|
+
import { ContextMenu } from '@possibly6400/ui-kit';
|
|
469
|
+
|
|
470
|
+
<ContextMenu
|
|
471
|
+
groups={[
|
|
472
|
+
{
|
|
473
|
+
id: 'actions',
|
|
474
|
+
items: [
|
|
475
|
+
{
|
|
476
|
+
id: 'edit',
|
|
477
|
+
label: 'Edit',
|
|
478
|
+
icon: <EditIcon />,
|
|
479
|
+
onClick: () => console.log('Edit'),
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
id: 'copy',
|
|
483
|
+
label: 'Copy',
|
|
484
|
+
icon: <CopyIcon />,
|
|
485
|
+
onClick: () => console.log('Copy'),
|
|
486
|
+
},
|
|
487
|
+
],
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
id: 'danger',
|
|
491
|
+
items: [
|
|
492
|
+
{
|
|
493
|
+
id: 'delete',
|
|
494
|
+
label: 'Delete',
|
|
495
|
+
variant: 'danger',
|
|
496
|
+
icon: <DeleteIcon />,
|
|
497
|
+
onClick: () => console.log('Delete'),
|
|
498
|
+
},
|
|
499
|
+
],
|
|
500
|
+
},
|
|
501
|
+
]}
|
|
502
|
+
showSeparators={true}
|
|
503
|
+
/>
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
**Props:**
|
|
507
|
+
- `groups: ContextMenuGroupData[]` - Array of menu groups
|
|
508
|
+
- `showSeparators?: boolean` - Show separators between groups (default: `true`)
|
|
509
|
+
- `className?: string` - Additional CSS classes
|
|
510
|
+
|
|
511
|
+
**Item Variants:**
|
|
512
|
+
- `default` - Standard menu item
|
|
513
|
+
- `danger` - Destructive action (red styling)
|
|
514
|
+
- `accent` - Accented item (highlighted)
|
|
515
|
+
|
|
516
|
+
**Features:**
|
|
517
|
+
- Grouped menu items with separators
|
|
518
|
+
- Icon support for each item
|
|
519
|
+
- Variant styling (default, danger, accent)
|
|
520
|
+
- Disabled state support
|
|
521
|
+
- Theme-aware styling
|
|
522
|
+
|
|
523
|
+
### CookieConsent
|
|
524
|
+
|
|
525
|
+
Configurable cookie consent card component with localStorage persistence. A pure UI component that can be used inline or within a modal wrapper.
|
|
526
|
+
|
|
527
|
+
```tsx
|
|
528
|
+
import { CookieConsent } from '@possibly6400/ui-kit';
|
|
529
|
+
|
|
530
|
+
<CookieConsent
|
|
531
|
+
title="Your privacy is important to us"
|
|
532
|
+
description="We process your personal information to measure and improve our sites and services, to assist our campaigns and to provide personalised content."
|
|
533
|
+
privacyLink="/privacy"
|
|
534
|
+
privacyLinkText="Privacy Policy"
|
|
535
|
+
acceptLabel="Accept"
|
|
536
|
+
optionsLabel="More Options"
|
|
537
|
+
onAccept={() => console.log('Accepted')}
|
|
538
|
+
onOptions={() => console.log('More options')}
|
|
539
|
+
storageKey="cookie-consent"
|
|
540
|
+
storageValue="accepted"
|
|
541
|
+
icon={cookieIcon}
|
|
542
|
+
privacyLinkTarget="_blank"
|
|
543
|
+
privacyLinkRel="noopener noreferrer"
|
|
544
|
+
className="transition-transform duration-300"
|
|
545
|
+
iconClassName=""
|
|
546
|
+
contentClassName=""
|
|
547
|
+
acceptButtonClassName=""
|
|
548
|
+
optionsButtonClassName=""
|
|
549
|
+
/>
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
**Props:**
|
|
553
|
+
- `title: string` - Consent card title
|
|
554
|
+
- `description: string` - Consent description text
|
|
555
|
+
- `privacyLink: string` - Privacy policy URL
|
|
556
|
+
- `privacyLinkText: string` - Privacy policy link text
|
|
557
|
+
- `acceptLabel: string` - Accept button label
|
|
558
|
+
- `optionsLabel: string` - More options button label
|
|
559
|
+
- `onAccept: () => void` - Callback when accept is clicked
|
|
560
|
+
- `onOptions: () => void` - Callback when more options is clicked
|
|
561
|
+
- `storageKey: string` - localStorage key for persisting consent
|
|
562
|
+
- `storageValue: string` - Value to store when consent is accepted
|
|
563
|
+
- `icon?: React.ReactNode` - Optional icon/illustration (typically a cookie icon)
|
|
564
|
+
- `privacyLinkTarget?: string` - Link target attribute (e.g., "_blank")
|
|
565
|
+
- `privacyLinkRel?: string` - Link rel attribute (e.g., "noopener noreferrer")
|
|
566
|
+
- `className?: string` - Additional CSS classes for the card container
|
|
567
|
+
- `iconClassName?: string` - Additional CSS classes for the icon wrapper
|
|
568
|
+
- `contentClassName?: string` - Additional CSS classes for the content wrapper
|
|
569
|
+
- `acceptButtonClassName?: string` - Additional CSS classes for the accept button
|
|
570
|
+
- `optionsButtonClassName?: string` - Additional CSS classes for the options button
|
|
571
|
+
|
|
572
|
+
**Features:**
|
|
573
|
+
- Pure UI component - no modal/backdrop assumptions
|
|
574
|
+
- localStorage persistence - automatically checks and stores consent state
|
|
575
|
+
- Fully props-driven - all text, links, and behavior controlled via props
|
|
576
|
+
- Optional icon support - layout adapts when icon is omitted
|
|
577
|
+
- Customizable styling - all elements can be styled via className props
|
|
578
|
+
- Dark mode support - theme-aware colors and styling
|
|
579
|
+
- Accessible - proper semantic HTML and keyboard navigation
|
|
580
|
+
- Inline or modal usage - can be embedded anywhere or wrapped in a modal
|
|
581
|
+
|
|
582
|
+
**Usage Notes:**
|
|
583
|
+
- Component automatically hides once consent is stored in localStorage
|
|
584
|
+
- Reset consent by removing the storageKey from localStorage
|
|
585
|
+
- For modal usage, wrap the component in a backdrop/overlay div
|
|
586
|
+
- All styling is customizable via className props while maintaining sensible defaults
|
|
587
|
+
|
|
337
588
|
### Form
|
|
338
589
|
|
|
339
|
-
|
|
590
|
+
Form container component with backdrop blur and composable form elements. Dynamically sizes based on content.
|
|
340
591
|
|
|
341
592
|
```tsx
|
|
342
593
|
import { Form, FormField, FormButton, FormFooter, FormFooterLink } from '@possibly6400/ui-kit';
|
|
@@ -372,7 +623,7 @@ import { Form, FormField, FormButton, FormFooter, FormFooterLink } from '@possib
|
|
|
372
623
|
```
|
|
373
624
|
|
|
374
625
|
**Components:**
|
|
375
|
-
- **Form**: Main form container with
|
|
626
|
+
- **Form**: Main form container with backdrop blur
|
|
376
627
|
- **FormField**: Input field wrapper with optional label and error state
|
|
377
628
|
- **FormButton**: Button component with primary and Google sign-in variants
|
|
378
629
|
- **FormFooter**: Footer container for form links and text
|
|
@@ -386,13 +637,13 @@ import { Form, FormField, FormButton, FormFooter, FormFooterLink } from '@possib
|
|
|
386
637
|
- `FormFooterLink`: Standard anchor HTML attributes
|
|
387
638
|
|
|
388
639
|
**Features:**
|
|
389
|
-
- Beautiful animated rotating border effect using conic gradient
|
|
390
640
|
- Backdrop blur effect for modern glassmorphism look
|
|
391
641
|
- Optional user/logo icon with animated design
|
|
392
642
|
- Theme-aware colors using CSS variables
|
|
393
643
|
- Composable structure - works with Checkbox, RadioButton, and other components
|
|
394
644
|
- Animated footer links with hover effects
|
|
395
645
|
- Customizable width and aspect ratio
|
|
646
|
+
- Dynamic sizing based on content
|
|
396
647
|
- Full TypeScript support
|
|
397
648
|
|
|
398
649
|
## Architecture Principles
|
|
@@ -402,20 +653,7 @@ import { Form, FormField, FormButton, FormFooter, FormFooterLink } from '@possib
|
|
|
402
653
|
3. **No hardcoded colors**: All colors derive from CSS variables
|
|
403
654
|
4. **Theme agnostic**: No OS theme detection, explicit theme control
|
|
404
655
|
5. **Composable**: Components can be combined and extended
|
|
405
|
-
|
|
406
|
-
## Quality Assurance
|
|
407
|
-
|
|
408
|
-
A comprehensive professional audit has been conducted on all components. See [`AUDIT_REPORT.md`](./AUDIT_REPORT.md) for detailed findings, including:
|
|
409
|
-
|
|
410
|
-
- Architecture and design system integrity analysis
|
|
411
|
-
- Component API quality assessment
|
|
412
|
-
- Accessibility (A11y) compliance review
|
|
413
|
-
- Performance and maintainability evaluation
|
|
414
|
-
- Visual consistency and UX rules validation
|
|
415
|
-
- Styling strategy assessment
|
|
416
|
-
- Improvement recommendations prioritized by severity
|
|
417
|
-
|
|
418
|
-
The audit identifies critical issues, medium-priority improvements, and long-term scalability considerations to help harden the UI Kit into a production-ready design system.
|
|
656
|
+
6. **Dynamic sizing**: Components adapt to content while maintaining minimum constraints
|
|
419
657
|
|
|
420
658
|
## License
|
|
421
659
|
|