border-beam 1.0.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/LICENSE +21 -0
- package/README.md +154 -0
- package/dist/index.cjs.js +663 -0
- package/dist/index.d.ts +169 -0
- package/dist/index.es.js +1365 -0
- package/package.json +64 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
3
|
+
import { HTMLAttributes } from 'react';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
import { RefAttributes } from 'react';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* BorderBeam component - Animated border beam effect for React
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <BorderBeam>
|
|
13
|
+
* <Card>Content</Card>
|
|
14
|
+
* </BorderBeam>
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
declare const BorderBeam: ForwardRefExoticComponent<BorderBeamProps & RefAttributes<HTMLDivElement>>;
|
|
18
|
+
export { BorderBeam }
|
|
19
|
+
export default BorderBeam;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Color variant for the beam effect
|
|
23
|
+
* - 'colorful': Full rainbow spectrum (default)
|
|
24
|
+
* - 'mono': Monochromatic grayscale
|
|
25
|
+
* - 'ocean': Blue and purple tones
|
|
26
|
+
* - 'sunset': Warm orange, yellow, and red tones
|
|
27
|
+
*/
|
|
28
|
+
export declare type BorderBeamColorVariant = 'colorful' | 'mono' | 'ocean' | 'sunset';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Props for the BorderBeam component
|
|
32
|
+
*/
|
|
33
|
+
export declare interface BorderBeamProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
34
|
+
/** Content to wrap with the border beam effect */
|
|
35
|
+
children: ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* Size/type preset
|
|
38
|
+
* - 'sm': Small button-sized with compact glow
|
|
39
|
+
* - 'md': Medium card-sized with full border glow (default)
|
|
40
|
+
* - 'line': Bottom-only traveling glow with breathe and spike animations
|
|
41
|
+
* @default 'md'
|
|
42
|
+
*/
|
|
43
|
+
size?: BorderBeamSize;
|
|
44
|
+
/**
|
|
45
|
+
* Color variant for the beam effect
|
|
46
|
+
* - 'colorful': Full rainbow spectrum (default)
|
|
47
|
+
* - 'mono': Monochromatic grayscale
|
|
48
|
+
* - 'ocean': Blue and purple tones
|
|
49
|
+
* - 'sunset': Warm orange, yellow, and red tones
|
|
50
|
+
* @default 'colorful'
|
|
51
|
+
*/
|
|
52
|
+
colorVariant?: BorderBeamColorVariant;
|
|
53
|
+
/**
|
|
54
|
+
* Theme mode - adapts beam/glow colors for dark or light backgrounds
|
|
55
|
+
* 'auto' detects system preference via prefers-color-scheme
|
|
56
|
+
* @default 'dark'
|
|
57
|
+
*/
|
|
58
|
+
theme?: BorderBeamTheme;
|
|
59
|
+
/**
|
|
60
|
+
* Disable the hue-shift animation for static colors (e.g., monochrome)
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
staticColors?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Rotation/travel duration in seconds
|
|
66
|
+
* @default 1.96 for border, 2.4 for line
|
|
67
|
+
*/
|
|
68
|
+
duration?: number;
|
|
69
|
+
/**
|
|
70
|
+
* Whether the animation is active
|
|
71
|
+
* @default true
|
|
72
|
+
*/
|
|
73
|
+
active?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Custom border radius in pixels. When omitted, the component
|
|
76
|
+
* auto-detects the border-radius of the first child element.
|
|
77
|
+
* Falls back to the size preset default if detection fails.
|
|
78
|
+
*/
|
|
79
|
+
borderRadius?: number;
|
|
80
|
+
/**
|
|
81
|
+
* Brightness multiplier for the glow effect
|
|
82
|
+
* @default 1.3
|
|
83
|
+
*/
|
|
84
|
+
brightness?: number;
|
|
85
|
+
/**
|
|
86
|
+
* Saturation multiplier for the glow effect
|
|
87
|
+
* @default 1.2 for dark, varies for light
|
|
88
|
+
*/
|
|
89
|
+
saturation?: number;
|
|
90
|
+
/**
|
|
91
|
+
* Hue rotation range in degrees for the hue-shift animation
|
|
92
|
+
* @default 30
|
|
93
|
+
*/
|
|
94
|
+
hueRange?: number;
|
|
95
|
+
/**
|
|
96
|
+
* Overall strength/opacity of the effect (0-1).
|
|
97
|
+
* Only affects the beam, glow, and bloom layers -- not the children.
|
|
98
|
+
* @default 1
|
|
99
|
+
*/
|
|
100
|
+
strength?: number;
|
|
101
|
+
/**
|
|
102
|
+
* Additional class name for the container
|
|
103
|
+
*/
|
|
104
|
+
className?: string;
|
|
105
|
+
/**
|
|
106
|
+
* Additional inline styles for the container
|
|
107
|
+
*/
|
|
108
|
+
style?: CSSProperties;
|
|
109
|
+
/**
|
|
110
|
+
* Callback when fade-in animation completes
|
|
111
|
+
*/
|
|
112
|
+
onActivate?: () => void;
|
|
113
|
+
/**
|
|
114
|
+
* Callback when fade-out animation completes
|
|
115
|
+
*/
|
|
116
|
+
onDeactivate?: () => void;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Size/type preset for the border beam effect
|
|
121
|
+
* - 'sm': Small button-sized with compact glow
|
|
122
|
+
* - 'md': Medium card-sized with full border glow
|
|
123
|
+
* - 'line': Bottom-only traveling glow with breathe and spike animations
|
|
124
|
+
*/
|
|
125
|
+
export declare type BorderBeamSize = 'sm' | 'md' | 'line';
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Theme mode for adapting beam colors to background
|
|
129
|
+
*/
|
|
130
|
+
export declare type BorderBeamTheme = 'dark' | 'light' | 'auto';
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Configuration for a size preset
|
|
134
|
+
*/
|
|
135
|
+
export declare interface SizeConfig {
|
|
136
|
+
borderRadius: number;
|
|
137
|
+
borderWidth: number;
|
|
138
|
+
width?: number;
|
|
139
|
+
height?: number;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Size presets for border radius and dimensions
|
|
144
|
+
*/
|
|
145
|
+
export declare const sizePresets: Record<'sm' | 'md' | 'line', SizeConfig>;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Per-size theme presets matching the tuned v5 control panel defaults
|
|
149
|
+
*/
|
|
150
|
+
export declare const sizeThemePresets: Record<'sm' | 'md' | 'line', Record<'dark' | 'light', ThemeColors>>;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Theme color configuration
|
|
154
|
+
*/
|
|
155
|
+
export declare interface ThemeColors {
|
|
156
|
+
strokeOpacity: number;
|
|
157
|
+
innerOpacity: number;
|
|
158
|
+
bloomOpacity: number;
|
|
159
|
+
innerShadow: string;
|
|
160
|
+
saturation: number;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* @deprecated Use `sizeThemePresets` for per-size theme values.
|
|
165
|
+
* Retained for backward compatibility — maps to `md` size presets.
|
|
166
|
+
*/
|
|
167
|
+
export declare const themeColors: Record<'dark' | 'light', ThemeColors>;
|
|
168
|
+
|
|
169
|
+
export { }
|