@firecms/ui 3.0.0-canary.231 → 3.0.0-canary.233
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/Select.d.ts +1 -2
- package/dist/index.es.js +26 -27
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +26 -27
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -2
- package/src/components/Button.tsx +1 -1
- package/src/components/LoadingButton.tsx +1 -1
- package/src/components/Select.tsx +26 -29
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@firecms/ui",
|
3
3
|
"type": "module",
|
4
|
-
"version": "3.0.0-canary.
|
4
|
+
"version": "3.0.0-canary.233",
|
5
5
|
"description": "Awesome Firebase/Firestore-based headless open-source CMS",
|
6
6
|
"funding": {
|
7
7
|
"url": "https://github.com/sponsors/firecmsco"
|
@@ -85,6 +85,7 @@
|
|
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
90
|
"@testing-library/react": "^16.2.0",
|
90
91
|
"@testing-library/user-event": "^14.6.1",
|
@@ -115,7 +116,7 @@
|
|
115
116
|
"index.css",
|
116
117
|
"tailwind.config.js"
|
117
118
|
],
|
118
|
-
"gitHead": "
|
119
|
+
"gitHead": "783647d996fe38fe8f0b162acc482a6008152e30",
|
119
120
|
"publishConfig": {
|
120
121
|
"access": "public"
|
121
122
|
}
|
@@ -50,7 +50,7 @@ const ButtonInner = React.forwardRef<
|
|
50
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,
|
51
51
|
"border border-transparent text-red-500 hover:text-red-500 hover:bg-red-500 hover:bg-opacity-10": variant === "text" && color === "error" && !disabled,
|
52
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,
|
53
|
+
"border border-transparent text-text-primary hover:text-text-primary hover:bg-surface-accent-200 dark:text-text-primary-dark dark:hover:text-text-primary-dark dark:hover:bg-surface-accent-700": variant === "text" && color === "neutral" && !disabled,
|
54
54
|
|
55
55
|
// Outlined Variants
|
56
56
|
"border border-primary text-primary hover:text-primary hover:bg-primary-bg": variant === "outlined" && color === "primary" && !disabled,
|
@@ -23,7 +23,7 @@ export function LoadingButton<P extends React.ElementType = "button">({
|
|
23
23
|
{...props}
|
24
24
|
>
|
25
25
|
{loading && (
|
26
|
-
<CircularProgress size={"small"}/>
|
26
|
+
<CircularProgress size={props.size === "small" ? "smallest" : "small"}/>
|
27
27
|
)}
|
28
28
|
{!loading && startIcon}
|
29
29
|
{children}
|
@@ -41,30 +41,30 @@ export type SelectProps<T extends SelectValue = string> = {
|
|
41
41
|
};
|
42
42
|
|
43
43
|
export const Select = forwardRef<HTMLDivElement, SelectProps>(({
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
44
|
+
inputRef,
|
45
|
+
open,
|
46
|
+
name,
|
47
|
+
fullWidth = false,
|
48
|
+
id,
|
49
|
+
onOpenChange,
|
50
|
+
value,
|
51
|
+
onChange,
|
52
|
+
onValueChange,
|
53
|
+
className,
|
54
|
+
inputClassName,
|
55
|
+
placeholder,
|
56
|
+
renderValue,
|
57
|
+
label,
|
58
|
+
size = "large",
|
59
|
+
error,
|
60
|
+
disabled,
|
61
|
+
padding = true,
|
62
|
+
position = "item-aligned",
|
63
|
+
endAdornment,
|
64
|
+
invisible,
|
65
|
+
children,
|
66
|
+
...props
|
67
|
+
}, ref) => {
|
68
68
|
|
69
69
|
const [openInternal, setOpenInternal] = useState(open ?? false);
|
70
70
|
|
@@ -77,7 +77,7 @@ export const Select = forwardRef<HTMLDivElement, SelectProps>(({
|
|
77
77
|
let typedValue: SelectValue = newValue;
|
78
78
|
if (newValue === "true") typedValue = true;
|
79
79
|
else if (newValue === "false") typedValue = false;
|
80
|
-
else if (!isNaN(Number(newValue)) && newValue.trim() !==
|
80
|
+
else if (!isNaN(Number(newValue)) && newValue.trim() !== '') typedValue = Number(newValue);
|
81
81
|
|
82
82
|
onValueChange?.(typedValue as any);
|
83
83
|
if (onChange) {
|
@@ -228,15 +228,13 @@ export type SelectItemProps<T extends SelectValue = string> = {
|
|
228
228
|
children?: React.ReactNode,
|
229
229
|
disabled?: boolean,
|
230
230
|
className?: string,
|
231
|
-
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void
|
232
231
|
};
|
233
232
|
|
234
233
|
export function SelectItem<T extends SelectValue = string>({
|
235
234
|
value,
|
236
235
|
children,
|
237
236
|
disabled,
|
238
|
-
className
|
239
|
-
onClick
|
237
|
+
className
|
240
238
|
}: SelectItemProps<T>) {
|
241
239
|
// Convert value to string for Radix UI
|
242
240
|
const stringValue = String(value);
|
@@ -245,7 +243,6 @@ export function SelectItem<T extends SelectValue = string>({
|
|
245
243
|
key={stringValue}
|
246
244
|
value={stringValue}
|
247
245
|
disabled={disabled}
|
248
|
-
onClick={onClick}
|
249
246
|
className={cls(
|
250
247
|
"w-full",
|
251
248
|
"relative flex items-center p-2 rounded-md text-sm text-surface-accent-700 dark:text-surface-accent-300",
|