@firecms/ui 3.0.0-beta.11 → 3.0.0-beta.13
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/components/Avatar.d.ts +1 -0
- package/dist/components/BooleanSwitch.d.ts +1 -1
- package/dist/components/BooleanSwitchWithLabel.d.ts +1 -1
- package/dist/components/Button.d.ts +6 -4
- package/dist/components/CircularProgress.d.ts +1 -1
- package/dist/components/DateTimeField.d.ts +1 -1
- package/dist/components/Dialog.d.ts +2 -1
- package/dist/components/Menu.d.ts +4 -1
- package/dist/components/MultiSelect.d.ts +14 -22
- package/dist/components/Select.d.ts +10 -9
- package/dist/components/Sheet.d.ts +2 -0
- package/dist/components/TextField.d.ts +38 -3
- package/dist/index.es.js +788 -684
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +788 -684
- package/dist/index.umd.js.map +1 -1
- package/package.json +30 -29
- package/src/components/Avatar.tsx +4 -1
- package/src/components/BooleanSwitch.tsx +1 -1
- package/src/components/BooleanSwitchWithLabel.tsx +7 -2
- package/src/components/Button.tsx +16 -17
- package/src/components/Chip.tsx +1 -0
- package/src/components/CircularProgress.tsx +7 -3
- package/src/components/DateTimeField.tsx +29 -23
- package/src/components/Dialog.tsx +3 -1
- package/src/components/DialogContent.tsx +1 -1
- package/src/components/FileUpload.tsx +2 -1
- package/src/components/Menu.tsx +13 -4
- package/src/components/Menubar.tsx +1 -1
- package/src/components/MultiSelect.tsx +54 -51
- package/src/components/SearchBar.tsx +1 -1
- package/src/components/Select.tsx +70 -55
- package/src/components/Sheet.tsx +9 -1
- package/src/components/Tabs.tsx +3 -1
- package/src/components/TextField.tsx +190 -153
- package/src/components/TextareaAutosize.tsx +2 -2
- package/src/components/Tooltip.tsx +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firecms/ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.0-beta.
|
|
4
|
+
"version": "3.0.0-beta.13",
|
|
5
5
|
"description": "Awesome Firebase/Firestore-based headless open-source CMS",
|
|
6
6
|
"funding": {
|
|
7
7
|
"url": "https://github.com/sponsors/firecmsco"
|
|
@@ -54,45 +54,46 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@material-design-icons/font": "^0.14.13",
|
|
57
|
-
"@radix-ui/react-checkbox": "^1.1.
|
|
58
|
-
"@radix-ui/react-collapsible": "^1.1.
|
|
59
|
-
"@radix-ui/react-dialog": "^1.1.
|
|
60
|
-
"@radix-ui/react-dropdown-menu": "^2.1.
|
|
61
|
-
"@radix-ui/react-label": "^2.1.
|
|
62
|
-
"@radix-ui/react-menubar": "^1.1.
|
|
63
|
-
"@radix-ui/react-popover": "^1.1.
|
|
64
|
-
"@radix-ui/react-portal": "^1.1.
|
|
65
|
-
"@radix-ui/react-radio-group": "^1.2.
|
|
66
|
-
"@radix-ui/react-scroll-area": "^1.2.
|
|
67
|
-
"@radix-ui/react-select": "^2.1.
|
|
68
|
-
"@radix-ui/react-separator": "^1.1.
|
|
69
|
-
"@radix-ui/react-slider": "^1.2.
|
|
70
|
-
"@radix-ui/react-switch": "^1.1.
|
|
71
|
-
"@radix-ui/react-tabs": "^1.1.
|
|
72
|
-
"@radix-ui/react-tooltip": "^1.1.
|
|
73
|
-
"@radix-ui/react-visually-hidden": "^1.1.
|
|
57
|
+
"@radix-ui/react-checkbox": "^1.1.3",
|
|
58
|
+
"@radix-ui/react-collapsible": "^1.1.2",
|
|
59
|
+
"@radix-ui/react-dialog": "^1.1.4",
|
|
60
|
+
"@radix-ui/react-dropdown-menu": "^2.1.4",
|
|
61
|
+
"@radix-ui/react-label": "^2.1.1",
|
|
62
|
+
"@radix-ui/react-menubar": "^1.1.4",
|
|
63
|
+
"@radix-ui/react-popover": "^1.1.4",
|
|
64
|
+
"@radix-ui/react-portal": "^1.1.3",
|
|
65
|
+
"@radix-ui/react-radio-group": "^1.2.2",
|
|
66
|
+
"@radix-ui/react-scroll-area": "^1.2.2",
|
|
67
|
+
"@radix-ui/react-select": "^2.1.4",
|
|
68
|
+
"@radix-ui/react-separator": "^1.1.1",
|
|
69
|
+
"@radix-ui/react-slider": "^1.2.2",
|
|
70
|
+
"@radix-ui/react-switch": "^1.1.2",
|
|
71
|
+
"@radix-ui/react-tabs": "^1.1.2",
|
|
72
|
+
"@radix-ui/react-tooltip": "^1.1.6",
|
|
73
|
+
"@radix-ui/react-visually-hidden": "^1.1.1",
|
|
74
74
|
"clsx": "^2.1.1",
|
|
75
75
|
"cmdk": "^0.2.1",
|
|
76
76
|
"date-fns": "^3.6.0",
|
|
77
77
|
"markdown-it": "^14.1.0",
|
|
78
78
|
"react-dropzone": "^14.3.5",
|
|
79
79
|
"react-fast-compare": "^3.2.2",
|
|
80
|
-
"tailwind-merge": "^2.
|
|
80
|
+
"tailwind-merge": "^2.6.0"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
|
-
"react": "
|
|
84
|
-
"react-dom": "
|
|
83
|
+
"react": ">=18.0.0",
|
|
84
|
+
"react-dom": ">=18.0.0"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@jest/globals": "^29.7.0",
|
|
88
|
+
"@tailwindcss/postcss": "^4.1.4",
|
|
88
89
|
"@testing-library/jest-dom": "^6.6.3",
|
|
89
|
-
"@testing-library/react": "^16.0
|
|
90
|
-
"@testing-library/user-event": "^14.
|
|
90
|
+
"@testing-library/react": "^16.2.0",
|
|
91
|
+
"@testing-library/user-event": "^14.6.1",
|
|
91
92
|
"@types/jest": "^29.5.14",
|
|
92
|
-
"@types/node": "^20.17.
|
|
93
|
+
"@types/node": "^20.17.14",
|
|
93
94
|
"@types/object-hash": "^3.0.6",
|
|
94
|
-
"@types/react": "^18.3.
|
|
95
|
-
"@types/react-dom": "^18.3.
|
|
95
|
+
"@types/react": "^18.3.18",
|
|
96
|
+
"@types/react-dom": "^18.3.0",
|
|
96
97
|
"@types/react-measure": "^2.0.12",
|
|
97
98
|
"@vitejs/plugin-react": "^4.3.4",
|
|
98
99
|
"babel-plugin-react-compiler": "beta",
|
|
@@ -105,8 +106,8 @@
|
|
|
105
106
|
"ts-jest": "^29.2.5",
|
|
106
107
|
"ts-node": "^10.9.2",
|
|
107
108
|
"tsd": "^0.31.2",
|
|
108
|
-
"typescript": "^5.7.
|
|
109
|
-
"vite": "^5.4.
|
|
109
|
+
"typescript": "^5.7.3",
|
|
110
|
+
"vite": "^5.4.14",
|
|
110
111
|
"vite-plugin-static-copy": "^1.0.6"
|
|
111
112
|
},
|
|
112
113
|
"files": [
|
|
@@ -115,7 +116,7 @@
|
|
|
115
116
|
"index.css",
|
|
116
117
|
"tailwind.config.js"
|
|
117
118
|
],
|
|
118
|
-
"gitHead": "
|
|
119
|
+
"gitHead": "26d5e1f33a7ac00c78e45cd3cb3c397f4ba00821",
|
|
119
120
|
"publishConfig": {
|
|
120
121
|
"access": "public"
|
|
121
122
|
}
|
|
@@ -8,6 +8,7 @@ export interface AvatarProps {
|
|
|
8
8
|
children?: React.ReactNode;
|
|
9
9
|
className?: string;
|
|
10
10
|
outerClassName?: string;
|
|
11
|
+
hover?: boolean;
|
|
11
12
|
style?: React.CSSProperties;
|
|
12
13
|
}
|
|
13
14
|
|
|
@@ -19,6 +20,7 @@ const AvatarInner: React.ForwardRefRenderFunction<HTMLButtonElement, AvatarProps
|
|
|
19
20
|
className,
|
|
20
21
|
style,
|
|
21
22
|
outerClassName,
|
|
23
|
+
hover = true,
|
|
22
24
|
...props
|
|
23
25
|
},
|
|
24
26
|
ref
|
|
@@ -36,7 +38,8 @@ const AvatarInner: React.ForwardRefRenderFunction<HTMLButtonElement, AvatarProps
|
|
|
36
38
|
{...props}
|
|
37
39
|
className={cls(
|
|
38
40
|
"rounded-full flex items-center justify-center overflow-hidden",
|
|
39
|
-
"p-1
|
|
41
|
+
"p-1 w-12 h-12 min-w-12 min-h-12",
|
|
42
|
+
hover && "hover:bg-surface-accent-200 hover:dark:bg-surface-accent-700",
|
|
40
43
|
outerClassName
|
|
41
44
|
)}
|
|
42
45
|
>
|
|
@@ -6,7 +6,7 @@ export type BooleanSwitchProps = {
|
|
|
6
6
|
value: boolean | null;
|
|
7
7
|
className?: string;
|
|
8
8
|
disabled?: boolean;
|
|
9
|
-
size?: "small" | "medium" | "large";
|
|
9
|
+
size?: "smallest" | "small" | "medium" | "large";
|
|
10
10
|
} & ({
|
|
11
11
|
allowIndeterminate: true;
|
|
12
12
|
onValueChange?: (newValue: boolean | null) => void;
|
|
@@ -27,13 +27,13 @@ export type BooleanSwitchWithLabelProps = BooleanSwitchProps & {
|
|
|
27
27
|
export const BooleanSwitchWithLabel = function BooleanSwitchWithLabel({
|
|
28
28
|
value,
|
|
29
29
|
position = "end",
|
|
30
|
+
size = "medium",
|
|
30
31
|
invisible,
|
|
31
32
|
onValueChange,
|
|
32
33
|
error,
|
|
33
34
|
label,
|
|
34
35
|
autoFocus,
|
|
35
36
|
disabled,
|
|
36
|
-
size,
|
|
37
37
|
className,
|
|
38
38
|
fullWidth = true,
|
|
39
39
|
inputClassName,
|
|
@@ -67,7 +67,12 @@ export const BooleanSwitchWithLabel = function BooleanSwitchWithLabel({
|
|
|
67
67
|
"rounded-md max-w-full justify-between box-border relative inline-flex items-center",
|
|
68
68
|
!invisible && focus && !disabled ? focusedClasses : "",
|
|
69
69
|
error ? "text-red-500 dark:text-red-600" : (focus && !disabled ? "text-primary" : (!disabled ? "text-text-primary dark:text-text-primary-dark" : "text-text-secondary dark:text-text-secondary-dark")),
|
|
70
|
-
|
|
70
|
+
{
|
|
71
|
+
"min-h-[28px]": size === "smallest",
|
|
72
|
+
"min-h-[32px]": size === "small",
|
|
73
|
+
"min-h-[42px]": size === "medium",
|
|
74
|
+
"min-h-[64px]": size === "large",
|
|
75
|
+
},
|
|
71
76
|
size === "small" ? "pl-2" : "pl-4",
|
|
72
77
|
size === "small" ? "pr-4" : "pr-6",
|
|
73
78
|
position === "end" ? "flex-row-reverse" : "flex-row",
|
|
@@ -2,21 +2,22 @@
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { cls } from "../util";
|
|
4
4
|
|
|
5
|
-
export type ButtonProps<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
variant?: "filled" | "neutral" | "outlined" | "text";
|
|
5
|
+
export type ButtonProps<C extends React.ElementType = "button"> = {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
variant?: "filled" | "outlined" | "text";
|
|
9
8
|
disabled?: boolean;
|
|
10
|
-
color?: "primary" | "secondary" | "text" | "error";
|
|
9
|
+
color?: "primary" | "secondary" | "text" | "error" | "neutral";
|
|
11
10
|
size?: "small" | "medium" | "large" | "xl" | "2xl";
|
|
12
11
|
startIcon?: React.ReactNode;
|
|
13
12
|
fullWidth?: boolean;
|
|
14
13
|
className?: string;
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
component?: C;
|
|
15
|
+
onClick?: React.MouseEventHandler<any>;
|
|
16
|
+
} & React.ComponentPropsWithoutRef<C>;
|
|
17
17
|
|
|
18
18
|
const ButtonInner = React.forwardRef<
|
|
19
|
-
|
|
19
|
+
HTMLButtonElement,
|
|
20
|
+
ButtonProps<React.ElementType>
|
|
20
21
|
>(({
|
|
21
22
|
children,
|
|
22
23
|
className,
|
|
@@ -42,29 +43,27 @@ const ButtonInner = React.forwardRef<
|
|
|
42
43
|
"border border-secondary bg-secondary focus:ring-secondary shadow hover:ring-1 hover:ring-secondary text-white hover:text-white": variant === "filled" && color === "secondary" && !disabled,
|
|
43
44
|
"border border-red-500 bg-red-500 hover:bg-red-500 focus:ring-red-500 shadow hover:ring-1 hover:ring-red-600 text-white hover:text-white": variant === "filled" && color === "error" && !disabled,
|
|
44
45
|
"border border-surface-accent-200 bg-surface-accent-200 hover:bg-surface-accent-300 focus:ring-surface-accent-400 shadow hover:ring-1 hover:ring-surface-accent-400 text-text-primary hover:text-text-primary dark:text-text-primary-dark hover:dark:text-text-primary-dark": variant === "filled" && color === "text" && !disabled,
|
|
46
|
+
"border border-transparent bg-surface-100 hover:bg-surface-accent-200 text-text-primary dark:bg-surface-800 dark:hover:bg-surface-accent-700 dark:text-text-primary-dark": variant === "filled" && color === "neutral" && !disabled,
|
|
45
47
|
|
|
46
48
|
// Text Variants
|
|
47
|
-
"border border-transparent text-primary hover:text-primary hover:bg-surface-accent-200 dark:hover:bg-surface-
|
|
48
|
-
"border border-transparent text-secondary hover:text-secondary hover:bg-
|
|
49
|
+
"border border-transparent text-primary hover:text-primary hover:bg-surface-accent-200 hover:bg-opacity-75 dark:hover:bg-surface-accent-800": variant === "text" && color === "primary" && !disabled,
|
|
50
|
+
"border border-transparent text-secondary hover:text-secondary hover:bg-surface-accent-200 hover:bg-opacity-75 dark:hover:bg-surface-accent-800": variant === "text" && color === "secondary" && !disabled,
|
|
49
51
|
"border border-transparent text-red-500 hover:text-red-500 hover:bg-red-500 hover:bg-opacity-10": variant === "text" && color === "error" && !disabled,
|
|
50
52
|
"border border-transparent text-text-primary hover:text-text-primary dark:text-text-primary-dark hover:dark:text-text-primary-dark hover:bg-surface-accent-200 hover:dark:bg-surface-700": variant === "text" && color === "text" && !disabled,
|
|
53
|
+
"border border-transparent text-text-primary hover:text-text-primary hover:bg-surface-accent-200 dark:text-text-primary-dark dark:hover:bg-surface-accent-700": variant === "text" && color === "neutral" && !disabled,
|
|
51
54
|
|
|
52
55
|
// Outlined Variants
|
|
53
56
|
"border border-primary text-primary hover:text-primary hover:bg-primary-bg": variant === "outlined" && color === "primary" && !disabled,
|
|
54
57
|
"border border-secondary text-secondary hover:text-secondary hover:bg-secondary-bg": variant === "outlined" && color === "secondary" && !disabled,
|
|
55
58
|
"border border-red-500 text-red-500 hover:text-red-500 hover:bg-red-500 hover:text-white": variant === "outlined" && color === "error" && !disabled,
|
|
56
59
|
"border border-surface-accent-400 text-text-primary hover:text-text-primary dark:text-text-primary-dark hover:bg-surface-accent-200": variant === "outlined" && color === "text" && !disabled,
|
|
57
|
-
|
|
58
|
-
// Neutral Variants
|
|
59
|
-
"border border-transparent bg-surface-100 hover:bg-surface-accent-200 text-text-primary dark:bg-surface-800 dark:hover:bg-surface-accent-700 dark:text-white": variant === "neutral" && (color === "primary" || color === "text") && !disabled,
|
|
60
|
-
"border border-transparent bg-surface-100 hover:bg-surface-accent-200 text-text-secondary dark:bg-surface-800 dark:hover:bg-surface-accent-700 dark:text-white": variant === "neutral" && color === "secondary" && !disabled,
|
|
61
|
-
"border border-transparent bg-surface-100 hover:bg-surface-accent-200 text-error dark:bg-surface-800 dark:hover:bg-surface-accent-700 dark:text-error": variant === "neutral" && color === "error" && !disabled,
|
|
60
|
+
"border border-surface-400 text-text-primary hover:bg-surface-accent-200 dark:border-surface-600 dark:text-text-primary-dark dark:hover:bg-surface-accent-700": variant === "outlined" && color === "neutral" && !disabled,
|
|
62
61
|
|
|
63
62
|
// Disabled states for all variants
|
|
64
63
|
"text-text-disabled dark:text-text-disabled-dark": disabled,
|
|
65
64
|
"border border-transparent opacity-50": variant === "text" && disabled,
|
|
66
65
|
"border border-surface-500 opacity-50": variant === "outlined" && disabled,
|
|
67
|
-
"border border-surface-
|
|
66
|
+
"border border-transparent bg-surface-300 dark:bg-surface-500 opacity-40": variant === "filled" && disabled,
|
|
68
67
|
});
|
|
69
68
|
|
|
70
69
|
const sizeClasses = cls(
|
|
@@ -83,7 +82,7 @@ const ButtonInner = React.forwardRef<
|
|
|
83
82
|
ref={ref}
|
|
84
83
|
onClick={props.onClick}
|
|
85
84
|
className={cls(startIcon ? "pl-3" : "", baseClasses, buttonClasses, sizeClasses, className)}
|
|
86
|
-
{...
|
|
85
|
+
{...props}>
|
|
87
86
|
{startIcon}
|
|
88
87
|
{children}
|
|
89
88
|
</Component>
|
package/src/components/Chip.tsx
CHANGED
|
@@ -46,6 +46,7 @@ export function Chip({
|
|
|
46
46
|
<div
|
|
47
47
|
className={cls("rounded-lg max-w-full w-max h-fit font-regular inline-flex gap-1",
|
|
48
48
|
"text-ellipsis",
|
|
49
|
+
"items-center",
|
|
49
50
|
onClick ? "cursor-pointer hover:bg-surface-accent-300 hover:dark:bg-surface-accent-700" : "",
|
|
50
51
|
sizeClassNames[size],
|
|
51
52
|
error || !usedColorScheme ? "bg-surface-accent-200 dark:bg-surface-accent-800 text-surface-accent-800 dark:text-white" : "",
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { cls } from "../util";
|
|
3
3
|
|
|
4
4
|
export type CircularProgressProps = {
|
|
5
|
-
size?: "small" | "medium" | "large",
|
|
5
|
+
size?: "smallest" | "small" | "medium" | "large",
|
|
6
6
|
className?: string
|
|
7
7
|
}
|
|
8
8
|
|
|
@@ -12,8 +12,10 @@ export function CircularProgress({
|
|
|
12
12
|
}: CircularProgressProps) {
|
|
13
13
|
|
|
14
14
|
let sizeClasses = "";
|
|
15
|
-
if (size === "
|
|
15
|
+
if (size === "smallest") {
|
|
16
16
|
sizeClasses = "w-4 h-4";
|
|
17
|
+
} else if (size === "small") {
|
|
18
|
+
sizeClasses = "w-6 h-6";
|
|
17
19
|
} else if (size === "medium") {
|
|
18
20
|
sizeClasses = "w-8 h-8 m-1";
|
|
19
21
|
} else {
|
|
@@ -21,8 +23,10 @@ export function CircularProgress({
|
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
let borderClasses = "";
|
|
24
|
-
if (size === "
|
|
26
|
+
if (size === "smallest") {
|
|
25
27
|
borderClasses = "border-[3px]";
|
|
28
|
+
} else if (size === "small") {
|
|
29
|
+
borderClasses = "border-[4px]";
|
|
26
30
|
} else if (size === "medium") {
|
|
27
31
|
borderClasses = "border-4";
|
|
28
32
|
} else {
|
|
@@ -16,7 +16,7 @@ export type DateTimeFieldProps = {
|
|
|
16
16
|
disabled?: boolean;
|
|
17
17
|
clearable?: boolean;
|
|
18
18
|
error?: boolean;
|
|
19
|
-
size?: "medium" | "large";
|
|
19
|
+
size?: "smallest" | "small" | "medium" | "large";
|
|
20
20
|
label?: React.ReactNode;
|
|
21
21
|
className?: string;
|
|
22
22
|
style?: React.CSSProperties;
|
|
@@ -38,7 +38,6 @@ export const DateTimeField: React.FC<DateTimeFieldProps> = ({
|
|
|
38
38
|
style,
|
|
39
39
|
inputClassName,
|
|
40
40
|
invisible,
|
|
41
|
-
locale, // Note: The 'locale' prop is not utilized with native inputs as they are managed by the browser.
|
|
42
41
|
}) => {
|
|
43
42
|
const inputRef = useRef<HTMLInputElement>(null);
|
|
44
43
|
const [focused, setFocused] = useState(false);
|
|
@@ -111,7 +110,9 @@ export const DateTimeField: React.FC<DateTimeFieldProps> = ({
|
|
|
111
110
|
!invisible && fieldBackgroundMixin,
|
|
112
111
|
disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin,
|
|
113
112
|
{
|
|
114
|
-
"min-h-[
|
|
113
|
+
"min-h-[28px]": size === "smallest",
|
|
114
|
+
"min-h-[32px]": size === "small",
|
|
115
|
+
"min-h-[42px]": size === "medium",
|
|
115
116
|
"min-h-[64px]": size === "large",
|
|
116
117
|
},
|
|
117
118
|
className
|
|
@@ -141,25 +142,30 @@ export const DateTimeField: React.FC<DateTimeFieldProps> = ({
|
|
|
141
142
|
</InputLabel>
|
|
142
143
|
)}
|
|
143
144
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
"
|
|
161
|
-
|
|
162
|
-
|
|
145
|
+
<input
|
|
146
|
+
ref={inputRef}
|
|
147
|
+
type={mode === "date_time" ? "datetime-local" : "date"}
|
|
148
|
+
value={valueAsInputValue(value ?? null, mode)}
|
|
149
|
+
onChange={handleInputChange}
|
|
150
|
+
onFocus={() => setFocused(true)}
|
|
151
|
+
onBlur={() => setFocused(false)}
|
|
152
|
+
disabled={disabled}
|
|
153
|
+
className={cls(
|
|
154
|
+
"w-full outline-none bg-transparent leading-normal text-base px-3",
|
|
155
|
+
clearable ? "pr-14" : "pr-12",
|
|
156
|
+
"rounded-md",
|
|
157
|
+
{
|
|
158
|
+
"min-h-[28px]": size === "smallest",
|
|
159
|
+
"min-h-[32px]": size === "small",
|
|
160
|
+
"min-h-[42px]": size === "medium",
|
|
161
|
+
"min-h-[64px]": size === "large",
|
|
162
|
+
},
|
|
163
|
+
label ? "pt-8 pb-2" : "py-2",
|
|
164
|
+
inputClassName,
|
|
165
|
+
disabled &&
|
|
166
|
+
"border border-transparent outline-none opacity-50 dark:opacity-50 text-surface-accent-600 dark:text-surface-accent-500"
|
|
167
|
+
)}
|
|
168
|
+
/>
|
|
163
169
|
<IconButton
|
|
164
170
|
onClick={(e) => {
|
|
165
171
|
e.stopPropagation();
|
|
@@ -180,7 +186,7 @@ export const DateTimeField: React.FC<DateTimeFieldProps> = ({
|
|
|
180
186
|
</div>
|
|
181
187
|
{invalidValue && (
|
|
182
188
|
<div className="flex items-center m-2">
|
|
183
|
-
<ErrorIcon size={"
|
|
189
|
+
<ErrorIcon size={"small"} color={"error"}/>
|
|
184
190
|
<div className="pl-2">
|
|
185
191
|
<Typography variant={"body2"}>
|
|
186
192
|
Invalid date value for this field
|
|
@@ -9,6 +9,7 @@ export type DialogProps = {
|
|
|
9
9
|
onOpenChange?: (open: boolean) => void;
|
|
10
10
|
children: React.ReactNode;
|
|
11
11
|
className?: string;
|
|
12
|
+
containerClassName?: string;
|
|
12
13
|
fullWidth?: boolean;
|
|
13
14
|
fullHeight?: boolean;
|
|
14
15
|
fullScreen?: boolean;
|
|
@@ -41,6 +42,7 @@ export const Dialog = ({
|
|
|
41
42
|
onOpenChange,
|
|
42
43
|
children,
|
|
43
44
|
className,
|
|
45
|
+
containerClassName,
|
|
44
46
|
fullWidth = true,
|
|
45
47
|
fullHeight,
|
|
46
48
|
fullScreen,
|
|
@@ -73,7 +75,7 @@ export const Dialog = ({
|
|
|
73
75
|
onOpenChange={onOpenChange}>
|
|
74
76
|
<DialogPrimitive.Portal>
|
|
75
77
|
|
|
76
|
-
<div className={"fixed inset-0 z-30"}>
|
|
78
|
+
<div className={cls("fixed inset-0 z-30", containerClassName)}>
|
|
77
79
|
|
|
78
80
|
<DialogPrimitive.Overlay
|
|
79
81
|
className={cls("fixed inset-0 transition-opacity z-20 ease-in-out duration-200 bg-black bg-opacity-50 dark:bg-opacity-60 backdrop-blur-sm ",
|
|
@@ -89,7 +89,8 @@ export function FileUpload({
|
|
|
89
89
|
<div
|
|
90
90
|
className="flex-grow h-28 box-border flex flex-col items-center justify-center text-center">
|
|
91
91
|
<Typography align={"center"}
|
|
92
|
-
variant={"label"}
|
|
92
|
+
variant={"label"}
|
|
93
|
+
className={"flex flex-row gap-2 justify-center"}>
|
|
93
94
|
{uploadDescription}
|
|
94
95
|
</Typography>
|
|
95
96
|
</div>
|
package/src/components/Menu.tsx
CHANGED
|
@@ -15,6 +15,9 @@ export type MenuProps = {
|
|
|
15
15
|
portalContainer?: HTMLElement | null;
|
|
16
16
|
side?: "top" | "right" | "bottom" | "left";
|
|
17
17
|
align?: "start" | "center" | "end";
|
|
18
|
+
|
|
19
|
+
sideOffset?: number;
|
|
20
|
+
className?: string;
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
const Menu = React.forwardRef<
|
|
@@ -28,7 +31,9 @@ const Menu = React.forwardRef<
|
|
|
28
31
|
side,
|
|
29
32
|
align,
|
|
30
33
|
onOpenChange,
|
|
31
|
-
portalContainer
|
|
34
|
+
portalContainer,
|
|
35
|
+
sideOffset = 4,
|
|
36
|
+
className
|
|
32
37
|
}, ref) => (
|
|
33
38
|
<DropdownMenu.Root
|
|
34
39
|
open={open}
|
|
@@ -42,8 +47,9 @@ const Menu = React.forwardRef<
|
|
|
42
47
|
<DropdownMenu.Portal container={portalContainer}>
|
|
43
48
|
<DropdownMenu.Content
|
|
44
49
|
side={side}
|
|
50
|
+
sideOffset={sideOffset}
|
|
45
51
|
align={align}
|
|
46
|
-
className={cls(paperMixin, focusedDisabled, "shadow py-2 z-30")}>
|
|
52
|
+
className={cls(paperMixin, focusedDisabled, "shadow py-2 z-30", className)}>
|
|
47
53
|
{children}
|
|
48
54
|
</DropdownMenu.Content>
|
|
49
55
|
</DropdownMenu.Portal>
|
|
@@ -57,18 +63,21 @@ export type MenuItemProps = {
|
|
|
57
63
|
children: React.ReactNode;
|
|
58
64
|
dense?: boolean;
|
|
59
65
|
onClick?: (event: React.MouseEvent) => void;
|
|
66
|
+
className?: string;
|
|
60
67
|
};
|
|
61
68
|
|
|
62
69
|
export function MenuItem({
|
|
63
70
|
children,
|
|
64
71
|
dense = false, // Default value is false if not provided
|
|
65
|
-
onClick
|
|
72
|
+
onClick,
|
|
73
|
+
className
|
|
66
74
|
}: MenuItemProps) {
|
|
67
75
|
// Dynamically adjusting the class based on the "dense" prop
|
|
68
76
|
const classNames = cls(
|
|
69
77
|
onClick && "cursor-pointer",
|
|
70
78
|
"rounded-md text-sm font-medium text-surface-accent-700 dark:text-surface-accent-300 hover:bg-surface-accent-100 dark:hover:bg-surface-accent-900 flex items-center gap-4",
|
|
71
|
-
dense ? "px-3 py-1.5" : "px-4 py-2"
|
|
79
|
+
dense ? "px-3 py-1.5" : "px-4 py-2",
|
|
80
|
+
className
|
|
72
81
|
);
|
|
73
82
|
|
|
74
83
|
return (
|
|
@@ -44,7 +44,7 @@ export function MenubarTrigger({
|
|
|
44
44
|
return (
|
|
45
45
|
<MenubarPrimitive.Trigger
|
|
46
46
|
onSelect={onSelect}
|
|
47
|
-
className={cls("py-2 px-3 outline-none select-none font-medium leading-none rounded text-text-primary dark:text-text-primary-dark text-[13px] flex items-center justify-between gap-[2px] data-[highlighted]:bg-surface-accent-100 data-[highlighted]:dark:bg-surface-800 data-[state=open]:bg-surface-accent-100 data-[state=open]:dark:bg-surface-800 hover:bg-surface-accent-200 hover:bg-opacity-75 dark:hover:bg-surface-
|
|
47
|
+
className={cls("py-2 px-3 outline-none select-none font-medium leading-none rounded text-text-primary dark:text-text-primary-dark text-[13px] flex items-center justify-between gap-[2px] data-[highlighted]:bg-surface-accent-100 data-[highlighted]:dark:bg-surface-800 data-[state=open]:bg-surface-accent-100 data-[state=open]:dark:bg-surface-800 hover:bg-surface-accent-200 hover:bg-opacity-75 dark:hover:bg-surface-accent-800",
|
|
48
48
|
className)}>
|
|
49
49
|
{children}
|
|
50
50
|
</MenubarPrimitive.Trigger>
|