@firecms/ui 3.0.0-canary.50 → 3.0.0-canary.51
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/Label.d.ts +4 -1
- package/dist/components/TextField.d.ts +1 -1
- package/dist/index.es.js +14 -3
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Label.tsx +14 -3
- package/src/components/TextField.tsx +3 -2
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.51",
|
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
|
"src",
|
117
117
|
"tailwind.config.js"
|
118
118
|
],
|
119
|
-
"gitHead": "
|
119
|
+
"gitHead": "d4d30347803b07a09f5b003eb63c78e46eb055fa",
|
120
120
|
"publishConfig": {
|
121
121
|
"access": "public"
|
122
122
|
}
|
package/src/components/Label.tsx
CHANGED
@@ -3,13 +3,24 @@ import * as LabelPrimitive from "@radix-ui/react-label"
|
|
3
3
|
import { cn } from "../util";
|
4
4
|
import { defaultBorderMixin } from "../styles";
|
5
5
|
|
6
|
+
type LabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & {
|
7
|
+
border?: boolean,
|
8
|
+
onClick?: React.MouseEventHandler<HTMLLabelElement>
|
9
|
+
};
|
6
10
|
const Label = React.forwardRef<
|
7
11
|
React.ElementRef<typeof LabelPrimitive.Root>,
|
8
|
-
|
9
|
-
>(({
|
12
|
+
LabelProps
|
13
|
+
>(({
|
14
|
+
className,
|
15
|
+
...props
|
16
|
+
}, ref) => (
|
10
17
|
<LabelPrimitive.Root
|
11
18
|
ref={ref}
|
12
|
-
|
19
|
+
onClick={props.onClick}
|
20
|
+
className={cn("text-sm font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
21
|
+
props.border && "border border-gray-300 dark:border-gray-700 rounded-md px-3 py-1.5",
|
22
|
+
props.onClick && "hover:cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-800",
|
23
|
+
defaultBorderMixin, className)}
|
13
24
|
{...props}
|
14
25
|
/>
|
15
26
|
))
|
@@ -40,7 +40,7 @@ export type TextFieldProps<T extends string | number> = {
|
|
40
40
|
endAdornment?: React.ReactNode,
|
41
41
|
autoFocus?: boolean,
|
42
42
|
placeholder?: string,
|
43
|
-
size?: "small" | "medium",
|
43
|
+
size?: "smallest" | "small" | "medium",
|
44
44
|
className?: string,
|
45
45
|
style?: React.CSSProperties,
|
46
46
|
inputClassName?: string,
|
@@ -128,7 +128,7 @@ export function TextField<T extends string | number>({
|
|
128
128
|
"rounded-md",
|
129
129
|
invisible ? focusedInvisibleMixin : focusedMixin,
|
130
130
|
disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin,
|
131
|
-
size === "small" ? "min-h-[48px]" : "min-h-[64px]",
|
131
|
+
size === "smallest" ? "min-h-[32px]" : (size === "small" ? "min-h-[48px]" : "min-h-[64px]"),
|
132
132
|
label ? (size === "medium" ? "pt-[28px] pb-2" : "pt-4 pb-2") : "py-2",
|
133
133
|
focused ? "text-text-primary dark:text-text-primary-dark" : "",
|
134
134
|
endAdornment ? "pr-10" : "pr-3",
|
@@ -152,6 +152,7 @@ export function TextField<T extends string | number>({
|
|
152
152
|
disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin,
|
153
153
|
error ? "border border-red-500 dark:border-red-600" : "",
|
154
154
|
{
|
155
|
+
"min-h-[32px]": !invisible && size === "smallest",
|
155
156
|
"min-h-[48px]": !invisible && size === "small",
|
156
157
|
"min-h-[64px]": !invisible && size === "medium"
|
157
158
|
},
|