@northslopetech/altitude-ui 1.1.0 → 1.5.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 +115 -16
- package/dist/index.d.mts +71 -18
- package/dist/index.d.ts +71 -18
- package/dist/index.js +852 -192
- package/dist/index.mjs +838 -184
- package/package.json +16 -17
- package/dist/tokens.css +0 -121
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @northslopetech/altitude-ui
|
|
2
2
|
|
|
3
3
|
React UI components for the Altitude design system, built on top of [shadcn/ui](https://ui.shadcn.com/) and styled with Altitude design tokens.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install @
|
|
8
|
+
npm install @northslopetech/altitude-ui
|
|
9
9
|
# or
|
|
10
|
-
pnpm add @
|
|
10
|
+
pnpm add @northslopetech/altitude-ui
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
## Architecture
|
|
@@ -18,10 +18,21 @@ This package combines the best of both worlds:
|
|
|
18
18
|
- **Altitude Design Tokens**: Replaces shadcn/ui's default colors and typography with our design system
|
|
19
19
|
|
|
20
20
|
Components are built using:
|
|
21
|
+
|
|
21
22
|
- **Radix UI**: For accessibility and behavior
|
|
22
23
|
- **class-variance-authority**: For type-safe variant management
|
|
23
24
|
- **Tailwind CSS**: For styling with Altitude design tokens
|
|
24
25
|
|
|
26
|
+
## Available Components
|
|
27
|
+
|
|
28
|
+
This package includes the following components:
|
|
29
|
+
|
|
30
|
+
- **Button** - Interactive button component with multiple variants and sizes
|
|
31
|
+
- **Select** - Dropdown selection component with search capabilities
|
|
32
|
+
- **DatePicker** - Date selection component with calendar popup
|
|
33
|
+
- **FormField** - Form field wrapper with label and error handling
|
|
34
|
+
- **Typography** - Text components with design system typography tokens
|
|
35
|
+
|
|
25
36
|
## Usage
|
|
26
37
|
|
|
27
38
|
### Button
|
|
@@ -29,21 +40,21 @@ Components are built using:
|
|
|
29
40
|
The Button component is built on shadcn/ui's Button but styled with Altitude design tokens.
|
|
30
41
|
|
|
31
42
|
```tsx
|
|
32
|
-
import { Button } from
|
|
43
|
+
import { Button } from "@northslopetech/altitude-ui";
|
|
33
44
|
|
|
34
45
|
function Example() {
|
|
35
46
|
return (
|
|
36
47
|
<div className="flex gap-2 flex-wrap">
|
|
37
48
|
{/* Default variant */}
|
|
38
49
|
<Button>Primary Button</Button>
|
|
39
|
-
|
|
50
|
+
|
|
40
51
|
{/* Other variants */}
|
|
41
52
|
<Button variant="secondary">Secondary</Button>
|
|
42
53
|
<Button variant="outline">Outline</Button>
|
|
43
54
|
<Button variant="ghost">Ghost</Button>
|
|
44
55
|
<Button variant="link">Link</Button>
|
|
45
56
|
<Button variant="destructive">Destructive</Button>
|
|
46
|
-
|
|
57
|
+
|
|
47
58
|
{/* Different sizes */}
|
|
48
59
|
<Button size="sm">Small</Button>
|
|
49
60
|
<Button size="lg">Large</Button>
|
|
@@ -56,11 +67,11 @@ function Example() {
|
|
|
56
67
|
|
|
57
68
|
#### Button Props
|
|
58
69
|
|
|
59
|
-
| Prop
|
|
60
|
-
|
|
61
|
-
| `variant` | `'default' \| 'secondary' \| 'outline' \| 'ghost' \| 'link' \| 'destructive'` | `'default'` | Visual style variant
|
|
62
|
-
| `size`
|
|
63
|
-
| `asChild` | `boolean`
|
|
70
|
+
| Prop | Type | Default | Description |
|
|
71
|
+
| --------- | ----------------------------------------------------------------------------- | ----------- | ----------------------------------------- |
|
|
72
|
+
| `variant` | `'default' \| 'secondary' \| 'outline' \| 'ghost' \| 'link' \| 'destructive'` | `'default'` | Visual style variant |
|
|
73
|
+
| `size` | `'sm' \| 'default' \| 'lg' \| 'xl' \| 'icon'` | `'default'` | Size of the button |
|
|
74
|
+
| `asChild` | `boolean` | `false` | Render as child element (for composition) |
|
|
64
75
|
|
|
65
76
|
All standard HTML button attributes are also supported.
|
|
66
77
|
|
|
@@ -78,12 +89,12 @@ The Button component uses Altitude design tokens:
|
|
|
78
89
|
Use the `asChild` prop for composition with other components (powered by Radix UI Slot):
|
|
79
90
|
|
|
80
91
|
```tsx
|
|
81
|
-
import { Button } from
|
|
82
|
-
import Link from
|
|
92
|
+
import { Button } from "@northslopetech/altitude-ui";
|
|
93
|
+
import Link from "next/link";
|
|
83
94
|
|
|
84
95
|
<Button asChild>
|
|
85
96
|
<Link href="/dashboard">Go to Dashboard</Link>
|
|
86
|
-
</Button
|
|
97
|
+
</Button>;
|
|
87
98
|
```
|
|
88
99
|
|
|
89
100
|
## shadcn/ui Integration
|
|
@@ -97,11 +108,22 @@ This package is configured to work with shadcn/ui:
|
|
|
97
108
|
|
|
98
109
|
## Development
|
|
99
110
|
|
|
111
|
+
### Prerequisites
|
|
112
|
+
|
|
113
|
+
This package depends on design tokens. Before development, ensure tokens are built:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
# From the root directory
|
|
117
|
+
pnpm tokens:build
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Commands
|
|
121
|
+
|
|
100
122
|
```bash
|
|
101
123
|
# Build the package
|
|
102
124
|
pnpm build
|
|
103
125
|
|
|
104
|
-
# Watch for changes
|
|
126
|
+
# Watch for changes (tokens must be built first)
|
|
105
127
|
pnpm dev
|
|
106
128
|
|
|
107
129
|
# Run linting
|
|
@@ -114,6 +136,8 @@ pnpm check-types
|
|
|
114
136
|
npx shadcn@latest add [component-name]
|
|
115
137
|
```
|
|
116
138
|
|
|
139
|
+
> **Note**: The package includes a prebuild script that automatically builds tokens, but for development mode you should build tokens manually first.
|
|
140
|
+
|
|
117
141
|
## Adding New Components
|
|
118
142
|
|
|
119
143
|
To add more shadcn/ui components:
|
|
@@ -121,4 +145,79 @@ To add more shadcn/ui components:
|
|
|
121
145
|
1. Run `npx shadcn@latest add [component-name]`
|
|
122
146
|
2. Update the generated component to use Altitude design tokens
|
|
123
147
|
3. Export the component from `src/index.ts`
|
|
124
|
-
4. Update this README with usage examples
|
|
148
|
+
4. Update this README with usage examples
|
|
149
|
+
|
|
150
|
+
### Select
|
|
151
|
+
|
|
152
|
+
A dropdown selection component with built-in search and filtering:
|
|
153
|
+
|
|
154
|
+
```tsx
|
|
155
|
+
import { Select } from "@northslopetech/altitude-ui";
|
|
156
|
+
|
|
157
|
+
const options = [
|
|
158
|
+
{ value: "apple", label: "Apple" },
|
|
159
|
+
{ value: "banana", label: "Banana" },
|
|
160
|
+
{ value: "orange", label: "Orange" },
|
|
161
|
+
];
|
|
162
|
+
|
|
163
|
+
function Example() {
|
|
164
|
+
return (
|
|
165
|
+
<Select
|
|
166
|
+
placeholder="Select a fruit..."
|
|
167
|
+
options={options}
|
|
168
|
+
onValueChange={(value) => console.log(value)}
|
|
169
|
+
/>
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### DatePicker
|
|
175
|
+
|
|
176
|
+
A date selection component with calendar popup:
|
|
177
|
+
|
|
178
|
+
```tsx
|
|
179
|
+
import { DatePicker } from "@northslopetech/altitude-ui";
|
|
180
|
+
|
|
181
|
+
function Example() {
|
|
182
|
+
const [date, setDate] = useState<Date>();
|
|
183
|
+
|
|
184
|
+
return (
|
|
185
|
+
<DatePicker selected={date} onSelect={setDate} placeholder="Pick a date" />
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### FormField
|
|
191
|
+
|
|
192
|
+
A form field wrapper that provides consistent styling and error handling:
|
|
193
|
+
|
|
194
|
+
```tsx
|
|
195
|
+
import { FormField, Input } from "@northslopetech/altitude-ui";
|
|
196
|
+
|
|
197
|
+
function Example() {
|
|
198
|
+
return (
|
|
199
|
+
<FormField label="Email Address" error="Please enter a valid email">
|
|
200
|
+
<Input type="email" placeholder="Enter your email" />
|
|
201
|
+
</FormField>
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Typography
|
|
207
|
+
|
|
208
|
+
Pre-styled text components using design system typography tokens:
|
|
209
|
+
|
|
210
|
+
```tsx
|
|
211
|
+
import { Typography } from "@northslopetech/altitude-ui";
|
|
212
|
+
|
|
213
|
+
function Example() {
|
|
214
|
+
return (
|
|
215
|
+
<div>
|
|
216
|
+
<Typography variant="display-xl">Large Display Text</Typography>
|
|
217
|
+
<Typography variant="heading-lg">Section Heading</Typography>
|
|
218
|
+
<Typography variant="body-md">Body paragraph text</Typography>
|
|
219
|
+
<Typography variant="label-sm-bold">Form Label</Typography>
|
|
220
|
+
</div>
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
```
|
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import { JSX } from 'react';
|
|
3
4
|
import { VariantProps } from 'class-variance-authority';
|
|
4
5
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
5
6
|
|
|
7
|
+
declare enum ButtonSize {
|
|
8
|
+
Small = "sm",
|
|
9
|
+
Default = "default",
|
|
10
|
+
Large = "lg",
|
|
11
|
+
Icon = "icon"
|
|
12
|
+
}
|
|
6
13
|
declare const buttonVariants: (props?: ({
|
|
7
14
|
variant?: "default" | "outline" | "destructive" | "destructive-subtle" | "ghost" | "link" | null | undefined;
|
|
8
|
-
size?:
|
|
15
|
+
size?: ButtonSize | null | undefined;
|
|
9
16
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
17
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
11
18
|
asChild?: boolean;
|
|
@@ -34,41 +41,87 @@ interface SelectTriggerProps extends React.ComponentPropsWithoutRef<typeof Selec
|
|
|
34
41
|
declare const SelectTrigger: React.ForwardRefExoticComponent<SelectTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
35
42
|
declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
36
43
|
declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
37
|
-
interface SelectContentProps extends Omit<React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>,
|
|
44
|
+
interface SelectContentProps extends Omit<React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>, "position">, VariantProps<typeof selectContentVariants> {
|
|
38
45
|
}
|
|
39
46
|
declare const SelectContent: React.ForwardRefExoticComponent<SelectContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
40
47
|
declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
41
48
|
declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
42
49
|
declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
43
50
|
|
|
51
|
+
interface FormFieldProps {
|
|
52
|
+
label?: string;
|
|
53
|
+
helperText?: string;
|
|
54
|
+
error?: boolean;
|
|
55
|
+
required?: boolean;
|
|
56
|
+
children: React.ReactNode;
|
|
57
|
+
className?: string;
|
|
58
|
+
id?: string;
|
|
59
|
+
compact?: boolean;
|
|
60
|
+
}
|
|
61
|
+
declare const FormField: React.ForwardRefExoticComponent<FormFieldProps & React.RefAttributes<HTMLDivElement>>;
|
|
62
|
+
|
|
63
|
+
declare const datePickerTriggerVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
|
|
64
|
+
interface DatePickerProps {
|
|
65
|
+
value?: Date;
|
|
66
|
+
onValueChange?: (date: Date | undefined) => void;
|
|
67
|
+
defaultValue?: Date | string | number;
|
|
68
|
+
disabled?: boolean;
|
|
69
|
+
placeholder?: string;
|
|
70
|
+
className?: string;
|
|
71
|
+
}
|
|
72
|
+
declare const DatePicker: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
73
|
+
|
|
74
|
+
declare enum UploadState {
|
|
75
|
+
Default = "default",
|
|
76
|
+
DragOver = "dragOver",
|
|
77
|
+
Error = "error",
|
|
78
|
+
Uploading = "uploading",
|
|
79
|
+
Success = "success"
|
|
80
|
+
}
|
|
81
|
+
declare const uploadVariants: (props?: ({
|
|
82
|
+
state?: "default" | "error" | "dragOver" | "uploading" | "success" | null | undefined;
|
|
83
|
+
disabled?: boolean | null | undefined;
|
|
84
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
85
|
+
interface UploadProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onError"> {
|
|
86
|
+
endpoint?: string;
|
|
87
|
+
onFileSelect?: (files: File[]) => void;
|
|
88
|
+
onUploadProgress?: (progress: number) => void;
|
|
89
|
+
onUploadError?: (error: string) => void;
|
|
90
|
+
onUploadComplete?: (files: File[]) => void;
|
|
91
|
+
onUploadSuccess?: (response: unknown) => void;
|
|
92
|
+
maxFileSize?: number;
|
|
93
|
+
acceptedFileTypes?: string[];
|
|
94
|
+
disabled?: boolean;
|
|
95
|
+
state?: UploadState;
|
|
96
|
+
progress?: number;
|
|
97
|
+
errorMessage?: string;
|
|
98
|
+
loading?: boolean;
|
|
99
|
+
}
|
|
100
|
+
declare const Upload: React.ForwardRefExoticComponent<UploadProps & React.RefAttributes<HTMLDivElement>>;
|
|
101
|
+
|
|
44
102
|
declare const inputVariants: (props?: ({
|
|
45
103
|
variant?: "textarea" | "input" | null | undefined;
|
|
46
104
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
47
|
-
type InputElement = HTMLInputElement | HTMLTextAreaElement;
|
|
48
105
|
interface BaseInputProps extends VariantProps<typeof inputVariants> {
|
|
49
106
|
className?: string;
|
|
50
107
|
style?: React.CSSProperties;
|
|
51
108
|
onClear?: () => void;
|
|
52
109
|
}
|
|
53
|
-
interface InputFieldProps extends BaseInputProps, Omit<React.InputHTMLAttributes<HTMLInputElement>,
|
|
110
|
+
interface InputFieldProps extends BaseInputProps, Omit<React.InputHTMLAttributes<HTMLInputElement>, "style"> {
|
|
54
111
|
variant?: "input";
|
|
55
112
|
}
|
|
56
|
-
interface TextareaFieldProps extends BaseInputProps, Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>,
|
|
113
|
+
interface TextareaFieldProps extends BaseInputProps, Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "style"> {
|
|
57
114
|
variant: "textarea";
|
|
58
115
|
}
|
|
59
116
|
type InputProps = InputFieldProps | TextareaFieldProps;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
children: React.ReactNode;
|
|
68
|
-
className?: string;
|
|
69
|
-
id?: string;
|
|
70
|
-
compact?: boolean;
|
|
117
|
+
interface InputComponent {
|
|
118
|
+
(props: InputFieldProps & {
|
|
119
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
120
|
+
}): JSX.Element;
|
|
121
|
+
(props: TextareaFieldProps & {
|
|
122
|
+
ref?: React.Ref<HTMLTextAreaElement>;
|
|
123
|
+
}): JSX.Element;
|
|
71
124
|
}
|
|
72
|
-
declare const
|
|
125
|
+
declare const TypedInput: InputComponent;
|
|
73
126
|
|
|
74
|
-
export { Button, type ButtonProps, FormField, type FormFieldProps, Input, type InputFieldProps, type InputProps, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, type TextareaFieldProps, Typography, type TypographyProps, buttonVariants, inputVariants, selectTriggerVariants, typographyVariants };
|
|
127
|
+
export { Button, type ButtonProps, ButtonSize, DatePicker, type DatePickerProps, FormField, type FormFieldProps, TypedInput as Input, type InputFieldProps, type InputProps, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, type TextareaFieldProps, Typography, type TypographyProps, Upload, type UploadProps, UploadState, buttonVariants, datePickerTriggerVariants, inputVariants, selectTriggerVariants, typographyVariants, uploadVariants };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import { JSX } from 'react';
|
|
3
4
|
import { VariantProps } from 'class-variance-authority';
|
|
4
5
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
5
6
|
|
|
7
|
+
declare enum ButtonSize {
|
|
8
|
+
Small = "sm",
|
|
9
|
+
Default = "default",
|
|
10
|
+
Large = "lg",
|
|
11
|
+
Icon = "icon"
|
|
12
|
+
}
|
|
6
13
|
declare const buttonVariants: (props?: ({
|
|
7
14
|
variant?: "default" | "outline" | "destructive" | "destructive-subtle" | "ghost" | "link" | null | undefined;
|
|
8
|
-
size?:
|
|
15
|
+
size?: ButtonSize | null | undefined;
|
|
9
16
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
17
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
11
18
|
asChild?: boolean;
|
|
@@ -34,41 +41,87 @@ interface SelectTriggerProps extends React.ComponentPropsWithoutRef<typeof Selec
|
|
|
34
41
|
declare const SelectTrigger: React.ForwardRefExoticComponent<SelectTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
35
42
|
declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
36
43
|
declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
37
|
-
interface SelectContentProps extends Omit<React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>,
|
|
44
|
+
interface SelectContentProps extends Omit<React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>, "position">, VariantProps<typeof selectContentVariants> {
|
|
38
45
|
}
|
|
39
46
|
declare const SelectContent: React.ForwardRefExoticComponent<SelectContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
40
47
|
declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
41
48
|
declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
42
49
|
declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
43
50
|
|
|
51
|
+
interface FormFieldProps {
|
|
52
|
+
label?: string;
|
|
53
|
+
helperText?: string;
|
|
54
|
+
error?: boolean;
|
|
55
|
+
required?: boolean;
|
|
56
|
+
children: React.ReactNode;
|
|
57
|
+
className?: string;
|
|
58
|
+
id?: string;
|
|
59
|
+
compact?: boolean;
|
|
60
|
+
}
|
|
61
|
+
declare const FormField: React.ForwardRefExoticComponent<FormFieldProps & React.RefAttributes<HTMLDivElement>>;
|
|
62
|
+
|
|
63
|
+
declare const datePickerTriggerVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
|
|
64
|
+
interface DatePickerProps {
|
|
65
|
+
value?: Date;
|
|
66
|
+
onValueChange?: (date: Date | undefined) => void;
|
|
67
|
+
defaultValue?: Date | string | number;
|
|
68
|
+
disabled?: boolean;
|
|
69
|
+
placeholder?: string;
|
|
70
|
+
className?: string;
|
|
71
|
+
}
|
|
72
|
+
declare const DatePicker: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
73
|
+
|
|
74
|
+
declare enum UploadState {
|
|
75
|
+
Default = "default",
|
|
76
|
+
DragOver = "dragOver",
|
|
77
|
+
Error = "error",
|
|
78
|
+
Uploading = "uploading",
|
|
79
|
+
Success = "success"
|
|
80
|
+
}
|
|
81
|
+
declare const uploadVariants: (props?: ({
|
|
82
|
+
state?: "default" | "error" | "dragOver" | "uploading" | "success" | null | undefined;
|
|
83
|
+
disabled?: boolean | null | undefined;
|
|
84
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
85
|
+
interface UploadProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onError"> {
|
|
86
|
+
endpoint?: string;
|
|
87
|
+
onFileSelect?: (files: File[]) => void;
|
|
88
|
+
onUploadProgress?: (progress: number) => void;
|
|
89
|
+
onUploadError?: (error: string) => void;
|
|
90
|
+
onUploadComplete?: (files: File[]) => void;
|
|
91
|
+
onUploadSuccess?: (response: unknown) => void;
|
|
92
|
+
maxFileSize?: number;
|
|
93
|
+
acceptedFileTypes?: string[];
|
|
94
|
+
disabled?: boolean;
|
|
95
|
+
state?: UploadState;
|
|
96
|
+
progress?: number;
|
|
97
|
+
errorMessage?: string;
|
|
98
|
+
loading?: boolean;
|
|
99
|
+
}
|
|
100
|
+
declare const Upload: React.ForwardRefExoticComponent<UploadProps & React.RefAttributes<HTMLDivElement>>;
|
|
101
|
+
|
|
44
102
|
declare const inputVariants: (props?: ({
|
|
45
103
|
variant?: "textarea" | "input" | null | undefined;
|
|
46
104
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
47
|
-
type InputElement = HTMLInputElement | HTMLTextAreaElement;
|
|
48
105
|
interface BaseInputProps extends VariantProps<typeof inputVariants> {
|
|
49
106
|
className?: string;
|
|
50
107
|
style?: React.CSSProperties;
|
|
51
108
|
onClear?: () => void;
|
|
52
109
|
}
|
|
53
|
-
interface InputFieldProps extends BaseInputProps, Omit<React.InputHTMLAttributes<HTMLInputElement>,
|
|
110
|
+
interface InputFieldProps extends BaseInputProps, Omit<React.InputHTMLAttributes<HTMLInputElement>, "style"> {
|
|
54
111
|
variant?: "input";
|
|
55
112
|
}
|
|
56
|
-
interface TextareaFieldProps extends BaseInputProps, Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>,
|
|
113
|
+
interface TextareaFieldProps extends BaseInputProps, Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "style"> {
|
|
57
114
|
variant: "textarea";
|
|
58
115
|
}
|
|
59
116
|
type InputProps = InputFieldProps | TextareaFieldProps;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
children: React.ReactNode;
|
|
68
|
-
className?: string;
|
|
69
|
-
id?: string;
|
|
70
|
-
compact?: boolean;
|
|
117
|
+
interface InputComponent {
|
|
118
|
+
(props: InputFieldProps & {
|
|
119
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
120
|
+
}): JSX.Element;
|
|
121
|
+
(props: TextareaFieldProps & {
|
|
122
|
+
ref?: React.Ref<HTMLTextAreaElement>;
|
|
123
|
+
}): JSX.Element;
|
|
71
124
|
}
|
|
72
|
-
declare const
|
|
125
|
+
declare const TypedInput: InputComponent;
|
|
73
126
|
|
|
74
|
-
export { Button, type ButtonProps, FormField, type FormFieldProps, Input, type InputFieldProps, type InputProps, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, type TextareaFieldProps, Typography, type TypographyProps, buttonVariants, inputVariants, selectTriggerVariants, typographyVariants };
|
|
127
|
+
export { Button, type ButtonProps, ButtonSize, DatePicker, type DatePickerProps, FormField, type FormFieldProps, TypedInput as Input, type InputFieldProps, type InputProps, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, type TextareaFieldProps, Typography, type TypographyProps, Upload, type UploadProps, UploadState, buttonVariants, datePickerTriggerVariants, inputVariants, selectTriggerVariants, typographyVariants, uploadVariants };
|