@meta-1/design 0.0.163 → 0.0.165

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meta-1/design",
3
- "version": "0.0.163",
3
+ "version": "0.0.165",
4
4
  "keywords": [
5
5
  "easykit",
6
6
  "design",
@@ -3,20 +3,26 @@ import type { PropsWithChildren } from "react";
3
3
  import { cn } from "@meta-1/design/lib/utils";
4
4
 
5
5
  export interface DividerProps extends PropsWithChildren {
6
- orientation: "left" | "center" | "right";
6
+ orientation?: "left" | "center" | "right";
7
7
  className?: string;
8
8
  labelClassName?: string;
9
9
  borderClassName?: string;
10
10
  }
11
11
 
12
12
  export const Divider = (props: DividerProps) => {
13
+ const { orientation = "center" } = props;
14
+ const orientationClass =
15
+ orientation === "left" ? "justify-start" : orientation === "right" ? "justify-end" : "justify-center";
16
+
13
17
  return (
14
- <div className={cn("relative my-6", props.className)}>
18
+ <div className={cn("relative", props.className)}>
15
19
  <div className="absolute inset-0 flex items-center">
16
20
  <span className={cn("w-full border-t", props.borderClassName)} />
17
21
  </div>
18
- <div className="relative flex justify-center text-xs uppercase">
19
- <span className={cn("bg-background px-2 text-muted-foreground", props.labelClassName)}>{props.children}</span>
22
+ <div className={cn("relative flex text-xs uppercase", orientationClass)}>
23
+ <span className={cn("mx-2 bg-background px-2 text-muted-foreground", props.labelClassName)}>
24
+ {props.children}
25
+ </span>
20
26
  </div>
21
27
  </div>
22
28
  );
@@ -6,7 +6,7 @@ import remove from "lodash/remove";
6
6
  import { type DropzoneOptions, useDropzone } from "react-dropzone";
7
7
  import { v4 as uuidv4 } from "uuid";
8
8
 
9
- import { Button, Progress, useMessage } from "@meta-1/design";
9
+ import { Button, Progress, Tooltip, useMessage } from "@meta-1/design";
10
10
  import { UIXContext } from "@meta-1/design/components/uix/config-provider";
11
11
  import { cn } from "@meta-1/design/lib";
12
12
  import type { HandleProps, UploadFile } from "./type";
@@ -166,13 +166,17 @@ export const Uploader = forwardRef<HTMLDivElement, UploaderProps>((props, forwar
166
166
  <div className="flex h-8 w-8 items-center justify-center">
167
167
  <FileIcon />
168
168
  </div>
169
- <div className="w-[50%] overflow-hidden overflow-ellipsis whitespace-nowrap text-sm">{file.name}</div>
170
- <div className="mx-1 flex-1">
169
+ <div className="min-w-0 flex-1 overflow-hidden overflow-ellipsis whitespace-nowrap text-sm">{file.name}</div>
170
+ <div className="mx-1 min-w-0 flex-1">
171
171
  {file.status === "uploading" && <Progress className="w-full" value={file.progress} />}
172
172
  {file.status === "error" && (
173
- <div className="flex items-center justify-end text-red-500">
174
- <CrossCircledIcon className="mr-1" />
175
- <span className="text-sm"> {file.error?.message}</span>
173
+ <div className="flex items-center justify-end">
174
+ <Tooltip content={file.error?.message}>
175
+ <CrossCircledIcon className="mr-1 flex-shrink-0 text-red-500" />
176
+ </Tooltip>
177
+ <span className="overflow-hidden text-ellipsis whitespace-nowrap text-red-500 text-sm">
178
+ {file.error?.message}
179
+ </span>
176
180
  </div>
177
181
  )}
178
182
  {file.status === "done" && (