@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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@firecms/ui",
3
3
  "type": "module",
4
- "version": "3.0.0-canary.50",
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": "e5d125d95a0c858bbcc9a57acc1adb3b61c64f23",
119
+ "gitHead": "d4d30347803b07a09f5b003eb63c78e46eb055fa",
120
120
  "publishConfig": {
121
121
  "access": "public"
122
122
  }
@@ -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
- React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>
9
- >(({ className, ...props }, ref) => (
12
+ LabelProps
13
+ >(({
14
+ className,
15
+ ...props
16
+ }, ref) => (
10
17
  <LabelPrimitive.Root
11
18
  ref={ref}
12
- className={cn("text-sm font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70", defaultBorderMixin, className)}
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
  },