@firecms/ui 3.0.0-canary.253 → 3.0.0-canary.255
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 -0
- package/dist/index.es.js +11 -6
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +11 -6
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
- package/src/components/BooleanSwitch.tsx +7 -3
- package/src/components/BooleanSwitchWithLabel.tsx +3 -3
- package/src/components/Select.tsx +3 -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-canary.
|
4
|
+
"version": "3.0.0-canary.255",
|
5
5
|
"description": "Awesome Firebase/Firestore-based headless open-source CMS",
|
6
6
|
"funding": {
|
7
7
|
"url": "https://github.com/sponsors/firecmsco"
|
@@ -116,7 +116,7 @@
|
|
116
116
|
"index.css",
|
117
117
|
"tailwind.config.js"
|
118
118
|
],
|
119
|
-
"gitHead": "
|
119
|
+
"gitHead": "320670c074735d9766907ebf28b44d9c20cb2bed",
|
120
120
|
"publishConfig": {
|
121
121
|
"access": "public"
|
122
122
|
}
|
@@ -41,7 +41,7 @@ export const BooleanSwitch = React.forwardRef(function BooleanSwitch({
|
|
41
41
|
}
|
42
42
|
}}
|
43
43
|
className={cls(
|
44
|
-
size === "small" ? "w-[38px] h-[22px] min-w-[38px] min-h-[22px]" : "w-[42px] h-[26px] min-w-[42px] min-h-[26px]",
|
44
|
+
size === "smallest" ? "w-[34px] h-[18px] min-w-[34px] min-h-[18px]" : size === "small" ? "w-[38px] h-[22px] min-w-[38px] min-h-[22px]" : "w-[42px] h-[26px] min-w-[42px] min-h-[26px]",
|
45
45
|
"outline-none rounded-full relative shadow-sm",
|
46
46
|
value ? (disabled
|
47
47
|
? "bg-white bg-opacity-54 dark:bg-surface-accent-950 border-surface-accent-100 dark:border-surface-accent-700 ring-1 ring-surface-accent-200 dark:ring-surface-accent-700"
|
@@ -58,8 +58,10 @@ export const BooleanSwitch = React.forwardRef(function BooleanSwitch({
|
|
58
58
|
{
|
59
59
|
"w-[21px] h-[10px]": size === "medium" || size === "large",
|
60
60
|
"w-[19px] h-[8px]": size === "small",
|
61
|
+
"w-[16px] h-[6px]": size === "smallest",
|
61
62
|
"translate-x-[10px]": size === "medium" || size === "large",
|
62
|
-
"translate-x-[9px]": size === "small"
|
63
|
+
"translate-x-[9px]": size === "small",
|
64
|
+
"translate-x-[8px]": size === "smallest"
|
63
65
|
}
|
64
66
|
)}
|
65
67
|
/>}
|
@@ -72,8 +74,10 @@ export const BooleanSwitch = React.forwardRef(function BooleanSwitch({
|
|
72
74
|
{
|
73
75
|
"w-[21px] h-[21px]": size === "medium" || size === "large",
|
74
76
|
"w-[19px] h-[19px]": size === "small",
|
77
|
+
"w-[16px] h-[16px]": size === "smallest",
|
75
78
|
[value ? "translate-x-[19px]" : "translate-x-[3px]"]: size === "medium" || size === "large",
|
76
|
-
[value ? "translate-x-[17px]" : "translate-x-[2px]"]: size === "small"
|
79
|
+
[value ? "translate-x-[17px]" : "translate-x-[2px]"]: size === "small",
|
80
|
+
[value ? "translate-x-[16px]" : "translate-x-[1px]"]: size === "smallest"
|
77
81
|
}
|
78
82
|
)}
|
79
83
|
/>}
|
@@ -73,8 +73,8 @@ export const BooleanSwitchWithLabel = function BooleanSwitchWithLabel({
|
|
73
73
|
"min-h-[42px]": size === "medium",
|
74
74
|
"min-h-[64px]": size === "large",
|
75
75
|
},
|
76
|
-
size === "small" ? "pl-2" : "pl-4",
|
77
|
-
size === "small" ? "pr-4" : "pr-6",
|
76
|
+
size === "small" || size === "smallest" ? "pl-2" : "pl-4",
|
77
|
+
size === "small" || size === "smallest" ? "pr-4" : "pr-6",
|
78
78
|
position === "end" ? "flex-row-reverse" : "flex-row",
|
79
79
|
fullWidth ? "w-full" : "",
|
80
80
|
className
|
@@ -103,7 +103,7 @@ export const BooleanSwitchWithLabel = function BooleanSwitchWithLabel({
|
|
103
103
|
<div className={cls(
|
104
104
|
"flex-grow",
|
105
105
|
position === "end" ? "mr-4" : "ml-4",
|
106
|
-
size === "small" ? "text-sm" : "text-base"
|
106
|
+
size === "small" || size === "smallest" ? "text-sm" : "text-base"
|
107
107
|
)}>
|
108
108
|
{label}
|
109
109
|
</div>
|
@@ -24,6 +24,7 @@ export type SelectProps<T extends SelectValue = string> = {
|
|
24
24
|
value?: T,
|
25
25
|
className?: string,
|
26
26
|
inputClassName?: string,
|
27
|
+
viewportClassName?: string,
|
27
28
|
onChange?: React.EventHandler<ChangeEvent<HTMLSelectElement>>,
|
28
29
|
onValueChange?: (updatedValue: T) => void,
|
29
30
|
placeholder?: React.ReactNode,
|
@@ -53,6 +54,7 @@ export const Select = forwardRef<HTMLDivElement, SelectProps>(({
|
|
53
54
|
onValueChange,
|
54
55
|
className,
|
55
56
|
inputClassName,
|
57
|
+
viewportClassName,
|
56
58
|
placeholder,
|
57
59
|
renderValue,
|
58
60
|
label,
|
@@ -216,7 +218,7 @@ export const Select = forwardRef<HTMLDivElement, SelectProps>(({
|
|
216
218
|
<SelectPrimitive.Portal>
|
217
219
|
<SelectPrimitive.Content position={position}
|
218
220
|
className={cls(focusedDisabled, "z-50 relative overflow-hidden border bg-white dark:bg-surface-900 p-2 rounded-lg", defaultBorderMixin)}>
|
219
|
-
<SelectPrimitive.Viewport className={"p-1"}
|
221
|
+
<SelectPrimitive.Viewport className={cls("p-1", viewportClassName)}
|
220
222
|
style={{ maxHeight: "var(--radix-select-content-available-height)" }}>
|
221
223
|
{children}
|
222
224
|
</SelectPrimitive.Viewport>
|