@meta-1/design 0.0.198 → 0.0.200
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/package.json +3 -1
- package/src/assets/locales/en-us.ts +4 -0
- package/src/assets/locales/zh-cn.ts +4 -0
- package/src/assets/locales/zh-tw.ts +4 -0
- package/src/assets/style/theme.css +72 -21
- package/src/components/ui/button.tsx +28 -18
- package/src/components/uix/action/index.tsx +7 -5
- package/src/components/uix/action/style.css +21 -0
- package/src/components/uix/alert/index.tsx +5 -5
- package/src/components/uix/alert-dialog/index.tsx +56 -16
- package/src/components/uix/badge/index.tsx +8 -2
- package/src/components/uix/button/index.tsx +7 -5
- package/src/components/uix/card/index.tsx +7 -4
- package/src/components/uix/checkbox-group/index.tsx +3 -4
- package/src/components/uix/combo-select/index.tsx +99 -129
- package/src/components/uix/command/index.tsx +126 -0
- package/src/components/uix/data-grid/index.tsx +625 -0
- package/src/components/uix/data-grid/overlays.tsx +26 -0
- package/src/components/uix/data-grid/style.css +6 -0
- package/src/components/uix/data-table/index.tsx +17 -8
- package/src/components/uix/date-picker/index.tsx +55 -46
- package/src/components/uix/date-range-picker/index.tsx +116 -36
- package/src/components/uix/dialog/index.tsx +5 -5
- package/src/components/uix/dropdown/index.tsx +1 -1
- package/src/components/uix/input/index.tsx +23 -0
- package/src/components/uix/message/index.tsx +4 -4
- package/src/components/uix/pagination/index.tsx +17 -31
- package/src/components/uix/popover/index.tsx +30 -0
- package/src/components/uix/radio-group/index.tsx +2 -2
- package/src/components/uix/select/index.tsx +6 -2
- package/src/components/uix/sheet/index.tsx +76 -0
- package/src/components/uix/tabs/index.tsx +38 -0
- package/src/components/uix/tags-input/index.tsx +22 -3
- package/src/components/uix/textarea/index.tsx +23 -0
- package/src/components/uix/tooltip/index.tsx +5 -4
- package/src/components/uix/tree/style.css +1 -0
- package/src/components/uix/tree-select/index.tsx +59 -64
- package/src/components/uix/uploader/index.tsx +1 -1
- package/src/components/uix/value-formatter/index.tsx +40 -46
- package/src/index.ts +19 -35
- package/src/lib/utils.ts +50 -1
- package/src/components/uix/breadcrumbs/index.tsx +0 -38
- package/src/components/uix/space/index.tsx +0 -24
package/src/lib/utils.ts
CHANGED
|
@@ -1,5 +1,54 @@
|
|
|
1
1
|
import { type ClassValue, clsx } from "clsx";
|
|
2
|
-
import {
|
|
2
|
+
import { extendTailwindMerge } from "tailwind-merge";
|
|
3
|
+
|
|
4
|
+
const twMerge = extendTailwindMerge<string>({
|
|
5
|
+
extend: {
|
|
6
|
+
theme: {
|
|
7
|
+
radius: [
|
|
8
|
+
"sm",
|
|
9
|
+
"md",
|
|
10
|
+
"lg",
|
|
11
|
+
"xl",
|
|
12
|
+
"button",
|
|
13
|
+
"alert",
|
|
14
|
+
"dialog",
|
|
15
|
+
"badge",
|
|
16
|
+
"card",
|
|
17
|
+
"select",
|
|
18
|
+
"popover",
|
|
19
|
+
"command",
|
|
20
|
+
"calendar",
|
|
21
|
+
"input",
|
|
22
|
+
"tabs-title",
|
|
23
|
+
],
|
|
24
|
+
spacing: [
|
|
25
|
+
"2xs",
|
|
26
|
+
"xs",
|
|
27
|
+
"sm",
|
|
28
|
+
"md",
|
|
29
|
+
"lg",
|
|
30
|
+
"xl",
|
|
31
|
+
"2xl",
|
|
32
|
+
"3xl",
|
|
33
|
+
"4xl",
|
|
34
|
+
"5xl",
|
|
35
|
+
"6xl",
|
|
36
|
+
"7xl",
|
|
37
|
+
"button",
|
|
38
|
+
"alert",
|
|
39
|
+
"dialog",
|
|
40
|
+
"badge",
|
|
41
|
+
"card",
|
|
42
|
+
"select",
|
|
43
|
+
"popover",
|
|
44
|
+
"command",
|
|
45
|
+
"calendar",
|
|
46
|
+
"input",
|
|
47
|
+
"tabs-title",
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
});
|
|
3
52
|
|
|
4
53
|
export function cn(...inputs: ClassValue[]) {
|
|
5
54
|
return twMerge(clsx(inputs));
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Children, cloneElement, type FC, type PropsWithChildren, type ReactElement } from "react";
|
|
2
|
-
|
|
3
|
-
import { cn } from "@meta-1/design/lib";
|
|
4
|
-
|
|
5
|
-
export interface BreadcrumbsItemProps extends PropsWithChildren {
|
|
6
|
-
last?: boolean;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const BreadcrumbsItem: FC<BreadcrumbsItemProps> = (props) => {
|
|
10
|
-
const { last = false } = props;
|
|
11
|
-
return (
|
|
12
|
-
<div className="text-muted-foreground">
|
|
13
|
-
{props.children}
|
|
14
|
-
{last ? null : <span className="mx-2">/</span>}
|
|
15
|
-
</div>
|
|
16
|
-
);
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export interface BreadcrumbsProps extends PropsWithChildren {
|
|
20
|
-
className?: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export const Breadcrumbs: FC<BreadcrumbsProps> = (props) => {
|
|
24
|
-
const { children, className } = props;
|
|
25
|
-
|
|
26
|
-
const size = Children.count(children);
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<div className={cn("my-2 flex items-center justify-start", className)}>
|
|
30
|
-
{Children.map(children, (child, index) => {
|
|
31
|
-
const ele = child as ReactElement;
|
|
32
|
-
if (!ele) return null;
|
|
33
|
-
// biome-ignore lint/suspicious/noExplicitAny: <cloneElement>
|
|
34
|
-
return cloneElement<any>(ele, { ...(ele as any).props, last: index === size - 1 });
|
|
35
|
-
})}
|
|
36
|
-
</div>
|
|
37
|
-
);
|
|
38
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { FC, PropsWithChildren } from "react";
|
|
2
|
-
|
|
3
|
-
import { cn } from "@meta-1/design/lib";
|
|
4
|
-
|
|
5
|
-
export interface SpaceProps extends PropsWithChildren {
|
|
6
|
-
className?: string;
|
|
7
|
-
direction?: "horizontal" | "vertical";
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const Space: FC<SpaceProps> = (props) => {
|
|
11
|
-
const { direction = "horizontal", className } = props;
|
|
12
|
-
return (
|
|
13
|
-
<div
|
|
14
|
-
className={cn(
|
|
15
|
-
"flex items-start justify-start",
|
|
16
|
-
direction === "vertical" ? "flex-col space-y-2" : null,
|
|
17
|
-
direction === "horizontal" ? "flex-row items-start space-x-2" : null,
|
|
18
|
-
className,
|
|
19
|
-
)}
|
|
20
|
-
>
|
|
21
|
-
{props.children}
|
|
22
|
-
</div>
|
|
23
|
-
);
|
|
24
|
-
};
|