dara-ui 0.1.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/LICENSE +21 -0
- package/README.md +185 -0
- package/dist/components/Accordion/Accordion.d.ts +23 -0
- package/dist/components/Accordion/index.d.ts +3 -0
- package/dist/components/AuroraBlobs/AuroraBlobs.d.ts +28 -0
- package/dist/components/AuroraBlobs/index.d.ts +3 -0
- package/dist/components/Avatar/Avatar.d.ts +65 -0
- package/dist/components/Avatar/index.d.ts +3 -0
- package/dist/components/Badge/Badge.d.ts +38 -0
- package/dist/components/Badge/index.d.ts +3 -0
- package/dist/components/BlogCard/BlogCard.d.ts +97 -0
- package/dist/components/BlogCard/index.d.ts +3 -0
- package/dist/components/Button/Button.d.ts +49 -0
- package/dist/components/Button/index.d.ts +3 -0
- package/dist/components/Card/Card.d.ts +43 -0
- package/dist/components/Card/index.d.ts +3 -0
- package/dist/components/CharacterCard/CharacterCard.d.ts +86 -0
- package/dist/components/CharacterCard/index.d.ts +3 -0
- package/dist/components/Checkbox/Checkbox.d.ts +59 -0
- package/dist/components/Checkbox/index.d.ts +3 -0
- package/dist/components/Dropdown/Dropdown.d.ts +90 -0
- package/dist/components/Dropdown/index.d.ts +3 -0
- package/dist/components/GradientRing/GradientRing.d.ts +42 -0
- package/dist/components/GradientRing/index.d.ts +3 -0
- package/dist/components/Icons/Icons.d.ts +192 -0
- package/dist/components/Icons/index.d.ts +1 -0
- package/dist/components/Input/Input.d.ts +61 -0
- package/dist/components/Input/index.d.ts +3 -0
- package/dist/components/LanguageChanger/LanguageChanger.d.ts +168 -0
- package/dist/components/LanguageChanger/index.d.ts +4 -0
- package/dist/components/Modal/Modal.d.ts +53 -0
- package/dist/components/Modal/index.d.ts +3 -0
- package/dist/components/Navbar/Navbar.d.ts +27 -0
- package/dist/components/Navbar/index.d.ts +3 -0
- package/dist/components/NoiseOverlay/NoiseOverlay.d.ts +23 -0
- package/dist/components/NoiseOverlay/index.d.ts +3 -0
- package/dist/components/Particles/Particles.d.ts +43 -0
- package/dist/components/Particles/index.d.ts +3 -0
- package/dist/components/ProductCard/ProductCard.d.ts +104 -0
- package/dist/components/ProductCard/index.d.ts +3 -0
- package/dist/components/Progress/Progress.d.ts +89 -0
- package/dist/components/Progress/index.d.ts +3 -0
- package/dist/components/QuestCard/QuestCard.d.ts +67 -0
- package/dist/components/QuestCard/index.d.ts +3 -0
- package/dist/components/Radio/Radio.d.ts +66 -0
- package/dist/components/Radio/index.d.ts +3 -0
- package/dist/components/Range/Range.d.ts +98 -0
- package/dist/components/Range/index.d.ts +3 -0
- package/dist/components/Sidebar/Sidebar.d.ts +163 -0
- package/dist/components/Sidebar/SidebarMobileTrigger.d.ts +33 -0
- package/dist/components/Sidebar/index.d.ts +5 -0
- package/dist/components/SocialMedia/SocialMedia.d.ts +31 -0
- package/dist/components/SocialMedia/index.d.ts +3 -0
- package/dist/components/StatsWidget/StatsWidget.d.ts +71 -0
- package/dist/components/StatsWidget/index.d.ts +3 -0
- package/dist/components/Switch/Switch.d.ts +62 -0
- package/dist/components/Switch/index.d.ts +3 -0
- package/dist/components/Tabs/Tabs.d.ts +21 -0
- package/dist/components/Tabs/index.d.ts +3 -0
- package/dist/components/ThemeChanger/ThemeChanger.d.ts +98 -0
- package/dist/components/ThemeChanger/index.d.ts +3 -0
- package/dist/components/Toast/Toast.d.ts +54 -0
- package/dist/components/Toast/ToastProvider.d.ts +78 -0
- package/dist/components/Toast/index.d.ts +5 -0
- package/dist/components/Tooltip/Tooltip.d.ts +83 -0
- package/dist/components/Tooltip/index.d.ts +3 -0
- package/dist/components/XPBar/XPBar.d.ts +71 -0
- package/dist/components/XPBar/index.d.ts +3 -0
- package/dist/dara-ui.cjs.js +973 -0
- package/dist/dara-ui.es.js +9522 -0
- package/dist/hooks/useAppTranslation.d.ts +7 -0
- package/dist/hooks/useDirection.d.ts +7 -0
- package/dist/index.d.ts +66 -0
- package/dist/style.css +2 -0
- package/dist/translations/en.d.ts +732 -0
- package/dist/translations/fa.d.ts +732 -0
- package/dist/translations/fr.d.ts +731 -0
- package/dist/translations/index.d.ts +2200 -0
- package/package.json +92 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> {
|
|
3
|
+
/**
|
|
4
|
+
* Whether the checkbox is checked
|
|
5
|
+
* @default false
|
|
6
|
+
*/
|
|
7
|
+
checked?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Default checked state (uncontrolled)
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
defaultChecked?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Callback when checked state changes
|
|
15
|
+
*/
|
|
16
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Label text for the checkbox
|
|
19
|
+
*/
|
|
20
|
+
label?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Checkbox size
|
|
23
|
+
* @default "md"
|
|
24
|
+
*/
|
|
25
|
+
size?: "sm" | "md" | "lg";
|
|
26
|
+
/**
|
|
27
|
+
* If true, adds a glow effect when checked
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
glow?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Error state
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
error?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Disabled state
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Additional className
|
|
43
|
+
*/
|
|
44
|
+
className?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Dara UI Checkbox - Interactive checkbox with glass styling and sparkle animation
|
|
48
|
+
*
|
|
49
|
+
* Features:
|
|
50
|
+
* - Glass styling with theme-aware colors
|
|
51
|
+
* - Smooth check animation with sparkle effect
|
|
52
|
+
* - Glow effect when checked
|
|
53
|
+
* - RTL support via document dir (box on the right, label on the left in RTL)
|
|
54
|
+
* - Controlled and uncontrolled modes
|
|
55
|
+
* - Multiple sizes (sm, md, lg)
|
|
56
|
+
* - Error state support
|
|
57
|
+
*/
|
|
58
|
+
export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
|
|
59
|
+
export default Checkbox;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface DropdownOption {
|
|
3
|
+
/**
|
|
4
|
+
* Option value (unique identifier)
|
|
5
|
+
*/
|
|
6
|
+
value: string;
|
|
7
|
+
/**
|
|
8
|
+
* Option label to display
|
|
9
|
+
*/
|
|
10
|
+
label: string;
|
|
11
|
+
/**
|
|
12
|
+
* Optional icon
|
|
13
|
+
*/
|
|
14
|
+
icon?: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Disabled state
|
|
17
|
+
*/
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface DropdownProps {
|
|
21
|
+
/**
|
|
22
|
+
* Array of dropdown options
|
|
23
|
+
*/
|
|
24
|
+
options: DropdownOption[];
|
|
25
|
+
/**
|
|
26
|
+
* Controlled: selected value
|
|
27
|
+
*/
|
|
28
|
+
value?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Default selected value (uncontrolled mode)
|
|
31
|
+
*/
|
|
32
|
+
defaultValue?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Controlled: callback when selection changes
|
|
35
|
+
*/
|
|
36
|
+
onChange?: (value: string) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Placeholder text when no option is selected
|
|
39
|
+
* @default "Select an option..."
|
|
40
|
+
*/
|
|
41
|
+
placeholder?: string;
|
|
42
|
+
/**
|
|
43
|
+
* If true, dropdown will be searchable
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
searchable?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Search placeholder text
|
|
49
|
+
* @default "Search..."
|
|
50
|
+
*/
|
|
51
|
+
searchPlaceholder?: string;
|
|
52
|
+
/**
|
|
53
|
+
* If true, dropdown will be disabled
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
56
|
+
disabled?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* If true, dropdown takes 100% of parent width
|
|
59
|
+
* When false, uses a fixed width per size (does not grow with label text)
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
|
+
fullWidth?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Size of the dropdown
|
|
65
|
+
* @default "md"
|
|
66
|
+
*/
|
|
67
|
+
size?: "sm" | "md" | "lg";
|
|
68
|
+
/**
|
|
69
|
+
* Additional className for the container
|
|
70
|
+
*/
|
|
71
|
+
className?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Label text for the dropdown
|
|
74
|
+
*/
|
|
75
|
+
label?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Helper text shown below dropdown
|
|
78
|
+
*/
|
|
79
|
+
helperText?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Error state
|
|
82
|
+
*/
|
|
83
|
+
error?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Error message
|
|
86
|
+
*/
|
|
87
|
+
errorMessage?: string;
|
|
88
|
+
}
|
|
89
|
+
export declare const Dropdown: React.ForwardRefExoticComponent<DropdownProps & React.RefAttributes<HTMLDivElement>>;
|
|
90
|
+
export default Dropdown;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface GradientRingProps {
|
|
3
|
+
/**
|
|
4
|
+
* Size of the ring in pixels
|
|
5
|
+
* @default 280
|
|
6
|
+
*/
|
|
7
|
+
size?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Colors for the conic gradient
|
|
10
|
+
* @default ["var(--color-primary)", "var(--color-secondary)", "var(--color-accent)", "var(--color-primary)"]
|
|
11
|
+
*/
|
|
12
|
+
colors?: string[];
|
|
13
|
+
/**
|
|
14
|
+
* Blur amount in pixels
|
|
15
|
+
* @default 60
|
|
16
|
+
*/
|
|
17
|
+
blur?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Opacity of the ring
|
|
20
|
+
* @default 0.5
|
|
21
|
+
*/
|
|
22
|
+
opacity?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Animation duration in seconds
|
|
25
|
+
* @default 15
|
|
26
|
+
*/
|
|
27
|
+
duration?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Additional className
|
|
30
|
+
*/
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Dara UI GradientRing - Spinning conic gradient ring
|
|
35
|
+
*
|
|
36
|
+
* Features:
|
|
37
|
+
* - Customizable size, colors, and blur
|
|
38
|
+
* - Smooth spinning animation
|
|
39
|
+
* - Used as a decorative element behind hero sections
|
|
40
|
+
*/
|
|
41
|
+
export declare const GradientRing: React.FC<GradientRingProps>;
|
|
42
|
+
export default GradientRing;
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dara UI - Centralized SVG Icons
|
|
3
|
+
*
|
|
4
|
+
* All manually built SVG icons used across the library.
|
|
5
|
+
* Import from here instead of redefining in each component.
|
|
6
|
+
*/
|
|
7
|
+
export declare const HomeIcon: ({ className }: {
|
|
8
|
+
className?: string;
|
|
9
|
+
}) => import("react").JSX.Element;
|
|
10
|
+
export declare const ExploreIcon: ({ className, }: {
|
|
11
|
+
className?: string;
|
|
12
|
+
}) => import("react").JSX.Element;
|
|
13
|
+
export declare const SettingsIcon: ({ className, }: {
|
|
14
|
+
className?: string;
|
|
15
|
+
}) => import("react").JSX.Element;
|
|
16
|
+
export declare const SearchIcon: ({ className, }: {
|
|
17
|
+
className?: string;
|
|
18
|
+
}) => import("react").JSX.Element;
|
|
19
|
+
export declare const UserIcon: ({ className }: {
|
|
20
|
+
className?: string;
|
|
21
|
+
}) => import("react").JSX.Element;
|
|
22
|
+
export declare const LockIcon: ({ className }: {
|
|
23
|
+
className?: string;
|
|
24
|
+
}) => import("react").JSX.Element;
|
|
25
|
+
export declare const CheckIcon: ({ className, }: {
|
|
26
|
+
className?: string;
|
|
27
|
+
}) => import("react").JSX.Element;
|
|
28
|
+
export declare const StarIcon: ({ className }: {
|
|
29
|
+
className?: string;
|
|
30
|
+
}) => import("react").JSX.Element;
|
|
31
|
+
export declare const BellIcon: ({ className }: {
|
|
32
|
+
className?: string;
|
|
33
|
+
}) => import("react").JSX.Element;
|
|
34
|
+
export declare const BellSlashIcon: ({ className, }: {
|
|
35
|
+
className?: string;
|
|
36
|
+
}) => import("react").JSX.Element;
|
|
37
|
+
export declare const CircleFilledIcon: ({ className, }: {
|
|
38
|
+
className?: string;
|
|
39
|
+
}) => import("react").JSX.Element;
|
|
40
|
+
export declare const CircleOutlineIcon: ({ className, }: {
|
|
41
|
+
className?: string;
|
|
42
|
+
}) => import("react").JSX.Element;
|
|
43
|
+
export declare const SparkleIcon: ({ className, }: {
|
|
44
|
+
className?: string;
|
|
45
|
+
}) => import("react").JSX.Element;
|
|
46
|
+
export declare const TrophyIcon: ({ className, }: {
|
|
47
|
+
className?: string;
|
|
48
|
+
}) => import("react").JSX.Element;
|
|
49
|
+
export declare const PackageIcon: ({ className, }: {
|
|
50
|
+
className?: string;
|
|
51
|
+
}) => import("react").JSX.Element;
|
|
52
|
+
export declare const TargetIcon: ({ className, }: {
|
|
53
|
+
className?: string;
|
|
54
|
+
}) => import("react").JSX.Element;
|
|
55
|
+
export declare const BanIcon: ({ className }: {
|
|
56
|
+
className?: string;
|
|
57
|
+
}) => import("react").JSX.Element;
|
|
58
|
+
export declare const SettingsGearIcon: ({ className, }: {
|
|
59
|
+
className?: string;
|
|
60
|
+
}) => import("react").JSX.Element;
|
|
61
|
+
export declare const FolderDocIcon: ({ className, }: {
|
|
62
|
+
className?: string;
|
|
63
|
+
}) => import("react").JSX.Element;
|
|
64
|
+
export declare const SwordsSmallIcon: ({ className, }: {
|
|
65
|
+
className?: string;
|
|
66
|
+
}) => import("react").JSX.Element;
|
|
67
|
+
export declare const ChartSmallIcon: ({ className, }: {
|
|
68
|
+
className?: string;
|
|
69
|
+
}) => import("react").JSX.Element;
|
|
70
|
+
export declare const UserSmallIcon: ({ className, }: {
|
|
71
|
+
className?: string;
|
|
72
|
+
}) => import("react").JSX.Element;
|
|
73
|
+
export declare const HomeSmallIcon: ({ className, }: {
|
|
74
|
+
className?: string;
|
|
75
|
+
}) => import("react").JSX.Element;
|
|
76
|
+
export declare const FolderSmallIcon: ({ className, }: {
|
|
77
|
+
className?: string;
|
|
78
|
+
}) => import("react").JSX.Element;
|
|
79
|
+
export declare const MoonOutlineIcon: ({ className, }: {
|
|
80
|
+
className?: string;
|
|
81
|
+
}) => import("react").JSX.Element;
|
|
82
|
+
export declare const SkullIcon: ({ className, }: {
|
|
83
|
+
className?: string;
|
|
84
|
+
}) => import("react").JSX.Element;
|
|
85
|
+
export declare const MoonIcon: ({ className }: {
|
|
86
|
+
className?: string;
|
|
87
|
+
}) => import("react").JSX.Element;
|
|
88
|
+
export declare const SunIcon: ({ className }: {
|
|
89
|
+
className?: string;
|
|
90
|
+
}) => import("react").JSX.Element;
|
|
91
|
+
export declare const VolumeHighIcon: ({ className, }: {
|
|
92
|
+
className?: string;
|
|
93
|
+
}) => import("react").JSX.Element;
|
|
94
|
+
export declare const VolumeMuteIcon: ({ className, }: {
|
|
95
|
+
className?: string;
|
|
96
|
+
}) => import("react").JSX.Element;
|
|
97
|
+
export declare const FolderIcon: ({ className, }: {
|
|
98
|
+
className?: string;
|
|
99
|
+
}) => import("react").JSX.Element;
|
|
100
|
+
export declare const DocsIcon: ({ className }: {
|
|
101
|
+
className?: string;
|
|
102
|
+
}) => import("react").JSX.Element;
|
|
103
|
+
export declare const MailIcon: ({ className }: {
|
|
104
|
+
className?: string;
|
|
105
|
+
}) => import("react").JSX.Element;
|
|
106
|
+
export declare const LogoutIcon: ({ className, }: {
|
|
107
|
+
className?: string;
|
|
108
|
+
}) => import("react").JSX.Element;
|
|
109
|
+
export declare const SidebarHomeIcon: ({ className, }: {
|
|
110
|
+
className?: string;
|
|
111
|
+
}) => import("react").JSX.Element;
|
|
112
|
+
export declare const PlayIcon: ({ className }: {
|
|
113
|
+
className?: string;
|
|
114
|
+
}) => import("react").JSX.Element;
|
|
115
|
+
export declare const PauseIcon: ({ className, }: {
|
|
116
|
+
className?: string;
|
|
117
|
+
}) => import("react").JSX.Element;
|
|
118
|
+
export declare const CartIcon: ({ className }: {
|
|
119
|
+
className?: string;
|
|
120
|
+
}) => import("react").JSX.Element;
|
|
121
|
+
export declare const CloseIcon: ({ className, }: {
|
|
122
|
+
className?: string;
|
|
123
|
+
}) => import("react").JSX.Element;
|
|
124
|
+
export declare const ChevronDownIcon: ({ className, }: {
|
|
125
|
+
className?: string;
|
|
126
|
+
}) => import("react").JSX.Element;
|
|
127
|
+
export declare const ChevronRightIcon: ({ className, }: {
|
|
128
|
+
className?: string;
|
|
129
|
+
}) => import("react").JSX.Element;
|
|
130
|
+
export declare const ChevronLeftIcon: ({ className, }: {
|
|
131
|
+
className?: string;
|
|
132
|
+
}) => import("react").JSX.Element;
|
|
133
|
+
export declare const SuccessIcon: ({ className, }: {
|
|
134
|
+
className?: string;
|
|
135
|
+
}) => import("react").JSX.Element;
|
|
136
|
+
export declare const ErrorIcon: ({ className, }: {
|
|
137
|
+
className?: string;
|
|
138
|
+
}) => import("react").JSX.Element;
|
|
139
|
+
export declare const WarningIcon: ({ className, }: {
|
|
140
|
+
className?: string;
|
|
141
|
+
}) => import("react").JSX.Element;
|
|
142
|
+
export declare const InfoIcon: ({ className }: {
|
|
143
|
+
className?: string;
|
|
144
|
+
}) => import("react").JSX.Element;
|
|
145
|
+
export declare const AvatarIcon: ({ className, }: {
|
|
146
|
+
className?: string;
|
|
147
|
+
}) => import("react").JSX.Element;
|
|
148
|
+
export declare const ImagePlaceholderIcon: ({ className, }: {
|
|
149
|
+
className?: string;
|
|
150
|
+
}) => import("react").JSX.Element;
|
|
151
|
+
export declare const BlogPlaceholderIcon: ({ className, }: {
|
|
152
|
+
className?: string;
|
|
153
|
+
}) => import("react").JSX.Element;
|
|
154
|
+
export declare const FlagIcon: ({ className }: {
|
|
155
|
+
className?: string;
|
|
156
|
+
}) => import("react").JSX.Element;
|
|
157
|
+
export declare const ClockIcon: ({ className, }: {
|
|
158
|
+
className?: string;
|
|
159
|
+
}) => import("react").JSX.Element;
|
|
160
|
+
export declare const RocketIcon: ({ className, }: {
|
|
161
|
+
className?: string;
|
|
162
|
+
}) => import("react").JSX.Element;
|
|
163
|
+
export declare const AnalyticsIcon: ({ className, }: {
|
|
164
|
+
className?: string;
|
|
165
|
+
}) => import("react").JSX.Element;
|
|
166
|
+
export declare const SwordsIcon: ({ className, }: {
|
|
167
|
+
className?: string;
|
|
168
|
+
}) => import("react").JSX.Element;
|
|
169
|
+
export declare const ChartBarIcon: ({ className, }: {
|
|
170
|
+
className?: string;
|
|
171
|
+
}) => import("react").JSX.Element;
|
|
172
|
+
export declare const GithubIcon: ({ className, }: {
|
|
173
|
+
className?: string;
|
|
174
|
+
}) => import("react").JSX.Element;
|
|
175
|
+
export declare const XTwitterIcon: ({ className, }: {
|
|
176
|
+
className?: string;
|
|
177
|
+
}) => import("react").JSX.Element;
|
|
178
|
+
export declare const DiscordIcon: ({ className, }: {
|
|
179
|
+
className?: string;
|
|
180
|
+
}) => import("react").JSX.Element;
|
|
181
|
+
export declare const YoutubeIcon: ({ className, }: {
|
|
182
|
+
className?: string;
|
|
183
|
+
}) => import("react").JSX.Element;
|
|
184
|
+
export declare const InstagramIcon: ({ className, }: {
|
|
185
|
+
className?: string;
|
|
186
|
+
}) => import("react").JSX.Element;
|
|
187
|
+
export declare const LinkedinIcon: ({ className, }: {
|
|
188
|
+
className?: string;
|
|
189
|
+
}) => import("react").JSX.Element;
|
|
190
|
+
export declare const BlueskyIcon: ({ className, }: {
|
|
191
|
+
className?: string;
|
|
192
|
+
}) => import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Icons';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> {
|
|
3
|
+
/**
|
|
4
|
+
* Input type
|
|
5
|
+
* @default "text"
|
|
6
|
+
*/
|
|
7
|
+
type?: "text" | "password" | "search" | "email" | "tel" | "number" | "url" | "date";
|
|
8
|
+
/**
|
|
9
|
+
* Input size
|
|
10
|
+
* @default "md"
|
|
11
|
+
*/
|
|
12
|
+
size?: "sm" | "md" | "lg";
|
|
13
|
+
/**
|
|
14
|
+
* Validation state
|
|
15
|
+
*/
|
|
16
|
+
validation?: "success" | "error" | "warning";
|
|
17
|
+
/**
|
|
18
|
+
* Error message
|
|
19
|
+
*/
|
|
20
|
+
errorMessage?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Success message
|
|
23
|
+
*/
|
|
24
|
+
successMessage?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Left icon
|
|
27
|
+
*/
|
|
28
|
+
leftIcon?: React.ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Right icon
|
|
31
|
+
*/
|
|
32
|
+
rightIcon?: React.ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* Glow focus effect
|
|
35
|
+
* @default true
|
|
36
|
+
*/
|
|
37
|
+
glowFocus?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Label text
|
|
40
|
+
*/
|
|
41
|
+
label?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Helper text
|
|
44
|
+
*/
|
|
45
|
+
helperText?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Full width
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
50
|
+
fullWidth?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Disabled state
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
disabled?: boolean;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Dara UI Input
|
|
59
|
+
*/
|
|
60
|
+
export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
61
|
+
export default Input;
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface LanguageOption {
|
|
3
|
+
/**
|
|
4
|
+
* Language code (e.g., "en", "fa", "fr")
|
|
5
|
+
*/
|
|
6
|
+
value: string;
|
|
7
|
+
/**
|
|
8
|
+
* Display label
|
|
9
|
+
*/
|
|
10
|
+
label: string;
|
|
11
|
+
/**
|
|
12
|
+
* Flag image URL (auto-generated from language code if not provided)
|
|
13
|
+
*/
|
|
14
|
+
icon?: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Direction for this language
|
|
17
|
+
* @default "ltr"
|
|
18
|
+
*/
|
|
19
|
+
dir?: "ltr" | "rtl";
|
|
20
|
+
}
|
|
21
|
+
export interface LanguageChangerProps {
|
|
22
|
+
/**
|
|
23
|
+
* Controlled value
|
|
24
|
+
*/
|
|
25
|
+
value?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Default value (uncontrolled)
|
|
28
|
+
*/
|
|
29
|
+
defaultValue?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Callback when language changes
|
|
32
|
+
*/
|
|
33
|
+
onChange?: (lang: string) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Available languages (overrides default)
|
|
36
|
+
*/
|
|
37
|
+
availableLanguages?: LanguageOption[];
|
|
38
|
+
/**
|
|
39
|
+
* Component size
|
|
40
|
+
* @default "md"
|
|
41
|
+
*/
|
|
42
|
+
size?: "sm" | "md" | "lg";
|
|
43
|
+
/**
|
|
44
|
+
* If true, shows only the icon in a fixed-size circular button
|
|
45
|
+
* @default false
|
|
46
|
+
*/
|
|
47
|
+
iconOnly?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Fixed width for the dropdown trigger (in px or rem)
|
|
50
|
+
* @example "140px" or "10rem"
|
|
51
|
+
*/
|
|
52
|
+
fixedWidth?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Additional className
|
|
55
|
+
*/
|
|
56
|
+
className?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Whether to use the I18n context
|
|
59
|
+
* @default true
|
|
60
|
+
*/
|
|
61
|
+
useContext?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Dropdown placement
|
|
64
|
+
* @default "bottom"
|
|
65
|
+
*/
|
|
66
|
+
placement?: "bottom" | "top";
|
|
67
|
+
/**
|
|
68
|
+
* Open the dropdown upward
|
|
69
|
+
* @default false
|
|
70
|
+
*/
|
|
71
|
+
openUpward?: boolean;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Default Dara UI languages with flag CDN URLs
|
|
75
|
+
*/
|
|
76
|
+
export declare const DEFAULT_LANGUAGES: LanguageOption[];
|
|
77
|
+
export interface I18nContextValue {
|
|
78
|
+
/**
|
|
79
|
+
* Current language code
|
|
80
|
+
*/
|
|
81
|
+
language: string;
|
|
82
|
+
/**
|
|
83
|
+
* Set the current language
|
|
84
|
+
*/
|
|
85
|
+
setLanguage: (lang: string) => void;
|
|
86
|
+
/**
|
|
87
|
+
* Translation function - resolves nested keys
|
|
88
|
+
* @example t('welcome.title') => "Welcome"
|
|
89
|
+
* @example t('greeting', { name: "John" }) => "Hello John"
|
|
90
|
+
*/
|
|
91
|
+
t: (key: string, params?: Record<string, string | number>) => string;
|
|
92
|
+
/**
|
|
93
|
+
* Available languages
|
|
94
|
+
*/
|
|
95
|
+
languages: LanguageOption[];
|
|
96
|
+
/**
|
|
97
|
+
* Direction for current language
|
|
98
|
+
*/
|
|
99
|
+
dir: "ltr" | "rtl";
|
|
100
|
+
}
|
|
101
|
+
export interface I18nProviderProps {
|
|
102
|
+
/**
|
|
103
|
+
* Initial language
|
|
104
|
+
*/
|
|
105
|
+
defaultLanguage?: string;
|
|
106
|
+
/**
|
|
107
|
+
* Translations object - keyed by language code
|
|
108
|
+
* @example { en: { welcome: "Welcome" }, fa: { welcome: "خوش آمدید" } }
|
|
109
|
+
*/
|
|
110
|
+
translations: Record<string, Record<string, any>>;
|
|
111
|
+
/**
|
|
112
|
+
* Available languages (overrides default)
|
|
113
|
+
*/
|
|
114
|
+
languages?: LanguageOption[];
|
|
115
|
+
/**
|
|
116
|
+
* Children
|
|
117
|
+
*/
|
|
118
|
+
children: React.ReactNode;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* I18nProvider - Provides translation context to children
|
|
122
|
+
*
|
|
123
|
+
* Features:
|
|
124
|
+
* - Self-contained i18n system, no external dependencies
|
|
125
|
+
* - Nested key resolution (e.g., 'welcome.title')
|
|
126
|
+
* - Parameter interpolation (e.g., 'Hello {{name}}')
|
|
127
|
+
* - Language persistence in localStorage
|
|
128
|
+
* - Auto-updates dir attribute on html
|
|
129
|
+
* - Triggers re-render of all consuming components on language change
|
|
130
|
+
*/
|
|
131
|
+
export declare const I18nProvider: React.FC<I18nProviderProps>;
|
|
132
|
+
/**
|
|
133
|
+
* useI18n - Hook for accessing i18n context
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```tsx
|
|
137
|
+
* const { t, language, setLanguage } = useI18n();
|
|
138
|
+
*
|
|
139
|
+
* // Translate a key
|
|
140
|
+
* <h1>{t('welcome.title')}</h1>
|
|
141
|
+
*
|
|
142
|
+
* // With parameters
|
|
143
|
+
* <p>{t('greeting', { name: user.name })}</p>
|
|
144
|
+
*
|
|
145
|
+
* // Change language
|
|
146
|
+
* <button onClick={() => setLanguage('fa')}>فارسی</button>
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
export declare const useI18n: () => I18nContextValue;
|
|
150
|
+
/**
|
|
151
|
+
* Dara UI LanguageChanger - Dropdown for switching between languages
|
|
152
|
+
*
|
|
153
|
+
* Features:
|
|
154
|
+
* - Auto-detects available languages from default list
|
|
155
|
+
* - Supports custom language lists
|
|
156
|
+
* - Clean dropdown with flag icons from Flagpedia CDN
|
|
157
|
+
* - Icon-only mode for compact navigation bars
|
|
158
|
+
* - Fixed width option for consistent sizing
|
|
159
|
+
* - Controlled or uncontrolled modes
|
|
160
|
+
* - Applies language via lang and dir attributes on html element
|
|
161
|
+
* - Persists language preference in localStorage
|
|
162
|
+
* - Size variants (sm, md, lg)
|
|
163
|
+
* - Dropdown is always centered under the trigger
|
|
164
|
+
* - Menu width matches the button when iconOnly or fixedWidth is used
|
|
165
|
+
* - All LanguageChanger instances sync through I18n context
|
|
166
|
+
*/
|
|
167
|
+
export declare const LanguageChanger: React.FC<LanguageChangerProps>;
|
|
168
|
+
export default LanguageChanger;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { LanguageChanger, I18nProvider, useI18n } from './LanguageChanger';
|
|
2
|
+
export type { LanguageChangerProps, LanguageOption, I18nContextValue, I18nProviderProps, } from './LanguageChanger';
|
|
3
|
+
export { DEFAULT_LANGUAGES } from './LanguageChanger';
|
|
4
|
+
export { LanguageChanger as default } from './LanguageChanger';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface ModalProps {
|
|
3
|
+
/**
|
|
4
|
+
* Whether the modal is open
|
|
5
|
+
* @default false
|
|
6
|
+
*/
|
|
7
|
+
isOpen: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Callback when modal closes
|
|
10
|
+
*/
|
|
11
|
+
onClose: () => void;
|
|
12
|
+
/**
|
|
13
|
+
* Modal title
|
|
14
|
+
*/
|
|
15
|
+
title?: React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Modal content
|
|
18
|
+
*/
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Modal size
|
|
22
|
+
* @default "md"
|
|
23
|
+
*/
|
|
24
|
+
size?: "sm" | "md" | "lg" | "xl";
|
|
25
|
+
/**
|
|
26
|
+
* Close on backdrop click
|
|
27
|
+
* @default true
|
|
28
|
+
*/
|
|
29
|
+
closeOnBackdropClick?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Close on Escape key
|
|
32
|
+
* @default true
|
|
33
|
+
*/
|
|
34
|
+
closeOnEscape?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Confirm button text
|
|
37
|
+
*/
|
|
38
|
+
confirmText?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Cancel button text
|
|
41
|
+
*/
|
|
42
|
+
cancelText?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Callback when confirm is clicked
|
|
45
|
+
*/
|
|
46
|
+
onConfirm?: () => void;
|
|
47
|
+
/**
|
|
48
|
+
* Additional className for modal content
|
|
49
|
+
*/
|
|
50
|
+
className?: string;
|
|
51
|
+
}
|
|
52
|
+
export declare const Modal: React.FC<ModalProps>;
|
|
53
|
+
export default Modal;
|