@downcity/ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/dist/index.cjs +586 -0
- package/dist/index.d.cts +104 -0
- package/dist/index.d.ts +104 -0
- package/dist/index.js +529 -0
- package/package.json +69 -0
- package/src/styles.css +137 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
|
+
import { Button as Button$1 } from '@base-ui/react/button';
|
|
5
|
+
import { VariantProps } from 'class-variance-authority';
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
8
|
+
import { Menu } from '@base-ui/react/menu';
|
|
9
|
+
import { Popover as Popover$1 } from '@base-ui/react/popover';
|
|
10
|
+
import { ToasterProps } from 'sonner';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Downcity UI SDK 通用工具。
|
|
14
|
+
*
|
|
15
|
+
* 关键说明(中文)
|
|
16
|
+
* - `cn` 统一合并条件类名与 Tailwind 冲突类。
|
|
17
|
+
* - 所有基础组件都应复用这个方法,避免类名覆盖顺序不一致。
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Downcity UI SDK 公共类型定义。
|
|
24
|
+
*
|
|
25
|
+
* 关键说明(中文)
|
|
26
|
+
* - 基础组件的公共联合类型统一集中到 `types/` 目录。
|
|
27
|
+
* - 这里只放跨组件共享或对外公开的类型,不放实现细节。
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* Button 组件支持的视觉变体。
|
|
31
|
+
*/
|
|
32
|
+
type DowncityButtonVariant = "default" | "outline" | "secondary" | "ghost" | "destructive" | "link";
|
|
33
|
+
/**
|
|
34
|
+
* Button 组件支持的尺寸。
|
|
35
|
+
*/
|
|
36
|
+
type DowncityButtonSize = "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg";
|
|
37
|
+
/**
|
|
38
|
+
* Card 组件支持的尺寸。
|
|
39
|
+
*/
|
|
40
|
+
type DowncityCardSize = "default" | "sm";
|
|
41
|
+
/**
|
|
42
|
+
* DropdownMenu Item 组件支持的变体。
|
|
43
|
+
*/
|
|
44
|
+
type DowncityDropdownMenuItemVariant = "default" | "destructive";
|
|
45
|
+
/**
|
|
46
|
+
* Toaster 支持的主题模式。
|
|
47
|
+
*/
|
|
48
|
+
type DowncityToasterTheme = "light" | "dark" | "system";
|
|
49
|
+
|
|
50
|
+
declare const buttonVariants: (props?: ({
|
|
51
|
+
variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" | "link" | null | undefined;
|
|
52
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
53
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
54
|
+
declare function Button({ className, variant, size, ...props }: Button$1.Props & VariantProps<typeof buttonVariants>): react_jsx_runtime.JSX.Element;
|
|
55
|
+
|
|
56
|
+
declare const badgeVariants: (props?: ({
|
|
57
|
+
variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" | "link" | null | undefined;
|
|
58
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
59
|
+
declare function Badge({ className, variant, render, ...props }: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
60
|
+
|
|
61
|
+
declare function Card({ className, size, ...props }: React.ComponentProps<"div"> & {
|
|
62
|
+
size?: "default" | "sm";
|
|
63
|
+
}): react_jsx_runtime.JSX.Element;
|
|
64
|
+
declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
65
|
+
declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
66
|
+
declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
67
|
+
declare function CardAction({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
68
|
+
declare function CardContent({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
69
|
+
declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
70
|
+
|
|
71
|
+
declare function DropdownMenu({ ...props }: Menu.Root.Props): react_jsx_runtime.JSX.Element;
|
|
72
|
+
declare function DropdownMenuPortal({ ...props }: Menu.Portal.Props): react_jsx_runtime.JSX.Element;
|
|
73
|
+
declare function DropdownMenuTrigger({ ...props }: Menu.Trigger.Props): react_jsx_runtime.JSX.Element;
|
|
74
|
+
declare function DropdownMenuContent({ align, alignOffset, side, sideOffset, className, ...props }: Menu.Popup.Props & Pick<Menu.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): react_jsx_runtime.JSX.Element;
|
|
75
|
+
declare function DropdownMenuGroup({ ...props }: Menu.Group.Props): react_jsx_runtime.JSX.Element;
|
|
76
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: Menu.GroupLabel.Props & {
|
|
77
|
+
inset?: boolean;
|
|
78
|
+
}): react_jsx_runtime.JSX.Element;
|
|
79
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: Menu.Item.Props & {
|
|
80
|
+
inset?: boolean;
|
|
81
|
+
variant?: "default" | "destructive";
|
|
82
|
+
}): react_jsx_runtime.JSX.Element;
|
|
83
|
+
declare function DropdownMenuSub({ ...props }: Menu.SubmenuRoot.Props): react_jsx_runtime.JSX.Element;
|
|
84
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: Menu.SubmenuTrigger.Props & {
|
|
85
|
+
inset?: boolean;
|
|
86
|
+
}): react_jsx_runtime.JSX.Element;
|
|
87
|
+
declare function DropdownMenuSubContent({ align, alignOffset, side, sideOffset, className, ...props }: React.ComponentProps<typeof DropdownMenuContent>): react_jsx_runtime.JSX.Element;
|
|
88
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }: Menu.CheckboxItem.Props & {
|
|
89
|
+
inset?: boolean;
|
|
90
|
+
}): react_jsx_runtime.JSX.Element;
|
|
91
|
+
declare function DropdownMenuRadioGroup({ ...props }: Menu.RadioGroup.Props): react_jsx_runtime.JSX.Element;
|
|
92
|
+
declare function DropdownMenuRadioItem({ className, children, inset, ...props }: Menu.RadioItem.Props & {
|
|
93
|
+
inset?: boolean;
|
|
94
|
+
}): react_jsx_runtime.JSX.Element;
|
|
95
|
+
declare function DropdownMenuSeparator({ className, ...props }: Menu.Separator.Props): react_jsx_runtime.JSX.Element;
|
|
96
|
+
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">): react_jsx_runtime.JSX.Element;
|
|
97
|
+
|
|
98
|
+
declare function Popover({ ...props }: Popover$1.Root.Props): react_jsx_runtime.JSX.Element;
|
|
99
|
+
declare function PopoverTrigger({ ...props }: Popover$1.Trigger.Props): react_jsx_runtime.JSX.Element;
|
|
100
|
+
declare function PopoverContent({ className, side, sideOffset, align, alignOffset, ...props }: Popover$1.Popup.Props & Pick<Popover$1.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): react_jsx_runtime.JSX.Element;
|
|
101
|
+
|
|
102
|
+
declare function Toaster({ ...props }: ToasterProps): react_jsx_runtime.JSX.Element;
|
|
103
|
+
|
|
104
|
+
export { Badge, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type DowncityButtonSize, type DowncityButtonVariant, type DowncityCardSize, type DowncityDropdownMenuItemVariant, type DowncityToasterTheme, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Popover, PopoverContent, PopoverTrigger, Toaster, badgeVariants, buttonVariants, cn };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
|
+
import { Button as Button$1 } from '@base-ui/react/button';
|
|
5
|
+
import { VariantProps } from 'class-variance-authority';
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
8
|
+
import { Menu } from '@base-ui/react/menu';
|
|
9
|
+
import { Popover as Popover$1 } from '@base-ui/react/popover';
|
|
10
|
+
import { ToasterProps } from 'sonner';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Downcity UI SDK 通用工具。
|
|
14
|
+
*
|
|
15
|
+
* 关键说明(中文)
|
|
16
|
+
* - `cn` 统一合并条件类名与 Tailwind 冲突类。
|
|
17
|
+
* - 所有基础组件都应复用这个方法,避免类名覆盖顺序不一致。
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Downcity UI SDK 公共类型定义。
|
|
24
|
+
*
|
|
25
|
+
* 关键说明(中文)
|
|
26
|
+
* - 基础组件的公共联合类型统一集中到 `types/` 目录。
|
|
27
|
+
* - 这里只放跨组件共享或对外公开的类型,不放实现细节。
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* Button 组件支持的视觉变体。
|
|
31
|
+
*/
|
|
32
|
+
type DowncityButtonVariant = "default" | "outline" | "secondary" | "ghost" | "destructive" | "link";
|
|
33
|
+
/**
|
|
34
|
+
* Button 组件支持的尺寸。
|
|
35
|
+
*/
|
|
36
|
+
type DowncityButtonSize = "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg";
|
|
37
|
+
/**
|
|
38
|
+
* Card 组件支持的尺寸。
|
|
39
|
+
*/
|
|
40
|
+
type DowncityCardSize = "default" | "sm";
|
|
41
|
+
/**
|
|
42
|
+
* DropdownMenu Item 组件支持的变体。
|
|
43
|
+
*/
|
|
44
|
+
type DowncityDropdownMenuItemVariant = "default" | "destructive";
|
|
45
|
+
/**
|
|
46
|
+
* Toaster 支持的主题模式。
|
|
47
|
+
*/
|
|
48
|
+
type DowncityToasterTheme = "light" | "dark" | "system";
|
|
49
|
+
|
|
50
|
+
declare const buttonVariants: (props?: ({
|
|
51
|
+
variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" | "link" | null | undefined;
|
|
52
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
53
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
54
|
+
declare function Button({ className, variant, size, ...props }: Button$1.Props & VariantProps<typeof buttonVariants>): react_jsx_runtime.JSX.Element;
|
|
55
|
+
|
|
56
|
+
declare const badgeVariants: (props?: ({
|
|
57
|
+
variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" | "link" | null | undefined;
|
|
58
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
59
|
+
declare function Badge({ className, variant, render, ...props }: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
60
|
+
|
|
61
|
+
declare function Card({ className, size, ...props }: React.ComponentProps<"div"> & {
|
|
62
|
+
size?: "default" | "sm";
|
|
63
|
+
}): react_jsx_runtime.JSX.Element;
|
|
64
|
+
declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
65
|
+
declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
66
|
+
declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
67
|
+
declare function CardAction({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
68
|
+
declare function CardContent({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
69
|
+
declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
70
|
+
|
|
71
|
+
declare function DropdownMenu({ ...props }: Menu.Root.Props): react_jsx_runtime.JSX.Element;
|
|
72
|
+
declare function DropdownMenuPortal({ ...props }: Menu.Portal.Props): react_jsx_runtime.JSX.Element;
|
|
73
|
+
declare function DropdownMenuTrigger({ ...props }: Menu.Trigger.Props): react_jsx_runtime.JSX.Element;
|
|
74
|
+
declare function DropdownMenuContent({ align, alignOffset, side, sideOffset, className, ...props }: Menu.Popup.Props & Pick<Menu.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): react_jsx_runtime.JSX.Element;
|
|
75
|
+
declare function DropdownMenuGroup({ ...props }: Menu.Group.Props): react_jsx_runtime.JSX.Element;
|
|
76
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: Menu.GroupLabel.Props & {
|
|
77
|
+
inset?: boolean;
|
|
78
|
+
}): react_jsx_runtime.JSX.Element;
|
|
79
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: Menu.Item.Props & {
|
|
80
|
+
inset?: boolean;
|
|
81
|
+
variant?: "default" | "destructive";
|
|
82
|
+
}): react_jsx_runtime.JSX.Element;
|
|
83
|
+
declare function DropdownMenuSub({ ...props }: Menu.SubmenuRoot.Props): react_jsx_runtime.JSX.Element;
|
|
84
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: Menu.SubmenuTrigger.Props & {
|
|
85
|
+
inset?: boolean;
|
|
86
|
+
}): react_jsx_runtime.JSX.Element;
|
|
87
|
+
declare function DropdownMenuSubContent({ align, alignOffset, side, sideOffset, className, ...props }: React.ComponentProps<typeof DropdownMenuContent>): react_jsx_runtime.JSX.Element;
|
|
88
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }: Menu.CheckboxItem.Props & {
|
|
89
|
+
inset?: boolean;
|
|
90
|
+
}): react_jsx_runtime.JSX.Element;
|
|
91
|
+
declare function DropdownMenuRadioGroup({ ...props }: Menu.RadioGroup.Props): react_jsx_runtime.JSX.Element;
|
|
92
|
+
declare function DropdownMenuRadioItem({ className, children, inset, ...props }: Menu.RadioItem.Props & {
|
|
93
|
+
inset?: boolean;
|
|
94
|
+
}): react_jsx_runtime.JSX.Element;
|
|
95
|
+
declare function DropdownMenuSeparator({ className, ...props }: Menu.Separator.Props): react_jsx_runtime.JSX.Element;
|
|
96
|
+
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">): react_jsx_runtime.JSX.Element;
|
|
97
|
+
|
|
98
|
+
declare function Popover({ ...props }: Popover$1.Root.Props): react_jsx_runtime.JSX.Element;
|
|
99
|
+
declare function PopoverTrigger({ ...props }: Popover$1.Trigger.Props): react_jsx_runtime.JSX.Element;
|
|
100
|
+
declare function PopoverContent({ className, side, sideOffset, align, alignOffset, ...props }: Popover$1.Popup.Props & Pick<Popover$1.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): react_jsx_runtime.JSX.Element;
|
|
101
|
+
|
|
102
|
+
declare function Toaster({ ...props }: ToasterProps): react_jsx_runtime.JSX.Element;
|
|
103
|
+
|
|
104
|
+
export { Badge, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type DowncityButtonSize, type DowncityButtonVariant, type DowncityCardSize, type DowncityDropdownMenuItemVariant, type DowncityToasterTheme, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Popover, PopoverContent, PopoverTrigger, Toaster, badgeVariants, buttonVariants, cn };
|