@react-fabric/form 1.0.0-beta.45 → 1.0.0-beta.47
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/css/_field.css +38 -14
- package/dist/cjs/form/Form.js +1 -1
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/input/ArrayInput.js +27 -10
- package/dist/cjs/input/ColorInput.js +23 -31
- package/dist/cjs/input/DateInput.js +1 -1
- package/dist/cjs/input/Field.js +1 -0
- package/dist/cjs/input/File.js +1 -1
- package/dist/cjs/input/Input.js +5 -3
- package/dist/cjs/input/Number.js +1 -1
- package/dist/cjs/input/Password.js +1 -1
- package/dist/cjs/input/RangeSlider.js +2 -2
- package/dist/cjs/input/Search.js +1 -1
- package/dist/cjs/input/Slider.js +2 -2
- package/dist/cjs/input/Textarea.js +1 -1
- package/dist/cjs/internal/InputWrapper.js +2 -2
- package/dist/cjs/select/useSelect.js +1 -1
- package/dist/esm/form/Form.js +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/input/ArrayInput.js +24 -7
- package/dist/esm/input/ColorInput.js +23 -31
- package/dist/esm/input/DateInput.js +1 -1
- package/dist/esm/input/Field.js +1 -0
- package/dist/esm/input/File.js +1 -1
- package/dist/esm/input/Input.js +5 -3
- package/dist/esm/input/Number.js +1 -1
- package/dist/esm/input/Password.js +1 -1
- package/dist/esm/input/RangeSlider.js +2 -2
- package/dist/esm/input/Search.js +1 -1
- package/dist/esm/input/Slider.js +2 -2
- package/dist/esm/input/Textarea.js +1 -1
- package/dist/esm/internal/InputWrapper.js +2 -2
- package/dist/esm/select/useSelect.js +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/input/ArrayInput.d.ts +20 -4
- package/dist/types/input/ColorInput.d.ts +1 -1
- package/dist/types/input/Input.d.ts +1 -1
- package/dist/types/types/index.d.ts +1 -0
- package/package.json +5 -5
- package/src/form/Form.tsx +1 -1
- package/src/index.ts +1 -0
- package/src/input/ArrayInput.tsx +50 -12
- package/src/input/ColorInput.tsx +13 -42
- package/src/input/DateInput.tsx +1 -1
- package/src/input/Field.tsx +1 -0
- package/src/input/File.tsx +1 -1
- package/src/input/Input.tsx +7 -2
- package/src/input/Number.tsx +1 -1
- package/src/input/Password.tsx +1 -1
- package/src/input/RangeSlider.tsx +2 -2
- package/src/input/Search.tsx +1 -1
- package/src/input/Slider.tsx +2 -2
- package/src/input/Textarea.tsx +1 -1
- package/src/internal/InputWrapper.tsx +6 -3
- package/src/select/useSelect.tsx +1 -0
- package/src/types/index.ts +2 -0
package/src/input/Field.tsx
CHANGED
package/src/input/File.tsx
CHANGED
package/src/input/Input.tsx
CHANGED
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
import { InputWrapper } from "../internal/InputWrapper";
|
|
34
34
|
import { type InputProps } from "../types";
|
|
35
35
|
import { handleEnter } from "../utils";
|
|
36
|
+
import classNames from "classnames";
|
|
36
37
|
|
|
37
38
|
export interface TextInputProps extends InputProps, RefProp<HTMLInputElement> {
|
|
38
39
|
/**
|
|
@@ -52,6 +53,7 @@ export const Input = ({
|
|
|
52
53
|
placeholder,
|
|
53
54
|
autoFocus,
|
|
54
55
|
error,
|
|
56
|
+
monospace,
|
|
55
57
|
type = "text",
|
|
56
58
|
onBlur,
|
|
57
59
|
onFocus,
|
|
@@ -82,7 +84,7 @@ export const Input = ({
|
|
|
82
84
|
|
|
83
85
|
return (
|
|
84
86
|
<InputWrapper
|
|
85
|
-
showClear={!!actualValue}
|
|
87
|
+
showClear={!!actualValue && !disabled && !readOnly}
|
|
86
88
|
onClear={handleChange}
|
|
87
89
|
invalid={invalid}
|
|
88
90
|
readOnly={readOnly}
|
|
@@ -92,7 +94,10 @@ export const Input = ({
|
|
|
92
94
|
{...rest}
|
|
93
95
|
>
|
|
94
96
|
<input
|
|
95
|
-
className=
|
|
97
|
+
className={classNames(
|
|
98
|
+
"appearance-none bg-transparent py-1 px-2 flex-1 border-none outline-none ring-0 peer",
|
|
99
|
+
monospace && "font-mono text-sm",
|
|
100
|
+
)}
|
|
96
101
|
aria-invalid={invalid}
|
|
97
102
|
aria-disabled={disabled}
|
|
98
103
|
aria-readonly={readOnly}
|
package/src/input/Number.tsx
CHANGED
package/src/input/Password.tsx
CHANGED
|
@@ -190,7 +190,7 @@ export const RangeSlider = ({
|
|
|
190
190
|
>
|
|
191
191
|
<div
|
|
192
192
|
className={classNames(
|
|
193
|
-
"flex-
|
|
193
|
+
"flex-1 order-3 flex items-center select-none z-0",
|
|
194
194
|
vertical && "flex-col w-8",
|
|
195
195
|
invalid ? "text-danger-500" : "text-primary-600",
|
|
196
196
|
)}
|
|
@@ -201,7 +201,7 @@ export const RangeSlider = ({
|
|
|
201
201
|
<div
|
|
202
202
|
ref={rangerInstance.trackElRef}
|
|
203
203
|
className={classNames(
|
|
204
|
-
"flex-
|
|
204
|
+
"flex-1 relative flex items-center",
|
|
205
205
|
vertical ? "my-2 w-8" : "mx-2 h-8",
|
|
206
206
|
)}
|
|
207
207
|
style={{ height: vertical ? height : undefined }}
|
package/src/input/Search.tsx
CHANGED
package/src/input/Slider.tsx
CHANGED
|
@@ -194,7 +194,7 @@ export const Slider = ({
|
|
|
194
194
|
>
|
|
195
195
|
<div
|
|
196
196
|
className={classNames(
|
|
197
|
-
"flex-
|
|
197
|
+
"flex-1 order-3 flex items-center select-none relative z-0",
|
|
198
198
|
vertical && "flex-col w-8",
|
|
199
199
|
invalid ? "text-danger-500" : "text-primary-600",
|
|
200
200
|
)}
|
|
@@ -205,7 +205,7 @@ export const Slider = ({
|
|
|
205
205
|
<div
|
|
206
206
|
ref={rangerInstance.trackElRef}
|
|
207
207
|
className={classNames(
|
|
208
|
-
"flex-
|
|
208
|
+
"flex-1 relative flex items-center",
|
|
209
209
|
vertical ? "my-2 w-8" : "mx-2 h-8",
|
|
210
210
|
)}
|
|
211
211
|
style={{ height: vertical ? height : undefined }}
|
package/src/input/Textarea.tsx
CHANGED
|
@@ -108,7 +108,7 @@ export const InputWrapper = ({
|
|
|
108
108
|
invalid && "fabric-invalidWrapper",
|
|
109
109
|
!noOutline &&
|
|
110
110
|
!noBorder &&
|
|
111
|
-
"bg-(--fabric-input) outline
|
|
111
|
+
"bg-(--fabric-input) outline overflow-hidden",
|
|
112
112
|
"flex flex-nowrap items-center flex-1",
|
|
113
113
|
textarea ? "rounded-capped group" : "rounded",
|
|
114
114
|
isExpanded
|
|
@@ -117,7 +117,7 @@ export const InputWrapper = ({
|
|
|
117
117
|
? "absolute inset-x-0"
|
|
118
118
|
: "relative",
|
|
119
119
|
!noOutline &&
|
|
120
|
-
"after:absolute after:bottom-0 after:h-
|
|
120
|
+
"after:absolute after:bottom-0 after:h-px after:bg-primary-500 after:mx-auto",
|
|
121
121
|
)}
|
|
122
122
|
onKeyDown={(e) =>
|
|
123
123
|
e.key === "Escape" &&
|
|
@@ -190,7 +190,10 @@ export const InputWrapper = ({
|
|
|
190
190
|
<Wrapper {...wrapperProps}>
|
|
191
191
|
<div
|
|
192
192
|
ref={elRef}
|
|
193
|
-
className=
|
|
193
|
+
className={classNames(
|
|
194
|
+
"relative min-h-8 flex flex-col flex-nowrap",
|
|
195
|
+
width ? "flex-auto" : "flex-1",
|
|
196
|
+
)}
|
|
194
197
|
style={{ width, flexBasis: width }}
|
|
195
198
|
>
|
|
196
199
|
{el}
|
package/src/select/useSelect.tsx
CHANGED