@northslopetech/altitude-ui 2.0.10 → 2.0.13
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/index.d.mts +35 -8
- package/dist/index.d.ts +35 -8
- package/dist/index.js +248 -122
- package/dist/index.mjs +233 -122
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -4,6 +4,8 @@ import { JSX } from 'react';
|
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
6
6
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
7
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
8
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
7
9
|
|
|
8
10
|
declare const buttonVariants: (props?: ({
|
|
9
11
|
variant?: "default" | "outline" | "destructive" | "destructive-subtle" | "ghost" | "link" | null | undefined;
|
|
@@ -67,6 +69,8 @@ interface DatePickerProps {
|
|
|
67
69
|
disabled?: boolean;
|
|
68
70
|
placeholder?: string;
|
|
69
71
|
className?: string;
|
|
72
|
+
minDate?: Date;
|
|
73
|
+
maxDate?: Date;
|
|
70
74
|
}
|
|
71
75
|
declare const DatePicker: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<HTMLInputElement>>;
|
|
72
76
|
|
|
@@ -75,19 +79,14 @@ declare const uploadVariants: (props?: ({
|
|
|
75
79
|
disabled?: boolean | null | undefined;
|
|
76
80
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
77
81
|
interface UploadProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onError"> {
|
|
78
|
-
endpoint?: string;
|
|
79
82
|
onFileSelect?: (files: File[]) => void;
|
|
80
|
-
onUploadProgress?: (progress: number) => void;
|
|
81
|
-
onUploadError?: (error: string) => void;
|
|
82
|
-
onUploadComplete?: (files: File[]) => void;
|
|
83
|
-
onUploadSuccess?: (response: unknown) => void;
|
|
84
|
-
maxFileSize?: number;
|
|
85
83
|
acceptedFileTypes?: string[];
|
|
86
84
|
disabled?: boolean;
|
|
87
85
|
state?: "default" | "dragOver" | "error" | "uploading" | "success";
|
|
88
86
|
progress?: number;
|
|
89
87
|
errorMessage?: string;
|
|
90
|
-
|
|
88
|
+
selectedFiles?: File[];
|
|
89
|
+
maxFileSize?: number;
|
|
91
90
|
}
|
|
92
91
|
declare const Upload: React.ForwardRefExoticComponent<UploadProps & React.RefAttributes<HTMLDivElement>>;
|
|
93
92
|
|
|
@@ -152,6 +151,34 @@ interface TabsContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
152
151
|
}
|
|
153
152
|
declare const TabsContent: React.ForwardRefExoticComponent<TabsContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
154
153
|
|
|
154
|
+
declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
155
|
+
interface DropdownMenuTriggerProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Trigger> {
|
|
156
|
+
icon?: React.ReactNode;
|
|
157
|
+
}
|
|
158
|
+
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
159
|
+
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
160
|
+
declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
|
161
|
+
declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
|
162
|
+
declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
163
|
+
declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
164
|
+
inset?: boolean;
|
|
165
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
166
|
+
declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
167
|
+
declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
168
|
+
declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
169
|
+
inset?: boolean;
|
|
170
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
171
|
+
declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
172
|
+
declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
173
|
+
declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
174
|
+
inset?: boolean;
|
|
175
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
176
|
+
declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
177
|
+
declare const DropdownMenuShortcut: {
|
|
178
|
+
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): react_jsx_runtime.JSX.Element;
|
|
179
|
+
displayName: string;
|
|
180
|
+
};
|
|
181
|
+
|
|
155
182
|
type IconVariant = "dark" | "light" | "gray" | "error" | "warning";
|
|
156
183
|
interface IconProps extends React.SVGProps<SVGSVGElement> {
|
|
157
184
|
className?: string;
|
|
@@ -217,4 +244,4 @@ declare const Warning: React.FC<IconProps>;
|
|
|
217
244
|
declare const Wrench: React.FC<IconProps>;
|
|
218
245
|
declare const Logout: React.FC<IconProps>;
|
|
219
246
|
|
|
220
|
-
export { ArrowDown, ArrowLeft, ArrowRight, ArrowUp, Badge, type BadgeProps, Bell, Bookmark, Button, type ButtonProps, Calendar, CaretDown, CaretLeft, CaretRight, CaretUp, Chat, Check, CheckIcon, Checkbox, type CheckboxProps, CheckmarkCircle, CheckmarkSquare, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, Close, CloseSmall, Cog, Credentials, DatePicker, type DatePickerProps, Doc, Dollar, Edit, Envelope, Exclamation, EyeClosed, EyeOpen, Filter, FilterDescending, FormField, type FormFieldProps, GraphBar, GraphDonut, GraphLine, GraphPie, HamburgerMenu, Home, type IconProps, type IconVariant, Information, TypedInput as Input, type InputFieldProps, type InputProps, Location, Lock, Logout, MagnifyingGlass, Minus, MoreMenu, Phone, Plus, QuestionCircle, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, Share, Star, Statement, Table, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps, type TextareaFieldProps, Trash, Typography, type TypographyProps, Upload, type UploadProps, User, UserMulti, Warning, Wrench, X, badgeVariants, buttonVariants, checkboxVariants, inputVariants, selectTriggerVariants, tabsVariants, typographyVariants, uploadVariants };
|
|
247
|
+
export { ArrowDown, ArrowLeft, ArrowRight, ArrowUp, Badge, type BadgeProps, Bell, Bookmark, Button, type ButtonProps, Calendar, CaretDown, CaretLeft, CaretRight, CaretUp, Chat, Check, CheckIcon, Checkbox, type CheckboxProps, CheckmarkCircle, CheckmarkSquare, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, Close, CloseSmall, Cog, Credentials, DatePicker, type DatePickerProps, Doc, Dollar, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type DropdownMenuTriggerProps, Edit, Envelope, Exclamation, EyeClosed, EyeOpen, Filter, FilterDescending, FormField, type FormFieldProps, GraphBar, GraphDonut, GraphLine, GraphPie, HamburgerMenu, Home, type IconProps, type IconVariant, Information, TypedInput as Input, type InputFieldProps, type InputProps, Location, Lock, Logout, MagnifyingGlass, Minus, MoreMenu, Phone, Plus, QuestionCircle, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, Share, Star, Statement, Table, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps, type TextareaFieldProps, Trash, Typography, type TypographyProps, Upload, type UploadProps, User, UserMulti, Warning, Wrench, X, badgeVariants, buttonVariants, checkboxVariants, inputVariants, selectTriggerVariants, tabsVariants, typographyVariants, uploadVariants };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ import { JSX } from 'react';
|
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
6
6
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
7
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
8
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
7
9
|
|
|
8
10
|
declare const buttonVariants: (props?: ({
|
|
9
11
|
variant?: "default" | "outline" | "destructive" | "destructive-subtle" | "ghost" | "link" | null | undefined;
|
|
@@ -67,6 +69,8 @@ interface DatePickerProps {
|
|
|
67
69
|
disabled?: boolean;
|
|
68
70
|
placeholder?: string;
|
|
69
71
|
className?: string;
|
|
72
|
+
minDate?: Date;
|
|
73
|
+
maxDate?: Date;
|
|
70
74
|
}
|
|
71
75
|
declare const DatePicker: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<HTMLInputElement>>;
|
|
72
76
|
|
|
@@ -75,19 +79,14 @@ declare const uploadVariants: (props?: ({
|
|
|
75
79
|
disabled?: boolean | null | undefined;
|
|
76
80
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
77
81
|
interface UploadProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onError"> {
|
|
78
|
-
endpoint?: string;
|
|
79
82
|
onFileSelect?: (files: File[]) => void;
|
|
80
|
-
onUploadProgress?: (progress: number) => void;
|
|
81
|
-
onUploadError?: (error: string) => void;
|
|
82
|
-
onUploadComplete?: (files: File[]) => void;
|
|
83
|
-
onUploadSuccess?: (response: unknown) => void;
|
|
84
|
-
maxFileSize?: number;
|
|
85
83
|
acceptedFileTypes?: string[];
|
|
86
84
|
disabled?: boolean;
|
|
87
85
|
state?: "default" | "dragOver" | "error" | "uploading" | "success";
|
|
88
86
|
progress?: number;
|
|
89
87
|
errorMessage?: string;
|
|
90
|
-
|
|
88
|
+
selectedFiles?: File[];
|
|
89
|
+
maxFileSize?: number;
|
|
91
90
|
}
|
|
92
91
|
declare const Upload: React.ForwardRefExoticComponent<UploadProps & React.RefAttributes<HTMLDivElement>>;
|
|
93
92
|
|
|
@@ -152,6 +151,34 @@ interface TabsContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
152
151
|
}
|
|
153
152
|
declare const TabsContent: React.ForwardRefExoticComponent<TabsContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
154
153
|
|
|
154
|
+
declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
155
|
+
interface DropdownMenuTriggerProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Trigger> {
|
|
156
|
+
icon?: React.ReactNode;
|
|
157
|
+
}
|
|
158
|
+
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
159
|
+
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
160
|
+
declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
|
161
|
+
declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
|
162
|
+
declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
163
|
+
declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
164
|
+
inset?: boolean;
|
|
165
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
166
|
+
declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
167
|
+
declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
168
|
+
declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
169
|
+
inset?: boolean;
|
|
170
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
171
|
+
declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
172
|
+
declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
173
|
+
declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
174
|
+
inset?: boolean;
|
|
175
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
176
|
+
declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
177
|
+
declare const DropdownMenuShortcut: {
|
|
178
|
+
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): react_jsx_runtime.JSX.Element;
|
|
179
|
+
displayName: string;
|
|
180
|
+
};
|
|
181
|
+
|
|
155
182
|
type IconVariant = "dark" | "light" | "gray" | "error" | "warning";
|
|
156
183
|
interface IconProps extends React.SVGProps<SVGSVGElement> {
|
|
157
184
|
className?: string;
|
|
@@ -217,4 +244,4 @@ declare const Warning: React.FC<IconProps>;
|
|
|
217
244
|
declare const Wrench: React.FC<IconProps>;
|
|
218
245
|
declare const Logout: React.FC<IconProps>;
|
|
219
246
|
|
|
220
|
-
export { ArrowDown, ArrowLeft, ArrowRight, ArrowUp, Badge, type BadgeProps, Bell, Bookmark, Button, type ButtonProps, Calendar, CaretDown, CaretLeft, CaretRight, CaretUp, Chat, Check, CheckIcon, Checkbox, type CheckboxProps, CheckmarkCircle, CheckmarkSquare, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, Close, CloseSmall, Cog, Credentials, DatePicker, type DatePickerProps, Doc, Dollar, Edit, Envelope, Exclamation, EyeClosed, EyeOpen, Filter, FilterDescending, FormField, type FormFieldProps, GraphBar, GraphDonut, GraphLine, GraphPie, HamburgerMenu, Home, type IconProps, type IconVariant, Information, TypedInput as Input, type InputFieldProps, type InputProps, Location, Lock, Logout, MagnifyingGlass, Minus, MoreMenu, Phone, Plus, QuestionCircle, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, Share, Star, Statement, Table, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps, type TextareaFieldProps, Trash, Typography, type TypographyProps, Upload, type UploadProps, User, UserMulti, Warning, Wrench, X, badgeVariants, buttonVariants, checkboxVariants, inputVariants, selectTriggerVariants, tabsVariants, typographyVariants, uploadVariants };
|
|
247
|
+
export { ArrowDown, ArrowLeft, ArrowRight, ArrowUp, Badge, type BadgeProps, Bell, Bookmark, Button, type ButtonProps, Calendar, CaretDown, CaretLeft, CaretRight, CaretUp, Chat, Check, CheckIcon, Checkbox, type CheckboxProps, CheckmarkCircle, CheckmarkSquare, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, Close, CloseSmall, Cog, Credentials, DatePicker, type DatePickerProps, Doc, Dollar, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type DropdownMenuTriggerProps, Edit, Envelope, Exclamation, EyeClosed, EyeOpen, Filter, FilterDescending, FormField, type FormFieldProps, GraphBar, GraphDonut, GraphLine, GraphPie, HamburgerMenu, Home, type IconProps, type IconVariant, Information, TypedInput as Input, type InputFieldProps, type InputProps, Location, Lock, Logout, MagnifyingGlass, Minus, MoreMenu, Phone, Plus, QuestionCircle, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, Share, Star, Statement, Table, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps, type TextareaFieldProps, Trash, Typography, type TypographyProps, Upload, type UploadProps, User, UserMulti, Warning, Wrench, X, badgeVariants, buttonVariants, checkboxVariants, inputVariants, selectTriggerVariants, tabsVariants, typographyVariants, uploadVariants };
|
package/dist/index.js
CHANGED
|
@@ -60,6 +60,21 @@ __export(index_exports, {
|
|
|
60
60
|
DatePicker: () => DatePicker,
|
|
61
61
|
Doc: () => Doc,
|
|
62
62
|
Dollar: () => Dollar,
|
|
63
|
+
DropdownMenu: () => DropdownMenu,
|
|
64
|
+
DropdownMenuCheckboxItem: () => DropdownMenuCheckboxItem,
|
|
65
|
+
DropdownMenuContent: () => DropdownMenuContent,
|
|
66
|
+
DropdownMenuGroup: () => DropdownMenuGroup,
|
|
67
|
+
DropdownMenuItem: () => DropdownMenuItem,
|
|
68
|
+
DropdownMenuLabel: () => DropdownMenuLabel,
|
|
69
|
+
DropdownMenuPortal: () => DropdownMenuPortal,
|
|
70
|
+
DropdownMenuRadioGroup: () => DropdownMenuRadioGroup,
|
|
71
|
+
DropdownMenuRadioItem: () => DropdownMenuRadioItem,
|
|
72
|
+
DropdownMenuSeparator: () => DropdownMenuSeparator,
|
|
73
|
+
DropdownMenuShortcut: () => DropdownMenuShortcut,
|
|
74
|
+
DropdownMenuSub: () => DropdownMenuSub,
|
|
75
|
+
DropdownMenuSubContent: () => DropdownMenuSubContent,
|
|
76
|
+
DropdownMenuSubTrigger: () => DropdownMenuSubTrigger,
|
|
77
|
+
DropdownMenuTrigger: () => DropdownMenuTrigger,
|
|
63
78
|
Edit: () => Edit,
|
|
64
79
|
Envelope: () => Envelope,
|
|
65
80
|
Exclamation: () => Exclamation,
|
|
@@ -2227,6 +2242,8 @@ var DatePicker = React6.forwardRef(
|
|
|
2227
2242
|
disabled,
|
|
2228
2243
|
placeholder = "mm/dd/yyyy",
|
|
2229
2244
|
className,
|
|
2245
|
+
minDate,
|
|
2246
|
+
maxDate,
|
|
2230
2247
|
...props
|
|
2231
2248
|
}, ref) => {
|
|
2232
2249
|
const parseDate = (dateValue) => {
|
|
@@ -2270,6 +2287,7 @@ var DatePicker = React6.forwardRef(
|
|
|
2270
2287
|
setInputValue(formatDateInput(parsedDefault));
|
|
2271
2288
|
}, [defaultValue, value]);
|
|
2272
2289
|
const handleDateSelect = (date) => {
|
|
2290
|
+
if (isDateDisabled(date)) return;
|
|
2273
2291
|
const newDate = new Date(date);
|
|
2274
2292
|
setSelectedDate(newDate);
|
|
2275
2293
|
setInputValue(formatDateInput(newDate));
|
|
@@ -2301,7 +2319,7 @@ var DatePicker = React6.forwardRef(
|
|
|
2301
2319
|
input.setSelectionRange(newPosition, newPosition);
|
|
2302
2320
|
}, 0);
|
|
2303
2321
|
const parsedDate = parseDateInput(formattedValue);
|
|
2304
|
-
if (parsedDate) {
|
|
2322
|
+
if (parsedDate && !isDateDisabled(parsedDate)) {
|
|
2305
2323
|
setSelectedDate(parsedDate);
|
|
2306
2324
|
setCurrentMonth(
|
|
2307
2325
|
new Date(parsedDate.getFullYear(), parsedDate.getMonth())
|
|
@@ -2357,11 +2375,30 @@ var DatePicker = React6.forwardRef(
|
|
|
2357
2375
|
const today = /* @__PURE__ */ new Date();
|
|
2358
2376
|
return date.toDateString() === today.toDateString();
|
|
2359
2377
|
};
|
|
2378
|
+
const isDateDisabled = (date) => {
|
|
2379
|
+
if (minDate && date < minDate) return true;
|
|
2380
|
+
if (maxDate && date > maxDate) return true;
|
|
2381
|
+
return false;
|
|
2382
|
+
};
|
|
2383
|
+
const generateYears = () => {
|
|
2384
|
+
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
2385
|
+
let startYear = currentYear - 50;
|
|
2386
|
+
let endYear = currentYear + 50;
|
|
2387
|
+
if (minDate) {
|
|
2388
|
+
startYear = Math.min(startYear, minDate.getFullYear());
|
|
2389
|
+
}
|
|
2390
|
+
if (maxDate) {
|
|
2391
|
+
endYear = Math.max(endYear, maxDate.getFullYear());
|
|
2392
|
+
}
|
|
2393
|
+
return Array.from(
|
|
2394
|
+
{ length: endYear - startYear + 1 },
|
|
2395
|
+
(_, i) => startYear + i
|
|
2396
|
+
);
|
|
2397
|
+
};
|
|
2360
2398
|
const days = getDaysInMonth(currentMonth);
|
|
2361
2399
|
const months = getMonthNames();
|
|
2362
2400
|
const dayNames = getDayNames();
|
|
2363
|
-
const
|
|
2364
|
-
const years = Array.from({ length: 100 }, (_, i) => currentYear - 50 + i);
|
|
2401
|
+
const years = generateYears();
|
|
2365
2402
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
2366
2403
|
PopoverPrimitive.Root,
|
|
2367
2404
|
{
|
|
@@ -2463,19 +2500,21 @@ var DatePicker = React6.forwardRef(
|
|
|
2463
2500
|
"button",
|
|
2464
2501
|
{
|
|
2465
2502
|
onClick: () => handleDateSelect(date),
|
|
2503
|
+
disabled: isDateDisabled(date),
|
|
2466
2504
|
className: cn(
|
|
2467
2505
|
"h-8 w-8 transition-colors relative",
|
|
2468
|
-
"hover:bg-gray focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1",
|
|
2469
|
-
isDateSelected(date) && !isToday(date) && "bg-dark text-light hover:bg-dark/90 rounded",
|
|
2470
|
-
isDateSelected(date) && isToday(date) && "bg-dark text-light hover:bg-dark/90 rounded-full",
|
|
2506
|
+
!isDateDisabled(date) && "hover:bg-gray focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1",
|
|
2507
|
+
isDateSelected(date) && !isToday(date) && !isDateDisabled(date) && "bg-dark text-light hover:bg-dark/90 rounded",
|
|
2508
|
+
isDateSelected(date) && isToday(date) && !isDateDisabled(date) && "bg-dark text-light hover:bg-dark/90 rounded-full",
|
|
2471
2509
|
!isDateSelected(date) && "rounded-full",
|
|
2472
|
-
isToday(date) && !isDateSelected(date) && "text-blue-600 after:content-[''] after:absolute after:bottom-1 after:left-1/2 after:-translate-x-1/2 after:w-1 after:h-1 after:bg-blue-600 after:rounded-full"
|
|
2510
|
+
isToday(date) && !isDateSelected(date) && !isDateDisabled(date) && "text-blue-600 after:content-[''] after:absolute after:bottom-1 after:left-1/2 after:-translate-x-1/2 after:w-1 after:h-1 after:bg-blue-600 after:rounded-full",
|
|
2511
|
+
isDateDisabled(date) && "text-secondary/40 cursor-not-allowed opacity-50"
|
|
2473
2512
|
),
|
|
2474
2513
|
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Typography, { variant: "label-sm", as: "span", children: date.getDate() })
|
|
2475
2514
|
}
|
|
2476
2515
|
)
|
|
2477
2516
|
},
|
|
2478
|
-
index
|
|
2517
|
+
date ? date.getTime() : `empty-${index}`
|
|
2479
2518
|
)) })
|
|
2480
2519
|
] })
|
|
2481
2520
|
] })
|
|
@@ -2518,106 +2557,18 @@ var uploadVariants = (0, import_class_variance_authority6.cva)(
|
|
|
2518
2557
|
var Upload = React7.forwardRef(
|
|
2519
2558
|
({
|
|
2520
2559
|
className,
|
|
2521
|
-
endpoint,
|
|
2522
2560
|
onFileSelect,
|
|
2523
|
-
onUploadProgress,
|
|
2524
|
-
onUploadError,
|
|
2525
|
-
onUploadComplete,
|
|
2526
|
-
onUploadSuccess,
|
|
2527
2561
|
maxFileSize = DEFAULT_MAX_FILE_SIZE,
|
|
2528
2562
|
acceptedFileTypes = ["application/pdf"],
|
|
2529
2563
|
disabled = false,
|
|
2530
2564
|
state = "default",
|
|
2531
2565
|
progress = 0,
|
|
2532
2566
|
errorMessage = "Helper text why file failed to upload",
|
|
2533
|
-
|
|
2567
|
+
selectedFiles = [],
|
|
2534
2568
|
...props
|
|
2535
2569
|
}, ref) => {
|
|
2536
|
-
const [currentState, setCurrentState] = React7.useState(state);
|
|
2537
|
-
const [currentProgress, setCurrentProgress] = React7.useState(progress);
|
|
2538
2570
|
const fileInputRef = React7.useRef(null);
|
|
2539
|
-
const [
|
|
2540
|
-
React7.useEffect(() => {
|
|
2541
|
-
if (loading) {
|
|
2542
|
-
setCurrentState("uploading");
|
|
2543
|
-
} else {
|
|
2544
|
-
setCurrentState(state);
|
|
2545
|
-
}
|
|
2546
|
-
}, [state, loading]);
|
|
2547
|
-
React7.useEffect(() => {
|
|
2548
|
-
if (loading || progress !== void 0) {
|
|
2549
|
-
setCurrentProgress(progress);
|
|
2550
|
-
}
|
|
2551
|
-
}, [progress, loading]);
|
|
2552
|
-
const uploadFile = React7.useCallback(
|
|
2553
|
-
(file) => {
|
|
2554
|
-
if (!endpoint) {
|
|
2555
|
-
console.warn("Upload endpoint not provided");
|
|
2556
|
-
return;
|
|
2557
|
-
}
|
|
2558
|
-
if (!file) return;
|
|
2559
|
-
if (!loading) {
|
|
2560
|
-
setCurrentState("uploading");
|
|
2561
|
-
}
|
|
2562
|
-
setCurrentProgress(0);
|
|
2563
|
-
const xhr = new XMLHttpRequest();
|
|
2564
|
-
const formData = new FormData();
|
|
2565
|
-
formData.append("file", file);
|
|
2566
|
-
xhr.upload.onprogress = (event) => {
|
|
2567
|
-
if (!event.lengthComputable || loading) return;
|
|
2568
|
-
const progressPercent = Math.round(
|
|
2569
|
-
event.loaded / event.total * 100
|
|
2570
|
-
);
|
|
2571
|
-
setCurrentProgress(progressPercent);
|
|
2572
|
-
onUploadProgress?.(progressPercent);
|
|
2573
|
-
};
|
|
2574
|
-
xhr.onload = () => {
|
|
2575
|
-
if (xhr.status < 200 || xhr.status >= 300) {
|
|
2576
|
-
if (!loading) {
|
|
2577
|
-
setCurrentState("error");
|
|
2578
|
-
}
|
|
2579
|
-
onUploadError?.(`Upload failed: ${xhr.statusText}`);
|
|
2580
|
-
return;
|
|
2581
|
-
}
|
|
2582
|
-
if (!loading) {
|
|
2583
|
-
setCurrentState("success");
|
|
2584
|
-
setCurrentProgress(100);
|
|
2585
|
-
}
|
|
2586
|
-
try {
|
|
2587
|
-
const response = JSON.parse(xhr.responseText);
|
|
2588
|
-
onUploadSuccess?.(response);
|
|
2589
|
-
} catch {
|
|
2590
|
-
onUploadSuccess?.(xhr.responseText);
|
|
2591
|
-
}
|
|
2592
|
-
onUploadComplete?.([file]);
|
|
2593
|
-
};
|
|
2594
|
-
xhr.onerror = () => {
|
|
2595
|
-
if (!loading) {
|
|
2596
|
-
setCurrentState("error");
|
|
2597
|
-
}
|
|
2598
|
-
onUploadError?.("Network error occurred during upload");
|
|
2599
|
-
};
|
|
2600
|
-
xhr.open("POST", endpoint);
|
|
2601
|
-
xhr.send(formData);
|
|
2602
|
-
},
|
|
2603
|
-
[
|
|
2604
|
-
endpoint,
|
|
2605
|
-
onUploadProgress,
|
|
2606
|
-
onUploadSuccess,
|
|
2607
|
-
onUploadComplete,
|
|
2608
|
-
onUploadError,
|
|
2609
|
-
loading
|
|
2610
|
-
]
|
|
2611
|
-
);
|
|
2612
|
-
const validateFile = (file) => {
|
|
2613
|
-
if (!acceptedFileTypes.includes(file.type)) {
|
|
2614
|
-
return `File type not supported. Please upload: ${acceptedFileTypes.join(", ")}`;
|
|
2615
|
-
}
|
|
2616
|
-
if (file.size > maxFileSize) {
|
|
2617
|
-
return `File size exceeds ${Math.round(maxFileSize / 1024 / 1024)}MB limit`;
|
|
2618
|
-
}
|
|
2619
|
-
return null;
|
|
2620
|
-
};
|
|
2571
|
+
const [isDragOver, setIsDragOver] = React7.useState(false);
|
|
2621
2572
|
const getFileTypeDisplay = () => {
|
|
2622
2573
|
const typeMap = {
|
|
2623
2574
|
"application/pdf": "PDF",
|
|
@@ -2639,29 +2590,20 @@ var Upload = React7.forwardRef(
|
|
|
2639
2590
|
if (!files || disabled) return;
|
|
2640
2591
|
const file = files[0];
|
|
2641
2592
|
if (!file) return;
|
|
2642
|
-
const error = validateFile(file);
|
|
2643
|
-
if (error) {
|
|
2644
|
-
setCurrentState("error");
|
|
2645
|
-
onUploadError?.(error);
|
|
2646
|
-
return;
|
|
2647
|
-
}
|
|
2648
|
-
setSelectedFiles([file]);
|
|
2649
2593
|
onFileSelect?.([file]);
|
|
2650
|
-
if (!endpoint) return;
|
|
2651
|
-
uploadFile(file);
|
|
2652
2594
|
};
|
|
2653
2595
|
const handleDragEnter = (e) => {
|
|
2654
2596
|
e.preventDefault();
|
|
2655
2597
|
e.stopPropagation();
|
|
2656
2598
|
if (disabled) return;
|
|
2657
|
-
if (
|
|
2658
|
-
|
|
2599
|
+
if (state === "error" || state === "uploading") return;
|
|
2600
|
+
setIsDragOver(true);
|
|
2659
2601
|
};
|
|
2660
2602
|
const handleDragLeave = (e) => {
|
|
2661
2603
|
e.preventDefault();
|
|
2662
2604
|
e.stopPropagation();
|
|
2663
2605
|
if (disabled) return;
|
|
2664
|
-
|
|
2606
|
+
setIsDragOver(false);
|
|
2665
2607
|
};
|
|
2666
2608
|
const handleDragOver = (e) => {
|
|
2667
2609
|
e.preventDefault();
|
|
@@ -2671,7 +2613,7 @@ var Upload = React7.forwardRef(
|
|
|
2671
2613
|
e.preventDefault();
|
|
2672
2614
|
e.stopPropagation();
|
|
2673
2615
|
if (disabled) return;
|
|
2674
|
-
|
|
2616
|
+
setIsDragOver(false);
|
|
2675
2617
|
const files = e.dataTransfer?.files;
|
|
2676
2618
|
handleFileSelect(files);
|
|
2677
2619
|
};
|
|
@@ -2684,12 +2626,11 @@ var Upload = React7.forwardRef(
|
|
|
2684
2626
|
};
|
|
2685
2627
|
const handleTryAgain = (e) => {
|
|
2686
2628
|
e.stopPropagation();
|
|
2687
|
-
setCurrentState("default");
|
|
2688
|
-
setSelectedFiles([]);
|
|
2689
2629
|
fileInputRef.current?.click();
|
|
2690
2630
|
};
|
|
2631
|
+
const effectiveState = isDragOver && state === "default" ? "dragOver" : state;
|
|
2691
2632
|
const renderContent = () => {
|
|
2692
|
-
switch (
|
|
2633
|
+
switch (effectiveState) {
|
|
2693
2634
|
case "error":
|
|
2694
2635
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2695
2636
|
"div",
|
|
@@ -2726,8 +2667,8 @@ var Upload = React7.forwardRef(
|
|
|
2726
2667
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w-full bg-gray rounded-full h-2", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2727
2668
|
"div",
|
|
2728
2669
|
{
|
|
2729
|
-
className: "bg-primary h-2 rounded-full transition-all duration-300 ease-in-out",
|
|
2730
|
-
style: { width: `${
|
|
2670
|
+
className: "bg-canvas-primary h-2 rounded-full transition-all duration-300 ease-in-out",
|
|
2671
|
+
style: { width: `${progress}%` }
|
|
2731
2672
|
}
|
|
2732
2673
|
) }),
|
|
2733
2674
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
@@ -2736,7 +2677,7 @@ var Upload = React7.forwardRef(
|
|
|
2736
2677
|
variant: "body-sm",
|
|
2737
2678
|
className: "text-secondary text-center",
|
|
2738
2679
|
children: [
|
|
2739
|
-
|
|
2680
|
+
Math.round(progress),
|
|
2740
2681
|
"% complete"
|
|
2741
2682
|
]
|
|
2742
2683
|
}
|
|
@@ -2800,14 +2741,14 @@ var Upload = React7.forwardRef(
|
|
|
2800
2741
|
{
|
|
2801
2742
|
ref,
|
|
2802
2743
|
className: cn(
|
|
2803
|
-
uploadVariants({ state:
|
|
2744
|
+
uploadVariants({ state: effectiveState, disabled }),
|
|
2804
2745
|
className
|
|
2805
2746
|
),
|
|
2806
2747
|
onDragEnter: handleDragEnter,
|
|
2807
2748
|
onDragLeave: !disabled ? handleDragLeave : void 0,
|
|
2808
2749
|
onDragOver: !disabled ? handleDragOver : void 0,
|
|
2809
2750
|
onDrop: !disabled ? handleDrop : void 0,
|
|
2810
|
-
onClick: disabled ||
|
|
2751
|
+
onClick: disabled || state === "uploading" ? void 0 : handleClick,
|
|
2811
2752
|
style: {
|
|
2812
2753
|
width: "960px",
|
|
2813
2754
|
height: "540px",
|
|
@@ -2815,7 +2756,7 @@ var Upload = React7.forwardRef(
|
|
|
2815
2756
|
},
|
|
2816
2757
|
role: "button",
|
|
2817
2758
|
tabIndex: disabled ? -1 : 0,
|
|
2818
|
-
"aria-label":
|
|
2759
|
+
"aria-label": state === "uploading" ? "Uploading files" : "Upload files",
|
|
2819
2760
|
"aria-disabled": disabled,
|
|
2820
2761
|
...props,
|
|
2821
2762
|
children: [
|
|
@@ -2852,7 +2793,7 @@ var Checkbox = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
2852
2793
|
ref,
|
|
2853
2794
|
className: cn(checkboxVariants(), className),
|
|
2854
2795
|
...props,
|
|
2855
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center text-current", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CheckIcon, { className: "size-3" }) })
|
|
2796
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center text-current", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CheckIcon, { variant: "light", className: "size-3" }) })
|
|
2856
2797
|
}
|
|
2857
2798
|
));
|
|
2858
2799
|
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
@@ -2919,7 +2860,7 @@ var tabsVariants = (0, import_class_variance_authority9.cva)(
|
|
|
2919
2860
|
{
|
|
2920
2861
|
variants: {
|
|
2921
2862
|
variant: {
|
|
2922
|
-
default: "border-b-
|
|
2863
|
+
default: "border-b-1 border-subtle hover:bg-gray data-[state=active]:border-interactive data-[state=active]:text-dark data-[state=active]:border-b-2 disabled:border-subtle disabled:text-muted disabled:cursor-not-allowed"
|
|
2923
2864
|
}
|
|
2924
2865
|
},
|
|
2925
2866
|
defaultVariants: {
|
|
@@ -3046,6 +2987,176 @@ var TabsContent = React10.forwardRef(
|
|
|
3046
2987
|
}
|
|
3047
2988
|
);
|
|
3048
2989
|
TabsContent.displayName = "TabsContent";
|
|
2990
|
+
|
|
2991
|
+
// src/components/ui/dropdown-menu.tsx
|
|
2992
|
+
var React11 = __toESM(require("react"));
|
|
2993
|
+
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
2994
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2995
|
+
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
2996
|
+
var DropdownMenuTrigger = React11.forwardRef(({ className, icon, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2997
|
+
DropdownMenuPrimitive.Trigger,
|
|
2998
|
+
{
|
|
2999
|
+
ref,
|
|
3000
|
+
className: cn(
|
|
3001
|
+
"inline-flex items-center justify-center rounded bg-light p-2 transition-colors hover:bg-gray focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-interactive focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
3002
|
+
className
|
|
3003
|
+
),
|
|
3004
|
+
...props,
|
|
3005
|
+
children: [
|
|
3006
|
+
icon || /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(MoreMenu, { className: "size-4" }),
|
|
3007
|
+
children
|
|
3008
|
+
]
|
|
3009
|
+
}
|
|
3010
|
+
));
|
|
3011
|
+
DropdownMenuTrigger.displayName = DropdownMenuPrimitive.Trigger.displayName;
|
|
3012
|
+
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
3013
|
+
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
3014
|
+
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
3015
|
+
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
3016
|
+
var DropdownMenuSubTrigger = React11.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3017
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
3018
|
+
{
|
|
3019
|
+
ref,
|
|
3020
|
+
className: cn(
|
|
3021
|
+
"flex cursor-pointer select-none items-center gap-2 px-2 py-3 outline-none transition-colors hover:bg-gray focus:bg-gray data-[state=open]:bg-gray [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
3022
|
+
inset && "pl-8",
|
|
3023
|
+
className
|
|
3024
|
+
),
|
|
3025
|
+
style: { font: "var(--typography-label-sm-regular)" },
|
|
3026
|
+
...props,
|
|
3027
|
+
children: [
|
|
3028
|
+
children,
|
|
3029
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ChevronRight, { className: "ml-auto" })
|
|
3030
|
+
]
|
|
3031
|
+
}
|
|
3032
|
+
));
|
|
3033
|
+
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
3034
|
+
var DropdownMenuSubContent = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3035
|
+
DropdownMenuPrimitive.SubContent,
|
|
3036
|
+
{
|
|
3037
|
+
ref,
|
|
3038
|
+
className: cn(
|
|
3039
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border border-subtle bg-light text-dark shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",
|
|
3040
|
+
className
|
|
3041
|
+
),
|
|
3042
|
+
...props
|
|
3043
|
+
}
|
|
3044
|
+
));
|
|
3045
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
3046
|
+
var DropdownMenuContent = React11.forwardRef(({ className, sideOffset = 4, align = "end", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3047
|
+
DropdownMenuPrimitive.Content,
|
|
3048
|
+
{
|
|
3049
|
+
ref,
|
|
3050
|
+
sideOffset,
|
|
3051
|
+
align,
|
|
3052
|
+
className: cn(
|
|
3053
|
+
"z-50 min-w-50 overflow-hidden rounded-md border border-subtle bg-light shadow-lg animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
3054
|
+
className
|
|
3055
|
+
),
|
|
3056
|
+
...props
|
|
3057
|
+
}
|
|
3058
|
+
) }));
|
|
3059
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
3060
|
+
var DropdownMenuItem = React11.forwardRef(({ className, inset, style, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3061
|
+
DropdownMenuPrimitive.Item,
|
|
3062
|
+
{
|
|
3063
|
+
ref,
|
|
3064
|
+
className: cn(
|
|
3065
|
+
"relative flex cursor-pointer select-none items-center px-2 py-3 outline-none transition-colors hover:bg-gray focus:bg-gray data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
3066
|
+
inset && "pl-8",
|
|
3067
|
+
className
|
|
3068
|
+
),
|
|
3069
|
+
style: {
|
|
3070
|
+
font: "var(--typography-label-sm-regular)",
|
|
3071
|
+
...style
|
|
3072
|
+
},
|
|
3073
|
+
...props
|
|
3074
|
+
}
|
|
3075
|
+
));
|
|
3076
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
3077
|
+
var DropdownMenuCheckboxItem = React11.forwardRef(({ className, children, style, checked, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3078
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
3079
|
+
{
|
|
3080
|
+
ref,
|
|
3081
|
+
className: cn(
|
|
3082
|
+
"relative flex cursor-pointer select-none items-center gap-2 px-2 py-3 outline-none transition-colors hover:bg-gray focus:bg-gray data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
3083
|
+
className
|
|
3084
|
+
),
|
|
3085
|
+
checked,
|
|
3086
|
+
style: {
|
|
3087
|
+
font: "var(--typography-label-sm-regular)",
|
|
3088
|
+
...style
|
|
3089
|
+
},
|
|
3090
|
+
...props,
|
|
3091
|
+
children: [
|
|
3092
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3093
|
+
Checkbox,
|
|
3094
|
+
{
|
|
3095
|
+
checked: checked === true,
|
|
3096
|
+
className: "pointer-events-none",
|
|
3097
|
+
"aria-hidden": "true"
|
|
3098
|
+
}
|
|
3099
|
+
),
|
|
3100
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "flex-1", children })
|
|
3101
|
+
]
|
|
3102
|
+
}
|
|
3103
|
+
));
|
|
3104
|
+
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
3105
|
+
var DropdownMenuRadioItem = React11.forwardRef(({ className, children, style, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3106
|
+
DropdownMenuPrimitive.RadioItem,
|
|
3107
|
+
{
|
|
3108
|
+
ref,
|
|
3109
|
+
className: cn(
|
|
3110
|
+
"relative flex cursor-pointer select-none items-center px-2 py-3 pl-8 outline-none transition-colors hover:bg-gray focus:bg-gray data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
3111
|
+
className
|
|
3112
|
+
),
|
|
3113
|
+
style: {
|
|
3114
|
+
font: "var(--typography-label-sm-regular)",
|
|
3115
|
+
...style
|
|
3116
|
+
},
|
|
3117
|
+
...props,
|
|
3118
|
+
children: [
|
|
3119
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "h-2 w-2 rounded-full bg-current" }) }) }),
|
|
3120
|
+
children
|
|
3121
|
+
]
|
|
3122
|
+
}
|
|
3123
|
+
));
|
|
3124
|
+
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
3125
|
+
var DropdownMenuLabel = React11.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3126
|
+
DropdownMenuPrimitive.Label,
|
|
3127
|
+
{
|
|
3128
|
+
ref,
|
|
3129
|
+
className: cn(
|
|
3130
|
+
"px-2 py-1.5 text-sm font-semibold",
|
|
3131
|
+
inset && "pl-8",
|
|
3132
|
+
className
|
|
3133
|
+
),
|
|
3134
|
+
...props
|
|
3135
|
+
}
|
|
3136
|
+
));
|
|
3137
|
+
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
3138
|
+
var DropdownMenuSeparator = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3139
|
+
DropdownMenuPrimitive.Separator,
|
|
3140
|
+
{
|
|
3141
|
+
ref,
|
|
3142
|
+
className: cn("-mx-1 my-1 h-px bg-subtle", className),
|
|
3143
|
+
...props
|
|
3144
|
+
}
|
|
3145
|
+
));
|
|
3146
|
+
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
3147
|
+
var DropdownMenuShortcut = ({
|
|
3148
|
+
className,
|
|
3149
|
+
...props
|
|
3150
|
+
}) => {
|
|
3151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3152
|
+
"span",
|
|
3153
|
+
{
|
|
3154
|
+
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
3155
|
+
...props
|
|
3156
|
+
}
|
|
3157
|
+
);
|
|
3158
|
+
};
|
|
3159
|
+
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
3049
3160
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3050
3161
|
0 && (module.exports = {
|
|
3051
3162
|
ArrowDown,
|
|
@@ -3078,6 +3189,21 @@ TabsContent.displayName = "TabsContent";
|
|
|
3078
3189
|
DatePicker,
|
|
3079
3190
|
Doc,
|
|
3080
3191
|
Dollar,
|
|
3192
|
+
DropdownMenu,
|
|
3193
|
+
DropdownMenuCheckboxItem,
|
|
3194
|
+
DropdownMenuContent,
|
|
3195
|
+
DropdownMenuGroup,
|
|
3196
|
+
DropdownMenuItem,
|
|
3197
|
+
DropdownMenuLabel,
|
|
3198
|
+
DropdownMenuPortal,
|
|
3199
|
+
DropdownMenuRadioGroup,
|
|
3200
|
+
DropdownMenuRadioItem,
|
|
3201
|
+
DropdownMenuSeparator,
|
|
3202
|
+
DropdownMenuShortcut,
|
|
3203
|
+
DropdownMenuSub,
|
|
3204
|
+
DropdownMenuSubContent,
|
|
3205
|
+
DropdownMenuSubTrigger,
|
|
3206
|
+
DropdownMenuTrigger,
|
|
3081
3207
|
Edit,
|
|
3082
3208
|
Envelope,
|
|
3083
3209
|
Exclamation,
|
package/dist/index.mjs
CHANGED
|
@@ -2103,6 +2103,8 @@ var DatePicker = React6.forwardRef(
|
|
|
2103
2103
|
disabled,
|
|
2104
2104
|
placeholder = "mm/dd/yyyy",
|
|
2105
2105
|
className,
|
|
2106
|
+
minDate,
|
|
2107
|
+
maxDate,
|
|
2106
2108
|
...props
|
|
2107
2109
|
}, ref) => {
|
|
2108
2110
|
const parseDate = (dateValue) => {
|
|
@@ -2146,6 +2148,7 @@ var DatePicker = React6.forwardRef(
|
|
|
2146
2148
|
setInputValue(formatDateInput(parsedDefault));
|
|
2147
2149
|
}, [defaultValue, value]);
|
|
2148
2150
|
const handleDateSelect = (date) => {
|
|
2151
|
+
if (isDateDisabled(date)) return;
|
|
2149
2152
|
const newDate = new Date(date);
|
|
2150
2153
|
setSelectedDate(newDate);
|
|
2151
2154
|
setInputValue(formatDateInput(newDate));
|
|
@@ -2177,7 +2180,7 @@ var DatePicker = React6.forwardRef(
|
|
|
2177
2180
|
input.setSelectionRange(newPosition, newPosition);
|
|
2178
2181
|
}, 0);
|
|
2179
2182
|
const parsedDate = parseDateInput(formattedValue);
|
|
2180
|
-
if (parsedDate) {
|
|
2183
|
+
if (parsedDate && !isDateDisabled(parsedDate)) {
|
|
2181
2184
|
setSelectedDate(parsedDate);
|
|
2182
2185
|
setCurrentMonth(
|
|
2183
2186
|
new Date(parsedDate.getFullYear(), parsedDate.getMonth())
|
|
@@ -2233,11 +2236,30 @@ var DatePicker = React6.forwardRef(
|
|
|
2233
2236
|
const today = /* @__PURE__ */ new Date();
|
|
2234
2237
|
return date.toDateString() === today.toDateString();
|
|
2235
2238
|
};
|
|
2239
|
+
const isDateDisabled = (date) => {
|
|
2240
|
+
if (minDate && date < minDate) return true;
|
|
2241
|
+
if (maxDate && date > maxDate) return true;
|
|
2242
|
+
return false;
|
|
2243
|
+
};
|
|
2244
|
+
const generateYears = () => {
|
|
2245
|
+
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
2246
|
+
let startYear = currentYear - 50;
|
|
2247
|
+
let endYear = currentYear + 50;
|
|
2248
|
+
if (minDate) {
|
|
2249
|
+
startYear = Math.min(startYear, minDate.getFullYear());
|
|
2250
|
+
}
|
|
2251
|
+
if (maxDate) {
|
|
2252
|
+
endYear = Math.max(endYear, maxDate.getFullYear());
|
|
2253
|
+
}
|
|
2254
|
+
return Array.from(
|
|
2255
|
+
{ length: endYear - startYear + 1 },
|
|
2256
|
+
(_, i) => startYear + i
|
|
2257
|
+
);
|
|
2258
|
+
};
|
|
2236
2259
|
const days = getDaysInMonth(currentMonth);
|
|
2237
2260
|
const months = getMonthNames();
|
|
2238
2261
|
const dayNames = getDayNames();
|
|
2239
|
-
const
|
|
2240
|
-
const years = Array.from({ length: 100 }, (_, i) => currentYear - 50 + i);
|
|
2262
|
+
const years = generateYears();
|
|
2241
2263
|
return /* @__PURE__ */ jsxs6(
|
|
2242
2264
|
PopoverPrimitive.Root,
|
|
2243
2265
|
{
|
|
@@ -2339,19 +2361,21 @@ var DatePicker = React6.forwardRef(
|
|
|
2339
2361
|
"button",
|
|
2340
2362
|
{
|
|
2341
2363
|
onClick: () => handleDateSelect(date),
|
|
2364
|
+
disabled: isDateDisabled(date),
|
|
2342
2365
|
className: cn(
|
|
2343
2366
|
"h-8 w-8 transition-colors relative",
|
|
2344
|
-
"hover:bg-gray focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1",
|
|
2345
|
-
isDateSelected(date) && !isToday(date) && "bg-dark text-light hover:bg-dark/90 rounded",
|
|
2346
|
-
isDateSelected(date) && isToday(date) && "bg-dark text-light hover:bg-dark/90 rounded-full",
|
|
2367
|
+
!isDateDisabled(date) && "hover:bg-gray focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1",
|
|
2368
|
+
isDateSelected(date) && !isToday(date) && !isDateDisabled(date) && "bg-dark text-light hover:bg-dark/90 rounded",
|
|
2369
|
+
isDateSelected(date) && isToday(date) && !isDateDisabled(date) && "bg-dark text-light hover:bg-dark/90 rounded-full",
|
|
2347
2370
|
!isDateSelected(date) && "rounded-full",
|
|
2348
|
-
isToday(date) && !isDateSelected(date) && "text-blue-600 after:content-[''] after:absolute after:bottom-1 after:left-1/2 after:-translate-x-1/2 after:w-1 after:h-1 after:bg-blue-600 after:rounded-full"
|
|
2371
|
+
isToday(date) && !isDateSelected(date) && !isDateDisabled(date) && "text-blue-600 after:content-[''] after:absolute after:bottom-1 after:left-1/2 after:-translate-x-1/2 after:w-1 after:h-1 after:bg-blue-600 after:rounded-full",
|
|
2372
|
+
isDateDisabled(date) && "text-secondary/40 cursor-not-allowed opacity-50"
|
|
2349
2373
|
),
|
|
2350
2374
|
children: /* @__PURE__ */ jsx6(Typography, { variant: "label-sm", as: "span", children: date.getDate() })
|
|
2351
2375
|
}
|
|
2352
2376
|
)
|
|
2353
2377
|
},
|
|
2354
|
-
index
|
|
2378
|
+
date ? date.getTime() : `empty-${index}`
|
|
2355
2379
|
)) })
|
|
2356
2380
|
] })
|
|
2357
2381
|
] })
|
|
@@ -2394,106 +2418,18 @@ var uploadVariants = cva6(
|
|
|
2394
2418
|
var Upload = React7.forwardRef(
|
|
2395
2419
|
({
|
|
2396
2420
|
className,
|
|
2397
|
-
endpoint,
|
|
2398
2421
|
onFileSelect,
|
|
2399
|
-
onUploadProgress,
|
|
2400
|
-
onUploadError,
|
|
2401
|
-
onUploadComplete,
|
|
2402
|
-
onUploadSuccess,
|
|
2403
2422
|
maxFileSize = DEFAULT_MAX_FILE_SIZE,
|
|
2404
2423
|
acceptedFileTypes = ["application/pdf"],
|
|
2405
2424
|
disabled = false,
|
|
2406
2425
|
state = "default",
|
|
2407
2426
|
progress = 0,
|
|
2408
2427
|
errorMessage = "Helper text why file failed to upload",
|
|
2409
|
-
|
|
2428
|
+
selectedFiles = [],
|
|
2410
2429
|
...props
|
|
2411
2430
|
}, ref) => {
|
|
2412
|
-
const [currentState, setCurrentState] = React7.useState(state);
|
|
2413
|
-
const [currentProgress, setCurrentProgress] = React7.useState(progress);
|
|
2414
2431
|
const fileInputRef = React7.useRef(null);
|
|
2415
|
-
const [
|
|
2416
|
-
React7.useEffect(() => {
|
|
2417
|
-
if (loading) {
|
|
2418
|
-
setCurrentState("uploading");
|
|
2419
|
-
} else {
|
|
2420
|
-
setCurrentState(state);
|
|
2421
|
-
}
|
|
2422
|
-
}, [state, loading]);
|
|
2423
|
-
React7.useEffect(() => {
|
|
2424
|
-
if (loading || progress !== void 0) {
|
|
2425
|
-
setCurrentProgress(progress);
|
|
2426
|
-
}
|
|
2427
|
-
}, [progress, loading]);
|
|
2428
|
-
const uploadFile = React7.useCallback(
|
|
2429
|
-
(file) => {
|
|
2430
|
-
if (!endpoint) {
|
|
2431
|
-
console.warn("Upload endpoint not provided");
|
|
2432
|
-
return;
|
|
2433
|
-
}
|
|
2434
|
-
if (!file) return;
|
|
2435
|
-
if (!loading) {
|
|
2436
|
-
setCurrentState("uploading");
|
|
2437
|
-
}
|
|
2438
|
-
setCurrentProgress(0);
|
|
2439
|
-
const xhr = new XMLHttpRequest();
|
|
2440
|
-
const formData = new FormData();
|
|
2441
|
-
formData.append("file", file);
|
|
2442
|
-
xhr.upload.onprogress = (event) => {
|
|
2443
|
-
if (!event.lengthComputable || loading) return;
|
|
2444
|
-
const progressPercent = Math.round(
|
|
2445
|
-
event.loaded / event.total * 100
|
|
2446
|
-
);
|
|
2447
|
-
setCurrentProgress(progressPercent);
|
|
2448
|
-
onUploadProgress?.(progressPercent);
|
|
2449
|
-
};
|
|
2450
|
-
xhr.onload = () => {
|
|
2451
|
-
if (xhr.status < 200 || xhr.status >= 300) {
|
|
2452
|
-
if (!loading) {
|
|
2453
|
-
setCurrentState("error");
|
|
2454
|
-
}
|
|
2455
|
-
onUploadError?.(`Upload failed: ${xhr.statusText}`);
|
|
2456
|
-
return;
|
|
2457
|
-
}
|
|
2458
|
-
if (!loading) {
|
|
2459
|
-
setCurrentState("success");
|
|
2460
|
-
setCurrentProgress(100);
|
|
2461
|
-
}
|
|
2462
|
-
try {
|
|
2463
|
-
const response = JSON.parse(xhr.responseText);
|
|
2464
|
-
onUploadSuccess?.(response);
|
|
2465
|
-
} catch {
|
|
2466
|
-
onUploadSuccess?.(xhr.responseText);
|
|
2467
|
-
}
|
|
2468
|
-
onUploadComplete?.([file]);
|
|
2469
|
-
};
|
|
2470
|
-
xhr.onerror = () => {
|
|
2471
|
-
if (!loading) {
|
|
2472
|
-
setCurrentState("error");
|
|
2473
|
-
}
|
|
2474
|
-
onUploadError?.("Network error occurred during upload");
|
|
2475
|
-
};
|
|
2476
|
-
xhr.open("POST", endpoint);
|
|
2477
|
-
xhr.send(formData);
|
|
2478
|
-
},
|
|
2479
|
-
[
|
|
2480
|
-
endpoint,
|
|
2481
|
-
onUploadProgress,
|
|
2482
|
-
onUploadSuccess,
|
|
2483
|
-
onUploadComplete,
|
|
2484
|
-
onUploadError,
|
|
2485
|
-
loading
|
|
2486
|
-
]
|
|
2487
|
-
);
|
|
2488
|
-
const validateFile = (file) => {
|
|
2489
|
-
if (!acceptedFileTypes.includes(file.type)) {
|
|
2490
|
-
return `File type not supported. Please upload: ${acceptedFileTypes.join(", ")}`;
|
|
2491
|
-
}
|
|
2492
|
-
if (file.size > maxFileSize) {
|
|
2493
|
-
return `File size exceeds ${Math.round(maxFileSize / 1024 / 1024)}MB limit`;
|
|
2494
|
-
}
|
|
2495
|
-
return null;
|
|
2496
|
-
};
|
|
2432
|
+
const [isDragOver, setIsDragOver] = React7.useState(false);
|
|
2497
2433
|
const getFileTypeDisplay = () => {
|
|
2498
2434
|
const typeMap = {
|
|
2499
2435
|
"application/pdf": "PDF",
|
|
@@ -2515,29 +2451,20 @@ var Upload = React7.forwardRef(
|
|
|
2515
2451
|
if (!files || disabled) return;
|
|
2516
2452
|
const file = files[0];
|
|
2517
2453
|
if (!file) return;
|
|
2518
|
-
const error = validateFile(file);
|
|
2519
|
-
if (error) {
|
|
2520
|
-
setCurrentState("error");
|
|
2521
|
-
onUploadError?.(error);
|
|
2522
|
-
return;
|
|
2523
|
-
}
|
|
2524
|
-
setSelectedFiles([file]);
|
|
2525
2454
|
onFileSelect?.([file]);
|
|
2526
|
-
if (!endpoint) return;
|
|
2527
|
-
uploadFile(file);
|
|
2528
2455
|
};
|
|
2529
2456
|
const handleDragEnter = (e) => {
|
|
2530
2457
|
e.preventDefault();
|
|
2531
2458
|
e.stopPropagation();
|
|
2532
2459
|
if (disabled) return;
|
|
2533
|
-
if (
|
|
2534
|
-
|
|
2460
|
+
if (state === "error" || state === "uploading") return;
|
|
2461
|
+
setIsDragOver(true);
|
|
2535
2462
|
};
|
|
2536
2463
|
const handleDragLeave = (e) => {
|
|
2537
2464
|
e.preventDefault();
|
|
2538
2465
|
e.stopPropagation();
|
|
2539
2466
|
if (disabled) return;
|
|
2540
|
-
|
|
2467
|
+
setIsDragOver(false);
|
|
2541
2468
|
};
|
|
2542
2469
|
const handleDragOver = (e) => {
|
|
2543
2470
|
e.preventDefault();
|
|
@@ -2547,7 +2474,7 @@ var Upload = React7.forwardRef(
|
|
|
2547
2474
|
e.preventDefault();
|
|
2548
2475
|
e.stopPropagation();
|
|
2549
2476
|
if (disabled) return;
|
|
2550
|
-
|
|
2477
|
+
setIsDragOver(false);
|
|
2551
2478
|
const files = e.dataTransfer?.files;
|
|
2552
2479
|
handleFileSelect(files);
|
|
2553
2480
|
};
|
|
@@ -2560,12 +2487,11 @@ var Upload = React7.forwardRef(
|
|
|
2560
2487
|
};
|
|
2561
2488
|
const handleTryAgain = (e) => {
|
|
2562
2489
|
e.stopPropagation();
|
|
2563
|
-
setCurrentState("default");
|
|
2564
|
-
setSelectedFiles([]);
|
|
2565
2490
|
fileInputRef.current?.click();
|
|
2566
2491
|
};
|
|
2492
|
+
const effectiveState = isDragOver && state === "default" ? "dragOver" : state;
|
|
2567
2493
|
const renderContent = () => {
|
|
2568
|
-
switch (
|
|
2494
|
+
switch (effectiveState) {
|
|
2569
2495
|
case "error":
|
|
2570
2496
|
return /* @__PURE__ */ jsxs7(
|
|
2571
2497
|
"div",
|
|
@@ -2602,8 +2528,8 @@ var Upload = React7.forwardRef(
|
|
|
2602
2528
|
/* @__PURE__ */ jsx7("div", { className: "w-full bg-gray rounded-full h-2", children: /* @__PURE__ */ jsx7(
|
|
2603
2529
|
"div",
|
|
2604
2530
|
{
|
|
2605
|
-
className: "bg-primary h-2 rounded-full transition-all duration-300 ease-in-out",
|
|
2606
|
-
style: { width: `${
|
|
2531
|
+
className: "bg-canvas-primary h-2 rounded-full transition-all duration-300 ease-in-out",
|
|
2532
|
+
style: { width: `${progress}%` }
|
|
2607
2533
|
}
|
|
2608
2534
|
) }),
|
|
2609
2535
|
/* @__PURE__ */ jsxs7(
|
|
@@ -2612,7 +2538,7 @@ var Upload = React7.forwardRef(
|
|
|
2612
2538
|
variant: "body-sm",
|
|
2613
2539
|
className: "text-secondary text-center",
|
|
2614
2540
|
children: [
|
|
2615
|
-
|
|
2541
|
+
Math.round(progress),
|
|
2616
2542
|
"% complete"
|
|
2617
2543
|
]
|
|
2618
2544
|
}
|
|
@@ -2676,14 +2602,14 @@ var Upload = React7.forwardRef(
|
|
|
2676
2602
|
{
|
|
2677
2603
|
ref,
|
|
2678
2604
|
className: cn(
|
|
2679
|
-
uploadVariants({ state:
|
|
2605
|
+
uploadVariants({ state: effectiveState, disabled }),
|
|
2680
2606
|
className
|
|
2681
2607
|
),
|
|
2682
2608
|
onDragEnter: handleDragEnter,
|
|
2683
2609
|
onDragLeave: !disabled ? handleDragLeave : void 0,
|
|
2684
2610
|
onDragOver: !disabled ? handleDragOver : void 0,
|
|
2685
2611
|
onDrop: !disabled ? handleDrop : void 0,
|
|
2686
|
-
onClick: disabled ||
|
|
2612
|
+
onClick: disabled || state === "uploading" ? void 0 : handleClick,
|
|
2687
2613
|
style: {
|
|
2688
2614
|
width: "960px",
|
|
2689
2615
|
height: "540px",
|
|
@@ -2691,7 +2617,7 @@ var Upload = React7.forwardRef(
|
|
|
2691
2617
|
},
|
|
2692
2618
|
role: "button",
|
|
2693
2619
|
tabIndex: disabled ? -1 : 0,
|
|
2694
|
-
"aria-label":
|
|
2620
|
+
"aria-label": state === "uploading" ? "Uploading files" : "Upload files",
|
|
2695
2621
|
"aria-disabled": disabled,
|
|
2696
2622
|
...props,
|
|
2697
2623
|
children: [
|
|
@@ -2728,7 +2654,7 @@ var Checkbox = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
2728
2654
|
ref,
|
|
2729
2655
|
className: cn(checkboxVariants(), className),
|
|
2730
2656
|
...props,
|
|
2731
|
-
children: /* @__PURE__ */ jsx8(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center text-current", children: /* @__PURE__ */ jsx8(CheckIcon, { className: "size-3" }) })
|
|
2657
|
+
children: /* @__PURE__ */ jsx8(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center text-current", children: /* @__PURE__ */ jsx8(CheckIcon, { variant: "light", className: "size-3" }) })
|
|
2732
2658
|
}
|
|
2733
2659
|
));
|
|
2734
2660
|
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
@@ -2795,7 +2721,7 @@ var tabsVariants = cva9(
|
|
|
2795
2721
|
{
|
|
2796
2722
|
variants: {
|
|
2797
2723
|
variant: {
|
|
2798
|
-
default: "border-b-
|
|
2724
|
+
default: "border-b-1 border-subtle hover:bg-gray data-[state=active]:border-interactive data-[state=active]:text-dark data-[state=active]:border-b-2 disabled:border-subtle disabled:text-muted disabled:cursor-not-allowed"
|
|
2799
2725
|
}
|
|
2800
2726
|
},
|
|
2801
2727
|
defaultVariants: {
|
|
@@ -2922,6 +2848,176 @@ var TabsContent = React10.forwardRef(
|
|
|
2922
2848
|
}
|
|
2923
2849
|
);
|
|
2924
2850
|
TabsContent.displayName = "TabsContent";
|
|
2851
|
+
|
|
2852
|
+
// src/components/ui/dropdown-menu.tsx
|
|
2853
|
+
import * as React11 from "react";
|
|
2854
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
2855
|
+
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2856
|
+
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
2857
|
+
var DropdownMenuTrigger = React11.forwardRef(({ className, icon, children, ...props }, ref) => /* @__PURE__ */ jsxs8(
|
|
2858
|
+
DropdownMenuPrimitive.Trigger,
|
|
2859
|
+
{
|
|
2860
|
+
ref,
|
|
2861
|
+
className: cn(
|
|
2862
|
+
"inline-flex items-center justify-center rounded bg-light p-2 transition-colors hover:bg-gray focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-interactive focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
2863
|
+
className
|
|
2864
|
+
),
|
|
2865
|
+
...props,
|
|
2866
|
+
children: [
|
|
2867
|
+
icon || /* @__PURE__ */ jsx11(MoreMenu, { className: "size-4" }),
|
|
2868
|
+
children
|
|
2869
|
+
]
|
|
2870
|
+
}
|
|
2871
|
+
));
|
|
2872
|
+
DropdownMenuTrigger.displayName = DropdownMenuPrimitive.Trigger.displayName;
|
|
2873
|
+
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
2874
|
+
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
2875
|
+
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
2876
|
+
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
2877
|
+
var DropdownMenuSubTrigger = React11.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs8(
|
|
2878
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
2879
|
+
{
|
|
2880
|
+
ref,
|
|
2881
|
+
className: cn(
|
|
2882
|
+
"flex cursor-pointer select-none items-center gap-2 px-2 py-3 outline-none transition-colors hover:bg-gray focus:bg-gray data-[state=open]:bg-gray [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
2883
|
+
inset && "pl-8",
|
|
2884
|
+
className
|
|
2885
|
+
),
|
|
2886
|
+
style: { font: "var(--typography-label-sm-regular)" },
|
|
2887
|
+
...props,
|
|
2888
|
+
children: [
|
|
2889
|
+
children,
|
|
2890
|
+
/* @__PURE__ */ jsx11(ChevronRight, { className: "ml-auto" })
|
|
2891
|
+
]
|
|
2892
|
+
}
|
|
2893
|
+
));
|
|
2894
|
+
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
2895
|
+
var DropdownMenuSubContent = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
2896
|
+
DropdownMenuPrimitive.SubContent,
|
|
2897
|
+
{
|
|
2898
|
+
ref,
|
|
2899
|
+
className: cn(
|
|
2900
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border border-subtle bg-light text-dark shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",
|
|
2901
|
+
className
|
|
2902
|
+
),
|
|
2903
|
+
...props
|
|
2904
|
+
}
|
|
2905
|
+
));
|
|
2906
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
2907
|
+
var DropdownMenuContent = React11.forwardRef(({ className, sideOffset = 4, align = "end", ...props }, ref) => /* @__PURE__ */ jsx11(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx11(
|
|
2908
|
+
DropdownMenuPrimitive.Content,
|
|
2909
|
+
{
|
|
2910
|
+
ref,
|
|
2911
|
+
sideOffset,
|
|
2912
|
+
align,
|
|
2913
|
+
className: cn(
|
|
2914
|
+
"z-50 min-w-50 overflow-hidden rounded-md border border-subtle bg-light shadow-lg animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
2915
|
+
className
|
|
2916
|
+
),
|
|
2917
|
+
...props
|
|
2918
|
+
}
|
|
2919
|
+
) }));
|
|
2920
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
2921
|
+
var DropdownMenuItem = React11.forwardRef(({ className, inset, style, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
2922
|
+
DropdownMenuPrimitive.Item,
|
|
2923
|
+
{
|
|
2924
|
+
ref,
|
|
2925
|
+
className: cn(
|
|
2926
|
+
"relative flex cursor-pointer select-none items-center px-2 py-3 outline-none transition-colors hover:bg-gray focus:bg-gray data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
2927
|
+
inset && "pl-8",
|
|
2928
|
+
className
|
|
2929
|
+
),
|
|
2930
|
+
style: {
|
|
2931
|
+
font: "var(--typography-label-sm-regular)",
|
|
2932
|
+
...style
|
|
2933
|
+
},
|
|
2934
|
+
...props
|
|
2935
|
+
}
|
|
2936
|
+
));
|
|
2937
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
2938
|
+
var DropdownMenuCheckboxItem = React11.forwardRef(({ className, children, style, checked, ...props }, ref) => /* @__PURE__ */ jsxs8(
|
|
2939
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
2940
|
+
{
|
|
2941
|
+
ref,
|
|
2942
|
+
className: cn(
|
|
2943
|
+
"relative flex cursor-pointer select-none items-center gap-2 px-2 py-3 outline-none transition-colors hover:bg-gray focus:bg-gray data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
2944
|
+
className
|
|
2945
|
+
),
|
|
2946
|
+
checked,
|
|
2947
|
+
style: {
|
|
2948
|
+
font: "var(--typography-label-sm-regular)",
|
|
2949
|
+
...style
|
|
2950
|
+
},
|
|
2951
|
+
...props,
|
|
2952
|
+
children: [
|
|
2953
|
+
/* @__PURE__ */ jsx11(
|
|
2954
|
+
Checkbox,
|
|
2955
|
+
{
|
|
2956
|
+
checked: checked === true,
|
|
2957
|
+
className: "pointer-events-none",
|
|
2958
|
+
"aria-hidden": "true"
|
|
2959
|
+
}
|
|
2960
|
+
),
|
|
2961
|
+
/* @__PURE__ */ jsx11("span", { className: "flex-1", children })
|
|
2962
|
+
]
|
|
2963
|
+
}
|
|
2964
|
+
));
|
|
2965
|
+
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
2966
|
+
var DropdownMenuRadioItem = React11.forwardRef(({ className, children, style, ...props }, ref) => /* @__PURE__ */ jsxs8(
|
|
2967
|
+
DropdownMenuPrimitive.RadioItem,
|
|
2968
|
+
{
|
|
2969
|
+
ref,
|
|
2970
|
+
className: cn(
|
|
2971
|
+
"relative flex cursor-pointer select-none items-center px-2 py-3 pl-8 outline-none transition-colors hover:bg-gray focus:bg-gray data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
2972
|
+
className
|
|
2973
|
+
),
|
|
2974
|
+
style: {
|
|
2975
|
+
font: "var(--typography-label-sm-regular)",
|
|
2976
|
+
...style
|
|
2977
|
+
},
|
|
2978
|
+
...props,
|
|
2979
|
+
children: [
|
|
2980
|
+
/* @__PURE__ */ jsx11("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx11(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx11("span", { className: "h-2 w-2 rounded-full bg-current" }) }) }),
|
|
2981
|
+
children
|
|
2982
|
+
]
|
|
2983
|
+
}
|
|
2984
|
+
));
|
|
2985
|
+
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
2986
|
+
var DropdownMenuLabel = React11.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
2987
|
+
DropdownMenuPrimitive.Label,
|
|
2988
|
+
{
|
|
2989
|
+
ref,
|
|
2990
|
+
className: cn(
|
|
2991
|
+
"px-2 py-1.5 text-sm font-semibold",
|
|
2992
|
+
inset && "pl-8",
|
|
2993
|
+
className
|
|
2994
|
+
),
|
|
2995
|
+
...props
|
|
2996
|
+
}
|
|
2997
|
+
));
|
|
2998
|
+
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
2999
|
+
var DropdownMenuSeparator = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
3000
|
+
DropdownMenuPrimitive.Separator,
|
|
3001
|
+
{
|
|
3002
|
+
ref,
|
|
3003
|
+
className: cn("-mx-1 my-1 h-px bg-subtle", className),
|
|
3004
|
+
...props
|
|
3005
|
+
}
|
|
3006
|
+
));
|
|
3007
|
+
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
3008
|
+
var DropdownMenuShortcut = ({
|
|
3009
|
+
className,
|
|
3010
|
+
...props
|
|
3011
|
+
}) => {
|
|
3012
|
+
return /* @__PURE__ */ jsx11(
|
|
3013
|
+
"span",
|
|
3014
|
+
{
|
|
3015
|
+
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
3016
|
+
...props
|
|
3017
|
+
}
|
|
3018
|
+
);
|
|
3019
|
+
};
|
|
3020
|
+
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
2925
3021
|
export {
|
|
2926
3022
|
ArrowDown,
|
|
2927
3023
|
ArrowLeft,
|
|
@@ -2953,6 +3049,21 @@ export {
|
|
|
2953
3049
|
DatePicker,
|
|
2954
3050
|
Doc,
|
|
2955
3051
|
Dollar,
|
|
3052
|
+
DropdownMenu,
|
|
3053
|
+
DropdownMenuCheckboxItem,
|
|
3054
|
+
DropdownMenuContent,
|
|
3055
|
+
DropdownMenuGroup,
|
|
3056
|
+
DropdownMenuItem,
|
|
3057
|
+
DropdownMenuLabel,
|
|
3058
|
+
DropdownMenuPortal,
|
|
3059
|
+
DropdownMenuRadioGroup,
|
|
3060
|
+
DropdownMenuRadioItem,
|
|
3061
|
+
DropdownMenuSeparator,
|
|
3062
|
+
DropdownMenuShortcut,
|
|
3063
|
+
DropdownMenuSub,
|
|
3064
|
+
DropdownMenuSubContent,
|
|
3065
|
+
DropdownMenuSubTrigger,
|
|
3066
|
+
DropdownMenuTrigger,
|
|
2956
3067
|
Edit,
|
|
2957
3068
|
Envelope,
|
|
2958
3069
|
Exclamation,
|