@deftui/react 0.3.1 → 0.3.3
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 +2 -2
- package/dist/index.mjs +2 -2
- package/dist/vendor/README.md +3 -1
- package/dist/vendor/coss/calendar.mjs +2 -0
- package/dist/vendor/coss/card.d.mts +0 -6
- package/dist/vendor/coss/card.mjs +1 -68
- package/dist/vendor/reui.io/frame.d.mts +22 -0
- package/dist/vendor/reui.io/frame.mjs +106 -0
- package/dist/vendor/shadcn/context-menu.d.mts +28 -0
- package/dist/vendor/shadcn/context-menu.mjs +126 -0
- package/dist/widgets/datetime.mjs +0 -5
- package/dist/widgets/index.d.mts +26 -8
- package/dist/widgets/index.mjs +27 -9
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -25,9 +25,9 @@ import { Form } from "./vendor/coss/form.mjs";
|
|
|
25
25
|
import { ScrollArea } from "./vendor/coss/scroll-area.mjs";
|
|
26
26
|
import { IconSwap } from "./vendor/tailored/icon-swap.mjs";
|
|
27
27
|
import { JsonViewer } from "./vendor/tailored/json-viewer.mjs";
|
|
28
|
-
import { AlertDialog, Breadcrumb, ButtonGroup, Card, Cascader, Combobox, Dialog, Drawer, Dropdown, Empty, Field, Frame, InputGroup, Kbd, Popover, Progress, Radio, Select, Table, Tabs, Timeline, Tooltip } from "./widgets/index.mjs";
|
|
28
|
+
import { AlertDialog, Breadcrumb, ButtonGroup, Card, Cascader, Combobox, ContextMenu, Dialog, Drawer, Dropdown, Empty, Field, Frame, InputGroup, Kbd, Popover, Progress, Radio, Select, Table, Tabs, Timeline, Tooltip } from "./widgets/index.mjs";
|
|
29
29
|
import { cn } from "cn";
|
|
30
30
|
import { cva } from "class-variance-authority";
|
|
31
31
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
32
32
|
export * from "react-dropzone";
|
|
33
|
-
export { AlertDialog, Badge, Breadcrumb, Button, ButtonGroup, Calendar, Card, Carousel, Cascader, type CascaderChangeDetails, type CascaderLabels, type CascaderMode, type CascaderNode, type CascaderProps, type CascaderSingleProps, Checkbox, Combobox, DatePicker, type DateRange, DateRangePicker, Dialog, Drawer, Dropdown, Dropzone, Empty, Field, Form, Frame, IconSwap, Image, ImageProps, Input, InputGroup, JsonViewer, 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, Timeline, Toaster as ToastProvider, Tooltip, cn, cva, formatBytes, mergeProps, toast, useCopyToClipboard, useDropzone, useIsMobile, type useLightbox, useMediaQuery, useSidebar };
|
|
33
|
+
export { AlertDialog, Badge, Breadcrumb, Button, ButtonGroup, Calendar, Card, Carousel, Cascader, type CascaderChangeDetails, type CascaderLabels, type CascaderMode, type CascaderNode, type CascaderProps, type CascaderSingleProps, Checkbox, Combobox, ContextMenu, DatePicker, type DateRange, DateRangePicker, Dialog, Drawer, Dropdown, Dropzone, Empty, Field, Form, Frame, IconSwap, Image, ImageProps, Input, InputGroup, JsonViewer, 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, Timeline, Toaster as ToastProvider, Tooltip, cn, cva, formatBytes, mergeProps, toast, useCopyToClipboard, useDropzone, useIsMobile, type useLightbox, useMediaQuery, useSidebar };
|
package/dist/index.mjs
CHANGED
|
@@ -22,8 +22,8 @@ import { Checkbox } from "./vendor/shadcn/checkbox.mjs";
|
|
|
22
22
|
import { Form } from "./vendor/coss/form.mjs";
|
|
23
23
|
import { IconSwap } from "./vendor/tailored/icon-swap.mjs";
|
|
24
24
|
import { JsonViewer } from "./vendor/tailored/json-viewer.mjs";
|
|
25
|
-
import { AlertDialog, Breadcrumb, ButtonGroup, Card, Cascader, Combobox, Dialog, Drawer, Dropdown, Empty, Field, Frame, InputGroup, Kbd, Popover, Progress, Radio, Select, Table, Tabs, Timeline, Tooltip } from "./widgets/index.mjs";
|
|
25
|
+
import { AlertDialog, Breadcrumb, ButtonGroup, Card, Cascader, Combobox, ContextMenu, Dialog, Drawer, Dropdown, Empty, Field, Frame, InputGroup, Kbd, Popover, Progress, Radio, Select, Table, Tabs, Timeline, Tooltip } from "./widgets/index.mjs";
|
|
26
26
|
import { cn } from "cn";
|
|
27
27
|
import { cva } from "class-variance-authority";
|
|
28
28
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
29
|
-
export { AlertDialog, Badge, Breadcrumb, Button, ButtonGroup, Calendar, Card, Carousel, Cascader, Checkbox, Combobox, DatePicker, DateRangePicker, Dialog, Drawer, Dropdown, Dropzone, Empty, Field, Form, Frame, IconSwap, Image, Input, InputGroup, JsonViewer, Kbd, Label, Lightbox, Pagination, Popover, Progress, Radio, ScrollArea, Select, Separator, Sidebar, Skeleton, Spinner, Switch, Table, Tabs, Textarea, TimePicker, Timeline, Toaster as ToastProvider, Tooltip, cn, cva, formatBytes, mergeProps, toast, useCopyToClipboard, useDropzone, useIsMobile, useMediaQuery, useSidebar };
|
|
29
|
+
export { AlertDialog, Badge, Breadcrumb, Button, ButtonGroup, Calendar, Card, Carousel, Cascader, Checkbox, Combobox, ContextMenu, DatePicker, DateRangePicker, Dialog, Drawer, Dropdown, Dropzone, Empty, Field, Form, Frame, IconSwap, Image, Input, InputGroup, JsonViewer, Kbd, Label, Lightbox, Pagination, Popover, Progress, Radio, ScrollArea, Select, Separator, Sidebar, Skeleton, Spinner, Switch, Table, Tabs, Textarea, TimePicker, Timeline, Toaster as ToastProvider, Tooltip, cn, cva, formatBytes, mergeProps, toast, useCopyToClipboard, useDropzone, useIsMobile, useMediaQuery, useSidebar };
|
package/dist/vendor/README.md
CHANGED
|
@@ -12,7 +12,7 @@ shadcn 组件使用 `components.json` 中的 `base-vega` 风格和 Lucide 图标
|
|
|
12
12
|
| ID | File | Docs | Modifications |
|
|
13
13
|
| --- | --- | --- | --- |
|
|
14
14
|
| `@coss/alert-dialog` | [coss/alert-dialog.tsx](coss/alert-dialog.tsx) | [Alert Dialog](https://coss.com/ui/docs/components/alert-dialog) | `font-bold text-xl` 替换为 `font-semibold text-lg`;用 `@starting-style` 支持初始打开时的入场动画 |
|
|
15
|
-
| `@coss/calendar` | [coss/calendar.tsx](coss/calendar.tsx) | [Calendar](https://coss.com/ui/docs/components/calendar) |
|
|
15
|
+
| `@coss/calendar` | [coss/calendar.tsx](coss/calendar.tsx) | [Calendar](https://coss.com/ui/docs/components/calendar) | 根据 `navigator.language` 自动设置 `locale` 为 zhCN 或 enUS |
|
|
16
16
|
| `@coss/card` | [coss/card.tsx](coss/card.tsx) | [Card](https://coss.com/ui/docs/components/card) | 用 `--card-spacing` 与 `--card-gap` 替代分段 padding;新增 `spacing`、`gap` 属性写入对应变量;标题改为 `text-base font-semibold leading-normal`;首尾图片贴边并补圆角 |
|
|
17
17
|
| `@coss/dialog` | [coss/dialog.tsx](coss/dialog.tsx) | [Dialog](https://coss.com/ui/docs/components/dialog) | `font-bold text-xl` 替换为 `font-semibold text-lg`;用 `@starting-style` 支持初始打开时的入场动画 |
|
|
18
18
|
| `@coss/drawer` | [coss/drawer.tsx](coss/drawer.tsx) | [Drawer](https://coss.com/ui/docs/components/drawer) | `font-bold text-xl` 替换为 `font-semibold text-lg`;用 `@starting-style` 支持初始打开时的入场动画 |
|
|
@@ -23,6 +23,7 @@ shadcn 组件使用 `components.json` 中的 `base-vega` 风格和 Lucide 图标
|
|
|
23
23
|
| `@coss/use-copy-to-clipboard` | [coss/hooks/use-copy-to-clipboard.ts](coss/hooks/use-copy-to-clipboard.ts) | [useCopyToClipboard](https://coss.com/ui/docs/hooks/use-copy-to-clipboard) | — |
|
|
24
24
|
| `@coss/use-media-query` | [coss/hooks/use-media-query.ts](coss/hooks/use-media-query.ts) | [useMediaQuery](https://coss.com/ui/docs/hooks/use-media-query) | 断点:`md` 设为 768px,与 Tailwind 默认值一致 |
|
|
25
25
|
| `@reui/cascader` | [reui.io/cascader/cascader.tsx](reui.io/cascader/cascader.tsx) | [Cascader](https://reui.io/docs/components/cascader) | 重映射 `scroll-area` 与 `spinner` 的导入 |
|
|
26
|
+
| `@reui/frame` | [reui.io/frame.tsx](reui.io/frame.tsx) | [Frame](https://reui.io/docs/components/base/frame) | — |
|
|
26
27
|
| `@reui/timeline` | [reui.io/timeline.tsx](reui.io/timeline.tsx) | [Timeline](https://reui.io/docs/components/timeline) | — |
|
|
27
28
|
| `badge` | [shadcn/badge.tsx](shadcn/badge.tsx) | [Badge](https://ui.shadcn.com/docs/components/base/badge) | 提供 `info`、`success`、`warning` 语义变体 |
|
|
28
29
|
| `breadcrumb` | [shadcn/breadcrumb.tsx](shadcn/breadcrumb.tsx) | [Breadcrumb](https://ui.shadcn.com/docs/components/base/breadcrumb) | 未显式指定 `BreadcrumbList` 则自动包裹 |
|
|
@@ -31,6 +32,7 @@ shadcn 组件使用 `components.json` 中的 `base-vega` 风格和 Lucide 图标
|
|
|
31
32
|
| `carousel` | [shadcn/carousel.tsx](shadcn/carousel.tsx) | [Carousel](https://ui.shadcn.com/docs/components/base/carousel) | — |
|
|
32
33
|
| `checkbox` | [shadcn/checkbox.tsx](shadcn/checkbox.tsx) | [Checkbox](https://ui.shadcn.com/docs/components/base/checkbox) | — |
|
|
33
34
|
| `combobox` | [shadcn/combobox.tsx](shadcn/combobox.tsx) | [Combobox](https://ui.shadcn.com/docs/components/base/combobox) | 将选中标记移至左侧 |
|
|
35
|
+
| `context-menu` | [shadcn/context-menu.tsx](shadcn/context-menu.tsx) | [Context Menu](https://ui.shadcn.com/docs/components/base/context-menu) | — |
|
|
34
36
|
| `direction` | [shadcn/direction.tsx](shadcn/direction.tsx) | [Direction](https://ui.shadcn.com/docs/components/base/direction) | — |
|
|
35
37
|
| `dropdown-menu` | [shadcn/dropdown-menu.tsx](shadcn/dropdown-menu.tsx) | [Dropdown Menu](https://ui.shadcn.com/docs/components/base/dropdown-menu) | — |
|
|
36
38
|
| `field` | [shadcn/field.tsx](shadcn/field.tsx) | [Field](https://ui.shadcn.com/docs/components/base/field) | — |
|
|
@@ -3,6 +3,7 @@ import { cn } from "../shadcn/lib/utils.mjs";
|
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { ChevronLeftIcon, ChevronRightIcon, ChevronsUpDownIcon } from "lucide-react";
|
|
5
5
|
import { DayPicker } from "@daypicker/react";
|
|
6
|
+
import { enUS, zhCN } from "@daypicker/react/locale";
|
|
6
7
|
// src/vendor/coss/calendar.tsx
|
|
7
8
|
const buttonClassNames = "relative flex size-(--cell-size) text-base sm:text-sm items-center justify-center rounded-lg text-foreground not-in-data-selected:hover:bg-accent disabled:pointer-events-none disabled:opacity-64 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0";
|
|
8
9
|
/** https://coss.com/ui/docs/components/calendar */
|
|
@@ -63,6 +64,7 @@ function Calendar({ className, classNames, showOutsideDays = true, components: u
|
|
|
63
64
|
formatters: { formatMonthDropdown: (month, dateLib) => dateLib.format(month, "LLL") },
|
|
64
65
|
mode,
|
|
65
66
|
showOutsideDays,
|
|
67
|
+
locale: navigator.language.startsWith("zh") ? zhCN : enUS,
|
|
66
68
|
...props
|
|
67
69
|
};
|
|
68
70
|
return /* @__PURE__ */ jsx(DayPicker, { ...dayPickerProps });
|
|
@@ -8,12 +8,6 @@ type SpacingProps = {
|
|
|
8
8
|
};
|
|
9
9
|
type CardSpacing = number | (string & {});
|
|
10
10
|
export declare function Card({ className, render, gap, spacing, ...props }: useRender.ComponentProps<"div"> & SpacingProps): React.ReactElement;
|
|
11
|
-
export declare function CardFrame({ className, render, gap, spacing, ...props }: useRender.ComponentProps<"div"> & SpacingProps): React.ReactElement;
|
|
12
|
-
export declare function CardFrameHeader({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement;
|
|
13
|
-
export declare function CardFrameTitle({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement;
|
|
14
|
-
export declare function CardFrameDescription({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement;
|
|
15
|
-
export declare function CardFrameAction({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement;
|
|
16
|
-
export declare function CardFrameFooter({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement;
|
|
17
11
|
export declare function CardHeader({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement;
|
|
18
12
|
export declare function CardTitle({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement;
|
|
19
13
|
export declare function CardDescription({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement;
|
|
@@ -24,73 +24,6 @@ function Card({ className, render, gap, spacing, ...props }) {
|
|
|
24
24
|
render
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
-
function CardFrame({ className, render, gap, spacing, ...props }) {
|
|
28
|
-
const defaultProps = {
|
|
29
|
-
className: cn("relative flex flex-col rounded-2xl border bg-card not-dark:bg-clip-padding text-card-foreground shadow-xs/5 [--clip-bottom:-1rem] [--clip-top:-1rem] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:bg-muted/72 before:shadow-[0_1px_--theme(--color-black/4%)] has-data-[slot=table-container]:overflow-hidden *:data-[slot=card]:-m-px *:data-[slot=table-container]:-m-px *:data-[slot=table-container]:w-[calc(100%+2px)] *:not-first:data-[slot=card]:rounded-t-xl *:not-last:data-[slot=card]:rounded-b-xl *:data-[slot=card]:bg-clip-padding *:data-[slot=card]:shadow-none *:data-[slot=card]:before:hidden *:not-first:data-[slot=card]:before:rounded-t-[calc(var(--radius-xl)-1px)] *:not-last:data-[slot=card]:before:rounded-b-[calc(var(--radius-xl)-1px)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)] *:data-[slot=card]:[clip-path:inset(var(--clip-top)_1px_var(--clip-bottom)_1px_round_calc(var(--radius-2xl)-1px))] *:data-[slot=card]:last:[--clip-bottom:1px] *:data-[slot=card]:first:[--clip-top:1px]", className),
|
|
30
|
-
"data-slot": "card-frame",
|
|
31
|
-
style: getCardStyle(spacing, gap)
|
|
32
|
-
};
|
|
33
|
-
return useRender({
|
|
34
|
-
defaultTagName: "div",
|
|
35
|
-
props: mergeProps(defaultProps, props),
|
|
36
|
-
render
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
function CardFrameHeader({ className, render, ...props }) {
|
|
40
|
-
const defaultProps = {
|
|
41
|
-
className: cn("relative flex grid auto-rows-min grid-rows-[auto_auto] flex-col items-start gap-x-4 px-(--card-spacing) py-(--card-gap) has-data-[slot=card-frame-action]:grid-cols-[1fr_auto]", className),
|
|
42
|
-
"data-slot": "card-frame-header"
|
|
43
|
-
};
|
|
44
|
-
return useRender({
|
|
45
|
-
defaultTagName: "div",
|
|
46
|
-
props: mergeProps(defaultProps, props),
|
|
47
|
-
render
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
function CardFrameTitle({ className, render, ...props }) {
|
|
51
|
-
const defaultProps = {
|
|
52
|
-
className: cn("self-center font-semibold text-sm", className),
|
|
53
|
-
"data-slot": "card-frame-title"
|
|
54
|
-
};
|
|
55
|
-
return useRender({
|
|
56
|
-
defaultTagName: "div",
|
|
57
|
-
props: mergeProps(defaultProps, props),
|
|
58
|
-
render
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
function CardFrameDescription({ className, render, ...props }) {
|
|
62
|
-
const defaultProps = {
|
|
63
|
-
className: cn("self-center text-muted-foreground text-sm", className),
|
|
64
|
-
"data-slot": "card-frame-description"
|
|
65
|
-
};
|
|
66
|
-
return useRender({
|
|
67
|
-
defaultTagName: "div",
|
|
68
|
-
props: mergeProps(defaultProps, props),
|
|
69
|
-
render
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
function CardFrameAction({ className, render, ...props }) {
|
|
73
|
-
const defaultProps = {
|
|
74
|
-
className: cn("col-start-2 nth-3:row-span-2 nth-3:row-start-1 inline-flex self-center justify-self-end", className),
|
|
75
|
-
"data-slot": "card-frame-action"
|
|
76
|
-
};
|
|
77
|
-
return useRender({
|
|
78
|
-
defaultTagName: "div",
|
|
79
|
-
props: mergeProps(defaultProps, props),
|
|
80
|
-
render
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
function CardFrameFooter({ className, render, ...props }) {
|
|
84
|
-
const defaultProps = {
|
|
85
|
-
className: cn("px-(--card-spacing) py-(--card-gap)", className),
|
|
86
|
-
"data-slot": "card-frame-footer"
|
|
87
|
-
};
|
|
88
|
-
return useRender({
|
|
89
|
-
defaultTagName: "div",
|
|
90
|
-
props: mergeProps(defaultProps, props),
|
|
91
|
-
render
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
27
|
function CardHeader({ className, render, ...props }) {
|
|
95
28
|
const defaultProps = {
|
|
96
29
|
className: cn("grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-(--card-spacing) [.border-b]:pb-(--card-gap) has-data-[slot=card-action]:grid-cols-[1fr_auto]", className),
|
|
@@ -157,4 +90,4 @@ function CardFooter({ className, render, ...props }) {
|
|
|
157
90
|
render
|
|
158
91
|
});
|
|
159
92
|
}
|
|
160
|
-
export { Card, CardAction, CardPanel as CardContent, CardPanel, CardDescription, CardFooter,
|
|
93
|
+
export { Card, CardAction, CardPanel as CardContent, CardPanel, CardDescription, CardFooter, CardHeader, CardTitle };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
/**
|
|
3
|
+
* Frame sets --frame-panel-bg and --frame-panel-border-color; FramePanel reads
|
|
4
|
+
* them back as bg-(--frame-panel-bg) and border-(--frame-panel-border-color).
|
|
5
|
+
* So variant="inverse" re-points every panel from one place, and a consumer's
|
|
6
|
+
* own bg-* on a panel still wins on source order, with no :not() and no `!`.
|
|
7
|
+
*/
|
|
8
|
+
declare const frameVariants: (props?: ({
|
|
9
|
+
variant?: "default" | "ghost" | "inverse" | null | undefined;
|
|
10
|
+
spacing?: "default" | "lg" | "sm" | "xs" | null | undefined;
|
|
11
|
+
stacked?: boolean | null | undefined;
|
|
12
|
+
dense?: boolean | null | undefined;
|
|
13
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
14
|
+
declare function Frame({ className, variant, spacing, stacked, dense, ...props }: React.ComponentProps<"div"> & VariantProps<typeof frameVariants>): import("react").JSX.Element;
|
|
15
|
+
declare function FramePanel({ className, fit, ...props }: React.ComponentProps<"div"> & {
|
|
16
|
+
fit?: boolean;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
declare function FrameHeader({ className, ...props }: React.ComponentProps<"header">): import("react").JSX.Element;
|
|
19
|
+
declare function FrameTitle({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
|
20
|
+
declare function FrameDescription({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
|
21
|
+
declare function FrameFooter({ className, ...props }: React.ComponentProps<"footer">): import("react").JSX.Element;
|
|
22
|
+
export { Frame, FrameDescription, FrameFooter, FrameHeader, FramePanel, FrameTitle, frameVariants };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { cn } from "cn";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
// src/vendor/reui.io/frame.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Frame sets --frame-panel-bg and --frame-panel-border-color; FramePanel reads
|
|
7
|
+
* them back as bg-(--frame-panel-bg) and border-(--frame-panel-border-color).
|
|
8
|
+
* So variant="inverse" re-points every panel from one place, and a consumer's
|
|
9
|
+
* own bg-* on a panel still wins on source order, with no :not() and no `!`.
|
|
10
|
+
*/
|
|
11
|
+
const frameVariants = cva([
|
|
12
|
+
"relative flex flex-col bg-muted/50 gap-(--frame-gap) px-(--frame-px) py-(--frame-py) rounded-(--frame-radius)",
|
|
13
|
+
"[--frame-radius:var(--radius-xl)]",
|
|
14
|
+
"[--frame-gap:--spacing(0.75)] [--frame-px:--spacing(0.75)] [--frame-py:--spacing(0.75)] [--frame-panel-header-gap:0rem] [--frame-panel-footer-gap:--spacing(1)]",
|
|
15
|
+
"[--frame-panel-px-adjust:0px] [--frame-panel-py-adjust:0px] [--frame-panel-header-px-adjust:0px] [--frame-panel-header-py-adjust:0px] [--frame-panel-footer-px-adjust:0px] [--frame-panel-footer-py-adjust:0px]",
|
|
16
|
+
"[--frame-panel-px:calc(var(--frame-panel-px-base)+var(--frame-panel-px-adjust))] [--frame-panel-py:calc(var(--frame-panel-py-base)+var(--frame-panel-py-adjust))] [--frame-panel-header-px:calc(var(--frame-panel-header-px-base)+var(--frame-panel-header-px-adjust))] [--frame-panel-header-py:calc(var(--frame-panel-header-py-base)+var(--frame-panel-header-py-adjust))] [--frame-panel-footer-px:calc(var(--frame-panel-footer-px-base)+var(--frame-panel-footer-px-adjust))] [--frame-panel-footer-py:calc(var(--frame-panel-footer-py-base)+var(--frame-panel-footer-py-adjust))]",
|
|
17
|
+
"",
|
|
18
|
+
"[--frame-panel-bg:var(--color-card)] [--frame-panel-border-color:var(--color-border)] [--frame-border-color:var(--color-border)]",
|
|
19
|
+
"[--frame-panel-radius:calc(var(--frame-radius)-var(--frame-px)-1px)]"
|
|
20
|
+
], {
|
|
21
|
+
variants: {
|
|
22
|
+
variant: {
|
|
23
|
+
default: "border border-[var(--frame-border-color)] bg-clip-padding",
|
|
24
|
+
inverse: "[--frame-panel-bg:color-mix(in_oklch,var(--color-muted)_40%,transparent)] border border-[var(--frame-border-color)] bg-background bg-clip-padding",
|
|
25
|
+
ghost: "[--frame-panel-radius:calc(var(--frame-radius)-var(--frame-px))]"
|
|
26
|
+
},
|
|
27
|
+
spacing: {
|
|
28
|
+
xs: "[--frame-panel-px-base:--spacing(2)] [--frame-panel-py-base:--spacing(2)] [--frame-panel-header-px-base:--spacing(2)] [--frame-panel-header-py-base:--spacing(0.5)] [--frame-panel-footer-px-base:--spacing(2)] [--frame-panel-footer-py-base:--spacing(0.5)]",
|
|
29
|
+
sm: "[--frame-panel-px-base:--spacing(3)] [--frame-panel-py-base:--spacing(3.5)] [--frame-panel-header-px-base:--spacing(3)] [--frame-panel-header-py-base:--spacing(1.5)] [--frame-panel-footer-px-base:--spacing(3)] [--frame-panel-footer-py-base:--spacing(1.5)]",
|
|
30
|
+
default: "[--frame-panel-px-base:--spacing(4)] [--frame-panel-py-base:--spacing(4)] [--frame-panel-header-px-base:--spacing(4)] [--frame-panel-header-py-base:--spacing(2)] [--frame-panel-footer-px-base:--spacing(4)] [--frame-panel-footer-py-base:--spacing(2)]",
|
|
31
|
+
lg: "[--frame-panel-px-base:--spacing(5)] [--frame-panel-py-base:--spacing(5)] [--frame-panel-header-px-base:--spacing(5)] [--frame-panel-header-py-base:--spacing(2.5)] [--frame-panel-footer-px-base:--spacing(5)] [--frame-panel-footer-py-base:--spacing(2.5)]"
|
|
32
|
+
},
|
|
33
|
+
stacked: {
|
|
34
|
+
true: [
|
|
35
|
+
"gap-0 *:has-[+[data-slot=frame-panel]]:rounded-b-none",
|
|
36
|
+
"*:has-[+[data-slot=frame-panel]]:before:hidden",
|
|
37
|
+
"*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:rounded-t-none",
|
|
38
|
+
"*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:border-t-0"
|
|
39
|
+
],
|
|
40
|
+
false: [
|
|
41
|
+
"data-[spacing=sm]:*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:mt-0.5",
|
|
42
|
+
"data-[spacing=default]:*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:mt-1",
|
|
43
|
+
"data-[spacing=lg]:*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:mt-2"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
dense: {
|
|
47
|
+
true: "p-0 gap-0 border-[var(--frame-border-color)] [--frame-panel-radius:var(--frame-radius)] [&_[data-slot=frame-panel]]:-mx-px [&_[data-slot=frame-panel]]:before:hidden [&_[data-slot=frame-panel]:last-child]:-mb-px [&:not(:has([data-slot=frame-panel-header]))_[data-slot=frame-panel]:is(:first-child)]:-mt-px",
|
|
48
|
+
false: ""
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
defaultVariants: {
|
|
52
|
+
variant: "default",
|
|
53
|
+
spacing: "default",
|
|
54
|
+
stacked: false,
|
|
55
|
+
dense: false
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
function Frame({ className, variant, spacing, stacked, dense, ...props }) {
|
|
59
|
+
return /* @__PURE__ */ jsx("div", {
|
|
60
|
+
className: cn(frameVariants({
|
|
61
|
+
variant,
|
|
62
|
+
spacing,
|
|
63
|
+
stacked,
|
|
64
|
+
dense
|
|
65
|
+
}), className),
|
|
66
|
+
"data-slot": "frame",
|
|
67
|
+
"data-spacing": spacing,
|
|
68
|
+
...props
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function FramePanel({ className, fit, ...props }) {
|
|
72
|
+
return /* @__PURE__ */ jsx("div", {
|
|
73
|
+
className: cn("relative overflow-hidden rounded-(--frame-panel-radius) border border-(--frame-panel-border-color) bg-(--frame-panel-bg) bg-clip-padding shadow-xs", !fit && "grow", "before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--frame-panel-radius)-1px)] before:shadow-black/5", "dark:bg-clip-border dark:before:shadow-white/5", "px-(--frame-panel-px) py-(--frame-panel-py)", className),
|
|
74
|
+
"data-slot": "frame-panel",
|
|
75
|
+
...props
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
function FrameHeader({ className, ...props }) {
|
|
79
|
+
return /* @__PURE__ */ jsx("header", {
|
|
80
|
+
className: cn("flex flex-col gap-(--frame-panel-header-gap) px-(--frame-panel-header-px) py-(--frame-panel-header-py)", className),
|
|
81
|
+
"data-slot": "frame-panel-header",
|
|
82
|
+
...props
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
function FrameTitle({ className, ...props }) {
|
|
86
|
+
return /* @__PURE__ */ jsx("div", {
|
|
87
|
+
className: cn("text-sm font-semibold", className),
|
|
88
|
+
"data-slot": "frame-panel-title",
|
|
89
|
+
...props
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
function FrameDescription({ className, ...props }) {
|
|
93
|
+
return /* @__PURE__ */ jsx("div", {
|
|
94
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
95
|
+
"data-slot": "frame-panel-description",
|
|
96
|
+
...props
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function FrameFooter({ className, ...props }) {
|
|
100
|
+
return /* @__PURE__ */ jsx("footer", {
|
|
101
|
+
className: cn("flex flex-col gap-(--frame-panel-footer-gap) px-(--frame-panel-footer-px) py-(--frame-panel-footer-py)", className),
|
|
102
|
+
"data-slot": "frame-panel-footer",
|
|
103
|
+
...props
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
export { Frame, FrameDescription, FrameFooter, FrameHeader, FramePanel, FrameTitle, frameVariants };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { ContextMenu } from "@base-ui/react/context-menu";
|
|
3
|
+
declare function ContextMenu$1({ ...props }: ContextMenu.Root.Props): React$1.JSX.Element;
|
|
4
|
+
declare function ContextMenuTrigger({ className, ...props }: ContextMenu.Trigger.Props): React$1.JSX.Element;
|
|
5
|
+
declare function ContextMenuContent({ className, align, alignOffset, side, sideOffset, ...props }: ContextMenu.Popup.Props & Pick<ContextMenu.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): React$1.JSX.Element;
|
|
6
|
+
declare function ContextMenuGroup({ ...props }: ContextMenu.Group.Props): React$1.JSX.Element;
|
|
7
|
+
declare function ContextMenuLabel({ className, inset, ...props }: ContextMenu.GroupLabel.Props & {
|
|
8
|
+
inset?: boolean;
|
|
9
|
+
}): React$1.JSX.Element;
|
|
10
|
+
declare function ContextMenuItem({ className, inset, variant, ...props }: ContextMenu.Item.Props & {
|
|
11
|
+
inset?: boolean;
|
|
12
|
+
variant?: "default" | "destructive";
|
|
13
|
+
}): React$1.JSX.Element;
|
|
14
|
+
declare function ContextMenuSub({ ...props }: ContextMenu.SubmenuRoot.Props): React$1.JSX.Element;
|
|
15
|
+
declare function ContextMenuSubTrigger({ className, inset, children, ...props }: ContextMenu.SubmenuTrigger.Props & {
|
|
16
|
+
inset?: boolean;
|
|
17
|
+
}): React$1.JSX.Element;
|
|
18
|
+
declare function ContextMenuSubContent({ ...props }: React$1.ComponentProps<typeof ContextMenuContent>): React$1.JSX.Element;
|
|
19
|
+
declare function ContextMenuCheckboxItem({ className, children, checked, inset, ...props }: ContextMenu.CheckboxItem.Props & {
|
|
20
|
+
inset?: boolean;
|
|
21
|
+
}): React$1.JSX.Element;
|
|
22
|
+
declare function ContextMenuRadioGroup({ ...props }: ContextMenu.RadioGroup.Props): React$1.JSX.Element;
|
|
23
|
+
declare function ContextMenuRadioItem({ className, children, inset, ...props }: ContextMenu.RadioItem.Props & {
|
|
24
|
+
inset?: boolean;
|
|
25
|
+
}): React$1.JSX.Element;
|
|
26
|
+
declare function ContextMenuSeparator({ className, ...props }: ContextMenu.Separator.Props): React$1.JSX.Element;
|
|
27
|
+
declare function ContextMenuShortcut({ className, ...props }: React$1.ComponentProps<"span">): React$1.JSX.Element;
|
|
28
|
+
export { ContextMenu$1 as ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { CheckIcon, ChevronRightIcon } from "lucide-react";
|
|
6
|
+
import { ContextMenu } from "@base-ui/react/context-menu";
|
|
7
|
+
// src/vendor/shadcn/context-menu.tsx
|
|
8
|
+
function ContextMenu$1({ ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(ContextMenu.Root, {
|
|
10
|
+
"data-slot": "context-menu",
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function ContextMenuTrigger({ className, ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsx(ContextMenu.Trigger, {
|
|
16
|
+
"data-slot": "context-menu-trigger",
|
|
17
|
+
className: cn("select-none", className),
|
|
18
|
+
...props
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function ContextMenuContent({ className, align = "start", alignOffset = 4, side = "right", sideOffset = 0, ...props }) {
|
|
22
|
+
return /* @__PURE__ */ jsx(ContextMenu.Portal, { children: /* @__PURE__ */ jsx(ContextMenu.Positioner, {
|
|
23
|
+
className: "isolate z-50 outline-none",
|
|
24
|
+
align,
|
|
25
|
+
alignOffset,
|
|
26
|
+
side,
|
|
27
|
+
sideOffset,
|
|
28
|
+
children: /* @__PURE__ */ jsx(ContextMenu.Popup, {
|
|
29
|
+
"data-slot": "context-menu-content",
|
|
30
|
+
className: cn("z-50 max-h-(--available-height) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
31
|
+
...props
|
|
32
|
+
})
|
|
33
|
+
}) });
|
|
34
|
+
}
|
|
35
|
+
function ContextMenuGroup({ ...props }) {
|
|
36
|
+
return /* @__PURE__ */ jsx(ContextMenu.Group, {
|
|
37
|
+
"data-slot": "context-menu-group",
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function ContextMenuLabel({ className, inset, ...props }) {
|
|
42
|
+
return /* @__PURE__ */ jsx(ContextMenu.GroupLabel, {
|
|
43
|
+
"data-slot": "context-menu-label",
|
|
44
|
+
"data-inset": inset,
|
|
45
|
+
className: cn("px-2 py-1.5 text-xs font-medium text-muted-foreground data-inset:pl-8", className),
|
|
46
|
+
...props
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function ContextMenuItem({ className, inset, variant = "default", ...props }) {
|
|
50
|
+
return /* @__PURE__ */ jsx(ContextMenu.Item, {
|
|
51
|
+
"data-slot": "context-menu-item",
|
|
52
|
+
"data-inset": inset,
|
|
53
|
+
"data-variant": variant,
|
|
54
|
+
className: cn("group/context-menu-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive", className),
|
|
55
|
+
...props
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function ContextMenuSub({ ...props }) {
|
|
59
|
+
return /* @__PURE__ */ jsx(ContextMenu.SubmenuRoot, {
|
|
60
|
+
"data-slot": "context-menu-sub",
|
|
61
|
+
...props
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function ContextMenuSubTrigger({ className, inset, children, ...props }) {
|
|
65
|
+
return /* @__PURE__ */ jsxs(ContextMenu.SubmenuTrigger, {
|
|
66
|
+
"data-slot": "context-menu-sub-trigger",
|
|
67
|
+
"data-inset": inset,
|
|
68
|
+
className: cn("flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
69
|
+
...props,
|
|
70
|
+
children: [children, /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto" })]
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
function ContextMenuSubContent({ ...props }) {
|
|
74
|
+
return /* @__PURE__ */ jsx(ContextMenuContent, {
|
|
75
|
+
"data-slot": "context-menu-sub-content",
|
|
76
|
+
className: "shadow-lg",
|
|
77
|
+
side: "right",
|
|
78
|
+
...props
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function ContextMenuCheckboxItem({ className, children, checked, inset, ...props }) {
|
|
82
|
+
return /* @__PURE__ */ jsxs(ContextMenu.CheckboxItem, {
|
|
83
|
+
"data-slot": "context-menu-checkbox-item",
|
|
84
|
+
"data-inset": inset,
|
|
85
|
+
className: cn("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
86
|
+
checked,
|
|
87
|
+
...props,
|
|
88
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
89
|
+
className: "pointer-events-none absolute right-2",
|
|
90
|
+
children: /* @__PURE__ */ jsx(ContextMenu.CheckboxItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
|
|
91
|
+
}), children]
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function ContextMenuRadioGroup({ ...props }) {
|
|
95
|
+
return /* @__PURE__ */ jsx(ContextMenu.RadioGroup, {
|
|
96
|
+
"data-slot": "context-menu-radio-group",
|
|
97
|
+
...props
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function ContextMenuRadioItem({ className, children, inset, ...props }) {
|
|
101
|
+
return /* @__PURE__ */ jsxs(ContextMenu.RadioItem, {
|
|
102
|
+
"data-slot": "context-menu-radio-item",
|
|
103
|
+
"data-inset": inset,
|
|
104
|
+
className: cn("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
105
|
+
...props,
|
|
106
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
107
|
+
className: "pointer-events-none absolute right-2",
|
|
108
|
+
children: /* @__PURE__ */ jsx(ContextMenu.RadioItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
|
|
109
|
+
}), children]
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
function ContextMenuSeparator({ className, ...props }) {
|
|
113
|
+
return /* @__PURE__ */ jsx(ContextMenu.Separator, {
|
|
114
|
+
"data-slot": "context-menu-separator",
|
|
115
|
+
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
116
|
+
...props
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function ContextMenuShortcut({ className, ...props }) {
|
|
120
|
+
return /* @__PURE__ */ jsx("span", {
|
|
121
|
+
"data-slot": "context-menu-shortcut",
|
|
122
|
+
className: cn("ml-auto text-xs tracking-widest text-muted-foreground group-focus/context-menu-item:text-accent-foreground", className),
|
|
123
|
+
...props
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
export { ContextMenu$1 as ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger };
|
|
@@ -6,7 +6,6 @@ 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
|
-
import { enUS, zhCN } from "@daypicker/react/locale";
|
|
10
9
|
import { format } from "date-fns";
|
|
11
10
|
// src/widgets/datetime.tsx
|
|
12
11
|
function TimePicker({ className, step = "1", ...props }) {
|
|
@@ -19,7 +18,6 @@ function TimePicker({ className, step = "1", ...props }) {
|
|
|
19
18
|
}
|
|
20
19
|
function DatePicker({ value, defaultValue = null, placeholder = "请选择日期", disabled, onChange, className, calendarProps, ...props }) {
|
|
21
20
|
const [internalValue, setInternalValue] = useState(defaultValue);
|
|
22
|
-
const locale = navigator.language.startsWith("zh") ? zhCN : enUS;
|
|
23
21
|
const date = value === void 0 ? internalValue : value;
|
|
24
22
|
function handleSelect(selected) {
|
|
25
23
|
const nextValue = selected ?? null;
|
|
@@ -36,7 +34,6 @@ function DatePicker({ value, defaultValue = null, placeholder = "请选择日期
|
|
|
36
34
|
}),
|
|
37
35
|
children: [/* @__PURE__ */ jsx(CalendarIcon, { "aria-hidden": "true" }), date ? format(date, "PPP") : placeholder]
|
|
38
36
|
}), /* @__PURE__ */ jsx(PopoverContent, { children: /* @__PURE__ */ jsx(Calendar, {
|
|
39
|
-
locale,
|
|
40
37
|
defaultMonth: date ?? void 0,
|
|
41
38
|
...calendarProps,
|
|
42
39
|
disabled: disabled || calendarProps?.disabled,
|
|
@@ -47,7 +44,6 @@ function DatePicker({ value, defaultValue = null, placeholder = "请选择日期
|
|
|
47
44
|
}
|
|
48
45
|
function DateRangePicker({ value, defaultValue = null, placeholder = "请选择日期范围", disabled, onChange, className, calendarProps, ...props }) {
|
|
49
46
|
const [internalValue, setInternalValue] = useState(defaultValue);
|
|
50
|
-
const locale = navigator.language.startsWith("zh") ? zhCN : enUS;
|
|
51
47
|
const date = value === void 0 ? internalValue : value;
|
|
52
48
|
function handleSelect(selected) {
|
|
53
49
|
const nextValue = selected ?? null;
|
|
@@ -68,7 +64,6 @@ function DateRangePicker({ value, defaultValue = null, placeholder = "请选择
|
|
|
68
64
|
date?.to && /* @__PURE__ */ jsxs(Fragment, { children: [" - ", format(date.to, "LLL dd, y")] })
|
|
69
65
|
]
|
|
70
66
|
}), /* @__PURE__ */ jsx(PopoverContent, { children: /* @__PURE__ */ jsx(Calendar, {
|
|
71
|
-
locale,
|
|
72
67
|
defaultMonth: date?.from,
|
|
73
68
|
...calendarProps,
|
|
74
69
|
disabled: disabled || calendarProps?.disabled,
|
package/dist/widgets/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AlertDialogClose, AlertDialogContent as AlertDialogPopup, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPrimitive, AlertDialogTitle, AlertDialogTrigger } from "../vendor/coss/alert-dialog.mjs";
|
|
2
|
-
import { Card as Card$1, CardAction, CardContent as CardPanel, CardDescription, CardFooter,
|
|
2
|
+
import { Card as Card$1, CardAction, CardContent as CardPanel, CardDescription, CardFooter, CardHeader, CardTitle } from "../vendor/coss/card.mjs";
|
|
3
3
|
import { DialogClose, DialogContent as DialogPopup, DialogDescription, DialogFooter, DialogHeader, DialogPanel, DialogPrimitive, DialogTitle, DialogTrigger } from "../vendor/coss/dialog.mjs";
|
|
4
4
|
import { Drawer as Drawer$1, DrawerClose, DrawerDescription, DrawerFooter, DrawerHeader, DrawerPanel, DrawerPopup, DrawerTitle, DrawerTrigger } from "../vendor/coss/drawer.mjs";
|
|
5
5
|
import { Empty as Empty$1, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from "../vendor/coss/empty.mjs";
|
|
@@ -10,11 +10,13 @@ import { CascaderAction, CascaderFooter, CascaderSubmenu, CascaderSubmenuContent
|
|
|
10
10
|
import { CascaderGroup, CascaderItemProps, CascaderItems, CascaderLabel, CascaderSeparator } from "../vendor/reui.io/cascader/cascader-item.mjs";
|
|
11
11
|
import { CascaderBack, CascaderBreadcrumb, CascaderInput, CascaderNav, CascaderValue } from "../vendor/reui.io/cascader/cascader-nav.mjs";
|
|
12
12
|
import { CascaderVirtualItems } from "../vendor/reui.io/cascader/cascader-virtual.mjs";
|
|
13
|
+
import { Frame as Frame$1, FrameDescription, FrameFooter, FrameHeader, FramePanel, FrameTitle } from "../vendor/reui.io/frame.mjs";
|
|
13
14
|
import { Timeline as Timeline$1, TimelineContent, TimelineDate, TimelineHeader, TimelineIndicator, TimelineItem, TimelineSeparator, TimelineTitle } from "../vendor/reui.io/timeline.mjs";
|
|
14
15
|
import { Breadcrumb as Breadcrumb$1, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "../vendor/shadcn/breadcrumb.mjs";
|
|
15
16
|
import { Separator } from "../vendor/shadcn/separator.mjs";
|
|
16
17
|
import { ButtonGroup as ButtonGroup$1, ButtonGroupSeparator, ButtonGroupText } from "../vendor/shadcn/button-group.mjs";
|
|
17
18
|
import { ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxValue } from "../vendor/shadcn/combobox.mjs";
|
|
19
|
+
import { ContextMenu as ContextMenu$1, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger } from "../vendor/shadcn/context-menu.mjs";
|
|
18
20
|
import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "../vendor/shadcn/dropdown-menu.mjs";
|
|
19
21
|
import { Label } from "../vendor/shadcn/label.mjs";
|
|
20
22
|
import { Field as Field$1, FieldDescription, FieldError, FieldLabel } from "../vendor/shadcn/field.mjs";
|
|
@@ -68,13 +70,13 @@ export declare const Card: typeof Card$1 & {
|
|
|
68
70
|
Action: typeof CardAction;
|
|
69
71
|
Description: typeof CardDescription;
|
|
70
72
|
};
|
|
71
|
-
/** https://
|
|
72
|
-
export declare const Frame: typeof
|
|
73
|
-
Header: typeof
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
/** https://reui.io/docs/components/base/frame */
|
|
74
|
+
export declare const Frame: typeof Frame$1 & {
|
|
75
|
+
Header: typeof FrameHeader;
|
|
76
|
+
Panel: typeof FramePanel;
|
|
77
|
+
Footer: typeof FrameFooter;
|
|
78
|
+
Title: typeof FrameTitle;
|
|
79
|
+
Description: typeof FrameDescription;
|
|
78
80
|
};
|
|
79
81
|
/** https://ui.shadcn.com/docs/components/base/field */
|
|
80
82
|
export declare const Field: typeof Field$1 & {
|
|
@@ -235,6 +237,22 @@ export declare const Breadcrumb: typeof Breadcrumb$1 & {
|
|
|
235
237
|
Ellipsis: typeof BreadcrumbEllipsis;
|
|
236
238
|
Page: typeof BreadcrumbPage;
|
|
237
239
|
};
|
|
240
|
+
/** https://ui.shadcn.com/docs/components/base/context-menu */
|
|
241
|
+
export declare const ContextMenu: typeof ContextMenu$1 & {
|
|
242
|
+
Trigger: typeof ContextMenuTrigger;
|
|
243
|
+
Content: typeof ContextMenuContent;
|
|
244
|
+
Sub: typeof ContextMenuSub;
|
|
245
|
+
SubTrigger: typeof ContextMenuSubTrigger;
|
|
246
|
+
SubContent: typeof ContextMenuSubContent;
|
|
247
|
+
Group: typeof ContextMenuGroup;
|
|
248
|
+
GroupLabel: typeof ContextMenuLabel;
|
|
249
|
+
Separator: typeof ContextMenuSeparator;
|
|
250
|
+
Item: typeof ContextMenuItem;
|
|
251
|
+
Shortcut: typeof ContextMenuShortcut;
|
|
252
|
+
RadioItem: typeof ContextMenuRadioItem;
|
|
253
|
+
RadioGroup: typeof ContextMenuRadioGroup;
|
|
254
|
+
CheckboxItem: typeof ContextMenuCheckboxItem;
|
|
255
|
+
};
|
|
238
256
|
/** https://coss.com/ui/docs/components/alert-dialog */
|
|
239
257
|
export declare const AlertDialog: typeof AlertDialogPrimitive.Root & {
|
|
240
258
|
Trigger: typeof AlertDialogTrigger;
|
package/dist/widgets/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AlertDialog as AlertDialog$1, AlertDialogClose, AlertDialogContent as AlertDialogPopup, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "../vendor/coss/alert-dialog.mjs";
|
|
2
|
-
import { Card as Card$1, CardAction, CardContent as CardPanel, CardDescription, CardFooter,
|
|
2
|
+
import { Card as Card$1, CardAction, CardContent as CardPanel, CardDescription, CardFooter, CardHeader, CardTitle } from "../vendor/coss/card.mjs";
|
|
3
3
|
import { Spinner } from "../vendor/shadcn/spinner.mjs";
|
|
4
4
|
import { Button } from "../vendor/shadcn/button.mjs";
|
|
5
5
|
import { ScrollArea } from "../vendor/coss/scroll-area.mjs";
|
|
@@ -12,6 +12,7 @@ import { CascaderAction, CascaderFooter, CascaderSubmenu, CascaderSubmenuContent
|
|
|
12
12
|
import { CascaderGroup, CascaderItem, CascaderItems, CascaderLabel, CascaderSeparator } from "../vendor/reui.io/cascader/cascader-item.mjs";
|
|
13
13
|
import { CascaderBack, CascaderBreadcrumb, CascaderInput, CascaderNav, CascaderValue } from "../vendor/reui.io/cascader/cascader-nav.mjs";
|
|
14
14
|
import { CascaderVirtualItems } from "../vendor/reui.io/cascader/cascader-virtual.mjs";
|
|
15
|
+
import { Frame as Frame$1, FrameDescription, FrameFooter, FrameHeader, FramePanel, FrameTitle } from "../vendor/reui.io/frame.mjs";
|
|
15
16
|
import { Timeline as Timeline$1, TimelineContent, TimelineDate, TimelineHeader, TimelineIndicator, TimelineItem, TimelineSeparator, TimelineTitle } from "../vendor/reui.io/timeline.mjs";
|
|
16
17
|
import { Breadcrumb as Breadcrumb$1, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "../vendor/shadcn/breadcrumb.mjs";
|
|
17
18
|
import { Separator } from "../vendor/shadcn/separator.mjs";
|
|
@@ -19,6 +20,7 @@ import { ButtonGroup as ButtonGroup$1, ButtonGroupSeparator, ButtonGroupText } f
|
|
|
19
20
|
import { Input } from "../vendor/shadcn/input.mjs";
|
|
20
21
|
import { Textarea } from "../vendor/shadcn/textarea.mjs";
|
|
21
22
|
import { Combobox as Combobox$1, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxValue } from "../vendor/shadcn/combobox.mjs";
|
|
23
|
+
import { ContextMenu as ContextMenu$1, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger } from "../vendor/shadcn/context-menu.mjs";
|
|
22
24
|
import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "../vendor/shadcn/dropdown-menu.mjs";
|
|
23
25
|
import { Field as Field$1, FieldDescription, FieldError, FieldLabel } from "../vendor/shadcn/field.mjs";
|
|
24
26
|
import { Label } from "../vendor/shadcn/label.mjs";
|
|
@@ -63,13 +65,13 @@ const Card = /* @__PURE__ */ Object.assign(Card$1, {
|
|
|
63
65
|
Action: CardAction,
|
|
64
66
|
Description: CardDescription
|
|
65
67
|
});
|
|
66
|
-
/** https://
|
|
67
|
-
const Frame = /* @__PURE__ */ Object.assign(
|
|
68
|
-
Header:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
/** https://reui.io/docs/components/base/frame */
|
|
69
|
+
const Frame = /* @__PURE__ */ Object.assign(Frame$1, {
|
|
70
|
+
Header: FrameHeader,
|
|
71
|
+
Panel: FramePanel,
|
|
72
|
+
Footer: FrameFooter,
|
|
73
|
+
Title: FrameTitle,
|
|
74
|
+
Description: FrameDescription
|
|
73
75
|
});
|
|
74
76
|
/** https://ui.shadcn.com/docs/components/base/field */
|
|
75
77
|
const Field = /* @__PURE__ */ Object.assign(Field$1, {
|
|
@@ -228,6 +230,22 @@ const Breadcrumb = /* @__PURE__ */ Object.assign(Breadcrumb$1, {
|
|
|
228
230
|
Ellipsis: BreadcrumbEllipsis,
|
|
229
231
|
Page: BreadcrumbPage
|
|
230
232
|
});
|
|
233
|
+
/** https://ui.shadcn.com/docs/components/base/context-menu */
|
|
234
|
+
const ContextMenu = /* @__PURE__ */ Object.assign(ContextMenu$1, {
|
|
235
|
+
Trigger: ContextMenuTrigger,
|
|
236
|
+
Content: ContextMenuContent,
|
|
237
|
+
Sub: ContextMenuSub,
|
|
238
|
+
SubTrigger: ContextMenuSubTrigger,
|
|
239
|
+
SubContent: ContextMenuSubContent,
|
|
240
|
+
Group: ContextMenuGroup,
|
|
241
|
+
GroupLabel: ContextMenuLabel,
|
|
242
|
+
Separator: ContextMenuSeparator,
|
|
243
|
+
Item: ContextMenuItem,
|
|
244
|
+
Shortcut: ContextMenuShortcut,
|
|
245
|
+
RadioItem: ContextMenuRadioItem,
|
|
246
|
+
RadioGroup: ContextMenuRadioGroup,
|
|
247
|
+
CheckboxItem: ContextMenuCheckboxItem
|
|
248
|
+
});
|
|
231
249
|
/** https://coss.com/ui/docs/components/alert-dialog */
|
|
232
250
|
const AlertDialog = /* @__PURE__ */ Object.assign(AlertDialog$1, {
|
|
233
251
|
Trigger: AlertDialogTrigger,
|
|
@@ -251,4 +269,4 @@ const InputGroup = /* @__PURE__ */ Object.assign(InputGroup$1, {
|
|
|
251
269
|
Textarea: InputGroupTextarea,
|
|
252
270
|
Button: InputGroupButton
|
|
253
271
|
});
|
|
254
|
-
export { AlertDialog, Badge, Breadcrumb, Button, ButtonGroup, Calendar, Card, Carousel, Cascader, Checkbox, Combobox, DatePicker, DateRangePicker, Dialog, Drawer, Dropdown, Dropzone, Empty, Field, Form, Frame, IconSwap, Image, Input, InputGroup, JsonViewer, Kbd, Label, Lightbox, Pagination, Popover, Progress, Radio, ScrollArea, Select, Separator, Sidebar, Skeleton, Spinner, Switch, Table, Tabs, Textarea, TimePicker, Timeline, Toaster as ToastProvider, Tooltip, formatBytes, toast, useDropzone, useSidebar };
|
|
272
|
+
export { AlertDialog, Badge, Breadcrumb, Button, ButtonGroup, Calendar, Card, Carousel, Cascader, Checkbox, Combobox, ContextMenu, DatePicker, DateRangePicker, Dialog, Drawer, Dropdown, Dropzone, Empty, Field, Form, Frame, IconSwap, Image, Input, InputGroup, JsonViewer, Kbd, Label, Lightbox, Pagination, Popover, Progress, Radio, ScrollArea, Select, Separator, Sidebar, Skeleton, Spinner, Switch, Table, Tabs, Textarea, TimePicker, Timeline, Toaster as ToastProvider, Tooltip, formatBytes, toast, useDropzone, useSidebar };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deftui/react",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/KiriRainCat/deftui.git",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"cn": "^0.5.2",
|
|
39
39
|
"date-fns": "^4.4.0",
|
|
40
40
|
"embla-carousel-react": "^8.6.0",
|
|
41
|
-
"lucide-react": "^1.
|
|
42
|
-
"motion": "^14.
|
|
43
|
-
"radashi": "^13.0.
|
|
44
|
-
"react-dropzone": "^20.
|
|
41
|
+
"lucide-react": "^1.72.0",
|
|
42
|
+
"motion": "^14.13.0",
|
|
43
|
+
"radashi": "^13.0.4",
|
|
44
|
+
"react-dropzone": "^20.2.0",
|
|
45
45
|
"tw-animate-css": "^1.4.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|