@firecms/ui 3.0.0-canary.205 → 3.0.0-canary.207

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.205",
4
+ "version": "3.0.0-canary.207",
5
5
  "description": "Awesome Firebase/Firestore-based headless open-source CMS",
6
6
  "funding": {
7
7
  "url": "https://github.com/sponsors/firecmsco"
@@ -115,7 +115,7 @@
115
115
  "index.css",
116
116
  "tailwind.config.js"
117
117
  ],
118
- "gitHead": "b3a2a795ce5eb7edc68efea5caa69b8d477901be",
118
+ "gitHead": "04f84602ba162577101f88759b0c56d429c73ff8",
119
119
  "publishConfig": {
120
120
  "access": "public"
121
121
  }
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import React, { useCallback, useEffect, useRef, forwardRef, ForwardedRef } from "react";
2
+ import React, { ForwardedRef, forwardRef, useEffect, useRef } from "react";
3
3
 
4
4
  import { TextareaAutosize } from "./TextareaAutosize";
5
5
  import {
@@ -33,7 +33,6 @@ export type TextFieldProps<T extends string | number> = {
33
33
  onChange?: (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
34
34
  label?: React.ReactNode;
35
35
  multiline?: boolean;
36
- rows?: number;
37
36
  disabled?: boolean;
38
37
  invisible?: boolean;
39
38
  error?: boolean;
@@ -46,6 +45,15 @@ export type TextFieldProps<T extends string | number> = {
46
45
  inputClassName?: string;
47
46
  inputStyle?: React.CSSProperties;
48
47
  inputRef?: React.ForwardedRef<any>;
48
+ /**
49
+ * Maximum number of rows to display.
50
+ */
51
+ maxRows?: number | string;
52
+ /**
53
+ * Minimum number of rows to display.
54
+ * @default 1
55
+ */
56
+ minRows?: number | string;
49
57
  } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size">;
50
58
 
51
59
  export const TextField = forwardRef<HTMLDivElement, TextFieldProps<string | number>>(
@@ -57,7 +65,8 @@ export const TextField = forwardRef<HTMLDivElement, TextFieldProps<string | numb
57
65
  type = "text",
58
66
  multiline = false,
59
67
  invisible,
60
- rows,
68
+ maxRows,
69
+ minRows,
61
70
  disabled,
62
71
  error,
63
72
  endAdornment,
@@ -101,7 +110,8 @@ export const TextField = forwardRef<HTMLDivElement, TextFieldProps<string | numb
101
110
  ref={inputRef}
102
111
  placeholder={focused || hasValue || !label ? placeholder : undefined}
103
112
  autoFocus={autoFocus}
104
- rows={rows}
113
+ minRows={minRows}
114
+ maxRows={maxRows}
105
115
  value={value ?? ""}
106
116
  onChange={onChange}
107
117
  style={inputStyle}