@deftui/react 0.1.0 → 0.1.2

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 CHANGED
@@ -11,20 +11,24 @@ import { Toaster, toast } from "./vendor/shadcn/toast.mjs";
11
11
  import { Input } from "./vendor/shadcn/input.mjs";
12
12
  import { useSidebar } from "./vendor/shadcn/sidebar.mjs";
13
13
  import { Sidebar } from "./widgets/sidebar.mjs";
14
- import { Breadcrumb } from "./widgets/breadcrumb.mjs";
15
- import { Pagination } from "./widgets/pagination.mjs";
14
+ import { DatePicker, DateRange, DateRangePicker, TimePicker } from "./widgets/datetime.mjs";
15
+ import { Dropzone, formatSize } from "./widgets/dropzone.mjs";
16
16
  import { LightboxActions, LightboxBackdrop, LightboxCaptions, LightboxChangeReason, LightboxClose, LightboxContent, LightboxControl, LightboxControlContext, LightboxCounter, LightboxDownload, LightboxImageChangeEventDetails, LightboxImageItem, LightboxItem, LightboxMore, LightboxNext, LightboxOpenEventDetails, LightboxPrevious, LightboxProps, LightboxSlide, LightboxSlides, LightboxThumbnail, LightboxThumbnails, LightboxToolbar, LightboxTrigger, LightboxTriggerProps, LightboxVideoItem, LightboxViewport, LightboxZoom, LightboxZoomButton, useLightbox } from "./vendor/tailored/lightbox.mjs";
17
17
  import { Carousel, Image, ImageProps, Lightbox } from "./widgets/multimedia.mjs";
18
- import { DatePicker, DateRange, DateRangePicker, TimePicker } from "./widgets/datetime-picker.mjs";
18
+ import { Pagination } from "./widgets/pagination.mjs";
19
19
  import { Badge } from "./vendor/shadcn/badge.mjs";
20
20
  import { Switch } from "./vendor/shadcn/switch.mjs";
21
21
  import { Spinner } from "./vendor/shadcn/spinner.mjs";
22
+ import { Skeleton } from "./vendor/shadcn/skeleton.mjs";
23
+ import { Checkbox } from "./vendor/shadcn/checkbox.mjs";
22
24
  import { Textarea } from "./vendor/shadcn/textarea.mjs";
23
25
  import { ScrollArea } from "./vendor/coss/scroll-area.mjs";
24
26
  import { Form } from "./vendor/coss/form.mjs";
25
27
  import { IconSwap } from "./vendor/tailored/icon-swap.mjs";
26
- import { AlertDialog, ButtonGroup, Card, Combobox, Dialog, Drawer, Dropdown, Empty, Field, InputGroup, Kbd, Popover, Progress, Radio, Select, Table, Tabs, Tooltip } from "./widgets/index.mjs";
28
+ import { AlertDialog, Breadcrumb, ButtonGroup, Calendar, Card, Combobox, Dialog, Drawer, Dropdown, Empty, Field, InputGroup, Kbd, Popover, Progress, Radio, Select, Table, Tabs, Tooltip } from "./widgets/index.mjs";
27
29
  import { cn } from "cn";
28
30
  import { cva } from "class-variance-authority";
29
31
  import { mergeProps } from "@base-ui/react/merge-props";
30
- export { AlertDialog, type AlertDialogHandle, Badge, Breadcrumb, Button, ButtonGroup, Card, Carousel, Combobox, type ComboboxItemCollection, type ComboboxPrimitiveValue, type CreateComboboxItemsOptions, DatePicker, type DateRange, DateRangePicker, Dialog, type DialogHandle, Drawer, type DrawerHandle, Dropdown, Empty, Field, Form, IconSwap, Image, ImageProps, Input, InputGroup, Kbd, Label, Lightbox, type LightboxActions, type LightboxBackdrop, type LightboxCaptions, type LightboxChangeReason, type LightboxClose, type LightboxContent, type LightboxControl, type LightboxControlContext, type LightboxCounter, type LightboxDownload, type LightboxImageChangeEventDetails, type LightboxImageItem, type LightboxItem, type LightboxMore, type LightboxNext, type LightboxOpenEventDetails, type LightboxPrevious, type LightboxProps, type LightboxSlide, type LightboxSlides, type LightboxThumbnail, type LightboxThumbnails, type LightboxToolbar, type LightboxTrigger, type LightboxTriggerProps, type LightboxVideoItem, type LightboxViewport, type LightboxZoom, type LightboxZoomButton, Pagination, Popover, Progress, Radio, ScrollArea, Select, Separator, Sidebar, Spinner, Switch, Table, Tabs, Textarea, TimePicker, Toaster as ToastProvider, Tooltip, cn, createAlertDialogHandle, createComboboxItems, createDialogHandle, createDrawerHandle, cva, mergeProps, toast, useCopyToClipboard, useIsMobile, type useLightbox, useMediaQuery, useSidebar };
32
+ import { useDropzone } from "react-dropzone";
33
+ export type * from "react-dropzone";
34
+ export { AlertDialog, type AlertDialogHandle, Badge, Breadcrumb, Button, ButtonGroup, Calendar, Card, Carousel, Checkbox, Combobox, type ComboboxItemCollection, type ComboboxPrimitiveValue, type CreateComboboxItemsOptions, DatePicker, type DateRange, DateRangePicker, Dialog, type DialogHandle, Drawer, type DrawerHandle, Dropdown, Dropzone, Empty, Field, Form, IconSwap, Image, ImageProps, Input, InputGroup, Kbd, Label, Lightbox, type LightboxActions, type LightboxBackdrop, type LightboxCaptions, type LightboxChangeReason, type LightboxClose, type LightboxContent, type LightboxControl, type LightboxControlContext, type LightboxCounter, type LightboxDownload, type LightboxImageChangeEventDetails, type LightboxImageItem, type LightboxItem, type LightboxMore, type LightboxNext, type LightboxOpenEventDetails, type LightboxPrevious, type LightboxProps, type LightboxSlide, type LightboxSlides, type LightboxThumbnail, type LightboxThumbnails, type LightboxToolbar, type LightboxTrigger, type LightboxTriggerProps, type LightboxVideoItem, type LightboxViewport, type LightboxZoom, type LightboxZoomButton, Pagination, Popover, Progress, Radio, ScrollArea, Select, Separator, Sidebar, Skeleton, Spinner, Switch, Table, Tabs, Textarea, TimePicker, Toaster as ToastProvider, Tooltip, cn, createAlertDialogHandle, createComboboxItems, createDialogHandle, createDrawerHandle, cva, formatSize, mergeProps, toast, useCopyToClipboard, useDropzone, useIsMobile, type useLightbox, useMediaQuery, useSidebar };
package/dist/index.mjs CHANGED
@@ -11,19 +11,22 @@ import { createDialogHandle } from "./vendor/shadcn/dialog.mjs";
11
11
  import { createDrawerHandle } from "./vendor/shadcn/drawer.mjs";
