@vashu96/ui 0.0.3 → 0.0.7
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 +143 -9
- package/dist/Alert.d.ts +20 -0
- package/dist/Avatar.d.ts +16 -0
- package/dist/Badge.d.ts +7 -0
- package/dist/Breadcrumb.d.ts +24 -0
- package/dist/Button.d.ts +16 -0
- package/dist/Card.d.ts +11 -0
- package/dist/Checkbox.d.ts +10 -0
- package/dist/Command.d.ts +26 -0
- package/dist/ConfirmDialog.d.ts +34 -0
- package/dist/DataTable.d.ts +14 -0
- package/dist/Dialog.d.ts +29 -0
- package/dist/Dropdown.d.ts +21 -0
- package/dist/EmptyState.d.ts +15 -0
- package/dist/FormField.d.ts +22 -0
- package/dist/Input.d.ts +10 -0
- package/dist/Label.d.ts +13 -0
- package/dist/Pagination.d.ts +16 -0
- package/dist/Progress.d.ts +20 -0
- package/dist/SearchCommand.d.ts +3 -0
- package/dist/Select.d.ts +22 -0
- package/dist/Separator.d.ts +7 -0
- package/dist/Sheet.d.ts +32 -0
- package/dist/Sidebar.d.ts +43 -0
- package/dist/Skeleton.d.ts +13 -0
- package/dist/Slider.d.ts +10 -0
- package/dist/Spinner.d.ts +10 -0
- package/dist/SpotlightCard.d.ts +12 -0
- package/dist/Switch.d.ts +16 -0
- package/dist/TOC.d.ts +6 -0
- package/dist/Table.d.ts +18 -0
- package/dist/Tabs.d.ts +27 -0
- package/dist/Tag.d.ts +17 -0
- package/dist/Textarea.d.ts +11 -0
- package/dist/ThemeProvider.d.ts +20 -0
- package/dist/Toast.d.ts +19 -0
- package/dist/Tooltip.d.ts +14 -0
- package/dist/hooks/useDebounce.d.ts +8 -0
- package/dist/index.cjs +33 -2
- package/dist/index.d.ts +27 -22
- package/dist/index.js +2767 -2408
- package/dist/lib/cn.d.ts +4 -0
- package/dist/lib/colorScheme.d.ts +85 -0
- package/package.json +12 -7
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Vashu Chogada
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,21 +1,56 @@
|
|
|
1
1
|
# @vashu96/ui
|
|
2
2
|
|
|
3
|
-
**Crystal Flat Design System** — A collection of high-quality, glassmorphism-inspired React components.
|
|
3
|
+
**Crystal Flat Design System** — A collection of high-quality, glassmorphism-inspired React components. Built with React, TypeScript, and modern CSS.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Glassmorphism**: Beautiful, translucent UI elements.
|
|
8
|
+
- **Dynamic Theming**: Built-in support for light/dark modes and custom color schemes.
|
|
9
|
+
- **Accessible**: Follows WAI-ARIA patterns.
|
|
10
|
+
- **Type-Safe**: Written in TypeScript with full type definitions.
|
|
11
|
+
|
|
12
|
+
## Requirements
|
|
13
|
+
|
|
14
|
+
This library requires the following peer dependencies to be installed in your project:
|
|
15
|
+
|
|
16
|
+
- **React**: `^19.2.0`
|
|
17
|
+
- **React DOM**: `^19.2.0`
|
|
18
|
+
- **TanStack Table**: `^8.0.0` (Required for `DataTable` component)
|
|
4
19
|
|
|
5
20
|
## Installation
|
|
6
21
|
|
|
7
22
|
```bash
|
|
8
|
-
npm install @vashu96/ui
|
|
23
|
+
npm install @vashu96/ui @tanstack/react-table
|
|
9
24
|
```
|
|
10
25
|
|
|
26
|
+
Check our `package.json` for all dependencies.
|
|
27
|
+
|
|
11
28
|
## Setup
|
|
12
29
|
|
|
30
|
+
### 1. Import Styles
|
|
31
|
+
|
|
13
32
|
Import the global styles in your main entry point (e.g., `main.tsx` or `App.tsx`):
|
|
14
33
|
|
|
15
34
|
```tsx
|
|
16
35
|
import "@vashu96/ui/styles.css";
|
|
17
36
|
```
|
|
18
37
|
|
|
38
|
+
### 2. Wrap with ThemeProvider
|
|
39
|
+
|
|
40
|
+
To enable dynamic theming and utilizing the color system, wrap your application with the `ThemeProvider`:
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
import { ThemeProvider } from "@vashu96/ui";
|
|
44
|
+
|
|
45
|
+
function App() {
|
|
46
|
+
return (
|
|
47
|
+
<ThemeProvider defaultMode="system" storageKey="vashu-ui-theme">
|
|
48
|
+
<YourApp />
|
|
49
|
+
</ThemeProvider>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
19
54
|
## Usage
|
|
20
55
|
|
|
21
56
|
```tsx
|
|
@@ -37,15 +72,114 @@ function MyComponent() {
|
|
|
37
72
|
|
|
38
73
|
The library provides a comprehensive set of components:
|
|
39
74
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
75
|
+
### Layout
|
|
76
|
+
|
|
77
|
+
- `Card` - Versatile container with glass variants.
|
|
78
|
+
- `SpotlightCard` - Card with mouse-tracking spotlight effect.
|
|
79
|
+
- `Separator` - Visual divider.
|
|
80
|
+
- `Sheet` - Slide-out modal/drawer.
|
|
81
|
+
- `Sidebar` - Application sidebar navigation.
|
|
82
|
+
- `TOC` - Table of Contents for document navigation.
|
|
83
|
+
|
|
84
|
+
### Forms
|
|
85
|
+
|
|
86
|
+
- `Button` - Interactive button with multiple variants.
|
|
87
|
+
- `Input` - Text input field.
|
|
88
|
+
- `Textarea` - Multi-line text input.
|
|
89
|
+
- `Checkbox` - Selection control.
|
|
90
|
+
- `Switch` - Toggle switch.
|
|
91
|
+
- `Slider` - Range slider.
|
|
92
|
+
- `Select` - Dropdown selection.
|
|
93
|
+
- `FormField` - Wrapper for form controls with labels and error states.
|
|
94
|
+
- `Label` - Text label for form elements.
|
|
95
|
+
|
|
96
|
+
### Feedback
|
|
97
|
+
|
|
98
|
+
- `Badge` - Status indicator.
|
|
99
|
+
- `Alert` - Urgent information banner.
|
|
100
|
+
- `Toast` - Temporary notification.
|
|
101
|
+
- `Progress` - Progress bar.
|
|
102
|
+
- `Spinner` - Loading indicator.
|
|
103
|
+
- `Skeleton` - Loading placeholder.
|
|
104
|
+
- `EmptyState` - Placeholder for empty data sets.
|
|
105
|
+
|
|
106
|
+
### Overlay
|
|
107
|
+
|
|
108
|
+
- `Dialog` - Modal dialog window.
|
|
109
|
+
- `ConfirmDialog` - Pre-configured confirmation modal.
|
|
110
|
+
- `Tooltip` - Information popup on hover.
|
|
111
|
+
- `Dropdown` - Menu for actions or selection.
|
|
112
|
+
- `Command` - Command palette/menu.
|
|
113
|
+
- `SearchCommand` - Specialized search command interface.
|
|
114
|
+
|
|
115
|
+
### Navigation
|
|
116
|
+
|
|
117
|
+
- `Tabs` - Tabbed interface.
|
|
118
|
+
- `Breadcrumb` - Path navigation.
|
|
119
|
+
- `Pagination` - Page navigation for lists.
|
|
120
|
+
- `Tag` - Categorization tag.
|
|
121
|
+
|
|
122
|
+
### Data Display
|
|
123
|
+
|
|
124
|
+
- `Table` - Simple data table.
|
|
125
|
+
- `DataTable` - Advanced table with sorting, filtering, and pagination.
|
|
126
|
+
- `Avatar` - User profile image/initials.
|
|
127
|
+
|
|
128
|
+
## Theming System
|
|
129
|
+
|
|
130
|
+
The library includes a powerful dynamic theming system accessible via `useThemeContext`.
|
|
131
|
+
|
|
132
|
+
### ThemeProvider Props
|
|
133
|
+
|
|
134
|
+
| Prop | Type | Default | Description |
|
|
135
|
+
| -------------- | ------------------------------- | ---------------- | ---------------------------------------- |
|
|
136
|
+
| `defaultMode` | `'light' \| 'dark' \| 'system'` | `'system'` | Initial color mode. |
|
|
137
|
+
| `defaultColor` | `ColorSchemeInput` | `PRESETS.indigo` | Initial primary color. |
|
|
138
|
+
| `storageKey` | `string` | `'theme'` | Key to use for localStorage persistence. |
|
|
139
|
+
|
|
140
|
+
### Using the Context
|
|
141
|
+
|
|
142
|
+
You can control the theme programmatically using the `useThemeContext` hook:
|
|
143
|
+
|
|
144
|
+
```tsx
|
|
145
|
+
import { useThemeContext, PRESETS } from "@vashu96/ui";
|
|
146
|
+
|
|
147
|
+
function ThemeSwitcher() {
|
|
148
|
+
const { mode, setMode, setColors } = useThemeContext();
|
|
149
|
+
|
|
150
|
+
return (
|
|
151
|
+
<div>
|
|
152
|
+
<button onClick={() => setMode(mode === "dark" ? "light" : "dark")}>
|
|
153
|
+
Toggle Mode
|
|
154
|
+
</button>
|
|
155
|
+
<button onClick={() => setColors(PRESETS.rose)}>Set Rose Theme</button>
|
|
156
|
+
</div>
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Color Presets
|
|
162
|
+
|
|
163
|
+
Available presets via `PRESETS`:
|
|
164
|
+
`indigo`, `emerald`, `rose`, `amber`, `cyan`, `violet`, `sky`, `fuchsia`, `orange`, `teal`.
|
|
165
|
+
|
|
166
|
+
## Publishing
|
|
167
|
+
|
|
168
|
+
To publish a new version of the library to NPM, use the following commands:
|
|
169
|
+
|
|
170
|
+
- **Patch release**: `npm run release` or `npm run release:patch` (e.g., v0.0.1 -> v0.0.2)
|
|
171
|
+
- **Minor release**: `npm run release:minor` (e.g., v0.0.2 -> v0.1.0)
|
|
172
|
+
- **Major release**: `npm run release:major` (e.g., v0.1.0 -> v1.0.0)
|
|
173
|
+
|
|
174
|
+
These scripts will automatically:
|
|
45
175
|
|
|
46
|
-
|
|
176
|
+
1. Build the production bundle.
|
|
177
|
+
2. Increment the version in `package.json`.
|
|
178
|
+
3. Create a git tag for the new version.
|
|
179
|
+
4. Publish the package to NPM with public access.
|
|
47
180
|
|
|
48
|
-
|
|
181
|
+
> [!IMPORTANT]
|
|
182
|
+
> Ensure you are logged into NPM (`npm login`) and have a clean git working directory before running these commands.
|
|
49
183
|
|
|
50
184
|
## License
|
|
51
185
|
|
package/dist/Alert.d.ts
CHANGED
|
@@ -1,12 +1,32 @@
|
|
|
1
1
|
import { ReactNode, HTMLAttributes } from 'react';
|
|
2
2
|
type AlertVariant = "info" | "success" | "warning" | "danger";
|
|
3
3
|
interface AlertProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/**
|
|
5
|
+
* The visual style of the alert.
|
|
6
|
+
* @default "info"
|
|
7
|
+
*/
|
|
4
8
|
variant?: AlertVariant;
|
|
9
|
+
/**
|
|
10
|
+
* Optional title for the alert.
|
|
11
|
+
*/
|
|
5
12
|
title?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Custom icon. If not provided, a default icon is used based on the variant.
|
|
15
|
+
*/
|
|
6
16
|
icon?: ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the alert can be dismissed.
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
7
21
|
dismissible?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Callback when the alert is dismissed.
|
|
24
|
+
*/
|
|
8
25
|
onDismiss?: () => void;
|
|
9
26
|
children?: ReactNode;
|
|
10
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Alert component for displaying messages.
|
|
30
|
+
*/
|
|
11
31
|
declare const Alert: import('react').ForwardRefExoticComponent<AlertProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
12
32
|
export { Alert, type AlertProps, type AlertVariant };
|
package/dist/Avatar.d.ts
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
type AvatarSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
3
3
|
interface AvatarProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Image source URL.
|
|
6
|
+
*/
|
|
4
7
|
src?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Alt text for the image. Also used for fallback initials if `fallback` is not provided.
|
|
10
|
+
*/
|
|
5
11
|
alt?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Explicit fallback text (e.g. initials).
|
|
14
|
+
*/
|
|
6
15
|
fallback?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Size of the avatar.
|
|
18
|
+
* @default "md"
|
|
19
|
+
*/
|
|
7
20
|
size?: AvatarSize;
|
|
8
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Avatar component with image and fallback support.
|
|
24
|
+
*/
|
|
9
25
|
declare const Avatar: import('react').ForwardRefExoticComponent<AvatarProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
10
26
|
export { Avatar, type AvatarProps, type AvatarSize };
|
package/dist/Badge.d.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
type BadgeVariant = "default" | "success" | "warning" | "danger" | "info";
|
|
3
3
|
interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4
|
+
/**
|
|
5
|
+
* The visual style of the badge.
|
|
6
|
+
* @default "default"
|
|
7
|
+
*/
|
|
4
8
|
variant?: BadgeVariant;
|
|
5
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Small count and labeling component.
|
|
12
|
+
*/
|
|
6
13
|
declare const Badge: import('react').ForwardRefExoticComponent<BadgeProps & import('react').RefAttributes<HTMLSpanElement>>;
|
|
7
14
|
export { Badge, type BadgeProps, type BadgeVariant };
|
package/dist/Breadcrumb.d.ts
CHANGED
|
@@ -1,13 +1,37 @@
|
|
|
1
1
|
import { ReactNode, HTMLAttributes } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Breadcrumb navigation container.
|
|
4
|
+
*/
|
|
2
5
|
declare const Breadcrumb: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & import('react').RefAttributes<HTMLElement>>;
|
|
6
|
+
/**
|
|
7
|
+
* Ordered list container for breadcrumb items.
|
|
8
|
+
*/
|
|
3
9
|
declare const BreadcrumbList: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLOListElement> & import('react').RefAttributes<HTMLOListElement>>;
|
|
10
|
+
/**
|
|
11
|
+
* Individual item in the breadcrumb list.
|
|
12
|
+
*/
|
|
4
13
|
declare const BreadcrumbItem: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLLIElement> & import('react').RefAttributes<HTMLLIElement>>;
|
|
5
14
|
interface BreadcrumbLinkProps extends HTMLAttributes<HTMLAnchorElement> {
|
|
15
|
+
/**
|
|
16
|
+
* Link URL.
|
|
17
|
+
*/
|
|
6
18
|
href?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the link is active/hovered.
|
|
21
|
+
*/
|
|
7
22
|
active?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Whether this is the current page. Rendering as a span instead of a link.
|
|
25
|
+
*/
|
|
8
26
|
isCurrent?: boolean;
|
|
9
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Navigation link or current page indicator.
|
|
30
|
+
*/
|
|
10
31
|
declare const BreadcrumbLink: import('react').ForwardRefExoticComponent<BreadcrumbLinkProps & import('react').RefAttributes<HTMLAnchorElement>>;
|
|
32
|
+
/**
|
|
33
|
+
* Visual separator between breadcrumb items.
|
|
34
|
+
*/
|
|
11
35
|
declare function BreadcrumbSeparator({ children, className, }: {
|
|
12
36
|
children?: ReactNode;
|
|
13
37
|
className?: string;
|
package/dist/Button.d.ts
CHANGED
|
@@ -2,9 +2,25 @@ import { ButtonHTMLAttributes } from 'react';
|
|
|
2
2
|
type ButtonVariant = "primary" | "secondary" | "ghost" | "danger";
|
|
3
3
|
type ButtonSize = "sm" | "md" | "lg";
|
|
4
4
|
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
|
+
/**
|
|
6
|
+
* The visual style of the button.
|
|
7
|
+
* @default "primary"
|
|
8
|
+
*/
|
|
5
9
|
variant?: ButtonVariant;
|
|
10
|
+
/**
|
|
11
|
+
* The size of the button.
|
|
12
|
+
* @default "md"
|
|
13
|
+
*/
|
|
6
14
|
size?: ButtonSize;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the button is in a loading state.
|
|
17
|
+
* Disables the button and shows a spinner.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
7
20
|
loading?: boolean;
|
|
8
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Interactive button component with support for multiple variants, sizes, and loading states.
|
|
24
|
+
*/
|
|
9
25
|
declare const Button: import('react').ForwardRefExoticComponent<ButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
10
26
|
export { Button, type ButtonProps, type ButtonVariant, type ButtonSize };
|
package/dist/Card.d.ts
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
type CardVariant = "glass" | "solid" | "outline";
|
|
3
3
|
interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/**
|
|
5
|
+
* The visual style of the card.
|
|
6
|
+
* @default "glass"
|
|
7
|
+
*/
|
|
4
8
|
variant?: CardVariant;
|
|
9
|
+
/**
|
|
10
|
+
* Padding size for the card content.
|
|
11
|
+
* @default "md"
|
|
12
|
+
*/
|
|
5
13
|
padding?: "none" | "sm" | "md" | "lg";
|
|
6
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Versatile container component with multiple visual variants and padding options.
|
|
17
|
+
*/
|
|
7
18
|
declare const Card: import('react').ForwardRefExoticComponent<CardProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
8
19
|
export { Card, type CardProps, type CardVariant };
|
package/dist/Checkbox.d.ts
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import { InputHTMLAttributes } from 'react';
|
|
2
2
|
interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
3
|
+
/**
|
|
4
|
+
* Label text to align with the checkbox.
|
|
5
|
+
*/
|
|
3
6
|
label?: string;
|
|
7
|
+
/**
|
|
8
|
+
* If true, the checkbox appears in an indeterminate state.
|
|
9
|
+
* Useful for "select all" scenarios.
|
|
10
|
+
*/
|
|
4
11
|
indeterminate?: boolean;
|
|
5
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Checkbox component with support for indeterminate state and labels.
|
|
15
|
+
*/
|
|
6
16
|
declare const Checkbox: import('react').ForwardRefExoticComponent<CheckboxProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
7
17
|
export { Checkbox, type CheckboxProps };
|
package/dist/Command.d.ts
CHANGED
|
@@ -9,13 +9,39 @@ interface CommandItem {
|
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
}
|
|
11
11
|
interface CommandProps {
|
|
12
|
+
/**
|
|
13
|
+
* Whether the command palette is open.
|
|
14
|
+
*/
|
|
12
15
|
open: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Callback to close the command palette.
|
|
18
|
+
*/
|
|
13
19
|
onClose: () => void;
|
|
20
|
+
/**
|
|
21
|
+
* List of items to search/display.
|
|
22
|
+
*/
|
|
14
23
|
items: CommandItem[];
|
|
24
|
+
/**
|
|
25
|
+
* Placeholder text for the input.
|
|
26
|
+
* @default "Type a command or search…"
|
|
27
|
+
*/
|
|
15
28
|
placeholder?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Message to display when no results are found.
|
|
31
|
+
* @default "No results found."
|
|
32
|
+
*/
|
|
16
33
|
emptyMessage?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Whether the results are loading.
|
|
36
|
+
*/
|
|
17
37
|
loading?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Callback for query changes (if handling filtering externally).
|
|
40
|
+
*/
|
|
18
41
|
onQueryChange?: (query: string) => void;
|
|
19
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Command palette component (Cmd+K style).
|
|
45
|
+
*/
|
|
20
46
|
declare function Command({ open, onClose, items, placeholder, emptyMessage, loading, onQueryChange, }: CommandProps): import('react').ReactPortal | null;
|
|
21
47
|
export { Command, type CommandProps, type CommandItem };
|
package/dist/ConfirmDialog.d.ts
CHANGED
|
@@ -1,13 +1,47 @@
|
|
|
1
1
|
interface ConfirmDialogProps {
|
|
2
|
+
/**
|
|
3
|
+
* Whether the dialog is open.
|
|
4
|
+
*/
|
|
2
5
|
open: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Callback to close the dialog.
|
|
8
|
+
*/
|
|
3
9
|
onClose: () => void;
|
|
10
|
+
/**
|
|
11
|
+
* Callback when the confirm button is clicked.
|
|
12
|
+
*/
|
|
4
13
|
onConfirm: () => void | Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Title of the confirmation dialog.
|
|
16
|
+
*/
|
|
5
17
|
title: string;
|
|
18
|
+
/**
|
|
19
|
+
* Description of the confirmation action.
|
|
20
|
+
*/
|
|
6
21
|
description: string;
|
|
22
|
+
/**
|
|
23
|
+
* Text for the confirm button.
|
|
24
|
+
* @default "Confirm"
|
|
25
|
+
*/
|
|
7
26
|
confirmText?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Text for the cancel button.
|
|
29
|
+
* @default "Cancel"
|
|
30
|
+
*/
|
|
8
31
|
cancelText?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Visual variant of the confirm button.
|
|
34
|
+
* @default "default"
|
|
35
|
+
*/
|
|
9
36
|
variant?: "danger" | "default";
|
|
37
|
+
/**
|
|
38
|
+
* Whether the confirm action is loading.
|
|
39
|
+
* @default false
|
|
40
|
+
*/
|
|
10
41
|
loading?: boolean;
|
|
11
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* A pre-composed Dialog for confirmation actions.
|
|
45
|
+
*/
|
|
12
46
|
export declare function ConfirmDialog({ open, onClose, onConfirm, title, description, confirmText, cancelText, variant, loading, }: ConfirmDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
13
47
|
export {};
|
package/dist/DataTable.d.ts
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
import { ColumnDef, Column } from '@tanstack/react-table';
|
|
2
2
|
interface DataTableProps<TData, TValue> {
|
|
3
|
+
/**
|
|
4
|
+
* Column definitions for the table.
|
|
5
|
+
*/
|
|
3
6
|
columns: ColumnDef<TData, TValue>[];
|
|
7
|
+
/**
|
|
8
|
+
* Data array to display.
|
|
9
|
+
*/
|
|
4
10
|
data: TData[];
|
|
11
|
+
/**
|
|
12
|
+
* Placeholder text for the global search input.
|
|
13
|
+
* @default "Search..."
|
|
14
|
+
*/
|
|
5
15
|
searchPlaceholder?: string;
|
|
6
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Advanced data table with sorting, filtering, selection, and pagination.
|
|
19
|
+
* Built on top of TanStack Table.
|
|
20
|
+
*/
|
|
7
21
|
export declare function DataTable<TData, TValue>({ columns, data, searchPlaceholder, }: DataTableProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
|
|
8
22
|
export declare function DataTableColumnHeader<TData, TValue>({ column, title, }: {
|
|
9
23
|
column: Column<TData, TValue>;
|
package/dist/Dialog.d.ts
CHANGED
|
@@ -1,15 +1,44 @@
|
|
|
1
1
|
import { ReactNode, HTMLAttributes } from 'react';
|
|
2
2
|
type DialogSize = "sm" | "md" | "lg";
|
|
3
3
|
interface DialogProps {
|
|
4
|
+
/**
|
|
5
|
+
* Whether the dialog is open.
|
|
6
|
+
*/
|
|
4
7
|
open: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Callback to close the dialog.
|
|
10
|
+
*/
|
|
5
11
|
onClose: () => void;
|
|
12
|
+
/**
|
|
13
|
+
* Size of the dialog.
|
|
14
|
+
* @default "md"
|
|
15
|
+
*/
|
|
6
16
|
size?: DialogSize;
|
|
7
17
|
children: ReactNode;
|
|
8
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Modal dialog component.
|
|
21
|
+
* Uses native <dialog> element.
|
|
22
|
+
*/
|
|
9
23
|
declare function Dialog({ open, onClose, size, children }: DialogProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
/**
|
|
25
|
+
* Header section for the Dialog.
|
|
26
|
+
*/
|
|
10
27
|
declare const DialogHeader: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
28
|
+
/**
|
|
29
|
+
* Footer section for the Dialog.
|
|
30
|
+
*/
|
|
11
31
|
declare const DialogFooter: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
32
|
+
/**
|
|
33
|
+
* Title element for the Dialog.
|
|
34
|
+
*/
|
|
12
35
|
declare const DialogTitle: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLHeadingElement> & import('react').RefAttributes<HTMLHeadingElement>>;
|
|
36
|
+
/**
|
|
37
|
+
* Description element for the Dialog.
|
|
38
|
+
*/
|
|
13
39
|
declare const DialogDescription: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
40
|
+
/**
|
|
41
|
+
* Close button for the Dialog.
|
|
42
|
+
*/
|
|
14
43
|
declare function DialogClose({ children, className, ...props }: HTMLAttributes<HTMLButtonElement>): import("react/jsx-runtime").JSX.Element;
|
|
15
44
|
export { Dialog, DialogHeader, DialogFooter, DialogTitle, DialogDescription, DialogClose, type DialogProps, type DialogSize, };
|
package/dist/Dropdown.d.ts
CHANGED
|
@@ -2,16 +2,37 @@ import { ReactNode, HTMLAttributes } from 'react';
|
|
|
2
2
|
interface DropdownProps {
|
|
3
3
|
children: ReactNode;
|
|
4
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* Dropdown menu container.
|
|
7
|
+
* Manages open/close state.
|
|
8
|
+
*/
|
|
5
9
|
declare function Dropdown({ children }: DropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
/**
|
|
11
|
+
* Trigger button for the Dropdown.
|
|
12
|
+
*/
|
|
6
13
|
declare const DropdownTrigger: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLButtonElement> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
7
14
|
interface DropdownMenuProps extends HTMLAttributes<HTMLDivElement> {
|
|
15
|
+
/**
|
|
16
|
+
* Alignment of the menu relative to the trigger.
|
|
17
|
+
* @default "left"
|
|
18
|
+
*/
|
|
8
19
|
align?: "left" | "right";
|
|
9
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Content container for the Dropdown.
|
|
23
|
+
* Uses a portal to render outside the DOM hierarchy.
|
|
24
|
+
*/
|
|
10
25
|
declare function DropdownMenu({ align, className, children, ...props }: DropdownMenuProps): import('react').ReactPortal | null;
|
|
11
26
|
interface DropdownItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
12
27
|
disabled?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Whether the item represents a destructive action.
|
|
30
|
+
*/
|
|
13
31
|
destructive?: boolean;
|
|
14
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Individual interactive item in a DropdownMenu.
|
|
35
|
+
*/
|
|
15
36
|
declare const DropdownItem: import('react').ForwardRefExoticComponent<DropdownItemProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
16
37
|
declare function DropdownSeparator({ className }: {
|
|
17
38
|
className?: string;
|
package/dist/EmptyState.d.ts
CHANGED
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
interface EmptyStateProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Icon or illustration to display.
|
|
5
|
+
*/
|
|
3
6
|
icon?: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Main title text.
|
|
9
|
+
*/
|
|
4
10
|
title: string;
|
|
11
|
+
/**
|
|
12
|
+
* Helper description text.
|
|
13
|
+
*/
|
|
5
14
|
description?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Optional action button or link.
|
|
17
|
+
*/
|
|
6
18
|
action?: ReactNode;
|
|
7
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Component for displaying empty states with an optional action.
|
|
22
|
+
*/
|
|
8
23
|
declare const EmptyState: import('react').ForwardRefExoticComponent<EmptyStateProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
9
24
|
export { EmptyState, type EmptyStateProps };
|
package/dist/FormField.d.ts
CHANGED
|
@@ -1,11 +1,33 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
interface FormFieldProps {
|
|
3
|
+
/**
|
|
4
|
+
* Label text for the field.
|
|
5
|
+
*/
|
|
3
6
|
label?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Error message or boolean indicating error state.
|
|
9
|
+
*/
|
|
4
10
|
error?: string | boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Helper text description.
|
|
13
|
+
*/
|
|
5
14
|
description?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The form control element (Input, Select, etc.).
|
|
17
|
+
*/
|
|
6
18
|
children: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Additional CSS classes.
|
|
21
|
+
*/
|
|
7
22
|
className?: string;
|
|
23
|
+
/**
|
|
24
|
+
* ID of the element the label is bound to.
|
|
25
|
+
* If not provided, a unique ID is generated.
|
|
26
|
+
*/
|
|
8
27
|
htmlFor?: string;
|
|
9
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Wrapper component for form controls that handles labels, error messages, and descriptions.
|
|
31
|
+
*/
|
|
10
32
|
export declare function FormField({ label, error, description, children, className, htmlFor, }: FormFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
11
33
|
export {};
|
package/dist/Input.d.ts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { InputHTMLAttributes } from 'react';
|
|
2
2
|
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Error message to display below the input.
|
|
5
|
+
* If provided, the input border will turn red.
|
|
6
|
+
*/
|
|
3
7
|
error?: string;
|
|
4
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Text input component with built-in error handling and consistent styling.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <Input placeholder="Enter your name" error={errors.name} />
|
|
14
|
+
*/
|
|
5
15
|
declare const Input: import('react').ForwardRefExoticComponent<InputProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
6
16
|
export { Input, type InputProps };
|
package/dist/Label.d.ts
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
import { LabelHTMLAttributes } from 'react';
|
|
2
2
|
interface LabelProps extends LabelHTMLAttributes<HTMLLabelElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Whether the field is required.
|
|
5
|
+
* Adds an asterisk or other indicator.
|
|
6
|
+
* @default false
|
|
7
|
+
*/
|
|
3
8
|
required?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Whether the associated field has an error.
|
|
11
|
+
* Changes the label color to danger.
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
4
14
|
error?: boolean;
|
|
5
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Text label component for form inputs.
|
|
18
|
+
*/
|
|
6
19
|
declare const Label: import('react').ForwardRefExoticComponent<LabelProps & import('react').RefAttributes<HTMLLabelElement>>;
|
|
7
20
|
export { Label, type LabelProps };
|