dara-ui 0.1.0 → 0.4.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/dist/components/Footer/Footer.d.ts +67 -0
- package/dist/components/Footer/index.d.ts +3 -0
- package/dist/components/Navbar/Navbar.d.ts +16 -0
- package/dist/components/PageLoader/PageLoader.d.ts +83 -0
- package/dist/components/PageLoader/PageLoaderProvider.d.ts +80 -0
- package/dist/components/PageLoader/index.d.ts +5 -0
- package/dist/components/ScrollReveal/ScrollReveal.d.ts +59 -0
- package/dist/components/ScrollReveal/index.d.ts +5 -0
- package/dist/components/ScrollReveal/useScrollReveal.d.ts +36 -0
- package/dist/dara-ui.cjs.js +387 -347
- package/dist/dara-ui.es.js +3075 -2375
- package/dist/index.d.ts +6 -0
- package/dist/style.css +1 -1
- package/dist/translations/en.d.ts +30 -0
- package/dist/translations/fa.d.ts +30 -0
- package/dist/translations/fr.d.ts +30 -0
- package/dist/translations/index.d.ts +90 -0
- package/package.json +4 -7
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type FooterVariant = "default" | "sticky" | "minimal";
|
|
3
|
+
export interface FooterColumn {
|
|
4
|
+
/**
|
|
5
|
+
* Column heading
|
|
6
|
+
*/
|
|
7
|
+
title?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Links in this column
|
|
10
|
+
*/
|
|
11
|
+
links?: {
|
|
12
|
+
label: string;
|
|
13
|
+
href: string;
|
|
14
|
+
external?: boolean;
|
|
15
|
+
icon?: React.ReactNode;
|
|
16
|
+
}[];
|
|
17
|
+
/**
|
|
18
|
+
* Free-form content for this column (overrides links)
|
|
19
|
+
*/
|
|
20
|
+
content?: React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
export interface FooterProps {
|
|
23
|
+
/**
|
|
24
|
+
* Layout variant
|
|
25
|
+
* - default: static footer at page bottom, brand + columns + bottom bar
|
|
26
|
+
* - sticky: always pinned to bottom of viewport (content pushes it up)
|
|
27
|
+
* - minimal: single-row thin strip
|
|
28
|
+
* @default "default"
|
|
29
|
+
*/
|
|
30
|
+
variant?: FooterVariant;
|
|
31
|
+
/**
|
|
32
|
+
* Brand element (logo, name)
|
|
33
|
+
*/
|
|
34
|
+
brand?: React.ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* Short tagline under the brand
|
|
37
|
+
*/
|
|
38
|
+
tagline?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Columns of links / content
|
|
41
|
+
*/
|
|
42
|
+
columns?: FooterColumn[];
|
|
43
|
+
/**
|
|
44
|
+
* Social icons / media strip (rendered above the bottom bar)
|
|
45
|
+
*/
|
|
46
|
+
social?: React.ReactNode;
|
|
47
|
+
/**
|
|
48
|
+
* Bottom bar content (copyright, legal links)
|
|
49
|
+
*/
|
|
50
|
+
bottomBar?: React.ReactNode;
|
|
51
|
+
/**
|
|
52
|
+
* Additional className
|
|
53
|
+
*/
|
|
54
|
+
className?: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Dara UI Footer
|
|
58
|
+
*
|
|
59
|
+
* Features:
|
|
60
|
+
* - Three variants: default, sticky, minimal
|
|
61
|
+
* - Glass-morphism styling consistent with Navbar
|
|
62
|
+
* - Responsive columns (2 cols on mobile, 4 on desktop)
|
|
63
|
+
* - RTL aware
|
|
64
|
+
* - Slots: brand, tagline, columns, social, bottomBar
|
|
65
|
+
*/
|
|
66
|
+
export declare const Footer: React.FC<FooterProps>;
|
|
67
|
+
export default Footer;
|
|
@@ -22,6 +22,22 @@ export interface NavbarProps {
|
|
|
22
22
|
themeChangerMobile?: React.ReactNode;
|
|
23
23
|
rightContent?: React.ReactNode;
|
|
24
24
|
className?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Enable IntersectionObserver-based scroll-spy.
|
|
27
|
+
* Each link's `href` (e.g. "#about") is observed; the section closest to
|
|
28
|
+
* the top of the viewport becomes active.
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
scrollSpy?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Offset from viewport top (px) where a section is considered "active"
|
|
34
|
+
* @default 140
|
|
35
|
+
*/
|
|
36
|
+
scrollSpyOffset?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Called with the currently-active section id whenever it changes
|
|
39
|
+
*/
|
|
40
|
+
onActiveChange?: (id: string) => void;
|
|
25
41
|
}
|
|
26
42
|
export declare const Navbar: React.FC<NavbarProps>;
|
|
27
43
|
export default Navbar;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type LoaderShape = "spinner" | "ring" | "dots" | "pulse" | "bars";
|
|
3
|
+
export type LoaderColor = "primary" | "secondary" | "accent" | "success" | "danger" | "warning";
|
|
4
|
+
export interface PageLoaderProps {
|
|
5
|
+
/**
|
|
6
|
+
* Whether the loader is visible
|
|
7
|
+
* @default true
|
|
8
|
+
*/
|
|
9
|
+
isLoading?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Loader shape/variant
|
|
12
|
+
* @default "spinner"
|
|
13
|
+
*/
|
|
14
|
+
shape?: LoaderShape;
|
|
15
|
+
/**
|
|
16
|
+
* Semantic color variant
|
|
17
|
+
* @default "primary"
|
|
18
|
+
*/
|
|
19
|
+
color?: LoaderColor;
|
|
20
|
+
/**
|
|
21
|
+
* Arbitrary CSS color (overrides `color` when provided)
|
|
22
|
+
* @example "var(--color-primary)" or "#7c5cff"
|
|
23
|
+
*/
|
|
24
|
+
customColor?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Loading label text
|
|
27
|
+
*/
|
|
28
|
+
label?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Progress value (0-100). Omit for indeterminate.
|
|
31
|
+
*/
|
|
32
|
+
progress?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Show progress percentage
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
showProgress?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Size of the loader
|
|
40
|
+
* @default "md"
|
|
41
|
+
*/
|
|
42
|
+
size?: "sm" | "md" | "lg";
|
|
43
|
+
/**
|
|
44
|
+
* Blur the backdrop
|
|
45
|
+
* @default true
|
|
46
|
+
*/
|
|
47
|
+
blur?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Show the Dara UI brand mark
|
|
50
|
+
* @default false
|
|
51
|
+
*/
|
|
52
|
+
showBrand?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Minimum display time in ms (prevents flash)
|
|
55
|
+
* @default 0
|
|
56
|
+
*/
|
|
57
|
+
minDuration?: number;
|
|
58
|
+
/**
|
|
59
|
+
* Render inline (no fixed positioning, no backdrop)
|
|
60
|
+
* Used for inline previews inside cards
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
inline?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Additional className
|
|
66
|
+
*/
|
|
67
|
+
className?: string;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Dara UI PageLoader - Full-screen loading overlay
|
|
71
|
+
*
|
|
72
|
+
* Features:
|
|
73
|
+
* - Multiple loader shapes (spinner, ring, dots, pulse, bars)
|
|
74
|
+
* - Optional progress bar with percentage
|
|
75
|
+
* - Glass backdrop with blur
|
|
76
|
+
* - Theme-aware colors + custom color support
|
|
77
|
+
* - Minimum display time to prevent flash
|
|
78
|
+
* - Smooth fade in/out
|
|
79
|
+
* - `inline` mode for embedding inside cards / previews
|
|
80
|
+
* - Glows follow the painted shape via drop-shadow (not bounding box)
|
|
81
|
+
*/
|
|
82
|
+
export declare const PageLoader: React.FC<PageLoaderProps>;
|
|
83
|
+
export default PageLoader;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { LoaderShape } from './PageLoader';
|
|
3
|
+
export interface PageLoaderOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Loading label
|
|
6
|
+
*/
|
|
7
|
+
label?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Loader shape
|
|
10
|
+
* @default "spinner"
|
|
11
|
+
*/
|
|
12
|
+
shape?: LoaderShape;
|
|
13
|
+
/**
|
|
14
|
+
* Minimum display time in ms
|
|
15
|
+
* @default 400
|
|
16
|
+
*/
|
|
17
|
+
minDuration?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Show progress
|
|
20
|
+
*/
|
|
21
|
+
showProgress?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Show brand mark
|
|
24
|
+
*/
|
|
25
|
+
showBrand?: boolean;
|
|
26
|
+
}
|
|
27
|
+
interface PageLoaderContextValue {
|
|
28
|
+
/**
|
|
29
|
+
* Show the page loader
|
|
30
|
+
*/
|
|
31
|
+
show: (options?: PageLoaderOptions) => void;
|
|
32
|
+
/**
|
|
33
|
+
* Hide the page loader
|
|
34
|
+
*/
|
|
35
|
+
hide: () => void;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the loader is currently visible
|
|
38
|
+
*/
|
|
39
|
+
isLoading: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Update progress (0-100)
|
|
42
|
+
*/
|
|
43
|
+
setProgress: (progress: number) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Wrap an async operation with automatic loader
|
|
46
|
+
*/
|
|
47
|
+
wrap: <T>(fn: () => Promise<T>, options?: PageLoaderOptions) => Promise<T>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* PageLoaderProvider - App-level page loader with imperative API
|
|
51
|
+
*
|
|
52
|
+
* Features:
|
|
53
|
+
* - show()/hide() imperative API
|
|
54
|
+
* - wrap() to auto-load during async ops
|
|
55
|
+
* - Route-change friendly
|
|
56
|
+
* - Progress support
|
|
57
|
+
*/
|
|
58
|
+
export declare const PageLoaderProvider: React.FC<{
|
|
59
|
+
children: ReactNode;
|
|
60
|
+
}>;
|
|
61
|
+
/**
|
|
62
|
+
* usePageLoader - Imperative API for the page loader
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```tsx
|
|
66
|
+
* const loader = usePageLoader();
|
|
67
|
+
*
|
|
68
|
+
* // Manual control
|
|
69
|
+
* loader.show({ label: "Loading...", showBrand: true });
|
|
70
|
+
* loader.hide();
|
|
71
|
+
*
|
|
72
|
+
* // Auto-wrap an async operation
|
|
73
|
+
* await loader.wrap(async () => {
|
|
74
|
+
* const data = await fetch("/api/data");
|
|
75
|
+
* return data.json();
|
|
76
|
+
* }, { label: "Fetching..." });
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
export declare const usePageLoader: () => PageLoaderContextValue;
|
|
80
|
+
export default usePageLoader;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { PageLoader } from './PageLoader';
|
|
2
|
+
export type { PageLoaderProps, LoaderShape } from './PageLoader';
|
|
3
|
+
export { PageLoaderProvider, usePageLoader } from './PageLoaderProvider';
|
|
4
|
+
export type { PageLoaderOptions } from './PageLoaderProvider';
|
|
5
|
+
export { PageLoader as default } from './PageLoader';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type ScrollRevealAnimation = "fade" | "fade-up" | "fade-down" | "fade-left" | "fade-right" | "zoom-in" | "zoom-out" | "flip-up" | "flip-down" | "slide-up" | "slide-down";
|
|
3
|
+
export interface ScrollRevealProps {
|
|
4
|
+
/**
|
|
5
|
+
* Content to reveal
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Animation type
|
|
10
|
+
* @default "fade-up"
|
|
11
|
+
*/
|
|
12
|
+
animation?: ScrollRevealAnimation;
|
|
13
|
+
/**
|
|
14
|
+
* Delay before animation starts (ms)
|
|
15
|
+
* @default 0
|
|
16
|
+
*/
|
|
17
|
+
delay?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Duration of the animation (ms)
|
|
20
|
+
* @default 600
|
|
21
|
+
*/
|
|
22
|
+
duration?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Distance to travel in pixels (for directional animations)
|
|
25
|
+
* @default 40
|
|
26
|
+
*/
|
|
27
|
+
distance?: number;
|
|
28
|
+
/**
|
|
29
|
+
* IntersectionObserver threshold (0-1)
|
|
30
|
+
* @default 0.15
|
|
31
|
+
*/
|
|
32
|
+
threshold?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Only animate once (don't re-trigger on scroll back)
|
|
35
|
+
* @default true
|
|
36
|
+
*/
|
|
37
|
+
once?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Root margin for IntersectionObserver
|
|
40
|
+
* @default "0px 0px -10% 0px"
|
|
41
|
+
*/
|
|
42
|
+
rootMargin?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Additional className
|
|
45
|
+
*/
|
|
46
|
+
className?: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Dara UI ScrollReveal - Animate elements into view on scroll
|
|
50
|
+
*
|
|
51
|
+
* Features:
|
|
52
|
+
* - Multiple animation presets (fade, slide, zoom, flip)
|
|
53
|
+
* - Configurable delay, duration, distance
|
|
54
|
+
* - IntersectionObserver-based (performant)
|
|
55
|
+
* - Respects prefers-reduced-motion
|
|
56
|
+
* - Runs once by default
|
|
57
|
+
*/
|
|
58
|
+
export declare const ScrollReveal: React.FC<ScrollRevealProps>;
|
|
59
|
+
export default ScrollReveal;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ScrollReveal } from './ScrollReveal';
|
|
2
|
+
export type { ScrollRevealProps, ScrollRevealAnimation } from './ScrollReveal';
|
|
3
|
+
export { useScrollReveal } from './useScrollReveal';
|
|
4
|
+
export type { UseScrollRevealOptions } from './useScrollReveal';
|
|
5
|
+
export { ScrollReveal as default } from './ScrollReveal';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface UseScrollRevealOptions {
|
|
2
|
+
/**
|
|
3
|
+
* IntersectionObserver threshold
|
|
4
|
+
* @default 0.15
|
|
5
|
+
*/
|
|
6
|
+
threshold?: number;
|
|
7
|
+
/**
|
|
8
|
+
* Only trigger once
|
|
9
|
+
* @default true
|
|
10
|
+
*/
|
|
11
|
+
once?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Root margin
|
|
14
|
+
* @default "0px 0px -10% 0px"
|
|
15
|
+
*/
|
|
16
|
+
rootMargin?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* useScrollReveal - Hook version of ScrollReveal for custom elements
|
|
20
|
+
*
|
|
21
|
+
* Returns a ref to attach and a boolean indicating visibility.
|
|
22
|
+
* Use with any element: cards, inputs, sections, etc.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* const { ref, isVisible } = useScrollReveal();
|
|
27
|
+
* <div ref={ref} style={{ opacity: isVisible ? 1 : 0 }}>
|
|
28
|
+
* Content
|
|
29
|
+
* </div>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare function useScrollReveal<T extends HTMLElement = HTMLDivElement>(options?: UseScrollRevealOptions): {
|
|
33
|
+
ref: import('react').RefObject<T | null>;
|
|
34
|
+
isVisible: boolean;
|
|
35
|
+
};
|
|
36
|
+
export default useScrollReveal;
|