12
12
  import { Label } from "./vendor/shadcn/label.mjs";
13
13
  import { Toaster, toast } from "./vendor/shadcn/toast.mjs";
14
+ import { Skeleton } from "./vendor/shadcn/skeleton.mjs";
14
15
  import { useSidebar } from "./vendor/shadcn/sidebar.mjs";
15
16
  import { Sidebar } from "./widgets/sidebar.mjs";
16
- import { Breadcrumb } from "./widgets/breadcrumb.mjs";
17
- import { Pagination } from "./widgets/pagination.mjs";
17
+ import { DatePicker, DateRangePicker, TimePicker } from "./widgets/datetime.mjs";
18
+ import { Dropzone, formatSize } from "./widgets/dropzone.mjs";
18
19
  import { Carousel, Image, Lightbox } from "./widgets/multimedia.mjs";
19
- import { DatePicker, DateRangePicker, TimePicker } from "./widgets/datetime-picker.mjs";
20
+ import { Pagination } from "./widgets/pagination.mjs";
20
21
  import { Badge } from "./vendor/shadcn/badge.mjs";
21
22
  import { Switch } from "./vendor/shadcn/switch.mjs";
23
+ import { Checkbox } from "./vendor/shadcn/checkbox.mjs";
22
24
  import { ScrollArea } from "./vendor/coss/scroll-area.mjs";
23
25
  import { Form } from "./vendor/coss/form.mjs";
24
26
  import { IconSwap } from "./vendor/tailored/icon-swap.mjs";
25
- import { AlertDialog, ButtonGroup, Card, Combobox, Dialog, Drawer, Dropdown, Empty, Field, InputGroup, Kbd, Popover, Progress, Radio, Select, Table, Tabs, Tooltip } from "./widgets/index.mjs";
27
+ import { AlertDialog, Breadcrumb, ButtonGroup, Calendar, Card, Combobox, Dialog, Drawer, Dropdown, Empty, Field, InputGroup, Kbd, Popover, Progress, Radio, Select, Table, Tabs, Tooltip } from "./widgets/index.mjs";
26
28
  import { cn } from "cn";
27
29
  import { cva } from "class-variance-authority";
28
30
  import { mergeProps } from "@base-ui/react/merge-props";
