@firecms/ui 3.0.0-canary.153 → 3.0.0-canary.155
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/DialogContent.d.ts +2 -1
- package/dist/components/DialogTitle.d.ts +2 -1
- package/dist/components/Select.d.ts +1 -0
- package/dist/index.es.js +38976 -8368
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +38976 -8369
- package/dist/index.umd.js.map +1 -1
- package/package.json +9 -3
- package/src/components/Avatar.tsx +1 -0
- package/src/components/BooleanSwitch.tsx +1 -0
- package/src/components/Button.tsx +1 -0
- package/src/components/CenteredView.tsx +1 -0
- package/src/components/Container.tsx +1 -0
- package/src/components/DateTimeField.tsx +1 -1
- package/src/components/DialogContent.tsx +6 -2
- package/src/components/DialogTitle.tsx +5 -1
- package/src/components/IconButton.tsx +1 -1
- package/src/components/InputLabel.tsx +1 -0
- package/src/components/Label.tsx +1 -0
- package/src/components/Menu.tsx +1 -0
- package/src/components/RadioGroup.tsx +1 -0
- package/src/components/Select.tsx +61 -54
- package/src/components/Slider.tsx +1 -0
- package/src/components/Tabs.tsx +0 -2
package/package.json
CHANGED
@@ -1,14 +1,18 @@
|
|
1
1
|
{
|
2
2
|
"name": "@firecms/ui",
|
3
3
|
"type": "module",
|
4
|
-
"version": "3.0.0-canary.
|
4
|
+
"version": "3.0.0-canary.155",
|
5
5
|
"description": "Awesome Firebase/Firestore-based headless open-source CMS",
|
6
6
|
"funding": {
|
7
7
|
"url": "https://github.com/sponsors/firecmsco"
|
8
8
|
},
|
9
9
|
"author": "FireCMS",
|
10
10
|
"license": "MIT",
|
11
|
-
"repository":
|
11
|
+
"repository": {
|
12
|
+
"type": "git",
|
13
|
+
"url": "https://github.com/firecmsco/firecms.git",
|
14
|
+
"directory": "packages/ui"
|
15
|
+
},
|
12
16
|
"main": "./dist/index.umd.js",
|
13
17
|
"module": "./dist/index.es.js",
|
14
18
|
"types": "./dist/index.d.ts",
|
@@ -91,7 +95,9 @@
|
|
91
95
|
"@types/react-dom": "^18.3.1",
|
92
96
|
"@types/react-measure": "^2.0.12",
|
93
97
|
"@vitejs/plugin-react": "^4.3.3",
|
98
|
+
"babel-plugin-react-compiler": "beta",
|
94
99
|
"cross-env": "^7.0.3",
|
100
|
+
"eslint-plugin-react-compiler": "beta",
|
95
101
|
"firebase": "^10.14.1",
|
96
102
|
"jest": "^29.7.0",
|
97
103
|
"npm-run-all": "^4.1.5",
|
@@ -108,7 +114,7 @@
|
|
108
114
|
"index.css",
|
109
115
|
"tailwind.config.js"
|
110
116
|
],
|
111
|
-
"gitHead": "
|
117
|
+
"gitHead": "c9b71679d709242ff3a47ec56a0ecf980ec76564",
|
112
118
|
"publishConfig": {
|
113
119
|
"access": "public"
|
114
120
|
}
|
@@ -180,7 +180,7 @@ export const DateTimeField: React.FC<DateTimeFieldProps> = ({
|
|
180
180
|
<div className="flex items-center m-2">
|
181
181
|
<ErrorIcon size={"medium"} color={"error"}/>
|
182
182
|
<div className="pl-2">
|
183
|
-
<Typography variant={"body2"}
|
183
|
+
<Typography variant={"body2"}>
|
184
184
|
Invalid date value for this field
|
185
185
|
</Typography>
|
186
186
|
<Typography variant={"body2"}>
|
@@ -4,9 +4,11 @@ import { cls } from "../util";
|
|
4
4
|
export function DialogContent({
|
5
5
|
children,
|
6
6
|
className,
|
7
|
-
fullHeight
|
7
|
+
fullHeight,
|
8
|
+
includeMargin = true
|
8
9
|
}: {
|
9
10
|
children: React.ReactNode,
|
11
|
+
includeMargin?: boolean,
|
10
12
|
fullHeight?: boolean,
|
11
13
|
className?: string
|
12
14
|
}) {
|
@@ -17,7 +19,9 @@ export function DialogContent({
|
|
17
19
|
</div>;
|
18
20
|
|
19
21
|
return <div
|
20
|
-
className={cls("
|
22
|
+
className={cls("h-full flex-grow",
|
23
|
+
{ "my-6 mx-6": includeMargin },
|
24
|
+
className)}>
|
21
25
|
{children}
|
22
26
|
</div>;
|
23
27
|
}
|
@@ -8,6 +8,7 @@ export type DialogContentProps = TypographyProps & {
|
|
8
8
|
children: React.ReactNode,
|
9
9
|
hidden?: boolean,
|
10
10
|
className?: string,
|
11
|
+
includeMargin?: boolean,
|
11
12
|
variant?: TypographyVariant
|
12
13
|
};
|
13
14
|
|
@@ -16,12 +17,15 @@ export function DialogTitle({
|
|
16
17
|
hidden,
|
17
18
|
className,
|
18
19
|
variant = "subtitle2",
|
20
|
+
gutterBottom = true,
|
21
|
+
includeMargin = true,
|
19
22
|
...props
|
20
23
|
}: DialogContentProps) {
|
21
24
|
|
22
25
|
const title = <DialogPrimitive.Title asChild>
|
23
26
|
<Typography variant={variant}
|
24
|
-
className={cls("mt-8
|
27
|
+
className={cls({ "mt-8 mx-6": includeMargin }, className)}
|
28
|
+
gutterBottom={gutterBottom}
|
25
29
|
{...props}>
|
26
30
|
{children}
|
27
31
|
</Typography>
|
@@ -1,3 +1,4 @@
|
|
1
|
+
"use client";
|
1
2
|
import React from "react";
|
2
3
|
import { cls } from "../util";
|
3
4
|
|
@@ -61,6 +62,5 @@ const IconButtonInner = <C extends React.ElementType = "button">({
|
|
61
62
|
</Component>
|
62
63
|
);
|
63
64
|
};
|
64
|
-
// React.ForwardRefRenderFunction<HTMLButtonElement, IconButtonProps<C>>
|
65
65
|
|
66
66
|
export const IconButton = React.forwardRef(IconButtonInner as React.ForwardRefRenderFunction<HTMLButtonElement, IconButtonProps<any>>) as React.ComponentType<IconButtonProps<any>>;
|
package/src/components/Label.tsx
CHANGED
package/src/components/Menu.tsx
CHANGED
@@ -16,6 +16,7 @@ import { SelectInputLabel } from "./common/SelectInputLabel";
|
|
16
16
|
export type SelectProps = {
|
17
17
|
open?: boolean,
|
18
18
|
name?: string,
|
19
|
+
fullWidth?: boolean,
|
19
20
|
id?: string,
|
20
21
|
onOpenChange?: (open: boolean) => void,
|
21
22
|
value?: string,
|
@@ -41,6 +42,7 @@ export const Select = forwardRef<HTMLDivElement, SelectProps>(({
|
|
41
42
|
inputRef,
|
42
43
|
open,
|
43
44
|
name,
|
45
|
+
fullWidth = false,
|
44
46
|
id,
|
45
47
|
onOpenChange,
|
46
48
|
value,
|
@@ -105,14 +107,18 @@ export const Select = forwardRef<HTMLDivElement, SelectProps>(({
|
|
105
107
|
{
|
106
108
|
"min-h-[28px]": size === "small",
|
107
109
|
"min-h-[42px]": size === "medium",
|
108
|
-
"min-h-[64px]": size === "large"
|
110
|
+
"min-h-[64px]": size === "large",
|
111
|
+
"w-fit": !fullWidth,
|
112
|
+
"w-full": fullWidth
|
109
113
|
}
|
110
114
|
)}>
|
111
115
|
<SelectPrimitive.Trigger
|
112
116
|
ref={inputRef}
|
113
117
|
id={id}
|
114
|
-
|
115
|
-
|
118
|
+
asChild
|
119
|
+
>
|
120
|
+
<div className={cls(
|
121
|
+
"h-full",
|
116
122
|
padding ? {
|
117
123
|
"px-4": size === "large",
|
118
124
|
"px-3": size === "medium",
|
@@ -127,65 +133,66 @@ export const Select = forwardRef<HTMLDivElement, SelectProps>(({
|
|
127
133
|
{
|
128
134
|
"min-h-[28px]": size === "small",
|
129
135
|
"min-h-[42px]": size === "medium",
|
130
|
-
"min-h-[64px]": size === "large"
|
136
|
+
"min-h-[64px]": size === "large",
|
137
|
+
"w-full": fullWidth,
|
138
|
+
"w-fit": !fullWidth
|
131
139
|
},
|
132
140
|
inputClassName
|
133
141
|
)}>
|
142
|
+
<div
|
143
|
+
ref={ref}
|
144
|
+
className={cls(
|
145
|
+
"flex-grow max-w-full flex flex-row gap-2 items-center",
|
146
|
+
"overflow-visible",
|
147
|
+
{
|
148
|
+
"min-h-[28px]": size === "small",
|
149
|
+
"min-h-[42px]": size === "medium",
|
150
|
+
"min-h-[64px]": size === "large"
|
151
|
+
}
|
152
|
+
)}>
|
153
|
+
<SelectPrimitive.Value
|
154
|
+
onClick={(e) => {
|
155
|
+
e.preventDefault();
|
156
|
+
e.stopPropagation();
|
157
|
+
}}
|
158
|
+
placeholder={placeholder}
|
159
|
+
className={"w-full"}>
|
160
|
+
{hasValue && value && renderValue ? renderValue(value) : placeholder}
|
161
|
+
{/*{hasValue && !renderValue && value}*/}
|
162
|
+
{hasValue && !renderValue && (() => {
|
134
163
|
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
"min-h-[28px]": size === "small",
|
142
|
-
"min-h-[42px]": size === "medium",
|
143
|
-
"min-h-[64px]": size === "large"
|
144
|
-
}
|
145
|
-
)}
|
146
|
-
>
|
147
|
-
<SelectPrimitive.Value
|
148
|
-
onClick={(e) => {
|
149
|
-
e.preventDefault();
|
150
|
-
e.stopPropagation();
|
151
|
-
}}
|
152
|
-
placeholder={placeholder}
|
153
|
-
className={"w-full"}>
|
154
|
-
{hasValue && value && renderValue ? renderValue(value) : placeholder}
|
155
|
-
{/*{hasValue && !renderValue && value}*/}
|
156
|
-
{hasValue && !renderValue && (() => {
|
164
|
+
// @ts-ignore
|
165
|
+
const childrenProps: SelectItemProps[] = Children.map(children, (child) => {
|
166
|
+
if (React.isValidElement(child)) {
|
167
|
+
return child.props;
|
168
|
+
}
|
169
|
+
}).filter(Boolean);
|
157
170
|
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
return child.props;
|
162
|
-
}
|
163
|
-
}).filter(Boolean);
|
171
|
+
const option = childrenProps.find((o) => o.value === value);
|
172
|
+
return option?.children;
|
173
|
+
})()}
|
164
174
|
|
165
|
-
|
166
|
-
|
167
|
-
})()}
|
175
|
+
</SelectPrimitive.Value>
|
176
|
+
</div>
|
168
177
|
|
169
|
-
|
178
|
+
{endAdornment && (
|
179
|
+
<div
|
180
|
+
className={cls("h-full flex items-center")}
|
181
|
+
onClick={(e) => {
|
182
|
+
e.preventDefault();
|
183
|
+
e.stopPropagation();
|
184
|
+
}}>
|
185
|
+
{endAdornment}
|
186
|
+
</div>
|
187
|
+
)}
|
188
|
+
<SelectPrimitive.Icon asChild>
|
189
|
+
<ExpandMoreIcon size={"medium"}
|
190
|
+
className={cls("transition", open ? "rotate-180" : "", {
|
191
|
+
"px-2": size === "large",
|
192
|
+
"px-1": size === "medium" || size === "small",
|
193
|
+
})}/>
|
194
|
+
</SelectPrimitive.Icon>
|
170
195
|
</div>
|
171
|
-
|
172
|
-
{endAdornment && (
|
173
|
-
<div
|
174
|
-
className={cls("h-full flex items-center")}
|
175
|
-
onClick={(e) => {
|
176
|
-
e.preventDefault();
|
177
|
-
e.stopPropagation();
|
178
|
-
}}>
|
179
|
-
{endAdornment}
|
180
|
-
</div>
|
181
|
-
)}
|
182
|
-
<SelectPrimitive.Icon asChild>
|
183
|
-
<ExpandMoreIcon size={"medium"}
|
184
|
-
className={cls("transition", open ? "rotate-180" : "", {
|
185
|
-
"px-2": size === "large",
|
186
|
-
"px-1": size === "medium" || size === "small",
|
187
|
-
})}/>
|
188
|
-
</SelectPrimitive.Icon>
|
189
196
|
</SelectPrimitive.Trigger>
|
190
197
|
|
191
198
|
</div>
|
package/src/components/Tabs.tsx
CHANGED
@@ -53,8 +53,6 @@ export function Tab({
|
|
53
53
|
: cls("text-surface-accent-700 dark:text-surface-accent-300",
|
54
54
|
"data-[state=active]:text-surface-accent-900 data-[state=active]:dark:text-white",
|
55
55
|
"hover:text-surface-accent-800 dark:hover:text-surface-accent-200"),
|
56
|
-
// disabled ? "text-surface-accent-400 dark:text-surface-accent-500" : "data-[state=active]:text-primary",
|
57
|
-
// "data-[state=active]:bg-surface-accent-50 data-[state=active]:dark:bg-surface-accent-800",
|
58
56
|
className)}>
|
59
57
|
<div className={cls("uppercase inline-block p-2 px-4 m-2 rounded",
|
60
58
|
"hover:bg-surface-accent-200 hover:bg-opacity-75 dark:hover:bg-surface-accent-800",
|