@peacock-ui/core 0.1.0 → 2.0.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 +34 -6
- package/dist/MotionPrimitive.d.ts +6 -0
- package/dist/MotionProvider.d.ts +16 -0
- package/dist/PeacockProvider.d.ts +0 -1
- package/dist/components/FluidCard.d.ts +8 -0
- package/dist/components/GlassMenu.d.ts +14 -0
- package/dist/components/PeacockBadge.d.ts +7 -0
- package/dist/components/PeacockButton.d.ts +3 -5
- package/dist/components/PeacockDialog.d.ts +18 -0
- package/dist/components/PeacockInput.d.ts +7 -0
- package/dist/components/PeacockSwitch.d.ts +7 -0
- package/dist/components/PeacockTooltip.d.ts +7 -0
- package/dist/hooks/useSpotlight.d.ts +10 -0
- package/dist/hooks/utils.d.ts +0 -1
- package/dist/index.d.ts +9 -1
- package/dist/motion/variants.d.ts +6 -7
- package/dist/peacock-ui.js +2517 -1045
- package/dist/peacock-ui.umd.cjs +86 -15
- package/dist/style.css +1 -1
- package/dist/themes/plugin.d.ts +4 -0
- package/package.json +8 -9
package/README.md
CHANGED
|
@@ -43,13 +43,41 @@ function App() {
|
|
|
43
43
|
}
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
## 🧱
|
|
46
|
+
## 🧱 Component Reference
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
### `PeacockButton`
|
|
49
|
+
Interactive light-source button with physics-based haptics.
|
|
50
|
+
```tsx
|
|
51
|
+
<PeacockButton variant="primary" glowSize={200}>
|
|
52
|
+
Spread Plumage
|
|
53
|
+
</PeacockButton>
|
|
54
|
+
```
|
|
55
|
+
**Props:** `variant` ('primary'|'outline'|'glass'), `glowSize` (number)
|
|
56
|
+
|
|
57
|
+
### `PeacockInput`
|
|
58
|
+
Focus-reactive input with dynamic glow borders.
|
|
59
|
+
```tsx
|
|
60
|
+
<PeacockInput label="Email" placeholder="you@example.com" error="Required" />
|
|
61
|
+
```
|
|
62
|
+
**Props:** `label` (string), `error` (string), `icon` (ReactNode)
|
|
63
|
+
|
|
64
|
+
### `FluidCard`
|
|
65
|
+
Expandable surface with shared-element layout transitions.
|
|
66
|
+
```tsx
|
|
67
|
+
<FluidCard title="Physics" description="Hover for details" expandedContent={<p>Details...</p>} />
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### `PeacockSwitch`
|
|
71
|
+
Spring-loaded toggle interaction.
|
|
72
|
+
```tsx
|
|
73
|
+
<PeacockSwitch checked={true} onChange={(val) => {}} label="Motion Enabled" />
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### `GlassMenu`
|
|
77
|
+
Command-palette style recursive menu.
|
|
78
|
+
```tsx
|
|
79
|
+
<GlassMenu isOpen={isOpen} onClose={close} items={[{ id: '1', label: 'Home' }]} />
|
|
80
|
+
```
|
|
53
81
|
|
|
54
82
|
## 🛠️ Development
|
|
55
83
|
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { HTMLMotionProps } from 'framer-motion';
|
|
3
|
+
export interface MotionPrimitiveProps extends HTMLMotionProps<'div'> {
|
|
4
|
+
as?: any;
|
|
5
|
+
}
|
|
6
|
+
export declare const MotionPrimitive: React.ForwardRefExoticComponent<Omit<MotionPrimitiveProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface MotionProviderProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
physics?: {
|
|
5
|
+
stiffness?: number;
|
|
6
|
+
damping?: number;
|
|
7
|
+
mass?: number;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export declare const MotionProvider: ({ children, physics }: MotionProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const useMotionPhysics: () => {
|
|
12
|
+
stiffness: number;
|
|
13
|
+
damping: number;
|
|
14
|
+
mass: number;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface FluidCardProps {
|
|
3
|
+
title: string;
|
|
4
|
+
description: string;
|
|
5
|
+
expandedContent?: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const FluidCard: ({ title, description, expandedContent, className }: FluidCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface GlassMenuItem {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
children?: GlassMenuItem[];
|
|
8
|
+
}
|
|
9
|
+
export interface GlassMenuProps {
|
|
10
|
+
items: GlassMenuItem[];
|
|
11
|
+
isOpen: boolean;
|
|
12
|
+
onClose: () => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const GlassMenu: ({ items, isOpen, onClose }: GlassMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface PeacockBadgeProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
variant?: 'primary' | 'success' | 'danger' | 'glass';
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const PeacockBadge: ({ children, variant, className }: PeacockBadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { HTMLMotionProps } from 'framer-motion';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
glow?: boolean;
|
|
3
|
+
export interface PeacockButtonProps extends HTMLMotionProps<'button'> {
|
|
4
|
+
variant?: 'primary' | 'outline' | 'glass';
|
|
5
|
+
glowSize?: number;
|
|
7
6
|
}
|
|
8
7
|
export declare const PeacockButton: React.ForwardRefExoticComponent<Omit<PeacockButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
-
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
3
|
+
declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
|
4
|
+
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const DialogPortal: ({ children, ...props }: DialogPrimitive.DialogPortalProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const DialogHeader: {
|
|
9
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
declare const DialogFooter: {
|
|
13
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
17
|
+
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
18
|
+
export { Dialog, DialogPortal, DialogOverlay, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface PeacockInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
+
label?: string;
|
|
4
|
+
error?: string;
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const PeacockInput: React.ForwardRefExoticComponent<PeacockInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface PeacockSwitchProps {
|
|
2
|
+
checked: boolean;
|
|
3
|
+
onChange: (checked: boolean) => void;
|
|
4
|
+
label?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const PeacockSwitch: ({ checked, onChange, label, disabled }: PeacockSwitchProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface PeacockTooltipProps {
|
|
3
|
+
content: string;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const PeacockTooltip: ({ content, children, className }: PeacockTooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface UseSpotlightConfig {
|
|
2
|
+
stiffness?: number;
|
|
3
|
+
damping?: number;
|
|
4
|
+
}
|
|
5
|
+
export declare function useSpotlight(config?: UseSpotlightConfig): {
|
|
6
|
+
x: import('motion-dom').MotionValue<number>;
|
|
7
|
+
y: import('motion-dom').MotionValue<number>;
|
|
8
|
+
onMouseMove: (e: React.MouseEvent<HTMLElement>) => void;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
package/dist/hooks/utils.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
export * from './MotionProvider';
|
|
1
2
|
export * from './PeacockProvider';
|
|
3
|
+
export * from './MotionPrimitive';
|
|
2
4
|
export * from './components/PeacockButton';
|
|
3
|
-
export * from './
|
|
5
|
+
export * from './components/FluidCard';
|
|
6
|
+
export * from './components/GlassMenu';
|
|
7
|
+
export * from './components/PeacockInput';
|
|
8
|
+
export * from './components/PeacockSwitch';
|
|
9
|
+
export * from './components/PeacockBadge';
|
|
10
|
+
export * from './components/PeacockTooltip';
|
|
11
|
+
export * from './components/PeacockDialog';
|
|
4
12
|
export * from './hooks/utils';
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { Variants } from 'framer-motion';
|
|
2
|
-
|
|
3
2
|
export declare const slideUp: Variants;
|
|
4
3
|
export declare const fadeScale: Variants;
|
|
5
4
|
export declare const springRotate: Variants;
|
|
6
5
|
export declare const transitions: {
|
|
7
6
|
spring: {
|
|
8
|
-
type:
|
|
9
|
-
stiffness:
|
|
10
|
-
damping:
|
|
7
|
+
readonly type: "spring";
|
|
8
|
+
readonly stiffness: 300;
|
|
9
|
+
readonly damping: 20;
|
|
11
10
|
};
|
|
12
11
|
smooth: {
|
|
13
|
-
type:
|
|
14
|
-
ease:
|
|
15
|
-
duration:
|
|
12
|
+
readonly type: "tween";
|
|
13
|
+
readonly ease: readonly [0.22, 1, 0.36, 1];
|
|
14
|
+
readonly duration: 0.3;
|
|
16
15
|
};
|
|
17
16
|
};
|