29
- export { AlertDialog, Badge, Breadcrumb, Button, ButtonGroup, Card, Carousel, Combobox, DatePicker, DateRangePicker, Dialog, Drawer, Dropdown, Empty, Field, Form, IconSwap, Image, Input, InputGroup, Kbd, Label, Lightbox, Pagination, Popover, Progress, Radio, ScrollArea, Select, Separator, Sidebar, Spinner, Switch, Table, Tabs, Textarea, TimePicker, Toaster as ToastProvider, Tooltip, cn, createAlertDialogHandle, createComboboxItems, createDialogHandle, createDrawerHandle, cva, mergeProps, toast, useCopyToClipboard, useIsMobile, useMediaQuery, useSidebar };
31
+ import { useDropzone } from "react-dropzone";
32
+ export { AlertDialog, Badge, Breadcrumb, Button, ButtonGroup, Calendar, Card, Carousel, Checkbox, Combobox, DatePicker, DateRangePicker, Dialog, Drawer, Dropdown, Dropzone, Empty, Field, Form, IconSwap, Image, Input, InputGroup, Kbd, Label, Lightbox, Pagination, Popover, Progress, Radio, ScrollArea, Select, Separator, Sidebar, Skeleton, Spinner, Switch, Table, Tabs, Textarea, TimePicker, Toaster as ToastProvider, Tooltip, cn, createAlertDialogHandle, createComboboxItems, createDialogHandle, createDrawerHandle, cva, formatSize, mergeProps, toast, useCopyToClipboard, useDropzone, useIsMobile, useMediaQuery, useSidebar };
@@ -24,6 +24,7 @@ shadcn 组件使用 `components.json` 中的 `base-vega` 风格和 Lucide 图标
24
24
  | `calendar` | [shadcn/calendar.tsx](shadcn/calendar.tsx) | [Calendar](https://ui.shadcn.com/docs/components/base/calendar) | 将 `react-day-picker` 导入改为 `@daypicker/react` |
25
25
  | `card` | [shadcn/card.tsx](shadcn/card.tsx) | [Card](https://ui.shadcn.com/docs/components/base/card) | — |
26
26
  | `carousel` | [shadcn/carousel.tsx](shadcn/carousel.tsx) | [Carousel](https://ui.shadcn.com/docs/components/base/carousel) | — |
27
+ | `checkbox` | [shadcn/checkbox.tsx](shadcn/checkbox.tsx) | [Checkbox](https://ui.shadcn.com/docs/components/base/checkbox) | — |
27
28
  | `combobox` | [shadcn/combobox.tsx](shadcn/combobox.tsx) | [Combobox](https://ui.shadcn.com/docs/components/base/combobox) | 额外导出 `createComboboxItems` 及其类型 |
28
29
  | `dialog` | [shadcn/dialog.tsx](shadcn/dialog.tsx) | [Dialog](https://ui.shadcn.com/docs/components/base/dialog) | 额外导出 `createDialogHandle` 及其类型 |
29
30
  | `direction` | [shadcn/direction.tsx](shadcn/direction.tsx) | [Direction](https://ui.shadcn.com/docs/components/base/direction) | — |
@@ -1,7 +1,10 @@
1
1
  import { Button } from "./button.mjs";
2
2
  import * as React$1 from "react";
3
- import { DayPicker } from "@daypicker/react";
3
+ import { DayButton, DayPicker, Locale } from "@daypicker/react";
4
4
  declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, locale, formatters, components, ...props }: React$1.ComponentProps<typeof DayPicker> & {
5
5
  buttonVariant?: React$1.ComponentProps<typeof Button>["variant"];
6
6
  }): React$1.JSX.Element;
7
- export { Calendar };
7
+ declare function CalendarDayButton({ className, day, modifiers, locale, ...props }: React$1.ComponentProps<typeof DayButton> & {
8
+ locale?: Partial<Locale>;
9
+ }): React$1.JSX.Element;
10
+ export { Calendar, CalendarDayButton };
@@ -0,0 +1,3 @@
1
+ import { Checkbox } from "@base-ui/react/checkbox";
2
+ declare function Checkbox$1({ className, ...props }: Checkbox.Root.Props): import("react").JSX.Element;
3
+ export { Checkbox$1 as Checkbox };
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ import { cn } from "cn";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { CheckIcon } from "lucide-react";
5
+ import { Checkbox } from "@base-ui/react/checkbox";
6
+ // src/vendor/shadcn/checkbox.tsx
7
+ function Checkbox$1({ className, ...props }) {
8
+ return /* @__PURE__ */ jsx(Checkbox.Root, {
9
+ "data-slot": "checkbox",
10
+ className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary", className),
11
+ ...props,
12
+ children: /* @__PURE__ */ jsx(Checkbox.Indicator, {
13
+ "data-slot": "checkbox-indicator",
14
+ className: "grid place-content-center text-current transition-none [&>svg]:size-3.5",
15
+ children: /* @__PURE__ */ jsx(CheckIcon, {})
16
+ })
17
+ });
18
+ }
19
+ export { Checkbox$1 as Checkbox };
@@ -0,0 +1,2 @@
1
+ declare function Skeleton({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
2
+ export { Skeleton };
@@ -1,6 +1,6 @@
1
1
  import { Button } from "../vendor/shadcn/button.mjs";
2
- import { Input } from "../vendor/shadcn/input.mjs";
3
2
  import { Calendar } from "../vendor/shadcn/calendar.mjs";
3
+ import { Input } from "../vendor/shadcn/input.mjs";
4
4
  import { ComponentProps } from "react";
5
5
  import { DateRange } from "@daypicker/react";
6
6
  type PickerProps<T> = Omit<ComponentProps<typeof Button>, "children" | "render" | "value" | "defaultValue" | "onChange"> & {
@@ -1,13 +1,13 @@
1
1
  import { Button } from "../vendor/shadcn/button.mjs";
2
+ import { Calendar } from "../vendor/shadcn/calendar.mjs";
2
3
  import { Input } from "../vendor/shadcn/input.mjs";
3
4
  import { Popover, PopoverContent, PopoverTrigger } from "../vendor/shadcn/popover.mjs";
4
- import { Calendar } from "../vendor/shadcn/calendar.mjs";
5
5
  import { cn } from "cn";
6
6
  import { useState } from "react";
7
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
8
  import { CalendarIcon } from "lucide-react";
9
9
  import { format } from "date-fns";
10
- // src/widgets/datetime-picker.tsx
10
+ // src/widgets/datetime.tsx
11
11
  function TimePicker({ className, step = "1", ...props }) {
12
12
  return /* @__PURE__ */ jsx(Input, {
13
13
  ...props,
@@ -0,0 +1,6 @@
1
+ import { DropzoneOptions } from "react-dropzone";
2
+ import { ComponentProps } from "react";
3
+ type DropzoneProps = DropzoneOptions & Omit<ComponentProps<"div">, keyof DropzoneOptions>;
4
+ export declare function formatSize(bytes: number): string;
5
+ export declare function Dropzone({ accept, minSize, maxSize, maxFiles, multiple, disabled, preventDropOnDocument, noClick, noKeyboard, noDrag, noDragEventsBubbling, noPaste, onDrop, onDropAccepted, onDropRejected, onDragEnter, onDragOver, onDragLeave, getFilesFromEvent, onFileDialogCancel, onFileDialogOpen, onError, validator, getErrorMessage, useFsAccessApi, autoFocus, children, className, ref, ...props }: DropzoneProps): import("react").JSX.Element;
6
+ export {};
@@ -0,0 +1,98 @@
1
+ "use client";
2
+ import { buttonVariants } from "../vendor/shadcn/button.mjs";
3
+ import { cn } from "cn";
4
+ import { useDropzone } from "react-dropzone";
5
+ import { useId, useImperativeHandle } from "react";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ import { UploadIcon } from "lucide-react";
8
+ // src/widgets/dropzone.tsx
9
+ function formatSize(bytes) {
10
+ const units = [
11
+ "B",
12
+ "KB",
13
+ "MB",
14
+ "GB",
15
+ "TB"
16
+ ];
17
+ const index = bytes > 0 ? Math.min(Math.floor(Math.log(bytes) / Math.log(1024)), units.length - 1) : 0;
18
+ return `${Number((bytes / 1024 ** index).toFixed(1))} ${units[index]}`;
19
+ }
20
+ function Dropzone({ accept, minSize, maxSize, maxFiles, multiple, disabled, preventDropOnDocument, noClick, noKeyboard, noDrag, noDragEventsBubbling, noPaste, onDrop, onDropAccepted, onDropRejected, onDragEnter, onDragOver, onDragLeave, getFilesFromEvent, onFileDialogCancel, onFileDialogOpen, onError, validator, getErrorMessage, useFsAccessApi, autoFocus, children, className, ref, ...props }) {
21
+ const { getRootProps, getInputProps, rootRef, isDragActive, isDragReject, isProcessing } = useDropzone({
22
+ accept,
23
+ minSize,
24
+ maxSize,
25
+ maxFiles,
26
+ multiple,
27
+ disabled,
28
+ preventDropOnDocument,
29
+ noClick,
30
+ noKeyboard,
31
+ noDrag,
32
+ noDragEventsBubbling,
33
+ noPaste,
34
+ onDrop,
35
+ onDropAccepted,
36
+ onDropRejected,
37
+ onDragEnter,
38
+ onDragOver,
39
+ onDragLeave,
40
+ getFilesFromEvent,
41
+ onFileDialogCancel,
42
+ onFileDialogOpen,
43
+ onError,
44
+ validator,
45
+ getErrorMessage,
46
+ useFsAccessApi,
47
+ autoFocus
48
+ });
49
+ useImperativeHandle(ref, () => rootRef.current);
50
+ const descriptionId = useId();
51
+ const limits = [multiple === false ? "单个文件" : maxFiles && maxFiles > 0 ? `最多 ${maxFiles} 个文件` : void 0, maxSize !== void 0 && Number.isFinite(maxSize) ? `每个不超过 ${formatSize(maxSize)}` : void 0].filter(Boolean);
52
+ return /* @__PURE__ */ jsxs("div", {
53
+ ...getRootProps({
54
+ "role": "button",
55
+ "aria-label": children == null ? "选择文件" : void 0,
56
+ "data-slot": "dropzone",
57
+ "data-state": isDragReject ? "reject" : isDragActive ? "active" : "idle",
58
+ "data-disabled": disabled || void 0,
59
+ ...props,
60
+ "aria-describedby": children == null ? [props["aria-describedby"], descriptionId].filter(Boolean).join(" ") : props["aria-describedby"],
61
+ "aria-busy": isProcessing || props["aria-busy"],
62
+ "className": cn("bg-background hover:bg-muted/30 focus-visible:border-ring focus-visible:ring-ring/50 data-[state=active]:border-ring data-[state=active]:bg-muted/50 data-[state=reject]:border-destructive data-[state=reject]:bg-destructive/5 data-[disabled]:hover:bg-background flex min-h-48 cursor-pointer flex-col items-center justify-center rounded-lg border-2 border-dashed px-6 py-6 text-center text-sm transition-colors outline-none focus-visible:ring-3 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50", className)
63
+ }),
64
+ children: [/* @__PURE__ */ jsx("input", { ...getInputProps({
65
+ disabled,
66
+ "aria-hidden": true
67
+ }) }), children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
68
+ /* @__PURE__ */ jsx("span", {
69
+ "data-slot": "dropzone-icon",
70
+ className: "text-muted-foreground mb-2 grid size-11 place-items-center rounded-full border",
71
+ children: /* @__PURE__ */ jsx(UploadIcon, {
72
+ "aria-hidden": "true",
73
+ className: "size-5"
74
+ })
75
+ }),
76
+ /* @__PURE__ */ jsx("p", {
77
+ "data-slot": "dropzone-title",
78
+ className: "font-medium",
79
+ children: isDragReject ? "暂不支持这些文件" : isDragActive ? "松开以添加文件" : "将文件拖到此处"
80
+ }),
81
+ /* @__PURE__ */ jsxs("p", {
82
+ id: descriptionId,
83
+ "data-slot": "dropzone-description",
84
+ className: "text-muted-foreground mt-1 text-xs",
85
+ children: ["或点击选择", limits.length > 0 && `(${limits.join(",")})`]
86
+ }),
87
+ /* @__PURE__ */ jsx("span", {
88
+ "data-slot": "dropzone-action",
89
+ className: cn(buttonVariants({
90
+ variant: "outline",
91
+ size: "sm"
92
+ }), "mt-4"),
93
+ children: "选择文件"
94
+ })
95
+ ] })]
96
+ });
97
+ }
98
+ export { Dropzone, formatSize };
@@ -1,8 +1,10 @@
1
1
  import { Empty as Empty$1, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from "../vendor/coss/empty.mjs";
2
2
  import { Button } from "../vendor/shadcn/button.mjs";
3
3
  import { AlertDialog as AlertDialog$1, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHandle, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, createAlertDialogHandle } from "../vendor/shadcn/alert-dialog.mjs";
4
+ import { Breadcrumb as Breadcrumb$1, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "../vendor/shadcn/breadcrumb.mjs";
4
5
  import { Separator } from "../vendor/shadcn/separator.mjs";
5
6
  import { ButtonGroup as ButtonGroup$1, ButtonGroupSeparator, ButtonGroupText } from "../vendor/shadcn/button-group.mjs";
7
+ import { Calendar as Calendar$1, CalendarDayButton } from "../vendor/shadcn/calendar.mjs";
6
8
  import { Card as Card$1, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "../vendor/shadcn/card.mjs";
7
9
  import { ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxItemCollection, ComboboxLabel, ComboboxList, ComboboxPrimitiveValue, ComboboxValue, CreateComboboxItemsOptions, createComboboxItems } from "../vendor/shadcn/combobox.mjs";
8
10
  import { Dialog as Dialog$1, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHandle, DialogHeader, DialogTitle, DialogTrigger, createDialogHandle } from "../vendor/shadcn/dialog.mjs";
@@ -25,14 +27,16 @@ import "./toast.mjs";
25
27
  import { Input } from "../vendor/shadcn/input.mjs";
26
28
  import { useSidebar } from "../vendor/shadcn/sidebar.mjs";
27
29
  import { Sidebar } from "./sidebar.mjs";
28
- import { Breadcrumb } from "./breadcrumb.mjs";
29
- import { Pagination } from "./pagination.mjs";
30
+ import { DatePicker, DateRange, DateRangePicker, TimePicker } from "./datetime.mjs";
31
+ import { Dropzone, formatSize } from "./dropzone.mjs";
30
32
  import { LightboxActions, LightboxBackdrop, LightboxCaptions, LightboxChangeReason, LightboxClose, LightboxContent, LightboxControl, LightboxControlContext, LightboxCounter, LightboxDownload, LightboxImageChangeEventDetails, LightboxImageItem, LightboxItem, LightboxMore, LightboxNext, LightboxOpenEventDetails, LightboxPrevious, LightboxProps, LightboxSlide, LightboxSlides, LightboxThumbnail, LightboxThumbnails, LightboxToolbar, LightboxTrigger, LightboxTriggerProps, LightboxVideoItem, LightboxViewport, LightboxZoom, LightboxZoomButton, useLightbox } from "../vendor/tailored/lightbox.mjs";
31
33
  import { Carousel, Image, ImageProps, Lightbox } from "./multimedia.mjs";
32
- import { DatePicker, DateRange, DateRangePicker, TimePicker } from "./datetime-picker.mjs";
34
+ import { Pagination } from "./pagination.mjs";
33
35
  import { Badge } from "../vendor/shadcn/badge.mjs";
34
36
  import { Switch } from "../vendor/shadcn/switch.mjs";
35
37
  import { Spinner } from "../vendor/shadcn/spinner.mjs";
38
+ import { Skeleton } from "../vendor/shadcn/skeleton.mjs";
39
+ import { Checkbox } from "../vendor/shadcn/checkbox.mjs";
36
40
  import { Textarea } from "../vendor/shadcn/textarea.mjs";
37
41
  import { ScrollArea } from "../vendor/coss/scroll-area.mjs";
38
42
  import { Form } from "../vendor/coss/form.mjs";
@@ -129,12 +133,37 @@ export declare const Dropdown: typeof DropdownMenu & {
129
133
  RadioGroup: typeof DropdownMenuRadioGroup;
130
134
  CheckboxItem: typeof DropdownMenuCheckboxItem;
131
135
  };
136
+ export declare const Combobox: typeof import("@base-ui/react").ComboboxRoot & {
137
+ Content: typeof ComboboxContent;
138
+ Empty: typeof ComboboxEmpty;
139
+ List: typeof ComboboxList;
140
+ Input: typeof ComboboxInput;
141
+ ChipsInput: typeof ComboboxChipsInput;
142
+ Chips: typeof ComboboxChips;
143
+ Value: typeof ComboboxValue;
144
+ Chip: typeof ComboboxChip;
145
+ Group: typeof ComboboxGroup;
146
+ GroupLabel: typeof ComboboxLabel;
147
+ GroupCollection: typeof ComboboxCollection;
148
+ Item: typeof ComboboxItem;
149
+ };
132
150
  export declare const Progress: typeof Progress$1 & {
133
151
  Label: typeof ProgressLabel;
134
152
  Value: typeof ProgressValue;
135
153
  Track: typeof ProgressTrack;
136
154
  Indicator: typeof ProgressIndicator;
137
155
  };
156
+ export declare const Calendar: typeof Calendar$1 & {
157
+ DayButton: typeof CalendarDayButton;
158
+ };
159
+ export declare const Breadcrumb: typeof Breadcrumb$1 & {
160
+ List: typeof BreadcrumbList;
161
+ Item: typeof BreadcrumbItem;
162
+ Separator: typeof BreadcrumbSeparator;
163
+ Link: typeof BreadcrumbLink;
164
+ Ellipsis: typeof BreadcrumbEllipsis;
165
+ Page: typeof BreadcrumbPage;
166
+ };
138
167
  export declare const AlertDialog: typeof AlertDialog$1 & {
139
168
  Trigger: typeof AlertDialogTrigger;
140
169
  Close: typeof AlertDialogCancel;
@@ -156,18 +185,4 @@ export declare const InputGroup: typeof InputGroup$1 & {
156
185
  Textarea: typeof InputGroupTextarea;
157
186
  Button: typeof InputGroupButton;
158
187
  };
159
- export declare const Combobox: typeof import("@base-ui/react").ComboboxRoot & {
160
- Content: typeof ComboboxContent;
161
- Empty: typeof ComboboxEmpty;
162
- List: typeof ComboboxList;
163
- Input: typeof ComboboxInput;
164
- ChipsInput: typeof ComboboxChipsInput;
165
- Chips: typeof ComboboxChips;
166
- Value: typeof ComboboxValue;
167
- Chip: typeof ComboboxChip;
168
- Group: typeof ComboboxGroup;
169
- GroupLabel: typeof ComboboxLabel;
170
- GroupCollection: typeof ComboboxCollection;
171
- Item: typeof ComboboxItem;
172
- };
173
- export { type AlertDialogHandle, Badge, Breadcrumb, Button, Carousel, type ComboboxItemCollection, type ComboboxPrimitiveValue, type CreateComboboxItemsOptions, DatePicker, type DateRange, DateRangePicker, type DialogHandle, type DrawerHandle, Form, IconSwap, Image, ImageProps, Input, Label, Lightbox, type LightboxActions, type LightboxBackdrop, type LightboxCaptions, type LightboxChangeReason, type LightboxClose, type LightboxContent, type LightboxControl, type LightboxControlContext, type LightboxCounter, type LightboxDownload, type LightboxImageChangeEventDetails, type LightboxImageItem, type LightboxItem, type LightboxMore, type LightboxNext, type LightboxOpenEventDetails, type LightboxPrevious, type LightboxProps, type LightboxSlide, type LightboxSlides, type LightboxThumbnail, type LightboxThumbnails, type LightboxToolbar, type LightboxTrigger, type LightboxTriggerProps, type LightboxVideoItem, type LightboxViewport, type LightboxZoom, type LightboxZoomButton, Pagination, ScrollArea, Separator, Sidebar, Spinner, Switch, Textarea, TimePicker, Toaster as ToastProvider, createAlertDialogHandle, createComboboxItems, createDialogHandle, createDrawerHandle, toast, type useLightbox, useSidebar };
188
+ export { type AlertDialogHandle, Badge, Button, Carousel, Checkbox, type ComboboxItemCollection, type ComboboxPrimitiveValue, type CreateComboboxItemsOptions, DatePicker, type DateRange, DateRangePicker, type DialogHandle, type DrawerHandle, Dropzone, Form, IconSwap, Image, ImageProps, Input, Label, Lightbox, type LightboxActions, type LightboxBackdrop, type LightboxCaptions, type LightboxChangeReason, type LightboxClose, type LightboxContent, type LightboxControl, type LightboxControlContext, type LightboxCounter, type LightboxDownload, type LightboxImageChangeEventDetails, type LightboxImageItem, type LightboxItem, type LightboxMore, type LightboxNext, type LightboxOpenEventDetails, type LightboxPrevious, type LightboxProps, type LightboxSlide, type LightboxSlides, type LightboxThumbnail, type LightboxThumbnails, type LightboxToolbar, type LightboxTrigger, type LightboxTriggerProps, type LightboxVideoItem, type LightboxViewport, type LightboxZoom, type LightboxZoomButton, Pagination, ScrollArea, Separator, Sidebar, Skeleton, Spinner, Switch, Textarea, TimePicker, Toaster as ToastProvider, createAlertDialogHandle, createComboboxItems, createDialogHandle, createDrawerHandle, formatSize, toast, type useLightbox, useSidebar };
@@ -2,8 +2,10 @@ import { Empty as Empty$1, EmptyContent, EmptyDescription, EmptyHeader, EmptyMed
2
2
  import { Spinner } from "../vendor/shadcn/spinner.mjs";
3
3
  import { Button } from "../vendor/shadcn/button.mjs";
4
4
  import { AlertDialog as AlertDialog$1, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, createAlertDialogHandle } from "../vendor/shadcn/alert-dialog.mjs";
5
+ import { Breadcrumb as Breadcrumb$1, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "../vendor/shadcn/breadcrumb.mjs";
5
6
  import { Separator } from "../vendor/shadcn/separator.mjs";
6
7
  import { ButtonGroup as ButtonGroup$1, ButtonGroupSeparator, ButtonGroupText } from "../vendor/shadcn/button-group.mjs";
8
+ import { Calendar as Calendar$1, CalendarDayButton } from "../vendor/shadcn/calendar.mjs";
7
9
  import { Card as Card$1, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "../vendor/shadcn/card.mjs";
8
10
  import { Input } from "../vendor/shadcn/input.mjs";
9
11
  import { Textarea } from "../vendor/shadcn/textarea.mjs";
@@ -23,14 +25,16 @@ import { Table as Table$1, TableBody, TableCell, TableFooter, TableHead, TableHe
23
25
  import { Tabs as Tabs$1, TabsContent, TabsList, TabsTrigger } from "../vendor/shadcn/tabs.mjs";
24
26
  import { Tooltip as Tooltip$1, TooltipContent, TooltipProvider, TooltipTrigger } from "../vendor/shadcn/tooltip.mjs";
25
27
  import { Toaster, toast } from "../vendor/shadcn/toast.mjs";
28
+ import { Skeleton } from "../vendor/shadcn/skeleton.mjs";
26
29
  import { useSidebar } from "../vendor/shadcn/sidebar.mjs";
27
30
  import { Sidebar } from "./sidebar.mjs";
28
- import { Breadcrumb } from "./breadcrumb.mjs";
29
- import { Pagination } from "./pagination.mjs";
31
+ import { DatePicker, DateRangePicker, TimePicker } from "./datetime.mjs";
32
+ import { Dropzone, formatSize } from "./dropzone.mjs";
30
33
  import { Carousel, Image, Lightbox } from "./multimedia.mjs";
31
- import { DatePicker, DateRangePicker, TimePicker } from "./datetime-picker.mjs";
34
+ import { Pagination } from "./pagination.mjs";
32
35
  import { Badge } from "../vendor/shadcn/badge.mjs";
33
36
  import { Switch } from "../vendor/shadcn/switch.mjs";
37
+ import { Checkbox } from "../vendor/shadcn/checkbox.mjs";
34
38
  import { ScrollArea } from "../vendor/coss/scroll-area.mjs";
35
39
  import { Form } from "../vendor/coss/form.mjs";
36
40
  import { IconSwap } from "../vendor/tailored/icon-swap.mjs";
@@ -123,12 +127,35 @@ const Dropdown = /* @__PURE__ */ Object.assign(DropdownMenu, {
123
127
  RadioGroup: DropdownMenuRadioGroup,
124
128
  CheckboxItem: DropdownMenuCheckboxItem
125
129
  });
130
+ const Combobox = /* @__PURE__ */ Object.assign(Combobox$1, {
131
+ Content: ComboboxContent,
132
+ Empty: ComboboxEmpty,
133
+ List: ComboboxList,
134
+ Input: ComboboxInput,
135
+ ChipsInput: ComboboxChipsInput,
136
+ Chips: ComboboxChips,
137
+ Value: ComboboxValue,
138
+ Chip: ComboboxChip,
139
+ Group: ComboboxGroup,
140
+ GroupLabel: ComboboxLabel,
141
+ GroupCollection: ComboboxCollection,
142
+ Item: ComboboxItem
143
+ });
126
144
  const Progress = /* @__PURE__ */ Object.assign(Progress$1, {
127
145
  Label: ProgressLabel,
128
146
  Value: ProgressValue,
129
147
  Track: ProgressTrack,
130
148
  Indicator: ProgressIndicator
131
149
  });
150
+ const Calendar = /* @__PURE__ */ Object.assign(Calendar$1, { DayButton: CalendarDayButton });
151
+ const Breadcrumb = /* @__PURE__ */ Object.assign(Breadcrumb$1, {
152
+ List: BreadcrumbList,
153
+ Item: BreadcrumbItem,
154
+ Separator: BreadcrumbSeparator,
155
+ Link: BreadcrumbLink,
156
+ Ellipsis: BreadcrumbEllipsis,
157
+ Page: BreadcrumbPage
158
+ });
132
159
  const AlertDialog = /* @__PURE__ */ Object.assign(AlertDialog$1, {
133
160
  Trigger: AlertDialogTrigger,
134
161
  Close: AlertDialogCancel,
@@ -150,18 +177,4 @@ const InputGroup = /* @__PURE__ */ Object.assign(InputGroup$1, {
150
177
  Textarea: InputGroupTextarea,
151
178
  Button: InputGroupButton
152
179
  });
153
- const Combobox = /* @__PURE__ */ Object.assign(Combobox$1, {
154
- Content: ComboboxContent,
155
- Empty: ComboboxEmpty,
156
- List: ComboboxList,
157
- Input: ComboboxInput,
158
- ChipsInput: ComboboxChipsInput,
159
- Chips: ComboboxChips,
160
- Value: ComboboxValue,
161
- Chip: ComboboxChip,
162
- Group: ComboboxGroup,
163
- GroupLabel: ComboboxLabel,
164
- GroupCollection: ComboboxCollection,
165
- Item: ComboboxItem
166
- });
167
- export { AlertDialog, Badge, Breadcrumb, Button, ButtonGroup, Card, Carousel, Combobox, DatePicker, DateRangePicker, Dialog, Drawer, Dropdown, Empty, Field, Form, IconSwap, Image, Input, InputGroup, Kbd, Label, Lightbox, Pagination, Popover, Progress, Radio, ScrollArea, Select, Separator, Sidebar, Spinner, Switch, Table, Tabs, Textarea, TimePicker, Toaster as ToastProvider, Tooltip, createAlertDialogHandle, createComboboxItems, createDialogHandle, createDrawerHandle, toast, useSidebar };
180
+ export { AlertDialog, Badge, Breadcrumb, Button, ButtonGroup, Calendar, Card, Carousel, Checkbox, Combobox, DatePicker, DateRangePicker, Dialog, Drawer, Dropdown, Dropzone, Empty, Field, Form, IconSwap, Image, Input, InputGroup, Kbd, Label, Lightbox, Pagination, Popover, Progress, Radio, ScrollArea, Select, Separator, Sidebar, Skeleton, Spinner, Switch, Table, Tabs, Textarea, TimePicker, Toaster as ToastProvider, Tooltip, createAlertDialogHandle, createComboboxItems, createDialogHandle, createDrawerHandle, formatSize, toast, useSidebar };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deftui/react",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/KiriRainCat/deftui.git",
@@ -43,6 +43,7 @@
43
43
  "lucide-react": "^1.62.0",
44
44
  "motion": "^14.7.1",
45
45
  "radashi": "^12.9.7",
46
+ "react-dropzone": "^20.1.4",
46
47
  "tw-animate-css": "^1.4.0"
47
48
  },
48
49
  "devDependencies": {
@@ -1,16 +0,0 @@
1
- import { Breadcrumb as Breadcrumb$1, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "../vendor/shadcn/breadcrumb.mjs";
2
- import React from "react";
3
- type ASTProps = Omit<React.ComponentProps<typeof Breadcrumb$1>, "children"> & {
4
- children: React.ReactElement | React.ReactElement[];
5
- };
6
- declare function BreadcrumbAST({ children, ...props }: ASTProps): React.JSX.Element;
7
- export declare const Breadcrumb: typeof Breadcrumb$1 & {
8
- AST: typeof BreadcrumbAST;
9
- List: typeof BreadcrumbList;
10
- Item: typeof BreadcrumbItem;
11
- Separator: typeof BreadcrumbSeparator;
12
- Link: typeof BreadcrumbLink;
13
- Ellipsis: typeof BreadcrumbEllipsis;
14
- Page: typeof BreadcrumbPage;
15
- };
16
- export {};
@@ -1,21 +0,0 @@
1
- import { Breadcrumb as Breadcrumb$1, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "../vendor/shadcn/breadcrumb.mjs";
2
- import React from "react";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
- import { castArray } from "radashi";
5
- // src/widgets/breadcrumb.tsx
6
- function BreadcrumbAST({ children, ...props }) {
7
- return /* @__PURE__ */ jsx(Breadcrumb, {
8
- ...props,
9
- children: /* @__PURE__ */ jsx(Breadcrumb.List, { children: castArray(children).map((item, index) => /* @__PURE__ */ jsxs(React.Fragment, { children: [index > 0 && /* @__PURE__ */ jsx(Breadcrumb.Separator, {}), /* @__PURE__ */ jsx(Breadcrumb.Item, { children: item })] }, item.key ?? index)) })
10
- });
11
- }
12
- const Breadcrumb = /* @__PURE__ */ Object.assign(Breadcrumb$1, {
13
- AST: BreadcrumbAST,
14
- List: BreadcrumbList,
15
- Item: BreadcrumbItem,
16
- Separator: BreadcrumbSeparator,
17
- Link: BreadcrumbLink,
18
- Ellipsis: BreadcrumbEllipsis,
19
- Page: BreadcrumbPage
20
- });
21
- export { Breadcrumb };