@react-fabric/form 1.0.0-beta.5 → 1.0.0-beta.52
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/{src/input/ArrayInput.module.css → css/_arrayInput.css} +8 -8
- package/css/_colorPicker.css +65 -0
- package/{src/internal/Field.module.css → css/_field.css} +64 -29
- package/{src/input/File.module.css → css/_file.css} +21 -6
- package/css/styles.css +27 -0
- package/dist/cjs/builder/FileField.js +37 -25
- package/dist/cjs/builder/FormField.js +50 -34
- package/dist/cjs/builder/SchemaEditor.js +72 -0
- package/dist/cjs/builder/components/AddSchemaFields.js +62 -0
- package/dist/cjs/builder/components/SchemaArrayForm.js +143 -0
- package/dist/cjs/builder/components/SchemaField.js +414 -0
- package/dist/cjs/form/Controller.js +46 -1
- package/dist/cjs/form/Form.js +43 -6
- package/dist/cjs/hooks/useFileUploader.js +16 -0
- package/dist/cjs/hooks/useFormBuilder.js +57 -15
- package/dist/cjs/i18n/ar.json.js +5 -4
- package/dist/cjs/i18n/en.json.js +5 -5
- package/dist/cjs/index.js +11 -2
- package/dist/cjs/input/ArrayInput.js +100 -33
- package/dist/cjs/input/AvatarInput.js +17 -8
- package/dist/cjs/input/Checkbox.js +15 -5
- package/dist/cjs/input/ColorInput.js +108 -56
- package/dist/cjs/input/ColorPicker.js +11 -35
- package/dist/cjs/input/DateInput.js +195 -0
- package/dist/cjs/input/Field.js +10 -4
- package/dist/cjs/input/File.js +14 -7
- package/dist/cjs/input/Hidden.js +11 -1
- package/dist/cjs/input/Input.js +19 -7
- package/dist/cjs/input/Number.js +17 -7
- package/dist/cjs/input/Password.js +16 -8
- package/dist/cjs/input/Radio.js +11 -2
- package/dist/cjs/input/RadioGroup.js +14 -3
- package/dist/cjs/input/{Range.js → RangeSlider.js} +14 -6
- package/dist/cjs/input/Search.js +25 -16
- package/dist/cjs/input/Slider.js +10 -4
- package/dist/cjs/input/Switch.js +39 -7
- package/dist/cjs/input/Textarea.js +23 -4
- package/dist/cjs/internal/ErrorIcon.js +1 -1
- package/dist/cjs/internal/FieldWrapper.js +11 -4
- package/dist/cjs/internal/InputWrapper.js +19 -16
- package/dist/cjs/select/AutoComplete.js +19 -8
- package/dist/cjs/select/DualList.js +15 -1
- package/dist/cjs/select/List.js +45 -20
- package/dist/cjs/select/Options.js +2 -2
- package/dist/cjs/select/Select.js +14 -4
- package/dist/cjs/select/useSelect.js +10 -6
- package/dist/cjs/types/schema.js +43 -0
- package/dist/cjs/utils/eventHandlers.js +11 -5
- package/dist/cjs/utils/getColor.js +6 -0
- package/dist/esm/builder/FileField.js +39 -27
- package/dist/esm/builder/FormField.js +50 -34
- package/dist/esm/builder/SchemaEditor.js +72 -0
- package/dist/esm/builder/components/AddSchemaFields.js +62 -0
- package/dist/esm/builder/components/SchemaArrayForm.js +143 -0
- package/dist/esm/builder/components/SchemaField.js +414 -0
- package/dist/esm/form/Controller.js +46 -1
- package/dist/esm/form/Form.js +43 -6
- package/dist/esm/hooks/useFileUploader.js +16 -0
- package/dist/esm/hooks/useFormBuilder.js +55 -13
- package/dist/esm/i18n/ar.json.js +5 -4
- package/dist/esm/i18n/en.json.js +5 -5
- package/dist/esm/index.js +5 -1
- package/dist/esm/input/ArrayInput.js +100 -33
- package/dist/esm/input/AvatarInput.js +17 -8
- package/dist/esm/input/Checkbox.js +15 -5
- package/dist/esm/input/ColorInput.js +110 -58
- package/dist/esm/input/ColorPicker.js +11 -35
- package/dist/esm/input/DateInput.js +195 -0
- package/dist/esm/input/Field.js +11 -5
- package/dist/esm/input/File.js +16 -9
- package/dist/esm/input/Hidden.js +11 -1
- package/dist/esm/input/Input.js +21 -9
- package/dist/esm/input/Number.js +19 -9
- package/dist/esm/input/Password.js +18 -10
- package/dist/esm/input/Radio.js +11 -2
- package/dist/esm/input/RadioGroup.js +15 -4
- package/dist/esm/input/{Range.js → RangeSlider.js} +14 -6
- package/dist/esm/input/Search.js +27 -18
- package/dist/esm/input/Slider.js +10 -4
- package/dist/esm/input/Switch.js +41 -9
- package/dist/esm/input/Textarea.js +24 -5
- package/dist/esm/internal/ErrorIcon.js +1 -1
- package/dist/esm/internal/FieldWrapper.js +11 -4
- package/dist/esm/internal/InputWrapper.js +19 -16
- package/dist/esm/select/AutoComplete.js +19 -8
- package/dist/esm/select/DualList.js +15 -1
- package/dist/esm/select/List.js +46 -21
- package/dist/esm/select/Options.js +2 -2
- package/dist/esm/select/Select.js +14 -4
- package/dist/esm/select/useSelect.js +11 -7
- package/{src/input/ColorPicker.module.css → dist/esm/types/schema.js} +18 -27
- package/dist/esm/utils/eventHandlers.js +11 -5
- package/dist/esm/utils/getColor.js +6 -1
- package/dist/types/builder/FileField.d.ts +4 -2
- package/dist/types/builder/FormField.d.ts +3 -1
- package/dist/types/builder/SchemaEditor.d.ts +9 -0
- package/dist/types/builder/components/AddSchemaFields.d.ts +2 -0
- package/dist/types/builder/components/SchemaArrayForm.d.ts +2 -0
- package/dist/types/builder/components/SchemaField.d.ts +10 -0
- package/dist/types/form/Controller.d.ts +47 -2
- package/dist/types/form/Form.d.ts +37 -2
- package/dist/types/hooks/useFileUploader.d.ts +16 -0
- package/dist/types/hooks/useFormBuilder.d.ts +32 -1
- package/dist/types/index.d.ts +5 -2
- package/dist/types/input/ArrayInput.d.ts +78 -6
- package/dist/types/input/AvatarInput.d.ts +14 -3
- package/dist/types/input/Checkbox.d.ts +13 -4
- package/dist/types/input/ColorInput.d.ts +15 -2
- package/dist/types/input/ColorPicker.d.ts +11 -1
- package/dist/types/input/DateInput.d.ts +28 -0
- package/dist/types/input/Field.d.ts +5 -1
- package/dist/types/input/File.d.ts +9 -0
- package/dist/types/input/Hidden.d.ts +8 -0
- package/dist/types/input/Input.d.ts +9 -1
- package/dist/types/input/Number.d.ts +9 -1
- package/dist/types/input/Password.d.ts +7 -1
- package/dist/types/input/Radio.d.ts +9 -1
- package/dist/types/input/RadioGroup.d.ts +26 -3
- package/dist/types/input/{Range.d.ts → RangeSlider.d.ts} +10 -2
- package/dist/types/input/Search.d.ts +14 -1
- package/dist/types/input/Slider.d.ts +7 -1
- package/dist/types/input/Switch.d.ts +16 -4
- package/dist/types/input/Textarea.d.ts +15 -1
- package/dist/types/internal/FieldWrapper.d.ts +1 -1
- package/dist/types/internal/InputWrapper.d.ts +1 -1
- package/dist/types/ranger/index.d.ts +2 -2
- package/dist/types/select/AutoComplete.d.ts +8 -1
- package/dist/types/select/DualList.d.ts +17 -2
- package/dist/types/select/List.d.ts +9 -1
- package/dist/types/select/Select.d.ts +9 -1
- package/dist/types/select/useSelect.d.ts +7 -6
- package/dist/types/types/index.d.ts +28 -7
- package/dist/types/types/schema.d.ts +78 -33
- package/dist/types/utils/eventHandlers.d.ts +1 -1
- package/package.json +15 -12
- package/src/builder/FileField.tsx +53 -27
- package/src/builder/FormField.tsx +52 -32
- package/src/builder/SchemaEditor.tsx +79 -0
- package/src/builder/components/AddSchemaFields.tsx +74 -0
- package/src/builder/components/SchemaArrayForm.tsx +158 -0
- package/src/builder/components/SchemaField.tsx +436 -0
- package/src/form/Controller.tsx +48 -3
- package/src/form/Form.tsx +45 -5
- package/src/hooks/useFileUploader.ts +16 -0
- package/src/hooks/useFormBuilder.tsx +58 -15
- package/src/i18n/ar.json +5 -4
- package/src/i18n/en.json +5 -5
- package/src/index.ts +11 -2
- package/src/input/ArrayInput.tsx +169 -54
- package/src/input/AvatarInput.tsx +20 -8
- package/src/input/Checkbox.tsx +15 -5
- package/src/input/ColorInput.tsx +126 -69
- package/src/input/ColorPicker.tsx +12 -36
- package/src/input/DateInput.tsx +259 -0
- package/src/input/Field.tsx +15 -11
- package/src/input/File.tsx +16 -14
- package/src/input/Hidden.tsx +12 -1
- package/src/input/Input.tsx +23 -10
- package/src/input/Number.tsx +18 -10
- package/src/input/Password.tsx +19 -12
- package/src/input/Radio.tsx +11 -2
- package/src/input/RadioGroup.tsx +35 -4
- package/src/input/{Range.tsx → RangeSlider.tsx} +13 -5
- package/src/input/Search.tsx +29 -19
- package/src/input/Slider.tsx +10 -4
- package/src/input/Switch.tsx +52 -7
- package/src/input/Textarea.tsx +29 -5
- package/src/internal/ErrorIcon.tsx +1 -1
- package/src/internal/FieldWrapper.tsx +8 -4
- package/src/internal/InputWrapper.tsx +36 -20
- package/src/select/AutoComplete.tsx +12 -1
- package/src/select/DualList.tsx +19 -0
- package/src/select/List.tsx +49 -8
- package/src/select/Options.tsx +1 -1
- package/src/select/Select.tsx +21 -3
- package/src/select/useSelect.tsx +13 -5
- package/src/types/index.ts +34 -8
- package/src/types/schema.ts +96 -41
- package/src/utils/eventHandlers.ts +9 -3
- package/dist/cjs/input/ArrayInput.module.css +0 -1
- package/dist/cjs/input/ColorPicker.module.css +0 -1
- package/dist/cjs/input/File.module.css +0 -1
- package/dist/cjs/internal/Field.module.css +0 -1
- package/dist/esm/input/ArrayInput.module.css +0 -1
- package/dist/esm/input/ColorPicker.module.css +0 -1
- package/dist/esm/input/File.module.css +0 -1
- package/dist/esm/internal/Field.module.css +0 -1
package/src/types/schema.ts
CHANGED
|
@@ -21,80 +21,135 @@
|
|
|
21
21
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
import { type Elements } from "@react-fabric/core/dist/types/types";
|
|
25
|
+
import { type DateLike } from "@react-fabric/date";
|
|
26
|
+
|
|
27
|
+
export enum DATA_TYPES {
|
|
28
|
+
TEXT = "text",
|
|
29
|
+
COLOR = "color",
|
|
30
|
+
BOOL = "bool",
|
|
31
|
+
DATE = "date",
|
|
32
|
+
DATETIME = "datetime",
|
|
33
|
+
STRING = "string",
|
|
34
|
+
NUMBER = "number",
|
|
35
|
+
RANGE = "range",
|
|
36
|
+
FILE = "file",
|
|
37
|
+
AVATAR = "avatar",
|
|
38
|
+
SCHEMA = "schema",
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const SCHEMA_CUSTOM_LIST = "--CUSTOM--";
|
|
42
|
+
|
|
43
|
+
interface SingleValue {
|
|
44
|
+
multiple?: false;
|
|
45
|
+
minItems?: never;
|
|
46
|
+
maxItems?: never;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface MultipleValue {
|
|
50
|
+
multiple: true;
|
|
51
|
+
minItems?: number;
|
|
52
|
+
maxItems?: number;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export type ValueType = SingleValue | MultipleValue;
|
|
56
|
+
|
|
57
|
+
interface BaseSchema {
|
|
25
58
|
id: string;
|
|
26
59
|
label: string;
|
|
27
60
|
datatype: string;
|
|
28
61
|
required?: boolean;
|
|
29
|
-
multiple?: boolean;
|
|
30
|
-
defaultValue?: AnyObject;
|
|
31
62
|
}
|
|
32
63
|
|
|
33
|
-
interface
|
|
34
|
-
datatype:
|
|
64
|
+
export interface DefaultSchema extends BaseSchema {
|
|
65
|
+
datatype: DATA_TYPES.TEXT | DATA_TYPES.COLOR;
|
|
35
66
|
}
|
|
36
67
|
|
|
37
|
-
interface BooleanSchema extends
|
|
38
|
-
datatype:
|
|
39
|
-
defaultValue?: boolean;
|
|
68
|
+
export interface BooleanSchema extends BaseSchema {
|
|
69
|
+
datatype: DATA_TYPES.BOOL;
|
|
40
70
|
}
|
|
41
71
|
|
|
42
|
-
interface StringSchema extends
|
|
43
|
-
datatype:
|
|
44
|
-
options?: string[];
|
|
72
|
+
export interface StringSchema extends BaseSchema {
|
|
73
|
+
datatype: DATA_TYPES.STRING;
|
|
45
74
|
regex?: string;
|
|
46
|
-
|
|
75
|
+
options?: string[];
|
|
76
|
+
optionList?: string;
|
|
77
|
+
allowCustom?: boolean;
|
|
47
78
|
}
|
|
48
79
|
|
|
49
|
-
interface RangeSchema extends
|
|
50
|
-
datatype:
|
|
80
|
+
export interface RangeSchema extends BaseSchema {
|
|
81
|
+
datatype: DATA_TYPES.RANGE;
|
|
51
82
|
min?: number;
|
|
52
83
|
max?: number;
|
|
53
84
|
step?: number;
|
|
54
|
-
defaultValue?: [number, number];
|
|
55
85
|
}
|
|
56
86
|
|
|
57
|
-
interface
|
|
58
|
-
datatype:
|
|
59
|
-
min?:
|
|
60
|
-
max?:
|
|
61
|
-
step?: number;
|
|
62
|
-
defaultValue?: number;
|
|
87
|
+
export interface DateSchema extends BaseSchema {
|
|
88
|
+
datatype: DATA_TYPES.DATE | DATA_TYPES.DATETIME;
|
|
89
|
+
min?: DateLike;
|
|
90
|
+
max?: DateLike;
|
|
63
91
|
}
|
|
64
92
|
|
|
65
|
-
interface
|
|
66
|
-
datatype:
|
|
93
|
+
export interface NumberSchema extends BaseSchema {
|
|
94
|
+
datatype: DATA_TYPES.NUMBER;
|
|
67
95
|
min?: number;
|
|
68
96
|
max?: number;
|
|
69
97
|
step?: number;
|
|
70
|
-
defaultValue?: number;
|
|
71
98
|
}
|
|
72
99
|
|
|
73
|
-
export interface FileSchema extends
|
|
74
|
-
datatype:
|
|
100
|
+
export interface FileSchema extends BaseSchema {
|
|
101
|
+
datatype: DATA_TYPES.FILE;
|
|
75
102
|
accept?: string;
|
|
76
103
|
}
|
|
77
104
|
|
|
78
|
-
export interface AvatarSchema extends
|
|
79
|
-
datatype:
|
|
105
|
+
export interface AvatarSchema extends BaseSchema {
|
|
106
|
+
datatype: DATA_TYPES.AVATAR;
|
|
80
107
|
multiple?: false;
|
|
81
108
|
}
|
|
82
109
|
|
|
83
110
|
export type SchemaType =
|
|
84
|
-
|
|
|
85
|
-
| BooleanSchema
|
|
86
|
-
| StringSchema
|
|
87
|
-
| RangeSchema
|
|
88
|
-
|
|
|
89
|
-
|
|
|
90
|
-
| FileSchema
|
|
91
|
-
| AvatarSchema;
|
|
92
|
-
|
|
93
|
-
export interface ChildSchema extends
|
|
94
|
-
datatype:
|
|
111
|
+
| (DefaultSchema & ValueType)
|
|
112
|
+
| (BooleanSchema & ValueType)
|
|
113
|
+
| (StringSchema & ValueType)
|
|
114
|
+
| (RangeSchema & ValueType)
|
|
115
|
+
| (DateSchema & ValueType)
|
|
116
|
+
| (NumberSchema & ValueType)
|
|
117
|
+
| (FileSchema & ValueType)
|
|
118
|
+
| (AvatarSchema & ValueType);
|
|
119
|
+
|
|
120
|
+
export interface ChildSchema extends BaseSchema {
|
|
121
|
+
datatype: DATA_TYPES.SCHEMA;
|
|
95
122
|
inline?: boolean;
|
|
96
123
|
schema: SchemaType[];
|
|
97
|
-
defaultValue?: never;
|
|
98
124
|
}
|
|
99
125
|
|
|
100
|
-
export type
|
|
126
|
+
export type SchemaDef = SchemaType | (ChildSchema & ValueType);
|
|
127
|
+
export type FormSchema = SchemaDef[];
|
|
128
|
+
|
|
129
|
+
export interface SchemaEditorProps {
|
|
130
|
+
/**
|
|
131
|
+
* default form schema
|
|
132
|
+
*/
|
|
133
|
+
schemaDef: FormSchema;
|
|
134
|
+
/**
|
|
135
|
+
* is dynamic schema (allow add/remove)
|
|
136
|
+
*/
|
|
137
|
+
dynamic?: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* acceptable list of data types
|
|
140
|
+
*/
|
|
141
|
+
acceptableTypes?: DATA_TYPES[];
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* available option lists in application
|
|
145
|
+
*/
|
|
146
|
+
optionLists?: string[];
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* footer actions
|
|
150
|
+
*/
|
|
151
|
+
children?: Elements<JSX.Element> | Array<Elements<JSX.Element>>;
|
|
152
|
+
|
|
153
|
+
onChange?: (schema: FormSchema) => void;
|
|
154
|
+
onSubmit?: (schema: FormSchema) => void;
|
|
155
|
+
}
|
|
@@ -23,19 +23,25 @@
|
|
|
23
23
|
|
|
24
24
|
/* istanbul ignore file */
|
|
25
25
|
|
|
26
|
-
import {
|
|
26
|
+
import { useFloatingTree } from "@floating-ui/react";
|
|
27
|
+
import { useDebounce } from "@react-fabric/core";
|
|
27
28
|
import { type KeyboardEvent, type MouseEvent } from "react";
|
|
28
29
|
|
|
29
30
|
/** ***************** common handler for enter press *******************/
|
|
30
|
-
export const
|
|
31
|
+
export const useHandleEnter = (
|
|
31
32
|
callback?: (e: KeyboardEvent) => void,
|
|
32
33
|
{
|
|
33
34
|
stopPropagation = false,
|
|
34
35
|
preventDefault = false,
|
|
35
36
|
}: { stopPropagation?: boolean; preventDefault?: boolean } = {},
|
|
36
37
|
) => {
|
|
37
|
-
const cbHandle =
|
|
38
|
+
const cbHandle = useDebounce(callback ?? (() => undefined), [callback], 100);
|
|
39
|
+
const tree = useFloatingTree();
|
|
38
40
|
return (e: KeyboardEvent) => {
|
|
41
|
+
// prevent propagation of event if input within dropdown (work around for floating-ui typeahead)
|
|
42
|
+
if (tree && e.key !== "Escape") {
|
|
43
|
+
e?.stopPropagation();
|
|
44
|
+
}
|
|
39
45
|
if (
|
|
40
46
|
!e.shiftKey &&
|
|
41
47
|
!e.altKey &&
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@layer var{.arrayInput{& [data-ref=fieldWrapper]{flex:1 1 0%}& .addButton :global(.buttonInner){color:theme(colors.tint.600);outline:1px dashed theme(colors.tint.600);&[data-invalid=true]{background-color:theme(colors.danger.100);color:theme(colors.danger.600);outline:1px dashed theme(colors.danger.600)}}}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@layer comp{.colorPicker{--color-shadow:theme(borderColor.base);& input{@apply bg-base text-base !border !border-solid !rounded-sm !border-base focus:!border-primary !shadow-none;line-height:2;padding:0 4px!important}& label{@apply !text-base}& :global(.flexbox-fix){@apply !border-t-muted justify-center;&>div>div{@apply text-center}& span>div{box-shadow:inset 0 0 1px 1px theme(borderColor.base)!important}}}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@layer comp{.fileInput{&::-webkit-file-upload-button{@apply bg-primary-500 opacity-80 hover:opacity-90 text-white rounded border-none py-0 cursor-pointer}&[aria-invalid=true]::-webkit-file-upload-button{@apply bg-danger-500}&:disabled::-webkit-file-upload-button{@apply bg-muted pointer-events-none}&[readOnly]{@apply pointer-events-none}}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@layer comp{}@layer var{.inputWrapper{&:after{inset-inline:50%;transition:all .3s;transition-delay:.1s}& .decorate:has([data-ref=button]){align-self:stretch;display:flex}&:has(input[disabled],textarea[disabled]){background-color:theme(colors.tint.50);cursor:not-allowed;& input,& textarea{cursor:not-allowed}}&:focus-within,&:has([data-open=true]){background-color:var(--fabric-input-focus);outline-color:var(--primary);z-index:1;&:not(:has([aria-readonly=true]:not([hidden]))):after{inset-inline:0}}&:global(.fixed){box-shadow:0 0 2rem .5rem var(--fabric-shadow)}& input,& textarea{max-width:100%}&>input[type=number]+.inputClear{margin-inline:-3rem 2rem}& input::-ms-clear,& select::-ms-clear,& textarea::-ms-clear{display:none}& input[type=search]::-webkit-search-cancel-button{display:none}& input[type=password]:not(:placeholder-shown){font-family:caption;letter-spacing:2px}& input:-webkit-autofill{box-shadow:0 0 0 999em var(--fabric-input) inset;-webkit-text-fill-color:theme(colors.accent.700)}& input:-webkit-autofill:focus{box-shadow:0 0 0 999em var(--fabric-input-focus) inset;-webkit-text-fill-color:theme(colors.accent.700)}&.invalidWrapper{outline-color:theme(colors.danger.500);&:after{background-color:theme(colors.danger.500)}}}.fieldGroup{>*{line-height:1}>:not(:first-child){&,&>[data-ref=button]>[role=button],&>[role=button],&>div{border-end-start-radius:0;border-start-start-radius:0}}>:not(:last-child){&,&>[data-ref=button]>[role=button],&>[role=button],&>div{border-end-end-radius:0;border-start-end-radius:0}}}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@layer var{.arrayInput{& [data-ref=fieldWrapper]{flex:1 1 0%}& .addButton :global(.buttonInner){color:theme(colors.tint.600);outline:1px dashed theme(colors.tint.600);&[data-invalid=true]{background-color:theme(colors.danger.100);color:theme(colors.danger.600);outline:1px dashed theme(colors.danger.600)}}}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@layer comp{.colorPicker{--color-shadow:theme(borderColor.base);& input{@apply bg-base text-base !border !border-solid !rounded-sm !border-base focus:!border-primary !shadow-none;line-height:2;padding:0 4px!important}& label{@apply !text-base}& :global(.flexbox-fix){@apply !border-t-muted justify-center;&>div>div{@apply text-center}& span>div{box-shadow:inset 0 0 1px 1px theme(borderColor.base)!important}}}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@layer comp{.fileInput{&::-webkit-file-upload-button{@apply bg-primary-500 opacity-80 hover:opacity-90 text-white rounded border-none py-0 cursor-pointer}&[aria-invalid=true]::-webkit-file-upload-button{@apply bg-danger-500}&:disabled::-webkit-file-upload-button{@apply bg-muted pointer-events-none}&[readOnly]{@apply pointer-events-none}}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@layer comp{}@layer var{.inputWrapper{&:after{inset-inline:50%;transition:all .3s;transition-delay:.1s}& .decorate:has([data-ref=button]){align-self:stretch;display:flex}&:has(input[disabled],textarea[disabled]){background-color:theme(colors.tint.50);cursor:not-allowed;& input,& textarea{cursor:not-allowed}}&:focus-within,&:has([data-open=true]){background-color:var(--fabric-input-focus);outline-color:var(--primary);z-index:1;&:not(:has([aria-readonly=true]:not([hidden]))):after{inset-inline:0}}&:global(.fixed){box-shadow:0 0 2rem .5rem var(--fabric-shadow)}& input,& textarea{max-width:100%}&>input[type=number]+.inputClear{margin-inline:-3rem 2rem}& input::-ms-clear,& select::-ms-clear,& textarea::-ms-clear{display:none}& input[type=search]::-webkit-search-cancel-button{display:none}& input[type=password]:not(:placeholder-shown){font-family:caption;letter-spacing:2px}& input:-webkit-autofill{box-shadow:0 0 0 999em var(--fabric-input) inset;-webkit-text-fill-color:theme(colors.accent.700)}& input:-webkit-autofill:focus{box-shadow:0 0 0 999em var(--fabric-input-focus) inset;-webkit-text-fill-color:theme(colors.accent.700)}&.invalidWrapper{outline-color:theme(colors.danger.500);&:after{background-color:theme(colors.danger.500)}}}.fieldGroup{>*{line-height:1}>:not(:first-child){&,&>[data-ref=button]>[role=button],&>[role=button],&>div{border-end-start-radius:0;border-start-start-radius:0}}>:not(:last-child){&,&>[data-ref=button]>[role=button],&>[role=button],&>div{border-end-end-radius:0;border-start-end-radius:0}}}}
|